Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pranjal_dhole
Flatland
Commits
cb4020ef
Commit
cb4020ef
authored
5 years ago
by
u214892
Browse files
Options
Downloads
Patches
Plain Diff
#163 random guesses
parent
eaaa06ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/run_all_examples.py
+23
-23
23 additions, 23 deletions
benchmarks/run_all_examples.py
with
23 additions
and
23 deletions
benchmarks/run_all_examples.py
+
23
−
23
View file @
cb4020ef
import
runpy
#
import sys
#
from io import StringIO
#
#
import importlib_resources
#
import pkg_resources
#
from importlib_resources import path
#
#
from benchmarks.benchmark_utils import swap_attr
import
sys
from
io
import
StringIO
import
importlib_resources
import
pkg_resources
from
importlib_resources
import
path
from
benchmarks.benchmark_utils
import
swap_attr
print
(
"
GRRRRRRRR run_all_examples.py
"
)
#
for entry in [entry for entry in importlib_resources.contents('examples') if
#
not pkg_resources.resource_isdir('examples', entry)
#
and entry.endswith(".py")
#
and '__init__' not in entry
#
and 'demo.py' not in entry
#
and 'DELETE' not in entry
#
]:
#
with path('examples', entry) as file_in:
#
print("")
#
print("")
#
#
print("")
#
print("*****************************************************************")
#
print("Running {}".format(entry))
#
print("*****************************************************************")
for
entry
in
[
entry
for
entry
in
importlib_resources
.
contents
(
'
examples
'
)
if
not
pkg_resources
.
resource_isdir
(
'
examples
'
,
entry
)
and
entry
.
endswith
(
"
.py
"
)
and
'
__init__
'
not
in
entry
and
'
demo.py
'
not
in
entry
and
'
DELETE
'
not
in
entry
]:
with
path
(
'
examples
'
,
entry
)
as
file_in
:
print
(
""
)
print
(
""
)
print
(
""
)
print
(
"
*****************************************************************
"
)
print
(
"
Running {}
"
.
format
(
entry
))
print
(
"
*****************************************************************
"
)
# with swap_attr(sys, "stdin", StringIO("q")):
# try:
# runpy.run_path(file_in, run_name="__main__", init_globals={
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment