id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
6,601 | is_modified | def is_modified(kev):
"""Determines whether the given kevent represents modification."""
fflags = kev.fflags
return (fflags & select.KQ_NOTE_EXTEND) or (fflags & select.KQ_NOTE_WRITE) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 153 | 156 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,602 | is_attrib_modified | def is_attrib_modified(kev):
"""Determines whether the given kevent represents attribute modification."""
return kev.fflags & select.KQ_NOTE_ATTRIB | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 159 | 161 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,603 | is_renamed | def is_renamed(kev):
"""Determines whether the given kevent represents movement."""
return kev.fflags & select.KQ_NOTE_RENAME | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 164 | 166 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,604 | __init__ | def __init__(self):
# Set of KeventDescriptor
self._descriptors = set()
# Descriptor for a given path.
self._descriptor_for_path = dict()
# Descriptor for a given fd.
self._descriptor_for_fd = dict()
# List of kevent objects.
self._kevents = list()
... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 175 | 188 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,605 | kevents | def kevents(self):
"""
List of kevents monitored.
"""
with self._lock:
return self._kevents | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 191 | 196 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,606 | paths | def paths(self):
"""
List of paths for which kevents have been created.
"""
with self._lock:
return list(self._descriptor_for_path.keys()) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 199 | 204 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,607 | get_for_fd | def get_for_fd(self, fd):
"""
Given a file descriptor, returns the kevent descriptor object
for it.
:param fd:
OS file descriptor.
:type fd:
``int``
:returns:
A :class:`KeventDescriptor` object.
"""
with self._lock:
... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 206 | 219 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,608 | get | def get(self, path):
"""
Obtains a :class:`KeventDescriptor` object for the specified path.
:param path:
Path for which the descriptor will be obtained.
"""
with self._lock:
path = absolute_path(path)
return self._get(path) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 221 | 230 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,609 | __contains__ | def __contains__(self, path):
"""
Determines whether a :class:`KeventDescriptor has been registered
for the specified path.
:param path:
Path for which the descriptor will be obtained.
"""
with self._lock:
path = absolute_path(path)
re... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 232 | 242 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,610 | add | def add(self, path, is_directory):
"""
Adds a :class:`KeventDescriptor` to the collection for the given
path.
:param path:
The path for which a :class:`KeventDescriptor` object will be
added.
:param is_directory:
``True`` if the path refers to... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 244 | 260 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,611 | remove | def remove(self, path):
"""
Removes the :class:`KeventDescriptor` object for the given path
if it already exists.
:param path:
Path for which the :class:`KeventDescriptor` object will be
removed.
"""
with self._lock:
path = absolute_pa... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 262 | 274 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,612 | clear | def clear(self):
"""
Clears the collection and closes all open descriptors.
"""
with self._lock:
for descriptor in self._descriptors:
descriptor.close()
self._descriptors.clear()
self._descriptor_for_fd.clear()
self._descrip... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 276 | 286 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,613 | _get | def _get(self, path):
"""Returns a kevent descriptor for a given path."""
return self._descriptor_for_path[path] | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 289 | 291 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,614 | _has_path | def _has_path(self, path):
"""Determines whether a :class:`KeventDescriptor` for the specified
path exists already in the collection."""
return path in self._descriptor_for_path | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 293 | 296 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,615 | _add_descriptor | def _add_descriptor(self, descriptor):
"""
Adds a descriptor to the collection.
:param descriptor:
An instance of :class:`KeventDescriptor` to be added.
"""
self._descriptors.add(descriptor)
self._kevents.append(descriptor.kevent)
self._descriptor_for... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 298 | 308 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,616 | _remove_descriptor | def _remove_descriptor(self, descriptor):
"""
Removes a descriptor from the collection.
:param descriptor:
An instance of :class:`KeventDescriptor` to be removed.
"""
self._descriptors.remove(descriptor)
del self._descriptor_for_fd[descriptor.fd]
del ... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 310 | 321 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,617 | __init__ | def __init__(self, path, is_directory):
self._path = absolute_path(path)
self._is_directory = is_directory
self._fd = os.open(path, WATCHDOG_OS_OPEN_FLAGS)
self._kev = select.kevent(self._fd,
filter=WATCHDOG_KQ_FILTER,
f... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 342 | 349 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,618 | fd | def fd(self):
"""OS file descriptor for the kevent descriptor."""
return self._fd | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 352 | 354 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,619 | path | def path(self):
"""The path associated with the kevent descriptor."""
return self._path | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 357 | 359 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,620 | kevent | def kevent(self):
"""The kevent object associated with the kevent descriptor."""
return self._kev | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 362 | 364 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,621 | is_directory | def is_directory(self):
"""Determines whether the kevent descriptor refers to a directory.
:returns:
``True`` or ``False``
"""
return self._is_directory | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 367 | 373 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,622 | close | def close(self):
"""
Closes the file descriptor associated with a kevent descriptor.
"""
try:
os.close(self.fd)
except OSError:
pass | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 375 | 382 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,623 | key | def key(self):
return (self.path, self.is_directory) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 385 | 386 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,624 | __eq__ | def __eq__(self, descriptor):
return self.key == descriptor.key | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 388 | 389 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,625 | __ne__ | def __ne__(self, descriptor):
return self.key != descriptor.key | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 391 | 392 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,626 | __hash__ | def __hash__(self):
return hash(self.key) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 394 | 395 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,627 | __repr__ | def __repr__(self):
return "<KeventDescriptor: path=%s, is_directory=%s>"\
% (self.path, self.is_directory) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 397 | 399 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,628 | __init__ | def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
EventEmitter.__init__(self, event_queue, watch, timeout)
self._kq = select.kqueue()
self._lock = threading.RLock()
# A collection of KeventDescriptor.
self._descriptors = KeventDescriptorSet()
def... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 447 | 461 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,629 | walker_callback | def walker_callback(path, stat_info, self=self):
self._register_kevent(path, stat.S_ISDIR(stat_info.st_mode)) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 456 | 457 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,630 | _register_kevent | def _register_kevent(self, path, is_directory):
"""
Registers a kevent descriptor for the given path.
:param path:
Path for which a kevent descriptor will be created.
:param is_directory:
``True`` if the path refers to a directory; ``False`` otherwise.
:t... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 463 | 498 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,631 | _unregister_kevent | def _unregister_kevent(self, path):
"""
Convenience function to close the kevent descriptor for a
specified kqueue-monitored path.
:param path:
Path for which the kevent descriptor will be closed.
"""
self._descriptors.remove(path) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 500 | 508 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,632 | queue_event | def queue_event(self, event):
"""
Handles queueing a single event object.
:param event:
An instance of :class:`watchdog.events.FileSystemEvent`
or a subclass.
"""
# Handles all the book keeping for queued events.
# We do not need to fire moved/del... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 510 | 529 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,633 | _queue_dirs_modified | def _queue_dirs_modified(self,
dirs_modified,
ref_snapshot,
new_snapshot):
"""
Queues events for directory modifications by scanning the directory
for changes.
A scan is a comparison between two snaps... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 531 | 551 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,634 | _queue_events_except_renames_and_dir_modifications | def _queue_events_except_renames_and_dir_modifications(self, event_list):
"""
Queues events from the kevent list returned from the call to
:meth:`select.kqueue.control`.
.. NOTE:: Queues only the deletions, file modifications,
attribute modifications. The other events,... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 553 | 599 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,635 | _queue_renamed | def _queue_renamed(self,
src_path,
is_directory,
ref_snapshot,
new_snapshot):
"""
Compares information from two directory snapshots (one taken before
the rename operation and another taken right after) to... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 601 | 651 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,636 | _read_events | def _read_events(self, timeout=None):
"""
Reads events from a call to the blocking
:meth:`select.kqueue.control()` method.
:param timeout:
Blocking timeout for reading events.
:type timeout:
``float`` (seconds)
"""
return self._kq.control(... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 653 | 665 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,637 | queue_events | def queue_events(self, timeout):
"""
Queues events by reading them from a call to the blocking
:meth:`select.kqueue.control()` method.
:param timeout:
Blocking timeout for reading events.
:type timeout:
``float`` (seconds)
"""
with self._l... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 667 | 709 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,638 | on_thread_stop | def on_thread_stop(self):
# Clean up.
with self._lock:
self._descriptors.clear()
self._kq.close() | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 711 | 715 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,639 | __init__ | def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
BaseObserver.__init__(self, emitter_class=KqueueEmitter, timeout=timeout) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py | 725 | 726 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,640 | _load_libc | def _load_libc():
libc_path = None
try:
libc_path = ctypes.util.find_library('c')
except (OSError, IOError, RuntimeError):
# Note: find_library will on some platforms raise these undocumented
# errors, e.g.on android IOError "No usable temporary directory found"
# will be rai... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 31 | 59 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,641 | __init__ | def __init__(self, path, recursive=False, event_mask=WATCHDOG_ALL_EVENTS):
# The file descriptor associated with the inotify instance.
inotify_fd = inotify_init()
if inotify_fd == -1:
Inotify._raise_error()
self._inotify_fd = inotify_fd
self._lock = threading.Lock()
... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 184 | 200 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,642 | event_mask | def event_mask(self):
"""The event mask for this inotify instance."""
return self._event_mask | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 203 | 205 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,643 | path | def path(self):
"""The path associated with the inotify instance."""
return self._path | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 208 | 210 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,644 | is_recursive | def is_recursive(self):
"""Whether we are watching directories recursively."""
return self._is_recursive | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 213 | 215 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,645 | fd | def fd(self):
"""The file descriptor associated with the inotify instance."""
return self._inotify_fd | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 218 | 220 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,646 | clear_move_records | def clear_move_records(self):
"""Clear cached records of MOVED_FROM events"""
self._moved_from_events = dict() | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 222 | 224 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,647 | source_for_move | def source_for_move(self, destination_event):
"""
The source path corresponding to the given MOVED_TO event.
If the source path is outside the monitored directories, None
is returned instead.
"""
if destination_event.cookie in self._moved_from_events:
return ... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 226 | 236 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,648 | remember_move_from_event | def remember_move_from_event(self, event):
"""
Save this event as the source event for future MOVED_TO events to
reference.
"""
self._moved_from_events[event.cookie] = event | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 238 | 243 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,649 | add_watch | def add_watch(self, path):
"""
Adds a watch for the given path.
:param path:
Path to begin monitoring.
"""
with self._lock:
self._add_watch(path, self._event_mask) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 245 | 253 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,650 | remove_watch | def remove_watch(self, path):
"""
Removes a watch for the given path.
:param path:
Path string for which the watch will be removed.
"""
with self._lock:
wd = self._wd_for_path.pop(path)
del self._path_for_wd[wd]
if inotify_rm_watch... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 255 | 266 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,651 | close | def close(self):
"""
Closes the inotify instance and removes all associated watches.
"""
with self._lock:
if self._path in self._wd_for_path:
wd = self._wd_for_path[self._path]
inotify_rm_watch(self._inotify_fd, wd)
os.close(self._i... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 268 | 276 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,652 | read_events | def read_events(self, event_buffer_size=DEFAULT_EVENT_BUFFER_SIZE):
"""
Reads events from inotify and yields them.
"""
# HACK: We need to traverse the directory path
# recursively and simulate events for newly
# created subdirectories/files. This will handle
# mkd... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 278 | 363 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,653 | _recursive_simulate | def _recursive_simulate(src_path):
events = []
for root, dirnames, filenames in os.walk(src_path):
for dirname in dirnames:
try:
full_path = os.path.join(root, dirname)
wd_dir = self._add_watch(full_path, self._e... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 287 | 305 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,654 | _add_dir_watch | def _add_dir_watch(self, path, recursive, mask):
"""
Adds a watch (optionally recursively) for the given directory path
to monitor events specified by the mask.
:param path:
Path to monitor
:param recursive:
``True`` to monitor recursively.
:param... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 366 | 387 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,655 | _add_watch | def _add_watch(self, path, mask):
"""
Adds a watch for the given path to monitor events specified by the
mask.
:param path:
Path to monitor
:param mask:
Event bit mask.
"""
wd = inotify_add_watch(self._inotify_fd, path, mask)
if wd... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 389 | 404 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,656 | _raise_error | def _raise_error():
"""
Raises errors for inotify failures.
"""
err = ctypes.get_errno()
if err == errno.ENOSPC:
raise OSError("inotify watch limit reached")
elif err == errno.EMFILE:
raise OSError("inotify instance limit reached")
else:
... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 407 | 417 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,657 | _parse_event_buffer | def _parse_event_buffer(event_buffer):
"""
Parses an event buffer of ``inotify_event`` structs returned by
inotify::
struct inotify_event {
__s32 wd; /* watch descriptor */
__u32 mask; /* watch mask */
__u32 cookie;... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 420 | 442 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,658 | __init__ | def __init__(self, wd, mask, cookie, name, src_path):
self._wd = wd
self._mask = mask
self._cookie = cookie
self._name = name
self._src_path = src_path | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 461 | 466 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,659 | src_path | def src_path(self):
return self._src_path | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 469 | 470 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,660 | wd | def wd(self):
return self._wd | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 473 | 474 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,661 | mask | def mask(self):
return self._mask | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 477 | 478 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,662 | cookie | def cookie(self):
return self._cookie | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 481 | 482 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,663 | name | def name(self):
return self._name | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 485 | 486 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,664 | is_modify | def is_modify(self):
return self._mask & InotifyConstants.IN_MODIFY > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 489 | 490 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,665 | is_close_write | def is_close_write(self):
return self._mask & InotifyConstants.IN_CLOSE_WRITE > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 493 | 494 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,666 | is_close_nowrite | def is_close_nowrite(self):
return self._mask & InotifyConstants.IN_CLOSE_NOWRITE > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 497 | 498 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,667 | is_access | def is_access(self):
return self._mask & InotifyConstants.IN_ACCESS > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 501 | 502 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,668 | is_delete | def is_delete(self):
return self._mask & InotifyConstants.IN_DELETE > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 505 | 506 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,669 | is_delete_self | def is_delete_self(self):
return self._mask & InotifyConstants.IN_DELETE_SELF > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 509 | 510 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,670 | is_create | def is_create(self):
return self._mask & InotifyConstants.IN_CREATE > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 513 | 514 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,671 | is_moved_from | def is_moved_from(self):
return self._mask & InotifyConstants.IN_MOVED_FROM > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 517 | 518 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,672 | is_moved_to | def is_moved_to(self):
return self._mask & InotifyConstants.IN_MOVED_TO > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 521 | 522 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,673 | is_move | def is_move(self):
return self._mask & InotifyConstants.IN_MOVE > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 525 | 526 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,674 | is_move_self | def is_move_self(self):
return self._mask & InotifyConstants.IN_MOVE_SELF > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 529 | 530 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,675 | is_attrib | def is_attrib(self):
return self._mask & InotifyConstants.IN_ATTRIB > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 533 | 534 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,676 | is_ignored | def is_ignored(self):
return self._mask & InotifyConstants.IN_IGNORED > 0 | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 537 | 538 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,677 | is_directory | def is_directory(self):
# It looks like the kernel does not provide this information for
# IN_DELETE_SELF and IN_MOVE_SELF. In this case, assume it's a dir.
# See also: https://github.com/seb-m/pyinotify/blob/2c7e8f8/python2/pyinotify.py#L897
return (self.is_delete_self or self.is_move_s... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 541 | 546 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,678 | key | def key(self):
return self._src_path, self._wd, self._mask, self._cookie, self._name | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 549 | 550 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,679 | __eq__ | def __eq__(self, inotify_event):
return self.key == inotify_event.key | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 552 | 553 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,680 | __ne__ | def __ne__(self, inotify_event):
return self.key == inotify_event.key | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 555 | 556 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,681 | __hash__ | def __hash__(self):
return hash(self.key) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 558 | 559 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,682 | _get_mask_string | def _get_mask_string(mask):
masks = []
for c in dir(InotifyConstants):
if c.startswith('IN_') and c not in ['IN_ALL_EVENTS', 'IN_CLOSE', 'IN_MOVE']:
c_val = getattr(InotifyConstants, c)
if mask & c_val:
masks.append(c)
mask_string =... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 562 | 570 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,683 | __repr__ | def __repr__(self):
mask_string = self._get_mask_string(self.mask)
s = "<InotifyEvent: src_path=%s, wd=%d, mask=%s, cookie=%d, name=%s>"
return s % (self.src_path, self.wd, mask_string, self.cookie, self.name) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py | 572 | 575 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,684 | __init__ | def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT,
stat=default_stat, listdir=os.listdir):
EventEmitter.__init__(self, event_queue, watch, timeout)
self._snapshot = None
self._lock = threading.Lock()
self._take_snapshot = lambda: DirectorySnapshot(
... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py | 68 | 74 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,685 | on_thread_start | def on_thread_start(self):
self._snapshot = self._take_snapshot() | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py | 76 | 77 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,686 | queue_events | def queue_events(self, timeout):
# We don't want to hit the disk continuously.
# timeout behaves like an interval for polling emitters.
if self.stopped_event.wait(timeout):
return
with self._lock:
if not self.should_keep_running():
return
... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py | 79 | 119 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,687 | __init__ | def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
BaseObserver.__init__(self, emitter_class=PollingEmitter, timeout=timeout) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py | 128 | 129 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,688 | __init__ | def __init__(self, stat, listdir, polling_interval=1):
"""
:param stat: stat function. See ``os.stat`` for details.
:param listdir: listdir function. See ``os.listdir`` for details.
:type polling_interval: float
:param polling_interval: interval in seconds between polling the fil... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py | 137 | 145 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,689 | __init__ | def __init__(self, path):
Thread.__init__(self)
self._queue = queue.Queue()
self._run_loop = None
if isinstance(path, bytes):
path = path.decode('utf-8')
self._path = unicodedata.normalize('NFC', path)
context = None
latency = 1.0
self._strea... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 84 | 100 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,690 | run | def run(self):
pool = AppKit.NSAutoreleasePool.alloc().init()
self._run_loop = CFRunLoopGetCurrent()
FSEventStreamScheduleWithRunLoop(
self._stream_ref, self._run_loop, kCFRunLoopDefaultMode)
if not FSEventStreamStart(self._stream_ref):
FSEventStreamInvalidate(sel... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 102 | 118 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,691 | stop | def stop(self):
if self._run_loop is not None:
CFRunLoopStop(self._run_loop) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 120 | 122 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,692 | _callback | def _callback(self, streamRef, clientCallBackInfo, numEvents, eventPaths, eventFlags, eventIDs):
events = [NativeEvent(path, flags, _id) for path, flags, _id in
zip(eventPaths, eventFlags, eventIDs)]
logger.debug("FSEvents callback. Got %d events:" % numEvents)
for e in events:... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 124 | 130 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,693 | read_events | def read_events(self):
"""
Returns a list or one or more events, or None if there are no more
events to be read.
"""
if not self.is_alive():
return None
return self._queue.get() | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 132 | 139 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,694 | __init__ | def __init__(self, path, flags, event_id):
self.path = path
self.flags = flags
self.event_id = event_id
self.is_created = bool(flags & kFSEventStreamEventFlagItemCreated)
self.is_removed = bool(flags & kFSEventStreamEventFlagItemRemoved)
self.is_renamed = bool(flags & kFS... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 143 | 156 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,695 | _event_type | def _event_type(self):
if self.is_created: return "Created"
if self.is_removed: return "Removed"
if self.is_renamed: return "Renamed"
if self.is_modified: return "Modified"
if self.is_inode_meta_mod: return "InodeMetaMod"
if self.is_xattr_mod: return "XattrMod"
re... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 159 | 166 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,696 | __repr__ | def __repr__(self):
s ="<NativeEvent: path=%s, type=%s, is_dir=%s, flags=%s, id=%s>"
return s % (repr(self.path), self._event_type, self.is_directory, hex(self.flags), self.event_id) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 168 | 170 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,697 | __init__ | def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
EventEmitter.__init__(self, event_queue, watch, timeout)
self._fsevents = FSEventsQueue(watch.path)
self._fsevents.start() | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 178 | 181 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,698 | on_thread_stop | def on_thread_stop(self):
self._fsevents.stop() | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 183 | 184 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,699 | queue_events | def queue_events(self, timeout):
events = self._fsevents.read_events()
if events is None:
return
i = 0
while i < len(events):
event = events[i]
# For some reason the create and remove flags are sometimes also
# set for rename and modify ty... | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 186 | 234 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,700 | __init__ | def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
BaseObserver.__init__(self, emitter_class=FSEventsEmitter, timeout=timeout) | python | wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py | 238 | 239 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.