query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "6304bb28630a342f3217ed6607ad9bb8", "score": "0.0", "text": "def quiz_topic_params\n params.fetch(:quiz_topic, {})\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
954bf6c4ee669305e83891a7ec1c6dd8
If an external search index was explicitly enabled by the user, then we expect that both internal search services should be disabled.
[ { "docid": "c240630aa5639f3cab7538fea059f76e", "score": "0.699911", "text": "def verify_op_disabled_if_user_set_external_opensearch\n if external? && opensearch_enabled?\n fail_with err_OPENSEARCH005_should_disable_opensearch\n elsif cfg_erchef_attr['search_auth_username'].nil? && cfg_erchef_...
[ { "docid": "a2d3cde9a61abc6f35bfd23f55d3509a", "score": "0.7565308", "text": "def verify_es_disabled_if_user_set_external_solr\n if external? && elasticsearch_enabled?\n fail_with err_INDEX005_should_disable_es\n end\n end", "title": "" }, { "docid": "f25fa695490063b3c14d7514351e...
82e27d2e6dca27311090bc5f3f47098f
Moves a record into a household
[ { "docid": "a71fc8368a792906959afb97afa0fe02", "score": "0.0", "text": "def move_to_household\n new_hoh_id = params.permit(:new_hoh_id)[:new_hoh_id]&.to_i\n current_patient_id = params.permit(:id)[:id]&.to_i\n\n current_patient = current_user.get_patient(current_patient_id)\n new_hoh = curre...
[ { "docid": "d233b118e43f7182eb22b7f6ff7291ac", "score": "0.64970666", "text": "def move!( move )\n move_and_record(move)\n end", "title": "" }, { "docid": "384b9081439f8a3dde72a1e38e5683f1", "score": "0.5974057", "text": "def move_and_record( move )\n #lift your piece off the ...
b1fe033e7f1b384aa552bae2b8f43013
columns that will be exposed for changing (akin to 'permitted_params')
[ { "docid": "018337de0d23382ae8c96dd40cf610c1", "score": "0.0", "text": "def included_mutation_columns\n self.included_query_columns - [\n 'id',\n 'uuid',\n 'created_at',\n 'updated_at',\n 'children_count'\n ]\n end", "title": "" } ]
[ { "docid": "fb732411d0c6ac318ad1908a8cdd24d8", "score": "0.8245517", "text": "def permitted_columns\n\t\t\t\t\tself.class.permitted_columns\n\t\t\t\tend", "title": "" }, { "docid": "fb732411d0c6ac318ad1908a8cdd24d8", "score": "0.8245517", "text": "def permitted_columns\n\t\t\t\t\tsel...
1bebade24f34a8ce5439a96697246afe
Identify and describe the Ruby method(s) you implemented. Person 5
[ { "docid": "e27e28838549b6f74e148510adf92d2c", "score": "0.0", "text": "def my_array_splitting_method(array)\n num_array = array.grep(0..100)\n str_array = array.grep(String)\n return num_array, str_array\nend", "title": "" } ]
[ { "docid": "f4ad13bf5fa71b1e7bc47220336ffdbf", "score": "0.7144192", "text": "def methods() end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.7030672", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd7...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "60730562cab3ea9fb724ec1e420248d3", "score": "0.0", "text": "def set_user_organization_filter\n @user_organization_filter = UserOrganizationFilter.find_by_object_key(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "de...
f9aeb871bb1efff3e9eeee6586123034
POST /events POST /events.json
[ { "docid": "f4a058898c3926d59689ae5fee81115a", "score": "0.718174", "text": "def create\n @event = Event.new(params[:event])\n\n #respond_to do |format|\n if @event.save\n # format.html # { redirect_to @event, notice: 'Event was successfully created.' }\n # format.json { render js...
[ { "docid": "8beb709b44028dcb6cde70ea2be23fa3", "score": "0.76767963", "text": "def create\n megam_rest.post_events(to_hash)\n end", "title": "" }, { "docid": "2eac2345f845c02c8478dafe0b803519", "score": "0.75318", "text": "def create\n @event = Event.new(event_pa...
1a88fe612c99bcf2aec2f8193a7b5b68
DELETE /posts/:post_id/comments/1 DELETE /posts/:post_id/comments/1.json
[ { "docid": "2c44ffa32e07bc25a2916530faf5ee2c", "score": "0.0", "text": "def destroy\n\t\t@comment.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to @post, notice: 'Comment was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n format.js { render action: \"relo...
[ { "docid": "0678185c52e83aa5cf7f76163178cd2b", "score": "0.83046967", "text": "def destroy\n @post = Post.find(params[:post_id])\n @comment = @post.comments.find(params[:id])\n @comment.destroy\n \n respond_to do |format|\n format.html { redirect_to post_path(@post), notice: \"Commen...
a8d96eb8144d5a700f9a13bb524f87e1
POST /posts or /posts.json
[ { "docid": "7b806930050a940660aef3c3f9896bb3", "score": "0.0", "text": "def create\n # raise 'Params are not permitted' if post_params.permitted!= true\n @post = Post.new(post_params)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was succe...
[ { "docid": "1ca5f2c21af5ddfbbcd53b4ca31817a0", "score": "0.7122264", "text": "def post(*args)\n request :post, *args\n end", "title": "" }, { "docid": "9b1182bed81f6c7622228e2ed62339ab", "score": "0.6957077", "text": "def post(path, *args)\n map(:POST, *args)\n end", ...
7b0d1e44b8cbc76ed6e0e909e532adca
Do you need a note to know this is the border?
[ { "docid": "d5a8350b71de06bb570c1bb0f8d7e760", "score": "0.0", "text": "def game_board_border\n puts @pastel.blue(\"<o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o><o>\")\n end", "title": "" } ]
[ { "docid": "85d32e85fbed41fd9d037b3e65c81e52", "score": "0.8129956", "text": "def border?\n @type == :border\n end", "title": "" }, { "docid": "b1d9a80401ab4c8c8dd757b1eae740c1", "score": "0.7827441", "text": "def isBorder\n return true if @type == -1\n end", "title": "" ...
885c91b10f535a78b0cb8171afe44e12
Create a new category sprite
[ { "docid": "bf1b690bd1fc5c6e935b0a39bd060d4f", "score": "0.0", "text": "def initialize(viewport)\n super(viewport, 1, GameData::Type.all.size)\n set_bitmap(IMAGE_NAME, :interface)\n end", "title": "" } ]
[ { "docid": "49a8b0be1a2f000d2f595c5931357f35", "score": "0.6657342", "text": "def uhook_create_category\n ::Category.new(params[:category])\n end", "title": "" }, { "docid": "c270d86c27516489c1715b0a6eae5516", "score": "0.65658903", "text": "def create\n # crea...
3d2a89dfaf1a0eeb7d65429ae2d84371
Returns the file permissions of a given file. This is fairly unix specific and probably doesn't belong in this class. Will be refactored out later.
[ { "docid": "f3b1dd3ad548c95457e8abececf278c7", "score": "0.6834385", "text": "def file_perms(path)\n perms = sprintf(\"%o\", File.stat(path).mode)\n perms.reverse[0..2].reverse\n end", "title": "" } ]
[ { "docid": "6ad01b778ddbede16448fb2f8724399d", "score": "0.70614535", "text": "def updatedb_file_permissions(file)\n meta = updatedb_file_ls(file)\n if meta\n permissions = meta.split(\" \")[0]\n permissions\n else\n nil\n end\n end", "titl...
a5bf0877f589deaecd0d846ac5b78fd3
Prepare method to create products
[ { "docid": "9d329442efabf042944a27a3f4ae68a6", "score": "0.64472395", "text": "def create_product(store:, name:, id_from_provider:, category:, url:)\n product = Product.find_by store: store, name: name\n\n return product if product\n\n Product.create store: store, name: name, id_from_provider: id_fro...
[ { "docid": "9bbad68e65383d9016922e9751078e18", "score": "0.7338895", "text": "def create_full_product\n generate_product_name\n generate_product_code\n generate_product_manufacturer\n generate_product_description\n generate_product_price\n end", "title": "" }, { "docid": "465...
fabcdc25d47710ccdad76ade8c61e18f
This function will generate the TPL cache for a view of type display
[ { "docid": "55e7f606fc6c6804f859b7cf429ee601", "score": "0.63861984", "text": "def render_display_tpl_cache\n # TODO: can probably move most of this function to a general function call\n # and re-use between render_view_js_cache and renderViewHTML\n field_handler = FieldR8.new(self)\n r8TPL ...
[ { "docid": "4ba8e3af260f233a016010baf53fbd13", "score": "0.6754247", "text": "def render_views_for_cache\n args = {\n denied_task: nil,\n home_view: :open,\n inc_name: \"_main\",\n inc_syntax: \"_main|open\"\n }\n %w(Home Companies Metrics Topics Overviews Notes Sources).each do |name|\n ...
b4dbc793497a66e10ee74123be334043
Clones the backends repo and checkout the proper tag, only if not already present
[ { "docid": "d772fbac647a35373647532411f86b29", "score": "0.6928282", "text": "def downloadAndCheckout\n if Dir.exist?(SRC_DIR)\n puts \"Already downloaded sane-projets/backends\"\n puts \"\"\n return\n end\n\n puts \"Cloning sane-projets/backends\"\n systemWithLog(\"git ...
[ { "docid": "71b77d5b763d3a515e49394d39e7f245", "score": "0.6122372", "text": "def add_template_repository_to_source_path\n if __FILE__ =~ %r{\\Ahttps?://}\n require 'tmpdir'\n\n source_paths.unshift(tempdir = Dir.mktmpdir(DIR_NAME + '-'))\n at_exit { FileUtils.remove_entry(tempdir) }\n run(...
ed0cc92ba57a3b20ac3b32070d56b6e1
invoked on incoming request
[ { "docid": "9039a6eac2d3bd1eb6b3526e600ba62c", "score": "0.0", "text": "def _on_request(request)\n _update_and_check_dialog_state_on_request(request)\n @offer_answer.handle_incoming_request(request) if @offer_answer\n \n # We forward the CANCEL to the transaction being canceled only after th...
[ { "docid": "629b2179e67a520aa5f6036b586147b0", "score": "0.8392402", "text": "def _on_request; end", "title": "" }, { "docid": "c1472dbef66c5465ed474a0547a208dc", "score": "0.81720656", "text": "def on_request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f...
4d9c7f56b28b5b2e96b94c6c5a272245
Returns array of best efforts for a certain distance ordered from best to worst. Each entry is an array [timeinseconds, startdateinseconds]
[ { "docid": "c122ba7634a5563debf8401affd657b3", "score": "0.734644", "text": "def best_efforts_for_distance(distance)\n return @db.execute('SELECT best_effort.elapsed_time, activity.start_date\n FROM best_effort\n JOIN activity\n ON ...
[ { "docid": "ac725f987622b27e1294fb0d0476c724", "score": "0.63037527", "text": "def best_efforts_for_activity(activity)\n return @db.execute('SELECT distance, elapsed_time\n FROM best_effort\n WHERE activity_id = ?\n ORDER BY distanc...
f0817e1fdc89a52fba8cabab54a42b90
Determine the page number for the given page name
[ { "docid": "1f1dbbc990621123b286a7602a34d14e", "score": "0.7832", "text": "def page_number_for(name, response)\n response.result['meta']['links'][name.to_s].split('=').last.to_i\n rescue NoMethodError\n nil\n end", "title": "" } ]
[ { "docid": "683fe63627cadac661ade3fabf8899fa", "score": "0.71984285", "text": "def calculate_page_number(page)\n result = page - 1\n result.negative? ? 0 : result\n end", "title": "" }, { "docid": "be24360d85a99f8a3a0b7d6805ae8ed0", "score": "0.7100187", "text": "def pag...
0adee866b2ec9f3dbb86d8a645e1175e
Runs two seperate methods: predicted_deaths and speed_of_spread. See below for more.
[ { "docid": "0aea1ff6270ed24ee8d362f8d72bccff", "score": "0.0", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" } ]
[ { "docid": "ca25261df4564636eeed1ea380f2d352", "score": "0.71354353", "text": "def virus_effects\n speed_of_spread(predicted_deaths()) \n\n end", "title": "" }, { "docid": "532f4462677dfce66073e2766f428304", "score": "0.7061073", "text": "def virus_effects \n predicted_deaths...
a23ae58f076859f380dcb35482100276
Keep only the permission bits. => 420 That is, 0644 octal.
[ { "docid": "ccc7c9b9e9d3aacb8ffa18ea71879b0e", "score": "0.0", "text": "def what_can_i_do?\n sys = Process::Sys\t\n puts \"UID=#{sys.getuid}, GID=#{sys.getgid}\"\n puts \"Effective UID=#{sys.geteuid}, Effective GID=#{sys.getegid}\"\n\n file = '/bin/ls'\n can_do = [:readable?, :writable?, :executabl...
[ { "docid": "f808e9f0a96979de1424e5a10f4bbf64", "score": "0.7110658", "text": "def clean_file_permissions path\n perms = if path.mach_o_executable? || path.text_executable?\n 0555\n else\n 0444\n end\n if ARGV.debug?\n old_perms = path.stat.mode\n if perms != old_perms\n ...
61a46abc30b113f1533ee2d7744b171b
GET /terrains/1 GET /terrains/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d2f57332e6166a336bb9978c2046eee8", "score": "0.6433577", "text": "def index\n @terrains = Terrain.all\n end", "title": "" }, { "docid": "20b472e87303a57963e31b1574066072", "score": "0.6428897", "text": "def show\n @slitter = Slitter.find(params[:id])\n\n respond...
8dbbe4bb5a36bc7b683c5d8f15527988
Delete the record corresponding to the given id
[ { "docid": "17666ab3bd00c84c4702b106aa6e5a9d", "score": "0.77079135", "text": "def delete(id)\n adapter.exec_prepared(\"delete_#{table_name}\", delete_sql, id)\n end", "title": "" } ]
[ { "docid": "2784c9cfaab5b5089058a90d42fab068", "score": "0.880825", "text": "def delete_by_id(id)\n delete(id)\n end", "title": "" }, { "docid": "290b1fabe2547d18d68edfdee2e7215a", "score": "0.87717915", "text": "def delete(id)\n read_or_die(id)\n\n Pod4.log...
0e9d1f031bfa41a5ad93fc9b8751deb0
GET /auction/promotion_activity_apply_products GET /auction/promotion_activity_apply_products.json
[ { "docid": "f92fd275729e3f98915749a78b455454", "score": "0.7556139", "text": "def index\n @auction_promotion_activity_apply_products = Auction::PromotionActivityApplyProduct.all\n end", "title": "" } ]
[ { "docid": "c47453d585c878eb75b80c0496aa4161", "score": "0.6945045", "text": "def set_auction_promotion_activity_apply_product\n @auction_promotion_activity_apply_product = Auction::PromotionActivityApplyProduct.find(params[:id])\n end", "title": "" }, { "docid": "407c2a9ccfce033dc0b...
93369e6298122ab1b75edc155a24adc8
GET /ent_items/1 GET /ent_items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.7230387", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "760567cb51d0bd992eef5f84e80bcac5", "score": "0.71551526", "text": "def index\n @ent_items = EntItem.all\n end", "title...
e6a11bec01c4b0c657660cdb1a475e86
Create outbound_admin_notification and outbound_event
[ { "docid": "f61bc9e1603bfd6b416e3877febf3555", "score": "0.58134186", "text": "def signup_outbound\n if self.confirmed_at_changed?\n Outboundmail.register_user(self)\n event_properties = {:user => self}\n Outboundmail.outbound_admin_notification(\"sign_up\", self, event_properties)\n ...
[ { "docid": "07b427c4cd8186007b93c70a5b26d8ad", "score": "0.6744155", "text": "def send_outbound_create_event\n # check for the therapist associated with this appointment\n send_outbound_event(\"created\")\n end", "title": "" }, { "docid": "8302487dfb3dc53b6391ebb0ae6fdaad", "score...
58f9840cfc3f6bad3c4e20efcf5aa9a9
For testing with predicates. Eg: assert_predicate str, :empty? This is really meant for specs and is frontended by assert_operator: str.must_be :empty?
[ { "docid": "def958c098f68e8eca7f22a928277363", "score": "0.64398956", "text": "def assert_predicate o1, op, msg = nil\n msg = message(msg) { \"Expected #{mu_pp(o1)} to be #{op}\" }\n assert o1.__send__(op), msg\n end", "title": "" } ]
[ { "docid": "9553485e67fed4c943f7034c0c8c0471", "score": "0.7429949", "text": "def strict_predicate_matchers; end", "title": "" }, { "docid": "a541baa7259c3d28ea262cded20b78c5", "score": "0.6801115", "text": "def test_assert_predicate\n object = 1\n predicate = :even?\n ...
ef30b369534739215f385cd4eef0938f
Gets the client profile
[ { "docid": "98856197679c11c31309ed7f29c278b5", "score": "0.76529056", "text": "def profile\n get(\"core/getUserProfile\", Profile, :session_token)\n end", "title": "" } ]
[ { "docid": "66ffa4a5d0c43ea1617ff33794cd6028", "score": "0.8096328", "text": "def profile\n @client.profile(userId)\n end", "title": "" }, { "docid": "d64a39a93bb993affbca1387f24f27fa", "score": "0.8071986", "text": "def get_client_detail\n get(\"profile/detail\")\n ...
35ff800fa4a1b06ef96877593876fc09
Export AT files in `/content` for Gap mark tagging.
[ { "docid": "453350b8f938e15996be55aec340b42a", "score": "0.71495163", "text": "def export_gap_mark_tagging(options)\n input_base_dir = config.compute_base_dir(options['base-dir'] || :content_dir)\n input_file_selector = config.compute_file_selector(options['file-selector'] || :all_files)\n...
[ { "docid": "a8212e9b0c850a93fffccc2625a841fd", "score": "0.627376", "text": "def export\n Tag.dump data, path\n end", "title": "" }, { "docid": "3dd623c2a51294f488aa67cf1fd9533f", "score": "0.6167677", "text": "def export\n raw_content_at = @content_at_file.conte...
270a6b67e2ce054297926293561e3334
Imports multiple new contacts into the contacts collection from CSV, JSON, or XML (based on content type).
[ { "docid": "0040994e53c3e761376ff070be2d61bf", "score": "0.0", "text": "def post_contacts_with_http_info(account_id, contact_mod_request)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.post_contacts ...\"\n end\n # verify the required pa...
[ { "docid": "655a6742dda96e41df2e60646ece0562", "score": "0.8073935", "text": "def import_contacts\n account_hashes = CsvTool.new(Contact).iterate_csv\n # contact_hashes = CsvTool.new(Contact).iterate_csv_w_error_report\n contact_hashes.each { |hash| parse_contacts(hash) }\n end", "title": ...
57c09f6c2e277343a07a366425b74771
Updates cart summary price
[ { "docid": "a991158951798971cb7a31fa24ddb6bc", "score": "0.7616815", "text": "def update_cart_sum\n cart.recalc_sum\n end", "title": "" } ]
[ { "docid": "726fbfcb599d829e450b080b8ab43107", "score": "0.778001", "text": "def update_total_price_and_quantity_in_cart\n \n # update price and quantity\n cart = get_current_cart\n price = 0\n quantity = 0\n cart.items.each do |item|\n price += item.price*item.quant...
091a5a27fc1942edc53427e1f96f86aa
authorization method, override in controller
[ { "docid": "af7717b0ec8df7061416ece094d86fe6", "score": "0.0", "text": "def authorized?\n if self.respond_to?(\"mini_wiki_authorized\")\n @authorized = mini_wiki_authorized\n else\n @authorized = true;\n end\n end", "title": "" } ]
[ { "docid": "cbbbaf55c0d577d42d53e39ce9fa49e0", "score": "0.8520828", "text": "def authorization; end", "title": "" }, { "docid": "c88364f80c71e1fee801b48b4dfe42a0", "score": "0.812336", "text": "def authorize\n end", "title": "" }, { "docid": "c88364f80c71e1fee801b48b4df...
60ec265d04959b0da11b813010d6a258
Set notifications Set notifications for a given source account
[ { "docid": "9c7af6a5a9737ad7db93f7c8aad9f82f", "score": "0.56384254", "text": "def set_notifications_request_with_http_info(source_account_id, set_notifications_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FundingManagerApi.set_notific...
[ { "docid": "62f313b9b79609f5babd6f29d2a74627", "score": "0.63228184", "text": "def set_notifications_request(source_account_id, set_notifications_request, opts = {})\n set_notifications_request_with_http_info(source_account_id, set_notifications_request, opts)\n nil\n end", "title": "" ...
1d1921e698802936df3477f725d70154
Setup UUID PostgreSQL server_id must be a unique number use timestamp to create unique UUID
[ { "docid": "646a89ba23e58173b4a80e5453ec89fc", "score": "0.6585696", "text": "def mycnf_uuid\n node[:db_postgres][:mycnf_uuid] ||= Time.new.to_i\n node[:db_postgres][:mycnf_uuid]\n end", "title": "" } ]
[ { "docid": "44a3102e743a4d408895f976d17186b2", "score": "0.73518425", "text": "def create_unique_uuid(conn)\n loop do\n uuid = SecureRandom.uuid\n break uuid unless uuid_exists?(conn, uuid)\n end\n end", "title": "" }, { "docid": "6be9ed1a3d9dacfee30708ae7e6ec082",...
179462eca595d8ecff50f19ac48dd433
Deepcompare two expressions for equality. When changing the conditions, please make sure to update pretty_print_instance_variables so that it includes all relevant values. source://regexp_parser//lib/regexp_parser/expression/methods/tests.rb101
[ { "docid": "38fa321e0d51418297e8f8177b0564ce", "score": "0.53322846", "text": "def ===(other); end", "title": "" } ]
[ { "docid": "c9d7aece3dcacb5c25207ac5ed997d36", "score": "0.6692245", "text": "def test_lessEqualExpression\n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG) \n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n var_AST = AST.new(\"s...
813ab2c3ddafd8a283dc236442cfbd99
Whether this line is the last line in the paragraph
[ { "docid": "29df417b51580f9ea48862bf4cc90e71", "score": "0.7285559", "text": "def paragraph_finished?\n @newline_encountered || next_string_newline? || @arranger.finished?\n end", "title": "" } ]
[ { "docid": "3eac61b34ebafa2617bbedcd229e5e44", "score": "0.77326673", "text": "def at_last_line?\n return true if @list.length == @current_index + 1\n return false\n end", "title": "" }, { "docid": "e3ae5c9010a68dbcd528a393dce96615", "score": "0.7670642", "text": "def at...
c9cb4853c72046a5e45fbb1be7cfd616
Used internally to kill off any worker threads that have taken too long to complete processing. Only called if there are too many processors currently servicing. It returns the count of workers still active after the reap is done. It only runs if there are workers to reap.
[ { "docid": "9c636eca3dead9484d6ae4f765e3e859", "score": "0.7097827", "text": "def reap_dead_workers(reason='unknown')\n if @workers.list.length > 0\n STDERR.puts \"#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'\"\n error_msg = \"Mongrel ti...
[ { "docid": "668341053dff984d9bab6ec62d160f1b", "score": "0.7203537", "text": "def reap_workers\n @reap = false\n workers.select do |worker|\n if status = worker.reap\n @failures += 1 if !status.success?\n worker\n end\n end\n end", "title": "" }, ...
a9b0ef96509bca31ef59ebae064a0b31
This method simulates a short period of boxing, with fighters exchanging hits once. The method changes state of fighters, it reduces their health, makes them tired, or dead. Input is: object of class Fighter, object of class Fighter, integer Output is a Hash with two elements, both of type Fighter
[ { "docid": "c92ecda413846d57c45c2ece1aef6fb6", "score": "0.63952154", "text": "def attack(offender, defender, fight_time)\n if defender.health > 0 && offender.is_dead == false\n defender.health = defender.health - offender.power\n if defender.health < 0\n defender.health = 0\n end\n elsi...
[ { "docid": "fd2c2daba3086c33734ddd4dd4065e0a", "score": "0.64179283", "text": "def battle\n # Runden auf 0 setzen, continue auf true (Für die Schleife)\n round = 0\n continue = true\n victory = false\n # Bilde Arrays mit allen nötigen Werten für den Kampf\n turn_fleet = build_array(@at...
38f0c742a8bfc47c6ed415bada7e9b99
GET /d_items GET /d_items.json
[ { "docid": "015220c513f375171750a252a866294e", "score": "0.7028864", "text": "def index\n @d_items = DItem.all\n end", "title": "" } ]
[ { "docid": "d57502db186679bf451e04276f7c18d6", "score": "0.7744396", "text": "def items\n get_request configure_payload('/items')\n end", "title": "" }, { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.7527671", "text": "def item(id)\n get(\"/item/#{id}.json\")\n...
6c39c441c605168e4a10ed816f784042
Given sorted list of Unix epoch time deliveries for customers, return UUIDs for customers with 3+ deliveries in any 30 day period.
[ { "docid": "73b2adb5dbd036d923175e81471ada92", "score": "0.6373025", "text": "def busy_customers(deliveries)\n secs_in_month = 60 * 60 * 24 * 30\n hash = {} # {id: [time difference, # of deliveries]}\n ans = []\n deliveries.each do |id, time|\n if hash[id]\n last_time, delivery_num = hash[id...
[ { "docid": "0b34994e700bc465c7b1343edde32a09", "score": "0.5192949", "text": "def unique_users(days=30)\n latest_executions(days).select(:user_id).distinct.count\n end", "title": "" }, { "docid": "973b1ef1776d0c1e8681e2afe52e69d6", "score": "0.5119149", "text": "def user_id_compa...
7e45e5c107dc5b8184f4b654f7a1ba9c
GET /broadcaster/social_entries/1 GET /broadcaster/social_entries/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "fcc4f18b8b3f57b1c81824d52973ad82", "score": "0.7793848", "text": "def index\n @broadcaster_social_entries = Broadcaster::SocialEntry.all\n end", "title": "" }, { "docid": "848062196303d1d6dd3fea7beabc0444", "score": "0.6555239", "text": "def following_broadcast_feed\n...
374a63d33bfdfaa7f7e4f20a491f5b0d
I worked on this challenge [by myself, with: ]. smallest_integer is a method that takes an array of integers as its input and returns the smallest integer in the array +list_of_nums+ is an array of integers smallest_integer(list_of_nums) should return the smallest integer in +list_of_nums+ If +list_of_nums+ is empty th...
[ { "docid": "37b098c00d6ef0d955e68a5bfe0b8c95", "score": "0.83634305", "text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n if list_of_nums.length == 1\n return list_of_nums[-1].to_i\n elsif list_of_nums.length > 1\n list_of_nums.sort!\n smallest = list_of_nums[0]\n end\n ...
[ { "docid": "9d752dfe39219905c168bf67cbef9693", "score": "0.92151535", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == []\n return nil\n else\n smallest_num = list_of_nums[0]\n list_of_nums.each do |num|\n if num < smallest_num\n smallest_num = num\n end\n ...
359a414e5822bedf0db755e4dac005cb
Defines a default constructor to copy all receivers generated during class instantiation into the object
[ { "docid": "2680ee2f28ccc01c8e2f8b795b184fdb", "score": "0.0", "text": "def initialize(connection, bot, restrictions = {})\n @connection = connection\n @bot = bot\n @receivers = []\n\n # Instantiate all class level receivers for this instance\n self.class.bare_receivers....
[ { "docid": "93afb9b730c3dd9549a73c40d76ee7f9", "score": "0.6603876", "text": "def define_constructors(&block)\n define_method('new', &block)\n define_instance_method('initialize', &block)\n end", "title": "" }, { "docid": "93afb9b730c3dd9549a73c40d76ee7f9", "score": "0...
ce5f30e76bd7bc75be1dd6bd3ffa011f
GET /subscriptions GET /subscriptions.json
[ { "docid": "fbe29fd46206c4909c369a69ae473b5a", "score": "0.0", "text": "def index\n @subscriptions = Subscription.where(nil)\n\n @courses = Course.active().order(:title)\n @members = Member.active().order(:name)\n @statuses = NamedList.where(list_name: 'status').select(:entry_name).order(:en...
[ { "docid": "5c00e186d4e2351fe4e1ad3758a2c93f", "score": "0.83018446", "text": "def subscriptions(query={})\n self.class.get(\"/users/subscriptions.json\", :query => query)\n end", "title": "" }, { "docid": "2ecce12170d672baa293bd99adeb4f50", "score": "0.7930397", "text": "def...
1c17df820f3967f4d1672d53f3a287cd
Override destination after update
[ { "docid": "c1ede05e69a9f56016d9b23ddcb58d09", "score": "0.0", "text": "def after_update_path_for(user)\n edit_user_registration_path\n end", "title": "" } ]
[ { "docid": "ffaa6a40d7dce08569223f36a68245e1", "score": "0.78057194", "text": "def update!(**args)\n @destination = args[:destination] if args.key?(:destination)\n end", "title": "" }, { "docid": "ffaa6a40d7dce08569223f36a68245e1", "score": "0.78057194", "text": "def ...
1451196990f47534c599192e08c484c2
Provide a default URL as a default if there hasn't been a file uploaded:
[ { "docid": "c5609b2dbd52a9dbc0ab47275c450f35", "score": "0.6552107", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n \"/assets/\" + [version_name, \"default.gif\"].compact.join('_')\n end", "title": "" } ]
[ { "docid": "b60fd9da936d3a3a2ede5b89d2cb78a3", "score": "0.8193984", "text": "def default_url\n '/no_file'\n end", "title": "" }, { "docid": "7e0c7efbe20c579ceeafc492e36148cb", "score": "0.74905765", "text": "def default_url\n ''\n end", "title": "" }, { "docid": ...
547bc2539d0927daa3b50d7424ccc6e1
If we get a web request in, then we know we're running in some sort of app server source://scout_apm//lib/scout_apm/middleware.rb15
[ { "docid": "ba27a77e129e79beb287c6254e59efab", "score": "0.0", "text": "def call(env); end", "title": "" } ]
[ { "docid": "a3df94061efcf347c0c16d3722a70f21", "score": "0.6442347", "text": "def is_app_metweblog?\r\n begin\r\n res = send_request_cgi(\r\n {\r\n 'uri' => '/html/en/index.html',\r\n 'method' => 'GET'\r\n })\r\n rescue ::Rex::ConnectionRefused, ::Rex::HostUnr...
40eb1479fa200d0cf64ec612b8e0aa6a
Searches for jobs across the Job Search API using keywords.
[ { "docid": "d3bfb26954682dd741ff56d77a02e848", "score": "0.77280164", "text": "def job_search(options={})\n path = \"job-search\"\n get(path,options)\n end", "title": "" } ]
[ { "docid": "eb02e1c336d79f1fe048c6ea900a82fd", "score": "0.74757487", "text": "def search\n\n @jobs = []\n \n PgSearch.multisearch(params['search-string']).where(:searchable_type => \"Job\").find_each do |document|\n @jobs << document.searchable\n end\n\n respond_to do |format|\n ...
19cadbcb8e2dc05af7c2930a38ef4934
adds dest section to C instructions
[ { "docid": "6852f34f3a9e83e543dcc151d1ce9b33", "score": "0.4833311", "text": "def add_dest(line)\n if line[0..1] == \"M=\"\n \"001\"\n elsif line[0..1] == \"D=\"\n \"010\"\n elsif line[0..1] == \"A=\"\n \"100\"\n elsif line[0..2] == \"MD=\"\n \"011\"\n elsif line[0..2]...
[ { "docid": "232488e4c6c2ddc4b849a3bef68b00e1", "score": "0.56205374", "text": "def ccp( source, dest )\n sliceFile( source, dest, File.size( source ), 0, $W )\nend", "title": "" }, { "docid": "129eb893d21bba19ad04c9b3aaf29dee", "score": "0.56048375", "text": "def add_destination(des...
0388ba76cc560a633b35430ba564cab6
Update the Aws.config hash
[ { "docid": "8334c390851fe88a035f0a046fb7b065", "score": "0.6582254", "text": "def update_aws_config(role_creds)\n Aws.config.update(\n credentials: Aws::Credentials.new(\n role_creds.credentials.access_key_id,\n role_creds.credentials.secret_access_key,\n role_creds.credenti...
[ { "docid": "2aaa1752d24141e3070f5cf384e546f1", "score": "0.757369", "text": "def update_aws_config\n Aws.config.update({\n credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']),\n region: ENV['AWS_REGION']\n ...
407724d8a21d41b75c8e531969f29c39
GET /ships/1 GET /ships/1.xml
[ { "docid": "20a7816db8541f2eb2f5d484b2b6d065", "score": "0.653938", "text": "def show\n @ship = Ship.find(params[:id])\n\t locations = Location.find :all\n\t @destinations = locations.reject { |l| l == @ship.location }\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml...
[ { "docid": "7d1113efa7c291aaf3fc685f678aed8b", "score": "0.7060716", "text": "def index\n #Wenn Schiffe existieren\n @ship = Ship.find(params[:ship_id])\n @ships_stations = @ship.ships_stations\n end", "title": "" }, { "docid": "26acb6aeb15bafad27e298c7a1f0785d", "score": "0.70...
8f5754fa6aacd69a5c989f0d16b067df
Intercepts GET requests on addressbook urls ending with ?export.
[ { "docid": "0e36def5490c5b2bd68dfb5dab4a913e", "score": "0.57331973", "text": "def http_get(request, response)\n query_params = request.query_parameters\n return true unless query_params.key?('export')\n\n path = request.path\n\n node = @server.tree.node_for_path(path)\n\n ...
[ { "docid": "9eb759ebecbe3f6285b4c14aff10b714", "score": "0.5246644", "text": "def download\n __log_activity\n __debug_route\n @item = get_record\n link = @item.download_url\n respond_to do |format|\n format.html { redirect_to(link, allow_other_host: true) }\n format.json { rend...
a0b2a11ea02a0e3e78e90e6b7eeb0e56
Sets the allowed capture method
[ { "docid": "8846bff78fff62a032e9f1f1fbf5c512", "score": "0.79013807", "text": "def with_allowed_capture_methods(allowed_capture_methods)\n @allowed_capture_methods = allowed_capture_methods\n self\n end", "title": "" } ]
[ { "docid": "79b95e75afa34d782c2c0022ffdddb6b", "score": "0.6695279", "text": "def with_allows_camera\n with_allowed_capture_methods(Constants::CAMERA)\n end", "title": "" }, { "docid": "52fc17f6f864dd1a710517e648a00f93", "score": "0.6393256", "text": "def set_Allo...
a7a6b022777d85e515c0c97fca0909ad
Get a deploy task`s status.
[ { "docid": "101b536da745fedb5431186383bba57c", "score": "0.7893862", "text": "def getDeployTaskStatus(task_id)\n r_hold = [[\"jobs\", -1]]\n r_notask = [[\"jobs\", 0]]\n r_error = [[\"jobs\",-2]]\n\n thor_log_path = LOG_PATH + \"thor_\" + task_id + \".log\"\n if not Fi...
[ { "docid": "c5d717190a6bd507a6a394a11a7b8082", "score": "0.77685875", "text": "def getDeployTaskStatus(task_id)\n\n Logger.info \"\\n#{LOG_SYMBOL*29} getDeployTaskStatus #{LOG_SYMBOL*28}\"\n\n thor_log_path = LOG_PATH + \"thor_\" + task_id + \".log\"\n log_lines = `wc -l #{thor_log_...
c19048d3efac2ebc2d75dd35311adc67
============================================================= ========================== CRUD =============================
[ { "docid": "576d6e0553d90d926702b84e016bfc8b", "score": "0.0", "text": "def save\n sql = \"\n INSERT INTO deals\n (name, discount_id, day, burger_id)\n VALUES\n ($1, $2, $3, $4)\n RETURNING id\n \"\n values = [@name, @discount_id, @day, @burger_id]\n deal = SqlRunner.run(sql, ...
[ { "docid": "871ca851e99ddfe3ef5344270d82e36f", "score": "0.6600298", "text": "def crud *args\n @crud = args.first if args.size > 0\n end", "title": "" }, { "docid": "df9f5e7a8ee9177de214354201dafbaa", "score": "0.6564583", "text": "def edit\n \n end", "title": "" ...
51e149dba6e099897145f4b7fec22305
GET /videos/new GET /videos/new.json
[ { "docid": "9abe6d5da0097a6822d022a8f12e8da8", "score": "0.7963612", "text": "def new\n @video = Video.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "title": "" } ]
[ { "docid": "3be03a7007b15886f3d2016144ae400d", "score": "0.8016282", "text": "def new\n \n @video = Video.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "8ee37ab8e33128df3d3...
c689e37c9afd1c08da60ae246548e438
Returns the model that matches the QStandardItem
[ { "docid": "15b9e09a2e8182100159f72f679c073b", "score": "0.66755277", "text": "def find_model_from_item(item)\n @items_to_models[item]\n end", "title": "" } ]
[ { "docid": "32225823908983c64bb0cb1f80b95d68", "score": "0.6296348", "text": "def get_model\n return model_classes[item_type].new()\n end", "title": "" }, { "docid": "07ae37ffab290d3c731cc6ca7985eeb1", "score": "0.58460253", "text": "def find_item_by_model(model)\n ...
30010914786d41f80d15f0e9cb6d1c19
PUT /pedidos/1 PUT /pedidos/1.json
[ { "docid": "2f24a6800547651d472caed59726e62e", "score": "0.65308535", "text": "def update\n @pedido = Pedido.find(params[:id])\n\n respond_to do |format|\n if @pedido.update_attributes(params[:pedido])\n format.html { redirect_to @pedido, notice: 'El Pedido fue actualizado exitosamente...
[ { "docid": "c1c34e23e5689956bbe8b0bfcabbd225", "score": "0.67186874", "text": "def update\n @pedido = Pedido.find(params[:id])\n\n respond_to do |format|\n if @pedido.update_attributes(params[:pedido])\n format.html { redirect_to @pedido, notice: 'El pedido fue actualizado existosament...
1e87b690a31b53782420eac6aaf57d25
Find one managing_group using label and show it.
[ { "docid": "39d89bfaac7a15bb9da336401c46a10d", "score": "0.7171875", "text": "def show_by_label\n objid = params[:label]\n obj = ManagingGroup.find_by_label(objid)\n if obj\n render json: {managing_group: obj}, status: 200\n else\n render json: {}, status: 404\n end\n rescue =>...
[ { "docid": "5925ecc8fcc0bbc49c87e8dbe88a76d1", "score": "0.66742426", "text": "def show_group\r\n show_group_by_id()\r\n end", "title": "" }, { "docid": "01dbca19bddf7cb9097b43abe8c4e26d", "score": "0.66726416", "text": "def showgroup\n group = groups.map(&:id)\n group.dele...
9e67626b4f160f903178ce64b680ec84
Set the value of the Keywords input for this Choreo.
[ { "docid": "bf442d6e85aa5a26facd90d5e81f2e6e", "score": "0.66652334", "text": "def set_Keywords(value)\n set_input(\"Keywords\", value)\n end", "title": "" } ]
[ { "docid": "da04d89c5c7b8c86e399098efbce6132", "score": "0.67314386", "text": "def keyword_list=(words)\n self.keywords = words.split(\",\").compact.map!(&:strip)\n end", "title": "" }, { "docid": "da04d89c5c7b8c86e399098efbce6132", "score": "0.67314386", "text": "def key...
a73eb24529c36381ff8d39f3ce9a0dce
If there is any data in the use constraints, save one field. Text is preferred to the url.
[ { "docid": "55632c57254f184ccf0f379c53af5328", "score": "0.0", "text": "def adjust_use_contraints_for_1_2(draft)\n return draft unless draft['UseConstraints']\n\n draft['UseConstraints'] = draft['UseConstraints']['LicenseText'] || draft['UseConstraints']['LicenseUrl']\n draft\n end", "titl...
[ { "docid": "7d1dec4ad4ab6d6b9f001cb699b9d683", "score": "0.5693663", "text": "def add_to_database\n if self.valid?\n Link.add({\"name\" => \"#{self.name}\", \"assignment_id\" => \"#{self.assignment_id}\", \"description\" => \"#{self.description}\", \"where_stored\" => \"#{self.where_stored}\"})\...
f8a263d6268ebd28032ef6aeca5456f1
Time complexity: O(n) Space complexity: O(n)
[ { "docid": "7d61e819b4ab95298acdd8d32a1d33f5", "score": "0.0", "text": "def nested(s)\n return true if s == \"\"\n return false if (s.length == 1 || s[0] != \"(\" || s[-1] != \")\" )\n return nested(s[1..-2])\nend", "title": "" } ]
[ { "docid": "5944c445a0d5d1383cd670cc84d3fc3b", "score": "0.69327533", "text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "...
822386f159da6d254a54a02c25afed84
ensures that all configured EBS volumes have been associated to the given nodes
[ { "docid": "f3aacaf2b485b5142b657141a4ee72d5", "score": "0.79234695", "text": "def ensure_ebs_volumes\n all_instances = @ec2.describe_instances()\n @ec2_nodes.each_pair do |node_name, node|\n node_instance = find_ec2_node_instance(node_name, all_instances)\n if !node.ebs_...
[ { "docid": "9e547801b060a4fe7b732a4c1ddb4ad0", "score": "0.6834937", "text": "def attach_ebs(node)\n Souffle::Log.info \"#{node.log_prefix} Attaching EBS...\"\n node.options[:volumes].each_with_index do |volume, index|\n @ec2.attach_volume(\n volume[:aws_id],\n node.options[:aws...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c27e4ec02b1905b37ed8eaf672f2982b", "score": "0.0", "text": "def aile_params\n params.require(:aile)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
14b83304c96acd55b65438e688dd5ad3
See question here: Write a recursive method to solve `make_better_change`. HINT: To make_better_change, we only take one coin at a time and never rule out denominations that we've already used. This allows each coin to be available each time we get a new remainder. By iterating over the denominations and continuing to ...
[ { "docid": "8d047c75661521e297b6977695e68e47", "score": "0.64890194", "text": "def make_better_change(value, coins)\n\nend", "title": "" } ]
[ { "docid": "a670d9922b7e0941e38f2c98429d8dec", "score": "0.8316564", "text": "def make_better_change(amount, coin_denoms)\n return [amount] if coin_denoms.include?(amount)\n return [] if amount <= 0\n\n coin_denoms.sort.reverse!\n all_possible_arr = []\n\n coin_denoms.each do |value|\n change_ar...
7c4c1c44e5f850ed61a19885e7e836da
Creates and performs a buy order. Returns the order.
[ { "docid": "6625d34016c0c1792ceb0ac01a6ffdd1", "score": "0.7687076", "text": "def buy!(qty, price)\n order = Fyb::Order.new qty, price, :buy\n order.perform\n end", "title": "" } ]
[ { "docid": "06d0b8b476df0cb74704a7af58cc31b4", "score": "0.7898349", "text": "def buy(params)\n params[:side] = 'buy'\n params[:product_id] = id\n\n Order.create(params)\n end", "title": "" }, { "docid": "844e30bcfd5c58c9fef34d6494e7cde2", "score": "0.7307218", "tex...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "42b44e5c0a943b5b3d07d9a75524cd98", "score": "0.0", "text": "def coupon_code_params\n params.require(:coupon_code).permit(:code, :type, :value, :cashback_value, :start_date, :end_date, :active, :minimum_delivery_amount_after_discount, :maximum_discount, :applicable_outlet_ids => [])\n end...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981537", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.67835593", "text": "def strong_params\n params.requ...
9824c4e9d3dce0e2cd2fd19267fd06c1
GET /sche_ts/1 GET /sche_ts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a6fe8460ac62d865b9160e6316f8c3f8", "score": "0.6354119", "text": "def index\n @ts = T.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ts }\n end\n end", "title": "" }, { "docid": "6a8eaddd4f894985a5139f9bc1e5bf99", ...
2f29b53709746ed667264b911b9d97ec
DELETE /todos/1 DELETE /todos/1.json
[ { "docid": "5dc806708b415e938d5b1c07453225fe", "score": "0.7224236", "text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n \n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :ok }\n format.js\n end \n end", "title"...
[ { "docid": "edb1a55951817c40c3f0a2a6c4172354", "score": "0.78317076", "text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1be68e43980093e1ba24c40d34d4e56...
952bb4133d802addbeea96a54f7873fd
Get whether the robot has been successfully placed or not
[ { "docid": "21be4f4e26e3c240cfd8f9cbfb5e3295", "score": "0.0", "text": "def placed?\n\t\t@placed\n\tend", "title": "" } ]
[ { "docid": "61afd222037c26dc7ccc4b1f30001b9b", "score": "0.72173303", "text": "def is_robot_placed?\n @is_robot_placed\n end", "title": "" }, { "docid": "ff8bff97a79e8414891a339492a5c0be", "score": "0.6916484", "text": "def test_robot_will_report_if_it_is_ready()\n @robot.plac...
9dfc25586c4f33ee7e7139a1584e7ea1
PATCH/PUT /db_connects/1 PATCH/PUT /db_connects/1.json
[ { "docid": "31756c76d0d872e15e4ab47a61af2dac", "score": "0.67234546", "text": "def update\n\n respond_to do |format|\n if @db_connect.update(db_connect_params)\n format.html { redirect_to db_connects_url, notice: 'Подключение успешно обновлено.' }\n format.json { render :show, stat...
[ { "docid": "073cfb58882c9546e560777ccdc33038", "score": "0.603753", "text": "def update\n begin\n @resource = Database.find(params[:id])\n @resource.update_attributes!(params[:database])\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n r...
8f993666b550103cc57d41948ac99e85
Format [:artithmetic, left, operator, right] should have removed arithmetic with more than one operator in an earlier transformation
[ { "docid": "40ab894ccb3a7f48c996d1ac4d550b84", "score": "0.5955727", "text": "def arithmetic(ast)\n left, operator, right = ast[1], ast[2], ast[3]\n # Three different options, array on the left, array on the right, or both\n # array on the left first\n if left.first == :array && right.first ...
[ { "docid": "e3d8775dfb2eaeb13ba9db9f8f72e94c", "score": "0.6607523", "text": "def writeArithmeticUnary(str)\n if str == \"-\"\n str = \"neg\\n\"\n\n elsif str == \"~\"\n str = \"not\\n\"\n end\n\n return str\nend", "title": "" }, { "docid": "735d041155340eab11b03ea9b44a0bfb", "...
5c5a4937dc1684eab3ae5fb1505f884d
DELETE /borrowers/1 DELETE /borrowers/1.json
[ { "docid": "f60d7e2ce450cebca50e6eb2cdde94cb", "score": "0.70312685", "text": "def destroy\n respond_with(@borrower)\n end", "title": "" } ]
[ { "docid": "5965d87f1cd774bff8a4c790f9f3249c", "score": "0.80287784", "text": "def destroy\n @borrower = Borrower.find(params[:id])\n @borrower.destroy\n\n respond_to do |format|\n \n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a193b462ac3...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0fa764081f377462106e1366b415c678", "score": "0.0", "text": "def set_user_campaign\n @user_campaign = UserCampaign.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;...
e7ac9895b89f183e68a1ce772882242d
We uncouple the users from this game and delete the game.
[ { "docid": "389806b19c7ee3cdd57c21b20117e30f", "score": "0.74146056", "text": "def gameover\n self.users.each do |user|\n user.leave_game\n end\n self.done = true\n self.save\n\n Game.del(self.id)\n end", "title": "" } ]
[ { "docid": "dadef65126dca68430142d47deedce72", "score": "0.73738956", "text": "def destroy\r\n if @game.is_empty?\r\n increment_winner_statistic\r\n\r\n # destroy bots users\r\n bots_ids = @game.users.collect {|user| user.id if user.is_bot}\r\n User.where(id: bots_ids).d...
47691a077d3e2f36bcc74e657f243ac4
A friendly, more verbose description of the activity status.
[ { "docid": "b193223d7eeb8d5742ec6581a4ac68f0", "score": "0.6733413", "text": "def status_message\n data.status_message\n end", "title": "" } ]
[ { "docid": "2cccf9042622ef07d17ed3afde4d6d16", "score": "0.77587867", "text": "def status\n \"#{@description} #{@status}\"\n end", "title": "" }, { "docid": "e249b661d9d73f3b9928dce8af62344a", "score": "0.75347817", "text": "def status\n inspect\n end", "title": "" ...
1ff5032924df2f6feae84f060714a2f5
Return a String key based on the target name to use in the ondisk cache.
[ { "docid": "452715d214740402453414ae9c07952d", "score": "0.83575034", "text": "def get_cache_key(target_name)\n if Rscons.phony_target?(target_name)\n PHONY_PREFIX + target_name.to_s\n else\n target_name\n end\n end", "title": "" } ]
[ { "docid": "01817ed4f81c5964f875d7c0e62268e2", "score": "0.75451857", "text": "def cache_key\n name.to_s\n end", "title": "" }, { "docid": "4c152feaf19f4f96db6cdbd366310720", "score": "0.6701045", "text": "def cache_key; @cache.to_sym; end", "title": "" }, { "...
ea823940ab1738849eb2d32baf66c8c3
this part between def and end is called a method
[ { "docid": "b2f93020a0db2e22a9c60b577ddb60b1", "score": "0.0", "text": "def play_paper\n @computer_move = [\"rock\",\"paper\",\"scissors\"].sample\n if @computer_move == \"paper\"\n @outcome = \"tie\"\n elsif @computer_move == \"scissors\"\n @outcome = \"lose\"\n else\n @outco...
[ { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7925137", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "score": "0.7925137", "text": "def end; end", "title": "" }, { "docid": "281e9a43f3408650bd69047a8fabab55", "scor...
5190bdfc3db9a2be53a8b1a79734d792
GET /classifications/1 GET /classifications/1.xml
[ { "docid": "8fe35c7c35ced443de83aa698d273d16", "score": "0.68985075", "text": "def show\n @classification = Classification.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @classification }\n end\n end", "title": "" } ]
[ { "docid": "e224c0c8531890982407380fee3e37e0", "score": "0.6285755", "text": "def show\n @classification_strategy = ClassificationStrategy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @classification_strategy }\n end\n end"...
11809a74aa142428997b7c9e8e9e6778
removes a specified photo for a profile DELETE /profiles/:profile_id/images/:id
[ { "docid": "f39e2a46af8f16df4f6ae4c7867069ad", "score": "0.7647898", "text": "def destroy\n \t# TODO: do I need more security on this?\n \tif not user_signed_in? # if user is not signed in, they should not be allowed to view this page or be redirected\n \t\trespond_to do |format|\n \t\t\tformat.html...
[ { "docid": "6382d86191b4cbb07f40a68737cdef27", "score": "0.78580093", "text": "def delete_profile_picture\n\t\tif (current_user.id == params[:id].to_i) \n\t\t\tcurrent_user.avatar = nil\n\t\t\tcurrent_user.save\n\t\t\tredirect_to current_user, notice: \"Image de profil supprimée\"\n\t\telse \n\t\t\tredi...
e2a0e6678d46a1b571084915c1fbe94f
use like `click_element :result_title, text: 'some thing'`
[ { "docid": "6f257a81fc6abd4c7c3345094665a907", "score": "0.58925", "text": "def result_title(**options)\n css('.search-results--title a', options)\n end", "title": "" } ]
[ { "docid": "0a9964edddcff05f8fd63a35323f6712", "score": "0.7078063", "text": "def navigate_into\n title_element.when_present.click\n end", "title": "" }, { "docid": "6235340fd2a68785b111e1a69c442756", "score": "0.6844564", "text": "def click_result(unique_identifier)\n wait_fo...
d834f2a519adee7f492afa6ca0415298
proof of concept search, get the name and try to find a match in database
[ { "docid": "2bee360aa7aa6d5655a9ee930b4a0699", "score": "0.0", "text": "def search\n\tlogger.debug session[:current_user]\n\t if session[:current_user] == nil\n\t\tlogger.debug \"User not login\"\n redirect_to :action => \"index\"\n else\n\t\tlogger.debug \"Enter Proof of concept s...
[ { "docid": "81cbdb2cecbd96543c06f8ba4a4df478", "score": "0.7504392", "text": "def match(name)\n query(FindByString: name)\n end", "title": "" }, { "docid": "f862531182777b5de32b20a96bd84e8e", "score": "0.71981615", "text": "def find(name); end", "title": "" }, { ...
78673a1ec13e4c7d8d4424c1482f460a
GET /conflict_meds/new GET /conflict_meds/new.json
[ { "docid": "452f6f99ad5e77c4f6124523f0561ee0", "score": "0.65518355", "text": "def new\n @conflict_med = ConflictMed.new\n if defined? params[:m_id]\n id = params[:m_id]\n @conflict_med.medicament_id = id\n @paramid = id\n end\n\n respond_to do |format|\n format.html # ne...
[ { "docid": "ab2c3a97cdb578fdad0e41c8042e4d1d", "score": "0.7836251", "text": "def new\n @conflict = Conflict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conflict }\n end\n end", "title": "" }, { "docid": "1755cd7ac8e0e1460653f...
0503e669343911becca52df6e26fd3ef
Object cache directory path. Will be created if directory doesn't exists
[ { "docid": "25cd0aab57ea9c2d0ffb1dba4a38b7a5", "score": "0.7834221", "text": "def cache_object\n @cache_object ||= begin\n cache_object = File.join(cache, 'objects')\n FileUtils.mkpath cache_object unless File.exist? cache_object\n @cache_object = cache_object\n end\n e...
[ { "docid": "eb932a6a8e1448d8de0e350a88dcad44", "score": "0.79118335", "text": "def cache_directory\n end", "title": "" }, { "docid": "eb932a6a8e1448d8de0e350a88dcad44", "score": "0.79118335", "text": "def cache_directory\n end", "title": "" }, { "docid": "afe1a0...
58ba488143a626a47531d383213bff3c
POST /mnoe/jpi/v1/impac/dashboards > POST /api/mnoe/v1/users/1/dashboards
[ { "docid": "7d67a4fdba1c5ad424d27cd9ccc807f9", "score": "0.72562796", "text": "def create\n authorize! :create_impac_dashboards, dashboards.build(dashboard_create_params)\n\n if @dashboard = dashboards.create(dashboard_create_params)\n MnoEnterprise::EventLogger.info('dashboard_create', curre...
[ { "docid": "2581514fb2a8aa4ca3fc99a7b248d2db", "score": "0.66800755", "text": "def create_dashboard(*args)\n username, arguments = extract_username(args)\n attrs = arguments.shift\n\n post api_url(username, 'dashboards'), attrs\n end", "title": "" }, { "doci...
50f9c953685a8761c2d43377b891fb93
POST /user_sessions POST /user_sessions.json
[ { "docid": "f462fd0acb850f92181f679b247f7072", "score": "0.6340046", "text": "def create\n # if the user has no password set, create a new session from just the login-name (workaround for authlogic)\n if User.find_by_login(params[:user_session][:login]).emptypw == true\n @user_session = UserS...
[ { "docid": "3fbbf53233517c3dfc79acfa27e823e1", "score": "0.7605258", "text": "def create\n @user_session = UserSession.new(user_session_params)\n\n if @user_session.save\n render json: @user_session, status: :created, location: @user_session\n else\n render json: @user_session.errors,...
4993b0b2785baf78d51065268a24d169
Functions for text messaging Representatives
[ { "docid": "b8ed4cf73c438b7ee5712d16fa783752", "score": "0.0", "text": "def config_yaml\n @config_yaml ||= YAML::load(File.open(\"#{Rails.root}/db/sms_carriers.yml\"))\n end", "title": "" } ]
[ { "docid": "bc4a10d049d1657b6b18f15d68267acb", "score": "0.677753", "text": "def msg_text(message)\n puts message\nend", "title": "" }, { "docid": "b93494472c640c05b12c482b4448e573", "score": "0.6638786", "text": "def messaging; end", "title": "" }, { "docid": "44e15ed5e...
efa1f2643ec8a32196c31eaa6e296f1c
job will be discarded immediately if failed
[ { "docid": "3584be80589169d812d38bc0045db5c1", "score": "0.0", "text": "def perform\n User.postcode_area_panel_details \n end", "title": "" } ]
[ { "docid": "fc07e59f017eb4f8edd13bae750ef305", "score": "0.75476027", "text": "def prepare_to_die!\r\n abandon_job!\r\n end", "title": "" }, { "docid": "c5d8c358d4c839ff37ba8e533ce78e80", "score": "0.6986418", "text": "def job?; end", "title": "" }, { "docid": "afd269...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c2f9c74838ee285f62f6b075c28ac84e", "score": "0.0", "text": "def admin_exhibition_params\n params.require(:exhibition).permit(:title_tr, :title_en, :text_tr, :text_en, :start_at, :end_at, :is_individual, :is_active)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74939764", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6955084", "text": "def strong_params\n params.require(:request).permit(param_whit...
4e186cc385a0612f38bbb0ebfc2ea1db
DELETE /turmas/1 DELETE /turmas/1.xml
[ { "docid": "0dad447a9464340b6246f6392267ac27", "score": "0.6893786", "text": "def destroy\n @turma = Turma.find(params[:id])\n @turma.destroy\n\n respond_to do |format|\n format.html { redirect_to(turmas_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e114e5effd27b181df5cc2d52cbc4c89", "score": "0.66913086", "text": "def destroy\n @tlectura = Tlectura.find(params[:id])\n @tlectura.destroy\n\n respond_to do |format|\n format.html { redirect_to(tlecturas_url) }\n format.xml { head :ok }\n end\n end", "title": "" ...
701c4a3f600a3d6fd6e0e9bea8e73d09
POST /contributing_libraries POST /contributing_libraries.json
[ { "docid": "7eba82482e8b74ad918a313f8d855f10", "score": "0.72886187", "text": "def create\n respond_to do |format|\n if @contributing_library.save\n format.html { redirect_to @contributing_library, notice: 'Contributing Library was successfully created.' }\n format.json { render :s...
[ { "docid": "667918db2b0da7ecd2e53207835a3c56", "score": "0.6637423", "text": "def contributing_library_params\n params.require(:contributing_library).permit(:label, :uri)\n end", "title": "" }, { "docid": "7e060cf2def651ce633f642e0814a996", "score": "0.6299508", "text": "def crea...
d4b4f22c5eb71d320aa47400632b5455
Reset at the beginning of every hour.
[ { "docid": "9d30c3b15c79454bd0eea792ad1a47c1", "score": "0.0", "text": "def limit_resets_at\n timestamp - (timestamp % 3600) + 3600\n end", "title": "" } ]
[ { "docid": "9bc8d246231a8020472e87c60191ad51", "score": "0.74790496", "text": "def reset\n @time.reset\n end", "title": "" }, { "docid": "975cc44af9b108602f2fc9f760fbeab4", "score": "0.7307702", "text": "def beginning_of_hour\n change(:min => 0, :sec => 0, :usec => 0)\n ...
b5e36bf5eb87b4347fba7da475980fbb
This loops over all of the authorization paths and adds a LEFT OUTER JOIN from the assignments table. This is a dynamic part of the the query. == Example of SQL Generated LEFT JOIN "journals" on "journals"."id" = "assignments"."assigned_to_id" AND "assignments"."assigned_to_type" = 'Journal' LEFT JOIN "papers" on "pape...
[ { "docid": "b286e9acd710ad5e4f0d22e8caf006fa", "score": "0.65318084", "text": "def add_auth_config_joins(query)\n auth_configs.each do |ac|\n join_table = ac.assignment_to.arel_table\n source_table = ac.authorizes.arel_table\n association = ac.assignment_to.reflections[ac.via.t...
[ { "docid": "7bda172e31cf2b09eda3c04cb5eceb0c", "score": "0.5420212", "text": "def add_auth_config_conditions(query)\n arel_conditions = auth_configs.reduce(nil) do |conditions, ac|\n if conditions\n conditions.or(\n ac.assignment_to .arel_table.primary_key.not_eq(nil)\n ...
eb4f1c5c5e3de7c8e194825a6c29ae73
This method initialize a new VIO Object.
[ { "docid": "feb6a59b241d86c02acbb2e1e5e5b6db", "score": "0.68724644", "text": "def initialize(name, options = {})\n @name = name\n super(name,options)\n @log = Logger.new(STDOUT)\n @log.level = Logger::INFO\n if options[:frame].debug == true\n\t@debug == true\n @log.level...
[ { "docid": "fec4ee38380924b06580ebf1137d6d95", "score": "0.66918963", "text": "def initialize\n\t\tself.initializeObject\n\tend", "title": "" }, { "docid": "18430a320e29c9dc2bed4255e4eb1103", "score": "0.6669109", "text": "def initialize(io)\n\t\t\t\t\t@io = io\n\t\t\t\tend", "ti...
19b11ee23da0871a8e736685e8469d4c
Start the game with a C2
[ { "docid": "398b0e3ff64206e6b5007708b8396014", "score": "0.6756253", "text": "def request_start(trick)\n $stdout.puts \"#{self}, you will start the game by playing a C2.\" \n $stdin.gets\n super\n end", "title": "" } ]
[ { "docid": "3cbf9265635dfe49c3972be8efcb8791", "score": "0.6631385", "text": "def update_phase2\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Branch by party command window cursor position\r\n case @party_command_window.index\r\n when 0 # fight\r\n # Pl...
d0a5f6cf21766d65df93987c845061ca
Offer links to further details on some attributes
[ { "docid": "741aa807f54f2eccf4fd7a8b65724690", "score": "0.0", "text": "def further_details \n {\n 'referer_host' => 'referer_path',\n 'referer_path' => 'referer_params',\n \n 'agent.name' => 'agent.major_version',\n 'agent.os' => 'agent.name',\n 'agent.major...
[ { "docid": "dad8bd07f1cbdc10e5e2936ea676ce2a", "score": "0.75627494", "text": "def display_all_links_attributes\n # Interface method\n end", "title": "" }, { "docid": "c6e18624ae24a2ed346d4eccb73fc3dc", "score": "0.7479951", "text": "def display_link_attributes(link)\n #...
c18c04de0defb003f7fda1ff233ad97e
Instantiates a new externalConnectorsItemIdResolver and sets the default values.
[ { "docid": "7f1022caba12b889670194239716045d", "score": "0.71000767", "text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.externalConnectors.itemIdResolver\"\n end", "title": "" } ]
[ { "docid": "8e048933732e1802c1642c0b1578ccb2", "score": "0.50110114", "text": "def initialize(connector, oid: nil, raw: nil)\n @connector = connector\n if oid\n initialize_from_service(oid)\n else\n @raw = raw\n end\n end", "title": "" }, { "docid": "86a9...
d0ccea9d5c7dee575afa4aa7582dd3d2
Find an input based on the attribute name. source://simple_form//lib/simple_form/form_builder.rb531
[ { "docid": "a5e9957d8570031f49ca214e7809f9b6", "score": "0.7413913", "text": "def find_input(attribute_name, options = T.unsafe(nil), &block); end", "title": "" } ]
[ { "docid": "dd5b9f57704000ede32473c9ee1e5f15", "score": "0.6894015", "text": "def thelper_find_input_by_name( n = 'commit' )\n find( :xpath, \"//input[contains(@name, '#{ n }')]\" )\n end", "title": "" }, { "docid": "69410eb1c42edf26805def0b77c05a87", "score": "0.6414777", "text"...
5628581de45a199359a91fe2145008fa
Only option is "expires" and it's a boolean
[ { "docid": "daada06857de07b5ee91a0590ff84fcb", "score": "0.0", "text": "def url_for(path, opts = {})\n path = absolute(path)\n (opts[:expires] ? storage.media(path) : storage.shares(path))['url']\n end", "title": "" } ]
[ { "docid": "f8d60ce6c9e644915b6359a7e18112ef", "score": "0.78613704", "text": "def expires?\n !!@expires_in\n end", "title": "" }, { "docid": "2048322c00507c0c4d032ff8e0ce04fb", "score": "0.7730054", "text": "def expires?\n ActiveRecord::ConnectionAdapters::Column.value_to...
ee9b12b0bbae557971164c069d2507f9
GET /categories/edit GET /categories/edit.json
[ { "docid": "4868012f922d26654b348c9e632c88a1", "score": "0.71967965", "text": "def edit\n @category = Category.find(params[:id])\n #@category = Category.new\n end", "title": "" } ]
[ { "docid": "cc2e96e7e869d194f91373dc161f511a", "score": "0.77504843", "text": "def edit\n render json: { content: render_to_string(partial: 'integral/backend/categories/modal', locals: { category: @resource, title: 'Edit Category', modal_id: \"modal--category-edit-#{@resource.id}\" }) }\n en...
46da32faa9dba0d4b46b0cddd5704eb4
POST /stock_users POST /stock_users.json
[ { "docid": "08e3673e41c3bddb4ac265ce1c4ddb91", "score": "0.66604626", "text": "def create\n\n if session[:index].nil?\n session[:index] = 0\n else\n session[:index] += 1\n end\n\n if request.xhr?\n\n @stock_id = Stock.find_by(symbol: params[\"symbol\"]).id\n @user_id = se...
[ { "docid": "56790624bc6c888810c96751b804ef3a", "score": "0.67104024", "text": "def stocks_user_params\n params.require(:stock_user).permit(:user_id, :stock_id)\n end", "title": "" }, { "docid": "3dbc8cc6f7d8e5a9b4733cc26f733687", "score": "0.64719677", "text": "def user_stock...