text stringlengths 0 1.05M | meta dict |
|---|---|
# auth0login/auth0backend.py
from urllib import request
from jose import jwt
from social_core.backends.oauth import BaseOAuth2
from accounts.models import UserProfile
class Auth0(BaseOAuth2):
"""Auth0 OAuth authentication backend"""
name = 'auth0'
SCOPE_SEPARATOR = ' '
ACCESS_TOKEN_METHOD = 'POST'
... | {
"repo_name": "chop-dbhi/biorepo-portal",
"path": "auth0login/auth0backend.py",
"copies": "1",
"size": "1536",
"license": "bsd-2-clause",
"hash": 3260646804566734000,
"line_mean": 33.9090909091,
"line_max": 107,
"alpha_frac": 0.595703125,
"autogenerated": false,
"ratio": 3.773955773955774,
"con... |
"""Auth Adapter Template File
IMPORTANT: NOT A FUNCTIONAL ADAPTER. FUNCTIONS MUST BE IMPLEMENTED
Notes:
- Each of the functions defined below must return a json serializable
object, json_response, or valid HttpResponse object
- A json_response creates an HttpResponse object given parameters:
- c... | {
"repo_name": "NERSC/newt-2.0",
"path": "authnz/adapters/template_adapter.py",
"copies": "3",
"size": "2418",
"license": "bsd-2-clause",
"hash": -3853432754423345700,
"line_mean": 27.1279069767,
"line_max": 75,
"alpha_frac": 0.6244830438,
"autogenerated": false,
"ratio": 4.545112781954887,
"con... |
"""Auth API endpoints."""
from flask import g, url_for, request
from flask_smorest import abort, Blueprint
from flask_login import login_required, logout_user
from bookmarks import csrf, db, utils
from bookmarks.users.models import User
from .schemas import UserPOSTSchema, TokenSchema, RequestPasswordResetSchema, R... | {
"repo_name": "ev-agelos/Python-bookmarks",
"path": "bookmarks/api/auth.py",
"copies": "1",
"size": "5611",
"license": "mit",
"hash": 2227816919678489600,
"line_mean": 35.6732026144,
"line_max": 102,
"alpha_frac": 0.6524683657,
"autogenerated": false,
"ratio": 3.824812542603954,
"config_test": ... |
# Auth codes
data_auth = "TESTAUTHCODE"
data_auth_admin = "TESTAUTHADMINCODE"
data_accounts_post_good = {
"api_key": data_auth_admin,
"username": "mike+testpromopuffin@westerncapelabs.com",
"password": "testweak"
}
data_accounts_put_good = {
# "api_key": data_auth_admin,
"username": "user1@example... | {
"repo_name": "westerncapelabs/promopuffin-core",
"path": "web/test_data.py",
"copies": "1",
"size": "5797",
"license": "bsd-3-clause",
"hash": 8168935843591968000,
"line_mean": 24.6504424779,
"line_max": 59,
"alpha_frac": 0.5511471451,
"autogenerated": false,
"ratio": 2.785679961556944,
"confi... |
""" Auth decorator """
import functools
from flask import request, Response, session
from frontui.data_provider import DataProvider
from frontui.linq import first_or_default
def check_auth(username, password):
""" Checks credentials """
database = DataProvider()
current_user = first_or_default(database.us... | {
"repo_name": "nixxa/SecretShopper",
"path": "frontui/auth.py",
"copies": "1",
"size": "1212",
"license": "mit",
"hash": -7386493876062698000,
"line_mean": 29.6052631579,
"line_max": 85,
"alpha_frac": 0.6560619089,
"autogenerated": false,
"ratio": 3.788273615635179,
"config_test": false,
"has... |
"""auth_demo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | {
"repo_name": "GunnerJnr/_CodeInstitute",
"path": "Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/5.Handling-Authentication/auth_demo/auth_demo/urls.py",
"copies": "2",
"size": "1153",
"license": "mit",
"hash": -210700132109033950,
"line_mean": 40.1785714286,
"line_max": 79,
... |
# /auth/(douban|weibo)
import web
from util import login,oauth
from model import user
from config.setting import blankrender
class auth:
def GET(self,name):
input = web.input()
new_user = None
cur_user = login.logged()
try:
client = oauth.createClientWithName(name)
... | {
"repo_name": "supersheep/huixiang",
"path": "controller/page/auth.py",
"copies": "1",
"size": "1186",
"license": "mit",
"hash": -2580181706532925000,
"line_mean": 33.8823529412,
"line_max": 86,
"alpha_frac": 0.5741989882,
"autogenerated": false,
"ratio": 3.8758169934640523,
"config_test": fals... |
"""authenticated registries
Revision ID: 4c22f218654
Revises: 20d5bd63d3d
Create Date: 2015-11-16 11:17:19.479593
"""
# revision identifiers, used by Alembic.
revision = '4c22f218654'
down_revision = '20d5bd63d3d'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():... | {
"repo_name": "RickyCook/DockCI",
"path": "alembic/versions/4c22f218654_authenticated_registries.py",
"copies": "2",
"size": "1665",
"license": "isc",
"hash": 2427125460051402000,
"line_mean": 36.8409090909,
"line_max": 118,
"alpha_frac": 0.6966966967,
"autogenerated": false,
"ratio": 3.447204968... |
"""Authenticate Module."""
import sys
import requests
from Common import Common
class Authenticate(Common):
"""
Authenticate class.
This class performs user login (authentication), and
returns the session object.
This session object is further used to get other details.
"""
def __init__... | {
"repo_name": "kryptxy/cli-amizone",
"path": "amizone/Authenticate.py",
"copies": "1",
"size": "3267",
"license": "mit",
"hash": -7423692243773564000,
"line_mean": 34.1290322581,
"line_max": 107,
"alpha_frac": 0.5904499541,
"autogenerated": false,
"ratio": 3.7294520547945207,
"config_test": fal... |
"""Authenticate Single Sign-On Middleware
==============
Single-Sign On
==============
About SSO
---------
Single sign on is a session/user authentication process that allows a user to
provide his or her credentials once in order to access multiple applications.
The single sign on authenticates the user to access a... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/AuthKit-0.4.0-py2.5.egg/authkit/authenticate/sso/__init__.py",
"copies": "3",
"size": "1230",
"license": "bsd-3-clause",
"hash": 7468298428619605000,
"line_mean": 34.1428571429,
"line_max": 81,
"alpha_frac": 0.75... |
"""Authentication against the Facebook ouath2 api."""
import urllib, urlparse, json
import base
import rowan.controllers as controllers
import rowan.http as http
FACEBOOK_OAUTH = {
# These should be fine, unless Facebook changes its API
"host": "graph.facebook.com",
"user_authorization": "/oauth/authori... | {
"repo_name": "cargocult/rowan-python",
"path": "rowan/auth/facebook.py",
"copies": "1",
"size": "3276",
"license": "mit",
"hash": -6779657904582992000,
"line_mean": 29.0550458716,
"line_max": 71,
"alpha_frac": 0.6196581197,
"autogenerated": false,
"ratio": 3.881516587677725,
"config_test": fal... |
"""Authentication against the twitter OAUTH api."""
import urlparse
import oauth2 as oauth
import base
import rowan.controllers as controllers
import rowan.http as http
TWITTER_OAUTH = {
# These should be fine, unless twitter changes its API
"host": "api.twitter.com",
"callback": "http://localhost:8000/... | {
"repo_name": "cargocult/rowan-python",
"path": "rowan/auth/twitter.py",
"copies": "1",
"size": "4049",
"license": "mit",
"hash": -7771066518132278000,
"line_mean": 32.1885245902,
"line_max": 74,
"alpha_frac": 0.6238577427,
"autogenerated": false,
"ratio": 3.908301158301158,
"config_test": fals... |
"""Authentication and authorization policies, roles and permissions.
Views are defined in the 'yait.views.auth' module, not here.
"""
from pyramid.security import authenticated_userid
from sqlalchemy.orm.exc import NoResultFound
from yait.models import DBSession
from yait.models import Role
from yait.models import ... | {
"repo_name": "dbaty/Yait",
"path": "yait/auth.py",
"copies": "1",
"size": "4844",
"license": "bsd-3-clause",
"hash": -352658436116404860,
"line_mean": 32.8741258741,
"line_max": 74,
"alpha_frac": 0.64223782,
"autogenerated": false,
"ratio": 3.808176100628931,
"config_test": false,
"has_no_ke... |
import base64
import functools
import logging
import os
import textwrap
import httpx
from airflow._vendor.connexion.utils import get_function_from_name
import http.cookies
from ..exceptions import (ConnexionException, OAuthProblem,
OAuthResponseProblem, OAuthScopeProblem)
logger = logging.g... | {
"repo_name": "nathanielvarona/airflow",
"path": "airflow/_vendor/connexion/decorators/security.py",
"copies": "3",
"size": "9853",
"license": "apache-2.0",
"hash": 3671244064150476000,
"line_mean": 27.8944281525,
"line_max": 110,
"alpha_frac": 0.6289454988,
"autogenerated": false,
"ratio": 4.141... |
import functools
import logging
import os
import textwrap
import requests
from ..exceptions import OAuthProblem, OAuthResponseProblem, OAuthScopeProblem
logger = logging.getLogger('connexion.api.security')
# use connection pool for OAuth tokeninfo
adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_m... | {
"repo_name": "NeostreamTechnology/Microservices",
"path": "venv/lib/python2.7/site-packages/connexion/decorators/security.py",
"copies": "1",
"size": "3575",
"license": "mit",
"hash": 7714007610579205000,
"line_mean": 36.6315789474,
"line_max": 105,
"alpha_frac": 0.6072727273,
"autogenerated": fal... |
"""Authentication and Authorization tests against DC/OS Enterprise and root Marathon."""
import pytest
import requests
from shakedown.clients import dcos_url_path, marathon
from shakedown.clients.authentication import DCOSAcsAuth
from shakedown.clients.rpcclient import verify_ssl
from shakedown.dcos.cluster import ee... | {
"repo_name": "gsantovena/marathon",
"path": "tests/system/marathon_auth_common_tests.py",
"copies": "2",
"size": "1366",
"license": "apache-2.0",
"hash": 5957815807943802000,
"line_mean": 40.3939393939,
"line_max": 106,
"alpha_frac": 0.7349926794,
"autogenerated": false,
"ratio": 3.3236009732360... |
"""Authentication api"""
from importlib import import_module
from django.conf import settings
from django.contrib.auth import SESSION_KEY, BACKEND_SESSION_KEY, HASH_SESSION_KEY
from django.db import IntegrityError
from profiles.utils import is_duplicate_username_error
from profiles.api import find_available_username
... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/api.py",
"copies": "1",
"size": "2069",
"license": "bsd-3-clause",
"hash": -2108860854990844000,
"line_mean": 32.3709677419,
"line_max": 99,
"alpha_frac": 0.700821653,
"autogenerated": false,
"ratio": 4.420940170940171,
"config_... |
"""Authentication api"""
import logging
from django.contrib.auth import get_user_model
from django.db import transaction, IntegrityError
from social_core.utils import get_strategy
from authentication.backends.micromasters import MicroMastersAuth
from channels import api as channels_api
from notifications import api a... | {
"repo_name": "mitodl/open-discussions",
"path": "authentication/api.py",
"copies": "1",
"size": "2640",
"license": "bsd-3-clause",
"hash": -7505764960439991000,
"line_mean": 29.3448275862,
"line_max": 87,
"alpha_frac": 0.684469697,
"autogenerated": false,
"ratio": 4.0121580547112465,
"config_t... |
""" Authentication Backend for CommCaer HQ """
from django.conf import settings
from django.contrib.auth.models import User
class HQBackend:
"""
Authenticate against a user's unsalted_password
(given username and sha1 of username:password)
"""
def authenticate(self, username=None, password=None): ... | {
"repo_name": "commtrack/commtrack-core",
"path": "apps/hq/authentication.py",
"copies": "3",
"size": "2135",
"license": "bsd-3-clause",
"hash": 8706163287827843000,
"line_mean": 30.8805970149,
"line_max": 93,
"alpha_frac": 0.5817330211,
"autogenerated": false,
"ratio": 3.9174311926605503,
"con... |
""" Authentication Backend for CommCaer HQ """
from django.conf import settings
from hq.models import ExtUser
class HQBackend:
"""
Authenticate against extuser.unsalted_password
(given username and sha1 of username:password)
"""
def authenticate(self, username=None, password=None):
... | {
"repo_name": "commtrack/commtrack-old-to-del",
"path": "apps/hq/authentication.py",
"copies": "1",
"size": "1998",
"license": "bsd-3-clause",
"hash": -2905620576605606000,
"line_mean": 29.7538461538,
"line_max": 75,
"alpha_frac": 0.5770770771,
"autogenerated": false,
"ratio": 3.8497109826589595,... |
""" Authentication Backend for CommCaer HQ """
from django.conf import settings
from django.contrib.auth.models import User
class HQBackend:
"""
Authenticate against a user's unsalted_password
(given username and sha1 of username:password)
"""
def authenticate(self, username=None, passwor... | {
"repo_name": "commtrack/temp-aquatest",
"path": "apps/hq/authentication.py",
"copies": "1",
"size": "2201",
"license": "bsd-3-clause",
"hash": -8073375033640239000,
"line_mean": 30.8805970149,
"line_max": 93,
"alpha_frac": 0.5642889596,
"autogenerated": false,
"ratio": 3.9945553539019962,
"con... |
""" Authentication backend. Please use slugify function to get username from email """
from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
from tastypie.authentication import ApiKeyAuthentication
class EmailAuthBackend(ModelBackend):
"""
Email Authentication Bac... | {
"repo_name": "iutinvg/django-email-auth-backend",
"path": "backends.py",
"copies": "1",
"size": "1471",
"license": "mit",
"hash": -6987307988962641000,
"line_mean": 30.9782608696,
"line_max": 86,
"alpha_frac": 0.6634942216,
"autogenerated": false,
"ratio": 4.444108761329305,
"config_test": fal... |
"""Authentication backend registry."""
from __future__ import unicode_literals
import logging
from warnings import warn
from django.conf import settings
from django.contrib.auth import get_backends
from django.utils.translation import ugettext_lazy as _
from djblets.registries.registry import (ALREADY_REGISTERED, LO... | {
"repo_name": "reviewboard/reviewboard",
"path": "reviewboard/accounts/backends/registry.py",
"copies": "2",
"size": "4924",
"license": "mit",
"hash": 298989174236463200,
"line_mean": 30.974025974,
"line_max": 79,
"alpha_frac": 0.6169780666,
"autogenerated": false,
"ratio": 4.689523809523809,
"... |
"""Authentication backends for Connect"""
# pylint: disable=protected-access
from django.core.cache import cache
from django.contrib.auth.backends import ModelBackend
class CachedModelAuthBackend(ModelBackend):
"""An extension of `ModelBackend` that allows caching"""
def get_all_permissions(self, user_obj, ob... | {
"repo_name": "ofa/connect",
"path": "open_connect/connect_core/utils/auth_backends.py",
"copies": "2",
"size": "1417",
"license": "mit",
"hash": 7225496955672206000,
"line_mean": 46.2333333333,
"line_max": 79,
"alpha_frac": 0.6217360621,
"autogenerated": false,
"ratio": 4.333333333333333,
"con... |
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'lazysignup.backends.LazySignupBackend',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_proc... | {
"repo_name": "danfairs/antisocial-network",
"path": "asn/settings.py",
"copies": "1",
"size": "5790",
"license": "mit",
"hash": 3937444925355757600,
"line_mean": 33.0588235294,
"line_max": 108,
"alpha_frac": 0.6856649396,
"autogenerated": false,
"ratio": 3.7163029525032094,
"config_test": fals... |
# [ Authentication Backends ] #
import logging
import os
CLEAR_TEXT=1
MD5_HASH =2
OTHER =3
class AbstractBackend():
passwordStorage = CLEAR_TEXT # specifies if the passwords are kept in clear text
def passHash(self, username, password, realm):
return password;
def load(self):
pass
... | {
"repo_name": "slaff/attachix",
"path": "server/core/provider/authentications/backend.py",
"copies": "1",
"size": "4729",
"license": "mit",
"hash": 6532260040631296000,
"line_mean": 26.8235294118,
"line_max": 98,
"alpha_frac": 0.5901882005,
"autogenerated": false,
"ratio": 4.256525652565257,
"c... |
AUTHENTICATION_BACKENDS = (
'oauth2_provider.backends.OAuth2Backend',
'social.backends.twitter.TwitterOAuth',
'social.backends.github.GithubOAuth2',
)
# OAuth2
ACCESS_TOKEN_EXPIRE_SECONDS = 60 * 60 * 24 * 365 # 1 year
SOCIAL_AUTH_PROTECTED_USER_FIELDS = ['email']
# https://apps.twitter.com/
# this is DEV... | {
"repo_name": "AllMyChanges/allmychanges.com",
"path": "allmychanges/settings/auth.py",
"copies": "1",
"size": "2237",
"license": "bsd-2-clause",
"hash": -6580981944081446000,
"line_mean": 42.862745098,
"line_max": 88,
"alpha_frac": 0.7313366115,
"autogenerated": false,
"ratio": 3.420489296636086... |
AUTHENTICATION_BACKENDS = (
'social_auth.backends.contrib.douban.Douban2Backend',
'social_auth.backends.contrib.qq.QQBackend',
'social_auth.backends.contrib.weibo.WeiboBackend',
'social_auth.backends.contrib.renren.RenRenBackend',
'social_auth.backends.contrib.baidu.BaiduBackend',
'social_auth.b... | {
"repo_name": "duoduo369/social_auth_demo",
"path": "snippet/settings.py",
"copies": "2",
"size": "2218",
"license": "mit",
"hash": 6229452574561048000,
"line_mean": 33.15625,
"line_max": 77,
"alpha_frac": 0.7397072278,
"autogenerated": false,
"ratio": 2.8612565445026177,
"config_test": false,
... |
AUTHENTICATION_BACKENDS = (
'social.backends.amazon.AmazonOAuth2',
'social.backends.angel.AngelOAuth2',
'social.backends.aol.AOLOpenId',
'social.backends.appsfuel.AppsfuelOAuth2',
'social.backends.behance.BehanceOAuth2',
'social.backends.belgiumeid.BelgiumEIDOpenId',
'social.backends.bitbuck... | {
"repo_name": "night-crawler/django-chant",
"path": "chant_project/social_settings.py",
"copies": "1",
"size": "4310",
"license": "mit",
"hash": -5897750761871019000,
"line_mean": 40.0476190476,
"line_max": 76,
"alpha_frac": 0.7473317865,
"autogenerated": false,
"ratio": 3.1691176470588234,
"co... |
# authentication class for API
from flask import request
from flask_restful import Resource, fields
from .parsers import common_get_parser, common_post_parser
from .base import ApiCommon
from ..models import JobRefresh
from ..decorators import token_required, json
from ...server.utils import Permission
from ...serve... | {
"repo_name": "slobodz/TeamServices",
"path": "project/server/api/task.py",
"copies": "1",
"size": "1325",
"license": "mit",
"hash": 6647534116522931000,
"line_mean": 29.8372093023,
"line_max": 84,
"alpha_frac": 0.641509434,
"autogenerated": false,
"ratio": 3.9201183431952664,
"config_test": fa... |
# authentication class for API
from flask_restful import Resource
from flask_apispec import MethodResource, doc
from flask import abort
from sqlalchemy.orm.exc import NoResultFound
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from .parsers import auth_post_parser
from ...server.models impor... | {
"repo_name": "slobodz/TeamServices",
"path": "project/server/api/auth.py",
"copies": "1",
"size": "1177",
"license": "mit",
"hash": 4223939049550708000,
"line_mean": 30,
"line_max": 70,
"alpha_frac": 0.6032285472,
"autogenerated": false,
"ratio": 4.526923076923077,
"config_test": false,
"has... |
"""Authentication exceptions"""
from social_core.exceptions import AuthException
class RequireProviderException(AuthException):
"""The user is required to authenticate via a specific provider/backend"""
def __init__(self, backend, social_auth):
"""
Args:
social_auth (social_django... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/exceptions.py",
"copies": "1",
"size": "2364",
"license": "bsd-3-clause",
"hash": 908950284583427500,
"line_mean": 26.8117647059,
"line_max": 84,
"alpha_frac": 0.6958544839,
"autogenerated": false,
"ratio": 4.7565392354124745,
"... |
"""Authentication Extension
User authentication hooks for WebCore applications.
* This extension is **available in**: `web.security>=2.1.0,<2.2.0`
* This extension has **no external package dependencies or language requirements**.
* This extension is **available with the name** `auth`, 'authn', or 'authentication' in... | {
"repo_name": "marrow/web.security",
"path": "web/ext/auth.py",
"copies": "1",
"size": "6665",
"license": "mit",
"hash": 566941859449485500,
"line_mean": 30.8899521531,
"line_max": 114,
"alpha_frac": 0.7332333083,
"autogenerated": false,
"ratio": 4.109124537607891,
"config_test": true,
"has_n... |
"""Authentication for HTTP component."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from datetime import timedelta
import logging
import secrets
from typing import Final
from urllib.parse import unquote
from aiohttp import hdrs
from aiohttp.web import Application, Request, Stre... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "2",
"size": "4259",
"license": "apache-2.0",
"hash": 2317921701469235000,
"line_mean": 28.1712328767,
"line_max": 86,
"alpha_frac": 0.6114111294,
"autogenerated": false,
"ratio": 4.284708249... |
"""Authentication for HTTP component."""
import asyncio
import base64
import hmac
import logging
from aiohttp import hdrs
from aiohttp.web import middleware
from homeassistant.const import HTTP_HEADER_HA_AUTH
from .util import get_real_ip
from .const import KEY_TRUSTED_NETWORKS, KEY_AUTHENTICATED
DATA_API_PASSWORD =... | {
"repo_name": "ewandor/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "3",
"size": "2304",
"license": "apache-2.0",
"hash": 3529250619101069300,
"line_mean": 26.7590361446,
"line_max": 75,
"alpha_frac": 0.6883680556,
"autogenerated": false,
"ratio": 4.173913043478261,... |
"""Authentication for HTTP component."""
import asyncio
import base64
import hmac
import logging
from aiohttp import hdrs
from homeassistant.const import HTTP_HEADER_HA_AUTH
from .util import get_real_ip
from .const import KEY_TRUSTED_NETWORKS, KEY_AUTHENTICATED
DATA_API_PASSWORD = 'api_password'
_LOGGER = logging.... | {
"repo_name": "stefan-jonasson/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "1",
"size": "2664",
"license": "mit",
"hash": 2746233775085359600,
"line_mean": 27.9565217391,
"line_max": 76,
"alpha_frac": 0.661036036,
"autogenerated": false,
"ratio": 4.374384236453202,... |
"""Authentication for HTTP component."""
import asyncio
import hmac
import logging
from homeassistant.const import HTTP_HEADER_HA_AUTH
from .util import get_real_ip
from .const import KEY_TRUSTED_NETWORKS, KEY_AUTHENTICATED
DATA_API_PASSWORD = 'api_password'
_LOGGER = logging.getLogger(__name__)
@asyncio.coroutine... | {
"repo_name": "shaftoe/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "3",
"size": "1964",
"license": "apache-2.0",
"hash": 3896402517389430300,
"line_mean": 28.7575757576,
"line_max": 74,
"alpha_frac": 0.6583503055,
"autogenerated": false,
"ratio": 4.345132743362832,... |
"""Authentication for HTTP component."""
import base64
import hmac
import logging
from aiohttp import hdrs
from aiohttp.web import middleware
import jwt
from homeassistant.auth.providers import legacy_api_password
from homeassistant.auth.util import generate_secret
from homeassistant.const import HTTP_HEADER_HA_AUTH
... | {
"repo_name": "HydrelioxGitHub/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "1",
"size": "6269",
"license": "apache-2.0",
"hash": -2117000514953568800,
"line_mean": 30.1890547264,
"line_max": 79,
"alpha_frac": 0.612856915,
"autogenerated": false,
"ratio": 4.20174262... |
"""Authentication for HTTP component."""
import base64
import logging
from aiohttp import hdrs
from aiohttp.web import middleware
import jwt
from homeassistant.auth.providers import legacy_api_password
from homeassistant.auth.util import generate_secret
from homeassistant.const import HTTP_HEADER_HA_AUTH
from homeass... | {
"repo_name": "fbradyirl/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "1",
"size": "7407",
"license": "apache-2.0",
"hash": 3278703469062248000,
"line_mean": 31.2043478261,
"line_max": 88,
"alpha_frac": 0.5763466991,
"autogenerated": false,
"ratio": 4.52197802197802... |
"""Authentication for HTTP component."""
import logging
import secrets
from aiohttp import hdrs
from aiohttp.web import middleware
import jwt
from homeassistant.core import callback
from homeassistant.util import dt as dt_util
from .const import KEY_AUTHENTICATED, KEY_HASS_REFRESH_TOKEN_ID, KEY_HASS_USER
# mypy: al... | {
"repo_name": "turbokongen/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "5",
"size": "3757",
"license": "apache-2.0",
"hash": -6646733706166692000,
"line_mean": 27.679389313,
"line_max": 87,
"alpha_frac": 0.6100612191,
"autogenerated": false,
"ratio": 4.160575858250... |
"""Authentication for HTTP component."""
import logging
from aiohttp import hdrs
from aiohttp.web import middleware
import jwt
from homeassistant.auth.util import generate_secret
from homeassistant.core import callback
from homeassistant.util import dt as dt_util
from .const import KEY_AUTHENTICATED, KEY_HASS_USER, ... | {
"repo_name": "joopert/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "2",
"size": "3773",
"license": "apache-2.0",
"hash": 3604284060827295000,
"line_mean": 26.3405797101,
"line_max": 87,
"alpha_frac": 0.5883912006,
"autogenerated": false,
"ratio": 4.3318025258323765... |
"""Authentication for HTTP component."""
import base64
import hmac
import logging
from aiohttp import hdrs
from aiohttp.web import middleware
import jwt
from homeassistant.core import callback
from homeassistant.const import HTTP_HEADER_HA_AUTH
from homeassistant.auth.providers import legacy_api_password
from homeas... | {
"repo_name": "tinloaf/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "1",
"size": "6262",
"license": "apache-2.0",
"hash": -5321763017716089000,
"line_mean": 30,
"line_max": 79,
"alpha_frac": 0.6135419994,
"autogenerated": false,
"ratio": 4.1942397856664435,
"confi... |
"""Authentication for HTTP component."""
import base64
import hmac
import logging
from aiohttp import hdrs
from aiohttp.web import middleware
from homeassistant.core import callback
from homeassistant.const import HTTP_HEADER_HA_AUTH
from .const import KEY_AUTHENTICATED, KEY_REAL_IP
DATA_API_PASSWORD = 'api_passwor... | {
"repo_name": "persandstrom/home-assistant",
"path": "homeassistant/components/http/auth.py",
"copies": "1",
"size": "4322",
"license": "apache-2.0",
"hash": 998796629718866600,
"line_mean": 31.7424242424,
"line_max": 77,
"alpha_frac": 0.6154558075,
"autogenerated": false,
"ratio": 4.348088531187... |
"""Authentication for Magpy backend."""
import tornado.auth
import tornado.web # pylint: disable=W0404
import tornado.gen
import json
from bson import json_util
from bson.objectid import ObjectId
from functools import partial
from magpy.server.database import DatabaseMixin
from magpy.server.utils import dejsonify
imp... | {
"repo_name": "zeth/magpy",
"path": "magpy/server/auth.py",
"copies": "2",
"size": "19421",
"license": "bsd-3-clause",
"hash": 8835503655712473000,
"line_mean": 37.842,
"line_max": 103,
"alpha_frac": 0.5214973482,
"autogenerated": false,
"ratio": 4.877197388247112,
"config_test": false,
"has_... |
"""Authentication for salesforce-reporting"""
import requests
import xml.dom.minidom
try:
# Python 3+
from html import escape
except ImportError:
from cgi import escape
class Connection:
"""
A Salesforce connection for accessing the Salesforce Analytics API using
the Password/Token authentica... | {
"repo_name": "cghall/salesforce-reporting",
"path": "salesforce_reporting/login.py",
"copies": "1",
"size": "5960",
"license": "mit",
"hash": -7162925508853577000,
"line_mean": 36.0186335404,
"line_max": 110,
"alpha_frac": 0.6157718121,
"autogenerated": false,
"ratio": 4.124567474048443,
"conf... |
""" Authentication library
======================
A base authentication & authorization module.
Includes the base class BaseAuth.
Authentication and authorization in NIPAP
-----------------------------------------
NIPAP offers basic authentication with two different backends, a simple
two... | {
"repo_name": "SpriteLink/NIPAP",
"path": "nipap/nipap/authlib.py",
"copies": "4",
"size": "25277",
"license": "mit",
"hash": -7644860344624668000,
"line_mean": 33.1120107962,
"line_max": 179,
"alpha_frac": 0.5885192072,
"autogenerated": false,
"ratio": 4.435339533251447,
"config_test": true,
... |
# authentication methods
import os
import hashlib
import binascii
from struct import pack
try:
from genelist import conf
except:
pass
def authenticate(username, password):
found_pass = None
with conf.conn() as conn:
cur = conn.cursor()
cur.execute('SELECT id, password FROM users WHERE... | {
"repo_name": "compgen-io/genelist",
"path": "src/genelist/auth.py",
"copies": "1",
"size": "4819",
"license": "bsd-3-clause",
"hash": -3196120618602061000,
"line_mean": 29.11875,
"line_max": 122,
"alpha_frac": 0.5789582901,
"autogenerated": false,
"ratio": 3.5749258160237387,
"config_test": fa... |
"""Authentication middleware"""
from django.db.models import Q
from django.http import HttpResponseForbidden
from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin
from django.utils.http import urlquote
from ipware import get_client_ip
from rest_framework.permissions import SAFE_METH... | {
"repo_name": "mitodl/open-discussions",
"path": "authentication/middleware.py",
"copies": "1",
"size": "2758",
"license": "bsd-3-clause",
"hash": -3173586217589866000,
"line_mean": 36.2702702703,
"line_max": 100,
"alpha_frac": 0.6493836113,
"autogenerated": false,
"ratio": 4.666666666666667,
"... |
"""Authentication middleware"""
from django.shortcuts import redirect
from django.utils.http import urlquote
from social_core.exceptions import SocialAuthBaseException
from social_django.middleware import SocialAuthExceptionMiddleware
class SocialAuthExceptionRedirectMiddleware(SocialAuthExceptionMiddleware):
""... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/middleware.py",
"copies": "1",
"size": "1373",
"license": "bsd-3-clause",
"hash": -7086708821217838000,
"line_mean": 38.2285714286,
"line_max": 86,
"alpha_frac": 0.6722505462,
"autogenerated": false,
"ratio": 4.9035714285714285,
... |
"""Authentication module for registration, logging in, and changing password"""
from flask import render_template, redirect, url_for, flash, \
request, session
from flask_login import login_user, logout_user, current_user
from app import app
from .alchemy import db, User, tablename
from passlib.hash import sha256_... | {
"repo_name": "disfear86/mushcloud",
"path": "app/auth.py",
"copies": "1",
"size": "6298",
"license": "apache-2.0",
"hash": 2940657145644754400,
"line_mean": 33.6043956044,
"line_max": 87,
"alpha_frac": 0.5770085742,
"autogenerated": false,
"ratio": 4.116339869281045,
"config_test": false,
"h... |
"""Authentication operations."""
import logging
import requests
from objectrocket import bases
from objectrocket import errors
logger = logging.getLogger(__name__)
class Auth(bases.BaseAuthLayer):
"""Authentication operations.
:param objectrocket.client.Client base_client: An objectrocket.client.Client ins... | {
"repo_name": "objectrocket/python-client",
"path": "objectrocket/auth.py",
"copies": "1",
"size": "4660",
"license": "mit",
"hash": -7697218388234832000,
"line_mean": 32.2857142857,
"line_max": 95,
"alpha_frac": 0.5916309013,
"autogenerated": false,
"ratio": 4.844074844074844,
"config_test": f... |
"""Authentication out of the box.
References
----------
https://stackoverflow.com/questions/13428708/best-way-to-make-flask-logins-login-required-the-default
https://stackoverflow.com/questions/14367991/flask-before-request-add-exception-for-specific-route
"""
from typing import Dict, Optional
from abc import ABC, a... | {
"repo_name": "jwkvam/conex",
"path": "bowtie/auth.py",
"copies": "1",
"size": "2953",
"license": "mit",
"hash": -7849294948340268000,
"line_mean": 29.7604166667,
"line_max": 101,
"alpha_frac": 0.6088723332,
"autogenerated": false,
"ratio": 4.460725075528701,
"config_test": false,
"has_no_key... |
# authentication_password.py is the first layer of Security Module. This system works with traditional user - password architecture.
from Tkinter import *
# destroys the authentication window
def quit(self):
self.root.destroy()
def authentication_password_main():
root = Tk()
root.geometry("500x200")
root.wm_... | {
"repo_name": "ahmetozlu/aipa",
"path": "modules/#1 Security Module/#1.1 UserName - Password Authentication/authentication_password.py",
"copies": "1",
"size": "1394",
"license": "mit",
"hash": -1816965476439668500,
"line_mean": 26.88,
"line_max": 132,
"alpha_frac": 0.7216642755,
"autogenerated": f... |
"""Authentication plug-in for rights management."""
from lib.plugin import Plugin
from lib.core import User
from lib.logger import log
from lib.config import configuration
class AuthPlugin(Plugin):
def __init__(self):
Plugin.__init__(self, 'auth')
self._set_summary(_('Authentification plugin'... | {
"repo_name": "AustrianGeekForce/p1tr-legacy",
"path": "plugins/auth.py",
"copies": "1",
"size": "6271",
"license": "bsd-3-clause",
"hash": 3680356825581324300,
"line_mean": 39.4580645161,
"line_max": 83,
"alpha_frac": 0.5321320364,
"autogenerated": false,
"ratio": 4.2115513767629285,
"config_t... |
"""Authentication process"""
import cherrypy
import lib.db_users as db_users
def check_auth(required=True, user_role=None):
"""Check authentication"""
if required:
user = db_users.user_by_session(cherrypy.session.id)
if user == None:
cherrypy.lib.sessions.expire()
raise ... | {
"repo_name": "JB26/Bibthek",
"path": "lib/auth.py",
"copies": "1",
"size": "1040",
"license": "mit",
"hash": 7636006552158591000,
"line_mean": 37.5185185185,
"line_max": 69,
"alpha_frac": 0.6298076923,
"autogenerated": false,
"ratio": 3.9393939393939394,
"config_test": false,
"has_no_keyword... |
"""Authentication related tests."""
import json
import pytest
from server.extensions import db
from server.models.user import User
@pytest.mark.usefixtures('dbmodels', 'dbtransaction')
class TestUserCreation:
"""User creation tests."""
def test_user_creation(self, app, client):
"""A user an be creat... | {
"repo_name": "Nukesor/spacesurvival",
"path": "tests/api/test_auth.py",
"copies": "1",
"size": "2598",
"license": "mit",
"hash": 5119047904296635000,
"line_mean": 31.0740740741,
"line_max": 58,
"alpha_frac": 0.5473441109,
"autogenerated": false,
"ratio": 4.217532467532467,
"config_test": true,... |
AUTHENTICATION_REQUIRED_401 = 401
NOT_AUTHORIZED_403 = 403
INVALID_REQUEST_400 = 400
REQUEST_ENTITY_TOO_LARGE_413 = 413
NOT_FOUND_404 = 404
INTERNAL_SERVER_ERROR_500 = 500
RESOURCE_CONFLICT_409 = 409
PAYMENT_REQUIRED_402 = 402
HEADER_PRECONDITIONS_FAILED = 412
LOCKED_423 = 423
TOO_MANY_REQUESTS_429 = 429
class JSONAP... | {
"repo_name": "Patreon/cartographer",
"path": "cartographer/exceptions/request_exceptions.py",
"copies": "1",
"size": "2455",
"license": "apache-2.0",
"hash": -2017469020522481400,
"line_mean": 32.6301369863,
"line_max": 96,
"alpha_frac": 0.6676171079,
"autogenerated": false,
"ratio": 3.966074313... |
"""Authentication serializers"""
import logging
from django.contrib.auth import get_user_model
from django.http import HttpResponseRedirect
from social_django.views import _do_login as login
from social_core.backends.email import EmailAuth
from social_core.exceptions import InvalidEmail, AuthException
from social_core... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/serializers.py",
"copies": "1",
"size": "13551",
"license": "bsd-3-clause",
"hash": 2646002320414702000,
"line_mean": 37.4971590909,
"line_max": 106,
"alpha_frac": 0.6366319829,
"autogenerated": false,
"ratio": 4.592002710945442,
... |
"""AuthenticationsLog API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class AuthenticationsLogAPI(BaseCanvasAPI):
"""AuthenticationsLog... | {
"repo_name": "tylerclair/py3canvas",
"path": "py3canvas/apis/authentications_log.py",
"copies": "1",
"size": "7828",
"license": "mit",
"hash": -8194398767201231000,
"line_mean": 39.7708333333,
"line_max": 174,
"alpha_frac": 0.6067961165,
"autogenerated": false,
"ratio": 3.9022931206380855,
"co... |
"""AuthenticationsLog API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from base import BaseCanvasAPI
from base import BaseModel
class AuthenticationsLogAPI(BaseCanvasAPI):
"""Authentic... | {
"repo_name": "PGower/PyCanvas",
"path": "pycanvas/apis/authentications_log.py",
"copies": "1",
"size": "6210",
"license": "mit",
"hash": -8978200857455608000,
"line_mean": 34.9642857143,
"line_max": 174,
"alpha_frac": 0.6022544283,
"autogenerated": false,
"ratio": 4.066797642436149,
"config_te... |
# Authentication tests based on airmozilla
# https://github.com/mozilla/airmozilla/blob/master/airmozilla/\
# auth/tests/test_views.py
import base64
import json
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.shortcuts import redi... | {
"repo_name": "chirilo/remo",
"path": "remo/base/tests/test_views.py",
"copies": "3",
"size": "20998",
"license": "bsd-3-clause",
"hash": 738716113425263600,
"line_mean": 42.1170431211,
"line_max": 79,
"alpha_frac": 0.6002952662,
"autogenerated": false,
"ratio": 3.8748846650673556,
"config_test... |
"""Authentication utils"""
from social_core.utils import get_strategy
from social_django.models import UserSocialAuth
from social_django.utils import STORAGE
from authentication.backends.micromasters import MicroMastersAuth
from authentication.exceptions import UserMissingSocialAuthException
# static for now
ALLOWED_... | {
"repo_name": "mitodl/open-discussions",
"path": "authentication/utils.py",
"copies": "1",
"size": "2911",
"license": "bsd-3-clause",
"hash": -5809767254463715000,
"line_mean": 29.3229166667,
"line_max": 112,
"alpha_frac": 0.6684987977,
"autogenerated": false,
"ratio": 4.255847953216374,
"confi... |
"""Authentication utils"""
from social_core.utils import get_strategy
from social_django.utils import STORAGE
class SocialAuthState: # pylint: disable=too-many-instance-attributes
"""Social auth state"""
FLOW_REGISTER = "register"
FLOW_LOGIN = "login"
# login states
STATE_LOGIN_EMAIL = "login/e... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/utils.py",
"copies": "1",
"size": "1821",
"license": "bsd-3-clause",
"hash": -5212208765886409000,
"line_mean": 27.9047619048,
"line_max": 79,
"alpha_frac": 0.6436024163,
"autogenerated": false,
"ratio": 3.88272921108742,
"confi... |
"""Authentication views"""
from urllib.parse import quote
import requests
from django.conf import settings
from django.core import mail as django_mail
from django.contrib.auth import get_user_model
from django.shortcuts import render
from social_core.backends.email import EmailAuth
from social_django.models import Use... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "authentication/views.py",
"copies": "1",
"size": "6374",
"license": "bsd-3-clause",
"hash": -6791200546418788000,
"line_mean": 32.3717277487,
"line_max": 105,
"alpha_frac": 0.6810480075,
"autogenerated": false,
"ratio": 4.404975812024879,
"con... |
"""Authentication views"""
from urllib.parse import quote
import requests
from django.conf import settings
from django.core import mail as django_mail
from django.contrib.auth import get_user_model, update_session_auth_hash
from django.shortcuts import render, redirect
from social_core.backends.email import EmailAuth
... | {
"repo_name": "mitodl/open-discussions",
"path": "authentication/views.py",
"copies": "1",
"size": "8358",
"license": "bsd-3-clause",
"hash": -8758623401227280000,
"line_mean": 34.8712446352,
"line_max": 105,
"alpha_frac": 0.6689399378,
"autogenerated": false,
"ratio": 4.281762295081967,
"confi... |
# authentication/views.py
# Create your views here.
from django.views.decorators.csrf import csrf_protect
from django.shortcuts import render_to_response
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.template import RequestContext
from authentication.models import User
fr... | {
"repo_name": "midhun3112/restaurant_locator",
"path": "Restaurant_Finder_App/restaurant_finder_app/restaurant_finder_app/authentication/utils/views.py",
"copies": "1",
"size": "2572",
"license": "apache-2.0",
"hash": -5951359536418152000,
"line_mean": 32.8421052632,
"line_max": 90,
"alpha_frac": 0.6... |
# Auther: Alan
from PIL import Image
import numpy as np
def test1():
input_path = "./laska.png"
maxsize = (32, 32)
# box = (0, 0, 28, 28)
lena = Image.open(input_path)
# print(type(lena))
lena.thumbnail(maxsize, Image.ANTIALIAS)
lena.save("temp.jpg", "JPEG")
# lena = Image.open("temp... | {
"repo_name": "songjs1993/DeepLearning",
"path": "3CNN/vgg/analysis_classification.py",
"copies": "1",
"size": "1519",
"license": "apache-2.0",
"hash": -8476503702593357000,
"line_mean": 23.737704918,
"line_max": 70,
"alpha_frac": 0.5049701789,
"autogenerated": false,
"ratio": 2.8364661654135337,... |
# Auther: Alan
import matplotlib.pyplot as plt
def draw_flower():
accu = [0.617647, 0.608824, 0.591176, 0.55, 0.561765]
accu = [0.570588, 0.585294, 0.579412, 0.535294, 0.520588]
# plt.plot([accu[0]] * M, label="base learner")
plt.margins(0.08)
plt.plot(accu, label="my")
names = [0.2, 0.4, 0.6,... | {
"repo_name": "songjs1993/DeepLearning",
"path": "3CNN/draw.py",
"copies": "1",
"size": "1057",
"license": "apache-2.0",
"hash": 610517153889668000,
"line_mean": 26.1025641026,
"line_max": 61,
"alpha_frac": 0.5714285714,
"autogenerated": false,
"ratio": 2.4524361948955917,
"config_test": false,... |
# Auther: Alan
import tensorflow as tf
import random
import os
import scipy.io as sio
import matplotlib.pyplot as plt # plt 用于显示图片
import matplotlib.image as mpimg # mpimg 用于读取图片
import numpy as np
# import Image
from PIL import Image
global max_row, max_col
def weight_variable(shape):
initial = tf.truncated_norm... | {
"repo_name": "songjs1993/DeepLearning",
"path": "3CNN/CNN_LeNet_5.py",
"copies": "1",
"size": "20045",
"license": "apache-2.0",
"hash": 6044837463063899000,
"line_mean": 39.1847133758,
"line_max": 145,
"alpha_frac": 0.569292545,
"autogenerated": false,
"ratio": 2.659780775716695,
"config_test"... |
# Auther: Alan
"""
还没试,因为之前Disease.py没收敛
现在好像都收敛不了,尝试下VGG吧。
随机切割。。
"""
import tensorflow as tf
import random
import os
import scipy.io as sio
# import matplotlib.pyplot as plt # plt
import matplotlib.image as mpimg # mpimg
import numpy as np
# import Image
import math
from PIL import Image
import xlrd
class Diseas... | {
"repo_name": "songjs1993/DeepLearning",
"path": "5Project/disease_classification/Disease.py",
"copies": "1",
"size": "12801",
"license": "apache-2.0",
"hash": 5586972919991105000,
"line_mean": 37.8323170732,
"line_max": 207,
"alpha_frac": 0.5330140535,
"autogenerated": false,
"ratio": 3.14726958... |
'''
The MIT License (MIT)
Copyright (c) 2014 Ahmet Besir Kurtulmus
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, modif... | {
"repo_name": "besirkurtulmus/AdvancedAlgorithms",
"path": "Sorting/MergeSort.py",
"copies": "1",
"size": "3060",
"license": "mit",
"hash": 8919339279610623000,
"line_mean": 25.8421052632,
"line_max": 80,
"alpha_frac": 0.7031709709,
"autogenerated": false,
"ratio": 3.0197433366238893,
"config_t... |
__auther__='Jorgen Grimnes, Sudhanshu Patel'
from sklearn import datasets
import numpy as np
from activation_functions import sigmoid_function, tanh_function, linear_function,\
LReLU_function, ReLU_function, symmetric_elliot_function, elliot_function
from neuralnet import NeuralNet
... | {
"repo_name": "sudhanshuptl/python-neural-network",
"path": "Iris_Data_Backprop/main.py",
"copies": "1",
"size": "2498",
"license": "bsd-2-clause",
"hash": -6622687449881503000,
"line_mean": 35.7352941176,
"line_max": 125,
"alpha_frac": 0.6321056845,
"autogenerated": false,
"ratio": 3.71173848439... |
# @auther: Seven Lju
# @date: 2015-08-06
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from django.http import HttpResponse, Http404
from django.views.decorators.csrf import csrf_exempt
def blankFile(f, size):
print 'size =', size
step = 10*1024*... | {
"repo_name": "dna2github/petalJS",
"path": "upload/upload/urls.py",
"copies": "3",
"size": "1518",
"license": "mit",
"hash": 894887338188166100,
"line_mean": 27.1111111111,
"line_max": 70,
"alpha_frac": 0.5895915679,
"autogenerated": false,
"ratio": 3.580188679245283,
"config_test": false,
"... |
__auther__='Sudhanshu Patel'
import xlrd
#find top 3 frequently occuring genere
Wbook = xlrd.open_workbook('PicturePerfect.xlsx') #global data
def TopGenere(limit=3):
#top n genere
#print 'no of sheets ',Wbook.nsheets
# we r goint to process only first sheet
data = Wbook.sheet_by_index(0)
ge... | {
"repo_name": "Hack22learn/Small-Application---Python",
"path": "picturePerfect/top_genre.py",
"copies": "2",
"size": "1133",
"license": "mit",
"hash": 4249662938536166400,
"line_mean": 26.6341463415,
"line_max": 62,
"alpha_frac": 0.5931156222,
"autogenerated": false,
"ratio": 3.303206997084548,
... |
"""Auth handler"""
from pyramid.httpexceptions import HTTPFound
from pyramid.url import route_url
from pyramid_handlers import action
from webhelpers import paginate
import uuid
from haven.forms.account import LoginForm
from haven.models.account import Account
class AuthHandler(object):
def __init__(self, reques... | {
"repo_name": "Niedra/Haven",
"path": "haven/handlers/auth.py",
"copies": "1",
"size": "1354",
"license": "isc",
"hash": 7039729800064316000,
"line_mean": 34.6315789474,
"line_max": 86,
"alpha_frac": 0.6211225997,
"autogenerated": false,
"ratio": 4.23125,
"config_test": false,
"has_no_keyword... |
# AuthHandler takes care of devising the auth type and using it
class AuthHandler():
URL_SECRET = 2
URL_TOKEN = 3
def __init__(self, auth):
self.auth = auth
# Calculating the Authentication Type
def get_auth_type(self):
if 'client_id' in self.auth and 'client_secret' in self.auth:
return self.URL_SECRET... | {
"repo_name": "schevalier/Whetlab-Python-Client",
"path": "whetlab/server/http_client/auth_handler.py",
"copies": "1",
"size": "1171",
"license": "bsd-3-clause",
"hash": 7120606539180506000,
"line_mean": 21.9607843137,
"line_max": 80,
"alpha_frac": 0.6908625107,
"autogenerated": false,
"ratio": 3... |
import sys
import os
import csv
import datetime
from datetime import timedelta
import re
from re import sub
from decimal import Decimal
directory = '/Users/lkerxhalli/Documents/iris/jun12/'
csvinputfile = directory + 'TransactionSearchResults374.csv'
csvoutputfile = directory + 'VendorSummary374.csv'
def main():
... | {
"repo_name": "lkerxhalli/tools",
"path": "vendors/vendors.py",
"copies": "1",
"size": "5623",
"license": "mit",
"hash": 2135060376857435400,
"line_mean": 36.9932432432,
"line_max": 114,
"alpha_frac": 0.5077360839,
"autogenerated": false,
"ratio": 4.424075531077891,
"config_test": false,
"has... |
import sys
import os
import csv
import datetime
from datetime import timedelta
import calendar
from dateutil.relativedelta import *
import re
from re import sub
from decimal import Decimal
directory = '/Users/lkerxhalli/Documents/iris/jun14/'
name = 'A_PPaymentHistorybyBill968'
csvinputfile = directory + name + '.c... | {
"repo_name": "lkerxhalli/tools",
"path": "payments/invoices.py",
"copies": "1",
"size": "5836",
"license": "mit",
"hash": 1322124914766140200,
"line_mean": 26.2710280374,
"line_max": 93,
"alpha_frac": 0.5781357094,
"autogenerated": false,
"ratio": 3.792072774528915,
"config_test": false,
"ha... |
import sys
import os
import csv
import datetime
from datetime import timedelta
import re
from re import sub
from decimal import Decimal
directory = '/Users/lkerxhalli/Documents/iris/jan29/'
fname = 'CIS'
csvinputfile = directory + fname + ' payments.csv'
csvopenbills = directory + fname + ' open bills.csv'
csvoutpu... | {
"repo_name": "lkerxhalli/tools",
"path": "payments/payments.py",
"copies": "1",
"size": "5915",
"license": "mit",
"hash": 4930711768281848000,
"line_mean": 24.063559322,
"line_max": 83,
"alpha_frac": 0.6713440406,
"autogenerated": false,
"ratio": 2.9589794897448725,
"config_test": false,
"ha... |
import sys
import os
import csv
import datetime
from datetime import timedelta
import re
from re import sub
from decimal import Decimal
directory = '/Users/lkerxhalli/Documents/iris/jun13/'
name = 'NPS 1.1.19 4.30.19'
csvinputfile = directory + name + '.csv'
csvoutputfile = directory + name + ' out.csv'
hName = '... | {
"repo_name": "lkerxhalli/tools",
"path": "payments/paymentswobill.py",
"copies": "1",
"size": "5997",
"license": "mit",
"hash": 6765552083399382000,
"line_mean": 27.1549295775,
"line_max": 92,
"alpha_frac": 0.5729531432,
"autogenerated": false,
"ratio": 3.688191881918819,
"config_test": false,... |
"""Auth models."""
from datetime import datetime, timedelta
from typing import Dict, List, NamedTuple, Optional
import uuid
import attr
from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN
from .util import generate_secret
TOKEN_TYPE_NORMAL = "normal"
... | {
"repo_name": "joopert/home-assistant",
"path": "homeassistant/auth/models.py",
"copies": "3",
"size": "3773",
"license": "apache-2.0",
"hash": 6942480508589013000,
"line_mean": 30.4416666667,
"line_max": 86,
"alpha_frac": 0.6649880732,
"autogenerated": false,
"ratio": 3.439380127620784,
"confi... |
"""Auth models."""
from datetime import datetime, timedelta
from typing import Dict, List, NamedTuple, Optional # noqa: F401
import uuid
import attr
from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN
from .util import generate_secret
TOKEN_TYPE_NORM... | {
"repo_name": "HydrelioxGitHub/home-assistant",
"path": "homeassistant/auth/models.py",
"copies": "12",
"size": "4027",
"license": "apache-2.0",
"hash": 1218640237234901800,
"line_mean": 30.4609375,
"line_max": 77,
"alpha_frac": 0.6411720884,
"autogenerated": false,
"ratio": 3.5017391304347827,
... |
"""Auth models."""
from datetime import datetime, timedelta
import secrets
from typing import Dict, List, NamedTuple, Optional
import uuid
import attr
from homeassistant.const import __version__
from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN
TOKE... | {
"repo_name": "partofthething/home-assistant",
"path": "homeassistant/auth/models.py",
"copies": "2",
"size": "3896",
"license": "mit",
"hash": -427211423434978800,
"line_mean": 28.2932330827,
"line_max": 86,
"alpha_frac": 0.6532340862,
"autogenerated": false,
"ratio": 3.497307001795332,
"confi... |
"""Auth models."""
from datetime import datetime, timedelta
import secrets
from typing import Dict, List, NamedTuple, Optional
import uuid
import attr
from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN
TOKEN_TYPE_NORMAL = "normal"
TOKEN_TYPE_SYSTEM =... | {
"repo_name": "leppa/home-assistant",
"path": "homeassistant/auth/models.py",
"copies": "2",
"size": "3758",
"license": "apache-2.0",
"hash": -8796732767231070000,
"line_mean": 30.3166666667,
"line_max": 86,
"alpha_frac": 0.6641830761,
"autogenerated": false,
"ratio": 3.428832116788321,
"config... |
"""Auth models."""
from __future__ import annotations
from datetime import datetime, timedelta
import secrets
from typing import NamedTuple
import uuid
import attr
from homeassistant.const import __version__
from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/auth/models.py",
"copies": "5",
"size": "3868",
"license": "apache-2.0",
"hash": 723616675521704000,
"line_mean": 27.6518518519,
"line_max": 86,
"alpha_frac": 0.6483971044,
"autogenerated": false,
"ratio": 3.5067996373526746,
"conf... |
"""auth
Revision ID: 140aa9118ff
Revises: None
Create Date: 2015-03-13 18:13
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy_searchable import sync_trigger
revision = '140aa9118ff'
down_revision = None
def upgrade():
conn = op.get_bind()
op.create_table(
'users',
sa.Colu... | {
"repo_name": "lucuma/vd-flask",
"path": "migrations/versions/20150313-18-13_140aa9118ff_auth.py",
"copies": "1",
"size": "2416",
"license": "bsd-3-clause",
"hash": -4919639636854227000,
"line_mean": 37.3492063492,
"line_max": 93,
"alpha_frac": 0.6233443709,
"autogenerated": false,
"ratio": 3.273... |
"""auth
Revision ID: cd454cecb6e8
Revises: 5cbf5ac4455e
Create Date: 2017-04-26 16:41:11.797947
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cd454cecb6e8'
down_revision = '5cbf5ac4455e'
branch_labels = None
depends_on = None
def upgrade():
# ### comma... | {
"repo_name": "dmitrijbozhkov/zno-library",
"path": "server/src/alembic/versions/cd454cecb6e8_auth.py",
"copies": "1",
"size": "2472",
"license": "apache-2.0",
"hash": -8481260425220693000,
"line_mean": 34.3142857143,
"line_max": 67,
"alpha_frac": 0.6553398058,
"autogenerated": false,
"ratio": 3.... |
"""authome URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"repo_name": "xncbf/authome",
"path": "board/urls.py",
"copies": "1",
"size": "1129",
"license": "mit",
"hash": 6540956768685010000,
"line_mean": 37.9310344828,
"line_max": 88,
"alpha_frac": 0.6829052259,
"autogenerated": false,
"ratio": 3.272463768115942,
"config_test": false,
"has_no_keywo... |
__author__ = '01'
__author__ += "Binary"
__author__ += "ZeroOne"
__author__ += "Hooman"
from scapy.layers.inet import *
from scapy.all import *
import threading
import time
import sys
import os
conf.route.resync()
conf.verb = 0
def PacketAnalyze(Pck) :
if((Pck.haslayer(IP)) and ((Pck.getlayer(IP).src == Target1... | {
"repo_name": "Hooman01/RemoteSniffer",
"path": "Main.py",
"copies": "1",
"size": "2674",
"license": "unlicense",
"hash": -2506831773551676000,
"line_mean": 24.4666666667,
"line_max": 189,
"alpha_frac": 0.5044876589,
"autogenerated": false,
"ratio": 2.7883211678832116,
"config_test": false,
"... |
__author__ = '116_13'
from tkinter import *
import time
tk = Tk()
tk.title('계산기')
tk.resizable(0,0)
#tk.wm_attributes("-topmost",1)
canvas = Canvas(tk,width = 340,height = 620, bd = 0, highlightthickness = 0)
canvas.pack()
canvas.create_rectangle(0,0,340,620, fill = '#1f1f1f')
#검정 배경색
canvas.create_rectangle(0,0,340,2... | {
"repo_name": "saintdragon2/python-3-lecture-2015",
"path": "sinsojael_final/2nd_presentation/2조/calc_2.py",
"copies": "1",
"size": "11631",
"license": "mit",
"hash": -8781168408872996000,
"line_mean": 41.3153846154,
"line_max": 113,
"alpha_frac": 0.3787837469,
"autogenerated": false,
"ratio": 2.... |
__author__ = '116_24'
import pygame
import sys
import time
from pygame.locals import *
import random
import math
import entities
pygame.init()
mainClock = pygame.time.Clock()
windowSurface = pygame.display.set_mode((500, 400), 0, 32)
pygame.display.set_caption('Dungeon Sam is pretty damn cool v0.9, 10/16/11')
white... | {
"repo_name": "saintdragon2/python-3-lecture-2015",
"path": "civil_mid_mid/hwaa.py",
"copies": "1",
"size": "8713",
"license": "mit",
"hash": 8907037313934475000,
"line_mean": 28.1404682274,
"line_max": 130,
"alpha_frac": 0.6403075864,
"autogenerated": false,
"ratio": 3.2151291512915128,
"confi... |
__author__ = '1'
from model.address import Address
import re
class AddressHelper:
def __init__(self, app):
self.app = app
def open_address_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("http://localhost/addressbook/") and len(wd.find_elements_by_name("Send e-Mail")) > 0... | {
"repo_name": "liliasapurina/python_training",
"path": "fixture/address.py",
"copies": "1",
"size": "8345",
"license": "apache-2.0",
"hash": -3074819857100079600,
"line_mean": 42.6963350785,
"line_max": 127,
"alpha_frac": 0.6027561414,
"autogenerated": false,
"ratio": 3.509251471825063,
"config... |
__author__ = '1'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_group_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("... | {
"repo_name": "liliasapurina/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "4782",
"license": "apache-2.0",
"hash": -3402304160222706000,
"line_mean": 34.962406015,
"line_max": 100,
"alpha_frac": 0.5972396487,
"autogenerated": false,
"ratio": 3.4132762312633833,
"config_t... |
__author__ = '1'
from model.project import Project
class ProjectHelper:
def __init__(self, app):
self.app = app
def open_projects_page(self):
wd = self.app.wd
# open manage page
wd.find_element_by_xpath("//html/body/table[2]/tbody/tr/td[1]/a[7]").click()
#find_element_... | {
"repo_name": "liliasapurina/python_training_mantiss",
"path": "fixture/project.py",
"copies": "1",
"size": "2412",
"license": "apache-2.0",
"hash": 7027408496536794000,
"line_mean": 39.2,
"line_max": 135,
"alpha_frac": 0.6044776119,
"autogenerated": false,
"ratio": 3.4019746121297603,
"config_... |
__author__ = '1'
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.address import Address
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = "group_list"
id = PrimaryKey(int, column = "gro... | {
"repo_name": "liliasapurina/python_training",
"path": "fixture/orm.py",
"copies": "1",
"size": "3210",
"license": "apache-2.0",
"hash": 3492404560571746000,
"line_mean": 43.5972222222,
"line_max": 149,
"alpha_frac": 0.6429906542,
"autogenerated": false,
"ratio": 3.7943262411347516,
"config_tes... |
__author__ = '1'
from sys import maxsize
class Address:
def __init__(self,name = None,middlename = None,lastname = None,nickname = None,company = None,address=None,id = None,
phone = None,mobilephone = None,workphone = None,secondaryphone = None,
all_phones_from_home_page = None,a... | {
"repo_name": "liliasapurina/python_training",
"path": "model/address.py",
"copies": "1",
"size": "1411",
"license": "apache-2.0",
"hash": -4229967786991187000,
"line_mean": 37.1351351351,
"line_max": 138,
"alpha_frac": 0.6031183558,
"autogenerated": false,
"ratio": 3.664935064935065,
"config_t... |
__author__ = '1'
from telnetlib import Telnet
class JamesHelper:
def __init__(self, app):
self.app = app
def ensure_user_exist(self, username, password):
james_config = self.app.config["james"]
session = JamesHelper.Session(james_config["host"], james_config["port"], james_config["use... | {
"repo_name": "liliasapurina/python_training_mantiss",
"path": "fixture/james.py",
"copies": "1",
"size": "1707",
"license": "apache-2.0",
"hash": -8183776568483045000,
"line_mean": 34.5833333333,
"line_max": 133,
"alpha_frac": 0.5776215583,
"autogenerated": false,
"ratio": 3.7933333333333334,
... |
__author__ = '1'
import mysql.connector
from model.group import Group
from model.address import Address
class DbFixture:
def __init__(self, host, user, name, password):
self.host = host
self.user = user
self.name = name
self.password = password
self.connection = mysql.conne... | {
"repo_name": "liliasapurina/python_training",
"path": "fixture/db.py",
"copies": "1",
"size": "1764",
"license": "apache-2.0",
"hash": -6711613908031418000,
"line_mean": 39.1136363636,
"line_max": 194,
"alpha_frac": 0.6003401361,
"autogenerated": false,
"ratio": 4.180094786729858,
"config_test... |
__author__ = '1'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
# open home page
self.app.open_home_page()
# login
wd.find_element_by_name("user").click()
wd.find_element_by_name("user"... | {
"repo_name": "liliasapurina/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1458",
"license": "apache-2.0",
"hash": 1313394902257111800,
"line_mean": 28.7755102041,
"line_max": 73,
"alpha_frac": 0.561042524,
"autogenerated": false,
"ratio": 3.390697674418605,
"config_te... |
__author__ = '1'
from model.address import Address
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:],"n:f:",["number of groups","file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/addresses.... | {
"repo_name": "liliasapurina/python_training",
"path": "generator/address.py",
"copies": "1",
"size": "1885",
"license": "apache-2.0",
"hash": 1384795451396821800,
"line_mean": 34.5660377358,
"line_max": 168,
"alpha_frac": 0.6525198939,
"autogenerated": false,
"ratio": 3.336283185840708,
"confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.