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 |
|---|---|---|---|---|---|---|
prepare formatstring. NOTE: this is not the final value. render adds numbering to this, if user has set numbering option.!!!! | def _prepare_format #:nodoc:
fmstr = nil
fmt = []
each_column { |c, i|
## trying a zero for hidden columns
## worked but an extra space is added below and the sep
w = c.width
case c.align
when :right
#fmt << "%.#{w}s "
fmt << "%#{w}.#{w}s "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render\n buffer = []\n _guess_col_widths\n rows = @list.size.to_s.length\n @rows = rows\n _prepare_format\n \n str = \"\"\n if @numbering\n str = \" \"*(rows+1)+@y\n end\n str << @fmstr % @columns\n buffer << str\n #puts \"-\" * str.length\n ... | [
"0.6511823",
"0.61348087",
"0.61348087",
"0.61348087",
"0.61348087",
"0.61348087",
"0.61348087",
"0.61348087",
"0.61348087",
"0.6043329",
"0.6043329",
"0.6030931",
"0.59357977",
"0.59357977",
"0.59357977",
"0.59357977",
"0.5868479",
"0.58615375",
"0.5802222",
"0.57625705",
"0... | 0.60025656 | 12 |
Before filters Requires a user to be signed in. | def signed_in_user
if signed_in?
return true
else
redirect_to signin_url and return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_filters\n set_user\n authorize\n end",
"def before_filter\n if current_user\n true\n end\n end",
"def signed_in_user_filter\n if signed_in?\n redirect_to root_path, notice: \"Already logged in\"\n end\n end",
"def current_user_required\n\t\t# Have to add \".filter(sel... | [
"0.78381836",
"0.7587757",
"0.73553073",
"0.72756255",
"0.64653397",
"0.6460761",
"0.6436536",
"0.6396451",
"0.6379741",
"0.6356206",
"0.6328723",
"0.6291878",
"0.62910926",
"0.6284429",
"0.62798274",
"0.62528664",
"0.62285143",
"0.6216747",
"0.6209073",
"0.62071157",
"0.6185... | 0.0 | -1 |
Requires the current user to be the same one for which the action is performed. | def correct_user
redirect_to root_url if params[:username] != current_user.username
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def require_same_user\n if current_user != @user\n flash[:error] = \"You do not have permisions to edit a user other than yourself\"\n redirect_to root_path\n end \n end",
"def ensure_user\n current_user? || deny_access('You must be logged in to perform this action.')\n end",
... | [
"0.76964",
"0.7661109",
"0.76570326",
"0.7537279",
"0.7330094",
"0.7206853",
"0.7205295",
"0.7197443",
"0.71946627",
"0.71814543",
"0.71730334",
"0.7167931",
"0.7153418",
"0.7148843",
"0.71041554",
"0.7098771",
"0.70688915",
"0.7053807",
"0.70324826",
"0.7027397",
"0.7017128"... | 0.0 | -1 |
Requires session[request.path] to be set to 'shared' or a user to be signed in as same one for which the action is performed. | def correct_user_or_shared_page
if session[request.path] != "shared"
# Run normal callbacks
signed_in_user && correct_user
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owner_only(user_id)\n if session['user_id'] == user_id\n true\n else\n redirect '/'\n end\nend",
"def require_session_ownership\r\n if session_user.screen_name == params[:screen_name]\r\n @user = session_user\r\n return true\r\n end\r\n\r\n # wrong screen_name in url doesn't match... | [
"0.6771916",
"0.65909594",
"0.64256215",
"0.6393042",
"0.6380926",
"0.6374899",
"0.63572735",
"0.63547885",
"0.6350289",
"0.6337064",
"0.6288977",
"0.62833196",
"0.62702364",
"0.62471616",
"0.6222235",
"0.6213984",
"0.6212755",
"0.6205202",
"0.6182407",
"0.6177145",
"0.617635... | 0.6863033 | 0 |
Given a dice which rolls 1 to 7 (with uniform probability), simulate a 5 sided dice. Preferably, write your solution as a function. Requirements You MUST do this on pen and paper or on a whiteboard. No actual coding is allowed until you've solved it on pen and paper! | def simulate_roll(min = 1, max = 7)
rand(max) + min
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dice_roll\n rand(1..6)\n end",
"def roll_a_dice\n\t\trand(1..6)\n\tend",
"def roll(dice)\n rand(1..6)*dice\nend",
"def roll\n # code goes here\n rand(1..6)\n # bonus solve using array\n #possible_rolls = (1..6).to_a\n #possible_rolls[rand(0..5)]\nend",
"def dice\n rand(1..6) + rand(1..6)\nen... | [
"0.7668775",
"0.7516878",
"0.7464262",
"0.7389701",
"0.738864",
"0.7342712",
"0.73310095",
"0.731832",
"0.7280669",
"0.71963984",
"0.7123245",
"0.7053284",
"0.7021797",
"0.70187956",
"0.70172846",
"0.694591",
"0.6872699",
"0.6869779",
"0.68639505",
"0.68639505",
"0.6810902",
... | 0.6229266 | 76 |
creates the Mechanize agent used to do the scraping and sets a nice user agent header for good net educate | def create_agent
self.agent = WWW::Mechanize.new
agent.user_agent = "Mozilla/4.0 (compatible; Blackbook #{Blackbook::VERSION})"
agent.keep_alive = false
agent
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_agent(agent)\n headers.update 'User-Agent' => agent\n end",
"def init_agent\r\n agent = Mechanize.new{|a| a.history.max_size = 10}\r\n agent.user_agent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5'\r\n agent.verify_mode = OpenSSL::SSL:... | [
"0.7416943",
"0.74113935",
"0.7377459",
"0.72215647",
"0.7173405",
"0.712079",
"0.7058507",
"0.701807",
"0.6987984",
"0.6987984",
"0.6987984",
"0.6987984",
"0.6987984",
"0.6987984",
"0.6987984",
"0.6963631",
"0.6885625",
"0.6885625",
"0.6885625",
"0.6885625",
"0.6885625",
"... | 0.7401067 | 2 |
Page scrapers will follow a fairly simple pattern of instantiating the agent, prepping for the scrape and then the actual scrape process | def fetch_contacts!
create_agent
prepare
scrape_contacts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start\n # Very important object. Don't lose or overwrite it. Required for scraping.\n agent = Mechanize.new\n\n begin\n # Authenticates in this method call.\n links = authenticate agent\n # Scrapes in this method call.\n acquire links, agent\n\n puts \"Grades acquired.\".foreg... | [
"0.68575025",
"0.6791944",
"0.67878217",
"0.67681825",
"0.6592999",
"0.6542702",
"0.65378666",
"0.6483583",
"0.64605254",
"0.643426",
"0.638668",
"0.6369418",
"0.6363492",
"0.63087505",
"0.6293656",
"0.62583214",
"0.62583214",
"0.624673",
"0.6234375",
"0.6192175",
"0.6176534"... | 0.0 | -1 |
Providers will often require you to login or otherwise prepare to actual scrape the contacts | def prepare; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scrape_contacts; end",
"def fetch_contacts!\n create_agent\n prepare\n scrape_contacts\n end",
"def scrape_contacts \n unless auth_cookie = agent.cookies.find{|c| c.name =~ /^Auth/}\n raise( Blackbook::BadCredentialsError, \"Must be authenticated to access contacts.\" )\n end\n \... | [
"0.7529925",
"0.7276081",
"0.71477276",
"0.7097228",
"0.667431",
"0.6569449",
"0.6544356",
"0.6449844",
"0.64204705",
"0.6291629",
"0.62460005",
"0.62452877",
"0.62139946",
"0.62041926",
"0.6182687",
"0.61376256",
"0.61376256",
"0.61376256",
"0.61376256",
"0.61376256",
"0.613... | 0.0 | -1 |
stub Some providers have a single page you can scrape from (like Gmail's HTML Contacts page) while others might require you to navigate several pages, scraping as you go. | def scrape_contacts; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_page\n page.visit('')\n end",
"def loadHandinPage()\n end",
"def fetchPage(url)\n Nokogiri::HTML(open(url, 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.152 Safari/535.19').read, nil, 'utf-8')\n end",
"def page(site)\n Nokogiri... | [
"0.632168",
"0.6285333",
"0.62334955",
"0.62241566",
"0.6136903",
"0.6113631",
"0.6098412",
"0.60975516",
"0.60646737",
"0.6013832",
"0.59873915",
"0.59845716",
"0.5981612",
"0.59722346",
"0.59388435",
"0.5897926",
"0.5897926",
"0.58719003",
"0.58719003",
"0.58649355",
"0.584... | 0.55188453 | 100 |
stub helper to strip html from text | def strip_html( html )
html.gsub(/<\/?[^>]*>/, '')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strip_html(text)\n @name =\n # Remove HTML from the text\n Sanitize.clean(text).\n # Replace newlines with a space\n gsub(/\\n|\\r/, ' ').\n # Replaces runs of spaces by a single space\n squeeze(' ').\n # Remove leading and trailing whitespace\n strip\nend",
"def strip_html(text)\n ... | [
"0.79107726",
"0.77517855",
"0.75825197",
"0.75083774",
"0.75083774",
"0.75083774",
"0.73941725",
"0.73231",
"0.7279591",
"0.72652704",
"0.7216221",
"0.7193634",
"0.7149507",
"0.71289575",
"0.7125986",
"0.7121022",
"0.7020071",
"0.69571745",
"0.694305",
"0.6919113",
"0.691824... | 0.6822878 | 30 |
Present the user's avatar, optionally with a form for uploading the image (if they're the viewer) | def card_avatar options={}
(is_viewer? && !@decorator.imgdata(false).present?) ?
super + collectible_editpic_button(@decorator, 'lg', label: 'Get a Picture', class: 'upload-button') :
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_answer_avatar_for(user)\n if user.avatar?\n image_tag(user.avatar.tiny.url, class: 'media-object tiny-thumbnail').html_safe\n else\n image_tag('fallback/default.gif', height: '30px', width: '30px', class: 'media-object tiny-thumbnail').html_safe\n end\n end",
"def edit\n \n @u... | [
"0.7003281",
"0.6941493",
"0.6914989",
"0.69111794",
"0.6824141",
"0.67765796",
"0.67765796",
"0.67720795",
"0.6666585",
"0.6658455",
"0.6604734",
"0.6593839",
"0.658528",
"0.6575731",
"0.64567816",
"0.6438632",
"0.6438575",
"0.64325213",
"0.64291936",
"0.6423737",
"0.6418343... | 0.68886626 | 4 |
Users don't have a ribbon on their card | def ribbon
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ribbon_got?(id)\n return @ribbons.include?(id)\n end",
"def test_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 500, 300, 50, @elements, nil, 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n ... | [
"0.58256733",
"0.5720923",
"0.55818325",
"0.5578039",
"0.5519928",
"0.54263926",
"0.54055727",
"0.5401377",
"0.53399915",
"0.53319687",
"0.53024626",
"0.5271457",
"0.52713186",
"0.5212148",
"0.5177438",
"0.51756066",
"0.51498866",
"0.5136888",
"0.5133197",
"0.51257825",
"0.51... | 0.6370088 | 0 |
Users don't have a tab on their card | def card_label
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def other_tabs_remaining?\n course.video_tabs.count > 1\n end",
"def other_tabs_remaining?\n category.tabs.count > 1\n end",
"def show_private_tab\n current_user && (current_user.admin? || # if current_user is an admin\n current_user.premium? || # current_user is a premium\n c... | [
"0.68477327",
"0.67271996",
"0.6591237",
"0.6455473",
"0.6184761",
"0.6144346",
"0.6144346",
"0.6135221",
"0.6089786",
"0.607783",
"0.60750663",
"0.606441",
"0.6056164",
"0.5927033",
"0.591795",
"0.591648",
"0.58741695",
"0.5868547",
"0.58681786",
"0.58278805",
"0.5803471",
... | 0.0 | -1 |
The path used after sign up. | def after_sign_up_path_for(resource)
values = {
business: "business.brilliancetech@gmail.com",
upload: 1,
no_shipping: 1,
# return: "#{Rails.application.secrets.app_host}/payments",
return: "http://familypedigree.herokuapp.com/payments",
# notify_url: "#{Rails.applica... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path\n root? ? boot_path : user_path\n end",
"def path\n root? ? boot_path : user_path\n end",
"def client_signed_up_path\n path_from_cookie(:after_account_signed_up_path) || path_from_cookie(:after_client_signed_up_path) || edit_user_client_path(current_user)\n end",
"def after_sign_... | [
"0.74486095",
"0.74486095",
"0.7348926",
"0.72428125",
"0.71978325",
"0.7191859",
"0.71229225",
"0.71229225",
"0.7114739",
"0.7110063",
"0.71050537",
"0.70890594",
"0.7078605",
"0.70710707",
"0.7039824",
"0.69836",
"0.69836",
"0.69836",
"0.69836",
"0.69687116",
"0.69687116",
... | 0.0 | -1 |
=begin INPUT: Obtain two collections of values If both collections are empty THEN return the empty collection else add collection one + collection two THEN return the combined collections END IF OUTPUT: Combine the two collections of words into one =end I worked on this challenge [by myself]. Your Solution Below =begin... | def array_concat(array_1, array_2)
combined_array = array_1 + array_2
return combined_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_concat(array_1, array_2)\n if array_1.empty? && array_2.empty?\n \tfinal_array = []\n else\n \tcount = 0\n \twhile count < array_2.length\n \t\tfinal_array = array_1.push array_2[count]\n \t\tcount += 1\n \tend\n end\n return final_array\nend",
"def array_concat(array_1, array_2)\n # Your co... | [
"0.7615307",
"0.75549287",
"0.7515556",
"0.75001305",
"0.749192",
"0.74563",
"0.74402696",
"0.74317396",
"0.74136806",
"0.74061644",
"0.7345057",
"0.73222965",
"0.7307473",
"0.7302662",
"0.73019147",
"0.7297929",
"0.727484",
"0.727484",
"0.7265757",
"0.72461057",
"0.7235194",... | 0.71166575 | 38 |
Public: Initializes the API Client class | def initialize
# Note: Suds logging is disabled
@soap_client = Suds.client(endpoint: ENDPOINT, namespace: NAMESPACE,
soap_version: 1, wsdl: WSDL, log: false)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n @api_user = \"\"\n @api_key = \"\"\n end",
"def initialize(api_key)\n @client = HTTPClient.new(\n default_header: {\n 'X-Auth-Token' => api_key,\n 'Content-Type' => 'application/json'\n }\n )\n end",
"def initialize(api_key, username, password)\n ... | [
"0.80325025",
"0.8010681",
"0.79503894",
"0.78721565",
"0.7803325",
"0.7789924",
"0.7745938",
"0.77344364",
"0.7718492",
"0.76793236",
"0.76279014",
"0.75967866",
"0.7588033",
"0.7564818",
"0.7562702",
"0.7555987",
"0.75242597",
"0.7506471",
"0.74999183",
"0.74901783",
"0.745... | 0.0 | -1 |
Public: Initializes a session on the API server and stores the expiry time and the session_id in instance variables Returns the session_id GUID | def initialize_session
response = @soap_client.call :initialize_session
# Without ActiveSupport
# 1.hour.from_now is 3600 seconds from Time.now
@session_expiry_time = Time.now + 3600
@session_id = response.body[:initialize_session_response][:initialize_session_result]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_session\n response = @savon.call :initialize_session\n # Without ActiveSupport\n # 1.hour.from_now is 3600 seconds from Time.now\n @session_expiry_time = Time.now + 3600\n @session_id = response.body[:initialize_session_response][:initialize_session_result]\n ... | [
"0.8205549",
"0.7366066",
"0.72173154",
"0.7182002",
"0.71672076",
"0.716702",
"0.7028304",
"0.69900715",
"0.6919015",
"0.69127214",
"0.6877575",
"0.6820005",
"0.6818361",
"0.6818361",
"0.6818361",
"0.67341465",
"0.6719797",
"0.66984504",
"0.6683915",
"0.6667034",
"0.66528183... | 0.793872 | 1 |
Public: Calls the 'SignIn' SOAP action username a String which corresponds to a TranscribeMe Portal account username which can be any valid email address password a String which is the portal account password Returns a GUID of the Customer ID | def sign_in(username, password)
# If #login_with is called before we have a session_id instance variable
# then call initialize_session
initialize_session unless session_valid?
# Use Suds to call the 'SignIn' SOAP action
response = @soap_client.call :sign_in,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_in(username, password)\n \n # If #login_with is called before we have a session_id instance variable\n # then call initialize_session\n initialize_session unless session_valid?\n\n # Use Savon to call the 'SignIn' SOAP action\n response = @savon.call :sign_in, \n... | [
"0.6435891",
"0.5484796",
"0.54348046",
"0.5424278",
"0.53663397",
"0.5348663",
"0.53032714",
"0.5277281",
"0.5253606",
"0.52351665",
"0.5195412",
"0.5171193",
"0.51522857",
"0.5135205",
"0.5123581",
"0.51164925",
"0.5088182",
"0.5087551",
"0.50824624",
"0.50808567",
"0.50686... | 0.69385266 | 0 |
Public: Calls the 'GetCustomerRecordings' SOAP Action requires the user to be logged in Returns an Array of Hashes of with the properties of recording objects | def get_recordings
# raise 'Login first!' unless @customer_login_id
response = @soap_client.call :get_customer_recordings,
message: { 'wsdl:sessionID' => session_id }
@recordings = response.body[:get_customer_recordings_response][:get_customer_recordings_result][:rec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_recordings\n # raise 'Login first!' unless @customer_login_id\n\n response = @savon.call :get_customer_recordings, \n message: { 'wsdl:sessionID' => session_id }\n\n # Returns an array of instances of the Recording class\n @recordings = Transcrib... | [
"0.8393711",
"0.74418026",
"0.6205894",
"0.59192604",
"0.58930606",
"0.5873243",
"0.5866161",
"0.5863246",
"0.5837155",
"0.58055586",
"0.5798558",
"0.57962966",
"0.5773887",
"0.5742582",
"0.5711987",
"0.57072693",
"0.57055783",
"0.57048357",
"0.5550881",
"0.55396473",
"0.5539... | 0.8729316 | 0 |
Public: Calls the 'GetUploadUrl' SOAP Action Returns the upload url as a String | def get_upload_url
# raise 'Login first!' unless @customer_login_id
response = @soap_client.call :get_upload_url,
message: { 'wsdl:sessionID' => @session_id }
@upload_url = response.body[:get_upload_url_response][:get_upload_url_result] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_upload_url\n # raise 'Login first!' unless @customer_login_id\n\n response = @savon.call :get_upload_url, \n message: { 'wsdl:sessionID' => @session_id }\n \n @upload_url = response.body[:get_upload_url_response][:get_uplo... | [
"0.7910738",
"0.7738141",
"0.7604398",
"0.6668465",
"0.653069",
"0.63836884",
"0.6358183",
"0.6320675",
"0.6280919",
"0.6180335",
"0.615021",
"0.61252236",
"0.6000212",
"0.57817954",
"0.57817954",
"0.57817954",
"0.57817954",
"0.57817954",
"0.57347214",
"0.57201344",
"0.569492... | 0.8321389 | 0 |
Public: Calls the 'TranscribeRecording' SOAP Action recording_id a String in GUID format Returns the SOAP response Hash | def transcribe_recording(recording_id)
# initialize_session unless @session.try :valid?
response = @soap_client.call :transcribe_recording,
message: { 'wsdl:sessionID' => @session_id,
'wsdl:recordingId' => recording_id }
respon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transcribe_recording(recording_id)\n # initialize_session unless @session.try :valid?\n\n response = @savon.call :transcribe_recording, \n message: { 'wsdl:sessionID' => @session_id, \n 'wsdl:recordingId' => recording_id }\n... | [
"0.785164",
"0.7162867",
"0.70631206",
"0.6783896",
"0.6631659",
"0.65345085",
"0.6409304",
"0.63984877",
"0.6378945",
"0.6236247",
"0.6235441",
"0.61924756",
"0.61735684",
"0.6157637",
"0.61524",
"0.61193633",
"0.6020989",
"0.5894645",
"0.58299625",
"0.57763284",
"0.57245725... | 0.81536764 | 0 |
Public: Calls the 'TranscribeRecordingWithPromoCode' SOAP Action recording_id a String in GUID format promocode a String Returns the SOAP response Hash | def transcribe_recording_using_promocode(recording_id, promocode)
# initialize_session unless @session.try :valid?
response = @soap_client.call :transcribe_recording_using_promocode,
message: { 'wsdl:sessionID' => @session_id,
'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transcribe_recording_using_promocode(recording_id, promocode)\n # initialize_session unless @session.try :valid?\n \n response = @savon.call :transcribe_using_promo_code, \n message: { 'wsdl:sessionID' => @session_id, \n ... | [
"0.8100696",
"0.65467256",
"0.6287079",
"0.55218077",
"0.5475904",
"0.527069",
"0.5211421",
"0.51613057",
"0.51164204",
"0.51164204",
"0.50006616",
"0.49446142",
"0.49424493",
"0.4890779",
"0.4884488",
"0.4866192",
"0.48377487",
"0.48356754",
"0.4802964",
"0.48028165",
"0.478... | 0.82682246 | 0 |
Public: Calls the 'GetRecordingInfo' SOAP Action recording_id a String in GUID format Returns the SOAP response Hash | def get_recording_info(recording_id)
@soap_client.call :get_recording_info,
message: { 'wsdl:sessionID' => @session_id,
'wsdl:recordingID' => recording_id }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_recording_info(recording_id)\n response = @savon.call :get_recording_info,\n message: { 'wsdl:sessionID' => @session_id,\n 'wsdl:recordingID' => recording_id }\n response.body[:get_recording_info_response][:get_recording_info_result]\n e... | [
"0.77321714",
"0.7124799",
"0.7103942",
"0.6680091",
"0.654284",
"0.6399653",
"0.6372261",
"0.6351654",
"0.6338941",
"0.6253416",
"0.62393284",
"0.6119873",
"0.61112463",
"0.6082434",
"0.59883547",
"0.59631765",
"0.5927142",
"0.5891637",
"0.5844049",
"0.5837947",
"0.58143103"... | 0.7974899 | 0 |
Public: Calls the 'FinalizeSession' SOAP Action to close the session on the server Returns the SOAP response Hash | def finalize_session
@soap_client.call :finalize_session,
message: { 'wsdl:sessionID' => @session_id }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finalize_session\n @savon.call :finalize_session, \n message: { 'wsdl:sessionID' => @session_id }\n end",
"def session_close\n begin\n auth.globals[:headers]['Cookie'] = \"SID=\\\"#{session_id}\\\"\"\n auth.call(:close_session)\n rescue Savon::SOAPFaul... | [
"0.7693333",
"0.66729575",
"0.63352805",
"0.6327183",
"0.6279471",
"0.6266235",
"0.60532063",
"0.60104865",
"0.5952604",
"0.59095734",
"0.59029317",
"0.58727735",
"0.58134305",
"0.5778133",
"0.5756415",
"0.5742522",
"0.5734387",
"0.5711704",
"0.5682101",
"0.5673438",
"0.56632... | 0.804677 | 0 |
Private: Checks if the session expiry time has passed Returns a Boolean | def session_valid?
@session_expiry_time > Time.now if @session_expiry_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def session_valid?\n @session_expiry_time > Time.now if @session_expiry_time\n end",
"def session_expired?\n ! (Time.now < session[:expire_at])\n end",
"def session_expiry\n reset_session if session[:expiry_time] and session[:expiry_time] < Time.now\n\n session[:expiry_time] = MAX_SESSION... | [
"0.86505353",
"0.85043937",
"0.8485214",
"0.8311907",
"0.82619697",
"0.8126619",
"0.8094892",
"0.79293305",
"0.7837234",
"0.76900136",
"0.7659409",
"0.7656007",
"0.7643836",
"0.76387304",
"0.7625968",
"0.7625725",
"0.76202387",
"0.7606185",
"0.7589389",
"0.7589389",
"0.758164... | 0.87361157 | 0 |
POST Insert a recipe into database | def create
recipe = Recipe.new(recipe_params)
ingredients = params[:ingredients]
tags = params[:tags]
if recipe.save
if !ingredients.blank?
redirect_to api_v1_recipe_ingredients_url(recipe_id: recipe.id, ingredients: ingredients, tags: tags)
end
else
render json: {status: '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_to_database(recipe)\n\t\t# Parsing the recipe line\n\t\trecipe_db = Recipe.new(\n\t\t\ttitle: recipe[\"recipe\"][\"label\"].to_s,\n\t\t\timage: recipe[\"recipe\"][\"image\"].to_s,\n\t\t\tdescription: recipe[\"recipe\"][\"source\"].to_s,\n\t\t\tuser_id: 1\n\t\t\t)\n\t\trecipe_db.save\n\t\tputs recipe_db.err... | [
"0.7185456",
"0.7101061",
"0.6979252",
"0.69508606",
"0.6928764",
"0.6927354",
"0.6881012",
"0.6867003",
"0.6865066",
"0.6865066",
"0.68584985",
"0.68214303",
"0.6821267",
"0.6809772",
"0.6805596",
"0.68010354",
"0.6773487",
"0.6770138",
"0.6770138",
"0.6766609",
"0.6766609",... | 0.6868256 | 7 |
PUT Update a recipe | def update
recipe = Recipe.find(params[:id])
ingredients = params[:ingredients]
tags = params[:tags]
if recipe.update_attributes(recipe_params)
if !ingredients.blank?
create_ingredient(recipe.id, ingredients)
end
if !tags.blank?
create_tag(recipe.id, tags)
end
ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n recipe.update(recipe_params)\n render json: recipe\n end",
"def update\n begin\n recipe = Recipe.find(params[:id])\n\n if recipe.update_attributes(recipe_params)\n render json: { status: 'SUCCESS', message: ... | [
"0.7986835",
"0.7787209",
"0.7759118",
"0.7708554",
"0.7708554",
"0.7708554",
"0.7708554",
"0.7666214",
"0.76061326",
"0.7593023",
"0.7512663",
"0.7501544",
"0.7500968",
"0.749247",
"0.74263895",
"0.73934853",
"0.73583627",
"0.73563975",
"0.73563975",
"0.73563975",
"0.7356397... | 0.7322927 | 31 |
DELETE Delete a recipe | def destroy
recipe = get_recipe_by_id(params[:id])
recipe.destroy
render json: {status: 'SUCCESS', message: 'Deleted recipe', data: recipe}, status: :ok
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recipe_delete # /v1/user/:id/recipes/:recipe_id (DELETE)\n params[:recipes] = params[:recipe_id]\n recipes_delete\n end",
"def destroy\n @recipe.destroy\n \n end",
"def delete_recipe(db,id)\n q = \"DELETE FROM recipes WHERE id=#{id};\"\n return db.execute(q)\nend",
"def destroy\n ... | [
"0.7812475",
"0.7748599",
"0.76796347",
"0.7678332",
"0.76510775",
"0.75723743",
"0.7421934",
"0.73956734",
"0.7338554",
"0.73118776",
"0.7233323",
"0.7207767",
"0.71821624",
"0.7179116",
"0.71674055",
"0.70404935",
"0.70272976",
"0.70272976",
"0.70041955",
"0.70041955",
"0.6... | 0.7586587 | 5 |
Create the ingredients for the recipe recipe_id: id of the recipe ingredients: list of ingredients for a recipe | def create_ingredient(recipe_id, ingredients)
destroy_ingredients = RecipeIngredient.where(recipe_id: recipe_id)
if !destroy_ingredients.blank?
destroy_ingredients.delete_all
end
ingredients.each do |recipe_ingredient|
ingredient = RecipeIngredient.new
ingredient.recipe_id = recipe_id
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @recipe = Recipe.new(recipe_params)\n if params['ingredients']\n params['ingredients'].each do |ingredient_name|\n @recipe.ingredients << Ingredient.find_by(name: ingredient_name)\n end\n end\n\n @recipe.save \n redirect_to recipes_path\n end",
"def create_ingredient... | [
"0.78298724",
"0.7707803",
"0.76807326",
"0.7543995",
"0.7475863",
"0.74117917",
"0.7281296",
"0.72451466",
"0.71976566",
"0.7173304",
"0.712313",
"0.70645636",
"0.70533687",
"0.70269895",
"0.70242923",
"0.7013806",
"0.6969493",
"0.69605935",
"0.6952212",
"0.6933721",
"0.6919... | 0.83935195 | 0 |
Create the tags for the recipe recipe_id: id of the recipe tags: list of tags for a recipe | def create_tag(recipe_id, tags)
destroy_tags = RecipeTag.where(recipe_id: recipe_id)
if !destroy_tags.blank?
destroy_tags.delete_all
end
tags.each do |recipe_tag|
tag = RecipeTag.new
tag.recipe_id = recipe_id
tag.tag = recipe_tag
tag.save!
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n \tset_tag_list\n\n @recipe = @current_user.recipes.build(params[:recipe])\n @recipe.status = @recipe.get_status\n item_client_ip(@recipe)\n # @recipe.is_draft = params[:is_draft]\n # @recipe.is_draft = @recipe.get_is_draft\n # @recipe.published_at = @recipe.get_published_at\n \n ... | [
"0.6504265",
"0.64722246",
"0.6460168",
"0.6329924",
"0.6221021",
"0.6200165",
"0.61626905",
"0.615402",
"0.600268",
"0.59847164",
"0.5966246",
"0.5955774",
"0.5938593",
"0.5935551",
"0.5929505",
"0.5904022",
"0.586058",
"0.5853507",
"0.58348316",
"0.5789006",
"0.5770832",
... | 0.7807949 | 0 |
Find all recipes matching the parameters recipe_name: name of the recipe recipe_tag: a single tag for a recipe recipe_ingredients: list of ingredients | def get_recipes(recipe_name, recipe_tag, recipe_ingredients)
recipes_ids = Set.new
ingredients_upcase = Set.new
#search by
case
when !recipe_name.blank?
recipes_ids = Recipe.where('UPPER(name) LIKE UPPER(?)', "%#{recipe_name}%").pluck(:id)
when !recipe_tag.blank?
recipes_ids = RecipeTa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recipeingredientsearch\n @query = params[:search]\n @searchedingredients = params[:searchingredients].split(/, */)\n @searchtest = []\n @searchedingredients.each do |si|\n @searchtest.push(si.downcase)\n end\n \n Ingredient.where(\"lower(name) IN (:searching)\", \n {searching: ... | [
"0.70910263",
"0.70052564",
"0.69439673",
"0.6929965",
"0.69144803",
"0.68493646",
"0.6845398",
"0.67759395",
"0.6760274",
"0.67585033",
"0.67170596",
"0.6716653",
"0.6709615",
"0.667991",
"0.6667788",
"0.6638084",
"0.66001487",
"0.6578361",
"0.6520817",
"0.6519832",
"0.64928... | 0.7930081 | 0 |
Get a single recipe matching the parameter recipe_id: id of a recipe | def get_recipe_by_id(recipe_id)
recipe = Recipe.find_by(id: recipe_id)
recipe.tags = RecipeTag.where('recipe_id = ?', recipe.id).pluck(:tag)
recipe.ingredients = RecipeIngredient.where('recipe_id = ?', recipe.id).pluck(:ingredient)
return recipe
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_recipe\n @recipe = Recipe.find(params[:id])\n end",
"def show\n recipe_id = params[:id].to_i\n @recipe = Recipe.find(recipe_id)\n end",
"def find_recipe\n @recipe = Recipe.find(params[:id])\n end",
"def show(id) \n response = request(:get, \"/recipes/#{id}.json\")\n... | [
"0.79550666",
"0.7885108",
"0.7807008",
"0.76749164",
"0.76105464",
"0.7425577",
"0.74107885",
"0.72413427",
"0.7228666",
"0.7206796",
"0.71995807",
"0.71215147",
"0.7114356",
"0.71129227",
"0.71129227",
"0.71129227",
"0.71129227",
"0.71129227",
"0.71129227",
"0.71129227",
"0... | 0.7541437 | 5 |
GET /knowledges GET /knowledges.json | def index
if(current_user.profile.nil?)
redirect_to new_profile_path,
notice: "You need first to fill your profile ;)."
else
@knowledges = current_user.profile.knowledges.all
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end",
"def index\n @knowledges = Knowledge.all\n end",
"def new\n @knowledge = current_user.knowledges.new\n\n ... | [
"0.6894962",
"0.6482017",
"0.61019754",
"0.5879565",
"0.58354855",
"0.5797021",
"0.55280095",
"0.5476968",
"0.5464409",
"0.54550433",
"0.5425189",
"0.53943545",
"0.5381064",
"0.5370014",
"0.5312618",
"0.52783513",
"0.52783513",
"0.52783513",
"0.5245175",
"0.52289784",
"0.5228... | 0.59176093 | 3 |
GET /knowledges/1 GET /knowledges/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end",
"def index\n @knowledges = Knowledge.all\n end",
"def new\n @knowledge = current_user.knowledges.new\n\n ... | [
"0.6900761",
"0.6428908",
"0.63948995",
"0.5739901",
"0.5731566",
"0.5699565",
"0.5694085",
"0.5602825",
"0.53821665",
"0.5352143",
"0.5305461",
"0.53009176",
"0.5265316",
"0.5259351",
"0.52504337",
"0.52504337",
"0.52504337",
"0.5231967",
"0.5231337",
"0.51865196",
"0.517362... | 0.0 | -1 |
POST /knowledges POST /knowledges.json | def create
@knowledge = Knowledge.new(knowledge_params)
@knowledge.profile = current_user.profile
respond_to do |format|
if @knowledge.save
format.html { redirect_to knowledges_path, notice: 'Knowledge was successfully created.' }
format.json { render action: 'show', status: :created,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @knowledge = current_user.knowledges.new(params[:knowledge])\n\n respond_to do |format|\n if @knowledge.save\n format.html { redirect_to @knowledge, notice: 'Knowledge was successfully created.' }\n format.json { render json: @knowledge, status: :created, location: @knowledge ... | [
"0.60486805",
"0.5869254",
"0.56131476",
"0.55864567",
"0.5460759",
"0.54190147",
"0.5368599",
"0.52017134",
"0.5134812",
"0.5105741",
"0.5099558",
"0.50881994",
"0.50741667",
"0.50425446",
"0.50265867",
"0.50206363",
"0.5018448",
"0.5002765",
"0.49906895",
"0.4978807",
"0.49... | 0.0 | -1 |
PATCH/PUT /knowledges/1 PATCH/PUT /knowledges/1.json | def update
respond_to do |format|
if @knowledge.update(knowledge_params)
format.html { redirect_to knowledges_path, notice: 'Knowledge was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @know... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @knowledge = current_user.knowledges.find(params[:id])\n\n respond_to do |format|\n if @knowledge.update_attributes(params[:knowledge])\n format.html { redirect_to @knowledge, notice: 'Knowledge was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.6237848",
"0.5796376",
"0.572529",
"0.5679823",
"0.56785727",
"0.56472677",
"0.5646884",
"0.5627597",
"0.5605231",
"0.5598421",
"0.5583601",
"0.5547218",
"0.554358",
"0.55402416",
"0.55396783",
"0.5535727",
"0.5521551",
"0.5514551",
"0.5512269",
"0.55005026",
"0.55005026",... | 0.0 | -1 |
DELETE /knowledges/1 DELETE /knowledges/1.json | def destroy
@knowledge.destroy
respond_to do |format|
format.html { redirect_to knowledges_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @knowledge = current_user.knowledges.find(params[:id])\n @knowledge.destroy\n\n respond_to do |format|\n format.html { redirect_to knowledges_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @in... | [
"0.71543026",
"0.6475935",
"0.64649564",
"0.6419162",
"0.64101493",
"0.64013314",
"0.63922596",
"0.6386774",
"0.63782674",
"0.63745177",
"0.63665164",
"0.6356153",
"0.63523823",
"0.63523823",
"0.6334917",
"0.6330435",
"0.63227755",
"0.6317183",
"0.629697",
"0.629453",
"0.6275... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_knowledge
@knowledge = Knowledge.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 knowledge_params
params.require(:knowledge).permit(:name, :desc)
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 |
Instantiates a new accessPackageResourceRoleScope and sets the default values. | def initialize()
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_role_scopes=(value)\n @resource_role_scopes = value\n end",
"def init\n self.role ||= \"standard\" #will set the default value only if it's nil\n end",
"def initialize(role, &blk)\n @role, @policies, @scopes = role, {}, {}\n instance_eval(&blk) if ... | [
"0.57594454",
"0.5284224",
"0.5265433",
"0.5224826",
"0.5126986",
"0.5101388",
"0.50970745",
"0.49880448",
"0.496245",
"0.49465865",
"0.48914415",
"0.4870479",
"0.48666537",
"0.4846254",
"0.4802115",
"0.47951952",
"0.47951952",
"0.47951952",
"0.47951952",
"0.47883323",
"0.478... | 0.0 | -1 |
Gets the createdDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z | def created_date_time
return @created_date_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_date_time_utc\n return @created_date_time_utc\n end",
"def created_date_time\n return @created_date_time\n end",
"def created_at_timestamp\n Time.now.gmtime.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end",
"def timestamp\n self.created_at.to... | [
"0.7632163",
"0.7629736",
"0.7564724",
"0.747261",
"0.74667794",
"0.7427643",
"0.7340075",
"0.7340075",
"0.73321664",
"0.7329063",
"0.72721404",
"0.7224356",
"0.7213787",
"0.71779525",
"0.71779525",
"0.7156535",
"0.7149605",
"0.71494406",
"0.7144883",
"0.7130442",
"0.7130442"... | 0.7664124 | 18 |
Sets the createdDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z | def created_date_time=(value)
@created_date_time = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_date_time=(createdDateTime)\n @created_date_time = createdDateTime\n end",
"def created_date_time_utc=(value)\n @created_date_time_utc = value\n end",
"def created_at=(value)\n @created_at = DateTime.parse(value)\n end",
"def create_timestamp\n... | [
"0.7829137",
"0.75813115",
"0.721586",
"0.71146333",
"0.71145517",
"0.6998485",
"0.6927011",
"0.6865355",
"0.68208086",
"0.68208086",
"0.65876204",
"0.6540059",
"0.64710087",
"0.64651",
"0.6439961",
"0.6432874",
"0.6432863",
"0.6432863",
"0.6432863",
"0.6432863",
"0.6432863",... | 0.7733337 | 20 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
"role" => lambda {|n| @role = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AccessPackageResourceRole.create_from_discrimi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },... | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.612005... | 0.0 | -1 |
Gets the role property value. The role property | def role
return @role
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role\n @role\n end",
"def get_role\n\t\tself.role\n\tend",
"def role\r\n r = read_attribute(:role)\r\n r.capitalize unless r.nil?\r\n end",
"def get_role\n return case self.role_id\n when 2\n \"User\"\n else\n \"N/A\"\n end\n end... | [
"0.8208447",
"0.81522584",
"0.78307474",
"0.77477396",
"0.7668824",
"0.763459",
"0.74447405",
"0.74383163",
"0.74054605",
"0.7371139",
"0.7263034",
"0.7184341",
"0.7184341",
"0.7183879",
"0.7175226",
"0.71302915",
"0.7122539",
"0.7122539",
"0.706573",
"0.7042955",
"0.7023937"... | 0.84608644 | 0 |
Sets the role property value. The role property | def role=(value)
@role = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_role\n @role = role\n end",
"def role= val\n write_attribute(:role, val.to_s)\n end",
"def role= val\n write_attribute(:role, val.to_s)\n end",
"def role= new_role\n @role = String new_role\n end",
"def set_Role(value)\n set_input(\"Role\", value)\n end",... | [
"0.861649",
"0.8046014",
"0.8046014",
"0.796943",
"0.79629016",
"0.7945792",
"0.78999215",
"0.78999215",
"0.7875896",
"0.7750461",
"0.7684081",
"0.7671929",
"0.7653162",
"0.7516295",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
... | 0.87294894 | 0 |
Gets the scope property value. The scope property | def scope
return @scope
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scope_value\n return unless position_scope_attr\n send(position_scope_attr)\n end",
"def scope\n @attributes[:scope]\n end",
"def scope\n read_attr :scope, :to_sym\n end",
"def scope\n parameter[:scope]\n end",
"def scope\n @scope\n end",
"def ... | [
"0.76529604",
"0.7231924",
"0.7132736",
"0.71291715",
"0.70269835",
"0.70269835",
"0.6714944",
"0.66890556",
"0.66710365",
"0.66449",
"0.663996",
"0.6462612",
"0.6291019",
"0.6286597",
"0.6268645",
"0.62028855",
"0.612111",
"0.6105797",
"0.6105797",
"0.6105797",
"0.6105797",
... | 0.73586154 | 6 |
Sets the scope property value. The scope property | def scope=(value)
@scope = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scope=(val)\n set_scope(val)\n val\n end",
"def set_Scope(value)\n set_input(\"Scope\", value)\n end",
"def set_Scope(value)\n set_input(\"Scope\", value)\n end",
"def set_Scope(value)\n set_input(\"Scope\", value)\n end",
"def set_Scope(valu... | [
"0.8007941",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.777591",
"0.77737504",
"0.77737504",
"0.76533264",
"0.73469883",
"0.7148777",
"0.7148777",
"0.7084341",
"0.7084341",
"0.672913",
"0.669826... | 0.82731503 | 5 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_date_time_value("createdDateTime", @created_date_time)
writer.write_object_value("role", @role)
writer.write_object_value("scope", @scope)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.794954",
"0.7644408",
"0.75776637",
"0.75776637",
"0.7438072",
"0.72067255",
"0.72067255",
"0.7206416",
"0.7015435",
"0.69990283",
"0.6991208",
"0.6981951",
"0.6970214",
"0.69652086",
"0.69652086",
"0.6942139",
"0.6939684",
"0.69322175",
"0.69122285",
"0.68901",
"0.6879095... | 0.0 | -1 |
Return the date when the folder was last updated | def last_updated
updated_at
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_modified\n stat.mtime\n end",
"def last_edited\n\t\tself.latest_update.to_date\n\tend",
"def last_edited\n self.latest_update.to_date\n end",
"def last_updated\n f = Folder.where(:id => params['id']).first\n render json: f.nil? ? \"unknown\" : f.updated_at\n end",
"def last_upda... | [
"0.75223345",
"0.7472307",
"0.7438879",
"0.74246",
"0.7423659",
"0.7398121",
"0.7366014",
"0.7242574",
"0.7242574",
"0.7242574",
"0.7242574",
"0.72367316",
"0.72367316",
"0.72367316",
"0.72367316",
"0.7219034",
"0.7113856",
"0.710986",
"0.70554984",
"0.7042453",
"0.70423234",... | 0.70330036 | 34 |
Return the number of files in the folder (nonrecursive) | def number_of_files
assets.length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_count\n return unless exists?\n Dir.glob(folder_pathname.join(\"**\")).count do |file|\n File.file?(file)\n end\n end",
"def get_count(path)\n file = scope.get(path)\n InvalidPath.raise! {!file}\n return 0 if !file.is_dir\n file.files_count\n end",
"def dir_file_c... | [
"0.85770965",
"0.80287963",
"0.80157185",
"0.78351307",
"0.7808689",
"0.77524316",
"0.77524316",
"0.77011675",
"0.75714916",
"0.7502841",
"0.74982953",
"0.74948597",
"0.74729097",
"0.73686343",
"0.7363276",
"0.7212741",
"0.70857286",
"0.7082247",
"0.70731115",
"0.69482607",
"... | 0.6518612 | 37 |
Checks to see if the folder is a 'root' or home folder | def is_root?
root == id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_root?()\n @rootpath == @path\n end",
"def is_root?\n @path == '/' || @path == ''\n end",
"def root?\n \tfolder_id.nil?\n end",
"def root?(path)\n \n root_objects = [\"gemfile\", \"procfile\", \"readme\"]\n current_objects = Dir[path + \"/*\"].map do |file|\n File.ba... | [
"0.7635429",
"0.7603582",
"0.7402844",
"0.72816133",
"0.7264885",
"0.71866584",
"0.70869243",
"0.70226663",
"0.70019364",
"0.6995364",
"0.6962513",
"0.6954728",
"0.6926277",
"0.68727416",
"0.68653464",
"0.6791847",
"0.67270875",
"0.67032766",
"0.66695434",
"0.6658272",
"0.665... | 0.0 | -1 |
Checks if the folder is shared | def shared?
!self.shared_folders.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shared? \n \t!self.shared_folders.empty? \n\tend",
"def has_share_access?(folder)\n return false if folder.nil?\n return true if self.folders.include?(folder)\n return true if self.shared_folders_by_others.include?(folder)\n \n unless folder.nil?\n folder.ancestors.each do |ancestor_... | [
"0.84485424",
"0.78783685",
"0.7725481",
"0.76962864",
"0.76598984",
"0.7588193",
"0.73082435",
"0.72057045",
"0.71458274",
"0.71205026",
"0.7097011",
"0.6978434",
"0.6955756",
"0.68979573",
"0.6827829",
"0.6822201",
"0.6806507",
"0.67288357",
"0.6699674",
"0.6632166",
"0.661... | 0.8503409 | 0 |
Checks if the folder is public | def public?
!self.public_folders.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private?\n self.public_folders.empty?\n end",
"def is_public?\n is_public == true && requires_login == false\n end",
"def root_public?\n self.root.public?\n end",
"def is_public?\n @status == \"public\"\n end",
"def is_public?\n @status == \"public\"\n en... | [
"0.81339365",
"0.7830179",
"0.770985",
"0.75022835",
"0.75022835",
"0.7498561",
"0.74536574",
"0.743142",
"0.7347058",
"0.732532",
"0.7320422",
"0.7311843",
"0.73076993",
"0.7279272",
"0.72162926",
"0.7105144",
"0.70732546",
"0.70480096",
"0.69759923",
"0.6965689",
"0.6963718... | 0.8432387 | 0 |
Checks to see if the folder is private. (not public) | def private?
self.public_folders.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_private?\n ! is_public?\n end",
"def is_private?\n ! is_public?\n end",
"def public?\n !self.public_folders.empty?\n end",
"def root_private?\n self.root.private?\n end",
"def is_private?\n is_public == false || (is_public == false && requires_subscription ==... | [
"0.73256844",
"0.73256844",
"0.725405",
"0.72359383",
"0.7198773",
"0.7038912",
"0.70309997",
"0.69863147",
"0.69767743",
"0.6966052",
"0.678988",
"0.67898464",
"0.67678964",
"0.6761252",
"0.6729177",
"0.6721514",
"0.6721514",
"0.6702083",
"0.6671887",
"0.6654216",
"0.6631700... | 0.8238323 | 0 |
Is the root folder public? | def root_public?
self.root.public?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_public_root?\n false\n end",
"def public?\n !self.public_folders.empty?\n end",
"def private?\n self.public_folders.empty?\n end",
"def root_private?\n self.root.private?\n end",
"def root?\n is_root?(@path)\n end",
"def is_root?()\n @rootpath == @path\n end",
"def ro... | [
"0.8766247",
"0.8121792",
"0.77916783",
"0.7780392",
"0.75076646",
"0.74951524",
"0.7491971",
"0.74848545",
"0.7470077",
"0.74284256",
"0.7405733",
"0.73801637",
"0.73181605",
"0.72479516",
"0.7112154",
"0.7112154",
"0.7102775",
"0.7100188",
"0.70814687",
"0.7055447",
"0.7049... | 0.8915485 | 0 |
Is the root folder private? | def root_private?
self.root.private?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_public_root?\n false\n end",
"def root_public?\n self.root.public?\n end",
"def private?\n self.public_folders.empty?\n end",
"def is_root?()\n @rootpath == @path\n end",
"def root?\n \tfolder_id.nil?\n end",
"def public?\n !self.public_folders.empty?\n end",
"def root?... | [
"0.81862265",
"0.8099162",
"0.7788598",
"0.7372862",
"0.7259929",
"0.718087",
"0.7054533",
"0.69742143",
"0.68834984",
"0.68371654",
"0.6778444",
"0.6753355",
"0.6752832",
"0.6751803",
"0.67372376",
"0.6725696",
"0.6725696",
"0.669453",
"0.66662127",
"0.66474575",
"0.6644184"... | 0.85230035 | 0 |
Gather a list of all the email adresses that the folder is shared with | def to_shared_emails
#shared_to = SharedFolder.select("shared_email").find(:all, :conditions => ["folder_id = ?",id])
email_addresses = Array.new
shared_folders.each do |folder|
email_addresses.push(folder.shared_email)
end
email_addresses
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_attendees()\n\t\turl = request.referrer.split(\"/\")\t# Get the URL of where the request CAME from, not the url that was requested.\n redis_key = url[-1].to_s + \":\" + url[-2].to_s + \":emails\";\n\t\tattendees = $redis.lrange(redis_key,0,-1)\n\t\tattendees.uniq!\n\t\tlogger.error \"@@@@@@@@@@@@ AT... | [
"0.6385268",
"0.63238657",
"0.62550944",
"0.61532986",
"0.61196524",
"0.6103077",
"0.6078206",
"0.60718364",
"0.6052476",
"0.5974436",
"0.5963796",
"0.5943543",
"0.5941283",
"0.5931614",
"0.59308434",
"0.58817184",
"0.5877269",
"0.5874378",
"0.5814281",
"0.5814281",
"0.580010... | 0.7708128 | 0 |
Calculates the total size of all assets in the current folder and subfolders (recursive) | def total_size
self._total_size(self, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _total_size(folder, size)\n folder.assets.each do |a|\n size = size + a.file_size\n end\n folder.children.each do |f|\n size = _total_size(f,size)\n end\n return size\n end",
"def calculate_tree_size(folder)\n\t\ttotal_size = 0\n\t\t@files.each do |name, size|\n\t\t\tbegin\n\t\t\t\t... | [
"0.829445",
"0.72857094",
"0.7185559",
"0.7073568",
"0.69653904",
"0.6935364",
"0.6879986",
"0.68090516",
"0.6802159",
"0.6644254",
"0.6644246",
"0.6589682",
"0.64592",
"0.64574033",
"0.6390974",
"0.6340066",
"0.633595",
"0.6335036",
"0.6314683",
"0.62634754",
"0.62321705",
... | 0.61649466 | 23 |
Creates a zip file and saves the location and creation time if the zip file location hasn't been saved or the contents of the folder has changed. (needs to be recursive) | def zip
if !FileTest::directory?("/mnt/filebox/assets/zipfile_repository")
Dir::mkdir("/mnt/filebox/assets/zipfile_repository")
end
if self.zipped_file.nil? or !File.file?(self.zipped_file)
logger.info("[ZIP] Creating zipfile for #{self.name}")
self.zipped_file = "/mnt/filebox/assets/zipfi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assure_created_zip\n FileCreator::createNewZip(self)\n raise \"No file created\" unless File.exists? zip_path\n end",
"def create_zip\n require 'zip'\n zip_files = [self.ground_truth, self.image_sequence, self.config_file]\n if self.acceptable_segmentation_region.present?\n ... | [
"0.7239472",
"0.70792025",
"0.7024762",
"0.68274707",
"0.67925406",
"0.6727761",
"0.66748667",
"0.6664948",
"0.6545483",
"0.64875376",
"0.6445687",
"0.6422431",
"0.63944566",
"0.63851357",
"0.63158125",
"0.63017666",
"0.62593544",
"0.62373346",
"0.621697",
"0.6214626",
"0.620... | 0.74767613 | 0 |
Helper for the total size method which recursively calculates the size | def _total_size(folder, size)
folder.assets.each do |a|
size = size + a.file_size
end
folder.children.each do |f|
size = _total_size(f,size)
end
return size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size\n children_size + my_size\n end",
"def total_size\n return @total_size if @total_size\n if @structure.instance_of? Array\n return 0 if @structure.empty?\n @total_size = strip(:size).flatten.inject { |sum, i| sum + i }\n else\n @total_size = size\n end\n ... | [
"0.7724895",
"0.76796305",
"0.7535288",
"0.74847823",
"0.7309639",
"0.6985883",
"0.695644",
"0.69502586",
"0.69502586",
"0.69447035",
"0.68877506",
"0.68877506",
"0.68877506",
"0.68877506",
"0.68877506",
"0.68877506",
"0.6882301",
"0.68258035",
"0.67993736",
"0.6797387",
"0.6... | 0.69120634 | 10 |
Helper for the zip method which creates the zip stream and calls the zip decender | def _zip
Zip::ZipFile.open(self.zipped_file, Zip::ZipFile::CREATE) do |z|
self._zip_decender(z,self,nil)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zip\n end",
"def zip\n end",
"def zip_contents; end",
"def zip\n @zip\n end",
"def export_zip\n stringio = Zip::ZipOutputStream::write_buffer do |zip|\n @zip = zip\n export\n end\n @zip = nil\n stringio.rewind\n stringio.sysread\n ... | [
"0.7783591",
"0.77181405",
"0.74728733",
"0.74325013",
"0.7145656",
"0.7026272",
"0.69303775",
"0.6875973",
"0.6838081",
"0.6752139",
"0.67381424",
"0.6706411",
"0.6667544",
"0.665464",
"0.6574031",
"0.65219456",
"0.6328092",
"0.6303474",
"0.62976485",
"0.6291506",
"0.6291268... | 0.77858925 | 0 |
Adds folder assets to the zip object and decends into the subfolders recursively adding their assets as well. | def _zip_decender(zipstream, folder, path)
if path.nil?
path = folder.name
else
path = path + "/" + folder.name
end
zipstream.dir.mkdir(path)
folder.assets.each do |a|
logger.info("[ZIP] Adding #{a.file_name} in #{a.uploaded_file.path}")
zipstream.add("#{path}/#{a.file_n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_files(zip)\n ZipFileGenerator.new(@manifest.base_dir, zip).write\n end",
"def run\n assets.each do |asset|\n next if ::File.directory?(asset)\n\n compress(asset)\n checksum(asset)\n end\n\n generate_manifest\n end",
"def recursively_deflate_direc... | [
"0.61086947",
"0.61060435",
"0.6061464",
"0.6007731",
"0.5917812",
"0.5841199",
"0.58001417",
"0.57991195",
"0.5763088",
"0.57603323",
"0.5631786",
"0.5612169",
"0.55973023",
"0.55808145",
"0.5574935",
"0.557355",
"0.55668014",
"0.55497897",
"0.553511",
"0.5532653",
"0.551064... | 0.72780645 | 0 |
GET /invoicestatuses GET /invoicestatuses.json | def index
@invoicestatuses = Invoicestatus.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @inciting_incidents = IncitingIncident.all\n render json: @inciting_incidents\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def index\n @innings... | [
"0.65578556",
"0.63009167",
"0.6275538",
"0.6230005",
"0.62188435",
"0.6171505",
"0.6164612",
"0.6161942",
"0.61527795",
"0.61527795",
"0.61527795",
"0.6145688",
"0.6145688",
"0.6132998",
"0.61025727",
"0.60914516",
"0.6090144",
"0.6076337",
"0.6063787",
"0.6033189",
"0.60184... | 0.6782847 | 0 |
GET /invoicestatuses/1 GET /invoicestatuses/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @getinvoicedatum = Getinvoicedatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @getinvoicedatum }\n end\n end",
"def index\r\n @invoicestatuses = Invoicestatus.all\r\n end",
"def show\n @incident = Incident.find(p... | [
"0.6418771",
"0.64007735",
"0.6248861",
"0.6207175",
"0.6099403",
"0.6074286",
"0.60462457",
"0.603139",
"0.6030851",
"0.5952416",
"0.5917502",
"0.5883167",
"0.587179",
"0.58583546",
"0.5857878",
"0.58458143",
"0.58402264",
"0.5834518",
"0.5822731",
"0.58219105",
"0.5820174",... | 0.0 | -1 |
POST /invoicestatuses POST /invoicestatuses.json | def create
@invoicestatus = Invoicestatus.new(invoicestatus_params)
respond_to do |format|
if @invoicestatus.save
format.html { redirect_to @invoicestatus, notice: 'Invoicestatus was successfully created.' }
format.json { render :show, status: :created, location: @invoicestatus }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :d... | [
"0.60714495",
"0.57937217",
"0.56855226",
"0.5667705",
"0.56533545",
"0.56297797",
"0.5615217",
"0.55532086",
"0.554624",
"0.55319613",
"0.55209357",
"0.5518754",
"0.5471253",
"0.54645765",
"0.54598886",
"0.5454074",
"0.5452175",
"0.54164785",
"0.54004",
"0.53930575",
"0.5385... | 0.56026596 | 7 |
PATCH/PUT /invoicestatuses/1 PATCH/PUT /invoicestatuses/1.json | def update
respond_to do |format|
if @invoicestatus.update(invoicestatus_params)
format.html { redirect_to @invoicestatus, notice: 'Invoicestatus was successfully updated.' }
format.json { render :show, status: :ok, location: @invoicestatus }
else
format.html { render :edit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @getinvoicedatum = Getinvoicedatum.find(params[:id])\n\n respond_to do |format|\n if @getinvoicedatum.update_attributes(params[:getinvoicedatum])\n format.html { redirect_to @getinvoicedatum, notice: 'Getinvoicedatum was successfully updated.' }\n format.json { head :no_conten... | [
"0.61235374",
"0.6058475",
"0.6037367",
"0.6036165",
"0.5956195",
"0.5919987",
"0.59000033",
"0.5894517",
"0.58738905",
"0.58600837",
"0.5836637",
"0.58305115",
"0.5830134",
"0.5823538",
"0.5724849",
"0.57216066",
"0.5706353",
"0.5704588",
"0.5685766",
"0.5683967",
"0.5672568... | 0.56091034 | 28 |
DELETE /invoicestatuses/1 DELETE /invoicestatuses/1.json | def destroy
@invoicestatus.destroy
respond_to do |format|
format.html { redirect_to invoicestatuses_url, notice: 'Invoicestatus was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @invoiceline = Invoiceline.find(params[:id])\n @invoiceline.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoicelines_url) }\n format.xml { head :ok }\n end\n end",
"def test_del\n header 'Content... | [
"0.728172",
"0.6891373",
"0.68901175",
"0.6854118",
"0.6853808",
"0.68381846",
"0.682847",
"0.68215257",
"0.68105596",
"0.6803928",
"0.67883587",
"0.67413354",
"0.6728785",
"0.6708859",
"0.669687",
"0.66847605",
"0.66847605",
"0.66743076",
"0.66743076",
"0.66743076",
"0.66743... | 0.68752426 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_invoicestatus
@invoicestatus = Invoicestatus.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6162554",
"0.60452986",
"0.5945278",
"0.59169763",
"0.58877826",
"0.5834763",
"0.5775349",
"0.5704972",
"0.5704972",
"0.56543803",
"0.5621491",
"0.5427202",
"0.54093206",
"0.54093206",
"0.54093206",
"0.53975695",
"0.53776276",
"0.53562194",
"0.5340594",
"0.5337824",
"0.532... | 0.0 | -1 |
Only allow a list of trusted parameters through. | def invoicestatus_params
params.require(:invoicestatus).permit(:invoicestatus)
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 |
GET /people_terms GET /people_terms.json | def index
@people_terms = PeopleTerm.where(["person_id = ?", params[:person_id]]).includes(:term).order("terms.start_date")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terms\n @api_v1_pages = Api::V1::Page.where('title = \"terms\"').first\n\n render json: @api_v1_pages\n end",
"def get_terms(params)\n send_get \"get_terms\", params\n end",
"def people(term, params = {})\n args = '&' + paramify(params) unless params.empty?\n get(\"/catalog/peo... | [
"0.74198216",
"0.7407318",
"0.72203463",
"0.6823552",
"0.6808383",
"0.67874205",
"0.66972584",
"0.66972584",
"0.6629937",
"0.6517631",
"0.63403815",
"0.6292339",
"0.6215613",
"0.6193557",
"0.6173762",
"0.6170125",
"0.6159998",
"0.61411494",
"0.61262155",
"0.6075106",
"0.60662... | 0.6617918 | 9 |
GET /people_terms/1 GET /people_terms/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terms\n @api_v1_pages = Api::V1::Page.where('title = \"terms\"').first\n\n render json: @api_v1_pages\n end",
"def people(term, params = {})\n args = '&' + paramify(params) unless params.empty?\n get(\"/catalog/people?term=#{term}#{args}\")\n end",
"def get_terms(params)\n send_g... | [
"0.75297713",
"0.69020295",
"0.682894",
"0.6803114",
"0.6532857",
"0.6385775",
"0.63797885",
"0.6341279",
"0.6336117",
"0.6296439",
"0.62776375",
"0.626525",
"0.626525",
"0.6250787",
"0.6203944",
"0.6170367",
"0.60844034",
"0.6066779",
"0.6060079",
"0.60503614",
"0.6045771",
... | 0.0 | -1 |
POST /people_terms POST /people_terms.json | def create
@people_term = PeopleTerm.new(people_term_params)
respond_to do |format|
if @people_term.save
format.html { redirect_to @people_term, notice: 'People term was successfully created.' }
format.json { render :show, status: :created, location: @people_term }
else
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_terms(params)\n send_get \"add_terms\", params\n end",
"def terms_post(opts = {})\n data, _status_code, _headers = terms_post_with_http_info(opts)\n data\n end",
"def people_term_params\n params.require(:people_term).permit(:person_id, :term_id)\n end",
"def create\n ... | [
"0.69485384",
"0.6921347",
"0.6721231",
"0.64618576",
"0.6352312",
"0.63122314",
"0.6297207",
"0.6260427",
"0.6260427",
"0.6209562",
"0.6202969",
"0.62014294",
"0.61632085",
"0.6136712",
"0.6092729",
"0.60720646",
"0.595872",
"0.5899768",
"0.5899185",
"0.5884864",
"0.58641624... | 0.72865486 | 0 |
PATCH/PUT /people_terms/1 PATCH/PUT /people_terms/1.json | def update
respond_to do |format|
if @people_term.update(people_term_params)
format.html { redirect_to @people_term, notice: 'People term was successfully updated.' }
format.json { render :show, status: :ok, location: @people_term }
else
format.html { render :edit }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @terms_of_use = TermsOfUse.find(params[:id])\n\n respond_to do |format|\n if @terms_of_use.update_attributes(params[:terms_of_use])\n format.html { redirect_to @terms_of_use, notice: 'Terms of use was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.6565607",
"0.64583135",
"0.6288723",
"0.6251702",
"0.62307066",
"0.6209012",
"0.6176027",
"0.6058723",
"0.6005997",
"0.5985005",
"0.59744",
"0.5972014",
"0.59538966",
"0.59447366",
"0.59418875",
"0.59028655",
"0.5897313",
"0.5893967",
"0.58514655",
"0.58477306",
"0.5840314... | 0.6949061 | 0 |
DELETE /people_terms/1 DELETE /people_terms/1.json | def destroy
@people_term.destroy
respond_to do |format|
format.html { redirect_to people_terms_url, notice: 'People term was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @go_term = GoTerm.find(params[:id])\n @go_term.destroy\n\n respond_to do |format|\n format.html { redirect_to go_terms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @privacy_term = PrivacyTerm.find(params[:id])\n @privacy_term.destroy\n\n resp... | [
"0.72060794",
"0.7056147",
"0.69761854",
"0.6898458",
"0.68279845",
"0.6753201",
"0.67426723",
"0.66773164",
"0.6667031",
"0.6649049",
"0.66417456",
"0.6623029",
"0.6619173",
"0.6609529",
"0.6605995",
"0.65991205",
"0.6588154",
"0.6583966",
"0.6578589",
"0.6578589",
"0.657858... | 0.7482181 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_people_term
@people_term = PeopleTerm.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 people_term_params
params.require(:people_term).permit(:person_id, :term_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69802505",
"0.6781974",
"0.67470175",
"0.67430073",
"0.67350477",
"0.6593221",
"0.6504263",
"0.64988977",
"0.6481794",
"0.64800006",
"0.64568025",
"0.64411247",
"0.6379476",
"0.63765615",
"0.6368045",
"0.6320141",
"0.6300363",
"0.6300057",
"0.62952244",
"0.6294712",
"0.629... | 0.0 | -1 |
GET /card_pages GET /card_pages.json | def index
@card_pages = CardPage.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @cards = Card.page(params[:page]).per(7)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end",
"def index\n @card = Card.paginate(:page => params[:page], :per_page => 15)\n end",
"def index\n @pages = Page.page param... | [
"0.7591505",
"0.71511203",
"0.7073391",
"0.69458234",
"0.69192123",
"0.6781108",
"0.6764483",
"0.673955",
"0.67163885",
"0.6691314",
"0.66805345",
"0.6664093",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66423315",
"0.6... | 0.77419126 | 0 |
GET /card_pages/1 GET /card_pages/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @card_pages = CardPage.all\n end",
"def index\n @cards = Card.page(params[:page]).per(7)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end",
"def show\n @page = @chapter.pages.find_by_number(params[:id])\n\n res... | [
"0.7601533",
"0.7405421",
"0.7089196",
"0.6946843",
"0.69207877",
"0.6890273",
"0.68581855",
"0.6810554",
"0.6810554",
"0.6810554",
"0.6810554",
"0.6810554",
"0.6810554",
"0.6810554",
"0.6762328",
"0.67246467",
"0.6713379",
"0.66996336",
"0.6680105",
"0.66674906",
"0.66328645... | 0.0 | -1 |
POST /card_pages POST /card_pages.json | def create
@card_page = CardPage.new(card_page_params)
respond_to do |format|
if @card_page.save
format.html { redirect_to @card_page, notice: 'Card page was successfully created.' }
format.json { render action: 'show', status: :created, location: @card_page }
else
format.ht... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @card_pages = CardPage.all\n end",
"def create\n @page = Page.new(page_params)\n\n if @page.save\n render json: @page, status: :created, location: @page\n else\n render json: @page.errors, status: :unprocessable_entity\n end\n end",
"def create\n #Each Page could be ... | [
"0.6703475",
"0.66446877",
"0.6527261",
"0.6402437",
"0.63296163",
"0.63077635",
"0.6211319",
"0.6204911",
"0.61955255",
"0.61908674",
"0.61885166",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6169322",
"0.6157733",
"0.6146727",
"0.6108626... | 0.736481 | 0 |
PATCH/PUT /card_pages/1 PATCH/PUT /card_pages/1.json | def update
respond_to do |format|
if @card_page.update(card_page_params)
format.html { redirect_to @card_page, notice: 'Card page was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @card_page... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n for... | [
"0.664527",
"0.65790606",
"0.65553373",
"0.65426314",
"0.6520077",
"0.650799",
"0.65025777",
"0.6496636",
"0.64962256",
"0.64962256",
"0.6493549",
"0.6491924",
"0.6478084",
"0.6478084",
"0.6450186",
"0.63840544",
"0.6378237",
"0.637506",
"0.637506",
"0.637506",
"0.6363867",
... | 0.7415093 | 0 |
DELETE /card_pages/1 DELETE /card_pages/1.json | def destroy
@card_page.destroy
respond_to do |format|
format.html { redirect_to card_pages_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @card.destroy\n\n head :no_content\n end",
"def destroy\n # @card = Card.destroy(params[:id])\n # render json: 200\n end",
"def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destr... | [
"0.7245162",
"0.72355306",
"0.723355",
"0.7231964",
"0.7225608",
"0.7199854",
"0.7173993",
"0.7173993",
"0.7173993",
"0.71704423",
"0.71704423",
"0.71704423",
"0.71704423",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",... | 0.8014684 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_card_page
@card_page = CardPage.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 card_page_params
params.require(:card_page).permit(:name, :link)
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 |
As a traveler, I'd like to visit a number towns while only driving a set number of miles, so that I don't fall asleep at the wheel. Scope number of towns will vary (k) number of miles will very (t) list of towns and miles between will be provided (ls) Acceptance Criteria return the number of miles to visit three towns ... | def choose_best_sum(miles, towns, list)
list.combination(towns)
.map { |path| path.inject(:+) }
.select { |sum| sum <= miles }
.max
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def game_trains\n trains = build_train_list({\n '2' => 0,\n '3' => 0,\n '4' => 0,\n '5' => 0,\n '6' => 0,\n ... | [
"0.5820945",
"0.56517243",
"0.5486238",
"0.53279316",
"0.53126425",
"0.5310793",
"0.5306572",
"0.5300798",
"0.52415425",
"0.52345425",
"0.52216804",
"0.5157555",
"0.5129693",
"0.5128798",
"0.51196384",
"0.51063293",
"0.50889313",
"0.5081421",
"0.50611514",
"0.5043999",
"0.502... | 0.50534743 | 19 |
Define input_to_index to convert the user input to a valid array position (subtract 1 from their input) | def input_to_index(user_input)
index=(user_input .to_i) -1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_to_index(input)\n #converts the user's input (a string) into an integer\n #converts the user's input from the user-friendly format (on a 1-9 scale) to the array-friendly format (where the first index starts at 0)\n input.to_i - 1\n end",
"def input_to_index(user_input)\n user_input = user_input.... | [
"0.88397723",
"0.875728",
"0.87117165",
"0.84226054",
"0.84226054",
"0.84226054",
"0.84080553",
"0.83906186",
"0.83724815",
"0.83724815",
"0.8269485",
"0.82275397",
"0.82080424",
"0.820289",
"0.820289",
"0.820289",
"0.820289",
"0.8201862",
"0.8190206",
"0.8181772",
"0.8166701... | 0.829487 | 10 |
Define valid_move? Returns true if the index is within the correct range of 08 and is currently unoccupied by an X or O token. Encapsulate the logic to check if a position is occupied in its own method, with position_taken? | def valid_move?(board,index)
# The user_input was accepted, converted to an integer and reduced by 1 in #input_to_index. Now you are testing to make sure
# that the value of the index is within the confines of the board array whose elements are 0-8. It also requires NOT #position_taken
# which means that the test that ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_move?(index)\n if position_taken?(index)\n false\n elsif position_taken?(index) == false && index.between?(0,8)\n true\n end\n end",
"def valid_move?(index)\n !position_taken?(index) && index.between?(0, 8)\n end",
"def valid_move?(index)\n if position_taken?(index)\n ... | [
"0.8558111",
"0.85237193",
"0.84963006",
"0.84871745",
"0.8486549",
"0.8484653",
"0.84749264",
"0.84749264",
"0.84749264",
"0.84749264",
"0.8474716",
"0.84658647",
"0.84604704",
"0.8458227",
"0.8458227",
"0.8454504",
"0.8436539",
"0.8432324",
"0.8431812",
"0.8429814",
"0.8422... | 0.0 | -1 |
Define turn to get user input | def turn (board)
#Ask the user to tell you where they want to move on the board
puts "Please enter 1-9:"
#Get the user input
user_input=gets.strip
index=input_to_index(user_input)
# If the move is a valid move, then make the move and display the board
if valid_move?(board,index)
move(board,index,"X")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input\n puts \"It's #{@player_turn.capitalize}'s turn. Please enter your move/ command.\"\n @input = gets.chomp.upcase\n end",
"def request_input(turn)\r\n if turn === true\r\n puts \"Player 1\"\r\n puts \"=\" * 8\r\n puts \"Put in your first coordinate:\"\r\n first_coor = gets.chomp.to_i... | [
"0.75016606",
"0.7140702",
"0.7129659",
"0.70943475",
"0.70621485",
"0.702581",
"0.695332",
"0.69462794",
"0.6903805",
"0.68961173",
"0.68489593",
"0.6846276",
"0.6832692",
"0.68207484",
"0.6798719",
"0.6793288",
"0.6775677",
"0.67718244",
"0.6734213",
"0.6731906",
"0.6722639... | 0.0 | -1 |
Define position_taken to see if the position the user requests is available or already filled with an X or an O. This code will be used with valid_move? | def position_taken?(board, index)
if (board[index]==" " || board[index]=="" || board[index] ==nil)
false
elsif (board[index]=="X"|| board[index]=="O")
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?(input)\n @board[input] == \"X\" || @board[input] == \"O\"\n end",
"def position_taken?(board, position)\n return false if valid_move?(board,... | [
"0.7893439",
"0.78867096",
"0.77809876",
"0.77543986",
"0.7724337",
"0.77015907",
"0.77015907",
"0.76881784",
"0.7685502",
"0.7664862",
"0.76627904",
"0.7656584",
"0.76449805",
"0.76388377",
"0.761582",
"0.7611678",
"0.7606079",
"0.76016253",
"0.7597656",
"0.7589818",
"0.7574... | 0.0 | -1 |
Define move. Once it is is verified that the position is valid this method inserts an X by default into the position chosen by the user | def move (board,index,character="X")
board[index]=character
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move(position, token='X')\n @board[position] = token\n end",
"def move_x(val)\n update(y, val)\n apply_pos\n end",
"def move(board, position, xo = \"X\")\n board[position] = xo\nend",
"def move(board, position, token=\"X\")\n board[position.to_i - 1] = token \nend",
"def move(positio... | [
"0.71694547",
"0.70786256",
"0.7068784",
"0.700451",
"0.69008243",
"0.6840095",
"0.68384933",
"0.6796639",
"0.6777916",
"0.6719428",
"0.66996807",
"0.6694327",
"0.6694293",
"0.66904205",
"0.6656348",
"0.6647354",
"0.6640236",
"0.6633135",
"0.6602142",
"0.65712494",
"0.6567188... | 0.0 | -1 |
define una variable matrix, fil, col y realiza por defecto un set y un get de dicha variable == Inicializacion Densa | def initialize(filas, columnas, *args)
@fil = filas
@col = columnas
@numCeldas = @fil * @col
@matrix = Array.new(@fil) {Array.new(@col)} # variable de instancia al accessor matrix que se hizo previamente
if args.length != 0
to_s(*args)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(nfil,ncol,mat) \n @nfil = nfil # inicializo numero de filas\n @ncol = ncol # inicializo numero de columnas \n @mat = Array.new(mat) #inicializo la matriz pasando como parametro un objeto de tipo matriz \n end",
"def set_valores_num\n valor = 1\n i = 0\n ... | [
"0.7009535",
"0.6854426",
"0.6816914",
"0.66970515",
"0.6523886",
"0.64816755",
"0.61885285",
"0.60683024",
"0.60620594",
"0.59683216",
"0.59330755",
"0.59307754",
"0.5920561",
"0.5917447",
"0.58944577",
"0.5858102",
"0.5846265",
"0.5837566",
"0.579734",
"0.5723614",
"0.57226... | 0.64318675 | 6 |
== Paso a string Densa | def to_s(*args)
if args.length != @numCeldas
raise ArgumentError, "Numero incorrecto de elementos"
else
numEle = 0
i = 0
while i < @fil
j = 0
while j < @col
@matrix[i][j] = args[numEle]
numEle += 1
j += 1
end
i += 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string(str); end",
"def str(str); end",
"def str(str); end",
"def damballa(text)\n StringFactory::damballa(text)\n end",
"def damballa(text)\n StringFactory::damballa(text)\n end",
"def String(p0) end",
"def text(string); end",
"def text(string); end",
"def text(str); end",
"d... | [
"0.7018091",
"0.68637675",
"0.68637675",
"0.66699845",
"0.66699845",
"0.6543886",
"0.6535791",
"0.6535791",
"0.6502503",
"0.6474396",
"0.6375788",
"0.62123674",
"0.6179793",
"0.6132193",
"0.6132193",
"0.6086596",
"0.6028436",
"0.5974928",
"0.59657115",
"0.59541386",
"0.594903... | 0.0 | -1 |
== Metodo suma Densa | def +(other)
#if ((other.class.to_s == "Densa") && (other.fil == @fil) && (other.col == @col))
0.upto(@fil - 1) do |i|
j = 0
(@col - 1).times do
@matrix[i][j] = @matrix[i][j] + other.matrix[i][j]
j += 1
end
end
#puts "#{@matrix... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum; end",
"def sum (tableau)\n chiffre = 0\n tableau.each do |element|\n chiffre = chiffre + element\n end\n return chiffre\nend",
"def saldo\n\t\t@saldo = 0\n\t\tself.categories.each do |cat|\n\t\t\t@saldo += cat.valor_receita_efetivado\n\t\t\t@saldo -= cat.valor_despesa_efetivado\n\t\tend\n\t\t@s... | [
"0.72064143",
"0.6970855",
"0.684749",
"0.6810384",
"0.6791239",
"0.67835426",
"0.67128974",
"0.6711477",
"0.6584759",
"0.65599924",
"0.6546582",
"0.6527039",
"0.65146023",
"0.64804494",
"0.6467506",
"0.6406411",
"0.63787323",
"0.6374913",
"0.63739216",
"0.63354427",
"0.63317... | 0.0 | -1 |
== Metodo resta Densa | def -(other)
#if ((other.class.to_s == "Densa") && (other.fil == @fil) && (other.col == @col))
0.upto(@fil - 1) do |i|
0.upto(@col - 1) do |j|
@matrix[i][j] = @matrix[i][j] - other.matrix[i][j]
end
end
#puts "#{@matrix}"
return @matrix
#else
#r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def suivre; end",
"def extraer_delante\n if(@tam == 0)\n puts \"La Lista está vacía\"\n else\n aux = @cabeza\n @cabeza = @cabeza[:Next_]\n @cabeza[:prev] = nil\n @tam = @tam - 1\n return aux[:value]\n ... | [
"0.70778394",
"0.6828922",
"0.6824248",
"0.68130535",
"0.6604603",
"0.6466142",
"0.64488673",
"0.6356107",
"0.6298351",
"0.62911534",
"0.62844944",
"0.62044334",
"0.60821193",
"0.6071368",
"0.6050576",
"0.60402703",
"0.6023909",
"0.6023124",
"0.60010165",
"0.59943926",
"0.598... | 0.0 | -1 |
== Metodo producto Densa | def *(other)
#if ((other.class.to_s == "Densa") && (@fil == @col) && (other.fil == other.col) && (@fil == other.fil))
matrizMult = Array.new(@fil) {Array.new(@col)}
i = 0
(0..(@fil - 1)).collect {
0.upto(@col - 1) do |j|
matrizMult[i][j] = 0
k... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prod_nar\n\t\t@edad * 2\n\tend",
"def get_products_dato(id)\n products = Product.find_by(company_id: self.id,id: id) \n \n if products.unidad == nil\n return products.name + \" - \" \n else \n return products.name + \" - \"+products.unidad \n end \n end",
"def ahorrodinero(añ... | [
"0.6853558",
"0.6301637",
"0.6292693",
"0.6231372",
"0.6231372",
"0.62190586",
"0.620419",
"0.6173047",
"0.6115624",
"0.60781974",
"0.6049917",
"0.6043287",
"0.6030931",
"0.5982276",
"0.5975735",
"0.59498346",
"0.58931184",
"0.5869912",
"0.58644134",
"0.5855044",
"0.5835901",... | 0.0 | -1 |
== Metodo minimo Densa | def minimo
min = @matrix[0][0]
i = 0
# while i < @fil
(@fil).times do
j = 0
# while j < @col
(@col).times do
if(@matrix[i][j] < min)
min = @matrix[i][j]
end
j += 1
end
i += 1
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ultimoDia (mes, ano=7)\n fim_do_mes = { \"1\" => \"31\", \"01\" => \"31\", \"2\" => \"28\", \"02\" => \"28\", \"3\" => \"31\",\n \"03\" => \"31\", \"4\" => \"30\", \"04\" => \"30\", \"5\" => \"31\", \"05\" => \"31\",\n \"6\" => \"30\", \"06\" => \"30\", \"7\" => \"31\", \"07\" => \"31\", \"8\" => \"31... | [
"0.6585546",
"0.6554372",
"0.6547542",
"0.6391379",
"0.62446874",
"0.62172526",
"0.6100826",
"0.608667",
"0.60679126",
"0.6000963",
"0.5999675",
"0.5987367",
"0.5953063",
"0.59339565",
"0.5909219",
"0.5908701",
"0.58908784",
"0.58877355",
"0.5883555",
"0.58823127",
"0.5825212... | 0.0 | -1 |
== Metodo maximo Densa | def maximo
max = @matrix[0][0]
i = 0
# while i < @fil
(@fil).times do
j = 0
# while j < @col
(@col).times do
if(@matrix[i][j] > max)
max = @matrix[i][j]
end
j += 1
end
i += 1
end
#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jugada_max\r\n movimiento.max_by{|x| x.nivel} #Devuelve el objeto de enumeración que da el valor máximo\r\n end",
"def maximo()\n\t\tmaximo = 0;\n\t\t@hash_no_nulos.each do |key,valor|\n\t\t\tif (valor > maximo)\n\t\t\t\tmaximo = valor\n\t\t\tend\n end\n\t\treturn maximo\n\tend",
"def ... | [
"0.7826323",
"0.76851004",
"0.74364275",
"0.71017855",
"0.7057347",
"0.7037908",
"0.7037908",
"0.696704",
"0.696704",
"0.69328886",
"0.69229984",
"0.68976045",
"0.6889512",
"0.68829006",
"0.68647254",
"0.68581295",
"0.6843066",
"0.68346894",
"0.68346894",
"0.68257076",
"0.680... | 0.6489169 | 42 |
== Metodo calular fila columna Dispersa | def calcularFilCol(numElem)
i = 0
num = 0
while i < @fil
j = 0
while j < @col
if (num == numElem)
@filM.push(i)
@colM.push(j)
end
num += 1
j += 1
end
i += 1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def col; end",
"def columns; end",
"def columns\n end",
"def columnas\n\t\t@renglones_reporte[0].id_columnas\n\tend",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def columns_title\n self.columns.co... | [
"0.6991528",
"0.6803789",
"0.67591155",
"0.6737709",
"0.6698797",
"0.6698797",
"0.6698797",
"0.6698797",
"0.6698797",
"0.6698797",
"0.6698797",
"0.66781336",
"0.6561896",
"0.6510314",
"0.63907146",
"0.6379648",
"0.6379648",
"0.6330302",
"0.6223949",
"0.6186932",
"0.61744124",... | 0.0 | -1 |
== Metodo minimo Dispersa | def minimo
min = 0
i = 0
while i < @numElementos
if(@eleM[i] < min)
min = @eleM[i]
end
i += 1
end
#puts "minimo: #{min}"
return min
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def suivre; end",
"def mi_carrera\n\n\tend",
"def unsichtbar_machen()\n end",
"def sigla; @nome; end",
"def sichtbar_machen()\n # TODO\n end",
"def posti_disponibili\n self.vehicle.posti - self.n_passeggeri\n end",
"def sichtbar_machen()\n end",
"def presentacion\n \"La marca del Ventilado... | [
"0.6239537",
"0.6209345",
"0.6199985",
"0.612468",
"0.6115583",
"0.6094223",
"0.60552686",
"0.60054874",
"0.5910617",
"0.5839675",
"0.5838946",
"0.5836864",
"0.5836864",
"0.5815958",
"0.57580817",
"0.5744355",
"0.5734378",
"0.57313865",
"0.5700767",
"0.567721",
"0.56764024",
... | 0.0 | -1 |
== Metodo maximo Dispersa | def maximo
max = 0
i = 0
while i < @numElementos
if(@eleM[i] > max)
max = @eleM[i]
end
i += 1
end
#puts "maximo: #{max}"
return max
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_max() @item_max end",
"def maximo()\n\t\tmaximo = 0;\n\t\t@hash_no_nulos.each do |key,valor|\n\t\t\tif (valor > maximo)\n\t\t\t\tmaximo = valor\n\t\t\tend\n end\n\t\treturn maximo\n\tend",
"def max_items\n main.max_items\n end",
"def jugada_max\r\n movimiento.max_by{|x| x... | [
"0.65625346",
"0.65429854",
"0.6532191",
"0.6414942",
"0.6365341",
"0.6353072",
"0.6309388",
"0.6249202",
"0.62445897",
"0.61857647",
"0.6160141",
"0.61499774",
"0.61337376",
"0.6119092",
"0.61155486",
"0.61053264",
"0.6092025",
"0.60824066",
"0.60824066",
"0.60714746",
"0.60... | 0.6220498 | 9 |
== Paso a string Dispersa | def to_s
matrizMuestra = Array.new(@fil) {Array.new(@col) {0}}
numEle = 0
i = 0
while i < @numElementos
matrizMuestra[@filM[i]][@colM[i]] = @eleM[i]
i += 1
end
#puts "muestra = #{matrizMuestra}"
return matrizMuestra
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string() end",
"def string?; end",
"def string(*) end",
"def string\n @string\n end",
"def string\n @string\n end",
"def String(p0) end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def s... | [
"0.708808",
"0.684174",
"0.6806909",
"0.6763421",
"0.6763421",
"0.6744463",
"0.67353565",
"0.67353565",
"0.67353565",
"0.67353565",
"0.67353565",
"0.67353565",
"0.67353565",
"0.67353565",
"0.67353565",
"0.65373075",
"0.65373075",
"0.65373075",
"0.6530416",
"0.6530416",
"0.652... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.