Why Parliament led the news in 2017
It's been another year of startling political news - with Parliament at the centre of many of the biggest stories.
In what could be termed an "ordinary" political year, Parliament can be seen as a stale debating chamber, or a legislative rubber stamp, processing the wishes of a government basking in the glow of a comfortable majority.
But a torrid combination of the EU referendum and a dramatic general election result has seen the spotlight swing back to the Palace of Westminster.
It's been a busy 2017, packed with Parliamentary events. Here are a few of them.
Activating Article 50
It was a high-stakes constitutional courtroom drama that saw the Supreme Court rule the government had to consult Parliament on activating Article 50, the mechanism for leaving the EU.
The result of that was a little piece of legislation called the European Union (Notification of Withdrawal) Bill, which came before Parliament in January.
The debate on this bill redrew the parliamentary battle lines for the year to come, with the Labour front bench joining the government in backing the process for quitting the EU.
But 47 Labour backbenchers voted against it or abstained - joined by the SNP, Lib Dems and Conservative former chancellor Ken Clarke.
These unusual political shifts have resurfaced repeatedly, with some adjustments, ever since on matters related to Brexit, with Remainers and Leavers often split across party lines.
The bill passed the Commons comfortably but encountered a rough ride in the House of Lords.
In the upper chamber, the government was defeated twice - on guaranteeing EU citizens' rights and on ensuring MPs get a vote on the final Brexit deal...more of which later.
A brace of by-elections
The Labour MP for Copeland, Jamie Reed, announced in December 2016 he was quitting Parliament - followed by party colleague Tristram Hunt, MP for Stoke-on-Trent, in January.
Both MPs insisted that their differences with Jeremy Corbyn were not their primary reason for standing down, but admitted to concerns about the party's leadership as they moved on to pastures new.
It fed into the ongoing divisions in the Labour Party which were supposed to have been laid to rest by Mr Corbyn's re-election to the leadership - but it didn't prefigure a wider rash of resignations, as some predicted.
The two by-elections which followed took place in marginal seats and were fiercely contested. Copeland gained a Conservative MP in Trudy Harrison, while Labour held on in Stoke with Gareth Snell.
The Speaker on the Donald
House of Commons Speaker John Bercow made an unexpected public intervention in February when he told MPs he would be "strongly opposed" to US President Donald Trump addressing the Houses of Parliament during his state visit to the UK.
Mr Bercow told MPs that "opposition to racism and sexism" were "hugely important considerations".
His statement was praised by Labour and the SNP but others said he ought to have stayed neutral, or pointed to ethical questions surrounding other speakers who have been invited to address Parliament.
President Trump was originally invited to make a state visit after meeting Theresa May in January, but it's still not clear when it might take place.
The (not so) fixed-term Parliament
After Theresa May became Conservative leader and prime minister, speculation began to rumble that she might call an election.
The logic ran that she would be able to shore up a perceived position of strength, at the same time as dealing a death blow to her Labour opponent and to Brexit naysayers.
She repeatedly dismissed the idea, and constitutional historians pointed out that the Fixed-term Parliaments Act would make it more difficult to simply summon one up.
It was therefore a sharp shock to all concerned - not least of all Conservatives themselves - when Mrs May got behind the lectern outside No 10 in April to announce she would seek a snap election.
The move to bring forward the next scheduled election date of 2020 had to be approved by two-thirds of MPs, the first time ever the opposition has had to consent to an election.
The upshot was that it was easier than anticipated for a bullish government to call an election under the Fixed-term Parliaments Act, effectively challenging the opposition to say it wasn't battle-ready.
This prime minister called an election, and you'll never guess what happened next...
Safe to say, the election returned a result which had been predicted by very few.
The Conservatives remained the biggest party, but lost their majority and 13 seats, while Labour picked up 30 seats. It was a story of the resurgence of two-party politics, with UKIP's vote share falling and the SNP's dominance in Scotland pared back.
As the scale of the Conservatives' shortfall became clear in the early hours of 9 June, rumours swirled that Theresa May might resign.
But she emerged from Downing Street and announced her intention to carry on, entering a confidence-and-supply arrangement with the DUP.
This meant the absence of a government majority was overlaid on the cross-cutting issue of Brexit, complicating the parliamentary maths even further.
Big Ben strikes out
Somehow, Parliament even managed to dominate headlines during the summer recess.
In August, Big Ben's chimes fell silent to protect the hearing of restoration workers carrying out repairs, which are expected to last until 2021.
The decision to switch it off sparked a debate about the length of time it will be silent, with MPs saying they had not been told it would be four years, the longest period in its history.
Even Theresa May got involved, suggesting "it can't be right" that the famous bongs would not be heard for four more years.
Labour MP Stephen Pound described it as "desperately sad" and Conservative Peter Bone said it "doesn't make any sense".
But the SNP's Pete Wishart told them to "get a grip" over their "bizarre obsession" with the issue.
Abuse of MPs
MPs have always been open to abuse by constituents, but this year candidates widely reported receiving threats or offensive comments during the election campaign.
A survey carried out by BBC Radio 5 found that among 113 who replied, just over half - 51% - said the 2017 general election campaign had been the worst they had ever experienced.
In Parliament in July, MPs shared their stories of being targeted, with several Labour MPs highlighting racist and sexist abuse and Conservatives criticising the actions of Labour-supporting groups including Momentum.
In that debate, shadow home secretary Diane Abbott graphically detailed the abuse levelled at her. A later survey found she was on the receiving end of 45% of all such attacks on MPs.
Separately, some Conservative rebels have complained of being threatened because of their stance on Brexit, which both the prime minister and home secretary have condemned as "unacceptable".
The Committee of Standards in Public Life recently published a report on intimidation in public life, which made a number of recommendations including legislation to shift the liability of illegal content online towards social media companies.
When Parliament started up again with a confidence-and-supply system in place for the Conservatives, a repeat of the hung Parliament of 1974 was predicted, which was characterised by tight votes and intricate whipping efforts.
But one of the most striking and unprecedented features that emerged was that the government began to abstain in non-binding votes rather than suffer even a symbolic defeat.
This incurred the wrath of Labour, who used an elaborate strategy to force a vote in which its motion passed unanimously.
The opposition accused government of disrespecting the House, and Commons Leader Andrea Leadsom defended MPs' right to vote as they see fit.
When it came to adopting this approach on a Labour motion requiring ministers to publish sectoral analyses on the impact of Brexit, the Speaker ended up ruling the vote was binding.
This in turn led to the government being asked to publish documents which, in the words of David Davis, "don't exist".
Sexual harassment in politics
After the news emerged of allegations against film producer Harvey Weinstein, it was as if a dam broke and stories of sexual harassment in many different industries flooded out.
It happened in British politics too. Two party activists told the BBC of being assaulted by senior political figures.
Defence Secretary Sir Michael Fallon resigned over inappropriate behaviour, and First Secretary of State Damian Green was asked to resign after an investigation found he "lied" over what he knew about police claims to have found pornography on his office computer.
Several other MPs have had the whip withdrawn pending various investigations, and a group was set up to examine the grievance procedure for parliamentary staff.
The inquiry has come up with plans for a new code of conduct, a confidential helpline and counselling support provided under an independent sexual violence advocate specialist service.
The EU Withdrawal Bill
Arguably the most dramatic moment in Parliament this year came right at the end, courtesy of the EU Withdrawal Bill - formerly known as the Great Repeal Bill.
The legislation, which repeals the European Communities Act and writes EU law into UK law ahead of Brexit, was always destined for a rocky ride.
Even before it was published, MPs on both sides of the House expressed concern about the powers handed to ministers under the bill.
This was just one issue of many which the government was challenged on, but in each instance ministers were able to satisfy enough MPs' concerns to avoid defeat.
That was until 13 December, when an alliance of Conservative rebels, Labour, Lib Dem, Plaid Cymru, Green and SNP MPs united to inflict an extremely close defeat on an amendment designed to ensure Parliament gets a final say on the Brexit deal.
Ministers even offered a concession at the eleventh hour, but it was rejected, and the government lost by four votes.
And the bill is set to cause headaches for the government for some months to come, as it heads for a tough passage through the House of Lords.
On the other hand...
While Parliament has been in the news a fair bit this year, it'd be remiss not to observe that it's all being driven by a political process that took place outside Parliament.
Yes, you guessed it, the EU referendum.