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
| try: | |
| int(value) | |
| except : | |
| value=0 | |
| finally: | |
| return value |
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 datetime import datetime | |
| date_time_obj = datetime.strptime(str(value),'%Y-%m-%d-%H-%M-%S') | |
| return date_time_obj.isoformat() | |
| # Openrefine supports ISO-8601 |
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 re | |
| x = re.search(r"\beva\b", value.lower()) | |
| if x: | |
| return "true" | |
| else: | |
| return "false" |
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 logging | |
| log = logging.getLogger('urllib3') | |
| log.setLevel(logging.DEBUG) | |
| stream = logging.StreamHandler() | |
| stream.setLevel(logging.DEBUG) | |
| log.addHandler(stream) | |
| #from http.client import HTTPConnection | |
| #HTTPConnection.debuglevel = 1 |
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
| query getAllEvents { | |
| listEvents{ | |
| items{ | |
| id | |
| name | |
| when | |
| } | |
| } | |
| } |
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 |
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
| 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
| # %% | |
| ! 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
| 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: |