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,401
__init__
def __init__(self, src_path): super(DirCreatedEvent, self).__init__(src_path)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
284
285
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,402
__repr__
def __repr__(self): return ("<%(class_name)s: src_path=%(src_path)r>" ) % (dict(class_name=self.__class__.__name__, src_path=self.src_path))
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
287
290
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,403
__init__
def __init__(self, src_path, dest_path): super(DirMovedEvent, self).__init__(src_path, dest_path)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
298
299
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,404
__repr__
def __repr__(self): return ("<%(class_name)s: src_path=%(src_path)r, " "dest_path=%(dest_path)r>" ) % (dict(class_name=self.__class__.__name__, src_path=self.src_path, dest_path=self.dest_path))
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
301
306
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,405
dispatch
def dispatch(self, event): """Dispatches events to the appropriate methods. :param event: The event object representing the file system event. :type event: :class:`FileSystemEvent` """ self.on_any_event(event) _method_map = { EVENT_TYP...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
314
330
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,406
on_any_event
def on_any_event(self, event): """Catch-all event handler. :param event: The event object representing the file system event. :type event: :class:`FileSystemEvent` """
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
332
339
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,407
on_moved
def on_moved(self, event): """Called when a file or a directory is moved or renamed. :param event: Event representing file/directory movement. :type event: :class:`DirMovedEvent` or :class:`FileMovedEvent` """
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
341
348
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,408
on_created
def on_created(self, event): """Called when a file or directory is created. :param event: Event representing file/directory creation. :type event: :class:`DirCreatedEvent` or :class:`FileCreatedEvent` """
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
350
357
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,409
on_deleted
def on_deleted(self, event): """Called when a file or directory is deleted. :param event: Event representing file/directory deletion. :type event: :class:`DirDeletedEvent` or :class:`FileDeletedEvent` """
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
359
366
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,410
on_modified
def on_modified(self, event): """Called when a file or directory is modified. :param event: Event representing file/directory modification. :type event: :class:`DirModifiedEvent` or :class:`FileModifiedEvent` """
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
368
375
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,411
__init__
def __init__(self, patterns=None, ignore_patterns=None, ignore_directories=False, case_sensitive=False): super(PatternMatchingEventHandler, self).__init__() self._patterns = patterns self._ignore_patterns = ignore_patterns self._ignore_directories = ignore_directories ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
383
390
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,412
patterns
def patterns(self): """ (Read-only) Patterns to allow matching event paths. """ return self._patterns
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
393
398
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,413
ignore_patterns
def ignore_patterns(self): """ (Read-only) Patterns to ignore matching event paths. """ return self._ignore_patterns
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
401
406
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,414
ignore_directories
def ignore_directories(self): """ (Read-only) ``True`` if directories should be ignored; ``False`` otherwise. """ return self._ignore_directories
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
409
414
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,415
case_sensitive
def case_sensitive(self): """ (Read-only) ``True`` if path names should be matched sensitive to case; ``False`` otherwise. """ return self._case_sensitive
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
417
423
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,416
dispatch
def dispatch(self, event): """Dispatches events to the appropriate methods. :param event: The event object representing the file system event. :type event: :class:`FileSystemEvent` """ if self.ignore_directories and event.is_directory: return ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
425
454
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,417
__init__
def __init__(self, regexes=[r".*"], ignore_regexes=[], ignore_directories=False, case_sensitive=False): super(RegexMatchingEventHandler, self).__init__() if case_sensitive: self._regexes = [re.compile(r) for r in regexes] self._ignore_regexes = [re.compile(r) fo...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
462
473
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,418
regexes
def regexes(self): """ (Read-only) Regexes to allow matching event paths. """ return self._regexes
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
476
481
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,419
ignore_regexes
def ignore_regexes(self): """ (Read-only) Regexes to ignore matching event paths. """ return self._ignore_regexes
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
484
489
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,420
ignore_directories
def ignore_directories(self): """ (Read-only) ``True`` if directories should be ignored; ``False`` otherwise. """ return self._ignore_directories
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
492
497
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,421
case_sensitive
def case_sensitive(self): """ (Read-only) ``True`` if path names should be matched sensitive to case; ``False`` otherwise. """ return self._case_sensitive
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
500
506
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,422
dispatch
def dispatch(self, event): """Dispatches events to the appropriate methods. :param event: The event object representing the file system event. :type event: :class:`FileSystemEvent` """ if self.ignore_directories and event.is_directory: return ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
508
537
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,423
on_moved
def on_moved(self, event): super(LoggingEventHandler, self).on_moved(event) what = 'directory' if event.is_directory else 'file' logging.info("Moved %s: from %s to %s", what, event.src_path, event.dest_path)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
543
548
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,424
on_created
def on_created(self, event): super(LoggingEventHandler, self).on_created(event) what = 'directory' if event.is_directory else 'file' logging.info("Created %s: %s", what, event.src_path)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
550
554
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,425
on_deleted
def on_deleted(self, event): super(LoggingEventHandler, self).on_deleted(event) what = 'directory' if event.is_directory else 'file' logging.info("Deleted %s: %s", what, event.src_path)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
556
560
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,426
on_modified
def on_modified(self, event): super(LoggingEventHandler, self).on_modified(event) what = 'directory' if event.is_directory else 'file' logging.info("Modified %s: %s", what, event.src_path)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
562
566
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,427
generate_sub_moved_events
def generate_sub_moved_events(src_dir_path, dest_dir_path): """Generates an event list of :class:`DirMovedEvent` and :class:`FileMovedEvent` objects for all the files and directories within the given moved directory that were moved along with the directory. :param src_dir_path: The source path ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
576
597
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,428
generate_sub_created_events
def generate_sub_created_events(src_dir_path): """Generates an event list of :class:`DirCreatedEvent` and :class:`FileCreatedEvent` objects for all the files and directories within the given moved directory that were moved along with the directory. :param src_dir_path: The source path of the cr...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py
600
615
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,429
encode
def encode(path): if isinstance(path, str_cls): try: path = path.encode(fs_encoding, 'strict') except UnicodeEncodeError: if not platform.is_linux(): raise path = path.encode(fs_fallback_encoding, 'strict') return path
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/unicode_paths.py
45
53
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,430
decode
def decode(path): if isinstance(path, bytes_cls): try: path = path.decode(fs_encoding, 'strict') except UnicodeDecodeError: if not platform.is_linux(): raise path = path.decode(fs_fallback_encoding, 'strict') return path
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/unicode_paths.py
56
64
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,431
_to_mode
def _to_mode(attr): m = 0 if (attr & FILE_ATTRIBUTE_DIRECTORY): m |= stdstat.S_IFDIR | 0o111 else: m |= stdstat.S_IFREG if (attr & FILE_ATTRIBUTE_READONLY): m |= 0o444 else: m |= 0o666 return m
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/win32stat.py
88
98
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,432
_to_unix_time
def _to_unix_time(ft): t = (ft.dwHighDateTime) << 32 | ft.dwLowDateTime return (t / 10000000) - 11644473600
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/win32stat.py
100
102
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,433
stat
def stat(path): hfile = CreateFile(path, FILE_READ_ATTRIBUTES, 0, None, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, None) if hfile == INVALID_HANDLE_VALUE: raise ctypes.WinError ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/win32stat.py
104
123
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,434
has_attribute
def has_attribute(ob, attribute): """ :func:`hasattr` swallows exceptions. :func:`has_attribute` tests a Python object for the presence of an attribute. :param ob: object to inspect :param attribute: ``str`` for the name of the attribute. """ return getattr(ob, attribute, No...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
48
58
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,435
__init__
def __init__(self): threading.Thread.__init__(self) self.daemon = True self._stopped_event = Event()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
68
71
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,436
stopped_event
def stopped_event(self): return self._stopped_event
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
74
75
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,437
should_keep_running
def should_keep_running(self): """Determines whether the thread should continue running.""" return not self._stopped_event.is_set()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
77
79
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,438
on_thread_stop
def on_thread_stop(self): """Override this method instead of :meth:`stop()`. :meth:`stop()` calls this method. This method is called immediately after the thread is signaled to stop. """ pass
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
81
87
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,439
stop
def stop(self): """Signals the thread to stop.""" self._stopped_event.set() self.on_thread_stop()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
89
92
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,440
on_thread_start
def on_thread_start(self): """Override this method instead of :meth:`start()`. :meth:`start()` calls this method. This method is called right before this thread is started and this object’s run() method is invoked. """ pass
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
94
101
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,441
start
def start(self): self.on_thread_start() threading.Thread.start(self)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
103
105
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,442
load_module
def load_module(module_name): """Imports a module given its name and returns a handle to it.""" try: __import__(module_name) except ImportError: raise ImportError('No module named %s' % module_name) return sys.modules[module_name]
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
108
114
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,443
load_class
def load_class(dotted_path): """Loads and returns a class definition provided a dotted path specification the last part of the dotted path is the class name and there is at least one module name preceding the class name. Notes: You will need to ensure that the module you are trying to load exis...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
117
151
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,444
__init__
def __init__(self, ref, snapshot): created = snapshot.paths - ref.paths deleted = ref.paths - snapshot.paths # check that all unchanged paths have the same inode for path in ref.paths & snapshot.paths: if ref.inode(path) != snapshot.inode(path): creat...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
69
116
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,445
files_created
def files_created(self): """List of files that were created.""" return self._files_created
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
119
121
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,446
files_deleted
def files_deleted(self): """List of files that were deleted.""" return self._files_deleted
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
124
126
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,447
files_modified
def files_modified(self): """List of files that were modified.""" return self._files_modified
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
129
131
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,448
files_moved
def files_moved(self): """ List of files that were moved. Each event is a two-tuple the first item of which is the path that has been renamed to the second item in the tuple. """ return self._files_moved
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
134
141
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,449
dirs_modified
def dirs_modified(self): """ List of directories that were modified. """ return self._dirs_modified
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
144
148
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,450
dirs_moved
def dirs_moved(self): """ List of directories that were moved. Each event is a two-tuple the first item of which is the path that has been renamed to the second item in the tuple. """ return self._dirs_moved
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
151
158
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,451
dirs_deleted
def dirs_deleted(self): """ List of directories that were deleted. """ return self._dirs_deleted
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
161
165
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,452
dirs_created
def dirs_created(self): """ List of directories that were created. """ return self._dirs_created
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
168
172
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,453
__init__
def __init__(self, path, recursive=True, walker_callback=(lambda p, s: None), stat=default_stat, listdir=os.listdir): self._stat_info = {} self._inode_to_path = {} st = stat(path) self._stat_info[path] = st self._inode_t...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
199
239
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,454
walk
def walk(root): try: paths = [os.path.join(root, name) for name in listdir(root)] except OSError as e: # Directory may have been deleted between finding it in the directory # list of its parent and trying to delete its contents. If this ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
210
233
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,455
paths
def paths(self): """ Set of file/directory paths in the snapshot. """ return set(self._stat_info.keys())
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
242
246
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,456
path
def path(self, id): """ Returns path for id. None if id is unknown to this snapshot. """ return self._inode_to_path.get(id)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
248
252
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,457
inode
def inode(self, path): """ Returns an id for path. """ st = self._stat_info[path] return (st.st_ino, st.st_dev)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
254
257
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,458
isdir
def isdir(self, path): return S_ISDIR(self._stat_info[path].st_mode)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
259
260
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,459
mtime
def mtime(self, path): return self._stat_info[path].st_mtime
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
262
263
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,460
stat_info
def stat_info(self, path): """ Returns a stat information object for the specified path from the snapshot. Attached information is subject to change. Do not use unless you specify `stat` in constructor. Use :func:`inode`, :func:`mtime`, :func:`isdir` instead. :p...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
265
278
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,461
__sub__
def __sub__(self, previous_dirsnap): """Allow subtracting a DirectorySnapshot object instance from another. :returns: A :class:`DirectorySnapshotDiff` object. """ return DirectorySnapshotDiff(previous_dirsnap, self)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
280
287
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,462
__str__
def __str__(self): return self.__repr__()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
289
290
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,463
__repr__
def __repr__(self): return str(self._stat_info)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py
292
293
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,464
__init__
def __init__(self, delay): self.delay = delay self._lock = threading.Lock() self._not_empty = threading.Condition(self._lock) self._queue = deque() self._closed = False
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py
24
29
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,465
put
def put(self, element): """Add element to queue.""" self._lock.acquire() self._queue.append((element, time.time())) self._not_empty.notify() self._lock.release()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py
31
36
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,466
close
def close(self): """Close queue, indicating no more items will be added.""" self._closed = True # Interrupt the blocking _not_empty.wait() call in get self._not_empty.acquire() self._not_empty.notify() self._not_empty.release()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py
38
44
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,467
get
def get(self): """Remove and return an element from the queue, or this queue has been closed raise the Closed exception. """ while True: # wait for element to be added to queue self._not_empty.acquire() while len(self._queue) == 0 and not self._closed:...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py
46
75
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,468
remove
def remove(self, predicate): """Remove and return the first items for which predicate is True, ignoring delay.""" try: self._lock.acquire() for i, (elem, t) in enumerate(self._queue): if predicate(elem): del self._queue[i] ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py
77
88
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,469
get_platform_name
def get_platform_name(): if sys.platform.startswith("win"): return PLATFORM_WINDOWS elif sys.platform.startswith('darwin'): return PLATFORM_DARWIN elif sys.platform.startswith('linux'): return PLATFORM_LINUX elif sys.platform.startswith(('dragonfly', 'freebsd', 'netbsd', 'openbsd...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py
29
39
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,470
is_linux
def is_linux(): return __platform__ == PLATFORM_LINUX
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py
44
45
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,471
is_bsd
def is_bsd(): return __platform__ == PLATFORM_BSD
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py
48
49
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,472
is_darwin
def is_darwin(): return __platform__ == PLATFORM_DARWIN
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py
52
53
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,473
is_windows
def is_windows(): return __platform__ == PLATFORM_WINDOWS
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py
56
57
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,474
import_module
def import_module(target, relative_to=None): target_parts = target.split('.') target_depth = target_parts.count('') target_path = target_parts[target_depth:] target = target[target_depth:] fromlist = [target] if target_depth and relative_to: relative_parts = relative_to.split('.') ...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/importlib2.py
24
40
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,475
_init
def _init(self, maxsize): queue.Queue._init(self, maxsize) self._last_item = None
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
86
88
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,476
_put
def _put(self, item): if item != self._last_item: queue.Queue._put(self, item) self._last_item = item else: # `put` increments `unfinished_tasks` even if we did not put # anything into the queue here self.unfinished_tasks -= 1
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
90
97
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,477
_get
def _get(self): item = queue.Queue._get(self) if item is self._last_item: self._last_item = None return item
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
99
103
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,478
_init
def _init(self, maxsize): queue.Queue._init(self, maxsize) self._set_of_items = set()
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
153
155
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,479
_put
def _put(self, item): if item not in self._set_of_items: queue.Queue._put(self, item) self._set_of_items.add(item) else: # `put` increments `unfinished_tasks` even if we did not put # anything into the queue here self.unfinished_tasks -= 1
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
157
164
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,480
_get
def _get(self): item = queue.Queue._get(self) self._set_of_items.remove(item) return item
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
166
169
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,481
__init__
def __init__(self, iterable=None): self.end = end = [] end += [None, end, end] # sentinel node for doubly linked list self.map = {} # key --> [key, prev, next] if iterable is not None: self |= iterable
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
192
197
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,482
__len__
def __len__(self): return len(self.map)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
199
200
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,483
__contains__
def __contains__(self, key): return key in self.map
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
202
203
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,484
add
def add(self, key): if key not in self.map: end = self.end curr = end[PREV] curr[NEXT] = end[PREV] = self.map[key] = [key, curr, end]
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
205
209
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,485
discard
def discard(self, key): if key in self.map: key, prev, _next = self.map.pop(key) prev[NEXT] = _next _next[PREV] = prev
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
211
215
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,486
__iter__
def __iter__(self): end = self.end curr = end[NEXT] while curr is not end: yield curr[KEY] curr = curr[NEXT]
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
217
222
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,487
__reversed__
def __reversed__(self): end = self.end curr = end[PREV] while curr is not end: yield curr[KEY] curr = curr[PREV]
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
224
229
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,488
pop
def pop(self, last=True): if not self: raise KeyError('set is empty') key = next(reversed(self)) if last else next(iter(self)) self.discard(key) return key
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
231
236
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,489
__repr__
def __repr__(self): if not self: return '%s()' % (self.__class__.__name__,) return '%s(%r)' % (self.__class__.__name__, list(self))
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
238
241
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,490
__eq__
def __eq__(self, other): if isinstance(other, OrderedSet): return len(self) == len(other) and list(self) == list(other) return set(self) == set(other)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
243
246
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,491
__del__
def __del__(self): self.clear() # remove circular references
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
248
249
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,492
name
def name(item): " Return an item's name. " return item.__name__
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
39
41
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,493
is_classmethod
def is_classmethod(instancemethod, klass): " Determine if an instancemethod is a classmethod. " return inspect.ismethod(instancemethod) and instancemethod.__self__ is klass
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
44
46
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,494
is_static_method
def is_static_method(method, klass): """Returns True if method is an instance method of klass.""" for c in klass.mro(): if name(method) in c.__dict__: return isinstance(c.__dict__[name(method)], staticmethod) else: return False
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
48
54
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,495
is_class_private_name
def is_class_private_name(name): " Determine if a name is a class private name. " # Exclude system defined names such as __init__, __add__ etc return name.startswith("__") and not name.endswith("__")
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
56
59
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,496
method_name
def method_name(method): """ Return a method's name. This function returns the name the method is accessed by from outside the class (i.e. it prefixes "private" methods appropriately). """ mname = name(method) if is_class_private_name(mname): mname = "_%s%s" % (name(method.__self__.__cl...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
62
71
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,497
format_arg_value
def format_arg_value(arg_val): """ Return a string representing a (name, value) pair. >>> format_arg_value(('x', (1, 2, 3))) 'x=(1, 2, 3)' """ arg, val = arg_val return "%s=%r" % (arg, val)
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
74
81
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,498
echo
def echo(fn, write=sys.stdout.write): """ Echo calls to a function. Returns a decorated version of the input function which "echoes" calls made to it by writing out the function's name and the arguments it was called with. """ import functools # Unpack function's arg count, arg names, arg d...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
84
112
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,499
wrapped
def wrapped(*v, **k): # Collect function arguments by chaining together positional, # defaulted, extra positional and keyword arguments. positional = list(map(format_arg_value, list(zip(argnames, v)))) defaulted = [format_arg_value((a, argdefs[a])) for a in argnames[...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
100
110
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
6,500
echo_instancemethod
def echo_instancemethod(klass, method, write=sys.stdout.write): """ Change an instancemethod so that calls to it are echoed. Replacing a classmethod is a little more tricky. See: http://www.python.org/doc/current/ref/types.html """ mname = method_name(method) never_echo = "__str__", "__repr__",...
python
wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
115
128
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }