text
stringlengths
0
1.05M
meta
dict
__author__ = 'Dimitry Lvovsky, dimitry@reviewpro.com' # Copyright 2014 ReviewRank S.A ( ReviewPro ) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/...
{ "repo_name": "reviewpro/connect_py", "path": "connect_py/Connect.py", "copies": "2", "size": "11039", "license": "apache-2.0", "hash": 7024644343435339000, "line_mean": 44.2418032787, "line_max": 169, "alpha_frac": 0.6139143038, "autogenerated": false, "ratio": 3.5438202247191013, "config_test...
__author__ = 'Dimitry Lvovsky' # Copyright 2014 ReviewRank S.A ( ReviewPro ) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
{ "repo_name": "reviewpro/connect_py", "path": "examples/python_csq_example.py", "copies": "2", "size": "1630", "license": "apache-2.0", "hash": 3053947922044047400, "line_mean": 31.6, "line_max": 78, "alpha_frac": 0.5374233129, "autogenerated": false, "ratio": 3.918269230769231, "config_test": ...
# This script considers all the products a user has ordered # # We train a model computing the probability of reorder on the "train" data # # For the submission, we keep the orders that have a probability of # reorder higher than a threshold import tempfile import numpy as np import pandas as pd import lightgbm as l...
{ "repo_name": "ifuding/Kaggle", "path": "Instacart/Code/fd_keras.py", "copies": "1", "size": "34543", "license": "apache-2.0", "hash": -7010696433914318000, "line_mean": 38.6135321101, "line_max": 159, "alpha_frac": 0.6095591003, "autogenerated": false, "ratio": 3.122107736804049, "config_test"...
__author__ = 'dipsingh' import json import socket import gevent import pcep_handler import te_controller import json from gevent import monkey monkey.patch_socket() MAXCLIENTS = 10 PCEADDR='0.0.0.0' PCEPORT=4189 def parse_config(pce_config_file): SR_TE = False TunnelName ='' ERO_LIST = list() # ERO List ...
{ "repo_name": "Dipsingh/mpls-pce", "path": "pce_controller.py", "copies": "1", "size": "4286", "license": "mit", "hash": -5891687146532034000, "line_mean": 39.0560747664, "line_max": 147, "alpha_frac": 0.5863275782, "autogenerated": false, "ratio": 3.3020030816640986, "config_test": false, "h...
__author__ = 'dipsingh' import socket import mpls_lsp_pb2 import struct class TEController(object): def __init__(self): self._lsp_dict = dict() self._lsp_delg_dict = dict() self._srpid = 1 def ip2int(self, addr): return struct.unpack_from("!I", socket.inet_aton(addr))[0] ...
{ "repo_name": "Dipsingh/mpls-pce", "path": "te_controller.py", "copies": "1", "size": "5174", "license": "mit", "hash": -3927052680769859000, "line_mean": 46.4678899083, "line_max": 195, "alpha_frac": 0.5048318516, "autogenerated": false, "ratio": 3.066982809721399, "config_test": false, "has...
__author__ = 'dipsingh' import string import struct import socket import binascii import json class PCEP(object): """ 6.1. Common Header 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
{ "repo_name": "Dipsingh/mpls-pce", "path": "pcep_handler.py", "copies": "1", "size": "35570", "license": "mit", "hash": -2567897749900257300, "line_mean": 45.4967320261, "line_max": 177, "alpha_frac": 0.4388810796, "autogenerated": false, "ratio": 3.506852016168786, "config_test": false, "has...
__author__ = 'disaster' import cattle import logging from fr.webcenter.backup.Singleton import Singleton logger = logging class Rancher(object): """ This class provide helper for Rancher API. """ __metaclass__ = Singleton def __init__(self, url=None, key=None, secret=None): """ I...
{ "repo_name": "rufusl/rancher-backup", "path": "backup/src/fr/webcenter/backup/Rancher.py", "copies": "1", "size": "4305", "license": "mit", "hash": -5209396737259590000, "line_mean": 34.875, "line_max": 296, "alpha_frac": 0.5825783972, "autogenerated": false, "ratio": 4.379450661241099, "confi...
__author__ = 'disaster' import re import logging import os from fr.webcenter.backup.Command import Command from fr.webcenter.backup.Singleton import Singleton from fr.webcenter.backup.Config import Config from jinja2 import Environment import yaml logger = logging class Backup(object): """ This class permit ...
{ "repo_name": "disaster37/rancher-backup", "path": "backup/src/fr/webcenter/backup/Backup.py", "copies": "1", "size": "14392", "license": "mit", "hash": 2766996562573457000, "line_mean": 41.9611940299, "line_max": 263, "alpha_frac": 0.5832406893, "autogenerated": false, "ratio": 4.684895833333333...
__author__ = 'disaster' import yaml import glob import logging from fr.webcenter.backup.Singleton import Singleton from jinja2 import Environment logger = logging class Config(object): __metaclass__ = Singleton def __init__(self, path=None): """ Permit to load all settings :param pa...
{ "repo_name": "rufusl/rancher-backup", "path": "backup/src/fr/webcenter/backup/Config.py", "copies": "2", "size": "2746", "license": "mit", "hash": 1122433631715465100, "line_mean": 27.6041666667, "line_max": 71, "alpha_frac": 0.5863073562, "autogenerated": false, "ratio": 4.509031198686371, "c...
__author__ = 'divya' import pandas as pd import pandas.io.data import math import matplotlib.pyplot as plt import os class DataHandler: def __init__(self): pass def fetch_data_from_yahoo(self, symbol, start, end): df = pandas.io.data.get_data_yahoo(symbol, start, end) return df ...
{ "repo_name": "abhipr1/DATA_SCIENCE_INTENSIVE", "path": "Capstone/DataHandler.py", "copies": "1", "size": "2049", "license": "apache-2.0", "hash": 3019294452824125400, "line_mean": 32.0483870968, "line_max": 98, "alpha_frac": 0.5212298682, "autogenerated": false, "ratio": 3.5572916666666665, "c...
__author__ = 'djff' ''' load_step_2_Dec29_2016.py is a python script that is used to load CV's and structure data in the sqlite database. it uses xlrd to handle the xlsx files, load, read data and workbook sheets from the file. ''' from step_variables import * from setup import * # *************...
{ "repo_name": "amabdallah/test2", "path": "2016/load_step_2_Adel_edits.py", "copies": "1", "size": "9565", "license": "bsd-3-clause", "hash": -6757132270796878000, "line_mean": 45.6585365854, "line_max": 118, "alpha_frac": 0.4647151072, "autogenerated": false, "ratio": 4.702556538839724, "confi...
__author__ = 'djff' ''' load_step_3_Jan3_2017.py is a python script that is used to load CV's and Networks data in the sqlite database. it uses xlrd to handle the xlsx files, load, read data and workbook sheets from the file. ''' from setup import * from step_variables import Network_sheets_ordere...
{ "repo_name": "amabdallah/test2", "path": "2016/load_step_3_Adel.py", "copies": "1", "size": "5127", "license": "bsd-3-clause", "hash": -5130461168733958000, "line_mean": 48.2980769231, "line_max": 84, "alpha_frac": 0.4538716598, "autogenerated": false, "ratio": 4.963213939980639, "config_test"...
__author__ = 'djff' ''' load_step_4.py is a python script that is used to load some CV's of Data Values to the sqlite database. it uses xlrd to handle the xlsx files, load, read data and workbook sheets from the file. ''' from setup import * from step_variables import DataValues_ordered class Lo...
{ "repo_name": "amabdallah/test2", "path": "2016/load_step_4_Adel.py", "copies": "1", "size": "2956", "license": "bsd-3-clause", "hash": -8566095208975121000, "line_mean": 45.1875, "line_max": 87, "alpha_frac": 0.4837618403, "autogenerated": false, "ratio": 4.519877675840979, "config_test": fals...
__author__ = 'djff' ''' load_step_one.py is a python script that is used to load CV's and structure data in the sqlite database. it uses xlrd to handle the xlsx files, load, read data and workbook sheets from the file. ''' from step_variables import * from setup import * # **********************...
{ "repo_name": "amabdallah/test2", "path": "2016/Dec26/load_step_one_Dec26.py", "copies": "1", "size": "9187", "license": "bsd-3-clause", "hash": 8144075151105460000, "line_mean": 43.8146341463, "line_max": 118, "alpha_frac": 0.4544465005, "autogenerated": false, "ratio": 4.820041972717734, "con...
__author__ = 'djff' # Sheet Names for step 1 loading in order of dependency, independent to dependent. metadata_sheets_ordered = ['StaticCVs', '1.1_Organiz&People', '1.2_Sources', '1.3_Methods'] # Sheet Names for step 2 loading in order of dependency independent to dependent. cv_sheets_ordered = ['ObjectCategory...
{ "repo_name": "amabdallah/test2", "path": "2016/step_variables_Adel.py", "copies": "1", "size": "1094", "license": "bsd-3-clause", "hash": 4099227457385383000, "line_mean": 34.2903225806, "line_max": 108, "alpha_frac": 0.6617915905, "autogenerated": false, "ratio": 3.305135951661631, "config_te...
__author__ = "djJfunk <J. Michael Burgess>" from astromodels.functions.functions import DiracDelta, StepFunctionUpper import numpy as np def step_generator(intervals, parameter): """ Generates sum of step or dirac delta functions for the given intervals and parameter. This can be used to link time-indep...
{ "repo_name": "volodymyrss/3ML", "path": "threeML/utils/step_parameter_generator.py", "copies": "1", "size": "2908", "license": "bsd-3-clause", "hash": 995743601363566300, "line_mean": 25.6788990826, "line_max": 81, "alpha_frac": 0.6317056396, "autogenerated": false, "ratio": 4.033287101248266, ...
__author__ = 'djstava' #!/usr/bin/env python #coding=utf-8 import getopt import sys def dj_commandLine_parse(): for str in sys.argv: print str try: opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="]) except getopt.GetoptError, err: # print help information and e...
{ "repo_name": "djstavaRT/PythonSnippets", "path": "dj_commandLine.py", "copies": "1", "size": "1036", "license": "mit", "hash": -6283396284005759000, "line_mean": 23.6904761905, "line_max": 77, "alpha_frac": 0.5540540541, "autogenerated": false, "ratio": 3.6223776223776225, "config_test": false...
__author__ = 'djstava' #!/usr/bin/env python # -*- coding:utf-8 -*- import os import sys import re import string import telnetlib import sqlite3 import codecs from time import ctime,sleep import threading import socket import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import * ...
{ "repo_name": "djstavaRT/PythonSnippets", "path": "lj_rescue.py", "copies": "1", "size": "4670", "license": "mit", "hash": -3367779426714580500, "line_mean": 26.9640718563, "line_max": 199, "alpha_frac": 0.5426124197, "autogenerated": false, "ratio": 3.3767172812725956, "config_test": false, ...
__author__ = 'djstava' #!/usr/bin/env python # -*- coding: utf-8 -* import sqlite3 def dj_sqlite3(): conn = sqlite3.connect('test.db') cursor = conn.cursor() #create cursor.execute('''create table catalog( id integer primary key, pid integer, name varchar(10) unique ...
{ "repo_name": "djstavaRT/PythonSnippets", "path": "dj_sqlite3.py", "copies": "1", "size": "1169", "license": "mit", "hash": 2655812813501244400, "line_mean": 15.4647887324, "line_max": 61, "alpha_frac": 0.5851154833, "autogenerated": false, "ratio": 3.770967741935484, "config_test": false, "h...
__author__ = 'djstava' #!/usr/bin/env python # -*- coding: utf-8 -* import wx import telnetlib DJ_AUTOTESTFORIPLOADER_LOG = "log.txt" class DJMainFrame(wx.Frame): def __init__(self,parent,id,title,pos,size): wx.Frame.__init__(self,parent,id,title,pos,size) self.panel = wx.Panel(self) se...
{ "repo_name": "djstavaRT/PythonSnippets", "path": "dj_autoTestForIploader.py", "copies": "1", "size": "6604", "license": "mit", "hash": -4200175521282728400, "line_mean": 33.9470899471, "line_max": 124, "alpha_frac": 0.6244700182, "autogenerated": false, "ratio": 3.5678011885467313, "config_tes...
__author__ = 'djw' class FieldNodeItem(object): """ An item built on a player's field board, held within a node/cell on that board """ def __init__(self): self.cattle = 0 self.boars = 0 self.sheep = 0 self.grain = 0 self.vegetables = 0 def update_animals(s...
{ "repo_name": "sourlows/pyagricola", "path": "src/field/node_item.py", "copies": "1", "size": "3158", "license": "mit", "hash": -3689722559803308500, "line_mean": 24.272, "line_max": 97, "alpha_frac": 0.5668144395, "autogenerated": false, "ratio": 4.017811704834606, "config_test": false, "has...
__author__ = 'dkador' class BaseKeenClientError(Exception): """ Base class for all Keen Client errors. """ def __str__(self): # all sub-classes should set self._message in their initializers return self._message class InvalidProjectIdError(BaseKeenClientError): def __init__(self...
{ "repo_name": "harshita-gupta/Harvard-FRSEM-Catalog-2016-17", "path": "flask/lib/python2.7/site-packages/keen/exceptions.py", "copies": "4", "size": "1602", "license": "mit", "hash": -25245506485995230, "line_mean": 36.2790697674, "line_max": 103, "alpha_frac": 0.6360799001, "autogenerated": false,...
__author__ = 'dkarchmer' import pytz from django.utils import timezone class TimezoneMiddleware: def __init__(self, get_response): self.get_response = get_response # One-time configuration and initialization. def __call__(self, request): # Code to be executed for each request before ...
{ "repo_name": "dkarchmer/django-aws-template", "path": "server/apps/utils/timezoneMiddleware.py", "copies": "1", "size": "1032", "license": "mit", "hash": -3409893466192614000, "line_mean": 27.6666666667, "line_max": 80, "alpha_frac": 0.601744186, "autogenerated": false, "ratio": 4.71232876712328...
__author__ = 'dkarchmer' """ See https://gist.github.com/dkarchmer/d85e55f9ed5450ba58cb This API generically supports DjangoRestFramework based APIs It is based on https://github.com/samgiles/slumber, but customized for Django Rest Frameworks, and the use of TokenAuthentication. Usage: # Assuming # v1_api_rout...
{ "repo_name": "dkarchmer/django-rest-framework-client", "path": "drf_client/connection.py", "copies": "1", "size": "9566", "license": "mit", "hash": -1028399164020417000, "line_mean": 32.3344947735, "line_max": 119, "alpha_frac": 0.5789253607, "autogenerated": false, "ratio": 3.9792013311148087, ...
__author__ = 'dkov' from pdf.lex import * class Pdf: def __init__(self): self.header = '' self.objects = {} self.trailer = None self.xref = {} def load(self, objects): self.header = objects[0] for object in objects: if isinstance(object, Indirect):...
{ "repo_name": "dkov01/pypdf", "path": "pdf/pdf.py", "copies": "1", "size": "2820", "license": "bsd-3-clause", "hash": -8702781687323489000, "line_mean": 28.0824742268, "line_max": 117, "alpha_frac": 0.4893617021, "autogenerated": false, "ratio": 3.7154150197628457, "config_test": false, "has_...
__author__ = 'dkov' import pdf import pdf.lex import pdf.testdata import pdf.filter from pdf.pdf import Pdf, Update def list_of_lists(list_of_ints): if list_of_ints == []: return [] it = iter(sorted(list_of_ints)) res = [] l = [] l.append(next(it)) sentinal = () while True: ...
{ "repo_name": "dkov01/pypdf", "path": "main.py", "copies": "1", "size": "3319", "license": "bsd-3-clause", "hash": 5486717774462938000, "line_mean": 25.1338582677, "line_max": 92, "alpha_frac": 0.5369087074, "autogenerated": false, "ratio": 3.2699507389162563, "config_test": false, "has_no_ke...
__author__ = 'dlau' from django.core.management.base import BaseCommand, make_option from django.db.models import Sum from sxsw.models import Event from birdy.twitter import AppClient, TwitterRateLimitError import sys api_keys = [ # UpWord Notes SXSW @dlauzzz { 'consumer_key' : 'SECRET_KEY', #This sh...
{ "repo_name": "laud/upword-notes-sxsw", "path": "sxsw/management/commands/refresh_tweet_info.py", "copies": "1", "size": "5515", "license": "mit", "hash": -2504744234671208000, "line_mean": 42.7698412698, "line_max": 136, "alpha_frac": 0.6184950136, "autogenerated": false, "ratio": 3.867461430575...
__author__ = 'dlau' from tastypie import fields from tastypie.cache import SimpleCache from tastypie.throttle import BaseThrottle from tastypie.resources import ModelResource, ALL from tastypie.authentication import Authentication from tastypie.authorization import ReadOnlyAuthorization from haystack.query import Sea...
{ "repo_name": "laud/upword-notes-sxsw", "path": "sxsw/api.py", "copies": "1", "size": "8368", "license": "mit", "hash": 6792014536308406000, "line_mean": 39.038277512, "line_max": 177, "alpha_frac": 0.6040869981, "autogenerated": false, "ratio": 3.8455882352941178, "config_test": false, "has_...
__author__ = 'dlgltlzed' import sys import json class ShiftParser: line_count = 0 column_count = 0 position = 0 save_coords = False level = -1 found_tokens = [] types = ('left shift', 'no shift', 'right shift', 'content') input_text = "" def __init__(self, input_text): se...
{ "repo_name": "moglars/ShiftParser", "path": "ShiftParser.py", "copies": "1", "size": "2789", "license": "mit", "hash": 4730527918282882000, "line_mean": 32.6024096386, "line_max": 81, "alpha_frac": 0.4442452492, "autogenerated": false, "ratio": 4.825259515570934, "config_test": false, "has_n...
__author__ = 'DLippman' import json from Queue import Queue from flask import Flask, render_template, request, Response import threading import contextlib from eiscp.core import ISCP, eISCP, command_to_iscp, iscp_to_command import logging logging.basicConfig( filename = 'c:\\Temp\\hello-service.log', level = ...
{ "repo_name": "devanl/webOnkyo", "path": "webOnkyo.py", "copies": "1", "size": "10863", "license": "mit", "hash": 460041246225017800, "line_mean": 28.4417344173, "line_max": 93, "alpha_frac": 0.5624597257, "autogenerated": false, "ratio": 4.080766341096919, "config_test": false, "has_no_keywo...
__author__ = 'dmakogon' from gigaspace.common import templating from gigaspace.common import remote nova_exceptions = remote.novaclient.client.exceptions cinder_exceptions = remote.cinderclient.client.exceptions class BaseNovaActions(remote.RemoteServices, templating.UserdataTemplate): """ Base Cinder actio...
{ "repo_name": "denismakogon/gigaspace-test-task", "path": "gigaspace/nova_workflow/base.py", "copies": "1", "size": "3363", "license": "apache-2.0", "hash": 1810045099855395300, "line_mean": 31.0285714286, "line_max": 75, "alpha_frac": 0.5854891466, "autogenerated": false, "ratio": 4.193266832917...
__author__ = 'dmakogon' import logging import re # Don't need this for testing logging.disable('LOG') def _check_for_exact_apache(start, lines): """Check for the Apache 2.0 license header. We strip all the newlines and extra spaces so this license string should work regardless of indentation in the file. """ ...
{ "repo_name": "rmyers/trove-dashboard", "path": "trove_dashboard/utils/hacking/check.py", "copies": "1", "size": "3870", "license": "apache-2.0", "hash": 3002208807663561700, "line_mean": 34.504587156, "line_max": 79, "alpha_frac": 0.6478036176, "autogenerated": false, "ratio": 4.035453597497393,...
__author__ = 'dmakogon' import sys import prettytable import six import jinja2 from gigaspace.common import cfg from oslo.utils import encodeutils CONF = cfg.CONF ENV = jinja2.Environment(loader=jinja2.ChoiceLoader([ jinja2.FileSystemLoader("/etc/gigaspace/templates"), ...
{ "repo_name": "denismakogon/gigaspace-test-task", "path": "gigaspace/common/utils.py", "copies": "1", "size": "2701", "license": "apache-2.0", "hash": -5083463365880304000, "line_mean": 31.5421686747, "line_max": 77, "alpha_frac": 0.5668271011, "autogenerated": false, "ratio": 3.8696275071633237,...
__author__ = 'dmakogon' from gigaspace.common import cfg from cinderclient.v2 import client as cinderclient from novaclient.v1_1 import client as novaclient from oslo.utils import importutils CONF = cfg.CONF class RemoteServices(object): _novaclient = None _cinderclient = None @property def novac...
{ "repo_name": "denismakogon/gigaspace-test-task", "path": "gigaspace/common/remote.py", "copies": "1", "size": "2077", "license": "apache-2.0", "hash": 3973835823909671400, "line_mean": 27.4520547945, "line_max": 65, "alpha_frac": 0.5690900337, "autogenerated": false, "ratio": 4.3180873180873185,...
__author__ = 'dmarkey' from models import SecretSantaOrg from captcha.fields import CaptchaField from django import forms from datetimewidget.widgets import DateTimeWidget from django.contrib.auth.models import User class NewSecretSantaForm(forms.ModelForm): your_email = forms.EmailField(max_length=256) captc...
{ "repo_name": "dmarkey/secretsanta", "path": "app/forms.py", "copies": "1", "size": "1389", "license": "mit", "hash": 1734350866578717400, "line_mean": 25.2075471698, "line_max": 82, "alpha_frac": 0.6508279338, "autogenerated": false, "ratio": 4.209090909090909, "config_test": false, "has_no_...
__author__ = 'dmitrii' import csv class Splitter: data = [] new_data = [] param_list = {'app': "app4", 'flac': "cr_audio1.flac", 'wav': "cr_audio1.wav", 'enw8': "enwik8", 'enw9': "enwik9", 'game': "game1", '01': "01",'02': "...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/csv_split.py", "copies": "1", "size": "1579", "license": "mit", "hash": 3444240337920474600, "line_mean": 42.8611111111, "line_max": 176, "alpha_frac": 0.4452184927, "autogenerated": false, "ratio": 3.4251626898047722, "config_test": false, "ha...
__author__ = 'dmitrii' import csv from os import walk freqs = [1200.0,1300.0, 1400.0, 1600.0, 1700.0, 1800.0, 1900.0, 2000.0, 2200.0, 2300.0, 2400.0, 2500.0, 2700.0, 2800.0, 2900.0, 2901.0] threads = [1, 2, 4, 8, 16, 32] energy ={} time={} subset_energy={} subset_time={} #max_deviation={} repeats = 10. for f in freqs...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/helper_scripts/evaluation.py", "copies": "1", "size": "3606", "license": "mit", "hash": 8550421760836460000, "line_mean": 34.0194174757, "line_max": 135, "alpha_frac": 0.5643372158, "autogenerated": false, "ratio": 2.8917401764234163, "config_tes...
__author__ = 'dmitrii' import csv param_list = {'app': "app4", 'flac': "cr_audio1.flac", 'wav': "cr_audio1.wav", 'enw8': "enwik8", 'enw9': "enwik9", 'game': "game1", '01': "01",'02': "02",'03': "03",'04': "04",'05': "05",'06': "06",'07': "07", '08': "08",'09': "09",'10': "10",...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/helper_scripts/avg.py", "copies": "1", "size": "2824", "license": "mit", "hash": -444111781628267800, "line_mean": 41.1492537313, "line_max": 177, "alpha_frac": 0.479815864, "autogenerated": false, "ratio": 3.0562770562770565, "config_test": fals...
__author__ = 'dmitrii' import csv param_list = {'app': "app4", 'flac': "cr_audio1.flac", 'wav': "cr_audio1.wav", 'enw8': "enwik8", 'enw9': "enwik9", 'game': "game1", '01': "01",'02': "02",'03': "03",'04': "04",'05': "05",'06': "06",'07...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/helper_scripts/fix_results.py", "copies": "1", "size": "2131", "license": "mit", "hash": -2066267285103363800, "line_mean": 51, "line_max": 175, "alpha_frac": 0.4486156734, "autogenerated": false, "ratio": 3.4150641025641026, "config_test": false...
__author__ = 'dmitrii' import numpy as np def featureFormat(dictionary, features, sort_keys=False): return_list = [] # if sort_keys: # keys = sorted(dictionary.keys()) # else: # keys = dictionary.keys() for key in xrange(len(dictionary)): tmp_list = [] for feature in fea...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/format.py", "copies": "1", "size": "1517", "license": "mit", "hash": 7944591009914677000, "line_mean": 26.5818181818, "line_max": 68, "alpha_frac": 0.5655899802, "autogenerated": false, "ratio": 4.179063360881543, "config_test": false, "has_no_...
__author__ = 'dmitrii' import csv filename = 'sim_annealing_results/sim_annealing_compress_01' with open(filename+'.csv', 'r') as csv_file: reader = csv.DictReader(csv_file) old_row = None min_energy = None settings = {} for row in reader: #if row["REP"] == "3": # if row["DataType"...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/helper_scripts/optimal_finder.py", "copies": "1", "size": "1424", "license": "mit", "hash": -3943977261526017000, "line_mean": 33.7317073171, "line_max": 93, "alpha_frac": 0.5400280899, "autogenerated": false, "ratio": 3.595959595959596, "config_...
__author__ = 'dmitrii' import csv import random from tools.format import featureFormat, targetFeatureSplit import numpy as np class Climber: dict = [] features_list = ["EN", "TR", "FR"] features_list2 = ["TIM", "TR", "FR"] features = [] target = [] target2 = [] threads = [] freqs = [] ...
{ "repo_name": "dpukhkaiev/BRISE", "path": "hill_climbing/climber.py", "copies": "1", "size": "5919", "license": "mit", "hash": 597543663946320500, "line_mean": 36.4683544304, "line_max": 134, "alpha_frac": 0.5103902686, "autogenerated": false, "ratio": 3.606946983546618, "config_test": false, ...
__author__ = 'dmitrii' import csv import random from tools.format import featureFormat, targetFeatureSplit import numpy as np class SimAnnealing: dict = [] features_list = ["EN", "TR", "FR"] features_list2 = ["TIM", "TR", "FR"] features = [] target = [] target2 = [] threads = [] freqs ...
{ "repo_name": "dpukhkaiev/BRISE", "path": "sim_annealing/sim_annealing.py", "copies": "1", "size": "9484", "license": "mit", "hash": -1003885419514510600, "line_mean": 37.7142857143, "line_max": 176, "alpha_frac": 0.5006326445, "autogenerated": false, "ratio": 3.7784860557768924, "config_test":...
__author__ = 'dmitrii' import csv import sys file_name = sys.argv[1][:-4] with open(file_name + ".csv", 'r') as csv_file: reader = csv.DictReader(csv_file) old_row = None min_energy = None settings = {} for row in reader: if row["REP"] == "1": if not old_row: ...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/helper_scripts/optimal_finder_db.py", "copies": "1", "size": "1378", "license": "mit", "hash": 4729949935080405000, "line_mean": 31.8095238095, "line_max": 97, "alpha_frac": 0.5123367199, "autogenerated": false, "ratio": 3.6358839050131926, "conf...
__author__ = 'dmitrii' import numpy as np import csv with open("../csvs/results.csv", 'r') as csv_file: query = "22" near_opt_freq = 2700. near_opt_tr = 8 res = [] time_naive = [] near_opt_res = [] near_opt_time = [] fin_res = 0. fin_near_opt = 0. fin_time_naive = 0. fin_ti...
{ "repo_name": "dpukhkaiev/BRISE", "path": "tools/optimal_db_comparison.py", "copies": "1", "size": "1837", "license": "mit", "hash": -5779240073786540000, "line_mean": 33.6603773585, "line_max": 100, "alpha_frac": 0.5459989113, "autogenerated": false, "ratio": 2.8524844720496896, "config_test":...
__author__ = 'dmitrii' import sys import re import csv from sklearn import cross_validation from sklearn.linear_model import LinearRegression, Ridge from tools.format import featureFormat, targetFeatureSplit from sklearn.preprocessing import PolynomialFeatures from sklearn.pipeline import Pipeline import random from m...
{ "repo_name": "dpukhkaiev/BRISE", "path": "core/regression.py", "copies": "1", "size": "10605", "license": "mit", "hash": -3832800422018744000, "line_mean": 36.3415492958, "line_max": 140, "alpha_frac": 0.5315417256, "autogenerated": false, "ratio": 3.561114842175957, "config_test": true, "ha...
__author__ = 'dmitriydmitrienko' from django.template import Context from django.template.loader import get_template from django.template import Library register = Library() def get_context_template(element): template = get_template("kubeform/kube_form.html") context = Context({'form': element}) return ...
{ "repo_name": "DmitryDmitrienko/django-kube-form", "path": "kubeform/templatetags/kube.py", "copies": "1", "size": "1248", "license": "apache-2.0", "hash": 355451222873789200, "line_mean": 27.3636363636, "line_max": 82, "alpha_frac": 0.6482371795, "autogenerated": false, "ratio": 4.06514657980456...
__author__ = 'Dmitriy Korsakov' __doc__ = 'Farm management' import json import copy from scalrctl import commands from scalrctl import click from scalrctl import request, settings class FarmTerminate(commands.SimplifiedAction): epilog = "Example: scalr-ctl farms terminate --farmId <ID> --force" post_temp...
{ "repo_name": "Scalr/scalr-ctl", "path": "scalrctl/commands/farm.py", "copies": "2", "size": "6362", "license": "apache-2.0", "hash": 738455535190341600, "line_mean": 31.793814433, "line_max": 117, "alpha_frac": 0.5845646023, "autogenerated": false, "ratio": 3.92958616429895, "config_test": fal...
__author__ = 'Dmitriy Korsakov' __doc__ = 'Image management' import copy from scalrctl import commands from scalrctl import click class ChangeImageAttrs(commands.Action): prompt_for = ["imageId"] class RegisterImage(commands.Action): def pre(self, *args, **kwargs): #XXX: this code does not work ye...
{ "repo_name": "Scalr/pecha", "path": "scalrctl/commands/image.py", "copies": "2", "size": "4042", "license": "apache-2.0", "hash": 6102947180607602000, "line_mean": 38.6274509804, "line_max": 128, "alpha_frac": 0.6526472044, "autogenerated": false, "ratio": 3.8531935176358436, "config_test": fa...
__author__ = 'Dmitriy Korsakov' __doc__ = 'Manage FarmRoles' import json import copy from scalrctl import commands from scalrctl import click from scalrctl import request, settings from scalrctl.commands import farm class LaunchServer(commands.SimplifiedAction): post_template = {} def pre(self, *args, **...
{ "repo_name": "Scalr/scalr-ctl", "path": "scalrctl/commands/farmrole.py", "copies": "2", "size": "2877", "license": "apache-2.0", "hash": 5163361854572674000, "line_mean": 31.3258426966, "line_max": 118, "alpha_frac": 0.598540146, "autogenerated": false, "ratio": 3.655654383735705, "config_test...
__author__ = 'Dmitriy Korsakov' __doc__ = 'RoleImage management' import copy import json from scalrctl import commands from scalrctl import click class ReplaceRoleImage(commands.SimplifiedAction): epilog = "Example: scalr-ctl role-images replace --roleID <roleID> --imageID <ID> --newImageID <newID>" post_t...
{ "repo_name": "Scalr/scalr-ctl", "path": "scalrctl/commands/roleimage.py", "copies": "2", "size": "2674", "license": "apache-2.0", "hash": 7227931644069351000, "line_mean": 31.2168674699, "line_max": 107, "alpha_frac": 0.5833956619, "autogenerated": false, "ratio": 3.7346368715083798, "config_t...
__author__ = 'Dmitriy Korsakov' __doc__ = 'Role management' import copy from scalrctl import commands from scalrctl import click class ChangeRoleAttrs(commands.Action): prompt_for = ["roleId"] class RoleClone(commands.SimplifiedAction): epilog = "Example: scalr-ctl role clone --roleId <ID> --name MyNewRol...
{ "repo_name": "Scalr/pecha", "path": "scalrctl/commands/role.py", "copies": "2", "size": "3224", "license": "apache-2.0", "hash": 3946340486088926700, "line_mean": 31.5757575758, "line_max": 108, "alpha_frac": 0.601426799, "autogenerated": false, "ratio": 3.8335315101070155, "config_test": fals...
__author__ = 'Dmitriy Korsakov' __doc__ = 'Server management' import copy import json import time from scalrctl import commands from scalrctl import click class RebootServer(commands.PolledAction): epilog = "Example: scalr-ctl servers reboot --serverId <ID> --hard --nowait" post_template = { "server...
{ "repo_name": "Scalr/pecha", "path": "scalrctl/commands/server.py", "copies": "2", "size": "11256", "license": "apache-2.0", "hash": 4327081301438371300, "line_mean": 39.9309090909, "line_max": 110, "alpha_frac": 0.5672530206, "autogenerated": false, "ratio": 4, "config_test": false, "has_no_...
__author__ = 'Dmitriy Korsakov' __doc__ = 'Server management' import copy import json import time from scalrctl import commands from scalrctl import click class ExecuteScript(commands.PolledAction): epilog = "Example: scalr-ctl scripts execute --serverId <ID> --scriptId <ID> --blocking --timeout 30" post_t...
{ "repo_name": "Scalr/scalr-ctl", "path": "scalrctl/commands/script.py", "copies": "2", "size": "3332", "license": "apache-2.0", "hash": 1815391308556685000, "line_mean": 41.7179487179, "line_max": 111, "alpha_frac": 0.6149459784, "autogenerated": false, "ratio": 4.093366093366093, "config_test"...
__author__ = 'Dmitriy Korsakov' from scalrctl import settings, spec specs_dict = {} count = 0 for path in settings.spec["paths"].keys(): methods = settings.spec["paths"][path].keys() for method in methods: if "parameters" != method: if method not in specs_dict: specs_dict[...
{ "repo_name": "Scalr/scalr-ctl", "path": "tests/unittests/test_spec.py", "copies": "2", "size": "1895", "license": "apache-2.0", "hash": 9171453825451638000, "line_mean": 28.609375, "line_max": 93, "alpha_frac": 0.635883905, "autogenerated": false, "ratio": 3.509259259259259, "config_test": fal...
__author__ = 'Dmitriy Korsakov' import json import yaml import six import prettytable import re from scalrctl import settings def calc_vertical_table(response_json, columns): rows = [] for block in response_json.get('data', ''): row = [] for name in columns: for item in block: ...
{ "repo_name": "Scalr/pecha", "path": "scalrctl/view.py", "copies": "2", "size": "3847", "license": "apache-2.0", "hash": -7641379589201650000, "line_mean": 28.1439393939, "line_max": 93, "alpha_frac": 0.5614764752, "autogenerated": false, "ratio": 3.494096276112625, "config_test": false, "has...
__author__ = 'Dmitriy Korsakov' import os import site import shutil from scalrctl import click from scalrctl import defaults PROGNAME = "scalr-ctl" AUTOCOMPLETE_FNAME = "path.bash.inc" AUTOCOMPLETE_CONTENT = "_%s_COMPLETE=source %s" % (PROGNAME.upper().replace("-", "_"), PROGNAME) AUTOCOMPLETE_PATH = os.path.join(o...
{ "repo_name": "Scalr/pecha", "path": "scalrctl/commands/internal/bash_complete.py", "copies": "2", "size": "2902", "license": "apache-2.0", "hash": 5216403455573373000, "line_mean": 41.0579710145, "line_max": 124, "alpha_frac": 0.6095796003, "autogenerated": false, "ratio": 3.6921119592875318, ...
__author__ = 'dmitriypetrusevich' import xml.etree.ElementTree as ElementTree import re re_find_mod = re.compile("([a-z])\s%\s([0-9]+)") re_find_equal = re.compile("([a-z0-9_]+?)\s=\s([0-9\.,]+)") re_find_not_equal = re.compile("([a-z0-9_]+?)\s!=\s([0-9\.,]+)") re_find_range = re.compile("([0-9]+)\.\.([0-9]+)") sour...
{ "repo_name": "nullic/DPLocalizationManager", "path": "Generator/parser.py", "copies": "1", "size": "8474", "license": "mit", "hash": 2501397798601455000, "line_mean": 33.4471544715, "line_max": 126, "alpha_frac": 0.5944064196, "autogenerated": false, "ratio": 3.1572280178837557, "config_test":...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' from django.core.management.base import BaseCommand from optparse import make_option from taskengine.atlas.taskdef import TaskDefinition from taskengine.atlas.datamgmt import AMIWrapper from deftcore.log import Logger logger = Logger().get() cla...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/server/management/commands/runworker.py", "copies": "1", "size": "2313", "license": "apache-2.0", "hash": 4567686638226923500, "line_mean": 40.3035714286, "line_max": 69, "alpha_frac": 0.551232166, "autogenerated": false, "ratio": 4.33146067...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' # howTo install Rucio client # source env/bin/activate # pip install rucio-clients-atlas # using: # >>> from ruciotmpl import DDMWrapper # >>> ddm = DDMWrapper() # >>> ddm.ddm_list_datasets_in_container('valid1:valid1.410000.PowhegPythiaEvtGen_P20...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/ruciotmpl.py", "copies": "1", "size": "10153", "license": "apache-2.0", "hash": 1567790900773827000, "line_mean": 40.6106557377, "line_max": 140, "alpha_frac": 0.5912538166, "autogenerated": false, "ratio": 3.7081811541271, "config_test": ...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json from django.core.exceptions import ObjectDoesNotExist from taskengine.models import ProductionDataset, ProductionTask, TTask, StepExecution, TaskRegDebugElement from taskengine.atlas.protocol import Protocol, TaskStatus, TaskDefConstant...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/taskengine/atlas/taskreg.py", "copies": "1", "size": "9925", "license": "apache-2.0", "hash": -1079532113500857000, "line_mean": 41.9653679654, "line_max": 118, "alpha_frac": 0.5213098237, "autogenerated": false, "ratio": 4.4091514882274545,...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json from django.core.management.base import BaseCommand from taskengine.atlas.taskdef import TaskDefinition from deftcore.log import Logger logger = Logger().get() class Command(BaseCommand): can_import_settings = True option_lis...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/server/management/commands/debug.py", "copies": "1", "size": "8583", "license": "apache-2.0", "hash": -148449523864072670, "line_mean": 43.703125, "line_max": 117, "alpha_frac": 0.5389723873, "autogenerated": false, "ratio": 4.13240250361097...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json from django.db import models from django.db import connections from django.dispatch import receiver from django.db.models.signals import post_init from deftcore.log import Logger logger = Logger().get() models.options.DEFAULT_NAMES +=...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/taskengine/models.py", "copies": "1", "size": "32368", "license": "apache-2.0", "hash": 1942746763818850300, "line_mean": 44.9120567376, "line_max": 119, "alpha_frac": 0.6500865052, "autogenerated": false, "ratio": 3.3503778076803643, "con...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils import timezone from deftcore.log import Logger from api import ApiServer from deftcore.helpers import Me...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/api/models.py", "copies": "1", "size": "5472", "license": "apache-2.0", "hash": 2750262843218431500, "line_mean": 40.4545454545, "line_max": 117, "alpha_frac": 0.6383406433, "autogenerated": false, "ratio": 3.480916030534351, "config_test"...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json from tastypie.serializers import Serializer from django.core.serializers.json import DjangoJSONEncoder from tastypie.resources import Resource from tastypie import fields from api.models import PhysGroupRequestIndex, PhysGroupRequestFil...
{ "repo_name": "retmas-dv/dkcatalog-nonrel", "path": "dkcatalog/api/resources.py", "copies": "1", "size": "2189", "license": "apache-2.0", "hash": 8332058935687046000, "line_mean": 36.1016949153, "line_max": 107, "alpha_frac": 0.6564641389, "autogenerated": false, "ratio": 4.114661654135339, "co...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json import requests import urllib class Client(object): BASE_URL = 'https://aipanda015.cern.ch' def __init__(self, auth_user, auth_key, verify_ssl_cert=False, base_url=None): self.verify_ssl_cert = verify_ssl_cert ...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/api/client/__init__.py", "copies": "1", "size": "10508", "license": "apache-2.0", "hash": 8821442971726374000, "line_mean": 44.4891774892, "line_max": 111, "alpha_frac": 0.622002284, "autogenerated": false, "ratio": 3.3929609299321926, "co...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json import threading from django.utils import timezone from deftcore.helpers import Singleton from deftcore.log import Logger, get_exception_string from taskengine.handlers import TaskActionHandler from taskengine.models import ProductionTa...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/api/__init__.py", "copies": "1", "size": "13415", "license": "apache-2.0", "hash": -313705003322990500, "line_mean": 60.5366972477, "line_max": 101, "alpha_frac": 0.590980246, "autogenerated": false, "ratio": 4.010463378176382, "config_tes...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import os import ast import json import re from django.template import add_to_builtins, Context, Template from django.template.defaultfilters import stringfilter from django import template from deftcore.helpers import Enum from deftcore.log import...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/taskengine/atlas/protocol/__init__.py", "copies": "1", "size": "15888", "license": "apache-2.0", "hash": 8116782058688068000, "line_mean": 35.8631090487, "line_max": 129, "alpha_frac": 0.5032099698, "autogenerated": false, "ratio": 3.7774607...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import os import json from deftcore.settings import LOGGING_BASE_DIR, DEFAULT_LOGGING_FILENAME from django.http import HttpResponse def view_log(request): try: log_file_path = os.path.join(LOGGING_BASE_DIR, DEFAULT_LOGGING_FILENAME) ...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/server/views.py", "copies": "1", "size": "1438", "license": "apache-2.0", "hash": -3227359656975388000, "line_mean": 43.9375, "line_max": 85, "alpha_frac": 0.4478442281, "autogenerated": false, "ratio": 4.594249201277956, "config_test": fa...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import os import re import ast import sys import time import json from deftcore.settings import DDM_ACCOUNT_NAME from deftcore.log import Logger from deftcore.helpers import Singleton, ImportHelper from deftcore.security.voms import MyProxyClient i...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/taskengine/atlas/datamgmt.py", "copies": "1", "size": "25429", "license": "apache-2.0", "hash": -7457631423259280000, "line_mean": 43.0710571924, "line_max": 122, "alpha_frac": 0.5336033662, "autogenerated": false, "ratio": 3.948602484472049...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import subprocess import socket import stat import datetime import gridproxy import gridproxy.voms from deftcore.settings import * from OpenSSL import crypto, SSL class MyProxyClient(object): SERVER_RESPONSE_SIZE = 16384 DIGEST_TYPE = "md...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/deftcore/security/voms.py", "copies": "1", "size": "7799", "license": "apache-2.0", "hash": -1075383616236485400, "line_mean": 35.1064814815, "line_max": 119, "alpha_frac": 0.5802025901, "autogenerated": false, "ratio": 3.6683913452492947, ...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import sys import traceback import logging import json import time from helpers import Singleton, AsyncRequest from django.conf import settings def get_exception_string(): ex_info = sys.exc_info() ex_string = traceback.format_exception_on...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/deftcore/log.py", "copies": "1", "size": "2425", "license": "apache-2.0", "hash": -8828104515292382000, "line_mean": 26.5568181818, "line_max": 88, "alpha_frac": 0.535257732, "autogenerated": false, "ratio": 3.783151326053042, "config_test...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import threading import requests from django.contrib import admin from deftcore.settings import DEBUG class ReadOnlyAdmin(admin.ModelAdmin): def __init__(self, model, admin_site): super(ReadOnlyAdmin, self).__init__(model, admin_site)...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/deftcore/helpers.py", "copies": "1", "size": "2436", "license": "apache-2.0", "hash": 710936181695811800, "line_mean": 27, "line_max": 113, "alpha_frac": 0.591543514, "autogenerated": false, "ratio": 3.922705314009662, "config_test": false...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import uuid import json import deftcore.settings from datetime import timedelta from tastypie import fields from tastypie.exceptions import NotFound, BadRequest from tastypie.resources import ModelResource, Resource, Bundle, ALL from tastypie.authe...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/api/resources.py", "copies": "1", "size": "12239", "license": "apache-2.0", "hash": 5506161897180166000, "line_mean": 34.7865497076, "line_max": 137, "alpha_frac": 0.5794591061, "autogenerated": false, "ratio": 4.267433751743376, "config_t...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' __version__ = '0.5.5' import os.path import StringIO import re import urllib import pycurl import HTMLParser import datetime import json from server.models import WebCache from deftcore.settings import CERNSSO_COOKIES_VALID_PERIOD from django.utils...
{ "repo_name": "retmas-dv/panda-deft", "path": "deftcore/deftcore/security/cernsso.py", "copies": "1", "size": "4449", "license": "apache-2.0", "hash": -2134351028835182800, "line_mean": 39.4454545455, "line_max": 110, "alpha_frac": 0.6277815239, "autogenerated": false, "ratio": 3.451512800620636,...
__author__ = 'Dmitry Golubkov' import json import requests import urllib class Client(object): def __init__(self, auth_user, auth_key, verify_ssl_cert=False, base_url='https://aipanda034.cern.ch'): self.base_url = base_url self.verify_ssl_cert = verify_ssl_cert self.api_url = '/api/v1/req...
{ "repo_name": "PanDAWMS/panda-bigmon-atlas", "path": "atlas/deftcore/api/client/__init__.py", "copies": "1", "size": "10788", "license": "apache-2.0", "hash": -9104483765283809000, "line_mean": 45.1068376068, "line_max": 113, "alpha_frac": 0.6254171301, "autogenerated": false, "ratio": 3.41392405...
__author__ = 'Dmitry Ustalov' import random class Data: def __init__(self, cluster, clusters_train, clusters_test, X_index_train, Y_all_train, Z_all_train, X_index_test, Y_all_test, Z_all_test): self.cluster = cluster self.subsumptions_train = [i for i, c in enu...
{ "repo_name": "nlpub/hyperstar", "path": "projlearn/data.py", "copies": "2", "size": "1792", "license": "mit", "hash": 8824807382648035000, "line_mean": 46.1578947368, "line_max": 118, "alpha_frac": 0.58984375, "autogenerated": false, "ratio": 3.138353765323993, "config_test": true, "has_no_k...
__author__ = 'Dmitry Ustalov' import tensorflow as tf class Baseline: """ A simple baseline that estimates the projection matrix W given the vectors X and Y without any constraints. """ def __init__(self, x_size, y_size, w_stddev, **kwargs): self.x_size = x_size self.y_size = y_s...
{ "repo_name": "dustalov/projlearn", "path": "projlearn/baseline.py", "copies": "2", "size": "1586", "license": "mit", "hash": -4168425476739356700, "line_mean": 32.7446808511, "line_max": 106, "alpha_frac": 0.5813366961, "autogenerated": false, "ratio": 2.9924528301886792, "config_test": false,...
__author__ = 'Dmitry Ustalov' import tensorflow as tf class MLP: """ A fully connected neural network-based approach. """ def __init__(self, x_size, y_size, lambda_, **kwargs): self.x_size = x_size self.y_size = y_size self.X = tf.placeholder(tf.float32, shape=[None, self.x_...
{ "repo_name": "nlpub/hyperstar", "path": "projlearn/mlp.py", "copies": "2", "size": "1913", "license": "mit", "hash": -4962274152779700000, "line_mean": 39.7021276596, "line_max": 105, "alpha_frac": 0.6116048092, "autogenerated": false, "ratio": 3.4406474820143886, "config_test": false, "has_...
__author__ = 'dmnmrzk' from bs4 import BeautifulSoup import requests from urlparse import urlparse etchosts = ''' # # /etc/hosts: static lookup table for host names # #<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain localhost ::1 localhost.localdomain localhost #Porn sites ''' r = r...
{ "repo_name": "dmnmrzk/pr0n-etc-hosts", "path": "pr0n-hostfile.py", "copies": "1", "size": "1106", "license": "bsd-3-clause", "hash": -8069637152057829000, "line_mean": 20.2692307692, "line_max": 48, "alpha_frac": 0.5696202532, "autogenerated": false, "ratio": 3.2244897959183674, "config_test":...
__author__ = 'dmorina, asmita, megha' from crowdsourcing.serializers.requester import * from crowdsourcing.serializers.project import * from rest_framework import viewsets from rest_framework.decorators import detail_route from rest_framework.response import Response from crowdsourcing.models import Module class Reques...
{ "repo_name": "ryosuzuki/crowdsource-platform", "path": "crowdsourcing/viewsets/requester.py", "copies": "3", "size": "1462", "license": "mit", "hash": 9125827891394691000, "line_mean": 46.1935483871, "line_max": 125, "alpha_frac": 0.7414500684, "autogenerated": false, "ratio": 3.983651226158038,...
__author__ = 'dmorina, asmita, megha' from crowdsourcing.serializers.worker import * from crowdsourcing.serializers.project import * from crowdsourcing.models import * from rest_framework import status, viewsets from rest_framework.response import Response from rest_framework.decorators import detail_route from rest_f...
{ "repo_name": "saviaga/crowdsource-platform", "path": "crowdsourcing/viewsets/worker.py", "copies": "1", "size": "5222", "license": "mit", "hash": 6216235548997721000, "line_mean": 40.4444444444, "line_max": 117, "alpha_frac": 0.6759862122, "autogenerated": false, "ratio": 4.197749196141479, "c...
__author__ = 'dmorina, megha' from csp import settings import httplib2 from django.http import HttpResponseRedirect from crowdsourcing import models from apiclient import discovery, errors from apiclient.http import MediaFileUpload from oauth2client.client import Credentials from rest_framework.viewsets import ViewSet ...
{ "repo_name": "saviaga/crowdsource-platform", "path": "crowdsourcing/viewsets/google_drive.py", "copies": "1", "size": "9289", "license": "mit", "hash": -7064796888112104000, "line_mean": 39.9251101322, "line_max": 116, "alpha_frac": 0.5930670686, "autogenerated": false, "ratio": 4.24155251141552...
__author__ = 'dmorina' from crowdsourcing import models from datetime import datetime from rest_framework import serializers from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from crowdsourcing.serializers.dynamic import DynamicFieldsModelSerializer from rest_framework.ex...
{ "repo_name": "ryosuzuki/crowdsource-platform", "path": "crowdsourcing/serializers/message.py", "copies": "3", "size": "1800", "license": "mit", "hash": -3019251495850996700, "line_mean": 44, "line_max": 107, "alpha_frac": 0.7338888889, "autogenerated": false, "ratio": 4.205607476635514, "confi...
__author__ = 'dmorina' from crowdsourcing import models from datetime import datetime from rest_framework import serializers from django.db.models import Avg from django.db.models import Max from django.db.models import Min from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExis...
{ "repo_name": "saviaga/crowdsource-platform", "path": "crowdsourcing/serializers/project.py", "copies": "1", "size": "12939", "license": "mit", "hash": 5410542558027583000, "line_mean": 40.8770226537, "line_max": 178, "alpha_frac": 0.6534508076, "autogenerated": false, "ratio": 4.284437086092716,...
__author__ = 'dmorina' from crowdsourcing import models from datetime import datetime from rest_framework import serializers import json class CategorySerializer(serializers.ModelSerializer): deleted = serializers.BooleanField(read_only=True) class Meta: model = models.Category fields = ('id'...
{ "repo_name": "ramcn/demo3", "path": "crowdsourcing/serializers/project.py", "copies": "6", "size": "2360", "license": "mit", "hash": -9105360023929757000, "line_mean": 30.4666666667, "line_max": 102, "alpha_frac": 0.7042372881, "autogenerated": false, "ratio": 4.591439688715953, "config_test":...
__author__ = 'dmorina' from csp import settings from crowdsourcing import models from rest_framework.views import APIView from django.http import HttpResponse, HttpResponseRedirect # TODO change this to support ajax requests, remove HttpResponseRedirect class DropboxOauth(APIView): """ Handles the Dropbox ...
{ "repo_name": "ryosuzuki/crowdsource-platform", "path": "crowdsourcing/viewsets/dropbox.py", "copies": "3", "size": "3457", "license": "mit", "hash": -3408953647318235600, "line_mean": 46.3698630137, "line_max": 108, "alpha_frac": 0.6146948221, "autogenerated": false, "ratio": 4.542706964520368, ...
__author__ = 'dmorina' from csp import settings def send_activation_email(email, host, activation_key): """ This sends the activation link to the user, the content will be moved to template files Keyword Arguments: host -- the domain of the website activation_k...
{ "repo_name": "ryosuzuki/crowdsource-platform", "path": "crowdsourcing/emails.py", "copies": "8", "size": "1719", "license": "mit", "hash": 8375116586483226000, "line_mean": 45.4864864865, "line_max": 131, "alpha_frac": 0.5671902269, "autogenerated": false, "ratio": 4.202933985330073, "config_t...
__author__ = 'dmorina' from oauth2_provider.oauth2_backends import OAuthLibCore, get_oauthlib_core from django.utils.http import urlencode import ast def get_model_or_none(model, *args, **kwargs): """ Get model object or return None, this will catch the DoesNotExist error. Keyword Arguments: ...
{ "repo_name": "phiju123/crowdsource-platform", "path": "crowdsourcing/utils.py", "copies": "1", "size": "2665", "license": "mit", "hash": -8922544273370280000, "line_mean": 36.0277777778, "line_max": 104, "alpha_frac": 0.6427767355, "autogenerated": false, "ratio": 4.3122977346278315, "config_t...
__author__ = 'dmorina' from crowdsourcing import models from datetime import datetime from rest_framework import serializers import json, hashlib, random, re from rest_framework.response import Response from django.contrib.auth.models import User from rest_framework.validators import UniqueTogetherValidator, UniqueVal...
{ "repo_name": "phiju123/crowdsource-platform", "path": "crowdsourcing/serializers/user.py", "copies": "1", "size": "8540", "license": "mit", "hash": -3489460346662191000, "line_mean": 43.0257731959, "line_max": 141, "alpha_frac": 0.6448477752, "autogenerated": false, "ratio": 4.35048395313296, ...
__author__ = 'dmorina' from crowdsourcing.serializers.worker import * from rest_framework import generics from rest_framework import status, views as rest_framework_views, viewsets class WorkerSkillViewSet(viewsets.ModelViewSet): from crowdsourcing.models import WorkerSkill queryset = WorkerSkill.objects.al...
{ "repo_name": "asmitagupta/crowdsource-platform", "path": "crowdsourcing/viewsets/worker.py", "copies": "1", "size": "1511", "license": "mit", "hash": 2813205578910359600, "line_mean": 29.22, "line_max": 74, "alpha_frac": 0.7875579087, "autogenerated": false, "ratio": 4.20891364902507, "config_...
__author__ = 'dmorina' from rest_framework import status, viewsets from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from rest_framework import mixins from crowdsourcing.models import Conversation, Message from crowdsourcing.serializers.message import ConversationSeri...
{ "repo_name": "ryosuzuki/crowdsource-platform", "path": "crowdsourcing/viewsets/message.py", "copies": "3", "size": "1449", "license": "mit", "hash": 2422728939528209000, "line_mean": 38.1891891892, "line_max": 87, "alpha_frac": 0.7004830918, "autogenerated": false, "ratio": 4.614649681528663, ...
__author__ = ['dmorina', 'shirish'] from oauth2_provider.oauth2_backends import OAuthLibCore, get_oauthlib_core from django.utils.http import urlencode import ast def get_delimiter(filename, *args, **kwargs): delimiter_map = {'csv': ',', 'tsv': '\t'} delimiter = None extension = filename.split('.')[-1] ...
{ "repo_name": "saviaga/crowdsource-platform", "path": "crowdsourcing/utils.py", "copies": "1", "size": "3889", "license": "mit", "hash": 8239774164165594000, "line_mean": 35.0185185185, "line_max": 104, "alpha_frac": 0.6312676781, "autogenerated": false, "ratio": 4.208874458874459, "config_test...
__author__ = ['dmorina', 'shirish'] from oauth2_provider.oauth2_backends import OAuthLibCore, get_oauthlib_core from django.utils.http import urlencode import ast def get_model_or_none(model, *args, **kwargs): """ Get model object or return None, this will catch the DoesNotExist error. Keyword A...
{ "repo_name": "ramcn/demo2", "path": "crowdsourcing/utils.py", "copies": "5", "size": "3632", "license": "mit", "hash": 2275986935252727800, "line_mean": 34.9702970297, "line_max": 104, "alpha_frac": 0.6316079295, "autogenerated": false, "ratio": 4.218350754936121, "config_test": false, "has_...
__author__ = ['dmorina', 'shirish'] import uuid from rest_framework.exceptions import AuthenticationFailed from django.utils.translation import ugettext_lazy as _ from crowdsourcing import models from datetime import datetime from rest_framework import serializers import json, hashlib, random, re from rest_framework....
{ "repo_name": "saviaga/crowdsource-platform", "path": "crowdsourcing/serializers/user.py", "copies": "1", "size": "9453", "license": "mit", "hash": 3395277921015894500, "line_mean": 40.1043478261, "line_max": 124, "alpha_frac": 0.6476250926, "autogenerated": false, "ratio": 4.370319001386963, "...
__author__ = 'd' from csp import settings from django import forms from django.contrib.auth.models import User class RegistrationForm(forms.Form): email = forms.EmailField(label='', widget=forms.TextInput(attrs={'class':'form-control', ...
{ "repo_name": "saviaga/crowdsource-platform", "path": "crowdsourcing/forms.py", "copies": "9", "size": "7962", "license": "mit", "hash": -5650967646976985000, "line_mean": 60.2461538462, "line_max": 120, "alpha_frac": 0.3364732479, "autogenerated": false, "ratio": 7.568441064638783, "config_tes...
__author__ = 'dnovogrodsky' import re import pathlib import os from subprocess import call #machineName = re.compile('(deflogix-pc.def-logix.local)') machineName = re.compile('(andre_sp3.def-logix.local)') inputSyslogMessages = open('messages','r') outputSyslogMessages = open('syslogMessages.txt', 'w') # read the in...
{ "repo_name": "DavidNovo/ExplorationsWithPython", "path": "importSyslogFiles.py", "copies": "1", "size": "1528", "license": "mit", "hash": 14008280263537180, "line_mean": 32.9777777778, "line_max": 108, "alpha_frac": 0.7336387435, "autogenerated": false, "ratio": 3.561771561771562, "config_test...
__author__ = 'Dobias van Ingen' import paramiko import sys import os import time test = os.system('ping 192.168.56.102') cmd = "display version\n" host = '192.168.56.102' user = 'dobias' passwd = 'HPRocks2' port = 22 ip = sys.argv[1] def etss_range(etssrange): hosts = [] block = etssrange.split('.') ...
{ "repo_name": "rbatist/HPN-Scripting", "path": "etss_scp_in.py", "copies": "2", "size": "1514", "license": "mit", "hash": -3004067570582508500, "line_mean": 23.4193548387, "line_max": 69, "alpha_frac": 0.5277410832, "autogenerated": false, "ratio": 3.5623529411764707, "config_test": false, "h...
__author__ = 'dolel' from math import sqrt class Recommender: def __init__(self, data, k_nearest_neighbor_value=1, max_no_of_recommendations=5): """ Initialize Recommender Currently, if data is dictionary, the recommender is initialized to it. For all other types of data, no initi...
{ "repo_name": "dolel13/GeekNightRecommendationEngine", "path": "recommender.py", "copies": "1", "size": "7570", "license": "apache-2.0", "hash": 865952906519872800, "line_mean": 44.3293413174, "line_max": 125, "alpha_frac": 0.5787318362, "autogenerated": false, "ratio": 3.9121447028423773, "con...
__author__ = "Domenico Solazzo" __version__ = "0.1" RESPONSE_CODES = { 200: "OK: Success", 202: "Accepted: The request was accepted and the user was queued for processing", 401: "Not Authorized: either you need to provide authentication credentials, or the credentials provided aren't valid.", ...
{ "repo_name": "domenicosolazzo/PythonKlout", "path": "pythonklout.py", "copies": "1", "size": "8616", "license": "mit", "hash": 7332461578272248000, "line_mean": 38.1636363636, "line_max": 168, "alpha_frac": 0.5023212628, "autogenerated": false, "ratio": 4.366953877344146, "config_test": false,...