text:
# OProperty - getLinkedClass()

Retrieves the class linked to the property.

## Retrieving Linked Classes

Properties are generally created as fields in a database class, (that is, an [`OClass`](../OClass.md) instance).  Using this method, you can retrieve the database class to which the given [`OProperty`](../OProperty.md) instance is linked.

OrientDB retrieves this class in lazy mode, because while unmarshalling, the class could not be loaded.

### Syntax

```
OClass OProperty.getLinkedClass()
```

#### Return Value

This method returns the [`OClass`](../OClass.md) instance linked to the property.

repository: orientechnologies/orientdb-docs

gha_language: CSS

repo_name: orientechnologies/orientdb-docs


text:
# PACStack Tests

This repository contains automated tests used for functional and regression
testing of PACStack instrumented binaries.

## Usage

PACStack uses the ARMv8.3-a PAuth extension and supports only AArch64 targets
with PAuth extension (e.g., `-march=armv8.3-a`). Consequently the testcases in
this repository have to be (cross-)compiled for AArch64 using the PACStack LLVM
toolchain available at [https://github.com/pacstack/pacstack-llvm](https://github.com/pacstack/pacstack-llvm).

Note that since LLVM project does not have implementations of all the parts of
toolchain and library dependencies it must be combined with a GCC cross compile
toolchain to provide missing components. The instructions here assume that the
Linaro toolchain (available at [https://www.linaro.org/downloads/](https://www.linaro.org/downloads/)) is installed
on host system.

Test binaries can be use executed using either ARM's [Armv8-A Architecture Fixed
Virtual Platform (FVP)](https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms) simulation models, or the [QEMU](https://www.qemu.org/) machine emulator version
4.0 or newer. The instructions here assume QEMU and that binary formats for the
Aarch64 binaries have been registered with Linux so that it will be possible to
run foreign binaries directly. On Ubuntu and other Debian-based distributions
this can be achieved by installing the `qemu-user-static` deb package.

The tests can be built using the PACStack LLVM & Linaro toolchain and ran using QEMU
as follows:

$ git clone https://github.com/pointer-authentication/pacstack-tests
$ cd pacstack-tests
$ ./autogen.sh

$ ./configure --host=aarch64-unknown-linux-gnu \
    CC=/path/to/pacstack/llvm/toolchain/bin/clang \
    LDSHARED=/path/to/pacstack/llvm/toolchain/bin/clang \
    CFLAGS="--target=aarch64-linux-gnu --sysroot=/path/to/linaro/sysroot --gcc-toolchain=/path/to/linaro/gcc" \
    LDFLAGS="-Wl,--dynamic-linker=/path/to/linaro/sysroot/lib/ld-linux-aarch64.so.1"

$ make check TESTS_ENVIRONMENT=LD_LIBRARY_PATH=/path/to/linaro/sysroot/lib;"

## Table of testcases

The following tests are currently implemented:

| Test | Description |
| --- | --- |
| `conftest` | Minimal _"Hello World"_ test for testing build configuration |
| `confirm_callback` | ConFIRM callback test |
| `confirm_convention` | ConFIRM C++ call convention test |
| `confirm_exception` | ConFIRM C++ exception handling test (`unmatched_pair` and `cppeh`) |
| `confirm_fptr` | ConFIRM function pointer test |
| `confirm_load_time_dynlnk` | ConFIRM load time dynamic linking test |
| `confirm_longjmp` | ConFIRM `setjmp` / `longjmp` test (from `unmatched_pair`) |
| `confirm_ret` | ConFIRM return branch test |
| `confirm_signal` | ConFIRM signal test |
| `confirm_switch` | ConFIRM switch case test |
| `confirm_tail_call` | ConFIRM tail call test |
| `confirm_vtable_call` | ConFIRM C++ vtable call test |

## Acknowledgements

Several tests included in this repository have been sourced from the [ConFIRM](https://github.com/SoftwareLanguagesSecurityLab/ConFIRM)
microbenchmarking suite for control-flow integrity relevance metrics originally
developed by the Software Languages Security Lab at the University of Texas at
Dallas. Licensed under the MIT license.

## License

> Copyright 2020 Aalto University Secure Systems Group
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

license: MIT

repository: pacstack/pacstack-tests

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: pacstack/pacstack-tests


text:
---
title: Enable cross-domain support | Migrate Target from at.js 2.x to Web SDK
description: Learn how to configure Adobe Target for cross-domain and mobile app to web browser scenarios using Experience Platform Web SDK.
exl-id: 6ec24ddc-8f6d-4331-a3ae-bd0f3a7d6e78
---
# Enable cross-domain visitor profiles

The Platform Web SDK supports visitor ID sharing capabilities that enable customers to deliver personalized experiences more accurately across your domains. This capability allows you to deliver consistent personalization across domains and enhances the accuracy of your visitor activity reporting, without relying on third-party cookies.

## Prerequisites

To use cross-domain ID sharing, you must use Platform Web SDK version 2.11.0 or later. This capability is also compatible with VisitorAPI.js version 1.7.0 or later.

Cross-domain ID sharing works by appending a special `adobe_mc` query string parameter to the URL of the destination domain. This parameter is used for specifying the visitor ID instead of generating a new ID or using an existing ID.

The destination domain must use either of these libraries for cross-domain ID sharing to process the `adobe_mc` parameter and share the visitor ID properly.

## Approach comparison

Before implementing, first determine if your existing implementation uses the `visitor.appendVisitorIDsTo()` function. Any custom code using this function should be updated to use the new `appendIdentityToUrl` Web SDK command.

| VisitorAPI.js | Platform Web SDK |
| --- | --- |
| `visitor.appendVisitorIDsTo(*url*)` |  `alloy("appendIdentityToUrl", { url: *url* })` |

## Using the `appendIdentityToURL` command

For cross-domain ID sharing, Web SDK version 2.11.0 adds support for the `appendIdentityToUrl` command. When used, this command generates the `adobe_mc` query string parameter.

The command accepts an object with one property, `url`, and returns an object with the property url.

This command does not wait for any consent update. If consent has not been provided, the URL is returned unchanged.

If an ECID is not provided, the `/acquire` endpoint is called to generate an ECID.

Below is an example of how you can implement cross-domain ID sharing.

This code adds an event listener for all the clicks on the page. If the click was on a link to a matching domain, in this case adobe.com or behance.com, it adds the identity to the URL and redirects the user there.

```Javascript
document.addEventListener("click", event => {
  const anchor = event.target.closest("a");
  if (!anchor || !anchor.href) {
    return;
  }
  const url = new URL(anchor.href);
  if (!url.hostname.endsWith("adobe.com") && !url.hostname.endsWith("behance.com")) {
    return;
  }
  event.preventDefault();
  alloy("appendIdentityToUrl", { url: anchor.href }).then(result => {
    document.location = result.url;
  });
});
```

>[!TIP]
>
>When using the tags feature (formerly Launch) to implement Web SDK, cross-domain ID sharing can be accomplished without custom code. Refer to the [dedicated documentation](https://experienceleague.adobe.com/docs/experience-platform/edge/identity/id-sharing.html#tags-extension) for more details.

>[!NOTE]
>
>The Platform Web SDK also supports mobile-to-web ID sharing for native mobile app use cases. For more information, refer to the dedicated documentation about [mobile-to-web and cross-domain ID sharing](https://experienceleague.adobe.com/docs/experience-platform/edge/identity/id-sharing.html).

Next, learn how to [update audiences and profile scripts](update-audiences.md) to ensure compatibility with Platform Web SDK.

>[!NOTE]
>
>We are committed to helping you be successful with your Target migration from at.js to Web SDK. If you run into obstacles with your migration or feel like there is critical information missing in this guide, please let us know by posting in [this Community discussion](https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-data/tutorial-discussion-migrate-target-from-at-js-to-web-sdk/m-p/575587#M463).

branch_name: refs/heads/main

gha_license_id: MIT


text:
## Release Overview

Minor update to fix issues with package on R-devel. Issues were related to the change in the RNG algorithm. Tests now pass on R-devel (checked
on rhub). Also incoporates a few minor bug fixes that address issues brought up by users of the package.

## R CMD check results

0 errors, 0 warnings, 2 notes

There is a note about authors with non-standard roles, 'rev'.
These authors were reviewers for the rOpensci review process
(see https://github.com/ropensci/onboarding/issues/107).

There is also a note about "Unknown, possibly mis-spelled, fields" in
DESCRIPTION. These are metadata for an ROpensci code metadata project.

## Reverse dependencies

No reverse dependencies.
---

gha_license_id: NOASSERTION


text:
Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation.

Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and content using our StoreKit wrapper and Google Play Billing wrapper.

Check the [documentation](https://docs.qonversion.io) to learn details on implementing and using Qonversion SDKs.

[![MIT License](http://img.shields.io/cocoapods/l/Qonversion.svg?style=flat)](http://qonversion.io)

## Product Center

1. Application calls the purchase method to initialize Qonversion SDK.
2. Qonversion SDK communicates with StoreKit or Google Billing Client to make a purchase.
3. If a purchase is successful, the SDK sends a request to Qonversion API for server-to-server purchase validation. Qonversion server receives accurate information on the in-app purchase status and user entitlements.
4. SDK returns control to the application with a processing state.

## Analytics

Monitor your in-app revenue metrics. Understand your customers and make better decisions with precise subscription revenue data.

## Integrations

Share your iOS and Android in-app subscription data with your favorite platforms.

## License

Qonversion SDK is available under the MIT license.

repository: mavarazy/react-native-sdk

repo_name: mavarazy/react-native-sdk


text:
# Hetzner Cloud Docker machine driver

[![Go Report Card](https://goreportcard.com/badge/github.com/JonasProgrammer/docker-machine-driver-hetzner)](https://goreportcard.com/report/github.com/JonasProgrammer/docker-machine-driver-hetzner)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://secure.travis-ci.org/JonasProgrammer/docker-machine-driver-hetzner.png)](http://travis-ci.org/JonasProgrammer/docker-machine-driver-hetzner)

> This library adds the support for creating [Docker machines](https://github.com/docker/machine) hosted on the [Hetzner Cloud](hetzner.de/cloud).

You need to create a project-specific access token under `Access` > `API Tokens` in the project control panel
and pass that to `docker-machine create` with the `--hetzner-api-token` option.

## Installation

You can find sources and pre-compiled binaries [here](https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases).

```shell
# Download the binary (this example downloads the binary for linux amd64)
$ wget https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases/download/0.2.4/docker-machine-driver-hetzner_0.2.4_linux_amd64.tar.gz
$ tar -xvf docker-machine-driver-hetzner_0.2.4_linux_amd64.tar.gz

# Make it executable and copy the binary in a directory accessible with your $PATH
$ chmod +x docker-machine-driver-hetzner
$ cp docker-machine-driver-hetzner /usr/local/bin/
```

## Usage

    $ docker-machine create \
      --driver hetzner \
      --hetzner-api-token=QJhoRT38JfAUO037PWJ5Zt9iAABIxdxdh4gPqNkUGKIrUMd6I3cPIsfKozI513sy \
      some-machine

### Using environment variables

    $ HETZNER_API_TOKEN=QJhoRT38JfAUO037PWJ5Zt9iAABIxdxdh4gPqNkUGKIrUMd6I3cPIsfKozI513sy \
      && HETZNER_IMAGE=centos-7 \
      && docker-machine create \
         --driver hetzner \
         some-machine

## Options

-   `--hetzner-api-token`: **required**. Your project-specific access token for the Hetzner Cloud API.
-   `--hetzner-image`: The name of the Hetzner Cloud image to use, see [Images API](https://docs.hetzner.cloud/#resources-images-get) for how to get a list.
-   `--hetzner-server-type`: The type of the Hetzner Cloud server, see [Server Types API](https://docs.hetzner.cloud/#resources-server-types-get) for how to get a list.
-   `--hetzner-server-location`: The location to create the server in, see [Locations API](https://docs.hetzner.cloud/#resources-locations-get) for how to get a list.
**NOTICE: Beware that Hetzner does not reject invalid location names at the time of writing this; instead, a seemingly random location is chosen. Double check both the option value's
spelling and the newly created server to make sure the desired location was chosen indeed.**
-   `--hetzner-existing-key-path`: Use an existing (local) SSH key instead of generating a new keypair.
-   `--hetzner-existing-key-id`: **requires `--hetzner-existing-key-path`**. Use an existing (remote) SSH key instead of uploading the imported key pair,
    see [SSH Keys API](https://docs.hetzner.cloud/#resources-ssh-keys-get) for how to get a list

The Hetzner Cloud driver will use `debian-9` as the default image and `cx11` as the default type.

#### Existing SSH keys

When you specify the `--hetzner-existing-key-path` option, the driver will attempt to copy `(specified file name)`
and `(specified file name).pub` to the machine's store path. They public key file's permissions will be set according
to your current `umask` and the private key file will have `600` permissions.

When you additionally specify the `--hetzner-existing-key-id` option, the driver will not create an SSH key using the API
but rather try to use the existing public key corresponding to the given id. Please note that during machine creation,
the driver will attempt to [get the key](https://docs.hetzner.cloud/#resources-ssh-keys-get-1) and **compare it's
fingerprint to the local public key's fingerprtint**. Keep in mind that the both the local and the remote key must be
accessible and have matching fingerprints, otherwise the machine will fail it's pre-creation checks.

Also note that the driver will attempt to delete the linked key during machine removal, unless `--hetzner-existing-key-id`
was used during creation.

#### Environment variables and default values

| CLI option                          | Environment variable              | Default                    |
| ----------------------------------- | --------------------------------- | -------------------------- |
| **`--hetzner-api-token`**           | `HETZNER_API_TOKEN`               | -                          |
| `--hetzner-image `                  | `HETZNER_IMAGE_IMAGE`             | `debian-9`                 |
| `--hetzner-server-type`             | `HETZNER_TYPE`                    | `cx11`                     |
| `--hetzner-server-location`         | `HETZNER_LOCATION`                | - *(let Hetzner choose)*   |
| `--hetzner-existing-key-path`       | `HETZNER_EXISTING_KEY_PATH`       | - *(generate new keypair)* |
| `--hetzner-existing-key-id`         | `HETZNER_EXISTING_KEY_ID`         | 0 *(upload new key)*       |

## Building from source

Use an up-to-date version of [Go](https://golang.org/dl)

To use the driver, you can download the sources and build it locally:

```shell
# Get sources and build the binary at ~/go/bin/docker-machine-driver-hetzner
$ go get github.com/jonasprogrammer/docker-machine-driver-hetzner

# Make the binary accessible to docker-machine
$ export GOPATH=$(go env GOPATH)
$ export GOBIN=$GOPATH/bin
$ export PATH="$PATH:$GOBIN"
```

## Development

Fork this repository, yielding `github.com/<yourAccount>/docker-machine-driver-hetzner`.

```shell
# Get the sources of your fork and build it locally
$ go get github.com/<yourAccount>/docker-machine-driver-hetzner

# * This integrates your fork into the $GOPATH (typically pointing at ~/go)
# * Your sources are at $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner
# * That folder is a local Git repository. You can pull, commit and push from there.
# * The binary will typically be at $GOPATH/bin/docker-machine-driver-hetzner
# * In the source directory $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner
#   you may use go get to re-build the binary.
# * Note: when you build the driver from different repositories, e.g. from your fork
#   as well as github.com/jonasprogrammer/docker-machine-driver-hetzner,
#   the binary files generated by these builds are all called the same
#   and will hence override each other.

# Make the binary accessible to docker-machine
$ export GOPATH=$(go env GOPATH)
$ export GOBIN=$GOPATH/bin
$ export PATH="$PATH:$GOBIN"

# Make docker-machine output help including hetzner-specific options
$ docker-machine create --driver hetzner
```

gha_language: Go


text:
# The Rust Ecosystem

The Rust ecosystem consists of a number of tools, of which the main ones are:

* `rustc`: the Rust compiler which turns `.rs` files into binaries and other
  intermediate formats.

* `cargo`: the Rust dependency manager and build tool. Cargo knows how to
  download dependencies, usually hosted on <https://crates.io>, and it will pass them to
  `rustc` when building your project. Cargo also comes with a built-in test
  runner which is used to execute unit tests.

* `rustup`: the Rust toolchain installer and updater. This tool is used to
  install and update `rustc` and `cargo` when new versions of Rust is released.
  In addition, `rustup` can also download documentation for the standard
  library. You can have multiple versions of Rust installed at once and `rustup`
  will let you switch between them as needed.

<details>

Key points:

* Rust has a rapid release schedule with a new release coming out
  every six weeks. New releases maintain backwards compatibility with
  old releases --- plus they enable new functionality.

* There are three release channels: "stable", "beta", and "nightly".

* New features are being tested on "nightly", "beta" is what becomes
  "stable" every six weeks.

* Dependencies can also be resolved from alternative [registries], git, folders, and more.

* Rust also has [editions]: the current edition is Rust 2021. Previous
  editions were Rust 2015 and Rust 2018.

  * The editions are allowed to make backwards incompatible changes to
    the language.

  * To prevent breaking code, editions are opt-in: you select the
    edition for your crate via the `Cargo.toml` file.

  * To avoid splitting the ecosystem, Rust compilers can mix code
    written for different editions.

  * Mention that it is quite rare to ever use the compiler directly not through `cargo` (most users never do).

  * It might be worth alluding that Cargo itself is an extremely powerful and comprehensive tool.  It is capable of many advanced features including but not limited to:
      * Project/package structure
      * [workspaces]
      * Dev Dependencies and Runtime Dependency management/caching
      * [build scripting]
      * [global installation]
      * It is also extensible with sub command plugins as well (such as [cargo clippy]).
  * Read more from the [official Cargo Book]

[editions]: https://doc.rust-lang.org/edition-guide/

[workspaces]: https://doc.rust-lang.org/cargo/reference/workspaces.html

[build scripting]: https://doc.rust-lang.org/cargo/reference/build-scripts.html

[global installation]: https://doc.rust-lang.org/cargo/commands/cargo-install.html

[cargo clippy]: https://github.com/rust-lang/rust-clippy

[official Cargo Book]: https://doc.rust-lang.org/cargo/

[registries]: https://doc.rust-lang.org/cargo/reference/registries.html

</details>

repository: google/comprehensive-rust

gha_language: Rust

repo_name: google/comprehensive-rust


text:
# asus-fan-control (AFC)

[![CI status](https://github.com/dominiksalvet/asus-fan-control/workflows/CI/badge.svg)](https://github.com/dominiksalvet/asus-fan-control/actions)
[![GitPack](https://img.shields.io/badge/-GitPack-571997)](https://github.com/topics/gitpack)
[![POSIX Shell](https://img.shields.io/badge/POSIX-Shell-111111)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fdominiksalvet%2Fasus-fan-control&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)

In default, some ASUS devices running Linux control their system fans inappropriately. **Typical symptoms** include:

* Running fans even when not under any load
* Not running fans under load appropriately
* Spinning up fans in short performance peaks

AFC solves the problems above and even more. **Tested devices** with links to their first testers:

| ASUS VivoBook | ASUS ZenBook   | ASUS ROG       | Others         |
|---------------|----------------|----------------|----------------|
| [N580VD][14]  | [UX310UA][18]  | [G751JY][25]   | [B9440UA][1]   |
| [S530UA][13]  | [UX330UAK][24] | [G752VL][2]    | [FX505GM][15]  |
| [X507UF][17]  | [UX360UAK][6]  | [GL502VMK][21] | [FX505GT][22]  |
| [X510UA][4]   | [UX410UA][7]   | [GL502VSK][10] | [FX553VD][12]  |
| [X512FA][5]   | [UX410UQ][9]   | [GL553VD][3]   | [TP550LAB][23] |
| [X542UF][16]  | [UX430UA][8]   | [GL553VE][11]  |                |
|               | [UX430UN][20]  | [GL702VSK][19] |                |

[1]: https://github.com/fzwoch
[2]: https://github.com/icegood
[3]: https://gitlab.com/infinito84
[4]: https://github.com/agura-lex
[5]: https://github.com/MartinMyr
[6]: https://github.com/afilipovich
[7]: https://github.com/fsanzdev
[8]: https://github.com/dominiksalvet
[9]: https://github.com/gobenavides
[10]: https://github.com/Mikarox
[11]: https://github.com/arruor
[12]: https://github.com/Greifent
[13]: https://github.com/nigelwarning
[14]: https://github.com/AntonisKl
[15]: https://github.com/Rakesh-rules
[16]: https://github.com/FadeMind
[17]: https://github.com/vaibhav-hexa
[18]: https://github.com/theamarin
[19]: https://github.com/bonezinger
[20]: https://github.com/klausenbusk
[21]: https://github.com/Errivincenz
[22]: https://github.com/zukurnaz
[23]: https://github.com/HamzaLakhani01
[24]: https://github.com/a-johnston
[25]: https://github.com/nick-dimitrov

> **ProTip!** Your device is not in the table? Take a look at [contributing.md](contributing.md) file and you can easily add it.
>
> Compatibility notes:
>
> * Devices with AMD processors do not work with AFC.
> * Devices with the 7th gen Intel processors work well.
> * Other devices may vary.

## Table of Contents

- [asus-fan-control (AFC)](#asus-fan-control-afc)
  - [Table of Contents](#table-of-contents)
  - [Install](#install)
    - [Dependencies](#dependencies)
    - [Using GitPack](#using-gitpack)
    - [From AUR](#from-aur)
  - [Usage](#usage)
    - [Custom Temperatures](#custom-temperatures)
    - [GUI](#gui)
  - [Useful Resources](#useful-resources)

## Install

### Dependencies

* **systemd** suite
* **acpi_call** module (see below)

### Using GitPack

AFC supports [GitPack](https://github.com/dominiksalvet/gitpack). Global installation/update:

```sh
sudo gitpack install github.com/dominiksalvet/asus-fan-control
```

> If your system has APT, GitPack will install acpi_call automatically.

### From AUR

We have an [AUR package](https://aur.archlinux.org/packages/asus-fan-control) available. Global installation/update:

```sh
mkdir -p /tmp/asus-fan-control/ && cd /tmp/asus-fan-control/ &&
git clone https://aur.archlinux.org/asus-fan-control.git . &&
sudo makepkg -si
```

For AUR installations, enable running AFC automatically:

```sh
sudo systemctl enable afc
```

## Usage

AFC does not run in the background (i.e., it is not a daemon process). It is **executed automatically whenever necessary** (e.g., on OS boots) to keep the effect of a permanent change. It is also possible to invoke it manually as shown below:

```sh
sudo asus-fan-control
```

> It uses custom temperatures if previously set, otherwise the default temperatures are used.

### Custom Temperatures

The fan speed policy is usually defined by 8 increasing numbers representing temperature boundaries in degrees Celsius between individual fan speed levels. E.g., UX430UA's default temperatures are `55 60 62 65 68 72 76 80` as shown:

| Speed level | Temperature (C°) |
|-------------|------------------|
| 0 (off)     | 54 and less      |
| 1           | 55 to 59         |
| 2           | 60 to 61         |
| 3           | 62 to 64         |
| 4           | 65 to 67         |
| 5           | 68 to 71         |
| 6           | 72 to 75         |
| 7           | 76 to 79         |
| 8 (max)     | 80 and more      |

To use your custom temperatures, use the `set-temps` command. For example:

```sh
sudo asus-fan-control set-temps 45 50 55 60 65 70 75 80
```

### GUI

Did you know that AFC has a **graphical user interface** extension? Visit [afc-gui](https://github.com/Greifent/afc-gui) for more details.

## Useful Resources

* [support.md](support.md) – questions, answers, help
* [contributing.md](contributing.md) – get involved, suggestions, bug reports
* [license](license) – author, license text

repository: dominiksalvet/asus-fan-control

gha_language: Shell

repo_name: dominiksalvet/asus-fan-control


text:
# MessageRoutine

[![Build Status](https://strawberry-vs.visualstudio.com/MessageRoutine/_apis/build/status/Berrysoft.MessageRoutine?branchName=master)](https://strawberry-vs.visualstudio.com/MessageRoutine/_build/latest?definitionId=7&branchName=master)

This is a message routine model for .NET.

## Inspiration
The controller of ASP.NET, which only receives a centain series of requests, and uses global settings through dependency injection.

## Sample
See the sample projects.

repository: Berrysoft/MessageRoutine

repo_name: Berrysoft/MessageRoutine


text:
# Collaborating with Git

Learn how to collaborate on [GitHub][github] with [Git][git].

**You will need**

* [Git][git]
* A free [GitHub][github] account
* A Unix CLI

**Recommended reading**

* [Git introduction](../git/)
* [Git branching](../git-branching/)

- [Group work](#group-work)
- [Distributed version control system](#distributed-version-control-system)
  - [What is a remote?](#what-is-a-remote)
  - [Centralized workflow](#centralized-workflow)
  - [Working with GitHub](#working-with-github)
    - [Create a free GitHub account](#create-a-free-github-account)
    - [Create an SSH key](#create-an-ssh-key)
    - [Copy the SSH key](#copy-the-ssh-key)
    - [Add the SSH key to your GitHub account](#add-the-ssh-key-to-your-github-account)
- [Sharing changes](#sharing-changes)
  - [Bob: create a repository on GitHub](#bob-create-a-repository-on-github)
  - [Bob: add B as a collaborator](#bob-add-b-as-a-collaborator)
  - [Bob: copy the remote SSH URL](#bob-copy-the-remote-ssh-url)
  - [Bob: add the remote to your local repository](#bob-add-the-remote-to-your-local-repository)
  - [Bob: push your commits to the shared repository](#bob-push-your-commits-to-the-shared-repository)
  - [Bob: remote branches](#bob-remote-branches)
  - [Alice: get the remote repository's SSH URL](#alice-get-the-remote-repositorys-ssh-url)
  - [Alice: clone the shared repository](#alice-clone-the-shared-repository)
  - [Alice: remote branches](#alice-remote-branches)
  - [Alice: make local changes](#alice-make-local-changes)
  - [Alice: check the state of branches](#alice-check-the-state-of-branches)
  - [Alice: push to the shared repository](#alice-push-to-the-shared-repository)
  - [Bob: check the state of branches](#bob-check-the-state-of-branches)
  - [Bob: fetch changes from the shared repository](#bob-fetch-changes-from-the-shared-repository)
  - [Bob: check the state of branches](#bob-check-the-state-of-branches-1)
  - [Using git pull](#using-git-pull)
- [Managing conflicting commit histories](#managing-conflicting-commit-histories)
  - [Bob: fix the bug](#bob-fix-the-bug)
  - [Alice: make other changes](#alice-make-other-changes)
  - [Alice: push the other changes](#alice-push-the-other-changes)
  - [Rejected pushes](#rejected-pushes)
    - [Alice: fetch the changes](#alice-fetch-the-changes)
    - [Alice: try to push again](#alice-try-to-push-again)
  - [Divergent history](#divergent-history)
  - [Alice: pull changes from the shared repository](#alice-pull-changes-from-the-shared-repository)
  - [Alice: check the conflict markers](#alice-check-the-conflict-markers)
  - [Alice: check the state of branches](#alice-check-the-state-of-branches-1)
  - [Alice: push the changes](#alice-push-the-changes)
  - [Bob: pull the changes](#bob-pull-the-changes)

## Group work

This tutorial is meant to be performed by a group of two.
Throughout the rest of the document, the members of the group will be referred to as **Bob** and **Alice**.

The tutorial assumes that you have followed the [previous Git tutorial][git-tutorial] and have kept your calculator repository.

## Distributed version control system

Working with remote repositories

### What is a remote?

A **remote repository** is a version of your project that is hosted on the Internet or network somewhere.
You can have **several of them**.

Collaborating with others involves **pushing** and **pulling** data to and from these remote repositories when you need to share work.

### Centralized workflow

There are [many ways][distributed-workflows] to work with Git as a team.
Here we will use a simple **centralized workflow**:

In this workflow:

* A **shared central repository** hosted on GitHub
* Each developer has a **repository on their local machine**
  * Each developer will add the shared repository as a **remote**

### Working with GitHub

> "[GitHub][github] is a web-based Git repository and Internet hosting service.
  It offers all of the **distributed version control** and **source code management (SCM)** functionality of **Git**
  as well other features like access control, bug tracking, feature requests, task management, and wikis for every project."

#### Create a free GitHub account

Both group members should register on GitHub:

#### Create an SSH key

To push code to GitHub, you will need to **authenticate** yourself.
There are two methods of authentication: HTTPS username/password or SSH keys.
We will use an **SSH key** for this tutorial.
You can check if you have one already with this command:

```bash
$> ls ~/.ssh
id_rsa  id_rsa.pub
```

If you see these files, then you already have an SSH key pair (`id_rsa` is the **private** key, `id_rsa.pub` is the **public** key).

If you don't (or see a *"No such file or directory"* error), use this command to generate a new key pair (press Enter at every prompt to keep the defaults):

```bash
$> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/.ssh/id_rsa.
Your public key has been saved in /home/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ULmjUQDN4Snkh0s9u093mcva4cI94cDk name@host
```

#### Copy the SSH key

To authenticate using your SSH key on GitHub, you will need to copy your **public key**.
You can display it on the CLI with this command:

```bash
$> cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQC+OMYWxBCiKa1lZuUc8sLcSBW17h
l4VTy9DaarFC98KxS3NQao/7+eMkOS3o1II4QL7pn7WMYITWpWP9UdJKNef/KQlTpS
1QVbhb6iJ2z2+GGt8+b0GvBRAZgab9TeOIrzN1QyknO4 name@host
```

#### Add the SSH key to your GitHub account

On GitHub, find the **SSH and GPG keys** section of your account settings and paste your **public SSH key** there:

(The title of the key is not important. It's useful when you have multiple keys, to remember which is which.)

## Sharing changes

Clone repositories, push and pull commits

### Bob: create a repository on GitHub

**Bob** should create a repository from the GitHub menu:

### Bob: add B as a collaborator

For this tutorial, both team members will need push access to the repository.
**Bob** should go to the repository's **collaborator settings**,
and add the GitHub username of **Alice** as a collaborator:

**Alice** must then **_accept the invitation sent by e-mail_** for the change to be effective.

### Bob: copy the remote SSH URL

**Bob** should copy the SSH URL of the GitHub repository:

**WARNING:** be sure to select the **SSH** URL, not the **HTTPS** URL
(which might be selected by default).

### Bob: add the remote to your local repository

**Bob** should move into their local repository and add the GitHub repository as a remote:

```bash
$> cd /path/to/projects/comem-archidep-git-branching

$> git remote add origin git@github.com:bob/github-demo.git
```

It's a convention to name the default remote **origin**.

You can check what remotes are available with `git remote`:

```bash
$> git remote -v
origin  git@github.com:bob/github-demo.git (fetch)
origin  git@github.com:bob/github-demo.git (push)
```

### Bob: push your commits to the shared repository

It's time for **Bob** to put the code in the shared GitHub repository.
This is done using the `git push` command:

```bash
$> git push -u origin main
Counting objects: 35, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (33/33), done.
Writing objects: 100% (35/35), 4.16 KiB | 0 bytes/s, done.
Total 35 (delta 14), reused 11 (delta 2)
remote: Resolving deltas: 100% (14/14), done.
To github.com:bob/github-demo.git
 * [new branch]      main -> main
```

The command `git push [remote] [branch]` tells Git to push the commit pointed to by `[branch]` to the remote named `[remote]`.

The `-u` option (or `--set-upstream`) tells Git to remember that you have linked this branch to that remote.

### Bob: remote branches

<git-memoir name='github' chapter='bob-push' svg-height='300px'></git-memoir>

The commit objects and file snapshots have been **pushed** (or uploaded) to the GitHub repository.

This includes not only the commit pointed to by main, but also the **entire history** of the repository up to that commit.

Note the **origin/main** branch that has appeared in your local repository.
This is a **remote-tracking branch**.
It tells you where the **main** branch points to on the **origin** remote (the GitHub repository in this case).

### Alice: get the remote repository's SSH URL

**Alice** can now go to the repository's page on GitHub (under **Bob**'s account) and copy the SSH URL:

**WARNING:** again, be sure to select the **SSH** URL, not the **HTTPS** URL
(which might be selected by default).

### Alice: clone the shared repository

**Alice** can now get a copy of the shared GitHub repository on their machine.
This is done using the `git clone` command:

```bash
$> git clone git@github.com:bob/github-demo.git
Cloning into 'github-demo'...
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 35 (delta 14), reused 35 (delta 14), pack-reused 0
Receiving objects: 100% (35/35), 4.16 KiB | 0 bytes/s, done.
Resolving deltas: 100% (14/14), done.

$> cd github-demo
```

The `git clone [url]` command copies the **remote** repository to your machine.

### Alice: remote branches

<git-memoir name='github' chapter='alice-pull' svg-height='275px'></git-memoir>

The entire history of the project is **pulled** (or downloaded) from the GitHub repository.

Git will also automatically checkout the **main** branch in the working directory so you have something to work from.

Again, Git has created a **remote-tracking branch** in Alice's repository,
so that you can know what the current state of the remote is.

### Alice: make local changes

**Alice** thinks that the project's filenames are too long. Let's fix that:

```bash
$> mv addition.js add.js
$> mv subtraction.js sub.js
$> git add .
$> git commit -m "Shorter filenames"
```

### Alice: check the state of branches

<git-memoir name='github' chapter='alice-commit' svg-height='275px'></git-memoir>

This is now the state of the shared repository and **Alice**'s local repository.

There is a new commit in **Alice**'s repository that is not in the shared GitHub repository.

### Alice: push to the shared repository

Push to update the shared repository:

```bash
$> git push origin main
```

<git-memoir name='github' chapter='alice-push' svg-height='275px'></git-memoir>

### Bob: check the state of branches

<git-memoir name='github' chapter='bob-look' controls='false' svg-height='275px'></git-memoir>

This is now the state from **Bob**'s perspective.

Notice that the new commit is in the shared repository (on GitHub)
but that the remote-tracking branch origin/main **is not up-to-date** in **Bob**'s repository.

Git does not automatically sync repositories.
**As far as Bob knows** looking at information from their local repository,
the main branch still points to `4f94ga` in the shared repository.

### Bob: fetch changes from the shared repository

**Bob** should now get the changes from the shared repository:

```bash
$> git fetch origin
remote: Counting objects: 2, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 2 (delta 1), reused 2 (delta 1), pack-reused 0
Unpacking objects: 100% (2/2), done.
From github.com:bob/github-demo
   4f94ga..92fb8c  main     -> origin/main
```

<git-memoir name='github' chapter='bob-fetch' svg-height='250px'></git-memoir>

The new commit is now here and the remote-tracking branch has been updated.

However, the local main branch **has not moved** and the working directory has **not been updated**.

### Bob: check the state of branches

Now you can use `git merge` like in the previous tutorial to bring the changes of origin/main into main:

```bash
$> git merge origin/main
Updating 4f94ga..92fb8c
Fast-forward
 addition.js => add.js | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename addition.js => add.js (100%)
```

<git-memoir name='github' chapter='bob-merge' svg-height='240px'></git-memoir>

As expected, main has been fast-forwarded to the commit pointed to by origin/main and the working directory has been updated.

**Bob**'s repository is now up-to-date.

### Using git pull

You can also use `git pull [remote] [branch]` to save time.

The following command:

```bash
$> git pull origin main
```

Is equivalent to running the two commands we just used:

```bash
$> git fetch origin
$> git merge origin/main
```

## Managing conflicting commit histories

### Bob: fix the bug

**Bob** now notices that the last change breaks the calculator.
This is because the files were renamed, but the `<script>` tags in `index.html` were not updated.
Fix that bug, then commit and push the change:

```bash
(Make the fix...)
$> git add index.html
$> git commit -m "Fix bad <script> tags"
$> git push origin main
```

<git-memoir name='github' chapter='bob-fix' svg-height='250px'></git-memoir>

### Alice: make other changes

**Alice**, not having noticed the bug, proceeds to make 2 changes on `index.html`:

* Add an `<h2>` title before each computation
* Put the two last `<script>` tags on one line

```html
*<h2>Addition</h2>
<p id="addition">...</p>

*<h2>Subtraction</h2>
<p id="subtraction">...</p>

<script src="calculations.js"></script>
*<script src="addition.js"></script><script src="subtraction.js"></script>
```

### Alice: push the other changes

Commit and push the changes:

```bash
$> git add index.html
$> git commit -m "Improve layout"
$> git push origin main
```

<git-memoir name='github' chapter='alice-fix' svg-height='250px'></git-memoir>

### Rejected pushes

```bash
To github.com:bob/github-demo.git
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'git@github.com:bob/github-demo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```

<git-memoir name='github' chapter='alice-fix' controls='false' svg-height='250px'></git-memoir>

The push was **rejected** by the remote repository. Why?

This is the state of **Alice**'s repository right now.

#### Alice: fetch the changes

Since Git tells Alice that the local copy of the remote repository is out of date, try fetching those changes:

```bash
$> git fetch origin
```

<git-memoir name='github' chapter='alice-fetch-changes' svg-height='325px'></git-memoir>

#### Alice: try to push again

```bash
$> git push origin main
To github.com:bob/github-demo.git
 ! [rejected]        main -> main (non-fast forward)
error: failed to push some refs to 'git@github.com:bob/github-demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```

<git-memoir name='github' chapter='alice-fetch-changes' controls='false' svg-height='315px'></git-memoir>

The push was **rejected again**! **Why?**

This is the state of **Alice**'s repository right now.

### Divergent history

<git-memoir name='github' chapter='alice-fetch-changes' controls='false' svg-height='325px'></git-memoir>

It's for the same reason as in the previous tutorial:
**Bob** and **Alice**'s work have diverged from a common ancestor.

A remote repository will **only accept fast-forward pushes** by default.

### Alice: pull changes from the shared repository

**Alice** wants to fetch **and** merge the changes made by **Bob**.
Let's use the `git pull` command:

```bash
$> git pull origin main
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 3 (delta 1), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:bob/github-demo
 * branch            main     -> FETCH_HEAD
   92fb8c..3ff531    main     -> origin/main
Auto-merging index.html
CONFLICT (content): Merge conflict in index.html
Automatic merge failed; fix conflicts and then commit the result.
```

The fetch succeeded, but the merge failed because of a **conflict** on `index.html`.

### Alice: check the conflict markers

**Alice** should take a look at `index.html`:

```txt
<<<<<<< HEAD
    <script src="addition.js"></script><script src="subtraction.js"></script>
=======
    <script src="add.js"></script>
    <script src="sub.js"></script>
>>>>>>> 3ff5311406e73c7d2cc1691f9535214c2543937f
```

Let's make sure we keep it on one line while still renaming the files, and remove the conflict markers::

```txt
    <script src="add.js"></script><script src="sub.js"></script>
```

Mark the conflict as resolved and finish the merge:

```bash
$> git add index.html
$> git commit -m "Merge origin/main"
```

### Alice: check the state of branches

Now the state of **Alice**'s local repository is consistent with the state of the shared repository:
the commit pointed to by **main** is ahead of the commit pointed to by **origin/main**.

<git-memoir name='github' chapter='alice-pull-changes' svg-height='325px'></git-memoir>

### Alice: push the changes

The push will be accepted now:

```bash
$> git push origin main
```

<git-memoir name='github' chapter='alice-push-merge' svg-height='335px'></git-memoir>

### Bob: pull the changes

**Bob** can now pull those latest changes to keep up-to-date:

```bash
$> git pull origin main
```

<git-memoir name='github' chapter='bob-pull-merge' svg-height='335px'></git-memoir>

[distributed-workflows]: https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows
[git]: https://git-scm.com
[git-tutorial]: ../git/
[github]: https://github.com

repository: MediaComem/comem-archidep

gha_language: JavaScript

repo_name: MediaComem/comem-archidep


text:
---
id: installation
title: Installation
sidebar_label: Installation
---

VizSeq requires **Python 3.6+** and currently runs on **Unix/Linux** and **macOS/OS X**. It will support **Windows** as
well in the future.

You can install VizSeq from PyPI repository:
```bash
$ pip install vizseq
```
Or install it from source:
```bash
$ git clone https://github.com/facebookresearch/vizseq
$ cd vizseq
$ pip install -e .
```

## Citation
If you find VizSeq useful in your research, please cite as
```
@inproceedings{wang2019vizseq,
  title = {VizSeq: A Visual Analysis Toolkit for Text Generation Tasks},
  author = {Changhan Wang, Anirudh Jain, Danlu Chen, Jiatao Gu},
  booktitle = {In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
  year = {2019},
}
```

repository: facebookresearch/vizseq

gha_language: Python

repo_name: facebookresearch/vizseq


text:
# Cygnus

Finally presenting the code browser you've waited for all your life.

You spent 20 years learning vim -- ahem -- a *fraction* of vim.
You can master this tool in about 20 seconds -- just j k gg G H L M. And w.
 Not even an e or b.
Only / to search not even an ? to search back.

No plugins to distract you, no complex config files, in fact no config files at all. No battling with pathogen, bundle, vundle, vimballs and git submodules.

And best of all a colorscheme to die for.

## Installation

    $ gem install cygnus

## Usage

     cygnus

 or map it to an alias and use the alias

     alias x=~/path_to_cygnus/cygnus

## Warning

This baby is seductive and addictive.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Cygnus is named after a constellation, and contains deneb, a massive star.

repository: rkumar/cygnus

repo_name: rkumar/cygnus


text:
# Google Cloud Source Repositories source

This event source receives messages from a [Google Cloud Source Repository][gc-source-repositories]
over a [Google Cloud Pub/Sub][gc-source-repositories-events] topic.

With `tmctl`:

!!! warning "Work in progress"
    This component is not yet available with `tmctl`.

On Kubernetes:

```yaml
apiVersion: sources.triggermesh.io/v1alpha1
kind: GoogleCloudSourceRepositoriesSource
metadata:
  name: sample
spec:
  repository: projects/my-project/repos/my-repo

  publishServiceAccount<EMAIL_ADDRESS>
  serviceAccountKey:
    value: >-
      {
        "type": "service_account",
        "project_id": "my-project",
        "private_key_id": "0000000000000000000000000000000000000000",
        "private_key": "<REDACTED_PRIVATE_KEY>\n",
        "client_email"<EMAIL_ADDRESS>        "client_id": "000000000000000000000",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/triggermesh-repositories-source%40my-project.iam.gserviceaccount.com"
      }
  sink:
    ref:
      apiVersion: eventing.triggermesh.io/v1alpha1
      kind: RedisBroker
      name: triggermesh
```

Events produced have the following attributes:

* type `com.google.cloud.repositories.notification`

See the [Kubernetes object reference](../../reference/sources/#sources.triggermesh.io/v1alpha1.GoogleCloudSourceRepositoriesSource) for more details.

## Prerequisite(s)

- Service account
- Repository
- Pub/Sub Topic _(optional)_

### Service Account

A Service Account is required to authenticate the event source and allow it to interact with Google
Cloud Repositories.

The service account must be granted an IAM Role with at least the following permissions:

- `source.repos.updateRepoConfig`
- `iam.serviceAccounts.actAs`

The following set of permissions is also required to allow this source to manage the Pub/Sub topic and subscription:

- `pubsub.subscriptions.create`
- `pubsub.subscriptions.delete`

The predefined `roles/source.admin`, `roles/iam.serviceAccountUser` and `roles/pubsub.editor` roles are an example of roles that are suitable for use with the TriggerMesh event
source for Google Cloud Repositories.

Create a key for this service account and save it. This key must be in JSON format. It is required to be
able to run an instance of the Google Cloud Repositories event source.

### Repository

Full resource name of the Repository. For example, projects/my-project/repos/my-repo.

### Pub/Sub Topic _(optional)_
Full resource name of the Pub/Sub topic where change notifications originating from the
configured repo are sent to. If not supplied, a topic is created on behalf of the user, in the
GCP project referenced by the 'project' attribute. The expected format is described at
https://cloud.google.com/pubsub/docs/admin#resource_names

[gc-source-repositories]: https://cloud.google.com/source-repositories/docs
[gc-source-repositories-events]: https://cloud.google.com/source-repositories/docs/configuring-notifications

repository: triggermesh/docs

gha_language: Makefile

repo_name: triggermesh/docs


text:
---
name: Refactoring
about: " Ask for a change in the implementation"
title: ''
labels: refactoring
assignees: ''

---

### Description
[Explain why this change is needed]

### Additional Information
**Is this change will introduce a breaking change ?**: [Pick one of the following: *Yes*|*No*]

**Complexity**: [Pick one of the following: *Low*|*Medium*|*High*|*Critical*]

**Version**: [version number]

**Other**: [Others information]

repository: Wynd-Lab/nihilus

gha_language: PHP

repo_name: Wynd-Lab/nihilus


text:
---
layout: post
title: Analysis of retractions in peer-reviewed journals
tags: networks
---

In this post, I look at a problem that has become more and more common over the last years in academia, that is, the bulk of papers that, either for misconduct, negligence, or simply for accidental human error, present inaccurate results and are ultimately retracted.

I first thought about this problem when I was approached by a journalist that wanted to dig into the issue of academic misconduct. She was curious on whether or not there were some patterns that could be identified by looking at the retractions records, although there was not a single specific question that needed to be answered. So I looked into the data, because, well, because this is what I do.

## Approach

Having no specific question on the agenda, I took the following approach for this analysis:

 - Parsing of the datasets
 - Manipulation of the dataset
 - Exploratory analysis with simple stastics and graphs
 - Additional data wrangling and refinement
 - Deeper look into the data and creation of additional graphs
 - Extraction of insighs and identification of other relevant questions for future analysis

## Datasets

Some initial research told me that there is no ultimate dataset that tracks all retracted paper, apparently. However, the Thomson Reuters Web of Science (WoS) database has a way of marking errata (that is, corrections to the original published article) and retractions. The subsample of actually retracted papers can be retrieved from the whole database by filtering for articles that include the term “retraction” in their title.
Unfortunately, this has to be done manually, exporting them to bibtex 500 records at a time.
Fortunately, there are not that many - less than 5000 overall - so the manual labor is not too taxing.

### Dataset parsing

This section has been moved to the appendix in order not to disrupt the flow.

### Building the DataFrames

This section has been moved to the appendix in order not to disrupt the flow.

## Analysis

In this section, I am going to explore the dataset, identify some patterns, then narrow the focus to answer some specific questions.

### Some preliminary analyses

This section is moved to the appendix, in order not to disrupt the flow with too many tables and graphs. Here are the main takeaways:

- It looks like some people have a really large number of retracted papers. I have spent a long time in academia and I have a good number of published papers myself, but some people have retracted more papers than I have ever published.
- Retractions appear to be increasing with time, but that may not be significant per se, as we would need to compare the fact with the total number of publications, which is also increasing overtime.
- There are too few retractions per journal per year to make an accurate granular analysis of which journals are more affected by the phenomenon.
- The dataset needs a little bit extra polishing (for example, some papers have "anonymous" authors).

There is really a large area to explore, but at this point we will need to pick a focus if we want to avoid getting lost in a myriad of graphs and tables.

### Analysis of the ancillary authors

As soon as I started looking at this dataset, I was curious about the distribution of the set of "middle authors", that is, all those authors that are in the middle of the pack, which are not usually credited with the work or its supervision, but offer some sort of contribution to it. So let us see how their distribution looks like.

```python
def build_middle_authors_df(ret_df):
    '''
    '''
    auth_dc = dict()
    for iloc in range(len(ret_df)):
        if ret_df['middle_authors'].iloc[iloc]=='None':
            auth_ls = ['Nemo']
        else:
            auth_ls = ast.literal_eval(ret_df['middle_authors'].iloc[iloc])
        #end
        for auth in auth_ls:
            if auth in auth_dc.keys():
                auth_dc[auth] = auth_dc[auth] + 1
            else:
                auth_dc[auth] = 1
            #end
        #end
    #end
    middle_authors_dc = {'middle_author': auth_dc.keys(), 'retraction_count': auth_dc.values()}
    middle_authors_df = pd.DataFrame(data=middle_authors_dc)
    return middle_authors_df.sort_values(by='retraction_count', ascending=False).reset_index(drop=True)
#end

middle_authors_df = build_middle_authors_df(summary_df)
```

```python
middle_authors_df.head(4)
```

      middle_author
      retraction_count

      Nemo
      1504

      Kloc, C
      21

      Tanaka, H.
      20

      Saitoh, Y.
      14

As expected, the most common middle author is "Nemo", that is, lots of retracted papers have fewer than three authors. However, a few names do appear to be in several retractions, and they are NOT among those people that have the most retractions are first or last author! We will need to explore this more.

```python
first_auth_df = summary_df.groupby(['first_author']).agg({'times-cited': sum,
                                                          'usage-count-since-2013': sum,
                                                          'retraction_count': 'count'}
                                                         ).sort_values(by='retraction_count',
                                                                      ascending=False).reset_index()
first_auth_df = first_auth_df[first_auth_df['first_author']!='{[}Anonymous], ']
sns.barplot(x='first_author', y="retraction_count", data=first_auth_df.head(16));
plt.xticks(rotation=90);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_43_0.png" title="first author retraction count" width="700" %}

```python
last_auth_df = summary_df.groupby(['last_author']).agg({'times-cited': sum,
                                                        'usage-count-since-2013': sum,
                                                        'retraction_count': 'count'}
                                                       ).sort_values(by='retraction_count',
                                                                     ascending=False).reset_index()
last_auth_df = last_auth_df[last_auth_df['last_author']!='None']
sns.barplot(x='last_author', y='retraction_count', data=last_auth_df.head(16));
plt.xticks(rotation=90);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_44_0.png" title="last author retraction count" width="700" %}

```python
sns.barplot(x="middle_author", y="retraction_count",
            data=middle_authors_df[middle_authors_df['middle_author']!='Nemo'].head(16));
plt.xticks(rotation=90);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_45_0.png" title="middle author retraction count" width="700" %}

Ok, this is interesting.

- First, there appears to be almost no overlap between the populations of "first authors", "last authors" and "middle authors", at least not for the most notable contributors to the retraction database. In other words, the people that are the "workers" of the retracted paper, usually the first authors, are not present much as "supervisors", typicall last authors, and vice versa. Additionally, there is a big group of "contributors", which do not overlap with the previous two categories, but that rack up a good deal of retracted papers. I wonder why that is!
- Second, I was not very lungimirant when I extracted the data and now I am left with fields populated by names (first and last author) and fields populated by lists (middle authors). I will need to unpack the dataset and build an author-centric DataFrame.
- Third, well, this is another bit of a problem. I am afraid that the original database was not consistent in recording the names of the authors. I have very good reason (well, because I explored the records more as soon as I noticed this) to believe that Fujii Yoshitaka and Fujii Y. can be actually the same person. A little exploration suggests that this is not an isolated case. Unfortunately, this will need to be fixed manually...

I will spare the details and all the boilerplate (it can be found in the appendix). Here is the final DatFrame.

```python
adj_author_summary_df.head(3)
```

      ID
      author_name
      first_author
      last_author
      middle_author
      title
      wos_categories

      0
      ISI:000315707300037
      Bose, Julie S.
      1
      0
      0
      1989    A Dihydrobenzofuran Lignan Induces Cel...
      1989    Chemistry, Medicinal
Name: web-of-scie...

      1
      ISI:000239914800070
      Rockley, M. G.
      0
      0
      1
      0    Theoretical investigation of the dissocia...
      0    Chemistry, Physical; Physics, Atomic, Mol...

      2
      ISI:000180655500059
      Onoda, N
      0
      0
      1
      0    A novel bone marrow stroma-derived growth...
      0    Immunology
1    Immunology
2    Immunolog...

With a little extra effort, we can polish things a bit and summarize everyhing for later analysis.

```python
auth_df = adj_author_summary_df.groupby(['author_name']).agg({'first_author': sum,
                                                              'last_author': sum,
                                                              'middle_author': sum}
                                                             ).sort_values(by='first_author',
                                                                           ascending=False).reset_index()

auth_df['count'] = auth_df['first_author'] + auth_df['last_author'] + auth_df['middle_author']
auth_df = auth_df[auth_df['author_name']!='{[}Anonymous], '][auth_df['author_name']!='None']
auth_df = auth_df.sort_values(by='count', ascending=False).reset_index(drop=True)
auth_df['first_and_last_author'] = auth_df['first_author'] + auth_df['last_author']
auth_df = auth_df.sort_values(by='count', ascending=False).reset_index(drop=True)
```

```python
auth_df.head(3)
```

      author_name
      first_author
      last_author
      middle_author
      count
      first_and_last_author

      0
      Fujii, Y.
      82
      3
      5
      90
      85

      1
      Toyooka, H.
      0
      43
      10
      53
      43

      2
      Stapel, D. A.
      14
      25
      8
      47
      39

Finally!
Let us now see how this looks in histogram form. I would like to have the author names on the x-axis and their retraction counts - individually stacked as first, last and middle author contributions - on the y-axis. All sorted by total retraction count. Using seaborn + native pyplot get us there, not without a little effort.

```python
plt.figure(figsize=(12,6))
middle_author_bar = sns.barplot(x='author_name', y='count', data=auth_df.head(30), color='green');
last_author_bar = sns.barplot(x='author_name', y='first_and_last_author', data=auth_df.head(30), color='red');
first_author_bar = sns.barplot(x='author_name', y='first_author', data=auth_df.head(30), color='blue');
first_auth = plt.Rectangle((0,0),1,1,fc='blue', edgecolor = 'none')
last_auth = plt.Rectangle((0,0),1,1,fc='red', edgecolor = 'none')
middle_auth = plt.Rectangle((0,0),1,1,fc='green', edgecolor = 'none')
l = plt.legend([first_auth, last_auth, middle_auth], ['First Author', 'Last Author', 'Middle Author'],
               loc=1, ncol = 2, prop={'size':16})
l.draw_frame(False)
plt.ylim([0,100])
plt.xlabel('Author Name')
plt.ylabel('Retractions Count')
plt.xticks(rotation=90);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_53_0.png" title="retraction count summary" width="900" %}

I personally find this plot quite informative. Here are a few things we can say:

 - The top 5 authors have over 35 retractions (each!) under their belts
 - There are more than 30 people with at least 10 retractions
 - Most authors tend to be first author OR middle author OR last author
 - A good number of authors appear to have a habit of being in the middle of the pack of the authorship of retracted papers

### Network analysis

An important part is missing to make something more than superficial out of the story so far. We have seen that a good number of authors have a lot of retracted papers in their academis CV. We have not investigated the reason for retraction in any of those cases, but it is reasonable to believe that each one of them is at least academically "negligent". Additionally, we have seen that authors are somewhat "specialized" in retracted papers, that is, some of them tend to be the first author of retracted papers, others the last, others appear everywhere else in the authorship list. This begs the questions:

 - Are there "pockets" of academic negligence?
 - Can we identify clusters of people that have contributed substantially to the academic papers' retraction records?

In order to answer these questions, I look into the co-authorship distribution and analyze the "network" of retractions using graphs.
To this aim, I take advantage of the NetworkX library in python and start building the graph.

#### Building nodes and edges

I follow the directions in the NetworkX library documentation regarding how to build the graph. Some boilerplate functions are provided in the appendix, but the main idea is to have:

 - One node for each author, with attributes describing total retraction count, and the individual counts as first, last or middle author
 - One edge for each co-authorship, with weight assigned based on how many retracted papers are shared by the given two authors

```python
import networkx as nx

G = nx.Graph()

edge_weight_dbl_dc = build_edge_weight_dc(article_ID_ls, adj_author_summary_df, author_label_dc, double=True)

for auth in author_ls:
    G.add_node(auth, count=author_retraction_count_dc[auth])
    G.add_node(auth, first=author_retraction_first_dc[auth])
    G.add_node(auth, last=author_retraction_last_dc[auth])
    G.add_node(auth, middle=author_retraction_middle_dc[auth])
#end
for co_authors in edge_weight_dbl_dc:
    G.add_edge(*co_authors, weight=edge_weight_dbl_dc[co_authors])
#end

```

Unfortunately, the above network is extremely large, having about 15k nodes and 50k edges. We need to simplify things. To this aim, I only choose the top 8 authors by retraction count and build the network filtering out any author (and corresponding edge) that does not have at least 1 co-authored retraction with those top 8.

```python
Top_n_auth_G = G.copy()

n = 8
top_n_auth_ls = list(set((auth_df['author_name'].head(n))))
top_n_auth_connection_ls = top_n_auth_ls

for auth in top_n_auth_ls:
    top_n_auth_connection_ls = top_n_auth_connection_ls + G.edge[auth].keys()
#end

top_n_auth_connection_ls = list(set(top_n_auth_connection_ls))
discard_ls = [auth for auth in author_ls if auth not in top_n_auth_connection_ls]
Top_n_auth_G.remove_nodes_from(discard_ls)

```

Let us plot the graph.

```python
plt.figure(figsize=(18,12))
node_size_ls = [50*Top_n_auth_G.node[a]['count'] for a in Top_n_auth_G.nodes()]
edge_weight_ls = [0.5*Top_n_auth_G.edge[a][b]['weight'] for a, b in Top_n_auth_G.edges()]
pos = nx.spring_layout(Top_n_auth_G)
nx.draw(Top_n_auth_G, pos, node_size=node_size_ls, width=edge_weight_ls)
nx.draw_networkx_labels(Top_n_auth_G, pos, node_size=node_size_ls, width=edge_weight_ls);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_63_0.png" title="top 8 authors graph" width="900" %}

There still is a lot of stuff overlapping in the graph, but a few things are quite evident:

 - The top 8 authors by retraction count make up 6 independent clusters
 - The first, second and fourth author by retraction count make up (and dominate!) one cluster, which is not that big overall
 - The cluster belonging to the 7th top author is the overall biggest one

#### Filtering out edges among minor authors

Let us see if we can polish things a bit by eliminating the edges between authors that are not in the top 8.

```python
Top_n_auth_filtered_G = G.copy()

n = 8
top_n_auth_ls = list(set((auth_df['author_name'].head(n))))
top_n_auth_connection_ls = top_n_auth_ls

for auth in top_n_auth_ls:
    top_n_auth_connection_ls = top_n_auth_connection_ls + G.edge[auth].keys()
#end

top_n_auth_connection_ls = list(set(top_n_auth_connection_ls))
discard_ls = [auth for auth in author_ls if auth not in top_n_auth_connection_ls]
Top_n_auth_filtered_G.remove_nodes_from(discard_ls)

remove_edge_ls = list()
for auth in top_n_auth_connection_ls:
    for conn in Top_n_auth_filtered_G.edge[auth].keys():
        if ((auth not in top_n_auth_ls) and (conn not in top_n_auth_ls)):
            remove_edge_ls = remove_edge_ls + [(auth, conn), (conn, auth)]
        #end
    #end
#end

Top_n_auth_filtered_G.remove_edges_from(remove_edge_ls)

node_size_ls = [50*Top_n_auth_filtered_G.node[a]['count'] for a in Top_n_auth_filtered_G.nodes()]
edge_weight_ls = [0.5*Top_n_auth_filtered_G.edge[a][b]['weight'] for a, b in Top_n_auth_filtered_G.edges()]
```

```python
plt.figure(figsize=(18,12))
pos = nx.spring_layout(Top_n_auth_filtered_G)
nx.draw(Top_n_auth_filtered_G, pos, node_size=node_size_ls, width=edge_weight_ls)
nx.draw_networkx_labels(Top_n_auth_filtered_G, pos, node_size=node_size_ls, width=edge_weight_ls);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_68_0.png" title="top 8 authors filtered graph" width="900" %}

Unfortunately, the plotting algorithm changes the position of the clusters once the network changes and we need to pay attention to which cluster we are referring to, but the overall considerations made before are reinforced by the analysis of this last plot.

#### Middle authors graph

As additional analyis, I am going to explore the clustering of middle authors only. That is, I would like to see how the top 8 authors, but middle author retraction count, are connected to the rest of the author population.

```python
mddl_author_ls = list(set(adj_author_summary_df['author_name'][adj_author_summary_df['middle_author']==1]))
mddl_article_ID_ls = list(set(adj_author_summary_df['ID'][adj_author_summary_df['middle_author']==1]))
mddl_author_label_dc = dict(zip(mddl_author_ls, range(len(mddl_author_ls))))
author_retraction_count_dc = dict(zip(list(auth_df['author_name']), list(auth_df['count'])))
author_retraction_first_dc = dict(zip(list(auth_df['author_name']), list(auth_df['first_author'])))
author_retraction_last_dc = dict(zip(list(auth_df['author_name']), list(auth_df['last_author'])))
author_retraction_middle_dc = dict(zip(list(auth_df['author_name']), list(auth_df['middle_author'])))
```

```python
mddl_adj_author_summary_df = adj_author_summary_df[adj_author_summary_df['middle_author']==1]
mddl_edge_weight_dbl_dc = build_edge_weight_dc(mddl_article_ID_ls, mddl_adj_author_summary_df,
                                               mddl_author_label_dc, double=True)
```

```python
G = nx.Graph()

for auth in mddl_author_ls:
    G.add_node(auth, count=author_retraction_count_dc[auth])
    G.add_node(auth, first=author_retraction_first_dc[auth])
    G.add_node(auth, last=author_retraction_last_dc[auth])
    G.add_node(auth, middle=author_retraction_middle_dc[auth])
#end
for co_authors in mddl_edge_weight_dbl_dc:
    G.add_edge(*co_authors, weight=mddl_edge_weight_dbl_dc[co_authors])
#end
```

```python
Top_n_mddl_auth_G = G.copy()

n = 8

temp_df = auth_df.sort_values(by='middle_author', ascending=False).reset_index(drop=True)

top_n_auth_ls = list(set((temp_df['author_name'].head(n))))
top_n_auth_connection_ls = top_n_auth_ls

for auth in top_n_auth_ls:
    top_n_auth_connection_ls = top_n_auth_connection_ls + G.edge[auth].keys()
#end

top_n_auth_connection_ls = list(set(top_n_auth_connection_ls))
discard_ls = [auth for auth in author_ls if auth not in top_n_auth_connection_ls]
Top_n_mddl_auth_G.remove_nodes_from(discard_ls)

node_size_ls = [50*Top_n_mddl_auth_G.node[a]['count'] for a in Top_n_mddl_auth_G.nodes()]
edge_weight_ls = [0.5*Top_n_mddl_auth_G.edge[a][b]['weight'] for a, b in Top_n_mddl_auth_G.edges()]
```

```python
plt.figure(figsize=(18,12))
pos = nx.spring_layout(Top_n_mddl_auth_G)
nx.draw(Top_n_mddl_auth_G, pos, node_size=node_size_ls, width=edge_weight_ls)
nx.draw_networkx_labels(Top_n_mddl_auth_G, pos, node_size=node_size_ls, width=edge_weight_ls);
```

{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_76_0.png" title="top 8 middle authors graph" width="900" %}

That is some pretty graph. Let us see if we can make sense of it.

 - Once again, we can identify a number of clusters smaller than 8, 4 precisely.
 - A pattern of "teams" of middle authors appear to arise, with some people having the tendency to participate in each other's retracted papers.
 - A few authors appear to bridge across teams and co-author retracted papers in different areas or across different research groups

## Concluding remarks and future analyses

We explore a nice dataset and drew some interesting insights even at this stage where we primarily confined our investigation to some descriptive statistics and plots. A few more questions can be asked - and answered! - by this dataset, such as the distribution of retractions over areas of study, or geography, as well as the evolution over time of the retraction statistics and network. With some additional data, we could compare the statistics we found here with some baseline, as well as analyze the impact of the retractions on the scientific world (via, for instance, citation count).

## Appendix

### Dataset parsing

I downloaded the dataset in bibtex format, so I needed a bibtex parser to extract the relevant information and start working on it. I here use the BibTexParser python library, with some additional customization.

```python
#*******************************
# Importing packages
#*******************************
import os
import sys
import ast
import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import *
#*******************************
%matplotlib inline
```

```python
def customizations(record):
    """
    Input record: a record
    Output: customized record
    """
    record = type(record)
    record = author(record)
    record = editor(record)
    record = journal(record)
    record = keyword(record)
    record = link(record)
    record = page_double_hyphen(record)
    record = doi(record)
    return record
#end
```

A few functions to parse the files (obviously, I first looked into what the parser would spit back, in order to understand what I had to work with, but I am saving that analysis to the reader) and build a nice dictionary from which to produce a Pandas DataFrame.

```python
def get_retraction_list():
    n_files = 9
    base_filename = 'retraction_records_' #the name I gave to my downloaded files
    retraction_ls = list()

    parser = BibTexParser()
    parser.customization = customizations

    for ifile in range(1, n_files+1):
        filename = base_filename + str(ifile).zfill(2) + '.bib'
        with open(filename) as rec_file:
            recs_str = rec_file.read()
        #end
        retraction_ls.extend(bibtexparser.loads(recs_str, parser=parser).entries)
    #end
    return retraction_ls
#end

def build_retraction_dc(retraction_ls):
    full_key_ls = list()
    for rec in retraction_ls:
        full_key_ls.extend(rec.keys())
    #end
    full_key_ls = list(set(full_key_ls))

    rec_dc = dict()
    for key in full_key_ls:
        rec_dc[key] = list()
    #end

    for retraction_dc in retraction_ls:
        for key in rec_dc.keys():
            if key in retraction_dc.keys():
                rec_dc[key].append(retraction_dc[key])
            else:
                rec_dc[key].extend([None])
            #end
        #end
    #end
    return rec_dc
#end
```

### Building the DataFrames

```python
retraction_ls = get_retraction_list()
rec_dc = build_retraction_dc(retraction_ls)
retractions_df = pd.DataFrame(data=rec_dc)
```

Ok, let us see what it looks like.

```python
retractions_df.head(1)
```

      ENTRYTYPE
      ID
      abstract
      address
      affiliation
      article-number
      author
      author-email
      booktitle
      doc-delivery-number
      ...
      series
      times-cited
      title
      type
      unique-id
      usage-count-(last-180-days)
      usage-count-since-2013
      volume
      web-of-science-categories
      year

      article
      ISI:000385601300067
      None
      THE BOULEVARD, LANGFORD LANE, KIDLINGTON, OXFO...
      Ashokkumar, S (Reprint Author), Annamalai Univ...
      None
      [Ashokkumar, S., Ravi, S., Kathiravan, V., Vel...
      None
      None
      DZ1MA
      ...
      None
      0
      Synthesis of silver nanoparticles using A. ind...
      correction
      ISI:000385601300067
      3
      3
      171
      Spectroscopy
      2017

1 rows × 43 columns

Still too much information. Let us try to extract only the fields that are relevant to us and reformat them to make our life easier.
A few classes may help us do that.

```python
class AuthorsExtractor():
    '''
    '''

    def __init__(self):
        pass
    #end

    def get_first_author(self, author_ls):
        if isinstance(author_ls, list):
            return author_ls[0]
        else:
            return None
        #end
    #end

    def get_last_author(self, author_ls):
        if isinstance(author_ls, list):
            if len(author_ls)>1:
                return author_ls[-1]
            else:
                return None
            #end
        else:
            return None
        #end
    #end

    def get_second_author(self, author_ls):
        if isinstance(author_ls, list):
            if len(author_ls)>2:
                return author_ls[1]
            else:
                return None
            #end
        else:
            return None
        #end
    #end

    def get_middle_authors(self, author_ls):
        if isinstance(author_ls, list):
            if len(author_ls)>2:
                return author_ls[1:-1]
            else:
                return None
            #end
        else:
            return None
        #end
    #end

#end

class TitleExtractor():
    '''
    '''

    def __init__(self):
        pass
    #end

    def get_title(self, title):
        if title[:14]=='Retraction of ':
            title = title.replace('Retraction of ', '').replace('\n', ' ')
        elif title[:11]=='Retraction:':
            title = title.replace('Retraction: ', '').replace('\n', ' ')
        else:
            title = title.replace('retraction', 'Retraction')
            title = title.split('Retraction ')[0].strip('()').replace('\n', ' ')
        return title
    #end

    def get_year_published(self, title):
        title = title.replace(' Statement of Retraction', '')
        try:
            year = int(title.replace(' )', ')').strip('()')[-4:])
        except:
            year = -9999
        #end
        return year
    #end

#end
```

Let us build a summary DataFrame now.

```python
def build_summary_df(df):
    '''
    '''
    to_copy_ls = ['ID', 'author', 'journal-iso', 'title', 'publisher', \
                  'times-cited', 'number-of-cited-references', 'usage-count-since-2013', \
                  'usage-count-(last-180-days)', 'web-of-science-categories']
    s_df = df[to_copy_ls].copy(deep=True)
    ae = AuthorsExtractor()
    s_df['first_author'] = s_df['author'].apply(lambda x: ae.get_first_author(x))
    s_df['last_author'] = s_df['author'].apply(lambda x: ae.get_last_author(x))
    s_df['second_author'] = s_df['author'].apply(lambda x: ae.get_second_author(x))
    s_df['middle_authors'] = s_df['author'].apply(lambda x: ae.get_middle_authors(x))
    s_df['month_retracted'] = df['month'].apply(lambda x: str(x)[0:4])
    s_df['year_retracted'] = df['year']
    s_df['title'] = df['title'].apply(lambda s: TitleExtractor().get_title(s))
    s_df['year_published'] = df['title'].apply(lambda s: TitleExtractor().get_year_published(s))
    s_df.drop('author', axis=1, inplace=True)
    s_df['retraction_count'] = 1
    int_ls = ['year_published', 'year_retracted', 'times-cited', 'number-of-cited-references', \
              'usage-count-since-2013', 'usage-count-(last-180-days)', 'retraction_count']
    str_ls =  [field for field in s_df.columns if field not in int_ls]
    s_df[int_ls] = s_df[int_ls].astype(int)
    s_df[str_ls] = s_df[str_ls].astype(str)
    return s_df
#end
```

```python
summary_df = build_summary_df(retractions_df)
```

```python
summary_df.head(1)
```

      ID
      journal-iso
      title
      publisher
      times-cited
      number-of-cited-references
      usage-count-since-2013
      usage-count-(last-180-days)
      web-of-science-categories
      first_author
      last_author
      second_author
      middle_authors
      month_retracted
      year_retracted
      year_published
      retraction_count

      0
      ISI:000385601300067
      Spectroc. Acta Pt. A-Molec. Biomolec. Spectr.
      Synthesis of silver nanoparticles using A. ind...
      PERGAMON-ELSEVIER SCIENCE LTD
      0
      1
      3
      3
      Spectroscopy
      Ashokkumar, S.
      Velmurugan, S.
      Ravi, S.
      [u'Ravi, S.', u'Kathiravan, V.']
      JAN
      2017
      2014
      1

Much better!
Ok, now we can start digging into the data and get a feeling of what may be going on.

### Some preliminary analyses

Let us start with some simple aggregate statistics.

```python
summary_df.groupby(['first_author']).agg({'retraction_count': 'count'}).sort_values(by='retraction_count',
                                                                                ascending=False).head(4)
```

      retraction_count

      first_author

      {[}Anonymous],
      154

      Fujii, Y.
      46

      Fujii, Yoshitaka
      36

      Schon, JH
      32

```python
summary_df.groupby(['second_author']).agg({'retraction_count': 'count'}).sort_values(by='retraction_count',
                                                                                ascending=False).head(4)
```

      retraction_count

      second_author

      None
      1504

      Kloc, C
      19

      Saitoh, Y.
      14

      Uemura, A.
      7

```python
summary_df.groupby(['last_author']).agg({'retraction_count': 'count'}).sort_values(by='retraction_count',
                                                                                ascending=False).head(4)
```

      retraction_count

      last_author

      None
      871

      Toyooka, H.
      28

      Batlogg, B
      21

      Kato, Shigeaki
      16

```python
journal_ls = ['Nature', 'Science', 'Cell']
summary_df[summary_df['journal-iso'].isin(journal_ls)].groupby(['journal-iso',
                                                                'year_published']).agg({'retraction_count':
                                                                                'count'}).head(4)
```

      retraction_count

      journal-iso
      year_published

      Cell
      2000
      2

      2002
      2

      2003
      3

      2004
      1

```python
summary_df.groupby(['year_published']).agg({'retraction_count': 'count'}).sort_values(by='retraction_count',
                                                                                ascending=False).head(6)
```

      retraction_count

      year_published

      2012
      384

      2010
      373

      2014
      346

      2009
      344

      2013
      331

      2008
      317

```python
summary_df.groupby(['year_retracted']).agg({'retraction_count': 'count'}).sort_values(by='retraction_count',
                                                                                ascending=False).head(6)
```

      retraction_count

      year_retracted

      2015
      613

      2013
      516

      2016
      511

      2014
      446

      2012
      413

      2011
      395

Let us now see what are the typical numbers of authors in the retracted papers.

```python
def n_authors_dist_df(ret_df):
    '''
    '''
    n_auth_dc = dict()
    for iloc in range(len(ret_df)):
        n_auth = 1
        if ret_df['last_author'].iloc[iloc]!='None':
            n_auth = n_auth + 1
        #end
        if ret_df['middle_authors'].iloc[iloc]!='None':
            n_auth = n_auth + len(ast.literal_eval(ret_df['middle_authors'].iloc[iloc]))
        #end
        if ret_df['first_author'].iloc[iloc]=='{[}Anonymous], ':
            n_auth = 0
        #end
        if str(n_auth) in n_auth_dc.keys():
            n_auth_dc[str(n_auth)] = n_auth_dc[str(n_auth)] + 1
        else:
            n_auth_dc[str(n_auth)] = 1
        #end
    #end
    n_auth_dist_df = pd.DataFrame(data={'n_authors': n_auth_dc.keys(), 'n_retractions': n_auth_dc.values()})
    n_auth_dist_df['n_authors'] = n_auth_dist_df['n_authors'].astype(int)
    n_auth_dist_df['n_rel_retractions'] = 1.0*n_auth_dist_df['n_retractions']/n_auth_dist_df['n_retractions'].sum()
    return n_auth_dist_df.sort_values(by='n_authors').reset_index(drop=True)
#end
```

```python
n_auth_dist_df = n_authors_dist_df(summary_df)
```

```python
n_auth_dist_df.sort_values(by='n_authors').head(8)
```

      n_authors
      n_retractions
      n_rel_retractions

      0
      0
      154
      0.035273

      1
      1
      717
      0.164224

      2
      2
      633
      0.144984

      3
      3
      657
      0.150481

      4
      4
      581
      0.133074

      5
      5
      425
      0.097343

      6
      6
      359
      0.082226

      7
      7
      250
      0.057261

```python
sns.barplot(x="n_authors", y="n_rel_retractions", data=n_auth_dist_df[n_auth_dist_df['n_authors']!=0]);
```
{% include image.html img="images/retraction_analysis_post/retraction_analysis_post_36_0.png" title="retraction distribution vs number of authors" width="900" %}

### Building the network

```python
def build_edge_weight_dc(article_ID_ls, adj_author_summary_df, author_label_dc, double=False):
    edge_weight_dc = dict()
    for art_id in article_ID_ls:
        art_auth_ls = list(adj_author_summary_df['author_name'][adj_author_summary_df['ID']==art_id])
        if 'None' in art_auth_ls:
            art_auth_ls.remove('None')
        #end
        if '{[}Anonymous], ' in art_auth_ls:
            art_auth_ls.remove('{[}Anonymous], ')
        #end
        if len(art_auth_ls)>1:
            for index, a1 in enumerate(art_auth_ls):
                if double:
                    for a2 in art_auth_ls:
                        if author_label_dc[a1]!=author_label_dc[a2]:
                            if (a1, a2) in edge_weight_dc:
                                edge_weight_dc[(a1, a2)] = edge_weight_dc[(a1, a2)] + 1
                            else:
                                edge_weight_dc[(a1, a2)] = 1
                            #end
                        #end
                    #end
                else:
                    for a2 in art_auth_ls[index+1:]:
                        if author_label_dc[a1]<author_label_dc[a2]:
                            if (a1, a2) in edge_weight_dc:
                                edge_weight_dc[(a1, a2)] = edge_weight_dc[(a1, a2)] + 1
                            else:
                                edge_weight_dc[(a1, a2)] = 1
                            #end
                        #end
                    #end
                #end
            #end
        #end
    #end
    return edge_weight_dc
#end
```

```python
author_ls = list(set(adj_author_summary_df['author_name']))
author_ls.remove('None')
author_ls.remove('{[}Anonymous], ')
article_ID_ls = list(set(adj_author_summary_df['ID']))
author_label_dc = dict(zip(author_ls, range(len(author_ls))))
author_retraction_count_dc = dict(zip(list(auth_df['author_name']), list(auth_df['count'])))
author_retraction_first_dc = dict(zip(list(auth_df['author_name']), list(auth_df['first_author'])))
author_retraction_last_dc = dict(zip(list(auth_df['author_name']), list(auth_df['last_author'])))
author_retraction_middle_dc = dict(zip(list(auth_df['author_name']), list(auth_df['middle_author'])))
```

#### Engineer the author DataFrame and fix the naming issues

```python
def list_of_el_in_two_lists(list1, list2):
    el_in_2_ls = []
    for el in list1:
        if el in list2:
            el_in_2_ls.append(el)
        #end
    #end
    return el_in_2_ls
#end
def flatten_list(nest_ls):
    flat_list = []
    for el in nest_ls:
        if el is None or el=='Nemo':
            pass
        elif isinstance(el, list):
            flat_list.extend(flatten_list(el))
        else:
            flat_list.append(el)
        #end
    #end
    return flat_list
#end
```

```python
first_auth_set = list(set(list(summary_df['first_author'])))
last_auth_set = list(set(list(summary_df['last_author'])))
middle_auth_set = list(set(flatten_list(summary_df['middle_authors'].apply(lambda x: ast.literal_eval(x)))))

first_or_last_ls = list_of_el_in_two_lists(first_auth_set, last_auth_set)
fist_or_middle_ls = list_of_el_in_two_lists(first_auth_set, middle_auth_set)
last_or_middle_ls = list_of_el_in_two_lists(last_auth_set, middle_auth_set)
all_positions_ls = list_of_el_in_two_lists(first_or_last_ls, middle_auth_set)
some_multiple_ls = list(set(first_or_last_ls + fist_or_middle_ls + last_or_middle_ls))
all_authors_ls = list(set(first_auth_set + middle_auth_set + last_auth_set))
```

```python
field_ls = ['ID', 'journal-iso', 'title', 'web-of-science-categories', 'first_author', 'last_author', 'middle_authors']
unpacked_df = summary_df[field_ls]
unpacked_df['middle_authors'] = unpacked_df['middle_authors'].apply(lambda x: ast.literal_eval(x) \
                                                                    if x!='None' else list())
unpacked_summary_df = pd.concat([pd.DataFrame(dict(zip(unpacked_df.columns,
                                                       unpacked_df.ix[i]))) for i in range(len(unpacked_df))])

```

```python
author_summary_dc = {'author_name': [], 'title': [], 'ID': [], 'wos_categories': [], 'first_author': [],
                     'last_author': [], 'middle_author': []}
for author in all_authors_ls:
    first_author_article_id_ls = list(summary_df['ID'][summary_df['first_author']==author])
    if len(first_author_article_id_ls)>0:
        for article_id in first_author_article_id_ls:
            author_summary_dc['ID'].append(article_id)
            author_summary_dc['author_name'].append(author)
            author_summary_dc['first_author'].append(1)
            author_summary_dc['last_author'].append(0)
            author_summary_dc['middle_author'].append(0)
            author_summary_dc['title'].append(summary_df['title'][summary_df['ID']==article_id])
            author_summary_dc['wos_categories'].append(summary_df['web-of-science-categories'][summary_df['ID']==article_id])
        #end
    #end
    last_author_article_id_ls = list(summary_df['ID'][summary_df['last_author']==author])
    if len(last_author_article_id_ls)>0:
        for article_id in last_author_article_id_ls:
            author_summary_dc['ID'].append(article_id)
            author_summary_dc['author_name'].append(author)
            author_summary_dc['first_author'].append(0)
            author_summary_dc['last_author'].append(1)
            author_summary_dc['middle_author'].append(0)
            author_summary_dc['title'].append(summary_df['title'][summary_df['ID']==article_id])
            author_summary_dc['wos_categories'].append(summary_df['web-of-science-categories']\
                                                       [summary_df['ID']==article_id])
        #end
    #end
    middle_author_article_id_ls = list(unpacked_summary_df['ID'][unpacked_summary_df['middle_authors']==author])
    if len(middle_author_article_id_ls)>0:
        for article_id in middle_author_article_id_ls:
            author_summary_dc['ID'].append(article_id)
            author_summary_dc['author_name'].append(author)
            author_summary_dc['first_author'].append(0)
            author_summary_dc['last_author'].append(0)
            author_summary_dc['middle_author'].append(1)
            author_summary_dc['title'].append(unpacked_summary_df['title'][unpacked_summary_df['ID']==article_id])
            author_summary_dc['wos_categories'].append(unpacked_summary_df['web-of-science-categories']\
                                                       [unpacked_summary_df['ID']==article_id])
        #end
    #end
#end

author_summary_df = pd.DataFrame(data=author_summary_dc)
```

```python
author_summary_df.head(3)
```

      ID
      author_name
      first_author
      last_author
      middle_author
      title
      wos_categories

      0
      ISI:000315707300037
      Bose, Julie S.
      1
      0
      0
      1989    A Dihydrobenzofuran Lignan Induces Cel...
      1989    Chemistry, Medicinal
Name: web-of-scie...

      1
      ISI:000239914800070
      Rockley, M. G.
      0
      0
      1
      0    Theoretical investigation of the dissocia...
      0    Chemistry, Physical; Physics, Atomic, Mol...

      2
      ISI:000180655500059
      Onoda, N
      0
      0
      1
      0    A novel bone marrow stroma-derived growth...
      0    Immunology
1    Immunology
2    Immunolog...

```python
same_author_dc = {'Fujii, Yoshitaka': 'Fujii, Y.',
                  'Toyooka, Hidenori': 'Toyooka, H.',
                  'Tanaka, Hiroyoshi': 'Tanaka, H.',
                  'Saitoh, Yuhji': 'Saitoh, Y.',
                  'Stapel, Diederik A.': 'Stapel, D. A.',
                  'Stapel, D.': 'Stapel, D. A.',
                  'Mori, Naoki': 'Mori, N.',
                  'Kato, Shigeaki': 'Kato, S.',
                  'Aggarwal, Bharat B.': 'Aggarwal, B. B.',
                  'Boldt, Joachim': 'Boldt, J.',
                  'Hunton, James E.': 'Hunton, J. E.',
                  'Tomita, Mariko': 'Tomita, M.',
                  'Potti, Anil': 'Potti, A.',
                  'Khang, Gilson': 'Khang, G.',
                  'Zaman, Khalid': 'Zaman, K.',
                  'Rhee, John M.': 'Rhee, J. M.',
                   'Kitagawa, Hirochika': 'Kitagawa, H.',
                  'Lichtenthaler, Ulrich': 'Lichtenthaler, U.',
                  'Pease, Larry R.': 'Pease, L. R.',
                  }

adj_author_summary_df = author_summary_df.copy(deep=True)
for old_name, new_name in zip(same_author_dc.keys(), same_author_dc.values()):
    adj_author_summary_df['author_name'][adj_author_summary_df['author_name']==old_name] = new_name
#end
```

gha_language: SCSS


text:
uuid: caa13404-9243-493b-943e-9848cadb1f99
name: Office 365

## Overview
Office 365 is a line of subscription services offered by Microsoft as part of the Microsoft Office product line.

## Setup
This setup guide will show you how to forward events produced by Office 365 service to SEKOIA.IO.

Theses changes have to be made from the Azure web portal ([https://portal.azure.com](https://portal.azure.com)).

### 1. Event hubs

As a prerequisite you need an `Event Hubs` (e.g. company-eventhub) and to choose an existing `resourceGroup` or create a new one (e.g. company-resource-group).
You also need your `Subscription ID` if you don't have a default one.

Navigate to: `Home > Cost Management + Billing > Subscriptions`. From there, copy the relevant `Subscription ID` that will be used in the command line (e.g. uuid)

Then you use Azure powershell (within Cloud Shell interface for example): you will a create a global `Event Hubs`, then specific `Event Hub` (e.g. o365-event).

```powershell
PS Azure:\> az eventhubs namespace create --name company-eventhub --resource-group company-resource-group --enable-kafka true --subscription uuid

PS Azure:\> az eventhubs eventhub create --resource-group company-resource-group --namespace-name company-eventhub --name o365-event --message-retention 3 --partition-count 4 --subscription uuid
```

Navigate to: `Home > Event Hubs > company-eventhub - Shared access policies`. From there, you can create a policy (e.g. RootManageSharedAccessKey) with the claims `Manage`, `Send` and `Listen`, and note the `Primary Key` that will be used as the `SharedAccessKey`.

Navigate to: `Home > Event Hubs > company-eventhub > o365-event - Shared access policies`. From there, you can create a policy (e.g. sekoiaio-nifi) with the claims `Listen`. Once created, click on the policy and save the `Connection string-primary key`, to be sent to SEKOIA.IO.

Navigate to: `Home > Event Hubs > company-eventhub > o365-event - Consumer groups`. From there, you can create a consumer group (e.g. sekoiaio-nifi).

### 2. Office 365

Office 365 has to be added through Azure portal following the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/solution-office-365)

Then you need to activate and configure the Office 365 diagnostic settings.

Navigate to: `Home > Office 365 > Monitoring > Diagnostic settings`:

- Add a new diagnostic setting, and select `Stream to an event hub`and click on configure.
- Select the previously created `Event hubs`, `Event Hub` and `SharedAccessKey`.
- Choose a name for this configuration and click on `Save`.

### 3. Enjoy your events

You can send to Sekoia the `Connection string-primary key` previously mentioned.

Once the configuration has been done on Sekoia side, you can go to the [events page](https://app.sekoia.io/sic/events) to watch your incoming events.

## Further Readings

- [Microsoft Stream Azure monitoring data to an event hub](https://docs.microsoft.com/en-us/azure/azure-monitor/platform/stream-monitoring-data-event-hubs)

repository: qbourgue/documentation

repo_name: qbourgue/documentation


text:
# Algorithms
[![Java CI with Maven](https://github.com/nmuzychuk/algorithms/actions/workflows/maven.yml/badge.svg)](https://github.com/nmuzychuk/algorithms/actions/workflows/maven.yml)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/34ce58f5d3e4458fa64596699c09432c)](https://www.codacy.com/app/nmuzychuk/algorithms)

## Overview
Algorithms
- Bubble sort
- Selection sort
- Insertion sort
- Merge sort
- Bogosort
- Quicksort
 - Linear search
- Binary search
- Ternary search
- Naive shuffle
- Fisher–Yates shuffle

Data structures
- Stack
- Queue
- Priority queue
- Linked list
- Doubly linked list
- Binary search tree
- Hash table

## Test
Run tests
```
./mvnw test
```

## License
This project is released under the [MIT License](LICENSE.txt)

repository: nmuzychuk/algorithms

gha_language: Java

repo_name: nmuzychuk/algorithms


text:
# Development

* To test against all LDraw models, run `yarn test:create && yarn test __ldraw`

# References

[brigl](https://github.com/HazenBabcock/brigl) - Simple library

# Rollup

* [publish typescript module](https://blog.logrocket.com/publishing-node-modules-typescript-es-modules/)
* [js library works everywhere](https://medium.com/@adostes/authoring-a-javascript-library-that-works-everywhere-using-rollup-f1b4b527b2a9)

repository: jsonxr/ldraw

gha_language: TypeScript

repo_name: jsonxr/ldraw


text:
polyglot
========

Service and storage for Likeastore localization

## Localization files

All locales are stored into `/locales` folder. Filename should consist of local [two-letter ISO language code](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) with `.json` extension.

## REST API

Read all localized strings,

```
GET /api/texts/:lang_id
```

Read localized string by prefix,

```
GET /api/texts/:lang_id?pref=SITE
```

or by few prefixes, separated by comma,

```
GET /api/texts/:lang_id?pref=SITE,APP_DASHBOARD,APP_SETTINGS
```

# License

MIT

repository: likeastore/polyglot

repo_name: likeastore/polyglot