
import copyreg
import types

import cairo
from future import standard_library

standard_library.install_aliases()


# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
    func = getattr(clazz, funcname)
    return types.MethodType(func, self)


def reduce_instancemethod(im):
    return (
        construct_instancemethod,
        (im.__func__.__name__, im.__self__, im.__self__.__class__),
    )


copyreg.pickle(types.MethodType, reduce_instancemethod, construct_instancemethod)


# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
    return cairo.Matrix(*args)


def reduce_cairo_matrix(m):
    return construct_cairo_matrix, tuple(m)


copyreg.pickle(cairo.Matrix, reduce_cairo_matrix, construct_cairo_matrix)


import copyreg
import types

import cairo
from future import standard_library

standard_library.install_aliases()

# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
    return cairo.Matrix(*args)


def reduce_cairo_matrix(m):
    return construct_cairo_matrix, tuple(m)


copyreg.pickle(cairo.Matrix, reduce_cairo_matrix, construct_cairo_matrix)

Remove ununsed pickle code for instance methods
Remove ununsed pickle code for instance methods

  
  import copyreg
  import types
  
  import cairo
  from future import standard_library
  
  standard_library.install_aliases()
- 
- 
- # Allow instancemethod to be pickled:
- def construct_instancemethod(funcname, self, clazz):
-     func = getattr(clazz, funcname)
-     return types.MethodType(func, self)
- 
- 
- def reduce_instancemethod(im):
-     return (
-         construct_instancemethod,
-         (im.__func__.__name__, im.__self__, im.__self__.__class__),
-     )
- 
- 
- copyreg.pickle(types.MethodType, reduce_instancemethod, construct_instancemethod)
- 
  
  # Allow cairo.Matrix to be pickled:
  def construct_cairo_matrix(*args):
      return cairo.Matrix(*args)
  
  
  def reduce_cairo_matrix(m):
      return construct_cairo_matrix, tuple(m)
  
  
  copyreg.pickle(cairo.Matrix, reduce_cairo_matrix, construct_cairo_matrix)
  
Remove ununsed pickle code for instance methods
## Code Before:

import copyreg
import types

import cairo
from future import standard_library

standard_library.install_aliases()


# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
    func = getattr(clazz, funcname)
    return types.MethodType(func, self)


def reduce_instancemethod(im):
    return (
        construct_instancemethod,
        (im.__func__.__name__, im.__self__, im.__self__.__class__),
    )


copyreg.pickle(types.MethodType, reduce_instancemethod, construct_instancemethod)


# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
    return cairo.Matrix(*args)


def reduce_cairo_matrix(m):
    return construct_cairo_matrix, tuple(m)


copyreg.pickle(cairo.Matrix, reduce_cairo_matrix, construct_cairo_matrix)

## Instruction:
Remove ununsed pickle code for instance methods
## Code After:

import copyreg
import types

import cairo
from future import standard_library

standard_library.install_aliases()

# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
    return cairo.Matrix(*args)


def reduce_cairo_matrix(m):
    return construct_cairo_matrix, tuple(m)


copyreg.pickle(cairo.Matrix, reduce_cairo_matrix, construct_cairo_matrix)
