Converts 'django.views.news.stories.story_detail' to
    ('django.views.news.stories', 'story_detail')

    Taken from django.core.urlresolvers
195344
def get_mod_func(class_string):
    
    try:
        dot = class_string.rindex('.')
    except ValueError:
        return class_string, ''
    return class_string[:dot], class_string[dot + 1:]
674956
function _detailedStringForDecryptionError(err, details) {
    let result = err.name + '[msg: ' + err.message;

    if (details) {
        result += ', ' +
            Object.keys(details).map(
                (k) => k + ': ' + details[k],
            ).join(', ');
    }

    result += ']';

    return result;
}
391730
def get_facet_serializer(self, *args, **kwargs):
        
        assert "objects" in kwargs, "`objects` is a required argument to `get_facet_serializer()`"

        facet_serializer_class = self.get_facet_serializer_class()
        kwargs["context"] = self.get_serializer_context()
        kwargs["context"].update({
            "objects": kwargs.pop("objects"),
            "facet_query_params_text": self.facet_query_params_text,
        })
        return facet_serializer_class(*args, **kwargs)
340003
async def detail(self, **kwargs):
        '''
        
        '''
        try:
            pk = self.pk_type(kwargs.get('pk'))
            obj = await self._meta.object_class.find_one(self.db, {self.pk: pk})
            if obj:
                return await obj.serialize()
            raise NotFound('Object matching the given {} with value {} was not found'.format(self.pk, str(pk)))
        except InvalidId:
            raise NotFound('Invalid ID')
587869
def from_url(url, timeout=None):
        
        articles = NewsPlease.from_urls([url], timeout=timeout)
        if url in articles.keys():
            return articles[url]
        else:
            return None
257677
def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None):
    """"""
    prefixer = get_url_prefix()

    if prefixer:
        prefix = prefix or '/'
    url = django_reverse(viewname, urlconf, args, kwargs, prefix)
    if prefixer:
        url = prefixer.fix(url)

    # Ensure any unicode characters in the URL are escaped.
    return iri_to_uri(url)
673920
function _batchDetails(context, result, maxResults, cb) {
  if (result.results.length === 0) return cb(null, {details: [], errors: []});
  var details = [];
  var errors = [];
  var j = (maxResults > result.results.length) ? result.results.length : maxResults;
  for (var i = 0; i < j; i++) {
    try {
      var placeid = result.results[i].place_id;
      context.details({placeid: placeid}, function(err, result){
        if (err) {
          errors.push({message: "Error requesting details for placeid " + placeid, error: err});
        } else {
          details.push(result);
        }
        if (details.length + errors.length == j) return cb(null, {details: details, errors: errors});
      });
    } catch (exp) {
      errors.push({message: "No place_id found", error: exp});
      if (details.length + errors.length == j) return cb(null, {details: details, errors: errors});
    }
  }
}
122755
def blog_post_detail(request, slug, year=None, month=None, day=None,
                     template="blog/blog_post_detail.html",
                     extra_context=None):
    
    blog_posts = BlogPost.objects.published(
                                     for_user=request.user).select_related()
    blog_post = get_object_or_404(blog_posts, slug=slug)
    related_posts = blog_post.related_posts.published(for_user=request.user)
    context = {"blog_post": blog_post, "editable_obj": blog_post,
               "related_posts": related_posts}
    context.update(extra_context or {})
    templates = [u"blog/blog_post_detail_%s.html" % str(slug), template]
    return TemplateResponse(request, templates, context)
743108
def details_handler(args):
    

    repo = _open_repo(args)
    _, anchor = _get_anchor(repo, args['<anchor-id>'])

    print("""path: {file_path}
encoding: {encoding}

[before]
{before}
--------------

[topic]
{topic}
--------------

[after]
{after}
--------------

offset: {offset}
width: {width}""".format(
        file_path=anchor.file_path,
        encoding=anchor.encoding,
        before=anchor.context.before,
        topic=anchor.context.topic,
        after=anchor.context.after,
        offset=anchor.context.offset,
        width=anchor.context.width))

    return ExitCode.OK
998108
def get(self, request, bot_id, handler_id, id, format=None):
        
        return super(UrlParameterDetail, self).get(request, bot_id, handler_id, id, format)
805037
def _parse_pages_binding(details):
    
    pages = _get_td_or_none(
        details,
        "ctl00_ContentPlaceHolder1_tblRowRozsahVazba"
    )

    if not pages:
        return None, None

    binding = None  # binding info and number of pages is stored in same string
    if "/" in pages:
        binding = pages.split("/")[1].strip()
        pages = pages.split("/")[0].strip()

    if not pages:
        pages = None

    return pages, binding
590916
def render_description_meta_tag(context, is_og=False):
    
    request = context['request']
    content = ''

    # Try to get the description from the context object (e.g. DetailViews).
    if context.get('object'):
        try:
            content = context['object'].get_meta_description()
        except AttributeError:
            pass
    elif context.get('meta_tagger'):
        content = context['meta_tagger'].get('description')

    if not content:
        try:
            # Try for the meta description of the cms page.
            content = request.current_page.get_meta_description()
        except (AttributeError, NoReverseMatch):
            pass

    if content:
        return mark_safe('<meta {attr_name}="{tag_name}" content="{content}">'.format(
            attr_name='name' if not is_og else 'property',
            tag_name='description' if not is_og else 'og:description',
            content=content
        ))
    else:
        return ''
1235234
def urls(self):
        
        from django.conf.urls import url
        urls = [
            url(r'^$', self.documentation),
            url(r'^map$', self.map_view),
        ]

        for resource_name in self.resource_map:
            urls.extend([
                url(r'(?P<resource_name>{})$'.format(
                    resource_name), self.handler_view),
                url(r'(?P<resource_name>{})/(?P<ids>[\w\-\,]+)$'.format(
                    resource_name), self.handler_view),
            ])

        return urls
1274956
def get_url(self, obj, view_name, request, format):
        
        # Unsaved objects will not yet have a valid URL.
        if hasattr(obj, 'pk') and obj.pk is None:
            return None

        lookup_value = getattr(obj, self.lookup_field)
        kwargs = {self.lookup_url_kwarg: lookup_value}
        return self.reverse(view_name, kwargs=kwargs, request=request, format=format)
510173
def get_stories(self, *args, **kwargs):
        
        from .story import Story, StoryDataWrapper
        return self.get_related_resource(Story, StoryDataWrapper, args, kwargs)
188168
def get_store(url_details):
    
    store = {}
    for detail in url_details:
        base_url = detail['url'].strip()

        # If a url detail has instances, it means that
        # we want to also create an endpoint that can list
        # all of the instances
        has_instances = False

        try:
            if len(detail['response']) > 1:
                if '__key' in detail['full_url']:
                    for resp in detail['response']:
                        parsed_resp = ast.literal_eval(resp)
                        tmp_copy_resp = deepcopy(parsed_resp)
                        cleaned_resp = {}
                        # Remove meta keys or hidden attributes from cleaned resp
                        for k, v in tmp_copy_resp.items():
                            if '__' not in k and '--' not in k:
                                cleaned_resp[k] = v
                        if parsed_resp['__key_position'] == 'url':
                            unique_key = parsed_resp['__key_name']
                            constructed_url = re.sub(r'\_\_key', str(parsed_resp[unique_key]), base_url)
                            store[constructed_url] = {
                                'data': cleaned_resp,
                                'pk': True,
                                'pkName': parsed_resp['__key_name'],
                                'position': 'url',
                                'options': parsed_resp.get('__options', '{}')
                            }
                            has_instances = True
                        elif parsed_resp['__key_position'] == 'query':
                            unique_key = parsed_resp['__key_name']
                            if not base_url.endswith('/'):
                                url_with_slash = base_url + '/'
                            constructed_url = url_with_slash + '__pk/' + str(parsed_resp[unique_key])
                            constructed_url = re.sub(r'\_\_key', '', constructed_url)  # if '__key' hasn't already been replaced, remove it
                            store[constructed_url] = {
                                'data': cleaned_resp,
                                'pk': True,
                                'pkName': unique_key,
                                'position': 'query',
                                'options': parsed_resp.get('__options', '{}')
                            }
                            has_instances = True

                    if has_instances:
                        # This endpoint has multiple instances
                        # we will need to create a new endpoint to list all
                        # these instances
                        list_url = re.sub(r'\/?\_\_key', '', base_url)
                        instances = []
                        for k, v in store.items():
                            if list_url in k:
                                instances.append(v['data'])
                        store[list_url] = {'data': instances}
                else:
                    # This is for an array of responses that don't
                    # have primary keys. I.e. the endpoint only serves
                    # a list
                    clean_resp = []
                    for resp in detail['response']:
                        parsed_resp = ast.literal_eval(resp)
                        tmp_copy_resp = deepcopy(parsed_resp)
                        cleaned_resp = {}
                        # Remove meta keys or hidden attributes from cleaned resp
                        for k, v in tmp_copy_resp.items():
                            if '__' not in k and '--' not in k:
                                cleaned_resp[k] = v
                        clean_resp.append(cleaned_resp)
                    store[base_url] = {
                        'data': clean_resp,
                        'pk': False
                    }

            else:
                # If the length of the response is not more than 1
                # Check if unique key is a dynamic key
                if isinstance(detail['response'], list) and len(detail['response']) == 1:
                    response = ast.literal_eval(detail['response'][0])
                    if response['__key_name'] is not None and response['__key_name'].startswith('*'):
                        for k, v in response.items():
                            if k.startswith('__') or k.startswith('--'):
                                continue
                            unique_key = k
                            if response['__key_position'] == 'query':
                                if not base_url.endswith('/'):
                                    url_with_slash = base_url + '/'
                                constructed_url = url_with_slash + '__pk/' + str(unique_key)
                                constructed_url = re.sub(r'\_\_key', '', constructed_url)
                            else:
                                constructed_url = re.sub(r'\_\_key', str(unique_key), base_url)
                            store[constructed_url] = {
                                'data': v,
                                'pk': True,
                                'parentName': unique_key,
                                'pkName': response['__key_name'][1:],
                                'position': response['__key_position'],
                                'options': parsed_resp.get('__options', '{}')
                            }
                        has_instances = True
                base_url = re.sub(r'\/?\_\_key', '', base_url)  # if '__key' hasn't already been replaced, remove it
                parsed_resp = ast.literal_eval(detail['response'][0])
                tmp_copy_resp = deepcopy(parsed_resp)
                cleaned_resp = {}
                # Remove meta keys or hidden attributes from cleaned resp
                for k, v in tmp_copy_resp.items():
                    if '__' not in k and '--' not in k:
                        cleaned_resp[k] = v

                store[base_url] = {
                    'data': cleaned_resp,
                    'pk': False,
                    'options': parsed_resp.get('__options', '{}')
                }
        except KeyError:
            # PUT, PATCH, DELETE
            pass
    return store
443591
def get_object(self, view_name, view_args, view_kwargs):
        

        # default lookup from rest_framework.relations.HyperlinkedRelatedField
        lookup_value = view_kwargs[self.lookup_url_kwarg]
        kwargs = {self.lookup_url_kwarg: lookup_value}

        # multi-level lookup
        for parent_lookup_kwarg in list(self.parent_lookup_kwargs.keys()):
            lookup_value = view_kwargs[parent_lookup_kwarg]
            kwargs.update({self.parent_lookup_kwargs[parent_lookup_kwarg]: lookup_value})

        return self.get_queryset().get(**kwargs)