<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calcRandomAnchors(args, inworld=True):
 """ Generates a list of random anchor points such that all circles will fit in the world, given the specified radius and worldsize. The number of anchors to generate is given by nPatches """

    anchors = []
    rng = (args.patchRadius, args.worldSize - args.patchRadius)
    if not inworld:
        rng = (0, args.worldSize)
    for i in range(args.nPatches):
        anchors.append((random.randrange(rng[0], rng[1]),
                        random.randrange(rng[0], rng[1])))

    return anchors