query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
def new method : get_all_dismantle_count | def get_all_dismantle_count
count = 0
groups = [$data_items, $data_armors, $data_weapons]
for group in groups
for obj in group
next if obj.nil?
count += obj.dismantle_counter
end # for
end # for
return count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count\n end",
"def count\n end",
"def counts\r\n @counts\r\n end",
"def count\n return @@all\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n @count\n end",... | [
"0.72181416",
"0.72181416",
"0.71026546",
"0.7082664",
"0.7011825",
"0.7011825",
"0.7011825",
"0.70047706",
"0.70047706",
"0.70047706",
"0.7000065",
"0.6999205",
"0.6957815",
"0.6957815",
"0.6934482",
"0.6910248",
"0.6892735",
"0.6853122",
"0.68384576",
"0.68384576",
"0.68384... | 0.7478532 | 0 |
GET /accession_location_entries/1 GET /accession_location_entries/1.json | def show
@accession_location_entry = AccessionLocationEntry.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @accession_location_entry }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locations\n get('locations')\n end",
"def get_location\n as_json(get_results('/locations.json'))\n end",
"def new\n @accession_location_entry = AccessionLocationEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @accession_location_entry }... | [
"0.65202993",
"0.64902353",
"0.64635515",
"0.6282157",
"0.6237028",
"0.6159012",
"0.61464167",
"0.6120498",
"0.6094246",
"0.6031871",
"0.60231113",
"0.6014338",
"0.5984254",
"0.59740543",
"0.5971812",
"0.59533226",
"0.5952472",
"0.5937841",
"0.59320223",
"0.59299326",
"0.5925... | 0.7180944 | 0 |
GET /accession_location_entries/new GET /accession_location_entries/new.json | def new
@accession_location_entry = AccessionLocationEntry.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @accession_location_entry }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @accession_location_entry = AccessionLocationEntry.new(params[:accession_location_entry])\n\n respond_to do |format|\n if @accession_location_entry.save\n format.html { redirect_to @accession_location_entry, notice: 'Accession location entry was successfully created.' }\n form... | [
"0.7206542",
"0.7106107",
"0.71039516",
"0.7068216",
"0.7063189",
"0.6962698",
"0.6962698",
"0.6962698",
"0.6962698",
"0.6962698",
"0.69202393",
"0.6903823",
"0.69018424",
"0.6899007",
"0.6899007",
"0.68906575",
"0.68439025",
"0.6823207",
"0.678212",
"0.67619354",
"0.6758749"... | 0.78341454 | 0 |
POST /accession_location_entries POST /accession_location_entries.json | def create
@accession_location_entry = AccessionLocationEntry.new(params[:accession_location_entry])
respond_to do |format|
if @accession_location_entry.save
format.html { redirect_to @accession_location_entry, notice: 'Accession location entry was successfully created.' }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postLocation( location_id, type, country, language, name, formal_name, resolution, population, description, timezone, latitude, longitude, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode, searchable_id, searchable_ids)\n params = Hash.new\n pa... | [
"0.6242699",
"0.5955907",
"0.58618236",
"0.57917845",
"0.5767019",
"0.5755245",
"0.5726805",
"0.5684456",
"0.56395006",
"0.5524876",
"0.54961795",
"0.54804873",
"0.54216635",
"0.54098195",
"0.53835875",
"0.53774047",
"0.53772527",
"0.53649586",
"0.53627306",
"0.53198624",
"0.... | 0.6858917 | 0 |
PUT /accession_location_entries/1 PUT /accession_location_entries/1.json | def update
@accession_location_entry = AccessionLocationEntry.find(params[:id])
respond_to do |format|
if @accession_location_entry.update_attributes(params[:accession_location_entry])
format.html { redirect_to @accession_location_entry, notice: 'Accession location entry was successfully updated.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_location(params)\n @client.put(\"#{path}/location\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end",
"def create\n @accession_location_entry = AccessionLocationEntry.new(params[:accessi... | [
"0.64269066",
"0.64180183",
"0.6282211",
"0.6180619",
"0.60750437",
"0.60668075",
"0.601699",
"0.6009725",
"0.59824437",
"0.5979467",
"0.59150267",
"0.5914181",
"0.5907044",
"0.58921933",
"0.58792233",
"0.5851517",
"0.5848158",
"0.5799227",
"0.57919824",
"0.57903355",
"0.5788... | 0.70068336 | 0 |
DELETE /accession_location_entries/1 DELETE /accession_location_entries/1.json | def destroy
@accession_location_entry = AccessionLocationEntry.find(params[:id])
@accession_location_entry.destroy
respond_to do |format|
format.html { redirect_to accession_location_entries_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Location.delete(params[\"id\"])\n end",
"def destroy\n @record = Location.find(params[:id])\n @record.trash\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @location = Location.find(params[:id])\r\n @location.destr... | [
"0.69462156",
"0.68298554",
"0.6684562",
"0.6682947",
"0.6636414",
"0.66307396",
"0.66076356",
"0.6575782",
"0.655458",
"0.65400356",
"0.65395075",
"0.6538113",
"0.65314806",
"0.6516871",
"0.6516409",
"0.65123856",
"0.6507473",
"0.6503454",
"0.65003955",
"0.6485329",
"0.64798... | 0.7760664 | 0 |
Require attribute to be set. Return attribute value. | def require_attr(name)
send(name).tap do |_|
raise AttributeError, "Attribute must be set: #{name}" if _.nil?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def require_attr(name)\n send(name).tap do |_|\n raise \"Attribute must be set: #{name}\" if _.nil?\n end\n end",
"def is_attribute?; end",
"def get_attribute(name); end",
"def get_attribute(name); end",
"def required(required)\n state_depth_must_be(States::ATTRIBUTE)\n ... | [
"0.7701382",
"0.6624033",
"0.6465094",
"0.6465094",
"0.64115876",
"0.64109665",
"0.6395014",
"0.6395014",
"0.63879555",
"0.6332254",
"0.62541634",
"0.62414527",
"0.62332577",
"0.6221746",
"0.6193909",
"0.6183849",
"0.6143699",
"0.6128453",
"0.6095054",
"0.6095054",
"0.6095054... | 0.7460677 | 1 |
A bigram is a pair of consecutive words. Given a string, return the longest bigram in that string. Include the space between the words. Assume there will be no punctuation. In the case of a tie, return the earlier bigram. | def longest_bigram(str)
bigram_hash = Hash.new
bigram_str = str.split(" ")
bigram_str.each_with_index do |word, i|
if i == bigram_str.length - 1
next
else
bigram_hash[word + " " + bigram_str[i + 1]] = (word + " " + bigram_str[i + 1]).length
end
end
temp_str = ""
temp_str_length = 0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def most_frequent_bigram(str)\n bigrams_hash = biagram_hash(str)\n bigrams_hash.key(bigrams_hash.values.max)\nend",
"def most_frequent_bigram(str)\n sub_str_arr = []\n bigram_count = Hash.new(0)\n str.each_char.with_index do |char,idx|\n if idx+1 != nil && str[idx..idx+1].length ==2\n ... | [
"0.7207688",
"0.7051371",
"0.7041303",
"0.702443",
"0.70081127",
"0.70071846",
"0.698274",
"0.6979883",
"0.69363034",
"0.6920343",
"0.68968546",
"0.68956643",
"0.68891966",
"0.6885634",
"0.6866206",
"0.6860503",
"0.68334246",
"0.68278694",
"0.6824303",
"0.68168306",
"0.681510... | 0.78004354 | 0 |
Retrieve one API Secret. | def get(secret_id)
request('/accounts/' + account_id + '/secrets/' + secret_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_secret(params)\n return @api_secret\n end",
"def secret\n client.get(\"/user/secret\").fetch(\"result\")\n end",
"def secretkey(apikey)\n get 'secretkey', {apikey: apikey} { |x| x['secretkey'] }\n end",
"def get_secret(secret_name, secret_version = nil)\n url = @vault_url... | [
"0.7861695",
"0.7570085",
"0.7257975",
"0.71788913",
"0.715328",
"0.70748",
"0.7073112",
"0.7039963",
"0.7020124",
"0.70143735",
"0.69242084",
"0.6916224",
"0.6916224",
"0.6913969",
"0.68782926",
"0.6830732",
"0.68221384",
"0.68221384",
"0.68221384",
"0.68221384",
"0.67820835... | 0.7575617 | 1 |
Revoke an API Secret. | def revoke(secret_id)
request('/accounts/' + account_id + '/secrets/' + secret_id, type: Delete)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def revoke\n post('/api/revoke')\n end",
"def revoke(user_id)\n require_user\n\n user = User.find(user_id)\n user.secrets.each do |secret|\n secret.destroy\n end\n\n user.destroy\n end",
"def decrypt_api_secret\n @api_secret_d = @client_api_detail.decrypted_api_s... | [
"0.70278716",
"0.68591785",
"0.6726838",
"0.67246026",
"0.6722175",
"0.66734755",
"0.65290856",
"0.64716893",
"0.64186555",
"0.6398145",
"0.63798296",
"0.63777775",
"0.6376802",
"0.63757986",
"0.6338414",
"0.62342596",
"0.6228308",
"0.61449856",
"0.6137439",
"0.61210626",
"0.... | 0.7718061 | 0 |
Execute the statement. This creates a new ResultSet object for the statement's virtual machine. If a block was given, the new ResultSet will be yielded to it; otherwise, the ResultSet will be returned. Any parameters will be bound to the statement using bind_params. Example: stmt = db.prepare( "select from table" ) stm... | def execute( *bind_vars )
reset! if active? || done?
bind_params(*bind_vars) unless bind_vars.empty?
@results = ResultSet.new(@connection, self)
step if 0 == column_count
yield @results if block_given?
@results
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute(stmt, bindvars={})\n sanity_check(stmt)\n\n if @convert_types\n bindvars = DBI::Utils::ConvParam.conv_param(driver_name, bindvars)\n end\n\n sth = StatementHandle.new(@handle.execute(stmt, bindvars), true, true, @convert_types, true)\n # FIXME trace sth.trace(@trace_mode... | [
"0.78412986",
"0.7522994",
"0.7345846",
"0.6927035",
"0.6924953",
"0.6923811",
"0.6919758",
"0.66868365",
"0.6662286",
"0.66231287",
"0.6573493",
"0.6498426",
"0.6485987",
"0.64362",
"0.6425445",
"0.6412007",
"0.63899696",
"0.63838255",
"0.6362206",
"0.6327105",
"0.6318795",
... | 0.7812787 | 1 |
Performs a sanity check to ensure that the statement is not closed. If it is, an exception is raised. | def must_be_open! # :nodoc:
if closed?
raise Thredis::Exception, "cannot use a closed statement"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_statement(stmt)\n raise InterfaceError, \"Statement is empty, or contains nothing but whitespace\" if stmt !~ /\\S/\n end",
"def integrity_check\n execute( \"PRAGMA integrity_check\" ) do |row|\n raise Exceptions::DatabaseException, row[0] if row[0] != \"ok\"\n end\n end",
... | [
"0.6775886",
"0.614622",
"0.6121186",
"0.6121186",
"0.60484594",
"0.59901685",
"0.59743994",
"0.5653497",
"0.56164974",
"0.56164974",
"0.54735667",
"0.5429225",
"0.5390244",
"0.5353985",
"0.52740806",
"0.52547145",
"0.5230944",
"0.52300596",
"0.5227438",
"0.5227438",
"0.52123... | 0.6764198 | 1 |
Public: Adds a Line and returns it. Also sets the parent on the line and for simplicity adds the current_line number. Returns the line that was added. | def add_line(line)
@lines << line
line
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(context, line)\n\t\t\t@lines << @line.new(context, line)\n\t\tend",
"def add_line\n @layout.add_widget(HLine.new)\n end",
"def add_line(line)\n\t\t@lines << line\n\tend",
"def append_line(line)\n @lines.push(line)\n @current = false\n @current_pos = 0\n end",
"def line... | [
"0.6668727",
"0.6592262",
"0.6482159",
"0.64409804",
"0.6272245",
"0.6220798",
"0.620202",
"0.61966985",
"0.6170827",
"0.6003752",
"0.5966348",
"0.592102",
"0.59197515",
"0.590428",
"0.5867356",
"0.5836515",
"0.5802996",
"0.5754109",
"0.5743829",
"0.57004714",
"0.5695685",
... | 0.67920893 | 0 |
Internal: Given an array of parsed blocks, converts the properties within the blocks into a single hash. Returns a hash. | def blocks_to_hash(blocks)
blocks.each_with_object({}) do |block, hash|
hash.merge!(block.to_hash)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_h(&block)\n if block_given?\n @properties.each_with_object({}) do |(key, val), acc|\n k, v = *block.(key, val)\n acc[k] = v\n end\n else\n DeepDup.deep_dup(@properties)\n end\n end",
"def json_adjustments\n @blockss.each do |r... | [
"0.6046544",
"0.55548185",
"0.54865503",
"0.5469761",
"0.546405",
"0.54541075",
"0.5424585",
"0.5415328",
"0.5398357",
"0.53873974",
"0.53280497",
"0.53262925",
"0.52941555",
"0.5293148",
"0.52784747",
"0.5266053",
"0.5253693",
"0.5234994",
"0.5224278",
"0.5202144",
"0.520202... | 0.73259133 | 0 |
Write encoded record to the handle | def write(record)
@fh.puts(encode(record))
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(record)\n @fh.write(MARC::Writer.encode(record))\n end",
"def record_write bytes\n @reader.record_write bytes, @state\n end",
"def write(record)\n @writer.write(MARC::XMLWriter.encode(record), @fh)\n @fh.write(\"\\n\")\n end",
"def write(record)\n @writer.write(M... | [
"0.7382807",
"0.7094003",
"0.6921319",
"0.6921319",
"0.68935287",
"0.67133904",
"0.6448053",
"0.63763046",
"0.6352201",
"0.63295764",
"0.63295764",
"0.63295764",
"0.63295764",
"0.62227345",
"0.6185086",
"0.6112052",
"0.6030467",
"0.6030467",
"0.6028497",
"0.6021128",
"0.59768... | 0.7957822 | 0 |
combine bishop and rook for queen moves | def bishop_moves(x, y, game)
own_spaces = game[game[:turn]].keys
opponent_spaces = game[@opp_turn[game[:turn]]].keys
moves = []
# up right
temp_x = x + 1
temp_y = y + 1
while temp_x < 5 && temp_y < 5 && !own_spaces.include?([temp_x, temp_y])
moves.push([temp_x, temp_y])
break if opponent_spaces.in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def moves_queen(color, a, b)\n\t\t_moves = []\n\t\t(continue_left(color, a, b)).each{|move| _moves << move}\n\t\t(continue_right(color, a, b)).each{|move| _moves << move}\n\t\t(continue_up(color, a, b)).each{|move| _moves << move}\n\t\t(continue_down(color, a, b)).each{|move| _moves << move}\n\t\t(continue_up_left... | [
"0.6793946",
"0.6759593",
"0.66348326",
"0.63150096",
"0.6277755",
"0.62528765",
"0.62267834",
"0.61691153",
"0.615425",
"0.6122588",
"0.6058275",
"0.60339695",
"0.6012107",
"0.6009247",
"0.59959733",
"0.59870994",
"0.59814507",
"0.5959321",
"0.5917923",
"0.5909152",
"0.58929... | 0.6824487 | 0 |
need to order through the hash according to the assigned key in the point_values method hash | def point_values
{
"A"=>1, "B"=>3, "C"=>3, "D"=>2,
"E"=>1, "F"=>4, "G"=>2, "H"=>4,
"I"=>1, "J"=>8, "K"=>5, "L"=>1,
"M"=>3, "N"=>1, "O"=>1, "P"=>3,
"Q"=>10, "R"=>1, "S"=>1, "T"=>1,
"U"=>1, "V"=>4, "W"=>4, "X"=>8,
"Y"=>4, "Z"=>10
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ordered_values; end",
"def hash\n @points.inject(0) { |sum, point| sum += point.x + point.y }\n end",
"def move_points(hash)\n\n\t\tpoints = Hash.new\n\n\t\tgc_hash = hash.select { |k,v| k.to_s.include?('gc') }\n\t\toc_hash = gc_hash.select { |k,v| v.include?('OC') }\n\n\t\t# Calculate OC count to ... | [
"0.6455059",
"0.64427334",
"0.63348913",
"0.6192054",
"0.6153559",
"0.6088921",
"0.59997576",
"0.59171265",
"0.58849764",
"0.58649707",
"0.58617437",
"0.58029777",
"0.57773423",
"0.57769984",
"0.57769984",
"0.5754508",
"0.57528013",
"0.5749163",
"0.57380855",
"0.5702592",
"0.... | 0.6493413 | 1 |
multiply that sum by the provided 3rd argument multiplier | def multiply_sum_by_3rd_argument
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multiply(*all_args)\n all_args.inject(1) { |sum, value| sum *= value}\nend",
"def mult(*args)\n\tprod = 1\n\targs.each do |arg|\n\t\tprod *= arg\n\tend\n\tprod\nend",
"def multiply(nums)\r\n nums.reduce(:*)\r\nend",
"def multiply\n inject(1) { |p,x| p * x }\n end",
"def mul!(*args)\n ... | [
"0.7444188",
"0.7357048",
"0.71049494",
"0.70804065",
"0.7065773",
"0.7042493",
"0.7042044",
"0.70210147",
"0.7015285",
"0.69790494",
"0.6963095",
"0.69568056",
"0.6918573",
"0.6889177",
"0.6886552",
"0.6886552",
"0.6879731",
"0.68562347",
"0.68267405",
"0.6789354",
"0.678407... | 0.78995043 | 0 |
directories and files from /home/account_name/www/project_name folder (using ex. FileZilla) but it left some folders with symlinks, such as: www ` project_name | current > /home/account_name/www/project_name/releases/20131014083207 ` releases | 20131014081055 | | log > /home/account_name/www/project_name/shared/log | |... | def cleanup
# ----------------------------------------------
account_name = 'your account name' # <-- change this!
project_name = 'your project name' # <-- change this!
# ----------------------------------------------
project_dir = "/home/#{account_name}/www"
Dir.chdir(project_dir)
Dir.entries(project_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tidy_up\n return if DEBUG\n\n puts heading(\"Tidying up PWD\")\n\n FileUtils.remove(Dir[\"#{FileUtils.pwd}/bugsnag-*.tgz\"])\nend",
"def remove_dead_symlinks\n base_paths.each do |path|\n command = \"find #{path} -xtype l -delete\"\n Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, c... | [
"0.61604303",
"0.609182",
"0.5838239",
"0.572081",
"0.56477356",
"0.5638157",
"0.56050116",
"0.5603893",
"0.55922616",
"0.5583106",
"0.5523004",
"0.552116",
"0.5510005",
"0.5510005",
"0.5507161",
"0.5504293",
"0.54923385",
"0.54508877",
"0.5426518",
"0.54211396",
"0.5417211",... | 0.7290133 | 0 |
Create an erased flash. | def createflashimage
flashdata = "\xff" * FLASHSIZE
Flashimage.write(flashdata)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flash_keeper\n flash.keep\n end",
"def discard_flash\n flash.discard\n end",
"def flash_destroyed_message\n flash_message_builder(:destroy, flash_status_type, 'destroyed')\n end",
"def keep_flash\n @keep_flash = true\n end",
"def scaffold_flash\n {}\n end",... | [
"0.63379157",
"0.6034925",
"0.6015594",
"0.5983541",
"0.5918129",
"0.59143656",
"0.58458066",
"0.57976186",
"0.5707702",
"0.56664616",
"0.56011134",
"0.5503426",
"0.54939735",
"0.54881525",
"0.544252",
"0.544252",
"0.5435931",
"0.5394532",
"0.5394523",
"0.5362896",
"0.5348555... | 0.62776345 | 1 |
Split flash image in partitions. | def splitflashimage
flashdata = Flashimage.read
size = flashdata.size
puts("Flash image size: #{size / MiB} MiB = #{size} B.")
raise('Flash size is unexpected.') if (size != FLASHSIZE)
baseaddress = PARTITIONS['boot'][START]
PARTITIONS.each { |label, partition|
first = partition[START] - baseaddress
last = fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mergepartitions\n\tflashdata = \"\\xff\" * FLASHSIZE\n\tbaseaddress = PARTITIONS['boot'][START]\n\tPARTITIONS.each { |label, partition|\n\t\tfirst = partition[START] - baseaddress\n\t\tlast = first + partition[SIZE]\n\t\tfilename = \"#{File.dirname(FLASHIMAGE)}/#{partition[FILE]}\"\n\t\tpartdata = Flashimage.r... | [
"0.690342",
"0.59546083",
"0.57812333",
"0.57254237",
"0.57205456",
"0.5712888",
"0.56876594",
"0.5683673",
"0.5644677",
"0.56099576",
"0.55600005",
"0.54711246",
"0.54664296",
"0.54483944",
"0.5411717",
"0.5397295",
"0.5254826",
"0.5215175",
"0.5200493",
"0.5196441",
"0.5172... | 0.8141284 | 0 |
Make flash image from partitions. | def mergepartitions
flashdata = "\xff" * FLASHSIZE
baseaddress = PARTITIONS['boot'][START]
PARTITIONS.each { |label, partition|
first = partition[START] - baseaddress
last = first + partition[SIZE]
filename = "#{File.dirname(FLASHIMAGE)}/#{partition[FILE]}"
partdata = Flashimage.read(filename)
size = partd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def splitflashimage\n\tflashdata = Flashimage.read\n\tsize = flashdata.size\n\tputs(\"Flash image size: #{size / MiB} MiB = #{size} B.\")\n\traise('Flash size is unexpected.') if (size != FLASHSIZE)\n\tbaseaddress = PARTITIONS['boot'][START]\n\tPARTITIONS.each { |label, partition|\n\t\tfirst = partition[START] - b... | [
"0.68787396",
"0.65255797",
"0.641545",
"0.62146753",
"0.5831584",
"0.57129085",
"0.5710913",
"0.5696141",
"0.5632923",
"0.5624845",
"0.55377704",
"0.5428235",
"0.54141676",
"0.5406065",
"0.53421277",
"0.5280142",
"0.5260895",
"0.52310866",
"0.5201961",
"0.5164563",
"0.510017... | 0.68463033 | 1 |
Change partition (configuration, web or code). | def changepartition(partition, filename)
baseaddress = PARTITIONS['boot'][START]
size = partition[SIZE]
partdata = Flashimage.read(filename)
length = partdata.size
last = partition[SIZE]
raise('Input file too large.') if length + 12 > last
crc32 = Zlib.crc32(partdata)
partdata[length ... last - 12] = "\xff" * ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_partition\n @partition = Partition.find(params[:id])\n end",
"def setPartitionType(settings)\n settings = deep_copy(settings)\n tm = Storage.GetTargetMap\n settings = Builtins.maplist(settings) do |d|\n if Ops.get_symbol(d, \"type\", :x) == :CT_DISK\n mp = Ops.get_integ... | [
"0.68011206",
"0.6676938",
"0.618568",
"0.60967946",
"0.60418004",
"0.5999213",
"0.59895533",
"0.58191353",
"0.57497066",
"0.56553215",
"0.5624845",
"0.55776787",
"0.5513125",
"0.5506415",
"0.54891264",
"0.5467075",
"0.545486",
"0.5430396",
"0.5425995",
"0.54255795",
"0.53947... | 0.6723628 | 1 |
Load partition file (code, web or configuration). | def loadpart(partname, filename)
flashimage = Flashimage.new
firmware = Flashimage.read(filename)
size = firmware.size
offset_signature = size - 10
signature = firmware[offset_signature .. -1]
puts("signature: #{signature.inspect}")
length, magic, crc32, offset = getblock(partname, firmware, offset_signature)
p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(file_path); end",
"def load(file_path); end",
"def load(path); end",
"def load_path; end",
"def set_partition\n @partition = Partition.find(params[:id])\n end",
"def load_path=(load_path); end",
"def load\n @yaml_parts, @ruby_parts = lookup_parts\n @data.clear\n self.y... | [
"0.56779397",
"0.56779397",
"0.56776893",
"0.5607713",
"0.552809",
"0.5422654",
"0.5393423",
"0.53713644",
"0.53360283",
"0.53193",
"0.53123003",
"0.5309336",
"0.5309114",
"0.5309114",
"0.52840716",
"0.5271817",
"0.5270335",
"0.5269269",
"0.52681625",
"0.52555305",
"0.5233593... | 0.6331081 | 0 |
Load firmware file (code and web). | def loadfw(filename)
flashimage = Flashimage.new
firmware = Flashimage.read(filename)
size = firmware.size
offset_signature = size - 10
signature = firmware[offset_signature .. -1]
puts("signature: #{signature.inspect}")
length, magic, crc32, offset_code = getblock('code', firmware, offset_signature)
code = Par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_firmware\n ensure_client && ensure_uri\n response = @client.rest_get(@data['uri'] + '/firmware')\n @client.response_handler(response)\n end",
"def load_file(path)\n load_string(File.binread(path))\n end",
"def loadpart(partname, filename)\n\tflashimage = Fl... | [
"0.63007134",
"0.6011472",
"0.5928067",
"0.5909968",
"0.5909968",
"0.58938366",
"0.5889059",
"0.5864592",
"0.5854285",
"0.5824867",
"0.5769541",
"0.5741391",
"0.57156634",
"0.56640905",
"0.56462",
"0.5618558",
"0.5609447",
"0.56001127",
"0.55932903",
"0.55932903",
"0.55531216... | 0.72785926 | 0 |
GET /boots/1 GET /boots/1.json | def show
@boot = Boot.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @boot }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @boot = Boot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @boot }\n end\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def show\n @boot = Boot.find(params[:id])\n\n respond_to do |format|... | [
"0.66913277",
"0.62402487",
"0.61105716",
"0.59769744",
"0.591952",
"0.5876535",
"0.5660398",
"0.5596117",
"0.55550104",
"0.55473495",
"0.55455303",
"0.5509982",
"0.5491295",
"0.5486162",
"0.5483385",
"0.54735804",
"0.5445544",
"0.5432645",
"0.5427404",
"0.54243594",
"0.54105... | 0.75800765 | 0 |
GET /boots/new GET /boots/new.json | def new
@boot = Boot.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @boot }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @boot = Boot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boot }\n end\n end",
"def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n en... | [
"0.7068447",
"0.6764454",
"0.6749742",
"0.6606039",
"0.6537489",
"0.64620835",
"0.64563084",
"0.64284384",
"0.64284384",
"0.64284384",
"0.64284384",
"0.64284384",
"0.636379",
"0.63579077",
"0.63579077",
"0.63579077",
"0.63579077",
"0.63535166",
"0.63530594",
"0.6350001",
"0.6... | 0.81628734 | 0 |
PUT /boots/1 PUT /boots/1.json | def update
@boot = Boot.find(params[:id])
respond_to do |format|
if @boot.update_attributes(params[:boot])
flash[:success] = "Updated successfully "
format.html { redirect_to boots_path, notice: 'Boot was successfully updated.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @boot = Boot.find(params[:id])\n\n respond_to do |format|\n if @boot.update_attributes(params[:boot])\n flash[:notice] = 'Boot was successfully updated.'\n format.html { redirect_to(@boot) }\n format.xml { head :ok }\n else\n format.html { render :action =>... | [
"0.6424908",
"0.61105126",
"0.5636898",
"0.56145096",
"0.5521343",
"0.5443643",
"0.5434995",
"0.5411755",
"0.5400058",
"0.53812206",
"0.5359651",
"0.5345468",
"0.53138494",
"0.52571774",
"0.52571774",
"0.52345127",
"0.52269644",
"0.5200251",
"0.51425636",
"0.51385486",
"0.511... | 0.6826857 | 0 |
DELETE /boots/1 DELETE /boots/1.json | def destroy
@boot = Boot.find(params[:id])
@boot.destroy
respond_to do |format|
flash[:success] = "Deleted successfully "
format.html { redirect_to boots_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @boot = Boot.find(params[:id])\n @boot.destroy\n\n respond_to do |format|\n format.html { redirect_to(boots_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @testboot.destroy\n respond_to do |format|\n format.html { redirect_to testboots_url, notice: ... | [
"0.74450946",
"0.69838065",
"0.6720092",
"0.65074015",
"0.6457982",
"0.64458597",
"0.64412314",
"0.64234084",
"0.6423225",
"0.6412931",
"0.6346784",
"0.6346784",
"0.6346784",
"0.6346784",
"0.63379455",
"0.6324339",
"0.63220555",
"0.630647",
"0.630647",
"0.62963164",
"0.629607... | 0.7643134 | 0 |
GET /daw_promos GET /daw_promos.json | def index
@daw_promos = DawPromo.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @promocion = Promocion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @promocion }\n end\n end",
"def index\n @daw_matricula_promos = DawMatriculaPromo.all\n end",
"def show\n @pdevice = Pdevice.find(params[:id])... | [
"0.6421152",
"0.62996143",
"0.6150884",
"0.6138804",
"0.6123474",
"0.6080514",
"0.60380435",
"0.59345794",
"0.5912635",
"0.5878894",
"0.5827744",
"0.5813213",
"0.58032966",
"0.5799405",
"0.57931346",
"0.57843083",
"0.57540596",
"0.57470965",
"0.57324034",
"0.57320577",
"0.571... | 0.67679787 | 0 |
POST /daw_promos POST /daw_promos.json | def create
@daw_promo = DawPromo.new(daw_promo_params)
respond_to do |format|
if @daw_promo.save
format.html { redirect_to @daw_promo, notice: 'Daw promo was successfully created.' }
format.json { render :show, status: :created, location: @daw_promo }
else
format.html { rend... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n megam_rest.post_promos(to_hash) #WONT BE USED AS OF NOW\n end",
"def create\n @daw_matricula_promo = DawMatriculaPromo.new(daw_matricula_promo_params)\n\n respond_to do |format|\n if @daw_matricula_promo.save\n format.html { redirect_to @daw_matricula_promo, notice: 'Daw ma... | [
"0.7214397",
"0.6106348",
"0.5992868",
"0.5981123",
"0.5788211",
"0.57550657",
"0.5698611",
"0.5653004",
"0.5481892",
"0.5480644",
"0.5477",
"0.54521966",
"0.54376364",
"0.5414071",
"0.5412733",
"0.540968",
"0.5398997",
"0.53984874",
"0.53982407",
"0.53896254",
"0.5343505",
... | 0.6368797 | 1 |
Retrieve all the attribute names (keys). like Hashkeys | def keys
getAttributeNames.to_a
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def keys\n attributes.ke... | [
"0.83720696",
"0.83720696",
"0.83720696",
"0.83720696",
"0.83421046",
"0.83070236",
"0.8240137",
"0.82318974",
"0.8211159",
"0.81253296",
"0.80687785",
"0.8066238",
"0.7990659",
"0.79830986",
"0.79690486",
"0.79690486",
"0.7962223",
"0.79262525",
"0.79241925",
"0.7881712",
"0... | 0.8470216 | 0 |
Remove an attribute for the given key. | def delete(key)
removeAttribute(key.to_s)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_attribute(key); end",
"def delete_attr!(key)\n copy_on_write if @attrs.shared\n key = key.intern \n old_attrs = @attrs\n @attrs = AttrArray.new\n @attrs_hash = {}\n old_attrs.each do |a|\n put_attr(a) if a.key_symbol != key\n end\n end",
"def remove_attri... | [
"0.85295427",
"0.8046233",
"0.7494352",
"0.7494352",
"0.7494352",
"0.7494352",
"0.7170832",
"0.7170832",
"0.7168768",
"0.71535647",
"0.71510696",
"0.708984",
"0.70307964",
"0.7027887",
"0.6876078",
"0.685754",
"0.68046373",
"0.6751213",
"0.6698729",
"0.6678779",
"0.667554",
... | 0.83570427 | 1 |
Iterate over every attribute name/value pair from the servlet request. like Hasheach | def each
getAttributeNames.each { |name| yield(name, getAttribute(name)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_attribute # :yields: key\n @attrs.each_key { |k| yield(k) }\n end",
"def each_attribute(&block)\n\t\t @@attributes.each &block\n\t\tend",
"def each # :yields: key, value\n @attrs.each { |k, v| yield(k, v) }\n end",
"def each_attribute(&block)\n attributes.each(&block)\n ... | [
"0.6871169",
"0.6616208",
"0.6598819",
"0.6588127",
"0.64660853",
"0.6449042",
"0.6395681",
"0.6395101",
"0.6347066",
"0.6317744",
"0.6188348",
"0.6186114",
"0.61479557",
"0.6146135",
"0.6146135",
"0.61373293",
"0.61347294",
"0.61000615",
"0.6099919",
"0.6072865",
"0.6058385"... | 0.69973594 | 0 |
Retrieve all the attribute names (keys) from the session. like Hashkeys | def keys
getAttributeNames.to_a
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keys\n attributes.keys\n end",
"def keys\n @attributes.keys\n end",
"def attributes\n @attrs.keys\n end",
"def keys\n Keys[to_attr_list]\n end",
"def attribute_keys\n return [] unless self[:attributes]\n self[:attributes].keys\n end",
"def at... | [
"0.77650887",
"0.7575111",
"0.75099236",
"0.74804366",
"0.7431779",
"0.74076426",
"0.74076426",
"0.74076426",
"0.74076426",
"0.7357327",
"0.7351607",
"0.71687037",
"0.7148262",
"0.7088859",
"0.706278",
"0.7058341",
"0.7055983",
"0.7030187",
"0.7005255",
"0.6972871",
"0.693539... | 0.8037139 | 1 |
Iterate over every attribute name/value pair from the session. like Hasheach | def each
getAttributeNames.each { |name| yield(name, getAttribute(name)) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_attribute # :yields: key\n @attrs.each_key { |k| yield(k) }\n end",
"def each # :yields: key, value\n @attrs.each { |k, v| yield(k, v) }\n end",
"def attributes\n if iterator?\n @attr.each do |key, value|\n yield(value)\n end if @attr\n else\n... | [
"0.6623814",
"0.6488496",
"0.6451143",
"0.640535",
"0.6334656",
"0.6282344",
"0.62392306",
"0.6152692",
"0.6128836",
"0.60732865",
"0.60620636",
"0.60481846",
"0.6032993",
"0.6032993",
"0.60315186",
"0.60060924",
"0.5999632",
"0.59871143",
"0.59691674",
"0.5969161",
"0.596732... | 0.67497075 | 1 |
codewars kata: colour association | def colour_association(array)
array.map{|pair| Hash[pair.first, pair.last]}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def color(color); end",
"def colors; end",
"def colorize!; @colors = true; end",
"def colorized?; end",
"def scan_for_colors; end",
"def generate_color_scheme\n if values_bits[Constants::V_Use_of_colors]<=2.5 #No colors \n if values_bits[Constants::V_Type_of_BG]<4.5 and @image_colors[0].get_li... | [
"0.6711947",
"0.6350977",
"0.6301483",
"0.6254664",
"0.62430394",
"0.61862665",
"0.61311495",
"0.6082481",
"0.60648423",
"0.6030823",
"0.60145295",
"0.5983263",
"0.59334964",
"0.5930534",
"0.5924699",
"0.5924699",
"0.5924699",
"0.59190124",
"0.5902911",
"0.58814967",
"0.58801... | 0.6607406 | 1 |
codewars kata: matrix addition | def matrixAddition(a, b)
c = [] << a << b
c.transpose.map{ |i| i.transpose }.map{ |s|
s.map{ |p| p.reduce(&:+)}}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matrix_addition(m1, m2)\n rows = m1.length\n cols = m1[0].length\n result = Array.new(rows) { Array.new(cols, 0)}\n (0...rows).each do |row|\n (0...cols).each do |col|\n result[row][col] = m1[row][col] + m2[row][col]\n end\n end\n \n result\nend",
"def matrix_add... | [
"0.7869705",
"0.7850795",
"0.7777493",
"0.77681583",
"0.76983064",
"0.76678276",
"0.7649536",
"0.7621031",
"0.7506059",
"0.74922585",
"0.7410893",
"0.7402457",
"0.73622286",
"0.7308594",
"0.7256614",
"0.71787995",
"0.7162077",
"0.7141986",
"0.71276253",
"0.7099612",
"0.706787... | 0.8022373 | 0 |
Insert a set into the search dictionary | def add_search_set( search_set, number_to_transpose = 0 )
@search_sets << Set.new( MiltonsMachine::Core::ForteSet.new(search_set).transpose_mod12(number_to_transpose) )
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert(val)\n hash[val] = Set.new unless hash[val]\n hash[val].add(values.size)\n values.push(val)\n hash[val].size == 1\n end",
"def __add_keys_to(set) # used by parser # [\n lim = @_st_tableSize\n lim = lim + lim\n kofs = 0\n while kofs < lim\n k = self.__at... | [
"0.6177171",
"0.607688",
"0.59745497",
"0.5956627",
"0.5948206",
"0.59259856",
"0.58951247",
"0.58811456",
"0.5874943",
"0.58352625",
"0.5789481",
"0.5749088",
"0.5687204",
"0.56850153",
"0.5616526",
"0.56158483",
"0.56066525",
"0.5598883",
"0.55987775",
"0.55276084",
"0.5527... | 0.6488078 | 0 |
Run the rotation_analysis and print out the results | def run_rotation_analysis
initialize_run
rotate_group
print_summary
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_rotation_count\n @rotation_count += 1\n print \"\\r\\e#{@rotation_count} of #{@maximum_rotations} processed...\"\n $stdout.flush\n end",
"def main\n north_south = 0\n east_west = 0\n rotation = 0\n\n standard_rotations = {\n 0 => { north_south: 0, east_west: 1 },\n 9... | [
"0.6004163",
"0.5732051",
"0.5711006",
"0.5667199",
"0.55585",
"0.5506489",
"0.5484848",
"0.53235203",
"0.5312208",
"0.52817506",
"0.5261955",
"0.52441883",
"0.52290374",
"0.5205131",
"0.51918006",
"0.51675093",
"0.51662785",
"0.51654243",
"0.51544803",
"0.5140026",
"0.514002... | 0.85818535 | 0 |
A recursive routine that rotates a group of voices in the horizontal matrix. If it is at depth, performs the final vertical analysis for the current rotations; otherwise, just calls itself to process the next group in the hierarchy. | def rotate_group( level = -1 )
level += 1
if level == 0 # First group always remains static
rotate_group(level) # Recursive call to process next group of rows
else
# Rotate each pitch to the right for each r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_rotation_analysis\n initialize_run\n rotate_group\n print_summary\n end",
"def spiral_access(arrays, &block)\n # checks if arrays has no sub-arrays\n if arrays.empty?\n return\n end\n\n# top row\n first_set = arrays[0]\n first_set.each do |x|\n block.call x\n end\n ... | [
"0.58914447",
"0.5213453",
"0.5172878",
"0.51578546",
"0.5112639",
"0.51018625",
"0.4927041",
"0.4922093",
"0.48874027",
"0.48260832",
"0.47970814",
"0.47718576",
"0.475144",
"0.46488744",
"0.46468467",
"0.46234345",
"0.45963815",
"0.4594693",
"0.45883408",
"0.4579273",
"0.45... | 0.73768514 | 0 |
Accumulate current permutation search result counts into the reports summary totals. For example: if the total column score was 9 for the current rotation of the rows, summary_totals[9] would be incremented to reflect that a matrix solution was found with score = 9 | def accumulate_summary_totals( score )
@summary_totals[score] ||= 0
@summary_totals[score] += 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def summarize_results(results)\n sort_order = ['scenario', 'step', 'failed', 'flaky', 'undefined', 'skipped', 'pending', 'passed']\n\n ['scenario', 'step'].map do |group|\n group_results = results.grep(/^\\d+ #{group}/)\n next if group_results.empty?\n\n sums = su... | [
"0.60953057",
"0.600039",
"0.58985794",
"0.58219343",
"0.577207",
"0.57419056",
"0.5726415",
"0.5687661",
"0.56077826",
"0.5471726",
"0.54679525",
"0.5459991",
"0.54142916",
"0.5409908",
"0.5407839",
"0.5400387",
"0.5379317",
"0.5376566",
"0.5373155",
"0.537284",
"0.53650963"... | 0.7095955 | 0 |
Print out a progress indicator of how many rotations / permutations have been processed and how many are remaining. | def print_rotation_count
@rotation_count += 1
print "\r\e#{@rotation_count} of #{@maximum_rotations} processed..."
$stdout.flush
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_progress\n\t\t\t# bar_size is between 0 and 30\n finish_size = (((@top_card-12).to_f / (@deck.length-11).to_f) * 30).to_i\n\t\t\tremain_size = 30 - finish_size\n\t\t\tprint \"\\nProgress: \"\n\t\t\tfinish_size.times {print '▓'}\n\t\t\tremain_size.times {print '░'}\n\t\t\tputs\n\t\t\tputs\n end",
... | [
"0.7286469",
"0.6606537",
"0.6606537",
"0.6606537",
"0.6606537",
"0.6606537",
"0.6561013",
"0.65301615",
"0.6503656",
"0.64372945",
"0.63917756",
"0.63744324",
"0.63731664",
"0.63432467",
"0.63100976",
"0.6208046",
"0.6141926",
"0.6137373",
"0.6123387",
"0.6123387",
"0.612338... | 0.7456358 | 0 |
Prints a summary section for the entire report | def print_summary
puts "\n\nScore : # Instances\n" << ("=" * 19)
@summary_totals.each_with_index { |value, index| puts " %5d:%8d\n" % [index, value] unless value.nil? }
puts "\n** End of Report"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def summary\n \n end",
"def dump_summary( summary )\n\t\thtml = self.render_summary( summary )\n\t\t@output.puts( html )\n\t\t@output.flush\n\tend",
"def summary\n end",
"def summary\n end",
"def summary\n # TODO\n end",
"def summary; end",
"def summary; end",
"def summary; end",
"def sum... | [
"0.72487986",
"0.72418725",
"0.7203269",
"0.7203269",
"0.7200281",
"0.71919674",
"0.71919674",
"0.71919674",
"0.71919674",
"0.712414",
"0.70546436",
"0.70524293",
"0.70318073",
"0.7016436",
"0.6937847",
"0.6918684",
"0.68868417",
"0.6867476",
"0.6850022",
"0.68379134",
"0.680... | 0.77893555 | 0 |
returns a chromosome object | def chromosome(id=nil)
return if id.nil?
begin
self.chromosomes[id.intern]
rescue
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chromosome_group\n chromosome[0]\n end",
"def chromosomes\n # Cache for performance\n if @chromosomes.nil?\n s = Set.new\n self.each { |entry| s << entry.chr }\n @chromosomes = s.to_a\n end\n \n return @chromosomes\n end",
"def new_rand_chrom\n ... | [
"0.69087785",
"0.66675186",
"0.6616339",
"0.6476195",
"0.6351701",
"0.60748726",
"0.58518857",
"0.56697726",
"0.56495184",
"0.5591868",
"0.5515572",
"0.5507487",
"0.54251176",
"0.54151255",
"0.5386429",
"0.53572005",
"0.53010887",
"0.5288723",
"0.52870905",
"0.5265328",
"0.52... | 0.7262938 | 0 |
Returns true if a user is defined. | def user_defined?
!@user.nil? || !@user['userId'].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user?(name)\n eval(USER_CHECK, binding, __FILE__, USER_CHECK_LINE)\n nil\nend",
"def custom?\n user_id.present? || is_a?(DSLDefined)\n end",
"def has_user?\n !user.nil?\n end",
"def user?\n get_mode == :user\n end",
"def is_potential_user?\n\t\ttrue\n\tend",
"def user_present?\n ... | [
"0.74699235",
"0.72796094",
"0.71275294",
"0.71097934",
"0.704967",
"0.698266",
"0.69224554",
"0.69224554",
"0.6908096",
"0.6872325",
"0.6848843",
"0.6789121",
"0.6716347",
"0.66968864",
"0.6690535",
"0.66733754",
"0.66626996",
"0.665802",
"0.66425085",
"0.6585555",
"0.656851... | 0.8091406 | 0 |
POST /favorite_tweets POST /favorite_tweets.json | def create
@favorite_tweet = FavoriteTweet.new(favorite_tweet_params)
respond_to do |format|
if @favorite_tweet.save
format.html { redirect_to @favorite_tweet, notice: 'Favorite tweet was successfully created.' }
format.json { render action: 'show', status: :created, location: @favorite_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n user = user_from_token\n @tweet = user.tweets.new()\n @tweet.tweet = params[:tweet]\n if @tweet.save\n render :json => @tweet, :status => :created\n else\n render :json => @tweet.errors, :status => :unprocessable_entity\n end\n end",
"def create_favorite(id)\n post \"... | [
"0.71963686",
"0.69921327",
"0.69658303",
"0.68816566",
"0.68612856",
"0.685439",
"0.68041986",
"0.6791777",
"0.6752056",
"0.6720362",
"0.67200935",
"0.669575",
"0.669575",
"0.6688767",
"0.66724735",
"0.6639043",
"0.65915155",
"0.658637",
"0.65502",
"0.6545046",
"0.6530948",
... | 0.7433148 | 0 |
PATCH/PUT /favorite_tweets/1 PATCH/PUT /favorite_tweets/1.json | def update
respond_to do |format|
if @favorite_tweet.update(favorite_tweet_params)
format.html { redirect_to @favorite_tweet, notice: 'Favorite tweet was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit... | [
"0.6960678",
"0.6960678",
"0.6960678",
"0.69604725",
"0.69222766",
"0.69034183",
"0.6883614",
"0.68249536",
"0.6781655",
"0.6781655",
"0.6781655",
"0.6781655",
"0.6761557",
"0.675751",
"0.67472273",
"0.67472273",
"0.67472273",
"0.6719685",
"0.6706669",
"0.67002296",
"0.668918... | 0.75267 | 0 |
DELETE /favorite_tweets/1 DELETE /favorite_tweets/1.json | def destroy
TwitterSyncWorker.new.delete(session[:user_id], @favorite_tweet.id)
@favorite_tweet.destroy
respond_to do |format|
format.html { redirect_to request.referer }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n user = user_from_token\n user.tweets.destroy(params[:id])\n head :no_content\n end",
"def destroy\n @interesting_tweet.destroy\n respond_to do |format|\n format.html { redirect_to interesting_tweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\... | [
"0.73611623",
"0.7237081",
"0.72364336",
"0.72051394",
"0.72051394",
"0.71854454",
"0.71765554",
"0.714541",
"0.7023002",
"0.70183814",
"0.69963676",
"0.6993292",
"0.69846225",
"0.6979157",
"0.69612306",
"0.6947594",
"0.6946989",
"0.6946989",
"0.6946989",
"0.6946989",
"0.6946... | 0.7240167 | 1 |
jobs:stop JOB_ID Stop a running job. | def stop
job_id = shift_argument
unless job_id
error("Usage: mortar jobs:stop JOB_ID\nMust specify JOB_ID.")
end
response = api.stop_job(job_id).body
#TODO: jkarn - Once all servers have the additional message field we can remove this check.
if response['message'].nil?
display("S... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop(options = {})\n # set :stopping\n info \"stopping job\"\n unsubscribe\n kill if options[:force]\n end",
"def kill_job(job_id)\n __push([], :kill_job, job_id)\n end",
"def job_stopped? job=@current_job\n return false unless job and j... | [
"0.73273987",
"0.7175865",
"0.71753585",
"0.71748996",
"0.6982509",
"0.6982509",
"0.6942156",
"0.67249715",
"0.6706788",
"0.6540835",
"0.65160674",
"0.6445151",
"0.643705",
"0.64167774",
"0.63927066",
"0.6387198",
"0.63614136",
"0.635167",
"0.6337637",
"0.633173",
"0.6301892"... | 0.8248524 | 0 |
GET /favourite_foods/1 GET /favourite_foods/1.json | def show
@favourite_food = FavouriteFood.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @favourite_food }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def favorite_foods\n get(\"/user/#{@user_id}/foods/log/favorite.json\")\n end",
"def show\n @favourite_listing = get_favourite_listing(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @favourite_listing }\n end\n end",
"def get_favou... | [
"0.84989434",
"0.7063839",
"0.7056084",
"0.7033001",
"0.70282334",
"0.69767",
"0.697556",
"0.6894857",
"0.6857454",
"0.68488467",
"0.67617226",
"0.66966665",
"0.66960293",
"0.66952133",
"0.6692517",
"0.6680044",
"0.66745186",
"0.66721827",
"0.66412985",
"0.66412985",
"0.66392... | 0.7635762 | 1 |
GET /favourite_foods/new GET /favourite_foods/new.json | def new
@favourite_food = FavouriteFood.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @favourite_food }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @fav = Fav.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fav }\n end\n end",
"def new\n @favorite = Favorite.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @favorite }\n end\n ... | [
"0.7602866",
"0.74826956",
"0.74777085",
"0.7373788",
"0.73180306",
"0.72258997",
"0.72258997",
"0.71241575",
"0.7093327",
"0.70832",
"0.70824677",
"0.7039349",
"0.69641525",
"0.69337416",
"0.6918807",
"0.69062984",
"0.6884498",
"0.6866088",
"0.68614453",
"0.6861139",
"0.6858... | 0.78515697 | 0 |
PUT /favourite_foods/1 PUT /favourite_foods/1.json | def update
@favourite_food = FavouriteFood.find(params[:id])
respond_to do |format|
if @favourite_food.update_attributes(params[:favourite_food])
format.html { redirect_to @favourite_food, notice: 'Favourite food was successfully updated.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def favorite_foods\n get(\"/user/#{@user_id}/foods/log/favorite.json\")\n end",
"def update\n json_response(@food_item.update!(food_item_params))\n end",
"def update\n respond_to do |format|\n if @favory.update(favory_params)\n format.html { redirect_to @favory, notice: \"Fav... | [
"0.7014924",
"0.67057246",
"0.6702148",
"0.66944414",
"0.66811377",
"0.667469",
"0.666159",
"0.6640309",
"0.6587724",
"0.6557583",
"0.65235865",
"0.64982474",
"0.64741874",
"0.64741874",
"0.64584434",
"0.64584434",
"0.64584434",
"0.63933563",
"0.6358495",
"0.6343483",
"0.6337... | 0.6960666 | 1 |
DELETE /favourite_foods/1 DELETE /favourite_foods/1.json | def destroy
@favourite_food = FavouriteFood.find(params[:id])
@favourite_food.destroy
respond_to do |format|
format.html { redirect_to favourite_foods_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_favorite_food(food_id)\n delete(\"/user/#{@user_id}/foods/favorite/#{food_id}.json\")\n end",
"def destroy\n @food = Food.find(params[:id])\n @food.destroy\n\n respond_to do |format|\n format.html { redirect_to foods_url }\n format.json { head :ok }\n end\n end",
"def ... | [
"0.7427092",
"0.7296844",
"0.7296844",
"0.70963365",
"0.7025781",
"0.70044833",
"0.69768685",
"0.6970896",
"0.6966709",
"0.6951589",
"0.69415987",
"0.6933586",
"0.6929641",
"0.6925296",
"0.69223464",
"0.692048",
"0.6912096",
"0.69096017",
"0.6908586",
"0.68933874",
"0.6893387... | 0.7730022 | 0 |
DELETE /shops/1 DELETE /shops/1.xml | def destroy
@shop = Shop.find(params[:id])
@shop.destroy
respond_to do |format|
format.html { redirect_to(admin_shops_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @repairshop = Repairshop.find(params[:id])\n @repairshop.destroy\n\n respond_to do |format|\n format.html { redirect_to(re... | [
"0.65141165",
"0.6476739",
"0.6475688",
"0.6457269",
"0.6414871",
"0.6388637",
"0.6360673",
"0.6348651",
"0.6323372",
"0.6276365",
"0.6236237",
"0.6235271",
"0.623514",
"0.6194304",
"0.6172855",
"0.6166707",
"0.6166707",
"0.61563534",
"0.6146716",
"0.612103",
"0.6108715",
"... | 0.6776488 | 0 |
Compiles all routes into regexps. | def compile!
return if compiled?
@routes.each_with_index do |route, index|
route.index = index
route.regexp = /(?<_#{index}>#{route.matcher.to_regexp})/
end
@compiled = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compile!\n return if compiled?\n @regexps = @routes.map.with_index do |route, index|\n route.index = index\n /(?<_#{index}>#{route.matcher.to_regexp})/\n end\n @regexps = recursive_compile(@regexps)\n @compiled = true\n end",
"def compile\n ... | [
"0.8115772",
"0.7071185",
"0.7014843",
"0.6735203",
"0.6690873",
"0.64595294",
"0.62049437",
"0.6125483",
"0.61136585",
"0.61121184",
"0.61121184",
"0.6107773",
"0.60939205",
"0.6033074",
"0.59805006",
"0.5959296",
"0.59400547",
"0.59196824",
"0.59196824",
"0.59196824",
"0.59... | 0.7659134 | 1 |
Finds routes by using request or env. | def find_by(request_or_env)
request = request_or_env.is_a?(Hash) ? Sinatra::Request.new(request_or_env) : request_or_env
pattern = decode_pattern(request.path_info)
verb = request.request_method
rotation { |offset| match?(offset, pattern) }.select { |route| route.verb == verb }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def route(env)\n routes.each do |route|\n return route if route.match(env)\n end\n\n nil\n end",
"def find_route(request)\n @routes.find {|r| r.match?(request) }\n end",
"def find_route(routes, request)\n transport = request.websocket? ? 'WS' : 'HTTP'\n routes.match(r... | [
"0.7627223",
"0.74200827",
"0.7418732",
"0.721284",
"0.7113679",
"0.70978194",
"0.6911638",
"0.67903876",
"0.6689333",
"0.6689333",
"0.66392386",
"0.6619604",
"0.6610928",
"0.65896064",
"0.6587124",
"0.65777093",
"0.6553928",
"0.6553928",
"0.65202415",
"0.647904",
"0.6425076"... | 0.77067447 | 0 |
Encode string with Encoding.default_external | def encode_default_external(string)
string.encode(Encoding.default_external)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def external_encoding\n Encoding.default_external\n end",
"def string_encoder\n return string if string.valid_encoding?\n str = string\n Encoding.list.each do |e|\n begin\n str.force_encoding(e.name)\n tmp_string = str.encode('UTF-8')\n return tmp_string if tm... | [
"0.75890625",
"0.7542044",
"0.7473844",
"0.7416969",
"0.73306304",
"0.7306955",
"0.7156714",
"0.70741445",
"0.70741445",
"0.7058213",
"0.70472217",
"0.70415145",
"0.7039941",
"0.7026714",
"0.69621706",
"0.6928945",
"0.6855664",
"0.68282866",
"0.6804509",
"0.6754842",
"0.67507... | 0.8961825 | 0 |
Finds an emoji by its name. | def find_emoji(name)
LOGGER.out("Resolving emoji #{name}")
emoji.find { |element| element.name == name }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_emoji?(emoji)\n Emoji.find_by_name emoji\n end",
"def find_emoji(key, server = nil)\n server = server || $bot.servers[SERVER_ID] || $bot.servers.first\n return if server.nil?\n if key.is_a?(Integer)\n server.emojis[key]\n elsif key.is_a?(String)\n server.emojis.find{ |id, e| e.name.do... | [
"0.66077566",
"0.6356576",
"0.6225231",
"0.6219515",
"0.61103976",
"0.6058261",
"0.60096383",
"0.59947395",
"0.5861071",
"0.58036435",
"0.57789695",
"0.57694024",
"0.56958956",
"0.5695522",
"0.567858",
"0.5659555",
"0.56351364",
"0.55797064",
"0.5572729",
"0.55421966",
"0.552... | 0.9117262 | 0 |
The bot's OAuth application. | def bot_application
return unless @type == :bot
response = API.oauth_application(token)
Application.new(JSON.parse(response), self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def oauth_application(token)\n request(\n __method__,\n :get,\n \"#{api_base}/oauth2/applications/@me\",\n Authorization: token\n )\n end",
"def connection_for_application\n oauth_client.client_credentials.get_token\n end",
"def oauth\n ::OAuth::Consumer.new(Config.con... | [
"0.73693085",
"0.68700224",
"0.6803141",
"0.67447376",
"0.6739837",
"0.6615489",
"0.65903246",
"0.653939",
"0.6537453",
"0.65316194",
"0.6479371",
"0.6466731",
"0.644376",
"0.6442134",
"0.6422361",
"0.64063597",
"0.6399454",
"0.6356976",
"0.6350804",
"0.6334928",
"0.6330561",... | 0.80125487 | 0 |
Creates an OAuth invite URL that can be used to invite this bot to a particular server. | def invite_url(server: nil, permission_bits: nil)
@client_id ||= bot_application.id
server_id_str = server ? "&guild_id=#{server.id}" : ''
permission_bits_str = permission_bits ? "&permissions=#{permission_bits}" : ''
"https://discord.com/oauth2/authorize?&client_id=#{@client_id}#{server_id_str... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invite_url(server = nil)\n raise 'No application ID has been set during initialization! Add one as the `application_id` named parameter while creating your bot.' unless @application_id\n\n guild_id_str = server ? \"&guild_id=#{server.id}\" : ''\n \"https://discordapp.com/oauth2/authorize?&client... | [
"0.79358506",
"0.61601734",
"0.6140274",
"0.61311567",
"0.58596253",
"0.57606685",
"0.5688839",
"0.5661156",
"0.56575847",
"0.56151354",
"0.5590863",
"0.5566705",
"0.5547112",
"0.5542738",
"0.5537466",
"0.5521269",
"0.55186635",
"0.54998434",
"0.5499122",
"0.5492385",
"0.5456... | 0.7333291 | 1 |
Sends a text message to a channel given its ID and the message's content, then deletes it after the specified timeout in seconds. | def send_temporary_message(channel, content, timeout, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil, components = nil)
Thread.new do
Thread.current[:discordrb_name] = "#{@current_thread}-temp-msg"
message = send_message(channel, content, tts, embed, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_temporary_message(channel_id, content, timeout, tts = false, server_id = nil)\n Thread.new do\n message = send_message(channel_id, content, tts, server_id)\n\n sleep(timeout)\n\n message.delete\n end\n\n nil\n end",
"def send_message(channel, content, opts = {})\n ... | [
"0.7993938",
"0.6187552",
"0.60455555",
"0.60313004",
"0.5957131",
"0.589204",
"0.5685615",
"0.56358874",
"0.56257606",
"0.56028855",
"0.5564914",
"0.55448204",
"0.5540462",
"0.552262",
"0.5519717",
"0.5516406",
"0.5515432",
"0.5468322",
"0.54659766",
"0.541653",
"0.5413082",... | 0.71656483 | 1 |
Sends a file to a channel. If it is an image, it will automatically be embedded. | def send_file(channel, file, caption: nil, tts: false, filename: nil, spoiler: nil)
if file.respond_to?(:read)
if spoiler
filename ||= File.basename(file.path)
filename = "SPOILER_#{filename}" unless filename.start_with? 'SPOILER_'
end
# https://github.com/rest-client/r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_file(path); end",
"def send_file(token, channel_id, file, caption: nil, tts: false)\n request(\n __method__,\n :post,\n \"#{api_base}/channels/#{channel_id}/messages\",\n { file: file, content: caption, tts: tts },\n Authorization: token\n )\n end",
"def send_file(chann... | [
"0.72900164",
"0.72698545",
"0.7137879",
"0.69675636",
"0.68549645",
"0.66866946",
"0.65693897",
"0.649217",
"0.64434123",
"0.63217616",
"0.6277791",
"0.6217847",
"0.62096065",
"0.61116534",
"0.6031926",
"0.60135734",
"0.5973319",
"0.5952479",
"0.5935816",
"0.5908261",
"0.588... | 0.73033434 | 0 |
Creates a server on Discord with a specified name and a region. | def create_server(name, region = :'eu-central')
response = API::Server.create(token, name, region)
id = JSON.parse(response)['id'].to_i
sleep 0.1 until (server = @servers[id])
debug "Successfully created server #{server.id} with name #{server.name}"
server
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_server(name, region = :london)\n response = API.create_server(token, name, region)\n id = JSON.parse(response)['id'].to_i\n sleep 0.1 until @servers[id]\n server = @servers[id]\n debug \"Successfully created server #{server.id} with name #{server.name}\"\n server\n end",... | [
"0.83683974",
"0.6795294",
"0.6512631",
"0.65120524",
"0.6255154",
"0.6223555",
"0.6218063",
"0.6204458",
"0.61825794",
"0.61438614",
"0.60822433",
"0.6000227",
"0.599413",
"0.59688234",
"0.59676874",
"0.5899694",
"0.58654946",
"0.5799056",
"0.57472765",
"0.5745482",
"0.56975... | 0.84140956 | 0 |
Creates a new application to do OAuth authorization with. This allows you to use OAuth to authorize users using Discord. For information how to use this, see the docs: | def create_oauth_application(name, redirect_uris)
response = JSON.parse(API.create_oauth_application(@token, name, redirect_uris))
[response['id'], response['secret']]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end",
"def create_oauth_application(to... | [
"0.69873273",
"0.69873273",
"0.69777524",
"0.6779362",
"0.6778442",
"0.6722473",
"0.672169",
"0.66975766",
"0.66803485",
"0.65305084",
"0.62695473",
"0.6241559",
"0.62196136",
"0.62072706",
"0.6128522",
"0.6127108",
"0.60710514",
"0.6049424",
"0.5999127",
"0.5996503",
"0.5982... | 0.7000048 | 0 |
Changes information about your OAuth application | def update_oauth_application(name, redirect_uris, description = '', icon = nil)
API.update_oauth_application(@token, name, redirect_uris, description, icon)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_oauth_application\n @oauth_application = Doorkeeper::Application.find(params[:oauth_application_id])\n end",
"def update_tokens(oauth_params)\n# binding.pry\n self.oauth_token = oauth_params.credentials.token\n # facebook, google provide this; twitter, linkedin don't\n self.oauth_expi... | [
"0.6815656",
"0.6455423",
"0.6445419",
"0.6440646",
"0.6397283",
"0.63802683",
"0.63802683",
"0.6377169",
"0.6307532",
"0.619249",
"0.6080465",
"0.60581374",
"0.604027",
"0.60270953",
"0.6023665",
"0.5967876",
"0.5941198",
"0.5936568",
"0.5898632",
"0.5898611",
"0.58880067",
... | 0.66020274 | 1 |
Sets the current listening status to the specified name. | def listening=(name)
gateway_check
update_status(@status, name, nil, nil, nil, 2)
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_listening\n @listening = Listening.find(params[:id])\n end",
"def name=(name)\n update_channel_data(name: name)\n end",
"def competing=(name)\n gateway_check\n update_s... | [
"0.69050187",
"0.59569013",
"0.58567226",
"0.57740796",
"0.5582599",
"0.5478112",
"0.545065",
"0.541106",
"0.53516525",
"0.5338427",
"0.53139347",
"0.52941483",
"0.52941483",
"0.528751",
"0.52463466",
"0.5237454",
"0.5224092",
"0.5213483",
"0.5198355",
"0.5149401",
"0.5138815... | 0.86877954 | 0 |
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 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 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 |
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|
Applic... | {
"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.ne... | {
"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 |
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 serv... | {
"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 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 ... | {
"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!')
toke... | {
"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_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 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... | {
"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 ac... | {
"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_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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.