Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/utdata/rwd-r-leso
https://github.com/utdata/rwd-r-leso
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/utdata/rwd-r-leso
- Owner: utdata
- Created: 2020-11-01T02:00:46.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-25T18:46:56.000Z (6 months ago)
- Last Synced: 2024-07-25T21:47:28.215Z (6 months ago)
- Homepage: https://utdata.github.io/rwd-r-leso/
- Size: 73 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.html
Awesome Lists containing this project
README
readme
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}Defence Logistics Agency’s LESO program
The Defense Logistics Agency handles transfers of military surplus equipment to local law enforcement through the Law Enforcement Support Office (LESO) or LESO Program.
The data is updated quarterly and available for download on their LESO Public Information page.
Research about the data
Shipment values
In 2020 I asked the LESO office about the
acquisition_value
measure and found that it should be multiplied by thequantity
. The value is for single item.In addition, I asked about why there are different prices for the same item, and received the following response on 2020-12-14:
You are correct, the NSN is the National Stock Number. The primary reason a similar item has a different NSN designation is classification difference. In some cases, this could be difference in features, a frequently added component to the item, or variance in storage requirements such as the recent vaccinees that are being assigned NSNs for DLA’s major subordinate command, Troop Support.The cost information is provided by the customer when they turn the items into DLA Disposition Services. Acquisition values can vary for numerous reasons. One is the above, variance in classification differences such as modifications. As with most commodities, other factors could include variance in acquisition cost depending on the quantity procured and the year acquired.
Controlled vs non-controlled
The most recent year includes “non-controlled” items like blankets and boots, which are removed after a year. This inflates counts for the most recent year of data. During research in June 2022, I learned a number of things about this.
- non-controlled items are classified with a DEMIL CODE of “A” or the combination of DEMIL CODE “Q” and DEMIL IC of “6”.
- Some non-controlled items, like aircraft or items of high value, remain on the property list.
- There are also errors in the coding the item “RECON SCOUT XT,SPEC”. That will need to be fixed in 22Q2 data, but the DLA said it will be fixed in the future.
Here is my correspondence:
Question: Is there a way to tell from the data itself if the item is a controlled vs non-controlled item? I thought perhaps the DEMIL IC field with value of “A” might be non-controlled, but there seem to be items older than a year with that categorization that could be controlled and accurately remain, like RECON SCOUT XT,SPEC and AIRPLANE,CARGO-TRANSPORT.
Property with the DEMIL codes A and Q6 are considered non-controlled general property and fall off the LESO property books after one year. All other Demil codes are considered controlled items and stay on the LESO property book until returned to DLA for disposition/disposal.
Followup question: When you say Q6, do you mean a demil_code of “Q” combined with demil_ic of “6”. Would other property with demil_code “Q” but with a demil_ic of other numbers not be controlled? Second question: In the 22Q2 data, there are a number of items older than a year (n = 62) that are DEMIL CODE A and DEMIL IC 1 and they do seem like big items that might be “controlled”. Some examples: RECON SCOUT XT,SPEC (ALABAMA LAW ENFORCEMENT AGENCY, 2016-08-25) and AIRPLANE,CARGO-TRANSPORT (ARIZONA DEPT OF PUBLIC SAFETY, 2015-12-03, $17,000,000). I could see the argument for them to be controlled (though SEAT,AIRCRAFT might be a maybe on that).
The general rule is that property coded A and Q6 (6 being the integrity code) falls off the LESO property book after one year. However, there are some exceptions. For instance, aircraft are always controlled regardless of the demil code. Also, LESO has the discretion to keep items as controlled despite the demil code. This happens with some high value items. The RECON SCOUT XT, SPEC example you cited was actually initially coded incorrectly because the wrong NSN was used when it was coded as A. Once the correct NSN was verified with the manufacturer, is was renamed and recoded as D. The next quarterly report will reflect the new name and code.
Followup: Any chance there is a standard minimum value that represents “high value items” that you keep on the property book?
No, there isn’t a standard minimum value. It also may also depend on the type of property.
Related data
- Two values are considered Demil Codes which note how an item must be tracked or destroyed?
- There is also the
NSN
value, or National Stock Number.
- I downloaded a version of NSN in June 2022, saved as
data-raw/nsn-extract-3-17-21.xlsx
. It doesn’t have many matches.
Breaks down NSN values.Local agencies.
The list as of 22Q2. List worked out in analysis notebook. See notes there.
#NC
is not confirmed.aus_msa_list <- c(
"AUSTIN PARKS POLICE DEPT", #NC
"AUSTIN POLICE DEPT",
"BASTROP COUNTY SHERIFF'S OFFICE",
"BASTROP POLICE DEPT",
"BEE CAVE POLICE DEPT",
"BUDA POLICE DEPT",
"CALDWELL COUNTY SHERIFFS OFFICE",
"CEDAR PARK POLICE DEPT",
"ELGIN POLICE DEPARTMENT",
"FLORENCE POLICE DEPT", #NC
"GEORGETOWN POLICE DEPT",
"GRANGER POLICE DEPT", #NC
"HAYS CO CONSTABLE PRECINCT 4",
"HAYS COUNTY SHERIFFS OFFICE",
"HUTTO POLICE DEPT",
"JARRELL POLICE DEPT", #NC
"JONESTOWN POLICE DEPT", #NC
"KYLE POLICE DEPT",
"LAGO VISTA POLICE DEPT",
"LAKEWAY POLICE DEPT", #NC
"LEANDER POLICE DEPT",
"LIBERTY HILL POLICE DEPT", #NC
"LOCKHART POLICE DEPT",
"LULING POLICE DEPT",
"MANOR POLICE DEPT",
"MARTINDALE POLICE DEPT", #NC
"PFLUGERVILLE POLICE DEPT",
"ROLLINGWOOD POLICE DEPT", #NC
"SAN MARCOS POLICE DEPT",
"SMITHVILLE POLICE DEPT", #NC
"SUNSET VALLEY POLICE DEPT", #NC
"TAYLOR POLICE DEPT", #NC
"THRALL POLICE DEPT", #NC
# TEXAS STATE UNIVERSITY HI_ED
"TRAVIS COUNTY SHERIFFS OFFICE",
# TRAVIS CONSTABLE OFFICE,
# SOUTHWESTERN UNIVERSITY HI_ID
"WESTLAKE HILLS POLICE DEPT", #NC
"UNIV OF TEXAS SYSTEM POLICE HI_ED",
"WILLIAMSON COUNTY SHERIFF'S OFFICE"
)Notebooks
import-clean which loops through sheets in an Excel file.window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const isCodeAnnotation = (el) => {
for (const clz of el.classList) {
if (clz.startsWith('code-annotation-')) {
return true;
}
}
return false;
}
const clipboard = new window.ClipboardJS('.code-copy-button', {
text: function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
});
clipboard.on('success', function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
};
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
let selectedAnnoteEl;
const selectorForAnnotation = ( cell, annotation) => {
let cellAttr = 'data-code-cell="' + cell + '"';
let lineAttr = 'data-code-annotation="' + annotation + '"';
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
return selector;
}
const selectCodeLines = (annoteEl) => {
const doc = window.document;
const targetCell = annoteEl.getAttribute("data-target-cell");
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
const lineIds = lines.map((line) => {
return targetCell + "-" + line;
})
let top = null;
let height = null;
let parent = null;
if (lineIds.length > 0) {
//compute the position of the single el (top and bottom and make a div)
const el = window.document.getElementById(lineIds[0]);
top = el.offsetTop;
height = el.offsetHeight;
parent = el.parentElement.parentElement;
if (lineIds.length > 1) {
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
height = bottom - top;
}
if (top !== null && height !== null && parent !== null) {
// cook up a div (if necessary) and position it
let div = window.document.getElementById("code-annotation-line-highlight");
if (div === null) {
div = window.document.createElement("div");
div.setAttribute("id", "code-annotation-line-highlight");
div.style.position = 'absolute';
parent.appendChild(div);
}
div.style.top = top - 2 + "px";
div.style.height = height + 4 + "px";
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
if (gutterDiv === null) {
gutterDiv = window.document.createElement("div");
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
gutterDiv.style.position = 'absolute';
const codeCell = window.document.getElementById(targetCell);
const gutter = codeCell.querySelector('.code-annotation-gutter');
gutter.appendChild(gutterDiv);
}
gutterDiv.style.top = top - 2 + "px";
gutterDiv.style.height = height + 4 + "px";
}
selectedAnnoteEl = annoteEl;
}
};
const unselectCodeLines = () => {
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
elementsIds.forEach((elId) => {
const div = window.document.getElementById(elId);
if (div) {
div.remove();
}
});
selectedAnnoteEl = undefined;
};
// Attach click handler to the DT
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
for (const annoteDlNode of annoteDls) {
annoteDlNode.addEventListener('click', (event) => {
const clickedEl = event.target;
if (clickedEl !== selectedAnnoteEl) {
unselectCodeLines();
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
if (activeEl) {
activeEl.classList.remove('code-annotation-active');
}
selectCodeLines(clickedEl);
clickedEl.classList.add('code-annotation-active');
} else {
// Unselect the line
unselectCodeLines();
clickedEl.classList.remove('code-annotation-active');
}
});
}
const findCites = (el) => {
const parentEl = el.parentElement;
if (parentEl) {
const cites = parentEl.dataset.cites;
if (cites) {
return {
el,
cites: cites.split(' ')
};
} else {
return findCites(el.parentElement)
}
} else {
return undefined;
}
};
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const citeInfo = findCites(ref);
if (citeInfo) {
tippyHover(citeInfo.el, function() {
var popup = window.document.createElement('div');
citeInfo.cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
}
});