query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
9f178f463280e093d2017fdf960b0fa7
Returns the IDs of the current set of clients.
[ { "docid": "f48c00cafa18e2ed5e58ec3173dcbfd9", "score": "0.7135779", "text": "def client_ids\n ary = IXP_FS_ROOT.client.entries\n ary.delete FOCUSED_WIDGET_ID\n ary\n end", "title": "" } ]
[ { "docid": "a1c25c223067cea3ca4e4a95b5470b95", "score": "0.802049", "text": "def client_ids\n @view.client_ids @id\n end", "title": "" }, { "docid": "155ddacf10d2f0a4bf73ad4a942215ba", "score": "0.7804814", "text": "def clients\n client_ids.map! {|i| Client.new i }\n ...
691bdb4cc43c9b95728e922abd7146ac
PUT /format_types/1 PUT /format_types/1.xml
[ { "docid": "5e55d120cfbae0b5259ecf4d07bf8f77", "score": "0.6597421", "text": "def update\n @format_type = FormatType.find(params[:id])\n\n respond_to do |format|\n if @format_type.update_attributes(params[:format_type])\n flash[:notice] = 'Format type was successfully updated.'\n ...
[ { "docid": "cc54bf80275f0c127a73e78a22f2fba7", "score": "0.6544672", "text": "def update\n @format = Format.find(params[:id])\n\n maybe_add_mimetype(params)\n\n respond_to do |format|\n if @format.update_attributes(params[:form])\n format.html { redirect_to(@format, :notice => 'Form...
9d142cffb6b66add40363793c9019d3b
PATCH/PUT /junks/1 PATCH/PUT /junks/1.json
[ { "docid": "5f340e4d01dde720ded8eb36c7ea2171", "score": "0.6192722", "text": "def update\n respond_to do |format|\n if @junk.update(junk_params)\n format.html { redirect_to @junk, notice: 'Junk successfully updated!' }\n format.json { render :show, status: :ok, location: @junk }\n ...
[ { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.65654856", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "6b3d6af3e1ade5f41124866b57a6b326", "score": "0.616914", "text": "def patch(path, **args); end", "title": "" }, { ...
2172211b6afb3a0c646cf5abb86fe416
called for a DELETE request
[ { "docid": "cbd06dbac17dc1b2f91ea54ee896af2b", "score": "0.0", "text": "def delete_resource\n\t\tQuote.find(id).destroy\n\t\ttrue\n\tend", "title": "" } ]
[ { "docid": "419097c1c4a142adaf725a2112822e8e", "score": "0.8289932", "text": "def delete\n request_method('DELETE')\n end", "title": "" }, { "docid": "6f739d79b7b2f8fa533105b3dc58c930", "score": "0.81248933", "text": "def delete(request, options = {})\n\n end", "title": ...
0285917df70f7d79dd8e7b134da4a4a1
POST /battles POST /battles.json
[ { "docid": "3d760dacd1fcfa165df2c7f98e469382", "score": "0.0", "text": "def create\n #Convert comma seprated value into an array\n hashtags = battle_params[:hashtags].split(',')\n @battle = Battle.new(name: battle_params[:name])\n if @battle.save\n\n #Insert hashtags into the battle\n ...
[ { "docid": "c16a3c4c2629626e6da1fa0a3246ab1f", "score": "0.60592556", "text": "def create\n @boat = Boat.new(boat_params)\n\n if @boat.save\n render json: @boat, status: :created, location: @boat\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "...
9d071ac09da7b9b4c15b7c93cbfbcf3d
Execution context for processing error messages in +code+. The relevant error message to are assumed to be the ones whose file name is one given in +files+.
[ { "docid": "7b2c223d41a3cb6a4b4a44f8490caac9", "score": "0.7447354", "text": "def error_manager(files,&code)\n begin\n code.call\n rescue ::StandardError => e\n # pp e.backtrace\n # Keep the relevant \n e.backtrace.select! do |mess|\n ...
[ { "docid": "806832d9e8ed58ca2da3230d9780c6e3", "score": "0.58684415", "text": "def error(path, code, msg)\n return code, \"text/plain\", \"Error #{code}: #{msg}\\r\\nCurrent path: #{path}\", {}\n end", "title": "" }, { "docid": "09756f425157b73b0004bfd1e1624d44", "score": "0.5864203"...
a4fd61308dfeba8830e4bf2a91c83ee5
shift Removes the first element from `self` and returns it, or `nil` if the array is empty. If a number `n` is given, removes `n` items from the start of the array and returns them.
[ { "docid": "5cdc43af5072e29e7050d9b02c10a8e8", "score": "0.63743746", "text": "def shift#(n=nil)\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "27074e353673a8ba402791d378b27d25", "score": "0.73718977", "text": "def shift(n = nil)\n element_or_array(n) { shift1 }\n end", "title": "" }, { "docid": "4fc1425ed576e8cca43e9f9544f3bfbd", "score": "0.73673004", "text": "def shift(n=undefined)\n Rubinius.check_froz...
05d6ddafc8af89056e50c7809c2d782a
Find every node with type +name+.
[ { "docid": "906a5f157fd564dbaa76803a30f46d1c", "score": "0.7894754", "text": "def find_nodes name\n each_sexp.find_all { |sexp| sexp.sexp_type == name }\n end", "title": "" } ]
[ { "docid": "77a1f40ff02739b18bdb1f3a5b631049", "score": "0.7559706", "text": "def find_all(name: nil, type: nil)\n T.unsafe(children).select { |c| searchable_child_matches(c, name, type) }\n end", "title": "" }, { "docid": "20bc6bab6269d56a1ec0b405a562402b", "score": "0.74886...
a40e0c351b8fe8a7641348151d789904
The winning player takes the bank
[ { "docid": "c042408aedbf75042ea4656b8e8aeb5c", "score": "0.7956593", "text": "def win(player)\n player.win(@bank)\n\n player\n end", "title": "" } ]
[ { "docid": "fa9082b696255d3dc1f812be5ad65640", "score": "0.7626158", "text": "def pay_bank\n case result\n when :player_win\n player.increase_bank(game_bank)\n when :dealer_win\n dealer.increase_bank(game_bank)\n else\n return_bank\n end\n end", "title": "" }, { ...
0e48033a591d236421429fb43e5c7bb1
Returns all methods that can be used for attribute assignment (those that end with =)
[ { "docid": "b78369ea91284fc72d6a60e021ef1cc9", "score": "0.7537174", "text": "def setter_methods\n methods.grep(/=\\z/)\n end", "title": "" } ]
[ { "docid": "06d4da77c810c300f157df8e1df5d4e2", "score": "0.7406534", "text": "def attribute_methods\n methods - Object.methods - [:validate_initialization, :list_of_attributes,\n :load, :get_value, :set_value,\n :set_value_at_i...
314b9e0a145e5630c12e8f57454e37d2
controller action for the challenge show36 page retrieves the appropriate ChallengeLevel record
[ { "docid": "0abe62d9aa3496d52a9615796d188263", "score": "0.7640612", "text": "def show36\n node = ChallengeLevel.find(params[:id])\n respond_to do |format|\n format.html { render :show36, locals: { node: node } }\n end\n end", "title": "" } ]
[ { "docid": "26502d3b241ded2dd214edbfaae88b0c", "score": "0.7529602", "text": "def show35\n node = ChallengeLevel.find(params[:id])\n respond_to do |format|\n format.html { render :show35, locals: { node: node } }\n end\n end", "title": "" }, { "docid": "aaf...
a5adae483134da61ea65349d8c1e6252
method computing date of next given day such as "friday"
[ { "docid": "208efe30c33e7bfed1a4cca57e44afd3", "score": "0.8028995", "text": "def date_of_next(day)\n date = Date.parse(day)\n delta = date > Date.today ? 0 : 7\n date + delta\nend", "title": "" } ]
[ { "docid": "b28c2b83665c116ce0907d495396aaad", "score": "0.82336843", "text": "def date_of_next(day)\n date = Date.parse(day)\n delta = date > Date.today ? 0 : 7\n date + delta\n Chronic.parse(\"0 next #{day}\").to_datetime\n end", "title": "" }, { "docid": "0382e46c0882f5d479a...
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "54aef63ac3c7539b8aa79cd8ba259321", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to user_url, notice: 'User was successfully updated.' }\n format.json { render :sh...
[ { "docid": "23a904e6ddd4b6b07c4b53353e78cf93", "score": "0.7225568", "text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "title": "" }, { "docid": "4781fa7337315133553edb54194e6202", "score": "0.7129473", "text": "def update\n render json: ...
de49b476aca42279b9b6278d2daf8bc8
Remove a batch action
[ { "docid": "30e91abfd9bfd4837c193bfa4a08a0da", "score": "0.7862366", "text": "def remove_batch_action(sym)\n @batch_actions.delete(sym.to_sym)\n end", "title": "" } ]
[ { "docid": "5f91665ca49c1039067df0f59c30b4df", "score": "0.7282447", "text": "def remove_action(action)\n action.behavior = nil\n @actions.delete(action)\n end", "title": "" }, { "docid": "fdc18853c54f6b143a065367f8e4f2b9", "score": "0.70542324", "text": "def clear_batch_actio...
730b6a4ec3b87b2e20c5662e18feb59a
Force generation is used when you are in a section that isn't published i.e. styleguide shouldn't be in the menu for fundamentals, but if you are on /web/styleguide/ the menu should have styleguide at the top level
[ { "docid": "222bc36b294b695063553f5873637763", "score": "0.0", "text": "def getBetterBookEntry(section, currentLevel, forceGeneration = false, isSelected = false)\n if section.nil?\n return nil\n end\n\n if section['index'].nil?\n return nil\n end\n\n indexPage = g...
[ { "docid": "f0b9a516dbdc2549881b48d070305b1c", "score": "0.6192082", "text": "def no_scaffold!\n @options[:scaffold] = false\n end", "title": "" }, { "docid": "f0b9a516dbdc2549881b48d070305b1c", "score": "0.6192082", "text": "def no_scaffold!\n @options[:scaffold] ...
1682c07eef7605dc5553e0685706a1ef
Public: Add new vat rates
[ { "docid": "52137f9c8dfae05283aa207ef423f5a1", "score": "0.78422713", "text": "def add_vat_rates(vat)\n wait_until_bus_section_load\n vat_country_select.select(vat.vat_country) unless vat.vat_country.nil?\n vat_rate_input.type_text(vat.vat_rate) unless vat.vat_rate.nil?\n vat_effecti...
[ { "docid": "d20a9d33845c1dc690199ab55a5a7fe8", "score": "0.642847", "text": "def add_rate(currency_iso_from, currency_iso_to, rate); end", "title": "" }, { "docid": "9568b272bc39eff49f1b69dbdceaa62a", "score": "0.6395935", "text": "def vat_rate\n end", "title": "" }, { ...
c01f52ac76c5f5831d7f986fd9e0299d
Handle replies from twitter oauth.
[ { "docid": "3bdd676e8527230d9a6ec89126682fd0", "score": "0.0", "text": "def create\n @usage = params[:usage] ? params[:usage].to_sym : :redirect\n oauth_verifier = params[:oauth_verifier]\n\n if oauth_verifier\n access_token = @client.authorize(\n session[:tw_r...
[ { "docid": "e390b16815e91ec4bf9bcf6f61842df4", "score": "0.7024755", "text": "def execute_respond_on_tweets tweets_to_respond\n translator = Translator.new\n tweets_to_respond.each do |x|\n # generate tweet\n response_tweet_str = generate_respond_tweet(x, translator)\n\n # post the ...
33b084f738beb361173d43812cbc58b7
Create link relations among containers
[ { "docid": "b2bce39989ba8c12ff76bea3977ec530", "score": "0.759236", "text": "def link_containers\n @containers.each_value do |container|\n links = container.attributes[:links]\n\n next if links.nil?\n\n links.each do |service, label|\n dependency_container = @containers[service]...
[ { "docid": "66e09f00dd74f19dd20f8e2523fe403c", "score": "0.6540077", "text": "def create_links\n end", "title": "" }, { "docid": "66e09f00dd74f19dd20f8e2523fe403c", "score": "0.6540077", "text": "def create_links\n end", "title": "" }, { "docid": "6897b0607281046f1520a7...
67387e237cd85968be7321f78c2f1426
Asks the player where they want to play
[ { "docid": "63ef186bedc7020058989a2c2f8ec440", "score": "0.7594", "text": "def choose_position(player)\n\t\tcheck_answer do\n\t\t\tputs \"Hey #{player.name}, where you wanna play?\"\n\t\t\tgets.chomp.to_i\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "8d3f4fbfb37ea402bd5a09f1f32816a8", "score": "0.7731745", "text": "def ask_player_to_play(player)\n\t\tputs \"\"\n\t\tputs \"Au tour de #{player.name} de jouer !\"\n\t\tprint \"#{player.name}, sélectionne une case : \"\n\tend", "title": "" }, { "docid": "ee4c17ed734c40e4cb1846a74e...
5a5062dd4415874fe600b8f6ebae987d
Remove the last node from the list
[ { "docid": "f49b0115addd8f5396da258b9040a55d", "score": "0.0", "text": "def pop\n if @size == 0\n return\n end\n\n previous = nil\n runner = @head\n (@size - 1).times.each do |i|\n previous = runner\n runner = runner.next\n end\n\n if previous.nil?\n @head = nil\...
[ { "docid": "5d0f4661c621f88ae65fe096caf20580", "score": "0.85491985", "text": "def remove_last\n unless empty?\n last_node = find_last()\n # doesn't work if the list only has 1 node\n # last_node.remove_before\n penultimate_node = last_node.back_pointer\n if penultimate_node\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dde5758ffa5492ca6f10246336ab164e", "score": "0.0", "text": "def set_school\n @school = School.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...
6a31982f4ced748c1e27d68b301fe132
GET /users/new GET /users/new.json
[ { "docid": "e9b6eea14747b7fb28070ae230d8cf17", "score": "0.0", "text": "def new\n if !check_root then return end\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "title": "" } ]
[ { "docid": "886855e8c82b584e43d5e0eb976cb8d6", "score": "0.83422595", "text": "def new\n @new_user = NewUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_user }\n end\n end", "title": "" }, { "docid": "c0689c28ca79528819a61...
31c06f2146853b67cd9007045f7d33c9
Returns 'true' if the session is open
[ { "docid": "2f82cc3d56868eec8544e70068bee06d", "score": "0.73654145", "text": "def is_open?\n self.establish.is_open?\n end", "title": "" } ]
[ { "docid": "25552bcd9313624c093d91d6373b5c0f", "score": "0.89005077", "text": "def open?\n @http_session && @http_session.started?\n end", "title": "" }, { "docid": "02b88ea2a9df98460f0dedab93ab3a63", "score": "0.88710654", "text": "def open?\n @http_session&.started?\n ...
ed03ea54fca5a411fd5bf2db2e0ef023
GET /custos/1 GET /custos/1.json
[ { "docid": "a510636352a554410c071a7156f9921a", "score": "0.0", "text": "def show\n @projeto = Projeto.first()\n end", "title": "" } ]
[ { "docid": "44d5c99d89ab374d2baf04ebcdda12b5", "score": "0.71869344", "text": "def getcustsjson\n render :json => @customers\n end", "title": "" }, { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.68830645", "text": "def get_customer(id)\n get(\"customers/#{id}\")\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "ba6a033ea8360824532d284990838783", "score": "0.0", "text": "def indicador_unidade_medida_params\n params.require(:indicador_unidade_medida).permit(:nome, :sigla)\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"...
4620a070a8aed024844f233de3bfb615
GET /user/:user_username/resumes GET /user/:user_username/resumes.json
[ { "docid": "e1416db27ff32aa1bf99857d5de2edae", "score": "0.6623581", "text": "def index\n if @user.nil?\n render text: 'the user doesn\\'t exist.', status: 404 if @user.nil?\n else\n all_resumes = Resume.where(owner_id: @user.id).order(:created_at)\n @original_resumes = all_resumes....
[ { "docid": "0539024477c9d51812e8b89dc2f5a800", "score": "0.8336395", "text": "def user_resumes\n user_id = params[:user_id]\n resumes = Resume.where(user_id: user_id)\n if resumes.empty?\n render json: [], status: :ok\n else\n render json: resumes, status: :ok\n end\n end", ...
f430b0407a1df20ac8b42db3826bcc40
Searches part information from part DB
[ { "docid": "dd945d223a2c23511eef98911ed4f73e", "score": "0.68212223", "text": "def searchPartInfo(info)\n\tdevice=info[:device]\n\tvalue=info[:value]\n\tif($deviceDB[device]!=nil and $deviceDB[device][value]!=nil)then\n\t\tinfo[:partInfo]=$deviceDB[device][value]\n\tend\n\treturn info\nend", "title"...
[ { "docid": "76ef8d528f6bbe7a3a0e569c81364250", "score": "0.65727663", "text": "def index\n @parts = Part.search(params[:search]).order('serial')\n @storage = Storage.all\n end", "title": "" }, { "docid": "b93884bec036615cb3bd87a040989e7a", "score": "0.65094835", "text": "def i...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ba35ff09b464e14dafeb8005e2078423", "score": "0.0", "text": "def tipo_cliente_params\n params.require(:tipo_cliente).permit(:nombre)\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...
44c5c376ff5304a090a4780163528c2a
return a value from either the defaults or options. Preference is options.
[ { "docid": "a2ba84a08aca6001fe5afbcd2e9a7249", "score": "0.0", "text": "def def_or_paras(name, defaults, opts)\n getp(name, opts) || getp(name, defaults)\n end", "title": "" } ]
[ { "docid": "7907169027158d915ad813c7f0b36090", "score": "0.6761837", "text": "def get(option)\n value = get_matching(option).values.first\n if value.nil? && !@global\n return get_matching(option, true).values.first\n else\n value\n end\n end", "title": "" }, ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "980927ef396e0ae8c0f21601bab87eea", "score": "0.0", "text": "def update!(**args)\n @day = args[:day] if args.key?(:day)\n @missed_calls_count = args[:missed_calls_count] if args.key?(:missed_calls_count)\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...
b7cf6f9115cad2057da3d51c9b466d61
/ End Location/Landmark Convenience Methods Action Convenience Methods
[ { "docid": "0fcea6252b9f7a1a29508ccd929e7876", "score": "0.0", "text": "def action_processor\n @action_processor ||= ActionProcessor.new(self)\n end", "title": "" } ]
[ { "docid": "ca25c7cc1638f7e00935e83e47d3d830", "score": "0.64387864", "text": "def location\n end", "title": "" }, { "docid": "925bfa14413f97aa81d4c481fe3cc1a3", "score": "0.63873965", "text": "def location; end", "title": "" }, { "docid": "925bfa14413f97aa81d4c481fe3cc1...
3116e220c41520ad943dbb1f66cd2446
extend the default json representation of a discussion to include attachment_name and member attributes
[ { "docid": "66dd5c4e43ceffa0e04d9da01bb1978c", "score": "0.6640897", "text": "def as_json(options = {})\n super(:methods => :attachment_name, :include => { :member => { :only => [:name, :slug, :image_url] } })\n end", "title": "" } ]
[ { "docid": "46fd37380c14275e1169e7aeb387605f", "score": "0.6454033", "text": "def as_json(options)\n super().merge!(type: \"blog\", subject: Subject.find_by(id: subject_id).name)\n end", "title": "" }, { "docid": "99cde8efa0e5d6b3087b04ccb4afe4ea", "score": "0.63821137", "text": ...
6da7eea20dbabda8af6a94cb7240d05b
Checks whether the page exists on the wiki.
[ { "docid": "92fa6058284ff326453a57c6baa86053", "score": "0.0", "text": "def execute(msg, page)\n return if Variables::Constants::IGNORED_USERS.include?(msg.user.nick)\n butt = LittleHelper.init_wiki\n page = page.spacify\n is_redir = butt.page_redirect?(page)\n link = ...
[ { "docid": "69db87bd460b825bdbf968ce97290adb", "score": "0.7977522", "text": "def page_exists?\n !!( get_doc rescue false )\n end", "title": "" }, { "docid": "5f30b62226883643e367922f3f03f909", "score": "0.72974026", "text": "def check_page#:doc:\n # @page => current page\...
4b29426c3106c9cdf4d640002d80e6d1
Writes an unsigned 32bit integer.
[ { "docid": "de49c5a37e1f8338b365dc16c5619882", "score": "0.70647484", "text": "def u32(x)\n write [x & 0xFF, (x >> 8) & 0xFF, (x >> 16) & 0xFF, (x >> 24) & 0xFF]\n end", "title": "" } ]
[ { "docid": "6f52d5c82ed83701f4cad5fa0b624bb4", "score": "0.8351614", "text": "def write_uint32(value)\n write_uint64(value)\n end", "title": "" }, { "docid": "75020a71b0a5a95b47ed9dc6e6c84c3f", "score": "0.819687", "text": "def write_uint32_le(value)\n write [value].pa...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c500585f529dee4d2eff949d9105678a", "score": "0.0", "text": "def group_params\n params.require(:group).permit(:name,:user_tokens)\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...
75210009f38ca78c3342052a24268ad4
Delete the given node, O(1) Naively assumes that given node is actually part of list
[ { "docid": "5d57ee008d6404fdb3fb4592db4add32", "score": "0.76540864", "text": "def delete_node(node)\n return unless node\n\n if node.prev\n node.prev.next = node.next\n end\n\n if node.next\n node.next.prev = node.prev\n end\n\n if node == @head\n @head = node.next\n ...
[ { "docid": "460a31e73ea9c70f67832034fed6f757", "score": "0.8406331", "text": "def delete(node)\n remove_node(node)\n end", "title": "" }, { "docid": "c1e7b64b04c360dbb87bcdf0524ac304", "score": "0.8088327", "text": "def delete(node)\n current_node = self.head.next\n last_no...
d031fbc61d5b34fc3843c01c375ffadb
Save the card to the database as the user's current card
[ { "docid": "8be491e1a7b01658456ee1f503ad2e69", "score": "0.0", "text": "def update_stripe_card_on_file(card)\n update!(\n card_type: card.brand.capitalize,\n card_last4: card.last4,\n card_exp_month: card.exp_month,\n card_exp_year: card.exp_year\n )\n\n...
[ { "docid": "3a59976b7fb6d4b6f967fbd9d1cab0ff", "score": "0.74482447", "text": "def set_card\n @card = current_user.card\n end", "title": "" }, { "docid": "8ae4ce1554ff5b9b40e5cdb61a37b755", "score": "0.7118695", "text": "def create\n @user_card = UserCard.new(params[:user_...
bd35802ca94c18d9ffd3ed07552c5b1a
validates :text, presence: true
[ { "docid": "93eeeeff7249c467abb651697c68a40b", "score": "0.0", "text": "def normalizedText\n # downcase; remove punctuation; remove extra whitespace; remove umm's/uhh's/uhm's, trim\n text.downcase.gsub(/[^0-9a-z ]/i, ' ').gsub(/\\bu+h+m*\\b|\\bu+m+\\b/, ' ').gsub(/\\s+/, ' ').strip\n end", "t...
[ { "docid": "db1cd38bf4b105e1b1bad10650f22dba", "score": "0.79462624", "text": "def validate_text\n if self.question.type_of == \"Essay\" and self.text_essay == \"\"\n errors.add(:text_essay, 'must not be blank')\n return false\n else\n if self.text == \"\"\n \terrors.add(:text, 'mu...
b50eaf1d720a5adcde47390c8db61189
Special case for text_style / default_appearance When shrink_to_fit is true, the default_appearance font size is set to 0 But the appearance stream font size must be preserved
[ { "docid": "01c86821a4cb52701491bc274038c745", "score": "0.60597867", "text": "def text_style=(value)\n @text_style = value\n set_default_appearance_from_text_style\n end", "title": "" } ]
[ { "docid": "2797a2950a09e4276a66786e9408129b", "score": "0.62962884", "text": "def text_field_default_appearance(element)\n text_style = element.text_style ||= Prawn::TextStyle(\n @document, 'Helvetica', :normal, 10, '000000'\n )\n border_style = element.border_style ||= Prawn::Bor...
8b5343a6a68dc6fae0c0c1cd2b3aa2f4
Returns a 32byte long String containing the 16 byte random value in hex representation
[ { "docid": "b5402847fb692d7343b9f9e6e0be9a86", "score": "0.6772228", "text": "def hex\n \"%032x\" % @value\n end", "title": "" } ]
[ { "docid": "470619a716a5c183c89d348e1de23760", "score": "0.78527313", "text": "def generate_random_hex(length=16)\n ActiveSupport::SecureRandom.hex(length)\n end", "title": "" }, { "docid": "dedad4fbaafc1e33157276a18c85641c", "score": "0.77886146", "text": "def random_string(...
cd9b20b6eb2c72feddd6092f80d69ae9
def Helper: Glucosecheckin database interactions Give bonus points for a bg check 23 hours after the last meal Give bonus points for a bg check 020 mins after a prior low bg check
[ { "docid": "d702a976f12f816b0f3708faae50cb38", "score": "0.71356994", "text": "def handle_glucose_checkin(mgdl, tag_abbrev_s)\n puts where = 'handle_glucose_checkin helper'\n begin\n pts = tag_abbrev_s == '' ? 10.0 : 15.0\n msg = ''\n\n hi = @this_user['hi']\n lo = @this_user['...
[ { "docid": "5b7ad9a8c40e67f91fb89b229cc8cec1", "score": "0.6167374", "text": "def award_badge(user, badge, db_conn)\n add_badge_award = db_conn.prepare(\"insert into GDN_BadgeAward (BadgeID, UserID, InsertUserID, DateInserted) values (?, ?, ?, ?)\")\n add_badge_award.execute(badge['BadgeID'], user['Us...
0df2eab534da4e39409ba3471f8abb34
Update payment account data With this method, the WHITE BRAND system asks Lemon Way to update information related to a CLIENT payment account. 1. The user enters his new data 2. The user calls the Lemon Way webservice 3. Lemon Way records data when it exists 4. The application processes Lemon Way&39;s response and disp...
[ { "docid": "aabfef4743a286c6e4f512ee83bd93c1", "score": "0.0", "text": "def accounts_individual_put_with_http_info(accountid, parameters, authorization, psu_ip_address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountsApi.accounts_individua...
[ { "docid": "00d6ef38e63d6fae82858dbdf2701e5f", "score": "0.6698451", "text": "def update\n flash.now[:icon] = 'fa-smile-o'\n flash.now[:message] = t('order_complete_hint')\n flash.now[:status] = 'success'\n\n @order = Order.find(params['MerchantTradeNo'].delete('O'))\n # Check token to de...
792a35a6e82b012b1b73d9b8a6ab0ac3
Log message and exit (critical exception)
[ { "docid": "6e8c1af2fb744a4fb1fdc752a757e775", "score": "0.73300534", "text": "def log_e\n log\n exit\n end", "title": "" } ]
[ { "docid": "890e4b847e734bf77eb86fda9be7d9f2", "score": "0.7105174", "text": "def criticalError(msg='Critical error')\n logExceptionMsg msg\n do_action 'StopSociety' if run\n exit 1\nend", "title": "" }, { "docid": "9f6b9145f01d1f61c17f7e1bef69249b", "score": "0.7020011", "text": ...
c6f16c06b1d9d226ed66a24b21d43874
Build a new ISO using packages from OBS Do some cleanup Download the original ISO (relying on AYTests::IsoRepo) Fetch required packages Fetch local packages Create the final ISO
[ { "docid": "6c546a3d8a41c6a7f6e3f3b2f78c2afc", "score": "0.7306858", "text": "def build(output_path = nil)\n cleanup\n iso_path = download_iso\n fetch_obs_packages\n fetch_local_packages\n build_iso(iso_path, output_path || AYTests.obs_iso_path)\n end", "title": "" } ]
[ { "docid": "b387c853d984fc4251e860ca523a2710", "score": "0.62387764", "text": "def build_iso(iso_path, output_path)\n log.info \"Creating DUD\"\n dud_path = cache_dir.join(\"#{version}.dud\")\n dud_dir = base_dir.join(\"share\", \"build_iso\", \"dud\", version)\n cmd = format(MKDUD_C...
07ccf9f0fcfbb9c1456bd9492fe3bf64
Return the number of failed jobs
[ { "docid": "52facf028eecc6e4add098dbc940fc65", "score": "0.7663012", "text": "def failed\n @resque_data_store.num_failed\n end", "title": "" } ]
[ { "docid": "c34d3f57faee504a21f38ae41adc6f8d", "score": "0.8653813", "text": "def amount_of_failed_jobs()\n # returning the amount of elements in '@retry_jobs_queue'\n return @retry_jobs_queue.size()\n end", "title": "" }, { "docid": "7f24fd486f4c615e32e1c9c08f6dd8e4", "score": "0...
9d5ec1139b564c95fb1532b6c18d7094
Creates the reader and writer access methods
[ { "docid": "79fcb4f897457d870e6abf9d905b038d", "score": "0.0", "text": "def validated_attr_accessor(symbols, validator)\n symbols.each do |symbol|\n attr_reader symbol\n\n module_eval(format(SETTER, symbol, validator, symbol), __FILE__, __LINE__)\n end\n end", "t...
[ { "docid": "36b1d1c935cd742c0e652e55bc34e388", "score": "0.68390346", "text": "def open_reader\n raise 'not implemented'\n end", "title": "" }, { "docid": "2c4d68b29353e1773e59c9ec22e5fd02", "score": "0.6801566", "text": "def create_reader\n raise NotImplementedErr...
f974135a86cf72173f12ace401d73773
Update a 'iam.IpAccessManagement' resource.
[ { "docid": "4ce913f5a1f28234252cef0b4173ea70", "score": "0.66649866", "text": "def patch_iam_ip_access_management(moid, iam_ip_access_management, opts = {})\n data, _status_code, _headers = patch_iam_ip_access_management_with_http_info(moid, iam_ip_access_management, opts)\n data\n end", ...
[ { "docid": "1b71149372a95f79fce1926fcd345f8f", "score": "0.7058416", "text": "def update_iam_ip_access_management(moid, iam_ip_access_management, opts = {})\n data, _status_code, _headers = update_iam_ip_access_management_with_http_info(moid, iam_ip_access_management, opts)\n data\n end", ...
567986825d042065214b3dbdc3386f14
This action is used for search
[ { "docid": "a53becf10adf218e14b1ef58f00444c5", "score": "0.0", "text": "def search(search_term)\n conditions = []\n SEARCHABLE_COLUMNS.each do|column|\n conditions << {column=>/#{search_term}/i}\n end\n any_of(conditions)\n end", "title": "" } ]
[ { "docid": "a5ae7e655eb7167a6857f4e6f969db03", "score": "0.8292999", "text": "def search\n\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.8270277", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a...
20d1e2cf05231ae3700236ed7aa26e86
The body of the filter. Compile each input file into a ES6 Module Transpiled output file.
[ { "docid": "6407c4ae8bc497e8bdfafcd9f5213d6b", "score": "0.65246826", "text": "def generate_output(inputs, output)\n inputs.each do |input|\n begin\n body = input.read if input.respond_to?(:read)\n local_opts = {}\n if @module_id_generator\n local_opts[:...
[ { "docid": "353e6adc36c424040920a3ce1a2fd92a", "score": "0.65105903", "text": "def generate_output(inputs, output)\n inputs.each do |input|\n begin\n body = input.read if input.respond_to?(:read)\n local_opts = {}\n if @module_id_generator\n local_opts[:...
bf04aea20e0d686b3faa86d285d387b1
Return volumes for dockercompose database services
[ { "docid": "ab53a52f9b935e555796465b6f285135", "score": "0.7520727", "text": "def db_volumes(database)\n return '' unless %w[mysql postgresql].include?(database)\n\n case database\n when 'mysql'\n mysql_volumes\n when 'postgresql'\n postgresql_volumes\n else\n ...
[ { "docid": "23248c3ce2acf3eac8831c53b712c491", "score": "0.7752051", "text": "def volumes\n [].tap do |volumes|\n volumes << \"/dockistrano/#{image_name.gsub(\"-\", \"_\")}/data:/dockistrano/data\"\n if mount_src and !mount_src.empty?\n mount_src.each do |host_src, container_...
216ceefcb1adc27ea93b2460800e3a08
Reset the column to its initial value. If the column was not set initial, removes it from the values. reset_column(:name) name => 'Initial'
[ { "docid": "dbbd6797908e31cca305a732d14e522b", "score": "0.79205436", "text": "def reset_column(column)\n if initial_values.has_key?(column)\n set_column_value(:\"#{column}=\", initial_values[column])\n end\n if missing_initial_values.include?(column)\n values.delete(column)...
[ { "docid": "ec14a028f0b8a9aaae4f57443d336e05", "score": "0.67808115", "text": "def reset_initial_values\n @initial_values.clear if @initial_values\n @missing_initial_values.clear if @missing_initial_values\n end", "title": "" }, { "docid": "8426992c025ded0e2ad1319e4eb5a4e2", ...
a8e00a9ddd457136182d674920f416d6
Sends an email message using a template
[ { "docid": "32c1ffa6e95999a89362f60f9d25e385", "score": "0.0", "text": "def deliver_template(template_id:, to:, params: {})\n url = \"templates/#{template_id}/#{path}\"\n response = client.post(url, to: to, params: params).parsed_body\n new(response)\n end", "title": "" }...
[ { "docid": "fa8762d47352ef309eb0ed1dfeac4052", "score": "0.7843808", "text": "def email_template(to, email_template, options = {})\n mail({\n :to => to,\n :cc => options['cc'],\n :bcc => options['bcc'],\n :subject => email_template.subject,\n :body => email_template.render(li...
c92bec52300921a0c0724d0e0c224402
POST /cordinators POST /cordinators.json
[ { "docid": "4f76dcd0dbc29ab0f68354bba4fa56ae", "score": "0.56536317", "text": "def create\n @cordinator = Cordinator.new(cordinator_params)\n\n respond_to do |format|\n if @cordinator.save\n format.html { redirect_to @cordinator, notice: 'El cordinador se ha creado correctamente' }\n ...
[ { "docid": "47855270daa893928c1e8d74f15d2f78", "score": "0.60080016", "text": "def create\n # @cord = Cord.new(cord_params)\n @cord = @racquet.cords.new(cord_params)\n @cord.user = current_user\n respond_to do |format|\n if @cord.save\n format.html { redirect_to @cord, notice: t(...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e89ae46397473b9d9cb12749c809f000", "score": "0.0", "text": "def preco_servico_params\n params.require(:preco_servico).permit(:id, :analise, :parametro, :produto, :preco)\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...
18d9decca3950b1977df178a2a2116ea
DELETE /users/1 DELETE /users/1.xml
[ { "docid": "629c124c5b846955d944e5f8ed7fa85c", "score": "0.0", "text": "def destroy\r\n @user = User.find(params[:id])\r\n @user.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(users_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" } ]
[ { "docid": "d29aa233ddb4837c263e69069aaa2550", "score": "0.77170086", "text": "def user_delete(username)\n make_request(:delete,\"#{user_url(username)}.xml\")\n end", "title": "" }, { "docid": "76704cc378f6c8f5f8049e9a28db23c1", "score": "0.7152957", "text": "def destroy\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bacdd0ab9acad772e651fc500371499e", "score": "0.0", "text": "def set_record_list\n @record_list = RecordList.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4a8c9a4a76206523f4c9dd602a2d774e", "score": "0.0", "text": "def set_survey_result\n @survey_result = SurveyResult.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
d9b433407d22aded7c7d1cd6e8eba4b4
The method should use the linear search algorithm to return an array of all the positions of the element where the target is found You may not use any Array or Enum methods except length, size or empty? You may not use any Enum derived iterations, only for, while or until Write Your method code here 1. newArr as empty ...
[ { "docid": "42f3f636cdac64b00409303b5bb9a154", "score": "0.8154223", "text": "def global_linear_search(array, target)\r\n newArr = []\r\n\r\n for current_index in 0..array.length-1\r\n if array[current_index] == target\r\n newArr.push(current_index)\r\n end\r\n end\r\nr...
[ { "docid": "c2616e389072c4a83790154f7e39b6d3", "score": "0.72994494", "text": "def search_range(nums, target)\n positions_of_target = [-1, -1] \n \n nums.each_with_index do |num, index|\n if num == target\n if positions_of_target[0] == -1\n positions_of_target[0] = index\n po...
b328f720ebbc623c69dfe6b1ddc9da9a
PUT /armies/1 PUT /armies/1.xml
[ { "docid": "d26124eec1db0679143c5d1936a4afae", "score": "0.5367402", "text": "def update\n @army = Army.find(params[:id])\n\n respond_to do |format|\n if @army.update_attributes(params[:army])\n format.html { redirect_to(@army, :notice => 'Army was successfully updated.') }\n fo...
[ { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.61246777", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "7dcf61d28367255f0ec9cea7ade341de", "score": "0.6115389", "text": "def update(id, name=\"Updated Name\", publish...
299650dfc458fca14af309a7c97d1c83
PUT /datasets/1 PUT /datasets/1.xml
[ { "docid": "8526edafdb4a57d3f4b32034a93467e6", "score": "0.6552326", "text": "def update\n @dataset = Dataset.find(params[:id])\n\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n flash[:notice] = 'Dataset was successfully updated.'\n format.html { red...
[ { "docid": "9d0bc3a176634b250a3abf2151c8ded6", "score": "0.6526648", "text": "def update\n @dataset = Dataset.find(params[:id])\n\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n format.html { redirect_to(@dataset, :notice => 'Dataset was successfully update...
7cd009ea1f17558be92b0299c8d58606
DESTROY /events/1/hosts/1 DESTROY /events/1/visitors/1
[ { "docid": "a68d27c927bf83112e55a35548434341", "score": "0.0", "text": "def destroy\n @role = get_role\n get_role.destroy\n flash[:notice] = t('destroy.success', :scope => get_i18n_scope) unless request.xhr?\n respond_with @event, @role\n end", "title": "" } ]
[ { "docid": "a13064351ebc598281b451509b59953f", "score": "0.651852", "text": "def destroy; end", "title": "" }, { "docid": "a13064351ebc598281b451509b59953f", "score": "0.651852", "text": "def destroy; end", "title": "" }, { "docid": "a13064351ebc598281b451509b59953f", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9d5485a132722e9a5a5691efea62a10f", "score": "0.0", "text": "def set_booking\n @booking = Booking.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...
ba1fd03c2d39fe3dc4eb65aad7140b11
returns true if laser is off screen
[ { "docid": "aefa04d44dd0a2d88cf8cb7986786310", "score": "0.69384784", "text": "def offScreen?\n\t\tdim = @width + @height\n\t\t(@x < -dim) || (@x > (Game::WIDTH+dim)) ||\n\t\t(@y < -dim) || (@y > (Game::HEIGHT+dim))\n\tend", "title": "" } ]
[ { "docid": "552f6d549b08544196dd81e242209009", "score": "0.7835604", "text": "def is_offscreen\n\t\tif @x > 1280 or @x < 0 or @y > 720 or @y < 0\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "5e2c046659104750c699ca85163c2496", "score": "0.72...
30843c2140859255f758047d6c5bd504
PUT /projecttags/1 PUT /projecttags/1.json
[ { "docid": "3e8bb4b28d5303dacd4cfc374584c055", "score": "0.68972546", "text": "def update\n @projecttag = Projecttag.find(params[:id])\n\n respond_to do |format|\n if @projecttag.update_attributes(params[:projecttag])\n format.html { redirect_to @projecttag, notice: 'Projecttag was suc...
[ { "docid": "389f38b377dc5fe12faf85de9ad09532", "score": "0.72198087", "text": "def update_tag(project_id, tag_id, opts = {})\n put \"projects/#{project_id}/tags/#{tag_id}\", opts\n end", "title": "" }, { "docid": "dd77df311401b8c5d8eaa607085cfd8b", "score": "0.69807684", ...
8143c85b309447595c5e86bca81b63ce
GET /cities GET /cities.json
[ { "docid": "9cbab310ea04a30906af373a40e9e114", "score": "0.64558846", "text": "def index\n @cities = @state ? @state.cities : City.page(params[:page])\n end", "title": "" } ]
[ { "docid": "a42672db56eb7f67cdd97b948dac6829", "score": "0.8392068", "text": "def cities\n self.class.get(\"/v1/cities\")\n end", "title": "" }, { "docid": "f00b025f7a4a01b6811779c7b39a360a", "score": "0.78225183", "text": "def index\n \n render json: @cities\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "73554f1d16a54e1e2cbd3745c4dbddd8", "score": "0.0", "text": "def sivic_professor_params\r\n params.require(:sivic_professor).permit(:sivic_pessoa_id, :user_inclusao, :user_bloqueio, :DATA_bloqueio, :sivic_igreja_id)\r\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...
e9ae40d541f10969c030a4d6daf0aab9
Parses the remote IP that's stored inside the .git/config file Will only parse it once. Any other requests will be pulled from memory
[ { "docid": "326d735ad0598e56a7c0e040d9b3b684", "score": "0.8098383", "text": "def parse_remote_ip\n @config ||= parse_configuration(\".git/config\")\n @remote_ip ||= $2 if @config[\"remote\"][\"webbynode\"][\"url\"] =~ /^(\\w+)@(.+):(.+)$/\n end", "title": "" } ]
[ { "docid": "f8e8c24418a533ea69d4b7c44b54f33a", "score": "0.5989835", "text": "def git_remotes\n @git_remotes ||= (File.read(git_directory / :config).scan(/\\s*url\\s*=\\s*(.*)\\n/).flatten.collect do |url|\n case url\n when %r{(github.com)[:/](.+)/(.+)/?\\.git$} then [$3, \"Git...
9cd3181a0713b52d257769b10dd3a64d
this is very imporant! define this method to do nothing and files will not be copied to the output directory
[ { "docid": "8e2e2862e3b757f88dc8c13caa403f42", "score": "0.0", "text": "def finalize\n end", "title": "" } ]
[ { "docid": "c144700b2620b072e0a574681620becb", "score": "0.6920035", "text": "def handleOtherFile(fileInfo)\n if (File.exists?(fileInfo[:outputPath]))\n puts \"SKIPPING: Copy target already exists: #{fileInfo[:outputPath]}\"\n return\n end\n\n # \"Remove\" (just don't copy) some files.\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "af0ec8c4b3f3e43a75c53be1cfa4a51d", "score": "0.0", "text": "def set_contact\n @contact = collection.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...
3cdc17ae9526a34762a6ab60ad9636ae
FIXME: Make it smarter to remove comments, etc from the beggining of the query
[ { "docid": "d650fde4656cf44f67488d157871e508", "score": "0.0", "text": "def query_type(query)\n query.strip.split(/\\s+/).first.downcase\nend", "title": "" } ]
[ { "docid": "3f14286dbb845f51d6b72e2b2603472f", "score": "0.6454117", "text": "def query\n raw_query.gsub(/\\s+/, ' ')\n end", "title": "" }, { "docid": "27c0120f4c85a642d3efebdaa72a864b", "score": "0.638149", "text": "def _query; end", "title": "" }, { "do...
bfbd924a3e0172cbb477b8e15f61de0b
Internal: Initialize base class.
[ { "docid": "6fd780037f9d6ca1a9ef5d5f319a56e1", "score": "0.0", "text": "def initialize(extensions: nil)\n @extensions = extensions || {}\n end", "title": "" } ]
[ { "docid": "7742d0fdd5905da1631cf48475818ed4", "score": "0.7846972", "text": "def init\n raise NotImplementedError\n end", "title": "" }, { "docid": "006ef28ab51a28a982112d3c90ebf5a5", "score": "0.7846558", "text": "def initialize(*_)\n super\n end", "title": ...
84f5669a056ae5388215a25003ffa86d
Cache permitters across multiple calls
[ { "docid": "7c51a57439a63c303a45aca2ac638401", "score": "0.0", "text": "def permitters\n @_parametrizr_permitters || {}\n end", "title": "" } ]
[ { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.6610253", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.6610253", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d60813792191da6a96da68848b902c90", "score": "0.0", "text": "def pulse_params\n params.require(:pulse).permit(:pulse_rate, :pulse_time)\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...
c7f4c85aa6f687d13146cec0c9cc8002
Update an contract as a mentor PUT /api/v1/contracts/:id
[ { "docid": "0c815fd1fcc4f84f10796ab3b0b6c0b9", "score": "0.7759755", "text": "def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render ...
[ { "docid": "f24b2ab1cd78d0bbdeae7e7005a93ada", "score": "0.77350295", "text": "def update(id, contract)\n @contract = Locomotive::Contract.get(id)\n raise NotFound unless @contract\n if @contract.update_attributes(contract)\n redirect resource(@contract), :message => {:notice => \"...
33c6b43c9ec2251631491dd1fce99d82
generates a random new sector
[ { "docid": "a90d759be8d39cdb497f4b5e46c1b455", "score": "0.60261846", "text": "def generate()\n\t\tnumSystems = Random.rand(MedianNumSolarSystems-NumSolarSystemsVariation...MedianNumSolarSystems+NumSolarSystemsVariation)\n\t\tnumSystems.times do\n\t\t\t# repeat until successful\n\t\t\tloop do\n\t\t\t\t#...
[ { "docid": "21c1583b6b0a56c537a34f44cd8d62e0", "score": "0.64299536", "text": "def newSector(db, world, x, y)\n\tnewId = newUUID(db)\n\t@db.hset('sgt-sector:' + newId, 'world', world.id)\n\t@db.hset('sgt-sector:' + newId, 'offsetx', x)\n\t@db.hset('sgt-sector:' + newId, 'offsety', y)\n\t\n\tsector = Sec...
e67f1c173bf9d509f51943ea5961253c
=begin Function name: gather_tags parameters: tagnames > type string returning: Array of tag objects =end
[ { "docid": "d4f3a68c669bf2784d33e4586c38c2d3", "score": "0.83723706", "text": "def gather_tags(tagnames)\n if(!tagnames)\n return nil\n end\n tags = Array.new\n tagnames.split(',').each do |tagname|\n tag = find_tag(tagname.strip) \n tags.push(tag) if tag\n end \n return...
[ { "docid": "3b0deb76a4f5676e62531da2a4561a14", "score": "0.7700529", "text": "def tags(*tag_names); end", "title": "" }, { "docid": "36be063495632d92a02d0456a3284e57", "score": "0.7299508", "text": "def getTag(*sought_tags); end", "title": "" }, { "docid": "a80281c1898aa9...
871ffc7a81fb8ed1b5e2fffada1994d4
DEPRECATED This method returns a 30 days ordered array This array is populated from other tasks. It's not possible to pass a days parameter to this method
[ { "docid": "90d63201e2e6875c45cc1cd7f8f39411", "score": "0.0", "text": "def get_old_api_calls(username)\n user_redis_key = ::User.where(:username => username).first.key\n calls = $users_metadata.HMGET(user_redis_key, 'api_calls').first\n if calls.nil? || calls['per_day'].nil?\n ...
[ { "docid": "fcb55adc3e6db8b9f670e766a8270312", "score": "0.6277806", "text": "def days_with_tasks\n \tdays = []\n \tself.tasks.incomplete.each do |task|\n \t\tdays << task.due_date.to_date\n \tend\t\n \tdays.uniq\n end", "title": "" }, { "docid": "f4c760c364d012cabdf32c77c6fa6d9d", ...
f7eec8ff81f61f381a4fa78752f003ea
GET /organizations/1 GET /organizations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d6650a30986bfa18e1a4ca6767b09f60", "score": "0.7808052", "text": "def index\n @organizations = current_user.organization\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organizations }\n end\n end", "title": "" }, { "doc...
ff72939b5ecc04d464b77561230ba0fa
Search cards by specified search criteria.
[ { "docid": "3d2205e11161cf8d26afa9a9255b1400", "score": "0.8263133", "text": "def search_cards_by_criteria(search_criteria)\n body = {identities: search_criteria.identities}\n if search_criteria.identity_type\n body[:identity_type] = search_criteria.identity_type\n ...
[ { "docid": "9082c696c664c49721a64e02a94fc74e", "score": "0.76719666", "text": "def full_card_search(search_term)\r\n # Takes a param and searches Title, Gametext, Lore in Cards for it\r\n # Returns a list of IDs of matching cards\r\n \r\n #horribly inefficient\r\n \r\n results_...
f1ca9ffa4e7f38dae277bce3003b2263
Set a page value for the query Needs a size to get the offset, so use a default if none is provided
[ { "docid": "8297ca49bd037192abc75f5b51e8b692", "score": "0.6752361", "text": "def page(num)\n @current_page = num.to_i\n @size ||= DEFAULT_PAGE_SIZE\n self\n end", "title": "" } ]
[ { "docid": "dbfd10ce193b37f0489a230836a941d3", "score": "0.7322846", "text": "def page(num)\n @query[:page] = num\n self\n end", "title": "" }, { "docid": "dbfd10ce193b37f0489a230836a941d3", "score": "0.7322846", "text": "def page(num)\n @query[:page] = num\n s...
f3a734fda3866a24149c2668700e873a
~5min(sleepy) Write a method that returns the factors of a number in ascending order.
[ { "docid": "ee88f164b533db73b8f63efe824f2e09", "score": "0.0", "text": "def factors(num)\n return nil if num < 0\n (1..num).inject([]) { |a,f| num % f == 0 ? a << f : a }\nend", "title": "" } ]
[ { "docid": "aeaa92e920adfc1bdfdb8456bf23f5f2", "score": "0.84756273", "text": "def factors(num)\nend", "title": "" }, { "docid": "aeaa92e920adfc1bdfdb8456bf23f5f2", "score": "0.84756273", "text": "def factors(num)\nend", "title": "" }, { "docid": "aeaa92e920adfc1bdfdb8456...
d3e17627cdf5f266594228c8d0b81911
Change ceph_chef_osd_nodes to ceph_chef_mon_nodes Ceph MONs set the keys so everything should pull from those and set their own node value to equal the given attribute Since data bags are not used, setting ALL mon node attributes will assure the secrets are kept even if your mon nodes die. If a new secret for anything ...
[ { "docid": "bdeaffd95a5048afaa3c11002a726c3d", "score": "0.601447", "text": "def ceph_chef_bootstrap_osd_secret\n if node['ceph']['encrypted_data_bags']\n secret = Chef::EncryptedDataBagItem.load_secret(node['ceph']['bootstrap-osd']['secret_file'])\n Chef::EncryptedDataBagItem.load('ceph', 'boots...
[ { "docid": "8cf8b6c0a06ffb7a5a9bf751acc01da3", "score": "0.6806058", "text": "def ceph_chef_save_bootstrap_osd_secret(secret)\n node.set['ceph']['bootstrap-osd'] = secret\n node.save\n secret\nend", "title": "" }, { "docid": "8cb20861fd39a457712c52995798c927", "score": "0.67892265", ...
b5b22342499667a0697272df9944e973
DELETE /tests_executors/1 DELETE /tests_executors/1.json
[ { "docid": "016bf861ece38fe49f36ccbd6bf5d100", "score": "0.7520972", "text": "def destroy\n @tests_executor.destroy\n respond_to do |format|\n format.html { redirect_to tests_executors_url, notice: 'Tests executor was successfully destroyed.' }\n format.json { head :no_content }\n end...
[ { "docid": "561b57f9fa7222e279229f89405ac038", "score": "0.6860619", "text": "def test_delete_not_exist_experiment\n not_exist_id = '10000'\n output = `curl -X DELETE http://localhost:8080/metrics/experiments/#{not_exist_id}`\n assert_match \"<html>\", output, \"TEST 3: delete not existing e...
a1565791f5b572a50ea89da8b5eb25db
Moves piece on board. Piece overtakes an existing opponent's piece
[ { "docid": "0de2e0c5bdb1b92f0ee450d4fd377bc3", "score": "0.0", "text": "def overtaken(piece, start_arr, finish_arr)\n\t\tovertaken(@board[start_arr].type, start_arr, finish_arr)\n\tend", "title": "" } ]
[ { "docid": "7e6f000388c5ae15caf64cfa234edb32", "score": "0.7926279", "text": "def move_piece!(color, from, to)\n raise \"There is no piece in that square\" if from.empty?\n raise \"Moving onto your own piece\" if color == self[to].color\n\n taken_piece = self[to].dup unless self[to].symbol == :...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d496f8e95c00a9ba8d3d269e70343ddf", "score": "0.0", "text": "def set_movielist\n @movielist = TaMovie.where(id: 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...
f6b269c4b72f6cf064abfed67b79e0d0
I: +join+ expecting argument.
[ { "docid": "89d611c307ac12b04d8b7355522dd5f9", "score": "0.76921654", "text": "def J\n unary_method \"join\"\n end", "title": "" } ]
[ { "docid": "ffa776f48e89481534e2df9e9a27ee4b", "score": "0.83633304", "text": "def my_join(join = '')\n res = ''\n self.each_index do |i|\n res += self[i] \n res += join if i != self.length - 1\n end\n res\n end", "title": "" }, { "docid":...
9fb3559227aee167bff085f9909d1636
PUT /userprofiles/1 PUT /userprofiles/1.json
[ { "docid": "e097e18bf196afb1f838daceb5ae7a06", "score": "0.7088497", "text": "def update\n @userprofile = Userprofile.find(params[:id])\n\n respond_to do |format|\n if @userprofile.update_attributes(params[:userprofile])\n format.html { redirect_to @userprofile, notice: 'Userprofile wa...
[ { "docid": "89eaa8034955d562ad80419908606e27", "score": "0.7455372", "text": "def update_current_user_profile_data(user_profile_data)\n # PUT /d2l/api/lp/(version)/profile/myProfile\nend", "title": "" }, { "docid": "800208431ddcdee1fcfab4b5b1287161", "score": "0.7371601", "text": "d...
f556e07d2d60eab5ef77e2104392fa09
Same as Pollrun, but will yield [nil, nil] to the block if interrupted. Return value may be an empty hash if the poller was killed.
[ { "docid": "4d5130d49caba6d868f2d8463972bc9c", "score": "0.50333667", "text": "def run(&block)\n raise \"#{self} cannot run; it was permanently killed.\" if @dead\n \n super do |socket, revents|\n if socket == @int_sock_rep || socket == @int_sock_pull\n key, * = socket.rec...
[ { "docid": "d7948f2990fd3872f9bb77770cf05b11", "score": "0.57569903", "text": "def run(&block)\n return {} if @poll_items.empty?\n \n # Convert seconds to miliseconds.\n timeout = @timeout > 0 ? (@timeout * 1000).to_i : @timeout\n \n # Poll\n rc = LibZMQ::zmq_poll @pol...
ca06d163aca4e34ec05d3c8ed47f3af7
This method converts a standard string keyed hash into a symbol keyed one. ==== Parameters input:: The Hash to be converted.
[ { "docid": "8775894f3a57bfbf6198478b2bd3b3d7", "score": "0.0", "text": "def convert_values(input)\n output = {}\n input.each {|key, value| output[key.intern] = value} if input\n output\n end", "title": "" } ]
[ { "docid": "81d6af9ff5aeddd9cbee5367cbc22c41", "score": "0.75110537", "text": "def symbolify(hash)\n Hash[hash.map{ |k, v| [k.to_sym, v] }]\nend", "title": "" }, { "docid": "7805e34e80371c3ef3fc258d4baefc06", "score": "0.7501988", "text": "def symbolize hash\n hash.inject({})...
02b19620b6e2a040aaac025e97d662f7
GET /listings/1 GET /listings/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e70649c15d97f7df223d71cd23d54d9a", "score": "0.78593236", "text": "def index\n @listings = Listing.all\n render json: @listings\n end", "title": "" }, { "docid": "3201658759b4b14909b3a85172768170", "score": "0.7774001", "text": "def index\n @listings = Listing.o...
61ccf6a0ad281d891d7ec61739868481
main convert to routine. it loads google spreadsheet and dump it as lua tables.
[ { "docid": "d5f042947bb39901ebae71ecbba9a5ac", "score": "0.68377817", "text": "def convert()\n\t\t\t\t# Logs in.\n\t\t\t\t# You can also use OAuth. See document of\n\t\t\t\t# GoogleDrive.login_with_oauth for details.\n\t\t\t\tsession = GoogleDrive.login(@acc, @pass)\n\t\t\t\tp @ignores\n\t\t\t\tif @igno...
[ { "docid": "eb6570110758481287ff5fb4815f0090", "score": "0.6021733", "text": "def process_data()\n \tSpreadsheet.client_encoding='UTF-8'\n\tbook=Spreadsheet::Workbook.new\n\tsheet = book.create_worksheet\n\tsheet.row(0).push 'Link Text','Link Url','Description' #For including headers to the spreadshee...
55902c82ea5456c42913ab97b3a04e34
method to strip out noncharacters, and downcase
[ { "docid": "f9a7d9fd125b0f3083e61c709fef627b", "score": "0.0", "text": "def wordprep(word)\n return word.gsub(/\\W/,'').downcase\nend", "title": "" } ]
[ { "docid": "2aeb4e27a7220b3aecfaeaaae9b144ad", "score": "0.7981213", "text": "def downcase(string); end", "title": "" }, { "docid": "e7c73dcdf236d91791a71c0867a9a294", "score": "0.79629284", "text": "def downcase! \n end", "title": "" }, { "docid": "29350f8b10bab0025a4...
41c65bd84719245b690c4a09b54e6a21
toggle between completed and imcomplete return the final state of the task
[ { "docid": "fd57da800bb9ed09cf603dd139068731", "score": "0.73995495", "text": "def toggle_completed\n update completed: !completed\n completed\n end", "title": "" } ]
[ { "docid": "fd6be1ba3be750c410665c8e86b6dd5d", "score": "0.76370645", "text": "def mask_as_done!\n @completed = true\n end", "title": "" }, { "docid": "5d6cdd2f9239f47e728d0b99ec93ea81", "score": "0.719821", "text": "def completed? # Is task completed? method\n completed_statu...
1584372e43c95338ad1c18105e00cb14
DELETE /collections/1 DELETE /collections/1.json
[ { "docid": "25e5d840109eddfe9ac68804113b6c22", "score": "0.66093147", "text": "def destroy\n gallery = @collection.gallery_id\n if @collection.destroy\n message = \"Collection destroyed successfully\"\n else\n message = \"Collection could not be destroyed because it has images in it\"...
[ { "docid": "7af8e802329b5cbfa44af60c226c489f", "score": "0.7955601", "text": "def destroy\n response = connection.delete(\"/collections/#{id}\")\n (200..299).include?(response.status)\n end", "title": "" }, { "docid": "0f4936d0826bd5a7803ea10a2f352fee", "score": "0.76791966"...
b1555feead3a662d84f8b741d88a6054
GET /activities GET /activities.json
[ { "docid": "7e3e2aa52ba1339605bb42675d61d9ba", "score": "0.7368234", "text": "def index\n @activities = Activity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @activities }\n end\n end", "title": "" } ]
[ { "docid": "d267af8dacd7e9798ee4fab575f48a47", "score": "0.86669844", "text": "def activities\n get_call('activities.json')\n end", "title": "" }, { "docid": "27e037574473aa2cbaf3d351d7e87b56", "score": "0.8442676", "text": "def all_activities\n get('activities.json')\n ...
5ffeacd67e46e579a4c85cd407a20bf4
Get role Get the details of the specified role. To see all the roles, use [List roles](operation/getAllRoles).
[ { "docid": "189be550024c9eab515de8d328c060f8", "score": "0.66147804", "text": "def get_role_with_http_info(role_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_role ...'\n end\n # verify the required parameter 'role...
[ { "docid": "dcaf6ea3f33594500edfa394d7fa2c98", "score": "0.78039527", "text": "def get_role(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'GetRole'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_meth...
088fcdcbce0a64ec78792b5c305a3c8e
Get your transactional email activity aggregated per day
[ { "docid": "c6f59a24567d9354557f131065c9156e", "score": "0.0", "text": "def get_smtp_report_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_smtp_report ...'\n end\n if @api_client.config.client_s...
[ { "docid": "bf6fd96c546207ea1a644405a80122e7", "score": "0.627577", "text": "def scheduled_emails\n @chat_history = EmailConversation.where(\"sender_id = #{current_user.id} AND sent_date is not null\")\n end", "title": "" }, { "docid": "ce2ab3887f2f6c1676eb53359bc15e6c", "score": "0....
2be15e7e68f15a1db4e55deae8993f29
DELETE /chatrooms/1 DELETE /chatrooms/1.json
[ { "docid": "86cc918fef52d18d67024348614411dc", "score": "0.74880373", "text": "def destroy\n @chatroom.destroy\n respond_to do |format|\n format.html { redirect_to chatrooms_url, notice: 'Chatroom was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "2915fb002b6dff96ca0f7db7f2d33d8f", "score": "0.7812962", "text": "def destroy\n @chatroom = Chatroom.find(params[:id])\n @chatroom.destroy\n\n respond_to do |format|\n format.html { redirect_to chatrooms_url }\n format.json { head :no_content }\n end\n end", "title...
4007792b1e61698cdc58399ba3cbc30c
Use this entry point.
[ { "docid": "d851d0b1253c2694f8d2a64b00c725b6", "score": "0.0", "text": "def rotate_hue(angle_degrees, str)\n replace_colours(str) do |hsl| \n h,s,l = *hsl\n [h+angle_degrees, s, l]\n end\n end", "title": "" } ]
[ { "docid": "bc3e0880d8b9c0c44e60030e2f8d8933", "score": "0.74309367", "text": "def run\n\n\t\tend", "title": "" }, { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.7260018", "text": "def main\n\n end", "title": "" }, { "docid": "e95cfad9c46711f2a05857f5bcaa...
06c37e4c0e4f2ec9ba890c4202e05759
Find device by `type` and `major` and `minor` numbers
[ { "docid": "b1286191081c1780059e147473a25bd7", "score": "0.8310477", "text": "def find(type, major, minor)\n sync do\n devices.detect do |dev|\n dev.type == type && dev.major == major && dev.minor == minor\n end\n end\n end", "title": "" } ]
[ { "docid": "4418cfe7dc8347297cf03416034641c3", "score": "0.85593086", "text": "def find(type, major, minor)\n devices.detect do |dev|\n dev.type == type && dev.major == major && dev.minor == minor\n end\n end", "title": "" }, { "docid": "aec3248d16bb0874fc4a4a119babad08",...