file_name large_stringlengths 4 140 | prefix large_stringlengths 0 12.1k | suffix large_stringlengths 0 12k | middle large_stringlengths 0 7.51k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
main.rs | c| match c {
Self::And(es) => es,
x => vec![x],
})
.collect(),
)
}
/// convert the expression into disjunctive normal form
///
/// careful, for some expressions this can have exponential runtime. E.g. the disjunctive normal... | Ok(serde_cbor::from_slice(&decompressed)?)
}
fn borrow_inner(elements: &[BTreeSet<String>]) -> Vec<BTreeSet<&str>> {
elements.iter().map(|x| x.iter().map(|e| e.as_ref()).collect()).collect() | random_line_split | |
main.rs | <_>>();
// not a single query can possibly match, no need to iterate.
if query.is_empty() {
return Vec::new();
}
// check the remaining queries
self.elements
.iter()
.enumerate()
.filter_map(|(i, e)| {
if query.iter(... |
fn and(e: Vec<Expression>) -> Self {
Self::And(
e.into_iter()
.flat_map(|c| match c {
Self::And(es) => es,
x => vec![x],
})
.collect(),
)
}
/// convert the expression into disjunctive norma... | {
Self::Or(
e.into_iter()
.flat_map(|c| match c {
Self::Or(es) => es,
x => vec![x],
})
.collect(),
)
} | identifier_body |
main.rs | <_>>();
// not a single query can possibly match, no need to iterate.
if query.is_empty() {
return Vec::new();
}
// check the remaining queries
self.elements
.iter()
.enumerate()
.filter_map(|(i, e)| {
if query.iter(... | (e: Vec<Expression>) -> Self {
Self::Or(
e.into_iter()
.flat_map(|c| match c {
Self::Or(es) => es,
x => vec![x],
})
.collect(),
)
}
fn and(e: Vec<Expression>) -> Self {
Self::And(
... | or | identifier_name |
main.rs |
}
}
Ok(Index {
strings: strings.into_iter().collect(),
elements,
})
}
}
impl Index {
/// given a query expression in Dnf form, returns all matching indices
pub fn matching(&self, query: Dnf) -> Vec<usize> {
// lookup all strings and trans... | {
return Err(serde::de::Error::custom("invalid string index"));
} | conditional_block | |
xterm.rs | fn from(color: XtermColors) -> Self {
match color {
$(
XtermColors::$name => $xterm_num,
)*
}
}
}
}
$(
#[allow(missing_docs)]
... | impl From<XtermColors> for u8 { | random_line_split | |
gtmaps.py | _z = min(reach_z)
nav_grid = np.zeros((c_x,c_z))
for i in range(nav_grid.shape[0]):
for j in range(nav_grid.shape[1]):
if [m_x + i*0.25, m_z + j*0.25] in coords:
nav_grid[i,j] = 1
else:
nav_grid[i,j] = 0
#print("nav_grid after disabling... | d = '>' #"\u2192" #right arrow
if locator[2]==270:
d = '^' #"\u2191" #up arrow
if locator[2]==90:
d = 'v' #"\u2193" #down arrow
if locator[2]==180:
d = '<' #"... | for j in range(mat.shape[1]):
d = repr(j)
if j<10:
d = '0'+d
print(d,end = '')
print(" ",end = '')
print(" ")
print(" ")
for i in range(mat.shape[0]):
for j in range(mat.shape[1]):
d = 0
if argmax:
d... | identifier_body |
gtmaps.py | m_z = min(reach_z)
nav_grid = np.zeros((c_x,c_z))
for i in range(nav_grid.shape[0]):
for j in range(nav_grid.shape[1]):
if [m_x + i*0.25, m_z + j*0.25] in coords:
nav_grid[i,j] = 1
else:
nav_grid[i,j] = 0
#print("nav_grid after disabli... | print(" ",end = '')
print(" --",repr(i))
#print(" ")
def surrounding_patch(agentloc, labeled_grid, R = 16, unreach_value = -1): #returns a visibility patch centered around the agent with radius R
#unreach_value = -1
mat = labeled_grid
position = agentloc
r=copy... | if locator[2]==180:
d = '<' #"\u2190" #left arrow
print(d,end = '')
| random_line_split |
gtmaps.py | append black columns to the left of agent position
#print("Increasing columns to left ")
mat = np.insert(mat,0, unreach_value,axis=1)
r-=1
p[0]+=1
r=copy.copy(R)
while position[0]+r>init_shape[1]-1: #append blank columns to the right of the agent position
#print("I... | prettyprint(o_grids[obj]) | conditional_block | |
gtmaps.py | (env,event):
#sometimes in a room there are fixed objects which cannot be removed from scene using disable command
#so need to go near them to check distance and then map them
return
def gtmap(env,event):
objs = event.metadata['objects']
print("There are a total of ",len(objs)," objects ... | touchmap | identifier_name | |
corpus_wikipedia.py | ', #'/home/arne/devel/ML/data/corpora/WIKIPEDIA/wikipedia-23886057.csv',#'/home/arne/devel/ML/data/corpora/WIKIPEDIA/documents_utf8_filtered_20pageviews.csv', # '/home/arne/devel/ML/data/corpora/SICK/sick_train/SICK_train.txt',
'The path to the SICK train data file.')
#tf.flags.DEFINE_string(
# 'corpus_data_inpu... | tree_mode=tree_mode,
child_idx_offset=child_idx_offset)
print('dump data, parents, depths and child indices for offset=' + str(offset) + ' ...')
current_seq_data.dump(out_path + '.data.batch' + str(offset))
current_seq_parents.dump(out_path + '.parent.batch' + str(offset)... | out_fn = ntpath.basename(out_path)
print('parse articles ...')
child_idx_offset = 0
for offset in range(0, max_articles, batch_size):
# all or none: otherwise the mapping lacks entries!
#if not careful or not os.path.isfile(out_path + '.data.batch' + str(offset)) \
# or not o... | identifier_body |
corpus_wikipedia.py | ', #'/home/arne/devel/ML/data/corpora/WIKIPEDIA/wikipedia-23886057.csv',#'/home/arne/devel/ML/data/corpora/WIKIPEDIA/documents_utf8_filtered_20pageviews.csv', # '/home/arne/devel/ML/data/corpora/SICK/sick_train/SICK_train.txt',
'The path to the SICK train data file.')
#tf.flags.DEFINE_string(
# 'corpus_data_inpu... |
return parser
def parse_articles(out_path, parent_dir, in_filename, parser, mapping, sentence_processor, max_depth, max_articles, batch_size, tree_mode):
out_fn = ntpath.basename(out_path)
print('parse articles ...')
child_idx_offset = 0
for offset in range(0, max_articles, batch_size):
... | if not os.path.isfile(out_filename + '.children.depth' + str(current_depth)):
preprocessing.merge_numpy_batch_files(out_base_name + '.children.depth' + str(current_depth), parent_dir) | conditional_block |
corpus_wikipedia.py | ', #'/home/arne/devel/ML/data/corpora/WIKIPEDIA/wikipedia-23886057.csv',#'/home/arne/devel/ML/data/corpora/WIKIPEDIA/documents_utf8_filtered_20pageviews.csv', # '/home/arne/devel/ML/data/corpora/SICK/sick_train/SICK_train.txt',
'The path to the SICK train data file.')
#tf.flags.DEFINE_string(
# 'corpus_data_inpu... | articles_from_csv_reader,
sentence_processor, parser, mapping,
args={
'filename': in_filename,
'max_articles': min(batch_size, max_articles),
'skip': offset
},
max_depth=max_depth,
batch_size=batch_si... | #if not careful or not os.path.isfile(out_path + '.data.batch' + str(offset)) \
# or not os.path.isfile(out_path + '.parent.batch' + str(offset)) \
# or not os.path.isfile(out_path + '.depth.batch' + str(offset)) \
# or not os.path.isfile(out_path + '.children.batch'... | random_line_split |
corpus_wikipedia.py | ', #'/home/arne/devel/ML/data/corpora/WIKIPEDIA/wikipedia-23886057.csv',#'/home/arne/devel/ML/data/corpora/WIKIPEDIA/documents_utf8_filtered_20pageviews.csv', # '/home/arne/devel/ML/data/corpora/SICK/sick_train/SICK_train.txt',
'The path to the SICK train data file.')
#tf.flags.DEFINE_string(
# 'corpus_data_inpu... | (out_path, parent_dir, in_filename, parser, mapping, sentence_processor, max_depth, max_articles, batch_size, tree_mode):
out_fn = ntpath.basename(out_path)
print('parse articles ...')
child_idx_offset = 0
for offset in range(0, max_articles, batch_size):
# all or none: otherwise the mapping la... | parse_articles | identifier_name |
sync.go | () error {
if w.holeSize > 0 {
err := w.writer.PunchHole(w.offset, w.holeSize)
if err == nil {
w.offset += w.holeSize
w.holeSize = 0
}
return err
}
if len(w.buf) == 0 {
return nil
}
n, err := w.writer.WriteAt(w.buf, w.offset)
if err != nil {
return err
}
w.buf = w.buf[:0]
w.offset += int64(n)... | Flush | identifier_name | |
sync.go | }
written += n2
if err != nil {
return written, err
}
} else {
written += n
}
p = p[n:]
}
}
return written, nil
}
func (w *batchingWriter) ReadFrom(src io.Reader) (int64, error) {
if err := w.prepareWrite(); err != nil {
return 0, err
}
var read int64
for {
n, err := src... | n2 = 0 | random_line_split | |
sync.go | , error) | err := w.Flush()
w.offset = offset
if err != nil {
return offset, err
}
}
return offset, nil
}
type counting struct {
count int64
}
type CountingReader struct {
io.Reader
counting
}
type CountingWriteCloser struct {
io.WriteCloser
counting
}
func (p *hashPool) get() (h hash.Hash) {
l := len(*p)
... | {
var o int64
if w.holeSize > 0 {
o = w.offset + w.holeSize
} else {
o = w.offset + int64(len(w.buf))
}
switch whence {
case io.SeekStart:
// no-op
case io.SeekCurrent:
offset = o + offset
case io.SeekEnd:
var err error
offset, err = w.writer.Seek(offset, whence)
if err != nil {
return offset, ... | identifier_body |
sync.go |
}
}
}
func (w *batchingWriter) WriteHole(size int64) error {
if w.holeSize == 0 {
err := w.Flush()
if err != nil {
return err
}
}
w.holeSize += size
return nil
}
func (w *batchingWriter) Seek(offset int64, whence int) (int64, error) {
var o int64
if w.holeSize > 0 {
o = w.offset + w.holeSize
} e... | {
return read, err
} | conditional_block | |
event.py | _* methods depend on this attribute.
Can be: 'QUIT', 'KEYDOWN', 'KEYUP', 'MOUSEDOWN', 'MOUSEUP', or 'MOUSEMOTION.'
"""
def __repr__(self):
"""List an events public attributes when printed.
"""
attrdict = {}
for varname in dir(self):
if '_' == varname[0]:
... |
return '%s(%s)' % (self.__class__.__name__, ', '.join(parameters))
class KeyDown(KeyEvent):
"""Fired when the user presses a key on the keyboard or a key repeats.
"""
type = 'KEYDOWN'
class KeyUp(KeyEvent):
"""Fired when the user releases a key on the keyboard.
"""
type = 'KEYUP'
_mo... | parameters.append('%s=%r' % (attr, value)) | conditional_block |
event.py |
'QUIT', 'KEYDOWN', 'KEYUP', 'MOUSEDOWN', 'MOUSEUP', or 'MOUSEMOTION.'
- L{MouseButtonEvent.button} (found in L{MouseDown} and L{MouseUp} events)
'LEFT', 'MIDDLE', 'RIGHT', 'SCROLLUP', 'SCROLLDOWN'
- L{KeyEvent.key} (found in L{KeyDown} and L{KeyUp} events)
'NONE', 'ESCAPE', 'BACKSPAC... | random_line_split | ||
event.py | _* methods depend on this attribute.
Can be: 'QUIT', 'KEYDOWN', 'KEYUP', 'MOUSEDOWN', 'MOUSEUP', or 'MOUSEMOTION.'
"""
def __repr__(self):
"""List an events public attributes when printed.
"""
attrdict = {}
for varname in dir(self):
if '_' == varname[0]:
... |
class MouseDown(MouseButtonEvent):
"""Fired when a mouse button is pressed."""
__slots__ = ()
type = 'MOUSEDOWN'
class MouseUp(MouseButtonEvent):
"""Fired when a mouse button is released."""
__slots__ = ()
type = 'MOUSEUP'
class MouseMotion(Event):
"""Fired when the mouse is moved."""
... | def __init__(self, button, pos, cell):
self.button = _mouseNames[button]
"""Can be one of
'LEFT', 'MIDDLE', 'RIGHT', 'SCROLLUP', 'SCROLLDOWN'
@type: string"""
self.pos = pos
"""(x, y) position of the mouse on the screen
@type: (int, int)"""
self.cell = cel... | identifier_body |
event.py | on the screen
@type: (int, int)"""
self.cell = cell
"""(x, y) position of the mouse snapped to a cell on the root console
@type: (int, int)"""
class MouseDown(MouseButtonEvent):
"""Fired when a mouse button is pressed."""
__slots__ = ()
type = 'MOUSEDOWN'
class MouseUp(Mou... | wait | identifier_name | |
dealerDispatcherList.js | *)
pageList: [10, 25, 50, 100],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url: "${ctx}/process/shopmsg/shopMsg/dataDispatcher",
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//queryParamsType:'',
... | conditional_block | ||
dealerDispatcherList.js | true,
//显示 内容列下拉框
showColumns: true,
//显示到处按钮
showExport: true,
//显示切换分页按钮
showPaginationSwitch: true,
//最低显示2行
minimumCountColumns: 2,
//是否显示行间隔色
striped: true,
//是否使用缓存,默认为t... |
}
,{
field: 'legalPersonName',
title: '法人姓名',
sortable: true
}
,{
field: 'legalPersonIdCard',
title: '法人身份号',
sort... | sortable: true | random_line_split |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 14