This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react' | |
| import { UserResponse } from '../shared/UserAPI' | |
| import { getWindowVar } from './util' | |
| export class CrispChat extends React.Component<{ user?: UserResponse }> { | |
| async componentDidMount() { | |
| // @ts-ignore | |
| if (typeof window !== 'undefined' && !window['$crisp']) { | |
| this.addMainScript() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from time import sleep | |
| from bs4 import BeautifulSoup | |
| from kafka import KafkaConsumer, KafkaProducer | |
| def publish_message(producer_instance, topic_name, key, value): | |
| try: | |
| key_bytes = bytes(key, encoding='utf-8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| def _map_to_pandas(rdds): | |
| """ Needs to be here due to pickling issues """ | |
| return [pd.DataFrame(list(rdds))] | |
| def toPandas(df, n_partitions=None): | |
| """ | |
| Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is | |
| repartitioned if `n_partitions` is passed. |