query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f0a9fca9a60043adb70872bf52f95801
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/studio/v1/flow/engagement.rb166
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "e22f41db93da5f68f9fb97ddc00b4512", "score": "0.62203723", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Studio.V1.EngagementContextInstance #{values}>\"\n end", "title": "" }, { "docid": "837dd2e...
f40385f1583b8976c1cd779320b05f94
Standardize phone number string to "+2349999999" format
[ { "docid": "4c137a9e2711f32d7e7248b4024c18bb", "score": "0.0", "text": "def phone_std(options={})\n return nil if self.blank?\n raw = self\n# raw = (self =~ /\\A[0+]/ ? '' : '0') + self # Add zero if leading plus or zero not present\n return raw.gsub(/\\A0/,Settings.contacts.local_countr...
[ { "docid": "d6a34c184a5556071e20a4a034a90899", "score": "0.79362816", "text": "def normalize_phone\n md = /\\A\n (?:[+]\\s*1)?\n [^0-9]* (\\d{3})\n [^0-9]* (\\d{3})\n [^0-9]* (\\d{4})\n [^0-9]*\n \\z/x.match(phone)\n if md\n self...
d29ff8cdb26116120fae69796082713c
GET /materie/1 GET /materie/1.xml
[ { "docid": "86254c8523c64addc94c6ca4d8582daf", "score": "0.72218853", "text": "def show\n @materia = Materia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @materia }\n end\n end", "title": "" } ]
[ { "docid": "1064e52e288c800ab52c2a415fa723f8", "score": "0.6788945", "text": "def show\n @materium = Materium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @materium }\n end\n end", "title": "" }, { "docid": "58f...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "67adcd69cabe5b135867c2f2034e8bce", "score": "0.0", "text": "def column_gap_rule=(column_gap_rule)\n validator = EnumAttributeValidator.new('String', ['SingleSpacingGap', 'OneAndHalfSpacingGap', 'DoubleSpacingGap', 'Exactly', 'Multiple'])\n unless validator.valid?(column_gap_rule)\n...
[ { "docid": "af6d0e33773bc681443214ce777b13e1", "score": "0.7088127", "text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "title": "" }, { "docid": "85eec95603dc239e3d18923b2c672b31", "score": "0.6482...
7e1747d2bdd7c95c2f0500954181b0a9
GET /beta_codes GET /beta_codes.xml
[ { "docid": "c677de114c3478078d0bd468e7a7211d", "score": "0.76533663", "text": "def index\n @beta_codes = BetaCode.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @beta_codes }\n end\n end", "title": "" } ]
[ { "docid": "4eb68c3b3427860cc6a77ba16cedcbe7", "score": "0.7381983", "text": "def show\n @beta_code = BetaCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @beta_code }\n end\n end", "title": "" }, { "docid": "2...
53011fe8619728993dd2e55d671f4248
Helper method to minimize errors and SQL injection attacks
[ { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.0", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" } ]
[ { "docid": "26889126b97b966a1548de1447ac37c8", "score": "0.7346617", "text": "def sanitize_sql_like(string, escape_character = T.unsafe(nil)); end", "title": "" }, { "docid": "de43d2a6c083acd13dd2503ead0c06e8", "score": "0.7298638", "text": "def sanitize_for_sql(string)\n \t#string....
ff53610b1d1c7195b01106a520e362a7
GET /friends/1 GET /friends/1.xml
[ { "docid": "1f50e45bf2cef58b43b71b0190467a51", "score": "0.67851496", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friend }\n end\n end", "title": "" } ]
[ { "docid": "1a5f78f6a58c88c44664da6087a64eff", "score": "0.7750704", "text": "def show\n # GET /friends/1 or /friends/1.json\n end", "title": "" }, { "docid": "1e4930c5be5127f530c704b38c4a0449", "score": "0.7600105", "text": "def friends(args={})\n fetch(url(:\"friends\", args...
62219cf05513a52f3202b6dbd5e89c71
POST /unpublished_image_posts POST /unpublished_image_posts.json
[ { "docid": "f1f7d47dd36187d048e19ded9c11cc67", "score": "0.7168426", "text": "def create\n @unpublished_image_post = UnpublishedImagePost.new(unpublished_image_post_params)\n\n respond_to do |format|\n if @unpublished_image_post.save\n format.html { redirect_to @unpublished_image_post,...
[ { "docid": "3c356471cf9868a9a36b0a563a7fb695", "score": "0.7539687", "text": "def index\n @unpublished_image_posts = UnpublishedImagePost.all\n end", "title": "" }, { "docid": "73c55252efafbf466e19a4854a78dad9", "score": "0.70456254", "text": "def set_unpublished_image_post\n ...
7c32929a97eec99c6336ea99f0c8be46
Retrieve a list of filed returns for the specified company in the year and month of a given filing period. Security Policies This API requires openId bearer token for authentication This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root ...
[ { "docid": "9ce6999dcf3f878751531229229981a9", "score": "0.7007281", "text": "def get_filed_returns(companyId, options={}) path = \"/api/v2/companies/#{companyId}/filings/returns/filed\"\n get(path, options, \"22.3.0\") end", "title": "" } ]
[ { "docid": "3ddecfecfd5bdcf815d80aba9b66aa65", "score": "0.5853458", "text": "def index\n @accounts = current_user.companies.find(params[:company_id]).accounts\n if params[:fiscal_year_id].present?\n @fiscal_year = current_user.companies.find(params[:company_id]).fiscal_years.find(params[:fis...
260c951147362e8f7f3e598cf297c07d
PATCH/PUT /potential_users/1 PATCH/PUT /potential_users/1.json
[ { "docid": "79a82aeea713ac75305728a4e01cef0c", "score": "0.75033903", "text": "def update\n @potential_user = PotentialUser.find(params[:id])\n\n if @potential_user.update(potential_user_params)\n head :no_content\n else\n render json: @potential_user.errors, status: :unprocessable_en...
[ { "docid": "3b79ec0097a76ef85fc6e9656edc3daf", "score": "0.70619553", "text": "def patch_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "...
51a45589cb02c925c6ae5ef61fa9a505
wrapper for Load module methods
[ { "docid": "51b502c5105b7e6411a66f03ec75cd43", "score": "0.0", "text": "def load_game()\n all_saves = load_yaml(@@saved_games_file)\n show_all_saves(all_saves)\n\n choice = load_setup()\n case choice\n when 'l'\n show_all_saves(all_saves)\n load_game()\n when 'q'\n retur...
[ { "docid": "2c2454d4367937817b4ed909b5f80ae1", "score": "0.79494697", "text": "def load_modules; end", "title": "" }, { "docid": "f20d661e62a108b7664d68a11905e676", "score": "0.79118264", "text": "def load_modules=(_arg0); end", "title": "" }, { "docid": "9ca2120ae7213ca7...
ba1c9e655283a982863afb77776e5aab
DELETE /loads/1 DELETE /loads/1.json
[ { "docid": "df9cb2d74a2865e22bcbd3b7a001d327", "score": "0.6982181", "text": "def destroy\n @load.destroy\n\n respond_to do |format|\n format.html { redirect_to @load.atom }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "ddfb279546e5a294b57e9c89530b551d", "score": "0.71528274", "text": "def destroy\n @load.destroy\n respond_to do |format|\n format.html { redirect_to loads_url, notice: 'Load was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
f138b989bc87114634d9435115a3d312
Is `$FORCE` set? Returns true or false.
[ { "docid": "808aa0fd97eec9b522e73561b0a6d61d", "score": "0.8716045", "text": "def force?\n !!$FORCE\n end", "title": "" } ]
[ { "docid": "80458c731a295d4186a6e3277568422c", "score": "0.8584018", "text": "def force?\n $FORCE\n end", "title": "" }, { "docid": "80458c731a295d4186a6e3277568422c", "score": "0.8584018", "text": "def force?\n $FORCE\n end", "title": "" }, { "docid": "0d...
ff24c642a7a3453b8758a7b435bdbf38
Validate oauth2 hmac signature with required and optional vars == Parameters: mac:: Signature for validation algorithm:: Name of the algorithm valid vars are hmacsha256, hmacsha1 key:: Key for hmac algorithm ts:: The timestamp value calculated for the request. nonce:: The nonce value generated for the request. method::...
[ { "docid": "83d89577be9495604efe2ba078b81425", "score": "0.72603434", "text": "def is_valid?(mac, algorithm, key, ts, nonce, method, uri, host, port, ext)\n @ts = ts\n @nonce = nonce\n @method = method\n @uri = uri\n @host = host\n @port = port\n @ext = e...
[ { "docid": "753032b7933ffc74a1ff2c8b17fc51fb", "score": "0.6833596", "text": "def signature_valid?\n \n #:method => \"GET\",\n #:date => \"Mon, 20 Jun 2011 12:06:11 GMT\",\n #:nonce => \"TESTNONCE\",\n #:path => \"/example\",\n #:query => {\n # \...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "149d366d31ca12cb253270999365edcb", "score": "0.0", "text": "def beer_params\n params.require(:beer).permit(:name, :brewer, :beer_type, :abv)\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...
682afc5bf673dfdf55629763aeb9f175
Sets the background colour of the Checkbox. Args : +Numeric+ +colour+ > The numeric Gosu constant representing a colour
[ { "docid": "d00ad3aa118eaaee5e60284f9a7e3e07", "score": "0.7266855", "text": "def background_colour=(colour)\n\t\t@button.background_colour = colour\n\tend", "title": "" } ]
[ { "docid": "d6aa7261756ca73f6c45aa07687633c0", "score": "0.7365702", "text": "def background_colour=(colour)\n\t\t@label.background_colour = colour\n\tend", "title": "" }, { "docid": "acd34e953db9bcca7f9534415ece2aff", "score": "0.65986013", "text": "def set_background_color(color)\n...
49926a0e51059022b19af2b300651c21
POST /posts POST /posts.json
[ { "docid": "e19c72912d7eb7dc676216f2162aaff4", "score": "0.0", "text": "def create\n # @post = Post.new(params[:post])\n @post = Post.new\n @post.body = params[:body]\n @post.user_id = params[:user_id]\n @post.parent_id = params[:parent_id]\n\n respond_to do |format|\n if session[...
[ { "docid": "1696d5d4d22767f1a79db670670b4d3b", "score": "0.74463975", "text": "def create\n render json: Post.create(params[\"post\"])\n end", "title": "" }, { "docid": "deba9d8e3b025d0e293927ebdb81e62a", "score": "0.73221767", "text": "def create\n respond_with Post.creat...
90f2b69fccc319b638fa97262a50fa91
GET /archive_faqs/new GET /archive_faqs/new.xml
[ { "docid": "37b5335aaec7650c3798c98059f481c1", "score": "0.7038456", "text": "def new\n @archive_faq = ArchiveFaq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @archive_faq }\n end\n end", "title": "" } ]
[ { "docid": "b989e3bdcbcb6c17ed4905a4d8f5ddca", "score": "0.681254", "text": "def faq_new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @article }\n end\n end", "title": "" }, { "docid": "d0e190a2537d0d72f56...
5822164980872d2aed8cfedb5f47b819
Create or update a Nat Rule If a NAT Rule is not already present on Tier1 denoted by Tier1 ID, under NAT section denoted by , create a new NAT Rule. If it already exists, update the NAT Rule. Under tier1 there will be 3 different NATs(sections). (INTERNAL, USER and DEFAULT) For more details related to NAT section pleas...
[ { "docid": "527ea2353a9744dc7eef14beba926abe", "score": "0.5388547", "text": "def patch_policy_nat_rule(tier_1_id, nat_id, nat_rule_id, policy_nat_rule, opts = {})\n patch_policy_nat_rule_with_http_info(tier_1_id, nat_id, nat_rule_id, policy_nat_rule, opts)\n nil\n end", "title": "" }...
[ { "docid": "bfe262b9956b5e59643dd61530a28918", "score": "0.66996175", "text": "def create_or_replace_policy_nat_rule_with_http_info(tier_1_id, nat_id, nat_rule_id, policy_nat_rule, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNe...
f9374a5de7e2906a13c4cfe434e36317
calculate the inner product if this point with p
[ { "docid": "119051d6a79ffce7e5d0f78cd092e729", "score": "0.6302903", "text": "def ip(p)\n (0...size).inject(0) { |sum, i| sum + @coords[i] * p[i] }\n end", "title": "" } ]
[ { "docid": "6e12721fa815b44349b159fc8e08af02", "score": "0.68562543", "text": "def pi_product\n self.inject{|a,b| a*b}\n end", "title": "" }, { "docid": "052b572a721d3ea5c920d69d39be6ed7", "score": "0.6750435", "text": "def products_at_point(x,y)\n -1.upto(1) do |j|\n -1....
a1100ef4c47263d7555e55cdbbc1576a
invert = [] ballots.each do |ballot| reverse = ballot.invert invert << reverse end puts invert.inspect
[ { "docid": "d7ccf289786e4f2f6fb5d5cbe529a174", "score": "0.0", "text": "def tally(ballots, names)\n names.each { |k, v| names[k] = 0 }\n ballots.each do |ballot|\n ballot.each do |key, value|\n if key ==1\n names[value] += 3\n elsif key ==2\n names[value] += 2\n elsif k...
[ { "docid": "ad39997f48d7ceea7abbfbe810e01f65", "score": "0.728263", "text": "def invert\n end", "title": "" }, { "docid": "81bb961b4d0fc6c0cc313ba1d67a9605", "score": "0.7267915", "text": "def invert(list)\ninvertlist = []\n list.each do |x|\n invertlist.push(- x)\n end\n re...
4efdd8a79fe0b661df7653e7d06c4b12
Whether to raise or return false if this action fails. If the :raise_on_failure option is present in the hash, use that, otherwise, fallback to the object's raise_on_save_failure (if set), or class's default (if not).
[ { "docid": "d13bb859a865a1ad8b571f6e4713ecb8", "score": "0.79270744", "text": "def raise_on_failure?(opts)\n opts.fetch(:raise_on_failure, raise_on_save_failure)\n end", "title": "" } ]
[ { "docid": "9024affe63886718df6c472acb20c854", "score": "0.64296734", "text": "def handle_silent_modification_failure?\n self[:raise_on_save_failure] == false\n end", "title": "" }, { "docid": "efafc31078da4a279dc95d4e72d29051", "score": "0.6112847", "text": "def save...
eb3242fa7b3944090fff92fbd77901dc
Equality testing. true iff keys of both digrams are equal, false otherwise
[ { "docid": "6d054b669354b8a0df1353f8608d6b82", "score": "0.62866855", "text": "def ==(other)\n key == other.key\n end", "title": "" } ]
[ { "docid": "4dfe7ba55e0643055113aba0230926e2", "score": "0.6694381", "text": "def equivalent_hash?(a, b)\n lower_a = Hash[a.map { |k, v| [k.downcase, v] }]\n lower_b = Hash[b.map { |k, v| [k.downcase, v] }]\n return lower_a == lower_b\nend", "title": "" }, { "docid": "52c4a335901019131156...
bc613b005c364b3f8af41f634db63d93
the different types of classes added to a date object depending on the date
[ { "docid": "ca167b6ca7f1abf70208f7ccda8abff5", "score": "0.0", "text": "def today\n \"today\" if @date == Date.today\n end", "title": "" } ]
[ { "docid": "266032fbf5e1a34344736ce04cf21ba8", "score": "0.73528194", "text": "def date_classes\n [Date, defined?(FmRest::StringDate) && FmRest::StringDate].compact.freeze\n end", "title": "" }, { "docid": "fa9d3442feca1eb5d32bbae42423897e", "score": "0.6324633", "text": ...
d91b997c30e6bcac00067865f942f119
Seeks to the given position (in bytes) in +io+
[ { "docid": "c08b38756621e30cbf6e124f34fae274", "score": "0.6257967", "text": "def pos=(offset)\n if closed?\n raise IOError, 'IO#pos on closed IO'\n end\n ofs = Maglev::Type.coerce_to(offset, Fixnum, :to_int)\n seek(ofs, SEEK_SET)\n end", "title": "" } ]
[ { "docid": "086ee8cd18133fcb4513f2ed21eebc87", "score": "0.75424814", "text": "def seek(pos)\n @io.seek(pos)\n end", "title": "" }, { "docid": "0a40f3f23f9e91d0c283197952e30e34", "score": "0.75041604", "text": "def seek(x); @_io.seek(x); end", "title": "" }, {...
51cb09fd2a508946f562263e57a5db87
checkin > remove name from checked_out_by_currently array and add one to the number available
[ { "docid": "e84587de69c978fa4b85905480c7bf3f", "score": "0.75491935", "text": "def checkin(name)\n @checked_out_by_currently.delete(name)\n @copies_available += 1\n end", "title": "" } ]
[ { "docid": "26eb8c61ba7022943b1b618c404b8760", "score": "0.7162948", "text": "def checkout(name)\n if @checked_out_by.include?(name) == false\n @checked_out_by << name\n end\n @checked_out_by_currently << name\n @copies_available -= 1\n end", "title": "" }, { "docid": "7435...
f0b4dcc5d13a2727c8dd6c4bb08dff6d
These helper methods will help us determine what type of user
[ { "docid": "0b1d16961b1176e4cc35086b33b9c25e", "score": "0.62829965", "text": "def user_type_for?(project = nil)\n return nil unless project\n\n user_project = user_projects.find_by_project_id(project.id)\n\n user_project ? user_project.user_type : nil\n end", "title": "" } ]
[ { "docid": "0380b614c6994f248a75a5d8ed689463", "score": "0.8014247", "text": "def user_type\n provider_match = \"oceanus\"\n if self.dsm?\n USER_TYPES[:dealership]\n elsif self.vendor_user?\n USER_TYPES[:vendor]\n # For oceanus users you need to return user\n elsif (!self.user_p...
556b4deb263045ee63519ee4c6fd78f9
send notification on successful order?
[ { "docid": "44c829d9ab91cecd1687920ee48ce851", "score": "0.0", "text": "def notify?\n account.notification_url.present? && digimember_id.present?\n end", "title": "" } ]
[ { "docid": "272ea19bc734944fb65817726d2c3f63", "score": "0.83255434", "text": "def send_notifications_for_successful_order\n return if @order.nil?\n\n publish_subscription_created_event(@order)\n notify_rm_team(@order)\n end", "title": "" }, { "docid": "fdaeeb637f07a5b90868...
3b11a8297b64841f0be60b971027c28d
PUT /activities/1 PUT /activities/1.json
[ { "docid": "1b8726fcc549360084ea77da6783f846", "score": "0.6726247", "text": "def update\n @activity = Activity.find(params[:id])\n\n respond_to do |format|\n if @activity.update_attributes(params[:activity])\n format.html { redirect_to @activity, notice: 'Activity was successfully upd...
[ { "docid": "d1b9228ba0de42ac0ade1169eacbbc85", "score": "0.7400462", "text": "def update\n activity = Activity.find_by(id: params[:id])\n activity.update(activity_params)\n render json: activity\n end", "title": "" }, { "docid": "7d1394b3aa975b7b19c8b5bcc5d790ea", ...
2d202f323aa1d2e5c28d1b01cbc0e156
Method to add an item to a list input: list, item name, and optional quantity steps: add new information to the hash output: hash with new items
[ { "docid": "1bcf69296adf3e9530bf9364f77115c2", "score": "0.0", "text": "def add_change_item(list, item, quantity)\r\n\tlist[item] = quantity\r\n\tp list\r\nend", "title": "" } ]
[ { "docid": "4055425147ef573bb65b4a03a49055e0", "score": "0.8756887", "text": "def add_to_list(list, item, quantity)\n# steps: set itemname as key and optional quantity as value\n\tlist[item] = quantity\n# output: hash containing the added item\n\tp list\nend", "title": "" }, { "docid": "8688...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7660b2106ed98fc31e10838677fb2e35", "score": "0.0", "text": "def set_unit\n @unit = Unit.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...
1cec5b54e199d6f043101056cbbd41cc
Expand the object's children into a listing of Comments and MoreComments.
[ { "docid": "8d32b3a76c3c21e9dea2e03644332f2b", "score": "0.0", "text": "def expand_one(link:)\n params = { link_id: link.name, children: read_attribute(:children).join(',') }\n params[:sort] = link.sort_order if link.sort_order\n client.model(:post, '/api/morechildren', params)\n ...
[ { "docid": "3d05467ffa69b1388df0cd894b52b51d", "score": "0.6909528", "text": "def recursive_comments\r\n child_comments = self.comments.all.map { |comment| comment.recursive_comments }\r\n [self, child_comments]\r\n end", "title": "" }, { "docid": "fbf852380a16bad51d0f5b38f4982701", ...
cc7afeeca176d377dfa90fae821b0b86
DSL method for building the `functions` part of the query definition
[ { "docid": "b7e7d10c36ab11078dc38ed71ee4769f", "score": "0.5125749", "text": "def functions(value=nil)\n if value\n @functions = value\n else\n @functions\n end\n end", "title": "" } ]
[ { "docid": "48d53403d8844524ffc3e269c11911ee", "score": "0.6787852", "text": "def create_function_query(expression) #:nodoc:\n if expression.is_a?(Sunspot::Query::FunctionQuery)\n expression\n elsif expression.is_a?(Symbol)\n Sunspot::Query::FieldFunctionQuery.new(@setup....
f65d99553a7957d84cbb3123e2103d01
Write a `batch_badge_creator` method that takes an array of names as an argument and returns an array of badge messages.
[ { "docid": "796c088444fce72d73389cc2fee506e8", "score": "0.8526702", "text": "def batch_badge_creator(names)\n messages = []\n names.each do |name|\n message = badge_maker(name)\n messages.push(message) #messages << message\n end\n return messages\nend", "title": "" }...
[ { "docid": "2bec0d3bd64dbbac2cf3b2bd210635ab", "score": "0.8695499", "text": "def batch_badge_creator(names)\n badges_messages = names.collect {\n |name| badge_maker(name)\n }\n return(badges_messages)\nend", "title": "" }, { "docid": "e2b0fed6431594d4f5c4afc23f96b89c", "score": "0...
da3560b443cc1bce840920516c889d92
TODO: metodo requiere refactoring TODO: verificar en donde se utiliza este metodo
[ { "docid": "1bbdbefdbe621bfc7d960d704c33a16c", "score": "0.0", "text": "def update\n @response_to_the_evaluation = ResponseToTheEvaluation.find(params[:id])\n @response_to_the_evaluation.save\n respond_to do |format|\n if @response_to_the_evaluation.save\n format.json\n forma...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7371743", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.62926584", "text": "def probers; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", ...
8261e68b8e998942de382d861903a39d
GET /vaccinations/1 GET /vaccinations/1.xml
[ { "docid": "ff1f917706ddcb395d9bc427c365c513", "score": "0.70071644", "text": "def show\n @vaccination = Vaccination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vaccination }\n end\n end", "title": "" } ]
[ { "docid": "759cb1117771bb2a11199a9209f8aa7f", "score": "0.66280425", "text": "def vips\n request :get, '/vips'\n end", "title": "" }, { "docid": "89f33250ffbb063e998d0bc55383aab8", "score": "0.65225285", "text": "def show\n respond_to do |format|\n format.html # show.htm...
40691c1bcee8e3e802694c6b6fadd91d
actions for cards product
[ { "docid": "77c3ae597861315fba1152158e75d984", "score": "0.0", "text": "def americas_cards_visa\n end", "title": "" } ]
[ { "docid": "e20ffaea4f4f9049f255e76ad9f042de", "score": "0.673889", "text": "def actions(order, variant)\n h.content_tag(:div, class: 'big ui compact icon buttons') do\n h.link_to(h.product_path(object.product.id), target: :_blank, class: 'ui blue basic button') do\n h.content_tag(:i, '',...
74ccf402475d83f2b1ff9c3cf8ef64be
PUT /books/1 PUT /books/1.json
[ { "docid": "9d131470ed402858fd3314900ef8ff74", "score": "0.66617465", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n fo...
[ { "docid": "e48618ca14f92c5d9c35ddcf8b4ce613", "score": "0.6936884", "text": "def update\n @book = Book.find(params[:id])\n\n if @book.update(book_params)\n head :no_content\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { ...
e6be96916d8548884ef8cb043fae0e57
Internal: Postorder DepthFirst search algorithm. Used for resolving asset dependencies. initial Initial Array of nodes to traverse. block node Current node to get children of Returns a Set of nodes. source://sprockets//lib/sprockets/utils.rb165
[ { "docid": "efc79225c8620d9bd59a78d0f3f4f73f", "score": "0.0", "text": "def dfs(initial); end", "title": "" } ]
[ { "docid": "85b2b2cfcedfde376cb8e620c311038d", "score": "0.67922795", "text": "def postorder\n return @nodes if !@root\n postorder_helper(@root)\n return @nodes\n end", "title": "" }, { "docid": "18b0488ccb7f2ef6526f05c5dd13424d", "score": "0.6631325", "text": "def postorde...
1d150738eebee414f2119b76ff4ac7f0
input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: [fill in any steps here] set default quantity print the list to the console [can you use one of your other methods here?] output: [what data type goes here, array or hash?] Method to add an item to a list input: string 'item name...
[ { "docid": "915eb7a44505ef00c28afa1925e49fe8", "score": "0.0", "text": "def create_list list\n temp = list.split(' ')\n grocery_list = Hash.new\n grocery_list.default = nil\n temp.each{|el| grocery_list[el] = 1}\n grocery_list\nend", "title": "" } ]
[ { "docid": "2516f2772a1013caa0505f9cb3ae483a", "score": "0.81554276", "text": "def add_item(list, item, quantity = 1)\n# input: list, item name, and optional quantity\n# steps: \n # check for optional quantity. if not present, set to default (1)\n list[item] = quantity\n # update list with input\n l...
36e89c5452bc57f35ac70c6b198c2012
It calls two methods predicted_deaths and speed_of_spread with instance variables.
[ { "docid": "0aea1ff6270ed24ee8d362f8d72bccff", "score": "0.0", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" } ]
[ { "docid": "290bee692ebb95044eb26423a3fc2a54", "score": "0.75692683", "text": "def virus_effects \n predicted_deaths #no arguments needed (@population_density, @population, @state) as method predicted_death works with instance variables\n speed_of_spread #no arguments needed (@population_density,...
ef1ef3577cfb82a95cd3b94a18141ef8
Calculate Classification of this Sample given the weights
[ { "docid": "bc1a4e7e2823d323c6178d2f0e4c5bf0", "score": "0.7624402", "text": "def calc_class(weights)\n sum = weights.inner_product @attributes\n if sum > 0\n 1\n else\n 0\n end\n end", "title": "" } ]
[ { "docid": "a64edc37a4986aecb4e3b8bbf682c3c7", "score": "0.7114275", "text": "def classify\n Rails.logger.debug \"Classification #{id}.classify\"\n weights_sum = classifiers.map( &:weight ).reduce( 0, :+ )\n Rails.logger.debug \"weights_sum: #{weights_sum}\"\n\n available_sum = classifiers.r...
750d0347a3778ca79202d9ab6e4031b8
wait_for_match keeps checking file for the presence of string until timeout seconds have passed. If it finds the string within timeout seconds, it returns true.
[ { "docid": "b8c248efc4f422d8cb8afb3ba03efbcc", "score": "0.83598435", "text": "def wait_for_match(file, string, max_timeout)\n interval = 5\n max_retries = max_timeout / interval || 1\n found = false\n max_retries.times do |i|\n if i % 2 == 0 || i == max_retries\n puts \"[#{i * i...
[ { "docid": "3a42a39878269d10dc875a2b11539427", "score": "0.7223892", "text": "def wait(input, t = timeout)\n regex = convert_to_regex(input)\n Timeout::timeout(t) do\n until log.read.match regex\n sleep 0.01\n end\n end\n sleep 0.01\n self\n rescue Timeout::Error\n pu...
7fde2fde25d409f6f14fab799a8d761e
Get Details of a CAO
[ { "docid": "8efc9c7496e026d8b5237a03a1a40d0c", "score": "0.59380776", "text": "def show\n @organization = Organization.find(params[:organization_id])\n @cao = Cao.find(params[:id])\n end", "title": "" } ]
[ { "docid": "ec238bf34ba78b14c35d8595b679fecb", "score": "0.63096887", "text": "def get_detail_info(header=Salesforce::Rest::AsfRest.send(:class_variable_get, \"@@auth_header\"),\n rest_svr=Salesforce::Rest::AsfRest.send(:class_variable_get, \"@@rest_svr\"),\n api_version=Salesforce::Re...
19a9ccc3308bf2a47d80c0a4c151154f
Returns the environment paths as an Array
[ { "docid": "ae5b5e00bb7ef6ceca2dc5a655f78474", "score": "0.62329495", "text": "def paths; execute_platform_specific(:paths); end", "title": "" } ]
[ { "docid": "0c2a5b8920aa9962d8c1085b4d949587", "score": "0.8645276", "text": "def environment_paths\n Array(@options[:environment_paths])\n end", "title": "" }, { "docid": "9dee7a0c12dcbc093893ee8f13e26042", "score": "0.83622444", "text": "def env_paths\n path = ENV['PATH'...
da1be7d959873ccf6c7c189ec3b1e3bb
get userinput3 if userinput3 == "list songs" list_songs elsif userinput3 == "list artists" list_artists elsif userinput3 == "list genres" list_genres elsif userinput3 == "list artist" list_songs_by_artist elsif userinput3 == "list genre" list_songs_by_genre elsif userinput3 == "play song" play_song else nil end end
[ { "docid": "e25798c459e96fec01ee765ca9ade2cc", "score": "0.0", "text": "def list_songs\n number = 0\n Song.all.sort_by!{ |m| m.name }\n Song.all.each do |item|\n number = number + 1\n puts \"#{number}. #{item.artist.name} - #{item.name} - #{item.genre.name}\"\n end\nend", "title": "" } ]
[ { "docid": "d8cfce41a40decf0095a3133880b86d9", "score": "0.717296", "text": "def call\n puts \"Welcome to your music library!\"\n puts \"To list all of your songs, enter 'list songs'.\"\n puts \"To list all of the artists in your library, enter 'list artists'.\"\n puts \"To list all of the g...
a56f9573469dcc2b04e5ba31088f9e9a
Returns method used for retrieving the build information txt file from individual properties after deployment
[ { "docid": "497f942532fe7374d2666a46d8cc2e3c", "score": "0.7035208", "text": "def svc_build_info(env, solution)\n url = \"http://#{env}.services.gamestop.com/Ecom/#{solution}/buildinfo.txt\"\n build_text_file = []\n open(url) do |f|\n no = 1\n f.each do |lines|\n build_text_fil...
[ { "docid": "049f66ab305eb22fd82f6e1b67f178e1", "score": "0.70016056", "text": "def build_information_file\n dir = FilePath.new(@build_dir, \"cruisecontrol_integrated_xml_files\").ensure_directory\n FilePath.new(dir, \"build-information.xml\")\n end", "title": "" }, { "docid": "20ba436...
676de9102d188a35a702b62252106e5c
GET /v1/users Get all users
[ { "docid": "c3e1fca773e6a485626442c283934d14", "score": "0.0", "text": "def index\n paginate json: User.all\n end", "title": "" } ]
[ { "docid": "65844d565c3ece8e3601af3a0042efcb", "score": "0.8734174", "text": "def all_users\n response = get(\"#{@config['url']}/api/2.1/rest/users\", {accept: :json, :cookies => cookies})\n JSON.parse(response, :symbolize_names => true)[:users][:user]\n end", "title": "" }, { "...
5a637d2317209dace19127f2cfbcaadd
Returns the value of attribute controller_name. source://railties//lib/rails/generators/resource_helpers.rb29
[ { "docid": "6b43d893e237e16627dc8d5f95cd5512", "score": "0.7545374", "text": "def controller_name; end", "title": "" } ]
[ { "docid": "612b3c3c9d365e33e099137f1a12bc9a", "score": "0.82406884", "text": "def controller_name\n controller.name.underscore\n end", "title": "" }, { "docid": "48896cdf46da851cf7a9228537a59f3e", "score": "0.80772305", "text": "def controller_name\n return self.require...
357aaa4527425e1b9317e1b21dbb95e4
users can edit their own profile, administrators can edit any
[ { "docid": "13d9d82b05c59c1d7d22387e67a6f80a", "score": "0.0", "text": "def edit\n end", "title": "" } ]
[ { "docid": "e78c07d72c7873a233b328c5c98b7f3d", "score": "0.82423854", "text": "def edit\n authorize! :edit, @profile\n end", "title": "" }, { "docid": "8c861e3c58fb1090c71c35648f36609b", "score": "0.80111706", "text": "def edit\n if current_profile!=@profile\n redirect_to...
e6ab210934d90085b663d600f33a8cb5
Updates the ticket description based on row data
[ { "docid": "13d49050115ce799a91439f0468dde56", "score": "0.72926056", "text": "def update_description(description, row)\n header = \"\"\n if description[:ticket_status] != row['comparison']\n header = \"++ #{row['comparison']} Vulnerabilities ++\\n\"\n description[:ticket_status] = row['...
[ { "docid": "68122e7a01ca32a5ebedf41cbf3f3c4b", "score": "0.7279502", "text": "def update_description(description, row)\n description\n end", "title": "" }, { "docid": "cee255cddc49425c50f8427e20317389", "score": "0.6314858", "text": "def set_expense_entry_description\n data=pa...
add6f5bb29a1cdd7770d156e81ac6997
DELETE /tyys/1 DELETE /tyys/1.json
[ { "docid": "64710b15baae56c57d94d45c9aacbfff", "score": "0.7028917", "text": "def destroy\n @tyy.destroy\n respond_to do |format|\n format.html { redirect_to tyys_url, notice: 'Tyy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.72394544", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
ded1a62dee1b41c626cef9321660fa2c
Returns the value of attribute options. source://omniauth//lib/omniauth/strategy.rb116
[ { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.0", "text": "def options; end", "title": "" } ]
[ { "docid": "6180a8600482a935bbc6e265647e317e", "score": "0.6422466", "text": "def options\n @options[:options]\n end", "title": "" }, { "docid": "09452912065c312c093ed48b07e13e1d", "score": "0.6415564", "text": "def omniauth_options\n if auth_hash = request.env['omnia...
d685cf59b79cd86c3ce59535df750383
Check if activities endpoint has next page
[ { "docid": "3fd1be813bc11a5b5d84676578f7b3fc", "score": "0.0", "text": "def next_page(resp)\n offset = resp.headers['X-Tracker-Pagination-Offset'].to_i\n returned = resp.headers['X-Tracker-Pagination-Returned'].to_i\n total = resp.headers['X-Tracker-Pagination-Total'].to_i\n\n offset...
[ { "docid": "585c0077ef01c0773f6bb0bf672a0c75", "score": "0.74902797", "text": "def has_next? \n self.current_activity.lower_item != nil\n end", "title": "" }, { "docid": "dc3edc3b5dea55bd3d16edabfac71ad6", "score": "0.7478652", "text": "def next_page?\n client.last_respon...
df1516fa351cd10b978bc082bdf722c7
GET /powe_factor_nozzle_xes/1 GET /powe_factor_nozzle_xes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "8dbe372b42a20d2d959ae740044a6bcc", "score": "0.7721971", "text": "def index\n @powe_factor_nozzle_xes = PoweFactorNozzleX.all\n end", "title": "" }, { "docid": "e7a3a473075cda07b0c8c99d3fd5d463", "score": "0.73602486", "text": "def set_powe_factor_nozzle_x\n @pow...
e26c0aab21ecdf0482019aaa89b1f31d
La cantidad de materias de Ing. en Sistemas
[ { "docid": "1d08e40cedff1f8f95acd2768d41a403", "score": "0.0", "text": "def initialize(_aprobadas,_anotadas)\n @aprobadas = _aprobadas\n @anotadas = _anotadas\n end", "title": "" } ]
[ { "docid": "82c34bb1b436cbff0da43f64ac8a3f14", "score": "0.6982621", "text": "def cantidad_de_operaciones\n @memoria.contador\n end", "title": "" }, { "docid": "fb597a2f1f483b12e588315449b0d3b6", "score": "0.61461395", "text": "def mis_materias\r\n @vistas= current_user.course...
9e105ecfb12e2c6051a844492af01806
All record of what changed is gone by the time we get to the after_commit hooks. So we cannot use firm_id_changed? at that point. To work around this we flag any important changes here to be actioned later.
[ { "docid": "123972c0de05f64a6013613aa9243736", "score": "0.8699806", "text": "def flag_changes_for_after_commit\n @old_firm_id = firm_id_change.first if firm_id_changed?\n end", "title": "" } ]
[ { "docid": "e1b002869b4a100fadb4d9915b7dcd16", "score": "0.6236303", "text": "def _after_save(pk)\n # SEQUEL5: Remove\n if @was_new\n @was_new = nil\n pk ? _save_refresh : changed_columns.clear\n else\n @columns_updated = nil\n end\n @modifie...
49f6dc7a184f4a0921ec5976b51cb6e7
Return the current preferences as arguments to the given controller path
[ { "docid": "5abcf2b3893895537b6c709a59df847f", "score": "0.0", "text": "def as_path( controller, options = {}, delete = [] )\n path_params =\n params\n .merge( options )\n .inject(Hash.new) do |m,v|\n k = v[0].to_sym\n m[k] = v[1] unless delete.include?( k )\n ...
[ { "docid": "a6e1e541c77767aa0c09237f4273c103", "score": "0.6097965", "text": "def controller_args() = { options: options, args: args, command: calling_method }", "title": "" }, { "docid": "3febb43bbfb33eebe150610759596aa1", "score": "0.5929435", "text": "def preferences options={}\n\...
b6cd55f4166837499ba00005f9e3db18
initializes data used in _backplane.html.erb
[ { "docid": "03ccbbb1be247baa511a397414dcfc2a", "score": "0.0", "text": "def backplane\n @use_backplane = @@use_backplane && app.backplane_server && app.backplane_bus && app.backplane_version\n \n @serverBaseURL = \"https://#{app.backplane_server}/#{app.backplane_version}/\"\n\n @busName = ap...
[ { "docid": "5eb4f4d273c0f594f4f97460640e0072", "score": "0.6786237", "text": "def initialize\n super()\n init_data()\n end", "title": "" }, { "docid": "8c8a872a76e746b282b6333438bbcf97", "score": "0.66795194", "text": "def init_data\n end", "title": "" }, { ...
8a9b95550f10ddd2b109d432b3719313
get the handlers associated with a Sponsee
[ { "docid": "76f2eaae32e6192396bfedecbd741154", "score": "0.6790331", "text": "def handlers\n raise \"User #{id} is not a Sponsee\" unless role == 'sponsee'\n\n User.select('handlers.*')\n .joins('INNER JOIN handler_relations s on users.id = s.sponsee_id')\n .joins('IN...
[ { "docid": "f40b09534a74e38466be7e27cc615351", "score": "0.684248", "text": "def handlers\n @handler;\n end", "title": "" }, { "docid": "291f73c470facc2420a0d5104e90235f", "score": "0.66371363", "text": "def handlers\n @handlers ||= Set.new\n end", "title": "" }, ...
45586274544e863a5fc96ff1f6debc62
POST /photo_admins POST /photo_admins.xml
[ { "docid": "154115b56344d1999c9b0eb51e08450e", "score": "0.64496714", "text": "def create\n @photo_admin = PhotoAdmin.new(params[:photo_admin])\n\n respond_to do |format|\n if @photo_admin.save\n flash[:notice] = 'PhotoAdmin was successfully created.'\n format.html { redirect_to...
[ { "docid": "56557cf227ff4ac596493b4b8b9518f1", "score": "0.58335185", "text": "def create\n @admin_photo = Admin::Photo.new(admin_photo_params)\n\n respond_to do |format|\n if @admin_photo.save\n format.html { redirect_to @admin_photo, notice: 'Photo was successfully created.' }\n ...
2dd02c9934ced416c49785484231c717
GET /userroles/new GET /userroles/new.json
[ { "docid": "1c20339a83980ee63ab9fc6907d2b719", "score": "0.7157033", "text": "def new\r\n # logger.debug \"The value of logged user id is: #{session[:user_id]} \"\r\n # if session[:user_id].present?\r\n @userrole = Userrole.new\r\n @roles = Role.all\r\n @user = User.find(params[:id])\...
[ { "docid": "64bbfd429b3f62103804f9f963c66899", "score": "0.81578904", "text": "def new\n @roles_user = RolesUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @roles_user }\n end\n end", "title": "" }, { "docid": "6aa840ff076fffa...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "b4a457e69cd7daa3edcad2dcf5a70310", "score": "0.0", "text": "def update!(**args)\n @algorithm = args[:algorithm] if args.key?(:algorithm)\n @content_type = args[:content_type] if args.key?(:content_type)\n @data = args[:data] if args.key?(:data)\n @...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
08d523842e27b975658cae71a7741646
the str parameter being passed and capitalize the first letter of each word. Words will be separated by only one space.
[ { "docid": "c00367e38b468e752435f82a40b16eff", "score": "0.8440799", "text": "def LetterCapitalize(str)\n\twords = str.split(\" \")\n\tcaps = words.map { |word| word.capitalize }\n\twhole = caps.join(\" \")\n\nend", "title": "" } ]
[ { "docid": "dc2b69612da74e500c9cbaa55b36e5ea", "score": "0.85221416", "text": "def titleize(str)\n words = str.split\n for word in words \n word.capitalize!\n end\n words.join(' ')\nend", "title": "" }, { "docid": "e61b6e7b60c7d30da2cb38d2e9177f42", "score": "0.8486686", "text...
a11621930bef0c993ac9f90c95aea883
Determines if the published or draft content will be used
[ { "docid": "478bbb3125e01c8e593d54412a8c3b40", "score": "0.0", "text": "def public?\n !(development_environments + test_environments).include?(environment_name)\n end", "title": "" } ]
[ { "docid": "808e9f532d3e0b55043e488196ccb4ab", "score": "0.76254755", "text": "def published?\n !draft?\n end", "title": "" }, { "docid": "deab52a5ccd8d00d0a7e5c1f2e22265c", "score": "0.7598195", "text": "def can_be_edited?\n published? or unpublished?\n end", "title": ""...
8bb4adc7e5cc73bb801dc1bf342c3d40
Data to build search filter input for regions
[ { "docid": "1ae54036dc388ade39b22e48c5aff5e0", "score": "0.68315005", "text": "def filter_regions\n regions = if @country_list.present?\n filtered_region_list\n else\n regions_list\n end\n {\n 'name': 'regions[]',\n ...
[ { "docid": "5daefd33dd8d28cdc890a5b7ed9b8ec1", "score": "0.6631659", "text": "def filters\n return '' unless search_params[:filters].present?\n return '' if %w(country region).include?(search_params[:geo_type])\n _filters = sanitise_filters\n _filters.to_hash.symbolize_keys.slice(*Se...
486823409278744019cd7a745786875b
Return the number of blocks that will be yielded for each
[ { "docid": "fc47d7830f46f72af880115fe97b9498", "score": "0.7738673", "text": "def num_blocks\n n = @commits.size / @commits_per_block\n n += 1 if @yield_remainder && n * @commits_per_block < @commits.size\n n\n end", "title": "" } ]
[ { "docid": "5e15bdc5424f1660d99bb9d33aebd337", "score": "0.79609716", "text": "def num_yields; end", "title": "" }, { "docid": "668a125894129bd537860c6ca9d9d788", "score": "0.78224605", "text": "def block_count\n @block_count\n end", "title": "" }, { "docid": "668a125...
1e32c1ba81e6a40efb1c815c850e1058
GET /rmembers/new GET /rmembers/new.json
[ { "docid": "216864ba4ea5c45869ae77a2e7def8b1", "score": "0.79841137", "text": "def new\n @rmember = Rmember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rmember }\n end\n end", "title": "" } ]
[ { "docid": "fc333dbb8e2038ff87a4687429153baf", "score": "0.7534366", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "title": "" }, { "docid": "5232f1b33913af35a8d810ec471db8be", "score": "0.7516...
80ed5a89e4a6b90f893a5806af432cd8
was hoping this would work
[ { "docid": "4cf8483792fc934b82e33100e901fe5a", "score": "0.0", "text": "def\n to_s() run();\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.67426074", "text": "def desired; end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.6456597", "text": "def applied; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...
bd7aad88e59a7ae3642fa93e8f80bf2c
Removes the top node from the list and returns its value.
[ { "docid": "e6fb29e2a1315a186c313221fd5210bd", "score": "0.6559095", "text": "def pop\n return nil if empty?\n @anchor.prev_node.delete\n end", "title": "" } ]
[ { "docid": "bfe5bf75eb41e69392694f580cf57334", "score": "0.8131901", "text": "def pop\r\n return nil if @top_node.nil?\r\n temp_node = @top_node\r\n @top_node = temp_node.next_node\r\n return temp_node.value\r\n end", "title": "" }, { "docid": "0c0abd38ccbea8a70d8162a0295ddb0f",...
d3ed2ae392aa0a054dcfbe251feb937f
restores Kernelputs to its original definition
[ { "docid": "1e3b85a793d13af8742b8e0e3a3358ca", "score": "0.4966785", "text": "def puts_on\n Kernel.module_eval %q{\n def puts(*args)\n $stdout.puts(*args)\n end\n def print(*args)\n $stdout.print(*args)\n end\n }\n end", "title": "" } ]
[ { "docid": "f57db2001c0508cdc4332743d8b0d90b", "score": "0.58671755", "text": "def puts_off\n Kernel.module_eval %q{\n def puts(*args)\n end\n def print(*args)\n end\n }\n end", "title": "" }, { "docid": "f57db2001c0508cdc4332743d8b0d90b", "score": "0.58671755"...
0f13b392bd8b5b4c1c5f2ca2ed6d669c
A String contains the name of the receiver.
[ { "docid": "d7cf36cea086494a0bf04e46eedd0510", "score": "0.0", "text": "def name\n self.info(CL_PLATFORM_NAME)\n end", "title": "" } ]
[ { "docid": "73cf3587c4af98d5a59347086edf53b6", "score": "0.82251287", "text": "def receiver_name\n\t\tif self.receiver_type == \"User\"\n\t\t\tself.receiver.full_name\n\t\telse\n\t\t\tself.receiver.name\n\t\tend\n\tend", "title": "" }, { "docid": "831db87386b8d9f8550e9e529f55e579", "scor...
503176e86c3baa980434a30f0b8280c9
Create a specing task.
[ { "docid": "6a8c1c8ea5bc694beb32fc393618c4f2", "score": "0.0", "text": "def initialize(name=:spec)\n @name = name\n @libs = [File.expand_path(File.dirname(__FILE__) + '/../../../lib')]\n @pattern = nil\n @spec_files = nil\n @spec_opts = []\n @warning = false\n ...
[ { "docid": "3271710b6e1c637399d8286c1ef67cdb", "score": "0.7115193", "text": "def create_forked_task(index)\n RSpec::Core::RakeTask.new(\"spec#{index}\", :pattern, :opts) do |t, args|\n t.rspec_opts = args[:opts]\n t.pattern = args[:pattern]\n end\n end", "title": "" }, { "d...
a0b5183496ded204e0427bb537edfbcf
GET /addbalances/1 GET /addbalances/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "07c28c17c9abfd18685fe5687cff3684", "score": "0.73211646", "text": "def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end", "title": "" }, { "docid": "bd70c0506154380e8f11d0ec832115eb", "score": "0.7318468", "text": "def create\n ...
6b0f40f88dab72b362f63ede3ea7ba6d
Use the undefined method as a column
[ { "docid": "c16172d99aed811d2f30c18613e8a299", "score": "0.6231685", "text": "def method_missing(m, *args, &block)\n column_name = m.to_s.gsub(/\\=$/, '')\n raise ExtendModelAt::InvalidColumn, \"#{column_name} not exist\" if @static == true and not (@columns.try(:keys).try(:include?, column_na...
[ { "docid": "199bb0a7953658d518a37bf7219ede1f", "score": "0.73058945", "text": "def real_column; end", "title": "" }, { "docid": "2aeca32a1e38d512c7653231eee275f6", "score": "0.7084603", "text": "def column()\n #This is a stub, used for indexing\n end", "title": "" }, ...
ef7641b8cae1c64bd830ec8e3bf414c4
Fill in data in a table in a Word DOCX document, return edit session Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates. Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth mu...
[ { "docid": "f30861ac1ef3cfac7ccf9c095ee64e30", "score": "0.6566204", "text": "def transform_document_docx_table_fill_in_edit_session(request, opts = {})\n data, _status_code, _headers = transform_document_docx_table_fill_in_edit_session_with_http_info(request, opts)\n data\n end", "titl...
[ { "docid": "7012dc904e9f844793c30fd69cd1b628", "score": "0.6201348", "text": "def transform_document_docx_table_fill_in_edit_session_with_http_info(request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TransformDocumentApi.transform_document_do...
7b5ae6d5daf5f340c9e67a51449df6ed
Removes first part from message and returns it as a string.
[ { "docid": "d5ac20a84f8665fd07f2977bad5d1565", "score": "0.0", "text": "def pop\n # NOTE: can't use popstr because the data might be binary\n ptr = ffi_delegate.pop\n return nil if ptr.null?\n\n Frame.from_ffi_delegate(ptr).to_s\n end", "title": "" } ]
[ { "docid": "3caeaab6fc2fb2d71f5a33a76d3c126f", "score": "0.630289", "text": "def cleansed_message\n message.to_s.gsub(/(\\e(\\[([\\d;]*[mz]?))?)?/, \"\").strip\n end", "title": "" }, { "docid": "3caeaab6fc2fb2d71f5a33a76d3c126f", "score": "0.630289", "text": "def cleansed_mes...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5bff9bfce3403dcc3dc0ace6b0ac43bf", "score": "0.0", "text": "def teaching_activity_params\n params.require(:teaching_activity).permit(:activity)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981606", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6784227", "text": "def strong_params\n params.requi...
568d08aa89aa1ef4b07b6420f9ac0529
Search for any resource details
[ { "docid": "6a0f06c5725ac3b3490fcf3caf129f89", "score": "0.0", "text": "def search(q, opts = {})\n data, _status_code, _headers = search_with_http_info(q, opts)\n data\n end", "title": "" } ]
[ { "docid": "c851033d76115d5dd752406359e685e7", "score": "0.6448462", "text": "def ar_retrieve_resources\n run_callbacks :ar_retrieve_resources do\n if params[:_search]\n # Fulltext search\n\n @resources = ar_model.search(params[:_search])\n @resources_count = @resources.coun...
8a34318143b53cc3a51e3b0411672082
GET /contacttypes/new GET /contacttypes/new.json
[ { "docid": "a0342b2d8565b727bfedf89c80b3e494", "score": "0.683968", "text": "def new\n @contacttype = Contacttype.new\n @option_type = \"<option value='Phone'>Phone</option><option value='Email'>Email</option><option value='Address'>Address</option>\"\n respond_to do |format|\n format.html...
[ { "docid": "23db2f068b3adc93939820098a8812d4", "score": "0.82254606", "text": "def new\n @contact_type = ContactType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contact_type }\n end\n end", "title": "" }, { "docid": "a153b396a...
1c1cd34542ac7d35ad7aa275d80e52c8
GET /people/select Page for after registration that allows you to select yourself from a list of people yet to be assigned, or create a new one if you don't exist
[ { "docid": "eb079ebe8c280f441b9f9602d457e7cb", "score": "0.574786", "text": "def select\n @userless_projects=Project.with_userless_people\n\n #strip out project with no people with email addresses\n #TODO: can be made more efficient by putting into a direct query in Project.with_userless_people...
[ { "docid": "aaaa1542b65cc33ee63c880be9debb79", "score": "0.670613", "text": "def select\n @current_object = current_workspace\n if request.get?\n @assigned_contacts = @current_object.people.all(:select =>\"people.id, people.email\")\n condition = @assigned_contacts.empty? ? \"\" : \"peop...
6936893ef32eb1803ad001d10329fc3c
PROTECTED/PRIVATE METHODS def within(bounding_box) where("lat >= ? AND lat = ? ", bounding_box['sw']['lat'], bounding_box['ne']['lat'], bounding_box['ne']['lng'], bounding_box['sw']['lng']) end
[ { "docid": "ca3d3990234a240e90e18c5bbd0c2c02", "score": "0.0", "text": "def address_from_components\n [street, city, state, country].compact.join(', ')\n end", "title": "" } ]
[ { "docid": "2292e2db1f7cad60a59dac903a843fa3", "score": "0.81550497", "text": "def within_bounding_box(bounds)\n sw_lat, sw_lng, ne_lat, ne_lng = bounds.flatten if bounds\n if sw_lat && sw_lng && ne_lat && ne_lng\n where(\n Geocoder::Sql.within_bounding_box(sw_lat, sw_lng, ne_l...
332bb5dd8f4fc9740fa9e847ba27cc7a
DELETE /parada_empresas/1 DELETE /parada_empresas/1.json
[ { "docid": "105d4b119e8298e22e16e38cbfe29452", "score": "0.7420472", "text": "def destroy\n @parada_empresa.destroy\n respond_to do |format|\n format.html { redirect_to parada_empresas_url, notice: 'Parada empresa was successfully destroyed.' }\n format.json { head :no_content }\n end...
[ { "docid": "48d46ec9b1304913b24e340713b5279f", "score": "0.7585765", "text": "def destroy\n @emprestimo = Emprestimo.find(params[:id])\n @emprestimo.destroy\n\n respond_to do |format|\n format.html { redirect_to emprestimos_url }\n format.json { head :no_content }\n end\n end", ...
11f8e383c69e646a76096bdc5d78ce18
GET /box_records/new GET /box_records/new.json
[ { "docid": "73120ea8800bde293dfac531f4a44c22", "score": "0.7171597", "text": "def new\n current_time = Time.now.to_i \n @box_record = BoxRecord.where(\" box_id = ? and start_time < ? and end_time > ? \",params[:id],current_time,current_time).first\n @box_record = BoxRecord.new(box_id: params...
[ { "docid": "1cdc93ed63dd60a140ed447272f15435", "score": "0.73160213", "text": "def new\n @box = Box.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @box }\n end\n end", "title": "" }, { "docid": "bb368224e5f8b73a2eb2de5a6188c9a7", ...
bd7c6cb1e321cd33b2d0f6432c9b5511
used to be compatable with Rails/ActiveSupport
[ { "docid": "e3a54d305156f70be905f7307752f443", "score": "0.0", "text": "def blank?\n self.text.blank?\n end", "title": "" } ]
[ { "docid": "7db0727baf89eb76beac27c515d7fe32", "score": "0.61243117", "text": "def support; end", "title": "" }, { "docid": "32c55baa0bcb80dd8d34e2b7e18e114f", "score": "0.5987591", "text": "def support_type?; end", "title": "" }, { "docid": "feb51464e074644cba82a0f4d8e15...
50772260931c61d5dcbfb91a0408c314
This config needs to run earlier than others
[ { "docid": "806e6bd647aa26625adfadfd0e50dbde", "score": "0.0", "text": "def run_config\n path = \"#{Volt.root}/config/app.rb\"\n require(path) if File.exists?(path)\n end", "title": "" } ]
[ { "docid": "91cf292890466245c8704b97a7114439", "score": "0.70926124", "text": "def before_run\n fail 'please run `dw config` first' unless configured?\n end", "title": "" }, { "docid": "3c11981c6935dc30291d794127bbc4d3", "score": "0.70696485", "text": "def before_configur...
d3306002d594303aa1449b30d2771f12
GET /hives/new GET /hives/new.json
[ { "docid": "ba4ced16b136df7e4fc074c350e9f21f", "score": "0.0", "text": "def new\n if current_user.admin?\n @hive = Hive.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hive }\n end\n else\n redirect_to unauthorized_path\...
[ { "docid": "151c5bd9094bebca9662720294d25440", "score": "0.7303973", "text": "def new\n @when = When.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @when }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a0662a8f89e52713ce65e379e59fe309", "score": "0.0", "text": "def main_skill_params\n params.require(:main_skill).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
d0dca9396a25ee5333926c7a8312ff93
if the customer was updated, we have to create the payment method separately, because otherwise, we don't know which if the customer's payment methods to use
[ { "docid": "a1c255dc18c663f34c4c535d2a18d90b", "score": "0.6737253", "text": "def create_or_retrieve_payment_method_on_braintree(customer_result)\n if existing_customer.present?\n payment_method_result = ::Braintree::PaymentMethod.create(payment_method_options)\n break_if_reject...
[ { "docid": "766f57ec41e4f30fda321b40ac0dfc0d", "score": "0.71484864", "text": "def create_or_update_usa_epay_payment_method\n if usa_epay_payment_method_id.present? # update\n options = {\n method_id: self.usa_epay_payment_method_id,\n method: credit_card,\n billing_address:...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0baa8638f4d6abffd28df8fa9a0fc8c8", "score": "0.0", "text": "def set_tracker\n\t\t@tracker = Tracker.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...
33b4727313643e168897e12c0b35ad70
Generate a token names table that maps token type to a printable name: either the label like INT or the literal like "begin".
[ { "docid": "f16c95e79eab2c71a0d5279519b05884", "score": "0.7776103", "text": "def gen_token_type_names(code)\n t = Label::MIN_TOKEN_TYPE\n while t <= @grammar.get_max_token_type\n token_name = @grammar.get_token_display_name(t)\n if (!(token_name).nil?)\n token_name = RJ...
[ { "docid": "0cfafda62553b0bb1263b02e6541fff0", "score": "0.67230755", "text": "def gen_token_type_constants(code)\n # make constants for the token types\n token_ids = @grammar.get_token_ids.iterator\n while (token_ids.has_next)\n token_id = token_ids.next_\n token_type = @gr...
a302a9020c91fa68ac74ca2cf1e263d6
Set up the prompt.
[ { "docid": "3d3dc783f43c5b55d3b92d73002a3635", "score": "0.7473099", "text": "def set_prompt(prompt)\r\n @options[:base_prompt] = Prompt.new(prompt)\r\n @options[:scroll_prompt] = Prompt.new(@options[:alt_prompt] || prompt)\r\n\r\n verify_prompt(@options[:base_prompt])\r\n verify_p...
[ { "docid": "8256f5746026bedb998f83b1ed83314a", "score": "0.81716913", "text": "def setup_prompt #:doc:\r\n wait_for_prompt 30, 30, true\r\n end", "title": "" }, { "docid": "782072d33ac99cf4c9fb9eff138b6982", "score": "0.80545896", "text": "def setup_prompt #:nodoc:\n com...
dfad1dda0cd5fee0e45ab77f56942353
Determine whether the detail record is NSAonly.
[ { "docid": "5da7ba23de1cca939f5a33f9c63f8bc1", "score": "0.72629076", "text": "def nsa_only?(detail)\n\t\t\treturn true if detail.mail_class == 'MT' #Metro Post is NSA only.\n\t\t\treturn true if ['B4','B5','B6','B7','B8','B9','O5','O6','O7','O8','IA','IB','IC'].include?(detail.rate_indicator)\n #N...
[ { "docid": "f3e6791f8e8d8d767c6d6827c87e468b", "score": "0.635893", "text": "def aleph_record?\n if @record.eds_accession_number.present? &&\n @record.eds_accession_number.start_with?('mit.')\n true\n else\n false\n end\n end", "title": "" }, { "docid": "8101643d385...
41697d71293aef9f4892f07c9b0c5aff
Returns the number of pendings this TestResult has recorded.
[ { "docid": "41f8110d54a4c9a3cfc0c483095d84e4", "score": "0.6937733", "text": "def pending_count\n @pendings.size\n end", "title": "" } ]
[ { "docid": "cc36abf3929fd27ebc934534cbf14a2b", "score": "0.6669276", "text": "def count_failing\n return self.failing_tests.size\n end", "title": "" }, { "docid": "0620dd6c1f73c20de91ff5611763c105", "score": "0.65973616", "text": "def skipped_record_count\n @skipped_record_inc...
c9692c07aeecd1cd2bdd635f92decf37
GET /price_options GET /price_options.xml
[ { "docid": "695d05371562755443a221bb15220a20", "score": "0.7364665", "text": "def index\n @price_options = PriceOption.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @price_options }\n end\n end", "title": "" } ]
[ { "docid": "beea0a90b5f499f9b0d1fbeec3209d64", "score": "0.7018491", "text": "def show\n @price_option = PriceOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @price_option }\n end\n end", "title": "" }, { "d...
9353b89b4cf9f3b74f38aaa3ca7ae529
Public: A version of `Dir.entries` that filters out `.` files and `~` swap files. path String directory path Returns an empty `Array` if the directory does not exist. source://sprockets//lib/sprockets/path_utils.rb56
[ { "docid": "78b8ea704333781e7709da5b8ac91c07", "score": "0.0", "text": "def entries(path); end", "title": "" } ]
[ { "docid": "0d916195805d7ea1b574aed5e88c4fe1", "score": "0.75566304", "text": "def entries(path)\n if File.directory?(path)\n entries = Dir.entries(path, encoding: Encoding.default_internal)\n entries.reject! { |entry|\n entry.start_with?(\".\".freeze) ||\n (entry....
5d827d6431c57cde22df0db7bcbbc7a6
O(n^2) start_2 = Time.now p second_anagram?("gizmo", "sally") p second_anagram?("elvis", "lives") p second_anagram?("asdfghjkl", "qwertyu") finish_2 = Time.now p "second_anagram" p diff_2 = finish_2 start_2 start_1 = Time.now p first_anagram?("gizmo", "sally") p first_anagram?("elvis", "lives") p first_anagram?("asdfgf...
[ { "docid": "892c6ff490b7d80e53350f8745ef8602", "score": "0.0", "text": "def third_anagram?(str1, str2)\n alpha = (\"a\"..\"z\").to_a\n str1_indices = str1.chars.map { |char| alpha.index(char) }\n str2_indices = str2.chars.map { |char| alpha.index(char) }\n str1_indices.sort == str2_indices.sort\nend...
[ { "docid": "b6d18c4085e2adb4cd0153a445c2ccb8", "score": "0.81670874", "text": "def first_anagram?(str_1, str_2) # O(n^3)\n arr = str_1.split(\"\") # 1\n arr = arr.permutation.to_a # n\n arr.map! { |word| word.join } # n\n arr.include?(str_2) # n\n # (0...
49757c3faaa74049f46309e89276b079
POST /uploads POST /uploads.json
[ { "docid": "10e4ba784818e373170208d244f3f2b5", "score": "0.0", "text": "def create\n\n p_attr = params[:photo]\n p_attr.permit!\n @photo = Photo.new(p_attr)\n\n respond_to do |format|\n if @photo.save\n #save new link between photo and post\n if (params[:post_id].length)\n...
[ { "docid": "21943825dd08d3c9a0ccc209b7419864", "score": "0.6966936", "text": "def create\n @upload = @user.uploads.build(upload_params)\n authorize @upload\n\n respond_to do |format|\n if @upload.save\n format.json { render json: @upload }\n format.html { redirect_to user_upl...
47ddfb416615fcc2d830347ed5e8faee
Delete Rma Status By Id
[ { "docid": "115c8b14c3559525b939922a5d183006", "score": "0.0", "text": "def procurement_rma_statuses_id_delete(id, opts = {})\n procurement_rma_statuses_id_delete_with_http_info(id, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "20d0dcf557fdbd935024aa5d939156e9", "score": "0.74117833", "text": "def delete_status index\n @status.delete index\n end", "title": "" }, { "docid": "220fa6a48fa2c87f22bb07c988990569", "score": "0.7392445", "text": "def delete_status(status_id)\n delete_request('/' ...
d2f3b6f28545f1ba64d5b6cd6de32c16
Check if a user has provided feedback for a given presentation
[ { "docid": "1573e49b0d2d42ead4eef3e2d7011cc3", "score": "0.82136554", "text": "def has_provided_feedback?(user, presentation)\n participation = Participation.where(user_id: user.id, presentation_id: presentation.id).first\n return unless participation.valid?\n participation.feedback_provided\n ...
[ { "docid": "1d5df40c8b6528dea3fc35ebc0dd2028", "score": "0.7303591", "text": "def feedback_can_be_given?\n !has_feedback? && !feedback_skipped?\n end", "title": "" }, { "docid": "1d5df40c8b6528dea3fc35ebc0dd2028", "score": "0.7303591", "text": "def feedback_can_be_given?\n !ha...