instance_id stringlengths 10 57 | file_changes listlengths 1 15 | repo stringlengths 7 53 | base_commit stringlengths 40 40 | problem_statement stringlengths 11 52.5k | patch stringlengths 251 7.06M |
|---|---|---|---|---|---|
numba__numba-6403 | [
{
"changes": {
"added_entities": [
"numba/core/types/containers.py:ListType.key"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"numba/core/types/containers.py:ListType"
]
},
"file": "numba/core/types/containers.py"
}
] | numba/numba | a812eed4dd23aa6ebb4bbea391b63dafdd912832 | `ListType` needs to implement `key`
- [x] I have tried using the latest released version of Numba (most recent is
visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
- [x] I have included below a minimal working reproducer (if you are unsure how
to write one see http://matthewrocklin... | diff --git a/numba/core/types/containers.py b/numba/core/types/containers.py
index 6191852af..e16aae402 100644
--- a/numba/core/types/containers.py
+++ b/numba/core/types/containers.py
@@ -627,6 +627,10 @@ class ListType(IterableType):
name = "{}[{}]".format(self.__class__.__name__, itemty,)
super(Lis... |
numba__numba-6490 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numba/stencils/stencil.py:StencilFunc._stencil_wrapper"
],
"edited_modules": [
"numba/stencils/stencil.py:StencilFunc"
]
},
"file": "numba/stencils/stencil.py"
},
{... | numba/numba | 6e2168a0e3d5bcc4bcc2abf76c42f2da8bd9b369 | stencil kernel performance not scaling in njit(parallel=True)
<!--
Thanks for opening an issue! To help the Numba team handle your information
efficiently, please first ensure that there is no other issue present that
already describes the issue you have
(search at https://github.com/numba/numba/issues?&q=is%3Ais... | diff --git a/numba/stencils/stencil.py b/numba/stencils/stencil.py
index 4c30bd2dd..b22a3abec 100644
--- a/numba/stencils/stencil.py
+++ b/numba/stencils/stencil.py
@@ -602,18 +602,25 @@ class StencilFunc(object):
if result is None:
return_type_name = numpy_support.as_dtype(
... |
numba__numba-6582 | [
{
"changes": {
"added_entities": [
"numba/core/cgutils.py:sizeof",
"numba/core/cgutils.py:memset_padding"
],
"added_modules": [
"numba/core/cgutils.py:sizeof",
"numba/core/cgutils.py:memset_padding"
],
"edited_entities": [
"numba/core/cgutils... | numba/numba | 0bac18af44d08e913cd512babb9f9b7f6386d30a | Dicts with tuple keys not working in 0.52.0
I’m using a dict with a tuple as the key which worked fine in 0.51.2, but does not work in 0.52.0:
```
import numpy as np
import numba
@numba.njit
def testdict(tuptype):
tdict = numba.typed.Dict.empty(tuptype, numba.core.types.float32)
t1 = np.array([3], dt... | diff --git a/numba/core/cgutils.py b/numba/core/cgutils.py
index 45c58e9f2..f62216365 100644
--- a/numba/core/cgutils.py
+++ b/numba/core/cgutils.py
@@ -373,20 +373,28 @@ def alloca_once(builder, ty, size=None, name='', zfill=False):
with builder.goto_entry_block():
ptr = builder.alloca(ty, size=size, nam... |
numba__numba-6584 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "numba/__init__.py"
}
] | numba/numba | 0bac18af44d08e913cd512babb9f9b7f6386d30a | from numba import * fails due to jitclass still being in __all__
5f7ecf3bbfdf25b55f663f5278e4e31ad6fdde4c removes `jitclass` from the `numba` namespace, but `__init__.py`'s `__all__` still contains `jitclass`, causing `from numba import *` to fail. | diff --git a/numba/__init__.py b/numba/__init__.py
index 808ac73e9..30866eaa7 100644
--- a/numba/__init__.py
+++ b/numba/__init__.py
@@ -66,7 +66,6 @@ __all__ = """
njit
stencil
jit_module
- jitclass
typeof
prange
gdb
|
numba__numba-6586 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numba/core/compiler.py:DefaultPassBuilder.define_untyped_pipeline"
],
"edited_modules": [
"numba/core/compiler.py:DefaultPassBuilder"
]
},
"file": "numba/core/compiler.... | numba/numba | 0bac18af44d08e913cd512babb9f9b7f6386d30a | Unexpected behaviour of `and` in guvectorize returned from factory function (bad specialisation of bool as int64?)
- [x] I have tried using the latest released version of Numba (most recent is
visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
- [x] I have included a self contained co... | diff --git a/numba/core/compiler.py b/numba/core/compiler.py
index 163292f9e..a0c03fdb3 100644
--- a/numba/core/compiler.py
+++ b/numba/core/compiler.py
@@ -514,14 +514,17 @@ class DefaultPassBuilder(object):
pm.add_pass(IRProcessing, "processing IR")
pm.add_pass(WithLifting, "Handle with contexts")
... |
numba__numba-6622 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numba/core/byteflow.py:TraceRunner._build_tuple_unpack"
],
"edited_modules": [
"numba/core/byteflow.py:TraceRunner"
]
},
"file": "numba/core/byteflow.py"
},
{
"... | numba/numba | 77a5b6333d91635bd16911225dca52a2f3d78425 | bytecode analysis failure with `BUILD_TUPLE_UNPACK`.
<!--
Thanks for opening an issue! To help the Numba team handle your information
efficiently, please first ensure that there is no other issue present that
already describes the issue you have
(search at https://github.com/numba/numba/issues?&q=is%3Aissue).
... | diff --git a/numba/core/byteflow.py b/numba/core/byteflow.py
index 69abff298..f84ac33b9 100644
--- a/numba/core/byteflow.py
+++ b/numba/core/byteflow.py
@@ -846,7 +846,14 @@ class TraceRunner(object):
# Builds tuple from other tuples on the stack
tuples = list(reversed([state.pop() for _ in range(inst... |
numba__numba-6635 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numba/core/untyped_passes.py:LiteralUnroll.run_pass"
],
"edited_modules": [
"numba/core/untyped_passes.py:LiteralUnroll"
]
},
"file": "numba/core/untyped_passes.py"
}... | numba/numba | ddc6d35c241b849b2ed693e84ec1d11747029e40 | Cannot iterate over fields of record array
When iterating over the fields of a record array, numba complains about a not implemented getitem.
Accessing the fields by name outside a loop works. I am using numba 0.52, the problem occurs on both Windows and linux
## This is the ipython cell that produces the error:
... | diff --git a/numba/core/untyped_passes.py b/numba/core/untyped_passes.py
index 7e90b58aa..358f06ffa 100644
--- a/numba/core/untyped_passes.py
+++ b/numba/core/untyped_passes.py
@@ -1464,6 +1464,9 @@ class LiteralUnroll(FunctionPass):
pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants")
... |
numba__numba-6653 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numba/cuda/envvars.py:get_numba_envvar"
],
"edited_modules": [
"numba/cuda/envvars.py:get_numba_envvar"
]
},
"file": "numba/cuda/envvars.py"
}
] | numba/numba | 77a5b6333d91635bd16911225dca52a2f3d78425 | get_numba_envvar doesn't seem to return the right value
If the env var value is found, Instead of returning the value, the function returns the default value.
https://github.com/numba/numba/blob/42050e4a306e53f332fbaecf45248c54fae752e5/numba/cuda/envvars.py#L32
| diff --git a/numba/cuda/envvars.py b/numba/cuda/envvars.py
index dfe29759e..57a806732 100644
--- a/numba/cuda/envvars.py
+++ b/numba/cuda/envvars.py
@@ -29,4 +29,4 @@ def get_numba_envvar(envvar, default=None):
if value is None:
return get_numbapro_envvar('NUMBAPRO_' + envvar, default=default)
else:
... |
numba__numba-6654 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numba/core/typing/npydecl.py:parse_dtype"
],
"edited_modules": [
"numba/core/typing/npydecl.py:parse_dtype"
]
},
"file": "numba/core/typing/npydecl.py"
},
{
"ch... | numba/numba | 77a5b6333d91635bd16911225dca52a2f3d78425 | Support alternative spellings of dtypes in dtype kwarg of numpy array constructors
<!--
Thanks for opening an issue! To help the Numba team handle your information
efficiently, please first ensure that there is no other issue present that
already describes the issue you have
(search at https://github.com/numba/nu... | diff --git a/numba/core/typing/npydecl.py b/numba/core/typing/npydecl.py
index 50cff1c6a..5381a9287 100644
--- a/numba/core/typing/npydecl.py
+++ b/numba/core/typing/npydecl.py
@@ -439,9 +439,13 @@ def parse_dtype(dtype):
elif isinstance(dtype, types.TypeRef):
return dtype.instance_type
elif isinstan... |
numba__numba-6661 | [
{
"changes": {
"added_entities": [
"numba/cuda/cudadrv/nvvm.py:NVVM.__init__",
"numba/cuda/cudadrv/nvvm.py:NVVM.is_nvvm70",
"numba/cuda/cudadrv/nvvm.py:NVVM.get_ir_version",
"numba/cuda/cudadrv/nvvm.py:ir_cas",
"numba/cuda/cudadrv/nvvm.py:ir_numba_atomic_binary",
... | numba/numba | ca8132ba5e43fc3f79767046ed55217aeeabb35e | <unnamed> (81, 19): parse expected comma after load's type
### Reporting a bug
Im getting an error like pasted below while trying to run the most basic example taken from official WWW:
https://developer.nvidia.com/blog/numba-python-cuda-acceleration/
```
import numpy as np
from numba import vectorize
@vecto... | diff --git a/numba/cuda/cudadrv/nvvm.py b/numba/cuda/cudadrv/nvvm.py
index 32085511f..a6f6f2af6 100644
--- a/numba/cuda/cudadrv/nvvm.py
+++ b/numba/cuda/cudadrv/nvvm.py
@@ -101,6 +101,11 @@ class NVVM(object):
# nvvmResult nvvmGetProgramLog(nvvmProgram cu, char *buffer)
'nvvmGetProgramLog': (nvvm_re... |
numba__numba-6666 | [
{
"changes": {
"added_entities": [
"numba/cuda/cudadrv/runtime.py:Runtime.is_supported_version",
"numba/cuda/cudadrv/runtime.py:Runtime.supported_versions"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"numba/cuda/cudadrv/runtime.py:... | numba/numba | c743ac82c7d2d02e0aaca2287764303f550f54a3 | Retrieve The Oldest and Newest Supported CUDA Versions
## Feature request
The STUMPY Python package depends on `numba` and, when `cuda` is available, it imports submodules that rely on cuda. It checks this by doing something like:
```
from numba import cuda
if cuda.is_available(): # Only import if CUDA is av... | diff --git a/docs/source/cuda-reference/host.rst b/docs/source/cuda-reference/host.rst
index d69b5de4e..9be7e7773 100644
--- a/docs/source/cuda-reference/host.rst
+++ b/docs/source/cuda-reference/host.rst
@@ -213,4 +213,9 @@ accessed through ``cuda.runtime``, which is an instance of the
:class:`numba.cuda.cudadrv.runt... |
numba__numba-6681 | [
{
"changes": {
"added_entities": [
"numba/core/byteflow.py:Flow._guard_with_as"
],
"added_modules": null,
"edited_entities": [
"numba/core/byteflow.py:Flow.run"
],
"edited_modules": [
"numba/core/byteflow.py:Flow"
]
},
"file": "numba/core... | numba/numba | ea2585bb9a17301218c7f845bbc91cc5fe076260 | with.. as construct breaks bytecode analysis and leads to an uncontrolled failure
numba.core.errors.UnsupportedError: Failed in nopython mode pipeline (step: analyzing bytecode)
'try' block not supported until python3.7 or later
| diff --git a/numba/core/byteflow.py b/numba/core/byteflow.py
index f84ac33b9..d82c07e67 100644
--- a/numba/core/byteflow.py
+++ b/numba/core/byteflow.py
@@ -130,6 +130,9 @@ class Flow(object):
state.advance_pc()
# Must the new PC be a new block?
... |
numpy__numpy-financial-54 | [
{
"changes": {
"added_entities": [
"numpy_financial/_financial.py:_roots"
],
"added_modules": [
"numpy_financial/_financial.py:_roots"
],
"edited_entities": [
"numpy_financial/_financial.py:irr",
"numpy_financial/_financial.py:npv"
],
"ed... | numpy/numpy-financial | d02edfb65dcdf23bd571c2cded7fcd4a0528c6af | Slow NPV calculations for monte carlo simulation purposes
When using a large number of monte carlo simulations (~1e6 or more) for uncertainty calculations on NPV, the present implementation of Numpy-financial NPV is very slow. We suggest a new implementation of the NPV function , which allows calculation of serveral pr... | diff --git a/numpy_financial/_financial.py b/numpy_financial/_financial.py
index e268424..070599d 100644
--- a/numpy_financial/_financial.py
+++ b/numpy_financial/_financial.py
@@ -675,7 +675,36 @@ def rate(nper, pmt, pv, fv, when='end', guess=None, tol=None, maxiter=100):
return rn
-def irr(values, guess=0.1,... |
numpy__numpydoc-101 | [
{
"changes": {
"added_entities": [
"numpydoc/docscrape.py:NumpyDocString._error_location"
],
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString.__setitem__",
"numpydoc/docscrape.py:NumpyDocString._parse"
],
"edited_module... | numpy/numpydoc | 057ef572dd5ea547af2832e1b68d934cf953eafe | Unknown Section error has no context.
Similar to #95 the "Unknown section: X" error has no context, making it really hard to find and fix :-/ | diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index 074a7f7..45883d0 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -136,7 +136,7 @@ class NumpyDocString(collections.Mapping):
def __setitem__(self, key, val):
if key not in self._parsed_data:
- warn("Unknown sec... |
numpy__numpydoc-106 | [
{
"changes": {
"added_entities": [
"numpydoc/docscrape_sphinx.py:SphinxDocString._process_param"
],
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape_sphinx.py:SphinxDocString._str_param_list",
"numpydoc/docscrape_sphinx.py:SphinxDocString._str_membe... | numpy/numpydoc | 057ef572dd5ea547af2832e1b68d934cf953eafe | Need Attributes displayable like param list
I've not investigated when/whether there was a change in numpydoc, but scikit-learn has long relied on Attributes (as per docstring, rather than than descriptors on the class) being listed like Parameters. See old docs at http://scikit-learn.org/0.18/modules/generated/sklearn... | diff --git a/numpydoc/docscrape_sphinx.py b/numpydoc/docscrape_sphinx.py
index d8a495e..a555ed0 100644
--- a/numpydoc/docscrape_sphinx.py
+++ b/numpydoc/docscrape_sphinx.py
@@ -79,21 +79,136 @@ class SphinxDocString(NumpyDocString):
out += ['']
return out
- def _str_param_list(self, name)... |
numpy__numpydoc-111 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"numpydoc/docscrape.py:NumpyDocString"
]
},
"file": "numpydoc/docscrape.py"
}
] | numpy/numpydoc | b215bed82942ed61bc39b18a5b9891e8b43553a2 | docscrape doesn't parse :meth:`~matplotlib.axes.Axes.plot` (including '~')
The `docscrape.parse_item_name` method can't parse the above text, because of the tilde. If I manually add a `~` to the regex on line 187 of `docscrape.py` things seem to work just fine. Is this a known issue, or have I done something wrong with... | diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index 074a7f7..b0ef3d7 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -213,7 +213,8 @@ class NumpyDocString(collections.Mapping):
return params
- _name_rgx = re.compile(r"^\s*(:(?P<role>\w+):`(?P<name>[a-zA-Z0-9_.-]+)`|"
+ ... |
numpy__numpydoc-136 | [
{
"changes": {
"added_entities": [
"numpydoc/__init__.py:setup"
],
"added_modules": [
"numpydoc/__init__.py:setup"
],
"edited_entities": null,
"edited_modules": null
},
"file": "numpydoc/__init__.py"
},
{
"changes": {
"added_entities": [
... | numpy/numpydoc | 2f075a613b7066493d05fb28d9851cdd7acd8f2a | BUG: Reference de-duplication isn't parallel-safe
Currently Numpydoc is marked as a parallel-safe sphinx plugin, but the renaming of duplicate references in ``rename_references`` is not parallel-safe because ``reference_offset`` will be [0] in each process at the start of the function call.
I'm running into conflict... | diff --git a/README.rst b/README.rst
index 7174840..3d680a5 100644
--- a/README.rst
+++ b/README.rst
@@ -11,16 +11,16 @@
numpydoc -- Numpy's Sphinx extensions
=====================================
-Numpy's documentation uses several custom extensions to Sphinx. These
-are shipped in this ``numpydoc`` package, in c... |
numpy__numpydoc-143 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape_sphinx.py:SphinxDocString._str_returns"
],
"edited_modules": [
"numpydoc/docscrape_sphinx.py:SphinxDocString"
]
},
"file": "numpydoc/docscrape_sphinx... | numpy/numpydoc | 8c1e85c746d1c95b9433b2ae97057b7f447c83d1 | dependency on sphinx.ext.autosummary
It appears that numpydoc has a hard dependency on sphinx.ext.autosummary being active (it inserts some `.. autosummary::` directives). This is fine, but perhaps `numpydoc.setup` should just call `sphinx.ext.autosummary.setup` in that case? (in the sense that I don't see much of a ... | diff --git a/doc/install.rst b/doc/install.rst
index d408189..5658dbb 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -9,8 +9,8 @@ The extension is available from:
* `numpydoc on GitHub <https://github.com/numpy/numpydoc/>`_
'numpydoc' should be added to the ``extensions`` option in your Sphinx
-``conf.py``.
... |
numpy__numpydoc-145 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString._parse",
"numpydoc/docscrape.py:NumpyDocString.__str__"
],
"edited_modules": [
"numpydoc/docscrape.py:NumpyDocString"
]
},
... | numpy/numpydoc | 40b3733b4bf4604ff7622b5eab592edcef750591 | support for coroutine
I have a lot of coroutine to comment but i have not seen any suppport for this python feature.
The yield allows to comment what goes out of the coroutine but it would be nice to be able to specify what goes in in a specific manner.
| diff --git a/doc/format.rst b/doc/format.rst
index 87f5ff7..cdeec0b 100644
--- a/doc/format.rst
+++ b/doc/format.rst
@@ -252,13 +252,21 @@ The sections of a function's docstring are:
Support for the **Yields** section was added in `numpydoc
<https://github.com/numpy/numpydoc>`_ version 0.6.
-7. **Other Parame... |
numpy__numpydoc-172 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString._parse_see_also",
"numpydoc/docscrape.py:NumpyDocString._parse",
"numpydoc/docscrape.py:NumpyDocString._str_see_also",
"numpydoc/docscrape.py... | numpy/numpydoc | 40b3733b4bf4604ff7622b5eab592edcef750591 | multiple entries in a See Also section
Observed in scipy.interpolate docs
```
See Also
------------
splev, splrep : FITPACK wrappers
```
The description text (the stuff after the colon) does not show up in the generated html docs.
Moving the description to a separate line,
```
See Also
------------
splev, splrep
... | diff --git a/doc/format.rst b/doc/format.rst
index 87f5ff7..cdeec0b 100644
--- a/doc/format.rst
+++ b/doc/format.rst
@@ -252,13 +252,21 @@ The sections of a function's docstring are:
Support for the **Yields** section was added in `numpydoc
<https://github.com/numpy/numpydoc>`_ version 0.6.
-7. **Other Parame... |
numpy__numpydoc-175 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString._parse_param_list",
"numpydoc/docscrape.py:NumpyDocString._parse",
"numpydoc/docscrape.py:NumpyDocString._str_param_list",
"numpydoc/docscrap... | numpy/numpydoc | 8f1ac50a7267e9e1ee66141fd71561c2ca2dc713 | Anonymous return values have their types populated in the name slot of the tuple.
I noticed an inconsistency, when using numpydoc version 0.6.0 in python2.7 on Ubuntu. The parsed return section information returns different styles of tuple depending on if the return value is anoymous or not.
Here is a minimal work... | diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index 02afd88..32245a9 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -220,7 +220,7 @@ class NumpyDocString(Mapping):
else:
yield name, self._strip(data[2:])
- def _parse_param_list(self, content):
+ def ... |
numpy__numpydoc-240 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "numpydoc/__init__.py"
},
{
"changes": {
"added_entities": [
"numpydoc/__main__.py:render_object",
"numpydoc/__main__.py:validate... | numpy/numpydoc | 472898ea0ca15561273fae1bf00468cd4117ea2b | Validation is not strict enough
The [docs suggest](https://numpydoc.readthedocs.io/en/latest/validation.html) that `python -m numpydoc` can be used to validate docstrings. However, `numpydoc` reports only the most egregious breakages of the standard.
If we want to help users write high quality docstrings, we should... | diff --git a/.travis.yml b/.travis.yml
index c1aa853..f6dd4cc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,6 +23,12 @@ script:
cd dist
pip install numpydoc* -v
- pytest -v --pyargs numpydoc
+ # Making sure the command line options work
+ - python -m numpydoc numpydoc.tests.test_main._capture_stdout
... |
numpy__numpydoc-283 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString._parse_see_also"
],
"edited_modules": [
"numpydoc/docscrape.py:NumpyDocString"
]
},
"file": "numpydoc/docscrape.py"
}
] | numpy/numpydoc | fd17df0c96e107f7550b91e2680e76d2be796e0c | Failed See Also Parsing.
```
In [1]: from numpydoc.docscrape import NumpyDocString
...: from numpy import seterrobj
...: NumpyDocString("""seterrobj(errobj)
...:
...: Set the object that defines floating-point error handling.
...:
...: See Also
...: --------
...: geterro... | diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index 77de401..d79992c 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -284,6 +284,8 @@ class NumpyDocString(Mapping):
"""
+ content = dedent_lines(content)
+
items = []
def parse_item_name(text):
|
numpy__numpydoc-286 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString._parse_param_list"
],
"edited_modules": [
"numpydoc/docscrape.py:NumpyDocString"
]
},
"file": "numpydoc/docscrape.py"
}
] | numpy/numpydoc | 4e86e815a855502eef1a796a5d3f217b08aaa79f | Wrong number of Parameter for numpy array.
```
In [1]: from numpydoc.docscrape import NumpyDocString
...: from numpy import array
...: len(NumpyDocString(array.__doc__)['Parameters'])
Out[1]: 1
```
(should be 6)
Again due to a dedent issue:
```
$ git diff
diff --git a/numpydoc/docscrape.py b/nump... | diff --git a/doc/install.rst b/doc/install.rst
index ba799e3..46b26f8 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -63,15 +63,6 @@ numpydoc_xref_aliases : dict
aliases/shortcuts used when specifying the types of parameters.
The keys should not have any spaces. Together with the ``intersphinx``
extensi... |
numpy__numpydoc-347 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/validate.py:validate"
],
"edited_modules": [
"numpydoc/validate.py:validate"
]
},
"file": "numpydoc/validate.py"
}
] | numpy/numpydoc | 4ae1e00e72e522c126403c1814f0b99dc5978622 | How to specify that parameter can equal the string 'integer'?
Say I have the following:
```python
def foo(bar: str) -> None:
"""
Parameters
----------
bar : {'integer', 'float'}
Some description.
"""
if bar not in {'integer', 'float'}:
raise ValueError('bar is neither "... | diff --git a/numpydoc/validate.py b/numpydoc/validate.py
index 91aca6b..3675737 100644
--- a/numpydoc/validate.py
+++ b/numpydoc/validate.py
@@ -564,6 +564,10 @@ def validate(obj_name):
else:
if doc.parameter_type(param)[-1] == ".":
errs.append(error("PR05", param_name... |
numpy__numpydoc-422 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape_sphinx.py:SphinxDocString.load_config",
"numpydoc/docscrape_sphinx.py:SphinxDocString._str_returns",
"numpydoc/docscrape_sphinx.py:SphinxDocString._str_param_list"
... | numpy/numpydoc | dcbfbc44ba01feddef62f294abf66581497f5828 | Is numpydoc_use_blockquotes deprecated or not yet?
On the documentation website for version 1.5.dev0: https://numpydoc.readthedocs.io/en/latest/install.html#configuration
> numpydoc_use_blockquotes : bool
>
> Until version 0.8, parameter definitions were shown as blockquotes, rather than in a definition list.... | diff --git a/doc/install.rst b/doc/install.rst
index a0bc076..976ddd5 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -48,10 +48,6 @@ numpydoc_citation_re : str
should be mangled to avoid conflicts due to
duplication across the documentation. Defaults
to ``[\w-]+``.
-numpydoc_use_blockquotes : bool
- U... |
numpy__numpydoc-429 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:NumpyDocString._parse_param_list"
],
"edited_modules": [
"numpydoc/docscrape.py:NumpyDocString"
]
},
"file": "numpydoc/docscrape.py"
}
] | numpy/numpydoc | 4ef89d4da0d494a5b7f6ecf1bd613599e50336bf | Parsing `returns` section with several types and no name
According to numpydoc [return value specification](https://numpydoc.readthedocs.io/en/latest/format.html#returns), the name for each return value may be optional. If the return value is omitted and the return type can take several types (if the actual type depend... | diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index 6bdaa84..9496f9d 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -226,10 +226,14 @@ class NumpyDocString(Mapping):
params = []
while not r.eof():
header = r.read().strip()
- if " :" in header:
- ... |
numpy__numpydoc-433 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/docscrape.py:ClassDoc.properties"
],
"edited_modules": [
"numpydoc/docscrape.py:ClassDoc"
]
},
"file": "numpydoc/docscrape.py"
}
] | numpy/numpydoc | b138ea7758532a8b6950c4404570ab367c3919f4 | BUG: Numpydoc doesn't render attributes decorated with `cached_property` in the Attributes section
Numpydoc doesn't render attributes decorated with `cached_property` in the `Attribute` section. I think it is due to this line:
https://github.com/numpy/numpydoc/blob/b138ea7758532a8b6950c4404570ab367c3919f4/numpydoc/d... | diff --git a/.circleci/config.yml b/.circleci/config.yml
index cc83b2a..b2269f4 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -2,32 +2,39 @@ version: 2
jobs:
build_docs:
docker:
- - image: circleci/python:3.7-stretch
+ - image: "cimg/python:3.10"
steps:
- checkout
... |
numpy__numpydoc-500 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"numpydoc/validate.py:Validator.source_file_name",
"numpydoc/validate.py:Validator.source_file_def_line"
],
"edited_modules": [
"numpydoc/validate.py:Validator"
]
},... | numpy/numpydoc | ecd24ab011634fd16cd7d811fd4adad3f305073c | `numpydoc ignore` inline comment not recognized when using decorators
When using decorators, the `numpydoc ignore` inline comment does not seem to be recognized by either `numpydoc --validate` or the validation during Sphinx build. Here's a reprex, stored as `test.py`:
```python
import functools
def test_decor... | diff --git a/numpydoc/validate.py b/numpydoc/validate.py
index 2cd1125..e98d385 100644
--- a/numpydoc/validate.py
+++ b/numpydoc/validate.py
@@ -280,7 +280,13 @@ class Validator:
File name where the object is implemented (e.g. pandas/core/frame.py).
"""
try:
- fname = inspect.getso... |
nutechsoftware__alarmdecoder-60 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"alarmdecoder/zonetracking.py:Zonetracker.update"
],
"edited_modules": [
"alarmdecoder/zonetracking.py:Zonetracker"
]
},
"file": "alarmdecoder/zonetracking.py"
}
] | nutechsoftware/alarmdecoder | 8a1a917dc04b60e03fa641f30000f5d8d23f94e6 | Communicator failures not handled
Messages such as this lead to failures when updating zones:
```
May 12 10:08:59 [00000001000000000A--],0fc,[f704009f10fc000008020000000000],"COMM. FAILURE "
May 12 10:09:03 [00000001000000100A--],0bf,[f704009f10bf000208020000000000],"CHECK 103 LngRngRadio 000... | diff --git a/alarmdecoder/zonetracking.py b/alarmdecoder/zonetracking.py
index 13be3c3..ae92eb7 100644
--- a/alarmdecoder/zonetracking.py
+++ b/alarmdecoder/zonetracking.py
@@ -189,7 +189,7 @@ class Zonetracker(object):
if match is None:
return
- zone =... |
nv-legate__legate.core-416 | [
{
"changes": {
"added_entities": [
"legate/util/args.py:Argument.kwargs"
],
"added_modules": null,
"edited_entities": [
"legate/util/args.py:parse_library_command_args"
],
"edited_modules": [
"legate/util/args.py:ArgSpec",
"legate/util/args.py:... | nv-legate/legate.core | 9b9e59cdbaeb22661f11a2babc491620ea3362d5 | cunumeric/legate eats the `-l` command line flag
The following program:
```
import cunumeric
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-l", type=int, default=None)
args, _ = parser.parse_known_args()
print(args.l)
```
run as `legate repro.py -l 5` will print `None`. However, i... | diff --git a/legate/util/args.py b/legate/util/args.py
index e8fdc0c3..88cd7319 100644
--- a/legate/util/args.py
+++ b/legate/util/args.py
@@ -14,6 +14,7 @@
#
from __future__ import annotations
+import re
import sys
import warnings
from argparse import Action, ArgumentParser, Namespace
@@ -73,6 +74,7 @@ class Ar... |
nylas__nylas-python-318 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"nylas/client/restful_model_collection.py:RestfulModelCollection.search"
],
"edited_modules": [
"nylas/client/restful_model_collection.py:RestfulModelCollection"
]
},
"f... | nylas/nylas-python | f2bb44ec3f465ab93deadfc0249972eaa7b5df53 | RFE: Allow to control `threads.search` threads view
## Issue Overview
Thanks for maintaining this damn awesome SDK! While implementing [email search functionality for Code Inbox](https://github.com/coder-inbox/code-inbox-server/blob/6ef01f0d207cbae10315a5f109646f5dc1bd34bd/src/nylas/router.py#L316) using this SDK, I... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8427d09..a9c651a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
nylas-python Changelog
======================
+Unreleased
+----------------
+* Add support for `view` parameter in `Threads.search()`
+
v5.14.1
----------------
* Fix error when trying to... |
nylas__nylas-python-350 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"nylas/models/messages.py:ScheduledMessage",
"nylas/models/messages.py:ScheduledMessagesList"
]
},
"file": "nylas/models/messages.py"
},
{
"cha... | nylas/nylas-python | 5564fdbbc57db90f9d76f7b81607765f9a9f6cdc | Python SDK (Nylas API v3) Error Messages
**Describe the bug**
Testing the Python SDK and receiving error messages for various calls, will include source code and errors below.
#### POST /v3/grants/{grant_id}/calendars/free-busy
_code sample:_
```
# SDK doesn't accept identifer
# https://nylas-python-sdk-referen... | diff --git a/.pylintrc b/.pylintrc
index 2db5495..f789fc6 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -29,3 +29,6 @@ generated-members=
CodeExchangeResponse.from_dict,
NylasApiErrorResponse.from_dict,
NylasOAuthErrorResponse.from_dict,
+ FreeBusyError.from_dict,
+ FreeBusy.from_dict,
+ ScheduledMe... |
nylas__nylas-python-78 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"nylas/client/client.py:APIClient.authentication_url"
],
"edited_modules": [
"nylas/client/client.py:APIClient"
]
},
"file": "nylas/client/client.py"
}
] | nylas/nylas-python | 6a9b1e5c0774b2a198496daedb980b5bbc091d30 | Allow users to pass `state` during authentication | diff --git a/nylas/client/client.py b/nylas/client/client.py
index 8278ae5..b41f782 100644
--- a/nylas/client/client.py
+++ b/nylas/client/client.py
@@ -143,13 +143,13 @@ class APIClient(json.JSONEncoder):
if 'Authorization' in self.session.headers:
del self.session.headers['Authorization'... |
nylas__nylas-python-79 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"nylas/client/restful_models.py:Folder.threads",
"nylas/client/restful_models.py:Folder.messages",
"nylas/client/restful_models.py:Label.threads",
"nylas/client/restful_models.py:... | nylas/nylas-python | 6a9b1e5c0774b2a198496daedb980b5bbc091d30 | Fix all xfail tests | diff --git a/nylas/client/restful_models.py b/nylas/client/restful_models.py
index 93488a0..e73c100 100644
--- a/nylas/client/restful_models.py
+++ b/nylas/client/restful_models.py
@@ -179,11 +179,11 @@ class Folder(NylasAPIObject):
@property
def threads(self):
- return self.child_collection({'in': s... |
nylas__nylas-python-98 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"nylas/client/restful_models.py:File.save"
],
"edited_modules": [
"nylas/client/restful_models.py:File"
]
},
"file": "nylas/client/restful_models.py"
}
] | nylas/nylas-python | 068a626706188eea00b606608ab06c9b9ea307fb | File.filename doesn't apply when type is stream:
Setting a filename on an attachment only works when using `.data`. When `.stream` is used, it falls back to the name of the file on the uploading system.
```
myfile = self.nylas_client.files.create()
myfile.content_type = 'application/pdf'
m... | diff --git a/nylas/client/restful_models.py b/nylas/client/restful_models.py
index d8d1c98..7f31653 100644
--- a/nylas/client/restful_models.py
+++ b/nylas/client/restful_models.py
@@ -387,18 +387,27 @@ class File(NylasAPIObject):
collection_name = 'files'
def save(self): # pylint: disable=arguments-differ... |
oasis-open__cti-pattern-validator-10 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2patterns/validator.py:run_validator"
],
"edited_modules": [
"stix2patterns/validator.py:run_validator"
]
},
"file": "stix2patterns/validator.py"
}
] | oasis-open/cti-pattern-validator | 82956eaff8caf5af323b0c712550bfc5840fbd62 | Unclear error message when missing brackets
If the input is missing the surrounding '[' and ']' (ie. the input is just a Comparison Expression, not an Observation Expression or Pattern Expresion), the validator's error message is unhelpful:
$ validate_patterns
Enter a pattern to validate: file-object:hashes... | diff --git a/.travis.yml b/.travis.yml
index 896f07d..52cda7e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,12 @@
sudo: false
language: python
python:
+ - "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
+ - "3.6"
install:
- pip install -U pip setuptools
- pip install tox-travis
diff --git a/stix2... |
oasis-open__cti-pattern-validator-46 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2patterns/grammars/STIXPatternLexer.py:serializedATN",
"stix2patterns/grammars/STIXPatternLexer.py:STIXPatternLexer.__init__"
],
"edited_modules": [
"stix2patterns/gramma... | oasis-open/cti-pattern-validator | 5f50cd15f293440a4447d01795222eb97c8f495e | Pattern passes unexpectedly
The following pattern passes with the latest version installed via `pip`
```
$ pip3 install stix2-patterns
Requirement already satisfied: stix2-patterns in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from stix2-pa... | diff --git a/stix2patterns/grammars/STIXPatternLexer.py b/stix2patterns/grammars/STIXPatternLexer.py
index dd44915..dc01a53 100644
--- a/stix2patterns/grammars/STIXPatternLexer.py
+++ b/stix2patterns/grammars/STIXPatternLexer.py
@@ -1,4 +1,4 @@
-# Generated from STIXPattern.g4 by ANTLR 4.7
+# Generated from STIXPattern... |
oasis-open__cti-pattern-validator-50 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2patterns/grammars/STIXPatternLexer.py:serializedATN"
],
"edited_modules": [
"stix2patterns/grammars/STIXPatternLexer.py:serializedATN",
"stix2patterns/grammars/STIXPatte... | oasis-open/cti-pattern-validator | 801c2364013d3cc5529f5e0b967def7f505a91e4 | Validation fails on network-traffic:start
If I run the following STIX pattern
`"[network-traffic:start = '2018-04-20T12:36:24.558Z']"`
it fails validation and gives the following error
`"FAIL: Error found at line 1:17. no viable alternative at input 'network-traffic:start'"`
The pattern passes validation if I use... | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8864e8e..702b1e0 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,6 +2,7 @@
sha: ea227f024bd89d638aea319c92806737e3375979
hooks:
- id: trailing-whitespace
+ exclude: stix2patterns/grammars/*
- id:... |
oasis-open__cti-pattern-validator-71 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "setup.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2patterns/v20/grammars/... | oasis-open/cti-pattern-validator | 45f81f0c5b9481054ba28aea2ecb372faee7fe2b | STIX 2.1 pattern validation failing on multiple START STOP qualifiers
When running the following from a terminal:
```
validate-patterns -v 2.1
[network-traffic:src_port = 37020 AND user-account:user_id = 'root'] START t'2016-06-01T01:30:00.123Z' STOP t'2016-06-01T02:20:00.123Z' OR [ipv4-addr:value = '192.168.122.83'... | diff --git a/.travis.yml b/.travis.yml
index 26be7f2..261f125 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-os: linux
+sudo: false
language: python
cache: pip
python:
@@ -6,15 +6,17 @@ python:
- "3.4"
- "3.5"
- "3.6"
- - "3.7"
- - "3.8"
+matrix:
+ include:
+ - python: 3.7 # https://githu... |
oasis-open__cti-pattern-validator-79 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2patterns/v20/object_validator.py:verify_object"
],
"edited_modules": [
"stix2patterns/v20/object_validator.py:verify_object"
]
},
"file": "stix2patterns/v20/object... | oasis-open/cti-pattern-validator | f819fc5c65785c950a2a65f2f8b78cc534ad8872 | Validator raises/crashes on hashes type "wildcard subscription"
Steps to reproduce
------------------
```
$ validate-patterns -v 2.1
Enter a pattern to validate: [file:hashes[*] = '8665c8d477534008b3058b72e2dae8ae']
```
Expected result
---------------
Something like `FAIL: Error found at line 1:... hashes typ... | diff --git a/stix2patterns/v20/object_validator.py b/stix2patterns/v20/object_validator.py
index 235ee63..72f051c 100644
--- a/stix2patterns/v20/object_validator.py
+++ b/stix2patterns/v20/object_validator.py
@@ -1,4 +1,5 @@
import re
+import stix2patterns.inspector
HASHES_REGEX = {
"MD5": (r"^[a-fA-F0-9]{32}$... |
oasis-open__cti-python-stix2-10 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2/common.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [... | oasis-open/cti-python-stix2 | 85b5a1971b0f36c3acaa0d3da734329bdd8ebe0b | is labels optional
Hi,
As an exercise I'm starting a similar Scala library for STIX 2.1, at:
[scalastix]( https://github.com/workingDog/scalastix)
According to the specs and as part of the common properties, labels is optional.
However, there are SDOs (e.g. Indicator) where it is required. Is this correct?
... | diff --git a/stix2/common.py b/stix2/common.py
index 29cbf62..c8c243d 100644
--- a/stix2/common.py
+++ b/stix2/common.py
@@ -2,7 +2,7 @@
from .other import ExternalReference, GranularMarking
from .properties import (BooleanProperty, ListProperty, ReferenceProperty,
- TimestampProperty)
+ ... |
oasis-open__cti-python-stix2-100 | [
{
"changes": {
"added_entities": [
"stix2/base.py:_STIXBase.serialize"
],
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase.__str__"
],
"edited_modules": [
"stix2/base.py:_STIXBase"
]
},
"file": "stix2/base.py"
},
{... | oasis-open/cti-python-stix2 | 5aa8c66bfc8b03dd76ff97ae3462c791d5861406 | Update DataStores, Sources, Sinks
While working #98 I noticed even further problems with how the stores work. In addition to the fixes, I will adding:
- Proper ABC for DataStore, DataStore, and DataSink.
- The version positional argument was missing in a lot of places.
| diff --git a/docs/guide/custom.ipynb b/docs/guide/custom.ipynb
index 2254fa8..48b9ffe 100644
--- a/docs/guide/custom.ipynb
+++ b/docs/guide/custom.ipynb
@@ -99,101 +99,28 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 3,
"metadata": {},
"outputs": [
{
- "data": ... |
oasis-open__cti-python-stix2-111 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/environment.py:Environment.get",
"stix2/environment.py:Environment.all_versions",
"stix2/environment.py:Environment.query",
"stix2/environment.py:Environment.add",
... | oasis-open/cti-python-stix2 | ef3ce9f6f0a678e604bda63f9eb5742ed53f8eff | Add functions to get related objects
In preparation for the Workbench layer, the Environment API should have some functions to explore/retrieve/dereference related objects. This would include something like `created_by()` (for `created_by_ref`) and `relationships()`. `relationships()` might have parameters like `source... | diff --git a/docs/guide/datastore.ipynb b/docs/guide/datastore.ipynb
index 7fc0997..24a2b4f 100644
--- a/docs/guide/datastore.ipynb
+++ b/docs/guide/datastore.ipynb
@@ -23,7 +23,7 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 40,
"metadata": {
"collapsed": true,
"... |
oasis-open__cti-python-stix2-127 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase.__deepcopy__",
"stix2/base.py:_Observable._check_ref"
],
"edited_modules": [
"stix2/base.py:_STIXBase",
"stix2/base.py:_Observable"
]
... | oasis-open/cti-python-stix2 | b1a020bb38d74c407ac125b1e032850acfe7a880 | Fail to create new version of ObservedData if it has related objects
If you try to generate a new version of an ObservedData which contains related objects (like domain-name -> ipv4) you obtain a fatal error
Example:
`from stix2 import ObservedData`
`from datetime import datetime`
`data = ObservedData(first_observe... | diff --git a/stix2/base.py b/stix2/base.py
index 76b07b8..fc13094 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -161,9 +161,12 @@ class _STIXBase(collections.Mapping):
", ".join(["{0!s}={1!r}".format(k, v) for k, v in props]))
def __deepcopy__(self, memo):
- # Assumpt... |
oasis-open__cti-python-stix2-131 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/sources/filesystem.py:FileSystemStore.__init__",
"stix2/sources/filesystem.py:FileSystemSink.__init__",
"stix2/sources/filesystem.py:FileSystemSink._check_path_and_write",
... | oasis-open/cti-python-stix2 | c682838239fce1abd3b3e471fb3c601de8663501 | Documentation: CompositeDataSource Examples seems wrong
First the variable ta probably should be something different, since it suggests a Threat Actor.
The 'output' seems to be two indicators - neither one of which has the id 'indicator--37a6a5de-a5b9-425a-903a-4ae9cbf1ff3f
get an object that is only in the filesys... | diff --git a/docs/guide/datastore.ipynb b/docs/guide/datastore.ipynb
index ba8ad53..31635ba 100644
--- a/docs/guide/datastore.ipynb
+++ b/docs/guide/datastore.ipynb
@@ -52,6 +52,19 @@
"print = json_print"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": true
+... |
oasis-open__cti-python-stix2-133 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/markings/granular_markings.py:remove_markings",
"stix2/markings/granular_markings.py:add_markings",
"stix2/markings/granular_markings.py:clear_markings"
],
"edited_modu... | oasis-open/cti-python-stix2 | 4a9c38e0b50415f4733072fc76eb8ebd0749c84b | Calling add_markings on a existing STIX object with custom properties causes an exception
Here is the stack trace:
Traceback (most recent call last):
```
File "/Users/rpiazza/projects/capec-attack/capec2stix/capec2stix.py", line 197, in <module>
main()
File "/Users/rpiazza/projects/capec-attack/capec2sti... | diff --git a/stix2/markings/granular_markings.py b/stix2/markings/granular_markings.py
index be5d258..7c227d9 100644
--- a/stix2/markings/granular_markings.py
+++ b/stix2/markings/granular_markings.py
@@ -116,9 +116,9 @@ def remove_markings(obj, marking, selectors):
granular_markings = utils.compress_markings(gran... |
oasis-open__cti-python-stix2-145 | [
{
"changes": {
"added_entities": null,
"added_modules": [
"docs/conf.py:STIXAttributeDocumenter"
],
"edited_entities": [
"docs/conf.py:STIXPropertyDocumenter.add_content",
"docs/conf.py:setup"
],
"edited_modules": [
"docs/conf.py:STIXPropertyDo... | oasis-open/cti-python-stix2 | 33cfc4bb2786e6da0960bdaf9c8d19e4daebd938 | Rundown status of existing issue: FileSystem query bug
Bug: When querying FileSystem, it came back with JSON parse error. Specifically had to use a filter with “type” field to work. @mbastian1135 was trying to reproduce this, but having problems | diff --git a/docs/conf.py b/docs/conf.py
index 49416a0..e53829b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -74,7 +74,7 @@ def get_property_type(prop):
return prop_class
-class STIXPropertyDocumenter(ClassDocumenter):
+class STIXAttributeDocumenter(ClassDocumenter):
"""Custom Sphinx extension to auto-... |
oasis-open__cti-python-stix2-165 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/properties.py:ListProperty.clean"
],
"edited_modules": [
"stix2/properties.py:ListProperty"
]
},
"file": "stix2/properties.py"
},
{
"changes": {
"ad... | oasis-open/cti-python-stix2 | 2d689815d743611a8f3ccd48ce5e2d1ec70695e5 | Create an Extension with Dict annidate inside List
Hi,
I'm trying to create a CyberObservable Extension for UserAccount which have to contain a DictionaryProperty() inside a ListProperty(). It is possible? Because when I try to create an extension like this one
```
@CustomExtension(UserAccount, 'ssh_keys', {
k... | diff --git a/stix2/properties.py b/stix2/properties.py
index ca7f04c..41841b6 100644
--- a/stix2/properties.py
+++ b/stix2/properties.py
@@ -129,6 +129,8 @@ class ListProperty(Property):
# constructor again
result.append(valid)
continue
+ elif type(self.cont... |
oasis-open__cti-python-stix2-172 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/patterns.py:make_constant"
],
"edited_modules": [
"stix2/patterns.py:make_constant"
]
},
"file": "stix2/patterns.py"
}
] | oasis-open/cti-python-stix2 | f778a45b33f9b74c5a3b62c38db477bb504c2202 | make_constant() should check if value is already a constant
``` python
>>> from stix2.patterns import StringConstant
>>> from stix2.patterns import make_constant
>>> a = StringConstant('foo')
>>> make_constant(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/lu/Projects/c... | diff --git a/stix2/patterns.py b/stix2/patterns.py
index 23ce71b..3f9cbd9 100644
--- a/stix2/patterns.py
+++ b/stix2/patterns.py
@@ -147,6 +147,9 @@ class ListConstant(_Constant):
def make_constant(value):
+ if isinstance(value, _Constant):
+ return value
+
try:
return parse_into_datetime(v... |
oasis-open__cti-python-stix2-185 | [
{
"changes": {
"added_entities": [
"stix2/utils.py:_iterate_over_values"
],
"added_modules": [
"stix2/utils.py:_iterate_over_values"
],
"edited_entities": [
"stix2/utils.py:find_property_index"
],
"edited_modules": [
"stix2/utils.py:find_... | oasis-open/cti-python-stix2 | d67f2da0ea839db464197f7da0f7991bdd774d1f | Custom STIX objects with nested dictionary error
A custom STIX object with a nested dictionary created using the following example:
``` python
#!/usr/bin/env python3.6
from stix2 import CustomObject, properties
@CustomObject('x-example', [
('dictionary', properties.DictionaryProperty()),
])
class Examp... | diff --git a/stix2/base.py b/stix2/base.py
index 2afba16..0ba6f56 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -236,6 +236,21 @@ class _STIXBase(collections.Mapping):
optional properties set to the default value defined in the spec.
**kwargs: The arguments for a json.dumps() call.
+... |
oasis-open__cti-python-stix2-187 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase.__getattr__"
],
"edited_modules": [
"stix2/base.py:_STIXBase"
]
},
"file": "stix2/base.py"
}
] | oasis-open/cti-python-stix2 | d67f2da0ea839db464197f7da0f7991bdd774d1f | Infinite recursion on _STIXBase object deserialization
Hi!
There seems to be a bug in the way the `__getitem__`/`__getattr__` functions are implemented in `_STIXBase` (_cti-python-stix2/stix2/base.py_). The bug can be reproduced by trying to serialize/deserialize an object instance, resulting in infinite recursion c... | diff --git a/stix2/base.py b/stix2/base.py
index 2afba16..9b5308f 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -185,7 +185,13 @@ class _STIXBase(collections.Mapping):
# Handle attribute access just like key access
def __getattr__(self, name):
- if name in self:
+ # Pickle-proofing: pickle... |
oasis-open__cti-python-stix2-20 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase._check_properties_dependency",
"stix2/base.py:_STIXBase._check_object_constraints",
"stix2/base.py:_STIXBase.__init__",
"stix2/base.py:_STIXBase.__getattr... | oasis-open/cti-python-stix2 | 229ab5d323a412ee91e8462701c816e1dfc0d521 | Forgot to instantiate ImmutableError
I'm guessing [this line](https://github.com/oasis-open/cti-python-stix2/blob/f937e2bb3f104e3cdf0578ed8323b2f7e39119a4/stix2/base.py#L99) should raise an instance of the exception class, not the class itself? | diff --git a/stix2/base.py b/stix2/base.py
index cde8bb6..3f696fd 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -69,22 +69,19 @@ class _STIXBase(collections.Mapping):
if list_of_properties and (not list_of_properties_populated or list_of_properties_populated == set(["extensions"])):
raise AtLe... |
oasis-open__cti-python-stix2-214 | [
{
"changes": {
"added_entities": [
"stix2/datastore/memory.py:_is_marking",
"stix2/datastore/memory.py:_ObjectFamily.__init__",
"stix2/datastore/memory.py:_ObjectFamily.add",
"stix2/datastore/memory.py:_ObjectFamily.__str__",
"stix2/datastore/memory.py:_ObjectFamily... | oasis-open/cti-python-stix2 | d69cc53dd2bdbcba9cdb2f9cf3eb3f80b7a73138 | Support multiple versions of an object in MemorySource
This would probably involve storing the objects in a dictionary of lists instead of just a list. | diff --git a/stix2/datastore/filters.py b/stix2/datastore/filters.py
index 03585ad..0172a50 100644
--- a/stix2/datastore/filters.py
+++ b/stix2/datastore/filters.py
@@ -123,8 +123,11 @@ def apply_common_filters(stix_objs, query):
Supports only STIX 2.0 common property properties.
Args:
- stix_objs (l... |
oasis-open__cti-python-stix2-216 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/v20/common.py:MarkingDefinition.__init__"
],
"edited_modules": [
"stix2/v20/common.py:MarkingDefinition"
]
},
"file": "stix2/v20/common.py"
}
] | oasis-open/cti-python-stix2 | 6613b55a433d4278c46f51327569fce0f125724c | The instance of MarkingDefinition cannot pass validation because the 'created' property does't have millisecond.
Here is the screenshot:

Source code:
:
if dictified == {}:
raise ValueError("The extensions property must contain ... |
oasis-open__cti-python-stix2-237 | [
{
"changes": {
"added_entities": [
"stix2/properties.py:CallableValues.__init__",
"stix2/properties.py:CallableValues.__call__"
],
"added_modules": [
"stix2/properties.py:CallableValues"
],
"edited_entities": null,
"edited_modules": null
},
"fi... | oasis-open/cti-python-stix2 | 06e23b08b8877bedc909889800682eec16a219c9 | WindowsRegistryKey fails to print
I am not sure if I am doing something wrong but trying to print a WindowsRegistryKey object always fails, even when using the provided example.
```
def test_key():
v = stix2.v21.WindowsRegistryValueType(
name="Foo",
data="qwerty",
data_type="REG_SZ",... | diff --git a/stix2/properties.py b/stix2/properties.py
index 24549aa..5e1b07f 100644
--- a/stix2/properties.py
+++ b/stix2/properties.py
@@ -11,7 +11,7 @@ import uuid
from six import string_types, text_type
from stix2patterns.validator import run_validator
-from .base import _STIXBase
+from .base import _Observable... |
oasis-open__cti-python-stix2-239 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/properties.py:DictionaryProperty.clean",
"stix2/properties.py:ExtensionsProperty.clean"
],
"edited_modules": [
"stix2/properties.py:DictionaryProperty",
"stix2/... | oasis-open/cti-python-stix2 | 06e23b08b8877bedc909889800682eec16a219c9 | Creating LanguageContent object has error
If you pass a language content object an empty contents dictionary, you get an exception saying it must be non-empty. I do not see anywhere in the 2.1 specification that requires this.
```
from stix2.v21 import LanguageContent, Campaign
camp = Campaign(name='foo')
Langua... | diff --git a/stix2/properties.py b/stix2/properties.py
index 24549aa..7202f9a 100644
--- a/stix2/properties.py
+++ b/stix2/properties.py
@@ -291,8 +291,6 @@ class DictionaryProperty(Property):
dictified = _get_dict(value)
except ValueError:
raise ValueError("The dictionary property mu... |
oasis-open__cti-python-stix2-258 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase.__init__"
],
"edited_modules": [
"stix2/base.py:_STIXBase"
]
},
"file": "stix2/base.py"
}
] | oasis-open/cti-python-stix2 | f8d4669f800291fd5977efaf924c9bb97b12052f | Ignore empty values for optional fields
Latest version of the library will not allow me to create instances of STIX2 classes with `None` or `[]` values for optional fields.
Example:
```python
In [4]: stix2.Malware(name='test malware', labels=['foo', 'bar'], external_references=[])
--------------------------------... | diff --git a/stix2/base.py b/stix2/base.py
index a6bafff..9fcdf56 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -143,12 +143,12 @@ class _STIXBase(collections.Mapping):
if custom_props:
self.__allow_custom = True
- # Remove any keyword arguments whose value is None
+ # Remove a... |
oasis-open__cti-python-stix2-261 | [
{
"changes": {
"added_entities": [
"stix2/exceptions.py:TLPMarkingDefinitionError.__init__",
"stix2/exceptions.py:TLPMarkingDefinitionError.__str__"
],
"added_modules": [
"stix2/exceptions.py:TLPMarkingDefinitionError"
],
"edited_entities": null,
"edit... | oasis-open/cti-python-stix2 | 582ba2be2c539ec2ef1f8bb384f5c1deb5e23831 | TLP MarkingDefinition does not use identifiers required by STIX2 spec
TLP Marking Definition objects are required to have one of the predefined identifiers for every color - http://docs.oasis-open.org/cti/stix/v2.0/cs01/part1-stix-core/stix-v2.0-cs01-part1-stix-core.html#_Toc496709287
At the moment stix2 library gen... | diff --git a/stix2/exceptions.py b/stix2/exceptions.py
index 231eeb6..f1f1c09 100644
--- a/stix2/exceptions.py
+++ b/stix2/exceptions.py
@@ -203,3 +203,16 @@ class MarkingNotFoundError(STIXError, AssertionError):
def __str__(self):
msg = "Marking {0} was not found in {1}!"
return msg.format(self.... |
oasis-open__cti-python-stix2-27 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase.new_version"
],
"edited_modules": [
"stix2/base.py:_STIXBase"
]
},
"file": "stix2/base.py"
},
{
"changes": {
"added_entities": nul... | oasis-open/cti-python-stix2 | f8e3a4f0e895da95fbef109041dec26d6f968690 | Passing a list to Bundle constructor creates list within a list
Currently if you pass a list to the Bundle constructor it creates a list within a list:
```json
{
"objects":
[
[
{ },
{ }
]
]
... | diff --git a/docs/overview.rst b/docs/overview.rst
index 643253c..b8c3809 100644
--- a/docs/overview.rst
+++ b/docs/overview.rst
@@ -1,9 +1,6 @@
Overview
========
-Goals
------
-
High level goals/principles of the python-stix2 library:
1. It should be as easy as possible (but no easier!) to perform common tasks... |
oasis-open__cti-python-stix2-306 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2/patterns.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/properties.p... | oasis-open/cti-python-stix2 | d4c01157352552e2ec05bcf7b0f79ef96e34022d | Update to STIX 2.1WD06
Necessary changes I see:
* [ ] `indicator.pattern_version`: if stix patterning lang used, default is spec_version of the object
* [ ] Empty dictionaries are now prohibited just like empty lists
* [ ] `socket-ext.options` now has some requirements around its keys/values
* [ ] Add a test to mak... | diff --git a/stix2/patterns.py b/stix2/patterns.py
index 9656ff1..2e149be 100644
--- a/stix2/patterns.py
+++ b/stix2/patterns.py
@@ -135,6 +135,7 @@ _HASH_REGEX = {
"SHA3512": ("^[a-fA-F0-9]{128}$", "SHA3-512"),
"SSDEEP": ("^[a-zA-Z0-9/+:.]{1,128}$", "ssdeep"),
"WHIRLPOOL": ("^[a-fA-F0-9]{128}$", "WHIRLP... |
oasis-open__cti-python-stix2-32 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/__init__.py:parse_observable",
"stix2/__init__.py:_register_observable"
],
"edited_modules": [
"stix2/__init__.py:parse_observable",
"stix2/__init__.py:_registe... | oasis-open/cti-python-stix2 | 6f680be8a65028c303bae38bbe1fa0a2d08852a8 | Can't add custom observables to Observed Data object | diff --git a/stix2/__init__.py b/stix2/__init__.py
index 904af9c..18c0b33 100644
--- a/stix2/__init__.py
+++ b/stix2/__init__.py
@@ -5,22 +5,24 @@
from . import exceptions
from .bundle import Bundle
from .observables import (URL, AlternateDataStream, ArchiveExt, Artifact,
- AutonomousSystem,... |
oasis-open__cti-python-stix2-328 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/markings/utils.py:check_tlp_marking"
],
"edited_modules": [
"stix2/markings/utils.py:check_tlp_marking"
]
},
"file": "stix2/markings/utils.py"
},
{
"chang... | oasis-open/cti-python-stix2 | 0af1f442c0cb6e30132174b5b657a6a35ef78a08 | `name` field missing from MarkingDefinition object
Super quick one: MarkingDefinition object should have an optional `name` field as per the current spec. Believe it needs adding to `common.py`. | diff --git a/stix2/markings/utils.py b/stix2/markings/utils.py
index b1c103b..41516cc 100644
--- a/stix2/markings/utils.py
+++ b/stix2/markings/utils.py
@@ -271,8 +271,8 @@ def check_tlp_marking(marking_obj, spec_version):
else:
w = (
'{"created": "2017-01-20T00:00:00.... |
oasis-open__cti-python-stix2-342 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/datastore/memory.py:_add",
"stix2/datastore/memory.py:MemorySource.get",
"stix2/datastore/memory.py:MemorySource.all_versions"
],
"edited_modules": [
"stix2/dat... | oasis-open/cti-python-stix2 | fdb00c4a8cfe7327bbac609f029b3ff2366b8ccd | Adding SCO to the MemoryStore results in error
Below an example of how to trigger the problem:
``` python
from stix2.v21 import observables
from stix2 import MemoryStore
mem_store = MemoryStore()
file_observable = observables.File(
name="example.exe",
size=68 * 1000,
magic_number_hex="50000000... | diff --git a/stix2/datastore/memory.py b/stix2/datastore/memory.py
index 52bf4c8..52da168 100644
--- a/stix2/datastore/memory.py
+++ b/stix2/datastore/memory.py
@@ -10,7 +10,6 @@ from stix2.base import _STIXBase
from stix2.core import parse
from stix2.datastore import DataSink, DataSource, DataStoreMixin
from stix2.... |
oasis-open__cti-python-stix2-343 | [
{
"changes": {
"added_entities": [
"stix2/datastore/filesystem.py:_is_versioned_type_dir",
"stix2/datastore/filesystem.py:_search_unversioned"
],
"added_modules": [
"stix2/datastore/filesystem.py:_is_versioned_type_dir",
"stix2/datastore/filesystem.py:_search_un... | oasis-open/cti-python-stix2 | 8aca39a0b037647f055ad11c85e0f289835f9f3d | Adding SCO to FileSystemStore results in error
Below an example of how to trigger the problem:
``` python
from stix2.v21 import observables
from stix2 import FileSystemStore
fs_store = FileSystemStore("/test_dir")
file_observable = observables.File(
name="example.exe",
size=68 * 1000,
magic_nu... | diff --git a/stix2/datastore/filesystem.py b/stix2/datastore/filesystem.py
index e8442e6..d5acc24 100644
--- a/stix2/datastore/filesystem.py
+++ b/stix2/datastore/filesystem.py
@@ -15,7 +15,7 @@ from stix2.datastore import (
DataSink, DataSource, DataSourceError, DataStoreMixin,
)
from stix2.datastore.filters im... |
oasis-open__cti-python-stix2-344 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/pattern_visitor.py:create_pattern_object"
],
"edited_modules": [
"stix2/pattern_visitor.py:create_pattern_object"
]
},
"file": "stix2/pattern_visitor.py"
}
] | oasis-open/cti-python-stix2 | 8aca39a0b037647f055ad11c85e0f289835f9f3d | Incorrect Pattern Error Propagation
When using `stix2/pattern_visitor.py/create_pattern_object()` with a pattern that does not include matching single quotes (e.g. "[ file: name = 'weirdname]" ), the stix2 library returns an unhelpful and unclear error. This is in comparison to the more useful error message provided by... | diff --git a/stix2/pattern_visitor.py b/stix2/pattern_visitor.py
index b2d7a53..6ac3e98 100644
--- a/stix2/pattern_visitor.py
+++ b/stix2/pattern_visitor.py
@@ -1,16 +1,12 @@
import importlib
import inspect
-from antlr4 import CommonTokenStream, InputStream
-from antlr4.tree.Trees import Trees
-import six
from sti... |
oasis-open__cti-python-stix2-348 | [
{
"changes": {
"added_entities": [
"stix2/base.py:_recursive_stix_list_to_dict"
],
"added_modules": [
"stix2/base.py:_recursive_stix_list_to_dict"
],
"edited_entities": [
"stix2/base.py:_Observable._generate_id",
"stix2/base.py:_recursive_stix_to_dic... | oasis-open/cti-python-stix2 | 148d672b24552917d1666da379fbb3d7e85e1bc8 | File SCO with WindowsPEBinary using WindowsPESection causes JSON serialization error
Below an example of how to trigger the problem:
``` python
from stix2.v21 import observables
directory_observable = observables.Directory(path="/home/user-1/")
file_observable = observables.File(
name="example.exe",
p... | diff --git a/stix2/base.py b/stix2/base.py
index a283902..4248075 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -388,14 +388,12 @@ class _Observable(_STIXBase):
temp_deep_copy = copy.deepcopy(dict(kwargs[key]))
_recursive_stix_to_dict(temp_deep_copy)
... |
oasis-open__cti-python-stix2-354 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/custom.py:_custom_observable_builder"
],
"edited_modules": [
"stix2/custom.py:_custom_observable_builder",
"stix2/custom.py:_CustomObservable"
]
},
"file"... | oasis-open/cti-python-stix2 | 30a59ad77669cda8260640f99d6d8ff3a7574640 | Custom SCOs don't support `_id_contributing_properties`
When creating custom SCOs, cannot specify the `_id_contributing_properties` property to define which properties should be used for the custom SCOs' deterministic IDs | diff --git a/stix2/custom.py b/stix2/custom.py
index a00498b..802fd07 100644
--- a/stix2/custom.py
+++ b/stix2/custom.py
@@ -53,7 +53,10 @@ def _custom_marking_builder(cls, type, properties, version):
return _CustomMarking
-def _custom_observable_builder(cls, type, properties, version):
+def _custom_observable... |
oasis-open__cti-python-stix2-355 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"stix2/v21/sdo.py:Identity",
"stix2/v21/sdo.py:Indicator",
"stix2/v21/sdo.py:Infrastructure",
"stix2/v21/sdo.py:Malware",
"stix2/v21/sdo.py:R... | oasis-open/cti-python-stix2 | c2b71672f5504b975b113e3671e3279ceb503a65 | Because of "unknown", several properties have been changed to optional
See oasis-tcs/cti-stix2#211 | diff --git a/stix2/v21/sdo.py b/stix2/v21/sdo.py
index 1d97261..0f4a5a7 100644
--- a/stix2/v21/sdo.py
+++ b/stix2/v21/sdo.py
@@ -173,7 +173,7 @@ class Identity(STIXDomainObject):
('name', StringProperty(required=True)),
('description', StringProperty()),
('roles', ListProperty(StringProperty)... |
oasis-open__cti-python-stix2-358 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"stix2/v21/observables.py:Software"
]
},
"file": "stix2/v21/observables.py"
}
] | oasis-open/cti-python-stix2 | c2b71672f5504b975b113e3671e3279ceb503a65 | Changes made to Software SCO, and its usage.
See https://github.com/oasis-tcs/cti-stix2/issues/220 | diff --git a/stix2/v21/observables.py b/stix2/v21/observables.py
index ed560a6..68115a0 100644
--- a/stix2/v21/observables.py
+++ b/stix2/v21/observables.py
@@ -760,6 +760,7 @@ class Software(_Observable):
('id', IDProperty(_type, spec_version='2.1')),
('name', StringProperty(required=True)),
... |
oasis-open__cti-python-stix2-360 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/custom.py:_custom_observable_builder"
],
"edited_modules": [
"stix2/custom.py:_custom_observable_builder",
"stix2/custom.py:_CustomObservable"
]
},
"file"... | oasis-open/cti-python-stix2 | 3803e4bdd7877af8e11211f42261f324b2c92255 | Enforce hash keys in 2.1 external-references
Came out of https://github.com/oasis-tcs/cti-stix2/issues/192 | diff --git a/docs/guide/custom.ipynb b/docs/guide/custom.ipynb
index 8185269..7ceb33b 100644
--- a/docs/guide/custom.ipynb
+++ b/docs/guide/custom.ipynb
@@ -175,9 +175,9 @@
".highlight .vm { color: #19177C } /* Name.Variable.Magic */\n",
".highlight .il { color: #666666 } /* Literal.Number.Integer.Long ... |
oasis-open__cti-python-stix2-369 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"stix2/v21/sdo.py:Malware"
]
},
"file": "stix2/v21/sdo.py"
}
] | oasis-open/cti-python-stix2 | 380926cff59f9e0d70914c2de933e4651f13259d | Malware os_execution_envs changes
This property was renamed to operating_system_refs, is now list of Software SCO identifiers instead of strings, and no longer SHOULD be a CPE entry. | diff --git a/stix2/v21/sdo.py b/stix2/v21/sdo.py
index 1d97261..5c87515 100644
--- a/stix2/v21/sdo.py
+++ b/stix2/v21/sdo.py
@@ -460,7 +460,7 @@ class Malware(STIXDomainObject):
('kill_chain_phases', ListProperty(KillChainPhase)),
('first_seen', TimestampProperty()),
('last_seen', TimestampPr... |
oasis-open__cti-python-stix2-376 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/core.py:_register_object",
"stix2/core.py:_register_marking",
"stix2/core.py:_register_observable",
"stix2/core.py:_register_observable_extension"
],
"edited_mo... | oasis-open/cti-python-stix2 | e8035863b8d7300a2cdba4c0737c49cfadb18bda | Registering new custom Object and Observable does not check for duplicates
When registering a new custom object or observable, the `_register_object` and `_register_observable` functions do not check to see if the type of the object/observable being passed in already exists in `OBJ_MAP`, which could lead to an existing... | diff --git a/.travis.yml b/.travis.yml
index 018aefe..81141d5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-sudo: false
+os: linux
language: python
cache: pip
dist: xenial
diff --git a/stix2/core.py b/stix2/core.py
index b03e3d7..dd7aac1 100644
--- a/stix2/core.py
+++ b/stix2/core.py
@@ -8,7 +8,7 @@ im... |
oasis-open__cti-python-stix2-382 | [
{
"changes": {
"added_entities": [
"stix2/pattern_visitor.py:STIXPatternVisitorForSTIX21.__init__",
"stix2/pattern_visitor.py:STIXPatternVisitorForSTIX20.__init__"
],
"added_modules": [
"stix2/pattern_visitor.py:STIXPatternVisitorForSTIX21",
"stix2/pattern_visit... | oasis-open/cti-python-stix2 | 38817a603f8d02a614dadba6cccee05bf5622c2b | Add more tests for patterns
We should write some more tests for patterns.py and increase code coverage. | diff --git a/stix2/pattern_visitor.py b/stix2/pattern_visitor.py
index 6ac3e98..c0a0fdb 100644
--- a/stix2/pattern_visitor.py
+++ b/stix2/pattern_visitor.py
@@ -2,11 +2,19 @@ import importlib
import inspect
from stix2patterns.exceptions import ParseException
-from stix2patterns.grammars.STIXPatternParser import (
-... |
oasis-open__cti-python-stix2-393 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2/patterns.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/properties.p... | oasis-open/cti-python-stix2 | 658e70bf04b2145e8b108ea7117867288a31e2a7 | SSDEEP Hashing algorithm case mismatch
Currently if an `ssdeep` hash is added to an object it will change it to its lowercase variant (not aligned with Section 10.6 STIX 2.1 https://docs.oasis-open.org/cti/stix/v2.1/cs01/stix-v2.1-cs01.html#_tumklw3o2gyz) because stix2 will "clean" the field name. This causes the valid... | diff --git a/stix2/patterns.py b/stix2/patterns.py
index f0cceb8..a44f68e 100644
--- a/stix2/patterns.py
+++ b/stix2/patterns.py
@@ -121,21 +121,21 @@ class BooleanConstant(_Constant):
_HASH_REGEX = {
- "MD5": ("^[a-fA-F0-9]{32}$", "MD5"),
- "MD6": ("^[a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{56}|[a-fA-F0-... |
oasis-open__cti-python-stix2-402 | [
{
"changes": {
"added_entities": [
"stix2/base.py:_make_json_serializable",
"stix2/base.py:_un_json_escape"
],
"added_modules": [
"stix2/base.py:_make_json_serializable",
"stix2/base.py:_un_json_escape"
],
"edited_entities": [
"stix2/base.py:... | oasis-open/cti-python-stix2 | 41525f9be08eea163ee3b88cb9b30b82f9c66ff2 | `CustomExtension`s for `File` with `TimestampProperty`s can't handle `datetime` objects
STIX 2.1 File SCOs require that their extensions be considered when generating deterministic UUIDs, serialised following JSON canonicalisation rules. Defining a `CustomExtension` for `Files` that include a timestamp property results... | diff --git a/stix2/base.py b/stix2/base.py
index ef3fcb8..7336285 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -334,23 +334,20 @@ class _Observable(_STIXBase):
def __init__(self, **kwargs):
# the constructor might be called independently of an observed data object
self._STIXBase__valid_refs ... |
oasis-open__cti-python-stix2-436 | [
{
"changes": {
"added_entities": [
"stix2/pattern_visitor.py:same_boolean_operator"
],
"added_modules": [
"stix2/pattern_visitor.py:same_boolean_operator"
],
"edited_entities": [
"stix2/pattern_visitor.py:STIXPatternVisitorForSTIX2.visitComparisonExpression"... | oasis-open/cti-python-stix2 | bb82beeec109e5e45d3ee19da97f4cd145b3491d | Pattern AST creation bug
Comparison expression ORs can get changed to ANDs:
```python
from stix2.pattern_visitor import create_pattern_object
ast = create_pattern_object(pattern="[a:b=1 AND a:b=2 OR a:b=3]")
print(ast)
```
produces
```
[a:b = 1 AND a:b = 2 AND a:b = 3]
```
| diff --git a/stix2/pattern_visitor.py b/stix2/pattern_visitor.py
index 5b8300f..c4deb64 100644
--- a/stix2/pattern_visitor.py
+++ b/stix2/pattern_visitor.py
@@ -49,6 +49,9 @@ def check_for_valid_timetamp_syntax(timestamp_string):
return _TIMESTAMP_RE.match(timestamp_string)
+def same_boolean_operator(current_o... |
oasis-open__cti-python-stix2-444 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "setup.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/datastore/__init__.py... | oasis-open/cti-python-stix2 | 18ee0d831e7dd178e1208d57e47b63e05d7ccdf2 | Many datastores and helpers assume created and modified fields exist in objects
As an example, `CompositeDataSource`s attempt to access the `modified` key directly as well as making use of the `deduplicate()` helper which attempts to access `modified` and then falls back to `created` if that's missing. The following sn... | diff --git a/setup.py b/setup.py
index 2fc5d70..3a5ef8d 100644
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,7 @@ setup(
'requests',
'simplejson',
'six>=1.13.0',
- 'stix2-patterns>=1.2.0',
+ 'stix2-patterns',
],
project_urls={
'Documentation': 'https://stix2.read... |
oasis-open__cti-python-stix2-454 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/patterns.py:make_constant"
],
"edited_modules": [
"stix2/patterns.py:make_constant"
]
},
"file": "stix2/patterns.py"
}
] | oasis-open/cti-python-stix2 | 72a032c6e31387254629e730470c3974919765a9 | AST make_constant() function doesn't make timestamp constants
If make_constant() can interpret the passed value as a timestamp, it will return a STIXdatetime object instead of a timestamp constant. That results in an incorrect AST and messed up pattern format. E.g.
```python
import stix2.patterns
comp_expr = s... | diff --git a/stix2/patterns.py b/stix2/patterns.py
index bbee7ac..f1472cd 100644
--- a/stix2/patterns.py
+++ b/stix2/patterns.py
@@ -227,7 +227,7 @@ def make_constant(value):
return value
try:
- return parse_into_datetime(value)
+ return TimestampConstant(value)
except (ValueError, Ty... |
oasis-open__cti-python-stix2-456 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/patterns.py:_ComparisonExpression.__init__",
"stix2/patterns.py:_BooleanExpression.__init__",
"stix2/patterns.py:ParentheticalExpression.__init__"
],
"edited_modules": ... | oasis-open/cti-python-stix2 | 72a032c6e31387254629e730470c3974919765a9 | AST comparison expression root type check for 'AND' is buggy
For example,
```
[(type-a:a=1 OR type-b:b=2) AND (type-a:a=2 OR type-b:b=1)]
```
is okay, but
```
[type-a:a=1 AND (type-a:a=2 OR type-b:b=1)]
```
is not:
```
>>> stix2.pattern_visitor.create_pattern_object("[type-a:a=1 AND (type-a:a=2 OR t... | diff --git a/stix2/patterns.py b/stix2/patterns.py
index bbee7ac..c0b4997 100644
--- a/stix2/patterns.py
+++ b/stix2/patterns.py
@@ -366,7 +366,7 @@ class _ComparisonExpression(_PatternExpression):
else:
self.rhs = make_constant(rhs)
self.negated = negated
- self.root_type = self.l... |
oasis-open__cti-python-stix2-467 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/equivalence/object/__init__.py:semantically_equivalent",
"stix2/equivalence/object/__init__.py:check_property_present"
],
"edited_modules": [
"stix2/equivalence/object/... | oasis-open/cti-python-stix2 | cfb518a84b28339f1161ff11e7c239116e8cfa29 | "Location" type object throws an exception when using semantic equivalence
This is the object:
> {
> > 'administrative_area': 'US-DC',
> > 'country': 'US',
> > 'created': '2020-07-08T21:03:08.000Z',
> > 'id': 'location--373ca831-cc20-4987-af8e-3e66edc5a294',
> > 'modified': '2020-07-08T21:03:08.000Z',
> >... | diff --git a/stix2/equivalence/object/__init__.py b/stix2/equivalence/object/__init__.py
index 8333ceb..ec6cc42 100644
--- a/stix2/equivalence/object/__init__.py
+++ b/stix2/equivalence/object/__init__.py
@@ -68,7 +68,7 @@ def semantically_equivalent(obj1, obj2, prop_scores={}, **weight_dict):
sum_weights ... |
oasis-open__cti-python-stix2-470 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"stix2/v21/sro.py:Sighting"
]
},
"file": "stix2/v21/sro.py"
}
] | oasis-open/cti-python-stix2 | a751df32c681e3ddfef92f29b91c071b84e91033 | Sighting: where_sighted_refs enforced with wrong types
STIX 2.1 spec section 5.2 says for the `where_sighted_refs` property of the Sighting relationship:
```
This property MUST reference only Identity or Location SDOs.
```
But the stix2 library only allows Identity. This should be fixed to also allow Location ... | diff --git a/stix2/v21/sro.py b/stix2/v21/sro.py
index d287373..e6eada6 100644
--- a/stix2/v21/sro.py
+++ b/stix2/v21/sro.py
@@ -86,7 +86,7 @@ class Sighting(_RelationshipObject):
('count', IntegerProperty(min=0, max=999999999)),
('sighting_of_ref', ReferenceProperty(valid_types="SDO", spec_version='2... |
oasis-open__cti-python-stix2-474 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"stix2/v20/common.py:MarkingDefinition"
]
},
"file": "stix2/v20/common.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,... | oasis-open/cti-python-stix2 | a82dc5e8136b3103facb1cec93a63ac12b640942 | STIX Objects: Property ordering
Some object definitions do not contain their properties in the correct order. Affects the "pretty" serialization. | diff --git a/stix2/v20/common.py b/stix2/v20/common.py
index f2a371e..720f14f 100644
--- a/stix2/v20/common.py
+++ b/stix2/v20/common.py
@@ -124,11 +124,11 @@ class MarkingDefinition(_STIXBase20, _MarkingsMixin):
('id', IDProperty(_type, spec_version='2.0')),
('created_by_ref', ReferenceProperty(valid... |
oasis-open__cti-python-stix2-489 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/equivalence/pattern/transform/observation.py:DNFTransformer.__transform"
],
"edited_modules": [
"stix2/equivalence/pattern/transform/observation.py:DNFTransformer"
]
... | oasis-open/cti-python-stix2 | bfc47e73f5cdf336610e492e8fca4218566843d9 | Observation expression DNF transformer needs to preserve FOLLOWEDBY order
This was just a plain oversight on my part. The same basic code handled both distributing AND over OR and FOLLOWEDBY over OR, but those have differing requirements. FOLLOWEDBY order must always be preserved. For example:
```
([A] OR [B]) F... | diff --git a/stix2/equivalence/pattern/transform/observation.py b/stix2/equivalence/pattern/transform/observation.py
index ee698bd..029824d 100644
--- a/stix2/equivalence/pattern/transform/observation.py
+++ b/stix2/equivalence/pattern/transform/observation.py
@@ -282,6 +282,7 @@ class AbsorptionTransformer(
... |
oasis-open__cti-python-stix2-52 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2/__init__.py"
},
{
"changes": {
"added_entities": [
"stix2/environment.py:Environment.__init__",
"stix2/environment.py:Envi... | oasis-open/cti-python-stix2 | adac43708b52884c82bb3fae7127effa57de5017 | Create "Environment" class
This is an abstraction that will encompass a data source, data sink, and object factory, and potentially other state, in a unified interface for interacting with external STIX repositories. | diff --git a/stix2/__init__.py b/stix2/__init__.py
index c2aae2e..35b65b0 100644
--- a/stix2/__init__.py
+++ b/stix2/__init__.py
@@ -7,7 +7,7 @@ from .common import (TLP_AMBER, TLP_GREEN, TLP_RED, TLP_WHITE, CustomMarking,
ExternalReference, GranularMarking, KillChainPhase,
M... |
oasis-open__cti-python-stix2-534 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/equivalence/pattern/transform/comparison.py:_dupe_ast",
"stix2/equivalence/pattern/transform/comparison.py:DNFTransformer.transform_and"
],
"edited_modules": [
"stix2/e... | oasis-open/cti-python-stix2 | 81550cab92aaacbca5db0d37c607dfd1707ce4c3 | Pattern semantic equivalence comparison expression DNF transformer ignores SCO types
The pattern semantic equivalence comparison expression DNF transformer rearranges an AST and can create new comparison expression AND nodes. Current AST AND node implementation will check whether all operands have an SCO type in commo... | diff --git a/stix2/equivalence/pattern/transform/comparison.py b/stix2/equivalence/pattern/transform/comparison.py
index 93a80e4..9da91ef 100644
--- a/stix2/equivalence/pattern/transform/comparison.py
+++ b/stix2/equivalence/pattern/transform/comparison.py
@@ -13,8 +13,8 @@ from stix2.equivalence.pattern.transform.spec... |
oasis-open__cti-python-stix2-542 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/utils.py:detect_spec_version"
],
"edited_modules": [
"stix2/utils.py:detect_spec_version"
]
},
"file": "stix2/utils.py"
}
] | oasis-open/cti-python-stix2 | 17445a085cb84734900603eb8009bcc856892762 | Spec version detection should use presence, not value of spec_version for STIX 2.0 bundles
Current spec version detection (via `stix2.utils.detect_spec_version()`) uses the value of the `spec_version` property, if present, to determine the spec version of bundles. It should use only the presence. The STIX 2.0 spec sa... | diff --git a/stix2/utils.py b/stix2/utils.py
index 647a89f..8f679d4 100644
--- a/stix2/utils.py
+++ b/stix2/utils.py
@@ -327,9 +327,15 @@ def detect_spec_version(stix_dict):
obj_type = stix_dict["type"]
if 'spec_version' in stix_dict:
- # For STIX 2.0, applies to bundles only.
- # For STIX 2.1... |
oasis-open__cti-python-stix2-60 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules":... | oasis-open/cti-python-stix2 | e2151659d7d68d9c6878f050e52d5d1af6bb0fd6 | Improve Data Markings Ease-of-Use
Some ideas I had while writing documentation, for how to make data markings a little easier to use:
- [ ] Maybe `StatementMarking()` should return a `MarkingDefinition` object and not require the user to create both a `MarkingDefinition` and `StatementMarking` object. Would a user e... | diff --git a/stix2/__init__.py b/stix2/__init__.py
index 7be0904..53c2fb1 100644
--- a/stix2/__init__.py
+++ b/stix2/__init__.py
@@ -8,6 +8,8 @@ from .common import (TLP_AMBER, TLP_GREEN, TLP_RED, TLP_WHITE, CustomMarking,
MarkingDefinition, StatementMarking, TLPMarking)
from .core import Bundle,... |
oasis-open__cti-python-stix2-605 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/v21/common.py:GranularMarking._check_object_constraints"
],
"edited_modules": [
"stix2/v21/common.py:GranularMarking"
]
},
"file": "stix2/v21/common.py"
}
] | oasis-open/cti-python-stix2 | fa8c95bba783c9dce8e2c56391077aee22767553 | Granular marking constraint checking is incorrect
The STIX 2.1 spec [section 7.2.3](https://docs.oasis-open.org/cti/stix/v2.1/os/stix-v2.1-os.html#_robezi5egfdr) says that one cannot include both `lang` and `marking_ref` in a granular marking:
> Because each granular marking instance applies to either a language or ... | diff --git a/stix2/v21/common.py b/stix2/v21/common.py
index 55c4a05..ca795e0 100644
--- a/stix2/v21/common.py
+++ b/stix2/v21/common.py
@@ -77,6 +77,7 @@ class GranularMarking(_STIXBase21):
def _check_object_constraints(self):
super(GranularMarking, self)._check_object_constraints()
self._check_... |
oasis-open__cti-python-stix2-71 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules":... | oasis-open/cti-python-stix2 | 58f39f80af5cbfe02879c2efa4b3b4ef7a504390 | Add tests for FileSystem Data Stores, Sources, Sinks
Specifically for adding/pushing STIX objects to these DataStores/Sinks as they can now be supplied with STIX content of a variety of forms | diff --git a/stix2/__init__.py b/stix2/__init__.py
index 53c2fb1..7be0904 100644
--- a/stix2/__init__.py
+++ b/stix2/__init__.py
@@ -8,8 +8,6 @@ from .common import (TLP_AMBER, TLP_GREEN, TLP_RED, TLP_WHITE, CustomMarking,
MarkingDefinition, StatementMarking, TLPMarking)
from .core import Bundle,... |
oasis-open__cti-python-stix2-74 | [
{
"changes": {
"added_entities": [
"stix2/core.py:STIXObjectProperty.__init__"
],
"added_modules": null,
"edited_entities": [
"stix2/core.py:STIXObjectProperty.clean",
"stix2/core.py:Bundle.__init__"
],
"edited_modules": [
"stix2/core.py:STIXOb... | oasis-open/cti-python-stix2 | 3c80e5e7ebb641b5feb55337f9470ec9d9d58572 | Unable to creat 'Bundle' when using custom fields with SDO
Hi,
When attempting to generate a bundle, a failure message is created when passing an SDO with custom objects even with `allow_custom=True` set on the SDO object.
example:
`v = factory.create(
Vulnerability,
name="Test Vulnerability",
custom_field ... | diff --git a/stix2/core.py b/stix2/core.py
index 3eaabb0..8ee11f5 100644
--- a/stix2/core.py
+++ b/stix2/core.py
@@ -15,6 +15,10 @@ from .utils import get_dict
class STIXObjectProperty(Property):
+ def __init__(self, allow_custom=False):
+ self.allow_custom = allow_custom
+ super(STIXObjectPropert... |
oasis-open__cti-python-stix2-88 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/base.py:_STIXBase.object_properties"
],
"edited_modules": [
"stix2/base.py:_STIXBase"
]
},
"file": "stix2/base.py"
},
{
"changes": {
"added_entities... | oasis-open/cti-python-stix2 | 482135465bb9c7bb8cd1ec5eb600d3990b65e092 | Unable to add() Bundle.
example usage:
```
bundle = Bundle(*bArgs, allow_custom=True)
store.add(bundle)
```
```
Traceback (most recent call last):
File "stix.py", line 166, in <module>
store.add(bundle)
File "/usr/local/lib/python2.7/dist-packages/stix2/environment.py", line 147, in add
... | diff --git a/stix2/base.py b/stix2/base.py
index 5307393..b0cf6ff 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -40,7 +40,14 @@ class _STIXBase(collections.Mapping):
"""Base class for STIX object types"""
def object_properties(self):
- return list(self._properties.keys())
+ props = set(sel... |
oasis-open__cti-python-stix2-97 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2/sources/memory.py:MemorySink.save_to_file"
],
"edited_modules": [
"stix2/sources/memory.py:MemorySink"
]
},
"file": "stix2/sources/memory.py"
}
] | oasis-open/cti-python-stix2 | 07a5d3a98ea49f4c343d26f04810bf305c052c8a | Add tests for Memory Data Stores, Sources, Sinks
From #58 | diff --git a/stix2/sources/memory.py b/stix2/sources/memory.py
index 2d1705d..4d3943b 100644
--- a/stix2/sources/memory.py
+++ b/stix2/sources/memory.py
@@ -164,7 +164,7 @@ class MemorySink(DataSink):
if not os.path.exists(os.path.dirname(file_path)):
os.makedirs(os.path.dirname(file_path))
... |
oasis-open__cti-stix-elevator-195 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2elevator/cli.py:_get_arg_parser"
],
"edited_modules": [
"stix2elevator/cli.py:_get_arg_parser"
]
},
"file": "stix2elevator/cli.py"
},
{
"changes": {
... | oasis-open/cti-stix-elevator | 077cda7dc2bb9d04fd24dd93e89d2a1d988d539d | The disable/enable option are not handled correctly.
The use case is: programmatically enable/disable messages at any time.
Because of the way the enable/disable option works, using set_option_value will not work as expected
A user would have to know that the “real” option is disabled, not disable
There also see... | diff --git a/idioms-json-2.1-valid/Appendix_G_IOCs_Full.json b/idioms-json-2.1-valid/Appendix_G_IOCs_Full.json
index b6c60fb..2f62f74 100644
--- a/idioms-json-2.1-valid/Appendix_G_IOCs_Full.json
+++ b/idioms-json-2.1-valid/Appendix_G_IOCs_Full.json
@@ -1451,4 +1451,4 @@
}
],
"type": "bundle"
-}
+}
\ ... |
oasis-open__cti-stix-validator-109 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2validator/v21/musts.py:patterns"
],
"edited_modules": [
"stix2validator/v21/musts.py:patterns"
]
},
"file": "stix2validator/v21/musts.py"
}
] | oasis-open/cti-stix-validator | 3e2486c337b9e72e18443d26804556d147e9d6cd | The pattern validator should not be invoked for non-STIX patterns
If the pattern type is snort, the STIX validator will still try to see if it is valid for the STIX Pattern language - which of course it isn't. We should not output a warning in these cases. | diff --git a/stix2validator/v21/musts.py b/stix2validator/v21/musts.py
index 9c71fa9..776adc4 100644
--- a/stix2validator/v21/musts.py
+++ b/stix2validator/v21/musts.py
@@ -408,6 +408,9 @@ def patterns(instance, options):
if instance['type'] != 'indicator' or 'pattern' not in instance:
return
+ if in... |
oasis-open__cti-stix-validator-140 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2validator/util.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modu... | oasis-open/cti-stix-validator | e8acfbf17cf744345a905c6377b9a64013cd79d9 | Changes to Malware Analysis object
see https://github.com/oasis-tcs/cti-stix2/issues/213 and https://github.com/oasis-tcs/cti-stix2/issues/210 | diff --git a/docs/best-practices.rst b/docs/best-practices.rst
index d7a73d2..0bca34f 100644
--- a/docs/best-practices.rst
+++ b/docs/best-practices.rst
@@ -320,10 +320,6 @@ Optional Checks - STIX 2.1
| | | | '<hash_type>', which is longer than ... |
oasis-open__cti-stix-validator-161 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2validator/v21/enums.py"
}
] | oasis-open/cti-stix-validator | 2aefc8ca80bb94022e777dba185503825e46b05a | Latitude is Misspelled Causing Validator to Assume it's a "custom property"
https://github.com/oasis-open/cti-stix-validator/blob/2aefc8ca80bb94022e777dba185503825e46b05a/stix2validator/v21/enums.py#L657 | diff --git a/stix2validator/v21/enums.py b/stix2validator/v21/enums.py
index e03019a..add4d79 100644
--- a/stix2validator/v21/enums.py
+++ b/stix2validator/v21/enums.py
@@ -654,7 +654,7 @@ PROPERTIES = {
'object_marking_refs',
'granular_markings',
'description',
- 'latittude',
+ ... |
oasis-open__cti-stix-validator-55 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"stix2validator/scripts/stix2_validator.py:main"
],
"edited_modules": [
"stix2validator/scripts/stix2_validator.py:main"
]
},
"file": "stix2validator/scripts/stix2_valid... | oasis-open/cti-stix-validator | f3dcf83c352c99b5190e9697db7149ce3baf5961 | handle options --verbose and --silent correctly
Related to #50
The correct combination of these two should be as follows:
|--verbose | --silent | desired behavior |
| --- | --- | --- |
|absent (default is False) | absent (default is False) | all messages except those printed by info |
|absent (default is Fa... | diff --git a/stix2validator/scripts/stix2_validator.py b/stix2validator/scripts/stix2_validator.py
index 15bd7b0..8dda167 100644
--- a/stix2validator/scripts/stix2_validator.py
+++ b/stix2validator/scripts/stix2_validator.py
@@ -292,9 +292,6 @@ def main():
options = ValidationOptions(args)
try:
- # S... |
oasis-open__cti-stix-validator-69 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "stix2validator/__init__.py"
},
{
"changes": {
"added_entities": [
"stix2validator/output.py:print_results_header",
"stix2validat... | oasis-open/cti-stix-validator | e47ffb22958eb81d60b293f3efcc2fab33827f14 | The validator logger has introduced problems for the elevator logger
Once the validator 1.0.1 was used with the elevator, each elevator message was output twice.
This temporary fix (https://github.com/oasis-open/cti-stix-elevator/commit/b7ce45baf17c0652afaf536415a3781021000f49) in the elevator solved the problem, bu... | diff --git a/stix2validator/__init__.py b/stix2validator/__init__.py
index 83efa8d..7cc2db5 100644
--- a/stix2validator/__init__.py
+++ b/stix2validator/__init__.py
@@ -1,7 +1,6 @@
# Expose certain functions and classes to the stix2validator namespace
# flake8: noqa
-import logging
import sys
from .errors impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.