text
stringlengths
4
1.02M
meta
dict
''' Helper class for parsing input data and generating train/test sets. Author: Tushar Makkar <tusharmakkar08[at]gmail.com> Date: 17.11.2014 ''' import csv, numpy, random def randomize_inputs(X, y): ''' Randomizes the input samples, just in case they are neatly ordered in the raw form. Args: ...
{ "content_hash": "30c408e171b970f171d8912255d7214e", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 72, "avg_line_length": 36.52914798206278, "alnum_prop": 0.5808986005401424, "repo_name": "tusharmakkar08/Feature_Selection_Symbiotic", "id": "42b3c05653a8441911935151caa28c4...
from admin_views.admin import AdminViews from conferences.models.conference import Conference from django.contrib import admin, messages from django.shortcuts import redirect from newsletters.exporter import Endpoint from notifications.aws import send_endpoints_to_pinpoint from pretix import get_all_order_positions, ge...
{ "content_hash": "939023ab33ce4b885be690d008fb56c6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 85, "avg_line_length": 31.39240506329114, "alnum_prop": 0.6540322580645161, "repo_name": "patrick91/pycon", "id": "b93046b5511356b9b2cb7d8d3da3bc59149ed4f7", "size": "2480"...
"""George Goerg's one-point reach curve model. This class fits the model described in George Goerg's paper: Goerg, Georg M. "Estimating reach curves from one data point." (2014). Goerg assumes the underlying reach curve is determined by an exponential- Poisson distribution with unknown mixing parameter, and shows ...
{ "content_hash": "519b7639d427be48a28da145a9f749b1", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 87, "avg_line_length": 41.4, "alnum_prop": 0.6211543351131452, "repo_name": "world-federation-of-advertisers/planning-evaluation-framework", "id": "719afee04c65036aacb02d90b8...
''' This module contains utility functions for producing the figures and tables, primarily compiling the data for them to use. ''' from os.path import join as _join def crop_png(filename): '''Autocrop excess white margins from PNG file Args ---- filename: str Path and filename with extension t...
{ "content_hash": "8e2675250ef1f495ff14fe758a0a90de", "timestamp": "", "source": "github", "line_count": 395, "max_line_length": 86, "avg_line_length": 31.539240506329115, "alnum_prop": 0.5537807031626264, "repo_name": "ryanjdillon/smartmove", "id": "37d731a13b287121d3983ab0d8047ed167408abd", "size"...
import os import yaml import popper.scm as scm from hashlib import shake_256 from popper.cli import log as log from box import Box class ConfigLoader(object): @staticmethod def load( engine_name=None, resman_name=None, config_file=None, workspace_dir=os.getcwd(), reu...
{ "content_hash": "4370c88770797d3cc187fa38f9ebc06b", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 83, "avg_line_length": 34.62589928057554, "alnum_prop": 0.5732391439850405, "repo_name": "systemslab/popper", "id": "a5138b1a6f01923567cb03da951a088962768dbb", "size": "48...
import json import click from tabulate import tabulate @click.command('keys', short_help='List API keys') @click.pass_obj def cli(obj): """List API keys.""" client = obj['client'] if obj['output'] == 'json': r = client.http.get('/keys') click.echo(json.dumps(r['keys'], sort_keys=True, in...
{ "content_hash": "96d5af216ec42c7f07aebec2712ed26a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 119, "avg_line_length": 33.86363636363637, "alnum_prop": 0.5879194630872483, "repo_name": "alerta/python-alerta", "id": "d740eb181310424e45c37f803199432700ee061f", "size": ...
from display.handlers.base import BaseHandler class UiButtonsHandler(BaseHandler): def get(self): title = 'UiButtonsHandler' self.render('ui/buttons.html', title = title, **self.render_dict)
{ "content_hash": "2b700e634022d39dd3109775cd3dca34", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 73, "avg_line_length": 35.166666666666664, "alnum_prop": 0.7109004739336493, "repo_name": "owlsn/h_crawl", "id": "1aea0afa1fe4aa4f453e07ed67d5fe3b3890f445", "size": "211", ...
import handson.myyaml # import logging import unittest from handson.test_setup import SetUp from handson.vpc import VPC class TestVPC(SetUp, unittest.TestCase): def test_vpc_cache(self): self.reset_yaml() handson.myyaml.yaml_file_name('./aws.yaml') handson.myyaml.load() v = VPC({...
{ "content_hash": "1862240dc1b8e965a5a637517c04197b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 51, "avg_line_length": 23.647058823529413, "alnum_prop": 0.6442786069651741, "repo_name": "smithfarm/ceph-auto-aws", "id": "e342991901a5eb0e4a7ccf45d1e5a604d6b222c4", "size...
import os from common import config # TODO check for path existence in all filepath functions # not temporary def getimagepath(imagename, *subdirs): imagedir = os.path.join(config.PROJECT_ROOT, "images") if len(subdirs): dirlist = [imagedir] + list(subdirs) imagedir = os.path.join(*dirlist) ...
{ "content_hash": "519a5f22dd6c072c50299cd4bf03a539", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 58, "avg_line_length": 26.901960784313726, "alnum_prop": 0.6552478134110787, "repo_name": "sonya/eea", "id": "332caa98309e62368a9249d48db5833dccebffea", "size": "1952", "...
"""Logging interface This exposes a simplified form of logging and helps consolidate config. The intended default logging setup is to log locally to a file and also to AWS DynamoDB so that logs can be aggregated an exposed easily. """ import logging log = None def set_config(log_dir, filename='log.txt'): """Invo...
{ "content_hash": "f1d871d640a432171e21483faba09702", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 24.78125, "alnum_prop": 0.6645649432534678, "repo_name": "jfalkner/acumen", "id": "c577a83dc3d63db8d05b0aa38a66c8699649ad8b", "size": "793", "binar...
import networkx as nx import random as rnd import numpy as np from time import clock from collections import defaultdict import matplotlib.pyplot as plt import zipfile ## local modules ## import percolations as perc import pretty_print as pp ### data structures ### # d_node_age[nodenumber] = ageclass d_node_age = {} ...
{ "content_hash": "a06ee9fd8f7a398bf06e839e122aea88", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 296, "avg_line_length": 40.407407407407405, "alnum_prop": 0.6968377635197067, "repo_name": "eclee25/flu-SDI-simulations-age", "id": "256689cd9c7722c5344e4d182794de61fea1a67d...
import os log_dir = '/data/logs/zoro' log_level = 'DEBUG' log_console = True plugins_path = './plugins/' user_home_path = os.getenv("HOME") user_plugins_path = os.path.join(user_home_path, '.zoro/plugins/') user_config_path = os.path.join(user_home_path, '.zoro/config.json')
{ "content_hash": "71f65b8a0372109dfa13759bdf846a78", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 68, "avg_line_length": 25.363636363636363, "alnum_prop": 0.6917562724014337, "repo_name": "onlytiancai/zoro", "id": "7e7194030c332666c68946ad40c59655ae524be2", "size": "326...
from django.conf import settings from django.contrib.auth.models import User, Group from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Create an admin user (if not exists) with password from env' def add_arguments(self, parser): parser.add_argument('--email', type...
{ "content_hash": "3be9f9c89ce6b750bb7f93fa9e47547f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 92, "avg_line_length": 37.172413793103445, "alnum_prop": 0.6363636363636364, "repo_name": "GETLIMS/LIMS-Backend", "id": "a550fece56fca82e912bf98f65e52491a069dc8a", "size": ...
""" Functions for reading and writing NMRPipe files and table (.tab) files """ from __future__ import print_function, division __developer_info__ = """ NMRPipe file structure is described in the NMRPipe man pages and fdatap.h """ import struct import datetime import os try: from StringIO import StringIO except I...
{ "content_hash": "45090af7dbcdac5887f71cce9e80ce48", "timestamp": "", "source": "github", "line_count": 2258, "max_line_length": 79, "avg_line_length": 30.82860938883968, "alnum_prop": 0.5639338610277111, "repo_name": "atomman/nmrglue", "id": "642a4893534efb9fd268c8afcbe2bd187c840d32", "size": "696...
from django.views import generic from .base import TemplateNameResolverMixin __all__ = ( 'ListView', ) class ListViewMixin(TemplateNameResolverMixin): template_suffixes = ('list',) class ListView(ListViewMixin, generic.ListView): pass
{ "content_hash": "d36afc0e5ad438d1d71ae6896895e42c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 51, "avg_line_length": 16.125, "alnum_prop": 0.7209302325581395, "repo_name": "jleeothon/canclon", "id": "801068b0d1252eb55167cbc49c86ec4c9c1c0bae", "size": "258", "binar...
from __future__ import absolute_import # -- stdlib -- import json import os import socket import sys import time # -- third party -- # -- own -- # -- code -- ts = int(time.time()) rst = [] if os.system('which docker > /dev/null'): print '[]' sys.exit(0) stuck = bool(os.system("timeout -k 10s 10s sudo docke...
{ "content_hash": "b978e8f8df48a096d1f16d1d916ef483", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 15.766666666666667, "alnum_prop": 0.587737843551797, "repo_name": "kadashu/satori", "id": "1ed9f709cffa0f4b8b7b6ad061ea7407aad65fd4", "size": "515", ...
import csv, sys from setup import db from models.trawler import Trawler def reload_data(db): db.sources.remove() for i, url in enumerate(csv.reader(open('models/sources/urls.csv'))): if i == 0: continue db.sources.insert({'url': url[0], 'tags': url[1].split(','), ...
{ "content_hash": "7e6dd0fa7aa90f02744b376bf39d62c7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 24.161290322580644, "alnum_prop": 0.5100133511348465, "repo_name": "damilare/mitiri", "id": "34d0548ac53041c32a70a72727dbc8df762a9be8", "size": "749"...
from random import randint def roll_dice(): """ simulate roll dice """ results = [] for num in range(times): result = randint(1, sides) results.append(result) return results def frequencies(x): """ calculate frequency of each time """ results = [] for num in range(1, sides+...
{ "content_hash": "b56856294ab4b13095111fc8908bf1c3", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 52, "avg_line_length": 23.72093023255814, "alnum_prop": 0.6843137254901961, "repo_name": "littleocub/python_practice", "id": "fe5c825bc9b58e3d06eeed8837c03a8bd4197f50", "si...
"""PILdriver, an image-processing calculator using PIL. An instance of class PILDriver is essentially a software stack machine (Polish-notation interpreter) for sequencing PIL image transformations. The state of the instance is the interpreter stack. The only method one will normally invoke after initialization is t...
{ "content_hash": "899de647fd71bd11977fb8abf989c82c", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 95, "avg_line_length": 29.549618320610687, "alnum_prop": 0.5833763885300955, "repo_name": "WillisXChen/django-oscar", "id": "ce2ecdfee30eeb9fa8adbce066a264fb7abf2a60", "si...
"""Data generators for translation data-sets.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tarfile # Dependency imports from tensor2tensor.data_generators import generator_utils from tensor2tensor.data_generators import problem from...
{ "content_hash": "c8475c3300921dfd19a4e31b5208dad8", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 118, "avg_line_length": 32.44117647058823, "alnum_prop": 0.6915231187669991, "repo_name": "rsepassi/tensor2tensor", "id": "b493ec5c9d44e405ceb019d97f121976f4cabedd", "size...
from toee import * import char_class_utils import char_editor ################################################### def GetConditionName(): # used by API return "Bard" # def GetSpellCasterConditionName(): # return "Bard Spellcasting" def GetCategory(): return "Core 3.5 Ed Classes" def GetClassDefinitionFlags(): r...
{ "content_hash": "9e5b86debda16ecf9d51816c9e8d778a", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 508, "avg_line_length": 28.41850220264317, "alnum_prop": 0.6840799875988219, "repo_name": "GrognardsFromHell/TemplePlus", "id": "2ea4e489687236929c02038fc1579b2863565f2d", ...
from quipp import * def run(): num_components = 2 point_dim = 5 ComponentsType = Vector(num_components, Double) PointType = Vector(point_dim, Double) get_point = rand_function(ComponentsType, PointType) def sample(): components = [normal(0, 1) for i in range(num_components)] return (components, ...
{ "content_hash": "8546f47f82b035404bc2768379ca9c81", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 62, "avg_line_length": 21.88888888888889, "alnum_prop": 0.7081218274111675, "repo_name": "jessica-taylor/quipp2", "id": "a5ff85c3e3e4dfd0adc4a12b0c286a9798e73d24", "size": ...
__author__ = 'eperez' from datetime import datetime from bson import ObjectId from flask import request from eduid_userdb.actions import Action from eduid_userdb.actions.tou import ToUUser, ToUUserDB from eduid_userdb.tou import ToUEvent from eduid_webapp.actions.action_abc import ActionPlugin from eduid_webapp.act...
{ "content_hash": "e543ce1930abfdb1acc6666e6c87c575", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 97, "avg_line_length": 37.88095238095238, "alnum_prop": 0.6275927089880579, "repo_name": "SUNET/eduid-webapp", "id": "ee299e5a564bcdcac55214153139c82118422154", "size": "47...
"""Python implementation of PVL (Parameter Value Language), with upcoming features. If you currently use:: import pvl you can change to:: import pvl.new as pvl And then use all of the pvl functions as you usually would. You will also need to have the 3rd party multidict library (https://github.com/aio-lib...
{ "content_hash": "9fa693769b018ddb13072169e11d7ee4", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 79, "avg_line_length": 36.95192307692308, "alnum_prop": 0.6567785584179027, "repo_name": "planetarypy/pvl", "id": "4d6ac9b9d85883a7f30518f176b71673213aff9f", "size": "7710...
"""Class decorator for adding properties for arguments""" from functools import partial __all__ = [] __private__ = ['properties_for_args'] def properties_for_args(cls, arg_names='_arg_names'): """For a class with an attribute `arg_names` containing a list of names, add a property for every name in that list....
{ "content_hash": "ce150d341e2e819035da34a2c8e8c26a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 36.361111111111114, "alnum_prop": 0.6096256684491979, "repo_name": "mabuchilab/QNET", "id": "9d0e3adf669d191c11a7132f77b32370eee3328c", "size": "1309...
"""Imagenet datasets.""" import io import os import tarfile from absl import logging from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow as tf import tensorflow_datasets.public_api as tfds _DESCRIPTION = """\ ILSVRC 2012, commonly known as 'ImageNet' is an image dataset organized according to th...
{ "content_hash": "8237766a3463088510eb1806d442ff0a", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 220, "avg_line_length": 36.61666666666667, "alnum_prop": 0.6747382794720073, "repo_name": "tensorflow/datasets", "id": "2aa2fd6ffa72be82a464201d7a30a4309b24d9a2", "size": ...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.110 Contact: [email protected] Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import sys # noqa: F401 import six # noq...
{ "content_hash": "47f8a72f1dd7bc94c87dd1255029e0d5", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 114, "avg_line_length": 36.8755980861244, "alnum_prop": 0.5710393149085247, "repo_name": "onshape-public/onshape-clients", "id": "75f4b03c82c6ebe57defb473f3b610ffb4d25dc9", ...
import sys import os import re import string import imp from tkinter import * import tkinter.simpledialog as tkSimpleDialog import tkinter.messagebox as tkMessageBox import traceback import webbrowser from idlelib.MultiCall import MultiCallCreator from idlelib import idlever from idlelib import WindowList from idlelib...
{ "content_hash": "c0f74aadcf7bf9ed9810014a47d09227", "timestamp": "", "source": "github", "line_count": 1593, "max_line_length": 95, "avg_line_length": 38.64846202134338, "alnum_prop": 0.5533158997514902, "repo_name": "MalloyPower/parsing-python", "id": "6a1e325880c8d06abf9d3405fa4ffc75fa94de3b", "...
import urllib2 from bs4 import BeautifulSoup from parsingLibrary import loadHtmlTags, parseChannel, remove_duplicate_elements from pymongo import MongoClient from mongoConfiguration import load_mongo_configuration mongo_address, mongo_port = load_mongo_configuration() client = MongoClient(mongo_address, mongo_port) d...
{ "content_hash": "52812114a297d6848565f6c7f3b481f4", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 117, "avg_line_length": 41.9344262295082, "alnum_prop": 0.674941360437842, "repo_name": "tvlive/tv-crawler", "id": "a70c27c41fb1427d50a0962eb8ae729a30e6f7ef", "size": "513...
"""Evaluates precision@k scores for table retriever predictions.""" from absl import app from absl import flags from tapas.scripts import eval_table_retriever_utils FLAGS = flags.FLAGS flags.DEFINE_string( 'prediction_files_local', None, 'A list of files that contain model predictions as a TSV' 'file wit...
{ "content_hash": "c8db57f780a3afd4f12773efdc663cd9", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 80, "avg_line_length": 31.67391304347826, "alnum_prop": 0.7048730267673301, "repo_name": "google-research/tapas", "id": "ebcb0ab9a91cc1117aa0f3207f87c4982e401e8e", "size": ...
import numpy as np def long_substr(strgs): """ Returns a list with the longest common substring sequences from @strgs Based on: http://stackoverflow.com/questions/2892931/longest-common-substring-from-more-than-two-strings-python """ # Copy the list strgs = strgs[:] if len(strgs) > 1 and l...
{ "content_hash": "6b6203facebfa9d1c095f910fdd81bf6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 115, "avg_line_length": 37, "alnum_prop": 0.5555935682517961, "repo_name": "iuliux/RegExTractor", "id": "a2f35efb0d16e3651128cd1d112a475636f5cc07", "size": "2923", "binar...
import nose.tools as ns import os from os.path import join from tempfile import gettempdir from relshell.record import Record from relshell.recorddef import RecordDef from relshell.batch import Batch from shellstreaming.core.batch_queue import BatchQueue from shellstreaming.ostream.localfile import LocalFile TEST_FIL...
{ "content_hash": "0049d0c172d2177a2da3338588cbd9bd", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 85, "avg_line_length": 23.333333333333332, "alnum_prop": 0.6628571428571428, "repo_name": "laysakura/shellstreaming", "id": "f4092ca0133808fc77753d0eabba2e3d539cd41f", "siz...
import requests from flask import Blueprint, request, jsonify, make_response from app.projects.models import Projects, ProjectsHaulers, ProjectsDebrisbox, ProjectsSchema, TicketsRd, db from app.facilities.models import FacilitiesSchema from app.ticketsRd.models import TicketsRdSchema from app.ticketsSr.models import Ti...
{ "content_hash": "004df2784616ae11bfbbee212edcb8af", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 626, "avg_line_length": 50.88823529411765, "alnum_prop": 0.53826147266212, "repo_name": "konstantinKim/vd-backend", "id": "87218a68e57e9d956f36398a9103064d5fcf2c82", "size...
import pandas as pd import numpy as np def data_check(data,target): """ Checks data type Parameters ---------- data : pd.DataFrame or np.array Field to specify the time series data that will be used. target : int or str Target column Returns ---------- tra...
{ "content_hash": "ec2827622da0f1198c15f71c3f87c0d1", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 83, "avg_line_length": 30.272727272727273, "alnum_prop": 0.5564135564135564, "repo_name": "RJT1990/pyflux", "id": "131a12c0ade1debdcb59b6e436415537898c0bef", "size": "2331"...
import sys from domains.support.lib.common import * import re from pprint import pprint def getRrdFiles(): return getRrdFilesInfo(getFileList("/var/webServer/static/rrd", recursive=True, match='^armore-.*')) def parseInfo(paramList): ds = {} cf = {} for p in paramList.split("\n"): dsSearch = ...
{ "content_hash": "d65c3773e6bd5901b9aea6c2d97a58a3", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 111, "avg_line_length": 30.11904761904762, "alnum_prop": 0.5359683794466403, "repo_name": "GridProtectionAlliance/ARMORE", "id": "9115223bd6a5333c73233388de73384ccbb87f2c", ...
import sys import os import argparse import json import importlib import getpass from datetime import datetime import requests import boto from boto.s3 import connect_to_region from boto.s3.connection import OrdinaryCallingFormat from drift.utils import get_tier_name from drift.management.gittools import get_branch, ...
{ "content_hash": "0c9336d41ee205f2897cbf9574de2b42", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 99, "avg_line_length": 31.18686868686869, "alnum_prop": 0.6414574898785426, "repo_name": "1939Games/drift", "id": "498a6f10eea15f958a9108d6b7196d0c623aed34", "size": "6197...
""" Package for prototype. """
{ "content_hash": "d8546e4799fe8bbe41c2aec33acf9c7f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 22, "avg_line_length": 10.333333333333334, "alnum_prop": 0.6129032258064516, "repo_name": "guilatrova/customercontrol-api", "id": "77a798048134c01f2643e9edbeabb84ca104cf8f", ...
""" Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is a RESTfu...
{ "content_hash": "d25b5d3125c98afc8a191308bbc000a8", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 984, "avg_line_length": 30.40590405904059, "alnum_prop": 0.5889563106796116, "repo_name": "Chaffelson/whoville", "id": "5ac69ff308ccdf764e10e63eacf9b9995bbcbaa5", "size": ...
import sys, os sys.path.insert(0, '..') # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.'))...
{ "content_hash": "bf1b70980d19e13b8078fc28ddcc0343", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 80, "avg_line_length": 32.271186440677965, "alnum_prop": 0.7022058823529411, "repo_name": "niwinz/pyssh-ctypes", "id": "58013334aae9517e3b072ba65e95f5ca83db9ece", "size": ...
''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import platform from pyglet.gl.base import Config, CanvasConfig, Context from pyglet.gl import ContextException from pyglet.gl import gl from pyglet.gl import agl from pyglet.canvas.cocoa import CocoaCanvas from pyglet.libs.darwin.cocoapy import *...
{ "content_hash": "916732aae0037311ca93d3730b46d231", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 187, "avg_line_length": 34.23157894736842, "alnum_prop": 0.6274087740877409, "repo_name": "infowantstobeseen/pyglet-darwincore", "id": "e0b0c4e4ac394be7995e8bada85635e064c0e...
from collections import OrderedDict import os.path import shutil import tempfile from unittest.mock import Mock # Django imports from django.contrib.auth.models import Group from django.http import Http404 from django.test import override_settings, TestCase, RequestFactory from django.urls import reverse from django.u...
{ "content_hash": "4887e0224af37fa0459266016657ed59", "timestamp": "", "source": "github", "line_count": 662, "max_line_length": 100, "avg_line_length": 46.12537764350453, "alnum_prop": 0.63248730964467, "repo_name": "SmartElect/SmartElect", "id": "55acf9b2406d0f817c790a9ba65728eb9090db6a", "size": ...
import _plotly_utils.basevalidators class LegendrankValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="legendrank", parent_name="scattersmith", **kwargs): super(LegendrankValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_na...
{ "content_hash": "e1cf57a6b619f2ee67d8d83020d6896a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 87, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6359223300970874, "repo_name": "plotly/plotly.py", "id": "35a094d3c358d20deb6d2e083a503ba33fd4d9c2", "size": "412"...
import numpy as np __logBase10of2 = 3.010299956639811952137388947244930267681898814621085413104274611e-1 def round_to_n(x, n): if not (type(n) is int or np.issubdtype(n, np.integer)): raise TypeError("RoundToSigFigs: sigfigs must be an integer.") if not np.all(np.isreal(x)): raise TypeError...
{ "content_hash": "eaee5002807afcd3bb69a1eac0b1cb75", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 85, "avg_line_length": 28.958333333333332, "alnum_prop": 0.6776978417266187, "repo_name": "RDCEP/atlas-viewer", "id": "4b6cd8a9c2404f82b4897c0f41f25b094f2c391c", "size": "8...
from enable.savage.svg.css.identifier import *
{ "content_hash": "82daf15cd0369f8228a4b4e2475f365d", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 46, "avg_line_length": 47, "alnum_prop": 0.8085106382978723, "repo_name": "enthought/etsproxy", "id": "c7858b2068c422a82410d26370a05d2b64b054a3", "size": "62", "binary": f...
from __future__ import unicode_literals import uuid import six from boto3 import Session from moto.core import ACCOUNT_ID from moto.core import BaseBackend from moto.core.exceptions import RESTError from moto.s3 import s3_backends from moto.ec2 import ec2_backends from moto.elb import elb_backends from moto.elbv2 imp...
{ "content_hash": "fd9197891c4825640458061305e6f112", "timestamp": "", "source": "github", "line_count": 719, "max_line_length": 100, "avg_line_length": 34.48539638386648, "alnum_prop": 0.5365194595684614, "repo_name": "william-richard/moto", "id": "f8d61ea1944147930617bbb1ac0bd58e4cc93c96", "size":...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('votaciones_leyes', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='vote', name='topic', ), ...
{ "content_hash": "951462b57a0ac881266750ed256cf525", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 62, "avg_line_length": 25.89189189189189, "alnum_prop": 0.535490605427975, "repo_name": "lfalvarez/votaciones_ley_pesca", "id": "69432bcabb32a5988626b79a3b6f08197b12d384", ...
""" Views for Scholarship app. """ import csv import os from venv import create from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required from django.http import HttpResponse, JsonResponse from django.shortcuts import render, redirect from django.views.decorator...
{ "content_hash": "27197875f5280285977e4715a8b5a850", "timestamp": "", "source": "github", "line_count": 732, "max_line_length": 87, "avg_line_length": 28.961748633879782, "alnum_prop": 0.6384433962264151, "repo_name": "sigmapi-gammaiota/sigmapi-web", "id": "1901479e840c3bfe3609e5daa8ecf83d0b17b465", ...
from web2kindle.libs.utils import load_config import os from web2kindle.libs.log import Log LOG = Log("Web2Kindle") INF = 99999999999999999999 CURRENT_PATH = os.getcwd() if len(os.getcwd()) > 1 else '/storage/emulated/0/w2k' CONFIG_PATH = os.path.join(CURRENT_PATH, 'web2kindle/config') BIN_PATH = os.path.join(CURREN...
{ "content_hash": "52d56b32aa1fcf84baeb63674cbb3a59", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 81, "avg_line_length": 48.27777777777778, "alnum_prop": 0.7520138089758343, "repo_name": "wax8280/web2kindle", "id": "434d8f81b165d7a27040205eee19b3a75def46ee", "size": "19...
""" Generate the site Usage: roxy [--config=INI] generate <site> [--file=FILE] roxy [--config=INI] initialize <site> [--file=FILE] roxy [--config=INI] shell <site> [--file=FILE] roxy (-h | --help) Options: -h, --help Show this text -c INI, --config=INI Config path [default: sit...
{ "content_hash": "3a2c15f4d86ee0782240d157935fd036", "timestamp": "", "source": "github", "line_count": 500, "max_line_length": 112, "avg_line_length": 29.312, "alnum_prop": 0.566457423580786, "repo_name": "jessedhillon/roxy", "id": "aa2d8b8fd82729e3830268c8f27a7844cab9a945", "size": "14656", "bi...
import os from flask import Flask, request, render_template from flask_restful import Resource, Api, reqparse from simple_salesforce import Salesforce app = Flask(__name__) api = Api(app) #Initialize a connection with Salesforce sf = Salesforce(username=os.environ.get('SALESFORCE_USERNAME'), password=os.environ.get('...
{ "content_hash": "3b9a259e5da4ab481a4ca4120b497c42", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 162, "avg_line_length": 34.794117647058826, "alnum_prop": 0.7016060862214708, "repo_name": "sumugapadman/Heroku_Python_Sf", "id": "0903bbca5615eae91c0ad576396b2a51f2378fe8", ...
import sys import time import argparse import signal import storjnode from btctxstore import BtcTxStore from crochet import setup # start twisted via crochet and remove twisted handler setup() signal.signal(signal.SIGINT, signal.default_int_handler) def _parse_args(args): parser = argparse.ArgumentParser(descri...
{ "content_hash": "f4784f790f6e3729026cd8d7406572ae", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 74, "avg_line_length": 28.18421052631579, "alnum_prop": 0.5830999066293184, "repo_name": "Storj/storjnode", "id": "37166dd14282c48240d4c71a7b88b8e5ecff4e2a", "size": "2160"...
""" Module for running server """ import os from app import APP from healthcheck import HEALTHCHECK APP.register_blueprint(HEALTHCHECK) ENV = os.environ.get('ENV', None) if ENV == 'local': APP.run(host='0.0.0.0', port=1000)
{ "content_hash": "245f7a167dcd5af786dcfedd2de65d67", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 38, "avg_line_length": 16.571428571428573, "alnum_prop": 0.7025862068965517, "repo_name": "miljkovicivan/MicroComments", "id": "98d2a27b4703bfc05a6b386c6a86a7cab220b093", "...
import click @click.command() @click.option('--count', default=1, help='Number of greetings.') @click.option('--name', prompt='Your name', help='The person to greet.') def hello(count, name): """Simple program that greets NAME for a total of COUNT times.""" for x in range(count): cli...
{ "content_hash": "b4541c06acfdfc93090684b15bc8be21", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 18.476190476190474, "alnum_prop": 0.5979381443298969, "repo_name": "jdurbin/sandbox", "id": "8e46123694c3d7e4a290389f08a1b4828c187b80", "size": "412"...
from keras.models import Sequential, Graph from keras.objectives import mse from keras.layers.core import Dropout, Dense import numpy as np import theano import seaborn def create_models( n_dims=25, dropout_probability=0.1, adversarial_weight=1, reconstruction_weight=1, genera...
{ "content_hash": "e9595585d13d594c7b56b73e970f1006", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 108, "avg_line_length": 35.87763713080169, "alnum_prop": 0.5660355168763965, "repo_name": "iskandr/adversarial-impute", "id": "4e58177bc06604bda5f9da373a79f1c11ab95e38", "...
""" """ from . import core, geometry, string, misc # noqa execute = core.OdhQLFunction.execute create = core.OdhQLFunction.create
{ "content_hash": "45eb9653bbd312e574733f169d8bebfa", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 50, "avg_line_length": 19, "alnum_prop": 0.7218045112781954, "repo_name": "hsr-ba-fs15-dat/opendatahub", "id": "6c49c0be25fcaa793982bb78189e2b0ba8a9fe43", "size": "133", "...
import sys import glob import os from setuptools import setup, find_packages package_data_list = list() for root, dirs, files in os.walk('hoggle/project_templates'): dir_path = root dir_list = dir_path.split('/') del dir_list[0] dir_path = "/".join(dir_list) for f in files: package_data...
{ "content_hash": "4afc1777747a71db57bfa4c13613fabf", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 71, "avg_line_length": 22.6046511627907, "alnum_prop": 0.6090534979423868, "repo_name": "sirvaliance/hoggle", "id": "f43dd34d6696cf8b45d3a3fd794f22a539202c99", "size": "972...
from django.apps import AppConfig class SiteSettingsConfig(AppConfig): name = 'texaslan.site_settings' verbose_name = "Site Settings" def ready(self): """Override this to put in: """ pass
{ "content_hash": "a9ac98ebfba0db2c848c70c82044bdda", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 36, "avg_line_length": 20.636363636363637, "alnum_prop": 0.6299559471365639, "repo_name": "TexasLAN/texaslan.org", "id": "d54b7794cf5f93d77a4201d93a2f351f6d136fd5", "size":...
import fixtures import mock import webob from nova.api.openstack.compute import multinic as multinic_v21 from nova import compute from nova import exception from nova import objects from nova import test from nova.tests.unit.api.openstack import fakes from nova.tests.unit import fake_instance UUID = '70f6db34-de8d-4...
{ "content_hash": "b1472d894ad63dbb3ace05c56742c3c9", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 78, "avg_line_length": 37.903225806451616, "alnum_prop": 0.6257021276595744, "repo_name": "klmitch/nova", "id": "ceaaebf37336eef08b7062528b7e9a1f89cf805e", "size": "6511",...
import comtypes.client, ctypes ################################################################ # Interfaces class IClassFactory(comtypes.IUnknown): _iid_ = comtypes.GUID("{00000001-0000-0000-C000-000000000046}") _methods_ = [ comtypes.STDMETHOD(comtypes.HRESULT, "CreateInstance", ...
{ "content_hash": "c9fc1a4d83272a4c7bf768082e27c1a0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 84, "avg_line_length": 39.54838709677419, "alnum_prop": 0.5848287112561175, "repo_name": "ezarko/cfn-init", "id": "01393b6a4bbe7c6ca9019f0464387807b964fd2f", "size": "2452"...
""" WSGI config for inventory project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SE...
{ "content_hash": "dbab686db3c29a164965fc3946f79a1d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.75, "alnum_prop": 0.7727272727272727, "repo_name": "NdagiStanley/inventory", "id": "7242ab434435ba916b0017e024f8348cf4dd2175", "size": "396", "b...
class SearchClient(object): """ Low-level interface to Camlistore indexer search operations. The indexer component visits all blobs in the store and infers connections between them based on its knowledge of certain schema formats. In particular, the indexer is responsible for tracking all of t...
{ "content_hash": "efd89662d9df3ae6010309e7788aac81", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 79, "avg_line_length": 31.47462686567164, "alnum_prop": 0.5919954476479514, "repo_name": "apparentlymart/python-camlistore", "id": "88a22cdcf07d5bc0869c01c1a90ec33df259868b"...
__author__ = 'cpaulson' import pyKriging from pyKriging.krige import kriging from pyKriging.samplingplan import samplingplan # The Kriging model starts by defining a sampling plan, we use an optimal Latin Hypercube here sp = samplingplan(2) X = sp.optimallhc(15) # Next, we define the problem we would like to solve te...
{ "content_hash": "a2472aabef39e1b163458ab8eddf251d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 94, "avg_line_length": 28.176470588235293, "alnum_prop": 0.7254697286012526, "repo_name": "DailyActie/Surrogate-Model", "id": "dfad144a290594a08fff08bffaedc4a12e43b65e", "s...
from __future__ import absolute_import, unicode_literals from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import permissions from rest_framework import renderers from rest_framework import viewsets from rest_framework.decorators import detail_route from res...
{ "content_hash": "dfc99ebd4c5a8f7c1686c366c5d38eb4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 34.8, "alnum_prop": 0.7503192848020435, "repo_name": "yrchen/CommonRepo", "id": "a33462ec239a686d6b2461c8b0f41835a48a4b8d", "size": "1590", "binary...
""" test__offline """ from __future__ import absolute_import import re import json as _json from unittest import TestCase import pytest import plotly from plotly import optional_imports matplotlylib = optional_imports.get_module("plotly.matplotlylib") if matplotlylib: import matplotlib # Force matplotlib ...
{ "content_hash": "68cf027fdab514103a82449cab3bd7b9", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 83, "avg_line_length": 29.329896907216494, "alnum_prop": 0.5859402460456942, "repo_name": "plotly/python-api", "id": "d36934d1eae317b3b12c5b080a78b38be2cd250e", "size": "28...
import os from contextlib import contextmanager from collections import defaultdict import importlib.util from veros import logger, runtime_settings, runtime_state, timer from veros.state import get_default_state, resize_dimension from veros.variables import get_shape # all variables that are re-named or unique to V...
{ "content_hash": "e1bf7ba9bcc7aee65f5caab03495132d", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 117, "avg_line_length": 30.017110266159698, "alnum_prop": 0.5556400025334093, "repo_name": "dionhaefner/veros", "id": "f3ce3cc3e73a3ecedf9f039f4682bbbfd8086ca6", "size": "...
""" Service unit testing best practice, with an alternative dependency. """ import pytest from sqlalchemy import Column, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from nameko.rpc import rpc from nameko.testing.services import worker_...
{ "content_hash": "bc78a28e34b58fc3e17f2776822d8f5e", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 24.214285714285715, "alnum_prop": 0.6969026548672567, "repo_name": "Alecto3-D/testable-greeter", "id": "da8d951427c3fa54384e1b42bcffa566b74d056f", "s...
import string from datetime import timedelta, datetime import csv import os import shutil import pickle # math import numpy as np from scipy.sparse import * # mabed import mabed.utils as utils __authors__ = "Adrien Guille, Nicolas Dugué" __email__ = "[email protected]" class Corpus: def __init__(sel...
{ "content_hash": "83b9d46ae7c052698a690adae50363a8", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 139, "avg_line_length": 45.3875, "alnum_prop": 0.5414486367391903, "repo_name": "AdrienGuille/pyMABED", "id": "f9638c67e71f6f3fe552ecdc65c662487626ab10", "size": "7286", ...
import os from twilio.rest import Client # To set up environmental variables, see http://twil.io/secure ACCOUNT_SID = os.environ['TWILIO_ACCOUNT_SID'] AUTH_TOKEN = os.environ['TWILIO_AUTH_TOKEN'] client = Client(ACCOUNT_SID, AUTH_TOKEN) notification = client.notify.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \ ...
{ "content_hash": "66883553b03de5eea2269e5ec680b718", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 35.666666666666664, "alnum_prop": 0.7420560747663552, "repo_name": "TwilioDevEd/api-snippets", "id": "39f91f6c214e363313648c6ada649149dd4184ce", "siz...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
{ "content_hash": "c1d89d2e6d333e69018f9d95311953c2", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 208, "avg_line_length": 42.70038910505836, "alnum_prop": 0.5644250045562238, "repo_name": "K4zuki/mbed", "id": "d6746ccc4b981a4bae16bd2155ea541d1fb1fa3c", "size": "10974",...
import threading import weakref from django.utils.inspect import func_accepts_kwargs def _make_id(target): if hasattr(target, '__func__'): return (id(target.__self__), id(target.__func__)) return id(target) NONE_ID = _make_id(None) # A marker for caching NO_RECEIVERS = object() class Signal: ...
{ "content_hash": "51d4012dc82b9476777dd95c9be40d43", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 94, "avg_line_length": 36.72108843537415, "alnum_prop": 0.5808632826972953, "repo_name": "reinout/django", "id": "6488c7fbd4516323b1faea40a0f115c06a17f25a", "size": "10796...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HMM4_if_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HMM4_if_ConnectedLHS. """ # Flag ...
{ "content_hash": "bb791d639bf254534ab04ae1f08aaff5", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 125, "avg_line_length": 43.19672131147541, "alnum_prop": 0.4713472485768501, "repo_name": "levilucio/SyVOLT", "id": "6f8b1077c1d224d0987fd24bee26e9416c8271d6", "size": "263...
import logging from datetime import timedelta, datetime from core.errors import ObservableValidationError from core.feed import Feed from core.observables import File, Hash, Hostname class HybridAnalysis(Feed): default_values = { "frequency": timedelta(minutes=5), "name": "HybridAnalysis", ...
{ "content_hash": "302c52a8257143c13597d847bdf78674", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 86, "avg_line_length": 34.5, "alnum_prop": 0.5421130014702793, "repo_name": "yeti-platform/yeti", "id": "7351ba911d6421dd3e7eaeb617f6a6a21db85388", "size": "4761", "bina...
class JSONResponse(HttpResponse): """ Return a JSON serialized HTTP resonse """ def __init__(self, request, data, status = 200): serialized = json.dumps(data) super(JSONResponse, self).__init__( content = serialized, content_type = 'application/json', ...
{ "content_hash": "59d8683cae6533d2d328dc42d6d25571", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 155, "avg_line_length": 41.55744680851064, "alnum_prop": 0.5212471841081302, "repo_name": "Makeystreet/makeystreet", "id": "966f47918a4747a7fe5cf02cae8c9718e7b05083", "siz...
"""Script for Expedia Hotel Recommendations Kaggle competition. Particular verison is based on Dataquest tutorial by Vik Paruchuri <https://www.dataquest.io/blog/kaggle-tutorial/> Main idea here lies in fiding most popular hotel clusters in the training data for all the data and for each particular `destination id`. A...
{ "content_hash": "46718a438fc1e997f5cc2eb273f419e1", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 96, "avg_line_length": 31.093333333333334, "alnum_prop": 0.5901943967981704, "repo_name": "ppik/playdata", "id": "f846a9c0f5e336e656dcc5378391b59fc698af6f", "size": "7018"...
import sys, glob from optparse import OptionParser parser = OptionParser() parser.add_option('--genpydir', type='string', dest='genpydir', default='gen-py') options, args = parser.parse_args() del sys.argv[1:] # clean up hack so unittest doesn't complain sys.path.insert(0, options.genpydir) sys.path.insert(0, glob.glob...
{ "content_hash": "a6f45b2902a0f837d4666f92541999f4", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 84, "avg_line_length": 30.529411764705884, "alnum_prop": 0.6088631984585742, "repo_name": "chentao/thrift", "id": "55e4996e87e52a62f43b573c1779bb124ec275f4", "size": "2885"...
from __future__ import print_function # ============================================================================= # DOCS # ============================================================================= __doc__ = """Make band merges difference and union.""" __version__ = "0.0.2" # ==============================...
{ "content_hash": "99414f7e33626389722f9e648cbc66dc", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 79, "avg_line_length": 29.790419161676645, "alnum_prop": 0.4958793969849246, "repo_name": "carpyncho/bmdiff", "id": "9baeb2b11b2dd8f7e04860c47ae5cd6e2fd45bab", "size": "50...
import re from oslib import osinit, OSLibError import subprocess import time from oslib.mime_utils import MimeMessage, URL import oslib.getuser as getuser import os import os.path from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType from boto.ec2.networkinterface import NetworkInterfaceSpecificat...
{ "content_hash": "30fc2224242af516540d2021cd14d94e", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 213, "avg_line_length": 40.361702127659576, "alnum_prop": 0.5952161307327359, "repo_name": "fbacchella/oscmd", "id": "20cb660f354ba891db90dc6c3e95ba64e18997b2", "size": "1...
import uuid import mock import mox from oslo_config import cfg from oslo_messaging.rpc import dispatcher from oslo_serialization import jsonutils as json import six from heat.common import context from heat.common import environment_util as env_util from heat.common import exception from heat.common import identifier...
{ "content_hash": "c4445d1fa58a0f332ffde941728f3eb2", "timestamp": "", "source": "github", "line_count": 1460, "max_line_length": 79, "avg_line_length": 43.50205479452055, "alnum_prop": 0.5138475587674964, "repo_name": "cwolferh/heat-scratch", "id": "e8b1b9938a24cbde45074a2efe4b76a4ed002e65", "size"...
"""Combine multiple one-epoch results files into one all-epoch result file Take multiple file paths as command line arguments Use last file path argument as the output file path Warn user if the input files are not exactly every epoch file required Warn user if the output file already exists .. moduleauthor:: Jan Van...
{ "content_hash": "058817b4cf0361b1b67fa5a02c902a37", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 79, "avg_line_length": 34.76, "alnum_prop": 0.6766398158803222, "repo_name": "jvanbrug/netflix", "id": "69566d9451bd13ca1bcef39f5124fbc5cb5efa56", "size": "1738", "binary...
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 0.3, s, t 0.6, s, t 1, s, q" tags = "skeleton, BitmapSkin, Animate" import cPickle import cocos from cocos.director import director from cocos.sprite import Sprite from cocos import skeleton import pyglet impor...
{ "content_hash": "e83e6adcd56b110e268437002cb8cacc", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 70, "avg_line_length": 26.227272727272727, "alnum_prop": 0.6256499133448874, "repo_name": "eevee/cocos2d-mirror", "id": "1b9e4336466f2a683299d8ea3af29d142742b55f", "size": ...
from cmspwn.module import pwnfunc @pwnfunc def is_ampcms(cmspwn, response): if 'AMP'.lower() in response.headers.get('set-cookie').split('=')[0].lower(): cmspwn.found = True; cmspwn.Framework = 'AMPCMS'; cmspwn.site = 'http://www.ampcms.org' return
{ "content_hash": "b27f93f9c7ee75077610edb8d79b7b65", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 95, "avg_line_length": 38.42857142857143, "alnum_prop": 0.6654275092936803, "repo_name": "kenjoe41/cmspwn", "id": "033930af6872e1b0856dbef5c31db94c6ef2296c", "size": "353", ...
""" This file contains code for working on lists and dictionaries. """ def moreThanOne(dict, key): """ Checks if a key in a dictionary has a value more than one. Arguments: dict -- the dictionary key -- the key Returns: True if the key exists in the dictionary and the value is at least one, otherwise...
{ "content_hash": "6955552e59386c237f5e95d7bdc6e75a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 89, "avg_line_length": 23.270833333333332, "alnum_prop": 0.675022381378693, "repo_name": "ephracis/hermes", "id": "0b1e6124caea059ee318fbbc33482073caf518f0", "size": "1117"...
""" Player (OOC) commands. These are stored on the Player object and self.caller is thus always a Player, not an Object/Character. These commands go in the PlayerCmdset and are accessible also when puppeting a Character (although with lower priority) These commands use the player_caller property which tells the comma...
{ "content_hash": "b602183c59d920c69bba2ade3ab597c0", "timestamp": "", "source": "github", "line_count": 766, "max_line_length": 138, "avg_line_length": 36.18798955613577, "alnum_prop": 0.5575036075036075, "repo_name": "ergodicbreak/evennia", "id": "e1b3ae31f2b72f560b2bc9ce7b87f0df0b98973f", "size":...
"""Test CLR <-> Python type conversions.""" import operator import pytest import System from Python.Test import ConversionTest, UnicodeString from Python.Runtime import PyObjectConversions from Python.Runtime.Codecs import RawProxyEncoder def test_bool_conversion(): """Test bool conversion.""" ob = Conversi...
{ "content_hash": "115015a73e7b74271f347be78d390668", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 99, "avg_line_length": 25.62533692722372, "alnum_prop": 0.671242242558115, "repo_name": "AlexCatarino/pythonnet", "id": "f8b67d3eb05ff38544e25424981f89dbf3ab9a83", "size":...
from __future__ import unicode_literals # coding: utf-8 # Use Gzipped files without extractionpyp import shutil import logging import datetime import os # operation system packages import ConfigParser as configparser # a package to parse INI file or confige file. import argparse # a package to parse commandline...
{ "content_hash": "7ec3fd19297705d1c2aff741b2c676b0", "timestamp": "", "source": "github", "line_count": 1057, "max_line_length": 130, "avg_line_length": 34.13907284768212, "alnum_prop": 0.5391436885132327, "repo_name": "Attayeb/qanaus", "id": "eb102fea6ac54a2dae0d182a8a3b4914dafe2d0d", "size": "361...
import pandas as pd from unittest.mock import patch, ANY from cartoframes.data.observatory.catalog.entity import CatalogList from cartoframes.data.observatory.catalog.variable import Variable from cartoframes.data.observatory.catalog.repository.variable_repo import VariableRepository from cartoframes.data.observatory...
{ "content_hash": "fd39c4e31dd290e29b113c7bfe233ede", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 111, "avg_line_length": 33.74752475247525, "alnum_prop": 0.6235880886020243, "repo_name": "CartoDB/cartoframes", "id": "15e5db28c52151127306c977d3c127aab5421836", "size": ...
import asyncio import pytest from sanic import Sanic from sanic.response import text from sanic.router import RouteExists, RouteDoesNotExist # ------------------------------------------------------------ # # UTF-8 # ------------------------------------------------------------ # def test_shorthand_routes_get(): ...
{ "content_hash": "7ee8e1904195a2c3b4be06147df8b76f", "timestamp": "", "source": "github", "line_count": 697, "max_line_length": 70, "avg_line_length": 26.24390243902439, "alnum_prop": 0.629400830964356, "repo_name": "jrocketfingers/sanic", "id": "b3e193550f73b24577b62bd99b157dbdf62fc63b", "size": "...
""" A spider that generate light requests to meassure QPS troughput usage: scrapy runspider qpsclient.py --loglevel=INFO --set RANDOMIZE_DOWNLOAD_DELAY=0 --set CONCURRENT_REQUESTS=50 -a qps=10 -a latency=0.3 """ from ants.spider import Spider from ants.http import Request class QPSSpider(Spider): name = ...
{ "content_hash": "7fe27a92487ca0baeb52c45aa2f075fd", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 136, "avg_line_length": 27.745454545454546, "alnum_prop": 0.5943643512450852, "repo_name": "wcong/ants", "id": "f399f7aa38285299a94de567adbf9fa214f42306", "size": "1526", ...
from numbers import Number import theano from theano import tensor as TT import numpy as np from . import origin class Input(object): """Inputs are objects that provide real-valued input to ensembles. Any callable can be used an input function. """ def __init__(self, name, values, zero_after_time=...
{ "content_hash": "43e5bb740be775b446d40f97e21c12e0", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 34.13793103448276, "alnum_prop": 0.5707070707070707, "repo_name": "ctn-waterloo/nengo_theano", "id": "9a98f7cd84aef1fa35658b0078c6b2c50c23d896", "siz...
''' Cardinal - An Open Source Cisco Wireless Access Point Controller MIT License Copyright © 2019 Cardinal Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, inclu...
{ "content_hash": "0ff08f6fb9c99e6b6378de266f0262a1", "timestamp": "", "source": "github", "line_count": 1009, "max_line_length": 554, "avg_line_length": 44.447968285431116, "alnum_prop": 0.6476097038886907, "repo_name": "falcon78921/Cardinal", "id": "3c350937fa6cc9463f87dde798cb7ef575a7bd83", "size...
"""Module to apply mutants at bytecode level""" import random import subprocess JUMP_OPCODES = ["je", "jne", "jl", "jle", "jg", "jge"] SHORT_JUMPS = list( map(bytes.fromhex, ["74", "75", "7C", "7D", "7E", "7F", "EB"])) # no unconditional for near jumps, since changes opcode length, not worth it NEAR_JUMPS = list( ...
{ "content_hash": "4331ae94202b17f8db11f91035fb726c", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 90, "avg_line_length": 35.56410256410256, "alnum_prop": 0.5671713530401346, "repo_name": "google/fuzzbench", "id": "e5e388a90a6dcb4630fe198c5c1f267e777d694e", "size": "473...
from __future__ import unicode_literals from django.db import migrations, models import django.contrib.gis.db.models.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Bin', fields=[ ('id', models...
{ "content_hash": "d8bb17455c73677b18339105908ba40c", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 180, "avg_line_length": 43.94871794871795, "alnum_prop": 0.5600933488914819, "repo_name": "sahilchinoy/ucpd-crime", "id": "c59509e063537f6a01602a2e72da243df9e6785f", "size"...
from sklearn_explain.tests.skl_datasets import skl_datasets_test as skltest skltest.test_class_dataset_and_model("BinaryClass_500" , "CalibratedClassifierCV_sigmoid_15")
{ "content_hash": "3cccfecacfbef705c708a24fa879565c", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 93, "avg_line_length": 43, "alnum_prop": 0.813953488372093, "repo_name": "antoinecarme/sklearn_explain", "id": "19e1f11b6e9b5ce4f1d6152d8416efa758316ab2", "size": "172", "...
"""Services for exploration-related statistics.""" from core.domain import exp_domain from core.domain import exp_services from core.domain import stats_domain from core.domain import stats_jobs_continuous from core.platform import models (stats_models,) = models.Registry.import_models([models.NAMES.statistics]) IMP...
{ "content_hash": "152888fc2420668e7b772d03d4666eee", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 79, "avg_line_length": 37.60621761658031, "alnum_prop": 0.6412234775420226, "repo_name": "anggorodewanto/oppia", "id": "4bfe86ae93f5c037508cb51d5ce73beba4b02b09", "size": ...
import numpy as np import sys import csv """This file is not well tested at this time, good chance it has bugs""" #Max number of iterations in the K-medoids algorithm K_MEDIODS_ITERATIONS = 100 #About how many teams will be in each cluster. Used to calculate the k of k-means APPROX_CLUSTER_SIZE = 2 #Numbe...
{ "content_hash": "95d619f8f3cd68a1dfe6b10253c6bb05", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 112, "avg_line_length": 33.774809160305345, "alnum_prop": 0.6789467736467397, "repo_name": "Hmc-cs-tdubno/C_Scores", "id": "d084ab034fa26de4fcf9d0f8676fb362c3d6d00a", "siz...
"""Converts an old version's data base to the recent format. The database of the rc-1 did not have a priority field. This script just adds this to all issues.""" import os import pickle ISSUE_FILE = '.issues' if __name__ == "__main__": with open(ISSUE_FILE,'r') as issues: DB = pickle.load(issues) ...
{ "content_hash": "bc0da7fc6ba6751c45fa7ba27d1d4009", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 67, "avg_line_length": 27.210526315789473, "alnum_prop": 0.6054158607350096, "repo_name": "dhesse/Git-Track", "id": "244982d0ad740400ad6877de63584fc9bfb8487b", "size": "539...
"""Compute the diffusion process from atom counts in two regions. The diffusion of atoms from one region to another is modelled as a first-order process. The flow rate of atoms is considered to be proportional to the difference of the number of atoms in the two regions. By using this script, the logarithm of the dif...
{ "content_hash": "a3fb47cfb9df49cbab7ef4998ce84880", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 78, "avg_line_length": 29.23931623931624, "alnum_prop": 0.6220403390821397, "repo_name": "tschijnmo/lammps_scripts", "id": "2b356b682e4b629d97ef6160fb321adb324de6c0", "siz...
''' Instructions: 1. Make sure you have Flask, Flask-Rauth, and SQLAlchemy installed. $ pip install Flask Flask-Rauth SQLAlchemy 2. Open a Python shell in this directory and execute the following: $ python >>> from tweet import init_db >>> init_db() >>> exit() This will initia...
{ "content_hash": "882cf293e15f8724ec101fb6160ec910", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 89, "avg_line_length": 30.52358490566038, "alnum_prop": 0.6773296244784422, "repo_name": "joelverhagen/flask-rauth", "id": "4568f8e6f5498f1dafcbce739b5866ade9fb629b", "siz...
from fabric import colors from fabric.api import env, local, cd, prefix, run, hide, sudo, settings from fabric.contrib.console import confirm REMOTE_WORKDIR = '' ACTIVATE = '' hostnames = { '52.78.100.214': 'oilboy', } def app(): global REMOTE_WORKDIR, ACTIVATE env.hosts = ['52.78.100.214'] env.use...
{ "content_hash": "ff450a218ffc115afde0963214e3a9dd", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 122, "avg_line_length": 31.102941176470587, "alnum_prop": 0.6198581560283688, "repo_name": "oilboy/oilboy", "id": "80a9ce856bc03c5b8920bc33b6fadd7f18826118", "size": "2134"...
from __future__ import absolute_import, division, print_function import operator import logging import numpy as np import pandas as pd from .contracts import contract from .coordinates import Coordinates from .visual import VisualAttributes from .visual import COLORS from .exceptions import IncompatibleAttribute fro...
{ "content_hash": "34923ad613da18181238a41ed7f23cfb", "timestamp": "", "source": "github", "line_count": 1154, "max_line_length": 97, "avg_line_length": 31.4367417677643, "alnum_prop": 0.5859474061414631, "repo_name": "JudoWill/glue", "id": "93169d126b47eeb71243f854f77737607a717b6c", "size": "36278"...