#NEWLINE# def create_keyspace( self , name , replication_strategy = SIMPLE_STRATEGY , strategy_options = None , durable_writes = True , **ks_kwargs ) : #NEWLINE# #INDENT# "\n        Creates a new keyspace.  Column families may be added to this keyspace\n        after it is created using :meth:`create_column_family()`.\n\n        `replication_strategy` determines how replicas are chosen for this keyspace.\n        The strategies that Cassandra provides by default\n        are available as :const:`SIMPLE_STRATEGY`, :const:`NETWORK_TOPOLOGY_STRATEGY`,\n        and :const:`OLD_NETWORK_TOPOLOGY_STRATEGY`.\n\n        `strategy_options` is a dictionary of strategy options. For\n        NetworkTopologyStrategy, the dictionary should look like\n        ``{'Datacenter1': '2', 'Datacenter2': '1'}``. This maps each\n        datacenter (as defined in a Cassandra property file) to a replica count.\n        For SimpleStrategy, you can specify the replication factor as follows:\n        ``{'replication_factor': '1'}``.\n\n        Example Usage:\n\n        .. code-block:: python\n\n            >>> from pycassa.system_manager import *\n            >>> sys = SystemManager('192.168.10.2:9160')\n            >>> # Create a SimpleStrategy keyspace\n            >>> sys.create_keyspace('SimpleKS', SIMPLE_STRATEGY, {'replication_factor': '1'})\n            >>> # Create a NetworkTopologyStrategy keyspace\n            >>> sys.create_keyspace('NTS_KS', NETWORK_TOPOLOGY_STRATEGY, {'DC1': '2', 'DC2': '1'})\n            >>> sys.close()\n\n        " #NEWLINE# if ( replication_strategy . find ( '.' ) == ( - 1 ) ) : #NEWLINE# #INDENT# strategy_class = ( 'org.apache.cassandra.locator.%s' % replication_strategy ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# strategy_class = replication_strategy #NEWLINE# #UNINDENT# ksdef = KsDef ( name , strategy_class = strategy_class , strategy_options = strategy_options , cf_defs = [ ] , durable_writes = durable_writes ) #NEWLINE# for ( k , v ) in ks_kwargs . iteritems ( ) : #NEWLINE# #INDENT# setattr ( ksdef , k , v ) #NEWLINE# #UNINDENT# self . _system_add_keyspace ( ksdef )