extract src and dst values from a section
174065
def _get_section_values(self, config, section):
        
        src_host = self._get_hosts_from_names(config.get(section, 'src.host')) \
            if config.has_option(section, 'src.host') else None
        src_file = [self._get_abs_filepath(config.get(section, 'src.file'))] \
            if config.has_option(section, 'src.file') else None
        if src_host is None and src_file is None:
            raise conferr('Section "%s" gets no sources' % section)

        dst_host = self._get_hosts_from_names(config.get(section, 'dst.host')) \
            if config.has_option(section, 'dst.host') else None
        dst_file = [self._get_abs_filepath(config.get(section, 'dst.file'))] \
            if config.has_option(section, 'dst.file') else None
        if dst_host is None and dst_file is None:
            raise conferr('Section "%s" gets no destinations' % section)

        return (src_host, src_file, dst_host, dst_file)
1059238
def prt_tsv_sections(prt, tsv_data, **kws):
    """"""
    prt_hdr_min = 10  # Print hdr on the 1st section and for any following 'large' sections
    num_items = 0
    if tsv_data:
        # Basic data checks
        assert len(tsv_data[0]) == 2, "wr_tsv_sections EXPECTED: [(section, nts), ..."
        assert tsv_data[0][1], \
            "wr_tsv_sections EXPECTED SECTION({S}) LIST TO HAVE DATA".format(S=tsv_data[0][0])
        hdrs_wrote = False
        sep = "\t" if 'sep' not in kws else kws['sep']
        prt_flds = kws['prt_flds'] if 'prt_flds' in kws else tsv_data[0]._fields
        fill = sep*(len(prt_flds) - 1)
        # Write data
        for section_text, data_nts in tsv_data:
            prt.write("{SEC}{FILL}\n".format(SEC=section_text, FILL=fill))
            if hdrs_wrote is False or len(data_nts) > prt_hdr_min:
                prt_tsv_hdr(prt, data_nts, **kws)
                hdrs_wrote = True
            num_items += prt_tsv_dat(prt, data_nts, **kws)
        return num_items
    else:
        return 0
327348
async def smove(self, src, dst, value):
        
        res = await self.srem(src, value)

        # Only add the element if existed in src set
        if res == 1:
            await self.sadd(dst, value)

        return res
1031362
def mksls(src, dst=None):
    '''
    
    '''
    with salt.utils.files.fopen(src, 'r') as fh_:
        ps_opts = xml.to_dict(ET.fromstring(fh_.read()))

    if dst is not None:
        with salt.utils.files.fopen(dst, 'w') as fh_:
            salt.utils.yaml.safe_dump(ps_opts, fh_, default_flow_style=False)
    else:
        return salt.utils.yaml.safe_dump(ps_opts, default_flow_style=False)
1104414
def compare_timestamp(src, dst):
  

  try:
    dst_time = os.path.getmtime(dst)
  except OSError as exc:
    if exc.errno == errno.ENOENT:
      return True  # dst does not exist

  src_time = os.path.getmtime(src)
  return src_time > dst_time
480236
function copyElements(src, dst, dstNdx, offset) {
  offset = offset || 0;
  const length = src.length;
  for (let ii = 0; ii < length; ++ii) {
    dst[dstNdx + ii] = src[ii] + offset;
  }
}
376293
def copymode(src, dst):
    """"""
    if hasattr(os, 'chmod'):
        st = os.stat(src)
        mode = stat.S_IMODE(st.st_mode)
        os.chmod(dst, mode)
463962
function( src, dst ){
    this._dat[ 0|BLEND_FUNC_C_SRC ] = src;
    this._dat[ 0|BLEND_FUNC_C_DST ] = dst;
    this._set = this._set & ~BLEND_FUNC_A_SET | (~~BLEND_FUNC_SET);
    return this;
  }
44801
function extractTime(time) {
    var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__read"])(time.split(':'), 2), h = _a[0], m = _a[1];
    return { hours: +h, minutes: +m };
}
530569
def copy_folder_content(src, dst):
    
    for file in os.listdir(src):
        file_path = os.path.join(src, file)
        dst_file_path = os.path.join(dst, file)
        if os.path.isdir(file_path):
            shutil.copytree(file_path, dst_file_path)
        else:
            shutil.copyfile(file_path, dst_file_path)
420201
def get_hdrs(self, **kws):
        """"""
        hdrs = get_hdrs(self.prt_flds, **kws)
        # Values in a "format_txt" "column" are used for formatting, not printing
        return [h for h in hdrs if h != "format_txt"]
1370962
function shallowCopy(src, dst) {
  dst = dst || {};

  for(var key in src) {
    if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {
      dst[key] = src[key];
    }
  }

  return dst;
}
662435
function dumpFiles(title, fn) {
            var matches = fn();
            if (matches.length) {
                log.info("");
                log.info((title + ":")['green']);
                for (var i = 0; i < matches.length; i++) {
                    if (matches[i].src === matches[i].dst) {
                        log.info(matches[i].dst);
                    } else {
                        log.info(matches[i].dst + ' (from ' + matches[i].src + ')');
                    }
                }
            }
        }
1285543
def divide(src_file, dst_dir)
      FileUtils.mkdir_p(dst_dir) unless File.exist?(dst_dir)

      src_content = YAML.load_file(src_file)
      filenames = []

      case src_content
      when Hash
        src_content.each do |key, value|
          filename = "#{dst_dir}/#{key}.yml"
          File.open(filename, "wb") do |f|
            f.write({key => value}.to_yaml)
          end
          filenames << filename
        end

      when Array
        src_content.each_with_index do |element, index|
          filename = "#{dst_dir}/#{index}.yml"
          File.open(filename, "wb") do |f|
            f.write([element].to_yaml)
          end
          filenames << filename
        end

      else
        raise "Unknown type"
      end

      filenames
    end
1107768
function processFormat( value, src, dst ) {
  if( !dst.format ) return value;
  try {
    if( !Array.isArray( dst.format ) )
      throw "Must be an array with two elements!";
    var intlFunc = dst.format[0];
    if( typeof intlFunc !== 'function' )
      throw "First element of the array must be a function!";
    var intlId = dst.format[1];
    if( typeof intlId !== 'string' )
      throw "Second element of the array must be a string!";
    return intlFunc( intlId, value );
  }
  catch( ex ) {
    console.error( ex );
    fail(
      "Error in format of link "
        + PropertyManager(src.obj) + "." + src.name
        + " -> "
        + PropertyManager(dst.obj) + "." + dst.name + "!\n"
        + ex
    );
  }
}
1183849
function parsePlain (params, section, stripped) {
  stripped = stripped.replace(internals.regexp.wildcard, '')
  assert(params && params[stripped], `The '${stripped}' parameter is missing`)

  return { dst: section, src: params[stripped] }
}
197081
def scale(val, src, dst):
    
    if val < src[0]:
        return dst[0]
    if val > src[1]:
        return dst[1]

    return ((val - src[0]) / (src[1] - src[0])) * (dst[1] - dst[0]) + dst[0]