Returns dictionary with trailer names as keys and list of
        trailer urls as values. Each trailer can have more links due
        to different qualities.

        Example:
        {'Trailer':['url1','url2'],'Featurette':['url1','url2']}
492964
def get_trailerLinks(self):
        
        if self._trailerLinks:
            return self._trailerLinks

        wip = WebIncParser("http://trailers.apple.com" + self.baseURL,
                           "includes/playlists/web.inc")

        self._trailerLinks = wip.getTrailers()
        return self._trailerLinks
1265853
def _get_containing_contigs(self, hits_dict):
        ''''''
        containing = {}

        for qry_name in hits_dict:
            d = self._containing_contigs(hits_dict[qry_name])
            if len(d):
                containing[qry_name] = d

        return containing
1194994
def list_of_lists_to_dict(l):
    
    d = {}
    for key, val in l:
        d.setdefault(key, []).append(val)
    return d
656464
def to_dict(self) -> dict:
        ''''''

        return {
            "version": self.version,
            "description": self.description,
            "count_mode": self.count_mode,
            "start_block": self.start_block,
            "end_block": self.end_block,
            "choices": self.choices,
            "vote_metainfo": self.vote_metainfo
        }
402005
def to_dict(self):
        
        return {
            "title": self.title,
            "language" : self.language,
            "description": self.description,
            "node_id": self.get_node_id().hex,
            "content_id": self.get_content_id().hex,
            "source_domain": self.domain_ns.hex,
            "source_id": self.source_id,
            "author": self.author,
            "aggregator": self.aggregator,
            "provider": self.provider,
            "files" : [f.to_dict() for f in filter(lambda x: x and x.filename, self.files)], # Filter out failed downloads
            "tags": self.tags,
            "kind": self.kind,
            "license": self.license.license_id,
            "license_description": self.license.description,
            "copyright_holder": self.license.copyright_holder,
            "questions": [question.to_dict() for question in self.questions],
            "extra_fields": json.dumps(self.extra_fields),
            "role": self.role,
        }
867032
def as_dict(self):
        
        drepr = {
            'blocks': [
                block.as_dict() for block in self if block.hidden == False
            ],
            'args': list(self.needed_inputs())
        }
        return drepr
2681
def get_context_dict(self):
        
        context_dict = {}
        for s in self.sections():
            for k, v in self.manifest.items(s):
                context_dict["%s:%s" % (s, k)] = v
        for k, v in self.inputs.values().items():
            context_dict["config:{0}".format(k)] = v
        context_dict.update(self.additional_context_variables.items())
        context_dict.update(dict([("%s|escaped" % k, re.escape(str(v) or "")) for k, v in context_dict.items()]))
        return context_dict
117868
def _build_dictionary(self, results):
        
        foreign = self._foreign_key

        dictionary = {}

        for result in results:
            key = getattr(result.pivot, foreign)
            if key not in dictionary:
                dictionary[key] = []

            dictionary[key].append(result)

        return dictionary
1048433
def params_to_dict(params, dct):
    
    for param, val in params.items():
        if val is None:
            continue
        dct[param] = val
    return dct
361375
def envdict2listdict(envdict):
    """"""
    sep = os.path.pathsep
    for key in envdict:
        if sep in envdict[key]:
            envdict[key] = [path.strip() for path in envdict[key].split(sep)]
    return envdict
1272835
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'title') and self.title is not None:
            _dict['title'] = self.title
        if hasattr(self, 'hash') and self.hash is not None:
            _dict['hash'] = self.hash
        return _dict
667470
def urlencode(params):
    """"""

    # Not doing duck typing here. Will make debugging easier.
    if not isinstance(params, dict):
        raise TypeError("Only dicts are supported.")

    params = flatten(params)

    url_params = OrderedDict()
    for param in params:
        value = param.pop()

        name = parametrize(param)
        if isinstance(value, (list, tuple)):
            name += "[]"

        url_params[name] = value

    return urllib_urlencode(url_params, doseq=True)
1072599
def asDictionary(self):
        
        value = self._dict
        if value is None:
            template = {
                "hasM" : self._hasM,
                "hasZ" : self._hasZ,
                "rings" : [],
                "spatialReference" : self.spatialReference
            }
            for part in self._rings:
                lpart = []
                for pt in part:
                    if isinstance(pt, list):
                        lpart.append(pt)
                    elif isinstance(pt, Point):
                        lpart.append(pt.asList)
                template['rings'].append(lpart)
                del lpart
            self._dict = template
        return self._dict
737170
def to_dict(self):
        

        result = self.to_identifier()

        result.update({
            'title': self.title,

            'watched': 1 if self.is_watched else 0,
            'collected': 1 if self.is_collected else 0,

            'plays': self.plays if self.plays is not None else 0,
            'in_watchlist': self.in_watchlist if self.in_watchlist is not None else 0,
            'progress': self.progress,

            'last_watched_at': to_iso8601_datetime(self.last_watched_at),
            'collected_at': to_iso8601_datetime(self.collected_at),
            'paused_at': to_iso8601_datetime(self.paused_at),

            'ids': dict([
                (key, value) for (key, value) in self.keys[1:]  # NOTE: keys[0] is the (<season>, <episode>) identifier
            ])
        })

        if self.rating:
            result['rating'] = self.rating.value
            result['rated_at'] = to_iso8601_datetime(self.rating.timestamp)

        # Extended Info
        if self.first_aired:
            result['first_aired'] = to_iso8601_datetime(self.first_aired)

        if self.updated_at:
            result['updated_at'] = to_iso8601_datetime(self.updated_at)

        if self.overview:
            result['overview'] = self.overview

        if self.available_translations:
            result['available_translations'] = self.available_translations

        return result
311535
def trailer
            #
            # First look for a standard trailer dictionary
            #
            if @revisions.last.trailer.dictionary?
                trl = @revisions.last.trailer

            #
            # Otherwise look for a xref stream.
            #
            else
                trl = @revisions.last.xrefstm
            end

            raise InvalidPDFError, "No trailer found" if trl.nil?

            trl
        end
1258340
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'url') and self.url is not None:
            _dict['url'] = self.url
        if hasattr(self, 'limit_to_starting_hosts'
                  ) and self.limit_to_starting_hosts is not None:
            _dict['limit_to_starting_hosts'] = self.limit_to_starting_hosts
        if hasattr(self, 'crawl_speed') and self.crawl_speed is not None:
            _dict['crawl_speed'] = self.crawl_speed
        if hasattr(self, 'allow_untrusted_certificate'
                  ) and self.allow_untrusted_certificate is not None:
            _dict[
                'allow_untrusted_certificate'] = self.allow_untrusted_certificate
        if hasattr(self, 'maximum_hops') and self.maximum_hops is not None:
            _dict['maximum_hops'] = self.maximum_hops
        if hasattr(self,
                   'request_timeout') and self.request_timeout is not None:
            _dict['request_timeout'] = self.request_timeout
        if hasattr(
                self,
                'override_robots_txt') and self.override_robots_txt is not None:
            _dict['override_robots_txt'] = self.override_robots_txt
        return _dict
595377
def asDictionary(self):
        
        #
        template = {"x" : self._x,
                    "y" : self._y,
                    "spatialReference" : self.spatialReference
                    }
        if not self._z is None:
            template['z'] = self._z
        if not self._m is None:
            template['z'] = self._m
        return template