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 |
|---|---|---|---|---|---|---|
| DISPOSE STUFF | | def terminate
super
dispose_spriteset
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finalize\r\n drop_chopsticks\r\n end",
"def dispose; end",
"def dispose\n self.bitmap.dispose\n @layout.bitmap.dispose\n @layout.dispose\n @layoutEquipment.bitmap.dispose\n @layoutEquipment.dispose\n @layoutPotions.bitmap.dispose\n @layoutPotions.dispose\n @icons.bitmap.dispose\... | [
"0.6355605",
"0.63477224",
"0.6250684",
"0.62161934",
"0.6173578",
"0.6148686",
"0.6040303",
"0.6030437",
"0.59844404",
"0.5980334",
"0.59794956",
"0.5979363",
"0.59703463",
"0.5965605",
"0.5965605",
"0.5951558",
"0.5951558",
"0.59513205",
"0.59298235",
"0.59298235",
"0.59265... | 0.5749133 | 34 |
| CREATE GRAPHICS | | def create_backgrounds
create_over
create_hud_bg
create_under
create_flow
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_graph\n end",
"def build_graph_generally(chart_type, categories, series, colors)\n graph = get_graph(chart_type)\n graph.add(:axis_category_text, categories)\n graph.add(:series, \"series legend label\", series)\n graph.add(:theme, \"vote\")\n graph.add(:user_data, :colors, colors... | [
"0.7079489",
"0.6673588",
"0.64538896",
"0.6281078",
"0.6240415",
"0.623008",
"0.6183453",
"0.61444175",
"0.6066718",
"0.60194016",
"0.6015264",
"0.5993427",
"0.5926101",
"0.59029",
"0.5893458",
"0.5861697",
"0.5861164",
"0.58610845",
"0.58566195",
"0.5852351",
"0.57814354",
... | 0.0 | -1 |
| UPDATE STUFF | | def update
update_flow
update_sprites
update_weather
update_timer
update_viewports
@brightness -= 15 if @brightness > 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_update\n do_edit\n update_save\n end",
"def update # EXTENSION\n sql = \"UPDATE tickets SET customer_id = $1, film_id = $2, screening_id = $3 WHERE id = $4\"\n values = [@customer_id, @film_id, @screening_id, @id]\n SqlRunner.run(sql, values)\nend",
"def update\n p \"UPDATE\"\n end",... | [
"0.68517804",
"0.6838884",
"0.6809351",
"0.6739161",
"0.67382485",
"0.6693608",
"0.6685131",
"0.6653031",
"0.6652288",
"0.66356915",
"0.66356915",
"0.66356915",
"0.66356915",
"0.66356915",
"0.66356915",
"0.66356915",
"0.66356915",
"0.6604552",
"0.65969217",
"0.6572028",
"0.65... | 0.0 | -1 |
| DISPOSE GRAPHICS | | def dispose
dispose_backgrounds
dispose_sprites
dispose_weather
dispose_timer
dispose_viewports
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark_children_for_removal\n work_graphics.each do |work_graphic|\n work_graphic.destroy\n end\n end",
"def close_graphics\n @p.close_graphics(self)\n end",
"def destroy\n @graphic.destroy\n end",
"def dispose\n self.bitmap.dispose\n @layout.bitmap.dispose\n @layout.di... | [
"0.6532056",
"0.64161134",
"0.63232654",
"0.6316491",
"0.631403",
"0.62640506",
"0.6243244",
"0.6207238",
"0.61468357",
"0.6133194",
"0.6128749",
"0.6077564",
"0.6044139",
"0.60049886",
"0.5987593",
"0.59771264",
"0.59589463",
"0.5946098",
"0.59162295",
"0.5882364",
"0.587602... | 0.6184346 | 8 |
Check data: make sure various types are known and have corresponding organization category set. | def checkData(dbName)
@db = @conn[dbName]
@edorg_collection = @db[EDORG_COLLECTION]
@edorg_collection.find.each do |row|
type = row[TYPE_FIELD]
body = row[BODY_FIELD]
orgcats = body[ORGCAT_FIELD]
if type == TYPE_VALUE_SCHOOL and not orgcats.include?(ORGCAT_VALUE_SCHOOL)
puts("Error: missing... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_truth\n assert_kind_of OrganizationCategory, organization_categories(:first)\n end",
"def check_input_data(data_category, import_file, export_file)\n category = description_formatting(data_category.to_s).downcase\n\t\n import_file_checked = File.file?(import_file.to_s)\n\texport_file_checked =... | [
"0.60478735",
"0.60015756",
"0.59274554",
"0.5837671",
"0.5691777",
"0.5654511",
"0.5587198",
"0.55713195",
"0.55467933",
"0.5453981",
"0.5361085",
"0.53487104",
"0.5311965",
"0.5305556",
"0.5299662",
"0.5283695",
"0.5270455",
"0.5262095",
"0.524292",
"0.5238098",
"0.5230529"... | 0.6365012 | 0 |
Update entity type to the generic value | def updateEdOrgs(dbName)
@db = @conn[dbName]
@edorg_collection = @db[EDORG_COLLECTION]
nupdated = 0
@edorg_collection.find.each do |row|
did_update = 0
if row[TYPE_FIELD] != TYPE_VALUE_EDORG
@edorg_collection.update({"_id" => row["_id"]},{"$set" => {TYPE_FIELD => TYPE_VALUE_EDORG}})
did_upda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_type=(value)\n @entity_type = value\n end",
"def update!(**args)\n @entity_type_names = args[:entity_type_names] if args.key?(:entity_type_names)\n end",
"def update!(**args)\n @entity_types = args[:entity_types] if a... | [
"0.7037007",
"0.659487",
"0.6571564",
"0.65705615",
"0.65705615",
"0.64897186",
"0.64897186",
"0.6379178",
"0.63548607",
"0.6330441",
"0.6253541",
"0.6222368",
"0.6147455",
"0.61221117",
"0.6084588",
"0.6069527",
"0.6011387",
"0.598343",
"0.5974713",
"0.5953215",
"0.5939067",... | 0.0 | -1 |
Example: this_script.rb all host:myhost.com port:12345 this_script.rb host:myhost.com port:12345 db1 db2 db3 | def parseArgs(argv)
result = { "all" => false, "mongo_host" => "localhost", "mongo_port" => 27017, "tenants" => [] }
for arg in argv
if arg == "--all"
result["all"] = true
elsif arg.include?(":")
host_port = arg.split(':')
result["mongo_host"] = host_port[0]
result["mongo_port"] = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dbs\n if @target_config['DBS'].empty?\n if @target_config['VERSION'].scan(/./)[0].to_i < 5 and not @target_config['VERSION'].nil?\n # MySQL < 5\n print_error(\"DB Version: #{@target_config['VERSION']}\")\n print_error(\"There is no information_schema to query.....\")\n p... | [
"0.5732666",
"0.5663686",
"0.5660475",
"0.5630357",
"0.5629363",
"0.56083465",
"0.55545855",
"0.55467445",
"0.5515718",
"0.54696447",
"0.54193294",
"0.5385484",
"0.538505",
"0.53798515",
"0.5361888",
"0.53540576",
"0.5353661",
"0.5344346",
"0.5336983",
"0.53181744",
"0.531817... | 0.5228538 | 30 |
Initializer, which will register the file format and save any options given as a hash. format:: The file format instance options:: A hash of options that can be used by a specific Source implementation | def initialize(format, options = {})
@options = options
@file_format = format
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(io, options = {})\n @io = io\n @format = options[:format] || FILE_FORMATS.first\n \n raise ArgumentError, \"Invalid format option provided #{options[:format]}\" unless FILE_FORMATS.include?(format)\n end",
"def determine_and_set_format options\n options.form... | [
"0.7364632",
"0.6933441",
"0.6755382",
"0.67321396",
"0.6689621",
"0.6639472",
"0.6574972",
"0.6265125",
"0.62407964",
"0.62084264",
"0.61766577",
"0.6161254",
"0.6156026",
"0.6142424",
"0.6136917",
"0.6105598",
"0.6081584",
"0.60302234",
"0.60229623",
"0.60150933",
"0.600963... | 0.83202904 | 0 |
The prepare method is called before the RequestLogAnalyzer::Source::Baseeach_request method is called. Use this method to implement any initialization that should occur before this source can produce Request instances. | def prepare
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare\n end",
"def prepare\n end",
"def prepare\n super\n end",
"def prepare\n prepare_prerequisites\n @prepared = true\n end",
"def prepare\n end",
"def prepare\n raise NotImplementedError\n end",
"def prepare\n @prepare ||= default_prep... | [
"0.6963331",
"0.6963331",
"0.684946",
"0.66845644",
"0.65844166",
"0.651466",
"0.6513742",
"0.64510334",
"0.642173",
"0.631601",
"0.6265661",
"0.62547415",
"0.62547415",
"0.62547415",
"0.6243855",
"0.61735773",
"0.61683345",
"0.61622214",
"0.61444587",
"0.61342597",
"0.612755... | 0.6683024 | 9 |
This function is called to actually produce the requests that will be send into the pipeline. The implementation should yield instances of RequestLogAnalyzer::Request. options:: A Hash of options that can be used in the implementation. | def each_request(options = {}, &block) # :yields: request
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform(request, options); end",
"def generate_request\r\n end",
"def make_requests requests, pager\n requests.each do |request|\n \n @current_request = request\n # setup the request with the fields required to page\n pager.page(request) do |raw_response|\n ... | [
"0.59361655",
"0.5817755",
"0.5688786",
"0.5610507",
"0.55555815",
"0.5525121",
"0.54797083",
"0.5452425",
"0.5436822",
"0.54218704",
"0.541823",
"0.5416617",
"0.53990215",
"0.5392615",
"0.53838885",
"0.5346134",
"0.53072137",
"0.52984494",
"0.52776146",
"0.52758473",
"0.5248... | 0.5941335 | 0 |
This function is called after RequestLogAnalyzer::Source::Baseeach_request finished. Any code to wrap up, free resources, etc. can be put in this method. | def finalize
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_request\n end",
"def log_request\n result = super\n push_outstanding_request\n result\n end",
"def request_log(request); end",
"def hook_pending_request(request) #THREAD_LOCAL_ACCESS\n wrapped_request, wrapped_response = wrap_request(request)\n state = TingYun::... | [
"0.66970074",
"0.66265386",
"0.650525",
"0.64542586",
"0.63088566",
"0.62896085",
"0.6215198",
"0.6213545",
"0.6194938",
"0.6083429",
"0.60749906",
"0.6074729",
"0.60719717",
"0.5986248",
"0.5955277",
"0.59535927",
"0.59535927",
"0.58985555",
"0.586628",
"0.58468276",
"0.5786... | 0.0 | -1 |
Was the transaction complete? | def complete?
status_code == 'OK'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finished?\n FINAL_STATUSES.include?(transaction_status) || status == COMPLETED\n end",
"def completed?\n \t\tlatest_transaction.completed? unless transactions.empty?\n \tend",
"def set_transaction_complete_flag()\n @is_transaction_complete = true\n end",
"def transaction_already_completed... | [
"0.7925423",
"0.77386403",
"0.73926765",
"0.7280427",
"0.71208286",
"0.70322263",
"0.7013873",
"0.6995075",
"0.6935933",
"0.6931318",
"0.6894564",
"0.6887114",
"0.68705916",
"0.6864825",
"0.6857438",
"0.6792209",
"0.67860085",
"0.67860085",
"0.6775055",
"0.6771483",
"0.673376... | 0.6836388 | 15 |
Was the transaction cancelled? Unfortunately, we can't distinguish "user abort" from "idle too long". | def cancelled?
status_code == 'ABORT'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancelled?\n @status == :cancelled\n end",
"def cancelled?\n @cancelled\n end",
"def cancelled?\n @cancelled\n end",
"def cancelled?\n # the establishment has been cancelled by the user\n request_cancelled?\n end",
"def cancelled?\n return @cancelled\n end",
"de... | [
"0.75850916",
"0.74861276",
"0.74861276",
"0.7424295",
"0.73208886",
"0.7309502",
"0.72919184",
"0.72892475",
"0.72743505",
"0.7127131",
"0.7039697",
"0.7020283",
"0.7011595",
"0.69675595",
"0.6953514",
"0.688486",
"0.6836691",
"0.6828027",
"0.66247845",
"0.6614873",
"0.65965... | 0.7701654 | 0 |
Text version of complete?, since we don't support Pending. | def status
complete? ? 'Completed' : 'Failed'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complete_or_not(bool)\r\n bool ? 'complete' : 'not-complete'\r\n end",
"def completion_aspect\n true_value = \"Completed\"\n false_value = \"Incomplete\"\n self.complete ? true_value : false_value\n end",
"def complete?\n status == \"Completed\"\n end",
"def complete?\n\... | [
"0.74066836",
"0.7262187",
"0.7260288",
"0.7180808",
"0.7041105",
"0.702032",
"0.7003049",
"0.7003049",
"0.6973324",
"0.69248974",
"0.69118285",
"0.688902",
"0.6831376",
"0.6827149",
"0.6824786",
"0.6816266",
"0.67871606",
"0.6781491",
"0.6781491",
"0.6748817",
"0.6747097",
... | 0.6957567 | 9 |
Status of transaction. List of possible values: OK:: Transaction completed successfully. NOTAUTHED:: Incorrect card details / insufficient funds. MALFORMED:: Invalid input data. INVALID:: Valid input data, but some fields are incorrect. ABORT:: User hit cancel button or went idle for 15+ minutes. REJECTED:: Rejected by... | def status_code
params['Status']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status\n @status ||= if checksum_ok?\n if transaction_id.blank?\n 'invalid'\n else\n transaction_status.downcase\n end\n else\n 'tampered'\n end\n end",
"def check_transaction_status\n ... | [
"0.72897434",
"0.7017682",
"0.6821523",
"0.6803435",
"0.67939264",
"0.67692566",
"0.67692566",
"0.67059016",
"0.6703277",
"0.665425",
"0.66303396",
"0.6590336",
"0.6530103",
"0.6517038",
"0.6464535",
"0.6447055",
"0.6417414",
"0.6406895",
"0.6335743",
"0.626631",
"0.6258218",... | 0.0 | -1 |
Check this if completed? is false. | def message
params['StatusDetail']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def completed?\n !!completed\n end",
"def complete?\n false\n end",
"def completed?\n @completed\n end",
"def completed?\n @completed\n end",
"def complete?\n self.complete\n end",
"def completed?\n completed\n end",
"def completed?\n !self.finished_at.nil... | [
"0.81859016",
"0.8120121",
"0.80808115",
"0.80743927",
"0.80289584",
"0.80125856",
"0.8006267",
"0.79421663",
"0.79421663",
"0.7922535",
"0.79129887",
"0.78973925",
"0.78973925",
"0.7885687",
"0.7883014",
"0.7877283",
"0.7867752",
"0.7806963",
"0.77651745",
"0.77206653",
"0.7... | 0.0 | -1 |
Vendorsupplied code (:order mapping). | def item_id
params['VendorTxCode']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def code_for_order(order)\n code_by_zone(order).code || Spina::Shop.config.default_sales_category_code\n end",
"def get_promo_code order\n order ? order[:promo_code] ? order[:promo_code] : nil : nil\n end",
"def extract_code_qty(order)\n return false if order.nil?\n order_item = order... | [
"0.6179349",
"0.61549866",
"0.6015704",
"0.5948963",
"0.5858093",
"0.5789236",
"0.5743092",
"0.5697759",
"0.5610794",
"0.5577878",
"0.55554336",
"0.55495524",
"0.5545056",
"0.5543692",
"0.55350435",
"0.5526102",
"0.55202615",
"0.5510903",
"0.55022144",
"0.54709655",
"0.545675... | 0.0 | -1 |
Authorization number (only if completed?). | def auth_id
params['TxAuthNo']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authorization_status\n @json_body['authorization_status']\n end",
"def social_security\n @num = 12345\n end",
"def authorization_mode; end",
"def authorization_from(response)\n response[:unique_id]\n end",
"def authorization; end",
"def authidcode\n\t\t \tparams['authIdCode']... | [
"0.63112783",
"0.61084074",
"0.5953799",
"0.59337944",
"0.5894682",
"0.5875739",
"0.5833237",
"0.58292586",
"0.582487",
"0.578452",
"0.57496953",
"0.57446957",
"0.5742895",
"0.57420605",
"0.5740927",
"0.5740498",
"0.5740498",
"0.57286507",
"0.5707598",
"0.5700491",
"0.569746"... | 0.6208617 | 1 |
Total amount (no fees). | def gross
params['Amount']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total\n (amount + fee) if amount\n end",
"def total_amount\n @total_amount ||= data_analyzer.total_amount\n end",
"def total_amount\n sum = ::Money.new(1, self.currency)\n @line_items.each {|li| sum += li.total_amount}\n sum -= ::Money.new(1, self.currency)\n sum\n ... | [
"0.831425",
"0.8144064",
"0.81066316",
"0.80967444",
"0.7924808",
"0.79111964",
"0.78524643",
"0.7790984",
"0.77825534",
"0.7758705",
"0.7729021",
"0.77044296",
"0.7697197",
"0.76942235",
"0.76440805",
"0.76374143",
"0.7588997",
"0.7584646",
"0.7583982",
"0.7579848",
"0.75682... | 0.0 | -1 |
AVS and CV2 check results. Possible values: ALL MATCH:: SECURITY CODE MATCH ONLY:: ADDRESS MATCH ONLY:: NO DATA MATCHES:: DATA NOT CHECKED:: | def avs_cv2_result
params['AVSCV2']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cvv_result(response)\n case response[:raw][:CardSecurityCodeMatch]\n when \"Pass\"\n return \"M\" # Match\n when \"Fail\"\n return \"N\" # No Match\n else\n return \"P\" # Not Processed\n end\n end",
"def avs_result(response)\n attrs={... | [
"0.69242316",
"0.6418947",
"0.62798053",
"0.6243541",
"0.6097319",
"0.58754",
"0.5847032",
"0.58242923",
"0.58237916",
"0.5771461",
"0.576802",
"0.574358",
"0.5642078",
"0.56412244",
"0.5558393",
"0.5556618",
"0.55199283",
"0.5517548",
"0.55017763",
"0.5489955",
"0.54898274",... | 0.567435 | 12 |
Numeric address check. Possible values: NOTPROVIDED:: NOTCHECKED:: MATCHED:: NOTMATCHED:: | def address_result
params['AddressResult']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_ip?(address)\n #ternary that validates number count if string or returns false\n address.is_a?(String) ? validate_number_count(address) : false\nend",
"def validateaddress(coinaddress)\n coind.validateaddress\n end",
"def check_address(_)\n raise NotImplementedError\n end",
"def valid_ip?... | [
"0.63719296",
"0.6367603",
"0.63454044",
"0.6312781",
"0.62874883",
"0.62280685",
"0.61973435",
"0.61749274",
"0.6147445",
"0.6033088",
"0.60322684",
"0.60159636",
"0.60159636",
"0.601177",
"0.6002252",
"0.5995453",
"0.597524",
"0.59476805",
"0.5942631",
"0.5942631",
"0.59176... | 0.0 | -1 |
Post code check. Possible values: NOTPROVIDED:: NOTCHECKED:: MATCHED:: NOTMATCHED:: | def post_code_result
params['PostCodeResult']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_post(value,assertion, opt_failure_message = '')\n\tcheck_assertion(value,assertion,CHECK_POST_VIOLATION_CLASS,'Precondition violated',opt_failure_message)\nend",
"def code_promotion_unchecked?\n promo_code.blank?\n end",
"def avs_code_matches?\n return ['Y', 'X', 'P'].include? avs_code... | [
"0.60460037",
"0.56959337",
"0.5509561",
"0.5477602",
"0.5454545",
"0.5428855",
"0.5404048",
"0.5391969",
"0.53893125",
"0.53469676",
"0.5309343",
"0.5309343",
"0.5309343",
"0.5309343",
"0.53084844",
"0.53013366",
"0.529644",
"0.5253436",
"0.52316827",
"0.52316827",
"0.521825... | 0.0 | -1 |
CV2 code check. Possible values: NOTPROVIDED:: NOTCHECKED:: MATCHED:: NOTMATCHED:: | def cv2_result
params['CV2Result']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cvv2_resp_code_matches?\n return ['M'].include? cvv2_resp_code\n end",
"def cvv2_resp_code_matches?\n return ['M'].include? cvv2_resp_code\n end",
"def avs_code_matches?\n return ['Y', 'X', 'P'].include? params['x_avs_code']\n end",
"def avs_code_ma... | [
"0.68839216",
"0.68479437",
"0.61467147",
"0.6142732",
"0.6135581",
"0.6111557",
"0.6012638",
"0.58993095",
"0.585811",
"0.575969",
"0.57307905",
"0.5698579",
"0.5657683",
"0.5645369",
"0.5614706",
"0.56018054",
"0.5593194",
"0.5584627",
"0.55524904",
"0.5515235",
"0.5505578"... | 0.0 | -1 |
Was the Gift Aid box checked? | def gift_aid?
params['GiftAid'] == '1'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def box_checked?(rating)\n if(session[:ratings] == nil) # All boxes checked initially\n return true\n else\n return session[:ratings].include?(rating)\n end\n end",
"def checked?\n state == :on\n end",
"def check_box; end",
"def check\n click unless checked?\n end"... | [
"0.67674756",
"0.65907717",
"0.6472403",
"0.64659214",
"0.64393634",
"0.6435561",
"0.6393778",
"0.63874024",
"0.6352107",
"0.6341477",
"0.626108",
"0.62591803",
"0.62526995",
"0.62479866",
"0.62293565",
"0.61915237",
"0.6165773",
"0.61281323",
"0.6126603",
"0.6118802",
"0.610... | 0.71119785 | 0 |
Result of 3D Secure checks. Possible values: OK:: Authenticated correctly. NOTCHECKED:: Authentication not performed. NOTAVAILABLE:: Card not authcapable, or auth is otherwise impossible. NOTAUTHED:: User failed authentication. INCOMPLETE:: Authentication unable to complete. ERROR:: Unable to attempt authentication due... | def buyer_auth_result
params['3DSecureStatus']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def success?\n self.secure? && self.status == \"1\"\n end",
"def support_3des_auth?\n # Ask for authentication\n buffer = [CMD_3DES_AUTH, 0x00]\n\n begin\n @pcd.picc_transceive(buffer)\n result = true\n rescue CommunicationError\n result = false\n ... | [
"0.6117213",
"0.598348",
"0.58786064",
"0.5825461",
"0.58123595",
"0.57913566",
"0.5727883",
"0.5602052",
"0.5602052",
"0.5602052",
"0.5602052",
"0.55998856",
"0.5597117",
"0.55452037",
"0.55256504",
"0.55028903",
"0.54731256",
"0.54681754",
"0.5438562",
"0.5438562",
"0.54122... | 0.70922565 | 0 |
Encoded 3D Secure result code. | def buyer_auth_result_code
params['CAVV']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def buyer_auth_result\n params['3DSecureStatus']\n end",
"def encryptHex\r\n\t \r\n\t \tif @IV.empty?\r\n\t\t\t_iv = OpenSSL::Cipher::Cipher.new(\"aes-#{ @cipher }-#{ @mode }\").random_iv\r\n\t\telse\r\n\t\t\t_iv= @IV\r\n\t\tend\r\n\t\t\r\n\t\tEncryptor.default_options.merge!(:algorithm => ... | [
"0.57532406",
"0.55592895",
"0.54912364",
"0.54509336",
"0.54509336",
"0.5428671",
"0.5347034",
"0.53335243",
"0.5325869",
"0.5322999",
"0.5309702",
"0.53080696",
"0.529672",
"0.52726334",
"0.52558255",
"0.5219351",
"0.5194221",
"0.5192146",
"0.51832163",
"0.51677245",
"0.516... | 0.53697395 | 6 |
Address confirmation status. PayPal only. Possible values: NONE:: CONFIRMED:: UNCONFIRMED:: | def address_status
params['AddressStatus']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_confirmed?\n return self.status == Erp::Reservations::Reservation::STATUS_CONFIRMED\n end",
"def is_confirmed?\n return self.status == Erp::QuickOrders::Order::STATUS_CONFIRMED\n end",
"def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n... | [
"0.66614634",
"0.66184556",
"0.6514911",
"0.6342267",
"0.6291039",
"0.62524617",
"0.624689",
"0.6204882",
"0.61386704",
"0.612516",
"0.61127853",
"0.61028355",
"0.6077359",
"0.6042464",
"0.6029915",
"0.6022341",
"0.6006337",
"0.59932894",
"0.5981265",
"0.5981114",
"0.59471565... | 0.60821813 | 12 |
Credit card type. Possible values: VISA:: Visa MC:: MasterCard DELTA:: Delta SOLO:: Solo MAESTRO:: Maestro (UK and International) UKE:: Visa Electron AMEX:: American Express DC:: Diners Club JCB:: JCB LASER:: Laser PAYPAL:: PayPal | def credit_card_type
params['CardType']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def credit_card_type(credit_card)\n case credit_card.type\n when \"visa\"\n 'VISA'\n when \"master\"\n 'MC'\n when \"discover\"\n 'DISC'\n when \"american_express\"\n 'AMEX'\n end\n end",
"def credit_card_type\n ... | [
"0.8768292",
"0.80096966",
"0.79097855",
"0.78269786",
"0.7738163",
"0.7722599",
"0.7705371",
"0.7691725",
"0.7577861",
"0.7457667",
"0.7429638",
"0.7359744",
"0.7333627",
"0.73301566",
"0.7311817",
"0.7288104",
"0.72314966",
"0.71848065",
"0.7023508",
"0.69736516",
"0.696616... | 0.76892483 | 8 |
Last four digits of credit card. | def credit_card_last_4_digits
params['Last4Digits']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def card_number_last_four_digits\n hash[\"CardNumberLastFourDigits\"]\n end",
"def last_four\n card_number.slice(-4,4)\n end",
"def card_number_mask\n \"XXX XXXX XXX #{last4}\"\n end",
"def card_number\n card = full_card_number.scan(/(\\d{4})/)\n card[2] = card[1] = ... | [
"0.8789402",
"0.85178304",
"0.79226667",
"0.7398105",
"0.71184736",
"0.7013709",
"0.6884295",
"0.6690934",
"0.66139597",
"0.6472827",
"0.63594466",
"0.6351649",
"0.6339466",
"0.6297325",
"0.62865007",
"0.62649316",
"0.62644446",
"0.6244705",
"0.62373674",
"0.6204919",
"0.6176... | 0.8736607 | 1 |
Used by composition methods, but not supplied by SagePay. | def currency
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def wrapper; end",
"def implementation; end",
"def implementation; end",
"def internal; end",
"def probers; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def private_method\n end",
"def isolated; end",
"def isolated; end",
"def... | [
"0.71454716",
"0.6359389",
"0.63083863",
"0.63083863",
"0.6290937",
"0.62489516",
"0.62132746",
"0.62132746",
"0.62132746",
"0.62132746",
"0.61817497",
"0.61737084",
"0.61737084",
"0.61283106",
"0.60977924",
"0.60977924",
"0.6091983",
"0.6001836",
"0.59879124",
"0.59879124",
... | 0.0 | -1 |
TODO: doesn't dump ivars ++ | def _dump(limit = nil)
tm = decomposed(true)
if (year & 0xffff) != year then
raise ArgumentError, "year too big to marshal: #{year}"
end
gmt = @is_gmt ? 1 : 0
major = 1 << 31 | # 1 bit
gmt << 30 | # 1 bit
(tm[5] - 1900) << 14 | # 16 bits
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_variables() end",
"def create_counter\n i = 0\n obj = Object.new\n (class << obj; self ; end ).class_eval {\n define_method(:inc, lambda { i += 1 } )\n define_method(:dec, lambda { i -= 1 } )\n }\n obj\nend",
"def private; end",
"def __ivars__ ; nil ; end",
"def __ivars__ ; ... | [
"0.5953385",
"0.5943469",
"0.5930514",
"0.5926709",
"0.5926709",
"0.58675015",
"0.5793847",
"0.5754105",
"0.57405925",
"0.57383245",
"0.5681761",
"0.5676371",
"0.56495285",
"0.56478393",
"0.56211907",
"0.56198275",
"0.5602515",
"0.5601795",
"0.5592988",
"0.558921",
"0.5585332... | 0.0 | -1 |
Returns: [ sec, min, hour, day, month, year, wday, yday, isdst, zone ] | def to_a
decomposed(@is_gmt)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_a\n [sec, min, hour, day, month, year, wday, yday, isdst, zone]\n end",
"def to_a\n [time.sec, time.min, time.hour, time.day, time.mon, time.year, time.wday, time.yday, dst?, zone]\n end",
"def get_time()\n arr = []\n x = Time.now.utc + Time.zone_offset('EST')\n # x.zone = \"-04:00\... | [
"0.78070986",
"0.7402217",
"0.61634135",
"0.5933578",
"0.5933138",
"0.5933138",
"0.5933138",
"0.5933138",
"0.5933138",
"0.5888855",
"0.5883111",
"0.58224463",
"0.58224463",
"0.5810563",
"0.57419723",
"0.56834006",
"0.5674039",
"0.5672418",
"0.56167954",
"0.5590839",
"0.556914... | 0.0 | -1 |
validates_format_of :url, :with => URI::regexp(%w(http https www)) validates_format_of :url, :with => URI::DEFAULT_PARSER.regexp[:ABS_URI] | def clicked!
self.click_count += 1
self.save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_url_format\n valid_url = false\n begin\n uri = URI.parse(url)\n valid_url = uri.scheme.present? || uri.host.present?\n rescue URI::InvalidURIError\n valid_url = false\n end\n errors.add(:url, 'format is invalid') unless valid_url\n end",
"def is_valid_url?\n (@url =... | [
"0.8434573",
"0.8035211",
"0.7966413",
"0.7906663",
"0.7871639",
"0.7859905",
"0.78099424",
"0.7791944",
"0.7782318",
"0.77593356",
"0.77331835",
"0.7731496",
"0.7724421",
"0.7719095",
"0.7660609",
"0.7633694",
"0.7628525",
"0.757617",
"0.7570681",
"0.75519043",
"0.7523888",
... | 0.0 | -1 |
Update an existing payment profile | def update(billing_id, creditcard, options = {})
if (response = get_customer_profile(:customer_profile_id => billing_id)).success?
update_customer_payment_profile(
:customer_profile_id => billing_id,
:payment_profile => {
:customer_payment_profile_id => response.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_payment_profile(payment_profile, profile_id, options = {})\n options = @@create_payment_profile_option_defaults.merge(options)\n @type = Type::CIM_UPDATE_PAYMENT\n @fields.merge!(payment_profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n handle_profil... | [
"0.8077831",
"0.7923163",
"0.78890735",
"0.76845104",
"0.7625337",
"0.75946975",
"0.75446236",
"0.7378621",
"0.7369391",
"0.736054",
"0.73142856",
"0.72825074",
"0.7256938",
"0.7241584",
"0.7190991",
"0.71471024",
"0.7133629",
"0.71103835",
"0.7096916",
"0.7096845",
"0.708683... | 0.69436675 | 34 |
Run an auth and capture transaction against the stored CC | def purchase(money, billing_id)
if (response = get_customer_profile(:customer_profile_id => billing_id)).success?
create_customer_profile_transaction(:transaction => { :customer_profile_id => billing_id, :customer_payment_profile_id => response.params['profile']['payment_profiles']['customer_payment_p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capture(money, authorization, options = {})\n post = { trans_id: authorization }\n add_customer_data(post, options)\n commit('PRIOR_AUTH_CAPTURE', money, post)\n end",
"def capture(money, authorization, options = {})\n txn_number, order_id = authorization.split(';')\n\n ... | [
"0.64617825",
"0.6390686",
"0.63761795",
"0.62577724",
"0.6252657",
"0.61744195",
"0.61682075",
"0.61056036",
"0.6032654",
"0.6006411",
"0.5994342",
"0.5963068",
"0.5955442",
"0.5936811",
"0.5912628",
"0.5871637",
"0.5857036",
"0.585524",
"0.5831056",
"0.5828449",
"0.58136666... | 0.0 | -1 |
Destroy a customer profile | def unstore(billing_id)
delete_customer_profile(:customer_profile_id => billing_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @profile.destroy\n end",
"def destroy\n\t\t@profile.destroy\n\t\tset_flash_message :notice, :destroyed\n\t\tredirect_to admin_profiles_url\n\tend",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n end",
"def destroy\n @user_profile = UserProfile.find(params... | [
"0.7693878",
"0.76426023",
"0.7467714",
"0.7464381",
"0.73932505",
"0.7377916",
"0.7279006",
"0.7278692",
"0.7268174",
"0.7259665",
"0.7254592",
"0.7250664",
"0.72447324",
"0.7243199",
"0.7221509",
"0.72160757",
"0.721538",
"0.7204097",
"0.7203389",
"0.7200172",
"0.7197534",
... | 0.0 | -1 |
Get the top 10 popular contents over the last 14 days | def top_paths(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/popular/paths", opts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_popular(*date)\n find_popular_in_structure(@content.dig(*date))\n end",
"def past_popular\n if @page == 1 && @user.last_sign_out_at.present? && @user.last_sign_out_at <= 2.days.ago && @user.current_sign_in_at >= 1.minutes.ago\n popular_in(@user.last_sign_out_at, @user.last_sign_in_at).limit(... | [
"0.6614699",
"0.6438644",
"0.6404362",
"0.63492286",
"0.6345986",
"0.6286327",
"0.6280349",
"0.6273421",
"0.6271661",
"0.6255333",
"0.6191217",
"0.6164382",
"0.6159937",
"0.61481696",
"0.614241",
"0.60963076",
"0.6088798",
"0.6073505",
"0.60647744",
"0.60640657",
"0.60431665"... | 0.0 | -1 |
Get the total number of views and breakdown per day or week for the last 14 days | def views(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/views", opts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def views_for days = 0\n case days\n when 7\n views_last_7\n when 30\n views_last_30\n else\n views\n end\n end",
"def weeks() 7 * days end",
"def calculate_views_count\n self.visits.count.to_i\n end",
"def last_7_day_kwh_usage_by_day\n usage_data = []\n Ti... | [
"0.7133464",
"0.6402245",
"0.635169",
"0.6348968",
"0.62762743",
"0.6275579",
"0.6206692",
"0.6152269",
"0.61448234",
"0.61448234",
"0.609662",
"0.6088941",
"0.6087879",
"0.60783",
"0.6022697",
"0.60187614",
"0.6017074",
"0.5992697",
"0.5992452",
"0.5958496",
"0.5958496",
"... | 0.0 | -1 |
Get the total number of clones and breakdown per day or week for the last 14 days | def clones(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/clones", opts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_week_power_for\n dates, totals = consolidate_week\n\n weekPowerCount = 0\n\n totals.each do |index, total|\n weekPowerCount+=total\n end\n\n weekPowerCount\n end",
"def weeks() 7 * days end",
"def total_weeks\n week_split.size\n end",
"def number_of_weeks\n @numb... | [
"0.6457682",
"0.64039946",
"0.6400044",
"0.62997615",
"0.61346614",
"0.6130263",
"0.60716844",
"0.60253584",
"0.5985133",
"0.59809756",
"0.5961433",
"0.59415936",
"0.5924472",
"0.59154797",
"0.590995",
"0.58838433",
"0.58786625",
"0.58786625",
"0.58778507",
"0.5865232",
"0.58... | 0.0 | -1 |
this is for admin page | def admin
if user_signed_in?
redirect_to members_url
else
redirect_to new_user_session_path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_logic\n end",
"def admin\n #TODO\n end",
"def admin\n\n end",
"def admin\n end",
"def admin\n end",
"def admin\n end",
"def admin\n end",
"def show\n\t\trequire_admin!\n\tend",
"def show\n checkadmin\n end",
"def admin_index\n return unless (user_is_allowed_to 'vi... | [
"0.7940408",
"0.74575615",
"0.74428725",
"0.7437061",
"0.7437061",
"0.7437061",
"0.7437061",
"0.74291795",
"0.7091065",
"0.70388556",
"0.70029575",
"0.69356245",
"0.6880278",
"0.6864705",
"0.6732545",
"0.6719622",
"0.6695875",
"0.6689519",
"0.6670768",
"0.66576475",
"0.664088... | 0.0 | -1 |
Process series can only be called within via .run Has two params begin and end of series | def process(start, finish)
# Clean up
array.clear
# Iterate
start.upto(finish) do |n|
if n % (first_number * second_number) == 0
array << word1 + word2
elsif n % first_number == 0
array << word1
elsif n % second_number == 0
array << word2
else
arr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def series(*eras); end",
"def run\n if series?\n series.map do |tf|\n { timeframe: tf, value: new_query(tf).run }\n end\n else\n new_query(timeframe).run\n end\n end",
"def runs; end",
"def run() end",
"def process; end",
"def process; end",
"def process;... | [
"0.5921617",
"0.58762455",
"0.54993397",
"0.5328012",
"0.53224343",
"0.53224343",
"0.53224343",
"0.53224343",
"0.53224343",
"0.53224343",
"0.53224343",
"0.53224343",
"0.52853",
"0.52697307",
"0.52697307",
"0.5249108",
"0.5249108",
"0.52490014",
"0.52490014",
"0.52490014",
"0.... | 0.0 | -1 |
Lets you do d2 d1 and get [0, 1] | def - other
[ self[0] - other[0], self[1] - other[1] ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def two1 a; a[0] + a[1] end",
"def vector_to(point2)\n end",
"def link(p1, p2)\n return [1, 0, p1.first] if p1.first == p2.first\n k = (p2.last - p1.last) * 1.0 / (p2.first - p1.first)\n [-k, 1, p1.last - k * p1.first]\nend",
"def call v1, v2\n # \"Readable\" method provided for the parentheticall... | [
"0.580218",
"0.54993826",
"0.54849213",
"0.54213536",
"0.5307071",
"0.5282615",
"0.5262049",
"0.52604014",
"0.5172174",
"0.5153943",
"0.5153943",
"0.5139533",
"0.510128",
"0.5094889",
"0.50757164",
"0.50757164",
"0.50757164",
"0.50711083",
"0.5069146",
"0.5066131",
"0.5052187... | 0.4637159 | 98 |
Lets you do d1 ^ [0, 1] and get d2 (basic vector addition) | def ^ vector
file, rank = (self[0]+vector[0]).chr, (self[1]+vector[1]).chr
"#{file}#{rank}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def +(vector2)\n end",
"def suppremum(d0, d1)\n d0 | d1\n end",
"def +(vector)\n end",
"def addition( vector2 )\n i = @i + vector2.i\n j = @j + vector2.j\n pt = Point2D.new(i, j)\n vectorAdd = Vector2D.new( 0, 0 )\n vectorAdd.initializeWithPoint( pt )\n \n return vectorAd... | [
"0.6725406",
"0.66043746",
"0.6312498",
"0.62323755",
"0.61899495",
"0.6107704",
"0.6106819",
"0.60930324",
"0.60659975",
"0.59535897",
"0.5938439",
"0.5930331",
"0.59042954",
"0.5879735",
"0.58518267",
"0.58511496",
"0.5792598",
"0.57887375",
"0.57556546",
"0.5750881",
"0.57... | 0.0 | -1 |
for [3,0] yields [1,0], [2,0], and [3,0] in succession for [2,2] yields [1,1], and [2,2] in succession | def walk
1.upto( self.map(&:abs).max ) do |mult|
yield [ basis[0] * mult, basis[1] * mult ]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_three_num_combos(nums)\n combos = []\n 0.upto(nums.size - 3) do |i1|\n 1.upto(nums.size - 2) do |i2|\n 2.upto(nums.size - 1) do |i3|\n combos << [nums[i1], nums[i2], nums[i3]] if i3 > i2 && i2 > i1\n end\n end\n end\n combos\nend",
"def combinations(arr)\n res = []\n i =... | [
"0.6242467",
"0.622526",
"0.61996716",
"0.61935395",
"0.618391",
"0.61401665",
"0.6130816",
"0.612212",
"0.61053056",
"0.60772735",
"0.6062726",
"0.6034528",
"0.6030415",
"0.60278136",
"0.60049",
"0.6001125",
"0.5997984",
"0.59919924",
"0.5990804",
"0.594944",
"0.5915983",
... | 0.0 | -1 |
Lets you do d2 d1 and get [0, 1] | def - other
self.to_s - other.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def two1 a; a[0] + a[1] end",
"def vector_to(point2)\n end",
"def link(p1, p2)\n return [1, 0, p1.first] if p1.first == p2.first\n k = (p2.last - p1.last) * 1.0 / (p2.first - p1.first)\n [-k, 1, p1.last - k * p1.first]\nend",
"def call v1, v2\n # \"Readable\" method provided for the parentheticall... | [
"0.58013684",
"0.54988605",
"0.54859763",
"0.54216695",
"0.5308603",
"0.5283217",
"0.526359",
"0.5259944",
"0.5172982",
"0.5154843",
"0.5154843",
"0.51394886",
"0.51025593",
"0.5096318",
"0.5076278",
"0.5076278",
"0.5076278",
"0.50705427",
"0.5070494",
"0.50667095",
"0.505220... | 0.0 | -1 |
Lets you do d1 ^ [0, 1] and get d2 (basic vector addition) | def ^ other
(self.to_s ^ other).to_sym
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def +(vector2)\n end",
"def suppremum(d0, d1)\n d0 | d1\n end",
"def +(vector)\n end",
"def addition( vector2 )\n i = @i + vector2.i\n j = @j + vector2.j\n pt = Point2D.new(i, j)\n vectorAdd = Vector2D.new( 0, 0 )\n vectorAdd.initializeWithPoint( pt )\n \n return vectorAd... | [
"0.6727926",
"0.6604169",
"0.6314554",
"0.6234529",
"0.6188737",
"0.6109646",
"0.61081755",
"0.60955524",
"0.60662824",
"0.59554887",
"0.5939985",
"0.5931744",
"0.5907793",
"0.58814347",
"0.5853056",
"0.5851583",
"0.5793583",
"0.57899225",
"0.57555634",
"0.5753004",
"0.575076... | 0.0 | -1 |
Avoid creating String garbage objects when needing a readonly String representation of a Symbol. | def to_s_const
@to_s_const ||= to_s.freeze
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n \"#{symbol}\"\n end",
"def turn_symbol_into_string(symbol)\n symbol.to_s\nend",
"def turn_symbol_into_string(symbol)\n\tn = :foobar\n\tn.to_s\nend",
"def turn_symbol_into_string(symbol)\n symbol.to_s\nend",
"def turn_symbol_into_string(symbol)\n symbol.to_s\nend",
"def turn_symb... | [
"0.7077892",
"0.69391483",
"0.6925527",
"0.68993413",
"0.68993413",
"0.68993413",
"0.6742546",
"0.6672603",
"0.6669752",
"0.65709984",
"0.64887595",
"0.6410727",
"0.63657135",
"0.6275201",
"0.6275201",
"0.6224038",
"0.6224038",
"0.6224038",
"0.6224038",
"0.6224038",
"0.622403... | 0.5614023 | 64 |
initialize from both a Mongo and Web hash | def initialize(hash)
@longitude = hash[:lng] if hash.key?(:lng)
@latitude = hash[:lat] if hash.key?(:lat)
if hash.key?(:type)
@type = hash[:type]
@longitude = hash[:coordinates][0]
@latitude = hash[:coordinates][1]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize hash\n @hash = hash\n end",
"def initialize(hash)\n load_hash(hash)\n end",
"def initialize(a_hash)\n from_h(a_hash)\n end",
"def init\n digest = self.digest || ''\n @digest_parts = parse_digest(digest) || {}\n end",
"def initialize(hash={})\n ... | [
"0.63894224",
"0.63485813",
"0.6210602",
"0.6125273",
"0.61213905",
"0.61122125",
"0.6086798",
"0.6085433",
"0.60605615",
"0.60549104",
"0.6037736",
"0.6023056",
"0.6011212",
"0.6009199",
"0.5996997",
"0.59609807",
"0.59469813",
"0.5946388",
"0.5943327",
"0.5934415",
"0.59098... | 0.0 | -1 |
Returns the full name of the character, including the prefix and suffix. character.full_name => "Adries the Explorer" | def full_name
[prefix, name, suffix].join("")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def short_name\r\n return \"#{first_name[0].chr}. #{last_name}\"\r\n end",
"def full_name()\n @name.to_s\n end",
"def full_name\n name\n end",
"def display_name\n full_name.join(\" \")\n end",
"def full_name\n self.name ? \"#{self.name.split(' ')[0..-2].join(' ')}, #{self... | [
"0.74724555",
"0.7333817",
"0.7295611",
"0.7170936",
"0.7170021",
"0.7118008",
"0.710249",
"0.70980054",
"0.7094307",
"0.7068687",
"0.7039857",
"0.7039522",
"0.7036147",
"0.7015562",
"0.70087224",
"0.70078725",
"0.7000444",
"0.6994717",
"0.6991989",
"0.6991989",
"0.6991989",
... | 0.7467655 | 1 |
Returns a classic character description. characer.description => "Level 48 Human Warrior" | def description
"Level #{level} #{race} #{class_name}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description\n description = \"\"\n if @monster\n puts \"An evil #{@monster.monster} is here.\"\n else\n puts \"The room is eerily quite.\"\n end\n end",
"def display_character_blah\n \n puts \"Name: #{name}\"\n puts \"Bio: #{description}\"\n end",
"def... | [
"0.7217011",
"0.6960438",
"0.6849403",
"0.6833987",
"0.6797088",
"0.67589915",
"0.6745627",
"0.6744215",
"0.6666218",
"0.6618066",
"0.6616127",
"0.65895057",
"0.65746635",
"0.6521977",
"0.6507864",
"0.64481246",
"0.6429414",
"0.64076746",
"0.6407015",
"0.6403584",
"0.640233",... | 0.6611763 | 11 |
So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1: 1 2: 3: 1,3 3: 6: 1,2,3,6 4: 10: 1,2,5,10 5: 15: 1,3,5,15 6: 21: 1,3,7,21 7: 28: 1,2,4,7,14,28 8: 36: 1,2,3,4,6,9,... | def divisor_counter(n)
i, count = 1, 0
until i * i > n
if n % i == 0
count += 1
count += 1 if i * i != n
end
i += 1
end
count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def triangle_number_with_gt_n_divisors(n)\n triangle_number = 1\n num_to_add = 2\n while divisors(triangle_number) <= n\n triangle_number = triangle_number + num_to_add\n num_to_add += 1\n end\n triangle_number\nend",
"def triangle_divisors(n)\n count = 2\n triangle = 1\n \n while\n triangle +=... | [
"0.7162107",
"0.7154976",
"0.71241766",
"0.70580536",
"0.70126474",
"0.69784105",
"0.69580036",
"0.6957392",
"0.69470716",
"0.6788541",
"0.6729871",
"0.6699522",
"0.66397595",
"0.65426075",
"0.65132654",
"0.6429914",
"0.6342923",
"0.6329128",
"0.6323199",
"0.62888306",
"0.623... | 0.0 | -1 |
Public : Specified to string method | def to_s
str = " Batch Errors:\n"
if batch_errors
str += batch_errors.map{ |be| "\t" + be.to_s }.join("\n")
end
return str
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_str() end",
"def to_str() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() end",
"def to_s() ... | [
"0.8715527",
"0.8715527",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
"0.86176115",
... | 0.0 | -1 |
Public : Helper method for the ApiFaultDetail constructor to initialize the batch errors array | def initialize_batch_errors(batch_errors_hash)
return if batch_errors_hash.nil?
if batch_errors_hash[:batch_error].is_a?(Array)
self.batch_errors = []
batch_errors_hash[:batch_error].each do |be|
self.batch_errors << init_batch_error(be)
end
elsif batch_errors_hash[:batch_error].is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_batch_errors(batch_errors_hash)\n\t\t\t\treturn if batch_errors_hash.nil?\n\t\t\t\t\n\t\t\t\tif batch_errors_hash[:batch_error].is_a?(Array)\n\t\t\t\t\tself.batch_errors = []\n\t\t\t\t\tbatch_errors_hash[:batch_error].each do |be|\n\t\t\t\t\t\tself.batch_errors << BingAdsApi::BatchError.new(be)\n\t\... | [
"0.7182728",
"0.6260985",
"0.61076474",
"0.60463244",
"0.5958766",
"0.594078",
"0.5907197",
"0.58562934",
"0.57942384",
"0.5782094",
"0.57725954",
"0.5764813",
"0.57527316",
"0.57527316",
"0.57510954",
"0.57510954",
"0.5742675",
"0.5737531",
"0.57359344",
"0.57318455",
"0.572... | 0.6895694 | 1 |
Intermediate Quiz 1, Question 6 Alyssa was asked to write an implementation of a rolling buffer. Elements are added to the rolling buffer and if the buffer becomes full, then new elements that are added will displace the oldest elements in the buffer. She wrote two implementations saying, "Take your pick. Do you like <... | def rolling_buffer1(buffer, max_buffer_size, new_element)
buffer << new_element
buffer.shift if buffer.size >= max_buffer_size
buffer
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element # Mutates the caller \n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > ma... | [
"0.8588265",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85451865",
"0.85021573",
"0.8438502",
"0.836496",
"0.8168037",
"0.8076811",
"0.8076811",
"0.8076811",
"0.80743146",
"0.8074157",
"0.67... | 0.85437256 | 24 |
Dataset Action :pull_result_hooks([], [res]) Pull the hook specific to the type of result | def hook__pull_result_hooks(_hook_args, event_args)
pull_hook(:"on_result_ready_#{event_args.first}", *event_args)
pull_hook(:on_processing_ready) if next_task(nil, false).nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hook__pull_result_hooks(_hook_args, event_args)\n pull_hook(:\"on_result_ready_#{event_args.first}\", *event_args)\n pull_hook(:on_preprocessing_ready) if done_preprocessing?\n end",
"def run_after_each_hooks( env, result )\n hooks = env[:hooks][:after_each]\n hooks += env[:hooks][:after_sta... | [
"0.6934976",
"0.65026534",
"0.61167514",
"0.5915293",
"0.5886019",
"0.5797938",
"0.5737207",
"0.5731895",
"0.5698772",
"0.56849843",
"0.5677532",
"0.565067",
"0.5629698",
"0.55687886",
"0.55369174",
"0.55319804",
"0.5498671",
"0.5481208",
"0.5465356",
"0.54643446",
"0.5426111... | 0.6620284 | 1 |
pass an argument to a lazyinit method Returns PI as a string with a custom number of digits. | def compute_pi(digits: 15)
precision = digits
result = BigMath.PI(precision)
result = result.truncate(precision).to_s
result = result[2..-1] # Remove '0.'
result = result.split('e').first # Remove 'e1'
result.insert(1, '.')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(digits)\n @value = digits.to_s.to_i\n end",
"def prec_i() end",
"def number(placeholder = nil)\n generate(placeholder, NUMBER_CHARACTERS)\n end",
"def converter(n, decimals=0, base=$pi)\r\n #your code here\r\nend",
"def my_pi(n)\n\t#p Math::PI\n\tMath::PI.round(n)\nend",
"def ... | [
"0.60836375",
"0.603295",
"0.5943921",
"0.5892147",
"0.5859975",
"0.57954615",
"0.5775898",
"0.5771584",
"0.57675904",
"0.57492006",
"0.5735362",
"0.5722223",
"0.5700029",
"0.56966645",
"0.5665457",
"0.56513506",
"0.5628917",
"0.562762",
"0.55992603",
"0.5597678",
"0.5574334"... | 0.54170984 | 31 |
Required options: :wmid WMID Optional: :password on Classic key or Light X509 certificate & key :key Base64 string for Classic key OR :key OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object :cert OpenSSL::X509::Certificate object :ca_cert file CA certificate or path to directory with certs (in PEM format) | def initialize(opt = {})
unless check_libxml_version
$stderr.puts "WARNING: webmoney lib will not work correctly with nokogori compiled with libxml2 version < 2.7.0"
end
@wmid = Wmid.new(opt[:wmid])
# classic or light
case opt[:key]
when String
@signer = Signer.new(@wmid, opt[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_config(options)\n if options.include?(:certificate)\n {:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(options[:key])),\n :SSLCertificate => OpenSSL::X509::Certificate.new(File.read(options[:certificate])),\n }\n else\n nil\n end\n end",
"def key_pem; ... | [
"0.6039673",
"0.6025769",
"0.59736013",
"0.5917219",
"0.59009445",
"0.5895679",
"0.58569443",
"0.5842638",
"0.57569134",
"0.5756009",
"0.56756574",
"0.56161785",
"0.56047744",
"0.558531",
"0.558531",
"0.558531",
"0.5582797",
"0.5582797",
"0.55367947",
"0.5502017",
"0.5502017"... | 0.49894974 | 97 |
Webmoney instance is classic type? | def classic?
!! @signer
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_type; end",
"def type\n return :basic if @is_basic\n return :platinum if @is_platinum\n return :centurion if @is_centurion\n return :premium if @is_premium\n :unknown\n end",
"def object_type?\n @data[:object_type]\n end",
"def will_be?(type)\n single_cla... | [
"0.6228075",
"0.6140642",
"0.6107158",
"0.607664",
"0.60671437",
"0.60604936",
"0.6059202",
"0.6010961",
"0.6010961",
"0.59857196",
"0.5979028",
"0.59730774",
"0.5964528",
"0.5948659",
"0.59291005",
"0.5912315",
"0.5911229",
"0.5892774",
"0.58777905",
"0.5862149",
"0.58615613... | 0.0 | -1 |
Check existent WMID or not Params: wmid | def wmid_exist?(wmid)
request(:find_wm, :wmid => Wmid.new(wmid))[:retval] == 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _net_wm(id) ; %Q{xprop -id #{id} _NET_WM_PID} ; end",
"def window_exist?(id)\n raise WindowError, \"Window #{id} doesn't exist\" unless @windows.key?(id)\n\n true\n end",
"def equip_wtype_ok?(wtype_id)\r\n features_set(FEATURE_EQUIP_WTYPE).include?(wtype_id)\r\n end",
"def check\n ... | [
"0.5753611",
"0.556423",
"0.52890587",
"0.5256211",
"0.52144355",
"0.52111375",
"0.5207963",
"0.51780015",
"0.510957",
"0.5080293",
"0.50363916",
"0.50244695",
"0.50068235",
"0.5003063",
"0.4996866",
"0.4989175",
"0.49754372",
"0.49632978",
"0.49422517",
"0.49315366",
"0.4914... | 0.8579821 | 0 |
Generic function for request to WMTinterfaces | def request(iface, opt ={})
raise ArgumentError, "should be hash" unless opt.kind_of?(Hash)
# Use self wmid when not defined
opt[:wmid] ||= @wmid
# Do request
res = https_request(iface, make_xml(iface, opt))
# Parse response
doc = Nokogiri::XML(res)
parse_retval(iface, doc)
make_r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_request(service); end",
"def notifyinterface\r\n\t\t\t`#{BITS::BITSADMIN} /getnotifyinterface {#{@id}}`\r\n\t\tend",
"def interface; end",
"def interface; end",
"def request(*args); end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end... | [
"0.5675495",
"0.55544555",
"0.5545482",
"0.5545482",
"0.5436252",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.54307353",
"0.5419401",
"0.539532",
"0.5358164",
"0.53347707",
"0.5... | 0.5770825 | 0 |
Signing string by instance wmid's, return signed string | def sign(str)
@signer.sign(str) unless str.nil? || str.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signed_string\n \"service=#{params['service']}&v=#{params['v']}&sec_id=#{params['sec_id']}¬ify_data=#{params['notify_data']}#{key}\"\n end",
"def signature\n Base64.encode64(digest_with_key(string_to_sign)).strip\n end",
"def sign secret, string_to_sign, digest_method = 'sha256'\... | [
"0.70593685",
"0.7023396",
"0.69561803",
"0.69024724",
"0.68244964",
"0.67870617",
"0.6776197",
"0.6763827",
"0.6601994",
"0.6527633",
"0.6515334",
"0.65067583",
"0.64977944",
"0.6454172",
"0.6402352",
"0.63277864",
"0.6326527",
"0.63103724",
"0.63001484",
"0.63001484",
"0.62... | 0.6585097 | 9 |
Make HTTPS request, return result body if 200 OK | def https_request(iface, xml)
@last_request = @last_response = nil
url = case iface
when Symbol
@interfaces[iface]
when String
URI.parse(iface)
end
raise ArgumentError, iface unless url
http = Net::HTTP.new(url.host, url.port)
http.verify_mode = OpenSSL::SSL::VERIFY_P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def httpsRequest (url)\n\turi = URI.parse(url)\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = true\n\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\trequest = Net::HTTP::Get.new(uri.request_uri)\n\tresponse = http.request(request)\n\treturn response\nend",
"def fetch_url(https,req)\n res = https... | [
"0.7449816",
"0.7439717",
"0.72965854",
"0.71266884",
"0.6770348",
"0.67517287",
"0.67380863",
"0.6723383",
"0.6491104",
"0.6488604",
"0.6461079",
"0.641945",
"0.6419142",
"0.63871837",
"0.63820076",
"0.6369213",
"0.63485765",
"0.6238007",
"0.6224935",
"0.6215117",
"0.6193894... | 0.62795854 | 17 |
Create unique Request Number based on time, return 16 digits string | def reqn
t = Time.now
msec = t.to_f.to_s.match(/\.(\d\d)/)[1] rescue '00'
t.strftime('%Y%m%d%H%M%S') + msec
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_id\n Time.now.to_f.to_s.ljust(16, '0') + rand(10).to_s\n end",
"def unique_transaction_number\n chars = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten\n string = (0...10).map{ chars[rand(chars.length)] }.join + Time.now.to_i.to_s\n end",
"def request_id\n S... | [
"0.7657467",
"0.7569826",
"0.7270492",
"0.7270492",
"0.7187476",
"0.71535224",
"0.7128025",
"0.71220285",
"0.6907103",
"0.69066316",
"0.6897441",
"0.6878562",
"0.6865421",
"0.6852",
"0.6840381",
"0.68006516",
"0.678076",
"0.67558587",
"0.6683215",
"0.6671825",
"0.66617376",
... | 0.0 | -1 |
Using array and string methods Passing in one argument Specs Your task is to make a function that can take any nonnegative integer as a argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number. Examples: Input: 21445 Output: 54421 Input: 145263 ... | def descending_order(n)
arr = n.to_s.chars
arr = arr.sort.reverse
(arr*"").to_i
# Your code goes here
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_number(n)\nn = n.to_s\narr = []\n n.length.times do |i|\n arr << n[i].to_i\n end\narr.sort!.reverse!\nstr= \"\"\narr.each do |i| str = str + \"#{i}\"\nend\nstr.to_i\nend",
"def descending_order(n)\n digit_arr = n.to_s.chars\n sorted_str = digit_arr.sort.reverse.join\n sorted_num = sorted_str.to_... | [
"0.81980956",
"0.78914714",
"0.78719914",
"0.78698313",
"0.78612196",
"0.77927387",
"0.77875865",
"0.7786954",
"0.77849954",
"0.7778253",
"0.77526987",
"0.7700067",
"0.76773876",
"0.7668865",
"0.7668865",
"0.7658559",
"0.7654411",
"0.76158136",
"0.76010615",
"0.7482496",
"0.7... | 0.7615452 | 18 |
Returns the current track | def current_track
reload
@tracks[@current_track_index]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_track\n return @interface.GetCurrentTrack.first\n end",
"def current_track\n IITTrack.new(@ole.CurrentTrack)\n end",
"def current_track\n path_root = File.expand_path(File.dirname(__FILE__))\n path = File.join(path_root, @script)\n current = `osascript #{path}`\... | [
"0.9097345",
"0.81257474",
"0.7593327",
"0.7193167",
"0.70804363",
"0.70703393",
"0.6979415",
"0.6905",
"0.6905",
"0.6905",
"0.6905",
"0.68176025",
"0.6783908",
"0.6746121",
"0.6640236",
"0.6634452",
"0.6615195",
"0.6615195",
"0.6608089",
"0.65685374",
"0.65586287",
"0.6552... | 0.8301204 | 1 |
Sets the current track in this playlist to the given track. Will add the track to to the playlist if it isn't already included. | def current_track=(track)
if (track)
reload
idx = index(track.url)
if (idx)
@current_track_index = idx
else
add_track(track)
@current_track_index = @tracks.count - 1
end
save
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_track(track)\n unless self.tracks.include?(track)\n self.tracks << track\n end\n \n track\n end",
"def add_track(track)\n raise \"Track already belongs to album '#{track.album}'.\" if track.album\n @tracks << track if !@tracks.include?(track)\n track._al... | [
"0.73691285",
"0.73263633",
"0.7027428",
"0.683709",
"0.6624555",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.661606",
"0.6497643",
"0.647156",
"0.6400623",
"0.6328496",
"0.63018495",
"0.63018495",
"0.629411... | 0.7119928 | 2 |
Returns the current track index | def current_track_index
reload
@current_track_index
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_track\n return @interface.GetCurrentTrack.first\n end",
"def current_track\n reload\n @tracks[@current_track_index]\n end",
"def nextTrack(current_track)\n if current_track == @tracks.length() - 1\n return 0\n else \n return current_track + 1\n end\n end",
... | [
"0.76120937",
"0.730153",
"0.728895",
"0.7218544",
"0.7131055",
"0.7074663",
"0.67541647",
"0.6739014",
"0.6739014",
"0.6739014",
"0.6739014",
"0.6723244",
"0.6717415",
"0.6711574",
"0.67061204",
"0.6627376",
"0.6574244",
"0.6490884",
"0.64735705",
"0.6387405",
"0.6288227",
... | 0.7954215 | 0 |
Sets the current track index | def current_track_index=(index)
reload
@current_track_index = index
save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_track_index\n reload\n @current_track_index\n end",
"def current_track=(track)\n if (track)\n reload\n idx = index(track.url)\n if (idx)\n \t @current_track_index = idx\n else\n \t add_track(track)\n \t @current_track_index = @tracks.cou... | [
"0.75716597",
"0.7287108",
"0.6907876",
"0.6616293",
"0.6535833",
"0.64937353",
"0.64382434",
"0.6434453",
"0.6408522",
"0.63585407",
"0.6357292",
"0.6293032",
"0.629233",
"0.6283701",
"0.6283582",
"0.6282583",
"0.6192159",
"0.6172719",
"0.6124675",
"0.6109783",
"0.6109658",
... | 0.8423329 | 0 |
Returs the tracks in this playlist | def tracks
reload
@tracks
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tracks!\n tracks = RSpotify::Track.search(self.keyword, limit: 50, offset: 0).sort_by(&:popularity)\n\n tracks.delete_if { |t| t.popularity < 45 }\n tracks = tracks.uniq { |t| t.artists.first.name } \n\n raise 'The playlist could not be generated' if tracks.size < 4\n ... | [
"0.69889766",
"0.65230054",
"0.633209",
"0.6302473",
"0.6158648",
"0.6085266",
"0.5978298",
"0.5974301",
"0.5968249",
"0.5896003",
"0.58808506",
"0.58730733",
"0.5868314",
"0.5867719",
"0.5866305",
"0.5849041",
"0.5833321",
"0.58044785",
"0.5801247",
"0.57905567",
"0.5746984"... | 0.7141589 | 0 |
Sets the track list for this playlist. Resets the current index to 0 | def tracks=(tracks)
reload
@tracks = track
@current_track_index = 0
save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_playlists_track\n @playlists_track = PlaylistsTrack.find(params[:id])\n end",
"def index\n set_song_list\n end",
"def set_song_list\n @song_list_song = SongListSong.find(params[:id])\n end",
"def set_songlist\n @songlist = Songlist.find(params[:id])\n end",
"def se... | [
"0.65137947",
"0.61849123",
"0.6118105",
"0.6091902",
"0.60331404",
"0.5932596",
"0.592903",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.5910436",
"0.58864236",
"0.58785135",
"0.5832891",
"0.58311546"... | 0.6068359 | 4 |
Returns the track immediately preceding the current track in this playlist | def previous_track
reload
(@current_track_index > 0 ? @tracks[@current_track_index - 1] : nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def previous_track()\n @ole.PreviousTrack()\n end",
"def prev_in_playlist\n self.new_record? ? nil : (self.in_playlist? ? VirtualClassroomLesson.where(:user_id => self.user_id, :position => (self.position - 1)).first : nil)\n end",
"def do_previous\n do_command('requests/status.json?command=pl_p... | [
"0.7120422",
"0.6906998",
"0.669509",
"0.665982",
"0.6527983",
"0.6500377",
"0.6455511",
"0.64225113",
"0.6389719",
"0.6385113",
"0.6385113",
"0.6370699",
"0.63471997",
"0.6329143",
"0.6323744",
"0.6304932",
"0.6303182",
"0.6279164",
"0.62712884",
"0.62259924",
"0.6180176",
... | 0.7119711 | 1 |
Returns the track immediately following the current track in this playlist | def next_track
reload
@tracks[@current_track_index + 1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def following\n my_index = participants.find_index do |path|\n path == @my_path\n end\n return nil if my_index == 0 # must be the leader then\n\n return participants[my_index-1]\n end",
"def prev_in_playlist\n self.new_record? ? nil : (self.in_playlist? ? VirtualClassroomLesson.... | [
"0.6707827",
"0.66656953",
"0.6609304",
"0.65805906",
"0.6514182",
"0.64993453",
"0.6425196",
"0.6376926",
"0.6249098",
"0.6242918",
"0.6142522",
"0.61293447",
"0.61103004",
"0.6101246",
"0.6026473",
"0.5874294",
"0.5858932",
"0.58223593",
"0.58204466",
"0.5798313",
"0.578728... | 0.6235014 | 10 |
Adds the given track to the playlist | def add_track(track)
reload
@tracks << track
save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_track(playlistID, track, artist)\n post(:session, {:method => \"playlist.addTrack\", :playlistID => playlistID, :track => track, :artist => artist})\n end",
"def add_track(track)\n unless self.tracks.include?(track)\n self.tracks << track\n end\n \n trac... | [
"0.8189424",
"0.8143365",
"0.7811133",
"0.7775196",
"0.77610034",
"0.7752185",
"0.7667266",
"0.7606358",
"0.76045984",
"0.7430038",
"0.7364608",
"0.7215814",
"0.72116953",
"0.7145501",
"0.7077555",
"0.7077555",
"0.7077555",
"0.7077555",
"0.7077555",
"0.7077555",
"0.7050504",
... | 0.7927214 | 2 |
Returns the index of the given track in the playlist, or nil if the track was not found. | def index(url)
reload
@tracks.map(&:url).index(url)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_playlist_by_name name\n @playlists.each do |playlist|\n return playlist.index if name == playlist.name\n end\n end",
"def play_list_song_id(song_row)\n @play_list ? song_row[IDX_PLAYLIST_ID] : nil\n end",
"def get_track_number(trackblock=nil)\n if trackblock.blank?\n n=self.tag... | [
"0.6710098",
"0.580656",
"0.5798076",
"0.5790317",
"0.5757488",
"0.5556514",
"0.5535557",
"0.5420975",
"0.5405268",
"0.5390225",
"0.538108",
"0.5373037",
"0.5318242",
"0.5289365",
"0.52615005",
"0.5235289",
"0.5235289",
"0.5235289",
"0.5235289",
"0.52141476",
"0.5206029",
"... | 0.0 | -1 |
Sets up the test environment for functional tests | def setup_request_environment(controller_class)
controller_class.class_eval do
def rescue_action(e)
raise e
end
end
@controller = controller_class.new
@controller.request = @request = ActionController::TestRequest.new
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_environment; end",
"def setup\n # NOTE: We do not yet assume any contents of the depot. When we do,\n # I have some code for populating test fixtures, although it leans a bit\n # toward Rails' conventions. We can probably 'derail' it. :)\n\n # Specify the environment, e.g. development vs.... | [
"0.75978357",
"0.7175146",
"0.7157438",
"0.6998523",
"0.6950235",
"0.68871266",
"0.6835336",
"0.6676797",
"0.6676797",
"0.6670085",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
"0.6663627",
... | 0.0 | -1 |
= main = Traitement principal de la commande 'taches' | def exec_commande_taches
# On affiche toujours la liste des tâches
clear
taches.wait_for_choix_and_execute
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"def texte_aide\n <<-EOT\n=== Aide pour les tâches ===\\033[0m\n\nAjouter une tâche (avec ou ... | [
"0.6070698",
"0.6070698",
"0.60239565",
"0.5858347",
"0.5814335",
"0.56902844",
"0.56409454",
"0.5636276",
"0.56068313",
"0.5589402",
"0.5589402",
"0.5589402",
"0.55682766",
"0.55447984",
"0.55243534",
"0.55091393",
"0.5493066",
"0.5482582",
"0.54791427",
"0.54586816",
"0.545... | 0.7154906 | 0 |
Retourne le texte d'aide | def texte_aide
<<-EOT
=== Aide pour les tâches ===\033[0m
Ajouter une tâche (avec ou sans description)
#{jaune('add "<tâche>"[ "description"][ <priorité>]')}
La priorité est un nombre de 0 (aucune priorité) à
9 (priorité maximale).
Marquer une tâche finie
#{jaune('close/done <id tâche>')}
Voir toutes l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"def nature_text\n return text_get(8, nature.first)\n end",
"def questioning\n re... | [
"0.6736329",
"0.6736329",
"0.6634055",
"0.6310845",
"0.6310845",
"0.6135747",
"0.5984254",
"0.59634024",
"0.59509426",
"0.58865887",
"0.5865919",
"0.5865919",
"0.58307797",
"0.578745",
"0.57833457",
"0.5765999",
"0.57623374",
"0.5727725",
"0.5695259",
"0.5678174",
"0.5676146"... | 0.66733634 | 2 |
Affichage des commandes de la prompt taches | def display_commandes
puts <<-EOT
(Taper 'aide' pour obtenir de l'aide)
EOT
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prompt; end",
"def prompt; end",
"def prompt; end",
"def prompt; end",
"def prompt(mess) # prompt for all questions\n puts \"==> #{mess}\"\nend",
"def confirm(prompt); end",
"def prompt()\n\tprint \"Geef commando > \"\nend",
"def prompting(v = true)\n @at_prompt = v\n end",
"def chut\n IR... | [
"0.70309496",
"0.70309496",
"0.70309496",
"0.70309496",
"0.70211166",
"0.69874656",
"0.6822778",
"0.67781425",
"0.67114776",
"0.67072654",
"0.66731125",
"0.6643971",
"0.6613308",
"0.6587898",
"0.658333",
"0.65790254",
"0.65354586",
"0.6535186",
"0.6526875",
"0.6517632",
"0.65... | 0.0 | -1 |
Retourne un identifiant libre | def new_id
@last_id ||= 0
@last_id += 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identifier\n best_identifier\n end",
"def loser_id\n return self.send(\"#{loser}_id\".intern)\n end",
"def oid\n id(get_oid())\n end",
"def loser_code()\n \"L\"+self.id.to_s\n end",
"def numid; end",
"def id() end",
"def digitool_id\n return nil if @mods.nil?\n return @mod... | [
"0.67506397",
"0.66176254",
"0.6428299",
"0.64036447",
"0.6284783",
"0.6276742",
"0.6264097",
"0.6257112",
"0.6254838",
"0.62402755",
"0.62199694",
"0.614155",
"0.6139521",
"0.6117105",
"0.6117105",
"0.6094773",
"0.6081658",
"0.6069775",
"0.6051436",
"0.60415024",
"0.60314417... | 0.0 | -1 |
Get the text message associated with a type | def [](type,version=nil)
type = type.to_sym
load_config_file
version ||= latest_version(type)
template = @templates[type][version.to_i] or raise Exception, "Unable to find version #{version} of template #{type}"
new(type,template,version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_by_type( type )\n\t\t\treturn @messages[ type ]\n\t\tend",
"def type_name\n MESSAGE_TYPE[self.type_id-1][0]\n end",
"def human_msg_type\n self[:msg_type].to_human\n end",
"def human_message_type\n self[:message_type].to_human\n end",
"def message_type\n MESSAGE_T... | [
"0.7715807",
"0.7072843",
"0.6995953",
"0.68683773",
"0.67272115",
"0.6712505",
"0.6684379",
"0.66811126",
"0.65557724",
"0.64884865",
"0.6409465",
"0.62314063",
"0.62314063",
"0.6226139",
"0.6214329",
"0.61944646",
"0.61772954",
"0.61004764",
"0.6094746",
"0.6068741",
"0.603... | 0.0 | -1 |
==================== = Instance Methods = ==================== | def initialize(type,template,version)
self.type = type
self.template = template
self.version = version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def instance; end",
"def instance; end",
"def instance; end",
"def initialize\n \n end",
"def initialize\n\t\t\n\tend",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"de... | [
"0.8070203",
"0.7730988",
"0.7730988",
"0.7730988",
"0.7216767",
"0.7172567",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.70851755",
"0.7081381",
"0.7081381",
"0.7067047",
"0.70... | 0.0 | -1 |
fills in the template with the associate objects Each parameter must be passed e.g. if the template references user and date, you should pass template.fill(:user => joe, :date => Time.now) This method returns a string that contains the filled in template | def fill_old(params={})
params.each do |key,value|
instance_variable_set("@#{key}".to_sym,value)
end
self.body = (template).result binding
self.body
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_form(template, destination, data = T.unsafe(nil), fill_options = T.unsafe(nil)); end",
"def template\n return @email unless @email.nil?\n \n #if self[:email].blank?\n #@template = Liquid::Template.parse(email)\n #self[:email] = Marshal.dump(@template)\n # save\n #else\n @e... | [
"0.6370933",
"0.6071928",
"0.6066352",
"0.5946629",
"0.5900054",
"0.5818318",
"0.58176595",
"0.57726777",
"0.57595176",
"0.57500696",
"0.57500696",
"0.57082593",
"0.5683821",
"0.5655102",
"0.5631173",
"0.5605101",
"0.5603806",
"0.55977595",
"0.556347",
"0.5542891",
"0.5532769... | 0.54999846 | 29 |
per since I want to include the ApplicationHelper | def fill(params={})
view = ActionView::Base.new(ActionController::Base.view_paths, {})
class << view
include ApplicationHelper, NotificationHelper
end
# render will automatically HTML escape anything in between <%= .... %> even if the template is not html
# this cryptic code is a w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_application_helpers; end",
"def app_helpers\n @app_helpers ||= Class.new do\n include Rails.application.routes.url_helpers\n include ::ApplicationHelper\n end.new\n end",
"def helper\n @helper ||= ApplicationController.helpers\n end",
"def helpers\n ApplicationContro... | [
"0.7985683",
"0.72832614",
"0.6832324",
"0.67807525",
"0.67807525",
"0.6714358",
"0.6714358",
"0.6714358",
"0.66183484",
"0.6564915",
"0.65551305",
"0.64794797",
"0.64794797",
"0.6477834",
"0.64411247",
"0.6399573",
"0.6336048",
"0.63328505",
"0.6276248",
"0.6266024",
"0.6252... | 0.0 | -1 |
We don't want display to be listed in internal_methods. Runs callbacks for +name+ hook in instance context. | def run_widget_hook(name, *args)
self.class.callbacks_for_hook(name).each { |blk| instance_exec(*args, &blk) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_hook!(name)\n return unless hooks[name.to_sym]\n hooks[name.to_sym].each { |blk| config.instance_exec(&blk) }\n end",
"def method_missing(meth_name, *args, &block)\n raise \"Cannot call '#{meth_name}' on an undef'd method.\" if method(:name).respond_to?(meth_name)\n Object.instance_m... | [
"0.57748705",
"0.57270104",
"0.5713867",
"0.5641339",
"0.5641339",
"0.5630815",
"0.5558933",
"0.5540886",
"0.55389255",
"0.5485594",
"0.5474739",
"0.5474739",
"0.54398495",
"0.5431466",
"0.5430626",
"0.54224896",
"0.53835666",
"0.5379934",
"0.5379934",
"0.53776675",
"0.537014... | 0.57047457 | 3 |
Constructor which needs a unique id for the widget and one or multiple start states. | def initialize(parent_controller, id, start_state, opts={})
super(parent_controller, opts) # do that as long as cells do need a parent_controller.
@name = id
@start_state = start_state
@visible = true
@cell = self ### DISCUSS: needed?
@params ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(name, start_state, id=nil)\n @name, @start_state, @id = name, start_state, id\n @components = []\n end",
"def initialize(states, start)\n @states = states\n @start = start\n end",
"def initialize (id, description)\n\t\t@states = []\n @state \n\t\t@id = id\n\t\t@description... | [
"0.70468915",
"0.6656279",
"0.60621744",
"0.60109663",
"0.5976972",
"0.5875469",
"0.5736748",
"0.56776327",
"0.56711537",
"0.5610219",
"0.5607839",
"0.5573474",
"0.5547371",
"0.54968446",
"0.546813",
"0.546813",
"0.5453771",
"0.5442963",
"0.5415566",
"0.5415001",
"0.54150003"... | 0.5257031 | 33 |
Returns the rendered content for the widget by running the state method for state. This might lead us to some other state since the state method could call jump_to_state. | def invoke(state=nil, event=nil)
logger.debug "\ninvoke on #{name} with #{state.inspect}"
if state.blank?
state = next_state_for(last_state) || @start_state
end
logger.debug "#{name}: transition: #{last_state} to #{state}"
logger.debug " ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_state(state)\n content = dispatch_state(state)\n \n return content if content.kind_of? String\n \n \n ### DISCUSS: are these vars really needed in state views?\n @cell = self\n @state_name = state\n \n render_view_for(content, state)\n end",
"... | [
"0.73675615",
"0.71804607",
"0.7057324",
"0.65043294",
"0.63138145",
"0.61983",
"0.6141378",
"0.61279416",
"0.6106358",
"0.59378487",
"0.5922503",
"0.5850057",
"0.5844652",
"0.5818104",
"0.580004",
"0.5791267",
"0.57639086",
"0.57497066",
"0.5747302",
"0.5678125",
"0.5678125"... | 0.0 | -1 |
Render the view for the current state. Usually called at the end of a state method. ==== Options :view Specifies the name of the view file to render. Defaults to the current state name. :template_format Allows using a format different to :html. :layout If set to a valid filename inside your cell's view_paths, the curre... | def render(options={}, &block)
if options[:nothing]
return ""
end
if options[:text]
options.reverse_merge!(:render_children => false)
end
options.reverse_merge! :render_children => true,
:locals => {},
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_view_for_state(state)\n view_class = Class.new(ActionView::Base)\n action_view = view_class.new(template_root, {}, @controller)\n action_view.for_cells = true\n\n view_file = find_view_file_for_state(action_view, state)\n\n unless view_file && File.readable?(view_file)\n ... | [
"0.7621247",
"0.7506493",
"0.74382204",
"0.73495644",
"0.70570534",
"0.69936585",
"0.696842",
"0.6944758",
"0.68441683",
"0.67829657",
"0.66513157",
"0.6648824",
"0.664285",
"0.6636213",
"0.65894026",
"0.65131956",
"0.64759064",
"0.64477897",
"0.64422995",
"0.6428035",
"0.639... | 0.6794784 | 9 |
Wraps the rendered content in a replace statement targeted at your +Apotomo.js_framework+ setting. Use +:selector+ to change the selector. Example: Assuming you set Apotomo.js_framework = :jquery and call replace in a state replace :view => :squeak, :selector => "divmouse" => "$(\"divmouse\").replaceWith(\"squeak!\")" | def replace(options={})
content = render(options)
Apotomo.js_generator.replace(options[:selector] || self.name, content)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replace(*args)\n wrap_in_javascript_for(:replace, *args)\n end",
"def js_replace_element(element, content)\n rjs_method :replace_element, :element => element, :content => content\n end",
"def update(options={})\n content = render(options)\n Apotomo.js_generator.update(options[:selecto... | [
"0.6353439",
"0.6248604",
"0.5817056",
"0.5616243",
"0.5601575",
"0.5508003",
"0.53983897",
"0.53156245",
"0.52441865",
"0.5211737",
"0.51837236",
"0.509511",
"0.5017295",
"0.5015852",
"0.49851727",
"0.4967553",
"0.49498725",
"0.4891904",
"0.48611686",
"0.48582682",
"0.485826... | 0.74880636 | 0 |
Same as replace except that the content is wrapped in an update statement. Example for +:jquery+: update :view => :squeak => "$(\"mum\").html(\"squeak!\")" | def update(options={})
content = render(options)
Apotomo.js_generator.update(options[:selector] || self.name, content)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replace_content(name, content)\n render :update do |page|\n page.replace_html name, content\n end\n end",
"def replace(*args)\n wrap_in_javascript_for(:replace, *args)\n end",
"def update(text); end",
"def replace(options={})\n content = render(options)\n Apotomo.js_generato... | [
"0.65205956",
"0.6149723",
"0.5966139",
"0.58970594",
"0.5839512",
"0.5826895",
"0.5595024",
"0.55720973",
"0.5562974",
"0.5534802",
"0.5533985",
"0.54505104",
"0.53943014",
"0.536772",
"0.536772",
"0.536772",
"0.536772",
"0.5332979",
"0.5313419",
"0.5313419",
"0.5313419",
... | 0.5463718 | 11 |
Force the FSM to go into state, regardless whether it's a valid transition or not. TODO: document the need for return. | def jump_to_state(state)
logger.debug "STATE JUMP! to #{state}"
render_state(state)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transition\n new_state = fetch_sensor_state\n return if new_state == @state\n puts \"Transitioned from #{@state} to #{new_state}\"\n if valid_transition?(new_state)\n @state = new_state\n # Do nothing\n else\n puts \"Invalid transition!\"\n @beam_broken = 0\n # TODO: tos... | [
"0.70419246",
"0.6737871",
"0.6703379",
"0.6477222",
"0.64691025",
"0.6464562",
"0.6385754",
"0.637242",
"0.6325658",
"0.63244766",
"0.61968654",
"0.6189092",
"0.6172825",
"0.605158",
"0.60480577",
"0.6022227",
"0.59684867",
"0.5965178",
"0.5959832",
"0.59581435",
"0.5943701"... | 0.54807234 | 57 |
DISCUSS: use param only for accessing request data. | def param(name)
@params[name]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_data; end",
"def request_params; end",
"def request_parameters; end",
"def request=(_arg0); end",
"def request=(_arg0); end",
"def request=(_arg0); end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def ... | [
"0.75577354",
"0.74050957",
"0.722105",
"0.7025451",
"0.7025451",
"0.7025451",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.68009675",
"0.67706996",
"0.6720037",
"0.66670686",
"0... | 0.0 | -1 |
Returns the widget named widget_id as long as it is below self or self itself. | def find_widget(widget_id)
find {|node| node.name.to_s == widget_id.to_s}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_widget widget_description\n @widgets.find widget_description\n end",
"def find_widget_index widget_description\n @widgets.find_index widget_description\n end",
"def find_widget widget_description\n @form.find_widget widget_description\n end",
"def widget_id\n [type.to_s, i... | [
"0.70559126",
"0.6414717",
"0.6288099",
"0.6040884",
"0.60324293",
"0.6017642",
"0.5877428",
"0.58373284",
"0.58175606",
"0.58175606",
"0.5782531",
"0.5732768",
"0.5681627",
"0.56670254",
"0.5625852",
"0.56201065",
"0.5568834",
"0.55392236",
"0.5522828",
"0.54842615",
"0.5430... | 0.7694818 | 0 |
redifing area method (method override) | def area
is_open ? width * length_opened : width * length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area_wrt_ground ()\n \n end",
"def area_clicked(leftX, topY, rightX, bottomY)\r\n# complete this code\r\nend",
"def area; rect size; end",
"def floor_area\n # what does super call here?\n super + 300\n # (@width * @length) + 300\n end",
"def area\n\t\t@side_length * @side_length\n\ten... | [
"0.7722339",
"0.69864494",
"0.6743501",
"0.6730705",
"0.6574688",
"0.6558933",
"0.65533113",
"0.6520483",
"0.6469339",
"0.6469339",
"0.638891",
"0.63170815",
"0.6291075",
"0.6281891",
"0.6268593",
"0.6267236",
"0.6261434",
"0.62365544",
"0.6223709",
"0.62205493",
"0.6195723",... | 0.62164044 | 20 |
DELETE /solos/1 DELETE /solos/1.json | def destroy
@solo.destroy
respond_to do |format|
format.html { redirect_to solos_url, notice: 'Solo was successfully destroyed.' }
format.json { head :no_content }
end
authorize @solo
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @seguidore = Seguidor... | [
"0.72111166",
"0.7080324",
"0.70597297",
"0.6973452",
"0.6963392",
"0.69623893",
"0.6930384",
"0.69217646",
"0.69216913",
"0.6918474",
"0.69123244",
"0.69029516",
"0.69029146",
"0.6900678",
"0.6893779",
"0.68862915",
"0.6883645",
"0.68828154",
"0.68766445",
"0.68655485",
"0.6... | 0.0 | -1 |
GET /ingredient_assignments/1 GET /ingredient_assignments/1.json | def show
@ingredient_assignment = IngredientAssignment.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @ingredient_assignment }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @ingredient_assignment = IngredientAssignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ingredient_assignment }\n end\n end",
"def create\n @ingredient_assignment = IngredientAssignment.new(params[:ingredient_assignment])\n\n res... | [
"0.65205956",
"0.6140539",
"0.6031372",
"0.59608185",
"0.57096785",
"0.57046753",
"0.568084",
"0.568084",
"0.568084",
"0.568084",
"0.5659041",
"0.5594325",
"0.5578827",
"0.5566787",
"0.5551226",
"0.5461277",
"0.54608536",
"0.54538697",
"0.5432247",
"0.54235303",
"0.54138345",... | 0.7017687 | 0 |
GET /ingredient_assignments/new GET /ingredient_assignments/new.json | def new
@ingredient_assignment = IngredientAssignment.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @ingredient_assignment }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @ingredient_assignment = IngredientAssignment.new(params[:ingredient_assignment])\n\n respond_to do |format|\n if @ingredient_assignment.save\n format.html { redirect_to @ingredient_assignment, notice: 'Ingredient assignment was successfully created.' }\n format.json { render ... | [
"0.7552252",
"0.7110443",
"0.68454164",
"0.68298113",
"0.68231714",
"0.68120354",
"0.6811288",
"0.6811288",
"0.67991924",
"0.6752977",
"0.67319417",
"0.6702304",
"0.6492088",
"0.64585173",
"0.6429692",
"0.63970137",
"0.63853115",
"0.63725734",
"0.6349371",
"0.63077885",
"0.62... | 0.7847825 | 0 |
POST /ingredient_assignments POST /ingredient_assignments.json | def create
@ingredient_assignment = IngredientAssignment.new(params[:ingredient_assignment])
respond_to do |format|
if @ingredient_assignment.save
format.html { redirect_to @ingredient_assignment, notice: 'Ingredient assignment was successfully created.' }
format.json { render json: @ingr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @ingredient_assignment = IngredientAssignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ingredient_assignment }\n end\n end",
"def ingredient_params\n params.require(:ingredient).permit(:name, :recipe_ids => [])\n end",
"def ... | [
"0.6236768",
"0.59490377",
"0.5912856",
"0.587301",
"0.58275",
"0.57822627",
"0.577282",
"0.5705931",
"0.5686786",
"0.5617618",
"0.56140137",
"0.5612804",
"0.5596597",
"0.5584034",
"0.5568054",
"0.5555012",
"0.5541735",
"0.5505777",
"0.5489677",
"0.54839194",
"0.5478866",
"... | 0.70631206 | 0 |
PUT /ingredient_assignments/1 PUT /ingredient_assignments/1.json | def update
@ingredient_assignment = IngredientAssignment.find(params[:id])
respond_to do |format|
if @ingredient_assignment.update_attributes(params[:ingredient_assignment])
format.html { redirect_to @ingredient_assignment, notice: 'Ingredient assignment was successfully updated.' }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @ingredient_assignment = IngredientAssignment.new(params[:ingredient_assignment])\n\n respond_to do |format|\n if @ingredient_assignment.save\n format.html { redirect_to @ingredient_assignment, notice: 'Ingredient assignment was successfully created.' }\n format.json { render ... | [
"0.63519794",
"0.6307496",
"0.62450135",
"0.599539",
"0.59844965",
"0.58971417",
"0.5859397",
"0.5843957",
"0.57956594",
"0.578485",
"0.577098",
"0.5768896",
"0.5761087",
"0.57352406",
"0.57352406",
"0.5712158",
"0.5711118",
"0.5711118",
"0.5711118",
"0.5711118",
"0.5711118",... | 0.70925283 | 0 |
DELETE /ingredient_assignments/1 DELETE /ingredient_assignments/1.json | def destroy
@ingredient_assignment = IngredientAssignment.find(params[:id])
@ingredient_assignment.destroy
respond_to do |format|
format.html { redirect_to ingredient_assignments_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @recipe_ingredient = Recipe_ingredient.find(params[:id])\n @recipe_ingredient.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_ingredients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recipe_ingredient = RecipeIngredient.find(... | [
"0.6826938",
"0.682378",
"0.6747492",
"0.67361486",
"0.670595",
"0.66289747",
"0.662868",
"0.66084206",
"0.65794396",
"0.65453",
"0.65361583",
"0.6535899",
"0.6514027",
"0.64806217",
"0.64783365",
"0.6462588",
"0.64597535",
"0.6459352",
"0.64461935",
"0.64123815",
"0.6409337"... | 0.7857063 | 0 |
Generated something like that : All299 | def category_li name
@tag = Tag.where(:name => name).first
if @tag
('<li><a href="/tags/' + @tag.slug + '">' + @tag.name + '</a><span>' + image_count(@tag) + '</span></li>').html_safe
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def codes; end",
"def intensifier; end",
"def mambo_no_5; end",
"def genetic_code_table; 11; end",
"def generate_comprehensive\n\n end",
"def _all; end",
"def transformations; end",
"def generate; end",
"def generate; end",
"def probers; end",
"def mapping; end",
"def mapping; end",
"def... | [
"0.5940894",
"0.5711113",
"0.5663063",
"0.5653103",
"0.5584668",
"0.553595",
"0.55159163",
"0.5460663",
"0.5460663",
"0.5446133",
"0.54273504",
"0.54273504",
"0.54146254",
"0.5413617",
"0.5395021",
"0.5388886",
"0.5386243",
"0.53856623",
"0.5360334",
"0.5350544",
"0.53280294"... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.