Get descriptive kwargs of the container (e.g. name, description, meta).
197251
def _rel(self, copy=False):
        
        rel = {}
        for key, obj in vars(self).items():
            if not isinstance(obj, (pd.Series, pd.DataFrame, pd.SparseSeries, pd.SparseDataFrame)) and not key.startswith('_'):
                if copy and 'id' not in key:
                    rel[key] = deepcopy(obj)
                else:
                    rel[key] = obj
        return rel
1047820
def _context_names():
    """"""
    import inspect

    from renku.models import provenance
    from renku.models._jsonld import JSONLDMixin

    for name in dir(provenance):
        cls = getattr(provenance, name)
        if inspect.isclass(cls) and issubclass(cls, JSONLDMixin):
            yield name
180642
def get_metadata(self):
        
        inspect_data = self.inspect(refresh=True)
        inspect_to_container_metadata(self.metadata, inspect_data, self.image)

        return self.metadata
69444
def get_metadata(self, container, prefix=None):
        
        headers = self.get_headers(container)
        if prefix is None:
            prefix = CONTAINER_META_PREFIX
        low_prefix = prefix.lower()
        ret = {}
        for hkey, hval in list(headers.items()):
            if hkey.lower().startswith(low_prefix):
                cleaned = hkey.replace(low_prefix, "").replace("-", "_")
                ret[cleaned] = hval
        return ret
681552
def get_description(self, obj):
        """"""
        search_description = self.get_model_config_value(obj, 'search_description')

        if not search_description:
            return super().get_description(obj)

        return search_description.format(**obj.__dict__)
509258
def get_descriptions_metadata(self):
        
        metadata = dict(self._descriptions_metadata)
        metadata.update({'existing_string_values': [t['text'] for t in self.my_osid_object_form._my_map['descriptions']]})
        return Metadata(**metadata)
750621
def metadataContributer(self):
        """"""
        if self._metaFL is None:
            fl = FeatureService(url=self._metadataURL,
                              proxy_url=self._proxy_url,
                              proxy_port=self._proxy_port)
            self._metaFS = fl
        return self._metaFS
1104763
def describe(self, **kwargs):
        
        response = self._new_response()
        description = {
            'cruddy_version': __version__,
            'table_name': self.table_name,
            'supported_operations': copy.copy(self.supported_ops),
            'prototype': copy.deepcopy(self.prototype),
            'operations': {}
        }
        for name, method in inspect.getmembers(self, inspect.ismethod):
            if not name.startswith('_'):
                argspec = inspect.getargspec(method)
                if argspec.defaults is None:
                    defaults = None
                else:
                    defaults = list(argspec.defaults)
                method_info = {
                    'docs': inspect.getdoc(method),
                    'argspec': {
                        'args': argspec.args,
                        'varargs': argspec.varargs,
                        'keywords': argspec.keywords,
                        'defaults': defaults
                    }
                }
                description['operations'][name] = method_info
        response.data = description
        return response
773234
def params(self):
        """"""
        return [
            DocstringParam.from_meta(meta, self.meta)
            for meta in self.meta
            if meta.args[0] in {
                'param', 'parameter', 'arg', 'argument', 'key', 'keyword'
            }
        ]
753575
def extract_kwargs(names:Collection[str], kwargs:KWArgs):
    ""
    new_kwargs = {}
    for arg_name in names:
        if arg_name in kwargs:
            arg_val = kwargs.pop(arg_name)
            new_kwargs[arg_name] = arg_val
    return new_kwargs, kwargs
744720
def determine_metadata(self, request, view):
        """"""
        metadata = super(
            DynamicMetadata,
            self).determine_metadata(
            request,
            view)
        metadata['features'] = getattr(view, 'features', [])
        if hasattr(view, 'get_serializer'):
            serializer = view.get_serializer(dynamic=False)
            if hasattr(serializer, 'get_name'):
                metadata['resource_name'] = serializer.get_name()
            if hasattr(serializer, 'get_plural_name'):
                metadata['resource_name_plural'] = serializer.get_plural_name()
        metadata['properties'] = self.get_serializer_info(serializer)
        return metadata
162836
def kwargs(self):
        """"""
        # Subclasses must override this property if and only if they define
        # keyword-only arguments in their __init__ method
        if hasattr(self, '_has_kwargs') and self._has_kwargs:
            raise NotImplementedError(
                "Class %s does not provide a kwargs property"
                % str(self.__class__.__name__))
        return {}
780075
def get_page_kwargs(**kwargs):
    """"""
    page_kwargs = {}

    page = kwargs.get("page")
    if page is not None and page > 0:
        page_kwargs["page"] = page

    page_size = kwargs.get("page_size")
    if page_size is not None and page_size > 0:
        page_kwargs["page_size"] = page_size

    return page_kwargs
439338
def get_valid_kwargs(func, potential_kwargs):
    
    kwargs = {}
    for name in get_kwarg_names(func):
        with suppress(KeyError):
            kwargs[name] = potential_kwargs[name]
    return kwargs
557779
def get_form_kwargs(self):
        

        kwargs = {}
        for key in six.iterkeys(self.form_classes):
            if self.request.method in ('POST', 'PUT'):
                kwargs[key] = {
                    'data': self.request.POST,
                    'files': self.request.FILES,
                }
            else:
                kwargs[key] = {}
        return kwargs
342462
def get_kwargs(grid, kwargs, phenotypes=False):
    
    denom = None
    if "denom" in kwargs:
        denom = kwargs["denom"]

    if "palette" in kwargs:
        palette = kwargs["palette"]
        if denom is None:
            denom = len(palette)
    elif "environment" in kwargs or isinstance(grid, EnvironmentFile):
        if "environment" in kwargs:
            env = kwargs["environment"]
        else:
            env = grid

        if phenotypes:
            palette = env.task_palette
            if denom is None:
                denom = len(env.tasks)
        else:
            palette = env.resource_palette
            if denom is None:
                denom = len(env.resources)

    else:
        length = get_pallete_length(grid)
        palette = sns.hls_palette(length, s=1)
        denom = length

    return denom, palette
409108
def get_metadata(self):
        
        if self._metadata is None:
            self._metadata = ContainerMetadata()
        inspect_to_container_metadata(self._metadata, self.inspect(refresh=True), self.image)
        return self._metadata