Locate the last config item at a specified depth
510883
def at_depth(self, level):
        
        return Zconfig(lib.zconfig_at_depth(self._as_parameter_, level), False)
730588
private String locateConfigFileName(String configDir, String configFileName) throws IOException {
    String curDir = new File(".").getCanonicalPath();

    String path = null;

    // Go for at most 10 levels up
    for (int i = 0; i < 10; i++) {
      path = String.format("%s/%s", curDir, configFileName);
      if (Utils.localFileExists(path)) break;

      String dir = String.format("%s/%s", curDir, configDir);
      if (Utils.dirExists(dir)) {
        path = String.format("%s/%s", dir, configFileName);
        if (Utils.localFileExists(path)) break;
      }

      curDir = String.format("%s/..", curDir);
    }

    mSource = path;

    if (Strings.isNullOrEmpty(path)) throw new IOException(String.format("Cannot locate DDF configuration file %s",
        configFileName));

    mLog.debug(String.format("Using config file found at %s\n", path));
    return path;
  }
197614
def depth(self, pos):
        """"""
        parent = self.parent_position(pos)
        if parent is None:
            return 0
        else:
            return self.depth(parent) + 1
1001062
async def traverse_settings(dev, module, settings, depth=0):
    """"""
    for setting in settings:
        if setting.is_directory:
            print("%s%s (%s)" % (depth * " ", setting.title, module))
            return await traverse_settings(dev, module, setting.settings, depth + 2)
        else:
            try:
                print_settings([await setting.get_value(dev)], depth=depth)
            except SongpalException as ex:
                err("Unable to read setting %s: %s" % (setting, ex))
                continue
346542
def last_seen_local(self) -> Optional[datetime]:
        """"""
        if self._node['seen']:
            return datetime.fromtimestamp(self._node['seen'])
1229873
def get_config(path=os.getcwd()):
    """"""
    config = default
    tries = 0
    current_dir = path
    while current_dir and tries < MAX_CONFIG_SEARCH_DEPTH:
        potential_path = os.path.join(current_dir, ".fonduer-config.yaml")
        if os.path.exists(potential_path):
            with open(potential_path, "r") as f:
                config = _merge(config, yaml.safe_load(f))
            logger.debug(f"Loading Fonduer config from {potential_path}.")
            break

        new_dir = os.path.split(current_dir)[0]
        if current_dir == new_dir:
            logger.debug("Unable to find config file. Using defaults.")
            break
        current_dir = new_dir
        tries += 1

    return config
896862
def overlay_depth(obj):
    
    if isinstance(obj, DynamicMap):
        if isinstance(obj.last, CompositeOverlay):
            return len(obj.last)
        elif obj.last is None:
            return None
        return 1
    else:
        return 1
569030
def do_last(environment, seq):
    """"""
    try:
        return next(iter(reversed(seq)))
    except StopIteration:
        return environment.undefined('No last item, sequence was empty.')
1207587
def get_last_array(self):
        
        # Get the root array (might not have been registered).
        root = self.repo[self.id]

        # Get length and last item in the root array.
        apex_id, apex_height = root.get_last_item_and_next_position()

        # Bail if there isn't anything yet.
        if apex_id is None:
            return None, None

        # Get the current apex array.
        apex = self.repo[apex_id]
        assert isinstance(apex, Array)

        # Descend until hitting the bottom.
        array = apex
        array_i = 0
        height = apex_height
        while height > 1:
            height -= 1
            array_id, width = array.get_last_item_and_next_position()
            assert width > 0
            offset = width - 1
            array_i += offset * self.repo.array_size ** height
            array = self.repo[array_id]

        return array, array_i
482063
def _last_stack_str():
    """"""
    stack = extract_stack()
    for s in stack[::-1]:
        if op.join('vispy', 'gloo', 'buffer.py') not in __file__:
            break
    return format_list([s])[0]
1217086
def _get_depthsr(self, goobj):
        """"""
        if 'reldepth' in self.gosubdag.prt_attr['flds']:
            return "R{R:02}".format(R=goobj.reldepth)
        return "D{D:02}".format(D=goobj.depth)
1355691
def get_last_doc(self):
        """"""
        return max(self.doc_dict.values(), key=lambda x: x.ts).meta_dict
1046985
def get_last_offset(self, field, filters_=[]):
        '''
            
        '''

        offset = self.get_last_item_field(field, filters_=filters_, offset=True)

        return offset
581693
def last(self, skipna=None, keep_attrs=None):
        
        return self._first_or_last(duck_array_ops.last, skipna, keep_attrs)
1191246
def last(conf):
    """"""
    try:
        v2ex = V2ex(conf.config)
        v2ex.login()
        last_date = v2ex.get_last()
        click.echo(last_date)
    except KeyError:
        click.echo('Keyerror, please check your config file.')
    except IndexError:
        click.echo('Please check your username and password.')
1078963
def _last_index(x, default_dim):
  """"""
  if x.get_shape().ndims is not None:
    return len(x.get_shape()) - 1
  else:
    return default_dim
239068
def _find_stages(self):
        """"""
        stages = []
        end = last_user_found = None
        for part in reversed(self.dfp.structure):
            if end is None:
                end = part

            if part['instruction'] == 'USER' and not last_user_found:
                # we will reuse the line verbatim
                last_user_found = part['content']

            if part['instruction'] == 'FROM':
                stages.insert(0, {'from_structure': part,
                                  'end_structure': end,
                                  'stage_user': last_user_found})
                end = last_user_found = None

        return stages