text
stringlengths
0
1.05M
meta
dict
import requests import json from getpass import getpass from ipaddress import ip_address class NXOS(): ''' This is a class to encapsulate the information needed to connect to an NXOS device via NXAPI. The object is instantiated with an IP address and has setter methods to set credentials. This class...
{ "repo_name": "PresidioCode/NXAPI", "path": "nxapi_base.py", "copies": "2", "size": "6368", "license": "apache-2.0", "hash": -3552731803735185400, "line_mean": 31, "line_max": 92, "alpha_frac": 0.5777324121, "autogenerated": false, "ratio": 4.173001310615989, "config_test": false, "has_no_key...
from argparse import ArgumentParser from nxapi_base import NXOS, short_intf, short_name def makeDescriptions(cdp, pc): neighbor_list = cdp["TABLE_cdp_neighbor_detail_info"]["ROW_cdp_neighbor_detail_info"] pc_list = pc["TABLE_channel"]["ROW_channel"] if type(pc_list) == dict: pc_list = [pc_list] ...
{ "repo_name": "jamiecaesar/NXAPI", "path": "IntfLabel.py", "copies": "2", "size": "2135", "license": "apache-2.0", "hash": -4331090162500188700, "line_mean": 36.4736842105, "line_max": 96, "alpha_frac": 0.6257611241, "autogenerated": false, "ratio": 3.630952380952381, "config_test": false, "h...
from argparse import ArgumentParser from nxapi_base import NXOS from ipaddress import ip_address, ip_network from requests import Timeout def GetRouteStats(routetable, vrf="default", addrf="ipv4"): ''' This function takes the route-table data structure via NXAPI and returns a new data structure that stor...
{ "repo_name": "PresidioCode/NXAPI", "path": "RouteStats.py", "copies": "2", "size": "4385", "license": "apache-2.0", "hash": -4056660942421025000, "line_mean": 39.2293577982, "line_max": 96, "alpha_frac": 0.5637400228, "autogenerated": false, "ratio": 3.7899740708729475, "config_test": false, ...
__author__ = 'jan.chvala' import sqlite3 import os import db.db_init import json from bottle import get, run, debug, template, request, static_file, error DB_NAME = 'db/sessions.db' POLYMER_ROOT = os.getcwd() + "/polymer/" # API for getting all session in JSON @get('/rest/sessions') def rest_session_list(): co...
{ "repo_name": "licshire/android-ipcam-server", "path": "src/android-ipcam-server.py", "copies": "1", "size": "4878", "license": "apache-2.0", "hash": -6602961846995700000, "line_mean": 26.7159090909, "line_max": 114, "alpha_frac": 0.6221812218, "autogenerated": false, "ratio": 3.313858695652174, ...
__author__ = 'janderson' #!/usr/bin/env python ''' Write a script that connects to the lab pynet-rtr1, logins, and executes the 'show ip int brief' command. ''' import telnetlib import time import socket import sys import getpass TELNET_PORT = 23 TELNET_TIMEOUT = 6 class TelnetConn(object): def __init__(self,...
{ "repo_name": "ande0581/pynet", "path": "class2/class2_ex3.py", "copies": "1", "size": "2122", "license": "apache-2.0", "hash": -2329559049049783000, "line_mean": 23.6744186047, "line_max": 90, "alpha_frac": 0.5980207352, "autogenerated": false, "ratio": 3.5723905723905722, "config_test": false...
__author__ = 'Janez Stupar' from tastypie import resources, authorization, authentication, fields from polls import models as poll_models class PollResource(resources.ModelResource): choices = fields.ToManyField('tp_demo.api.polls_api.ChoiceResource', 'choices',null=True, blank=True, full=True) class Meta: ...
{ "repo_name": "JanezStupar/tastypie_demo", "path": "tp_demo/api/polls_api.py", "copies": "1", "size": "4329", "license": "mit", "hash": -5605972320585961000, "line_mean": 46.0652173913, "line_max": 116, "alpha_frac": 0.6830676831, "autogenerated": false, "ratio": 4.2399608227228205, "config_tes...
__author__ = 'jang@ioctl.org' import eventlet import eventlet.debug # Still not sure how some of these FDs get invalidated. # I'm pretty sure GC is not involved. import gc print "gc enabled?", gc.isenabled() eventlet.monkey_patch() #eventlet.debug.hub_listener_stacks(True) #eventlet.debug.hub_timer_stacks(True) #even...
{ "repo_name": "jan-g/eventlet-paramiko-test", "path": "para.py", "copies": "1", "size": "3986", "license": "apache-2.0", "hash": -3334610459291107000, "line_mean": 28.0948905109, "line_max": 103, "alpha_frac": 0.5990968389, "autogenerated": false, "ratio": 3.9465346534653465, "config_test": fal...
__author__ = 'Jan Karabas' __project__ = 'snarkx' __all__ = ['Cycle'] class Cycle(object): r""" An *immutable cycle* """ def __init__(self, *args, oriented=True): self._oriented = oriented self._mydata = [] if isinstance(args[0],list): self._mydata = args[0][:] ...
{ "repo_name": "jkarabas/snarkx", "path": "snarkx/cycle.py", "copies": "1", "size": "6298", "license": "bsd-3-clause", "hash": 3540190831843919000, "line_mean": 26.5021834061, "line_max": 86, "alpha_frac": 0.466020959, "autogenerated": false, "ratio": 3.793975903614458, "config_test": false, "...
__author__ = 'Jan Karabas' __project__ = 'snarkx' __all__ = ['PartitionsInt'] class PartitionsInt(object): r""" Integer partitions iterator. Given a non-negative integer *n* it yields all partitions of that number. The obtained partitons can be generated up to given length or they...
{ "repo_name": "jkarabas/snarkx", "path": "snarkx/combinat.py", "copies": "1", "size": "2153", "license": "bsd-3-clause", "hash": 3807796330869963300, "line_mean": 30.6617647059, "line_max": 92, "alpha_frac": 0.5039479796, "autogenerated": false, "ratio": 4.0853889943074, "config_test": false, ...
__author__ = 'Jan Karabas' __project__ = 'snarkx' class BasicPermutation(object): def __init__(self, arg): self.__data = None if isinstance(arg, int): if arg < 1: raise ValueError('Degree too small on Permutaion({0})'.format(arg)) self.__data = [_i for _i in...
{ "repo_name": "jkarabas/snarkx", "path": "snarkx/basicpermutation.py", "copies": "1", "size": "7629", "license": "bsd-3-clause", "hash": 829314472688601900, "line_mean": 30.7875, "line_max": 102, "alpha_frac": 0.47961725, "autogenerated": false, "ratio": 4.036507936507936, "config_test": false,...
__author__ = 'jankuehl' import re from defusedxml import ElementTree as ET from dojo.models import Finding class XanitizerXMLParser(object): def __init__(self, filename, test): self.items = [] if filename is None: return root = self.parse_xml(filename) if root is n...
{ "repo_name": "rackerlabs/django-DefectDojo", "path": "dojo/tools/xanitizer/parser.py", "copies": "1", "size": "6355", "license": "bsd-3-clause", "hash": 2477606740323438600, "line_mean": 33.3513513514, "line_max": 137, "alpha_frac": 0.5350118017, "autogenerated": false, "ratio": 4.15359477124183...
import requests import json import os from posixpath import join as urljoin from requests_oauthlib import OAuth1Session import xmltodict CLIENT_ID = os.getenv('GOODREADS_CLIENT_ID') CLIENT_SECRET = os.getenv('GOODREADS_CLIENT_SECRET') # credentials stored to home folder OAUTH_TOKEN_JSON = os.getenv('GOODREADS_OAUT...
{ "repo_name": "jmargeta/goodreads", "path": "goodreads/goodreads.py", "copies": "1", "size": "3790", "license": "mit", "hash": 9208095422668134000, "line_mean": 31.6724137931, "line_max": 81, "alpha_frac": 0.6094986807, "autogenerated": false, "ratio": 3.9274611398963732, "config_test": false, ...
__author__ = 'jannis' import pandas, os class dummy(object): """ an empty class used to define the states and processes attribute in the knowledgebase """ pass class Knowledgebase(object): """ This class provides convenient access to data which is required to instantiate states and processes. ""...
{ "repo_name": "fugufisch/wholecell", "path": "data/knowledgebase.py", "copies": "1", "size": "2562", "license": "mit", "hash": 1603049989477326300, "line_mean": 33.6351351351, "line_max": 104, "alpha_frac": 0.5765027322, "autogenerated": false, "ratio": 4.3720136518771335, "config_test": false,...
__author__ = 'jan' import matplotlib.pyplot as plt from prettyplotlib.utils import remove_chartjunk, maybe_get_ax from prettyplotlib import colors as _colors import numpy as np import matplotlib.mlab as mlab def _beeswarm(ax, x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, patch_arti...
{ "repo_name": "olgabot/prettyplotlib", "path": "prettyplotlib/_beeswarm.py", "copies": "1", "size": "12196", "license": "mit", "hash": 4303627592129842700, "line_mean": 34.0459770115, "line_max": 103, "alpha_frac": 0.5420629715, "autogenerated": false, "ratio": 3.500574052812859, "config_test":...
__author__ = 'janomar' import logging import jaydebeapi from airflow.hooks.base_hook import BaseHook class JdbcHook(BaseHook): """ General hook for jdbc db access. If a connection id is specified, host, port, schema, username and password will be taken from the predefined connection. Raises an airfl...
{ "repo_name": "jbalogh/airflow", "path": "airflow/hooks/jdbc_hook.py", "copies": "1", "size": "2937", "license": "apache-2.0", "hash": 861209922547051300, "line_mean": 31.6444444444, "line_max": 124, "alpha_frac": 0.5863125638, "autogenerated": false, "ratio": 3.809338521400778, "config_test": ...
__author__ = 'janomar' import logging import jaydebeapi from airflow.hooks.dbapi_hook import DbApiHook class JdbcHook(DbApiHook): """ General hook for jdbc db access. If a connection id is specified, host, port, schema, username and password will be taken from the predefined connection. Raises an ai...
{ "repo_name": "linearregression/airflow", "path": "airflow/hooks/jdbc_hook.py", "copies": "1", "size": "1783", "license": "apache-2.0", "hash": -1946840023228784000, "line_mean": 31.4181818182, "line_max": 124, "alpha_frac": 0.6438586652, "autogenerated": false, "ratio": 3.8593073593073592, "co...
__author__ = 'janomar' import logging from airflow.hooks.jdbc_hook import JdbcHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class JdbcOperator(BaseOperator): """ Executes sql code in a database using jdbc driver. Requires jaydebeapi. :param jdbc_u...
{ "repo_name": "wxiang7/airflow", "path": "airflow/operators/jdbc_operator.py", "copies": "5", "size": "1835", "license": "apache-2.0", "hash": 4121977111532776000, "line_mean": 34.9803921569, "line_max": 118, "alpha_frac": 0.6670299728, "autogenerated": false, "ratio": 3.619329388560158, "confi...
__author__ = 'janomar' import logging from airflow.hooks.jdbc_hook import JdbcHook from airflow.models import BaseOperator from airflow.utils import apply_defaults class JdbcOperator(BaseOperator): """ Executes sql code in a database using jdbc driver. Requires jaydebeapi. :param jdbc_url: driver ...
{ "repo_name": "neovintage/airflow", "path": "airflow/operators/jdbc_operator.py", "copies": "16", "size": "1824", "license": "apache-2.0", "hash": -2812628482849963500, "line_mean": 34.7647058824, "line_max": 118, "alpha_frac": 0.6655701754, "autogenerated": false, "ratio": 3.611881188118812, "...
__author__ = 'janosbana' ''' this script makes an api call to ml studio web service we created and returns the predicted values for each order item for the next seven days Note: the code was taken from Azure's ML Studio web service information page and modified to fit our needs ''' import json import requests from d...
{ "repo_name": "jayBana/InventoryMan", "path": "G53IDS/server/ml_helpers/ml_studio_request.py", "copies": "1", "size": "3063", "license": "apache-2.0", "hash": -6836530926263494000, "line_mean": 41.5416666667, "line_max": 178, "alpha_frac": 0.6134508652, "autogenerated": false, "ratio": 3.69036144...
__author__ = 'janos' import csv import re import networkx as nx from optparse import OptionParser import os import sys import json def export_edges_to_csv(csv_edge_file_name, provider_graph_to_export): """Export edges to CSV""" with open(csv_edge_file_name, "wb") as f: csv_edges = csv.writer(f) ...
{ "repo_name": "jhajagos/HealthcareAnalyticTools", "path": "teaming/manipulate_provider_graphml.py", "copies": "1", "size": "11891", "license": "mit", "hash": -3886552304717131000, "line_mean": 46.3784860558, "line_max": 526, "alpha_frac": 0.6169371794, "autogenerated": false, "ratio": 3.869508623...
__author__ = 'janos' from optparse import OptionParser from teaming_extract import field_selection_with_like if __name__ == "__main__": parser = OptionParser() parser.add_option("-o", "--file", dest="file_name", help="") parser.add_option("-t", "--taxonomy_list", dest="taxonomy_list", help="") parser...
{ "repo_name": "jhajagos/HealthcareAnalyticTools", "path": "teaming/generate_taxonomy_binary_indicator_fields.py", "copies": "1", "size": "1384", "license": "mit", "hash": -2029472331579051500, "line_mean": 48.4285714286, "line_max": 147, "alpha_frac": 0.5729768786, "autogenerated": false, "ratio"...
__author__ = 'janos' """ Generate queries against DE-SYNPUF database or another claim's database were the coding is flat for understanding relationships between first time of diagnosis. """ import sqlalchemy as sa import re import csv def find_columns_that_match(table_columns, regex_field_match): columns_that_m...
{ "repo_name": "jhajagos/DeSYNPUFAnalysis", "path": "scripts/generate_de_synpuf_queries.py", "copies": "1", "size": "6815", "license": "mit", "hash": -7933314545642608000, "line_mean": 35.0582010582, "line_max": 148, "alpha_frac": 0.6234776229, "autogenerated": false, "ratio": 3.071203244704822, ...
__author__ = 'Jan Pecinovsky' from opengrid.config import Config config = Config() import os import sys import json import jsonpickle import datetime as dt import pandas as pd from requests.exceptions import HTTPError import warnings from tqdm import tqdm # compatibility with py3 if sys.version_info.major >= 3: ...
{ "repo_name": "WolfBerwouts/opengrid", "path": "opengrid/library/houseprint/houseprint.py", "copies": "2", "size": "19273", "license": "apache-2.0", "hash": -4990689198843223000, "line_mean": 30.1357027464, "line_max": 119, "alpha_frac": 0.5204171639, "autogenerated": false, "ratio": 4.7342176369...
__author__ = 'Jan Pecinovsky' import datetime as dt from copy import copy import forecastio import geopy import numpy as np import pandas as pd from dateutil import rrule class Weather(): """ Object that contains Weather Data from Forecast.io for multiple days as a Pandas Dataframe. NOTE: Foreca...
{ "repo_name": "MatteusDeloge/opengrid", "path": "opengrid/library/forecastwrapper.py", "copies": "1", "size": "13954", "license": "apache-2.0", "hash": 578585944947614800, "line_mean": 32.7077294686, "line_max": 120, "alpha_frac": 0.5820553246, "autogenerated": false, "ratio": 4.551206784083496, ...
__author__ = 'Jan Pecinovsky' import geocoder import astral import math import pandas as pd class SolarInsolation(object): """ Module to calculate Solar Insolation (direct intensity, global intensity, air mass) and basic solar parameters (angle) based on a location and a date. Formulas fro...
{ "repo_name": "WolfBerwouts/opengrid", "path": "opengrid/library/solarmodel.py", "copies": "2", "size": "7232", "license": "apache-2.0", "hash": -7697855993331262000, "line_mean": 27.5889328063, "line_max": 106, "alpha_frac": 0.5188053097, "autogenerated": false, "ratio": 4.7862342819324954, "c...
__author__ = 'Jan Pecinovsky' import pandas as pd """ A Device is an entity that can contain multiple sensors. The generic Device class can be inherited by a specific device class, eg. Fluksometer """ class Device(object): def __init__(self, key=None, site=None): self.key = key self.site = site ...
{ "repo_name": "WolfBerwouts/opengrid", "path": "opengrid/library/houseprint/device.py", "copies": "2", "size": "4236", "license": "apache-2.0", "hash": 4222962926596030000, "line_mean": 27.8163265306, "line_max": 119, "alpha_frac": 0.5576015109, "autogenerated": false, "ratio": 4.362512873326468,...
__author__ = 'Jan Pecinovsky' import pandas as pd """ A Site is a physical entity (a house, appartment, school, or other building). It may contain multiple devices and sensors. The Site contains most of the metadata, eg. the number of inhabitants, the size of the building, the location etc. """ class Site(object): ...
{ "repo_name": "JrtPec/opengrid", "path": "opengrid/library/houseprint/site.py", "copies": "2", "size": "3909", "license": "apache-2.0", "hash": 3859008429521143300, "line_mean": 29.7874015748, "line_max": 119, "alpha_frac": 0.5643387056, "autogenerated": false, "ratio": 4.189710610932476, "conf...
__author__ = 'Jan Pecinovsky' """ A Device is an entity that can contain multiple sensors. The generic Device class can be inherited by a specific device class, eg. Fluksometer """ import pandas as pd class Device(object): def __init__(self, key, site): self.key = key self.site = site sel...
{ "repo_name": "MatteusDeloge/opengrid", "path": "opengrid/library/houseprint/device.py", "copies": "1", "size": "3025", "license": "apache-2.0", "hash": 4672811439635854000, "line_mean": 29.26, "line_max": 119, "alpha_frac": 0.5656198347, "autogenerated": false, "ratio": 4.272598870056497, "con...
__author__ = 'Jan Pecinovsky' """ A sensor generates a single data stream. It can have a parent device, but the possibility is also left open for a sensor to stand alone in a site. It is an abstract class definition which has to be overridden (by eg. a Fluksosensor). This class contains all metadata concerning the fu...
{ "repo_name": "MatteusDeloge/opengrid", "path": "opengrid/library/houseprint/sensor.py", "copies": "1", "size": "8288", "license": "apache-2.0", "hash": -3748338458504229000, "line_mean": 32.5587044534, "line_max": 117, "alpha_frac": 0.5173745174, "autogenerated": false, "ratio": 4.73059360730593...
__author__ = 'Jan Pecinovsky, Roel De Coninck' """ A sensor generates a single data stream. It can have a parent device, but the possibility is also left open for a sensor to stand alone in a site. It is an abstract class definition which has to be overridden (by eg. a Fluksosensor). This class contains all metadata ...
{ "repo_name": "WolfBerwouts/opengrid", "path": "opengrid/library/houseprint/sensor.py", "copies": "1", "size": "12287", "license": "apache-2.0", "hash": 7288069317909659000, "line_mean": 31.8556149733, "line_max": 110, "alpha_frac": 0.525351998, "autogenerated": false, "ratio": 4.560876020786934,...
__author__ = 'Jan Růžička <jan.ruzicka01@gmail.com>' __version__ = "0.5.0" import sys import string import re unicode = "".join([chr(x) for x in range(sys.maxunicode)]) ascii = string.ascii_lowercase + string.ascii_uppercase nums = "".join(str(x) for x in range(10)) ascii_nums = ascii + nums def expand(lst): ""...
{ "repo_name": "ruza-net/Parse.py", "path": "utils.py", "copies": "1", "size": "1028", "license": "apache-2.0", "hash": -1067285666272394900, "line_mean": 22.3181818182, "line_max": 107, "alpha_frac": 0.52, "autogenerated": false, "ratio": 3.2334384858044163, "config_test": false, "has_no_keyw...
__author__ = 'Jan Růžička <jan.ruzicka01@gmail.com>' __version__ = "1.0.5" from utils import * import sys import re _ignored = " " _recursed = {} _keywords = [] _literals = [] _ops = {} def _addOp(op, att): if type(op) in [And, Or, Xor]: _addOp(op.first, att) _addOp(op.second, att) else:...
{ "repo_name": "ruza-net/Parse.py", "path": "parse.py", "copies": "1", "size": "23401", "license": "apache-2.0", "hash": 8161297823337952000, "line_mean": 23.7085533263, "line_max": 159, "alpha_frac": 0.4993161809, "autogenerated": false, "ratio": 3.941711590296496, "config_test": false, "has_...
__author__="Janusz Swiatczak" __date__ ="12/09/2012" import re import os INSTANCE_START_TAG = re.compile(r'<INSTANCE CLASS="(.*)"', re.I) INSTANCE_END_TAG = re.compile(r'</INSTANCE>', re.I) PEOPLECODE_SECTION = 'PCM' pathRule = lambda x: '.' if int(x) in (12,39) else ('' if not x or int(x) == 0 else os.sep) PATH_KE...
{ "repo_name": "swiatczak/psprojectparser", "path": "psconstants.py", "copies": "1", "size": "7738", "license": "mit", "hash": 224884070226773500, "line_mean": 65.1367521368, "line_max": 250, "alpha_frac": 0.5328250194, "autogenerated": false, "ratio": 3.1830522418757714, "config_test": false, ...
__author__="Janusz Swiatczak" __date__ ="13/07/2014" import re import codecs import os import os.path import xml.etree.ElementTree as ET import psconstants as ppsc # # Reference: David Beazley @ http://www.dabeaz.com # def coroutine(func): """ Turn function object into a coroutine. use as a decorat...
{ "repo_name": "swiatczak/psprojectparser", "path": "psprojectparser.py", "copies": "1", "size": "4848", "license": "mit", "hash": 5551069796769817000, "line_mean": 40.4358974359, "line_max": 168, "alpha_frac": 0.5567244224, "autogenerated": false, "ratio": 4.154241645244216, "config_test": fals...
__author__ = 'Jan Voigt' import numpy as np import csv as csv from pylab import * #from operator import add import matplotlib.pyplot as plt x1List = [] # ln(c) y1List = [] # EMK Dotierseite f = open("EMK_dotierseite_ln(c)_alle.txt") for line in f: line = line.rstrip() parts = line.split() ...
{ "repo_name": "fxjung/mathphyprak", "path": "legacy/emklnc.py", "copies": "1", "size": "1443", "license": "isc", "hash": 3206102540919071000, "line_mean": 24.7222222222, "line_max": 96, "alpha_frac": 0.6209286209, "autogenerated": false, "ratio": 2.4457627118644067, "config_test": false, "has...
__author__ = 'jan.zdunek' # Copyright 2013-2015 Jan Zdunek # # 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 # # Unless required by applicable law...
{ "repo_name": "jzdunek/robot-profiler", "path": "src/python/robot_profiler.py", "copies": "1", "size": "4927", "license": "apache-2.0", "hash": -8934476236485787000, "line_mean": 34.1928571429, "line_max": 143, "alpha_frac": 0.6141668358, "autogenerated": false, "ratio": 3.9196499602227526, "co...
__author__ = 'jan.zdunek' # Copyright 2015 Jan Zdunek # # 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 # # Unless required by applicable law or a...
{ "repo_name": "jzdunek/robot-profiler", "path": "test/python/robot_profiler_unittests.py", "copies": "1", "size": "11110", "license": "apache-2.0", "hash": 3902919362699715000, "line_mean": 43.44, "line_max": 121, "alpha_frac": 0.6606660666, "autogenerated": false, "ratio": 3.8859741168240642, ...
__author__ = "Jared B Bowden" __version__ = 1.2 """ Plot of internet speed """ import matplotlib.pylab as plt import pandas as pd from matplotlib.dates import DateFormatter data_path = "/Users/jaredbowden/Google Drive/cave_in_a_lake/data/" dateparse = lambda x: pd.datetime.strptime(x, '%Y/%d/%m %H:%M:%S') raw_data ...
{ "repo_name": "JaredBBowden/speedtest-cli", "path": "graph_speed.py", "copies": "1", "size": "1589", "license": "apache-2.0", "hash": 4726506013344118000, "line_mean": 21.3802816901, "line_max": 71, "alpha_frac": 0.6299559471, "autogenerated": false, "ratio": 3.0735009671179885, "config_test": ...
__author__ = 'Jared Jorgensen' from slickqaweb.app import app from slickqaweb.model.testrunGroup import TestrunGroup from slickqaweb.model.testrun import Testrun from slickqaweb.model.serialize import deserialize_that from slickqaweb.model.query import queryFor from slickqaweb.utils import * import datetime from flask...
{ "repo_name": "slickqa/slickqaweb", "path": "slickqaweb/api/testrungroup.py", "copies": "1", "size": "4009", "license": "apache-2.0", "hash": 1699729544710015000, "line_mean": 40.3298969072, "line_max": 104, "alpha_frac": 0.7298578199, "autogenerated": false, "ratio": 3.310487200660611, "config...
__author__ = 'Jason Crockett' import django.db.models as datdb import django.db.models.manager as dbiface import django.forms.formsets as dbiform import ebay class Item(datdb.Model): iid = datdb.AutoField(primary_key=True) name = datdb.CharField(max_length=60) image = datdb.ImageField(verbose_name="Produc...
{ "repo_name": "deddokatana/Ba3-Shop2", "path": "Model.py", "copies": "1", "size": "2828", "license": "mit", "hash": -3867563405924629000, "line_mean": 37.7397260274, "line_max": 95, "alpha_frac": 0.7241867044, "autogenerated": false, "ratio": 3.5086848635235732, "config_test": false, "has_no_...
__author__ = 'Jason Crockett' #username = "" #password = "" #authtoken = "" #from ebaysdk import trading from ebaysdk.trading import Connection as trading class EbayUser: DevID = 'f48a5c13-dca0-4077-8295-006421d6ed3b' AppID = 'MrJasonA-67c2-4711-b4a2-51b534432c67' CertID = 'a1ebd7a4-24e4-4a41-b657-03d45...
{ "repo_name": "deddokatana/Ba3-Shop2", "path": "ebay.py", "copies": "1", "size": "3856", "license": "mit", "hash": 8374881862919811000, "line_mean": 51.1216216216, "line_max": 899, "alpha_frac": 0.7868257261, "autogenerated": false, "ratio": 1.9051383399209487, "config_test": false, "has_no_k...
__author__ = 'Jason Grundstad' from django.conf import settings from bs4 import BeautifulSoup import json import requests import re MD_ANDERSON_URL = 'https://pct.mdanderson.org' MD_ANDERSON_OUTFILE = settings.LINKS_OUT + 'mdanderson.json' def merge_dicts(x, y): """ :rtype : dict """ z = x.copy() ...
{ "repo_name": "jgrundstad/Variant_Report_Viewer", "path": "igsb_report_viewer/viewer/util/link_out_scraper.py", "copies": "1", "size": "2209", "license": "apache-2.0", "hash": -6004847059391534000, "line_mean": 23.5555555556, "line_max": 79, "alpha_frac": 0.5595291987, "autogenerated": false, "ra...
__author__ = 'Jason Grundstad' from django.conf import settings from pyvirtualdisplay import Display from selenium import webdriver from bs4 import BeautifulSoup import json MD_ANDERSON_URL = 'https://pct.mdanderson.org/#/home' MD_ANDERSON_OUTFILE = settings.LINKS_OUT + 'mdanderson.json' def scrape_mdanderson(): ...
{ "repo_name": "jgrundstad/viewer", "path": "util/link_out_scraper.py", "copies": "2", "size": "1092", "license": "apache-2.0", "hash": 5799785715621495000, "line_mean": 24.3953488372, "line_max": 76, "alpha_frac": 0.641025641, "autogenerated": false, "ratio": 3.1744186046511627, "config_test": ...
__author__ = 'Jason Grundstad' from django.conf import settings import json, simplejson import os import tablib def add_goodies(atoms, headers, md_anderson_genes): for i in range(0, len(headers)): if not atoms[i]: atoms[i] = '' # highlight NON_SYNONYMOUS_CODING if(headers[i] ==...
{ "repo_name": "jgrundstad/Variant_Report_Viewer", "path": "igsb_report_viewer/viewer/util/report_parser.py", "copies": "1", "size": "1688", "license": "apache-2.0", "hash": 6468972669506762000, "line_mean": 34.1666666667, "line_max": 78, "alpha_frac": 0.5710900474, "autogenerated": false, "ratio"...
__author__ = 'jasonhuang' import urllib.request as ur import json, os, sys import socket import logging import subprocess def reporthook(blocknum, blocksize, totalsize): readsofar = blocknum * blocksize if totalsize > 0: percent = readsofar * 1e2 / totalsize s = "\r%5.1f%% %*d / %d" % ( ...
{ "repo_name": "jasonleakey/douban-fm-music-downloader", "path": "com/guchy/main.py", "copies": "1", "size": "2755", "license": "apache-2.0", "hash": -4880071600862845000, "line_mean": 37.2638888889, "line_max": 124, "alpha_frac": 0.5626134301, "autogenerated": false, "ratio": 3.4610552763819094, ...
__author__ = 'Jason Mehring' # # This module is only used with WingIDE debugger for testing code within # The debugging environment # # Stage 1: bind /srv/...modules to cache/extmods. No sync will take place # since files are bound # BIND # True : bind custom modules # False : do not bind custom module...
{ "repo_name": "DockerNAS/yamlscript-formula", "path": "src/salt-call.py", "copies": "1", "size": "7810", "license": "mit", "hash": 1702327962998151200, "line_mean": 32.6637931034, "line_max": 98, "alpha_frac": 0.5473751601, "autogenerated": false, "ratio": 3.7674867342016403, "config_test": fal...
__author__ = 'jason' from collections import Counter import math import nltk import string from sklearn.feature_extraction.text import TfidfVectorizer # main functions used by others def list_similarity(list1, list2): c1, c2 = Counter(list1), Counter(list2) return length_similarity(c1, c2) * counter_cosine_si...
{ "repo_name": "ArisKots1992/Similar-World-News-Articles", "path": "Utils.py", "copies": "1", "size": "1873", "license": "mit", "hash": -8810448234906630000, "line_mean": 25.0138888889, "line_max": 94, "alpha_frac": 0.6118526428, "autogenerated": false, "ratio": 3.2917398945518452, "config_test"...
__author__ = 'jason' from textblob import TextBlob from textblob.np_extractors import FastNPExtractor from hashtagify import Hashtagify from nltk.tag.stanford import NERTagger from geonames import * from nltk.corpus import stopwords class NewsArticle: def __init__(self, id, title, date, text, url, description, co...
{ "repo_name": "JasonPap/World-news-articles-matching", "path": "NewsArticle.py", "copies": "1", "size": "10533", "license": "mit", "hash": 6339896830549414000, "line_mean": 46.2331838565, "line_max": 308, "alpha_frac": 0.6478686034, "autogenerated": false, "ratio": 3.7929420237666545, "config_t...
__author__ = 'jason' from textblob import TextBlob from textblob.np_extractors import FastNPExtractor from hashtagify import Hashtagify try: from nltk.tag.stanford import StanfordNERTagger except: from nltk.tag.stanford import NERTagger from geonames import * from nltk.corpus import stopwords class NewsArticl...
{ "repo_name": "ArisKots1992/Similar-World-News-Articles", "path": "NewsArticle.py", "copies": "1", "size": "11483", "license": "mit", "hash": 4341731296338985500, "line_mean": 46.8458333333, "line_max": 308, "alpha_frac": 0.6426891927, "autogenerated": false, "ratio": 3.753841124550507, "config...
__author__ = 'jason' from NewsAggregator import NewsAggregator from NewsArticle import NewsArticle from XMLparser import * from nltk.corpus import stopwords countries = ["Greece"] aggr = NewsAggregator(0.35) xmlfiles = ["cbsnews.xml", "Global News.xml", "chathamdailynews.xml", "Sky-News.xml", "npr.xml", ...
{ "repo_name": "JasonPap/World-news-articles-matching", "path": "main.py", "copies": "1", "size": "1263", "license": "mit", "hash": -1009234354362083300, "line_mean": 36.1470588235, "line_max": 118, "alpha_frac": 0.6516231196, "autogenerated": false, "ratio": 2.971764705882353, "config_test": fa...
__author__ = 'jason' import imaplib import re import sys import getpass import smtplib import time from treelib import Tree from os import path from collections import defaultdict import xml.etree.ElementTree as ET from DatabaseLoader import DatabaseLoader #member variables db_file_location = "./db" tree_location = "...
{ "repo_name": "jramapuram/rentbot", "path": "Rentbot.py", "copies": "1", "size": "5659", "license": "mit", "hash": -3501232468076854300, "line_mean": 35.5096774194, "line_max": 129, "alpha_frac": 0.5458561583, "autogenerated": false, "ratio": 3.3445626477541373, "config_test": false, "has_no_...
__author__ = 'Jason' import json class JCal(): @classmethod def from_calendar(cls, calendar): """Convert a Calendar instance to a json string. :param calendar: icalendar.Calendar :return: json str """ return json.dumps(JCal._from_component(calendar)) @classmetho...
{ "repo_name": "JasonCozens/CalTools", "path": "cal_tools/jcal.py", "copies": "1", "size": "1093", "license": "bsd-2-clause", "hash": -8366995506873019000, "line_mean": 26.35, "line_max": 66, "alpha_frac": 0.571820677, "autogenerated": false, "ratio": 4.711206896551724, "config_test": false, "...
__author__ = 'Jason' import os import icalendar class Examples5545(): """Examples from RFC 5545. (http://tools.ietf.org/html/rfc5545) . """ ical_str = ( 'BEGIN:VCALENDAR\r\n' 'VERSION:2.0\r\n' 'PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n' 'BEGIN:VEVENT\r\n' ...
{ "repo_name": "JasonCozens/CalTools", "path": "cal_tools/examples/parsing_ex.py", "copies": "1", "size": "1521", "license": "bsd-2-clause", "hash": 8046122434648141000, "line_mean": 28.2692307692, "line_max": 71, "alpha_frac": 0.5180802104, "autogenerated": false, "ratio": 3.0727272727272728, "...
__author__ = 'jason' import os import numpy as np from skimage.io import imread from skimage import morphology from skimage.filter import threshold_otsu, rank from skimage import measure import matplotlib.pyplot as plt def get_max_region(label_list, imagethres): regions = measure.regionprops(label_list) regi...
{ "repo_name": "JasonTam/ndsb2015", "path": "feature/improc.py", "copies": "1", "size": "3064", "license": "mit", "hash": 484001441934973300, "line_mean": 31.2526315789, "line_max": 96, "alpha_frac": 0.6458877285, "autogenerated": false, "ratio": 3.2735042735042734, "config_test": false, "has_...
__author__ = 'jason' import os.path import bcrypt import leveldb import getpass import sys from simplecrypt import encrypt, decrypt class DatabaseLoader: # helper to parse out the db def load_database(self, file_path, db_pwd): db = leveldb.LevelDB(file_path) db_kv_set = {} encrypted_...
{ "repo_name": "jramapuram/rentbot", "path": "DatabaseLoader.py", "copies": "1", "size": "3234", "license": "mit", "hash": 598254084010476800, "line_mean": 41.5657894737, "line_max": 117, "alpha_frac": 0.5269016698, "autogenerated": false, "ratio": 3.8637992831541217, "config_test": false, "ha...
__author__ = 'Jason' import time import unittest class JCalTest(unittest.TestCase): def test_from_jcal(self): """Example of parsing jcal dates and times. :return: None This examples shows the format strings to use to parse a date or time from a jcal json stream. """ ...
{ "repo_name": "JasonCozens/CalTools", "path": "cal_tools/examples/time_ex.py", "copies": "1", "size": "1264", "license": "bsd-2-clause", "hash": 2845770478971544600, "line_mean": 33.1891891892, "line_max": 77, "alpha_frac": 0.5965189873, "autogenerated": false, "ratio": 3.0384615384615383, "con...
__author__ = 'Jason' import unittest from icalendar import Calendar from cal_tools import model from cal_tools.model import CalendarModel print_help = True class CalendarModelTest(unittest.TestCase): def test_calendar_type_incorrect(self): # Act. with self.assertRaises(AssertionError) as ex: ...
{ "repo_name": "JasonCozens/CalTools", "path": "cal_tools/test/model_test/calendar_model_test.py", "copies": "1", "size": "1561", "license": "bsd-2-clause", "hash": -1508134833989146400, "line_mean": 26.875, "line_max": 56, "alpha_frac": 0.5707879564, "autogenerated": false, "ratio": 3.85432098765...
__author__ = 'Jason' import unittest import icalendar import icalendar.cal import icalendar.parser_tools import icalendar.parser import icalendar.prop import cal_tools.ijconvert import json import yaml class IJConvertTest(unittest.TestCase): def test_empty_vcalendar(self): # Arrange. expected_r...
{ "repo_name": "JasonCozens/CalTools", "path": "cal_tools/test/ijconvert_test.py", "copies": "1", "size": "3668", "license": "bsd-2-clause", "hash": -5911728690271333000, "line_mean": 22.6709677419, "line_max": 84, "alpha_frac": 0.5155398037, "autogenerated": false, "ratio": 3.43767572633552, "c...
__author__ = 'jason' import Utils class Classifier: def __init__(self, content_type, initial_content): self.content_type = content_type # a string with that describes the type of data to be stored self.content = initial_content # This function compute the similarity of the object stored wit...
{ "repo_name": "JasonPap/World-news-articles-matching", "path": "Classifier.py", "copies": "1", "size": "1948", "license": "mit", "hash": 764715219768870800, "line_mean": 41.347826087, "line_max": 102, "alpha_frac": 0.6262833676, "autogenerated": false, "ratio": 4.198275862068965, "config_test":...
__author__ = 'jason' def geo_search(query): results = dict() # use the geonames webAPI to fill dictionary with data results["country"] = "Greece" return results import urllib2 from bs4 import BeautifulSoup Cache = dict() def getCountry(query): if query in Cache: return Cache[query...
{ "repo_name": "ArisKots1992/Similar-World-News-Articles", "path": "geonames.py", "copies": "1", "size": "1105", "license": "mit", "hash": 6135644727705165000, "line_mean": 24.6976744186, "line_max": 128, "alpha_frac": 0.563800905, "autogenerated": false, "ratio": 4.003623188405797, "config_test...
__author__ = 'Jason Piper' import imp current_version = imp.load_source('lol', 'pyDNase/_version.py').__version__ try: from setuptools import setup, Extension except ImportError: from distutils.core import setup from distutils.extension import Extension setup( name='pyDNase', version=current_vers...
{ "repo_name": "jpiper/pyDNase", "path": "setup.py", "copies": "1", "size": "1690", "license": "mit", "hash": 217815065132853020, "line_mean": 32.137254902, "line_max": 149, "alpha_frac": 0.6313609467, "autogenerated": false, "ratio": 3.1766917293233083, "config_test": false, "has_no_keywords"...
__author__ = 'Jason' import os, re, csv, ast, csv import math import jinja2 jinja_environment = jinja2.Environment(autoescape=True, loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates'))) import flask from features import attr_str2dict from utils import * MAX_MONTH = 1000 def _a...
{ "repo_name": "zwChan/VATEC", "path": "~/eb-flask/analysis.py", "copies": "1", "size": "9079", "license": "apache-2.0", "hash": 6690114786800579000, "line_mean": 53.0242424242, "line_max": 530, "alpha_frac": 0.5825531446, "autogenerated": false, "ratio": 3.0954653937947496, "config_test": false...
__author__ = 'Jason' from collections import deque from Node import Node from Edge import Edge class Graph: def __init__(self): self.dictionary = dict() self.number_of_nodes = 0 self.number_of_edges = 0 def insert_node(self, node): """ Insert a node in ...
{ "repo_name": "JasonPap/graphproject", "path": "python/Graph.py", "copies": "1", "size": "7894", "license": "mit", "hash": 684801361661715800, "line_mean": 32.480349345, "line_max": 120, "alpha_frac": 0.5153280973, "autogenerated": false, "ratio": 4.126502875065342, "config_test": false, "has...
__author__ = 'Jason' from collections import deque import itertools def degree_distribution(graph): distribution = dict() for node_id in graph.dictionary: n = len(graph.dictionary[node_id].links) if n in distribution: val = distribution[n] val += 1 ...
{ "repo_name": "JasonPap/graphproject", "path": "python/GraphStatistics.py", "copies": "1", "size": "8961", "license": "mit", "hash": 3086861111594786300, "line_mean": 26.179245283, "line_max": 101, "alpha_frac": 0.4747238031, "autogenerated": false, "ratio": 3.6952577319587627, "config_test": f...
__author__ = 'Jason' from Graph import Graph from Node import Node from Edge import Edge def create_graph_from_file(filename): """ Create a graph from a CSV file. Column[0] -> Column[1] :param filename: CSV filename :return: Graph """ graph = Graph() with open(filename, 'r')...
{ "repo_name": "JasonPap/graphproject", "path": "python/FileOperations.py", "copies": "1", "size": "4102", "license": "mit", "hash": -6314599435570171000, "line_mean": 31.6393442623, "line_max": 112, "alpha_frac": 0.5402242808, "autogenerated": false, "ratio": 4.077534791252485, "config_test": f...
__author__ = 'Jason' from GraphStatistics import * from Edge import * import itertools import copy def girvan_newman(given_graph, limit): graph = copy.deepcopy(given_graph) ecb = edge_betweeness_centrality_slow(graph) # ecb is a dictionary (edge start, edge end) : centrality Q = -1 prev_Q...
{ "repo_name": "JasonPap/graphproject", "path": "python/Girvan_Newman.py", "copies": "1", "size": "3555", "license": "mit", "hash": -8662023135947273000, "line_mean": 29.4601769912, "line_max": 117, "alpha_frac": 0.5676511955, "autogenerated": false, "ratio": 3.562124248496994, "config_test": fa...
__author__ = 'Jason' import itertools from Graph import * from GraphStatistics import * def get_cliques(graph, k, proc_pool): persons = [] for idx in graph.dictionary: persons.append(idx) cliques = [] combinations = itertools.combinations(persons, k) arg = [] for comb ...
{ "repo_name": "JasonPap/graphproject", "path": "python/Clique_Percolation_Method.py", "copies": "1", "size": "2475", "license": "mit", "hash": 5090507665947763000, "line_mean": 23, "line_max": 54, "alpha_frac": 0.5373737374, "autogenerated": false, "ratio": 3.7218045112781954, "config_test": fa...
__author__ = 'Jason' import csv import sys,os,re with open(r'C:\fsu\ra\data\201708\Copy of Botanical_with_dsld_cat_termlist.csv', 'w+') as output: with open(r'C:\fsu\ra\data\201708\Copy of Botanical_with_dsld_cat.csv', 'rb') as csvfile: spamreader = csv.reader(csvfile, delimiter=',', quotechar=...
{ "repo_name": "zwChan/Clinical-Text-Mining", "path": "py/preprocess_index.py", "copies": "1", "size": "1746", "license": "apache-2.0", "hash": 8593496552647507000, "line_mean": 34.375, "line_max": 97, "alpha_frac": 0.4450171821, "autogenerated": false, "ratio": 3.779220779220779, "config_test":...
__author__ = 'Jason' import urllib2 from urllib2 import urlopen from bs4 import BeautifulSoup import re def visible(element): if element.parent.name in ['style', 'script', '[document]', 'head', 'title']: return False # elif re.match("<!--.*-->", str(element)): # return False ...
{ "repo_name": "zwChan/Clinical-Text-Mining", "path": "py/get_ct.py", "copies": "1", "size": "1562", "license": "apache-2.0", "hash": -458659385224633500, "line_mean": 33.5, "line_max": 123, "alpha_frac": 0.5550576184, "autogenerated": false, "ratio": 3.2073921971252566, "config_test": false, ...
__author__ = 'Jason Romero' from pyPdf import PdfFileWriter, PdfFileReader output = PdfFileWriter() input1 = PdfFileReader(file("document1.pdf", "rb")) # print the title of document1.pdf print "title = %s" % (input1.getDocumentInfo().title) # add page 1 from input1 to output document, unchanged output.addPage(input1...
{ "repo_name": "codenamejason/data_from_pdf", "path": "pyPDF.py", "copies": "1", "size": "1268", "license": "artistic-2.0", "hash": -3882264183226830300, "line_mean": 31.5128205128, "line_max": 69, "alpha_frac": 0.7492113565, "autogenerated": false, "ratio": 2.990566037735849, "config_test": fal...
__author__ = 'jasonrudy' import unittest import numpy from choldate import cholupdate, choldowndate class TestCholdate(unittest.TestCase): def setUp(self): numpy.random.seed(1) self.X = numpy.random.normal(size=(100,10)) def test_update(self): V = numpy.dot(self.X.transpose...
{ "repo_name": "jcrudy/choldate", "path": "choldate/test/test.py", "copies": "1", "size": "1127", "license": "bsd-3-clause", "hash": 4055990410864702000, "line_mean": 27.8974358974, "line_max": 79, "alpha_frac": 0.5749778172, "autogenerated": false, "ratio": 3.0876712328767124, "config_test": tr...
__author__ = 'Jason Vanzin forked by kujiy' import sys #used to get commandline arguments import subprocess import os def update(ipaddress, hostname): cmd = 'hostile set ' + ipaddress + ' ' + hostname print(cmd) os.system(cmd) def validIP(ipaddress): """ str -> bool Found this on http://stackoverflow.com/ques...
{ "repo_name": "kujiy/docker-connect-host-to-guest", "path": "docker-connect-host-to-guest.py", "copies": "1", "size": "3295", "license": "mit", "hash": 8252807859000254000, "line_mean": 29.5092592593, "line_max": 161, "alpha_frac": 0.6801213961, "autogenerated": false, "ratio": 3.18973862536302, ...
__author__ = 'Jason Wang' import numpy as np def nMathar(wv, P, T, H=10): """ Calculate the index of refraction as given by Mathar (2008): http://arxiv.org/pdf/physics/0610256v2.pdf ***Only valid for between 1.3 and 2.5 microns! Inputs: wv: wavelength in microns P: Pressure in Pa ...
{ "repo_name": "semaphoreP/nair", "path": "nair.py", "copies": "2", "size": "9649", "license": "bsd-3-clause", "hash": 535032433317127940, "line_mean": 37.4462151394, "line_max": 148, "alpha_frac": 0.5750855011, "autogenerated": false, "ratio": 2.412853213303326, "config_test": false, "has_no_...
import random,copy, statistics, timeit, threading, math from math import * import numpy as np import matplotlib.pyplot as plt import plot as pt import queue as Queue print("SIMULATED ANNEALING BASED PLACER") files = ['cm138a.txt', 'cm150a.txt', 'cm151a.txt', 'cm162a.txt', 'alu2.txt', 'C880.txt', ...
{ "repo_name": "jaspreetj/SA_based_FPGA_placer", "path": "SAv3.py", "copies": "1", "size": "10052", "license": "mit", "hash": -4039079754577298000, "line_mean": 29.3146417445, "line_max": 100, "alpha_frac": 0.5021886192, "autogenerated": false, "ratio": 3.973122529644269, "config_test": false, ...
__author__ = 'jasrub' import json """ Parameter class for defining parameters for a Deep Learning model """ class Parameter(object): def __init__(self, name, value, p_type=None, p_min=0, p_max=0, step=0, description="", size_change=False, list_type=None, is_path=False): se...
{ "repo_name": "artBoffin/GooeyBrain", "path": "models/parameter.py", "copies": "1", "size": "1108", "license": "apache-2.0", "hash": 5558352260417176000, "line_mean": 29.8055555556, "line_max": 67, "alpha_frac": 0.523465704, "autogenerated": false, "ratio": 3.705685618729097, "config_test": fal...
__author__ = 'jasrub' import json import os import signal import subprocess import time from flask import (Flask,jsonify, render_template, request, send_file) import models_manager from models.util import log # webapp app = Flask(__name__,static_folder='app/static', template_folder='app/templates') # for debugging...
{ "repo_name": "artBoffin/GooeyBrain", "path": "main.py", "copies": "1", "size": "3182", "license": "apache-2.0", "hash": -9044894453814023000, "line_mean": 29.8932038835, "line_max": 104, "alpha_frac": 0.6634192332, "autogenerated": false, "ratio": 3.563269876819709, "config_test": false, "ha...
__author__ = 'jasrub' """ This file is called from main.py whan "Train" is clicked. It recieves as arguments a path to parameters json file and a flag weather this is train or not TODO: add generate button, then call this with "--train False" flag on click """ import argparse import json from pprint import pformat ...
{ "repo_name": "artBoffin/GooeyBrain", "path": "run_tf.py", "copies": "1", "size": "1240", "license": "apache-2.0", "hash": -1738717137634039000, "line_mean": 27.1818181818, "line_max": 103, "alpha_frac": 0.6459677419, "autogenerated": false, "ratio": 3.604651162790698, "config_test": false, "...
__author__ = 'jatwood' import lasagne import lasagne.layers as layers import theano import theano.tensor as T import numpy as np import matplotlib.pyplot as plt import util # This class is not user facing; it contains the Lasagne internals for the SCNN model. class SearchConvolution(layers.MergeLayer): """ ...
{ "repo_name": "jcatw/scnn", "path": "scnn/scnn.py", "copies": "1", "size": "11080", "license": "mit", "hash": 2983355005087330300, "line_mean": 36.9452054795, "line_max": 142, "alpha_frac": 0.5825812274, "autogenerated": false, "ratio": 3.4239802224969096, "config_test": false, "has_no_keywor...
__author__ = 'jatwood' import numpy as np import cPickle as cp import inspect import os current_dir = os.path.dirname(os.path.abspath(inspect.stack()[0][1])) def parse_cora(plot=False): path = "%s/data/cora/" % (current_dir,) id2index = {} label2index = { 'Case_Based': 0, 'Genetic_Algo...
{ "repo_name": "jcatw/scnn", "path": "scnn/data.py", "copies": "1", "size": "6116", "license": "mit", "hash": -697243858439341700, "line_mean": 26.0619469027, "line_max": 84, "alpha_frac": 0.5021255723, "autogenerated": false, "ratio": 3.397777777777778, "config_test": false, "has_no_keywords"...
__author__ = 'jatwood' import numpy as np import sys from sklearn.metrics import f1_score, accuracy_score import util, data from graph_scnn import GraphSCNN def graph_experiment(data_fn, name, n_hops, transform_fn=util.rw_laplacian, transform_name='rwl'): A, X, Y = data_fn() n_graphs = len(A) indices ...
{ "repo_name": "jcatw/scnn", "path": "scnn/graph_experiment.py", "copies": "1", "size": "2497", "license": "mit", "hash": -8979454289852689000, "line_mean": 34.6714285714, "line_max": 113, "alpha_frac": 0.6063275931, "autogenerated": false, "ratio": 2.9940047961630696, "config_test": false, "h...
__author__ = 'jatwood' import numpy as np def rw_laplacian(A): Dm1 = np.zeros(A.shape) degree = A.sum(0) for i in range(A.shape[0]): if degree[i] == 0: Dm1[i,i] = 0. else: Dm1[i,i] = - 1. / degree[i] return -np.asarray(Dm1.dot(A),dtype='float32') def laplac...
{ "repo_name": "jcatw/scnn", "path": "scnn/util.py", "copies": "1", "size": "1181", "license": "mit", "hash": 4972983377597312000, "line_mean": 19.0169491525, "line_max": 51, "alpha_frac": 0.5190516511, "autogenerated": false, "ratio": 2.727482678983834, "config_test": false, "has_no_keywords"...
__author__ = 'jatwood' import sys import numpy as np from sklearn.metrics import f1_score, accuracy_score from sklearn.linear_model import LogisticRegression import data import kernel def baseline_edge_experiment(model_fn, data_fn, data_name, model_name): print 'Running edge experiment (%s)...' % (data_name,) ...
{ "repo_name": "jcatw/scnn", "path": "scnn/baseline_edge_experiment.py", "copies": "1", "size": "2403", "license": "mit", "hash": 3738545890330624500, "line_mean": 26.3068181818, "line_max": 103, "alpha_frac": 0.6125676238, "autogenerated": false, "ratio": 3.12890625, "config_test": false, "ha...
__author__ = 'jatwood' import sys import numpy as np from sklearn.metrics import f1_score, accuracy_score from sklearn.linear_model import LogisticRegression import data import util import kernel import structured def node_proportion_baseline_experiment(model_fn, data_fn, data_name, model_name, prop_valid, prop_tes...
{ "repo_name": "jcatw/scnn", "path": "scnn/node_proportion_baseline_experiment.py", "copies": "1", "size": "6747", "license": "mit", "hash": -329463364221982850, "line_mean": 31.4375, "line_max": 124, "alpha_frac": 0.6094560545, "autogenerated": false, "ratio": 3.117837338262477, "config_test": ...
__author__ = 'jatwood' import sys import numpy as np from sklearn.metrics import f1_score, accuracy_score from edge_scnn import EdgeSCNN import data import util def edge_experiment(data_fn, name, n_hops, transform_fn=util.rw_laplacian, transform_name='rwl'): print 'Running edge experiment (%s)...' % (name,) ...
{ "repo_name": "jcatw/scnn", "path": "scnn/edge_experiment.py", "copies": "1", "size": "2490", "license": "mit", "hash": -4330952920816972300, "line_mean": 27.9534883721, "line_max": 113, "alpha_frac": 0.6012048193, "autogenerated": false, "ratio": 3.0778739184178, "config_test": false, "has_n...
__author__ = 'jatwood' import sys import numpy as np from sklearn.metrics import f1_score, accuracy_score from scnn import SCNN, DeepSCNN, DeepFeedForwardSCNN import data import util def node_experiment(data_fn, name, n_hops, transform_fn=util.rw_laplacian, transform_name='rwl'): print 'Running node experiment ...
{ "repo_name": "jcatw/scnn", "path": "scnn/node_experiment.py", "copies": "1", "size": "3295", "license": "mit", "hash": -8004710738341169000, "line_mean": 31.3039215686, "line_max": 115, "alpha_frac": 0.6209408194, "autogenerated": false, "ratio": 2.9445933869526364, "config_test": true, "has...
__author__ = 'jatwood' # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) setup( name='scnn', # Versions should comply with PEP440. For a discussion on ...
{ "repo_name": "jcatw/scnn", "path": "setup.py", "copies": "1", "size": "4846", "license": "mit", "hash": 6922065338169591000, "line_mean": 32.4206896552, "line_max": 101, "alpha_frac": 0.6438299629, "autogenerated": false, "ratio": 3.9430431244914566, "config_test": true, "has_no_keywords": f...
__author__ = 'Javad Arjmandi' from random import randint def player_choice_input(): choice = input("Welcome to The Game! Please Choose: \n1. Rock\n2. Paper\n3. Scissor\n>>>") if choice == "1": return "Rock" elif choice == "2": return "Paper" elif choice == "3": return "Scissor" ...
{ "repo_name": "La-Volpe/RoPaSci", "path": "RoPaSci.py", "copies": "1", "size": "1360", "license": "mit", "hash": 4473146328923384300, "line_mean": 29.2444444444, "line_max": 94, "alpha_frac": 0.5316176471, "autogenerated": false, "ratio": 3.215130023640662, "config_test": false, "has_no_keywo...
__author__ = 'Javier Domingo Cansino <javierdo1@gmail.com>' __version__ = '0.0.1' import ast import logging from functools import partial logging.basicConfig(level=logging.DEBUG, format='%(levelname)-8s %(asctime)s %(message)s') logger = logging.getLogger() DQ = '"' SQ = "'" class StringChecker...
{ "repo_name": "txomon/flake8-quotes", "path": "flake8_quotes.py", "copies": "1", "size": "4511", "license": "mit", "hash": -4947451979116135000, "line_mean": 32.4148148148, "line_max": 79, "alpha_frac": 0.5455553092, "autogenerated": false, "ratio": 3.9294425087108014, "config_test": false, "...
__author__ = 'Javier' import unittest from gindex import GIndex, Project, ProjectRepositoryService, ProjectFactory from gindex_presenter import GIndexPresenter from gindex_conectors import GithubConnector from unittest.mock import MagicMock import httpretty class TestProject(unittest.TestCase): def test_init_co...
{ "repo_name": "javierj/kobudo-katas", "path": "Kata-RestConsumer/testcases.py", "copies": "1", "size": "3673", "license": "apache-2.0", "hash": -1258656430675613700, "line_mean": 35.0098039216, "line_max": 93, "alpha_frac": 0.6319085216, "autogenerated": false, "ratio": 3.5283381364073008, "con...
__author__ = 'Javier' import urllib.request import json class Repo(object): def __init__(self, fork, stars, watchers): self._fork = int(fork) self._stars = int(stars) self._watchers = int(watchers) @property def forks(self): return self._fork @property def stars(s...
{ "repo_name": "javierj/kobudo-katas", "path": "Kata-RestConsumer/DjangoGIndexDemo/gindex/gindex_logic/gindex.py", "copies": "1", "size": "1609", "license": "apache-2.0", "hash": -7977808212470422000, "line_mean": 25.3770491803, "line_max": 90, "alpha_frac": 0.6059664388, "autogenerated": false, "...
__author__ = 'Javier' class Project(object): def __init__(self, forks, stars, watchs): self._forks = int(forks) self._stars = int(stars) self._watchs = int(watchs) @property def forks(self): return self._forks @property def stars(self): return self._stars...
{ "repo_name": "javierj/kobudo-katas", "path": "Kata-RestConsumer/gindex.py", "copies": "1", "size": "1259", "license": "apache-2.0", "hash": -5008096293509698000, "line_mean": 22.7735849057, "line_max": 65, "alpha_frac": 0.5909451946, "autogenerated": false, "ratio": 3.724852071005917, "config_...
__author__ = 'javon' import itertools import math import heapq def func(): options = [] n = raw_input() a,b = n.split() a,b = int(a),int(b) return (a+b)+(a-b)+(b+a)+(b-a) evaluations = {"+": lambda num1, num2, ans: (num1 + num2) == ans, "-": lambda num1, num2, ans: (num1 - num2) ==...
{ "repo_name": "JA-VON/python-helpers-msbm", "path": "main.py", "copies": "1", "size": "24289", "license": "mit", "hash": 8788391688941698000, "line_mean": 31.2576361222, "line_max": 304, "alpha_frac": 0.4431224011, "autogenerated": false, "ratio": 3.7774494556765164, "config_test": false, "ha...
def ranges(upvotes, N, K): i = 1 count = 0 helper1 = {} helper2 = {} n = N - K + 1 if upvotes[0] < upvotes[1]: helper1.extend([1, 0]) helper2.extend([1, 0]) elif upvotes[0] > upvotes[1]: helper1.extend([0, 1]) helper2.extend([0, 1]) else: hel...
{ "repo_name": "JA-VON/python-helpers-msbm", "path": "quora_subrange.py", "copies": "1", "size": "4950", "license": "mit", "hash": -3204781393106124000, "line_mean": 23.8793969849, "line_max": 72, "alpha_frac": 0.4797979798, "autogenerated": false, "ratio": 3.435114503816794, "config_test": fals...
__author__ = 'javon' import Queue class MutableQueue(Queue.Queue): def change(self, index, new_item): with self.mutex: self.queue[index] = new_item def show(self, index): with self.mutex: return self.queue[index] def ranges_with_queue(upvotes, N, K): i = 1 ...
{ "repo_name": "JA-VON/python-helpers-msbm", "path": "quora_subranges_simple.py", "copies": "1", "size": "2882", "license": "mit", "hash": 1175338326680779000, "line_mean": 26.4571428571, "line_max": 76, "alpha_frac": 0.4580152672, "autogenerated": false, "ratio": 3.709137709137709, "config_test...
__author__ = 'javon' """ Recursive power implementation O(log n) """ def pow_recur(a, n): if n == 0: return 1 if n == 1: return a elif n % 2 == 0: return pow_recur(a, n / 2) * pow_recur(a, n / 2) else: return a * pow_recur(a, (n - 1) / 2) * pow_recur(a, (n - 1) / 2) ...
{ "repo_name": "JA-VON/python-helpers-msbm", "path": "implementations.py", "copies": "1", "size": "18945", "license": "mit", "hash": 4425060195597715000, "line_mean": 25.7207334274, "line_max": 122, "alpha_frac": 0.4775930325, "autogenerated": false, "ratio": 3.4215279031966768, "config_test": f...
__author__ = 'jawaad' import codecs import logging from tbar import YuubinBango, unicode_csv_reader class RedisYuubinBango(YuubinBango): """Enables the use of Redis-DB with Japanese Postal Code data.""" def _save(self, pipeline): """Uses pipeline / connection sent by default. You should use...
{ "repo_name": "jmahmood/pytbar", "path": "pytbar/redis_tbar.py", "copies": "1", "size": "1373", "license": "mit", "hash": 5380473099949217000, "line_mean": 31.6904761905, "line_max": 98, "alpha_frac": 0.6474872542, "autogenerated": false, "ratio": 3.671122994652406, "config_test": false, "has...
__author__ = 'jay7958' from xml.dom import NamespaceErr from defusedxml import ElementTree from datetime import datetime from dojo.models import Finding class VeracodeXMLParser(object): def __init__(self, filename, test): vscan = ElementTree.parse(filename) root = vscan.getroot() if 'ht...
{ "repo_name": "yan99uic/django-DefectDojo", "path": "dojo/tools/veracode/parser.py", "copies": "2", "size": "4974", "license": "bsd-3-clause", "hash": -5897367039127475000, "line_mean": 48.2475247525, "line_max": 142, "alpha_frac": 0.4969843185, "autogenerated": false, "ratio": 4.07037643207856, ...
class HashTable(): LOAD_THRESHOLD = 0.3 GOLDEN_VALUE = 0.618034 LOW_CAP = 10 def __init__(self, capacity=-1): self.size = 0 self.capacity = max(self.LOW_CAP, capacity) self.table = [None] * self.capacity def loadFactor(self): return self.size / self.capacity def resize(s...
{ "repo_name": "JDNdeveloper/Interview-Practice-Python", "path": "src/HashTable.py", "copies": "1", "size": "1734", "license": "mit", "hash": -8238702344313458000, "line_mean": 23.4225352113, "line_max": 64, "alpha_frac": 0.598615917, "autogenerated": false, "ratio": 3.4404761904761907, "config_...
def quickSort(data): sortedData = list(data) _quickSort(sortedData, 0, len(data) - 1) return sortedData def _quickSort(data, left, right): if (right - left) < 1: return partitionIndex = _partition(data, left, right) _quickSort(data, left, partitionIndex - 1) _quickSort(data, partitionIndex ...
{ "repo_name": "JDNdeveloper/Interview-Practice-Python", "path": "src/QuickSort.py", "copies": "1", "size": "1566", "license": "mit", "hash": 3241390101307373600, "line_mean": 26, "line_max": 70, "alpha_frac": 0.6123882503, "autogenerated": false, "ratio": 3.157258064516129, "config_test": false...
from collections import Counter class Arc: def __init__(self): self.dest = None self.weight = 1 def __eq__(self, other): return self.dest == other.dest def __repr__(self): return str(self.weight) + "->" + str(self.dest) def __hash__(self): return hash(self.dest) class Gr...
{ "repo_name": "JDNdeveloper/Interview-Practice-Python", "path": "src/GraphADT.py", "copies": "1", "size": "2846", "license": "mit", "hash": -3869290566667396600, "line_mean": 23.9649122807, "line_max": 66, "alpha_frac": 0.5270555165, "autogenerated": false, "ratio": 3.2525714285714287, "config_...