text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Charles'
from collections import defaultdict
from warpper import check_files
from model import IMAGE_OUTPUT_MODEL
from datetime import datetime
import logging
import sys
import image
import numpy as np
reload(sys)
sys.setdefaultencoding('utf-8')
logger = logging.getLogger()
logger.setLevel(logging.DEBUG... | {
"repo_name": "CharlesZhong/Mobile-Celluar-Measure",
"path": "http_parser/statistic.py",
"copies": "1",
"size": "15519",
"license": "mit",
"hash": 3112415513610587000,
"line_mean": 39.5221932115,
"line_max": 178,
"alpha_frac": 0.5365036407,
"autogenerated": false,
"ratio": 3.9700690713737528,
"... |
__author__ = 'charles'
from flask import Flask
from flask import render_template
from flask import request
from flask import send_file
import logging
from cards_generator import generate_output_file
#from google.appengine.api.logservice import logservice
#from werkzeug import secure_filename
app = Flask(__name__)
... | {
"repo_name": "xebia-france/agile-cards-generator",
"path": "webapp.py",
"copies": "1",
"size": "1107",
"license": "mit",
"hash": -2916159652181887000,
"line_mean": 27.3846153846,
"line_max": 115,
"alpha_frac": 0.6784101174,
"autogenerated": false,
"ratio": 3.84375,
"config_test": false,
"has... |
__author__ = 'Charles'
from httplib import HTTPResponse
class HTTP_Requset(object):
def __init__(self, header_keys, len_request, len_request_body):
self.user_token, self.user_conf = self.parse_X_QB(header_keys['X-QB'])
self.accept = header_keys['Accept'] if header_keys['Accept'] else '-'
... | {
"repo_name": "CharlesZhong/Mobile-Celluar-Measure",
"path": "http_parser/model.py",
"copies": "1",
"size": "4322",
"license": "mit",
"hash": -4436949113195415000,
"line_mean": 37.5982142857,
"line_max": 104,
"alpha_frac": 0.5340120315,
"autogenerated": false,
"ratio": 3.545529122231337,
"confi... |
__author__ = 'charles'
import argparse
import os
import sys
import re
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def print_bytes(ba, start, end, match_start,... | {
"repo_name": "afrocheese/find_bytes",
"path": "find_bytes.py",
"copies": "1",
"size": "2488",
"license": "apache-2.0",
"hash": 2638892539311944700,
"line_mean": 31.3246753247,
"line_max": 103,
"alpha_frac": 0.5325562701,
"autogenerated": false,
"ratio": 3.445983379501385,
"config_test": false,... |
__author__ = 'Charles'
import os
import copy
from . import macro
class Module(object):
def __init__(self, name, target): self.name = name; self.target = target
def override(self, subcobj=None):
if issubclass(subcobj.__class__, self):
subcobj.compilers = copy.deepcopy(self.compilers)
... | {
"repo_name": "chen-charles/sysbd",
"path": "sysbd/module.py",
"copies": "1",
"size": "2969",
"license": "mit",
"hash": 410617296560472100,
"line_mean": 29.9270833333,
"line_max": 100,
"alpha_frac": 0.4338160997,
"autogenerated": false,
"ratio": 4.385524372230428,
"config_test": false,
"has_n... |
__author__ = 'Charles'
import os
from . import macro
#import macro
class Directory(object):
def __init__(self, name, parentDir, isModule=False):
self.parent = parentDir
self.children = set()
self.parent.add(self)
self.name = name
self.isModule = bool(isModule)
def getPath(self):
return self.parent.ge... | {
"repo_name": "chen-charles/sysbd",
"path": "sysbd/directory.py",
"copies": "1",
"size": "1870",
"license": "mit",
"hash": -4714995162490486000,
"line_mean": 26.1014492754,
"line_max": 107,
"alpha_frac": 0.6989304813,
"autogenerated": false,
"ratio": 2.9588607594936707,
"config_test": false,
... |
__author__ = 'Charles'
try:
import os
import sysbd
import envir
import traceback
import inspect
print("PROJECTPATH:", envir.PROJECTPATH, end="\n\n")
# add dependencies as user-defined macros, then solve them during compile time
# bdr = builder.Builder(mod)
# bdr.build(envir.solve_dependencies)
# for ... | {
"repo_name": "chen-charles/sysbd",
"path": "build.py",
"copies": "1",
"size": "1870",
"license": "mit",
"hash": -5153221422475887000,
"line_mean": 32.3928571429,
"line_max": 188,
"alpha_frac": 0.6903743316,
"autogenerated": false,
"ratio": 3.040650406504065,
"config_test": false,
"has_no_key... |
__author__ = 'Charlie'
# Attempt at Mahendran and Vedaldi's Understanding Deep Image Representations by Inverting them
import numpy as np
import tensorflow as tf
import scipy.io
import scipy.misc
from datetime import datetime
import os, sys, inspect
utils_path = os.path.abspath(
os.path.realpath(os.path.join(os.p... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "ImageArt/ImageInversion.py",
"copies": "1",
"size": "4731",
"license": "mit",
"hash": 5583885898626082000,
"line_mean": 34.0444444444,
"line_max": 112,
"alpha_frac": 0.6081166772,
"autogenerated": false,
"ratio": 3.1666666666666665,
"config_... |
__author__ = 'Charlie'
# Implementation based on neural style paper
import numpy as np
import tensorflow as tf
import scipy.io
import scipy.misc
from datetime import datetime
import os, sys, inspect
utils_path = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], ... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "ImageArt/NeuralStyle.py",
"copies": "1",
"size": "6289",
"license": "mit",
"hash": -2803190280620934700,
"line_mean": 35.3526011561,
"line_max": 125,
"alpha_frac": 0.5905549372,
"autogenerated": false,
"ratio": 3.1940071102082275,
"config_te... |
__author__ = 'Charlie'
# Implementation draws details from https://github.com/hardmaru/cppn-tensorflow
import numpy as np
import tensorflow as tf
import os, sys, inspect
# import scipy.misc as misc
import matplotlib.pyplot as plt
utils_folder = os.path.abspath(
os.path.realpath(os.path.join(os.path.split(inspect.g... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "GenerativeNetworks/SimpleCPPN.py",
"copies": "1",
"size": "4415",
"license": "mit",
"hash": -1713713630714220300,
"line_mean": 35.4876033058,
"line_max": 117,
"alpha_frac": 0.6201585504,
"autogenerated": false,
"ratio": 2.9007884362680683,
"... |
__author__ = 'Charlie'
# Implementation to deep dream with VGG net
import tensorflow as tf
import numpy as np
import scipy.io
import scipy.misc
from datetime import datetime
import os, sys, inspect
utils_path = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "ImageArt/DeepDream.py",
"copies": "1",
"size": "6231",
"license": "mit",
"hash": -3418248685045084700,
"line_mean": 35.0173410405,
"line_max": 114,
"alpha_frac": 0.5856202857,
"autogenerated": false,
"ratio": 3.1030876494023905,
"config_test... |
__author__ = 'charlie'
import numpy as np
import os
import random
from six.moves import cPickle as pickle
from tensorflow.python.platform import gfile
import glob
import TensorflowUtils as utils
DATA_URL = 'http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip'
def read_dataset(data_dir):
pickl... | {
"repo_name": "DeepSegment/FCN-GoogLeNet",
"path": "read_MITSceneParsingData.py",
"copies": "1",
"size": "2629",
"license": "mit",
"hash": 5069208943157499000,
"line_mean": 36.0281690141,
"line_max": 112,
"alpha_frac": 0.6135412704,
"autogenerated": false,
"ratio": 3.8435672514619883,
"config_t... |
__author__ = 'charlie'
import numpy as np
import os
import random
from six.moves import cPickle as pickle
from tensorflow.python.platform import gfile
import glob
import TensorflowUtils as utils
# DATA_URL = 'http://sceneparsing.csail.mit.edu/data/ADEChallengeData2016.zip'
DATA_URL = 'http://data.csail.mit.edu/places... | {
"repo_name": "shekkizh/FCN.tensorflow",
"path": "read_MITSceneParsingData.py",
"copies": "2",
"size": "2416",
"license": "mit",
"hash": 3316867346930717000,
"line_mean": 35.6060606061,
"line_max": 102,
"alpha_frac": 0.6225165563,
"autogenerated": false,
"ratio": 3.751552795031056,
"config_test... |
__author__ = 'charlie'
import numpy as np
import os, sys, inspect
import random
from six.moves import cPickle as pickle
from tensorflow.python.platform import gfile
import glob
utils_path = os.path.abspath(
os.path.realpath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if utils_pa... | {
"repo_name": "BerenLuthien/HyperColumns_ImageColorization",
"path": "read_FlowersDataset.py",
"copies": "1",
"size": "3558",
"license": "bsd-3-clause",
"hash": -1541117904404964400,
"line_mean": 36.8510638298,
"line_max": 129,
"alpha_frac": 0.6385609893,
"autogenerated": false,
"ratio": 3.619532... |
__author__ = 'Charlie'
import numpy as np
import tensorflow as tf
import os, sys, inspect
import scipy.io
import scipy.misc as misc
from datetime import datetime
utils_folder = os.path.abspath(
os.path.realpath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if utils_folder not in s... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "GenerativeNetworks/ImageAnalogy.py",
"copies": "1",
"size": "9032",
"license": "mit",
"hash": 8847596187631892000,
"line_mean": 42.4230769231,
"line_max": 116,
"alpha_frac": 0.6335252436,
"autogenerated": false,
"ratio": 2.8251485767907414,
... |
__author__ = 'Charlie'
import numpy as np
import tensorflow as tf
import scipy.misc as misc
import os, sys, argparse, inspect
import random
utils_path = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if utils_path not in sys.path:
sys.path.insert(0,... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "ImageArt/NeuralArtist.py",
"copies": "1",
"size": "7166",
"license": "mit",
"hash": 3885256271954654000,
"line_mean": 39.0335195531,
"line_max": 134,
"alpha_frac": 0.5979626012,
"autogenerated": false,
"ratio": 3.14989010989011,
"config_test... |
__author__ = 'Charlie'
import os, sys
import tarfile
import tensorflow as tf
from tensorflow.python.platform import gfile
from six.moves import urllib
import numpy as np
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('model_dir', 'Models_zoo/imagenet',
"""Path to classify_image_graph_... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "Misc/FindInceptionSimilarity.py",
"copies": "1",
"size": "3836",
"license": "mit",
"hash": 8449568167106041000,
"line_mean": 37.7474747475,
"line_max": 126,
"alpha_frac": 0.6504171011,
"autogenerated": false,
"ratio": 3.2316764953664703,
"co... |
__author__ = 'Charlie'
import pandas as pd
import numpy as np
import os, sys, inspect
from six.moves import cPickle as pickle
import scipy.misc as misc
IMAGE_SIZE = 96
NUM_LABELS = 30
VALIDATION_PERCENT = 0.1 # use 10 percent of training images for validation
IMAGE_LOCATION_NORM = IMAGE_SIZE / 2
np.random.seed(0)
... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "FaceDetection/FaceDetectionDataUtils.py",
"copies": "1",
"size": "4210",
"license": "mit",
"hash": -5156132960241312000,
"line_mean": 39.0952380952,
"line_max": 100,
"alpha_frac": 0.6137767221,
"autogenerated": false,
"ratio": 3.46217105263157... |
__author__ = 'Charlie'
import tensorflow as tf
import os, sys, inspect
import numpy as np
import tensorflow.examples.tutorials.mnist as mnist
# import matplotlib.pyplot as plt
# from mpl_toolkits.mplot3d import Axes3D
utils_folder = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspe... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "Unsupervised_learning/MNISTAutoEncoder.py",
"copies": "1",
"size": "6987",
"license": "mit",
"hash": -8601272841587165000,
"line_mean": 41.8650306748,
"line_max": 111,
"alpha_frac": 0.6142836697,
"autogenerated": false,
"ratio": 2.877677100494... |
__author__ = 'Charlie'
# Layer visualization based on deep dream code in tensorflow for VGG net
import tensorflow as tf
import numpy as np
import scipy.io
import scipy.misc
from datetime import datetime
import os, sys, inspect
utils_path = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfi... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "ImageArt/LayerVisualization.py",
"copies": "1",
"size": "6296",
"license": "mit",
"hash": 7650208080421785000,
"line_mean": 36.0352941176,
"line_max": 112,
"alpha_frac": 0.5967280813,
"autogenerated": false,
"ratio": 3.1276701440635866,
"con... |
__author__ = "charlie"
import numpy as np
import tensorflow as tf
import os, sys, inspect
from datetime import datetime
utils_path = os.path.abspath(
os.path.realpath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if utils_path not in sys.path:
sys.path.insert(0, utils_path)
... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "ContextEncoder/ContextInpainting.py",
"copies": "1",
"size": "10794",
"license": "mit",
"hash": -6370957698208667000,
"line_mean": 45.7272727273,
"line_max": 115,
"alpha_frac": 0.6081156198,
"autogenerated": false,
"ratio": 3.085763293310463,
... |
__author__ = 'Charlie'
import random
import os, sys
import tensorflow as tf
from datetime import datetime
import numpy as np
from six.moves import urllib
import tarfile
import csv
import hashlib
from tensorflow.python.client import graph_util
from tensorflow.python.framework import tensor_shape
from tensorflow.python... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "Misc/YelpRestaurantClassification2.py",
"copies": "1",
"size": "11897",
"license": "mit",
"hash": 4436966991620708400,
"line_mean": 38.1348684211,
"line_max": 121,
"alpha_frac": 0.6482306464,
"autogenerated": false,
"ratio": 3.4484057971014495... |
__author__ = 'Charlie'
import tensorflow as tf
import os, sys
from six.moves import urllib
import tarfile
import time
from datetime import datetime
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('batch_size', 128,
"""Number of images to process in a batch.""")
tf.app.flags.DEFINE_... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "Misc/Deblurring.py",
"copies": "1",
"size": "10291",
"license": "mit",
"hash": -6244239061862444,
"line_mean": 38.1292775665,
"line_max": 119,
"alpha_frac": 0.6141288505,
"autogenerated": false,
"ratio": 3.5461750516884907,
"config_test": fa... |
__author__ = 'Charlie'
# Placeholder for implementation of justins generative neural style
import tensorflow as tf
import numpy as np
import scipy.io
import scipy.misc
from datetime import datetime
import os, sys, inspect
utils_path = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(i... | {
"repo_name": "shekkizh/TensorflowProjects",
"path": "GenerativeNetworks/GenerativeNeuralStyle.py",
"copies": "1",
"size": "12757",
"license": "mit",
"hash": -117780039498001390,
"line_mean": 37.6575757576,
"line_max": 121,
"alpha_frac": 0.6080583209,
"autogenerated": false,
"ratio": 3.2230924709... |
__author__ = 'Charlie'
# Utils used with tensorflow implemetation
import tensorflow as tf
import numpy as np
import os, sys
from six.moves import urllib
import tarfile
import zipfile
from skimage import io, color
import scipy.io
def maybe_download_and_extract(dir_path, url_name, is_tarfile=False, is_zipfile=False):
... | {
"repo_name": "BerenLuthien/HyperColumns_ImageColorization",
"path": "TensorflowUtils.py",
"copies": "1",
"size": "11368",
"license": "bsd-3-clause",
"hash": 6939041719194776000,
"line_mean": 35.5530546624,
"line_max": 115,
"alpha_frac": 0.6031843772,
"autogenerated": false,
"ratio": 3.2452183842... |
__author__ = 'Charlie'
# Utils used with tensorflow implemetation
import tensorflow as tf
import numpy as np
import scipy.misc as misc
import os, sys
from six.moves import urllib
import tarfile
import zipfile
import scipy.io
def get_model_data(dir_path, model_url):
maybe_download_and_extract(dir_path, model_url)
... | {
"repo_name": "PetroWu/AutoPortraitMatting",
"path": "TensorflowUtils_plus.py",
"copies": "1",
"size": "8879",
"license": "apache-2.0",
"hash": 1369384595148125000,
"line_mean": 35.093495935,
"line_max": 120,
"alpha_frac": 0.6029958329,
"autogenerated": false,
"ratio": 3.1722043586995357,
"conf... |
__author__ = 'charm ship jo'
import pygame
pygame.init()
class Window:
def __init__(self,caption,size,flags=0,depth=0,fps=30):
self.fps = fps
self.screen = pygame.display.set_mode(size,flags,depth)
pygame.display.set_caption(caption)
self.clock = pygame.time.Clock()
self.Window_Open ... | {
"repo_name": "saintdragon2/python-3-lecture-2015",
"path": "civil-final/1st_presentation/9조/10.py",
"copies": "1",
"size": "3580",
"license": "mit",
"hash": 4634117050519224000,
"line_mean": 28.1056910569,
"line_max": 81,
"alpha_frac": 0.6005586592,
"autogenerated": false,
"ratio": 3.29650092081... |
__author__ = "Chase Roberts"
__maintainers__ = ["Chase Roberts"]
import json
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth import authenticate
from deck.views import *
from deck.models import *
class DeckTest(TestCase):
def setUp(self):
self.requ... | {
"repo_name": "gavinmcgimpsey/deckofcards",
"path": "deck/tests.py",
"copies": "2",
"size": "5594",
"license": "mit",
"hash": -1257555009063426800,
"line_mean": 40.1323529412,
"line_max": 90,
"alpha_frac": 0.6022524133,
"autogenerated": false,
"ratio": 3.852617079889807,
"config_test": true,
... |
__author__ = ['Chatziargyriou Eleftheria <ele.hatzy@gmail.com>']
__license__ = 'MIT License'
import re
from cltk.stem.middle_english.stem import affix_stemmer
"""
The hyphenation/syllabification algorithm is based on the typical syllable
structure model of onset/nucleus/coda. An additional problem arises with the
di... | {
"repo_name": "LBenzahia/cltk",
"path": "cltk/phonology/middle_english/transcription.py",
"copies": "1",
"size": "10342",
"license": "mit",
"hash": -3009798491542365000,
"line_mean": 29.649851632,
"line_max": 109,
"alpha_frac": 0.5199922548,
"autogenerated": false,
"ratio": 3.5373287671232876,
... |
__author__ = 'Chaya D. Stern'
from pymol import stored, cmd
import os
import errno
def torsion_drive(atom1, atom2, atom3, atom4, interval, selection, path, mol_name,):
"""
This function generates input pdbs of dihedral angles selected of intervals specified with interval
:param atom1: name of atom 1 of d... | {
"repo_name": "ChayaSt/torsionfit",
"path": "torsionfit/qmscan/generate_dihedral.py",
"copies": "4",
"size": "1411",
"license": "mit",
"hash": -833706337376347400,
"line_mean": 36.1578947368,
"line_max": 103,
"alpha_frac": 0.6371367824,
"autogenerated": false,
"ratio": 3.6744791666666665,
"conf... |
__author__ = 'Chaya D. Stern'
import numpy as np
import logging
import sys
verbose = False
def RMSE(scanSet, db):
'''
:param model: TorsionScanSet
:param db: pymc database
:return: numpy array of rmse
'''
N = len(scanSet.qm_energy)
errors = np.zeros(len(db.trace('mm_energy')[:]))
fo... | {
"repo_name": "ChayaSt/torsionfit",
"path": "torsionfit/utils.py",
"copies": "4",
"size": "1415",
"license": "mit",
"hash": -2497664416041538000,
"line_mean": 26.7450980392,
"line_max": 88,
"alpha_frac": 0.6508833922,
"autogenerated": false,
"ratio": 3.723684210526316,
"config_test": false,
"... |
__author__ = 'Chaya D. Stern'
import pandas as pd
import numpy as np
from simtk.unit import Quantity, nanometers, kilojoules_per_mole
from cclib.parser import Gaussian, Psi
from cclib.parser.utils import convertor
import mdtraj as md
from parmed.charmm import CharmmPsfFile, CharmmParameterSet
import parmed
from tor... | {
"repo_name": "ChayaSt/torsionfit",
"path": "torsionfit/database/qmdatabase.py",
"copies": "4",
"size": "27227",
"license": "mit",
"hash": -3142209354035950600,
"line_mean": 36.4010989011,
"line_max": 128,
"alpha_frac": 0.5479487274,
"autogenerated": false,
"ratio": 3.927726485862666,
"config_t... |
import sys
import os
import subprocess
class ADB:
PYADB_VERSION = "0.1.4"
_output = None
_error = None
_return = 0
_devices = None
_target = None
# reboot modes
REBOOT_RECOVERY = 1
REBOOT_BOOTLOADER = 2
# default TCP/IP port
DEFAULT_TCP_PORT = 55... | {
"repo_name": "casschin/pyadb",
"path": "pyadb/adb.py",
"copies": "1",
"size": "13746",
"license": "bsd-2-clause",
"hash": 3745135573042152400,
"line_mean": 25.3824701195,
"line_max": 101,
"alpha_frac": 0.4898879674,
"autogenerated": false,
"ratio": 4.425627817128139,
"config_test": false,
"h... |
try:
import sys
import os
import subprocess
except ImportError,e:
# should never be reached
print "[f] Required module missing. %s" % e.args[0]
sys.exit(-1)
class ADB():
PYADB_VERSION = "0.1.4"
__adb_path = None
__output = None
__error = None
__return =... | {
"repo_name": "ohyeah521/pyadb",
"path": "pyadb/adb.py",
"copies": "1",
"size": "13863",
"license": "bsd-2-clause",
"hash": -1161467678908281000,
"line_mean": 25.505952381,
"line_max": 101,
"alpha_frac": 0.4823631249,
"autogenerated": false,
"ratio": 4.441845562319769,
"config_test": false,
"... |
import logging
import sys
import textwrap
import time
from logging.handlers import RotatingFileHandler
from bson.json_util import DEFAULT_JSON_OPTIONS
from pymongo import MongoClient, errors
from bson import json_util
from datetime import datetime
from elasticsearch import Elasticsearch
from pymongo.errors import Cur... | {
"repo_name": "yeti-platform/yeti",
"path": "extras/yeti_to_elasticsearch.py",
"copies": "1",
"size": "14495",
"license": "apache-2.0",
"hash": 6410166187659785000,
"line_mean": 35.1471321696,
"line_max": 129,
"alpha_frac": 0.5373577096,
"autogenerated": false,
"ratio": 4.771231073074391,
"conf... |
__author__ = 'Cheng'
from django.conf.urls import patterns, url
import views
urlpatterns = patterns('',
# /pledges/
url(r'^$', views.index, name='index'),
url(r'^reward/list/$', views.list_rewards, name='list_rewards'),
url(r... | {
"repo_name": "TejasM/wisely",
"path": "wisely_project/pledges/urls.py",
"copies": "1",
"size": "1256",
"license": "mit",
"hash": 7544688192623138000,
"line_mean": 53.6086956522,
"line_max": 94,
"alpha_frac": 0.4673566879,
"autogenerated": false,
"ratio": 3.817629179331307,
"config_test": false... |
__author__ = 'chengxue'
from taskflow import task
from utils.db_handlers import tenants as db_handler
from utils.helper import *
from keystoneclient import exceptions as keystone_exceptions
LOG = logging.getLogger(__name__)
class UpdateProjectsQuotasTask(task.Task):
"""
Task to update quotas for all migrate... | {
"repo_name": "Phoenix1708/OpenAcademy_OpenStack_Flyway",
"path": "flyway/flow/update_projects_quotas_task.py",
"copies": "1",
"size": "4048",
"license": "apache-2.0",
"hash": -6279432761373879000,
"line_mean": 39.898989899,
"line_max": 78,
"alpha_frac": 0.5007411067,
"autogenerated": false,
"rat... |
__author__ = 'chengxue'
from utils.db_base import *
from collections import OrderedDict
def initialise_keypairs_mapping():
"""function to create the keypairs table
which is used to record keypairs that has
been migrated
"""
table_name = "keypairs"
columns = '''id INT NOT NULL AUTO_INCREMENT,... | {
"repo_name": "Phoenix1708/OpenAcademy_OpenStack_Flyway",
"path": "flyway/utils/db_handlers/keypairs.py",
"copies": "1",
"size": "3972",
"license": "apache-2.0",
"hash": -1268473912583028700,
"line_mean": 31.0403225806,
"line_max": 78,
"alpha_frac": 0.5813192346,
"autogenerated": false,
"ratio": ... |
__author__ = 'Chengyu'
from user_manage.models import User
from user_manage.models import Friendship
from colock.Error import *
from colock import utils, settings
import os
from colock.key_generator import phone_hash_gen
import base64
import message.igt_wrappers as igt
@utils.hook()
def get_friend_list(meta, data, i... | {
"repo_name": "FXuZ/colock-server",
"path": "user_manage/friendship.py",
"copies": "1",
"size": "7825",
"license": "apache-2.0",
"hash": -5922503241595774000,
"line_mean": 31.6041666667,
"line_max": 112,
"alpha_frac": 0.6014057508,
"autogenerated": false,
"ratio": 3.334043459735833,
"config_tes... |
__author__ = 'chenkovsky'
from ctypes import *
import os
from . import arpa
libngram = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/../libngram.so')
libngram.NgramBuilder_init.restype = POINTER(c_byte)
libngram.Ngram_init_from_bin.restype = POINTER(c_byte)
libngram.Ngram_init_from_bin.argtypes = [... | {
"repo_name": "chenkovsky/pyngram",
"path": "pyngram/__init__.py",
"copies": "1",
"size": "2379",
"license": "mit",
"hash": -53508232823783760,
"line_mean": 33.9852941176,
"line_max": 100,
"alpha_frac": 0.5968894493,
"autogenerated": false,
"ratio": 2.8187203791469195,
"config_test": false,
"... |
__author__ = 'chenkovsky'
from rex import rex
import sys
def arpa(fp, gram=None, header_start = None, header_end = None, section_start = None, section_end = None, file_end = None):
section = None
lm_info = {}
max_gram = 0
for l in fp:
#print(l)
if l.startswith("\\"):
if l == ... | {
"repo_name": "chenkovsky/pyngram",
"path": "pyngram/arpa.py",
"copies": "1",
"size": "1969",
"license": "mit",
"hash": -835003712792065400,
"line_mean": 36.8846153846,
"line_max": 123,
"alpha_frac": 0.4393092941,
"autogenerated": false,
"ratio": 3.868369351669941,
"config_test": false,
"has_... |
__author__ = 'chenkovsky'
import pandas as pd
import numpy as np
from sklearn.neighbors import KDTree
import time
class UserBasedKNNRecommender:
"""
class for user based knn recommender.
when doing recommendation, it first select neighbors,
and calculate the similarity between neighbors and current use... | {
"repo_name": "chenkovsky/recpy",
"path": "knn.py",
"copies": "1",
"size": "11367",
"license": "mit",
"hash": -6707025606095105000,
"line_mean": 44.6506024096,
"line_max": 128,
"alpha_frac": 0.5398961907,
"autogenerated": false,
"ratio": 3.464492532764401,
"config_test": false,
"has_no_keywor... |
__author__ = 'chenshuai'
cast = ["Cleese", "Plain", "Jones", "Idle"]
print cast
print len(cast)
print cast[1]
cast.append("Gilliam")
print cast
cast.pop()
print cast
cast.extend(["Gilliam", "Chapman"])
print cast
cast.remove("Chapman")
print cast
cast.insert(0, "Chapman")
print cast
movies = ["The Holy Grail", "The L... | {
"repo_name": "feng345fengcool/hellojava",
"path": "src/main/resources/basic.py",
"copies": "1",
"size": "5434",
"license": "apache-2.0",
"hash": 7160944304162383000,
"line_mean": 23.4774774775,
"line_max": 99,
"alpha_frac": 0.5894368789,
"autogenerated": false,
"ratio": 3.24031007751938,
"conf... |
__author__ = 'chenzhao'
from base import *
from flask.ext.security import Security, SQLAlchemyUserDatastore, UserMixin, RoleMixin
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired)
from gmission.config impor... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/models/user.py",
"copies": "1",
"size": "3166",
"license": "mit",
"hash": -7097410278279076000,
"line_mean": 37.6097560976,
"line_max": 105,
"alpha_frac": 0.6430827543,
"autogenerated": false,
"ratio": 3.702923976608187,
"confi... |
__author__ = 'CHEN Zhao'
import json_encoder
import log
import sys
import socket
import os.path
APP_SECRET_KEY = 'gMissionForHKUSTSecretKey'
APP_AUTH_HEADER_PREFIX = 'gMission'
def stdout(*lst):
print '[' + ' '.join(sys.argv) + ']' + ' '.join(map(str, lst))
sys.stdout.flush()
def config(app, root):
con... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/config/__init__.py",
"copies": "1",
"size": "2911",
"license": "mit",
"hash": -5404358308857559000,
"line_mean": 31.7078651685,
"line_max": 107,
"alpha_frac": 0.6698728959,
"autogenerated": false,
"ratio": 2.9256281407035174,
"... |
__author__ = 'chenzhao'
import logging
import os.path
import os
from logging.handlers import RotatingFileHandler
def set_logger(app):
logs_path = app.config['GMISSION_LOGS_DIR']
if not os.path.exists(logs_path):
os.mkdir(logs_path)
set_flask_logger(app, logs_path)
set_profiling_logger(app, lo... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/config/log.py",
"copies": "1",
"size": "2226",
"license": "mit",
"hash": 4957775791757541000,
"line_mean": 30.3521126761,
"line_max": 97,
"alpha_frac": 0.725965858,
"autogenerated": false,
"ratio": 3.4565217391304346,
"config_t... |
__author__ = 'chenzhao'
from base import *
# type = text / image / selection
class HIT(db.Model, BasicModelMixin):
__tablename__ = 'hit'
id = db.Column(db.Integer, primary_key=True)
type = db.Column(db.String(20))
title = db.Column(db.String(500))
description = db.Column(db.TEXT)
attachment_... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/models/crowdsourcing.py",
"copies": "1",
"size": "2810",
"license": "mit",
"hash": -6033324008222323000,
"line_mean": 36.4666666667,
"line_max": 107,
"alpha_frac": 0.6797153025,
"autogenerated": false,
"ratio": 3.361244019138756,... |
__author__ = 'chenzhao'
import datetime
import re
import hashlib
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.orm import backref
db = SQLAlchemy()
GEO_NUMBER_TYPE = db.REAL()
#python any is stupid
def good_any(l):
for i in l:
if i:
... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/models/base.py",
"copies": "1",
"size": "1545",
"license": "mit",
"hash": -3849444209082241000,
"line_mean": 23.5238095238,
"line_max": 87,
"alpha_frac": 0.6006472492,
"autogenerated": false,
"ratio": 3.6098130841121496,
"confi... |
__author__ = 'chenzhao'
import inspect
from flask.ext import restless
from gmission.models import *
from .base import ReSTBase
from gmission.flask_app import db, app
REST_PREFIX = '/rest'
class ReSTManager(object):
rest_models = []
@classmethod
def rest_url_get_single(cls, model_obj):
return '%... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/rest/manager.py",
"copies": "1",
"size": "1746",
"license": "mit",
"hash": 5364546028743731000,
"line_mean": 44.9473684211,
"line_max": 112,
"alpha_frac": 0.5171821306,
"autogenerated": false,
"ratio": 4.523316062176166,
"confi... |
__author__ = 'CHEN Zhao'
import os
import random
from gmission.flask_app import app
from flask import Blueprint, jsonify, request, redirect, url_for, send_from_directory
from werkzeug.utils import secure_filename
from PIL import Image
image_blueprint = Blueprint('image', __name__, template_folder='templates')
AL... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/blueprints/image.py",
"copies": "1",
"size": "2005",
"license": "mit",
"hash": -9137040077026091000,
"line_mean": 29.3787878788,
"line_max": 86,
"alpha_frac": 0.6698254364,
"autogenerated": false,
"ratio": 3.4391080617495713,
"... |
__author__ = 'CHEN Zhao'
import os
import subprocess
import random
from gmission.flask_app import app
from flask import Blueprint, jsonify, request, redirect, url_for, send_from_directory
from werkzeug.utils import secure_filename
audio_blueprint = Blueprint('audio', __name__, template_folder='templates')
UPLOAD_... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/blueprints/audio.py",
"copies": "1",
"size": "1113",
"license": "mit",
"hash": -2031719833654991400,
"line_mean": 27.5384615385,
"line_max": 86,
"alpha_frac": 0.6945193172,
"autogenerated": false,
"ratio": 3.6254071661237783,
"... |
__author__ = 'CHEN Zhao'
import time
import admin
import blueprints
from flask_app import app, cache
import rest
from flask import render_template, request, redirect, jsonify, g
from models import *
import json
app.register_blueprint(blueprints.user_bp, url_prefix='/user')
app.register_blueprint(blueprints.image_bp... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/gmission/views.py",
"copies": "1",
"size": "2574",
"license": "mit",
"hash": 2358753885647399400,
"line_mean": 28.5862068966,
"line_max": 96,
"alpha_frac": 0.6767676768,
"autogenerated": false,
"ratio": 3.266497461928934,
"config_test":... |
__author__ = 'chenzhao'
######################################
# DO NOT RENAME THIS FILE TO email.py
######################################
# Import smtplib for the actual sending function
import smtplib
# Import the email modules we'll need
from email.mime.text import MIMEText
gmail_user, gmail_password = 'gmiss... | {
"repo_name": "gmission/gmission",
"path": "services/cron_jobs/gmail.py",
"copies": "1",
"size": "1063",
"license": "mit",
"hash": -6336540074524997000,
"line_mean": 21.1666666667,
"line_max": 75,
"alpha_frac": 0.619943556,
"autogenerated": false,
"ratio": 3.6655172413793102,
"config_test": fal... |
__author__ = 'chenzhao'
from flask import request, render_template, redirect, flash, url_for, g, jsonify, send_from_directory
from werkzeug.utils import secure_filename
import random
from models import *
from barrage.flask_app import app
UPLOAD_DIR = app.config['BB_IMAGE_UPLOAD_DIR']
URL_PREFIX = '/bb'
@app.be... | {
"repo_name": "chenzhao/barrage-server",
"path": "barrage/views.py",
"copies": "1",
"size": "2178",
"license": "mit",
"hash": 4439304593953986000,
"line_mean": 24.6235294118,
"line_max": 114,
"alpha_frac": 0.6533516988,
"autogenerated": false,
"ratio": 3.1069900142653353,
"config_test": false,
... |
__author__ = 'chenzhao'
import datetime
import re
import os
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import and_
db = SQLAlchemy()
def get_or_create(model, commit=False, **kwargs):
instance = db.session.query(model).filter_by(**kwargs).first()
if instance:
instance._existed = Tru... | {
"repo_name": "chenzhao/barrage-server",
"path": "barrage/models.py",
"copies": "1",
"size": "1590",
"license": "mit",
"hash": 2479510869770718000,
"line_mean": 28.4444444444,
"line_max": 104,
"alpha_frac": 0.6553459119,
"autogenerated": false,
"ratio": 3.2919254658385095,
"config_test": false,... |
__author__ = 'chenzhao'
import inspect
import os
import os.path
import shutil
from gmission.models import *
def columns(cls):
for cln in cls.__mapper__.columns:
yield cln
def all_models():
for cls in globals().values():
if inspect.isclass(cls) and issubclass(cls, db.Model):
yie... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/model_translate.py",
"copies": "1",
"size": "1322",
"license": "mit",
"hash": 5567613565314658000,
"line_mean": 20.6721311475,
"line_max": 67,
"alpha_frac": 0.5491679274,
"autogenerated": false,
"ratio": 3.3638676844783717,
"config_test... |
__author__ = 'chenzhao'
import time
import random
import datetime
from unit_test import *
#
# SIM_USER_IDS = range(1000000)
# BULK_SIZE = 10000
#
#
# def create_sim_users():
# existing_sim_user_ids = set([int(u[0][3:]) for u in db.session.query(User.name).filter(User.name.like('sim%')).all()])
#
# l = SIM_US... | {
"repo_name": "gmission/gmission",
"path": "hkust-gmission/test/sim.py",
"copies": "1",
"size": "2735",
"license": "mit",
"hash": 6982675749097573000,
"line_mean": 30.0795454545,
"line_max": 124,
"alpha_frac": 0.5616087751,
"autogenerated": false,
"ratio": 3.1436781609195403,
"config_test": fal... |
__author__ = 'chenzheng'
__author__ = 'chenzheng'
import os
import subprocess
import argparse
pjoin = os.path.join
N2TEMPLATE ="""
memory total 1000 mb
geometry units angstroms
N 0 0 0
N 0 0 1.1
end
title "N2 dft optimize"
charge 0
basis
N library "{Polarfunc_1st}"
end
dft
mult 1
xc {functional_1st}
end
task ... | {
"repo_name": "czhengsci/nano266",
"path": "Chen_Script/N2_Temp_Gen.py",
"copies": "1",
"size": "1182",
"license": "bsd-3-clause",
"hash": 4243657201282108000,
"line_mean": 15.6478873239,
"line_max": 80,
"alpha_frac": 0.6759729272,
"autogenerated": false,
"ratio": 2.7746478873239435,
"config_te... |
__author__ = 'chenzheng'
import os
import subprocess
import argparse
pjoin = os.path.join
H2TEMPLATE ="""
memory total 1000 mb
geometry units angstroms
H 0 0 0
H 0 0 0.7414
end
title "H2 dft optimize"
charge 0
basis
H library "{Polarfunc_1st}"
end
dft
mult 1
xc {functional_1st}
end
task dft optimize
title "H... | {
"repo_name": "czhengsci/nano266",
"path": "Chen_Script/H2_Temp_Gen.py",
"copies": "1",
"size": "1157",
"license": "bsd-3-clause",
"hash": 997985094538085600,
"line_mean": 15.7826086957,
"line_max": 80,
"alpha_frac": 0.680207433,
"autogenerated": false,
"ratio": 2.78125,
"config_test": false,
... |
__author__ = 'Chick Markley'
from PySide import QtGui, QtCore
from ast_tool_box.models.code_models.code_model import AstTreeItem, CodeItem, FileItem, GeneratedCodeItem
from ast_tool_box.views.code_views.ast_tree_widget import AstTreePane, AstTreeWidget
from ast_tool_box.views.editor_widget import EditorPane
class Co... | {
"repo_name": "ucb-sejits/ast_tool_box",
"path": "ast_tool_box/views/code_views/code_pane.py",
"copies": "1",
"size": "12606",
"license": "mit",
"hash": -1039237745624882400,
"line_mean": 36.4065281899,
"line_max": 110,
"alpha_frac": 0.6025702047,
"autogenerated": false,
"ratio": 3.81537530266343... |
__author__ = 'Chick Markley'
from PySide import QtGui, QtCore
from ast_tool_box.views.highlighter import Highlighter
class EditorPane(QtGui.QPlainTextEdit):
def __init__(self, parent_panel=None):
# Editor widget
super(EditorPane, self).__init__()
font = QtGui.QFont()
font.setFamil... | {
"repo_name": "ucb-sejits/ast_tool_box",
"path": "ast_tool_box/views/editor_widget.py",
"copies": "1",
"size": "4113",
"license": "mit",
"hash": -1578324404918985000,
"line_mean": 33.5630252101,
"line_max": 94,
"alpha_frac": 0.6442985655,
"autogenerated": false,
"ratio": 3.780330882352941,
"con... |
__author__ = 'Chick Markley'
from PySide import QtGui, QtCore
class SearchLineEdit(QtGui.QLineEdit):
def __init__(self, parent=None, on_changed=None, on_next=None):
QtGui.QLineEdit.__init__(self, parent)
self.clear_button = QtGui.QToolButton(self)
self.clear_button.setIcon(
Q... | {
"repo_name": "ucb-sejits/ast_tool_box",
"path": "ast_tool_box/views/search_widget.py",
"copies": "1",
"size": "3170",
"license": "mit",
"hash": -2911495842420046300,
"line_mean": 38.625,
"line_max": 125,
"alpha_frac": 0.5977917981,
"autogenerated": false,
"ratio": 3.6774941995359627,
"config_t... |
__author__ = 'Chick Markley'
import os
import sys
import imp
import inspect
from pprint import pprint
class Util(object):
@staticmethod
def is_package(directory):
# print "is_package testing %s" % os.path.join(directory, "__init__.py")
return os.path.isfile(os.path.join(directory, "__init__.p... | {
"repo_name": "ucb-sejits/ast_tool_box",
"path": "ast_tool_box/util.py",
"copies": "1",
"size": "2118",
"license": "mit",
"hash": 1536131648322578000,
"line_mean": 32.109375,
"line_max": 98,
"alpha_frac": 0.5627950897,
"autogenerated": false,
"ratio": 3.8933823529411766,
"config_test": false,
... |
__author__ = 'Chick Markley'
import types
import ast
from ast_tool_box.views.editor_widget import EditorPane
from ast_tool_box.views.search_widget import SearchLineEdit
from ast_tool_box.models.transform_models.transform_file import AstTransformItem, CodeGeneratorItem
from PySide import QtGui, QtCore
DEBUGGING = Fa... | {
"repo_name": "ucb-sejits/ast_tool_box",
"path": "ast_tool_box/views/transform_views/transform_tree_widget.py",
"copies": "1",
"size": "8081",
"license": "mit",
"hash": -8120472517666699000,
"line_mean": 36.412037037,
"line_max": 112,
"alpha_frac": 0.6262838758,
"autogenerated": false,
"ratio": 4... |
__author__ = 'Chick Markley'
import types
import ast
import tempfile
import os
from ast_tool_box.views.search_widget import SearchLineEdit
from PySide import QtGui, QtCore
DEBUGGING = False
class AstTreePane(QtGui.QGroupBox):
def __init__(self, code_presenter=None, ast_root=None, tab_name=None):
super(... | {
"repo_name": "ucb-sejits/ast_tool_box",
"path": "ast_tool_box/views/code_views/ast_tree_widget.py",
"copies": "1",
"size": "11795",
"license": "mit",
"hash": -6473404286601594000,
"line_mean": 34.7424242424,
"line_max": 118,
"alpha_frac": 0.5830436626,
"autogenerated": false,
"ratio": 3.89017150... |
__author__ = 'chick'
import os
import stat
import inspect
import shutil
from mako.template import Template
class Builder:
"""
Class that creates a directory and file hierarchy based on a template directory
ordinary files are copied as is
*.mako files are rendered with mako into files with the .mako ... | {
"repo_name": "mbdriscoll/ctree",
"path": "ctree/tools/generators/builder.py",
"copies": "3",
"size": "3321",
"license": "bsd-2-clause",
"hash": -8335997471395615000,
"line_mean": 35.097826087,
"line_max": 122,
"alpha_frac": 0.5609756098,
"autogenerated": false,
"ratio": 4.172110552763819,
"con... |
__author__ = 'chitrabhanu'
import csv
import os, stat
import sys
import datetime
import time
import json
USAGE_ERROR_PREFIX = "USAGE ERROR: "
RUNTIME_ERROR_PREFIX = "RUNTIME ERROR: "
class UsageError(Exception):
def __init__(self, msg):
self.msg = USAGE_ERROR_PREFIX + msg
class RuntimeError(Exception):... | {
"repo_name": "unchaoss/unchaoss",
"path": "engine/py/contactops/contactops.py",
"copies": "1",
"size": "5436",
"license": "apache-2.0",
"hash": 6575334732027518000,
"line_mean": 32.975,
"line_max": 104,
"alpha_frac": 0.5410228109,
"autogenerated": false,
"ratio": 3.473482428115016,
"config_tes... |
__author__ = 'chitrabhanu'
import os, stat
import sys
import datetime
import hashlib
import time
from filecmp import dircmp
USAGE_ERROR_PREFIX = "USAGE ERROR: "
RUNTIME_ERROR_PREFIX = "RUNTIME ERROR: "
class UsageError(Exception):
def __init__(self, msg):
self.msg = USAGE_ERROR_PREFIX + msg
class Runti... | {
"repo_name": "unchaoss/unchaoss",
"path": "engine/py/dirops/dirops.py",
"copies": "1",
"size": "33264",
"license": "apache-2.0",
"hash": 4834666172884900000,
"line_mean": 40.8427672956,
"line_max": 140,
"alpha_frac": 0.5712782588,
"autogenerated": false,
"ratio": 3.5226093402520386,
"config_te... |
__author__ = 'chitrabhanu'
import os
from slackclient import SlackClient
import requests
import sys
import datetime
import time
import json
from json2html import json2html
# This value is used as a delay between successive page requests to avoid getting rate limited by Slack
SECONDS_BETWEEN_SUCCESSIVE_PAGE_REQUESTS ... | {
"repo_name": "unchaoss/unchaoss",
"path": "self-contained-apps/py/slackbak/slackback.py",
"copies": "1",
"size": "34669",
"license": "apache-2.0",
"hash": -3842203280328850000,
"line_mean": 44.0246753247,
"line_max": 310,
"alpha_frac": 0.5523378234,
"autogenerated": false,
"ratio": 3.74678482654... |
__author__ = 'chmod'
from rHLDS import const
from io import BytesIO
import socket
import sys
class Console:
host = ''
port = ''
password = ''
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def __init__(self, *, host, port=27015, password):
self.host = host
self.port = po... | {
"repo_name": "chmod1/rHLDS",
"path": "rHLDS/console.py",
"copies": "1",
"size": "1886",
"license": "mit",
"hash": -2210590902798207700,
"line_mean": 26.3333333333,
"line_max": 64,
"alpha_frac": 0.5349946978,
"autogenerated": false,
"ratio": 4.108932461873638,
"config_test": false,
"has_no_ke... |
__author__ = 'Chong-U Lim, culim@mit.edu'
class Analyzer(object):
def __init__(self, puzzlescript):
self.puzzlescript = puzzlescript
def get_number_of_levels(self):
return len(self.puzzlescript['levels'].levels)
def get_number_of_rules(self):
if ('rules' not in self.puzzlescript):
return 0
return len(... | {
"repo_name": "chongdashu/puzzlescript-analyze",
"path": "python/analyzer.py",
"copies": "1",
"size": "2109",
"license": "mit",
"hash": 8661229490364737000,
"line_mean": 27.5,
"line_max": 155,
"alpha_frac": 0.7031768611,
"autogenerated": false,
"ratio": 2.925104022191401,
"config_test": false,
... |
__author__ = 'Chong-U Lim, culim@mit.edu'
import re,sys,os,copy
class Script(object):
def __init__(self, txt):
self.sections = {}
self.txt = txt
if (self.txt):
self.parse(txt)
def parse(self, txt):
section = Section.create(Section.TYPE_PRELUDE)
self.add_section(section)
lines = txt.split("\... | {
"repo_name": "chongdashu/puzzlescript-analyze",
"path": "python/puzzlescript.py",
"copies": "1",
"size": "12603",
"license": "mit",
"hash": -1530629649629180000,
"line_mean": 22.6011235955,
"line_max": 75,
"alpha_frac": 0.6592874712,
"autogenerated": false,
"ratio": 2.9724056603773583,
"config... |
__author__ = 'Chong-U Lim, culim@mit.edu'
__version__ = '2014.02.23'
import datetime
class Arff(object):
def __init__(self):
self.title = "Untitled"
self.sources = []
self.relation = "default"
self.attributes = []
self.instances = 0
def setTitle(self, title):
self.title = title
def addSource(self, s... | {
"repo_name": "chongdashu/puzzlescript-analyze",
"path": "python/weka.py",
"copies": "1",
"size": "2635",
"license": "mit",
"hash": 8366106543745340000,
"line_mean": 22.9545454545,
"line_max": 123,
"alpha_frac": 0.5984819734,
"autogenerated": false,
"ratio": 2.957351290684624,
"config_test": fa... |
__author__ = "Chris Barnett"
__version__ = "0.3"
__license__ = "MIT"
def post_rings_kcf_to_image(inputstream):
"""
posts kcf to the image converter at RINGS
'http://rings.t.soka.ac.jp/cgi-bin/tools/utilities/KCFtoIMAGE/KCF_to_IMAGE.pl'
:param inputstream: read and then passed to the textarea in web f... | {
"repo_name": "chrisbarnettster/cfg-analysis-on-heroku-jupyter",
"path": "notebooks/scripts/post_kcf_to_image.py",
"copies": "1",
"size": "2501",
"license": "mit",
"hash": -6321263924505291000,
"line_mean": 35.7794117647,
"line_max": 109,
"alpha_frac": 0.6617353059,
"autogenerated": false,
"ratio... |
__author__ = "Chris Barnett"
__version__ = "0.5.2"
__license__ = "MIT"
from BeautifulSoup import BeautifulSoup
import mechanize
class PrettifyHandler(mechanize.BaseHandler):
def http_response(self, request, response):
if not hasattr(response, "seek"):
response = mechanize.response_seek_wrapper... | {
"repo_name": "chrisbarnettster/cfg-analysis-on-heroku-jupyter",
"path": "notebooks/scripts/post_glycan_convert.py",
"copies": "1",
"size": "12539",
"license": "mit",
"hash": -7614142839339036000,
"line_mean": 43.1514084507,
"line_max": 196,
"alpha_frac": 0.6596219794,
"autogenerated": false,
"ra... |
from __future__ import print_function, division
import numpy as np
import pandas as pd
from subprocess import call
from os import path
from sys import argv
jamierod_results_path = '/nfs/slac/g/ki/ki18/des/cpd/jamierod_results.csv'
jamierod_results = pd.read_csv(jamierod_results_path)
#out_dir = '/nfs/slac/g/ki/ki18/d... | {
"repo_name": "aaronroodman/DeconvolvePSF",
"path": "src/do_call.py",
"copies": "1",
"size": "1556",
"license": "mit",
"hash": 7853368597436541000,
"line_mean": 34.3636363636,
"line_max": 94,
"alpha_frac": 0.6503856041,
"autogenerated": false,
"ratio": 2.897579143389199,
"config_test": false,
... |
AUTHOR = 'Chris Dent'
AUTHOR_EMAIL = 'cdent@peermore.com'
NAME = 'tiddlywebplugins.twimport'
DESCRIPTION = 'TiddlyWiki and tiddler import tools for TiddyWeb'
VERSION = '1.1.1'
import os
from setuptools import setup, find_packages
CLASSIFIERS = """
Environment :: Web Environment
License :: OSI Approved :: BSD Licen... | {
"repo_name": "tiddlyweb/tiddlywebplugins.twimport",
"path": "setup.py",
"copies": "1",
"size": "1086",
"license": "bsd-3-clause",
"hash": 4211076501607947000,
"line_mean": 26.15,
"line_max": 86,
"alpha_frac": 0.664825046,
"autogenerated": false,
"ratio": 3.503225806451613,
"config_test": false... |
from configparser import ConfigParser
from os import path
from subprocess import Popen, CalledProcessError, PIPE, STDOUT
import shlex
def main():
config_file = 'settings.ini'
# Check if the ini file exists, create if not
if not path.isfile(config_file):
create_ini(config_file)
print(conf... | {
"repo_name": "ChrisEby/SnapshotCycle",
"path": "snapshot_cycle.py",
"copies": "1",
"size": "2847",
"license": "mit",
"hash": 5450643881733936000,
"line_mean": 31.7356321839,
"line_max": 101,
"alpha_frac": 0.5904460836,
"autogenerated": false,
"ratio": 3.9707112970711296,
"config_test": true,
... |
__author__ = "Chris Greene"
import pdb
from dolfin import *
import time
import montecarlo_mockup as mc
import move_particles_c as c_interface
import numpy as np
import dolfin_util as du
import mcoptions,sys,os
import re
import photocurrent as pc
import density_funcs
import materials
import meshes
class Problem:
pa... | {
"repo_name": "cwgreene/Nanostructure-Simulator",
"path": "monte.py",
"copies": "1",
"size": "6970",
"license": "mit",
"hash": -8086935310102842000,
"line_mean": 28.7863247863,
"line_max": 96,
"alpha_frac": 0.7305595409,
"autogenerated": false,
"ratio": 2.888520513883133,
"config_test": false,
... |
__author__ = 'Chris Krycho'
__copyright__ = '2013 Chris Krycho'
from logging import error, warning
from sys import exit
try:
from jinja2 import Environment, FileSystemLoader, TemplateNotFound
except ImportError as import_error:
error(import_error)
exit()
class Renderer():
DEFAULT_NAME = 'default'
... | {
"repo_name": "chriskrycho/step-stool",
"path": "step_stool/render.py",
"copies": "1",
"size": "1860",
"license": "mit",
"hash": -980047906801529300,
"line_mean": 36.2,
"line_max": 100,
"alpha_frac": 0.6569892473,
"autogenerated": false,
"ratio": 4.2465753424657535,
"config_test": false,
"has... |
__author__ = 'Chris Lewis'
__version__ = '0.1.0'
__email__ = 'clewis1@c.ringling.edu'
import sys
import json
import maya.cmds as mc
from maya.OpenMaya import *
from maya.OpenMayaMPx import *
kPluginTranslatorTypeName = 'Three.js'
kOptionScript = 'ThreeJsExportScript'
kDefaultOptionsString = '0'
FLOAT_PRECISION = 8
... | {
"repo_name": "mind0n/hive",
"path": "History/Website/3js/utils/exporters/maya/plug-ins/threeJsFileTranlator.py",
"copies": "2",
"size": "9427",
"license": "mit",
"hash": -7738290745982726000,
"line_mean": 33.7896678967,
"line_max": 128,
"alpha_frac": 0.5470457197,
"autogenerated": false,
"ratio"... |
__author__ = 'Chris Lewis'
__version__ = '0.1.0'
__email__ = 'clewis1@c.ringling.edu'
import sys
import json
import maya.cmds as mc
from maya.OpenMaya import *
from maya.OpenMayaMPx import *
kPluginTranslatorTypeName = 'Three.js'
kOptionScript = 'ThreeJsExportScript'
kDefaultOptionsString = '0'
FLOAT... | {
"repo_name": "stanwmusic/three.js",
"path": "utils/exporters/maya/plug-ins/threeJsFileTranslator.py",
"copies": "25",
"size": "9928",
"license": "mit",
"hash": 2361810420530528000,
"line_mean": 34.3736263736,
"line_max": 128,
"alpha_frac": 0.5321313457,
"autogenerated": false,
"ratio": 4.2719449... |
"""
S5/HTML Slideshow Writer.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import docutils
from docutils import frontend, nodes, utils
from docutils.writers import html4css1
from docutils.parsers.rst import directives
themes_dir_path = utils.relative_path(
os.path.join(os.getcwd(), 'du... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/docutils-0.4-py2.5.egg/docutils/writers/s5_html/__init__.py",
"copies": "6",
"size": "13039",
"license": "bsd-3-clause",
"hash": 5015931710226948000,
"line_mean": 38.9969325153,
"line_max": 80,
"alpha_frac": 0.56... |
"""
S5/HTML Slideshow Writer.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import docutils
from docutils import frontend, nodes, utils
from docutils.writers import html4css1
from docutils.parsers.rst import directives
themes_dir_path = utils.relative_path(
os.path.join... | {
"repo_name": "hugs/selenium",
"path": "selenium/src/py/lib/docutils/writers/s5_html/__init__.py",
"copies": "5",
"size": "14189",
"license": "apache-2.0",
"hash": -539343065299782660,
"line_mean": 39.8554572271,
"line_max": 80,
"alpha_frac": 0.5480301642,
"autogenerated": false,
"ratio": 3.98231... |
# This example loads a large 800MB Hacker News comments dataset
# and preprocesses it. This can take a few hours, and a lot of
# memory, so please be patient!
from lda2vec import preprocess, Corpus
import numpy as np
import pandas as pd
import logging
import cPickle as pickle
import os.path
logging.basicConfig()
ma... | {
"repo_name": "cemoody/lda2vec",
"path": "examples/hacker_news/data/preprocess.py",
"copies": "1",
"size": "4172",
"license": "mit",
"hash": 6543860040082700000,
"line_mean": 36.9272727273,
"line_max": 76,
"alpha_frac": 0.7293863854,
"autogenerated": false,
"ratio": 3.3084853291038856,
"config_... |
# This simple example loads the newsgroups data from sklearn
# and train an LDA-like model on it
import logging
import pickle
from sklearn.datasets import fetch_20newsgroups
import numpy as np
from lda2vec import preprocess, Corpus
logging.basicConfig()
# Fetch data
remove = ('headers', 'footers', 'quotes')
texts ... | {
"repo_name": "cemoody/lda2vec",
"path": "examples/twenty_newsgroups/data/preprocess.py",
"copies": "1",
"size": "2233",
"license": "mit",
"hash": -2383055556073981000,
"line_mean": 33.890625,
"line_max": 76,
"alpha_frac": 0.7254814151,
"autogenerated": false,
"ratio": 3.3130563798219583,
"conf... |
# This simple example loads the newsgroups data from sklearn
# and train an LDA-like model on it
import os
import os.path
import pickle
import time
import shelve
import chainer
from chainer import cuda
from chainer import serializers
import chainer.optimizers as O
import numpy as np
from lda2vec import utils
from ld... | {
"repo_name": "cemoody/lda2vec",
"path": "examples/twenty_newsgroups/lda2vec/lda2vec_run.py",
"copies": "1",
"size": "4411",
"license": "mit",
"hash": -5107678301188548000,
"line_mean": 34.5725806452,
"line_max": 78,
"alpha_frac": 0.6585808207,
"autogenerated": false,
"ratio": 3.069589422407794,
... |
# This simple example loads the newsgroups data from sklearn
# and train an LDA-like model on it
import os.path
import pickle
import time
from chainer import serializers
from chainer import cuda
import chainer.optimizers as O
import numpy as np
from lda2vec import prepare_topics, print_top_words_per_topic
from lda2v... | {
"repo_name": "cemoody/lda2vec",
"path": "examples/twenty_newsgroups/lda/lda_run.py",
"copies": "1",
"size": "2451",
"license": "mit",
"hash": -6793085741310999000,
"line_mean": 29.2592592593,
"line_max": 78,
"alpha_frac": 0.6344349245,
"autogenerated": false,
"ratio": 2.9817518248175183,
"conf... |
# This simple example loads the newsgroups data from sklearn
# and train an LDA-like model on it
import os.path
import pickle
import time
from chainer import serializers
import chainer.optimizers as O
import numpy as np
from lda2vec import utils
from nvdm import NVDM
vocab = pickle.load(open('vocab.pkl', 'r'))
corp... | {
"repo_name": "cemoody/lda2vec",
"path": "examples/twenty_newsgroups/nvdm/nvdm_run.py",
"copies": "1",
"size": "1839",
"license": "mit",
"hash": -5795243133006661000,
"line_mean": 27.734375,
"line_max": 67,
"alpha_frac": 0.6356715606,
"autogenerated": false,
"ratio": 3.059900166389351,
"config_... |
# This simple example loads the newsgroups data from sklearn
# and train an LDA-like model on it
import os.path
import pickle
import time
import chainer
from chainer import cuda
from chainer import serializers
import chainer.optimizers as O
import numpy as np
from lda2vec import utils
from lda2vec import prepare_top... | {
"repo_name": "cemoody/lda2vec",
"path": "examples/hacker_news/lda2vec/lda2vec_run.py",
"copies": "1",
"size": "4044",
"license": "mit",
"hash": 4763528635687371000,
"line_mean": 32.9831932773,
"line_max": 77,
"alpha_frac": 0.6456478734,
"autogenerated": false,
"ratio": 3.117964533538936,
"conf... |
def _print_zone_info(zoneinfo):
print "="*80
print "| ID: %s" % zoneinfo['Id'].split("/")[-1]
print "| Name: %s" % zoneinfo['Name']
print "| Ref: %s" % zoneinfo['CallerReference']
print "="*80
print zoneinfo['Config']
print
def create(conn, hostname, caller_reference=None, comment=''):
... | {
"repo_name": "milannic/expCPython",
"path": "concoord-1.0.2/build/lib.linux-x86_64-2.7/concoord/route53.py",
"copies": "3",
"size": "9010",
"license": "mit",
"hash": 1712553647002299100,
"line_mean": 43.603960396,
"line_max": 139,
"alpha_frac": 0.6445061043,
"autogenerated": false,
"ratio": 3.47... |
__author__ = 'chris'
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
class WSProtocol(WebSocketServerProtocol):
def onOpen(self):
self.factory.register(self)
def onMessage(self, payload, isBinary):
"""
handle outgoing messages and notifications h... | {
"repo_name": "bankonme/OpenBazaar-Server",
"path": "ws.py",
"copies": "2",
"size": "1175",
"license": "mit",
"hash": 3861046384917417000,
"line_mean": 27.6585365854,
"line_max": 94,
"alpha_frac": 0.6689361702,
"autogenerated": false,
"ratio": 4.3357933579335795,
"config_test": false,
"has_no... |
__author__ = 'chris'
from binascii import unhexlify
import dht.constants
import mock
import nacl.signing
import nacl.hash
from txrudp import packet, connection, rudp, constants
from twisted.internet import udp, address, task
from twisted.trial import unittest
from dht.crawling import RPCFindResponse, NodeSpiderCrawl, ... | {
"repo_name": "eXcomm/OpenBazaar-Server",
"path": "dht/tests/test_crawling.py",
"copies": "3",
"size": "15291",
"license": "mit",
"hash": -806074362060223000,
"line_mean": 41.1239669421,
"line_max": 113,
"alpha_frac": 0.6449545484,
"autogenerated": false,
"ratio": 3.58943661971831,
"config_test... |
__author__ = 'chris'
from binascii import unhexlify
import mock
import nacl.signing
import nacl.hash
from txrudp import packet, connection, rudp, constants
from twisted.internet import udp, address, task
from twisted.trial import unittest
from dht.crawling import RPCFindResponse, NodeSpiderCrawl, ValueSpiderCrawl
from... | {
"repo_name": "Joaz/OpenBazaar-Server",
"path": "dht/tests/test_crawling.py",
"copies": "2",
"size": "15319",
"license": "mit",
"hash": 825506423789790700,
"line_mean": 40.9698630137,
"line_max": 113,
"alpha_frac": 0.6450812716,
"autogenerated": false,
"ratio": 3.5943219145940875,
"config_test"... |
__author__ = 'chris'
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
def get(key, default):
return getattr(settings, key, default)
# AUTH based settings
WOOEY_ALLOW_ANONYMOUS = get('WOOEY_ALLOW_ANONYMOUS', True)
WOOEY_AUTH = get('WOOEY_AUTH', True)
WOOEY_LOGIN_URL = get('... | {
"repo_name": "wooey/Wooey",
"path": "wooey/settings.py",
"copies": "1",
"size": "1273",
"license": "bsd-3-clause",
"hash": 2882682810500737000,
"line_mean": 38.78125,
"line_max": 86,
"alpha_frac": 0.7227022781,
"autogenerated": false,
"ratio": 2.641078838174274,
"config_test": false,
"has_no... |
{
"repo_name": "hottwaj/Wooey",
"path": "wooey/views/mixins.py",
"copies": "4",
"size": "1736",
"license": "bsd-3-clause",
"hash": 8870189604861213000,
"line_mean": 39.3720930233,
"line_max": 152,
"alpha_frac": 0.6630184332,
"autogenerated": false,
"ratio": 3.116696588868941,
"config_test": fals... | |
__author__ = 'chris'
from OpenSSL import SSL
from twisted.internet import ssl
class ChainedOpenSSLContextFactory(ssl.DefaultOpenSSLContextFactory):
def __init__(self, privateKeyFileName, certificateChainFileName,
sslmethod=SSL.SSLv23_METHOD):
"""
@param privateKeyFileName: Name o... | {
"repo_name": "OpenBazaar/OpenBazaar-Server",
"path": "net/sslcontext.py",
"copies": "7",
"size": "1076",
"license": "mit",
"hash": -374273050424855700,
"line_mean": 40.3846153846,
"line_max": 91,
"alpha_frac": 0.6802973978,
"autogenerated": false,
"ratio": 4.846846846846847,
"config_test": fal... |
__author__ = 'chris'
from twisted.internet import reactor, task
from protos.message import Command, PING, STUN, STORE, HOLE_PUNCH, INV, VALUES
from log import Logger
from constants import SEED_NODE, SEED_NODE_TESTNET
class BanScore(object):
def __init__(self, peer_ip, multiplexer, ban_time=86400):
self.p... | {
"repo_name": "hauxir/OpenBazaar-Server",
"path": "net/dos.py",
"copies": "1",
"size": "2291",
"license": "mit",
"hash": -7546997388569179000,
"line_mean": 34.796875,
"line_max": 90,
"alpha_frac": 0.5351374945,
"autogenerated": false,
"ratio": 3.5464396284829722,
"config_test": false,
"has_no... |
__author__ = 'chris'
from unittest import TestCase
import subprocess
import os
import shutil
import sys
BASE_DIR = os.path.split(__file__)[0]
WOOEY_SCRIPT_PATH = os.path.join(BASE_DIR, '..', 'scripts', 'wooify')
WOOEY_TEST_PROJECT_NAME = 'wooey_project'
WOOEY_TEST_PROJECT_PATH = os.path.join(BASE_DIR, WOOEY_TEST_PROJE... | {
"repo_name": "hottwaj/Wooey",
"path": "tests/test_project.py",
"copies": "4",
"size": "1558",
"license": "bsd-3-clause",
"hash": -4403777348932068000,
"line_mean": 37,
"line_max": 104,
"alpha_frac": 0.6810012837,
"autogenerated": false,
"ratio": 3.2256728778467907,
"config_test": true,
"has_... |
__author__ = 'chris'
from zope.interface.verify import verifyObject
from txrudp.rudp import ConnectionMultiplexer
from txrudp.connection import HandlerFactory, Handler
from txrudp.crypto_connection import CryptoConnectionFactory
from interfaces import MessageProcessor
from protos.message import Message, FIND_VALUE
from... | {
"repo_name": "melpomene/OpenBazaar-Server",
"path": "wireprotocol.py",
"copies": "1",
"size": "4583",
"license": "mit",
"hash": -6045484732270255000,
"line_mean": 40.6636363636,
"line_max": 114,
"alpha_frac": 0.6233907921,
"autogenerated": false,
"ratio": 4.537623762376238,
"config_test": fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.