code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
import IPy
from .Errors import ConfigError
from .Helpers import BasicConfigElement
from .Logging import logger
class ExpResCriterion_DNSRecord(BasicConfigElement):
"""DNS record
Test properties which are common to all DNS record types.
`type`: record's type. Must be one of the DNS record types impleme... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/ExpResCriteriaDNSRecords.py | 0.814385 | 0.414721 | ExpResCriteriaDNSRecords.py | pypi |
from .Errors import ConfigError
from .ExpResCriteriaBase import ExpResCriterion
from .ExpResCriteriaDNSRecords import HANDLED_RECORD_TYPES
from .Logging import logger
from .ParsedResults import ParsedResult_DNSHeader, ParsedResult_EDNS
class ExpResCriterion_DNSBased(ExpResCriterion):
def response_matches(self, ... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/ExpResCriteriaDNS.py | 0.845081 | 0.286381 | ExpResCriteriaDNS.py | pypi |
from .Errors import ConfigError
from .Helpers import BasicConfigElement
class ExpResCriterion(BasicConfigElement):
"""ExpResCriterion
This class reads expected result attributes from the monitor's config
file, validates them and use them to match received results against
expected values.
The CR... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/ExpResCriteriaBase.py | 0.726037 | 0.461623 | ExpResCriteriaBase.py | pypi |
import IPy
from .Errors import ConfigError, ResultProcessingError
from .ExpResCriteriaBase import ExpResCriterion
from .Logging import logger
from .ParsedResults import ParsedResult_RTT, ParsedResult_DstResponded, \
ParsedResult_DstIP
class ExpResCriterion_RTT(ExpResCriterion):
"""Cri... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/ExpResCriteriaCommon.py | 0.806129 | 0.373876 | ExpResCriteriaCommon.py | pypi |
import datetime
import json
import os
from six.moves.queue import Queue, Empty
import time
from threading import Thread
import pytz
import yaml
from .Action import ACTION_CLASSES
from .Config import Config
from .Errors import ConfigError, MissingFileError, \
MeasurementProcessingError, \
... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/Monitor.py | 0.624294 | 0.222014 | Monitor.py | pypi |
from .Errors import ConfigError, ResultProcessingError
from .ExpResCriteria import CRITERIA_CLASSES
from .Helpers import BasicConfigElement
from .Logging import logger
class ExpectedResult(BasicConfigElement):
"""Expected result
A group of criteria used to match probes' results.
`descr` (optional): a b... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/ExpectedResult.py | 0.895443 | 0.239077 | ExpectedResult.py | pypi |
import re
import six
from .Action import Action, ACTION_CLASSES
from .ExpectedResult import ExpectedResult
from .ExpResCriteria import CRITERIA_CLASSES, \
CRITERIA_CLASSES_COMMON, \
CRITERIA_CLASSES_TRACEROUTE, \
CRITERIA_CLASSES_SSL,... | /ripe-atlas-monitor-0.1.10.tar.gz/ripe-atlas-monitor-0.1.10/pierky/ripeatlasmonitor/doc.py | 0.59796 | 0.168651 | doc.py | pypi |
import json
from . import utils
class ShopifyCommons(object):
PRODUCT_TYPE = "Platforme"
""" The type to use when creating a custom product,
should properly identify it from the remaining products
in the catalog (dummy product) """
PRODUCT_TAGS = "platforme"
""" The comma-separated tags to... | /ripe-commons-logic-0.2.4.tar.gz/ripe-commons-logic-0.2.4/src/ripe_commons_logic/shopify.py | 0.722918 | 0.297942 | shopify.py | pypi |
<h1><a href="https://tech.platforme.com"><img src="res/logo.svg" alt="RIPE Rainbow" height="60" style="height: 60px;"></a></h1>
**Bringing happiness to the RIPE world through testing 🌈**
RIPE Rainbow is a simple automation test framework for the RIPE world.
## Installation
```bash
pip install ripe-rainbow
```
## ... | /ripe-rainbow-0.10.3.tar.gz/ripe-rainbow-0.10.3/README.md | 0.644113 | 0.983279 | README.md | pypi |
import appier
from .. import parts
class RipeWhitePart(parts.Part):
def authorize(self):
self.id.authorize()
def select_size(self, size, gender=None, scale=None, open=True, wait_closed=True):
"""
Opens the size selection window, selects the proper scale and size and
applies ... | /ripe-rainbow-0.10.3.tar.gz/ripe-rainbow-0.10.3/src/ripe_rainbow/domain/logic/ripe_white.py | 0.742235 | 0.329823 | ripe_white.py | pypi |
import appier
from .. import parts
class RipeRetailPart(parts.Part):
def login(self, username, password):
self.interactions.goto_url(self.login_url)
self.interactions.write_text(".form input[name='username']", username)
self.interactions.write_text(".form input[name='password']", passwo... | /ripe-rainbow-0.10.3.tar.gz/ripe-rainbow-0.10.3/src/ripe_rainbow/domain/logic/ripe_retail.py | 0.613931 | 0.313512 | ripe_retail.py | pypi |
import appier
from .. import parts
class RipeCorePart(parts.Part):
def assert_swatch(self, selector, brand, model, material, color):
"""
Checks that the img element identified by the selector points to the
correct swatch. The correctness verification is performed by checking
the ... | /ripe-rainbow-0.10.3.tar.gz/ripe-rainbow-0.10.3/src/ripe_rainbow/domain/logic/ripe_core.py | 0.747892 | 0.309363 | ripe_core.py | pypi |
import os
import appier
from .. import parts
class InteractionsPart(parts.Part):
def goto_url(self, url, redirect_url=None, params=[], fragment="", wait=True):
"""
Navigates to a certain URL with given GET parameters and to
the request fragment.
The operation is always going to ... | /ripe-rainbow-0.10.3.tar.gz/ripe-rainbow-0.10.3/src/ripe_rainbow/domain/base/interactions.py | 0.680985 | 0.394493 | interactions.py | pypi |
import unittest
import appier
import ripe_rainbow
class LogicPartTest(unittest.TestCase):
def test_match_url(self):
test_case = ripe_rainbow.TestCase()
logic_part = ripe_rainbow.LogicPart(test_case)
self.assertEqual(
logic_part.match_url("http://www.platforme.com", "http://... | /ripe-rainbow-0.10.3.tar.gz/ripe-rainbow-0.10.3/src/ripe_rainbow/unit/domain/base/logic.py | 0.502686 | 0.566738 | logic.py | pypi |
class AtlasSource(object):
"""
Class responsible for creating an Atlas source object that holds
information about the number of probes, the type of the source and
the value of the source. This object can be passed as source argument
later on when we call AtlasRequest.
Usage:
from ripe.at... | /ripe.atlas.cousteau-2.0.0-py3-none-any.whl/ripe/atlas/cousteau/source.py | 0.760028 | 0.294684 | source.py | pypi |
class AtlasMeasurement(object):
"""
Parent class for creating an Atlas measurement object containing all
needed options for ATLAS API. The different kind of measurements are
specified as child classes. These objects can be passed as measurement
arguments later on when we call AtlasRequest.
To u... | /ripe.atlas.cousteau-2.0.0-py3-none-any.whl/ripe/atlas/cousteau/measurement.py | 0.857156 | 0.419529 | measurement.py | pypi |
import calendar
import requests
from dateutil import parser
from datetime import datetime
from .version import __version__
class AtlasRequest(object):
"""
Base class for doing Atlas requests. Contains functions that can be used by
most Atlas requests.
"""
http_methods = {
"GET": requests... | /ripe.atlas.cousteau-2.0.0-py3-none-any.whl/ripe/atlas/cousteau/request.py | 0.728265 | 0.156652 | request.py | pypi |
Changelog
=========
* 1.3.0
* abuf.py: error handling for NS records, extended rcode, cookies and client subnets
* 1.2.2
* Catch problems parsing SSL certificates
* 1.2.1
* Add support for non-DNS names in subjectAltName extensions
* 1.2
* Replaced pyOpenSSL with cryptography
* Added parsing of sub... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/CHANGES.rst | 0.816553 | 0.680142 | CHANGES.rst | pypi |
from datetime import datetime
from dateutil.relativedelta import relativedelta
from pytz import UTC
from .base import Result, ResultParseError, ParsingDict
class Packet(ParsingDict):
"""
Model for data structure of each packet for a NTP result.
"""
NTP_EPOCH = datetime(1900, 1, 1, tzinfo=UTC)
... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/ntp.py | 0.867514 | 0.362743 | ntp.py | pypi |
from .base import Result, ParsingDict
class Response(ParsingDict):
def __init__(self, data, **kwargs):
ParsingDict.__init__(self, **kwargs)
self.raw_data = data
self.af = self.ensure("af", int)
self.body_size = self.ensure("bsize", int)
self.head_size = self.ensure("hsi... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/http.py | 0.72662 | 0.180883 | http.py | pypi |
import logging
import pytz
from calendar import timegm
from datetime import datetime
from .helpers.compatibility import string
# Try to use ujson if it's available
try:
import ujson as json
except ImportError:
import json
class ResultParseError(Exception):
pass
class ResultError(Exception):
pass... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/base.py | 0.577019 | 0.208743 | base.py | pypi |
from __future__ import absolute_import
import base64
from collections import namedtuple
from datetime import datetime
from pytz import UTC
from .base import Result, ParsingDict
from .helpers import abuf
from .helpers import compatibility
class Header(ParsingDict):
def __init__(self, data, **kwargs):
... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/dns.py | 0.820972 | 0.198142 | dns.py | pypi |
import logging
import pytz
import codecs
from datetime import datetime
try:
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.backends import openssl
from cryptography.hazmat.primitives import hashes
except ImportError:
logging.warning(
"cryp... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/ssl.py | 0.646906 | 0.184657 | ssl.py | pypi |
import logging
from calendar import timegm
from .base import Result, ParsingDict
class IcmpHeader(ParsingDict):
"""
But why did we stop here? Why not go all the way and define subclasses for
each object and for `mpls`? it comes down to a question of complexity vs.
usefulness. This is such a frin... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/traceroute.py | 0.73412 | 0.341747 | traceroute.py | pypi |
from .base import Result, ResultParseError, ParsingDict
class Packet(ParsingDict):
def __init__(self, data, default_ttl, default_source_address, **kwargs):
ParsingDict.__init__(self, **kwargs)
self.rtt = None
self.dup = False
self.ttl = None
self.source_address = data.... | /ripe.atlas.sagan-1.3.0.tar.gz/ripe.atlas.sagan-1.3.0/ripe/atlas/sagan/ping.py | 0.651244 | 0.221098 | ping.py | pypi |
from ripe.atlas.sagan import Result
from ripe.atlas.sagan import ResultParseError
from ripe.atlas.cousteau import ProbeRequest
from ripe.atlas.cousteau import Probe as CProbe
from .exceptions import RipeAtlasToolsException
from .cache import cache
from .settings import conf
class FilterFactory(object):
@staticme... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/filters.py | 0.719679 | 0.289359 | filters.py | pypi |
import argparse
import os
import re
import sys
from dateutil import parser
from ..settings import aliases
class ArgumentType(object):
@staticmethod
def path(string):
if not os.path.exists(string) and not string == "-":
raise argparse.ArgumentTypeError(
'The file name spe... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/helpers/validators.py | 0.561575 | 0.210219 | validators.py | pypi |
import argparse
import csv
import re
from io import StringIO
from typing import (Any, Dict, Iterable, Iterator, List, Mapping, Optional,
Tuple)
from typing_extensions import Literal, NotRequired, TypedDict
from .colours import colourise
Alignment = Literal["<", "^", ">"]
LEFT: Alignment = "<"
CE... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/helpers/tabular.py | 0.842378 | 0.22213 | tabular.py | pypi |
from collections.abc import Mapping
import copy
import os
import re
import yaml
from ..helpers import xdg
class UserSettingsParser(object):
USER_CONFIG_DIR = xdg.get_config_home()
USER_RC = None
def get(self):
r = copy.deepcopy(self.DEFAULT)
if os.path.exists(self.USER_RC):
... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/settings/__init__.py | 0.628293 | 0.237366 | __init__.py | pypi |
from ..ipdetails import IP
from .base import Renderer as BaseRenderer
class Renderer(BaseRenderer):
RENDERS = [BaseRenderer.TYPE_TRACEROUTE]
DEFAULT_RADIUS = 2
@staticmethod
def add_arguments(parser):
group = parser.add_argument_group(
title="Optional arguments for traceroute_a... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/renderers/traceroute_aspath.py | 0.63409 | 0.168241 | traceroute_aspath.py | pypi |
import importlib
import os
import pkgutil
import sys
from ..exceptions import RipeAtlasToolsException
from ..helpers import xdg
class Renderer(object):
TYPE_PING = "ping"
TYPE_TRACEROUTE = "traceroute"
TYPE_DNS = "dns"
TYPE_SSLCERT = "sslcert"
TYPE_HTTP = "http"
TYPE_NTP = "ntp"
RENDER... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/renderers/base.py | 0.544075 | 0.150809 | base.py | pypi |
from ..helpers.sanitisers import sanitise
from .base import Renderer as BaseRenderer
class Renderer(BaseRenderer):
"""
This is meant to be a stub example for what an aggregate renderer might look
like. If you have ideas as to how to make this better, feel free to send
along a pull request.
"""
... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/renderers/aggregate_ping.py | 0.875721 | 0.30978 | aggregate_ping.py | pypi |
from ..helpers.sanitisers import sanitise
from .base import Renderer as BaseRenderer
class Renderer(BaseRenderer):
"""
This is meant to be a stub example for what an aggregate renderer might look
like. If you have ideas as to how to make this better, feel free to send
along a pull request.
"""
... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/renderers/ping.py | 0.859369 | 0.331918 | ping.py | pypi |
from ripe.atlas.cousteau import Measurement
from ripe.atlas.cousteau.exceptions import APIResponseError
from .base import Command as BaseCommand, MetaDataMixin
from ..exceptions import RipeAtlasToolsException
from ..helpers.colours import colourise
from ..helpers.sanitisers import sanitise
from ..helpers.validators i... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/measurement_info.py | 0.741861 | 0.289284 | measurement_info.py | pypi |
import itertools
import sys
from typing import Any, Dict, List, Mapping, Tuple
import requests
from ripe.atlas.cousteau import ProbeRequest
from ..exceptions import RipeAtlasToolsException
from ..helpers import tabular
from ..helpers.sanitisers import sanitise
from ..helpers.validators import ArgumentType
from ..set... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/probe_search.py | 0.558809 | 0.18628 | probe_search.py | pypi |
from ripe.atlas.cousteau import Probe
from ripe.atlas.cousteau.exceptions import APIResponseError
from .base import Command as BaseCommand, MetaDataMixin
from ..exceptions import RipeAtlasToolsException
from ..helpers.colours import colourise
from ..helpers.sanitisers import sanitise
from ..helpers.validators import ... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/probe_info.py | 0.627152 | 0.178562 | probe_info.py | pypi |
from ripe.atlas.cousteau import Measurement
from ripe.atlas.cousteau.exceptions import APIResponseError
from ..exceptions import RipeAtlasToolsException
from ..renderers import Renderer
from ..streaming import Stream
from .base import Command as BaseCommand
from ..helpers.validators import ArgumentType
class Comman... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/stream.py | 0.677367 | 0.206174 | stream.py | pypi |
import os
import sys
try:
import ujson as json
except ImportError:
import json
import itertools
from ripe.atlas.sagan import Result
from ripe.atlas.cousteau import AtlasLatestRequest, AtlasResultsRequest
from ..aggregators import RangeKeyAggregator, ValueKeyAggregator, aggregate
from ..exceptions import Rip... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/report.py | 0.498535 | 0.172102 | report.py | pypi |
from ...helpers.validators import ArgumentType
from ...settings import conf
from .base import Command
class HttpMeasureCommand(Command):
DESCRIPTION = "Create an HTTP measurement and wait for the results"
def add_arguments(self):
Command.add_arguments(self)
self.add_primary_argument(name=... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/measure/http.py | 0.857112 | 0.165897 | http.py | pypi |
import json
import os
import re
import webbrowser
from collections import OrderedDict
from ripe.atlas.cousteau import (
Ping,
Traceroute,
Dns,
Sslcert,
Http,
Ntp,
AtlasSource,
AtlasCreateRequest,
)
from ripe.atlas.cousteau.measurement import AtlasMeasurement
from ...exceptions import... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/measure/base.py | 0.663669 | 0.158435 | base.py | pypi |
from ripe.atlas.sagan.dns import Message
from ...exceptions import RipeAtlasToolsException
from ...helpers.validators import ArgumentType
from ...settings import conf
from .base import Command
class DnsMeasureCommand(Command):
DESCRIPTION = "Create a DNS measurement and wait for the results"
def _upper_st... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/measure/dns.py | 0.801431 | 0.156523 | dns.py | pypi |
from ...helpers.validators import ArgumentType
from ...settings import conf
from .base import Command
class TracerouteMeasureCommand(Command):
DESCRIPTION = "Create a traceroute measurement and wait for the results"
def _upper_str(self, s):
"""
Private method to validate specific command li... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/measure/traceroute.py | 0.864939 | 0.219923 | traceroute.py | pypi |
from ...exceptions import RipeAtlasToolsException
from ..base import Factory as BaseFactory
from .ping import PingMeasureCommand
from .traceroute import TracerouteMeasureCommand
from .dns import DnsMeasureCommand
from .sslcert import SslcertMeasureCommand
from .http import HttpMeasureCommand
from .ntp import NtpMeasur... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/commands/measure/__init__.py | 0.505615 | 0.182608 | __init__.py | pypi |
import itertools
class ValueKeyAggregator(object):
"""Aggregator based on tha actual value of the key/attribute"""
def __init__(self, key, prefix=None):
self.aggregation_keys = key.split(".")
self.key_prefix = prefix or self.aggregation_keys[-1].upper()
def get_key_value(self, entity):
... | /ripe.atlas.tools-3.1.0-py3-none-any.whl/ripe/atlas/tools/aggregators/base.py | 0.799168 | 0.252897 | base.py | pypi |
from textwrap import wrap
from typing import Any, Dict, List, Optional, Tuple, Union
from colorama import Back, Fore, Style
from tabulate import tabulate
from .formatters import get_formatter
TableData = List[Dict[str, Any]]
TableStructure = Tuple[
Tuple[
Union[str, Tuple[str, ...]],
Optional[st... | /ripe.stat.cli-0.1.0-py3-none-any.whl/ripe/stat/cli/filters.py | 0.84869 | 0.277657 | filters.py | pypi |
import os
import abc
import sys
from importlib import machinery
extension_suffixes = machinery.EXTENSION_SUFFIXES
# Which types with buffer interface we support (apart from byte strings)
_buffer_type = (bytearray, memoryview)
def ripemd_filename(dir_comps, filename):
"""Return the complete file name for the m... | /ripemd-hash-1.0.1.tar.gz/ripemd-hash-1.0.1/lib/ripemd/_raw_api.py | 0.52902 | 0.301092 | _raw_api.py | pypi |
from ripemd._raw_api import (load_ripemd_raw_lib,
VoidPointer, SmartPointer,
create_string_buffer,
get_raw_buffer, c_size_t,
c_uint8_ptr)
_raw_ripemd160_lib = load_ripemd_raw_lib(
... | /ripemd-hash-1.0.1.tar.gz/ripemd-hash-1.0.1/lib/ripemd/ripemd160.py | 0.845465 | 0.341239 | ripemd160.py | pypi |
from __future__ import unicode_literals
import colorfield.fields
import djangocms_attributes_field.fields
import django.core.validators
import django.db.models.deletion
from django.db import models, migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
('filer', '0007_a... | /ripiu.djangocms_aoxomoxoa-0.0.4.tar.gz/ripiu.djangocms_aoxomoxoa-0.0.4/ripiu/djangocms_aoxomoxoa/migrations/0001_initial.py | 0.660939 | 0.210868 | 0001_initial.py | pypi |
# riposte
[](https://travis-ci.org/fwkz/riposte)
[](https://github.com/fwkz/riposte/blob/master/LICENS)
[](https://pypi.org/project/riposte/)
[![... | /riposte-0.2.2.tar.gz/riposte-0.2.2/README.md | 0.466846 | 0.963022 | README.md | pypi |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from ripozo.exceptions import NotFoundException
from ripozo.manager_base import BaseManager
from ripozo.utilities import make_json_safe
from ripozo import fields
from ca... | /ripozo-cassandra-0.2.1.tar.gz/ripozo-cassandra-0.2.1/ripozo_cassandra/cqlmanager.py | 0.838184 | 0.214619 | cqlmanager.py | pypi |
# How to turn your database into a ReSTful API in under 10 lines of code
A package to turn your database into a ReSTful API in just 10 lines of code.
You can either install the package and simply start the API from the
command line or you can follow this tutorial to build it yourself.
## Installation
```bash
pip in... | /ripozo-oasis-1.0.1.tar.gz/ripozo-oasis-1.0.1/README.md | 0.516595 | 0.916931 | README.md | pypi |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from ripozo import Relationship, ListRelationship
from ripozo.resources.constructor import ResourceMetaClass
from ripozo.resources.restmixins import CRUDL
from ripozo_sq... | /ripozo-sqlalchemy-1.0.2.tar.gz/ripozo-sqlalchemy-1.0.2/ripozo_sqlalchemy/easy_resource.py | 0.79649 | 0.591841 | easy_resource.py | pypi |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from datetime import datetime, date, time, timedelta
from decimal import Decimal
from functools import wraps
from ripozo.exceptions import NotFoundException
from ripozo.... | /ripozo-sqlalchemy-1.0.2.tar.gz/ripozo-sqlalchemy-1.0.2/ripozo_sqlalchemy/alchemymanager.py | 0.828592 | 0.20268 | alchemymanager.py | pypi |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from sqlalchemy.orm import sessionmaker, scoped_session
class ScopedSessionHandler(object):
"""
A ScopedSessionHandler is injected into the AlchemyManager
i... | /ripozo-sqlalchemy-1.0.2.tar.gz/ripozo-sqlalchemy-1.0.2/ripozo_sqlalchemy/session_handlers.py | 0.792263 | 0.166981 | session_handlers.py | pypi |
from os.path import abspath, dirname, join
import numpy as np
import pandas as pd
from scipy.fftpack import next_fast_len
from scipy.io import loadmat
from scipy.ndimage import gaussian_filter1d
from scipy.signal import filtfilt, hilbert, remez
def ripple_bandpass_filter(sampling_frequency):
ORDER = 101
nyqu... | /ripple_detection-1.4.0-py3-none-any.whl/ripple_detection/core.py | 0.818338 | 0.547646 | core.py | pypi |
import numpy as np
from scipy.stats import norm
RIPPLE_FREQUENCY = 200
def simulate_time(n_samples, sampling_frequency):
return np.arange(n_samples) / sampling_frequency
def mean_squared(x):
return (np.abs(x) ** 2.0).mean()
def normalize(y, x=None):
"""normalize power in y to a (standard normal) whit... | /ripple_detection-1.4.0-py3-none-any.whl/ripple_detection/simulate.py | 0.919685 | 0.785966 | simulate.py | pypi |
from itertools import chain
import numpy as np
import pandas as pd
from scipy.stats import zscore
from ripple_detection.core import (
exclude_close_events,
exclude_movement,
gaussian_smooth,
get_envelope,
get_multiunit_population_firing_rate,
merge_overlapping_ranges,
threshold_by_zscore,
... | /ripple_detection-1.4.0-py3-none-any.whl/ripple_detection/detectors.py | 0.910162 | 0.445891 | detectors.py | pypi |
#!/usr/bin/env python
import numpy as np
import pandas as pd
from ripple_detector_CNN.external.modified_ripple_detection.core import (
exclude_close_events,
filter_band,
gaussian_smooth,
threshold_by_zscore,
)
def define_ripple_candidates(
time_x,
lfp,
samp_rate,
lo_hz=150,
hi_hz... | /ripple_detector_CNN-0.1.5-py3-none-any.whl/ripple_detector_CNN/define_ripple_candidates.py | 0.462716 | 0.325494 | define_ripple_candidates.py | pypi |
import torch.nn as nn
import math
import torch
def init_act_layer(act_str="relu"):
if act_str == "relu":
act_layer = nn.ReLU()
if act_str == "lrelu":
act_layer = nn.LeakyReLU(0.1)
return act_layer
def calc_out_len(i, k, s, p, d=1):
o = (i + 2 * p - k - (k - 1) * (d - 1)) / s + 1
... | /ripple_detector_CNN-0.1.5-py3-none-any.whl/ripple_detector_CNN/ResNet1D/modules.py | 0.940099 | 0.458409 | modules.py | pypi |
from os.path import abspath, dirname, join
import numpy as np
import pandas as pd
from scipy.fftpack import next_fast_len
from scipy.io import loadmat
from scipy.ndimage.filters import gaussian_filter1d
from scipy.signal import filtfilt, hilbert, remez
from scipy.stats import zscore
from numba import jit
def filter... | /ripple_detector_CNN-0.1.5-py3-none-any.whl/ripple_detector_CNN/external/modified_ripple_detection/core.py | 0.858006 | 0.534066 | core.py | pypi |
import hashlib
from binascii import hexlify
from ecdsa import curves, SigningKey, six
from ecdsa.util import sigencode_der
from .serialize import (
to_bytes, from_bytes, RippleBaseDecoder, serialize_object, fmt_hex)
__all__ = ('sign_transaction', 'signature_for_transaction')
tfFullyCanonicalSig = 0x80000000
d... | /ripple-python-0.2.11.tar.gz/ripple-python-0.2.11/ripple/sign.py | 0.853333 | 0.459804 | sign.py | pypi |
import importlib.resources as pkg_resources
from typing import Callable, Tuple
import jax
import jax.numpy as jnp
import numpy as np
from . import noise_resources
from .typing import Array
f_range_LIGOI = (40.0, 1e4)
r"""
LIGO-I frequency range [Hz].
References:
`<https://arxiv.org/abs/gr-qc/0010009>`_
"""
d... | /ripplegw-0.0.4-py3-none-any.whl/ripple/noise.py | 0.924364 | 0.569942 | noise.py | pypi |
from math import pi
from typing import Callable, Optional, Tuple
import warnings
from jax import random
import jax.numpy as jnp
from .constants import C, G
from .typing import Array, PRNGKeyArray
def Mc_eta_to_ms(m):
r"""
Converts chirp mass and symmetric mass ratio to binary component masses.
Args:
... | /ripplegw-0.0.4-py3-none-any.whl/ripple/__init__.py | 0.979121 | 0.719347 | __init__.py | pypi |
import jax
import jax.numpy as jnp
from .IMRPhenomD_utils import (
get_coeffs,
get_delta0,
get_delta1,
get_delta2,
get_delta3,
get_delta4,
get_transition_frequencies,
)
from .IMRPhenomD_QNMdata import fM_CUT
from ..constants import EulerGamma, gt, m_per_Mpc, C, PI
from ..typing import Arra... | /ripplegw-0.0.4-py3-none-any.whl/ripple/waveforms/IMRPhenomD.py | 0.61231 | 0.320296 | IMRPhenomD.py | pypi |
from typing import Tuple
import jax.numpy as jnp
import jax
from ..constants import gt
from ..typing import Array
from .IMRPhenomD_QNMdata import QNMData_a, QNMData_fRD, QNMData_fdamp
def EradRational0815_s(eta, s):
eta2 = eta * eta
eta3 = eta2 * eta
eta4 = eta3 * eta
return (
(
... | /ripplegw-0.0.4-py3-none-any.whl/ripple/waveforms/IMRPhenomD_utils.py | 0.7478 | 0.332907 | IMRPhenomD_utils.py | pypi |
[](https://doi.org/10.21105/joss.00925)
[](https://badge.fury.io/py/ripser)
[](https://pypi.python.org/pypi/ripser/)
[.
Depending on your preferred learning style, you can read through the entire intro guide first or start with the exerc... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/RiptableExercises.ipynb | 0.861916 | 0.99554 | RiptableExercises.ipynb | pypi |
Work with Dates and Times
=========================
In Riptable, there are three fundamental date and time classes:
- ``rt.Date``, used for date information with no time attached to it.
- ``rt.DateTimeNano``, used for data with both date and time
information (including time zone), to nanosecond precision.
- ``r... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_datetimes.rst | 0.929648 | 0.815857 | tutorial_datetimes.rst | pypi |
Merge Datasets
==============
Merging gives you more flexibility to bring data from different Datasets
together.
A merge operation connects rows in Datasets using a “key” column that
the Datasets have in common.
Riptable’s two main Dataset merge functions are ``merge_lookup()`` and
``merge_asof()``. Generally speaki... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_merge.rst | 0.855036 | 0.716343 | tutorial_merge.rst | pypi |
Riptable Categoricals -- Filtering
**********************************
.. currentmodule:: riptable
Categoricals that use base-1 indexing can be filtered when they're created or anytime
afterwards. Filters can also be applied on a one-off basis at the time of an operation.
Values or entire categories can be filtere... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/categoricals_user_guide_filters.rst | 0.905953 | 0.697673 | categoricals_user_guide_filters.rst | pypi |
Riptable Categoricals -- Invalid Categories
*******************************************
.. currentmodule:: riptable
A category set to be invalid at Categorical creation is considered to be NaN in the sense
that `~riptable.rt_categorical.Categorical.isnan` returns `True` for the category, but
it's mapped to a valid i... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/categoricals_user_guide_invalid_categories.rst | 0.921305 | 0.747524 | categoricals_user_guide_invalid_categories.rst | pypi |
Riptable Categoricals -- Final dtype of Integer Mapping Array
*************************************************************
.. currentmodule:: riptable
Final dtype from provided mapping code/index array
--------------------------------------------------
If the user provides the integer array of mapping codes, the ar... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/categoricals_user_guide_dtype.rst | 0.857976 | 0.720116 | categoricals_user_guide_dtype.rst | pypi |
Riptable Datasets, FastArrays, and Structs
===================================================
What Is a Dataset?
------------------
A Dataset is a table of data that consists of a sequence of columns of
the same length. It’s similar to a spreadsheet, a SQL table, a Pandas
DataFrame or the data.frame in R. The Datase... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_datasets.rst | 0.910766 | 0.935876 | tutorial_datasets.rst | pypi |
Riptable Categoricals -- Sorting and Display Order
**************************************************
.. currentmodule:: riptable
Whether a Categorical's categories are lexicographically sorted or considered to be
"ordered" as specified at creation depends on two parameters: ``ordered`` and ``lex``.
- ``ordered`` ... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/categoricals_user_guide_order.rst | 0.907132 | 0.720208 | categoricals_user_guide_order.rst | pypi |
Riptable Categoricals -- Constructing
*************************************
.. currentmodule:: riptable
There are many ways to construct a Categorical -- here are some of the more
common ones.
On this page:
- `From a list of strings`_
- `From a list of non-unique strings and a list of unique categories`_
- `From a... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/categoricals_user_guide_construct.rst | 0.883839 | 0.792544 | categoricals_user_guide_construct.rst | pypi |
Perform Group Operations with Categoricals
==========================================
Riptable Categoricals have two related uses:
- They efficiently store string (or other large dtype) arrays that have
repeated values. The repeated values are partitioned into groups (a.k.a.
categories), and each group is mapp... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_categoricals.rst | 0.934005 | 0.863219 | tutorial_categoricals.rst | pypi |
Working with Missing Data
=========================
When you work with real-world data, you often have to deal with missing
values. It’s useful to know how Riptable stores and represents missing
values, how to detect missing values in your data, and how you can use a
few strategies to fill in missing values so you can... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_missing_data.rst | 0.930891 | 0.956917 | tutorial_missing_data.rst | pypi |
Work with Riptable Files and Other File Formats
===============================================
SDS is Riptable’s native file format, and it’s the only data format
fully supported directly within Riptable. That said, there are ways to
get data that’s in other formats in and out of Riptable.
SDS
---
We’ll start with ... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_io.rst | 0.70028 | 0.690996 | tutorial_io.rst | pypi |
Accums
======
Accums aggregate data similarly to Categoricals, but they distinguish
themselves by providing a fancier output with overall aggregates in
summary footers and columns.
``Accum2()``
------------
``Accum2()`` is very much like a multi-key Categorical: It computes
aggregates values for pairs of groups. The... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_accums.rst | 0.904102 | 0.721081 | tutorial_accums.rst | pypi |
Concatenate Datasets
====================
Concatentating Datasets is straightforward, with two Dataset methods:
You can concatenate rows (vertically) with ``concat_rows()`` or columns
(horizontally) with ``concat_columns()``.
However, it’s good to be aware of what happens when you concatenate two
Datasets that have d... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_concat.rst | 0.915616 | 0.731299 | tutorial_concat.rst | pypi |
Instantiate with Placeholder Values and Generate Sample Data
============================================================
It’s useful to have a few tools in your back pocket for generating data
quickly – either placeholder values (like 1s or 0s) meant to temporarily
fill a certain structure you’re instantiating, or sa... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/tutorial_sample_data.rst | 0.873296 | 0.911731 | tutorial_sample_data.rst | pypi |
Riptable Categoricals -- Indexing
*********************************
Bracket indexing traverses the FastArray of indices/codes and returns the
corresponding category.
When a Categorical is indexed with a single integer, the corresponding category is
returned as a unicode string.
When multiple integers or a boolean... | /riptable-1.13.0.tar.gz/riptable-1.13.0/docs/source/tutorial/categoricals_user_guide_indexing.rst | 0.950949 | 0.697068 | categoricals_user_guide_indexing.rst | pypi |
# Adapted from https://github.com/pandas-dev/pandas/blob/main/scripts/validate_docstrings.py
# Module walking inspired by https://github.com/pyvista/numpydoc-validation/blob/main/numpydoc_validation/_validate.py
from __future__ import annotations
import argparse
import doctest
import importlib
import inspect
import i... | /riptable-1.13.0.tar.gz/riptable-1.13.0/dev_tools/validate_docstrings.py | 0.670069 | 0.349783 | validate_docstrings.py | pypi |
import json
from datetime import datetime
from typing import Any, List
from riptide.cloud.exception import RiptideClientException
_ROUTE = "api/history"
_MAX_IDENTIFIERS = 50
_MAX_TIME_DIFF = 31 # days
class RiptideHistoryApp:
"""
Raw Historic Data - The value of a point as recorded at the site at
... | /riptide-cloud-0.0.2.tar.gz/riptide-cloud-0.0.2/riptide/cloud/history.py | 0.876105 | 0.603406 | history.py | pypi |
import json
from typing import List
_ROUTE = "api/watch"
class RiptideWatchApp:
def __init__(self, client):
self._client = client
def create_watch(self, identifiers: List[str]) -> str:
"""
Create a watch for the list of interested points.
:param identifiers: list of entity ... | /riptide-cloud-0.0.2.tar.gz/riptide-cloud-0.0.2/riptide/cloud/watch.py | 0.587825 | 0.250502 | watch.py | pypi |
from datetime import datetime
from typing import List
from riptide.cloud.exception import RiptideClientException
_ROUTE = "api/alarms"
class RiptideAlarmApp:
def __init__(self, client):
self._client = client
# TODO: this should be typing.Literal
self._context = ["site_uuids", "entity_u... | /riptide-cloud-0.0.2.tar.gz/riptide-cloud-0.0.2/riptide/cloud/alarms.py | 0.415847 | 0.150153 | alarms.py | pypi |
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 0.2.4 - 2022-02-03
This version fixes a bug where all the functi... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/CHANGELOG.md | 0.91666 | 0.799403 | CHANGELOG.md | pypi |
import numpy as np
from riptide.libffa import downsample
def downsample_vertical(X, factor):
m, __ = X.shape
if not factor > 1:
raise ValueError("factor must be > 1")
if not factor < m:
raise ValueError("factor must be strictly smaller than the number of input lines")
Y = np.asconti... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/folding.py | 0.900193 | 0.528777 | folding.py | pypi |
import numpy as np
### Local module imports
import riptide.libcpp as libcpp
from .ffautils import generate_width_trials
from .periodogram import Periodogram
from .timing import timing
@timing
def ffa_search(tseries, period_min=1.0, period_max=30.0, fpmin=8, bins_min=240, bins_max=260,
ducy_max=0.20, wtsp=1.5, de... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/search.py | 0.913242 | 0.747639 | search.py | pypi |
import logging
import typing
from math import ceil
import numpy as np
from riptide.clustering import cluster1d
from riptide.timing import timing
log = logging.getLogger('riptide.peak_detection')
class Peak(typing.NamedTuple):
"""
A simple NamedTuple with the essential parameters of a peak found
in a... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/peak_detection.py | 0.91534 | 0.61973 | peak_detection.py | pypi |
import os
import pprint
import json
from astropy.coordinates import SkyCoord
import astropy.units as uu
from schema import Schema, And, Or, Optional
from .reading import PrestoInf, SigprocHeader
SCHEMA_ITEMS = {
Optional('source_name') : Or(str, None),
Optional('skycoord') : Or(SkyCoord, None),
Optional(... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/metadata.py | 0.741019 | 0.331039 | metadata.py | pypi |
import logging
from collections import namedtuple
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import astropy.units as uu
from astropy.time import Time
log = logging.getLogger('riptide.candidate')
class Candidate(object):
"""
Final data product of the riptide ... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/candidate.py | 0.819099 | 0.598782 | candidate.py | pypi |
import os
import ctypes
### Non-standard imports
import numpy as np
import numpy.ctypeslib as npct
from numpy import log, sin, cos, exp, pi
### Local imports
from .ffautils import generate_width_trials
import riptide.libcpp as libcpp
def generate_signal(nsamp, period, phi0=0.5, ducy=0.02, amplitude=10.0, stdnoise=1... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/libffa.py | 0.885012 | 0.697016 | libffa.py | pypi |
import numpy as np
import riptide.libcpp
def running_median(x, width_samples):
"""
Computes the running median of data with the specified window size.
Parameters
----------
x : ndarray
One dimensional input data.
width_samples : int
The width of the running median window in nu... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/running_medians.py | 0.869146 | 0.79909 | running_medians.py | pypi |
import pandas
class PeakCluster(list):
"""
Basic list subclass to store a cluster of Peak objects
Parameters
----------
peaks: iterable
List or iterable of Peak objects
rank: int or None, optional
Rank within the search, 0 means brightest
(default: None)
parent_fu... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/pipeline/peak_cluster.py | 0.93426 | 0.640397 | peak_cluster.py | pypi |
import logging
import multiprocessing
from riptide import TimeSeries, ffa_search, find_peaks
log = logging.getLogger('riptide.worker_pool')
class WorkerPool(object):
"""
deredden_params : dict
range_confs : list of dicts
List of dicts from the 'ranges' section of the YAML config file
loade... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/pipeline/worker_pool.py | 0.648132 | 0.162081 | worker_pool.py | pypi |
import logging
import argparse
import numpy as np
import pandas
from riptide import __version__, TimeSeries, ffa_search, find_peaks
from riptide.clustering import cluster1d
log = logging.getLogger('riptide.rseek')
help_formatter = lambda prog: argparse.ArgumentDefaultsHelpFormatter(prog, max_help_position=16)
... | /riptide-ffa-0.2.4.tar.gz/riptide-ffa-0.2.4/riptide/apps/rseek.py | 0.801819 | 0.253431 | rseek.py | pypi |
import warnings
from collections import OrderedDict
from typing import List
from dotenv import dotenv_values
from schema import Schema, Optional, Or
from configcrunch import YamlConfigDocument, ConfigcrunchError
from configcrunch import variable_helper
from riptide.config.document.common_service_command import Conta... | /riptide_lib-0.8.0b1-py3-none-any.whl/riptide/config/document/service.py | 0.666497 | 0.1929 | service.py | pypi |
from collections import OrderedDict
import os
from pathlib import PurePosixPath
from dotenv import dotenv_values
from schema import Schema, Optional, Or
from typing import TYPE_CHECKING, Union
from configcrunch import variable_helper
from riptide.config.document.common_service_command import ContainerDefinitionYamlC... | /riptide_lib-0.8.0b1-py3-none-any.whl/riptide/config/document/command.py | 0.835383 | 0.192824 | command.py | pypi |
from schema import Optional, Schema, Or
from typing import List, Union, TYPE_CHECKING, Tuple, Type
from configcrunch import YamlConfigDocument, DocReference, ConfigcrunchError, REMOVE
from configcrunch import variable_helper
from riptide.config.document.command import Command
from riptide.config.document.service impor... | /riptide_lib-0.8.0b1-py3-none-any.whl/riptide/config/document/app.py | 0.888958 | 0.245108 | app.py | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.