text stringlengths 4 1.02M | meta dict |
|---|---|
from EXOSIMS.StarCatalog.SIMBADCatalog import SIMBADCatalog
from EXOSIMS.util.get_dirs import get_cache_dir
import os
import inspect
class SIMBAD300Catalog(SIMBADCatalog):
"""SIMBAD300 Catalog class
This class populates the star catalog used in EXOSIMS from the SIMBAD300
catalog.
"""
... | {
"content_hash": "e465a78125bdd97c39409fc63bd39699",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 76,
"avg_line_length": 38.121212121212125,
"alnum_prop": 0.6335453100158982,
"repo_name": "dsavransky/EXOSIMS",
"id": "b2c5e2890380be1897917f4f181a5cf40f74f7f3",
"size": "1... |
NAME = "name"
TABLE = "table"
VALUE = "value"
FIELDS = "fields"
REPORT = "report"
KARYO = "karyotype"
KARYOTYPE_STRING = "KaryotypeString"
CONFIDENCE = "confidence"
VERSION = "algorithmVersion"
STARTSTOPS = "startStops"
KEY = "recordKey"
START = "startPosition"
STOP = "stopPosition"
ERR_STR = "errorString"
ERR_TYPE = "... | {
"content_hash": "bd346b83eed6f709fb35b8ad076594c3",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 41,
"avg_line_length": 25.175,
"alnum_prop": 0.7497517378351539,
"repo_name": "esilgard/argos_nlp",
"id": "70cbc950f8c46771dea9243e573d3d6f380dfde5",
"size": "1068",
"bin... |
import os,random
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras.backend as K
from gan_model import generator_model,discriminator_model
K.set_image_dim_ordering('th')
#os.environ["THEANO_FLAGS"] = "device=gpu%d,lib.cnmem=0"%(random.randint(0,3))
import numpy as np
import theano as th
import theano.tensor as T
... | {
"content_hash": "318dbd7b9b06497454808de2e7b9765b",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 96,
"avg_line_length": 31.205882352941178,
"alnum_prop": 0.6740271980611283,
"repo_name": "andrewv587/pycharm-project",
"id": "c3d521228ce604dee5323926f2783eee738b316e",
"... |
import masterPlugin
import MatrixUtils
## Wrapper for MatrixUtils.initialize()
class init(masterPlugin.masterPlugin):
def __init__(this):
super().__init__()
this.command = "init"
this.aliases = None
this.commandInfo = {'requiredArguments': [[0, int, 'with'],
[1, i... | {
"content_hash": "b76c2e9a1050f529e2f8a46a5e26f54d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 80,
"avg_line_length": 32.523809523809526,
"alnum_prop": 0.5724743777452416,
"repo_name": "charlesdaniels/hercm",
"id": "52232eb02ac7df5ae879d39aea0fcd1110a42d79",
"size": ... |
"""
"""
import cv2
import numpy as np
from argparse import ArgumentParser
from simplejson import load
from os import system
from datetime import datetime, date, timedelta
try:
from urllib.request import Request, urlopen # Python 3
except ImportError:
from urllib2 import Request, urlopen # Python 2
__cloudc... | {
"content_hash": "392ac3381fbdf14e8ad19f2ccfa6a2c0",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 34.96825396825397,
"alnum_prop": 0.5907852927825692,
"repo_name": "hackforthesea/SatelitoVido",
"id": "66cf2728e7d490d781e3ea6b68774173bf30f74c",
"s... |
"""
GDAL - Constant definitions
"""
from ctypes import (
c_double, c_float, c_int16, c_int32, c_ubyte, c_uint16, c_uint32,
)
# See https://gdal.org/api/raster_c_api.html#_CPPv412GDALDataType
GDAL_PIXEL_TYPES = {
0: 'GDT_Unknown', # Unknown or unspecified type
1: 'GDT_Byte', # Eight bit unsigned integer
... | {
"content_hash": "8cc40605638a70ddf347a2db9229452b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 77,
"avg_line_length": 37.86842105263158,
"alnum_prop": 0.6678248783877693,
"repo_name": "koordinates/django",
"id": "2ac3872c98b616a86ec63fc6e79b6a73197ecfb0",
"size": "28... |
"""
WSGI config for WeddingAssist 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WeddingAssist.settings")
from d... | {
"content_hash": "4d177c7da5c63d9ed4eb376185b57d23",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 28.642857142857142,
"alnum_prop": 0.7805486284289277,
"repo_name": "cjworld/WeddingAssist",
"id": "65c2c580cb827d1b59629651ef2568d0b6f233d2",
"size":... |
"""
Slider Cutoff
=============
This example shows how to bind a variable parameter to a slider, and how to use the corresponding bound value to color data points. This example is based on an example from the Altair 4 documentation for Interactions, in which the interactivity was accomplished using a selection. The ... | {
"content_hash": "e4ff776c33da3f90bd820970bcb5d76b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 421,
"avg_line_length": 32,
"alnum_prop": 0.7041666666666667,
"repo_name": "altair-viz/altair",
"id": "19db7749396cf26bfb33e41933058f92c0487bcd",
"size": "960",
"binary":... |
from oslo_log import log as logging
from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources import signal_responder
from heat.engine import support
from heat.scaling import scal... | {
"content_hash": "90854fb218d381c45dcfb87feea396f2",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 79,
"avg_line_length": 38.22282608695652,
"alnum_prop": 0.586378501350775,
"repo_name": "openstack/heat",
"id": "8ca88275f33f9306c0110c9561d7ffda4b161484",
"size": "7608",... |
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict, Set
import voluptuous as vol
from homeassistant import core, config as conf_util, c... | {
"content_hash": "d37e876bbc54187bd65605031bd9555e",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 89,
"avg_line_length": 33.5,
"alnum_prop": 0.6421737466513586,
"repo_name": "qedi-r/home-assistant",
"id": "312c739cd7203494150ce4a60f8f18c2190ed6d2",
"size": "13065",
"... |
from __future__ import division, print_function, absolute_import
import numpy as np
class LeastSquaresMixin(object):
"""Mixin for matrix-based Least Squares periodic analysis"""
def _construct_X(self, omega, weighted=True, **kwargs):
raise NotImplementedError()
def _construct_y(self, weighted=Tr... | {
"content_hash": "319ae4d14788f750ad04d5126614ef88",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 79,
"avg_line_length": 33.94117647058823,
"alnum_prop": 0.5691507798960138,
"repo_name": "nhuntwalker/gatspy",
"id": "6fca0b4bab5f9b896b0167cd85eabddaec9c6f0b",
"size": "28... |
"""MyOffers URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views... | {
"content_hash": "8a23fe22be3769ef27a8449db77ff89a",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 96,
"avg_line_length": 51.205882352941174,
"alnum_prop": 0.7122343480758185,
"repo_name": "amitdhiman000/dais",
"id": "98e71251763436abd354db84e11339abb0560598",
"size": "1... |
from .environment import Environment
from .learner import EpisodicLearnerMixin
from .value_function import ValueFunction
from .mdp import MDP, FixedGameMDP, GameMDP
| {
"content_hash": "2e4579b502f76d6a5381e083cc78e85f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 43,
"avg_line_length": 41.25,
"alnum_prop": 0.8484848484848485,
"repo_name": "davidrobles/mlnd-capstone-code",
"id": "1a7e653b6a58a21c90478457766c2ab3ea966a0f",
"size": "165... |
import argparse
import tables as tb
import pylab as pl
from psi.controller.calibration import util
if __name__ == '__main__':
desc = 'Convert to speaker calibration'
parser = argparse.ArgumentParser(description=desc)
parser.add_argument('filename', type=str, help='filename')
parser.add_argument('smoo... | {
"content_hash": "90e60c3aa012d7c13a10056d9add6f93",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.6002076843198338,
"repo_name": "bburan/psiexperiment",
"id": "76ca35032b8a3e7f0036802fac00394d330dc420",
"size": ... |
'''
Master Reborn Add-on
Copyright (C) 2017 Master Reborn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versio... | {
"content_hash": "7a1421854ac5cfd16a0b0c4d57df4580",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 140,
"avg_line_length": 33.98684210526316,
"alnum_prop": 0.5439411536972513,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "e9e99311403c09f1f573fac0dba94aeaf7d4b081",
... |
import logging
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from dojo.filters import TestTypeFilter
from dojo.forms import Test_TypeForm... | {
"content_hash": "4f265e580cee8f258efcad4c1dacda76",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 76,
"avg_line_length": 34.225,
"alnum_prop": 0.6081081081081081,
"repo_name": "OWASP/django-DefectDojo",
"id": "cc87333f5fc264cbf06700d6de7141555d2d3028",
"size": "2753",
... |
import uuid
import unittest
try:
from unittest import mock
except ImportError:
# noinspection PyUnresolvedReferences
import mock
# As these are unit tests, we do not need the full broker capability,
# we can thus mock the DbFactory in order for it not to try and open
# the database (which is not require... | {
"content_hash": "890a0c6e7c581956c85d58d9646697b1",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 46.794520547945204,
"alnum_prop": 0.6487119437939111,
"repo_name": "quattor/aquilon",
"id": "682fff28a20d8d5b6e6de1267418dcd248f2149e",
"size": "4099... |
import sys
sys.path.insert(1, "../../../")
import h2o, tests
def link_functions_tweedie_basic(ip,port):
print "Read in prostate data."
hdf = h2o.upload_file(h2o.locate("smalldata/prostate/prostate_complete.csv.zip"))
print "Testing for family: TWEEDIE"
print "Set variables for h2o."
y =... | {
"content_hash": "9a16e8ada585d77f7193ff0f391668ee",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 124,
"avg_line_length": 37.206896551724135,
"alnum_prop": 0.6320667284522706,
"repo_name": "bospetersen/h2o-3",
"id": "8b00ffeb5e5a11d6ea61d8fb74490e6e483f517a",
"size": "1... |
import numpy
class BiExponentialParameters(object):
def __init__(self, tau1, tau2): # , amplitude, baseline):
assert (tau1 > 0)
assert (tau2 > 0)
# assert (tau2 > tau1)
self._tau1 = tau1
self._tau2 = tau2
self._amplitude = 1.
self._baseline = 0
# se... | {
"content_hash": "2ec30d50d4e3ab017a7d56d8d067ed61",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 89,
"avg_line_length": 27.047619047619047,
"alnum_prop": 0.5134976525821596,
"repo_name": "samuroi/SamuROI",
"id": "bf12be1aca8c85a8f18338786900033a62a6dbd5",
"size": "1706... |
"""Tools for working with groups
This provides several functions to work with groups and a Group class that
keeps track of the different representations and has methods to work more
easily with groups.
Author: Josef Perktold,
Author: Nathaniel Smith, recipe for sparse_dummies on scipy user mailing list
Created on T... | {
"content_hash": "42c9bb9c5a8dd9c82ac451b554e4a58a",
"timestamp": "",
"source": "github",
"line_count": 657,
"max_line_length": 79,
"avg_line_length": 34.207001522070016,
"alnum_prop": 0.551570703924535,
"repo_name": "ChadFulton/statsmodels",
"id": "110e9dc461b81e3657ca786684f8f45b02e9db4f",
"size"... |
import os
from setuptools import setup
if __name__ == "__main__":
import scatterbrane
setup(
name="scatterbrane",
version = "0.1.0",
packages = ["scatterbrane"],
author = "Katherine Rosenfeld",
author_email = "[email protected]",
description = ("A python module t... | {
"content_hash": "f01feb972a8f841c518e29b4cd10d557",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 90,
"avg_line_length": 31,
"alnum_prop": 0.5826612903225806,
"repo_name": "krosenfeld/scatterbrane",
"id": "5e04c050afda6cdd6dc71b90308bde788d22d9f7",
"size": "496",
"bin... |
"""Weapon.py: Contains all weapon classes. Each class controls behavior for a specific weapon."""
__author__ = "Scott Munro"
__copyright__ = "Copyright 2015"
import bullet
import game_constants
class Weapon(object):
def fire(self):
raise Exception("Must implement 'Fire' method")
def reload(se... | {
"content_hash": "4280428926f71a7029326e5cb0f893a2",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 97,
"avg_line_length": 23.82857142857143,
"alnum_prop": 0.6294964028776978,
"repo_name": "scottnm/itchnscratch",
"id": "98344d083cea59d5e7a1792ce45e2ec6f9d89e77",
"size": "... |
"""
Support for Vanderbilt (formerly Siemens) SPC alarm systems.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/spc/
"""
import logging
import asyncio
import json
from urllib.parse import urljoin
import aiohttp
import async_timeout
import voluptuous as ... | {
"content_hash": "6140c4432d44765161307434bf8107d9",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 76,
"avg_line_length": 33.169611307420496,
"alnum_prop": 0.5811228294449771,
"repo_name": "ewandor/home-assistant",
"id": "c186559c91a4c4758b52f0ecac6ff6a54534de7a",
"size... |
from __future__ import unicode_literals, division
from datetime import date
import uuid
from django.db import models
from django.core.exceptions import ValidationError
from django.dispatch import receiver
from django.db.models.signals import pre_save
from ..users.models import User
from ..reviews.models import Wine, ... | {
"content_hash": "f856b19e3db4d706e501674acb7eaa6f",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 95,
"avg_line_length": 35.64556962025316,
"alnum_prop": 0.6598011363636364,
"repo_name": "REBradley/WineArb",
"id": "875cbd75f847beab942755c52fffddbbff40047a",
"size": "281... |
"""
The following code is used to convert bytes to be human readable.
It was found on the Internet...
"""
import math
import string
import sys
import inspect
import zipfile
import tarfile
import logging
if sys.version_info >= (3, 0):
long = int
class human_readable(long):
"""
define a human_readable cla... | {
"content_hash": "d3fdbf0fb4c4fb8c6161023d1a20ebc4",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 103,
"avg_line_length": 35.52542372881356,
"alnum_prop": 0.5403148854961832,
"repo_name": "bedaes/burp-ui",
"id": "eadd38956e9d45e3220888abc2fb00292acb6310",
"size": "4216... |
from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import Table
from melange.db.sqlalchemy.migrate_repo.schema import String
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
ip_blocks = Table('ip_blocks', meta, autoload=True)
n... | {
"content_hash": "115cf3d028b71f1873af2f289c3e429f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 60,
"avg_line_length": 27.136363636363637,
"alnum_prop": 0.7269681742043551,
"repo_name": "rackerlabs/melange",
"id": "bb3d3ca42da39eee2c396a2cebee7c93b0cdac1b",
"size": "1... |
from Player import Player
class Game:
def __init__(self):
self.timebank = 0
self.timePerMove = 0
self.enemy = Player()
self.me = Player()
self.piece = None
self.piecePosition = None
self.nextPiece = None
self.round = 0
| {
"content_hash": "91189fdc61291126b6f406721b3d2e02",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 33,
"avg_line_length": 19.25,
"alnum_prop": 0.5162337662337663,
"repo_name": "Dduvacher/TetrisBot",
"id": "43fad589fe6b9f19d0033442c6ad501d154c91f3",
"size": "308",
"bina... |
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import models
from django.contrib.auth.models import User
from django.utils.html import format_html
from django.conf import settings
from django.db.models.signals import post_save, post_delete, pre_delete
from django.dispatch import r... | {
"content_hash": "02e32eff13f9168c69694f6e6fa595b3",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 88,
"avg_line_length": 31.45614035087719,
"alnum_prop": 0.6787506971556051,
"repo_name": "Azarn/mytodo",
"id": "abfefc1bbabf58eadbe79ca5bbbd7656eb39cb7f",
"size": "3586",
... |
__author__ = 'Matt Delaney'
import sys
import rospy
from std_msgs.msg import Int64, Int32
sys.path.append("/home/pi/ROSta-Bot/src/transporter/src")
from transport_drive_motor_API import *
from state_machine import *
from driving_interface.msg import position
# This is a simple 3-state machine. It moves the robot to a... | {
"content_hash": "0f6c3dbd937e951ac4446fbf87b5b4ae",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 130,
"avg_line_length": 46.373831775700936,
"alnum_prop": 0.6823861346231358,
"repo_name": "MarsRobotics/ROSta-Bot",
"id": "b680ba9eec1947fc3fc6e3681452479b7db35f38",
"siz... |
import sys
from itertools import chain
from django import forms
from django.conf import settings
from django.db.models.query import QuerySet
from django.utils.encoding import force_text
from django.utils.html import conditional_escape, escape
from django.utils.safestring import mark_safe
try:
from django.forms.uti... | {
"content_hash": "f46f48408d2c92d65db7ceccaf7253d1",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 103,
"avg_line_length": 40.26589595375722,
"alnum_prop": 0.5898650588573069,
"repo_name": "svleeuwen/sortedm2m-filter-horizontal-widget",
"id": "d722f5d8f30ef79a33471b11639a... |
"""The implementation of `tf.data.Dataset.unique`."""
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.util import nest
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import gen_experimental_dataset_ops
def _unique(self, name): # pylint: disable=unused-privat... | {
"content_hash": "ec7e0ec03d905e19bcae2bb44ef3b3af",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 80,
"avg_line_length": 43.142857142857146,
"alnum_prop": 0.7077814569536424,
"repo_name": "yongtang/tensorflow",
"id": "2184254139f711bc2a7d848508fcb295a07a9e2c",
"size": "... |
import tinysegmenter
from . import base
import testable
class Tzer(base.Tzer):
'''A wrapper for the TinySegmenter tokenizer for Japanese. e.g.:
>>> Tzer(1).tokenize(base.T_JP) == base.T_JP_TOKS
True'''
def __init__(self, ngram):
base.Tzer.__init__(self, ngram)
self.seg = tinysegmenter... | {
"content_hash": "ac2dae8715a0db1fca8acb3e40f69069",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 67,
"avg_line_length": 21.61904761904762,
"alnum_prop": 0.6475770925110133,
"repo_name": "casmlab/quac",
"id": "87bd56fd0cde24c65455890f04d24124553ed07c",
"size": "518",
... |
from tornado.httpclient import AsyncHTTPClient
from tornado.concurrent import Future
from tornado import gen
from util import stop_loop, start_loop
@gen.coroutine
def fetch_coroutine(url):
http_client = AsyncHTTPClient()
response = yield http_client.fetch(url)
raise gen.Return(response)
def fetch_corout... | {
"content_hash": "bfb6848e1c1643117ff058511aa40e3c",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 26,
"alnum_prop": 0.7156593406593407,
"repo_name": "zhyq0826/tornado-asyn",
"id": "9f83994d3afb32e4d2255607db76431a62447c1d",
"size": "780",
"binar... |
"""Python bindings for creating and serving the Reverb ReverbService.
See ./client.py and ./tf_client.py for details of how to interact with the
service.
"""
from __future__ import annotations
import abc
import collections
from typing import Optional, Sequence
from absl import logging
import portpicker
from reverb ... | {
"content_hash": "892e751f28861531c064945d2a49c956",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 80,
"avg_line_length": 38.87267904509284,
"alnum_prop": 0.6841351074718526,
"repo_name": "deepmind/reverb",
"id": "28a474b1552c4d119335ef9cd3698921bdecd707",
"size": "1525... |
"""
Nevow support for lore. DEPRECATED.
Don't use this module, it will be removed in the release of Twisted
after 2.3. If you want static templating with Nevow, instantiate a
rend.Page() and call renderString (or renderSynchronously) yourself.
Do something like::
lore -inevow --config pageclass=some.module.SomePag... | {
"content_hash": "94ea712326cc6c0dcd2b9eebb399206e",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 106,
"avg_line_length": 30.233644859813083,
"alnum_prop": 0.6460587326120556,
"repo_name": "hortonworks/hortonworks-sandbox",
"id": "a30ea1a6a72cc4b125948090f1723c933005c89d... |
'''
./tdd_suite.py test; red_green_bar.py $? $COLUMNS
'''
import sys
import unittest
class TestSimpleExample(unittest.TestCase):
def test_simple_example(self):
'''
TestSimpleExample:
'''
self.assertEqual(0, 1)
fast_test_ls = [
TestSimpleExample,
]
slow_test_ls = [
... | {
"content_hash": "ad9722eff39f65b4776909fc71f71170",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 73,
"avg_line_length": 19.616666666666667,
"alnum_prop": 0.637213254035684,
"repo_name": "kwadrat/rgb_tdd",
"id": "7b01ddf7038dedb44879a2f9847d2a14e3762426",
"size": "1225"... |
"""Utility methods for evaluation of trained models."""
from typing import Sequence, Tuple
import jax
import jax.numpy as jnp
from jax_cfd.data import xarray_utils as xr_utils
import numpy as np
import xarray
# pytype complains about valid operations with xarray (e.g., see b/153704639),
# so it isn't worth the troubl... | {
"content_hash": "51b7ea753189ab8665d36aa048e3e3ca",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 115,
"avg_line_length": 38.94769230769231,
"alnum_prop": 0.666218991941855,
"repo_name": "google/jax-cfd",
"id": "a4a2925ff0306b14485d190dcf43da7caeddbd7d",
"size": "13233... |
"""
common.py
This module contains the model to persist and then
retrieve data from backends. It is intended to be
a common structure for a all parsed sources.
"""
__author__ = 'Alan Barber'
#python
from collections import namedtuple
Common = namedtuple(
'Common',
[
"type",
"data",
"... | {
"content_hash": "ba6ead49bf058919c0ae7aa4aa12d081",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 50,
"avg_line_length": 16.681818181818183,
"alnum_prop": 0.6076294277929155,
"repo_name": "alanebarber/sabroso",
"id": "efc218b2024afee3e3d4195b7b42446ca7ac7648",
"size": "... |
"""
Main module of the foraging ant simulation.
"""
from cab.complex_automaton import ComplexAutomaton
from abm.fa_agent import HiveAgent
from ca.fa_cell import WorldCell
from fa_global_constants import GC
# from util.fa_visualization import Visualizer
__author__ = 'Michael Wagner'
__version__ = '1.0'
if __name__ ... | {
"content_hash": "97019f73f267171459063e0067b6d915",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 109,
"avg_line_length": 25.90625,
"alnum_prop": 0.6863691194209891,
"repo_name": "Micutio/CAB_Simulations",
"id": "e6cf3c7c91e0e9793924a77180926ae4a3cb1434",
"size": "829",... |
import csv
from django import http
from django.conf import settings
from django.contrib import admin, messages
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.shortcuts import redirect, render
from django.views import debug
import commonware.... | {
"content_hash": "6318af154ec4d99baf586592147c3c46",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 78,
"avg_line_length": 36.574561403508774,
"alnum_prop": 0.6091857536874925,
"repo_name": "shahbaz17/zamboni",
"id": "4ebbf410ef114b0f84d8fb0fc0b36a0285713958",
"size": "8... |
from __future__ import division
import logging
import time
from quant import config
from quant.brokers import broker_factory
from quant.common import constant
from quant.tool import email_box
from .basicbot import BasicBot
class Maker_ZRX(BasicBot):
"""
./venv/bin/python -m quant.cli -mBitfinex_ZRX_ETH,Bin... | {
"content_hash": "c1e3693f17ed92b7d4abfff65e6edbb6",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 113,
"avg_line_length": 39.34765625,
"alnum_prop": 0.5718256725900923,
"repo_name": "doubleDragon/QuantBot",
"id": "9d852219328c10e22f183315738722d9f28a85a9",
"size": "101... |
""" Test behavior of NLHBase. """
from nlhtree import NLHTree
__all__ = [
'NLHBase',
]
class NLHBase(object):
""" Test behavior of NLHBase. """
def __init__(self, name, hashtype):
self._root = NLHTree(name, hashtype) # immutable ref to a NLHTree
self._cur_tree = self._root ... | {
"content_hash": "9f90e73f219e0358b4d0328c2df82141",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 76,
"avg_line_length": 24.642857142857142,
"alnum_prop": 0.5611594202898551,
"repo_name": "jddixon/nlhtree_py",
"id": "7ef2142401f427f843adfc5e1440571c86484c8f",
"size": "1... |
import logging
import json
import sys
from dlab.fab import *
from dlab.meta_lib import *
from dlab.actions_lib import *
import os
import argparse
import traceback
parser = argparse.ArgumentParser()
parser.add_argument('--uuid', type=str, default='')
args = parser.parse_args()
if __name__ == "__main__":
instance_... | {
"content_hash": "e8f9fed8895da855db9eba99d3aaed60",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 167,
"avg_line_length": 53.53136531365314,
"alnum_prop": 0.5881988005790308,
"repo_name": "epam/DLab",
"id": "1e9fe8eb5fe0b6b01b45b34fda991329bceed3b3",
"size": "15276",
... |
import time
from datetime import datetime
import sys
import os
from multiprocessing import Pool
# Project dependency modules
import pandas as pd
pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment
import lasagne
# Project modules
sys.path.append('../')
from sleep_control.t... | {
"content_hash": "a6233140b45f39e85473cc22b13b9dae",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 103,
"avg_line_length": 33.31159420289855,
"alnum_prop": 0.6497715901675005,
"repo_name": "zaxliu/deepnap",
"id": "efabd8516978796f715bed1b20adcd12deaf5f2b",
"size": "4623... |
from basic import login, BasicCtrl
class LeaveCtrl(BasicCtrl):
@login
def get(self):
self.render('leave.html')
@login
def post(self):
self.del_current_sess()
self.redirect('/')
| {
"content_hash": "fce4e51861a8bb567e8b5fe36e693b19",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 34,
"avg_line_length": 19.90909090909091,
"alnum_prop": 0.6027397260273972,
"repo_name": "finron/luokr.com",
"id": "0dcf8545a16ebfa007f60f12a672d8403c68fb0d",
"size": "234"... |
"""A set of utilities to load score files with different formats.
"""
import numpy
import tarfile
import os
def open_file(filename, mode='rt'):
"""open_file(filename) -> file_like
Opens the given score file for reading.
Score files might be raw text files, or a tar-file including a single score file inside.
... | {
"content_hash": "41e18b6a99a5ad36009f319895a2fdbc",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 127,
"avg_line_length": 34.79115479115479,
"alnum_prop": 0.6763418079096045,
"repo_name": "tiagofrepereira2012/bob.measure",
"id": "63246db0e4048bf1e13cfd624113bd3f2de665c1"... |
import datetime
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_unicode
from django_comments.forms import CommentForm
from .models import ThreadedComment... | {
"content_hash": "18aa22e12a286bd0f1123ddbd8fabe65",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 92,
"avg_line_length": 35.46938775510204,
"alnum_prop": 0.6708860759493671,
"repo_name": "underlost/GamerNews",
"id": "208cd1cd2593455cf72553f174d2df88e4aeb223",
"size": "1... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('storage', '0005_auto_20170127_1412'),
]
operations = [
migrations.AlterField(
model_name='scalefile',
... | {
"content_hash": "3ef197de34e76cda31ad96fdc63461ca",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 139,
"avg_line_length": 35.026315789473685,
"alnum_prop": 0.5957926371149511,
"repo_name": "ngageoint/scale",
"id": "df0df74ef8f9169a5b38f4ba144e1bf129ccaf5e",
"size": "135... |
"""Extensions module. Each extension is initialized in the app factory located
in app.py
"""
from flask_bcrypt import Bcrypt
bcrypt = Bcrypt()
from flask_login import LoginManager
login_manager = LoginManager()
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask_migrate import Migrate
migrate = Mig... | {
"content_hash": "6abdb0af658d2de6b1d10f1bb641629b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 20.85185185185185,
"alnum_prop": 0.7886323268206039,
"repo_name": "binking/News_website",
"id": "9b53e9882ff725c6f3b343e608f71d7ea0d13e0b",
"size": "... |
import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="len", parent_name="bar.marker.colorbar", **kwargs):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "6b68be29d24abd3c0135bbeb346f0b45",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 37.30769230769231,
"alnum_prop": 0.5938144329896907,
"repo_name": "plotly/python-api",
"id": "8528a13ae3b050d24746333d8d717d4c2742279c",
"size": "485... |
import logging
from archinfo.arch_soot import (ArchSoot, SootAddressDescriptor,
SootAddressTerminator, SootArgument,
SootMethodDescriptor)
from ... import sim_options as o
from ...errors import SimEngineError, SimTranslationError
from cle import CLEError... | {
"content_hash": "6c84184f768568abfd387f1d8bf92b29",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 114,
"avg_line_length": 42.16183574879227,
"alnum_prop": 0.6010885133199656,
"repo_name": "angr/angr",
"id": "132bc13bbf38b468364dac5e0f38a75732b152aa",
"size": "17456",
... |
class TestSequenceFunctions():
def setUp(self):
pass
def tearDown(self):
pass
def test_listcontroler_loads(self):
pass
| {
"content_hash": "7596fbb83d66eb779a7c4ff32a3bcd4b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 39,
"avg_line_length": 16.2,
"alnum_prop": 0.5802469135802469,
"repo_name": "hepix-virtualisation/vmcaster",
"id": "41ae0ae4a24ad08b6806d92b2599567c9e56f623",
"size": "164"... |
import os.path
import logging
import json
import tempfile
import shutil
import time
from ceph_deploy import hosts
from ceph_deploy.cliutil import priority
from ceph_deploy.lib import remoto
import ceph_deploy.util.paths.mon
LOG = logging.getLogger(__name__)
def _keyring_equivalent(keyring_one, keyring_two):
"""... | {
"content_hash": "70afc6cd539e83544ac5fb2190fe7b56",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 99,
"avg_line_length": 33.548507462686565,
"alnum_prop": 0.561450339228117,
"repo_name": "Vicente-Cheng/ceph-deploy",
"id": "a7d0981d902e29a551979001edb7f53e749cc8f4",
"si... |
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import pandas as pd
import marvin
from marvin.utils.yanny import yanny
# Stores the maskbits yanny file structure so that we don't need to open it more than once.
_maskbits_from_yanny = None
def _read_maskbit_schemas():... | {
"content_hash": "c102d2ff532d161d8de6b173ad01073d",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 113,
"avg_line_length": 30.379746835443036,
"alnum_prop": 0.5294166666666666,
"repo_name": "sdss/marvin",
"id": "a427e6b4169664b67c4cf830ed463bd6ce968677",
"size": "12229"... |
import logging
from shove import Shove
logging.basicConfig(level=logging.DEBUG)
from plex import Plex
import os
def print_title(container):
print list(container)[0].title
if __name__ == '__main__':
# Without caching
print_title(Plex['library'].metadata(3))
print_title(Plex['library'].metadata(3))
... | {
"content_hash": "a2037cd3445630da1a12104aa6db8cb2",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 71,
"avg_line_length": 21.59375,
"alnum_prop": 0.6512301013024602,
"repo_name": "fuzeman/plex.py",
"id": "558c005a0b7947ae8cd3a8de0bb29a9fca2ff726",
"size": "691",
"binar... |
from time import time
class LabelAnnealer(object):
"""Keeps track of how many labels we want to collect"""
def __init__(self, agent_logger, final_timesteps, final_labels, pretrain_labels):
self._agent_logger = agent_logger
self._final_timesteps = final_timesteps
self._final_labels = fi... | {
"content_hash": "1404e9d76364680b4fae7848e605b47e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 119,
"avg_line_length": 45.93333333333333,
"alnum_prop": 0.6611030478955007,
"repo_name": "nottombrown/rl-teacher",
"id": "b56970fdbfd20f42e82b90643e3d152b7bfd1744",
"size"... |
from __future__ import print_function
import filecmp
a = r"\\DEQWQNAS01\Lidar08\LiDAR\BE"
b = r"P:\Willamette\BE"
match, mismatch, err = filecmp.cmpfiles(a, b, common)
print(mismatch) | {
"content_hash": "753d2dbbe61e21379687208e530d604d",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.7258064516129032,
"repo_name": "rmichie/PyScripts",
"id": "3d0c6f5b45709585e4f280229382b39f354bd287",
"size": "187... |
from Models.FeatureProcessing import *
import sklearn
from sklearn.linear_model import LogisticRegression
import numpy as np
import abc
from ClassificationModule import ClassificationModule
class lrreadmeonly(ClassificationModule):
"""A basic logistic regressor"""
def __init__(self, text_corpus):
... | {
"content_hash": "4378b19919ef259886f6a2104af1f619",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 144,
"avg_line_length": 39.0958904109589,
"alnum_prop": 0.665031534688157,
"repo_name": "Ichaelus/Github-Classifier",
"id": "b15f167a035c59e005be83baeef7831f39a5bbd2",
"siz... |
"""This example gets all ad group criteria in an account.
To add keywords, run add_keywords.py.
Tags: AdGroupCriterionService.get
Api: AdWordsOnly
"""
__author__ = ('[email protected] (Kevin Winter)'
'Joseph DiLallo')
from googleads import adwords
PAGE_SIZE = 500
def main(client):
# Initiali... | {
"content_hash": "c02be6f2f5434eb92e4c90efe1b66834",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 80,
"avg_line_length": 28.083333333333332,
"alnum_prop": 0.6065281899109792,
"repo_name": "jdilallo/jdilallo-test",
"id": "683e2f2fae0c6888f1d35d97f9489a6320c3972d",
"size"... |
import Tkinter
from tkFileDialog import askopenfilename
class File_Loader():
def loadMP3(self):
currentAudioFilePath = askopenfilename(filetypes=[("Sound files","*.mp3, *.wav")]) # show an "Open" dialog box and return the path to the selected file
print(currentAudioFilePath)
return curren... | {
"content_hash": "f3f5890ed6e6b8759548c43c281d96e6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 159,
"avg_line_length": 33.4,
"alnum_prop": 0.7245508982035929,
"repo_name": "Thomas-Stewart/RadioFrequencyInterpreter",
"id": "f15e542281e4d227219004b900f29b4a3e994c82",
"... |
import unittest
import os
import yaml
import imp
# add parent dir to search path
import sys
#sys.path.insert(0, "..")
f = None
try:
(f, pathname, description) = imp.find_module("monkeyYaml", [os.path.join(os.getcwd(), "../")])
module = imp.load_module("monkeyYaml", f, pathname, description)
monkeyYaml = ... | {
"content_hash": "95391f5fd8b10afa6c72c6f9136976d9",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 98,
"avg_line_length": 27.677777777777777,
"alnum_prop": 0.5826977117623444,
"repo_name": "baslr/ArangoDB",
"id": "64744f64e0b43cb164e2e4f029453749d3bc17b1",
"size": "5129... |
from flask.ext.wtf import Form
from flask.ext.babel import gettext
from wtforms import TextField, BooleanField, RadioField
from wtforms.validators import Required, Regexp, Optional
from wtforms import IntegerField, HiddenField
from wtforms import ValidationError
from wtforms.validators import StopValidation
from wtform... | {
"content_hash": "771b01b596ed201191f8f5107bc7d814",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 124,
"avg_line_length": 45.64459930313589,
"alnum_prop": 0.5426717557251909,
"repo_name": "nukru/projectQ",
"id": "ff55b80a9cef6abaef8dd2562e2e87fd74d4bca0",
"size": "1310... |
extensions = [
'openstackdocstheme',
'sphinx.ext.autodoc',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '... | {
"content_hash": "b87c90b1a723502b30133e60b5b56d1d",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 79,
"avg_line_length": 32.32806324110672,
"alnum_prop": 0.7009414353832987,
"repo_name": "openstack/openstack-ansible-rsyslog_server",
"id": "b39ce1792ad9856874cc1e9029baae9... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Asset',
fields=[
(... | {
"content_hash": "ab591e351127280473b9fcefc38701f4",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 191,
"avg_line_length": 45.360759493670884,
"alnum_prop": 0.5729035858797266,
"repo_name": "H0neyBadger/cmdb",
"id": "e3e098c454ff1c5719110bbfd0f8535ada4f76a8",
"size": "7... |
"""BayesianOptimization is used""" | {
"content_hash": "8f4664d418af5a4c3df5369d1266eb99",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 34,
"avg_line_length": 34,
"alnum_prop": 0.7647058823529411,
"repo_name": "odb9402/OPPA",
"id": "163e0893a104b7eef19cf27a2d91dba3129113f6",
"size": "34",
"binary": false,
... |
"""Auto-generated file, do not edit by hand. 800 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_800 = PhoneMetadata(id='001', country_code=800, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='(?:00|[1-9]\\d)\\d{6}', possible_leng... | {
"content_hash": "9d06c71bc80aa5b32764dbeb7ed6e736",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 128,
"avg_line_length": 81.57142857142857,
"alnum_prop": 0.6952714535901926,
"repo_name": "daviddrysdale/python-phonenumbers",
"id": "5c5026dbec1349080625bf54dda73ffcb8772f2d"... |
import getpass
import os
os.system("clear")
pw = getpass.getpass()
minuscula=0
mayuscula=0
numero=0
especial =0
if (len(pw)<5) or (len(pw)>15):
print("Error, out of range")
for i in pw:
if (ord(i)>47) and (ord(i)<58):
numero = 1
elif (ord(i)>64) and (ord(i)<91):
mayuscula = 1
elif (ord(i... | {
"content_hash": "97c774ff2c5c00f0166926d2ee5952ad",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 218,
"avg_line_length": 43.8,
"alnum_prop": 0.619482496194825,
"repo_name": "Am3ra/CS",
"id": "308d5a389e0e21091c36223a3389ca697fda9bf4",
"size": "1314",
"binary": false,... |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project fold... | {
"content_hash": "f68e5bb4dc5b28b64561d0e445269272",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 98,
"avg_line_length": 29.30943396226415,
"alnum_prop": 0.6642204197244753,
"repo_name": "smillerpy/shoes",
"id": "b47323d4a95072aef97645af9181230155ad0277",
"size": "7767... |
from modelmapper.declarations import Mapper, Field
from modelmapper.qt.fields import QLineEditAccessor
class String(QLineEditAccessor):
def get_value(self):
return str(self.widget.text())
def set_value(self, value):
self.widget.setText(str(value))
class Integer(QLineEditAccessor):
def... | {
"content_hash": "e85b71a8c5aa87e4f5926e88a3c61499",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 79,
"avg_line_length": 24.761904761904763,
"alnum_prop": 0.6057692307692307,
"repo_name": "franramirez688/model-mapper",
"id": "2e1ea26357eac72644bfd8a4e511ade260d1740c",
"... |
"""Test to verify that we can load components."""
# pylint: disable=protected-access
import asyncio
import unittest
import pytest
import homeassistant.loader as loader
import homeassistant.components.http as http
from tests.common import (
get_test_home_assistant, MockModule, async_mock_service)
class TestLoad... | {
"content_hash": "0e68e1368785980fd37ade2d04c9ddae",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 77,
"avg_line_length": 33.044117647058826,
"alnum_prop": 0.6688918558077437,
"repo_name": "persandstrom/home-assistant",
"id": "4beb7db570e4cd580bef790ef30fa11c6ce991bf",
... |
"""merged scheduler and mmou code
Revision ID: 9dce37322c71
Revises: 960085fce39c, edc5377c32c7
Create Date: 2016-06-15 10:41:56.784841
"""
# revision identifiers, used by Alembic.
revision = '9dce37322c71'
down_revision = ('960085fce39c', 'edc5377c32c7')
branch_labels = None
depends_on = None
from alembic import o... | {
"content_hash": "6cf4ebf8f372058a1b0274337b506633",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 48,
"avg_line_length": 13.76923076923077,
"alnum_prop": 0.696927374301676,
"repo_name": "c4fcm/CivilServant",
"id": "7b342d0bddd92a2e90bf19702369a3cdbf63c33c",
"size": "716... |
from ui import *
from state import *
from updater import *
from const import DEFAULT_CONFIG
from os import path as op
import sys
from optparse import OptionParser
import curses
import curses.ascii
import os
import stat
import yaml
import locale
import unicodedata
import threading
import Queue
import tweepy
__author__ ... | {
"content_hash": "2450667c39956130242c8e2c4599ab4b",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 100,
"avg_line_length": 31.416,
"alnum_prop": 0.6065699006875478,
"repo_name": "seikichi/tuitwi",
"id": "2bc2c160e24e3a65618ed6cf7397836ddbbff88c",
"size": "4084",
"bina... |
from chatterbot import ChatBot
'''
This is an example showing how to create an export file from
an existing chat bot that can then be used to train other bots.
'''
chatbot = ChatBot(
'Export Example Bot',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# First, lets train our bot with some data
chatb... | {
"content_hash": "b9ad2e169e8efb838763d494dca0c1e0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 63,
"avg_line_length": 26.529411764705884,
"alnum_prop": 0.753880266075388,
"repo_name": "osDanielLee/SelfThinkingRobot",
"id": "539a95d0b0041df826d7f66ea885e097a940ad7a",
... |
from flask import render_template, redirect, request, url_for, flash
from flask_login import login_user, logout_user, login_required, \
current_user
from .import auth
from .. import db
from ..models import User
from ..email import send_email
from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\
F... | {
"content_hash": "d28c61d9d02cc8c52c77864180052d09",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 78,
"avg_line_length": 37.68867924528302,
"alnum_prop": 0.6357947434292867,
"repo_name": "superchilli/webapp",
"id": "7c9baafdca7885e2a5eb8c27e95c3e90fd7c884f",
"size": "3... |
from tkinter import *
from tkinter.ttk import *
class Entry(Entry):
def __init__(self, parent):
self.parent = parent
Entry.__init__(self, self.parent)
self.__alignment = W
self.__column = 0
self.__padding = (0, 0)
self.__placed = False
self.__row = 0
... | {
"content_hash": "a33ad64d2ea94ae35c6f11b4805c458b",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 128,
"avg_line_length": 24.26153846153846,
"alnum_prop": 0.5688015218769816,
"repo_name": "Kyle-Fagan/tkLibs",
"id": "41cc47f649f29a948a6c88399ab2d8c4b5d32c60",
"size": "15... |
class Compressor(object):
def compress(self, toCompress):
if toCompress is None:
return ""
else:
result = []
index = 0
length = len (toCompress)
while index < length:
counter = 1
index += 1
w... | {
"content_hash": "4c1d6a14d59b5c38407dde7a5284481e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 84,
"avg_line_length": 33.1,
"alnum_prop": 0.5921450151057401,
"repo_name": "Alex-Diez/python-tdd-katas",
"id": "d603b368b4e0bd8b8a892a7439399e2c5f153172",
"size": "1350",
... |
from game import entity
class OnlineStub(entity.StubEntity):
_components = (
'stubs.Online.Online',
)
_stub_name = 'online'
def __init__(self):
print('OnlineStub create!')
| {
"content_hash": "91dec71df7308c10f08e87a69f664c48",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 36,
"avg_line_length": 16.636363636363637,
"alnum_prop": 0.6775956284153005,
"repo_name": "dennisding/ether",
"id": "443a8bfebbcf936ae759de260f1a58d377523ab9",
"size": "207... |
from __future__ import absolute_import, division, print_function, unicode_literals
import hashlib
import json
import os
from os.path import abspath, basename, dirname, isdir, isfile, islink, join
import re
import tarfile
import tempfile
from .._vendor.auxlib.entity import EntityEncoder
from ..base.constants import CO... | {
"content_hash": "5687834bcd7712105262cb4444d0af0f",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 88,
"avg_line_length": 30.09691629955947,
"alnum_prop": 0.5837236533957846,
"repo_name": "zooba/PTVS",
"id": "629f9dd37f7544cfc90bdd27ede9bd7b871cec15",
"size": "6931",
... |
from tastypie.resources import ModelResource, ALL
from .models import Filer, Filing
from .utils.serializer import CIRCustomSerializer
class FilerResource(ModelResource):
class Meta:
queryset = Filer.objects.all()
serializer = CIRCustomSerializer()
filtering = {'filer_id_raw': ALL}
... | {
"content_hash": "659b8eb63ead767085f95841357260b8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 28.68421052631579,
"alnum_prop": 0.6697247706422018,
"repo_name": "myersjustinc/django-calaccess-campaign-browser",
"id": "685275ae8d17ab9e879561b847fe... |
from testSPARQL import ns_rdf
from testSPARQL import ns_rdfs
from testSPARQL import ns_dc0
from testSPARQL import ns_foaf
from testSPARQL import ns_ns
from testSPARQL import ns_book
from testSPARQL import ns_vcard
from testSPARQL import ns_person
from rdflib.Literal import Literal
from rdflib.sparql.sparqlOperator... | {
"content_hash": "b7d87eb60c1555c2d5b43a1fec1a80b2",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 68,
"avg_line_length": 29.38095238095238,
"alnum_prop": 0.6636952998379254,
"repo_name": "alcides/rdflib",
"id": "60723b7ea4f08e5c5353317254081390486dfe1d",
"size": "1361",... |
"""
Burp-UI is a web-ui for burp backup written in python with Flask and
jQuery/Bootstrap
.. module:: burpui_monitor
:platform: Unix
:synopsis: Burp-UI monitor module.
.. moduleauthor:: Ziirish <[email protected]>
"""
__title__ = "burp-ui-monitor"
| {
"content_hash": "94187a3bb7d60e8a760c3698977bb292",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 68,
"avg_line_length": 23.727272727272727,
"alnum_prop": 0.6934865900383141,
"repo_name": "ziirish/burp-ui",
"id": "3989dfa4f44096b4033277c7a406cf609c0dcb85",
"size": "284"... |
from __future__ import division #3/2=1.5 and 3//2=1
#adam-does# blends cosmics and blocks them from being blended into stars
#adam-use # use with CRNitschke cosmics masking pipeline
import sys ; sys.path.append('/u/ki/awright/InstallingSoftware/pythons')
from import_tools import *
import astropy
from astropy.io import ... | {
"content_hash": "877bd9a2e488fc5c7678373ccdd9dd3e",
"timestamp": "",
"source": "github",
"line_count": 2361,
"max_line_length": 406,
"avg_line_length": 55.090216010165186,
"alnum_prop": 0.6794984162130577,
"repo_name": "deapplegate/wtgpipeline",
"id": "77ae9aa39c96aec1fa206bbea68451ece059b251",
"s... |
from flask import render_template, request
from app import app
# ROUTING/VIEW FUNCTIONS
@app.route('/')
@app.route('/index')
def index():
# Renders index.html.
return render_template('index.html')
# @app.route('/output')
# def cities_output():
# return render_template('output.html')
@app.route('/author')
d... | {
"content_hash": "f469c7776d6866a9b0ad47f3b253d85a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 58,
"avg_line_length": 22.896551724137932,
"alnum_prop": 0.6852409638554217,
"repo_name": "hongsups/insightfl_shin",
"id": "f586124df25cc5ad02d7beea4c01b7b16086d864",
"size... |
from cumulusci.core.config.sfdx_org_config import SfdxOrgConfig
from typing import Optional
import base64
import enum
import io
import json
import pathlib
import zipfile
from pydantic import BaseModel, validator
from simple_salesforce.exceptions import SalesforceMalformedRequest
from cumulusci.core.exceptions import ... | {
"content_hash": "9bfb856fd86f31e9a5d3c1db65ee37b9",
"timestamp": "",
"source": "github",
"line_count": 602,
"max_line_length": 182,
"avg_line_length": 41.84551495016611,
"alnum_prop": 0.5916001746655551,
"repo_name": "SalesforceFoundation/CumulusCI",
"id": "413209e447e230fcba8dc53021933ddf1daa544c",... |
from __future__ import absolute_import, division, print_function
import math
import thread
import roslib; roslib.load_manifest('ev3_ros')
import rospy
from sensor_msgs.msg import JointState, Imu
from PyKDL import Rotation
import rpyc
import nxt.error
from nxt_msgs.msg import Range, Contact, JointCommand, Color, Gyro,... | {
"content_hash": "0518bcfedd0125c55362bc713a80ab3a",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 97,
"avg_line_length": 35.23893805309734,
"alnum_prop": 0.5752134605725766,
"repo_name": "youtalk/mindstorms_ros",
"id": "18070129df9436effbdbad28cef858aae03bb04a",
"size"... |
"""
This script will handle the initial configuration using command line arguments and the YAML config file and calling the metadatanavigator functions to enable/disable debug, color and json support.
Once all configuration are set, the script will call the mnavigator function, imported from metadatanavigator, with the... | {
"content_hash": "d156a4d35a632d44d2442fa7d5fb7717",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 196,
"avg_line_length": 33.160919540229884,
"alnum_prop": 0.5996533795493935,
"repo_name": "marcelocrnunes/metadatanavigator",
"id": "ad69a2290009d915b0928af171be8c8400623507... |
"""
This module provides relevance matching and formatting of related strings
based on the relevance. It is borrowed from Gnome-Do with modifications
to fit nicely into python.
>>> import relevance
>>> relevance.score('hi there dude', 'hi dude')
0.53480769230769232
>>> relevance.formatCommonSubstrings('hi there dude'... | {
"content_hash": "0f2b6c589285103a89ab0d4ef839e041",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 76,
"avg_line_length": 28.534246575342465,
"alnum_prop": 0.533685389662346,
"repo_name": "icebreaker/dotfiles",
"id": "e5e139f67513b0f8fe84cff9ceee4e22da2aa917",
"size": "... |
import os
import requests
import sys
def main():
# Unknown error raised when the wifi adapter dies - restart RPi to "fix"
url = 'http://www.google.com'
try:
requests.packages.urllib3.disable_warnings()
_ = requests.get(url)
print('Successful ping')
except:
sys.stderr.wr... | {
"content_hash": "9acbb254b3c96a013a26aedc74d7bd0a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 76,
"avg_line_length": 23.842105263157894,
"alnum_prop": 0.6158940397350994,
"repo_name": "noelevans/sandpit",
"id": "6843b4560d57518a4f35a1b5ea65fecfbc6542a9",
"size": "45... |
import sys
import datetime
import glob
import traceback
import re
import shlex
import os
DOCUMENTATION = '''
---
module: command
version_added: historical
short_description: Executes a command on a remote node
description:
- The M(command) module takes the command name followed by a list of space-delimited argume... | {
"content_hash": "c67bd61d66a495abd1398cec44a3c497",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 174,
"avg_line_length": 34.832669322709165,
"alnum_prop": 0.5919020931030539,
"repo_name": "dispansible/dispansible",
"id": "bc286d6855debdcd718ef173d73ba488311b03ba",
"si... |
from __future__ import print_function
import pytest
from datetime import datetime, timedelta
import itertools
from numpy import nan
import numpy as np
from pandas import (DataFrame, Series, Timestamp, date_range, compat,
option_context, Categorical)
from pandas.core.arrays import IntervalArray, ... | {
"content_hash": "5796a98da549b4764ac18476c9b3b105",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 79,
"avg_line_length": 35.76842105263158,
"alnum_prop": 0.5288895428683539,
"repo_name": "cython-testbed/pandas",
"id": "3fe1c84174acba991308aa4247f8018429dfe033",
"size":... |
'''
Test suite for pcalg
'''
import networkx as nx
import numpy as np
from gsq.ci_tests import ci_test_bin, ci_test_dis
from gsq.gsq_testdata import bin_data, dis_data
import pytest
from pcalg import estimate_cpdag
from pcalg import estimate_skeleton
@pytest.mark.parametrize(('indep_test_func', 'data_matrix', 'g_an... | {
"content_hash": "0c5a2a7cc39f197a5326a4fd32a973fe",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 76,
"avg_line_length": 35.68571428571428,
"alnum_prop": 0.5176140912730184,
"repo_name": "keiichishima/pcalg",
"id": "55c253c4bbaa682d4f86fb15b23b9396b7464ad0",
"size": "25... |
import sys
import subprocess
__all__ = ['log_info', 'handle_error', 'run_command', ]
def log_info(msg):
sys.stdout.write('* {}\n'.format(msg))
sys.stdout.flush()
def handle_error(msg):
sys.stderr.write('* {}\n'.format(msg))
sys.exit(1)
def run_command(
command, ignore_error=False, return... | {
"content_hash": "78576725a8c6e78b2d634ed04ecaadca",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 79,
"avg_line_length": 26.558823529411764,
"alnum_prop": 0.6124031007751938,
"repo_name": "aknuds1/deploy-ecs",
"id": "307c1d4dd59a1b0f98adc5addc7806ab442da48b",
"size": "9... |
import json
import signal
import sys
from tornado.httpserver import HTTPServer
from tornado.httputil import HTTPHeaders
import tornado.ioloop
from tornado.options import define, options
from tornado.web import URLSpec
from orders import Book, Buy, Sell
import constants
try:
from httplib import responses # py2... | {
"content_hash": "baf7f2debd571ca5f56555d7b4eefd34",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 87,
"avg_line_length": 28.616161616161616,
"alnum_prop": 0.6050123543946346,
"repo_name": "eigenholser/ddme",
"id": "f63b8dfefd79a8e83d5c69d234d503e29f19dd37",
"size": "283... |
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('plugins', '0003_auto_20170501_2124'),
]
operations = [
migrations.AddField(
model_name='d... | {
"content_hash": "a1146a8a8c4a99bc78d10d5983e4cffd",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 135,
"avg_line_length": 37.75555555555555,
"alnum_prop": 0.6327251324308417,
"repo_name": "ava-project/ava-website",
"id": "a47342d962e622cd4128baf21b47aa971f4a631c",
"size... |
import re
from setuptools import find_packages, setup
def read_requirements(req_file):
return [line for line in re.sub(r"\s*#.*\n", "\n", req_file.read()).splitlines() if line]
with open("requirements/base.txt") as f:
REQUIREMENTS = read_requirements(f)
with open("requirements/test.txt") as f:
TEST_RE... | {
"content_hash": "674e257c88914cfb969ea4e4c5eb3bb1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 93,
"avg_line_length": 30.043478260869566,
"alnum_prop": 0.64616497829233,
"repo_name": "jsmesami/naovoce",
"id": "dca098f3e893a45cb92e908fb418a46c08b1ce50",
"size": "1406"... |
import logging
import os
import socket
import subprocess
import sys
import tempfile
import time
from django.core.management.base import BaseCommand
import redisutils
import redis as redislib
log = logging.getLogger('z.redis')
# We process the keys in chunks of size CHUNK.
CHUNK = 3000
# Remove any sets with less th... | {
"content_hash": "a6e361d96be9c1c3b9d2e00d8cb9e079",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 78,
"avg_line_length": 28.02542372881356,
"alnum_prop": 0.5400665255518597,
"repo_name": "jbalogh/zamboni",
"id": "2e83b6b8378d803dcf9bc6b2f43163d139739a10",
"size": "3307... |
from decouple import config
SECRET_KEY = "hi"
DEBUG = config('DEBUG', default=False, cast=bool)
ALLOWED_HOSTS = ['*']
DATABASES = {
"default": dict(
ENGINE='django.db.backends.sqlite3',
NAME=config('DB_NAME', default=':memory:'),
)
}
INSTALLED_APPS = (
'django.contrib.admin',
'django... | {
"content_hash": "45872a9aabaaf662a4ab3e33660f184d",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 70,
"avg_line_length": 25.942307692307693,
"alnum_prop": 0.6286137879911046,
"repo_name": "fgmacedo/django-export-action",
"id": "1952a9a3a7baa0d684a73f71b9404d5187d8394b",
... |
"""
NAME
xpeem_magic.py
DESCRIPTION
Creates MagIC header file and convert XPEEM text files into a MagIC format measurement file.
SYNTAX
xpeem_magic.py [command line options]
OPTIONS
-h: prints the help message and quits
-ID: directory for input files, default = current directory
-WD: director... | {
"content_hash": "2e690b678a8fbfc29c6f9e44f40d3fe2",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 330,
"avg_line_length": 38.37748344370861,
"alnum_prop": 0.6189818809318378,
"repo_name": "lfairchild/PmagPy",
"id": "d735b7cf54b5cf58ad3df498c5f8868760c09f71",
"size": "5... |
"""Implementation of basic magic functions."""
import argparse
from logging import error
import io
from pprint import pformat
import sys
from warnings import warn
from traitlets.utils.importstring import import_item
from IPython.core import magic_arguments, page
from IPython.core.error import UsageError
from IPython... | {
"content_hash": "2261393a59b21cf492b3cd3377040a32",
"timestamp": "",
"source": "github",
"line_count": 663,
"max_line_length": 112,
"avg_line_length": 34.716440422322776,
"alnum_prop": 0.5871746969631142,
"repo_name": "sserrot/champion_relationships",
"id": "a8feb7553865dd7daf8abd30c79575299b4c87fc"... |
from setuptools import setup, find_packages
setup(
name='wikimedia_thumbor_proxy_loader',
version='0.1.1',
url='https://github.com/wikimedia/thumbor-proxy-loader',
license='MIT',
author='Gilles Dubuc, Wikimedia Foundation',
description='Thumbor proxy loader',
packages=find_packages(),
... | {
"content_hash": "f3fd1b1e02001e4923e9d347ebe15f2c",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 26.90625,
"alnum_prop": 0.5900116144018583,
"repo_name": "wikimedia/thumbor-proxy-loader",
"id": "e496a4d2195877cee2c57736ec6959eae73e451c",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.