Parse XML with JMESPATH

import json
import xmltodict

# Convierto el XML en diccionario, puedo cambiar el prefijo para atributos y para los valores dentro del tag
# config_dict = xmltodict.parse(xml_config, attr_prefix='(ATR)',  cdata_key='___text')
config_dict = xmltodict.parse(xml_config)

# Reviso como quedo
log.info(json.dumps(config_dict, indent = 2))
    
# Aqui parseo el PATH que quiero siguiendo las reglas de JMESPATH
mos = jmespath.search("raml.cmData.managedObject[?\"@class\"=='LNMME']", config_dict)
log.info

Bitwise

//How do we define Bitwise Enums?
[Flags] enum DaysOfWeek {
  None = 0, Monday = 1, Tuesday = 2, Wednesday = 4, Thursday = 8, Friday = 16,
    Saturday = 32, Sunday = 64
};

//Combining Bitwise Enums
DaysOfWeek selectedDays = DaysOfWeek.Monday | DaysOfWeek.Wednesday | DaysOfWeek.Friday;

//Checking for Enum Values

Console.WriteLine("selected Days", selectedDays);

if ((selectedDays & DaysOfWeek.Monday) != 0) {
  Console.WriteLine("Monday is selected.");
}

selectedDays ^= DaysOfWeek.Wednesday;

Add One Row

/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @param {number} val
 * @param {number} depth
 * @return {TreeNode}
 */
var addOneRow = function(root, val, depth) {
    // If the depth is 1, create a new root node with the given value
    // and make the original tree as

Non_Member Full File One Per Month Segment

Segment Name: NM_Full_File_One_Per_Month_Seg
Scheduled List Name: Non Member

Legacy Full File One Per Month Segment

Segment Name: MP_Full_File_One_Per_Month_Seg
Scheduled List Name: Loyalty Legacy

Rewards Full File One Per Month Segment

Segment Name: LR_Full_File_One_Per_Month_Seg
Scheduled List Name: LR_Full_File_Coupon_One_Per_Month_List

Premium Full File One Per Month Segment

Segment Name: LP_Full_File_One_Per_Month_Seg
Scheduled List Name: LP_Full_File_One_Per_Month_Daily_List

Nice Names for IDs

<?php 
// wordpress function that removes spaces and characters and adds dashes
echo sanitize_title_with_dashes( get_the_title() ); 
?>

Full File One Per Month Segment

Segment Name: Full File One Per Month
Scheduled List Name: Full File One Per Month Daily Generated List

Full File One Per Week Segment

Segment Name: Full File One Per Week
Scheduled List Name: Full File One Per Week Daily Generated List

Wordpress connexion

https://pro.mapado.com/wp-admin/

id sur Bitwarden

Item Master - Stocked

SELECT
  RTRIM(dbo.dmprod.pr_codenum) AS pr_codenum,
  RTRIM(dbo.dmprod.pr_descrip) AS pr_descrip,
  RTRIM(dbo.dmunit.un_name) AS un_name,
  dbo.dmunit.un_factor
FROM
  dbo.dmprod
  INNER JOIN dbo.dmunit ON dbo.dmprod.pr_unid = dbo.dmunit.un_id
WHERE
  (dbo.dmprod.pr_active = 1)
  AND (dbo.dmprod.pr_stocked = 1)
  AND (
    LEFT(dbo.dmprod.pr_codenum, 1) IN ('1', '2', '3', '4', '5')
  )

Item Master - Screened

SELECT
  dbo.dmprod.pr_codenum AS PartNumber,
  dbo.dmprod.pr_descrip AS Description,
  dbo.dmpr2.p2_name AS Class,
  dbo.dmpr1.p1_name AS Protein,
  dbo.dmprod.pr_id,
  dbo.dmprod.pr_retail AS Retail,
  dbo.dmpr5.p5_name AS Brand,
  dbo.dmprod.pr_user1 AS Flavor,
  timerwinter.d2_value AS Offload_Min_Winter,
  timersummer.d2_value AS Offload_Min_Summer,
  dbo.dmpr3.p3_name AS Stage,
  dbo.dmunit.un_factor AS Unit,
  bagweight.d2_value AS OzWeight
FROM
  dbo.dmprod
  LEFT OUTER J

Issue Requirements

SELECT
  jo_jobnum,
  jo_planstart,
  linepart.pr_codenum AS jobpart,
  linepart.pr_descrip AS jobpartdesc,
  lj_planquant,
  bompart.pr_codenum AS bomlinepart,
  bompart.pr_descrip AS bomlinepartdesc,
  SUM(results.required) AS Required,
  issuequant.issue,
  deissuequant.deissue,
  iif(
    SUM(results.required) - (
      isnull(issuequant.issue, 0) - isnull(deissuequant.deissue, 0)
    ) < 0,
    0,
    SUM(results.required) - (
      isnull(issuequant.issue, 0) - isnull(deis

Issue Exceptions

SELECT
  issued.fi_postref,
  h.pr_codenum,
  h.pr_descrip,
  issued.fi_userlot,
  SUM(issued.fi_quant - ISNULL(deissued.deissue, 0)) AS netissued,
  issued.fi_lotdate,
  issued.fi_expires,
  goldenvalleysystem.dbo.dxuser.us_fname + ' ' + goldenvalleysystem.dbo.dxuser.us_lname AS [user]
FROM
  dbo.dtfifo AS issued
  INNER JOIN dbo.dxlog ON dbo.dxlog.lo_recid = issued.fi_id
  AND dbo.dxlog.lo_table = 'dtfifo'
  INNER JOIN goldenvalleysystem.dbo.dxuser ON goldenvalleysystem.dbo.dxuser

Angles aggregation

import numpy as np

## angle format: 0/360 to -180/180
def angles_format(angle_0_360:np.array)->np.array:
    return np.array([v-360 if v>=180 else v for v in angle_0_360])

## aggregation for angular data
def angles_agg(angle_0_360:np.array, func_agg) -> float:
    """
    Calculate wind direction average.
    angle_0_360 -- array of angles to be averaged.
    func_agg -- aggregation fucntion.
    return -- aggregated value.
    """
    # validation
    if len(angle_0_360) == 0: