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
Execute the history command.
def process_command(input) @args, @history = input.args, Mysh.input.history # The history command should not be part of the history. @history.pop pull_index || clear_history || show_history end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_history argv\n setup argv\n msg run_cmd(\"history\")\n end", "def exec(command)\n @history << [command]\n end", "def history_do(lines = (Readline::HISTORY.size - 2))\n irb_eval lines\nend", "def history_do(lines = (Readline::HISTORY.size - 2))\n irb_eval lines\n nil\nend", "def hi...
[ "0.82982504", "0.7437089", "0.70565736", "0.70539194", "0.6882794", "0.67524683", "0.67524683", "0.67524683", "0.67152274", "0.6689233", "0.6689233", "0.6688908", "0.66859615", "0.66859615", "0.668394", "0.6637459", "0.6569617", "0.6440064", "0.64347005", "0.6387546", "0.6365...
0.66784734
15
Deal with history index arguments
def pull_index index = @args[0].to_i if (1..@history.length) === index Mysh.input.instance_options[:initial] = @history[index-1] else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history=(_arg0); end", "def history=(_arg0); end", "def history\n generic_index(true)\n end", "def history\r\n\r\n end", "def history; end", "def history; end", "def history; end", "def index=(_arg0); end", "def redirection_history=(_arg0); end", "def history_added=(_arg0); end", "def a...
[ "0.7564619", "0.7564619", "0.73215413", "0.6908015", "0.68832916", "0.68832916", "0.68832916", "0.6801588", "0.66809386", "0.66545606", "0.64433247", "0.6372733", "0.6369166", "0.63658506", "0.6307738", "0.6287485", "0.6218259", "0.6184385", "0.61588496", "0.61080766", "0.607...
0.64106697
11
Clear the history buffer.
def clear_history if @args[0] == 'clear' @history.clear else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear\n synchronize do\n erase_history\n end\n end", "def clear_history\n while ! Readline::HISTORY.empty? do\n Readline::HISTORY.pop\n end\n end", "def clear_history()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n ...
[ "0.81732947", "0.80272365", "0.7997522", "0.75578344", "0.75578344", "0.73647267", "0.722293", "0.72044873", "0.70209783", "0.69117504", "0.6894914", "0.68522763", "0.68152416", "0.6779411", "0.6682489", "0.6642941", "0.65788126", "0.6551021", "0.64210725", "0.6416945", "0.63...
0.8034555
1
Just show the history.
def show_history pattern = Regexp.new(@args[0] || /./) @history.each_with_index do |item, index| puts "#{index+1}: #{item}" if item =~ pattern end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history\n # blank\n end", "def history; end", "def history; end", "def history; end", "def history\r\n\r\n end", "def write_history; end", "def cmd_history argv\n setup argv\n msg run_cmd(\"history\")\n end", "def history\n\t\t@user.show_log\n\tend", "def history\r\n []\r\n e...
[ "0.7937038", "0.78794867", "0.78794867", "0.78794867", "0.7828564", "0.749446", "0.7419719", "0.7256493", "0.71060765", "0.7046995", "0.7044046", "0.70438206", "0.70235246", "0.70190156", "0.6989189", "0.69209784", "0.69209784", "0.68940425", "0.68840396", "0.6879293", "0.679...
0.78962135
1
Blocks a user from logging in to web instance
def setUserWebBlocked(block) @WEB_PROPS["BLOCKED"] = block @ACCESS_CONTROL.setUserField(@USER_NAME, "BLOCKED", block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logging_in\n current_user.absorb_from(guest_user)\n end", "def block_user\n SecurityService.block_user(params[:id])\n redirect_to '/users/', notice: \"Käyttäjä ei voi enää luoda kursseja.\"\n end", "def check_login\n head :forbidden unless self.current_user\n end", "def block_access\...
[ "0.72287285", "0.676408", "0.67555094", "0.66576904", "0.6616262", "0.65111184", "0.64988256", "0.6468334", "0.64590335", "0.6417301", "0.6412859", "0.64115924", "0.6383688", "0.6380877", "0.6378194", "0.6358828", "0.63538873", "0.63321793", "0.631803", "0.6304174", "0.629690...
0.0
-1
Checks the users web instance login status
def isUserWebBlocked if(@WEB_PROPS != nil) amblocked = @WEB_PROPS["BLOCKED"] return (amblocked == nil && amblocked == "true") else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_login_status\n # If user hasn't logged in\n unless logged_in?\n # Show reminder message\n flash[:info] = \"Log in to continue.\"\n\n # Redirect user to login page\n redirect_to login_url\n end\n end", "def needs_login?() false end", "def check_login\n ...
[ "0.7185377", "0.6989921", "0.68386126", "0.6787634", "0.67367744", "0.67194325", "0.6694572", "0.66608727", "0.6625367", "0.6624686", "0.6530265", "0.6527048", "0.64604926", "0.64495224", "0.6424884", "0.64090437", "0.64090437", "0.6397145", "0.6363583", "0.6355374", "0.63507...
0.0
-1
Blocks an admin from logging into the admin console
def setUserAdminBlocked(block) @ADMIN_PROPS["BLOCKED"] = block @ADMIN_ACCESS_CONTROL.setUserField(@USER_NAME, "BLOCKED", block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin(&block)\n block.call if logged_in?\n end", "def admin_logged_in!\n return if current_admin.present?\n \n flash[:alert] = \"You must be signed in as an administrator\"\n redirect_to login_url\n end", "def logged_in_admin\n unless logged_admin_in?\n flash[:danger]...
[ "0.7480928", "0.7436552", "0.74324065", "0.7419343", "0.73951524", "0.73878455", "0.7374202", "0.7355781", "0.7353699", "0.7292275", "0.72839475", "0.7269607", "0.72675496", "0.72612345", "0.72612303", "0.72572404", "0.7248248", "0.7248248", "0.72378033", "0.72229236", "0.721...
0.0
-1
Checks the users admin instance login status
def isUserAdminBlocked if(@ADMIN_PROPS != nil) amblocked = @ADMIN_PROPS["BLOCKED"] return (amblocked == nil && amblocked == "true") else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_admin_status\n if current_user.nil? || !current_user.admin?\n flash[:alert] = \"Access denied. Please login as an admin user\"\n redirect_to root_url\n end\n end", "def check_admin_status\n if current_user.nil? || !current_user.admin?\n flash[:alert] = \"Access de...
[ "0.75340384", "0.75340384", "0.74926984", "0.7475455", "0.73342407", "0.7300918", "0.7287988", "0.7267489", "0.7211535", "0.7167229", "0.70954794", "0.7076841", "0.70181346", "0.7008166", "0.7005889", "0.7005889", "0.7001604", "0.69728214", "0.69682425", "0.69620115", "0.6948...
0.0
-1
public static boolean createUser(String userName, String password, boolean isAdminUser, String webGroups[], String adminGroup, String fName, String lName, String email, Properties additionalUserInformation)
def createUser(userName, password, isAdminUser, webGroups, adminGroup, fName, lName, email, additionalUserInformation) @ACCESS_CONTROL.createNewUser(userName, webGroups[0], email, fName, lName, password) at = 0 webGroups.each{ |group| @ACCESS_CONTROL.setUserField(userName, "group#{at}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createNewUser(userName, initialGroup, userEmail, fname, lname, password)\n\n password = password.encrypt\n user = {\"login\" => userName,\n \"group0\" => initialGroup,\n \"email\" => userEmail,\n \"fname\" => fname,\n \"lname\" => lname,...
[ "0.74102163", "0.70958275", "0.6916647", "0.6797854", "0.67274743", "0.6696694", "0.66553926", "0.6602645", "0.6584447", "0.657968", "0.64916205", "0.6489494", "0.64694524", "0.64689106", "0.64538413", "0.6453691", "0.64517474", "0.64502895", "0.6430834", "0.64282066", "0.641...
0.89066535
0
Retrieve all the variables and setup as a hash for doing a POST
def get_post_variables @data = {} @response_text.scan(/NAME=(\w+) TYPE=hidden VALUE="([^"]*)/) do |name, value| @data[name] = value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_post_variables\r\n\t\t\t@data = {}\r\n\t\t\t@response_text.scan(/NAME=(\\w+) TYPE=hidden VALUE=\"([^\"]*)/) do |name, value|\r\n\t\t\t\t@data[name] = value\r\n\t\t\tend\r\n\t\tend", "def post_parameters\n request.POST\n end", "def post_data\n @request[\"postData\"]\n end", "def bu...
[ "0.7127326", "0.6948124", "0.6757738", "0.67107373", "0.6670047", "0.65322113", "0.64773047", "0.6475097", "0.6392067", "0.6383374", "0.62316686", "0.62316686", "0.62316686", "0.62316686", "0.6175385", "0.614992", "0.6144257", "0.6143406", "0.61361015", "0.6125927", "0.610363...
0.7098475
1
Create verify xml as per the api format . "params" is collection keyvalues, in this "params" holds CardData, AVSData, Amount. It returns xml format in string.
def verifyXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.AuthorizeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"AuthorizeTransaction" ) { xml.Ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorizeXML(params) \n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.AuthorizeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', \n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"A...
[ "0.63836354", "0.63139063", "0.6229533", "0.6105691", "0.60511976", "0.5999555", "0.5940831", "0.5837182", "0.58146566", "0.5797738", "0.576511", "0.5686895", "0.5665135", "0.5657565", "0.56210333", "0.56195974", "0.5561996", "0.55485517", "0.5547748", "0.5534185", "0.552148"...
0.75271386
0
Create Authorize xml as per the api format . "params" is collection keyvalues, in this "params" holds CardData, AVSData, Amount, P2PETransactionData,PaymentAccountDataToken. It returns xml format in string.
def authorizeXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.AuthorizeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"AuthorizeTra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorizeAndCaptureXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.AuthorizeAndCaptureTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', \n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n ...
[ "0.6701778", "0.6378834", "0.60759187", "0.6062218", "0.5966001", "0.5960821", "0.5937644", "0.5823911", "0.5806916", "0.57954216", "0.56997454", "0.5668651", "0.5633432", "0.5585941", "0.5545079", "0.55350673", "0.54864264", "0.5473251", "0.5371862", "0.5360706", "0.53563935...
0.6829767
0
Create AuthorizeCapture xml as per the api format . "params" is collection keyvalues, in this "params" holds CardData, AVSData, Amount, P2PETransactionData,PaymentAccountDataToken. It returns xml format in string.
def authorizeAndCaptureXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.AuthorizeAndCaptureTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def captureXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ChangeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"Capture\" ) {\n xml.App...
[ "0.6786518", "0.624985", "0.58946115", "0.5854061", "0.56727576", "0.5654516", "0.5648212", "0.56148607", "0.5612469", "0.5603617", "0.5555418", "0.55080813", "0.549603", "0.5480658", "0.5466367", "0.54400516", "0.5417813", "0.54090446", "0.5394875", "0.537793", "0.53746897",...
0.6829887
0
Create Capture xml as per the api format . "params" is collection keyvalues, in this "params" holds Amount, TransactionId. It returns xml format in string.
def captureXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.ChangeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"Capture" ) { xml.ApplicationProfi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def returnByIdXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ReturnById('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"ReturnById\" ) {\n xml.ApplicationProfil...
[ "0.6456082", "0.6232635", "0.6192524", "0.6133825", "0.60540634", "0.5929281", "0.58599424", "0.57771397", "0.5716329", "0.56761783", "0.56524867", "0.56460756", "0.5638206", "0.5573087", "0.554828", "0.5532143", "0.5485918", "0.5473962", "0.54593277", "0.5456444", "0.5453029...
0.759805
0
Create Undo xml as per the api format . "params" is collection keyvalues, in this "params" hold TransactionId. It returns xml format in string.
def undoXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.Undo('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"Undo" ) { xml.ApplicationProfileId application_profile_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjustXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.Adjust('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"Adjust\" ) {\n xml.ApplicationProfileId applicat...
[ "0.6026714", "0.5933481", "0.5348578", "0.5326515", "0.5325376", "0.530923", "0.523648", "0.5197784", "0.5185931", "0.50713456", "0.50635606", "0.50426406", "0.50426406", "0.50426406", "0.50426406", "0.50426406", "0.50426406", "0.5028762", "0.5020382", "0.5018203", "0.5016852...
0.8337454
0
Create Adjust xml as per the api format . "params" is collection keyvalues, in this "params" holds adjusted Amount, TransactionId. It returns xml format in string.
def adjustXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.Adjust('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"Adjust" ) { xml.ApplicationProfileId application_profile_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def returnByIdXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ReturnById('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"ReturnById\" ) {\n xml.ApplicationProfil...
[ "0.65261555", "0.64160687", "0.61131024", "0.6055856", "0.55714405", "0.5415317", "0.53638184", "0.5352269", "0.5348756", "0.5310934", "0.5305264", "0.52866197", "0.52797246", "0.5270611", "0.5259842", "0.5257616", "0.52428246", "0.52362657", "0.5216671", "0.52030087", "0.518...
0.8246574
0
Create ReturnById xml as per the api format . "params" is collection keyvalues, in this "params" holds Amount, TransactionId. It returns xml format in string.
def returnByIdXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.ReturnById('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"ReturnById" ) { xml.ApplicationProfileId applicat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjustXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.Adjust('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"Adjust\" ) {\n xml.ApplicationProfileId applicat...
[ "0.6123846", "0.6067641", "0.59212077", "0.58403385", "0.5792095", "0.577693", "0.5723404", "0.5640022", "0.5624831", "0.5529969", "0.5448661", "0.5448661", "0.5389999", "0.5389999", "0.5389999", "0.5389999", "0.5389999", "0.5389999", "0.5366789", "0.5351837", "0.5350602", ...
0.84495443
0
Create ReturnUnlinked xml as per the api format . "params" is collection keyvalues, in this "params" holds CardData, AVSData, Amount, P2PETransactionData,PaymentAccountDataToken. It returns xml format in string.
def returnUnlinkedXML(params) begin Nokogiri::XML::Builder.new do |xml| xml.ReturnTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"ReturnTransaction" ) { xml.Application...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def returnByIdXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ReturnById('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"ReturnById\" ) {\n xml.ApplicationProfil...
[ "0.6529044", "0.58121485", "0.5811484", "0.57375544", "0.5713359", "0.5691076", "0.56645983", "0.56645983", "0.56412566", "0.5442697", "0.5421733", "0.54156053", "0.5411612", "0.53594863", "0.5285797", "0.51085186", "0.49571383", "0.49557737", "0.49514523", "0.49485812", "0.4...
0.7450421
0
Create CaptureAll xml as per the api format . "params" is collection keyvalues, in this "params" holds list of Capture transactions. It returns xml format in string.
def captureAllXML() begin Nokogiri::XML::Builder.new do |xml| xml.CaptureAll('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>"CaptureAll" ) { xml.ApplicationProfileId...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def captureXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ChangeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"Capture\" ) {\n xml.App...
[ "0.6846237", "0.60214025", "0.59899086", "0.58851284", "0.5831186", "0.58275175", "0.5770809", "0.5741236", "0.5703913", "0.5702869", "0.57005864", "0.57005864", "0.57005864", "0.57005864", "0.57005864", "0.57005864", "0.56920886", "0.5677992", "0.56424415", "0.56382793", "0....
0.6906132
0
Create QueryTransactionsDetail JSON as per the api format . "params" is collection keyvalues, in this "params" holds query information. It returns JSON format in string.
def queryTransactionsDetailJSON(params) begin { :TransactionDetailFormat => 'CWSTransaction', :PagingParameters => { :Page => 0, :PageSize => 10 }, :QueryTransactionsParameters => { :Amounts => nil, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_single_transaction_query(params = {})\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"id\"] = params[:transaction_id]\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n ...
[ "0.67708635", "0.67708635", "0.6380893", "0.60567796", "0.6037034", "0.60150945", "0.6001824", "0.59883994", "0.59402966", "0.5909381", "0.58636886", "0.5828", "0.5828", "0.57943815", "0.57943815", "0.5772859", "0.5729677", "0.56859046", "0.56569916", "0.56569916", "0.5568943...
0.8425488
0
Returns an array of organizations based on the access_type parameter The default access_type is RESTRICTED
def organizations_with_access(access_type = ACCESS_STATES[:RESTRICTED]) subscribed_organizations.includes(teams: :subscriptions).where("subscriptions.access_type = ?", access_type) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_types\n organizations.map(&:organization_type)\n end", "def get_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, headers = send_request(params)\n orgs = response.css('OrgList Org')\n\n results = {...
[ "0.70425206", "0.6999762", "0.6970571", "0.69672894", "0.69399387", "0.6893963", "0.68792397", "0.68784577", "0.68354774", "0.6817574", "0.6803949", "0.6763254", "0.6704545", "0.6701345", "0.66386974", "0.66380286", "0.663423", "0.6633815", "0.6632158", "0.66279954", "0.66248...
0.767328
0
If we create a new article, the public list of articles must be regenerated
def after_create(article) #expire_public_page(params[:article], params[:group]) '/etc/cron.hourly/railsfix' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_article\n self.model = store._articles.buffer # creates buffer that assigns to a model which we change latetly\n page._new_article = true \n end", "def after_create(article)\n expire_public_page\n end", "def add_article(article)\n self.article_lists.create(:article_id => articl...
[ "0.69004524", "0.67818", "0.66632587", "0.66269976", "0.6508754", "0.6443139", "0.64430875", "0.64189756", "0.6389379", "0.6364968", "0.63588065", "0.6348669", "0.6344746", "0.618962", "0.61573577", "0.6147273", "0.6129587", "0.6124484", "0.6114704", "0.6102352", "0.60950994"...
0.5834458
76
If we update an existing article, the cached version of that particular article becomes stale
def after_update(article) #expire_public_page(params[:article], params[:group]) '/etc/cron.hourly/railsfix' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if article_number_changed == true\n return execute_update && change_article\n end\n return execute_update\n end", "def update_cache\n # Does nothing...up to subclasses to implement.\n end", "def after_update(article)\n expire_article_page(article.i...
[ "0.6872551", "0.6702381", "0.6617566", "0.6569016", "0.6444852", "0.6324973", "0.62999976", "0.62726474", "0.62715", "0.62634003", "0.6211014", "0.61787385", "0.61334467", "0.6130432", "0.6122924", "0.6049547", "0.6033428", "0.6021022", "0.6021022", "0.5979064", "0.5969149", ...
0.0
-1
Deleting a page means we update the public list and blow away the cached article
def after_destroy_old(article) #expire_public_pageold(article) '/etc/cron.hourly/railsfix' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n @page = ComatosePage.find params[:id]\n if request.post?\n expire_cms_pages_from_bottom @page\n expire_cms_fragments_from_bottom @page\n @page.destroy\n flash[:notice] = \"Deleted page '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n...
[ "0.7543499", "0.7264641", "0.72561246", "0.72394264", "0.7229616", "0.7148548", "0.71443117", "0.7091257", "0.7084785", "0.7036809", "0.7025848", "0.70246875", "0.7005665", "0.70026535", "0.6986666", "0.6981904", "0.6955127", "0.6953766", "0.69455767", "0.6943192", "0.6928831...
0.0
-1
Time Complexity: O(n) Space Complexity: O(1)
def balanced(string) array = string.split("") i = 0 j = -1 until i = array.length / 2 return false if i != j i += 1 j -+ 1 end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6951067", "0.65906656", "0.6426608", "0.63374686", "0.61629635", "0.61491394", "0.6099901", "0.6065554", "0.6059895", "0.6039608", "0.6039197", "0.6006651", "0.60061294", "0.59993017", "0.59129846", "0.5909476", "0.58858675", "0.58789295", "0.5874044", "0.5873482", "0.5849...
0.0
-1
Time Complexity: ? Space Complexity: ?
def evaluate_postfix(postfix_expression) raise NotImplementedError, "Not implemented yet" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def largest_subsum(list)\n max = list[0] # O(1)\n current_sum = list[0] # O(1)\n\n (1...list.length).each do |i| # O(n)\n # debugger\n if current_sum < ...
[ "0.62574106", "0.6005434", "0.5977816", "0.5976574", "0.5916582", "0.59069425", "0.5885494", "0.5884955", "0.5868798", "0.58640856", "0.58033556", "0.5767254", "0.57608736", "0.5750557", "0.5727338", "0.57079476", "0.56690526", "0.56547195", "0.56431", "0.56296796", "0.561061...
0.0
-1
Internal: Initializes a new instance. adapter The adapter instance to send instrumentation to.
def initialize(adapter) @adapter = Nunes::Adapter.wrap(adapter) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(adapter)\n @adapter = adapter\n end", "def initialize(adapter)\n @adapter = adapter\n end", "def initialize(adapter)\n self.adapter = adapter\n end", "def initialize(adapter); end", "def initialized_adapter\n adapter.new(adapter_options)\n end", ...
[ "0.81902003", "0.81899834", "0.81426877", "0.779894", "0.7208526", "0.7170858", "0.7022079", "0.69951624", "0.6862842", "0.6744635", "0.6734697", "0.67009544", "0.6575368", "0.6548288", "0.6499456", "0.63831925", "0.6355409", "0.61917686", "0.6160229", "0.6157396", "0.6151328...
0.7517476
4
Private: Dispatcher that converts incoming events to method calls.
def call(name, start, ending, transaction_id, payload) # rails doesn't recommend instrumenting methods that start with bang # when in production return if name.start_with?(BANG) method_name = name.split('.').first if respond_to?(method_name) send(method_name, start, ending, trans...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch_to(dispatcher)\n @jr_method_args.each { |args|\n # copy args so original is preserved\n handler_method, jr_methods =\n extract_handler_method(Array.new(args))\n jr_methods.map! { |m| m.to_s }\n\n handler = has_handler_for?(handler_method) ?\n ...
[ "0.6104651", "0.6094436", "0.58548313", "0.5739248", "0.5621523", "0.56188124", "0.56188124", "0.5578764", "0.55769336", "0.55766064", "0.5537769", "0.54632103", "0.54305756", "0.5410659", "0.5399351", "0.5391169", "0.5385137", "0.53334993", "0.5327665", "0.53168714", "0.5301...
0.0
-1
Internal: Increment a metric for the client. metric The String name of the metric to increment. value The Integer value to increment by. Returns nothing.
def increment(metric, value = 1) @adapter.increment metric, value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metric_increment(metric_name)\n metric.increment(metric_name)\n end", "def _statsd_increment(metric)\n statsd.increment(metric) if statsd\n end", "def increment_metric(metric_name, amount = 1) # THREAD_LOCAL_ACCESS\n return unless agent\n\n if amount == 1\n metrics = [metric_na...
[ "0.7484445", "0.67789537", "0.63020366", "0.59458345", "0.5944046", "0.59377646", "0.5857421", "0.58560574", "0.5832565", "0.58252645", "0.5808531", "0.57167614", "0.56437516", "0.56434214", "0.5621365", "0.5606237", "0.559021", "0.55702215", "0.55672807", "0.5564219", "0.556...
0.8200005
0
Internal: Track the timing of a metric for the client. metric The String name of the metric. value The Integer duration of the event in milliseconds. Returns nothing.
def timing(metric, value) @adapter.timing metric, value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def record_time(metric, labels = {})\n result = nil\n time = Benchmark.realtime { result = yield }\n metric&.observe(time, labels)\n result\n end", "def metric(name:, value: nil, success: -> result { true }, **rest, &block)\n result = time_block(&block)\n rescue...
[ "0.6452341", "0.6300942", "0.622976", "0.5921571", "0.585442", "0.5835578", "0.5792397", "0.5734541", "0.57106745", "0.5643718", "0.5629967", "0.56229484", "0.5595704", "0.55800354", "0.5535931", "0.55054504", "0.5500063", "0.5488108", "0.54756236", "0.5457809", "0.5431978", ...
0.7575534
0
Returns an array of elements from the sorted set using ZRANGE. range receives 2 integers, start and stop Example: class CreditRecord 1) c2 = CreditRecord.create(:credits => 2) c3 = CreditRecord.create(:credits => 3) event = CreditEvent.create event.records.add(c1) event.records.add(c2) event.records.add(c3) [c1, c2] ==...
def range(start, stop) fetch(redis.zrange(key, start, stop)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zrange(key, start, stop, byscore: T.unsafe(nil), by_score: T.unsafe(nil), bylex: T.unsafe(nil), by_lex: T.unsafe(nil), rev: T.unsafe(nil), limit: T.unsafe(nil), withscores: T.unsafe(nil), with_scores: T.unsafe(nil)); end", "def z_list_range(key, start = 0, count = 1)\n handle_pipeline(@redis.zrevr...
[ "0.67454296", "0.66781455", "0.66356003", "0.6624799", "0.6561606", "0.6528622", "0.6489221", "0.6435696", "0.6429592", "0.63634396", "0.6330038", "0.63270974", "0.63225526", "0.6293669", "0.6232748", "0.6214162", "0.62032324", "0.61765295", "0.6136744", "0.606367", "0.605719...
0.6887996
0
Keep the sorted set to the speicified length
def keep_head(length) drop_below(length) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort!\n\t\tquick!(self, 1, length)\n\tend", "def problem_106\n a = [1,2,3,4]\n a = [1,2,3,4,5,6,7]\n a = [1,2,3,4,5,6,7,8,9,10,11,12] \n \n num = 0\n seen = {}\n # Don't do length of 1, they are ordered\n # Because they are size ordered, and 2 smalls are bigger than a large\n 2.upto(a.length/2) do |...
[ "0.61844784", "0.6127619", "0.6114293", "0.6104816", "0.60902244", "0.60141945", "0.59686816", "0.5925692", "0.5905632", "0.58960813", "0.5881049", "0.5869357", "0.58202565", "0.578843", "0.57796705", "0.57770026", "0.57184565", "0.57174134", "0.5711394", "0.5711266", "0.5699...
0.0
-1
Reversely keep the sorted set to the specified length
def keep_tail(length) rank = size - length drop_above(rank) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse!\n low = 0\n high = self.__size - 1\n while low < high\n a = self.__at(low)\n b = self.__at(high)\n self.__at_put(high, a)\n self.__at_put(low, b)\n low = low + 1\n high = high - 1\n end\n self\n end", "def reverse!(arr)\n arr.size.times do |n|\n arr....
[ "0.65747225", "0.618996", "0.6081487", "0.6065792", "0.60584176", "0.6046482", "0.60355055", "0.5958855", "0.5954961", "0.5941072", "0.5927598", "0.592289", "0.5915892", "0.5868319", "0.5864877", "0.5840324", "0.5797289", "0.579051", "0.57894474", "0.5774946", "0.5774426", ...
0.6422498
1
ISO8601 string examples are taken from ISO8601 gem at published under the conditions of MIT license at Copyright (c) 20122014 Arnau Siches MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softwar...
def test_iso8601_parsing_wrong_patterns_with_raise invalid_patterns = ["", "P", "PT", "P1YT", "T", "PW", "P1Y1W", "~P1Y", ".P1Y", "P1.5Y0.5M", "P1.5Y1M", "P1.5MT10.5S"] invalid_patterns.each do |pattern| assert_raise ActiveSupport::Duration::ISO8601Parser::ParsingError, pattern.inspect do ActiveSu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_iso8601\n strftime('%Y-%m-%dT%H:%M:%SZ')\n end", "def iso8601(p1 = v1)\n #This is a stub, used for indexing\n end", "def to_iso8601(date)\n return nil unless(date)\n date = DateTime.parse(date) unless(date.respond_to?(:strftime))\n date.strftime('%Y-%m-%dT%H:%M:%...
[ "0.7157519", "0.6986221", "0.69006157", "0.6854663", "0.6753192", "0.67225754", "0.6634514", "0.6405202", "0.6317594", "0.6200826", "0.6156187", "0.610216", "0.5929391", "0.57236195", "0.56644416", "0.55872315", "0.55814505", "0.55774397", "0.5541957", "0.5533767", "0.5460797...
0.51166356
41
Find a way to accumulate the :worldwide_grosses and return that Integer using director_data as input
def gross_for_director(director_data) i = 0 tot = 0 while i < director_data[:movies].count do tot += director_data[:movies][i][:worldwide_gross] i += 1 end return tot end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gross_for_director(director_data)\n movie_index = 0\n worldwide_grosses = 0\n while movie_index < director_data[:movies].length\n worldwide_grosses += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\nworldwide_grosses\nend", "def gross_for_director(director_data)\n s...
[ "0.8029837", "0.79776275", "0.79773915", "0.79361767", "0.79248714", "0.78916717", "0.7838351", "0.77536833", "0.7750221", "0.7714856", "0.7668552", "0.76530826", "0.7606851", "0.760095", "0.7600013", "0.7586569", "0.7579721", "0.75762385", "0.7555412", "0.7525543", "0.751644...
0.76686096
10
parse_address scans the provided configuration block and extracts the interface address, if configured, and returns it. If there is no IP address configured, then this method will return the DEFAULT_ADDRESS. The return value is intended to be merged into the ipaddress resource hash.
def parse_address(config) mdata = /(?<=^\s{3}ip\saddress\s)(.+)$/.match(config) { address: mdata.nil? ? DEFAULT_ADDRESS : mdata[1] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ipaddress\n config[\"ipaddress\"]\n end", "def ip\n if ifconfig =~ /inet addr:([0-9.]+)/\n $1\n else\n \"0.0.0.0\"\n end\n end", "def address\n return @mac_address if defined? @mac_address and @mac_address\n re = %r/[^:\\-](?:[0-9A-F][0-9A-F][:\\-])...
[ "0.6053217", "0.6040735", "0.59457344", "0.59046036", "0.5826203", "0.58006936", "0.5773785", "0.57305676", "0.5649963", "0.5592574", "0.5575048", "0.5507619", "0.54064196", "0.5401063", "0.5398586", "0.5389409", "0.5364254", "0.5356258", "0.53556997", "0.5339391", "0.5332837...
0.7636915
0
parse_mtu scans the provided configuration block and extracts the IP interface MTU value. The MTU value is expected to always be present in the configuration blcok. The return value is intended to be merged into the ipaddress resource hash.
def parse_mtu(config) mdata = /(?<=mtu\s)(\d+)$/.match(config) { mtu: mdata.nil? ? '' : mdata[1] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetMtu(node)\n\t@interfaces.each do |ifn|\n\t self.GetGroupInterface(node, ifn).mtu=\"1528\"\n\tend\n end", "def set_mtu(name, opts = {})\n cmds = command_builder('mtu', opts)\n configure_interface(name, cmds)\n end", "def wn_dmtu\n get_link(link='dmtu')\n end", "def mtu\n s...
[ "0.5211812", "0.5018331", "0.4960494", "0.47897443", "0.47897443", "0.47897443", "0.46736765", "0.45819524", "0.4567225", "0.4567225", "0.4536106", "0.45030543", "0.4454673", "0.4435197", "0.42548397", "0.41761297", "0.41229007", "0.40790644", "0.40653437", "0.40483755", "0.4...
0.7849626
0
parse_helper_addresses scans the provided configuration block and extracts any configured IP helper address values. The interface could be configured with one or more helper addresses. If no helper addresses are configured, then an empty array is set in the return hash. The return value is intended to be merged into th...
def parse_helper_addresses(config) helpers = config.scan(/(?<=\s{3}ip\shelper-address\s).+$/) { helper_addresses: helpers } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_helper_addresses(name, opts = {})\n value = opts[:value]\n enable = opts.fetch(:enable, true)\n default = opts[:default] || false\n\n if value\n unless value.is_a?(Array)\n raise ArgumentError, 'value must be an Array'\n end\n end\n\n c...
[ "0.62409234", "0.56207496", "0.5529982", "0.53586376", "0.527351", "0.51909554", "0.51508564", "0.5115976", "0.5043788", "0.50345576", "0.503213", "0.50127953", "0.49802342", "0.49585512", "0.49453977", "0.4929978", "0.4883116", "0.4813924", "0.48074758", "0.4805455", "0.4777...
0.8021262
0
parse_load_interval scans the provided configuration block and parse the loadinterval value. If the interface loadinterval value is not configured, then this method will return the value of DEFAULT_LOAD_INTERVAL. The hash returned is intended to be merged into the interface resource hash.
def parse_load_interval(config) mdata = /load-interval (\w+)$/.match(config) { load_interval: mdata.nil? ? DEFAULT_LOAD_INTERVAL : mdata[1] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_load_interval(name, opts = {})\n commands = command_builder('load-interval', opts)\n configure_interface(name, commands)\n end", "def set_load_interval(name, opts = {})\n cmds = command_builder('load-interval', opts)\n configure_interface(name, cmds)\n end", "def p...
[ "0.5499027", "0.54776305", "0.5121923", "0.4993298", "0.49832976", "0.4868855", "0.48651206", "0.48361558", "0.47895375", "0.47875324", "0.4722555", "0.47162768", "0.47151795", "0.47017127", "0.46618813", "0.46329266", "0.4630479", "0.45713863", "0.45473245", "0.45102626", "0...
0.77463895
1
create will create a new IP interface on the node. If the ip interface already exists in the configuration, this method will still return successful. This method will cause an existing layer 2 interface (switchport) to be deleted if it exists in the node's configuration.
def create(name) configure(["interface #{name}", 'no switchport']) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name)\n configure [\"interface #{name}\", 'no ip address', 'switchport']\n end", "def create\n\t\t\t@subnet_id = Net::HTTP.get(URI.parse(\"#{URL}network/interfaces/macs/#{@macs_arr.first}/subnet-id\"))\n\t\t\tresp = ec2.create_network_interface(subnet_id: \"#{@subnet_id}\")\n\t\t\t@network...
[ "0.6961242", "0.6796134", "0.625823", "0.62570256", "0.6162629", "0.603976", "0.59058625", "0.58399516", "0.583043", "0.5512155", "0.55094576", "0.55082315", "0.5446946", "0.54443663", "0.5378545", "0.5333774", "0.52840954", "0.5275015", "0.52708924", "0.52643955", "0.5227075...
0.6684965
2
delete will delete an existing IP interface in the node's current configuration. If the IP interface does not exist on the specified interface, this method will still return success. This command will default the interface back to being a switchport.
def delete(name) configure(["interface #{name}", 'no ip address', 'switchport']) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client_opts = {}\n client_opts[:network_interface_id] = network_interface_id\n client.delete_network_interface(client_opts)\n nil\n end", "def delete(name)\n configure [\"interface #{name}\", 'no switchport']\n end", "def restart_interface(interface)\n ...
[ "0.7133724", "0.6697253", "0.64472944", "0.64312035", "0.6278268", "0.6208888", "0.6126928", "0.6084022", "0.6072836", "0.6018805", "0.5897524", "0.5829822", "0.57676774", "0.5742166", "0.57229847", "0.55808735", "0.55762494", "0.54926264", "0.54926264", "0.54926264", "0.5473...
0.69558585
1
set_address configures a logical IP interface with an address. The address value must be in the form of A.B.C.D/E. If the enable keyword is false, then the interface address is negated using the config no keyword. If the default option is set to true, then the ip address value is defaulted using the default keyword. Th...
def set_address(name, opts = {}) cmds = command_builder('ip address', opts) configure_interface(name, cmds) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_helper_addresses(name, opts = {})\n value = opts[:value]\n enable = opts.fetch(:enable, true)\n default = opts[:default] || false\n\n if value\n unless value.is_a?(Array)\n raise ArgumentError, 'value must be an Array'\n end\n end\n\n c...
[ "0.69042", "0.6823939", "0.63709116", "0.63626134", "0.6198588", "0.60740536", "0.60408145", "0.59648275", "0.5950422", "0.5950422", "0.58366823", "0.57962525", "0.57962525", "0.5791568", "0.5749636", "0.5748997", "0.56528175", "0.5617115", "0.5545572", "0.5542317", "0.551463...
0.7047523
0
set_mtu configures the IP mtu value of the ip interface in the nodes configuration. If the enable option is false, then the ip mtu value is configured using the no keyword. If the default keyword option is provided and set to true then the ip mtu value is configured using the default keyword. The default keyword has pr...
def set_mtu(name, opts = {}) cmds = command_builder('mtu', opts) configure_interface(name, cmds) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetMtu(node)\n\t@interfaces.each do |ifn|\n\t self.GetGroupInterface(node, ifn).mtu=\"1528\"\n\tend\n end", "def set_mtu(opts)\n opts = check_params(opts,[:mtus])\n super(opts)\n end", "def set_mtu(opts)\n opts = check_params(opts,[:mtus])\n super(opts)\n end", "def mtu\n ...
[ "0.64655983", "0.63826144", "0.63826144", "0.5116881", "0.5116881", "0.5116881", "0.4748889", "0.46540523", "0.46029526", "0.4595679", "0.45774817", "0.45195213", "0.4499322", "0.44904998", "0.44777367", "0.44579932", "0.44459864", "0.4409966", "0.44056022", "0.43863192", "0....
0.6868758
0
set_helper_addresses configures the list of helper addresses on the ip interface. An IP interface can have one or more helper addresses configured. If no value is provided, the helper address configuration is set using the no keyword. If the default option is specified and set to true, then the helper address values ar...
def set_helper_addresses(name, opts = {}) value = opts[:value] enable = opts.fetch(:enable, true) default = opts[:default] || false if value unless value.is_a?(Array) raise ArgumentError, 'value must be an Array' end end case default ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_helper_addresses(config)\n helpers = config.scan(/(?<=\\s{3}ip\\shelper-address\\s).+$/)\n { helper_addresses: helpers }\n end", "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end", "def set_Addresses(value)\n set_input(\"Addresses\", value)\n ...
[ "0.62457836", "0.57117665", "0.57117665", "0.57117665", "0.5701856", "0.53097713", "0.5239886", "0.5126589", "0.5027663", "0.4994285", "0.49615186", "0.49458286", "0.48888797", "0.48833197", "0.48805737", "0.48490712", "0.48251507", "0.48068032", "0.47960404", "0.47955847", "...
0.8224314
0
set_load_interval is a convenience function for configuring the value of interface loadinterval
def set_load_interval(name, opts = {}) cmds = command_builder('load-interval', opts) configure_interface(name, cmds) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_load_interval(name, opts = {})\n commands = command_builder('load-interval', opts)\n configure_interface(name, commands)\n end", "def reload_interval=(interval)\n raise ArgumentError, 'Argument must be Integer.' unless interval.kind_of?(Integer)\n self.enable_reload = false i...
[ "0.8131005", "0.7089731", "0.6107042", "0.6037183", "0.6023637", "0.58463573", "0.58463573", "0.5830824", "0.5829228", "0.57767725", "0.56802624", "0.5665856", "0.5665856", "0.5644337", "0.5598003", "0.5554479", "0.551809", "0.54967", "0.5443704", "0.53612584", "0.5356765", ...
0.8134388
0
If we are just being created and have a USER, but no PHONE NUMBER, then use the users phone number!
def copy_phone_if_user self.phone_number = user.phone_number if user && !phone_number end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_phone\n if update_phone && user.completed_sign_up?\n user.unverified_phone\n else\n user.phone\n end\n end", "def phone\n @json['user']['content']['phonenumber'] || ''\n end", "def set_user_phone_number\n @user_phone_number = UserPhoneNumber.find(params[:id])\n end"...
[ "0.7602501", "0.6979493", "0.6923788", "0.6873253", "0.67178947", "0.6685096", "0.6670594", "0.66410416", "0.6628331", "0.6599851", "0.6599472", "0.65654665", "0.6560679", "0.65374035", "0.64763695", "0.64763695", "0.6456678", "0.6445233", "0.6437445", "0.6427565", "0.6388138...
0.74177825
1
Use callbacks to share common setup or constraints between actions.
def set_question_option @question_option = QuestionOption.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.532...
0.0
-1
Only allow a trusted parameter "white list" through.
def question_option_params params.require(:question_option).permit(:question_id, :title) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the evenvalued terms.
def is_even(num) if num % 2 == 0 return num else return 0 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_even_fib_terms(max)\n sum = 0\n \n # initialize sequence\n t0 = 1\n t1 = 2\n \n while t1 < max\n if t1 % 2 == 0\n sum += t1\n end\n\n # advance to next term in the sequence\n t2 = t0 + t1\n t0 = t1\n t1 = t2\n end\n\n sum\nend", "def even_fibonacci_sum(limit)\n array = [0...
[ "0.8023819", "0.773742", "0.76806855", "0.76542723", "0.7649347", "0.7643376", "0.75985307", "0.7585838", "0.7570688", "0.75691545", "0.75551176", "0.7535338", "0.7516236", "0.74964315", "0.74817544", "0.7480496", "0.74692434", "0.7449181", "0.7448456", "0.7442246", "0.743498...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_disclosure_form @disclosure_form = DisclosureForm.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def disclosure_form_params params.permit(:name, :dob, :street, :apt_number, :city_state_zip, :email, :home_phone, :whatisnst, :participant, :pricingandpayment, :finalagreement, :emergency_contact_name, :emergency_contact_phone) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7122899", "0.7054107", "0.69478", "0.6902101", "0.67359334", "0.67178756", "0.66889167", "0.6677724", "0.6661157", "0.6555896", "0.6527207", "0.64584696", "0.64517015", "0.6450208", "0.644749", "0.6435074", "0.6413329", "0.6413329", "0.6391818", "0.6380081", "0.6380081", ...
0.0
-1
The opposite of +assert_queued+.
def assert_not_queued(klass, args = nil, message = nil) queue = Resque.queue_for(klass) assert_block (message || "#{klass}#{args ? " with #{args.inspect}" : ""} should not have been queued in #{queue}.") do !in_queue?(queue, klass, args) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_queued_in(expected_time_difference, klass, args = nil, message = nil)\n queue = Resque.queue_for(klass)\n assert_queued_in_with_queue(queue, expected_time_difference, klass, args, message)\n end", "def test_isEmptyOnNonEmptyQueue\n @queue.enqueue(100)\n assert_equal( false , @queue.empty?...
[ "0.7142062", "0.7008809", "0.6811878", "0.678636", "0.6778477", "0.6770653", "0.6765957", "0.66629046", "0.65714514", "0.6549591", "0.64944655", "0.6386987", "0.63598573", "0.6343602", "0.6127641", "0.60799766", "0.6024693", "0.5969962", "0.5937291", "0.5931944", "0.5915512",...
0.7532201
0
copy from this.copy(that) copies that into this
def copy(project) project.tickets.each do |ticket| copy_ticket = self.ticket!(:title => ticket.title, :description => ticket.description) ticket.comments.each do |comment| copy_ticket.comment!(:body => comment.body) sleep 1 end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy\n\t\t\treturn self.dup\n\t\tend", "def copy_to(other); end", "def copy\n dup\n end", "def copy\n Marshal.load(Marshal.dump(self))\n end", "def deepcopy\n\t\tMarshal.load(Marshal.dump(self))\n\tend", "def make_copy\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend", "def clon...
[ "0.76714534", "0.76152563", "0.7562753", "0.75355905", "0.7378767", "0.7315183", "0.7305928", "0.7305928", "0.71516174", "0.714991", "0.7126143", "0.7119238", "0.71008146", "0.71008146", "0.708592", "0.7050362", "0.7034959", "0.7025708", "0.69924206", "0.6974541", "0.697072",...
0.0
-1
tried to reuse my sorted item list, but i dont think i want my keys in my inventory hash to be in alphabetical order, according to the interaction pattern def total_inventory inventory = Hash.new sorted_item_list.each do |item| inventory[item] = 0 end inventory end
def total_inventory inventory = Hash.new(0) @vendors.each do |vendor| vendor.inventory.keys.each do |item| inventory[item] += vendor.inventory[item] end end inventory end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purchased_items\n @items.inject({}) do |hash, item|\n item = item.capitalize\n if PRODUCTS.include? item\n hash[item] = 0 unless hash[item.to_s]\n hash[item] += 1\n end\n hash\n end\n end", "def initialize\n #each item has name and inventory number\n @inventory_...
[ "0.72052574", "0.7013151", "0.69561064", "0.68053037", "0.6694553", "0.6516662", "0.64491326", "0.6430756", "0.6373781", "0.63510877", "0.6343247", "0.63357043", "0.63086253", "0.62898594", "0.62898594", "0.62847584", "0.6256059", "0.6242332", "0.62417936", "0.62377346", "0.6...
0.7202964
1
This method only partly works. It is able to return true or false deplending on if the item is in stock. And it is able to change the stock of the vendor. If the vendor does not have enough of that stock tho, I was unable to figure out how to move to the next vendor, and subtract the difference from their stock. Spent ...
def sell(item, quantity) if total_inventory.has_key?(item) && quantity < total_inventory[item] @vendors.each do |vendor| if vendor.inventory.has_key?(item) if vendor.inventory[item] >= quantity vendor.inventory[item] -= quantity else vendor.inventory[item] -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_stock_on_update\n # What has changed?\n product_has_changed = product_changed? rescue false\n store_has_changed = store_changed? rescue false\n quantity_has_changed = quantity_changed? rescue false\n # Previous values\n product_prev = product_was rescue product\n store_prev = store_...
[ "0.6872867", "0.6724124", "0.6679403", "0.6678313", "0.66624165", "0.66197884", "0.6614728", "0.6564519", "0.6538605", "0.6501001", "0.6496275", "0.64815474", "0.6481244", "0.6478659", "0.6464735", "0.6462165", "0.64571387", "0.6413355", "0.6393877", "0.63546044", "0.6351807"...
0.6812991
1
increments will be by 1 each phrase
def using_until levitation_force = 6 until levitation_force == 10 puts "Wingardium Leviosa" levitation_force += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment \n\t\t@counter = @counter + 1\n\tend", "def inc\n $i + 1\n end", "def increment\n @counter = @counter + 1\n end", "def incr\n add(1)\n end", "def incr_count\n @count ||= 0\n @count += 1\n end", "def incr(x) x + 1 end", "def increase_index\n @i +=1\n...
[ "0.6759258", "0.6751687", "0.6717209", "0.6641107", "0.66036105", "0.6528965", "0.6526568", "0.6378939", "0.6360136", "0.62941444", "0.6285763", "0.62690973", "0.62490773", "0.6212764", "0.6211495", "0.61825967", "0.61796904", "0.61188596", "0.6092671", "0.60913706", "0.60711...
0.0
-1
das sollte man mit einer dieser anonymen funktionen ersetzen
def getassociated(type) self.forward_items_dataset.filter("content LIKE '%type\":\"#{type}%'") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schubert; end", "def suivre; end", "def zuruecksetzen()\n end", "def private; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def anchored; end", "def schumann; end", "def aon; end", "def refutal()\n end", "def probers; end", "def feruchemist; en...
[ "0.6883975", "0.6859791", "0.67669916", "0.67391664", "0.66260666", "0.66260666", "0.66260666", "0.66260666", "0.6461506", "0.623562", "0.6162729", "0.6142306", "0.61265355", "0.6108109", "0.6074522", "0.6066602", "0.6064716", "0.6044759", "0.6036589", "0.59727937", "0.593087...
0.0
-1
validates_presence_of :main_image_url, :unless => "main_image_file_name.present?" validates_presence_of :main_image_file_name, :unless => "main_image_url.present?"
def main_image_url? main_image_source == ImageSource::URL end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validates_presence_of_urls\n if provider_media_id.blank?\n !( source_url.blank? || thumbnail_url.blank? || content_url.blank? )\n else\n true\n end\n end", "def valid_image_url(url)\n !url.images.first.src.to_s.starts_with?('/')\nend", "def image_presence\n errors.add(:image, \"Imag...
[ "0.6776017", "0.67156637", "0.6666386", "0.65906", "0.6553178", "0.6535744", "0.6500205", "0.6481247", "0.6400686", "0.6392289", "0.63877463", "0.63585144", "0.635615", "0.6352345", "0.63348955", "0.62562805", "0.6241107", "0.62261367", "0.6224062", "0.6186569", "0.61814225",...
0.56693774
65
Default: '' Accepts: String
def oauth2_client_id(value = nil) rw_config(:oauth2_client_id, value, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default\n ''\n end", "def defaults_str\n \"\"\n end", "def string?; end", "def default! default_string\n strip.empty? ? clear << default_string.to_s : self\n end", "def default(text)\n text.to_s\n end", "def noop\n \"\"\n end", "def string=(_arg0); end", "def p...
[ "0.7730112", "0.7556992", "0.71862733", "0.7124071", "0.7041491", "0.6846404", "0.6806525", "0.6796679", "0.67491853", "0.67491853", "0.67491853", "0.67491853", "0.67491853", "0.67491853", "0.67491853", "0.67491853", "0.67491853", "0.6687844", "0.6687844", "0.6687844", "0.666...
0.0
-1
Default: '' Accepts: String
def oauth2_client_secret(value = nil) rw_config(:oauth2_client_secret, value, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default\n ''\n end", "def defaults_str\n \"\"\n end", "def string?; end", "def default! default_string\n strip.empty? ? clear << default_string.to_s : self\n end", "def default(text)\n text.to_s\n end", "def noop\n \"\"\n end", "def string=(_arg0); end", "def p...
[ "0.7725261", "0.75531167", "0.7187803", "0.7120455", "0.70379823", "0.6843944", "0.6807163", "0.6795757", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.6688927", "0.6688927", "0.6688927", "0.6659798", "0.66579...
0.0
-1
Default: '' Accepts: String
def oauth2_site(value = nil) rw_config(:oauth2_site, value, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default\n ''\n end", "def defaults_str\n \"\"\n end", "def string?; end", "def default! default_string\n strip.empty? ? clear << default_string.to_s : self\n end", "def default(text)\n text.to_s\n end", "def noop\n \"\"\n end", "def string=(_arg0); end", "def p...
[ "0.7725261", "0.75531167", "0.7187803", "0.7120455", "0.70379823", "0.6843944", "0.6807163", "0.6795757", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.6688927", "0.6688927", "0.6688927", "0.6659798", "0.66579...
0.0
-1
Default: '' Accepts: String
def oauth2_scope(value = nil) rw_config(:oauth2_scope, value, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default\n ''\n end", "def defaults_str\n \"\"\n end", "def string?; end", "def default! default_string\n strip.empty? ? clear << default_string.to_s : self\n end", "def default(text)\n text.to_s\n end", "def noop\n \"\"\n end", "def string=(_arg0); end", "def p...
[ "0.7725261", "0.75531167", "0.7187803", "0.7120455", "0.70379823", "0.6843944", "0.6807163", "0.6795757", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.674976", "0.6688927", "0.6688927", "0.6688927", "0.6659798", "0.66579...
0.0
-1
Hooks into credentials so that you can pass a user who has already has an oauth2 access token.
def credentials=(value) super values = value.is_a?(Array) ? value : [value] hash = values.first.is_a?(Hash) ? values.first.with_indifferent_access : nil self.record = hash[:priority_record] if !hash.nil? && hash.key?(:priority_record) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate_with_oauth2(oauth2_id, oauth2_token)\n \n # find user and update access token \n returning(self.find_for_oauth2(oauth2_id)) do |user|\n user.update_attributes(:oauth2_token => oauth2_token) unless user.nil?\n end\n\n end", ...
[ "0.684971", "0.65093267", "0.6445627", "0.64448303", "0.6413494", "0.6363131", "0.6315507", "0.6294397", "0.62212", "0.61550844", "0.613821", "0.61273164", "0.6114561", "0.6109969", "0.60980326", "0.6095028", "0.6078739", "0.6074399", "0.60697454", "0.60691226", "0.60673696",...
0.0
-1
Clears out the block if we are authenticating with oauth2, so that we can redirect without a DoubleRender error.
def save(&block) block = nil if redirecting_to_oauth2_server? super(&block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel\n __log_activity\n __debug_route\n __debug_request\n super\n rescue => error\n auth_failure_redirect(message: error)\n end", "def without_redirect(&block)\n if block_given?\n @agent.redirect_ok = false\n yield\n @agent.redirect_ok = true\n end\...
[ "0.63735783", "0.63290995", "0.6288825", "0.6064729", "0.5933692", "0.59201676", "0.59133667", "0.5911094", "0.5766515", "0.57631874", "0.5725014", "0.5706251", "0.56905746", "0.56879145", "0.56499785", "0.56417894", "0.56168437", "0.5616596", "0.5608587", "0.5605405", "0.559...
0.6263952
3
Convenience methods for accessing configuration values
def find_by_oauth2_method self.class.find_by_oauth2_method end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(key)\n\t\t\treturn @config[key]\n\t\tend", "def get(name)\n @config[name]\n end", "def configuration\n return @children['configuration'][:value]\n end", "def [](k)\n @my_conf[k]\n end", "def get(key)\n self.config[key]\n end", "def [](k)\n @con...
[ "0.7376758", "0.73731166", "0.72893924", "0.72788167", "0.7276819", "0.7257226", "0.7235032", "0.712082", "0.708154", "0.7062403", "0.7060734", "0.7060734", "0.7025016", "0.7021631", "0.69920564", "0.6988838", "0.6964147", "0.6960662", "0.6948077", "0.69460154", "0.69344485",...
0.0
-1
GET /attachments GET /attachments.json
def index @attachments = Attachment.all respond_to do |format| format.html # index.html.erb format.json { render json: @attachments } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @channel = Channel.find_by_name(params[:channel_id])\n @attachments = @channel.attachments.order(\"created_at DESC\")\n\n respond_to do |format|\n format.json { render :json => @attachments.to_json(:methods => :url) }\n end\n end", "def attachments\n Easybill::Api::Attachm...
[ "0.7403629", "0.7219272", "0.7218139", "0.72067606", "0.7203128", "0.7203128", "0.7203128", "0.7203128", "0.7187078", "0.71577555", "0.71577555", "0.71577555", "0.71577555", "0.71577555", "0.7101302", "0.7087153", "0.70859534", "0.70809966", "0.7067069", "0.7044941", "0.69741...
0.7475036
1
GET /attachments/1 GET /attachments/1.json
def show @attachment = Attachment.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @attachment } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attachment(id)\n response = conn.get 'api/files/attachments/' + id\n\n unless response.status == 200\n error_model = JSON.load(response.body)\n mailosaur_error = Mailosaur::MailosaurError.new('Operation returned an invalid status code \\'' + response.status.to_s + '\\'', error_model...
[ "0.7398587", "0.7296942", "0.7253588", "0.7209554", "0.71996045", "0.71996045", "0.7145582", "0.70333874", "0.70266855", "0.70266855", "0.70266855", "0.70266855", "0.70266855", "0.698761", "0.69863105", "0.6961913", "0.6919592", "0.6893697", "0.68758965", "0.68495494", "0.684...
0.73936045
4
GET /attachments/new GET /attachments/new.json
def new @attachment = Attachment.new @attachment.model_name=params[:model_name] @attachment.model_id=params[:model_id] @attachment.created_by = current_user.id @attachment.user_id =current_user.id @attachment.sede_id =current_user.sede_id respond_to do |format| format.html # n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attachment }\n end\n end", "def new\n @attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ...
[ "0.8170156", "0.81698227", "0.81698227", "0.7850828", "0.76186186", "0.75798947", "0.75798947", "0.7561675", "0.75612336", "0.7499064", "0.7499064", "0.7325541", "0.7198492", "0.7149169", "0.6943176", "0.69420123", "0.69367063", "0.69170254", "0.6755561", "0.6755561", "0.6743...
0.0
-1
POST /attachments POST /attachments.json
def create @attachment = Attachment.new(params[:attachment]) if @attachment.model_id != nil respond_to do |format| if @attachment.save format.html { redirect_to "/#{@attachment.model_name}/#{@attachment.model_id}/edit/", notice: 'Attachment was successfully created.' } format....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n if params[:attachments]\n params[:attachments].each do |a|\n @attachment = @document.attachments.create!(:attachment => a)\n end\n end\n format.html {...
[ "0.67856145", "0.67284447", "0.6717782", "0.6717782", "0.6710522", "0.66664606", "0.6630575", "0.65930396", "0.65218943", "0.6507676", "0.6459344", "0.6454859", "0.6453828", "0.6449482", "0.6444526", "0.64219415", "0.640342", "0.6388061", "0.63603103", "0.6320983", "0.6305493...
0.58849114
69
PUT /attachments/1 PUT /attachments/1.json
def update @attachment = Attachment.find(params[:id]) if @attachment.model_id != nil respond_to do |format| if @attachment.update_attributes(params[:attachment]) format.html { redirect_to "/#{@attachment.model_name}/#{@attachment.model_id}/edit/", notice: 'Attachment was successfully up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @document.update(document_params)\n if params[:attachments]\n params[:attachments].each do |a|\n @attachment = @document.attachments.create!(:attachment => a)\n end\n end\n format.html { redirect_to @document, notice...
[ "0.70723903", "0.6969434", "0.69647133", "0.69444317", "0.6940061", "0.6824948", "0.6824948", "0.6770707", "0.67692095", "0.6754012", "0.67488635", "0.6722136", "0.6639801", "0.6639801", "0.66233605", "0.6618303", "0.6527931", "0.65129924", "0.65124446", "0.6439156", "0.63972...
0.6488836
19
DELETE /attachments/1 DELETE /attachments/1.json
def destroy rol = Role.where(:id=>current_user.role).first if rol.nombre == "ACRM" @attachment = Attachment.find(params[:id]) @attachment.destroy else @attachment = Attachment.find(params[:id]) flash[:error] ='No tienes permiso para realizar esta accion' redirect_to "/#{@attachment.model_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @attachment = Attachment.find_by_name(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url }\n format.json { head :ok }\n end\n end", "def destroy\n @attachments = Attachment.find_by_id(params[:id])\n if @attachments....
[ "0.7916768", "0.7911838", "0.784848", "0.78034145", "0.78034145", "0.78034145", "0.7649128", "0.75554717", "0.7527234", "0.7527234", "0.75029725", "0.7485045", "0.74720657", "0.74386334", "0.7388286", "0.7363958", "0.7326456", "0.7315792", "0.7279625", "0.72642744", "0.723074...
0.0
-1
this method is only here until my patch to add it to holygrail is accepted TODO: consider not requiring holygrail
def js_dom # force holygrail to set @__page js('true') unless @__page HTML::Document.new(@__page.to_html, false, true).root end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def schubert; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def probers; end", "def refutal()\n end", "def jack_handey; end", "def implementation; end", "def implementation; end", "def suivre; end", "def weber; end", "def mitch_h...
[ "0.72554106", "0.64134276", "0.64018524", "0.64018524", "0.64018524", "0.64018524", "0.6347293", "0.6164893", "0.6035768", "0.60233474", "0.60233474", "0.59546834", "0.5948067", "0.59028184", "0.58855", "0.58724016", "0.58308554", "0.5808673", "0.5808613", "0.5808613", "0.580...
0.0
-1
GET /products GET /products.json
def index #@products = Product.all @products = Product.order('created_at ASC').page(params[:page]).per(12) respond_to do |format| format.html # index.html.erb format.json { render json: @products } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def products\n request :public, :get, :products\n end", "def index\n @products = Product.all\n render json: @products\n end", "def index\n begin\n ...
[ "0.79500145", "0.7929853", "0.79054135", "0.77477723", "0.76619905", "0.7622153", "0.762195", "0.762195", "0.762195", "0.76070404", "0.75873625", "0.75828224", "0.7578298", "0.75750685", "0.7565435", "0.7565435", "0.7565435", "0.7565435", "0.7530454", "0.7523024", "0.75097287...
0.7058764
73
GET /products/1 GET /products/1.json
def show #@product_impact_line_items = @product.product_impact_line_items.includes(:impact_line_item, :impact_entries) respond_to do |format| format.html # show.html.erb format.json { render json: @product } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product(name)\n get(\"/apiproducts/#{name}\")\n end", "def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def index\n @api_v1_products = Product.all\n jso...
[ "0.77224106", "0.76329553", "0.76313764", "0.7607208", "0.75760156", "0.7552171", "0.7506385", "0.7484625", "0.745622", "0.74501616", "0.74376804", "0.7421124", "0.7362056", "0.7318765", "0.73185545", "0.73185545", "0.73185545", "0.7316062", "0.7311976", "0.73088664", "0.7294...
0.0
-1
POST /products POST /products.json
def create #byebug params.require(:product).permit(:name, :parent_product_id, :user_id) @product = Product.new(product_params) # set up associations @product.user = current_user ActiveRecord::Base.transaction do respond_to do |format| if @product.save ImpactLineItem.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n if params[:products]\n params[:products].each do |product|\n @...
[ "0.7675459", "0.7591834", "0.75612974", "0.75322855", "0.75319254", "0.7508541", "0.74220365", "0.73919785", "0.7374981", "0.7356637", "0.73236746", "0.72879046", "0.71453404", "0.7051657", "0.7048709", "0.7043144", "0.70384234", "0.70384234", "0.70384234", "0.7033281", "0.70...
0.0
-1
PATCH/PUT /products/1 PATCH/PUT /products/1.json
def update ActiveRecord::Base.transaction do respond_to do |format| if @product.update(product_params) ImpactLineItem.all.each do |impact_line_item| product_impact_line_item = @product.product_impact_line_items.find_by_impact_line_item_id(impact_line_item.id) Categ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def update\n if @product.update(product_params)\n render json: @product, status: :ok#, location: @colle...
[ "0.7269931", "0.6935652", "0.68690825", "0.6846676", "0.68126076", "0.67678404", "0.6749974", "0.6741848", "0.67151767", "0.6700884", "0.6686023", "0.66597176", "0.6654553", "0.66536564", "0.664067", "0.664067", "0.66382414", "0.6631012", "0.6631012", "0.6627257", "0.6620688"...
0.0
-1
DELETE /products/1 DELETE /products/1.json
def destroy @product.destroy respond_to do |format| format.html { redirect_to products_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n product = Product.find(params[:id])\n product.destroy\n\n render json: { deleted: params[:id] }\n end", "def delete_product(name)\n delete(\"/apiproducts/#{name}\")\n end", "def destroy\n p @product.destroy!\n render json: { result: 'deleted' }, status: :ok\n end", ...
[ "0.7716767", "0.7593029", "0.7548404", "0.75026053", "0.7501899", "0.74741083", "0.7439505", "0.7417943", "0.74088925", "0.7370336", "0.73533446", "0.73478407", "0.73357344", "0.73357344", "0.73357344", "0.73131037", "0.73131037", "0.73131037", "0.73131037", "0.73131037", "0....
0.73308176
20
Use callbacks to share common setup or constraints between actions.
def set_product #@product = Product.find params[:id] @product = Product.where(id: params[:id]).includes( {product_impact_line_items: [:impact_line_item, :impact_entries]}).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def product_params params.require(:product).permit(:name, :description, :barcode_type, :barcode, :image, :address, :user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.629...
0.0
-1
Constructor Params: +color+:: the color of the player +display+:: the object of a class encapsulating
def initialize(color, display) @color = color @display = display end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(color, board)\n @my_color = color\n @opponent_color = \n @my_color == Reversi::Board::DISK[:white] ? \n Reversi::Board::DISK[:black] : Reversi::Board::DISK[:white]\n @board = board\n end", "def initialize(color)\n @color = color\n end", "def initialize(c...
[ "0.6786432", "0.6752082", "0.66963583", "0.65550196", "0.65087336", "0.64917564", "0.6481129", "0.6476787", "0.64615446", "0.6460129", "0.644403", "0.63901037", "0.63844967", "0.63107073", "0.6292702", "0.6280116", "0.6269664", "0.6249759", "0.6238945", "0.62387645", "0.62275...
0.8033685
0
method gets the player movement
def get_move cols = %w(a b c d e f g h) rows = %w(8 7 6 5 4 3 2 1) from_pos, to_pos = nil, nil until from_pos && to_pos @display.draw if from_pos row, col = from_pos piece = @display.board[from_pos].class puts "#{piece} at #{cols[col]}#{rows[row]} selected. Where to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_move\n @players[0].get_move(@board)\n end", "def current_player_move\n @on_move == HUMAN_PLAYER ? human.move : computer.move\n end", "def player_position_look_update; end", "def update_player_movement\r\n # Move player in the direction the directional button is being pressed\r\n cas...
[ "0.7300525", "0.7108719", "0.70933926", "0.69621915", "0.69532776", "0.6928365", "0.6856961", "0.68043154", "0.6804129", "0.6777395", "0.6715853", "0.6714387", "0.67005616", "0.6673488", "0.66504997", "0.6598883", "0.65834767", "0.6544281", "0.6533309", "0.6518426", "0.651237...
0.0
-1
Boolean method returning the bool value indicating whether the given selected figure is valid
def valid_selection?(pos) piece = @display.board[pos] piece.color == @color end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid?\n validate_triangle\n true\n end", "def valid?\n validate!\n true\n rescue MiniMagick::Invalid\n false\n end", "def valid?\n return false if @max_cfvo.nil?\n return false if @max_color.nil?\n return false if @mid_cfvo.nil?\n return false if...
[ "0.6817812", "0.6729485", "0.67261195", "0.6648905", "0.6643566", "0.6643566", "0.6642276", "0.6618414", "0.6617961", "0.6614916", "0.6598242", "0.65575814", "0.653537", "0.6522483", "0.6519528", "0.64812696", "0.64669794", "0.64669794", "0.64669794", "0.64669794", "0.6466979...
0.0
-1
GET /spots GET /spots.xml
def index if params[:keyword] @spots = Spot.find(:all, :conditions => ["name like ?", "%#{params[:keyword]}%"]) else @spots = Spot.find(:all) end respond_to do |format| format.html # index.html.erb format.xml { render :xml => @spots } format.json { render :json => @spots....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @spots = Spot.find(:all) \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @spots }\n end\n end", "def show\n @spot = Spot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xm...
[ "0.74429226", "0.70069253", "0.70063", "0.68722105", "0.68575096", "0.6855056", "0.6671202", "0.66618776", "0.6528304", "0.64600945", "0.63718253", "0.6355338", "0.6283198", "0.6252559", "0.62195116", "0.62018496", "0.60784507", "0.60048807", "0.5997642", "0.5981643", "0.5969...
0.6638542
8
GET /spots/1 GET /spots/1.xml
def show @spot = Spot.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @spot } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @spots = Spot.find(:all) \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @spots }\n end\n end", "def show\n @spot_activity = SpotActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format....
[ "0.72319645", "0.6495363", "0.648675", "0.6435463", "0.63611215", "0.63473827", "0.6317015", "0.631176", "0.6245735", "0.6157297", "0.61473876", "0.5989815", "0.5974792", "0.5937288", "0.5893849", "0.58660686", "0.5848654", "0.58289784", "0.58203554", "0.5813854", "0.58066094...
0.72126204
2
GET /spots/new GET /spots/new.xml
def new @title = "場所の登録" @spot = Spot.new @lat = session[:new_map_center_lat] || 34 @lng = session[:new_map_center_lng] || 150 @zoom = session[:new_map_zoom] || 1 respond_to do |format| format.html # new.html.erb format.xml { render :xml => @spot } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @spot = Spot.new(params[:spot])\n\n respond_to do |format|\n if @spot.save\n flash[:notice] = 'Spot was successfully created.'\n format.html { redirect_to(@spot) }\n format.xml { render :xml => @spot, :status => :created, :location => @spot }\n else\n forma...
[ "0.719872", "0.7153215", "0.7153215", "0.7001926", "0.6915244", "0.6655957", "0.66164356", "0.66032326", "0.6539377", "0.65134215", "0.64906764", "0.6440647", "0.6440647", "0.6369867", "0.6358691", "0.63531816", "0.6338194", "0.63215154", "0.63082176", "0.628201", "0.6281695"...
0.6175506
50
POST /spots POST /spots.xml
def create @spot = Spot.new(params[:spot]) respond_to do |format| if @spot.save flash[:notice] = 'Spot was successfully created.' format.html { redirect_to(@spot) } format.xml { render :xml => @spot, :status => :created, :location => @spot } else format.html { rende...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @spot = Spot.new(spot_params)\n\n respond_to do |format|\n if @spot.save\n format.html { redirect_to @spot, notice: 'Spot was successfully created.' }\n format.json { render :show, status: :created, location: @spot }\n else\n format.html { render :new }\n fo...
[ "0.6605932", "0.6586947", "0.6477971", "0.6404298", "0.61660933", "0.61529034", "0.6107558", "0.6103169", "0.6069601", "0.6016869", "0.59677684", "0.5964157", "0.5938998", "0.58903635", "0.5887882", "0.5830724", "0.581705", "0.58030385", "0.5779274", "0.5748995", "0.5744909",...
0.6943756
0
PUT /spots/1 PUT /spots/1.xml
def update @spot = Spot.find(params[:id]) respond_to do |format| if @spot.update_attributes(params[:spot]) flash[:notice] = 'Spot was successfully updated.' format.html { redirect_to(@spot) } format.xml { head :ok } else format.html { render :action => "edit" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @spot = Spot.find(params[:id])\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n...
[ "0.6583891", "0.658334", "0.65819573", "0.65819573", "0.6577946", "0.6442288", "0.64096373", "0.63760203", "0.6350477", "0.6350477", "0.6350477", "0.6350477", "0.62630695", "0.61750597", "0.61498", "0.6117777", "0.61135644", "0.59792244", "0.5976361", "0.59697115", "0.5956879...
0.6966321
0
DELETE /spots/1 DELETE /spots/1.xml
def destroy @spot = Spot.find(params[:id]) @spot.destroy respond_to do |format| format.html { redirect_to(spots_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @spot = Spot.find(params[:id])\n @spot.destroy\n\n respond_to do |format|\n format.html { redirect_to(spot_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def delete()\n res...
[ "0.7291676", "0.6624148", "0.66236794", "0.65972114", "0.6558815", "0.6495135", "0.63619936", "0.63619936", "0.6333078", "0.62592983", "0.6249959", "0.6216139", "0.6160865", "0.61570716", "0.6151279", "0.61475515", "0.6147537", "0.6129842", "0.6121459", "0.6121459", "0.612145...
0.7332503
0
GET /declaration_containers GET /declaration_containers.json
def index @declaration_containers = @declaration.declaration_containers.page(params[:page]) respond_to do |format| format.html # index.html.erb format.json { render json: @declaration_containers } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @declaration_container }\n end\n end", "def index\n @containers = Container.all\n end", "def containers\n TestLab::Container.all\n end", "def create\n @declaration_container = DeclarationC...
[ "0.6783124", "0.6520187", "0.6374029", "0.6326546", "0.6218535", "0.6209396", "0.6197015", "0.6183934", "0.61831903", "0.60729015", "0.6050682", "0.5985655", "0.5935334", "0.59206355", "0.5885471", "0.5882846", "0.5861131", "0.5821936", "0.58196545", "0.5798009", "0.57894534"...
0.75577176
0
GET /declaration_containers/1 GET /declaration_containers/1.json
def show respond_to do |format| format.html # show.html.erb format.json { render json: @declaration_container } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @declaration_containers = @declaration.declaration_containers.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @declaration_containers }\n end\n end", "def index\n @containers = Container.all\n end", "def create\n ...
[ "0.7388319", "0.6743388", "0.66686505", "0.6461354", "0.6313267", "0.62979895", "0.6297625", "0.6292567", "0.6229595", "0.6223503", "0.6222594", "0.6170343", "0.61597574", "0.6084709", "0.6046337", "0.60257727", "0.5941389", "0.59389824", "0.5921294", "0.5906619", "0.5882632"...
0.66715103
2
GET /declaration_containers/new GET /declaration_containers/new.json
def new @declaration_container = DeclarationContainer.new(:declaration_id => @declaration.id) respond_to do |format| format.html # new.html.erb format.json { render json: @declaration_container } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n response = post_request(URI.parse(\"http://\"+Storage.find(cookies[:donabe_ip]).data+\"/\"+Storage.find(cookies[:current_tenant]).data+\"/containers.json\"), params[:container].to_json, Storage.find(cookies[:current_token]).data)\n json_respond response.body \n\n end", "def create\n res...
[ "0.721692", "0.7153837", "0.70260745", "0.68807894", "0.6873884", "0.6738005", "0.6662435", "0.6646981", "0.6574454", "0.6452609", "0.6448426", "0.6389368", "0.63851917", "0.6368986", "0.63640416", "0.63312155", "0.6325413", "0.630941", "0.6253809", "0.62261295", "0.6225032",...
0.7340427
0
POST /declaration_containers POST /declaration_containers.json
def create @declaration_container = DeclarationContainer.new(params[:declaration_container]) respond_to do |format| if @declaration_container.save format.html { redirect_to new_declaration_container_url(:declaration_id => @declaration_container.declaration_id), notice: 'Declaration container was ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n response = post_request(URI.parse(\"http://\"+(sesh :donabe_ip)+\"/\"+(sesh :current_tenant)+\"/containers.json\"), params[:container].to_json, (sesh :current_token))\n json_respond response.body \n\n end", "def create\n response = post_request(URI.parse(\"http://\"+Storage.find(cookies...
[ "0.7269031", "0.7036018", "0.6538774", "0.6397962", "0.62260205", "0.59086496", "0.58799714", "0.58510166", "0.58453804", "0.5839208", "0.5731913", "0.5722767", "0.5709518", "0.56978905", "0.5526372", "0.55007195", "0.54722893", "0.54154944", "0.5413828", "0.53923905", "0.537...
0.72740287
0
PUT /declaration_containers/1 PUT /declaration_containers/1.json
def update respond_to do |format| if @declaration_container.update_attributes(params[:declaration_container]) format.html { redirect_to @declaration_container, notice: 'Declaration container was successfully updated.' } format.json { head :no_content } else format.html { render a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n response = post_request(URI.parse(\"http://\"+(sesh :donabe_ip)+\"/\"+(sesh :current_tenant)+\"/containers.json\"), params[:container].to_json, (sesh :current_token))\n json_respond response.body \n\n end", "def update\n @container = Container.find(params[:id])\n\n respond_to do |for...
[ "0.65274495", "0.6337214", "0.6333239", "0.6330675", "0.6323929", "0.62748456", "0.618666", "0.6121751", "0.6089702", "0.6089702", "0.605397", "0.60125315", "0.59736514", "0.58905536", "0.5886036", "0.5884495", "0.58286834", "0.58200467", "0.57791716", "0.57731813", "0.571308...
0.6658888
0
DELETE /declaration_containers/1 DELETE /declaration_containers/1.json
def destroy @declaration_container.destroy respond_to do |format| format.html { redirect_to declaration_containers_url(:declaration_id => @declaration_container.declaration_id) } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete # rubocop:disable Metrics/AbcSize\n attrcheck = { 'container name' => @options[:container] }\n @validate.attrvalidate(@options, attrcheck)\n containerview = ObjectStorage.new(@options[:id_domain], @options[:user_name], @options[:passwd])\n if @options[:recurse]\n contents = containervie...
[ "0.76918715", "0.7438931", "0.7337981", "0.7057264", "0.69436973", "0.6942435", "0.69313556", "0.6906878", "0.6859583", "0.684559", "0.68162847", "0.68000805", "0.6758714", "0.67520845", "0.6731611", "0.66865116", "0.66116", "0.65722394", "0.6566707", "0.65207314", "0.6433853...
0.76548004
1
Create a new instance based on the supplied HQMF entry
def initialize(entry) @entry = entry @code_list_xpath = 'cda:act/cda:sourceOf//cda:code/@code' template_id = attr_val('cda:act/cda:templateId/@root') case template_id when '2.16.840.1.113883.3.560.1.2' @type = :diagnosis @code_list_xpath = 'cda:act/cda:sourceOf/cda:observat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_record(src = :example)\n fields = src.is_a?(Hash) ? src : manifests(src.to_sym).fields.except(:id)\n Manifest.new(fields)\n end", "def as_hqmf_model\n @hqmf ||= HQMF::Document.from_json(self.hqmf_document)\n end", "def new(&block)\n assign_attributes if params[model_identifier]\n...
[ "0.5707038", "0.5690233", "0.55953306", "0.55622053", "0.54981196", "0.5450447", "0.54236335", "0.5423372", "0.5423372", "0.5411338", "0.5411338", "0.5406396", "0.53943086", "0.5326762", "0.53220886", "0.53091043", "0.53055227", "0.53055227", "0.52905136", "0.5282919", "0.527...
0.0
-1
Get the identifier of the criteria, used elsewhere within the document for referencing
def id attr_val('cda:act/cda:id/@root') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def occurrence_id \n # An identifier for the Occurrence (as opposed to a particular digital record of the occurrence).\n # In the absence of a persistent global unique identifier, construct one from a combination of identifiers in the record that will most closely make the occurrenceID globally unique.\n...
[ "0.60920924", "0.6091506", "0.6059526", "0.59146196", "0.5906911", "0.5861032", "0.5840608", "0.57908136", "0.57642967", "0.5751927", "0.57094", "0.5682323", "0.567403", "0.5669488", "0.56657654", "0.56657654", "0.563467", "0.5611659", "0.5601943", "0.5590149", "0.5579265", ...
0.0
-1
Get the title of the criteria, provides a human readable description
def title @entry.at_xpath('.//cda:title').inner_text end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_title_description()\n\t\tif !self.building_number.nil?\n\t\t\tif self.title.include? self.building_number\n\t\t\t\treturn \"Building \" + self.building_number\n\t\t\telse\n\t\t\t\treturn \"Building \" + self.building_number + \"- \" + self.title\n\t\t\tend\n\t\telse\n\t\t\treturn self.title\n\t\tend\n\tend...
[ "0.67994153", "0.6794488", "0.66137445", "0.6604283", "0.64589506", "0.6374694", "0.6329028", "0.62590224", "0.61775875", "0.61597127", "0.6153423", "0.6152271", "0.61486703", "0.61259705", "0.6124067", "0.6124067", "0.6116671", "0.6116671", "0.6116671", "0.6116671", "0.61166...
0.0
-1
Get the code list OID of the criteria, used as an index to the code list database
def code_list_id attr_val(@code_list_xpath) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_code_list_id_for_element(data_criteria, record)\n source_data_criteria = record.source_data_criteria if record.respond_to?('source_data_criteria')\n if source_data_criteria\n data_criteria_source = source_data_criteria.select { |sdc| sdc['description'] == data_criteria['description'] }\n\...
[ "0.6566039", "0.65039617", "0.55662733", "0.54731756", "0.54731756", "0.54152083", "0.5308026", "0.528009", "0.52527857", "0.5166433", "0.5159573", "0.514968", "0.5142255", "0.5141008", "0.5114429", "0.51089424", "0.5088797", "0.5055395", "0.5032888", "0.5020609", "0.5007019"...
0.6392065
2
Get the status of the criteria, e.g. active, completed, etc. Only present for certain types like condition, diagnosis, procedure, etc.
def status if @status_path attr_val(@status_xpath) else nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_status\n if criteria_type == Constants::CRITERIA_TYPE_PASS_FAIL\n temp_status = status\n else\n temp_status = point.zero? ? Constants::CRITERIA_STATUS_FAILED : Constants::CRITERIA_STATUS_PASSED\n end\n temp_status\n end", "def get_status\n if draft\n :draft\n elsif close...
[ "0.73605233", "0.6826434", "0.6603151", "0.6561015", "0.6458034", "0.6426171", "0.6426171", "0.6422271", "0.6391215", "0.63535726", "0.634973", "0.6348514", "0.6348514", "0.6348514", "0.6348514", "0.62648356", "0.6262153", "0.6262153", "0.6250871", "0.624784", "0.6226443", ...
0.0
-1
Get a JS friendly constant name for this measure attribute
def const_name components = title.gsub(/\W/,' ').split.collect {|word| word.strip.upcase } components.join '_' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def const_value() @name end", "def name\n underscore const_name\n end", "def name \n case type\n when \"percentage\"\n return \"#{@multiplier.round(0)}\\% Off\"\n when \"deduction\"\n return \"£#{@multiplier.round(0)} Off\"\n end\n end", "def name\n @custom_name || @at...
[ "0.6975965", "0.6824656", "0.65747225", "0.65431106", "0.6508178", "0.64865637", "0.6233803", "0.6233803", "0.61627936", "0.6147548", "0.6132274", "0.6090819", "0.60772294", "0.60616463", "0.6037446", "0.6018665", "0.6000121", "0.59772646", "0.59772646", "0.59772646", "0.5977...
0.6418567
6