Code Duplication    Length = 18-31 lines in 2 locations

pylast/__init__.py 2 locations

@@ 496-526 (lines=31) @@
493
        """
494
495
        params = {}
496
497
        if longitude:
498
            params["long"] = longitude
499
        if latitude:
500
            params["lat"] = latitude
501
        if location:
502
            params["location"] = location
503
        if limit:
504
            params["limit"] = limit
505
        if distance:
506
            params["distance"] = distance
507
        if tag:
508
            params["tag"] = tag
509
        if festivalsonly:
510
            params["festivalsonly"] = 1
511
        elif not festivalsonly:
512
            params["festivalsonly"] = 0
513
514
        doc = _Request(self, "geo.getEvents", params).execute(cacheable)
515
516
        return _extract_events_from_doc(doc, self)
517
518
    def get_metro_weekly_chart_dates(self, cacheable=True):
519
        """
520
        Returns a list of From and To tuples for the available metro charts.
521
        """
522
523
        doc = _Request(self, "geo.getMetroWeeklyChartlist").execute(cacheable)
524
525
        seq = []
526
        for node in doc.getElementsByTagName("chart"):
527
            seq.append((node.getAttribute("from"), node.getAttribute("to")))
528
529
        return seq
@@ 359-376 (lines=18) @@
356
            1.0. Do not distribute code or client implementations which use
357
            this test identifier. Do not use the identifiers used by other
358
            clients.
359
            =========
360
361
            To obtain a new client identifier please contact:
362
                * Last.fm: [email protected]
363
                * # TODO: list others
364
365
            ...and provide us with the name of your client and its homepage
366
            address.
367
        """
368
369
        _deprecation_warning(
370
            "Use _Network.scrobble(...), _Network.scrobble_many(...),"
371
            " and Network.update_now_playing(...) instead")
372
373
        return Scrobbler(self, client_id, client_version)
374
375
    def _get_language_domain(self, domain_language):
376
        """
377
            Returns the mapped domain name of the network to a DOMAIN_* value
378
        """
379