Skip to content

Instantly share code, notes, and snippets.

View benthomasson's full-sized avatar

Ben Thomasson benthomasson

  • Ansible by RedHat
View GitHub Profile
@benthomasson
benthomasson / settings.py
Last active June 27, 2024 18:16 — forked from ipmb/settings.py
Django logging example
import logging.config
import os
from django.utils.log import DEFAULT_LOGGING
# Disable Django's logging setup
LOGGING_CONFIG = None
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
logging.config.dictConfig({
---
- name: Using locals instead of events
hosts: all
sources:
- range:
limit: 5
rules:
- name: r1
condition:
all:
@benthomasson
benthomasson / gist:a6c84ad5a64f4e056ab32a7f6e3e02d1
Created January 22, 2022 12:14 — forked from abadger/gist:d3d1917cb9cb7b1cf31454f0c726e41b
Documentation on how Ansible modules are made ready to be executed on a remote system.
=======
Modules
=======
This is an in-depth dive into understanding how Ansible makes use of modules.
It will be of use to people working on the portions of the Core Ansible Engine
that execute a module, it may be of interest to people writing Ansible Modules,
and people simply wanting to use Ansible Modules will likely want to read
a different paper.
@benthomasson
benthomasson / readme.md
Created October 4, 2017 21:15 — forked from baraldilorenzo/readme.md
VGG-19 pre-trained model for Keras

##VGG19 model for Keras

This is the Keras model of the 19-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

from __future__ import print_function
from nanomsg import Socket, REQ, REP, PUB, SUB, DONTWAIT, \
NanoMsgAPIError, EAGAIN, SUB_SUBSCRIBE
import time
from gevent import monkey
import gevent
monkey.patch_all()
diff --git a/tastypie/fields.py b/tastypie/fields.py
index ae3f291..568788c 100644
--- a/tastypie/fields.py
+++ b/tastypie/fields.py
@@ -644,7 +644,7 @@ class RelatedField(ApiField):
Accepts either a URI, a data dictionary (or dictionary-like structure)
or an object with a ``pk``.
"""
- self.fk_resource = self.to_class()
+ self.fk_resource = self.to_class(api_name=self.api_name)