code: def create_keyspace(name, strategy_class, replication_factor, durable_writes=True, **replication_values):
      
      cluster = get_cluster()
  
      if name not in cluster.metadata.keyspaces:
          #try the 1.2 method
          replication_map = {
              'class': strategy_class,
              'replication_factor':replication_factor
          }
          replication_map.update(replication_values)
          if strategy_class.lower() != 'simplestrategy':
              # Although the Cassandra documentation states for `replication_factor`
              # that it is "Required if class is SimpleStrategy; otherwise,
              # not used." we get an error if it is present.
              replication_map.pop('replication_factor', None)
  
          query = """
          CREATE KEYSPACE {}
          WITH REPLICATION = {}
          """.format(name, json.dumps(replication_map).replace('"', "'"))
  
          if strategy_class != 'SimpleStrategy':
              query += " AND DURABLE_WRITES = {}".format('true' if durable_writes else 'false')
  
          execute(query)
docs: creates a keyspace
  
      :param name: name of keyspace to create
      :param strategy_class: keyspace replication strategy class
      :param replication_factor: keyspace replication factor
      :param durable_writes: 1.2 only, write log is bypassed if set to False
      :param **replication_values: 1.2 only, additional values to ad to the replication data map