index int64 0 731k | package stringlengths 2 98 ⌀ | name stringlengths 1 76 | docstring stringlengths 0 281k ⌀ | code stringlengths 4 8.19k | signature stringlengths 2 42.8k ⌀ | embed_func_code listlengths 768 768 |
|---|---|---|---|---|---|---|
727,433 | d8s_lists.iterables | iterables_are_same_length | Return whether or not the given iterables are the same lengths. | def iterables_are_same_length(a: Sized, b: Sized, *args: Sized, debug_failure: bool = False) -> bool:
"""Return whether or not the given iterables are the same lengths."""
consolidated_list = [a, b, *args]
lengths_1, lengths_2 = itertools.tee(map(len, consolidated_list))
result = iterable_has_single_it... | (a: Sized, b: Sized, *args: Sized, debug_failure: bool = False) -> bool | [
-0.028398696333169937,
0.012706619687378407,
-0.018852606415748596,
0.034203749150037766,
0.02522895112633705,
0.024252228438854218,
-0.011333677917718887,
-0.006915386766195297,
-0.005984734743833542,
0.019294895231723785,
-0.025800243020057678,
0.006454668007791042,
-0.008721403777599335,
... |
727,434 | d8s_lists.iterables | iterables_have_same_items | Return whether iterables have identical items (considering both identity and count). | def iterables_have_same_items(a: Sequence, b: Sequence, *args: Sequence) -> bool: # noqa: CCR001
"""Return whether iterables have identical items (considering both identity and count)."""
first_list = a
remaining_lists = [b, *args]
if iterables_are_same_length(a, *remaining_lists):
for item in... | (a: Sequence, b: Sequence, *args: Sequence) -> bool | [
-0.007696051616221666,
-0.03069126047194004,
-0.050303179770708084,
0.03152778744697571,
0.008379216305911541,
0.028981026262044907,
-0.03989306092262268,
0.011311708949506283,
0.051158297806978226,
0.04238405451178551,
-0.018282771110534668,
-0.013254311867058277,
0.024556726217269897,
-0... |
727,436 | d8s_lists.iterables | longest | . | def longest(iterable: Iterable[Any]) -> Any:
"""."""
longest_item = max(iterable, key=len)
return longest_item
| (iterable: Iterable[Any]) -> Any | [
0.013258133083581924,
0.00246868166141212,
-0.0034544323571026325,
0.029322857037186623,
-0.0219534020870924,
-0.027050035074353218,
0.02653348445892334,
0.01847529411315918,
0.051517315208911896,
-0.05086302012205124,
-0.02474277652800083,
-0.015384599566459656,
-0.03626185655593872,
-0.0... |
727,437 | d8s_lists.iterables | nontruthy_items | Return an iterable with only elements of the given iterable which evaluate to False.
(see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)
| def nontruthy_items(iterable: Iterable[Any]) -> Iterator[Any]:
"""Return an iterable with only elements of the given iterable which evaluate to False.
(see https://docs.python.org/3.9/library/stdtypes.html#truth-value-testing)
"""
return filter(lambda x: not x, iterable)
| (iterable: Iterable[Any]) -> Iterator[Any] | [
0.004781683906912804,
-0.0010311187943443656,
-0.023912785574793816,
-0.04328406602144241,
-0.038672685623168945,
0.0026506686117500067,
-0.038952164351940155,
-0.012890895828604698,
0.04531027376651764,
0.007580824661999941,
0.008214015513658524,
0.05048060789704323,
0.014541558921337128,
... |
727,438 | d8s_lists.iterables | run_length_encoding | Perform run-length encoding on the given array.
See https://en.wikipedia.org/wiki/Run-length_encoding for more details.
| def run_length_encoding(iterable: Iterable[Any]) -> Iterator[str]:
"""Perform run-length encoding on the given array.
See https://en.wikipedia.org/wiki/Run-length_encoding for more details.
"""
run_length_encodings = (f'{len(tuple(g))}{k}' for k, g in itertools.groupby(iterable))
return run_length_... | (iterable: Iterable[Any]) -> Iterator[str] | [
-0.024343302473425865,
-0.004664791747927666,
-0.04951590299606323,
0.025189876556396484,
0.03242894262075424,
0.027349501848220825,
-0.028126968070864677,
-0.023289406672120094,
0.0801653116941452,
-0.01220620609819889,
0.017864424735307693,
0.014037568122148514,
0.03139232099056244,
0.01... |
727,441 | d8s_lists.iterables | types | Return a set containing the types of all items in the list_arg. | def types(iterable: Iterable[Any]) -> Iterator[Type]:
"""Return a set containing the types of all items in the list_arg."""
return map(type, iterable)
| (iterable: Iterable[Any]) -> Iterator[Type] | [
-0.021296150982379913,
0.014764138497412205,
-0.041089046746492386,
-0.0030288854613900185,
-0.00261504203081131,
0.043487098067998886,
0.022405698895454407,
0.0020658608991652727,
0.03530866280198097,
0.01469255518168211,
-0.007816045545041561,
0.0033085092436522245,
-0.006845191586762667,
... |
727,442 | datasette.filters | FilterArguments | null | class FilterArguments:
def __init__(
self, where_clauses, params=None, human_descriptions=None, extra_context=None
):
self.where_clauses = where_clauses
self.params = params or {}
self.human_descriptions = human_descriptions or []
self.extra_context = extra_context or {}
| (where_clauses, params=None, human_descriptions=None, extra_context=None) | [
-0.014973736368119717,
-0.04483838006854057,
0.04881419613957405,
-0.022676881402730942,
-0.027094455435872078,
-0.027499400079250336,
-0.015627169981598854,
-0.0036306940019130707,
0.019290074706077576,
-0.03280048817396164,
-0.01592167466878891,
0.030646922066807747,
-0.024425504729151726,... |
727,443 | datasette.filters | __init__ | null | def __init__(
self, where_clauses, params=None, human_descriptions=None, extra_context=None
):
self.where_clauses = where_clauses
self.params = params or {}
self.human_descriptions = human_descriptions or []
self.extra_context = extra_context or {}
| (self, where_clauses, params=None, human_descriptions=None, extra_context=None) | [
-0.014009700156748295,
-0.03960800543427467,
0.06147946044802666,
-0.02849092334508896,
-0.03997071832418442,
-0.02811007760465145,
0.001748945564031601,
0.02401144616305828,
-0.017954178154468536,
-0.027330249547958374,
-0.023721277713775635,
0.05194016918540001,
-0.011352844536304474,
0.... |
727,444 | datasette_leaflet_freedraw | extra_body_script | null | @hookimpl
def extra_body_script(request, datasette, database, table):
async def inner():
has_geometry = False
if table:
has_geometry = bool(
await geometry_columns_for_table(datasette, database, table)
)
current_geojson = None
freedraw = reques... | (request, datasette, database, table) | [
0.03761741518974304,
-0.01997184008359909,
-0.04009498283267021,
0.015007250010967255,
-0.02271418645977974,
0.00830741599202156,
-0.05461995676159859,
0.044255781918764114,
-0.043612752109766006,
-0.016104187816381454,
0.016009625047445297,
0.012416206300258636,
-0.11067728698253632,
-0.0... |
727,445 | datasette_leaflet_freedraw | extra_js_urls | null | @hookimpl
def extra_js_urls(view_name, datasette):
if view_name in ("database", "table"):
return [
{
"url": datasette.urls.static_plugins(
"datasette-leaflet-freedraw", "datasette-leaflet-freedraw.js"
),
"module": True,
... | (view_name, datasette) | [
-0.02960282936692238,
-0.07354117184877396,
0.006948242895305157,
0.026466935873031616,
-0.01659335382282734,
0.06676764041185379,
-0.03128725290298462,
0.04039030149579048,
-0.004300653003156185,
0.04920664057135582,
0.0004706639447249472,
0.028760617598891258,
-0.01003485731780529,
-0.01... |
727,446 | datasette_leaflet_freedraw | filters_from_request | null | @hookimpl
def filters_from_request(request, database, table, datasette):
async def inner():
geometry_columns = await geometry_columns_for_table(datasette, database, table)
if not geometry_columns:
return
freedraw = request.args.get("_freedraw", "")
try:
geojso... | (request, database, table, datasette) | [
0.026993928477168083,
-0.050492774695158005,
-0.05662775784730911,
0.04008189216256142,
-0.044952698051929474,
0.012325739488005638,
-0.0373118557035923,
0.015672095119953156,
-0.016806136816740036,
-0.03221796080470085,
-0.01961335726082325,
0.003790211398154497,
-0.11243751645088196,
-0.... |
727,447 | datasette_leaflet_freedraw | geometry_columns_for_table | null | from datasette import hookimpl
from datasette.filters import FilterArguments
from datasette.utils import sqlite3
from jinja2.utils import htmlsafe_json_dumps
import json
import textwrap
async def geometry_columns_for_table(datasette, database, table):
# Returns [{"column": spatial_index_enabled (boolean)}]
sq... | (datasette, database, table) | [
0.050279874354600906,
-0.07560575753450394,
-0.016939707100391388,
0.005824767053127289,
0.02162555232644081,
0.034009575843811035,
-0.006512768566608429,
-0.012820996344089508,
-0.03479054942727089,
-0.03705909475684166,
-0.00307276239618659,
0.02655312977731228,
-0.10450181365013123,
-0.... |
727,448 | jinja2.utils | htmlsafe_json_dumps | Serialize an object to a string of JSON with :func:`json.dumps`,
then replace HTML-unsafe characters with Unicode escapes and mark
the result safe with :class:`~markupsafe.Markup`.
This is available in templates as the ``|tojson`` filter.
The following characters are escaped: ``<``, ``>``, ``&``, ``'`... | def htmlsafe_json_dumps(
obj: t.Any, dumps: t.Optional[t.Callable[..., str]] = None, **kwargs: t.Any
) -> markupsafe.Markup:
"""Serialize an object to a string of JSON with :func:`json.dumps`,
then replace HTML-unsafe characters with Unicode escapes and mark
the result safe with :class:`~markupsafe.Mark... | (obj: Any, dumps: Optional[Callable[..., str]] = None, **kwargs: Any) -> markupsafe.Markup | [
-0.019685475155711174,
-0.057993803173303604,
0.027339937165379524,
-0.05691317468881607,
0.03023962676525116,
0.02885281853377819,
-0.011229545809328556,
-0.04549451917409897,
-0.010464099235832691,
0.003784456057474017,
-0.023863909766077995,
0.025935117155313492,
-0.018478771671652794,
... |
727,453 | django_urr.extract | extract_urls |
Extract URLEntry objects from the given iterable
of Django URL pattern objects. If no iterable is given,
the patterns exposed by the root resolver are used, i.e.
all of the URLs routed in the project.
:param urlpatterns: Iterable of URLPattern objects
:return: Generator of `URLEntry` objects.... | def extract_urls(urlpatterns=None):
"""
Extract URLEntry objects from the given iterable
of Django URL pattern objects. If no iterable is given,
the patterns exposed by the root resolver are used, i.e.
all of the URLs routed in the project.
:param urlpatterns: Iterable of URLPattern objects
... | (urlpatterns=None) | [
-0.04936762526631355,
-0.0003288928419351578,
-0.04193851724267006,
-0.04621225222945213,
-0.05348159372806549,
0.03311145678162575,
0.05555855110287666,
-0.028378397226333618,
-0.02668088488280773,
0.06194918230175972,
0.0011302180355414748,
0.035168442875146866,
0.025083227083086967,
-0.... |
727,454 | wxai_langchain.credentials | Credentials | null | class Credentials:
DEFAULT_API = "https://us-south.ml.cloud.ibm.com/ml/v1-beta/generation/text?version=2023-05-29"
def __init__(
self,
api_key: str,
project_id: str,
api_endpoint: str = DEFAULT_API,
):
"""
Instansiate the credentials object
Args:
... | (api_key: str, project_id: str, api_endpoint: str = 'https://us-south.ml.cloud.ibm.com/ml/v1-beta/generation/text?version=2023-05-29') | [
0.028867697343230247,
-0.1076987162232399,
-0.051369696855545044,
0.019744765013456345,
0.023519771173596382,
-0.05151773616671562,
-0.02661009505391121,
0.024037908762693405,
-0.001090056262910366,
0.034012068063020706,
0.020984595641493797,
0.04944518581032753,
-0.0019291393691673875,
0.... |
727,455 | wxai_langchain.credentials | __init__ |
Instansiate the credentials object
Args:
api_key (str): The GENAI API Key
api_endpoint (str, optional): GENAI API Endpoint. Defaults to DEFAULT_API.
| def __init__(
self,
api_key: str,
project_id: str,
api_endpoint: str = DEFAULT_API,
):
"""
Instansiate the credentials object
Args:
api_key (str): The GENAI API Key
api_endpoint (str, optional): GENAI API Endpoint. Defaults to DEFAULT_API.
"""
if api_key is None:
... | (self, api_key: str, project_id: str, api_endpoint: str = 'https://us-south.ml.cloud.ibm.com/ml/v1-beta/generation/text?version=2023-05-29') | [
-0.0166962668299675,
-0.10043195635080338,
-0.06776613742113113,
0.026470579206943512,
-0.01618756726384163,
-0.054903287440538406,
-0.02032984048128128,
0.061116695404052734,
-0.012181553058326244,
0.030958041548728943,
0.013398800045251846,
0.057919152081012726,
0.0033474289812147617,
0.... |
727,458 | openpaygo.metrics_shared | AuthMethod | null | class AuthMethod(object):
SIMPLE_AUTH = 'sa'
TIMESTAMP_AUTH = 'ta'
COUNTER_AUTH = 'ca'
DATA_AUTH = 'da'
RECURSIVE_DATA_AUTH = 'ra'
| () | [
0.0257964339107275,
-0.010300597175955772,
0.03606107831001282,
0.0321781300008297,
0.045229148119688034,
-0.050622131675481796,
0.0026111025363206863,
-0.04810540750622749,
-0.01176569052040577,
-0.026875030249357224,
0.02446616441011429,
0.054864611476659775,
-0.009019763208925724,
0.002... |
727,459 | openpaygo.metrics_request | MetricsRequestHandler | null | class MetricsRequestHandler(object):
def __init__(self, serial_number, data_format=None, secret_key=None, auth_method=None):
self.secret_key = secret_key
self.auth_method = auth_method
self.request_dict = {
'serial_number': serial_number,
}
self.data_format = dat... | (serial_number, data_format=None, secret_key=None, auth_method=None) | [
0.010868802666664124,
-0.036628562957048416,
-0.10491538047790527,
0.011916758492588997,
-0.019831322133541107,
-0.057128582149744034,
-0.07158039510250092,
0.010499523021280766,
-0.05481309816241264,
-0.00291681126691401,
0.012884870171546936,
0.021657761186361313,
0.03371424600481987,
-0... |
727,460 | openpaygo.metrics_request | __init__ | null | def __init__(self, serial_number, data_format=None, secret_key=None, auth_method=None):
self.secret_key = secret_key
self.auth_method = auth_method
self.request_dict = {
'serial_number': serial_number,
}
self.data_format = data_format
if self.data_format:
if self.data_format.get(... | (self, serial_number, data_format=None, secret_key=None, auth_method=None) | [
0.030588796362280846,
-0.007405904121696949,
-0.07227717339992523,
0.009930222295224667,
0.0047609382309019566,
-0.04024060070514679,
-0.056240323930978775,
0.014366340823471546,
-0.037586357444524765,
-0.014941736124455929,
-0.02099267579615116,
0.04231945052742958,
0.001713427365757525,
... |
727,461 | openpaygo.metrics_request | get_condensed_request_dict | null | def get_condensed_request_dict(self):
if not self.data_format:
raise ValueError('No Data Format provided for condensed request')
data_order = self.data_format.get('data_order')
if self.data and not data_order:
raise ValueError('Data Format does not contain data_order')
historical_data_or... | (self) | [
0.006412421353161335,
-0.004440115764737129,
-0.09863469749689102,
-0.04624715819954872,
-0.04904530569911003,
-0.04986143112182617,
-0.04795713722705841,
-0.039795875549316406,
0.024134021252393723,
-0.029186232015490532,
0.0011167086195200682,
-0.021879957988858223,
-0.024950148537755013,
... |
727,462 | openpaygo.metrics_request | get_condensed_request_payload | null | def get_condensed_request_payload(self):
payload = self.get_condensed_request_dict()
return OpenPAYGOMetricsShared.convert_to_metrics_json(payload)
| (self) | [
-0.01452325377613306,
-0.03386170417070389,
-0.019416114315390587,
-0.005229406990110874,
-0.015964360907673836,
-0.023903394117951393,
-0.03436220809817314,
-0.007498934864997864,
-0.0015122995246201754,
-0.017621202394366264,
0.02466277964413166,
-0.020831333473324776,
-0.00922481156885624... |
727,463 | openpaygo.metrics_request | get_simple_request_dict | null | def get_simple_request_dict(self):
simple_request = self.request_dict
simple_request['data'] = self.data
simple_request['historical_data'] = self.historical_data
# We prepare the auth
if self.auth_method:
simple_request['auth'] = OpenPAYGOMetricsShared.generate_request_signature_from_data(si... | (self) | [
0.02152204141020775,
-0.006507218815386295,
-0.01944049447774887,
0.008412119932472706,
-0.028549646958708763,
-0.03403041511774063,
-0.041898276656866074,
0.030994031578302383,
0.007237669546157122,
0.00014322565402835608,
0.01853339932858944,
0.03855634480714798,
-0.00250883586704731,
0.... |
727,464 | openpaygo.metrics_request | get_simple_request_payload | null | def get_simple_request_payload(self):
payload = self.get_simple_request_dict()
return OpenPAYGOMetricsShared.convert_to_metrics_json(payload)
| (self) | [
0.01602029986679554,
-0.031884726136922836,
0.0018715605838224292,
0.009438986890017986,
0.009785371832549572,
-0.00884147360920906,
-0.025182178243994713,
0.01775222271680832,
-0.022740164771676064,
-0.006914707366377115,
0.02793593890964985,
0.02959858439862728,
0.022636249661445618,
-0.... |
727,465 | openpaygo.metrics_request | set_data | null | def set_data(self, data):
self.data = data
| (self, data) | [
0.011876918375492096,
0.022652553394436836,
0.0001718108105706051,
0.040628887712955475,
-0.010241935960948467,
0.008793325163424015,
-0.02721017226576805,
0.011233091354370117,
0.040696658194065094,
0.0013564847176894546,
-0.022686438634991646,
-0.03142893686890602,
0.010733278468251228,
... |
727,466 | openpaygo.metrics_request | set_historical_data | null | def set_historical_data(self, historical_data):
if not self.data_format.get('historical_data_interval'):
for time_step in historical_data:
if not time_step.get('timestamp'):
raise ValueError('Historical Data objects must have a time stamp if no historical_data_interval is defined... | (self, historical_data) | [
0.006476737093180418,
0.03380497172474861,
-0.05746304988861084,
0.02194894291460514,
-0.030908429995179176,
-0.01926829293370247,
-0.0006426137406378984,
0.04749607294797897,
-0.015625128522515297,
0.045229215174913406,
0.0020655845291912556,
-0.02819179743528366,
0.015544169582426548,
-0... |
727,467 | openpaygo.metrics_request | set_request_count | null | def set_request_count(self, request_count):
self.request_dict['request_count'] = request_count
| (self, request_count) | [
-0.00451403995975852,
0.016463469713926315,
-0.07106631249189377,
0.023507075384259224,
-0.021037127822637558,
0.07297413796186447,
-0.04517446458339691,
0.008155081421136856,
0.0002882491098716855,
-0.038258615881204605,
-0.02860027365386486,
-0.022127311676740646,
-0.03921252489089966,
0... |
727,468 | openpaygo.metrics_request | set_timestamp | null | def set_timestamp(self, timestamp):
self.request_dict['timestamp'] = timestamp
| (self, timestamp) | [
0.022935902699828148,
0.07942492514848709,
-0.045463450253009796,
0.045803748071193695,
-0.01898847706615925,
-0.019532950595021248,
-0.07452467083930969,
0.11243356764316559,
0.007401422597467899,
0.011510488577187061,
-0.042094528675079346,
-0.045463450253009796,
-0.024263054132461548,
-... |
727,469 | openpaygo.metrics_response | MetricsResponseHandler | null | class MetricsResponseHandler(object):
def __init__(self, received_metrics, data_format=None, secret_key=None, last_request_count=None, last_request_timestamp=None):
self.received_metrics = received_metrics
self.request_dict = json.loads(received_metrics)
# We convert the base variable names... | (received_metrics, data_format=None, secret_key=None, last_request_count=None, last_request_timestamp=None) | [
0.02939097210764885,
-0.03611480072140694,
-0.08208847045898438,
-0.0007547549903392792,
-0.009188545867800713,
-0.04888182505965233,
-0.07012582570314407,
0.00576991168782115,
-0.03281475976109505,
-0.009492767974734306,
0.000910088827367872,
0.03848670423030853,
0.02986535243690014,
-0.0... |
727,470 | openpaygo.metrics_response | __init__ | null | def __init__(self, received_metrics, data_format=None, secret_key=None, last_request_count=None, last_request_timestamp=None):
self.received_metrics = received_metrics
self.request_dict = json.loads(received_metrics)
# We convert the base variable names to simple
self.request_dict = OpenPAYGOMetricsShar... | (self, received_metrics, data_format=None, secret_key=None, last_request_count=None, last_request_timestamp=None) | [
0.002896276768296957,
-0.07370196282863617,
-0.052001435309648514,
0.019396208226680756,
-0.029103385284543037,
-0.03155285865068436,
-0.05098535865545273,
0.05878738686442375,
-0.0578438863158226,
0.025347525253891945,
-0.007606978993862867,
0.08375388383865356,
0.021863827481865883,
-0.0... |
727,471 | openpaygo.metrics_response | _fill_timestamp_in_historical_data | null | def _fill_timestamp_in_historical_data(self, historical_data):
last_timestamp = datetime.fromtimestamp(self.get_data_timestamp())
for idx, time_step in enumerate(historical_data):
if time_step.get('relative_time') is not None:
last_timestamp = last_timestamp + timedelta(seconds=int(time_step... | (self, historical_data) | [
0.00246242294088006,
0.01536588929593563,
-0.07343841344118118,
0.054367344826459885,
-0.02450411207973957,
-0.025372657924890518,
-0.040692348033189774,
0.07924105226993561,
0.0030768737196922302,
0.05100403353571892,
0.005252860952168703,
-0.030121946707367897,
-0.002850497141480446,
-0.... |
727,472 | openpaygo.metrics_response | _get_simple_data | null | def _get_simple_data(self):
data = copy.deepcopy(self.request_dict.get('data'))
# If no data or not condensed in list, we just return it
if not data:
return {}
if not isinstance(data, list):
return data
data_order = self.data_format.get('data_order')
if not data_order:
ra... | (self) | [
0.04004263877868652,
-0.006603362038731575,
-0.026284869760274887,
-0.04779401421546936,
-0.003106519114226103,
-0.01180155761539936,
0.008421812206506729,
-0.034954652190208435,
0.053377941250801086,
-0.024007216095924377,
-0.02650528959929943,
-0.001971135614439845,
-0.038242559880018234,
... |
727,473 | openpaygo.metrics_response | _get_simple_historical_data | null | def _get_simple_historical_data(self):
historical_data = copy.deepcopy(self.request_dict.get('historical_data'))
if not historical_data:
return []
historical_data_order = self.data_format.get('historical_data_order')
clean_historical_data = []
for time_step in historical_data:
time_s... | (self) | [
0.010536037385463715,
-0.00012438053090590984,
-0.12109443545341492,
-0.04837804660201073,
-0.015631409361958504,
-0.02250923030078411,
-0.02551419474184513,
0.00628056051209569,
0.03744072839617729,
0.0016494637820869684,
-0.01537944097071886,
0.005314679350703955,
-0.04468250274658203,
-... |
727,474 | openpaygo.metrics_response | add_extra_data_to_answer | null | def add_extra_data_to_answer(self, extra_data_dict):
if not self.response_dict.get('extra_data'):
self.response_dict['extra_data'] = {}
self.response_dict['extra_data'].update(extra_data_dict)
| (self, extra_data_dict) | [
-0.013003294356167316,
-0.006224797107279301,
-0.013505084440112114,
0.015789097175002098,
-0.0017541036941111088,
0.01822018437087536,
-0.014681696891784668,
0.02418976090848446,
0.03941650688648224,
-0.01863545924425125,
0.046130117028951645,
-0.015365170314908028,
0.005121723283082247,
... |
727,475 | openpaygo.metrics_response | add_new_base_url_to_answer | null | def add_new_base_url_to_answer(self, new_base_url):
self.add_settings_to_answer({'base_url': new_base_url})
| (self, new_base_url) | [
-0.07347768545150757,
-0.020802905783057213,
0.018403220921754837,
0.02009313926100731,
-0.02651483193039894,
0.04485045745968819,
0.0008380943327210844,
0.012556100264191628,
0.014837490394711494,
0.009742384776473045,
0.013384160585701466,
0.01855531334877014,
0.018403220921754837,
0.066... |
727,476 | openpaygo.metrics_response | add_settings_to_answer | null | def add_settings_to_answer(self, settings_dict):
if not self.response_dict.get('settings'):
self.response_dict['settings'] = {}
self.response_dict['settings'].update(settings_dict)
| (self, settings_dict) | [
-0.017376268282532692,
-0.019499553367495537,
-0.006681846920400858,
-0.029257996007800102,
0.0053082117810845375,
0.055465396493673325,
-0.04475364089012146,
0.04648693650960922,
0.0078951520845294,
0.01583363674581051,
0.0027689365670084953,
0.020764857530593872,
-0.004658226855099201,
0... |
727,477 | openpaygo.metrics_response | add_time_to_answer | null | def add_time_to_answer(self, target_datetime):
data = self._get_simple_data()
if data.get('active_until_timestamp_requested', False):
target_timestamp = 0
if target_datetime:
if target_datetime.year > 1970:
target_timestamp = target_datetime.timestamp()
self.r... | (self, target_datetime) | [
0.04555489122867584,
0.010849501006305218,
-0.022498536854982376,
0.012773962691426277,
0.011760598979890347,
-0.02155025117099285,
-0.012262633070349693,
0.07653221487998962,
-0.005680415779352188,
-0.01817547157406807,
-0.027481684461236,
-0.05195116996765137,
0.017338749021291733,
0.003... |
727,478 | openpaygo.metrics_response | add_tokens_to_answer | null | def add_tokens_to_answer(self, token_list):
self.response_dict['token_list'] = token_list
| (self, token_list) | [
-0.007740961387753487,
-0.006560422480106354,
-0.053765106946229935,
-0.014672410674393177,
0.004294209647923708,
0.07326086610555649,
-0.023695100098848343,
-0.011552414856851101,
-0.009823769330978394,
0.050392139703035355,
0.025263529270887375,
-0.027219850569963455,
-0.015212085098028183... |
727,479 | openpaygo.metrics_response | data_format_available | null | def data_format_available(self):
return self.data_format != None
| (self) | [
0.08413565158843994,
-0.011232509277760983,
0.015267891809344292,
-0.006281884852796793,
0.05132008716464043,
0.022198766469955444,
0.028721941635012627,
-0.009102492593228817,
0.01386174838989973,
-0.029920076951384544,
0.019236711785197258,
-0.0143110491335392,
0.008233013562858105,
-0.0... |
727,480 | openpaygo.metrics_response | expects_time_answer | null | def expects_time_answer(self):
data = self._get_simple_data()
if data.get('active_until_timestamp_requested', False) or data.get('active_seconds_left_requested', False):
return True
return False
| (self) | [
0.06105611100792885,
0.03750687837600708,
0.02655734494328499,
0.017507221549749374,
0.03540979325771332,
-0.004748521838337183,
0.01241921167820692,
0.027984051033854485,
-0.018392466008663177,
-0.02310231141746044,
0.0364755243062973,
-0.0031005055643618107,
0.010425262153148651,
-0.0258... |
727,481 | openpaygo.metrics_response | expects_token_answer | null | def expects_token_answer(self):
return self.get_token_count() is not None
| (self) | [
0.027499418705701828,
-0.004690634086728096,
0.02157440595328808,
0.02780069038271904,
0.047266192734241486,
0.05449671670794487,
0.01996762305498123,
-0.019432028755545616,
0.022361060604453087,
-0.02743246965110302,
0.06222935765981674,
-0.0013682759599760175,
-0.002021031454205513,
-0.0... |
727,482 | openpaygo.metrics_response | get_answer_dict | null | def get_answer_dict(self):
# If there is not data format, we just return the full response
condensed_answer = copy.deepcopy(self.response_dict)
if self.secret_key:
condensed_answer['auth'] = OpenPAYGOMetricsShared.generate_response_signature_from_data(
serial_number=self.request_dict.get... | (self) | [
0.037748172879219055,
-0.043192971497774124,
-0.02464776672422886,
-0.0469202846288681,
-0.020792556926608086,
-0.043046802282333374,
-0.039063695818185806,
-0.019879000261425972,
0.029672330245375633,
0.0052803591825068,
0.023387057706713676,
0.007207964546978474,
-0.009638026356697083,
0... |
727,483 | openpaygo.metrics_response | get_answer_payload | null | def get_answer_payload(self):
payload = self.get_answer_dict()
return OpenPAYGOMetricsShared.convert_to_metrics_json(payload)
| (self) | [
0.009313907474279404,
-0.05533354729413986,
0.025209413841366768,
-0.03275333344936371,
-0.00777590973302722,
-0.006083253305405378,
-0.026481054723262787,
0.003544268198311329,
-0.0035184917505830526,
0.0005353993037715554,
0.049422137439250946,
0.000060480790125438944,
0.014821485616266727... |
727,484 | openpaygo.metrics_response | get_data_format_id | null | def get_data_format_id(self):
return self.request_dict.get('data_format_id')
| (self) | [
0.05560552701354027,
-0.012245229445397854,
0.025382893159985542,
-0.01324921753257513,
0.007130893878638744,
0.018947068601846695,
0.05083443596959114,
0.009825359098613262,
0.015051248483359814,
-0.01838071644306183,
-0.03140682354569435,
-0.06082283332943916,
-0.026721544563770294,
-0.0... |
727,485 | openpaygo.metrics_response | get_data_timestamp | null | def get_data_timestamp(self):
return self.request_dict.get('data_collection_timestamp', self.timestamp)
| (self) | [
0.03297452628612518,
0.022944053635001183,
-0.01994009129703045,
0.06916017830371857,
0.036807164549827576,
-0.020665185526013374,
-0.00042620868771336973,
0.025861695408821106,
0.057938482612371445,
-0.008727027103304863,
-0.038257353007793427,
-0.06038999184966087,
-0.03293999657034874,
... |
727,486 | openpaygo.metrics_response | get_device_serial | null | def get_device_serial(self):
return self.request_dict.get('serial_number')
| (self) | [
0.05052725598216057,
0.07389441877603531,
-0.012149231508374214,
0.003941092174500227,
0.0398935042321682,
-0.01916784606873989,
0.016145354136824608,
0.018236545845866203,
0.029124289751052856,
-0.06600376963615417,
-0.027634209021925926,
-0.017711631953716278,
-0.00032198638655245304,
-0... |
727,487 | openpaygo.metrics_response | get_request_count | null | def get_request_count(self):
return self.request_dict.get('request_count')
| (self) | [
0.013517803512513638,
-0.0213730838149786,
-0.034983303397893906,
0.036898814141750336,
0.019541585817933083,
0.0651274174451828,
-0.004721569828689098,
-0.013215354643762112,
0.04204045236110687,
-0.06069149449467659,
-0.014357940293848515,
-0.03568901866674423,
-0.03488248586654663,
-0.0... |
727,488 | openpaygo.metrics_response | get_request_timestamp | null | def get_request_timestamp(self):
return self.request_timestamp
| (self) | [
0.01879234053194523,
0.05938795208930969,
0.007912336848676205,
0.059111084789037704,
0.018601994961500168,
-0.0405610017478466,
-0.02760016918182373,
0.0691475123167038,
0.023550990968942642,
-0.03609652444720268,
-0.028119295835494995,
-0.05302001163363457,
-0.011360195465385914,
-0.0144... |
727,489 | openpaygo.metrics_response | get_simple_metrics | null | def get_simple_metrics(self):
# We start the process by making a copy of the dict to work with
simple_dict = copy.deepcopy(self.request_dict)
simple_dict.pop('auth') if 'auth' in simple_dict else None # We remove the auth
# We process the data and replace it
simple_dict['data'] = self._get_simple_da... | (self) | [
0.03333083540201187,
0.006292229052633047,
-0.03496681526303291,
0.03342072293162346,
0.011667590588331223,
-0.026858828961849213,
-0.04102533310651779,
-0.0008359675412066281,
-0.004065229557454586,
0.01134398952126503,
-0.03058023191988468,
0.04933107644319534,
0.023766648024320602,
0.01... |
727,490 | openpaygo.metrics_response | get_token_count | null | def get_token_count(self):
data = self._get_simple_data()
return data.get('token_count')
| (self) | [
-0.004087087698280811,
-0.051619403064250946,
0.02816055156290531,
0.060062602162361145,
0.0863524079322815,
0.07807476073503494,
-0.004606510046869516,
0.008244535885751247,
0.035461436957120895,
-0.03933537378907204,
0.018392929807305336,
-0.015653029084205627,
-0.029551196843385696,
-0.... |
727,491 | openpaygo.metrics_response | is_auth_valid | null | def is_auth_valid(self):
auth_string = self.request_dict.get('auth', None)
if not auth_string:
return False
elif not self.secret_key:
raise ValueError('Secret key is required to check the auth.')
self.auth_method = auth_string[:2]
new_signature = OpenPAYGOMetricsShared.generate_reque... | (self) | [
0.026214180514216423,
-0.004557241685688496,
-0.0356830395758152,
0.07654464989900589,
0.015564079396426678,
-0.027121376246213913,
-0.0066007948480546474,
0.012625142931938171,
-0.045699991285800934,
-0.0050084772519767284,
0.025250285863876343,
0.040937215089797974,
0.020884405821561813,
... |
727,492 | openpaygo.metrics_response | set_device_parameters | null | def set_device_parameters(self, secret_key=None, data_format=None, last_request_count=None, last_request_timestamp=None):
if secret_key:
self.secret_key = secret_key
if data_format:
self.data_format = data_format
if last_request_count:
self.last_request_count = last_request_count
... | (self, secret_key=None, data_format=None, last_request_count=None, last_request_timestamp=None) | [
0.03004327602684498,
-0.013205534778535366,
-0.04073912277817726,
0.020698102191090584,
-0.01486649364233017,
-0.004045164678245783,
-0.03040832281112671,
-0.0029043962713330984,
0.008487316779792309,
0.009472941048443317,
-0.05592503026127815,
-0.007807418704032898,
-0.024567587301135063,
... |
727,493 | openpaygo.token_decode | OpenPAYGOTokenDecoder | null | class OpenPAYGOTokenDecoder(object):
MAX_TOKEN_JUMP = 64
MAX_TOKEN_JUMP_COUNTER_SYNC = 100
MAX_UNUSED_OLDER_TOKENS = 8*2
@classmethod
def decode_token(cls, token, secret_key, count, used_counts=None, starting_code=None, value_divider=1, restricted_digit_set=False):
secret_key = OpenPAYGOTok... | () | [
0.06857452541589737,
-0.05746401473879814,
-0.06096840649843216,
0.0950167328119278,
0.04197302460670471,
-0.01101094949990511,
-0.06913203746080399,
-0.05065435171127319,
-0.010702324099838734,
-0.07745496183633804,
0.02719883807003498,
0.042769476771354675,
0.039723046123981476,
-0.01591... |
727,494 | openpaygo.token_encode | OpenPAYGOTokenEncoder | null | class OpenPAYGOTokenEncoder(object):
@classmethod
def generate_token(cls, secret_key, count, value=None, token_type=TokenType.ADD_TIME, starting_code=None, value_divider=1, restricted_digit_set=False, extended_token=False):
secret_key = OpenPAYGOTokenShared.load_secret_key_from_hex(secret_key)
... | () | [
0.03425157070159912,
-0.08081023395061493,
-0.05752143636345863,
0.08543012291193008,
0.05630965903401375,
-0.021016718819737434,
-0.08868677169084549,
-0.025011789053678513,
-0.0139543442055583,
-0.06297442317008972,
0.04506287723779678,
0.04824378341436386,
0.043245214968919754,
0.006522... |
727,495 | openpaygo.token_shared | TokenType | null | class TokenType(object):
ADD_TIME = 1
SET_TIME = 2
DISABLE_PAYG = 3
COUNTER_SYNC = 4
INVALID = 10
ALREADY_USED = 11
| () | [
0.06143351271748543,
0.0006230634753592312,
-0.004592712502926588,
-0.025510231032967567,
0.033729229122400284,
-0.015071061439812183,
-0.017212877050042152,
-0.056418534368276596,
-0.02566695027053356,
-0.05854293331503868,
0.03331131115555763,
0.049731891602277756,
0.009690405800938606,
... |
727,496 | openpaygo | decode_token | null | def decode_token(**kwargs):
return OpenPAYGOTokenDecoder.decode_token(**kwargs)
| (**kwargs) | [
0.05263620242476463,
-0.040790412575006485,
0.02709371969103813,
0.0499567985534668,
-0.03322814404964447,
-0.03655977547168732,
-0.027587292715907097,
0.026282846927642822,
0.030125677585601807,
-0.024696355685591698,
0.03846356272697449,
0.073895163834095,
0.00014377562911249697,
-0.0034... |
727,497 | openpaygo | generate_token | null | def generate_token(**kwargs):
return OpenPAYGOTokenEncoder.generate_token(**kwargs)
| (**kwargs) | [
-0.008922247216105461,
-0.07396718114614487,
0.04391144961118698,
0.030248166993260384,
0.014809180982410908,
-0.028603674843907356,
-0.06081123650074005,
0.012036286294460297,
0.0213434137403965,
-0.03290734812617302,
0.06368035078048706,
0.0834842398762703,
0.02347775548696518,
0.0096307... |
727,505 | chiabip158 | PyBIP158 | null | from chiabip158 import PyBIP158
| null | [
-0.0388394333422184,
-0.06084844842553139,
-0.02604091726243496,
0.03880244493484497,
-0.07039184868335724,
-0.019845101982355118,
-0.029610445722937584,
0.023950984701514244,
0.002966130618005991,
-0.03514043986797333,
0.029887869954109192,
0.06258697807788849,
0.0013975261244922876,
0.02... |
727,506 | stream_chat.client | StreamChat | null | class StreamChat(StreamChatInterface):
def __init__(
self, api_key: str, api_secret: str, timeout: float = 6.0, **options: Any
):
super().__init__(
api_key=api_key, api_secret=api_secret, timeout=timeout, **options
)
self.session = requests.Session()
self.sess... | (api_key: str, api_secret: str, timeout: float = 6.0, **options: Any) | [
-0.015790468081831932,
-0.07859858125448227,
-0.04463782161474228,
-0.011438173241913319,
-0.009840902872383595,
-0.0201106034219265,
-0.04365158453583717,
0.041507598012685776,
-0.03509707748889923,
0.0021399676334112883,
-0.0003058532311115414,
-0.01680886186659336,
-0.0005664817290380597,... |
727,507 | stream_chat.client | __init__ | null | def __init__(
self, api_key: str, api_secret: str, timeout: float = 6.0, **options: Any
):
super().__init__(
api_key=api_key, api_secret=api_secret, timeout=timeout, **options
)
self.session = requests.Session()
self.session.mount("http://", requests.adapters.HTTPAdapter(max_retries=1))
... | (self, api_key: str, api_secret: str, timeout: float = 6.0, **options: Any) | [
-0.006214258261024952,
-0.07134681195020676,
-0.009016767144203186,
0.013525150716304779,
-0.02780013531446457,
0.03486733138561249,
-0.06572304666042328,
0.02648792415857315,
-0.017302444204688072,
-0.0008781271753832698,
0.029824690893292427,
0.012025480158627033,
0.028793668374419212,
0... |
727,508 | stream_chat.client | _make_request | null | def _make_request(
self,
method: Callable[..., requests.Response],
relative_url: str,
params: Dict = None,
data: Any = None,
) -> StreamResponse:
params = params or {}
data = data or {}
serialized = None
default_params = self.get_default_params()
default_params.update(params)
... | (self, method: Callable[..., requests.models.Response], relative_url: str, params: Optional[Dict] = None, data: Optional[Any] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.0023122839629650116,
-0.03494630753993988,
-0.019745033234357834,
0.008833548054099083,
-0.024159498512744904,
0.016965214163064957,
-0.058219220489263535,
0.06605073809623718,
-0.03834489360451698,
0.012901689857244492,
0.054562050849199295,
0.038307953625917435,
0.07052061706781387,
-... |
727,509 | stream_chat.client | _parse_response | null | def _parse_response(self, response: requests.Response) -> StreamResponse:
try:
parsed_result = json.loads(response.text) if response.text else {}
except ValueError:
raise StreamAPIException(response.text, response.status_code)
if response.status_code >= 399:
raise StreamAPIException(... | (self, response: requests.models.Response) -> stream_chat.types.stream_response.StreamResponse | [
-0.01928030513226986,
-0.005709719378501177,
-0.06085346266627312,
-0.014158974401652813,
-0.042514581233263016,
0.043154746294021606,
-0.010506260208785534,
0.08909609913825989,
-0.03255434334278107,
0.033702876418828964,
0.07102081179618835,
0.04368194192647934,
0.048539675772190094,
-0.... |
727,510 | stream_chat.client | _query_flag_reports |
Note: Do not use this.
It is present for internal usage only.
This function can, and will, break and/or be removed at any point in time.
| def _query_flag_reports(self, **options: Any) -> StreamResponse:
"""
Note: Do not use this.
It is present for internal usage only.
This function can, and will, break and/or be removed at any point in time.
"""
data = {"filter_conditions": options}
return self.post("moderation/reports", data=... | (self, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
0.0008184090838767588,
-0.04444413259625435,
-0.015212533995509148,
-0.003737997030839324,
0.007526422385126352,
0.013800541870296001,
-0.03893063962459564,
-0.028391126543283463,
-0.018271850422024727,
-0.017750758677721024,
0.004492320120334625,
-0.013733304105699062,
-0.01162372063845396,... |
727,511 | stream_chat.client | _review_flag_report |
Note: Do not use this.
It is present for internal usage only.
This function can, and will, break and/or be removed at any point in time.
| def _review_flag_report(
self, report_id: str, review_result: str, user_id: str, **details: Any
) -> StreamResponse:
"""
Note: Do not use this.
It is present for internal usage only.
This function can, and will, break and/or be removed at any point in time.
"""
data = {
"review_resul... | (self, report_id: str, review_result: str, user_id: str, **details: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.016633426770567894,
-0.026491837576031685,
-0.0006557489978149533,
0.06602685153484344,
-0.01701357215642929,
-0.04386020824313164,
-0.010103392414748669,
0.025630176067352295,
-0.030090536922216415,
0.017621802166104317,
0.006935522425919771,
-0.020831910893321037,
-0.025393642485141754,... |
727,512 | stream_chat.client | add_device | null | def add_device(
self,
device_id: str,
push_provider: str,
user_id: str,
push_provider_name: str = None,
) -> StreamResponse:
return self.post(
"devices",
data={
"id": device_id,
"push_provider": push_provider,
"user_id": user_id,
"p... | (self, device_id: str, push_provider: str, user_id: str, push_provider_name: Optional[str] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.0707264095544815,
0.023592932149767876,
-0.03827957808971405,
0.008063684217631817,
0.022492744028568268,
-0.0019624396227300167,
-0.010242232121527195,
0.039781421422958374,
-0.03363433852791786,
-0.004610314033925533,
0.008251414634287357,
-0.04529982805252075,
-0.022667378187179565,
... |
727,513 | stream_chat.client | add_segment_targets | null | def add_segment_targets(
self, segment_id: str, target_ids: List[str]
) -> StreamResponse:
return self.post(
f"segments/{segment_id}/addtargets", data={"target_ids": target_ids}
)
| (self, segment_id: str, target_ids: List[str]) -> stream_chat.types.stream_response.StreamResponse | [
-0.07103818655014038,
0.057866230607032776,
-0.05088057741522789,
-0.042956553399562836,
-0.07500019669532776,
0.06773650646209717,
-0.03518892452120781,
0.06610304862260818,
-0.06558173149824142,
0.015743784606456757,
-0.02422388270497322,
0.023563547059893608,
0.051228124648332596,
-0.04... |
727,514 | stream_chat.client | ban_user | null | def ban_user(self, target_id: str, **options: Any) -> StreamResponse:
data = {"target_user_id": target_id, **options}
return self.post("moderation/ban", data=data)
| (self, target_id: str, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
0.0023316743317991495,
-0.012620512396097183,
0.02992170862853527,
-0.013149255886673927,
-0.06435074657201767,
-0.015636952593922615,
0.025743763893842697,
0.039907168596982956,
-0.013443966396152973,
0.009170674718916416,
-0.06764455884695053,
-0.03793087974190712,
0.004201781004667282,
... |
727,515 | stream_chat.client | campaign | null | def campaign( # type: ignore
self, campaign_id: Optional[str] = None, data: Optional[CampaignData] = None
) -> Campaign:
return Campaign(client=self, campaign_id=campaign_id, data=data)
| (self, campaign_id: Optional[str] = None, data: Optional[stream_chat.types.campaign.CampaignData] = None) -> stream_chat.campaign.Campaign | [
-0.06718457490205765,
0.02441300079226494,
-0.022122617810964584,
-0.0025078810285776854,
-0.041333429515361786,
-0.008659956976771355,
0.0438191182911396,
-0.008145065046846867,
0.026951953768730164,
-0.020080802962183952,
-0.0816015675663948,
0.014994021505117416,
-0.010280093178153038,
... |
727,516 | stream_chat.client | channel | null | def channel( # type: ignore
self, channel_type: str, channel_id: str = None, data: Dict = None
) -> Channel:
return Channel(self, channel_type, channel_id, data)
| (self, channel_type: str, channel_id: Optional[str] = None, data: Optional[Dict] = None) -> stream_chat.channel.Channel | [
-0.038490042090415955,
-0.02751590497791767,
-0.005281191784888506,
-0.010087971575558186,
-0.02594049833714962,
-0.0013975019101053476,
0.022091494873166084,
0.05832584202289581,
0.01885117031633854,
-0.010920430533587933,
0.0073891934007406235,
0.02790975756943226,
-0.04783506691455841,
... |
727,517 | stream_chat.client | check_push | null | def check_push(self, push_data: Dict) -> StreamResponse:
return self.post("check_push", data=push_data)
| (self, push_data: Dict) -> stream_chat.types.stream_response.StreamResponse | [
-0.015568406321108341,
-0.03543447330594063,
-0.09791194647550583,
0.012485302053391933,
0.0056183855049312115,
0.020995691418647766,
-0.02201489917933941,
0.014761533588171005,
0.017649291083216667,
-0.03385470062494278,
0.01311381347477436,
-0.03217300772666931,
0.05748334899544716,
-0.0... |
727,518 | stream_chat.client | check_sns | null | def check_sns(
self, sns_key: str = None, sns_secret: str = None, sns_topic_arn: str = None
) -> StreamResponse:
data = {
"sns_key": sns_key,
"sns_secret": sns_secret,
"sns_topic_arn": sns_topic_arn,
}
return self.post("check_sns", data=data)
| (self, sns_key: Optional[str] = None, sns_secret: Optional[str] = None, sns_topic_arn: Optional[str] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.06074972078204155,
-0.04458019137382507,
-0.006962366867810488,
-0.020816950127482414,
0.022974057123064995,
0.04391377046704292,
0.0037420529406517744,
0.05415564030408859,
0.05156009644269943,
0.03788088634610176,
-0.03819655999541283,
0.04861380532383919,
0.07969016581773758,
-0.0262... |
727,519 | stream_chat.client | check_sqs | null | def check_sqs(
self, sqs_key: str = None, sqs_secret: str = None, sqs_url: str = None
) -> StreamResponse:
data = {"sqs_key": sqs_key, "sqs_secret": sqs_secret, "sqs_url": sqs_url}
return self.post("check_sqs", data=data)
| (self, sqs_key: Optional[str] = None, sqs_secret: Optional[str] = None, sqs_url: Optional[str] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.028421873226761818,
-0.0932910293340683,
-0.020308848470449448,
0.0042164078913629055,
-0.02574089542031288,
0.04720624163746834,
-0.0012364478316158056,
0.00740773556753993,
0.035501059144735336,
0.035430967807769775,
-0.04331619665026665,
0.02975360117852688,
0.04415728896856308,
0.00... |
727,520 | stream_chat.client | commit_message | null | def commit_message(self, message_id: str) -> StreamResponse:
return self.post(f"messages/{message_id}/commit")
| (self, message_id: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.03949322551488876,
-0.01692311465740204,
-0.04374634101986885,
0.005812294781208038,
0.02003253623843193,
-0.037098612636327744,
0.020246978849172592,
0.0685502290725708,
0.033721137791872025,
-0.031648192554712296,
-0.014823362231254578,
-0.056648653000593185,
-0.01662825606763363,
0.0... |
727,521 | stream_chat.client | create_blocklist | null | def create_blocklist(
self, name: str, words: Iterable[str], type: str = "word"
) -> StreamResponse:
return self.post(
"blocklists", data={"name": name, "words": words, "type": type}
)
| (self, name: str, words: Iterable[str], type: str = 'word') -> stream_chat.types.stream_response.StreamResponse | [
0.013075994327664375,
-0.03880617767572403,
-0.046702392399311066,
-0.049638163298368454,
-0.053417548537254333,
0.0244816355407238,
-0.02417793497443199,
0.012713241390883923,
-0.0478159599006176,
0.030741240829229355,
-0.004040904343128204,
0.054834816604852676,
-0.07545270770788193,
-0.... |
727,522 | stream_chat.client | create_campaign | null | def create_campaign(
self, campaign_id: Optional[str] = None, data: CampaignData = None
) -> StreamResponse:
payload = {"id": campaign_id}
if data is not None:
payload.update(cast(dict, data))
return self.post("campaigns", data=payload)
| (self, campaign_id: Optional[str] = None, data: Optional[stream_chat.types.campaign.CampaignData] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.08991894125938416,
0.03427238389849663,
-0.020812619477510452,
-0.027288047596812248,
-0.026656297966837883,
0.03381612151861191,
-0.0007606213912367821,
-0.011968133971095085,
-0.011880391277372837,
-0.02562093175947666,
-0.05959498882293701,
0.00703259464353323,
0.012126071378588676,
... |
727,523 | stream_chat.client | create_channel_type | null | def create_channel_type(self, data: Dict) -> StreamResponse:
if "commands" not in data or not data["commands"]:
data["commands"] = ["all"]
return self.post("channeltypes", data=data)
| (self, data: Dict) -> stream_chat.types.stream_response.StreamResponse | [
-0.060242850333452225,
-0.005879688076674938,
-0.01134126540273428,
-0.0818801000714302,
0.01225588284432888,
0.036027245223522186,
0.0064241038635373116,
0.0197383314371109,
0.019337641075253487,
-0.008505948819220066,
0.02982526272535324,
0.034023795276880264,
-0.04146268963813782,
-0.01... |
727,524 | stream_chat.client | create_command | null | def create_command(self, data: Dict) -> StreamResponse:
return self.post("commands", data=data)
| (self, data: Dict) -> stream_chat.types.stream_response.StreamResponse | [
-0.017484376206994057,
-0.010909495875239372,
-0.02595618925988674,
-0.10643410682678223,
0.031071892008185387,
0.017647461965680122,
-0.03388724476099014,
0.06715648621320724,
0.016686121001839638,
0.011098330840468407,
0.05204971134662628,
0.004991244524717331,
-0.01490077469497919,
-0.0... |
727,525 | stream_chat.client | create_import | null | def create_import(
self, path: str, mode: Literal["insert", "upsert"] = "upsert"
) -> StreamResponse:
return self.post("imports", data={"path": path, "mode": mode})
| (self, path: str, mode: Literal['insert', 'upsert'] = 'upsert') -> stream_chat.types.stream_response.StreamResponse | [
-0.029574058949947357,
-0.018857328221201897,
-0.03318065404891968,
-0.011601206846535206,
0.02811424806714058,
0.013722226023674011,
0.010982933454215527,
0.0313430093228817,
-0.02344285137951374,
0.004229159094393253,
0.0013224172871559858,
-0.008561364375054836,
-0.028148597106337547,
-... |
727,526 | stream_chat.client | create_import_url | null | def create_import_url(self, filename: str) -> StreamResponse:
return self.post("import_urls", data={"filename": filename})
| (self, filename: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.08593060076236725,
-0.018365629017353058,
-0.047888778150081635,
0.01005947683006525,
0.007819117978215218,
0.06365098804235458,
-0.03168381005525589,
0.06556370109319687,
0.005352952517569065,
0.027663562446832657,
-0.018967781215906143,
-0.028070900589227676,
0.0060170902870595455,
-0... |
727,527 | stream_chat.client | create_permission | null | def create_permission(self, permission: Dict) -> StreamResponse:
return self.post("permissions", data=permission)
| (self, permission: Dict) -> stream_chat.types.stream_response.StreamResponse | [
-0.025581829249858856,
0.06013914942741394,
-0.023682521656155586,
-0.03154868260025978,
0.03375053405761719,
0.01995113678276539,
-0.002645164495334029,
0.09029275923967361,
-0.011101706884801388,
-0.007088788785040379,
0.055500131100416183,
0.08726731687784195,
0.00903431884944439,
-0.05... |
727,528 | stream_chat.client | create_role | null | def create_role(self, name: str) -> StreamResponse:
return self.post("roles", data={"name": name})
| (self, name: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.04717061296105385,
-0.000631827162578702,
0.031016772612929344,
-0.10885526239871979,
0.008260090835392475,
-0.02367253042757511,
-0.02829539030790329,
0.03251701965928078,
0.016415514051914215,
0.0196079034358263,
0.03567451983690262,
0.06775542348623276,
-0.004806029610335827,
0.01516... |
727,529 | stream_chat.base.client | create_search_params | null | def create_search_params(
self,
filter_conditions: Dict,
query: Union[str, Dict],
sort: List[Dict] = None,
**options: Any,
) -> Dict[str, Any]:
params = options.copy()
if isinstance(query, str):
params.update({"query": query})
else:
params.update({"message_filter_conditio... | (self, filter_conditions: Dict, query: Union[str, Dict], sort: Optional[List[Dict]] = None, **options: Any) -> Dict[str, Any] | [
-0.006266133859753609,
-0.01276855356991291,
0.0010973686585202813,
-0.03687885403633118,
-0.02660948410630226,
-0.0005975319654680789,
-0.04838418588042259,
0.0017278443556278944,
0.022719847038388252,
-0.08033737540245056,
-0.008915267884731293,
0.01380457915365696,
-0.025646163150668144,
... |
727,530 | stream_chat.client | create_segment | null | def create_segment(
self,
segment_type: SegmentType,
segment_id: Optional[str] = None,
data: Optional[SegmentData] = None,
) -> StreamResponse:
payload = {"type": segment_type.value}
if segment_id is not None:
payload["id"] = segment_id
if data is not None:
payload.update(cas... | (self, segment_type: stream_chat.types.segment.SegmentType, segment_id: Optional[str] = None, data: Optional[stream_chat.types.segment.SegmentData] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.05973140895366669,
0.09253762662410736,
-0.033319924026727676,
-0.043647151440382004,
0.010663792490959167,
0.02419724315404892,
0.0004757853748742491,
0.06415989249944687,
-0.08105899393558502,
-0.03133596107363701,
0.009600955992937088,
0.03773069381713867,
0.010973786935210228,
-0.05... |
727,531 | stream_chat.base.client | create_token |
Creates a JWT for a user.
Stream uses JWT (JSON Web Tokens) to authenticate chat users, enabling them to login.
Knowing whether a user is authorized to perform certain actions is managed
separately via a role based permissions system.
By default, user tokens are valid indefinite... | def create_token(
self, user_id: str, exp: int = None, iat: int = None, **claims: Any
) -> str:
"""
Creates a JWT for a user.
Stream uses JWT (JSON Web Tokens) to authenticate chat users, enabling them to login.
Knowing whether a user is authorized to perform certain actions is managed
separatel... | (self, user_id: str, exp: Optional[int] = None, iat: Optional[int] = None, **claims: Any) -> str | [
-0.04714313894510269,
-0.041471511125564575,
0.06885427236557007,
-0.011650316417217255,
0.034806448966264725,
-0.013140472583472729,
0.008096517994999886,
0.009771815501153469,
-0.06704802066087723,
0.004332743585109711,
0.044397637248039246,
0.05884764343500137,
0.0198687557131052,
0.039... |
727,532 | stream_chat.client | deactivate_user | null | def deactivate_user(self, user_id: str, **options: Any) -> StreamResponse:
return self.post(f"users/{user_id}/deactivate", data=options)
| (self, user_id: str, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
0.0113808773458004,
0.014657588675618172,
0.050675131380558014,
-0.06392215937376022,
-0.021307384595274925,
-0.03274959325790405,
-0.04653981700539589,
-0.01360623724758625,
-0.009733760729432106,
0.005589684005826712,
-0.032171349972486496,
-0.0539693646132946,
-0.04180873557925224,
0.01... |
727,533 | stream_chat.client | delete | null | def delete(self, relative_url: str, params: Dict = None) -> StreamResponse:
return self._make_request(self.session.delete, relative_url, params, None)
| (self, relative_url: str, params: Optional[Dict] = None) -> stream_chat.types.stream_response.StreamResponse | [
-0.039150748401880264,
-0.02268420346081257,
-0.03932156413793564,
-0.01620178297162056,
-0.020839404314756393,
0.01824301853775978,
-0.08492910861968994,
0.10583683848381042,
-0.0234870333224535,
0.05018538236618042,
0.008002672344446182,
-0.02160806953907013,
0.035119518637657166,
-0.016... |
727,534 | stream_chat.client | delete_blocklist | null | def delete_blocklist(self, name: str) -> StreamResponse:
return self.delete(f"blocklists/{name}")
| (self, name: str) -> stream_chat.types.stream_response.StreamResponse | [
0.020612167194485664,
-0.05310762673616409,
-0.026587191969156265,
-0.027688734233379364,
-0.06826215982437134,
-0.007164188660681248,
-0.048567939549684525,
0.06736090034246445,
-0.02990850619971752,
0.019477246329188347,
-0.04296009615063667,
-0.035316068679094315,
-0.05160552263259888,
... |
727,535 | stream_chat.client | delete_campaign | null | def delete_campaign(self, campaign_id: str, **options: Any) -> StreamResponse:
return self.delete(f"campaigns/{campaign_id}", options)
| (self, campaign_id: str, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.05202920734882355,
0.03065635822713375,
0.0012795132352039218,
-0.03560987114906311,
-0.00011670686944853514,
0.021407490596175194,
-0.028733840212225914,
0.033150434494018555,
0.014886518940329552,
0.0035917300265282393,
-0.08168100565671921,
-0.0460018552839756,
-0.020905211567878723,
... |
727,536 | stream_chat.client | delete_channel_type | null | def delete_channel_type(self, channel_type: str) -> StreamResponse:
return self.delete(f"channeltypes/{channel_type}")
| (self, channel_type: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.05298760533332825,
0.012441461905837059,
-0.007420320995151997,
-0.03256030008196831,
0.0016280150739476085,
0.004155722446739674,
-0.024711554870009422,
0.0582658015191555,
-0.028927257284522057,
0.03180627152323723,
0.0074031841941177845,
-0.0228093471378088,
-0.02753916010260582,
-0.... |
727,537 | stream_chat.client | delete_channels | null | def delete_channels(self, cids: Iterable[str], **options: Any) -> StreamResponse:
return self.post("channels/delete", data=dict(options, cids=cids))
| (self, cids: Iterable[str], **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.08211888372898102,
-0.026179304346442223,
-0.02991672232747078,
-0.05865137651562691,
-0.025709955021739006,
0.04957727715373039,
-0.018200352787971497,
0.052914876490831375,
0.03328908979892731,
0.05420124530792236,
-0.0016611950704827905,
-0.029499521479010582,
-0.02105122059583664,
0... |
727,538 | stream_chat.client | delete_command | null | def delete_command(self, name: str) -> StreamResponse:
return self.delete(f"commands/{name}")
| (self, name: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.0006463640602305532,
-0.033935949206352234,
-0.01127284113317728,
-0.08951172977685928,
0.0002891077019739896,
0.00987212359905243,
-0.03828068822622299,
0.06371168047189713,
0.04150150343775749,
0.014007176272571087,
0.021371427923440933,
-0.04656757041811943,
-0.02702462300658226,
-0.... |
727,539 | stream_chat.client | delete_device | null | def delete_device(self, device_id: str, user_id: str) -> StreamResponse:
return self.delete("devices", {"id": device_id, "user_id": user_id})
| (self, device_id: str, user_id: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.028120728209614754,
0.023695899173617363,
-0.0004521995724644512,
-0.02943621762096882,
0.014248291030526161,
0.0032908597495406866,
-0.031623005867004395,
0.05876993015408516,
-0.028359906747937202,
0.02607061341404915,
0.009977220557630062,
-0.04417995363473892,
-0.026736900210380554,
... |
727,540 | stream_chat.client | delete_message | null | def delete_message(self, message_id: str, **options: Any) -> StreamResponse:
return self.delete(f"messages/{message_id}", options)
| (self, message_id: str, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.008369684219360352,
0.000053251718782121316,
0.025888049975037575,
-0.06442120671272278,
0.01722850650548935,
0.0022282926365733147,
0.024927889928221703,
0.06833430379629135,
0.03449324518442154,
0.007065318059176207,
-0.014809993095695972,
-0.04887750744819641,
-0.03690269961953163,
0... |
727,541 | stream_chat.client | delete_permission | null | def delete_permission(self, id: str) -> StreamResponse:
return self.delete(f"permissions/{id}")
| (self, id: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.026745080947875977,
0.0617712065577507,
0.03591819107532501,
-0.05062882602214813,
0.023681769147515297,
0.03652412071824074,
-0.0010719492565840483,
0.07486603409051895,
-0.014929444529116154,
0.023648105561733246,
0.0011739896144717932,
0.01378490962088108,
0.004662295337766409,
-0.03... |
727,542 | stream_chat.client | delete_push_provider | null | def delete_push_provider(self, provider_type: str, name: str) -> StreamResponse:
return self.delete(f"push_providers/{provider_type}/{name}")
| (self, provider_type: str, name: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.03300227224826813,
-0.023938506841659546,
-0.0005318080075085163,
-0.032731205224990845,
0.017670108005404472,
0.00018529895169194788,
-0.01838165521621704,
0.03242625668644905,
0.020380767062306404,
0.03073209524154663,
0.03376464545726776,
-0.03376464545726776,
-0.0037673923652619123,
... |
727,543 | stream_chat.client | delete_role | null | def delete_role(self, name: str) -> StreamResponse:
return self.delete(f"roles/{name}")
| (self, name: str) -> stream_chat.types.stream_response.StreamResponse | [
0.012366896495223045,
0.0060076359659433365,
0.04603710025548935,
-0.09852351248264313,
0.037769634276628494,
-0.022006556391716003,
-0.045694053173065186,
0.03401325270533562,
0.027975600212812424,
0.04782095178961754,
0.02080588787794113,
0.021817879751324654,
-0.018421700224280357,
-0.0... |
727,544 | stream_chat.client | delete_segment | null | def delete_segment(self, segment_id: str) -> StreamResponse:
return self.delete(f"segments/{segment_id}")
| (self, segment_id: str) -> stream_chat.types.stream_response.StreamResponse | [
-0.02169826813042164,
0.09789929538965225,
-0.011508993804454803,
-0.02853682078421116,
0.017584851011633873,
0.008162559010088444,
-0.03921456262469292,
0.11723234504461288,
-0.03907744958996773,
-0.017790522426366806,
-0.020738471299409866,
0.011440437287092209,
0.006680015474557877,
-0.... |
727,545 | stream_chat.client | delete_user | null | def delete_user(self, user_id: str, **options: Any) -> StreamResponse:
return self.delete(f"users/{user_id}", options)
| (self, user_id: str, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.04862944409251213,
0.024278132244944572,
0.06022879481315613,
-0.06948632001876831,
0.00015494003309868276,
0.013337421230971813,
-0.018688855692744255,
0.028943484649062157,
-0.01344719436019659,
0.020637325942516327,
-0.005012967623770237,
-0.06096061319112778,
-0.009330706670880318,
... |
727,546 | stream_chat.client | delete_users | null | def delete_users(
self, user_ids: Iterable[str], delete_type: str, **options: Any
) -> StreamResponse:
return self.post(
"users/delete", data=dict(options, user=delete_type, user_ids=user_ids)
)
| (self, user_ids: Iterable[str], delete_type: str, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.06879262626171112,
0.006881075911223888,
0.0033294798340648413,
-0.07579156011343002,
-0.021558891981840134,
0.024296816438436508,
-0.031948499381542206,
-0.007465831469744444,
-0.03200289607048035,
0.06367941945791245,
0.03372543305158615,
-0.036554016172885895,
-0.0033884085714817047,
... |
727,547 | stream_chat.client | export_channel | null | def export_channel(
self,
channel_type: str,
channel_id: str,
messages_since: Union[str, datetime.datetime] = None,
messages_until: Union[str, datetime.datetime] = None,
**options: Any,
) -> StreamResponse:
if isinstance(messages_since, datetime.datetime):
messages_since = messages_s... | (self, channel_type: str, channel_id: str, messages_since: Union[str, datetime.datetime, NoneType] = None, messages_until: Union[str, datetime.datetime, NoneType] = None, **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.061951857060194016,
-0.04542651027441025,
-0.025206616148352623,
-0.07185250520706177,
-0.0033646738156676292,
0.021220877766609192,
0.002584360772743821,
0.039129406213760376,
-0.05408957600593567,
0.02071128413081169,
-0.015260468237102032,
-0.0428057499229908,
-0.005837561096996069,
... |
727,548 | stream_chat.client | export_channels | null | def export_channels(
self, channels: Iterable[Dict], **options: Any
) -> StreamResponse:
return self.post("export_channels", data={"channels": channels, **options})
| (self, channels: Iterable[Dict], **options: Any) -> stream_chat.types.stream_response.StreamResponse | [
-0.06926786154508591,
-0.05490953102707863,
-0.06950660049915314,
-0.03731119632720947,
-0.005981216672807932,
0.047849733382463455,
-0.04239288717508316,
0.012542223557829857,
0.0011521195992827415,
0.07394028455018997,
0.018450966104865074,
-0.03308213874697685,
-0.018604440614581108,
0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.