parameters: (self, c, typeid, *args, **kwds)
docstring: Create a new shared object and return its id
docstring_summary: Create a new shared object and return its id
docstring_tokens: Create a new shared object and return its id
function: def create(self, c, typeid, *args, **kwds):
          '''
          Create a new shared object and return its id
          '''
          self.mutex.acquire()
          try:
              callable, exposed, method_to_typeid, proxytype = \
                        self.registry[typeid]
  
              if callable is None:
                  assert len(args) == 1 and not kwds
                  obj = args[0]
              else:
                  obj = callable(*args, **kwds)
  
              if exposed is None:
                  exposed = public_methods(obj)
              if method_to_typeid is not None:
                  assert type(method_to_typeid) is dict
                  exposed = list(exposed) + list(method_to_typeid)
  
              ident = '%x' % id(obj)  # convert to string because xmlrpclib
                                      # only has 32 bit signed integers
              util.debug('%r callable returned object with id %r', typeid, ident)
  
              self.id_to_obj[ident] = (obj, set(exposed), method_to_typeid)
              if ident not in self.id_to_refcount:
                  self.id_to_refcount[ident] = 0
              # increment the reference count immediately, to avoid
              # this object being garbage collected before a Proxy
              # object for it can be created.  The caller of create()
              # is responsible for doing a decref once the Proxy object
              # has been created.
              self.incref(c, ident)
              return ident, tuple(exposed)
          finally:
              self.mutex.release()
function_tokens: def create ( self , c , typeid , * args , * * kwds ) : self . mutex . acquire ( ) try : callable , exposed , method_to_typeid , proxytype = self . registry [ typeid ] if callable is None : assert len ( args ) == 1 and not kwds obj = args [ 0 ] else : obj = callable ( * args , * * kwds ) if exposed is None : exposed = public_methods ( obj ) if method_to_typeid is not None : assert type ( method_to_typeid ) is dict exposed = list ( exposed ) + list ( method_to_typeid ) ident = '%x' % id ( obj ) # convert to string because xmlrpclib # only has 32 bit signed integers util . debug ( '%r callable returned object with id %r' , typeid , ident ) self . id_to_obj [ ident ] = ( obj , set ( exposed ) , method_to_typeid ) if ident not in self . id_to_refcount : self . id_to_refcount [ ident ] = 0 # increment the reference count immediately, to avoid # this object being garbage collected before a Proxy # object for it can be created.  The caller of create() # is responsible for doing a decref once the Proxy object # has been created. self . incref ( c , ident ) return ident , tuple ( exposed ) finally : self . mutex . release ( )