repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
Stimela | Stimela-master/stimela/cargo/cab/tigger_tag/src/run.py | import os
import sys
import glob
import subprocess
import yaml
import shutil
import shlex
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
params = {}
for param in cab... | 1,657 | 23.746269 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_fluxscale/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
import os
print(f"Running CASA task '{config.binary}'")
save_result = parameters_dict.pop("save_result", None)
overwrite = parameters_dict.pop("overwrite", False)
fluxtable = parameters_dict['fluxtable']
if ... | 461 | 27.875 | 80 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_oldsplit/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_listobs/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa47_polcal/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
from casacore.tables import table
import numpy
import glob
import yaml
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_l... | 1,666 | 24.257576 | 159 | py |
Stimela | Stimela-master/stimela/cargo/cab/rmsynth3d/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=True,
positional=["fit... | 438 | 30.357143 | 120 | py |
Stimela | Stimela-master/stimela/cargo/cab/tricolour/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=None,
positional=["ms"... | 471 | 30.466667 | 78 | py |
Stimela | Stimela-master/stimela/cargo/cab/sharpener/src/run.py | import os
import sys
import yaml
import sharpener
import glob
import shlex
import subprocess
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
m... | 2,072 | 27.39726 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/tigger_restore/src/run.py | import os
import sys
import subprocess
import glob
import yaml
import shlex
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab['... | 1,455 | 21.4 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/sunblocker/src/run.py | import sys
import os
from sunblocker.sunblocker import Sunblocker
import inspect
import yaml
import subprocess
import glob
import shlex
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_... | 1,284 | 22.363636 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/ddfacet/src/run.py | import sys
import os
import astropy.io.fits as pyfits
import glob
import subprocess
import shutil
import shlex
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["ju... | 2,478 | 28.164706 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/cleanmask/src/run.py | import os
import sys
import shlex
import shutil
import yaml
import glob
import subprocess
OUTPUT = os.environ["OUTPUT"]
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
... | 1,101 | 22.956522 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/eidos/src/run.py | import os
import sys
import shutil
import subprocess
import shlex
import yaml
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
msname = None
for ... | 1,082 | 21.5625 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/curl/src/run.py | import os
import sys
import shutil
import shlex
import glob
import subprocess
import yaml
CONFIG = os.environ["CONFIG"]
OUTPUT = os.environ["OUTPUT"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
url = None
for pa... | 1,042 | 21.673913 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/ragavi/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
args = [config.binary] + parse_parameters(repeat=" ")
# run the command
if prun(args) != 0:
sys.exit(1)
| 207 | 16.333333 | 53 | py |
Stimela | Stimela-master/stimela/cargo/cab/chgcentre/src/run.py | import os
import sys
import glob
import yaml
import shutil
import shlex
import subprocess
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab[... | 1,088 | 21.6875 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/wsclean/src/run.py | import os
import sys
import re
import yaml
import subprocess
import shlex
import glob
import shutil
CONFIG = os.environ['CONFIG']
INPUT = os.environ['INPUT']
OUTPUT = os.environ['OUTPUT']
MSDIR = os.environ['MSDIR']
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
params = cab['parameters']
junk = cab[... | 2,324 | 28.0625 | 160 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_plotants/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_setjy/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_virtualconcat/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_clearcal/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_script/src/run.py | import os
import sys
import yaml
import shlex
import shutil
import subprocess
import glob
CONFIG = os.environ["CONFIG"]
OUTPUT = os.environ["OUTPUT"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
msname = None
cu... | 1,266 | 22.036364 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/pyddi/src/run.py | import os
import sys
import subprocess
import yaml
import glob
import shutil
import shlex
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab[... | 1,025 | 21.8 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/halo-fdca/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import yaml
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab[... | 1,022 | 22.25 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/fitstool/src/run.py | import os
import sys
import shutil
import shlex
import subprocess
import shutil
import glob
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
inim... | 2,017 | 21.674157 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_imregrid/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_fixvis/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/flagstats/src/run.py | import sys
import os
from MSUtils import flag_stats
import inspect
import glob
import shutil
import yaml
import codecs
import json
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = ... | 1,176 | 23.020408 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/pycasacore/src/run.py | import os
import sys
import tempfile
import shlex
import shutil
import yaml
import glob
import subprocess
CONFIG = os.environ["CONFIG"]
OUTPUT = os.environ["OUTPUT"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
m... | 1,159 | 22.673469 | 95 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_flagdata/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_ft/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_concat/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_statwt/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_polcal/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
save_result = parameters_dict.pop("save_result", None)
task = crasa.CasaTask(config.binary, save_result=save_result, **parameters_dict)
task.run()
| 307 | 27 | 80 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_polcal/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
from pyrap.tables import table
import os
import numpy
print(f"Running CASA task '{config.binary}'")
save_result = parameters_dict.pop("save_result", None)
task = crasa.CasaTask(config.binary, save_result=sa... | 1,062 | 28.527778 | 150 | py |
Stimela | Stimela-master/stimela/cargo/cab/equolver/src/run.py | #config -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
args = [config.binary] + parse_parameters(repeat=" ")
for i in range(len(args)):
if args[i] == '--verb':
val = args.pop(i+1)
if val == 'False':
args.pop(i)
# run the command
if... | 355 | 19.941176 | 53 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_rmtables/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_gaincal/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
from pyrap.tables import table
import os
import numpy
print(f"Running CASA task '{config.binary}'")
save_result = parameters_dict.pop("save_result", None)
task = crasa.CasaTask(config.binary, save_result=sa... | 1,062 | 28.527778 | 150 | py |
Stimela | Stimela-master/stimela/cargo/cab/sofia2/src/run.py | import os
import sys
import Tigger
import numpy
import tempfile
import json
import codecs
import shlex
import shutil
import glob
import subprocess
from astLib.astWCS import WCS
from astropy.io.votable import parse_single_table
from Tigger.Models import SkyModel, ModelClasses
CONFIG = os.environ["CONFIG"]
INPUT = os.... | 3,932 | 24.705882 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa47_setjy/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/montage/src/run.py | import os
import sys
import subprocess
import shlex
import shutil
import glob
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for param in cab['p... | 1,844 | 29.75 | 97 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa47_gaincal/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
from casacore.tables import table
import numpy
import glob
import yaml
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_l... | 1,666 | 24.257576 | 159 | py |
Stimela | Stimela-master/stimela/cargo/cab/cubical_pgs/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parameters_dict, prun, parse_parameters
"""
config:
contains the sections before parameters in params.json
.binary has the name of the binary to be executed
parameters_dict: dict
contains all the provided parameters, even the position... | 688 | 26.56 | 74 | py |
Stimela | Stimela-master/stimela/cargo/cab/pybdsm/src/run.py | import os
import sys
import re
import bdsf as bdsm # bdsm it is and bdsm it shall remain
import numpy
import Tigger
import tempfile
import astropy.io.fits as pyfits
import yaml
import shlex
import shutil
import glob
import subprocess
from astLib.astWCS import WCS
from Tigger.Models import SkyModel, ModelClasses
CONF... | 6,220 | 30.419192 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_fringefit/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/breizorro/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import yaml
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab[... | 1,252 | 24.571429 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/politsiyakat_autocorr_amp/src/run.py | import sys
import os
import json
import yaml
import subprocess
import shlex
import shutil
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
tasksu... | 1,053 | 20.510204 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_clean/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
from pyrap.tables import table
import os
import sys
import numpy
import astropy.io.fits as pyfits
args = parameters_dict
print(f"Running CASA task '{config.binary}'")
noise_image = args.pop('noise_image', F... | 2,154 | 29.352113 | 134 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_uvsub/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa47_applycal/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_split/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/simms/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=True,
positional=["ant... | 416 | 28.785714 | 98 | py |
Stimela | Stimela-master/stimela/cargo/cab/shadems_direct/src/run.py | # -*- coding: future_fstrings -*-
import sys, os, os.path
from scabha import log, config, parameters, prun_multi, OUTPUT
ms = os.path.abspath(parameters.ms)
os.chdir(OUTPUT)
errors = prun_multi([f"{config.binary} {ms} {args}" for args in parameters.args])
for cmd, exc in errors:
log.error(f"{cmd}: failed with r... | 418 | 25.1875 | 81 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_bandpass/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
from pyrap.tables import table
import os
import numpy
print(f"Running CASA task '{config.binary}'")
save_result = parameters_dict.pop("save_result", None)
task = crasa.CasaTask(config.binary, save_result=sa... | 1,399 | 30.111111 | 154 | py |
Stimela | Stimela-master/stimela/cargo/cab/mvftoms/src/run.py | import os
import sys
import glob
import subprocess
import shutil
import shlex
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTDIR = os.environ["OUTPUT"]
HOME = os.environ["HOME"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
ar... | 1,506 | 22.920635 | 91 | py |
SeeChart | SeeChart-main/gold_summary_update.py | import json
for i in range(87, 1062):
if i != 611 and i != 818 and i != 795 and i != 791:
print(str(i))
fileName = str(i)
f = open('static/generated/' + fileName + '.json')
found_data = json.load(f)
if "gold" in found_data:
found_data['gold'] = found_data['g... | 693 | 23.785714 | 74 | py |
SeeChart | SeeChart-main/test.py | import csv
csv_file = csv.reader(open('recorded_data.csv', 'r'), delimiter=',')
url = "https://www.statista.com/statistics/755069/pubg-player-share/"
for row in csv_file:
if url == row[3]:
print(row[4])
| 218 | 20.9 | 69 | py |
SeeChart | SeeChart-main/utility.py | import csv
import os
import shutil
from datetime import datetime
import random
import string
import base64
# from PIL import Image
from io import BytesIO
import json
import requests
import io
from BaselineSummarizer import summarize
url_name = ""
def make_directory(name):
if os.path.exists(name):
print("... | 20,592 | 36.306159 | 146 | py |
SeeChart | SeeChart-main/app.py | from datetime import datetime
import json
import csv
import os
from os import listdir
from os.path import isfile, join
import ssl
from flask_jsglue import JSGlue # pip install Flask-JSGlue -> http://stewartpark.github.io/Flask-JSGlue/
import math
from qna import askMe
from flask import (
Flask,
g,
redire... | 54,982 | 34.726446 | 116 | py |
SeeChart | SeeChart-main/qna.py | # !pip install transformers
# !pip install datasets
# !pip install nltk
import json
import math
import os
import sys
import nltk # Here to have a nice missing dependency error message early on
import transformers
from filelock import FileLock
from transformers import (
AutoConfig,
AutoModelForSeq2SeqLM,
... | 5,738 | 30.707182 | 393 | py |
SeeChart | SeeChart-main/tasks.py | import json
import datetime
import os.path
class Tasks(object):
data = {
'last_updated': None,
'pid': None,
'logged_in': None
}
fileName: str
def __init__(self, pid):
self.pid = pid
self.fileName = 'data_' + pid
if os.path.isfile('static/task/' + self... | 3,849 | 27.947368 | 85 | py |
SeeChart | SeeChart-main/BaselineSummarizer.py | import \
json # Serialization: process of encoding data into JSON format (like converting a Python list to JSON). Deserialization: process of decoding JSON data back into native objects you can work with (like reading JSON data into a Python list)
import math # To use mathematical functions
import \
re # Re... | 149,901 | 51.875485 | 2,291 | py |
SeeChart | SeeChart-main/users.py | import csv
class User:
def __init__(self, id, username, password):
self.id = id
self.username = username
self.password = password
def __repr__(self):
return f'<User: {self.username}>'
users = []
with open('static/users/users.csv', mode='r') as csv_file:
csv_reader = cs... | 483 | 20.043478 | 112 | py |
lama-cleaner | lama-cleaner-main/main.py | from lama_cleaner import entry_point
if __name__ == "__main__":
entry_point()
| 83 | 15.8 | 36 | py |
lama-cleaner | lama-cleaner-main/setup.py | import setuptools
from pathlib import Path
web_files = Path("lama_cleaner/app/build/").glob("**/*")
web_files = [str(it).replace("lama_cleaner/", "") for it in web_files]
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
def load_requirements():
requirements_file_name = "requ... | 1,616 | 33.404255 | 82 | py |
lama-cleaner | lama-cleaner-main/scripts/tool.py | import glob
import os
from typing import Dict, List, Union
import torch
from diffusers.utils import is_safetensors_available
if is_safetensors_available():
import safetensors.torch
from huggingface_hub import snapshot_download
from diffusers import DiffusionPipeline, __version__
from diffusers.schedulers.sche... | 14,778 | 39.825967 | 171 | py |
lama-cleaner | lama-cleaner-main/scripts/convert_vae_pt_to_diffusers.py | import argparse
import io
import requests
import torch
from omegaconf import OmegaConf
from diffusers import AutoencoderKL
from diffusers.pipelines.stable_diffusion.convert_from_ckpt import (
assign_to_checkpoint,
conv_attn_to_linear,
create_vae_diffusers_config,
renew_vae_attention_paths,
renew_v... | 7,961 | 33.318966 | 117 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/model_manager.py | import torch
import gc
from loguru import logger
from lama_cleaner.const import SD15_MODELS
from lama_cleaner.helper import switch_mps_device
from lama_cleaner.model.controlnet import ControlNet
from lama_cleaner.model.fcf import FcF
from lama_cleaner.model.lama import LaMa
from lama_cleaner.model.ldm import LDM
from... | 4,073 | 34.12069 | 86 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/const.py | import json
import os
from enum import Enum
from pydantic import BaseModel
MPS_SUPPORT_MODELS = [
"instruct_pix2pix",
"sd1.5",
"anything4",
"realisticVision1.4",
"sd2",
"paint_by_example",
"controlnet",
]
DEFAULT_MODEL = "lama"
AVAILABLE_MODELS = [
"lama",
"ldm",
"zits",
"... | 5,145 | 28.574713 | 148 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/benchmark.py | #!/usr/bin/env python3
import argparse
import os
import time
import numpy as np
import nvidia_smi
import psutil
import torch
from lama_cleaner.model_manager import ModelManager
from lama_cleaner.schema import Config, HDStrategy, SDSampler
try:
torch._C._jit_override_can_fuse_on_cpu(False)
torch._C._jit_over... | 3,215 | 28.236364 | 100 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/server.py | #!/usr/bin/env python3
import os
import hashlib
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
import imghdr
import io
import logging
import multiprocessing
import random
import time
from pathlib import Path
import cv2
import numpy as np
import torch
from PIL import Image
from loguru import logger
from lama_cleane... | 18,878 | 29.303371 | 109 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/helper.py | import io
import os
import sys
from typing import List, Optional
from urllib.parse import urlparse
import cv2
from PIL import Image, ImageOps, PngImagePlugin
import numpy as np
import torch
from lama_cleaner.const import MPS_SUPPORT_MODELS
from loguru import logger
from torch.hub import download_url_to_file, get_dir
i... | 8,639 | 28.488055 | 165 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/runtime.py | # https://github.com/huggingface/huggingface_hub/blob/5a12851f54bf614be39614034ed3a9031922d297/src/huggingface_hub/utils/_runtime.py
import platform
import sys
import packaging.version
from rich import print
from typing import Dict, Any
_PY_VERSION: str = sys.version.split()[0].rstrip("+")
if packaging.version.Versio... | 1,374 | 25.960784 | 132 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/web_config.py | import json
import os
from datetime import datetime
import gradio as gr
from loguru import logger
from lama_cleaner.const import *
_config_file = None
def save_config(
host,
port,
model,
sd_local_model_path,
sd_controlnet,
sd_controlnet_method,
device,
gui,
no_gui_auto_close,
... | 8,530 | 33.538462 | 88 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/__init__.py | import os
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
import warnings
warnings.simplefilter("ignore", UserWarning)
from lama_cleaner.parse_args import parse_args
def entry_point():
args = parse_args()
# To make os.environ["XDG_CACHE_HOME"] = args.model_cache_dir works for diffusers
# https://githu... | 488 | 24.736842 | 129 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/installer.py | import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
def install_plugins_package():
install("rembg")
install("realesrgan")
install("gfpgan")
| 232 | 16.923077 | 76 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/parse_args.py | import os
import imghdr
import argparse
from pathlib import Path
from loguru import logger
from lama_cleaner.const import *
from lama_cleaner.runtime import dump_environment_info
def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.a... | 8,695 | 32.836576 | 116 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/schema.py | from typing import Optional
from enum import Enum
from PIL.Image import Image
from pydantic import BaseModel
class HDStrategy(str, Enum):
# Use original image size
ORIGINAL = "Original"
# Resize the longer side of the image to a specific size(hd_strategy_resize_limit),
# then do inpainting on the res... | 3,399 | 32.333333 | 154 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/file_manager/utils.py | # Copy from: https://github.com/silentsokolov/flask-thumbnails/blob/master/flask_thumbnails/utils.py
import importlib
import os
from pathlib import Path
from typing import Union
def generate_filename(original_filename, *options):
name, ext = os.path.splitext(original_filename)
for v in options:
if v:... | 1,758 | 24.867647 | 100 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/file_manager/storage_backends.py | # Copy from https://github.com/silentsokolov/flask-thumbnails/blob/master/flask_thumbnails/storage_backends.py
import errno
import os
from abc import ABC, abstractmethod
class BaseStorageBackend(ABC):
def __init__(self, app=None):
self.app = app
@abstractmethod
def read(self, filepath, mode="rb",... | 1,293 | 26.531915 | 110 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/file_manager/__init__.py | from .file_manager import FileManager
| 38 | 18.5 | 37 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/file_manager/file_manager.py | # Copy from https://github.com/silentsokolov/flask-thumbnails/blob/master/flask_thumbnails/thumbnail.py
import os
from datetime import datetime
import cv2
import time
from io import BytesIO
from pathlib import Path
import numpy as np
# from watchdog.events import FileSystemEventHandler
# from watchdog.observers import... | 8,685 | 31.654135 | 103 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/realesrgan.py | from enum import Enum
import cv2
from loguru import logger
from lama_cleaner.const import RealESRGANModelName
from lama_cleaner.helper import download_model
from lama_cleaner.plugins.base_plugin import BasePlugin
class RealESRGANUpscaler(BasePlugin):
name = "RealESRGAN"
def __init__(self, name, device, no_... | 3,567 | 35.783505 | 122 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/interactive_seg.py | import json
import cv2
import numpy as np
from loguru import logger
from lama_cleaner.helper import download_model
from lama_cleaner.plugins.base_plugin import BasePlugin
from lama_cleaner.plugins.segment_anything import SamPredictor, sam_model_registry
# 从小到大
SEGMENT_ANYTHING_MODELS = {
"vit_b": {
"url"... | 2,547 | 32.526316 | 86 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/base_plugin.py | from loguru import logger
class BasePlugin:
def __init__(self):
err_msg = self.check_dep()
if err_msg:
logger.error(err_msg)
exit(-1)
def __call__(self, rgb_np_img, files, form):
...
def check_dep(self):
...
| 280 | 16.5625 | 48 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/gfpgan_plugin.py | import cv2
from loguru import logger
from lama_cleaner.helper import download_model
from lama_cleaner.plugins.base_plugin import BasePlugin
class GFPGANPlugin(BasePlugin):
name = "GFPGAN"
def __init__(self, device, upscaler=None):
super().__init__()
from .gfpganer import MyGFPGANer
... | 2,400 | 32.347222 | 92 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/gfpganer.py | import os
import torch
from facexlib.utils.face_restoration_helper import FaceRestoreHelper
from gfpgan import GFPGANv1Clean, GFPGANer
from torch.hub import get_dir
class MyGFPGANer(GFPGANer):
"""Helper for restoration with GFPGAN.
It will detect and crop faces, and then resize the faces to 512x512.
GFP... | 2,750 | 31.364706 | 110 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/gif.py | import io
import math
from PIL import Image, ImageDraw
from lama_cleaner.helper import load_img
from lama_cleaner.plugins.base_plugin import BasePlugin
def keep_ratio_resize(img, size, resample=Image.BILINEAR):
if img.width > img.height:
w = size
h = int(img.height * size / img.width)
else:
... | 4,156 | 26.713333 | 88 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/__init__.py | from .interactive_seg import InteractiveSeg
from .remove_bg import RemoveBG
from .realesrgan import RealESRGANUpscaler
from .gfpgan_plugin import GFPGANPlugin
from .restoreformer import RestoreFormerPlugin
from .gif import MakeGIF
from .anime_seg import AnimeSeg
| 263 | 32 | 46 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/anime_seg.py | import cv2
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from PIL import Image
from lama_cleaner.helper import load_model
from lama_cleaner.plugins.base_plugin import BasePlugin
class REBNCONV(nn.Module):
def __init__(self, in_ch=3, out_ch=3, dirate=1, stride=1):
s... | 13,465 | 28.530702 | 86 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/restoreformer.py | import cv2
from loguru import logger
from lama_cleaner.helper import download_model
from lama_cleaner.plugins.base_plugin import BasePlugin
class RestoreFormerPlugin(BasePlugin):
name = "RestoreFormer"
def __init__(self, device, upscaler=None):
super().__init__()
from .gfpganer import MyGFPG... | 1,747 | 30.781818 | 95 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/remove_bg.py | import os
import cv2
import numpy as np
from torch.hub import get_dir
from lama_cleaner.plugins.base_plugin import BasePlugin
class RemoveBG(BasePlugin):
name = "RemoveBG"
def __init__(self):
super().__init__()
from rembg import new_session
hub_dir = get_dir()
model_dir = os... | 1,053 | 25.35 | 87 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/predictor.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from .modeling import Sam
from typing import Optional, Tuple
class SamPredictor:
d... | 11,845 | 40.41958 | 100 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/build_sam.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
from functools import partial
from .modeling import ImageEncoderViT, MaskDecoder, PromptEncoder, Sam, TwoWa... | 2,929 | 26.12963 | 89 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/__init__.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from .build_sam import (
build_sam,
build_sam_vit_h,
build_sam_vit_l,
build_sam_vit_b,
sam_model_regis... | 363 | 23.266667 | 61 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/utils/__init__.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
| 197 | 32 | 61 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/utils/transforms.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from torch.nn import functional as F
from torchvision.transforms.functional import resize,... | 4,054 | 34.884956 | 84 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/modeling/mask_decoder.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
from torch import nn
from torch.nn import functional as F
from typing import List, Tuple, Type
from .common... | 6,614 | 36.372881 | 123 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/modeling/image_encoder.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional, Tuple, Type
from .common... | 14,407 | 35.383838 | 202 | py |
lama-cleaner | lama-cleaner-main/lama_cleaner/plugins/segment_anything/modeling/prompt_encoder.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from torch import nn
from typing import Any, Optional, Tuple, Type
from .common import L... | 8,594 | 38.976744 | 97 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.