repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
missionpinball/mpf | mpf/modes/game/code/game.py | 1 | 31543 | """Contains the Game class which is the Machine Mode that actually runs and manages the game in a pinball machine.
Note that in the Mission Pinball Framework, a distinction is made between a
*game* and a *machine*. A *game* refers to a game in progress, whereas a
*machine* is the physical pinball machine.
"""
from fun... | mit | 6ea7fdf1517a28018f0609f39e856bc7 | 39.182166 | 119 | 0.588245 | 4.286899 | false | false | false | false |
missionpinball/mpf | mpf/devices/stepper.py | 1 | 9259 | """Implements a servo in MPF."""
import asyncio
from typing import Optional
from mpf.platforms.interfaces.stepper_platform_interface import StepperPlatformInterface
from mpf.core.delays import DelayManager
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.syst... | mit | 36adc76a53e311773d27e202222fe1ed | 40.895928 | 120 | 0.600497 | 4.102348 | false | true | false | false |
missionpinball/mpf | mpf/commands/scaffold.py | 1 | 4392 | """Scaffold YAMLs in your machine."""
import cmd
import os
from mpf.file_interfaces.yaml_roundtrip import YamlRoundtrip
class ScaffoldCli(cmd.Cmd):
"""Scaffolding for MPF."""
intro = 'Welcome to the MPF scaffolding shell. Type help or ? to list commands.\n'
prompt = "(scaffold) "
def __init__(self... | mit | 356823eb46b76eb629518970b0cfa33c | 31.776119 | 110 | 0.570128 | 4.007299 | false | true | false | false |
missionpinball/mpf | mpf/tests/test_Game.py | 1 | 30362 | from mpf.tests.MpfFakeGameTestCase import MpfFakeGameTestCase
from mpf.tests.MpfGameTestCase import MpfGameTestCase
from unittest.mock import MagicMock, patch
class TestGame(MpfGameTestCase):
def get_config_file(self):
return 'config.yaml'
def get_machine_path(self):
return 'tests/machine_f... | mit | 570c440e6198506312373ae3f4144b49 | 58.41683 | 116 | 0.659838 | 3.416835 | false | false | false | false |
missionpinball/mpf | mpf/config_players/random_event_player.py | 1 | 3446 | """Random event config player."""
from mpf.core.config_player import ConfigPlayer
from mpf.core.randomizer import Randomizer
from mpf.core.utility_functions import Util
class RandomEventPlayer(ConfigPlayer):
"""Plays a random event based on config."""
config_file_section = 'random_event_player'
show_sec... | mit | bc5accfdf467511ec6dfa70831ce72a6 | 37.288889 | 93 | 0.602147 | 4.275434 | false | true | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/windowslive/views.py | 2 | 1450 | from __future__ import unicode_literals
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import WindowsLiveProvider
class WindowsLiveOAuth2Adapter(OAuth2Adapter):
provider_id = WindowsLiveProvider.id
... | mit | 60748783ac4b5a26156011ddcffbf5a8 | 36.179487 | 81 | 0.670345 | 3.333333 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/tumblr/views.py | 2 | 1108 | import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthCallbackView,
OAuthLoginView,
)
from .provider import TumblrProvider
class TumblrAPI(OAuth):
url = "http://api.tumblr.com/v2/user/info"
def get... | mit | a015db2b2c4cecf83d034766da1d8f06 | 31.588235 | 86 | 0.729242 | 3.230321 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/drip/views.py | 2 | 1060 | """Views for Drip API."""
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import DripProvider
class DripOAuth2Adapter(OAuth2Adapter):
"""OAuth2Adapter for Drip API v3."""
provider_id = DripProvider.... | mit | 52c6190f5a4468352814ddb8f2bdae98 | 31.121212 | 81 | 0.709434 | 3.49835 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/github/views.py | 2 | 2032 | import requests
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.github.provider import GitHubProvider
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
class GitHubOAuth2Adapter(OAuth2Adapter):
provider... | mit | 98c2bb9e4bdb36145e098773423b5e5d | 35.945455 | 81 | 0.640748 | 3.66787 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/amazon_cognito/views.py | 2 | 1595 | import requests
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.amazon_cognito.provider import (
AmazonCognitoProvider,
)
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
class AmazonCognitoOAuth2Adapt... | mit | 39ed07af42c85177e114547c5f18d6a1 | 26.982456 | 88 | 0.689655 | 3.779621 | false | false | false | false |
pennersr/django-allauth | allauth/account/migrations/0001_initial.py | 2 | 3393 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
UNIQUE_EMAIL = getattr(settings, "ACCOUNT_UNIQUE_EMAIL", True)
class Migration(migrations.Migration):
dependencies = [
migrations.swapp... | mit | 6893a8e4188b810a912553b577989fc7 | 30.12844 | 85 | 0.38491 | 5.85 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/eveonline/provider.py | 2 | 1453 | from allauth.socialaccount.app_settings import STORE_TOKENS
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class EveOnlineAccount(ProviderAccount):
def get_profile_url(self):
return "https://gate.eveonline.com/Pro... | mit | 53da81becb5ead05b75e1ef67ae4f784 | 29.270833 | 82 | 0.633173 | 3.874667 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/admin.py | 2 | 1697 | from django import forms
from django.contrib import admin
from allauth import app_settings
from allauth.account.adapter import get_adapter
from .models import SocialAccount, SocialApp, SocialToken
class SocialAppForm(forms.ModelForm):
class Meta:
model = SocialApp
exclude = []
widgets = ... | mit | cce26b0f5ab5d76bd06e6919d69deade | 26.819672 | 72 | 0.628167 | 3.657328 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/cilogon/provider.py | 2 | 1692 | from allauth.account.models import EmailAddress
from allauth.socialaccount.app_settings import QUERY_EMAIL
from allauth.socialaccount.providers.base import AuthAction, ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class Scope(object):
OPENID = "openid"
EMAIL = "ema... | mit | a738af9e4e8e36c0015786071c225aea | 29.214286 | 78 | 0.650709 | 3.607676 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/authentiq/views.py | 2 | 1213 | import requests
from urllib.parse import urljoin
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import AuthentiqProvider
class AuthentiqOAuth2Adapter(OAuth2Adapter):
provid... | mit | 76aec76f65a3c1dbaca2ff066448d2d3 | 31.783784 | 82 | 0.71723 | 3.599407 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/doximity/provider.py | 2 | 1064 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class DoximityAccount(ProviderAccount):
def get_profile_url(self):
return None
def get_avatar_url(self):
return self.account.extra_data.get("profile_phot... | mit | 76eb8a9c7b4d0913e953facf6ef2a371 | 27 | 74 | 0.646617 | 3.582492 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/oauth/client.py | 2 | 7374 | """
Parts derived from socialregistration and authorized by: alen, pinda
Inspired by:
http://github.com/leah/python-oauth/blob/master/oauth/example/client.py
http://github.com/facebook/tornado/blob/master/tornado/auth.py
"""
import requests
from urllib.parse import parse_qsl, urlparse
from django.http import ... | mit | afaea91c7bb0a43e777b1690f156e558 | 33.457944 | 105 | 0.584757 | 4.247696 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/strava/provider.py | 2 | 1491 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class StravaAccount(ProviderAccount):
def get_profile_url(self):
id = self.account.extra_data.get("id")
if id:
return "https://www.strava.com/athl... | mit | e7661287757f2f58068be0efd31ceb15 | 29.428571 | 78 | 0.629108 | 3.774684 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/openstreetmap/views.py | 2 | 1632 | from xml.etree import ElementTree
from xml.parsers.expat import ExpatError
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthCallbackView,
OAuthLoginView,
)
from .provider import OpenStreetMapProvider
class OpenStr... | mit | 343fbe696fd76edea2cdce5ffc0f1541 | 34.478261 | 81 | 0.699142 | 3.709091 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/vimeo/views.py | 2 | 1144 | import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthCallbackView,
OAuthLoginView,
)
from .provider import VimeoProvider
class VimeoAPI(OAuth):
url = "http://vimeo.com/api/rest/v2?method=vimeo.people.g... | mit | 1283fc1476f289e8a06568e4424bc35a | 31.685714 | 85 | 0.723776 | 3.315942 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/__init__.py | 2 | 1601 | import importlib
from collections import OrderedDict
from django.conf import settings
class ProviderRegistry(object):
def __init__(self):
self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None):
self.load()
return [provider_cls(request) for prov... | mit | b1e94c121b1e7b7ade339899bfdf2d11 | 33.06383 | 85 | 0.607745 | 4.45961 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/untappd/client.py | 2 | 1760 | import requests
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.oauth2.client import (
OAuth2Client,
OAuth2Error,
)
from .provider import UntappdProvider
class UntappdOAuth2Client(OAuth2Client):
"""
Custom client because Untappd:
* uses redirect_url instea... | mit | 02fed5cf583716a0c84868308278d61f | 32.846154 | 81 | 0.598864 | 4.009112 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/facebook/provider.py | 2 | 7547 | import json
import string
from urllib.parse import quote
from django.conf import settings
from django.middleware.csrf import get_token
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.crypto import get_random_string
from django.utils.html import escapejs, mark_safe
... | mit | 297efe871d8e37edf542e881865b3f37 | 33.778802 | 87 | 0.595203 | 3.872242 | false | false | false | false |
mosra/m.css | plugins/ansilexer.py | 1 | 11698 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2020 Blair Conrad <blair@blairconrad.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated docume... | mit | b3ce8412b5130a6462c1790250a1b97f | 37.045603 | 79 | 0.572688 | 3.930013 | false | false | false | false |
mosra/m.css | documentation/test_doxygen/__init__.py | 1 | 3980 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz>
#
# 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 Softwar... | mit | 21c23d8f85d22bf4b3d1d2944a49266e | 43.685393 | 126 | 0.678149 | 3.692665 | false | true | false | false |
mosra/m.css | plugins/dot2svg.py | 1 | 5239 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz>
#
# 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 Softwar... | mit | fbb0d939d46ecc3f031b50f78c0dddbb | 39.276923 | 112 | 0.627196 | 3.435696 | false | false | false | false |
gboeing/osmnx | osmnx/folium.py | 1 | 5725 | """Create interactive Leaflet web maps of graphs and routes via folium."""
import json
from . import utils_graph
# folium is an optional dependency for the folium plotting functions
try:
import folium
except ImportError: # pragma: no cover
folium = None
def plot_graph_folium(
G,
graph_map=None,
... | mit | 4c3e20ba2e12a90b8aeee9b9894bfa82 | 29.452128 | 97 | 0.639825 | 3.667521 | false | false | false | false |
gboeing/osmnx | osmnx/osm_xml.py | 1 | 14895 | """Read/write .osm formatted XML files."""
import bz2
import xml.sax
from pathlib import Path
from xml.etree import ElementTree as etree
import networkx as nx
import numpy as np
import pandas as pd
from . import settings
from . import utils
from . import utils_graph
class _OSMContentHandler(xml.sax.handler.Content... | mit | 9487fcc21ed5400bcfbd5479b0826346 | 37.094629 | 99 | 0.614166 | 3.824134 | false | false | false | false |
gboeing/osmnx | osmnx/utils.py | 1 | 10525 | """General utility functions."""
import datetime as dt
import logging as lg
import os
import sys
import unicodedata
import warnings
from contextlib import redirect_stdout
from pathlib import Path
from . import settings
def citation():
"""
Print the OSMnx package's citation information.
Boeing, G. 2017.... | mit | 3d7a9faa4ec0f8160ac12edbf37e4988 | 30.606607 | 98 | 0.64361 | 3.938997 | false | false | false | false |
gboeing/osmnx | osmnx/simplification.py | 1 | 24520 | """Simplify, correct, and consolidate network topology."""
import logging as lg
import geopandas as gpd
import networkx as nx
from shapely.geometry import LineString
from shapely.geometry import MultiPolygon
from shapely.geometry import Point
from shapely.geometry import Polygon
from . import stats
from . import uti... | mit | 5dddd00fcf1dc1e382aeba0fcde61882 | 40.418919 | 98 | 0.638785 | 4.276247 | false | false | false | false |
gboeing/osmnx | osmnx/downloader.py | 1 | 28483 | """Interact with the OSM APIs."""
import datetime as dt
import json
import logging as lg
import re
import socket
import time
from collections import OrderedDict
from hashlib import sha1
from pathlib import Path
from urllib.parse import urlparse
import numpy as np
import requests
from dateutil import parser as date_pa... | mit | bbaf137412af3f356667101c1d74fdee | 34.426617 | 107 | 0.639188 | 4.074821 | false | false | false | false |
gboeing/osmnx | osmnx/bearing.py | 1 | 12169 | """Calculate graph edge bearings."""
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from . import projection
# scipy is an optional dependency for entropy calculation
try:
import scipy
except ImportError: # pragma: no cover
scipy = None
def calculate_bearing(lat1, lng1, lat2, lng... | mit | be48017b72fabb1cbffeeb58a668b1c2 | 33.53125 | 93 | 0.648787 | 3.847737 | false | false | false | false |
cantools/cantools | cantools/database/can/formats/arxml/end_to_end_properties.py | 1 | 1424 | from typing import Optional, List
class AutosarEnd2EndProperties:
"""This class collects all attributes that are required to implement
AUTOSAR-conformant End-to-End protection (CRCs) of messages
"""
def __init__(self):
self._category: Optional[str] = None
self._data_ids: Optional[List[... | mit | e42ecea760b7e8debadf7540e8e1f6eb | 28.061224 | 72 | 0.627107 | 4.175953 | false | false | false | false |
cantools/cantools | cantools/j1939.py | 2 | 4627 | from collections import namedtuple
import bitstruct
from .errors import Error
FrameId = namedtuple('FrameId',
[
'priority',
'reserved',
'data_page',
'pdu_format',
'pdu_spe... | mit | e3c37005294f4b610498e52daa686045 | 29.24183 | 84 | 0.500973 | 4.308194 | false | false | false | false |
cantools/cantools | cantools/database/can/database.py | 1 | 18147 | import logging
from typing import (
Dict,
List,
Tuple,
Optional,
TextIO,
Union,
)
from .bus import Bus
from .formats import arxml
from .formats import dbc
from .formats import kcd
from .formats import sym
from .formats.arxml import AutosarDatabaseSpecifics
from .formats.dbc import DbcSpecifics
... | mit | 0933da3e28c11c42ad382e3b5ce6b8f8 | 32.543438 | 91 | 0.551441 | 4.289057 | false | false | false | false |
cantools/cantools | cantools/database/diagnostics/database.py | 2 | 3195 | import logging
from .formats import cdd
from ...compat import fopen
LOGGER = logging.getLogger(__name__)
class Database(object):
"""This class contains all DIDs.
The factory functions :func:`load()<cantools.database.load()>`,
:func:`load_file()<cantools.database.load_file()>` and
:func:`load_strin... | mit | f3757cd3afae9e8f3f64c26f549eee1f | 24.357143 | 75 | 0.556182 | 4.044304 | false | false | false | false |
jepegit/cellpy | cellpy/utils/ica.py | 1 | 37768 | """ica contains routines for creating and working with
incremental capacity analysis data"""
import os
import logging
import warnings
import numpy as np
import pandas as pd
from scipy import stats
from scipy.interpolate import interp1d
from scipy.signal import savgol_filter
from scipy.integrate import simps
from scip... | mit | ae9a5aef9c0126b095fd4977d9be1347 | 33.969444 | 112 | 0.609924 | 3.853776 | false | false | false | false |
jepegit/cellpy | cellpy/utils/batch_tools/batch_journals.py | 1 | 25830 | import json
import logging
import os
import pathlib
import platform
import shutil
import tempfile
import warnings
import pandas as pd
from cellpy.exceptions import UnderDefined
from cellpy.parameters import prms
from cellpy.parameters.internal_settings import (
get_headers_journal,
keys_journal_session,
)
fro... | mit | f8e08c5c811cac006d98e5895684567b | 33.671141 | 113 | 0.555556 | 3.992889 | false | false | false | false |
jepegit/cellpy | cellpy/utils/batch.py | 1 | 47287 | """Routines for batch processing of cells (v2)."""
import logging
import os
import pathlib
import shutil
import sys
import warnings
import pandas as pd
from pandas import Index
from tqdm.auto import tqdm
import cellpy.exceptions
from cellpy import log, prms
from cellpy.parameters.internal_settings import (
heade... | mit | c6ef5863876438997c3dfd6b5f493bac | 37.289069 | 123 | 0.583184 | 4.189139 | false | false | false | false |
jepegit/cellpy | tests/test_cellpy.py | 1 | 6844 | import logging
import os
import tempfile
import time
import pytest
import cellpy.readers.core
import cellpy.utils.helpers
from cellpy import log, prms
from . import fdv
log.setup_logging(default_level="DEBUG", testing=True)
def test_conftest(hello_world):
assert hello_world == "hello cellpy!"
@pytest.fixtur... | mit | 523eeb59d17773f32e58023a6a9ba136 | 28.886463 | 88 | 0.650643 | 3.446123 | false | true | false | false |
miguelgrinberg/python-socketio | src/socketio/asyncio_pubsub_manager.py | 1 | 8461 | import asyncio
from functools import partial
import uuid
from engineio import json
import pickle
from .asyncio_manager import AsyncManager
class AsyncPubSubManager(AsyncManager):
"""Manage a client list attached to a pub/sub backend under asyncio.
This is a base class that enables multiple servers to share... | mit | 3560ca122d44cb8e31691773c80904dd | 42.613402 | 79 | 0.531025 | 5.118572 | false | false | false | false |
miguelgrinberg/python-socketio | tests/common/test_pubsub_manager.py | 1 | 14367 | import functools
import logging
import unittest
from unittest import mock
import pytest
from socketio import base_manager
from socketio import pubsub_manager
class TestPubSubManager(unittest.TestCase):
def setUp(self):
id = 0
def generate_id():
nonlocal id
id += 1
... | mit | f20660d03fcde991feb5e51e641d616e | 32.964539 | 79 | 0.475186 | 4.00865 | false | true | false | false |
miguelgrinberg/python-socketio | src/socketio/asyncio_server.py | 1 | 31327 | import asyncio
import engineio
from . import asyncio_manager
from . import exceptions
from . import packet
from . import server
class AsyncServer(server.Server):
"""A Socket.IO server for asyncio.
This class implements a fully compliant Socket.IO web server with support
for websocket and long-polling t... | mit | 5df97a123476f02577d290b2a79c98a2 | 49.609047 | 79 | 0.569285 | 4.963873 | false | false | false | false |
miguelgrinberg/python-socketio | src/socketio/client.py | 1 | 32551 | import itertools
import logging
import random
import signal
import threading
import engineio
from . import exceptions
from . import namespace
from . import packet
default_logger = logging.getLogger('socketio.client')
reconnecting_clients = []
def signal_handler(sig, frame): # pragma: no cover
"""SIGINT handle... | mit | 2e5f7a93162b073eed46306b5d036ac6 | 43.468579 | 79 | 0.578262 | 4.962799 | false | false | false | false |
qiniu/python-sdk | qiniu/services/pili/rtc_server_manager.py | 2 | 2044 | # -*- coding: utf-8 -*-
from qiniu import http, Auth
import json
class RtcServer(object):
"""
直播连麦管理类
主要涉及了直播连麦管理及操作接口的实现,具体的接口规格可以参考官方文档 https://developer.qiniu.com
Attributes:
auth: 账号管理密钥对,Auth对象
"""
def __init__(self, auth):
self.auth = auth
self.host = 'http://rt... | mit | 98444528e9a7c8d99d12fc12b98185f5 | 31.333333 | 104 | 0.599485 | 2.690707 | false | false | false | false |
qiniu/python-sdk | qiniu/services/compute/app.py | 3 | 6799 | # -*- coding: utf-8 -*-
from qiniu import http, QiniuMacAuth
from .config import KIRK_HOST
from .qcos_api import QcosClient
class AccountClient(object):
"""客户端入口
使用账号密钥生成账号客户端,可以进一步:
1、获取和操作账号数据
2、获得部署的应用的客户端
属性:
auth: 账号管理密钥对,QiniuMacAuth对象
host: API host,在『内网模式』下使用时,auth=None,会... | mit | d924ac767181d69abf9e472f70531c8b | 23.486607 | 69 | 0.533637 | 2.479656 | false | false | false | false |
mir-group/flare | tests/test_gp_from_aimd.py | 1 | 15018 | import numpy as np
import pickle
import pytest
import json as json
from copy import deepcopy
from json import loads
from glob import glob
from os import remove, path
from flare.env import AtomicEnvironment
from flare.struc import Structure
from flare.gp import GaussianProcess
from flare.mgp import MappedGaussianProce... | mit | 50d49922d6f2614cee61a77f7355327b | 28.562992 | 88 | 0.577374 | 3.113184 | false | true | false | false |
mir-group/flare | flare/lammps/lammps_calculator.py | 1 | 6652 | """LAMMPS calculator for preparing and parsing single-point LAMMPS \
calculations."""
import subprocess
import numpy as np
# TODO: split LAMMPS input and data files into separate classes
def run_lammps(lammps_executable, input_file, output_file):
"""Runs a single point LAMMPS calculation.
:param lammps_exec... | mit | 5b5dee007d256f1107a7570372c8858e | 25.188976 | 82 | 0.599218 | 3.390418 | false | false | false | false |
mir-group/flare | flare/mgp/map2b.py | 1 | 6405 | import numpy as np
from numba import njit
from typing import List
from flare.struc import Structure
from flare.utils.element_coder import Z_to_element
from flare.mgp.mapxb import MapXbody, SingleMapXbody
from flare.mgp.grid_kernels import grid_kernel, self_kernel
from flare.kernels.utils import from_mask_to_args
... | mit | 36d5bf70f6e92320f5c9428e4fca7af1 | 26.255319 | 87 | 0.522404 | 3.348144 | false | false | false | false |
mir-group/flare | flare/utils/learner.py | 1 | 14698 | """
Utility functions for various tasks.
"""
from warnings import warn
from json import JSONEncoder
from typing import List
from math import inf
import numpy as np
def is_std_in_bound(
std_tolerance: float,
noise: float,
structure: "flare.struc.Structure",
max_atoms_added: int = inf,
update_style... | mit | 3a22ee30e1c2f384f06b3c4ef47aebdd | 35.20197 | 85 | 0.648524 | 3.69668 | false | false | false | false |
mir-group/flare | flare/utils/element_coder.py | 1 | 7184 | """
Utility functions for various tasks.
"""
from warnings import warn
from json import JSONEncoder
from typing import List
from math import inf
import numpy as np
_user_element_to_Z = {}
_user_Z_to_element = {}
def inject_user_definition(element: str, Z: int):
"""Allow user-defined element. The definition
... | mit | 6e33210f5ad8c37e1cdb66ce7a18d0e1 | 18.208556 | 88 | 0.48789 | 2.827233 | false | false | false | false |
singingwolfboy/flask-dance | flask_dance/contrib/reddit.py | 1 | 4477 | from flask import g
from werkzeug.local import LocalProxy
from flask_dance import __version__ as _flask_dance_version
from flask_dance.consumer import OAuth2ConsumerBlueprint, OAuth2Session
__maintainer__ = "Sergey Storchay <r8@r8.com.ua>"
DEFAULT_USER_AGENT = f"Flask-Dance/{_flask_dance_version}"
class RedditOAu... | mit | 961feea7962b351ba117ea5ff7263cc1 | 38.619469 | 92 | 0.665848 | 3.934095 | false | false | false | false |
singingwolfboy/flask-dance | flask_dance/consumer/storage/session.py | 1 | 1086 | import flask
from flask_dance.consumer.storage import BaseStorage
class SessionStorage(BaseStorage):
"""
The default storage backend. Stores and retrieves OAuth tokens using
the :ref:`Flask session <flask:sessions>`.
"""
def __init__(self, key="{bp.name}_oauth_token"):
"""
Args:
... | mit | 5c3ce0268a05dd84b708e9eb1b63133e | 31.909091 | 83 | 0.611418 | 4.209302 | false | false | false | false |
singingwolfboy/flask-dance | flask_dance/contrib/authentiq.py | 1 | 3454 | from flask import g
from werkzeug.local import LocalProxy
from flask_dance.consumer import OAuth2ConsumerBlueprint
__maintainer__ = "Pieter Ennes <support@authentiq.com>"
def make_authentiq_blueprint(
client_id=None,
client_secret=None,
*,
scope="openid profile",
redirect_url=None,
redirect_... | mit | d276afe9e0350bdb0117528017cece11 | 40.119048 | 92 | 0.668211 | 3.876543 | false | false | false | false |
fedora-python/portingdb | portingdb/htmlreport.py | 1 | 22142 | from collections import OrderedDict, Counter, defaultdict, deque
import random
import math
import uuid
import datetime
from flask import Flask, render_template, current_app, Markup, abort, url_for
from flask import make_response, request
from flask.json import jsonify
from jinja2 import StrictUndefined
import markdown... | mit | 27c4a490d7c91fa8913084c9157a4f9c | 28.483356 | 90 | 0.583235 | 3.725101 | false | false | false | false |
fedora-python/portingdb | portingdb/history_graph.py | 1 | 2750 | from collections import defaultdict
from plotly.offline import plot
from plotly.offline.offline import get_plotlyjs
from plotly.graph_objs import Scatter, Figure, Layout
STATUS_ORDER = (
'dropped',
'py3-only',
'legacy-leaf',
'released',
'in-progress',
None, # status not found
'mispackaged... | mit | b6e72b24204b1e691b5dba6b364524d9 | 29.898876 | 82 | 0.562909 | 3.873239 | false | false | false | false |
fedora-python/portingdb | dnf-plugins/py3query.py | 1 | 20001 | """
DNF plugin for getting the Python 3 porting status.
Put this in your DNF plugin directory, then run:
$ dnf --enablerepo=rawhide --enablerepo=rawhide-source py3query -o fedora.json
This will give you a file "fedora.json" with information for portingdb.
"""
from __future__ import print_function
import sys
im... | mit | ce3981f973607f065ce16b0a7eb8287e | 38.684524 | 110 | 0.533323 | 3.785917 | false | false | false | false |
meejah/txtorcon | examples/web_onion_service_ephemeral_auth.py | 1 | 2052 | #!/usr/bin/env python
# This shows how to leverage the endpoints API to get a new hidden
# service up and running quickly. You can pass along this API to your
# users by accepting endpoint strings as per Twisted recommendations.
#
# http://twistedmatrix.com/documents/current/core/howto/endpoints.html#maximizing-the-re... | mit | f64cf1802d44095941fbfc75a435daf7 | 29.626866 | 120 | 0.669591 | 3.717391 | false | false | false | false |
meejah/txtorcon | txtorcon/spaghetti.py | 1 | 4406 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import with_statement
import warnings
class FSM(object):
"""
Pass callables for matcher and handler to add_handler to create
transitions between states. A "matcher" is a predicate, and if... | mit | 5bcf4ef4f4f9ed7d1788832ac58f74d4 | 27.61039 | 73 | 0.539038 | 4.168401 | false | false | false | false |
getnikola/nikola | nikola/plugins/command/new_post.py | 1 | 21526 | # -*- coding: utf-8 -*-
# Copyright © 2012-2022 Roberto Alsina and others.
# 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 t... | mit | 8375e82e96b9d7a28c2057bac04a62a7 | 36.561955 | 174 | 0.551503 | 4.197972 | false | false | false | false |
getnikola/nikola | nikola/plugins/compile/rest/thumbnail.py | 1 | 2854 | # -*- coding: utf-8 -*-
# Copyright © 2014-2022 Pelle Nilsson and others.
# 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... | mit | b23e1c8e22da3890b4a4f30e572ae65f | 34.222222 | 123 | 0.682089 | 4.189427 | false | false | false | false |
machow/siuba | siuba/sql/verbs/summarize.py | 1 | 4242 | from sqlalchemy import sql
from siuba.dply.verbs import summarize
from .mutate import _sql_upsert_columns, _eval_expr_arg, _eval_expr_kwarg
from ..utils import lift_inner_cols, _sql_with_only_columns
from ..backend import LazyTbl, get_single_from
@summarize.register(LazyTbl)
def _summarize(__data, *args, **kwargs)... | mit | bb535fcc511752e23835240540fb6108 | 31.136364 | 105 | 0.627063 | 3.537948 | false | false | false | false |
machow/siuba | siuba/sql/verbs/explain.py | 1 | 1031 | """
Implements LazyTbl to represent tables of SQL data, and registers it on verbs.
This module is responsible for the handling of the "table" side of things, while
translate.py handles translating column operations.
"""
from ..backend import LazyTbl
from ..utils import _sql_simplify_select
from siuba.dply.verbs im... | mit | 7c475f1e966640eb011d3ddfea63cb29 | 26.131579 | 80 | 0.669253 | 3.920152 | false | false | false | false |
machow/siuba | siuba/sql/verbs/conditional.py | 1 | 1536 | import warnings
from sqlalchemy import sql
from siuba.dply.verbs import case_when, if_else
from siuba.siu import Call
from ..backend import LazyTbl
@case_when.register(sql.base.ImmutableColumnCollection)
def _case_when(__data, cases):
# TODO: will need listener to enter case statements, to handle when they use... | mit | faaf299354d51eb053bc3f9668cb69cf | 27.444444 | 88 | 0.591146 | 3.728155 | false | false | false | false |
machow/siuba | siuba/experimental/pivot/pivot_long.py | 1 | 12881 | import pandas as pd
import numpy as np
import re
from typing import Union, Tuple, Dict, Optional, Callable
from pandas.core.groupby import DataFrameGroupBy
from siuba.dply.verbs import gather, var_create, var_select, separate, extract
from siuba.siu import singledispatch2
from .utils import vec_as_names, reconstruct... | mit | e7e42a77c78873bb13dd2dcb8204183e | 34.880223 | 97 | 0.578992 | 3.730379 | false | false | false | false |
machow/siuba | siuba/sql/verbs/select.py | 1 | 2057 | from siuba.dply.verbs import select, rename, _select_group_renames
from siuba.dply.tidyselect import VarList, var_select
from siuba.dply.verbs import simple_varname
from pandas import Series
from ..backend import LazyTbl, _warn_missing
from ..utils import lift_inner_cols
@select.register(LazyTbl)
def _select(__dat... | mit | 1cd54f09ce7c8ffe97c79ca77d1c09ce | 29.701493 | 100 | 0.633933 | 3.317742 | false | false | false | false |
julython/julython.org | july/people/forms.py | 2 | 7316 | from django import forms
from django.utils.translation import ugettext_lazy
from models import Location, Team
from july.utils import check_location
class EditAddressForm(forms.Form):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop('user', None)
super(EditAddressForm, self).__init__(*... | mit | 07855d5f1d443b641a11722808f02ea6 | 32.559633 | 77 | 0.577638 | 4.175799 | false | false | false | false |
julython/julython.org | july/management/commands/load_users.py | 2 | 3813 | import json
import logging
import requests
from time import sleep
from django.core.management.base import BaseCommand, CommandError
from django.template.defaultfilters import slugify
from july.models import User
from july.people.models import Location, Team
from optparse import make_option
def get_twitter_id(name):... | mit | 271111af7f101304e1fdd4f5ce0bee33 | 30.512397 | 77 | 0.535799 | 4.030655 | false | false | false | false |
postlund/pyatv | pyatv/support/knock.py | 1 | 2536 | """Module used to knock on TCP ports.
This module will open a TCP-connection to one or more ports on a given host and
immediately close it. The use case for this is to wake a device sleeping via a Bonjour
sleep proxy. Such a device will automatically be woken up in case any of its services
are accessed, something this... | mit | c37dc459967dde1f40314b95afc0670a | 32.813333 | 88 | 0.671924 | 3.740413 | false | false | false | false |
postlund/pyatv | pyatv/protocols/mrp/messages.py | 1 | 6798 | """Helper code for dealing with protobuf messages."""
import binascii
from uuid import uuid4
from pyatv import const
from pyatv.auth import hap_tlv8
from pyatv.protocols.mrp import protobuf
def create(message_type, error_code=0, identifier=None):
"""Create a ProtocolMessage."""
message = protobuf.ProtocolMe... | mit | 9e9df868551fdd74d94ea80f60b1a52f | 31.371429 | 87 | 0.708444 | 3.956927 | false | false | false | false |
postlund/pyatv | pyatv/scripts/atvremote.py | 1 | 23169 | """CLI application for discovering and controlling Apple TVs."""
import argparse
import asyncio
import binascii
import inspect
from ipaddress import IPv4Address
import logging
import sys
import traceback
from pyatv import connect, const, exceptions, interface, pair, scan
from pyatv.conf import AppleTV, ManualService
... | mit | 7d153901cb36cf7737ac8cec8983d627 | 30.057641 | 88 | 0.595494 | 4.049816 | false | false | false | false |
postlund/pyatv | pyatv/protocols/airplay/srp.py | 1 | 7323 | """Implementation of SRP used by AirPlay device authtentication."""
import binascii
import hashlib
import logging
from os import urandom
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed255... | mit | aaedcf0542291c7d18ce580999b913cc | 36.553846 | 86 | 0.643998 | 3.806133 | false | false | false | false |
postlund/pyatv | pyatv/protocols/dmap/parser.py | 1 | 2586 | """Parser and data extractor for raw DMAP data.
DMAP is basically TLV (see Wikipedia) where the key is a 4 byte ASCII value,
a four byte big endian unsigned int as length and the data as data. So:
+---------------+------------------+--------------------+
| Key (4 bytes) | Length (4 bytes) | Data (Length bytes |
... | mit | f2920812d800c1ff733534e5cb837446 | 29.785714 | 80 | 0.561098 | 3.576763 | false | false | false | false |
postlund/pyatv | pyatv/scripts/__init__.py | 1 | 3053 | """Scripts bundled with pyatv."""
import argparse
from ipaddress import ip_address
import json
import logging
from pyatv import const
_LOGGER = logging.getLogger(__name__)
# pylint: disable=too-few-public-methods
class TransformProtocol(argparse.Action):
"""Transform protocol in string format to internal repre... | mit | cc65c23083f0623c8eedf0dd0ba1448a | 33.303371 | 86 | 0.64625 | 4.361429 | false | false | false | false |
postlund/pyatv | pyatv/protocols/mrp/protobuf/VirtualTouchDeviceDescriptorMessage_pb2.py | 1 | 1641 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pyatv/protocols/mrp/protobuf/VirtualTouchDeviceDescriptorMessage.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
... | mit | 24288af391426e2029243ee77c3e3853 | 47.264706 | 362 | 0.804388 | 3.295181 | false | false | true | false |
postlund/pyatv | pyatv/scripts/atvlog.py | 1 | 8737 | #!/usr/bin/env python3
"""Script converting pyatv logs to HTML."""
import argparse
import asyncio
from datetime import datetime
import json
import logging
import os
import re
import sys
from aiohttp import web, web_request
_LOGGER = logging.getLogger(__name__)
# Used by atvremote, atvscript, etc.
LOG_LINE_RE = (
... | mit | 954711f47a09e15acc5baf5407476865 | 26.049536 | 87 | 0.577429 | 3.797045 | false | false | false | false |
postlund/pyatv | pyatv/support/rtsp.py | 1 | 10211 | """Implementation of the RTSP protocol.
This is a simple implementation of the RTSP protocol used by Apple (with its quirks
and all). It is somewhat generalized to support both AirPlay 1 and 2.
"""
import asyncio
from hashlib import md5
import logging
import plistlib
from random import randrange
from typing import Any... | mit | e68d73b6a629fa95cfce9f32aae36b62 | 32.811258 | 87 | 0.593282 | 3.770679 | false | false | false | false |
postlund/pyatv | tests/auth/test_hap_tlv8.py | 1 | 3265 | """Unit tests for pyatv.support.hap_tlv8."""
from collections import OrderedDict
from pyatv.auth.hap_tlv8 import (
ErrorCode,
Method,
State,
TlvValue,
read_tlv,
stringify,
write_tlv,
)
SINGLE_KEY_IN = {10: b"123"}
SINGLE_KEY_OUT = b"\x0a\x03\x31\x32\x33"
# Use OrderedDict as a regular di... | mit | 1507f22cc5026fbce9410fd46a2d1d27 | 26.436975 | 80 | 0.612864 | 2.968182 | false | true | false | false |
postlund/pyatv | pyatv/protocols/companion/connection.py | 1 | 5110 | """Connection abstraction for Companion protocol."""
from abc import ABC
import asyncio
from collections import deque
from enum import Enum
import logging
from typing import Optional
from pyatv import exceptions
from pyatv.support import chacha20, log_binary
from pyatv.support.state_producer import StateProducer
_LOG... | mit | 0e12b893d06f1b3e0aabe5ec023061bf | 30.73913 | 88 | 0.604501 | 4.134304 | false | false | false | false |
postlund/pyatv | pyatv/protocols/mrp/protobuf/RemoveEndpointsMessage_pb2.py | 1 | 1934 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pyatv/protocols/mrp/protobuf/RemoveEndpointsMessage.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.p... | mit | 6fa24db5c16813f8f025ff3b5c44aed2 | 49.894737 | 356 | 0.811272 | 3.46595 | false | false | true | false |
postlund/pyatv | pyatv/protocols/airplay/player.py | 1 | 3163 | """Play media on a device by sending an URL."""
import asyncio
import logging
import plistlib
from uuid import uuid4
from pyatv import exceptions
from pyatv.support.http import HttpConnection
_LOGGER = logging.getLogger(__name__)
PLAY_RETRIES = 3
WAIT_RETRIES = 5
HEADERS = {
"User-Agent": "MediaControl/1.0",
... | mit | 1537dba6a14720de00f120869d1399a0 | 30.316832 | 83 | 0.538729 | 4.374827 | false | false | false | false |
tiangolo/fastapi | tests/test_additional_responses_default_validationerror.py | 1 | 2598 | from fastapi import FastAPI
from fastapi.testclient import TestClient
app = FastAPI()
@app.get("/a/{id}")
async def a(id):
pass # pragma: no cover
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/a/{id}": {
"get": {
... | mit | 43b024ce535ec56cb876e5f419df758f | 29.564706 | 86 | 0.335258 | 5.015444 | false | false | false | false |
tiangolo/fastapi | tests/test_tutorial/test_additional_responses/test_tutorial003.py | 1 | 4140 | from fastapi.testclient import TestClient
from docs_src.additional_responses.tutorial003 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items/{item_id}": {
"get": {
"responses": ... | mit | b091d1ab2332f3cda5c98deb3ed874d1 | 34.384615 | 86 | 0.354831 | 5.024272 | false | true | false | false |
tiangolo/fastapi | tests/test_security_oauth2_optional_description.py | 1 | 8017 | from typing import Optional
import pytest
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
from pydantic import BaseModel
app = FastAPI()
reusable_oauth2 = OAuth2(
flows={
"password": {
... | mit | 8f8bfe3268f5096e18f92428b5661a26 | 30.439216 | 87 | 0.433579 | 4.496354 | false | false | false | false |
tiangolo/fastapi | tests/test_tutorial/test_extending_openapi/test_tutorial002.py | 1 | 1252 | import os
from pathlib import Path
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(scope="module")
def client():
static_dir: Path = Path(os.getcwd()) / "static"
print(static_dir)
static_dir.mkdir(exist_ok=True)
from docs_src.extending_openapi.tutorial002 import app
with T... | mit | 8813571971612000f98ff0bc64fa7dfc | 28.809524 | 67 | 0.714856 | 3.577143 | false | true | false | false |
tiangolo/fastapi | docs_src/app_testing/app_b/main.py | 1 | 1145 | from typing import Union
from fastapi import FastAPI, Header, HTTPException
from pydantic import BaseModel
fake_secret_token = "coneofsilence"
fake_db = {
"foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"},
"bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
}
app =... | mit | ee1844584481bdca9637cd5602b0c2a8 | 29.131579 | 78 | 0.662882 | 3.338192 | false | false | false | false |
tiangolo/fastapi | tests/test_tutorial/test_additional_responses/test_tutorial002.py | 1 | 3923 | import os
import shutil
from fastapi.testclient import TestClient
from docs_src.additional_responses.tutorial002 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items/{item_id}": {
"get": {
... | mit | bf92660573ee6574e1968ac6c3044d0f | 33.113043 | 86 | 0.367321 | 4.867246 | false | true | false | false |
tiangolo/fastapi | tests/test_dependency_duplicates.py | 1 | 7572 | from typing import List
from fastapi import Depends, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel
app = FastAPI()
client = TestClient(app)
class Item(BaseModel):
data: str
def duplicate_dependency(item: Item):
return item
def dependency(item2: Item):
return item2... | mit | 399912f5ec25590a82d65001bfc514b0 | 31.637931 | 100 | 0.396725 | 4.847631 | false | false | false | false |
tiangolo/fastapi | fastapi/routing.py | 1 | 53693 | import asyncio
import dataclasses
import email.message
import inspect
import json
from contextlib import AsyncExitStack
from enum import Enum, IntEnum
from typing import (
Any,
Callable,
Coroutine,
Dict,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
Union,
)
from fastapi impor... | mit | 661ad27d09809b8ea25f2c3f09987e79 | 42.265915 | 90 | 0.603654 | 4.330779 | false | false | false | false |
tiangolo/fastapi | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py | 1 | 4129 | from fastapi.testclient import TestClient
from docs_src.path_operation_advanced_configuration.tutorial004 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items/": {
"post": {
"res... | mit | fe778c162573c7690d9c02ef648a21a4 | 35.866071 | 293 | 0.367886 | 4.9807 | false | false | false | false |
tiangolo/fastapi | tests/test_tutorial/test_extra_models/test_tutorial003.py | 1 | 4407 | from fastapi.testclient import TestClient
from docs_src.extra_models.tutorial003 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items/{item_id}": {
"get": {
"responses": {
... | mit | 1f04acc35c04ac0c6115aac7e288eda2 | 34.256 | 86 | 0.356932 | 5.00227 | false | false | false | false |
tiangolo/fastapi | docs_src/extending_openapi/tutorial002.py | 1 | 1175 | from fastapi import FastAPI
from fastapi.openapi.docs import (
get_redoc_html,
get_swagger_ui_html,
get_swagger_ui_oauth2_redirect_html,
)
from fastapi.staticfiles import StaticFiles
app = FastAPI(docs_url=None, redoc_url=None)
app.mount("/static", StaticFiles(directory="static"), name="static")
@app.ge... | mit | 14dcbcdc0cb7380567db9ec935a354a1 | 27.658537 | 69 | 0.678298 | 3.044041 | false | false | false | false |
revolunet/sublimetext-markdown-preview | desktop/dialog.py | 3 | 17300 | #!/usr/bin/env python
"""
Simple desktop dialogue box support for Python.
Copyright (C) 2007, 2009 Paul Boddie <paul@boddie.org.uk>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either ver... | mit | 99f8f4d067fbdda73ea4c79eb9c73b83 | 30.397459 | 133 | 0.591387 | 4.067717 | false | false | false | false |
revolunet/sublimetext-markdown-preview | desktop/windows.py | 7 | 8000 | #!/usr/bin/env python
"""
Simple desktop window enumeration for Python.
Copyright (C) 2007, 2008, 2009 Paul Boddie <paul@boddie.org.uk>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either... | mit | 9f7227307e332f51eabbe3afeb4fb195 | 28.304029 | 94 | 0.62975 | 3.992016 | false | false | false | false |
gaasedelen/lighthouse | plugins/lighthouse/ui/coverage_settings.py | 1 | 4506 | import logging
from lighthouse.util.qt import *
from lighthouse.util.disassembler import disassembler
logger = logging.getLogger("Lighthouse.UI.Settings")
class TableSettingsMenu(QtWidgets.QMenu):
"""
A quick-access settings menu for Lighthouse.
"""
def __init__(self, parent=None):
super(Tab... | mit | a639fee3d5ec5ebad89f50b12ba9abf8 | 41.509434 | 104 | 0.60253 | 4.461386 | false | false | false | false |
gaasedelen/lighthouse | plugins/lighthouse/integration/core.py | 1 | 13592 | import os
import abc
import logging
import lighthouse
from lighthouse.util import lmsg
from lighthouse.util.qt import *
from lighthouse.util.update import check_for_update
from lighthouse.util.disassembler import disassembler, DisassemblerContextAPI
from lighthouse.ui import *
from lighthouse.metadata import Databas... | mit | e62e45a823d1f4cb9e5d17a5da035877 | 31.990291 | 110 | 0.570115 | 4.638908 | false | false | false | false |
gaasedelen/lighthouse | plugins/lighthouse/ui/coverage_combobox.py | 1 | 30888 | import logging
import weakref
from lighthouse.util import *
from lighthouse.util.qt import *
from lighthouse.util.disassembler import disassembler
logger = logging.getLogger("Lighthouse.UI.ComboBox")
#------------------------------------------------------------------------------
# Constants Definitions
#------------... | mit | 311d270e8739f1f1629d6b9cefcec031 | 35.467532 | 103 | 0.555847 | 4.678582 | false | false | false | false |
gaasedelen/lighthouse | plugins/lighthouse/director.py | 1 | 55590 | import os
import time
import string
import logging
import threading
import traceback
import collections
from lighthouse.util.misc import *
from lighthouse.util.debug import *
from lighthouse.util.python import *
from lighthouse.util.qt import await_future, await_lock, flush_qt_events
from lighthouse.util.disassembler ... | mit | fe933ae1f73565e7980d8d591662e765 | 34.795235 | 139 | 0.579457 | 4.87974 | false | false | false | false |
mosdef-hub/foyer | foyer/atomtyper.py | 1 | 8161 | """Determine proper atom types for chemical systems."""
from warnings import warn
import ele
from ele.exceptions import ElementError
from gmso import Topology
from parmed import Structure
from foyer.exceptions import FoyerError
from foyer.smarts import SMARTS
from foyer.smarts_graph import SMARTSGraph
from foyer.topo... | mit | 502e6fe038944b1aac810c635e98e3c3 | 34.637555 | 88 | 0.611445 | 4.315706 | false | false | false | false |
rlworkgroup/metaworld | metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_handle_pull_side.py | 1 | 3891 | import numpy as np
from gym.spaces import Box
from metaworld.envs.asset_path_utils import full_v1_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerHandlePullSideEnv(SawyerXYZEnv):
def __init__(self):
hand_low = (-0.5, 0.40, 0.05)
... | mit | c1bfdcf23f5b44198a465c0a9be7b1e8 | 30.379032 | 117 | 0.562837 | 3.115292 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.