body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
@abstractmethod
def decode_ids_to_tokens(self, tokens: List[int]) -> List[str]:
'\n Implemented by subclass in order to decode a token id list into a token list.\n A token list is the string representation of each token id.\n\n Args:\n tokens: List of int representing the token ids.\... | 8,077,708,010,352,892,000 | Implemented by subclass in order to decode a token id list into a token list.
A token list is the string representation of each token id.
Args:
tokens: List of int representing the token ids.
Returns:
A list of decoded tokens. | nemo/collections/asr/metrics/rnnt_wer.py | decode_ids_to_tokens | JINHXu/NeMo | python | @abstractmethod
def decode_ids_to_tokens(self, tokens: List[int]) -> List[str]:
'\n Implemented by subclass in order to decode a token id list into a token list.\n A token list is the string representation of each token id.\n\n Args:\n tokens: List of int representing the token ids.\... |
def decode_tokens_to_str(self, tokens: List[int]) -> str:
'\n Implemented by subclass in order to decoder a token list into a string.\n\n Args:\n tokens: List of int representing the token ids.\n\n Returns:\n A decoded string.\n '
hypothesis = ''.join([self.labe... | 3,894,442,656,208,714,000 | Implemented by subclass in order to decoder a token list into a string.
Args:
tokens: List of int representing the token ids.
Returns:
A decoded string. | nemo/collections/asr/metrics/rnnt_wer.py | decode_tokens_to_str | JINHXu/NeMo | python | def decode_tokens_to_str(self, tokens: List[int]) -> str:
'\n Implemented by subclass in order to decoder a token list into a string.\n\n Args:\n tokens: List of int representing the token ids.\n\n Returns:\n A decoded string.\n '
hypothesis = .join([self.labels... |
def decode_ids_to_tokens(self, tokens: List[int]) -> List[str]:
'\n Implemented by subclass in order to decode a token id list into a token list.\n A token list is the string representation of each token id.\n\n Args:\n tokens: List of int representing the token ids.\n\n Retur... | -6,223,895,649,209,285,000 | Implemented by subclass in order to decode a token id list into a token list.
A token list is the string representation of each token id.
Args:
tokens: List of int representing the token ids.
Returns:
A list of decoded tokens. | nemo/collections/asr/metrics/rnnt_wer.py | decode_ids_to_tokens | JINHXu/NeMo | python | def decode_ids_to_tokens(self, tokens: List[int]) -> List[str]:
'\n Implemented by subclass in order to decode a token id list into a token list.\n A token list is the string representation of each token id.\n\n Args:\n tokens: List of int representing the token ids.\n\n Retur... |
def setUp(self, debug=False, profile=True):
'\n setUp test environment\n '
TestCase.setUp(self)
self.debug = debug
self.profile = profile
msg = f'test {self._testMethodName}, debug={self.debug}'
self.profiler = Profiler(msg, profile=self.profile) | 2,393,079,469,751,454,000 | setUp test environment | tests/basetest.py | setUp | WolfgangFahl/pyOnlineSpreadSheetEditing | python | def setUp(self, debug=False, profile=True):
'\n \n '
TestCase.setUp(self)
self.debug = debug
self.profile = profile
msg = f'test {self._testMethodName}, debug={self.debug}'
self.profiler = Profiler(msg, profile=self.profile) |
@staticmethod
def inPublicCI():
'\n are we running in a public Continuous Integration Environment?\n '
publicCI = (getpass.getuser() in ['travis', 'runner'])
jenkins = ('JENKINS_HOME' in os.environ)
return (publicCI or jenkins) | -2,310,455,625,163,682,300 | are we running in a public Continuous Integration Environment? | tests/basetest.py | inPublicCI | WolfgangFahl/pyOnlineSpreadSheetEditing | python | @staticmethod
def inPublicCI():
'\n \n '
publicCI = (getpass.getuser() in ['travis', 'runner'])
jenkins = ('JENKINS_HOME' in os.environ)
return (publicCI or jenkins) |
def __init__(self, msg, profile=True):
'\n construct me with the given msg and profile active flag\n \n Args:\n msg(str): the message to show if profiling is active\n profile(bool): True if messages should be shown\n '
self.msg = msg
self.profile = profile
... | 6,166,635,583,448,363,000 | construct me with the given msg and profile active flag
Args:
msg(str): the message to show if profiling is active
profile(bool): True if messages should be shown | tests/basetest.py | __init__ | WolfgangFahl/pyOnlineSpreadSheetEditing | python | def __init__(self, msg, profile=True):
'\n construct me with the given msg and profile active flag\n \n Args:\n msg(str): the message to show if profiling is active\n profile(bool): True if messages should be shown\n '
self.msg = msg
self.profile = profile
... |
def time(self, extraMsg=''):
'\n time the action and print if profile is active\n '
elapsed = (time.time() - self.starttime)
if self.profile:
print(f'{self.msg}{extraMsg} took {elapsed:5.1f} s')
return elapsed | -4,921,684,839,023,697,000 | time the action and print if profile is active | tests/basetest.py | time | WolfgangFahl/pyOnlineSpreadSheetEditing | python | def time(self, extraMsg=):
'\n \n '
elapsed = (time.time() - self.starttime)
if self.profile:
print(f'{self.msg}{extraMsg} took {elapsed:5.1f} s')
return elapsed |
def __init__(self, id):
'Initialize the class.'
self.level = 'S'
Entity.__init__(self, id) | 7,661,185,872,800,717,000 | Initialize the class. | Bio/PDB/Structure.py | __init__ | AaronLi/biopython | python | def __init__(self, id):
self.level = 'S'
Entity.__init__(self, id) |
def __repr__(self):
'Return the structure identifier.'
return ('<Structure id=%s>' % self.get_id()) | -6,355,413,107,838,914,000 | Return the structure identifier. | Bio/PDB/Structure.py | __repr__ | AaronLi/biopython | python | def __repr__(self):
return ('<Structure id=%s>' % self.get_id()) |
def get_models(self):
'Return models.'
(yield from self) | 6,382,655,307,569,794,000 | Return models. | Bio/PDB/Structure.py | get_models | AaronLi/biopython | python | def get_models(self):
(yield from self) |
def get_chains(self):
'Return chains from models.'
for m in self.get_models():
(yield from m) | -7,909,861,180,488,219,000 | Return chains from models. | Bio/PDB/Structure.py | get_chains | AaronLi/biopython | python | def get_chains(self):
for m in self.get_models():
(yield from m) |
def get_residues(self):
'Return residues from chains.'
for c in self.get_chains():
(yield from c) | 8,528,804,944,604,388,000 | Return residues from chains. | Bio/PDB/Structure.py | get_residues | AaronLi/biopython | python | def get_residues(self):
for c in self.get_chains():
(yield from c) |
def get_atoms(self):
'Return atoms from residue.'
for r in self.get_residues():
(yield from r) | -8,607,889,299,429,391,000 | Return atoms from residue. | Bio/PDB/Structure.py | get_atoms | AaronLi/biopython | python | def get_atoms(self):
for r in self.get_residues():
(yield from r) |
def atom_to_internal_coordinates(self, verbose: bool=False) -> None:
'Create/update internal coordinates from Atom X,Y,Z coordinates.\n\n Internal coordinates are bond length, angle and dihedral angles.\n\n :param verbose bool: default False\n describe runtime problems\n\n '
for ... | 396,073,781,232,036,200 | Create/update internal coordinates from Atom X,Y,Z coordinates.
Internal coordinates are bond length, angle and dihedral angles.
:param verbose bool: default False
describe runtime problems | Bio/PDB/Structure.py | atom_to_internal_coordinates | AaronLi/biopython | python | def atom_to_internal_coordinates(self, verbose: bool=False) -> None:
'Create/update internal coordinates from Atom X,Y,Z coordinates.\n\n Internal coordinates are bond length, angle and dihedral angles.\n\n :param verbose bool: default False\n describe runtime problems\n\n '
for ... |
def internal_to_atom_coordinates(self, verbose: bool=False) -> None:
'Create/update atom coordinates from internal coordinates.\n\n :param verbose bool: default False\n describe runtime problems\n\n :raises Exception: if any chain does not have .pic attribute\n '
for chn in self.... | 6,753,981,550,650,205,000 | Create/update atom coordinates from internal coordinates.
:param verbose bool: default False
describe runtime problems
:raises Exception: if any chain does not have .pic attribute | Bio/PDB/Structure.py | internal_to_atom_coordinates | AaronLi/biopython | python | def internal_to_atom_coordinates(self, verbose: bool=False) -> None:
'Create/update atom coordinates from internal coordinates.\n\n :param verbose bool: default False\n describe runtime problems\n\n :raises Exception: if any chain does not have .pic attribute\n '
for chn in self.... |
def ll2z(locations, radius_search=CITY_RADIUS_SEARCH):
'Computes the z-value for the given lon, lat tuple or\n list of lon, lat tuples\n :param locations:\n :param radius_search: Checks to see if a city is within X km from the given location,\n removes the search if value is set t... | -9,122,859,694,354,971,000 | Computes the z-value for the given lon, lat tuple or
list of lon, lat tuples
:param locations:
:param radius_search: Checks to see if a city is within X km from the given location,
removes the search if value is set to 0
:return: Array of z-values, one for each location specified | calculation/gmhazard_calc/gmhazard_calc/nz_code/nzs1170p5/nzs_zfactor_2016/ll2z.py | ll2z | ucgmsim/gmhazard | python | def ll2z(locations, radius_search=CITY_RADIUS_SEARCH):
'Computes the z-value for the given lon, lat tuple or\n list of lon, lat tuples\n :param locations:\n :param radius_search: Checks to see if a city is within X km from the given location,\n removes the search if value is set t... |
def testRaw():
'[summary]\n '
ui = UtopiaDataInterface()
ui.connect()
sigViewer(ui, 30000) | -6,927,465,488,642,527,000 | [summary] | mindaffectBCI/decoder/UtopiaDataInterface.py | testRaw | CkiChen/pymindaffectBCI | python | def testRaw():
'\n '
ui = UtopiaDataInterface()
ui.connect()
sigViewer(ui, 30000) |
def testPP():
'[summary]\n '
from sigViewer import sigViewer
ppfn = butterfilt_and_downsample(order=4, stopband=((0, 1), (25, (- 1))), fs_out=100)
ui = UtopiaDataInterface(data_preprocessor=ppfn, stimulus_preprocessor=None)
ui.connect()
sigViewer(ui) | -8,013,218,896,713,429,000 | [summary] | mindaffectBCI/decoder/UtopiaDataInterface.py | testPP | CkiChen/pymindaffectBCI | python | def testPP():
'\n '
from sigViewer import sigViewer
ppfn = butterfilt_and_downsample(order=4, stopband=((0, 1), (25, (- 1))), fs_out=100)
ui = UtopiaDataInterface(data_preprocessor=ppfn, stimulus_preprocessor=None)
ui.connect()
sigViewer(ui) |
def testFileProxy(filename, fs_out=999):
'[summary]\n\n Args:\n filename ([type]): [description]\n fs_out (int, optional): [description]. Defaults to 999.\n '
from mindaffectBCI.decoder.FileProxyHub import FileProxyHub
U = FileProxyHub(filename)
from sigViewer import sigViewer
pp... | 3,211,236,362,447,928,300 | [summary]
Args:
filename ([type]): [description]
fs_out (int, optional): [description]. Defaults to 999. | mindaffectBCI/decoder/UtopiaDataInterface.py | testFileProxy | CkiChen/pymindaffectBCI | python | def testFileProxy(filename, fs_out=999):
'[summary]\n\n Args:\n filename ([type]): [description]\n fs_out (int, optional): [description]. Defaults to 999.\n '
from mindaffectBCI.decoder.FileProxyHub import FileProxyHub
U = FileProxyHub(filename)
from sigViewer import sigViewer
pp... |
def testFileProxy2(filename):
'[summary]\n\n Args:\n filename ([type]): [description]\n '
from mindaffectBCI.decoder.FileProxyHub import FileProxyHub
U = FileProxyHub(filename)
fs = 200
fs_out = 200
ppfn = butterfilt_and_downsample(order=4, stopband=((45, 65), (0, 3), (25, (- 1))), ... | 4,541,379,977,686,302,000 | [summary]
Args:
filename ([type]): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | testFileProxy2 | CkiChen/pymindaffectBCI | python | def testFileProxy2(filename):
'[summary]\n\n Args:\n filename ([type]): [description]\n '
from mindaffectBCI.decoder.FileProxyHub import FileProxyHub
U = FileProxyHub(filename)
fs = 200
fs_out = 200
ppfn = butterfilt_and_downsample(order=4, stopband=((45, 65), (0, 3), (25, (- 1))), ... |
def testERP():
'[summary]\n '
ui = UtopiaDataInterface()
ui.connect()
erpViewer(ui, evtlabs=None) | -352,454,395,409,471,940 | [summary] | mindaffectBCI/decoder/UtopiaDataInterface.py | testERP | CkiChen/pymindaffectBCI | python | def testERP():
'\n '
ui = UtopiaDataInterface()
ui.connect()
erpViewer(ui, evtlabs=None) |
def testElectrodeQualities(X, fs=200, pktsize=20):
'[summary]\n\n Args:\n X ([type]): [description]\n fs (int, optional): [description]. Defaults to 200.\n pktsize (int, optional): [description]. Defaults to 20.\n\n Returns:\n [type]: [description]\n '
if (X.ndim > 2):
... | -3,518,891,553,744,630,000 | [summary]
Args:
X ([type]): [description]
fs (int, optional): [description]. Defaults to 200.
pktsize (int, optional): [description]. Defaults to 20.
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | testElectrodeQualities | CkiChen/pymindaffectBCI | python | def testElectrodeQualities(X, fs=200, pktsize=20):
'[summary]\n\n Args:\n X ([type]): [description]\n fs (int, optional): [description]. Defaults to 200.\n pktsize (int, optional): [description]. Defaults to 20.\n\n Returns:\n [type]: [description]\n '
if (X.ndim > 2):
... |
def connect(self, host=None, port=(- 1), queryifhostnotfound=True):
'[make a connection to the utopia host]\n\n Args:\n host ([type], optional): [description]. Defaults to None.\n port (int, optional): [description]. Defaults to -1.\n queryifhostnotfound (bool, optional): [de... | 1,323,226,354,754,162,000 | [make a connection to the utopia host]
Args:
host ([type], optional): [description]. Defaults to None.
port (int, optional): [description]. Defaults to -1.
queryifhostnotfound (bool, optional): [description]. Defaults to True.
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | connect | CkiChen/pymindaffectBCI | python | def connect(self, host=None, port=(- 1), queryifhostnotfound=True):
'[make a connection to the utopia host]\n\n Args:\n host ([type], optional): [description]. Defaults to None.\n port (int, optional): [description]. Defaults to -1.\n queryifhostnotfound (bool, optional): [de... |
def isConnected(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return (self.U.isConnected if (self.U is not None) else False) | 7,819,996,133,519,783,000 | [summary]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | isConnected | CkiChen/pymindaffectBCI | python | def isConnected(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return (self.U.isConnected if (self.U is not None) else False) |
def getTimeStamp(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return self.U.getTimeStamp() | 625,336,908,263,022,200 | [summary]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | getTimeStamp | CkiChen/pymindaffectBCI | python | def getTimeStamp(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return self.U.getTimeStamp() |
def sendMessage(self, msg: UtopiaMessage):
'[send a UtopiaMessage to the utopia hub]\n\n Args:\n msg (UtopiaMessage): [description]\n '
self.U.sendMessage(msg) | 3,466,417,455,431,208,400 | [send a UtopiaMessage to the utopia hub]
Args:
msg (UtopiaMessage): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | sendMessage | CkiChen/pymindaffectBCI | python | def sendMessage(self, msg: UtopiaMessage):
'[send a UtopiaMessage to the utopia hub]\n\n Args:\n msg (UtopiaMessage): [description]\n '
self.U.sendMessage(msg) |
def getNewMessages(self, timeout_ms=0):
'[get new messages from the UtopiaHub]\n\n Args:\n timeout_ms (int, optional): [description]. Defaults to 0.\n\n Returns:\n [type]: [description]\n '
return self.U.getNewMessages(timeout_ms) | 6,442,127,469,990,777,000 | [get new messages from the UtopiaHub]
Args:
timeout_ms (int, optional): [description]. Defaults to 0.
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | getNewMessages | CkiChen/pymindaffectBCI | python | def getNewMessages(self, timeout_ms=0):
'[get new messages from the UtopiaHub]\n\n Args:\n timeout_ms (int, optional): [description]. Defaults to 0.\n\n Returns:\n [type]: [description]\n '
return self.U.getNewMessages(timeout_ms) |
def initDataRingBuffer(self):
'[initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.]\n\n Returns:\n [type]: [description]\n '
print('geting some initial data to setup the ring buffer')
databuf = []
nmsg = 0
iter = 0
d... | 3,578,887,752,692,050,400 | [initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | initDataRingBuffer | CkiChen/pymindaffectBCI | python | def initDataRingBuffer(self):
'[initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.]\n\n Returns:\n [type]: [description]\n '
print('geting some initial data to setup the ring buffer')
databuf = []
nmsg = 0
iter = 0
d... |
def initStimulusRingBuffer(self):
'initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.'
self.stimulus_ringbuffer = RingBuffer(maxsize=((self.fs * self.datawindow_ms) / 1000), shape=(257,), dtype=np.float32) | 4,857,781,732,760,419,000 | initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc. | mindaffectBCI/decoder/UtopiaDataInterface.py | initStimulusRingBuffer | CkiChen/pymindaffectBCI | python | def initStimulusRingBuffer(self):
self.stimulus_ringbuffer = RingBuffer(maxsize=((self.fs * self.datawindow_ms) / 1000), shape=(257,), dtype=np.float32) |
def preprocess_message(self, m: UtopiaMessage):
'[apply pre-processing to topia message before any more work]\n\n Args:\n m (UtopiaMessage): [description]\n\n Returns:\n [type]: [description]\n '
m.timestamp = (m.timestamp % (1 << 24))
return m | -8,116,090,609,917,216,000 | [apply pre-processing to topia message before any more work]
Args:
m (UtopiaMessage): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | preprocess_message | CkiChen/pymindaffectBCI | python | def preprocess_message(self, m: UtopiaMessage):
'[apply pre-processing to topia message before any more work]\n\n Args:\n m (UtopiaMessage): [description]\n\n Returns:\n [type]: [description]\n '
m.timestamp = (m.timestamp % (1 << 24))
return m |
def processDataPacket(self, m: DataPacket):
'[pre-process a datapacket message ready to be inserted into the ringbuffer]\n\n Args:\n m (DataPacket): [description]\n\n Returns:\n [type]: [description]\n '
d = np.array(m.samples, dtype=np.float32)
if self.data_prepro... | -5,731,186,222,297,899,000 | [pre-process a datapacket message ready to be inserted into the ringbuffer]
Args:
m (DataPacket): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | processDataPacket | CkiChen/pymindaffectBCI | python | def processDataPacket(self, m: DataPacket):
'[pre-process a datapacket message ready to be inserted into the ringbuffer]\n\n Args:\n m (DataPacket): [description]\n\n Returns:\n [type]: [description]\n '
d = np.array(m.samples, dtype=np.float32)
if self.data_prepro... |
def add_sample_timestamps(self, d: np.ndarray, timestamp: float, fs: float):
'add per-sample timestamp information to the data matrix\n\n Args:\n d (np.ndarray): (t,d) the data matrix to attach time stamps to\n timestamp (float): the timestamp of the last sample of d\n fs (fl... | 2,263,153,318,634,905,000 | add per-sample timestamp information to the data matrix
Args:
d (np.ndarray): (t,d) the data matrix to attach time stamps to
timestamp (float): the timestamp of the last sample of d
fs (float): the nomional sample rate of d
Returns:
np.ndarray: (t,d+1) data matrix with attached time-stamp channel | mindaffectBCI/decoder/UtopiaDataInterface.py | add_sample_timestamps | CkiChen/pymindaffectBCI | python | def add_sample_timestamps(self, d: np.ndarray, timestamp: float, fs: float):
'add per-sample timestamp information to the data matrix\n\n Args:\n d (np.ndarray): (t,d) the data matrix to attach time stamps to\n timestamp (float): the timestamp of the last sample of d\n fs (fl... |
def plot_raw_preproc_data(self, d_raw, d_preproc, ts):
'[debugging function to check the diff between the raw and pre-processed data]\n\n Args:\n d_raw ([type]): [description]\n d_preproc ([type]): [description]\n ts ([type]): [description]\n '
if (not hasattr(self... | 1,639,815,109,318,496,800 | [debugging function to check the diff between the raw and pre-processed data]
Args:
d_raw ([type]): [description]
d_preproc ([type]): [description]
ts ([type]): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | plot_raw_preproc_data | CkiChen/pymindaffectBCI | python | def plot_raw_preproc_data(self, d_raw, d_preproc, ts):
'[debugging function to check the diff between the raw and pre-processed data]\n\n Args:\n d_raw ([type]): [description]\n d_preproc ([type]): [description]\n ts ([type]): [description]\n '
if (not hasattr(self... |
def processStimulusEvent(self, m: StimulusEvent):
'[pre-process a StimulusEvent message ready to be inserted into the stimulus ringbuffer]\n\n Args:\n m (StimulusEvent): [description]\n\n Returns:\n [type]: [description]\n '
d = np.zeros((257,), dtype=np.float32)
i... | -2,385,323,848,178,737,000 | [pre-process a StimulusEvent message ready to be inserted into the stimulus ringbuffer]
Args:
m (StimulusEvent): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | processStimulusEvent | CkiChen/pymindaffectBCI | python | def processStimulusEvent(self, m: StimulusEvent):
'[pre-process a StimulusEvent message ready to be inserted into the stimulus ringbuffer]\n\n Args:\n m (StimulusEvent): [description]\n\n Returns:\n [type]: [description]\n '
d = np.zeros((257,), dtype=np.float32)
i... |
def update_and_send_ElectrodeQualities(self, d_raw: np.ndarray, d_preproc: np.ndarray, ts: int):
'[compute running estimate of electrode qality and stream it]\n\n Args:\n d_raw (np.ndarray): [description]\n d_preproc (np.ndarray): [description]\n ts (int): [description]\n ... | 7,000,004,924,750,501,000 | [compute running estimate of electrode qality and stream it]
Args:
d_raw (np.ndarray): [description]
d_preproc (np.ndarray): [description]
ts (int): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | update_and_send_ElectrodeQualities | CkiChen/pymindaffectBCI | python | def update_and_send_ElectrodeQualities(self, d_raw: np.ndarray, d_preproc: np.ndarray, ts: int):
'[compute running estimate of electrode qality and stream it]\n\n Args:\n d_raw (np.ndarray): [description]\n d_preproc (np.ndarray): [description]\n ts (int): [description]\n ... |
def update_electrode_powers(self, d_raw: np.ndarray, d_preproc: np.ndarray):
'[track exp-weighted-moving average centered power for 2 input streams]\n\n Args:\n d_raw (np.ndarray): [description]\n d_preproc (np.ndarray): [description]\n\n Returns:\n [type]: [descriptio... | 2,754,732,351,761,983,000 | [track exp-weighted-moving average centered power for 2 input streams]
Args:
d_raw (np.ndarray): [description]
d_preproc (np.ndarray): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | update_electrode_powers | CkiChen/pymindaffectBCI | python | def update_electrode_powers(self, d_raw: np.ndarray, d_preproc: np.ndarray):
'[track exp-weighted-moving average centered power for 2 input streams]\n\n Args:\n d_raw (np.ndarray): [description]\n d_preproc (np.ndarray): [description]\n\n Returns:\n [type]: [descriptio... |
def update(self, timeout_ms=None, mintime_ms=None):
'Update the tracking state w.r.t. the data source\n\n By adding data to the data_ringbuffer, stimulus info to the stimulus_ringbuffer, \n and other messages to the messages ring buffer.\n\n Args\n timeout_ms : int\n max blo... | 6,327,734,097,786,197,000 | Update the tracking state w.r.t. the data source
By adding data to the data_ringbuffer, stimulus info to the stimulus_ringbuffer,
and other messages to the messages ring buffer.
Args
timeout_ms : int
max block waiting for messages before returning
mintime_ms : int
min time to accumulate messages before r... | mindaffectBCI/decoder/UtopiaDataInterface.py | update | CkiChen/pymindaffectBCI | python | def update(self, timeout_ms=None, mintime_ms=None):
'Update the tracking state w.r.t. the data source\n\n By adding data to the data_ringbuffer, stimulus info to the stimulus_ringbuffer, \n and other messages to the messages ring buffer.\n\n Args\n timeout_ms : int\n max blo... |
def push_back_newmsgs(self, oldmsgs):
'[put unprocessed messages back onto the newmessages queue]\n\n Args:\n oldmsgs ([type]): [description]\n '
self.newmsgs.extend(oldmsgs) | 3,987,448,184,813,840,000 | [put unprocessed messages back onto the newmessages queue]
Args:
oldmsgs ([type]): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | push_back_newmsgs | CkiChen/pymindaffectBCI | python | def push_back_newmsgs(self, oldmsgs):
'[put unprocessed messages back onto the newmessages queue]\n\n Args:\n oldmsgs ([type]): [description]\n '
self.newmsgs.extend(oldmsgs) |
def extract_data_segment(self, bgn_ts, end_ts=None):
'extract a segment of data based on a start and end time-stamp\n\n Args:\n bgn_ts (float): segment start time-stamp\n end_ts (float, optional): segment end time-stamp. Defaults to None.\n\n Returns:\n (np.ndarray): t... | -7,491,877,753,707,852,000 | extract a segment of data based on a start and end time-stamp
Args:
bgn_ts (float): segment start time-stamp
end_ts (float, optional): segment end time-stamp. Defaults to None.
Returns:
(np.ndarray): the data between these time-stamps, or None if timestamps invalid | mindaffectBCI/decoder/UtopiaDataInterface.py | extract_data_segment | CkiChen/pymindaffectBCI | python | def extract_data_segment(self, bgn_ts, end_ts=None):
'extract a segment of data based on a start and end time-stamp\n\n Args:\n bgn_ts (float): segment start time-stamp\n end_ts (float, optional): segment end time-stamp. Defaults to None.\n\n Returns:\n (np.ndarray): t... |
def extract_stimulus_segment(self, bgn_ts, end_ts=None):
'extract a segment of the stimulus stream based on a start and end time-stamp\n\n Args:\n bgn_ts (float): segment start time-stamp\n end_ts (float, optional): segment end time-stamp. Defaults to None.\n\n Returns:\n ... | 107,512,148,402,593,490 | extract a segment of the stimulus stream based on a start and end time-stamp
Args:
bgn_ts (float): segment start time-stamp
end_ts (float, optional): segment end time-stamp. Defaults to None.
Returns:
(np.ndarray): the stimulus events between these time-stamps, or None if timestamps invalid | mindaffectBCI/decoder/UtopiaDataInterface.py | extract_stimulus_segment | CkiChen/pymindaffectBCI | python | def extract_stimulus_segment(self, bgn_ts, end_ts=None):
'extract a segment of the stimulus stream based on a start and end time-stamp\n\n Args:\n bgn_ts (float): segment start time-stamp\n end_ts (float, optional): segment end time-stamp. Defaults to None.\n\n Returns:\n ... |
def extract_msgs_segment(self, bgn_ts, end_ts=None):
'[extract the messages between start/end time stamps]\n\n Args:\n bgn_ts ([type]): [description]\n end_ts ([type], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n '
msgs ... | 930,822,136,109,789,600 | [extract the messages between start/end time stamps]
Args:
bgn_ts ([type]): [description]
end_ts ([type], optional): [description]. Defaults to None.
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | extract_msgs_segment | CkiChen/pymindaffectBCI | python | def extract_msgs_segment(self, bgn_ts, end_ts=None):
'[extract the messages between start/end time stamps]\n\n Args:\n bgn_ts ([type]): [description]\n end_ts ([type], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n '
msgs ... |
def run(self, timeout_ms=30000):
'[test run the interface forever, just getting and storing data]\n\n Args:\n timeout_ms (int, optional): [description]. Defaults to 30000.\n '
t0 = self.getTimeStamp()
tstart = self.data_timestamp
trlen_ms = 5000
while (self.getTimeStamp() < ... | -8,931,932,729,467,831,000 | [test run the interface forever, just getting and storing data]
Args:
timeout_ms (int, optional): [description]. Defaults to 30000. | mindaffectBCI/decoder/UtopiaDataInterface.py | run | CkiChen/pymindaffectBCI | python | def run(self, timeout_ms=30000):
'[test run the interface forever, just getting and storing data]\n\n Args:\n timeout_ms (int, optional): [description]. Defaults to 30000.\n '
t0 = self.getTimeStamp()
tstart = self.data_timestamp
trlen_ms = 5000
while (self.getTimeStamp() < ... |
def fit(self, X, fs: float=None, zi=None):
'[summary]\n\n Args:\n X ([type]): [description]\n fs (float, optional): [description]. Defaults to None.\n zi ([type], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n '
... | 8,991,536,753,699,651,000 | [summary]
Args:
X ([type]): [description]
fs (float, optional): [description]. Defaults to None.
zi ([type], optional): [description]. Defaults to None.
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | fit | CkiChen/pymindaffectBCI | python | def fit(self, X, fs: float=None, zi=None):
'[summary]\n\n Args:\n X ([type]): [description]\n fs (float, optional): [description]. Defaults to None.\n zi ([type], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n '
... |
def transform(self, X, Y=None):
'[summary]\n\n Args:\n X ([type]): [description]\n Y ([type], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n '
if (not hasattr(self, 'sos_')):
self.fit(X[0:1, :])
if (self.sos_ i... | -7,833,983,299,940,526,000 | [summary]
Args:
X ([type]): [description]
Y ([type], optional): [description]. Defaults to None.
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | transform | CkiChen/pymindaffectBCI | python | def transform(self, X, Y=None):
'[summary]\n\n Args:\n X ([type]): [description]\n Y ([type], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n '
if (not hasattr(self, 'sos_')):
self.fit(X[0:1, :])
if (self.sos_ i... |
@staticmethod
def testcase():
' test the filt+downsample transformation filter by incremental calling '
X = np.sin((((np.arange(100)[:, np.newaxis] * 2) * np.pi) / 30))
xs = np.arange(X.shape[0])[:, np.newaxis]
bands = (0, 20, 'bandpass')
fs = 200
fs_out = 130
fds = butterfilt_and_downsample... | 4,805,566,877,508,397,000 | test the filt+downsample transformation filter by incremental calling | mindaffectBCI/decoder/UtopiaDataInterface.py | testcase | CkiChen/pymindaffectBCI | python | @staticmethod
def testcase():
' '
X = np.sin((((np.arange(100)[:, np.newaxis] * 2) * np.pi) / 30))
xs = np.arange(X.shape[0])[:, np.newaxis]
bands = (0, 20, 'bandpass')
fs = 200
fs_out = 130
fds = butterfilt_and_downsample(stopband=bands, fs=fs, fs_out=fs_out)
print('single step')
f... |
def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n\n Returns:\n [type]: [description]\n '
return self | -7,139,748,956,259,923,000 | [summary]
Args:
X ([type]): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | fit | CkiChen/pymindaffectBCI | python | def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n\n Returns:\n [type]: [description]\n '
return self |
def transform(self, X):
'[transform Stimulus-encoded to brain-encoded]\n\n Args:\n X ([type]): [description]\n\n Returns:\n [type]: [description]\n '
if (X is None):
return None
prevX = self.prevX
if (self.histlen > 0):
if ((X.shape[0] >= self.h... | 8,042,121,421,868,493,000 | [transform Stimulus-encoded to brain-encoded]
Args:
X ([type]): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | transform | CkiChen/pymindaffectBCI | python | def transform(self, X):
'[transform Stimulus-encoded to brain-encoded]\n\n Args:\n X ([type]): [description]\n\n Returns:\n [type]: [description]\n '
if (X is None):
return None
prevX = self.prevX
if (self.histlen > 0):
if ((X.shape[0] >= self.h... |
def testcase():
' test the stimulus transformation filter by incremental calling '
M = np.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 1])[:, np.newaxis]
s2ef = stim2eventfilt(evtlabs=('re', 'fe'), histlen=3)
print('single step')
m0 = s2ef.transform(M)
print('{} -> {}'.format(M, m0))
print('Step size =... | 2,849,858,674,135,896,000 | test the stimulus transformation filter by incremental calling | mindaffectBCI/decoder/UtopiaDataInterface.py | testcase | CkiChen/pymindaffectBCI | python | def testcase():
' '
M = np.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 1])[:, np.newaxis]
s2ef = stim2eventfilt(evtlabs=('re', 'fe'), histlen=3)
print('single step')
m0 = s2ef.transform(M)
print('{} -> {}'.format(M, m0))
print('Step size = 1')
m1 = np.zeros(m0.shape, m0.dtype)
for i in range(... |
def hl2alpha(self, hl):
'[summary]\n\n Args:\n hl ([type]): [description]\n\n Returns:\n [type]: [description]\n '
return np.exp((np.log(0.5) / hl)) | -8,196,885,410,909,495,000 | [summary]
Args:
hl ([type]): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | hl2alpha | CkiChen/pymindaffectBCI | python | def hl2alpha(self, hl):
'[summary]\n\n Args:\n hl ([type]): [description]\n\n Returns:\n [type]: [description]\n '
return np.exp((np.log(0.5) / hl)) |
def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n\n Returns:\n [type]: [description]\n '
self.sX_N = X.shape[0]
if (self.car and (X.shape[(- 1)] > 4)):
X = (X.copy() - np.mean(X, (- 1), keepdims=True))
self.sX = np.sum(X, axis=0)
... | 2,493,160,889,451,224,000 | [summary]
Args:
X ([type]): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | fit | CkiChen/pymindaffectBCI | python | def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n\n Returns:\n [type]: [description]\n '
self.sX_N = X.shape[0]
if (self.car and (X.shape[(- 1)] > 4)):
X = (X.copy() - np.mean(X, (- 1), keepdims=True))
self.sX = np.sum(X, axis=0)
... |
def transform(self, X: np.ndarray):
'[compute the exponientially weighted centered power of X]\n\n Args:\n X (np.ndarray): [description]\n\n Returns:\n [type]: [description]\n '
if (self.sX is None):
return self.fit(X)
if (self.car and (X.shape[(- 1)] > 4))... | -7,378,616,810,163,433,000 | [compute the exponientially weighted centered power of X]
Args:
X (np.ndarray): [description]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | transform | CkiChen/pymindaffectBCI | python | def transform(self, X: np.ndarray):
'[compute the exponientially weighted centered power of X]\n\n Args:\n X (np.ndarray): [description]\n\n Returns:\n [type]: [description]\n '
if (self.sX is None):
return self.fit(X)
if (self.car and (X.shape[(- 1)] > 4))... |
def mean(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return (self.sX / self.sX_N) | 4,070,333,294,140,741,000 | [summary]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | mean | CkiChen/pymindaffectBCI | python | def mean(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return (self.sX / self.sX_N) |
def power(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return (self.sXX / self.sXX_N) | -2,892,201,905,606,831,000 | [summary]
Returns:
[type]: [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | power | CkiChen/pymindaffectBCI | python | def power(self):
'[summary]\n\n Returns:\n [type]: [description]\n '
return (self.sXX / self.sXX_N) |
def testcase(self):
'[summary]\n '
import matplotlib.pyplot as plt
X = np.random.randn(10000, 2)
pt = power_tracker(100, 100, 100)
print('All at once: power={}'.format(pt.transform(X)))
pt = power_tracker(100, 1000, 1000)
print('alpha_mu={} alpha_pow={}'.format(pt.alpha_mu, pt.alpha_p... | 3,154,473,121,034,125,300 | [summary] | mindaffectBCI/decoder/UtopiaDataInterface.py | testcase | CkiChen/pymindaffectBCI | python | def testcase(self):
'\n '
import matplotlib.pyplot as plt
X = np.random.randn(10000, 2)
pt = power_tracker(100, 100, 100)
print('All at once: power={}'.format(pt.transform(X)))
pt = power_tracker(100, 1000, 1000)
print('alpha_mu={} alpha_pow={}'.format(pt.alpha_mu, pt.alpha_power))
... |
def __init__(self, fs=None, sample2timestamp=None, max_delta=200):
'tranform from per-packet (i.e. multiple-samples) to per-sample timestamps\n\n Args:\n fs (float): default sample rate, used when no other timing info is available\n sample2timestamp (transformer, optional): class to de-... | 8,096,475,303,372,531,000 | tranform from per-packet (i.e. multiple-samples) to per-sample timestamps
Args:
fs (float): default sample rate, used when no other timing info is available
sample2timestamp (transformer, optional): class to de-jitter timestamps based on sample-count. Defaults to None. | mindaffectBCI/decoder/UtopiaDataInterface.py | __init__ | CkiChen/pymindaffectBCI | python | def __init__(self, fs=None, sample2timestamp=None, max_delta=200):
'tranform from per-packet (i.e. multiple-samples) to per-sample timestamps\n\n Args:\n fs (float): default sample rate, used when no other timing info is available\n sample2timestamp (transformer, optional): class to de-... |
def fit(self, ts, nsamp=1):
'[summary]\n\n Args:\n ts ([type]): [description]\n nsamp (int, optional): [description]. Defaults to 1.\n '
self.last_sample_timestamp_ = ts
self.n_ = 0 | -909,119,697,521,445,400 | [summary]
Args:
ts ([type]): [description]
nsamp (int, optional): [description]. Defaults to 1. | mindaffectBCI/decoder/UtopiaDataInterface.py | fit | CkiChen/pymindaffectBCI | python | def fit(self, ts, nsamp=1):
'[summary]\n\n Args:\n ts ([type]): [description]\n nsamp (int, optional): [description]. Defaults to 1.\n '
self.last_sample_timestamp_ = ts
self.n_ = 0 |
def transform(self, timestamp: float, nsamp: int=1):
'add per-sample timestamp information to the data matrix\n\n Args:\n timestamp (float): the timestamp of the last sample of d\n nsamp(int): number of samples to interpolate\n\n Returns:\n np.ndarray: (nsamp) the inte... | -4,200,367,045,856,528,400 | add per-sample timestamp information to the data matrix
Args:
timestamp (float): the timestamp of the last sample of d
nsamp(int): number of samples to interpolate
Returns:
np.ndarray: (nsamp) the interpolated time-stamps | mindaffectBCI/decoder/UtopiaDataInterface.py | transform | CkiChen/pymindaffectBCI | python | def transform(self, timestamp: float, nsamp: int=1):
'add per-sample timestamp information to the data matrix\n\n Args:\n timestamp (float): the timestamp of the last sample of d\n nsamp(int): number of samples to interpolate\n\n Returns:\n np.ndarray: (nsamp) the inte... |
def testcase(self, npkt=1000, fs=100):
'[summary]\n\n Args:\n npkt (int, optional): [description]. Defaults to 1000.\n fs (int, optional): [description]. Defaults to 100.\n '
nsamp = np.random.random_integers(0, 10, size=(npkt,))
ts_true = ((np.arange(np.sum(nsamp)) * 100... | -9,214,255,085,325,899,000 | [summary]
Args:
npkt (int, optional): [description]. Defaults to 1000.
fs (int, optional): [description]. Defaults to 100. | mindaffectBCI/decoder/UtopiaDataInterface.py | testcase | CkiChen/pymindaffectBCI | python | def testcase(self, npkt=1000, fs=100):
'[summary]\n\n Args:\n npkt (int, optional): [description]. Defaults to 1000.\n fs (int, optional): [description]. Defaults to 100.\n '
nsamp = np.random.random_integers(0, 10, size=(npkt,))
ts_true = ((np.arange(np.sum(nsamp)) * 100... |
def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n '
self.W_ = np.zeros((self.order, X.shape[(- 1)]), dtype=X.dtype)
self.W_[(- 1), :] = 1
(_, self.W_) = self.transform(X[1:, :]) | -6,270,560,603,298,594,000 | [summary]
Args:
X ([type]): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | fit | CkiChen/pymindaffectBCI | python | def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n '
self.W_ = np.zeros((self.order, X.shape[(- 1)]), dtype=X.dtype)
self.W_[(- 1), :] = 1
(_, self.W_) = self.transform(X[1:, :]) |
def transform(self, X):
'add per-sample timestamp information to the data matrix\n\n Args:\n X (float): the data to decorrelate\n nsamp(int): number of samples to interpolate\n\n Returns:\n np.ndarray: the decorrelated data\n '
if (not hasattr(self, 'W_')):
... | 1,294,235,935,748,090,400 | add per-sample timestamp information to the data matrix
Args:
X (float): the data to decorrelate
nsamp(int): number of samples to interpolate
Returns:
np.ndarray: the decorrelated data | mindaffectBCI/decoder/UtopiaDataInterface.py | transform | CkiChen/pymindaffectBCI | python | def transform(self, X):
'add per-sample timestamp information to the data matrix\n\n Args:\n X (float): the data to decorrelate\n nsamp(int): number of samples to interpolate\n\n Returns:\n np.ndarray: the decorrelated data\n '
if (not hasattr(self, 'W_')):
... |
def testcase(self, dur=3, fs=100, blksize=10):
'[summary]\n\n Args:\n dur (int, optional): [description]. Defaults to 3.\n fs (int, optional): [description]. Defaults to 100.\n blksize (int, optional): [description]. Defaults to 10.\n '
import numpy as np
impor... | -1,198,068,088,960,186,600 | [summary]
Args:
dur (int, optional): [description]. Defaults to 3.
fs (int, optional): [description]. Defaults to 100.
blksize (int, optional): [description]. Defaults to 10. | mindaffectBCI/decoder/UtopiaDataInterface.py | testcase | CkiChen/pymindaffectBCI | python | def testcase(self, dur=3, fs=100, blksize=10):
'[summary]\n\n Args:\n dur (int, optional): [description]. Defaults to 3.\n fs (int, optional): [description]. Defaults to 100.\n blksize (int, optional): [description]. Defaults to 10.\n '
import numpy as np
impor... |
def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n '
self.sigma2_ = np.zeros((X.shape[(- 1)],), dtype=X.dtype)
self.sigma2_ = (X[0, :] * X[0, :])
self.transform(X[1:, :]) | 5,082,720,218,458,383,000 | [summary]
Args:
X ([type]): [description] | mindaffectBCI/decoder/UtopiaDataInterface.py | fit | CkiChen/pymindaffectBCI | python | def fit(self, X):
'[summary]\n\n Args:\n X ([type]): [description]\n '
self.sigma2_ = np.zeros((X.shape[(- 1)],), dtype=X.dtype)
self.sigma2_ = (X[0, :] * X[0, :])
self.transform(X[1:, :]) |
def transform(self, X):
'add per-sample timestamp information to the data matrix\n\n Args:\n X (float): the data to decorrelate\n\n Returns:\n np.ndarray: the decorrelated data\n '
if (not hasattr(self, 'sigma2_')):
self.fit(X)
(X, self.W_) = standardize_ch... | 2,438,386,620,523,981,000 | add per-sample timestamp information to the data matrix
Args:
X (float): the data to decorrelate
Returns:
np.ndarray: the decorrelated data | mindaffectBCI/decoder/UtopiaDataInterface.py | transform | CkiChen/pymindaffectBCI | python | def transform(self, X):
'add per-sample timestamp information to the data matrix\n\n Args:\n X (float): the data to decorrelate\n\n Returns:\n np.ndarray: the decorrelated data\n '
if (not hasattr(self, 'sigma2_')):
self.fit(X)
(X, self.W_) = standardize_ch... |
def testcase(self, dur=3, fs=100, blksize=10):
'[summary]\n\n Args:\n dur (int, optional): [description]. Defaults to 3.\n fs (int, optional): [description]. Defaults to 100.\n blksize (int, optional): [description]. Defaults to 10.\n '
import numpy as np
impor... | 6,321,695,239,963,563,000 | [summary]
Args:
dur (int, optional): [description]. Defaults to 3.
fs (int, optional): [description]. Defaults to 100.
blksize (int, optional): [description]. Defaults to 10. | mindaffectBCI/decoder/UtopiaDataInterface.py | testcase | CkiChen/pymindaffectBCI | python | def testcase(self, dur=3, fs=100, blksize=10):
'[summary]\n\n Args:\n dur (int, optional): [description]. Defaults to 3.\n fs (int, optional): [description]. Defaults to 100.\n blksize (int, optional): [description]. Defaults to 10.\n '
import numpy as np
impor... |
def _read_fmt_chunk(fid, is_big_endian):
'\n Returns\n -------\n size : int\n size of format subchunk in bytes (minus 8 for "fmt " and itself)\n format_tag : int\n PCM, float, or compressed format\n channels : int\n number of channels\n fs : int\n sampling frequency in ... | -1,035,857,940,140,194,300 | Returns
-------
size : int
size of format subchunk in bytes (minus 8 for "fmt " and itself)
format_tag : int
PCM, float, or compressed format
channels : int
number of channels
fs : int
sampling frequency in samples per second
bytes_per_second : int
overall byte rate for the file
block_align : int
... | scipy/io/wavfile.py | _read_fmt_chunk | AKuederle/scipy | python | def _read_fmt_chunk(fid, is_big_endian):
'\n Returns\n -------\n size : int\n size of format subchunk in bytes (minus 8 for "fmt " and itself)\n format_tag : int\n PCM, float, or compressed format\n channels : int\n number of channels\n fs : int\n sampling frequency in ... |
def read(filename, mmap=False):
'\n Open a WAV file\n\n Return the sample rate (in samples/sec) and data from a WAV file.\n\n Parameters\n ----------\n filename : string or open file handle\n Input wav file.\n mmap : bool, optional\n Whether to read data as memory-mapped.\n On... | -5,569,298,711,442,947,000 | Open a WAV file
Return the sample rate (in samples/sec) and data from a WAV file.
Parameters
----------
filename : string or open file handle
Input wav file.
mmap : bool, optional
Whether to read data as memory-mapped.
Only to be used on real files (Default: False).
.. versionadded:: 0.12.0
Returns
... | scipy/io/wavfile.py | read | AKuederle/scipy | python | def read(filename, mmap=False):
'\n Open a WAV file\n\n Return the sample rate (in samples/sec) and data from a WAV file.\n\n Parameters\n ----------\n filename : string or open file handle\n Input wav file.\n mmap : bool, optional\n Whether to read data as memory-mapped.\n On... |
def write(filename, rate, data):
'\n Write a NumPy array as a WAV file.\n\n Parameters\n ----------\n filename : string or open file handle\n Output wav file.\n rate : int\n The sample rate (in samples/sec).\n data : ndarray\n A 1-D or 2-D NumPy array of either integer or floa... | -1,827,049,610,991,448,600 | Write a NumPy array as a WAV file.
Parameters
----------
filename : string or open file handle
Output wav file.
rate : int
The sample rate (in samples/sec).
data : ndarray
A 1-D or 2-D NumPy array of either integer or float data-type.
Notes
-----
* Writes a simple uncompressed WAV file.
* To write multipl... | scipy/io/wavfile.py | write | AKuederle/scipy | python | def write(filename, rate, data):
'\n Write a NumPy array as a WAV file.\n\n Parameters\n ----------\n filename : string or open file handle\n Output wav file.\n rate : int\n The sample rate (in samples/sec).\n data : ndarray\n A 1-D or 2-D NumPy array of either integer or floa... |
def StreptomycesSpNrrlf5008(directed: bool=False, preprocess: bool=True, load_nodes: bool=True, verbose: int=2, cache: bool=True, cache_path: str='graphs/string', version: str='links.v11.5', **additional_graph_kwargs: Dict) -> Graph:
'Return new instance of the Streptomyces sp. NRRLF5008 graph.\n\n The graph is ... | 1,039,991,421,972,142,100 | Return new instance of the Streptomyces sp. NRRLF5008 graph.
The graph is automatically retrieved from the STRING repository.
Parameters
-------------------
directed: bool = False
Wether to load the graph as directed or undirected.
By default false.
preprocess: bool = True
Whether to preprocess the gr... | bindings/python/ensmallen/datasets/string/streptomycesspnrrlf5008.py | StreptomycesSpNrrlf5008 | AnacletoLAB/ensmallen | python | def StreptomycesSpNrrlf5008(directed: bool=False, preprocess: bool=True, load_nodes: bool=True, verbose: int=2, cache: bool=True, cache_path: str='graphs/string', version: str='links.v11.5', **additional_graph_kwargs: Dict) -> Graph:
'Return new instance of the Streptomyces sp. NRRLF5008 graph.\n\n The graph is ... |
def compute_mask(coords, indices):
'\n Gets the mask for the coords given the indices in slice format.\n\n Works with either start-stop ranges of matching indices into coords\n called "pairs" (start-stop pairs) or filters the mask directly, based\n on which is faster.\n\n Exploits the structure in so... | -8,573,733,571,166,544,000 | Gets the mask for the coords given the indices in slice format.
Works with either start-stop ranges of matching indices into coords
called "pairs" (start-stop pairs) or filters the mask directly, based
on which is faster.
Exploits the structure in sorted coords, which is that for a constant
value of coords[i - 1], co... | pythran/tests/pydata/compute_mask.py | compute_mask | AlifeLines/pythran | python | def compute_mask(coords, indices):
'\n Gets the mask for the coords given the indices in slice format.\n\n Works with either start-stop ranges of matching indices into coords\n called "pairs" (start-stop pairs) or filters the mask directly, based\n on which is faster.\n\n Exploits the structure in so... |
def _get_slice_len(idx):
'\n Get the number of elements in a slice.\n\n Parameters\n ----------\n idx : np.ndarray\n A (3,) shaped array containing start, stop, step\n\n Returns\n -------\n n : int\n The length of the slice.\n\n Examples\n --------\n >>> idx = np.array([5... | -4,259,978,124,523,301,000 | Get the number of elements in a slice.
Parameters
----------
idx : np.ndarray
A (3,) shaped array containing start, stop, step
Returns
-------
n : int
The length of the slice.
Examples
--------
>>> idx = np.array([5, 15, 5])
>>> _get_slice_len(idx)
2 | pythran/tests/pydata/compute_mask.py | _get_slice_len | AlifeLines/pythran | python | def _get_slice_len(idx):
'\n Get the number of elements in a slice.\n\n Parameters\n ----------\n idx : np.ndarray\n A (3,) shaped array containing start, stop, step\n\n Returns\n -------\n n : int\n The length of the slice.\n\n Examples\n --------\n >>> idx = np.array([5... |
def _get_mask_pairs(starts_old, stops_old, c, idx):
"\n Gets the pairs for a following dimension given the pairs for\n a dimension.\n\n For each pair, it searches in the following dimension for\n matching coords and returns those.\n\n The total combined length of all pairs is returned to\n help wi... | -5,647,724,412,426,087,000 | Gets the pairs for a following dimension given the pairs for
a dimension.
For each pair, it searches in the following dimension for
matching coords and returns those.
The total combined length of all pairs is returned to
help with the performance guesstimate.
Parameters
----------
starts_old, stops_old : list[int]
... | pythran/tests/pydata/compute_mask.py | _get_mask_pairs | AlifeLines/pythran | python | def _get_mask_pairs(starts_old, stops_old, c, idx):
"\n Gets the pairs for a following dimension given the pairs for\n a dimension.\n\n For each pair, it searches in the following dimension for\n matching coords and returns those.\n\n The total combined length of all pairs is returned to\n help wi... |
def _join_adjacent_pairs(starts_old, stops_old):
'\n Joins adjacent pairs into one. For example, 2-5 and 5-7\n will reduce to 2-7 (a single pair). This may help in\n returning a slice in the end which could be faster.\n\n Parameters\n ----------\n starts_old, stops_old : list[int]\n The inp... | -2,693,863,116,294,275,000 | Joins adjacent pairs into one. For example, 2-5 and 5-7
will reduce to 2-7 (a single pair). This may help in
returning a slice in the end which could be faster.
Parameters
----------
starts_old, stops_old : list[int]
The input starts and stops
Returns
-------
starts, stops : list[int]
The reduced starts and s... | pythran/tests/pydata/compute_mask.py | _join_adjacent_pairs | AlifeLines/pythran | python | def _join_adjacent_pairs(starts_old, stops_old):
'\n Joins adjacent pairs into one. For example, 2-5 and 5-7\n will reduce to 2-7 (a single pair). This may help in\n returning a slice in the end which could be faster.\n\n Parameters\n ----------\n starts_old, stops_old : list[int]\n The inp... |
def _filter_pairs(starts, stops, coords, indices):
'\n Converts all the pairs into a single integer mask, additionally filtering\n by the indices.\n\n Parameters\n ----------\n starts, stops : list[int]\n The starts and stops to convert into an array.\n coords : np.ndarray\n The coor... | 1,796,064,902,100,777,000 | Converts all the pairs into a single integer mask, additionally filtering
by the indices.
Parameters
----------
starts, stops : list[int]
The starts and stops to convert into an array.
coords : np.ndarray
The coordinates to filter by.
indices : np.ndarray
The indices in the form of slices such that indices... | pythran/tests/pydata/compute_mask.py | _filter_pairs | AlifeLines/pythran | python | def _filter_pairs(starts, stops, coords, indices):
'\n Converts all the pairs into a single integer mask, additionally filtering\n by the indices.\n\n Parameters\n ----------\n starts, stops : list[int]\n The starts and stops to convert into an array.\n coords : np.ndarray\n The coor... |
def collect_files(img_dir, gt_dir):
'Collect all images and their corresponding groundtruth files.\n\n Args:\n img_dir (str): The image directory\n gt_dir (str): The groundtruth directory\n\n Returns:\n files (list): The list of tuples (img_file, groundtruth_file)\n '
assert isinst... | 18,978,806,529,696,932 | Collect all images and their corresponding groundtruth files.
Args:
img_dir (str): The image directory
gt_dir (str): The groundtruth directory
Returns:
files (list): The list of tuples (img_file, groundtruth_file) | tools/data/textdet/funsd_converter.py | collect_files | GHuiXin/mmocr | python | def collect_files(img_dir, gt_dir):
'Collect all images and their corresponding groundtruth files.\n\n Args:\n img_dir (str): The image directory\n gt_dir (str): The groundtruth directory\n\n Returns:\n files (list): The list of tuples (img_file, groundtruth_file)\n '
assert isinst... |
def collect_annotations(files, nproc=1):
'Collect the annotation information.\n\n Args:\n files (list): The list of tuples (image_file, groundtruth_file)\n nproc (int): The number of process to collect annotations\n\n Returns:\n images (list): The list of image information dicts\n '
... | -5,933,038,107,388,529,000 | Collect the annotation information.
Args:
files (list): The list of tuples (image_file, groundtruth_file)
nproc (int): The number of process to collect annotations
Returns:
images (list): The list of image information dicts | tools/data/textdet/funsd_converter.py | collect_annotations | GHuiXin/mmocr | python | def collect_annotations(files, nproc=1):
'Collect the annotation information.\n\n Args:\n files (list): The list of tuples (image_file, groundtruth_file)\n nproc (int): The number of process to collect annotations\n\n Returns:\n images (list): The list of image information dicts\n '
... |
def load_img_info(files):
'Load the information of one image.\n\n Args:\n files (tuple): The tuple of (img_file, groundtruth_file)\n\n Returns:\n img_info (dict): The dict of the img and annotation information\n '
assert isinstance(files, tuple)
(img_file, gt_file) = files
assert ... | 7,809,661,699,419,274,000 | Load the information of one image.
Args:
files (tuple): The tuple of (img_file, groundtruth_file)
Returns:
img_info (dict): The dict of the img and annotation information | tools/data/textdet/funsd_converter.py | load_img_info | GHuiXin/mmocr | python | def load_img_info(files):
'Load the information of one image.\n\n Args:\n files (tuple): The tuple of (img_file, groundtruth_file)\n\n Returns:\n img_info (dict): The dict of the img and annotation information\n '
assert isinstance(files, tuple)
(img_file, gt_file) = files
assert ... |
def load_json_info(gt_file, img_info):
'Collect the annotation information.\n\n Args:\n gt_file (str): The path to ground-truth\n img_info (dict): The dict of the img and annotation information\n\n Returns:\n img_info (dict): The dict of the img and annotation information\n '
annot... | 8,850,481,707,175,886,000 | Collect the annotation information.
Args:
gt_file (str): The path to ground-truth
img_info (dict): The dict of the img and annotation information
Returns:
img_info (dict): The dict of the img and annotation information | tools/data/textdet/funsd_converter.py | load_json_info | GHuiXin/mmocr | python | def load_json_info(gt_file, img_info):
'Collect the annotation information.\n\n Args:\n gt_file (str): The path to ground-truth\n img_info (dict): The dict of the img and annotation information\n\n Returns:\n img_info (dict): The dict of the img and annotation information\n '
annot... |
def optimize(expr, optimizations):
" Apply optimizations to an expression.\n\n Parameters\n ==========\n\n expr : expression\n optimizations : iterable of ``Optimization`` instances\n The optimizations will be sorted with respect to ``priority`` (highest first).\n\n Examples\n ========\n\n ... | 1,866,487,192,515,732,200 | Apply optimizations to an expression.
Parameters
==========
expr : expression
optimizations : iterable of ``Optimization`` instances
The optimizations will be sorted with respect to ``priority`` (highest first).
Examples
========
>>> from sympy import log, Symbol
>>> from sympy.codegen.rewriting import optims_c... | sympy/codegen/rewriting.py | optimize | Abhishek-IOT/sympy | python | def optimize(expr, optimizations):
" Apply optimizations to an expression.\n\n Parameters\n ==========\n\n expr : expression\n optimizations : iterable of ``Optimization`` instances\n The optimizations will be sorted with respect to ``priority`` (highest first).\n\n Examples\n ========\n\n ... |
def create_expand_pow_optimization(limit):
" Creates an instance of :class:`ReplaceOptim` for expanding ``Pow``.\n\n The requirements for expansions are that the base needs to be a symbol\n and the exponent needs to be an Integer (and be less than or equal to\n ``limit``).\n\n Parameters\n ==========... | 6,880,643,915,469,284,000 | Creates an instance of :class:`ReplaceOptim` for expanding ``Pow``.
The requirements for expansions are that the base needs to be a symbol
and the exponent needs to be an Integer (and be less than or equal to
``limit``).
Parameters
==========
limit : int
The highest power which is expanded into multiplication.
... | sympy/codegen/rewriting.py | create_expand_pow_optimization | Abhishek-IOT/sympy | python | def create_expand_pow_optimization(limit):
" Creates an instance of :class:`ReplaceOptim` for expanding ``Pow``.\n\n The requirements for expansions are that the base needs to be a symbol\n and the exponent needs to be an Integer (and be less than or equal to\n ``limit``).\n\n Parameters\n ==========... |
def main():
'Main function. Read coordinates, fetch addresses and write on file.'
logfile = open(LOGNAME, 'r')
datafile = open(DATANAME, 'w')
logfile.readline()
print('fetching addresses...')
line = logfile.readline()
while ((not line.startswith('***')) and line.strip()):
(cat, lat, ... | 987,414,624,452,161,200 | Main function. Read coordinates, fetch addresses and write on file. | locate.py | main | jdnietov/wazeReading | python | def main():
logfile = open(LOGNAME, 'r')
datafile = open(DATANAME, 'w')
logfile.readline()
print('fetching addresses...')
line = logfile.readline()
while ((not line.startswith('***')) and line.strip()):
(cat, lat, lng) = line.split(';')
latlng = ('%s,%s' % (lat, lng))
... |
def get_x_coordinate(width, year_index):
'\n Given the width of the canvas and the index of the current year\n in the YEARS list, returns the x coordinate of the vertical\n line associated with that year.\n\n Input:\n width (int): The width of the canvas\n year_index (int): The index of th... | -1,885,833,101,397,108,200 | Given the width of the canvas and the index of the current year
in the YEARS list, returns the x coordinate of the vertical
line associated with that year.
Input:
width (int): The width of the canvas
year_index (int): The index of the current year in the YEARS list
Returns:
x_coordinate (int): The x coordi... | stancode_project/baby_names/babygraphics.py | get_x_coordinate | beomgyutxt/stanCode_project | python | def get_x_coordinate(width, year_index):
'\n Given the width of the canvas and the index of the current year\n in the YEARS list, returns the x coordinate of the vertical\n line associated with that year.\n\n Input:\n width (int): The width of the canvas\n year_index (int): The index of th... |
def draw_fixed_lines(canvas):
'\n Erases all existing information on the given canvas and then\n draws the fixed background lines on it.\n\n Input:\n canvas (Tkinter Canvas): The canvas on which we are drawing.\n\n Returns:\n This function does not return any value.\n '
canvas.delet... | 7,858,595,460,280,777,000 | Erases all existing information on the given canvas and then
draws the fixed background lines on it.
Input:
canvas (Tkinter Canvas): The canvas on which we are drawing.
Returns:
This function does not return any value. | stancode_project/baby_names/babygraphics.py | draw_fixed_lines | beomgyutxt/stanCode_project | python | def draw_fixed_lines(canvas):
'\n Erases all existing information on the given canvas and then\n draws the fixed background lines on it.\n\n Input:\n canvas (Tkinter Canvas): The canvas on which we are drawing.\n\n Returns:\n This function does not return any value.\n '
canvas.delet... |
def draw_names(canvas, name_data, lookup_names):
'\n Given a dict of baby name data and a list of name, plots\n the historical trend of those names onto the canvas.\n\n Input:\n canvas (Tkinter Canvas): The canvas on which we are drawing.\n name_data (dict): Dictionary holding baby name data\... | -8,383,493,657,984,384,000 | Given a dict of baby name data and a list of name, plots
the historical trend of those names onto the canvas.
Input:
canvas (Tkinter Canvas): The canvas on which we are drawing.
name_data (dict): Dictionary holding baby name data
lookup_names (List[str]): A list of names whose data you want to plot
Return... | stancode_project/baby_names/babygraphics.py | draw_names | beomgyutxt/stanCode_project | python | def draw_names(canvas, name_data, lookup_names):
'\n Given a dict of baby name data and a list of name, plots\n the historical trend of those names onto the canvas.\n\n Input:\n canvas (Tkinter Canvas): The canvas on which we are drawing.\n name_data (dict): Dictionary holding baby name data\... |
def toElement(self, legacyDelay=False):
'\n Render into a domish Element.\n\n @param legacyDelay: If C{True} send the delayed delivery information\n in legacy format.\n '
element = xmppim.Message.toElement(self)
if self.delay:
element.addChild(self.delay.toElement(legacy=... | -3,488,027,034,297,016,000 | Render into a domish Element.
@param legacyDelay: If C{True} send the delayed delivery information
in legacy format. | wokkel/muc.py | toElement | Gandi/wokkel | python | def toElement(self, legacyDelay=False):
'\n Render into a domish Element.\n\n @param legacyDelay: If C{True} send the delayed delivery information\n in legacy format.\n '
element = xmppim.Message.toElement(self)
if self.delay:
element.addChild(self.delay.toElement(legacy=... |
def toElement(self):
'\n Returns a L{domish.Element} representing the history options.\n '
element = domish.Element((NS_MUC, 'history'))
for key in self.attributes:
value = getattr(self, key, None)
if (value is not None):
if (key == 'since'):
stamp =... | 957,642,058,368,581,200 | Returns a L{domish.Element} representing the history options. | wokkel/muc.py | toElement | Gandi/wokkel | python | def toElement(self):
'\n \n '
element = domish.Element((NS_MUC, 'history'))
for key in self.attributes:
value = getattr(self, key, None)
if (value is not None):
if (key == 'since'):
stamp = value.astimezone(tzutc())
element[key] = sta... |
def _childParser_mucUser(self, element):
'\n Parse the MUC user extension element.\n '
for child in element.elements():
if (child.uri != NS_MUC_USER):
continue
elif (child.name == 'status'):
try:
value = int(child.getAttribute('code'))
... | -8,153,738,244,076,290,000 | Parse the MUC user extension element. | wokkel/muc.py | _childParser_mucUser | Gandi/wokkel | python | def _childParser_mucUser(self, element):
'\n \n '
for child in element.elements():
if (child.uri != NS_MUC_USER):
continue
elif (child.name == 'status'):
try:
value = int(child.getAttribute('code'))
statusCode = STATUS_CODE.lo... |
def connectionInitialized(self):
'\n Called when the XML stream has been initialized.\n\n It initializes several XPath events to handle MUC stanzas that come\n in.\n '
xmppim.BasePresenceProtocol.connectionInitialized(self)
self.xmlstream.addObserver(GROUPCHAT, self._onGroupChat)... | -618,956,503,203,230,200 | Called when the XML stream has been initialized.
It initializes several XPath events to handle MUC stanzas that come
in. | wokkel/muc.py | connectionInitialized | Gandi/wokkel | python | def connectionInitialized(self):
'\n Called when the XML stream has been initialized.\n\n It initializes several XPath events to handle MUC stanzas that come\n in.\n '
xmppim.BasePresenceProtocol.connectionInitialized(self)
self.xmlstream.addObserver(GROUPCHAT, self._onGroupChat)... |
def _onGroupChat(self, element):
'\n A group chat message has been received from a MUC room.\n\n There are a few event methods that may get called here.\n L{receivedGroupChat}, L{receivedSubject} or L{receivedHistory}.\n '
message = GroupChat.fromElement(element)
self.groupChatRe... | 7,946,529,378,002,423,000 | A group chat message has been received from a MUC room.
There are a few event methods that may get called here.
L{receivedGroupChat}, L{receivedSubject} or L{receivedHistory}. | wokkel/muc.py | _onGroupChat | Gandi/wokkel | python | def _onGroupChat(self, element):
'\n A group chat message has been received from a MUC room.\n\n There are a few event methods that may get called here.\n L{receivedGroupChat}, L{receivedSubject} or L{receivedHistory}.\n '
message = GroupChat.fromElement(element)
self.groupChatRe... |
def groupChatReceived(self, message):
'\n Called when a groupchat message was received.\n\n This method is called with a parsed representation of a received\n groupchat message and can be overridden for further processing.\n\n For regular groupchat message, the C{body} attribute contains... | -6,893,553,630,542,734,000 | Called when a groupchat message was received.
This method is called with a parsed representation of a received
groupchat message and can be overridden for further processing.
For regular groupchat message, the C{body} attribute contains the
message body. Conversation history sent by the room upon joining, will
have t... | wokkel/muc.py | groupChatReceived | Gandi/wokkel | python | def groupChatReceived(self, message):
'\n Called when a groupchat message was received.\n\n This method is called with a parsed representation of a received\n groupchat message and can be overridden for further processing.\n\n For regular groupchat message, the C{body} attribute contains... |
def _sendDeferred(self, stanza):
'\n Send presence stanza, adding a deferred with a timeout.\n\n @param stanza: The presence stanza to send over the wire.\n @type stanza: L{generic.Stanza}\n\n @param timeout: The number of seconds to wait before the deferred is\n timed out.\n ... | -7,452,771,661,565,527,000 | Send presence stanza, adding a deferred with a timeout.
@param stanza: The presence stanza to send over the wire.
@type stanza: L{generic.Stanza}
@param timeout: The number of seconds to wait before the deferred is
timed out.
@type timeout: C{int}
The deferred object L{defer.Deferred} is returned. | wokkel/muc.py | _sendDeferred | Gandi/wokkel | python | def _sendDeferred(self, stanza):
'\n Send presence stanza, adding a deferred with a timeout.\n\n @param stanza: The presence stanza to send over the wire.\n @type stanza: L{generic.Stanza}\n\n @param timeout: The number of seconds to wait before the deferred is\n timed out.\n ... |
def join(self, roomJID, nick, historyOptions=None, password=None):
'\n Join a MUC room by sending presence to it.\n\n @param roomJID: The JID of the room the entity is joining.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param nick: The nick name for the entitity... | 7,766,148,615,772,783,000 | Join a MUC room by sending presence to it.
@param roomJID: The JID of the room the entity is joining.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param nick: The nick name for the entitity joining the room.
@type nick: C{unicode}
@param historyOptions: Options for conversation history sent by the
... | wokkel/muc.py | join | Gandi/wokkel | python | def join(self, roomJID, nick, historyOptions=None, password=None):
'\n Join a MUC room by sending presence to it.\n\n @param roomJID: The JID of the room the entity is joining.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param nick: The nick name for the entitity... |
def nick(self, roomJID, nick):
"\n Change an entity's nick name in a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#changenick\n\n @param roomJID: The JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param nick: The new nick name w... | 8,459,624,295,962,374,000 | Change an entity's nick name in a MUC room.
See: http://xmpp.org/extensions/xep-0045.html#changenick
@param roomJID: The JID of the room.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param nick: The new nick name within the room.
@type nick: C{unicode} | wokkel/muc.py | nick | Gandi/wokkel | python | def nick(self, roomJID, nick):
"\n Change an entity's nick name in a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#changenick\n\n @param roomJID: The JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param nick: The new nick name w... |
def status(self, roomJID, show=None, status=None):
'\n Change user status.\n\n See: http://xmpp.org/extensions/xep-0045.html#changepres\n\n @param roomJID: The Room JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param show: The availability o... | -6,188,022,030,358,750,000 | Change user status.
See: http://xmpp.org/extensions/xep-0045.html#changepres
@param roomJID: The Room JID of the room.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param show: The availability of the entity. Common values are xa,
available, etc
@type show: C{unicode}
@param status: The current... | wokkel/muc.py | status | Gandi/wokkel | python | def status(self, roomJID, show=None, status=None):
'\n Change user status.\n\n See: http://xmpp.org/extensions/xep-0045.html#changepres\n\n @param roomJID: The Room JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param show: The availability o... |
def leave(self, roomJID):
'\n Leave a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#exit\n\n @param roomJID: The JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n '
occupantJID = self._roomOccupantMap[roomJID]
presence = xmppi... | -1,254,793,334,089,341,400 | Leave a MUC room.
See: http://xmpp.org/extensions/xep-0045.html#exit
@param roomJID: The JID of the room.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>} | wokkel/muc.py | leave | Gandi/wokkel | python | def leave(self, roomJID):
'\n Leave a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#exit\n\n @param roomJID: The JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n '
occupantJID = self._roomOccupantMap[roomJID]
presence = xmppi... |
def groupChat(self, roomJID, body):
'\n Send a groupchat message.\n '
message = GroupChat(recipient=roomJID, body=body)
self.send(message.toElement()) | 6,700,500,881,912,077,000 | Send a groupchat message. | wokkel/muc.py | groupChat | Gandi/wokkel | python | def groupChat(self, roomJID, body):
'\n \n '
message = GroupChat(recipient=roomJID, body=body)
self.send(message.toElement()) |
def chat(self, occupantJID, body):
'\n Send a private chat message to a user in a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#privatemessage\n\n @param occupantJID: The Room JID of the other user.\n @type occupantJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n ... | 6,678,183,103,771,934,000 | Send a private chat message to a user in a MUC room.
See: http://xmpp.org/extensions/xep-0045.html#privatemessage
@param occupantJID: The Room JID of the other user.
@type occupantJID: L{JID<twisted.words.protocols.jabber.jid.JID>} | wokkel/muc.py | chat | Gandi/wokkel | python | def chat(self, occupantJID, body):
'\n Send a private chat message to a user in a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#privatemessage\n\n @param occupantJID: The Room JID of the other user.\n @type occupantJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n ... |
def subject(self, roomJID, subject):
'\n Change the subject of a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#subject-mod\n\n @param roomJID: The bare JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param subject: The subject yo... | 84,716,214,549,814,260 | Change the subject of a MUC room.
See: http://xmpp.org/extensions/xep-0045.html#subject-mod
@param roomJID: The bare JID of the room.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param subject: The subject you want to set.
@type subject: C{unicode} | wokkel/muc.py | subject | Gandi/wokkel | python | def subject(self, roomJID, subject):
'\n Change the subject of a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#subject-mod\n\n @param roomJID: The bare JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param subject: The subject yo... |
def invite(self, roomJID, invitee, reason=None):
'\n Invite a xmpp entity to a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#invite\n\n @param roomJID: The bare JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param invitee: The e... | 2,277,563,155,247,746,300 | Invite a xmpp entity to a MUC room.
See: http://xmpp.org/extensions/xep-0045.html#invite
@param roomJID: The bare JID of the room.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param invitee: The entity that is being invited.
@type invitee: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param reas... | wokkel/muc.py | invite | Gandi/wokkel | python | def invite(self, roomJID, invitee, reason=None):
'\n Invite a xmpp entity to a MUC room.\n\n See: http://xmpp.org/extensions/xep-0045.html#invite\n\n @param roomJID: The bare JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param invitee: The e... |
def getRegisterForm(self, roomJID):
'\n Grab the registration form for a MUC room.\n\n @param room: The room jabber/xmpp entity id for the requested\n registration form.\n @type room: L{JID<twisted.words.protocols.jabber.jid.JID>}\n '
def cb(response):
form = data... | 603,588,402,837,602,400 | Grab the registration form for a MUC room.
@param room: The room jabber/xmpp entity id for the requested
registration form.
@type room: L{JID<twisted.words.protocols.jabber.jid.JID>} | wokkel/muc.py | getRegisterForm | Gandi/wokkel | python | def getRegisterForm(self, roomJID):
'\n Grab the registration form for a MUC room.\n\n @param room: The room jabber/xmpp entity id for the requested\n registration form.\n @type room: L{JID<twisted.words.protocols.jabber.jid.JID>}\n '
def cb(response):
form = data... |
def register(self, roomJID, options):
'\n Send a request to register for a room.\n\n @param roomJID: The bare JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param options: A mapping of field names to values, or C{None} to\n cancel.\n ... | 8,946,513,596,048,187,000 | Send a request to register for a room.
@param roomJID: The bare JID of the room.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}
@param options: A mapping of field names to values, or C{None} to
cancel.
@type options: C{dict} | wokkel/muc.py | register | Gandi/wokkel | python | def register(self, roomJID, options):
'\n Send a request to register for a room.\n\n @param roomJID: The bare JID of the room.\n @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n @param options: A mapping of field names to values, or C{None} to\n cancel.\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.