Patches method_missing to include property accessors
 After the first method call, builds the accessor methods to get a speed
 boost
351384
def method_missing(name, *args)
      if !valid_accessor?(name)
        super
      elsif self.class.prop?(name.to_s)
        self.class.build_property_reader(name)
        send(name)
      else
        self.class.build_property_writer(name)
        send(name, args.first)
      end
    end
1373166
def method_missing(meth, *args)
      if include?(meth.to_s) then
        if args.empty? then
          create_getter meth
        else
          raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
        end
      elsif meth.to_s =~ /^(.+)\?$/ and include?(root_meth = $1) then
        if args.empty? then
          !!create_getter(root_meth) #TODO duplication of logic
        else
          raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
        end
      else
        super
      end
    end
977618
def add_method(info, target_cls, virtual=False, dont_replace=False):
    """"""

    # escape before prefixing, like pygobject
    name = escape_identifier(info.name)
    if virtual:
        name = "do_" + name
        attr = VirtualMethodAttribute(info, target_cls, name)
    else:
        attr = MethodAttribute(info, target_cls, name)

    if dont_replace and hasattr(target_cls, name):
        return

    setattr(target_cls, name, attr)
911343
def method_missing(method_symbol, *args, &block)
      key = method_symbol.to_s
      set = key.chomp!('=')
      if set
        self[key] = args.first
      elsif self.key?(key)
        self[key]
      else
        nil
      end
    end
561186
def add_methods(source_class, blacklist=()):
    

    def wrap(wrapped_fx):
        """Wrap a GAPIC method; preserve its name and docstring."""
        # If this is a static or class method, then we need to *not*
        # send self as the first argument.
        #
        # Similarly, for instance methods, we need to send self.api rather
        # than self, since that is where the actual methods were declared.
        instance_method = True

        # If this is a bound method it's a classmethod.
        self = getattr(wrapped_fx, "__self__", None)
        if issubclass(type(self), type):
            instance_method = False

        # Okay, we have figured out what kind of method this is; send
        # down the correct wrapper function.
        if instance_method:
            fx = lambda self, *a, **kw: wrapped_fx(self.api, *a, **kw)  # noqa
            return functools.wraps(wrapped_fx)(fx)

        fx = lambda *a, **kw: wrapped_fx(*a, **kw)  # noqa
        return staticmethod(functools.wraps(wrapped_fx)(fx))

    def actual_decorator(cls):
        # Reflectively iterate over most of the methods on the source class
        # (the GAPIC) and make wrapped versions available on this client.
        for name in dir(source_class):
            # Ignore all private and magic methods.
            if name.startswith("_"):
                continue

            # Ignore anything on our blacklist.
            if name in blacklist:
                continue

            # Retrieve the attribute, and ignore it if it is not callable.
            attr = getattr(source_class, name)
            if not callable(attr):
                continue

            # Add a wrapper method to this object.
            fx = wrap(getattr(source_class, name))
            setattr(cls, name, fx)

        # Return the augmented class.
        return cls

    # Simply return the actual decorator; this is returned from this method
    # and actually used to decorate the class.
    return actual_decorator
924015
def method_missing(method, *args, &block)
      instance_variable = instance_variablize(method)
      if respond_to_missing?(method) and instance_variable_defined?(instance_variable)
        self.class.send :attr_reader, method.to_sym
        instance_variable_get instance_variable
      else
        super
      end
    end
412742
def method_missing(sym, *args, &block)
      if self.internal_object.key?(sym.to_s)
        return self.internal_object[sym.to_s]
      end

      super
    end
806633
def method_missing(method, *args)
      request = RequestBuilder.new(@client)
      request.send(method, *args)
      request
    end
986774
def method_missing(*args)
      method = args[0].to_s
      case args.length
        when 2
          k, v = method.delete('=').to_sym, args[1]
          add_attribute k, v
      end
    end
114317
def method_missing(method_symbol, *method_args)
      if method_args.length > 0
        _set(method_symbol, method_args.first)
      end

      _get(method_symbol)
    end
284382
private void addHashCodeMethod() {
        Modifiers modifiers = Modifiers.PUBLIC.toSynchronized(true);
        MethodInfo mi = addMethodIfNotFinal(modifiers, "hashCode", TypeDesc.INT, null);

        if (mi == null) {
            return;
        }

        CodeBuilder b = new CodeBuilder(mi);

        boolean mixIn = false;
        for (StorableProperty property : mAllProperties.values()) {
            if (property.isDerived() || property.isJoin()) {
                continue;
            }
            TypeDesc fieldType = TypeDesc.forClass(property.getType());
            b.loadThis();
            b.loadField(property.getName(), fieldType);
            CodeBuilderUtil.addValueHashCodeCall(b, fieldType, true, mixIn);
            mixIn = true;
        }

        b.returnValue(TypeDesc.INT);
    }
225521
def _update_classmethod(self, oldcm, newcm):
        """"""
        # While we can't modify the classmethod object itself (it has no
        # mutable attributes), we *can* extract the underlying function
        # (by calling __get__(), which returns a method object) and update
        # it in-place.  We don't have the class available to pass to
        # __get__() but any object except None will do.
        self._update(None, None, oldcm.__get__(0), newcm.__get__(0))
61366
def edit(object, method_name)
      method = LookupPath.new(object).find(method_name.to_s) or
        raise NoMethodError, "no method `#{method_name}' in lookup path of #{object.class} instance"
      file, line = method.source_location
      if !file
        raise NoSourceLocationError, "no source location for #{method.owner}##{method.name}"
      elsif !File.exist?(file)
        raise NoSourceFileError, "cannot find source file: #{file}"
      else
        run(file, line)
      end
    end
597262
def method_missing(*args, &block)
      if Namespace.exists?(args.first)
        create_namespace(args.first)
      else
        call_method(args, &block)
      end
    end
1072451
def method_missing(method, *args)
      attr_name, suffix = method.to_s.scan(/([a-z0-9\_]+)(\?|\=)?$/i).first
      if suffix == ATTR_SETTER
        @_metaclass.send(:attr_accessor, attr_name)
        @_fields << attr_name.to_sym
        send(method, args.first)
      elsif attr_name && @_fields.include?(attr_name.to_sym)
        value = @attrs[attr_name.to_sym]
        case suffix
        when nil
          @_metaclass.send(:attr_accessor, attr_name)
          value
        when ATTR_PREDICATE then !!value
        end
      elsif suffix.nil? && SPECIAL_METHODS.include?(attr_name)
        instance_variable_get "@_#{attr_name}"
      elsif attr_name && !@_fields.include?(attr_name.to_sym)
        nil
      else
        super
      end
    end
575163
def define_accessors(field)
      # add the generated method
      self.generated_methods.module_eval do
        define_method(field) do
          @hash[field]
        end
        define_method("#{field}=") do |val|
          @hash[field] = val
        end
      end
    end
1251871
def apply(cls, fs):
        
        logger.debug(
            'Patching %s with %s.', fs.__class__.__name__, cls.__name__)
        fs._patch = cls
        for method_name in cls.patch_methods:
            # if fs hasn't method, raise AttributeError.
            origin = getattr(fs, method_name)
            method = getattr(cls, method_name)
            bound_method = method.__get__(fs, fs.__class__)
            setattr(fs, method_name, bound_method)
            setattr(fs, '_origin_' + method_name, origin)