text stringlengths 4 1.02M | meta dict |
|---|---|
"""Classes supporting courses viewed by a student."""
__author__ = 'Rahul Singal (rahulsingal@google.com)'
import mimetypes
import os
import course_explorer
import webapp2
import appengine_config
from common import jinja_utils
from common import users
from controllers import sites
from controllers import utils
from... | {
"content_hash": "1b936d17b16bc62867115545a4f04040",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 78,
"avg_line_length": 36.25,
"alnum_prop": 0.6296934865900383,
"repo_name": "ram8647/gcb-mobilecsp",
"id": "55599acf549628c70cb97203a4ae9988ed127427",
"size": "11038",
... |
from __future__ import print_function
import time
import logging
import threading
import multiprocessing
try:
import uwsgi
except ImportError:
uwsgi = None
from isso.compat import PY2K
if PY2K:
import thread
else:
import _thread as thread
from werkzeug.contrib.cache import NullCache, SimpleCache
l... | {
"content_hash": "fb8e1fab77fbbf8c0946e64c5efc3b2d",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 77,
"avg_line_length": 21.1015625,
"alnum_prop": 0.6219918548685672,
"repo_name": "mathstuf/isso",
"id": "368c8e3c1e07083664057cd76924532d88be6c6f",
"size": "2728",
"bin... |
# Hive Appier Framework
# Copyright (c) 2008-2022 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foundation, either version 2.0 of the L... | {
"content_hash": "f463e23847df6237e53d65edc513c1aa",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 35.42424242424242,
"alnum_prop": 0.6988879384088965,
"repo_name": "hivesolutions/appier",
"id": "8368039c239721ee52304afdd8ee3797a6b2efb9",
"size": "... |
from cmspwn.module import pwnfunc
@pwnfunc
def is_joomla(cmspwn,response):
if 'joomla.css' in response.content:
cmspwn.found = True; cmspwn.Framework = 'Joomla'; cmspwn.site = 'https://www.joomla.org/'
return
| {
"content_hash": "3b386d2a4515c6b5f00f3460ad1e756a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 101,
"avg_line_length": 33.42857142857143,
"alnum_prop": 0.6752136752136753,
"repo_name": "kenjoe41/cmspwn",
"id": "e0f816d3214b685a21b9421a2799356a57175d86",
"size": "292",... |
from common_fixtures import * # NOQA
DEFINITION = '''
{
"id": "lala",
"resourceFields": {
"fooBar": {
"type": "string"
}
}
}
'''
def test_schema_create(context, client, super_client):
lala = client.by_id_schema('lala')
assert la... | {
"content_hash": "0dc9e874c53bfc79f8e1971ce297f156",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 75,
"avg_line_length": 36.578947368421055,
"alnum_prop": 0.4092086330935252,
"repo_name": "stresler/cattle",
"id": "d45b82c234a6d1ed49d6754587e0ff124e4f9440",
"size": "3475... |
from .core import CvBridge, CvBridgeError
| {
"content_hash": "dabfc69c8f462eea8f0263b4488c382b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 41,
"avg_line_length": 42,
"alnum_prop": 0.8333333333333334,
"repo_name": "Shedino/SherpaHighLevel",
"id": "d37a7b4f1aa498888973a80abf14d5c287f048dc",
"size": "42",
"binar... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CompanyBalance.worked_hours'
db.add_column(u'ecg_balancing_companybalance', 'worked_hours',
se... | {
"content_hash": "1caf254ea37e824a65fd4c5bf2e6773a",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 205,
"avg_line_length": 80.24074074074075,
"alnum_prop": 0.5634279559966151,
"repo_name": "sinnwerkstatt/ecg-balancing",
"id": "9349e4cd7497e25f83a2baeb3f4d23d230d6fd36",
... |
import mock
from django.test import TestCase
from mediaviewer.views.signin import signin
class TestSignin(TestCase):
def setUp(self):
self.siteGreeting_patcher = mock.patch(
'mediaviewer.views.signin.SiteGreeting')
self.mock_siteGreeting = self.siteGreeting_patcher.start()
... | {
"content_hash": "5fa8a06eca7101606f2dc164d5a313fc",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 134,
"avg_line_length": 47.84472049689441,
"alnum_prop": 0.5728936777878748,
"repo_name": "kyokley/MediaViewer",
"id": "f0f0fa5fe0b2aeb5d859da7ec4202a1dd8ba08a9",
"size": ... |
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_ok', [dirname(__file__)])
except ImportError:
import _ok
... | {
"content_hash": "fd96f2183fb5fdcb3b57c56ecdbdae40",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 157,
"avg_line_length": 61.39324116743472,
"alnum_prop": 0.7382840843696049,
"repo_name": "ferchaure/bci",
"id": "23e29000fa70617dfdf90bb70c3297fc25f43935",
"size": "40172... |
import browser
from decorators import implicit_wait
from pageobjects.base import PageObject
from selenium.webdriver.support.select import Select
class Networks(PageObject):
@property
def flatdhcp_manager(self):
return self.parent.\
find_element_by_xpath(
self.XPATH_RADIO.fo... | {
"content_hash": "635363b542d89ad9a9c3e46d6791e044",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 27.582159624413144,
"alnum_prop": 0.6066382978723405,
"repo_name": "dancn/fuel-main-dev",
"id": "68a045ea68a86a10d74c71c2659d23298a5f87ac",
"size": ... |
import unittest
from .context import rbtree
from itertools import zip_longest
from random import shuffle
class TestNode(unittest.TestCase):
SIZE = 100
def setUp(self):
nums = list(range(self.SIZE))
shuffle(nums)
self.root = rbtree.Node(nums[0])
for num in nums[1:]:
... | {
"content_hash": "6fde4230d650fa717fabeccfb72cd4b9",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 78,
"avg_line_length": 31.823170731707318,
"alnum_prop": 0.5882352941176471,
"repo_name": "niemmi/algolib",
"id": "ad7e177fb43bd10a6111f872d2ded227c60f3785",
"size": "5219... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_workflow', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='callbackparamete... | {
"content_hash": "a72fd4764469b7ae35e1d387d0b98ca3",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 182,
"avg_line_length": 38.62068965517241,
"alnum_prop": 0.6116071428571429,
"repo_name": "dani0805/django_workflow",
"id": "f4aed5f4e6d3e41fc65033feba6dbf9ca27b2548",
"siz... |
"""
Bundle class for providing some common utilities when manipulating the bundle
spec
"""
from collections import Mapping
from itertools import chain
import yaml
from conjureup.consts import spell_types
class BundleInvalidApplication(Exception):
pass
class BundleInvalidFragment(Exception):
pass
class B... | {
"content_hash": "2d3b7586a02fba55c369e10e01fb166c",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 78,
"avg_line_length": 30.616883116883116,
"alnum_prop": 0.5371155885471898,
"repo_name": "Ubuntu-Solutions-Engineering/conjure",
"id": "dc4665d3c794a62fdb006477745588317706... |
import logging
l = logging.getLogger(name=__name__)
from .engine import SimEngine
#pylint: disable=arguments-differ
class SimEngineProcedure(SimEngine):
"""
An engine for running SimProcedures
"""
def process(self, state, procedure,
ret_to=None,
inline=None,
force... | {
"content_hash": "a5ab3f6e9f614169a67e01b347d29096",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 98,
"avg_line_length": 35.42857142857143,
"alnum_prop": 0.6271994134897361,
"repo_name": "iamahuman/angr",
"id": "1fc306e915e39d1e050ee4e730ecb35c8a4d5436",
"size": "2728",... |
"""
Utils for FPGA driver.
"""
import glob
import re
VENDORS = ["intel", "inspur"] # can extend, such as ["intel", "xilinx"]
SYS_FPGA_PATH = "/sys/class/fpga"
VENDORS_PATTERN = re.compile("|".join(["(%s)" % v for v in VENDORS]))
def discover_vendors():
vendors = set()
for p in glob.glob1(SYS_FPGA_PATH, "... | {
"content_hash": "03bde5194ea241d188f094b7fb1d0f27",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 72,
"avg_line_length": 20.761904761904763,
"alnum_prop": 0.5871559633027523,
"repo_name": "openstack/nomad",
"id": "75562ba916c8f47e6b7ccf8656cad986ade6a405",
"size": "1014... |
"""
Defines the Sumatra version control interface for Git.
Classes
-------
GitWorkingCopy
GitRepository
:copyright: Copyright 2006-2015 by the Sumatra team, see doc/authors.txt
:license: BSD 2-clause, see LICENSE for details.
"""
from __future__ import print_function
from __future__ import absolute_import
from __fu... | {
"content_hash": "d622c93bb79db79cef533413c6c38f39",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 101,
"avg_line_length": 31.40909090909091,
"alnum_prop": 0.61794500723589,
"repo_name": "maxalbert/sumatra",
"id": "c162208aac35447cd303d9d1cb04c6ae98c4f4be",
"size": "621... |
__all__ = ['DictExtractionTransformer', 'DictListExtractionTransformer', 'FunctionTransformer', 'IdentityTransformer']
from . import PureTransformer
class DictExtractionTransformer(PureTransformer):
"""Extract a given key from dictionary object."""
def __init__(self, key=None, default=None, **kwargs):
... | {
"content_hash": "1807715e25b5fe77b61f683189388838",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 118,
"avg_line_length": 28.26530612244898,
"alnum_prop": 0.6685920577617328,
"repo_name": "skylander86/ycml",
"id": "647b2d0db878446316352bb17ae8aa4bf77f0009",
"size": "138... |
from os import listdir
from os.path import abspath, isdir, isfile, join as path_join
from time import time
from contextlib import contextmanager
import pyautogui as ag
from robot.api import logger as LOGGER
from ..errors import ImageNotFoundException, InvalidImageException
from ..errors import ReferenceFolderExceptio... | {
"content_hash": "af4f2c5ee9d01ead05d767511f6aa3e8",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 81,
"avg_line_length": 40.4453125,
"alnum_prop": 0.5591075912690747,
"repo_name": "Eficode/robotframework-imagehorizonlibrary",
"id": "b2ed9d5c4c32a458af72a5166eedac7e885929... |
"""Miscellaneous utility functions"""
import os
import os.path
import sys
import json
import re
import subprocess
import traceback
import logging
import copy
logger = logging.getLogger(__name__)
from parse_requirements import parse, get_local_files_matching_requirements
from engage_django_components import get_addi... | {
"content_hash": "878180c7f89d63b806ad0bbfa84e57bc",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 158,
"avg_line_length": 44.53086419753087,
"alnum_prop": 0.6086082617133352,
"repo_name": "quaddra/engage",
"id": "5d732923047c66428cc1d3d3189a645c72638f57",
"size": "1442... |
import csv
import ConfigParser
from contactmap import names_within, MessageSender
INFILE = 'grid.csv'
with open(INFILE, 'r') as f:
reader = csv.reader(f)
# skip header
reader.next()
boxes = []
for r in reader:
minlon = float(r[1])
minlat = float(r[3])
maxlon = float(r[2])... | {
"content_hash": "a32b5fd020bea3d7adabfed8ab19b243",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 76,
"avg_line_length": 31.905882352941177,
"alnum_prop": 0.6497050147492626,
"repo_name": "osmItalia/contactmap",
"id": "8dd123c2a5f0d663bf4c6d44b71a995652d494f7",
"size": ... |
"""
Post-processes the force coefficients from a cuIBM simulation.
This script reads the forces, computes the mean forces within a given range,
computes the Strouhal number within a range, plots the force coefficients,
saves the figure, and prints a data-frame that contains the mean values.
"""
from snake.cuibm.simul... | {
"content_hash": "0d8571748bbfa31379b985b3f4017d79",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 37.2962962962963,
"alnum_prop": 0.6425024826216484,
"repo_name": "barbagroup/cuIBM",
"id": "a738b4734fbc5c12fbe4900f29f7d8c3bd840f19",
"size": "1007"... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.maintenance import MaintenanceManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-maintenance
# USAGE
python configuration_assignments_create_or_update_parent.py
Before run the sample, please set the v... | {
"content_hash": "0b80031e6d3309222ba83fa56951b120",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 190,
"avg_line_length": 39.906976744186046,
"alnum_prop": 0.7301864801864801,
"repo_name": "Azure/azure-sdk-for-python",
"id": "e2a772f23a83e4e1405f60db6f6faa49064f0585",
"... |
import six
import time
from airflow.exceptions import AirflowException
from airflow.contrib.hooks.databricks_hook import DatabricksHook
from airflow.models import BaseOperator
XCOM_RUN_ID_KEY = 'run_id'
XCOM_RUN_PAGE_URL_KEY = 'run_page_url'
class DatabricksSubmitRunOperator(BaseOperator):
"""
Submits an S... | {
"content_hash": "906dafb126c37a7c12c0b7a4fae0f9de",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 100,
"avg_line_length": 43.36254980079681,
"alnum_prop": 0.6187982359426681,
"repo_name": "RealImpactAnalytics/airflow",
"id": "2aa1ef2c2aaa6ef48d32cb63b7e5bba89d71ec4f",
... |
import datetime
import tweepy
import botologist.plugin
import botologist.util
class TwitterPlugin(botologist.plugin.Plugin):
SPAM_THROTTLE = 10
def __init__(self, bot, channel):
super().__init__(bot, channel)
self.cfg = self.bot.config.get("twitter_api")
if not self.cfg:
... | {
"content_hash": "a738aa9c9a5d8ecec4e503ba7b8dc2cb",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 86,
"avg_line_length": 29.049180327868854,
"alnum_prop": 0.5744920993227991,
"repo_name": "anlutro/botologist",
"id": "af54961f2945fd7b21fe4f83679b4b51913dc833",
"size": "1... |
from google.cloud import speech_v2
def sample_create_recognizer():
# Create a client
client = speech_v2.SpeechClient()
# Initialize request argument(s)
recognizer = speech_v2.Recognizer()
recognizer.model = "model_value"
recognizer.language_codes = ['language_codes_value1', 'language_codes_va... | {
"content_hash": "65de6b2da5d16a8f25073d4e595af4e9",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 25.642857142857142,
"alnum_prop": 0.6963788300835655,
"repo_name": "googleapis/python-speech",
"id": "af0ffdc76996ebfa374890c925587c4d941b95cb",
"siz... |
"""
Implements the mini message windows.
Two parts:
- the "mini message queue" for managing all mini messages.
- the "mini message window" for displaying each mini message.
"""
# ----------------------------------------------------------------------------
# Imports
# --------------------------------... | {
"content_hash": "a4436d7babead5be647a2761f35cd6ee",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 78,
"avg_line_length": 33.63484486873509,
"alnum_prop": 0.5152912793585468,
"repo_name": "drdelta/notenso",
"id": "45a8fcd40a2f4eb2030986c3b4c56f1136427808",
"size": "1580... |
from django.conf.urls import include
from django.conf.urls import url
urlpatterns = [
url(r"^auth/", include("kolibri.core.auth.api_urls")),
url(r"^content/", include("kolibri.core.content.api_urls")),
url(r"^logger/", include("kolibri.core.logger.api_urls")),
url(r"^tasks/", include("kolibri.core.task... | {
"content_hash": "94899046eecb8be6378872ff375b7def",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 72,
"avg_line_length": 48.733333333333334,
"alnum_prop": 0.6716826265389877,
"repo_name": "lyw07/kolibri",
"id": "09b4d1b80a68843036c026f8ac5706b32fba1385",
"size": "731",
... |
""" Contains a few template tags relating to autotags
Specifically, the autotag tag itself, and the filters epoch and cstag.
"""
from django import template
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from tags.models import Tag
import datetime
import calendar
import t... | {
"content_hash": "172c4cff746382ffe20169151dbe9646",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 120,
"avg_line_length": 30.163265306122447,
"alnum_prop": 0.6860622462787551,
"repo_name": "RossBrunton/BMAT",
"id": "91d9618bdd18c88aeaea23f930e5191a72d3f8b2",
"size": "14... |
from msla import app, db
from flask import render_template, session, redirect, request, url_for
from msla.utils import *
from .models import *
from .forms import LoginForm
@app.route("/login", methods=["GET","POST"])
def login():
if isauth():
return redirect('/')
form = LoginForm()
if request.method == 'POST':
... | {
"content_hash": "0bd70605273ee77ac58c6e4191a7de76",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 70,
"avg_line_length": 25.357142857142858,
"alnum_prop": 0.6859154929577465,
"repo_name": "Nguyen-Dang-Thu/MSLA",
"id": "7885d1c96f88a3a88277ef5e4d6ca275502a9c93",
"size": ... |
history_list = {}
| {
"content_hash": "44c58ae1d8b04ea346fdf7df3e5e2af6",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 17,
"avg_line_length": 18,
"alnum_prop": 0.6111111111111112,
"repo_name": "hsnl-dev/vcpe-hub",
"id": "aba251ba801b5e11560a9893027ba098cedb3fcf",
"size": "18",
"binary": fa... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from projects.models import Project, ProjectMember
# @@@ we should have auto slugs, even if suggested and overrideable
class ProjectForm(forms.ModelForm):
slug = forms.SlugField(max_... | {
"content_hash": "d141710e87d2780aa3f2fe8fae9c38c7",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 138,
"avg_line_length": 41.306666666666665,
"alnum_prop": 0.6429954809554551,
"repo_name": "ericholscher/pinax",
"id": "5fb777a90dcd8e156c807414551799563bed9730",
"size": "... |
import warnings
from .. import auth, errors, utils
from ..types import ServiceMode
class ServiceApiMixin(object):
@utils.minimum_version('1.24')
def create_service(
self, task_template, name=None, labels=None, mode=None,
update_config=None, networks=None, endpoint_config=None,
... | {
"content_hash": "9ac0fadbd7519e276000600d01a608b4",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 79,
"avg_line_length": 36.96396396396396,
"alnum_prop": 0.5339182711836867,
"repo_name": "amisrs/one-eighty",
"id": "4972c16d1c4a482270b718e39e81e654097d8fe6",
"size": "12... |
"""
Interactive NLTK Applications:
chartparser: Chart Parser
chunkparser: Regular-Expression Chunk Parser
collocations: Find collocations in text
concordance: Part-of-speech concordancer
nemo: Finding (and Replacing) Nemo regular expression tool
rdparser: Recursive Descent Parser
srparser: Shift-Red... | {
"content_hash": "d761fef7a1f3e65bd172c8413167d8a7",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 66,
"avg_line_length": 28.88235294117647,
"alnum_prop": 0.7053632043448744,
"repo_name": "tadgh/ArgoRevisit",
"id": "2758591984c6ef16d84f7362d114918aa50147ca",
"size": "180... |
"""Support for getting data from websites with scraping."""
import logging
import voluptuous as vol
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.rest.sensor import RestData
from homeassistant.const import (
CONF_N... | {
"content_hash": "0887652135da964bf9facd1cdac8064b",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 83,
"avg_line_length": 31.5578231292517,
"alnum_prop": 0.6413020047424014,
"repo_name": "Cinntax/home-assistant",
"id": "b6a6fdf4896f1fca8001731805a7c026a74f760d",
"size":... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "srt.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really ... | {
"content_hash": "4f509052021f55fdc4cb1c93c8d35bdc",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.095238095238095,
"alnum_prop": 0.6187419768934531,
"repo_name": "true7/srt",
"id": "67a36aa829b60048fde8ed35e121244c34374e41",
"size": "801",
"b... |
"""
The help command. The basic idea is that help texts for commands
are best written by those that write the commands - the admins. So
command-help is all auto-loaded and searched from the current command
set. The normal, database-tied help system is used for collaborative
creation of other help topics such as RP help... | {
"content_hash": "1eeb014b9ae25562616de3871cb99550",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 139,
"avg_line_length": 38.19850187265918,
"alnum_prop": 0.5843710167663496,
"repo_name": "shollen/evennia",
"id": "2d7dd225ded3616b5117644714ba81351e618ba5",
"size": "101... |
from toontown.suit import DistributedFactorySuit
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer
class DistributedMintSuit(DistributedFactorySuit.DistributedFactorySuit):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedMintSuit')
def renameBoss(se... | {
"content_hash": "2fe70dedd61b1850d23d38be60f8070c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 87,
"avg_line_length": 43.25,
"alnum_prop": 0.6628131021194605,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "5780bb8022dfc3ce32347e38a5e37282311da0b6",
"size":... |
from doom.actions.action import Action
from doom.map.objects import Teleporter, Segment, Linedef, Sector
from doom.map.plane import plane_setup
from util.vector import Vector2
# 3D floor line special flag values.
THREED_KIND_SOLID = 0x01
THREED_KIND_SWIMMABLE = 0x02
THREED_KIND_NONSOLID = 0x04
THREED_FLAG_IGNORE_BOTT... | {
"content_hash": "2de0531879293661cc1c8d697b1b433d",
"timestamp": "",
"source": "github",
"line_count": 499,
"max_line_length": 145,
"avg_line_length": 42.899799599198396,
"alnum_prop": 0.5305741112720138,
"repo_name": "GitExl/DoomPath",
"id": "6ee028766e773162525d12cb1c856085b4a3781d",
"size": "21... |
from gael.memcache import memoize
class MyCache:
def __init__(self):
self.cache = {}
def get(self, key):
return self.cache.get(key, None)
def set(self, key, value, *args):
self.cache[key] = value
def test__memoize__with_format_string__uses_interpolated_string_for_key():
val... | {
"content_hash": "aa5aa9c404c4703e1cd9dbc165ce2462",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 74,
"avg_line_length": 22.5,
"alnum_prop": 0.6064814814814815,
"repo_name": "blairconrad/LibraryHippo",
"id": "c2018cca88555a72b1c8d10eed6d43335c543fc8",
"size": "1103",
... |
from graphql import graphql
from .schema import StarWarsSchema
def test_correctly_mutates_dataset():
query = '''
mutation AddBWingQuery($input: IntroduceShipInput!) {
introduceShip(input: $input) {
ship {
id
name
}
faction {
name
... | {
"content_hash": "ae0e291c1ef1cfcd9dc4eb11145d06fc",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 61,
"avg_line_length": 23.023809523809526,
"alnum_prop": 0.4591520165460186,
"repo_name": "miracle2k/graphql-relay-py",
"id": "a4194f94d0677bd30b7f7d8a68d2894b15ed667c",
"s... |
from transitions import Machine
from isha.dict.identity import IDENTITY
from isha.dict.status import STATUS_DICT, STATUS, TRANSITIONS
class player:
def __init__(self, nick):
self.__nick = nick # player's nick in irc
self.__alive = True
self.__max_hp = 0
self.__hp = 0
... | {
"content_hash": "1e0074f4e0da5b6c3bf31a87dc0a9718",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 109,
"avg_line_length": 23.776470588235295,
"alnum_prop": 0.53686293913904,
"repo_name": "Stevearzh/irc-sha",
"id": "bca9a05fc1e63c63aec8a741804eda68f5e38a54",
"size": "202... |
import logging
import telnetlib
from threading import Lock
class ConnectionError(Exception):
def __init__(self, ip, port):
self.ip = ip
self.port = port
def __str__(self):
return 'Error connecting to host %s port %s.' % (self.ip, self.port)
class NoConnectionError(Exception):
de... | {
"content_hash": "a0ab355921b7bdb5cef1b0fba0943111",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 79,
"avg_line_length": 25.954166666666666,
"alnum_prop": 0.5294589821801252,
"repo_name": "nikdoof/python-ts3",
"id": "36b3d47e596e9abf8beeaa1bc96cf746e08ee8b5",
"size": "... |
from django.conf.urls import url, patterns, include
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import cache_page
from common.views import APIRoot, root_redirect_view
apipatterns = patterns(
'',
url(r'^$', login_required(
cache_page(60*60)(APIRoot.as_vi... | {
"content_hash": "f7c4c0a18646c5076e47e4cb7ea7a81d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 43.29032258064516,
"alnum_prop": 0.6646795827123696,
"repo_name": "urandu/mfl_api",
"id": "d073a0552d127934fe244d9dbd80739310ac1e70",
"size": "1342",... |
"""
Define a suite a tests for the Component module.
"""
import pytest
from striplog.rock import Rock
from striplog import Component
from striplog.component import ComponentError
from striplog import Lexicon
r = {'colour': 'grey',
'grainsize': 'vf-f',
'lithology': 'sand'}
r2 = {'grainsize': 'VF-F',
'... | {
"content_hash": "9769945dc5bd436a24b7c5adfa4cc2bb",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 72,
"avg_line_length": 21.986486486486488,
"alnum_prop": 0.6164720344191764,
"repo_name": "EvanBianco/striplog",
"id": "55bde95f18c5527d0ef364c84cdd184ff1142be4",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('delivery2', '0008_remove_emailtemplate_is_system'),
]
operations = [
migrations.AddField(
model_name='emailtemplate',
name='... | {
"content_hash": "663ad58aefdddb8a35e0dad67b5053e3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 23.833333333333332,
"alnum_prop": 0.6223776223776224,
"repo_name": "AlexStarov/Shop",
"id": "6211f8ed31d302e1c9cbeabe78e13279c97e4cb6",
"size": "511"... |
"""
BlueButtonFHIR_API
FILE: fhir_io_hapi.admin
Created: 1/7/16 11:12 AM
"""
__author__ = 'Mark Scrimshire:@ekivemark'
from django.contrib import admin
from .models import ResourceTypeControl
class ResourceTypeControlAdmin(admin.ModelAdmin):
list_display = ('resource_name', 'search_parameter_mask' )
sear... | {
"content_hash": "44ce146cfabb44ce95a086c470ea1ee1",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 22.105263157894736,
"alnum_prop": 0.75,
"repo_name": "ekivemark/BlueButtonFHIR_API",
"id": "ce67d1a28e673149b1f4688120f52e675bfe83d2",
"size": "496",... |
import os
| {
"content_hash": "f0d4a033ce7eadc01e5b3feee0dc0b42",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 9,
"avg_line_length": 10,
"alnum_prop": 0.8,
"repo_name": "nwcrazysword/reversalcode",
"id": "d5dc1256cf3055a767dd68622de2698b45345b62",
"size": "90",
"binary": false,
"... |
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_length'... | {
"content_hash": "4c39ccb9dd8e10cf57a00b3c3df3b102",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 329,
"avg_line_length": 65.31818181818181,
"alnum_prop": 0.6461377870563675,
"repo_name": "Dybov/real_estate_agency",
"id": "bd1ded6110899b9a10e5cef6d3c4497321552ceb",
"siz... |
"""Commands for reading disk types."""
from googlecloudsdk.calliope import base
class DiskTypes(base.Group):
"""Read Google Compute Engine virtual disk types."""
DiskTypes.detailed_help = {
'brief': 'Read Google Compute Engine virtual disk types',
}
| {
"content_hash": "455f02d2dd5089b621dd04b423f319fb",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 61,
"avg_line_length": 21.75,
"alnum_prop": 0.7279693486590039,
"repo_name": "ychen820/microblog",
"id": "3ba18f94bcd894220b2c0323daba7941ad686158",
"size": "311",
"binar... |
import gcc
import gccutils
import sys
# Where our output goes.
output_file = None
# Cleanup functions require special treatment, because they take a
# function argument, but in theory the function must be nothrow.
cleanup_functions = {
'make_cleanup': 1,
'make_cleanup_dtor': 1,
'make_final_cleanup': 1,
... | {
"content_hash": "a5ef9b0ada08efc58e9102890cfe2661",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 86,
"avg_line_length": 39.22641509433962,
"alnum_prop": 0.587012987012987,
"repo_name": "armoredsoftware/protocol",
"id": "6d20b1d73b7b91ff8d80cc92e7a3bf86bb7aa79b",
"size... |
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
from auth.hashers import (is_password_usable,
check_password, make_password, PBKDF2PasswordHasher, load_hashers,
PBKDF2SHA1PasswordHasher, get_hasher, UNUSABLE_PASSWORD)
from django.utils import unittest
from django.utils.unittest impo... | {
"content_hash": "aa5bf45f0027898dee89bd627c663084",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 75,
"avg_line_length": 41.26315789473684,
"alnum_prop": 0.6669096209912536,
"repo_name": "sv1jsb/dwitter",
"id": "19500452eea8b32be031e181ef589c04599393bf",
"size": "5488"... |
import functools
import tensorflow as tf
import numpy as np
from sonnet.python.modules import basic
from sonnet.python.modules import rnn_core
from sonnet.python.ops import nest
from sonnet.python.modules.base import AbstractModule
from sonnet.python.modules.basic import BatchApply, Linear, BatchFlatten
from sonnet.p... | {
"content_hash": "9c41cc6adb41b406a812731b01911eba",
"timestamp": "",
"source": "github",
"line_count": 1545,
"max_line_length": 170,
"avg_line_length": 39.70097087378641,
"alnum_prop": 0.5661743128240243,
"repo_name": "mumuwoyou/vnpy-master",
"id": "b386c63f161df66b19ef7716abe61eb357f6dfb0",
"size... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/boots/shared_boots_tusken_raider.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","boots_tusken_raider")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retur... | {
"content_hash": "dedc31da7a221cfac7ae8a67913a7014",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 25.23076923076923,
"alnum_prop": 0.7134146341463414,
"repo_name": "obi-two/Rebelion",
"id": "59151d4d030552c9ee005e6016a72975f611e586",
"size": "473"... |
from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class Iface:
def setInactivityTimeoutPeriod(self, periodInSeconds):
... | {
"content_hash": "857a1cf67e32f346e480dc5d20d7439e",
"timestamp": "",
"source": "github",
"line_count": 3595,
"max_line_length": 188,
"avg_line_length": 30.53240611961057,
"alnum_prop": 0.6270999599139973,
"repo_name": "jchen123/hadoop-20-warehouse-fix",
"id": "f7464e998ed4587196805b0042dfff3ca7d923a... |
import six
from ...errors.httpforbiddenexception import HttpForbiddenException
import saklient
str = six.text_type
# module saklient.cloud.errors.disabledinsandboxexception
class DisabledInSandboxException(HttpForbiddenException):
## 要求された操作は許可されていません。このゾーンではこの操作は禁止されています。他のゾーンでお試しください。
## @param {int} s... | {
"content_hash": "6f9610ce8c710059260a9b293033dbdf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 176,
"avg_line_length": 38.875,
"alnum_prop": 0.7427652733118971,
"repo_name": "sakura-internet/saklient.python",
"id": "f46b605d7e3e3f093d40e725ceddb056531455ec",
"size": ... |
from __future__ import print_function
import os.path as op
from nose.tools import assert_true, assert_raises
import warnings
from copy import deepcopy
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_equal)
from scipy.fftpa... | {
"content_hash": "dd69825c2c5f08fb7b379528873770d5",
"timestamp": "",
"source": "github",
"line_count": 745,
"max_line_length": 79,
"avg_line_length": 41.05771812080537,
"alnum_prop": 0.6014450111154701,
"repo_name": "jmontoyam/mne-python",
"id": "d6a907cb2dfffb685ccc7f1dee61d02ff0fec1f6",
"size": ... |
import zlib
from socket import gethostname
from warcio.utils import Digester
from warcio.recordbuilder import RecordBuilder
from warcio.statusandheaders import StatusAndHeadersParser
# ============================================================================
class BaseWARCWriter(RecordBuilder):
def __init_... | {
"content_hash": "2bdb1213b265361bc6e77fbac5edc304",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 87,
"avg_line_length": 33.01863354037267,
"alnum_prop": 0.5664033107599699,
"repo_name": "webrecorder/warcio",
"id": "6fb71be94f1137c09421c4a0092cfaa92b581f86",
"size": "5... |
import copy
import subprocess
import unittest
from unittest import mock
from unittest.mock import MagicMock
from parameterized import parameterized
from airflow.exceptions import AirflowException
from airflow.providers.apache.beam.hooks.beam import BeamCommandRunner, BeamHook, beam_options_to_args
PY_FILE = 'apache_... | {
"content_hash": "f8cb047914174a7975b21299e358a4b9",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 110,
"avg_line_length": 38.051383399209485,
"alnum_prop": 0.6095356808974759,
"repo_name": "sekikn/incubator-airflow",
"id": "d0d713e1129e8aef71426fa4e7895cf7932351a8",
"s... |
import requests
import json
import codecs
import time
def fetch(n,origin,filename):
lat1 = 59.29
lat2 = 59.37
long1 = 17.96
long2 = 18.15
delta_lat = (lat2-lat1)/(n-1)
delta_long = (long2-long1)/(n-1)
json_object = {};
features = []
for current_node_id in range(1,n*n+1):
... | {
"content_hash": "e5574e8008a3ddc4a7a4f1015789adc6",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 93,
"avg_line_length": 32.18604651162791,
"alnum_prop": 0.4772398843930636,
"repo_name": "dirrelito/isobike",
"id": "8282fa75dca383a005a280ebd5fd1b3c4e7526aa",
"size": "282... |
test = {
'name': 'shopping-cart',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
sqlite> SELECT * FROM shopping_cart LIMIT 15;
CAKE!|0
cornbread, cornbread, cornbread, cornbread, cornbread|0
cranberries, cranberries, cranberries, cornbread,... | {
"content_hash": "a2e9a6cbea51f6eaa83739564dddde76",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 114,
"avg_line_length": 55.194244604316545,
"alnum_prop": 0.6711418143899895,
"repo_name": "tavaresdong/courses",
"id": "3602047d1ae00439cbc7d125c7fda87d88a4578d",
"size":... |
"""Wind sensor parameters."""
from makani.config import mconfig
from makani.control import system_types
import numpy as np
@mconfig.Config(deps={
'gs': 'base_station.ground_station',
'gs_model': 'base_station.gs_model',
})
def MakeParams(params):
"""Make wind sensor parameters."""
if params['gs_model'] ==... | {
"content_hash": "73849c1f34c81ab0f51ab106842fcc1a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 77,
"avg_line_length": 34.75925925925926,
"alnum_prop": 0.6275972296217368,
"repo_name": "google/makani",
"id": "fbae619ff17365e5a35d1c0aa8c64c0cef4e2262",
"size": "2466",
... |
def checkio(number):
if number % 15 ==0:
return "Fizz Buzz"
elif number % 3 == 0:
return "Fizz"
elif number % 5 == 0:
return "Buzz"
else:
return str(number)
# These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
... | {
"content_hash": "559eed7aa6ede04ff815ba6c1f192703",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 81,
"avg_line_length": 32.64705882352941,
"alnum_prop": 0.5837837837837838,
"repo_name": "Dani4kor/Checkio",
"id": "a9c0703e0c9b75e726f24f9d1d6a14b3a2438612",
"size": "555"... |
import pytest
from plenum.common.messages.fields import HexField
valid_hex_hash = "0123456789abcdefABCDEF"
validator = HexField(length=len(valid_hex_hash))
def test_valid_hex():
assert not validator.validate(valid_hex_hash)
def test_empty_string():
assert validator.validate('')
def test_invalid_length():... | {
"content_hash": "d45aef3bec908854d092693895ebe139",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 23.181818181818183,
"alnum_prop": 0.7274509803921568,
"repo_name": "evernym/plenum",
"id": "13d32e37dedaedd8b47fd686367b802212f77708",
"size": "510",... |
"""
unit test for loop functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
SIMPLE = '''{% for item in seq %}{{ item }}{% endfor %}'''
ELSE = '''{% for item in seq %}XXX{% else %}...{% endfor %}'''
EMPTYBLOCKS = '''<{% for item in ... | {
"content_hash": "d95992ce0b222ae96a364a380c9ea662",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 71,
"avg_line_length": 32.8375,
"alnum_prop": 0.575942139322421,
"repo_name": "dcramer/jinja1-djangosupport",
"id": "ed1cc2ed0820b9a6698e68b6dad4ec0ea7933c6a",
"size": "265... |
import sys
import os
import os.path
import re
import getopt
#
# svn autoprops definitions.
# Copy and paste here the ICU recommended auto-props from
# http://icu-project.org/docs/subversion_howto/index.html
#
# This program will parse this autoprops string, and verify that files in
# the repository have t... | {
"content_hash": "c62209c91c14337509691a7eda48203b",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 108,
"avg_line_length": 38.45454545454545,
"alnum_prop": 0.590307328605201,
"repo_name": "fceller/arangodb",
"id": "4eb505c7fe332705cd6a2f01549171e2a515f539",
"size": "937... |
"""Generates Menus for Bitbar display"""
PATH_TO_SCRIPT = None
def output_for_bitbar(zones):
"""Prints the topology display"""
print("🔊Sonos")
print("---")
for zone in zones:
print_zone(zone)
def print_zone(zone):
"""Prints basic info about the zone and calls functions to
print more ... | {
"content_hash": "a296248f7ba8391b22155521b4bd6f04",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 81,
"avg_line_length": 36.13861386138614,
"alnum_prop": 0.5843835616438356,
"repo_name": "anergictcell/SonosBar",
"id": "dee2283484ca869b19e9e6a1ecb43228513d5c7d",
"size":... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import unittest
import datetime as pydt
import logging
import uuid
import j... | {
"content_hash": "871fbd9b2d9b65f875485e1ed9700039",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 121,
"avg_line_length": 43.13671875,
"alnum_prop": 0.5776510006338857,
"repo_name": "e-mission/e-mission-server",
"id": "13f89d9a31aa9c0bafc6ba9f0a4668d38819799f",
"size":... |
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='souspi',
version='0.1',
description='Raspberry Pi based sous vide cooker',
long_description=readme(),
url='http://github.com/jrheling/souspi',
author='Joshua Heling',
au... | {
"content_hash": "56639d0614e4a994ab3dc78e2d08bcdd",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 109,
"avg_line_length": 34.80769230769231,
"alnum_prop": 0.5867403314917127,
"repo_name": "jrheling/souspi",
"id": "3854f0875b12417dc621a312443b0d6a48d703a4",
"size": "905"... |
import datetime
import factory
from .. import models
from kolibri.core.auth.test.test_api import FacilityUserFactory
class ContentSessionLogFactory(factory.DjangoModelFactory):
class Meta:
model = models.ContentSessionLog
user = factory.SubFactory(FacilityUserFactory)
start_timestamp = datetim... | {
"content_hash": "13778fb84acd8b8eabbea43481e1a647",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 63,
"avg_line_length": 22.53125,
"alnum_prop": 0.7642163661581137,
"repo_name": "DXCanas/kolibri",
"id": "6fd9e25542b9bc06a4316ab39e37d6c035692fe3",
"size": "721",
"binar... |
"""Copyright 2013 Google Inc. All Rights Reserved.
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 ... | {
"content_hash": "96454508ab16e3f7040a8ac2d0a7b099",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 72,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.7720670391061453,
"repo_name": "trein/pinject",
"id": "52260a8ac0d8311be9298e3f4ad67b42d262c530",
"size": "895",
... |
from __future__ import absolute_import, division, print_function, unicode_literals
from tensorboardX import summary
from .expect_reader import compare_proto, write_proto
import numpy as np
import pytest
import unittest
# compare_proto = write_proto # massive update expect
def tensor_N(shape, dtype=float):
numel =... | {
"content_hash": "7944485f1f439e8f0f5e41f3eb467d8d",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 120,
"avg_line_length": 37.82517482517483,
"alnum_prop": 0.5697910889258643,
"repo_name": "lanpa/tensorboardX",
"id": "aa493bba5555f33dd6f485af21473f7d063db14e",
"size": "... |
import logging
import six
from .target import Target
from .memory_map import MemoryType
from . import exceptions
from ..flash.eraser import FlashEraser
from ..debug.cache import CachingDebugContext
from ..debug.elf.elf import ELFBinaryFile
from ..debug.elf.elf_reader import ElfReaderContext
from ..utility.graph import... | {
"content_hash": "d8ee0ff1943f4f8e671eb1c17d2197f7",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 102,
"avg_line_length": 35.76623376623377,
"alnum_prop": 0.6554103122730573,
"repo_name": "mbedmicro/pyOCD",
"id": "fa2b4d9a25bc1ad0635fee62fe26f3476847bc11",
"size": "889... |
import os
import unittest
import shutil
import pygit2
from datetime import datetime, timedelta
from gitmodel.workspace import Workspace
from unicore_gitmodels import models
def get_workspace(repo):
try:
ws = Workspace(repo.path, repo.head.name)
except pygit2.GitError:
ws = Workspace(repo.pat... | {
"content_hash": "3a49470f66abcd0335418c7021bd8a54",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 78,
"avg_line_length": 35.2029702970297,
"alnum_prop": 0.5962593165518211,
"repo_name": "praekelt/unicore-gitmodels",
"id": "08c89e38db55bb68a88663882fd771f801ee24ae",
"si... |
import collections
import contextlib
import copy
import hashlib
import json
import logging
import os
import posixpath
import re
import shutil
import sys
import tempfile
import time
from six.moves import range # pylint: disable=redefined-builtin
from six.moves import zip # pylint: disable=redefined-builtin
from devil... | {
"content_hash": "88c1da6c1f545baf3337828364a30674",
"timestamp": "",
"source": "github",
"line_count": 1690,
"max_line_length": 80,
"avg_line_length": 41.701183431952664,
"alnum_prop": 0.640056757715502,
"repo_name": "chromium/chromium",
"id": "06bc2b1368f529cd42c99b47f1ae7581266bcb7d",
"size": "7... |
"""
Django settings for code_bin project.
Generated by 'django-admin startproject' using Django 1.8.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... | {
"content_hash": "7ab5360bcb39e81736c102a17dec62dd",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 71,
"avg_line_length": 25.87962962962963,
"alnum_prop": 0.6862254025044723,
"repo_name": "andrewjenkins/code_bin",
"id": "b8308e5e3c822176c07c1ce89f9138d3bf2f05e2",
"size"... |
"""Networks for the PPO algorithm defined as recurrent cells."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
_MEAN_WEIGHTS_INITIALIZER = tf.contrib.layers.variance_scaling_initializer(factor=0.1)
_LOGSTD_INITIALIZER = tf.random_... | {
"content_hash": "2080a8753dd40df4b9a34b7d1486c702",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 101,
"avg_line_length": 40.35761589403973,
"alnum_prop": 0.6291434197571382,
"repo_name": "MTASZTAKI/ApertusVR",
"id": "d2c22bd0f221f93a190c4e068414c793f7b0e641",
"size": ... |
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest ; pytest
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
# External impo... | {
"content_hash": "5ee4099bec64ee3c37a1385e0c3094cb",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 91,
"avg_line_length": 32.21818181818182,
"alnum_prop": 0.3301354401805869,
"repo_name": "stonebig/bokeh",
"id": "2e8833363345efb5c0264f17b81116629f4fbf25",
"size": "2276",... |
"""pools: a resource to handle storage pool management
A pool is added by an operator by interacting with the
pooling-related endpoints. When specifying a pool, the
following fields are required:
::
{
"name": string,
"weight": integer,
"uri": string::uri
}
Furthermore, depending on t... | {
"content_hash": "9d2d8046fed037a2fe5a1c90be2221ba",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 75,
"avg_line_length": 30.728813559322035,
"alnum_prop": 0.5584666298952013,
"repo_name": "openstack/zaqar",
"id": "0f47c6ff215d040e6dc27c853b6c4aaea5b7125e",
"size": "784... |
import scrapy
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from pprint import pprint
import urlparse
from competitor_prices.items import Product
def to_float(extract):
out = 0.0
if len(extract) > 0:
out = extract[0]
out = out.replace("$","")... | {
"content_hash": "abb897ba3cc12635adf3a7dfd8575495",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 105,
"avg_line_length": 38.95049504950495,
"alnum_prop": 0.6288764616166751,
"repo_name": "vlandham/social_shopper",
"id": "e143df51e84e8e63b99cb120e5b812d67906318b",
"siz... |
from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication (SessionAuthentication):
def enforce_csrf(self, request):
return | {
"content_hash": "ed7226f2c26e0799e8f494bbadcfc8ac",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 63,
"avg_line_length": 34,
"alnum_prop": 0.8588235294117647,
"repo_name": "vingle1/AfriCuisine",
"id": "ef7dd5623cebfc00db7ff526a2bf1ff5da191909",
"size": "170",
"binary":... |
"""
rand Module provide random-relevant functions
Required Library
- comlib.conv
- hashlib
TODO:
-
"""
def getMD5(data):
import hashlib
return hashlib.md5(data).hexdigest()
def getRandInt():
pass
def getRandFloat():
pass
def getGaussian():
pass
| {
"content_hash": "1cf5a3994cf6c40c3b1769826b789882",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 45,
"avg_line_length": 9.125,
"alnum_prop": 0.6335616438356164,
"repo_name": "yan9yu/lib",
"id": "8074dee65e102924de006bae62da73d0ea0a7e31",
"size": "335",
"binary": fals... |
import os.path
import signal
from ducktape.services.service import Service
from ducktape.utils.util import wait_until
from kafkatest.directory_layout.kafka_path import KafkaPathResolverMixin
class StreamsTestBaseService(KafkaPathResolverMixin, Service):
"""Base class for Streams Test services providing some com... | {
"content_hash": "273a487d157b7a54d75eb1e47da05e9d",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 171,
"avg_line_length": 44.75316455696203,
"alnum_prop": 0.6187243671333617,
"repo_name": "rhauch/kafka",
"id": "e7be9475f79f897556217993df0b42130244e14b",
"size": "7852",... |
NWID=1
NR_NODES=20
#Controllers=[{"ip":'127.0.0.1', "port":6633}, {"ip":'10.0.1.28', "port":6633}]
Controllers=[{"ip":'10.0.1.28', "port":6633}]
"""
Start up a Simple topology
"""
from mininet.net import Mininet
from mininet.node import Controller, RemoteController
from mininet.log import setLogLevel, info, error, war... | {
"content_hash": "0e1a0a4d1e8f3d07b85e9b5331312cb8",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 84,
"avg_line_length": 29.357615894039736,
"alnum_prop": 0.5598917211820438,
"repo_name": "opennetworkinglab/spring-open",
"id": "0fc96f1f7e07023ca433f9ccce31ca0905b8930e",
... |
from __future__ import print_function
import argparse
from bcc import BPF, USDT, USDTException
import os
import sys
from subprocess import call
from time import sleep, strftime
class Category(object):
THREAD = "THREAD"
METHOD = "METHOD"
OBJNEW = "OBJNEW"
CLOAD = "CLOAD"
EXCP = "EXCP"
GC = "GC"
... | {
"content_hash": "cdfcf0cd01256bd49fc302fae5da84b2",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 85,
"avg_line_length": 40.54355400696864,
"alnum_prop": 0.518133379168099,
"repo_name": "iovisor/bcc",
"id": "3f4287bfe8b02366bf519258e8d8ba3d9a1194bd",
"size": "12410",
... |
"""
Core request classes that implement calls available in all versions of RWS.
RWSRequest subclasses represent URL endpoints. They can be passed to a RWSConnection get or post method
as appropriate.
TODO: Note that might want to make the Request objects responsible for deciding whether they are get, post, patch etc.... | {
"content_hash": "3a6a2a470d9a015a1cf633be6f83737f",
"timestamp": "",
"source": "github",
"line_count": 527,
"max_line_length": 121,
"avg_line_length": 33.30740037950664,
"alnum_prop": 0.5775081182703812,
"repo_name": "Oli76/rwslib",
"id": "48d1cc929b6f628e4cc178f9b350caabb2a10d42",
"size": "17553"... |
import utils.xmls as xml_utils
import datetime
import os
import time
from teams.models import Team
from games.models import Game
from players.models import Player
from eventstatistics.models import EventStatistic
from qualifiers.models import Qualifier
from django.core.management.base import BaseCommand
def is_tag(... | {
"content_hash": "f2c996626af735a9e9d4b5b5316a5214",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 115,
"avg_line_length": 31.31140350877193,
"alnum_prop": 0.6398655273847877,
"repo_name": "awyrough/xsoccer",
"id": "9fa148995d19778dfc3be0d876adcea75e1558f5",
"size": "71... |
"""
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
All rights reserved.
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
... | {
"content_hash": "1a64239d1aeb4304ce4a395cc9f94c92",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 76,
"avg_line_length": 31.32608695652174,
"alnum_prop": 0.707147814018043,
"repo_name": "ahealy19/F-IDE-2016",
"id": "a9e66aaa15057125d58225c4db04890345554b35",
"size": "14... |
"""Tests for tensorflow.ops.io_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
import tensorflow.python.platform
import tensorflow as tf
import numpy as np
import six
from tensorflow.python.platform import gfile
class ... | {
"content_hash": "cc9cb0f8619149a92b33f67b404b842c",
"timestamp": "",
"source": "github",
"line_count": 572,
"max_line_length": 79,
"avg_line_length": 38.17832167832168,
"alnum_prop": 0.630506456635223,
"repo_name": "miyosuda/intro-to-dl-android",
"id": "af4c6a6e60b626d07a9cfc79b9b2c63cf96ab876",
"... |
from django.core.exceptions import ObjectDoesNotExist
from hkm.models.campaigns import CampaignStatus, Campaign
from hkm.models.models import ProductOrderCollection
class OrderCreator(object):
def validate_basket(self, basket):
# For now validate that discounts are still valid
for line in basket... | {
"content_hash": "1623038c023ce900b3e78a0a5312983d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 116,
"avg_line_length": 43.904761904761905,
"alnum_prop": 0.6198481561822126,
"repo_name": "andersinno/kuvaselaamo",
"id": "ff93037d89b2b1445a7006270218ea0525ffd873",
"size... |
from fabric.api import env, run
from fabric.contrib.files import append
import config
import datetime
import os
import socket
LOCAL_PUBKEY_FILE = os.path.expanduser('~') + '/.ssh/' + 'id_rsa.pub'
def get_hosts():
hosts = {}
for addr in config.HOSTS:
if ':' in addr:
ip,port = addr.split(":"... | {
"content_hash": "ee9b80135096e8881684a43dbd11bb44",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 69,
"avg_line_length": 26.391304347826086,
"alnum_prop": 0.6013179571663921,
"repo_name": "bopjiang/ssh-no-password",
"id": "31277a503fd89668d5cdce58bae965d57ae28201",
"siz... |
import argparse
import requests
import sys
import time
import os
def ping(url, expected_status=200):
ca_file = os.path.join(os.path.abspath(os.path.split(__file__)[0]), 'cacert.pem')
try:
r = requests.get(url, verify=ca_file)
except Exception as e:
sys.stderr.write('Error: ' + str(e) + '... | {
"content_hash": "5b17aec49dd006ea19effb398e0db433",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 122,
"avg_line_length": 26.68,
"alnum_prop": 0.5847076461769115,
"repo_name": "adlibre/ssl-ping",
"id": "9dfbf0a2681f047d3ba0704ef276d96f8562aa24",
"size": "1357",
"binar... |
import Gaffer
class TestNode( Gaffer.Node ) :
def __init__( self, name = "TestNode" ):
super( TestNode, self ).__init__( name=name )
self._nodeValueChangedConnection = Gaffer.Metadata.nodeValueChangedSignal().connect( Gaffer.WeakMethod( self.__nodeValueChanged ) )
self._plugValueChangedConnection = Gaffer.Met... | {
"content_hash": "89357a091f8dcc6e1414b7dd7981111b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 136,
"avg_line_length": 30.96153846153846,
"alnum_prop": 0.7354037267080745,
"repo_name": "ivanimanishi/gaffer",
"id": "21cd4f09ed3ac52d557573b3412a71fffa7bc63e",
"size": "... |
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# Application... | {
"content_hash": "647963619b74ff6d9ba99194df6cca25",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 71,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.7407166123778501,
"repo_name": "gilsondev/istari",
"id": "0dee3ee7a0d8442a6b92f4bc1df92f020ce3dacb",
"size": "163... |
from django.core.handlers.base import BaseHandler
from django.urls import resolve
from django.utils.deprecation import MiddlewareMixin
def bypass_middleware(view):
view.bypass_middleware = True
return view
class BypassMiddleware(MiddlewareMixin):
"""
Customized version of a gist detailing this tech... | {
"content_hash": "a341f1dc4e4f2652f1c629ac56b9002c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 77,
"avg_line_length": 32.57142857142857,
"alnum_prop": 0.6657894736842105,
"repo_name": "WikiWatershed/model-my-watershed",
"id": "ede9d97645e9cbdbebf922d86fcde94c306f8efa",... |
from .creative_work import CreativeWork
class Recipe(CreativeWork):
"""Defines a cooking recipe.
Variables are only populated by the server, and will be ignored when
sending a request.
:param _type: Constant filled by server.
:type _type: str
:ivar id: A String identifier.
:vartype id: s... | {
"content_hash": "45865ebb47909f95908730cf57e3944f",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 79,
"avg_line_length": 41.01,
"alnum_prop": 0.5986344793952695,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "842d959109b983d26c1ad0d7ad90cf6458138e97",
"size": "... |
#!/usr/bin/env python3
"""Generate psa_constant_names_generated.c
which is included by programs/psa/psa_constant_names.c.
The code generated by this module is only meant to be used in the context
of that program.
An argument passed to this script will modify the output directory where the
file is written:
* by defaul... | {
"content_hash": "aade822926dac042eab121bff5d26cc0",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 92,
"avg_line_length": 36.468023255813954,
"alnum_prop": 0.5585492227979275,
"repo_name": "ARMmbed/mbedtls",
"id": "960a07986fdc3cd3adf1e950315e7d76b266857f",
"size": "125... |
import sys
sys.path.append('..')
from dojo.models import Product
from dojo.models import Endpoint
from dojo.endpoint import views
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from cus... | {
"content_hash": "e4fd750d835def68057c5d95251abdac",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 103,
"avg_line_length": 37.32890365448505,
"alnum_prop": 0.6407974368102528,
"repo_name": "OWASP/django-DefectDojo",
"id": "a494de4ef042ae2737cc7144cc749e9e7a77f2c9",
"siz... |
"""The tests for Philips Hue device triggers for V2 bridge."""
from aiohue.v2.models.button import ButtonEvent
from homeassistant.components import hue
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.components.hue.v2.device import async_setup_devices
from homeassistant.c... | {
"content_hash": "02e8241deb1d02f0cf5a91ddeae6fb40",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 86,
"avg_line_length": 35.824175824175825,
"alnum_prop": 0.6260736196319019,
"repo_name": "GenericStudent/home-assistant",
"id": "a5e60b965fdc55afea2c9979d82d3d48d2d7ee3b",
... |
from servicemanager import ServiceManager
def Service(name):
if not ServiceManager.is_initialized:
ServiceManager.load_all()
return ServiceManager.fetch_service(name)
| {
"content_hash": "8f928bd2d507963828d910ad05e145c0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 45,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.7663043478260869,
"repo_name": "pywebdata/pywebdata",
"id": "8d6df4d3b4a5f55be7940ba485e4e8664410f073",
"size": "1... |
'''
Created on Sep 17, 2012
@author: Gary
'''
import unittest
from housemonitor.lib.moduleloader import ModuleLoader
import logging.config
from mock import Mock, patch
import os
class Test( unittest.TestCase ):
logger = logging.getLogger( 'lib' )
def setUp( self ):
logging.config.fileConfig( "unitt... | {
"content_hash": "ac837f4ed0bc99f591946adfd28c0e93",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 112,
"avg_line_length": 42.38961038961039,
"alnum_prop": 0.5419730392156863,
"repo_name": "gary-pickens/HouseMonitor",
"id": "a740acc5936f249daa53d3e08efe0b7bc5e3e671",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.