Skip to content

Instantly share code, notes, and snippets.

View danielperezr88's full-sized avatar
🚀
Empowering world-changing ideas

Daniel Pérez Rubio danielperezr88

🚀
Empowering world-changing ideas
  • Madrid
View GitHub Profile
@danielperezr88
danielperezr88 / php-ini-modifier.py
Last active July 15, 2016 12:51
ConfigParser applied to php.ini commented and uncommented option parsing
from configparser import ConfigParser
LOGDIR = '/etc/php5/apache2'
### Overload ConfigParser _read method to generate a comment parser
class CommentParser(ConfigParser):
def __init__(self,*args,**kwargs):
super(ConfigParser,self).__init__(*args,**kwargs)
import json
from datetime import date, timedelta
from collections import Counter
import unicodedata
from time import sleep
from AbstractServiceClass import AbstractServiceClass
class HeartBeater(AbstractServiceClass):
def __init__(self):
AbstractServiceClass.__init__(self)
def __doit__(self):
self.log('.')
{#
Renders Bokeh models into a basic .html file.
:param title: value for ``<title>`` tags
:type title: str
:param plot_resources: typically the output of RESOURCES
:type plot_resources: str
:param plot_script: typically the output of PLOT_SCRIPT
@danielperezr88
danielperezr88 / mod-resources.py
Last active August 26, 2016 13:08
Modified bokeh submodule. It adds external javascript/css model summoning capabilities with "__javascript__" and "__css__" attributes
''' Remember changing this file name before running bokeh
The resources module provides the Resources class for easily configuring
how BokehJS code and CSS resources should be located, loaded, and embedded in
Bokeh documents.
Also provides some pre-configured Resources objects.
Attributes:
CDN : load minified BokehJS from CDN
# Creado para solucionar una serie de errores de tweepy
# mover a "/usr/local/lib/python3.4/site-packages/tweepy/streaming.py" después de instalar tweepy
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
# call "rabbitmqctl stop" when exiting
trap "{ echo Stopping rabbitmq; rabbitmqctl stop; exit 0; }" TERM
echo Starting rabbitmq
rabbitmq-server &
# from docs: When Bash receives a signal for which a
# trap has been set while waiting for a command to
# complete, the trap will not be executed until the
# command completes.
diff --git a/workspace.bzl b/workspace.bzl
index 13f29c1..d0cb97a 100644
--- a/workspace.bzl
+++ b/workspace.bzl
@@ -76,7 +76,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
native.new_http_archive(
name = "gmock_archive",
- url = "https://archive.openswitch.net/gmock-1.7.0.zip",
+ url = "http://pkgs.fedoraproject.org/repo/pkgs/gmock/gmock-1.7.0.zip/073b984d8798ea1594f5e44d85b20d66/gmock-1.7.0.zip",
diff --git a/parser_trainer_test.sh b/parser_trainer_test.sh
index ba2a6e7..977c89c 100644
--- a/parser_trainer_test.sh
+++ b/parser_trainer_test.sh
@@ -22,7 +22,7 @@
set -eux
-BINDIR=$TEST_SRCDIR/syntaxnet
+BINDIR=$TEST_SRCDIR/$TEST_WORKSPACE/syntaxnet
diff --git a/tom_lib/nlp/topic_model.py b/tom_lib/nlp/topic_model.py
index 0abd98b..02f7088 100644
--- a/tom_lib/nlp/topic_model.py
+++ b/tom_lib/nlp/topic_model.py
@@ -6,7 +6,7 @@ import tom_lib.stats
from scipy import spatial, cluster
from scipy.sparse import coo_matrix
from sklearn.decomposition import NMF, LatentDirichletAllocation as LDA
-import lda
+from sklearn import lda