def create_policy(env, policy_type, policy_weights_file=None):
    """Create a policy.

    Create and return a policy.

    Args:
        env: gym.Environment. Gym environment.
        policy_type: policies.X. Policy type.
        policy_weights_file: str. Path to policy weights file.
    Return:
        policies.policy.
    """
    input_size = env.observation_space.shape[0]
    output_size = env.action_space.shape[0]
    action_low = env.action_space.low
    action_high = env.action_space.high
    policy = policy_type(input_size=input_size,
                         output_size=output_size,
                         action_high=action_high,
                         action_low=action_low)
    if policy_weights_file:
        policy.load_model(policy_weights_file)
    return policy