text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = '1'
from model.group import Group
import random
import string
import os.path
import getopt
import sys
import time
import clr
clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c')
from Microsoft.Office.Interop import Excel
try:
op... | {
"repo_name": "liliasapurina/ironpython_training",
"path": "generator/group.py",
"copies": "1",
"size": "1230",
"license": "apache-2.0",
"hash": 6179516049224937000,
"line_mean": 20.224137931,
"line_max": 124,
"alpha_frac": 0.6723577236,
"autogenerated": false,
"ratio": 2.9782082324455206,
"con... |
__author__ = '1'
from pytest_bdd import given, when, then
from model.address import Address
import random
@given('a address list')
def address_list(db):
return db.get_address_list()
@given('a address with <name>,<nickname>,<lastname>,<middlename>')
def new_address(name,nickname,lastname,middlename):
return A... | {
"repo_name": "liliasapurina/python_training",
"path": "bdd/address_steps.py",
"copies": "1",
"size": "2582",
"license": "apache-2.0",
"hash": -1650964450218694400,
"line_mean": 38.7230769231,
"line_max": 128,
"alpha_frac": 0.7257939582,
"autogenerated": false,
"ratio": 3.3488975356679638,
"con... |
__author__ = '1'
from pytest_bdd import given, when, then
from model.group import Group
import random
@given('a group list')
def group_list(db):
return db.get_group_list()
@given('a group with <name>, <header> and <footer>')
def new_group(name, header, footer):
return Group(name=name, header=header, footer=f... | {
"repo_name": "liliasapurina/python_training",
"path": "bdd/group_steps.py",
"copies": "1",
"size": "1525",
"license": "apache-2.0",
"hash": -3130263287801531000,
"line_mean": 31.4468085106,
"line_max": 93,
"alpha_frac": 0.6970491803,
"autogenerated": false,
"ratio": 3.0684104627766597,
"config... |
__author__ = '1'
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.project import ProjectHelper
from fixture.james import JamesHelper
from fixture.signup import SignupHelper
from fixture.mail import MailHelper
from fixture.soap import SoapHelper
class Application:
def __init__... | {
"repo_name": "liliasapurina/python_training_mantiss",
"path": "fixture/application.py",
"copies": "1",
"size": "1221",
"license": "apache-2.0",
"hash": 2666932139152073000,
"line_mean": 27.4186046512,
"line_max": 65,
"alpha_frac": 0.6142506143,
"autogenerated": false,
"ratio": 4.153061224489796,... |
__author__ = '1'
import pytest
import json
import os.path
import importlib
import jsonpickle
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.p... | {
"repo_name": "liliasapurina/python_training",
"path": "conftest.py",
"copies": "1",
"size": "2462",
"license": "apache-2.0",
"hash": -6900977132761336000,
"line_mean": 30.5641025641,
"line_max": 129,
"alpha_frac": 0.6783103168,
"autogenerated": false,
"ratio": 3.6636904761904763,
"config_test"... |
__author__ = '1'
class Contact:
def __init__(self, first_name, middle_name, last_name, nickname, photo, title, company, address, phones, emails,
homepage, birthday, anniversary, group, secondary):
self.first_name = first_name
self.middle_name = middle_name
self.last_name =... | {
"repo_name": "Acket74/python_training",
"path": "contact.py",
"copies": "1",
"size": "1900",
"license": "apache-2.0",
"hash": 766454364917166100,
"line_mean": 31.2033898305,
"line_max": 116,
"alpha_frac": 0.6110526316,
"autogenerated": false,
"ratio": 3.4608378870673953,
"config_test": false,
... |
__author__ = '3ev0'
import argparse
import logging
import sys
import datetime
from dnsmon import service
from dnsmon import webapp
_log = logging.getLogger()
DEF_INTERVAL = 60*24
def main():
argparser = argparse.ArgumentParser(description="Control the dns-monitor services.")
argparser.add_argument("-d", "-... | {
"repo_name": "3ev0/dns-monitor",
"path": "dnsmon/cli.py",
"copies": "1",
"size": "1504",
"license": "apache-2.0",
"hash": 6826737889758097000,
"line_mean": 35.7073170732,
"line_max": 164,
"alpha_frac": 0.6715425532,
"autogenerated": false,
"ratio": 3.659367396593674,
"config_test": false,
"h... |
__author__ = '3ev0'
import unittest
from dnsmon import whois
class MyTestCase(unittest.TestCase):
def setUp(self):
self.whoisclient = whois.WhoisClient()
# def test_talk_whois(self):
# resp = self.whoisclient._talk_whois("whois.iana.org", "nu.nl")
# self.assertIn("source:", resp)
... | {
"repo_name": "3ev0/dns-monitor",
"path": "dnsmon/tests/whois_test.py",
"copies": "1",
"size": "2072",
"license": "apache-2.0",
"hash": -1482039249084187600,
"line_mean": 32.4193548387,
"line_max": 120,
"alpha_frac": 0.597007722,
"autogenerated": false,
"ratio": 3.139393939393939,
"config_test"... |
__author__ = '3ev0'
"""
Whois library.
See RFC 3912
https://www.icann.org/resources/pages/approved-with-specs-2013-09-17-en#whois
We parse the key/value pairs as-is and do not try to transform to a uniformish format. This should be good enough.
How to deal with domain intermediaries? This is, afaik, limited to .com, ... | {
"repo_name": "3ev0/dns-monitor",
"path": "dnsmon/whois.py",
"copies": "1",
"size": "9321",
"license": "apache-2.0",
"hash": 130123753985403380,
"line_mean": 34.5763358779,
"line_max": 123,
"alpha_frac": 0.634159425,
"autogenerated": false,
"ratio": 3.61139093374661,
"config_test": true,
"has... |
__author__ = '4Thing'
import urllib2
import random
import threading
import thread
import Queue
user_agent_list = \
[
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 "
"(KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",
"Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKi... | {
"repo_name": "4xin/scrapy-study",
"path": "urllibTest/urllibDemo.py",
"copies": "1",
"size": "3915",
"license": "apache-2.0",
"hash": -6904811541591299000,
"line_mean": 36.4019607843,
"line_max": 119,
"alpha_frac": 0.601532567,
"autogenerated": false,
"ratio": 2.847272727272727,
"config_test":... |
__author__ = '4Thing'
import urllib2
import threading
import thread
import Queue
user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 "
ip_queue = Queue.Queue()
threads = []
lock = thread.allocate_lock()
file = open("D:\Doc\ips.txt")
for line in file:
ip_queue.put(line.rstrip())
def... | {
"repo_name": "4xin/scrapy-study",
"path": "ProxyAuth/ProxyAuth.py",
"copies": "1",
"size": "1183",
"license": "apache-2.0",
"hash": 9043869931886548000,
"line_mean": 26.9024390244,
"line_max": 92,
"alpha_frac": 0.5655114117,
"autogenerated": false,
"ratio": 3.3512747875354107,
"config_test": f... |
__author__ = '7634'
import socket
import sys
from math import sin,cos
from time import clock,sleep
# Create a socket (SOCK_STREAM means a TCP socket)
class ModelKtn:
""" Ktn model
"""
def __init__(self):
self.n = 10.0
self.v = 2.77
self.w = 1.0
self.omega = 1... | {
"repo_name": "juhnowski/DataStreams",
"path": "udp_ktn.py",
"copies": "1",
"size": "1884",
"license": "mit",
"hash": 339785135135966400,
"line_mean": 25.7352941176,
"line_max": 68,
"alpha_frac": 0.4102972399,
"autogenerated": false,
"ratio": 3.108910891089109,
"config_test": false,
"has_no_k... |
__author__ = '7634'
import socket
import sys
from math import sin,cos,sqrt,pi
from time import clock,sleep
# Create a socket (SOCK_STREAM means a TCP socket)
class ModelTas:
""" Tas model
"""
def __init__(self):
self.n = 50.0
self.t = 0.0
self.x_max = 1280.0
... | {
"repo_name": "juhnowski/DataStreams",
"path": "udp_tas.py",
"copies": "1",
"size": "2985",
"license": "mit",
"hash": 5145508383742742000,
"line_mean": 26.4476190476,
"line_max": 79,
"alpha_frac": 0.4525963149,
"autogenerated": false,
"ratio": 3,
"config_test": false,
"has_no_keywords": false... |
__author__ = '7634'
import socket
import sys
from math import sin,cos,sqrt
from time import clock,sleep
# Create a socket (SOCK_STREAM means a TCP socket)
class ModelLd:
""" Ktn model
"""
def __init__(self):
self.n = 100.0
self.y_min = -3000.0
self.y_max = 3000.0
... | {
"repo_name": "juhnowski/DataStreams",
"path": "udp_ld.py",
"copies": "1",
"size": "1319",
"license": "mit",
"hash": 1718320720330337500,
"line_mean": 23.4038461538,
"line_max": 68,
"alpha_frac": 0.4821834723,
"autogenerated": false,
"ratio": 3.2170731707317075,
"config_test": false,
"has_no_... |
__author__ = 'aagrawal'
__version__ = '0.9'
# Interface for accessing the VQA dataset.
# This code is based on the code written by Tsung-Yi Lin for MSCOCO Python API available at the following link:
# (https://github.com/pdollar/coco/blob/master/PythonAPI/pycocotools/coco.py).
# The following functions are defined:... | {
"repo_name": "VT-vision-lab/VQA",
"path": "PythonHelperTools/vqaTools/vqa.py",
"copies": "1",
"size": "7157",
"license": "bsd-2-clause",
"hash": -2754397214706195000,
"line_mean": 39.2078651685,
"line_max": 233,
"alpha_frac": 0.6652228587,
"autogenerated": false,
"ratio": 3.219523166891588,
"c... |
__author__ = 'aagrawal'
__version__ = '0.9'
"""
Modified by Mateusz Malinowski [mmalinow@mpi-inf.mpg.de] to work
with test datasets without annotations.
"""
# Interface for accessing the VQA dataset.
# This code is based on the code written by Tsung-Yi Lin for MSCOCO Python API available at the following link:
# (... | {
"repo_name": "mateuszmalinowski/visual_turing_test-tutorial",
"path": "kraino/utils/vqaTools/vqa.py",
"copies": "1",
"size": "8434",
"license": "mit",
"hash": 1412840564757121800,
"line_mean": 42.6994818653,
"line_max": 233,
"alpha_frac": 0.5833530946,
"autogenerated": false,
"ratio": 3.90101757... |
__author__ = 'aahammer'
import datetime
import time
from time import mktime
def getMatchData(tree):
match_col = {}
if tree.xpath('//span[@id="lblHeader"][1]')[0].text == None:
return
match_col['queue_type'], match_col['match_type'] = tree.xpath('//span[@id="lblHeader"][1]')[0].text.split(':')
... | {
"repo_name": "aahammer/smitestats",
"path": "src/load/parseSmiteMatch.py",
"copies": "1",
"size": "2700",
"license": "mit",
"hash": -902340133176381400,
"line_mean": 39.9242424242,
"line_max": 162,
"alpha_frac": 0.5748148148,
"autogenerated": false,
"ratio": 3.3834586466165413,
"config_test": ... |
__author__ = 'aakilomar'
import requests, json, time
requests.packages.urllib3.disable_warnings()
host = "https://localhost:8443"
#from rest_requests import add_user
def add_user(phone):
post_url = host + "/api/user/add/" + str(phone)
return requests.post(post_url,None, verify=False).json()
def add_group(use... | {
"repo_name": "PaballoDitshego/grassroot-platform",
"path": "docs/tests/vote_requests.py",
"copies": "2",
"size": "2148",
"license": "bsd-3-clause",
"hash": 4294464664050359000,
"line_mean": 30.5882352941,
"line_max": 96,
"alpha_frac": 0.6601489758,
"autogenerated": false,
"ratio": 2.887096774193... |
__author__ = 'aakilomar'
import requests, json, time
from timeit import default_timer as timer
requests.packages.urllib3.disable_warnings()
host = "https://localhost:8443"
def cancel_event(eventid):
post_url = host + "/api/event/cancel/" + str(eventid)
return requests.post(post_url,None, verify=False).json(... | {
"repo_name": "mokoka/grassroot-platform",
"path": "docs/tests/adhoc_requests.py",
"copies": "2",
"size": "5668",
"license": "bsd-3-clause",
"hash": 5066557155340078000,
"line_mean": 39.7769784173,
"line_max": 159,
"alpha_frac": 0.6887791108,
"autogenerated": false,
"ratio": 2.9551616266944736,
... |
__author__ = 'aakilomar'
import requests, json, time
requests.packages.urllib3.disable_warnings()
host = "https://localhost:8443"
# different project but left as an example
def rewrite_event(event):
post_url = host + "/api/event/create/"
headers = {"Authorization" : "(some auth code)", "Accept" : "applicatio... | {
"repo_name": "mokoka/grassroot-platform",
"path": "docs/tests/rest_requests.py",
"copies": "2",
"size": "6527",
"license": "bsd-3-clause",
"hash": 3690699247240019500,
"line_mean": 32.3010204082,
"line_max": 120,
"alpha_frac": 0.6880649609,
"autogenerated": false,
"ratio": 2.880406001765225,
"... |
__author__ = 'aamir'
import argparse
from model import LatLongData
from model import PlaceData
def get_latlong(days):
latlong_data = LatLongData(int(days)).get_data()
display(latlong_data)
def get_places(days):
places_data = PlaceData(int(days)).get_data()
display(places_data)
def display(data):
... | {
"repo_name": "aamir/eathquake",
"path": "main.py",
"copies": "1",
"size": "1183",
"license": "mit",
"hash": -2337871117599279000,
"line_mean": 33.7941176471,
"line_max": 127,
"alpha_frac": 0.5984784446,
"autogenerated": false,
"ratio": 3.70846394984326,
"config_test": false,
"has_no_keywords... |
__author__ = 'aamir'
import math
class Aggregator:
def __init__(self):
self.magnitude = []
self.max_mag = 0
self.count = 0
self.total_energy = 0
self.max_energy = 0
def add_magnitude(self, magnitude):
self.count += 1
self.magnitude.append(magnitude)
... | {
"repo_name": "aamir/eathquake",
"path": "aggregator.py",
"copies": "1",
"size": "1179",
"license": "mit",
"hash": -7470073298244385000,
"line_mean": 27.0714285714,
"line_max": 113,
"alpha_frac": 0.5530110263,
"autogenerated": false,
"ratio": 3.6055045871559632,
"config_test": false,
"has_no_... |
__author__ = 'aamir'
import os
import sqlite3
import requests
import datetime
api_endpoint = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojson"
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
class Data... | {
"repo_name": "aamir/eathquake",
"path": "data.py",
"copies": "1",
"size": "3374",
"license": "mit",
"hash": -8626345582344966000,
"line_mean": 36.9101123596,
"line_max": 127,
"alpha_frac": 0.5444576171,
"autogenerated": false,
"ratio": 3.795275590551181,
"config_test": false,
"has_no_keyword... |
__author__ = 'Aamir'
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_noop as _
from .fields import AutoCleanField
from .util import clean
def base_clean_model(**kwargs):
defaults = {
'depends_on': 'name',
'unique': Tru... | {
"repo_name": "intellisense/django-autoclean",
"path": "autoclean/models.py",
"copies": "1",
"size": "1174",
"license": "mit",
"hash": -6593532050342292000,
"line_mean": 29.8947368421,
"line_max": 122,
"alpha_frac": 0.5902896082,
"autogenerated": false,
"ratio": 4.2690909090909095,
"config_test... |
__author__ = 'Aamir'
from django.db.models import CharField
from django.utils.translation import ugettext_noop as _
from django.core.exceptions import FieldDoesNotExist
from django.core import checks
from .managers import AutoCleanManager
from .util import clean
class AutoCleanField(CharField):
"""
A lower ... | {
"repo_name": "intellisense/django-autoclean",
"path": "autoclean/fields.py",
"copies": "1",
"size": "3982",
"license": "mit",
"hash": 2679181184261474300,
"line_mean": 36.214953271,
"line_max": 108,
"alpha_frac": 0.5894023104,
"autogenerated": false,
"ratio": 4.191578947368421,
"config_test": ... |
__author__ = 'aarongary'
from models.SearchResult import SearchResultModel
from models.GroupedItem import GroupedItem
class ConditionResultModel(SearchResultModel):
def __init__(self):
self.conditionId = 'cosmic_clinvar'
def addGroupedCosmicConditions(self, groupItemTermName, groupedCondition):
... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/models/ConditionResults.py",
"copies": "1",
"size": "2201",
"license": "mit",
"hash": 7723667087863331000,
"line_mean": 40.5283018868,
"line_max": 87,
"alpha_frac": 0.6851431168,
"autogenerated": false,
"ratio": 4.315686274509804,
"conf... |
__author__ = 'aarongary'
import pymongo
from bottle import Bottle, request, HTTPError, response
import app
from app import genemania
from bson.json_util import dumps
api = Bottle()
@api.put('/api/nav/project/:id/state/:state')
def put_state(id, state):
client = pymongo.MongoClient(app.mongodb_uri)
genelis... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/nav/myIOSREST.py",
"copies": "1",
"size": "1156",
"license": "mit",
"hash": 6650077529675422000,
"line_mean": 22.5918367347,
"line_max": 116,
"alpha_frac": 0.6461937716,
"autogenerated": false,
"ratio": 3.274787535410765,
"config_te... |
__author__ = 'aarongary'
import pymongo
import app.MyGeneInfo
from elasticsearch import Elasticsearch
from app import elastic_search_uri
class TermAnalyzer():
def get_resolved_terms(self):
return self.terms
def process_terms_bulk(self, terms):
terms_with_id = []
#====================... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/models/TermResolver.py",
"copies": "1",
"size": "21104",
"license": "mit",
"hash": -7926714475220083000,
"line_mean": 36.0896309315,
"line_max": 113,
"alpha_frac": 0.4542740713,
"autogenerated": false,
"ratio": 3.4104718810601162,
"conf... |
__author__ = 'aarongary'
import pymongo
import sys
import requests
import os
import json
def populate_gene_db():
client = pymongo.MongoClient()
db = client.identifiers
genemania = db.genemania
genemania_pubmed = db.genemania_pubmed
genemania_pubmed.drop()
genemania_items = genemania.find({'so... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/genemania_pubmed.py",
"copies": "1",
"size": "3764",
"license": "mit",
"hash": -3485441007078305300,
"line_mean": 28.6377952756,
"line_max": 145,
"alpha_frac": 0.5719978746,
"autogenerated": false,
"ratio": 3.5779467680608366,
"conf... |
__author__ = 'aarongary'
import requests
import tarfile,sys
import urllib2
import json
import time
import app.genemania
import pymongo
from itertools import islice
from bson.json_util import dumps
def lookup_id(name):
'''
:param name: gene id, symbol, or synonym to find in the name column (case insensitive)
... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/NihNcbi.py",
"copies": "1",
"size": "2200",
"license": "mit",
"hash": -3529697229851589600,
"line_mean": 31.3529411765,
"line_max": 159,
"alpha_frac": 0.6045454545,
"autogenerated": false,
"ratio": 3.6065573770491803,
"config_test":... |
__author__ = 'aarongary'
import requests
import tarfile,sys
import urllib2
import json
import time
import pymongo
import nav.api
from itertools import islice
from elasticsearch import Elasticsearch
from bson.json_util import dumps
from collections import Counter
from app import go
from app import PubMed
#es = Elastics... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/NeighborhoodSearch.py",
"copies": "1",
"size": "4801",
"license": "mit",
"hash": 5946266885547932000,
"line_mean": 31.8904109589,
"line_max": 128,
"alpha_frac": 0.5682149552,
"autogenerated": false,
"ratio": 3.7332814930015554,
"con... |
__author__ = 'aarongary'
import unittest
import warnings
from app import SearchPathwaysTab
from app import SearchConditionsTab
from app import SearchAuthorsTab
from app import SearchDrugsTab
from app import SearchViz
from bson.json_util import dumps
#from app.nav import job_queue
import json
class ClusterSearchTests(u... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/unit_tests/Search_Tests.py",
"copies": "1",
"size": "2878",
"license": "mit",
"hash": -2571232189833258000,
"line_mean": 37.3733333333,
"line_max": 105,
"alpha_frac": 0.5889506602,
"autogenerated": false,
"ratio": 3.9751381215469612,
"c... |
__author__ = 'aarongary'
from app import PubMed
from app import elastic_search_uri
from collections import Counter
from elasticsearch import Elasticsearch
from bson.json_util import dumps
import matplotlib.pyplot as plt
import matplotlib.colors as mpclrs
import pymongo
from multiprocessing import Manager, Process
impo... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchInferredDrugsTab.py",
"copies": "1",
"size": "22412",
"license": "mit",
"hash": -9033547962789414000,
"line_mean": 36.986440678,
"line_max": 412,
"alpha_frac": 0.5054881314,
"autogenerated": false,
"ratio": 3.5557670950341107,
... |
__author__ = 'aarongary'
from app import PubMed
from app import elastic_search_uri
from collections import Counter
from elasticsearch import Elasticsearch
es = Elasticsearch([elastic_search_uri],send_get_body_as='POST',timeout=300)
#============================
#============================
# DRUG SEARCH
#=====... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchDrugsTab.py",
"copies": "1",
"size": "15395",
"license": "mit",
"hash": 4439462251718326000,
"line_mean": 32.7609649123,
"line_max": 122,
"alpha_frac": 0.5412146801,
"autogenerated": false,
"ratio": 3.9575835475578405,
"config... |
__author__ = 'aarongary'
from collections import Counter
from app import PubMed
from app import elastic_search_uri
from app import util
from models.TermResolver import TermAnalyzer
from elasticsearch import Elasticsearch
import numpy as np
import networkx as nx
import pandas as pd
import community
import matplotlib.py... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchPathwaysTab.py",
"copies": "1",
"size": "74638",
"license": "mit",
"hash": -3359700570773812700,
"line_mean": 38.3660337553,
"line_max": 293,
"alpha_frac": 0.5175245853,
"autogenerated": false,
"ratio": 3.7806706514031,
"confi... |
__author__ = 'aarongary'
from collections import Counter
from app import PubMed
from models.TermResolver import TermAnalyzer
from elasticsearch import Elasticsearch
from app import elastic_search_uri
from app import path_to_cluster_file
from app import path_to_DB_file
from app import util
import numpy as np
import net... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchViz.py",
"copies": "1",
"size": "87637",
"license": "mit",
"hash": 345687025269189400,
"line_mean": 39.5726851852,
"line_max": 412,
"alpha_frac": 0.5138354804,
"autogenerated": false,
"ratio": 3.6442531603459747,
"config_test"... |
__author__ = 'aarongary'
from collections import Counter
from app import PubMed
from models.TermResolver import TermAnalyzer
from elasticsearch import Elasticsearch
es = Elasticsearch(['http://ec2-52-24-205-32.us-west-2.compute.amazonaws.com:9200/'],send_get_body_as='POST') # Clustered Server
#======================... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchGeneTab.py",
"copies": "1",
"size": "12062",
"license": "mit",
"hash": 2978320720312095000,
"line_mean": 33.5616045845,
"line_max": 220,
"alpha_frac": 0.5341568562,
"autogenerated": false,
"ratio": 3.937969311132876,
"config_t... |
__author__ = 'aarongary'
from elasticsearch import Elasticsearch
from app import elastic_search_uri
from app import util
import pymongo
es = Elasticsearch([elastic_search_uri],send_get_body_as='POST',timeout=300) # Prod Clustered Server
def get_people_people_pubmed_search_mapped2(queryTerms, pageNumber=1):
"""Se... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchAuthorsTab.py",
"copies": "1",
"size": "9013",
"license": "mit",
"hash": -4442008409606309400,
"line_mean": 32.258302583,
"line_max": 137,
"alpha_frac": 0.4516809054,
"autogenerated": false,
"ratio": 4.464091134224864,
"config... |
__author__ = 'aarongary'
from itertools import groupby
from elasticsearch import Elasticsearch
from app import elastic_search_uri
from bson.json_util import dumps
from models.ConditionSearchModel import ConditionSearchResults
import pymongo
from app import util
from operator import itemgetter
es = Elasticsearch([elas... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/SearchConditionsTab.py",
"copies": "1",
"size": "39357",
"license": "mit",
"hash": -4482864544533970000,
"line_mean": 36.6622009569,
"line_max": 197,
"alpha_frac": 0.5066188988,
"autogenerated": false,
"ratio": 3.8878790872271067,
"... |
__author__ = 'aarongary'
from xml.dom import minidom
from bson.json_util import dumps
import xml.etree.ElementTree as ET
import requests
import pymongo
def get_drugbank_synonym(drugbank_id):
client = pymongo.MongoClient()
db = client.identifiers
drugbank_lookup = db.drugbank
result = drugbank_lookup... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/DrugBank.py",
"copies": "1",
"size": "2387",
"license": "mit",
"hash": 8207706602907682000,
"line_mean": 33.1,
"line_max": 131,
"alpha_frac": 0.5651445329,
"autogenerated": false,
"ratio": 3.557377049180328,
"config_test": false,
... |
__author__ = 'aarongary'
import json
class DrugSearchResult():
def __init__(self):
self.inferred_drugs = []
def add_drug_item(self, drug_item):
# Search the dictionary for the grouping term
# if we find it we append the grouped condition
# if we don't find it we insert the gro... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/models/DrugResultModel.py",
"copies": "1",
"size": "1193",
"license": "mit",
"hash": -2221320215847401700,
"line_mean": 35.1818181818,
"line_max": 87,
"alpha_frac": 0.5825649623,
"autogenerated": false,
"ratio": 4.003355704697986,
"conf... |
__author__ = 'aarongary'
import requests
import tarfile,sys
import urllib2
import json
from itertools import islice
from bson.json_util import dumps
from collections import Counter
def getEntrezGeneInfoByID(gene_id):
if(len(gene_id) > 0):
try:
entrez_url = "http://eutils.ncbi.nlm.nih.gov/entr... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/restLayer/app/RestBroker.py",
"copies": "1",
"size": "2808",
"license": "mit",
"hash": 3738412820966717400,
"line_mean": 26.2621359223,
"line_max": 128,
"alpha_frac": 0.5413105413,
"autogenerated": false,
"ratio": 3.4752475247524752,
"config_test... |
import random
import traceback
from copy import copy
random.seed()
class bracket:
def __init__(self, left, right, victor):
self.left=left
self.right=right
self.victor=victor
self.mapped=False
self.mappedTo=None
self.num=0
self.status=0
self.generation=... | {
"repo_name": "captianjroot/EquationBrackets",
"path": "bracket.py",
"copies": "1",
"size": "8753",
"license": "mit",
"hash": -4658322482003922000,
"line_mean": 35.3195020747,
"line_max": 143,
"alpha_frac": 0.5673483377,
"autogenerated": false,
"ratio": 3.6854736842105265,
"config_test": false,... |
import socket
import os
import time
import threading
import bracket
import weakref
#from switches import switch, case
import random
from datetime import date
lock = (date.today()>date(2014,4,8))
Shutdown=False
clients={}
sessions={}
submitted=set()
version=1.02
pointSystem=[16,8,4,2,1]
master=None
key=None
source=None
... | {
"repo_name": "captianjroot/EquationBrackets",
"path": "bracketServer.py",
"copies": "1",
"size": "18913",
"license": "mit",
"hash": 336747781909883400,
"line_mean": 33.0161870504,
"line_max": 95,
"alpha_frac": 0.5691852165,
"autogenerated": false,
"ratio": 3.7645302547770703,
"config_test": fa... |
__author__ = 'Aaron Hosford'
__all__ = [
'ScoringMeasure',
]
class ScoringMeasure:
"""A generalized categorization of a parse tree node within its parse
tree which acts as a key for storing/retrieving scores and their
accuracies. Roughly analogous to XCS (Accuracy-based Classifier System)
rules.""... | {
"repo_name": "hosford42/pyramids",
"path": "pyramids/scoring.py",
"copies": "1",
"size": "1050",
"license": "mit",
"hash": -1750060305961810700,
"line_mean": 26.6315789474,
"line_max": 75,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.9923954372623576,
"config_test": false,
"has_no_k... |
__author__ = 'Aaron Hosford'
__all__ = [
'Timeout',
'GrammarParserError',
'GrammarSyntaxError',
]
class Timeout(Exception):
pass
class GrammarParserError(Exception):
def __init__(self, msg=None, filename=None, lineno=1, offset=1,
text=None):
super().__init__(msg, (filen... | {
"repo_name": "hosford42/pyramids",
"path": "pyramids/exceptions.py",
"copies": "1",
"size": "1541",
"license": "mit",
"hash": 7860788195168563000,
"line_mean": 25.5689655172,
"line_max": 75,
"alpha_frac": 0.5340687865,
"autogenerated": false,
"ratio": 4.120320855614973,
"config_test": false,
... |
__author__ = 'Aaron Hosford'
import logging
import unittest
import xcs
import xcs.bitstrings as bitstrings
import xcs.scenarios
class TestBitString(unittest.TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.use_numpy = False
def run(self, result=None):
... | {
"repo_name": "hosford42/xcs",
"path": "tests/test_bitString.py",
"copies": "1",
"size": "5863",
"license": "bsd-3-clause",
"hash": 6341346287876807000,
"line_mean": 31.7541899441,
"line_max": 75,
"alpha_frac": 0.5701859116,
"autogenerated": false,
"ratio": 4.051831375259157,
"config_test": tru... |
__author__ = 'Aaron Hosford'
import unittest
from xcs.bitstrings import BitString
from xcs.scenarios import HaystackProblem
class TestHaystackProblem(unittest.TestCase):
def setUp(self):
self.scenario = HaystackProblem(10)
def test_get_possible_actions(self):
actions = self.scenario.get_po... | {
"repo_name": "hosford42/xcs",
"path": "tests/test_haystackProblem.py",
"copies": "1",
"size": "1588",
"license": "bsd-3-clause",
"hash": -3121617109990896000,
"line_mean": 29.5384615385,
"line_max": 69,
"alpha_frac": 0.6353904282,
"autogenerated": false,
"ratio": 4.061381074168798,
"config_tes... |
__author__ = "Aaron Huus"
__email__ = "huus@thehumangeo.com"
from random import choice
import sys
import json
import codecs
import glob
import wikipedia
import os.path
from BeautifulSoup import BeautifulSoup
import zipfile
import ntpath
fridge_words = ["service", "backend", "cache", "miss", "database", "op", "monito... | {
"repo_name": "ahuus1/talking-fridge",
"path": "speak.py",
"copies": "1",
"size": "10796",
"license": "mit",
"hash": -2421137960596540400,
"line_mean": 38.401459854,
"line_max": 130,
"alpha_frac": 0.5614116339,
"autogenerated": false,
"ratio": 3.755130434782609,
"config_test": false,
"has_no_... |
__author__ = 'Aaron J. Masino'
from sklearn import metrics
import numpy as np
def negpv(y_actual, y_predicted):
'''calculates the negative predictive value as tn/(tn+fn), where tn = true predicted negatives
fn = false predicted negatives
assuems negative cases are indicated by 0 and positive cases by 1'''... | {
"repo_name": "chop-dbhi/arrc",
"path": "learn/metrics.py",
"copies": "1",
"size": "5990",
"license": "mit",
"hash": -6672611512489178000,
"line_mean": 43.7014925373,
"line_max": 122,
"alpha_frac": 0.6280467446,
"autogenerated": false,
"ratio": 3.0639386189258313,
"config_test": false,
"has_n... |
__author__ = 'Aaron J. Masino'
import numpy as np
from learn.metrics import PerformanceMetrics
import sklearn
def printsf(text, out_file=None, fmode = 'a', print_to_screen=True, carriage_returns=1):
if print_to_screen: print(text)
if out_file:
with open(out_file, fmode) as f:
f.write(text)... | {
"repo_name": "chop-dbhi/arrc",
"path": "learn/printers.py",
"copies": "1",
"size": "3827",
"license": "mit",
"hash": 3831240497916179500,
"line_mean": 53.6714285714,
"line_max": 137,
"alpha_frac": 0.6814737392,
"autogenerated": false,
"ratio": 2.8369162342475907,
"config_test": true,
"has_no... |
__author__ = 'Aaron J. Masino'
import numpy as np
from numpy.random import RandomState
import pandas as pd
from learn import printers, wrangle
from learn.metrics import PerformanceMetrics
import sklearn
from functools import reduce
def load_report(path):
f = open(path,'r')
text = reduce(lambda x,y: x+y, f.rea... | {
"repo_name": "chop-dbhi/arrc",
"path": "keyword_analysis.py",
"copies": "1",
"size": "3129",
"license": "mit",
"hash": 2339957175155129000,
"line_mean": 33.0108695652,
"line_max": 125,
"alpha_frac": 0.6155321189,
"autogenerated": false,
"ratio": 3.4047878128400435,
"config_test": true,
"has_... |
__author__ = 'Aaron J. Masino'
import numpy as np
def extractBy(condition, data, tol = 1e-6):
not_condition = condition[:]==False
return (data[condition], data[not_condition])
def partion(condition, data, ratios=[.6,.2,.2]):
''' returns two lists (l1,l2). l1 is a list of numpy arrays where each array con... | {
"repo_name": "chop-dbhi/arrc",
"path": "learn/wrangle.py",
"copies": "1",
"size": "1775",
"license": "mit",
"hash": -3090557369432531500,
"line_mean": 38.4666666667,
"line_max": 131,
"alpha_frac": 0.6163380282,
"autogenerated": false,
"ratio": 3.0187074829931975,
"config_test": false,
"has_n... |
__author__ = 'Aaron J. Masino'
'''
Created on Feb 3, 2014
@author: masinoa
'''
import nltk.data
from nltk.tokenize import regexp_tokenize
from nltk.corpus import stopwords
import re
from functools import reduce
#load a sentence tokenizer, faster for many tokenizations
sent_tokenizer = nltk.data.load('file:./learn/... | {
"repo_name": "chop-dbhi/arrc",
"path": "nlp/util.py",
"copies": "1",
"size": "3491",
"license": "mit",
"hash": 5654559967217085000,
"line_mean": 36.5376344086,
"line_max": 131,
"alpha_frac": 0.6422228588,
"autogenerated": false,
"ratio": 3.382751937984496,
"config_test": false,
"has_no_keywo... |
import copy
def fieldOfView(startX, startY, mapWidth, mapHeight, radius,
funcVisitTile, funcTileBlocked):
"""
Determines which coordinates on a 2D grid are visible from a
particular coordinate.
startX, startY: The (x, y) coordinate on the grid that
... | {
"repo_name": "RedMike/pYendor",
"path": "lib/fov.py",
"copies": "1",
"size": "11735",
"license": "bsd-2-clause",
"hash": -6715600887052716000,
"line_mean": 30.512465374,
"line_max": 73,
"alpha_frac": 0.567106945,
"autogenerated": false,
"ratio": 3.758808456117873,
"config_test": false,
"has_... |
__author__ = 'Aaron'
englishLetterFreq = {'E': 12.70, 'T': 9.06, 'A': 8.17, 'O': 7.51, 'I':
6.97, 'N': 6.75, 'S': 6.33, 'H': 6.09, 'R': 5.99, 'D': 4.25, 'L': 4.03, 'C':
2.78, 'U': 2.76, 'M': 2.41, 'W': 2.36, 'F': 2.23, 'G': 2.02, 'Y': 1.97, 'P':
1.93, 'B': 1.29, 'V': 0.98, 'K': 0.77, 'J': 0.15, 'X': 0.15, 'Q': 0.10... | {
"repo_name": "Aaron-Cai/PythonCipher",
"path": "freqAnalysis.py",
"copies": "1",
"size": "1684",
"license": "bsd-2-clause",
"hash": 7612826142082984000,
"line_mean": 29.6363636364,
"line_max": 81,
"alpha_frac": 0.614608076,
"autogenerated": false,
"ratio": 2.322758620689655,
"config_test": fal... |
__author__ = 'Aaron'
import pyperclip,sys,os
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def translateMessage(key,message,mode):
translated = []
keyIndex = 0;
key = key.upper()
for symbol in message:
num = LETTERS.find(symbol.upper())
if num!= -1:
if mode == 'encrypt':
num += LETTERS.find(key[keyIndex])... | {
"repo_name": "Aaron-Cai/PythonCipher",
"path": "vigenereCipher.py",
"copies": "1",
"size": "1499",
"license": "bsd-2-clause",
"hash": -125788802840440340,
"line_mean": 17.2804878049,
"line_max": 50,
"alpha_frac": 0.6617745163,
"autogenerated": false,
"ratio": 3.046747967479675,
"config_test": ... |
import numpy as np
import numpy.lib.index_tricks as itricks
from WavefrontPSF.psf_evaluator import Moment_Evaluator
#from scipy.signal import convolve2d as convolve
def convolve(A, B):
""" Performs a convolution of two 2D arrays """
C = np.fft.ifft2(np.fft.fft2(A) * np.fft.fft2(B))
C = np.fft.fftshift(C)
... | {
"repo_name": "aaronroodman/DeconvolvePSF",
"path": "src/lucy.py",
"copies": "1",
"size": "6087",
"license": "mit",
"hash": -1050264533834633900,
"line_mean": 30.3762886598,
"line_max": 142,
"alpha_frac": 0.6004599967,
"autogenerated": false,
"ratio": 3.2481323372465316,
"config_test": false,
... |
import os
import glob
import string
sourcepath = '\src'
distpath = '\dist'
sourcelist = []
for root, dirs, files in os.walk(sourcepath):
for name in files:
pathfile = os.path.join(root, name)
#ignore python extensions
pathfile = string.replace(pathfile, '.pyo', '')
... | {
"repo_name": "lantra/vugamedev",
"path": "comparison.py",
"copies": "1",
"size": "1512",
"license": "mit",
"hash": 3477741370272653300,
"line_mean": 28.6666666667,
"line_max": 77,
"alpha_frac": 0.6342592593,
"autogenerated": false,
"ratio": 3.714987714987715,
"config_test": false,
"has_no_ke... |
__author__ = "Aaron Steele (eightysteele@gmail.com)"
__contributors__ = []
from autocomplete_handler import AutocompleteName
import cache
import collections
import csv
import logging
import json
import urllib
import webapp2
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
from google.ap... | {
"repo_name": "MapofLife/MOL",
"path": "app/search_cache_backend.py",
"copies": "1",
"size": "14424",
"license": "bsd-3-clause",
"hash": -5081427497706750000,
"line_mean": 34.702970297,
"line_max": 258,
"alpha_frac": 0.5644758735,
"autogenerated": false,
"ratio": 3.9626373626373628,
"config_tes... |
__author__ = 'aaronweaver'
from datetime import datetime
import json
from dojo.models import Finding
class BanditParser(object):
def __init__(self, filename, test):
tree = filename.read()
try:
data = json.loads(str(tree, 'utf-8'))
except:
data = json.loads(tree)
... | {
"repo_name": "rackerlabs/django-DefectDojo",
"path": "dojo/tools/bandit/parser.py",
"copies": "2",
"size": "2441",
"license": "bsd-3-clause",
"hash": 8624187820962124000,
"line_mean": 34.3768115942,
"line_max": 86,
"alpha_frac": 0.4354772634,
"autogenerated": false,
"ratio": 4.614366729678639,
... |
__author__ = 'aaronweaver'
from defusedxml import ElementTree
from datetime import datetime
from dojo.models import Finding
class CheckmarxXMLParser(object):
def __init__(self, filename, test):
cxscan = ElementTree.parse(filename)
root = cxscan.getroot()
dupes = dict()
for quer... | {
"repo_name": "Prakhash/security-tools",
"path": "external/django-DefectDojo-1.2.1/dojo/tools/checkmarx/parser.py",
"copies": "4",
"size": "3573",
"license": "apache-2.0",
"hash": 3517576160266509000,
"line_mean": 37.0106382979,
"line_max": 104,
"alpha_frac": 0.4354883851,
"autogenerated": false,
... |
__author__ = 'aaronweaver'
from defusedxml import ElementTree
from dateutil import parser
import ntpath
from dojo.utils import add_language
from dojo.models import Finding
class CheckmarxXMLParser(object):
result_dupes = dict()
language_list = []
def __init__(self, filename, test):
cxscan = Ele... | {
"repo_name": "OWASP/django-DefectDojo",
"path": "dojo/tools/checkmarx/parser.py",
"copies": "1",
"size": "5389",
"license": "bsd-3-clause",
"hash": 8047831438161155000,
"line_mean": 40.7751937984,
"line_max": 170,
"alpha_frac": 0.4910001856,
"autogenerated": false,
"ratio": 4.609923011120616,
... |
__author__ = 'Aaron Weaver'
from dojo.models import Endpoint, Finding
from datetime import datetime
import json
class SSLlabsParser(object):
def __init__(self, filename, test):
tree = filename.read()
try:
data = json.loads(str(tree, 'utf-8'))
except:
data = json.lo... | {
"repo_name": "rackerlabs/django-DefectDojo",
"path": "dojo/tools/ssl_labs/parser.py",
"copies": "1",
"size": "11268",
"license": "bsd-3-clause",
"hash": -1315198056133747700,
"line_mean": 50.2181818182,
"line_max": 116,
"alpha_frac": 0.4875754349,
"autogenerated": false,
"ratio": 4.6048222313036... |
__author__ = 'Aaron Weaver'
from dojo.models import Endpoint, Finding
from datetime import datetime
import json
class SSLlabsParser(object):
def __init__(self, filename, test):
tree = json_output.read()
try:
data = json.loads(str(tree, 'utf-8'))
except:
data = json... | {
"repo_name": "OWASP/django-DefectDojo",
"path": "dojo/tools/ssl_labs/parser.py",
"copies": "1",
"size": "11271",
"license": "bsd-3-clause",
"hash": 13686470994533472,
"line_mean": 50.2318181818,
"line_max": 116,
"alpha_frac": 0.4876231035,
"autogenerated": false,
"ratio": 4.60228664761127,
"co... |
__author__ = 'aaronweaver'
import pandas as pd
import hashlib
from dojo.models import Finding, Endpoint
class ContrastCSVParser(object):
def __init__(self, filename, test):
dupes = dict()
self.items = ()
if filename is None:
self.items = ()
return
df = p... | {
"repo_name": "OWASP/django-DefectDojo",
"path": "dojo/tools/contrast/parser.py",
"copies": "2",
"size": "4897",
"license": "bsd-3-clause",
"hash": -6651149804168665000,
"line_mean": 39.1393442623,
"line_max": 275,
"alpha_frac": 0.4621196651,
"autogenerated": false,
"ratio": 4.576635514018691,
... |
__author__ = 'aaronweaver'
import re
from defusedxml import ElementTree as ET
import hashlib
from urllib.parse import urlparse
from dojo.models import Finding, Endpoint
class NiktoXMLParser(object):
def __init__(self, filename, test):
dupes = dict()
self.items = ()
if filename is None:... | {
"repo_name": "rackerlabs/django-DefectDojo",
"path": "dojo/tools/nikto/parser.py",
"copies": "2",
"size": "5143",
"license": "bsd-3-clause",
"hash": -7994457130637868000,
"line_mean": 38.5615384615,
"line_max": 534,
"alpha_frac": 0.4458487264,
"autogenerated": false,
"ratio": 4.036891679748822,
... |
import argparse
import os
import pickle
import subprocess
import sys
import smtplib
comps = ['neutron', 'python-neutronclient', 'horizon']
rmadison_cmd = 'rmadison %(comp)s | grep "%(ppa)s "'
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--ppa', required = True,
... | {
"repo_name": "CiscoSystems/n1kv-openstack-tools",
"path": "canonical/rebase_warning.py",
"copies": "1",
"size": "1806",
"license": "apache-2.0",
"hash": -2257821476985970700,
"line_mean": 35.8571428571,
"line_max": 150,
"alpha_frac": 0.5470653378,
"autogenerated": false,
"ratio": 4.0044345898004... |
__author__ = 'abc'
from pyquery import PyQuery as pq
import datetime
def removeScript(input, output):
with open(input) as f1:
with open(output, 'w') as f2:
scriptFlag = 0
for eachline in f1:
tagStartCnt = eachline.count('<script')
tagStopCnt = eachli... | {
"repo_name": "SamhooXee/other",
"path": "douban/douban_parse_131106A.py",
"copies": "1",
"size": "3041",
"license": "mit",
"hash": -8750948564373744000,
"line_mean": 34.7882352941,
"line_max": 92,
"alpha_frac": 0.420914173,
"autogenerated": false,
"ratio": 3.964797913950456,
"config_test": fal... |
__author__ = 'Abdullah AA'
from html.parser import HTMLParser
class ImageParser(HTMLParser):
image_links = []
image_names = []
def handle_starttag(self, tag, attrs):
target_found = False
if tag == 'a':
for temp_tuple in attrs:
if temp_tuple[0] == 'class' and ... | {
"repo_name": "Ansari90/grab_n_save",
"path": "ResponseParser.py",
"copies": "1",
"size": "1049",
"license": "mit",
"hash": -428309185360462660,
"line_mean": 27.3783783784,
"line_max": 77,
"alpha_frac": 0.515729266,
"autogenerated": false,
"ratio": 3.988593155893536,
"config_test": false,
"ha... |
__author__ = 'abdullah'
from api import views
from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = [
url(r'^contents$', views.Contents.as_view()),
url(r'^links', views.Links.as_view()),
url(r'^contents/(?P<content_link>\w+)$', views.Content... | {
"repo_name": "haliciyazilim/beste-yarismasi",
"path": "server/api/urls.py",
"copies": "1",
"size": "1222",
"license": "mit",
"hash": 1936785145095909400,
"line_mean": 42.6428571429,
"line_max": 74,
"alpha_frac": 0.6415711948,
"autogenerated": false,
"ratio": 3.0936708860759494,
"config_test": ... |
__author__ = 'AbdullahS'
from pprint import pprint, pformat # NOQA
from hydra.lib import util
import time
import sys
import logging
import os
import random
from hydra.lib.childmgr import ChildManager
l = util.createlogger('MOCKAPI', logging.INFO)
# l.setLevel(logging.DEBUG)
class TaskInfo(object):
"""
Tas... | {
"repo_name": "sushilks/hydra",
"path": "src/main/python/hydra/lib/mock_backend.py",
"copies": "4",
"size": "8204",
"license": "apache-2.0",
"hash": 8287475296248777000,
"line_mean": 29.1617647059,
"line_max": 95,
"alpha_frac": 0.551316431,
"autogenerated": false,
"ratio": 3.7021660649819497,
"... |
__author__ = 'AbdullahS'
from pprint import pprint, pformat # NOQA
import logging
from hydra.lib import util
from hydra.lib.utility.py_sys_cmd import PySysCommand
l = util.createlogger('h_common', logging.INFO)
# l.setLevel(logging.DEBUG)
def execute_remote_cmd(ip, user, cmd, timeout=10, suppress_output=False):
... | {
"repo_name": "kratos7/hydra",
"path": "src/main/python/hydra/lib/common.py",
"copies": "4",
"size": "1296",
"license": "apache-2.0",
"hash": 5420315013317296000,
"line_mean": 27.8,
"line_max": 78,
"alpha_frac": 0.6211419753,
"autogenerated": false,
"ratio": 3.456,
"config_test": false,
"has_... |
__author__ = 'AbdullahS'
import logging
import os
import time
import psutil
import pika
from hydra.lib import util
from hydra.lib.hdaemon import HDaemonRepSrv
from hydra.lib.childmgr import ChildManager
from pprint import pformat
l = util.createlogger('HSub', logging.INFO)
class HDRmqsRepSrv(HDaemonRepSrv):
def... | {
"repo_name": "sushilks/hydra",
"path": "src/main/python/hydra/rmqtest/rmq_sub.py",
"copies": "4",
"size": "3863",
"license": "apache-2.0",
"hash": -4137370242138258000,
"line_mean": 36.5048543689,
"line_max": 105,
"alpha_frac": 0.6078177582,
"autogenerated": false,
"ratio": 3.1978476821192054,
... |
__author__ = 'AbdullahS'
import sys
from pprint import pprint, pformat # NOQA
from optparse import OptionParser
import logging
from hydra.lib import util
from hydra.lib.h_analyser import HAnalyser
from hydra.lib.hydrabase import HydraBase
try:
# Python 2.x
from ConfigParser import ConfigParser
except ImportE... | {
"repo_name": "lake-lerna/hydra",
"path": "src/main/python/hydra/rmqtest/runtest.py",
"copies": "4",
"size": "12277",
"license": "apache-2.0",
"hash": 4800181781085176000,
"line_mean": 43.321299639,
"line_max": 111,
"alpha_frac": 0.5710678505,
"autogenerated": false,
"ratio": 3.5037100456621006,
... |
__author__ = 'AbdullahS'
import time
import logging
import os
import psutil
import pika
import json
from pprint import pprint, pformat # NOQA
from hydra.lib import util
from hydra.lib.hdaemon import HDaemonRepSrv
l = util.createlogger('HPub', logging.INFO)
class HDRmqpRepSrv(HDaemonRepSrv):
def __init__(self, ... | {
"repo_name": "kratos7/hydra",
"path": "src/main/python/hydra/rmqtest/rmq_pub.py",
"copies": "4",
"size": "5421",
"license": "apache-2.0",
"hash": -4117551571402022400,
"line_mean": 39.1555555556,
"line_max": 112,
"alpha_frac": 0.5784910533,
"autogenerated": false,
"ratio": 3.6702775897088693,
... |
__author__ = 'AbdullahS, sushil'
from pprint import pprint, pformat # NOQA
import zmq
import logging
import json
import traceback
from hydra.lib import util
from hydra.lib.utility.h_threading import HThreading
from hydra.lib import hdaemon_pb2
l = util.createlogger('HDaemon', logging.INFO)
# l.setLevel(logging.DEBU... | {
"repo_name": "kratos7/hydra",
"path": "src/main/python/hydra/lib/hdaemon.py",
"copies": "4",
"size": "5381",
"license": "apache-2.0",
"hash": 2527723556447115300,
"line_mean": 35.3581081081,
"line_max": 94,
"alpha_frac": 0.5261103884,
"autogenerated": false,
"ratio": 4.012677106636838,
"config... |
__author__ = 'abdul'
from base import DocumentWrapper
###############################################################################
# Generic Cluster Class
###############################################################################
class Cluster(DocumentWrapper):
##########################################... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/objects/cluster.py",
"copies": "1",
"size": "3635",
"license": "mit",
"hash": -6839899916959995000,
"line_mean": 33.3018867925,
"line_max": 79,
"alpha_frac": 0.3639614856,
"autogenerated": false,
"ratio": 5.8... |
__author__ = 'abdul'
from base import DocumentWrapper
###############################################################################
# Generic Cluster Class
###############################################################################
class Cluster(DocumentWrapper):
########################################... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/objects/cluster.py",
"copies": "1",
"size": "4318",
"license": "mit",
"hash": -5232055353074801000,
"line_mean": 34.1056910569,
"line_max": 102,
"alpha_frac": 0.3675312645,
"autogenerated": false,
"ratio": 5.890859481582537,
"config_test": fa... |
__author__ = 'abdul'
from bson.son import SON
from mongoctl.utils import (
document_pretty_string, wait_for, kill_process, is_pid_alive
)
from mongoctl.mongoctl_logging import *
from mongoctl.errors import MongoctlException
import mongoctl.repository as repository
import mongoctl.objects.server
from start im... | {
"repo_name": "richardxx/mongoctl-service",
"path": "mongoctl/commands/server/stop.py",
"copies": "2",
"size": "8674",
"license": "mit",
"hash": 7357226350246813000,
"line_mean": 36.7130434783,
"line_max": 93,
"alpha_frac": 0.514180309,
"autogenerated": false,
"ratio": 4.44137224782386,
"config... |
__author__ = 'abdul'
from bson.son import SON
from mongoctl.utils import (
document_pretty_string, wait_for, kill_process, is_pid_alive
)
from mongoctl.mongoctl_logging import *
from mongoctl.errors import MongoctlException
import mongoctl.repository
import mongoctl.objects.server
from start import server_stoppe... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/commands/server/stop.py",
"copies": "1",
"size": "8780",
"license": "mit",
"hash": -3062294088784132000,
"line_mean": 37.8495575221,
"line_max": 116,
"alpha_frac": 0.5128701595,
"autogenerated": false,
"ratio": 4.497950819672131,
"config_test... |
__author__ = 'abdul'
from distutils2.version import NormalizedVersion, suggest_normalized_version
from errors import MongoctlException
# Version support stuff
MIN_SUPPORTED_VERSION = "1.8"
###############################################################################
# MongoDBEdition (enum)
#######################... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/mongodb_version.py",
"copies": "1",
"size": "3066",
"license": "mit",
"hash": -1201776706138043400,
"line_mean": 39.3421052632,
"line_max": 79,
"alpha_frac": 0.4993476843,
"autogenerated": false,
"ratio": 5.0344827586206895,
"config_test": fa... |
__author__ = 'abdul'
from mongoctl.utils import document_pretty_string
###############################################################################
# Document Wrapper Class
###############################################################################
class DocumentWrapper(object):
###########################... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/objects/base.py",
"copies": "1",
"size": "1864",
"license": "mit",
"hash": -6790554958325382000,
"line_mean": 35.5490196078,
"line_max": 79,
"alpha_frac": 0.2929184549,
"autogenerated": false,
"ratio": 7.1692307692307695,
"config_test": false... |
__author__ = 'abdul'
from mongoctl.utils import resolve_path
import server
###############################################################################
# CONSTANTS
###############################################################################
#####################################################################... | {
"repo_name": "richardxx/mongoctl-service",
"path": "mongoctl/objects/mongos.py",
"copies": "2",
"size": "1981",
"license": "mit",
"hash": 4509212096900290000,
"line_mean": 31.4754098361,
"line_max": 79,
"alpha_frac": 0.3740535083,
"autogenerated": false,
"ratio": 5.596045197740113,
"config_tes... |
__author__ = 'abdul'
from pymongo import uri_parser, errors
###############################################################################
# mongo uri tool. Contains utility functions for dealing with mongo uris
###############################################################################
########################... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/mongo_uri_tools.py",
"copies": "3",
"size": "5653",
"license": "mit",
"hash": -8354100921785608000,
"line_mean": 32.2529411765,
"line_max": 79,
"alpha_frac": 0.3700689899,
"autogenerated": false,
"ratio": 5.3... |
__author__ = 'abdul'
from server import Server
###############################################################################
# CONSTANTS
###############################################################################
###############################################################################
# MongosServer Cl... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/objects/mongos.py",
"copies": "1",
"size": "1355",
"license": "mit",
"hash": 602501670587533300,
"line_mean": 32.9,
"line_max": 79,
"alpha_frac": 0.3276752768,
"autogenerated": false,
"ratio": 6.642156862745098,
"config_test": false,
"has_n... |
__author__ = 'abdul'
from verlib import NormalizedVersion, suggest_normalized_version
# Version support stuff
MIN_SUPPORTED_VERSION = "1.8"
###############################################################################
# MongoctlNormalizedVersion class
# we had to inherit and override __str__ because the suggest_no... | {
"repo_name": "richardxx/mongoctl-service",
"path": "mongoctl/mongo_version.py",
"copies": "2",
"size": "1632",
"license": "mit",
"hash": -3471303163761897500,
"line_mean": 36.9534883721,
"line_max": 79,
"alpha_frac": 0.53125,
"autogenerated": false,
"ratio": 4.990825688073395,
"config_test": f... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.errors import MongoctlException
import mongoctl
###############################################################################
# print uri command
###############################################################################
def print_uri_... | {
"repo_name": "richardxx/mongoctl-service",
"path": "mongoctl/commands/misc/print_uri.py",
"copies": "1",
"size": "1105",
"license": "mit",
"hash": 4761182202367542000,
"line_mean": 28.0789473684,
"line_max": 79,
"alpha_frac": 0.5022624434,
"autogenerated": false,
"ratio": 4.42,
"config_test": ... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.utils import document_pretty_string
from mongoctl.mongoctl_logging import log_info
from mongoctl.objects.replicaset_cluster import ReplicaSetCluster
from mongoctl.errors import MongoctlException
##############################################... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/commands/cluster/configure.py",
"copies": "3",
"size": "2825",
"license": "mit",
"hash": -7132978114343946000,
"line_mean": 43.140625,
"line_max": 79,
"alpha_frac": 0.5553982301,
"autogenerated": false,
"rati... |
__author__ = 'abdul'
import mongoctl.repository as repository
import shutil
from mongoctl.mongoctl_logging import log_info
from mongoctl.errors import MongoctlException
from stop import do_stop_server
from start import do_start_server
###############################################################################
# ... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/commands/server/resync_secondary.py",
"copies": "3",
"size": "2014",
"license": "mit",
"hash": -5144760799878899000,
"line_mean": 37,
"line_max": 79,
"alpha_frac": 0.5759682224,
"autogenerated": false,
"ratio": 4.195833333333334,
"config_test... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.commands.command_utils import (
extract_mongo_exe_options, get_mongo_executable, options_to_command_args,
VersionPreference
)
from mongoctl.mongoctl_logging import log_info, log_error
from mongoctl.mongo_uri_tools import is_mongo_uri,... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/commands/common/connect.py",
"copies": "1",
"size": "8503",
"license": "mit",
"hash": -6104325432770128000,
"line_mean": 37.3018018018,
"line_max": 89,
"alpha_frac": 0.4673644596,
"autogenerated": false,
"ratio": 5.061309523809523,
"config_te... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.commands.command_utils import (
extract_mongo_exe_options, get_mongo_executable, options_to_command_args,
VERSION_PREF_MAJOR_GE
)
from mongoctl.mongoctl_logging import log_info, log_error
from mongoctl.mongo_uri_tools import is_mongo_... | {
"repo_name": "richardxx/mongoctl-service",
"path": "mongoctl/commands/common/connect.py",
"copies": "2",
"size": "7835",
"license": "mit",
"hash": 1232361655658958300,
"line_mean": 36.6730769231,
"line_max": 79,
"alpha_frac": 0.4534779834,
"autogenerated": false,
"ratio": 5.21290751829674,
"co... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.mongoctl_logging import log_info
from start import extract_server_options, do_start_server
from stop import do_stop_server
###############################################################################
# restart command
####################... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/commands/server/restart.py",
"copies": "3",
"size": "1357",
"license": "mit",
"hash": -2757331736204144000,
"line_mean": 35.6756756757,
"line_max": 79,
"alpha_frac": 0.515843773,
"autogenerated": false,
"rati... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.mongoctl_logging import *
from mongoctl.errors import MongoctlException
from mongoctl.utils import document_pretty_string
from mongoctl.objects.mongod import MongodServer
#######################################################################... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/commands/common/status.py",
"copies": "1",
"size": "1264",
"license": "mit",
"hash": -1982838262129137000,
"line_mean": 37.303030303,
"line_max": 79,
"alpha_frac": 0.5775316456,
"autogenerated": false,
"ratio": 4.596363636363637,
"config_test... |
__author__ = 'abdul'
import mongoctl.repository as repository
from mongoctl.mongo_uri_tools import is_mongo_uri, parse_mongo_uri
from mongoctl.utils import resolve_path
from mongoctl.mongoctl_logging import log_info , log_warning
from mongoctl.commands.command_utils import (
is_db_address, is_dbpath, extract_mo... | {
"repo_name": "richardxx/mongoctl-service",
"path": "mongoctl/commands/common/restore.py",
"copies": "2",
"size": "9719",
"license": "mit",
"hash": 6851981200272323000,
"line_mean": 36.96484375,
"line_max": 87,
"alpha_frac": 0.5164111534,
"autogenerated": false,
"ratio": 4.966274910577415,
"con... |
__author__ = 'abdul'
import os
import re
import mongoctl.repository as repository
from mongoctl.mongoctl_logging import *
from mongoctl import config
from mongoctl.errors import MongoctlException
from mongoctl.utils import is_exe, which, resolve_path, execute_command
from mongoctl.mongo_version import version_obj
fro... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/commands/command_utils.py",
"copies": "2",
"size": "14067",
"license": "mit",
"hash": 4543575385565772300,
"line_mean": 37.3297002725,
"line_max": 79,
"alpha_frac": 0.5242055875,
"autogenerated": false,
"rati... |
__author__ = 'abdul'
import os
import stat
import subprocess
import re
import signal
import resource
import mongoctl.repository as repository
from mongoctl.commands.command_utils import (
options_to_command_args, extract_mongo_exe_options
)
from mongoctl.mongoctl_logging import *
from mongoctl.errors import Mon... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/commands/server/start.py",
"copies": "1",
"size": "26038",
"license": "mit",
"hash": 2312401157750846000,
"line_mean": 36.1971428571,
"line_max": 102,
"alpha_frac": 0.51555419,
"autogenerated": false,
"ratio"... |
__author__ = 'abdul'
import os
import subprocess
import pwd
import time
import socket
import psutil
import urlparse
import json
from bson import json_util
from mongoctl_logging import *
from errors import MongoctlException
import signal
###############################################################################... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/utils.py",
"copies": "1",
"size": "13621",
"license": "mit",
"hash": 5686721982741939000,
"line_mean": 31.9009661836,
"line_max": 91,
"alpha_frac": 0.4648704207,
"autogenerated": false,
"ratio": 4.741037243299687,
"config_test": false,
"has... |
__author__ = 'abdul'
import os
import subprocess
import pwd
import time
import socket
import urlparse
import json
from bson import json_util
from mongoctl_logging import *
from errors import MongoctlException
###############################################################################
def namespace_get_property... | {
"repo_name": "richardxx/mongoctl-service",
"path": "build/lib.linux-x86_64-2.7/mongoctl/utils.py",
"copies": "2",
"size": "9428",
"license": "mit",
"hash": 7165811512469557000,
"line_mean": 30.9627118644,
"line_max": 80,
"alpha_frac": 0.4411327959,
"autogenerated": false,
"ratio": 4.862300154718... |
__author__ = 'abdul'
import os
from mongoctl.mongoctl_logging import log_info, log_error, log_exception
from mongoctl.errors import MongoctlException
from mongoctl.utils import call_command, which
from mongoctl.binary_repo import (
get_binary_repository, S3MongoDBBinaryRepository
)
from mongoctl.mongodb_version... | {
"repo_name": "mongolab/mongoctl",
"path": "mongoctl/commands/misc/publish_mongodb.py",
"copies": "1",
"size": "2777",
"license": "mit",
"hash": -878568143732092500,
"line_mean": 29.1847826087,
"line_max": 79,
"alpha_frac": 0.5851638459,
"autogenerated": false,
"ratio": 4.048104956268221,
"conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.