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 |
|---|---|---|---|---|---|---|
Substitutes special characters with their XML entity. E.g. it substitutes "<" with "<". | def escape_xml(text)
text.encode(xml: :text)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_gsub!(chars)\n mapping = {\n '&' => '&',\n '<' => '<',\n '>' => '>',\n '\"' => '"',\n \"'\" => '''\n }\n re = /&(?!amp;)|[<>'\"]/\n chars.gsub!(re, mapping)\n chars\n end",
"def escape_xml(string) \n string.gsub(/[&<>\\'\\\"]/) do | ma... | [
"0.81134385",
"0.7451417",
"0.7441459",
"0.73939836",
"0.73343104",
"0.7291183",
"0.7286745",
"0.7265885",
"0.70572984",
"0.7055767",
"0.6982291",
"0.6942248",
"0.6913582",
"0.6907665",
"0.68636906",
"0.6841599",
"0.6830967",
"0.6802817",
"0.67973703",
"0.67921394",
"0.676468... | 0.6509977 | 31 |
Substitutes back XML entities with their plain text equivalent. E.g. it substitutes "<" with "<". | def unescape_xml(text)
CGI.unescape_html text
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve_xml_entities(text)\r\n result=text\r\n result.gsub!(\"<\", \"<\")\r\n result.gsub!(\">\", \">\")\r\n result.gsub!(\"&\", \"&\")\r\n result\r\n end",
"def entity_gsub!(chars)\n mapping = {\n '&' => '&',\n '<' => '<',\n '>' => '&g... | [
"0.8154558",
"0.7559189",
"0.7327057",
"0.7227761",
"0.71658576",
"0.715201",
"0.7062194",
"0.70245856",
"0.7012031",
"0.699243",
"0.6916936",
"0.68483657",
"0.663875",
"0.66350055",
"0.659608",
"0.6494929",
"0.6462377",
"0.6434946",
"0.6430991",
"0.6422241",
"0.64034563",
... | 0.6737825 | 12 |
Description: It is a METHOD for invoking the Razoo Site | def invokeRazooSite()
puts "************** START : Invoke Razoo Application ****************"
# Create a new instance of the Selenium-Client driver.
$browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "https://www-qatrunk.razoo.com/login",
:timeout_in_second => 60
# Start the browser session
$browser.start_new_browser_session
# Print a message in the browser-side log and status bar
$browser.set_context("Razoo Application")
$browser.open "/"
puts "Passed. Razoo Site gets invoked successfully!"
puts "************** END : Invoke Razoo Application ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; end",
"def site; e... | [
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"0.6983428",
"... | 0.66429037 | 30 |
Description: This method allows the user to create account in Razoo. | def createRazooAccount(first_name, last_name, email_id, pass_word)
puts "************** START : Create a Razoo Account ****************"
$browser.click "link=Sign up"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Create an account on Razoo")
puts "Passed. User has reached the Account creation page successfully."
rescue Test::Unit::AssertionFailedError
puts "Failed. User didn't reach the Account creation page."
end
puts "Step 1 : Entering Account creation details"
$browser.type "user_first_name", first_name
$browser.type "user_last_name", last_name
$browser.type "user_email", email_id
$browser.click "user_terms_of_use"
$browser.type "user_password", pass_word
$browser.type "user_password_confirmation", pass_word
$browser.click "//button[@type='submit']"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Your account has been created.")
puts "Step 2 : Passed. Account has been created successfully!"
rescue Test::Unit::AssertionFailedError
begin
assert $browser.is_text_present("Email is already in use by another account (if it's yours, you can recover your account password from the login screen)")
puts "Step 2 : Failed. #{email_id} has already been taken."
login(email_id, pass_word)
rescue Test::Unit::AssertionFailedError
puts "Step 2 : Failed. Account not created successfully!"
end
end
puts "************** END : Create a Razoo Account ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_account\n\n end",
"def create_accounts\n end",
"def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end",
"def create_account\n if new_record? && !self.account_id\n account = Account.new\n account.name = \"Preecha o nome da sua empresa\... | [
"0.8188425",
"0.7591067",
"0.75439626",
"0.7378918",
"0.7147901",
"0.71357816",
"0.7129786",
"0.71184707",
"0.7022961",
"0.7004335",
"0.7004335",
"0.6985949",
"0.69765073",
"0.69619584",
"0.695699",
"0.6953992",
"0.6953992",
"0.69314903",
"0.69133455",
"0.6902272",
"0.6890707... | 0.0 | -1 |
Description: This method allows the user to login to Razoo application. | def login(email_id, pass_word)
puts "************** START : Login to Razoo ****************"
$browser.click "link=Log in"
$browser.wait_for_page_to_load
puts "Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}"
$browser.type "user_session_email", email_id
$browser.type "user_session_password", pass_word
$browser.click "//button[@type='submit']"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Login successful!")
puts "Step 2 : Passed. Login was Successful!!!"
rescue Test::Unit::AssertionFailedError
puts "Step 2 : Failed. Login Failed"
end
puts "************** END : Login to Razoo ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login\n end",
"def login\n validate_arguments!\n\n Turbot::Auth.login\n display \"Authentication successful.\"\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
... | [
"0.7478593",
"0.74374604",
"0.74355835",
"0.74355835",
"0.74355835",
"0.74355835",
"0.74355835",
"0.74355835",
"0.74355835",
"0.74355835",
"0.74355835",
"0.7359022",
"0.7359022",
"0.73383445",
"0.72495264",
"0.71485215",
"0.7146734",
"0.7123809",
"0.7092621",
"0.69978374",
"0... | 0.66145265 | 44 |
Description: This method allows the user to search Project. | def searchProject(project_name)
$story_name = project_name
puts "************** START: Search PROJECT ****************"
$browser.click "//strong"
$browser.wait_for_page_to_load
$browser.click "orgScope"
sleep 2
$browser.click "widgetScope"
sleep 2
puts "Step 1 : Type #{$story_name} in the Search Field"
$browser.type "parametricKeyword", project_name
$browser.click "//button[@type='submit']"
sleep 5
puts "Step 2 : Click on #{$story_name} link"
$browser.click "link=#{$story_name}"
$browser.wait_for_page_to_load
begin
assert_equal "#{$story_name} - Razoo", $browser.get_title
puts "Step 3 : Passed. User reached #{$story_name} Story Page successfully!!"
rescue Test::Unit::AssertionFailedError
puts "Step 3 : Failed. Problem in reaching the Project Story page."
end
puts "************** END : Search PROJECT ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_search(name)\n search_field.set name\n search_button.click\n end",
"def search\n\n @searching = true\n results = Project.includes(:images, :videos, :account, :invoice).user_readable(current_user).search_for(params['search-string'])\n @projects = results.page(params[:page]).per(@... | [
"0.8167837",
"0.7711648",
"0.7509277",
"0.7369897",
"0.73240757",
"0.7243915",
"0.7201348",
"0.71983236",
"0.7027781",
"0.70145637",
"0.69880617",
"0.69810414",
"0.68776655",
"0.6868382",
"0.6864584",
"0.6859799",
"0.6856708",
"0.6842676",
"0.6839956",
"0.6824763",
"0.6803169... | 0.6903627 | 13 |
Description: This method allows to grant the Admin rights to the Normal User. | def grantOrgAdminRights(admin_url, email_id, ein_number)
puts "************** START : Grant ORG Admin rights ****************"
$browser.open admin_url
$browser.click "link=Manage Org Admins"
$browser.wait_for_page_to_load
$browser.type "email", email_id
$browser.type "ein", ein_number
$browser.click "commit"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Org Admin successfully created!")
puts "Passed. Org Admin successfully created for #{email_id} user"
rescue Test::Unit::AssertionFailedError
puts "Failed. Org Admin has not created successfully for #{email_id} user"
end
puts "************** END : Grant ORG Admin rights ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_as_admin\n self.role = USER_ROLES[:admin]\n end",
"def admin_user \n if (!current_user.lunches_admin?) \n flash[:alert] = 'You not allowed to edit menu.'\n \n redirect_to(root_url)\n end\n end",
"def make_admin\n authorize! @user\n @user.roles = @user.rol... | [
"0.7382321",
"0.7260479",
"0.72393847",
"0.71641356",
"0.71494776",
"0.7134239",
"0.7100304",
"0.70736945",
"0.70217246",
"0.70213205",
"0.701641",
"0.7007104",
"0.70047665",
"0.7003035",
"0.69878435",
"0.69824576",
"0.69781905",
"0.6970687",
"0.6953214",
"0.6947404",
"0.6946... | 0.0 | -1 |
Description: This method allows the user to check/click Signup Login links in Razoo. | def verifySignupLoginLinks()
puts "************** START: Verify SignUp Login Links ****************"
puts "Step 1 : Click on Sign Up Link at the Header."
$browser.click "link=Sign up"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Create an account on Razoo")
puts "Step 1 is passed. User has reached the Sign Up screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1 is Failed. User had failed to reach the Sign Up screen."
$verification_errors << $!
end
puts "Step 2 : Click on Login Link in the Sign up screen."
$browser.click "link=Log In"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Log in")
puts "Step 2 is passed. User has reached the Login screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 2 is Failed. User had failed to reach the Login screen."
$verification_errors << $!
end
puts "Step 3 : Click on Forgot Password Link in the Login screen."
$browser.click "link=exact:Forgot login details?"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Reset Your Password")
puts "Step 3 is passed. User has reached the Reset Your Password screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 3 is Failed. User had failed to reach the Reset Your Password screen."
$verification_errors << $!
end
puts "************** END: Verify SignUp Login Links ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def comp_signin_link\n click_link 'Sign in'\n end",
"def nav_login_button\r\n \r\n end",
"def button_to_function_with_login_check(name, *args, &block)\n html_options = args.extract_options!\n level = html_options.delete :level\n if level && ApplicationHelper.need_signup?(level) && ... | [
"0.6962902",
"0.6931101",
"0.6738772",
"0.66342366",
"0.6515258",
"0.64978194",
"0.649739",
"0.6458347",
"0.6442681",
"0.6406932",
"0.6395633",
"0.63892394",
"0.6376531",
"0.6369642",
"0.63684833",
"0.634929",
"0.63252014",
"0.6324359",
"0.6323296",
"0.6321328",
"0.63103926",... | 0.63880366 | 13 |
Description: This method allows the user to check/click all the Header links in Razoo. | def verifyHeaderLinks()
puts "************** START: Verify Header Links ****************"
puts "Step 1 : Click on Donate Link at the Header"
$browser.click "//strong"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Search by Name, Keyword, or Zip Code")
puts "Step 1 is Passed. User has reached the Search page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1 is Failed. User had failed to reach the Search Page."
$verification_errors << $!
end
puts "Step 2 : Click on Fundraise Link at the Header"
$browser.click "//li[2]/a/strong"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Create a Fundraising Page")
puts "Step 2 is Passed. User has reached the Create Fundraising page successfully thro' Header."
rescue Test::Unit::AssertionFailedError
puts "Step 2 is Failed. User had failed to reach the Create Fundraising page thro' Header."
$verification_errors << $!
end
begin
assert $browser.is_element_present("link=Start a fundraiser")
puts "Step 2 is Passed. User has reached the Create Fundraising page successfully thro' Header."
rescue Test::Unit::AssertionFailedError
puts "Step 2 is Failed. User had failed to reach the Create Fundraising page thro' Header."
$verification_errors << $!
end
puts "Step 3 : Click on Search Image icon at the Header"
$browser.click "//input[@type='image']"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Search by Name, Keyword, or Zip Code")
puts "Step 3 is Passed. User has reached the Search page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 3 is Failed. User had failed to reach the Search Page."
$verification_errors << $!
end
puts "************** END: Verify Header Links ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verifyHeaderLinks()\n\n\tputs \"************** START: Verify Header Links ****************\"\n\tputs \"Step 1 : Click on Donate Link at the Header\"\n\t$browser.click \"//strong\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Search by Name, Keyword, or Zip Code\")\n\t\tput... | [
"0.6715679",
"0.6676555",
"0.6317206",
"0.6207091",
"0.6158847",
"0.6015229",
"0.6013594",
"0.5993965",
"0.5956792",
"0.58936846",
"0.5858779",
"0.58507425",
"0.58462614",
"0.57995874",
"0.5689727",
"0.5665278",
"0.56362236",
"0.5629746",
"0.5628147",
"0.5616183",
"0.56148106... | 0.67099667 | 1 |
Description: This method allows the user to check/click all the Footer links in Razoo. | def verifyFooterLinks()
puts "************** START: Verify Footer Links ****************"
puts "Step 1 : Click on Fundraise Link at the Footer"
$browser.click "//div/a/em"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Create a Fundraising Page")
puts "Step 1 is Passed. User has reached the Create Fundraising page successfully thro' Footer."
rescue Test::Unit::AssertionFailedError
puts "Step 1 is Failed. User had failed to reach the Create Fundraising page thro' Footer."
$verification_errors << $!
end
begin
assert $browser.is_element_present("link=Start a fundraiser")
puts "Step 2 is Passed. User has reached the Create Fundraising page successfully thro' Footer."
rescue Test::Unit::AssertionFailedError
puts "Step 2 is Failed. User had failed to reach the Create Fundraising page thro' Footer."
$verification_errors << $!
end
puts "Step 3 : Click on Nonprofits Link at the Footer"
$browser.click "//div[2]/div/a/em"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Razoo For Nonprofits")
puts "Step 3 is Passed. User has reached the Claim Admin Access page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 3 is Failed. User had failed to reach the Claim Admin Access page."
$verification_errors << $!
end
puts "************** END: Verify Footer Links ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def footer_check(locators)\n passing = false\n locators.where(offer: 'footer').each do |locator|\n passing = true if browser.first(locator.css)\n end\n raise \"Could Not Find Footer\" if passing == false\n end",
"def verifyFooterLinks()\n\t\n\tputs \"********... | [
"0.69726855",
"0.6872534",
"0.661653",
"0.66009957",
"0.64208716",
"0.63339335",
"0.62797356",
"0.616962",
"0.600168",
"0.5985875",
"0.5970845",
"0.5946117",
"0.59439504",
"0.5907305",
"0.5890963",
"0.58885914",
"0.5883801",
"0.5871587",
"0.5862083",
"0.5844033",
"0.5824827",... | 0.6689927 | 3 |
Description: This method allows the user to check/click all the MyAccount links in Razoo. | def verifyMyAccountLinks()
puts "************** START: Verify MyAccount Links ****************"
puts "Step 1 : Verify all the links under My Account screen."
$browser.click "myAccountHeaderLink"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("My Account")
puts "Step 1.1 : User has reached the Account page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1.1 : User had failed to reach the Account page."
$verification_errors << $!
end
$browser.click "link=Edit My Profile"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Edit My Profile")
puts "Step 1.2 : User has reached the EditMyProfile page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1.2 : User had failed to reach the EditMyProfile page."
$verification_errors << $!
end
$browser.click "link=My Donations"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Start donating")
puts "Step 1.3 : User has reached the My Donations page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1.3 : User had failed to reach the My Donations page."
$verification_errors << $!
end
$browser.click "link=Account Settings"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Change your login information")
puts "Step 1.4 : User has reached the Account Settings page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1.4 : User had failed to reach the Account Settings page."
$verification_errors << $!
end
begin
assert $browser.is_element_present("link=My Saved Cards")
$browser.click "link=My Saved Cards"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("My Credit Cards")
puts "Step 1.5 : User has reached the My Saved Card page successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1.5 : User had failed to reach the My Saved Card page."
$verification_errors << $!
end
rescue
$verification_errors << $!
puts "Step 1.5 : My Saved card link is not available for this User."
end
puts "************** END: Verify MyAccount Links ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def link_account_click\n link_account_button.click\n end",
"def test_02_normaluser_clickall_links()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 01 ----------------------\"\n\t\tverifyAboutUsLinks()\n\t\tverifySignupLoginLinks()\n\t\tlogin(\"normaluser@aol.com\", \"123456\")\n\t\tverifyHead... | [
"0.71369505",
"0.67011714",
"0.65718096",
"0.6560189",
"0.61526775",
"0.6103668",
"0.603856",
"0.6035404",
"0.6033989",
"0.5907793",
"0.5869743",
"0.584983",
"0.58461726",
"0.5785496",
"0.57650226",
"0.5761578",
"0.5752358",
"0.5691608",
"0.56880987",
"0.56618124",
"0.5655191... | 0.6119209 | 6 |
Description: This method allows the NPO Admin to check/click all the Story links in Razoo. | def verifyNPOAdminLinks(story_name)
puts "************** START: Verify ORG page Links ****************"
puts "Step 1 : Click on MY NPO link at the Header."
$browser.click "link=My NPO"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present(story_name)
puts "Step 1 is Passed. User has reached the MY NPO screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1 is Failed. User had failed to reach MY NPO screen."
$verification_errors << $!
end
puts "Step 2 : Click on EditPage link on the Story page."
$browser.click "link=Edit Page"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("The Basics")
puts "Step 2 is Passed. User has reached the EditPage screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 2 is Failed. User had failed to reach EditPage screen."
$verification_errors << $!
end
puts "Step 3 : Click on Thumbnail link on the Story page."
$browser.click "link=Thumbnail"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Current Thumbnail")
puts "Step 3 is Passed. User has reached the Thumbnail screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 3 is Failed. User had failed to reach Thumbnail screen."
$verification_errors << $!
end
puts "Step 4 : Click on Matching Grants link on the Story page."
$browser.click "link=Matching Grants"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Grantor")
puts "Step 4 is Passed. User has reached the Matching Grants screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 4 is Failed. User had failed to reach Matching Grants screen."
$verification_errors << $!
end
puts "Step 5 : Click on NPO Details link on the Story page."
$browser.click "link=NPO Details"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Charity Logo:")
puts "Step 5 is Passed. User has reached the NPO Details screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 5 is Failed. User had failed to reach NPO Details screen."
$verification_errors << $!
end
puts "Step 6 : Click on Promote link on the Story page."
$browser.click "link=Promote"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Or get a donation button to put on your website")
puts "Step 6 is Passed. User has reached the Promote screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 6 is Failed. User had failed to reach Promote screen."
$verification_errors << $!
end
puts "Step 7 : Click on DonateAnywhere link on the Story page."
$browser.click "link=DonateAnywhere"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("DonateAnywhere")
puts "Step 7 is Passed. User has reached the DonateAnywhere screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 7 is Failed. User had failed to reach DonateAnywhere screen."
$verification_errors << $!
end
puts "Step 8 : Click on Donations link on the Story page."
$browser.click "link=Donations"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Donations Listing")
puts "Step 8 is Passed. User has reached the Donations screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 8 is Failed. User had failed to reach Donations screen."
$verification_errors << $!
end
puts "Step 9 : Click on Disbursements link on the Story page."
$browser.click "link=Disbursements"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Disbursements")
puts "Step 9 is Passed. User has reached the Disbursements screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 9 is Failed. User had failed to reach Disbursements screen."
$verification_errors << $!
end
# ------------------------------ Global Admin Links -----------------------------
begin
assert $browser.is_element_present("link=Data Sources")
puts "Step 10 : Click on Create Data Sources link on the Story page."
$browser.click "link=Data Sources"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Razoo Admin Area")
puts "Step 10 is Passed. User has reached the Data Sources screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 10 is Failed. User had failed to reach Data Sources screen."
$verification_errors << $!
end
puts "Step 11 : Click on Create Audits link on the Story page."
$browser.click "link=Audits"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("PATRIOT Act")
puts "Step 11 is Passed. User has reached the Audits screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 11 is Failed. User had failed to reach Audits screen."
$verification_errors << $!
end
rescue
puts "Step 10 & 11 : I don't have access to view Data Sources and Audit links."
end
# ------------------------------ Global Admin Links -----------------------------
puts "Step 12 : Click on Create Project link on the Story page."
$browser.click "link=Create Project"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("The Basics")
puts "Step 12 is Passed. User has reached the Create Project screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 12 is Failed. User had failed to reach Create Project screen."
$verification_errors << $!
end
puts "************** END: Verify ORG page Links ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_03_storyadmin_clickall_links()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 02 ----------------------\"\n\t\tlogin(\"orgadmin@aol.com\", \"123456\")\n\t\tverifyHeaderLinks()\n\t\tverifyFooterLinks()\n\t\tverifyMyAccountLinks()\n\t\tverifyNPOAdminLinks(\"Minnesota Community Foundation\")\n\t\... | [
"0.76336783",
"0.62938935",
"0.6258575",
"0.6258575",
"0.6187767",
"0.6105753",
"0.6042825",
"0.59901327",
"0.59274393",
"0.59087807",
"0.57696474",
"0.5712865",
"0.5706284",
"0.56892437",
"0.56782097",
"0.56689274",
"0.56500787",
"0.5638172",
"0.5602282",
"0.5587661",
"0.557... | 0.59087807 | 10 |
Description: This method allows the FR/PRO Admin to check/click all the Story links in Razoo. | def verifyStoryAdminLinks()
puts "************** START: Verify PRO page Links ****************"
puts "Step 1 : Click on EditPage link on the Story page."
$browser.click "link=Edit Page"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("The Basics")
puts "Step 1 is Passed. User has reached the EditPage screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 1 is Failed. User had failed to reach EditPage screen."
$verification_errors << $!
end
puts "Step 2 : Click on Thumbnail link on the Story page."
$browser.click "link=Thumbnail"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Current Thumbnail")
puts "Step 2 is Passed. User has reached the Thumbnail screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 2 is Failed. User had failed to reach Thumbnail screen."
$verification_errors << $!
end
puts "Step 3 : Click on Matching Grants link on the Story page."
$browser.click "link=Matching Grants"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Grantor")
puts "Step 3 is Passed. User has reached the Matching Grants screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 3 is Failed. User had failed to reach Matching Grants screen."
$verification_errors << $!
end
puts "Step 4 : Click on Promote link on the Story page."
$browser.click "link=Promote"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Or get a donation button to put on your website")
puts "Step 4 is Passed. User has reached the Promote screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 4 is Failed. User had failed to reach Promote screen."
$verification_errors << $!
end
puts "Step 5 : Click on DonateAnywhere link on the Story page."
$browser.click "link=DonateAnywhere"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("DonateAnywhere")
puts "Step 5 is Passed. User has reached the DonateAnywhere screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 5 is Failed. User had failed to reach DonateAnywhere screen."
$verification_errors << $!
end
puts "Step 6 : Click on Donations link on the Story page."
$browser.click "link=Donations"
$browser.wait_for_page_to_load
begin
assert $browser.is_text_present("Donations Listing")
puts "Step 6 is Passed. User has reached the Donations screen successfully."
rescue Test::Unit::AssertionFailedError
puts "Step 6 is Failed. User had failed to reach Donations screen."
$verification_errors << $!
end
puts "************** END: Verify PRO page Links ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_03_storyadmin_clickall_links()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 02 ----------------------\"\n\t\tlogin(\"orgadmin@aol.com\", \"123456\")\n\t\tverifyHeaderLinks()\n\t\tverifyFooterLinks()\n\t\tverifyMyAccountLinks()\n\t\tverifyNPOAdminLinks(\"Minnesota Community Foundation\")\n\t\... | [
"0.75275606",
"0.61787665",
"0.6154492",
"0.6136655",
"0.6080685",
"0.597234",
"0.5949132",
"0.5858388",
"0.5836687",
"0.5805271",
"0.5761123",
"0.5752309",
"0.5704497",
"0.56979007",
"0.569094",
"0.569094",
"0.5684146",
"0.5656127",
"0.5653229",
"0.56402826",
"0.5630729",
... | 0.6255769 | 2 |
Description: This method allows the user to logout from the Razoo application. | def logout()
puts "************** START : Log out from Razoo ****************"
sleep 2
$browser.click "link=Log out"
$browser.wait_for_page_to_load
begin
assert $browser.is_element_present("link=Log in")
puts "Passed. Logged out Successfully from the Application!"
rescue Test::Unit::AssertionFailedError
puts "Failed. Logout is Failed."
end
puts "************** END : Log out from Razoo ****************"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exec_logout\n core_destroySession\n redirect_to lato_core.login_path\n end",
"def logout\n call('User.logout')\n end",
"def logout\n data_for(:logout)\n return nil\n end",
"def logout\n call :get, '/user/logout'\n end",
"def logout\n Http... | [
"0.8128902",
"0.8089089",
"0.80701226",
"0.80700845",
"0.80449235",
"0.8034167",
"0.8034167",
"0.80150187",
"0.7797495",
"0.7787129",
"0.7780412",
"0.77688587",
"0.7768314",
"0.77593917",
"0.7750047",
"0.7725466",
"0.7697246",
"0.7669302",
"0.7653484",
"0.7638857",
"0.7638740... | 0.0 | -1 |
Description: This method will stop the running browser. | def stopBrowser()
$browser.stop
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stopBrowser()\n\t\n\t#@browser.close_current_browser_session()\n\t@browser.stop\n\t\nend",
"def stop\n Net::HTTP.get('localhost', '/selenium-server/driver/?cmd=shutDown', @port_number)\n end",
"def test_05_stop_browser()\n\t\tstopBrowser()\n\tend",
"def test_08_stop_browser()\n\t\tstopBrowser()\n... | [
"0.86980695",
"0.7763584",
"0.7574146",
"0.7573417",
"0.7347251",
"0.7319321",
"0.73184353",
"0.71159786",
"0.70986265",
"0.7096786",
"0.70814794",
"0.7066433",
"0.7045197",
"0.69924164",
"0.6896085",
"0.68106955",
"0.6789849",
"0.67348677",
"0.6733271",
"0.67231816",
"0.6723... | 0.87218153 | 2 |
Update the attribute with the given value. It runs the value through the callbacks, and returns a new value given by the callbacks. | def update(value)
@list.callbacks[:update].inject(value) { |a, e| e.call(self, a) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(new_value)\n self.value = new_value\n end",
"def update_attribute_without_validatons_or_callbacks(name, value)\n set(Hash[name, value])\n end",
"def update!(value:, **)\n @value = value\n self\n end",
"def update_attribute_without_callbacks(name, value)\n se... | [
"0.681915",
"0.67416507",
"0.65920603",
"0.6478875",
"0.64766365",
"0.64766365",
"0.6446111",
"0.6292839",
"0.6278528",
"0.62618107",
"0.6240482",
"0.62294406",
"0.6223525",
"0.6170502",
"0.6158415",
"0.60959876",
"0.60954994",
"0.6082262",
"0.6040785",
"0.60366905",
"0.60151... | 0.7220998 | 0 |
The perform method is in charge of our code execution when enqueued. | def perform(mailer, method, *args)
mailer.send(method, *args).deliver
#ex: LadybooMailer.atm_checkout_completed_successfully(order).deliver
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform\n raise NotImplementedError, 'Implement this in a subclass'\n end",
"def perform\n \n end",
"def perform; end",
"def perform; end",
"def _run\n super.tap { reenqueue }\n end",
"def perform(&block); end",
"def execute\n adapter.enqueue klass, *args\n end",... | [
"0.71829754",
"0.7173839",
"0.7080186",
"0.7080186",
"0.70769703",
"0.7040585",
"0.70270985",
"0.69795537",
"0.6891379",
"0.6850613",
"0.68463117",
"0.68291926",
"0.6788192",
"0.6747695",
"0.6741019",
"0.6697734",
"0.6690095",
"0.6655567",
"0.6651279",
"0.6634857",
"0.6597891... | 0.0 | -1 |
GET /rolepermissions GET /rolepermissions.json | def index
@rolepermissions = Rolepermission.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @permissions = @role.permissions\n end",
"def role_permissions\n return @role_permissions\n end",
"def index\n index_helper\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @role_permissions }\n ... | [
"0.776141",
"0.7388996",
"0.73712146",
"0.7294407",
"0.72378993",
"0.7170811",
"0.71313363",
"0.7129098",
"0.7114254",
"0.70764697",
"0.7024899",
"0.70222193",
"0.7016698",
"0.69931495",
"0.6960503",
"0.6959292",
"0.69212663",
"0.69102365",
"0.68980616",
"0.68210286",
"0.6811... | 0.72128963 | 5 |
GET /rolepermissions/1 GET /rolepermissions/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @permissions = @role.permissions\n end",
"def show\n @lab_permissions_role = LabPermissionsRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_permissions_role }\n end\n end",
"def index\n index_helper\n ... | [
"0.7796933",
"0.73432356",
"0.7336419",
"0.73041457",
"0.73003936",
"0.7261889",
"0.7230403",
"0.7159253",
"0.69946784",
"0.6993243",
"0.6988654",
"0.6951533",
"0.69354874",
"0.6918571",
"0.6915776",
"0.6913594",
"0.6871528",
"0.6868113",
"0.6767447",
"0.67557347",
"0.6717062... | 0.0 | -1 |
POST /rolepermissions POST /rolepermissions.json | def create
@screens = Screen.all
@roles = Role.all
Rolepermission.roleperm(params[:screens])
flash[:success] = 'Les permissions ont bien été misent à jour'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @role = Role.new(role_params) \n @role.permissions = []\n @role.set_permissions(params[:permissions]) if params[:permissions]\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :... | [
"0.7808514",
"0.74420124",
"0.7145067",
"0.7124625",
"0.70726895",
"0.705823",
"0.7006619",
"0.6980538",
"0.69746995",
"0.6828824",
"0.6777971",
"0.673447",
"0.671043",
"0.66561866",
"0.6624418",
"0.6595895",
"0.6546208",
"0.65111905",
"0.6509194",
"0.6498529",
"0.6472278",
... | 0.0 | -1 |
PATCH/PUT /rolepermissions/1 PATCH/PUT /rolepermissions/1.json | def update
respond_to do |format|
if @rolepermission.update(rolepermission_params)
format.html { redirect_to @rolepermission, notice: 'Rolepermission was successfully updated.' }
format.json { render :show, status: :ok, location: @rolepermission }
else
format.html { render :edit }
format.json { render json: @rolepermission.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @role.permissions = []\n @role.set_permissions(params[:permissions]) if params[:permissions]\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, loca... | [
"0.80759764",
"0.79691356",
"0.77559566",
"0.7735055",
"0.73320395",
"0.7207246",
"0.7165097",
"0.70121473",
"0.6977915",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493",
"0.6977493"... | 0.7242306 | 5 |
DELETE /rolepermissions/1 DELETE /rolepermissions/1.json | def destroy
@rolepermission.destroy
respond_to do |format|
format.html { redirect_to rolepermissions_url, notice: 'Rolepermission was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @roles_and_permission = @roles.roles_and_permission.find(params[:id])\n @roles_and_permission.destroy\n\n respond_to do |format|\n format.html { redirect_to roles_and_permissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab_permissions_role = ... | [
"0.7774853",
"0.77041984",
"0.7645368",
"0.7225824",
"0.71359575",
"0.7080364",
"0.7011295",
"0.70079505",
"0.69558483",
"0.6935341",
"0.69301295",
"0.69172096",
"0.6911218",
"0.6896849",
"0.68960303",
"0.68898976",
"0.6889696",
"0.6885698",
"0.6880435",
"0.68641335",
"0.6855... | 0.7601697 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_rolepermission
@rolepermission = Rolepermission.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.61642385",
"0.60448",
"0.5945487",
"0.5915654",
"0.58890367",
"0.58330417",
"0.5776098",
"0.5703048",
"0.5703048",
"0.5654613",
"0.5620029",
"0.5423114",
"0.540998",
"0.540998",
"0.540998",
"0.5393666",
"0.53783023",
"0.53568405",
"0.53391176",
"0.5339061",
"0.53310865",
... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def rolepermission_params
params.fetch(:rolepermission, {})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
creates an new instance of a card | def new
@card = Card.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newCard\n\t@card = Cards.new\n \t@card.random\n end",
"def create_card\n @card = Card.new(content_type_id: 2, content_id: self.id, created_by: self.created_by)\n if !@card.save\n raise ActiveRecord::RecordInvalid.new(self)\n end\n end",
"def create_card\n @card = Card.new(cont... | [
"0.7887435",
"0.7687802",
"0.7568933",
"0.744292",
"0.7434655",
"0.7352899",
"0.7316247",
"0.7192218",
"0.7180247",
"0.7151719",
"0.71108896",
"0.71039003",
"0.709881",
"0.70066404",
"0.69774413",
"0.69631153",
"0.69631153",
"0.69631153",
"0.69631153",
"0.69492227",
"0.694058... | 0.83844984 | 1 |
method for creating a new card | def create
# new instance of a card with parameters of card details
@card = Card.create(card_params)
# current user info gets associated with card?? ASK
# if card is valid based on our criteria (validations)
# then the card will be saved and added to list of all cards
# and user will be redirected to list of all cards
if @card.valid?
@card.save!
redirect_to cards_path
# if card doesn't fit our criteria, then user will get an
# error message
else
render :new
flash[:alert] = "There was an error with your submission"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @card = Card.new(card_params)\n @card[:authorization_id] = Authorization.current_id\n respond_to do |format|\n if @card.save\n format.html { redirect_to @card, notice: 'Card was successfully created.' }\n format.json { render :show, status: :created }\n e... | [
"0.8441513",
"0.8296954",
"0.8283506",
"0.8274311",
"0.8236877",
"0.8205544",
"0.8191525",
"0.8191525",
"0.8191525",
"0.8191525",
"0.81887794",
"0.8183299",
"0.81646544",
"0.81410503",
"0.81247616",
"0.81247616",
"0.80932313",
"0.80408955",
"0.801529",
"0.7970807",
"0.7960828... | 0.7785863 | 27 |
what does this do | def card_params
params.require(:card).permit(:number,
:expiration_month,
:expiration_year)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def schubert; end",
"def formation; end",
"def r; end",
"def r; end",
"def probers=(_arg0); end",
"def operations; end",
"def operations; end",
"def suivre; end",
"def ber... | [
"0.73507357",
"0.6875822",
"0.6576209",
"0.6576209",
"0.6576209",
"0.6576209",
"0.6494534",
"0.6494211",
"0.6390648",
"0.6390648",
"0.61697906",
"0.61600256",
"0.61600256",
"0.61531067",
"0.6152555",
"0.613896",
"0.61125076",
"0.61028326",
"0.6083312",
"0.60825884",
"0.606988... | 0.0 | -1 |
GET /qa_clients GET /qa_clients.json | def index
@qa_clients = QaClient.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @qa_clients }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def show\n @qa_client = QaClient.find(params[:id])\n @qa_activities = @qa_client.qa_activities\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qa_client }\n end\n end",
... | [
"0.73130435",
"0.7279154",
"0.7164125",
"0.7141477",
"0.7010841",
"0.70051223",
"0.70051223",
"0.69777936",
"0.68231714",
"0.681952",
"0.67604166",
"0.6737969",
"0.6723651",
"0.6710572",
"0.6693314",
"0.6679898",
"0.6679898",
"0.6679898",
"0.6679898",
"0.6679898",
"0.6679898"... | 0.7757721 | 0 |
GET /qa_clients/1 GET /qa_clients/1.json | def show
@qa_client = QaClient.find(params[:id])
@qa_activities = @qa_client.qa_activities
respond_to do |format|
format.html # show.html.erb
format.json { render json: @qa_client }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n \n @qa_clients = QaClient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qa_clients }\n end\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def index\n sanitized_params = parse_params... | [
"0.75910175",
"0.6988098",
"0.6974533",
"0.6956233",
"0.6913556",
"0.6913556",
"0.6913556",
"0.6913556",
"0.6913556",
"0.6913556",
"0.6913556",
"0.69129896",
"0.68723625",
"0.68594694",
"0.68535155",
"0.6842453",
"0.6836146",
"0.6774143",
"0.6760383",
"0.6743054",
"0.6692173"... | 0.73811436 | 1 |
GET /qa_clients/new GET /qa_clients/new.json | def new
@qa_client = QaClient.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @qa_client }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n... | [
"0.76808286",
"0.76808286",
"0.76808286",
"0.76808286",
"0.74082726",
"0.7391666",
"0.73609024",
"0.7349965",
"0.73295385",
"0.7255794",
"0.7240947",
"0.7198134",
"0.717272",
"0.7169922",
"0.7120095",
"0.71073854",
"0.70848614",
"0.7047303",
"0.7017105",
"0.6976652",
"0.69766... | 0.7786 | 0 |
POST /qa_clients POST /qa_clients.json | def create
@qa_client = QaClient.new(params[:qa_client])
respond_to do |format|
if @qa_client.save
format.html { redirect_to @qa_client, notice: 'Qa client was successfully created.' }
format.json { render json: @qa_client, status: :created, location: @qa_client }
else
format.html { render action: "new" }
format.json { render json: @qa_client.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @client = current_user.clients.build(client_params)\n\n if @client.save\n render :create, status: :created\n CareeerMailer.trial_end(current_user.email, @client).deliver_later\n CareeerMailer.welcome(current_user.email, @client).deliver_later\n else\n render ... | [
"0.6661772",
"0.6512869",
"0.6408191",
"0.63824844",
"0.6355434",
"0.6341585",
"0.6333531",
"0.6332362",
"0.63131005",
"0.63098216",
"0.63098216",
"0.63098216",
"0.6305785",
"0.6304521",
"0.62968856",
"0.6283523",
"0.62773234",
"0.62773234",
"0.62773234",
"0.62666",
"0.626531... | 0.71829206 | 0 |
PUT /qa_clients/1 PUT /qa_clients/1.json | def update
@qa_client = QaClient.find(params[:id])
respond_to do |format|
if @qa_client.update_attributes(params[:qa_client])
format.html { redirect_to @qa_client, notice: 'Qa client was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @qa_client.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @client.update(client_params)\n render json: @client\n end",
"def update\n client=Client.find_by_id params[:id]\n if client!= nil\n client.cedula=params[:cedula] ? params[:cedula]: client.cedula\n client.sector=params[:sector] ? params[:sector]: client.sector\n client.nom... | [
"0.6936792",
"0.6508922",
"0.63844234",
"0.6360124",
"0.6331521",
"0.62583375",
"0.62450683",
"0.62450683",
"0.6244772",
"0.6244772",
"0.6238513",
"0.623569",
"0.6226394",
"0.6208544",
"0.6207895",
"0.6204055",
"0.6202968",
"0.61923707",
"0.6150855",
"0.614618",
"0.6145001",
... | 0.728287 | 0 |
DELETE /qa_clients/1 DELETE /qa_clients/1.json | def destroy
@qa_client = QaClient.find(params[:id])
@qa_client.destroy
respond_to do |format|
format.html { redirect_to qa_clients_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n... | [
"0.72737885",
"0.7242045",
"0.7239342",
"0.71923125",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7189413",
"0.7188678",
"0.7188678",
"0.714276",
"0.7123334",
"0.71207494",
"0.70791984",
"0.70729065",
"0.7057669",... | 0.7807439 | 0 |
code your input_to_index and move method here! | def input_to_index(input)
input = input.to_i
input = input - 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_to_index(move_index)\r\n move_index = move_index.to_i - 1\r\n move_index\r\n end",
"def input_to_index(move)\r\n index = move.to_i - 1\r\nend",
"def input_to_index(move)\n move = move.to_i - 1\nend",
"def input_to_index(move)\n move.to_i - 1\n end",
"def input_to_index(nextmove)\n ... | [
"0.7908671",
"0.7829489",
"0.77252024",
"0.755641",
"0.74487364",
"0.7104359",
"0.70859915",
"0.68077767",
"0.68064576",
"0.6802601",
"0.67759883",
"0.675182",
"0.66928726",
"0.6678514",
"0.6662877",
"0.66247594",
"0.6575357",
"0.65610653",
"0.65356266",
"0.65240985",
"0.6511... | 0.6326722 | 53 |
Renders the static about page | def about
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about\n # Static Page\n end",
"def about; render; end",
"def about\r\n end",
"def about\n\n end",
"def about\n\n \tend",
"def about\n end",
"def about\n\tend",
"def about\n\tend",
"def about_us\n render(:about_us, layout:false) and return\n end",
"def about\n \n end",
"def ... | [
"0.82698613",
"0.8252892",
"0.7568405",
"0.7481016",
"0.7457958",
"0.7449853",
"0.74143153",
"0.74143153",
"0.7374476",
"0.7354728",
"0.7315758",
"0.7315758",
"0.7315758",
"0.726819",
"0.72653437",
"0.7145223",
"0.71425223",
"0.70594627",
"0.7041138",
"0.7041138",
"0.6944841"... | 0.73178166 | 26 |
Renders the sitemap.xml for search engines | def sitemap
@voices = Voice.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sitemap\n @pages = Page.sitemap\n respond_to do |format|\n format.xml { render layout: \"alchemy/sitemap\" }\n end\n end",
"def sitemap\n @pages = Page.sitemap\n respond_to do |format|\n format.xml { render layout: 'alchemy/sitemap' }\n end\n end",
"def sit... | [
"0.7373059",
"0.73636454",
"0.7352997",
"0.7113424",
"0.7068706",
"0.7008817",
"0.70027643",
"0.69251466",
"0.68127614",
"0.6783935",
"0.6574239",
"0.64999145",
"0.6448175",
"0.6372043",
"0.6370268",
"0.62722456",
"0.6195026",
"0.6170937",
"0.6170937",
"0.61707443",
"0.615505... | 0.5152464 | 73 |
To display the current state of the board | def display_board(board = [" "," "," "," "," "," "," "," "," "])
puts " #{board[0]} | #{board[1]} | #{board[2]} "
puts "-----------"
puts " #{board[3]} | #{board[4]} | #{board[5]} "
puts "-----------"
puts " #{board[6]} | #{board[7]} | #{board[8]} "
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state\n board.state(index)\n end",
"def display\n puts \"===Current Board Status===\"\n @bingo_board.each { |row| puts print row }\n end",
"def display_board\n board =\n \" _______ _______ _______\n | | | |\n A| #{@state[:A1]} | #{@state[:A2]} ... | [
"0.7694199",
"0.7609994",
"0.75940543",
"0.7558306",
"0.74808884",
"0.7395321",
"0.7366915",
"0.7319327",
"0.72892445",
"0.7259157",
"0.7105098",
"0.7100659",
"0.70253325",
"0.70227134",
"0.70226026",
"0.70025605",
"0.698262",
"0.69774956",
"0.6974034",
"0.6969821",
"0.694978... | 0.0 | -1 |
Convert the user's input into an acceptable index for board[] | def input_to_index(input)
input.to_i - 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_to_index(user_input)\n #take the user's input (\"1\"-\"9\") and convert it to the index of the board array (0-8)\n user_input.to_i - 1\nend",
"def input_to_index(user_input) #this method converts the user_input into the 0-8 index, AKA the position on the board\n user_input = user_input.to_i # assi... | [
"0.80693644",
"0.7434726",
"0.73577714",
"0.73369104",
"0.7154359",
"0.71040684",
"0.7030658",
"0.70119405",
"0.6842494",
"0.68107545",
"0.6801036",
"0.6801036",
"0.6779474",
"0.675316",
"0.67335373",
"0.6728886",
"0.67264134",
"0.6709931",
"0.6702989",
"0.6691112",
"0.666503... | 0.0 | -1 |
Update the board to reflect the user's move | def move(board, index, char = "X")
board[index] = char
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(board)\n current_captures(board)\n current_moves(board)\n end",
"def turn\n current_move = current_player.move(@board)\n current_token = current_player.token\n if self.board.valid_move?(current_move)\n self.board.update(current_move, current_player)\n ... | [
"0.7649676",
"0.74774367",
"0.74300325",
"0.7385206",
"0.7358081",
"0.7356524",
"0.7349679",
"0.7334587",
"0.72747254",
"0.7240604",
"0.7226404",
"0.72262764",
"0.72189677",
"0.7087171",
"0.7027532",
"0.7006092",
"0.698102",
"0.6935781",
"0.69110715",
"0.6848634",
"0.68437934... | 0.0 | -1 |
Check if a position is already taken | def position_taken?(board, index)
if board[index] == " " || board[index] == "" || board[index] == nil
return false
elsif board[index] == "X" || board[index] == "O"
return true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position_taken?(board, pos)\n if board[pos]==\"X\" || board[pos]==\"O\"\n taken = true\n else\n taken = false\n end\n taken\nend",
"def position_taken?(index)\n @board[index] == \"X\" || @board[index] == \"O\"\n end",
"def position_taken?(board, position)\n\tif board[position] == \"X\" || boa... | [
"0.7694706",
"0.76927304",
"0.76926994",
"0.762874",
"0.7623216",
"0.75829554",
"0.75803393",
"0.7560014",
"0.75563157",
"0.75254947",
"0.75216657",
"0.7511119",
"0.75110084",
"0.7499579",
"0.749008",
"0.74861884",
"0.7484409",
"0.7480514",
"0.7475596",
"0.74742275",
"0.74716... | 0.0 | -1 |
Validate the user's chosen move | def valid_move?(board, index)
if !position_taken?(board, index) && index.between?(0, 8)
return true
else
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_move?\n\t\tvalid_1 = (0..2).include? (@take_from)\n\t\tvalid_2 = (0..2).include? (@move_to)\n\t\tif valid_1 == false || valid_2 == false\n\t\t\tputs \"I'm sorry, please input your move in a 'x,y' format, ensuring that you are selecting numbers between 1 and 3!\"\n\t\t\tmove_input\n\t\telsif @pegs[@take_f... | [
"0.825734",
"0.80440867",
"0.78996176",
"0.7803614",
"0.76373905",
"0.7629277",
"0.7474837",
"0.74618584",
"0.7458295",
"0.7443473",
"0.7438692",
"0.73945117",
"0.73796517",
"0.7335079",
"0.73344254",
"0.7333574",
"0.7306322",
"0.72937554",
"0.7290375",
"0.7275858",
"0.726165... | 0.0 | -1 |
Defined search method that takes array (arr) and integer to find (x). Set index to zero. Set default variable to nil. Call .each method on array; set while loop to run as long as the index of array is equal to the search integer, then the integer assigned to index gets returned. Set index to count up by 1 each loop. If iteration conditions are not met, nil gets returned. | def search_array(arr, x)
index = 0
default = nil
arr.each do if x == arr[index]
return index
# default = index
end
index += 1
end
return default
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(arr, x)\n (0..arr.count).each do |i|\n return i if arr[i] == x\n end\n -1\nend",
"def search_array(arr, x)\n index_count = 0\n index_result = 0\n until index_count == arr.length\n if arr[index_count] == x\n index_result = index_count\n end\n index_count += 1\n end\n search_arr... | [
"0.8277561",
"0.813161",
"0.79116553",
"0.7820477",
"0.77544343",
"0.7739782",
"0.7724648",
"0.7710232",
"0.77079153",
"0.7693654",
"0.76843214",
"0.7632061",
"0.7626642",
"0.76200163",
"0.76157826",
"0.7602046",
"0.7571652",
"0.7544245",
"0.7534612",
"0.7521812",
"0.75200343... | 0.8186463 | 1 |
=begin Each new integer in the Fibonacci sequence is generated by adding the previous two integers. By starting with 0 and 1, the first 10 terms will be: 0, 1, 2, 3, 5, 8, 13, 21, 34, 55. Method call 'fib(10)' should return 55; '8' returns 21; '12' should return 144. =end Release 1: Calculate Fibonacci Numbers Defined method taking argument of number The number gets returned if present in range between 0 and 1, as include evaluates to true. If false, fib adds the numbers previous by 1 and 2. Close method Test by calling method with argument | def fib(n)
arr = [0, 1]
fibonacci = ->(arr) {
if arr.size == n
arr
else
current_number, last_number = arr.last(2)
fibonacci.(arr + [current_number + last_number])
end
}
fibonacci.(arr)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fib(number)\n if number == 0\n 0\n elsif number == 1\n 1\n else\n test= fib(number-1) + fib(number-2)\n puts \"adding number #{number-1} and #{number-2} = #{test}\"\n test\n end\nend",
"def fibs(n)\nend",
"def fib(n)\n \nend",
"def fib(n)\n\nend",
"def fibonacci(num)\n # Enter co... | [
"0.808084",
"0.8019722",
"0.794028",
"0.7934445",
"0.7873356",
"0.7825265",
"0.7825265",
"0.7814438",
"0.7782192",
"0.7782192",
"0.7782192",
"0.7782192",
"0.7782192",
"0.77815175",
"0.7768559",
"0.7751911",
"0.7719545",
"0.77110964",
"0.7701014",
"0.7598489",
"0.7588744",
"... | 0.0 | -1 |
Driver Code: How to Test Loooooong number: 218922995834555169026 Add negative index to end of call Release 2: Sort an Array Bubble Sort =begin 'n' represents total number of values in array. Loop will iterate through entire array & check value for each element and compare them. Then it will switch integers if previous integer is greater than next. 'Swapped' checks if item is false. For (n1) you want iterate through one time fewer than the total sum of the array. 'i' represents iterator variable within block parameters in this case the index. Simple conditional: if that array element is greater than the next element, then the elements switch places. In that case, swapped is true. 'break if not swapped' is syntactic sugar. Then, return array. Created array, called bubble_sort method with 'a' as argument; printed to irb. =end | def bubble_sort(array)
n = array.length
loop do
swapped = false
(n-1).times do |i|
if array[i] > array[i+1]
array[i], array[i+1] = array[i+1], array[i]
swapped = true
end
end
break if not swapped
end
array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bubble_sort(arr)\n n = arr.length\n #ln 7, array length is my set of four numbers\n\n loop do\n #[2, 42, 22, 02]\n #[42, 2, 22, 02]\n #[42, 22, 2, 02]\n #[42, 22, 02, 2]\n\n swapped = false\n\n (n-1).times do |i|\n if arr[i] > arr [i + 1]\n arr [i], arr[i +1] = arr [i +1], ... | [
"0.8623019",
"0.8499803",
"0.8494116",
"0.84378994",
"0.83709544",
"0.83667535",
"0.8362318",
"0.83520687",
"0.83491105",
"0.8272202",
"0.8241025",
"0.82305706",
"0.8227145",
"0.8220897",
"0.8219314",
"0.8212116",
"0.8211086",
"0.82107204",
"0.82088083",
"0.82058656",
"0.8202... | 0.81395656 | 36 |
How many circular primes are there below one million? See if a number is prime | def prime?(number)
if number <= 1
return false
end
(2..Math.sqrt(number)).each do |n|
if number%n == 0
return false
end
end
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circular_primes(max)\n idx = 2 #numbers lower than 2 aren't prime\n circ_primes = []\n\n while idx<max\n if only_odd_digits?(idx) #Check to see if all digits in number are odd\n if is_circular_prime?(idx)\n circ_primes << idx\n end\n end\n\n if idx%2==0 #Only check odd number... | [
"0.7741786",
"0.7715734",
"0.7526283",
"0.7446089",
"0.74272585",
"0.7424226",
"0.739791",
"0.73855996",
"0.7333882",
"0.730511",
"0.7291012",
"0.72554505",
"0.7252765",
"0.72358996",
"0.7233974",
"0.72314763",
"0.7226679",
"0.7221863",
"0.72137487",
"0.72078794",
"0.72034454... | 0.0 | -1 |
Get circular rotations of the number, excluding the number | def circular_rotations(number)
rotations = []
if number.to_s.size == 1
return rotations
end
digits = number.to_s.split("").map { |x| x.to_i }
(number.to_s.size-1).times {
digits << digits.shift
rotations << digits.to_s.to_i
}
return rotations
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circular_prime?(number)\n if number.to_s.size == 1\n return true\n end\n rotations = circular_rotations(number)\n rotations.each do |r|\n if !prime?(r)\n return false\n end\n end\n return true\nend",
"def circ_array(pNum_elem=nil, pDegree_between=nil)\r\n # - - - - - - - - - - - - - - - ... | [
"0.6304201",
"0.61518705",
"0.6092036",
"0.608904",
"0.6080418",
"0.6073862",
"0.5979502",
"0.5947174",
"0.5926375",
"0.59192514",
"0.5903394",
"0.5831688",
"0.58127165",
"0.5806141",
"0.5797188",
"0.578812",
"0.57567716",
"0.5756098",
"0.57300484",
"0.5696202",
"0.5694921",
... | 0.80306995 | 0 |
=begin Check to see if a number is a circular prime Function assumes that the number is already a prime and checks to see if the number's rotations are prime Returns false when it finds the first nonprime rotation =end | def circular_prime?(number)
if number.to_s.size == 1
return true
end
rotations = circular_rotations(number)
rotations.each do |r|
if !prime?(r)
return false
end
end
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_circular_prime?(number)\n rotation = number.to_s.split(//).map! {|i| i.to_i}\n\n (rotation.length).times do\n rotation.push(rotation.shift)\n number = rotation.join().to_i\n\n if !is_prime?(number)\n return false\n end\n end\n\n if number == 9\n return false\n end\n\n return true\n... | [
"0.87575775",
"0.7883184",
"0.7764716",
"0.7722418",
"0.76924217",
"0.7683571",
"0.76831895",
"0.7673172",
"0.7672294",
"0.7656592",
"0.76389724",
"0.76294935",
"0.76294935",
"0.76294935",
"0.7613462",
"0.7613199",
"0.76105034",
"0.7601874",
"0.7601874",
"0.75908184",
"0.7584... | 0.8852047 | 0 |
Return the :name property. | def name
self[ :name ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n @attributes[:name]\n end",
"def get_name\n @name\n end",
"def name\n @attributes[:name]\n end",
"def name\n @attributes[:name]\n end",
"def name\n @attributes[:name]\n end",
"def name\n @attributes[:name]\n end",
"def get_name\n return... | [
"0.862412",
"0.86055666",
"0.8535663",
"0.8535663",
"0.8535663",
"0.8535663",
"0.85255665",
"0.84917647",
"0.8419677",
"0.8419677",
"0.8408644",
"0.83957964",
"0.83913916",
"0.83874375",
"0.8381369",
"0.8381369",
"0.8381369",
"0.8381369",
"0.8380691",
"0.83801657",
"0.837835"... | 0.8338542 | 51 |
Return the property by (Symbol) key | def []( key )
@props[ key ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def [](key)\n get_property(key)\n end",
"def get_property(key)\n @data[key]\n end",
"def get_property(key)\n self.fetch key\n end",
"def [](key)\n @props[key]\n end",
"def [](key)\n @properties[key]\n end",
"def [](key)\n @properties[key]\n end",
"def [](key)... | [
"0.78596246",
"0.7824522",
"0.7761606",
"0.7741057",
"0.761277",
"0.761277",
"0.761277",
"0.75971985",
"0.7523521",
"0.7500335",
"0.7212792",
"0.7161142",
"0.714022",
"0.71360743",
"0.71286356",
"0.7104585",
"0.70431596",
"0.7028377",
"0.69759893",
"0.69619745",
"0.69619745",... | 0.7679334 | 4 |
Set property by (Symbol) key to value. Note that the :roles property key is supported here, but is effectively the same as add( val ). Roles are only added, never removed. | def []=( key, val )
key = key.to_sym
if key == :roles
add( *val )
else
@props[ key.to_sym ] = val
end
val
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_roles=(value)\n roles[:user_roles]=value\n end",
"def set_property(key, value)\n end",
"def set_ant_property(key, value)\n instance_eval(\"@%s = '%s'\" % [ key.to_s, value.to_s ])\n end",
"def set_role(role_name, value)\n if value == \"1\"\n for role in self.roles\n if ... | [
"0.6402344",
"0.63900346",
"0.607519",
"0.6071271",
"0.6023202",
"0.6023202",
"0.60180455",
"0.5975321",
"0.5914082",
"0.591378",
"0.5907697",
"0.58403236",
"0.5838914",
"0.5838914",
"0.5829356",
"0.5829356",
"0.5802249",
"0.5791714",
"0.5777406",
"0.5769523",
"0.57583624",
... | 0.86363167 | 0 |
Merge properties. Note that the :roles property key is supported here, but is affectively the same as add( val ). | def merge_props( opts )
opts.each do |key,val|
self[ key ] = val
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge(properties)\n properties.each do |name, value|\n self[name] = value\n end\n end",
"def merge_properties!(props = {})\n @hash[:properties].deep_merge!(props)\n end",
"def properties(keyvals = {})\n self.merge!(keyvals)\n end",
"def []=( key, val )\n k... | [
"0.67361635",
"0.6308034",
"0.61377877",
"0.60780615",
"0.6045628",
"0.59311265",
"0.5852364",
"0.5723417",
"0.57003134",
"0.56875825",
"0.55598813",
"0.55044943",
"0.5467344",
"0.5452042",
"0.5445204",
"0.5435004",
"0.54154205",
"0.53501344",
"0.53501344",
"0.5326395",
"0.52... | 0.6009801 | 5 |
Add any number of roles (by Symbol) or (direct) Component instances. | def add( *args )
args.each do |arg|
case( arg )
when Symbol
@contents << arg unless @contents.include?( arg )
when Component
@contents << arg
else
raise "Invalid host #{name} addition: #{arg.inspect}"
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_roles(roles)\n if !roles.is_a? Array\n roles = [roles]\n end\n rs = (self.role_symbols + roles.map {|x| x.to_s}).uniq\n self.role_symbols = rs\n end",
"def role( symbol, *args )\n if args.empty?\n @roles[ symbol.to_sym ]\n else\n @roles[ symbol.to_sym ] += args.f... | [
"0.66642886",
"0.65937936",
"0.62518185",
"0.6200016",
"0.61377704",
"0.6117509",
"0.6000751",
"0.59276575",
"0.5869141",
"0.5807916",
"0.5770606",
"0.5712365",
"0.570889",
"0.5680989",
"0.56579155",
"0.565512",
"0.5649112",
"0.5571496",
"0.5541028",
"0.5527483",
"0.5516511",... | 0.5181586 | 56 |
Return an Array of previously added role symbols. | def roles
@contents.select { |c| c.is_a?( Symbol ) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role_symbols\n @role_symbols ||= (roles || []).map {|r| r.to_sym}\n end",
"def role_symbols\r\n (roles || []).map {|r| r.title.to_sym}\r\n end",
"def role_symbols\n (roles || []).map { |r| r.title.to_sym }\n end",
"def role_symbols\n (roles || []).map { |r| r.title.to_sym }\n end",
"def... | [
"0.79858214",
"0.7809179",
"0.77336097",
"0.77336097",
"0.7715163",
"0.7691432",
"0.764167",
"0.74536544",
"0.7333053",
"0.7325011",
"0.6989322",
"0.6942595",
"0.6926078",
"0.69240403",
"0.6607521",
"0.6466421",
"0.6460605",
"0.6447921",
"0.64240474",
"0.64240474",
"0.6289664... | 0.6747854 | 14 |
Return a flat Array of Component instances by traversing previously added roles and any direct components in order. | def components
@contents.inject([]) do |m,c|
if c.is_a?( Symbol )
m += space.role( c )
else
m << c
end
m
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def components\n result = []\n\n @children.each do |_key, child_group|\n child_group.each do |child|\n result << child if child.is_a?(Component)\n end\n end\n\n result\n end",
"def all_roles\n result = Array.new\n \n# for role in self.roles\n# ... | [
"0.6713714",
"0.5945033",
"0.5937931",
"0.5783247",
"0.57402384",
"0.5724117",
"0.5724117",
"0.568516",
"0.5632652",
"0.55893344",
"0.5586512",
"0.5441057",
"0.54346806",
"0.5413865",
"0.5396935",
"0.5277825",
"0.52570033",
"0.52270865",
"0.5208358",
"0.5204728",
"0.52046746"... | 0.56758267 | 8 |
Returns components instances under the specified roles for this host | def components_in_roles( qroles )
( qroles & roles ).inject([]) { |m,r| m += space.role( r ) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instances_by_role(*roles)\n roles = roles.flatten.map(&:to_s)\n instances.select { |inst| roles.include?(inst.role.to_s) }\n end",
"def get_instances(role: nil, username: nil, bastion: nil)\n puts \"Getting instances for role: #{role}\"\n servers = []\n instances_for_role(ro... | [
"0.706946",
"0.6296566",
"0.62565374",
"0.61827123",
"0.59423256",
"0.5909614",
"0.5848396",
"0.58273876",
"0.57960784",
"0.55723923",
"0.55650353",
"0.55502754",
"0.55310136",
"0.54515845",
"0.5441019",
"0.5333872",
"0.53251845",
"0.5268159",
"0.52664596",
"0.5262994",
"0.52... | 0.5772088 | 9 |
Return the last component added to this Host prior to the given component (either directly or via a role), or nil if there is no such component. | def prior_component( component )
last = nil
@contents.each do |c|
if c.is_a?( Symbol )
space.role( c ).each do |rc|
return last if rc.equal?( component ) #identity
last = rc
end
else
return last if c.equal?( component ) #identity
last = c
end
end
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def previous_item(column=nil)\n column = column || default_orderable_column\n orderable_scoped(column).where(orderable_column(column) => send(column) - 1).first\n end",
"def prev_element_of(node)\n\t\treturn valid(node) ? node.previous_element : nil\n\tend",
"def previous_node\n retur... | [
"0.5276243",
"0.525168",
"0.52386117",
"0.51704085",
"0.5130504",
"0.51133263",
"0.50909907",
"0.5023149",
"0.49989942",
"0.49859652",
"0.49324808",
"0.48974293",
"0.48830366",
"0.4869631",
"0.48596475",
"0.4828155",
"0.48242223",
"0.4822581",
"0.4820457",
"0.4816126",
"0.480... | 0.731495 | 0 |
Return the _last_ component which is a kind of the specified Class or Module clz, or nil if not found. | def component( clz )
components.reverse.find { |c| c.kind_of?( clz ) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_tab_class(klass, tab_classes)\n tab_classes.last == klass ? 'last' : ''\n end",
"def clazz\n Module.const_get(name)\n rescue NameError\n nil\n end",
"def current_component\n\t\t\tcomponents.last\n\t\tend",
"def get_class(class_name)\n Module.const_get(class_name)\n rescue... | [
"0.62224144",
"0.5924551",
"0.5859473",
"0.58182114",
"0.5800323",
"0.57709473",
"0.57342374",
"0.57230604",
"0.57056236",
"0.56863457",
"0.5547432",
"0.55140924",
"0.55140924",
"0.5512453",
"0.5467887",
"0.54652387",
"0.54553294",
"0.54553294",
"0.54538745",
"0.54019225",
"0... | 0.71396863 | 0 |
P R I V A T E | def exists_ip_in_unique_net?(object, parent)
puts "\\\\ 1. IP IN UNIQUE_NET ?? \\\\"
temp = Ipnet.find(:first, :conditions => ["parent_id = ? and unq = ?", parent, true])
if not temp.nil?
puts "ipnet.rb: Validierung fehlgeschlagen (Unique IP für das Netz bereits vergeben)"
errors.add(:ipaddr, "ist für das Netz bereits vergeben.") and puts "ipnet.rb: Validierung fehlgeschlagen"
else
return true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def suivre; end",
"def terpene; end",
"def schubert; end",
"def who_we_are\r\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def r; end",
"def r; end",
"def executor; end",
"def executor; end",
"def executor; ... | [
"0.7013582",
"0.6880758",
"0.67470044",
"0.6505686",
"0.6406804",
"0.6372331",
"0.63016474",
"0.63016474",
"0.63016474",
"0.63016474",
"0.6296903",
"0.6296903",
"0.62940687",
"0.62940687",
"0.62940687",
"0.62737346",
"0.6245376",
"0.6245376",
"0.61912525",
"0.6173413",
"0.617... | 0.0 | -1 |
stuff to write into the page | def jsonProperties
allItems = {
:labelStates => @labelStates,
:initialState => @initialState,
:size => @size,
}
allItems.merge!( { :bindings => @bindings } ) unless @bindings.nil?
allItems.merge!( { :javascriptActions => @javascriptActions } ) unless @javascriptActions.nil?
return allItems
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def writePage\n $cgi.out{$page}\nend",
"def writePage\n $cgi.out{$page}\nend",
"def XOsavePage()\n\t\tbegin\n\n\t\t\tfileName= $gcfd.logPath+@wwBrws.url.tr(\" =%?*/\\\\:\",'_')+Time.now.to_i.to_s+'.html'\n\t\t\tFile.open(fileName, 'w') do |file|\n\t\t\t\tfile.write(@wwBrws.html)\n\t\t\tend\n\t\t\t$alog.lwrit... | [
"0.68924594",
"0.68924594",
"0.6418037",
"0.63580537",
"0.635556",
"0.6333526",
"0.6333526",
"0.6305235",
"0.62701523",
"0.62659866",
"0.6236113",
"0.6229305",
"0.6159932",
"0.61445946",
"0.6138958",
"0.6117122",
"0.6107182",
"0.6105604",
"0.6104721",
"0.6104721",
"0.6050007"... | 0.0 | -1 |
GET /trainings GET /trainings.json | def index
@trainings = Training.order(:datetime)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trainings\n render json: @plan.trainings\n end",
"def show\n @training = trainings.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training }\n end\n end",
"def all\n url = url_for(\"organizers\", credentials.... | [
"0.79527164",
"0.7483754",
"0.7443308",
"0.7246551",
"0.7246551",
"0.7246551",
"0.6909961",
"0.683408",
"0.6791949",
"0.67264205",
"0.6718133",
"0.6682787",
"0.65627974",
"0.65575814",
"0.65575814",
"0.65575814",
"0.6535238",
"0.65161145",
"0.644478",
"0.63918084",
"0.6314592... | 0.57484007 | 75 |
GET /trainings/1 GET /trainings/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @training = trainings.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training }\n end\n end",
"def trainings\n render json: @plan.trainings\n end",
"def index\n @trainings = Training.all\n end",
"def inde... | [
"0.76275057",
"0.74484915",
"0.711328",
"0.711328",
"0.711328",
"0.69039685",
"0.68307686",
"0.68068457",
"0.6799327",
"0.67097276",
"0.65183014",
"0.65183014",
"0.65183014",
"0.650598",
"0.6488535",
"0.64826035",
"0.6470133",
"0.6448665",
"0.6407615",
"0.6387376",
"0.636871"... | 0.0 | -1 |
POST /trainings POST /trainings.json | def create
@training = Training.new(training_params)
respond_to do |format|
if @training.save
format.html { redirect_to team_training_path(@team, @training), notice: 'Training was successfully created.' }
format.json { render :show, status: :created, location: @training }
else
format.html { render :new }
format.json { render json: @training.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trainings\n render json: @plan.trainings\n end",
"def create\n @training = Training.new(params[:training])\n\n respond_to do |format|\n if @training.save\n format.html { redirect_to @training, notice: 'Training was successfully created.' }\n format.json { render json: @tr... | [
"0.6850966",
"0.6690802",
"0.66812235",
"0.66684455",
"0.66571224",
"0.66571224",
"0.66571224",
"0.66098136",
"0.66012704",
"0.6587163",
"0.6579643",
"0.649504",
"0.64638346",
"0.63992864",
"0.6392737",
"0.6377953",
"0.6356972",
"0.625761",
"0.62222886",
"0.62222886",
"0.6222... | 0.6571401 | 11 |
PATCH/PUT /trainings/1 PATCH/PUT /trainings/1.json | def update
respond_to do |format|
if @training.update(training_params)
format.html { redirect_to team_training_path(@team, @training), notice: 'Training was successfully updated.' }
format.json { render :show, status: :ok, location: @training }
else
format.html { render :edit }
format.json { render json: @training.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @training = trainings.find(params[:id])\n\n respond_to do |format|\n if @training.update_attributes(params[training_param])\n format.html { redirect_to @training, notice: 'Training was successfully updated.' }\n format.json { head :no_content }\n else\n format.html... | [
"0.7024611",
"0.6820773",
"0.6675676",
"0.6532034",
"0.6532034",
"0.6532034",
"0.6532034",
"0.65217733",
"0.63714284",
"0.63187927",
"0.62972254",
"0.62463206",
"0.6236065",
"0.6214786",
"0.6208438",
"0.61399305",
"0.61281955",
"0.61048526",
"0.60960025",
"0.6081674",
"0.6035... | 0.6511146 | 8 |
DELETE /trainings/1 DELETE /trainings/1.json | def destroy
@training.destroy
respond_to do |format|
format.html { redirect_to team_trainings_url, notice: 'Training was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @train.destroy\n respond_to do |format|\n format.html { redirect_to trains_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @training = Training.find(params[:id])\n @training.destroy\n\n respond_to do |format|\n format.html { redirect_to traini... | [
"0.76598513",
"0.7607483",
"0.74018264",
"0.7373008",
"0.7308702",
"0.7272417",
"0.7272417",
"0.7272417",
"0.7272417",
"0.7266625",
"0.7169356",
"0.71485275",
"0.7114208",
"0.71113753",
"0.7097897",
"0.70898837",
"0.7075413",
"0.6981671",
"0.69329196",
"0.69294894",
"0.692948... | 0.7119695 | 12 |
Use callbacks to share common setup or constraints between actions. | def set_training
@training = Training.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 list of trusted parameters through. | def training_params
params.require(:training).permit(:team_id, :scheduled_at, :location)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\... | [
"0.69497335",
"0.6812623",
"0.6803639",
"0.6795365",
"0.67448795",
"0.67399913",
"0.6526815",
"0.6518771",
"0.64931697",
"0.6430388",
"0.6430388",
"0.6430388",
"0.63983387",
"0.6356042",
"0.63535863",
"0.63464934",
"0.63444513",
"0.6337208",
"0.6326454",
"0.6326454",
"0.63264... | 0.0 | -1 |
Validamos se a conta possuia pai e passou a nao ter. Isso nao deve ser permitido pois podem existir transacoes que sao especificas de filial assiciadas a conta, o que geraria insonsistencia. | def pai_modificado
if (self.changed.include? 'pai_id') & (self.pai == nil)
self.errors.add(:pai, "Não é possível tornar Matriz uma conta Filial")
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_cuit\n errors[:base] << \"El CUIT no es válido\" if not validar_cuit(self.cuit)\n end",
"def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ... | [
"0.5879104",
"0.5802664",
"0.5786312",
"0.5746009",
"0.5697765",
"0.5696202",
"0.56941664",
"0.5678233",
"0.56559545",
"0.562866",
"0.5625626",
"0.5534527",
"0.55341035",
"0.5513285",
"0.5489281",
"0.5476629",
"0.5475823",
"0.5474034",
"0.5471142",
"0.5470169",
"0.5464956",
... | 0.0 | -1 |
GET /posts GET /posts.json | def index
@visit = params[:visit]
@year = params[:year].present? ? params[:year] : ''
if params[:section_id].present?
@section = Section.joins(:category).where('sections.id = ? and categories.link = ?', params[:section_id], 'posts').first()
@posts = @section.posts.where("to_char(posts.posted_at, 'YYYY-MM-DD') LIKE '%#{@year}%'").order('posts.posted_at DESC')
if @visit
@posts.sort! { |a, b| b.impressionist_count <=> a.impressionist_count }
end
else
@section = Section.joins(:category).where('categories.link = ?', 'posts').order('sections.created_at ASC').first()
@posts = @section.posts.order('posts.posted_at DESC')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def index\n @posts = Post.all\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n ... | [
"0.7865315",
"0.7494904",
"0.7494433",
"0.7494433",
"0.7488696",
"0.74314564",
"0.728645",
"0.728645",
"0.728645",
"0.72562826",
"0.72522277",
"0.7247287",
"0.7246305",
"0.72221965",
"0.72042215",
"0.72039723",
"0.7169929",
"0.71689725",
"0.71644753",
"0.7121855",
"0.71152896... | 0.0 | -1 |
GET /posts/1 GET /posts/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def show\n render json: Post.find(params[\"id\"])\n end",
"def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end",
"def show\n @post = Post.find(params[:id])\n\n render json: @post\n end",
... | [
"0.77110183",
"0.73537844",
"0.73433185",
"0.73379177",
"0.73228735",
"0.7293139",
"0.7275997",
"0.7256934",
"0.7161576",
"0.7158913",
"0.71552676",
"0.71552676",
"0.7119547",
"0.7094749",
"0.7094749",
"0.7094749",
"0.70943594",
"0.7071599",
"0.70607626",
"0.70452625",
"0.703... | 0.0 | -1 |
POST /posts POST /posts.json | def create
@post = Post.new(post_params)
respond_to do |format|
if @post.save
@publication = Publication.create(:content => @post.title + @post.introduction + @post.description + @post.tag_list.join(' '), :published_id => @post.id, :published_type => 'Post')
format.html { redirect_to '/admin/posts', notice: 'Post was successfully created.' }
format.json { render action: 'list', status: :created, location: @post }
else
format.html { render action: 'new' }
format.json { render json: @post.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n render json: Post.create(params[\"post\"])\n end",
"def create\n respond_with Post.create(params[:posts])\n end",
"def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end",
"def create\n @post = Post.new(post_params)\n @po... | [
"0.74463975",
"0.73221767",
"0.73072433",
"0.7123966",
"0.7015686",
"0.701327",
"0.69841874",
"0.6939327",
"0.69313824",
"0.69053805",
"0.68196476",
"0.6812792",
"0.6793222",
"0.6792862",
"0.6779654",
"0.6779654",
"0.67625546",
"0.67602354",
"0.67515427",
"0.6735786",
"0.6698... | 0.0 | -1 |
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json | def update
respond_to do |format|
if @post.update(post_params)
@publication = Publication.find_by_published_id_and_published_type(@post.id, 'Post')
@publication.update(:content => @post.title + @post.introduction + @post.description + @post.tag_list.join(' '))
format.html { redirect_to '/admin/posts', notice: 'Post was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'list' }
format.json { render json: @post.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"def update\n respond_with Post.update(params[:id], params[:posts])\n end",
"def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n forma... | [
"0.7185994",
"0.70406336",
"0.67729545",
"0.6765654",
"0.66686016",
"0.6647406",
"0.6577934",
"0.65551394",
"0.6550076",
"0.6549546",
"0.6534091",
"0.6529909",
"0.6498768",
"0.6496488",
"0.6466881",
"0.6429923",
"0.6427244",
"0.64262676",
"0.64255387",
"0.64184135",
"0.641780... | 0.0 | -1 |
DELETE /posts/1 DELETE /posts/1.json | def destroy
@post.destroy
respond_to do |format|
format.html { redirect_to '/admin/posts' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: param... | [
"0.8046884",
"0.76902676",
"0.7583626",
"0.75803024",
"0.7568048",
"0.75047046",
"0.75031126",
"0.74750155",
"0.74671036",
"0.74650854",
"0.746482",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"... | 0.73095584 | 74 |
Use callbacks to share common setup or constraints between actions. | def set_post
@post = Post.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def post_params
params.require(:post).permit(:title, :introduction, :description, :active, :image, :tag_list, :posted_at, :section_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.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
returns an array with the array elements multiplied by two. | def times_two(nums)
# your code
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_times_two(array)\n new_array = array.map{ |el| el * 2}\n end",
"def double_array(array)\n array*2\nend",
"def array_times_two!(array)\n array.map!{ |el| el *2}\n end",
"def multiply_by_two(array)\n array.map { |n| n * 2 }\nend",
"def double_array(input_array)\n \n double_array = []\... | [
"0.85335547",
"0.819824",
"0.81257325",
"0.7944768",
"0.7852337",
"0.77969855",
"0.7770848",
"0.775698",
"0.76852244",
"0.76744497",
"0.76250035",
"0.7614298",
"0.760756",
"0.75166804",
"0.7487658",
"0.7440843",
"0.73595166",
"0.7330268",
"0.7305626",
"0.7296652",
"0.7267246"... | 0.0 | -1 |
I worked on this challenge by myself. Your Solution Below | def good_guess?(int)
if int == 42
p true
else
p false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution4(input)\n end",
"def challenge; end",
"def solution(s, p, q)\r\n # write your code in Ruby 2.2\r\n # A -1\r\n # C -2\r\n # G -3\r\n # T -4\r\n # s - string with n charactekrs\r\n #cagccta\r\n #0123345\r\n #p,q - not empty arrays\r\n #\r\n #p[0]=2 q[0]=4 gcc 322 ... | [
"0.66699874",
"0.65802413",
"0.6146916",
"0.6141384",
"0.60677093",
"0.6048339",
"0.6008928",
"0.5924959",
"0.5917534",
"0.5897405",
"0.5886607",
"0.5859519",
"0.58535683",
"0.5827131",
"0.58258575",
"0.5825749",
"0.5824339",
"0.57750577",
"0.5770655",
"0.57650816",
"0.576445... | 0.0 | -1 |
Return the current Observability observer agent. | def observability
return Observability.observer
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent\n @agent\n end",
"def agent\n @agent\n end",
"def agent\n @agent ||= Helpers.agent\n end",
"def agent\n @agent ||= Helpers.agent\n end",
"def agent\n @agent ||= initialize_agent\n end",
"def status\n self.agent.status\n end",
"def observers\n ... | [
"0.6967558",
"0.68767995",
"0.667425",
"0.64557993",
"0.62755126",
"0.5953977",
"0.5924071",
"0.58754134",
"0.586205",
"0.5823715",
"0.5814705",
"0.5723562",
"0.56434476",
"0.5571907",
"0.5423532",
"0.5374289",
"0.53126305",
"0.52562296",
"0.52324194",
"0.5206222",
"0.5195172... | 0.7490186 | 0 |
this section contains regex functions. these all filter back through the object map until they do all they are supposed to do | def tipoff()
@court.tipoff()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def regexps; end",
"def pre_match() end",
"def regex(_obj)\n raise NotImplementedError\n end",
"def re; end",
"def post_match() end",
"def methods_matching(re); end",
"def extended_regexps!\n @hsh = self.class.er(@hsh)\n end",
"def regexp; end",
"def regexp; end",
"def process_procmap... | [
"0.7228324",
"0.68435013",
"0.67390305",
"0.65957916",
"0.6374419",
"0.617648",
"0.6110616",
"0.6108421",
"0.6108421",
"0.61075425",
"0.6087204",
"0.6082193",
"0.6082193",
"0.60757667",
"0.6072086",
"0.5970874",
"0.5932531",
"0.59041274",
"0.58815914",
"0.58526987",
"0.583054... | 0.0 | -1 |
GET /confrences/1 GET /confrences/1.json | def show
@confrence = Confrence.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @confrence }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @conf = Conf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conf }\n end\n end",
"def show\n @global_config = AppConfig.where(:section => params[:sect])\n @global_config.each do |conf|\n puts conf.confkey\n end... | [
"0.72512066",
"0.6758621",
"0.6712495",
"0.6551519",
"0.6538744",
"0.6480336",
"0.64374495",
"0.64363545",
"0.63997066",
"0.63997066",
"0.639007",
"0.63243514",
"0.62787676",
"0.6259344",
"0.6258005",
"0.61273956",
"0.6112235",
"0.60951245",
"0.60920703",
"0.6084567",
"0.6084... | 0.68793327 | 1 |
GET /confrences/new GET /confrences/new.json | def new
@confrence = Confrence.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @confrence }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @conf = Conf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conf }\n end\n end",
"def new\n\tadd_breadcrumb \"Nueva configuración\", :new_configuracion_path\n @configuracion = Configuracion.new\n\n respond_to do |format|\n format... | [
"0.7937215",
"0.7273865",
"0.722282",
"0.7103482",
"0.7080087",
"0.7064302",
"0.7050653",
"0.6922772",
"0.69174397",
"0.67862666",
"0.67860407",
"0.67534524",
"0.6723976",
"0.67149067",
"0.6684897",
"0.66454345",
"0.66379815",
"0.66090995",
"0.65752524",
"0.6560788",
"0.65566... | 0.740588 | 1 |
POST /confrences POST /confrences.json | def create
@confrence = Confrence.new(params[:confrence])
respond_to do |format|
if @confrence.save
format.html { redirect_to @confrence, notice: 'Confrence was successfully created.' }
format.json { render json: @confrence, status: :created, location: @confrence }
else
format.html { render action: "new" }
format.json { render json: @confrence.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @conf = Conf.new(conf_params)\n\n respond_to do |format|\n if @conf.save\n format.html { redirect_to @conf, notice: 'Conf was successfully created.' }\n format.json { render :show, status: :created, location: @conf }\n else\n format.html { render :new }\n fo... | [
"0.7046398",
"0.70320505",
"0.6857423",
"0.65314806",
"0.61996126",
"0.6180571",
"0.61100256",
"0.6088135",
"0.60678226",
"0.6037391",
"0.59852535",
"0.5982257",
"0.59239316",
"0.5903807",
"0.5844947",
"0.5836387",
"0.5832013",
"0.5806912",
"0.5751152",
"0.5727459",
"0.572375... | 0.6488818 | 4 |
PUT /confrences/1 PUT /confrences/1.json | def update
@confrence = Confrence.find(params[:id])
respond_to do |format|
if @confrence.update_attributes(params[:confrence])
format.html { redirect_to @confrence, notice: 'Confrence was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @confrence.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @conf.update(conf_params)\n format.html { redirect_to @conf, notice: 'Conf was successfully updated.' }\n format.json { render :show, status: :ok, location: @conf }\n else\n format.html { render :edit }\n format.json { render json: @... | [
"0.6757705",
"0.6757319",
"0.6716901",
"0.6505216",
"0.60162306",
"0.5924261",
"0.5898763",
"0.58915293",
"0.5863862",
"0.5846758",
"0.57917064",
"0.5777382",
"0.5772407",
"0.5765981",
"0.5765765",
"0.5760062",
"0.572215",
"0.5716021",
"0.56685805",
"0.56677914",
"0.56645757"... | 0.6374604 | 4 |
DELETE /confrences/1 DELETE /confrences/1.json | def destroy
@confrence = Confrence.find(params[:id])
@confrence.destroy
respond_to do |format|
format.html { redirect_to confrences_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @conf = Conf.find(params[:id])\n @conf.destroy\n\n respond_to do |format|\n format.html { redirect_to confs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @conf.destroy\n respond_to do |format|\n format.html { redirect_to confs_url, notice: '... | [
"0.7707761",
"0.76126057",
"0.76126057",
"0.7152266",
"0.71019167",
"0.6972398",
"0.6960159",
"0.69570214",
"0.6907719",
"0.69005483",
"0.68236655",
"0.682293",
"0.6807334",
"0.67331934",
"0.67104495",
"0.67074406",
"0.669444",
"0.66871756",
"0.6658043",
"0.6653449",
"0.66381... | 0.724691 | 3 |
Return the app bundle path for the frontmost application. | def current_app
`osascript -e 'POSIX path of (path to frontmost application as text)'`.chomp
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def application_path\n fetch_path(DevTools.app_root)\n end",
"def appBundlesPath\n \"#{SIMULATORS_ROOT}/#{@guid}/#{DEVICE_APP_BUNDLES_RELATIVE_PATH}\"\n end",
"def application_path\n if environment.container?\n applications_path.join(application_name_as_snake_case)\n ... | [
"0.74868107",
"0.72516096",
"0.70783967",
"0.69382447",
"0.6897525",
"0.6755201",
"0.6683763",
"0.65867215",
"0.65833634",
"0.6573522",
"0.6510651",
"0.643345",
"0.6358437",
"0.6352383",
"0.6347005",
"0.63048977",
"0.62919533",
"0.6289398",
"0.62886274",
"0.6279104",
"0.62791... | 0.66363406 | 7 |
Get the title and URL of the current browser. | def current_browser_tab(app_bundle_path)
if app_bundle_path =~ /Safari/
app = SBApplication.applicationWithBundleIdentifier 'com.apple.Safari'
tab = app.windows[0].currentTab
[tab.URL, tab.name]
elsif app_bundle_path =~ /Chrome/
app = SBApplication.applicationWithBundleIdentifier 'com.google.Chrome'
tab = app.windows[0].activeTab
[tab.URL, tab.title]
else
abort("unknown app: #{app_bundle_path}")
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title\n browser.title\n end",
"def title\n @browser.title\n end",
"def title\n @browser.title\n end",
"def currentWindowTitle\n begin\n return theBrowser.title\n rescue\n return nil\n end\n end",
"def page_title\n @web_browser.page_title\n end... | [
"0.80656934",
"0.7943439",
"0.7722218",
"0.7637588",
"0.7478132",
"0.7438359",
"0.7324435",
"0.7292094",
"0.70955545",
"0.7063089",
"0.7014388",
"0.69578",
"0.69026494",
"0.6826625",
"0.678031",
"0.6766526",
"0.67308474",
"0.672457",
"0.6702112",
"0.6687359",
"0.6620595",
"... | 0.6209513 | 39 |
Shellescape the given string | def escape(str)
URI.escape str, /[:?\/']/
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shellescape(str)\n Util.shellescape(str)\n end",
"def shellescape\n Shellwords.escape(self)\n end",
"def shellescape(str)\n # An empty argument will be skipped, so return empty quotes.\n return \"''\" if str.empty?\n\n str = str.dup\n\n # Process as a single byte sequence becaus... | [
"0.8511822",
"0.7603936",
"0.72994965",
"0.7289978",
"0.7209497",
"0.70661485",
"0.7028813",
"0.68715113",
"0.5925906",
"0.5854961",
"0.5635682",
"0.5515515",
"0.5454817",
"0.5392929",
"0.5391371",
"0.5387793",
"0.5357128",
"0.5354897",
"0.5349319",
"0.5339105",
"0.5319664",
... | 0.0 | -1 |
Capture URL and TITLE with emacsclient. | def capture(url, title)
template_key = 'l'
ec = '/usr/local/bin/emacsclient'
`#{ec} org-protocol:/capture:/#{template_key}/'#{escape url}'/'#{escape title}'/''`
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run\n super\n\n uri = _get_entity_name\n \n begin \n _log \"Browser Navigating to #{uri}\"\n c = Intrigue::ChromeBrowser.new\n browser_response = c.navigate_and_capture(uri)\n rescue Errno::ECONNREFUSED => e \n _log_error \"Unable to connect to chrome browser. Is it running... | [
"0.58904344",
"0.52051187",
"0.5121999",
"0.51191807",
"0.51023537",
"0.5095666",
"0.5074607",
"0.50549567",
"0.5046631",
"0.5045205",
"0.5037342",
"0.5018147",
"0.5017895",
"0.4996244",
"0.49938387",
"0.4988835",
"0.49694595",
"0.49599996",
"0.4954613",
"0.4952181",
"0.49235... | 0.6812955 | 0 |
Creates a new instance of the scrubber | def initialize
@current_key = 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(fighter, bomber)\n create(fighter, bomber)\n end",
"def create\n @scrub = Scrub.new(scrub_params)\n\n respond_to do |format|\n if @scrub.save\n format.html { redirect_to @scrub, notice: 'Scrub was successfully created.' }\n format.json { render action: 'show', status: ... | [
"0.5918677",
"0.5814267",
"0.5793796",
"0.5793796",
"0.5793796",
"0.5793796",
"0.5793796",
"0.57452005",
"0.5739895",
"0.5604964",
"0.5604964",
"0.5604964",
"0.5604964",
"0.5604964",
"0.5604964",
"0.5604964",
"0.5604964",
"0.5604964",
"0.55624723",
"0.5547277",
"0.5499329",
... | 0.0 | -1 |
Loads an extension into this instance by its path | def load_extension path
instance_eval(File.read(File.join(File.dirname(__FILE__), path)))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(path); end",
"def extension_from_path(path)\n @extensions.find {|e| e.path == path}\n end",
"def _load(path)\n path = Pathname.new(path)\n @loader.load(path)\n end",
"def add_extension(path); end",
"def add_extension_path(path)\n validate_extension(path)\n @optio... | [
"0.7042855",
"0.7018971",
"0.6906561",
"0.68785787",
"0.6491461",
"0.6471221",
"0.6441505",
"0.64025146",
"0.63991475",
"0.63372535",
"0.63372535",
"0.6324371",
"0.6313672",
"0.6291046",
"0.6290275",
"0.62855107",
"0.6269874",
"0.6243596",
"0.6231301",
"0.61761016",
"0.614143... | 0.8560356 | 0 |
rebuild complete index for model | def rebuild_pgindex!
self.all.each { |model| model.rebuild_pgindex! }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rebuild_index\n aaf_index.rebuild_index\n end",
"def update_index\n all.each do |n|\n n.update_index\n end\n end",
"def index(model)\n model.index\n ElasticMapper.index.refresh\nend",
"def construct_index\n end",
"def reindex!\n find(:all).each { |r| r.upda... | [
"0.7842015",
"0.73903763",
"0.7384246",
"0.72862524",
"0.7267823",
"0.7138177",
"0.70431507",
"0.7024288",
"0.70225966",
"0.70205724",
"0.69963276",
"0.69634676",
"0.69634676",
"0.68866926",
"0.6881428",
"0.68658084",
"0.6837054",
"0.6771458",
"0.67682064",
"0.67615855",
"0.6... | 0.82320774 | 0 |
Team's clone is itself (Teams are unique, uncopyable) | def clone
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clone()\n Team.new(@school.clone, @members.map {|m| m.clone}, @name.clone, @num_wins)\n end",
"def clone()\n Match.new(@team_a.clone, @team_b.clone, @judges.map {|j| j.clone})\n end",
"def clone\n self\n end",
"def clone() end",
"def clone; end",
"def clone; end",
"def clone; end",
... | [
"0.824998",
"0.748566",
"0.6731887",
"0.66537",
"0.6643961",
"0.6643961",
"0.6643961",
"0.6624793",
"0.6616999",
"0.6592926",
"0.65810525",
"0.6569567",
"0.6555422",
"0.6555422",
"0.65498614",
"0.65498614",
"0.65498614",
"0.6498717",
"0.64543116",
"0.6365588",
"0.63162816",
... | 0.66314405 | 7 |
Use callbacks to share common setup or constraints between actions. | def set_location
@location = current_user.locations.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def location_params
params.require(:location).permit(:name, :description, :latitude, :longitude)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
name: instructions_work explanation: Checks if instructions about the medals's behavior are correct parameters: none return: method to check if instructions are in the correct class | def instructions_work
current_user = User.create(name: "Joao", email: "joao@gmail.com", password: "12345678", nickname: "joaovitor")
current_user.restore_attributes
achieved_return = achieved?(current_user)
if current_user.changed?
errors.add(:achieved_instructions, "Changing user information")
else
# nothing to do
end
current_user.restore_attributes
message_return = message(current_user)
if current_user.changed?
errors.add(:message_instructions, "Changing user information")
else
# nothing to do
end
return instructions_return_valid_class(achieved_return, message_return)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instructions\n \n end",
"def instructions; raise NotImplementedError\n end",
"def checkAdhoc(maps)\n #check for Main class with 0-param main method\n if maps.imap.has_key?('Main')\n found = false\n maps.imap['Main'].each do |_,method|\n if method.name.name == 'main'\n ... | [
"0.64020306",
"0.5762337",
"0.57321036",
"0.5454375",
"0.54400456",
"0.5422836",
"0.53848803",
"0.53756773",
"0.5368741",
"0.5368741",
"0.5340534",
"0.53336835",
"0.5298454",
"0.52659565",
"0.52659565",
"0.5259325",
"0.5230896",
"0.5224044",
"0.5197591",
"0.5186915",
"0.51737... | 0.58703315 | 1 |
name: instructions_return_valid_class explanation: Checks if parameters are in the correct class (boolean and string) parameters: achieved_return: boolean from achieved? method message_return: String with instructions return: none | def instructions_return_valid_class(achieved_return, message_return)
if (achieved_return.class != TrueClass && achieved_return.class != FalseClass)
errors.add(:achieved_instructions, "Achieved must be True or False")
else
# nothing to do
end
if message_return.class != String
errors.add(:message_instructions, "Message must be String")
else
# nothing to do
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isClass _args\n \"isClass _args;\" \n end",
"def instructions_work\n current_user = User.create(name: \"Joao\", email: \"joao@gmail.com\", password: \"12345678\", nickname: \"joaovitor\")\n current_user.restore_attributes\n\n achieved_return = achieved?(current_user)\n if current_user.cha... | [
"0.5640559",
"0.56252694",
"0.5488571",
"0.5488571",
"0.54822266",
"0.5446531",
"0.5335838",
"0.53299433",
"0.5329243",
"0.53226733",
"0.53226733",
"0.5306163",
"0.53053993",
"0.5304937",
"0.52918875",
"0.5286717",
"0.52632946",
"0.5244507",
"0.5241371",
"0.5241371",
"0.52413... | 0.82854176 | 0 |
name: achieved? explanation: Checks if user got the medal parameters: current_user: Object from User class that represents the current user of the system return: none | def achieved?(current_user)
achieved_instructions.each do |instruction|
eval instruction
end
rescue
errors.add(:achieved_instructions, "Invalid instructions")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user?\n \n end",
"def user_is_current\n fetch_user\n\n unless current_user?(@user)\n flash[:error] = t(:not_authorized)\n redirect_to root_path\n end\n end",
"def possessive(user)\n return 'your' if (user == current_user)\n return 'their' unless user.contact_informatio... | [
"0.6810425",
"0.66587406",
"0.6653594",
"0.6614367",
"0.6603946",
"0.66019666",
"0.6540302",
"0.64771783",
"0.6473505",
"0.647164",
"0.647164",
"0.64647204",
"0.6447083",
"0.64222103",
"0.64166516",
"0.64137346",
"0.64023685",
"0.64011097",
"0.6381137",
"0.6380892",
"0.638089... | 0.0 | -1 |
name: message explanation: Display the message with that is missing to win the medal parameters: current_user: Object from User class that represents the current user of the system return: none | def message(current_user)
message_instructions.each do |instruction|
eval instruction
end
rescue
errors.add(:message_instructions, "Invalid instructions")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_user\n\t\tunless current_user == @univers.user\n\t\t\tflash[:danger] = \"You have no power there\"\n\t\t\tredirect_to universes_path\n end\n end",
"def require_owner\n @messsage = \"You don't have the permission to do this operation.\"\n render :file => \"shared/message\" unless @user.e... | [
"0.6432501",
"0.6428965",
"0.64275527",
"0.627959",
"0.62641853",
"0.6247084",
"0.615143",
"0.6072486",
"0.6067574",
"0.60344636",
"0.59966505",
"0.5993053",
"0.5990492",
"0.59784275",
"0.59747255",
"0.59712327",
"0.59712327",
"0.5947651",
"0.593855",
"0.5931669",
"0.5916814"... | 0.0 | -1 |
Return true, if user is loged id, else returns false | def logged_in?
!current_user.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_is_old? user\n return user.logins_number > 1\n end",
"def loged_in?\n !current_user.nil?\n end",
"def loged_in?\n !current_user.nil?\n end",
"def loged?\n @user = current_user\n if not @user\n redirect_to welcome_index_path\n end\n end",
"def user_login?\n\t\treval = use... | [
"0.7773043",
"0.7626834",
"0.75538844",
"0.71957177",
"0.695535",
"0.6929811",
"0.6916634",
"0.6916634",
"0.6717489",
"0.6717489",
"0.66606355",
"0.6626066",
"0.66251326",
"0.66210246",
"0.6620645",
"0.65775484",
"0.65584576",
"0.6550021",
"0.6532861",
"0.6528135",
"0.6528135... | 0.0 | -1 |
The method should take in a string argument containing a phrase and check to see if the phrase is written in all uppercase: if it isn't, then grandma can't hear you. She should then respond with (return) HUH?! SPEAK UP, SONNY!. If you shout at her (i.e. call the method with a string argument containing a phrase that is all uppercase, then she can hear you (or at least she thinks that she can) and should respond with (return) NO, NOT SINCE 1938!. However, if the phrase is exactly equal to: "I LOVE YOU GRANDMA!", then Grandma is very pleased and definitely hears that! and should repond with (return) I LOVE YOU TOO PUMPKIN! | def speak_to_grandma(question)
if question != question.upcase
return "HUH?! SPEAK UP, SONNY!"
elsif question == "I LOVE YOU GRANDMA!"
return "I LOVE YOU TOO PUMKIN!"
else
return "NO, NOT SINCE 1938!"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def speak_to_grandma(takes_string_arguement)\n\n if takes_string_arguement == takes_string_arguement.upcase\n return \"NO, NOT SINCE 1938!\"\n else\n return \"HUH?! SPEAK UP, SONNY!\"\n end\n \nend",
"def speak_to_grandma(input_phrase)\n if input_phrase == \"I LOVE YOU GRANDMA!\"\n ... | [
"0.75905514",
"0.7469693",
"0.74361676",
"0.73763186",
"0.70306367",
"0.69623005",
"0.6960449",
"0.69051236",
"0.6887451",
"0.68582803",
"0.6854702",
"0.685009",
"0.67165035",
"0.67165035",
"0.6705906",
"0.6694342",
"0.66802925",
"0.66802925",
"0.66802925",
"0.66802925",
"0.6... | 0.6767418 | 12 |
Overriding base get_child method | def get_child(name, options)
child = hash[name].is_a?(Hash) ? hash[name] : {}
child_location = location + "[#{name}]"
create_composite(options, child, name, child_location)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_child(name)\n Vidalia::checkvar(name,String,self.class.ancestors,\"name\")\n @children[name]\n end",
"def child\n children[0]\n end",
"def children; end",
"def children; end",
"def children; end",
"def children; end",
"def children; end",
"def children; end",
"d... | [
"0.6851984",
"0.6802884",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.6750389",
"0.67447346",
"0.671551",
"0.66840935",
"0.66663736",
"0.6580003",
"0.65630096",
"0.6545533",
... | 0.6794853 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.