Derive missing values of source from the existing fields.
425761
def populate_source(cls, source):
        """"""
        # Only URL pararemter is mandatory, let the KeyError be thrown.
        if "name" not in source:
            source["name"] = get_url_name(source["url"])
        if "verify_ssl" not in source:
            source["verify_ssl"] = "https://" in source["url"]
        if not isinstance(source["verify_ssl"], bool):
            source["verify_ssl"] = source["verify_ssl"].lower() == "true"
        return source
393649
def get_fields(desc2nts):
        """"""
        if 'flat' in desc2nts:
            nts_flat = desc2nts.get('flat')
            if nts_flat:
                return nts_flat[0]._fields
        if 'sections' in desc2nts:
            nts_sections = desc2nts.get('sections')
            if nts_sections:
                return nts_sections[0][1][0]._fields
117491
def add_missing(C):
    """"""
    C_out = C.copy()
    for k in (set(WC_keys) - set(C.keys())):
        C_out[k] = np.zeros(C_keys_shape[k])
    return C_out
1036643
def derive_fields(self):
        
        if self.fields:
            return self.fields

        else:
            fields = []
            for field in self.object_list.model._meta.fields:
                if field.name != 'id':
                    fields.append(field.name)
            return fields
810326
def get_missing_bins(original, trimmed):
    

    original_diag = np.diag(original)
    trimmed_diag = np.diag(trimmed)
    index = []
    m = min(original.shape)
    for j in range(min(trimmed.shape)):
        k = 0
        while original_diag[j + k] != trimmed_diag[j] and k < 2 * m:
            k += 1
        index.append(k + j)
    return np.array(index)
28475
def _chk_flds_fmt(nt_fields, prtfmt):
    """"""
    fmtflds = get_fmtflds(prtfmt)
    missing_data = set(fmtflds).difference(set(nt_fields))
    # All data needed for print is present, return.
    if not missing_data:
        return
    #raise Exception('MISSING DATA({M}).'.format(M=" ".join(missing_data)))
    msg = ['CANNOT PRINT USING: "{PF}"'.format(PF=prtfmt.rstrip())]
    for fld in fmtflds:
        errmrk = "" if fld in nt_fields else "ERROR-->"
        msg.append("  {ERR:8} {FLD}".format(ERR=errmrk, FLD=fld))
    raise Exception('\n'.join(msg))
755970
private Data<Input, Output> derive_(Input input) {
        Data<Input, Output> result = new Data<>(input, fn_.apply(input));
        recent_.set(result);
        return result;
    }
64517
def _get_data_from_table(source, fields='*', first_row=0, count=-1, schema=None):
  
  if not source.exists():
    return _get_data_from_empty_list(source, fields, first_row, count)
  if schema is None:
    schema = source.schema
  fields = get_field_list(fields, schema)
  gen = source.range(first_row, count) if count >= 0 else source
  rows = [{'c': [{'v': row[c]} if c in row else {} for c in fields]} for row in gen]
  return {'cols': _get_cols(fields, schema), 'rows': rows}, source.length
255191
def _get_implicit_requirements(
        self,
        fields,
        requirements
    ):
        """"""
        for name, field in six.iteritems(fields):
            source = field.source
            # Requires may be manually set on the field -- if not,
            # assume the field requires only its source.
            requires = getattr(field, 'requires', None) or [source]
            for require in requires:
                if not require:
                    # ignore fields with empty source
                    continue

                requirement = require.split('.')
                if requirement[-1] == '':
                    # Change 'a.b.' -> 'a.b.*',
                    # supporting 'a.b.' for backwards compatibility.
                    requirement[-1] = '*'
                requirements.insert(requirement, TreeMap(), update=True)
50224
def _extract_alternative_fields(self, fields, default=None, field_type=float):
        '''
        
        '''
        for field in fields:
            if field in self.tags:
                if field_type is float:
                    value = eval_frac(self.tags[field].values[0])
                if field_type is str:
                    value = str(self.tags[field].values)
                if field_type is int:
                    value = int(self.tags[field].values[0])
                return value, field
        return default, None
825658
def execute(self, sources, target):
        
        existing_ml_fields = self._get_fields_list_from_eps(sources)
        dup_ml_fields = [f.copy() for f in self.fields]
        if self.is_append:
            src = list([copy.deepcopy(f) for f in existing_ml_fields[0]])
            src.extend(dup_ml_fields)
            target._ml_fields = src
        else:
            target._ml_fields = self.fields
931289
function expandSchemaDescriptor(descriptor) {
  for (const field of (descriptor.fields || [])) {
    expandFieldDescriptor(field)
  }
  if (!descriptor.missingValues) descriptor.missingValues = config.DEFAULT_MISSING_VALUES
  return descriptor
}
175691
def missing(*args, **kwds):
        """"""
        from functools import reduce

        freq = kwds.get('freq')
        miss = (checks.missing_any(da, freq) for da in args)
        return reduce(np.logical_or, miss)
153726
def zero_missing_data(data1, data2):
    """"""
    nans = xu.logical_and(xu.isnan(data1), xu.logical_not(xu.isnan(data2)))
    return data1.where(~nans, 0)
1336957
def export_deleted_fields(self):
        
        result = self.__deleted_fields__.copy()

        for key, value in self.__original_data__.items():
            if key in result:
                continue
            try:
                partial = value.export_deleted_fields()
                result.extend(['.'.join([key, key2]) for key2 in partial])
            except AttributeError:
                pass

        return result
552724
def GetValues(self, fd):
    """"""
    result = None
    for result in fd.new_attributes.get(self, []):
      # We need to interpolate sub fields in this rdfvalue.
      if self.field_names:
        for x in self.GetSubFields(result, self.field_names):
          yield x

      else:
        yield result

    for result in fd.synced_attributes.get(self, []):
      result = result.ToRDFValue()

      # We need to interpolate sub fields in this rdfvalue.
      if result is not None:
        if self.field_names:
          for x in self.GetSubFields(result, self.field_names):
            yield x

        else:
          yield result

    if result is None:
      default = self.GetDefault(fd)
      if default is not None:
        yield default
1043390
def update(self, values):
        
        for k, v in values.items():
            root, sub = self.split(k)
            if sub is None:
                self.declarations[root] = v
            else:
                self.contexts[root][sub] = v

        extra_context_keys = set(self.contexts) - set(self.declarations)
        if extra_context_keys:
            raise errors.InvalidDeclarationError(
                "Received deep context for unknown fields: %r (known=%r)" % (
                    {
                        self.join(root, sub): v
                        for root in extra_context_keys
                        for sub, v in self.contexts[root].items()
                    },
                    sorted(self.declarations),
                )
            )