query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
Sets the current watching status to the specified name. | def watching=(name)
gateway_check
update_status(@status, name, nil, nil, nil, 3)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def competing=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 5)\n end",
"def listening=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 2)\n end",
"def set_status(val)\n self.status = val\n self\n end",
"def status=(value)\n ... | [
"0.6237716",
"0.6160209",
"0.6081324",
"0.57756966",
"0.5766619",
"0.5755497",
"0.5734069",
"0.5722514",
"0.5708228",
"0.57043225",
"0.56532204",
"0.5630378",
"0.55817467",
"0.5577651",
"0.5577651",
"0.5577372",
"0.5517312",
"0.55101407",
"0.5504092",
"0.54802066",
"0.5472376... | 0.85823715 | 0 |
Sets the currently online stream to the specified name and Twitch URL. | def stream(name, url)
gateway_check
update_status(@status, name, url)
name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream(name, url)\n gateway_check\n update_status(@idletime, name, url)\n name\n end",
"def update_stream(name, params={})\n stream = ::M2X::Client::Stream.new(@client, self, \"name\" => name)\n\n stream.update!(params)\n end",
"def set_stream\n @stream = current_user.stream\n... | [
"0.6523595",
"0.6038782",
"0.6007969",
"0.59999794",
"0.58787066",
"0.58787066",
"0.5828698",
"0.5828698",
"0.5828698",
"0.5828698",
"0.57894003",
"0.57769513",
"0.57327384",
"0.5632106",
"0.54159665",
"0.5352153",
"0.53197",
"0.5310819",
"0.52885216",
"0.5268746",
"0.526079"... | 0.64457554 | 1 |
Sets the currently competing status to the specified name. | def competing=(name)
gateway_check
update_status(@status, name, nil, nil, nil, 5)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watching=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 3)\n end",
"def set_status(val)\n self.status = val\n self\n end",
"def set_status\n self.status = 1\n end",
"def game=(name)\n gateway_check\n update_status(@status, name, nil)\n end"... | [
"0.6564305",
"0.63031274",
"0.62669027",
"0.6218116",
"0.609785",
"0.60911584",
"0.6074275",
"0.6072246",
"0.6011434",
"0.598891",
"0.5974829",
"0.59435505",
"0.59295654",
"0.59258413",
"0.5924069",
"0.59012246",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.5901... | 0.82807195 | 0 |
Sets status to online. | def online
gateway_check
update_status(:online, @activity, @streamurl)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_online_status\n self.online_status = \"offline\"\n end",
"def set_online_status(status)\n case status\n when :available, :online\n @notification_server.chg \"NLN\", 0\n when :busy\n @notification_server.chg \"BSY\", 0\n when :idle\n @notification_server.chg \"IDL\", 0\n ... | [
"0.8451545",
"0.7961447",
"0.7636506",
"0.7532946",
"0.7206101",
"0.7009379",
"0.700205",
"0.6955704",
"0.6879258",
"0.684575",
"0.67882293",
"0.6771992",
"0.673311",
"0.67199683",
"0.6675017",
"0.6621805",
"0.66055214",
"0.65308344",
"0.6511109",
"0.6511109",
"0.6486688",
... | 0.74428433 | 4 |
Sets status to idle. | def idle
gateway_check
update_status(:idle, @activity, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idle\n set_state :idle\n @start_time = nil\n end",
"def idle\n gateway_check\n update_status((Time.now.to_f * 1000), @game, nil)\n end",
"def idle\n return unless ready_to_idle?\n\n @idling = true\n\n imap.idle(@mailbox.idle_timeout, &idle_handler)\n ensure\n @idl... | [
"0.77936685",
"0.6972496",
"0.68180937",
"0.65688807",
"0.63946515",
"0.6357286",
"0.624753",
"0.6203768",
"0.61928236",
"0.614327",
"0.6133321",
"0.6114859",
"0.6022177",
"0.59964406",
"0.5974761",
"0.5971599",
"0.596172",
"0.59550965",
"0.5954162",
"0.5929523",
"0.59265023"... | 0.76704377 | 1 |
Sets the bot's status to DnD (red icon). | def dnd
gateway_check
update_status(:dnd, @activity, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_status(msg)\n response = \"DJ announcements: #{@dj_state ? 'enabled' : 'disabled'}\"\n\n if @dj_state\n response << \" DJ tweets: #{@dj_tweeting ? 'enabled' : 'disabled'}\"\n end\n\n msg.reply response\n end",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n upd... | [
"0.5709672",
"0.5703655",
"0.55529743",
"0.5505187",
"0.54807925",
"0.5456211",
"0.52762717",
"0.5274191",
"0.5269922",
"0.52650845",
"0.52071166",
"0.52052397",
"0.51922864",
"0.51752084",
"0.516386",
"0.51199967",
"0.50915986",
"0.5078657",
"0.5074455",
"0.50739443",
"0.506... | 0.58063143 | 0 |
Sets the bot's status to invisible (appears offline). | def invisible
gateway_check
update_status(:invisible, @activity, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def offline()\n set_status(\"OFFLINE\")\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def set_online_status\n self.online_status = \"offline\"\n end",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",... | [
"0.68732727",
"0.6253153",
"0.6155522",
"0.5891482",
"0.5834581",
"0.5754021",
"0.57037",
"0.5696002",
"0.5632243",
"0.5585356",
"0.557294",
"0.5570152",
"0.55527866",
"0.5546498",
"0.55411613",
"0.55411613",
"0.5503662",
"0.5503662",
"0.54908526",
"0.5463203",
"0.5454171",
... | 0.78919953 | 0 |
Sets debug mode. If debug mode is on, many things will be outputted to STDOUT. | def debug=(new_debug)
LOGGER.debug = new_debug
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def debug_mode=(debug_mode)\n ConsoleDisplay.debug = debug_mode\n end",
"def debug_mode\n @configuration[:debug_mode] = true\n end",
"def debug_mode=(flag)\r\n self.conf[:debug] = flag\r\n end",
"def debug!\n @client.debug_dev = STDOUT\n end",
"def debug=(_)\n Nitro.mode = ... | [
"0.8239631",
"0.8111475",
"0.7848723",
"0.77481574",
"0.7702652",
"0.76977915",
"0.7658898",
"0.7658224",
"0.76164687",
"0.7607557",
"0.7503489",
"0.74618787",
"0.74214375",
"0.74158823",
"0.7399364",
"0.71884894",
"0.71749",
"0.7164863",
"0.7125587",
"0.71206987",
"0.7089146... | 0.732655 | 16 |
Sets the logging mode | def mode=(new_mode)
LOGGER.mode = new_mode
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logging=(value)\n @logging = value ? true : false\n end",
"def logging_enabled=(value)\n @@logging_enabled = value\n end",
"def test_mode!\n @test_mode = true\n # Switch the default logger\n ::Fluent::Logger.open(::Fluent::Logger::TestLogger)\n end",
"def log_level=(val)... | [
"0.70555043",
"0.67728037",
"0.67487997",
"0.6737861",
"0.6694683",
"0.6575507",
"0.6504914",
"0.6463892",
"0.6455526",
"0.6379514",
"0.6379514",
"0.6379088",
"0.63767546",
"0.636815",
"0.63469726",
"0.6336211",
"0.6336211",
"0.6332319",
"0.6306417",
"0.62763315",
"0.6274712"... | 0.7741867 | 0 |
Prevents the READY packet from being printed regardless of debug mode. | def suppress_ready_debug
@prevent_ready = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blockdev?() end",
"def dump_pending\n end",
"def dump_pending\n end",
"def suppress; @write = false end",
"def maybe_print(message)\n is_status = message[\"payload\"].try(:[], \"message_type\") == \"read_status\"\n STDOUT.puts \"\\n#{message.to_yaml}\\n\" unless is_status\n end",
... | [
"0.56040066",
"0.5365612",
"0.5365612",
"0.53409",
"0.5231933",
"0.5206627",
"0.5200374",
"0.51980317",
"0.51980317",
"0.51706046",
"0.51706046",
"0.51291233",
"0.5127588",
"0.5122123",
"0.5114263",
"0.5072797",
"0.506431",
"0.5060526",
"0.5028076",
"0.5013429",
"0.50047904",... | 0.73851323 | 0 |
Add a user to the list of ignored users. Those users will be ignored in message events at event processing level. | def ignore_user(user)
@ignored_ids << user.resolve_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_user(user)\n self.users << user unless self.users.include?(user)\n end",
"def update_ignores\n @ignore_users |= WhitelistedUser.all.map(&:user_id)\n end",
"def add_user_ids(user_ids) # :nodoc:\n user_ids.each do |id|\n @context.add_user(:id => id) unless @context.users[id]... | [
"0.72495097",
"0.6920261",
"0.67893726",
"0.6752447",
"0.6710671",
"0.6366166",
"0.6366166",
"0.63495415",
"0.62881213",
"0.6199504",
"0.6164286",
"0.6164286",
"0.6117742",
"0.6079606",
"0.6074576",
"0.59940577",
"0.59710944",
"0.59380716",
"0.58957505",
"0.5882208",
"0.58468... | 0.76001734 | 0 |
Remove a user from the ignore list. | def unignore_user(user)
@ignored_ids.delete(user.resolve_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ignore_user(user)\n @ignored_ids << user.resolve_id\n end",
"def ignore_user(user)\n @ignored_ids << user.resolve_id\n end",
"def removeWorkingUser user\n @workingUsers.delete user\n end",
"def remove(user)\n if(self.isIn(user))\n @mysqlHelper.deleteDisConUser(user.getI, @... | [
"0.7124421",
"0.7124421",
"0.678656",
"0.65031415",
"0.64845306",
"0.6445111",
"0.6416952",
"0.6416617",
"0.62982816",
"0.6271644",
"0.6251797",
"0.61972123",
"0.6186429",
"0.61432314",
"0.61270356",
"0.6110375",
"0.6110375",
"0.60872054",
"0.60124785",
"0.59864354",
"0.59863... | 0.7673168 | 0 |
Checks whether a user is being ignored. | def ignored?(user)
@ignored_ids.include?(user.resolve_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enduser_ignored?\n true\n end",
"def ignore?\n @should_ignore\n end",
"def ignored?\n !!ignored\n end",
"def i_dont_own?(object)\n if(current_user.present? and object.user.present? and object.user.id.present? and (current_user.id == object.user.id))\n false\n else\n... | [
"0.7960408",
"0.6888111",
"0.6860321",
"0.6838355",
"0.68343896",
"0.67028886",
"0.6700272",
"0.66743845",
"0.65700126",
"0.6568097",
"0.6554485",
"0.6544706",
"0.65434754",
"0.6489275",
"0.6461445",
"0.64446515",
"0.6424585",
"0.6418858",
"0.6418317",
"0.63756204",
"0.634492... | 0.79722875 | 0 |
Dispatches an event to this bot. Called by the gateway connection handler used internally. | def dispatch(type, data)
handle_dispatch(type, data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call(event)\n client.send_message(queue_url: queue_url, message_body: event)\n end",
"def call(event)\n client.send_message(queue_url: queue_url, message_body: event)\n end",
"def send_event(event)\n @client.send_event(@klass.to_s, @id, event)\n self\n end",
"de... | [
"0.6827179",
"0.6827179",
"0.6307242",
"0.6190496",
"0.6117292",
"0.61035854",
"0.60860616",
"0.60807097",
"0.60442585",
"0.60355425",
"0.6023239",
"0.6005803",
"0.5994768",
"0.5989069",
"0.59779227",
"0.59429127",
"0.5922048",
"0.58963144",
"0.58795875",
"0.5819147",
"0.5806... | 0.0 | -1 |
Raises a heartbeat event. Called by the gateway connection handler used internally. | def raise_heartbeat_event
raise_event(HeartbeatEvent.new(self))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_heartbeat(_payload)\n send_packet(OPCODES[:HEARTBEAT], @session.seq)\n end",
"def handle_heartbeat_ack(_payload)\n @heartbeat_acked = true\n end",
"def poll_heartbeat_timeout\n now = Hastur::Util.timestamp\n delta = now - @last_heartbeat\n\n # perform hea... | [
"0.7392785",
"0.6951944",
"0.6945434",
"0.6934182",
"0.6844225",
"0.67835087",
"0.6558897",
"0.6490727",
"0.6415971",
"0.62849027",
"0.625128",
"0.62399256",
"0.6195762",
"0.6161104",
"0.61512244",
"0.61342454",
"0.6120736",
"0.6112991",
"0.61104536",
"0.603179",
"0.5851655",... | 0.82131034 | 0 |
Makes the bot leave any groups with no recipients remaining | def prune_empty_groups
@channels.each_value do |channel|
channel.leave_group if channel.group? && channel.recipients.empty?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_leave\n GroupMailer.group_leave\n end",
"def disown_all!\n self.groups.each do |group|\n self.disown!(group)\n end\n end",
"def leave(group)\n group_membership_ids.include? group.id\n groups.destroy(group)\n end",
"def delete_group_memberships_for_end_users\n self.group_me... | [
"0.6297581",
"0.62445325",
"0.6044387",
"0.59665316",
"0.588507",
"0.58644235",
"0.5847096",
"0.58466744",
"0.583669",
"0.582041",
"0.58101285",
"0.5782278",
"0.5781081",
"0.5780202",
"0.5775733",
"0.57469773",
"0.57240504",
"0.5694992",
"0.5690972",
"0.5666579",
"0.5661589",... | 0.70148003 | 0 |
Get all application commands. | def get_application_commands(server_id: nil)
resp = if server_id
API::Application.get_guild_commands(@token, profile.id, server_id)
else
API::Application.get_global_commands(@token, profile.id)
end
JSON.parse(resp).map do |command_data|
ApplicationCommand.new(command_data, self, server_id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end",
"def all_commands\n [client_commands, server_commands].flatten\n end",
"def list_commands\n puts template(:all, {\n app: File.basename(@app),\n\n cmds: ::WeatherSage::C... | [
"0.7503003",
"0.74731416",
"0.7411596",
"0.72424257",
"0.7220817",
"0.7174554",
"0.7140143",
"0.700237",
"0.6978414",
"0.6858803",
"0.67535424",
"0.6730534",
"0.67279255",
"0.67279255",
"0.67157304",
"0.6712434",
"0.66891",
"0.66485935",
"0.66239893",
"0.66227156",
"0.6610756... | 0.7699006 | 0 |
Get an application command by ID. | def get_application_command(command_id, server_id: nil)
resp = if server_id
API::Application.get_guild_command(@token, profile.id, server_id, command_id)
else
API::Application.get_global_command(@token, profile.id, command_id)
end
ApplicationCommand.new(JSON.parse(resp), self, server_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end",
"def app_by_id(id)\n get(\"/apps/#{id}\")\n end",
"def command(name)\n commands.find { |command| command.name == name.to_s }\n end",
"def get id\n... | [
"0.73590213",
"0.64247155",
"0.6362859",
"0.6346973",
"0.6345813",
"0.6258138",
"0.6243382",
"0.62079227",
"0.6093267",
"0.5981358",
"0.59109575",
"0.58858705",
"0.58858705",
"0.58858705",
"0.58473945",
"0.58238953",
"0.58137655",
"0.5751888",
"0.575023",
"0.574087",
"0.57311... | 0.76984763 | 0 |
Remove an application command from the commands registered with discord. | def delete_application_command(command_id, server_id: nil)
if server_id
API::Application.delete_guild_command(@token, profile.id, server_id, command_id)
else
API::Application.delete_global_command(@token, profile.id, command_id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n @bot.delete_application_command(@id, server_id: @server_id)\n end",
"def remove_command\n return if !has_manage_messages_permission?\n command.event.message.delete\n end",
"def unregister_commands\n Bot::Commands.delete_for self\n end",
"def remove_command(name... | [
"0.7376783",
"0.7259488",
"0.7099469",
"0.7004282",
"0.6860014",
"0.67703646",
"0.65656316",
"0.65062183",
"0.6474784",
"0.6474626",
"0.6402586",
"0.61848885",
"0.6147852",
"0.6028535",
"0.60203433",
"0.6004277",
"0.5973524",
"0.5967581",
"0.591945",
"0.59167707",
"0.58636105... | 0.6934519 | 4 |
Throws a useful exception if there's currently no gateway connection. | def gateway_check
raise "A gateway connection is necessary to call this method! You'll have to do it inside any event (e.g. `ready`) or after `bot.run :async`." unless connected?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gateway_check\n return if connected?\n\n raise \"A gateway connection is necessary to call this method! You'll have to do it inside any event (e.g. `ready`) or after `bot.run :async`.\"\n end",
"def gateway_error_code\n nil\n end",
"def gateway_error\n message\n ... | [
"0.7751847",
"0.65875864",
"0.6534818",
"0.651003",
"0.6309331",
"0.5974415",
"0.595532",
"0.5945726",
"0.57716304",
"0.5750861",
"0.57480955",
"0.566896",
"0.55939406",
"0.55939406",
"0.55601287",
"0.55475944",
"0.5541724",
"0.54064506",
"0.54039925",
"0.5363154",
"0.5354816... | 0.7690634 | 1 |
Logs a warning if there are servers which are still unavailable. e.g. due to a Discord outage or because the servers are large and taking a while to load. | def unavailable_servers_check
# Return unless there are servers that are unavailable.
return unless @unavailable_servers&.positive?
LOGGER.warn("#{@unavailable_servers} servers haven't been cached yet.")
LOGGER.warn('Servers may be unavailable due to an outage, or your bot is on very large servers that are taking a while to load.')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning_webmin\n unless @info[:processes].to_a.grep(/cpanel/i).empty?\n @warnings << \"Server likely to be running cPanel\"\n end\n end",
"def warning_plesk\n unless @info[:processes].to_a.grep(/psa/i).empty?\n @warnings << \"Server likely to be running Plesk\"\n end\n ... | [
"0.6361353",
"0.6191853",
"0.61414224",
"0.60870624",
"0.60433996",
"0.5995705",
"0.59831613",
"0.59126437",
"0.5882191",
"0.57987726",
"0.57576466",
"0.57331866",
"0.57167315",
"0.5689741",
"0.56821626",
"0.5672402",
"0.5661423",
"0.5656712",
"0.56450856",
"0.5639436",
"0.56... | 0.827108 | 0 |
Internal handler for PRESENCE_UPDATE | def update_presence(data)
# Friends list presences have no server ID so ignore these to not cause an error
return unless data['guild_id']
user_id = data['user']['id'].to_i
server_id = data['guild_id'].to_i
server = server(server_id)
return unless server
member_is_new = false
if server.member_cached?(user_id)
member = server.member(user_id)
else
# If the member is not cached yet, it means that it just came online from not being cached at all
# due to large_threshold. Fortunately, Discord sends the entire member object in this case, and
# not just a part of it - we can just cache this member directly
member = Member.new(data, server, self)
debug("Implicitly adding presence-obtained member #{user_id} to #{server_id} cache")
member_is_new = true
end
username = data['user']['username']
if username && !member_is_new # Don't set the username for newly-cached members
debug "Implicitly updating presence-obtained information for member #{user_id}"
member.update_username(username)
end
member.update_presence(data)
member.avatar_id = data['user']['avatar'] if data['user']['avatar']
server.cache_member(member)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_resume\n\n end",
"def update_resume\n\n end",
"def update\n\t\t# Left empty intentionally.\n\tend",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update\n \n e... | [
"0.61999214",
"0.61999214",
"0.6170997",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.60825586",
"0.6077589",
"0.60676974",
"0.60676974",
"0.60549814",
"0.60549814",
"0.60369676",
"0.60238826",
"0.6018666",
... | 0.0 | -1 |
Internal handler for VOICE_STATE_UPDATE | def update_voice_state(data)
@session_id = data['session_id']
server_id = data['guild_id'].to_i
server = server(server_id)
return unless server
user_id = data['user_id'].to_i
old_voice_state = server.voice_states[user_id]
old_channel_id = old_voice_state.voice_channel&.id if old_voice_state
server.update_voice_state(data)
existing_voice = @voices[server_id]
if user_id == @profile.id && existing_voice
new_channel_id = data['channel_id']
if new_channel_id
new_channel = channel(new_channel_id)
existing_voice.channel = new_channel
else
voice_destroy(server_id)
end
end
old_channel_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def voice_state_update(attributes = {}, &block)\n register_event(VoiceStateUpdateEvent, attributes, block)\n end",
"def update_voice_state(data)\n server_id = data['guild_id'].to_i\n server = server(server_id)\n return unless server\n\n server.update_voice_state(data)\n\n @sessio... | [
"0.66678077",
"0.6266998",
"0.6186738",
"0.6186738",
"0.6149403",
"0.61267304",
"0.60902643",
"0.6052997",
"0.60195696",
"0.59829587",
"0.5965124",
"0.595698",
"0.5882775",
"0.5864108",
"0.58582145",
"0.58407634",
"0.58398664",
"0.5775996",
"0.5771805",
"0.57627153",
"0.57622... | 0.6511533 | 1 |
Internal handler for VOICE_SERVER_UPDATE | def update_voice_server(data)
server_id = data['guild_id'].to_i
channel = @should_connect_to_voice[server_id]
debug("Voice server update received! chan: #{channel.inspect}")
return unless channel
@should_connect_to_voice.delete(server_id)
debug('Updating voice server!')
token = data['token']
endpoint = data['endpoint']
unless endpoint
debug('VOICE_SERVER_UPDATE sent with nil endpoint! Ignoring')
return
end
debug('Got data, now creating the bot.')
@voices[server_id] = Discordrb::Voice::VoiceBot.new(channel, self, token, @session_id, endpoint)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_server_update(ev)\n\t\tif(cookies_are_tasty(ev.client,ev.cookie))\n\t\t\tev.client.is_nice=true\n\t\t\tmunch_on(ev.cookie)\n\t\tend\n\t\tif(not ev.client.is_nice)\n\t\t\tpost_event UnauthorizedConnectionEvent.new(ev.src)\n\t\t\treturn\n\t\tend\n\t\tif(ev.build_date!=SUPPORTED_VERSION)\n\t\t\tclient.post_eve... | [
"0.7318484",
"0.6757797",
"0.6548655",
"0.6486446",
"0.6475725",
"0.6355513",
"0.63385504",
"0.6288361",
"0.6238096",
"0.6224254",
"0.62186927",
"0.6153474",
"0.61312884",
"0.61072624",
"0.6084803",
"0.60821885",
"0.60772467",
"0.60741854",
"0.6069963",
"0.6065875",
"0.606587... | 0.678757 | 1 |
Internal handler for CHANNEL_CREATE | def create_channel(data)
channel = data.is_a?(Discordrb::Channel) ? data : Channel.new(data, self)
server = channel.server
# Handle normal and private channels separately
if server
server.add_channel(channel)
@channels[channel.id] = channel
elsif channel.private?
@pm_channels[channel.recipient.id] = channel
elsif channel.group?
@channels[channel.id] = channel
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_create(attributes = {}, &block)\n register_event(ChannelCreateEvent, attributes, block)\n end",
"def create_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n server.channels ... | [
"0.7314882",
"0.71098524",
"0.7033836",
"0.6868919",
"0.681347",
"0.6757599",
"0.6727253",
"0.6645563",
"0.65945053",
"0.6563238",
"0.6563238",
"0.65439284",
"0.65344584",
"0.6502589",
"0.65021276",
"0.6493995",
"0.6493995",
"0.6492331",
"0.64906824",
"0.6485189",
"0.6481412"... | 0.7042559 | 2 |
Internal handler for CHANNEL_UPDATE | def update_channel(data)
channel = Channel.new(data, self)
old_channel = @channels[channel.id]
return unless old_channel
old_channel.update_from(channel)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n Channel.channels_to_update\n end",
"def update!(**args)\n @channel = args[:channel] if args.key?(:channel)\n end",
"def update_channel(data)\n channel = Channel.new(data, self)\n old_channel = @channels[channel.id]\n return unless old_channel\n old_channel.u... | [
"0.7691809",
"0.73157984",
"0.7256416",
"0.6996448",
"0.6993422",
"0.69134665",
"0.69134665",
"0.6874695",
"0.6865345",
"0.68566614",
"0.68542105",
"0.68542105",
"0.68155867",
"0.66716224",
"0.6664757",
"0.6655276",
"0.6610942",
"0.65946025",
"0.6572071",
"0.65672153",
"0.654... | 0.7251911 | 3 |
Internal handler for CHANNEL_DELETE | def delete_channel(data)
channel = Channel.new(data, self)
server = channel.server
# Handle normal and private channels separately
if server
@channels.delete(channel.id)
server.delete_channel(channel.id)
elsif channel.pm?
@pm_channels.delete(channel.recipient.id)
elsif channel.group?
@channels.delete(channel.id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n \n @channel = @channel || ChannelClass.find(params[:id])\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channel_classes_url, notice: '频道删除成功.' }\n format.json { head :no_content }\n end\n \n end",
"def destroy\n @chatty_crow_channel.destroy\n... | [
"0.7274665",
"0.7253049",
"0.7142875",
"0.709312",
"0.7065909",
"0.7039059",
"0.70167065",
"0.7006301",
"0.69271034",
"0.6921449",
"0.6920747",
"0.6920747",
"0.6898756",
"0.6886372",
"0.6883147",
"0.6870261",
"0.68574566",
"0.6840838",
"0.6840838",
"0.6813838",
"0.6800069",
... | 0.7207992 | 2 |
Internal handler for CHANNEL_RECIPIENT_ADD | def add_recipient(data)
channel_id = data['channel_id'].to_i
channel = self.channel(channel_id)
recipient_user = ensure_user(data['user'])
recipient = Recipient.new(recipient_user, channel, self)
channel.add_recipient(recipient)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def radioChannelAdd _obj, _args\n \"_obj radioChannelAdd _args;\" \n end",
"def add_message_reaction(data); end",
"def handle_incoming_invite(*args); false; end",
"def accept\n self.status = :accepted\n self.group.add_members(self.receiver, self.role, :was_invited, self.sender)\n self.save\... | [
"0.59188515",
"0.5910316",
"0.57202965",
"0.56902367",
"0.5667978",
"0.5640804",
"0.5635768",
"0.55883616",
"0.5489959",
"0.5487487",
"0.5483835",
"0.5474196",
"0.54579836",
"0.5457606",
"0.5451404",
"0.5431891",
"0.5422748",
"0.5416657",
"0.54128456",
"0.541247",
"0.5369983"... | 0.63274175 | 0 |
Internal handler for CHANNEL_RECIPIENT_REMOVE | def remove_recipient(data)
channel_id = data['channel_id'].to_i
channel = self.channel(channel_id)
recipient_user = ensure_user(data['user'])
recipient = Recipient.new(recipient_user, channel, self)
channel.remove_recipient(recipient)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def irc_part_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n if sender[:nick] == @nick then\n drop_channel arguments[:channel]\n else\n @channel_members[arguments[:channel]].delete sender[:nick]\n end\n #TODO what should we do if we are in ... | [
"0.67463094",
"0.66882",
"0.6494119",
"0.6476184",
"0.64005417",
"0.6232816",
"0.6104394",
"0.6089027",
"0.6069224",
"0.60441095",
"0.6012108",
"0.5985949",
"0.5978697",
"0.5976731",
"0.59377664",
"0.58905846",
"0.58905846",
"0.58563626",
"0.58173764",
"0.579825",
"0.5784963"... | 0.65926135 | 2 |
Internal handler for GUILD_MEMBER_ADD | def add_guild_member(data)
server_id = data['guild_id'].to_i
server = self.server(server_id)
member = Member.new(data, server, self)
server.add_member(member)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end",
"def add_member\n become_member = $browser.element(@selector).link(text: 'Become a Member')\n become_member.click if become_member.exist?\n\n add_new = $browser.element(@selector).link(text: 'Add N... | [
"0.6990879",
"0.6517435",
"0.63937503",
"0.6382706",
"0.6357182",
"0.6316856",
"0.6296525",
"0.6237053",
"0.619828",
"0.61930937",
"0.6181279",
"0.61642915",
"0.6146942",
"0.6142383",
"0.61372334",
"0.612659",
"0.610743",
"0.6082429",
"0.6075876",
"0.6058043",
"0.6053159",
... | 0.67713344 | 1 |
Internal handler for GUILD_MEMBER_UPDATE | def update_guild_member(data)
server_id = data['guild_id'].to_i
server = self.server(server_id)
member = server.member(data['user']['id'].to_i)
member.update_roles(data['roles'])
member.update_nick(data['nick'])
member.update_boosting_since(data['premium_since'])
member.update_communication_disabled_until(data['communication_disabled_until'])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n member = server.member(data['user']['id'].to_i)\n member.update_roles(data['roles'])\n member.update_nick(data['nick'])\n end",
"def update!(**args)\n @chat_id = args[:chat... | [
"0.686198",
"0.6295523",
"0.6295523",
"0.62874967",
"0.62874967",
"0.6120318",
"0.6106171",
"0.61046755",
"0.60249734",
"0.60185605",
"0.58947945",
"0.58920157",
"0.58920157",
"0.58077675",
"0.58077675",
"0.5753472",
"0.5750578",
"0.5750022",
"0.5727764",
"0.5727764",
"0.5702... | 0.6854867 | 1 |
Internal handler for GUILD_MEMBER_DELETE | def delete_guild_member(data)
server_id = data['guild_id'].to_i
server = self.server(server_id)
return unless server
user_id = data['user']['id'].to_i
server.delete_member(user_id)
rescue Discordrb::Errors::NoPermission
Discordrb::LOGGER.warn("delete_guild_member attempted to access a server for which the bot doesn't have permission! Not sure what happened here, ignoring")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n user_id = data['user']['id'].to_i\n server.delete_member(user_id)\n rescue Discordrb::Errors::NoPermission\n Discordrb::LOGGER.warn(\"delete_guild_member attempted to access a server ... | [
"0.68046767",
"0.66562814",
"0.6413304",
"0.63841766",
"0.6382879",
"0.6368897",
"0.6367947",
"0.63541365",
"0.63065517",
"0.62851495",
"0.6280644",
"0.6247861",
"0.6247861",
"0.62163174",
"0.6194904",
"0.61747086",
"0.61665314",
"0.6142755",
"0.612855",
"0.61100346",
"0.6100... | 0.67568505 | 1 |
Internal handler for GUILD_CREATE | def create_guild(data)
ensure_server(data, true)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_child\n nil\n end",
"def crew _args\n \"crew _args;\" \n end",
"def createMenu _obj, _args\n \"_obj createMenu _args;\" \n end",
"def host_child_new(host_name, pub_name, prefix, website, email)\n send_req({\n act: :host_child_new,\n pub_name: pub_name,\n ... | [
"0.6128622",
"0.5899525",
"0.5891158",
"0.58861685",
"0.5768698",
"0.56993145",
"0.5674157",
"0.56266534",
"0.56181115",
"0.56168574",
"0.56008",
"0.55963975",
"0.5591144",
"0.55399203",
"0.547829",
"0.54654324",
"0.544472",
"0.5438036",
"0.54375863",
"0.5391729",
"0.538545",... | 0.55182946 | 14 |
Internal handler for GUILD_UPDATE | def update_guild(data)
@servers[data['id'].to_i].update_data(data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_update; end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update\n ... | [
"0.623351",
"0.62005323",
"0.62005323",
"0.62005323",
"0.6191177",
"0.6037577",
"0.6037577",
"0.6036744",
"0.60331976",
"0.59629935",
"0.59279335",
"0.58606535",
"0.5816543",
"0.5816543",
"0.57478344",
"0.57478344",
"0.57396024",
"0.5732423",
"0.57224035",
"0.57224035",
"0.57... | 0.0 | -1 |
Internal handler for GUILD_DELETE | def delete_guild(data)
id = data['id'].to_i
@servers.delete(id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def child_post_delete_hook( key, object, parent_hash = nil )\n \n return object\n \n end",
"def destroy\n @condominium_child.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @child.destroy\n respond_to do |format... | [
"0.62881494",
"0.6238443",
"0.61743945",
"0.61639905",
"0.6120463",
"0.6096221",
"0.60895956",
"0.60895956",
"0.6085373",
"0.6080045",
"0.6080045",
"0.6077248",
"0.6077248",
"0.60456216",
"0.60021025",
"0.5979875",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59... | 0.0 | -1 |
Internal handler for GUILD_ROLE_UPDATE | def update_guild_role(data)
role_data = data['role']
server_id = data['guild_id'].to_i
server = @servers[server_id]
new_role = Role.new(role_data, self, server)
role_id = role_data['id'].to_i
old_role = server.roles.find { |r| r.id == role_id }
old_role.update_from(new_role)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n # this action is not provided for partyroles\n end",
"def update\n @user = User.find(params[:id])\n unless changing_his_own_role?(@user)\n User.update_all(params[:user], {:id => @user.id})\n # if @user.update_attribute(:role, params[:user][:role])\n # if @user.send(:attribu... | [
"0.6923584",
"0.6847488",
"0.6814899",
"0.67430526",
"0.6677443",
"0.6673432",
"0.6622177",
"0.661937",
"0.6526311",
"0.651197",
"0.650364",
"0.64796466",
"0.6464701",
"0.6447708",
"0.64433545",
"0.64316726",
"0.63907593",
"0.6352228",
"0.63425064",
"0.6328062",
"0.6317582",
... | 0.6409637 | 16 |
Internal handler for GUILD_ROLE_CREATE | def create_guild_role(data)
role_data = data['role']
server_id = data['guild_id'].to_i
server = @servers[server_id]
new_role = Role.new(role_data, self, server)
existing_role = server.role(new_role.id)
if existing_role
existing_role.update_from(new_role)
else
server.add_role(new_role)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n chef_server_rest.post(\"roles\", self)\n self\n end",
"def create\n Statements::CreateRole.new(context: self)\n end",
"def create_user_role\n if self.role.blank?\n id = Role.select{|role| role.role_type == $roles[:user]}.map(&:id)\n self.update_attributes(:rol... | [
"0.6872108",
"0.6832281",
"0.66914177",
"0.65840554",
"0.64816517",
"0.6438338",
"0.640479",
"0.6398303",
"0.6363379",
"0.6340463",
"0.62889224",
"0.6268303",
"0.6249968",
"0.6236322",
"0.62316823",
"0.6219937",
"0.62155324",
"0.6209823",
"0.6209662",
"0.6207588",
"0.62064195... | 0.6225007 | 15 |
Internal handler for GUILD_ROLE_DELETE | def delete_guild_role(data)
role_id = data['role_id'].to_i
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.delete_role(role_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @core_user_role.destroy\n respond_to do |format|\n format.html { redirect_to core_user_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if !grant_access(\"alter_roles\", current_user)\n head(403)\n end\n @role.destroy\n respond_to do |... | [
"0.7093062",
"0.7026739",
"0.69979346",
"0.692597",
"0.6889344",
"0.6880559",
"0.68731064",
"0.6859878",
"0.6854104",
"0.685093",
"0.6841487",
"0.68375427",
"0.67910445",
"0.67835605",
"0.6782425",
"0.6781933",
"0.6771251",
"0.67655987",
"0.67643267",
"0.67521256",
"0.6746558... | 0.6525349 | 61 |
Internal handler for GUILD_EMOJIS_UPDATE | def update_guild_emoji(data)
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.update_emoji_data(data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @custom_emoji = args[:custom_emoji] if args.key?(:custom_emoji)\n @unicode = args[:unicode] if args.key?(:unicode)\n end",
"def update!(**args)\n @custom_emoji = args[:custom_emoji] if args.key?(:custom_emoji)\n @unicode = args[:unicode] if args.ke... | [
"0.56084317",
"0.56084317",
"0.5572472",
"0.5572472",
"0.5488843",
"0.5470801",
"0.54296994",
"0.5419812",
"0.53795534",
"0.5320633",
"0.53203297",
"0.53073967",
"0.53021216",
"0.53021216",
"0.5289584",
"0.527835",
"0.5277607",
"0.5277607",
"0.521725",
"0.5200382",
"0.5190220... | 0.5712303 | 0 |
Internal handler for MESSAGE_CREATE | def create_message(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n create_message(params)\n end",
"def handle_create_message(message, obj, response)\n new_name = message[:name] || message[:hrn]\n msg_props = message.properties.merge({ hrn: new_name })\n\n obj.create(message[:type], msg_props, &lambda do |new_obj|\n begin\n response[:res_id]... | [
"0.7608997",
"0.72740674",
"0.72508687",
"0.71597725",
"0.700779",
"0.70005536",
"0.6999833",
"0.6973321",
"0.6876489",
"0.6790315",
"0.6767513",
"0.67096734",
"0.67086226",
"0.6704885",
"0.6682551",
"0.66669977",
"0.6662425",
"0.6656933",
"0.6654197",
"0.66455406",
"0.662587... | 0.80424803 | 0 |
Internal handler for TYPING_START | def start_typing(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_typing\n API::Channel.start_typing(@bot.token, @id)\n end",
"def begin_typing(&block)\n with_keyboard_focus do\n application.keyboard.when_element(:visible?) do\n yield application.keyboard if block_given?\n end\n end\n end",
"def set_typing\n ... | [
"0.6774777",
"0.64316434",
"0.62740463",
"0.60293543",
"0.58119667",
"0.5730701",
"0.56031734",
"0.5587063",
"0.55658495",
"0.5550916",
"0.54618156",
"0.5433956",
"0.5390404",
"0.5302332",
"0.5228392",
"0.5191063",
"0.5180171",
"0.51741457",
"0.5156803",
"0.51085836",
"0.5076... | 0.79771054 | 0 |
Internal handler for MESSAGE_UPDATE | def update_message(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updated(message)\n end",
"def update\n # find and update a specific message\n end",
"def update\n # find and update a specific message\n end",
"def update\n # find and update a specific message\n end",
"def update\n update_q(@message, message_params)\n end",
"def update!(**... | [
"0.80195963",
"0.7928072",
"0.7928072",
"0.78656393",
"0.7246278",
"0.7036213",
"0.7036213",
"0.6981093",
"0.69660515",
"0.69639397",
"0.6948467",
"0.6946392",
"0.6924613",
"0.6910506",
"0.6910506",
"0.6884319",
"0.6867026",
"0.6866507",
"0.6863477",
"0.6854968",
"0.6808966",... | 0.81659627 | 0 |
Internal handler for MESSAGE_DELETE | def delete_message(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n # delete a specific message\n end",
"def destroy\n # delete a specific message\n end",
"def destroy\n # delete a specific message\n end",
"def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end",
"def destroy\n get_message().delete\n end",
"def messagedelet... | [
"0.79247785",
"0.7870885",
"0.7825669",
"0.78194636",
"0.77664506",
"0.77519286",
"0.75718194",
"0.74972874",
"0.74636704",
"0.7311444",
"0.73051316",
"0.7284578",
"0.7276078",
"0.72565967",
"0.7245604",
"0.7238536",
"0.7228178",
"0.72203404",
"0.7219104",
"0.7218521",
"0.721... | 0.8421452 | 0 |
Internal handler for MESSAGE_REACTION_ADD | def add_message_reaction(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_add_reply( m, params )\n # lame auth check\n # TODO: need to get a look into new auth system\n\n name = params[:name].downcase\n reply = params[:reply].to_s\n\n # check whether good is in database\n# status( name, @stock )\n# if @inreg == false\n# m.reply( \"#{name} doe... | [
"0.5948839",
"0.5830207",
"0.5829463",
"0.5804491",
"0.5773326",
"0.5757889",
"0.56807",
"0.56807",
"0.56807",
"0.5650981",
"0.5587086",
"0.558463",
"0.554084",
"0.55269843",
"0.53942376",
"0.5393272",
"0.5343823",
"0.5343823",
"0.5341771",
"0.53301865",
"0.53294134",
"0.53... | 0.7244814 | 0 |
Internal handler for MESSAGE_REACTION_REMOVE | def remove_message_reaction(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_message(name)\n\t\tend",
"def remove_all_message_reactions(data); end",
"def delete_message(data); end",
"def delete_message(data); end",
"def supprimerMessage(indice)\r\n\t\t@lstMessages.delete(indice) if @lstMessages.has_key?(indice)\r\n\tend",
"def rm(msgid)\n req(\"rm\", \"\... | [
"0.667572",
"0.66230637",
"0.65286845",
"0.65286845",
"0.6337768",
"0.6328019",
"0.62162626",
"0.6173989",
"0.61100453",
"0.6093377",
"0.6093377",
"0.6093377",
"0.6093377",
"0.60772717",
"0.60767573",
"0.60597223",
"0.6043116",
"0.6020181",
"0.6011349",
"0.5953205",
"0.588943... | 0.77340853 | 0 |
Internal handler for MESSAGE_REACTION_REMOVE_ALL | def remove_all_message_reactions(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_message_reaction(data); end",
"def _remove_all_method\n :\"_remove_all_#{self[:name]}\"\n end",
"def _remove_all_method\n :\"_remove_all_#{self[:name]}\"\n end",
"def clean_all\n\t\t\t\t\t@messages = []\n\t\t\t\tend",
"def remove_all_method\n :\"remove_all_#{self... | [
"0.6820369",
"0.63740325",
"0.6334058",
"0.61254525",
"0.60393846",
"0.60378236",
"0.6013697",
"0.595617",
"0.59309286",
"0.57197124",
"0.5686392",
"0.56808877",
"0.56808877",
"0.56598544",
"0.56268114",
"0.5602594",
"0.5557516",
"0.5557114",
"0.5519992",
"0.55078614",
"0.549... | 0.72189426 | 0 |
Internal handler for GUILD_BAN_ADD | def add_user_ban(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def msg_BAN(source, args)\n return nil\n end",
"def addHandgunItem _obj, _args\n \"_obj addHandgunItem _args;\" \n end",
"def add1\n bp = bpn\n bp.add_list_item('Apollo13',actors,hanks)\nend",
"def ban\n ban = Ban.new\n ban.steamid = params[:id]\n ban.ts = params[:ts]\n ban.sign = par... | [
"0.6248805",
"0.5861954",
"0.5841996",
"0.56147",
"0.5592438",
"0.5532081",
"0.5479989",
"0.5458416",
"0.54517585",
"0.53584355",
"0.53584355",
"0.52599037",
"0.5245032",
"0.5242702",
"0.52190423",
"0.5216284",
"0.5204837",
"0.519241",
"0.5188778",
"0.5167934",
"0.5162251",
... | 0.7235239 | 0 |
Internal handler for GUILD_BAN_REMOVE | def remove_user_ban(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def removeHandgunItem _obj, _args\n \"_obj removeHandgunItem _args;\" \n end",
"def unban(jid,reason=nil,&blk)\n set_affiliation 'none', jid, reason, &blk\n end",
"def removeBackpack _args\n \"removeBackpack _args;\" \n end",
"def remove_guild_ban(guild_id, user_id, reason: nil)\n... | [
"0.6252262",
"0.6055566",
"0.6052344",
"0.5978838",
"0.5847075",
"0.5730595",
"0.5706117",
"0.5675428",
"0.5675428",
"0.56325006",
"0.5611945",
"0.5566859",
"0.5560829",
"0.5533284",
"0.5527187",
"0.55261475",
"0.55079025",
"0.54138607",
"0.54065526",
"0.53904724",
"0.5354227... | 0.7298363 | 0 |
Notifies everything there is to be notified that the connection is now ready | def notify_ready
# Make sure to raise the event
raise_event(ReadyEvent.new(self))
LOGGER.good 'Ready'
@gateway.notify_ready
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notify_ready\n notify(\"READY=1\")\n end",
"def notify_ready\n # Make sure to raise the event\n raise_event(ReadyEvent.new(self))\n LOGGER.good 'Ready'\n\n # Tell the run method that everything was successful\n @ws_success = true\n end",
"def send_ready_notification\n\n ... | [
"0.7469654",
"0.7238633",
"0.68915284",
"0.66748446",
"0.66688156",
"0.657193",
"0.65401155",
"0.65401155",
"0.64917785",
"0.648263",
"0.64756733",
"0.6474577",
"0.6430575",
"0.642331",
"0.6390488",
"0.63673353",
"0.636204",
"0.6355232",
"0.6355232",
"0.63443106",
"0.63255715... | 0.72069186 | 2 |
GET /tiendas_clientes GET /tiendas_clientes.json | def index
unless current_user.tiene_permiso_sobre? @cliente
redirect_to clientes_url, alert: 'No tienes los permisos necesarios.'
else
@tiendas_clientes = @cliente.tiendas_clientes
render layout: "dataTables"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n get_clientes\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def index\n @c... | [
"0.7446176",
"0.71840674",
"0.7053288",
"0.70309716",
"0.70309716",
"0.70309716",
"0.70309716",
"0.70276886",
"0.6857828",
"0.6833347",
"0.6812668",
"0.67595524",
"0.6737607",
"0.6732066",
"0.6704018",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.668234... | 0.60811085 | 72 |
GET /tiendas_clientes/1 GET /tiendas_clientes/1.json | def show
unless current_user.tiene_permiso_sobre? @tienda_cliente.cliente
redirect_to clientes_url, alert: 'No tienes los permisos necesarios para ver esa tienda.'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n get_clientes\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def find_client\n cliente = get_cliente(params[:id])\n\n respond_to do |format|\n format.jso... | [
"0.74022025",
"0.7126223",
"0.7027978",
"0.70100355",
"0.70100355",
"0.70100355",
"0.70100355",
"0.6962636",
"0.6891252",
"0.68833065",
"0.68600136",
"0.678503",
"0.67841595",
"0.67773056",
"0.67754275",
"0.6702336",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694... | 0.0 | -1 |
POST /tiendas_clientes POST /tiendas_clientes.json | def create
@tienda_cliente = @cliente.tiendas_clientes.build(tienda_cliente_params)
respond_to do |format|
if @tienda_cliente.save
format.html { redirect_to @tienda_cliente, notice: 'La tienda se creó exitosamente.' }
format.json { render :show, status: :created, location: @tienda_cliente }
else
format.html { render :new }
format.json { render json: @tienda_cliente.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n\n client = Cliente.new\n\n client.nombre = params[:nombre]\n client.cedula = params[:cedula]\n client.pagina = params[:pagina]\n\n client.dirrecion = params[:dirrecion]\n client.telefono = params[:telefono]\n \n client.sector = params[:sector]\n \n\n if client.save\n ... | [
"0.6540972",
"0.6527762",
"0.6494968",
"0.64197373",
"0.64039224",
"0.6350697",
"0.63330895",
"0.6303754",
"0.6212286",
"0.617808",
"0.6140775",
"0.61273205",
"0.6126304",
"0.61060154",
"0.6095872",
"0.6095872",
"0.6088495",
"0.6042369",
"0.6039275",
"0.6033399",
"0.60304296"... | 0.6701628 | 0 |
PATCH/PUT /tiendas_clientes/1 PATCH/PUT /tiendas_clientes/1.json | def update
respond_to do |format|
if @tienda_cliente.update(tienda_cliente_params)
format.html { redirect_to @tienda_cliente, notice: 'La tienda se actualizó exitosamente.' }
format.json { render :show, status: :ok, location: @tienda_cliente }
else
format.html { render :edit }
format.json { render json: @tienda_cliente.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'El cliente se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { r... | [
"0.67743903",
"0.66896874",
"0.6666911",
"0.66472733",
"0.6642194",
"0.6640146",
"0.6640146",
"0.66329837",
"0.6573523",
"0.6570198",
"0.6569454",
"0.6565012",
"0.65348125",
"0.6531919",
"0.65280366",
"0.649713",
"0.6496634",
"0.64622915",
"0.6458767",
"0.6430716",
"0.6396413... | 0.6552312 | 12 |
DELETE /tiendas_clientes/1 DELETE /tiendas_clientes/1.json | def destroy
cliente = @tienda_cliente.cliente
if @tienda_cliente.destroy
redirect_to cliente_tiendas_clientes_url(cliente), notice: 'La tienda se borró exitosamente.'
else
@tienda_cliente.update(activo: false)
redirect_to cliente_tiendas_clientes_url(cliente), notice: 'La tienda se ha desactivado.'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente excluído com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_t... | [
"0.7428273",
"0.74006814",
"0.7391989",
"0.7374213",
"0.73599035",
"0.7355573",
"0.73190874",
"0.73190874",
"0.73190874",
"0.73185486",
"0.73048204",
"0.7302532",
"0.7301637",
"0.7286137",
"0.72758675",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.72653... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_tienda_cliente
@tienda_cliente = TiendaCliente.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163821",
"0.6045432",
"0.5945441",
"0.5916224",
"0.58894575",
"0.5834073",
"0.57764685",
"0.5702474",
"0.5702474",
"0.5653258",
"0.56211996",
"0.54235053",
"0.5410683",
"0.5410683",
"0.5410683",
"0.53948104",
"0.5378064",
"0.5356684",
"0.53400385",
"0.53399503",
"0.533122... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def tienda_cliente_params
params.require(:tienda_cliente).permit(:nombre, :direccion, :telefono)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69811666",
"0.6782836",
"0.6747644",
"0.6742015",
"0.6735273",
"0.6593917",
"0.65037674",
"0.6498627",
"0.6482372",
"0.64795715",
"0.64566946",
"0.6439213",
"0.6380714",
"0.6378147",
"0.63657266",
"0.63206697",
"0.6300169",
"0.62992156",
"0.6295538",
"0.62943023",
"0.62915... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_playlist
@playlist = Playlist.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
GET /empresas GET /empresas.json | def index
@institucions = Institucion.search(params[:search], params[:page])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: ... | [
"0.7540952",
"0.7004249",
"0.69645905",
"0.6842314",
"0.67357254",
"0.66989076",
"0.66989076",
"0.66750306",
"0.6673944",
"0.6635433",
"0.6625087",
"0.661472",
"0.6610647",
"0.6604201",
"0.65969485",
"0.65890557",
"0.65890557",
"0.6578836",
"0.65713525",
"0.6562834",
"0.65517... | 0.0 | -1 |
GET /empresas/1 GET /empresas/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render j... | [
"0.7233606",
"0.6870134",
"0.6861099",
"0.6827971",
"0.6791959",
"0.6784153",
"0.66661274",
"0.6626827",
"0.660911",
"0.6591215",
"0.6589608",
"0.658852",
"0.65852696",
"0.6561057",
"0.65534",
"0.6548038",
"0.654691",
"0.65348655",
"0.6528294",
"0.6479397",
"0.64476657",
"0... | 0.0 | -1 |
POST /empresas POST /empresas.json | def create
@institucion = Institucion.new(institucion_params)
respond_to do |format|
if @institucion.save
format.html { redirect_to @institucion, notice: 'Empresa se ha creado correctamente.' }
format.json { render :show, status: :created, location: @institucion }
else
format.html { render :new }
format.json { render json: @institucion.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @empresas = Empresa.new(empresa_params)\n\n respond_to do |format|\n if @empresas.save\n format.html { redirect_to @empresas, notice: 'Empresa was successfully created.' }\n format.json { render :show, status: :created, location: @empresas }\n else\n format.html { ... | [
"0.682665",
"0.67328596",
"0.6690261",
"0.6681895",
"0.6662854",
"0.664385",
"0.66416675",
"0.66150993",
"0.6603925",
"0.65711516",
"0.65581477",
"0.6411651",
"0.64064705",
"0.63886887",
"0.6331809",
"0.62992203",
"0.6278001",
"0.62636393",
"0.6254142",
"0.62410516",
"0.62080... | 0.0 | -1 |
PATCH/PUT /empresas/1 PATCH/PUT /empresas/1.json | def update
respond_to do |format|
if @institucion.update(institucion_params)
format.html { redirect_to @institucion, notice: 'Empresa se ha actualizado correctamente.' }
format.json { render :show, status: :ok, location: @institucion }
else
format.html { render :edit }
format.json { render json: @institucion.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @emprego.update(emprego_params)\n format.html { redirect_to @emprego, notice: 'Emprego was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @empre... | [
"0.66764665",
"0.65188104",
"0.6391711",
"0.6382479",
"0.6380362",
"0.6371382",
"0.63382274",
"0.6328772",
"0.6308569",
"0.6303294",
"0.628924",
"0.6280263",
"0.6264173",
"0.6252227",
"0.6250315",
"0.6249257",
"0.62487775",
"0.6248056",
"0.6248056",
"0.62444293",
"0.6242012",... | 0.0 | -1 |
DELETE /empresas/1 DELETE /empresas/1.json | def destroy
@institucion.destroy
respond_to do |format|
format.html { redirect_to institucions_url, notice: 'Empresa se ha eliminado correctamente.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @emprego.destroy\n respond_to do |format|\n format.html { redirect_to empregos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado.destroy\n respond_to do |format|\n format.html { redirect_to empleados_url }\n format.json { head :no_co... | [
"0.7330137",
"0.71741563",
"0.7140429",
"0.7140429",
"0.7136313",
"0.7103863",
"0.7098734",
"0.70934683",
"0.7048201",
"0.704317",
"0.70406485",
"0.70400286",
"0.7030377",
"0.70247275",
"0.7015985",
"0.7011696",
"0.6998268",
"0.69949985",
"0.698613",
"0.69727796",
"0.69556814... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_institucion
@institucion = Institucion.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163821",
"0.6045432",
"0.5945441",
"0.5916224",
"0.58894575",
"0.5834073",
"0.57764685",
"0.5702474",
"0.5702474",
"0.5653258",
"0.56211996",
"0.54235053",
"0.5410683",
"0.5410683",
"0.5410683",
"0.53948104",
"0.5378064",
"0.5356684",
"0.53400385",
"0.53399503",
"0.533122... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def institucion_params
params.require(:institucion).permit(:cod, :nombre, :email, :direccion, :telefono)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69811666",
"0.6782836",
"0.6747644",
"0.6742015",
"0.6735273",
"0.6593917",
"0.65037674",
"0.6498627",
"0.6482372",
"0.64795715",
"0.64566946",
"0.6439213",
"0.6380714",
"0.6378147",
"0.63657266",
"0.63206697",
"0.6300169",
"0.62992156",
"0.6295538",
"0.62943023",
"0.62915... | 0.0 | -1 |
On lit la page | def page_reading
page = Nokogiri::HTML(open("https://coinmarketcap.com/all/views/all/"))
crypto_name_array = []
crypto_value_array = []
# on récupère
page.xpath('//tr/td[3]/div').each do |crypto|
crypto_name_array.push(crypto.text)
end
page.xpath('//tr/td[5]/div').each do |value|
crypto_value_array.push(value.text)
end
general_array = crypto_name_array.zip(crypto_value_array).map { |x, y| {x=>y.delete('$,').to_f}}
return general_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page_load; end",
"def set_page\n end",
"def landing() end",
"def loadHandi... | [
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.7017904",
"0.7001979",
"0.68669236",
"0.6735521",
"0.6669993",
"0.6664113",
"0.6635459",
"0.6630942",
"0.... | 0.0 | -1 |
=begin Converts double value to the text description. | def convertValue(theMoney)
if theMoney == nil
raise ArgumentError, "theMoney is nil"
end
intPart = theMoney.to_i
fractPart = ((theMoney - intPart) * NUM100).round
if @currency == Currency::PER1000.to_s
fractPart = ((theMoney - intPart) * NUM1000).round
end
return convert(intPart, fractPart);
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_double_value\n\t\tend",
"def double\n Util.from_bytes :double, value\n end",
"def descr_value\n @value.to_s\n end",
"def to_s\n \"Arete : Sommet1 = #{@sommet1}, Sommet2 = #{@sommet2}, estDouble? = #{@estDouble}\\n\"\n end",
"def price_as_string\n return \"$%.2f\" % @price.to_f ... | [
"0.68977493",
"0.6406998",
"0.63094735",
"0.6210827",
"0.6085217",
"0.6056762",
"0.6010243",
"0.600279",
"0.59242696",
"0.5902884",
"0.5870777",
"0.5775231",
"0.57740736",
"0.57701534",
"0.575007",
"0.57486796",
"0.57377857",
"0.5734188",
"0.5707793",
"0.57048637",
"0.5698591... | 0.0 | -1 |
hour specified hour minute specified minute second specified second interval how fast the second hand advances in real time. | def initialize(hour, minute, second, interval)
@hour = hour
@minute = minute
@second = second
@interval = interval
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rational_hour(seconds); end",
"def end_of_hour\n change(min: 59, sec: 59.999)\n end",
"def end_of_hour\n change(\n min: 59,\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"def setTime(hour, min, sec)\n setSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
... | [
"0.6709556",
"0.614363",
"0.61361176",
"0.6059917",
"0.6019283",
"0.595288",
"0.5921481",
"0.58988297",
"0.5897865",
"0.5841987",
"0.58183527",
"0.5814105",
"0.5794004",
"0.5792468",
"0.5790944",
"0.5736809",
"0.5736809",
"0.573235",
"0.5711035",
"0.5662243",
"0.5644958",
"... | 0.63010275 | 1 |
Ticks our clock for a specified number of turns. Our clock tick in real time according to the clock interval. | def wind_up(turns)
"Starting time: " + current time
turns.times do
sleep(@interval)
tick
end
"Finsh Time: " + current_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loop(num_ticks, tick_time)\n @tick_time = tick_time\n \n (0..num_ticks).each do |tick|\n time = java.lang.System.currentTimeMillis\n\n @tick = tick\n yield tick\n\n sleep_time = @tick_time - (java.lang.System.currentTimeMillis - time)\n java.lang.Thread.sleep(sleep_time) if sl... | [
"0.6269858",
"0.6123167",
"0.61206996",
"0.60446733",
"0.6033775",
"0.59440416",
"0.59239256",
"0.5890349",
"0.587527",
"0.5873299",
"0.5855315",
"0.58008254",
"0.5794506",
"0.5703314",
"0.56980896",
"0.56129986",
"0.5578223",
"0.5527699",
"0.55204713",
"0.548684",
"0.5460826... | 0.6106426 | 3 |
Tick will now increment the second value. | def tick
@second += 1
need_tock?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tick(seconds)\n\t\t@time += seconds\n\tend",
"def tick\n @time = next_time(true)\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = ... | [
"0.74979687",
"0.7196552",
"0.6778341",
"0.6573163",
"0.6482976",
"0.6482976",
"0.6482976",
"0.64382243",
"0.64003307",
"0.63891745",
"0.6322627",
"0.6154744",
"0.613554",
"0.6100395",
"0.60834646",
"0.6011973",
"0.6006825",
"0.5969938",
"0.5934505",
"0.5918612",
"0.5851342",... | 0.80126786 | 0 |
If the second value == 60, then it will commit a tock | def need_tock?
if @second == 60
@second = 0
tock
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tock\n @minute += 1\n end",
"def cheat\n if @score >= 60 and !@cheating and !@cheating_two\n @cheating = true\n @score -= 60\n end\n end",
"def bust?; value > 21; end",
"def checker\n @hash.each_pair do |key, value|\n @hash[key]=value+1\n if value>=@tresholds\n @h... | [
"0.6006742",
"0.589643",
"0.5762616",
"0.5616108",
"0.55299366",
"0.54519296",
"0.54220545",
"0.53642106",
"0.5345481",
"0.5308886",
"0.53062266",
"0.53051746",
"0.52411973",
"0.5233876",
"0.52265996",
"0.52211547",
"0.5210867",
"0.5197313",
"0.51950043",
"0.51905304",
"0.518... | 0.6561541 | 0 |
Increments the minute value. | def tock
@minute += 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def increment_time\n @now += 1.minute\n end",
"def advance_minutes(mins)\n self + (mins * 60)\n end",
"def minute\n set_function_and_argument(:minute, nil)\n end",
"def minute=(value)\n RangeValidator.validate \"DateGroupItem.minute\", 0, 59, value\n @minute = value\n ... | [
"0.7205509",
"0.71260184",
"0.6601368",
"0.65721387",
"0.65227187",
"0.63068146",
"0.6264998",
"0.625215",
"0.623022",
"0.623022",
"0.6229087",
"0.60351825",
"0.5974196",
"0.59446204",
"0.59301054",
"0.5906068",
"0.5895508",
"0.5895508",
"0.5892949",
"0.5737203",
"0.57295823"... | 0.6712835 | 2 |
If minute value == 60, then it will commit a ticktock | def need_tick_tock?
if @minute == 60
@minute = 0
tick_tock
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tock\n @minute += 1\n end",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\... | [
"0.7776418",
"0.7579251",
"0.7324939",
"0.68012846",
"0.64941674",
"0.6316363",
"0.6301563",
"0.615146",
"0.615146",
"0.6073975",
"0.59590167",
"0.5943216",
"0.593197",
"0.57048863",
"0.56690484",
"0.5656231",
"0.5656231",
"0.5656231",
"0.565457",
"0.5651588",
"0.5584626",
... | 0.8124774 | 0 |
Advances the hour. Minutes are set to 0 Seconds are set to 0. | def tick_tock
@hour += 1
@minute = 0
@second = 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def advance_hours(hours)\n self + (hours * 60 * 60)\n end",
"def succ\n next_hour = Hour.new(\"12 AM\")\n\n next_time = (@hour + 1) % 24\n next_hour.instance_eval { @hour = next_time }\n #puts \" succ called: next_hour is #{next_hour}, #{@hour}, #{next_time}\"\n next_hour\n end",
"def ... | [
"0.76520455",
"0.70104843",
"0.67804",
"0.6614284",
"0.6613331",
"0.6610804",
"0.65816593",
"0.6502101",
"0.6476486",
"0.6330718",
"0.6330718",
"0.62788576",
"0.6268018",
"0.6259763",
"0.6247819",
"0.62472886",
"0.6212615",
"0.6205877",
"0.61883897",
"0.6177508",
"0.61546403"... | 0.64058214 | 9 |
Not bad. Not bad at all. | def current_time
"#{hour}:#{minute}:#{second}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def big_bad; end",
"def probers; end",
"def missing?; end",
"def ignores; end",
"def used?; end",
"def missing; end",
"def ibu; end",
"def invalid; end",
"def awaken!\n\t\traise 'Not implemented'\n\tend",
"def anchored; end",
"def suivre; end",
"def silly_adjective; end"... | [
"0.72536653",
"0.71228844",
"0.6609639",
"0.64272684",
"0.6383401",
"0.63808966",
"0.6362311",
"0.6316181",
"0.6312514",
"0.63060623",
"0.6275413",
"0.62740827",
"0.6264205",
"0.6262579",
"0.6257702",
"0.6240493",
"0.6235666",
"0.62153274",
"0.6202587",
"0.61952",
"0.6181524"... | 0.0 | -1 |
5 Cases (1) First install, anything goes => OK (2) An old storage type was not set and the new_storage_type is :filesystem => OK (3) An old storage type was not set and the new_storage_type is :sql => NOT_OK (4) An old storage type was set and is not equal to the new storage type => NOT_OK (5) An old storage type was set and is equal to the new storage type => OK | def verify_storage_type_unchanged
if previous_run.nil? # case (1)
true
else
previous_value = previous_run['bookshelf']['storage_type']
current_value = (user_attrs['storage_type'] || 'filesystem').to_s
if previous_value.nil? && current_value == 'filesystem' # case (2)
true
elsif previous_value.nil? && current_value != 'filesystem' # case (3)
fail_with <<~EOM
Bookshelf's storage_type was previously the default of 'filesystem';
however the current configuration would result in a value of
'#{current_value}'. At this time it is not possible to change the
bookshelf storage_type post-installation.
Please set
bookshelf['storage_type'] = 'filesystem'
in /etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/#{ChefUtils::Dist::Server::SERVER}.rb or leave it unset.
EOM
elsif previous_value.to_s == current_value # case (5)
true
else # everything else is invalid, including case 4 above
fail_with <<~EOM
Bookshelf's storage_type was previously '#{previous_value}'; however
the current configuration would result in a value of '#{current_value}'.
At this time it is not possible to change the bookshelf storage_type post-installation.
Please set
bookshelf['storage_type'] = '#{previous_value}'
in /etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/#{ChefUtils::Dist::Server::SERVER}.rb
EOM
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_variation_storage_type\n cid = VirtualMonkey::Toolbox::determine_cloud_id(s_one)\n if cid == 232\n @storage_type = \"ros\"\n else\n pick = rand(100000) % 2\n if pick == 1\n @storage_type = \"ros\"\n else\n @storage_type = \"volu... | [
"0.68890625",
"0.6241801",
"0.59194773",
"0.5850532",
"0.5850532",
"0.5808165",
"0.57523435",
"0.57252544",
"0.5650731",
"0.5593707",
"0.5557879",
"0.5479037",
"0.5478838",
"0.5432302",
"0.54239285",
"0.54142946",
"0.54085827",
"0.5400725",
"0.53981584",
"0.5386897",
"0.53696... | 0.76222897 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_task
@task = Task.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163443",
"0.604317",
"0.5943409",
"0.59143174",
"0.5887026",
"0.58335453",
"0.57738566",
"0.5701527",
"0.5701527",
"0.56534666",
"0.5618685",
"0.54237175",
"0.5407991",
"0.5407991",
"0.5407991",
"0.5394463",
"0.5376582",
"0.5355932",
"0.53376216",
"0.5337122",
"0.5329516"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def task_params
params.require(:task).permit(:title, :content, :completed, :date_completed, :list_id,
list:[:name, :id, :user_id, :privacy, :description, :status])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Is +date+ included in the temporal expression. | def includes?(date)
@days.include?(date.day)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def includes?(date)\n false\n end",
"def explicit_date?(date)\n \t\t!(/(?<relative_date>#{EXISTING_PATTERNS[:explicit_dates]})/.match(date)).nil?\n \tend",
"def include?(date)\n unless date.instance_of?(Date)\n raise ArgumentError, \"Parameters must be of class Date\"\n end\n\n... | [
"0.7954536",
"0.74254596",
"0.7111029",
"0.7108957",
"0.7042194",
"0.6931208",
"0.6882395",
"0.6876057",
"0.6869571",
"0.6859489",
"0.6835791",
"0.6779143",
"0.6731515",
"0.66136134",
"0.6532193",
"0.6522187",
"0.6486998",
"0.6404552",
"0.6387765",
"0.6377243",
"0.6331364",
... | 0.684476 | 10 |
Human readable version of the temporal expression. | def inspect
"the day of the month is the " +
ordinal_list(@days)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n @expression.to_s\n end",
"def inspect\n \"#{time.strftime(\"%Y-%m-%d %H:%M:%S\")} #{period.abbreviation}\"\n end",
"def to_temporal_sexp\n Dumper.dump(self)\n end",
"def tir_f\n format_f(self.tir)\n end",
"def to_s\n return @exp\n end",
"def exp_text\n @exp... | [
"0.6368355",
"0.63165367",
"0.631618",
"0.6250106",
"0.61675483",
"0.6109238",
"0.60927266",
"0.6077167",
"0.59858847",
"0.59774345",
"0.59648234",
"0.5896879",
"0.5882015",
"0.5861977",
"0.5860485",
"0.58481055",
"0.5821307",
"0.5814742",
"0.5814547",
"0.58117825",
"0.580050... | 0.0 | -1 |
Encode the temporal expression into +codes+. | def encode(codes)
encode_list(codes, @days)
codes << encoding_token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encode(codes)\n encode_list(codes, @years)\n codes << encoding_token\n end",
"def encode(codes)\n encode_list(codes, @weeks)\n codes << encoding_token\n end",
"def encode\n @code = \"\"\n add_check_digit_and_ensure_even_digit_size\n 0.step(@encodable.size - 1, 2) do |i|\n... | [
"0.6798391",
"0.67676747",
"0.6424279",
"0.6258846",
"0.6153673",
"0.6051423",
"0.5778526",
"0.5778526",
"0.5729366",
"0.5700355",
"0.56043607",
"0.56033397",
"0.5588766",
"0.5533201",
"0.5488222",
"0.5450914",
"0.5442591",
"0.5410525",
"0.53952473",
"0.5386026",
"0.53570044"... | 0.73046476 | 0 |
POST /sessions POST /sessions.json | def create
user=ApiM8::Client::Account::Users.instance.login(params[:login], params[:password])
puts user.current_user
if user
session[:current_user_id]=user.id
redirect_to role_super_admin_dashboards_url, :notice => "Logged in as #{params[:login]}!"
else
flash[:danger] = 'Invalid email/password combination' # Not quite right!
render "new"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @session = SessionService.new(current_user).create_from_web! session_params\n\n respond_to do |format|\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created }\n end\n end",
"def post_params(... | [
"0.70373255",
"0.7007398",
"0.6930623",
"0.6902813",
"0.6752149",
"0.6736444",
"0.6726408",
"0.6619362",
"0.6601675",
"0.6594401",
"0.65655935",
"0.6541066",
"0.65188426",
"0.6512475",
"0.6509723",
"0.64883345",
"0.6485823",
"0.6464108",
"0.6461902",
"0.64483804",
"0.64408696... | 0.0 | -1 |
DELETE /sessions/1 DELETE /sessions/1.json | def destroy
sign_out
redirect_to login_url, alert: "Successfully logged out"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n ... | [
"0.7547095",
"0.7505047",
"0.74601185",
"0.7408997",
"0.7386861",
"0.7356258",
"0.7299738",
"0.72481555",
"0.7219981",
"0.7211935",
"0.7209504",
"0.7153417",
"0.7149718",
"0.7106548",
"0.7106548",
"0.7106548",
"0.7106548",
"0.7098076",
"0.7054706",
"0.70518315",
"0.7028367",
... | 0.0 | -1 |
Is this an "infinite" paginator | def infinite?
@count.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paginator; end",
"def paginated?\n false\n end",
"def paginate; false; end",
"def paginator=(_arg0); end",
"def paginate!\n paginated?? nil : page!(1)\n end",
"def paginated?\n current_page && current_page > 0\n end",
"def paginated?\n page_count > 1\n end",
"d... | [
"0.76346296",
"0.7188816",
"0.7165192",
"0.7015973",
"0.7010716",
"0.6958979",
"0.68820834",
"0.68741125",
"0.6809616",
"0.6730568",
"0.6706848",
"0.6696838",
"0.6685148",
"0.6625548",
"0.6611017",
"0.6597203",
"0.65867126",
"0.65758854",
"0.65721875",
"0.6534182",
"0.644101"... | 0.61497724 | 46 |
GET /thing_types GET /thing_types.json | def index
@thing_types = ThingType.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end",
"def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end",
"def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.ht... | [
"0.77523476",
"0.70706415",
"0.6908508",
"0.66675395",
"0.6655826",
"0.6577568",
"0.65704393",
"0.65353847",
"0.6500588",
"0.6479018",
"0.6475635",
"0.64227796",
"0.6385143",
"0.6375576",
"0.6360951",
"0.6337234",
"0.6300508",
"0.6299166",
"0.6293892",
"0.6274894",
"0.626127"... | 0.715947 | 1 |
GET /thing_types/1 GET /thing_types/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end",
"def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end",
"def index\n @th... | [
"0.73535776",
"0.7349672",
"0.68903476",
"0.6349735",
"0.63371956",
"0.63362056",
"0.632931",
"0.62958324",
"0.6260286",
"0.62339693",
"0.6182233",
"0.61668485",
"0.6151782",
"0.6129324",
"0.6118446",
"0.6093532",
"0.6080097",
"0.6009512",
"0.6005692",
"0.59963727",
"0.599037... | 0.0 | -1 |
POST /thing_types POST /thing_types.json | def create
@thing_type = ThingType.new(thing_type_params)
respond_to do |format|
if @thing_type.save
format.html { redirect_to @thing_type, notice: 'Thing type was successfully created.' }
format.json { render :show, status: :created, location: @thing_type }
else
format.html { render :new }
format.json { render json: @thing_type.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_params\n params.from_jsonapi.require(:type).permit(:name)\n end",
"def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end",
"def clothing_type_params\n params.require(:clothing_type).permit(:name)\n end",
"def thing_type_params\n params.require(:thing_typ... | [
"0.6508891",
"0.6320648",
"0.61794466",
"0.6159986",
"0.6116042",
"0.60842395",
"0.6062709",
"0.6006655",
"0.59865385",
"0.59825236",
"0.597014",
"0.595698",
"0.5864639",
"0.5772186",
"0.576734",
"0.5742168",
"0.5713445",
"0.56968474",
"0.5688395",
"0.5671396",
"0.5671396",
... | 0.6824022 | 0 |
PATCH/PUT /thing_types/1 PATCH/PUT /thing_types/1.json | def update
respond_to do |format|
if @thing_type.update(thing_type_params)
format.html { redirect_to @thing_type, notice: 'Thing type was successfully updated.' }
format.json { render :show, status: :ok, location: @thing_type }
else
format.html { render :edit }
format.json { render json: @thing_type.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @clothing_type.update(clothing_type_params)\n format.html { redirect_to @clothing_type, notice: 'Clothing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing_type }\n else\n format.html { render ... | [
"0.6670715",
"0.63565385",
"0.62737274",
"0.62680906",
"0.62027663",
"0.61963594",
"0.6146416",
"0.6131429",
"0.61234885",
"0.61108285",
"0.607953",
"0.6012331",
"0.60122883",
"0.5985591",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979754",
"0.597904... | 0.7190378 | 0 |
DELETE /thing_types/1 DELETE /thing_types/1.json | def destroy
@thing_type.destroy
respond_to do |format|
format.html { redirect_to thing_types_url, notice: 'Thing type was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @clothing_type.destroy\n respond_to do |format|\n format.html { redirect_to clothing_types_url, notice: 'Clothing type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type = Type.find(params[:id])\n @type.destroy\n\n respo... | [
"0.7085014",
"0.7023634",
"0.6995377",
"0.690573",
"0.690573",
"0.6840859",
"0.68237853",
"0.6813082",
"0.67557",
"0.67516804",
"0.6749158",
"0.6742377",
"0.6736162",
"0.6736045",
"0.6734368",
"0.6719228",
"0.67088735",
"0.6699809",
"0.6693963",
"0.66872084",
"0.668263",
"0... | 0.75017405 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_thing_type
@thing_type = ThingType.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def thing_type_params
params.require(:thing_type).permit(:name, :avatar)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
add a test db.execute("INSERT INTO tasks (task, due_date, completed) VALUES ('pay bills again', '9/4/17', 'false')") | def create_task (db, task, due_date, completed)
db.execute("INSERT INTO tasks (task, due_date, completed) VALUES (?, ?, ?)", [task, due_date, completed])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_task(db, task, date_needed, notes)\n db.execute(\"INSERT INTO list (task, date_needed, notes) VALUES (?, ?, ?)\", [task, date_needed, notes])\nend",
"def add_task(db, table_name, name, time, importance)\n\tdb.execute(\"INSERT INTO #{table_name} (task_name, task_time, importance) VALUES (?, ?, ?)\", [n... | [
"0.86859226",
"0.8082236",
"0.8040265",
"0.8022535",
"0.71406865",
"0.70912725",
"0.7056773",
"0.68811536",
"0.6844786",
"0.6838136",
"0.68121916",
"0.6774782",
"0.6772722",
"0.66671634",
"0.6625227",
"0.6621133",
"0.6615321",
"0.65995914",
"0.6586554",
"0.65757394",
"0.65748... | 0.8983653 | 0 |
Downloads historical prices using the YahooFinance gem. | def initialize(ticker, from_date, to_date)
@from_date = from_date
@to_date = to_date
# @raw_data = YahooFinance::get_historical_quotes(ticker, @from_date-Extra_Days, to_date).reverse
quote = get_quote(ticker)
@raw_data = transpose_reverse(quote)
convert_raw_data_strings!
# We will never have need of the extraneous dates so we trim here
@dates = trim_dates
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_historic_stock_data(ticker, date_from, date_to, frequency = \"1d\")\n url = \"https://query1.finance.yahoo.com/v7/finance/download/#{ticker}?period1=#{date_from.strftime(\"%s\")}&period2=#{date_to.strftime(\"%s\")}&interval=#{frequency}&events=history\"\n\n request = Typhoeus::Request.new(url)\n r... | [
"0.7207063",
"0.6724181",
"0.66878104",
"0.66245997",
"0.65237755",
"0.6413913",
"0.6313322",
"0.6294406",
"0.6293501",
"0.6293501",
"0.62682635",
"0.6252363",
"0.6178697",
"0.6169673",
"0.61425257",
"0.6113415",
"0.61125386",
"0.61097056",
"0.6092002",
"0.60838354",
"0.60778... | 0.0 | -1 |
Replace this with your real tests. | def test_aggregation
dta = Foci::Aggregators::DownloadTotalAggregator.new
parser = Foci::LogParser.new
fields = parser.parse_line('193.34.112.161 - - [06/May/2007:07:04:47 -0500] "GET /" 200 22600 "-" "-" dist.co... 25')
vhost = Vhost.find_by_host('dist.example.com')
assert_not_nil vhost
period = Period.find_by_name('Dec 2004')
assert_not_nil period
dta.process(vhost, period, fields)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testing\n # ...\n end",
"def __dummy_test__\n end",
"def tests; end",
"def tests; end",
"def spec; end",
"def spec; end",
"def self_test; end",
"def self_test; end",
"def test \n end",
"def test_0_dummy\n\t\tend",
"def test\n\n end",
"def test\n end",
"def test\n end"... | [
"0.7446459",
"0.6956364",
"0.69155836",
"0.69155836",
"0.6864151",
"0.6864151",
"0.66406286",
"0.66406286",
"0.66253287",
"0.6547665",
"0.6524571",
"0.6484549",
"0.6484549",
"0.6484549",
"0.6403847",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188"... | 0.0 | -1 |
require 'backports' gem install backports / array:rotate / ruby 1.8 | def memory_usage
`ps -o rss= -p #{Process.pid}`.to_i # in kilobytes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def converted_arrays; end",
"def rotate(arr)\n\nend",
"def instantiate_new_array\n<<<<<<< HEAD\n Array.new\nend",
"def rotate_array(array)\n array[1..-1] << array[0]\nend",
"def rotate_array(array)\narray[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]] \nend",
"def ... | [
"0.60965025",
"0.60379744",
"0.60223967",
"0.59507906",
"0.59231126",
"0.59180856",
"0.5883893",
"0.58836436",
"0.5883235",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
... | 0.0 | -1 |
check if puzzle solved. | def solved?
# pour toutes les pièces
(0..8).each { |i|
# la case est encore vide : solved = false
return false if @cases[i] == nil
# sinon, est-ce que les pièces matchent entre elles.
return false if not self.match?(i)
}
# sinon, ca match partout : le puzzle est résolu (solved) !
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solved?\n end",
"def solved?\n @solution != nil\n end",
"def solve\n\n #Loop until the puzzle is solved or until one\n #loop didn't change any values\n #--------------------------------------------------\n puzzle_check\n \n #If the puzzle wasn't solved, try one more time\n ... | [
"0.8040121",
"0.7899613",
"0.77969956",
"0.7770005",
"0.7699044",
"0.76792985",
"0.76619756",
"0.7654912",
"0.76367146",
"0.754697",
"0.7524984",
"0.7505174",
"0.73927504",
"0.736069",
"0.73512703",
"0.73334247",
"0.73215824",
"0.72496474",
"0.7147381",
"0.71325177",
"0.70878... | 0.8175004 | 0 |
0 > 1, 1 > 0 2 > 3, 3 > 2 ... | def opposite n
if n%2 == 0
return n+1
else
return n-1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution(a)\n if a.count >= 3\n distances = []\n last = nil\n (1...a.count - 1).each { |i|\n if a[i] > a[i - 1] and a[i] > a[i + 1]\n distances << i - last if last\n last = i\n end\n }\n puts distances.inspect\n \n... | [
"0.59299797",
"0.592578",
"0.58229417",
"0.578304",
"0.5769303",
"0.57264405",
"0.572091",
"0.5707745",
"0.5699283",
"0.5682707",
"0.566053",
"0.5631282",
"0.563103",
"0.56309247",
"0.56306064",
"0.56291914",
"0.55934346",
"0.5591577",
"0.55827373",
"0.55789196",
"0.55756795"... | 0.0 | -1 |
This method creates a new outgoing message. | def initialize(from, to, provider, message)
@from = from
@to = to
@provider = provider
@message = message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_outgoing_message(phone_number, body, message_id = nil, outgoing_count = nil)\n if phone_number.can_receive_email? && allow_email_gateway? &&\n (! allow_commercial_gateway? || prefer_email? )\n to = \"#{phone_number.number}@#{phone_number.provider_email}\"\n ... | [
"0.6863068",
"0.6395797",
"0.6387949",
"0.63805705",
"0.6282034",
"0.6275927",
"0.6275927",
"0.62690103",
"0.6263038",
"0.62115824",
"0.61757183",
"0.612014",
"0.6118242",
"0.603402",
"0.60270935",
"0.6020818",
"0.601037",
"0.59878224",
"0.59351647",
"0.59351647",
"0.59351647... | 0.0 | -1 |
This method sends an email message disguised as an SMS message. | def deliver
Mail.new(from: from, to: formatted_to, body: sanitized_message).deliver!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_sms!(msg)\n return false unless sms_alerts and phone_number_is_valid? and not mobile_carrier.blank?\n PersonMailer.send_sms(self, msg).deliver\n end",
"def send_sms(number, subject, carrier, message)\n SMSMailer.sms_mailer(number, subject, carrier, message).deliver_now\n end",
"def send... | [
"0.76776797",
"0.7592039",
"0.74998206",
"0.71865207",
"0.7096294",
"0.70588815",
"0.70246905",
"0.6962636",
"0.6950622",
"0.6894564",
"0.68856657",
"0.6871104",
"0.6825135",
"0.6818493",
"0.68159103",
"0.6803716",
"0.6798487",
"0.67855805",
"0.6771584",
"0.67590785",
"0.6698... | 0.0 | -1 |
This method formats the TO address to include the provider. | def formatted_to
"#{to}@#{Base.gateways[@provider][:sms]}" rescue raise "Invalid provider"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to\n @to ||= unquoted_address_header(:to)\n end",
"def to\n address_list_fetch('to')\n end",
"def stamp_to\n to = validate_to\n raise StanzaErrors::BadRequest.new(self, 'modify') unless to\n to.bare.tap do |bare|\n self['to'] = bare.to_s\n end\n end... | [
"0.6852653",
"0.64515",
"0.6396367",
"0.61574036",
"0.612608",
"0.61088604",
"0.6006481",
"0.60062873",
"0.5912349",
"0.5888783",
"0.5870044",
"0.58464557",
"0.58068854",
"0.58068854",
"0.5804907",
"0.58012307",
"0.5797022",
"0.57720786",
"0.5770777",
"0.57604456",
"0.5705903... | 0.7275079 | 0 |
This method sanitizes the message body. | def sanitized_message
message.to_s[0,140]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_body\n if @body && /\\b(?:html|xml)\\b/ =~ @type\n @body.scrub!\n end\n end",
"def sanitize\n scrub_payload_emails\n scrub_actor_attributes\n end",
"def cleanup_body(body)\n delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\\r\\n]+/).reject(&:bla... | [
"0.7031387",
"0.70212257",
"0.6961889",
"0.6948664",
"0.6917089",
"0.6835991",
"0.6805405",
"0.6748517",
"0.6724432",
"0.6719474",
"0.6689921",
"0.6673553",
"0.660771",
"0.65629137",
"0.6402586",
"0.6368258",
"0.6292628",
"0.6287936",
"0.62827325",
"0.62174624",
"0.6215756",
... | 0.7102011 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.