Shulchan Arukh, Orach Chayim Siman 356
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
אמת המים העוברת בחצר עמוקה עשרה ורחבה ארבעה אין ממלאין ממנה בשבת אלא אם כן עשו לה מחיצה גבוה עשרה בכניסתה וביציאתה ויהיה טפח ממנה משוקע במים ואם היתה המחיצה כולה יורדת בתוך המים צריך שיהי' טפח ממנה יוצא למעל מן המים ואם התחילה לעשות המחיצ' אצל השפה מכל צד ולא חיבר אותם באמצע כדי שיהו המים נכנסים ויוצאים דרך שם אם אין ביניהם ג' טפחים שרי דאמרינן לבוד יש ביניהם ג' טפחים אסור: הגה ואם הנקבים שהאמה נכנס ויוצא בהם אינם רחבים ג' אפי' מחיצה אינו צריך (ב"י בשם ריטב"א):
If a stream of water passes through a yard and it is ten [tefachim] deep and four wide, we do not collect water from it on Shabbat unless a ten tefachim tall wall is made at its entrance and exit. At least one tefach of the wall must be underwater. If the whole wall is underwater, at least one tefach must be above the water. If one started to make a wall from the sides of the stream but did not connect the walls so that water can still flow, if there are three tefachim between the sides, this is allowed, and we consider it attached. If there are three tefachim between the sides, it is forbidden. RAMA: If the holes in which the stream enters and exit are not three wide, even a wall is unnecessary (Beit Yosef in the name of the Ritva).
חצר שנפרצה ולשון ים עובר על הפרצה אם אינו במלואו ואין בפרצה יותד מי' מותר למלאות ממנו ולהכניס לבית נפרצה במילואה או שיש בפרצה יותר מי' אם נשאר במקום שנפרץ גידודין גבוהים י' והמים מכסים אותו מותר למלאות ממנו בחצר אבל אסור להכניסן לבית אלא אם כן עשו מחיצה גבוה עשרה על המים לא נשאר גידודים אסור אפילו למלאות בחצר:
If a yard is breached, the sea enters through the breach, it is only partially breached, and the hole is wider than ten [tefachim], one is permitted to use the water and bring it into his house. If it is fully breached or the hole is wider than ten, if parts of the wall remain where it fell, and those parts are taller than ten but covered by water, he can use the water in the yard but it is forbidden to bring it into his house unless he made a ten-tefach tall wall. If no parts of the wall remain, it is even forbidden to use the water.