query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
84ffdad02a581e4a0c348770e1dcb8f6
DELETE /tasks/1 DELETE /tasks/1.xml
[ { "docid": "220aaaa5696e87fca04f23b49243fe72", "score": "0.6704179", "text": "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(feature_tasks_path(@feature)) }\n format.xml { head :ok }\n end\n end", "title": "...
[ { "docid": "1b2f6f2a72d8409facdb4921322f2feb", "score": "0.73862225", "text": "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n Task.find_by_name(unescape_url(params[:id]))\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n...
827057ac4f908532a17ad6705e6a6f4d
new is initialized with a name
[ { "docid": "7ddc1e5e599ea4ce0e0f264d423fd127", "score": "0.0", "text": "def initialize(name)\n @name = name\n @@all << self\n end", "title": "" } ]
[ { "docid": "7866e43415b454926b27c4c4881d63b0", "score": "0.90225023", "text": "def new(name); end", "title": "" }, { "docid": "7866e43415b454926b27c4c4881d63b0", "score": "0.90225023", "text": "def new(name); end", "title": "" }, { "docid": "7866e43415b454926b27c4c4881d63...
b21b11e04e680255ce20cb8dec42efa8
add a data node that the master can use
[ { "docid": "bf2176513902b841d27442f045456263", "score": "0.66094196", "text": "def add_node(node_id, node, recovery_mode = false)\n @logger.log_add_node(node_id, Marshal.dump(node)) unless recovery_mode\n @data_nodes[node_id] = node\n @replicator.get_heartbeat(node)\n end", ...
[ { "docid": "0c4b03e61052ec4f990642feee377f20", "score": "0.7524547", "text": "def add_node_data(node)\n # Merge in our server-side facts, so they can be used during compilation.\n node.add_server_facts(@server_facts)\n end", "title": "" }, { "docid": "0c4b03e61052ec4f990642feee377f20"...
158421145a27aa79a5c4c5663577dea8
Makes a request to /tokens for pairing Adds passed params as post parameters If empty params, retrieves servergenerated pairing code If pairingCode key/value is passed, will pair client ID to this account Returns response hash
[ { "docid": "a9234a64cd779000c91e1f889a4540bc", "score": "0.0", "text": "def get_token(facade)\n token = @tokens[facade] || refresh_tokens[facade] || raise(BitPayError, \"Not authorized for facade: #{facade}\")\n end", "title": "" } ]
[ { "docid": "41d5c633d63e70c41a4dff8615118d26", "score": "0.6177188", "text": "def get_token_code(relationship_hash)\n\n\n response = rest_post_call($INTRODUCTIONS_DOMAIN + '/relationship', nil, relationship_hash.to_json)\n\n #uri = URI.parse($INTRODUCTIONS_DOMAIN)\n #http = Net::HTTP.new(uri.host, ur...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e6da4913558fd7bb8f536623fca46bec", "score": "0.0", "text": "def set_test_paper\n @test_paper = TestPaper.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
332a397975d368443d673fa609b43756
otherwise. This time, however, your method should be caseinsensitive, and it should ignore all nonalphanumeric characters. If you wish, you may simplify things by calling the palindrome? method you wrote in the previous exercise.
[ { "docid": "d0f235b6178666fb204a1aa8a4b301f6", "score": "0.0", "text": "def palindrome?(string)\n string = string.reverse.downcase\nend", "title": "" } ]
[ { "docid": "ad03400fcb22d1e43f3e3d2d11e00b50", "score": "0.8381956", "text": "def palindrome?(str)\n # YOUR CODE HERE\n str.downcase.gsub(/\\W/, '').reverse == str.downcase.gsub(/\\W/, '')\nend", "title": "" }, { "docid": "c9f016f515002ac3094cd2791bc975d6", "score": "0.83463585", "...
ced96d83a82798eb70226daca69ccf0f
include the efforts in the segment, if applicable jb the json for the segment ejb the json for the efforts, in a list
[ { "docid": "aa713ed35b6aeb5d16b45a1acd236cab", "score": "0.0", "text": "def initialize(jb, ejb)\n @id = jb[\"id\"]\n @name = jb[\"name\"]\n @climb_category = jb[\"climb_category\"]\n @start_latlng = jb[\"start_latlng\"]\n @end_latlng = jb[\"end_latlng\"]\n @aver...
[ { "docid": "cfa06b702d81ec7fba436d6818d7583c", "score": "0.56650585", "text": "def get_epics_in_active_sprint(sprint_id,view_id)\n current_start_at = 0\n\n response = get_response(\"/rest/agile/1.0/board/170/sprint/1163/issue?startAt=#{current_start_at}\")\n page_result = JSON.parse(response....
cac624757b89f67db114aeb02bfc93c7
upload opml Upload an OPML file to create feeds
[ { "docid": "1f12add4a21297602a27696c1a138917", "score": "0.67517424", "text": "def opml_upload(opts = {})\n opml_upload_with_http_info(opts)\n nil\n end", "title": "" } ]
[ { "docid": "d75799a2b497ef65389ad91851a4b9c0", "score": "0.6537841", "text": "def create\n file = opml_import_params[:file]\n current_user.import_subscriptions file.tempfile\n rescue => e\n Rails.logger.error \"Error importing OPML for user #{current_user.id} - #{current_user.email}\"\n Rai...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "a86986358cd50825d4e57d4edc59f0bd", "score": "0.0", "text": "def plantacion_params\n params.require(:plantacion).permit(:parcela_id, :cultivo, :variedad, :numplantas, :observaciones)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7476646", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.7168696", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist =...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1c6112986383b530e021236b15442eb6", "score": "0.0", "text": "def registro_params\n params.require(:registro).permit(:titulo, :descripcion, :direccion, :telefono1,:costo, :correo, :sitioweb, :logo, :categoria, :user_id,:grupo_id,:countclicks, :descripcionlarga,:recomendado)\n end", ...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69780594", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.678054", "text": "def strong_params\n params.requi...
2e671c628bbba80ab49a1248e1898bd8
POST /recipes POST /recipes.json changed redirect to go to home page
[ { "docid": "f2ab2357a7c52be2be09524bff30b258", "score": "0.0", "text": "def create\n @recipe = Recipe.new(params[:recipe])\n @recipe.user_id = params[:user_id].to_i\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully cre...
[ { "docid": "abff7c2de9844ffde0b7b73f06027a36", "score": "0.6766529", "text": "def index\n redirect_to recipes_path\n end", "title": "" }, { "docid": "f8a495a7b179135a8661376cb0896c80", "score": "0.66237247", "text": "def create\n @recipe = Recipe.new(params[:recipe])\n\n re...
bd9580d1cb2eda6c349ea7b7165c7be4
Load any valid commands
[ { "docid": "453a95e5cd5779f5a6fcf072e8602143", "score": "0.6729513", "text": "def load_notetag_initial_commands\n @init_commands = []\n res = self.note.scan(CommandManager::CommandRegex)\n res.each {|(idstring, args)|\n idstring = idstring.downcase\n if CommandManager.actor_...
[ { "docid": "93f0f779207eea185497392727c3eeb2", "score": "0.8005792", "text": "def load_command(command); end", "title": "" }, { "docid": "19843ba61991bde5a45b7e3ed19abec9", "score": "0.78896385", "text": "def load_basic_commands\n load_cmd = lambda do |name, cmd|\n if !$_comm...
e189b79d1c87aa9b3e6e953785a8c44d
POST /books POST /books.xml
[ { "docid": "26ac01990fb322975e4fc2166482f934", "score": "0.62693274", "text": "def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n flash[:notice] = 'Book was successfully created.'\n format.html { redirect_to(@book) }\n format.xml { ...
[ { "docid": "503f9d2a1f572dbe3f7cefe150f74c22", "score": "0.63617384", "text": "def create\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save \n flash[:notice] = 'Book was successfully created.'\n format.html { redirect_to books_path }\n format.xm...
1247d1184ee23111bb50a3e670bcda30
make & record a guess create a new Turn object w/ respective guess & card next card in deck becomes current card store & return new Turn object
[ { "docid": "0e058812e2421bf2f6951603b8c42a34", "score": "0.79584205", "text": "def take_turn(guess)\n turn = Turn.new(guess, current_card)\n current_card = deck.cards.shift\n turns << turn\n turn\n end", "title": "" } ]
[ { "docid": "4c6d7d2c651b263b6d80f197b1130fd7", "score": "0.77505267", "text": "def take_turn(guess)\n guess.capitalize\n new_turn = Turn.new(guess, current_card)\n @turns << new_turn\n if current_card.answer == guess.capitalize\n @correct << current_card\n else\n @incorrect << c...
b94390359371eef3e987771c8d4a9713
Get module name from directory name; strip "puppet" prefix.
[ { "docid": "8ad7509b11e8389eccad0fd18e9ffac3", "score": "0.7983005", "text": "def module_name\n File.basename(File.dirname(__FILE__)).sub(/^puppet-/, '')\nend", "title": "" } ]
[ { "docid": "f82a962e57715dc029e6433a6fab7013", "score": "0.7136786", "text": "def module_name(name)\n # module name can't have dashes, so let's assume it is everything after the last dash\n name.rpartition('-').last\n end", "title": "" }, { "docid": "4494374becaeeb1525d2fd...
8f8ead304d26961cc34c7b0bd08954c7
Initializes a message object.
[ { "docid": "cd9e658225cd6c4b5cbfb681bb80369d", "score": "0.0", "text": "def initialize descriptor, address, docs, fields, extensions, resource,\n nested_messages, nested_enums\n super descriptor, address, docs\n @fields = fields || []\n @extensions = extensions |...
[ { "docid": "220e45ab19f3a6a0325f2d0f5ce8f08e", "score": "0.87475187", "text": "def initialize_message\n\t\t@message = Message.new\n\tend", "title": "" }, { "docid": "ae876a0df0030bb50e70a3a6e1ab2fda", "score": "0.80044717", "text": "def init_message\n\n end", "title": "" }, ...
1ef8e981640fac501f79eca641a23ee0
Change the current font to the title font.
[ { "docid": "6358231d26ac58076c6e6ac4d021e92b", "score": "0.80882776", "text": "def use_title_font\n @pdf.select_font @title_font, @title_font_encoding\n end", "title": "" } ]
[ { "docid": "b51714b9d7dccf991579fee40ecbe18c", "score": "0.68926376", "text": "def bold_title=(value)\n @title_font.bold = value\n end", "title": "" }, { "docid": "63d42f9a9c8b58fc5705575bb4f04cf9", "score": "0.6868686", "text": "def title_font_size=(value)\n @title_font...
0fa487b18634923ff82d3103d86d9f6a
uncomment next line to run this challenge solution Emp_of_companies(CRM) Challenge 2
[ { "docid": "ac2a66e86a248de3af0f1ab2b308eaed", "score": "0.5744556", "text": "def Employments(data)\n result = []\n data[:people].each do |person|\n person[:employments].each do |employment|\n full_emp = employment.merge!(person_id: person[:id],\n person_first_...
[ { "docid": "8e5dbfc81f2d08776a27b5b54a80d4f0", "score": "0.7129028", "text": "def employees_of_companies\n CRM[:companies].each do |company|\n company_id = company.delete(:id)\n puts company[:name]\n\n CRM[:people].each do |person|\n person[:employments].each do |emplo...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a280245a260cd1283eca6bfbdf96923b", "score": "0.0", "text": "def set_article\n @article = Article.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
971f115c0bd690f003b487ec078777df
Fetches the regID for this student, from the database if we have it locally, or from SWS if we haven't fetched it yet.
[ { "docid": "df70bd39781f4115cfb359883d4d1ef5", "score": "0.7293155", "text": "def reg_id\n if read_attribute(:reg_id).blank?\n @reg_id ||= StudentResource.find_by_system_key(system_key, false)\n update_attribute(:reg_id, @reg_id)\n else\n @reg_id ||= read_attribute(:reg_id)\n end...
[ { "docid": "7db87b49abab33b22686ec1bd92e79c5", "score": "0.7258746", "text": "def reg_id\n @reg_id ||= StudentResource.find_by_system_key(system_key, false)\n end", "title": "" }, { "docid": "c700bca821753f5a22fc428a9f9c2fc4", "score": "0.6008221", "text": "def student_id\n ...
7380bf66a1260274e6b91762ded7c690
Parses a Spreadsheet Document and returns a Workbook object. At present, only ExcelDocuments can be read.
[ { "docid": "3b253443bbec9d566a8aaf1b68553fcb", "score": "0.0", "text": "def open io_or_path, mode=\"rb+\"\n if io_or_path.respond_to? :seek\n Excel::Workbook.open(io_or_path)\n elsif block_given?\n File.open(io_or_path, mode) do |fh|\n yield open(fh)\n end\n ...
[ { "docid": "b9d6e4120b74809fac1d07ea538a2af6", "score": "0.6453413", "text": "def spreadsheet\n if is_extractable_spreadsheet?\n workbook = parse_spreadsheet_xml(spreadsheet_xml)\n if content_blob.worksheets.empty?\n workbook.sheets.each_with_index do |sheet, sheet_number|\n ...
745a5c7651505529fdde9d09e179e0c8
al momento non in uso
[ { "docid": "500c18ea3316dc947d5231d32e825545", "score": "0.0", "text": "def read_styles(options_styles)\n @styles = {}\n if options_styles\n @wb.styles do |wb_style|\n options_styles.each_pair do |name, s|\n styles[name.to_sym] = wb_style.add_style s\n end\n...
[ { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.74327606", "text": "def suivre; end", "title": "" }, { "docid": "07f4aba74008200310213b63a5f3de3f", "score": "0.66254514", "text": "def zuruecksetzen()\n end", "title": "" }, { "docid": "1b32dbfb5c4033670c1e7a8ae...
1d50003b1d63645ddcaa974fbe5b1c75
Runs a playbook or a role via ansiblerunner.
[ { "docid": "9ea78d237de0e9d39bc1f118179aabdb", "score": "0.60224235", "text": "def run_via_cli(hosts, credentials, env_vars, extra_vars, tags: nil, ansible_runner_method: \"run\", verbosity: 0, become_enabled: false, **playbook_or_role_args)\n # If we are running against only localhost and no oth...
[ { "docid": "023f63d055650f49b7a1404d26c3f7ff", "score": "0.6171179", "text": "def run_async(env_vars, extra_vars, playbook_path, hosts: [\"localhost\"], credentials: [], verbosity: 0, become_enabled: false)\n run_via_cli(hosts,\n credentials,\n env_vars,\n ...
dfce5523cf163cf1b2561f453495a8e4
count of free specified product
[ { "docid": "d1ca6f358e07adda377bafbc610b80c0", "score": "0.6397058", "text": "def free_qty_to_add(pay_product, qty, free_product)\n f = pay_product.valid_freebies.find{|i| i.freebie_id==free_product.id}\n if f\n free_qty = ( qty / f.prod_qty ).round * f.freebie_qty\n else\n free_qty =...
[ { "docid": "025b385b7f8a1511232e334569195c46", "score": "0.7046225", "text": "def num_free\n free_items.count\n end", "title": "" }, { "docid": "025b385b7f8a1511232e334569195c46", "score": "0.7046225", "text": "def num_free\n free_items.count\n end", "title": "" }, { ...
42b301ac7388d24d309cf78875cf2d3a
Format as datetime for emails.
[ { "docid": "b3e8f60e72754b26bcb8e6553d7756f9", "score": "0.73069715", "text": "def email_time; strftime(EMAIL_TIME_FORMAT); end", "title": "" } ]
[ { "docid": "43d053be007c513657f73538e79cf067", "score": "0.7939571", "text": "def email_date; strftime(EMAIL_TIME_FORMAT); end", "title": "" }, { "docid": "2a68f22ca564940f7eb7b8ceea8af36a", "score": "0.768952", "text": "def email_date\n strftime(MO.email_time_format)\n end", ...
04232e0fd9cabd1968716331c8a462ad
This will need tuning dependent on eventhub/splunk payload limits Also ought to have some error handling
[ { "docid": "a26b58e2dd365a366929727b84283e81", "score": "0.0", "text": "def process_in_batches(records)\n records.each_slice(@max_events_per_send).each { |batch| \n payload = { \"records\" => batch }\n log.debug \"Sending batch of #{batch.size()} records to EventHub...\"\n @sen...
[ { "docid": "3f30fe6d9c5cfc50810f2425a4fd2bc0", "score": "0.6451319", "text": "def test_req_too_large()\n conn = Scalaroid::PubSub.new()\n data = (0..($_TOO_LARGE_REQUEST_SIZE)).map{0}.join()\n key = \"_ReqTooLarge\"\n begin\n conn.publish(@testTime.to_s + key, data)\n a...
cfc94fee85ac073ea8433322461be9a6
Confirms the correct user.
[ { "docid": "799d315634e944b139ba6821c13f0a07", "score": "0.0", "text": "def correct_user\n @user = Login.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "title": "" } ]
[ { "docid": "c96f27a6347be3bc55a20e8450db1ec9", "score": "0.72449994", "text": "def correct_user\n @user = User.find(params[:id])\n unless current_user == @user\n flash[:warning] = \"You are not authorized to do that.\"\n redirect_to root_path\n end\n end", "title": ""...
34d8fbe1ce68dac163493f17e657c3ae
GET /exercises GET /exercises.json
[ { "docid": "23436dac2bf6ec5446f3e2d34a491a00", "score": "0.60400534", "text": "def index\n @exercisesGlobal = Exercise.find_all_by_is_global(true)\n @exercisesByUser = Exercise.find_all_by_user_id(current_user.id)\n\n unitGlobal = @exercisesGlobal.collect { | e |\n e.unit ? [e.id, e.unit.n...
[ { "docid": "7c269fa6edd7a93c0daf72b29b43b324", "score": "0.74260163", "text": "def show\n render json: @exercise\n end", "title": "" }, { "docid": "c533b59808034f7bcc5dc9cc229dfde3", "score": "0.73882824", "text": "def index\n @exercises = Exercise.all\n @exercises.each do ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "be508f0621662ca9495061d427733793", "score": "0.0", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
0ace522b97f1c0d58afda9a114620fa0
Used to calculate a destination/target url for an Umlaut response item. Pass in a ServiceType join object (not actually a ServiceResponse, sorry) Calculates the URL for it, and then runs our link_out_filters on it, returning the final calculated url. Also requires a rails 'params' object, since url calculation sometime...
[ { "docid": "da3d6e7b1c4fb850fa131193ce8073e4", "score": "0.6165931", "text": "def calculate_url_for_response(svc_response)\n svc = ServiceStore.instantiate_service!(svc_response.service_id, nil)\n destination = svc.response_url(svc_response, params)\n\n raise_missing_url!(svc_response) if dest...
[ { "docid": "c9d9e0aeeb1c1289ed1b779eb96fd0f0", "score": "0.54281074", "text": "def image_url_redirect(link_url, service_endpoint, stop_indicator = LOCATION_STOP_INDICATOR)\n link_url_redirect \"#{service_endpoint}#{extract_id link_url}\", stop_indicator\n end", "title": "" }, { "docid": ...
abfa34f7475433ab2622a366eea03a77
guardamos la carta en una variable auxiliar y lo tenemos a null
[ { "docid": "19ec2e59c876110e4936248352629ec8", "score": "0.6400507", "text": "def devolver_carta_libertad\n auxiliar = @carta_libertad\n @carta_libertad = nil\n \n return auxiliar\n \n end", "title": "" } ]
[ { "docid": "61b5b15f4dbabf39604a27863dac2d75", "score": "0.65974844", "text": "def juega_despues mano, carta_inicial, baza\n\t\tcarta_a_jugar = nil\n\t\tUtil.muestra_msg baza.to_s, @verbose\n\t\tcadena = (Util.captura_entrada \"Escoge una carta por su posicion en la mano (0=inicial)=>\").chomp\n\t\tcart...
9b33e128a3ae8586974fbbdbaedec1ec
Define what happens when the measure is run
[ { "docid": "a4a1db286a43a1105e8a78ed6d789a50", "score": "0.0", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # Use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n oc...
[ { "docid": "99ab945a1927e84fe17934e1440b9eb0", "score": "0.74859875", "text": "def measure(&block); @measure = block; end", "title": "" }, { "docid": "98be183bacea0b93f865dcb476b3ac9c", "score": "0.705503", "text": "def measure(&block)\n @measure = block\n end", "title": "" ...
d5b8c89545bfbe9c8959aaa9e5d8f6f2
List the currencies imported and registered
[ { "docid": "9cee3aa66f2957b180a99cc9c2498d1a", "score": "0.0", "text": "def all\n table.keys.map do |curr|\n c = Currency.new(curr)\n if c.priority.nil?\n raise MissingAttributeError.new(:all, c.id, :priority)\n end\n c\n end.sort_by(&:priorit...
[ { "docid": "f556a345b8cf51d47c579d063b9c5eb0", "score": "0.8114825", "text": "def list_currencies()\n path = '/locale/currencies'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n ...
db9541aa600426da99692868e5790f9f
TODO: Make this a shareable Module
[ { "docid": "81bfa9d63960f0856b295fc2f05c5804", "score": "0.0", "text": "def rowify fields=nil\n\n #Default Fields\n fields ||= [:asset_id,\n :org_name,\n :vin,\n :manufacturer,\n :model,\n :year,\n :type,\n ...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7096118", "text": "def private; end", "title": "" }, { "docid": "b44978fb90407afbd0420a3793d8a926", "score": "0.67957604", "text": "def modules; end", "title": "" }, { "docid": "b44978fb90407afbd0420a3793d8a926", ...
704935c49a664fa87b806f4cb79cd07d
GET /loan_requests/1 GET /loan_requests/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c6d96256d0f0429b326492a4c480fbfc", "score": "0.728693", "text": "def index\n @loan_requests = LoanRequest.all\n end", "title": "" }, { "docid": "b6c1869fc082706e94a1fb757601d221", "score": "0.6827517", "text": "def requests\n @bills = Bill.where :approved => false\...
1a051700e67ca4ea02e1297f43fbb3b6
DELETE /herbies/1 DELETE /herbies/1.json
[ { "docid": "cb0b0bce7fb34bf936a47f4c04ae8b6d", "score": "0.7091632", "text": "def destroy\n @herbie.destroy\n respond_to do |format|\n format.html { redirect_to herbies_url, notice: 'Herbie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.70277447", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
8c2de5fbbb68adb438c5556167c9b970
Updates a 'Comprobante' to be canceled
[ { "docid": "eeaf554eb31159d89e2bf6a92e14528b", "score": "0.622507", "text": "def cancel\n cancel_controller = CancelController.new\n cancel_controller.cancel_comprobante(File.open @options[:cancel])\nend", "title": "" } ]
[ { "docid": "950ba8c148887c8aba02245fd3550f2f", "score": "0.6975069", "text": "def cancel!\n update_attributes :status => 'cancelled'\n end", "title": "" }, { "docid": "5d1820eb4665ecb3b8a566dcbca2f292", "score": "0.6931904", "text": "def cancel\n self.update(canceled_at:...
5532c108531491f2d92f9a691f35eae7
Map a common shortened severity [R/C/W/E/F0000] to a defined severity level.
[ { "docid": "8683052b24401b2a76458aafa8035e13", "score": "0.5627908", "text": "def rcwef_short(name)\n char = name.chars.first.downcase\n case char\n when 'r', 'c'\n LOW\n when 'w'\n MEDIUM\n when 'e', 'f'\n HIGH\n else\n LOW\n end\n end",...
[ { "docid": "254f500e855167ffa2865c881ea5112a", "score": "0.6875465", "text": "def severity_str\n return \"\" if severity.nil?\n case severity\n when 3 then \"Low\"\n when 2 then \"Medium\"\n when 1 then \"High\"\n end\n end", "title": "" }, { "docid": "79248a92674460...
6a2fabd9faf85f32d0972bd1b7ee48f8
GET /hubs/1 GET /hubs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b444bf5b927fbc1f8f91b481ec94b0bd", "score": "0.77911806", "text": "def index\n @hubs = Hub.all\n respond_to do |format|\n format.html { @hubs }\n format.json { render json: @hubs }\n end\n end", "title": "" }, { "docid": "12a0bfda1bd9af5e350b739eb48eb7f0", ...
d22341f5d496de4e02245577c61ad5f4
DELETE /sanskrit_terms/1 DELETE /sanskrit_terms/1.json
[ { "docid": "065739f6e39c6d945a1f87f4abb96bde", "score": "0.7573407", "text": "def destroy\n @sanskrit_term.destroy\n respond_to do |format|\n format.html { redirect_to sanskrit_terms_url, notice: 'Sanskrit term was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "4fb5f41bace587c3d2372fd5becb1ec3", "score": "0.7011898", "text": "def destroy\n UriService.client.delete_term(@term['uri'])\n respond_to do |format|\n format.html { redirect_to terms_controlled_vocabulary_path(@controlled_vocabulary), notice: 'Term has been deleted.' }\n form...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "60ea9fbabbd37b86e9aaafe586013a02", "score": "0.0", "text": "def villager_gender_params\n params.require(:villager_gender).permit(:value)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7475058", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71668744", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist ...
c0e59fd941015869b222542c96d22a8a
POST /teams POST /teams.json
[ { "docid": "61fbd583f93c6509bc97040cf345194d", "score": "0.6426935", "text": "def create\n @team = Team.new(team_params)\n @team.slug = @team.name.downcase.gsub(\" \", \"-\")\n\n @team.community_rating = 0\n\n # Set default picture url\n if !@team.picture_url\n @team.picture_url = 'h...
[ { "docid": "070c8f8528c14de019a5f02cfbeb76bd", "score": "0.7407207", "text": "def create\n @response = HTTParty.get('http://laxapi.herokuapp.com/api/teams')\n CreateTeamService.new.create_team_objects(@response)\n render :json => {\n :message => \" #{Team.count} teams have been created\",\...
3de3f8d9e6445d9a2a42bf4a28aa1224
Check to see if the user is a registered traveler (i.e. not a guest, no roles)
[ { "docid": "b3b224272ecd25a7267a40325d4cb3c4", "score": "0.7970802", "text": "def registered_traveler?\n registered? && traveler?\n end", "title": "" } ]
[ { "docid": "79ce987cce5a7718676bf1f46125decc", "score": "0.81400293", "text": "def is_traveler\n if @traveler\n return @traveler.id == current_or_guest_user.id ? false : true\n else\n return false\n end \n end", "title": "" }, { "docid": "930e422be4ae597f743cfdc31d2603c2...
6e6638f8557859d1a62caf2df8275150
PATCH/PUT /galleries/1 PATCH/PUT /galleries/1.json
[ { "docid": "d7890f3f7dbcdf6dee5cfbdb7a8b25b0", "score": "0.0", "text": "def update\n respond_to do |format|\n if @allocation.update(allocation_params)\n\n else\n format.json { render json: @allocation.errors, status: :unprocessable_entity }\n end\n e...
[ { "docid": "df1d1868d4d91593f1c23aa4990225f0", "score": "0.73400944", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n if @gallery.update(gallery_params)\n head :no_content\n else\n render json: @gallery.errors, status: :unprocessable_entity\n end\n end", "title"...
02a9051fa7af5a22730b168a2bf3b9d5
POST /registros POST /registros.json
[ { "docid": "bb8106c96e1e051eee90cd8eb32b0e6a", "score": "0.6818192", "text": "def create\n @registro = Registro.new(registro_params)\n\n respond_to do |format|\n if @registro.save\n format.html { redirect_to @registro, notice: 'Registro was successfully created.' }\n format.json...
[ { "docid": "6d34ead8f4c6c44efe6dd66fcf7ae83b", "score": "0.6873357", "text": "def create\n @registro = Registro.new(registro_params)\n\n respond_to do |format|\n if @registro.save\n format.html { redirect_to '/' }\n format.json { render :show, status: :created, location: @regist...
fba9c8944178a2374cc458bdeba3514b
Returns the object at the front of the Deque but does not remove it. d = Containers::Deque.new d.push_front(1) d.push_front(2) d.front => 2
[ { "docid": "e640f5695d6f316265349b891c1e02f6", "score": "0.67098033", "text": "def front\n @front && @front.obj\n end", "title": "" } ]
[ { "docid": "36be1e8b76334da87f5bc5b0a770ae0b", "score": "0.75422406", "text": "def peek\n if empty?\n nil\n else\n first = @queue.remove\n addToTop(first)\n first\n end\n end", "title": "" }, { "docid": "3d35d9e2ec99389df30fc543e10a6379", "score": "0.752406"...
319d0366aa33b34fcbb096c64253f438
convert an input string to DOWNCASE source://liquid4.0.3/lib/liquid/standardfilters.rb:27
[ { "docid": "7588de95f5829830f13cc03827cb0ebb", "score": "0.6785301", "text": "def downcase(input); end", "title": "" } ]
[ { "docid": "1d6661bf45297a03693e90c69f64357d", "score": "0.6493956", "text": "def constantize(string)\n return string.downcase.gsub(/[^a-z]/i, '') \n end", "title": "" }, { "docid": "f02a9ebac7dd743db7af8f94501ae473", "score": "0.64333296", "text": "def upcase(input); end", "...
eee762d12418a558c3428068bc92574b
Reserved ruby methods (such as 'send') must be prefixed with '__'
[ { "docid": "b5a62dc44df7edc5902618b24367fb3d", "score": "0.0", "text": "def method_missing(method, *args)\n method_name = translate_method_to_wire_command(method)\n element_identifier = args[0]\n value = args[1]\n command_string = \"|#{method_name}|#{element_identifier}|#{value}|\"\n...
[ { "docid": "512a0a7f27061e8658ad3021502a1307", "score": "0.7372426", "text": "def __send__(symbol, *args, &block)\n ### *** TODO *** ###\n end", "title": "" }, { "docid": "99903a8993503c02de09ec6d1b2bf628", "score": "0.72243667", "text": "def send(method, *args)\n return super...
5ae978f5d71efed2ab4f49fb3d5b4d63
GET /reproduction_simbols/1 GET /reproduction_simbols/1.json
[ { "docid": "188eb98c12cf1396e88429da97f1724f", "score": "0.6384293", "text": "def show\n @reproduction_simbol = ReproductionSimbol.find(params[:id])\n end", "title": "" } ]
[ { "docid": "211724e412fb659803658aea25824029", "score": "0.6475629", "text": "def index\n @simbols = Simbol.all\n end", "title": "" }, { "docid": "d13359a6abf2ee12dd7d0abcc3213b02", "score": "0.63902193", "text": "def sympols_index_action\n response = Unirest.get(\"http://loca...
155399011f2be58de759ba6e09f12684
One doesn't have to use the helpers The full managed API is available
[ { "docid": "fedc6b4d509dde242096839520deb0eb", "score": "0.0", "text": "def circle_example_pure_api\n\tbegin\n\t #uses fully-qualifed identifiers\n\t #could use Aas::Application instead\t\n\t app = Autodesk::AutoCAD::ApplicationServices::Application\n\t doc = app.DocumentManager.MdiActiveDocument\n\...
[ { "docid": "6daaf82d3cc78dc75bd9b6e6a33d6643", "score": "0.6427684", "text": "def entitystore; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.6350122", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c...
25f85636164ed2f5c6a60e39a8bc1851
PATCH/PUT /admin/menus/1 PATCH/PUT /admin/menus/1.json
[ { "docid": "4a403a4394186c30c8b4992364db9729", "score": "0.6928818", "text": "def update\n @menu = Menu.find(params[:id])\n respond_to do |format|\n if @menu.update(menu_params)\n format.html { redirect_to [@admin, :menu], notice: 'Menu was successfully updated.' }\n format.json...
[ { "docid": "c86eb31a3d2f0a834a18d61f93dc66ae", "score": "0.7104371", "text": "def update\n @admin_menu = Admin::Menu.find(params[:id])\n\n respond_to do |format|\n if @admin_menu.update_attributes(params[:admin_menu])\n format.html { redirect_to @admin_menu, notice: 'Menu was successfu...
876ec7f42f6059ec73b0f5a53f6b8e11
Create Campaign Create a campaign.
[ { "docid": "e42b17ff820203cbd60fc7c561ce7290", "score": "0.0", "text": "def create_campaign_0_with_http_info(name, start_time, end_time, list_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignsApi.create_campaign_0 ...\"\n end\n ...
[ { "docid": "e8d9e4905554853dbf11d13cb7b9eaf4", "score": "0.8336976", "text": "def create\n return nil if created?\n request :create_campaign_on_bidstalk do\n client = Bidstalk::Campaign::Client.new\n client.create to_platform_campaign!\n end\n end", "title": "" }, ...
fd590b06ce57dfd0684d63202e552185
Check if it is possible to move falcon down.
[ { "docid": "53ff759a8d25ec50366c2903fc2298d9", "score": "0.64203346", "text": "def move_down_possible?(height)\n z_next_down = @box.y + @box.height + z_vel\n z_next_down < height\n end", "title": "" } ]
[ { "docid": "cae1f1c82a8895f2f282c793686ba5b4", "score": "0.69589806", "text": "def moveDown()\n return (@tetromino.moveDown() && !@board.causesCollision?(@tetromino))\n end", "title": "" }, { "docid": "48e16fd56aa328e38189de4a339e8e01", "score": "0.6892752", "text": "def go_down\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d3c164ca09b719f2ae382433565e3554", "score": "0.0", "text": "def set_admin_venue\n @admin_venue = Venue.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60315156", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6018921", "text": "de...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "200136602ee6c00baafe6ed3ccf9393e", "score": "0.0", "text": "def timer_tag_params\n params.require(:timer_tag).permit(:category_record_id, :tag_id, :user_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
0568d965222c1816ecd32401896d8630
Id of this transaction (paypal number)
[ { "docid": "edd6683dce528072f3d186812c5ffc8d", "score": "0.73933387", "text": "def transaction_id\n params['PNREF']\n end", "title": "" } ]
[ { "docid": "31d1d48e99ac1e34e46b73d98a9e00ff", "score": "0.8002628", "text": "def transaction_id\n params['PAYMENT']\n end", "title": "" }, { "docid": "42b8a9b0ed5bfd39609714ea5b8b2e7e", "score": "0.78560674", "text": "def transaction_id; end", "title": "" }, ...
254f1d67359d0f62e9e3605e5ef46523
PATCH/PUT /work_orders/1 PATCH/PUT /work_orders/1.json
[ { "docid": "ccb51488ad54df7459677e57450c319b", "score": "0.72599083", "text": "def update\n respond_to do |format|\n if @work_order.update(work_order_params)\n format.html { redirect_to \"/\", notice: 'Work order was successfully updated.' }\n format.json { render :show, status: :o...
[ { "docid": "7dc308454a45102ca06037edf5c0ee41", "score": "0.72859013", "text": "def update\n @workorder = Workorder.find(params[:id])\n\n respond_to do |format|\n if @workorder.update_attributes(params[:workorder])\n format.html { redirect_to @workorder, notice: 'Workorder was successfu...
7db5381aaf052fe70047678496af12ef
an array with the first letters of each word
[ { "docid": "7bb833072e4256533d7c4a97f08baaa7", "score": "0.80577403", "text": "def first_letters(string)\n #empty array\n arr = []\n #separte each how word and later take the first\n #letter of each word\n arr << string.split.map(&:chr).join\n #separate each letter with a coma\n arr[0].chars\nend...
[ { "docid": "2ac56d1a264a80b63c1bbe5042774578", "score": "0.7650339", "text": "def first_letters(word)\n\tletters = word.split(\"\")\n prev_letter = \"\"\n \n #define the array consonnant\n starting_consonant = []\n \n #loop to check if it's a each letter is a vowel\n\tletters.each do |...
71f6ba92d2bc85919fed061ba47dd124
Process message Override this method in subclass
[ { "docid": "85a92ce8d4d4392bf6532c49223a748c", "score": "0.6948236", "text": "def call(message)\n raise \"Implement this method in subclass\"\n end", "title": "" } ]
[ { "docid": "2570dd440d5d578cd76281bbfd7a927d", "score": "0.83033234", "text": "def process_message(message)\n raise NotImplementedError, \"This method should be overridden by subclass\"\n end", "title": "" }, { "docid": "d10d6722dded89b63de5f923df1bdc5b", "score": "0.7976988", ...
8ea2ec5d39b0145526c769448992a7e1
Only Logged In Users
[ { "docid": "1399ede367503aa41711f2c527713a98", "score": "0.0", "text": "def clear_dead_deals\n\t\tcurrent_user.watching.where(\"dead = ?\", true).each do |deal|\n\t\t\tcurrent_user.unwatch!(deal)\n\t\tend\n\t\tdeals = current_user.watching.size\n\t\trespond_to do |format|\n\t\t\tformat.html {\n\t\t\t\tf...
[ { "docid": "ef50011b27c46ce640ef818ab93a1023", "score": "0.81582546", "text": "def only_loggedin_users\n redirect_to login_url unless logged_in? # logged_in? is found in our SessionsHelper\n end", "title": "" }, { "docid": "5348e932eb09cb464cbdefbdf8bd6ab9", "score": "0.7625939",...
55fdbc57b1cd4569652eed5238da0238
Lists available fulfillment statuses Permissions Needed: ANY
[ { "docid": "5c496e2cb18b98602cf446093bb1dca9", "score": "0.5384631", "text": "def get_ful_fillment_statuses_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: InvoicesApi.get_ful_fillment_statuses ...\"\n end\n # resource pa...
[ { "docid": "86b3102a288be0fa1b6f38b683088f0a", "score": "0.64543045", "text": "def status_list\n %w[unconfirmed unable_to_attend attending]\n end", "title": "" }, { "docid": "195f8e96a14ca8476e76f8feb4c9e596", "score": "0.6422786", "text": "def pending_statuses\n required_...
1b4826be8f779bd5b0f5a0961178859c
Apply heroku configurations changes. app name of the remote heroku app. settings list to apply method to. method name of the api method to call. message display of what actions are to be performed.
[ { "docid": "f362561756d482e3f7cbaa9faca70aa4", "score": "0.78417665", "text": "def apply(app, settings, method, message)\n if settings.present?\n @displayer.labelize(message)\n settings.each do |setting|\n @displayer.labelize(\"\\t#{setting}\")\n heroku.__send__(meth...
[ { "docid": "0931d21ef7f3a8a666bfce3b15b5fcd5", "score": "0.5964446", "text": "def configure\n vars = %W{\n #{PAGES[:error]}='#{error_page_url}'\n #{PAGES[:maintenance]}='#{maintenance_page_url}'\n }.join(' ')\n\n run(\"heroku config:set -a #{app} #{vars}\")\n end", "title": "" ...
87481e720dd5006579a1376d87e11c88
Internally draw the message
[ { "docid": "93cf20b82b160155a456ac26fcd68442", "score": "0.0", "text": "def refresh_internal(lineheight)\n skip = false\n counter = 0\n @instructions.each_with_index do |instr_arr, i|\n marker = @markers[i]\n call_marker_action(marker) if marker\n instr_arr.each do |i...
[ { "docid": "3aa4654d2dd1df61692037e24dec5c08", "score": "0.79950047", "text": "def draw_msg ( t )\n\t\t@pic.draw_box_s([0,610],[700,680],[0,0,0])\n\t\trender_txt(@pic,t,[10,625],40)\n\t\tredraw\n\tend", "title": "" }, { "docid": "cafb9d2d6f483f65cbcaf187c962bc66", "score": "0.7721064", ...
925f0753ee7b2e680fbdae0c410ccbdb
Removes an array of lists
[ { "docid": "159c21c6dae8d56f1c1a04465d0455e5", "score": "0.0", "text": "def rm_lists(lists)\n i = 0\n while i < lists.length\n FileUtils.rm_r(\"#{Dir.home}/.liste/#{lists[i]}.list\") rescue rmi()\n i += 1\n end\n puts \"List(s) '#{lists.join(', ')}' removed\"\nend", "title": "" } ]
[ { "docid": "6b55f54fa3344d4dafc073a82ce55fa8", "score": "0.6961798", "text": "def remove_items!(input_arr)\n input_arr.slice!(0)\n input_arr.each do |item_to_remove|\n $grocery_db.execute(\"DELETE FROM audit_list WHERE item = ?\", item_to_remove)\n end\n end", "title": "" }, { ...
9a359f61603f9da9952199202ceb1e6e
It returns true if the build method has been called.
[ { "docid": "fd3cb30974e6f6c649c545224bed4b4f", "score": "0.7876513", "text": "def built?\n @built = false if @built.nil?\n @built\n end", "title": "" } ]
[ { "docid": "0dd73af694388ca5d278c49721bf13f4", "score": "0.7712822", "text": "def building?\n !build_stack.empty?\n end", "title": "" }, { "docid": "e22d6bbcccc758a4f5eba99348205177", "score": "0.74645364", "text": "def built?\n !@view.nil?\n end", "title": "" }...
7b0da8f083fa342dc5fe0866031e5c13
checks if dealer can stop
[ { "docid": "7087f04e23db611d765eddf4476abb60", "score": "0.76247853", "text": "def dealer_stop?\n p_score, d_score = self.scores\n if Game.can_stop?(self.card_numbers nil) and d_score >= p_score\n true\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "155d78d31894944261137dc1b60ec0bb", "score": "0.7380701", "text": "def stop?\n @stop\n end", "title": "" }, { "docid": "6da927542e278b9993dafdac1806a38d", "score": "0.729332", "text": "def dealer_stop\n game_owner_only!\n if @game.dealer_stop?\n @game.st...
8ee01c6fdea8163f8105ae0162a8e2dd
function for creating the block for a non poem expression
[ { "docid": "ea223be41c76a0f93f4fea06330e5348", "score": "0.0", "text": "def do_generic_text(work_id, expression_id, line, line_expression_order, line_page_order, line_designator, arr_flags)\n\tret_text = \"\"\n\t# <text n=\"A Ballad of Life\" type=\"poem\" xml:id=\"expressionid\">\n\t# \t<index corresp=...
[ { "docid": "f5c2efb38808b8107fe7cbfb257e501d", "score": "0.68141997", "text": "def block_literal?; end", "title": "" }, { "docid": "f5c2efb38808b8107fe7cbfb257e501d", "score": "0.68141997", "text": "def block_literal?; end", "title": "" }, { "docid": "cd2b14095600593fbc1c...
51206b65ea5f271cd5ed4788b9fbb829
Method returns the height of a given node
[ { "docid": "0f44950dd3d415b0015c756c9d1bf6e2", "score": "0.78925395", "text": "def height(node, height = 0)\n if node.left == nil && node.right == nil\n return height\n else\n left = 0\n right = 0\n left = height(node.left, height + 1) unless node.left == nil\n right = hei...
[ { "docid": "869c655c49b6097724314a6df1e40c34", "score": "0.8766375", "text": "def height node\n node&.height || 0 \n end", "title": "" }, { "docid": "d5788284a1f144b6e217ac473c2f96a4", "score": "0.8499755", "text": "def height\n node['height']\n end", "title": "" }, ...
8a84c8a5c85d0ad19950fa7a07fde9e2
Gets the jobTitle property value. Job title for this organizational contact. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq for null values).
[ { "docid": "1f037d5267f3d18b34e97f03db4e7d3b", "score": "0.7012157", "text": "def job_title\n return @job_title\n end", "title": "" } ]
[ { "docid": "a78f13613821244769854fe059b71be2", "score": "0.6530419", "text": "def get_title(job)\n job.search(\"h3\").text.strip\n end", "title": "" }, { "docid": "dedd1cef7063368ca3ee4e266c8db7d0", "score": "0.6424466", "text": "def job_title=(value)\n @jo...
aefa8d90f52f31a413fe56d7e1a86ee1
Returns concatenation of first and last names if person, otherwise returns name. Thus, if you wanted to, for example, iterate over search results and output the name, you could do so without checking entity type first.
[ { "docid": "a6e6d63f1a204e23854c45ede4340b62", "score": "0.65779984", "text": "def name\n if @namespace == \"person\"\n @first_name + \" \" + @last_name\n else\n @name\n end\n end", "title": "" } ]
[ { "docid": "d5aba45b654e5c5984ad2567844a409a", "score": "0.72772914", "text": "def person_name \n \"#{person.first} #{person.last}\"\n end", "title": "" }, { "docid": "5739fda430e59a9c7153045d2ae60b3f", "score": "0.7267522", "text": "def person_entity_display_name(person_entity, ...
8af09f83c1917e76bdc0fbf8e0eb834b
GET /rumors/1 GET /rumors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ab4fdc7df3211fe71d2739cd47029f01", "score": "0.77128285", "text": "def index\n @rumors = Rumor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rumors }\n end\n end", "title": "" }, { "docid": "9f653227a9d5bfdbc67550a...
bcbb71fcbdb6802f899dda161d5cffe6
GET /dummy POST /dummy PUT /dummy PATCH /dummy DELETE /dummy
[ { "docid": "63de8568f8785598a163d2525469d37b", "score": "0.0", "text": "def index\n #Does nothing really... (Except create log)\n\n render json: \"success\"\n end", "title": "" } ]
[ { "docid": "ade43359931a8158bc17b1b039ca8b28", "score": "0.6153454", "text": "def destroy\n @dummy = Dummy.find(params[:id])\n @dummy.destroy\n\n respond_to do |format|\n format.html { redirect_to dummies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "a02fdfddf92e407d8fb4b029d8245589", "score": "0.0", "text": "def stadium_params\n params.require(:stadium).permit(:name,:city)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
c0f9bba152146dc911fa4e5ec22661ed
method for passsing in an address that can be added to the google maps url to return the lattitude, longitude, and other locations specific info
[ { "docid": "d56c1fd41eec9ce59a7746581f0e2ea2", "score": "0.6730102", "text": "def initialize(address)\n\t\t@base_google_maps_url = \"http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=\"\n\t\t@location = address\n\t\t@lat = \"\"\n\t\t@long = \"\"\n\t\t@sublocal = \"\"\n\t\t@state = \"\...
[ { "docid": "c0038040497f646be5c745d4443dc548", "score": "0.77902496", "text": "def gmaps4rails_address\n latlon\n end", "title": "" }, { "docid": "704091273114ce8b9d7c77f00f3503bc", "score": "0.7663375", "text": "def gmaps4rails_address \n address\n end", "title": "" ...
1d99f5377a96aed96c511d24be8b47f2
ligne pour appeler la fonction
[ { "docid": "5a7233e142a7754b874d09567ce24992", "score": "0.0", "text": "def ask_first_name #fonction dont le role est d'afficher \"bonjour + first name\"\n\tputs \"Quel est ton prénom ?\"\n\tprint \">\"\n\tfirst_name = gets.chomp\n\treturn first_name\n\t\nend", "title": "" } ]
[ { "docid": "9da75f38bbbf324b100402649a37d15c", "score": "0.6783748", "text": "def studliga\n\n end", "title": "" }, { "docid": "4fe655da88e61d28e8b9a9ed964af838", "score": "0.6641103", "text": "def imprensa\n\t\t\n\tend", "title": "" }, { "docid": "26da328e8cf814fdc197fd...
2a676f9f69092e36b06920d145b10267
Get the tags for this learner Get the tags for this learner
[ { "docid": "ea6ac834eef2f4185ddb3aad73d82a63", "score": "0.0", "text": "def get_learner_tags_with_http_info(learner_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LearnerApi.get_learner_tags ...'\n end\n # verify the required parame...
[ { "docid": "36bdb481d6be054bd773cd960d3c2a46", "score": "0.7348168", "text": "def tags\n return @tags\n end", "title": "" }, { "docid": "36bdb481d6be054bd773cd960d3c2a46", "score": "0.7348168", "text": "def tags\n return @tags\n end...
c09e1f25905f20c2599247ac7cbe89a3
add_breadcrumb I18n.t('navigation.page.product'), :products_path, only: [:show] GET /products GET /products.json
[ { "docid": "674a3b887f6d0d7c407539bae71be1b5", "score": "0.717015", "text": "def index\n @products_grid = initialize_grid(Product.all)\n\n add_breadcrumb I18n.t('navigation.page.product'), nil\n end", "title": "" } ]
[ { "docid": "ed62ee4b26672c6b567a7eb25068dc73", "score": "0.80103326", "text": "def show\n add_breadcrumb \"#{@product.recipe.name}\", :product_path\n end", "title": "" }, { "docid": "b1c463bfda0722cfafd8906cf67166a7", "score": "0.773324", "text": "def show\n add_breadcrumb ...
6ec94c41d23358ced68a405ac5ffd30d
A version with an incremented version number that would be applied after the latest (local or applied) migration.
[ { "docid": "08eab6bdb4601469f4deb478ec680803", "score": "0.661586", "text": "def next_version(bump_type=nil)\n local_max = local_versions.max || Version.new('0')\n applied_max = applied_versions.max || Version.new('0')\n max_version = [local_max, applied_max].max\n max_version.next(...
[ { "docid": "32e712acec1aee74293cdce04d7991c3", "score": "0.7489249", "text": "def next_version\n (new_record? ? 0 : versions.calculate(:maximum, version_column).to_i) + 1\n end", "title": "" }, { "docid": "33d4a749b8bf2e23ae57f671f2a00015", "score": "0.7220128", "text...
bfde52d0152b0e8e4cd65fbfcb0a1151
:callseq: ot.get(key) ot.send(key) ot[key] You can use get to access member object values instead of the >> syntax. Unlike >>, this works for keys with spaces, or keys that have the same name as methods on Object.
[ { "docid": "d4089247d939df9faead775f78fea404", "score": "0.0", "text": "def get(key); @store.octothorpe_store[octokey key]; end", "title": "" } ]
[ { "docid": "76b121f5bdc4e6837e683d7992f29175", "score": "0.73201686", "text": "def send key, value\n method_missing key, value\n end", "title": "" }, { "docid": "3725b4b192e57d14e424f3999b465c6f", "score": "0.7047996", "text": "def []( key ) send( key ); end", "title": ""...
df925c694df79c966d5a68e67e8085bf
Returns the value if has a value Blocks until a value it set
[ { "docid": "3959fc2ffe683151c59133b622548027", "score": "0.78608334", "text": "def value\n if @has_value\n return @value\n else\n @mutex.synchronize {\n @condvar.wait(@mutex, @timeout)\n return @value\n }\n end\n end", "title": "" } ]
[ { "docid": "31fd5d476fd28e709bf663e52ea4387b", "score": "0.7410398", "text": "def value\n\t\treturn @value if delivered?\n\n\t\tmutex.synchronize {\n\t\t\tcond.wait(mutex)\n\t\t}\n\n\t\t@value\n\tend", "title": "" }, { "docid": "19439622c89dde413eef604d63b30c81", "score": "0.7113347", ...
2745178e0a01a53897c6f6a553042155
GET /privileges GET /privileges.json
[ { "docid": "e6a47dc88914e272462dbd041841372a", "score": "0.7178544", "text": "def index\n @privileges = Privilege.all\n end", "title": "" } ]
[ { "docid": "04dc9b08546d23c5d2eee94d0a819d91", "score": "0.7383657", "text": "def get_privileges(opts = {})\n data, _status_code, _headers = get_privileges_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "a92cf217319962777a8733046e5448b3", "score": "0.72432595"...
14af6cc9b86f7a803e95702249b1b124
This function identifies all AppleNote potential objects in ZICNOTEDATA and calls +rip_note+ on each.
[ { "docid": "0af919d0b4a462535647ee7be32c6d0d", "score": "0.6568238", "text": "def rip_notes()\n range_start_core = (@range_start - 978307200)\n range_end_core = (@range_end - 978307200)\n @logger.debug(\"Rip Notes: Ripping notes between #{Time.at(range_start)} and #{Time.at(range_end)}\")\n ...
[ { "docid": "a05d7da0cf14ccc6b2597d155f2f5101", "score": "0.6947404", "text": "def rip_notes()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICNOTEDATA.ZNOTE FROM ZICNOTEDATA\") do |row|\n self.rip_note(row[\"ZNOTE\"])\n end\n end\n\n if @version == IOS_LEGACY_VER...
df1aed0a4600006ec70d860ac878bf04
Sends a 'like' to 500px, returning a boolean to indicate success or failure.
[ { "docid": "a7c2bac578a08a1e322aed927e8897d8", "score": "0.5860158", "text": "def like(id)\n @client.post(\"photos/#{id}/vote?vote=1\").success?\n end", "title": "" } ]
[ { "docid": "333d11c7bd58dbf8697794252e52091b", "score": "0.6891309", "text": "def like!(user)\n response = @client.quill.post \"/api/v3.0/message/#{id}/like/\", {:collection_id => conversation.id, :lftoken => user.token}\n if response.success?\n true\n else\n raise APIExcept...
72df8adcf114f0c2e7c57b98ebda4171
move the object to the target path prefix and return the path the object was moved to
[ { "docid": "ff2884e7ab718c27499e72a694835201", "score": "0.7314651", "text": "def move_s3_object(obj, target_path_prefix)\n move_target_key = \"#{target_path_prefix}/#{layer_name_with_extension(obj.key)}\"\n obj.move_to(\n bucket: BUCKET,\n key: move_target_key\n )\n\n ...
[ { "docid": "7de75f8f9f401b50e28810d50083e5a5", "score": "0.71903634", "text": "def move!(new_path); end", "title": "" }, { "docid": "fd95c504fcf0c36b81be687678c14b58", "score": "0.6774222", "text": "def move(to_path)\n self.cloud_api.move(self, to_path)\n end", "title": "" ...
dec3590c1b5aa992d126c9547d27d69c
Aircraft model plus the registration and aircraft name if available
[ { "docid": "774b91cc3e139d8c75c377f62490787e", "score": "0.56588805", "text": "def aircraft_description\n s = aircraft_type\n\n extra = []\n extra.push aircraft_registration unless aircraft_registration.nil?\n extra.push \"\\\"#{aircraft_name}\\\"\" unless aircraft_name.nil?\n\n if !extra...
[ { "docid": "9c68404652294ca86c78ff9698a4441e", "score": "0.6532589", "text": "def selected_aircraft_info!\r\n # --------------------------------------------------------------------------\r\n # TODO: Prompt for an aircraft model as the input and use .typeinfo instead.\r\n # This way ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "186fe3e59bbe968aee6d2e7bdd6a7143", "score": "0.0", "text": "def set_translatorused\n @translatorused = Translatorused.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
67277383d671ce32f9f5604b833692fa
this method is called from groups_assign using delayed_job therefore this gets executed in background this assigns the groups to the package
[ { "docid": "c241f7b3e1600bebd2ed3424f20b34fc", "score": "0.578942", "text": "def calculate_delayed_group_learners(groups_to_be_assigned,current_user_id,package_id)\n current_user = User.find(current_user_id)\n package = Package.find(package_id)\n groups_to_be_assigned.each { |g|\n #get all...
[ { "docid": "3e6c8c9e9c9a9bb0e0553c0a5823cad8", "score": "0.77831966", "text": "def groups_assign(groups_to_be_assigned,package)\n groups_delayed = Array.new\n groups_to_be_assigned.each { |g|\n groups_delayed << g[0].to_i\n }\n current_user_id = current_user.id\n #call calculate_dela...
9045e10a75e0e129cf902b7c248e5bce
GET /table2s/1 GET /table2s/1.json
[ { "docid": "e7e5d85aca81086a28e9424ee8113a61", "score": "0.7546781", "text": "def show\n @table2 = Table2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table2 }\n end\n end", "title": "" } ]
[ { "docid": "f4f2306617a0e49e577289832716c28c", "score": "0.6591401", "text": "def new\n @table2 = Table2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table2 }\n end\n end", "title": "" }, { "docid": "5ce52391084eeb96a8013183d8d...
357584be4aee13c11b85987b8bbe849a
GET /besoin_humains/1 GET /besoin_humains/1.xml
[ { "docid": "169bcdc39f5960d2fbfc5a492d72f49f", "score": "0.7421528", "text": "def show\n @besoin_humain = BesoinHumain.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @besoin_humain.to_xml }\n end\n end", "title": "" } ]
[ { "docid": "1945816b31552af5fa3d6fb25d2c592d", "score": "0.71307397", "text": "def index\n @besoin_humains = @association.besoin_humains\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @besoin_humains.to_xml }\n end\n end", "title": "" }, ...
27647e66b0a3becf30c635f375c0792f
Convert to list using recursion
[ { "docid": "039f1a9b4190ed38b0427570164a26dd", "score": "0.64115274", "text": "def convert_to_list(node,div)\n\tmod = div%10\n\tdiv = div/10\n\tif div == 0 && mod == 0\n\t\treturn nil\n\tend\n\tnode.next = Node.new(mod)\n\tconvert_to_list(node.next,div)\nend", "title": "" } ]
[ { "docid": "d4434bf3e64fc3a6624ffe7573f15126", "score": "0.64698726", "text": "def return_list\n\t\tarr = []\n\t\tcurrent_node = @head\n\t\twhile current_node do\n\t\t\tarr << current_node\n\t\t\tcurrent_node = current_node.next\n\t\tend\t\n\t\tarr\n\tend", "title": "" }, { "docid": "a908317...
cd2af6d8a8fe85dcf1212d4c5ce9e59d
Replace document square annotation
[ { "docid": "4efd150cac1d89903713818449147331", "score": "0.0", "text": "def put_square_annotation(name, annotation_id, annotation, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_square_annotation_with_http_info(name, annotation_id, annotation, opts)\n ...
[ { "docid": "1b86b38309513956fa41806b0049d2a1", "score": "0.6619264", "text": "def strip_annotations(content); end", "title": "" }, { "docid": "a7a9cf9d365088c03f4876141a14597a", "score": "0.63354915", "text": "def editAnnotation ## accepts annotation id\n \n\t# Deprecate the old ann...
731d8847af817710b2c0d4d31a622924
Firefox does some fancy work that seems important here. I don't know precisely what it is, but doing this in various places tends to eliciit different results.
[ { "docid": "34722da6919a871d619a6de64fc10dc2", "score": "0.5442469", "text": "def run_firefox_if_needed\n if @firefox_needs_run\n converge_by \"briefly run firefox to have it set up the newly-created profile\" do\n pipe = IO.popen [firefox_bin, \"-P\", new_resource.profile_name]\n sleep 5\...
[ { "docid": "110570677937e800bbc37a326066f65c", "score": "0.5941491", "text": "def badbrowser\n end", "title": "" }, { "docid": "33ab105f935f71467912fe85cb029fde", "score": "0.57274455", "text": "def desiredBrowser\n #:htmlunit\n #:chrome\n :firefox\n #@caps\nend", "title": "...
fc8fda5890db418c73e23fdd9d11bd7b
lexer rule r_float! (R_FLOAT) (in Hephaestus.g)
[ { "docid": "d2e4e327f95655edd96b7b76b3a16ef3", "score": "0.81768644", "text": "def r_float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n\n type = R_FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - ...
[ { "docid": "fc68df27b01b9818391b6f71da74b435", "score": "0.7542491", "text": "def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n...
84257283fc48dfde2c579bf0beb8ecba
Format the clippings to .org format.
[ { "docid": "f780f7748f63f185f6f855cb0a3513e5", "score": "0.57559943", "text": "def format\n puts '* Kindle Clippings'\n @notebook.each do |title, info|\n puts '** ' + title\n info.each do |clipping|\n puts '- ' + clipping.content\n end\n end\n end", "title": "" } ]
[ { "docid": "7af39da59ebe7e5dad77535e6efcd73b", "score": "0.5690884", "text": "def formatAPA\n (prettyOutput(@authors.map { |x| x.to_s }) + \"(\" + @date.year.to_s + \") \" + @title +\n \"\\n\\t(\" + @edition.to_s + \") \" +\n \"(\" + @editionnumber.to_s + \") \" +\n ...
99fd7afeaad6abf9d0d67568c9e66a01
POST /serviced_zips POST /serviced_zips.xml
[ { "docid": "2d93b2444e541d3cb1cb190ad4070be5", "score": "0.6264726", "text": "def create\n @serviced_zip = ServicedZip.new(params[:serviced_zip])\n if @serviced_zip.save\n flash[:notice] = 'Route was successfully created.'\n redirect_to :back\n else\n render :action => \"n...
[ { "docid": "7fbe855047da63df795601a8fc18b8ea", "score": "0.65704393", "text": "def create\n @zip = Zip.new(zip_params)\n\n respond_to do |format|\n if @zip.save\n format.html { redirect_to @zip, notice: 'Zip was successfully created.' }\n format.json { render :show, status: :cre...
5d791013deb8d3ea6c05fd16ebf2a81e
Initialize the query: create the rules based on the list of hosts extracted from the input file
[ { "docid": "4b18320205a7cfcb3047035d139c4c4c", "score": "0.5709076", "text": "def initialize(input, lang, filter)\n super()\n\n raise Xi::ML::Error::ConfigError, \\\n \"Unknown argument '#{filter}'. Choose from #{FILTERS}\" \\\n unless FILTERS.include?(filter)\n\n @input = input\n ...
[ { "docid": "5e4f0f1562588585d5b3f23518097266", "score": "0.62795293", "text": "def filter_by_host(hosts)\n rules = []\n count_urls = 0\n\n hosts.each do |item|\n # get the host (check if simple String or URL)\n if URI(item).host.nil?\n host = item\n else\n host = UR...
6771289de60164af6a893906fd3b09d2
PUT /fbl_units/1 PUT /fbl_units/1.json
[ { "docid": "4af47f384c4776534d96186579dddfeb", "score": "0.6977476", "text": "def update\n @fbl_unit = FblUnit.find(params[:id])\n\n respond_to do |format|\n if @fbl_unit.update_attributes(params[:fbl_unit])\n format.html { redirect_to @fbl_unit, notice: 'Fbl unit was successfully upda...
[ { "docid": "aa2a723238171d495983deb9afef1e83", "score": "0.7094918", "text": "def update\n @unit = Unit.find(params[:id])\n\n if @unit.update(unit_params)\n head :no_content\n else\n render json: @unit.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { ...
c32ee727b0a524770decbb37e56ea269
devuelve un mapa con los nombres de las variables y sus valores
[ { "docid": "e098911135309485feaf053d3f6aa3b4", "score": "0.0", "text": "def properties\n mapa = {}\n self.instance_variables.each do |selector|\n mapa[selector] = self.instance_variable_get selector\n end\n mapa\n end", "title": "" } ]
[ { "docid": "afbf2a667d689d76f845e507bb8b8fc2", "score": "0.65928406", "text": "def strand_maps\n self.variables.to_a\n end", "title": "" }, { "docid": "37c95c98dc172a5958d17a3d0b7b2c44", "score": "0.6465411", "text": "def vars var_dict\n var_dict.each_pair { |k, v| mf.variable...
9c38387518159bc3801c7555754ac80a
DELETE /packs/1 DELETE /packs/1.xml
[ { "docid": "7b54b89fd89556b75ac9e9ce4cb06178", "score": "0.7685366", "text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to(packs_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "aa87577c41551597e276bb7e78afdc78", "score": "0.76866466", "text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_packs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, ...
9a24a1a1833907c498ab12fe2855fda9
Execute a raw SQL statement Set trans = false to force and disable transactions
[ { "docid": "58412f2a7016f8401461b0818ff64750", "score": "0.7535201", "text": "def execute(sql, trans=true)\n start_transaction if trans\n end_transaction if @transaction and not trans \n\n # $log.debug \"LOG-SQL: #{sql}\"# if @config[:verbose]\n\n # run the query\n #puts \"<#{sq...
[ { "docid": "dee6549d7a3713541a2efca53e720d77", "score": "0.7107806", "text": "def direct_sql(transaction, sql)\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "2506dc5dc54dfb0604d0259723524d4d", "score": "0.6847712", "text": "def do_execute(sql, n...