repo_name stringlengths 7 65 | path stringlengths 5 186 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 941 973k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 5 100 | line_max int64 26 999 | alpha_frac float64 0.25 0.93 | ratio float64 1.5 7.35 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
geopython/pycsw | pycsw/plugins/profiles/__init__.py | 72 | 1311 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the ... | mit | 4f7ff24e5b71d6bf3063ea81b68e410a | 44.206897 | 67 | 0.684973 | 4.567944 | false | false | false | false |
geopython/pycsw | pycsw/ogc/fes/fes1.py | 3 | 18802 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
# Copyright (c) 2015 Angelos Tzotsos
#
# Permission is hereby granted, free of charge, to any p... | mit | ffe14f5740ed7e96bf07dd895fec4593 | 42.422633 | 163 | 0.541485 | 4.111524 | false | false | false | false |
geopython/pycsw | pycsw/core/repository.py | 3 | 23957 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
# Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2019 Tom Kralidis
# Copyright (c) 2015 Angelos ... | mit | ff1fb89cc3610b1cebedfc098b6b47d0 | 37.702746 | 185 | 0.57766 | 4.324368 | false | false | false | false |
geopython/pycsw | pycsw/server.py | 3 | 38643 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2016 Tom Kralidis
# Copyright (c) 2015 Angelos Tzotsos
# Copyright (c) 2016 James Dickens
# Copyright (c) 2016 Ri... | mit | 690492ee6dd42056f89907ea143ee094 | 40.022293 | 108 | 0.533991 | 4.341422 | false | true | false | false |
geopython/pycsw | pycsw/plugins/profiles/ebrim/ebrim.py | 5 | 8080 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the ... | mit | 5344804f9585c2c644aa80159e3f63b7 | 45.436782 | 257 | 0.605941 | 4.050125 | false | false | false | false |
python-escpos/python-escpos | src/escpos/image.py | 2 | 3942 | """ Image format handling class
This module contains the image format handler :py:class:`EscposImage`.
:author: `Michael Billington <michael.billington@gmail.com>`_
:organization: `python-escpos <https://github.com/python-escpos>`_
:copyright: Copyright (c) 2016 Michael Billington <michael.billington@gmail.com>
:lice... | mit | ba69f7a0d5d0d0293e4cef9e844bfc84 | 29.55814 | 84 | 0.586504 | 3.9778 | false | false | false | false |
dmort27/epitran | epitran/puncnorm.py | 1 | 1211 | # -*- coding: utf-8 -*-
import pkg_resources
import unicodecsv as csv
class PuncNorm(object):
def __init__(self):
"""Constructs a punctuation normalization object"""
self.puncnorm = self._load_punc_norm_map()
def _load_punc_norm_map(self):
"""Load the map table for normalizing 'down'... | mit | a132efee9e5fbdedb354d4292fb278f8 | 28.536585 | 92 | 0.563171 | 3.893891 | false | false | false | false |
crdoconnor/strictyaml | strictyaml/parser.py | 1 | 11474 | """
Parsing code for strictyaml.
"""
import sys
from strictyaml import ruamel as ruamelyaml
from strictyaml import exceptions
from strictyaml.ruamel.comments import CommentedSeq, CommentedMap
from strictyaml.any_validator import Any
from strictyaml.yamllocation import YAMLChunk
from strictyaml import utils
from stri... | mit | 05fb567d0d4f848dacb881e12e8e5418 | 34.52322 | 92 | 0.591686 | 4.394485 | false | false | false | false |
crdoconnor/strictyaml | strictyaml/ruamel/nodes.py | 1 | 3833 | # coding: utf-8
from __future__ import print_function
import sys
from .compat import string_types
if False: # MYPY
from typing import Dict, Any, Text # NOQA
class Node(object):
__slots__ = "tag", "value", "start_mark", "end_mark", "comment", "anchor"
def __init__(self, tag, value, start_mark, end_ma... | mit | 1b876c86d0dcb65b4c15269e965259a3 | 25.992958 | 88 | 0.47065 | 3.706963 | false | false | false | false |
crdoconnor/strictyaml | strictyaml/ruamel/parser.py | 1 | 33903 | # coding: utf-8
from __future__ import absolute_import
# The following YAML grammar is LL(1) and is parsed by a recursive descent
# parser.
#
# stream ::= STREAM-START implicit_document? explicit_document*
# STREAM-END
# implicit_document ::... | mit | a11d313e8abcc52acc09a4e7738743d3 | 39.169431 | 93 | 0.542076 | 4.215218 | false | false | false | false |
crdoconnor/strictyaml | strictyaml/ruamel/reader.py | 1 | 11206 | # coding: utf-8
from __future__ import absolute_import
# This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parse... | mit | c7cd0913bcad97138ef3eb4e99ac769a | 33.48 | 90 | 0.524987 | 3.96813 | false | false | false | false |
mnot/redbot | redbot/message/headers/content_range.py | 1 | 1518 | from redbot.message import headers, HttpMessage
from redbot.speak import Note, categories, levels
from redbot.syntax import rfc7233
from redbot.type import AddNoteMethodType
class content_range(headers.HttpHeader):
canonical_name = "Content-Range"
description = """\
The `Content-Range` header is sent with par... | mit | 2a3d0eddb955dab5460e97831371fa7d | 34.302326 | 98 | 0.709486 | 3.785536 | false | false | false | false |
mnot/redbot | redbot/formatter/html_base.py | 1 | 9882 | import codecs
from functools import partial
import json
import os
import time
from typing import Any, List, Tuple
from urllib.parse import urljoin, urlencode, quote as urlquote
from jinja2 import Environment, PackageLoader, select_autoescape
from markupsafe import Markup, escape
from redbot import __version__
from re... | mit | b0e68b5529e27e34a02b14ea61420d25 | 33.795775 | 97 | 0.523376 | 3.912114 | false | false | false | false |
mnot/redbot | redbot/cache_file.py | 1 | 1773 | import gzip
import os
from os import path
import time
import zlib
class CacheFile:
"""
A gzipped cache file whose unix modification time indicates how long it
is fresh for. No locking, so errors are discarded.
"""
def __init__(self, my_path: str) -> None:
self.path = my_path
def read... | mit | b467771905dba1846f1e852e6e989073 | 25.462687 | 75 | 0.513254 | 4.4325 | false | false | false | false |
mnot/redbot | redbot/message/status.py | 1 | 15925 | # pylint: disable=too-many-public-methods
"""
The Resource Expert Droid Status Code Checker.
"""
from functools import partial
from typing import List
from thor.http import safe_methods
from redbot.message import HttpRequest, HttpResponse
from redbot.speak import Note, levels, categories
from redbot.type import Str... | mit | a7dfbde60777e8cf02efa90af8d1d1f6 | 30.977912 | 100 | 0.672402 | 3.972312 | false | false | false | false |
mnot/redbot | redbot/syntax/rfc5234.py | 1 | 2045 | """
Regex for ABNF
These regex are directly derived from the core ABNF in RFC5234:
https://tools.ietf.org/html/rfc5234#appendix-B.1
They should be processed with re.VERBOSE.
"""
# ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
ALPHA = r"[\x41-\x5A\x61-\x7A]"
# BIT = "0" / "1"
BIT = r"[01]"
# C... | mit | 89fa939a77059bcad7a941c04510743f | 20.989247 | 63 | 0.403423 | 2.921429 | false | false | false | false |
bambinos/bambi | bambi/families/univariate.py | 1 | 6486 | # pylint: disable=unused-argument
import numpy as np
import xarray as xr
from scipy import stats
from .family import Family
class UnivariateFamily(Family):
def predict(self, model, posterior, linear_predictor):
"""Predict mean response"""
response_var = model.response.name + "_mean"
respo... | mit | afbb65229815198a6ed5014c960539b9 | 34.25 | 93 | 0.659883 | 3.589375 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/add_pins.py | 1 | 16888 | """Add_pin adss a Pin to a port, add_pins adds Pins to all ports.
- pins
- outline
Some functions modify a component without changing its name.
Make sure these functions are inside a new Component or called as a decorator
They without modifying the cell name
"""
import json
from functools import partial
from typing i... | mit | 7453a3629ced3c6516813098a312c8da | 26.549755 | 87 | 0.573958 | 3.472753 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/components/taper_cross_section.py | 1 | 2375 | import gdsfactory as gf
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.cross_section import rib_conformal, strip_rib_tip
from gdsfactory.types import CrossSectionSpec
@cell
def taper_cross_section(
cross_section1: CrossSectionSpec = strip_rib_tip,
cross_section2: C... | mit | 2245f4654228cc1ba688f29740da25f9 | 30.666667 | 85 | 0.597053 | 3.487518 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/geometry/offset.py | 1 | 2849 | """Based on phidl.geometry."""
import gdstk
import gdsfactory as gf
from gdsfactory.component_layout import Polygon, _parse_layer
from gdsfactory.types import Component, ComponentReference, LayerSpec
@gf.cell
def offset(
elements: Component,
distance: float = 0.1,
use_union: bool = True,
precision: ... | mit | 8dfbe3b69befd05f78abb1c53ca656c9 | 33.743902 | 87 | 0.664444 | 4.087518 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/read/import_gds.py | 1 | 4825 | from pathlib import Path
from typing import Optional, Union
import gdstk
from omegaconf import OmegaConf
from gdsfactory.cell import Settings, cell
from gdsfactory.component import Component
from gdsfactory.component_reference import ComponentReference
from gdsfactory.config import logger
from gdsfactory.name import ... | mit | 35eff97be4ea77b745e4b85a5b78887f | 31.823129 | 86 | 0.596477 | 3.625094 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/components/compass.py | 1 | 2540 | from typing import Optional, Tuple
import gdsfactory as gf
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.types import Ints, LayerSpec
@cell
def compass(
size: Tuple[float, float] = (4.0, 2.0),
layer: LayerSpec = "WG",
port_type: Optional[str] = "placement",
... | mit | 1c300fe893f5f10116ec1aedafd4e36c | 26.912088 | 84 | 0.472441 | 3.808096 | false | false | false | false |
gdsfactory/gdsfactory | fixme/snspd_candelabra.py | 1 | 11435 | """fixme."""
import numpy as np
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.types import LayerSpec
from gdsfactory.components.optimal_hairpin import optimal_hairpin
from gdsfactory.components.optimal_90deg import optimal_90deg
from gdsfactory.components.compass import co... | mit | 8e3219491e0738ba8333f32e4397541d | 32.731563 | 88 | 0.513686 | 3.358297 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/components/via_cutback.py | 1 | 5304 | """Via cutback."""
import gdsfactory as gf
from gdsfactory.add_pins import LayerSpec
from gdsfactory.component import Component
from gdsfactory.components.compass import compass
from gdsfactory.components.via_stack import via_stack_heater_m3
from gdsfactory.types import ComponentSpec, Float2
@gf.cell
def _via_iterab... | mit | 7eba6c214271a25412a3fe7d362aa6c8 | 29.482759 | 87 | 0.586538 | 3.214545 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/components/coupler.py | 1 | 3406 | import gdsfactory as gf
from gdsfactory.component import Component
from gdsfactory.components.coupler_straight import (
coupler_straight as coupler_straight_function,
)
from gdsfactory.components.coupler_symmetric import (
coupler_symmetric as coupler_symmetric_function,
)
from gdsfactory.types import Component... | mit | b50a43ae9ac7546f8f11b15238c66cc6 | 29.963636 | 87 | 0.52525 | 3.329423 | false | false | false | false |
gdsfactory/gdsfactory | docs/write_components_doc.py | 1 | 1556 | import inspect
import pathlib
import gdsfactory as gf
from gdsfactory.serialization import clean_value_json
filepath = pathlib.Path(__file__).parent.absolute() / "components.rst"
skip = {}
skip_plot = [
"component_lattice",
"component_sequence",
"extend_port",
"extend_ports_list",
]
skip_settings ... | mit | b75bb3ad5c9096843f60cad8f61c8ab8 | 19.473684 | 112 | 0.511568 | 3.969388 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/components/cutback_2x2.py | 1 | 1420 | import gdsfactory as gf
from gdsfactory.component import Component
from gdsfactory.components.component_sequence import component_sequence
from gdsfactory.components.mmi2x2 import mmi2x2
from gdsfactory.types import ComponentSpec
@gf.cell
def cutback_2x2(
component: ComponentSpec = mmi2x2,
cols: int = 4,
... | mit | a5e90a4ed57c702f7240957597f4a251 | 25.792453 | 81 | 0.64507 | 3.317757 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/components/die_bbox_frame.py | 1 | 2800 | from typing import Optional, Tuple, Union
import numpy as np
import gdsfactory as gf
from gdsfactory.components.text import text
from gdsfactory.types import Anchor, LayerSpec
Coordinate = Union[Tuple[float, float], Tuple[int, int]]
@gf.cell_without_validator
def die_bbox_frame(
bbox: Tuple[Coordinate, Coordin... | mit | b5e1391b50dc10e13e6197f69471e809 | 26.45098 | 72 | 0.527143 | 3.181818 | false | false | false | false |
gdsfactory/gdsfactory | gdsfactory/grid.py | 1 | 8976 | """pack a list of components into a grid."""
from typing import Optional, Tuple
import numpy as np
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.component_layout import Group
from gdsfactory.components.text_rectangular import text_rectangular
from gdsfactory.components.tr... | mit | bd04978fd106ae6946967a82602bbe04 | 33.656371 | 87 | 0.567959 | 3.712159 | false | false | false | false |
ssato/python-anyconfig | tests/cli/test_detectors.py | 1 | 3242 | #
# Copyright (C) 2021 Satoru SATOH <satoru.satoh @ gmail.com>
# License: MIT
#
# pylint: disable=missing-docstring
"""test cases of anyconfig.cli.detectors.
"""
import contextlib
import io
import unittest
import warnings
import anyconfig.cli.detectors as TT
import anyconfig.cli.parse_args
class TestCase(unittest.Te... | mit | 8e1670ae70bd07cc8c226368801d2971 | 31.09901 | 71 | 0.446638 | 3.630459 | false | true | false | false |
ssato/python-anyconfig | src/anyconfig/cli/utils.py | 1 | 2464 | #
# Copyright (C) 2011 - 2021 Satoru SATOH <satoru.satoh gmail.com>
# SPDX-License-Identifier: MIT
#
"""Utilities for anyconfig.cli.*."""
import functools
import os
import sys
import typing
from .. import api
@functools.lru_cache(None)
def list_parser_types() -> typing.List[str]:
"""Provide an wrapper of api.lis... | mit | 3c689dd1d782f44854e0d6e161674a47 | 27 | 78 | 0.594562 | 3.666667 | false | false | false | false |
ssato/python-anyconfig | src/anyconfig/backend/json/default.py | 1 | 1317 | #
# Copyright (C) 2011 - 2021 Satoru SATOH <satoru.satoh@gmail.com>
# SPDX-License-Identifier: MIT
#
# Ref. python -c "import json; help(json)"
#
# pylint: disable=import-error
"""A backend module using the standard json lib to load and dump JSON data.
- Format to support: JSON, http://www.json.org
- Requirements: jso... | mit | 0966041d5c1296fbdd2120a933383d85 | 24.326923 | 75 | 0.694002 | 3.181159 | false | false | false | false |
hugsy/gef | tests/utils.py | 1 | 14032 | """
Utility functions for testing
"""
import contextlib
import enum
import os
import pathlib
import platform
import re
import subprocess
import tempfile
import time
import unittest
import warnings
from typing import Dict, Iterable, List, Optional, Union
from urllib.request import urlopen
TMPDIR = pathlib.Path(tempfil... | mit | bc5c8dcfe5df9200d508a0dcb4c5f182 | 33.987531 | 127 | 0.599715 | 3.709677 | false | false | false | false |
hugsy/gef | tests/commands/edit_flags.py | 1 | 1751 | """
`edit-flags` command test module
"""
import pytest
from tests.utils import (
ARCH,
GefUnitTestGeneric,
gdb_start_silent_cmd_last_line,
gdb_start_silent_cmd,
)
@pytest.mark.skipif(ARCH not in ["i686", "x86_64", "armv7l", "aarch64"],
reason=f"Skipped for {ARCH}")
class EditFla... | mit | 1d0f8952db36f153168e1b4e2cd1ae71 | 32.673077 | 85 | 0.553969 | 3.617769 | false | true | false | false |
javipalanca/spade | tests/test_trace.py | 1 | 5230 | import datetime
import itertools
from collections import namedtuple
from aioxmpp import JID
from spade.message import Message
from spade.trace import TraceStore, _agent_in_msg
def test_agent_in_msg_sender():
msg = Message(sender="agent@server")
assert _agent_in_msg(JID.fromstr("agent@server"), msg)
def te... | mit | f96b8525d131a6ca26d454d2c3933ed5 | 23.325581 | 85 | 0.592734 | 3.156307 | false | true | false | false |
javipalanca/spade | tests/factories.py | 1 | 1657 | import factory
from aioxmpp import PresenceShow, PresenceState
from asynctest import CoroutineMock, Mock
from spade.agent import Agent
class MockedConnectedAgent(Agent):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._async_connect = CoroutineMock()
self._asyn... | mit | 650ea02da57cd3b597040486bc3eb261 | 27.568966 | 84 | 0.640917 | 3.945238 | false | false | false | false |
javipalanca/spade | examples/send_and_recv.py | 1 | 2562 | import getpass
import time
from spade import quit_spade
from spade.agent import Agent
from spade.behaviour import OneShotBehaviour
from spade.message import Message
from spade.template import Template
class SenderAgent(Agent):
class InformBehav(OneShotBehaviour):
async def run(self):
print("I... | mit | 00df621d0fd8fdc2641168638ca48050 | 28.448276 | 85 | 0.600312 | 3.99688 | false | false | false | false |
solvebio/solvebio-python | solvebio/cli/credentials.py | 1 | 4145 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
import six
import solvebio
from netrc import netrc as _netrc, NetrcParseError
import os
def as_netrc_machine(api_host):
return api_host.replace("https://", "").replace("http://", "")
class netrc(_netrc):
... | mit | dc7162217cade62bc7d000b66fc16b08 | 29.477941 | 78 | 0.580941 | 3.830869 | false | false | false | false |
solvebio/solvebio-python | solvebio/__init__.py | 1 | 5319 | # -*- coding: utf-8 -*-
"""
SolveBio Python Client
~~~~~~~~~~~~~~~~~~~~~~
This is the Python client & library for the SolveBio API.
Have questions or comments? email us at: support@solvebio.com
"""
from __future__ import absolute_import
from __future__ import print_function
__docformat__ = 'restructuredtext'
import ... | mit | bf47c91d8e20af9f7c366cebb38181d5 | 25.073529 | 77 | 0.619289 | 3.812903 | false | false | false | false |
solvebio/solvebio-python | solvebio/contrib/dash/solvebio_auth.py | 1 | 7140 | from __future__ import absolute_import
import json
import flask
import requests
import os
from six.moves.urllib.parse import urljoin
from dash_auth.oauth import OAuthBase
import solvebio
class SolveBioAuth(OAuthBase):
"""Handles OAuth2 flows with the SolveBio API."""
AUTH_COOKIE_NAME = 'dash_solvebio_auth... | mit | 7ad2c0c291bb44b20b3ecc465037bd15 | 34 | 78 | 0.534594 | 4.163265 | false | false | false | false |
solvebio/solvebio-python | solvebio/contrib/streamlit/solvebio_auth.py | 1 | 1233 | import os
from typing import Any
from typing import Dict
from urllib.parse import urlencode
from urllib.parse import urljoin
import solvebio
from httpx_oauth.oauth2 import BaseOAuth2
class SolveBioOAuth2(BaseOAuth2[Dict[str, Any]]):
"""Class implementing OAuth2 for SolveBio API"""
# SolveBio API OAuth2 end... | mit | 4b88b461827d91a066d7ea0fa1d8f262 | 29.073171 | 83 | 0.620438 | 3.584302 | false | false | false | false |
sigopt/sigopt-python | sigopt/hyperopt/base.py | 1 | 3415 | # Copyright © 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from .compat import Trials, STATUS_OK, STATUS_FAIL
from ..local_run_context import LocalRunContext
from .. import SigOptFactory
from ..defaults import get_default_name
HYPEROPT_SOURCE_NAME = 'Hyperopt'
HYPEROPT_SOURCE_PRIORITY = 1
class SigOptTri... | mit | c74a7d0cf0f5e1624aafd311b3c5bc69 | 28.179487 | 94 | 0.643234 | 3.545171 | false | false | false | false |
sigopt/sigopt-python | sigopt/orchestrate/stop.py | 1 | 1077 | # Copyright © 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from .identifier import IDENTIFIER_TYPE_EXPERIMENT, IDENTIFIER_TYPE_RUN, get_run_and_pod_from_identifier
def stop_experiment(experiment_identifier, services):
assert experiment_identifier["type"] == IDENTIFIER_TYPE_EXPERIMENT
experiment_jobs = ... | mit | 13126ad8d25a0c3ef0e8759127b8da6f | 37.428571 | 104 | 0.768587 | 3.684932 | false | false | false | false |
sigopt/sigopt-python | test/orchestrate/options_validator/service_test.py | 1 | 9268 | # Copyright © 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
import pytest
from mock import Mock
from sigopt.orchestrate.options_validator.service import OptionsValidatorService
class TestOptionsValidatorService(object):
@pytest.fixture()
def options_validator_service(self):
services = Mock()
re... | mit | bbf046ce0c0c2bd185bc85e558a9b0ad | 27.959375 | 96 | 0.6221 | 3.74273 | false | true | false | false |
choderalab/openmmtools | openmmtools/alchemy.py | 1 | 131748 | #!/usr/bin/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Alchemical factory for free energy calculations that operates directly on OpenMM System objects.
DESCRIPTION
This m... | mit | 7957cbb03c33c20b4810f756a7c424e5 | 50.767387 | 212 | 0.615478 | 4.284348 | false | false | false | false |
choderalab/openmmtools | openmmtools/utils.py | 1 | 35498 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
General utility functions for the repo.
"""
# ================================================================... | mit | 93ae3f67a1f05366ece50087d8cdf0fa | 33.231437 | 118 | 0.592174 | 4.622135 | false | false | false | false |
choderalab/openmmtools | openmmtools/multistate/sams.py | 1 | 37672 | #!/usr/local/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
SamsSampler
===========
Self-adjusted mixture sampling (SAMS), also known as optimally-adjusted mixture ... | mit | 130aa77fb53f3f3a2fae543ef7ced522 | 51.835905 | 247 | 0.627814 | 4.026077 | false | false | false | false |
choderalab/openmmtools | openmmtools/multistate/multistatereporter.py | 1 | 85150 | #!/usr/local/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
Multistatereporter
==================
Master multi-thermodynamic state reporter module. Handles all Disk... | mit | 85c1a5425f31d71bdff18c32b83679a8 | 44.413333 | 131 | 0.596312 | 4.742412 | false | false | false | false |
choderalab/openmmtools | openmmtools/sobol.py | 1 | 16887 | #! /usr/bin/env python
"""
From: http://people.sc.fsu.edu/~jburkardt/py_src/sobol/sobol.html
See mit_license.txt for license information.
"""
import math
from numpy import *
def i4_bit_hi1 ( n ):
#*****************************************************************************80
#
## I4_BIT_HI1 returns the position o... | mit | c3aafdd2d24b86b1084d71874dcceb79 | 26.503257 | 108 | 0.446201 | 3.252504 | false | false | false | false |
althonos/pronto | pronto/utils/meta.py | 1 | 6441 | import collections
import contextlib
import functools
import inspect
import itertools
import sys
import typing
from typing import Callable, Iterator, List, Tuple, Type
T = typing.TypeVar("T")
F = typing.TypeVar("F", bound=Callable[..., object])
class typechecked(object):
_disable = 0
if sys.version_info >=... | mit | 3e902c0bbed80f0645ae91d76a7f7bc9 | 37.112426 | 104 | 0.533302 | 4.231932 | false | false | false | false |
althonos/pronto | pronto/parsers/rdfxml.py | 1 | 36581 | import datetime
import os
import re
import typing
import warnings
from typing import Dict, List, Optional, Tuple
from xml.etree import ElementTree as etree
import dateutil.parser
from ..definition import Definition
from ..metadata import Metadata, Subset
from ..pv import LiteralPropertyValue, ResourcePropertyValue
fr... | mit | f3394a077c231cbe86a5d5d09b687c02 | 42.54881 | 92 | 0.501873 | 4.194107 | false | false | false | false |
althonos/pronto | pronto/parsers/obojson.py | 1 | 1946 | import multiprocessing.pool
import os
import fastobo
from ..logic.lineage import Lineage
from ..utils.meta import typechecked
from ._fastobo import FastoboParser
from .base import BaseParser
class OboJSONParser(FastoboParser, BaseParser):
@classmethod
def can_parse(cls, path, buffer):
return buffer.... | mit | 54c758bec88a2e6f451a383dbff56e7f | 33.75 | 82 | 0.615622 | 4.353468 | false | false | false | false |
pact-foundation/pact-python | pact/constants.py | 1 | 1301 | """Constant values for the pact-python package."""
import os
from os.path import join, dirname, normpath
def broker_client_exe():
"""Get the appropriate executable name for this platform."""
if os.name == 'nt':
return 'pact-broker.bat'
else:
return 'pact-broker'
def message_exe():
""... | mit | 73844d3c4679979e8976a1a930a804a4 | 26.104167 | 73 | 0.625673 | 3.603878 | false | false | false | false |
pact-foundation/pact-python | pact/message_consumer.py | 1 | 6120 | """Classes and methods to describe contract Consumers."""
from .message_pact import MessagePact
from .provider import Provider
class MessageConsumer(object):
"""
A Pact message consumer.
Use this class to describe the service making requests to the provider and
then use `has_pact_with` to create a co... | mit | eea3ecad39fceb280573819f1873aae9 | 40.917808 | 104 | 0.624183 | 4.288718 | false | false | false | false |
warner/foolscap | src/foolscap/slicers/bool.py | 3 | 2408 | # -*- test-case-name: foolscap.test.test_banana -*-
from twisted.python.components import registerAdapter
from twisted.internet.defer import Deferred
from foolscap import tokens
from foolscap.tokens import Violation, BananaError
from foolscap.slicer import BaseSlicer, LeafUnslicer
from foolscap.constraint import Opene... | mit | abd8fa8626f6a773174ad26b260e742f | 32.444444 | 74 | 0.638289 | 4.202443 | false | false | false | false |
warner/foolscap | src/foolscap/logging/publish.py | 1 | 9404 | from __future__ import print_function
import os
from collections import deque
import six
from zope.interface import implementer
from twisted.python import filepath
from foolscap.referenceable import Referenceable
from foolscap.logging.interfaces import RISubscription, RILogPublisher
from foolscap.logging import app_ver... | mit | 826e52fb55cadd99f621310a13c4b366 | 36.767068 | 94 | 0.630476 | 3.994902 | false | false | false | false |
warner/foolscap | src/foolscap/constraint.py | 1 | 10430 |
# This provides a base for the various Constraint subclasses to use. Those
# Constraint subclasses live next to the slicers. It also contains
# Constraints for primitive types (int, str).
# This imports foolscap.tokens, but no other Foolscap modules.
import six
from zope.interface import implementer, Interface
from... | mit | f98f330ac78b4fa2d9bdc07bcfce3da1 | 36.517986 | 79 | 0.6279 | 4.299258 | false | false | false | false |
warner/foolscap | src/foolscap/logging/web.py | 1 | 17941 | from __future__ import print_function
import time
import six
from six.moves.urllib.parse import quote
from twisted.internet import reactor, endpoints
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.python import usage
from foolscap import base32
from foolscap.eventual import fireEventually
... | mit | 88ec0bb01b838ab1af09135d1cb720e8 | 35.689162 | 88 | 0.502257 | 3.845049 | false | false | false | false |
jmoiron/humanize | tests/test_i18n.py | 1 | 4163 | """Internationalisation tests."""
import datetime as dt
import importlib
import pytest
import humanize
def test_i18n():
three_seconds = dt.timedelta(seconds=3)
one_min_three_seconds = dt.timedelta(milliseconds=67_000)
assert humanize.naturaltime(three_seconds) == "3 seconds ago"
assert humanize.ord... | mit | 70f1920babe84b4f406ec5aff81b00cf | 30.037594 | 87 | 0.631783 | 3.297125 | false | true | false | false |
jmoiron/humanize | src/humanize/number.py | 1 | 12368 | #!/usr/bin/env python
"""Humanizing functions for numbers."""
import math
import re
from fractions import Fraction
from .i18n import _gettext as _
from .i18n import _ngettext
from .i18n import _ngettext_noop as NS_
from .i18n import _pgettext as P_
from .i18n import thousands_separator
def ordinal(value, gender="m... | mit | 2e5ff87bc7bc540a661847c17bc9eaed | 26.165198 | 88 | 0.524366 | 3.704716 | false | false | false | false |
jmoiron/humanize | src/humanize/filesize.py | 1 | 2167 | #!/usr/bin/env python
"""Bits and bytes related humanization."""
suffixes = {
"decimal": ("kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"),
"binary": ("KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"),
"gnu": "KMGTPEZY",
}
def naturalsize(value, binary=False, gnu=False, format="%.1f"):
"""Forma... | mit | 7665c8f7b6e519a27efad4dbedd6dc4f | 29.957143 | 80 | 0.539455 | 3.375389 | false | false | false | false |
lipis/electron-crash-reporter | main/model/crash.py | 1 | 1387 | # coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
import flask
from api import fields
import model
class Crash(model.Base):
project_key = ndb.KeyProperty(kind=model.Project, required=True, verbose_name=u'Project')
ver = ndb.StringProperty(default='', verbose_name=u'Ele... | mit | c7a365664316e99a0a6cf021a0b9c381 | 31.255814 | 98 | 0.706561 | 3.511392 | false | false | false | false |
pytest-dev/pluggy | src/pluggy/_manager.py | 1 | 17872 | import inspect
import sys
import types
import warnings
from typing import Any
from typing import Callable
from typing import cast
from typing import Dict
from typing import Iterable
from typing import List
from typing import Mapping
from typing import Optional
from typing import Sequence
from typing import Set
from typ... | mit | 84db4c604cfb48aad29a4180b9d1d35c | 36.625263 | 88 | 0.594505 | 4.254225 | false | false | false | false |
lipis/electron-crash-reporter | main/util.py | 1 | 7045 | # coding: utf-8
from uuid import uuid4
import hashlib
import re
import unicodedata
import urllib
from google.appengine.datastore.datastore_query import Cursor
from google.appengine.ext import ndb
from webargs import fields as wf
from webargs.flaskparser import parser
import flask
import config
####################... | mit | 15d43d757abc3775014447fef32ef237 | 31.16895 | 79 | 0.583818 | 3.663547 | false | false | false | false |
lipis/electron-crash-reporter | main/model/config_auth.py | 3 | 4407 | # coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
from api import fields
import model
class ConfigAuth(object):
bitbucket_key = ndb.StringProperty(default='', verbose_name='Key')
bitbucket_secret = ndb.StringProperty(default='', verbose_name='Secret')
dropbox_app_key... | mit | 62e31f8b82365fe329e3b90cb8f1d49f | 38.348214 | 90 | 0.724529 | 3.609337 | false | false | false | false |
lipis/electron-crash-reporter | main/api/v1/user.py | 2 | 2029 | # coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
from flask.ext import restful
import flask
from api import helpers
import auth
import model
import util
from main import api_v1
@api_v1.resource('/admin/user/', endpoint='api.admin.user.list')
class AdminUserListAPI(restfu... | mit | dffd25a903fb250c3101fdba3eed8b04 | 29.742424 | 79 | 0.635781 | 3.277868 | false | false | false | false |
jacebrowning/gitman | gitman/shell.py | 1 | 4372 | """Utilities to call shell programs."""
import os
import subprocess
import log
from . import common
from .exceptions import ShellError
CMD_PREFIX = "$ "
OUT_PREFIX = "> "
def call(name, *args, _show=True, _stream=True, _shell=False, _ignore=False):
"""Call a program with arguments.
:param name: name of p... | mit | 422d8f0702d646c6fa94dfb7cd231644 | 29.361111 | 162 | 0.609332 | 3.746358 | false | false | false | false |
pebble/cloudpebble | ide/migrations/0026_auto__add_buildsize.py | 3 | 13495 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'BuildSize'
db.create_table(u'ide_buildsize', (
... | mit | 7004fb0701f9a18388407917c97394a5 | 80.301205 | 195 | 0.553242 | 3.574834 | false | false | false | false |
bioconda/bioconda-utils | bioconda_utils/bot/views.py | 1 | 8448 | """
HTTP Views (accepts and parses webhooks)
"""
import logging
from aiohttp import web
from aiohttp_session import get_session
from aiohttp_security import check_authorized, forget, permits, remember, authorized_userid
from aiohttp_jinja2 import template, render_template
from .events import event_routes
from ..gith... | mit | ef95a3ae829353f9d39974d32c60043c | 30.288889 | 96 | 0.648201 | 4.065448 | false | false | false | false |
pebble/cloudpebble | ide/migrations/0005_auto__add_project_github_fields.py | 3 | 9675 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Project.github_repo'
db.add_column(u'ide_project', 'github_repo',
self... | mit | cc7c81a442c75d6ff1fbe3c1a4fbb59f | 69.115942 | 187 | 0.552558 | 3.618175 | false | false | false | false |
bioconda/bioconda-utils | bioconda_utils/lint/check_policy.py | 1 | 4372 | """Policy compliance
This checks that recipes are in accordance with policy (as far as it
can be mechanically checked).
"""
import glob
import os
from . import LintCheck, ERROR, WARNING, INFO
from bioconda_utils import utils
class uses_vcs_url(LintCheck):
"""The recipe downloads source from a VCS
Please b... | mit | 473f676bbc5b2e654c12dbb3a5f6dcfd | 31.385185 | 86 | 0.652104 | 4.063197 | false | false | false | false |
pebble/cloudpebble | ide/api/__init__.py | 2 | 3083 | import urllib2
import json
from celery.result import AsyncResult
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST, require_safe
from ide.models.project import Project
__aut... | mit | ea56f57d665d686d3f57ea31b6f1fa0b | 29.22549 | 149 | 0.644178 | 3.727932 | false | false | false | false |
pebble/cloudpebble | ide/migrations/0030_auto__add_resourcevariant__add_unique_resourcevariant_resource_file_va.py | 3 | 13813 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ResourceVariant'
db.create_table(u'ide_resourcevariant', ... | mit | 855c2f78a3321399a412db42a37f7e6f | 78.849711 | 195 | 0.555346 | 3.606527 | false | false | false | false |
bioconda/bioconda-utils | bioconda_utils/bot/worker.py | 1 | 6710 | """
Celery Worker Setup
"""
import abc
import asyncio
import logging
import os
import re
from functools import wraps
import subprocess
from importlib import import_module
import aiohttp
from celery import Celery, Task
from celery.signals import celeryd_init
from kombu import serialization
import simplejson
from ..... | mit | efa764395faf0405d747c95f3928cb41 | 31.259615 | 86 | 0.639642 | 4.129231 | false | false | false | false |
bioconda/bioconda-utils | bioconda_utils/bot/commands.py | 1 | 7769 | """
Handlers for user commmands (``@biocondabot do this``)
"""
import logging
import functools
from typing import Callable, Dict, Optional
from inspect import getdoc
from . import tasks
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
class CommandDispatch:
"""Decorator based router handli... | mit | ac65aa6a1b2268d933cf078132dc3b6f | 34.967593 | 92 | 0.599949 | 3.888388 | false | false | false | false |
bioconda/bioconda-utils | bioconda_utils/_version.py | 1 | 18467 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | mit | 831ca3246ae92f7981c4d180394751d4 | 34.513462 | 79 | 0.575459 | 3.952697 | false | false | false | false |
trek10inc/awsume | awsume/awsumepy/lib/exceptions.py | 1 | 3818 | from . config_management import CONFIG_MANAGEMENT_HELP
class AwsumeException(Exception):
""""""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class ProfileNotFoundError(AwsumeException):
""""""
def __init__(self, profile_name='', message=''):
self.profile_nam... | mit | 182634cc58034985878a6035dd5a1695 | 28.828125 | 136 | 0.621268 | 4.010504 | false | false | false | false |
benoitc/couchdbkit | setup.py | 3 | 1830 | # -*- coding: utf-8 -
#
# This file is part of couchdbkit released under the MIT license.
# See the NOTICE for more information.
from imp import load_source
import os
import sys
if not hasattr(sys, 'version_info') or sys.version_info < (2, 6, 0, 'final'):
raise SystemExit("couchdbkit requires Python 2.6 or later.... | mit | 844cb1c8e5bb628793918be7a3132c74 | 27.59375 | 77 | 0.622951 | 3.804574 | false | false | false | false |
theonion/django-bulbs | tests/content/test_custom_search.py | 1 | 24328 | import copy
import json
from datetime import timedelta
from django.core.urlresolvers import reverse
from django.utils import timezone, dateparse
from bulbs.utils.test import BaseIndexableTestCase
from rest_framework.test import APIClient
from bulbs.content.models import Content, FeatureType, Tag
from bulbs.content.cu... | mit | dc9022671278e0803708accd2b76af84 | 34.988166 | 99 | 0.498808 | 3.962215 | false | true | false | false |
theonion/django-bulbs | bulbs/contributions/south_migrations/0001_initial.py | 2 | 6786 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
# Safe User import for Django < 1.5
try:
from django.contrib.auth import get_user_model
except ImportError:
from django.contrib.auth.models import User
else:
User = get_user_mo... | mit | 980a1f33ebd1b03cde5723406a5fe65d | 59.053097 | 198 | 0.583996 | 3.605739 | false | false | false | false |
wireservice/csvkit | csvkit/utilities/sql2csv.py | 1 | 3300 | #!/usr/bin/env python
import agate
import six
from sqlalchemy import create_engine
from csvkit.cli import CSVKitUtility
class SQL2CSV(CSVKitUtility):
description = 'Execute an SQL query on a database and output the result to a CSV file.'
# Overrides all flags except --linenumbers, --verbose, --version.
... | mit | 306d0f955d6804fc298ec928ef694b46 | 34.869565 | 117 | 0.597879 | 4.089219 | false | false | false | false |
cole/aiosmtplib | aiosmtplib/esmtp.py | 1 | 2369 | """
ESMTP utils
"""
import re
from typing import Dict, List, Tuple
__all__ = ("parse_esmtp_extensions",)
OLDSTYLE_AUTH_REGEX = re.compile(r"auth=(?P<auth>.*)", flags=re.I)
EXTENSIONS_REGEX = re.compile(r"(?P<ext>[A-Za-z0-9][A-Za-z0-9\-]*) ?")
def parse_esmtp_extensions(message: str) -> Tuple[Dict[str, str], List[... | mit | 750b01ea318e7ffebb783f6554b553f3 | 31.902778 | 86 | 0.610384 | 3.736593 | false | false | false | false |
wireservice/csvkit | csvkit/utilities/csvjoin.py | 1 | 5777 | #!/usr/bin/env python
import agate
from csvkit.cli import CSVKitUtility, match_column_identifier
class CSVJoin(CSVKitUtility):
description = 'Execute a SQL-like join to merge CSV files on a specified column or columns.'
epilog = "Note that the join operation requires reading all files into memory. Don't try... | mit | e93df10ac52ffc624c3f6db79bf87072 | 43.438462 | 119 | 0.599792 | 3.989641 | false | false | false | false |
theonion/django-bulbs | bulbs/promotion/templatetags/promotion.py | 1 | 2769 | from django import template
from django.template.base import parse_bits, Variable, VariableDoesNotExist
from django.template.defaulttags import ForNode
from bulbs.promotion.models import PZone
register = template.Library()
class PZoneSequence(object):
def __init__(self, pzone_name, slice_string=None, apply=Tr... | mit | 11b700e392179e19d9bb296251c92d84 | 28.457447 | 88 | 0.572409 | 3.88359 | false | false | false | false |
theonion/django-bulbs | bulbs/poll/models.py | 1 | 2963 | import logging
from django.db import models, transaction
from djes.models import Indexable
from bulbs.content.models import Content, ElasticsearchImageField
from .mixins import AnswerMixin, PollMixin
logger = logging.getLogger(__name__)
"""
Sodahead API Integration Rationale
The sodahoad api implements a POST ... | mit | 959100bf86c3afc6996afb472ff4320f | 28.336634 | 79 | 0.660817 | 3.808483 | false | false | false | false |
wireservice/csvkit | csvkit/utilities/csvformat.py | 1 | 3134 | #!/usr/bin/env python
import itertools
import sys
import agate
from csvkit.cli import CSVKitUtility, make_default_headers
class CSVFormat(CSVKitUtility):
description = 'Convert a CSV file to a custom output format.'
override_flags = ['L', 'blanks', 'date-format', 'datetime-format']
def add_arguments(se... | mit | 4f2a0997905acc419a767f512622325b | 38.670886 | 114 | 0.601149 | 3.957071 | false | false | false | false |
wireservice/csvkit | csvkit/utilities/csvpy.py | 1 | 1988 | #!/usr/bin/env python
import sys
import agate
from csvkit.cli import CSVKitUtility
class CSVPy(CSVKitUtility):
description = 'Load a CSV file into a CSV reader and then drop into a Python shell.'
def add_arguments(self):
self.argparser.add_argument('--dict', dest='as_dict', action='store_true',
... | mit | a298bfb565df06ea56593d8d3b60ad87 | 32.133333 | 110 | 0.592555 | 4.04065 | false | false | false | false |
theonion/django-bulbs | bulbs/liveblog/models.py | 1 | 1706 | from django.conf import settings
from django.db import models
from bulbs.content.models import Content
from bulbs.liveblog.utils import get_liveblog_author_model_name
class AbstractLiveBlog(models.Model):
"""Base mixin inherited by each property's concrete LiveBlog implementation (along with base
content cla... | mit | 78cd6e41a3de000044bb5ddde3956516 | 33.816327 | 96 | 0.710434 | 3.825112 | false | false | false | false |
theonion/django-bulbs | bulbs/ads/views.py | 1 | 1904 | import json
import sys
from django.core.urlresolvers import resolve, Resolver404
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseNotFound
from django.views.decorators.csrf import csrf_exempt
from django.test.client import RequestFactory
from .models import TargetingOverride
if sys.version_i... | mit | e2f840076668af2497e0939b597a4ac1 | 30.213115 | 84 | 0.670168 | 4.297968 | false | false | false | false |
theonion/django-bulbs | bulbs/contributions/csv_serializers.py | 1 | 1676 | from django.contrib.auth import get_user_model
from django.utils import timezone
from rest_framework import serializers
from .models import Contribution, LineItem
contributor_cls = get_user_model()
class ContributionCSVSerializer(serializers.ModelSerializer):
class Meta:
model = Contribution
def... | mit | 4e2416fd04a0878fdcea24bd206e7343 | 30.037037 | 70 | 0.606205 | 4.058111 | false | false | false | false |
theonion/django-bulbs | bulbs/feeds/serializers.py | 1 | 1390 | from rest_framework import serializers
class GlanceContentSerializer(serializers.Serializer):
type = serializers.IntegerField(required=True, allow_null=False)
id = serializers.CharField()
title = serializers.CharField()
link = serializers.URLField()
modified = serializers.DateTimeField()
publ... | mit | f4353d9c759c686e37db91ff38e26493 | 33.75 | 87 | 0.592086 | 4.426752 | false | false | false | false |
cole/aiosmtplib | aiosmtplib/email.py | 1 | 5417 | """
Email message and address formatting/parsing functions.
"""
import copy
import email.charset
import email.generator
import email.header
import email.headerregistry
import email.message
import email.policy
import email.utils
import io
import re
from typing import List, Optional, Tuple, Union
__all__ = (
"extra... | mit | bbe5ce9c493c15edcbb51dc1c014b7e9 | 28.928177 | 82 | 0.648514 | 3.836402 | false | false | false | false |
lmjohns3/theanets | theanets/layers/convolution.py | 1 | 8665 | # -*- coding: utf-8 -*-
'''Convolutional layers "scan" over input data.'''
from __future__ import division
import numpy as np
import theano
import theano.tensor as TT
from . import base
from .. import util
__all__ = [
'Conv1',
'Conv2',
'Pool1',
'Pool2',
]
class Convolution(base.Layer):
'''Con... | mit | 4a718a432ea3831b72a984a53edf0067 | 33.939516 | 88 | 0.571841 | 3.674724 | false | false | false | false |
agronholm/apscheduler | src/apscheduler/marshalling.py | 1 | 3510 | from __future__ import annotations
import sys
from datetime import date, datetime, tzinfo
from functools import partial
from typing import Any, Callable, overload
from ._exceptions import DeserializationError, SerializationError
if sys.version_info >= (3, 9):
from zoneinfo import ZoneInfo
else:
from backport... | mit | c8a753b416b334eecd8e40ceae0fc67e | 25.19403 | 88 | 0.640456 | 4.076655 | false | false | false | false |
agronholm/apscheduler | src/apscheduler/schedulers/sync.py | 1 | 9178 | from __future__ import annotations
import atexit
import logging
import sys
import threading
from collections.abc import MutableMapping
from contextlib import ExitStack
from datetime import timedelta
from functools import partial
from logging import Logger
from types import TracebackType
from typing import Any, Callabl... | mit | 4cc2dc3f3a1269b87a1cde29fbb62188 | 32.253623 | 88 | 0.58662 | 4.237304 | false | false | false | false |
agronholm/apscheduler | examples/web/asgi_fastapi.py | 1 | 2132 | """
Example demonstrating use with the FastAPI web framework.
Requires the "postgresql" service to be running.
To install prerequisites: pip install sqlalchemy asycnpg fastapi uvicorn
To run: uvicorn asgi_fastapi:app
It should print a line on the console on a one-second interval while running a
basic web app at http:... | mit | 6f3009fdc50619a6362241201aae096d | 32.3125 | 85 | 0.724203 | 3.948148 | false | false | false | false |
lmjohns3/theanets | theanets/trainer.py | 1 | 14385 | # -*- coding: utf-8 -*-
'''This module contains optimization methods for neural networks.
Many optimization methods are general-purpose optimization routines that happen
to be pretty good for training neural networks; these are provided by
``downhill``. The other methods here --- :class:`SampleTrainer`,
:class:`Super... | mit | 532e221240fe7a0ae43cd298c921b2ea | 41.68546 | 86 | 0.619951 | 4.439815 | false | false | false | false |
lmjohns3/theanets | theanets/layers/base.py | 1 | 25785 | # -*- coding: utf-8 -*-
'''This module contains classes for different types of network layers.'''
from __future__ import division
import numpy as np
import theano
import theano.sparse as SS
import theano.tensor as TT
from .. import activations
from .. import util
__all__ = [
'Concatenate',
'Input',
'Fl... | mit | 376928a15b55b129bfd9cd69d0ad7a8a | 36.047414 | 89 | 0.590809 | 4.473456 | false | false | false | false |
lmjohns3/theanets | examples/recurrent-memory.py | 1 | 3305 | #!/usr/bin/env python
'''This example examines recurrent performance in a memory task.
In the memory task, a network is supposed to read in T frames of n-dimensional
data and reproduce the first t frames at the output of the network, after
reading in T - t additional frames of n-dimensional data.
This task is quite ... | mit | 29f870cd49d6e3631df52c0c4da0bfec | 35.722222 | 80 | 0.678971 | 3.512221 | false | false | false | false |
agronholm/apscheduler | src/apscheduler/datastores/memory.py | 1 | 11442 | from __future__ import annotations
from bisect import bisect_left, insort_right
from collections import defaultdict
from datetime import MAXYEAR, datetime, timedelta, timezone
from functools import partial
from typing import Any, Iterable
from uuid import UUID
import attrs
from .._enums import ConflictPolicy
from ..... | mit | 03cde998fabb2c0ee0a8b883d7af7758 | 34.981132 | 88 | 0.605139 | 3.839597 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.