query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b5446bf95a6b711b0b07a2aef67d147a
Caches display math. We support both TeXstyle $$...$$ and LaTeXstyle \[ ... \].
[ { "docid": "0a787154f23519adf9e19702d5346377", "score": "0.75458467", "text": "def cache_display_math(output)\n output.gsub!(/\\\\\\[(.*?)\\\\\\]|\\$\\$(.*?)\\$\\$/m) do\n math = \"\\\\[ #{$1 || $2} \\\\]\"\n equation_element(math)\n end\n end", "title": "" } ]
[ { "docid": "c6738dbda01758909a421af54df81b96", "score": "0.7264078", "text": "def cache_display_inline_math(output)\n output.tap do\n cache_display_math(output)\n cache_inline_math(output)\n end\n end", "title": "" }, { "docid": "dfb527b5f2f9e4f88e18bcc14ea9f0fb", ...
3e1e1f37f24b64b06daa9628f9d31f68
for zip64 we have some extra items to write before end of central directory
[ { "docid": "1e746701e14aebee3ee23067d125f344", "score": "0.68277574", "text": "def write_end_of_central_directory\n @mgr.write_bytes(z64_end_of_central_directory)\n @mgr.write_bytes(z64_end_of_central_directory_locator)\n @mgr.write_bytes(end_of_central_directory)\n end", "title": "" } ]
[ { "docid": "1c12eb3f25b0127a4d6ff16bcc7b57d6", "score": "0.7293009", "text": "def write_zip64_support; end", "title": "" }, { "docid": "94bcccddd9f31d56c82ba5e896b0a5c5", "score": "0.7173415", "text": "def write_zip64_support=(_arg0); end", "title": "" }, { "docid": "8250...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "e60da727ec32ff8b3a1a7b4b72e0fbf5", "score": "0.0", "text": "def runner_params\n params.require(:runner).permit(:name, :age)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7942467", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6957796", "text": "def permitted_params\n params.permit!\n end", "title":...
a55b5d7f6583ba1b86bf8fdea2b3b15e
def first_bought(filter=nil) item = pb_saleorders.order("created").first return item.nil? ? "" : Time.at(item.created).to_datetime.strftime("%d%m%Y, %H:%I %p") end def last_bought(filter=nil) item = pb_saleorders.order("created DESC").first return item.nil? ? "" : Time.at(item.created).to_datetime.strftime("%d%m%Y, %H:...
[ { "docid": "4cab02c0c03043ccca84d4c48243cb5c", "score": "0.0", "text": "def bought_order_list_link\r\n ActionView::Base.send(:include, Rails.application.routes.url_helpers)\r\n link_helper = ActionController::Base.helpers\r\n \r\n link_helper.link_to(\"Xem chi tiết\".html_safe, {controller: ...
[ { "docid": "3163b65498438206aac274fc2f0ba3eb", "score": "0.64764833", "text": "def latest_solobook\n self.solobooks.find(:first, \n :conditions => \"published_on <= NOW()\", \n :order => \"published_on DESC\")\n end", "title": "" }, { "docid"...
4aa034b5617e087c0ab8d04af3cea6d5
mosaic effect _width_ :: width for mosaic unit. _height_ :: height for mosaic unit.
[ { "docid": "196d338006bc1f015829a452fb01a59d", "score": "0.7990888", "text": "def mosaic(width, height)\n Ext.pkl_mosaic(@pkl_image, width, height)\n self\n end", "title": "" } ]
[ { "docid": "2de2b21071157c24fa0006be53ccbdd4", "score": "0.70854956", "text": "def test_mosaic\n Pikl::Image.open(SAMPLE_IMAGE) do |img|\n img.mosaic(3,3)\n end\n end", "title": "" }, { "docid": "2c9a3334faac3608f4517812f8aea080", "score": "0.68188554", "text": "d...
0c46fff91348690e7138c6ba2a6b2c02
push jsonstring into array (sending cache)
[ { "docid": "3c54b698fb05881e92fcf6d97f7bc811", "score": "0.5773831", "text": "def push_block_with_to_json(host_item,block_hash,batch_arr)\r\n tmp_hash = { host_to: host_item['host'], port_to: host_item['port'], format_to: 'json' }.merge(block_hash[:filebot] || {})\r\n block_hash[:filebot] = tmp_ha...
[ { "docid": "988c5410d738bcc335015e73e3e743d7", "score": "0.66072893", "text": "def _push data\n\t\t\tresponse << data.to_s\n\t\tend", "title": "" }, { "docid": "927bab6f2a7dad71d13b9b10e076f4e1", "score": "0.61418706", "text": "def push( content )\n store.push( JSON.dump( conten...
a549d1a3105f1b962d62ff00081db486
Convert Kelvin to Fahrenheit
[ { "docid": "f23d791e3f3883c2043c26e67a2473a9", "score": "0.8403565", "text": "def kelvin_to_fahrenheit(temp)\n temp.to_f * 9/5 - 459.67\nend", "title": "" } ]
[ { "docid": "bbb8af01aa785dbe6ea96c8946bf3b6d", "score": "0.8189414", "text": "def fahrenheit_to_kelvin(temp)\n (temp.to_f + 459.67) * 5/9\nend", "title": "" }, { "docid": "9f3039102290d68c07eedad155f06491", "score": "0.8119704", "text": "def kelvin_to_fahrenheit(temp)\n 1.8 * (te...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e6917e35de2514f51ea121f0218e5173", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:post_id, :content, :email)\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...
25be61d0e4433a96c059f52dcd7fae1c
Return the Point for next move
[ { "docid": "c544c6eaf31d7c850748e60b0362dced", "score": "0.8437211", "text": "def next_move\n @point.add(next_point)\n end", "title": "" } ]
[ { "docid": "7b03b2998668a24bc6dfee88176f5f79", "score": "0.7800904", "text": "def next_point\n POINTS[POINTS.index(self.points)+1]\n end", "title": "" }, { "docid": "3309837472eb684554d2f367ff119365", "score": "0.76828384", "text": "def next_coordinates\n get_direction\n cu...
4dc595f586ca64390b278f757ef88eb3
Construct an ARP packet that's either a :request or a :reply. Only IPv4 over ethernet is supported
[ { "docid": "e00a43541dbb1bdbf6686530f8671402", "score": "0.79033095", "text": "def arp(operation, opts = {})\n sender_mac = opts[:sender_mac] || opts[:src_mac] || @src_mac\n target_mac = opts[:target_mac] || \"\\x00\\x00\\x00\\x00\\x00\\x00\"\n sender_ip = ip_addr(opts[:sender_ip])\n target_...
[ { "docid": "672009d7ee4746e6e130334c9d445941", "score": "0.7122133", "text": "def request_for message, src_mac, src_ip\n puts \"Send ARP request!\"\n dpid = message.datapath_id\n out_port = Trema::Controller::OFPP_FLOOD\n tgt_ip = message.ipv4_daddr.to_s\n \n self.send_packet_out_arp_r...
2073351d7d52346e8675c4dc4895342c
GET /cashtables/1 GET /cashtables/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "574c60dcadcba900e97906c22fb2c067", "score": "0.7167918", "text": "def index\n @cashtables = Cashtable.all\n\n\n\n\n\n end", "title": "" }, { "docid": "08b31afe2a9fb2767e3ece0e12e3af61", "score": "0.6636833", "text": "def index\n @cashes = Cash.find(:all, :condition...
c27ed006260bca99e51cfebf813b2696
get xrp amount of transaction
[ { "docid": "3190b06fe59adda06832a4746accab54", "score": "0.8131907", "text": "def xrp_amount\n (self.amount / 1000000).floor\n end", "title": "" } ]
[ { "docid": "e4a78ebfa2359553d917449ecc93e5c9", "score": "0.75750935", "text": "def gettransactionamount()\r\n return getvalue(SVTags::XACTION_AMOUNT)\r\n end", "title": "" }, { "docid": "db5bc4140a224576be38cf2f05825fba", "score": "0.67916477", "text": "def rrp_inc_sales_tax\n ...
25c6145e71a28c2fbb2ac48649cf1a44
GET /articles/1 GET /articles/1.json
[ { "docid": "b1c463bfda0722cfafd8906cf67166a7", "score": "0.0", "text": "def show\n add_breadcrumb 'shopping cart'\n end", "title": "" } ]
[ { "docid": "d695cde7c2c0621e81aae9eb9677e9bf", "score": "0.7745946", "text": "def show\n @article = Article.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articles }\n end\n end", "title": "" }, { "docid": ...
79a930ef778ae59a4ef4b0f8da01b576
GET /administrative_regions GET /administrative_regions.json
[ { "docid": "2e80d4f8b1a713fb1239b35a5b38a1cf", "score": "0.76548386", "text": "def index\n @administrative_regions = AdministrativeRegion.all\n end", "title": "" } ]
[ { "docid": "4bb1eaff438740060ee0d18bd01f7fa3", "score": "0.7460801", "text": "def geographic_regions\n self.dig_for_array(\"geographicRegions\")\n end", "title": "" }, { "docid": "d558052b4b78b0651391e3da6c0219c0", "score": "0.7044896", "text": "def geographic_regions\n self.d...
c2e41ac8d53dddc38e148747ea3811ec
Predict how the values and object ids will change throughout the flow of the code below: Answer: within each section
[ { "docid": "d52d8bcc6398a9064faf80a468f0c8ff", "score": "0.5675565", "text": "def fun_with_ids\n a_outer = 42\n b_outer = \"forty two\"\n c_outer = [42]\n d_outer = c_outer[0]\n\n a_outer_id = a_outer.object_id # object_id of the literal 42\n b_outer_id = b_outer.object_id # obje...
[ { "docid": "87afb298eac524b43ae630727e701da7", "score": "0.625252", "text": "def fun_with_ids\n a_outer = 42\n b_outer = \"forty two\"\n c_outer = [42]\n d_outer = c_outer[0]\n\n a_outer_id = a_outer.object_id\n b_outer_id = b_outer.object_id\n c_outer_id = c_outer.object_id\n d_outer_id = d_out...
7c094457a35182238ab8d7a5d024ff9a
Abstract syntax: ================ ASSERT ::= VAR |> NUM | VAR = NUM AND_ASSERT ::= ASSERT & AND_ASSERT STAR_ASSERT ::= ASSERT STAR_ASSERT
[ { "docid": "461c26d07ded408794e31b099b124f39", "score": "0.55496395", "text": "def parse_assertion assertion_file\n postcond = \"\"\n File.open assertion_file do |file|\n postcond = file.gets\n end\n halves = postcond.split /\\s*@\\s*/\n ands = halves[0]\n stars = halves[1]\n and_asserts = [...
[ { "docid": "4cbd959c5782cf61165c96c2d40a04ec", "score": "0.63096994", "text": "def assert_syntax_error(*)\n true.should == true\n end", "title": "" }, { "docid": "4cbd959c5782cf61165c96c2d40a04ec", "score": "0.63096994", "text": "def assert_syntax_error(*)\n true.should ...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "497a2c6438d4d060759a8d7318d51113", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n message_id == o.message_id &&\n account_id == o.account_id &&\n source_tn == o.source_tn &&\n destination_tn == o.d...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.768239", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193c...
82015ded8083b4f6019157f1bb232dab
This method creates roles from an Ansible inventory
[ { "docid": "1ddec29bfed0a61d25ccc04daf607b42", "score": "0.70805246", "text": "def ansible_roles(file = nil)\n file ||= \"config/ansible/#{fetch(:stage)}\"\n\n contents = IO.read(file)\n\n header = '=' * 30 + \" Reading roles from Ansible inventory \" + '=' * 30\n puts header\n\n current_role = nil...
[ { "docid": "41cc1a633d3de610f634e50166852e05", "score": "0.6165574", "text": "def make_roles\n logger.debug \"CALLING CREATE ROLES\"\n self.roles.create :name => \"#{self.cp_title} Edit\", :critical_process_id => self.cp_secondary_id, :edit => true, :review => false\n self.roles.create :name =>...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "1844f06b1dc222f867126fc7068738b1", "score": "0.0", "text": "def update!(**args)\n @ranges = args[:ranges] if args.key?(:ranges)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.7307693", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72636455", "text": "def update(...
ca00b8bd0934182e7ad0b948599c7901
url uri/products/:id/edit path edit_product_path(id) http mehod GET roles & responsibilitiesto find the record the usr is trying to edit and display it on a form
[ { "docid": "31d43f46fb3ed768c2ebf321856eea29", "score": "0.7062627", "text": "def edit \n @product=Product.find(params[:id])\n end", "title": "" } ]
[ { "docid": "2952f377848cd54ddb138f3dad5ec525", "score": "0.79027826", "text": "def edit\n #for edit action in product controller we have to find the product through id\n end", "title": "" }, { "docid": "bf2373c121c6c43432871e320702292f", "score": "0.78817976", "text": "def ...
fe6b3e86e9c4b8765310c9bc0af8e402
do not allow offerstartdate to be less than current date
[ { "docid": "ec004fe1fc4b5b5941c54546625cef56", "score": "0.84795666", "text": "def offerstartdate_cannot_be_in_the_past\n\t\terrors.add(:offerstartdate, \"Offer Start Date cannot be less than Todays date :( ! \") if offerstartdate < Date.today\n\tend", "title": "" } ]
[ { "docid": "404913704bfbbc4c1591c2ea51fe786a", "score": "0.78932154", "text": "def offerenddate_cannot_be_in_the_past\n\t\terrors.add(:offerenddate, \"Offer Start Date cannot be less than Todays date :( ! \") if offerenddate < Date.today\n\tend", "title": "" }, { "docid": "66b6871e6eaa9dca7a...
91bac2e39997078160bd9a9e354a2755
POST /observacao_vocacionados POST /observacao_vocacionados.json
[ { "docid": "16d8ee9519399294b209c6aba3988f4b", "score": "0.70221555", "text": "def create\n @observacao_vocacionado = ObservacaoVocacionado.new(params[:observacao_vocacionado])\n\n respond_to do |format|\n if @observacao_vocacionado.save\n format.html { redirect_to :action => :index, :...
[ { "docid": "506c44305c6d9c46a57b66ed09c710e4", "score": "0.70190394", "text": "def new\n @observacao_vocacionado = ObservacaoVocacionado.new\n\n if params[:vocacionado]\n @observacao_vocacionado.vocacionado_id = params[:vocacionado]\n end\n\n respond_to do |format|\n format.html # ...
51781c12eefec35518c41ff5501d478d
=begin rdoc Return an Image object for the specified ident (SHA). =end
[ { "docid": "3a4112afc76821dda61b00af90a1ae67", "score": "0.62591934", "text": "def image(ident)\n @images[ident]\n end", "title": "" } ]
[ { "docid": "8eeeaa334835b680d7563e49079df653", "score": "0.67780906", "text": "def get_image(oid)\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "f6758f64f43e92b0913e2c26f7dbb66e", "score": "0.6668103", "text": "def image_sha(image_id)\n get_image_tag(imag...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7419adf27a40488629753cce261cb1ae", "score": "0.0", "text": "def set_theme\n @theme = Theme.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60326946", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015941", "text": "de...
ca2cb586eeeb0fe7d803b11c5868eb27
Provide a detailed, user friendly representation source://twilioruby//lib/twilioruby/rest/studio/v2/flow.rb272
[ { "docid": "473108fa97cee58671b779c2ccfec06f", "score": "0.0", "text": "def inspect; end", "title": "" } ]
[ { "docid": "f696fd2cd8006d314f2039a49cd0e367", "score": "0.6371228", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.FlexApi.V1.FlexFlowInstance #{values}>\"\n end", "title": "" }, { ...
115e2e5d8b87d4d952d62eba69a36506
Flexible default_task, compatible with haml's CLI
[ { "docid": "e0c4c129817001e070f12389dd1932b1", "score": "0.0", "text": "def method_missing(*args)\n return super(*args) if args.length > 1\n render(args.first.to_s)\n end", "title": "" } ]
[ { "docid": "0f7d4469f2d986df95a1c34e2683a733", "score": "0.8202863", "text": "def default_task task\n if @default_task.nil? or task == :default\n @default_task = task\n end\n end", "title": "" }, { "docid": "bf42b64c5777973e5c71397e5296074f", "score": "0.7855221", "text":...
948e0fcbd3b6d46cc6d2304b237d3c98
def create_with_fb user = Account.from_omniauth(env["omniauth.auth"]) session[:user_id] = user.id redirect_to home_path end
[ { "docid": "6984b6783aeaedfc5cf653778fa42aba", "score": "0.0", "text": "def failure\n super\n end", "title": "" } ]
[ { "docid": "d75cf92684fd80df22894a19fa9dbc2e", "score": "0.9320993", "text": "def createFacebook\n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n redirect_to root_path\n end", "title": "" }, { "docid": "fabd07485d0b706569329e4f3a9c4fc9", "scor...
fb57757669d989570a79a329ff358585
Hack, ignore the desc calls performed by the original initializer.
[ { "docid": "e53412c0116cfc8eb8b7a800ac881b2b", "score": "0.0", "text": "def desc(description)\n # no-op\n end", "title": "" } ]
[ { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.6826469", "text": "def initalize; end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.6826469", "text": "def initalize; end", "title": "" }, { "docid": "625c30ca8c654e1f94ef4de9cbfbfec2...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "b78321dd0972f41ca188874c7017e53d", "score": "0.0", "text": "def update!(**args)\n @error_message = args[:error_message] if args.key?(:error_message)\n @value = args[:value] if args.key?(:value)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
da2aa7d5843f3c2ed844832d3b3cf5fc
This method selects the name of the third stage if it exists RETURNS STRING
[ { "docid": "24da1caee10f3ff6dea5e86d48bfe8c9", "score": "0.68215835", "text": "def stage3\n\t\tif @api_evolution[\"chain\"][\"evolves_to\"][0] == nil ||\n\t\t\t@api_evolution[\"chain\"][\"evolves_to\"][0][\"evolves_to\"][0] == nil ||\n\t\t\t@api_evolution[\"chain\"][\"evolves_to\"][0][\"evolves_to\"][0]...
[ { "docid": "0c3c45277ae83bd835d2f18d366558ee", "score": "0.6656138", "text": "def stage1\n\t\treturn @api_evolution[\"chain\"][\"species\"][\"name\"]\n\tend", "title": "" }, { "docid": "7f90c8a746bb51df8c0e094b375544d2", "score": "0.64345735", "text": "def stage2\n\t\tif @api_evoluti...
29c7b89a1527274535e02158841e8d07
GET /producto_padres GET /producto_padres.json
[ { "docid": "ba26acf2679d56955c2df74e976b1be5", "score": "0.70582503", "text": "def index\r\n @producto_padres = ProductoPadre.all\r\n end", "title": "" } ]
[ { "docid": "541ead84016a78c910d43c9b35c94a2b", "score": "0.6802754", "text": "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usuario.productos\n else\n @productos = Producto.all\n render json: @productos\n end\n end",...
2159c5db594c95725e1d9fad8d7ebb32
Returns true if a valid move for current player is available; else returns false
[ { "docid": "8a8a0aa5d95c726a8562a16cce7604fe", "score": "0.74664044", "text": "def isValidMoveAvailable()\n\t\tisValidMoveAvailableForDisc(@disc)\n end", "title": "" } ]
[ { "docid": "b982ed2acbd8b8c6b19ebf422a71ff9e", "score": "0.8317002", "text": "def moves_available?(player)\n !@board.moves(player).empty?\n end", "title": "" }, { "docid": "b0da4245323982b962d5b8877ba41fa0", "score": "0.78873295", "text": "def move_valid_for?(player_id)\n retu...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "4dec71f2352f63567c186eef22958e4b", "score": "0.0", "text": "def shipper_params\n params.require(:shipper).permit(:shipperName, :phone)\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"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "429b9d4f83049da27170dc0a0f3ac86b", "score": "0.0", "text": "def requisition_params\n params.require(:resquisition).permit(:text)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497761", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6959097", "text": "def strong_params\n params.require(:request).permit(param_white...
c534e6503e141744b09f4990899c591a
Delete Tier1 static routes Delete Tier1 static routes
[ { "docid": "83705a6192897f6ca5778cd75cf75dc8", "score": "0.6733651", "text": "def delete_tier1_static_routes(tier_1_id, route_id, opts = {})\n delete_tier1_static_routes_with_http_info(tier_1_id, route_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "f71b20f7755d82a15c2fa0b403579f2f", "score": "0.79733676", "text": "def delete_all_static_routes\n super\n end", "title": "" }, { "docid": "71c8fc67a1426a5df598215bbf9183c2", "score": "0.76573414", "text": "def delete_static_route\n super\n end", "title...
fe695a48f73868ae8b08a11b46648220
FIXME: Refactor this somewhere else Code borrowed from icalendar gem
[ { "docid": "c8ab940c5b710683f4551d57e9df720d", "score": "0.0", "text": "def time_to_ical( time )\n s = \"\"\n\n # 4 digit year\n s << time.year.to_s\n\n # Double digit month\n s << \"0\" unless time.month > 9 \n s << time.month.to_s\n\n # Double digit day\n ...
[ { "docid": "506a6b235515f01f7add93e8415f0ab7", "score": "0.72024953", "text": "def interview_calendar\n end", "title": "" }, { "docid": "553f7cf5638c38fb5fdd939d06c4b727", "score": "0.69649553", "text": "def make_cal(events,link,venue)\n cal = Calendar.new\n\n cal.product_id = \"-...
d99aeeff01c4a1ec8637507e292538b1
DELETE /authentications/1 DELETE /authentications/1.json
[ { "docid": "e6c97514569f9aa69c6ceba65b8a072c", "score": "0.0", "text": "def destroy\n @light_switch.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Switch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "daf6178ecdace5803de6914dee99b770", "score": "0.77333516", "text": "def destroy\n @authentication = logged_in_user.authentications.find(params[:id])\n @authentication.destroy\n\n respond_to do |format|\n format.html { redirect_to authentications_url }\n format.json { head ...
ef799f9601f2951da6a995cd4973b988
GET /devotions GET /devotions.xml
[ { "docid": "0cc2f6b91d4a7a81ef4129175b0edcc3", "score": "0.6952885", "text": "def index\n @devotions = Devotion.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @devotions }\n end\n end", "title": "" } ]
[ { "docid": "6505aae3d0ffb133acc4444fed43bb68", "score": "0.6109915", "text": "def show\n @devotion = Devotion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @devotion }\n end\n end", "title": "" }, { "docid": "2fb...
f9b33c12c3b5fae1273eae4d76946132
Integral power of the base: radixn for integer n; returns an integer.
[ { "docid": "aab54e017859545aca5c1ce3488c246b", "score": "0.83217674", "text": "def int_radix_power(n)\n (n < 0) ? (2**n) : (1<<n)\n end", "title": "" } ]
[ { "docid": "b3fb7f13f3da645ffdd0af2886aac553", "score": "0.8437357", "text": "def int_radix_power(n)\n @num_class.int_radix_power(n)\n end", "title": "" }, { "docid": "2449bc83212a446abfeb3716ea68d5c5", "score": "0.84226274", "text": "def int_radix_power(n)\n 10**n\n ...
cf0fb2fb4c39dc3bc2083b0fe941f9a3
Set all node level attributes to the given node
[ { "docid": "31161a49b6f451be10b7a366265ee650", "score": "0.6540836", "text": "def set_node_attributes(job)\n return if node_attributes.empty?\n\n nodes.concurrent_map do |node|\n node.reload\n\n node_attributes.each do |attribute|\n key, val...
[ { "docid": "c878fecb8cee5457431849afc902d09b", "score": "0.7300816", "text": "def transfer_node_attributes(nodes, attributes); end", "title": "" }, { "docid": "4bf33ff50f5129a1c91a9994450d64dd", "score": "0.70327544", "text": "def node=(val)\n attributes['node'] = val\n end",...
5bfbc8f5898790dd8d973296e0d2bf60
POST /introexams POST /introexams.json
[ { "docid": "bf84365fb3773d1b914460fe5969a5e6", "score": "0.6738807", "text": "def create\n @introexam = Introexam.new(introexam_params)\n\n respond_to do |format|\n if @introexam.save\n format.html { redirect_to @introexam, notice: 'Introexam was successfully created.' }\n forma...
[ { "docid": "de4df72d44944255e692156cb6f02e2a", "score": "0.65002084", "text": "def introexam_params\n params.require(:introexam).permit(:title, :message, :picture1, :testimonial1, :picture2, :testimonial2, :picture3, :testimonial3)\n end", "title": "" }, { "docid": "c7493054a356bf964...
125ce78988d8ff52a572490c1328de21
PATCH/PUT /m_empleados/1 PATCH/PUT /m_empleados/1.json
[ { "docid": "142ac7d5e83ee462a6575292f501e463", "score": "0.6569749", "text": "def update\n respond_to do |format|\n if @m_empleado.update(m_empleado_params)\n format.html { redirect_to @m_empleado, notice: 'M empleado was successfully updated.' }\n format.json { render :show, statu...
[ { "docid": "cee77a842090272c383a9428b455ebb5", "score": "0.6809546", "text": "def update\n @emprestimo = Emprestimo.find(params[:id])\n\n respond_to do |format|\n if @emprestimo.update_attributes(params[:emprestimo])\n format.html { redirect_to @emprestimo, notice: 'Emprestimo was succ...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "a112db11be45376c641c359b1b6f1149", "score": "0.0", "text": "def customers_browsing_time_logic=(customers_browsing_time_logic)\n validator = EnumAttributeValidator.new('String', ['is at least', 'is more than', 'is less than', 'is at most'])\n unless validator.valid?(customers_browsi...
[ { "docid": "8146b840a980695b919bbb80892fcc0c", "score": "0.6161179", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DE...
6c5f929d51ab7721e2f2c8b9cee3f3c2
Bumps the minor version. 1.5.1 > 1.6.0
[ { "docid": "f35d076406c422da42f7cbc89791fc05", "score": "0.821185", "text": "def bump_minor_version()\n Juwelier::Commands::Version::BumpMinor.build_for(self).run\n end", "title": "" } ]
[ { "docid": "636d2f86ccf6c425b09e1dd476e5cf66", "score": "0.83948535", "text": "def bump_minor_version; end", "title": "" }, { "docid": "d84d2ac8c063c15c7047ce7d146539e2", "score": "0.80538946", "text": "def bump_minor_version()\n Jeweler::Commands::Version::BumpMinor.build_for(sel...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "69ecf6349bf49e4089fa604f243739eb", "score": "0.0", "text": "def project_params\n params.require(:project).permit(:name, :serialnum, :create_date, :funder, :brief, :interest_rate,\n :gross, :balance, :endowment, :project_level_id, :project_state_id, :project_type_id, :comment,\n ...
[ { "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...
f13c0bde8eb61f236779a25a0e539706
GET /plants/1 GET /plants/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c4bcd2aaf3f57cd25d4b62a483a627c2", "score": "0.75742185", "text": "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plants }\n end\n end", "title": "" }, { "docid": "c2905df11288cb2149b9641...
593ac13a0b7a021314766fbf357a4d92
=begin Here is another solution, submitted by a Codewars user. Rather than using gsub like in my solution, it involves turning the string into an array of characters, mapping over them and turning each character into its current count in the counter hash, then joining it all back into a string. =end
[ { "docid": "bc7dbd2f37c93bcb00670f2710ee64c9", "score": "0.73966384", "text": "def str_numericals(s)\n h = Hash.new(0) ; s.chars.map {|c| h[c] += 1}.join\nend", "title": "" } ]
[ { "docid": "4dcf122f6b9078b73e935ff32e7302bf", "score": "0.7630662", "text": "def compressed_string(input_string)\n\tchar_counter = Hash.new(0)\n\tstring_array = input_string.split(\"\")\n\n\tstring_array.each do |letter|\n\t\tchar_counter[letter] += 1\n\tend\n\tchar_counter.keys.join(\"\")\n\t\nend", ...
f5b3bce328bae27fb3d12133e1e304f0
Private: add a valid configuration to the global set of named configs. config the config to store name the lookup value for this config Raises errors if the config is invalid or if a config named `name` already exists. Returns the config, if valid
[ { "docid": "0192ec4a4be66849da68d1e13e432911", "score": "0.63655853", "text": "def add_configuration(name, config)\n config.validate_config!\n @configurations ||= {}\n config.send(:cache_headers!)\n config.send(:cache_hpkp_report_host)\n config.freeze\n @configu...
[ { "docid": "5884233f15c4b75f8846eb5699c3e7fb", "score": "0.609133", "text": "def config(name)\n name = name.downcase\n return @config[name] if @config[name]\n @config[name] = @ruhoh.resources.load_collection(name).config\n end", "title": "" }, { "docid": "e7bd7421e571cf59a4...
f068259806455578f617777106e077ad
GET /people/new GET /people/new.json
[ { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.7880659", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" } ]
[ { "docid": "6591334d64f5ace8500a624da05f811a", "score": "0.79892075", "text": "def new\n @person = people_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "e4e2f0df213a8b75729f7...
d9c0baf27ee8bea25212c79b130e58ab
default behavior if subtitles are present without the :hover_text => true option
[ { "docid": "ce5807253163b2a6a00c9f6a5e060a46", "score": "0.79481465", "text": "def wants_subtitles?\n has_subtitles? && !wants_hover_text?\n end", "title": "" } ]
[ { "docid": "6919c6046d94d97d9a3b2280e0a78d60", "score": "0.82218426", "text": "def wants_hover_text?\n has_subtitles? && @options.has_key?(:hover_text) && @options[:hover_text]\n end", "title": "" }, { "docid": "1751a391e04cbcbeda867a355e6303ee", "score": "0.81877255", "text"...
9f5814ea161e8d3407bc4ec4bc0c6eac
A callback for SFTP status packets. By default, raises an exception unless the status is FX_OK, in which case the registered callback is invoked.
[ { "docid": "d20d190778ff4d801a72133d736e9c61", "score": "0.62693137", "text": "def do_status( code, message, language )\n raise StatusException.new( code, message, language ) unless code == FX_OK\n @callback[ Status.new( code, message, language ) ]\n end", "title": "" } ]
[ { "docid": "9f82433d1f9e9b47e938b207ef608bbf", "score": "0.64700496", "text": "def on_status(&f)\n @on_status = f\n end", "title": "" }, { "docid": "c7b05ef7ae3fc60d9eba3758c64f19f5", "score": "0.642797", "text": "def on_status(&f)\n @on_status = f\n end", "title": ""...
8d9af8fd0ff211191e020668be44b8e5
Create a new file named as current date and time
[ { "docid": "dd6f321ebd7a3c5ec5cf28f088bd940f", "score": "0.66560656", "text": "def new_file name\n raise \"Not a Valid Directory\" unless valid_directory?\n\n file_name = \"#{Time.now.strftime(\"%Y%m%d%H%M%S\")}_#{name}.txt\"\n \"#{output_directory_path}#{file_name}\"\n end", "title": "" ...
[ { "docid": "daa0ac2d481067990fbd27ee6380b8b6", "score": "0.7854639", "text": "def createFile(file,time)\n\t\tFile.open(file, \"w+\") do |f|\n\t\t\tf.print time\n\t\tend\n\tend", "title": "" }, { "docid": "27b56d8ea176558212990e8029e9d595", "score": "0.7592528", "text": "def manual_fi...
5beb13403731f87a59d851dcd7e00ff7
Connects to the datastore and loads up the preferences
[ { "docid": "d10decc27a5e945d518183a2b6959b4c", "score": "0.5910384", "text": "def initialize(user)\n @user = user\n @@prefs ||= self.class.get_db\n @@prefs.transaction(true) do\n @prefs = @@prefs.fetch(@user, {})\n end\n end", "title": "" } ]
[ { "docid": "8fd6defbe696ae7dc2ca1fe706659722", "score": "0.6432403", "text": "def set_preferences\n @preferences = Preference.first\n end", "title": "" }, { "docid": "c96db93775ddb3fa758d72d6437b5fd5", "score": "0.63877547", "text": "def load\n @preferences = load_from_file ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "73768c699b0cc4953578cbda05664ff1", "score": "0.0", "text": "def customer_params\n params.require(:customer).permit(:name, :category, :document_id, :since, :code, :birthdate, notes_attributes:[:id,:origin,:origin_id,:private,:text,:title,:_destroy],\n ...
[ { "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"...
e82930d6a69e956c47efb1dc3cf0f8ee
Returns the width of this String in em.
[ { "docid": "bec85b371dda8c3cf4aea92f90212e4a", "score": "0.7124861", "text": "def width\n width = 0\n self.each_char do |char|\n char_width = METRICS[char] || DEFAULT_WIDTH\n width += char_width\n end\n return width\n end", "title": "" } ]
[ { "docid": "35d1f46454755901b6826ea1cad2cfd7", "score": "0.7550161", "text": "def width\n @font.text_width(self.text)\n end", "title": "" }, { "docid": "35d1f46454755901b6826ea1cad2cfd7", "score": "0.7550161", "text": "def width\n @font.text_width(self.text)\n end", "titl...
7498759175c764d0b286b3023707e70b
DESTROY DELETE /shidou_recs/1 DELETE /shidou_recs/1.xml
[ { "docid": "4d136576632f8ff0a1cf1a6152a4cb58", "score": "0.73426104", "text": "def destroy\n @shidou_rec = ShidouRec.find(params[:id])\n @shidou_rec.destroy\n\n respond_to do |format|\n format.html { redirect_to(shidou_recs_url) }\n format.xml { head :ok }\n end\n end", "titl...
[ { "docid": "73153f8d1e3178596f85ce8dac6bfcd2", "score": "0.6800343", "text": "def sasc_destroy\n record = fetch_individual_record\n resource = resourcify(record)\n resource.destroy!\n head :no_content\n resource\n end", "title": "" }, { "docid": "60aee05e1c01eb91e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "436e8d326f1e3399ee60aedc8113d8ba", "score": "0.0", "text": "def set_dimission\n @dimission = Dimission.detail_by_id params[:id]\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165152", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60463154", "text": "def action_hook...
fd1bfe92e5028f5ba0e12d728d17d288
Test add_new_item method (requirement 8)
[ { "docid": "a56ef0317582199b95e9114b3b375e27", "score": "0.79543215", "text": "def test_add_new_item\n user = Trading::User.named('Peter')\n user.add_new_item('Cookies', 3)\n assert_equal(user.list_of_items[0].name,'Cookies')\n assert_equal(user.list_of_items[0].price,3)\n assert_equal(us...
[ { "docid": "9c2844c77ec12cd7e47bb029a20c9643", "score": "0.79764414", "text": "def test_create_todo_item\n item = @todo_list.add_item(\"Update resume\")\n assert_equal(2, @todo_list.count)\n end", "title": "" }, { "docid": "b092ce2af12cf8cb596af12fadc3c10d", "score": "0....
3d5301a4e65fd2518cad8bc30bd2af3f
end the run method
[ { "docid": "5f3ee67da87098a4f0322ee84dab4304", "score": "0.0", "text": "def get_door_sub_surfaces(model)\n \n # Sub-surface between finished space and outdoors\n finished_sub_surfaces = []\n model.getSpaces.each do |space|\n next if Geometry.space_is_unfinished(space)\n space.sur...
[ { "docid": "4da8b4c3bd5770e60b33f86f7d85b9b4", "score": "0.8253342", "text": "def run\n end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.81494945", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72...
a20691e2bbb0c05c320a7924c43538f9
Read node support bundle Read node support bundle
[ { "docid": "41158bf543254a400f4533b762ea3609", "score": "0.6810594", "text": "def read_node_support_bundle_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_node_support_bundle ...\"\n end\n ...
[ { "docid": "b30f808c1a45d79f682be2ea9a72c85c", "score": "0.75637656", "text": "def read_node_support_bundle(opts = {})\n read_node_support_bundle_with_http_info(opts)\n return nil\n end", "title": "" }, { "docid": "6436837b3c3dc2c7053e6d5dd1f5bbcc", "score": "0.5681313", ...
5eb5a9edb3f349ff79e40143b6acd9a4
Accesses the time an attempt of this Run should start at.
[ { "docid": "6e934e382021f49c2f8f0f4d4975cdcf", "score": "0.0", "text": "def offset()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = TimeSpanRef.new(Native.Run_offset(@handle.ptr))\n result\n end", "title": "" ...
[ { "docid": "b9cb5dadc5261bbcda7a219df7246122", "score": "0.7453522", "text": "def when_to_run\n time - @@REMINDER_TIME\n end", "title": "" }, { "docid": "b92a0996519bd6ddb0de3d04d476fde9", "score": "0.74205256", "text": "def start_time; end", "title": "" }, { "docid":...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dc24c1f445615857ca2d985f50bd6728", "score": "0.0", "text": "def set_person\n @person = Person.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...
cf35add3d68d73b2e9bf80892d5df774
This is method required for the CmdStager to work...
[ { "docid": "8110273e6e015e0d1107c42fa93fc20a", "score": "0.0", "text": "def execute_command(cmd, _opts)\r\n cmd_xp = \"EXEC master..xp_cmdshell '#{cmd}'\"\r\n send_login_msg(create_login_msg_sql(cmd_xp))\r\n end", "title": "" } ]
[ { "docid": "b8ab9179210057242404374fa57a6fc3", "score": "0.7160963", "text": "def cmd; end", "title": "" }, { "docid": "0e239f007217b6ec79d08ecdf18cb5a8", "score": "0.6931956", "text": "def supercommand!() __supercommand__ end", "title": "" }, { "docid": "2b12f915e0d4417e...
d2e7479a2838399bf7b41343304bb937
Requests an action from the API endpoint
[ { "docid": "2732490eee9a65eba2ce347c22011fa8", "score": "0.69845814", "text": "def request(action, data = nil)\n session.request(\n Endpoint.new.soap_action_name(entity_class, action),\n data\n )\n end", "title": "" } ]
[ { "docid": "ac672ee1809614f8860d087470c2f670", "score": "0.74206704", "text": "def hit\n action = params[:req]\n name = params[:name] || params[:id]\n render api_not_supported action, name\n end", "title": "" }, { "docid": "a88978f578e369797bdedc1baef19750", "score": "0.7300354...
501f842b954efc278ca6accd5e9d4728
before_action :set_id, only: [:show,:edit,:update,:destroy]
[ { "docid": "f122baa9c9273a26baca95ec2701e1a3", "score": "0.0", "text": "def index\n \tif @client.present?\n \t\tl_records_per_page = SystemParam.get_pagination_records_per_page\n\t\t @resources = @client.shared_resources.order(\"date_assert_acquired desc\").page(params[:page]).per(l_records_per...
[ { "docid": "5c56d2a86051819b9431147c2ed12cde", "score": "0.7235762", "text": "def edit\n # before_action\n end", "title": "" }, { "docid": "954206898305c61ca938dca26dc586d8", "score": "0.7030205", "text": "def edit\n # Instance variable defined in before_action\n end", "t...
0b1af0e4c16566a0329e9936d7929e46
Get all the recent orders eligible for whatsits
[ { "docid": "41bd22b11b8c8399a6eedda20a84e1c7", "score": "0.71968013", "text": "def get_eligible\n yesterday = DateTime.now - 1\n orders = ShopifyAPI::Order.all\n # Orders which have been fulfilled recently.\n orders.select do |order|\n order.fulfillment_status && \n order.fulfillments &&\n ...
[ { "docid": "ea194af057510cf9e60556ec810b6b7e", "score": "0.7163707", "text": "def get_eligible\n yesterday = DateTime.now - 1\n orders = ShopifyAPI::Order.all\n # Orders which have been fulfilled recently.\n orders.select do |order|\n order.fulfillment_status && \n order.fulfillments &&\n o...
bdf46653c7e20a1192e067c86f491ba1
translates data field [5,3] tp user fieldinput (e.g c5)
[ { "docid": "ad3355334b67cf5ff664988adcdcb91b", "score": "0.5990595", "text": "def translate_to_user_input(tupel)\n a = (tupel[0]+96).chr \n b = tupel[1].to_s\n return a + b\n end", "title": "" } ]
[ { "docid": "9cacda888f13a1da58be785333a2c66e", "score": "0.614939", "text": "def convert_user_input(input)\n processed_input = input.split(//).reverse\n [8 - processed_input[0].to_i, COLUMNS[processed_input[1].to_sym]]\n end", "title": "" }, { "docid": "c619b3073fe336e83da1ad68edc5c9a...
f779613319620d8c59d9d65a7464ae60
GET /emails GET /emails.json
[ { "docid": "91048010cba1bfc24b8f56d238edf058", "score": "0.6447727", "text": "def index\n @emails = Email.all\n respond_to do |format|\n format.html { render :html => @emails }\n format.xml { render :xml => @emails.to_xml }\n end\n end", "title": "" } ]
[ { "docid": "df2098f6fe76b92a1943af92f7873c49", "score": "0.830841", "text": "def emails\n get '/user/emails'\n end", "title": "" }, { "docid": "1a9fd73b5df1521d212896ed5cf25ad7", "score": "0.7904743", "text": "def emails\n respond_with_entity(api.get('/api/v1/profile/e...
d1b6f6c503a56f7d632340ef3509d284
AS5801 | User Profile/Settings Enabled upload of user profile images PUT '/b_image/int_xxid/:id/upload_and_link' Steps: 1. Register User 2. Get Int_Xxid 3. Upload & Link image 4. Get all images for user 5. Verify the image details 6. Get all images for int_xxid 7. Verify the image is linked to the int_xxid
[ { "docid": "1cf8c68f5d58bbfa868084893e79fc54", "score": "0.7312487", "text": "def test_monkey_upload_for_user_to_int_xxid\n # Step 1\n @user = setup_user\n\n # Step 2\n int_xxid = get_rateable_int_xxids_from_search('pizza', 'los angeles, ca').sample\n\n # Step 3\n upload_and_link_image...
[ { "docid": "b5a6c471cc077d7a424eae0329638c50", "score": "0.6932071", "text": "def update_profile_image_by_user_id\n # POST /d2l/api/lp/(version)/profile/user/(userId)/image\n # RETURNS: ?\nend", "title": "" }, { "docid": "fb5afe8a66ba1cb0b4b43bf97ba6824e", "score": "0.6842167", "te...
2e0eb33982889d8d790014beff1bf9d0
Convert the string to an array with the string in it.
[ { "docid": "be789fc439a7c4e3e0acc0e7a59410f2", "score": "0.0", "text": "def to_a\n [ self ]\n end", "title": "" } ]
[ { "docid": "2fc6bf7744439e96030104b8e74a0c92", "score": "0.7782348", "text": "def split_string_to_array(str)\n @string_as_array = str.split('')\n return @string_as_array\nend", "title": "" }, { "docid": "9372ce36bd88e60c51c10bb7619b7423", "score": "0.77522695", "text": "def string_...
137230a1f01f109d237916bf558d1eb2
Detect the ticket reporter. If ticket created by some automatic/admin user account then reporter is the first nonsystem user account who modified the ticket.
[ { "docid": "6ef75f79b11d7c9d33fa2634585fb91e", "score": "0.69912404", "text": "def reporter\n sys = @opts.slice(\"system-users\", \",\")\n return @issue.reporter.id if sys.empty? || sys.none? { |susr| susr.eql? @issue.reporter.id }\n first = @issue.history.find { |h| sys.none? { |susr| su...
[ { "docid": "67928be2587b417a59875befffe97504", "score": "0.61352485", "text": "def responsible_user\r\n if reportable.is_a?(User)\r\n reportable\r\n elsif reportable.is_a?(Content)\r\n reportable.user\r\n else\r\n nil\r\n end\r\n end", "title": "" }, { "docid": "0...
579b8ba726c405306be07e50b34755f1
checks to see if guess of letter was correct
[ { "docid": "b9a9dcc9f9a04dff6c428fed7a1d0010", "score": "0.8128979", "text": "def correct_guess?(letter)\n if @word_selected.include?(letter)\n if @correct_guesses.empty?\n @correct_guesses << letter\n elsif @correct_guesses.include?(letter)\n puts 'Letter already gu...
[ { "docid": "8f31890e5e0d50299bab0028541e4231", "score": "0.842382", "text": "def check_letter(user_guess)\n @letter = user_guess.length == 1\n end", "title": "" }, { "docid": "3e6528743173f3e8acfd7e7f818682dd", "score": "0.84051895", "text": "def guess_correct(letter)\n\t\tif @se...
c10d23baeec2912e1ded968e2b935111
Whether notifications should automatically be sent
[ { "docid": "db3d5b2fda8983ae624eed2859200089", "score": "0.66051626", "text": "def auto_notify; end", "title": "" } ]
[ { "docid": "c9178e70df8e1c2cfc322fad85702d9f", "score": "0.82522076", "text": "def send_notifications?\n !!send_notifications\n end", "title": "" }, { "docid": "7dcf1d5628dc56b362c63efee5f2dc37", "score": "0.8249524", "text": "def notification?\n true\n end", ...
896d7fdb1edee99cbf1ecfe04c327c43
Show the difference bettween 2 version of the same program
[ { "docid": "7b97d920abee6ff4d4ba9da37cfdc3ed", "score": "0.6398262", "text": "def diff\n @old_version = Program::Version.find(params[:old_version_id])\n @version = Program::Version.find(params[:version_id])\n end", "title": "" } ]
[ { "docid": "d9bb65860aeebc8d1cb60fd0b1a84ce4", "score": "0.66704375", "text": "def diff\n end", "title": "" }, { "docid": "b3ff8be74fdde72eb1e2fb427641e5be", "score": "0.65951294", "text": "def diff(cmd_1, cmd_2)\n \tout_1, err_1, code_1 = Shared.pipe(cmd_1)\n \tout_2, e...
01ca2f2c0d3aec1130343ef11e13e8e6
`Stripedwith_stripe_error_handlers(&thunk)` Execute `&thunk` and rescue `Stripe` errors if they are raised passing the errors and an appropriate message to the `handle_stripe_error!` method.
[ { "docid": "8b02c4779541d6f3771d7282ede3d65d", "score": "0.8214495", "text": "def with_stripe_error_handlers(&thunk)\n thunk.call()\n rescue Stripe::CardError => sce\n handle_stripe_error!(sce, sce.message)\n rescue Stripe::InvalidRequestError => sire\n handle_stripe_error!(sire, \"...
[ { "docid": "a91f219b4fde5f4dffe60287e0fcdaa2", "score": "0.6555886", "text": "def stripe_handler\n begin\n result = yield\n rescue Stripe::CardError, # Most common error, occurs when card cannot be charged\n Stripe::RateLimitError, # Too many requests hit the API too quickly\...
c3b6a906162f2cf6dc2408a07221b42e
A shorthand for getting the first argument of the node. Equivalent to `arguments.first`.
[ { "docid": "8181cb56d8afa180498290b0d2c1fee0", "score": "0.7638552", "text": "def first_argument\n children[first_argument_index]\n end", "title": "" } ]
[ { "docid": "974fc79fe6aebe42e0389e4b9fee6e44", "score": "0.8570126", "text": "def first_argument\n arguments[0]\n end", "title": "" }, { "docid": "7cf3e9bc30a3c440f89511e8bbca03d9", "score": "0.81685674", "text": "def first_argument(*args); argument(0, *args); end", "...
bda06ea5a5c9e6aef3e5c0a2023b77da
Given a record identifier and a channel name, will add the specified record to the given channel.
[ { "docid": "d38e9575135d2002a81f8d7910847191", "score": "0.77727175", "text": "def add_record(channel_name, identifier)\n stream = \"#{@stream_base}:#{channel_name}\"\n current_score = (Time.now.to_f * 1000000).round\n @redis.zadd stream, current_score, identifier\n end", "...
[ { "docid": "ec9aa2832a93d78a17e4225aaee869e7", "score": "0.6610686", "text": "def add_channel(channel)\n self.channels[channel.cid] = channel\n end", "title": "" }, { "docid": "3b9391239b864758e1c6315e0377f8d7", "score": "0.6170811", "text": "def add_channel(db, channel)\n\tdb.ex...
c8dd83afe9ed33a82211af47df07d4f3
GET /agegroups GET /agegroups.xml
[ { "docid": "d9e9f3873c191e623dffbfa2b42fb14e", "score": "0.5914419", "text": "def index\n \n set_sort_params(params)\n @agegroups = Agegroup.find(:all, :conditions => params[:agegroup], :limit => params[:limit], :order => params[:order], \n :offset => params[:o...
[ { "docid": "40158a306d172d148ad8c9b38846e2eb", "score": "0.7157062", "text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end", "title": "" }, { "docid": "c449413110964807364c22a01ac02ab9", "score": "0.7122769", "text": "def retrieve...
d652704232a47e02ae97d124c8dba79f
ensures the uniqueness replicable option is respected
[ { "docid": "6544a3d1772c741bf6ea6ad07c85cda3", "score": "0.715953", "text": "def ensure_uniqueness_when_replicating(replication)\n # if uniqueness property is set, make sure the specified field is unique\n if params = replicable_opts(:uniqueness)\n # setup the params for the call to the...
[ { "docid": "91cdc3e0d564dc030229fd199dde97d6", "score": "0.7579356", "text": "def ensure_unique\n end", "title": "" }, { "docid": "0d84e1ba51d788ee15dbe196586f6d02", "score": "0.74816906", "text": "def skip_uniqueness_validation!\n @skip_uniqueness_validation = true\n end", ...
6273705c0945fcc161da3d6a75d833f7
Returns the collection protocol coordinator. Fetches the CP if necessary and possible. Adds defaults to the CP if necessary, which sets a default coordinator if possible.
[ { "docid": "d810ac3323061cc0b13ec63262b3be67", "score": "0.6707072", "text": "def default_receiver\n cep = collection_event_parameters\n cltr = cep.user if cep\n return cltr if cltr\n cp = collection_protocol || return\n rcv = cp.coordinators.first\n return rcv if rcv or cp...
[ { "docid": "3510ef8493fa51095c892e5eb890ae68", "score": "0.60047114", "text": "def default_user\n scg = specimen_collection_group || (specimen.specimen_collection_group if specimen) || return\n cp = scg.collection_protocol || return\n cp.coordinators.first || (cp.sites.first.coordinator i...
a4a79a9b169c35045293139ef2b9b3d2
POST /decodings POST /decodings.json
[ { "docid": "ca787fe15b5d60559152e6c94a2426e1", "score": "0.7437721", "text": "def create\n @decoding = Decoding.new(decoding_params)\n respond_to do |format|\n if @decoding.save\n format.json { render json: @decoding }\n else\n format.json { render json: @decoding.errors, s...
[ { "docid": "84f713e91383d38071a89b8259311525", "score": "0.63741237", "text": "def decoding_params\n params.require(:decoding).permit(:plain, :encoded)\n end", "title": "" }, { "docid": "01e6cc0213b090b7b7261b2ec75c0d65", "score": "0.61673194", "text": "def index\n @decodi...
67dd304262aac44d7a607a7ced8b9bb7
Performs a HEAD request against this object and returns an object with useful information about it This information includes the following. metadata (hash of usersupplied keyvalue pairs) content_length (integer, number of bytes) content_type (as sent to S3 when uploading the object) etag (typically the object's MD5) se...
[ { "docid": "4132a6fa741fb0a13250791248e542a1", "score": "0.5556642", "text": "def head\n @object.head\n end", "title": "" } ]
[ { "docid": "21135024c631cd25677f6c65d43dac77", "score": "0.78205645", "text": "def object_head(bucket_name, filename, options={})\n filename.gsub!(/^\\//, \"\")\n resp = head(bucket_name, \"/#{filename}\", options)\n return resp.header unless resp.code == \"200\"\n resp_obj = {}\n ...
cad814cbd50b401469b380bc428eee63
All of the possible combinations of variants
[ { "docid": "72f4525c8ea73a5256509cbd994b235d", "score": "0.7938021", "text": "def variant_combinations\n combinations = []\n 0.upto(2 ** FIELD_VARIANTS.length - 1) do |b|\n combinations << combination = []\n FIELD_VARIANTS.each_with_index do |variant, i|\n combination <<...
[ { "docid": "2519b98a06a3abd782433de8d6dcab4c", "score": "0.68400455", "text": "def combos\n first.product(*tail)\n end", "title": "" }, { "docid": "9a1003eb2fa0666f639a2b1c2de0b5f4", "score": "0.67650247", "text": "def combine_parts(parts)\n\t\t\tparts.size.downto(1).with_obj...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "5ccc73756392f274e28104db711e8ffe", "score": "0.0", "text": "def confirmarCotizMesCam\n GeneradorCorreoMailer.confirmarCotizMesCam\n end", "title": "" } ]
[ { "docid": "947d18f31928dcf9761bdcbda7f18565", "score": "0.71475905", "text": "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "f9cb02c07e98bbf5e69bcea1540cfe24", "score": "0.71186084", "text": "def preview\n @e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d2608f433e10bcd76b03e2907424d2e0", "score": "0.0", "text": "def set_review\n @review = Review.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...
16c84933e9d3ce7a6fe39bdf28ba53bd
CAUTION! This method flush data on current db.
[ { "docid": "0f3c6da3e32ed2bb32d47d3efcc1d8a0", "score": "0.78245455", "text": "def flush!\n @redis.flushdb\n end", "title": "" } ]
[ { "docid": "b677b9ef06038e4b7205fbe8a03676f7", "score": "0.8873075", "text": "def flushdb\n end", "title": "" }, { "docid": "34f510cc81fb4e7236fae7c011d3f12f", "score": "0.8678415", "text": "def flushdb; end", "title": "" }, { "docid": "d09df512fe3c869f1ec0de64332145...
d0df87b1bea9b55706b1c7c4184cdaba
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json
[ { "docid": "63ca0d73ea26bac17981957fa83da6c2", "score": "0.0", "text": "def update\n @post_lock = PostLock.acquire(user: current_user, post: @post)\n\n respond_to do |format|\n if @post.update(post_params)\n format.html do\n if params[:post][:return_to_path].present?\n ...
[ { "docid": "2a642a611c63a85b6ef6e72d09830e50", "score": "0.7186348", "text": "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "title": "" }, { "docid": "e2c68cadce474543233abd080997b452", "score": "0.70419043", "text": "def update\n respond_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "52e2e7204623c468af6df99606a66448", "score": "0.0", "text": "def set_post\n @post = Post.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...
0ee59a88e3577bc85491f36c8c8bdf13
Returns the value of attribute node. source://rubocopfactory_bot//lib/rubocop/cop/factory_bot/create_list.rb232
[ { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.0", "text": "def node; end", "title": "" } ]
[ { "docid": "172905362168474c40e3768b157db41e", "score": "0.6978355", "text": "def value(node, attribute); end", "title": "" }, { "docid": "172905362168474c40e3768b157db41e", "score": "0.6978355", "text": "def value(node, attribute); end", "title": "" }, { "docid": "9b7ec7...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9087e2e3ebe487a4c68fadf64a5c87ec", "score": "0.0", "text": "def set_chat_log\n @chat_log = ChatLog.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...
b51b1f5a704be523f0e6a64461216c95
GET /impostos GET /impostos.json
[ { "docid": "efcf0cf74d800c2c12483864d1c62889", "score": "0.6304175", "text": "def index\n @impostos = Imposto.all\n end", "title": "" } ]
[ { "docid": "abd01bc33555a48970836565f36ad3f2", "score": "0.63172686", "text": "def mostrar_impedimentos\n @impedimentos = Paciente.find(params[:id]).cuestionario_impedimentos\n end", "title": "" }, { "docid": "701a3802b0dd1dc697c21b1bfe7a3d8d", "score": "0.6186812", "text": "def ...
511377cd75882f026dd4cfc10a495861
GET /mosquitto_acls/1 GET /mosquitto_acls/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "fd279e0eb4b0d2b7ac08ab80b3bacc2e", "score": "0.7795508", "text": "def list_acls\n server.perform_request('listacls', {:key => 'acls'})\n end", "title": "" }, { "docid": "4487e60b0e2c5bb9ac7653cbdb61d319", "score": "0.7538969", "text": "def index\n @mosquitt...
d48c3fe54e1aae3a3f82a600d6fae8ca
.. end class << self Start observing the declared classes and their subclasses.
[ { "docid": "198ff5357a61562f091235c3af1b643f", "score": "0.6549922", "text": "def initialize\r\n observed_classes.each { |klass| add_observer!(klass) }\r\n end", "title": "" } ]
[ { "docid": "0b77e1ca231859d5ac384bc6e9b302cf", "score": "0.6962749", "text": "def observed_class_inherited(subclass) #:nodoc:\n observed_classes << subclass\n observer!(subclass)\n end", "title": "" }, { "docid": "8cce26ad81c3c557d0de240f206eb20f", "score": "0.65976346", ...
4c72257b51a701a7cade59e1aace5d40
def household_thankyou_params params.require(:prescreen_household).permit(:save_prescreen_data_flag) end
[ { "docid": "df7e07601b2c80b1a5b5e00b4537d3d9", "score": "0.69620746", "text": "def capture_ssn_params\n \t \tparams.require(:prescreen_household_member).permit(:first_name, :last_name,:date_of_birth,:middle_name,:suffix,:ssn,:gender,:marital_status,:identification_type,:primary_language,:personal_respo...
[ { "docid": "f1aab0c283d6bfc995aa6887ccf4eec1", "score": "0.7312721", "text": "def house_hunter_params\n params.require(:house_hunter).permit(:email, :password, :name, :phone, :preferred)\n end", "title": "" }, { "docid": "c446493a74288ad4251c2b7b5e196b0e", "score": "0.72341335", ...
e24713c738ab8e033957fbc45b730ba2
FIXME this should not be here
[ { "docid": "30a63b364598fbfc03694f74ae0f7340", "score": "0.0", "text": "def send_email(payment, bill)\n Admin.all.each do |admin|\n Pony.mail :to => admin.email,\n :from => payment.contributor_email,\n :subject => I18n.t(:upload_receipt_subject),\n :html_body => erb(:\"/ma...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.76571506", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6514819", "text": "def probers; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", ...
7e256e09135f38d132e4029c161c6e8f
Returns the number of the next page or +nil+ if the current page is the last.
[ { "docid": "34a11670981d0af3c5bbba2fd0e053dd", "score": "0.0", "text": "def next_page\n @dataset.next_page\n end", "title": "" } ]
[ { "docid": "9a90a6e2935aaa3fdab0cd6f8b7f76d2", "score": "0.8274451", "text": "def next_page\n current_page < page_count ? (current_page + 1) : nil\n end", "title": "" }, { "docid": "4607d08b00b5e8de6e629a1726330401", "score": "0.82418156", "text": "def next_page\n cu...
0dc9f1da8bafdf74b461b9505a430aaf
Reads in the data from a sub tsv file, creates an array of movie objects and returns it
[ { "docid": "2f6c3f2bc02fe8508ee1e8cf8137f140", "score": "0.8398434", "text": "def read_from_tsv(tsv)\n # First read in the data from the file\n movies = Array.new\n tsv.parse do |row|\n # Check the conditions before creating the object. That is, ensure the entry is both a movie and not an adult fi...
[ { "docid": "f0a47da57ea8a830f13377521c386423", "score": "0.6449888", "text": "def tsv2array( data )\n return_data = [] \n data_by_line = data.split(\"\\n\")\n \n data_by_line.each do |d|\n intermediate = {}\n data_by_item = d.split(\"\\t\")\n for i in 0 .. ( data_by_item.size...
1083b0e38dadeb3c1453bf5453a7b71f
initialize Total cost for a given reservation returns total_cost (float)
[ { "docid": "3cd8708d81236e19e31b0058ebfc9908", "score": "0.74377424", "text": "def total_cost()\n total_cost = nil\n if @room != nil\n total_cost = @room.price.to_f * @number_of_days\n end\n return total_cost\n end", "title": "" } ]
[ { "docid": "424bcc848452ddd46e282fe12b8c84e7", "score": "0.8325466", "text": "def total_cost(reservation)\n total_cost = reservation.cost\n return total_cost\n end", "title": "" }, { "docid": "424bcc848452ddd46e282fe12b8c84e7", "score": "0.8325466", "text": "def total_co...
ffb878e3cad5c48c924f4569936efbb8
GET /tasks GET /tasks.json
[ { "docid": "b7ab8decdd86bac02ac4e11ac97f697e", "score": "0.0", "text": "def index\n @tasks = Task.order(created_at: :desc).page params[:page]\n @categories = Category.all\n @contractors = Contractor.order(rating: :desc)\n end", "title": "" } ]
[ { "docid": "c7fe93d08ee068d33f0c6bc2df5e475f", "score": "0.7889543", "text": "def tasks\n uri = URI(BASE_URL + TASKS_ENDPOINT)\n\n make_request(uri)\n end", "title": "" }, { "docid": "0cf34a8d9937d77b2fd4de07d1325de2", "score": "0.7751927", "text": "def tasks\n @todos = Tod...
3f817ef064a4115db9746795bddd1e03
Check if the players ranking is consistent, which will be true if: every player has a rank no two players have the same rank the highest rank is 1 the lowest rank is equal to the total of players
[ { "docid": "ffbc8ec80176c7fe6be34ab445f227b6", "score": "0.758536", "text": "def check_ranks(options={})\n ranks = Hash.new\n @player.values.each do |p|\n if p.rank\n raise \"two players have the same rank #{p.rank}\" if ranks[p.rank]\n ranks[p.rank] = p\n end\n...
[ { "docid": "3a8400fc0e6e89033312ab2bb9eba9f3", "score": "0.7055235", "text": "def ranking_summary\n r2s, min, max, dup = Hash.new, nil, nil, false\n # The minimum and maximum ranking numbers.\n players.reject{ |p| p.rank.nil? }.each do |p|\n dup = true if r2s[p.rank]\n r2s[p.rank] = p...