You will want to use arcpy.da.walk and list datasets with a "Feature" dataset type filter and then get a list of polylines using list feature classes with a "Polyline" filter. Then for each polyline you can run Copy Features to copy into your new geodatabase. The os module would come in handy.
Something like this would work, but you can adapt it to what you need:
import arcpy, os
from arcpy import env
env.workspace = "Your geodatabase path"
outputGDB = "The new geodatabase path"
for gdb, datasets, features in arcpy.da.Walk(env.workspace):
for dataset in datasets:
for feature in arcpy.ListFeatureClasses("Polyline_*","POLYLINE",dataset):
arcpy.CopyFeatures_management(feature,os.path.join(outputGDB,"Polyline_"+dataset))