Task: Transform-by-output-target-schema (source dataset: github-pipelines)

Your task is to create a data transformation pipeline in Python using pandas libraries.

Given Source Tables below, and a Target Schema provided by users that demonstrates how the desired output table should look like schematically, please write Python pandas code that can transform the Source Tables into an output table, that matches the schema/structure given by the Target Schema.  Please note that the data values in the Target Schema are intended to represent the format and layout of the output table, but may not exactly match the actual data generated from the Source Tables when the python code is run on the Source Tables.

Use operations such as merge, groupby, pivot, apply, or any appropriate python or pandas steps. Your code should save the resulting DataFrame to a CSV file named 'output.csv'. Ensure that the code is executable and can be run directly as is, in a Python environment with pandas installed.

Source Tables:


Table #1
Filename: source_0.csv
Sample Rows in Markdown:
| 0                     | 1      | 2                                                                   |   3 |     4 | 5   | 6                                                                                                                                                                                 |   7 | 8   |
|:----------------------|:-------|:--------------------------------------------------------------------|----:|------:|:----|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----:|:----|
| [24/Dec/2017:02:10:00 | +0100] | GET /images/USA-logosmall.gif HTTP/1.0                              | 200 | 24917 | -   | geoff geoff 189.144.84.110 0 Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1                               | 370 | -   |
| [16/Sep/2017:23:40:00 | +0200] | GET /shuttle/missions/sts-71/sts-71-day-03-highlights.html HTTP/1.0 | 200 | 23839 | -   | julien julien 128.61.230.135 0 Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1                             | 351 | -   |
| [04/Oct/2017:03:25:00 | +0200] | GET /shuttle/missions/sts-72/news/ HTTP/1.0                         | 200 | 14352 | -   | jerome jerome 128.53.38.244 0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)                          | 484 | -   |
| [31/Mar/2017:05:10:00 | +0200] | GET /history/apollo/apollo-13/images/70HC314.GIF HTTP/1.0           | 200 | 21691 | -   | phil phil 128.183.43.156 0 Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1                                 | 739 | -   |
| [05/Apr/2017:23:35:00 | +0200] | GET /history/apollo/apollo-13/movies/apo13damage.mpg HTTP/1.0       | 200 | 28782 | -   | ted ted 128.30.116.17 0 Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5               | 597 | -   |
| [11/Sep/2017:00:30:00 | +0200] | GET /shuttle/missions/sts-71/images/KSC-95EC-0915.gif HTTP/1.0      | 200 | 14878 | -   | ced ced 128.120.187.240 0 Windows-RSS-Platform/2.0 (IE 11.0; Windows NT 6.1)                                                                                                      | 436 | -   |
| [18/Sep/2017:00:05:00 | +0200] | GET /shuttle/missions/sts-71/sts-71-day-03-highlights.html HTTP/1.0 | 200 |  9152 | -   | bob bob 128.52.223.40 0 Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5               | 644 | -   |
| [01/Jan/2017:03:35:00 | +0100] | GET /cgi-bin/imagemap/countdown?370,274 HTTP/1.0                    | 200 |  5753 | -   | ted ted 128.127.172.197 0 Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5             | 342 | -   |
| [26/Oct/2017:02:15:00 | +0200] | GET /history/skylab/skylab-2.html HTTP/1.0                          | 200 | 10125 | -   | leo leo 128.72.232.234 0 Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36 | 796 | -   |
| [15/Nov/2017:16:40:00 | +0100] | GET /shuttle/resources/orbiters/atlantis.html HTTP/1.0              | 200 | 23392 | -   | ted ted 128.64.75.90 0 Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1                                     | 731 | -   |


Target Schema:
| 0                     | 1      | 2                                                                   |   3 |     4 | 5   | 6                                                                                                                                                                      |   7 | 8   | date        |   hour |   minute |   seconds |   zone | protocol   |
|:----------------------|:-------|:--------------------------------------------------------------------|----:|------:|:----|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----:|:----|:------------|-------:|---------:|----------:|-------:|:-----------|
| [23/Sep/2017:19:30:00 | +0200] | GET /shuttle/missions/sts-71/images/KSC-95EC-0917.gif HTTP/1.0      | 200 |  6576 | -   | loic loic 128.20.236.18 0 Windows-RSS-Platform/2.0 (IE 11.0; Windows NT 6.1)                                                                                           | 514 | -   | 23/Sep/2017 |     19 |       30 |         0 |    200 | GET        |
| [29/Mar/2017:06:05:00 | +0200] | GET /facilities/tour.html HTTP/1.0                                  | 200 |  3173 | -   | frank frank 128.16.44.50 0 Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5 | 775 | -   | 29/Mar/2017 |      6 |        5 |         0 |    200 | GET        |
| [13/Jun/2017:02:40:00 | +0200] | GET /software/winvn/userguide/wvnguide.gif HTTP/1.0                 | 200 |  7504 | -   | julien julien 128.181.77.134 0 Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1                  | 385 | -   | 13/Jun/2017 |      2 |       40 |         0 |    200 | GET        |
| [09/Feb/2017:14:55:00 | +0100] | GET /htbin/wais.pl HTTP/1.0                                         | 200 |  9288 | -   | hacker hacker 189.58.32.14 0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)                | 892 | -   | 09/Feb/2017 |     14 |       55 |         0 |    100 | GET        |
| [09/Apr/2017:00:10:00 | +0200] | GET /shuttle/missions/sts-74/mission-sts-74.html HTTP/1.0           | 200 | 18264 | -   | ted ted 189.171.142.2 0 Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1                         | 867 | -   | 09/Apr/2017 |      0 |       10 |         0 |    200 | GET        |
| [16/May/2017:12:35:00 | +0200] | GET /shuttle/technology/images/srb_mod_compare_3-small.gif HTTP/1.0 | 200 |  3359 | -   | ced ced 128.173.167.178 0 Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5  | 854 | -   | 16/May/2017 |     12 |       35 |         0 |    200 | GET        |
| [09/Mar/2017:23:30:00 | +0100] | GET /cgi-bin/imagemap/countdown?103,180 HTTP/1.0                    | 200 | 22866 | -   | leo leo 128.52.117.4 0 Windows-RSS-Platform/2.0 (IE 11.0; Windows NT 6.1)                                                                                              | 645 | -   | 09/Mar/2017 |     23 |       30 |         0 |    100 | GET        |
| [22/Nov/2017:09:50:00 | +0100] | GET /shuttle/countdown/liftoff.html HTTP/1.0                        | 200 | 25542 | -   | frank frank 128.89.98.141 0 Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko                                                                   | 862 | -   | 22/Nov/2017 |      9 |       50 |         0 |    100 | GET        |
| [08/Feb/2017:00:20:00 | +0100] | GET /htbin/wais.pl?51-L HTTP/1.0                                    | 200 |  1790 | -   | bob bob 128.29.8.252 0 Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko                                                                        | 429 | -   | 08/Feb/2017 |      0 |       20 |         0 |    100 | GET        |
| [26/Nov/2017:22:55:00 | +0100] | GET /shuttle/countdown/lps/back.gif HTTP/1.0                        | 200 | 19833 | -   | hacker hacker 128.124.33.50 0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)               | 368 | -   | 26/Nov/2017 |     22 |       55 |         0 |    100 | GET        |

Return only the final code in markdown codeblock format, without any additional text or explanation. 



target: target.csv
train: source_0.csv
test: test_0.csv