Skip to content

Commit

Permalink
apply isort and black
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgirshick committed Apr 27, 2019
1 parent 8a679b4 commit aabe5bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions yacs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"""

import copy
import sys
import io
import logging
import os
import sys
from ast import literal_eval

import yaml
Expand Down Expand Up @@ -426,11 +426,15 @@ def _decode_cfg_value(cls, value):
return value


load_cfg = CfgNode.load_cfg # keep this function in global scope for backward compatibility
load_cfg = (
CfgNode.load_cfg
) # keep this function in global scope for backward compatibility


def _valid_type(value, allow_cfg_node=False):
return (type(value) in _VALID_TYPES) or (allow_cfg_node and isinstance(value, CfgNode))
return (type(value) in _VALID_TYPES) or (
allow_cfg_node and isinstance(value, CfgNode)
)


def _merge_a_into_b(a, b, root, key_list):
Expand Down
2 changes: 1 addition & 1 deletion yacs/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def test_new_allowed(self):
cfg.merge_from_file("example/config_new_allowed.yaml")
assert cfg.KWARGS.a == 1
assert cfg.KWARGS.B.c == 2
assert cfg.KWARGS.B.D.e == '3'
assert cfg.KWARGS.B.D.e == "3"

def test_new_allowed_bad(self):
cfg = get_cfg()
Expand Down

0 comments on commit aabe5bd

Please sign in to comment.