https://github.com/4Catalyzer/pykubectl
A python bridge to kubectl providing additional functionalities useful for CD and #automation.
#machine_learning
A python bridge to kubectl providing additional functionalities useful for CD and #automation.
#machine_learning
GitHub
4Catalyzer/pykubectl
pykubectl - A python bridge to kubectl
https://github.com/pytorch/pytorch
#PyTorch doesn't only port #Torch to Python, but adds many other conveniences, such as #GPU acceleration and a library that allows multiprocessing to be done with shared memory (for partitioning jobs across multiple cores). Best of all, it can provide GPU-powered replacements for some of the unaccelerated functions in #NumPy.
#machine_learning
#PyTorch doesn't only port #Torch to Python, but adds many other conveniences, such as #GPU acceleration and a library that allows multiprocessing to be done with shared memory (for partitioning jobs across multiple cores). Best of all, it can provide GPU-powered replacements for some of the unaccelerated functions in #NumPy.
#machine_learning
GitHub
GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Tensors and Dynamic neural networks in Python with strong GPU acceleration - pytorch/pytorch
https://realpython.com/blog/python/getting-started-with-django-channels/#.WLWLY9_IJ0s.linkedin
In this tutorial, we will use #Django_Channels to create a real-time application that updates a list of users as they log in and out.
Django Channels Logo
With #WebSockets (via Django Channels) managing the communication between the client and the server, whenever a user is authenticated, an event will be broadcasted to every other connected user. Each user’s screen will change automatically, without them having to reload their browsers.
In this tutorial, we will use #Django_Channels to create a real-time application that updates a list of users as they log in and out.
Django Channels Logo
With #WebSockets (via Django Channels) managing the communication between the client and the server, whenever a user is authenticated, an event will be broadcasted to every other connected user. Each user’s screen will change automatically, without them having to reload their browsers.
Realpython
Getting Started with Django Channels – Real Python
Let's use Django Channels to create a real-time Django application.
http://pybit.es/codechallenge11.html
Inspired by David Beazley's #Generator Tricks for Systems Programmers we ask you to turn the following unix #pipeline into Python code using generators. To get a bunch of .py files you can use our challenges repo you cloned. Or use a project of your own.
Note that in our experience one subprocess is not necessarily one generator, for example 'sort|uniq|sort' can be easily combined into one, as well as 'grep|sed'. See our template if you need guidance.
Inspired by David Beazley's #Generator Tricks for Systems Programmers we ask you to turn the following unix #pipeline into Python code using generators. To get a bunch of .py files you can use our challenges repo you cloned. Or use a project of your own.
Note that in our experience one subprocess is not necessarily one generator, for example 'sort|uniq|sort' can be easily combined into one, as well as 'grep|sed'. See our template if you need guidance.
PyBites
Code Challenge 11 - Generators for Fun and Profit
A new week, a new 'bite' of Python coding! After last week's article on generators we will get you to practice a bit more with them in our new challenge. Good luck and have fun.
https://github.com/Miserlou/Zappa#about
Zappa makes it super easy to build and deploy all Python #WSGI applications on #AWS Lambda + #API Gateway. Think of it as "#serverless" #web hosting for your Python apps. That means infinite scaling, zero downtime, zero maintenance - and at a fraction of the cost of your current deployments!
If you've got a Python web app (including Django and Flask apps), it's as easy as:
$ pip install zappa
$ zappa init
$ zappa deploy
and now you're server-less! Wow!
What do you mean "serverless"?
Okay, so there still is a server - but it only has a 40 millisecond life cycle! Serverless in this case means "without any permanent infrastructure."
Zappa makes it super easy to build and deploy all Python #WSGI applications on #AWS Lambda + #API Gateway. Think of it as "#serverless" #web hosting for your Python apps. That means infinite scaling, zero downtime, zero maintenance - and at a fraction of the cost of your current deployments!
If you've got a Python web app (including Django and Flask apps), it's as easy as:
$ pip install zappa
$ zappa init
$ zappa deploy
and now you're server-less! Wow!
What do you mean "serverless"?
Okay, so there still is a server - but it only has a 40 millisecond life cycle! Serverless in this case means "without any permanent infrastructure."
GitHub
GitHub - Miserlou/Zappa: Serverless Python
Serverless Python. Contribute to Miserlou/Zappa development by creating an account on GitHub.
http://techioz.com/lambda-function-in-python/
#lambda function is defined using lambda keyword. It’s an anonymous function without name.
#python #learn
#lambda function is defined using lambda keyword. It’s an anonymous function without name.
#python #learn
http://docs.python-guide.org/en/latest/
Greetings, Earthling! Welcome to The Hitchhiker’s Guide to Python.
This is a living, breathing guide. If you’d like to contribute, fork us on GitHub!
This handcrafted guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis.
This guide is opinionated in a way that is almost, but not quite, entirely unlike Python’s official documentation. You won’t find a list of every #Python web framework available here. Rather, you’ll find a nice concise list of highly recommended options.
#learn
Greetings, Earthling! Welcome to The Hitchhiker’s Guide to Python.
This is a living, breathing guide. If you’d like to contribute, fork us on GitHub!
This handcrafted guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis.
This guide is opinionated in a way that is almost, but not quite, entirely unlike Python’s official documentation. You won’t find a list of every #Python web framework available here. Rather, you’ll find a nice concise list of highly recommended options.
#learn
https://realpython.com/blog/python/introduction-to-mongodb-and-python/#.WMfv6BURLc4.linkedin
#Python is a powerful programming language used for many different types of applications within the development community. Many know it as a flexible language that can handle just about any #task. So, what if our complex Python application needs a #database that’s just as flexible as the language itself? This is where #NoSQL, and specifically #MongoDB, come in to play.
#Python is a powerful programming language used for many different types of applications within the development community. Many know it as a flexible language that can handle just about any #task. So, what if our complex Python application needs a #database that’s just as flexible as the language itself? This is where #NoSQL, and specifically #MongoDB, come in to play.
Realpython
Introduction to MongoDB and Python – Real Python
This article looks at how to use Python to interface with MongoDB along with an overview of SQL vs. NoSQL, PyMongo, and MongoEngine.
http://www.drdobbs.com/open-source/the-new-asyncio-in-python-34-servers-pro/240168408
In a previous article on the new #asyncio module introduced in Python 3.4, I explained simple use of event loop functions that register, execute, and delay or cancel calls. In this article, I demonstrate more-advanced examples that explore asyncio's support for server and client programming, #protocols, and #transports.
#learn
In a previous article on the new #asyncio module introduced in Python 3.4, I explained simple use of event loop functions that register, execute, and delay or cancel calls. In this article, I demonstrate more-advanced examples that explore asyncio's support for server and client programming, #protocols, and #transports.
#learn
Dr. Dobb's
The New asyncio in Python 3.4: Servers, Protocols, and Transports
Coding advanced asynchronous I/O with Python's new high-level streams API.
http://stackoverflow.com/questions/32054066/python-how-to-run-multiple-coroutines-concurrently-using-asyncio
how to run multiple #coroutines #concurrently using #asyncio?
You can use #asyncio.async() to run as many #coroutines as you want, before executing blocking call for starting event loop.
how to run multiple #coroutines #concurrently using #asyncio?
You can use #asyncio.async() to run as many #coroutines as you want, before executing blocking call for starting event loop.
Stack Overflow
Python - how to run multiple coroutines concurrently using asyncio?
I'm using the websockets library to create a websocket server in Python 3.4. Here's a simple echo server:
import asyncio
import websockets
@asyncio.coroutine
def connection_handler(websocket, pat...
import asyncio
import websockets
@asyncio.coroutine
def connection_handler(websocket, pat...
http://stackoverflow.com/questions/29819151/what-should-i-decorate-with-asyncio-coroutine-for-async-operations
If you have a function that needs to use yield from to call a #coroutine, you should #decorate it with asyncio.coroutine. Also note that coroutines are often (not always) "viral". As soon as you add yield from to a function it becomes a coroutine, and additionally any function that calls that coroutine usually (though not always) needs to be come a coroutine, too.
If you have a function that needs to use yield from to call a #coroutine, you should #decorate it with asyncio.coroutine. Also note that coroutines are often (not always) "viral". As soon as you add yield from to a function it becomes a coroutine, and additionally any function that calls that coroutine usually (though not always) needs to be come a coroutine, too.
Stackoverflow
What should I decorate with @asyncio.coroutine for async operations?
I want to run my code asnychronously. What should I decorate with @asyncio.coroutine and what should I call with yield from for async operations?
In my case, I have some example code without decor...
In my case, I have some example code without decor...
http://calebmadrigal.com/calling-sync-code-from-asyncio/
Calling synchronous code from asyncio
Mon 25 May 2015
I recently needed to call some #synchronous code from #asyncio. Thankfully, asyncio provides the #run_in_executor function, which runs the specified function in a different thread. Here is an example of using it:
#learn
Calling synchronous code from asyncio
Mon 25 May 2015
I recently needed to call some #synchronous code from #asyncio. Thankfully, asyncio provides the #run_in_executor function, which runs the specified function in a different thread. Here is an example of using it:
#learn
https://pymotw.com/3/asyncio/executors.html
Combining Coroutines with Threads and Processes
A lot of existing libraries are not ready to be used with #asyncio natively. They may block, or depend on concurrency features not available through the module. It is still possible to use those libraries in an application based on asyncio by using an #executor from #concurrent.futures to run the code either in a separate thread or a separate process.
#Threads
The #run_in_executor() method of the event loop takes an executor instance, a regular callable to invoke, and any arguments to be passed to the callable. It returns a Future that can be used to wait for the function to finish its work and return something. If no executor is passed in, a #ThreadPoolExecutor is created. This example explicitly creates an executor to limit the number of worker threads it will have available.
#Processes
A ProcessPoolExecutor works in much the same way, creating a set of worker #processes instead of threads. Using separate processes requires more system resources, but for computationally-intensive operations it can make sense to run a separate task on each CPU core.
#learn
Combining Coroutines with Threads and Processes
A lot of existing libraries are not ready to be used with #asyncio natively. They may block, or depend on concurrency features not available through the module. It is still possible to use those libraries in an application based on asyncio by using an #executor from #concurrent.futures to run the code either in a separate thread or a separate process.
#Threads
The #run_in_executor() method of the event loop takes an executor instance, a regular callable to invoke, and any arguments to be passed to the callable. It returns a Future that can be used to wait for the function to finish its work and return something. If no executor is passed in, a #ThreadPoolExecutor is created. This example explicitly creates an executor to limit the number of worker threads it will have available.
#Processes
A ProcessPoolExecutor works in much the same way, creating a set of worker #processes instead of threads. Using separate processes requires more system resources, but for computationally-intensive operations it can make sense to run a separate task on each CPU core.
#learn
https://see.stanford.edu/Course/CS229
This course provides a broad introduction to #machine_learning and #statistical_pattern_recognition.
Topics include: supervised learning (generative/discriminative learning, parametric/non-parametric learning, neural networks, support vector machines); unsupervised learning (clustering, dimensionality reduction, kernel methods); learning theory (bias/variance tradeoffs; VC theory; large margins); reinforcement learning and adaptive control.
The course will also discuss recent applications of machine learning, such as to robotic control, data mining, autonomous navigation, bioinformatics, speech recognition, and text and web data processing.
Students are expected to have the following background:
This course provides a broad introduction to #machine_learning and #statistical_pattern_recognition.
Topics include: supervised learning (generative/discriminative learning, parametric/non-parametric learning, neural networks, support vector machines); unsupervised learning (clustering, dimensionality reduction, kernel methods); learning theory (bias/variance tradeoffs; VC theory; large margins); reinforcement learning and adaptive control.
The course will also discuss recent applications of machine learning, such as to robotic control, data mining, autonomous navigation, bioinformatics, speech recognition, and text and web data processing.
Students are expected to have the following background:
see.stanford.edu
Stanford Engineering Everywhere | CS229 - Machine Learning
This course provides a broad introduction to machine learning and statistical pattern recognition.
Topics include: supervised learning (generative/discriminative learning, parametric/non-parametric learning, neural networks, support vector machines); unsupervised…
Topics include: supervised learning (generative/discriminative learning, parametric/non-parametric learning, neural networks, support vector machines); unsupervised…
http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/
The asynchronous programming topic is difficult to cover. These days, it's not just about one thing, and I'm mostly an outsider to it. However, because I deal a lot with relational databases and the Python stack's interaction with them, I have to field a lot of questions and issues regarding #asynchronous_IO and #database programming, both specific to #SQLAlchemy as well as towards #Openstack.
#asyncio
The asynchronous programming topic is difficult to cover. These days, it's not just about one thing, and I'm mostly an outsider to it. However, because I deal a lot with relational databases and the Python stack's interaction with them, I have to field a lot of questions and issues regarding #asynchronous_IO and #database programming, both specific to #SQLAlchemy as well as towards #Openstack.
#asyncio
http://aiomysql.readthedocs.io/en/latest/sa.html
aiomysql.sa — support for SQLAlchemy functional SQL layer
sqlalchemy support ported from #aiopg, so #api should be very familiar for aiopg user.
While core API provides a core support for access to #MySQL #database, manipulations with raw SQL strings too annoying.
Fortunately we can use excellent SQLAlchemy Core as SQL query builder.
So you can execute SQL #query built by tbl.insert().values(val='abc') or tbl.select() expressions.
#sqlalchemy has rich and very powerful set of SQL construction functions, please read tutorial for full list of available operations.
Also we provide SQL transactions support. Please take a look on SAConnection.begin() method and family.
aiomysql.sa — support for SQLAlchemy functional SQL layer
sqlalchemy support ported from #aiopg, so #api should be very familiar for aiopg user.
While core API provides a core support for access to #MySQL #database, manipulations with raw SQL strings too annoying.
Fortunately we can use excellent SQLAlchemy Core as SQL query builder.
So you can execute SQL #query built by tbl.insert().values(val='abc') or tbl.select() expressions.
#sqlalchemy has rich and very powerful set of SQL construction functions, please read tutorial for full list of available operations.
Also we provide SQL transactions support. Please take a look on SAConnection.begin() method and family.
https://dbader.org/blog/python-decorators
Understanding #decorators is a milestone for any serious Python programmer. Here’s your step-by-step guide to how decorators can help you become a more efficient and productive Python developer.
#learn
Understanding #decorators is a milestone for any serious Python programmer. Here’s your step-by-step guide to how decorators can help you become a more efficient and productive Python developer.
#learn
dbader.org
Python Decorators: A Step-By-Step Introduction – dbader.org
Understanding decorators is a milestone for any serious Python programmer. Here’s your step-by-step guide to how decorators can help you become a more efficient and productive Python developer.
# How to merge two #dicts
# in Python 3.5+
»> x = {'a': 1, 'b': 2}
»> y = {'b': 3, 'c': 4}
»> z = {**x, **y}
»> z
{'c': 4, 'a': 1, 'b': 3}
# In Python 2.x you could
# use this:
»> z = dict(x, **y)
»> z
{'a': 1, 'c': 4, 'b': 3}
# in Python 3.5+
»> x = {'a': 1, 'b': 2}
»> y = {'b': 3, 'c': 4}
»> z = {**x, **y}
»> z
{'c': 4, 'a': 1, 'b': 3}
# In Python 2.x you could
# use this:
»> z = dict(x, **y)
»> z
{'a': 1, 'c': 4, 'b': 3}
https://www.djangoproject.com/weblog/2017/apr/04/django-111-released/
The #Django team is happy to announce the release of Django 1.11.
This version has been designated as a long-term support (#LTS) release, which means that security and data loss fixes will be applied for at least the next three years. It will also receive fixes for crashing bugs, major functionality bugs in newly-introduced features, and regressions from older versions of Django for the next eight months until December 2017.
The #Django team is happy to announce the release of Django 1.11.
This version has been designated as a long-term support (#LTS) release, which means that security and data loss fixes will be applied for at least the next three years. It will also receive fixes for crashing bugs, major functionality bugs in newly-introduced features, and regressions from older versions of Django for the next eight months until December 2017.
http://aiohttp.readthedocs.io/en/stable/web.html#aiohttp-web-websockets
In order to implement a #web_server, first create a #request handler.
A request handler is a coroutine or regular function that accepts a Request instance as its only parameter and returns a Response instance:
#aiohttp #asyncio
from aiohttp import web
async def hello(request):
return web.Response(text="Hello, world")
Next, create an Application instance and register the request handler with the application’s #router on a particular HTTP method and path:
In order to implement a #web_server, first create a #request handler.
A request handler is a coroutine or regular function that accepts a Request instance as its only parameter and returns a Response instance:
#aiohttp #asyncio
from aiohttp import web
async def hello(request):
return web.Response(text="Hello, world")
Next, create an Application instance and register the request handler with the application’s #router on a particular HTTP method and path:
#AI #Artificial_Intelligence
#aiohttp
#API
#AWS
#asyncio
#audio
#automated_testing
#automation
#atexit
#BeeWare
#button
#client
#concurrency
#cron
#Coroutine
#data_analysis
#data_mining
#data_processing
#database
#Deep_Learning
#Debian
#decorator
#dispatch
#django
#dropdownbox
#Docker
#event
#Firefox
#form
#freeze
#functool
#Generator
#GeoDjango
#Google
#GPU
#Gym
#learn
#Image_processing
#intelligence
#input
#IOT
#lambda
#lists
#machine_learning
#Magenta
#map
#Metaprogramming
#Micro_services
#mind
#monitoring
#MongoDB
#Mozilla
#Multipart
#multi_touch_apps
#multiprocessing
#Nodes
#NoSQL
#numeric_computation
#numerical
#NumPy
#OAuth
#object_serialization
#OCR
#overloading
#package
#parallel
#pipeline
#protocols
#PostGIS
#pyAudioAnalysis
#PyInstaller
#PySide
#PyTorch
#pytest
#python
#Pyvideo_archives
#Qt
#Redis
#random
#request
#REST
#satellite
#scrapy
#scikit_learn
#SciPy
#searching
#submit
#selectbox
#Selenium
#serialization
#server
#session
#socket
#sound
#task
#TensorFlow
#text_boxes
#text
#test
#telegram
#Thread
#transport
#tuples
#Universe
#Unix
#urllib
#upload
#Web
#aiohttp
#API
#AWS
#asyncio
#audio
#automated_testing
#automation
#atexit
#BeeWare
#button
#client
#concurrency
#cron
#Coroutine
#data_analysis
#data_mining
#data_processing
#database
#Deep_Learning
#Debian
#decorator
#dispatch
#django
#dropdownbox
#Docker
#event
#Firefox
#form
#freeze
#functool
#Generator
#GeoDjango
#GPU
#Gym
#learn
#Image_processing
#intelligence
#input
#IOT
#lambda
#lists
#machine_learning
#Magenta
#map
#Metaprogramming
#Micro_services
#mind
#monitoring
#MongoDB
#Mozilla
#Multipart
#multi_touch_apps
#multiprocessing
#Nodes
#NoSQL
#numeric_computation
#numerical
#NumPy
#OAuth
#object_serialization
#OCR
#overloading
#package
#parallel
#pipeline
#protocols
#PostGIS
#pyAudioAnalysis
#PyInstaller
#PySide
#PyTorch
#pytest
#python
#Pyvideo_archives
#Qt
#Redis
#random
#request
#REST
#satellite
#scrapy
#scikit_learn
#SciPy
#searching
#submit
#selectbox
#Selenium
#serialization
#server
#session
#socket
#sound
#task
#TensorFlow
#text_boxes
#text
#test
#telegram
#Thread
#transport
#tuples
#Universe
#Unix
#urllib
#upload
#Web