query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "c6feeff0ca5c2ae0aecd62e35c1653a1", "score": "0.0", "text": "def update!(**args)\n @access_token = args[:access_token] if args.key?(:access_token)\n @public_key = args[:public_key] if args.key?(:public_key)\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...
8042a8d3e8176407c91f7e9c3a996d33
Rolf makes changes to vote and reasons of his naming. Shouldn't matter whether Mary has voted on it.
[ { "docid": "5256c4ae8c53d943fe03a0bbc3ce3d97", "score": "0.57251704", "text": "def test_edit_naming_thats_being_used_just_change_reasons\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n o_count = Obse...
[ { "docid": "6ead105a9b7fb1ff778a90e225fca310", "score": "0.6218693", "text": "def test_cast_vote_mary\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login(\"dick\")\n obs.change_vote(na...
15115376944169413eff13981ba8c6ed
o(n) need to refactor
[ { "docid": "0888fce52b5ca5fc097fe3000ce2611b", "score": "0.0", "text": "def symbol_frequency\n freq = Hash.new(0)\n @text.scan(/[^a-zA-Z0-9]/).each { |word| freq[word] += 1 }\n freq\n end", "title": "" } ]
[ { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5891063", "text": "def anchored; end", "title": "" }, { "docid": "b18c5ab6d5ecfa89758fb54cda0355f8", "score": "0.5761107", "text": "def oids; end", "title": "" }, { "docid": "b18c5ab6d5ecfa89758fb54cda0355f8", ...
346caeb27aad54075a30d575a38dd540
GET /responses/1 GET /responses/1.json
[ { "docid": "6e6ce8383eb60d95077157717bf0ccbc", "score": "0.6745719", "text": "def show\n @responses = Response.find(params[:id])\n respond_with @response\n end", "title": "" } ]
[ { "docid": "8133969096a3630059fa46752740d5ff", "score": "0.7103356", "text": "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end", "title": "" }, { "docid": "b8e0862accab7b89d3ab1dd6752fbc12", "score": "0.68198735", "text": "de...
a6016e445d94c792674fa4dff17a40a7
GET /sim_scripts GET /sim_scripts.xml
[ { "docid": "14dd88869f488f598a3f1e540d12ae5a", "score": "0.75351536", "text": "def index\n @sim_scripts = @user.sim_scripts\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sim_scripts }\n end\n end", "title": "" } ]
[ { "docid": "92925c43138c303011bf5e57a852c089", "score": "0.67306197", "text": "def show\n @sim_script = SimScript.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sim_script }\n end\n end", "title": "" }, { "docid"...
2f788dd89e0709374528811394c7df8e
To benefits from the Enumerable mixins the class must provide a method `each' yielding successive members of the collection.
[ { "docid": "c8464a751f0e48030f88622850984aa9", "score": "0.0", "text": "def each\n @csv_contents.each do |line|\n yield CsvRow.new(@headers, line)\n end\n end", "title": "" } ]
[ { "docid": "9da63f5ed0f25a6f26e41f24f8bc158e", "score": "0.777453", "text": "def each\n @collection.each { |c| yield c }\n end", "title": "" }, { "docid": "3499ca27ca0e337b329ae8f1be75ad6e", "score": "0.7480144", "text": "def each()\n self.to_a.each { |elt| yield el...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "95a6b434736c7dff93c8cbc409c56697", "score": "0.0", "text": "def new_input_set()\n return CouponGroupDataInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6740627", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.6579906", "text": "def new_input_set()\n return Run...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "611dcba7438508055263a8e7855faab5", "score": "0.0", "text": "def huangli_params\n params.require(:huangli).permit(:year, :month, :day, :yangli, :nongli, :star, :taishen, :wuxing, :chong, :sha, :shengxiao, :jiri, :zhiri, :xiongshen, :jishenyiqu, :caishen, :xishen, :fushen, :suici, :yi, :j...
[ { "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"...
43850cd3eb5eaeedd0244919cd4ab615
Terminate the current session
[ { "docid": "1b2caa578254c9e4d046e89d417af6e7", "score": "0.0", "text": "def logout(scopes=nil)\n scopes ? warden.logout(scopes) : warden.logout(warden.config.default_scope)\n end", "title": "" } ]
[ { "docid": "1ebb3b90be57edb18b094b2f0e7e7c73", "score": "0.7747254", "text": "def kill_session\n @authenticator.kill_session\n @session = ''\n end", "title": "" }, { "docid": "0238541c08e06e22ec7a44f65d90d315", "score": "0.7514328", "text": "def end_sessi...
07f92dc7d1a3c600b6eb6d05e431847f
Create a new route on the map. Requires a name (need not be unique), a primary category, route_vertexes, and a source_data_set_id.
[ { "docid": "da2eec86d7bffb86a95a949013b65ef0", "score": "0.7654434", "text": "def create_route(attributes)\n \n unless attributes[:source_data_set_id]\n attributes[:source_data_set_id] = attributes[:source_data_set] && attributes[:source_data_set].id || nil\n end\n ...
[ { "docid": "2c2ce75cd26acd10c4f04420daea0e74", "score": "0.68990946", "text": "def create\n Route.create!(\n data_source: params[:source],\n start_node: params[:start_node],\n end_node: params[:end_node],\n start_time: params[:start_time],\n end_time: params[:end_time]\n )...
edb175d3589f047c808908932bcc344a
Loop through each line of the instructions and call the relevant method
[ { "docid": "7ce29dcc835076aafcd351f6434a3e89", "score": "0.59917635", "text": "def read_instruction(line)\n line_arr = line.split(/[\\s\\[\\]=]/).reject(&:empty?)\n instruction = line_arr.first\n change_mask(line_arr.last) if instruction == \"mask\"\n update_memory_hash(line_arr[1].to_i, line_arr[2]...
[ { "docid": "b19b38eafdf49b0e458a656a22f790dd", "score": "0.73680085", "text": "def process_instructions\n instructions.each do |instruction|\n handle_instruction(instruction)\n end\n end", "title": "" }, { "docid": "3c9f974cdb02b9412913c6952e5bff27", "score": "0.6460983", ...
28b4fc32c1adf1942d60338c5f420003
Execute a SPARQL query
[ { "docid": "4125f1b97213df867553e158d015620a", "score": "0.650749", "text": "def query(sparql, opts = {})\n res = execute_request(\n :get,\n '/query',\n params: opts.slice(:baseURI, :offset, :limit).merge(query: sparql),\n headers: request_headers(opts)\n ).body\n\...
[ { "docid": "c2202f6abaa08c0140a28f1fc2eb7279", "score": "0.8190537", "text": "def execute_query(sparql_query)\n puts \"Executing SPARQL Query: #{sparql_query} ...\"\n \n if sparql_query.include? \"DESCRIBE\"\n response = @repository.query(sparql_query, :result_type => RubySesame::D...
a5718114128a66327ae6abfead0924bd
Returns the value of attribute old_value. source://seleniumwebdriver//lib/selenium/webdriver/devtools/mutation_event.rb24
[ { "docid": "1938bc93851f82a7ed4a880487cda9dc", "score": "0.6999057", "text": "def old_value; end", "title": "" } ]
[ { "docid": "838a1b6d0c9442af39153aedea807202", "score": "0.6139836", "text": "def attribute_was(attr_name) # :nodoc:\n mutations_from_database.original_value(attr_name.to_s)\n end", "title": "" }, { "docid": "e1cb43866df336543913ac6e9de381d4", "score": "0.6057763", "text"...
f73bbf99e2005a2e5e4197df8265b231
PUT /collections/1 PUT /collections/1.xml
[ { "docid": "23bdeeb210f469aa356c8df18d0f4d0e", "score": "0.6720814", "text": "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n flash[:notice] = 'Collection was successfully updated.'\n fo...
[ { "docid": "c41189f509a778f2d8b68343a30f6f1f", "score": "0.6481878", "text": "def update\n @collection = Collection.find(params[:id])\n\n respond_to do |format|\n if @collection.update_attributes(params[:collection])\n save_activity(@collection, \"updated collection\")\n \n ...
beb8839bf1380a5cb648712456171af6
=============================== RUN PALLETIZING CRITERIA CODE ==============================
[ { "docid": "de00c62a2d0238b9ee31f1dd63e3b584", "score": "0.0", "text": "def build_palletizing_criterium_form(run_palletizing_criterium,action = nil,caption = nil,is_edit = nil,is_create_retry = nil,is_view = nil)\n\n\n #---------------------------------------------------------------------------------...
[ { "docid": "325a7826b75f433127619561da3c1deb", "score": "0.64418477", "text": "def run_all()\n end", "title": "" }, { "docid": "481d6a09df98f124f8dfd3d151336439", "score": "0.6267524", "text": "def run_all\n end", "title": "" }, { "docid": "481d6a09df98f124f8dfd3d15...
6dbd07e22b34914618559c05a0876996
Finds whether track lays in a hex are blocked by a private company. Some hexes are blocked by two private companies. In this case either one can lay track in the hex.
[ { "docid": "6af05e353e56aba604ed94c946348382", "score": "0.58638716", "text": "def ability_blocking_hex(operator, hex)\n return false unless hex.tile.color == :white # Upgrades are never blocked.\n\n privates = (@game.companies + @game.minors).reject(&:closed?)\n blockin...
[ { "docid": "a690edfbde3095fe14cc18022ff6cfea", "score": "0.60607725", "text": "def corporation_private_connected?(corporation, minor)\n return false if corporation.closed?\n return false unless corporation.floated?\n\n @graph_broad.reachable_hexes(corporation).any? { |hex, _| ...
605a3d2031bf744b131ca0ce5737443c
Returns an array of errors if available.
[ { "docid": "9141c36ab4012a890493013f67010be4", "score": "0.71680737", "text": "def errors\n # JSON API errors\n if self.error? && self.json_api? && self.parsed_body.has_key?('errors')\n response_errors = self.parsed_body['errors']\n translated_errors = {}\n\n res...
[ { "docid": "c02c617cc06c9f2401e2caeaeac529cb", "score": "0.8568744", "text": "def errors\n return @errors || []\n end", "title": "" }, { "docid": "57ac00a5ce8fa481d389e42018398d77", "score": "0.84534353", "text": "def errors\n @errors || []\n end", "title": ""...
72178ce3780796848261b021eb6f6966
ECMA262 3rd 11.4.9 Logical NOT Operator
[ { "docid": "a738078da5f63d8fbcb4fba09ac15f2e", "score": "0.0", "text": "def log_not()\n if self.to_boolean().value\n JSValue::FALSE\n else\n JSValue::TRUE\n end\n end", "title": "" } ]
[ { "docid": "17928b94f847f94e6c010e7b707e410f", "score": "0.7868", "text": "def _not # not value -> (result)\r\n val = @operands[0]\r\n var = read_byte\r\n store var, ~val\r\n end", "title": "" }, { "docid": "35a52f659cb0d79d063249c23d04eb0b", "score": "0.76526946", "text": ...
b534d12488a6bd98f529f15ce035d69c
DELETE /broadcaster/avatars/1 DELETE /broadcaster/avatars/1.json
[ { "docid": "f44efbd3282bfd807e52036e94095206", "score": "0.7879134", "text": "def destroy\n @broadcaster_avatar.destroy\n respond_to do |format|\n format.html { redirect_to broadcaster_avatars_url, notice: 'Avatar was successfully destroyed.' }\n format.json { head :no_content }\n end...
[ { "docid": "c50d150736a61a3ac9a152a29f90ac75", "score": "0.7272288", "text": "def delete_avatar\n update_webhook(avatar: nil)\n end", "title": "" }, { "docid": "c50d150736a61a3ac9a152a29f90ac75", "score": "0.7272288", "text": "def delete_avatar\n update_webhook(avatar: n...
dcf4fe9c2bdba15b298e2b6b7871502b
PATCH/PUT /document_groups/1 PATCH/PUT /document_groups/1.json
[ { "docid": "45861322bb86a268200fd0d840463676", "score": "0.7000552", "text": "def update\n respond_to do |format|\n if @document_group.update(document_group_params)\n format.html { redirect_to document_group_page_path(@document_group.name.tr(' ', '+')), notice: updated_message(@@object_ty...
[ { "docid": "ba5c0dfb2c0031a3b36c01a2d916f652", "score": "0.705366", "text": "def update\n @group = Group.find(params[:id])\n\n #Uploaded documents are not attributes of user and aren't updated as such\n if params[:group][:document]\n Document.upload_doc(params[:group][:document], @group)\n...
0f137120a03aa7cc9607f9d1c132b06e
Internal: The session id, which can be obtained by calling Metaforce.login or through OAuth.
[ { "docid": "269e6792836995deb26c22907489c4d3", "score": "0.7938384", "text": "def session_id\n @options[:session_id]\n end", "title": "" } ]
[ { "docid": "8e0f84fb9a2eaa2665141056381cea35", "score": "0.8253183", "text": "def session_id\n @server_session.session_id if @server_session\n end", "title": "" }, { "docid": "68f6a3c4794e6b0d748c2498cb399fde", "score": "0.8195484", "text": "def session_id\n ...
68abc7fe591cdb018b5ba16a437e3ebc
Invoke all of the project's pipelines, detecting any changes to the Assetfile and rebuilding the pipelines if necessary.
[ { "docid": "36c18c213f3b63dacfe3f72bfb076ffa", "score": "0.66512465", "text": "def invoke\n @invoke_mutex.synchronize do\n last_manifest.read_manifest\n\n if dirty?\n rebuild_from_assetfile(assetfile_path) if assetfile_dirty?\n\n # The temporary files have ...
[ { "docid": "0b40b832320f5bbef728311fc024f4ae", "score": "0.6782914", "text": "def precompile_assets\n # Currently this will always run so the resource will always update :-/\n # Better fix would be to shell_out! and parse the output?\n ruby_execute 'rake assets:precompile' do\...
713d409bc4d26a64dbd845c18ceda210
Creates a strong parameter hash for mass assignment
[ { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.5704432", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" } ]
[ { "docid": "72032eb14c7841a5e425ed3a79059576", "score": "0.6811449", "text": "def strong_parameters\n\t\t\tattrs = self.attribute_names - [\"created_at\", \"updated_at\", \"id\"]\n\t\t\tattrs.push(:_color) if colored? # add the color attribute to the permitted attributes if the object is colorable\n\t\t...
8ff7c504dc551e36d28c8d52f3ad3bef
Move the specified number of degrees, for the specified number of steps
[ { "docid": "e5ffbb5629ad2c29b5fd54211e98cdc9", "score": "0.0", "text": "def rotate_hue(degrees=180, steps=1)\n c = self.class.name.downcase\n hsv = self.to_hsv\n v = []\n (1..steps).each do |i|\n v << HSV.new((hsv.h + (degrees * i) + 360 * i) % 360, hsv.s, hsv.v).s...
[ { "docid": "6c3b9e84810abde2475c38c9ac505e4b", "score": "0.7216613", "text": "def move(steps)\n pos = 0.to_c\n dir = 1.to_c\n steps.each do |t, d|\n case t\n when \"N\"\n pos += N*d\n when \"S\"\n pos += S*d\n when \"E\"\n pos += E*d\n when \"W\"\n pos += W*d\n w...
fba4d4dbaf1f437db35343dc6fc0edc3
GET /create_resumes/1 GET /create_resumes/1.json
[ { "docid": "e935e08f16d31786a3bae18f5b6effac", "score": "0.7000197", "text": "def show\n @create_resume = CreateResume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @create_resume }\n end\n end", "title": "" } ]
[ { "docid": "a7bfc0490f59fab4385e2c29b69800c0", "score": "0.7745734", "text": "def create\n @resume = current_user.resumes.new(params[:resume])\n\n respond_to do |format|\n if @resume.save\n format.html { redirect_to @resume, notice: 'Resume was successfully created.' }\n format....
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0715dd10f1e1534c6236bf5996964bef", "score": "0.0", "text": "def material_params\n params.require(:material).permit(:title, :description, :created_at, :updated_at, :updated_by, :public_level, :level_id, :subject_id, questions_attributes: [:id, :content, :_destroy, alternatives_attributes...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
d0f070027f10d712ef2c977cfc545587
public: Creates a new worker The worker continuously takes messages off the queue and makes requests to the salesmachine.io api queue Queue synchronized between client and worker api_key String of the application's Api key options Hash of worker options batch_size Fixnum of how many items to send in a batch on_error Pr...
[ { "docid": "0a730519d6b840d1236a6ea822e87541", "score": "0.6660365", "text": "def initialize(queue, api_key, options = {})\n symbolize_keys! options\n @queue = queue\n @api_key = api_key\n @batch_size = options[:batch_size] || Queue::BATCH_SIZE\n @on_error = options[:o...
[ { "docid": "a52b5cb9223fefda153a2117d6273038", "score": "0.6916312", "text": "def create_worker(id)\n worker = ApiQueue::Worker.new(id: id, supervisor: self)\n @workers << worker\n worker\n end", "title": "" }, { "docid": "841ba3caaa12a36663ae4f252cd9c5fd", "score": "0....
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f9552de535b479e805a7724745c66202", "score": "0.0", "text": "def set_conversation\n @conversation = Conversation.friendly.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
1672b91e1890afc5283d32abdca8112d
POST /admin/format_deliveries POST /admin/format_deliveries.json
[ { "docid": "5ba1b45f54e7ee34284de93162461097", "score": "0.6523164", "text": "def create\n @format_delivery = FormatDelivery.new(format_delivery_params)\n\n respond_to do |format|\n if @format_delivery.save\n format.html { redirect_to admin_format_deliveries_path, notice: 'Le format de...
[ { "docid": "148c0783dc780c622d50c755f5e612ae", "score": "0.6395014", "text": "def index\n @format_deliveries = FormatDelivery.all\n end", "title": "" }, { "docid": "fcc12f015446737283b37b74c52ed817", "score": "0.62299126", "text": "def index\n @format_deliveries = FormatDelive...
ba5e4f2adf4077ca186095fc6bc85dd5
PATCH/PUT /base_property_types/1 PATCH/PUT /base_property_types/1.json
[ { "docid": "c592cd3d0564f3be407fd4c05ad0c50f", "score": "0.7573044", "text": "def update\n respond_to do |format|\n if @property_type.update(base_property_type_params)\n format.html { redirect_to base_property_types_url, notice: 'Base property type was successfully updated.' }\n fo...
[ { "docid": "c57e2916f6295eaff96523e5d5147a2e", "score": "0.6516229", "text": "def update\n respond_to do |format|\n if @property_property_type.update(property_property_type_params)\n format.html { redirect_to @property_property_type, notice: 'Property property type was successfully update...
abe8ad714aa71f34a6e8447dd2981d2c
Navigates into the board
[ { "docid": "0a9964edddcff05f8fd63a35323f6712", "score": "0.0", "text": "def navigate_into\n title_element.when_present.click\n end", "title": "" } ]
[ { "docid": "0559de063526f69010574a640bb2b0a2", "score": "0.67740536", "text": "def go_to_next_row()\n turn_left()\n move()\n turn_left()\n end", "title": "" }, { "docid": "6e062084fae3e6bf8c56b2c4bac8b431", "score": "0.6638905", "text": "def play_move(from,...
3ec7bf6d774291bd3d295c26c89b6742
Convert an array of numeric bytes to a hex string (eg [0x90, 0x40, 0x40] > "904040")
[ { "docid": "040204cb44d1acd2101183522fca2f24", "score": "0.79416686", "text": "def numeric_bytes_to_hex_string(bytes)\r\n string_bytes = bytes.map do |byte|\r\n string = byte.to_s(16).upcase\r\n string = \"0#{string}\" if byte < 0x10\r\n string\r\n end\r\n string_byte...
[ { "docid": "ccf26b0b432ea036d460a01e099a78c4", "score": "0.7762372", "text": "def to_hex_s\n TypeConversion.numeric_byte_array_to_hex_string(to_a)\n end", "title": "" }, { "docid": "34b1d81f9054caf9453a8e935f86997f", "score": "0.7691417", "text": "def to_hex(bytes)\n byt...
ea6822df7bb109c2b176e6addea74b1a
POST /hotels POST /hotels.json
[ { "docid": "0d3a31be0243e4a2761211db17d51bf7", "score": "0.5626217", "text": "def create\n\n @hotel.user_id = current_user.id\n\n if @hotel.save\n\n redirect_to new_hotel_location_path(@hotel.id)\n\n else\n respond_to do |format|\n format.html { redirect_to @hotel, noti...
[ { "docid": "2a8664ec76c7d141760ed2531aff89ac", "score": "0.6984998", "text": "def create\n @hotel = Hotel.new(params[:hotel])\n\n if @hotel.save\n render json: @hotel, status: :created, location: @hotel\n else\n render json: @hotel.errors, status: :unprocessable_entity\n end\n end...
7c3659ec684235d2dbb8f77ebcee1cd5
Gibt den Wert wahr wieder falls es sich um eine nicht leere Bilddatei handelt.
[ { "docid": "08eb547f7502883e41cfa5cc60853308", "score": "0.0", "text": "def valid_file?\n\t\tunless @image.content_type =~ /^image/\n\t\t\terrors.add(:base, \"Die Datei ist kein Bild\")\n\t\t\treturn false\n\t\tend\n\t\tif @image.size > 2.megabyte\n\t\t\terrors.add(:image, \"muss kleiner als 2MB sein.\"...
[ { "docid": "dc64ee59d540d3e6e6588bf3b2e75e43", "score": "0.6769011", "text": "def zeichnen()\n if sichtbar?() \n Leinwand.gib_einzige_instanz().zeichne_kreis(self)\n end\n end", "title": "" }, { "docid": "ccf2375ad20c7dc89eee33e7fbebc68e", "score": "0.6733033", "text": "d...
2aae4c8fecfc5446cc7e4be6d822e05e
write a function that accepts two parameters: title and rating the method should print the story title and the rating out of ten show the user a message that says "Welcome to Movie Rating" show the user a message asking them for the title of a movie store the input in a variable show the user a message asking for their...
[ { "docid": "b16e071666881cde941908eb17297128", "score": "0.5878244", "text": "def display_story(string1, string2)\n\treturn \"#{string1} #{string2}\"\nend", "title": "" } ]
[ { "docid": "39399e97d99aaa848a26648cc4977055", "score": "0.8498289", "text": "def display_story(title, rating)\n puts \"Your show title is #{title} and it is rated #{rating} out of ten\"\nend", "title": "" }, { "docid": "ccb750e9fbf91d9b87619f153d9cc445", "score": "0.84680754", "tex...
09fc29c9ddf0cf2ca2790abec3e0d797
Utility function to quickly convert a search result into an array of hashes (keyed by the attribute name) for easier processing this is not done by default on all searches as this can cause a large overhead on big data returns.
[ { "docid": "e85035e0d59e5386c8fa78044019efbb", "score": "0.700636", "text": "def conv_results_to_a_of_h( search_results )\n result_objects = []\n\n search_results[:data].each do |row|\n tmp = {}\n row.each_index do |index|\n tmp[ search_results[:headers][index]...
[ { "docid": "0f5c3435cc13b26e921eb451ef3d23d8", "score": "0.629955", "text": "def results_as_hash; end", "title": "" }, { "docid": "6e60a646a38f001f52e03eace814e5e5", "score": "0.6244771", "text": "def to_search_h\n self.class.attribute_names.reduce({}) do |acc, key|\n val...
338118e87d8819799fe434eca1f84f29
GET /quote_addresses/1 GET /quote_addresses/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "790ff05c8abb69832d2ab515c772cc00", "score": "0.7479519", "text": "def index\n @quote_addresses = QuoteAddress.all\n end", "title": "" }, { "docid": "0b186cb6c7c89b57f60a8b93d31e187b", "score": "0.6672371", "text": "def set_quote_address\n @quote_address = QuoteAd...
833683cd1d7fc824c7a45453a9879cd8
base spree product this method is called for every row, so for master products and variants
[ { "docid": "951e657a18726da047b13b1e4651a9fe", "score": "0.6840587", "text": "def add_product\n # unique by name. don't create if product exists\n # strangley spree is not povideing any uid in products table.\n # I am using name for now, if that will not work I modify schema and add uid t...
[ { "docid": "106bb6f4cbb947309fa7c75d63a4a4f1", "score": "0.7191959", "text": "def update_master_variant()\n @new_product_variant = Spree::Variant.where(\"product_id=?\", @new_product.id).first\n @new_product_variant.update_column(\"sku\", @product_row[:name])\n @new_product_variant.update...
860261a09a7e2c41b9a62d84d5ce263a
Generate page data for an specific archive from the given batch_id. If only pages for specific work are requested, tgt_work_id will be nonnil. The uri_block is a block that determines URI for the work, and fileame for the pagelevel RDF file for that work
[ { "docid": "add0179774fb82bfccc34bda5a9e7823", "score": "0.69199467", "text": "def generate_pages(archive, batch_id, tgt_work_id, skip, &uri_block)\n\n # Templae for page RDF header.\n hdr =\n\"<rdf:RDF xmlns:rdfs=\\\"http://www.w3.org/2000/01/rdf-schema#\\\"\n xmlns:rdf=\\\"http://www...
[ { "docid": "42b3a4a9f05aa9f45f589774a2030211", "score": "0.49144402", "text": "def download_batch(companyId, batchId, id) path = \"/api/v2/companies/#{companyId}/batches/#{batchId}/files/#{id}/attachment\"\n get(path, {}, AvaTax::VERSION) end", "title": "" }, { "docid": "4...
66ce15b75839146c536d90b82d043044
Provides the results for Soccer tournaments
[ { "docid": "75248ec9b671f6c87ff3d53fe66c92ae", "score": "0.65125686", "text": "def tournament_results(tournament_id)\n get_data(\"/tournaments/#{tournament_id}/results\")\n end", "title": "" } ]
[ { "docid": "757dc24cf2fba53326857e01d34438df", "score": "0.7212672", "text": "def tournaments\n response = get request_url('tournaments')\n if response.success?\n Sportradar::Api::SoccerV3::Tournaments.new indifferent_access(response)\n else\n response\n end...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c132f1e72de07d83fb3c9b7ceeffa384", "score": "0.0", "text": "def built_year_params\n params.require(:built_year).permit(:year, :gearbox, :engine_displacement)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69802505", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781974", "text": "def strong_params\n params.requ...
09e1274a7b298550d9ab905313d54257
Check limits new_plan_id Integer Return boolean
[ { "docid": "3f3aeaeed50dd9d6f178a7c4beba40a0", "score": "0.85401297", "text": "def check_limits new_plan_id\n retVal = true\n\n #KBBTODO #100\n unless reach_plan_user_limit? new_plan_id\n @response[:success] = false\n add_notice('error', I18n.t('notice.subscriptions.too_many_active_us...
[ { "docid": "cb9d75ac177eb831deb39235ed75d810", "score": "0.7536438", "text": "def reach_plan_user_limit? plan_id\n Plan.find(plan_id).user_limit >= @current_tenant.users.enable.all.count\n end", "title": "" }, { "docid": "626b0820e6100973f00ba1a618865282", "score": "0.75232834", ...
f7c3f07e71205ea9de4cb5510397ec7c
creates a link to an employee detail page
[ { "docid": "1c7d62680001e307d451f5519cfc1b8e", "score": "0.6994043", "text": "def employee_link_short(employee_object)\n link_to(employee_object.first_name + ' ' + employee_object.last_name, employee_path(employee_object))\n end", "title": "" } ]
[ { "docid": "7a055c3dfbb639081db9d081001a536a", "score": "0.64251393", "text": "def display_resource(employee)\n \"#{employee.full_name} (#{employee.id})\"\n end", "title": "" }, { "docid": "fa149fdd7743707c510dccd9707dd97b", "score": "0.6311921", "text": "def link\n #todo: all...
10e6f53105f0c047b34d6f2f202431be
Additional Solution Added 02/26/2021
[ { "docid": "5c487ac5307878a95466c76424be39df", "score": "0.0", "text": "def time_of_day(int)\n num = int.divmod(1440)[1]\n h = num / 60\n m = num % 60 \n hh = h < 10 ? \"0#{h}\" : h\n mm = m < 10 ? \"0#{m}\" : m \n \"#{hh}:#{mm}\"\nend", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58706576", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58706576", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3...
366d5ac011a321f429b0d25d71ba3af1
Public: Add or update username / realm entry with the new password. This will add a new entry if the username / realm combination does not exist in the file. If the entry does exist in the file, then the password of the entry is updated to the new password. The file is not written to disk until save! is called. usernam...
[ { "docid": "bfa3e00b4c53ba97cf0eecf85ef85646", "score": "0.73694074", "text": "def add_or_update(username, realm, password)\n if has_entry?(username, realm) then\n update(username, realm, password)\n else\n add(username, realm, password)\n end\n end", "title": "" } ...
[ { "docid": "b99aa2ef4886d69f8d8914db117ed563", "score": "0.7639707", "text": "def add(username, realm, password)\n raise DigestFileError, \"Unable to add already existing user #{username} in realm #{realm}\" if has_entry?(username, realm)\n\n new_entry = DigestEntry.new(username, realm, passwo...
9cd078cc652c12556af23b7312540d0d
Check if current user can delete a solution
[ { "docid": "c57eda654125a1a589040816c856b119", "score": "0.8403802", "text": "def can_delete_solution\n unless @contestproblem.in_progress? && !@contestsolution.official && @contestsolution.user == current_user.sk && !current_user.other\n flash[:danger] = \"Vous ne pouvez pas supprimer cette sol...
[ { "docid": "76487acadf21726f910004f362cab583", "score": "0.7695996", "text": "def user_can_delete?\n false\n end", "title": "" }, { "docid": "ce80700a584eff2a9f6cd8ea42013bd8", "score": "0.76338047", "text": "def can_delete?(user)\n self.user_id == user.id || user.admin?\n...
128b501586ba69da559e05cd9026ea15
Process all the pending nested attributes that needed to wait until ids were set to fire off.
[ { "docid": "a9f0a1cd55e2a345e1d2352972fb8f01", "score": "0.663938", "text": "def process_nested\n pending_nested.each_pair do |name, value|\n send(\"#{name}=\", value)\n end\n end", "title": "" } ]
[ { "docid": "b62549ce9e71731b8aa8aeffefc336ea", "score": "0.60450506", "text": "def process_pending\n process_nested and process_relations\n pending_nested.clear and pending_relations.clear\n _reset_memoized_descendants!\n end", "title": "" }, { "docid": "56fbacc01ba...
87ee7cd08c9c3c4dc66fc2e9743a42ec
build_requires adds a requirements to the list of build time dependencies that will need to be fetched from an external source before this component can be built. build_requires can also be satisfied by other components in the same project.
[ { "docid": "2f4e98f81ad8bda61772cf23738ad052", "score": "0.8260286", "text": "def build_requires(build_requirement)\n @component.build_requires << build_requirement\n end", "title": "" } ]
[ { "docid": "a5fbb33025e7d6b39c17c3aac355a3b9", "score": "0.71119684", "text": "def gem_build_requirements\n build_requires.select { |r| r.gem? }\n end", "title": "" }, { "docid": "cf9b8552e013a393eb3402d73eb49294", "score": "0.70908725", "text": "def requires()\n @re...
4efe67ae772280ae71b2bdd22ae69621
Function to see if we've been clicked
[ { "docid": "9ae9f9215472567fdf22cdd392f604f1", "score": "0.0", "text": "def contains(point)\n\n # For now, we'll just do a circle check within our radius - a circle\n # definitely contains our polygon, and this just gives the user a bit\n # of flex, too\n (point.x - (@x + @radius))**...
[ { "docid": "be88b7b59f76ae0338e867394e393480", "score": "0.888491", "text": "def clicked?\n return @clicked\n end", "title": "" }, { "docid": "885a13be3d5a7d56bb0ee930040d9f51", "score": "0.87347037", "text": "def clicked?\n\t\tif @clicked\n\t\t\t@clicked = false\n\t\t\tretur...
adb3be08caa5c6ad2059f3fbc67a9310
POST /rects POST /rects.json
[ { "docid": "702e40ce91540bd4acb29c7569884920", "score": "0.67912513", "text": "def create\n @rect = Rect.new(params[:rect])\n\n respond_to do |format|\n if @rect.save\n format.html { redirect_to @rect, notice: 'Rect was successfully created.' }\n format.json { render json: @rect...
[ { "docid": "59c96951bc544cd603d573d4121a8cc1", "score": "0.6001044", "text": "def determine_rects\n end", "title": "" }, { "docid": "59c96951bc544cd603d573d4121a8cc1", "score": "0.6001044", "text": "def determine_rects\n end", "title": "" }, { "docid": "e14af5808f32cb6c...
3f08f5480e08dffc1940ff06af22d925
GET /pub_quiz_answers GET /pub_quiz_answers.json
[ { "docid": "5031d34a26a3cfb76f7ee91d7a8422b5", "score": "0.7322476", "text": "def index\n @pub_quiz_answers = PubQuizAnswer.all\n end", "title": "" } ]
[ { "docid": "b6b9387142057b49e718eed8f1613b6e", "score": "0.7439009", "text": "def answers\n request('answers')\n end", "title": "" }, { "docid": "20d6517c93f785a4c3c419d8d68217d7", "score": "0.721619", "text": "def index\n @answers = @question.answers\n respond_with...
db1d750173a53f65233c9c027c1b37ee
Fourth, test that turns can be taken. This should call `call_shot` on the player who is up next.
[ { "docid": "9ed2f05de134f0a2b30086e9839043c1", "score": "0.0", "text": "def test_40_two_humans_can_exchange_fire\n human1 = HumanPlayer.new(\"Amy\")\n human2 = HumanPlayer.new(\"Beth\")\n game = Game.new(human1, human2)\n\n $mock_inputs.clear\n $mock_inputs += standard_placement # Set up ...
[ { "docid": "1e6ee40f146cbf8bb9ca22ff161b202d", "score": "0.7472994", "text": "def test_it_has_a_player_shot\n computer_player = ComputerPlayer.new\n human_player = HumanPlayer.new\n turn = Turn.new(computer_player, human_player)\n turn.player_shot\n end", "title": "" }, { "docid...
e06ac622892f426abadff21be09dd720
Converts the given size into an integer number of bytes.
[ { "docid": "a287828fe100bebaa83060b8674e861f", "score": "0.6226821", "text": "def interpret_size(size)\n case size\n when /k$/i then size.to_i * 1024\n when /m$/i then size.to_i * 1024 * 1024\n when /g$/i then size.to_i * 1024 * 1024 * 1024\n else size.to_i\n...
[ { "docid": "470ed87d84d5635eb668807d0adca314", "score": "0.73914444", "text": "def input_to_bytes(size)\n case size\n when /m|mb/i\n size.to_i * (1024**2)\n when /t|tb/i\n size.to_i * (1024**4)\n else\n # default is gigabytes\n size.to_i * (1024**3)\n ...
3e194d0eda3c694d58d3c0003bb165bc
Accepts a user object and creates a friendship request between both users.
[ { "docid": "5071480deeefdc2cadf83e9a318ba37b", "score": "0.6760419", "text": "def request_friendship_with(friend)\n\t\t\t\t\tunless is_friends_or_pending_with?(friend) || self == friend\n \t \t::Friendship.create!(:friendshipped_by_me => self, :friendshipped_for_me => friend)\n\t\t\t\t\tend\n \...
[ { "docid": "e1719653109b856692f60fb06406b055", "score": "0.8032652", "text": "def request_friendship(user_2)\n self.friendships.create(friend: user_2)\n end", "title": "" }, { "docid": "0a4cba242907d057ebf9717acc801e97", "score": "0.80304265", "text": "def request_friendship (use...
1430bf7826253a9c22ba62dabb1ea563
DELETE /documentations/1 or /documentations/1.json
[ { "docid": "2617c35fa667cd9e0120014e9d0ec56c", "score": "0.7335772", "text": "def destroy\n @documentation.destroy\n respond_to do |format|\n format.html { redirect_to documentations_url, notice: \"Documentation was successfully destroyed.\" }\n format.json { head :no_content }\n end\...
[ { "docid": "1da608e94e1a446d3185585df6a3f7df", "score": "0.758535", "text": "def destroy\n document = @person.documents.find(params[:id])\n document.destroy\n\n head 204\n end", "title": "" }, { "docid": "7e7089fca070ad5909ce2ae58dc9ecbb", "score": "0.75764555", "text": "de...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "23b543a0e7784c8428033f10930e93fa", "score": "0.0", "text": "def set_user_login\n @user_login = UserLogin.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...
b2ce843881a097580a8d84f716230965
Public: Retrieves default application. Returns Hsquare::Application object for default application.
[ { "docid": "bb66c61a136719a85c7c3c7159b49d6c", "score": "0.87843335", "text": "def default_application\n if @default_application\n @default_application\n elsif @applications && !@applications.empty?\n @default_application ||= @applications.first\n else\n @default_appl...
[ { "docid": "3e91969eec2fa78b92d03b813a46cc39", "score": "0.7856377", "text": "def default_app()\n @apps[0]\n end", "title": "" }, { "docid": "b2edb1dea9817beeb25349fbdc1fc0ee", "score": "0.6682775", "text": "def application!\n res = get!(APPLICATION_PATH)\n buil...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "04efe52803a067a0b9e5461990985e90", "score": "0.0", "text": "def set_hearing\n @hearing = Hearing.find(params[:id])\n @prosecution_case = @hearing.prosecution_cases.first\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...
1c16ce18cee13895c7b650c11a1fbe6a
Override to complete some action before dropping into shell.
[ { "docid": "8b68c34645990987bb9d8ee21f149a86", "score": "0.571874", "text": "def before_shell\n end", "title": "" } ]
[ { "docid": "81721170d96498488b71d63b6333ca35", "score": "0.6970074", "text": "def after_shell\n end", "title": "" }, { "docid": "7821df26a3f9ca17c4d5cf4347c87774", "score": "0.67265093", "text": "def shell_close()\n raise NotImplementedError\n end", "title": "" }, { ...
3e41b216c55afcb9d8275fd70d433c44
GET /country returns all countries
[ { "docid": "85b2454e673a484b3c9d8f7059949267", "score": "0.7704176", "text": "def index\n @countries = Country.all\n json_response(@countries)\n end", "title": "" } ]
[ { "docid": "d861e7105b26510383bc12ee0fef447c", "score": "0.8736741", "text": "def country_list\n get_request( \"/api/v2_1/api/countries\")\n end", "title": "" }, { "docid": "d8b601f16d48c1671ee474e7c45bed48", "score": "0.844271", "text": "def all_countries \n\t\tself.clas...
219e50a0d80dfac950e4e3ded9a05622
Returns the y coordinate of a symbol by first converting to a String and then calling Stringy.
[ { "docid": "de2eec6d4f923cca2f9467ae32b75258", "score": "0.6290038", "text": "def y\n to_s.y\n end", "title": "" } ]
[ { "docid": "d6d06f579a348dd1bdae3ae0c9005dda", "score": "0.64300776", "text": "def y\n @y / CharData::CHAR_HEIGHT\n end", "title": "" }, { "docid": "de000a147da7839dc0522397fb548564", "score": "0.6369268", "text": "def y\n if attributes[:y].is_a?(Proc)\n attributes[:y...
21f1ef1813a6702277362011d8ee80b1
Decode a batch of events from the given content data. This should be passed the request body, if the ContentType is of the form `application/cloudeventsbatch+format`.
[ { "docid": "5ac1b58b30bb29848fb0d128bb89bb12", "score": "0.76271236", "text": "def decode_batched_content input, format, **format_args\n handlers = @batched_formatters[format] || []\n handlers.reverse_each do |handler|\n events = handler.decode_batch input, **format_args\n return...
[ { "docid": "9417cedef98414cca5c4b2991f9480e7", "score": "0.73017615", "text": "def decode_batched_content input, content_type\n handlers = @batched_formats[content_type.subtype_format] || []\n handlers.reverse_each do |handler|\n events = handler.decode_batched_content input, cont...
4be8658e3b897a9fc8c28d548c0ece62
Returns a file upload field with a more pleasant interface than browser file inputs. Changes messaging if the `method` already exists. Options are forwarded to the hidden `file_field`.
[ { "docid": "0804d1e535770f822841c4c298379bcc", "score": "0.72240406", "text": "def attachment_field(method, options = {})\n render(partial:\"admin/shared/forms/attachment_field\", locals: {\n f: self,\n method: method,\n options: options,\n })\n end", "title": "" ...
[ { "docid": "c0b49abea496a9e0cd75767d3a15a1c9", "score": "0.8036863", "text": "def file_field(object_name, method, options = {})\n options = { include_hidden: multiple_file_field_include_hidden }.merge!(options)\n\n Tags::FileField.new(object_name, method, self, convert_direct_upload_option...
eb312985922cb0139c4f2d0eebabc336
Tell Gyoku how to convert Hash key Symbols to XML tags. Accepts one of :lower_camelcase, :camelcase, :upcase, or :none.
[ { "docid": "2409b2940a96bcbcd33f87827031aa40", "score": "0.0", "text": "def convert_request_keys_to(converter)\n @options[:convert_request_keys_to] = converter\n end", "title": "" } ]
[ { "docid": "8daa9820d79a1e36d417c8d1d3c7189a", "score": "0.63310134", "text": "def xml_string symbol\n if symbol.is_a? String\n symbol\n else\n symbol.to_s.gsub('_',' ').gsub(/\\b./, &:upcase)\n end\n end", "title": "" }, { "docid": "5d4e0e0fafbd72c5f4d0c76d073a0e2f", ...
c23af1b2c610fc9847912d4bccbdb4a0
GET /groups/new GET /groups/new.json
[ { "docid": "922e1183c8738858de933d056cac67c4", "score": "0.7134333", "text": "def new\n @group = Group.new\n @universities = University.order(:name)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end", "title": "" } ]
[ { "docid": "14d48c30451f8afa609eaced8133477a", "score": "0.8187752", "text": "def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end", "title": "" }, { "docid": "9f640e042b091bfd7159f1be78fc0a8f...
7f269dc7c680be959ed920154456000a
Load additional authorization_rules for specs. For some strange reason, this isn't done automatically while running the specs
[ { "docid": "857a8e2f4be211c7638733e9c3cc9f93", "score": "0.797176", "text": "def load_authorization_rules\n instance = Alchemy::Auth::Engine.get_instance\n instance.load(File.join(File.dirname(__FILE__), '../../dummy', 'config/authorization_rules.rb'))\n end", "title": "" } ]
[ { "docid": "3812d07f75ea3deed785ece62321fc2e", "score": "0.83212364", "text": "def load_authorization_rules\n instance = Alchemy::Auth::Engine.get_instance\n instance.load(File.join(File.dirname(__FILE__), '../../../spec/dummy', 'config/authorization_rules.rb'))\n end", "title": "...
7ac010324491c64e772c738641cbc879
DELETE /qus/1 DELETE /qus/1.json
[ { "docid": "cce45e18f8b68e2f6cbf5849e22a5a6a", "score": "0.6506055", "text": "def destroy\n @qu = Qu.find(params[:id])\n @qu.destroy\n respond_to do |format|\n format.html { redirect_to qus_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7161146", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.6840841", "text": "def delete path\n make_request(path, \"delete\", {})\...
9238669097ba6ca69286d38645714506
Turn the lights on at the start of the overflight and then turn the lights back off at the end
[ { "docid": "94a2f87a27c47adbb445f7b72247d7b3", "score": "0.68892485", "text": "def run_light_sequence(duration)\n @light.set_state( { :on => true })\n @sched.in duration do\n @light.set_state( { :on => false })\n end\n @sched.in duration do\n request_pass_update\n end\n end", ...
[ { "docid": "f7caf5cc4be0d91c40585707e32436f7", "score": "0.7834977", "text": "def lightsOn\n @turn_lights_on_off=true\n end", "title": "" }, { "docid": "a0c2752838ea81a30d84efe789a61b83", "score": "0.78107", "text": "def turnLightsOn\n @lightsOn = true\n end", "title": ""...
e83ae9d168cdfc62dc45c2be2f1d0480
this function returns a measure of how the answer to a question will discrimate a set of products the measure is a 3upple made of [standard deviation, nb product, average weight]
[ { "docid": "b2c729b0a33442cc41920a7e80b379cd", "score": "0.0", "text": "def discrimination(user, product_idurls)\n raise \"error product_idurls=#{product_idurls.inspect}\" unless product_idurls.is_a?(Array) and product_idurls.size > 0\n weights = []; deviations = []\n product_idurls.each do |p...
[ { "docid": "c8968fcb1e802041672f412e34822b31", "score": "0.6363169", "text": "def StandardDeviation(results)\n\n \n #Standard deviation = the square root of the sum of the diffrences between the samples and the \n #average squared divided by the sample size minus one\n #s = sqrt((X - M)^2/n-1)\n re...
63fe3051244d40e38d99066b63434933
DELETE /troubles/1 DELETE /troubles/1.json
[ { "docid": "a3355778210171466ffd30b1e15b671d", "score": "0.6808052", "text": "def destroy\n @trouble.destroy\n respond_to do |format|\n format.html { redirect_to troubles_url, notice: 'Trouble was successfully destroyed.' }\n end\n end", "title": "" } ]
[ { "docid": "1cfa01772e7141a573b1c2d104011f18", "score": "0.7522404", "text": "def destroy\n @trouble = Trouble.find(params[:id])\n @trouble.destroy\n\n respond_to do |format|\n format.html { redirect_to troubles_url }\n format.json { head :no_content }\n end\n end", "title": "...
1d0236f600e91240c25d35f88d5f6524
Sets the object associated with this note
[ { "docid": "b1ab00eb230a273783872db7c95e08cd", "score": "0.0", "text": "def for=(model)\n assign_attributes(for_type: model.class.to_s, for_id: model.id)\n end", "title": "" } ]
[ { "docid": "32c3d64decb41406875ad22af67cfdf2", "score": "0.7263715", "text": "def object=(object)\n self.object_id = object.id\n self.object_type = object.class\n end", "title": "" }, { "docid": "406de708b107a77089484dbf815da422", "score": "0.7142807", "text": "def __set...
9442dcdb986d04d71bf10351e751c5a0
Recursively ensure all puppet code can be parsed
[ { "docid": "c2006e4c2131ad6f25963682f68a5c0c", "score": "0.47695225", "text": "def validate_puppet_code(step_key, value)\n case value\n when Array\n value.map { |element| validate_puppet_code(step_key, element) }\n when Hash\n value.each_with_object({}) d...
[ { "docid": "4a27053714711dbcb11fc560f1c0d270", "score": "0.5767221", "text": "def run_puppet_lint(manifests)\r\n manifests.each do |manifest|\r\n sh \"puppet-lint --fail-on-warnings --no-80chars-check \\\"#{manifest}\\\"\"\r\n end\r\nend", "title": "" }, { "docid": "ddcdc4db32682cba110a...
e35a34e037edb37a97b78b748725a59b
f(n) = f(n1) + 2 + 8(n1) f(n) = f(n1) + 4 + 8(n1) f(n) = f(n1) + 6 + 8(n1) f(n) = f(n1) + 8 + 8(n1)
[ { "docid": "e324018ca4ad44e4ac0e0f3ca1f86744", "score": "0.0", "text": "def diagonal_numbers(key_number)\n i = 0\n numbers = [1]\n 500.times do |x|\n numbers << (numbers[-1] + key_number + 8*i)\n i += 1\n end\n numbers.select { |x| x > 1}\nend", "title": "" } ]
[ { "docid": "3bcd9335b4b65f0de1d681e6e890c32d", "score": "0.77558345", "text": "def solution_28\n def f(n)\n if n == 1\n return [1]\n else\n start = f(n-2).last + (n-1)\n return (0..3).map { |i| start + (n-1)*i }\n end\n...
4852bfe85d03bf1da7206ee6b783a355
=== save_files Saves Email body and attachment files into directory.
[ { "docid": "18dc797000d165458fb4c95d516890bd", "score": "0.7765713", "text": "def save_files\n\n return if @mail.nil?\n\n path = self.get_dir\n FileUtils.mkdir_p(path)\n\n # Raw data\n self.save_raw(@mail.raw_source)\n\n # Attachment files\n\n return unless @mail.has_attachments?\n\...
[ { "docid": "087d086e39a9eb66ca0490af747beeb0", "score": "0.6695119", "text": "def save_emails\r\n @log.debug \"There are #{@saved_mail.size} saved emails\"\r\n @saved_mail.each do |em|\r\n SavedMail.create(\r\n :body => em.to_s\r\n )\r\n end\r\n @log.debug \"Mails saved\"\r\...
61b6e4a65744d4ffa6057b0abcb3e42c
removes all html entities
[ { "docid": "533ae28683ac5640dcefda93d582aee2", "score": "0.8320526", "text": "def rm_html_entities(str)\n str.gsub(/&\\w+;/, \"\")\n end", "title": "" } ]
[ { "docid": "51bc5cd89128dce6389d21418b29ae44", "score": "0.8079592", "text": "def without_entities(html)\n html.\n gsub(/&#(\\d+)/) { |n| [n.to_i].pack('U') }.\n gsub(/&#x([\\da-f]+)/i) { |n| [n.to_i(16)].pack('U') }.\n gsub(/&\\w+;/, [0xfffd].pack('U'))\nend", "title": "" }, { "do...
22a40ffb77d9c5a0da4dadb2c605e56a
Gives each player two cards from the deck to start out.
[ { "docid": "207921cdb27e485682ae763bd058359d", "score": "0.67402536", "text": "def dealInitialCards\n\t\t@players.each.with_index do |player, playerIndex|\n\t\t\t(0..1).each do |i|\n\t\t\t\tcard = @deck.getNextCard\n\t\t\t\tplayer.dealCard(card, 0, false)\n\t\t\t\tif playerIndex != DEALER_INDEX\n\t\t\t\...
[ { "docid": "e8b8977bd09385bbf7cc6fd1940cb87a", "score": "0.74427146", "text": "def split_deck\n main_deck = create_deck\n # randomize\n @player1_deck, @player2_deck = main_deck.each_slice(main_deck.length / 2).to_a\n end", "title": "" }, { "docid": "ab27ed3fb0e39542db4c82a9325518d3...
43dbb82173a2ec50ac19723af93afa8d
DELETE /tour_packages/1 DELETE /tour_packages/1.json
[ { "docid": "122903cdbdd60b90857585e5114b5231", "score": "0.7410369", "text": "def destroy\n @tour_package.destroy\n respond_to do |format|\n format.html { redirect_to tour_packages_url, notice: 'Tour package was successfully destroyed.' }\n format.json { head :no_content }\n end\n en...
[ { "docid": "2780ecc9d27c64d7334c0a7ee6f53071", "score": "0.72944427", "text": "def destroy\n @travel_package.destroy\n respond_to do |format|\n format.html { redirect_to travel_packages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a1...
735d55a13c1ffb079bc5a60a5055c107
GET /rreplies/1 GET /rreplies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4a7aa2b76d150ed60d07eb3aa5802b11", "score": "0.773676", "text": "def index\n @rreplies = Rreply.all\n end", "title": "" }, { "docid": "d42dda858ed16e821b695c00bd3bc515", "score": "0.7332532", "text": "def index\n @replies = Reply.all\n\n render json: @replies\n ...
9b329c8f4833d4a17de5f86149fd45e1
returns properties that this ring can use this ability on
[ { "docid": "12237ac77903e71cd931350ec5a2da10", "score": "0.0", "text": "def permitted(aRing,aAbility)\n\t\t\taRing = Concentric.lookup_ring(aRing)\n\t\t\traise \"aRing must be a number or a symbol defined in Concentric.config.ring_names\" if !aRing.is_a?(Fixnum)\n\t\t\treturn [] unless aRing and rings_a...
[ { "docid": "836da00306b482a0089ea320453b419f", "score": "0.72494996", "text": "def properties\n self['properties']\n end", "title": "" }, { "docid": "7bb245494ce1ff0baeaabdc698c0a343", "score": "0.7143697", "text": "def requested_properties\n @properties\n end", ...
cda42f73c36606b5444b1674ddf022a1
GET /smalltrials/1 GET /smalltrials/1.json
[ { "docid": "2f81f2a35d57ed9351eaf95e748d7788", "score": "0.79838157", "text": "def show\n @smalltrial = Smalltrial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @smalltrial }\n end\n end", "title": "" } ]
[ { "docid": "22a026aae4263c8559ab5a11da3e6ebb", "score": "0.750459", "text": "def show\n @mostsmalltrial = Mostsmalltrial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmalltrial }\n end\n end", "title": "" }, { ...
93eb43a8dd711ae44971e6f1a22590af
Main point of entry for kitchenplan binary. run starts the app.
[ { "docid": "400f06c50dae988fca26a3c0627cfdf7", "score": "0.0", "text": "def initialize\n super\n configure_logging\n detect_platform()\n detect_resolver()\n load_config()\n end", "title": "" } ]
[ { "docid": "59ac35ff1ac98658504629a26f9730dd", "score": "0.7154882", "text": "def run_main\n end", "title": "" }, { "docid": "42758f2575376a129193cd895e4c31e1", "score": "0.6863408", "text": "def run\n Kitchenplan::Log.info \"Kitchenplan starting up.\"\n # get options. ...
49bfe1695d6d855f93b018548b155aaa
The Add method should return the sum of the input when called with a multiple positive integer numbers up to 1000.
[ { "docid": "4d64dfb7e19700bc0e792ebbff6d2e13", "score": "0.0", "text": "def test_Add_Should_ReturnSum_When_CalledWithTwoOrMoreIntegersWithCustomSeparatorDeclaration382\n # Arrange.\n @inputValue = '//[++][!!][##]\\n0++0'\n @expectedResult = 0\n\n # Act.\n @actualResult...
[ { "docid": "8922b52992b7fc4494384f8720b929f3", "score": "0.73114955", "text": "def add(number)\n \n end", "title": "" }, { "docid": "576a7399151404eb24e394217876afcc", "score": "0.72276115", "text": "def add(numbers)\n\tnumbers.inject(:+)\nend", "title": "" }, { ...
a1c0da4aa79ed88d6385821b1ed1f1f9
DELETE /comm_rate_ms/1 DELETE /comm_rate_ms/1.json
[ { "docid": "ddf3bba584bd606e8042fde3283ed61c", "score": "0.7473905", "text": "def destroy\n @comm_rate_m.destroy\n respond_to do |format|\n format.html { redirect_to comm_rate_ms_url, notice: 'Comm rate m was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "027aae8a8c4f73908c01e583d64f649c", "score": "0.7246274", "text": "def destroy\n @rate.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a33c6dcb05d9d79f8ebfd20d067319a6", "score": "0.71952736", "tex...
d42800bd803d718cf7b1fcc48f03a233
Establishes connection to NATS
[ { "docid": "c4802612c9ccdef965d9dab90fa7b98e", "score": "0.7147961", "text": "def connect(opts={})\n opts[:verbose] = false if opts[:verbose].nil?\n opts[:pedantic] = false if opts[:pedantic].nil?\n opts[:reconnect] = true if opts[:reconnect].nil?\n opts[:reconnect_time_wait]...
[ { "docid": "a5a718595767b45754e89ac868a26404", "score": "0.6478864", "text": "def connect(uri=nil, opts={}, &blk)\n case uri\n when String\n # Initialize TLS defaults in case any url is using it.\n uris = opts[:uri] = process_uri(uri)\n opts[:tls] ||= {} if uris.any? {|u| ...
6a1ba99333b018324e3a8b549d80c892
Returns +true+, if this items is the first of a new section
[ { "docid": "3553f29a82788d055aa1b7873329098f", "score": "0.76632917", "text": "def new_section?\n @new_section\n end", "title": "" } ]
[ { "docid": "57e2c97344caf664400df69e4ba35544", "score": "0.7344696", "text": "def first_item?\n false\n end", "title": "" }, { "docid": "13b816c40d3b437f1d68995bb2ba617d", "score": "0.70140225", "text": "def start_section? i, diff_ary\n !@section && section?(i, diff_...
a34ef69b8882ee71ded287ed1be6bb7d
Returns the configuration options set up by parsing the commandline arguments passed to the client application.
[ { "docid": "07a14a1b7b2aeac8d082c4877cbaad10", "score": "0.69737554", "text": "def configuration\n parser = OptionParser.new do |opts|\n opts.banner = \"Usage: #{$PROGRAM_NAME} [options]\"\n\n opts.on('-i', '--interactive',\n 'Run the application in interactive ...
[ { "docid": "59a2ddd0653f349e608031f15dd766fb", "score": "0.7256954", "text": "def options\n parse_arguments(ARGV) if @options.nil?\n @options\n end", "title": "" }, { "docid": "aa93465348d504779958aa126a49689e", "score": "0.7179964", "text": "def command_line_options\n ...
8424608651488ab52cdac9c51e8b73b1
Holds the content to be added to the file.
[ { "docid": "ff78756c0a9688714898e3f2a3874d24", "score": "0.0", "text": "def render\n @render ||= if data.is_a?(Proc)\n data.call\n else\n data\n end\n end", "title": "" } ]
[ { "docid": "b517c18dfda0430ac7fc5afbd2a5372f", "score": "0.7214608", "text": "def add_to_storage\n generate_storage_path &&\n Conduit::Storage.write(file, content)\n end", "title": "" }, { "docid": "84b1f1c040276f788c09a6e63fff21c4", "score": "0.71968704", "text"...
9a9267676f2dfa16edfee1fa1b319293
Add Application to this domain options cartrdige template scale gear_profile
[ { "docid": "373e5c821f910c6f035bc82968a4b5e8", "score": "0.58478504", "text": "def add_application(name, options)\n debug \"Adding application #{name} to domain #{id}\"\n\n payload = {:name => name}\n options.each do |key, value|\n payload[key] = value\n end\n ...
[ { "docid": "3653422c506de8569855687b1be51425", "score": "0.58874506", "text": "def scale(options)\n # retrieve the App's Procfile data\n allowed_proctypes = proctypes.keys\n old_formation = self.formation\n\n allowed_proctypes.each do |gear_proctype|\n old_count = old_formation[gear_pro...
703686e3341f55ef219acdff23c1c2fb
PATCH/PUT /nakladatelstvi/1 PATCH/PUT /nakladatelstvi/1.json
[ { "docid": "b5a794c70199554723eb6decabd20ba2", "score": "0.66666496", "text": "def update\n respond_to do |format|\n if @nakladatelstvi.update(nakladatelstvi_params)\n format.html { redirect_to nakladatelstvi_index_path, notice: 'Nakladatelstvi was successfully updated.' }\n format...
[ { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.623265", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "6823ca2eb6b168572557c700ad11a10f", "score": "0.6229788", "text": "def update\n respond_to do |format|\n if @j_datum...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a6d7d4083899b26e5ea97a82d57e9863", "score": "0.0", "text": "def set_oder\n @oder = Oder.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...
eaeebb0c3695c5e07a90dd9a625fdc50
for data files, SOPs and presentations, that only have a single contentblob
[ { "docid": "1a0fc7c2b045c02ad52aa176e04b4411", "score": "0.0", "text": "def download_single\n name = self.controller_name.singularize\n @asset = eval(\"@#{name}\")\n\n @asset_version = eval(\"@display_#{name}\")\n @content_blob = @asset_version.content_blob\n @asset.ju...
[ { "docid": "595c84a83bcdd5264559d69142460659", "score": "0.68585765", "text": "def content\n @blob.content\n end", "title": "" }, { "docid": "e2ad58f9bdcbd00a0346dc235f4ab9b7", "score": "0.66797954", "text": "def blob; end", "title": "" }, { "docid": "e2ad58f9bdcbd00a...
106e088e6e267f6ccf423a2e9fc5b1af
Return the service response or nil if the record is not found
[ { "docid": "8f72bf42d3b338d26a4e786e017d994c", "score": "0.7664837", "text": "def service_response\n @service_response ||= ServiceResponse.find(params[:service_response_id])\n rescue ActiveRecord::RecordNotFound\n nil\n end", "title": "" } ]
[ { "docid": "8d1424c088588441f2512f88e8a464e2", "score": "0.6358299", "text": "def find_record\n if @zone.nil?\n if @resource[:zoneid] != 'absent' then\n @zone = zone_by_id @resource[:zoneid]\n if @zone.nil? then\n self.fail \"No zone with id: ...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "ed3b4bff7d599fe01104c8463bdef5a0", "score": "0.0", "text": "def hash\n [seller_fulfillment_order_id, marketplace_id, displayable_order_id, displayable_order_date, displayable_order_comment, shipping_speed_category, delivery_window, destination_address, fulfillment_action, fulfillment_po...
[ { "docid": "d63333ed15c27e3f7526f0c6f8099546", "score": "0.7118691", "text": "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end", "title": "" }, { "docid": "23cdf6a080837fbe407633be0799ea0e", "score": "0.70400536", "text": "def hash() end", "title": ...
92f8f12ae6c153e42f66ef58eb717110
Send JOIN command Join a channel with given password
[ { "docid": "8e755c9c1777878ea9760c0fb090ae81", "score": "0.86148196", "text": "def join(channel, password=nil)\n write_optional(\"JOIN #{channel}\", password)\n end", "title": "" } ]
[ { "docid": "e4b758fec134592a80759f2f6261763a", "score": "0.8040653", "text": "def join(channel, password = '')\n @irc.join(channel, password)\n end", "title": "" }, { "docid": "02368c030a7c079f068b05d9deb3fb3b", "score": "0.77922004", "text": "def join(chan, pass = '')\n w...
1aee7b568011b4f8b21fce2ae37f0e8b
Identical cells using md5 (no collision check)
[ { "docid": "c9736dd53ccbef0e26aaf82b280977f8", "score": "0.71018577", "text": "def identical_cells\n CodeCell.includes(:notebook).where(md5: md5).where.not(id: id)\n end", "title": "" } ]
[ { "docid": "285e580eeb31704dc1215ed9f2a999aa", "score": "0.74601763", "text": "def mutate_md5(cell)\n cell ? Digest::MD5.base64digest(cell) : cell\n end", "title": "" }, { "docid": "cfbfaec8f6c49d8097e6b90563a72393", "score": "0.65257335", "text": "def md5?; @md5; end", "...
77110853e008f0a628c56cee35c7940f
Sign out current user
[ { "docid": "85733dbd24f3518e6aab850d35aa4a72", "score": "0.80518955", "text": "def signout \n\t if current_user\n\t session[:identity] = nil\n\t session[:authentication_id] = nil\n\t session.delete :identity\n\t session.delete :authentication_id\n\t flash[:notice] = 'You have...
[ { "docid": "ff0771cbf1ce8626c189079f380b0adc", "score": "0.8767493", "text": "def sign_out\n session.delete :user_id\n @current_user = nil\n end", "title": "" }, { "docid": "974ef0a45dcde8de66867ff784e866cd", "score": "0.87275094", "text": "def sign_out\n @current_use...
7fdc7e3bfebfca64bf6fb4beb542ff95
Set the value of the Output input for this Choreo.
[ { "docid": "f62db772eb9f8c41b09569d5a217a439", "score": "0.78824985", "text": "def set_Output(value)\n set_input(\"Output\", value)\n end", "title": "" } ]
[ { "docid": "ea2c06461ecafb98374882b22324aebf", "score": "0.76374596", "text": "def output=(output)\n @output = output\n end", "title": "" }, { "docid": "62aa323b2466e507a293ef0168e596c3", "score": "0.7489443", "text": "def output=(output)\n Validator.validate_output(output...
fb1832153361dbd0794f206462578f8c
DELETE /floors/1 DELETE /floors/1.json
[ { "docid": "0f2b3655f990af143c63140ef7cf9642", "score": "0.6973188", "text": "def destroy\n @floor.destroy\n respond_to do |format|\n format.html { redirect_to floors_url, notice: I18n.t('floors.destroy') }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "4ea21d62adcdef7c24492538d73740c0", "score": "0.6945638", "text": "def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect_to floors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
9a04b7cdc35d61e81e8df236fbf0e5b6
Edita los datos de la ruta
[ { "docid": "a0cc8724a056b3b9e0f0e29f63ad73b3", "score": "0.6796113", "text": "def edit\n @ruta = @transportador.ruta if @transportador\n @ruta ||= Ruta.find(params[:id])\n @transportador ||= @ruta.transportador\n end", "title": "" } ]
[ { "docid": "03269b7353e60e7e373ef0b15969a043", "score": "0.7246676", "text": "def edit() end", "title": "" }, { "docid": "03269b7353e60e7e373ef0b15969a043", "score": "0.7246676", "text": "def edit() end", "title": "" }, { "docid": "419a6f93d773b84645ae2e147e8ea60c", "...
91c46fac35b605ce775178196e915213
process the remaining expression to see if an until, end, ending is specified
[ { "docid": "73c5dc1f84850f00daed8f67faeed1da", "score": "0.5813846", "text": "def process_for_ending(text)\n (md = Patterns::PROCESS_FOR_ENDING.match text) ?\n [ md[:target], md[:ending] ] :\n [text, nil]\n end", "title": "" } ]
[ { "docid": "e1147e986d273ac9c530a4361f176dff", "score": "0.681881", "text": "def process_until(exp)\n Loop::While.new(Operator::Logical::Not.new(process(exp.shift)), process(exp.shift))\n end", "title": "" }, { "docid": "7f184928eeb346764961c4786627687b", "score": "0.6662734", ...