 All right, it's four o'clock. It's time for lightning talks again Thank you. Thank you How was the rest of Europe Python for you today was good? All right, all right, thanks I think all the people with the green shirts everybody who's putting work into this really appreciate that you like it Okay, let's get started. We don't have two setups again We're gonna stick with a quick switch over So if you are giving a lightning talk today, please be prepared to quickly set up We're gonna start with Anton Turing about elliptics and The person after that is going to be Austin Bingham on being super Austin. Are you there? Excellent best position you could pick All right, let's go. Hello, my name is Anton I work at Yandex Sorry, okay. Yandex is Russian company. We provide services like searching and Search mail video music and so on we have a lot of user-generated content services and Today, I would like to introduce you one of our open source projects named elliptics Elliptics is a distributed for tolerant key value storage with high availability high scalability and a lot of other buzzwords We use it we use it in our production to store petabytes of data and the billions of keys and It works perfectly It was founded to solve problem when one of our data centers goes down Idea of Amazon Dynamics is in base of this storage. Of course elliptics has DHT and provides replication By using mechanism of elliptics groups Each nodder in one group takes responsibility for some range. That's you for some range of keys and this DHT ring and when you store your data By key hash is calculated from this key and according to that number data is transferred for some node If you need replication, you should write your data and three different groups for example in three different data centers Elliptics is not simply a storage. It provides distributed cache Russian words amazing and We use it in our for example content delivery network. We use this cache For example in engines. We use this cache in services which are related with some Operations with sending files for example photos If some photo became very popular we could copy this Photo to the cache and close it to the user so we could save a lot of IO and network The other feature is that elliptics provides you an ability to Start your own program on the same node when your data is stored. It's server-sized scripting. You Could write your own program on Python C++ and many other programs or languages story and You have a guarantee that you That your worker would launch on the proper node and you need not copy any data through network Elliptics is easy to use and easy to enlarge. It has a rich and powerful Python API It supports asynchronous operations. So you could implement a really good scalable Applications using it. Of course we provide C++ and go API and we have of course Http interface for our storage it has buckets and keys like S3 S3 interface story and It's not compatible, but full S3 compatible interface is being developed now It oh, sorry. It's quite obvious that it's impossible to store billions of keys on ordinary file system for example on X and X3 and so on so we Implemented our own backend for elliptics storage It named EBLOP At the first glance it looks like a simple large binary object and you just append that data to the end of this file and marked deleted keys as deleted but There is a lot of rocket science and this part of elliptics and it's extremely fast So the bottom line is if you need Distributed storage in your own project and you could not rely on S3 because of big brother or something like this I think I'm pretty sure that elliptics is a good choice for you. Thank you Thank you The next one is Austin on being super and Mika Otama is the the next one Miko. Are you there? Okay If it works that is the I can't see you Miko. There we go. Okay. There you are. Thank you great Hi, my name is Austin Bingham I work for and in part own a small software company in Norway called 60 North and I want to talk about well on being super so Who here uses super just raise your hand so nearly everybody that that sounds about right who knows how super actually works Much smaller hand Who knows about the super proxy objects and method resolution order and the C3 algorithm? Okay. All right, so basically a lot of us use super But don't really understand exactly what's going on inside of and that's position I was in a couple months ago and I had to develop some training for somebody and I wanted to know how does super work I use it for literally more than ten years knowing that super is how I access the base class implementation That was my model of it. I'd never had to really get any fancier than that But as I looked into it I learned that actually super is really fascinating and it opens a door to a wide variety of really interesting design choices And so I thought it would be a great topic for something like a five-minute lightning talk format. So here I am So the first thing you need to understand to understand super is method resolution order Which a lot of you probably know already because you you can use or you use method resolution order all the time Implicitly even without super all it is is an ordering of an inheritance graph And so here I've created ABC and D a standard diamond Well, maybe not standard Maybe not a good idea But it's a diamond inheritance graph and you can see the MRO for D in the end there is dbca an object Is of course object is always in there So it's just an order that Python has come up with for all of the classes in an inheritance graph As I said, this is useful. This is used for all method resolution. So you call D dot foo Then the method resolution order is used by Python to figure out which of these objects which of these classes I'm sorry implements foo and the first one that has foo is the one that gets used That's fundamentally what MRO is so how is MRO calculated? It can't just be randomly chosen. It must have some order That's what the C3 algorithm is or C3 linearization is the computer science term. This came out of the Dillon language I think I don't know many many years ago and now it's used in Python, Perl, Dillon Probably some other languages. It's very popular for dynamic MRO calculation It has three basic things that it guarantees when it calculates the MRO One is that derived classes will come in the MRO before their base classes So it guarantees that it guarantees that whatever base class order you give in your class definition is also preserved So the relative ordering is always preserved Based on what you tell it lexically and finally the first two constraints are conserved Anywhere in an inheritance graph so the relative ordering of classes is always the same no matter where you start These are the rules that C3 provides and that's how Python resolves functions methods. I should say C3 brings with it a little bit of baggage one of the interesting side effects is that not all inheritance graphs are legal So in this case you see I've created another inheritance graph where D inherits from BA and C in that order and because of the Guarantees that C3 wants to make or is going to make it's telling you it can't do that It can't have a before C because a have to come after C because a is a is that a bell I should be concerned about okay I don't know what's going on. It really I don't So you can get it you can get yourself into a hole you may have seen this maybe not I'd never seen it But I thought it was interesting so that's C3 Finally we come to super what is super actually doing and this is the the most pithy terse explanation I can come up with that's not a poem which may have been a good idea But given a method resolution order some MRO Calculated by C3 and a class C in that MRO somewhere super gives you an object which will resolve function resolve method calls Using everything after C in that MRO that is the definition of what super does to make sense Yeah, you read it a few times later if you want when you call super what you're actually doing is is creating a proxy object a super proxy And that's the workhorse of super that's the thing that in embeds all this logic about Looking in the MRO in the right place and using the tail and so forth So I had this nice picture of not really horses is a horse in a donkey But one of them is named Mr. Henry, which I thought was the cool name for a donkey So I put it up there. They're the workhorses of super Super proxies are like I said just regular objects you can take a reference to it You can interrogate its type you can see that it has a little dunder thing in it called this class Which is the the class type you pass as the first argument So you can examine super a little bit and get a better sense of kind of how it's put together and what it's doing So in summary, I think I'm well in time here one Python calculates an MRO for all classes You might have known that already C3 is the algorithm that does that super requires an MRO and a starting point in that MRO That's the how it knows what to trim off of the MRO and finally super proxies find the first class in the rest of the MRO that supports the function that you want to call or you try to call and that's how super works Thank you The next one after me call will be Dimitri Miller Jeff. I hope I pronounced that arbitrarily wrong There you are. I can see you. Thank you. What somebody might to share what the ring was about. Is that a nice message or? Please turn off your phones. We all will be happy with that Hello, Berlin so Who is having a fun in Europe by turn, please raise your hands What's that it? Very good My name is Miko and where I'm coming from you are going to have more fun So we are going to have a pike on Finland and I'm here to tell you why should come coach her At the first of all, we can we are having fun now. So let's compare Finland to Berlin. So First of all, we are a little bit smaller community chair so we are still Maturing so we need a lot of Guys to come to see us and tell us that the buton is good I'm especially proud of our little by ladies community. We started like a one year ago with Two members and now we have 60 members there and then of course in Finland It's not the Berlin so You can use your laptop for the purpose. It was created which is forming up your laps Also a lot of cool technology comes from Finland So if you like linux ssa or irc, you should come to pay us a visit Looking for our freedom And we are the only pike on in the world where we have a sauna party I need to tell the truth that I'm not actually one of the organizers And because I'm not the organizers I can make any promises. So if there's no sauna party You are invited to my home. I have a sauna for three people And what I hope that you would do now that you go to a fi.pycon.org and what we lack in Finland is a good speaker So we have had the problems to Have these foreign superstars come to our conference So if you have a talk in pycon, please reduce that talk and come to tell the talk again into our pycon in Finland Thank you Lynn are you around? I can see you here next Okay, my name is Mitri Smilajews. I'm a phd student at Queen Mary University of London And I'm doing computational linguistics 24 hours seven days a week So this talk will be about distributional semantics Semantics as a study is all about meaning and because I'm doing languages So it's meaning of sentences and meaning of words And like the main ideas of the whole field are can be I said in these two sentences So you should know a word by the company it keeps or a little bit more formally That semantically similar words tend to appear in similar contexts So if you think about it, then you will see words like beer or wine Accurating together with I don't know bar and parties and probably Such words as python will of course with some different words like right, so oh, sorry This iPython is a bit confusing So Now we can if we get a big text we can just Look to it and for every word we will look What are the other words our word of Co occurs together so for the boy we will know okay We we see it with a one time and we see it with might one time and so on and so forth and then we Do it on many other sentences and do our counting and we get something like this So we got our boy and we know that it was together with time about 100 times and together with year about 102 times and then we do the same with goal and we and what we notice That these numbers kind of similar ish, right? At least they're not The pattern is different than to notion and idea, right? So we we can measure A way of similarity. So how can we do the similarity thing? What we what we're going to do is that we will see these words as vectors in a multi-dimensional space and vectors These are just some directions Uh two points and between two points you can calculate the distance or you can call calculate the cosine between these two points, right? So that's what we are going to do So we'll use ticket learn Uh And ask us okay Given these vectors with calculators the the distance and what we see that indeed Boy is much closer to goal than to notion and we would expect it So can we go even further can we actually make it Visible to us so Now our vectors they're kind of in in a so huge them multi-dimensional space that we cannot even imagine how it looks like So we what what this code is doing that it's It tries to to get the same points on a two-dimensional space And tries to preserve the distances So why why it's two dimensions because then we can easily plot it So and if we plot we get something like this and so here you see That boy is close to the goal Mother is close to father And all the family words they cluster nicely in our field and then kind of business related words are here And colors are there and so on and so forth So that's what distributional semantics is about Though my main message is Is this? Sorry So it was really few lines of code But there were some intuition behind so some some science was behind and If scientists tell you they kind of know What to do but developers know how to do things and if you connect these two things together You can achieve very great results and it doesn't really apply to Linguistics it applies to any science and I really encourage you to Look for some cool scientific results if you're a programmer or learn programming if you are Scientist, thank you The next afterlin will be a Harut Dagestan. All right. Oh awesome my turn. Okay. Hold on I don't have slide notes, but I can kind of make shift. Hold on Oh, damn it. It's not set up right Totally unprepared. Okay. So first a little bit about me. I am Lynn Root. I actually live in San Francisco I am a back-end developer for Spotify I am also Leader slash founder of the Pi ladies of San Francisco And a board member on the python software foundation So earlier Miko from Picon Finland talked about them having Pi ladies for about a year now, which is pretty awesome Side note. You should all go to Picon Finland. I spoke there last time. It was awesome And you might be wondering what exactly is Pi ladies So Pi ladies is Sort of a mentorship group for women and friends and the python slash open source community We're there to support women in diversity We've been around since the fall of 2011 and Pi ladies San Francisco started in April 2012 and we're now up to like, I don't know, 1800 members And we have about 50 locations All around the world except Antarctica Which is kind of the purpose of this talk. Maybe you can get a little Pi ladies in Antarctica penguin Pi ladies So Why would you want to start a Pi ladies? I'm presenting about Pi ladies. Why would you want that? It can be it essentially is the motivation for you to learn or to better your python knowledge I started Pi ladies by wanting to learn how to code in python and got some friends with me and it kind of blossomed from there It also gives you leadership and organization and it creates sort of a networking Kind of web for you so you can kind of you know find jobs or build your resume And also we kind of want to take over the world. So That's kind of awesome How can you get Pi ladies? You can pip install it I did I created a python package Right before picon and it's up on Pi PI So you can go grab it. Um, yeah, there is literally a Pi ladies on Pi PI so many people ask me about that Yes, there's literally not figuratively literally a Python package Um, so pip install Pi ladies and then run Pi ladies handbook And what it does what it gives you Is it's a handbook and a checklist on how to start your own local chapter And I have some assets and images so you can promote Pi ladies The workshop materials so you don't have to like create your own workshop. A lot of them are beginner workshops and um, I am still developing it and We'll have more scripts and stuff for like local organizers to work with twitter and meet up and Data mining about our meetup statistics So, um, if you don't want to pip install it, you can also go to kit.pi ladies.com to see what it's about Let's just um read the docs And um, basically I wanted everyone to be able to have their own Pi ladies Thank you And the next one would be uh, Radomir Doppieralski Radomir, are you here? All right. Thank you. It's okay. I don't know But there those things have been in there. It should be I think it's coming up It's there, sir If I try Oh, it's Sorry I think it should be I can't help with russian cloned Okay, I just And there's a do you see that screen over there? There's another screen down there. Maybe you can use that for I just move Presentations there and show Okay My name is Harut. I was I wanted to present our forms like Django or WT forms but ours forms purpose to validate user input Convert that input from Form representation to python internal representation render the forms and our key feature is that They work well with nested data So we have a little bit different abstraction layers The main object is form it contains nested structure of fields Fielding represent a single atomic Single maybe atomic or maybe complex structure of data Every field has a converter has widget Has permissions and has data before converting and after converting So Here is the form to create your own form. You should subclass form Class and define List of fields here. You can see there are nested fields and To use form you instantiate it with Initial data Then call accept with Data you want to convert And either get data in form that python data or get errors Here you see a result of conversion of nested structure so Converter is object with two main methods One is two python which accept unicode string and returns Object of type of whatever type you want and the second method does Revert Reverse conversion And you can define validating functions that just validate or do simple one side conversions So And from these methods you can Throw validation error which Which is written in form That errors So You put converter in the field And validators as arguments to converters Converters can be required or not required There is implementation of Multidict The features that allows us to Add Values under the same name list of converter with with nested converter Here you see implementation of multiple selects by list of converter You can easily Tweak converters by copying them by call And here is an example of implementation of a little bit complex converter that converts not implementation users That converts SQL That converts Dictionary to SQL alchemy object So widgets A little bit simpler they just take A field and render them to the Template you can render the entire form or Single field and Where do we use it is our CMS With some keywords presented So here it is Lars Butler, are you there? Is it you? Hello everybody. My name is Radarino Piralski. I You know there is a saying that python is going either to save the world or destroy it And I think there are enough people working on the saving part. So I thought I will work a little bit on the destroying part So this is a hobby project of mine. It's a killer robot that's going to Run around and kill everybody It's Made with a raspberry pi inside And programmed in python, obviously It started as a actually as a mechano set Thing with with some Arduino attached to it, but that didn't work too well So I got a servo controller for it and it's Programmable kind. So I thought oh great. I can program it. It came with some Language based loosely on fort I don't know if you know fort It's it wasn't as easy to program as I anticipated Then I decided to Upgrade the robot and give it another knee. So it it has three degrees of freedom per leg And that Thanks to that I can make it move much smoother and I can make it tilt and and do all sorts of cool acrobatics But because of that I had to do something called inverse Kinematics which involves a little bit of math mostly trigonometrics and a little bit of linear algebra And doing that in anything but python was too painful for me So I decided to remake it again and and put a raspberry pi inside And also to put a bigger battery because all this extra servos servos were too much for for for the three AA batteries that I had in there And it's growing. It's still growing right now it has Gyro Sensor so it can sense when you tilt it or when you pick it up or find things like that It has an audio. It has a speaker connected to it So it can talk for example the voices of turret from portal Very useful like hello friend. I'm going to kill you And it's coming on nicely unfortunately I was planning on bringing it here and showing how it works But unfortunately just before the conference it it burned three servos in in the legs So I decided no I'm not going to risk that But this is how it looked like recently And that's all thank you. But it's not me. It's called kubik so you can google that and see it We are making very good progress everybody who's in the overflow slots has a very good chance to actually get the talks in here um Dimitri Semerov Are you around excellent get ready Works hi everybody So I got to practice this elevator pitch when I was at the open stack summit in lanta a few weeks ago So I've condensed that all for for you to just a couple bullet points. So here we go Uh, this is zero vm and I work for rack space by the way Um zero vm is not zero mq. It's not docker I can't tell you how many people asked me. Is that like docker after I explained it to them in a few sentences So it's not docker Dockers cool, but this is not docker It is not a drop in replacement for any other type of virtual machine. It's something completely different It's not knackle, but it's based on it and um If you want to know about knackle, I'm not going to explain that to you just go read about it It's pretty cool It's open source and uh rack space is sponsoring it, but that doesn't mean it's a rack space thing Anyone who wants to get involved in it can Just to give you a quick comparison of different types of virtualization technologies Um, something like kvm would be in the far left column Um There's no kernel. There's no operating system. The the overhead is extremely low. There's no interpretation It starts up in about five milliseconds And and it's extremely secure, but of course there are some limitations Um a couple other um key aspects Um, there's there's no place to get entropy from Uh time and random functions behave completely deterministically So if you it's just like a pure function if you give it x for input You will always always always always always get y for outputs no matter what And there's no persistent state. So you can't really write a demon with this thing. It's more of like a Don't think of them so much like a program, but think of it as like a function your programs behave like functions So you you decompose your application to small Tiny tiny little programs Um, so of course you need to do something with this so For for i o you have to map all of your inputs and outputs beforehand and we do that through an abstraction What we call channels a channel on the host on the outside zero vm can be A file it can be a pipe. It can be a socket or whatever But inside it's just treated as a file everything looks like a file And you can read and write and you can declare okay read only or read write or whatever Like I said starts up in five milliseconds no interpretation. Um, the cool thing about it is that um This is this is really useful where when you have an environment where multiple users are running arbitrary code And you don't want them to talk to each other probably So um the worst thing a user can do with with his or her code is to just crash itself That's it. They they can't break out Um If you want to read about how that works, there's the thing called suffer fault isolation That's the it's the the core concept in knackle the native client. You can read about that Um, this this means that you can embed it in data stores like open stack swift And we've done this up today. It works already. Um, we're still developing it to add some more cool features so, um The cool thing about this is that you can send code to the data do computations in place Um, and you have lots and lots of tiny little processes that live for just a few seconds and then they're discarded and never reused Uh, if you want a program on this thing you can write in c or c plus plus We've also ported c python uh 2.7. We're working on python 3 and uh, we also support lua for some reason Um Why is this interesting to python people? Well, most of our developer tools are written in python Um, testing tools and of course the the thing that enables this The glue between swift and zero vm is this zero cloud thing and that's written in python, of course Um, everything is Apache 2. It's all open source. So Use it contribute to it And if you want to want to find out more about zero vm Check out these websites come harass us on irc or um harass that twitter handle right there And uh, that's all. Thank you very much Another just gentle reminder your phones have other settings than ring Klaus Bremer, you're up next. All right. I see you. Okay So, uh, good afternoon everyone. So my name is Dimitri Generoff. I work for google and I'm here to talk about zombies and application frameworks So first of all why zombies? Let's get out get this out of the way first So some guys a few years ago wrote a scientific paper on modeling an outbreak of a zombie infection And the math involved there involves solving as like a system of differential equations And the sci-fi guys actually made a cook cookbook sample out of this And what I did with this was deploy this to google app engine So just to show that it actually works. So here's my Little website. I can just change some values Uh, first read press the simulate button And provided that my network connection is doing fine. It will show me the updated graph I'm actually using my personal hotspot on the phone. Yep. So it works Uh, but wait, this is an app engine application. How could I deploy sci-fi and matlock to app engine? This doesn't work Actually, uh, what I used here was a new feature of app engine Which is called manage VMs and here's the link to some documentation of it And what is essentially what this allows me to do is to run the app engine Runtime on the standard google compute engine VMs Which means that I still get to use most of the app engine apis that are familiar like the datastore man cache authentication And in in addition to that I get to do a lot of stuff that wasn't previously possible such as running background threads and Process that's installing like binary models, which I just did I can have direct network and disk access and I can even with some caveats direct the ssh into the machine running on the app engine instance Uh, and I also get the compute engine pricing. So unlike app engine compute engine Unlike app engine instances compute engine VMs do not really start in like milliseconds. They start in minutes So I actually have a long running VM and I have to pay to keep it running But still there is the the pricing still is relatively nice So how can this actually be accomplished? So in in my app.yaml file In addition to the standard like app engine stuff that I usually have there I add this key parameter Which is called vm equals vm colon true. This means that I want to use this new manage VM stuff When I do that I also have to set up to tell which kind of instances I want and how many of them So in this case, I'm said I'm still telling that I want manual scaling. I just want one instance And here I specify the type of the instance that I want to use so like and one standard one is just some It has one core. It has some amount of memory just the default compute engine instance And this wonderful app get install line allows me to actually install binary packages onto my machine as As it's installed and I want to install numpy scipy and the matplotlib package And now once I have done that I can actually go into the google developers console and check the state of my instance So I see so this is my instance. I can see it state I can see its ip address and I can even press the ssh button to connect into it And I think I have an ssh window already open. No, I don't so let me open this again And so this connects direct to the to the machine directly from my browser without any native without any chrome apps without any native code without any plugins It's just it's just an incomplete in browser implementation of the ssh And once and now that I have got there I can actually for example get the list of processes and Peak a little bit under the hood. So what's actually running there? Like there is like all kinds all kinds of interesting google stuff running there and for example, you can see docker there And you can see through that that my application was actually deployed as a docker image So this feature is actually now in limited preview. So if you want to use it for your own stuff You have to sign up for the uh for the limited preview. So here's the link where you can do that And if you have any more questions on this then you can find me. I'll be around you in the rest of the conference Thanks, everyone Larry Hastings All right, he would be next Yes, my name is klaus bremer and I like to talk about the alpha m fritz box today The box is a very popular internet access router here at least in germany And what you see here is a picture of an older model, but that doesn't matter Sometime ago I have tried to um Access this box by means of python But unfortunately I was not able to find any library that allowed that And so I decided to write my own one and I've named it fritz connection and Before you can talk to this box. You first have to know how this box talks to you And this is based on upnp and with style And by the letter one which is an xml based dialect the box tells you about their own api And once you know this You can start to exchange data by means of soap via http And the api itself is organized in services Every service has a lot of action And any action may Get some parameters and may return a result that depends on the action Yes to work with fritz connection. You first have to install it. Let's go by pip install fritz connection And then you have may have to wait some time because it depends on requests and lxml And lxml might have to compile so this can take a few minutes But afterwards you are able to inspect the api So this is just the two liner You say import fritz connection as fc fc to make a Long word short And then you say fc print api You get the you offer the you send the address of your Fritz box the ip address, but that's not that's optional because Fritz connection knows how to find your Box, but you may have changed the ip Or may have more than one fritz box in your network And then you give your password And as a result you get a very very long list of all available services and corresponding action names And the parameters for the actions as tuples here The first item and as tuple is the name of the parameter The second one whether it's inbound or outbound and the last one the type of the parameter Once you know this You can start to use the api This is done by the method call action and call action needs your service name the action name And optional some parameters And here's a very simple example You can say call action One ip connection and force termination as action name Then the box will reconnect and you may get a new External ip from your service provider And because it's hard to remember all the service names and action names You can write it and here's a shorter call. You can just call fc reconnect and that's done There are more complicated examples for example this There's a module named fritz host Which lists you all active hosts which are connected to the box. This is a snapshot from my own home office as you can see And because this is a lightning talk I see There is a repository for it And there are all a lot of links there to the documentation of the available service names And action names and you can have a look at the code And if you say well this code is quite ugly and I can do it better So please feel free to improve it in this sense. Thank you very much Okay, exercise pick up your phone unlock it Check the icon that says whether it's on Sound ring vibrate or silent make sure it's either vibration or silent We are having currently one ring per lightning torque. I think we can get the ratio down a little bit. Thank you Ladies and gentlemen, my name is Larry Hastings. I was the release manager for python 3 4 And I'm probably going to do it again for 3 5 I'm here to tell you a little bit about how see python works internally and show you a problem that we were having And how we solved it with a new tool and by we I kind of mean me. I did most of this So let's talk about the problem here. We have a python interpreter and it's running your wonderful code And you just happen to call os dot dupe 2 when you pass in Two handles, which are actually python integers So this goes into the see python interpreter in the world's round and around and around it comes out here This is posix underscore dupe 2. This is a c function that is the implementation of dupe 2 for c python How does this work and specifically how do we turn those python objects? Which are h and h2 these python integers. How do we turn them into native c integers? Which is what the c code really wants to talk to So here's posix dupe 2. This is sort of the external stuff There's the doc string, which is a c string and there's the external interface for dupe 2 Most of it is kind of interesting it returns a py object star Everything that is an object in c python is a py object star It takes in a module and here it takes the args and kw args And this is the interesting part or at least for this talk args is appointed to a tuple and that contains the positional arguments kw args is appointed to addict and that contains the keyword arguments if there are any But these are still python values How do we turn them into native c values, which is what we want to deal with? This is it you actually it's it's up to you to write this code And so there's code that looks a lot like this all over the place in c python Every time that you want to deal with a parameter you kind of have to write it in a bunch of different places So in python 3 4 we added this new Inheritable parameter to dupe 2 and we had to touch four different places We had to add it to this keywords list so that it knew its name for a keyword parameter We had to actually declare the variable We had to tell it what type it was this little i means it's an integer and the pipe means it's optional And this inheritable that's how it actually writes it in we actually had to touch five different places But we forgot one we forgot to touch the doc string And the reason I point this out is because we're now up to five different places You have to touch when you add a new parameter and it's kind of an error prone process So we're talking about adding a sixth one To get introspection information right now if you call inspect dot signature on os dot dupe 2 You don't get a signature back. We wanted to fix that but that would mean adding a sixth place And now this seemed like it was going to be way too much work It was going to be way too error prone to manage all of these things. So I wrote a new tool. It's called argument clinic The way this works is you write a comment inside of your c file It's literally a c comment with these extra funny strings at the beginning in the end And inside of that this is machine readable information Formatted sort of vaguely python s kind of It's not intended to look like python. It's intended to be convenient for the person who's writing it So you declare the name of your function you declare your arguments and you only have to write them once Here you're declaring the arguments you're declaring their default values You're declaring their c types and you're declaring per argument doc strings Which is just a convention for encouraging people to document more really And then at the bottom you have the actual doc string for the entire function. This is input to clinic Clinic runs over the code finds this and then writes immediately afterwards in the c file. It's output. It's output is c code This is similar to a tool by the way called cog written by ned bachelder, which is a brilliant idea So this is c code. Um that's dealing with uh informing python about Dupe two. So there's the doc string And that's actually by the way where we hid the introspection information. It's that funny looking first line Here is a method def which is how we tell python. Here's a function called dupe two Here's the function you should call when you call it This is the external implementation of dupe two and argument clinic writes that and that has all the Argument parsing stuff and it writes a new function for you. You write in the middle Called due to impulse and you'll note fd fd2 and inheritable. It's done all the conversion for you It's now in lovely native c types and your code becomes much cleaner to read inside of c python All this upper code this stuff is actually hidden in a separate file. So you don't even see it anymore That's about all I got if you want to know more about it You can read the pep pep 436 or you can look at the source code It's ships with python tools clinic clinic dot pi and it's only about 4 000 lines. Thanks very much The next one after sebastian will be Stefan schwarzer. Are you there? I can see him. Thanks Hi, everyone. I'm sebastian greff and today i'm going to talk about pep 473 adding structure data to built-in exceptions. It's a draft pep So if you like the idea or you have any comments, please like contact me I start like thinking about this when I was working on doing tdd on a huge code base and either because like I I was lacking like some understanding of the code or like typos like sometimes good fail and the error messages are like not helpful at all So the the worst example is index error So you don't get back either the offending index nor the size of the container and it's even worse when you have a nested indexing because you you don't even have the offset and So I started with a really hacky solution I instrumented by code to temporarily store some additional information about the The the index and the the receiving objects and which is open source by the way and then I have a test runner that collects all this information and outputs like nicely. So in this case, it's kind of like much more direct to see that we have an off by one error And so we can go and fix the code without having to to divide it or like add extra print statements or whatever method you like And of course the limitations of this is not portable. It only works with C python 2 and also relies on the error messages. We are like not standard within the the standard library itself So I decided to reach the community. I I wrote to A python ideas and they were really supportive and they They put me to Some pre-existing issues Related to this like some some of those are like older than 10 years old And basically this pet what it is. It's a summary of all the attempts of like all these people including widow Trying to have like more useful More useful exceptions. So for the case of index error, we we would like add like the target The index which is just an alias of the key and For example for value error, we we could have like the unexpected value. So then like test runners could like Get this information and and try to like do some automated debugging for you. The same could be Could be possible in interactive console like ipi phone or like for diagnosing Failing requests in a web application or run running processes and in the long term The idea is like with this information to provide A uniform and normalized error message for all the standard library so if you If you find this interesting and want to see it implemented or have any comments go read the pep and send me an email A small announcement The local bitcoin group They are having their opening ceremony for their new office tonight at 6 30 In their office, obviously Go to their booth and check out the details if you want to go there The next after stefan will be mark shannon mark. Are you around excellent? So, um, my name is stefan schwarzer. I'm giving a talk on thursday About supporting python 2 and 3 with the same code and I got a few questions on this yesterday Yeah, what this is about and I thought I might say a few words um About this or who for whom this is uh, you know, this is for the talk is intended for Developers maintaining a library for python 2 And your users asking you all the time. Please add python 3 support. We need python 3 really we do Okay, but you are a bit reluctant maybe and I don't know how much work this will be And uh, of course, that's this very and you are the user and you're waiting for someone else to Part this library or adapt the library for python 3 um Okay, the talk is not about all the differences Big and small difference between python 2 and 3 There are other documents would summarize this quite nicely one is of course what's new in python 3 or 3 0 actually And one another one is porting to python 3 or something Very good guide The talk is about some differences between python 2 and 3 most really related to python versus bytes versus unit code Issues because this is I think the most complex part Which might require real thought. I mean, which is not so straight straight forward to get right um Okay, I discussed some steps to take to take to get to a python 3 version of your library or python 2 code So it runs on both python 2 and 3 unchanged And also some yeah design api design Advice how you can do this and some other useful tips or best practices yeah I also want to Give a sprint or offer a sprint on saturday at least And possibly sunday. I don't know how much of sunday. I will be here still So if you have a library that you want to port or adapt for python 3 Again with the same source code for python 2 and 3 Yeah, you're welcome. Yeah Thanks I think my my counter and out of power Okay, I have no slides it does matter Yeah, I'm just sorry. Okay This talk's called birthday and you'll see why in a second right? Well, your python's really good and it's even better if you get your birthday hands up if it's your birthday this week Just me. Oh, no. I see some other people Good. In fact, it's my birthday today. This is not just an attempt to get free cake and beer. There is some other logic there Right. Well, the birthday is just a number. It's a number between 1 and 366 So it's just an arbitrary function mapping a person to some small number. It's a it's a hash function It's eight and a half bit hash function so, uh Right, who's heard of the birthday paradox? Oh, good number most of you. Okay for those who haven't Um, the hands up again whose birthday it was this week. Now she hopes whose birthdays are today So I can't see from here. Go on somebody must have their hand up. There's got to be like at least 300 Okay, well, that's good. So so that's quite a good hash function. It tends to be, you know, not too many collisions But the problem is If you take a group of people and see if find out more than half the problem is you're more than half of them having the same birthday You only need 23 people for that to be the case So that's your birthday paradox not really a paradox So you might think you've got quite a good hash function because of collisions It's slightly different. In fact, if you've got an n-bit hash function If you get close to Two to the n over two items you're likely to have a collision. So if you've got a hash function of 20 bits which gives you a million items if you have a thousand entries good chance you'll have a collision You know a whole number of percent Okay so Hash functions are useful for chopping stuff up into data, but they're sort of probabilistic So who's heard of bloom filters? I'm not preaching to the converter too much, but definitely a fair bit Okay, so it's a probabilistic set. It's a way of using a hash function to say Is this a member of some set and what it gives us to a nice property that we never get any false negatives But we might have false positives So if we're not doing bloom filter based on using birthdays as a hash Um, we'd use 366 bits But let's suppose we haven't got a big expensive server that has 366 bits of memory But we've got this little laptop with 43 bits of memory So what we can do is we can break the hash up into different hashes smaller hashes and save a bit of memory there By the way, if anyone actually does know our bloom filters work, they're probably wincing and I suggest you go and look at wikipedia afterwards But this is kind of fun fun introduction So I need two volunteers from the front row Come on. Don't be shy. It's one Go on. I had to stand up here. We've just put your hand up. Okay. So I've got two people right. Can I have your name? You are j o a r She's pronounced You are And the day of your birth 24th and the month 10 And sorry, there's a gentleman over there Peter Dimitri I can't hear very well up here obviously Dimitri and 24th This is not working. Well of october and yours was probabilistic data structures for you can have another volunteer just to make this thing work a little bit better Another volunteer, please Okay Yes, please Luis And hopefully you're not born on 24th october 12th of december Is that sorry 12 12, okay So we have our bloom filter and we're looking for you are or louis, uh, yeah, louis Sorry, not dimitri because we just scratched dimitri because he had the wrong birthday So we have our bloom filter and basically what we want to do is we can say probabilistically Somebody's probably either you are or louis We can't say for sure that they are but we can say they're surely if they're not So I want everyone in the front if you can see the microphone without turning your a microphone without turning your head You're at the front if you can see a microphone you're on the back I want everyone at the front to raise your left hand If your date of birth was the 24th or the 12th Come on. Don't be shy. This doesn't work if you're shy Really, there's like two or three people there. You're out of time. Actually. Oh, wow Thomas Weidmann you are Thomas Okay, I just wanted to show you two rather new projects The one is ns update dot info and the other is And the special thing is both were initially written in 48 hours It was a contest and it happened that I stood guard a hacker space called check space And I started with ns update info You maybe have used a dynamic dns service like no ip or dindiness or some of the others but Usually they want to sell you something and only some features are for free and other features are for pay And also it's sometimes a bit difficult to find the free features because they have lots of features And we just thought we write a new one That's much simpler Uh on this new service, it's made with Django by the way You can have one account, but you can have many hosts So you don't need to create a new account for every host. It helps you configure your router Uh, you even have a small browser based update client if you have no other update client This is for a talk usage Uh, you can update hosts in your own domain if you run your own name server And you can even update other services that are based on the dynamic dns protocol And it supports ipv6 also and it uses ssl of course So it's on github ns update minus info is the organization It's bsd licensed python jango bootstrap jquery and a library called dns python That does all the low-level dns stuff You can run your own instance on your own server. You need the software, a web server, whiskey, a name server and a database server, but you can even use sqlite 3 So no big data. So uh, no big database needed Um, I maybe show shortly a few pictures Looks like this if you are not logged in it shows your ip if you have ipv6 connectivity also shows the ipv6 address This is the login screen. You have a local account or you can also log in with github or bit bucket or google This is if you have created a few hosts On the left you can create a new host. It's just typing in some name selecting a domain It also shows your reverse dns This happens after you created a host It shows you're ready to use dd client conf You just copy and paste this piece of text into the config and it immediately works So creating a new host is about two minutes. Maybe This look is the screen if you edit a host you can change the ip and so on And you can add new domains if you control a domain name server And if you add a new domain, it even shows you your bind 9 config if you copy and paste this to your bind installation It also will immediately work and accept updates Statistics And there is even documentation It's on github. Have a look The other project is uh, pay spin There are lots of pay spins usually you just pay text into them We wanted to create a new one that accepts every content type so you can paste the pdfs Or upload pdfs. You can upload images video audio binaries If it's texted you get highlighting as usual if it's other content You get just the appropriate rendering if possible You can drag and drop multiple files If you have a modern browser you get file lists if you drag and drop multiple stuff There's a simple permission system in it And it can even deal with large files efficiently. It's also on github. It's called b pasty It's bsd license python flowers bootstrap jQuery and so on And in general we need your help if such a project is interesting for you. It's good for newbies also It's rather small projects. Just join us contribute your ideas Buck fixes security reviews You find me on twitter and i'm also here for the sprints Okay, thank you Christian heimers are you around? All right, excellent And after christian, um There's gonna be rock rock Did i see you all right excellent Oh, no doesn't start Oh starts on the wrong display Okay, let's try this way doesn't switch over Okay So hi, i'm christian heimers. I'm a professional paranoid python core committer I'm one of the guys that takes care of the security of c python So if you're wanting to know more you can reach me on twitter or on email So i'd like to tell to you what we'll actually do at the You know today, i'd like to talk to you what we actually do with c python core security We have a python security response team That's the team that interacts with all incoming bug reports We work rather closely with redhead in google and also with core developers from other teams For example at one time we had a issue that was first detected by ruby guys Later i ported the security fix for python to php. So we were able to fix the issue on all three projects Also, we are using a tool called caverti scan. It's a commercial tool, but free for open source It's a static c code analyzer Or this URL you can find c python Yeah caverti defined this limit defect to send Density for all different kinds of projects in size So for python it would be about .5 but actually today it's So we just have two outstanding issues because I updated the Toolchain to a new version and take the two more issues. I'm hope to call them that in a couple of days We got some new things. I applied to this tab. It replaces the old hash function used for dictionaries And so the thing that hashes the strings and unicode strings To a hash or with sip hash 24 from dj burnstein And another guy implemented This tab it's basically It ensures that file descriptors doesn't get leaked to sub processes It's especially important if you have root demon that starts some other processes that are Nice That should not get sensitive informations That's isolated mode a new feature too That does something so a console script doesn't get poisoned by the user site directory or some n-fars Or as you random got a bit optimized for python 3.4 it uses a persistent file descriptor Eventually, they're going to use the new shiny get random this call linux getting these days Or when those we're using this function. Oh, and by the way We're using uh, you want to have any random secure Random numbers don't ever use the random module. It's use a mesonet twister and if an attacker is able to get this amount of Outputs it can guess any future outputs. It's 624 so not much Um, this is another feature I implemented for python 3.4 It's a password base key to rich key derivation function two Um While I was implementing this I found a dorsal numeracy in open SSL in their implementation By the way the same issue jango had a while ago So and if you're dealing with passwords never ever use anything else than these three functions Be grip and script are fine too And you need this function in python 2 or all of versions Please use my library because much much faster than any other libraries currently on the market So There's also some changes in the hmech module with python 3.3. We already had This computer digest comparison function python 3.3 3.4. We're getting another one and the good thing is So oh almost all the time. So it's keeping to the end Several of these features will be back ported to python 2.7 So really new features except for security After rock the last slot will be for That's the one name. I really don't know how to pronounce Joar Exactly you're next Hi guys, uh, I'm rock. I work for road code um And as any of you you I installed my software And as a developer I install it even more often. I'm more multiple versions different project different platform not only python Um, therefore I usually broke my system Not anymore since I switched to nix Uh, nix is a package manager. You heard the talk this morning from my, uh, uh friend Doman about it the internals I would just like to go through all the features it offers and invite you at the end Of the euro python to join us to sprint and Make sure you don't break your system. Uh, by just developing on your project So nix, uh, it's let's start in the top bottom. It's portable. It works on any POSIX platform, which means, um Poor macOS users could actually now drop go away from homebrew, uh, because we ship also binaries So, yeah, we have a transparent source, uh, binary model So if the binaries are not found, yes, we'll compile them for you if it's needed Uh, we, uh, we support multi-user and multi-version Uh, uh, solution to the problem so you can work, uh, you can have, uh, Different python versions, uh, installed at the same time in the same environment, uh, and they do not conflict um Going up We make sure that every installation you do it's reliable and it doesn't break anything outside of that installation Even though even sometimes happen that some installation break all the installations are atomic Uh in if something goes wrong, give her the installation is Installed application is installed successfully. You can always roll back to previous version um It's reproducible the thing that bugs me the most is when somebody does a false release on pi pi and Somebody forgot to pin The versions then I'm developing at one point I end up with a broken development environment We make sure here with by default you get the it's always working once you set it up, um And well all in all nix is great for developers Think of nix as a virtual end the tool you probably are all using but much bigger It's not only meant for python. It's you can you use it for any project Any language specific project you have you can even Bind them more together because I think nowadays, uh, we are all kind of forced at least to um To learn javascript and all the tools that they have so It's one tool to do the job and Just to maybe because you're probably wondering Yeah, this is a tool that looks again like docker, right? We don't virtualize anything We think a packaging problem should be done by the on the packaging level We can output we can provision or whatever you want to call it docker virtual box any images But you can just use it for booting bootstrapping your development environment and not screwing up your laptop Uh, thank you And hope to see you on saturday. We'll have a nix corner and we can get you up and running For basically any development environment you need Thank you As you are will be the last one and as we have been talking about sprints a couple of times already Who of you is thinking about joining us on the sprints on saturday? Can you show me your hands? That is a good number. That is awesome. It looks like I would guess at least 50 60 in here. That's very nice All right, my name is uh, you are and um I came to a realization yesterday that uh set up pie The dependency declaration for your program basically Is turned complete. So I exploited that fact and I created a package Called uh deprolet. You never know what you get So pip install deprolet and Then it don't do it Just don't that's all Thank you very much That was fast. You've got the shortest lightning talk. Awesome. It's 45 seconds