add more
This commit is contained in:
parent
9d4397aa4a
commit
387339bf17
@ -62,7 +62,7 @@ Rabit provides different reduction operators, for example, if you change ```op:
|
|||||||
the reduction operation will be a summation, and the result will become ```a = {1, 3, 5}```.
|
the reduction operation will be a summation, and the result will become ```a = {1, 3, 5}```.
|
||||||
You can also run the example with different processes by setting -n to different values.
|
You can also run the example with different processes by setting -n to different values.
|
||||||
|
|
||||||
If you are more familiar with python, you can also use rabit in python. The same example as before can be found in [basic.py](basic.py):
|
If you are more familiar with python, you can also use rabit in python. The same example as before can be found in [basic.py](../guide/basic.py):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|||||||
@ -14,13 +14,19 @@ from recom import parser
|
|||||||
|
|
||||||
class MarkdownParser(parser.CommonMarkParser):
|
class MarkdownParser(parser.CommonMarkParser):
|
||||||
github_doc_root = None
|
github_doc_root = None
|
||||||
|
doc_suffix = set(['md', 'rst'])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def remap_url(url):
|
def remap_url(url):
|
||||||
if MarkdownParser.github_doc_root is None or url is None:
|
if MarkdownParser.github_doc_root is None or url is None:
|
||||||
return url
|
return url
|
||||||
|
if url.startswith('#'):
|
||||||
|
return url
|
||||||
arr = url.split('#', 1)
|
arr = url.split('#', 1)
|
||||||
if arr[0].endswith('.md') and arr[0].find('://') == -1:
|
ssuffix = arr[0].rsplit('.', 1)
|
||||||
|
|
||||||
|
if len(ssuffix) == 2 and (ssuffix[-1] in MarkdownParser.doc_suffix
|
||||||
|
and arr[0].find('://') == -1):
|
||||||
arr[0] = arr[0][:-3] + '.html'
|
arr[0] = arr[0][:-3] + '.html'
|
||||||
return '#'.join(arr)
|
return '#'.join(arr)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user