Because you can't get the docs.
Create a transliterator:
greek2latin = icu.Transliterator.createInstance('Greek-Latin')
from keras.models import Sequential | |
from keras.layers.core import Dense, Dropout, Activation | |
from keras.optimizers import SGD | |
import numpy as np | |
X = np.array([[0,0],[0,1],[1,0],[1,1]]) | |
y = np.array([[0],[1],[1],[0]]) | |
model = Sequential() | |
model.add(Dense(8, input_dim=2)) |
#!/usr/bin/env python | |
"""Basic Python Cheat Sheet by Filip Kral on 2015/02/16""" | |
""" | |
Python is a cross-platform, interpreted, object-oriented programming language. | |
That means you can run it on Linux, Windows, Mac, and other platforms, | |
you don't need to compile your code to execute it because it is compiled on | |
the fly, and you can use classes and objects. |
<?xml version='1.0' encoding='UTF-8'?> | |
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> | |
<rootfiles> | |
<rootfile media-type="application/oebps-package+xml" full-path="content.opf"/> | |
</rootfiles> | |
</container> |
""" | |
Functions for converting dates to/from JD and MJD. Assumes dates are historical | |
dates, including the transition from the Julian calendar to the Gregorian | |
calendar in 1582. No support for proleptic Gregorian/Julian calendars. | |
:Author: Matt Davis | |
:Website: http://github.com/jiffyclub | |
""" |
import os.path | |
import collections | |
from operator import itemgetter | |
WORDFILE = '/usr/share/dict/words' | |
class Autocorrect(object): | |
""" | |
Very simplistic implementation of autocorrect using ngrams. | |
""" |
import random | |
class TicTacToe: | |
def __init__(self, playerX, playerO): | |
self.board = [' ']*9 | |
self.playerX, self.playerO = playerX, playerO | |
self.playerX_turn = random.choice([True, False]) | |
def play_game(self): |
# We start by loading up PyICU. | |
import PyICU as icu | |
# Let's create a test text. Notice it contains some punctuation. | |
test = u"This is (\"a\") test!" | |
# We create a wordbreak iterator. All break iterators in ICU are really RuleBasedBreakIterators, and we need to tell it which locale to take the word break rules from. Most locales have the same rules for UAX#29 so we will use English. | |
wb = icu.BreakIterator.createWordInstance(icu.Locale.getEnglish()) | |
# An iterator is just that. It contains state and then we iterate over it. The state in this case is the text we want to break. So we set that. |
name: Minimal Android CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
jobs: |
#!perl -w | |
=head1 NAME | |
pl2py.pl | |
=head1 DESCRIPTION | |
Attempts to convert perl scripts to python with the awesome power of regular expressions. |