#%% #library srt link: https://github.com/cdown/srt #pip install -U srt #copy paste srt file as following(focus on the format at head and tail) #it returns a sequence of subtitle classes object, contains index,time,contant usw. #using for loop searching desired word in every object.content. #it returns the time interval at the start and the end #use srt.timedelta_to_srt_timestamp convert the time to normal one import pandas as pd import srt import datetime data = list(srt.parse("""\ 1 00:00:12,753 --> 00:00:16,491 The drive through the world's most secure prison is beautiful. 2 00:00:16,515 --> 00:00:20,468 The federal government's only supermax prison, known as ADX, 3 00:00:20,492 --> 00:00:22,625 is 90 miles south of Denver. 4 00:00:22,649 --> 00:00:24,498 Standing outside the building, 5 00:00:24,522 --> 00:00:27,625 ADX looks like a newish suburban middle school. 6 00:00:27,649 --> 00:00:29,268 (Laughter) 7 00:00:29,292 --> 00:00:31,903 The lobby is clean and bright; 8 00:00:31,927 --> 00:00:35,125 there's big windows and clear views of the mountains; 9 00:00:35,149 --> 00:00:39,323 and a polite front-desk attendant with a kiosk selling travel mugs. 10 00:00:39,347 --> 00:00:41,268 (Laughter) 11 00:00:41,292 --> 00:00:43,910 On the wall is a large plaque that reads, 12 00:00:43,934 --> 00:00:47,014 "The best prize that life offers is the chance to work hard 13 00:00:47,038 --> 00:00:48,438 at work worth doing." 14 00:00:49,427 --> 00:00:52,693 Just past it is a huge framed photo of Alcatraz. 15 00:00:53,911 --> 00:00:57,037 And down the stairs, at the end of a long hallway, 16 00:00:57,061 --> 00:01:00,355 are 400 men decaying in isolation cells. 17 00:01:01,792 --> 00:01:05,686 I work on cases involving the constitutional rights of prisoners. 18 00:01:05,710 --> 00:01:09,066 Now, people have differing views about prisoners' rights. 19 00:01:09,511 --> 00:01:11,940 But there's something more people can agree on: 20 00:01:11,964 --> 00:01:13,114 torture. 21 00:01:14,130 --> 00:01:16,337 The US government says it doesn't use torture, 22 00:01:16,361 --> 00:01:19,101 and we condemn other countries, like Iran and North Korea, 23 00:01:19,125 --> 00:01:20,792 for their use of torture. 24 00:01:21,496 --> 00:01:25,410 But some people think the so-called worst of the worst deserve it: 25 00:01:25,434 --> 00:01:29,355 terrorists, mass murderers, the really "bad" people. 26 00:01:30,071 --> 00:01:32,969 Now I personally believe that no one deserves to be tortured 27 00:01:32,993 --> 00:01:34,317 by the US government. 28 00:01:34,341 --> 00:01:35,599 But that's me. 29 00:01:35,623 --> 00:01:42,623 (Applause) 30 00:01:42,647 --> 00:01:43,853 No matter where you fall, 31 00:01:43,877 --> 00:01:46,059 there's a few things I need you to understand 32 00:01:46,083 --> 00:01:47,283 before I continue. 33 00:01:47,869 --> 00:01:50,537 First, we do torture people here in America, 34 00:01:50,561 --> 00:01:52,903 tens of thousands of them every day. 35 00:01:52,927 --> 00:01:55,127 It's called solitary confinement. 36 00:01:55,513 --> 00:01:57,823 It's done in our names, using our tax dollars, 37 00:01:57,847 --> 00:01:59,386 behind closed doors. 38 00:01:59,902 --> 00:02:01,260 And as a result, 39 00:02:01,284 --> 00:02:04,427 we're undermining the core values of our justice system. 40 00:02:05,477 --> 00:02:07,367 Built with state-of-the-art technology, 41 00:02:07,391 --> 00:02:10,297 ADX has nearly perfected solitary confinement. 42 00:02:10,970 --> 00:02:13,038 Each man spends 23 hours a day 43 00:02:13,062 --> 00:02:15,924 alone in a cell the size of a small bathroom. 44 00:02:16,537 --> 00:02:20,109 Virtually every aspect of his life occurs in that cell. 45 00:02:20,133 --> 00:02:22,403 But aside from sleeping and eating, 46 00:02:22,427 --> 00:02:25,141 which he does within an arm's reach of his toilet, 47 00:02:25,165 --> 00:02:27,061 there aren't many aspects of life. 48 00:02:27,680 --> 00:02:31,714 Correctional officers push food trays through slots in the doors 49 00:02:31,738 --> 00:02:34,175 and take the men to solitary exercise cages 50 00:02:34,199 --> 00:02:36,794 that are referred to by prisoners and staff alike, 51 00:02:36,818 --> 00:02:39,128 without irony, as dog runs. 52 00:02:39,992 --> 00:02:41,387 Other than that, 53 00:02:41,411 --> 00:02:43,418 these men are locked in cement closets, 54 00:02:43,442 --> 00:02:45,243 all day, every day. 55 00:02:45,577 --> 00:02:47,903 Two steps forward, two steps back. 56 00:02:47,927 --> 00:02:49,077 That's it. 57 00:02:49,673 --> 00:02:52,665 They can't see the nearby mountains or any trees -- 58 00:02:52,689 --> 00:02:55,395 "nothing living, not so much as a blade of grass," 59 00:02:55,419 --> 00:02:57,752 is how one man in ADX described it. 60 00:02:58,435 --> 00:03:01,542 Some people report that after years of not looking at anything 61 00:03:01,566 --> 00:03:03,288 further than 10 feet away, 62 00:03:03,312 --> 00:03:05,287 their eyesight has deteriorated so much 63 00:03:05,311 --> 00:03:08,160 that they can't focus on faraway objects anymore. 64 00:03:08,748 --> 00:03:10,895 The isolation is so deep and profound 65 00:03:10,919 --> 00:03:14,799 that one of our clients would lie on the floor of his cell for hours, 66 00:03:14,823 --> 00:03:17,078 just hoping to catch a glimpse of someone's feet 67 00:03:17,102 --> 00:03:19,402 as they walked past the door of his cell. 68 00:03:19,924 --> 00:03:22,948 Another befriended a wasp that flew into his cell, 69 00:03:22,972 --> 00:03:25,630 feeding it and talking to it like a friend. 70 00:03:26,551 --> 00:03:28,662 Some try to communicate with fellow prisoners 71 00:03:28,686 --> 00:03:31,021 by yelling through the shower drains. 72 00:03:31,045 --> 00:03:33,410 Still though, many of these men lost their voices 73 00:03:33,434 --> 00:03:35,797 after talking with us for just an hour. 74 00:03:36,593 --> 00:03:39,648 Their vocal cords were out of practice speaking for that long. 75 00:03:41,188 --> 00:03:45,156 We know the impact of long-term isolation is devastating. 76 00:03:45,180 --> 00:03:47,114 This borders on common sense. 77 00:03:47,895 --> 00:03:50,492 It's why harsh prison systems and torture regimes 78 00:03:50,516 --> 00:03:53,672 routinely use solitary as a form of severe punishment. 79 00:03:54,188 --> 00:03:57,656 And why none of us would tolerate having a loved one, 80 00:03:57,680 --> 00:03:59,903 like a parent or a child, 81 00:03:59,927 --> 00:04:04,188 locked alone in a small bathroom for days, let alone years. 82 00:04:05,069 --> 00:04:06,219 Or decades. 83 00:04:07,866 --> 00:04:10,444 In the course of representing that first client at ADX, 84 00:04:10,468 --> 00:04:13,151 we learned about another man, Tommy Silverstein, 85 00:04:13,175 --> 00:04:16,049 who the Federal Bureau of Prisons put in solitary confinement 86 00:04:16,072 --> 00:04:19,687 under a "no human contact" order in 1983, 87 00:04:19,712 --> 00:04:21,831 after he killed a corrections officer. 88 00:04:22,355 --> 00:04:24,376 Tommy was 31 years old. 89 00:04:25,355 --> 00:04:26,958 Now he's 66. 90 00:04:27,363 --> 00:04:30,393 He's been in solitary confinement for 35 years. 91 00:04:32,488 --> 00:04:35,734 Struggling to find the words to capture his experience of ADX, 92 00:04:35,758 --> 00:04:38,885 Tommy, who has become an accomplished artist, 93 00:04:38,909 --> 00:04:40,480 drew it instead. 94 00:04:41,800 --> 00:04:45,356 Unless we start to change how we treat prisoners in this country, 95 00:04:45,380 --> 00:04:48,593 he'll probably be there for the rest of his life. 96 00:04:49,736 --> 00:04:51,528 Both John McCain and Nelson Mandela 97 00:04:51,552 --> 00:04:54,466 said that of all the horrors they suffered in prison, 98 00:04:54,490 --> 00:04:57,085 solitary confinement was the worst. 99 00:04:57,109 --> 00:04:59,149 That's because solitary puts people at risk 100 00:04:59,173 --> 00:05:01,791 of losing their grasp on who they are, 101 00:05:01,815 --> 00:05:04,815 of how and whether they're connected to a larger world. 102 00:05:05,523 --> 00:05:07,975 As psychologist Dr. Craig Haney explains, 103 00:05:07,999 --> 00:05:11,094 that's because human identity is socially created. 104 00:05:11,761 --> 00:05:15,095 We understand ourselves through our relationships with other people. 105 00:05:15,633 --> 00:05:19,918 Solitary confinement can make you change what you think about yourself. 106 00:05:19,942 --> 00:05:22,874 It can make you doubt whether you even have a self. 107 00:05:23,435 --> 00:05:27,094 Some people in solitary aren't even sure they exist, 108 00:05:27,118 --> 00:05:29,824 so they'll mouth off to a corrections officer 109 00:05:29,848 --> 00:05:32,299 and end up getting shackled or beaten. 110 00:05:32,323 --> 00:05:34,923 But at least then, they know they exist. 111 00:05:36,120 --> 00:05:41,104 Over time, some of the men in ADX break down in obvious ways, 112 00:05:41,128 --> 00:05:43,707 like banging their heads on the walls of their cells 113 00:05:43,731 --> 00:05:46,016 or smearing themselves with feces. 114 00:05:46,823 --> 00:05:50,090 Or attempting suicide, some of them successfully. 115 00:05:50,514 --> 00:05:51,938 Many people cut themselves 116 00:05:51,962 --> 00:05:55,554 just to feel the pain that keeps them tethered to the real world. 117 00:05:56,300 --> 00:05:57,972 Others adjust, 118 00:05:57,996 --> 00:06:00,887 showing no outward sign of mental illness. 119 00:06:00,911 --> 00:06:03,947 But there's grave harm in the adjustment itself. 120 00:06:04,606 --> 00:06:07,257 That's because the experience of long-term isolation 121 00:06:07,281 --> 00:06:10,534 can paradoxically lead to social withdrawal. 122 00:06:10,558 --> 00:06:13,122 At first, people are starved for human contact, 123 00:06:13,146 --> 00:06:14,331 but over time, 124 00:06:14,355 --> 00:06:16,926 it becomes disorienting, even frightening. 125 00:06:16,950 --> 00:06:18,764 They can't handle it anymore. 126 00:06:20,133 --> 00:06:22,864 All of this amounts to a prolonged social death. 127 00:06:23,245 --> 00:06:26,721 The men in ADX are stuck in suspended animation. 128 00:06:27,261 --> 00:06:29,047 Not really part of this world, 129 00:06:29,071 --> 00:06:32,602 they're not really part of any world that's fully and tangibly human. 130 00:06:33,395 --> 00:06:37,283 It's for all of these reasons that international human rights law 131 00:06:37,307 --> 00:06:40,007 prohibits the use of long-term solitary confinement. 132 00:06:41,046 --> 00:06:44,578 In fact, the UN has called on governments to ban the use of solitary 133 00:06:44,602 --> 00:06:46,401 for more than 15 days. 134 00:06:47,522 --> 00:06:49,164 As of today, 135 00:06:49,188 --> 00:06:53,856 Tommy Silverstein has been in solitary for 12,815 days. 136 00:06:55,887 --> 00:06:58,650 Now in judging other countries' human rights records, 137 00:06:58,674 --> 00:07:01,895 the US State Department has called the use of long-term solitary 138 00:07:01,919 --> 00:07:03,561 a human rights violation. 139 00:07:04,236 --> 00:07:05,966 In 2009, for example, 140 00:07:07,395 --> 00:07:13,502 State Department condemned Israel, Iran, Indonesia and Yemen 141 00:07:13,526 --> 00:07:15,259 for their use of solitary. 142 00:07:15,994 --> 00:07:18,794 But we allow it to happen on our own soil. 143 00:07:20,073 --> 00:07:24,193 When a prison is located in the US instead of China, 144 00:07:24,217 --> 00:07:28,601 when it's run by the federal government and not some rogue sheriff, 145 00:07:28,625 --> 00:07:31,855 when it has state-of-the-art technology and gleaming floors, 146 00:07:31,879 --> 00:07:34,954 not overcrowded cells and decrepit facilities, 147 00:07:34,978 --> 00:07:37,828 it's harder to believe that torture happens there. 148 00:07:38,319 --> 00:07:43,065 But it's important to entertain the idea that, sometimes, this too 149 00:07:43,089 --> 00:07:44,889 is what torture looks like. 150 00:07:45,931 --> 00:07:47,202 As a civil rights lawyer, 151 00:07:47,226 --> 00:07:50,321 I believe it's important to ensure that people, 152 00:07:50,345 --> 00:07:52,892 even those convicted of terrible crimes, 153 00:07:52,916 --> 00:07:55,315 aren't tortured by our government. 154 00:07:55,339 --> 00:07:56,958 And if this talk were a movie, 155 00:07:56,982 --> 00:08:01,212 I'd tell you next about how we fought and fought and eventually won. 156 00:08:02,633 --> 00:08:04,212 But this isn't a movie. 157 00:08:04,236 --> 00:08:07,712 So I'll tell you, instead, about how deeply this injustice is hidden. 158 00:08:08,117 --> 00:08:10,387 How difficult it is to expose it, 159 00:08:10,411 --> 00:08:12,677 and why it's important that we do. 160 00:08:14,165 --> 00:08:17,960 You'd think that lawyers, people who work in the justice system, 161 00:08:17,984 --> 00:08:20,387 would know what happens in our prisons. 162 00:08:20,736 --> 00:08:24,093 But I'm a lawyer, and I live less than two hours away from ADX. 163 00:08:24,638 --> 00:08:26,766 And until we went to see that first client, 164 00:08:26,790 --> 00:08:28,923 I didn't know anything about it. 165 00:08:29,265 --> 00:08:31,208 I don't think that's an accident. 166 00:08:32,225 --> 00:08:35,020 ADX walls itself off from public scrutiny. 167 00:08:35,823 --> 00:08:38,283 In the 25 years since it opened, 168 00:08:38,308 --> 00:08:41,626 it's allowed only a single visit by human rights organizations. 169 00:08:42,269 --> 00:08:44,864 Journalists are routinely denied entry. 170 00:08:44,888 --> 00:08:46,419 Mail is censored. 171 00:08:47,214 --> 00:08:49,594 And even when rare family visits occur, 172 00:08:49,618 --> 00:08:52,055 they're monitored by an unseen government official 173 00:08:52,079 --> 00:08:54,213 who can cut the visit off without notice 174 00:08:54,237 --> 00:08:57,055 if he thinks that the prisoner is talking in too much detail 175 00:08:57,079 --> 00:08:58,945 about the conditions in ADX. 176 00:09:00,037 --> 00:09:03,791 In China, in Russia, they keep out the human rights observers, 177 00:09:03,815 --> 00:09:06,215 keep out the media, keep out the UN. 178 00:09:06,712 --> 00:09:07,862 And so do we. 179 00:09:08,776 --> 00:09:11,537 ADX is, in the words of one journalist, 180 00:09:11,561 --> 00:09:13,561 "a black site on American soil." 181 00:09:14,546 --> 00:09:19,260 We know that secrecy is a hallmark of places that torture. 182 00:09:19,998 --> 00:09:23,371 But after years of shining a light, 183 00:09:23,395 --> 00:09:26,596 we now know more about the conditions in Guantanamo 184 00:09:26,620 --> 00:09:28,334 than we do at ADX. 185 00:09:29,343 --> 00:09:30,494 Five years ago, 186 00:09:30,518 --> 00:09:33,509 when there was a hunger strike and force-feeding at Guantanamo, 187 00:09:33,533 --> 00:09:35,822 the same thing was happening at ADX. 188 00:09:35,846 --> 00:09:37,656 But you probably didn't hear about it 189 00:09:37,680 --> 00:09:40,306 because the government gagged family members and lawyers 190 00:09:40,330 --> 00:09:41,782 from talking about it. 191 00:09:42,561 --> 00:09:44,188 But here's the thing: 192 00:09:44,212 --> 00:09:47,918 the American criminal justice system is supposed to be transparent. 193 00:09:48,680 --> 00:09:50,553 And before someone gets sent to prison, 194 00:09:50,577 --> 00:09:52,466 that's largely true. 195 00:09:53,347 --> 00:09:56,164 Legislators meet in public to debate and define the laws 196 00:09:56,188 --> 00:09:58,255 that prohibit criminal conduct. 197 00:09:58,883 --> 00:10:02,508 Citizens in our community serve as jurors on criminal trials. 198 00:10:02,845 --> 00:10:04,631 And if you want to watch a trial, 199 00:10:04,655 --> 00:10:06,921 the courtroom doors are wide open. 200 00:10:07,774 --> 00:10:10,962 After the trial, though, our commitment to transparency ends. 201 00:10:11,875 --> 00:10:13,954 With the prison door securely shut, 202 00:10:13,978 --> 00:10:15,804 what happens behind prison walls 203 00:10:15,828 --> 00:10:17,561 stays behind prison walls. 204 00:10:17,970 --> 00:10:20,339 And without the scrutiny of the public gaze, 205 00:10:20,363 --> 00:10:21,763 the darkness festers. 206 00:10:23,601 --> 00:10:24,866 Other than execution, 207 00:10:24,890 --> 00:10:28,242 incarceration is the most intrusive power of the state: 208 00:10:28,266 --> 00:10:30,733 the deprivation of citizens' liberty. 209 00:10:31,385 --> 00:10:33,028 But no government institution 210 00:10:33,052 --> 00:10:36,401 is more opaque and less accountable than prison. 211 00:10:36,425 --> 00:10:38,811 Even though prisons are supported by tax payers 212 00:10:38,835 --> 00:10:42,267 and return 95 percent of their residents to our communities. 213 00:10:43,038 --> 00:10:47,577 It's that secrecy that allows the ADX to disappear people. 214 00:10:49,038 --> 00:10:52,728 And so we have an obligation, said Justice Kennedy, 215 00:10:52,752 --> 00:10:54,588 as a democracy and as a people, 216 00:10:54,612 --> 00:10:57,875 "we should know what happens after the prisoner is taken away." 217 00:10:58,220 --> 00:11:02,391 The prison system is the concern and responsibility of every citizen. 218 00:11:02,415 --> 00:11:03,955 This is your justice system. 219 00:11:03,979 --> 00:11:05,512 These are your prisons. 220 00:11:06,360 --> 00:11:08,360 Torture happens in the dark. 221 00:11:08,384 --> 00:11:13,418 And so we need to embrace the admonition that sunlight is the best disinfectant. 222 00:11:13,442 --> 00:11:16,728 Not only because we need to know what happens inside ADX, 223 00:11:16,752 --> 00:11:19,458 but because the knowing itself can create change. 224 00:11:20,823 --> 00:11:24,140 There's an axiom in physics called the uncertainty principle. 225 00:11:25,101 --> 00:11:29,053 It teaches that the mere fact of observation 226 00:11:29,077 --> 00:11:30,910 can alter, will alter, 227 00:11:30,934 --> 00:11:33,468 the subatomic reaction being observed. 228 00:11:34,204 --> 00:11:35,514 In other words, 229 00:11:36,458 --> 00:11:38,992 watching something affects its course. 230 00:11:39,577 --> 00:11:41,783 In a democracy like the US, 231 00:11:41,807 --> 00:11:44,786 prisons are administered in our name and on our behalf. 232 00:11:45,500 --> 00:11:48,531 The conditions in ADX implicate our tax dollars, 233 00:11:48,555 --> 00:11:50,039 public safety 234 00:11:50,063 --> 00:11:51,253 and, most of all, 235 00:11:51,277 --> 00:11:54,587 our shared belief in the inherent dignity of every human being. 236 00:11:55,881 --> 00:11:58,266 We have an obligation to bear witness. 237 00:11:59,079 --> 00:12:00,238 Thank you. 238 00:12:00,262 --> 00:00:00,000 (Applause) """)) # %% word = 'They' cut_list = pd.DataFrame(columns=['start', 'end', 'contant']) for i in range(len(data)): if word in data[i].content: start = srt.timedelta_to_srt_timestamp(data[i].start) end = srt.timedelta_to_srt_timestamp(data[i].end) print(start) cut_list = cut_list.append({'start': start, 'end':end, 'contant': data[i].content}, ignore_index=True) cut_list # %%