text stringlengths 4 1.02M | meta dict |
|---|---|
from flask_socketio import SocketIO
from flask_socketio import send, emit
from flask_socketio import Namespace
class MyCustomNamespace(Namespace):
def on_connect(self):
send("connection received")
def on_disconnect(self):
print("connection ter... | {
"content_hash": "5d3f522a6ca4d02a77213b54452fa35d",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 94,
"avg_line_length": 21.680851063829788,
"alnum_prop": 0.591756624141315,
"repo_name": "glenn-edgar/local_controller_3",
"id": "f8a26287a6945286ebf1841388b170085634704d",
... |
import binascii
import pkgutil
import textwrap
from binascii import unhexlify, a2b_base64, b2a_base64
from hashlib import sha256
from ..helpers import Manifest, NoManifestError, Error, yes, bin_to_hex
from ..repository import Repository
from .key import KeyfileKey, KeyfileNotFoundError, KeyBlobStorage, identify_key
... | {
"content_hash": "3a3e4c7b6e7c3c7ecebbcce1b27c374a",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 130,
"avg_line_length": 36.12903225806452,
"alnum_prop": 0.5028061224489796,
"repo_name": "edgimar/borg",
"id": "f6564a884c92fbc92f0fb195885e3c94d5301a17",
"size": "7840",... |
"""App name"""
from django.apps import AppConfig
class X509PkiConfig(AppConfig):
name = "x509_pki"
| {
"content_hash": "6ff236a1dc900db0a86de16c61b8bb87",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 33,
"avg_line_length": 15.142857142857142,
"alnum_prop": 0.6981132075471698,
"repo_name": "repleo/bounca",
"id": "02d825103f764ff8cf90f9958f81479cf23c02aa",
"size": "106",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/kaadu/shared_lair_kaadu_swamp.iff"
result.attribute_template_id = -1
result.stfName("lair_n","kaadu_swamp")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "1473c62f32cce4087c391a93548cfd59",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 23.384615384615383,
"alnum_prop": 0.6907894736842105,
"repo_name": "anhstudios/swganh",
"id": "f8e483c6496bae18dd6867b8b96f3f4cf2827e57",
"size": "44... |
from django.contrib import admin
from .models import Question, Choice
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date'], '... | {
"content_hash": "a5f152b7cee88b18769e2269c98d50c8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 80,
"avg_line_length": 30,
"alnum_prop": 0.6403508771929824,
"repo_name": "cloudhotspot/pypackage-docker",
"id": "368c40c21f0d52fdcd47964709209b7c2d0af5b0",
"size": "570",
... |
import os
import shutil
from colorama import init, Fore, Style
init()
from configobj import ConfigObj
import fabric_colors
def quickstart():
"""
Run `fabc-quickstart` in your console to get started with fabric-colors!
"""
venv = os.path.basename(os.getenv('VIRTUAL_ENV'))
if venv:
print ... | {
"content_hash": "d323b8ddac1b56fe0dc778af8f97adf5",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 101,
"avg_line_length": 34.2,
"alnum_prop": 0.5705263157894737,
"repo_name": "fabric-colors/fabric-colors",
"id": "1d635d053370ad989c4f1e49eae85da8f0d4fda1",
"size": "4275... |
lines = []
all_lines = open("salida.txt").readlines()
size = len(all_lines)
count = 0
# TODO: check that they're actually hidden
HIDDEN_METHODS = [
'getAccessibilityNodeProvider',
'getIteratorForGranularity',
'getViewRootImpl',
'getHardwareRenderer',
'getDisplayList',
]
def generate_new_line(new_line):
method_n... | {
"content_hash": "df711914bb6577053821b573f18cdb32",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 182,
"avg_line_length": 35.989583333333336,
"alnum_prop": 0.6017366136034732,
"repo_name": "edlectrico/android-dynamic-ui",
"id": "144b225d4f87d8805ad0088cbdad3735d91b269e",
... |
"""Utilities for OAuth.
Utilities for making it easier to work with OAuth 2.0
credentials.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import os
import threading
from oauth2client.client import Credentials
from oauth2client.client import Storage as BaseStorage
class CredentialsFileSymbolicLinkError(Ex... | {
"content_hash": "0b28d7c679a8d058a81daefed71e9013",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 74,
"avg_line_length": 26.38888888888889,
"alnum_prop": 0.5968421052631578,
"repo_name": "itielshwartz/BackendApi",
"id": "211793b774851715f60c1b8a0758ac50882c26c9",
"size... |
import os
import os.path
import pkgutil
import sys
import tempfile
__all__ = ["version", "bootstrap"]
_SETUPTOOLS_VERSION = "21.2.1"
_PIP_VERSION = "8.1.2"
# pip currently requires ssl support, so we try to provide a nicer
# error message when that is missing (http://bugs.python.org/issue19744)
_MISSING_SSL_MESSA... | {
"content_hash": "799af30883e123fc39adc3f80da5e8f4",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 78,
"avg_line_length": 30.580952380952382,
"alnum_prop": 0.6086888819682342,
"repo_name": "timm/timmnix",
"id": "9c601218c2cbb3b7f00bab292295906a613ad18f",
"size": "6422",... |
"""
This file was generated with the customdashboard management command and
contains the class for the main dashboard.
To activate your index dashboard add the following to your settings.py::
GRAPPELLI_INDEX_DASHBOARD = 'blog.dashboard.CustomIndexDashboard'
"""
from django.utils.translation import ugettext_lazy a... | {
"content_hash": "f69da97e04a676777e5129f4820f95fd",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 74,
"avg_line_length": 31.728070175438596,
"alnum_prop": 0.48603815316560683,
"repo_name": "varunsagi20/varunmehta.me",
"id": "38a7b660fe95b9bb73e32c6901ce7adb21f9beda",
"... |
"""This plugin generates tab completions for Beets commands for the Fish shell
<https://fishshell.com/>, including completions for Beets commands, plugin
commands, and option flags. Also generated are completions for all the album
and track fields, suggesting for example `genre:` or `album:` when querying the
Beets dat... | {
"content_hash": "68f8e2d6388bb470e7bfb092bcce9f7b",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 79,
"avg_line_length": 35.464944649446494,
"alnum_prop": 0.5302257829570284,
"repo_name": "shamangeorge/beets",
"id": "12f474e88b181e47ab4923d4710388cbee265f80",
"size": "... |
"""Sparse rational function fields. """
from operator import add, mul
from sympy.core.expr import Expr
from sympy.core.sympify import CantSympify, sympify
from sympy.polys.rings import PolyElement
from sympy.polys.monomialtools import lex
from sympy.polys.polyerrors import ExactQuotientFailed, CoercionFailed
from sym... | {
"content_hash": "4f59a0ea2f1db334c1a10fababd78097",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 118,
"avg_line_length": 32.68055555555556,
"alnum_prop": 0.5485196203428248,
"repo_name": "amitjamadagni/sympy",
"id": "5accf9a0b3a332bef1445da950dee1bdd515b6b2",
"size": ... |
"""
Read/Write AMQP frames over network transports.
2009-01-14 Barry Pederson <bp@barryp.org>
"""
# Copyright (C) 2009 Barry Pederson <bp@barryp.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Softwa... | {
"content_hash": "f922af3496401a064cf5b3b93a8e70d9",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 92,
"avg_line_length": 24.472727272727273,
"alnum_prop": 0.5841381872213968,
"repo_name": "sorenh/cc",
"id": "3c82f456b1e69cd287b3d1fbdcd68d28aa178950",
"size": "5384",
... |
import oslo_serialization
from cinder.i18n import _
from cinder.volume.drivers.coprhd.helpers import commoncoprhdapi as common
from cinder.volume.drivers.coprhd.helpers import consistencygroup
from cinder.volume.drivers.coprhd.helpers import volume
class Snapshot(common.CoprHDResource):
# Commonly used URIs for... | {
"content_hash": "c0d8e10e91995433a804fbc54de544e5",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 78,
"avg_line_length": 36.946280991735534,
"alnum_prop": 0.5345039704731015,
"repo_name": "ge0rgi/cinder",
"id": "857b8babdeab596fd66e20224efe1a533358c0fd",
"size": "9575"... |
INTRODUCTION_HASH = '#intro'
LOG_FMT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
DOCS_COMMIT_MESSAGE = 'Updated docs'
REQUIREMENT_COMMIT_MESSAGE = 'Updated requirements.txt file by MOOC workbench'
WORKBENCH_COMMIT_MESSAGES = [DOCS_COMMIT_MESSAGE, REQUIREMENT_COMMIT_MESSAGE]
EXTRA_INDEX_URL = 'https://packa... | {
"content_hash": "b39b7e657012c1c0d7a22e0a6123b621",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 78,
"avg_line_length": 57.166666666666664,
"alnum_prop": 0.7463556851311953,
"repo_name": "MOOCworkbench/MOOCworkbench",
"id": "d0e87a0f9d7cf05039e23b649bce2c2788d9e781",
"s... |
__all__ = [
'run',
]
import six
from glance.api.v2 import images as v2_api
from glance.common import exception
from glance.common.scripts import utils as script_utils
from glance.common import store_utils
from glance.common import utils as common_utils
from glance import i18n
from glance.openstack.common import e... | {
"content_hash": "0884bd8972846eb40ee4519e80fedd7f",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 79,
"avg_line_length": 38.76158940397351,
"alnum_prop": 0.607722535451905,
"repo_name": "redhat-openstack/glance",
"id": "5e9dc5c72c10b5c7317da57b9225cd24191d8658",
"size"... |
"""
backend.users
~~~~~~~~~~~~~~
backend users package
"""
from ..core import Service
from .models import User
class UsersService(Service):
__model__ = User
| {
"content_hash": "c954e0a5f348651c94e368d906fd6875",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 28,
"avg_line_length": 13.615384615384615,
"alnum_prop": 0.5932203389830508,
"repo_name": "peterlada/backend",
"id": "356daf4d5f4894ee62d1089e4ff0e7f2a9a906e9",
"size": "20... |
from django.db import models
from django.conf import settings
class DatabaseQueryset(models.query.QuerySet):
def load(self):
for db in self.all():
db.load()
def unload(self):
for db in self.all():
db.unload()
class DatabaseManager(models.Manager):
... | {
"content_hash": "6bf37f9773cfa1c7eb395614a0655932",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 57,
"avg_line_length": 27.045454545454547,
"alnum_prop": 0.6033613445378151,
"repo_name": "allanlei/django-saas",
"id": "54c24341a1ff0201563cc65ec22b71633601ef82",
"size": ... |
from django.contrib.gis.db import models
from django.contrib.gis import geos
from django.contrib.gis.measure import *
from django.db import connection
from django.conf import settings
def kml_doc_from_queryset(qs):
dict = {}
placemarks = []
for item in qs:
placemarks.append( kml_placemark... | {
"content_hash": "8c2f833e6d4782226149ee91d89035c8",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 122,
"avg_line_length": 39.92248062015504,
"alnum_prop": 0.6349514563106796,
"repo_name": "Alwnikrotikz/marinemap",
"id": "107c1357f8d8dbe916a29b5cc788bc32a6115f90",
"size... |
"""Integration tests for the pr_curves plugin."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
import os.path
import numpy as np
import six
import tensorflow as tf
from tensorboard.backend.event_processing import plu... | {
"content_hash": "7d643015a4542b7b9a1a0be830b18104",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 127,
"avg_line_length": 40.013698630136986,
"alnum_prop": 0.6677507702841493,
"repo_name": "agrubb/tensorboard",
"id": "1a9a2744d30c5ded016a88d9493d09a10592cb13",
"size": ... |
from django.shortcuts import render, get_object_or_404
from django.utils.safestring import mark_safe
from extensions.views import tab_extension, TabExtensionDelegate
from resourcehandlers.aws.models import AWSHandler
from resourcehandlers.models import ResourceHandler
from typing import Dict
from utilities.exceptions... | {
"content_hash": "9a8e69d979107ccb1e649098c0d86624",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 115,
"avg_line_length": 38.973544973544975,
"alnum_prop": 0.6721422753190334,
"repo_name": "CloudBoltSoftware/cloudbolt-forge",
"id": "926a90be3431c696d91523d5a02c1aa5316758... |
"""
From NumbaPro
"""
from __future__ import print_function, division, absolute_import
import dis
import sys
import inspect
from collections import namedtuple
from numba import errors, utils
from numba.config import PYVERSION
opcode_info = namedtuple('opcode_info', ['argsize'])
def get_function_object(obj):
"... | {
"content_hash": "45aea068a05603d049f43e8247f9217d",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 86,
"avg_line_length": 28.883116883116884,
"alnum_prop": 0.5053956834532374,
"repo_name": "GaZ3ll3/numba",
"id": "5a992d4afce89799a3ef8c23833e995e41deb98e",
"size": "11120... |
from msrest.serialization import Model
class Emotion(Model):
"""Properties describing facial emotion in form of confidence ranging from 0
to 1.
:param anger:
:type anger: float
:param contempt:
:type contempt: float
:param disgust:
:type disgust: float
:param fear:
:type fear:... | {
"content_hash": "330c5baf39eadcf4d79caf8f114951da",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 134,
"avg_line_length": 30.847826086956523,
"alnum_prop": 0.5757575757575758,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "16764d94baed268241a505f4b03d143e57f3c5be"... |
"""Distributed execution using an IPython cluster.
Uses IPython parallel to setup a cluster and manage execution:
http://ipython.org/ipython-doc/stable/parallel/index.html
Borrowed from Brad Chapman's implementation:
https://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/pipeline/ipython.py
"""
| {
"content_hash": "b89530f28f06bdadde5676ad03e8f46f",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 79,
"avg_line_length": 37.875,
"alnum_prop": 0.8052805280528053,
"repo_name": "poojavade/Genomics_Docker",
"id": "a50470c8e1a9b880b25b429b6e327b72ed831120",
"size": "303",
... |
from StringIO import StringIO
import csv
from hashlib import md5
from aludel.database import get_engine
from aludel.service import (
service, handler, get_url_params, get_json_params, set_request_id,
APIError, BadRequestParams,
)
from twisted.internet.defer import inlineCallbacks, returnValue
from .models im... | {
"content_hash": "0da58f8e3e224db4ee8b7510ac9adb63",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 78,
"avg_line_length": 35.7888198757764,
"alnum_prop": 0.5869489760499826,
"repo_name": "praekelt/unique-code-service",
"id": "2265f91c61c5a4639601c44ef28fc78fd9da8edf",
"... |
import os
from common import *
class SIPBuilder:
def __init__(self, doxyparse, outputdir):
self.doxyparser = doxyparse
self.output_dir = outputdir
def make_bindings(self):
output_dir = os.path.abspath(os.path.join(self.output_dir, "sip"))
if not os.path.exists(output_dir):
... | {
"content_hash": "5806a19e66088b73d9ea9ba7f0620541",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 134,
"avg_line_length": 36.17857142857143,
"alnum_prop": 0.5294504771306351,
"repo_name": "ric2b/Vivaldi-browser",
"id": "ac8d2fb20b917187f9c253fd0b267a4300ae41ce",
"size":... |
import scrapy,csv,time
from scraping.items import lysitem
class LysSpider(scrapy.Spider):
''' Class contains two property name which is the spider
name, and Download_delay'''
name = "lys"
DOWNLOAD_DELAY = 0.25
def start_requests(self):
'''Here Fetched the catagory Squash to speed up... | {
"content_hash": "2c5c1398107992953c57c241973cd854",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 119,
"avg_line_length": 48.45945945945946,
"alnum_prop": 0.5906302286670385,
"repo_name": "apoorvrajsaxena/FlaskScrapy",
"id": "091a77e75e2870e7d03b1974ba19a8d95ecf206b",
"... |
import pywt._extensions._cwt
from scipy.linalg import _fblas
import scipy.spatial.ckdtree
import sys
# from tensorflow.contrib.framework.python.ops import gen_variable_ops
from src.tracker import Tracker
import tkinter as tk
import warnings
import cv2
import time
import pickle
from keras.models import load_model
fro... | {
"content_hash": "4332cf9182877cf97ec989c1cc8354eb",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 176,
"avg_line_length": 38.515337423312886,
"alnum_prop": 0.6116597642561326,
"repo_name": "kai06046/opencv-tracker-interface",
"id": "ab1a3c48d431a68f1d28923baa60d8706dc45a... |
from heatclient.common import utils
from heatclient import exc
from heatclient.v1 import resources as hc_res
import mock
import os
import testtools
class ShellTest(testtools.TestCase):
def test_format_parameter_none(self):
self.assertEqual({}, utils.format_parameters(None))
def test_format_parameter... | {
"content_hash": "0e8f6aa89604a1b5fe08b0a84cdb7704",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 79,
"avg_line_length": 41.333333333333336,
"alnum_prop": 0.5375733137829912,
"repo_name": "ecerulm/python-heatclient",
"id": "10946eb6a293712a3c7d5a938992521961661a7b",
"s... |
import asyncio
import collections
import logging
import os
import threading
import time
import traceback
import unittest
import pytest
from integration_tests.env_variable_names import (
SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN,
SLACK_SDK_TEST_RTM_TEST_CHANNEL_ID,
)
from integration_tests.helpers import async_test... | {
"content_hash": "8697053dfed693451002a434e035d916",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 122,
"avg_line_length": 34.89820359281437,
"alnum_prop": 0.557652711050103,
"repo_name": "slackapi/python-slackclient",
"id": "b2a64ef70763ecd6e24c163bd3026f9603e7cb9f",
"... |
"""
Provide functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
import asyncio
from datetime import timedelta
import logging
import os
from typing import Any, Sequence, Callable
import voluptuous a... | {
"content_hash": "76563ebe740d2d97de2dae166bb442cf",
"timestamp": "",
"source": "github",
"line_count": 562,
"max_line_length": 79,
"avg_line_length": 35.08896797153025,
"alnum_prop": 0.6053245436105477,
"repo_name": "oandrew/home-assistant",
"id": "b00a1044ad66d36b25cc152f0b43acce205a8c8b",
"size"... |
import mwparserfromhell
import pywikibot
pywikibot.config.family = "wikipedia"
pywikibot.config.mylang = "en"
site = pywikibot.Site()
site.login()
source = pywikibot.Page(site, "Template:Infobox company")
titles = [source.title(withNamespace=False).lower()]
for reference in source.getReferences(withTemplateInclusion... | {
"content_hash": "9469a697da5924e621bf148ef3c08fd6",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 132,
"avg_line_length": 33.80555555555556,
"alnum_prop": 0.6589975349219392,
"repo_name": "HazardSJ/HazardBot",
"id": "adcd963b7fa798eedd90e7b228facd260543d7ca",
"size": "1... |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------
project = 'GoodVibes'
copyright = '2020, Luchini, G.; Alegre-Requena J. V.; Guan, Y.; Funes-Ardoiz, I.; Paton, R. S.'
author = 'Luchini, G.; Alegre-Requena J. V.; Guan, Y.... | {
"content_hash": "32df6dad1006218a062e4d3a9163141f",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 95,
"avg_line_length": 30.412121212121214,
"alnum_prop": 0.6462734157034675,
"repo_name": "bobbypaton/GoodVibes",
"id": "4547d5515992d22ca9f895a9acbd7adcbf956463",
"size":... |
from thumbor.filters import BaseFilter, filter_method
from thumbor.ext.filters import _convolution
class Filter(BaseFilter):
"""
Usage: /filters:convolution(<semicolon separated matrix items>, <number of columns in matrix>, <should normalize boolean>)
Example of blur filter: /filters:convolution(1... | {
"content_hash": "ce7176dc0cfd1ac6f4d0bc93554acd56",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 130,
"avg_line_length": 50.25,
"alnum_prop": 0.6629353233830846,
"repo_name": "figarocms/thumbor",
"id": "24b612fc6290477746a95f79a5373b909b360b7f",
"size": "1037",
"bina... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Project.flp'
db.alter_column(u'projects_project', 'flp_id', self.gf('django.db.models.fields.related.ForeignKey')... | {
"content_hash": "37148559cb65dc06a7621418cbcc16fa",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 187,
"avg_line_length": 67.80898876404494,
"alnum_prop": 0.5658657829328915,
"repo_name": "Hackfmi/Diaphanum",
"id": "1ee0980b3c5dc473b8cb01e863723caa6db7b6e8",
"size": "60... |
"""
New Zealand (North and South Island) city and district councils.
Source: http://en.wikipedia.org/wiki/Territorial_authorities_of_New_Zealand
District council choices are in format:
('Name', _('Name District')),
eg.
('Selwyn', _('Selwyn District')),
City council choices are in format:
('Name', _('... | {
"content_hash": "61f77b96f92a8c06b4fdf93eac232d97",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 75,
"avg_line_length": 34.23762376237624,
"alnum_prop": 0.5908039329091961,
"repo_name": "maisim/django-localflavor",
"id": "eea182d6448d933cb9fc7f8e6e4a11b8f02230b7",
"si... |
"""Controllers for the collections editor."""
from core.controllers import base
from core.domain import acl_decorators
from core.domain import collection_services
from core.domain import rights_manager
from core.domain import summary_services
from core.platform import models
import feconf
import utils
current_user_se... | {
"content_hash": "5fd98ce0a9f171db1cac5c71cf01ea44",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 80,
"avg_line_length": 38.31683168316832,
"alnum_prop": 0.6386304909560724,
"repo_name": "shaz13/oppia",
"id": "aba4dec0f8798db6d7360cabd6a3869bb595bcba",
"size": "8362",
... |
"""
hello_ga4gh_client.py
Provides examples of using GA4GH compliant API using
a supplied client library.
"""
# In this example we will use the ga4gh client to make
# working with the API a little easier. We won't need
# the requests module because the ga4gh client handles
# the HTTP layer.
import ga4gh.c... | {
"content_hash": "86e432e170ab55e9b81462cf2d04d081",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 85,
"avg_line_length": 29.630434782608695,
"alnum_prop": 0.6786500366837858,
"repo_name": "achave11/bioapi-examples",
"id": "bd84f073faadf79a4e90ef5b270fb4eb6bf8f6fb",
"siz... |
"""
Module for parsing patches.xml from the repository metadata.
"""
__all__ = ('PatchesXml', )
# import stable api
from rpath_xmllib import api1 as xmllib
from repomd.patchxml import PatchXml
from repomd.xmlcommon import XmlFileParser, SlotNode
from repomd.errors import UnknownElementError
class _Patches(SlotNode)... | {
"content_hash": "f0051723e8378f277db08437c129bbe3",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 73,
"avg_line_length": 27.305882352941175,
"alnum_prop": 0.6156828953037484,
"repo_name": "sassoftware/mirrorball",
"id": "3977126ef7093c39e3c3d5c6a4b7eff848562e74",
"size"... |
"""Psort (Plaso Síar Og Raðar Þessu) - Makes output from Plaso Storage files.
Sample Usage:
psort.py /tmp/mystorage.dump "date > '01-06-2012'"
See additional details here: http://plaso.kiddaland.net/usage/psort
"""
import argparse
import multiprocessing
import logging
import pdb
import sys
import time
# The follo... | {
"content_hash": "52ccf0655a55141241486809691c8045",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 80,
"avg_line_length": 36.56463595839524,
"alnum_prop": 0.676853055916775,
"repo_name": "8u1a/plaso",
"id": "60cbb6d83bef9c0662b87092acd30545d91db4b3",
"size": "24653",
... |
"""
example of how2use batchOpenMPI, with lastProcessBatch=True to avoid process being tied down unessarcyilly
"""
import batchOpenMPI, time
def randomPause_base(pause) :
time.sleep(pause)
randomPause = batchOpenMPI.batchFunction(randomPause_base)
batchOpenMPI.begin_MPI_loop()
print('lastProcessBatch=True examp... | {
"content_hash": "2e602dab098699ecfac638ce0ea2941a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 107,
"avg_line_length": 30.523809523809526,
"alnum_prop": 0.7862714508580343,
"repo_name": "hamish2014/batchOpenMPI",
"id": "f9c274eba58e50a0f4bab8ba3254b07e4ecff28e",
"siz... |
import cuttsum.events
import cuttsum.corpora
from cuttsum.pipeline import InputStreamResource
from mpi4py import MPI
from cuttsum.misc import enum
from cuttsum.classifiers import NuggetRegressor
import numpy as np
import pandas as pd
import random
import pyvw
from datetime import datetime
from sklearn.feature_extractio... | {
"content_hash": "86211c09c408556072b74ab5e5707c61",
"timestamp": "",
"source": "github",
"line_count": 1146,
"max_line_length": 197,
"avg_line_length": 34.973821989528794,
"alnum_prop": 0.5317614770459081,
"repo_name": "kedz/cuttsum",
"id": "724bf258d04d209722e0ef25675a41ff83336b1f",
"size": "4008... |
from __future__ import absolute_import
#### PATTERN #######################################################################################
# Authors: Tom De Smedt <tom@organisms.be>, Walter Daelemans <walter.daelemans@ua.ac.be>
# License: BSD License, see LICENSE.txt
# Source: https://github.com/clips/pattern/patter... | {
"content_hash": "7e411b6870d3ae4425c5f322e26abe6e",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 100,
"avg_line_length": 42.18181818181818,
"alnum_prop": 0.6468596059113301,
"repo_name": "markuskiller/textblob-de",
"id": "c50a8b8d93c2f118a96d97262da0d15a8bc66ffe",
"siz... |
"""Abstract base class of Port-specific entry points for the layout tests
test infrastructure (the Port and Driver classes)."""
import cgi
import difflib
import errno
import itertools
import json
import logging
import os
import operator
import optparse
import re
import sys
try:
from collections import OrderedDict... | {
"content_hash": "3a9263d429b1c18c462a93a52172ef11",
"timestamp": "",
"source": "github",
"line_count": 1732,
"max_line_length": 189,
"avg_line_length": 43.68302540415704,
"alnum_prop": 0.6243143578424246,
"repo_name": "smishenk/blink-crosswalk",
"id": "6f3dac33417abe0f9fef2a671575a49e4877bcca",
"s... |
"""
Test 3
Introduces the use of MLPClassifier.
"""
import csv
import math
from random import shuffle
import numpy as np
from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import cross_val_score
from frequent import get_most_frequent_terms
print("Reading CSV...")
csvfile = open('data/trai... | {
"content_hash": "b6ea4f95a0bea206fa0deda37fcc5648",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 109,
"avg_line_length": 26.55056179775281,
"alnum_prop": 0.6648328396106644,
"repo_name": "jramcast/ml_weather",
"id": "e7ceb1174d5fc90a76ffb36c6ea88a6b63bbe53c",
"size": "... |
from django.apps import AppConfig
class NewsConfig(AppConfig):
name = "news"
| {
"content_hash": "0ae9736e3f39a1831dd725e25ac4771e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 16.6,
"alnum_prop": 0.7349397590361446,
"repo_name": "evanepio/dotmanca",
"id": "42c63baa57354535356aadf0d30080e1b7852554",
"size": "83",
"binary": ... |
"""Tests for the MRUListEx Windows Registry plugin."""
import unittest
from plaso.dfwinreg import definitions as dfwinreg_definitions
from plaso.dfwinreg import fake as dfwinreg_fake
from plaso.formatters import winreg as _ # pylint: disable=unused-import
from plaso.lib import timelib
from plaso.parsers.winreg_plugi... | {
"content_hash": "2f536e88d0d562dd4c5fefe71e9e7be3",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 80,
"avg_line_length": 41.58441558441559,
"alnum_prop": 0.6670049968769519,
"repo_name": "ostree/plaso",
"id": "246c7b5bf0972611cacdd9417e4c6d878d1d5e9f",
"size": "12850",... |
import time
import requests
from django.contrib.auth.models import User
from django.contrib.sessions.backends.db import SessionStore
from django.test import LiveServerTestCase
from django.test.client import RequestFactory
from websocket import create_connection, WebSocketException
from ws4redis.django_runserver import ... | {
"content_hash": "62f3a8821349dbbba20926c2af602c85",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 107,
"avg_line_length": 46.75121951219512,
"alnum_prop": 0.6630843071786311,
"repo_name": "ojarva/django-websocket-redis",
"id": "4e0851851d43927a2c728c6310e88117d34902cc",
... |
import numpy as np
import data_utils as du
import os
import sys
from etaprogress.progress import ProgressBar as pgb
from ConfigParser import ConfigParser as Config
load_path = '../waves/'
save_path = '../tmp/'
if not os.path.exists(load_path):
print 'ERROR: waves directory not found!'
sys.exit(1)
else:
wav... | {
"content_hash": "0f3d7a4442e16bdb6ba56ca93651bd0a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 64,
"avg_line_length": 28.58490566037736,
"alnum_prop": 0.6587458745874587,
"repo_name": "shady-cs15/slash",
"id": "43ddc0018687b62aaef93fbf6bf2d67f9c2cf10d",
"size": "2002... |
"""Calculate the liquid volume of a cylinder"""
from hcsr04sensor import sensor
trig_pin = 17
echo_pin = 27
cuboid_depth = 40 # distance from sensor to bottom of box in inches
cuboid_length = 24
cuboid_width = 30
#
# Calculate the litres in a box like container
value = sensor.Measurement(trig_pin, echo_pin, 68, "imp... | {
"content_hash": "f77269cbd7ee718b35ede9618826bb48",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 87,
"avg_line_length": 36.6875,
"alnum_prop": 0.7529812606473595,
"repo_name": "alaudet/hcsr04sensor",
"id": "4916a9b46cc12ab7c14d227b9ce1847c40551832",
"size": "587",
"b... |
from abc import ABC, abstractmethod
from uk_gov_phe_erdst_sc.configuration import Configuration
from .build_configuration import BuildConfiguration
from .build_client import BuildClientConfiguration
import os
class BuildSummaryConfiguration(Configuration):
builds_folder = None
server_source_folder = None
... | {
"content_hash": "df46276b200c662c47674da6ffdac39b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 130,
"avg_line_length": 32.507936507936506,
"alnum_prop": 0.67431640625,
"repo_name": "PublicHealthEngland/animal-welfare-assessment-grid",
"id": "8d3974d3310e93c3d497f07d3f8... |
"""This modules stubs out functions in oslo_concurrency.processutils."""
import re
from eventlet import greenthread
from oslo_concurrency import processutils
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
_fake_execute_repliers = []
_fake_execute_log = []
def fake_execute_get_log():
ret... | {
"content_hash": "80ab76b8bcd9e316a8c82f34b959b563",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 31.032608695652176,
"alnum_prop": 0.6304728546409807,
"repo_name": "openstack/nova",
"id": "c370853cb53ec784ca1b5443dffabe7a147bfe12",
"size": "3472"... |
from google.cloud import dialogflow_v2beta1
def sample_create_session_entity_type():
# Create a client
client = dialogflow_v2beta1.SessionEntityTypesClient()
# Initialize request argument(s)
request = dialogflow_v2beta1.CreateSessionEntityTypeRequest(
parent="parent_value",
)
# Make ... | {
"content_hash": "51c57a579b396065959d68db6086f237",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 28.526315789473685,
"alnum_prop": 0.7490774907749077,
"repo_name": "googleapis/python-dialogflow",
"id": "4f9e714f5ab365ccb05d8b3c283147c6e2ffff45",
... |
"""
Created on Thu May 21 12:12:21 2015
@author: Marco Tinacci
"""
import numpy as np
import Network as net
import networkx as nx
def correlation(dg):
'''
Tests the correlation between total assets and degrees (in, out and sum of
both)
dg: digraph with node assets
prints: correlations be... | {
"content_hash": "88773542855707ab37b99c8def3493e1",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 156,
"avg_line_length": 35.142857142857146,
"alnum_prop": 0.6151761517615176,
"repo_name": "marcotinacci/interbank-lending-systemic-risk",
"id": "134ecbba86be221bbd7a932421ef... |
"""Parallel workflow execution via PBS/Torque
"""
import os
from time import sleep
import subprocess
from .base import (SGELikeBatchManagerBase, logger, iflogger, logging)
from ...interfaces.base import CommandLine, text_type
class PBSPlugin(SGELikeBatchManagerBase):
"""Execute using PBS/Torque
The plugin... | {
"content_hash": "fd0d4ebbfeb57f814dc98ffb52d78cc4",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 80,
"avg_line_length": 38.10091743119266,
"alnum_prop": 0.52130989646039,
"repo_name": "sgiavasis/nipype",
"id": "0c298670fd88bd6bbdfaadf26f2422420523d001",
"size": "4153"... |
from hp_procurve_ssh import HPProcurveSSH
from hp_comware_ssh import HPComwareSSH | {
"content_hash": "69e2abebc2b2854860c86c7ba3588655",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 41,
"avg_line_length": 40.5,
"alnum_prop": 0.8641975308641975,
"repo_name": "nvoron23/netmiko",
"id": "eefc5a6d24a56a79388cfd5b84eb64114dd40fd1",
"size": "81",
"binary": f... |
import json
import gsxws
import os.path
from gsxws.repairs import SymptomIssue
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as... | {
"content_hash": "fb1e6397d1121cc860b9cfc12b9ae741",
"timestamp": "",
"source": "github",
"line_count": 639,
"max_line_length": 95,
"avg_line_length": 31.885758998435055,
"alnum_prop": 0.5981840490797546,
"repo_name": "filipp/Servo",
"id": "8d9ffabdb774cf76937bc2f7d471aa55576b0583",
"size": "21753"... |
import json
from datetime import datetime
import pytz
from dateutil.parser import parse as parse_dt
from unicore.comments.client.base import (
BaseClient, BaseClientObject, CommentServiceException)
class UserBanned(CommentServiceException):
pass
class CommentStreamNotOpen(CommentServiceException):
pass... | {
"content_hash": "cf813a3c49292c70b2a8f715f0c1da4f",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 79,
"avg_line_length": 27.977011494252874,
"alnum_prop": 0.5649137222678718,
"repo_name": "universalcore/unicore.comments.client",
"id": "1cc37639d9fa5fdba67cdf868eb3c262be1... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "d946bccd6bfd4182cd170f8d7d9af421",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 161,
"avg_line_length": 31.577272727272728,
"alnum_prop": 0.653951345904707,
"repo_name": "zouzhberk/ambaridemo",
"id": "3bd0f53269d10d62bd914d9d9285baffc8d78644",
"size":... |
import asyncio
import inspect
import json
import logging
import logging.config
import os
import socket
import ssl
import sys
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
Dict,
List,
Optional,
Tuple,
Type,
Union,
)
from h11._connection im... | {
"content_hash": "fc49ab7bf99606f987ae4be8e52e95b6",
"timestamp": "",
"source": "github",
"line_count": 587,
"max_line_length": 104,
"avg_line_length": 36.63884156729131,
"alnum_prop": 0.5767889524340912,
"repo_name": "encode/uvicorn",
"id": "d2faf76fce4be8165adbae7bee1949beb9d150c3",
"size": "2150... |
from difflib import SequenceMatcher
import SonicScrewdriver as utils
import csv
authornames = set()
allrows = list()
def forceint(astring):
try:
intval = int(astring)
except:
intval = 0
return intval
existing = set()
with open('masterpoemeta.csv', encoding = 'utf-8') as f:
reader = ... | {
"content_hash": "a4c9ca6e329a1186b68110a682d4b056",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 67,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.5582655826558266,
"repo_name": "tedunderwood/GenreProject",
"id": "2aff336de8c5db4ce6a771682ad41cd61b96ec99",
"si... |
from django.db import models
from django.utils import timezone
from osf.models.base import BaseModel, ObjectIDMixin
from osf.utils.fields import NonNaiveDateTimeField
class AlternativeCitation(ObjectIDMixin, BaseModel):
# TODO DELETE ME POST MIGRATION
modm_model_path = 'website.project.model.AlternativeCitati... | {
"content_hash": "853047ad0428dc2091db032e66e3d64a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 107,
"avg_line_length": 30.555555555555557,
"alnum_prop": 0.6636363636363637,
"repo_name": "acshi/osf.io",
"id": "564696acca39715be562830b92228dda2e21d0b9",
"size": "1650",... |
"""
Django test runner that invokes nose.
You can use
NOSE_ARGS = ['list', 'of', 'args']
in settings.py for arguments that you always want passed to nose.
"""
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.simple import DjangoTestSuiteR... | {
"content_hash": "039b63ea29ec773c82561b7e2ad4e921",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 33.72727272727273,
"alnum_prop": 0.6477987421383647,
"repo_name": "jsocol/django-nose",
"id": "ffb32437feebdc83db9e64908f4a9b5b82199434",
"size": "33... |
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def remove_prereg_users_without_realm(
apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
prereg_model = apps.get_model("zerver", "Preregistra... | {
"content_hash": "21511acb6b746499fe5a808cc9fe4c12",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 74,
"avg_line_length": 34.476190476190474,
"alnum_prop": 0.6795580110497238,
"repo_name": "brainwane/zulip",
"id": "7f6a7a4f4b2d86a897bf777166c55698fc22420f",
"size": "774"... |
from reparse.config import pattern_max_recursion_depth
from reparse.expression import Group, AlternatesGroup, Expression
from reparse.util import separate_string
class ExpressionGroupNotFound(Exception):
pass
class Function_Builder(object):
"""
Function Builder is an on-the-fly builder of functions for ... | {
"content_hash": "20753e7767b23f1ec7f68cc554cd8b0b",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 111,
"avg_line_length": 39.22142857142857,
"alnum_prop": 0.5831360407940266,
"repo_name": "photonovus/reparse",
"id": "fe5dda2e53f69d55b2ab169890a78a084b30a08d",
"size": "... |
from adios2NPTypes import SmallTestData
from mpi4py import MPI
import numpy as np
import adios2
def check_object(adios2_object, name):
if adios2_object is None:
raise ValueError(str(name) + ' not found')
def check_name(name, name_list):
if name not in name_list:
raise ValueError(str(name) + ... | {
"content_hash": "6f8814d3ae44197073768defaddfd4c5",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 71,
"avg_line_length": 29.20883534136546,
"alnum_prop": 0.6478757046610752,
"repo_name": "ornladios/ADIOS2",
"id": "606309a41485e0d2892d18e4da71592c07fbedc1",
"size": "756... |
"""
1w2mqtt.py - Publish temperature readings from a 1 wire temperature sensor as an mqtt message.
Command Line Arguments:
-b --broker, Broker wihch 1w2mqtt should connect.
-d --delay, Delay between sensor readings.
-t --topic, Base topic which 1w2mqtt should publish messages.
-v --verbose, Enable Verbose output.
""... | {
"content_hash": "d34c947ee039f243c7e404673a702ed1",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 110,
"avg_line_length": 27.862068965517242,
"alnum_prop": 0.7196782178217822,
"repo_name": "jcsmith/1w2mqtt",
"id": "ee36d60021697bf1de631024db3d42379b6f0310",
"size": "297... |
"""distutils.command.install_egg_info
Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""
from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re
class install_egg_info(Command):
"""Install an .egg-info file for the package"""
... | {
"content_hash": "d096b2e091b1b9fb12b85fbaee883e61",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 81,
"avg_line_length": 36.30927835051546,
"alnum_prop": 0.6124361158432708,
"repo_name": "Bjay1435/capstone",
"id": "06010f84d283c81f633b94cce41913c77fda73d1",
"size": "352... |
import pytest
import os
@pytest.fixture()
def node(host, request):
"""
This fixture represents a single node in the ceph cluster. Using the
host.ansible fixture provided by testinfra it can access all the ansible
variables provided to it by the specific test scenario being ran.
You must include t... | {
"content_hash": "75bc4de949ef96e79d6f8f26f35ab622",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 145,
"avg_line_length": 41.37908496732026,
"alnum_prop": 0.6319696730374349,
"repo_name": "font/ceph-ansible",
"id": "f24c8751f24c10ac863a620486332033de91d62c",
"size": "6... |
import logging
import re
import time
from devil.android import device_errors
from devil.android import flag_changer
from devil.utils import reraiser_thread
from pylib import valgrind_tools
from pylib.base import base_test_result
from pylib.local.device import local_device_test_run
TIMEOUT_ANNOTATIONS = [
('Manual'... | {
"content_hash": "3cec59ffe29528c615fac9af6dbc891d",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 80,
"avg_line_length": 34.08424908424909,
"alnum_prop": 0.6484685652874799,
"repo_name": "ds-hwang/chromium-crosswalk",
"id": "9298d756fc02196f1dc58b8bb800bee0aa8a60c1",
"... |
"""
.. module:: get_data_hlsp_k2gap
:synopsis: Returns K2GAP lightcurve data as a JSON string.
.. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
import collections
from data_series import DataSeries
import numpy
from parse_obsid_hlsp_k2gap import parse_obsid_hlsp_k2gap
#--------------------
def get_data... | {
"content_hash": "c8ab1b39a1159496b528c641c9f83b1c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 78,
"avg_line_length": 38.63095238095238,
"alnum_prop": 0.5864406779661017,
"repo_name": "openSAIL/MASTDataDelivery",
"id": "9af56306c362975cccd6642a41788e742393c9e3",
"siz... |
from pgcli.packages.sqlcompletion import suggest_type
import pytest
def sorted_dicts(dicts):
"""input is a list of dicts"""
return sorted(tuple(x.items()) for x in dicts)
def test_select_suggests_cols_with_visible_table_scope():
suggestions = suggest_type('SELECT FROM tabl', 'SELECT ')
assert sorted_... | {
"content_hash": "f87d868897699291ffae8e39cd18e41d",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 82,
"avg_line_length": 39.61692650334076,
"alnum_prop": 0.5811783224645829,
"repo_name": "thedrow/pgcli",
"id": "277936e956d5b2050ffaf04e7c7c427b2efd331e",
"size": "17788"... |
import newrelic.api.function_trace
_methods_1 = ['bgrewriteaof', 'bgsave', 'config_get', 'config_set',
'dbsize', 'debug_object', 'delete', 'echo', 'flushall',
'flushdb', 'info', 'lastsave', 'object', 'ping', 'save',
'shutdown', 'slaveof', 'append', 'decr', 'exists',
... | {
"content_hash": "8bd9c02cd7c2d8d3d90f4a8120dc2e05",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 72,
"avg_line_length": 47.541666666666664,
"alnum_prop": 0.5333041191936897,
"repo_name": "PulsePod/evepod",
"id": "0f2b5ce5e44536539ea526def666720f5651fa74",
"size": "2282... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('services', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='service',
name='url',
field=models... | {
"content_hash": "060e65aa7c023af479c5db8173253bf2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 21.789473684210527,
"alnum_prop": 0.5772946859903382,
"repo_name": "gygcnc/gygcnc",
"id": "2674858dfcff82ad591bcb9c0b5ae07095c4f54c",
"size": "438",
... |
from google.cloud import gke_multicloud_v1
async def sample_list_azure_clusters():
# Create a client
client = gke_multicloud_v1.AzureClustersAsyncClient()
# Initialize request argument(s)
request = gke_multicloud_v1.ListAzureClustersRequest(
parent="parent_value",
)
# Make the reques... | {
"content_hash": "aeed23f56c3cc3c68191470d4c0e6551",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 72,
"avg_line_length": 27.4,
"alnum_prop": 0.7208029197080292,
"repo_name": "googleapis/python-gke-multicloud",
"id": "9c5b9cf3c8450fca59e6d266e941a802476ab70a",
"size": "1... |
from tensorflow.keras import Input
from tensorflow.keras import Model
from tensorflow.keras.layers import Layer, Activation, BatchNormalization, Convolution2D, Dense, Flatten, MaxPooling2D, AveragePooling2D, \
add
from tensorflow.keras.models import Sequential
from tensorflow.keras.regularizers import l2
from tenso... | {
"content_hash": "cfe87827f98b1a515b28572758f8ffe8",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 139,
"avg_line_length": 41.83505154639175,
"alnum_prop": 0.6522917693445047,
"repo_name": "apacha/MusicSymbolClassifier",
"id": "87f9ba8c05045a6d198d9d9bbe1350a3f5887895",
... |
TEMPLATE = """Copyright {year} - {author}
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distr... | {
"content_hash": "cf7c405c00314b5980f506f3a33f1b02",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 77,
"avg_line_length": 53.7,
"alnum_prop": 0.7951582867783985,
"repo_name": "pyrelease/pyrelease",
"id": "1ea4be4fd5f36a2b3ca9fdbd00835afc749825a8",
"size": "1074",
"bina... |
'''
Plots person-concept heatmaps
'''
import plotly.plotly as py
from plotly.graph_objs import *
from sys import argv
py.sign_in('username', 'api-key')
def swap(data):
tmp = data[4][:]
data[4] = data[0][:]
data[0] = tmp[:]
return data
def swap2(data):
for person in data:
tmp = person[4... | {
"content_hash": "2466845008e92a9d27d076ce1b7d3c99",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 131,
"avg_line_length": 25.4,
"alnum_prop": 0.5560266505148395,
"repo_name": "bjerva/cassiodigitalis",
"id": "caff3d757fea7fe524b9958bc9c3643d6ba4802f",
"size": "1674",
"... |
"""Greedy-GQ(lambda) learning agent"""
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import super
from future import standard_library
standard_library.install_aliases()
from past.utils import old_div
fro... | {
"content_hash": "aa4e1affb8b599845ceb0f943097af7f",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 94,
"avg_line_length": 38.75,
"alnum_prop": 0.6,
"repo_name": "rlpy/rlpy",
"id": "b79bcb5fe67ed3c931504b43ce032ebe3a6cc179",
"size": "5425",
"binary": false,
"copies":... |
'''
Created on Mar 22, 2018
@author: msanchez
'''
from flask import Flask, jsonify
from scraper.Scraper import Scraper
from scraper.utilities.WebUtilities import WebUtilities
from scraper.RestOperations import RestOperations
app = Flask("news-scraper")
api_version ="/api/v0.1"
@app.route("/")
def default():
scr... | {
"content_hash": "8368d6c56cdb94248aa177e6bfd2b9e9",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 25.979166666666668,
"alnum_prop": 0.6639935846030474,
"repo_name": "MarioCodes/ProyectosClaseDAM",
"id": "2248ef315fa72784eda746f366454556a950f5ac",
... |
from utils.header import Header, NonEncodingField
from utils.commafy import commafy
class SymbolTableBase(Header):
FIELDS = (
NonEncodingField('desc'),
)
def __init__(self, entry_type, num_entries=None):
if num_entries is not None:
desc = '%s %s' % (commafy(num_entries), entry... | {
"content_hash": "6acc5c2134128b404deeed3b5b072ed4",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 112,
"avg_line_length": 32,
"alnum_prop": 0.6076388888888888,
"repo_name": "hkkwok/MachOTool",
"id": "1cf3dfd43f9adb239369435330125b7e77c9a21d",
"size": "2304",
"binary":... |
def extractHpsetupCo(item):
'''
Parser for 'hpsetup.co'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', ... | {
"content_hash": "3758c628f867102c6a848357f3317e16",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.618421052631579,
"repo_name": "fake-name/ReadableWebProxy",
"id": "51518834e74c84de7355ec0f4ae271dfffe3ca83",
"s... |
import math
import cmath
import warnings
# import scipy.constants as physical_constants # Container of physical constants which might be of use
import numpy as np
from .material import Material
from ..base import Base, Attribute, LinkedList
class MaterialSolid(Material):
"""
Solid material class
"""
... | {
"content_hash": "1319c9b14b89ad35150f70cedad61cc8",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 103,
"avg_line_length": 31.104477611940297,
"alnum_prop": 0.5743761996161229,
"repo_name": "FRidh/seapy",
"id": "3039d885feac9cdc6ab74a51105fc5110a5b27be",
"size": "2084",
... |
from django.core.mail import get_connection, EmailMessage
from django.template import Context, Template
from process import process
from email_ab import email_ab
# from django.conf import settings
class email_title(email_ab):
ready_state = None
subject_template = '[{{ep.show.name}}] Video metadata for "{{e... | {
"content_hash": "7b89450959a87badad91f37c89ba58d3",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 277,
"avg_line_length": 41.6375,
"alnum_prop": 0.6865806064244971,
"repo_name": "xfxf/veyepar",
"id": "596d2d3867d0f30dc5e0a004694f1861456cf86d",
"size": "3430",
"binary"... |
"""
tests.py
http://docs.djangoproject.com/en/dev/topics/testing/
.. moduleauthor:: Ulrich Felzmann <ulrich.felzmann@versi.edu.au>
.. moduleauthor:: Gerson Galang <gerson.galang@versi.edu.au>
"""
from os import path
import unittest
from xml.sax.handler import feature_namespaces
from xml.sax import make_parser
from d... | {
"content_hash": "05812afe641d7253658620f89defd99c",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 79,
"avg_line_length": 40.595588235294116,
"alnum_prop": 0.6250075469419791,
"repo_name": "grischa/mytardis-mrtardis",
"id": "bf17c8812833a70efef8b63cbb0f2c16edc033db",
"s... |
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineRespon... | {
"content_hash": "e46e09859b6f5c05dbde7482164d07ba",
"timestamp": "",
"source": "github",
"line_count": 638,
"max_line_length": 244,
"avg_line_length": 43.83542319749216,
"alnum_prop": 0.6470483069331713,
"repo_name": "Azure/azure-sdk-for-python",
"id": "b4da448c5053acf84508587cf436185139c50198",
"... |
from django.db import migrations, models
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
# Set starred_message_count for already existing users to True.
def set_starred_message_count_to_true(
apps: StateApps, schema_editor: BaseDatabaseSch... | {
"content_hash": "91920e0000ff2008de0b0bc68e2e369f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 96,
"avg_line_length": 31.65625,
"alnum_prop": 0.6811451135241856,
"repo_name": "andersk/zulip",
"id": "8eb5949f430da0f364e52032aff0aff0b4f4956a",
"size": "1062",
"binary... |
"""
DeliveryHub
DeliveryHub API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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 L... | {
"content_hash": "937d1e8326925feb0d7849c390a28a7c",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 77,
"avg_line_length": 28.08080808080808,
"alnum_prop": 0.5406474820143885,
"repo_name": "garywong89/PetStoreAPI",
"id": "7c1684e7642761903afce58c572b8724bcce8da4",
"size":... |
"""
head_request.py
~~~~~~~~~~~~~~~
A short example that demonstrates a client that makes HEAD requests to certain
websites.
This example is intended as a reproduction of nghttp2 issue 396, for the
purposes of compatibility testing.
"""
from __future__ import print_function
from twisted.internet import reactor
from ... | {
"content_hash": "bc501357a7026199f80c1607bbf24bde",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 79,
"avg_line_length": 30.154545454545456,
"alnum_prop": 0.6364184504069943,
"repo_name": "bhavishyagopesh/hyper-h2",
"id": "f53d1897f2d6d93881eac3179809ff400bbd7ce9",
"si... |
"""Copyright 2022 Google LLC
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 writing, software
dist... | {
"content_hash": "c11aa79ca6917b02b41caef9229dec6c",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 78,
"avg_line_length": 32.14035087719298,
"alnum_prop": 0.6643013100436681,
"repo_name": "gsuitedevs/python-samples",
"id": "608699ec4e98f2fc793a2050063ec1020fd22248",
"siz... |
import requests
import logging
from requests_toolbelt.utils import dump
from awsauth import S3Auth
host = '192.168.10.20:7480'
access_key = 'admin'
secret_key = 'admin'
cmd = ''
serverurl = 'http://%s' % host
url = 'http://%s%s' % (host,cmd)
response = requests.get(url,auth=S3Auth(access_key, secret_key, serverurl))
da... | {
"content_hash": "57695c8abe76ed6431fb0e16778f8493",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 29,
"alnum_prop": 0.713527851458886,
"repo_name": "wzyuliyang/ceph-note",
"id": "a3c76daf0627cf3e561e0e7309f9fcc93f0633bc",
"size": "377",
"binary"... |
import pickle
import unittest
from .. import events
class TestEvent(unittest.TestCase):
def test_pickling(self):
e = events.Event({"a": "b"})
self.assertEqual(e, pickle.loads(pickle.dumps(e)))
| {
"content_hash": "9f2f2c531ad8804d5705969decce0f01",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 58,
"avg_line_length": 21.6,
"alnum_prop": 0.6666666666666666,
"repo_name": "abusesa/abusehelper",
"id": "2f3577427ecb13f9276f1f0f093427ff3d293b4a",
"size": "216",
"binar... |
from pyface.action.api import ActionController
from traits.api import Instance
# Local imports.
from pyface.tasks.task import Task
from task_action import TaskAction
class TaskActionController(ActionController):
""" An action controller for menu and tool bars.
The controller is used to 'hook' the invocation... | {
"content_hash": "b24fb56f79d135b5b502ddadd3a83b7f",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 80,
"avg_line_length": 33.63636363636363,
"alnum_prop": 0.5722972972972973,
"repo_name": "brett-patterson/pyface",
"id": "bf08af1f283e62087382a3af129f64f747c3095c",
"size":... |
"""Tests for manipulating MagnumService via the DB API"""
from magnum.common import context # NOQA
from magnum.common import exception
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class DbMagnumServiceTestCase(base.DbTestCase):
def test_create_magnum_service(self):
utils... | {
"content_hash": "2b3f0d5434862be07ed1bd1a6618df42",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 77,
"avg_line_length": 40.13636363636363,
"alnum_prop": 0.6109852774631936,
"repo_name": "dimtruck/magnum",
"id": "b0cf71cc36c861d176b66ddd42fcc35bdb0cc661",
"size": "4105"... |
"""
Pelix remote services: Abstract RPC implementation
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.8
:status: Beta
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except... | {
"content_hash": "ebf1b3c3afd368d3c76b5ae950901340",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 80,
"avg_line_length": 31.485488126649077,
"alnum_prop": 0.5401826866672254,
"repo_name": "isandlaTech/cohorte-demos",
"id": "9370b5056efcd9aa98b2afb0121a23bc3fb7d48f",
"s... |
import os
import sys
dirname = os.path.dirname(__file__)
srcdir = os.path.abspath(os.path.join(dirname, '..', '..', 'src'))
sys.path.insert(0, srcdir) # F2x source dir
sys.path.insert(1, os.path.abspath(os.path.join(dirname, '..', 'contrib', 'ext'))) # own extensions
# -- Project information ---------------------... | {
"content_hash": "a9dd4804a7523c2d3972bd6fcb436ead",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 100,
"avg_line_length": 26.9390243902439,
"alnum_prop": 0.5783159800814849,
"repo_name": "led02/F2x",
"id": "a78c27c5a8a1ba44dda79a8b35bb76b8d94790c4",
"size": "5180",
"... |
import os
from contextlib import contextmanager
class EnvPathList(list):
__slots__ = ["_path_factory", "_pathsep"]
def __init__(self, path_factory, pathsep):
self._path_factory = path_factory
self._pathsep = pathsep
def append(self, path):
list.append(self, self._path_factory(path... | {
"content_hash": "aa505f283900796ddcb2b67b665eb8c3",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 99,
"avg_line_length": 37.58282208588957,
"alnum_prop": 0.5843943845902709,
"repo_name": "siemens/plumbum",
"id": "83c7ebebb26344ca738cf11882301c56b5eada00",
"size": "6126... |
from turbogears import testutil, database
# from videostore.model import YourDataClass, User
# database.set_db_uri("sqlite:///:memory:")
# class TestUser(testutil.DBTest):
# def get_model(self):
# return User
# def test_creation(self):
# "Object creation should set the name"
# obj = Us... | {
"content_hash": "cc6e63a59dc709b84cd11f12974d1b96",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 35.375,
"alnum_prop": 0.5777385159010601,
"repo_name": "gjhiggins/elixir",
"id": "0446f0963768613c3e9b7e647e043de852d2054d",
"size": "845",
"binary... |
import os
from flask import render_template, redirect, url_for
from storyweb.core import app
from storyweb import authz
def angular_templates():
partials_dir = os.path.join(app.static_folder, 'templates')
for (root, dirs, files) in os.walk(partials_dir):
for file_name in files:
file_path ... | {
"content_hash": "0d0634665f20bbf22d79a0b912343077",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 31.59090909090909,
"alnum_prop": 0.6316546762589929,
"repo_name": "pudo/storyweb",
"id": "ef42fa0bd511687ad4fac7ee2188312f2d4bc5c4",
"size": "695",
... |
from openerp import tools
from openerp import models,fields,api
from openerp.tools.translate import _
class is_nomenclature_sans_gamme(models.Model):
_name='is.nomenclature.sans.gamme'
_order='bom_id, product_id'
_auto = False
bom_id = fields.Many2one('mrp.bom', 'Nomenclatu... | {
"content_hash": "ab506b8b2e5420d497c4bf5cc3d60b69",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 97,
"avg_line_length": 47.55555555555556,
"alnum_prop": 0.5186915887850467,
"repo_name": "tonygalmiche/is_plastigray",
"id": "b5fca9e4a82a25ea8a4658994fbf2bd5e2265407",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.