import torch
import math


def generate_circle_samples(nb_samples, seed=42):
    """Generate data as asked in the project description.

    Args:
        nb_samples (int): How many samples are required
        seed (int, optional): Seed of random generator, for reproducibility. Defaults to 42.

    Returns:
        (samples, labels): (2D points in space, labels associated)
    """
    torch.random.manual_seed(seed)
    samples = torch.rand(size=(nb_samples, 2))
    center = torch.tensor([[0.5, 0.5]])

    dist = ((samples - center) ** 2).sum(dim=1) ** 0.5
    radius = 1 / ((2 * math.pi) ** 0.5)

    labels = torch.empty(nb_samples)
    labels[dist >= radius] = 0.0

    labels[dist < radius] = 1.0

    return samples, labels