Skip to content

Instantly share code, notes, and snippets.

☢️

John Andersen pdxjohnny

☢️
View GitHub Profile
@pdxjohnny
pdxjohnny / df-source.diff
Created Aug 4, 2020
DataFlow source accumulator operation partial modifications to source for record() etc.
View df-source.diff
diff --git a/dffml/source/df.py b/dffml/source/df.py
index 380e6312..af9e44c8 100644
--- a/dffml/source/df.py
+++ b/dffml/source/df.py
@@ -17,17 +17,70 @@ class DataFlowSourceConfig:
source: BaseSource
dataflow: DataFlow
features: Features
+ length: str = field("Definition name to add as source length", default=None)
orchestrator: BaseOrchestrator = MemoryOrchestrator.withconfig({})
@pdxjohnny
pdxjohnny / client.py
Last active Jul 13, 2020
Have requests use Windows certs for TLS/SSL validation
View client.py
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@pdxjohnny
pdxjohnny / full.patch
Created Jun 25, 2020
saksham defaults edits (NO_DEFAULTS)
View full.patch
commit 722561381fb70aa895b786b39934ed2316420aab
Author: sakshamarora1 <sakshamarora1001@gmail.com>
Date: Tue Jun 23 20:48:06 2020 +0530
df: memory: Support default values for definitions
Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
diff --git a/dffml/df/base.py b/dffml/df/base.py
index d11c3f73..a7695722 100644
@pdxjohnny
pdxjohnny / edits.diff
Created Jun 25, 2020
saksham defaults edits (NO_DEFAULTS)
View edits.diff
diff --git a/dffml/df/base.py b/dffml/df/base.py
index 2494fcc4..a7695722 100644
--- a/dffml/df/base.py
+++ b/dffml/df/base.py
@@ -17,7 +17,7 @@ from dataclasses import is_dataclass
from contextlib import asynccontextmanager
from .exceptions import NotOpImp
-from .types import Operation, Input, Parameter, Stage, Definition
+from .types import Operation, Input, Parameter, Stage, Definition, NO_DEFAULT
@pdxjohnny
pdxjohnny / pagination.py
Last active Jul 13, 2020
Python example pagination client and server
View pagination.py
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@pdxjohnny
pdxjohnny / default-values.patch
Created Jun 16, 2020
DFFML memory support default values TODO
View default-values.patch
diff --git a/dffml/df/memory.py b/dffml/df/memory.py
index 7d29c84f..f6c7cdfb 100644
--- a/dffml/df/memory.py
+++ b/dffml/df/memory.py
@@ -586,8 +586,27 @@ class MemoryInputNetworkContext(BaseInputNetworkContext):
],
)
)
- # Return if there is no data for an input
+ # There is no data in the network for an input
@pdxjohnny
pdxjohnny / cmd.sh
Last active Jun 16, 2020
DFFML sharedconfig
View cmd.sh
dffml service dev export -configloader yaml test:dataflow
@pdxjohnny
pdxjohnny / cmds.patch
Created Jun 10, 2020
DFFML display model config as yaml-ish for `dffml model list`
View cmds.patch
diff --git a/dffml/util/cli/cmds.py b/dffml/util/cli/cmds.py
index 26227b49..0ccb2c25 100644
--- a/dffml/util/cli/cmds.py
+++ b/dffml/util/cli/cmds.py
@@ -1,3 +1,4 @@
+import json
import inspect
from typing import List
@@ -9,6 +10,7 @@ from ...base import config, field
@pdxjohnny
pdxjohnny / cvedb-asyncio.py
Created May 20, 2020
Original cve-bin-tool CVE db code (async)
View cvedb-asyncio.py
'''
Retrieval access and caching of NIST CVE database
'''
import os
import re
import gzip
import json
import glob
import asyncio
import hashlib
@pdxjohnny
pdxjohnny / tar_vs_shutil.py
Created May 15, 2020
Untaring vs. using shutil.unpack_archive
View tar_vs_shutil.py
import os
import shutil
import pathlib
import tempfile
import functools
import subprocess
import contextlib
import urllib.request
You can’t perform that action at this time.