message
stringlengths 13
484
| diff
stringlengths 38
4.63k
|
---|---|
fix: detect the external interface
This commit replaces eno1 with the
correct interface nem of the router gateway in
the OVN deployment. | # Create a logical router to connect the VMs switch
#
ovn-nbctl lr-add lr0
- ovn-nbctl lrp-add lr0 lr0-sw0 00:00:00:65:77:09 {{ kubeinit_inventory_network_gateway }}/24
+ ovn-nbctl lrp-add lr0 lr0-sw0 00:00:00:65:77:09 {{ kubeinit_inventory_network_gateway }}/{{ kubeinit_inventory_network_cidr }}
ovn-nbctl lsp-add sw0 sw0-lr0
ovn-nbctl lsp-set-type sw0-lr0 router
ovn-nbctl lsp-set-addresses sw0-lr0 router
#
sysctl net.ipv4.conf.all.rp_filter=2
#
- # NAT from eno1
+ # NAT from the external interface
#
- iptables -t nat -A POSTROUTING -s {{ kubeinit_inventory_network_net }}/{{ kubeinit_inventory_network_cidr }} -o eno1 -j MASQUERADE
+ # Get the external interface name
+ iface=$(ip route get "8.8.8.8" | grep -Po '(?<=(dev )).*(?= src| proto)')
#
- iptables -A FORWARD -i eno1 -j ACCEPT
+ iptables -t nat -A POSTROUTING -s {{ kubeinit_inventory_network_net }}/{{ kubeinit_inventory_network_cidr }} -o $iface -j MASQUERADE
+ #
+ iptables -A FORWARD -i $iface -j ACCEPT
iptables -A FORWARD -i br-ex -j ACCEPT
- iptables -A FORWARD -o eno1 -j ACCEPT
+ iptables -A FORWARD -o $iface -j ACCEPT
iptables -A FORWARD -o br-ex -j ACCEPT
#
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
|
dispersion_analysis.py: free unused memory after each step
allows running several examples in parallel without hogging memory | @@ -10,6 +10,7 @@ from __future__ import absolute_import
import os
import sys
sys.path.append('.')
+import gc
import functools
from copy import copy
from argparse import ArgumentParser, RawDescriptionHelpFormatter
@@ -481,6 +482,8 @@ def main():
save_eigenvectors(eigenshapes_filename % iv, svecs, pb)
+ gc.collect()
+
log(save_figure=os.path.join(output_dir, 'frequencies.png'))
log(finished=True)
@@ -538,6 +541,8 @@ def main():
save_eigenvectors(eigenshapes_filename % io, svecs, pb)
+ gc.collect()
+
log(save_figure=os.path.join(output_dir, 'wave-numbers.png'))
log(finished=True)
|
Update exchange_powershell_abuse_via_ssrf.yml
Resolving | name: Exchange PowerShell Abuse via SSRF
id: 29228ab4-0762-11ec-94aa-acde48001122
-version: 1
-date: '2021-08-27'
+version: 2
+date: '2022-10-02'
author: Michael Haag, Splunk
type: TTP
datamodel: []
@@ -20,7 +20,7 @@ description: 'This analytic identifies suspicious behavior related to ProxyShell
Review the source attempting to perform this activity against your environment.
In addition, review PowerShell logs and access recently granted to Exchange roles.'
-search: '| `exchange` c_uri="*//autodiscover.json*" cs_uri_query="*PowerShell*" cs_method="POST"
+search: '`exchange` c_uri="*//autodiscover.json*" cs_uri_query="*PowerShell*" cs_method="POST"
| stats count min(_time) as firstTime max(_time) as lastTime by dest, cs_uri_query,
cs_method, c_uri | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
| `exchange_powershell_abuse_via_ssrf_filter`'
|
interface: fix DeprecationWarnings re SSLContext
```
...\electrum\electrum\interface.py:585: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated.
sslc = ssl.SSLContext()
...\electrum\electrum\interface.py:585: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
sslc = ssl.SSLContext()
``` | @@ -495,8 +495,8 @@ class Interface(Logger):
sslc = ca_sslc
else:
# pinned self-signed cert
- sslc = ssl.create_default_context(ssl.Purpose.SERVER_AUTH, cafile=self.cert_path)
- sslc.check_hostname = 0
+ sslc = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=self.cert_path)
+ sslc.check_hostname = False
return sslc
def handle_disconnect(func):
@@ -582,7 +582,9 @@ class Interface(Logger):
raise GracefulDisconnect("could not get certificate after 10 tries")
async def _fetch_certificate(self) -> bytes:
- sslc = ssl.SSLContext()
+ sslc = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
+ sslc.check_hostname = False
+ sslc.verify_mode = ssl.CERT_NONE
async with _RSClient(session_factory=RPCSession,
host=self.host, port=self.port,
ssl=sslc, proxy=self.proxy) as session:
|
Fix broken test_discovery_with_libvirt_error
Mock only small parts of libvirt not the whole library,
when testing libvirt discovery.
Closes-Bug: | @@ -130,6 +130,9 @@ class FakeManualInstanceConn(object):
def listAllDomains(self):
return [FakeManualInstanceDomain()]
+ def isAlive(self):
+ return False
+
class TestDiscovery(base.BaseTestCase):
@@ -288,14 +291,13 @@ class TestDiscovery(base.BaseTestCase):
self.client.instance_get_all_by_host.call_args_list)
@testtools.skipUnless(libvirt, "libvirt not available")
- @mock.patch.object(utils, "libvirt")
- @mock.patch.object(discovery, "libvirt")
- def test_discovery_with_libvirt_error(self, libvirt, libvirt2):
+ @mock.patch.object(libvirt, "VIR_DOMAIN_METADATA_ELEMENT", 2)
+ @mock.patch.object(libvirt, "openReadOnly")
+ def test_discovery_with_libvirt_error(self, openReadOnly):
self.CONF.set_override("instance_discovery_method",
"libvirt_metadata",
group="compute")
- libvirt.VIR_DOMAIN_METADATA_ELEMENT = 2
- libvirt2.openReadOnly.return_value = FakeManualInstanceConn()
+ openReadOnly.return_value = FakeManualInstanceConn()
dsc = discovery.InstanceDiscovery(self.CONF)
resources = dsc.discover(mock.MagicMock())
self.assertEqual(0, len(resources))
|
update regex for eos processName
some EOS processNames contain '-' for example:
ProcMgr-worker | @@ -9,7 +9,7 @@ prefixes:
date: (\w+ +\d+)
time: (\d\d:\d\d:\d\d)
host: ([^ ]+)
- processName: (\w+)
+ processName: ([\w-]+)
tag: ([\w-]+)
line: '{date} {time} {host} {processName}: %{tag}'
# ISO8601 date-time format
@@ -17,6 +17,6 @@ prefixes:
date: (\d{4}-\d{2}-\d{2})
time: (\d{2}:\d{2}:\d{2}[\.\d{3}]?[\+|-]\d{2}:\d{2})
host: ([^ ]+)
- processName: (\w+)
+ processName: ([\w-]+)
tag: ([\w-]+)
line: '{date}T{time} {host} {processName}: %{tag}'
|
MAINT: Decrement stacklevel to 2 for public linalg funcs
[ci skip] | @@ -176,7 +176,7 @@ def solve(a, b, sym_pos=False, lower=False, overwrite_a=False,
if debug is not None:
warn('Use of the "debug" keyword is deprecated '
'and this keyword will be removed in future '
- 'versions of SciPy.', DeprecationWarning, stacklevel=3)
+ 'versions of SciPy.', DeprecationWarning, stacklevel=2)
# Get the correct lamch function.
# The LAMCH functions only exists for S and D
@@ -330,7 +330,7 @@ def solve_triangular(a, b, trans=0, lower=False, unit_diagonal=False,
if debug is not None:
warn('Use of the "debug" keyword is deprecated '
'and this keyword will be removed in the future '
- 'versions of SciPy.', DeprecationWarning, stacklevel=3)
+ 'versions of SciPy.', DeprecationWarning, stacklevel=2)
a1 = _asarray_validated(a, check_finite=check_finite)
b1 = _asarray_validated(b, check_finite=check_finite)
@@ -428,7 +428,7 @@ def solve_banded(l_and_u, ab, b, overwrite_ab=False, overwrite_b=False,
if debug is not None:
warn('Use of the "debug" keyword is deprecated '
'and this keyword will be removed in the future '
- 'versions of SciPy.', DeprecationWarning, stacklevel=3)
+ 'versions of SciPy.', DeprecationWarning, stacklevel=2)
a1 = _asarray_validated(ab, check_finite=check_finite, as_inexact=True)
b1 = _asarray_validated(b, check_finite=check_finite, as_inexact=True)
@@ -1222,7 +1222,7 @@ def lstsq(a, b, cond=None, overwrite_a=False, overwrite_b=False,
# restart with gelss
lstsq.default_lapack_driver = 'gelss'
mesg += "Falling back to 'gelss' driver."
- warn(mesg, RuntimeWarning, stacklevel=3)
+ warn(mesg, RuntimeWarning, stacklevel=2)
return lstsq(a, b, cond, overwrite_a, overwrite_b,
check_finite, lapack_driver='gelss')
|
Make one of the slowest io.fits tests faster by generating fewer random numbers
But use a random seed so the test cannot become flaky (even if very
unlikely) because the quantization only loses precision if the noise in
each tile is "high enough". | @@ -1506,7 +1506,8 @@ class TestCompressedImage(FitsTestCase):
def test_lossless_gzip_compression(self):
"""Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/198"""
- noise = np.random.normal(size=(1000, 1000))
+ rng = np.random.RandomState(seed=42)
+ noise = rng.normal(size=(20, 20))
chdu1 = fits.CompImageHDU(data=noise, compression_type='GZIP_1')
# First make a test image with lossy compression and make sure it
|
soundd: increase upper bound for volume level
Raise soundd upper limit | @@ -48,7 +48,7 @@ void Sound::update() {
// scale volume using ambient noise level
if (sm.updated("microphone")) {
- float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 56.f, 0.f, 1.f);
+ float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 60.f, 0.f, 1.f);
volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale);
Hardware::set_volume(volume);
}
|
Report more info from and robustify the ToyService
Maybe this will make it not fail and fix | @@ -18,6 +18,7 @@ from builtins import range
import codecs
import os
import random
+import traceback
import unittest
# Python 3 compatibility imports
@@ -277,7 +278,7 @@ class ToyService(Job.Service):
try:
while True:
if terminate.isSet(): # Quit if we've got the terminate signal
- logger.debug("Demo service worker being told to quit")
+ logger.debug("Service worker being told to quit")
return
time.sleep(0.2) # Sleep to avoid thrashing
@@ -288,20 +289,27 @@ class ToyService(Job.Service):
fH = codecs.getreader('utf-8')(fH)
line = fH.readline()
except:
- logger.debug("Something went wrong reading a line")
+ logger.debug("Something went wrong reading a line: %s", traceback.format_exc())
raise
+ if len(line.strip()) == 0:
+ # Don't try and make an integer out of nothing
+ continue
+
# Try converting the input line into an integer
try:
inputInt = int(line)
except ValueError:
- logger.debug("Tried casting input line to integer but got error: %s" % line)
+ logger.debug("Tried casting input line '%s' to integer but got error: %s", line, traceback.format_exc())
continue
# Write out the resulting read integer and the message
with jobStore.updateFileStream(outJobStoreID) as fH:
fH.write(("%s %s\n" % (inputInt, messageInt)).encode('utf-8'))
+
+ logger.debug("Service worker did useful work")
except:
+ logger.debug("Error in service worker: %s", traceback.format_exc())
error.set()
raise
|
Added functions.
Added subgeo2gei, subgei2geo. | @@ -711,3 +711,67 @@ def subsm2gsm(time_in, data_in):
# gvector = np.column_stack((xgsm, ygsm, zgsm))
return [xgsm, ygsm, zgsm]
+
+
+def subgei2geo(time_in, data_in):
+ """
+ Transform data from GEI to GEO.
+
+ Parameters
+ ----------
+ time_in: list of float
+ Time array.
+ data_in: list of float
+ Coordinates in GEI.
+
+ Returns
+ -------
+ list
+ Coordinates in GEO.
+
+ """
+ xgeo, ygeo, zgeo = 0, 0, 0
+ d = np.array(data_in)
+ xgei, ygei, zgei = d[:, 0], d[:, 1], d[:, 2]
+ gst, slong, sra, sdec, obliq = csundir_vect(time_in)
+
+ sgst = np.sin(gst)
+ cgst = np.cos(gst)
+
+ xgeo = cgst * xgei + sgst * ygei
+ ygeo = -sgst * xgei + cgst * ygei
+ zgeo = zgei
+
+ return [xgeo, ygeo, zgeo]
+
+
+def subgeo2gei(time_in, data_in):
+ """
+ Transform data from GEO to GEI.
+
+ Parameters
+ ----------
+ time_in: list of float
+ Time array.
+ data_in: list of float
+ Coordinates in GEI.
+
+ Returns
+ -------
+ list
+ Coordinates in GEI.
+
+ """
+ xgei, ygei, zgei = 0, 0, 0
+ d = np.array(data_in)
+ xgeo, ygeo, zgeo = d[:, 0], d[:, 1], d[:, 2]
+ gst, slong, sra, sdec, obliq = csundir_vect(time_in)
+
+ sgst = np.sin(gst)
+ cgst = np.cos(gst)
+
+ xgei = cgst * xgeo - sgst * ygeo
+ ygei = sgst * xgeo + cgst * ygeo
+ zgei = zgeo
+
+ return [xgei, ygei, zgei]
|
fix mignore rules not being cleared when...
... mignore file is deleted | @@ -568,12 +568,12 @@ class UpDownSync:
@property
def mignore_rules(self):
- if get_ctime(self.mignore_path) > self._mignore_load_time:
+ if get_ctime(self.mignore_path) != self._mignore_ctime_loaded:
self._mignore_rules = self._load_mignore_rules_form_file()
return self._mignore_rules
def _load_mignore_rules_form_file(self):
- self._mignore_load_time = time.time()
+ self._mignore_ctime_loaded = get_ctime(self.mignore_path)
try:
with open(self.mignore_path, "r") as f:
spec = f.read()
|
remove setup_requires
# 163 this was causing issues because pip/setuptools ignores a given index url for setup_requires | @@ -56,12 +56,6 @@ class DeployPypi(Command):
msg="Uploading package to pypi")
-SETUP_REQUIRES = [
- "setuptools>=36",
- "pytest-runner",
-]
-
-
TESTS_REQUIRE = [
"pytest>=3.1.0",
"pytest-cov",
@@ -74,8 +68,6 @@ TESTS_REQUIRE = [
setup(
name="tavern",
- setup_requires=SETUP_REQUIRES,
-
cmdclass={
"docs": BuildDocs,
"upload_twine": DeployPypi,
|
GafferArnold::ParameterHandler : Allow overriding to a ClosurePlug
using gaffer.plugType | @@ -234,6 +234,7 @@ const AtString g_gafferPlugTypeArnoldString( "gaffer.plugType" );
const AtString g_FloatPlugArnoldString( "FloatPlug" );
const AtString g_Color3fPlugArnoldString( "Color3fPlug" );
const AtString g_Color4fPlugArnoldString( "Color4fPlug" );
+const AtString g_ClosurePlugArnoldString( "ClosurePlug" );
} // namespace
@@ -310,6 +311,10 @@ Gaffer::Plug *ParameterHandler::setupPlug( const AtNodeEntry *node, const AtPara
{
parameterType = AI_TYPE_RGBA;
}
+ else if( plugTypeOverride == g_ClosurePlugArnoldString )
+ {
+ parameterType = AI_TYPE_CLOSURE;
+ }
else
{
msg(
|
Deseasonify: adjust 'Merrybot' to 'MerryBot'
For the sake of consistency - all other seasonal bot names have
the B capitalized. | @@ -33,7 +33,7 @@ class Christmas(SeasonBase):
"""Branding for December."""
season_name = "Festive season"
- bot_name = "Merrybot"
+ bot_name = "MerryBot"
colour = Colours.soft_red
description = (
|
add pudl_out access to the gen/pm/fuel ownership scaled something...
i hate it... but it does indeed work. | @@ -823,6 +823,35 @@ class PudlTabl(object):
)
return self._dfs["gen_allocated_eia923"]
+ def gen_pm_fuel_ownership(self, update=False):
+ """
+ WIP.
+
+ This is what is needed to generate a ownership scaled output at the
+ generator/prime_mover/fuel level... But this shouldn't really live here.
+ """
+ if update or self._dfs["gen_pm_fuel_own"] is None:
+ idx_gens = pudl.analysis.allocate_net_gen.IDX_GENS
+ self._dfs[
+ "gen_pm_fuel_own"
+ ] = pudl.analysis.plant_parts_eia.MakeMegaGenTbl().slice_by_ownership(
+ gens_mega=pd.merge(
+ self.gen_pm_fuel_allocated_eia923(),
+ self.gens_eia860()[idx_gens + ["utility_id_eia", "capacity_mw"]],
+ on=idx_gens,
+ validate="m:1",
+ how="left",
+ ),
+ own_eia860=self.own_eia860(),
+ slice_cols=[
+ "net_generation_mwh",
+ "fuel_consumed_mmbtu",
+ "capacity_mw",
+ ],
+ validate="m:m",
+ )
+ return self._dfs["gen_pm_fuel_own"]
+
###########################################################################
# FERC FORM 1 OUTPUTS
###########################################################################
|
Reflect the fact that AWS free tier is not enough
The AWS free tier covers only a t2.micro instance, which is unsufficient (nowadays?) for installing TLJH. | @@ -14,9 +14,6 @@ Prerequisites
#. An Amazon Web Services account.
- The `AWS free tier <https://aws.amazon.com/free/>`_ is fully
- capable of running a minimal littlest Jupyterhub for testing purposes.
-
If asked to choose a default region, choose the one closest to the majority
of your users.
|
Handled case where RPC may not exist for a given RPC.
The current implementation prints "invalid command: " for both an invalid command and cases where RPC might not exist but command is valid | @@ -458,6 +458,8 @@ class _Connection(object):
encode = None if sys.version < '3' else 'unicode'
return etree.tostring(rsp[0], encoding=encode)
return rsp[0]
+ except TypeError:
+ return "No RPC equivalent found for: " + command
except:
return "invalid command: " + command
|
ceph-rgw: add cluster parameter on ceph_ec_profile
introduced a regression with the ceph_ec_profile module call in
the ceph-rgw role due the missing cluster module parameter. | - name: create ec profile
ceph_ec_profile:
name: "{{ item.value.ec_profile }}"
+ cluster: "{{ cluster }}"
k: "{{ item.value.ec_k }}"
m: "{{ item.value.ec_m }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
|
Bump minimum version of galaxy-lib
Follow common-workflow-language/cwltool#982
Resolve software requirements using Environment Modules | @@ -36,7 +36,7 @@ def runSetup():
apacheLibcloud = 'apache-libcloud==2.2.1'
cwltool = 'cwltool==1.0.20180820141117'
schemaSalad = 'schema-salad>=2.6, <3'
- galaxyLib = 'galaxy-lib==17.9.3'
+ galaxyLib = 'galaxy-lib==17.9.9'
htcondor = 'htcondor>=8.6.0'
dill = 'dill==0.2.7.1'
six = 'six>=1.10.0'
|
ENH: stats.dlaplace.rvs improvements
This commit incorporates the following recommendations:
1) Add references in the comments
2) Use np.expm1 to improve accuracy | @@ -941,13 +941,19 @@ class dlaplace_gen(rv_discrete):
# The discrete Laplace is equivalent to the two-sided geometric
# distribution with PMF:
# f(k) = (1 - alpha)/(1 + alpha) * alpha^abs(k)
+ # Reference:
+ # https://www.sciencedirect.com/science/
+ # article/abs/pii/S0378375804003519
# Furthermore, the two-sided geometric distribution is
# equivalent to the difference between two iid geometric
# distributions.
+ # Reference (page 179):
+ # https://pdfs.semanticscholar.org/61b3/
+ # b99f466815808fd0d03f5d2791eea8b541a1.pdf
# Thus, we can leverage the following:
# 1) alpha = e^-a
# 2) probability_of_success = 1 - alpha (Bernoulli trial)
- probOfSuccess = 1. - np.exp(-np.asarray(a))
+ probOfSuccess = -np.expm1(-np.asarray(a))
x = self._random_state.geometric(probOfSuccess, size=self._size)
y = self._random_state.geometric(probOfSuccess, size=self._size)
return x - y
|
Temporarily add vcrpy!=2.0.0 as requirement for nose-detecthttp
nose-detecthttp requires vcrpy. vcrpy 2.0.0 has had a breaking change which
makes it incompatible with Python<3.5.[1]
The root issue should be fixed upstream, but till then avoid vcrpy 2.0.0.
[1]: | @@ -77,6 +77,8 @@ commands =
deps =
nose
nose-detecthttp
+ # Temporary requirement. Should be fixed in vcrpy or required in nose-detecthttp.
+ vcrpy!=2.0.0
unicodecsv
mock
@@ -91,6 +93,8 @@ deps =
beautifulsoup4
nose
nose-detecthttp>=0.1.3
+ # Temporary requirement. Should be fixed in vcrpy or required in nose-detecthttp.
+ vcrpy!=2.0.0
six
mock
|
Removed `compute_callrate_mt` default value
since it triggered `hl.init()` | @@ -162,7 +162,7 @@ def get_qc_mt(
def compute_callrate_mt(
mt: hl.MatrixTable,
- intervals_ht: hl.Table = hl.import_locus_intervals(exome_calling_intervals_path),
+ intervals_ht: hl.Table,
bi_allelic_only: bool = True,
autosomes_only: bool = True
) -> hl.MatrixTable:
@@ -177,7 +177,7 @@ def compute_callrate_mt(
contain an `interval_info` field containing all non-key fields of the `intervals_ht`.
:param MatrixTable mt: Input MT
- :param Table intervals_ht: Table containing the intervals. This table has to be keyed by locus. Default is the Broad exome calling intervals.
+ :param Table intervals_ht: Table containing the intervals. This table has to be keyed by locus.
:param bool bi_allelic_only: If set, only bi-allelic sites are used for the computation
:param bool autosomes_only: If set, only autosomal intervals are used.
:return: Callrate MT
|
fix error while loading cv2.VideoCapture
* test=develop fix error while loading cv2.VideoCapture
* test=develop
fix bug of index out of range in SampleFrames
* fix bug | import os
import sys
+import cv2
import math
import random
import functools
@@ -386,7 +387,6 @@ def video_loader(frames, nsample, seglen, mode):
def mp4_loader(filepath, nsample, seglen, mode):
cap = cv2.VideoCapture(filepath)
videolen = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
- average_dur = int(videolen / nsample)
sampledFrames = []
for i in range(videolen):
ret, frame = cap.read()
@@ -395,7 +395,7 @@ def mp4_loader(filepath, nsample, seglen, mode):
continue
img = frame[:, :, ::-1]
sampledFrames.append(img)
-
+ average_dur = int(len(sampledFrames) / nsample)
imgs = []
for i in range(nsample):
idx = 0
@@ -417,7 +417,7 @@ def mp4_loader(filepath, nsample, seglen, mode):
idx = i
for jj in range(idx, idx + seglen):
- imgbuf = sampledFrames[int(jj % videolen)]
+ imgbuf = sampledFrames[int(jj % len(sampledFrames))]
img = Image.fromarray(imgbuf, mode='RGB')
imgs.append(img)
|
DOC: special: Set Axes3D rect to avoid clipping labels in plot.
This fixes the clipping of the axis ticks and labels in the
Bessel function plot in the `special` tutorial. | @@ -50,7 +50,7 @@ drum head anchored at the edge:
>>> from mpl_toolkits.mplot3d import Axes3D
>>> from matplotlib import cm
>>> fig = plt.figure()
- >>> ax = Axes3D(fig)
+ >>> ax = Axes3D(fig, rect=(0, 0.05, 0.95, 0.95))
>>> ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap='RdBu_r', vmin=-0.5, vmax=0.5)
>>> ax.set_xlabel('X')
>>> ax.set_ylabel('Y')
|
custom fields documentation missing word "more"
The "one or object types" looks like it is missing the word "more". | @@ -24,7 +24,7 @@ Marking a field as required will force the user to provide a value for the field
The filter logic controls how values are matched when filtering objects by the custom field. Loose filtering (the default) matches on a partial value, whereas exact matching requires a complete match of the given string to a field's value. For example, exact filtering with the string "red" will only match the exact value "red", whereas loose filtering will match on the values "red", "red-orange", or "bored". Setting the filter logic to "disabled" disables filtering by the field entirely.
-A custom field must be assigned to one or object types, or models, in NetBox. Once created, custom fields will automatically appear as part of these models in the web UI and REST API. Note that not all models support custom fields.
+A custom field must be assigned to one or more object types, or models, in NetBox. Once created, custom fields will automatically appear as part of these models in the web UI and REST API. Note that not all models support custom fields.
### Custom Field Validation
|
Ability to add a comment
New method add_comment | @@ -316,6 +316,17 @@ class Confluence(AtlassianRestAPI):
params['start'] = start
return (self.get(url, params=params) or {}).get('results')
+ def add_comment(self, page_id, text):
+ """
+ Add comment into page
+ :param page_id
+ :param text
+ """
+ data = {'type': 'comment',
+ 'container': {'id': page_id, 'type': 'page', 'status': 'current'},
+ 'body': {'storage': {'value': text, 'representation': 'storage'}}}
+ return self.post('rest/api/content/', data=data)
+
def attach_file(self, filename, page_id=None, title=None, space=None, comment=None):
"""
Attach (upload) a file to a page, if it exists it will update the
|
tests: use osd ids instead of device name in ooo_collocation
on master, it doesn't make sense anymore to use device name, we should
use osd id instead. | @@ -60,12 +60,6 @@ def setup(host):
if cmd.rc == 0:
osd_ids = cmd.stdout.rstrip("\n").split("\n")
osds = osd_ids
- if docker and fsid == "6e008d48-1661-11e8-8546-008c3214218a":
- osds = []
- for device in ansible_vars.get("devices", []):
- real_dev = host.run("sudo readlink -f %s" % device)
- real_dev_split = real_dev.stdout.split("/")[-1]
- osds.append(real_dev_split)
address = host.interface(public_interface).addresses[0]
|
Fix error during sa-managed-object saving
HG--
branch : bugfixes/sa_mo_save-error | @@ -58,7 +58,7 @@ class TagsExpression(object):
def as_sql(self, qn, connection):
t = ",".join(str(adapt(x)) for x in self.tags)
- return "ARRAY[%s] <@ %s.%s" % (t, self.table, qn("tags")), []
+ return "ARRAY[%s] <@ \"%s\".%s" % (t, self.table, qn("tags")), []
class TagsNode(tree.Node):
|
Ensure that Qtile.finalize() is called on restart
For issue | @@ -81,6 +81,7 @@ class Qtile(command.CommandObject):
"""This object is the `root` of the command graph"""
def __init__(self, config, displayName=None, fname=None, no_spawn=False, state=None):
+ self._restart = False
self.no_spawn = no_spawn
self._eventloop = None
@@ -339,6 +340,9 @@ class Qtile(command.CommandObject):
finally:
self._eventloop.close()
self._eventloop = None
+ if self._restart:
+ logger.warning('Restarting Qtile with os.execv(...)')
+ os.execv(*self._restart)
def _process_fake_screens(self):
"""
@@ -1376,17 +1380,11 @@ class Qtile(command.CommandObject):
return v.args[0]
self.handle_KeyPress(d)
- def cmd_execute(self, cmd, args):
- """Executes the specified command, replacing the current process"""
- self.stop()
- os.execv(cmd, args)
-
def cmd_restart(self):
- """Restart qtile using the execute command"""
+ """Restart qtile"""
argv = [sys.executable] + sys.argv
if '--no-spawn' not in argv:
argv.append('--no-spawn')
-
buf = io.BytesIO()
try:
pickle.dump(QtileState(self), buf, protocol=0)
@@ -1394,8 +1392,8 @@ class Qtile(command.CommandObject):
logger.error("Unable to pickle qtile state")
argv = [s for s in argv if not s.startswith('--with-state')]
argv.append('--with-state=' + buf.getvalue().decode())
-
- self.cmd_execute(sys.executable, argv)
+ self._restart = (sys.executable, argv)
+ self.stop()
def cmd_spawn(self, cmd):
"""Run cmd in a shell.
|
Add warning if num_jobs >1 and torch.num_threads >1
+ in some cases this can result in a endless computation
This warning makes the user aware of this | @@ -27,6 +27,7 @@ from typing import (
)
import numpy as np
+import torch
from intervaltree import Interval, IntervalTree
from tqdm.auto import tqdm
from typing_extensions import Literal
@@ -4055,6 +4056,13 @@ class CutSet(Serializable, Sequence[Cut]):
)
executor = None
+ if num_jobs > 1 and torch.get_num_threads() > 1:
+ logging.warning(
+ "num_jobs is > 1 and torch's number of threads is > 1 as well: "
+ "This might result in a never ending computation. "
+ "If this happens, use torch.set_num_threads(1) to circumvent this."
+ )
+
# Non-parallel execution
if executor is None and num_jobs == 1:
if progress_bar:
|
Correct a mistake for URL description
Link for bug-tracker in "Virtual instance reservation" section is
displayed improperly.
Correct it by adding new line before it. | @@ -32,6 +32,7 @@ Virtual instance reservation
**Note** virtual instance reservation feature is not available in current
release. Expected to be available in the future (`bug tracker`_).
+
.. _bug tracker: https://blueprints.launchpad.net/blazar/+spec/new-instance-reservation
Virtual instance reservation mostly looks like usual instance booting for user
|
Update capitalization for OptiFine capes
Changed from `optifine` to `OptiFine` | @@ -101,7 +101,7 @@ class MinecraftData(commands.Cog):
@minecraft.group(invoke_without_command=True)
@checks.bot_has_permissions(embed_links=True)
async def cape(self, ctx, player: MCPlayer):
- """Get minecraft capes by nickname"""
+ """Get Minecraft capes by nickname"""
try:
await self.session.get(
f"https://crafatar.com/capes/{player.uuid}", raise_for_status=True
@@ -125,7 +125,7 @@ class MinecraftData(commands.Cog):
@cape.command(aliases=["of"])
async def optifine(self, ctx, player: MCPlayer):
- """Get optifine cape by nickname"""
+ """Get OptiFine cape by nickname"""
try:
await self.session.get(
f"http://s.optifine.net/capes/{player.name}.png", raise_for_status=True
@@ -133,12 +133,12 @@ class MinecraftData(commands.Cog):
except aiohttp.ClientResponseError as e:
if e.status == 404:
await ctx.send(
- chat.error(_("{} doesn't have optifine cape").format(player.name))
+ chat.error(_("{} doesn't have OptiFine cape").format(player.name))
)
else:
await ctx.send(
chat.error(
- _("Unable to get {player}'s optifine cape: {message}").format(
+ _("Unable to get {player}'s OptiFine cape: {message}").format(
player=player.name, message=e.message
)
)
|
pil_to_tensor accimage backend return uint8
accimage always stores images as uint8, so let's be compatible with the internal representation. Tests were failing without this as it would return a float32 image normalized between 0-1 | @@ -155,7 +155,8 @@ def pil_to_tensor(pic):
raise TypeError('pic should be PIL Image. Got {}'.format(type(pic)))
if accimage is not None and isinstance(pic, accimage.Image):
- nppic = np.zeros([pic.channels, pic.height, pic.width], dtype=np.float32)
+ # accimage format is always uint8 internally, so always return uint8 here
+ nppic = np.zeros([pic.channels, pic.height, pic.width], dtype=np.uint8)
pic.copyto(nppic)
return torch.as_tensor(nppic)
|
Generic API: make Name_Map tagged
This is just for the convenience of using the dot notation when calling
its lookup primitives.
TN: | @@ -528,7 +528,7 @@ package Langkit_Support.Generic_API.Introspection is
-- Name maps --
---------------
- type Name_Map is private;
+ type Name_Map is tagged private;
-- Map from names to enum types, enum values, struct types and struct
-- members for a given casing convention and a given language.
|
Remove link
A small documentation fix that refers to the URL instead of the local file that has to be cleaned up. | @@ -198,7 +198,7 @@ Ray has experimental support for machines running Apple Silicon (such as M1 macs
* ``bash Miniforge3-MacOSX-arm64.sh``
- * ``rm https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh # Cleanup.``
+ * ``rm Miniforge3-MacOSX-arm64.sh # Cleanup.``
#. Ensure you're using the miniforge environment (you should see (base) in your terminal).
|
Update honggfuzz
This version adds splicing
(https://github.com/google/honggfuzz/commit/150cbd741c7346571e5a9c47b7819d2e37500a64)
which rather significantly improves coverage in some tests (e.g. in
sqlite3) | @@ -23,14 +23,14 @@ RUN apt-get update -y && \
libblocksruntime-dev \
liblzma-dev
-# Download honggfuz version 2.1 + 539ea048d6273864e396ad95b08911c69cd2ac51
+# Download honggfuz version 2.1 + 8c0808190bd10ae63b26853ca8ef29e5e17736fe
# Set CFLAGS use honggfuzz's defaults except for -mnative which can build CPU
# dependent code that may not work on the machines we actually fuzz on.
# Create an empty object file which will become the FUZZER_LIB lib (since
# honggfuzz doesn't need this when hfuzz-clang(++) is used).
RUN git clone https://github.com/google/honggfuzz.git /honggfuzz && \
cd /honggfuzz && \
- git checkout 539ea048d6273864e396ad95b08911c69cd2ac51 && \
+ git checkout 8c0808190bd10ae63b26853ca8ef29e5e17736fe && \
CFLAGS="-O3 -funroll-loops" make && \
touch empty_lib.c && \
cc -c -o empty_lib.o empty_lib.c
|
Update Alabama.md
More links & tagging Alabama | During an altercation with protesters, a woman falls to the ground and other protesters are pushed away after trying to help her, while an officer steps on and trips over the woman.
+tags: baton, kick, beat, push, shove
+
id: al-huntsville-1
**Links**
@@ -15,6 +17,8 @@ id: al-huntsville-1
Police officer exits his vehicle and begins pepper spraying protestors for no apparent reason.
+tags: threaten, pepper-spray, spray
+
id: al-huntsville-2
**Links**
@@ -26,6 +30,8 @@ id: al-huntsville-2
Police use tear gas on reporters and protestors, who are then initially blocked from leaving the area by other officers.
+tags: tear-gas, tear-gas-canister, journalist
+
id: al-huntsville-3
**Links**
@@ -37,11 +43,17 @@ id: al-huntsville-3
A Huntsville PD Lieutenant stated that they used tear gas on protestors before violence occurred, adding that "they weren't going to roll the dice".
+Footage taken of a protestor in a garage after shows bruises consistent with rubber bullet rounds.
+
+tags: tear-gas, tear-gas-canister, rubber-bullets, shoot
+
id: al-huntsville-4
**Links**
* https://www.alreporter.com/2020/06/03/huntsville-police-deploy-tear-gas-rubber-bullets-on-protesters/
+* https://twitter.com/IanHoppe/status/1268350756186460164
+* https://twitter.com/ByChipBrownlee/status/1268357881381957635
### Police fire rubber bullets on dispersing crowd | (believed to be) June 5th
@@ -50,6 +62,8 @@ After disperse order is given, protestors comply and begin to back away from the
June 5th date determined by Reddit submitter stating video, which is stamped "1d ago", to have been uploaded on June 6th, 2020. Confirmed that mass protests did occurr in Hunstville on June 5th.
+tag: rubber-bullets, threaten
+
id: al-huntsville-5
**Links**
|
langkit.utils: make dispatch_on_type work for instances
TN: | @@ -268,30 +268,38 @@ def type_check_instance(klass):
return lambda t: isinstance(t, klass)
-def dispatch_on_type(type, type_to_action_assocs, exception=None):
+def dispatch_on_type(typ_or_inst, type_to_action_assocs, exception=None):
"""
- Dispatch on the type parameter, execute the corresponding action
- depending on the type. Every type in type_to_action_assocs will be
- tested in turn. If type is a subtype of one of them, then the
- corresponding action will be executed.
+ Dispatch on `typ_or_inst`, execute the corresponding action depending on
+ the type. Every "type" (MatcherType below) in type_to_action_assocs will be
+ tested in turn; the correpsonding action will be executed if the type:
- :param type: The type to dispatch upon.
+ * is `typ_or_inst`;
+ * is a class and `typ_or_inst` is an instance of it;
+ * is a class and `typ_or_inst` is a subclass of it.
+
+ :param InputType typ_or_inst: The type/instance to dispatch upon.
:param type_to_action_assocs: An association of types to actions that
returns something.
- :type type_to_action_assocs: list[(type, (type) -> T)]
+ :type type_to_action_assocs: list[(MatcherType, (InputType) -> RType)]
:param Exception exception: The exception to raise in case the type is
not in the dispatch table.
- :rtype: T
+ :rtype: RType
"""
exception = exception or Exception(
- "Error in dispatch_on_type: {} not handled".format(type)
+ "Error in dispatch_on_type: {} not handled".format(typ_or_inst)
)
for target_type, action in type_to_action_assocs:
- if issubclass(type, target_type):
- return action(type)
+ if (
+ target_type is typ_or_inst
+ or (inspect.isclass(target_type)
+ and (issubclass(type(typ_or_inst), target_type)
+ or issubtype(typ_or_inst, target_type)))
+ ):
+ return action(typ_or_inst)
raise exception
|
LiteralExpr.__repr__: fix to handle None static types
TN: | @@ -2637,8 +2637,10 @@ class LiteralExpr(BasicExpr):
'1-literal': self.literal}
def __repr__(self):
- return '<LiteralExpr {} ({})>'.format(self.template,
- self.type.name().camel)
+ return '<LiteralExpr {} ({})>'.format(
+ self.template,
+ self.type.name().camel if self.static_type else '<no type>'
+ )
class NullExpr(LiteralExpr):
|
Fixing DistilBert error message
Fixing error message | @@ -166,7 +166,7 @@ class DistilBertTokenizer(PreTrainedTokenizer):
if not os.path.isfile(vocab_file):
raise ValueError(
f"Can't find a vocabulary file at path '{vocab_file}'. To load the vocabulary from a Google pretrained"
- " model use `tokenizer = BertTokenizer.from_pretrained(PRETRAINED_MODEL_NAME)`"
+ " model use `tokenizer = DistilBertTokenizer.from_pretrained(PRETRAINED_MODEL_NAME)`"
)
self.vocab = load_vocab(vocab_file)
self.ids_to_tokens = collections.OrderedDict([(ids, tok) for tok, ids in self.vocab.items()])
|
Update health_api.py
Adding docs to health endpoint. | @@ -18,7 +18,9 @@ class HealthApi(BaseApi):
router = app.router
router.add_get('/health', security.authentication_exempt(self.get_health_info))
- @aiohttp_apispec.docs(tags=["health"])
+ @aiohttp_apispec.docs(tags=['health'],
+ summary='Health endpoints returns the status of CALDERA',
+ description='Returns the status of CALDERA and additional details including versions of system components')
@aiohttp_apispec.response_schema(CalderaInfoSchema, 200)
async def get_health_info(self, request):
loaded_plugins_sorted = sorted(self._app_svc.get_loaded_plugins(), key=operator.attrgetter('name'))
|
docs: Emphasise WIP PRs in git-guide.md.
Fiuxes | @@ -784,7 +784,9 @@ complicated rebase.
When you're ready for feedback, submit a pull request. At Zulip we recommend
submitting work-in-progress pull requests early and often. This allows you to
get feedback and help with your bugfix or feature. Prefix work-in-progress pull
-requests with **[WIP]**.
+requests with **[WIP]**: this will indicate to maintainers that your pull
+request is not yet ready to be merged, which will set expectations
+correctly for any feedback from other developers.
Pull requests are a feature specific to GitHub. They provide a simpler,
web-based way to submit your work (often called "patches") to a project. It's
@@ -879,8 +881,10 @@ You'll see the *Open a pull request* page:
![images-create-pr]
-Provide a **title** and first comment for your pull request. When ready, click
-the green **Create pull request** to submit the pull request.
+Provide a **title** and first comment for your pull request. Remember to prefix
+your pull request title with [WIP] if it is a work-in-progress.
+
+When ready, click the green **Create pull request** to submit the pull request.
Note: **Pull request titles are different from commit messages.** Commit
messages can be edited with `git commit --amend`, `git rebase -i`, etc., while
|
Temporarily disable select/topk/kthvalue AD
Summary:
Temporarily disable them for perf consideration. Will figure out a way to do `torch.zeros(sizes, grad.options())` in torchscript before enabling these.
Pull Request resolved: | @@ -166,30 +166,30 @@ const std::vector<std::string> functions = {
# FIXME: torchscript: torch.zeros(sizes, grad.options())
return torch.zeros(sizes).to(grad).scatter_(dim, indices, grad)
- def topk(self,
- k: int,
- dim: int = -1,
- largest: bool = True,
- sorted: bool = True):
- result0, result1 = torch.topk(self, k, dim, largest, sorted)
- self_size = self.size()
- def backward(grad_output):
- grad_self = AD_index_select_backward(grad_output, dim, result1, self_size, True)
- return grad_self, None, None, None, None
+ # def topk(self,
+ # k: int,
+ # dim: int = -1,
+ # largest: bool = True,
+ # sorted: bool = True):
+ # result0, result1 = torch.topk(self, k, dim, largest, sorted)
+ # self_size = self.size()
+ # def backward(grad_output):
+ # grad_self = AD_index_select_backward(grad_output, dim, result1, self_size, True)
+ # return grad_self, None, None, None, None
- return result0, result1, backward
+ # return result0, result1, backward
- def kthvalue(self,
- k: int,
- dim: int,
- keepdim: bool):
- result0, result1 = torch.kthvalue(self, k, dim, keepdim)
- self_size = self.size()
- def backward(grad_output):
- grad_self = AD_index_select_backward(grad_output, dim, result1, self_size, keepdim)
- return grad_self, None, None, None
+ # def kthvalue(self,
+ # k: int,
+ # dim: int,
+ # keepdim: bool):
+ # result0, result1 = torch.kthvalue(self, k, dim, keepdim)
+ # self_size = self.size()
+ # def backward(grad_output):
+ # grad_self = AD_index_select_backward(grad_output, dim, result1, self_size, keepdim)
+ # return grad_self, None, None, None
- return result0, result1, backward
+ # return result0, result1, backward
def AD_mm_backward_self(grad, mat2):
return grad.mm(mat2.t())
@@ -232,15 +232,16 @@ const std::vector<std::string> functions = {
grad_input.select(dim, index).copy_(grad)
return grad_input
- def select(self,
- dim: int,
- index: int):
- self_size = self.size()
- def backward(grad_output):
- grad_self = AD_select_backward(grad_output, self_size, dim, index)
- return grad_self, None, None
+ # TODO: fix torch.zeros(sizes, grad.options()) before enabling select, topk, kthvalue
+ # def select(self,
+ # dim: int,
+ # index: int):
+ # self_size = self.size()
+ # def backward(grad_output):
+ # grad_self = AD_select_backward(grad_output, self_size, dim, index)
+ # return grad_self, None, None
- return torch.select(self, dim, index), backward
+ # return torch.select(self, dim, index), backward
def AD_slice_backward(grad,
input_sizes: List[int],
|
Adding support for non-file SVGs
source.setter now uses Svg.set_tree() to set the tree and execute .reload()
Svg() can now reloaded/initiated using set_tree(tree) when source is not a file.
Svg() Constructor therefore does not require source parameter - which now defaults to None.
source.setter is only executed during __init__ when parameter is given. | @@ -366,7 +366,7 @@ cdef class Svg(RenderContext):
"""Svg class. See module for more informations about the usage.
"""
- def __init__(self, source, anchor_x=0, anchor_y=0,
+ def __init__(self, source=None, anchor_x=0, anchor_y=0,
bezier_points=BEZIER_POINTS, circle_points=CIRCLE_POINTS,
color=None):
'''
@@ -420,6 +420,7 @@ cdef class Svg(RenderContext):
b"\xff\xff\xff\xff\xff\xff\xff\x00", colorfmt="rgba")
self._source = None
+ if source:
self.source = source
@@ -510,14 +511,17 @@ cdef class Svg(RenderContext):
fd = open(filename, 'rb')
try:
#save the tree for later reloading
- self.tree = parse(fd)
- self.reload()
+ self.set_tree(parse(fd))
end = time()
Logger.debug("Svg: Loaded {} in {:.2f}s".format(filename, end - start))
finally:
self._source = filename
fd.close()
+ def set_tree(self, tree):
+ self.tree = tree
+ self.reload()
+
cdef void reload(self) except *:
# parse tree
start = time()
|
chore: Drop duplicate event method
This particular definition was chosen since there was no corresponding
subscribe method with the same key generation logic | @@ -41,7 +41,6 @@ io.use((socket, next) => {
sid: socket.sid,
})
.then((res) => {
- console.log(`User ${res.body.message.user} found`);
socket.user = res.body.message.user;
socket.user_type = res.body.message.user_type;
})
|
[nightly] Change the logs and metrics for serve ha test
Serve HA tests have been running for two days and they failed:
QPS low (350)
Availability low (99.94%).
This PR reduced the availability metrics to 99.9% and print logs for debugging. | @@ -319,7 +319,7 @@ def get_stats():
failures = float(data[-1][18]) - float(data[offset][18])
# Available, through put
- return (total - failures) / total, total / (end_time - start_time)
+ return (total - failures) / total, total / (end_time - start_time), data
def main():
@@ -333,11 +333,17 @@ def main():
duration = 5 * 60 * 60
procs.append(start_sending_traffics(duration * 1.1, users))
start_killing_nodes(duration, 60, 6)
- rate, qps = get_stats()
+ rate, qps, data = get_stats()
print("Result:", rate, qps)
- assert rate > 0.9995
+
+ try:
+ assert rate > 0.999
assert qps > users * 10 * 0.8
+ except Exception:
+ print("Raw Data", data)
+ print("Result:", rate, qps)
+ raise
except Exception as e:
print("Experiment failed")
|
Add `free` to list description
There has been some recent interest in adding paid services to this list, so adding `free` in the project's description to clarify the mission of the project. | # Public APIs [](https://travis-ci.org/toddmotto/public-apis)
-A collective list of JSON APIs for use in web development.
+A collective list of free JSON APIs for use in web development.
For information on contributing to this project, please see the [contributing guide](CONTRIBUTING.md).
|
quickstart -> don't throw exception if elected to avoid installing
samples | @@ -226,6 +226,7 @@ def quickstart():
print("Would you like to download & view samples? [Y]/n:")
i = input()
samples = True if not len(i) or i.lower in ("y", "yes") else False
+ sample_location = None
if samples:
pwd = pathlib.Path().absolute()
print(f"Select location for sample files [{pwd}/liu_samples]:")
@@ -256,6 +257,8 @@ def quickstart():
print("You may now run a back-testing sessions for these days, as well as ")
print("analyze an existing trading session.")
print()
+
+ if sample_location:
print("To experience Liu Algo Trading for the first time:")
print(f"1. change your working directory to the sample directory {sample_location} ('cd {sample_location}'),")
if os.name == "nt":
|
fixed tests and hopefully increased coverage.
fixed tests and hopefully increased coverage. | @@ -166,6 +166,9 @@ def test_plantcv_analyze_bound():
# Test with debug='plot', line position that will trigger -y, and two channel object
_ = pcv.analyze_bound(img=img, imgname="img", obj=object_contours[0], mask=mask, line_position=1, device=0,
debug="plot", filename=False)
+ # Test with debug='plot', line position that will trigger -y, and two channel object
+ _ = pcv.analyze_bound(img=img, imgname="img", obj=object_contours[0], mask=mask, line_position=2056, device=0,
+ debug="plot", filename=False)
# Test with debug = None
device, boundary_header, boundary_data, boundary_img1 = pcv.analyze_bound(img=img, imgname="img",
obj=object_contours[0], mask=mask,
@@ -195,6 +198,9 @@ def test_plantcv_analyze_bound_horizontal():
# Test with debug='plot', line position that will trigger -y, and two channel object
_ = pcv.analyze_bound_horizontal(img=img, obj=object_contours[0], mask=mask, line_position=1, device=0,
debug="plot", filename=False)
+ # Test with debug='plot', line position that will trigger -y, and two channel object
+ _ = pcv.analyze_bound_horizontal(img=img, obj=object_contours[0], mask=mask, line_position=2056, device=0,
+ debug="plot", filename=False)
# Test with debug = None
device, boundary_header, boundary_data, boundary_img1 = pcv.analyze_bound_horizontal(img=img,
obj=object_contours[0], mask=mask,
@@ -224,12 +230,18 @@ def test_plantcv_analyze_bound_vertical():
# Test with debug='plot', line position that will trigger -x, and two channel object
_ = pcv.analyze_bound_horizontal(img=img, obj=object_contours[0], mask=mask, line_position=1, device=0,
debug="plot", filename=False)
+ # Test with debug='plot', line position that will trigger -x, and two channel object
+ _ = pcv.analyze_bound_horizontal(img=img, obj=object_contours[0], mask=mask, line_position=2454, device=0,
+ debug="plot", filename=False)
# Test with debug = None
device, boundary_header, boundary_data, boundary_img1 = pcv.analyze_bound_vertical(img=img,
obj=object_contours[0], mask=mask,
line_position=1000, device=0,
debug=None, filename=False)
+ if cv2.__version__[0] == '2':
assert boundary_data[3] == 333000
+ else:
+ assert boundary_data[3] == 333094
def test_plantcv_analyze_color():
# Test cache directory
|
[client] Fix regression in
I typoed cleanup() to clean().
[email protected] | @@ -1221,7 +1221,7 @@ def main(args):
min_free_space=options.min_free_space,
max_age_secs=MAX_AGE_SECS)
for c in caches:
- c.clean()
+ c.cleanup()
return 0
if not options.no_clean:
|
Update timestamp
Update timestamp to add endpoint_url field on migrate | "issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-07 04:12:43.691760",
+ "modified": "2019-02-25 04:12:43.691760",
"modified_by": "Administrator",
"module": "Integrations",
"name": "S3 Backup Settings",
|
FIX: destroy cluster
fixed destroy cluster option | @@ -248,9 +248,7 @@ def run(args):
tcs.append(tc)
break
if test.get('destroy-cluster') is True:
- (nodename, uid, node_num, _, _) = ceph_nodes[0].hostname.split('-')
- cleanup_name = nodename + "-" + uid
- cleanup_ceph_nodes(osp_cred, name=cleanup_name)
+ cleanup_ceph_nodes(osp_cred)
if test.get('recreate-cluster') is True:
ceph_nodes = create_nodes(glb_file, osp_cred)
tcs.append(tc)
|
[Tutorial] Fix vta vision detection tutorial 'sphinx' style error.
Issue:
Some bash code in this tutorial does not get syntax highlighting
because of the format errors.
Solution:
Fix the 'sphinx' 'rst' style error. | @@ -39,7 +39,7 @@ tensorization in the core) to massage the compute graph for the hardware target.
# YOLO-V3-tiny Model with Darknet parsing have dependancy with CFFI and CV2 library,
# we need to install CFFI and CV2 before executing this script.
#
-# pip3 install "Pillow<7"
+# .. code-block:: bash
#
# pip3 install cffi
# pip3 install opencv-python
|
fixed a few documentation bugs
there was a warning of header underline not being long enough
and code type graphql was being used intead of json | @@ -78,7 +78,7 @@ We should receive:
}
InputFields and InputObjectTypes
-----------------------
+----------------------------------
InputFields are used in mutations to allow nested input data for mutations
To use an InputField you define an InputObjectType that specifies the structure of your input data
@@ -114,7 +114,7 @@ Note that **name** and **age** are part of **person_data** now
Using the above mutation your new query would look like this:
-.. code:: graphql
+.. code:: json
mutation myFirstMutation {
createPerson(personData: {name:"Peter", age: 24}) {
|
Add CAPABILITY_NAMED_IAM for Create and Update of Cluster
Add CAPABILITY_NAMED_IAM for create, update of the cluster.
Manually tested the change by creating and Updating a cluster. | @@ -32,7 +32,7 @@ class CfnClient(Boto3Client):
return self._client.create_stack(
StackName=stack_name,
TemplateBody=template_body,
- Capabilities=["CAPABILITY_IAM"],
+ Capabilities=["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
DisableRollback=disable_rollback,
Tags=tags,
)
@@ -50,7 +50,7 @@ class CfnClient(Boto3Client):
return self._client.create_stack(
StackName=stack_name,
TemplateURL=template_url,
- Capabilities=[capabilities],
+ Capabilities=[capabilities, "CAPABILITY_NAMED_IAM"],
DisableRollback=disable_rollback,
Tags=tags,
)
@@ -67,7 +67,7 @@ class CfnClient(Boto3Client):
StackName=stack_name,
TemplateBody=json.dumps(updated_template, indent=2), # Indent so it looks nice in the console
Parameters=params,
- Capabilities=["CAPABILITY_IAM"],
+ Capabilities=["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
)
@AWSExceptionHandler.handle_client_exception
@@ -77,12 +77,12 @@ class CfnClient(Boto3Client):
return self._client.update_stack(
StackName=stack_name,
TemplateURL=template_url,
- Capabilities=["CAPABILITY_IAM"],
+ Capabilities=["CAPABILITY_IAM","CAPABILITY_NAMED_IAM"],
)
return self._client.update_stack(
StackName=stack_name,
TemplateURL=template_url,
- Capabilities=["CAPABILITY_IAM"],
+ Capabilities=["CAPABILITY_IAM","CAPABILITY_NAMED_IAM"],
Tags=tags,
)
|
Remove unneeded directory literals
resolves | @@ -455,12 +455,6 @@ class CWLJob(Job):
cwltool.stdfsaccess.StdFsAccess(outdir),
recursive=True))
- def make_dir_literal(obj):
- if "location" in obj and obj["location"].startswith("file:"):
- obj["location"] = "_:" + str(uuid.uuid4())
-
- adjustDirObjs(output, make_dir_literal)
-
adjustFileObjs(output, functools.partial(uploadFile,
functools.partial(writeGlobalFileWrapper, fileStore),
index, existing))
|
Fix lint failure.
Introduced in | @@ -33,7 +33,8 @@ from test_utils.system import unique_resource_id
USER_PROJECT = os.environ.get('GOOGLE_CLOUD_TESTS_USER_PROJECT')
-RUNNING_IN_VPCSC = os.getenv('GOOGLE_CLOUD_TESTS_IN_VPCSC', '').lower() == 'true'
+RUNNING_IN_VPCSC = os.getenv(
+ 'GOOGLE_CLOUD_TESTS_IN_VPCSC', '').lower() == 'true'
def _bad_copy(bad_request):
|
Add missing ws separator between words
This is to add missing ws separator between words, usually
in log messages. | @@ -217,8 +217,9 @@ def start_shellinabox_console(node_uuid, port, console_cmd):
raise loopingcall.LoopingCallDone()
if (time.time() > expiration):
- locals['errstr'] = _("Timeout while waiting for console subprocess"
- "to start for node %s.") % node_uuid
+ locals['errstr'] = (_("Timeout while waiting for console "
+ "subprocess to start for node %s.") %
+ node_uuid)
LOG.warning(locals['errstr'])
raise loopingcall.LoopingCallDone()
|
Disabling umap reproducibility tests for cuda 11.4
Authors:
- Corey J. Nolet (https://github.com/cjnolet)
Approvers:
- Dante Gama Dessavre (https://github.com/dantegd)
URL: | @@ -298,8 +298,14 @@ class UMAPParametrizableTest : public ::testing::Test {
assertions(handle, X_d.data(), e1, test_params, umap_params);
+ // v21.08: Reproducibility looks to be busted for CTK 11.4. Need to figure out
+ // why this is happening and re-enable this.
+#if CUDART_VERSION == 11040
+ return;
+#else
// Disable reproducibility tests after transformation
if (!test_params.fit_transform) { return; }
+#endif
device_buffer<float> embeddings2(alloc, stream, n_samples * umap_params.n_components);
float* e2 = embeddings2.data();
|
update for ALLOWED_FILTERS
updated ALLOWED_FILTERS for Movies, Shows, and Photos sections. | @@ -649,7 +649,8 @@ class MovieSection(LibrarySection):
"""
ALLOWED_FILTERS = ('unwatched', 'duplicate', 'year', 'decade', 'genre', 'contentRating',
'collection', 'director', 'actor', 'country', 'studio', 'resolution',
- 'guid', 'label')
+ 'guid', 'label', 'writer', 'producer', 'subtitleLanguage', 'audioLanguage',
+ 'lastViewedAt', 'viewCount', 'addedAt')
ALLOWED_SORT = ('addedAt', 'originallyAvailableAt', 'lastViewedAt', 'titleSort', 'rating',
'mediaHeight', 'duration')
TAG = 'Directory'
@@ -709,7 +710,11 @@ class ShowSection(LibrarySection):
TYPE (str): 'show'
"""
ALLOWED_FILTERS = ('unwatched', 'year', 'genre', 'contentRating', 'network', 'collection',
- 'guid', 'duplicate', 'label')
+ 'guid', 'duplicate', 'label', 'show.title', 'show.year', 'show.userRating',
+ 'show.viewCount', 'show.lastViewedAt', 'show.actor', 'show.addedAt', 'episode.title',
+ 'episode.originallyAvailableAt', 'episode.resolution', 'episode.subtitleLanguage',
+ 'episode.unwatched', 'episode.addedAt','episode.userRating', 'episode.viewCount',
+ 'episode.lastViewedAt')
ALLOWED_SORT = ('addedAt', 'lastViewedAt', 'originallyAvailableAt', 'titleSort',
'rating', 'unwatched')
TAG = 'Directory'
@@ -784,7 +789,12 @@ class MusicSection(LibrarySection):
TAG (str): 'Directory'
TYPE (str): 'artist'
"""
- ALLOWED_FILTERS = ('genre', 'country', 'collection', 'mood', 'year', 'track.userRating')
+ ALLOWED_FILTERS = ('genre', 'country', 'collection', 'mood', 'year', 'track.userRating', 'artist.title',
+ 'artist.userRating', 'artist.genre', 'artist.country', 'artist.collection', 'artist.addedAt',
+ 'album.title', 'album.userRating', 'album.genre', 'album.decade', 'album.collection',
+ 'album.viewCount', 'album.lastViewedAt', 'album.studio', 'album.addedAt', 'track.title',
+ 'track.userRating', 'track.viewCount', 'track.lastViewedAt', 'track.skipCount',
+ 'track.lastSkippedAt')
ALLOWED_SORT = ('addedAt', 'lastViewedAt', 'viewCount', 'titleSort', 'userRating')
TAG = 'Directory'
TYPE = 'artist'
@@ -858,7 +868,8 @@ class PhotoSection(LibrarySection):
TAG (str): 'Directory'
TYPE (str): 'photo'
"""
- ALLOWED_FILTERS = ('all', 'iso', 'make', 'lens', 'aperture', 'exposure', 'device', 'resolution')
+ ALLOWED_FILTERS = ('all', 'iso', 'make', 'lens', 'aperture', 'exposure', 'device', 'resolution', 'place',
+ 'originallyAvailableAt', 'addedAt', 'title', 'userRating')
ALLOWED_SORT = ('addedAt',)
TAG = 'Directory'
TYPE = 'photo'
|
Make untruth work with multiple dimensions
Closes | @@ -4955,6 +4955,18 @@ def untruth(lhs, ctx):
(any) -> [int(x in a) for x in range(max(a))]
"""
lhs = iterable(lhs, ctx=ctx)
+ if any(type(x) != int for x in lhs):
+ lhs = [iterable(x, ctx=ctx) for x in lhs]
+ dimensions = len(lhs[0])
+ maxCoords = [max(x[i] for x in lhs) + 1 for i in range(dimensions)]
+ deep_listify = lambda a: [deep_listify(x) for x in a] if vy_type(a, simple=True) is list else a
+ matrix = deep_listify(zero_matrix(maxCoords[::-1], ctx=ctx))
+ for x in lhs:
+ ref = matrix
+ for i in range(dimensions - 1):
+ ref = ref[x[i]]
+ ref[x[dimensions - 1]] = 1
+ return matrix
return [int(x in lhs) for x in range(monadic_maximum(lhs, ctx) + 1)]
|
billing: Don't use data attribute for iterating through subscriptions.
Iterating through data attribute is same as iterating through
subscriptions. | @@ -108,7 +108,7 @@ def get_upcoming_invoice(stripe_customer_id: str) -> stripe.Invoice:
def extract_current_subscription(stripe_customer: stripe.Customer) -> Any:
if not stripe_customer.subscriptions:
return None
- for stripe_subscription in stripe_customer.subscriptions.data:
+ for stripe_subscription in stripe_customer.subscriptions:
if stripe_subscription.status != "canceled":
return stripe_subscription
return None
|
Removed Picatic and updated Eventbrite
Removed Picatic (acquired by Eventbrite) and updated Eventbrite link. | @@ -684,8 +684,7 @@ API | Description | Auth | HTTPS | CORS |
### Events
API | Description | Auth | HTTPS | CORS |
|---|---|---|---|---|
-| [Eventbrite](https://www.eventbrite.com/developer/v3/) | Find events | `OAuth` | Yes | Unknown |
-| [Picatic](http://developer.picatic.com/?utm_medium=web&utm_source=github&utm_campaign=public-apis%20repo&utm_content=toddmotto) | Sell tickets anywhere | `apiKey` | Yes | Unknown |
+| [Eventbrite](https://www.eventbrite.com/platform/api/) | Find events | `OAuth` | Yes | Unknown |
| [SeatGeek](https://platform.seatgeek.com/) | Search events, venues and performers | `apiKey` | Yes | Unknown |
| [Ticketmaster](http://developer.ticketmaster.com/products-and-docs/apis/getting-started/) | Search events, attractions, or venues | `apiKey` | Yes | Unknown |
|
ENH: added utility import
Imported get_mapped_value to the utils namespace. | @@ -11,6 +11,7 @@ from pysat.utils._core import display_available_instruments
from pysat.utils._core import display_instrument_stats
from pysat.utils._core import generate_instrument_list
from pysat.utils._core import listify
+from pysat.utils._core import get_mapped_value
from pysat.utils._core import load_netcdf4
from pysat.utils._core import NetworkLock
from pysat.utils._core import scale_units
|
Update README.md
Remove support email ID as that channel is not active anymore. | @@ -181,4 +181,4 @@ For each of the above data sources
## References and support
-* For feedback and support reach out to your TAM or [email protected]
+* For feedback and support reach out to your TAM
|
Fixes type hint to account for include_cursor
Test Plan: Unit
Reviewers: prha | import warnings
from abc import ABC, abstractmethod, abstractproperty
-from typing import Callable, Iterable, List, Optional
+from typing import Callable, Iterable, List, Optional, Tuple, Union
import pyrsistent
from dagster.core.definitions.events import AssetKey
@@ -124,7 +124,7 @@ def get_asset_events(
ascending: bool = False,
include_cursor: bool = False,
cursor: int = None, # deprecated
- ) -> Iterable[EventRecord]:
+ ) -> Union[Iterable[EventRecord], Iterable[Tuple[int, EventRecord]]]:
pass
@abstractmethod
|
Update molecule.charge to be float in ASEAtomsAdaptor
This is what pymatgen uses | @@ -190,7 +190,7 @@ class AseAtomsAdaptor:
cls = Molecule if cls is None else cls
molecule = AseAtomsAdaptor.get_structure(atoms, cls=cls)
- molecule.charge = int(np.sum(atoms.get_initial_charges()))
+ molecule.charge = np.sum(atoms.get_initial_charges())
molecule.spin_multiplicity = int(np.sum(atoms.get_initial_magnetic_moments()) + 1)
return molecule
|
Fixed --no-mouse parameter message
`--no-mouse` is deprecated. Changed parameter to `--set console_mouse=false` | @@ -294,7 +294,7 @@ class Window(urwid.Frame):
if not k:
if args[1] == "mouse drag":
signals.status_message.send(
- message = "Hold down fn, shift, alt or ctrl to select text or use the --no-mouse parameter.",
+ message = "Hold down fn, shift, alt or ctrl to select text or use the --set console_mouse=false parameter.",
expire = 1
)
elif args[1] == "mouse press" and args[2] == 4:
|
Woraround to prevent a runtime error in Linux
Woraround to avoid a "RuntimeError: no access to protected functions or
signals for objects not created from Python" | from qtpy.QtGui import QImage, QPixmap, QPainter
from qtpy.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QMenu,
QVBoxLayout, QWidget, QGridLayout, QFrame,
- QScrollArea, QPushButton, QSizePolicy, QSpinBox,
- QSplitter, QStyleOptionSlider, QStyle)
+ QScrollArea, QPushButton, QScrollBar, QSizePolicy,
+ QSpinBox, QSplitter, QStyleOptionSlider, QStyle)
# ---- Local library imports
@@ -408,6 +408,12 @@ def setup_scrollarea(self):
self.scrollarea.setSizePolicy(QSizePolicy(QSizePolicy.Ignored,
QSizePolicy.Preferred))
+ # Set the vertical scrollbar explicitely :
+
+ # This is required to avoid a "RuntimeError: no access to protected
+ # functions or signals for objects not created from Python" in Linux.
+ self.scrollarea.setVerticalScrollBar(QScrollBar())
+
return self.scrollarea
def setup_arrow_buttons(self):
|
fix dbnsfp
google drive interface keeps changing - switched to ftp server dbnsfp source | @@ -7,15 +7,9 @@ recipe:
recipe_type: bash
recipe_cmds:
- |
- # Uses Google Drive for faster download with tricks from
- # http://stackoverflow.com/a/38937732/252589
- ggID='0B60wROKy6OqcRmZLbWd4SW5Yc1U'
- ggURL='https://drive.google.com/uc?export=download'
mkdir -p variation
cd variation
- filename="$(curl -k -sc tmp-gcokie "${ggURL}&id=${ggID}" | grep -o '="uc-name.*</span>' | sed 's/.*">//;s/<.a> .*//')"
- getcode="$(awk '/_warning_/ {print $NF}' tmp-gcokie)"
- curl -k -Lb tmp-gcokie "${ggURL}&confirm=${getcode}&id=${ggID}" -o "${filename}" -C -
+ wget -c --no-check-certificate ftp://dbnsfp:[email protected]/dbNSFPv3.5a.zip
UNPACK_DIR=`pwd`/tmpunpack
if [ ! -f dbNSFP.txt.gz ]; then
mkdir -p $UNPACK_DIR
@@ -32,7 +26,6 @@ recipe:
# index in position 1 and 2
tabix -f -s 1 -b 2 -e 2 -c '#' dbNSFP.txt.gz
rm -f $UNPACK_DIR/* && rmdir $UNPACK_DIR
- rm -f tmp-gcokie
rm -f dbNSFPv*.zip
recipe_outfiles:
- variation/dbNSFP.txt.gz
|
popovers: New function for hiding all user info popovers.
New function `hide_all_user_info_popovers` closes all user info
popovers, instead of calling multiple functions everytime to close
user info popover now we can just call this new function.
This commit is a follow-up of | @@ -723,6 +723,12 @@ export function hide_user_sidebar_popover() {
}
}
+function hide_all_user_info_popovers() {
+ hide_message_info_popover();
+ hide_user_sidebar_popover();
+ hide_user_info_popover();
+}
+
function focus_user_info_popover_item() {
// For now I recommend only calling this when the user opens the menu with a hotkey.
// Our popup menus act kind of funny when you mix keyboard and mouse.
@@ -1012,9 +1018,7 @@ export function register_click_handlers() {
$("body").on("click", ".info_popover_actions .sidebar-popover-mute-user", (e) => {
const user_id = elem_to_user_id($(e.target).parents("ul"));
- hide_message_info_popover();
- hide_user_sidebar_popover();
- hide_user_info_popover();
+ hide_all_user_info_popovers();
e.stopPropagation();
e.preventDefault();
muted_users_ui.confirm_mute_user(user_id);
@@ -1022,9 +1026,7 @@ export function register_click_handlers() {
$("body").on("click", ".info_popover_actions .sidebar-popover-unmute-user", (e) => {
const user_id = elem_to_user_id($(e.target).parents("ul"));
- hide_message_info_popover();
- hide_user_sidebar_popover();
- hide_user_info_popover();
+ hide_all_user_info_popovers();
muted_users_ui.unmute_user(user_id);
e.stopPropagation();
e.preventDefault();
@@ -1323,7 +1325,6 @@ export function hide_all_except_sidebars(opts) {
hideAll({exclude: opts.exclude_tippy_instance});
}
hide_actions_popover();
- hide_message_info_popover();
emoji_picker.hide_emoji_popover();
giphy.hide_giphy_popover();
stream_popover.hide_stream_popover();
@@ -1331,8 +1332,7 @@ export function hide_all_except_sidebars(opts) {
stream_popover.hide_all_messages_popover();
stream_popover.hide_starred_messages_popover();
stream_popover.hide_drafts_popover();
- hide_user_sidebar_popover();
- hide_user_info_popover();
+ hide_all_user_info_popovers();
hide_playground_links_popover();
// look through all the popovers that have been added and removed.
|
[docs] Reduce chunk size for algolia records
Summary: Title
Test Plan: Run a deploy, was successful
Reviewers: max | @@ -18,12 +18,13 @@ const settings = {
};
// We are operating under an Algolia record size limit (currently 10KB). Before this changeset,
-// we were just truncating records at 5000 chars. Now we chunk each document into 10000 char
+// we were just truncating records at 5000 chars. Now we chunk each document into 8000 char
// records with the same name -- Algolia dedupes based on the values of
// distinct/attributeForDistinct set on the index. A further improvement here would be to chunk at
// word boundaries.
+const CHUNK_SIZE = 8000;
const recordChunker = (accumulator, currentValue) => {
- if (currentValue.markdown.length <= 10000) {
+ if (currentValue.markdown.length <= CHUNK_SIZE) {
accumulator.push(currentValue);
return accumulator;
} else {
@@ -37,11 +38,11 @@ const recordChunker = (accumulator, currentValue) => {
markdown: currentValue.markdown,
slug: currentValue.slug
};
- nextValue.markdown = markdown.slice(0, 10000);
+ nextValue.markdown = markdown.slice(0, CHUNK_SIZE);
nextValue.objectID = objectID + "_" + i.toString();
i = i + 1;
accumulator.push(nextValue);
- markdown = markdown.slice(10000);
+ markdown = markdown.slice(CHUNK_SIZE);
}
return accumulator;
}
|
move disabled to call_chunks
This allows disabling states when using salt-ssh | @@ -1954,6 +1954,29 @@ class State(object):
'''
Iterate over a list of chunks and call them, checking for requires.
'''
+ # Check for any disabled states
+ disabled = {}
+ if 'state_runs_disabled' in self.opts['grains']:
+ for low in chunks[:]:
+ state_ = '{0}.{1}'.format(low['state'], low['fun'])
+ for pat in self.opts['grains']['state_runs_disabled']:
+ if fnmatch.fnmatch(state_, pat):
+ comment = (
+ 'The state function "{0}" is currently disabled by "{1}", '
+ 'to re-enable, run state.enable {1}.'
+ ).format(
+ state_,
+ pat,
+ )
+ _tag = _gen_tag(low)
+ disabled[_tag] = {'changes': {},
+ 'result': False,
+ 'comment': comment,
+ '__run_num__': self.__run_num,
+ '__sls__': low['__sls__']}
+ self.__run_num += 1
+ chunks.remove(low)
+ break
running = {}
for low in chunks:
if '__FAILHARD__' in running:
@@ -1969,7 +1992,8 @@ class State(object):
if self.reconcile_procs(running):
break
time.sleep(0.01)
- return running
+ ret = dict(list(disabled.items()) + list(running.items()))
+ return ret
def check_failhard(self, low, running):
'''
@@ -2455,35 +2479,11 @@ class State(object):
# Compile and verify the raw chunks
chunks = self.compile_high_data(high, orchestration_jid)
- # Check for any disabled states
- disabled = {}
- if 'state_runs_disabled' in self.opts['grains']:
- for low in chunks[:]:
- state_ = '{0}.{1}'.format(low['state'], low['fun'])
- for pat in self.opts['grains']['state_runs_disabled']:
- if fnmatch.fnmatch(state_, pat):
- comment = (
- 'The state function "{0}" is currently disabled by "{1}", '
- 'to re-enable, run state.enable {1}.'
- ).format(
- state_,
- pat,
- )
- _tag = _gen_tag(low)
- disabled[_tag] = {'changes': {},
- 'result': False,
- 'comment': comment,
- '__run_num__': self.__run_num,
- '__sls__': low['__sls__']}
- self.__run_num += 1
- chunks.remove(low)
- break
-
# If there are extensions in the highstate, process them and update
# the low data chunks
if errors:
return errors
- ret = dict(list(disabled.items()) + list(self.call_chunks(chunks).items()))
+ ret = self.call_chunks(chunks)
ret = self.call_listen(chunks, ret)
def _cleanup_accumulator_data():
|
Add retry for funding script
...because jsonrpc library hard-coded timeouts | @@ -23,7 +23,14 @@ class Endpoint:
async def __sendRequest(self, *args):
client = aiohttpClient(self.session, self.url)
+ # manual retry since the library has hard-coded timeouts
+ while True:
+ try:
response = await client.request(*args)
+ break
+ except:
+ print("!timeout! retrying")
+ pass
return response
async def sendTransaction(self, tx):
@@ -97,7 +104,6 @@ async def fund_shard(endpoint, genesisId, to, networkId, shard, amount):
async def fund(endpoint, genesisId, addrByAmount):
networkId = await endpoint.getNetworkId()
shardSize = await endpoint.getShardSize()
-
for amount in addrByAmount:
addrs = addrByAmount.get(amount, [])
print(
@@ -105,7 +111,6 @@ async def fund(endpoint, genesisId, addrByAmount):
amount, len(addrs)
)
)
-
# shard -> [addr]
byShard = defaultdict(list)
for addr in addrs:
@@ -143,7 +148,7 @@ async def fund(endpoint, genesisId, addrByAmount):
def read_addr(filepath) -> Dict[int, List[str]]:
- """ Every line is "<addr> <tqkc amount>" """
+ """ Every line is '<addr> <tqkc amount>' """
with open(filepath) as f:
tqkcMap = dict([line.split() for line in f.readlines()])
byAmount = defaultdict(list)
|
Update extensions.md
Add a skeleton, better than nothing. | @@ -9,4 +9,16 @@ nav_order: 2
Making extensions
=================
-Coming soon...
+Start off by copying the example extension in `lnbits/extensions/example` into your own:
+```sh
+cp lnbits/extensions/example lnbits/extensions/mysuperplugin -r # Let's not use dashes or anything; it doesn't like those.
+cd lnbits/extensions/mysuperplugin
+find . -type f -print0 | xargs -0 sed -i 's/example/mysuperplugin/g' # Change all occurrences of 'example' to your plugin name 'mysuperplugin'.
+```
+
+Going over the example extension's structure:
+* views_api.py: This is where your public API would go. It will be exposed at "$DOMAIN/$PLUGIN/$ROUTE". For example: https://lnbits.com/mysuperplugin/api/v1/tools.
+* views.py: The `/` path will show up as your plugin's home page in lnbits' UI. Other pages you can define yourself. The `templates` folder should explain itself in relation to this.
+* migrations.py: Create database tables for your plugin. They'll be created when you run `pipenv run flask migrate`.
+
+... This document is a work-in-progress. Send pull requests if you get stuck, so others don't.
|
Remove unused scaling_enabled method from adhoc provider
scaling_enabled usually lives on executors, not on providers,
and this method never seems to be invoked. | @@ -238,10 +238,6 @@ class AdHocProvider(ExecutionProvider, RepresentationMixin):
self.resources[job_id]['status'] = JobStatus(JobState.COMPLETED)
return rets
- @property
- def scaling_enabled(self):
- return True
-
@property
def label(self):
return self._label
|
Lkt lowering: handle "null" literal expressions
TN: | @@ -1324,6 +1324,10 @@ class LktTypesLoader:
elif isinstance(expr, L.NotExpr):
return E.Not(helper(expr.f_expr))
+ elif isinstance(expr, L.NullLit):
+ result_type = self.resolve_type_decl(expr.p_check_expr_type)
+ return E.No(result_type)
+
elif isinstance(expr, L.NumLit):
return E.Literal(int(expr.text))
|
mypy_primer: check conclusion field as well
Fixes
The comment workflow waits for the mypy primer to run. I think with
Github's changes to workflow running, these runs get marked as
completed, but have the conclusion "action_required".
E.g., see | @@ -47,14 +47,17 @@ jobs:
workflow_id: "mypy_primer.yml",
})
if (response) {
- return response.data.workflow_runs.find(run => run.head_sha == pr_commit_sha)
+ workflow_runs = response.data.workflow_runs
+ // Sort by reverse updated_at
+ workflow_runs.sort((a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime())
+ return workflow_runs.find(run => run.head_sha == pr_commit_sha)
}
return undefined
}
const end_time = Number(new Date()) + 60 * 60 * 1000
let primer_run = await check_mypy_primer()
- while (!primer_run || primer_run.status != "completed") {
+ while (!primer_run || primer_run.status != "completed" || primer_run.conclusion != "success") {
if (Number(new Date()) > end_time) {
throw Error("Timed out waiting for mypy_primer")
}
|
Rename variable in initialize.get_solution_stack
cr | @@ -497,19 +497,19 @@ def get_region(region_argument, interactive, force_non_interactive=False):
return region
-def get_solution_stack(solution_string):
+def get_solution_stack(platform):
# Get solution stack from config file, if exists
- if not solution_string:
+ if not platform:
try:
- solution_string = solution_stack_ops.get_default_solution_stack()
+ platform = solution_stack_ops.get_default_solution_stack()
except NotInitializedError:
- solution_string = None
+ platform = None
# Validate that the platform exists
- if solution_string:
- solution_stack_ops.find_solution_stack_from_string(solution_string)
+ if platform:
+ solution_stack_ops.find_solution_stack_from_string(platform)
- return solution_string
+ return platform
def handle_buildspec_image(solution, force_non_interactive):
|
Update cls_target.py
correct mis-spelling of args. | @@ -14,7 +14,7 @@ class ClsTarget(nn.Module):
self.vocab_size = vocab_size
self.hidden_size = args.hidden_size
- self.linear_1 = nn.Linear(args.hidden_size, aargs.hidden_size)
+ self.linear_1 = nn.Linear(args.hidden_size, args.hidden_size)
self.linear_2 = nn.Linear(args.hidden_size, args.labels_num)
self.softmax = nn.LogSoftmax(dim=-1)
self.criterion = nn.NLLLoss()
|
ubuiltins.bool: Clarify docs.
Avoid double and triple negatives. | @@ -113,10 +113,10 @@ class bool:
def __init__(self, *args) -> None:
"""
- Returns a Boolean value, i.e. one of ``True`` or ``False``.
+ Creates a boolean value, which is ``True`` or ``False``.
- ``x`` is converted using the standard truth testing procedure. If ``x``
- is false or omitted, this returns ``False``; otherwise it returns ``True``.
+ The argument is converted using the standard truth testing procedure.
+ If no argument is given, it returns ``False``.
"""
|
Load OSS Nux iframe via https
### Summary & Motivation
1. Load over https
2. Remove ugly iframe border
3. 1 second timeout.
### How I Tested These Changes
OSS Dagit:
<img width="879" alt="Screen Shot 2023-01-11 at 2 43 05 AM"
src="https://user-images.githubusercontent.com/2286579/211889039-6361aafa-1fb5-494b-a273-c688c814fc94.png"> | @@ -20,7 +20,8 @@ export const CommunityNux = () => {
);
};
-const TIMEOUT = 5000;
+// Wait 1 second before trying to show Nux
+const TIMEOUT = 1000;
const CommunityNuxImpl: React.FC<{dismiss: () => void}> = ({dismiss}) => {
const [shouldShowNux, setShouldShowNux] = React.useState(false);
@@ -93,7 +94,7 @@ const CommunityNuxImpl: React.FC<{dismiss: () => void}> = ({dismiss}) => {
);
};
-const IFRAME_SRC = 'http://dagster.io/dagit_iframes/community_nux';
+const IFRAME_SRC = 'https://dagster.io/dagit_iframes/community_nux';
type Props = {
width: string;
@@ -157,6 +158,7 @@ const useCommuniyNuxIframe = ({width, height}: Props) => {
top: parentRect.top,
zIndex: 21,
overflow: 'hidden',
+ border: 'none',
}
: {width, height, left: '-999999px', position: 'absolute', zIndex: 0}
}
|
Exclude json and source from Loader
Temporary measure, this should really be customisable per project and application. | @@ -152,7 +152,8 @@ class Window(QtWidgets.QDialog):
assets_model.addItem(item)
assets_model.setFocus()
- self.data["button"]["load"].show()
+ assets_model.setCurrentRow(0)
+ self.data["button"]["load"].hide()
self.data["button"]["stop"].hide()
def on_assetschanged(self, *args):
@@ -232,6 +233,10 @@ class Window(QtWidgets.QDialog):
if version_item is None:
return
+ # Item is disabled
+ if not version_item.data(QtCore.Qt.ItemIsEnabled):
+ return
+
representations = {}
if version_item.data(LatestRole):
@@ -244,12 +249,21 @@ class Window(QtWidgets.QDialog):
"parent": subset["_id"]
}, sort=[("name", -1)])
+ if not latest_version:
+ # No version available
+ continue
+
for representation in io.find({
"type": "representation",
"parent": latest_version["_id"]}):
name = representation["name"]
+ # TODO(marcus): These are permanently excluded
+ # for now, but look towards making this customisable.
+ if name not in ("json", "source"):
+ continue
+
if name not in representations:
representations[name] = list()
@@ -258,9 +272,10 @@ class Window(QtWidgets.QDialog):
else:
document = version_item.data(DocumentRole)
representations = {
- document["name"]: [document]
- for document in io.find({"type": "representation",
+ representation["name"]: [representation]
+ for representation in io.find({"type": "representation",
"parent": document["_id"]})
+ if representation["name"] not in ("json", "source")
}
has = {"children": False}
@@ -279,8 +294,13 @@ class Window(QtWidgets.QDialog):
def on_representationschanged(self, *args):
button = self.data["button"]["load"]
- item = self.data["model"]["assets"].currentItem()
- button.setEnabled(item.data(QtCore.Qt.ItemIsEnabled))
+ button.hide()
+
+ item = self.data["model"]["representations"].currentItem()
+
+ if item and item.data(QtCore.Qt.ItemIsEnabled):
+ button.show()
+ button.setEnabled(True)
def on_refresh_pressed(self):
self.refresh()
|
remove output_regex from supertask task.json
This field has no effect in the supertask | "multiple_choice_grade"
],
"example_input_prefix": "Context: ",
- "example_output_prefix": "\nA: ",
- "output_regex": ""
+ "example_output_prefix": "\nA: "
}
|
GDB helpers: hide special properties from completion
TN: | @@ -232,6 +232,12 @@ For instance::
prefix = word.lower()
result = [prop.name for prop in self.context.debug_info.properties
if prop.name.lower().startswith(prefix)]
+
+ # If the users didn't ask for a special property, don't suggest special
+ # properties, as they are usually just noise for them.
+ if not prefix.startswith('['):
+ result = [n for n in result if not n.startswith('[')]
+
return result
def invoke(self, arg, from_tty):
|
fix exit code bug
when running under Xvfb it is possible for the quit timer to trigger
after calling exit(1). When quit was called it was forcing exit(0).
I'm not sure why the quit timer was still triggering, but this commit
will ensure it always uses the correct exit code. | @@ -23,6 +23,7 @@ def _consoleAppExceptionHook(exc_type, exc_value, exc_traceback):
class ConsoleApp(object):
_startupCallbacks = {}
+ _exitCode = 0
def __init__(self):
om.init()
@@ -85,10 +86,11 @@ class ConsoleApp(object):
@staticmethod
def quit():
- ConsoleApp.applicationInstance().quit()
+ ConsoleApp.exit(ConsoleApp._exitCode)
@staticmethod
def exit(exitCode=0):
+ ConsoleApp._exitCode = exitCode
ConsoleApp.applicationInstance().exit(exitCode)
@staticmethod
|
doc: remove note about unstable API in RTD docs
The API is no longer unstable. | @@ -22,12 +22,6 @@ Code `examples <https://github.com/theupdateframework/python-tuf/tree/develop/ex
are available for client implementation using ngclient and a
basic repository using Metadata API.
-.. note:: Major API changes are unlikely but these APIs are not yet
- considered stable, and a higher-level repository operations API is not yet
- included.
-
- There is a legacy implementation in the source code (not covered by this
- documentation): it is in maintenance mode and receives no feature work.
.. toctree::
:maxdepth: 2
|
New entry, Indiana: tear gassing protestors
Sent to me over pm on reddit. | @@ -51,3 +51,15 @@ One woman struggled against the officer restraining her, so she and her friend w
**Links**
* https://www.reddit.com/r/PublicFreakout/comments/guffju/indianapolis_police_on_women_rights/
+
+## Lafayette
+
+### Officer drops tear gas into peaceful protest without warning |
+
+In this video, protestors are chanting peacefully when an officer drops tear gas on them with no warning.
+
+**Links**
+
+* https://www.facebook.com/ctchoula/videos/10163707272210302/
+
+* [Image of a tear gas cannister used in this incident](https://scontent-ort2-2.xx.fbcdn.net/v/t1.0-9/101254362_755196441884833_7192544661301362688_n.jpg?_nc_cat=103&_nc_sid=110474&_nc_ohc=wjDZM1x0RLYAX9sKPft&_nc_ht=scontent-ort2-2.xx&oh=606a9dbf10d30a680c5dcb2c8ae8d7ce&oe=5EFD314B).
|
Added -N (view mode) to cmake when listing header paths.
This improves performance when generating for VSCode. | @@ -179,7 +179,7 @@ def get_vs_header_paths(fips_dir, proj_dir, cfg):
# next get the used active Visual Studio instance from the cmake cache
proj_name = util.get_project_name_from_dir(proj_dir)
build_dir = util.get_build_dir(fips_dir, proj_name, cfg['name'])
- outp = subprocess.check_output(['cmake', '-LA', '.'], cwd=build_dir).decode("utf-8")
+ outp = subprocess.check_output(['cmake', '-LA', '-N', '.'], cwd=build_dir).decode("utf-8")
for line in outp.splitlines():
if line.startswith('CMAKE_LINKER:FILEPATH='):
bin_index = line.find('/bin/')
|
Update README.md
Added short discussion on human game-playing priors. | @@ -88,6 +88,8 @@ As previously mentioned, playing "randomly" (assuming parsable input) can solve
It is also likely that model performance is fairly sensitive to the details of the instructions, the choices of flavor text, as well as even the choices of symbols for the ASCII representation of the board. I argue that these choices _shouldn't_ matter, but they are choices that could be randomized in an auxiliary version of this task to test for appropriate generalization ability, should language models start becoming good at this task.
+Finally, it could be argued that there isn't an unambiguous "correct way to play" this task without additional grounding---that the implied objective "move the player to the target" is only "obvious" to a human because of human game-playing priors and familiarities with similar varieties of abstract games. An agent could decide to try to visit every available tile in the game, or intentionally avoid the mcguffin, or even try to spell out messages via their motion in the game etc., and these sorts of richly structured "strategies" are not well captured (or even detectable, really) by the current task score. To mitigate this, I've attempted to make the intended objective as obvious as possible, but because of the sheer variety of possible strategies available to even extremely simple game-playing rule systems, it's impractical to fully mitigate this problem.
+
## References:
|
Fix some template escaping.
The |safe in the format call was being lost and the output escaped. | <p class="share-link">
<br/>
{% set link='<a href="' + share_link + '">' + share_link + '</a>' %}
- {{ _('Share this article: {link}')|f(link=link|safe) }}
+ {{ _('Share this article: {link}')|f(link=link)|safe }}
</p>
{% endif %}
</article>
|
Remove pip install instructions
as now attrdict and jsmin are installed from conda-forge. | @@ -71,11 +71,6 @@ We recommend that you create a conda environment using the available
.. _environment.yml: \
https://github.com/pySTEPS/pysteps/blob/master/environment.yml
-In addition, you still need to pip install few remaining important dependencies::
-
- pip install attrdict
- pip install jsmin
-
This will allow running most of the basic functionalities in pysteps.
Install from source
|
Avoid setting Py_TPFLAGS_HEAPTYPE in Pyston
See | @@ -166,7 +166,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t);/*proto*/
static int __Pyx_PyType_Ready(PyTypeObject *t) {
// FIXME: is this really suitable for CYTHON_COMPILING_IN_LIMITED_API?
-#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API)
+#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
// avoid C warning about unused helper function
(void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
|
Add test section to extras_require
Closes | @@ -15,16 +15,22 @@ setup(
"Programming Language :: Python :: 3.10",
],
description="Send JSON-RPC requests",
+ extras_require={
+ "test": [
+ "pytest",
+ "pytest-cov",
+ "tox",
+ ],
+ },
include_package_data=True,
- install_requires=[],
license="MIT",
long_description=README,
long_description_content_type="text/markdown",
name="jsonrpcclient",
- # Be PEP 561 compliant
- # https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages
- zip_safe=False,
packages=["jsonrpcclient"],
url="https://github.com/explodinglabs/jsonrpcclient",
version="4.0.2",
+ # Be PEP 561 compliant
+ # https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages
+ zip_safe=False,
)
|
Set diesel fuel cost to escalation_pct for on-grid runs
This will be un-done when we update the UI and make a new version release. At that point, we will expose generator_fuel_escalation_pct in the UI | @@ -506,9 +506,9 @@ class ValidateNestedInput:
self.input_dict["Scenario"]["Site"]["LoadProfile"]["outage_end_time_step"] = 8760
# else:
# Sets diesel fuel escalation to the electricity escalation rate
- # Removed because diesel fuel cost escalation will be exposed as an input for on-grid
- # self.input_dict["Scenario"]["Site"]["Financial"]["generator_fuel_escalation_pct"] = \
- # self.input_dict["Scenario"]["Site"]["Financial"]["escalation_pct"]
+ # TODO: remove with next major UI update
+ self.input_dict["Scenario"]["Site"]["Financial"]["generator_fuel_escalation_pct"] = \
+ self.input_dict["Scenario"]["Site"]["Financial"]["escalation_pct"]
@property
def isValid(self):
if self.input_data_errors or self.urdb_errors or self.ghpghx_inputs_errors:
|
Correct printing of error info message for docker volume create command
zip() function in python3 returns an iterator. So creating a list from it for
proper error info message printing for docker volume create command
Resolves: | @@ -369,7 +369,7 @@ def validate_opts(opts, vmdk_path):
if len(invalid) != 0:
msg = 'Invalid options: {0} \n'.format(list(invalid)) \
+ 'Valid options and defaults: ' \
- + '{0}'.format(zip(list(valid_opts), defaults))
+ + '{0}'.format(list(zip(list(valid_opts), defaults)))
raise ValidationError(msg)
# For validation of clone (in)compatible options
|
Upgraded Message's get_command method to return pure command
(backward compatible) | @@ -130,7 +130,7 @@ class Message(base.TelegramObject):
command, _, args = self.text.partition(' ')
return command, args
- def get_command(self):
+ def get_command(self, pure=False):
"""
Get command from message
@@ -138,7 +138,10 @@ class Message(base.TelegramObject):
"""
command = self.get_full_command()
if command:
- return command[0]
+ command = command[0]
+ if pure:
+ command, _, _ = command[1:].partition('@')
+ return command
def get_args(self):
"""
|
rgw: call `ceph_ec_profile` when needed
Let's replace `command` tasks with `ceph_ec_profile` calls | ---
-- name: remove ec profile
- command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd erasure-code-profile rm {{ item.value.ec_profile }}"
- loop: "{{ rgw_create_pools | dict2items }}"
+- name: create ec profile
+ ceph_ec_profile:
+ name: "{{ item.value.ec_profile }}"
+ k: "{{ item.value.ec_k }}"
+ m: "{{ item.value.ec_m }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
- changed_when: false
- when:
- - item.value.type is defined
- - item.value.type == 'ec'
- failed_when: false
-
-- name: set ec profile
- command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd erasure-code-profile set {{ item.value.ec_profile }} k={{ item.value.ec_k }} m={{ item.value.ec_m }}"
loop: "{{ rgw_create_pools | dict2items }}"
- delegate_to: "{{ groups[mon_group_name][0] }}"
- changed_when: false
when:
- item.value.type is defined
- item.value.type == 'ec'
+ environment:
+ CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
+ CEPH_CONTAINER_BINARY: "{{ container_binary }}"
- name: set crush rule
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd crush rule create-erasure {{ item.key }} {{ item.value.ec_profile }}"
|
Get chassis from config file
Allow local controller to get chassis name from the configuration option
'host' in neutron.conf. The 'host' will be got from socket.gethostname by
default | # License for the specific language governing permissions and limitations
# under the License.
-import socket
import sys
import time
@@ -584,7 +583,7 @@ def init_ryu_config():
# python df_local_controller.py <chassis_unique_name>
# <local ip address> <southbound_db_ip_address>
def main():
- chassis_name = socket.gethostname()
+ chassis_name = cfg.CONF.host
common_config.init(sys.argv[1:])
config.setup_logging()
init_ryu_config()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.