Skip to content

Instantly share code, notes, and snippets.

@gqqnbig
Last active December 10, 2020 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gqqnbig/b4816e90a60c21174a7ec26779be3cec to your computer and use it in GitHub Desktop.
Save gqqnbig/b4816e90a60c21174a7ec26779be3cec to your computer and use it in GitHub Desktop.
Pycharm External Documentation Configurations

I have to use Chrome extension Requestly to deal with the paths of some libraries.

Due to the removal of the export function in the free version of Requestly, I'm not going to update these Requestly rules. Please let me know if you like another form of solution! (https://app.requestly.io/pricing)

Tensorflow

tensorflow_core: https://www.tensorflow.org/api_docs/python/{element.qname.slashes}#{functionToProperty.name}

Import the shared rule to Requestly: https://app.requestly.io/rules/#sharedList/1605688738767-Pycharm or import the following text version.

[
  {
    "creationDate": 1605688040286,
    "description": "",
    "groupId": "",
    "id": "Redirect_1605688040286",
    "isSample": false,
    "name": "tensorflow API",
    "objectType": "rule",
    "pairs": [
      {
        "destination": "https://www.tensorflow.org/api_docs/python/tf/$2",
        "source": {
          "filters": {},
          "key": "Url",
          "operator": "Matches",
          "value": "/https:\\/\\/www.tensorflow.org\\/api_docs\\/python\\/tensorflow_core\\/(python\\/)?(.+)$/i"
        }
      },
      {
        "destination": "https://www.tensorflow.org/api_docs/python/tf/$1#$2",
        "source": {
          "filters": {},
          "key": "Url",
          "operator": "Matches",
          "value": "/https:\\/\\/www\\.tensorflow\\.org\\/api_docs\\/python\\/tf\\/(.+)\\/(\\w+)#\\2$/i"
        }
      },
      {
        "destination": "$1/optimizers/$2",
        "source": {
          "filters": {},
          "key": "Url",
          "operator": "Matches",
          "value": "/(.+?)\\/optimizer_v2\\/\\w+\\/(.+)/i"
        }
      }
    ],
    "ruleType": "Redirect",
    "status": "Active"
  },
  {
    "creationDate": 1605875268105,
    "description": "",
    "groupId": "",
    "id": "Replace_1605875268105",
    "isSample": false,
    "name": "Tensorflow API replace",
    "objectType": "rule",
    "pairs": [
      {
        "from": "ops/dataset_ops/DatasetV2",
        "source": {
          "filters": {},
          "key": "Url",
          "operator": "Contains",
          "value": "www.tensorflow.org"
        },
        "status": "Inactive",
        "to": "Dataset"
      },
      {
        "from": "ops/dataset_ops/DatasetV1",
        "source": {
          "filters": {},
          "key": "Url",
          "operator": "Contains",
          "value": "www.tensorflow.org"
        },
        "status": "Inactive",
        "to": "Dataset"
      }
    ],
    "ruleType": "Replace",
    "status": "Active",
    "version": 2
  }
]

Not going to China from tensorflow.org

Chinese docs uses links pointing tensorflow.google.cn instead of www.tensorflow.org. If you don't like being extradited to China, add the following rule.

[
  {
    "creationDate": 1605860688972,
    "description": "",
    "groupId": "",
    "id": "Replace_1605860688972",
    "isSample": false,
    "name": "No extradition to China",
    "objectType": "rule",
    "pairs": [
      {
        "from": "tensorflow.google.cn",
        "source": {
          "filters": {},
          "key": "host",
          "operator": "Contains",
          "value": "tensorflow.google.cn"
        },
        "status": "Inactive",
        "to": "www.tensorflow.org"
      }
    ],
    "ruleType": "Replace",
    "status": "Active",
    "version": 2
  }
]

keras-tuner

kerastuner: https://keras-team.github.io/keras-tuner/documentation/tuners/#{class.name}-class (imperfect)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment