Skip to content

Instantly share code, notes, and snippets.

import random
class Markov(object):
def __init__(self, open_file):
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
self.database()
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'
# into your database.
from django.db import models
# lint Python modules using external checkers.
#
# This is the main checker controlling the other ones and the reports
# generation. It is itself both a raw checker and an astng checker in order
# to:
# * handle message activation / deactivation at the module level
# * handle some basic but necessary stats'data (number of classes, methods...)
#
[MASTER]
In [1]: '' in 'abc'
Out[1]: True
In [2]: [] in [1, 2, 3,] #If empty sequence in sequence is True, why is this false?
Out[2]: False
In [3]: '' in [1, 2, 3,]
Out[3]: False
In [4]: x = 'abc'
ids = ['4153869960',
'4160152863',
'4165131655',
'4164906099',
'4165892330',
'4165146115']
import urllib
import json
<Location />
SetHandler /path/to/umoja.wsgi
</Location>
def merge(url):
full_url=[]
for i, el in enumerate(url):
if i%2==0:
full_url.append(el)
full_url = ''.join(full_url)
return full_url
def combineflatten(seq):
items= tuple(item for item in seq if not isinstance(item, tuple))
scala> None == None
res3: Boolean = true
scala> None == 10
<console>:5: warning: comparing non-null values of types object None and Int using `==' will always yield false
None == 10
^
res4: Boolean = false
scala> None > 10
php> echo(false)
php> echo(true)
1
php> echo(null)
php>
Clojure 1.0.0-
user=> nil
nil
user=> (== 10 10)
true
user=> (== nil 10)
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (== 10 nil)
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (> nil 10)