parameters: (self, locale, tree)
return_statement: return locale[:i]
docstring: Gets the parent locale in the given tree, according to dependency data.
docstring_summary: Gets the parent locale in the given tree, according to dependency data.
docstring_tokens: Gets the parent locale in the given tree according to dependency data .
function: def _get_parent_locale(self, locale, tree):
          """Gets the parent locale in the given tree, according to dependency data."""
          dependency_data = self.dependency_data_by_tree[tree]
          if "parents" in dependency_data and locale in dependency_data["parents"]:
              return dependency_data["parents"][locale]
          if "aliases" in dependency_data and locale in dependency_data["aliases"]:
              return dependency_data["aliases"][locale]
          if LANGUAGE_ONLY_REGEX.match(locale):
              return "root"
          i = locale.rfind("_")
          if i < 0:
              assert locale == "root", "Invalid locale: %s/%s" % (tree, locale)
              return None
          return locale[:i]
function_tokens: def _get_parent_locale ( self , locale , tree ) : dependency_data = self . dependency_data_by_tree [ tree ] if "parents" in dependency_data and locale in dependency_data [ "parents" ] : return dependency_data [ "parents" ] [ locale ] if "aliases" in dependency_data and locale in dependency_data [ "aliases" ] : return dependency_data [ "aliases" ] [ locale ] if LANGUAGE_ONLY_REGEX . match ( locale ) : return "root" i = locale . rfind ( "_" ) if i < 0 : assert locale == "root" , "Invalid locale: %s/%s" % ( tree , locale ) return None return locale [ : i ]