This file contains 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
from snowfakery.utils.randomized_range import random_range | |
countries = ["Canada", "Mexico", "United States", "Japan", "China"] * 1_000_000 | |
def shuffle_sequence(sequence): | |
indexes = random_range(0, len(sequence)) | |
for index in indexes: | |
yield sequence[index] | |
This file contains 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
<p>Plug-in coding conventions</p> | |
<p>To ensure custom plug-ins work well with the core toolkit code and | |
remain compatible with future releases, the DITA Open Toolkit project | |
recommends that plug-ins use modern development practices and common | |
coding patterns.</p> | |
<p>Best practices</p> | |
<p>Adhering to certain development practices will properly isolate your | |
code from that of DITA Open Toolkit. This will make it easier to you to | |
upgrade to new versions of DITA-OT when they are released.</p> | |
<ul> |
This file contains 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
Plug-in coding conventions | |
To ensure custom plug-ins work well with the core toolkit code and remain compatible with future releases, the DITA Open Toolkit project recommends that plug-ins use modern development practices and common coding patterns. | |
Best practices | |
Adhering to certain development practices will properly isolate your code from that of DITA Open Toolkit. This will make it easier to you to upgrade to new versions of DITA-OT when they are released. | |
* Use a properly-constructed DITA-OT plug-in. | |
* Use a version control system to store your code. |
This file contains 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
['UserProvisioningRequest.ParentId', 'UserProvisioningRequest'] | |
['OrgMetricScanSummary', 'OrgMetricScanSummary.OrgMetricId', 'OrgMetric', 'OrgMetric.LatestOrgMetricScanSummaryId'] | |
['RefundLinePayment', 'RefundLinePayment.AssociatedRefundLinePaymentId'] | |
['PaymentLineInvoice.AssociatedPaymentLineId', 'PaymentLineInvoice'] | |
['FeedComment', 'FeedComment.ThreadParentId'] | |
['NavigationMenuItem.DraftRowId', 'NavigationMenuItem'] | |
['NavigationMenuItem', 'NavigationMenuItem.ParentId'] | |
['ContentFolder', 'ContentFolder.ParentContentFolderId'] | |
['CategoryNode', 'CategoryNode.ParentId'] | |
['ContentVersion.FirstPublishLocationId', 'CollaborationGroup', 'CollaborationGroup.AnnouncementId', 'Announcement', 'Announcement.FeedItemId', 'FeedItem', 'FeedItem.RelatedRecordId', 'ContentVersion'] |
This file contains 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
# cci org shell qa --script find_cycles.py | |
import networkx | |
from cumulusci.salesforce_api.org_schema import get_org_schema | |
def look_for_cycles(sf, org_config): | |
G = networkx.DiGraph() | |
with get_org_schema(sf, org_config) as org_schema: |
This file contains 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
Building wheel for fastnumbers (setup.py) ... error | |
ERROR: Command errored out with exit status 1: | |
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u6un7_3p/fastnumbers/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u6un7_3p/fastnumbers/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-yjvat2p7 --python-tag cp38 | |
cwd: /tmp/pip-install-u6un7_3p/fastnumbers/ | |
Complete output (17 lines): | |
running bdist_wheel | |
running build | |
running build_ext | |
building 'fastnumbers' extension | |
creating build |
This file contains 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
$ python | |
Python 3.6.8 (default, Feb 19 2019, 17:13:58) | |
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from ast import literal_eval | |
>>> literal_eval("100-20") | |
80 | |
>>> | |
$ pyenv shell 3.8.0 |
This file contains 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
$ pyenv shell 3.6.8 | |
$ pip install jinja2 | |
Collecting jinja2 | |
Using cached https://files.pythonhosted.org/packages/65/e0/eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b/Jinja2-2.10.3-py2.py3-none-any.whl | |
Collecting MarkupSafe>=0.23 (from jinja2) | |
Downloading https://files.pythonhosted.org/packages/f0/00/a6aea33f5598b080b86d6b6d1214b51afe3ffa6100b902d5aa465080083f/MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl | |
Installing collected packages: MarkupSafe, jinja2 | |
Successfully installed MarkupSafe-1.1.1 jinja2-2.10.3 | |
You are using pip version 18.1, however version 19.3.1 is available. | |
You should consider upgrading via the 'pip install --upgrade pip' command. |
This file contains 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
INTERNALERROR> Traceback (most recent call last): | |
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/main.py", line 187, in wrap_session | |
INTERNALERROR> config._do_configure() | |
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/config/__init__.py", line 720, in _do_configure | |
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) | |
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/hooks.py", line 308, in call_historic | |
INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs) | |
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec | |
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) | |
INTERNALERROR> File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda> |
This file contains 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
File "/Users/pprescod/code/envs/metaci-py/bin/pytest", line 10, in <module> | |
sys.exit(main()) | |
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/config/__init__.py", line 71, in main | |
config = _prepareconfig(args, plugins) | |
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/_pytest/config/__init__.py", line 221, in _prepareconfig | |
pluginmanager=pluginmanager, args=args | |
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__ | |
return self._hookexec(self, self.get_hookimpls(), kwargs) | |
File "/Users/pprescod/code/envs/metaci-py/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec | |
return self._inner_hookexec(hook, methods, kwargs) |
NewerOlder