query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
428b7e062b5888366857aca2cb706c4d
Add a storage adapter to the set of possible adapters. Takes an object that responds to `driver`, `use?`, `storage_class`, and `display_name`.
[ { "docid": "0c78d4de392f49240d76da666b614c86", "score": "0.75690997", "text": "def add_storage_adapter(adapter)\n raise ArgumentError, \"#{adapter} is not a Bumbleworks storage adapter\" unless\n [:driver, :use?, :new_storage, :allow_history_storage?, :storage_class, :display_name].all? { |m...
[ { "docid": "a4cc11ac65e855c592b5ae7ce6a54004", "score": "0.6750107", "text": "def storage_adapter\n @storage_adapter ||= begin\n all_adapters = storage_adapters\n raise UndefinedSetting, \"No storage adapters configured\" if all_adapters.empty?\n adapter = all_adapters.detect d...
e6e00be10179ad6bd28ee9c871c14a2f
PUT /kingdoms/1 PUT /kingdoms/1.xml
[ { "docid": "6c8c14536ff0d836c158582263e3760c", "score": "0.6833555", "text": "def update\n @kingdom = Kingdom.find(params[:id])\n\n respond_to do |format|\n if @kingdom.update_attributes(params[:kingdom])\n flash[:notice] = 'Kingdom was successfully updated.'\n format.html { red...
[ { "docid": "e631b376ae2ccb776680432bf94b01cc", "score": "0.6072867", "text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "c2c0b673628fdc28b1...
393d1fc57fa18c6a6c3297bce66a6de1
Public: Update the status. It should be one of: ["normal_exit", "timeout_exit", "failure_exit"]
[ { "docid": "d0a6b810350b53f8eb3853c08920bd9e", "score": "0.0", "text": "def update_status(status)\n RRRSpec.redis.hset(key, 'status', status)\n end", "title": "" } ]
[ { "docid": "95d1f25f88637231f6d0ce9aa9470530", "score": "0.72011817", "text": "def update!(**args)\n @exit_code = args[:exit_code] if args.key?(:exit_code)\n @status = args[:status] if args.key?(:status)\n end", "title": "" }, { "docid": "95d1f25f88637231f6d0ce9aa947...
9e552ff4af3763036831776f3ae13625
ID.me boolean value that specifies whether the signedin 'wallet' has multifactor enabled or not
[ { "docid": "be4ad7e53487f1a3dae7064a6d6911d8", "score": "0.0", "text": "def multifactor\n attributes['multifactor']\n end", "title": "" } ]
[ { "docid": "d82935a0823196b584483901b36ba49f", "score": "0.6164937", "text": "def allow_stickers_and_memes\n return @allow_stickers_and_memes\n end", "title": "" }, { "docid": "9212f30f3a5ba1bb0a28db30b430f89d", "score": "0.6004934", "text": "def shared_acce...
a49011d5f6b53a61997dec2b6fca3667
POST /employees POST /employees.json
[ { "docid": "16a41c1ab60766a04d2586c3a47e3d93", "score": "0.64259374", "text": "def create\n @employee = Employee.new(employee_params)\n @employee.save\n end", "title": "" } ]
[ { "docid": "94f76b583d2a6da6619908174b3784f8", "score": "0.75055444", "text": "def create\n @employee = Employee.new(employee_params)\n @employee.save\n render :json => {:employee => @employee}\n end", "title": "" }, { "docid": "276e656cf1c5aa296da2b716e9dff4ef", "score": "0.71...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "018246e15760db9eb5b1094976bc0937", "score": "0.0", "text": "def set_aviso\n @aviso = Aviso.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;...
ce0fea642872f1ca373f264256aecb8f
PUT /talks/1 PUT /talks/1.xml
[ { "docid": "720c038676069593ee330420633f0124", "score": "0.67216253", "text": "def update\n respond_to do |format|\n if @talk.update_attributes(params[:talk])\n flash[:notice] = 'Talk was successfully updated.'\n format.html { redirect_to([@talk.conference, @talk]) }\n forma...
[ { "docid": "98c74a92167576a4143144db106e62cd", "score": "0.6836313", "text": "def update\n @talk = Talk.find(params[:id])\n\n respond_to do |format|\n if @talk.update_attributes(params[:talk])\n format.html { redirect_to(@talk, :notice => 'Talk was successfully updated.') }\n fo...
5f2dab1e55bb06900b08c5dde039482b
Clear display for the current line input Handles clearing input that is longer than the current terminal width which allows copy & pasting long strings.
[ { "docid": "de16ea0df3b07b932ea403c72c7f143b", "score": "0.78874797", "text": "def clear_display(line, screen_width)\n total_lines = count_screen_lines(line.size, screen_width)\n current_line = count_screen_lines(line.prompt_size + line.cursor, screen_width)\n lines_down = total_lines - ...
[ { "docid": "00453abb6af71532dbe98ada69fe0f08", "score": "0.7499509", "text": "def clear\n # get console window height and width\n h,w = Inquirer::IOHelper.winsize\n # determine how many lines to move up\n n = @rendered.scan(/\\n/).length\n # jump back to the first position and clear the l...
2786497c3e07bf1b108291ecc172dfc3
Returns the default value for a SUM.
[ { "docid": "fc11a28c430e2418e0a9b95f6c0954ed", "score": "0.0", "text": "def default\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "2b868eae13ed22381063726f835209c4", "score": "0.6646627", "text": "def default_sum(listing, vat=0)\n self.sum = listing.price\n end", "title": "" }, { "docid": "2b868eae13ed22381063726f835209c4", "score": "0.6646627", "text": "def default_sum(listing, vat=0)\n self....
79b20aae4ea0aeddb4579970404d9adf
POST /hoods POST /hoods.json
[ { "docid": "7cfa4fd0d30fda29fb696d4d12a0fd82", "score": "0.6969172", "text": "def create\n @hood = Hood.new(hood_params)\n\n respond_to do |format|\n if @hood.save\n format.html { redirect_to @hood, notice: 'Hood was successfully created.' }\n format.json { render action: 'show'...
[ { "docid": "e8cc1141d372ccbb45f65671e11f7e86", "score": "0.6591998", "text": "def create\n @neighborhood = Neighborhood.new(params[:neighborhood])\n\n respond_to do |format|\n if @neighborhood.save\n format.html { redirect_to @neighborhood, notice: 'Neighborhood was successfully create...
40ee3229bebb987f36555e8b57337dbc
We are able to define our own booleans.
[ { "docid": "7850faa7c8bceec0154b76933e5a840c", "score": "0.63275915", "text": "def typus_boolean(attribute = 'default')\n boolean = Typus::Configuration.config[self.name]['fields']['options']['booleans'][attribute] rescue nil\n boolean = \"true, false\" if boolean.nil?\n return { :true =>...
[ { "docid": "4a1ee3ca11093ada11b14e8a7b8cf071", "score": "0.73817384", "text": "def type_bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n\n\n type = TYPE_BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization...
c61f50105cfe70f57e57071233d2586c
Sets the value of the `read_only` attribute.
[ { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.9142877", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" } ]
[ { "docid": "05c08131dd9c5788e49d3a481b1d5a80", "score": "0.90427387", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "05c08131dd9c5788e49d3a481b1d5a80", "score": "0.90427387", "text": "def read_only=(value)\n ...
ce8cdb06bbaed3deb79348f3f09ad710
Delete a review for this interview Deletes a review by ID for this interview. Use with caution!
[ { "docid": "ea7d6047866cb727d9cdb3ecf39826cb", "score": "0.7079542", "text": "def delete_interview_review(interview_id, review_id, opts = {})\n delete_interview_review_with_http_info(interview_id, review_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "841f80fe4ab54e7f152518db2d41a92c", "score": "0.7776276", "text": "def _reviews_delete(id)\n delete id.to_s\n _response_status(204, last_response)\n end", "title": "" }, { "docid": "9c466acb66587c61adcfd0fc6bf3563e", "score": "0.7327745", "text": "def destroy\n @...
292129113d1cc39e08cd9fb859454f5f
Returns a snapshot of the given state; in this case with the color values replaced with their raw symbols.
[ { "docid": "93406600617a26925400e26822895800", "score": "0.60741127", "text": "def snapshot\n\n #Get a raw snapshot of the beacon's state.\n snapshot = super\n\n #Replace any of the \"color fields\" with their appropriate symbol name.\n snapshot.each do |key, value| \n\n #If t...
[ { "docid": "24cdc5aac271a64e838f05fe0fcaaf93", "score": "0.6102516", "text": "def color\r\n {\r\n r: 255 - (50 * state[state_prop]),\r\n g: 204 - (50 * state[state_prop]),\r\n b: 52 * debuff\r\n }\r\n end", "title": "" }, { "docid": "dafd5800260591686fdb7e91...
c23a2109a209cdd538d3bac1eb878af1
DELETE /announcements/1 DELETE /announcements/1.json
[ { "docid": "3f20d86d56f685abb481e4d8a020e592", "score": "0.68495226", "text": "def destroy\n if allow_access_if_user_rank_at_least(1)\n @announcement.destroy\n respond_to do |format|\n format.html { redirect_to announcements_index_url }\n format.json { head :no_content }\n ...
[ { "docid": "c20a9059434a63f3fb0564a76c2264d2", "score": "0.8048461", "text": "def destroy\n @announcement = Announcement.find(params[:id])\n @announcement.destroy\n\n respond_to do |format|\n format.html { redirect_to announcements_url }\n format.json { head :ok }\n end\n end", ...
15bd024f253fbadf352adad88d68bd7c
GET /groups GET /groups.json
[ { "docid": "b2bfec4207b6be4c54743027fb9346b8", "score": "0.0", "text": "def index\n\tif params.has_key?(:search)\n\t\t@groups = Group.search(params[:search]).paginate(page: params[:page], per_page: 10)\n\telse\n \t\t@groups = Group.paginate(page: params[:page], per_page: 10) #order: 'name ASC'\n\tend...
[ { "docid": "46520ea3a5550063b144c223d15c79ca", "score": "0.8286577", "text": "def GetGroups params = {}\n\n params = params.merge(path: 'groups.json')\n APICall(params)\n\n end", "title": "" }, { "docid": "f3e9578633b47f00b29cc0e3faabdcf4", "score": "0.8278107", "t...
62712ac38b5317246a4e2bb906f99024
Users Controller HTTP Request Methods Returns a list of all Users GET /users GET /users.json
[ { "docid": "92c38d204173af55357406763326ad78", "score": "0.0", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" } ]
[ { "docid": "de3b087f20ee65746adea1959f862485", "score": "0.8286488", "text": "def users\n get('get_users')\n end", "title": "" }, { "docid": "1b36c6d085c50d9b823abd98e9d4a7dd", "score": "0.8226217", "text": "def list_users\n self.class.get('/users')\n end", "title...
10a20f21d5e269bede2e10e5bb98bfa9
Regard as success iff all the minor tests were end in success.
[ { "docid": "1b5e580c581d680e688d81956aad88b7", "score": "0.0", "text": "def succeeded?\n @policies.each do |p|\n return false if p.result.class == ::IOCheck::Policy::Failure\n end\n return true\n end", "title": "" } ]
[ { "docid": "b9a22797dc9b97ac0ac383472c447b8c", "score": "0.64937174", "text": "def any_test_failed?(test_results); end", "title": "" }, { "docid": "ae4251a016536e2eac67d35941eec277", "score": "0.62200874", "text": "def succeeded?; @failures.empty?; end", "title": "" }, { ...
a52ffb10230173e592e7881c4512cd13
Checks if is project saved
[ { "docid": "504372357c2ea6779c653a9a8f3df4fd", "score": "0.0", "text": "def saved?\n res = uri.nil?\n !res\n end", "title": "" } ]
[ { "docid": "03d80b6824653508a24edf07bd34658e", "score": "0.7342984", "text": "def project_create?\n is_project_create\n end", "title": "" }, { "docid": "43e6acd29373c5e7a9ff2e97caf78bde", "score": "0.731275", "text": "def project?\r\n false\r\n end", "title": "" }, { ...
c17470bc5883e3746fc912833eaccb57
DELETE /wantedgames/1 DELETE /wantedgames/1.json
[ { "docid": "38baafdfa18b9e3eef48c13af679b049", "score": "0.73227143", "text": "def destroy\n @wantedgame.destroy\n respond_to do |format|\n format.html { redirect_to wantedgames_url, notice: 'Wantedgame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "78ec7688c345c79be957dd89117b70be", "score": "0.7473694", "text": "def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04d411ebe23afba8eff05cc22431c49b", "score": "0.7402564", "text...
f123df704586ed700f913c38beccf8f3
Returns details of a user
[ { "docid": "a1e00d5897e3d1ed0f0ba2a168be3aee", "score": "0.8351655", "text": "def details(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n user = args.first\n merge_user_into_options!(user, options)\n response = get('users/details', options)\n end", "title": "" } ]
[ { "docid": "1fa340328c780cc7bc2a4bc7079f2724", "score": "0.8306205", "text": "def fetch_user_details\n get('users/list')\n end", "title": "" }, { "docid": "55836acde852fb65ab2c501191677a73", "score": "0.8178217", "text": "def user_details\n user_details_for(@qualifie...
ca6ac8667c25f87e7dd2a3eda46a6640
POST /sessions POST /sessions.json
[ { "docid": "eaf77fb66f407137d9c2c27ce5c55be8", "score": "0.6409512", "text": "def create\n\n user = User.find_by user:params[:user]\n auth = user.authenticate(params[:password]) if user\n\n @session = Session.new(user:user)\n\n if auth and @session.save\n render json: @session.token\n ...
[ { "docid": "9f246698ea5c1becce7f3cb4ef311f3e", "score": "0.7441891", "text": "def create\n @session = Session.new(params[:session])\n\n if @session.save\n render json: @session, status: :created, location: @session\n else\n render json: @session.errors, status: :unprocessable_entity\n...
776141b05f7b1c80e3fe45e2f688ae7c
would be better if could reuse 'init_fb_connect' from facebooker lib
[ { "docid": "9ae1ac490471eb51ca4c4cc0a84c9afe", "score": "0.0", "text": "def facebook_js\n if @service.blank? || @service.option.blank?\n js_options = '{}'\n else\n js_options = \"{ permsToRequestOnConnect: '#{@service.option}' }\"\n end\n str = <<-EOM\n (function($...
[ { "docid": "9f76b88e6b50d1f236fad67b5d488a5d", "score": "0.7311746", "text": "def init_fb_connect(required_features = ['Api'], app_settings = '{}')\n init_string = \"FB.Facebook.init('#{Facebooker.api_key}', '/xd_receiver.html', #{app_settings});\"\n unless required_features.blank?\n ...
3ddc6385383201f08fb64306589d6234
Returns true if the user has just been activated.
[ { "docid": "5f9fcc15febec429ab57de00f72d4a46", "score": "0.0", "text": "def pending?\n @activated\n end", "title": "" } ]
[ { "docid": "7c4af83de2d6e21e6fadb72045c34ff2", "score": "0.83840567", "text": "def user_activated?(current_user)\n current_user.activated\n end", "title": "" }, { "docid": "def7469836c9b3bb398df868dfb9fde6", "score": "0.8199124", "text": "def activated?\n @user = User.find(id)...
a2c1013289ac8c7588fe270edb448131
after running learn and reading the error multiple times, realized that I was improperly accessing the NDS movies> titles. names & movies are on the same layer within the AoH
[ { "docid": "0d7f0d7d59634cc5b761fc25452e5ea9", "score": "0.5396919", "text": "def print_first_directors_movie_titles\n first_dir_movies = directors_database[0][:movies]\n idx = 0\n while idx < first_dir_movies.size\n # the following statement will print out the movie titles of the first director w...
[ { "docid": "930437ac583251ecf09a87b1adf2f8f7", "score": "0.5965719", "text": "def movie_names\n\n end", "title": "" }, { "docid": "34f353d34030a79420ab2ca97a23094b", "score": "0.5865108", "text": "def initialize(title)\n\t\tapikey = \"3exp2hc3hykfqg8u4g8gudpx\"\n\t\tbaseURL = \"http...
228e03bb409efa50de2224eded957bc3
ActiveRecrod callback fired on +before_create+ to make sure a new object always gets a publication date; if none is supplied it defaults to the creation date.
[ { "docid": "b05b932862f492087b60b84517fa2f94", "score": "0.0", "text": "def publish_by_default\n write_attribute(:is_published, true) if is_published.nil?\n end", "title": "" } ]
[ { "docid": "b848c251a0e3dea4cfdfe9e1a7ef3333", "score": "0.75923455", "text": "def before_create\n self.date ||= Date.today\n super\n end", "title": "" }, { "docid": "81f9dcec7a8a9d60c56bd4bcf2821596", "score": "0.73954195", "text": "def after_initialize\n self.created_on |...
247ee0183de5a3d1c3c69647380aba23
Reset invitation token and send invitation again
[ { "docid": "42519796a8ef974c1c49f99dcf6a75ab", "score": "0.0", "text": "def invite!(invited_by = nil, options = {})\n # This is an order-dependant assignment, this can't be moved\n was_invited = invited_to_sign_up?\n\n # Required to workaround confirmable model's confirmation_requir...
[ { "docid": "f86d049b6cbdad2858b486e05ce45e3f", "score": "0.7572551", "text": "def defer_invitation\n response_service.invitation_token = nil\n end", "title": "" }, { "docid": "ad0b0bf87e101b5f73cdb8757dc220c2", "score": "0.7442039", "text": "def resend_invitation\n update_attr...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "38a850a1513a91fd82b699b1e801200c", "score": "0.0", "text": "def set_user_usergroup\n @user_usergroup = UserUsergroup.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
2bb7340742c32b5e62d579e6e8edb2ed
keep array elements unchanged
[ { "docid": "b91b595e9807a974e52270e29899b7b5", "score": "0.71969384", "text": "def map_to_no_change(array)\n no_change_array = []\n counter = 0\n\n while counter < array.length do\n no_change_array.push(array[counter])\n counter += 1\n end\n\n no_change_array\nend", "title": "" } ]
[ { "docid": "ad95419136c067985bc1d7eafdcf37bd", "score": "0.76735044", "text": "def map_to_no_change(array)\n arr = []\n array.each do |e|\n arr << e\n end\n arr\nend", "title": "" }, { "docid": "8094fe7501e17d6ebe907c46b34887de", "score": "0.74971414", "text": "def map_to_no_c...
03bd26090c7889a6569fdd3daff4560a
Sets custom repository class Person included RocketModel repository = MyRepository attribute :name end
[ { "docid": "22cd65d502ca6b7713b5129c769633f8", "score": "0.59708387", "text": "def repository=(repository_klass)\n @repository = repository_klass.new(self)\n end", "title": "" } ]
[ { "docid": "0b86df309cf0e06d0c1f117780d7380d", "score": "0.70118064", "text": "def repository\n @repository || model.repository\n end", "title": "" }, { "docid": "11b2b3c2a368e2ee634bb53cb06a2458", "score": "0.69239944", "text": "def repository\n defined?(@repository) ? ...
91f43c8d9f691561bf7881466521444f
GET /documents GET /documents.json
[ { "docid": "5ab494e2cf4b655a4face1a5d884d9ec", "score": "0.0", "text": "def index\n semantic_breadcrumb @project.name\n if @project.manager?(current_user)\n @documents = @project.documents\n else\n ids = @project.assigns.where('user_id = ?', current_user.id).all.map{|d| d.document_id}...
[ { "docid": "d2a99e8da401980123ae247607b6ca45", "score": "0.765549", "text": "def documents(params={})\n server.get(\"#{name}/_all_docs\", params)\n end", "title": "" }, { "docid": "daf0bd11c5e7e97d796869f8cdcf1c4b", "score": "0.76269925", "text": "def index\n @documents = ...
4dc6120ea43a84e88e3ddc62c1821660
Extrae por la cola de la lista un nodo == Parameters: No recibe nada == Returns: Retorna el nodo extraido
[ { "docid": "e47e26da1b02aa541a24d25fd4e86ceb", "score": "0.0", "text": "def popTail\n \n unless @tail.nil?\n \n aux = @tail\n unless @tail.prev.nil?\n \n @tail.prev.next = nil\n @tail = @tail.prev\n \n...
[ { "docid": "8bdea08b1333f17067b16d2ec5b26cd2", "score": "0.65266967", "text": "def extraer_por_cabeza\n\t\tif(@head==nil)\n\t\t\tputs \"No hay nada que extraer (lista vacia)\"\n\t\telse\n\t\t\taux=@head\n\t\t\t@head=@head.nest\n\t\t\tif(head!=nil)\n\t\t\t\t@head.prev=nil\n\t\t\tend\n\t\t\taux.nest=nil\n...
a67471b147a32df971cf7c69f5157d45
POST /admin/pricing/paint_colors POST /admin/pricing/paint_colors.json
[ { "docid": "ffba4f87312d1d57ca07b1febae6eed2", "score": "0.7346183", "text": "def create\n @admin_pricing_paint_color = Admin::Pricing::PaintColor.new(admin_pricing_paint_color_params)\n\n respond_to do |format|\n if @admin_pricing_paint_color.save\n format.html { redirect_to admin_pri...
[ { "docid": "a4d66ab14a1b34e9c8701ddc7f588dbd", "score": "0.7087494", "text": "def create\n @palette = Palette.new(palette_params)\n\n respond_to do |format|\n if @palette.save\n params[:palette][:colors].each do |value|\n @palette.colors.create(hex_value: value)\n end\n...
03603457454b3aeb2a88d8d63e2e67d6
Updates the users portfolio balance based on their current stock prices.
[ { "docid": "a4320fa9a4cc2622a18a838510dec27c", "score": "0.7555781", "text": "def update\n user = User.find(params[:id])\n bal = 0\n user.portfolios.each do |p|\n bal = bal + p.total_price\n end\n user.update_attribute(:portfolio_balance, bal)\n rende...
[ { "docid": "44a794990266621519deb718a1292020", "score": "0.72883075", "text": "def update_balance(trade)\n if trade.trade_type == 'buy'\n self.balance = self.balance + trade.amount\n self.save\n elsif trade.trade_type == 'sell'\n\n # If the balance of this portfolio is greater than ...
4d9d7a3fa1f2c0dfd944e45d12d73c9f
Get IPSec VPN session statistics under Tier0 no enforcement point path specified: statistics are evaluated on each enforcement point. an enforcement point path is specified: statistics are evaluated only on the given enforcement point. source=realtime: statistics are fetched realtime from the enforcement point. source=...
[ { "docid": "27b6bb28e1ffece587486ef37195821d", "score": "0.54299027", "text": "def get_tier0_ip_sec_vpn_session_statistics_0(tier_0_id, locale_service_id, service_id, session_id, opts = {})\n data, _status_code, _headers = get_tier0_ip_sec_vpn_session_statistics_0_with_http_info(tier_0_id, locale_s...
[ { "docid": "a6e021db3ca6b606b42b11611284708a", "score": "0.55479133", "text": "def get_tier0_ip_sec_vpn_session_statistics(tier_0_id, locale_service_id, service_id, session_id, opts = {})\n data, _status_code, _headers = get_tier0_ip_sec_vpn_session_statistics_with_http_info(tier_0_id, locale_servi...
27333305bba675273ac58b7abab860de
PATCH/PUT /training_classes/1 PATCH/PUT /training_classes/1.json
[ { "docid": "3ceaf11496574b91639d086ff933bd19", "score": "0.7191274", "text": "def update\n respond_to do |format|\n if @training_class.update(training_class_params)\n format.html { redirect_to @training_class, notice: 'Training class was successfully updated.' }\n format.json { hea...
[ { "docid": "a43d169bafc47bf9fb0da5f370f5ff39", "score": "0.7194631", "text": "def update\n respond_to do |format|\n if @training_class.update(training_class_params)\n format.html { redirect_to @training_class, notice: 'Class was successfully updated.' }\n format.json { render :show...
defcb7165b5c7bdeb71d7c6b2d1245c3
will return a string that is [0..4] characters in length that contains the characters 'B' and 'W' if the string is "BBBB" that means that the guesss was correct parameters => user_guess: a 4 character string that is made up of the characters r,g,b,y,p, and o preconditions: user_guess must not be null and must be a vali...
[ { "docid": "8d2c1920efb90a79cc14d921d254825f", "score": "0.69463325", "text": "def guess(user_guess)\n if(!@game_over)\n user_guess = validate_input(user_guess)\n @guesses.push(user_guess.dup)\n sc = @secret_code.dup\n data = \"\"\n #search for correct colors in the correct s...
[ { "docid": "2312136a0e16050cc902aa9aeb7b424a", "score": "0.6787726", "text": "def check_answer(user_guess)\n add_guess\n answer_copy = @secret_code.dup\n feedback = ''\n\n user_guess.each_char.with_index do |char, i|\n if char == @secret_code[i]\n feedback << \"B\"\n answe...
225f03b9c5968990173e8e86c949ecd3
GET /profiles GET /profiles.xml
[ { "docid": "eb2a6d8b5e133ad97149bbb8ff06bff3", "score": "0.70021003", "text": "def index\n if ( signed_in? ) \n @user = User.find( current_user().id);\n else\n print( \"Must sign in first\" )\n end\n if (@user)\n @profiles = @user.profiles\n\n end\n\n respond_to do |form...
[ { "docid": "93edd2ba7f3c41892d9400fad4224664", "score": "0.78547597", "text": "def list_profiles\n # /profiles returns a list of profiles.\n end", "title": "" }, { "docid": "06a86c98d74e3efdf4952ff7fe997fb4", "score": "0.76223457", "text": "def profiles\n output(query('get...
9236b2a3daf16aeec9c73670422af62c
load_and_authorize_resource before_filter :load_permissions GET /person_type_masters GET /person_type_masters.json
[ { "docid": "e9576f4980cf9a81c32847957ef597c2", "score": "0.0", "text": "def index\n @person_type_masters = PersonTypeMaster.all.paginate(:page => params[:page], :per_page => 5).order('id desc')\n @person_infos = PersonInfo.all.paginate(:page => params[:page], :per_page => 10).order('id desc')\n ...
[ { "docid": "6146be367767fc3ba3a294dbc369b0ef", "score": "0.7089287", "text": "def load_permissions\n authorize! :manage, :all\n end", "title": "" }, { "docid": "6146be367767fc3ba3a294dbc369b0ef", "score": "0.7089287", "text": "def load_permissions\n authorize! :manage, :...
3a0ff197f934b91800ae6a72472d5400
is this a valid move? Is it within the range of the board? Is the place already taken?
[ { "docid": "2ff17fedbaaf81f518e958fcd636b77c", "score": "0.0", "text": "def valid_move?(board, index)\n # if the index is within range of 0-8 and is unoccupied\n if position_taken?(board, index) == false && index.between?(0, 8)\n return true\n else\n return false\n end\nend", "title": "" ...
[ { "docid": "831bceacfcab90f8c67180dd8cf680e3", "score": "0.84580207", "text": "def valid_move(row, col)\n is_empty(row, col) and inside_board(row,col)\nend", "title": "" }, { "docid": "5a140b9fed8d1743dd3f1d9375697b81", "score": "0.84555596", "text": "def valid_move?(board, position...
5363ac7c6b6579dc9844bad9eeb30ade
Runs all path extraction components and returns an array of paths.
[ { "docid": "eead7348ada7d5bd495e3098bb71e4bc", "score": "0.6047063", "text": "def run_extractors\n begin\n return self.class.extractors.available.map do |name|\n exception_jail( false ){ self.class.extractors[name].new.run( doc ) }\n end.flatten.uniq.c...
[ { "docid": "50506098e442c862fb03b762ba938f10", "score": "0.7234223", "text": "def result_paths\n paths = Dir.glob( dir.join('*') ).map {|x|\n Pathname(x)\n }\n return paths\n end", "title": "" }, { "docid": "6ab8a1c58748cee4bae230eb7bea1a64", "score": "0.72262365", "te...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "f90493fea3dc02e7414545adef2c4c27", "score": "0.0", "text": "def update!(**args)\n @compliant_values = args[:compliant_values] if args.key?(:compliant_values)\n @instructions = args[:instructions] if args.key?(:instructions)\n @remediation_type = args[:remediation_t...
[ { "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...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "aee6a980982bd53c3f731d345bb2f61b", "score": "0.0", "text": "def drivers_license_dob=(drivers_license_dob)\n if !drivers_license_dob.nil? && drivers_license_dob.to_s.length > 10\n fail ArgumentError, 'invalid value for \"drivers_license_dob\", the character length must be smaller ...
[ { "docid": "0f4a74039d4b8dc62405e39b58357a05", "score": "0.6472992", "text": "def attr_writer_tag(text); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.6315012", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "ac5...
164fda8199835db7e65faaba80b80a5d
POST /tracked_actions POST /tracked_actions.xml
[ { "docid": "d14328f577ee96f8843735e2c5df85bb", "score": "0.6536944", "text": "def create\n @tracked_action = TrackedAction.new(params[:tracked_action])\n\n respond_to do |format|\n if @tracked_action.save\n format.html { redirect_to([:scaffold, @tracked_action], :notice => 'TrackedActi...
[ { "docid": "59e448e3d4e6df9506864158caaf74b6", "score": "0.657448", "text": "def index\n @tracked_actions = TrackedAction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tracked_actions }\n end\n end", "title": "" }, { "docid"...
edd08e8f63fdaca7279ae6b32800de70
METHOD DECLARATIONS 'Encrypts' secret word by printing next highest letter in the alphabet
[ { "docid": "ae8c0641209a6ae3e024d715974f76a7", "score": "0.78598285", "text": "def encrypt(secret_word)\r\n\t#keeps track of letters in word\r\n\tcounter = 0\r\n\t#loop through secret word replacing letter with next highest one\r\n\t#if statement prints 'a' instead of 'aa' if z is used in secret word\r\...
[ { "docid": "5ea747c8be74cde03ea6aa1db2454e5b", "score": "0.8114525", "text": "def encrypt(word) #To encrypt a word\n\ti = 0\n\tsecret_word = \"\"\n\t\twhile i < word.length\n\t\tif word [i] == \"z\"\n\t\t letter = \"a\"\n\t\telse\n\t\t letter = word[i].next\n\t\tend\n\t\tsecret_word += letter\n\t\ti +...
9843ddfbf498aff6f72be46944cd9c4e
I worked on this challenge by myself. Your Solution Below
[ { "docid": "4b6896f025720e71dc93da778d23280f", "score": "0.0", "text": "def welcome(address)\n\n\tif address.include?(\"CA\")\n\t\t\"Welcome to California\"\n\telse\n\t\t\"You should move to California\"\n\tend\n\nend", "title": "" } ]
[ { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.66699874", "text": "def solution4(input)\n end", "title": "" }, { "docid": "f712d49ec6c615538b2e2aa846391fda", "score": "0.65802413", "text": "def challenge; end", "title": "" }, { "docid": "eabdd32fa3a69c5639179...
828164457dd042f8672ada8b836ab331
The sort feature is not supported in this graph.
[ { "docid": "72ccc49c58edbacf23be98f13d91eb0c", "score": "0.0", "text": "def sorted_drawing=(_value)\n raise 'Not support #sorted_drawing= in Gruff::Candlestick'\n end", "title": "" } ]
[ { "docid": "3a19ceba7cdcb752bb2cba11e625d9c2", "score": "0.6678729", "text": "def sort_by\n end", "title": "" }, { "docid": "b0b212c1d5230a9b8d9562c050ef7d4f", "score": "0.66649634", "text": "def sort!\n # no op\n end", "title": "" }, { "docid": "c9d3e8a8...
ae33b7f8f239c5524beb51bbc443b9af
Generates the complete graph on n vertices if n is an integer, otherwise the complete graph on the vertices in the enumerable given
[ { "docid": "617d20b0bb4b33078d51b8c1e7f75c8c", "score": "0.76771843", "text": "def complete_graph(n)\n set = (Integer === n) ? 1..n : n\n RGL::ImplicitGraph.new do |g|\n g.vertex_iterator { |b| set.each(&b) }\n g.adjacent_iterator do |x, b|\n set.each { |y| b.call(y) unless x == y }\n en...
[ { "docid": "50b7da4a4d976c23f168cf522256f60d", "score": "0.63272685", "text": "def cycle(n)\n RGL::ImplicitGraph.new { |g|\n g.vertex_iterator { |b| 0.upto(n - 1, &b) }\n g.adjacent_iterator { |x, b| b.call((x + 1) % n) }\n g.directed = true\n }\nend", "title": "" }, { "docid": "6...
06007b8618892ad2ac988248c2d02ef6
PUT /photoalbums/1 PUT /photoalbums/1.json
[ { "docid": "81f508479b77887ce2be19e0b60ecbf5", "score": "0.65423805", "text": "def update\n @photoalbum = Photoalbum.find(params[:id])\n\n respond_to do |format|\n if @photoalbum.update_attributes(photoalbum_params)\n format.html { redirect_to @photoalbum, notice: 'Photoalbum was succe...
[ { "docid": "71d94a4d1fd3421129f8c0e51ebd88e4", "score": "0.7149454", "text": "def update\n respond_to do |format|\n if @album.update(album_params)\n params[:photo]['picture'].each do |a|\n @photo = @album.photos.create!(:picture => a, :album_id => @album.id, :order => Pho...
edc3dc3e05b1d9041c246e82a5ff5d2b
GET /reporter_images GET /reporter_images.json
[ { "docid": "75cc675aaf1c7d8ea6aad97109bf8746", "score": "0.74429315", "text": "def index\n @reporter_images = ReporterImage.all\n end", "title": "" } ]
[ { "docid": "48abcf1926c89e07c98d25c55ddb1ed2", "score": "0.70937395", "text": "def images\n response = JSON.parse( self.class.get(\"#{BASE_URL}/contest/#{@api_key}/images\") )\n end", "title": "" }, { "docid": "6d3cc0645b7bc0549579e0c8ab06a1ad", "score": "0.69179523", "text":...
bb5fe8002e10f13d3d733c50aee017c2
Service one or more SMTP client connections
[ { "docid": "7f50022197155a05cfc55326ae7854a3", "score": "0.0", "text": "def accept( service )\n while session = service.accept\n\n class << session\n def get_line\n line = gets\n line.chomp! unless line.nil?\n line \n end\n end\n\n begi...
[ { "docid": "36b64ed65b31245fbb4189c6fdce725f", "score": "0.578231", "text": "def initialize(\n ports: DEFAULT_SMTPD_PORT,\n hosts: DEFAULT_SMTPD_HOST,\n max_processings: DEFAULT_SMTPD_MAX_PROCESSINGS,\n max_connections: nil,\n crlf_mode: nil,\n do_dns_reverse_lookup: nil,\n...
b5be3187021d3c543b5f40a13cce2761
Tests Walkingdfa_step on examples
[ { "docid": "9e1ba7240e3447634096448382d785a1", "score": "0.81236845", "text": "def test_step_on_examples\n assert_equal(nil, @small_dfa.dfa_step(0, 'b'))\n assert_equal(@small_dfa.ith_state(1), @small_dfa.dfa_step(0, 'a'))\n assert_equal(@small_dfa.ith_states(1), @small_dfa.dfa_step...
[ { "docid": "2fe694c6ca179d65482ca5f8d2f15ca6", "score": "0.68211263", "text": "def test_dfa_reached_on_examples\n assert_equal(nil, @small_dfa.dfa_reached('? a a'))\n assert_equal(@small_dfa.ith_state(2), @small_dfa.dfa_reached('? b'))\n assert_equal(@small_dfa.ith_state(1), @small_...
80a6fe9857a24452c23338112c13765c
Creates Firebase OAuth based auth object; one argument must be specified
[ { "docid": "898186cda2451c571d0bda185c608dba", "score": "0.0", "text": "def initialize(json: nil, path: nil)\n if json\n load_privatekeyjson(json)\n elsif path\n load_privatekeyfile(path)\n end\n end", "title": "" } ]
[ { "docid": "b89874cd055d044aaf9f9178e6cc4571", "score": "0.6684115", "text": "def oauth\n Auth.new(params[:uid], params[:oauth_token], action_name)\n end", "title": "" }, { "docid": "1cd934a9e0405fa53bd4b14ec61228ec", "score": "0.66102237", "text": "def firebase_auth_token\n r...
d548ca4c9cedd001dac3113b01a7744d
PUT /slicegroups/1 PUT /slicegroups/1.xml
[ { "docid": "a9c22775e6ea5f34f828fd361d5f9c7b", "score": "0.6933213", "text": "def update\n @slicegroup = Slicegroup.find(params[:id])\n\n respond_to do |format|\n if @slicegroup.update_attributes(params[:slicegroup])\n flash[:notice] = 'Slicegroup was successfully updated.'\n fo...
[ { "docid": "e1132c7e04025ff99ada00faf7a14dc9", "score": "0.62139255", "text": "def update\n @slice = Xen::Slice.find(params[:id])\n\n respond_to do |format|\n if @slice.update_attributes(params[:slice])\n flash[:notice] = 'Slice was successfully updated.'\n format.html { redirec...
03b8b26dfd2bdec94db7971b0142dbae
Everything below is in relation to making an API for users to pull the hash from
[ { "docid": "08a821af19077f853cc8643baf9c5690", "score": "0.0", "text": "def allinfo()\n\teventsarray = readereventsfromtimes(\"times.txt\")\n\tfillhash = {}\n\n\tn = 0\n\twhile n < eventsarray.size\n\n\tentrants_in_single_event = peopleinevent(eventsarray[n], \"entrants.txt\")\n\n\t\tint = 0\n\t\twhile ...
[ { "docid": "b5e6ea098cd9371dfd3e8d60e0487bed", "score": "0.7046492", "text": "def hash\n login.hash\n end", "title": "" }, { "docid": "59253aa5130b8984c4c00123856bb8cc", "score": "0.647134", "text": "def hash_grab\n\t\t\tgets.chomp\n\t\tend", "title": "" }, { "docid":...
99d1a741631caa539edd625b68eed6ef
make the magic: convert incoming names into registers that have the type set according to the name (using infer_type) names are stored, so subsequent calls use the same register
[ { "docid": "2d58eef4fa155e647936ae1463bb32fc", "score": "0.50930035", "text": "def method_missing(name , *args)\n return super if args.length != 0\n name = name.to_s\n return @names[name] if @names.has_key?(name)\n if name == \"message\"\n return Risc.message_reg.set_builder(s...
[ { "docid": "09fdb0b16fb885621efe12d1d9c664a1", "score": "0.62824196", "text": "def register_names\n register_attributes.collect {|attr| get_register(attr)}\n end", "title": "" }, { "docid": "659453753f7a4051408bb4b745181900", "score": "0.6005417", "text": "def type_name_resol...
c2f2d937dbc5f87f90fb5ee0dbf0c986
Public: Remove a tag from a subscriber. email The String email address of the subscriber. tag The String tag to remove. Returns a Drip::Response. See
[ { "docid": "97f7d04a12971955f68d2446c4d69d3f", "score": "0.8689515", "text": "def remove_tag(email, tag)\n make_json_api_request :delete, \"v2/#{account_id}/subscribers/#{CGI.escape email}/tags/#{CGI.escape tag}\"\n end", "title": "" } ]
[ { "docid": "0e81a6b80016c83bed25049df08e7933", "score": "0.68737185", "text": "def remove_tag(tag: required(\"tag\"), options: {}, **data)\n with_params = data.merge(tag: tag).reject { |_,v| v.nil? || Array(v).empty? }\n client.post(\"/tasks/#{gid}/removeTag\", body: with_params, options: ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5520cd6a55ad12005019bef7b1556be7", "score": "0.0", "text": "def acting_params\n params.require(:acting).permit(:user_id, :activity_id, :start, :stop)\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...
62bac9b5862f62b1a4fe7f9296e84075
Set the bin from the current rank elements with identical keys land in identical bins.
[ { "docid": "f5956e6444a4b6c880a6f75155cae5b6", "score": "0.52251816", "text": "def get_bin rank\n ((rank-0.5) / bin_size ).floor + 1\n end", "title": "" } ]
[ { "docid": "ffe6364a1830b0aeeaa94f8c21393b0e", "score": "0.60242945", "text": "def bin!\n set_num_bins_from_total_count! unless self.num_bins\n set_edges_from_min_max_and_num_bins!\n until values.empty?\n value = values.shift\n add_to_some_bin(value.to_f) if value\...
c4f8fd695f3716ecc21c3c906d34010b
GET /births GET /births.json
[ { "docid": "7d1a647c09614f6d192d537be4549832", "score": "0.6415354", "text": "def index\n @births = Birth.where(user_id: current_user.id )\n end", "title": "" } ]
[ { "docid": "f2827fe58cddf6233ecffc8baf2715e2", "score": "0.6829262", "text": "def people\n Birdman::Requester.get(\"movies/#{id}/people\")\n end", "title": "" }, { "docid": "69dfd08a6f9305b77015f598ee7e6fca", "score": "0.67445886", "text": "def dashboard_births\n\t\t\n\t\tstart =...
e1da43636c428457bf665076c6b404ad
Creates a new instance of QueryStats::Holder with an empty array of stats.
[ { "docid": "fa857b60b891eabed975569fe50e6c6e", "score": "0.48051673", "text": "def initialize\n @ignore_types = [\n :begin_db_transaction,\n :columns,\n :commit_db_transaction,\n :rollback_db_transaction\n ]\n @stats = []\n end", "title": "" } ]
[ { "docid": "354d7e2460e7bbec84483630194f8dd2", "score": "0.67886525", "text": "def queries\n @query_stats ||= QueryStats::Holder.new\n end", "title": "" }, { "docid": "45804fde6d21f9a3c75eb3ff85fad795", "score": "0.6614392", "text": "def initialize\n @stats = []\n end...
d7e0bff22f60012a1959d42aaefe0288
Generate a report based on a 'new report' form submission.
[ { "docid": "db7de447356675a27d7f8d157605e9e6", "score": "0.0", "text": "def create\n appctrl_patch_params_from_js( :saved_report, :active_task_ids )\n appctrl_patch_params_from_js( :saved_report, :inactive_task_ids )\n\n saved_report = SavedReport.new( params[ :saved_report ] )\n save...
[ { "docid": "b5fec731185ebee22e02a4f64329ff59", "score": "0.74138546", "text": "def create_new_report!; end", "title": "" }, { "docid": "b5fec731185ebee22e02a4f64329ff59", "score": "0.74138546", "text": "def create_new_report!; end", "title": "" }, { "docid": "9e7f05251ee4...
f93130a04ad7887842da55958dd6faa7
GET /analysis_results/new GET /analysis_results/new.json
[ { "docid": "4382fb4ba43ad2b559433a8681612155", "score": "0.7952296", "text": "def new\n @analysis_result = AnalysisResult.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @analysis_result }\n end\n end", "title": "" } ]
[ { "docid": "6ecb0538e19775096ceec6aed0df7b28", "score": "0.787994", "text": "def new\n @analysis = Analysis.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @analysis }\n end\n end", "title": "" }, { "docid": "8c1632282be1b9d9a7dcfd...
77233fb861667db5a51b1a34ac90dc31
initially thinking just run through all the permutations of containers, but even printing them out takes forever. It's not a permutation that I want, it's all combinations of the inputs, but of varying sizes (that is, where we choose from [1..containers.length] items each time)
[ { "docid": "6d39e63ef6bc52738125572a1c07819c", "score": "0.5676855", "text": "def count_container_combos(min_bucket_num, bucket_limit, limit, containers)\n num = 0\n num_buckets_used = []\n min_bucket_num.upto(bucket_limit).flat_map do |num_buckets|\n num_matches = containers.combination(num_bucke...
[ { "docid": "f4e9afbe958e0e7dfb0e8c838ea4641f", "score": "0.6850028", "text": "def permutations(elements)\n return [elements] if elements.size <= 1\n result = []\n elements.uniq.each do |p|\n _elements = elements.dup\n _elements.delete_at(elements.index(p))\n permutations(_elements).each do |perm|\...
e60f19ef529cb9fd54b7fa40537cce1a
Get the hash at the given coordinates
[ { "docid": "88c0aa910d3fc9ca29a990c80fefffa4", "score": "0.7653185", "text": "def hash_for_coordinates(x, y, board)\n board[(x.to_s + y.to_s).to_i]\n end", "title": "" } ]
[ { "docid": "8407f9168fc0df23919dc604f7abfbf1", "score": "0.71912795", "text": "def hash_pos\n return (@x * 1000 + @y)\n end", "title": "" }, { "docid": "8407f9168fc0df23919dc604f7abfbf1", "score": "0.71912795", "text": "def hash_pos\n return (@x * 1000 + @y)\n end", "titl...
c3aceffd80602bfbeb8c0563f716d31c
GET /organizations/new GET /organizations/new.json
[ { "docid": "a823a453a7d2d4a5102d1c4f9c0790d7", "score": "0.8000781", "text": "def new\n @organization = Organization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organization }\n end\n end", "title": "" } ]
[ { "docid": "e5ac26479f193f4bb138d5b09b0897e6", "score": "0.8050886", "text": "def new\n @breadcrumb = 'create'\n @organization = Organization.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organization }\n end\n end", ...
b770040cb37815c76f34a86712b20531
function that decrypts encoded text
[ { "docid": "bdf81ace260816238b06067ceb781fd4", "score": "0.76403093", "text": "def textDecryptor(encodedText, cryptoKey)\n decryptedText = \"\"\n\n #algorithm that uses key to un-shift letters in encoded word to return to human readable form (original word)\n encodedText.each_char do |value|\n ...
[ { "docid": "8ff78a57b1e97bb17ffd6f2c1b792754", "score": "0.8192837", "text": "def decrypt; end", "title": "" }, { "docid": "7d6b35d30d7f7cc65717e7ba3b92586c", "score": "0.77974737", "text": "def decrypt(text)\n @private_key.private_decrypt(Base64.decode64(text)) if text\n end...
10529c027056692d9c4982f984227375
Display in Enabled State?
[ { "docid": "ba04e999b9b60849bea16a6b5a6c0283", "score": "0.0", "text": "def enable?(item)\n return super if item.is_a?(RPG::UsableItem)\n return true\n end", "title": "" } ]
[ { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.8040662", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.8040662", "text": "def enabled_state\n super\n end", "title": "" }, { ...
1092fad1da30fcfa62408e649758a403
PATCH/PUT /ip_adresses/1 PATCH/PUT /ip_adresses/1.json
[ { "docid": "f9b0212b7112d4cc3051698bc02ddeb4", "score": "0.6312498", "text": "def update\n respond_to do |format|\n if @ip_adress.update(ip_adress_params)\n format.html { redirect_to @ip_adress, notice: 'Ip adress was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "a45442fbc6dafba1063300976c3dfd83", "score": "0.6627806", "text": "def update\n respond_to do |format|\n if @ip_address.update(ip_address_params)\n format.html { redirect_to ip_addresses_path, notice: 'Ip address was successfully updated.' }\n format.json { head :no_cont...
77aef0cbe589527e02f40724126a5e6f
DELETE /filtering_fields/1 DELETE /filtering_fields/1.xml
[ { "docid": "a17bf145cda4e1c535e1a5bc492e676a", "score": "0.685943", "text": "def destroy\n @filtering_field = FilteringField.find(params[:id], :include => :questionnaire)\n @questionnaire = @filtering_field.questionnaire\n @filtering_field.destroy\n\n respond_to do |format|\n format.htm...
[ { "docid": "70470093fa6d7a308b7f4afaae80fbfe", "score": "0.61979336", "text": "def del_filter(set, path=nil)\n p = path ? \"/filters/delete/#{path}/#{set}\" : \"/filters/delete/#{set}\" \n request({:method=>\"DELETE\", :path=>p})\n end", "title": "" }, { "docid": "e5399a2cb826177e41dc...
94f2d8535d59d9057fbde6fc96091122
Generates the tokenized kshingles for this String. See Minhash::StringFunctionstokenized_k_shingles
[ { "docid": "9036a7f639a74eda098a6e4caa07bf2f", "score": "0.8085885", "text": "def tokenized_k_shingles(k, &block)\n Minhash.tokenized_k_shingles self, k, &block\n end", "title": "" } ]
[ { "docid": "fef673fe9edf5acd3df209d63cccd82d", "score": "0.5815137", "text": "def gen_keys(str); end", "title": "" }, { "docid": "e87eaf1a16271d3fec4ab5c7c4c9ec65", "score": "0.5669627", "text": "def knothash(string)\n hasher = KnotHash.new(256, string.bytes + [17, 31, 73, 47, 23])\...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "5e642a4e8ff1fbe84ffc3b268f7d366b", "score": "0.0", "text": "def author_params\n params.require(:author).permit(:id, :author_first_name, :author_last_name, :author_middle_name, :author_email,\n :affiliation_id, :resource_id, :author_orcid)\n end", ...
[ { "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":...
54cdeb31221694fd48db3ca83284c4b8
Sets the capability to true or false. Example. permission[:read] = true
[ { "docid": "7a3573334d53339477ccfc529789e2f4", "score": "0.6357371", "text": "def []= type, arg\n bool = case arg.to_s\n when /false|0/i then false\n when /true|1/i then true\n end\n return unless has_capability? type and not bool.nil?\n self.bitmask ^= self[type] == b...
[ { "docid": "9207a114dd85b2e891c7d0ed483e4f20", "score": "0.71456575", "text": "def capability=(value)\n @capability = value\n end", "title": "" }, { "docid": "d56afdd090814e6f8a87e8354b4d3ec3", "score": "0.6747171", "text": "def _capability\n role_capabilities.inject({ }) ...
b37e606a1398a720e39e2429ecf73074
Adds a condition to the request. column The column in question. value The value to be matched with the column.
[ { "docid": "a988748324918d86bf3927d19a00da4f", "score": "0.75907874", "text": "def if(column, value)\n @query += \"#{column} = ? \"\n @values << value\n return self\n end", "title": "" } ]
[ { "docid": "b2006b8ed1d0c85ddaa45e8540db2d0c", "score": "0.6644777", "text": "def add_column_condition(query:, column:, values:)\n return query if values.nil?\n query.where(column.in(values))\n end", "title": "" }, { "docid": "3e159dcafb2a74b42cef2ccacb02c73d", "score": "0.6...
1247133a904be112f571c16b4f0b3e0d
Returns number of free bytes in the output buffer. As the output buffer is self expanding this normally returns 0.
[ { "docid": "20c86c5b6a74de471eae60bffe1da894", "score": "0.714439", "text": "def avail_out\n\t\t\t@output_buffer.length - @out_pos\n\t\tend", "title": "" } ]
[ { "docid": "eaca1e619a6d9a36df25158a10dfa8d3", "score": "0.7326297", "text": "def bytes_used\n bytes_total - bytes_free\n end", "title": "" }, { "docid": "55ef7fe5430a3dc143743041bd29e6a0", "score": "0.7313394", "text": "def total_out\n\t\t@output_buffer.length\n\tend", ...
96ba1473966b6fc9bc736019bfdce64c
PATCH/PUT /investigation_results/1 PATCH/PUT /investigation_results/1.json
[ { "docid": "9ea3f6d569f1af037d548ffc080fc5d7", "score": "0.7143969", "text": "def update\n respond_to do |format|\n if @investigation_result.update(investigation_result_params)\n format.html { redirect_to @investigation_result, notice: 'Investigation result was successfully updated.' }\n ...
[ { "docid": "65db656da3d2656da0389213af915e42", "score": "0.65946275", "text": "def update\n respond_to do |format|\n if @investigation.update(investigation_params)\n format.html { redirect_to @investigation, notice: 'Investigation was successfully updated.' }\n format.json { render...
3460a5e2bc9997952ac8036678f76cf5
The sum of the expenses should be the same of the general outflow obtained from the Reports UI
[ { "docid": "0ced704851ca16039d7bb65e867ff520", "score": "0.6462259", "text": "def AssertionValidateTheCalculationOfTheExpensesIsEqualToTheOutflow()\n assert_equal(Helper.getSumArrayFloatAmount(self.categorysAmount.map {|name| name.text}),Helper.getFloatAmount(self.totalOutFlow.text), \"test is failing ...
[ { "docid": "1636c4af17dff23cdf88170c2e53d92a", "score": "0.75297034", "text": "def total_expenses\n sum_expenses(self.expenses)\n end", "title": "" }, { "docid": "ed0f2dcd41e536c4e450dddd0bc3d766", "score": "0.73701084", "text": "def expenses\n section, section_name = ge...
00974e15282d3e27e287910610d7688b
handle user commands here
[ { "docid": "7dc520a86cdc7de077933c8411ce5d09", "score": "0.0", "text": "def cmd_option\r\n clear_screen\r\n case @cmd\r\n when NEW_GAME\r\n return game_start\r\n when ADD_NEW_WORD\r\n loop do\r\n clear_screen\r\n if error_msg(add_new_word(@word_list)) == GAME_CONTINUE...
[ { "docid": "9322fe2361b10c4238178db4f964959b", "score": "0.7272658", "text": "def run_command(user_input)\n handle_user_input(user_input)\n end", "title": "" }, { "docid": "936bd368587e041de69937aeac0990ec", "score": "0.71593434", "text": "def process_commands; end", "tit...
647af9b398d769f12f6d0b9654ef87fd
GET /portal/learners/new GET /portal/learners/new.xml
[ { "docid": "1e18cd15195e54faea5a7e05c5172e2a", "score": "0.71205866", "text": "def new\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Learner\n @portal_learner = Portal::Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xm...
[ { "docid": "76979efff517db3db54c52360b4d3dc3", "score": "0.7910361", "text": "def new\n @learner = Portal::Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @learner }\n end\n end", "title": "" }, { "docid": "1dd95e22118448...
409d16dbca997b1635414eb35832da4b
takes in an markings argument and returns a copy without id's
[ { "docid": "f20bf88502e71f1f19f493dff3db0410", "score": "0.64615965", "text": "def remote_ids_from_args(markings)\n new_markings = markings.deep_dup\n # First get rid of the controlled structure\n new_markings.delete(:controlled_structure)\n # then get rid of the remote object type\n...
[ { "docid": "fcf7e198c01b0ae4c423dcbc279f55a2", "score": "0.56786335", "text": "def delete_marker; end", "title": "" }, { "docid": "c7ca8b88ac03d43d69d807837e071134", "score": "0.5435761", "text": "def copy(cleanse = true)\n a = dup\n a.cleanse if cleanse\n a\n end", "ti...
37193986c6868e6e9785ae9b08528ae4
Class Methods Instance Methods
[ { "docid": "dda5b99df642339db95fbc88c8122880", "score": "0.0", "text": "def display_name\n if self.importable\n \"#{self.id} - Import Data for #{self.importable.display_name}\"\n else\n \"#{self.id} - Import Data (No Importable)\"\n end\n end", "title": "" } ]
[ { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7328269", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7328269", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46",...
62141de8082e5d5a31549852b7e29b28
Is this hand a blackjack?
[ { "docid": "b854327dc324e9e4c11c80d492549848", "score": "0.7000673", "text": "def bj?\n return self.max_hand == BJ_HAND && !@ace_split\n end", "title": "" } ]
[ { "docid": "44786a56067b5ff416b2e8890feb26f8", "score": "0.89544564", "text": "def is_blackjack_hand(hand)\n return hand.is_blackjack\n end", "title": "" }, { "docid": "8d43047b148f479dd1274e7eb4322774", "score": "0.8946779", "text": "def is_blackjack\n return @hand.is_blackja...
4d39452820e174efd9fd449b40b79dbe
Within the encrypt method, write an algorithm that takes a string and advances each letter one index forward. Within the decrypt method, write an algorithm that reverses the given string one character. Create two methods, these methods can be called whatever you want, but make sure it's a relevant. The first method wil...
[ { "docid": "c3932b3ff4d6a66251a8307acb40d101", "score": "0.0", "text": "def encrypt(str) #define encryption method\n\n \tindex = 0 \n \tcharset = \"abcdefghijklmnopqrstuvwxyz\" #define all possible characters\n \twhile index < str.length \n \t\tif str[0] == charset[-1]\n\t\t\tstr[index] = charset[inde...
[ { "docid": "8cbb31dc6d0d7d8b5d4c5fa2f9a1bc97", "score": "0.7657667", "text": "def method_decryption (string)\r\nindex = 0\r\n while index < string.length\r\n string[index] = method_previous(string[index])\r\n index += 1\r\n end\r\nstring\r\nend", "title": "" }, { "docid": "28e36a95bd...
95c15660caf2702f4d6c2a1772b7089f
Given a URI ( get the ontology acronym (BRO)
[ { "docid": "1c921dc80f573510bc686a5b49af1027", "score": "0.78396577", "text": "def acronym_from_ontology_uri(uri)\n acronym_ontology_uri_map[uri.to_s]\n end", "title": "" } ]
[ { "docid": "ce95e3faa5b5894ad5b8f162351182e5", "score": "0.67327905", "text": "def ontology_uri_from_acronym(acronym)\n ontology_uri_acronym_map[acronym]\n end", "title": "" }, { "docid": "c885f5f07386e3bd72c1859b43ee471e", "score": "0.65094066", "text": "def ontology_uri...
9cd2dd1fd1c82e4cd283ac81c17ee202
:callseq: on_cvar: (String value) > CVar source://syntax_tree//lib/syntax_tree/parser.rb1259
[ { "docid": "30f82afe771dba29bbb5fff9140bf10f", "score": "0.8435098", "text": "def on_cvar(value); end", "title": "" } ]
[ { "docid": "e9a189243acadd5108af9c9160d9defc", "score": "0.80981797", "text": "def visit_cvar(node); end", "title": "" }, { "docid": "7893b85ba979165bd3197e32ddb6941d", "score": "0.78661877", "text": "def visit_cvar(node)\n s(\n :cvar,\n [node.value.to_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e46a8e85a9f6da3caeebc8ad9085309b", "score": "0.0", "text": "def recipe_params\n params.require(:recipe).permit(:title, :recipe, :city, :address, :zipcode, :image)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6978086", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6780264", "text": "def strong_params\n params.requi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c260493e096449e7d25d00e329fc6f07", "score": "0.0", "text": "def set_user_article\n @user_article = UserArticle.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...
cd5fb211f07214dc1095c6848d79de95
Get plugin list that enabled navbar
[ { "docid": "b7febe90f619eb89f3f19d8c53c4e84f", "score": "0.82920295", "text": "def navbar_plugins\n sorted_plugins.select { |plugin| plugin.navbar_link == true && plugin.root_path.present? }\n end", "title": "" } ]
[ { "docid": "e99a46c14d471c3ec9ba94193a1a75ad", "score": "0.81878", "text": "def navbar_plugins\n plugins.sort.select { |plugin| plugin.navbar_link == true && plugin.root_path.present? }\n end", "title": "" }, { "docid": "69f14001d37852c0f093372ed0a60233", "score": "0.80779827", ...
5e55582c3540924c5e4e996e6e24d5dd
initialize is called automatically when an instance is created
[ { "docid": "994badedae4de2e0e5556868e21e170d", "score": "0.0", "text": "def initialize\n self.active = false\n end", "title": "" } ]
[ { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.89832526", "text": "def initialize\n initialize!\n end", "title": "" }, { "docid": "70bf8cb295fdc2050998983b54d334dd", "score": "0.8865515", "text": "def init\n end", "title": "" }, { "docid": "6fca...
358272a6e42124edfb89140cb4a3976e
Returns an array for the listed events. This array contains more than simply strings of the event titles, because often the titles are truncated to fit on the screen. In addition, getting the "title" tag of the link is often problematic because titles can contain doublequotes, which will mess up the HTML of the anchor ...
[ { "docid": "537b56a1ce458fc96a6223bca9ba6eea", "score": "0.7522526", "text": "def events_list\n list = []\n if frm.table(:class=>\"calendar\").exist?\n events_table = frm.table(:class=>\"calendar\")\n else\n events_table = frm.table(:class=>\"listHier lines nolines\")\n end\n ev...
[ { "docid": "c50f86f637d49673a942aac4d665cb77", "score": "0.6690712", "text": "def test\n company_event_page = @agent.get(\"https://abakus.no/event/company/\")\n events_list = company_event_page.search(\"#eventlist\")\n events_array = []\n events_list.css(\"li\").each do |li|\n title_nod...
7265b87e76ddb98068bb91a738611728
Helper to add common options values for ajax loading "busy" spinner
[ { "docid": "74e5a962c8e84b68edf94d81e341547c", "score": "0.76121765", "text": "def ajax_busy_options(element_id)\n {:loading => \"load_busy($('#{element_id}'))\", :complete => \"unload_busy()\"}\n end", "title": "" } ]
[ { "docid": "5aa5e40e02e334171fcec651e11a5fa2", "score": "0.6904051", "text": "def loading_with_spinner(spinner_id, options)\n options.merge(\n :loading => \"$('#{spinner_id}').show(); #{options[:loading]}\",\n :complete => \"$('#{spinner_id}').hide(); #{options[:complete]}\"\n )...
d1aa9247ee80fdffb1a225446cb0f62e
TODO: Currently if successful at canceling the order, this method will append status="successful" to the order information, which is kind of confusing. Think of a better idea to handle it
[ { "docid": "48eb5c89813ff46fc74c64f30154aed6", "score": "0.66296047", "text": "def cancel\n response = @client.user.orders.cancel id: self.id\n self.status = response.first.status\n self\n end", "title": "" } ]
[ { "docid": "08e048fb52fa7347137b0a2097681395", "score": "0.71564114", "text": "def cancel_order\n # change status and add item qty back to inventory\n if self.status != \"canceled\"\n self.status = \"canceled\"\n self.product.quantity += self.quantity\n self.product.save\n\n re...
2f60a66fc7c9ade08d38d0edd406c8ab
Get the checker id. Requires zone attribute to be defined in the ohm object
[ { "docid": "b2302596783abfa273b4f52dda458a02", "score": "0.8485172", "text": "def checker_id\n Helper.get_zone_checker(zone)\n end", "title": "" } ]
[ { "docid": "49202d0da683d80c7d9db5eb7c8c4c31", "score": "0.7016087", "text": "def get_zone_id\n uri = URI.parse(@cf_uri)\n params = \"name=#{@zone}\"\n request = \"Net::HTTP::Get.new(uri.path+'?'+params, headers)\"\n response = \"json.fetch('result').first['id']\"\n make_request(params, u...
cf36a2b36d86482165b7c2fe80392f7d
Writes the value for this data to +io+.
[ { "docid": "c8dacb6872c51237e15530b4477a0280", "score": "0.6245706", "text": "def _do_write(io)\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "2325f8d58ac997dbf7b8aeff0bea7ade", "score": "0.81318283", "text": "def write(io)\n io.write [@value].pack(format)\n end", "title": "" }, { "docid": "ea1a7a1dd38b3af9a827cb342482b8bd", "score": "0.7490224", "text": "def write(io)\n @values.each {|field|\n ...
94b953b6a73847c1d47f95f3a9f79a02
Defined Method Below (Remember variables within method are separate) def name_of_method(parameter1, parameter2) the variables you define here are the names you will use within the method within method you cannot call a variable from outside the method Between defend
[ { "docid": "680ca9b806d0354f5bb778f6b921baf5", "score": "0.0", "text": "def calculateTip(bill,tip_per,share)\n\ttip_value = bill*tip_per\n\ttotal=tip_value +bill\n\tshare_per_person=total/share\n\n\treturn [total,tip_value, share_per_person]\nend", "title": "" } ]
[ { "docid": "c788c261558ba5e5d6883577af9c30fa", "score": "0.70265377", "text": "def do_something(age, name, location)\n\nend", "title": "" }, { "docid": "3048a66c9676b0f0d0ec6b686566daed", "score": "0.6984841", "text": "def my_method_param(name) #Define method \"my_method_param\"\n p...
38e896fa24bd4caa9637224a47410ada
Method to remove an item from the list input: one of the item I want to delete steps: delete the item and quantity pair from the hash output: hash without the itme delteted
[ { "docid": "a62e76d721c1654d52ad2ee1d7f18941", "score": "0.0", "text": "def remove_item(list, item)\r\n\tlist.delete(item)\r\n\tp list\r\nend", "title": "" } ]
[ { "docid": "a53f0224fa5f17c5639643c080e4a81c", "score": "0.86094195", "text": "def remove_item(input_hash, item)\n# input: list, item name, and optional quantity\n# steps: use input item to delete key\n input_hash.delete(item)\n# output: hash data structure of key/value pairs\nreturn input_hash\nend", ...
def6e3ab5ca60788808b122b4f98534d
returns a Fixnum product for a given string number
[ { "docid": "878bc3334ddde69cbb1646598dd3827c", "score": "0.7450181", "text": "def product(string)\n num_array = string.split(\"\").each.map { |string_number| string_number.to_i }.inject(:*)\n end", "title": "" } ]
[ { "docid": "867a5099e38b6953ec335b18edafe5ca", "score": "0.8174561", "text": "def digit_product(str_num)\n digits = str_num.chars.map { |n| n.to_i }\n product = 0\n\n digits.each do |digit|\n product *= digit\n end\n\n product\nend", "title": "" }, { "docid": "867a5099e38b6953ec335b1...
104bed2b05f4f1620070ee19afbbf4ee
reduce 427 omitted reduce 428 omitted
[ { "docid": "236438b07d557b3d8c913d83af6c899b", "score": "0.0", "text": "def _reduce_429(val, _values, result)\n result = val[1]\n \n result\nend", "title": "" } ]
[ { "docid": "56bd5579a3a2de64f1337e1168c579a4", "score": "0.7627646", "text": "def _reduce_594(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "53a34acbe647416d051d0d32da148185", "score": "0.7604876", "text": "def _re...
08f7b9000a06af2e0a79a286fda693d2
POST /businesses POST /businesses.xml
[ { "docid": "73e59e34e3bc3ec88bb81cddbeb37e96", "score": "0.5274931", "text": "def create\n @business = Business.new(params[:business])\n \n respond_to do |format|\n if @business.save\n format.html { redirect_to(@business, :notice => 'Business was successfully created.') }\n f...
[ { "docid": "ce53ee289510053e88cd019d690e787f", "score": "0.595259", "text": "def post_business(business, location)\n xml = Builder::XmlMarkup.new\n query = xml.tag!(\"BPMSPost\", 'Edition' => \"1.1\") {\n xml.tag!(\"Record\") {\n xml.tag!(\"Phone\", location.phone)\n xml...
859ec4abe207fe2ee69d05d6b73a76b7
Returns a copy of this question that is bound to some object. This object will be used as the instance on which the `instance_block`, if provided, is `instance_eval`ed.
[ { "docid": "0fd1053ba3a6ed6731f6ad9f1ab45cc0", "score": "0.5796281", "text": "def for_instance(instance)\n self.clone.tap{|q| q.instance = instance }\n end", "title": "" } ]
[ { "docid": "e7f959c49c9d79e13a704d80c5fda6fd", "score": "0.602642", "text": "def evaluate(&block)\n self.original_self = eval \"self\", block.binding\n instance_eval &block\n end", "title": "" }, { "docid": "7d0138f3741aac335c664f94199feb0d", "score": "0.5940742", "text"...