TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #magiccircle

当前筛选 #magiccircle清除筛选
English Law Report

@enlawreport · Post #1758 · 01.11.2025 г., 07:26

💼 Advanced Legal Opinions — там, где тонкий риск превращается в юридическую броню. Вот 10 продвинутых промптов, которые используют юристы Magic Circle при подготовке комплексных legal opinions: от enforceability и санкций — до кросс-бордер и regulatory анализов. 🧩 PROMPT SET 1️⃣ Enforceability Opinion Draft an enforceability opinion for a loan agreement governed by English law and executed by a foreign borrower. Identify key issues (capacity, authority, governing law, jurisdiction, public policy) and formulate standard opinion wording. ⚖️Учимся писать главный раздел банковских opinion’ов. 2️⃣ Capacity and Authority Prepare the “corporate capacity and authority” section of a legal opinion for a foreign company entering an English law contract. Explain which documents and corporate actions you would verify. 📑Практика due diligence в юридическом мнении. 3️⃣ Regulatory Legal Opinion Draft the key parts of a regulatory legal opinion on whether a proposed financial product requires FCA authorisation under English law. Include relevant statutory references and FCA guidance. 🏛️Формат мнения для финансовых институтов. 4️⃣ Sanctions Exposure Draft a legal opinion analysing the impact of UK sanctions on the enforceability of a contract with a Russian counterparty. Identify how OFSI and UK sanctions regulations affect contractual obligations. 💣Тема с высоким риском и международным резонансом. 5️⃣ Cross-Border Recognition Write the “Recognition and Enforcement” section of a legal opinion for an English judgment to be enforced in another jurisdiction. Include analysis under the CJJA 1982 and relevant bilateral treaties. 🌍Отрабатываем мнение для трансграничных споров. 6️⃣ Conflict of Laws Draft an opinion analysing potential conflicts of law arising in a transaction involving English, French, and UAE parties. Identify governing law hierarchy and how Rome I applies. ⚙️Практикуем кросс-юрисдикционный анализ. 7️⃣ Material Adverse Effect Clause Prepare a legal opinion evaluating the enforceability and interpretation of a “Material Adverse Effect” clause under English law. Include relevant case law and contractual construction principles. 📊Для M&A и корпоративных сделок. 8️⃣ Force Majeure and Frustration Draft an analytical section comparing “force majeure” clauses and the doctrine of “frustration” under English law. Apply to a scenario involving supply chain disruption. ⚓Практический opinion для морских и коммерческих дел. 9️⃣ Legal Risk and Opinion Limitations Create a model paragraph explaining limitations of responsibility and legal uncertainty in a cross-border opinion. Include “reasoned opinion” vs “confirmation opinion” distinction. 🧩Профессиональное самострахование юриста. 🔟 Opinion Letter Formatting and Presentation Design a professional layout and heading system for a legal opinion letter issued by a Magic Circle firm. Include best practices for clarity, annex references, and signature blocks. 💼Финальный штрих — эстетика и структура документа. 🎓Хэштеги: #ELR#LegalOpinion#EnglishLaw#MagicCircle#LawyerSkills#AdvancedLaw