This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data "aws_iam_policy_document" "override" { | |
| statement { | |
| sid = "PublicReadForGetBucketObjects" | |
| principals { | |
| identifiers = ["*"] | |
| type = "AWS" | |
| } | |
| actions = ["s3:GetObject"] | |
| resources = [(terraform.workspace == "default") ? "arn:aws:s3:::${var.WEBSITE_BUCKET_NAME}/*" : "arn:aws:s3:::${terraform.workspace}-${var.WEBSITE_BUCKET_NAME}/*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://github.com/huggingface/notebooks/blob/main/sagemaker/11_deploy_model_from_hf_hub/deploy_transformer_model_from_hf_hub.ipynb | |
| pip install "sagemaker>=2.48.0" --upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # katana -list urls.txt -fs dn -j -o pages.json -silent | |
| import json | |
| import re | |
| import csv | |
| from concurrent.futures import ThreadPoolExecutor | |
| def find_email_in_json_line(json_line): | |
| # Parse the JSON line | |
| data = json.loads(json_line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| def transform_transcribe_output(json_output): | |
| transcriptions = [] | |
| output = json.loads(json_output) | |
| current_speaker_label = None | |
| for result in output['results']['items']: | |
| if 'speaker_label' in result: | |
| speaker_label = result['speaker_label'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import githubAppJwt from 'universal-github-app-jwt'; | |
| import { request } from "@octokit/request"; | |
| const APPID = "XXXXXX" | |
| // Replace with the path to your GitHub App's private key file | |
| const PRIVATE_KEY = `YYYYYYYYYYYYYYY`; | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rich.traceback import install | |
| install(show_locals=True) | |
| from rich.console import Console | |
| console = Console() | |
| cache = Cache('prompt_cache') | |
| try: | |
| CMD | |
| except Exception as e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # %% | |
| ! pip install selectolax requests | |
| # %% | |
| import csv | |
| with open("urls.csv") as f: | |
| reader = csv.reader(f) | |
| urls = list(reader) | |
| print(urls) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var synthetics = require('Synthetics'); | |
| const log = require('SyntheticsLogger'); | |
| const recordedScript = async function () { | |
| let page = await synthetics.getPage(); | |
| await synthetics.executeStep('Goto_0', async function() { | |
| await page.goto("https://mtchoun-mouh.mongulu.cm/", {waitUntil: 'domcontentloaded', timeout: 60000}) | |
| }) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| repos: | |
| - id: $REPO | |
| delete_source_branch_on_merge: true | |
| workflow: datadog | |
| apply_requirements: | |
| - approved | |
| - undiverged | |
| pre_workflow_hooks: | |
| - run: | | |
| /usr/local/bin/rebase $REPO/c/-/merge_requests/$PULL_NUM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| df = pf.read_json("chemin",lines=True) | |
| df.columns.values | |
| df["Useridentity"] # contient du json imbriqué | |
| df["Useridentity"].apply(df.Series) | |
| df["Useridentity"].apply(df.Series).columns.values # ce df a les jsons imbriqués comme colonnes | |
| fdf = df[df["Useridentity"].apply(df.Series)["arn"].isna()] # récupéer le df avec tous ceux qui sont Nan |