body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
b5c2eb92c4279c74d4acc969da85f011f5f8af3c2a8b75826d8539be52f48249 | def snapshot(self):
'\n Callback function for the snapshot button\n Saves the image to path\n '
snap = self.current_frame()
timestamp = '{:%Y%m%d-%H%M%S}'.format(datetime.now())
snap_path = ((self.path + timestamp) + '.png')
cv2.imwrite(snap_path, snap)
print('[INFO] Saved S... | Callback function for the snapshot button
Saves the image to path | webcamgui/App.py | snapshot | MrGrayCode/webcamgui | 0 | python | def snapshot(self):
'\n Callback function for the snapshot button\n Saves the image to path\n '
snap = self.current_frame()
timestamp = '{:%Y%m%d-%H%M%S}'.format(datetime.now())
snap_path = ((self.path + timestamp) + '.png')
cv2.imwrite(snap_path, snap)
print('[INFO] Saved S... | def snapshot(self):
'\n Callback function for the snapshot button\n Saves the image to path\n '
snap = self.current_frame()
timestamp = '{:%Y%m%d-%H%M%S}'.format(datetime.now())
snap_path = ((self.path + timestamp) + '.png')
cv2.imwrite(snap_path, snap)
print('[INFO] Saved S... |
4f2ce58431a7f2e8d3ff225adac554789fcaf038206c7d01d8cbe469f14c72ec | def update(self, fps):
'\n Updates the canvas in the window\n Also the FPS is updated after each execution of this function\n '
(ret, frame) = self.vid.get_frame()
self.canvas_left.delete('all')
self.canvas_right.delete('all')
if ret:
fps.update()
self.photo = PI... | Updates the canvas in the window
Also the FPS is updated after each execution of this function | webcamgui/App.py | update | MrGrayCode/webcamgui | 0 | python | def update(self, fps):
'\n Updates the canvas in the window\n Also the FPS is updated after each execution of this function\n '
(ret, frame) = self.vid.get_frame()
self.canvas_left.delete('all')
self.canvas_right.delete('all')
if ret:
fps.update()
self.photo = PI... | def update(self, fps):
'\n Updates the canvas in the window\n Also the FPS is updated after each execution of this function\n '
(ret, frame) = self.vid.get_frame()
self.canvas_left.delete('all')
self.canvas_right.delete('all')
if ret:
fps.update()
self.photo = PI... |
402d4890420b0d6dc9995d22701a429431243c990c680ce77ac6b54d9dd40037 | @classmethod
def setUpClass(cls):
' Set up any course data '
super().setUpClass()
cls.course = CourseFactory.create()
cls.course_key = cls.course.id | Set up any course data | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/features/calendar_sync/tests/test_plugins.py | setUpClass | osoco/better-ways-of-thinking-about-software | 3 | python | @classmethod
def setUpClass(cls):
' '
super().setUpClass()
cls.course = CourseFactory.create()
cls.course_key = cls.course.id | @classmethod
def setUpClass(cls):
' '
super().setUpClass()
cls.course = CourseFactory.create()
cls.course_key = cls.course.id<|docstring|>Set up any course data<|endoftext|> |
97270a975c5bf16dd3dfbb20e06e3344ab495474ee4d5776e8ab677cf00e1f99 | def forward(self, key, value, query, mask=None, layer_cache=None, type=None):
'\n Compute the context vector and the attention vectors.\n\n Args:\n key (`FloatTensor`): set of `key_len`\n key vectors `[batch, key_len, dim]`\n value (`FloatTensor`): set of `key_len`\n... | Compute the context vector and the attention vectors.
Args:
key (`FloatTensor`): set of `key_len`
key vectors `[batch, key_len, dim]`
value (`FloatTensor`): set of `key_len`
value vectors `[batch, key_len, dim]`
query (`FloatTensor`): set of `query_len`
query vectors `[batch, query_l... | onmt/modules/multi_headed_attn.py | forward | philhchen/OpenNMT-evidential-softmax | 0 | python | def forward(self, key, value, query, mask=None, layer_cache=None, type=None):
'\n Compute the context vector and the attention vectors.\n\n Args:\n key (`FloatTensor`): set of `key_len`\n key vectors `[batch, key_len, dim]`\n value (`FloatTensor`): set of `key_len`\n... | def forward(self, key, value, query, mask=None, layer_cache=None, type=None):
'\n Compute the context vector and the attention vectors.\n\n Args:\n key (`FloatTensor`): set of `key_len`\n key vectors `[batch, key_len, dim]`\n value (`FloatTensor`): set of `key_len`\n... |
2e6c8beccae50aff6d2ac88e04296a20323791f77426df9a8013cab88cd3e67e | def shape(x):
' projection '
return x.view(batch_size, (- 1), head_count, dim_per_head).transpose(1, 2) | projection | onmt/modules/multi_headed_attn.py | shape | philhchen/OpenNMT-evidential-softmax | 0 | python | def shape(x):
' '
return x.view(batch_size, (- 1), head_count, dim_per_head).transpose(1, 2) | def shape(x):
' '
return x.view(batch_size, (- 1), head_count, dim_per_head).transpose(1, 2)<|docstring|>projection<|endoftext|> |
f86b6d4f473e2df7e4cd4eb2a3e7280e71b5ed5a3d43f2f5da1d2fa05ccb7297 | def unshape(x):
' compute context '
return x.transpose(1, 2).contiguous().view(batch_size, (- 1), (head_count * dim_per_head)) | compute context | onmt/modules/multi_headed_attn.py | unshape | philhchen/OpenNMT-evidential-softmax | 0 | python | def unshape(x):
' '
return x.transpose(1, 2).contiguous().view(batch_size, (- 1), (head_count * dim_per_head)) | def unshape(x):
' '
return x.transpose(1, 2).contiguous().view(batch_size, (- 1), (head_count * dim_per_head))<|docstring|>compute context<|endoftext|> |
f01e1a81fd168ff0f75c674fa0f70481aea0b08755efd00f22f154b1554452df | def __init__(self, link_uri):
' Initialize and run the example with the specified link_uri '
self._cf = Crazyflie(rw_cache='./cache')
self._cf.connected.add_callback(self._connected)
self._cf.disconnected.add_callback(self._disconnected)
self._cf.connection_failed.add_callback(self._connection_faile... | Initialize and run the example with the specified link_uri | asset/remote_control.py | __init__ | shushuai3/multi-robot-localization | 8 | python | def __init__(self, link_uri):
' '
self._cf = Crazyflie(rw_cache='./cache')
self._cf.connected.add_callback(self._connected)
self._cf.disconnected.add_callback(self._disconnected)
self._cf.connection_failed.add_callback(self._connection_failed)
self._cf.connection_lost.add_callback(self._connect... | def __init__(self, link_uri):
' '
self._cf = Crazyflie(rw_cache='./cache')
self._cf.connected.add_callback(self._connected)
self._cf.disconnected.add_callback(self._disconnected)
self._cf.connection_failed.add_callback(self._connection_failed)
self._cf.connection_lost.add_callback(self._connect... |
50f5d31cd9d546a5c3b35f9c543b9dfcd502c53fbac215cbe72e2218d9659569 | def _connected(self, link_uri):
' This callback is called form the Crazyflie API when a Crazyflie\n has been connected and the TOCs have been downloaded.'
print(('Connected to %s' % link_uri))
self._cf.param.add_update_callback(group='relative_ctrl', name='keepFlying', cb=self._a_pitch_kd_callback)
... | This callback is called form the Crazyflie API when a Crazyflie
has been connected and the TOCs have been downloaded. | asset/remote_control.py | _connected | shushuai3/multi-robot-localization | 8 | python | def _connected(self, link_uri):
' This callback is called form the Crazyflie API when a Crazyflie\n has been connected and the TOCs have been downloaded.'
print(('Connected to %s' % link_uri))
self._cf.param.add_update_callback(group='relative_ctrl', name='keepFlying', cb=self._a_pitch_kd_callback)
... | def _connected(self, link_uri):
' This callback is called form the Crazyflie API when a Crazyflie\n has been connected and the TOCs have been downloaded.'
print(('Connected to %s' % link_uri))
self._cf.param.add_update_callback(group='relative_ctrl', name='keepFlying', cb=self._a_pitch_kd_callback)
... |
70d8a4e80fa1a952075f723094309aa24960f81d39265c62449dffb2d105975c | def _a_pitch_kd_callback(self, name, value):
'Callback for pid_attitude.pitch_kd'
print('Readback: {0}={1}'.format(name, value))
self._cf.close_link() | Callback for pid_attitude.pitch_kd | asset/remote_control.py | _a_pitch_kd_callback | shushuai3/multi-robot-localization | 8 | python | def _a_pitch_kd_callback(self, name, value):
print('Readback: {0}={1}'.format(name, value))
self._cf.close_link() | def _a_pitch_kd_callback(self, name, value):
print('Readback: {0}={1}'.format(name, value))
self._cf.close_link()<|docstring|>Callback for pid_attitude.pitch_kd<|endoftext|> |
93d61a95cf88dd5ea63f03bc97eee4b1eb43a956d110b7f09a7e190a18c6f951 | def _connection_failed(self, link_uri, msg):
'Callback when connection initial connection fails (i.e no Crazyflie\n at the specified address)'
print(('Connection to %s failed: %s' % (link_uri, msg)))
self.is_connected = False | Callback when connection initial connection fails (i.e no Crazyflie
at the specified address) | asset/remote_control.py | _connection_failed | shushuai3/multi-robot-localization | 8 | python | def _connection_failed(self, link_uri, msg):
'Callback when connection initial connection fails (i.e no Crazyflie\n at the specified address)'
print(('Connection to %s failed: %s' % (link_uri, msg)))
self.is_connected = False | def _connection_failed(self, link_uri, msg):
'Callback when connection initial connection fails (i.e no Crazyflie\n at the specified address)'
print(('Connection to %s failed: %s' % (link_uri, msg)))
self.is_connected = False<|docstring|>Callback when connection initial connection fails (i.e no Crazy... |
cdd4d3d107b2466fe6a4f623d8e213dc6445fdc289ae3c025b78145b54bcf4b6 | def _connection_lost(self, link_uri, msg):
'Callback when disconnected after a connection has been made (i.e\n Crazyflie moves out of range)'
print(('Connection to %s lost: %s' % (link_uri, msg))) | Callback when disconnected after a connection has been made (i.e
Crazyflie moves out of range) | asset/remote_control.py | _connection_lost | shushuai3/multi-robot-localization | 8 | python | def _connection_lost(self, link_uri, msg):
'Callback when disconnected after a connection has been made (i.e\n Crazyflie moves out of range)'
print(('Connection to %s lost: %s' % (link_uri, msg))) | def _connection_lost(self, link_uri, msg):
'Callback when disconnected after a connection has been made (i.e\n Crazyflie moves out of range)'
print(('Connection to %s lost: %s' % (link_uri, msg)))<|docstring|>Callback when disconnected after a connection has been made (i.e
Crazyflie moves out of range)<|... |
a245154807213eae47976974a1fa487cd0ed3d50a452d1b6d4efa580f1d57134 | def _disconnected(self, link_uri):
'Callback when the Crazyflie is disconnected (called in all cases)'
print(('Disconnected from %s' % link_uri))
self.is_connected = False | Callback when the Crazyflie is disconnected (called in all cases) | asset/remote_control.py | _disconnected | shushuai3/multi-robot-localization | 8 | python | def _disconnected(self, link_uri):
print(('Disconnected from %s' % link_uri))
self.is_connected = False | def _disconnected(self, link_uri):
print(('Disconnected from %s' % link_uri))
self.is_connected = False<|docstring|>Callback when the Crazyflie is disconnected (called in all cases)<|endoftext|> |
2e759627366e308843825ef54850ee8cee1e30f681f7953007a6d6d1ea9920f9 | def _laplacian_normalize(adj):
'Symmetrically normalize adjacency matrix.'
adj = sp.coo_matrix(adj)
rowsum = np.array(adj.sum(1))
d_inv_sqrt = np.power(rowsum, (- 0.5)).flatten()
d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0.0
d_mat_inv_sqrt = sp.diags(d_inv_sqrt)
return adj.dot(d_mat_inv_sqrt).trans... | Symmetrically normalize adjacency matrix. | interactions.py | _laplacian_normalize | CRIPAC-DIG/GET | 12 | python | def _laplacian_normalize(adj):
adj = sp.coo_matrix(adj)
rowsum = np.array(adj.sum(1))
d_inv_sqrt = np.power(rowsum, (- 0.5)).flatten()
d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0.0
d_mat_inv_sqrt = sp.diags(d_inv_sqrt)
return adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt).A | def _laplacian_normalize(adj):
adj = sp.coo_matrix(adj)
rowsum = np.array(adj.sum(1))
d_inv_sqrt = np.power(rowsum, (- 0.5)).flatten()
d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0.0
d_mat_inv_sqrt = sp.diags(d_inv_sqrt)
return adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt).A<|docstring|>Sy... |
caca2dd13dd8513b7d58e1f0db5980bb533e73c35f521c57cf3338115c2b29d0 | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, **kargs):
' Converting the dataframe of interactions '
(ids, contents_dict, lengths_dict, position_dict) = ([], {}, {}, {})
raw_content_dict = {}
FileHandler.myprint('[NOTICE] MatchZoo use queryID and... | Converting the dataframe of interactions | interactions.py | convert_leftright | CRIPAC-DIG/GET | 12 | python | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, **kargs):
' '
(ids, contents_dict, lengths_dict, position_dict) = ([], {}, {}, {})
raw_content_dict = {}
FileHandler.myprint('[NOTICE] MatchZoo use queryID and docID as index in dataframe left and ri... | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, **kargs):
' '
(ids, contents_dict, lengths_dict, position_dict) = ([], {}, {}, {})
raw_content_dict = {}
FileHandler.myprint('[NOTICE] MatchZoo use queryID and docID as index in dataframe left and ri... |
2c909c9ea3f069220759bd89d1728cdf6cb6aa3d9eea243d5649d8114f3f24db | def convert_relations(self, relation: pd.DataFrame):
' Convert relations.\n We want to retrieve positive interactions and negative interactions. Particularly,\n for every pair (query, doc) = 1, we get a list of negatives of the query q\n\n It is possible that a query may have multiple positive ... | Convert relations.
We want to retrieve positive interactions and negative interactions. Particularly,
for every pair (query, doc) = 1, we get a list of negatives of the query q
It is possible that a query may have multiple positive docs. Therefore, negatives[q]
may vary the lengths but not too much. | interactions.py | convert_relations | CRIPAC-DIG/GET | 12 | python | def convert_relations(self, relation: pd.DataFrame):
' Convert relations.\n We want to retrieve positive interactions and negative interactions. Particularly,\n for every pair (query, doc) = 1, we get a list of negatives of the query q\n\n It is possible that a query may have multiple positive ... | def convert_relations(self, relation: pd.DataFrame):
' Convert relations.\n We want to retrieve positive interactions and negative interactions. Particularly,\n for every pair (query, doc) = 1, we get a list of negatives of the query q\n\n It is possible that a query may have multiple positive ... |
eaa84e14b2a04fa2c73f4aa50b2cf10e08f5a93fbd4d81c1f50b0d7fc4dad638 | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, source_key: str, raw_source_key: str, **kargs):
' Converting the dataframe of interactions '
(ids, contents_dict, lengths_dict, position_dict) = ([], {}, {}, {})
(raw_content_dict, sources, raw_sources, c... | Converting the dataframe of interactions | interactions.py | convert_leftright | CRIPAC-DIG/GET | 12 | python | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, source_key: str, raw_source_key: str, **kargs):
' '
(ids, contents_dict, lengths_dict, position_dict) = ([], {}, {}, {})
(raw_content_dict, sources, raw_sources, char_sources) = ({}, {}, {}, {})
dict... | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, source_key: str, raw_source_key: str, **kargs):
' '
(ids, contents_dict, lengths_dict, position_dict) = ([], {}, {}, {})
(raw_content_dict, sources, raw_sources, char_sources) = ({}, {}, {}, {})
dict... |
6b358d7675a547c967cc8c443a07004f50f61483f69c6f941ea41acd01e8f7c3 | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, source_key: str, raw_source_key: str, **kargs):
' Converting the dataframe of interactions\n Compress the text & build GAT adjacent matrix\n '
(ids, contents_dict, lengths_dict, position_dict) =... | Converting the dataframe of interactions
Compress the text & build GAT adjacent matrix | interactions.py | convert_leftright | CRIPAC-DIG/GET | 12 | python | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, source_key: str, raw_source_key: str, **kargs):
' Converting the dataframe of interactions\n Compress the text & build GAT adjacent matrix\n '
(ids, contents_dict, lengths_dict, position_dict) =... | def convert_leftright(self, part: pd.DataFrame, text_key: str, length_text_key: str, raw_text_key: str, source_key: str, raw_source_key: str, **kargs):
' Converting the dataframe of interactions\n Compress the text & build GAT adjacent matrix\n '
(ids, contents_dict, lengths_dict, position_dict) =... |
6ddc50c67f4258e27c406dbda4eba2f4e5523b811d69968bcd6e2a830f904d6b | def convert_relations(self, relation: pd.DataFrame):
' Convert relations.\n We want to retrieve positive interactions and negative interactions. Particularly,\n for every pair (query, doc) = 1, we get a list of negatives of the query q\n\n It is possible that a query may have multiple positive ... | Convert relations.
We want to retrieve positive interactions and negative interactions. Particularly,
for every pair (query, doc) = 1, we get a list of negatives of the query q
It is possible that a query may have multiple positive docs. Therefore, negatives[q]
may vary the lengths but not too much. | interactions.py | convert_relations | CRIPAC-DIG/GET | 12 | python | def convert_relations(self, relation: pd.DataFrame):
' Convert relations.\n We want to retrieve positive interactions and negative interactions. Particularly,\n for every pair (query, doc) = 1, we get a list of negatives of the query q\n\n It is possible that a query may have multiple positive ... | def convert_relations(self, relation: pd.DataFrame):
' Convert relations.\n We want to retrieve positive interactions and negative interactions. Particularly,\n for every pair (query, doc) = 1, we get a list of negatives of the query q\n\n It is possible that a query may have multiple positive ... |
df1dfa392f3a371663a2b3a00b651f17982b91f476e48302ad06d864984355a1 | def load(self):
"Retrieves the data for this object from the WikiTree server.\n This happens automatically when any of the properties are accessed.\n\n >>> p = Person('Sloan-518')\n >>> p.load()\n "
items = microdata.get_items(urllib.request.urlopen(self.url))
data = items[0].jso... | Retrieves the data for this object from the WikiTree server.
This happens automatically when any of the properties are accessed.
>>> p = Person('Sloan-518')
>>> p.load() | wikitree/public.py | load | jeroenl/wikitree-microdata | 2 | python | def load(self):
"Retrieves the data for this object from the WikiTree server.\n This happens automatically when any of the properties are accessed.\n\n >>> p = Person('Sloan-518')\n >>> p.load()\n "
items = microdata.get_items(urllib.request.urlopen(self.url))
data = items[0].jso... | def load(self):
"Retrieves the data for this object from the WikiTree server.\n This happens automatically when any of the properties are accessed.\n\n >>> p = Person('Sloan-518')\n >>> p.load()\n "
items = microdata.get_items(urllib.request.urlopen(self.url))
data = items[0].jso... |
a2221dd216516391a34e055d131e32edf918b569d57e402320ddda2a3943b0be | def _is_wrong_type(self, obj):
'\n Return true if object is not a list\n '
return (not (isinstance(obj, collections.Collection) or self.isinstance(obj[0], collections.Collection))) | Return true if object is not a list | gym/envs/networks/gymternet.py | _is_wrong_type | geoffroeder/gym | 0 | python | def _is_wrong_type(self, obj):
'\n \n '
return (not (isinstance(obj, collections.Collection) or self.isinstance(obj[0], collections.Collection))) | def _is_wrong_type(self, obj):
'\n \n '
return (not (isinstance(obj, collections.Collection) or self.isinstance(obj[0], collections.Collection)))<|docstring|>Return true if object is not a list<|endoftext|> |
197dcc54967651b54fe78c8a9476fcfa74b78e7faa2abf73df0f6ac2a00dafa2 | def step(self, action):
"Run one timestep of the environment's dynamics. When end of\n episode is reached, you are responsible for calling `reset()`\n to reset this environment's state.\n\n Accepts an action and returns a tuple (observation, reward, done, info).\n\n Args:\n ac... | Run one timestep of the environment's dynamics. When end of
episode is reached, you are responsible for calling `reset()`
to reset this environment's state.
Accepts an action and returns a tuple (observation, reward, done, info).
Args:
action (object): an action provided by the environment
Returns:
observati... | gym/envs/networks/gymternet.py | step | geoffroeder/gym | 0 | python | def step(self, action):
"Run one timestep of the environment's dynamics. When end of\n episode is reached, you are responsible for calling `reset()`\n to reset this environment's state.\n\n Accepts an action and returns a tuple (observation, reward, done, info).\n\n Args:\n ac... | def step(self, action):
"Run one timestep of the environment's dynamics. When end of\n episode is reached, you are responsible for calling `reset()`\n to reset this environment's state.\n\n Accepts an action and returns a tuple (observation, reward, done, info).\n\n Args:\n ac... |
9f5b797ad959271869a48bbb4e3e63514faf998e9b9d4e6e45c8bb41b7011fa3 | def _get_reward(self, demand, action):
'\n TODO: replace with implementation from http://www.cs.huji.ac.il/~schapiram/Learning_to_Route%20(NIPS).pdf\n :return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor`\n '
return 1.0 | TODO: replace with implementation from http://www.cs.huji.ac.il/~schapiram/Learning_to_Route%20(NIPS).pdf
:return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor` | gym/envs/networks/gymternet.py | _get_reward | geoffroeder/gym | 0 | python | def _get_reward(self, demand, action):
'\n TODO: replace with implementation from http://www.cs.huji.ac.il/~schapiram/Learning_to_Route%20(NIPS).pdf\n :return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor`\n '
return 1.0 | def _get_reward(self, demand, action):
'\n TODO: replace with implementation from http://www.cs.huji.ac.il/~schapiram/Learning_to_Route%20(NIPS).pdf\n :return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor`\n '
return 1.0<|docstring|>TODO: replace ... |
cf39ee599430f8b9523860c03ad010722975c88b94d8051421e44d37910d0306 | def _get_observation(self):
'\n :return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor`\n '
return gym.Env.observation_space.sample() | :return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor` | gym/envs/networks/gymternet.py | _get_observation | geoffroeder/gym | 0 | python | def _get_observation(self):
'\n \n '
return gym.Env.observation_space.sample() | def _get_observation(self):
'\n \n '
return gym.Env.observation_space.sample()<|docstring|>:return: Random uniform demand matrix of size self.n_nodes x self.n_nodes scaled by `scale_factor`<|endoftext|> |
02bea008c853be170e739033348401795fddb22c11e7c565f57014b74854b035 | def retinanet_resnet50_fpn(pretrained=False, progress=True, num_classes=91, pretrained_backbone=True, **kwargs):
'\n Constructs a RetinaNet model with a ResNet-50-FPN backbone.\n\n The input to the model is expected to be a list of tensors, each of shape ``[C, H, W]``, one for each\n image, and should be i... | Constructs a RetinaNet model with a ResNet-50-FPN backbone.
The input to the model is expected to be a list of tensors, each of shape ``[C, H, W]``, one for each
image, and should be in ``0-1`` range. Different images can have different sizes.
The behavior of the model changes depending if it is in training or evalua... | torchvision/models/detection/retinanet.py | retinanet_resnet50_fpn | AlexTS1980/vision | 1 | python | def retinanet_resnet50_fpn(pretrained=False, progress=True, num_classes=91, pretrained_backbone=True, **kwargs):
'\n Constructs a RetinaNet model with a ResNet-50-FPN backbone.\n\n The input to the model is expected to be a list of tensors, each of shape ``[C, H, W]``, one for each\n image, and should be i... | def retinanet_resnet50_fpn(pretrained=False, progress=True, num_classes=91, pretrained_backbone=True, **kwargs):
'\n Constructs a RetinaNet model with a ResNet-50-FPN backbone.\n\n The input to the model is expected to be a list of tensors, each of shape ``[C, H, W]``, one for each\n image, and should be i... |
907d503d974d6fb27d6a70976f4cc5d05209fc7c51a7bb48b20ea1f425ebf5a3 | def forward(self, images, targets=None):
'\n Arguments:\n images (list[Tensor]): images to be processed\n targets (list[Dict[Tensor]]): ground-truth boxes present in the image (optional)\n\n Returns:\n result (list[BoxList] or dict[Tensor]): the output from the model.\... | Arguments:
images (list[Tensor]): images to be processed
targets (list[Dict[Tensor]]): ground-truth boxes present in the image (optional)
Returns:
result (list[BoxList] or dict[Tensor]): the output from the model.
During training, it returns a dict[Tensor] which contains the losses.
During ... | torchvision/models/detection/retinanet.py | forward | AlexTS1980/vision | 1 | python | def forward(self, images, targets=None):
'\n Arguments:\n images (list[Tensor]): images to be processed\n targets (list[Dict[Tensor]]): ground-truth boxes present in the image (optional)\n\n Returns:\n result (list[BoxList] or dict[Tensor]): the output from the model.\... | def forward(self, images, targets=None):
'\n Arguments:\n images (list[Tensor]): images to be processed\n targets (list[Dict[Tensor]]): ground-truth boxes present in the image (optional)\n\n Returns:\n result (list[BoxList] or dict[Tensor]): the output from the model.\... |
af3f267158964404b2ff460bba694c11f7d4c5108f3a4d27b401907739c47346 | @pytest.mark.parametrize('channels_per_node', [0])
@pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('number_of_tokens', [1])
def test_token_registered_race(raiden_chain, token_amount):
'Test recreating the scenario described on issue:\n https://github.com/raiden-network/raiden/issues/784... | Test recreating the scenario described on issue:
https://github.com/raiden-network/raiden/issues/784 | raiden/tests/integration/test_pythonapi.py | test_token_registered_race | gcarq/raiden | 0 | python | @pytest.mark.parametrize('channels_per_node', [0])
@pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('number_of_tokens', [1])
def test_token_registered_race(raiden_chain, token_amount):
'Test recreating the scenario described on issue:\n https://github.com/raiden-network/raiden/issues/784... | @pytest.mark.parametrize('channels_per_node', [0])
@pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('number_of_tokens', [1])
def test_token_registered_race(raiden_chain, token_amount):
'Test recreating the scenario described on issue:\n https://github.com/raiden-network/raiden/issues/784... |
d41f4274e7db52502c8a78b9592abf42d2b4a9f020fe8352057572b4feade640 | @pytest.mark.parametrize('channels_per_node', [1])
@pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('number_of_tokens', [1])
def test_deposit_updates_balance_immediately(raiden_chain, token_addresses):
' Test that the balance of a channel gets updated by the deposit() call\n immediately ... | Test that the balance of a channel gets updated by the deposit() call
immediately and without having to wait for the
`ContractReceiveChannelNewBalance` message since the API needs to return
the channel with the deposit balance updated. | raiden/tests/integration/test_pythonapi.py | test_deposit_updates_balance_immediately | gcarq/raiden | 0 | python | @pytest.mark.parametrize('channels_per_node', [1])
@pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('number_of_tokens', [1])
def test_deposit_updates_balance_immediately(raiden_chain, token_addresses):
' Test that the balance of a channel gets updated by the deposit() call\n immediately ... | @pytest.mark.parametrize('channels_per_node', [1])
@pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('number_of_tokens', [1])
def test_deposit_updates_balance_immediately(raiden_chain, token_addresses):
' Test that the balance of a channel gets updated by the deposit() call\n immediately ... |
ee5f3052ecd6a857642add89958a703a207b98a9ec65ca2db5d1ba3962c80c45 | @pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('channels_per_node', [1])
@pytest.mark.xfail
def test_insufficient_funds(raiden_network, token_addresses, deposit):
'Test transfer on a channel with insufficient funds. It is expected to\n fail, as at the moment RaidenAPI is mocked and wil... | Test transfer on a channel with insufficient funds. It is expected to
fail, as at the moment RaidenAPI is mocked and will always succeed. | raiden/tests/integration/test_pythonapi.py | test_insufficient_funds | gcarq/raiden | 0 | python | @pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('channels_per_node', [1])
@pytest.mark.xfail
def test_insufficient_funds(raiden_network, token_addresses, deposit):
'Test transfer on a channel with insufficient funds. It is expected to\n fail, as at the moment RaidenAPI is mocked and wil... | @pytest.mark.parametrize('number_of_nodes', [2])
@pytest.mark.parametrize('channels_per_node', [1])
@pytest.mark.xfail
def test_insufficient_funds(raiden_network, token_addresses, deposit):
'Test transfer on a channel with insufficient funds. It is expected to\n fail, as at the moment RaidenAPI is mocked and wil... |
d578e990ad63c61256d8867fb1a2f188369989a6d7f70194ee1b6d68e6d24897 | def get(self, request, input):
'\n Accepts GET request at /stocks/search/<str:input>\n input - Search value entered by the user.\n '
rs = RedisStore(connection_pool=settings.REDIS_CONN_POOL)
input = input.upper()
stocks = rs.get_stock_data(input)
return JsonResponse(stocks, safe... | Accepts GET request at /stocks/search/<str:input>
input - Search value entered by the user. | stocks/views.py | get | BA1RY/stocks_book | 2 | python | def get(self, request, input):
'\n Accepts GET request at /stocks/search/<str:input>\n input - Search value entered by the user.\n '
rs = RedisStore(connection_pool=settings.REDIS_CONN_POOL)
input = input.upper()
stocks = rs.get_stock_data(input)
return JsonResponse(stocks, safe... | def get(self, request, input):
'\n Accepts GET request at /stocks/search/<str:input>\n input - Search value entered by the user.\n '
rs = RedisStore(connection_pool=settings.REDIS_CONN_POOL)
input = input.upper()
stocks = rs.get_stock_data(input)
return JsonResponse(stocks, safe... |
54831aff6c23720ffd556f7c257579784406251a7fc3b0d84cc362702fd55fb2 | def handle(self, record):
'Обработчик записей.\n\n Обновляет статус в триггер файле, если новый имеет приоритет выше,\n либо предыдущий устарел.\n\n '
self.refresh_trigger_state()
if (record.levelno > self.current_run_state):
self.current_run_state = record.levelno
if (self.... | Обработчик записей.
Обновляет статус в триггер файле, если новый имеет приоритет выше,
либо предыдущий устарел. | KristaBackup/common/TriggerHandler.py | handle | javister/krista-backup | 7 | python | def handle(self, record):
'Обработчик записей.\n\n Обновляет статус в триггер файле, если новый имеет приоритет выше,\n либо предыдущий устарел.\n\n '
self.refresh_trigger_state()
if (record.levelno > self.current_run_state):
self.current_run_state = record.levelno
if (self.... | def handle(self, record):
'Обработчик записей.\n\n Обновляет статус в триггер файле, если новый имеет приоритет выше,\n либо предыдущий устарел.\n\n '
self.refresh_trigger_state()
if (record.levelno > self.current_run_state):
self.current_run_state = record.levelno
if (self.... |
bb620e31fb510084155c66a29a1de4617a0d41feda3020e6668d3fb139ee4a63 | def insert_prediction(params, result):
' insert a new prediction '
params = eval(params)
latitude = result['payload'][0]
longitude = result['payload'][1]
discovery_date = result['payload'][2]
fire_size = result['payload'][3]
state_cat = result['payload'][4]
owner_descr_cat = result['pay... | insert a new prediction | src/objectives/python/aws_predict/categorizer_lambda/db_utils.py | insert_prediction | RobinsonCW/USWildfireAnalysis | 0 | python | def insert_prediction(params, result):
' '
params = eval(params)
latitude = result['payload'][0]
longitude = result['payload'][1]
discovery_date = result['payload'][2]
fire_size = result['payload'][3]
state_cat = result['payload'][4]
owner_descr_cat = result['payload'][5]
discovery... | def insert_prediction(params, result):
' '
params = eval(params)
latitude = result['payload'][0]
longitude = result['payload'][1]
discovery_date = result['payload'][2]
fire_size = result['payload'][3]
state_cat = result['payload'][4]
owner_descr_cat = result['payload'][5]
discovery... |
3796a3e7ee1077fb0c3eb61847016bcb7d7868012a243d89936ad8f559438d39 | def maxPathSum(self, root):
'\n :type root: TreeNode\n :rtype: int\n '
def maxend(node):
if (not node):
return 0
left = maxend(node.left)
right = maxend(node.right)
self.max = max(self.max, ((left + node.val) + right))
return max((node.va... | :type root: TreeNode
:rtype: int | docs/pycode/tree/binary-tree-maximum-path-sum.py | maxPathSum | ppipada/tech-interview-prep | 0 | python | def maxPathSum(self, root):
'\n :type root: TreeNode\n :rtype: int\n '
def maxend(node):
if (not node):
return 0
left = maxend(node.left)
right = maxend(node.right)
self.max = max(self.max, ((left + node.val) + right))
return max((node.va... | def maxPathSum(self, root):
'\n :type root: TreeNode\n :rtype: int\n '
def maxend(node):
if (not node):
return 0
left = maxend(node.left)
right = maxend(node.right)
self.max = max(self.max, ((left + node.val) + right))
return max((node.va... |
e17514c322f25fc20b7113a9e8dfcad17da49d6c7efa4be282a23209296a418b | def __init__(self, bounds, message=None):
'\n ```\n bounds A comma-separated list of conditions of the format\n\n <field_name>:<lower_bound>:<upper_bound>\n\n Either <lower_bound> or <upper_bound> may be empty.\n\n message Optional string to be output inste... | ```
bounds A comma-separated list of conditions of the format
<field_name>:<lower_bound>:<upper_bound>
Either <lower_bound> or <upper_bound> may be empty.
message Optional string to be output instead of default when bounds
are violated
``` | logger/transforms/qc_filter_transform.py | __init__ | decibelhertz/openrvdas | 17 | python | def __init__(self, bounds, message=None):
'\n ```\n bounds A comma-separated list of conditions of the format\n\n <field_name>:<lower_bound>:<upper_bound>\n\n Either <lower_bound> or <upper_bound> may be empty.\n\n message Optional string to be output inste... | def __init__(self, bounds, message=None):
'\n ```\n bounds A comma-separated list of conditions of the format\n\n <field_name>:<lower_bound>:<upper_bound>\n\n Either <lower_bound> or <upper_bound> may be empty.\n\n message Optional string to be output inste... |
589c0e2aaa15d9904eba5414d0e32926a28c82fee428c22a4d62c960efea7ca2 | def transform(self, record):
'Does record violate any bounds?'
if (not record):
return None
if (type(record) is list):
results = []
for single_record in record:
results.append(self.transform(single_record))
return results
if (type(record) is DASRecord):
... | Does record violate any bounds? | logger/transforms/qc_filter_transform.py | transform | decibelhertz/openrvdas | 17 | python | def transform(self, record):
if (not record):
return None
if (type(record) is list):
results = []
for single_record in record:
results.append(self.transform(single_record))
return results
if (type(record) is DASRecord):
fields = record.fields
elif... | def transform(self, record):
if (not record):
return None
if (type(record) is list):
results = []
for single_record in record:
results.append(self.transform(single_record))
return results
if (type(record) is DASRecord):
fields = record.fields
elif... |
bbe0fa1ff31c1a4406aea4fa5ccf85c9b248d1346ce180158dce291d31e1ed06 | def load_dataset(dataset_name, data_path, normal_class, tokenizer='spacy', use_tfidf_weights=False, append_sos=False, append_eos=False, clean_txt=False):
'Loads the dataset.'
implemented_datasets = ('reuters', 'newsgroups20', 'imdb')
assert (dataset_name in implemented_datasets)
dataset = None
if (d... | Loads the dataset. | src/datasets/main.py | load_dataset | shaliniiit/CVDD-PyTorch | 48 | python | def load_dataset(dataset_name, data_path, normal_class, tokenizer='spacy', use_tfidf_weights=False, append_sos=False, append_eos=False, clean_txt=False):
implemented_datasets = ('reuters', 'newsgroups20', 'imdb')
assert (dataset_name in implemented_datasets)
dataset = None
if (dataset_name == 'reut... | def load_dataset(dataset_name, data_path, normal_class, tokenizer='spacy', use_tfidf_weights=False, append_sos=False, append_eos=False, clean_txt=False):
implemented_datasets = ('reuters', 'newsgroups20', 'imdb')
assert (dataset_name in implemented_datasets)
dataset = None
if (dataset_name == 'reut... |
07c8d22d1061d3de4d07f6c02109980add522b50904e7523bf71b03e87b593e4 | def draw_line(screen: List[int], width: int, x1: int, x2: int, y: int) -> None:
' Draws line on screen according to coordinates '
starting_index: int = (((width / BYTE_SIZE) * y) + (x1 // BYTE_SIZE))
ending_index: int = (starting_index + (x2 // BYTE_SIZE))
if (starting_index == ending_index):
li... | Draws line on screen according to coordinates | src/bit_manipulation/draw_line.py | draw_line | JadielTeofilo/General-Algorithms | 0 | python | def draw_line(screen: List[int], width: int, x1: int, x2: int, y: int) -> None:
' '
starting_index: int = (((width / BYTE_SIZE) * y) + (x1 // BYTE_SIZE))
ending_index: int = (starting_index + (x2 // BYTE_SIZE))
if (starting_index == ending_index):
line: int = group_of_ones(((1 + x2) - x1))
... | def draw_line(screen: List[int], width: int, x1: int, x2: int, y: int) -> None:
' '
starting_index: int = (((width / BYTE_SIZE) * y) + (x1 // BYTE_SIZE))
ending_index: int = (starting_index + (x2 // BYTE_SIZE))
if (starting_index == ending_index):
line: int = group_of_ones(((1 + x2) - x1))
... |
f69cdda312b5edefd723f207f945dae0a2217b07cb8c8b01295276abe1ab392e | def _fix_num_frames(sample: wsj0mix.SampleType, target_num_frames: int, sample_rate: int, random_start=False):
'Ensure waveform has exact number of frames by slicing or padding'
mix = sample[1]
src = torch.cat(sample[2], 0)
(num_channels, num_frames) = src.shape
num_seconds = torch.div(num_frames, s... | Ensure waveform has exact number of frames by slicing or padding | examples/source_separation/utils/dataset/utils.py | _fix_num_frames | LaudateCorpus1/audio | 1,718 | python | def _fix_num_frames(sample: wsj0mix.SampleType, target_num_frames: int, sample_rate: int, random_start=False):
mix = sample[1]
src = torch.cat(sample[2], 0)
(num_channels, num_frames) = src.shape
num_seconds = torch.div(num_frames, sample_rate, rounding_mode='floor')
target_seconds = torch.div(... | def _fix_num_frames(sample: wsj0mix.SampleType, target_num_frames: int, sample_rate: int, random_start=False):
mix = sample[1]
src = torch.cat(sample[2], 0)
(num_channels, num_frames) = src.shape
num_seconds = torch.div(num_frames, sample_rate, rounding_mode='floor')
target_seconds = torch.div(... |
d6dd1e1d85bf6a8e488b385056ac7a88e799c9aea1cfc9a3352b9d2fb75fd058 | def __init__(self, dirName):
'\n Args:\n dirName (string): directory where to load the corpus\n '
print(('Loading OpenSubtitles conversations in %s.' % dirName))
self.conversations = []
self.tag_re = re.compile('(<!--.*?-->|<[^>]*>)')
self.conversations = self.loadConversati... | Args:
dirName (string): directory where to load the corpus | chatbot/corpus/opensubsdata.py | __init__ | neuromancer/lisa | 2 | python | def __init__(self, dirName):
'\n Args:\n dirName (string): directory where to load the corpus\n '
print(('Loading OpenSubtitles conversations in %s.' % dirName))
self.conversations = []
self.tag_re = re.compile('(<!--.*?-->|<[^>]*>)')
self.conversations = self.loadConversati... | def __init__(self, dirName):
'\n Args:\n dirName (string): directory where to load the corpus\n '
print(('Loading OpenSubtitles conversations in %s.' % dirName))
self.conversations = []
self.tag_re = re.compile('(<!--.*?-->|<[^>]*>)')
self.conversations = self.loadConversati... |
63e1fd36c3f41bd4a8deab3b7af742f5e01be82ec6281cf9130a4c3b7f8beae0 | def loadConversations(self, dirName):
'\n Args:\n dirName (str): folder to load\n Return:\n array(question, answer): the extracted QA pairs\n '
conversations = []
dirList = self.filesInDir(dirName)
for filepath in tqdm(dirList, 'OpenSubtitles data files'):
... | Args:
dirName (str): folder to load
Return:
array(question, answer): the extracted QA pairs | chatbot/corpus/opensubsdata.py | loadConversations | neuromancer/lisa | 2 | python | def loadConversations(self, dirName):
'\n Args:\n dirName (str): folder to load\n Return:\n array(question, answer): the extracted QA pairs\n '
conversations = []
dirList = self.filesInDir(dirName)
for filepath in tqdm(dirList, 'OpenSubtitles data files'):
... | def loadConversations(self, dirName):
'\n Args:\n dirName (str): folder to load\n Return:\n array(question, answer): the extracted QA pairs\n '
conversations = []
dirList = self.filesInDir(dirName)
for filepath in tqdm(dirList, 'OpenSubtitles data files'):
... |
98713f20533494f9fd48d6281a490dfdf30d26b0fa7138f0cac1469df3576f5c | def __init__(self, *args, **kwargs):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
self.args = list(args)
self.kwargs = kwargs | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, *args, **kwargs):
self.args = list(args)
self.kwargs = kwargs | def __init__(self, *args, **kwargs):
self.args = list(args)
self.kwargs = kwargs<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
a785032ff37f8059dda672bf7ddbcc295ce64e1c9928acede47bc3d588343438 | def __eq__(self, other):
' x.__eq__(other) <==> x==other\n\n Tests the equality of Event self against Event y.\n Two Events are considered "equal" iif the name,\n channel and target are identical as well as their\n args and kwargs passed.\n '
return ((self.__class__ is other._... | x.__eq__(other) <==> x==other
Tests the equality of Event self against Event y.
Two Events are considered "equal" iif the name,
channel and target are identical as well as their
args and kwargs passed. | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __eq__ | antont/tundra | 1 | python | def __eq__(self, other):
' x.__eq__(other) <==> x==other\n\n Tests the equality of Event self against Event y.\n Two Events are considered "equal" iif the name,\n channel and target are identical as well as their\n args and kwargs passed.\n '
return ((self.__class__ is other._... | def __eq__(self, other):
' x.__eq__(other) <==> x==other\n\n Tests the equality of Event self against Event y.\n Two Events are considered "equal" iif the name,\n channel and target are identical as well as their\n args and kwargs passed.\n '
return ((self.__class__ is other._... |
c709e800bd759243e4131c414e2483eeea9b768c9dcfe74e6e6b1f62f5a9aaa3 | def __repr__(self):
'x.__repr__() <==> repr(x)'
if (type(self.channel) is tuple):
channel = ('%s:%s' % self.channel)
else:
channel = (self.channel or '')
return ('<%s[%s] %s %s>' % (self.name, channel, self.args, self.kwargs)) | x.__repr__() <==> repr(x) | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __repr__ | antont/tundra | 1 | python | def __repr__(self):
if (type(self.channel) is tuple):
channel = ('%s:%s' % self.channel)
else:
channel = (self.channel or )
return ('<%s[%s] %s %s>' % (self.name, channel, self.args, self.kwargs)) | def __repr__(self):
if (type(self.channel) is tuple):
channel = ('%s:%s' % self.channel)
else:
channel = (self.channel or )
return ('<%s[%s] %s %s>' % (self.name, channel, self.args, self.kwargs))<|docstring|>x.__repr__() <==> repr(x)<|endoftext|> |
8ef5ac0e860da9f0b1d37a80e767c5610552c94f6b731dfec8889d58b0a90f8e | def __getitem__(self, x):
'x.__getitem__(y) <==> x[y]\n\n Get and return data from the Event object requested by "x".\n If an int is passed to x, the requested argument from self.args\n is returned index by x. If a str is passed to x, the requested\n keyword argument from self.kwargs is ... | x.__getitem__(y) <==> x[y]
Get and return data from the Event object requested by "x".
If an int is passed to x, the requested argument from self.args
is returned index by x. If a str is passed to x, the requested
keyword argument from self.kwargs is returned keyed by x.
Otherwise a TypeError is raised as nothing else... | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __getitem__ | antont/tundra | 1 | python | def __getitem__(self, x):
'x.__getitem__(y) <==> x[y]\n\n Get and return data from the Event object requested by "x".\n If an int is passed to x, the requested argument from self.args\n is returned index by x. If a str is passed to x, the requested\n keyword argument from self.kwargs is ... | def __getitem__(self, x):
'x.__getitem__(y) <==> x[y]\n\n Get and return data from the Event object requested by "x".\n If an int is passed to x, the requested argument from self.args\n is returned index by x. If a str is passed to x, the requested\n keyword argument from self.kwargs is ... |
6f9d6a9a512a4b9e7f47069494bc1046047eab7f65ceb0996b88cbdc3bce3c5a | def __setitem__(self, i, y):
'x.__setitem__(i, y) <==> x[i] = y\n\n Modify the data in the Event object requested by "x".\n If i is an int, the ith requested argument from self.args\n shall be changed to y. If i is a str, the requested value\n keyed by i from self.kwargs, shall by change... | x.__setitem__(i, y) <==> x[i] = y
Modify the data in the Event object requested by "x".
If i is an int, the ith requested argument from self.args
shall be changed to y. If i is a str, the requested value
keyed by i from self.kwargs, shall by changed to y.
Otherwise a TypeError is raised as nothing else is valid. | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __setitem__ | antont/tundra | 1 | python | def __setitem__(self, i, y):
'x.__setitem__(i, y) <==> x[i] = y\n\n Modify the data in the Event object requested by "x".\n If i is an int, the ith requested argument from self.args\n shall be changed to y. If i is a str, the requested value\n keyed by i from self.kwargs, shall by change... | def __setitem__(self, i, y):
'x.__setitem__(i, y) <==> x[i] = y\n\n Modify the data in the Event object requested by "x".\n If i is an int, the ith requested argument from self.args\n shall be changed to y. If i is a str, the requested value\n keyed by i from self.kwargs, shall by change... |
e92909674fd0c828e358810f4b5bc636b598866f12384986ac7e3d912947c57d | def __init__(self, type, value, traceback, handler=None):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Error, self).__init__(type, value, traceback, handler) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, type, value, traceback, handler=None):
super(Error, self).__init__(type, value, traceback, handler) | def __init__(self, type, value, traceback, handler=None):
super(Error, self).__init__(type, value, traceback, handler)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
465e1517368e12d4c0af7b23937637a154c2a9b2572fe7d8ec885a704e422bdd | def __init__(self, event, handler, retval):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Success, self).__init__(event, handler, retval) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, event, handler, retval):
super(Success, self).__init__(event, handler, retval) | def __init__(self, event, handler, retval):
super(Success, self).__init__(event, handler, retval)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
29f949bbf6d877e0574c7dd2692b7c8b9ef9854d36161b4122d727d23c000b1b | def __init__(self, event, handler, error):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Failure, self).__init__(event, handler, error) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, event, handler, error):
super(Failure, self).__init__(event, handler, error) | def __init__(self, event, handler, error):
super(Failure, self).__init__(event, handler, error)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
2f3ca14483a3b431565fd0db59c867e8b4d611f190ca0c21b2bbc885fe538621 | def __init__(self, event, handler, retval):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Filter, self).__init__(event, handler, retval) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, event, handler, retval):
super(Filter, self).__init__(event, handler, retval) | def __init__(self, event, handler, retval):
super(Filter, self).__init__(event, handler, retval)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
b0a5cb426b2faa345755c9a61fa1fbd45671f6a4ab6976b55b8b9062dfc6be1d | def __init__(self, event):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Start, self).__init__(event) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, event):
super(Start, self).__init__(event) | def __init__(self, event):
super(Start, self).__init__(event)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
2f7a6bbc03d1551a89cbd17d875003b86fe5d8c664a3f0239bf86ae1f94f494c | def __init__(self, event, handler, retval):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(End, self).__init__(event, handler, retval) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, event, handler, retval):
super(End, self).__init__(event, handler, retval) | def __init__(self, event, handler, retval):
super(End, self).__init__(event, handler, retval)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
72e7e5ba091812cf7a1cac44dae7ef60c4826798ed8613ed4639fa9ddfef9b5c | def __init__(self, component, mode):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Started, self).__init__(component, mode) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, component, mode):
super(Started, self).__init__(component, mode) | def __init__(self, component, mode):
super(Started, self).__init__(component, mode)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
ff66ee9a7177f5f99b2b3bb7331efedd938100a700e76a7ffde8b794c332e8a5 | def __init__(self, component):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Stopped, self).__init__(component) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, component):
super(Stopped, self).__init__(component) | def __init__(self, component):
super(Stopped, self).__init__(component)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
2bd3b2fed9f7ff162a93f5b1db230cbac86aee975979b781a4e6ef5f8148b54d | def __init__(self, signal, stack):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Signal, self).__init__(signal, stack) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, signal, stack):
super(Signal, self).__init__(signal, stack) | def __init__(self, signal, stack):
super(Signal, self).__init__(signal, stack)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
0dfba88992ff2b2dd5ae4dca8dfe0750509616364e6d42b94a9393d0139be88d | def __init__(self, component, manager):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Registered, self).__init__(component, manager) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, component, manager):
super(Registered, self).__init__(component, manager) | def __init__(self, component, manager):
super(Registered, self).__init__(component, manager)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
73c4b7a5c1b2a46aa8f68d5c534d21529a58cad64247a43f68bf0dd042e3184c | def __init__(self, component, manager):
'x.__init__(...) initializes x; see x.__class__.__doc__ for signature'
super(Unregistered, self).__init__(component, manager) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | src/Application/PythonScriptModule/pymodules_old/circuits/core/events.py | __init__ | antont/tundra | 1 | python | def __init__(self, component, manager):
super(Unregistered, self).__init__(component, manager) | def __init__(self, component, manager):
super(Unregistered, self).__init__(component, manager)<|docstring|>x.__init__(...) initializes x; see x.__class__.__doc__ for signature<|endoftext|> |
293ed619160e164aeed89003b0050c3191866d5bd27102b65a589612c5c71fc0 | def alignments(self, tokens: TokenList):
'\n\t\tAligns the original and gold tokens in order to discover the corrections that have been made.\n\n\t\t:param tokens: A TokenList\n\t\t:return: A tuple with three elements:\n\n\t\t - ``fullAlignments`` -- A list of letter-by-letter alignments (2-element tuples)\n\t\t... | Aligns the original and gold tokens in order to discover the corrections that have been made.
:param tokens: A TokenList
:return: A tuple with three elements:
- ``fullAlignments`` -- A list of letter-by-letter alignments (2-element tuples)
- ``wordAlignments``--
- ``readCounts`` -- A dictionary of counts ... | CorrectOCR/aligner.py | alignments | CopenhagenCityArchives/CorrectOCR | 9 | python | def alignments(self, tokens: TokenList):
'\n\t\tAligns the original and gold tokens in order to discover the corrections that have been made.\n\n\t\t:param tokens: A TokenList\n\t\t:return: A tuple with three elements:\n\n\t\t - ``fullAlignments`` -- A list of letter-by-letter alignments (2-element tuples)\n\t\t... | def alignments(self, tokens: TokenList):
'\n\t\tAligns the original and gold tokens in order to discover the corrections that have been made.\n\n\t\t:param tokens: A TokenList\n\t\t:return: A tuple with three elements:\n\n\t\t - ``fullAlignments`` -- A list of letter-by-letter alignments (2-element tuples)\n\t\t... |
4bf343b18a920da316c3ee15a12d3ded5529df869f8e902648bc7cee8179a995 | def apply_as_gold(self, left: TokenList, right: TokenList):
'\n\t\tSets gold on the left tokens based on originals from the right tokens.\n\t\t\n\t\tWill attempt to handle cases where tokens have been deleted.\n\n\t\t:param left: A TokenList\n\t\t:param right: A TokenList\n\t\t'
matcher = difflib.SequenceMatche... | Sets gold on the left tokens based on originals from the right tokens.
Will attempt to handle cases where tokens have been deleted.
:param left: A TokenList
:param right: A TokenList | CorrectOCR/aligner.py | apply_as_gold | CopenhagenCityArchives/CorrectOCR | 9 | python | def apply_as_gold(self, left: TokenList, right: TokenList):
'\n\t\tSets gold on the left tokens based on originals from the right tokens.\n\t\t\n\t\tWill attempt to handle cases where tokens have been deleted.\n\n\t\t:param left: A TokenList\n\t\t:param right: A TokenList\n\t\t'
matcher = difflib.SequenceMatche... | def apply_as_gold(self, left: TokenList, right: TokenList):
'\n\t\tSets gold on the left tokens based on originals from the right tokens.\n\t\t\n\t\tWill attempt to handle cases where tokens have been deleted.\n\n\t\t:param left: A TokenList\n\t\t:param right: A TokenList\n\t\t'
matcher = difflib.SequenceMatche... |
ee697ecc6c606ef4b1bf068bf3e5bd3801617c78d7d3f4c19a2efb4cfec48ce1 | @property
def splitting_side(self) -> int:
'\n .. note::\n :class: toggle\n\n CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)\n | o Property SplittingSide() As CatSplitSide\n | \n | Returns or sets the splitting side . The splitting... | .. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property SplittingSide() As CatSplitSide
|
| Returns or sets the splitting side . The splitting side is the side of the
| splitting element kept after the split. A positive side refers to... | pycatia/part_interfaces/split.py | splitting_side | Tian-Jionglu/pycatia | 90 | python | @property
def splitting_side(self) -> int:
'\n .. note::\n :class: toggle\n\n CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)\n | o Property SplittingSide() As CatSplitSide\n | \n | Returns or sets the splitting side . The splitting... | @property
def splitting_side(self) -> int:
'\n .. note::\n :class: toggle\n\n CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)\n | o Property SplittingSide() As CatSplitSide\n | \n | Returns or sets the splitting side . The splitting... |
8306ee0d9472325b4784c23dc3d770aa54233f7bba7a25e5186dfd7c83b19a76 | @splitting_side.setter
def splitting_side(self, value: int):
'\n :param int value:\n '
self.split.SplittingSide = value | :param int value: | pycatia/part_interfaces/split.py | splitting_side | Tian-Jionglu/pycatia | 90 | python | @splitting_side.setter
def splitting_side(self, value: int):
'\n \n '
self.split.SplittingSide = value | @splitting_side.setter
def splitting_side(self, value: int):
'\n \n '
self.split.SplittingSide = value<|docstring|>:param int value:<|endoftext|> |
de2871e3dc2adb438acd208dca2e7b369a5bbd0199dd4ad7d47577bcca563aea | def resolve_shortcut(x):
'If the given path is a Windows shortcut, resolve it'
if _is_windows:
shell = win32com.client.Dispatch('WScript.Shell')
if (os.path.splitext(x)[1] not in ('.lnk', '.url')):
xlnk = (x + '.lnk')
if os.path.exists(xlnk):
shortcut = shell.Crea... | If the given path is a Windows shortcut, resolve it | pines/remote_import.py | resolve_shortcut | jpn--/pine | 2 | python | def resolve_shortcut(x):
if _is_windows:
shell = win32com.client.Dispatch('WScript.Shell')
if (os.path.splitext(x)[1] not in ('.lnk', '.url')):
xlnk = (x + '.lnk')
if os.path.exists(xlnk):
shortcut = shell.CreateShortCut(xlnk)
return shortcut.Targetpa... | def resolve_shortcut(x):
if _is_windows:
shell = win32com.client.Dispatch('WScript.Shell')
if (os.path.splitext(x)[1] not in ('.lnk', '.url')):
xlnk = (x + '.lnk')
if os.path.exists(xlnk):
shortcut = shell.CreateShortCut(xlnk)
return shortcut.Targetpa... |
9426db073254ea2f0a89b80541dbc037b69b0dac6108fe2704a754056c27db13 | def recursive_resolve_shortcut(x):
'Get a (real) file path given a path that may include windows shortcuts.'
x_parts = recursive_path_split(x)
built = x_parts[0]
x_parts = x_parts[1:]
while (len(x_parts) > 0):
built = resolve_shortcut(os.path.join(built, x_parts[0]))
x_parts = x_part... | Get a (real) file path given a path that may include windows shortcuts. | pines/remote_import.py | recursive_resolve_shortcut | jpn--/pine | 2 | python | def recursive_resolve_shortcut(x):
x_parts = recursive_path_split(x)
built = x_parts[0]
x_parts = x_parts[1:]
while (len(x_parts) > 0):
built = resolve_shortcut(os.path.join(built, x_parts[0]))
x_parts = x_parts[1:]
return built | def recursive_resolve_shortcut(x):
x_parts = recursive_path_split(x)
built = x_parts[0]
x_parts = x_parts[1:]
while (len(x_parts) > 0):
built = resolve_shortcut(os.path.join(built, x_parts[0]))
x_parts = x_parts[1:]
return built<|docstring|>Get a (real) file path given a path th... |
37f928ad291be516c4cf127ceeeed8498ed64d146fe9ceb6b13a95c3f259c6d0 | def exact_import(modulename, filepath, resolve_shortcuts=True):
'Import a specific python module or script as if it were a standard module.\n\n\tParameters\n\t----------\n\tmodulename : str\n\t\tThe name the new module will receive\n\tfilepath : str\n\t\tWhere the module file is located\n\tresolve_shortcuts : bool,... | Import a specific python module or script as if it were a standard module.
Parameters
----------
modulename : str
The name the new module will receive
filepath : str
Where the module file is located
resolve_shortcuts : bool, default True
Should windows shortcuts in the path for the module file ... | pines/remote_import.py | exact_import | jpn--/pine | 2 | python | def exact_import(modulename, filepath, resolve_shortcuts=True):
'Import a specific python module or script as if it were a standard module.\n\n\tParameters\n\t----------\n\tmodulename : str\n\t\tThe name the new module will receive\n\tfilepath : str\n\t\tWhere the module file is located\n\tresolve_shortcuts : bool,... | def exact_import(modulename, filepath, resolve_shortcuts=True):
'Import a specific python module or script as if it were a standard module.\n\n\tParameters\n\t----------\n\tmodulename : str\n\t\tThe name the new module will receive\n\tfilepath : str\n\t\tWhere the module file is located\n\tresolve_shortcuts : bool,... |
67b42276b5135b5d6bee2b1a12470accb813d1362da540d1bd1e7c189dfec928 | def _parser_header_if(self, data: str) -> list[tuple[(UUID, Optional[str])]]:
"\n b'if',\n b'<http://192.168.200.198:8000/litmus/lockcoll/> '\n b'(<opaquelocktoken:245ec6a9-e8e2-4c7d-acd4-740b9e301ae0> '\n b'[e24bfe34b6750624571283fcf1ed8542]) '\n b(Not <DAV:no-lock> '... | b'if',
b'<http://192.168.200.198:8000/litmus/lockcoll/> '
b'(<opaquelocktoken:245ec6a9-e8e2-4c7d-acd4-740b9e301ae0> '
b'[e24bfe34b6750624571283fcf1ed8542]) '
b(Not <DAV:no-lock> '
b'[e24bfe34b6750624571283fcf1ed8542])' | asgi_webdav/request.py | _parser_header_if | ported-pw/asgi-webdav | 38 | python | def _parser_header_if(self, data: str) -> list[tuple[(UUID, Optional[str])]]:
"\n b'if',\n b'<http://192.168.200.198:8000/litmus/lockcoll/> '\n b'(<opaquelocktoken:245ec6a9-e8e2-4c7d-acd4-740b9e301ae0> '\n b'[e24bfe34b6750624571283fcf1ed8542]) '\n b(Not <DAV:no-lock> '... | def _parser_header_if(self, data: str) -> list[tuple[(UUID, Optional[str])]]:
"\n b'if',\n b'<http://192.168.200.198:8000/litmus/lockcoll/> '\n b'(<opaquelocktoken:245ec6a9-e8e2-4c7d-acd4-740b9e301ae0> '\n b'[e24bfe34b6750624571283fcf1ed8542]) '\n b(Not <DAV:no-lock> '... |
109241db8f40d3835df9f377fb623ddf138a47ffd6a00a33c271010d65ea2ea2 | def parse_sum_stats_standard(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n chr pos ref alt reffrq info rs pval effalt\n chr1 1020428 C T 0.85083 0.98732 rs6687776 0.0587 -0.0100048507289348\n chr1 1020496 G ... | Input format:
chr pos ref alt reffrq info rs pval effalt
chr1 1020428 C T 0.85083 0.98732 rs6687776 0.0587 -0.0100048507289348
chr1 1020496 G A 0.85073 0.98751 rs6678318 0.1287 -0.00826075392985992 | ldpred/sum_stats_parsers.py | parse_sum_stats_standard | choishingwan/ldpred | 0 | python | def parse_sum_stats_standard(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n chr pos ref alt reffrq info rs pval effalt\n chr1 1020428 C T 0.85083 0.98732 rs6687776 0.0587 -0.0100048507289348\n chr1 1020496 G ... | def parse_sum_stats_standard(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n chr pos ref alt reffrq info rs pval effalt\n chr1 1020428 C T 0.85083 0.98732 rs6687776 0.0587 -0.0100048507289348\n chr1 1020496 G ... |
cb37bed7e0a5c38d754beb0694aa463fd59ffeed265e2a112ae41e2e4cc685ff | def parse_sum_stats_giant(filename=None, bimfile=None, hdf5_file=None, debug=False):
'\n Input format:\n\n MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU b SE p N\n MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU p N\n rs10 a c 0.0333 0.8826 78380\n rs1000000 a g 0.3667 0.... | Input format:
MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU b SE p N
MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU p N
rs10 a c 0.0333 0.8826 78380
rs1000000 a g 0.3667 0.1858 133822 | ldpred/sum_stats_parsers.py | parse_sum_stats_giant | choishingwan/ldpred | 0 | python | def parse_sum_stats_giant(filename=None, bimfile=None, hdf5_file=None, debug=False):
'\n Input format:\n\n MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU b SE p N\n MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU p N\n rs10 a c 0.0333 0.8826 78380\n rs1000000 a g 0.3667 0.... | def parse_sum_stats_giant(filename=None, bimfile=None, hdf5_file=None, debug=False):
'\n Input format:\n\n MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU b SE p N\n MarkerName Allele1 Allele2 Freq.Allele1.HapMapCEU p N\n rs10 a c 0.0333 0.8826 78380\n rs1000000 a g 0.3667 0.... |
4c6cff9a0113dbcd94176f9586a1cc63c7ccaefed7ea0acccf4fe872987365d1 | def parse_sum_stats_giant2(filename=None, bimfile=None, hdf5_file=None, debug=False):
'\n Input format:\n\n MarkerName A1 A2 Freq.Hapmap.Ceu BETA SE.2gc P.2gc N\n rs4747841 a g 0.55 0.0025 0.0061 0.68 60558.2\n rs4749917 t c 0.45 -0.0025 0.0061 0.68 60558.1\n rs737656 a g 0.3667 -0.0073 0.0064 0.25 6... | Input format:
MarkerName A1 A2 Freq.Hapmap.Ceu BETA SE.2gc P.2gc N
rs4747841 a g 0.55 0.0025 0.0061 0.68 60558.2
rs4749917 t c 0.45 -0.0025 0.0061 0.68 60558.1
rs737656 a g 0.3667 -0.0073 0.0064 0.25 60529.2 | ldpred/sum_stats_parsers.py | parse_sum_stats_giant2 | choishingwan/ldpred | 0 | python | def parse_sum_stats_giant2(filename=None, bimfile=None, hdf5_file=None, debug=False):
'\n Input format:\n\n MarkerName A1 A2 Freq.Hapmap.Ceu BETA SE.2gc P.2gc N\n rs4747841 a g 0.55 0.0025 0.0061 0.68 60558.2\n rs4749917 t c 0.45 -0.0025 0.0061 0.68 60558.1\n rs737656 a g 0.3667 -0.0073 0.0064 0.25 6... | def parse_sum_stats_giant2(filename=None, bimfile=None, hdf5_file=None, debug=False):
'\n Input format:\n\n MarkerName A1 A2 Freq.Hapmap.Ceu BETA SE.2gc P.2gc N\n rs4747841 a g 0.55 0.0025 0.0061 0.68 60558.2\n rs4749917 t c 0.45 -0.0025 0.0061 0.68 60558.1\n rs737656 a g 0.3667 -0.0073 0.0064 0.25 6... |
040b85c69c21ffa03b932642ca5f3bbb7e8874c3ea811d4f6640af630718742d | def parse_sum_stats_pgc(filename=None, bimfile=None, hdf5_file=None):
'\n Input format:\n\n CHR SNP BP A1 A2 FRQ_A_30232 FRQ_U_40578 INFO OR SE P ngt Direction HetISqt HetChiSq HetDf HetPVa\n ...\n\n '
if (bimfile is not None):
print('Parsing S... | Input format:
CHR SNP BP A1 A2 FRQ_A_30232 FRQ_U_40578 INFO OR SE P ngt Direction HetISqt HetChiSq HetDf HetPVa
... | ldpred/sum_stats_parsers.py | parse_sum_stats_pgc | choishingwan/ldpred | 0 | python | def parse_sum_stats_pgc(filename=None, bimfile=None, hdf5_file=None):
'\n Input format:\n\n CHR SNP BP A1 A2 FRQ_A_30232 FRQ_U_40578 INFO OR SE P ngt Direction HetISqt HetChiSq HetDf HetPVa\n ...\n\n '
if (bimfile is not None):
print('Parsing S... | def parse_sum_stats_pgc(filename=None, bimfile=None, hdf5_file=None):
'\n Input format:\n\n CHR SNP BP A1 A2 FRQ_A_30232 FRQ_U_40578 INFO OR SE P ngt Direction HetISqt HetChiSq HetDf HetPVa\n ...\n\n '
if (bimfile is not None):
print('Parsing S... |
450493497ad690882a14e027d5942e901f2bb00200004fd1987d21f1a17d1a5a | def parse_sum_stats_pgc_small(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n hg19chrc snpid a1 a2 bp info or se p ngt\n chr1 rs4951859 C G 729679 0.631 0.97853 0.0173 0.2083 0\n chr1 rs14255... | Input format:
hg19chrc snpid a1 a2 bp info or se p ngt
chr1 rs4951859 C G 729679 0.631 0.97853 0.0173 0.2083 0
chr1 rs142557973 T C 731718 0.665 1.01949 0.0198 0.3298 0
... | ldpred/sum_stats_parsers.py | parse_sum_stats_pgc_small | choishingwan/ldpred | 0 | python | def parse_sum_stats_pgc_small(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n hg19chrc snpid a1 a2 bp info or se p ngt\n chr1 rs4951859 C G 729679 0.631 0.97853 0.0173 0.2083 0\n chr1 rs14255... | def parse_sum_stats_pgc_small(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n hg19chrc snpid a1 a2 bp info or se p ngt\n chr1 rs4951859 C G 729679 0.631 0.97853 0.0173 0.2083 0\n chr1 rs14255... |
a74d64cf737a12d7809f7431d03e534d9d1da6a8143800cfb09b05439de17ed4 | def parse_sum_stats_basic(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n hg19chrc snpid a1 a2 bp or p \n chr1 rs4951859 C G 729679 0.97853 0.2083 \n chr1 rs142557973 T C 731718 1.01949 0.3298 \n ..... | Input format:
hg19chrc snpid a1 a2 bp or p
chr1 rs4951859 C G 729679 0.97853 0.2083
chr1 rs142557973 T C 731718 1.01949 0.3298
... | ldpred/sum_stats_parsers.py | parse_sum_stats_basic | choishingwan/ldpred | 0 | python | def parse_sum_stats_basic(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n hg19chrc snpid a1 a2 bp or p \n chr1 rs4951859 C G 729679 0.97853 0.2083 \n chr1 rs142557973 T C 731718 1.01949 0.3298 \n ..... | def parse_sum_stats_basic(filename=None, bimfile=None, hdf5_file=None, n=None, debug=False):
'\n Input format:\n\n hg19chrc snpid a1 a2 bp or p \n chr1 rs4951859 C G 729679 0.97853 0.2083 \n chr1 rs142557973 T C 731718 1.01949 0.3298 \n ..... |
be9c8453cebb41fa4a6a541ba00c1b44376cce9228dac004c94f9e9a728692cc | def _expand_dims(array, in_array):
'\n Avoid indexing errors when a tile winds up with a single row or col\n\n Need to add a dimension to arrays if the first or second dimension of\n in_array is 1 (meaning there is only 1 row or 1 column in a block) as\n otherwise the squeeze done after finding the max ... | Avoid indexing errors when a tile winds up with a single row or col
Need to add a dimension to arrays if the first or second dimension of
in_array is 1 (meaning there is only 1 row or 1 column in a block) as
otherwise the squeeze done after finding the max drought indices will
result in a missing dimension of the max ... | te_algorithms/gdal/drought.py | _expand_dims | ConservationInternational/trends.earth-algorithms | 2 | python | def _expand_dims(array, in_array):
'\n Avoid indexing errors when a tile winds up with a single row or col\n\n Need to add a dimension to arrays if the first or second dimension of\n in_array is 1 (meaning there is only 1 row or 1 column in a block) as\n otherwise the squeeze done after finding the max ... | def _expand_dims(array, in_array):
'\n Avoid indexing errors when a tile winds up with a single row or col\n\n Need to add a dimension to arrays if the first or second dimension of\n in_array is 1 (meaning there is only 1 row or 1 column in a block) as\n otherwise the squeeze done after finding the max ... |
7989365440f21171191142b3443a8f529fa6e9993d5b82c31798a7f8739f2e25 | def _compute_drought_summary_table(aoi, compute_bbs_from, in_dfs, output_job_path: Path, drought_period: int, n_cpus: int) -> Tuple[(SummaryTableDrought, Path, Path)]:
'Computes summary table and the output tif file(s)'
wkt_aois = aoi.meridian_split(as_extent=False, out_format='wkt')
bbs = aoi.get_aligned_o... | Computes summary table and the output tif file(s) | te_algorithms/gdal/drought.py | _compute_drought_summary_table | ConservationInternational/trends.earth-algorithms | 2 | python | def _compute_drought_summary_table(aoi, compute_bbs_from, in_dfs, output_job_path: Path, drought_period: int, n_cpus: int) -> Tuple[(SummaryTableDrought, Path, Path)]:
wkt_aois = aoi.meridian_split(as_extent=False, out_format='wkt')
bbs = aoi.get_aligned_output_bounds(compute_bbs_from)
assert (len(wkt_... | def _compute_drought_summary_table(aoi, compute_bbs_from, in_dfs, output_job_path: Path, drought_period: int, n_cpus: int) -> Tuple[(SummaryTableDrought, Path, Path)]:
wkt_aois = aoi.meridian_split(as_extent=False, out_format='wkt')
bbs = aoi.get_aligned_output_bounds(compute_bbs_from)
assert (len(wkt_... |
6ff0f88cb43533ace55e29823005948f322432a89a786874355c73d9afec2dbe | def save_summary_table_excel(output_path: Path, summary_table: SummaryTableDrought, years: List[int]):
'Save summary table into an xlsx file on disk'
template_summary_table_path = (Path(__file__).parents[1] / 'data/summary_table_drought.xlsx')
workbook = openpyxl.load_workbook(str(template_summary_table_pat... | Save summary table into an xlsx file on disk | te_algorithms/gdal/drought.py | save_summary_table_excel | ConservationInternational/trends.earth-algorithms | 2 | python | def save_summary_table_excel(output_path: Path, summary_table: SummaryTableDrought, years: List[int]):
template_summary_table_path = (Path(__file__).parents[1] / 'data/summary_table_drought.xlsx')
workbook = openpyxl.load_workbook(str(template_summary_table_path))
_render_drought_workbook(workbook, sum... | def save_summary_table_excel(output_path: Path, summary_table: SummaryTableDrought, years: List[int]):
template_summary_table_path = (Path(__file__).parents[1] / 'data/summary_table_drought.xlsx')
workbook = openpyxl.load_workbook(str(template_summary_table_path))
_render_drought_workbook(workbook, sum... |
c7791acd83481b3f5f05c1dc51be054d74f8ac66e29b30a99c87bb48e316d17c | def emit_progress(self, *args):
'Reimplement to display progress messages'
util.log_progress(*args, message=f'Processing drought summary for {self.params.in_df.path}') | Reimplement to display progress messages | te_algorithms/gdal/drought.py | emit_progress | ConservationInternational/trends.earth-algorithms | 2 | python | def emit_progress(self, *args):
util.log_progress(*args, message=f'Processing drought summary for {self.params.in_df.path}') | def emit_progress(self, *args):
util.log_progress(*args, message=f'Processing drought summary for {self.params.in_df.path}')<|docstring|>Reimplement to display progress messages<|endoftext|> |
0f1dcce291cae13a30f7822565bd33c9869841b74377012596f5881e7ab1089b | def get_line_params(self):
'Make a list of parameters to use in the _process_line function'
src_ds = gdal.Open(str(self.params.in_df.path))
src_gt = src_ds.GetGeoTransform()
lat = src_gt[3]
logger.debug('getting line params for image with xsize %s, and ysize %s', src_ds.RasterXSize, src_ds.RasterYSi... | Make a list of parameters to use in the _process_line function | te_algorithms/gdal/drought.py | get_line_params | ConservationInternational/trends.earth-algorithms | 2 | python | def get_line_params(self):
src_ds = gdal.Open(str(self.params.in_df.path))
src_gt = src_ds.GetGeoTransform()
lat = src_gt[3]
logger.debug('getting line params for image with xsize %s, and ysize %s', src_ds.RasterXSize, src_ds.RasterYSize)
line_params = []
for y in range(0, self.image_info.y... | def get_line_params(self):
src_ds = gdal.Open(str(self.params.in_df.path))
src_gt = src_ds.GetGeoTransform()
lat = src_gt[3]
logger.debug('getting line params for image with xsize %s, and ysize %s', src_ds.RasterXSize, src_ds.RasterYSize)
line_params = []
for y in range(0, self.image_info.y... |
6616f168a12f0b931e67483fb21818b3ed5b1d515b412f80615638ac8cc7bf0c | def convert_eval_format(self, all_bboxes):
'\n Used to convert the evaluation formats when saving the detection results\n '
detections = []
for image_id in all_bboxes:
for cls_ind in all_bboxes[image_id]:
category_id = self._valid_ids[(cls_ind - 1)]
for bbox in all_bbox... | Used to convert the evaluation formats when saving the detection results | CenterNet/src/lib/datasets/dataset/hmdb21.py | convert_eval_format | Kalana304/KORSAL | 0 | python | def convert_eval_format(self, all_bboxes):
'\n \n '
detections = []
for image_id in all_bboxes:
for cls_ind in all_bboxes[image_id]:
category_id = self._valid_ids[(cls_ind - 1)]
for bbox in all_bboxes[image_id][cls_ind]:
bbox[2] -= bbox[0]
... | def convert_eval_format(self, all_bboxes):
'\n \n '
detections = []
for image_id in all_bboxes:
for cls_ind in all_bboxes[image_id]:
category_id = self._valid_ids[(cls_ind - 1)]
for bbox in all_bboxes[image_id][cls_ind]:
bbox[2] -= bbox[0]
... |
89f63ca4751a20038f1cc5c4a6bf526967d1eed1f1056846d866108c472ff646 | def setUpdateConfig(self, deviceName):
'\n _setUpdateRate corrects the update rate of weather devices to get an defined\n setting regardless, what is setup in server side.\n\n :param deviceName:\n :return: success\n '
if (deviceName != self.deviceName):
return False
... | _setUpdateRate corrects the update rate of weather devices to get an defined
setting regardless, what is setup in server side.
:param deviceName:
:return: success | mw4/logic/focuser/focuserIndi.py | setUpdateConfig | mworion/MountWizzard4 | 16 | python | def setUpdateConfig(self, deviceName):
'\n _setUpdateRate corrects the update rate of weather devices to get an defined\n setting regardless, what is setup in server side.\n\n :param deviceName:\n :return: success\n '
if (deviceName != self.deviceName):
return False
... | def setUpdateConfig(self, deviceName):
'\n _setUpdateRate corrects the update rate of weather devices to get an defined\n setting regardless, what is setup in server side.\n\n :param deviceName:\n :return: success\n '
if (deviceName != self.deviceName):
return False
... |
28ca9df44c0dd5e7f3cf8dc9b7e32b4d1a307f10bcd0f0152257d3adb923a8e2 | def move(self, position=None):
'\n :param position:\n :return:\n '
if (self.device is None):
return False
pos = self.device.getNumber('ABS_FOCUS_POSITION')
pos['FOCUS_ABSOLUTE_POSITION'] = position
suc = self.client.sendNewNumber(deviceName=self.deviceName, propertyName=... | :param position:
:return: | mw4/logic/focuser/focuserIndi.py | move | mworion/MountWizzard4 | 16 | python | def move(self, position=None):
'\n :param position:\n :return:\n '
if (self.device is None):
return False
pos = self.device.getNumber('ABS_FOCUS_POSITION')
pos['FOCUS_ABSOLUTE_POSITION'] = position
suc = self.client.sendNewNumber(deviceName=self.deviceName, propertyName=... | def move(self, position=None):
'\n :param position:\n :return:\n '
if (self.device is None):
return False
pos = self.device.getNumber('ABS_FOCUS_POSITION')
pos['FOCUS_ABSOLUTE_POSITION'] = position
suc = self.client.sendNewNumber(deviceName=self.deviceName, propertyName=... |
c6e1cf577fa11e75b07c624c584ccbe5a8cc79f7cafaffca9d8a374ca605ca79 | def halt(self):
'\n :return:\n '
if (self.device is None):
return False
pos = self.device.getNumber('ABS_FOCUS_POSITION')
suc = self.client.sendNewNumber(deviceName=self.deviceName, propertyName='ABS_FOCUS_POSITION', elements=pos)
return suc | :return: | mw4/logic/focuser/focuserIndi.py | halt | mworion/MountWizzard4 | 16 | python | def halt(self):
'\n \n '
if (self.device is None):
return False
pos = self.device.getNumber('ABS_FOCUS_POSITION')
suc = self.client.sendNewNumber(deviceName=self.deviceName, propertyName='ABS_FOCUS_POSITION', elements=pos)
return suc | def halt(self):
'\n \n '
if (self.device is None):
return False
pos = self.device.getNumber('ABS_FOCUS_POSITION')
suc = self.client.sendNewNumber(deviceName=self.deviceName, propertyName='ABS_FOCUS_POSITION', elements=pos)
return suc<|docstring|>:return:<|endoftext|> |
1f61a06e297e75188e3d04afe4fddcc1cd6ae42dfbef4ee20f4c4aeba274d1d4 | def generate_old_db(env_dir, hub_version, db_url):
'Generate an old jupyterhub database\n\n Installs a particular jupyterhub version in a virtualenv\n and runs populate_db.py to populate a database\n '
env_pip = os.path.join(env_dir, 'bin', 'pip')
env_py = os.path.join(env_dir, 'bin', 'python')
... | Generate an old jupyterhub database
Installs a particular jupyterhub version in a virtualenv
and runs populate_db.py to populate a database | Lib/site-packages/jupyterhub/tests/test_db.py | generate_old_db | KarmaScripter/PiggyPy | 0 | python | def generate_old_db(env_dir, hub_version, db_url):
'Generate an old jupyterhub database\n\n Installs a particular jupyterhub version in a virtualenv\n and runs populate_db.py to populate a database\n '
env_pip = os.path.join(env_dir, 'bin', 'pip')
env_py = os.path.join(env_dir, 'bin', 'python')
... | def generate_old_db(env_dir, hub_version, db_url):
'Generate an old jupyterhub database\n\n Installs a particular jupyterhub version in a virtualenv\n and runs populate_db.py to populate a database\n '
env_pip = os.path.join(env_dir, 'bin', 'pip')
env_py = os.path.join(env_dir, 'bin', 'python')
... |
46259c3f4d844991ea79e69d83705d1abf4c231f774cf6758cd3f334563b3f39 | def train_test_split(data, column_to_drop):
'We will be splitting the dataset into two fold train and test'
X = data.drop([column_to_drop], axis=1)
y = data[column_to_drop]
from sklearn.model_selection import train_test_split
(x_train, x_test, y_train, y_test) = train_test_split(X, y, test_size=0.1,... | We will be splitting the dataset into two fold train and test | model3.py | train_test_split | Idowuilekura/bank_of_portugal_predictive-model-building | 0 | python | def train_test_split(data, column_to_drop):
X = data.drop([column_to_drop], axis=1)
y = data[column_to_drop]
from sklearn.model_selection import train_test_split
(x_train, x_test, y_train, y_test) = train_test_split(X, y, test_size=0.1, random_state=0)
'getting the counts of the target, this is... | def train_test_split(data, column_to_drop):
X = data.drop([column_to_drop], axis=1)
y = data[column_to_drop]
from sklearn.model_selection import train_test_split
(x_train, x_test, y_train, y_test) = train_test_split(X, y, test_size=0.1, random_state=0)
'getting the counts of the target, this is... |
7a9b6c9d10ead03152651c88a7bdfa7ca36562d7797ab78028af6b4e9af1b3b8 | def get_score(model, x_train, x_test, y_train, y_test, score):
'Here we want to get the score for each prediction with different metrics, this will be used when we run our cross-validation'
model.fit(x_train, y_train)
y_pred = model.predict(x_test)
from sklearn.metrics import f1_score, accuracy_score, r... | Here we want to get the score for each prediction with different metrics, this will be used when we run our cross-validation | model3.py | get_score | Idowuilekura/bank_of_portugal_predictive-model-building | 0 | python | def get_score(model, x_train, x_test, y_train, y_test, score):
model.fit(x_train, y_train)
y_pred = model.predict(x_test)
from sklearn.metrics import f1_score, accuracy_score, roc_auc_score, precision_score, recall_score
if (score == 'f1_score'):
score = f1_score(y_test, y_pred)
elif (s... | def get_score(model, x_train, x_test, y_train, y_test, score):
model.fit(x_train, y_train)
y_pred = model.predict(x_test)
from sklearn.metrics import f1_score, accuracy_score, roc_auc_score, precision_score, recall_score
if (score == 'f1_score'):
score = f1_score(y_test, y_pred)
elif (s... |
f7fd7abc5649e89a0a90ef2ede58579b9806cd5df12024bd0acb2118d71d1704 | def kfold_validate(data, column_to_drop, score, select_best_3=True):
'This function is meant to run a kfold cross validation on the data\n with various models and picking the best 3 models based on the \n defined scoring metrics)'
score = score
from sklearn.model_selection import KFold
from sklearn.li... | This function is meant to run a kfold cross validation on the data
with various models and picking the best 3 models based on the
defined scoring metrics) | model3.py | kfold_validate | Idowuilekura/bank_of_portugal_predictive-model-building | 0 | python | def kfold_validate(data, column_to_drop, score, select_best_3=True):
'This function is meant to run a kfold cross validation on the data\n with various models and picking the best 3 models based on the \n defined scoring metrics)'
score = score
from sklearn.model_selection import KFold
from sklearn.li... | def kfold_validate(data, column_to_drop, score, select_best_3=True):
'This function is meant to run a kfold cross validation on the data\n with various models and picking the best 3 models based on the \n defined scoring metrics)'
score = score
from sklearn.model_selection import KFold
from sklearn.li... |
a5efaa92057a70b6d8e1b7a55c8c6b913b3dd552075472637240c79b2fa859e0 | def skfold_validate(data, column_to_drop, score, select_best_3=True):
'This function is meant to run a stratifiedkfold cross validation on the data\n with various models and picking the best 3 models based on the \n defined scoring metrics)'
score = score
from sklearn.model_selection import KFold, Stratif... | This function is meant to run a stratifiedkfold cross validation on the data
with various models and picking the best 3 models based on the
defined scoring metrics) | model3.py | skfold_validate | Idowuilekura/bank_of_portugal_predictive-model-building | 0 | python | def skfold_validate(data, column_to_drop, score, select_best_3=True):
'This function is meant to run a stratifiedkfold cross validation on the data\n with various models and picking the best 3 models based on the \n defined scoring metrics)'
score = score
from sklearn.model_selection import KFold, Stratif... | def skfold_validate(data, column_to_drop, score, select_best_3=True):
'This function is meant to run a stratifiedkfold cross validation on the data\n with various models and picking the best 3 models based on the \n defined scoring metrics)'
score = score
from sklearn.model_selection import KFold, Stratif... |
d1ffbb7d04b6bdff17415fa07d07035b7ae5e4b0529b8064d963e981bbf0893b | def make_predictions(data, column_to_drop, model):
' From the previous function we were able to get the 3 most efficient model\n for our predictions, here we will use the models to make predictions'
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
fro... | From the previous function we were able to get the 3 most efficient model
for our predictions, here we will use the models to make predictions | model3.py | make_predictions | Idowuilekura/bank_of_portugal_predictive-model-building | 0 | python | def make_predictions(data, column_to_drop, model):
' From the previous function we were able to get the 3 most efficient model\n for our predictions, here we will use the models to make predictions'
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
fro... | def make_predictions(data, column_to_drop, model):
' From the previous function we were able to get the 3 most efficient model\n for our predictions, here we will use the models to make predictions'
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
fro... |
c728dc5006ec18a173c80e7c93cbf5f540a524672e0b7c2fe713852223d6854d | @pytest.fixture(scope='session')
def session_id():
'Unique session identifier, random string.'
return str(uuid.uuid4()) | Unique session identifier, random string. | tests/conftest.py | session_id | nimnull/talkbot | 6 | python | @pytest.fixture(scope='session')
def session_id():
return str(uuid.uuid4()) | @pytest.fixture(scope='session')
def session_id():
return str(uuid.uuid4())<|docstring|>Unique session identifier, random string.<|endoftext|> |
0bbdbe4d97063f616c9d9d83ca2cefd37a4f0347d8c47eed0ced068f60217e55 | def bilateral_slice_guide_vjp(grid, guide, codomain_tangent):
'VJP for bilateral_slice with respect to `guide`.\n\n Note that this depends on both `grid` and `guide`.\n\n Args:\n grid: The bilateral grid with shape (gh, gw, gd, gc).\n guide: The guide image with shape (h, w).\n codomain_tangent: The codo... | VJP for bilateral_slice with respect to `guide`.
Note that this depends on both `grid` and `guide`.
Args:
grid: The bilateral grid with shape (gh, gw, gd, gc).
guide: The guide image with shape (h, w).
codomain_tangent: The codomain tangent with shape (gh, gw, gc).
Returns:
The vector-Jacobian product codoma... | jax/bilateral_slice.py | bilateral_slice_guide_vjp | gaugau147/hdrnet | 680 | python | def bilateral_slice_guide_vjp(grid, guide, codomain_tangent):
'VJP for bilateral_slice with respect to `guide`.\n\n Note that this depends on both `grid` and `guide`.\n\n Args:\n grid: The bilateral grid with shape (gh, gw, gd, gc).\n guide: The guide image with shape (h, w).\n codomain_tangent: The codo... | def bilateral_slice_guide_vjp(grid, guide, codomain_tangent):
'VJP for bilateral_slice with respect to `guide`.\n\n Note that this depends on both `grid` and `guide`.\n\n Args:\n grid: The bilateral grid with shape (gh, gw, gd, gc).\n guide: The guide image with shape (h, w).\n codomain_tangent: The codo... |
c8ab620c24e1d0c9f024c455780ee779ca87acc8239ed7c06258f5773b00a577 | def _compute_scale_pad(image_extent, grid_extent):
'Computes spatial scale and padding given image and grid extents.\n\n Args:\n image_extent: Image extent along that axis.\n grid_extent: Grid extent along the corresponding axis.\n\n Returns:\n (scale, half_pad)\n scale: spatial scaling (image pixels ... | Computes spatial scale and padding given image and grid extents.
Args:
image_extent: Image extent along that axis.
grid_extent: Grid extent along the corresponding axis.
Returns:
(scale, half_pad)
scale: spatial scaling (image pixels per grid cell)
half_pad: how much padding is needed on either side of the ... | jax/bilateral_slice.py | _compute_scale_pad | gaugau147/hdrnet | 680 | python | def _compute_scale_pad(image_extent, grid_extent):
'Computes spatial scale and padding given image and grid extents.\n\n Args:\n image_extent: Image extent along that axis.\n grid_extent: Grid extent along the corresponding axis.\n\n Returns:\n (scale, half_pad)\n scale: spatial scaling (image pixels ... | def _compute_scale_pad(image_extent, grid_extent):
'Computes spatial scale and padding given image and grid extents.\n\n Args:\n image_extent: Image extent along that axis.\n grid_extent: Grid extent along the corresponding axis.\n\n Returns:\n (scale, half_pad)\n scale: spatial scaling (image pixels ... |
9dd3f8193dd9846d946d6795e9cb07bbc9833058e363febc6bc586de58fb7209 | def _compute_spatial_weights(image_extent, grid_extent):
'Computes spatial weights given image and grid extents.\n\n Args:\n image_extent: Image extent along that axis.\n grid_extent: Grid extent along the corresponding axis.\n\n Returns:\n An (image_extent, grid_extent) array with the spatial weight for... | Computes spatial weights given image and grid extents.
Args:
image_extent: Image extent along that axis.
grid_extent: Grid extent along the corresponding axis.
Returns:
An (image_extent, grid_extent) array with the spatial weight for each
spatial and grid position. | jax/bilateral_slice.py | _compute_spatial_weights | gaugau147/hdrnet | 680 | python | def _compute_spatial_weights(image_extent, grid_extent):
'Computes spatial weights given image and grid extents.\n\n Args:\n image_extent: Image extent along that axis.\n grid_extent: Grid extent along the corresponding axis.\n\n Returns:\n An (image_extent, grid_extent) array with the spatial weight for... | def _compute_spatial_weights(image_extent, grid_extent):
'Computes spatial weights given image and grid extents.\n\n Args:\n image_extent: Image extent along that axis.\n grid_extent: Grid extent along the corresponding axis.\n\n Returns:\n An (image_extent, grid_extent) array with the spatial weight for... |
9e3dcbda8b224be633564b1e155d1974e4402e4fe4d4afaec8709217cc5ee2d4 | def _symmetric_pad_ij(image, grid_shape):
'Symmetrically pads an image along the first two axes.\n\n Args:\n image: the image.\n grid_shape: shape of the corresponding bilateral grid.\n\n Returns:\n `image` padded along the first two axes in "symmetric" mode sufficient\n to compute the proper grid gra... | Symmetrically pads an image along the first two axes.
Args:
image: the image.
grid_shape: shape of the corresponding bilateral grid.
Returns:
`image` padded along the first two axes in "symmetric" mode sufficient
to compute the proper grid gradient for the given image and grid shape. | jax/bilateral_slice.py | _symmetric_pad_ij | gaugau147/hdrnet | 680 | python | def _symmetric_pad_ij(image, grid_shape):
'Symmetrically pads an image along the first two axes.\n\n Args:\n image: the image.\n grid_shape: shape of the corresponding bilateral grid.\n\n Returns:\n `image` padded along the first two axes in "symmetric" mode sufficient\n to compute the proper grid gra... | def _symmetric_pad_ij(image, grid_shape):
'Symmetrically pads an image along the first two axes.\n\n Args:\n image: the image.\n grid_shape: shape of the corresponding bilateral grid.\n\n Returns:\n `image` padded along the first two axes in "symmetric" mode sufficient\n to compute the proper grid gra... |
073e655f4d5ca51426fd64f26bf1e00966bdc9da0a7b71c9b4d68838d9c6320a | def _compute_range_weights(guide, grid_shape):
'Computes range weights for the given guide image and grid shape.\n\n Args:\n guide: The guide image with shape (h, w).\n grid_shape: The grid shape, an array-like containing [gh, gw, gd, gc].\n\n Returns:\n An (image_extent, grid_extent) array with the spat... | Computes range weights for the given guide image and grid shape.
Args:
guide: The guide image with shape (h, w).
grid_shape: The grid shape, an array-like containing [gh, gw, gd, gc].
Returns:
An (image_extent, grid_extent) array with the spatial weight for each
spatial and grid position. | jax/bilateral_slice.py | _compute_range_weights | gaugau147/hdrnet | 680 | python | def _compute_range_weights(guide, grid_shape):
'Computes range weights for the given guide image and grid shape.\n\n Args:\n guide: The guide image with shape (h, w).\n grid_shape: The grid shape, an array-like containing [gh, gw, gd, gc].\n\n Returns:\n An (image_extent, grid_extent) array with the spat... | def _compute_range_weights(guide, grid_shape):
'Computes range weights for the given guide image and grid shape.\n\n Args:\n guide: The guide image with shape (h, w).\n grid_shape: The grid shape, an array-like containing [gh, gw, gd, gc].\n\n Returns:\n An (image_extent, grid_extent) array with the spat... |
f1a7749b742761e1e20675129fb15771a7531f819c79bf0c2d95ade0b5030863 | def bilateral_slice_grid_vjp(guide, codomain_tangent, grid_shape):
'VJP for bilateral_slice with respect to `grid`.\n\n Note that this is independent of `grid`.\n\n Args:\n guide: The guide image with shape (h, w).\n codomain_tangent: The codomain tangent with shape (gh, gw, gc).\n grid_shape: The grid s... | VJP for bilateral_slice with respect to `grid`.
Note that this is independent of `grid`.
Args:
guide: The guide image with shape (h, w).
codomain_tangent: The codomain tangent with shape (gh, gw, gc).
grid_shape: The grid shape, an array-like containing [gh, gw, gd, gc].
Returns:
The vector-Jacobian product ... | jax/bilateral_slice.py | bilateral_slice_grid_vjp | gaugau147/hdrnet | 680 | python | def bilateral_slice_grid_vjp(guide, codomain_tangent, grid_shape):
'VJP for bilateral_slice with respect to `grid`.\n\n Note that this is independent of `grid`.\n\n Args:\n guide: The guide image with shape (h, w).\n codomain_tangent: The codomain tangent with shape (gh, gw, gc).\n grid_shape: The grid s... | def bilateral_slice_grid_vjp(guide, codomain_tangent, grid_shape):
'VJP for bilateral_slice with respect to `grid`.\n\n Note that this is independent of `grid`.\n\n Args:\n guide: The guide image with shape (h, w).\n codomain_tangent: The codomain tangent with shape (gh, gw, gc).\n grid_shape: The grid s... |
66defda517005d9f21e7c4a2710457a3a67bdb290df47b9c10ece6dd24f574a9 | @jax.custom_vjp
def bilateral_slice(grid, guide):
'Slices a bilateral grid using the a guide image.\n\n Args:\n grid: The bilateral grid with shape (gh, gw, gd, gc).\n guide: A guide image with shape (h, w). Values must be in the range [0, 1].\n\n Returns:\n sliced: An image with shape (h, w, gc), comput... | Slices a bilateral grid using the a guide image.
Args:
grid: The bilateral grid with shape (gh, gw, gd, gc).
guide: A guide image with shape (h, w). Values must be in the range [0, 1].
Returns:
sliced: An image with shape (h, w, gc), computed by trilinearly
interpolating for each grid channel c the grid at 3D... | jax/bilateral_slice.py | bilateral_slice | gaugau147/hdrnet | 680 | python | @jax.custom_vjp
def bilateral_slice(grid, guide):
'Slices a bilateral grid using the a guide image.\n\n Args:\n grid: The bilateral grid with shape (gh, gw, gd, gc).\n guide: A guide image with shape (h, w). Values must be in the range [0, 1].\n\n Returns:\n sliced: An image with shape (h, w, gc), comput... | @jax.custom_vjp
def bilateral_slice(grid, guide):
'Slices a bilateral grid using the a guide image.\n\n Args:\n grid: The bilateral grid with shape (gh, gw, gd, gc).\n guide: A guide image with shape (h, w). Values must be in the range [0, 1].\n\n Returns:\n sliced: An image with shape (h, w, gc), comput... |
90c4446eccb8e1ad94492b34954212cb8f56dd4c8f7c82dcab6052980e138036 | def DelayedFileAudioSource(path, blocksize=512):
'\n Simulates real-time decoding with a time.sleep corresponding to the\n duration of the audio packet sent at each yield (assumes 8kHz)\n\n :path: Path to the audio input (any format supported by soundfile package)\n :blocksize: Size of the blocks of aud... | Simulates real-time decoding with a time.sleep corresponding to the
duration of the audio packet sent at each yield (assumes 8kHz)
:path: Path to the audio input (any format supported by soundfile package)
:blocksize: Size of the blocks of audio which will be sent (in samples) | tests/unit/test_recognizer.py | DelayedFileAudioSource | CPqD/asr-sdk-python | 2 | python | def DelayedFileAudioSource(path, blocksize=512):
'\n Simulates real-time decoding with a time.sleep corresponding to the\n duration of the audio packet sent at each yield (assumes 8kHz)\n\n :path: Path to the audio input (any format supported by soundfile package)\n :blocksize: Size of the blocks of aud... | def DelayedFileAudioSource(path, blocksize=512):
'\n Simulates real-time decoding with a time.sleep corresponding to the\n duration of the audio packet sent at each yield (assumes 8kHz)\n\n :path: Path to the audio input (any format supported by soundfile package)\n :blocksize: Size of the blocks of aud... |
1ddbd588af3d5cc8abcd30efdceb2d6e5e252b87ecf4deb9ff74f5ea613515ee | def catalog_evselect(catalog, timerg=None, latrg=None, lonrg=None, deprg=None):
"\n To select events from input catalog.\n\n Parameters\n ----------\n catalog : dict\n Input catalog which contains information of each event therein.\n each parameter should be in numpy array format;\n ... | To select events from input catalog.
Parameters
----------
catalog : dict
Input catalog which contains information of each event therein.
each parameter should be in numpy array format;
catalog['id'] : id of the event;
catalog['time'] : origin time;
catalog['latitude'] : latitude in degree;
cat... | src/catalogs.py | catalog_evselect | speedshi/MALMI | 13 | python | def catalog_evselect(catalog, timerg=None, latrg=None, lonrg=None, deprg=None):
"\n To select events from input catalog.\n\n Parameters\n ----------\n catalog : dict\n Input catalog which contains information of each event therein.\n each parameter should be in numpy array format;\n ... | def catalog_evselect(catalog, timerg=None, latrg=None, lonrg=None, deprg=None):
"\n To select events from input catalog.\n\n Parameters\n ----------\n catalog : dict\n Input catalog which contains information of each event therein.\n each parameter should be in numpy array format;\n ... |
bb5ef877f3ed74a018b670cd7e7d7e481f98f62e20d2ca42a23037ad2622bb86 | def catalog_rmrpev(catalog, thrd_time=0.3, thrd_hdis=None, thrd_depth=None, evkp=None):
"\n To remove the repeated events in the catalog.\n\n Parameters\n ----------\n catalog : dict,\n input catalog containing event information.\n catalog['time'] : origin time;\n catalog['latitude'... | To remove the repeated events in the catalog.
Parameters
----------
catalog : dict,
input catalog containing event information.
catalog['time'] : origin time;
catalog['latitude'] : latitude in degree;
catalog['longitude'] : logitude in degree;
catalog['depth_km'] : depth in km;
catalog['coheren... | src/catalogs.py | catalog_rmrpev | speedshi/MALMI | 13 | python | def catalog_rmrpev(catalog, thrd_time=0.3, thrd_hdis=None, thrd_depth=None, evkp=None):
"\n To remove the repeated events in the catalog.\n\n Parameters\n ----------\n catalog : dict,\n input catalog containing event information.\n catalog['time'] : origin time;\n catalog['latitude'... | def catalog_rmrpev(catalog, thrd_time=0.3, thrd_hdis=None, thrd_depth=None, evkp=None):
"\n To remove the repeated events in the catalog.\n\n Parameters\n ----------\n catalog : dict,\n input catalog containing event information.\n catalog['time'] : origin time;\n catalog['latitude'... |
466e4ae0a32331e4751ea046d934dd818e23f034eb3f999263ceca93baca2878 | def save(self):
'add page info to each page (page x of y)'
num_pages = len(self._saved_page_states)
for state in self._saved_page_states:
self.__dict__.update(state)
self.draw_page_number(num_pages)
canvas.Canvas.showPage(self)
canvas.Canvas.save(self) | add page info to each page (page x of y) | reportlabtopic/myinvoice1.py | save | szintakacseva/PythonTutorial | 0 | python | def save(self):
num_pages = len(self._saved_page_states)
for state in self._saved_page_states:
self.__dict__.update(state)
self.draw_page_number(num_pages)
canvas.Canvas.showPage(self)
canvas.Canvas.save(self) | def save(self):
num_pages = len(self._saved_page_states)
for state in self._saved_page_states:
self.__dict__.update(state)
self.draw_page_number(num_pages)
canvas.Canvas.showPage(self)
canvas.Canvas.save(self)<|docstring|>add page info to each page (page x of y)<|endoftext|> |
7a4066bdee38b56c67c2ff34f6d773bf20cd93e5582b3f3486f5a01a257912ea | def draw_page_number(self, page_count):
'\n self.drawRightString(211 * mm, 15 * mm + (0.2 * inch),\n "Page %d of %d" % (self._pageNumber, page_count))\n '
self.drawRightString((205 * mm), ((5 * mm) + (0.2 * inch)), ('%d oldal{oszesen: %d}' % (page_count, self._pageNumbe... | self.drawRightString(211 * mm, 15 * mm + (0.2 * inch),
"Page %d of %d" % (self._pageNumber, page_count)) | reportlabtopic/myinvoice1.py | draw_page_number | szintakacseva/PythonTutorial | 0 | python | def draw_page_number(self, page_count):
'\n self.drawRightString(211 * mm, 15 * mm + (0.2 * inch),\n "Page %d of %d" % (self._pageNumber, page_count))\n '
self.drawRightString((205 * mm), ((5 * mm) + (0.2 * inch)), ('%d oldal{oszesen: %d}' % (page_count, self._pageNumbe... | def draw_page_number(self, page_count):
'\n self.drawRightString(211 * mm, 15 * mm + (0.2 * inch),\n "Page %d of %d" % (self._pageNumber, page_count))\n '
self.drawRightString((205 * mm), ((5 * mm) + (0.2 * inch)), ('%d oldal{oszesen: %d}' % (page_count, self._pageNumbe... |
45c5a4703c27cbba952c5600ed232e488e159f7292af301ff2c8ae0656344089 | def json_rpc(method, params=None):
'\n Executes a JSON-RPC in Kodi\n\n :param method: The JSON-RPC method to call\n :type method: string\n :param params: The parameters of the method call (optional)\n :type params: dict\n :returns: dict -- Method call result\n '
request_data = {'jsonrpc': '... | Executes a JSON-RPC in Kodi
:param method: The JSON-RPC method to call
:type method: string
:param params: The parameters of the method call (optional)
:type params: dict
:returns: dict -- Method call result | resources/lib/helpers/kodi_ops.py | json_rpc | lukrus1/plugin.autoupdatekodi | 1 | python | def json_rpc(method, params=None):
'\n Executes a JSON-RPC in Kodi\n\n :param method: The JSON-RPC method to call\n :type method: string\n :param params: The parameters of the method call (optional)\n :type params: dict\n :returns: dict -- Method call result\n '
request_data = {'jsonrpc': '... | def json_rpc(method, params=None):
'\n Executes a JSON-RPC in Kodi\n\n :param method: The JSON-RPC method to call\n :type method: string\n :param params: The parameters of the method call (optional)\n :type params: dict\n :returns: dict -- Method call result\n '
request_data = {'jsonrpc': '... |
109c231c99133bf63db46edde0ba89fb419584ece8fb18c68be75166b8b2d3c4 | def get_local_string(string_id):
'Retrieve a localized string by its id'
src = (xbmc if (string_id < 30000) else G.ADDON)
return src.getLocalizedString(string_id) | Retrieve a localized string by its id | resources/lib/helpers/kodi_ops.py | get_local_string | lukrus1/plugin.autoupdatekodi | 1 | python | def get_local_string(string_id):
src = (xbmc if (string_id < 30000) else G.ADDON)
return src.getLocalizedString(string_id) | def get_local_string(string_id):
src = (xbmc if (string_id < 30000) else G.ADDON)
return src.getLocalizedString(string_id)<|docstring|>Retrieve a localized string by its id<|endoftext|> |
ee45976fb11b8e4b3fe27d11979a5801cb6ce96b274a29777df6151549da2462 | def show_notification(msg, title='AutoUpdateKodi', time=3000):
'Show a notification'
xbmc.executebuiltin('Notification({}, {}, {}, {})'.format(title, msg, time, G.ICON)) | Show a notification | resources/lib/helpers/kodi_ops.py | show_notification | lukrus1/plugin.autoupdatekodi | 1 | python | def show_notification(msg, title='AutoUpdateKodi', time=3000):
xbmc.executebuiltin('Notification({}, {}, {}, {})'.format(title, msg, time, G.ICON)) | def show_notification(msg, title='AutoUpdateKodi', time=3000):
xbmc.executebuiltin('Notification({}, {}, {}, {})'.format(title, msg, time, G.ICON))<|docstring|>Show a notification<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.