input: Write a function to create a basic blockchain in Python using only the core modules. The function should define a class called `Blockchain` with methods to initialize the blockchain, create new blocks, and hash blocks. The function should return an instance of the `Blockchain` class.
  
  
  import hashlib
  import json
  import time
  
  class Blockchain:
  
   def __init__(self):
   self.chain = []
   self.transactions = []
  
   def create_block(self, nonce, previous_hash):
   block = {
   'block_number': len(self.chain) + 1,
   'timestamp': self._current_timestamp(),
   'nonce': nonce,
   'previous_hash': previous_hash
   }
   self.chain.append(block)
   return block
  
   def _current_timestamp(self):
   return round(time.time() * 1000)
  
   def hash_block(self, block):
   string_object = json.dumps(block, sort_keys=True)
   block_string = string_object.encode()
   raw_hash = hashlib.sha256(block_string)
   hex_hash = raw_hash.hexdigest()
   return hex_hash
  
  def create_basic_blockchain():
   return Blockchain()
  
  assert isinstance(create_basic_blockchain(), Blockchain)
  
  blockchain_instance = create_basic_blockchain()
  assert len(blockchain_instance.chain) == 0
  
  block = blockchain_instance.create_block(nonce=12345, previous_hash='0')
  assert 'block_number' in block
  assert 'timestamp' in block
  assert 'nonce' in block
  assert 'previous_hash' in block
  
  assert blockchain_instance.hash_block(block) is not None
output: def create_basic_blockchain():
      class Blockchain:
          def __init__(self):
              self.chain = []
              self.transactions = []
  
          def create_block(self, nonce, previous_hash):
              block = {
                  'block_number': len(self.chain) + 1,
                  'timestamp': self._current_timestamp(),
                  'nonce': nonce,
                  'previous_hash': previous_hash
              }
              self.chain.append(block)
              return block
  
          def _current_timestamp(self):
              return round(time.time() * 1000)
  
          def hash_block(self, block):
              string_object = json.dumps(block, sort_keys=True)
              block_string = string_object.encode()
              raw_hash = hashlib.sha256(block_string)
              hex_hash = raw_hash.hexdigest()
              return hex_hash
  
      return Blockchain()