open-index/open-npm huggingface dataset:
npm package: @socialgouv/letor-scores
Description: JavaScript port of https://github.com/ArmandGiraud/letor_scores
Latest version: 1.1.0

# letor-scores

[![Github Master CI Status](https://github.com/SocialGouv/letor-scores/workflows/CI/badge.svg?branch=master)](https://github.com/SocialGouv/letor-scores/actions/)
[![codecov](https://codecov.io/gh/SocialGouv/letor-scores/branch/master/graph/badge.svg)](https://codecov.io/gh/SocialGouv/letor-scores)
[![NPM version](http://img.shields.io/npm/v/@socialgouv/letor-scores.svg)](https://npmjs.org/package/@socialgouv/letor-scores)

JavaScript port of https://github.com/ArmandGiraud/letor_scores

## Usage

```js
const { mrr, dcg, precisionK, recall } = require("@socialgouv/letor-scores");

const predictions = ["a", "b", "c"];
const expected = ["b", "e"];
const expectedScoresDict = { b: 5, e: 1 };

console.log({
  mrr: mrr({
    predictions,
    expected
  }),
  dcg: dcg({
    predictions,
    expectedScores: expectedScoresDict,
    k
  }),
  precision: precisionK({
    predictions,
    expected,
    k
  }),
  recall: recall({
    predictions,
    expected,
    k
  })
});
```

## Dev

Install yarn : `npm i -g yarn`

Then launch tests with `yarn test`

```
 PASS  src/dcg.test.js
  ✓ emptyPrediction return 0 (5ms)
  ✓ badPrediction1 return 0 (1ms)
  ✓ more documents in predictions should not alter dcg
  ✓ better prediction should have higher score (1ms)
  ✓ higher k doesnt crash (1ms)
  ✓ ideal dcg is computed correctly: normalization makes effect
  ✓ dcg relative scores (1ms)
  ✓ dcg is not messed by additional results
  ✓ one good result on first place should be ideal (1ms)
  ✓ expectations are sorted
  ✓ float
  ✓ cdtn1

 PASS  src/mrr.test.js
  ✓ [1, 2, 3], [1] == 1 (6ms)
  ✓ [1, 2, 3], [4] == 0.01
  ✓ [1, 2, 3], [2] == 1/2 (1ms)
  ✓ [1, 2, 3], [1, 2] == 1
  ✓ [1, 2, 3], [4, 5, 6] == 0.01
  ✓ emptyPrediction
  ✓ badPrediction1 (1ms)
  ✓ moreDocuments should not alter mrr
  ✓ goodRanking vs bad ranking (1ms)
  ✓ higher k doesnt crash (1ms)

 PASS  src/recall.test.js
  ✓ emptyPrediction (5ms)
  ✓ badPrediction1 (1ms)
  ✓ more documents than k should have identical results (1ms)
  ✓ goodRanking vs badRanking1
  ✓ higher k doesnt crash (1ms)
  ✓ perfect results
  ✓ perfect precision
  ✓ [1, 2, 3], [1], k = 1) == 1 (1ms)
  ✓ [1, 2, 3], [9], k = 1) == 0
  ✓ [1, 2, 3], [1], k = 3) == 1
  ✓ [1, 2, 3], [3, 1], k = 1) == 1/2 (1ms)
  ✓ [1, 2, 3], [3, 1, 4], k = 2) == 1/3

 PASS  src/precisionK.test.js
  ✓ emptyPrediction (5ms)
  ✓ badPrediction1
  ✓ more predictions should not change results (1ms)
  ✓ goodRanking vs badRanking (1ms)
  ✓ higher k doesnt crash
  ✓ higher k doesnt crash
  ✓ perfect results (1ms)
  ✓ perfect precision
  ✓ [1, 2, 3], [1], 3) == 1/3
  ✓ [1, 2, 3], [1, 2], 3) == 2/3
  ✓ [1, 2, 3], [1, 2, 3], 3) == 1.0 (1ms)
  ✓ [1, 2, 3], [1, 2, 3, 1], 3) == 1.0
  ✓ [1, 2, 3], [4], 3) == 0.0
  ✓ [1, 2, 3], [4, 5, 6], 3) == 0.0
  ✓ empty predictions return 0

Test Suites: 4 passed, 4 total
Tests:       49 passed, 49 total
Snapshots:   0 total
Time:        1.743s
```
npm package: @socialgouv/matomo-metabase
Description: Extract visitor events from Matomo API and push to Postgres
Latest version: 1.1.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @socialgouv/matomo-metabase

Extract matomo data and push to Postgres

Use Matomo [`Live.getLastVisitsDetails`](https://developer.matomo.org/api-reference/reporting-api) API to extract visits informations.

## Usage

```sh
npx @socialgouv/matomo-metabase [YYYY-MM-DD]
```

### Environment variables Deployment

| name              | value                                          |
| ----------------- | ---------------------------------------------- |
| MATOMO_KEY\*      | matomo api token                               |
| MATOMO_SITE\*     | matomo site id                                 |
| MATOMO_URL\*      | matomo url                                     |
| PGDATABASE\*      | Postgres connection string                     |
| DESTINATION_TABLE | `matomo`                                       |
| STARTDATE         | default to today()                             |
| RESULTPERPAGE     | matomo pagination : `100`                      |
| OFFSET            | default days to check in the past; default = 3 |

## Dev

```sh
docker-compose up
export MATOMO_URL=
export MATOMO_SITE=
export MATOMO_KEY=
export DESTINATION_TABLE=
export STARTDATE=
export OFFSET=
export PGDATABASE=postgres://postgres:postgres@127.0.0.1:5455/postgres
yarn start
```

Use `yarn test -u` to update the snapshots
npm package: @socialgouv/nos1000jours-lib
Description: Librairie partagé pour l'application Nos 1000 premiers jours
Author: Incubateur des Ministères Sociaux
Latest version: 1.7.1

# Nos 1000 jours Lib package
Cette librairie est utilisée pour regrouper le code métier du projet 1000 jours.

Elle est utilisée par :
- l'application mobile 
- le site web pro
- le widget

## Importer et utiliser la lib 
```
yarn add @socialgouv/nos1000jours-lib
```

Exemple : 
```
import { AROUNDME_FILTER_DATA } from "@socialgouv/nos1000jours-lib";

...

const [getFilterData] = useLazyQuery(gql(AROUNDME_FILTER_DATA), {
    fetchPolicy: FetchPoliciesConstants.NO_CACHE,
    onCompleted: (data) => {
      // ...
    },
  });

...
```

## Pour lancer la lib et la tester en local
```
yarn install
yarn build

```

Tester la lib en local :  `package.json` du projet utilisant la lib
```
"@socialgouv/nos1000jours-lib": "../nos1000jours-lib"
```
npm package: @socialgouv/parse-manifests
Description: Parse and summarize a bunch of kubernetes YAML manifests
Latest version: 1.16.4

# @socialgouv/parse-manifests

Extract basic informations from a bunch of kubernetes manifests

## Usage

### Bin

```sh
cat manifests.yml | parse-manifests [--json|markdown|text]
```

### Module

```js
import fs from "fs";
import parseManifests from "@socialgouv/parse-manifests";

const manifests = fs.readFileSync("./sample.yml").toString();

console.log(parseManifests(manifests));

/** outputs
{
  manifests: [
    {
      kind: 'Deployment',
      name: 'backend',
      namespace: 'app-preprod'
    },
    {
      kind: 'SealedSecret',
      name: 'backend-sealed-secret',
      namespace: 'app-preprod'
    },
    { kind: 'Service', name: 'backend', namespace: 'app-preprod' },
    { kind: 'Ingress', name: 'backend', namespace: 'app-preprod' },
    {
      kind: 'SealedSecret',
      name: 'azure-app-volume',
      namespace: 'app-preprod'
    },
    {
      kind: 'PersistentVolumeClaim',
      name: 'uploads',
      namespace: 'app-preprod'
    },
    {
      kind: 'PersistentVolume',
      name: 'app-uploads',
      namespace: 'app-preprod'
    },
    {
      kind: 'Deployment',
      name: 'version1',
      namespace: 'app-preprod'
    },
    { kind: 'Service', name: 'version1', namespace: 'app-preprod' },
    { kind: 'Ingress', name: 'version1', namespace: 'app-preprod' },
    {
      kind: 'Deployment',
      name: 'version2',
      namespace: 'app-preprod'
    },
    {
      kind: 'Service',
      name: 'version2',
      namespace: 'app-preprod'
    },
    {
      kind: 'Ingress',
      name: 'version2',
      namespace: 'app-preprod'
    },
    {
      kind: 'SealedSecret',
      name: 'azure-pg-user',
      namespace: 'app-preprod'
    }
  ],
  hosts: [
    'backend-app-preprod.dev.company.com',
    'version1-app-preprod.dev.company.com',
    'version2-app-preprod.dev.company.com'
  ],
  images: [
    'ghcr.io/company/app/backend:1.1.0-alpha.6',
    'ghcr.io/company/docker/wait-for-postgres:6.38.3',
    'ghcr.io/company/app/frontend-version1:1.1.0-alpha.6',
    'ghcr.io/company/app/frontend-version2:1.1.0-alpha.6'
  ],
  namespace: 'app-preprod',
  'app.github.com/run': '1127909139',
  'app.github.com/repo': 'company/app'
}

```

---

#### example markdown output with [sample.yml](./sample.yml) :

---

<details>
  <summary>Ingresses</summary>

 - 🚀 [backend-app-preprod.dev.company.com](https://backend-app-preprod.dev.company.com)
 - 🚀 [version1-app-preprod.dev.company.com](https://version1-app-preprod.dev.company.com)
 - 🚀 [version2-app-preprod.dev.company.com](https://version2-app-preprod.dev.company.com)

</details>

<details>
  <summary>Docker images</summary>

 - 📦 docker pull ghcr.io/company/app/backend:1.1.0-alpha.6
 - 📦 docker pull ghcr.io/company/docker/wait-for-postgres:6.38.3
 - 📦 docker pull ghcr.io/company/app/frontend-version1:1.1.0-alpha.6
 - 📦 docker pull ghcr.io/company/app/frontend-version2:1.1.0-alpha.6

</details>
npm package: @socialgouv/react-departements
Description: Une carte de France où certains departements peuvent être colorés.
Latest version: 3.0.0

<h1 align="center">
  <img src="https://github.com/SocialGouv/react-departements/raw/master/demo.png" width="250"/>
  <p align="center">React Departements</p>
</h1>
<h3 align="center">
  🧹Une carte de France où certains departements peuvent être colorés.✨
</h3>

<p align="center">
  <a href="https://gitlab.factory.social.gouv.fr/SocialGouv/react-departements/pipelines"><img src="https://gitlab.factory.social.gouv.fr/SocialGouv/react-departements/badges/master/pipeline.svg" alt="Gitlab Master Build Status"></a>
  <a href="https://travis-ci.com/SocialGouv/react-departements"><img src="https://travis-ci.com/SocialGouv/react-departements.svg?branch=master" alt="Travis Build Status"></a>
  <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" alt="License: Apache-2.0"></a>
  <a href="https://www.npmjs.com/package/@socialgouv/react-departements"><img src="https://img.shields.io/npm/v/@socialgouv/react-departements.svg" alt="Npm version"></a> 
  <br>
  <a href="https://www.npmjs.com/package/@socialgouv/react-departements"><img src="https://nodei.co/npm/@socialgouv/react-departements.png?downloads=true&downloadRank=true&stars=true" alt="Npm banner"></a> 
</p>

<br>
<br>
<br>
<br>

## Installation

```sh
$ npm install @socialgouv/react-departements
# or
$ yarn add @socialgouv/react-departements

# `react@16+` and `prop-types@15+` must be installed
$ yarn add react prop-types
```

## Usage

```js
import France from "react-departements";

<France departements={[75, 89, 21, 33, 47, 74, "2a", 976]} />;
```

See [example/src](./example/src).

## Props

| Prop           | type   | usage                                | default |
| -------------- | ------ | ------------------------------------ | ------- |
| color          | string | couleur par défaut d'un département  | #74B4FF |
| highlightColor | string | couleur du highlight                 | #b3ff75 |
| departements   | array  | liste des départements à highlighter | []      |

## Source

Le fond de carte est [issu de wikimedia et distribué sous licence Creative Commons Attribution-Share Alike](https://commons.wikimedia.org/wiki/File:Communes_france-fr.svg)

## Release policy

### Auto

Trigger a custom build on [Travis](https://travis-ci.com/SocialGouv/react-departements) (in the "More options" right menu) on the `master` branch with a custom config:

```yml
env:
  global:
    - RELEASE=true
```
npm package: @socialgouv/react-k8s-viewer
Description: Render diagrams from your kubernetes manifests
Latest version: 1.1.8

# @socialgouv/react-k8s-viewer

Render diagrams from your kubernetes manifests.

Use [kubernetes-models-ts](https://github.com/tommy351/kubernetes-models-ts), [react-flow](https://reactflow.dev/) and [dagre](https://github.com/dagrejs/dagre) for layouting.

See demo : https://socialgouv.github.io/react-k8s-viewer

![](./demo.png)

## Usage

`K8sViewer` expect a list of `Manifest` or a `ManifestList` as JSON

```js
import { K8sViewer } from "@socialgouv/react-k8s-viewer";

import manifests from "./manifests.json";

const App = () => (
  <div style={{ width: 1000, height: 400 }}>
    <K8sViewer manifests={manifests} />
  </div>
);
```

To extract the manifests from some namespace:

```sh
kubectl --namespace some-app get deploy,ing,service,secret,sealedsecret,configmap -ojson > manifests.json
```

## Todo:

- handle multiple namespaces