This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SubclassingQuerySet(QuerySet): | |
def __getitem__(self, k): | |
result = super(SubclassingQuerySet, self).__getitem__(k) | |
if isinstance(result, models.Model): | |
return result.as_leaf_class() | |
else: | |
return result | |
def __iter__(self): | |
for item in super(SubclassingQuerySet, self).__iter__(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Marksman < RTanque::Bot::Brain | |
NAME = 'MarksmanSample_testbattle' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
command.speed = RTanque::Bot::MAX_SPEED | |
nearest = nearest_target() | |
if (!defined?(@direction)) | |
@direction = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=set([1,2,3,4]) | |
b=set([4,5,6,7]) | |
c=set([7,8,9]) | |
def array_combinations(*args): | |
combinations = [[i] for i in set(args[0])] | |
for arg in args[1:]: | |
tempcomb = [] | |
for i in set(arg): | |
tempcomb += [c+[i] for c in combinations if i not in c ] | |
combinations = tempcomb |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { | |
"@base": "http://demos.gsi.dit.upm.es/eurosentiment/generator#{{ filename }}", | |
"dc": "http://purl.org/dc/terms/", | |
"dc:subject": { | |
"@type": "@id" | |
}, | |
"emotions": { | |
"@container": "@list", | |
"@id": "onyx:hasEmotionSet", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZM2cshLida17Ay7EZW6jB9x3jkczT3QF7XJThPmruhv3E3V50mcT6oXf7eunks1XOJtBBJfxYnB93aGt/FJ/f8n44PF6uL+cuj8L9G1tbcIJXUY4HXDN/ewLN/yJqjqax9Sf/d/RV6i3AC+lD8neUsEk7xTzDNaygv+nz40vZ52aHda5AS1hh7XsVQ8SG/2tLvOGSzLT5bhOxqEBVt1CdaBM9dPZhNG8QnMUgEajywFP8OY13q6+boPGpHe2qBKAmIvN6J2uLhcQ6tIt6ODRGyklNY6B8Cagmf0/tCNg/RfzMAWMLFl1NBn3YCszDj/BR32Nw2pSaBzKdAsIyvmfd [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from flask import Flask, redirect, session, url_for, request, flash, render_template | |
from flask_oauth import OAuth | |
from flask.ext.mongoengine import MongoEngine | |
from pymongo import MongoClient | |
from config import * | |
with open('config.json', 'r') as f: | |
config = json.loads(f.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0F+APPR0NnvNKuRodiFrXbyuT7bkVQ66kGgAgkw666P9/+42VaX9VbzFMrGxXqCpDXzgQgFWU80ZzQtl5qmg4CgGsBoR9Bxs3d/6EEBxuEWZOnRC+IVM7wVcnRNdvMIL6+7gk5keTz5uhrdyWJTCA+MD4NIh3gbXtqQ0FRMFrCaTCguErhqkUfwNoJaB3ZJeqFYnruyhGI24YmgJVDQ9PaSc9yGXXPIoBAIVxhGiHRHkuqj0BojBR5gHDACJ8EeYkdoayKwY05fFBtNiOD3VuspOJZnefaDWALjgvuOts4DSPg8Qpw5wNW7SMTzKODy3zlIWOV8JixBQ0mLoouXnr [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from rdflib import Graph, plugin | |
from rdflib.serializer import Serializer | |
import sys | |
g = Graph().parse(sys.argv[1], format='json-ld') | |
print "Hooray! It seems to be a valid json-ld file!" |