Ensure the key is an underscored Symbol.

 Examples:

     'ApplyBuyerProtection' -> :apply_buyer_protection
     'PayPalEmailAddress'   -> :paypal_email_address
     'SoldOffeBay'          -> :sold_off_ebay

 @return [Symbol] the reformatted key.
165428
def format_key(key)
      key = key.to_s
      key = key.gsub('PayPal', 'Paypal')
      key = key.gsub('eBay',   'Ebay')
      key = key.gsub('EBay',   'Ebay')
      key.underscore.to_sym
    end
592797
def symbolize(allowed_keys: nil, allowed_vals: nil)
      keys = allowed_keys || self.class.allowed[:keys]
      vals = allowed_vals || self.class.allowed[:vals]

      each_with_object({}) do |(k, v), h|
        k = k.to_sym unless !k.respond_to?(:to_sym) || keys.include?(k.class)
        v = v.to_sym unless !v.respond_to?(:to_sym) || vals.include?(v.class)

        h[k] = !v.respond_to?(:symbolize) ? v : v.symbolize({
          :allowed_keys => allowed_keys,
          :allowed_vals => allowed_vals
        })
      end
    end
797543
def check_key(key, allowed):
    

    if key in allowed:
        return True

    for pattern in allowed:
        if fnmatch(key, pattern):
            return True

    return False
720001
def check_client_key(self, client_key):
        
        lower, upper = self.client_key_length
        return (set(client_key) <= self.safe_characters and
                lower <= len(client_key) <= upper)
604413
def _FormatPropertyName(self, property_name):
    
    # TODO: Add Unicode support.
    fix_key = re.sub(r'(.)([A-Z][a-z]+)', r'\1_\2', property_name)
    return re.sub(r'([a-z0-9])([A-Z])', r'\1_\2', fix_key).lower()
936166
def check_key!(key)
      return if key.is_a?(String) || key.is_a?(Symbol)
      raise TypeError, 'key must be a String or Symbol'
    end
1312099
def get_key_signature(key='C'):
    
    if not is_valid_key(key):
        raise NoteFormatError("unrecognized format for key '%s'" % key)

    for couple in keys:
        if key in couple:
            accidentals = keys.index(couple) - 7
            return accidentals
753777
def make_key class_name
      name = class_name.to_s.pluralize.gsub(/::/, '__').underscore
      only_last_part_plural(name).to_sym
    end
859241
def _real_key(self, key):
        
        if key is not None:
            try:
                return key.lower()
            except AttributeError:
                raise TypeError(
                    _format("NocaseDict key {0!A} must be a string, "
                            "but is {1}", key, type(key)))

        if self.allow_unnamed_keys:
            return None

        raise TypeError(
            _format("NocaseDict key None (unnamed key) is not "
                    "allowed for this object"))
679589
def sign(self, msg, key):
        

        if not isinstance(key, rsa.RSAPrivateKey):
            raise TypeError(
                "The key must be an instance of rsa.RSAPrivateKey")
        sig = key.sign(msg, self.padding, self.hash)
        return sig
320234
def to_underscore(value)
      underscore_value = value.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
      gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase
      return underscore_value
    end
1081329
def method_missing(method, *args, &block)
      # Check string keys first, original and downcase
      string_method = method.to_s

      if raw_hash.key?(string_method)
        return self[string_method]
      elsif raw_hash.key?(string_method.downcase)
        return self[string_method.downcase]
      end

      if string_method =~ /[A-Z+]/
        string_method = string_method.snakecase
      end

      index = string_method.downcase.to_sym
      # Check symbol key and return local hash entry.
      return self[index] if raw_hash.has_key?(index)
      # Then delegate to hash object.
      if raw_hash.respond_to?(method)
        return raw_hash.send(method, *args)
      end
      # Finally return nil.
      nil
    end
427206
def symbolize_keys(allowed: nil)
      allowed ||= self.class.allowed[:keys]
      each_with_object({}) do |(k, v), h|
        k = k.to_sym if k.respond_to?(:to_sym) && !allowed.include?(k.class)
        h[k] = !v.respond_to?(:symbolize_keys) ? v : v.symbolize_keys({
          :allowed => allowed
        })
      end
    end
905500
def camelcase_keys(options)
      options = options.clone
      
      if options[:destination_address]
        options[:destinationAddress] = options[:destination_address]
        options.delete(:destination_address)
      end
      
      if options[:notify_url]
        options[:notifyURL] = options[:notify_url]
        options.delete(:notify_url)
      end
      
      if options[:client_correlator]
        options[:clientCorrelator] = options[:client_correlator]
        options.delete(:client_correlator)
      end
      
      if options[:callback_data]
        options[:callbackData] = options[:callback_data]
        options.delete(:callback_data)
      end
      
      options
    end
459156
def _get_key_redis_key(bank, key):
    '''
    
    '''
    opts = _get_redis_keys_opts()
    return '{prefix}{separator}{bank}/{key}'.format(
        prefix=opts['key_prefix'],
        separator=opts['separator'],
        bank=bank,
        key=key
    )
227031
def static_record_lookup_key(value)#:nodoc:
      if value.is_a? self
        static_record_lookup_key(
          value.send(
            acts_as_static_record_options[:lookup_key] ||
            acts_as_static_record_options[:key] ||
            primary_key
          )
        )
      else
        value.to_s.gsub(' ', '_').gsub(/\W/, "").underscore
      end
    end
1043285
def symbolize v
      case
        when v.is_a?(Array)
          v.map {|i| symbolize(i)}
        when v.is_a?(Hash)
          result = {}
          v.each do |k, val|
            result[k.underscore().to_sym()] = symbolize(val)
          end
          result
        else
          v
      end
    end