query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
dbb37a81096e938c36727e4bbc533eba | will be deleted along with cleanup legacy code | [
{
"docid": "86757c388fc6b61e78dde01285bf4c59",
"score": "0.0",
"text": "def default_service_names\n {\n producer: 'barito-flow-producer',\n zookeeper: 'zookeeper',\n kafka: 'kafka',\n consumer: 'barito-flow-consumer',\n elasticsearch: 'elasticsearch',\n kibana: 'kibana',... | [
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.83203435",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.83203435",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",... |
24dd8598e3762f9aa8d5cd7687d19381 | this method will remove any double quotes between the first opening quote (|".....) and last closing quote. (....."|) from a field. | [
{
"docid": "6058c8d871d81785c0e142c963e6076b",
"score": "0.64410746",
"text": "def remove_double_quotes(row)\n loop do\n break unless row.match /([^^|\\n])(\")([^|\\n])/\n row.gsub!(/([^^|\\n])(\")([^|\\n])/, '\\1\\3')\n end\n\nend",
"title": ""
}
] | [
{
"docid": "a02000d621e210e816d18c54e142fe5d",
"score": "0.6852623",
"text": "def remove_double_quotes(row)\n regex = /([^^#{Regexp.quote(@delim)}\\n])(\")([^#{Regexp.quote(@delim)}\\n])/\n # row.split(@delim).each { |field| field.gsub!(regex, '\\1\\3') unless field == nil}\n\n loop do\n break unl... |
4b1ac2df1e8ae45ab93b27034b08a1f9 | Set RTLD_GLOBAL for this object. | [
{
"docid": "1d83d778c1ec2528b52b7f19f5fd49dc",
"score": "0.6031581",
"text": "def rtld_global\n return @rtld_global unless @rtld_global.nil?\n @rtld_global = (value & 2) != 0\n @rtld_global\n end",
"title": ""
}
] | [
{
"docid": "aa577589cabd3d4843fa0fba2339d6ce",
"score": "0.61243707",
"text": "def set_global_only\n @global_only = true\n self\n end",
"title": ""
},
{
"docid": "aa577589cabd3d4843fa0fba2339d6ce",
"score": "0.61243707",
"text": "def set_global_only\n @global_only = true\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c81ad945a83bd7a9147f68b0e9688931",
"score": "0.0",
"text": "def set_claim\n @claim = Claim.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... |
4e726a14245f2601a564e15d7a09f79e | create and read cache with 'key' creates cache if it doesn't exist reads cache if it exists | [
{
"docid": "6ab155622f2791414396c28de6f392bc",
"score": "0.0",
"text": "def cache key\n begin\n if expired?(key)\n content = Proc.new { yield }.call\n set( key, content )\n end\n content ||= get( key )\n return content\n rescue LocalJumpError\n ... | [
{
"docid": "ed00114e5c6376041e7b5295fe3484bf",
"score": "0.7925433",
"text": "def read_cache(key)\n @cache ||= {}\n @cache[key]\n end",
"title": ""
},
{
"docid": "8f8a9f16cbc6bcf7f44809d02f054884",
"score": "0.7795406",
"text": "def thread_safe_find_or_create_cache(key)\n c... |
c94330a10b6e07cf1f1cc7439ef33f89 | Read slide shape info. | [
{
"docid": "8f3ee9014437fb0d358d0704196a695b",
"score": "0.6291762",
"text": "def get_shape(name, slide_index, shape_index, password = nil, folder = nil, storage = nil, sub_shape = nil)\n data, _status_code, _headers = get_shape_with_http_info(name, slide_index, shape_index, password, folder, stora... | [
{
"docid": "73bd2ad02a2d0921d392ae0d4824d869",
"score": "0.59165025",
"text": "def get_shapes(slide_number,storage_type = '',storage_name='',folder_name='')\n begin\n if @filename == ''\n raise 'No file name specified'\n end\n \n str_uri = $... |
f010a8da248912ef72c40035ba0f8728 | Generate a page for each Feature Directory. This is called recursively to ensure that all feature directories contained as children are rendered to pages. | [
{
"docid": "454dee42078d4f79b12eb1825ff57d73",
"score": "0.6906263",
"text": "def serialize_feature_directories_recursively(namespaces)\n namespaces.each do |namespace|\n Templates::Engine.with_serializer(namespace, options[:serializer]) do\n options[:object] = namespace\n T('layout').run(... | [
{
"docid": "d58b5d59ee34d7d78cdcfd0a9ba3fa12",
"score": "0.6703784",
"text": "def generate_featuredirectories_list\n directories_ordered_by_name = root_feature_directories.sort { |x,y| x.value.to_s <=> y.value.to_s }\n generate_full_list directories_ordered_by_name, :featuredirectories,\n :list_tit... |
9669855118be6a7112eb2f8f9e8fc1f6 | Instance initialized with below | [
{
"docid": "f5fff386c10f288e19e3f0362631b880",
"score": "0.0",
"text": "def initialize(name)\r\n @name = name\r\n @strikes = 0\r\n @balls = 0\r\n @outs = 0\r\n @home_runs = 0\r\n @bases = []\r\n end",
"title": ""
}
] | [
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.84109855",
"text": "def initialize() end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.84109855",
"text": "def initialize() end",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af1... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "e2529d87f42918770c40c38e1e590423",
"score": "0.0",
"text": "def set_db_scheduled_job\n @db_scheduled_job = DbScheduledJob.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;... |
3a1a4b72853fc1d177382303d0cd7e61 | ================================================================================= Response to update Params: | [
{
"docid": "470d850f0240b5de5ad8b21913270ff8",
"score": "0.0",
"text": "def update\n @model_obj.update(theme_params)\n website = Website.find(params[:website_id])\n #update_preview website.preview\n redirect_to action: \"index\"\n end",
"title": ""
}
] | [
{
"docid": "f40dbaab2cbe350f38ed7a51a0705615",
"score": "0.733494",
"text": "def update(params)\n with_options(request_method: :put, params: params).response\n end",
"title": ""
},
{
"docid": "eb90249d0a2c7ba0165351ef62bf84d1",
"score": "0.7272384",
"text": "def update(pa... |
51fdfa56d0a318980e8ef63c03f421de | GET /devices/1 GET /devices/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "fff865b72acdc7758482dc1ed89f472d",
"score": "0.72966814",
"text": "def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"title": ""
},
{
"docid": "89... |
3624201e11afc29f5c6dd2a6419a5512 | Returns a element reference by finding it through +id+ in the DOM. This element can then be used for further method calls. Examples: page['blank_slate'] => $('blank_slate'); page['blank_slate'].show => $('blank_slate').show(); page['blank_slate'].show('first').up => $('blank_slate').show('first').up(); You can also pas... | [
{
"docid": "03a9146ac96fe532b738a3628ac51e2f",
"score": "0.57730633",
"text": "def [](id)\n case id\n when String, Symbol, NilClass\n JavaScriptElementProxy.new(self, id)\n else\n JavaScriptElementProxy.new(self, ActionController::RecordIdentifier... | [
{
"docid": "2664db0a9432f47d50be41517e3ddce0",
"score": "0.66509295",
"text": "def id id\n find_element :id, id\n end",
"title": ""
},
{
"docid": "4b845537731ef127497d85e97489ac89",
"score": "0.6384379",
"text": "def element_by_id(elem_id)\r\n if is_firefox?\r\n # ele... |
bb02ce175f705ecd542a2fdb34cbf24b | give points based on timeliness | [
{
"docid": "06b0ddea2a6f469129323d40d491cb2f",
"score": "0.57212615",
"text": "def assign_points\n \n end",
"title": ""
}
] | [
{
"docid": "8581f2bdfe7f2588570eca779f39997d",
"score": "0.6614225",
"text": "def points\n @points ||= parse_points\n end",
"title": ""
},
{
"docid": "6b3c53a3058dadd0007f45031b38ca4a",
"score": "0.65181535",
"text": "def points_on_line start_x, start_y, rise, run, distance\n... |
375d703992ce260e497e6d4d06deacec | PUT /addresses/1 PUT /addresses/1.json | [
{
"docid": "eb79450d6025c37ae80568b479a4947f",
"score": "0.636296",
"text": "def update\n @address = current_user.addresses.find(params[:id])\n respond_to do |format|\n if @address.update_attributes(params[:address])\n format.html { redirect_to \"/#{current_user.name}\", notice: 'Addre... | [
{
"docid": "d3ba64ea51ec6223a15334efb66ee9c9",
"score": "0.7004307",
"text": "def update\n if @address.update(address_params)\n render json: @address\n else\n render json: @address.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "af19af4e9102... |
e66f47c3fbfcb917182e0f9fce595ac7 | ajout de nouveau client sur la plateforme | [
{
"docid": "28fe1ad4ca53e36d17e391b2375e8e1c",
"score": "0.0",
"text": "def new_customer\n end",
"title": ""
}
] | [
{
"docid": "2abe046b9f9716384d90473d6a03bcee",
"score": "0.6872584",
"text": "def create\n @secubat_client = SecubatClient.new(secubat_client_params)\n\n respond_to do |format|\n if @secubat_client.save\n if params[\"commit\"] == \"Sauvegarder et Ajouter un nouveau client\"\n ... |
6fe4483bb5afc1807052810c322e1102 | Update the subscription's plan. Params: +plan_id+:: ID of the new plan to be applied on the subscription +prorate+:: Define if proration should be done when updating the plan +options+:: +Hash+ of options | [
{
"docid": "e52b0eb31b541452b51d138b4e6f2f92",
"score": "0.81850207",
"text": "def update_plan(plan_id, prorate, options = nil)\n request = Request.new(@client)\n path = \"/subscriptions/\" + CGI.escape(@id) + \"\"\n data = {\n 'plan_id'=> plan_id, \n 'prorate'=> prora... | [
{
"docid": "59505e08ce20caa91d67104d3c5e84ec",
"score": "0.74334043",
"text": "def update_plan!(plan_id, profilable = payment_gateway_profilable)\n raise \"Inequivalence beyond object identity, profilable != payment_gateway_profilable\" if profilable != payment_gateway_profilable\n\n _with_stripe_... |
b7199493d995c8f26ebedd9053a927bc | Checks if the names of the entries are unique, i.e. if no one of the entries have the same name. Returns : true if the names in the entries are unique Return Type : boolean | [
{
"docid": "501e1c044f5701a4d9b4bb3fe516404a",
"score": "0.80501294",
"text": "def names_are_unique?(entries)\n\t\tplayers = entries.map{|entry| entry.player()}\n\n\t\tplayers.each do |lhs_player|\n\t\t\tplayers.each do |rhs_player|\n\n\t\t\t\tif lhs_player.name == rhs_player.name && \n\t\t\t\t\t!lhs_pl... | [
{
"docid": "20f29ae792b51206b020d92502cee8f4",
"score": "0.7431169",
"text": "def unique?(name)\n tgts = resolve_mapping(name)\n targets = tgts.is_a?(Array) ? tgts : find(tgts)\n targets.size == 1\n end",
"title": ""
},
{
"docid": "86eff916c71f2544b8fd7a0ddcc12f23",... |
7afcdafe60103d6a1d8558cd0b137bda | Code related to role | [
{
"docid": "0fd3900502152b1b21b8b68937ec67bb",
"score": "0.0",
"text": "def admin?\n self.role == \"admin\"\n end",
"title": ""
}
] | [
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.88028234",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.88028234",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"... |
dc89e517b91fd6c4f6e5ff7bd4ac6cb0 | Compare two cards (fixit: refactor) | [
{
"docid": "244fae271216662a3f955fdba01eaad1",
"score": "0.620504",
"text": "def <=> card\n if rank_of_kind > card.rank_of_kind\n return 1\n end\n if rank_of_kind < card.rank_of_kind\n return -1\n end\n if rank_of_suit > card.rank_of_suit\n return 1\n end\n if rank_of... | [
{
"docid": "7fce2d9bcfc1a65b7b723b15201be86c",
"score": "0.7257851",
"text": "def == other_card\n if self.name == other_card.name and\n self.cost == other_card.cost and\n self.sets == other_card.sets and\n self.image_uri == other_card.image_uri and\n self.multiverse_id =... |
6bffdab7795e61851cb450d7045abcd7 | override iOS rendering method | [
{
"docid": "e00886d79b4676c19d485735d967811a",
"score": "0.0",
"text": "def drawRect(rect)\n\n # grab a random color for drawing\n red = rand\n green = rand\n blue = rand\n color = UIColor.colorWithRed(red, green:green, blue:blue, alpha:1.0)\n\n # set the random color as current drawin... | [
{
"docid": "2dbf5a58ce3d49aad1e45f07f9321159",
"score": "0.73127055",
"text": "def render\n raise NotImplementedError, \"Subclasses must implement a render method\"\n end",
"title": ""
},
{
"docid": "922da2a4295286fffb3d08225c3a3077",
"score": "0.725115",
"text": "def... |
12e08e2907166cb7179ff487cfdb0d3a | GET /species GET /species.json | [
{
"docid": "b8ab39fa9f341f614bd502c52c5801e5",
"score": "0.6837834",
"text": "def index\n @species = Species.all\n end",
"title": ""
}
] | [
{
"docid": "9091445ab95149ce8ca5539d327139f2",
"score": "0.78866726",
"text": "def show\n render json: @species\n end",
"title": ""
},
{
"docid": "81f8eaefcc58e8bedc77f521aa2d48df",
"score": "0.7644663",
"text": "def index\n @species = Species.where(query_params)\n render j... |
4da0354311b3b5e8a74035ead01e1054 | Updates the list of all installed RVM rubies on the system | [
{
"docid": "c6dcb9d65cde2cdc39d977db77c0acd4",
"score": "0.84557915",
"text": "def update_installed_rubies\n @installed_rubies = RVM.list_strings\n @installed_rubies\nend",
"title": ""
}
] | [
{
"docid": "b65c9c06dbdb82e700c939e8177df737",
"score": "0.7580186",
"text": "def update_known_rubies\n @known_rubies = RVM.list_known_strings\n @known_rubies\nend",
"title": ""
},
{
"docid": "935496cea714e7f37af6afda51b08b65",
"score": "0.71158004",
"text": "def setup_rubies\n ... |
d7f2996cbf47b0da2b1631e484fbe63e | GET /events/[star|unstar] GET /events/[star|unstar].xml | [
{
"docid": "db1ad10f2e0dfad44c6d9893f789548c",
"score": "0.0",
"text": "def set_starred_state(intended_starred_state)\n @event = Event.find(params[:id])\n \n case intended_starred_state\n when true\n message = \"Event successfully starred\"\n starred_state = @even... | [
{
"docid": "655773957e1b525642f0e9136bbde84b",
"score": "0.65245605",
"text": "def index\n @events = Event.lookup\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "7e511467f8b7fb22b8... |
db9e7c528b59ab1765f0975293dc33d8 | POST /weekplans POST /weekplans.json | [
{
"docid": "e3513b8dcd2c941416e669063e99c172",
"score": "0.7552646",
"text": "def create\n @weekplan = Weekplan.new(weekplan_params)\n\n respond_to do |format|\n if @weekplan.save\n format.html { redirect_to @weekplan, notice: 'The plan was successfully created.' }\n format.json... | [
{
"docid": "8744d4a1e0c4d8935b09aacab2ba1ee2",
"score": "0.7297633",
"text": "def weekplan_params\n params.require(:weekplan).permit(:plan)\n end",
"title": ""
},
{
"docid": "a5eeca11595b11ff9f09067adc8903e5",
"score": "0.68616664",
"text": "def index\n @weekplans = Weekpl... |
42d02936c5c1a2e5194a8813f17181eb | Set current user in DEMO | [
{
"docid": "879cd36f94c160413ec9f54c78396630",
"score": "0.0",
"text": "def set_user\n User.before_set_user # for testing only\n\n session[\"user\"] = User.authentication_service.get_user_session(params[:id])\n redirect_to \"/test/users\"\n end",
"title": ""
}
] | [
{
"docid": "5e2877b9d4079da263f67646ff68099d",
"score": "0.86035687",
"text": "def set_user\r\n @user = current_user\r\n end",
"title": ""
},
{
"docid": "fe178d3fe1327bd45b2477cd272c5b6a",
"score": "0.8566253",
"text": "def set_user\n @user = @current_user\n end",
"title"... |
23ba53cc92625c91ddd118e282dc8b6d | GET /todos GET /todos.json | [
{
"docid": "8b1dbac81472eff58cb602a4a1473ebb",
"score": "0.0",
"text": "def index\n @users = User.all\n end",
"title": ""
}
] | [
{
"docid": "7ccebee0d4839eba8a4a2c3245a09764",
"score": "0.80005896",
"text": "def index\n @todos = @user.todos\n render json: @todos\n end",
"title": ""
},
{
"docid": "c16be5131581e97d99ddb45de4f4414a",
"score": "0.7970908",
"text": "def index\n @todos = Todo.all\n json... |
195d5b40bdec2fa3af6b0146afabac27 | Replaces a WikiWord link with a link to a Page, if it exists. | [
{
"docid": "5134397d436b230e7c88573d5a99bc48",
"score": "0.57759273",
"text": "def replace_wiki_words(str)\n str.gsub(/\\[\\[([A-Za-z0-9 \\\\]+)\\]\\]/) do |match|\n c_string, page_string = params[:controller], $1\n if $1.match(/\\\\/)\n ary = $1.split(/\\\\/)\n c_string, page... | [
{
"docid": "ce6a93a12f8595141d1a1877fc6ab0c4",
"score": "0.65182084",
"text": "def link_to_page(page_name, wiki= @wiki, text = nil, options = {})\r\n raise 'Wiki not defined' if wiki.nil?\r\n wiki.make_link(page_name, text, \r\n options.merge(:base_url => \"#{base_url}/#{wiki.nam... |
2da7175b2b788ef7c07ab4c4bcd9e324 | 7) Remove all items from cart_total Allow a user to remove multiple items at once from the cart. | [
{
"docid": "b70667a6684db536ce71b1e375e3232b",
"score": "0.74713063",
"text": "def remove_all_from_cart\n Cart.clear\nend",
"title": ""
}
] | [
{
"docid": "a216f1a770d5dde285914dfe46d65514",
"score": "0.7284663",
"text": "def delete_all_items_in_cart\n destroy_all_order_items if is_pending?\n end",
"title": ""
},
{
"docid": "ff5895cc8ec7cc9e2083035eeb3491ca",
"score": "0.72065324",
"text": "def clear_cart\n self.order... |
4f5f0bec82bf942188a425e19fdb1b6b | Loads the file from the supplied path, and parses it with `JSON.parse` Returns a hash | [
{
"docid": "f590a0d0b31616b62c90ef7f562012bb",
"score": "0.67863256",
"text": "def load_file path\n text = \"\"\n open_file_safely(path).\n each_line(){|line| text << line }. \n close\n validate_json text\n end",
"title": ""
}
] | [
{
"docid": "65fd87e042e027db6b0aeedfca03173c",
"score": "0.8427574",
"text": "def load_hash(file_path) \n file=File.read(file_path)\n JSON.parse(file)\n end",
"title": ""
},
{
"docid": "60169da4f0c7957910fd6c759921a78c",
"score": "0.8274173",
"text": "def read_json(path)\n fi... |
8fb41bae047825cdad942316c97c23a5 | Returns the visible documents that the group has access to | [
{
"docid": "f4f8d7766c93570191f0213737284b22",
"score": "0.82506675",
"text": "def visible_documents\n permissions = self.permissions.find(:all, \n :conditions => [\"controller = ? AND action = ?\", \"documents\", \"show\"])\n ids = permissions.collect{|p| p.subject_id}\n Doc... | [
{
"docid": "7f8e176cc8fb549b1f40d2e8bbca0a0c",
"score": "0.7063503",
"text": "def show\n @group = Group.find(params[:id])\n @groups = Group.find(:all, :order => 'updated_at').reverse().find_all{|g| g.visible or g.visible == nil}\n @documents = @group.documents.sort_by {|doc| doc.updated_at }.re... |
71a72e07613f6e5f3ce0d7a1b5b91842 | environment variable is only used if no config file | [
{
"docid": "37176a17513597a7ae4ae1756d8a29f2",
"score": "0.0",
"text": "def azure_resource_id\n @azure_resource_id ||= config[\"azure_resource_id\"]\n end",
"title": ""
}
] | [
{
"docid": "bd1d501b2cb07953ec759dab24efe265",
"score": "0.75495046",
"text": "def env_config; end",
"title": ""
},
{
"docid": "bd1d501b2cb07953ec759dab24efe265",
"score": "0.75495046",
"text": "def env_config; end",
"title": ""
},
{
"docid": "0bae4d616c0636db361f47947dd0... |
ba027791a639d7ec4b8bc51530f0a870 | Performs an HTTP POST against the API. | [
{
"docid": "c7b1efe4ecc0cfaf440e3e5adb1d8d3f",
"score": "0.7321154",
"text": "def post(url, body)\n return self.make_request(:post, url, body)\n end",
"title": ""
}
] | [
{
"docid": "3b1ed2b99ae176613d2129bd767ff0cc",
"score": "0.8034524",
"text": "def post\n uri = post_api_uri\n result = handle_with_exception(uri) do |http|\n uri_path = uri.path.present? ? uri.path : \"/\"\n @headers.present? ? http.post(uri_path, @request_parameters.to_query, @h... |
2736d98a8d6b8347288ffd5f1893d325 | single document availability info | [
{
"docid": "d6213fb93d45ff4c68cb8bece7a1e2e8",
"score": "0.6981484",
"text": "def availability\n end",
"title": ""
}
] | [
{
"docid": "bf681f86528b214fb3104061c3016413",
"score": "0.6804209",
"text": "def availability_status\n return @availability_status\n end",
"title": ""
},
{
"docid": "71ad985915331aecde510c9f6aed83fc",
"score": "0.6797567",
"text": "def fetch_availability\n ... |
67b03c6bef859ae804bdb7d47b3df300 | play_again: prompt to continue playing | [
{
"docid": "ae2c0c1b186ad4a2c314e88b00ae1d26",
"score": "0.73635215",
"text": "def play_again\n\tputs \"do you want to play again? (type 'Y' or 'N')\"\n\tagain = gets.chomp\n\t\n\tif again == 'Y' || again == 'y'\n\t\tgame\n\telse\n\t\tputs '>>> laytaz <<<'\n\t\t# ???? need to break out loop ????\n\t\t# ... | [
{
"docid": "9785ff61e6d0756595f8ed952f2c6872",
"score": "0.8325553",
"text": "def play_again\n\t \tputs \"Do you want to play again ? yes or no ?\"\n\t \tanswer = gets.chomp\n\t \t\tif answer == \"yes\"\n\t \t\tputs \"Here we go again\"\n\t \t\tGame.new.go\n\t \t else puts \"That is OK, we can stop pla... |
a1f7d3194b007799579b1fbfddb6bc88 | use to serialize json of object with current user options if logic require more than one options please use default serializer init style for best customizable | [
{
"docid": "0c11f645ecab64ece140041098886f94",
"score": "0.0",
"text": "def serialize(serializer = nil, options = {})\n serializer ||= self.class::DEFAULT_SERIALIZER\n serializer.new(self, options: options).attributes\n end",
"title": ""
}
] | [
{
"docid": "84f09323398a965b8f6d879b93a33d77",
"score": "0.73626655",
"text": "def to_json(options = {})\n super(self.class.serialize_options_update(options))\n end",
"title": ""
},
{
"docid": "b9d41f358c141400194d7d25d2b4df93",
"score": "0.7267847",
"text": "def _render_opti... |
6ec5641d54cc2d4a66456f59845a9438 | Override start to do custom dispatch (looking for plugin for unknown command) | [
{
"docid": "6b351500eb301906d5a1918759790c91",
"score": "0.0",
"text": "def start(given_args = ARGV, config = {})\n\n config[:shell] ||= Thor::Base.shell.new\n\n command_name = normalize_command_name(retrieve_command_name(given_args.dup))\n clazz = command_name ? class_for_command[c... | [
{
"docid": "963603c831e74cbe872d391efa7d4365",
"score": "0.67510337",
"text": "def start\n raise 'This is an abstract action and should be inherited and implemented!'\n end",
"title": ""
},
{
"docid": "f624fabbcc0024856a18146344f4a9c9",
"score": "0.6697035",
"text": "def star... |
a7fd72067b82a72424f1fb0418bbb084 | DELETE /admin/stories/1 DELETE /admin/stories/1.json | [
{
"docid": "8731bdd9d5cae0426895e9e590e19782",
"score": "0.7469043",
"text": "def destroy\n @story.destroy\n respond_to do |format|\n format.html { redirect_to admin_stories_url, notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.story', cou... | [
{
"docid": "3874ec41a47a05f1e277bae2778a6fb8",
"score": "0.78635526",
"text": "def delete_story(id)\n @client.raw('delete', \"/content/stories/#{id}\")\n end",
"title": ""
},
{
"docid": "86eb69729dc7ac49dda7c471542de118",
"score": "0.77953887",
"text": "def destroy\n @story.de... |
2bf2c8b8f5769f6db01b856f831667d2 | Returns false if the next backward will return an element. | [
{
"docid": "949003d59a64ec6e410337c2caa2c861",
"score": "0.0",
"text": "def at_beginning?; raise NotImplementedError; end",
"title": ""
}
] | [
{
"docid": "ca5964418da5077eecb99bf996fe50d1",
"score": "0.77063525",
"text": "def next?\n !last?\n end",
"title": ""
},
{
"docid": "74c5d99af96d36fc1186262506bb3221",
"score": "0.7481324",
"text": "def has_next?\n !next_item.nil?\n end",
"title": ""
},
{
... |
531aa34add096aa3a3379a5d73ee3cca | Gets the firstSeenDateTime property value. The first date and time this host was observed. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014, is 20140101T00:00:00Z. | [
{
"docid": "a15c92d97254780351873bf85030e78c",
"score": "0.8150694",
"text": "def first_seen_date_time\n return @first_seen_date_time\n end",
"title": ""
}
] | [
{
"docid": "3168c16429bd68b9b732624feb57b06b",
"score": "0.7461268",
"text": "def first_seen_date_time=(value)\n @first_seen_date_time = value\n end",
"title": ""
},
{
"docid": "3168c16429bd68b9b732624feb57b06b",
"score": "0.7461268",
"text": "def first_seen... |
285ef7b71bea1fa3439f6234a07e5a36 | Return the converted content of the children of +el+ as a string. The parameter +indent+ has to be the amount of indentation used for the element +el+. | [
{
"docid": "c4ed4fc1141078c3101458495f4848c1",
"score": "0.5489886",
"text": "def inner(el, indent); end",
"title": ""
}
] | [
{
"docid": "2991a7184578da8bb8c959cd97a1cdbf",
"score": "0.63247097",
"text": "def inner(el, indent)\n result = ''\n indent += @indent\n @stack.push(el)\n\n if el.type == :ol\n el.children.each {|c, i| c.options[:ordered] = true}\n end\n\n el.children.e... |
ed8097ab123fef64b37a45f15774481a | POST /reviews POST /reviews.json | [
{
"docid": "b7bc8a209aee0d84336d15fa5d1e71df",
"score": "0.0",
"text": "def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n @review.book_id = @book.id\n \n if @review.save\n flash[:success] = \"Review successfully created\"\n redirect_to @book\... | [
{
"docid": "8efc0fbf5b99d3ed070fc5f9e06c19f3",
"score": "0.7683334",
"text": "def create\n @review = @reviews.build(review_params)\n\n respond_to do |format|\n if @review.save\n format.json { render :index }\n else\n format.json { render json: @review.errors, status: :unpro... |
227f7f7690bc5141cb5b1a357ba81f5f | getStyle finds a placemark's style by recursively checking its ancestors and descendants | [
{
"docid": "283711bbba65e4fb1d632502dcfd913b",
"score": "0.6623855",
"text": "def getStyle(name, placeHash)\n\tvalues = placeHash[name]\n\tstyle = \"00\"\n\tif values == nil\n\t\tstyle = \"00\"\n\telsif values[1] != nil\n\t\tstyle = values[1]\n\telse\n\t\tstyle = checkAncestors(name, placeHash)\n\t\tsty... | [
{
"docid": "4c9c3083420fb9502d104ce34f021bf1",
"score": "0.5824196",
"text": "def checkAncestors(name, placeHash)\n\tvalues = placeHash[name]\n\tstyle = \"00\"\n\tif values == nil\n\t\tstyle = \"00\"\n\telsif values[1] != nil\n\t\tstyle = values[1]\n\telsif values[0] != nil\n\t\tstyle = checkAncestors(v... |
6eb49c2c71082d5d1042cbd9a6248a8b | display all instances of a specific attribute in the database | [
{
"docid": "5e7b4f7e145d891268369064d71241a1",
"score": "0.6889104",
"text": "def display_by_attribute\n\t\tputs \"\\nEnter attribute to display (ID, first name, last name, email):\"\n\t\tattribute = gets.chomp.downcase\n\n\t\tif attribute == \"id\"\n\t\t\t@database_array.each {|x| puts x.id}\n\n\t\tels... | [
{
"docid": "e502248cc0fd063cbdbd1e99ea95ac39",
"score": "0.6533881",
"text": "def display_info_by_attribute(arg)\r\n\t\tattribute_array = []\r\n\t\t@contacts_array.each do |contact|\r\n\t\t\tattribute_array << contact.send(arg) # Database#send passes the 'arg' string to contact, but as a method and not ... |
39f0dfecda4b0db36d6f9a5e2f1840b0 | Determine if all the targets for the install directories are writable decomposing each candidate directory from the right side and checking if that path is writable. If not, we require explicit permission. | [
{
"docid": "f4e211edf84a8e76c26f5e82f815baad",
"score": "0.7283038",
"text": "def need_permission?\n FileList[\"#{BUILD_CONFIG[:stagingdir]}/*\"].each do |name|\n destdir = ENV['DESTDIR'] || ''\n dir = File.expand_path(File.join(destdir, BUILD_CONFIG[:prefixdir], name))\n\n until dir == \"/\"\... | [
{
"docid": "97f1054a1e8902d881baea0b2ed6559b",
"score": "0.66289496",
"text": "def check_perms\n @perms_checked = true\n @perms = {} if @perms.nil?\n \n if File.directory?(@path)\n @perms[:readable] = @perms[:writable] = @perms[:executable] = false\n else\n\n path ... |
aa10f1ca9b4d25a17a5ecb44a7a2ee66 | Edit action retrives the post and renders the edit page | [
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.0",
"text": "def edit\n end",
"title": ""
}
] | [
{
"docid": "ffb18491690025bddd92984aa80bbf9d",
"score": "0.8444802",
"text": "def edit\n # Same as show action, we need to find the specific post to edit\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "7ab66614f674b28122c671c826f08e96",
"score": "0.84... |
c81d50a8c792255dd9107a9e7f79a31a | redirect to last page (e.g. open tab) or /admin after sign_in | [
{
"docid": "2b4f4a23c2e580a9ccd7ae4cd7d78bce",
"score": "0.7320362",
"text": "def after_sign_in_path_for(_resource)\n session['user_return_to'] || '/admin'\n end",
"title": ""
}
] | [
{
"docid": "4af89f45cfca36d3172c7c530c6a5661",
"score": "0.8025244",
"text": "def redirect_to_appropriate_page_after_sign_in\n if params[:redirect_back_url]\n redirect_to params[:redirect_back_url]+\"?auth_token=#{@current_user.auth_token}\"\n elsif params[:requested_url]\n redir... |
a9918934f139a2505828190f19625bcd | if n < 2 1 else n function(n 2) end end | [
{
"docid": "4ef83f34d8c471c5455bf3e4051d78f1",
"score": "0.0",
"text": "def number_of_zero_for_f(n)\n\t# n が奇数なら必ず 0.\n\treturn 0 if n.odd?\n\n\tnumber_of_five = 0\n\t# n が偶数の場合, 2, 4, ..., n の中の約数5の個数を数える.\n\tnumber_to_divide = 5\n\twhile (number_to_divide * 2 <= n)\n\t\tnumber_of_five += n / 2 / numbe... | [
{
"docid": "652e86bc7d4afc447b631c95195f19a3",
"score": "0.74816245",
"text": "def func(n)\n if n < 3\n n\n else func_iter(2, 1, 0, n)\n end\nend",
"title": ""
},
{
"docid": "591e2db03b9faf6a562fb0154cdf0cb1",
"score": "0.7389044",
"text": "def even(n)\n if n.odd?\n puts \"... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "b7577d065d4ff36dd597ab200d54e4c8",
"score": "0.0",
"text": "def update!(**args)\n @image = args[:image] unless args[:image].nil?\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
cc254e68a487f75a1236e43ff71b156f | scrape Scoutlander for the passed adult, popluate their info, and add scout links (but no scout info) | [
{
"docid": "afb0e8e378d12b241c105a1201c0e0a2",
"score": "0.8242728",
"text": "def fetch_adult_info_with_scout_links(adult_datum)\n adult_page = fetch_person_info(:adult, adult_datum)\n\n if adult_page.search(\"table#ctl00_mainContent_ParentProfile_tblScoutGrid a\").size > 0\n adul... | [
{
"docid": "92e9b518fe77f9ca9fa7ed48f1b2b751",
"score": "0.7503335",
"text": "def fetch_unit_adults_with_scouts\n login\n\n adults_page = @agent.get(\"/securesite/parentmain.aspx?UID=#{@unit.sl_uid}\")\n # puts adults_page.inspect\n # get the table rows, excluding the first t... |
5cbde50671bc076ef666e3a89903a0f4 | GET /otrunk_example_otrunk_imports/new GET /otrunk_example_otrunk_imports/new.xml | [
{
"docid": "099d700040c6c4c297e7d10b20c07d21",
"score": "0.78157675",
"text": "def new\n @otrunk_import = OtrunkExample::OtrunkImport.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @otrunk_import }\n end\n end",
"title": ""
}
] | [
{
"docid": "c86f7f910d961c73a5b53ede8544763c",
"score": "0.6907229",
"text": "def create\n @otrunk_import = OtrunkExample::OtrunkImport.new(params[:otrunk_import])\n\n respond_to do |format|\n if @otrunk_import.save\n flash[:notice] = 'OtrunkExample::OtrunkImport was successfully creat... |
e81232f3adaed84fe82e9b2a1287c96d | POST /catalogs/resources POST /catalogs/resources.json | [
{
"docid": "56b75d84dc97531e7f41b2308354c254",
"score": "0.69736123",
"text": "def create\n @catalogs_resource = Catalogs::Resource.new(catalogs_resource_params)\n if @catalogs_resource.save\n flash[:success] = t('notices.saved_successfully')\n index\n end\n end",
"title": ""
}... | [
{
"docid": "8709c3dcca344d727390a9afdbda8f73",
"score": "0.67849475",
"text": "def create\n @catalogs_resource = Catalogs::Resource.new(params[:catalogs_resource])\n\n respond_to do |format|\n if @catalogs_resource.save\n format.html { redirect_to(@catalogs_resource, :notice => 'Nuevo ... |
064d7fc2b09d3cbab40c1720b5495c16 | DELETE /shredders/1 DELETE /shredders/1.json | [
{
"docid": "86011b889335ca56f294461a679e5ce8",
"score": "0.714914",
"text": "def destroy\n @shredder.destroy\n respond_to do |format|\n format.html { redirect_to shredders_url, notice: 'Shredder was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"titl... | [
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.7104298",
"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": "... |
b27fee8615d647a1aadaf0e4cc967018 | Create a process in the native architecture | [
{
"docid": "2182d205303c246daf3eb21b26beacc1",
"score": "0.49375516",
"text": "def spawn_inject_proc(win_dir)\n print_status('Spawning process with Windows Publisher Certificate, to inject into...')\n if sysinfo['Architecture'] == ARCH_X64 && session.arch == ARCH_X86\n cmd = \"#{win_dir}\\\\s... | [
{
"docid": "94206a10dc3759e4f3d4b56196419b96",
"score": "0.6289478",
"text": "def create_process(*args, start: true, wait: true, attach: true, cwd: nil, environment: {})\n process = ChildProcess.build(*args)\n process.io.inherit! if attach\n\n # Set the working directory\n process.cwd = cwd unless c... |
2aa7ed4f853fd6b536adff32a4a796a5 | POST /beveragecategories POST /beveragecategories.json | [
{
"docid": "7ee5cd00d062daa215eb16953cd241bd",
"score": "0.6770866",
"text": "def create\n @beveragecategory = Beveragecategory.new(params[:beveragecategory])\n\n respond_to do |format|\n if @beveragecategory.save\n format.html { redirect_to @beveragecategory, notice: 'Beveragecategory... | [
{
"docid": "de1019d3d161e462915d4ceb82ed94b7",
"score": "0.71057606",
"text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"title": ""
},
{
"docid": "efcb5e10780279c84a4be599091f0268",
"score": "0.66... |
76d8e90193d8d568fc0868b7e7b293b8 | PATCH/PUT /antennas/1 PATCH/PUT /antennas/1.json | [
{
"docid": "cb465056347ed1991658e6591dd9b336",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @antenna.update(antenna_params)\n format.html { redirect_to @antenna, notice: 'Antenna was successfully updated.' }\n format.json { render :show, status: :ok, location: ... | [
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.64567363",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.643022",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "489ca02ff3e7fc245b003748feb4237a",
"score": "0.0",
"text": "def artcile_params\n params.require(:artcile).permit(:title, :content).merge(user_id: current_user.id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
5bce7e9eab4045588a5e7d96dcc0ed56 | DELETE /current_stats/1 DELETE /current_stats/1.xml | [
{
"docid": "c58db62aa6c077f7b6c27735660a5c9f",
"score": "0.7347188",
"text": "def destroy\n @current_stat = CurrentStat.find(params[:id])\n @current_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to(current_stats_url) }\n format.xml { head :ok }\n end\n end",
... | [
{
"docid": "4107dddc77164a96d9420f2ceb0ca66d",
"score": "0.71099865",
"text": "def destroy\r\n @stat = Stat.find(params[:id])\r\n @stat.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(stats_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
... |
df9489c2b87e0057a635634be8943a7c | GET /zip_demographics/1 GET /zip_demographics/1.xml | [
{
"docid": "d64a15431d084640fd4aa03eaba5deac",
"score": "0.6561285",
"text": "def show\n @zip_demographic = ZipDemographic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @zip_demographic }\n format.js { render :json => @zip_... | [
{
"docid": "d7efe6715e98f02d9fece051a7f158c2",
"score": "0.69226193",
"text": "def show\n @zip = Zip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @zip }\n end\n end",
"title": ""
},
{
"docid": "a88a204f37eb24203... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "2a16f2ae6293c98101e58fc71c9d95db",
"score": "0.0",
"text": "def update!(**args)\n @results = args[:results] if args.key?(:results)\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... |
44f2243974e41a0de3f932ceea85eb75 | returns true if the /var/log/messages has things the look like errors in them warn, notice, error, fatal, backup: (becasue there is an error here) this is a tad fragile as if te logging is not correct, we will not see the error | [
{
"docid": "d0e670bf24d735bd1cc67eff307fc3b2",
"score": "0.7253946",
"text": "def log_has_errors?(_server, _ignores=nil , _grep_patt = 'notice|warn|error|fatal|backup:|fail')\n syslog = syslog_id(_server)\n status = self.get_log_errors(_server, _grep_patt, _ignores)\n if (!status.passed)\n ... | [
{
"docid": "54efa99e34289608bf851ffdc7eeeb23",
"score": "0.769922",
"text": "def errors?\n return true if @log.buffer.join().match(/WARN|ERROR|FATAL|UNKNOWN/i)\n return false\n end",
"title": ""
},
{
"docid": "197c2d44307cdb8c9caa18c9900d5776",
"score": "0.6884446",
"text": "d... |
c8441f9ee6b367864598682d6acf31ae | Return a list of units accessible through Team Switch ==== Syntax Array = switchableUnits ==== Parameters ==== Returns Array ==== Multiplayer ==== See Also Team_Switch, units, playableUnits, allUnits, allGroups, vehicles Official Wiki: ==== Examples | [
{
"docid": "2f2ed90552346416a246c197cd85cb1a",
"score": "0.6355535",
"text": "def switchableUnits \n \"switchableUnits\" \n end",
"title": ""
}
] | [
{
"docid": "4307246249a2262e396e44a56e2f0e7a",
"score": "0.6029039",
"text": "def unit_idlers\n world.units.active.find_all { |u|\n unit_isidler(u)\n }\n end",
"title": ""
},
{
"docid": "fb237c768deb2b29e463b6ab26a44dbe",
"score": "0.60262406",... |
c47e439debe13b73d35b61abbb8b6ce5 | Determine if a specific board position is taken; return "true" if so | [
{
"docid": "8a43f27cb16ef8b8b07383e17bc26d27",
"score": "0.0",
"text": "def position_taken?(index)\n @board[index] == \"X\" || @board[index] == \"O\"\n end",
"title": ""
}
] | [
{
"docid": "76a417758ab0a6f8b449e55729503756",
"score": "0.8397085",
"text": "def position_taken?(board, position)\n if !board.empty? && board[position] && (board[position].include?(\"X\") || board[position].include?(\"O\"))\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c5a80d05965663f6d5a4d8be83da137e",
"score": "0.0",
"text": "def set_movie\n @movie = Movie.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... |
9c8881665cb35cc5cb6cdd7ec9c7cf84 | Returns the URI for the specified database table (or report). | [
{
"docid": "5b60f486938cc43434e3375b5a6a283c",
"score": "0.82010925",
"text": "def get_uri(table_or_report_name)\n \"/#{URI.encode ZohoReports.configuration.login_email}/#{URI.encode ZohoReports.configuration.zoho_database_name}/#{URI.encode table_or_report_name}\"\n end",
"title": ""
}
] | [
{
"docid": "8eda0808e565877c68207d183bceb9d4",
"score": "0.6758265",
"text": "def uri(db = database)\n \"#{db.root}/#{self['_id']}\"\n end",
"title": ""
},
{
"docid": "cf1b754ad6e7af1db63734bd3f14f74f",
"score": "0.67124313",
"text": "def path(table)\n \"#{database}.... |
2d9a31f75916aa49a69723221d321c82 | PUT /emoneyoutstandings/1 PUT /emoneyoutstandings/1.xml | [
{
"docid": "ad6ee6798e1dc72ebc79b9b88c337fb0",
"score": "0.58856225",
"text": "def update\n @emoneyoutstanding = Emoneyoutstanding.find(params[:id])\n\n respond_to do |format|\n if @emoneyoutstanding.update_attributes(params[:emoneyoutstanding])\n format.html { redirect_to(@emoneyoutst... | [
{
"docid": "d053646fc71a8e383c80e0a49096fec9",
"score": "0.59029835",
"text": "def update\n @eep = Eep.find(params[:id])\n\n respond_to do |format|\n if @eep.update_attributes(params[:eep])\n format.html { redirect_to(@eep, :notice => 'Eep was successfully updated.') }\n format.... |
db5c3f00003755c3ce555eb4aac58811 | PATCH/PUT /addresses/1 PATCH/PUT /addresses/1.json | [
{
"docid": "6445853eb328fbae2b6c1001f3cf0ce4",
"score": "0.6212829",
"text": "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to [:admin,@address], notice: 'Address was successfully updated.' }\n format.json { render :show, status: ... | [
{
"docid": "ec7eb5e4ae6c8278b775dc2146e487c0",
"score": "0.7079826",
"text": "def update\n respond_to do |format|\n if @address.update(address_params)\n format.html { redirect_to @address, notice: 'Address was successfully updated.' }\n format.json { render :show, status: :ok, loca... |
c3aa85b6ee1109d1a2d2e2737c0809d9 | refute_includes(collection, obj, msg = nil) Fails if collection includes obj. | [
{
"docid": "47d503e382cff0714c5816a70ac7d9cc",
"score": "0.5996936",
"text": "def test_refute_includes\n array = [1, 18, 4, 9, 15, 3]\n found_3 = false\n array.each do |num|\n found_3 = true if num == 3\n end\n raise \"Expected #{array.inspect} to not include 3.\" if foun... | [
{
"docid": "d5434b48d6e5e88363c8fa879410fe75",
"score": "0.9037176",
"text": "def refute_includes(collection, obj, msg = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d4543f9bcc8e356dc78e3f699fd357a6",
"score": "0.90015686",
"text": "def refute_includes collection, obj, msg = nil\... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "23570fc4cf16c5b65033932668e7c051",
"score": "0.0",
"text": "def set_rating\n @rating = Rating.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
546afff028ae325bf1b1dd00080495e7 | GET /workstatuses GET /workstatuses.json | [
{
"docid": "c39e25560bb36e8021a51145ed895ee1",
"score": "0.709449",
"text": "def index\n @workstatuses = Workstatus.all\n end",
"title": ""
}
] | [
{
"docid": "69c8b6a30019f39075d856a0bea84189",
"score": "0.68353474",
"text": "def work_statuses\n @work_statuses = WorkStatus.all\n end",
"title": ""
},
{
"docid": "895aa559dc1a9829b45c0187c631a2a3",
"score": "0.66231185",
"text": "def get_tweets\n tweets = TwitterService.new... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f5432df5a51a6340d0776ab7c4527c62",
"score": "0.0",
"text": "def set_change_password\n @change_password = ChangePassword.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... |
22a380c78882864ddd78b6abb622ddf1 | POST /restaurant/locations POST /restaurant/locations.json | [
{
"docid": "31d07b338a232c3a85b401c2dca1418a",
"score": "0.7107263",
"text": "def create\n @restaurant_location = Restaurant::Location.new(params[:restaurant_location])\n\n respond_to do |format|\n if @restaurant_location.save\n format.html { redirect_to @restaurant_location, notice: '... | [
{
"docid": "650e8f9cbfd39222c1fdff06ea2b383e",
"score": "0.6837787",
"text": "def create\n @species_location = SpeciesLocation.new(species_location_params)\n\n if @species_location.save\n render json: @species_location, status: :created, location: @species_location\n else\n render jso... |
73d7b03fef7e9a8b947c4f8ed41acdd2 | Upload box file to be hosted on VagrantCloud. This method provides different behaviors based on the parameters passed. When the `direct` option is enabled the upload target will be directly to the backend storage. However, when the `direct` option is used the upload process becomes a two steps where a callback must be ... | [
{
"docid": "c9b074ab5b8c374f252a24f0f44c559f",
"score": "0.77193975",
"text": "def upload(path: nil, direct: false)\n if !exist?\n raise Error::BoxError::ProviderNotFoundError,\n \"Provider #{name} not found for box #{version.box.tag} version #{version.version}\"\n end\... | [
{
"docid": "3dd7481c32dc06563a47b9529f5a50b2",
"score": "0.7106651",
"text": "def upload_file(path, &block)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b8574435a9ceffb1049f94fd41981462",
"score": "0.7000313",
"text": "def upload_file(&block)\n re... |
01cfa4ebfabddded8e62a56fc3e5883d | If user has defined basic auth in the settings, they should be added to the HTTP request. | [
{
"docid": "1e13d6fcdc0a6259b1fd97065bb1e27a",
"score": "0.7763347",
"text": "def prepare_basic_auth(request)\n user = @options[:user] || nil\n pass = @options[:pass] || nil\n\n request.basic_auth user, pass\n request\n end",
"title": ""
}
] | [
{
"docid": "b6bfb2a1c75db29034264fd35b5bb5a6",
"score": "0.7825291",
"text": "def require_http_basic_auth\n if APP_CONFIG['perform_authentication']\n authenticate_or_request_with_http_basic do |login, password|\n login==APP_CONFIG['username'] and password == APP_CONFIG['password']\n ... |
250039dab9fca7bc8edfc3eeb822d635 | GET /offers/1 GET /offers/1.json | [
{
"docid": "dce055789443c9b14622e093c643c36f",
"score": "0.63234246",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @offer }\n end\n end",
"title": ""
}
] | [
{
"docid": "f2eb41f34d532623753b377dfcdcdd61",
"score": "0.7771842",
"text": "def show\n @offer = Offer.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @offer }\n end\n end",
"title": ""
},
{
"docid": "d019bd1853a72c3c85667866bcbaf988",
"score": "... |
85e33a826498b23a96028aa777a7dbde | GET /skaters/1 GET /skaters/1.json | [
{
"docid": "db0532677beaa78be6640c97249f854f",
"score": "0.0",
"text": "def show\n @gofes = Gofe.all\n @scores = Score.all\n @club_awards = ClubAward.all\n @ab_teams = AbTeam.all\n @external_awards = ExternalAward.all\n @star_golds = StarGold.all\n @star_with_honors = StarWithHonor.... | [
{
"docid": "a1d9fc82f15089729c8eeca4721db103",
"score": "0.6847541",
"text": "def show\n @skid = Skid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skid }\n end\n end",
"title": ""
},
{
"docid": "0c65c0a81d245f227... |
6a386ffe3496550ac0dc0dda3fa072a9 | An iterator that "walks the tree," descending into children recursively. | [
{
"docid": "5ec351b5695b648220541d5f548f28a9",
"score": "0.7235888",
"text": "def walk(&blk)\n yield self\n self.each_child do |child|\n child.walk(&blk)\n end\n end",
"title": ""
}
] | [
{
"docid": "0b68b0227c6c3c44c728cc453f8b9196",
"score": "0.7646091",
"text": "def each\n @children.each {|child| yield child}\n end",
"title": ""
},
{
"docid": "606b7f2c52d8b509287f3308af8506c9",
"score": "0.76220995",
"text": "def each\n queue = [@root]\n until queu... |
bb14c397778f4bf98ceb211b5e871f99 | see lines 28662870 in calendrica3.0.cl Return Julian centuries since 2000 at moment tee. | [
{
"docid": "b9096dd805653b838a72d5093e2cebc6",
"score": "0.76391274",
"text": "def julian_centuries(tee = self.fixed)\n (dynamical_from_universal(tee) - j2000) / mpf(36525.0)\n end",
"title": ""
}
] | [
{
"docid": "f5adfd2aad59b5d1b5c32b01a2232dfc",
"score": "0.68125975",
"text": "def calcJDFromJulianCent(t)\n t * 36525.0 + 2451545.0\n end",
"title": ""
},
{
"docid": "ba7631cdb3be2bad3c4ba24526d6e632",
"score": "0.636909",
"text": "def calc_ju_iers2003(t)\n return (0.599546... |
f48d29108fff18da23ee47889a237903 | sorts resources into resources marked priority, resources marked read and unread resources | [
{
"docid": "667c3558d69da9be53f11e84198bde2a",
"score": "0.6019208",
"text": "def index\n @resources = []\n\n if @current_user.user_type == \"coach\"\n @resources = @current_user.resources\n elsif @current_user.user_type == \"student\"\n @resources = @current_user.coach.resources if @... | [
{
"docid": "6b250f5f4d12eebdac718c5ec6be07f8",
"score": "0.71627414",
"text": "def sorted_resources(resources, order)\n sort_order = order.map { |i| [ i.property, i.direction == :desc ] }\n\n # sort resources by each property\n resources.sort do |a,b|\n cmp = 0\n s... |
d59bc1c283cc87b87986ad5a3d479ae4 | POST /diningts POST /diningts.json | [
{
"docid": "4aa264fbcb63b380a6636f3ffc650426",
"score": "0.6290197",
"text": "def create\n @diningt = Diningt.new(diningt_params)\n\n respond_to do |format|\n if @diningt.save\n format.html { redirect_to @diningt, notice: 'Diningt was successfully created.' }\n format.json { ren... | [
{
"docid": "fdecb77e3b4af059bb37d0a164d4826d",
"score": "0.5908641",
"text": "def create\n @dino = Dino.new(dino_params)\n\n if @dino.save\n render json: @dino, status: :created, location: @dino\n else\n render json: @dino.errors, status: :unprocessable_entity\n end\n end",
"t... |
97f30c1529432ffb2ff4aa749339e26b | Filters the given annotation information +operations+ is a mapping about geometrical constraints that are applied on the filtered annotations. It is a mapping of the form symbol => [min_width, max_hole] Where +min_width+ is the minimum width an annotated segment should have without being removed and +max_hole+ the size... | [
{
"docid": "69a15fa9702c76674e8f9d4b754a28f2",
"score": "0.56214345",
"text": "def cleanup_annotations(symbol, operations)\n ann_idx = find_annotation(symbol)\n for c in corridors\n c.cleanup_annotations(ann_idx, operations)\n end\n end",
"title": ""
}
] | [
{
"docid": "89d7133fe61cd71f19a3a2ec995846a1",
"score": "0.65681976",
"text": "def cleanup_single_annotations(curve, annotations, operations)\n filtered = []\n if annotations.empty?\n return filtered\n end\n\n current = annotations.first\n for an in annotat... |
87c4e8eef01b55a1cf9d5cf0fcbb5152 | Returns an URI containing an unique ID for the given item. This will be used in the Atom feed to uniquely identify articles. These IDs are created using a procedure suggested by Mark Pilgrim in this blog post: | [
{
"docid": "9defae1a76e63a9d72f5b3ed52ae6c57",
"score": "0.58129346",
"text": "def atom_tag_for(item)\n require 'time'\n\n hostname = @site.config[:base_url].sub(/.*:\\/\\/(.+?)\\/?$/, '\\1')\n formatted_date = Time.parse(item[:created_at]).to_iso8601_date\n\n 'tag:' + hostna... | [
{
"docid": "237bace29a43b116b1cdf0360143b01d",
"score": "0.74687356",
"text": "def item_id(item)\n item.identifier.gsub(/^\\/(.+)\\/$/, '\\1').gsub(/[\\/_]+/, '-')\nend",
"title": ""
},
{
"docid": "20f63799666e59c7eb832494481a7348",
"score": "0.73557365",
"text": "def make_id(item)\... |
7b0f0346a98b27db4401afd49581705c | Compare the equality of another ValueChange object. | [
{
"docid": "e4c7cb48211440b9bc2b61160331c22b",
"score": "0.7228932",
"text": "def == other\n return (@value == other.value) &&\n (@transition == other.transition)\n end",
"title": ""
}
] | [
{
"docid": "eab08b2333c1ddc6a49d69b8a5f98652",
"score": "0.81151617",
"text": "def == other\n (self.start_value == other.start_value) &&\n (self.value_changes == other.value_changes)\n end",
"title": ""
},
{
"docid": "ab95a3b50f7f4088d842612ac05f8ceb",
"score": "0.706126",
"te... |
48d94d8b9d43670d879b0b72e44885cb | before_action :admin_customer, only: :destroy | [
{
"docid": "326d410bfbf5ad1d661fceda242bf03a",
"score": "0.0",
"text": "def index\n @customer = Customer.paginate(page: params[:page])\n end",
"title": ""
}
] | [
{
"docid": "f75bf217a34dee424cdfd7d2252ef78f",
"score": "0.7552571",
"text": "def destroy\n @admin_customer.destroy\n respond_to do |format|\n format.html { redirect_to admin_customers_url, notice: \"Customer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n ... |
0c9d011d2b80cc50182b59a975df94d5 | Method to print a list and make it look pretty input: steps: output: | [
{
"docid": "e6d6e267a27a38255cfe17c4edd4e8e9",
"score": "0.0",
"text": "def printlist(newlist)\n arraylist = newlist.to_a\n puts arraylist\nend",
"title": ""
}
] | [
{
"docid": "bd8f318dd0b6ed35421ed47959e73c2e",
"score": "0.7689665",
"text": "def print_pretty(list)\n# steps: print it formatted\n list.each do |food, quantity|\n puts \"You need #{quantity} of #{food}.\"\n end\n# output: printed formatted hash\n\tlist\nend",
"title": ""
},
{
"docid": ... |
761bc9a0098fe1e7e0f26b9abb3dc153 | POST /questions POST /questions.json | [
{
"docid": "3340060a8107e49c47894c4e080cc01c",
"score": "0.0",
"text": "def create\n @question = Question.new(permitted_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.js {}\n... | [
{
"docid": "56850646224a2709f3405ab227e6e9c2",
"score": "0.7311781",
"text": "def create\n \t@question = Question.new(questions_params)\n\n \trespond_to do |format|\n \t\tif @question.save\n \t\t\tformat.html { redirect_to @question, notice: 'question was successfully created.' }\n \t\t\tformat.jso... |
1e0e8a7474657649b08a96ba8815f0dc | DELETE /orders/1 DELETE /orders/1.json | [
{
"docid": "8d7f50a50c09c3a84e0efc7ff3f8a1f4",
"score": "0.7371411",
"text": "def destroy\n order.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "ac23039e82f793639ed84f35b6bfc003",
"score": "0.7592003",
"text": "def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "b8b68786b200bf543cbbdd6c924261b7",
"score": "0.7475092",
"text": "... |
a21c87502059885a4182dfed224c0803 | Update a project column | [
{
"docid": "462c368a2d93f638101ca43d68d21787",
"score": "0.7463315",
"text": "def update_project_column(column_id, name, options = {})\n opts = options.dup\n opts[:name] = name\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n patch \"p... | [
{
"docid": "220ce784d80e9b5a8993fdc4526cb8f5",
"score": "0.8256772",
"text": "def update_project_column(id, name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "235927b5242ce7a7e02bdf1be16cd201",
"score": "0.77736205",
"text": "def update_project_column(id, name, options ... |
50bbaea9040822365ba83de639e93d69 | returns max population occurrence | [
{
"docid": "18d1d1b175d04f8e2f352e37e86c6293",
"score": "0.80722946",
"text": "def max_population\n @store[:population].max\n end",
"title": ""
}
] | [
{
"docid": "a5e1b5f90b576948b3fe1a3892ccddb1",
"score": "0.6828066",
"text": "def biggest_population_city\n\n max_population = -1\n max_city = \"\"\n\n @query.get_graph.each_key do |city|\n population = get_city_info(city,\"population\")\n if population > max_population\n max_p... |
f46f3816e0b084d6ed3ca87bc1c5c7f2 | GET /audits/1 GET /audits/1.json | [
{
"docid": "fe7f3ed5045eabf4aac246814696bf6a",
"score": "0.6431062",
"text": "def show\n @audit = Audit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @audit }\n end\n end",
"title": ""
}
] | [
{
"docid": "d6ae486045294955bcc4fa6a33808bca",
"score": "0.69209284",
"text": "def index\n @audits = Audit.all\n end",
"title": ""
},
{
"docid": "61921291936da07140893347ab3f2179",
"score": "0.6843741",
"text": "def show\n audits = @client.audits + @client.associated_audits\n ... |
1ff23db9b11ffe8b1797bb6672eabcad | facilitator has approved the credit for transmittal to the district. move the credit course names over and record who approved the credit for transmittal to district | [
{
"docid": "c6f8157992e50cf8610d895fb1f96a83",
"score": "0.6365312",
"text": "def district_approve(user, date)\n\t raise \"Can't approve this, as it has already been approved for recording at the district\" if self.credit_transmittal_batch_id\n\t \n\t self.district_finalize_approved = true\n self.... | [
{
"docid": "64baf79a7a55dadc45c9ba5c06fd1d31",
"score": "0.59427583",
"text": "def claim\n @student.index.claim_accommodation_scholarship!\n @school_year = TermsCalculator.current_school_year\n end",
"title": ""
},
{
"docid": "70c73409c26322528e7c3c83abd2097a",
"score": "0.582156"... |
83fb675bbc28c3135f73a95f58d4bf63 | GET /newslists GET /newslists.json | [
{
"docid": "20680f0c82130a4ec4fa683a180c4cf5",
"score": "0.66338205",
"text": "def index\n # 应用了分页插件\n @newslists = Newslist.order('id').page(params[:page]).per(20)\n end",
"title": ""
}
] | [
{
"docid": "c2c6c7fb0c49180e9474b8eff2409fd5",
"score": "0.79604465",
"text": "def lists\n\tget('/lists.json')\nend",
"title": ""
},
{
"docid": "ab52997c576fb1d43810e3dfb747dd82",
"score": "0.76184195",
"text": "def cmdWorldNewsGetList\n params = {\n \"world_news_get_... |
3f375a16042a34ca78947cb08c84f7f0 | An array for optional fields | [
{
"docid": "f7c7ef0f25aeee5629287d7ffb13450f",
"score": "0.0",
"text": "def optionals\r\n %w[\r\n callback_url\r\n callback_method\r\n username\r\n password\r\n tag\r\n callback_timeout\r\n detect_language\r\n ]\r\n end",
"title": ""
}
... | [
{
"docid": "f317b91bf3f99ed9e90475433de4215e",
"score": "0.78333855",
"text": "def optional\n Array(@profile[:optional]).each do |field|\n @optional_fields << field unless @optional_fields.include?(field)\n end\n @optional_fields\n end",
"title": ""
},
{
"docid": "5c... |
e5f842d7b27d23307941bbf09ff14e6d | DELETE /releases/1 DELETE /releases/1.json | [
{
"docid": "eaa0f4e2304ed14085d22b2bfe35ebd7",
"score": "0.7009856",
"text": "def destroy\n @release.destroy\n respond_to do |format|\n format.html { redirect_to releases_url, notice: 'Release was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title"... | [
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.7568845",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "80a7dc7a82faa7e033c8ece4ec1561b5",
"score": "0.7360299",
"text": "def destro... |
45448047a18a097fdc361cc8fe82e3ba | In ms (milliseconds), defaults to 5 seconds | [
{
"docid": "a35569d8d7a084105388c648236f2718",
"score": "0.0",
"text": "def timeout\n @timeout || Elected.timeout\n end",
"title": ""
}
] | [
{
"docid": "9ec6963d48aa8ef376e9da4a808e940c",
"score": "0.76891154",
"text": "def in_milliseconds; end",
"title": ""
},
{
"docid": "5710a4f7737bdd05fcd7c0bc0c6b0f82",
"score": "0.75291103",
"text": "def milliseconds(); end",
"title": ""
},
{
"docid": "be317e55386b8264864... |
ef54ed7145d9e6bcc08988d7d095c50e | GET /miniatures/new GET /miniatures/new.xml | [
{
"docid": "01388919c10c53db4fc2049041f9f310",
"score": "0.74726665",
"text": "def new\n @miniature = Miniature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @miniature }\n end\n end",
"title": ""
}
] | [
{
"docid": "31a6331e36350defb415f6a71f9493d3",
"score": "0.73438644",
"text": "def new\n @mini = Mini.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mini }\n end\n end",
"title": ""
},
{
"docid": "0a1f9b2e864376deee285cbf191732... |
e0453aa916453c846aca86af01b2e3d0 | GET /players GET /players.json | [
{
"docid": "9fe14b1e56bba19c0b972a11dec8fb58",
"score": "0.0",
"text": "def index\n if current_user.present?\n @players = Player.where(:user_id => current_user.id)\n else\n @players = Player.all\n end\n end",
"title": ""
}
] | [
{
"docid": "4c832775b9124dbf3a6c1e7a3aa47090",
"score": "0.7901851",
"text": "def players\n @players = Game.find_by_id(params[:id]).players\n render template: \"players/players.json.jbuilder\"\n end",
"title": ""
},
{
"docid": "9931baedd241ed6b41432c2c2ca95b4a",
"score": "0.788544... |
2be14bacdca530360e1f0fab5121a25d | Translates the +subject+ using Rails I18n class under [mailer_scope, action_name] scope. If it does not find a translation for the +subject+ under the specified scope it will default to a humanized version of the action_name. If the subject has interpolations, you can pass them through the +interpolations+ parameter. s... | [
{
"docid": "788a3847a4daf215ea23260ceb1ba9cf",
"score": "0.582178",
"text": "def default_i18n_subject(interpolations = T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "dc7d12811f6d234ea98ad06ca7ef51d8",
"score": "0.8200177",
"text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.hu... |
68fa4344978ca972a655582dc877d10b | Count the number of nodes edited by experienced mappers (those who had accounts before the aw) | [
{
"docid": "d83daa17bef248da40807f08d130a2cd",
"score": "0.8474294",
"text": "def number_of_nodes_edited_by_experienced_mappers\n nodes_by_experienced_mappers = Node_Query.new(analysis_window: aw, constraints: {'user' => {'$in' => aw.experienced_contributors}}).run\n {'Nodes Edited by Experien... | [
{
"docid": "24b3926ab8a86f57da2e78b28a595581",
"score": "0.8372792",
"text": "def number_of_nodes_edited_by_new_mappers\n \t\tnodes_by_new_mappers = Node_Query.new(analysis_window: aw, constraints: {'user' => {'$in' => aw.new_contributors}}).run\n {'Nodes Edited by New Mappers' => nodes_by_new_map... |
1f16f0e67c6511d8cd3fda7ecf2604cf | def on_ground? AgentModel.getInstance.position.getZ < 0.5 end | [
{
"docid": "02b40af0f427d8ad0cc0acb19cb21745",
"score": "0.5937327",
"text": "def back? target_position\n Angles.angle_diff(target_position.phi, Math::PI) < Math::PI / 6.0\n end",
"title": ""
}
] | [
{
"docid": "74d4cb1ff73d5106ac2a1b8d1c55af75",
"score": "0.80739707",
"text": "def above_ground?\n\t\tbody.position.y > 0\n\tend",
"title": ""
},
{
"docid": "0a8716c459f7722db8c19ac11e19fb8b",
"score": "0.7765924",
"text": "def on_ground\n\treturn @y==410\nend",
"title": ""
},
... |
7a9cde8787b84ead101e4764f777d201 | return true if empty attr field causes save to fail (desired result) | [
{
"docid": "267c96f39a342c9ed152039ee78f3799",
"score": "0.66355616",
"text": "def assert_reject_empty(obj, attr)\n eval(\"obj.%s = nil\" % attr)\n assert !obj.save\n end",
"title": ""
}
] | [
{
"docid": "dff79bd44a6489c095afb84f60a43997",
"score": "0.7373244",
"text": "def allow_blank?\n @existing.update_attribute(@attribute, '')\n super\n end",
"title": ""
},
{
"docid": "d544b5b55b97c5f61cf867bd7a9866f7",
"score": "0.7333294",
"text": "def allow_... |