text stringlengths 0 1.05M | meta dict |
|---|---|
"""Auth provider that validates credentials via an external command."""
from __future__ import annotations
import asyncio.subprocess
import collections
import logging
import os
from typing import Any, cast
import voluptuous as vol
from homeassistant.const import CONF_COMMAND
from homeassistant.exceptions import Home... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/auth/providers/command_line.py",
"copies": "3",
"size": "5267",
"license": "apache-2.0",
"hash": -3084275640727132700,
"line_mean": 33.4248366013,
"line_max": 99,
"alpha_frac": 0.5919878489,
"autogenerated": false,
"ratio": 4.4749362... |
"""Auth provider that validates credentials via an external command."""
from typing import Any, Dict, Optional, cast
import asyncio.subprocess
import collections
import logging
import os
import voluptuous as vol
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEM... | {
"repo_name": "Cinntax/home-assistant",
"path": "homeassistant/auth/providers/command_line.py",
"copies": "3",
"size": "5242",
"license": "apache-2.0",
"hash": 2523407146912819700,
"line_mean": 32.8193548387,
"line_max": 86,
"alpha_frac": 0.5881342999,
"autogenerated": false,
"ratio": 4.465076660... |
"""Auth provider that validates credentials via an external command."""
import asyncio.subprocess
import collections
import logging
import os
from typing import Any, Dict, Optional, cast
import voluptuous as vol
from homeassistant.const import CONF_COMMAND
from homeassistant.exceptions import HomeAssistantError
fro... | {
"repo_name": "partofthething/home-assistant",
"path": "homeassistant/auth/providers/command_line.py",
"copies": "2",
"size": "5254",
"license": "mit",
"hash": -7465641924585928000,
"line_mean": 33.5657894737,
"line_max": 99,
"alpha_frac": 0.5921202893,
"autogenerated": false,
"ratio": 4.47529812... |
'''auth provides helper methods for setting up the headers required by chef'''
import json
from base64 import b64encode
from hashlib import sha1
from datetime import datetime
from .pastry_rsa import sign
CANONICAL = '''Method:%(method)s
Hashed Path:%(hashed_path)s
X-Ops-Content-Hash:%(hashed_body)s
X-Ops-Timestamp:%... | {
"repo_name": "stephenbm/pastry",
"path": "pastry/utils/auth.py",
"copies": "1",
"size": "1888",
"license": "mit",
"hash": 200546040471628300,
"line_mean": 28.0461538462,
"line_max": 78,
"alpha_frac": 0.6403601695,
"autogenerated": false,
"ratio": 3.5488721804511276,
"config_test": false,
"ha... |
# Auth Public Api methods
# These methods should check permissions, wrap in transactions, produce sideffects, etc
from google.appengine.ext import ndb
from auth_core.api import users as internal_users_api
def get_auth_users(*args, **kwargs):
"""
Fetch a list of users
"""
models, cursor, more = inter... | {
"repo_name": "digibodies/auth_core",
"path": "auth_core/services/users_service.py",
"copies": "1",
"size": "3049",
"license": "mit",
"hash": 1574759336054453800,
"line_mean": 26.2232142857,
"line_max": 96,
"alpha_frac": 0.66152837,
"autogenerated": false,
"ratio": 3.651497005988024,
"config_te... |
from flask_oauth import OAuth
import os, stat, configparser, sys
## Local PostgreSQL server configuration ##
def accessible_by_group_or_world(file):
""" Verify the permissions of configuration file.
*Contributed by Nassib Nassar*.
:param file: File name.
:type file: str
:rtype: bool
"""
st = o... | {
"repo_name": "nassar/yamz",
"path": "seaice/auth.py",
"copies": "3",
"size": "3939",
"license": "bsd-3-clause",
"hash": 5045199636096515000,
"line_mean": 41.8152173913,
"line_max": 88,
"alpha_frac": 0.7131251587,
"autogenerated": false,
"ratio": 4.044147843942505,
"config_test": true,
"has_n... |
# auth.py - do oauth2
"""Helpers for doing OAuth 2.0 authentification."""
import os
from oauth2client import file, client, tools
from .tools import doctemplate
__all__ = ['get_credentials']
SCOPES = 'read'
SECRETS = '~/client_secrets.json'
STORAGE = '~/storage.json'
@doctemplate(SCOPES, SECRETS, STORAGE)
def ... | {
"repo_name": "xflr6/gsheets",
"path": "gsheets/oauth2.py",
"copies": "1",
"size": "2809",
"license": "mit",
"hash": -4249115649637958000,
"line_mean": 27.6632653061,
"line_max": 88,
"alpha_frac": 0.6304734781,
"autogenerated": false,
"ratio": 3.671895424836601,
"config_test": false,
"has_no_... |
"""auth.py for authentication related functions"""
import hug
from jose import jwt
import requests
from models import ApiKey
from settings import settings
def _get_rsa_key(kid):
"""get known good jwks"""
# TODO: cache this!!!
rsa_key = {}
response = requests.get(settings.JWKS_URL)
if response.stat... | {
"repo_name": "swilcox/badash",
"path": "badash-api/auth.py",
"copies": "1",
"size": "2543",
"license": "mit",
"hash": 7363733242609081000,
"line_mean": 26.6413043478,
"line_max": 83,
"alpha_frac": 0.5768777035,
"autogenerated": false,
"ratio": 3.632857142857143,
"config_test": false,
"has_no... |
"""auth.py: tradier auth handler"""
from os import path
import requests
import tradier._helpers as helpers
HERE = path.abspath(path.dirname(__file__))
GENERAL_AUTH_TOKEN = None
class TradierAuth(object):
"""wrapper for authentication in Tradier"""
def __init__(self, access_token):
self.access_token... | {
"repo_name": "EVEprosper/ProsperTradier",
"path": "tradier/auth.py",
"copies": "1",
"size": "1274",
"license": "mit",
"hash": 2328524061397201000,
"line_mean": 23.5,
"line_max": 76,
"alpha_frac": 0.636577708,
"autogenerated": false,
"ratio": 3.692753623188406,
"config_test": false,
"has_no_k... |
"""Auth related model classes """
from datetime import datetime, timedelta
from smtplib import SMTPRecipientsRefused
from flask import current_app, url_for
from flask_dance.consumer.backend.sqla import OAuthConsumerMixin
from sqlalchemy import UniqueConstraint
from sqlalchemy.dialects.postgresql import ENUM
from ..au... | {
"repo_name": "uwcirg/true_nth_usa_portal",
"path": "portal/models/auth.py",
"copies": "1",
"size": "12838",
"license": "bsd-3-clause",
"hash": 8852160748382165000,
"line_mean": 33.3262032086,
"line_max": 80,
"alpha_frac": 0.6335098925,
"autogenerated": false,
"ratio": 3.9271948608137044,
"conf... |
"""Auth related view functions"""
import base64
from datetime import datetime
import hashlib
import hmac
import json
from flask import (
Blueprint,
abort,
current_app,
jsonify,
redirect,
render_template,
request,
session,
url_for,
)
from flask_dance.consumer import oauth_authorized... | {
"repo_name": "uwcirg/true_nth_usa_portal",
"path": "portal/views/auth.py",
"copies": "1",
"size": "34606",
"license": "bsd-3-clause",
"hash": 232737086177198080,
"line_mean": 33.3996023857,
"line_max": 79,
"alpha_frac": 0.6323758886,
"autogenerated": false,
"ratio": 4.251351351351351,
"config_... |
# Authr: Kyle Kastner
# License: BSD 3-Clause
from lasagne.layers import InputLayer, get_output, get_all_params
from lasagne.layers import Conv2DLayer, MaxPool2DLayer
from lasagne.updates import adam
from lasagne.init import GlorotUniform
from lasagne.objectives import squared_error
from lasagne.nonlinearities import l... | {
"repo_name": "kastnerkyle/crikey",
"path": "music_synthesis/music_synthesis.py",
"copies": "1",
"size": "4427",
"license": "bsd-3-clause",
"hash": -4001471018487539000,
"line_mean": 35.5867768595,
"line_max": 79,
"alpha_frac": 0.6912130111,
"autogenerated": false,
"ratio": 3.0893230983949755,
... |
# @authro: Zhongyuan Sun
# time: O(log(m*n)), space: O(1)
class Solution(object):
def searchMatrix(self, matrix, target):
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
# Solution One
# if not matrix or not matrix[0]:
# retur... | {
"repo_name": "danielsunzhongyuan/my_leetcode_in_python",
"path": "search_a_2d_matrix_74.py",
"copies": "1",
"size": "1170",
"license": "apache-2.0",
"hash": 9184027503586248000,
"line_mean": 28.25,
"line_max": 91,
"alpha_frac": 0.4358974359,
"autogenerated": false,
"ratio": 3.762057877813505,
... |
"""auth -- rudimentary authenticator interface
This authenticator interface wraps up the messy loose-ends of
interfacing SASL to a real environment.
Copyright (c) 2009, Coptix, Inc. All rights reserved.
See the LICENSE file for license terms and warranty disclaimer.
"""
from __future__ import absolute_import
import... | {
"repo_name": "thisismedium/python-sasl",
"path": "sasl/auth.py",
"copies": "1",
"size": "4379",
"license": "bsd-2-clause",
"hash": -605704405231793800,
"line_mean": 26.0308641975,
"line_max": 98,
"alpha_frac": 0.6238867321,
"autogenerated": false,
"ratio": 4.226833976833976,
"config_test": fal... |
# Auth: ryee
# Review: mlr
# Date: 2013-04-26
from juriscraper.OpinionSite import OpinionSite
import re
import time
from datetime import date
from lxml import html
class Site(OpinionSite):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.court_id = self.__modu... | {
"repo_name": "m4h7/juriscraper",
"path": "juriscraper/opinions/united_states/state/miss.py",
"copies": "2",
"size": "2119",
"license": "bsd-2-clause",
"hash": 8398723772321609000,
"line_mean": 36.1754385965,
"line_max": 139,
"alpha_frac": 0.6120811704,
"autogenerated": false,
"ratio": 3.24502297... |
"""Auth system routing"""
import django.contrib.auth.views as v
from django.conf.urls import include, url
from .views import ProfileView, SelfProfileView, EditProfileView, VoteProfileView, SwitchIsActiveView
from .forms import AuthenticationForm, PasswordResetForm, PasswordChangeForm, SetPasswordForm
urlpatterns = [... | {
"repo_name": "AmatanHead/collective-blog",
"path": "user/urls.py",
"copies": "1",
"size": "1901",
"license": "mit",
"hash": -2991536002136129000,
"line_mean": 50.3783783784,
"line_max": 104,
"alpha_frac": 0.6633350868,
"autogenerated": false,
"ratio": 3.2385008517887566,
"config_test": false,
... |
""" Auth Utils
"""
import cloudstorage as gcs
import endpoints
import json
import os
import webapp2
import logging
import re
from datetime import datetime
from datetime import date
from google.appengine.api import app_identity
from google.appengine.api import mail
from google.appengine.api import urlfetch
from apicli... | {
"repo_name": "GoogleDeveloperExperts/experts-app-backend",
"path": "services/utils.py",
"copies": "1",
"size": "5155",
"license": "apache-2.0",
"hash": 6119972345662019000,
"line_mean": 28.2897727273,
"line_max": 79,
"alpha_frac": 0.6083414161,
"autogenerated": false,
"ratio": 3.902346707040121,... |
"""AuthZ Adapter implementations of assessment.authoring sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/assessment_authoring/sessions.py",
"copies": "1",
"size": "117410",
"license": "mit",
"hash": 6969800657711364000,
"line_mean": 45.0431372549,
"line_max": 152,
"alpha_frac": 0.6882037305,
"autogenerated": false,
"ratio": 3.862298101911247... |
"""AuthZ Adapter implementations of assessment managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . imp... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/assessment/managers.py",
"copies": "1",
"size": "79157",
"license": "mit",
"hash": 8505568905143893000,
"line_mean": 49.8068035944,
"line_max": 134,
"alpha_frac": 0.6864206577,
"autogenerated": false,
"ratio": 4.091012455424053,
"config... |
"""AuthZ Adapter implementations of assessment sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osi... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/assessment/sessions.py",
"copies": "1",
"size": "186111",
"license": "mit",
"hash": 6162014958399580000,
"line_mean": 42.7599341641,
"line_max": 136,
"alpha_frac": 0.6779610018,
"autogenerated": false,
"ratio": 3.8814365263092037,
"conf... |
"""AuthZ Adapter implementations of authentication.process sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/authentication_process/sessions.py",
"copies": "1",
"size": "11196",
"license": "mit",
"hash": 6393665619261712000,
"line_mean": 41.4090909091,
"line_max": 136,
"alpha_frac": 0.677920686,
"autogenerated": false,
"ratio": 3.745734359317497... |
"""AuthZ Adapter implementations of authentication sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from .... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/authentication/sessions.py",
"copies": "1",
"size": "53910",
"license": "mit",
"hash": -2078749037089801500,
"line_mean": 41.1501172791,
"line_max": 120,
"alpha_frac": 0.6742533853,
"autogenerated": false,
"ratio": 3.819611733031033,
"c... |
"""AuthZ Adapter implementations of authorization managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . ... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/authorization/managers.py",
"copies": "1",
"size": "28160",
"license": "mit",
"hash": -1987508369067683600,
"line_mean": 48.1448516579,
"line_max": 136,
"alpha_frac": 0.6959161932,
"autogenerated": false,
"ratio": 4.229498347852208,
"co... |
"""AuthZ Adapter implementations of authorization sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/authorization/sessions.py",
"copies": "1",
"size": "133649",
"license": "mit",
"hash": -156402211636455100,
"line_mean": 42.1404131698,
"line_max": 149,
"alpha_frac": 0.680738352,
"autogenerated": false,
"ratio": 3.9813220530846913,
"co... |
"""AuthZ Adapter implementations of cataloging sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osi... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/cataloging/sessions.py",
"copies": "1",
"size": "29988",
"license": "mit",
"hash": -2830353448367033000,
"line_mean": 40.7079276773,
"line_max": 122,
"alpha_frac": 0.6857076164,
"autogenerated": false,
"ratio": 3.9803557207326787,
"conf... |
"""AuthZ Adapter implementations of commenting managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . im... | {
"repo_name": "birdland/dlkit-doc",
"path": "dlkit/authz_adapter/commenting/managers.py",
"copies": "1",
"size": "17782",
"license": "mit",
"hash": -8305332286868536000,
"line_mean": 40.7417840376,
"line_max": 124,
"alpha_frac": 0.6520076482,
"autogenerated": false,
"ratio": 4.332846003898635,
... |
"""AuthZ Adapter implementations of commenting sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osi... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/commenting/sessions.py",
"copies": "1",
"size": "61081",
"license": "mit",
"hash": -3880746889645692000,
"line_mean": 40.6650750341,
"line_max": 135,
"alpha_frac": 0.6736300977,
"autogenerated": false,
"ratio": 3.882595982710399,
"confi... |
"""AuthZ Adapter implementations of grading managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . import... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/grading/managers.py",
"copies": "1",
"size": "48456",
"license": "mit",
"hash": 5024476071009833000,
"line_mean": 49.8457502623,
"line_max": 123,
"alpha_frac": 0.6913488526,
"autogenerated": false,
"ratio": 4.020911127707244,
"config_te... |
"""AuthZ Adapter implementations of grading sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid i... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/grading/sessions.py",
"copies": "1",
"size": "123917",
"license": "mit",
"hash": -627357185066517800,
"line_mean": 44.3410171972,
"line_max": 139,
"alpha_frac": 0.684692173,
"autogenerated": false,
"ratio": 3.8462039853498045,
"config_t... |
"""AuthZ Adapter implementations of hierarchy sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/hierarchy/sessions.py",
"copies": "1",
"size": "20169",
"license": "mit",
"hash": -2797549101457148400,
"line_mean": 37.7865384615,
"line_max": 133,
"alpha_frac": 0.6986960186,
"autogenerated": false,
"ratio": 4.1203268641470885,
"confi... |
"""AuthZ Adapter implementations of id managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . import sess... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/id/managers.py",
"copies": "1",
"size": "1313",
"license": "mit",
"hash": 3683884714931638000,
"line_mean": 34.4864864865,
"line_max": 92,
"alpha_frac": 0.7638994669,
"autogenerated": false,
"ratio": 3.8731563421828907,
"config_test": f... |
"""AuthZ Adapter implementations of id sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid import... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/id/sessions.py",
"copies": "1",
"size": "2759",
"license": "mit",
"hash": 4065301484480719000,
"line_mean": 27.4432989691,
"line_max": 83,
"alpha_frac": 0.6969916636,
"autogenerated": false,
"ratio": 3.858741258741259,
"config_test": fa... |
"""AuthZ Adapter implementations of learning managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . impor... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/learning/managers.py",
"copies": "1",
"size": "62360",
"license": "mit",
"hash": -82351417761316300,
"line_mean": 51.5801011804,
"line_max": 140,
"alpha_frac": 0.6951731879,
"autogenerated": false,
"ratio": 4.159829230871856,
"config_te... |
"""AuthZ Adapter implementations of learning sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid ... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/learning/sessions.py",
"copies": "1",
"size": "156181",
"license": "mit",
"hash": -8700138836962806000,
"line_mean": 44.4278650378,
"line_max": 143,
"alpha_frac": 0.691831913,
"autogenerated": false,
"ratio": 3.9427698677168537,
"config... |
"""AuthZ Adapter implementations of locale sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid im... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/locale/sessions.py",
"copies": "1",
"size": "12747",
"license": "mit",
"hash": -3839362966950811600,
"line_mean": 28.1693363844,
"line_max": 112,
"alpha_frac": 0.7088726759,
"autogenerated": false,
"ratio": 4.069923371647509,
"config_te... |
"""AuthZ Adapter implementations of logging sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid i... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/logging_/sessions.py",
"copies": "1",
"size": "57785",
"license": "mit",
"hash": 1833666414610054400,
"line_mean": 40.3340486409,
"line_max": 113,
"alpha_frac": 0.666591676,
"autogenerated": false,
"ratio": 3.780503761858031,
"config_te... |
"""AuthZ Adapter implementations of osid managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid impo... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/osid/managers.py",
"copies": "1",
"size": "5944",
"license": "mit",
"hash": -117902608758481550,
"line_mean": 28.72,
"line_max": 108,
"alpha_frac": 0.6746298789,
"autogenerated": false,
"ratio": 3.946879150066401,
"config_test": true,
... |
"""AuthZ Adapter implementations of osid markers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid.osid_... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/osid/markers.py",
"copies": "1",
"size": "1113",
"license": "mit",
"hash": 696998175203019300,
"line_mean": 26.1463414634,
"line_max": 72,
"alpha_frac": 0.7124887691,
"autogenerated": false,
"ratio": 3.8379310344827586,
"config_test": f... |
"""AuthZ Adapter implementations of osid sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid.osid... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/osid/sessions.py",
"copies": "1",
"size": "8008",
"license": "mit",
"hash": -7080570260075141000,
"line_mean": 35.4,
"line_max": 108,
"alpha_frac": 0.6176323676,
"autogenerated": false,
"ratio": 4.030196275792652,
"config_test": false,
... |
"""AuthZ Adapter implementations of relationship sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..o... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/relationship/sessions.py",
"copies": "1",
"size": "61690",
"license": "mit",
"hash": -1623827449736987600,
"line_mean": 42.7517730496,
"line_max": 132,
"alpha_frac": 0.6865132112,
"autogenerated": false,
"ratio": 4.047369111665136,
"con... |
"""AuthZ Adapter implementations of repository managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . imp... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/repository/managers.py",
"copies": "1",
"size": "52154",
"license": "mit",
"hash": 6599075108429198000,
"line_mean": 50.131372549,
"line_max": 136,
"alpha_frac": 0.6945009012,
"autogenerated": false,
"ratio": 4.239473256381077,
"config_... |
"""AuthZ Adapter implementations of repository sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osi... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/repository/sessions.py",
"copies": "1",
"size": "113204",
"license": "mit",
"hash": -4866542742809629000,
"line_mean": 42.7249903438,
"line_max": 136,
"alpha_frac": 0.6837125897,
"autogenerated": false,
"ratio": 4.049363285162398,
"conf... |
"""AuthZ Adapter implementations of resource managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . impor... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/resource/managers.py",
"copies": "1",
"size": "34852",
"license": "mit",
"hash": 8579871113833204000,
"line_mean": 48.3654390935,
"line_max": 128,
"alpha_frac": 0.6880810283,
"autogenerated": false,
"ratio": 4.116702102527758,
"config_t... |
"""AuthZ Adapter implementations of resource sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid ... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/resource/sessions.py",
"copies": "1",
"size": "108237",
"license": "mit",
"hash": -6795941698338841000,
"line_mean": 42.0194753577,
"line_max": 160,
"alpha_frac": 0.6800816726,
"autogenerated": false,
"ratio": 3.932030370182003,
"config... |
"""AuthZ Adapter implementations of type sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from ..osid impo... | {
"repo_name": "mitsei/dlkit",
"path": "dlkit/authz_adapter/type/sessions.py",
"copies": "1",
"size": "4262",
"license": "mit",
"hash": -4136328731090501600,
"line_mean": 27.7972972973,
"line_max": 97,
"alpha_frac": 0.6893477241,
"autogenerated": false,
"ratio": 3.9646511627906977,
"config_test"... |
"""a util for convert protobuf to dict
"""
from google.protobuf.message import Message
from google.protobuf.descriptor import FieldDescriptor
__all__ = [
"protobuf_to_dict", "TYPE_CALLABLE_MAP", "dict_to_protobuf",
"REVERSE_TYPE_CALLABLE_MAP"
]
EXTENSION_CONTAINER = '___X'
TYPE_CALLABLE_MAP = {
FieldDes... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/protobuf_to_dict.py",
"copies": "3",
"size": "6572",
"license": "apache-2.0",
"hash": -208936837406744200,
"line_mean": 34.5243243243,
"line_max": 99,
"alpha_frac": 0.6133597079,
"autogenerated": false,
"ratio": 3.951894167167... |
"""A utility class for a code container.
A code container is a class which holds source code for a debugger. It knows how
to color the text, and also how to translate lines into offsets, and back.
"""
import string, sys
from win32com.axdebug import axdebug
import tokenize
from util import RaiseNotImpl, _wrap
from w... | {
"repo_name": "aurelijusb/arangodb",
"path": "3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/axdebug/codecontainer.py",
"copies": "17",
"size": "8881",
"license": "apache-2.0",
"hash": 8688469491258705000,
"line_mean": 34.2420634921,
"line_max": 131,
"alpha_frac": 0.5872086477... |
"""A utility class for a code container.
A code container is a class which holds source code for a debugger. It knows how
to color the text, and also how to translate lines into offsets, and back.
"""
import string, sys
from win32com.axdebug import axdebug
import tokenize
from util import RaiseNotImpl, _wra... | {
"repo_name": "Southpaw-TACTIC/Team",
"path": "src/python/Lib/site-packages/win32comext/axdebug/codecontainer.py",
"copies": "1",
"size": "9133",
"license": "epl-1.0",
"hash": -8159367269289065000,
"line_mean": 34.2420634921,
"line_max": 131,
"alpha_frac": 0.5710062411,
"autogenerated": false,
"r... |
"""A utility class that holds I/O events and their expiration time."""
class EventPool(object):
"""A pool that holds I/O events and their expiration time.
The pool holds file descriptors and the events that will occur for them
for each second since epoch.
For example, a file descriptor can contain a ... | {
"repo_name": "snudler6/time-travel",
"path": "src/time_travel/event_pool.py",
"copies": "1",
"size": "3983",
"license": "mit",
"hash": -3697201646062691300,
"line_mean": 37.2980769231,
"line_max": 79,
"alpha_frac": 0.6025608838,
"autogenerated": false,
"ratio": 4.31995661605206,
"config_test":... |
'''A utility for backing up and restoring saved games.
Usage:
savman list [--backups]
savman scan [--nocache]
savman update
savman load <directory>
savman backup <directory> [<game>] [options]
savman restore <game> [<directory>] [options]
savman -h | --help
Commands:
list Show a list ... | {
"repo_name": "strata8/savman",
"path": "savman/cli.py",
"copies": "1",
"size": "5281",
"license": "mit",
"hash": 3588195374458359000,
"line_mean": 37.8382352941,
"line_max": 94,
"alpha_frac": 0.5614466957,
"autogenerated": false,
"ratio": 3.769450392576731,
"config_test": false,
"has_no_keyw... |
"""A utility for browsing COM objects.
Usage:
Command Prompt
Use the command *"python.exe catbrowse.py"*. This will display
display a fairly small, modal dialog.
Pythonwin
Use the "Run Script" menu item, and this will create the browser in an
MDI window. This window can be fully resized.
D... | {
"repo_name": "Simran-B/arangodb",
"path": "3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32com/client/combrowse.py",
"copies": "17",
"size": "17290",
"license": "apache-2.0",
"hash": 8531007928667158000,
"line_mean": 30.9593345656,
"line_max": 148,
"alpha_frac": 0.6604395604,
"auto... |
"""A utility for browsing COM objects.
Usage:
Command Prompt
Use the command *"python.exe catbrowse.py"*. This will display
display a fairly small, modal dialog.
Pythonwin
Use the "Run Script" menu item, and this will create the browser in an
MDI window. This window can be fully ... | {
"repo_name": "Southpaw-TACTIC/Team",
"path": "src/python/Lib/site-packages/win32com/client/combrowse.py",
"copies": "1",
"size": "20909",
"license": "epl-1.0",
"hash": 598785889596972700,
"line_mean": 36.7203703704,
"line_max": 154,
"alpha_frac": 0.5461284614,
"autogenerated": false,
"ratio": 3.... |
'''A utility for creating incremental backup archives.
Usage:
vbackup info <file>
vbackup build <directory> <file>
vbackup restore [--ver=<id>|--num=<num>] <directory> <file>
vbackup trim [--output=<file>] <num> <file>
vbackup -h | --help
Commands:
info Show information about backup
build... | {
"repo_name": "strata8/savman",
"path": "savman/vbackup.py",
"copies": "1",
"size": "16949",
"license": "mit",
"hash": -8200858894230709000,
"line_mean": 43.4881889764,
"line_max": 112,
"alpha_frac": 0.5451649065,
"autogenerated": false,
"ratio": 4.102880658436214,
"config_test": false,
"has_... |
"""A utility for dealing with tmux layout information."""
import re
class Layout(object):
def __init__(self, x, y, size, identifier=-1, vertical=False):
self._depth = -1
self.parent = None
self.x = x
self.y = y
self.size = tuple(size)
self.x2 = x + self.size[0]
... | {
"repo_name": "tweekmonster/tmux2html",
"path": "tmux2html/tmux_layout.py",
"copies": "1",
"size": "4595",
"license": "mit",
"hash": -8923565051808707000,
"line_mean": 26.1893491124,
"line_max": 79,
"alpha_frac": 0.5192600653,
"autogenerated": false,
"ratio": 3.6468253968253967,
"config_test": ... |
"""A utility for debugging serialization issues."""
from typing import Any, Tuple, Set, Optional
import inspect
import ray.cloudpickle as cp
import colorama
from contextlib import contextmanager
@contextmanager
def _indent(printer):
printer.level += 1
yield
printer.level -= 1
class _Printer:
def __i... | {
"repo_name": "ray-project/ray",
"path": "python/ray/util/check_serialize.py",
"copies": "2",
"size": "7213",
"license": "apache-2.0",
"hash": 2333344253280773000,
"line_mean": 32.3935185185,
"line_max": 79,
"alpha_frac": 0.5648135311,
"autogenerated": false,
"ratio": 4.296009529481834,
"config... |
'''A utility for finding Python packages that may not be in use.
'''
from __future__ import print_function
import os
import sys
import codecs
__all__ = ('__version__', 'main')
__version__ = '0.1.2'
if sys.stdout.encoding is None:
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
if sys.stderr.encoding is None:... | {
"repo_name": "tweekmonster/moult",
"path": "moult/__init__.py",
"copies": "1",
"size": "1086",
"license": "mit",
"hash": 85206168975489870,
"line_mean": 27.5789473684,
"line_max": 85,
"alpha_frac": 0.6325966851,
"autogenerated": false,
"ratio": 3.596026490066225,
"config_test": false,
"has_n... |
"""A utility for fuzzy-matching people between the NY State Voter File and
other data sources, e.g. Campaign Finance records or call records.
Uses [fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) to fuzzy-match
name strings, with a bit of added interpersonal intelligence.
@author n.o.franklin@gmail.com
"""
import... | {
"repo_name": "UnitedThruAction/Data",
"path": "Tools/FuzzyMatch.py",
"copies": "1",
"size": "5653",
"license": "apache-2.0",
"hash": -2757769541779303000,
"line_mean": 37.4557823129,
"line_max": 82,
"alpha_frac": 0.5547496904,
"autogenerated": false,
"ratio": 3.8195945945945944,
"config_test":... |
#A utility for getting a Pulse article stream
import httplib, urllib, urllib2,base64, json, time
from multiprocessing import *
from multiprocessing.queues import *
PROCESSES=5 #number of helper daemons to buffer articles
SCRAPE = ['Entrepreneurship & Small Business', ]
rss_url="hr-pulsesubscriber.appspot.com"
def ... | {
"repo_name": "jaywreddy/QuantSentimentAnalysis",
"path": "V0/content/stream/articleGrabber.py",
"copies": "1",
"size": "4971",
"license": "mit",
"hash": -8255475573762788000,
"line_mean": 26.4640883978,
"line_max": 95,
"alpha_frac": 0.6833635083,
"autogenerated": false,
"ratio": 3.19267822736030... |
# A utility for writing json without longhand LBYL checks for reading / writing
# Original here: https://github.com/Twentysix26/Red-DiscordBot/blob/develop/cogs/utils/dataIO.py
import ujson as json
import os
import logging
from random import randint
class InvalidFileIO(Exception):
pass
class DataIO():
def __... | {
"repo_name": "henry232323/Typheus",
"path": "cogs/utils/dataIO.py",
"copies": "1",
"size": "2248",
"license": "mit",
"hash": -9020301641979569000,
"line_mean": 28.9733333333,
"line_max": 96,
"alpha_frac": 0.5889679715,
"autogenerated": false,
"ratio": 3.8493150684931505,
"config_test": false,
... |
"""A utility function for importing TensorFlow graphs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import tensorflow.python.platform
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import types_pb2
fr... | {
"repo_name": "MemeticParadigm/TensorFlow",
"path": "tensorflow/python/framework/importer.py",
"copies": "2",
"size": "11112",
"license": "apache-2.0",
"hash": 8197402257604181000,
"line_mean": 35.1954397394,
"line_max": 109,
"alpha_frac": 0.6354391649,
"autogenerated": false,
"ratio": 3.76422764... |
"""A utility function for importing TensorFlow graphs."""
import contextlib
import tensorflow.python.platform
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import types_pb2
from tensorflow.python.framework import op_def_registry
from tensorflow.python.framework import ops
from tensorf... | {
"repo_name": "javierblasco/tensorflow",
"path": "tensorflow/python/framework/importer.py",
"copies": "5",
"size": "10996",
"license": "apache-2.0",
"hash": 3160909117518002000,
"line_mean": 35.2904290429,
"line_max": 109,
"alpha_frac": 0.6342306293,
"autogenerated": false,
"ratio": 3.76060191518... |
# A utility function to find the distance between two points
def dist(p1, p2):
return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2
# O(N) operation as at most 3 points are passed to this.
def brute(xP, n):
minDis = float("inf")
for i in range(n):
for j in range(i + 1, n):
currDis = dist(x... | {
"repo_name": "saisankargochhayat/algo_quest",
"path": "Company-Based/amazon/my_oa/closest_robots.py",
"copies": "1",
"size": "2426",
"license": "apache-2.0",
"hash": -2096086162222867200,
"line_mean": 27.5529411765,
"line_max": 93,
"alpha_frac": 0.5812036274,
"autogenerated": false,
"ratio": 3.0... |
# A Utility Function to print the Grid
def print_grid(arr):
for i in range(9):
for j in range(9):
print arr[i][j],
print
# Function to Find the entry in the Grid that is still not used
# Searches the grid to find an entry that is still unassigned. If
# found, the reference parameters... | {
"repo_name": "EUNIX-TRIX/al-go-rithms",
"path": "backtracking/sudoku/python/sudoku.py",
"copies": "7",
"size": "3631",
"license": "mit",
"hash": -7507165403448245000,
"line_mean": 30.5739130435,
"line_max": 125,
"alpha_frac": 0.6177361608,
"autogenerated": false,
"ratio": 3.331192660550459,
"c... |
"""A utility module for handling Fasta sequences, entries and files.
Copyright (c) 2011 Joel Hedlund.
Contact: Joel Hedlund <yohell@ifm.liu.se>
"""
__version__ = "4.0.0"
__copyright__ = """\
Copyright (c) 2005-2007 Joel Hedlund. All rights reserved.
Redistribution and use in source and binary forms, with or witho... | {
"repo_name": "BILS/agda",
"path": "agda/core/fasta.py",
"copies": "1",
"size": "12588",
"license": "mit",
"hash": -5410387054340065000,
"line_mean": 33.9666666667,
"line_max": 103,
"alpha_frac": 0.6298856053,
"autogenerated": false,
"ratio": 4.316872427983539,
"config_test": false,
"has_no_k... |
"""A utility module for mirt training, containing a variety of useful
datastructures.
In this file:
functions:
get_exercise_ind:
turn an array of exercise names into an array of indices within a
matrix.
conditional_probability_correct:
predict the probabilities of getting questions cor... | {
"repo_name": "bkimo/guacamole",
"path": "mirt/mirt_util.py",
"copies": "1",
"size": "27516",
"license": "mit",
"hash": 1238158016434031400,
"line_mean": 39.9464285714,
"line_max": 79,
"alpha_frac": 0.617313563,
"autogenerated": false,
"ratio": 3.857022708158116,
"config_test": false,
"has_no... |
"A utility plugin to fetch tweet links."
import urlparse
try:
import HTMLParser as htmlparser
except ImportError:
import html.parser as htmlparser
import BeautifulSoup
import requests
# John Gruber's URL regular expression
# http://daringfireball.net/2010/07/improved_regex_for_matching_urls
URL_RE = re.co... | {
"repo_name": "wohali/gizzy",
"path": "plugins/twitter.py",
"copies": "1",
"size": "1414",
"license": "apache-2.0",
"hash": -8850524213319278000,
"line_mean": 17.8533333333,
"line_max": 68,
"alpha_frac": 0.5339462518,
"autogenerated": false,
"ratio": 2.9705882352941178,
"config_test": false,
... |
"""A utility program to help extract rows from
Syngo ouput according to the CPT codes
of the procedures that the rows reprsent.
"""
import xlrd
import os
import xlwt
def get_code_groups():
"""
Each sheet of the workbook represents a different output sheet.
There is no functional difference bet... | {
"repo_name": "mcstrother/dicom-sr-qi",
"path": "unported scripts/extract_cpt/extract_cpt.py",
"copies": "2",
"size": "9240",
"license": "bsd-2-clause",
"hash": 5638127624250303000,
"line_mean": 33.6756756757,
"line_max": 116,
"alpha_frac": 0.5865800866,
"autogenerated": false,
"ratio": 3.3983082... |
"""A utility that pulls down news data for processing and grading"""
from datetime import datetime
from os import path, makedirs, remove
import csv
from enum import Enum
import requests
import demjson
import pandas_datareader.data as web
from tinydb import TinyDB, Query
import ujson as json
from plumbum import cli
fr... | {
"repo_name": "EVEprosper/vincent_lexicon",
"path": "vincent_lexicon/NewsScraper.py",
"copies": "1",
"size": "18447",
"license": "apache-2.0",
"hash": 7424545229478076000,
"line_mean": 31.3631578947,
"line_max": 95,
"alpha_frac": 0.5790643465,
"autogenerated": false,
"ratio": 3.8423245157258905,
... |
"""A utility to convert from Backus-Naur form to Chomsky Normal Form.
Backus-Naur Form (BNF) is a more natural way to encode the grammars for
docstrings. However, the CYK parsing algorithm (in its simplest form)
Chomsky Normal From (CNF). This utility, intended for use during
development, converts BNF grammars to CN... | {
"repo_name": "terrencepreilly/darglint",
"path": "bin/bnf_to_cnf/bnf_to_cnf/validate.py",
"copies": "1",
"size": "3927",
"license": "mit",
"hash": 138964003165329070,
"line_mean": 31.1885245902,
"line_max": 79,
"alpha_frac": 0.601986249,
"autogenerated": false,
"ratio": 4.3296582138919515,
"co... |
"""A utility to display and modify polytaxis metadata."""
import argparse
import polytaxis
def minmax_append_action(nmin, nmax):
class Inner(argparse.Action):
def __call__(self, parser, args, values, option_string=None):
if not nmin <= len(values) <= nmax:
raise argparse.Argumen... | {
"repo_name": "Rendaw/polytaxis-python",
"path": "ptmod.py",
"copies": "1",
"size": "4049",
"license": "bsd-2-clause",
"hash": -1006643911532070500,
"line_mean": 28.1294964029,
"line_max": 95,
"alpha_frac": 0.5085206224,
"autogenerated": false,
"ratio": 4.248688352570829,
"config_test": false,
... |
""" A Util module for odds and ends.
"""
import sys
def isString(data):
return isinstance(data, str)
def isInteger(data):
return isinstance(data, int)
def string2File(string, path, append):
retval = False
try:
mode = 'a' if append else 'w'
with open(path, mode) as fp:
fp.... | {
"repo_name": "SRI-CSL/PLambda",
"path": "plambda/util/Util.py",
"copies": "1",
"size": "1173",
"license": "mit",
"hash": 7332732155300912000,
"line_mean": 23.9574468085,
"line_max": 98,
"alpha_frac": 0.6189258312,
"autogenerated": false,
"ratio": 3.6203703703703702,
"config_test": false,
"ha... |
"""A util script used on daryl's laptop to switch 'iemdb' /etc/hosts entry
129.186.185.33 iemdb iemdb2
#127.0.0.1 iemdb iemdb2
"""
import sys
import tempfile
import os
METVM4, METVM1, METVM6, METVM7 = range(4)
IPS = ["172.16.170.1", "172.16.171.1", "172.16.172.1", "172.16.173.1"]
LOOKUP = {
"": IPS[METVM6],
... | {
"repo_name": "akrherz/iem",
"path": "scripts/util/set_iemdb_etc_hosts.py",
"copies": "1",
"size": "2149",
"license": "mit",
"hash": 815409692624444000,
"line_mean": 25.8625,
"line_max": 74,
"alpha_frac": 0.5486272685,
"autogenerated": false,
"ratio": 2.478662053056517,
"config_test": false,
... |
"""AutoAPI directives"""
import posixpath
import re
from docutils.parsers.rst import Directive, directives
from docutils.statemachine import ViewList
from docutils import nodes
from sphinx import addnodes
import sphinx.ext.autosummary
from sphinx.util.nodes import nested_parse_with_titles
from sphinx.util.rst import... | {
"repo_name": "rtfd/sphinx-autoapi",
"path": "autoapi/directives.py",
"copies": "1",
"size": "4506",
"license": "mit",
"hash": 796452331850421200,
"line_mean": 30.7323943662,
"line_max": 80,
"alpha_frac": 0.5814469596,
"autogenerated": false,
"ratio": 4.126373626373627,
"config_test": false,
... |
"""AutoAugment <https://arxiv.org/abs/1805.09501>らしきもの。
<https://github.com/tensorflow/models/tree/master/research/autoaugment>
"""
# pylint: disable=arguments-differ,abstract-method,unused-argument
import random
import albumentations as A
import numpy as np
import PIL.Image
import PIL.ImageEnhance
import PIL.ImageO... | {
"repo_name": "ak110/pytoolkit",
"path": "pytoolkit/autoaugment.py",
"copies": "1",
"size": "14447",
"license": "mit",
"hash": 3367822454907353600,
"line_mean": 32.5717647059,
"line_max": 113,
"alpha_frac": 0.5545977011,
"autogenerated": false,
"ratio": 2.9774624373956593,
"config_test": false,... |
# Autobahn client with auto-reconnect capability
# Totally based on https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/wamp/beginner/client.py
import sys
from twisted.python import log
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.prot... | {
"repo_name": "voidabhi/python-scripts",
"path": "wamp.py",
"copies": "1",
"size": "2030",
"license": "mit",
"hash": 2746131842378822700,
"line_mean": 34,
"line_max": 113,
"alpha_frac": 0.6763546798,
"autogenerated": false,
"ratio": 4.541387024608501,
"config_test": false,
"has_no_keywords": ... |
# [autobahn-js](https://github.com/crossbario/autobahn-js) | amd64 |
# | [](https://github.com/crossbario/crossbar-docker/blob/master/autobahn-js/x86_64/Dockerfile.full)
i... | {
"repo_name": "tavendo/AutobahnPython",
"path": "docker/images.py",
"copies": "1",
"size": "5408",
"license": "mit",
"hash": 5587671410050608000,
"line_mean": 42.6129032258,
"line_max": 351,
"alpha_frac": 0.6421967456,
"autogenerated": false,
"ratio": 3.203791469194313,
"config_test": false,
... |
# Adds G28 and G29 before the automatically inserted heat up code M104.
# Also removes any additional G28 and G29 codes from the start gcode.
# Copyright 2017, Kai Hendrik Behrends
# Licensed under the MIT license.
# Version 17.04
# Used G-codes
# ============
# G28: Move to Origin (Home)
# G29: Detailed Z-Probe
# ... | {
"repo_name": "kbehren/cura-plugins",
"path": "plugins/AutoBedLevelingBeforeHeatUp.py",
"copies": "1",
"size": "2180",
"license": "mit",
"hash": 4309938413912134700,
"line_mean": 33.0625,
"line_max": 78,
"alpha_frac": 0.5399082569,
"autogenerated": false,
"ratio": 4.412955465587045,
"config_tes... |
# autocalibrator.py
#
# David J. Lampert (djlampert@gmail.com)
#
# Contains the AutoCalibrator class that can be used to calibrate a model.
# The class requires and HSPFModel class, start and end dates, and an output
# location to work in while running simulations. The primary function is
# autocalibrate, and it takes ... | {
"repo_name": "kbrannan/PyHSPF",
"path": "src/pyhspf/calibration/autocalibrator.py",
"copies": "1",
"size": "19175",
"license": "bsd-3-clause",
"hash": -6027378612949193000,
"line_mean": 32.9380530973,
"line_max": 80,
"alpha_frac": 0.5216688396,
"autogenerated": false,
"ratio": 4.209659714599342,... |
# Auto-clustering, suggested by Matt Terry
from skimage import io, color, exposure
from sklearn import cluster, preprocessing
import numpy as np
import matplotlib.pyplot as plt
url = 'http://blogs.mathworks.com/images/steve/2010/mms.jpg'
import os
if not os.path.exists('mm.jpg'):
print("Downloading M&M's...")
... | {
"repo_name": "scikit-image/skimage-demos",
"path": "mm_color_cluster.py",
"copies": "1",
"size": "2030",
"license": "bsd-3-clause",
"hash": 6307169292797551000,
"line_mean": 21.808988764,
"line_max": 68,
"alpha_frac": 0.6285714286,
"autogenerated": false,
"ratio": 2.721179624664879,
"config_te... |
"""Auto-commit hook for Fava.
This mainly serves as an example how Fava's extension systems, which only
really does hooks at the moment, works.
"""
# mypy: ignore-errors
# pylint: disable=missing-docstring
# pragma: no cover - this is just an untested example
import os
import subprocess
from fava.ext import FavaExten... | {
"repo_name": "beancount/fava",
"path": "src/fava/ext/auto_commit.py",
"copies": "2",
"size": "1158",
"license": "mit",
"hash": 6441280979347800000,
"line_mean": 32.0857142857,
"line_max": 73,
"alpha_frac": 0.6476683938,
"autogenerated": false,
"ratio": 3.676190476190476,
"config_test": false,
... |
"""Auto-complete class relying on a modified trie data structure.
original trie: https://github.com/welliam/data-structures/tree/trie-traversal
"""
from trie import Trie
class AutoCompleter():
"""Callable autocomplete class takes a list to create word_list."""
def __init__(self, word_list, max_completions=5... | {
"repo_name": "Bl41r/code-katas",
"path": "autocomplete.py",
"copies": "1",
"size": "1257",
"license": "mit",
"hash": -5816757501013268000,
"line_mean": 33.9166666667,
"line_max": 87,
"alpha_frac": 0.5926809865,
"autogenerated": false,
"ratio": 4.232323232323233,
"config_test": false,
"has_no... |
from pyjamas.ui.TextBox import TextBox
from pyjamas import Factory
from pyjamas.ui.PopupPanel import PopupPanel
from pyjamas.ui.ListBox import ListBox
from pyjamas.ui import KeyboardListener
from pyjamas.ui.RootPanel import RootPanel
class AutoCompleteTextBox(TextBox):
def __init__(self, **kwargs):
self.c... | {
"repo_name": "pyjs/pyjs",
"path": "pyjswidgets/pyjamas/ui/AutoComplete.py",
"copies": "7",
"size": "4587",
"license": "apache-2.0",
"hash": 3730614548417433600,
"line_mean": 30.6344827586,
"line_max": 122,
"alpha_frac": 0.616088947,
"autogenerated": false,
"ratio": 4.0521201413427566,
"config_... |
from TextBox import TextBox
from pyjamas import Factory
from PopupPanel import PopupPanel
from ListBox import ListBox
from pyjamas.ui import KeyboardListener
from RootPanel import RootPanel
class AutoCompleteTextBox(TextBox):
def __init__(self, **kwargs):
self.choicesPopup = PopupPanel(True, False)
... | {
"repo_name": "andreyvit/pyjamas",
"path": "library/pyjamas/ui/AutoComplete.py",
"copies": "4",
"size": "4558",
"license": "apache-2.0",
"hash": -6262661383855550000,
"line_mean": 30.6527777778,
"line_max": 122,
"alpha_frac": 0.5987275121,
"autogenerated": false,
"ratio": 4.220370370370371,
"co... |
# Autocomplete component for Pyjamas
# Ported by Willie Gollino from Autocomplete component for GWT -
# Originally by Oliver Albers http://gwt.components.googlepages.com/
#
# Licensed under the LGPL 2.1
#
# TODO: textarea autocomplete
# http://gwt.components.googlepages.com/auto-completiontextbox
from pyjamas.ui.TextB... | {
"repo_name": "lovelysystems/pyjamas",
"path": "library/pyjamas/ui/AutoComplete.py",
"copies": "1",
"size": "4386",
"license": "apache-2.0",
"hash": 9150799772186674000,
"line_mean": 30.5539568345,
"line_max": 122,
"alpha_frac": 0.5911992704,
"autogenerated": false,
"ratio": 4.245885769603098,
... |
"""Autocomplete fields for QuerySetSequence choices."""
from dal_contenttypes.fields import (
ContentTypeModelMultipleFieldMixin,
GenericModelMixin,
)
from django import forms
from django.conf.urls import url
from django.contrib.contenttypes.models import ContentType
from queryset_sequence import QuerySetSeq... | {
"repo_name": "yourlabs/django-autocomplete-light",
"path": "src/dal_queryset_sequence/fields.py",
"copies": "1",
"size": "6349",
"license": "mit",
"hash": 3894462834988762000,
"line_mean": 35.4885057471,
"line_max": 79,
"alpha_frac": 0.5982044416,
"autogenerated": false,
"ratio": 4.4932767162066... |
"""Autocomplete fields for Select2GenericForeignKey choices."""
from dal_queryset_sequence.fields import QuerySetSequenceModelField
from dal_select2_queryset_sequence.views import Select2QuerySetSequenceAutoView
from dal_select2_queryset_sequence.widgets import QuerySetSequenceSelect2
from django.conf.urls import ur... | {
"repo_name": "yourlabs/django-autocomplete-light",
"path": "src/dal_select2_queryset_sequence/fields.py",
"copies": "1",
"size": "2698",
"license": "mit",
"hash": 4422993666809181700,
"line_mean": 35.4594594595,
"line_max": 81,
"alpha_frac": 0.6212008895,
"autogenerated": false,
"ratio": 4.27575... |
"""AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from configHandler import idleConf
import AutoCompleteWindow
f... | {
"repo_name": "TathagataChakraborti/resource-conflicts",
"path": "PLANROB-2015/py2.5/lib/python2.5/idlelib/AutoComplete.py",
"copies": "5",
"size": "8998",
"license": "mit",
"hash": -3363074120693179400,
"line_mean": 38.814159292,
"line_max": 79,
"alpha_frac": 0.5462324961,
"autogenerated": false,
... |
"""autocomplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names or file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import string
import sys
# These constants represent the two different types of completi... | {
"repo_name": "anbangleo/NlsdeWeb",
"path": "Python-3.6.0/Lib/idlelib/autocomplete.py",
"copies": "4",
"size": "9437",
"license": "mit",
"hash": -938038975779608600,
"line_mean": 39.6767241379,
"line_max": 87,
"alpha_frac": 0.5610893292,
"autogenerated": false,
"ratio": 4.379118329466357,
"conf... |
"""AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names or file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from idlelib.configHandler import idleConf
# This string inclu... | {
"repo_name": "tequa/ammisoft",
"path": "ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/idlelib/AutoComplete.py",
"copies": "9",
"size": "8964",
"license": "bsd-3-clause",
"hash": -1042728092433250400,
"line_mean": 38.1441048035,
"line_max": 79,
"alpha_frac": 0.5604640785,
"autogener... |
"""AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from configHandler import idleConf
import AutoCompl... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/1.1-src/python/Lib/idlelib/AutoComplete.py",
"copies": "2",
"size": "9224",
"license": "mit",
"hash": -2043018278578962200,
"line_mean": 38.814159292,
"line_max": 79,
"alpha_frac": 0.5328490893,
"autogenerated": false,
"ratio": 4.5... |
"""Autocomplete support for foreign keys.
Requires the protoculous JavaScript library."""
# Widget
# originally from http://www.djangosnippets.org/snippets/253/
from django import newforms as forms
from django.newforms.widgets import TextInput, flatatt
from django.newforms.util import smart_unicode
from django.util... | {
"repo_name": "NnNHackTeam/israkotz",
"path": "IsraKotzApp/AutoCompleteField.py",
"copies": "1",
"size": "3622",
"license": "mit",
"hash": 521006900710858600,
"line_mean": 32.5462962963,
"line_max": 116,
"alpha_frac": 0.6021535064,
"autogenerated": false,
"ratio": 3.6365461847389557,
"config_te... |
"""Autocomplete widgets bases."""
import copy
import json
from dal import forward
from django import VERSION
from django import forms
from django.core.urlresolvers import reverse
from django.utils import six
from django.utils.safestring import mark_safe
class WidgetMixin(object):
"""Base mixin for autocomplete... | {
"repo_name": "luzfcb/django-autocomplete-light",
"path": "src/dal/widgets.py",
"copies": "1",
"size": "5396",
"license": "mit",
"hash": 5918770968828942000,
"line_mean": 32.725,
"line_max": 78,
"alpha_frac": 0.60693106,
"autogenerated": false,
"ratio": 4.330658105939005,
"config_test": false,
... |
"""Autocomplete widgets bases."""
import copy
import json
from dal import forward
from django import VERSION
from django import forms
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.utils import six
from django.utils.safestring import mark_saf... | {
"repo_name": "shubhamdipt/django-autocomplete-light",
"path": "src/dal/widgets.py",
"copies": "1",
"size": "5605",
"license": "mit",
"hash": 8640056397791198000,
"line_mean": 32.765060241,
"line_max": 78,
"alpha_frac": 0.6071364853,
"autogenerated": false,
"ratio": 4.331530139103555,
"config_t... |
"""Autocomplete widgets bases."""
import copy
from django import VERSION
from django import forms
from django.core.urlresolvers import reverse
from django.utils import six
class WidgetMixin(object):
"""Base mixin for autocomplete widgets.
.. py:attribute:: url
Absolute URL to the autocomplete view... | {
"repo_name": "Perkville/django-autocomplete-light",
"path": "src/dal/widgets.py",
"copies": "3",
"size": "3339",
"license": "mit",
"hash": -8547279860228072000,
"line_mean": 29.9166666667,
"line_max": 78,
"alpha_frac": 0.6262353998,
"autogenerated": false,
"ratio": 4.387647831800263,
"config_t... |
"""Autocompletion integration with python prompt toolkit.
This module integrates the low level autocomplete functionality
provided in awsshell.autocomplete and integrates it with the
interface required for autocompletion in the python prompt
toolkit.
If you're interested in the heavy lifting of the autocompletion
log... | {
"repo_name": "awslabs/aws-shell",
"path": "awsshell/shellcomplete.py",
"copies": "1",
"size": "6586",
"license": "apache-2.0",
"hash": 6657570462026829000,
"line_mean": 41.7662337662,
"line_max": 77,
"alpha_frac": 0.5898876404,
"autogenerated": false,
"ratio": 4.674237047551455,
"config_test":... |
# autocondense_rolethemes.py
# This script plays the same role for my custom topic model
# that condense_doctopics plays for MALLET:
# we're creating a portable subset of the doct-topic table
# that answers preregistered hypotheses.
# There are differences here because my doctopic file has a
# slightly different form... | {
"repo_name": "tedunderwood/biographies",
"path": "topicmodel/interpret/autocondense_rolethemes.py",
"copies": "1",
"size": "2601",
"license": "mit",
"hash": 7676522470699475000,
"line_mean": 29.6,
"line_max": 103,
"alpha_frac": 0.585928489,
"autogenerated": false,
"ratio": 3.6582278481012658,
... |
# To configure on the comware switch:
# scheduler job AP-DEPLOY
# command 1 python ap_config.py deploy
#
# scheduler job AP-REMOVE
# command 1 python ap_config.py remove
#
# scheduler schedule AP-DEPLOY
# user-role network-admin
# job AP-DEPLOY
# time repeating interval 5
#
# scheduler schedule AP-REMOVE
# user... | {
"repo_name": "networkingdvi/HPN-Scripting",
"path": "ap_config.py",
"copies": "1",
"size": "3998",
"license": "mit",
"hash": -2248629448089865500,
"line_mean": 36.7169811321,
"line_max": 121,
"alpha_frac": 0.5272636318,
"autogenerated": false,
"ratio": 3.950592885375494,
"config_test": true,
... |
"Autoconfiguration"
from __future__ import unicode_literals
import pylibmc
class UnsupportedAutoconfMethod(Exception):
pass
class NoAutoconfFound(Exception):
pass
def _elasticache_config_get(address, key):
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
host, port = add... | {
"repo_name": "lericson/pylibmc",
"path": "src/pylibmc/autoconf.py",
"copies": "1",
"size": "2101",
"license": "bsd-3-clause",
"hash": -425188332445923700,
"line_mean": 32.8870967742,
"line_max": 80,
"alpha_frac": 0.5916230366,
"autogenerated": false,
"ratio": 3.6924428822495607,
"config_test":... |
# Released under the MIT licence.
# Copyright Peter Hinch 2018
# Generates Python code providing a binary signal having good autocorrelation
# characteristics. These comprise:
# 1. An autocorrelation function approximating an impulse function.
# 2. A limited maximum runlength (i.e. limited bandwidth).
# 3. Zero DC co... | {
"repo_name": "peterhinch/micropython-filters",
"path": "non_realtime/autocorrelate.py",
"copies": "1",
"size": "6011",
"license": "mit",
"hash": -97040692492232030,
"line_mean": 41.3309859155,
"line_max": 89,
"alpha_frac": 0.5870903344,
"autogenerated": false,
"ratio": 3.5886567164179106,
"con... |
"""Autocorrelation analyses of time series."""
import numpy as np
###################################################################################################
###################################################################################################
def compute_autocorr(sig, max_lag=1000, lag_step=1,... | {
"repo_name": "voytekresearch/neurodsp",
"path": "neurodsp/aperiodic/autocorr.py",
"copies": "1",
"size": "1324",
"license": "mit",
"hash": 7839824118265271000,
"line_mean": 32.9487179487,
"line_max": 99,
"alpha_frac": 0.5611782477,
"autogenerated": false,
"ratio": 4.355263157894737,
"config_te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.