query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2af49dac466e8c281fb41c31ca20e668
Returns a single Resource object, based on its _id_ ==== Arguments _id_ id of Resource
[ { "docid": "7de32cfc914c76349384bfa71be25fe3", "score": "0.7596603", "text": "def find(id)\n code, data = @session.get(element_path(id) + '.json')\n if code == 200\n key = @resource.name.to_s.split('::').last.downcase\n @resource.new(data[key].merge(:session =>@session))\n e...
[ { "docid": "8f5d25435b22a82a59de23a5b24dd615", "score": "0.8232799", "text": "def find_one(id)\n response = request(:get, \"/#{resource_name}/#{id}\")\n #puts response\n construct_record_from_singular(response)\n end", "title": "" }, { "docid": "0e149f61f964b0cdd4a0...
c7477a03a25c7a33fedaf42cb87bb7ea
Get the content, will be compressed in production typically.
[ { "docid": "fede41ac1ecf64533e5f4b107f0c2b78", "score": "0.72258955", "text": "def content(compress = p?)\n compress ? cached : joined\n end", "title": "" } ]
[ { "docid": "3e120fcc3f91759cdd5612d007d95709", "score": "0.76626855", "text": "def content\n return @raw if @raw\n\n if self.uri\n @raw = HTTParty.get(self.uri.to_s).body\n # elsif self.precompiled?\n # template = Tilt.new(self.filepath)\n # @r...
76dd5bbb504aab88b160536eace7d675
Call this function to replace the current string permanently
[ { "docid": "179c0c59baa7207fef26469a9a7400b6", "score": "0.0", "text": "def clever_title! args = {} # :args: :max_downcase_conversion, :capitalize_first_letter\n @title = self\n @max_downcase_conversion = 4\n @max_downcase_conversion = args[:max_downcase_conversion] if args[:max_downcase_conver...
[ { "docid": "dc59809264443004dbf673532d91a1e6", "score": "0.710606", "text": "def change_string(str)\n \tstr.replace(\"New string content!\")\n \tstr = \"original string content!\"\n end", "title": "" }, { "docid": "c349ea9d7370850f1c1ef11c1c7313e4", "score": "0.7078296", "text": "def...
bd1c84494b3449b5d2bdf739494075b5
shortcut methods to get to report file in report_file object
[ { "docid": "06dc48822d18b13ad9fd929a66aaa9b4", "score": "0.0", "text": "def report_record\n x = self.election_translations.select{|x| x.locale == I18n.locale.to_s}.first\n if x.present?\n return x.report_record\n end\n return nil\n end", "title": "" } ]
[ { "docid": "828f5a4848740deed5b9d8e7169224cd", "score": "0.7962501", "text": "def report_record\n self.report_file\n end", "title": "" }, { "docid": "76ac0d5c40c639e4389372fbf3e48020", "score": "0.7787482", "text": "def report_to\n @report_to ||= file(@project.path_to(:repor...
14ffe313318512f9cdb633b1b9cc1dce
Public: Creates a new DebugRunner. dataset The Atlas::Dataset whose demands and shares are to be calculated. directory The path to a directory in which to store debug output and diagrams. nil will disable diagram output. Retuns a DebugRunner.
[ { "docid": "feaae6a193028d59711a0859dea117ce", "score": "0.75794995", "text": "def initialize(dataset, directory = nil, diagrams = SECTORS)\n require 'ruby-progressbar'\n\n @dataset = dataset\n @runner = nil\n @error = nil\n\n @diagrams = diagrams\n\n if directory...
[ { "docid": "b9fd7581ff9e3af13368186c536e1e27", "score": "0.5176474", "text": "def initialize(directory, scan_procedure_name=nil)\n raise(IOError, \"Visit directory not found: #{directory}\") unless File.directory? File.expand_path(directory)\n @visit_directory = File.expand_path(directory)\n @w...
026ed67522c0c959870379717c7f30bf
Returns the db file path.
[ { "docid": "fd641aab497fa5b86788daa78ba815d9", "score": "0.7662637", "text": "def db_file_path\n @db_file_path ||= ::File.join(WebProfiler.config.tmp_dir, \"rack-webprofiler.db\")\n end", "title": "" } ]
[ { "docid": "bfd4b1d6360d9c66d9555231f89a6f8f", "score": "0.8586633", "text": "def db_path(db_name)\n File.join(@path, db_name)\n end", "title": "" }, { "docid": "d8db4b25fc8b1693e53fdfe78bc5d90d", "score": "0.8535845", "text": "def filepath db_name\n \"#{@path}/#{filename ...
368a945068d8944ee2587c36c163389d
Someone who doesn't (yet) have a valid JWT API token.
[ { "docid": "2fe7d49198fa044e565a13ecfae97c54", "score": "0.0", "text": "def guest_user(_user)\n if RuntimeConfig.vote_signin_active?\n can :access, :sessions\n end\n end", "title": "" } ]
[ { "docid": "ba482c7f49f6ec908ad270b60f4068c3", "score": "0.71664286", "text": "def verify_jwt_token\n begin\n if request.format.json?\n token = request.headers['Authorization'].split(' ').last\n decoded_token = JWT.decode token, nil, false\n @current_user = User.find(decoded...
6a1640b76a639deb9825fc95880a17f2
puts "time start" fin = Time.now + 3 while Time.now < fin fin Time.now sleep 1 return "Too late" end puts "time end" ARGUMENTS
[ { "docid": "659d36d0c0f341f5c5142082d6388f67", "score": "0.0", "text": "def intro_prompt(intro_prompt_answer, current_user)\n\n if intro_prompt_answer == \"Run inside and save them\"\n system \"clear\"\n\n puts user_stats(current_user)\n\n puts \"You run up the steps to save the villag...
[ { "docid": "f81631ae398c4a39d87480910849946a", "score": "0.7291621", "text": "def alarm_clock_anna \n time = 30 \n until time == 45 \n puts \"Good Morning Anna, it's great to stay up late\"\n time += 5 \nend \nend", "title": "" }, { "docid": "71e8d9f2f8311148a9dfaca59c882214", "score...
0ed1b7ae8505b8e40132317514f22083
Find end date of booking/subscription
[ { "docid": "a2b8f5d8e6c7d048269163fa32dbc9bb", "score": "0.826365", "text": "def booking_subscription_end_date\n record = find_booking_subscription(params)\n record.instance_of?(Booking) ? date_format(record.end_date) : date_format(record.expired_at)\n end", "title": "" } ]
[ { "docid": "012ef5f5210a74da98af0c1398dd5462", "score": "0.7600346", "text": "def end_date\n subscription? ? Time.zone.at(@item.period.end).strftime('%b %d, %Y') : nil\n end", "title": "" }, { "docid": "67e6a9ac6261eb647128d85ed4938db2", "score": "0.74808854", "text": "def en...
ba671c0db72059e7c99cc21cb7b187be
Routed to by: "GET user_messages"
[ { "docid": "72ae55ee996183383a13c27795ef0ee3", "score": "0.0", "text": "def get_user_messages\n @processed_messages = ProcessedMessages.where(:user_id => User.find_by_phone_number(current_user.phone_number)).where('date_processed > ?', Date.today - 6)\n @messages_from_user = ProcessedMessages.wher...
[ { "docid": "099b66d6d743e0cf8643ae1aa0eb2634", "score": "0.7893552", "text": "def messages\n # con le restrizioni correnti, l'utente è sempre il current_user\n @user = User.find(params[:id])\n @messages = @user.received_messages.paginate(page: params[:page])\n end", "title": "" }, { ...
eb911bd82881194e1f5faa5cfdf29b44
GET /asesors GET /asesors.json
[ { "docid": "d5b4f9175ee2466f0e7a280a56ab5881", "score": "0.5785245", "text": "def index\n @asesors = Asesor.where(:app_id => params[:app_id])\n @parametro = params[:app_id]\n end", "title": "" } ]
[ { "docid": "4bf2e34d2fd4bf1da0b033ed1869477c", "score": "0.7582811", "text": "def index\n @asesors = Asesor.all\n end", "title": "" }, { "docid": "90c589cfb50f6628a54e78665c1c3e94", "score": "0.59602064", "text": "def set_asesor\n @asesor = Asesor.find(params[:id])\n end"...
de9d6d689439865ac30c21ce7cb87071
Camera.create(brand: "canon", name: "Canon EOS 5D Mark II", megapixels: "21.1", memory_type: "CompactFlash (CF) Card", small_image_url: " large_image_url: " price: "$2895") Camera.create(brand: "nikon", name: "Nikon D7000", megapixels: "16.2", memory_type: "Secure Digital, SDHC, SDXC", small_image_url: " large_image_ur...
[ { "docid": "d3574475bee2ae5e996e951c7df8df8d", "score": "0.66645443", "text": "def add_cameras(brand)\n full_url = \"https://api.flickr.com/services/rest/?method=flickr.cameras.getBrandModels&api_key=#{FLICKR_KEY}&brand=#{brand}\"\n raw_response = HTTParty.get(full_url)\n data = raw_response.to_hash\...
[ { "docid": "5b50ce0bed1af2710347198ec6a30473", "score": "0.6546688", "text": "def camera\n end", "title": "" }, { "docid": "5b50ce0bed1af2710347198ec6a30473", "score": "0.6546688", "text": "def camera\n end", "title": "" }, { "docid": "b310353d330079762b94bea0812c5e9f",...
98f652fc852173eff207b1816b1cd38c
Update time left on step. If step complete, return step. Else, return nil
[ { "docid": "80972219ef7cd84a476563d28413d1f2", "score": "0.6018262", "text": "def update\n @time += -1\n if @time == -1\n done = @target\n @target = \"\"\n return done\n end\n return nil\n end", "title": "" } ]
[ { "docid": "5a383855aa727783371aecd7d8ea8f78", "score": "0.64251965", "text": "def steps_remaining\n @total_steps - @step\n end", "title": "" }, { "docid": "259ca158d599522c982a50c455560a46", "score": "0.6279883", "text": "def update_timestep\n default = MSPhysics:...
17733a54c129f990a430bb5efdd41253
Defines a callback that will get called right after the client's execute method has finished. class Github < Artemis::Client after_execute do |data, errors, extensions| if errors.present? Rails.logger.error(errors.to_json) end end ... end
[ { "docid": "0e5cb093f9ee8e22b713f7c37ea95e03", "score": "0.6800111", "text": "def after_execute(&block)\n config.after_callbacks = [*config.after_callbacks, block]\n end", "title": "" } ]
[ { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.65537316", "text": "def execute_callbacks; end", "title": "" }, { "docid": "d647b4c5ed8f534a894e5ed10b0c17f6", "score": "0.63719773", "text": "def after_execute\n puts 'after_execute called'\n end", "title": "" }, ...
78ad00d4d9b2b8e0d7b147e3f64ee09e
DELETE /metaforms/1 DELETE /metaforms/1.json
[ { "docid": "5b4e78a121a4fb2bbac98734df00f898", "score": "0.78998625", "text": "def destroy\n @metaform = Metaform.find(params[:id])\n @metaform.destroy\n\n respond_to do |format|\n format.html { redirect_to metaforms_url }\n format.json { head :no_content }\n end\n end", "titl...
[ { "docid": "de1a9f30b9c90bc799081110b81f6135", "score": "0.7359193", "text": "def delete_form(id)\n @client.raw('delete', \"/content/forms/#{id}\")\n end", "title": "" }, { "docid": "4a74fc6c8eab43cc17182029730bbe73", "score": "0.7162011", "text": "def destroy\n @adminmatrixst...
917bf2314add1dc69aec1dced1bbf985
lexer rule class! (CLASS) (in FoodLOOP.g)
[ { "docid": "60e56dd31eac9bf8b6aeb662554844f1", "score": "0.6503277", "text": "def class!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n\n\n type = CLASS\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\...
[ { "docid": "21e700193bb1c19bef3024bce47aec95", "score": "0.7449394", "text": "def class!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n type = CLASS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - -...
9a1a91a4c27bf1c1eac1c1d19a09e0c8
Metodo para verificar si el empleado que va registar el medico es externo o interno.
[ { "docid": "c09bc865198c5d8f81efcd83e910e32c", "score": "0.5514408", "text": "def verificar_empleado_externo?(user)\n unless user.nil?\n @employee = Employee.find_by(user_id: user)\n unless @employee.nil?\n puts user\n puts @employee.provider_provider_id.nil? \n @employ...
[ { "docid": "2efaade0a1301eafa8e3177c588ffc1f", "score": "0.6074028", "text": "def has_primo_as_external_system?\n @record.external_system.eql?(\"primo\")\n end", "title": "" }, { "docid": "38c1a999ee6e6cf2001abe822fa45e6d", "score": "0.59400356", "text": "def registrable?\n # ...
3f52973818698070d105a2c20fdb77a5
Serializes information the current object
[ { "docid": "0fc1d499e0fb522e6198528efcbc814a", "score": "0.0", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"performedBy\", @performed_by)\n writer.write_date_...
[ { "docid": "d162e297d0f84ca205afa381c3f6a428", "score": "0.782961", "text": "def serialize\n Marshal.dump(self)\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.7646631", "text": "def serialize(object) end", "title": "" }, { "docid": "...
fba8d9880bed12ca1d5a58fc68e68f6f
POST /courses_students POST /courses_students.xml
[ { "docid": "2d9e7183ab5138001207ae28fd2a3349", "score": "0.6824418", "text": "def create\n @courses_student = CoursesStudent.new(params[:courses_student])\n\n respond_to do |format|\n if @courses_student.save\n flash[:notice] = 'CoursesStudent was successfully created.'\n format...
[ { "docid": "7e5ffd1608699c8bae53d86377be5ee1", "score": "0.70051575", "text": "def users_students course_id\n call_path = \"users/students\"\n request = {\"courseID\": course_id}\n data = build_post_data(request.to_json)\n perform_post(build_url(call_path), data)\n end", "titl...
dab81e87d65ed70046eee60fe3a12fec
Check to see if there's a Dangerfile in the organisation, and run it if so
[ { "docid": "8859f3a5ed76c7f0bfd8878f14194b18", "score": "0.75163466", "text": "def check_and_run_org_dangerfile(dm)\n if dm.env.request_source.organisation && !dm.env.request_source.danger_repo? && (danger_repo = dm.env.request_source.fetch_danger_repo)\n url = dm.env.request_source.file_url...
[ { "docid": "8af8c8c8ed7807b0d3e102821538ddfa", "score": "0.62095404", "text": "def testing_dangerfile\n env = Danger::EnvironmentManager.new(testing_env)\n\n Danger::Dangerfile.new(env, testing_ui)\nend", "title": "" }, { "docid": "22a6ab56597c5391405ffb6889ffc878", "score": "0.6199918...
24fed7aac1d8c1c4f300001cefb3fb55
Defines accessor which sets value of Watir element instance. Method name is element name + "=". Note that custom block arguments are not used here.
[ { "docid": "d38f6c58e032ab4cdd6533fa9897aa10", "score": "0.74437976", "text": "def define_set_accessor(name, method, *args, &block)\n watir_args, custom_args = extract_custom_args(method, args)\n include(Module.new do\n define_method \"#{name}=\" do |*opts|\n element = ...
[ { "docid": "7f7a4892254328f8d1716886740b86ae", "score": "0.6914072", "text": "def value=(value)\n `#{@element}.value = #{value}`\n end", "title": "" }, { "docid": "069da454914a494c8b1f169227a777e0", "score": "0.67282057", "text": "def define_element_accessor(name, method,...
80d175eec3580895c552cdbfdf804426
Delete this image and all child objects
[ { "docid": "cf9b39b9df590cce068fb0be43acb6ac", "score": "0.6802572", "text": "def delete!\n begin\n image_builds.each do |build|\n build.delete!\n end\n rescue NoMethodError\n end\n Image.delete(@uuid)\n end", "title": "" ...
[ { "docid": "e57471cbc7e4d176ba238b8ec1f6425f", "score": "0.7350946", "text": "def destroy\n @image.destroy\n end", "title": "" }, { "docid": "9440c662080de1a1813e6f0cd45906e3", "score": "0.73416704", "text": "def destroy\n @item_image.destroy\n end", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "39be87ce157b7f64ab1225845ddcd3d3", "score": "0.0", "text": "def set_ticket\n @ticket = Ticket.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook;...
fba6dd7b3674f8fa6153eefd441d44a0
Returns a +Hash+ of properties that can be converted into a json string to make a _Sumac_ +null+ message component.
[ { "docid": "d016b9a3bf45496bbcc76dba5f97a37a", "score": "0.600002", "text": "def properties\n { 'object_type' => 'null' }\n end", "title": "" } ]
[ { "docid": "a334129db70d73f3109a1bf94a4638a8", "score": "0.6285022", "text": "def to_hash; @caesars_properties.to_hash; end", "title": "" }, { "docid": "3e92ead69ed6fe09e046d999cf28925a", "score": "0.6250061", "text": "def to_jaxb_json_hash\n _h = super\n _h['emailId'] = em...
ce96f6578b36fc16bad0d60a4d7aafe5
Return the command line argument list to be used. Replace this method when testing.
[ { "docid": "918b22692ace1619af422b085d4e7ff8", "score": "0.7323488", "text": "def argv\n ARGV\n end", "title": "" } ]
[ { "docid": "8bbeba6369b7ed3e8ef6f287c0492d01", "score": "0.76257944", "text": "def args\n parse_arguments(ARGV) if @args.nil?\n @args\n end", "title": "" }, { "docid": "59b6b3646c3f686ea74d13d7c4264005", "score": "0.7603177", "text": "def getCommandLineArguments\n _ch...
9b42ff508432000698793f28748ffb4f
Hook Shot action definition Trigger this tool
[ { "docid": "d5eafc28a48a93097d296fce761cdd26", "score": "0.671487", "text": "def hook_action\n if tool_canuse?(HweaponId) and not @showing_hook\n unless character_at_playerpos?\n @hookshot.each do |hook| \n hook.direction = @direction\n hook.moveto(@x, @y)\n hoo...
[ { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.7046048", "text": "def action_hook; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.7033157", "text": "def define_action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe...
d4ba320256a0a4960581be18b908de1e
Pick a server to handle the request based on a hash of the key.
[ { "docid": "1cdea21cad88a70f378ae3a0e93b525c", "score": "0.63619894", "text": "def get_server_for_key(key)\n # Easy enough if there is only one server.\n return @servers.first if @servers.length == 1\n\n # Hash the value of the key to select the bucket.\n hkey = key.hash\n ...
[ { "docid": "9220f02b8a3eab4293c19686805e052e", "score": "0.69341385", "text": "def pick_server(server)\n if server.is_a?(Hash)\n server\n else\n super\n end\n end", "title": "" }, { "docid": "45205819e85b8ffd8f156b8deb4c7ce9", "score": "0.6647188", "te...
2ac595bd68b6be5b35aa355d5805f98d
DELETE /fixtures/1 DELETE /fixtures/1.json
[ { "docid": "f656888ae9a00b1f3532d4f28440dbf1", "score": "0.7526504", "text": "def destroy\n @fixture.destroy\n flash[:danger] = \"Fixture Deleted.\"\n respond_to do |format|\n format.html { redirect_to admin_fixtures_path }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "a648a91651ad2556f120ffe4f0a225fe", "score": "0.78866434", "text": "def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.html { redirect_to fixtures_url }\n format.json { head :no_content }\n end\n end", "title": ...
fbfa957e506b87023febd038a35ef19e
Implementation of the storage increment method, as prescribed by the Throttling module.
[ { "docid": "e6a7fce91178340c243df0cb6342b0da", "score": "0.6160504", "text": "def increment(key)\n @redis.incr(key)\n end", "title": "" } ]
[ { "docid": "38929ad134706ba8a627433922bb7129", "score": "0.74288833", "text": "def increment(k, amount = 1, ignored_options = nil)\n storage.increment k, amount\n end", "title": "" }, { "docid": "df32dff57658ff3efa208978b1b6ad33", "score": "0.71983486", "text": "def increment\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "edd7227c3a2eb6d369f5cc54b9717050", "score": "0.0", "text": "def channel_city_params\n params.require(:channel_city).permit(:city, :panel_name, :background)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7123669", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.7054077", "text": "def expected_permitted_parameter_names; end", "title": ""...
6542e0bd313cefb8e2f1908cbfb06350
POST /instruments POST /instruments.json
[ { "docid": "e8bf085c7c89fee4793363cab417a8b7", "score": "0.5887145", "text": "def create\n @instrument = current_user.instruments.build(instrument_params)\n @instrument.image.attach(params[:instrument][:image])\n respond_to do |format|\n if @instrument.save\n format.html { redirect_...
[ { "docid": "9a8ad6d71c7fcfc414880ea4508712ff", "score": "0.6937109", "text": "def create\n p \"*******INST CREATE*********\"\n user = User.find_by(id: session[:user_id])\n instrument = user.instruments.build(instrument_params)\n if instrument.save\n render json: instrument, status: :cre...
22e662521b5e5dd83bb5df25102f5e35
=== add_official_titles Add OfficialTitles to the User.
[ { "docid": "fba517355c9023bdf046de5e40bf45ce", "score": "0.79402006", "text": "def add_official_titles\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n @user = User.find(params[:user_id])\n\n unless params[:official_titles].nil?\n para...
[ { "docid": "bb75c0b3c821705c916fc38171ad1c72", "score": "0.5961884", "text": "def add_to_page_title(*elements)\n @TITLE_ELEMENTS ||= []\n @TITLE_ELEMENTS += elements\n elements.first\n end", "title": "" }, { "docid": "79cdcf3c462b6c52503ea3d3017a72ec", "score": "0.571192", ...
e67eb4c3aaa705389ca58f1061f368fb
public instance methods ...................................................
[ { "docid": "5e53aecef62d459212b5ff076a54493b", "score": "0.0", "text": "def current_api_key\n api_keys.active.first || api_keys.create\n end", "title": "" } ]
[ { "docid": "40769f9969d33ad71cb2389a7e574114", "score": "0.77245784", "text": "def institucional\n\t\t\n\tend", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.75891304", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373a...
638f5a9f5b8a203f82622e9dd3b26266
Public: Get the Puppet version used to compile the catalog
[ { "docid": "f46a8805527198aa051f107f1f511436", "score": "0.7709802", "text": "def puppet_version\n @raw.puppet_version\n end", "title": "" } ]
[ { "docid": "5f20e9b7b95a4c99877aad06a44efdb6", "score": "0.8215424", "text": "def puppet_version\n @catalog_obj.respond_to?(:puppet_version) ? @catalog_obj.puppet_version : @options[:puppet_version]\n end", "title": "" }, { "docid": "bf6ef70220d6acd1349a080f97ba2536", "score": "0...
8d6f6431052b344c423fe0674f817369
Press the button down at the current mouse location. Does not release the button until the mouseup method is invoked.
[ { "docid": "92f942f2a80b15c8988ec887ccac94be", "score": "0.7140305", "text": "def mousedown(btn = 'left')\n not_supported('mousedown')\n end", "title": "" } ]
[ { "docid": "43a510654bda610118471656622a1443", "score": "0.79399186", "text": "def down(button: Button::LEFT, click_count: 1)\n @_button = button\n client.command(\n Protocol::Input.dispatch_mouse_event(\n type: 'mousePressed',\n button: button,\n x: @_x,\n ...
5dc2c23180939ae2d080f2a7a624ec77
Method: chooseTable Choose a table name from the metadata.
[ { "docid": "f0d1ea40fd09e772c3c5b175b5b70daf", "score": "0.84356165", "text": "def chooseTable\n @metadata.chooseTable\n end", "title": "" } ]
[ { "docid": "37e5c9c93d4183adba6e766019208418", "score": "0.6998255", "text": "def chooseTableAlias\n @metadata.chooseTableAlias\n end", "title": "" }, { "docid": "4e33f1d705427e0212f53c5af3c142bb", "score": "0.6337193", "text": "def table(table_id); Table.new(@opts, get(\"tables/...
fd1175a7ee5044437c603c14ef36023b
Assign resource with new values and store it in database as new record.
[ { "docid": "524d8c729e5884e5ad2a691288421bdd", "score": "0.58635896", "text": "def create(resource, params, authorizer)\n save __callee__, resource, params, authorizer\n end", "title": "" } ]
[ { "docid": "4366a1a6f3779a8448ceec3bad0f5410", "score": "0.70439327", "text": "def save\n if new_record?\n response = Codeplane::Request.post(resource_path, attributes)\n else\n response = Codeplane::Request.put(resource_path, attributes)\n end\n\n assign_at...
ec701703348f71d7f22f47d7d764b411
DELETE /keys/1 DELETE /keys/1.json
[ { "docid": "c534633b6bca88ffc465b530893fa160", "score": "0.68064094", "text": "def destroy\n key = Key.find(params[:id])\n if key\n key.destroy\n # FIXME Should be removed from hosts\n respond_to do |format|\n format.html { redirect_to keys_user_path(@key.user), notice: 'Key ...
[ { "docid": "d5da0743add603db185763bfd1498003", "score": "0.742433", "text": "def delete_key(key_id)\n start.uri('/api/key')\n .url_segment(key_id)\n .delete()\n .go()\n end", "title": "" }, { "docid": "266ff91b0c70838c2f07be7dce57dce5", "score": "0.7347...
643eccf947773328f47fef744bc7f3bf
Returns the excess memory in this memory bucket.
[ { "docid": "444817ac56d090ae0c7116ddd129766a", "score": "0.78956676", "text": "def excess\n if @total_memory\n @size_specified ? @size_specified - default_size : MemorySize::ZERO\n else\n MemorySize::ZERO\n end\n end", "title": "" } ]
[ { "docid": "1bf1f847981867926edb5a850e3215ec", "score": "0.6371972", "text": "def used_space\n size - free_space\n end", "title": "" }, { "docid": "ac1518129ea8683411c5daa988d57c1a", "score": "0.6296374", "text": "def memused\n @memtotal - @memfree\n end", "ti...
5a4936cc11d124747974fa8de2c9261d
POST /errquests POST /errquests.json
[ { "docid": "57fa7af1c74d409e0e50617ab01cac91", "score": "0.6803267", "text": "def create\n @errquest = Errquest.new(errquest_params)\n\n respond_to do |format|\n if @errquest.save\n format.html { redirect_to @errquest, notice: 'Errquest was successfully created.' }\n format.json...
[ { "docid": "e6bba4607278fd34b861433d67c36826", "score": "0.6166348", "text": "def set_errquest\n @errquest = Errquest.find(params[:id])\n end", "title": "" }, { "docid": "883b69db2479c4030f8b78a38e92e6a6", "score": "0.61281735", "text": "def test_create_fail_bad_request3\n ...
98fac3c30ae9c2471e53928fc5b554f9
% match : String > MatchData
[ { "docid": "9b579032ccde337cb5d5fca3b735da77", "score": "0.71938473", "text": "def match(p0) end", "title": "" } ]
[ { "docid": "98131226aa7b50922b264c811ba52183", "score": "0.8050286", "text": "def matchdata\n @matchdata\n end", "title": "" }, { "docid": "c08a8353c0909c6ca9150c12225f7a7d", "score": "0.721662", "text": "def match\n @match\n end", "title": "" }, { ...
c24c804fadd532b80ae9a74f68f4272d
Begin the series of transactions described by this bag management request.
[ { "docid": "fe5d024f29125fd68ec5ea1de0e987ac", "score": "0.0", "text": "def begin!\n ::Client::Repl::BagRetrievalJob.perform_later(self, Rails.configuration.staging_dir.to_s)\n end", "title": "" } ]
[ { "docid": "449f50742b386ed5f6996bb62b717753", "score": "0.64093894", "text": "def start_transaction\n @stats_engine.start_transaction\n end", "title": "" }, { "docid": "7108f175b239c00d2f5347a60c0bc30c", "score": "0.6407443", "text": "def begin_transaction\n @tr...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "d11af5f4adbcf8110a16b58be6c47db3", "score": "0.0", "text": "def conference_params\n params.fetch(:conference, {}).permit(\n :name,\n :start,\n :finish,\n :sale_from,\n :sale_to\n )\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"...
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b", "score": "0.0", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n ...
[ { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.7242611", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ...
357dd42d9ee800985c5f90ad7f0bad80
round the total fractional pennies if options[:comp_total] is set, 0.5 is rounded downwards.
[ { "docid": "0bc7d3828421e6ab903deced74d5e85a", "score": "0.7303926", "text": "def round_comp_total(total)\n if total % 1 == 0.5\n total.floor\n else\n total.round\n end\n end", "title": "" } ]
[ { "docid": "ce8a1552c417d6ac3da7e28b5a696cf8", "score": "0.59410274", "text": "def conv_price_total\n (price_total || 0).to_r.round(SK::Calc.precision)\n end", "title": "" }, { "docid": "591c030e9cddff2d5b19f5f15538552f", "score": "0.5893329", "text": "def calculate_total\n t ...
e1cc1e841efbdf4b8a43a4f14397f8a7
GET /adverts GET /adverts.json
[ { "docid": "7e4616f46b71e12895cb042f8c9a8258", "score": "0.0", "text": "def index\n if category_exists?\n @adverts = Advert.where({category:params['category']}).order(created_at: :desc)\n else\n @adverts = Advert.all.order(created_at: :desc)\n end\n end", "title": "" } ]
[ { "docid": "5c786380f0bf3538f0837ad888b37c65", "score": "0.7539831", "text": "def index\n @adverts = Advert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @adverts.map(&:attributes) }\n end\n end", "title": "" }, { "docid": "e2a...
b9400e4f0d538e611704ca2d53c62ebd
Log an `ERROR` entry.
[ { "docid": "d0e0736611484a406a0d9bb0262922b2", "score": "0.0", "text": "def error message = nil, &block\n if block_given?\n add ::Logger::ERROR, nil, message, &block\n else\n add ::Logger::ERROR, message\n end\n end", "title": "" } ]
[ { "docid": "65c8d68038b5ee8ba5690db6cf9d4c8a", "score": "0.7664618", "text": "def error(msg) log(ERROR, \"ERROR \" << format(msg)); end", "title": "" }, { "docid": "fa3a0dbc0e06893588a906bcb02095fe", "score": "0.7590005", "text": "def error(*args); log(ERROR, *args); end", "title...
a2af5985c26eb659d782ce9078e80c32
Invokes a layout view (i.e., a view from the layouts template directory), using the assigns parameter to define instance variables for the view. The block is evaluated and also passed into the view as the +layout_content+ instance variable. You can define a layout just by creating a template and then calling the +layou...
[ { "docid": "6a6fc20d46d2126ace24414d2fbf22ff", "score": "0.75156176", "text": "def layout( name, assigns = {}, &block )\n assigns[ :layout_content ] = capture(&block)\n self << app::Views[:layouts].process( request ) do\n send( name, assigns )\n end\n end", "title"...
[ { "docid": "c3f1373c76b76367dd1bd4d4bf19bdd6", "score": "0.6889848", "text": "def inside_layout(layout, &block)\n layout = layout.to_s\n layout = layout.include?('/') ? layout : \"layouts/#{layout}\"\n @template.instance_variable_set('@content_for_layout', capture(&block))\n concat (\n ...
32c481466edfe15bbbcec3e0ea1dab04
Marks the entire flash or a single flash entry to be discarded by the end of the current action: flash.discard discard the entire flash at the end of the current action flash.discard(:warning) discard only the "warning" entry at the end of the current action Use this method when you want to display the message in the c...
[ { "docid": "87fb39b962a985c58633cd086eb882b5", "score": "0.0", "text": "def discard(k = nil)\n k = k.to_s if k\n @discard.merge Array(k || keys)\n k ? self[k] : self\n end", "title": "" } ]
[ { "docid": "9376d4338ee6c6da83077ab4be1a0a3b", "score": "0.74254864", "text": "def discard_flash\n flash.discard\n end", "title": "" }, { "docid": "e3d56f91e0cff7a22e34436e349c017c", "score": "0.6808019", "text": "def hide_flash(key)\n discard_header = response.headers['...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9a9f78cf925ef024e9e72c5f11aebd4e", "score": "0.0", "text": "def coffee_type_params\n params.require(:coffee_type).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "6494d3d63105df7f041f836fb54d525a", "score": "0.0", "text": "def promote_params\n params.require(:promote).permit(:name, :description, :image, :category)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496024", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69581187", "text": "def strong_params\n params.require(:request).permit(param_whit...
1c6306ccc545fcfa0d30d55afb76112d
GET /posts/new GET /posts/new.json
[ { "docid": "540e26ec2082baa58c36a1b4edb21683", "score": "0.8041974", "text": "def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end", "title": "" } ]
[ { "docid": "78c0f5caba07a51e63ee382cdb515af9", "score": "0.80156785", "text": "def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "a69a4d49f6c45783c79dad1572c3...
b605d0f026e51620dcf9857d09716691
GET /references or /references.json
[ { "docid": "192c8d2e4ad246e2777ab975ff08e456", "score": "0.686017", "text": "def index\n @references = Reference.all\n end", "title": "" } ]
[ { "docid": "9a67374a8200a122d44fbc0384472fab", "score": "0.7351259", "text": "def index\n @references = Reference.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @references }\n end\n end", "title": "" }, { "docid": "8e6d6d0b4d55...
9a3138faa298ec1670c02ab52d3592bc
rule 'add_operator' => 'MINUS'
[ { "docid": "2b6c2adfa7e5e34784b0467d9a14aba9", "score": "0.5848974", "text": "def reduce_add_operator_1(_production, _range, _tokens, theChildren)\n return CalcSubtractNode.new(theChildren[0].symbol)\n end", "title": "" } ]
[ { "docid": "10ba6fdab985825c7e223cff264933c0", "score": "0.68455744", "text": "def unary_minus; end", "title": "" }, { "docid": "10ba6fdab985825c7e223cff264933c0", "score": "0.68455744", "text": "def unary_minus; end", "title": "" }, { "docid": "eb95cc871bd1e8d71636c9ed79...
035075843dbd13d01ff109e348503b74
Advances to the next token, safely ignore return value if not needed.
[ { "docid": "35a3b32c4af7aaf207f5e5638f89558c", "score": "0.7445779", "text": "def advance\n @lookahead = next_token()\n end", "title": "" } ]
[ { "docid": "f53e793aea7dc680f306c4166bbefa20", "score": "0.7997565", "text": "def next_token\n tokens.shift\n end", "title": "" }, { "docid": "7d194f025dd81fed5b279471dfd946c4", "score": "0.79694647", "text": "def next\n token = next_token\n token = next_token while tok...
c2350108c1b0d888db1f63034445b308
define what happens when the measure is run
[ { "docid": "5adec94624e455cb105c19e750d10d61", "score": "0.61319697", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\...
[ { "docid": "3aed6bf09d049db487e1bed466e2a5b5", "score": "0.79848564", "text": "def measure; end", "title": "" }, { "docid": "13b5a61b24409f671a1b39a8a7599881", "score": "0.7639647", "text": "def measure=(_arg0); end", "title": "" }, { "docid": "8780f5b0874ee15c5ec2fff5454...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2cfd6f8d3b63ccdf037157876239dfc5", "score": "0.0", "text": "def anime_params\n params.require(:anime).permit(:title, :episode, :season, :summary, :img_url)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74939764", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6955084", "text": "def strong_params\n params.require(:request).permit(param_whit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a40c199320de3541c4d8eaee87d65ba8", "score": "0.0", "text": "def record_params\n params.require(:record).permit(:email)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69795185", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782116", "text": "def strong_params\n params.requ...
a4dd2a3242a7d4c9dc405661a77c8b16
Check the credit of image to see if it is copyrighted.
[ { "docid": "10e5da232396352618ad7da273d9bff1", "score": "0.85737234", "text": "def is_image_copyrighted(image_credit)\n\tis_copyright = false\n\tif image_credit.downcase.include? 'copyright'\n\t\tis_copyright = true\n\tend\n\n\treturn is_copyright\nend", "title": "" } ]
[ { "docid": "401c4ca581d01cbf025344033ced2842", "score": "0.7309647", "text": "def copyright?\n return false unless is_a?(LicenseFile)\n return false unless matcher.is_a?(Matchers::Copyright)\n\n filename =~ /\\Acopyright(?:#{LicenseFile::OTHER_EXT_REGEX})?\\z/io\n end", "ti...
653486630fc7f630aa4004772f56de91
GET /exports/new GET /exports/new.json
[ { "docid": "2b8b85f0234c19538d21c8db453e627e", "score": "0.72885793", "text": "def new\n @export = Export.new\n @dbs = get_dbs\n @tables = db_metadata\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @export }\n end\n end", ...
[ { "docid": "7aa7f30f96910199ded930d66b63e75f", "score": "0.71196485", "text": "def new\n @export_record = ExportRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @export_record }\n end\n end", "title": "" }, { "docid": "553468...
3a9ae47783c8f60eff3a03bceb049a02
GET /peladas GET /peladas.json
[ { "docid": "3b6b791e6ef09212cb5cf0915e6c25d7", "score": "0.0", "text": "def index\n @peladas_grid = initialize_grid(Pelada, \n :include => [:usuario], \n :order => 'peladas.local',\n :order => 'peladas.minimo_pessoas',\n :order => 'peladas.data',\n :order => 'peladas.maximo_pesso...
[ { "docid": "a48a033a788fdebb2a77104f36901d8c", "score": "0.77591425", "text": "def index\n @pessoas = Pessoa.all\n render json: @pessoas\n end", "title": "" }, { "docid": "51ea57fcafe28ace1ac99853d21ecc72", "score": "0.73456234", "text": "def show\n render json: @pessoa\n ...
8bede0ac0c63320fe4e731ee8f4ac524
In the parent process: read data from the fork. In the forked process: read data from the parent. Works just like IOread_nonblock.
[ { "docid": "701dfca6e9ca5fc2a50a756826fad77c", "score": "0.6777692", "text": "def read_nonblock(*args)\n @readable_io.read_nonblock(*args)\n rescue NoMethodError\n raise NotRunning, \"Fork is not running yet, you must invoke #execute first.\" unless @pid\n raise FlagNotSpecified, \"You must se...
[ { "docid": "99850b371fc13f5ad96d0132b2e5deab", "score": "0.72539306", "text": "def call(*, **, &block)\n pid = fork_and_return_pid(&block)\n write.close\n result = read.read\n Process.wait(pid)\n\n # rubocop:disable MarshalLoad\n Marshal.load(result)\n # rubocop:enable...
4edb832d9d3637caf7bb8493c286c16a
should only be accessed by an API call.
[ { "docid": "5edfb5274166ac9afca4e0d92d97c2ae", "score": "0.0", "text": "def create\n\n token_params ={\n user_id: auth_user.id,\n platform_type: params[:type],\n token: params[:device]\n }\n\n unless ::Users::UserNotificationToken.where(user_id: auth_user.id, platform_type: param...
[ { "docid": "f8877e8a5e4afd637fc06584527bff92", "score": "0.6594611", "text": "def api\n raise NotImplementedError\n end", "title": "" }, { "docid": "07b7ecb7f05badb14700b65a293f27dc", "score": "0.64962023", "text": "def request_call; end", "title": "" }, {...
16bd9046422c203b763dc2b111b05ab0
Create HP Number Max
[ { "docid": "6890c1e38fd3b85ac376fe727c654b67", "score": "0.7487588", "text": "def create_hp_number_max(viewport)\n return if !HP_NUMBER_MAX_VISIBLE\n @hp_number2 = Sprite.new\n @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)\n @hp_number2.z = HUD_Z + HP_NUMBER_Z\n ...
[ { "docid": "5ab0203836ecaf5f38c6978262a6f664", "score": "0.7721667", "text": "def max_hp\n end", "title": "" }, { "docid": "e4d2e712ecd2d943d748c61e07ed4c91", "score": "0.7696387", "text": "def create_hp_number_max\r\r\n return if !HP_NUMBER_MAX_VISIBLE\r\r\n @hp_numbe...
b9cbecc58eacc93c894c5a06770266fe
def print(str=nil) super(str.to_s) unless quiet? end def puts(str=nil) super(str.to_s) unless quiet? end TODO: Deprecate one of the three report, status, trace.
[ { "docid": "9e31184ac6cd822d53e27447b2c2aaef", "score": "0.6441206", "text": "def report(message)\n #@_stdout.puts(message) unless quiet?\n puts(message) unless quiet?\n end", "title": "" } ]
[ { "docid": "d58183d540756713d92e8d78ceff2299", "score": "0.78170145", "text": "def puts(o, override: false)\n if $debug_print || override\n super(o)\n end\nend", "title": "" }, { "docid": "ef8c8b6bbae3bcc6b74feb1d50cf9cd3", "score": "0.78052765", "text": "def puts(arg)\n supe...
092bfa9a359062684ffef5dbf9c780fb
returns either nil or text
[ { "docid": "59d6629832605908886fc68c3844db72", "score": "0.0", "text": "def get_title\n\t\twid = ENV['WINDOWID']\n\t\treturn nil unless wid\n\t\toutput = ''; \n\t\tIO.popen(\"xprop -id #{wid}\") do |io| \n\t\t\twhile s=io.gets; output << s; end \n\t\tend\n\t\tm = output.match(/^WM_NAME\\(STRING\\) = \"(...
[ { "docid": "3bfc7bf17ed03ba389da73c17a0e4277", "score": "0.7893499", "text": "def text?; end", "title": "" }, { "docid": "3bfc7bf17ed03ba389da73c17a0e4277", "score": "0.7893499", "text": "def text?; end", "title": "" }, { "docid": "d506fa7a8f9812d565b608daa6c12cb7", "...
c0def65567a191c61c346784a1a0f8cb
won method : returns true if there is a winner; else if not
[ { "docid": "104a61147ee2fd332d18e0a08e77a693", "score": "0.7600273", "text": "def won?()\n\n # loops through the 2D array WIN_COMBINATIONS\n WIN_COMBINATIONS.each do |combination|\n\n # flags\n x_win = 0\n o_win = 0\n\n combination.each do |index|\n\n # che...
[ { "docid": "a7d4f1811d1d5c450fb37a3083d5606c", "score": "0.8350968", "text": "def someone_won?(brd)\n !!detect_winner(brd)\n end", "title": "" }, { "docid": "99096a1dc4dff71a3931513d8d5cf287", "score": "0.8118858", "text": "def won?()\r\n\t\twin_game = false\r\n\t\t\r\n\t\tif()\r...
ad9333bf42ad434b7a639cdf4af13853
PUT /reminders_mains/1 PUT /reminders_mains/1.xml
[ { "docid": "aeb4cc5ed09b1af651fc296ad6a43586", "score": "0.710331", "text": "def update\n @reminders_main = RemindersMain.find(params[:id])\n\n respond_to do |format|\n if @reminders_main.update_attributes(params[:reminders_main])\n format.html { redirect_to(@reminders_main, :notice =>...
[ { "docid": "81b2154722ae5f9eda346cb52a3d4f30", "score": "0.625929", "text": "def update\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n if @reminder.update_attributes(params[:reminder])\n format.html { redirect_to(@reminder, :notice => 'Reminder was successfully u...
55959286555db49dcbecadff805a94dd
makes an inclusive date range from departure date to return date
[ { "docid": "8bb76a6e44a7289cb532033ce6d01025", "score": "0.8073176", "text": "def date_range\n Range.new(departure_date, return_date)\n end", "title": "" } ]
[ { "docid": "a85145402e7399157140df4cfa127efe", "score": "0.71534437", "text": "def create_hotel_range(start_date, end_date)\n end_date = end_date - 1\n range = (start_date .. end_date)\n return range\n end", "title": "" }, { "docid": "d38901656e65e4afdbdfcaec450ec630", "score":...
3a804b548fa9721db99b11ee5365a024
PATCH/PUT /my_threads/1 PATCH/PUT /my_threads/1.json
[ { "docid": "f4c33a014b6a17bcb438b06320143672", "score": "0.640248", "text": "def update\n respond_to do |format|\n if @my_thread.update(my_thread_params)\n format.html { redirect_to @my_thread, notice: 'My thread was successfully updated.' }\n format.json { render :show, status: :o...
[ { "docid": "dfb14f20be9f310d10c299fe0c7887da", "score": "0.71741635", "text": "def update_thread(conversation_id:, thread_id:, op:, path:, value:)\n body = {}\n body[:op] = op\n body[:path] = path\n body[:value] = value\n\n patch(\"conversations/#{conversation_id}/threads/#{thread_id}\", ...
fec9786994ce7e9a0dd7d8fb41959acd
Expect a model to be created with the given attributes.
[ { "docid": "a8dc7c4ef8b4e6fb1d324e1c7975e294", "score": "0.7027135", "text": "def expect_creation(model, attrs, invalid=nil)\n klass = attrs.delete(:class) || model.class\n flexmock(model, :id => CommonTestUtilities.next_id)\n flexmock(klass).should_receive(:create).\n with(member_attrs).o...
[ { "docid": "db5b5c024ea1b9ea45e0874ed2102a0c", "score": "0.720545", "text": "def create_model\n # binding.pry # if model_values.nil?\n self.model = klass.create(model_values)\n rescue ActiveModel::UnknownAttributeError => e\n puts \"Err: #{e.message}\"\n end", "title": "" }, ...
f0829505605606b04f0feb478b8c311d
PSEUDOCODE Diego INPUT: "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" OUTPUT: "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" create a method that takes a sentence as an argument
[ { "docid": "d7fa56ce5a0cb9a0e36b1448763b9cb5", "score": "0.0", "text": "def encrypt(sentence, shift_number = -3)\n # create an array containing the alphabet and store in variable\n alphabet = (\"A\"..\"Z\").to_a\n encrpyted_sentence = []\n # Split the sentence into characters\n # iterate over each ...
[ { "docid": "40ae5fe7006163bdb8ef6dac7c06ac26", "score": "0.683377", "text": "def sentence_maker(string)\n sentence = \"\"\n string.each do |word|\n sentence += word.to_s + \" \"\n end\n return full_sentence(sentence)\n end", "title": "" }, { "docid": "f967d24342ce890d25cb84ea4cf677...
df20286f4cd5d6cd377fc7d7a383f16b
Return aggregate information of all migration unit groups Return information of all migration unit groups in the migration plan. If request parameter summary is set to true, then only count of migration units will be returned, migration units list will be empty. If request parameter component type is specified, then al...
[ { "docid": "32cfd3c9929b41853a3ddb20e4e65028", "score": "0.5562867", "text": "def get_migration_unit_group_aggregate_info(opts = {})\n data, _status_code, _headers = get_migration_unit_group_aggregate_info_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "3e010e665b726c74535a16ed0e05419b", "score": "0.6939076", "text": "def get_migration_unit_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiMigrationGroupApi.get_migration_unit_groups ...'\n en...
b0c621c9987a07d3ac89046118a0e012
Edit a document Edit metadata of a specific document.
[ { "docid": "6908086e88b2ce88f21cfbb37ca67e40", "score": "0.0", "text": "def users_id_user_accounts_id_account_transactions_id_transaction_documents_id_document_put(id_user, id_account, id_transaction, id_document, opts = {})\n data, _status_code, _headers = users_id_user_accounts_id_account_transac...
[ { "docid": "35f58f2fe5af061beb687f474934a3de", "score": "0.73370755", "text": "def edit_metadata\n not_authorized if Revs::Application.config.disable_editing == true\n @document=SolrDocument.find(params[:id])\n updates=params[:document]\n updates.each {|field,value| @document.send(\"...
eb86ae83b6d107728f670acb010421d1
Scrub sensitive parameters from your log filter_parameter_logging :password
[ { "docid": "1087616a6a4c47f91a10bff914499689", "score": "0.0", "text": "def current_user\n @g_user ||= get_logged_in_user\n @g_user\n end", "title": "" } ]
[ { "docid": "7a54048117803b08ea1002bd771bae99", "score": "0.7118054", "text": "def filter_secrets(msg)\n case type\n when :username_password then msg.gsub(password, '****')\n else msg\n end\n end", "title": "" }, { "docid": "4090378d23d7b03c053a48f1971877ee", "score...
87cc0526e1186aedd6d3524166eda5c4
=begin rdoc we needed something handy to write several lines into a single label, so we provide an array with hashes inside, each hash must contain a [:text] key and could contain optional parameters such as :justification, and :font_size if not DEFAULTS options are used. =end
[ { "docid": "e4986a2e17429f7b9a84b2894c7e2b2e", "score": "0.6417246", "text": "def add_multiline_label(content = [], position = 0)\n opts = {}\n content.each_with_index do |options, i|\n options = DEFAULTS.merge(options)\n if i.zero?\n opts = options\n ...
[ { "docid": "98e4ef18476174a2bbae731a58446a65", "score": "0.6650701", "text": "def label(x, y, text, attributes = nil)\n %[<text font-size=\"#{FONT_SIZE}\" font-family=\"Verdana\" fill=\"#333333\" text-anchor=\"middle\" x=\"#{x}\" y=\"#{y + FONT_SIZE / 2}\"#{' ' + attributes if attributes}>#{tex...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "758032d8d25e505fa364ce33b605d458", "score": "0.0", "text": "def photo_params\n params.require(:photo).permit(:image, :exif_at, :user_id, :album_id, :title, :last_comment_at, :description)\n end", "title": "" } ]
[ { "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...
248ffe993a9082c0fb97a9f00e741ee4
POST /rsources POST /rsources.json
[ { "docid": "86a769c063dc73f103bdec7525422680", "score": "0.70192534", "text": "def create\n @rsource = Rsource.new(rsource_params)\n\n respond_to do |format|\n if @rsource.save\n format.html { redirect_to @rsource, notice: 'Rsource was successfully created.' }\n format.json { re...
[ { "docid": "2eb2fe28523405f71ebd37db2bbccfc4", "score": "0.7381164", "text": "def create_sources( source_array )\n log_message( \"Creating sources from JSON data...\" ) unless @logging == false\n resp = @connection.post( \"source\", source_array )\n JSON.parse(resp) \n end", "title": "" ...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "f0ff79d474b4d3d5b9687d897ed56ca8", "score": "0.0", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.67215014", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.67215014", "text": "def hash\n [value].hash\n end", "title": "" }, { "d...
2a50aa7d41de776740ff8bffaead0288
New. Returns an array of TP Max state ID's
[ { "docid": "518e7aedeb6e5a9eba67d19e150edc82", "score": "0.6037774", "text": "def param_max_states(type)\n []\n end", "title": "" } ]
[ { "docid": "ebf2810cf8ae2f77d32acfdfb71566d1", "score": "0.7563749", "text": "def tpmax_states\n []\n end", "title": "" }, { "docid": "d4a11a0cb9de5cedefa4b9a255d28501", "score": "0.67013484", "text": "def add_tpmax_states\n tpmax_states.each do |id|\n add_state(id)\n ...
c41bf37c8473a75f33e3f059f02ed4dd
Locates the service corresponding to the given path.
[ { "docid": "f96ecf46cd4a38ac3df2dcbce6aaaa16", "score": "0.0", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return weight_service(path)\n end\n return weight_service(path[0..(index - 1)...
[ { "docid": "e8e807e295b3bc4c300490e3f7c21425", "score": "0.7272553", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return operating_system_service(path)\n end\n return operating_system_s...
0ab6763355e7962a6baf60be9d5ed0bd
Zip the input directory.
[ { "docid": "2b9c96836621f03255aeeeb7a85203f4", "score": "0.59857285", "text": "def write\n entries = Dir.entries(@input_dir); entries.delete(\".\"); entries.delete('..')\n io = Zip::File.open(@server_pack_file, Zip::File::CREATE)\n write_entries(entries, '', io)\n io.close\n end", "titl...
[ { "docid": "498cc22d69e8dd9a1a7272e3f3139c68", "score": "0.8066838", "text": "def zip(input_dir, output_file)\n entries = Dir.entries(input_dir) - %w(. ..)\n\n Zip::File.open(output_file, Zip::File::CREATE) do |zipfile|\n write_entries input_dir, entries, '', zipfile\n end\n end", "ti...
af680224e5fd83a8faa03b7f933fc330
Using the block form has the added advantage of catching the exceptions that could be raised by Net::HTTP for you, otherwise you will have to handle those yourself.
[ { "docid": "302fd13f49047e1de45335954dadfd10", "score": "0.0", "text": "def conn\n @conn ||= connect\n if block_given?\n yield @conn\n else\n @conn\n end\n rescue *HttpExceptions\n @conn = nil\n retry if (retried = !retried)..retried\n # raise $! # XXX...
[ { "docid": "b114d40b89351bd0bc756eff36103713", "score": "0.69100004", "text": "def perform_request(&block)\n begin\n block.call\n rescue RestClient::Exception => e\n message = if e.http_body.strip.empty?\n e\n else\n message = [\"Exception:\"]\n ...
6a0563c172e3a8c682065d6d83a760b9
check that the file is a tempfile object
[ { "docid": "29a1e12a726a915a9cb4806cdc5eea64", "score": "0.65765136", "text": "def check_file(file)\n log \"FCKEDITOR ---- CLASS OF UPLOAD OBJECT: #{file.class}\"\n\n unless file.class.to_s == \"Tempfile\" || file.class.to_s == \"StringIO\"\n @errorNumber = 403\n throw Exception.new\n ...
[ { "docid": "a08681eb7533935bd46611c209138843", "score": "0.74472994", "text": "def file_backed?\n @tempfile_in\n end", "title": "" }, { "docid": "8cfd58c8529671b8146d0361dad1a2d8", "score": "0.6927423", "text": "def tempfile?(source_path)\n tempfiles.any? {|tempfile| tempfil...
512543577e2cf23a91bcf5782f1942a0
PUT /tunneling_unders/1 PUT /tunneling_unders/1.xml
[ { "docid": "ee50868426f379872954b578e94186fc", "score": "0.65397024", "text": "def update\n @tunneling_under = TunnelingUnder.find(params[:id])\n\n respond_to do |format|\n if @tunneling_under.update_attributes(params[:tunneling_under])\n flash[:notice] = 'TunnelingUnder was successful...
[ { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.61171", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-t...
4a8975b8a2c613ded3efc019a46535ce
Question 5 How could the unnecessary duplication in this method be removed?
[ { "docid": "7ba9e433fd73c32b67fd5aaeb0749a0d", "score": "0.0", "text": "def color_valid(color)\n if color == \"blue\" || color == \"green\"\n true\n else\n false\n end\nend", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.66181326", "text": "def private; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.62985367", "text": "def anchored; end", "title": "" }, { "docid": "65868f3890b7055ca6fbf5f330690d03"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e3ec86ee22448910ade683e54a494e5e", "score": "0.0", "text": "def cache_params\n params.require(:cache).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74964964", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957765", "text": "def strong_params\n params.require(:request).permit(param_whit...
6c6587f76b04a03d28e9c23b47fd012c
this is added for authenticate user before go to inside app the action home of controller welcomecontroller is created
[ { "docid": "25c5ec23805311a4eb2c6d4334d0cf5c", "score": "0.0", "text": "def home\n\t@post = Post.all\n\t@user = User.all\nend", "title": "" } ]
[ { "docid": "1f5e3d12aba4c4907eb4ee069849e89a", "score": "0.74521756", "text": "def authenticate1\n if @current_user\n puts \"welcome\"\n redirect_to welcome_path\n else\n redirect_to log_in_path\n end\n end", "title": "" }, { "docid": "0b6dd8116c2280702d2e1381d331278...
31c3dc815f2b6ab121287ce6ce0a5b1d
Returns the current language code portion from locale (parameter or default)
[ { "docid": "3aec5b1fdcc143acb3877bd45a1aed7c", "score": "0.8447438", "text": "def current_language_code(locale=nil)\n Utility.language_code(locale)\n end", "title": "" } ]
[ { "docid": "fc58406bffa87b0da84486269557834f", "score": "0.81824315", "text": "def current_locale_code\n Utility.locale_code\n end", "title": "" }, { "docid": "6a4be73a2592908612f1f3e868cc7604", "score": "0.7954145", "text": "def language_code\n return nil if locale.nil?\n ...
21f52a76b8cc713fc043f8f9269f661d
Overriding this method to make "title" visible as "Name". This is called in forms to create error messages.
[ { "docid": "6ca77639850b2317015e84f9f3d67295", "score": "0.0", "text": "def human_attribute_name (attr)\n return case attr\n when 'title' then 'Name'\n else super.human_attribute_name attr\n end\n end", "title": "" } ]
[ { "docid": "2be8a5183f4a56ef4542dcf1bd5bd906", "score": "0.73409474", "text": "def form_title(title = -1)\n @form_title ||= self.superclass.form_title if is_kvo_subclass?\n @form_title = title if title != -1\n @form_title\n end", "title": "" }, { "docid": "7e1ea7ba4...
d540e6f54fc8aaf7e946f623947d2550
Runs a command === Required :command command to run :command command to run === Optional :params parameters for the command :cookie cookie, if the command requires it
[ { "docid": "1f0fba30c45e0248c0cc979b2c28b135", "score": "0.0", "text": "def run_command(action, object, params = {}, cookie = nil)\n cmd = Command.new(action, object, params, cookie)\n\n try_opensrs do\n result = cmd.run(@host, @key, @user, @port)\n Response.new(result, p...
[ { "docid": "4c65ee28d3b8fda24b60526cb1513af0", "score": "0.6963076", "text": "def run(command, *params)\n \n Rails.logger.info \"Shell command #{cmd}\"\n \n \n end", "title": "" }, { "docid": "7d8886dc3b75054ac3016df334142294", "score": "0.68627703", ...
c955cfc6b3c1ffcf278d2d6e0b35212d
POST /clients POST /clients.json
[ { "docid": "9f3086f14afbe214724390a2258700cb", "score": "0.6770246", "text": "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save(params[:client])\n format.html { redirect_to clients_path, notice: 'Clientul a fost creat cu success.' }\n ...
[ { "docid": "463c7897bc343b5c33ded0eb3d7c38a8", "score": "0.7867169", "text": "def create\n http_api.post(\"clients\", self)\n end", "title": "" }, { "docid": "84186d209e6b5dca2e0c8146b546a058", "score": "0.7761909", "text": "def create_client(params={})\n post('/clients', ...
c94f41bf15075683b35b668cc9cf4176
helper methods to conditionally guard individual tests by platform
[ { "docid": "467e498fe8e6fbdb08f64e8a5162e382", "score": "0.575397", "text": "def linux?\n %w(debian redhat ubuntu).include?(os[:family])\nend", "title": "" } ]
[ { "docid": "26b2bee70fcb236e006d1e985ebde417", "score": "0.74655646", "text": "def on_os_under_test\n on_supported_os.reject do |os, facts|\n (only_test_os() && !only_test_os.include?(os)) ||\n (exclude_test_os() && exclude_test_os.include?(os))\n end\nend", "title": "" }, { "doc...
b7d4ea71a0a93484cf2a96442263281a
Override in tests if you want different numbers
[ { "docid": "3258b3552b49006b846281c25824b132", "score": "0.0", "text": "def delay_before_streaming_logs\n 30\n end", "title": "" } ]
[ { "docid": "c569a01807ce3b1c1dd05b0439bd6177", "score": "0.6693705", "text": "def / numeric\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c569a01807ce3b1c1dd05b0439bd6177", "score": "0.6693705", "text": "def / numeric\n #This is a stub, used...
e7eb8b052bbaed1782d45a2a48fa373b
Initialize the hint servers. Recursive queries need a starting name server to work off of. This method takes a list of IP addresses to use as the starting servers. These name servers should be authoritative for the root (.) zone. res.hints=(ips) If no hints are passed, the default nameserver is asked for the hints. Nor...
[ { "docid": "228f59a3f057595403a094008215e79f", "score": "0.49584833", "text": "def hints=(hints)\n Recursor.set_hints(hints, @resolver)\n end", "title": "" } ]
[ { "docid": "d9727da548fd6bd88b83784bc193afc6", "score": "0.59405136", "text": "def setup_query_servers\n @servers = []\n\n if @single_server\n @servers << @single_server\n else\n @servers = ['8.8.8.8', '8.8.4.4']\n end\n end", "title": "" }, { "docid": "2560c9132e25570...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f67153b35e7adc8fa8867cc8a867f95e", "score": "0.0", "text": "def albumsix_params\n params.require(:albumsix).permit(:title, :avatar, :user_id)\n end", "title": "" } ]
[ { "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...
be7f4e167bc60886fced2cf87ae80346
Generates a hash value for this object.
[ { "docid": "78c9eb90f4992b0d2e3b71f9d6becbc5", "score": "0.0", "text": "def hash\n super +\n @available.hash +\n @backup.hash +\n @committed.hash +\n @critical_space_action_blocker.hash +\n @data_center.hash +\n @data_centers.hash +\n @discard_after_delete.hash +\...
[ { "docid": "39b15da071a5d18e77c7674f9a946414", "score": "0.7402406", "text": "def hash\n @hash || calculate_hash!\n end", "title": "" }, { "docid": "dcd2d2a7b8b5351f882af58dc9101795", "score": "0.73919034", "text": "def hash\n @hash ||= _calculate_hash\n end", "title"...
e3eb02b02434c0eaf209940a3bfc9e2e
KEY = "lili_925" DES_KEY = "feifan_5"
[ { "docid": "633fefaa7ebc3aff847732ecb9ae45ca", "score": "0.0", "text": "def encode(str,key,des_key)\n des = OpenSSL::Cipher::Cipher.new(ALG)\n des.pkcs5_keyivgen(key, des_key)\n des.encrypt\n cipher = des.update(str)\n cipher << des.final\n return Base64.encode64(cipher) #B...
[ { "docid": "5393567d7bc18c46eee36dd100002500", "score": "0.67633164", "text": "def generate_key_pair\n cipher = OpenSSL::Cipher::Cipher.new('des3')\n rsa_key = OpenSSL::PKey::RSA.new(2048)\n {\n private_key: rsa_key.to_pem(cipher,'password'),\n public_key: rsa_key.public_key.to_pem\n ...
4e36e1464cf61be056fb90a6cd1cd7fc
Provide user a list of cookbooks in COOKBOOK_DIR to upload with berks.
[ { "docid": "04791aae4d22944e726429b05f49bfc8", "score": "0.0", "text": "def launch_cluster_menu()\n question = \"Launch a cluster\"\n unless ENV['COOKBOOK_DIR']\n agree(\"Aborting. You must set the environment variable COOKBOOK_DIR. Would you like to exit the wizard?\") do |answer|\n ...
[ { "docid": "ecd6f0acbc52030193c22e4fda4c699b", "score": "0.75820917", "text": "def upload_cookbooks!\n loader = Chef::CookbookLoader.new(Chef::Config[:cookbook_path])\n loader.load_cookbooks\n\n uploader = Chef::CookbookUploader.new(loader.cookbooks, loader.cookbook_paths)\n uploader...
5a0a5eed7643213a6316df0592237417
steps one and two won't run in computer's first turn 1. Computer first checks if it goes for the win otherwise continue 2. Computer checks if it needs to defend 3. otherwise Find an empty corner 4. on the computer's second turn it will see if it needs to do step 1 or 2 otherwise it chooses a corner cell computer will g...
[ { "docid": "554b2b9b39fb4ce1e7f5ab0ccbfc38ac", "score": "0.0", "text": "def move(board)\n\t\tif(board.cells[4] == \" \")\n\t\treturn final_cell_move =\t\"5\"\n\t\telse\n\t\t\tif(attack_against_opponent(board) != nil)\n\t\t\t\t return final_cell_move = attack_against_opponent(board)\n\t\t\telsif(defend_a...
[ { "docid": "284a8bb85e6b2e88f227baa5f2a48563", "score": "0.7334728", "text": "def win(board, marker)\n\t\t#horizontal top\n\t\tif board[0] && board[1] == marker\n\t\t\tboard[2] == perfect_move\n\t\telsif board[0] && board[2] == marker\n\t\t\tboard[1] == perfect_move\n\t\telsif board[1] && board[2] == ma...