def parseGopkgImportPath(self, path):
parts = path.split('<STR_LIT:/>')<EOL>if re.match('<STR_LIT>', parts[<NUM_LIT:1>]):<EOL><INDENT>if len(parts) < <NUM_LIT:3>:<EOL><INDENT>raise ValueError("<STR_LIT>" % path)<EOL><DEDENT>project = "<STR_LIT>"<EOL>repository = parts[<NUM_LIT:2>]<EOL>version = parts[<NUM_LIT:1>]<EOL>prefix = "<STR_LIT:/>".join(parts[:<NUM_LIT:3>])<EOL>provider_prefix = "<STR_LIT>" % (parts[<NUM_LIT:1>], parts[<NUM_LIT:2>])<EOL><DEDENT>else:<EOL><INDENT>if len(parts) < <NUM_LIT:2>:<EOL><INDENT>raise ValueError("<STR_LIT>" % path)<EOL><DEDENT>dotparts = parts[<NUM_LIT:1>].split("<STR_LIT:.>")<EOL>if len(dotparts) == <NUM_LIT:1>:<EOL><INDENT>if len(parts) != <NUM_LIT:3>:<EOL><INDENT>raise ValueError("<STR_LIT>" % path)<EOL><DEDENT>prefix = "<STR_LIT:/>".join(parts[:<NUM_LIT:3>])<EOL>project = parts[<NUM_LIT:1>]<EOL>dotparts = parts[<NUM_LIT:2>].split("<STR_LIT:.>")<EOL>repository = dotparts[<NUM_LIT:0>]<EOL>if len(dotparts) == <NUM_LIT:0>:<EOL><INDENT>version = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>version = dotparts[<NUM_LIT:1>]<EOL><DEDENT>provider_prefix = "<STR_LIT>" % (parts[<NUM_LIT:1>], parts[<NUM_LIT:2>])<EOL><DEDENT>else:<EOL><INDENT>if len(dotparts) != <NUM_LIT:2>:<EOL><INDENT>raise ValueError("<STR_LIT>" % path)<EOL><DEDENT>prefix = "<STR_LIT:/>".join(parts[:<NUM_LIT:2>])<EOL>project = "<STR_LIT>"<EOL>repository = dotparts[<NUM_LIT:0>]<EOL>version = dotparts[<NUM_LIT:1>]<EOL>provider_prefix = "<STR_LIT>" % parts[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>repo = {}<EOL>repo["<STR_LIT>"] = prefix<EOL>repo["<STR_LIT>"] = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT:username>": project, "<STR_LIT>": repository, "<STR_LIT:version>": version}<EOL>return repo<EOL>
Definition: gopkg.in/<v>/<repo> || gopkg.in/<repo>.<v> || gopkg.in/<project>/<repo>