text
stringlengths
0
1.05M
meta
dict
__author__ = 'christoph' from restapi.models import Hostname, AddressUpdate from django.template import Context, loader, Template from django.conf import settings import os import datetime import subprocess class DyndnsService(object): def __init__(self): self.nsd = NsdService() def get_host(self, ho...
{ "repo_name": "cemonds/tinhat-dyndns-server", "path": "restapi/services.py", "copies": "1", "size": "3279", "license": "mit", "hash": 4275618283869078500, "line_mean": 38.0357142857, "line_max": 132, "alpha_frac": 0.6273254041, "autogenerated": false, "ratio": 3.4735169491525424, "config_test":...
__author__ = 'christoph' import sqlite3 from flask import g from contextlib import closing import random import string import collections def connect_db(app): conn = sqlite3.connect(app.config['DATABASE']) conn.row_factory = sqlite3.Row return conn def init_db(app): with closing(connect_db(app)) as...
{ "repo_name": "hikhvar/fotoShare", "path": "database/__init__.py", "copies": "1", "size": "9231", "license": "mit", "hash": -3237555303500923000, "line_mean": 27.4030769231, "line_max": 143, "alpha_frac": 0.6152096198, "autogenerated": false, "ratio": 3.690923630547781, "config_test": false, ...
__author__ = 'christoph' """ Copied from the python documentation https://docs.python.org/2/library/csv.html#csv-examples """ import csv, codecs, cStringIO class UTF8Recoder: """ Iterator that reads an encoded stream and reencodes the input to UTF-8 """ def __init__(self, f, encoding): self...
{ "repo_name": "hikhvar/fotoShare", "path": "unicode_helper.py", "copies": "1", "size": "1913", "license": "mit", "hash": 3519121681618111000, "line_mean": 28.90625, "line_max": 96, "alpha_frac": 0.6063774177, "autogenerated": false, "ratio": 3.7731755424063116, "config_test": false, "has_no_k...
__author__ = 'christoph' import scrapy from jtr_scrapper.items import JtrTeamRankingItem, JtrTournamentItem, JtrTournamentPartition import datetime import uuid import utils import Geohash as geohash import geopy import geopy.exc import geopy.distance as geodistance class Jtr_Spider(scrapy.Spider): name = "jtrspid...
{ "repo_name": "hikhvar/jtr_scrapper", "path": "jtr_scrapper/spiders/jtr_spider.py", "copies": "1", "size": "4628", "license": "mit", "hash": -1772705891333194000, "line_mean": 44.8217821782, "line_max": 115, "alpha_frac": 0.5814606742, "autogenerated": false, "ratio": 3.8374792703150913, "confi...
__author__ = "Christoph Statz, christoph.statz <at> tu-dresden.de" import numpy as np from pyvisfile.silo import SiloFile, \ DB_HDF5, DB_CLOBBER, DBOPT_CYCLE, DBOPT_DTIME, DB_COLLINEAR, \ DBOPT_XUNITS, DBOPT_YUNITS, DBOPT_XLABEL, DBOPT_YLABEL, \ DBOPT_UNITS, DB_NODECENT, DBObjectType, DB_LOCAL...
{ "repo_name": "inducer/pyvisfile", "path": "examples/multimesh_rowmajor.py", "copies": "1", "size": "2400", "license": "mit", "hash": -8538491446414694000, "line_mean": 26.9069767442, "line_max": 76, "alpha_frac": 0.6125, "autogenerated": false, "ratio": 2.5396825396825395, "config_test": false...
runDB = [] errorDB = [] notInstDB = [] dbs = ['FNOSDS', 'FNGCDDS', 'IBM_FORMS_DATA_SOURCE', 'activities', 'blogs', 'communities', 'dogear', 'files', 'forum', 'homepage', 'metrics', 'mobile', 'news', 'oauth provider', 'profiles', 'search', 'wikis'] # List of all databases to check for db in dbs: # loop through ...
{ "repo_name": "stoeps13/ibmcnxscripting", "path": "WebSphere/checkDataSource.py", "copies": "1", "size": "1479", "license": "apache-2.0", "hash": -6723606180777789000, "line_mean": 25.4107142857, "line_max": 244, "alpha_frac": 0.5794455713, "autogenerated": false, "ratio": 3.2505494505494505, "...
import sys import os # Load all jython commands, when they are not loaded try: NewsActivityStreamService.listApplicationRegistrations() except NameError: print "Connections Commands not loaded! Load now: " execfile("loadAll.py") class cnxMenu: menuitems = [] # Function to add menuitems def A...
{ "repo_name": "stoeps13/ibmcnxscripting", "path": "WebSphere/cnxmenu.py", "copies": "1", "size": "6463", "license": "apache-2.0", "hash": 2495343851678926300, "line_mean": 33.9351351351, "line_max": 124, "alpha_frac": 0.6818814792, "autogenerated": false, "ratio": 3.105718404613167, "config_tes...
#import sys #import os # Load all jython commands, when they are not loaded try: NewsActivityStreamService.listApplicationRegistrations() except NameError: print "Connections Commands not loaded! Load now: " execfile("loadAll.py") class cnxMenu_cfgtasks: menuitems = [] # Function to add menuite...
{ "repo_name": "stoeps13/ibmcnxscripting", "path": "WebSphere/cnxmenu_cfgtasks.py", "copies": "1", "size": "4226", "license": "apache-2.0", "hash": 4865302241897416000, "line_mean": 32.2755905512, "line_max": 114, "alpha_frac": 0.653099858, "autogenerated": false, "ratio": 3.1966717095310138, "c...
__author__= 'Christo Robison' import numpy as np import h5py import matplotlib.pyplot as plt import collections f = h5py.File('mnist40_Centroids.h5','r') centroids = f['mnist40_Centroids_numpy'][:] f.close() f = h5py.File('mnist_train.h5','r') mnist_train = f['data'][:] mnist_train_labels = f['labels'][:] f.close() ...
{ "repo_name": "Crobisaur/KMeans_MNIST", "path": "CpE520_HW6.py", "copies": "1", "size": "5138", "license": "mit", "hash": -8869534383570345000, "line_mean": 31.9423076923, "line_max": 92, "alpha_frac": 0.6270922538, "autogenerated": false, "ratio": 3.1618461538461538, "config_test": true, "ha...
__author__ = 'Christo Robison' import numpy as np import scipy as sci import h5py from PIL import Image import os import collections '''THis program reads in the entire MNist dataset''' def readMnist(path = '/home/crob/Downloads/mnist/train'): dataDir = '/home/crob/Downloads/mnist/train/' #m = np.ndarray() ...
{ "repo_name": "Crobisaur/KMeans_MNIST", "path": "readMnist.py", "copies": "1", "size": "1326", "license": "mit", "hash": 838113359604378200, "line_mean": 27.8260869565, "line_max": 85, "alpha_frac": 0.5467571644, "autogenerated": false, "ratio": 3.2106537530266346, "config_test": false, "has_...
import numpy as np import matplotlib.pyplot as plt import skimage.draw as skdraw #Used for fast landscape triangle rastering import scipy.misc #Used for downsampling rasterized images avoiding aliasing import time #For timing kernel comparison import sklearn.metrics.pairwise ##########################################...
{ "repo_name": "ctralie/MorseSSM", "path": "DGMTools.py", "copies": "1", "size": "7377", "license": "apache-2.0", "hash": -1384315117805682000, "line_mean": 35.3399014778, "line_max": 127, "alpha_frac": 0.5519859021, "autogenerated": false, "ratio": 2.9215841584158415, "config_test": false, "h...
import csv import mysql.connector import configSettings as cs import collections import pickle import pandas as pd import os.path import philly_tweet_tools ################# import db config settings ################## cnx = mysql.connector.connect(user=cs.user, password=cs.password, host...
{ "repo_name": "ctufts/philly_tweet_pulse", "path": "mysql_python/updateDemographicTable.py", "copies": "1", "size": "2638", "license": "mit", "hash": -3252969724600779000, "line_mean": 31.5679012346, "line_max": 76, "alpha_frac": 0.6758908264, "autogenerated": false, "ratio": 3.0252293577981653, ...
import csv import re import happierfuntokenizing import mysql.connector import configSettings as cs import collections import pickle import gensim from nltk.tokenize import WhitespaceTokenizer from nltk import WordNetLemmatizer, word_tokenize from nltk.corpus import stopwords import os.path import json ###############...
{ "repo_name": "ctufts/philly_tweet_pulse", "path": "mysql_python/updateTopicTable.py", "copies": "1", "size": "3661", "license": "mit", "hash": -840383019105886700, "line_mean": 31.3982300885, "line_max": 81, "alpha_frac": 0.6700355094, "autogenerated": false, "ratio": 3.1614853195164074, "conf...
__author__ = 'Chuck Martin' import os import shutil from django.core.management.base import BaseCommand from django.conf import settings from django.template.loader import render_to_string from data_port.forms import MessageForm from data_port.get_LAN_ip_address import get_LAN_ip_address class Command(BaseCommand)...
{ "repo_name": "cwurld/django-phonegap", "path": "django_phonegap/data_port/management/commands/bundle_phonegap.py", "copies": "1", "size": "1740", "license": "bsd-3-clause", "hash": 3507171369397103000, "line_mean": 39.4651162791, "line_max": 102, "alpha_frac": 0.5965517241, "autogenerated": false,...
__author__ = 'chuqiao' import EventsPortal from datetime import datetime import logging def logger(): """ Function that initialises logging system """ global logger # create logger with 'syncsolr' logger = logging.getLogger('adddata') logger.setLevel(logging.DEBUG) # specifies the ...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "AddDataTest.py", "copies": "1", "size": "2436", "license": "mit", "hash": 1921533156218916900, "line_mean": 38.9508196721, "line_max": 207, "alpha_frac": 0.7085385878, "autogenerated": false, "ratio": 3.510086455331412, "config_...
__author__ = 'chuqiao' from apscheduler.schedulers.blocking import BlockingScheduler import logging import SyncSolr import sys def logger(): """ Function that initialises logging system """ global logger # create logger with 'syncsolr' logger = logging.getLogger('updatesolr') logger.s...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "ScheduleSyncTwoSolrs.py", "copies": "1", "size": "2439", "license": "mit", "hash": 4308705427337492500, "line_mean": 29.8860759494, "line_max": 290, "alpha_frac": 0.6908569086, "autogenerated": false, "ratio": 3.6294642857142856, ...
__author__ = 'chuqiao' from geopy.geocoders import Nominatim import EventsPortal def getCoordinatesForAllData(sourceUrl,patternUrl): data = EventsPortal.getAllEventsData(sourceUrl,patternUrl) for docs in data: latitudeField = docs['latitude'] if latitudeField == None: g...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "GetCoordinatesForAllData.py", "copies": "1", "size": "1206", "license": "mit", "hash": 3228737382286825500, "line_mean": 19.4576271186, "line_max": 106, "alpha_frac": 0.6343283582, "autogenerated": false, "ratio": 3.95409836065573...
__author__ = 'chuqiao' import csv import urllib2 import pysolr import logging import sys reload(sys) sys.setdefaultencoding('utf8') logging.basicConfig(filename='syncsolr.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%d/%m/%Y %I:%M:%S', filemode='w', level=logging.D...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "SyncSolr.py", "copies": "1", "size": "5368", "license": "mit", "hash": 7923437870240841000, "line_mean": 28.5, "line_max": 277, "alpha_frac": 0.6128912072, "autogenerated": false, "ratio": 3.529257067718606, "config_test": false...
__author__ = 'chuqiao' from apscheduler.schedulers.blocking import BlockingScheduler import EventsPortal import sys import logging def logger(): """ Function that initialises logging system """ global logger # create logger with 'syncsolr' logger = logging.getLogger('scheduleAddData') ...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "ScheduleUpdateData.py", "copies": "1", "size": "1884", "license": "mit", "hash": 2330816139601360000, "line_mean": 23.7894736842, "line_max": 111, "alpha_frac": 0.656581741, "autogenerated": false, "ratio": 4.034261241970022, "c...
__author__ = 'chuqiao' import smtplib import base64 from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText def viewlog(file): file = open("Eventsportal.log") file.seek(0,2)# Go to the end of the file while True: line = file.readline() if "***Finished updatin...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "UpdateEmailNotification.py", "copies": "1", "size": "1782", "license": "mit", "hash": 6753773975781303000, "line_mean": 22.76, "line_max": 67, "alpha_frac": 0.6301907969, "autogenerated": false, "ratio": 3.3559322033898304, "con...
__author__ = 'chuqiao' import smtplib import base64 from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText def viewlog(file): file = open("syncsolr.log") file.seek(0,2)# Go to the end of the file while True: line = file.readline() if "***Finished synchronizi...
{ "repo_name": "elixirhub/events-portal-scraping-scripts", "path": "SyncEmailNotification.py", "copies": "1", "size": "1799", "license": "mit", "hash": -3037982041571672600, "line_mean": 22.9866666667, "line_max": 72, "alpha_frac": 0.6336853808, "autogenerated": false, "ratio": 3.306985294117647, ...
__author__ = 'chy' from rest_framework import serializers from question_answer.models import Question, Answer, Tag # -*- coding: utf-8 -*- class QuestionListSerializer(serializers.HyperlinkedModelSerializer): answers_count = serializers.Field(source='get_answer_count') class Meta: model = Question ...
{ "repo_name": "caihaoyu/code_god", "path": "question_answer/serializers.py", "copies": "1", "size": "1123", "license": "mit", "hash": 2386881558278041000, "line_mean": 32.0588235294, "line_max": 145, "alpha_frac": 0.6936776492, "autogenerated": false, "ratio": 3.99644128113879, "config_test": f...
__author__ = 'cindylamm' import time import logging import config as conf from tsdbquery import tsdbquery from sparkprocess import sparkprocess # ############################################################################### # Defaults # if conf.DEBUG: FORMAT = '%(asctime)-0s %(levelname)s %(message)s [at l...
{ "repo_name": "clamm/spark-location-history", "path": "src/process-data/process-data.py", "copies": "1", "size": "1564", "license": "apache-2.0", "hash": 8251940224899189000, "line_mean": 27.962962963, "line_max": 88, "alpha_frac": 0.6227621483, "autogenerated": false, "ratio": 3.842751842751843,...
__author__ = 'cirreth' from libs import ownet from plugins.SHomePlugin import SHomePlugin import json import logging class OneWirePlugin(SHomePlugin): #static _READ_ATTEMPTS_COUNT = 3 # _host = None _port = None _connection = None def __init__(self, parameters): self._host = par...
{ "repo_name": "Cirreth/shome", "path": "plugins/onewire/OneWirePlugin.py", "copies": "1", "size": "1965", "license": "mit", "hash": -4570186932667019000, "line_mean": 31.7666666667, "line_max": 122, "alpha_frac": 0.5745547074, "autogenerated": false, "ratio": 4.128151260504202, "config_test": f...
__author__ = 'cirreth' from plugins.SHomePlugin import SHomePlugin import logging import json import pymysql class DatabasePlugin(SHomePlugin): _host = None _login = None _password = None _database = None _connection = None _cursor = None def __init__(self, params): self._host ...
{ "repo_name": "Cirreth/shome", "path": "plugins/database/DatabasePlugin.py", "copies": "1", "size": "1515", "license": "mit", "hash": 3594354991446144500, "line_mean": 29.3, "line_max": 119, "alpha_frac": 0.6184818482, "autogenerated": false, "ratio": 4.243697478991597, "config_test": false, ...
__author__ = 'cirreth' import logging from core.entities.Scenario import Scenario class ActionProcessor: def __init__(self, load_stored=True): if load_stored: self._scenarios = {scenario.name: scenario for scenario in Scenario.get_all()} else: self._scenarios = {} de...
{ "repo_name": "Cirreth/shome", "path": "core/ActionProcessor.py", "copies": "1", "size": "1867", "license": "mit", "hash": 4147560557571044000, "line_mean": 36.36, "line_max": 107, "alpha_frac": 0.6518478843, "autogenerated": false, "ratio": 4.520581113801453, "config_test": false, "has_no_ke...
__author__ = 'cirreth' import logging import time from plugins.SHomePlugin import SHomePlugin from libs.ledstrip import * class LedStripPlugin(SHomePlugin): _ledstrip = None _cur_r=0 _cur_g=0 _cur_b=0 def __init__(self, parameters): self._ledstrip = RGB() def call(s...
{ "repo_name": "Cirreth/shome", "path": "plugins/ledstrip/LedStripPlugin.py", "copies": "1", "size": "1955", "license": "mit", "hash": -518975058909406500, "line_mean": 28.546875, "line_max": 110, "alpha_frac": 0.4987212276, "autogenerated": false, "ratio": 3.417832167832168, "config_test": fals...
__author__ = 'civic' from serial import Serial import time from datetime import ( datetime, timedelta ) import serial import math from .msg import ( AlarmSetting, StopButton, TemperatureUnit, ToneSet, WorkStatus, RequestMessage, ResponseMessage, InitRequest, InitResponse, ...
{ "repo_name": "civic/elitech-datareader", "path": "elitech/__init__.py", "copies": "1", "size": "8950", "license": "mit", "hash": -2347113941363696000, "line_mean": 27.4126984127, "line_max": 136, "alpha_frac": 0.5037988827, "autogenerated": false, "ratio": 3.9973202322465387, "config_test": fa...
__author__ = 'civil' import tkinter as tk import matplotlib from tkinter import Tk, Menu, Toplevel, Button from tkinter.filedialog import askopenfilename, asksaveasfile from tkinter.messagebox import showerror def donothing(): filewin = Toplevel(root) button = Button(filewin, text="Do nothing button") but...
{ "repo_name": "saintdragon2/python-3-lecture-2015", "path": "civil-final/1st_presentation/4조/civil0531.py", "copies": "1", "size": "2834", "license": "mit", "hash": 4940356245414173000, "line_mean": 30.1538461538, "line_max": 91, "alpha_frac": 0.6570218772, "autogenerated": false, "ratio": 3.2953...
__author__ = 'CJeon' """ clothing attributes를 효율적으로 관리하는 class """ class clothing_data(object): def __init__(self, attribute_list): self.attributes = attribute_list def __repr__(self): # to support print # when called, it will print all the attributes. return str(self.get_att...
{ "repo_name": "adobecs5/urp2015", "path": "classes/clothing_data_class.py", "copies": "1", "size": "2582", "license": "apache-2.0", "hash": 843323254173984000, "line_mean": 39.03125, "line_max": 83, "alpha_frac": 0.5846994536, "autogenerated": false, "ratio": 3.9659442724458205, "config_test": ...
import itertools import time from operator import mul start_time = time.time() # Return all 6-digit permutations meeting AB-CD=EF, output as (EF, (A,B,C,D,E,F)) perm_1 = sc.parallelize(list(itertools.permutations([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 6)))\ .filter(lambda x : x[0] > 0 and x[2] > 0 and x[4] >0)\ .fi...
{ "repo_name": "dng8888/ABCDEFGHPPP", "path": "spark-python-smartbruteforce/abcdefghppp.py", "copies": "4", "size": "1849", "license": "mit", "hash": 4119717318074119000, "line_mean": 39.1956521739, "line_max": 157, "alpha_frac": 0.6122228231, "autogenerated": false, "ratio": 2.4752342704149934, ...
__author__ = 'cjm' import logging import requests from subprocess import call from scigraph.renderers.Renderer import Renderer from graphviz import Digraph # TODO: different implementations for different types def safe(s): return s.replace(":","") def apply_styles(graph, styles): graph.graph_attr.update( ...
{ "repo_name": "SciGraph/py-SciGraph", "path": "scigraph/renderers/GraphVizRenderer.py", "copies": "1", "size": "2552", "license": "apache-2.0", "hash": -8696371646109301000, "line_mean": 23.0754716981, "line_max": 72, "alpha_frac": 0.4905956113, "autogenerated": false, "ratio": 3.7419354838709675...
__author__ = 'cjm' import logging import requests from scigraph.model.BBOPGraph import * from scigraph.model.Concept import * from scigraph.model.EntityAnnotationResults import * # TODO: modularize into vocab/graph/etc? class SciGraph: """ foo """ def __init__(self, url=None): if url is not...
{ "repo_name": "SciGraph/py-SciGraph", "path": "scigraph/api/SciGraph.py", "copies": "1", "size": "2122", "license": "apache-2.0", "hash": 93287713574919380, "line_mean": 33.2258064516, "line_max": 123, "alpha_frac": 0.6055607917, "autogenerated": false, "ratio": 3.696864111498258, "config_test"...
__author__ = 'cjm' import logging import requests # TODO: consider an external model class BBOPGraph: """ foo """ nodemap = {} def __init__(self, obj={}): self.nodes = [] self.edges = [] self.add_json_graph(obj) return def add_json_graph(self, obj={}): ...
{ "repo_name": "SciGraph/py-SciGraph", "path": "scigraph/model/BBOPGraph.py", "copies": "1", "size": "2554", "license": "apache-2.0", "hash": -8387259188252382000, "line_mean": 23.5576923077, "line_max": 69, "alpha_frac": 0.4960845732, "autogenerated": false, "ratio": 3.587078651685393, "config_...
__author__ = 'cjoakim' from .constants import Constants class Distance(object): def __init__(self, dist=0.0, uom=Constants.uom_miles()): self.value = float(dist) self.uom = self.unit_of_measure(uom) def unit_of_measure(self, s): u = str(s).strip().lower() if u == 'k': ...
{ "repo_name": "cjoakim/m26-py", "path": "m26/distance.py", "copies": "1", "size": "2226", "license": "mit", "hash": -2812487091825601500, "line_mean": 30.3521126761, "line_max": 74, "alpha_frac": 0.5759209344, "autogenerated": false, "ratio": 3.5903225806451613, "config_test": false, "has_no_...
__author__ = 'cjoakim' from .distance import Distance from .elapsed_time import ElapsedTime from .speed import Speed class RunWalkCalculator(object): @classmethod def calculate(cls, run_hhmmss, run_ppm, walk_hhmmss, walk_ppm, miles): result = dict() result['run_hhmmss'] = run_hhmmss ...
{ "repo_name": "cjoakim/m26-py", "path": "m26/run_walk_calculator.py", "copies": "1", "size": "1653", "license": "mit", "hash": -2439331850620752400, "line_mean": 36.5681818182, "line_max": 74, "alpha_frac": 0.5940713854, "autogenerated": false, "ratio": 3.306, "config_test": false, "has_no_ke...
__author__ = 'cjoakim' import math from .elapsed_time import ElapsedTime class Speed(object): def __init__(self, d, et): self.dist = d # an instance of Distance self.etime = et # an instance of ElapsedTime def mph(self): return self.dist.as_miles() / self.etime.hours() def...
{ "repo_name": "cjoakim/m26-py", "path": "m26/speed.py", "copies": "1", "size": "1808", "license": "mit", "hash": 7663225684585853000, "line_mean": 28.1612903226, "line_max": 79, "alpha_frac": 0.5508849558, "autogenerated": false, "ratio": 3.1334488734835357, "config_test": false, "has_no_keyw...
__author__ = 'cjoakim' import math from numbers import Number from .constants import Constants class ElapsedTime(object): def __init__(self, val): self.secs = 0 self.hh = 0 self.mm = 0 self.ss = 0 if not val: val = 0 if isinstance(val, Number): ...
{ "repo_name": "cjoakim/m26-py", "path": "m26/elapsed_time.py", "copies": "1", "size": "2100", "license": "mit", "hash": 5164572181177640000, "line_mean": 27.3783783784, "line_max": 68, "alpha_frac": 0.5123809524, "autogenerated": false, "ratio": 3.3870967741935485, "config_test": false, "has_...
__author__ = 'cjoakim' class Age(object): """ Instances of this class represent the age of a person, as a float value of their age in years. """ def __init__(self, n=0.0): self.value = float(n) def max_pulse(self): if self.value < 20: return 200.0 else: ...
{ "repo_name": "cjoakim/m26-py", "path": "m26/age.py", "copies": "1", "size": "1171", "license": "mit", "hash": 1222010966062210600, "line_mean": 26.880952381, "line_max": 75, "alpha_frac": 0.5328778822, "autogenerated": false, "ratio": 3.753205128205128, "config_test": false, "has_no_keywords...
__author__ = 'ckinsey' import re class StacheTag(object): """ Represents a parsed StacheTag """ def __init__(self, stachetag, *args, **kwargs): """ Takes a textual stachetag and turns it into a bonafide StacheTag """ # Ensure the authenticity of the stachetag ...
{ "repo_name": "heapsortjobs/python-stachetag", "path": "stachetag/__init__.py", "copies": "1", "size": "2335", "license": "mit", "hash": 1220149922693318700, "line_mean": 27.1325301205, "line_max": 110, "alpha_frac": 0.5841541756, "autogenerated": false, "ratio": 3.7240829346092506, "config_tes...
__author__ = 'ck' import csv import os import sys import json import requests from requests.auth import HTTPBasicAuth bintray_api_root = "https://bintray.com/api/v1" def read_prop_file(f): return dict([(row[0].strip(), row[1].strip()) for row in csv.reader(open(f, 'r'), delimiter='=')]) def create_package(re...
{ "repo_name": "hmrc/kickstarters", "path": "init-repository.py", "copies": "2", "size": "2353", "license": "apache-2.0", "hash": -1282165705763419000, "line_mean": 28.049382716, "line_max": 118, "alpha_frac": 0.6417339567, "autogenerated": false, "ratio": 3.4705014749262535, "config_test": fals...
__author__ = 'clarkg1' import time from optparse import OptionParser from top.render import Renderer from prof.parse import ProfileLog if __name__ == '__main__': parser = OptionParser() parser.add_option('-f', '--file', dest='file', metavar='LOGFILE', help='target file (normally "/path/to/prof.log")', default...
{ "repo_name": "cubic1271/pybrof", "path": "top.py", "copies": "1", "size": "1038", "license": "mit", "hash": -3779611215902435300, "line_mean": 33.6, "line_max": 162, "alpha_frac": 0.6069364162, "autogenerated": false, "ratio": 4.119047619047619, "config_test": false, "has_no_keywords": false...
__author__ = 'clarkg1' import json import os import sh import shutil import sys import threading import time import uuid # TODO: Violating DRY because I'm too lazy to think about how to do this better ... :/ class OptionsEnabled: PSUTIL_ENABLED = False MAKO_ENABLED = False def import_error(item): print ...
{ "repo_name": "cubic1271/pybrig", "path": "bro/benchmark/info/trial.py", "copies": "1", "size": "4449", "license": "bsd-3-clause", "hash": -2244199212615908900, "line_mean": 29.4726027397, "line_max": 121, "alpha_frac": 0.6122724208, "autogenerated": false, "ratio": 3.628874388254486, "config_t...
__author__ = 'clarkmatthew' from prettytable import PrettyTable from colorama import Fore, init from subprocess import Popen, PIPE import re cmd_string = 'euca-describe-images --show-empty-fields -h' cmd = cmd_string.split() p = Popen(cmd, stdout=PIPE) p_out, p_err = p.communicate() if p.returncode: print str...
{ "repo_name": "bigschwan/simplecli", "path": "menutree/euca2ools/euca2ools_command.py", "copies": "2", "size": "1136", "license": "mit", "hash": 7695601673091688000, "line_mean": 21.2745098039, "line_max": 83, "alpha_frac": 0.5845070423, "autogenerated": false, "ratio": 3.2364672364672367, "con...
__author__ = 'clarkmatthew' from simplecli.basemenu import BaseMenu, CliError from subprocess import Popen, PIPE import os import glob class pkg_mgr(object): def info(self, pkg): raise NotImplementedError() def install(self, pkg): raise NotImplementedError() def uninstall(self, pkg): ...
{ "repo_name": "bigschwan/simplecli", "path": "menutree/euca2ools/euca2oolsbase.py", "copies": "2", "size": "2364", "license": "mit", "hash": 6238456592523856000, "line_mean": 24.6956521739, "line_max": 119, "alpha_frac": 0.5638747885, "autogenerated": false, "ratio": 3.4867256637168142, "config...
import json class Namespace(object): """ Convert dict (if provided) into attributes and return a somewhat generic object """ def __init__(self, newdict=None): if newdict: for key in newdict: value = newdict[key] try: if isinst...
{ "repo_name": "tbeckham/DeploymentManager", "path": "config_manager/namespace.py", "copies": "3", "size": "1031", "license": "apache-2.0", "hash": 8788768164762655000, "line_mean": 30.2424242424, "line_max": 78, "alpha_frac": 0.3860329777, "autogenerated": false, "ratio": 5.129353233830845, "co...
__author__ = 'clarkmatthew' try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup import simplecli setup(name = "simplecli", version = simplecli.__version__, description = "CLI framework and utilities for a " "Hybrid Eucalyptus C...
{ "repo_name": "nephomaniac/simplecli", "path": "setup.py", "copies": "2", "size": "1067", "license": "mit", "hash": -231561721902276260, "line_mean": 35.7931034483, "line_max": 67, "alpha_frac": 0.5716963449, "autogenerated": false, "ratio": 4.445833333333334, "config_test": false, "has_no_ke...
__author__ = 'ClarkWong' from app import db, api from flask.ext.restful import reqparse, abort, Resource, fields, marshal_with, marshal from models import User user_fields = { 'id' : fields.Integer, 'name' : fields.String, 'password' : fields.String, 'privilege' : fields.Integer, 'description' : ...
{ "repo_name": "njuwangchen/TRMSdemo", "path": "app/views.py", "copies": "1", "size": "2977", "license": "mit", "hash": 4194409517529127000, "line_mean": 33.2183908046, "line_max": 87, "alpha_frac": 0.5975814578, "autogenerated": false, "ratio": 3.6889714993804215, "config_test": false, "has_n...
__author__ = 'Claude' from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from Web.views import is_admin from Web.models import CreateApplication from Web.models import DeleteApplication from Web.models import PortApplication from Web.models import OperationRecord ...
{ "repo_name": "ClaudeZoo/iDashBoardWeb", "path": "Web/application_views.py", "copies": "2", "size": "1389", "license": "unlicense", "hash": 4963300685352538000, "line_mean": 41.0909090909, "line_max": 86, "alpha_frac": 0.7717782577, "autogenerated": false, "ratio": 4.30030959752322, "config_tes...
__author__ = 'Claude' from django.utils import timezone from django.shortcuts import HttpResponse from django.core.exceptions import ObjectDoesNotExist from Web.models import VM from Web.models import MachineInfo from Web.models import CreateApplication from Web.models import DeleteApplication def handle_notification...
{ "repo_name": "ClaudeZoo/iDashBoardWeb", "path": "Web/notification.py", "copies": "2", "size": "1685", "license": "unlicense", "hash": 8508097473920156000, "line_mean": 47.1714285714, "line_max": 125, "alpha_frac": 0.6338278932, "autogenerated": false, "ratio": 4.2125, "config_test": false, "...
__author__ = 'Claude' import datetime import json from django.shortcuts import render from django.shortcuts import HttpResponse from django.shortcuts import HttpResponseRedirect from django.contrib.auth.decorators import login_required from Web.models import VM from Web.models import Host @login_required def refresh_...
{ "repo_name": "littlepig2013/iDashBoardWeb", "path": "Web/vm_views.py", "copies": "2", "size": "4180", "license": "unlicense", "hash": 2763241019495619000, "line_mean": 32.44, "line_max": 101, "alpha_frac": 0.5476076555, "autogenerated": false, "ratio": 3.3682514101531025, "config_test": false,...
__author__ = 'Claude' import json from django.shortcuts import HttpResponse from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from Web.views import is_admin from Web.models import CreateApplication from Web.models import DeleteApplication from Web.models import Po...
{ "repo_name": "ClaudeZoo/iDashBoardWeb", "path": "Web/audit_views.py", "copies": "2", "size": "3890", "license": "unlicense", "hash": 1983228150465842400, "line_mean": 31.9745762712, "line_max": 79, "alpha_frac": 0.7151670951, "autogenerated": false, "ratio": 4.052083333333333, "config_test": f...
__author__ = 'Claude' import json from django.shortcuts import HttpResponse from django.shortcuts import render_to_response from django.shortcuts import HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from Web.models import Host from W...
{ "repo_name": "ClaudeZoo/iDashBoardWeb", "path": "Web/create_vm_views.py", "copies": "2", "size": "2975", "license": "unlicense", "hash": 7199266943134210000, "line_mean": 40.9014084507, "line_max": 117, "alpha_frac": 0.5757983193, "autogenerated": false, "ratio": 4.407407407407407, "config_tes...
__author__ = 'Claude' import json from django.shortcuts import render_to_response from django.shortcuts import HttpResponse from django.contrib.auth.decorators import login_required from Web.views import is_admin from Web.models import MachineInfo @login_required def detail_view(request): is_administer = is_admin...
{ "repo_name": "littlepig2013/iDashBoardWeb", "path": "Web/detail_views.py", "copies": "2", "size": "2213", "license": "unlicense", "hash": 5237553236311738000, "line_mean": 38.5178571429, "line_max": 78, "alpha_frac": 0.4993221871, "autogenerated": false, "ratio": 4.016333938294011, "config_tes...
__author__ = 'Claude' import json from django.utils import timezone from django.shortcuts import HttpResponse from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from Web.models import Host from Web.models import VM from Web.models import PortApplication from ...
{ "repo_name": "littlepig2013/iDashBoardWeb", "path": "Web/nat_views.py", "copies": "2", "size": "2872", "license": "unlicense", "hash": -9195149607707513000, "line_mean": 40.0285714286, "line_max": 119, "alpha_frac": 0.6368384401, "autogenerated": false, "ratio": 4.085348506401138, "config_test...
__author__ = 'claudia' from config import wmata from math import hypot from multiprocessing import Pool def f_range(mini, maxi, step): while mini < maxi: yield mini mini += step class DistanceCalculations: def __init__(self, lat1, lat2, lon1, lon2, res): self.lat1, self.lat2 = lat1, la...
{ "repo_name": "fwilson42/dchacks2015", "path": "scripts/algo-old.py", "copies": "1", "size": "3267", "license": "mit", "hash": 5613251609260047000, "line_mean": 28.9816513761, "line_max": 86, "alpha_frac": 0.595959596, "autogenerated": false, "ratio": 3.0390697674418603, "config_test": false, ...
__author__ = 'claudia' from config import wmata import json data = { "metrobus": [], "metrorail": [] } for line in wmata.lines.all: for staa in wmata.lines[line].stations: if line == 'RD': headway = 4.5 elif line == 'BL': headway = 12 else: headwa...
{ "repo_name": "fwilson42/dchacks2015", "path": "scripts/algo.py", "copies": "1", "size": "1155", "license": "mit", "hash": -8533517890982304000, "line_mean": 24.6888888889, "line_max": 58, "alpha_frac": 0.5194805195, "autogenerated": false, "ratio": 3.1385869565217392, "config_test": false, "...
__author__ = 'claudia' import markovmodels as mm import re import string #from bs4 import BeautifulSoup #import requests data = mm.db data.connect() data.create_tables([mm.Subject, mm.Word, mm.WordLink]) print("created tables") #def import_wiki(url): # file_orig = open("temp_orig.txt", 'w') # file_x = open("t...
{ "repo_name": "laudiacay/noteorious", "path": "src/buildmarkov.py", "copies": "1", "size": "2154", "license": "mit", "hash": 1687796155896059000, "line_mean": 27.3421052632, "line_max": 106, "alpha_frac": 0.5849582173, "autogenerated": false, "ratio": 2.9751381215469612, "config_test": false, ...
__author__ = 'Claudio' import YamlHandler class HTMLBuilder(YamlHandler.YamlHandler): """ The HTML Builder handles the skeleton """ def __init__(self, path, file): YamlHandler.YamlHandler.__init__(self, path, file) self.__store_skeleton() self.init = False if self.skeleton:...
{ "repo_name": "claudiordgz/AdGenerator", "path": "src/BuilderManager/Agents/HTMLBuilderAgent.py", "copies": "1", "size": "1443", "license": "apache-2.0", "hash": 3650683319300001000, "line_mean": 31.8181818182, "line_max": 102, "alpha_frac": 0.6146916147, "autogenerated": false, "ratio": 3.964285...
__author__ = 'Claudio' import yaml class ConnectionHandler(object): """ The Connection Handler must handle all the I/O operations to the User Communications model. """ def __init__(self): self.modify_lst = list() self.flags = dict() self.__modify_model = { 'ftp' : self.__mo...
{ "repo_name": "claudiordgz/AdGenerator", "path": "src/Connection/ConnectionModelHandler.py", "copies": "1", "size": "2925", "license": "apache-2.0", "hash": -5160311608951619000, "line_mean": 31.1538461538, "line_max": 75, "alpha_frac": 0.544957265, "autogenerated": false, "ratio": 3.693181818181...
__author__ = 'Claudio' """ In our implementation of thescale function (page 25), the body of the loop executes the command data[j] = factor. Wehave discussed that numeric types are immutable, and that use of the = operator in this context causes the creation of a new instance (not the mutation of an existing instance)...
{ "repo_name": "claudiordgz/GoodrichTamassiaGoldwasser", "path": "ch01/c116c1117.py", "copies": "1", "size": "6895", "license": "mit", "hash": -3282859988457104000, "line_mean": 45.2818791946, "line_max": 99, "alpha_frac": 0.5444525018, "autogenerated": false, "ratio": 3.4876074860900355, "confi...
__author__ = "ClaytonBat" class Node: def __init__(self,initdata): self.data = initdata self.next = None def getData(self): return self.data def getNext(self): return self.next def setData(self,newdata): self.data = newdata def setNext(self,newnext): ...
{ "repo_name": "mcsoo/Exercises", "path": "Lists.py", "copies": "1", "size": "1928", "license": "mit", "hash": -2544061640521459000, "line_mean": 20.1978021978, "line_max": 47, "alpha_frac": 0.5248962656, "autogenerated": false, "ratio": 3.9266802443991855, "config_test": false, "has_no_keywor...
__author__ = 'Clayton Daley' import logging logging.basicConfig(level=logging.DEBUG) log = logging.getLogger("twisted-pyro.tests_manual") log.info("Loading Application") import pyro.protocol from Pyro4.socketutil import getInterfaceAddress class Foo(object): def ping(self): log.info("Foo was pinged!!!")...
{ "repo_name": "claytondaley/TxPyro", "path": "tests/tests_manual_protocol.py", "copies": "1", "size": "1173", "license": "apache-2.0", "hash": 8666788946730633000, "line_mean": 27.6341463415, "line_max": 71, "alpha_frac": 0.7186700767, "autogenerated": false, "ratio": 3.2493074792243766, "confi...
__author__ = 'Clayton Daley' import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger("test_pyro") log.info("Logger started") import pyro.proxy import Pyro4 import Pyro4.futures from pprint import pprint, pformat from twisted.internet import reactor import twisted.internet.defer uri = "PYRONAM...
{ "repo_name": "claytondaley/TxPyro", "path": "tests/tests_manual_proxy.py", "copies": "1", "size": "1919", "license": "apache-2.0", "hash": -4392532440357881300, "line_mean": 34.5555555556, "line_max": 289, "alpha_frac": 0.73736321, "autogenerated": false, "ratio": 3.219798657718121, "config_te...
__author__ = 'clh' import requests import boto # Config # required github_api_token = 'Your Github API Token' #limit the search scope to your user account, or organization. search_username = 'YourUserName or Org Name' # optional, but you should have at least one of these. aws_key_report_file = './aws_key_report.csv'...
{ "repo_name": "codyhanson/github_cred_check", "path": "github_cred_check.py", "copies": "1", "size": "2314", "license": "mit", "hash": -6179744931384365000, "line_mean": 33.0441176471, "line_max": 107, "alpha_frac": 0.6253241141, "autogenerated": false, "ratio": 3.5007564296520424, "config_test...
from flask import Flask, jsonify, abort, make_response, request, url_for from flask_cors import CORS from flask_mongoengine import MongoEngine import datetime app = Flask(__name__) CORS(app, resources=r'/api/*', headers='Content-Type') # app.config['CORS_HEADERS'] = 'Content-Type' app.config['MONGODB_SETTINGS'] = {'...
{ "repo_name": "OfficeLunch/OfficeLunch", "path": "officelunch_api/rest_api.py", "copies": "1", "size": "16551", "license": "mit", "hash": 7034252528209153000, "line_mean": 30.2873345936, "line_max": 173, "alpha_frac": 0.6316234669, "autogenerated": false, "ratio": 3.447406790252031, "config_tes...
__author__ = 'clipo' import csv import argparse import logging as logger import operator import itertools import os import networkx as nx import networkx.algorithms.isomorphism as iso from pylab import * import matplotlib.pyplot as plt import matplotlib.mlab as mlab from networkx.algorithms.isomorphism.isomorph i...
{ "repo_name": "mmadsen/characterstate-network", "path": "buildCharacterstateNetwork.py", "copies": "1", "size": "12003", "license": "apache-2.0", "hash": 2763904985399182000, "line_mean": 39.5540540541, "line_max": 154, "alpha_frac": 0.5799383487, "autogenerated": false, "ratio": 3.67401285583103...
__author__ = 'clobo' from collections import namedtuple #! from pyperform import ComparisonBenchmark MyNamedTuple = namedtuple('ButtonStatus', ('name', 'age', 'gender')) #! class MyClass(object): #! __slots__ = ('name', 'age', 'gender') def __init__(self, name, age, gender): self.name = name ...
{ "repo_name": "lobocv/pyperform", "path": "examples/dict_vs_class_vs_namedtuple.py", "copies": "1", "size": "1721", "license": "mit", "hash": -5709625545324312000, "line_mean": 24.3088235294, "line_max": 72, "alpha_frac": 0.5258570598, "autogenerated": false, "ratio": 3.677350427350427, "config...
__author__ = 'clobo' import logging class CustomLogLevel(object): def __init__(self, level, name, logger_name=None): self.level = level self.name = name self.logger_name = logger_name if logger_name is None: self.logger = logging.getLogger() else: ...
{ "repo_name": "lobocv/pyperform", "path": "pyperform/customlogger.py", "copies": "1", "size": "2485", "license": "mit", "hash": 6387122239963750000, "line_mean": 30.0625, "line_max": 105, "alpha_frac": 0.6201207243, "autogenerated": false, "ratio": 3.894984326018809, "config_test": false, "ha...
__author__ = 'cmantas' _author__ = 'cmantas' from Node import Node from VM import get_all_vms from json import loads, dumps from os import remove from os.path import isfile from lib.persistance_module import get_script_text, env_vars from lib.tiramola_logging import get_logger from threading import Thread from lib.Clus...
{ "repo_name": "cmantas/tiramola_v3", "path": "ClientsCluster.py", "copies": "1", "size": "8124", "license": "apache-2.0", "hash": 3529025877205748700, "line_mean": 36.4377880184, "line_max": 135, "alpha_frac": 0.5738552437, "autogenerated": false, "ratio": 3.742054352832796, "config_test": fals...
__author__ = 'cmantas' from CassandraNode import CassandraNode as Node, get_script_text from CassandraNode import get_all_nodes from VM import Timer, get_all_vms from time import sleep from json import loads, dumps from os import remove from os.path import isfile orchestrator = None seeds = [] # the seed node(s)...
{ "repo_name": "cmantas/cluster_python_tool", "path": "CassandraCluster.py", "copies": "1", "size": "6930", "license": "apache-2.0", "hash": -6097949900996507000, "line_mean": 28.6153846154, "line_max": 114, "alpha_frac": 0.6349206349, "autogenerated": false, "ratio": 3.3397590361445784, "config...
__author__ = 'cmantas' from kamaki.clients import ClientError from kamaki.clients.astakos import AstakosClient from kamaki.clients.astakos import getLogger from kamaki.clients.cyclades import CycladesClient, CycladesNetworkClient #http://www.synnefo.org/docs/kamaki/latest/developers/code.html#the-client-api-ref from sy...
{ "repo_name": "cmantas/tiramola_v3", "path": "lib/connector_okeanos.py", "copies": "1", "size": "3840", "license": "apache-2.0", "hash": -2107679832938864600, "line_mean": 30.7355371901, "line_max": 107, "alpha_frac": 0.653125, "autogenerated": false, "ratio": 3.194675540765391, "config_test": ...
__author__ = 'cmantas' from kamaki.clients import ClientError from kamaki.clients.astakos import AstakosClient from kamaki.clients.astakos import getLogger #not working fuck yeah # okeanos bullshit #from kamaki.clients.astakos import CachedAstakosClient as AstakosClient from kamaki.clients.cyclades import CycladesCli...
{ "repo_name": "cmantas/cluster_python_tool", "path": "lib/connector_okeanos.py", "copies": "1", "size": "3683", "license": "apache-2.0", "hash": -2739490330299988000, "line_mean": 30.2118644068, "line_max": 107, "alpha_frac": 0.6679337497, "autogenerated": false, "ratio": 3.1586620926243567, "c...
__author__ = 'cmantas' from lib.tiramola_logging import get_logger from multiprocessing import Process from lib.persistance_module import get_script_text, home, env_vars class Cluster(object): # the logger for this file log = get_logger('CLUSTER', 'DEBUG', logfile=home+'files/logs/Coordinator.log') def _...
{ "repo_name": "cmantas/tiramola_v3", "path": "lib/Cluster.py", "copies": "1", "size": "4957", "license": "apache-2.0", "hash": -8607584156181632000, "line_mean": 30.7820512821, "line_max": 105, "alpha_frac": 0.5757514626, "autogenerated": false, "ratio": 4.056464811783961, "config_test": false,...
__author__ = 'cmantas' from Node import Node from VM import Timer from json import loads, dumps from os import remove from os.path import isfile from lib.persistance_module import get_script_text, env_vars from lib.tiramola_logging import get_logger from multiprocessing import Process from lib.Cluster import Cluster ...
{ "repo_name": "cmantas/tiramola_v3", "path": "CassandraCluster.py", "copies": "1", "size": "10124", "license": "apache-2.0", "hash": -190637696955258660, "line_mean": 28.7764705882, "line_max": 117, "alpha_frac": 0.6174436981, "autogenerated": false, "ratio": 3.5710758377425043, "config_test": ...
__author__ = 'cmantas' from sqlite3 import connect from tools import myplot, show from ConsoleBackend import ConsoleBackend import traceback class SQLiteBackend(ConsoleBackend): def __init__(self, sql_file): self.file=sql_file self.connection = connect(self.file) self.cursor = self.connecti...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/monitoring/lib/SQLiteBackend.py", "copies": "1", "size": "2352", "license": "apache-2.0", "hash": 5019332883007767000, "line_mean": 28.4, "line_max": 85, "alpha_frac": 0.5824829932, "autogenerated": false, "ratio": 4.048192771084337,...
__author__ = 'cmantas' from sys import stderr from os.path import exists from os import mkdir from scp_utils import * import ntpath import thread from lib.persistance_module import env_vars #choose the IaaS provider infrastructure = env_vars['iaas'] if infrastructure == 'okeanos': from lib import connector_okeanos...
{ "repo_name": "cmantas/cluster_python_tool", "path": "VM.py", "copies": "1", "size": "9679", "license": "apache-2.0", "hash": -4126158221563864000, "line_mean": 31.3745819398, "line_max": 132, "alpha_frac": 0.5366256845, "autogenerated": false, "ratio": 3.6732447817836813, "config_test": false,...
__author__ = 'cmantas' from sys import stderr from os.path import exists from os import mkdir, remove, makedirs from time import time, sleep import ntpath import thread from lib.scp_utils import * from lib.persistance_module import env_vars, home from lib.tiramola_logging import get_logger #choose the IaaS provider ...
{ "repo_name": "cmantas/tiramola_v3", "path": "VM.py", "copies": "1", "size": "10280", "license": "apache-2.0", "hash": -6994011133846125000, "line_mean": 31.128125, "line_max": 124, "alpha_frac": 0.5402723735, "autogenerated": false, "ratio": 3.7273386511965194, "config_test": false, "has_no_...
__author__ = 'cmantas' from time import sleep import CassandraCluster as Servers from ClientsCluster import my_Clients as Clients from lib.persistance_module import env_vars, home from Monitoring import MonitorVms from new_decision_module import RLDecisionMaker as DM from lib.tiramola_logging import get_logger from tim...
{ "repo_name": "cmantas/tiramola_v3", "path": "Coordinator.py", "copies": "1", "size": "7202", "license": "apache-2.0", "hash": 7686149717960657000, "line_mean": 33.4593301435, "line_max": 148, "alpha_frac": 0.655234657, "autogenerated": false, "ratio": 4.059751972942503, "config_test": false, ...
__author__ = 'cmantas' from tools import * from json import loads ms = take_single("select metrics from mahout_kmeans_text where k=15 and documents=90300 and dimensions=53235;")[0] mj = loads(ms) cols = iter(["#727272", '#f1595f', '#79c36a', '#599ad3', '#f9a65a','#9e66ab','#cd7058', '#d77fb3']) def timeline2vaslue...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/experiments/depricated/handler/metrics.py", "copies": "1", "size": "1434", "license": "apache-2.0", "hash": -2237060242500615200, "line_mean": 25.0909090909, "line_max": 115, "alpha_frac": 0.6164574616, "autogenerated": false, "ratio...
__author__ = 'cmantas' from tools import * def draw_kmeans_forDF(engine, minDF, list_k= [5,10,15,20]): for k in list_k: draw_single_kmeans(engine, k, minDF, title=engine.title()+" K-means (minDF={})".format(minDF), hide_minDF=True) def draw_kmeans_forK(engine, k, list_minDF= [10,60,110,160]): for minD...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/experiments/depricated/handler/draw_kmeans_experiments.py", "copies": "1", "size": "1524", "license": "apache-2.0", "hash": 5589209333649970000, "line_mean": 22.1060606061, "line_max": 186, "alpha_frac": 0.6509186352, "autogenerated": ...
__author__ = 'cmantas' from tools import * def draw_single_move(frome, toe, minDf, **kwargs): if frome == "weka": table='arff2'+toe elif toe == "weka": table=frome+'2arff' else: table=frome+"2"+toe tfidf_table= frome+"_tfidf" query = join_query({'table':table, 'tfidf_table'...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/experiments/depricated/handler/draw_movers.py", "copies": "1", "size": "2135", "license": "apache-2.0", "hash": 8377254932109308000, "line_mean": 35.186440678, "line_max": 165, "alpha_frac": 0.631381733, "autogenerated": false, "rati...
__author__ = 'cmantas' import datetime from ConsoleBackend import ConsoleBackend from lib.tools import myplot, show, mycast from pymongo import MongoClient def cast_dict(a): """ given a dictionary of string-->string, it creates another dictionary with the same keys and the casted values of the original...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/monitoring/lib/MongoBackend.py", "copies": "1", "size": "3929", "license": "apache-2.0", "hash": -3791131042456369700, "line_mean": 29.6953125, "line_max": 116, "alpha_frac": 0.6105879359, "autogenerated": false, "ratio": 4.140147523...
__author__ = 'cmantas' import matplotlib.pyplot as plt from ast import literal_eval from time import time, sleep from json import load, dumps from os.path import isfile try: plt.style.use('fivethirtyeight') except: # print "You could get prettier graphs with matplotlib > 1.4" pass from matplotlib.pyplot ...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/monitoring/lib/tools.py", "copies": "1", "size": "2356", "license": "apache-2.0", "hash": -8779479438703075000, "line_mean": 27.0476190476, "line_max": 113, "alpha_frac": 0.6213921902, "autogenerated": false, "ratio": 3.7877813504823...
__author__ = 'cmantas' import sys from CassandraCluster import * args = sys.argv if args[1] == "load_data": record_count = int(args[2]) print "CLI: Loading %d records in the cluster" % record_count run_load_phase(record_count) elif args[1] == "run_sinusoid": args = args[2:] for i in range(len(arg...
{ "repo_name": "cmantas/cluster_python_tool", "path": "cli.py", "copies": "1", "size": "1778", "license": "apache-2.0", "hash": -1967723078958664000, "line_mean": 30.75, "line_max": 110, "alpha_frac": 0.5478065242, "autogenerated": false, "ratio": 3.3931297709923665, "config_test": false, "has...
__author__ = 'cmantas' import sys from lib.tiramola_logging import get_logger from os import remove, mkdir from shutil import move raw_args = sys.argv args = dict() def parse_args(): chosen_function = raw_args[1] global args for arg in raw_args[2:]: i = arg.find("=") if i == -1: ...
{ "repo_name": "cmantas/tiramola_v3", "path": "cli.py", "copies": "1", "size": "7438", "license": "apache-2.0", "hash": 2393308565163120600, "line_mean": 24.8263888889, "line_max": 103, "alpha_frac": 0.6304114009, "autogenerated": false, "ratio": 3.6931479642502483, "config_test": false, "has_...
__author__ = 'cmantas' import traceback from lib.tiramola_logging import get_logger from os import remove, mkdir, listdir from shutil import move, copy from time import strftime from os.path import isdir, isfile, join, exists, basename from random import random from json import load, dumps, loads from lib.persistance_m...
{ "repo_name": "cmantas/tiramola_v3", "path": "Experiment.py", "copies": "1", "size": "8839", "license": "apache-2.0", "hash": -3012856640105823700, "line_mean": 29.9055944056, "line_max": 111, "alpha_frac": 0.5970132368, "autogenerated": false, "ratio": 3.974370503597122, "config_test": false, ...
__author__ = 'cmantas' filename = 'files/measurements/clean-metrics.txt' class Metric: def __init__(self, state, lamda, throughput, latency): self.state = int(round(float(state))) self.lamda = int(round(float(lamda))) self.throughput = int(round(float(throughput))) self.latency = ...
{ "repo_name": "cmantas/tiramola_v3", "path": "obsolete/process_training_set_test.py", "copies": "1", "size": "2952", "license": "apache-2.0", "hash": -6069783286410424000, "line_mean": 32.5568181818, "line_max": 128, "alpha_frac": 0.6629403794, "autogenerated": false, "ratio": 3.272727272727273, ...
__author__ = 'cmantas' from sklearn.preprocessing import LabelEncoder from pyspark.mllib.classification import LabeledPoint import joblib from sys import maxint input_fname = "/home/cmantas/Data/Result_W2V_IMR_New.csv" test1_fname = "/home/cmantas/Data/Result_W2V_IMR_test1.csv" wanted_lines = 100 def get_labels_f...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/spark/IMR_tools_old.py", "copies": "1", "size": "5394", "license": "apache-2.0", "hash": 2310007588811610600, "line_mean": 29.4745762712, "line_max": 114, "alpha_frac": 0.6492398962, "autogenerated": false, "ratio": 3.171075837742504...
__author__ = 'cmantas' from VM import VM, Timer, LOGS_DIR from VM import get_all_vms from lib.persistance_module import env_vars, get_script_text from lib.tiramola_logging import get_logger class Node (VM): """ Class that represents a node a cluster. extends VM """ def __init__(self, cluster_name=''...
{ "repo_name": "cmantas/tiramola_v3", "path": "Node.py", "copies": "1", "size": "5541", "license": "apache-2.0", "hash": -1703996145183386400, "line_mean": 35.94, "line_max": 136, "alpha_frac": 0.5746255189, "autogenerated": false, "ratio": 3.8399168399168397, "config_test": false, "has_no_key...
__author__ = 'cmantas' from VM import VM, Timer from VM import get_all_vms from lib.persistance_module import env_vars, get_script_text class CassandraNode: """ Class that represents a node in a cassandra cluster. Can be of type 'SEED' or 'REGULAR' (default) """ #static vars image = env_vars["cas...
{ "repo_name": "cmantas/cluster_python_tool", "path": "CassandraNode.py", "copies": "1", "size": "4457", "license": "apache-2.0", "hash": -7305861535435517000, "line_mean": 30.8357142857, "line_max": 101, "alpha_frac": 0.5611397801, "autogenerated": false, "ratio": 3.7611814345991563, "config_te...
__author__ = 'cmantas' import argparse from os import system parser = argparse.ArgumentParser(description='runs TF/IDF on a directory of text docs') # parser.add_argument("-o","--operation", help="Operation: Load or Save", required=True) parser.add_argument("-i","--input", help="the local input directory", require...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/spark/text_loader.py", "copies": "1", "size": "1405", "license": "apache-2.0", "hash": 6106496425426773000, "line_mean": 27.6734693878, "line_max": 100, "alpha_frac": 0.6775800712, "autogenerated": false, "ratio": 3.252314814814815, ...
__author__ = 'cmantas' import argparse parser = argparse.ArgumentParser(description='runs kmeans on spark for .csv files') parser.add_argument('operation', help='"train" or "classify"') parser.add_argument("-it","--iterations", help="the max iterations of the algorithm", type=int, default=3) parser.add_argument("-i", ...
{ "repo_name": "project-asap/IReS-Platform", "path": "asap-tools/spark/svm_spark.py", "copies": "1", "size": "3086", "license": "apache-2.0", "hash": -6986023773304116000, "line_mean": 33.2888888889, "line_max": 106, "alpha_frac": 0.6461438756, "autogenerated": false, "ratio": 3.65207100591716, ...
__author__ = 'cmantas' import logging, sys, logging.handlers configured_loggers = [] def get_logger(name, level='INFO', show_level=False, show_time=False, logfile=None): new_logger = logging.getLogger(name) #skip configuration if already configured if name in configured_loggers: return new_logge...
{ "repo_name": "cmantas/tiramola_v3", "path": "lib/tiramola_logging.py", "copies": "1", "size": "2296", "license": "apache-2.0", "hash": 7519820989774407000, "line_mean": 30.9027777778, "line_max": 88, "alpha_frac": 0.6781358885, "autogenerated": false, "ratio": 3.776315789473684, "config_test":...
__author__ = 'cmantas' #python ssh lib import paramiko import string import sys from socket import error as socketError sys.path.append('lib/scp.py') from lib.scp import SCPClient from datetime import datetime, timedelta from lib.persistance_module import env_vars, home from time import time import sys, traceback ssh...
{ "repo_name": "cmantas/tiramola_v3", "path": "lib/scp_utils.py", "copies": "1", "size": "3752", "license": "apache-2.0", "hash": 7833926596271534000, "line_mean": 28.5511811024, "line_max": 119, "alpha_frac": 0.6202025586, "autogenerated": false, "ratio": 3.667644183773216, "config_test": false...
__author__ = 'cmantas' #!/usr/bin/python # -*- coding: utf-8 -*- import sqlite3 as lite import sys, json from datetime import datetime from os import path home = path.dirname(path.realpath(__file__))+"/../" ENV_VARS_FILE = home+'files/env_vars.json' OPENSTACK_NAMES_FILE = home +'files/openstack_names.json' SCRIPTS_F...
{ "repo_name": "cmantas/tiramola_v3", "path": "lib/persistance_module.py", "copies": "1", "size": "1532", "license": "apache-2.0", "hash": -2887049403545663000, "line_mean": 25.8771929825, "line_max": 81, "alpha_frac": 0.6788511749, "autogenerated": false, "ratio": 3.1718426501035197, "config_te...
__author__ = 'cmantas' #!/usr/bin/python # -*- coding: utf-8 -*- import sqlite3 as lite import sys, json from datetime import datetime ENV_VARS_FILE = 'files/env_vars.json' OPENSTACK_NAMES_FILE = 'files/openstack_names.json' db_file = "files/persistance.db" #load the env vars from file env_vars = json.loads(open(...
{ "repo_name": "cmantas/cluster_python_tool", "path": "lib/persistance_module.py", "copies": "1", "size": "2075", "license": "apache-2.0", "hash": 8469714468918350000, "line_mean": 22.3146067416, "line_max": 87, "alpha_frac": 0.6187951807, "autogenerated": false, "ratio": 3.446843853820598, "con...
__author__ = 'cmiller' ''' Tool for anim exporting and importing between rigs for Hulk Show and expandable to others. Also houses similar tools for baking final animation for Lighting export 1. Option to delete the keys ''' # Imports import os, os.path, json, sys from maya import OpenMayaUI as omU...
{ "repo_name": "CzarOfTheUniverse/MayaPythonTools", "path": "CMiller_MafTools/CMiller_MafTools.py", "copies": "1", "size": "27850", "license": "mit", "hash": -4473608612826845000, "line_mean": 38.9558823529, "line_max": 408, "alpha_frac": 0.533070018, "autogenerated": false, "ratio": 3.86269070735...
__author__ = 'cobedien' import requests import json base_url = 'http://10.0.243.20/api/' name_pwd = {'aaaUser': {'attributes': {'name': 'admin', 'pwd': 'cisco.123'}}} json_credentials = json.dumps(name_pwd) login_url = base_url + 'aaaLogin.json' post_response = requests.post(login_url, data=json_credentials) auth =...
{ "repo_name": "tecdct2941/nxos_dashboard", "path": "test_uri.py", "copies": "1", "size": "1257", "license": "apache-2.0", "hash": 3891488434091734500, "line_mean": 36, "line_max": 105, "alpha_frac": 0.7128082737, "autogenerated": false, "ratio": 2.7565789473684212, "config_test": false, "has_...
__author__ = "Coda Hale <coda.hale@gmail.com>" __date__ = "2008-03-19" __version__ = "1.0" __credits__ = """ Copyright (c) 2008 Coda Hale Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without re...
{ "repo_name": "codahale/hadoop-streaming", "path": "python/lib/hadoop/__init__.py", "copies": "1", "size": "4976", "license": "mit", "hash": 3708776750673975000, "line_mean": 34.55, "line_max": 83, "alpha_frac": 0.6927250804, "autogenerated": false, "ratio": 4.274914089347079, "config_test": fa...