text
stringlengths
0
1.05M
meta
dict
from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim import atexit import ssl import sys #Script to get Max EVC Mode supported on all the hosts in the cluster s=ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode=ssl.CERT_NONE si= SmartConnect(host="10.160.50.60", user="Administrator@vsphere.local",...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/getEVCClusterState.py", "copies": "1", "size": "2301", "license": "mit", "hash": 8774701115499308000, "line_mean": 34.4, "line_max": 138, "alpha_frac": 0.6710126032, "autogenerated": false, "ratio": 3.6640127388...
from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim import atexit import ssl import sys s=ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode=ssl.CERT_NONE si= SmartConnect(host="10.160.50.60", user="Administrator@vsphere.local", pwd="VMware#12",sslContext=s) content=si.content # Your cluster na...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/getMaxEVCMode.py", "copies": "1", "size": "1926", "license": "mit", "hash": -3603587355603857000, "line_mean": 34.0181818182, "line_max": 138, "alpha_frac": 0.6671858775, "autogenerated": false, "ratio": 3.62030...
from pyVim.connect import SmartConnect import ssl from pyVmomi import vim import atexit import sys import argparse import getpass def get_args(): """ Get arguments from CLI """ parser = argparse.ArgumentParser( description='Arguments for talking to vCenter') parser.add_argument('-s', '--host'...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/per-VM EVC/per-VM_EVC_clustermask.py", "copies": "1", "size": "3551", "license": "mit", "hash": -866747896578511500, "line_mean": 31.5779816514, "line_max": 114, "alpha_frac": 0.6316530555, "autogenerated": false,...
from pyVim.connect import SmartConnect import ssl from pyVmomi import vim import atexit import sys import argparse import getpass def get_args(): """ Get arguments from CLI """ parser = argparse.ArgumentParser( description='Arguments for talking to vCenter') parser.add_argument('-s', '--host...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/per-VM EVC/configure_pervm_evc.py", "copies": "1", "size": "2999", "license": "mit", "hash": 2885683889624883000, "line_mean": 31.247311828, "line_max": 114, "alpha_frac": 0.6185395132, "autogenerated": false, "...
from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim import atexit import ssl import sys import time s=ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode=ssl.CERT_NONE si= SmartConnect(host="10.161.20.30", user="Administrator@vsphere.local", pwd="VMware#123",sslContext=s) content=si.content #Clus...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/enable_proactive_ha.py", "copies": "1", "size": "2439", "license": "mit", "hash": 3310235510155513300, "line_mean": 34.347826087, "line_max": 138, "alpha_frac": 0.7076670767, "autogenerated": false, "ratio": 3.4...
from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim import atexit import ssl import sys import time #Script to register a health update provider and adding monitored entities s=ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode=ssl.CERT_NONE si= SmartConnect(host="10.161.20.30", user="Administrato...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/register_provider.py", "copies": "1", "size": "2532", "license": "mit", "hash": 6120032858773733000, "line_mean": 38.5625, "line_max": 138, "alpha_frac": 0.7417061611, "autogenerated": false, "ratio": 3.71806167...
from pyVim.connect import SmartConnect from pyVmomi import vim import ssl s=ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode=ssl.CERT_NONE c= SmartConnect(host="10.192.20.30", user="Administrator@vsphere.local", pwd="VMW!23A",sslContext=s) vcha = c.content.failoverClusterManager VchaClusterHealth = vcha.GetVchaClus...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/get_vcha_health.py", "copies": "1", "size": "1361", "license": "mit", "hash": 6746981779155990000, "line_mean": 37.8857142857, "line_max": 138, "alpha_frac": 0.7891256429, "autogenerated": false, "ratio": 3.0584...
import requests import json import ssl import atexit import sys import argparse import getpass from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) s=requests.Session() s.verify=False def get_args(): """ Get arguments from ...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "vCenter REST APIs using Python/relocate_vm.py", "copies": "1", "size": "4372", "license": "mit", "hash": -31064515828263796, "line_mean": 31.6268656716, "line_max": 131, "alpha_frac": 0.6084172004, "autogenerated": false, "ratio": 3.64333...
from pyVim.connect import SmartConnect from pyVmomi import vim import ssl s=ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode=ssl.CERT_NONE c= SmartConnect(host="10.161.2.3", user="Administrator@vsphere.local", pwd="VMware1!",sslContext=s) content=c.content #Below method gets all objects those are matching with prov...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "pyVmomi vSphere python SDK/getDRSRules.py", "copies": "1", "size": "2353", "license": "mit", "hash": -5155983317375272000, "line_mean": 47.0204081633, "line_max": 138, "alpha_frac": 0.7450063748, "autogenerated": false, "ratio": 3.5490196...
import requests import json import ssl import atexit import sys import argparse import getpass from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) s=requests.Session() s.verify=False def get_args(): """ Get arguments from C...
{ "repo_name": "vThinkBeyondVM/vThinkBVM-scripts", "path": "vCenter REST APIs using Python/HLMLinking.py", "copies": "1", "size": "4041", "license": "mit", "hash": 6440666958698434000, "line_mean": 30.8188976378, "line_max": 131, "alpha_frac": 0.5634743875, "autogenerated": false, "ratio": 4.10253...
__author__ = 'vikesh' from slackrtm.server import User, Bot class DummyServer(object): def __init__(self, slack=None, config=None, hooks=None, db=None): self.slack = slack or DummySlack() self.config = config self.hooks = hooks self.db = db def query(self, sql, *params): ...
{ "repo_name": "vicky002/Charmander", "path": "charmander/dummyserver.py", "copies": "1", "size": "1508", "license": "mit", "hash": 8552597043563004000, "line_mean": 26.4181818182, "line_max": 69, "alpha_frac": 0.5444297082, "autogenerated": false, "ratio": 3.651331719128329, "config_test": fals...
__author__ = 'vikesh' import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup PYTHON3 = sys.version_info[0] > 2 required = ['requests>=2.5', 'websocket-client==0.32.0', 'beautifulsoup4==4.4.1', 'html5lib==0.9999999', 'pyfiglet==0.7.4', ...
{ "repo_name": "vicky002/Charmander", "path": "setup.py", "copies": "1", "size": "1424", "license": "mit", "hash": -6887243084360543000, "line_mean": 24.9090909091, "line_max": 90, "alpha_frac": 0.6172752809, "autogenerated": false, "ratio": 3.4066985645933014, "config_test": false, "has_no_ke...
__author__ = 'vikesh' import os import wolframalpha from flask import Flask, request, Response, redirect try: import config wol_id = config.wolframalpha['app_id'] except: wol_id = os.environ.get('APP_ID') if not wol_id: import sys print 'No config.py found exisiting...' sys.exit(0) app =...
{ "repo_name": "vicky002/slack-TheL", "path": "app.py", "copies": "1", "size": "1215", "license": "mit", "hash": -4762528517801742000, "line_mean": 21.9245283019, "line_max": 88, "alpha_frac": 0.5958847737, "autogenerated": false, "ratio": 3.2058047493403694, "config_test": false, "has_no_keyw...
__author__ = 'vikesh' """ ~wiki <query | topic> returns a wiki link for that <query> """ import re try: from urllib import quote except ImportError: from urllib2.request import quote import requests from bs4 import BeautifulSoup def return_wiki(search_term): search_term = quote(search_term) url =...
{ "repo_name": "vicky002/Charmander", "path": "charmander/extensions/wiki.py", "copies": "1", "size": "1280", "license": "mit", "hash": 2781957121268595000, "line_mean": 23.6346153846, "line_max": 121, "alpha_frac": 0.63515625, "autogenerated": false, "ratio": 3.2160804020100504, "config_test": ...
import flickr_api logFile = 'pyflickr.log' resize = (1,1) fd = open('flickr.key','r') kdat = fd.readlines() fd.close() flickr_api.set_keys(api_key=kdat[0].strip(), api_secret=kdat[1].strip()) def log(msg,typ='a'): global logFile fd = open(logFile,typ) fd.write(msg+'\n') fd.close() def setLog(fil='pyflickr....
{ "repo_name": "makechaos/PhotoAccess", "path": "pyflickr.py", "copies": "1", "size": "7263", "license": "mit", "hash": -9066565338676208000, "line_mean": 25.7022058824, "line_max": 131, "alpha_frac": 0.6067740603, "autogenerated": false, "ratio": 2.9512393336042257, "config_test": false, "has...
import os import sys from pymongo import MongoClient from datetime import datetime dbname = 'PhotoDB-6' updfil = '.lastupdate'+'_'+dbname def getJpegHeader(fname): from PIL import Image from PIL.ExifTags import TAGS import datetime import os i = Image.open(fname) inf = i._getexif(); dat = dict() sdi...
{ "repo_name": "makechaos/PhotoAccess", "path": "addDirImagesToDB.py", "copies": "1", "size": "4510", "license": "mit", "hash": -3467925956153327600, "line_mean": 24.7714285714, "line_max": 115, "alpha_frac": 0.5600886918, "autogenerated": false, "ratio": 2.8653113087674713, "config_test": false...
import photoServer import web import StringIO import string from PIL import Image from pymongo import MongoClient hostid='http://192.168.1.4:1451' client = MongoClient('localhost',1951) dbName = 'PhotoDB-6' db = client[dbName] coll = db['Photos'] gopt = '' showSizeText = False dfmt = '%d-%b-%Y' albumList = None imPer...
{ "repo_name": "makechaos/PhotoAccess", "path": "photoServer.py", "copies": "1", "size": "23825", "license": "mit", "hash": -2759888120304611000, "line_mean": 36.5788643533, "line_max": 562, "alpha_frac": 0.580818468, "autogenerated": false, "ratio": 3.002898916057474, "config_test": false, "h...
import time #knapsack problem # given max weight W and weights w1....wn and values v1...vn, maximize the items in a bag def knapsack(input, maxWeight): k=[0] # for w = 1 to W # k(w) = max(k(W-wi) + vi)) for w in range(1, maxWeight+1): maxVal = 0 for i in range(0, len(input)): ...
{ "repo_name": "vikramraman/algorithms", "path": "python/knapsack.py", "copies": "1", "size": "1502", "license": "mit", "hash": -1890469022171185000, "line_mean": 24.4576271186, "line_max": 89, "alpha_frac": 0.5026631158, "autogenerated": false, "ratio": 2.740875912408759, "config_test": false, ...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '01 January 2009' __copyright__ = 'Copyright (c) 2009 Viktor Kerkez' import os import logging from tea.process import execute from samovar.scm.base import SCM logger = logging.getLogger(__name__) class Git(SCM): def __init__(self, repository): ...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/scm/git.py", "copies": "1", "size": "2096", "license": "bsd-3-clause", "hash": 8714407073657700000, "line_mean": 33.3606557377, "line_max": 78, "alpha_frac": 0.5601145038, "autogenerated": false, "ratio": 3.8248175182481754, "config_test": ...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '02 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' from samovar.commander import BaseCommand from ._parsing import HgStyle, HgLexer class Command(BaseCommand): '''Perform hg commit on all selected repositories''' option_l...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/commands/scm/commit.py", "copies": "1", "size": "2122", "license": "bsd-3-clause", "hash": -5582876740645743000, "line_mean": 46.1555555556, "line_max": 112, "alpha_frac": 0.6055607917, "autogenerated": false, "ratio": 3.8442028985507246, "...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '02 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' import os import json import glob import urllib import logging try: import urlparse # @UnusedImport import urllib2 as request # @UnusedImport except: from urllib impo...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/utils/other.py", "copies": "1", "size": "5190", "license": "bsd-3-clause", "hash": 4718988135565490000, "line_mean": 33.8322147651, "line_max": 123, "alpha_frac": 0.5816955684, "autogenerated": false, "ratio": 3.728448275862069, "config_tes...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '02 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' import os from tea.system import platform from tea.process import execute from samovar.commander import BaseCommand from tea.console.color import cprint, Color class Command(Base...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/commands/other/open.py", "copies": "1", "size": "2406", "license": "bsd-3-clause", "hash": 459136104476312900, "line_mean": 40.4827586207, "line_max": 157, "alpha_frac": 0.5573566085, "autogenerated": false, "ratio": 3.7711598746081503, "co...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '18 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' import abc import getpass from tea.console.color import cprint, Color from samovar.parsing import ConsoleFormatter from tea.utils import six from tea.utils.six.moves import input # @Unres...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/commander/ui.py", "copies": "1", "size": "4411", "license": "bsd-3-clause", "hash": -8497480318262835000, "line_mean": 32.9307692308, "line_max": 74, "alpha_frac": 0.6463386987, "autogenerated": false, "ratio": 4.380337636544191, "config_te...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '18 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' import os import re import sys import json import time import logging import argparse from samovar.commander.options import add_option from samovar.commander.exceptions import CommandError...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/commander/base.py", "copies": "1", "size": "7608", "license": "bsd-3-clause", "hash": -6999416014485885000, "line_mean": 33.8990825688, "line_max": 79, "alpha_frac": 0.6100157729, "autogenerated": false, "ratio": 4.402777777777778, "config_...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '19 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' from tea.console.color import Color class Font(object): """Font properties""" Defalt = 0 # Style Mono = 1 Roman = 2 Sans = 4 # Decoration Bold = 8 I...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/parsing/style.py", "copies": "1", "size": "4942", "license": "bsd-3-clause", "hash": -5722094206169405000, "line_mean": 28.4166666667, "line_max": 77, "alpha_frac": 0.5064751113, "autogenerated": false, "ratio": 3.873040752351097, "config_t...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '19 January 2013' __copyright__ = 'Copyright (c) 2013 Viktor Kerkez' import sys from tea.utils import six from tea.console.color import cprint from samovar.parsing.token import Token from samovar.parsing.style import Style, ConsoleStyleAdapter class Forma...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/parsing/formatter.py", "copies": "1", "size": "2295", "license": "bsd-3-clause", "hash": -3168443094630368000, "line_mean": 26, "line_max": 77, "alpha_frac": 0.6265795207, "autogenerated": false, "ratio": 3.756137479541735, "config_test": f...
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '01 January 2009' __copyright__ = 'Copyright (c) 2009 Viktor Kerkez' import re try: import urlparse from urllib2 import quote as urlquote except ImportError: import urllib.parse as urlparse urlquote = urlparse.quote # tea impor...
{ "repo_name": "alefnula/samovar", "path": "src/samovar/scm/repository.py", "copies": "1", "size": "2843", "license": "bsd-3-clause", "hash": -4720663800626940000, "line_mean": 27.9263157895, "line_max": 73, "alpha_frac": 0.52514949, "autogenerated": false, "ratio": 3.981792717086835, "config_te...
__author__ = 'Vinayak Marali' __author__ = 'Pavan Prabhakar Bhat' """ CSCI-603: Lab 2 (week 2) Section 03 Author: Pavan Prbahakar Bhat (pxb8715@rit.edu) Vinayak Marali (vkm7895@rit.edu) This is a program that draws a forest with trees and a house. """ # Imports required by the program import turtle import ra...
{ "repo_name": "pavanbhat/Python-Labs", "path": "forest.py", "copies": "1", "size": "7578", "license": "bsd-3-clause", "hash": -4133744165060668000, "line_mean": 26.4565217391, "line_max": 101, "alpha_frac": 0.5897334389, "autogenerated": false, "ratio": 3.584673604541154, "config_test": false, ...
__author__ = 'vinay' import json import traceback from django.core.cache import cache from django.http.response import HttpResponseForbidden, JsonResponse from django.shortcuts import get_object_or_404 from django.views.decorators.csrf import csrf_protect from django.views.decorators.http import require_POST from .mo...
{ "repo_name": "amitu/cfblog", "path": "cfblog/views.py", "copies": "1", "size": "1900", "license": "bsd-3-clause", "hash": 8042067649594949000, "line_mean": 34.1851851852, "line_max": 110, "alpha_frac": 0.6115789474, "autogenerated": false, "ratio": 4.260089686098655, "config_test": false, "h...
__author__ = 'vinay' import json from django.conf import settings from django.core.cache import cache from django.core.exceptions import ValidationError from django.http.response import Http404, HttpResponse from django.template import TemplateSyntaxError, TemplateDoesNotExist from django.views.decorators.csrf import ...
{ "repo_name": "amitu/cfblog", "path": "cfblog/response.py", "copies": "1", "size": "5653", "license": "bsd-3-clause", "hash": -6723283974273591000, "line_mean": 38.5314685315, "line_max": 117, "alpha_frac": 0.6527507518, "autogenerated": false, "ratio": 4.536918138041734, "config_test": false, ...
__author__ = 'Vince.ec' from grizli import model from grizli import multifit import numpy as np from scipy.interpolate import interp1d from astropy.table import Table from astropy import wcs from astropy.io import fits from glob import glob import os def Extract_BeamCutout(target_id, grism_file, mosaic, seg_map, inst...
{ "repo_name": "ivastar/clear", "path": "notebooks/forward_modeling/sim_tools.py", "copies": "1", "size": "7874", "license": "mit", "hash": -4544690886130491400, "line_mean": 35.9718309859, "line_max": 115, "alpha_frac": 0.5575311151, "autogenerated": false, "ratio": 3.024971187091817, "config_t...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 ap...
{ "repo_name": "vidupont/ebu-kiosk-v1", "path": "scripts/get-platformio.py", "copies": "1", "size": "5510", "license": "apache-2.0", "hash": 8022378251782360000, "line_mean": 27.4020618557, "line_max": 91, "alpha_frac": 0.6143375681, "autogenerated": false, "ratio": 3.7921541637990366, "config_t...
__author__ = 'vincentnewpro' from sys import byteorder from array import array from struct import pack import pyaudio import wave class CocoListener: THRESHOLD = 450 CHUNK_SIZE = 1024 FORMAT = pyaudio.paInt16 RATE = 16000 def is_silent(self,snd_data): "Returns 'True' if below the 'sile...
{ "repo_name": "yhfy2006/cocabot", "path": "bot/cocoListener.py", "copies": "1", "size": "3612", "license": "mit", "hash": -1813079574896706300, "line_mean": 27.4488188976, "line_max": 84, "alpha_frac": 0.553709856, "autogenerated": false, "ratio": 3.6484848484848484, "config_test": false, "ha...
__author__ = 'vincentnewpro' from sys import byteorder from array import array from struct import pack import pyaudio import wave THRESHOLD = 500 CHUNK_SIZE = 1024 FORMAT = pyaudio.paInt16 RATE = 11025 def is_silent(snd_data): "Returns 'True' if below the 'silent' threshold" return max(snd_data) < THRESHOLD...
{ "repo_name": "yhfy2006/cocabot", "path": "bot/tester.py", "copies": "1", "size": "2995", "license": "mit", "hash": 4955161118986051000, "line_mean": 23.5573770492, "line_max": 80, "alpha_frac": 0.6023372287, "autogenerated": false, "ratio": 3.313053097345133, "config_test": false, "has_no_ke...
__author__ = 'vincenzo gulisano' import pymysql.cursors from optparse import OptionParser def open_connection(password): connection = pymysql.connect(host='129.16.22.6', port=8080, user='root', password=password, ...
{ "repo_name": "vincenzo-gulisano/debs2016_evaluationplatform", "path": "db/db_utils.py", "copies": "1", "size": "4108", "license": "mit", "hash": -84487580802181920, "line_mean": 32.1290322581, "line_max": 105, "alpha_frac": 0.6550632911, "autogenerated": false, "ratio": 3.9767666989351405, "co...
__author__ = 'vin@misday.com' from pyvin.core import SqliteHelp class Persist(SqliteHelp): DB_NAME = 'data.db' DB_VER = 1 CREATE_BOOK_TBL = ''' CREATE TABLE IF NOT EXISTS book ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, bid TEXT NOT NULL, title TEXT NOT NULL, ...
{ "repo_name": "susemm/books", "path": "duoPersist.py", "copies": "1", "size": "1992", "license": "apache-2.0", "hash": 3201576209880223000, "line_mean": 28.6769230769, "line_max": 141, "alpha_frac": 0.5240963855, "autogenerated": false, "ratio": 3.913555992141454, "config_test": false, "has_n...
__author__ = 'vin@misday.com' import os, sys, urllib, urllib2, codecs, traceback, platform, re, threading, logging from datetime import * from pyvin.core import Processor import bs4 reload(sys) sys.setdefaultencoding('utf8') sysstr = platform.system() def get_timestamp(): return datetime.now().strf...
{ "repo_name": "susemm/pyvin", "path": "spider/__init__.py", "copies": "1", "size": "11436", "license": "apache-2.0", "hash": 7337961346833993000, "line_mean": 30.214084507, "line_max": 156, "alpha_frac": 0.502186079, "autogenerated": false, "ratio": 3.8196392785571143, "config_test": false, "...
__author__ = 'vin@misday.com' import sqlite3 class SqliteHelp: def __init__(self, dbName = '', newVersion= 0): self.conn = sqlite3.connect(dbName, check_same_thread=False) self.cursor = self.conn.cursor() version = self.getVersion() if version == 0: self.onC...
{ "repo_name": "susemm/pyvin", "path": "core/sqlitehelp.py", "copies": "1", "size": "1091", "license": "apache-2.0", "hash": -5997201825090383000, "line_mean": 24.6585365854, "line_max": 68, "alpha_frac": 0.5490375802, "autogenerated": false, "ratio": 3.9386281588447654, "config_test": false, ...
__author__ = 'vin@misday.com' import threading, Queue, time, logging from .callbacks import Callbacks class Processor(threading.Thread, Callbacks): (EVT_START, EVT_STOP, EVT_LOOP, EVT_MAX_NUM) = range(1, 5) def __init__(self, name = '', interval = 0, log=None): if log: self.log ...
{ "repo_name": "susemm/pyvin", "path": "core/processor.py", "copies": "1", "size": "1619", "license": "apache-2.0", "hash": -2787456163956494000, "line_mean": 29.7843137255, "line_max": 80, "alpha_frac": 0.5311920939, "autogenerated": false, "ratio": 3.958435207823961, "config_test": false, "h...
__author__ = 'vin@misday.com' import wx, webbrowser from pyvin.core import Callbacks (IDX_LABEL, IDX_HELP, IDX_ID, IDX_BITMAP, IDX_KIND, IDX_HANDLER, IDX_ID2) = range(0, 7) def createMenubar(wnd, menuDef): '''menuDef = [('FILE', ( ('Open', 'Open a file', MainWindow.ID_MENUITE...
{ "repo_name": "susemm/pyvin", "path": "ux/__init__.py", "copies": "1", "size": "4396", "license": "apache-2.0", "hash": -1914303062579027700, "line_mean": 28.7412587413, "line_max": 131, "alpha_frac": 0.5141037307, "autogenerated": false, "ratio": 3.6300578034682083, "config_test": false, "ha...
__author__ = 'vin@misday.com' class KeyEvent: '''From ${android}\android-sdk-windows\sources\android-23\android\view\KeyEvent.java''' # /** Key code constant: Unknown key code. */ KEYCODE_UNKNOWN = 0; # /** Key code constant: Soft Left key. # * Usually situated below the display...
{ "repo_name": "susemm/pyvin", "path": "android/keyevent.py", "copies": "1", "size": "33177", "license": "apache-2.0", "hash": 7724741026146750000, "line_mean": 45.6025824964, "line_max": 97, "alpha_frac": 0.5668987552, "autogenerated": false, "ratio": 3.486077545444993, "config_test": false, ...
__author__ = 'VinnieJohns' from model.contact import Contact from fixture import support import random import string import jsonpickle import os.path import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"]) except getopt.GetoptError as err: getopt.usage() ...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "generator/contact.py", "copies": "1", "size": "2671", "license": "apache-2.0", "hash": 237324172609434940, "line_mean": 40.75, "line_max": 113, "alpha_frac": 0.6053912392, "autogenerated": false, "ratio": 3.5997304582210243, "config...
__author__ = 'VinnieJohns' from model.contact import Contact from random import randrange import re def test_14_all_contact_fields(app, db): if len(db.get_contacts_list()) == 0: app.contact.create(Contact(fname="pleasedeleteme")) contacts = db.get_contacts_list() index = randrange(len(contacts)) ...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "test/test_14_all_contact_fields.py", "copies": "1", "size": "1674", "license": "apache-2.0", "hash": -597511869262833200, "line_mean": 39.8292682927, "line_max": 116, "alpha_frac": 0.6170848268, "autogenerated": false, "ratio": 3.5845...
__author__ = 'VinnieJohns' from model.contact import Contact import random def test_modify_random_contact(app, db, check_ui): # please note that anniversary_date_month values are lowercase letters only new_contact_data = Contact(fname="mod_fname0", midname="mod_mname0", lname="mod_lname0", nickname="mod_nickn...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "test/test_modify_contact.py", "copies": "1", "size": "1724", "license": "apache-2.0", "hash": 429097734776443100, "line_mean": 62.8888888889, "line_max": 124, "alpha_frac": 0.6281902552, "autogenerated": false, "ratio": 3.393700787401...
__author__ = 'VinnieJohns' from model.contact import Contact import re class ContactHelper: # variable for storing list of groups contacts_cache = None def __init__(self, app): self.app = app def open_add_new_contact_page(self): wd = self.app.wd if not (wd.current_url.endswi...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "fixture/contact.py", "copies": "1", "size": "9381", "license": "apache-2.0", "hash": -7200583717819921000, "line_mean": 48.9042553191, "line_max": 105, "alpha_frac": 0.6229613048, "autogenerated": false, "ratio": 3.4026115342763874, ...
__author__ = 'VinnieJohns' from model.group import Group from fixture import support import random import string import jsonpickle import os.path import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"]) except getopt.GetoptError as err: getopt.usage() sys...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "generator/group.py", "copies": "1", "size": "1256", "license": "apache-2.0", "hash": 8347184192884904000, "line_mean": 28.2325581395, "line_max": 113, "alpha_frac": 0.625, "autogenerated": false, "ratio": 3.431693989071038, "config_...
__author__ = 'VinnieJohns' from model.group import Group class GroupHelper: # variable for storing list of groups groups_cache = None def __init__(self, app): self.app = app def open_groups_page(self): wd = self.app.wd if not (wd.current_url.endswith("/group.php") and len(wd...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "fixture/group.py", "copies": "1", "size": "3695", "license": "apache-2.0", "hash": 4868656958044630000, "line_mean": 32.2972972973, "line_max": 100, "alpha_frac": 0.5943166441, "autogenerated": false, "ratio": 3.411819021237304, "co...
__author__ = 'VinnieJohns' from sys import maxsize class Contact: def __init__(self, fname=None, midname=None, lname=None, nickname=None, title=None, company=None, address=None, home_tel=None, mobile_tel=None, work_tel=None, fax=None, email=None, email_2=None, email_3=None, homep...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "model/contact.py", "copies": "1", "size": "2130", "license": "apache-2.0", "hash": -5607995282213015000, "line_mean": 41.62, "line_max": 137, "alpha_frac": 0.623943662, "autogenerated": false, "ratio": 3.429951690821256, "config_tes...
__author__ = 'VinnieJohns' import mysql.connector from model.group import Group from model.contact import Contact import re class DbFixture: def __init__(self, host, name, user, password): self.host = host self.name = name self.user = user self.password = password self.con...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "fixture/db.py", "copies": "1", "size": "3281", "license": "apache-2.0", "hash": 3869348454509595600, "line_mean": 43.9589041096, "line_max": 177, "alpha_frac": 0.5574519963, "autogenerated": false, "ratio": 4.035670356703567, "confi...
__author__ = 'VinnieJohns' 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.di...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "conftest.py", "copies": "1", "size": "2473", "license": "apache-2.0", "hash": 8193260037312981000, "line_mean": 29.5308641975, "line_max": 100, "alpha_frac": 0.6716538617, "autogenerated": false, "ratio": 3.691044776119403, "config_...
__author__ = 'VinnieJohns' import re def test_phones_on_home_page(app): contact_from_home_page = app.contact.get_contacts_list()[0] contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0) assert contact_from_home_page.all_phones_from_homepage == merge_phones_like_on_home_page(contact_from_...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "test/test_phones.py", "copies": "1", "size": "1253", "license": "apache-2.0", "hash": 1420637484622089200, "line_mean": 43.7857142857, "line_max": 129, "alpha_frac": 0.6624102155, "autogenerated": false, "ratio": 3.1721518987341772, ...
__author__ = 'VinnieJohns' class SessionHelper: def __init__(self, app): self.app = app def change_field_value(self, field_name, text): wd = self.app.wd if text is not None: wd.find_element_by_name(field_name).click() wd.find_element_by_name(field_name).clear(...
{ "repo_name": "VinnieJohns/barancev_python_training", "path": "fixture/session.py", "copies": "1", "size": "1451", "license": "apache-2.0", "hash": -821486765525905800, "line_mean": 29.25, "line_max": 96, "alpha_frac": 0.5768435562, "autogenerated": false, "ratio": 3.430260047281324, "config_te...
__author__ = 'vipin' from functools import wraps import requests from requests.auth import HTTPBasicAuth from os import getcwd, path as pth from subprocess import Popen, PIPE def log_api_rate_limit(func): """ Decorator to display request rate limits info from response headers :param func: function wh...
{ "repo_name": "vipnambiar/test_github_api", "path": "scripts/test_api.py", "copies": "1", "size": "1938", "license": "mit", "hash": -3755338767145346000, "line_mean": 28.8153846154, "line_max": 92, "alpha_frac": 0.6341589267, "autogenerated": false, "ratio": 3.726923076923077, "config_test": fa...
import tkinter from tkinter import * from tkinter import Tk, scrolledtext, filedialog, messagebox root = Tk(className=" TextEditor-VaibhawLabs") #name your texteditor in quotes textPad = scrolledtext.ScrolledText(root, width=100, height=80) #Defining Menu bar and sub-commands def open_file(): file = filedia...
{ "repo_name": "vaibhawvipul/TextEditor-Python", "path": "TextEditor_VaibhawLabs.py", "copies": "1", "size": "2718", "license": "mit", "hash": -9198054289929137000, "line_mean": 30.9764705882, "line_max": 97, "alpha_frac": 0.700147167, "autogenerated": false, "ratio": 3.016648168701443, "config_...
import numpy as np from . import MinCovDet from ..utils.validation import check_is_fitted, check_array from ..metrics import accuracy_score from ..base import OutlierMixin class EllipticEnvelope(MinCovDet, OutlierMixin): """An object for detecting outliers in a Gaussian distributed dataset. Read more in the...
{ "repo_name": "chrsrds/scikit-learn", "path": "sklearn/covariance/elliptic_envelope.py", "copies": "2", "size": "7417", "license": "bsd-3-clause", "hash": -5527737046481410000, "line_mean": 33.6588785047, "line_max": 78, "alpha_frac": 0.6023998921, "autogenerated": false, "ratio": 4.2675489067894...
import numpy as np from . import MinCovDet from ..utils.validation import check_is_fitted, check_array from ..utils.validation import _deprecate_positional_args from ..metrics import accuracy_score from ..base import OutlierMixin class EllipticEnvelope(OutlierMixin, MinCovDet): """An object for detecting outlier...
{ "repo_name": "huzq/scikit-learn", "path": "sklearn/covariance/_elliptic_envelope.py", "copies": "3", "size": "8067", "license": "bsd-3-clause", "hash": -2816385220872183000, "line_mean": 34.0739130435, "line_max": 79, "alpha_frac": 0.6076608405, "autogenerated": false, "ratio": 4.293241085683874...
import numpy as np from . import MinCovDet from ..utils.validation import check_is_fitted from ..metrics import accuracy_score from ..base import OutlierMixin class EllipticEnvelope(OutlierMixin, MinCovDet): """An object for detecting outliers in a Gaussian distributed dataset. Read more in the :ref:`User G...
{ "repo_name": "kevin-intel/scikit-learn", "path": "sklearn/covariance/_elliptic_envelope.py", "copies": "2", "size": "8336", "license": "bsd-3-clause", "hash": 4007024372102468600, "line_mean": 34.025210084, "line_max": 79, "alpha_frac": 0.6016074856, "autogenerated": false, "ratio": 4.2748717948...
import numpy as np from . import MinCovDet from ..utils.validation import check_is_fitted from ..utils.validation import _deprecate_positional_args from ..metrics import accuracy_score from ..base import OutlierMixin class EllipticEnvelope(OutlierMixin, MinCovDet): """An object for detecting outliers in a Gaussi...
{ "repo_name": "anntzer/scikit-learn", "path": "sklearn/covariance/_elliptic_envelope.py", "copies": "2", "size": "8316", "license": "bsd-3-clause", "hash": -844995554201382700, "line_mean": 34.3872340426, "line_max": 79, "alpha_frac": 0.6041366041, "autogenerated": false, "ratio": 4.2799794132784...
import numpy as np import scipy as sp import warnings from . import MinCovDet from ..utils.validation import check_is_fitted, check_array from ..metrics import accuracy_score from ..base import OutlierMixin class EllipticEnvelope(MinCovDet, OutlierMixin): """An object for detecting outliers in a Gaussian distrib...
{ "repo_name": "BiaDarkia/scikit-learn", "path": "sklearn/covariance/elliptic_envelope.py", "copies": "2", "size": "7621", "license": "bsd-3-clause", "hash": 7518322883330183000, "line_mean": 34.1198156682, "line_max": 79, "alpha_frac": 0.6213095394, "autogenerated": false, "ratio": 4.352370074243...
__author__ = "vishvendra singh" __version__ = 0.1 import sys import os import urllib import basic_functions as bf import dlsub def print_msg(msg): print_head() print "msg: "+msg cli_menu() def cli_menu(): print "1. add folder to watch" print "2. remove folder" print "3. download subtitles"...
{ "repo_name": "darthvish/subtitle_automate", "path": "main.py", "copies": "1", "size": "2833", "license": "mit", "hash": -7874948459626425000, "line_mean": 20.1492537313, "line_max": 90, "alpha_frac": 0.5990116484, "autogenerated": false, "ratio": 3.870218579234973, "config_test": false, "has...
__author__ = 'ViS' import random import math import itertools M = 10 class Individual: def __init__(self, num, val, fitness): self.num = num self.val = val self.fitness = M - fitness class Population: def __init__(self): self.individuals = [] self.fitness_avg = 0 ...
{ "repo_name": "slavik-m/genetic-algorithm", "path": "src/python/genetic_algorithm.py", "copies": "1", "size": "7108", "license": "mit", "hash": -7957650740815945000, "line_mean": 32.214953271, "line_max": 118, "alpha_frac": 0.5495216657, "autogenerated": false, "ratio": 3.9140969162995596, "con...
__author__ = 'Vitalii_Lebedynskyi' import logging import os class UserExpandFileHandler(logging.StreamHandler): """ A handler class which writes formatted logging records to disk files. """ def __init__(self, filename, mode='a', encoding=None, delay=False): """ Open the specified file...
{ "repo_name": "vlebedynskyi/Automator", "path": "tools/handlers.py", "copies": "1", "size": "2012", "license": "apache-2.0", "hash": -8662670393694546000, "line_mean": 31.4677419355, "line_max": 73, "alpha_frac": 0.5780318091, "autogenerated": false, "ratio": 4.657407407407407, "config_test": f...
__author__ = 'Vitalyi' import requests class YandexDnsApi: base_url = 'https://pddimp.yandex.ru/nsapi/' def get_token(self, domain_name): result = requests.get(self.base_url, params={'domain_name':domain_name}) pass def add_a_record(self, domain, content, subdomain=None, ttl=None): ...
{ "repo_name": "tedor/yandex-dns-manager", "path": "vendors/yandex_dns/api.py", "copies": "1", "size": "2134", "license": "bsd-3-clause", "hash": 5587070864063260000, "line_mean": 25.9746835443, "line_max": 112, "alpha_frac": 0.6081651807, "autogenerated": false, "ratio": 3.611864406779661, "con...
__author__ = 'vitorio' from bs4 import BeautifulSoup from wand.image import Image import os import argparse parser = argparse.ArgumentParser(description='Turn an hOCR file and a directory of JPEG2000 images into another directory of PNG images. This assumes an Internet Archive format set of JPEG2000 image names (name...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-hocr2png.py", "copies": "1", "size": "1168", "license": "cc0-1.0", "hash": 79045488633023200, "line_mean": 54.619047619, "line_max": 223, "alpha_frac": 0.6729452055, "autogenerated": false, "ratio": 3.191256830601093, "config_test": false, ...
__author__ = 'vitorio' from bs4 import BeautifulSoup import argparse parser = argparse.ArgumentParser(description='Remove empty text-related markup from an hOCR file ("ocr_line" with no content, "ocr_carea" with no "ocr_line", "ocr_page" with no "ocr_line" or floats)') parser.add_argument('hocrfile', help='The hOCR f...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-hocrremoveempties.py", "copies": "1", "size": "1082", "license": "cc0-1.0", "hash": 6540733223925330000, "line_mean": 42.32, "line_max": 200, "alpha_frac": 0.6395563771, "autogenerated": false, "ratio": 2.9643835616438357, "config_test": fals...
__author__ = 'vitorio' from bs4 import BeautifulSoup import csv import cgi import argparse parser = argparse.ArgumentParser(description='Reconcile an original hOCR file and a list of Mechanical Turk CSVs with corrections.') parser.add_argument('hocrfile', metavar='FILE', help='The unedited hOCR file to read from') pa...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-csv2hocr.py", "copies": "1", "size": "3016", "license": "cc0-1.0", "hash": -548263470305490800, "line_mean": 37.6666666667, "line_max": 148, "alpha_frac": 0.574933687, "autogenerated": false, "ratio": 3.7142857142857144, "config_test": false,...
__author__ = 'vitorio' from bs4 import BeautifulSoup import csv import cgi import argparse parser = argparse.ArgumentParser(description='Turn a corrected hOCR file into a Mechanical Turk CSV output file (Input.URL, Input.PAGE, Input.LINE, Input.OCR, Answer.answer, Answer.transcription).') parser.add_argument('hocrfil...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-hocr2outputcsv.py", "copies": "1", "size": "3497", "license": "cc0-1.0", "hash": -2716472194987142000, "line_mean": 42.7125, "line_max": 198, "alpha_frac": 0.5973691736, "autogenerated": false, "ratio": 3.688818565400844, "config_test": false...
__author__ = 'vitorio' from bs4 import BeautifulSoup import csv import cgi import argparse parser = argparse.ArgumentParser(description='Turn an hOCR file into a Mechanical Turk CSV input file (URL, PAGE, LINE, OCR). This assumes an Internet Archive format set of image names (name_0000.0.png).') parser.add_argument('...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-hocr2csv.py", "copies": "1", "size": "1125", "license": "cc0-1.0", "hash": -1273824746024407600, "line_mean": 45.875, "line_max": 205, "alpha_frac": 0.6311111111, "autogenerated": false, "ratio": 3.4403669724770642, "config_test": false, "h...
__author__ = 'vitorio' from bs4 import BeautifulSoup import os import argparse parser = argparse.ArgumentParser(description='Take an hOCR file and a directory of images and add the image names into the hOCR file. This assumes the directory has the same number of images as the hOCR file has pages, and they are in orde...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-hocraddimages.py", "copies": "1", "size": "2098", "license": "cc0-1.0", "hash": 7564395242763357000, "line_mean": 46.7045454545, "line_max": 243, "alpha_frac": 0.692564347, "autogenerated": false, "ratio": 3.15015015015015, "config_test": fal...
__author__ = 'vitorio' from lxml import etree import os import argparse # from ocropodium ocradmin/nodelib/utils.py # Apache License 2.0 def hocr_from_abbyy(abbyyxml, xsltfile): """ Apply some XSL to transform Abbyy XML to HOCR. """ with open(os.path.join(os.path.dirname(__file__), xsltfile), "r") as ...
{ "repo_name": "vitorio/iaproofread", "path": "iapr04-abbyy2hocr.py", "copies": "1", "size": "1190", "license": "cc0-1.0", "hash": -453155807586322240, "line_mean": 43.1111111111, "line_max": 249, "alpha_frac": 0.6966386555, "autogenerated": false, "ratio": 3.005050505050505, "config_test": fals...
__author__ = 'vitorio' from xml.dom import minidom import os.path import pickle import PythonMagick import jinja2 IA_NAME = 'windinwillows00grah' # IA_NAME = 'artpracticeoftyp00gres' # IA_NAME = 'manualoflinotype00merg' # must already exist OUTPUT_FOLDER = 'iapr' djvuxml = minidom.parse('%s_djvu.xml' % IA_NAME) # ...
{ "repo_name": "vitorio/iaproofread", "path": "iaproofread03.py", "copies": "1", "size": "1899", "license": "cc0-1.0", "hash": 4493866031327866400, "line_mean": 34.1666666667, "line_max": 102, "alpha_frac": 0.6482359136, "autogenerated": false, "ratio": 3.4908088235294117, "config_test": false, ...
__author__ = 'vitorio' from xml.dom import minidom import os.path import pickle #IA_NAME = 'windinwillows00grah' #IA_NAME = 'artpracticeoftyp00gres' #IA_NAME = 'manualoflinotype00merg' IA_NAME = 'glimpsesofworldp00stod' # must already exist OUTPUT_FOLDER = 'iapr' djvuxml = minidom.parse('%s_djvu.xml' % IA_NAME) # ...
{ "repo_name": "vitorio/iaproofread", "path": "iaproofread03-brittlenames.py", "copies": "1", "size": "1315", "license": "cc0-1.0", "hash": 652880839129213400, "line_mean": 32.7179487179, "line_max": 102, "alpha_frac": 0.6653992395, "autogenerated": false, "ratio": 3.230958230958231, "config_tes...
__author__ = 'vitorio' from xml.dom import minidom import os.path import PythonMagick IA_NAME = 'windinwillows00grah' # IA_NAME = 'artpracticeoftyp00gres' # IA_NAME = 'manualoflinotype00merg' djvuxml = minidom.parse('%s_djvu.xml' % IA_NAME) # apparently case-sensitive, is this something I have to account for someho...
{ "repo_name": "vitorio/iaproofread", "path": "iaproofread02.py", "copies": "1", "size": "3245", "license": "cc0-1.0", "hash": 3592362242502495000, "line_mean": 40.6025641026, "line_max": 113, "alpha_frac": 0.5707241911, "autogenerated": false, "ratio": 3.6749716874292186, "config_test": false, ...
__author__ = 'vitorio' import os import djvu.decode def _get_text(sexpr, level=0): txt='' if (isinstance(sexpr, djvu.sexpr.ListExpression) and len(sexpr) !=0): txt = '' for child in sexpr[5:]: txt = txt + _get_text(child, level + 1) return txt else: txt = str(se...
{ "repo_name": "vitorio/iaproofread", "path": "iaproofread01.py", "copies": "1", "size": "2294", "license": "cc0-1.0", "hash": -5415250500534145000, "line_mean": 25.0795454545, "line_max": 75, "alpha_frac": 0.5775937228, "autogenerated": false, "ratio": 3.1685082872928176, "config_test": false, ...
__author__ = 'vitor' from django.conf import settings from django.core.mail import send_mail from collections import defaultdict import string def enviar_email(obj): email_assunto = settings.EMAIL_SUBJECT habilidades = get_usuario_habilidades(obj) if habilidades: for habilidade in h...
{ "repo_name": "vitorh45/avaliacao", "path": "apps/core/utils.py", "copies": "1", "size": "1103", "license": "apache-2.0", "hash": -5702407708198633000, "line_mean": 34.6129032258, "line_max": 93, "alpha_frac": 0.6536718042, "autogenerated": false, "ratio": 3.1695402298850577, "config_test": fal...
__author__ = 'vitor' from django.test import TestCase from django.core.urlresolvers import reverse as r from django.core import mail class AvaliacaoEmailTest(TestCase): def test_receive_front_end_email(self): data = {'nome': 'Vitor Hugo Campos', 'email': 'vitorh45@gmail.com', 'html_c':8, 'css_c':9, 'java...
{ "repo_name": "vitorh45/avaliacao", "path": "apps/core/tests/test_emails.py", "copies": "1", "size": "1453", "license": "apache-2.0", "hash": 5468025899180702000, "line_mean": 44.4375, "line_max": 117, "alpha_frac": 0.6235375086, "autogenerated": false, "ratio": 3.0207900207900207, "config_test...
__author__ = 'vitor' from models import User, UserFavorite, Magazine, Feed, Category import json import requests import memcache from settings import SOLR_URL, CACHES from django.http import HttpResponse # Finds an user by a given email. def user_find_by_email(email): try: user = User.objects.get(email=e...
{ "repo_name": "Infobase/pulsemob_webservices", "path": "pulsemob_webservices/webservices/services.py", "copies": "2", "size": "3432", "license": "bsd-2-clause", "hash": 1842581619119125800, "line_mean": 31.0841121495, "line_max": 223, "alpha_frac": 0.6325757576, "autogenerated": false, "ratio": 3...
__author__ = 'Vivan' from api import Api class Uber(Api): """ Class holding all Uber API calls. Inherits from the base API class. This class is used to provide access to all the API calls which are abstracted as methods. """ def __init__(self, client_id, server_token, secret): """ ...
{ "repo_name": "vivangkumar/uberpy", "path": "uberpy/uber.py", "copies": "1", "size": "4101", "license": "mit", "hash": -6259783032311669000, "line_mean": 39.2156862745, "line_max": 102, "alpha_frac": 0.6337478664, "autogenerated": false, "ratio": 4.404940923737916, "config_test": false, "has_...
__author__ = 'Vivan' import json from httplib2 import Http from urllib.parse import urlencode from errors import ( UnauthorisedException, MalformedRequestException, InvalidRequestException, UnacceptableContentException, NotFoundException, RateLimitException, ServerException, UberpyException ) class Api(obje...
{ "repo_name": "vivangkumar/uberpy", "path": "uberpy/api.py", "copies": "1", "size": "4779", "license": "mit", "hash": -5908086984990954000, "line_mean": 33.6304347826, "line_max": 105, "alpha_frac": 0.6325591128, "autogenerated": false, "ratio": 4.577586206896552, "config_test": false, "has_n...
__author__ = 'Vivan' ''' This file contains a list of all exceptions that can be thrown by the API. ''' class UnauthorisedException(Exception): """ Exception for requests that are being used with out appropriate authorisation. """ def __init__(self, message, http_response): super(Unauthorise...
{ "repo_name": "vivangkumar/uberpy", "path": "uberpy/errors.py", "copies": "1", "size": "2950", "license": "mit", "hash": 1424072482350777000, "line_mean": 23.5916666667, "line_max": 115, "alpha_frac": 0.6383050847, "autogenerated": false, "ratio": 4.4832826747720365, "config_test": false, "ha...
__author__ = "Vivek Balasubramanian <vivek.balasubramanian@rutgers.edu>" __copyright__ = "Copyright 2017, http://radical.rutgers.edu" __license__ = "MIT" class EnTKError(Exception): """EnTKError is the base exception thrown by the Ensemble Toolkit""" def __init__ (self, msg): super(EnTKError, self...
{ "repo_name": "vivek-bala/radical.entk-0.6", "path": "src/radical/entk/exceptions.py", "copies": "2", "size": "3212", "license": "mit", "hash": 4223345816536017400, "line_mean": 31.13, "line_max": 115, "alpha_frac": 0.5747198007, "autogenerated": false, "ratio": 3.9605425400739827, "config_test...
__author__ = "Vivek Balasubramanian <vivek.balasubramanian@rutgers.edu>" __copyright__ = "Copyright 2017, http://radical.rutgers.edu" __license__ = "MIT" # pylint: disable=useless-super-delegation class EnTKError(Exception): """EnTKError is the generic exception type used by EnTK -- exception arg messages are...
{ "repo_name": "radical-cybertools/radical.ensemblemd", "path": "src/radical/entk/exceptions.py", "copies": "1", "size": "2390", "license": "mit", "hash": 5499520869487663000, "line_mean": 30.038961039, "line_max": 102, "alpha_frac": 0.5640167364, "autogenerated": false, "ratio": 4.03035413153457,...
__author__ = 'vivek' import time from fractions import gcd import math #--- In Progress. ---# startTime = time.clock() prime_numbers = [] def isPrime(number) : if number < 0: return 0 elif number == 2 or number == 3 : return 1 elif number % 2 == 0 or number % 3 ==0 or number == 1 : ...
{ "repo_name": "vivekpabani/projecteuler", "path": "python/243/problem_243a.py", "copies": "1", "size": "1485", "license": "apache-2.0", "hash": 994667278765045400, "line_mean": 23.3442622951, "line_max": 72, "alpha_frac": 0.5562289562, "autogenerated": false, "ratio": 3.604368932038835, "config...
__author__ = 'vivek' import time def check_pandigital(number_s): if '0' not in number_s and len(number_s) == 9 and len(number_s) == len(''.join(set(number_s))): return 1 else: return 0 def main(): start_time = time.clock() one_d = [i for i in xrange(1, 10)] two_d = [i for i i...
{ "repo_name": "vivekpabani/projecteuler", "path": "python/038/problem_038.py", "copies": "1", "size": "1201", "license": "apache-2.0", "hash": -9137620281721964000, "line_mean": 26.9534883721, "line_max": 105, "alpha_frac": 0.5120732723, "autogenerated": false, "ratio": 3.025188916876574, "conf...
__author__ = 'vivek' ''' Purpose : This file is executed by each of the compute units in the simulation stage. Uses the arguments to create a bash script which is executed on the remote machine to perform the gromacs simulation. Arguments : --mdp = name of the gromacs parameter f...
{ "repo_name": "radical-cybertools/ExTASY", "path": "examples/grlsd-on-archer/helper_scripts/run.py", "copies": "1", "size": "4047", "license": "mit", "hash": -4253916762966087000, "line_mean": 26.7191780822, "line_max": 85, "alpha_frac": 0.5127254757, "autogenerated": false, "ratio": 3.6263440860...
__author__ = 'vivek' ''' Purpose : This file is used to split the large input coordinate file into smaller coordinate files that can are executed on by each compute unit. It uses the gro.py file to get the specifics of the system in question. Arguments : num_tasks = number of compute units ...
{ "repo_name": "radical-cybertools/ExTASY", "path": "examples/grlsd-adaptive-on-archer/helper_scripts/spliter.py", "copies": "2", "size": "1520", "license": "mit", "hash": 4817268808058966000, "line_mean": 30.6666666667, "line_max": 94, "alpha_frac": 0.5789473684, "autogenerated": false, "ratio": ...
__author__ = 'Vixus' from riotwatcher import RiotWatcher w = RiotWatcher('eda1ed56-6ae8-41bf-97b7-acaa970537dc') # check if we have API calls remaining print(w.can_make_request()) me = w.get_summoner(name='vixus360') print(me) # championList = w.static_get_champion_list() # print championList # print w.get_champion...
{ "repo_name": "Vixus/LoLAPI", "path": "testcode.py", "copies": "1", "size": "2350", "license": "mit", "hash": 2706632983823544000, "line_mean": 29.5324675325, "line_max": 90, "alpha_frac": 0.6493617021, "autogenerated": false, "ratio": 2.997448979591837, "config_test": false, "has_no_keywords...
__author__ = 'vjmor_000' import os import urllib import csv import types from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 from baseRequestHandler import BaseRequestHandler from ndbEntityDefs import Project from ndbEntityDefs import Character from ndbEntityDefs ...
{ "repo_name": "Vjmorrison/ClassroomQuest", "path": "signup.py", "copies": "1", "size": "2412", "license": "mit", "hash": -5118063189830015000, "line_mean": 29.5316455696, "line_max": 83, "alpha_frac": 0.6239635158, "autogenerated": false, "ratio": 4.095076400679117, "config_test": false, "has...
__author__ = 'vjmor_000' import os import urllib import datetime from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 import logging from baseRequestHandler import BaseRequestHandler from ndbEntityDefs import Character from ndbEntityDefs import SubmittedProject fro...
{ "repo_name": "Vjmorrison/ClassroomQuest", "path": "admin.py", "copies": "1", "size": "9349", "license": "mit", "hash": -5034109469323290000, "line_mean": 35.3813229572, "line_max": 196, "alpha_frac": 0.6090490962, "autogenerated": false, "ratio": 4.294441892512632, "config_test": false, "has...
__author__ = 'vjmor_000' import os import urllib from google.appengine.api import users from google.appengine.ext import ndb from ndbEntityDefs import Character import jinja2 import webapp2 from ConfigParser import ConfigParser class BaseRequestHandler(webapp2.RequestHandler): CONFIG_FILE = ConfigParser() ...
{ "repo_name": "Vjmorrison/ClassroomQuest", "path": "baseRequestHandler.py", "copies": "1", "size": "3938", "license": "mit", "hash": -791827840711602700, "line_mean": 33.252173913, "line_max": 118, "alpha_frac": 0.623666836, "autogenerated": false, "ratio": 4.026584867075664, "config_test": tru...
__author__ = 'vjmor_000' import types import csv import math from google.appengine.ext import ndb class Character(ndb.Model): username = ndb.StringProperty() fullName = ndb.StringProperty() xp = ndb.IntegerProperty() level = ndb.IntegerProperty() numProjects = ndb.IntegerProperty() currentPr...
{ "repo_name": "Vjmorrison/ClassroomQuest", "path": "ndbEntityDefs.py", "copies": "1", "size": "9342", "license": "mit", "hash": 6101681498714303000, "line_mean": 30.8839590444, "line_max": 195, "alpha_frac": 0.6256690216, "autogenerated": false, "ratio": 4.042405884898312, "config_test": false,...
__author__ = 'vladimir' from collections import OrderedDict import traceback import ujson from flask import Blueprint, request from . import * from .database import update_query, select_query from .user import get_user_profile, prepare_profiles forum_blueprint = Blueprint("forum", __name__, url_prefix="forum") @...
{ "repo_name": "d3QUone/db_api", "path": "blueprints/forum.py", "copies": "1", "size": "15539", "license": "mit", "hash": -2552295630200011300, "line_mean": 41.5726027397, "line_max": 114, "alpha_frac": 0.4590385482, "autogenerated": false, "ratio": 4.066736456425019, "config_test": false, "ha...
__author__ = 'vladimir' from collections import OrderedDict import traceback import ujson from flask import Blueprint, request from . import * from .database import update_query, select_query user_blueprint = Blueprint("user", __name__, url_prefix="user") # actually this is get_or_create method @user_blueprint.r...
{ "repo_name": "d3QUone/db_api", "path": "blueprints/user.py", "copies": "1", "size": "12667", "license": "mit", "hash": 5942831885124844000, "line_mean": 33.704109589, "line_max": 119, "alpha_frac": 0.5337491119, "autogenerated": false, "ratio": 3.687627365356623, "config_test": false, "has_n...
__author__ = 'vladimir' import pymysql from pymysql import InternalError def get_connection(): return pymysql.connect( host='localhost', user='root', password='', db='forumdb', charset='utf8', cursorclass=pymysql.cursors.DictCursor ) # InternalError: (1205, u...
{ "repo_name": "d3QUone/db_api", "path": "blueprints/database.py", "copies": "1", "size": "1555", "license": "mit", "hash": 7102717014884208000, "line_mean": 27.2727272727, "line_max": 96, "alpha_frac": 0.6231511254, "autogenerated": false, "ratio": 3.756038647342995, "config_test": false, "ha...
__author__ = 'vladimir' import traceback import ujson from flask import Blueprint, request from . import * from .database import update_query, select_query from .user import get_user_profile thread_blueprint = Blueprint("thread_blueprint", __name__, url_prefix="thread") @thread_blueprint.route("/create/", method...
{ "repo_name": "d3QUone/db_api", "path": "blueprints/thread.py", "copies": "1", "size": "17562", "license": "mit", "hash": -6440187867061378000, "line_mean": 32.1984877127, "line_max": 158, "alpha_frac": 0.4973807083, "autogenerated": false, "ratio": 3.639038541234977, "config_test": false, "h...
__author__ = 'vladimir' import traceback import ujson from flask import Blueprint, request from . import * from .database import update_query, select_query post_blueprint = Blueprint("post", __name__, url_prefix="post") @post_blueprint.route("/create/", methods=["POST"]) def create(): try: params = r...
{ "repo_name": "d3QUone/db_api", "path": "blueprints/post.py", "copies": "1", "size": "14886", "license": "mit", "hash": 6964371697894078000, "line_mean": 34.7836538462, "line_max": 216, "alpha_frac": 0.4672175198, "autogenerated": false, "ratio": 3.8887147335423196, "config_test": false, "has...
__author__ = 'vladimir' import ujson from flask import Flask from blueprints.database import update_query, select_query from blueprints.forum import forum_blueprint from blueprints.post import post_blueprint from blueprints.user import user_blueprint from blueprints.thread import thread_blueprint app = Flask("db-ap...
{ "repo_name": "d3QUone/db_api", "path": "app.py", "copies": "1", "size": "1814", "license": "mit", "hash": -2590965052305288700, "line_mean": 29.7457627119, "line_max": 95, "alpha_frac": 0.6168687982, "autogenerated": false, "ratio": 3.3406998158379375, "config_test": false, "has_no_keywords"...
import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_warn...
{ "repo_name": "chaluemwut/fbserver", "path": "venv/lib/python2.7/site-packages/sklearn/linear_model/tests/test_omp.py", "copies": "1", "size": "8244", "license": "apache-2.0", "hash": 5674632861510036000, "line_mean": 36.9907834101, "line_max": 78, "alpha_frac": 0.6263949539, "autogenerated": false...
import sys import pytest import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_allclose from sklearn.utils.testing import if_safe_multiprocessing_with_blas from sklearn.decomposition import SparsePCA, MiniBatchSparsePCA, PCA from sklearn.utils import...
{ "repo_name": "chrsrds/scikit-learn", "path": "sklearn/decomposition/tests/test_sparse_pca.py", "copies": "2", "size": "7777", "license": "bsd-3-clause", "hash": -4439829493386850300, "line_mean": 36.0333333333, "line_max": 79, "alpha_frac": 0.630834512, "autogenerated": false, "ratio": 3.1132906...
import sys import numpy as np from sklearn.decomposition import SparsePCA, MiniBatchSparsePCA from sklearn.utils import check_random_state from sklearn.utils.testing import SkipTest from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.test...
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/scikit-learn-master/sklearn/decomposition/tests/test_sparse_pca.py", "copies": "1", "size": "6027", "license": "mit", "hash": -128105871463702880, "line_mean": 36.4347826087, "line_max": 79, "alpha_frac": 0.6338145014, "autogenerated": f...