100+ results for 'glob.glob lang:python'

Not the results you expected?

octopress.py (https://bitbucket.org/gyk001/st2cfg.git) Python · 189 lines

176 self.page_extension = octo_set.get("octopress_page_extension")

177

178 files = glob.glob(self.octopress_path + "/source/*/index." + self.page_extension);

179 files.reverse()

180 self.quick_panel_items = []

base.py (https://gitlab.com/pooja043/Globus_Docker_2) Python · 164 lines

128 files_path = self._get_files_path()

129 for pattern in copy_filenames:

130 for match in glob.glob(os.path.join(files_path, pattern)):

131 shutil.copyfile(match, os.path.join(dest, os.path.basename(match)))

132

test_import_tools.py (https://github.com/SEL-Columbia/formhub.git) Python · 79 lines

16

17 def images_count(username="bob"):

18 images = glob.glob(

19 os.path.join(settings.MEDIA_ROOT, username, 'attachments', '*'))

20 return len(images)

34 Instance.objects.all().delete() # ?

35 if settings.TESTING_MODE:

36 images = glob.glob(

37 os.path.join(

38 settings.MEDIA_ROOT, self.user.username, 'attachments', '*'))

gconfsettings.py (https://bitbucket.org/cfield/ubuntu-tweak.git) Python · 159 lines

35 def load_override(self):

36 try:

37 for override in glob.glob('/usr/share/gconf/defaults/*'):

38 for line in open(override):

39 splits = line.split()

whole_surface_avgs.py (https://gitlab.com/Cadair/driver-widths-paper) Python · 82 lines

38

39 def glob_files(tube_r, search):

40 files = glob.glob(os.path.join(cfg.data_dir,tube_r,search))

41 files.sort()

42 return files

work-around-vs-dependency-tracking-bugs.py (https://bitbucket.org/zenoalbisser/webkit.git) Python · 66 lines

46

47 def mtime_of_newest_file_matching_glob(glob_pattern):

48 files = glob.glob(glob_pattern)

49 assert len(files), "Couldn't find any files matching glob %s" % glob_pattern

50 return max(map(os.path.getmtime, files))

models.py (https://bitbucket.org/rukku/webandgis.git) Python · 76 lines

60 # if it has a .shp file, it is vector :)

61 os.chdir(zip_out)

62 shapefiles = glob.glob('*.shp')

63

64 if len(shapefiles) > 0:

filebased.py (https://gitlab.com/benji-bou/urotechchallenge-Serenity) Python · 153 lines

150 return []

151 filelist = [os.path.join(self._dir, fname) for fname

152 in glob.glob1(self._dir, '*%s' % self.cache_suffix)]

153 return filelist

154

develop.py (https://github.com/jsgf/tahoe-lafs.git) Python · 165 lines

51 easy_install.finalize_options(self)

52 # pick up setup-dir .egg files only: no .egg-info

53 self.package_index.scan(glob.glob('*.egg'))

54

55 self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link')

show-tool-versions.py (https://github.com/jsgf/tahoe-lafs.git) Python · 162 lines

9 except ImportError:

10 import glob

11 eggz = glob.glob('setuptools-*.egg')

12 if len(eggz) > 0:

13 egg = os.path.realpath(eggz[0])

histogram_analysis.py (https://bitbucket.org/wschurman/colorapp-analysis.git) Python · 97 lines

17 os.chdir(self.image_dir)

18

19 for infile in glob.glob("*.jpg"):

20 yield (infile, Image.open(infile))

21

mktraj.py (https://gitlab.com/exaalt/parsplice) Python · 106 lines

61 while j<len(cl[itraj]):

62 c=cl[itraj][j]

63 filei=glob.glob(run+"/"+"state-%i.out" % c)

64 #print filei

65 if len(filei)>0:

93 #print c

94

95 filei=glob.glob(run+"/"+"state-%i.out" % c)

96 #print filei

97 if len(filei)>0:

endovis_instrument_2015.py (https://github.com/warmspringwinds/pytorch-segmentation-detection.git) Python · 225 lines

75 # we apply a regex here to filter annotations out from

76 # anything else

77 saved_annotations = glob.glob( os.path.join(saved_annotations_path, ('[0-9]' * 8) + '.png') )

78

79 self.dataset_size = len(saved_annotations)

handlers.py (https://github.com/jenshnielsen/ipython.git) Python · 86 lines

30 resource

31 )

32 for logo_file in glob.glob(pjoin(resource_dir, 'logo-*')):

33 fname = os.path.basename(logo_file)

34 no_ext, _ = os.path.splitext(fname)

__init__.py (https://github.com/oppian/oppian.git) Python · 86 lines

52

53 # currently only get PNG and JPEG files

54 filenames = glob.glob("*.png") + glob.glob("*.jpg")

55 for filename in filenames:

56 create_photo('images/', filename, verbosity)

createarrayinfo.py (https://github.com/gatoatigrado/pyplusplusclone.git) Python · 169 lines

164 print >>sys.stderr, "Preprocessor args: %s"%cppargs

165

166 headers = glob.glob(headernames)

167 print >>sys.stderr, "%d header files found"%len(headers)

168 for header in headers:

avatar-test.py (https://github.com/heca/rextest2.git) Python · 167 lines

140 def movePcapFiles():

141 print "moving pcap files..."

142 pcap = glob.glob(wiresTempDir + '/captured*.*.pcap')

143 for i in range(0,len(pcap)):

144 shutil.move(pcap[i], avatarLogs)

_fortran.py (https://github.com/mantidproject/3rdpartylibs-mac.git) Python · 154 lines

143

144 exclude_pattern = re.compile('_subr_[0-9]')

145 source_fnames = [f for f in glob.glob(os.path.join(source_dir, '*.f'))

146 if not exclude_pattern.search(os.path.basename(f))]

147 fnames = []

loaddata.py (https://bitbucket.org/smichal88/tag-highlight-git-repo-mirror.git) Python · 143 lines

136

137 def GlobData(matcher):

138 files = glob.glob(os.path.join(data_directory, matcher))

139 return [os.path.relpath(i,data_directory) for i in files]

140

git.py (https://github.com/mitnk/dotfiles.git) Python · 228 lines

62 output = output.replace("'", '').strip()

63 p = os.path.join(output, 'git-*')

64 cmd_list = glob.glob(p)

65 cmd_list = [re.sub(r'.*/git-', '', x) for x in cmd_list]

66 _CACHE_GIT_['command_list'] = cmd_list

summary_writer_test.py (https://gitlab.com/wilane/tensorflow) Python · 151 lines

23

24 def _EventsReader(self, test_dir):

25 event_paths = glob.glob(os.path.join(test_dir, "event*"))

26 # If the tests runs multiple time in the same directory we can have

27 # more than one matching event file. We only want to read the last one.

xbb_blast.py (https://github.com/NYCiGEM/NYC_Software_2011.git) Python · 161 lines

27 pin, nin = [],[]

28 try:

29 pin.extend(glob.glob(os.environ['BLASTDB'] + '/*.pin'))

30 except:

31 pass

32 pin.extend(glob.glob('*.pin'))

33

34 try:

35 nin.extend(glob.glob(os.environ['BLASTDB'] + '/*.nin'))

36 except:

37 pass

anvio.py (https://github.com/nekrut/galaxy.git) Python · 165 lines

102 break

103 if basename is not None and not os.path.exists(os.path.join(dataset.extra_files_path, basename)):

104 for name in glob.glob(os.path.join(dataset.extra_files_path, f"*{basename}")):

105 dataset.metadata.anvio_basename = os.path.basename(name)

106 found = True

test_image.py (https://github.com/pytorch/vision.git) Python · 159 lines

63

64 # Truncated images should raise an exception

65 truncated_images = glob.glob(

66 os.path.join(DAMAGED_JPEG, 'corrupt*.jpg'))

67 for image_path in truncated_images:

check-git-repo-availability.py (https://gitlab.com/onitake/fdroiddata) Python · 74 lines

10 files = sys.argv[1:]

11 else:

12 files = sorted(glob.glob('metadata/*.yml'))

13

14 errors = dict()

tests.py (https://github.com/ask/puka.git) Python · 89 lines

30

31 def main_coverage(TESTS):

32 TEST_NAMES = [f.rpartition('.')[0] for f in glob.glob("test_*.py")]

33 TEST_NAMES.sort()

34

36 os.chdir(sys.argv[1])

37 BAD_MODULES=(sys.argv[3] if len(sys.argv) >= 4 else '').split(',')

38 MODULE_NAMES=[sys.argv[2] + '.' +f[0:-3] for f in glob.glob("*.py") if f not in BAD_MODULES]

39 MODULE_NAMES.sort()

40 os.chdir(pwd)

autoTracto2regions.py (https://github.com/LinjieChen/Slicer3.git) Python · 76 lines

34 fullDir = os.getcwd()

35

36 pars = glob.glob('*.in')

37 dwis = glob.glob('*.dwi')

38 rois = glob.glob('*.roi')

39 wmas = glob.glob('*.wm')

queue.py (https://github.com/noplay/scrapy.git) Python · 177 lines

122

123 def _cleanup(self):

124 for x in glob.glob(os.path.join(self.path, 'q*')):

125 os.remove(x)

126 os.remove(os.path.join(self.path, 'info.json'))

plot.py (https://bitbucket.org/6tisch/simulator.git) Python · 157 lines

50 for key in options.kpis:

51 # load data

52 for file_path in sorted(glob.glob(os.path.join(subfolder, '*.kpi'))):

53 curr_combination = os.path.basename(file_path)[:-8] # remove .dat.kpi

54 with open(file_path, 'r') as f:

example.py (https://gitlab.com/jonnialva90/iridium-browser) Python · 121 lines

115 ['/test/file1.txt', '/test/file2.txt']

116 '''

117 return glob.glob(glob_path)

118

119 def rm_tree(path):

xtr_cls_fic_lst.py (https://gitlab.com/liuxin429go/toolbox) Python · 143 lines

135 def main():

136 infos = {}

137 for f in glob.glob('*.tree.xml'):

138 readInfos(f, infos)

139 for i in infos: print(i)

recipe-576437.py (https://github.com/ActiveState/code.git) Python · 71 lines

40 drive = sys.path[0][0:2]

41 #here we list all the file on the shortcut directory

42 files = glob.glob(sys.path[0]+'/*')

43 # here we take one file path

44 path = glob.glob(sys.path[0])[0]

tasks.py (https://github.com/Suggsgested/lernanta.git) Python · 103 lines

99

100 # remove frame image files.

101 files = glob.glob(self.frame_prefix + '*')

102 for f in files:

103 os.unlink(f)

scan_server_dlls.py (https://github.com/akesling/chromium.git) Python · 141 lines

105 (x, src_folder) = os.path.split(dst)

106

107 for file in glob.glob(os.path.join(output_dir, option)):

108 if option.startswith(SERVERS_DIR):

109 (x, file_name) = os.path.split(file)

features_extractor.py (https://github.com/microsoft/SPTAG.git) Python · 169 lines

24 List of file paths

25 """

26 all_files = glob.glob(glob_pattern, recursive=recursive)

27 print('Found %s files using pattern: %s' % (len(all_files), glob_pattern))

28 return all_files

gen-build.py (https://github.com/tzuryby/mod_conference-admin.git) Python · 172 lines

165 files = [ ]

166 for pat in string.split(patterns):

167 files.extend(glob.glob(pat))

168 return files

169

misc.py (https://github.com/fabiomdiniz/Frey.git) Python · 114 lines

40 """Returns *.dll, *.so, *.dylib in given directory."""

41 files = []

42 files.extend(glob.glob(os.path.join(directory, '*.so')))

43 files.extend(glob.glob(os.path.join(directory, '*.dll')))

44 files.extend(glob.glob(os.path.join(directory, '*.dylib')))

45 return files

46

generate_overlays.py (git://github.com/alexanderhiam/PyBBIO.git) Python · 87 lines

41 def compileOverlays():

42 print "Compiling all overlays..."

43 overlays = glob.glob('%s/*.dts' % dts_path)

44 for overlay in overlays:

45 name = os.path.splitext(os.path.basename(overlay))[0]

inotifyexec.py (https://bitbucket.org/mikebentley15/configurations.git) Python · 130 lines

34 '''Used in a for statement like so

35

36 files = glob.glob('*.cpp')

37 for file, types in inotifywait(['--monitor'] + files):

38 # do something

googlenet_tinyyolov3.py (https://github.com/Xilinx/Vitis-AI.git) Python · 98 lines

42 images[g] = list()

43 for ext in fileExtension:

44 images[g].extend(glob.glob(imageDirectory[g] + '/' + ext))

45 nImages = nImages + len(images[g])

46

conftest.py (https://github.com/micasense/imageprocessing.git) Python · 190 lines

45 @pytest.fixture()

46 def panel_rededge_file_list(files_dir):

47 return sorted(glob.glob(os.path.join(files_dir, 'IMG_0000_*.tif')))

48

49 @pytest.fixture()

50 def non_panel_rededge_file_list(files_dir):

51 return sorted(glob.glob(os.path.join(files_dir, 'IMG_0001_*.tif')))

52

53 @pytest.fixture()

59 @pytest.fixture()

60 def panel_altum_file_list(altum_files_dir):

61 return sorted(glob.glob(os.path.join(altum_files_dir, 'IMG_0000_*.tif')))

62

63 @pytest.fixture()

base.py (https://github.com/deepmind/kapitan.git) Python · 169 lines

41 input_paths = []

42 for input_path in comp_obj["input_paths"]:

43 globbed_paths = [glob.glob(os.path.join(path, input_path)) for path in self.search_paths]

44 inputs = list(itertools.chain.from_iterable(globbed_paths))

45 # remove duplicate inputs

FileManager.py (https://github.com/introlab/OpenIMU.git) Python · 82 lines

11

12 # Add files to list

13 files = glob.glob(from_path + "/**/*.*", recursive=True) # Files in sub folders

14 for file in files:

15 file_name = file.replace("/", os.sep)

test_dirdbm.py (https://github.com/RoDaniel/featurehouse.git) Python · 106 lines

96 assert dbm["key1"] == "value"

97 assert dbm["key2"] == "correct"

98 assert not glob.glob(os.path.join(self.path, "*.new"))

99 assert not glob.glob(os.path.join(self.path, "*.rpl"))

test_handler_tb_stats.py (https://github.com/Project-MONAI/MONAI.git) Python · 72 lines

41 engine.run(range(3), max_epochs=2)

42 # check logging output

43 self.assertTrue(len(glob.glob(tempdir)) > 0)

44

45 def test_metrics_writer(self):

66 engine.run(range(3), max_epochs=2)

67 # check logging output

68 self.assertTrue(len(glob.glob(tempdir)) > 0)

69

70

gentmpkconfig.py (https://github.com/sonydevworld/spresense.git) Python · 73 lines

57 # Search top of Kconfig in the same level directories

58

59 kconfigs = glob.glob('../*/Kconfig')

60

61 # Add kconfigs from user application

62 if 'SPRESENSE_HOME' in os.environ:

63 kconfigs = kconfigs + glob.glob(os.path.join(os.environ['SPRESENSE_HOME'], "Kconfig"))

64

65 for c in kconfigs:

util.py (https://github.com/shantigilbert/Sx05RE.git) Python · 96 lines

12 '''List readable character devices.'''

13

14 fns = glob.glob('{}/event*'.format(input_device_dir))

15 fns = list(filter(is_device, fns))

16

analyze_result_log.py (https://github.com/yaneurao/YaneuraOu.git) Python · 104 lines

68

69 # print os.path.join(sys.argv[1], '*', 'log')

70 for file_path in sorted(glob.glob(os.path.join(sys.argv[1], '*.log'))):

71 fig = analyze_log(file_path)

72 sys.stdout.write(".")

provision.py (https://github.com/zulip/python-zulip-api.git) Python · 80 lines

12 current_dir = os.path.dirname(os.path.abspath(__file__))

13 bots_dir = os.path.join(current_dir, "bots")

14 bots_subdirs = map(lambda d: os.path.abspath(d), glob.glob(bots_dir + '/*'))

15 paths = filter(lambda d: os.path.isdir(d), bots_subdirs)

16 return paths

se_batch.py (https://github.com/anicolson/DeepXi.git) Python · 56 lines

39 fnames = ['*.wav', '*.flac', '*.mp3']

40 for fname in fnames:

41 for fpath in glob.glob(os.path.join(fdir, fname)):

42 for snr in snr_l:

43 if fpath.find('_' + str(snr) + 'dB') != -1:

game.py (https://gitlab.com/leoDumontier/OnVerraPlusTard) Python · 128 lines

32

33 def __init__(self, name=None, initial=None, current=None, static=None):

34 for path in glob.glob("mud/games/projet/*new*.yml"):

35 os.remove(path)

36 self._for_reset = {"name" : name ,

57 def yaml_load_all_glob(self, pattern):

58 l = []

59 for filename in glob.glob(pattern):

60 l.extend(self.yaml_load_all(filename))

61 return l

75 def yaml_load_glob(self, pattern):

76 d = {}

77 for filename in glob.glob(pattern):

78 d.update(self.yaml_load(filename))

79 return d

make_dos_files.py (https://gitlab.com/ppferreira/mzrte2) Python · 167 lines

20 for current_atom in self.atoms: #maps through the atoms

21 for current_orbital in self.orbitals: #maps through the orbitals

22 current_orbital_files = glob.glob(f'{prefix}*({current_atom})*({current_orbital})*')

23

24 num_files = len(current_orbital_files) #number of files in current orbital

101 #test area

102 if __name__ == '__main__':

103 dirs = glob.glob('S*')

104 dirs = sorted(dirs)

105 print(dirs)

124 os.chdir(currentDir)

125

126 clusters = glob.glob('MnZrTe2*')

127 clusters = sorted(clusters)

128 for currentCluster in clusters:

make_dos_files.py (https://gitlab.com/ppferreira/mzrte2) Python · 167 lines

20 for current_atom in self.atoms: #maps through the atoms

21 for current_orbital in self.orbitals: #maps through the orbitals

22 current_orbital_files = glob.glob(f'{prefix}*({current_atom})*({current_orbital})*')

23

24 num_files = len(current_orbital_files) #number of files in current orbital

101 #test area

102 if __name__ == '__main__':

103 dirs = glob.glob('S*')

104 dirs = sorted(dirs)

105 print(dirs)

124 os.chdir(currentDir)

125

126 clusters = glob.glob('CuZrTe2*')

127 clusters = sorted(clusters)

128 for currentCluster in clusters:

pack.py (https://github.com/LeelaChessZero/lczero-training.git) Python · 85 lines

22 ids = []

23 for d in dirs:

24 for f in glob.glob(os.path.join(d, "training.*.gz")):

25 ids.append(int(os.path.basename(f).split('.')[-2]))

26 ids.sort()

test_lorapayload.py (https://github.com/jieter/python-lora.git) Python · 77 lines

17

18 def fixtures():

19 for device_path in glob.glob(os.path.join(FIXTURES_PATH, "*")):

20 if device_path.endswith("README.md"):

21 continue

26

27 # text all the files ending in xml in the path we just discovered

28 for fixture_filename in glob.glob(os.path.join(device_path, "payload*.xml")):

29

30 fixture = "/".join(fixture_filename.split("/")[-2:])

voice_conversion_test.py (https://github.com/Hiroshiba/become-yukarin.git) Python · 76 lines

37 try:

38 if p.suffix in ['.npy', '.npz']:

39 fn = glob.glob(str(input_wave_directory / p.stem) + '.*')[0]

40 p = Path(fn)

41 wave = acoustic_converter(p)

51 config = create_config(base_model / 'config.json')

52

53 input_paths = list(sorted([Path(p) for p in glob.glob(str(config.dataset.input_glob))]))

54 numpy.random.RandomState(config.dataset.seed).shuffle(input_paths)

55 path_train = input_paths[0]

data_preprocess.py (https://github.com/athon2/BraTS2018_NvNet.git) Python · 126 lines

106 training_data_files = list()

107 subject_ids = list()

108 for subject_dir in glob.glob(os.path.join(data_dir, "*", "*")):

109 subject_ids.append(os.path.basename(subject_dir))

110 subject_files = list()

gen_vid_thunks.py (https://github.com/StanfordSNR/gg.git) Python · 93 lines

42 to_delete = []

43 for stc in SUFFIX_TO_CLEAR:

44 to_delete.extend(glob.glob('*.' + stc))

45

46 for todel in to_delete:

reparseprops.py (https://github.com/brmson/Sentence-selection.git) Python · 95 lines

39

40 qnum=0

41 for path in glob.glob(PATH + '/*'):

42 i=0

43 p.write("<A "+str(qnum)+">\n")

cleanup.py (https://github.com/gigantum/gigantum-client.git) Python · 69 lines

32 root_dir = os.path.join(root_dir, 'servers', testutils.current_server_id())

33 if os.name == 'nt':

34 user_projects = glob.glob(f'{root_dir}\*\*\labbooks\selenium-project-*')

35 else:

36 user_projects = glob.glob(f'{root_dir}/*/*/labbooks/selenium-project-*')

48 dataset_file_cache_dir = os.path.join(root_dir, '.labmanager', 'datasets', testutils.current_server_id())

49 if os.name == 'nt':

50 user_datasets = glob.glob(f'{server_dir}\*\*\datasets\selenium-dataset-*')

51 cache_datasets = glob.glob(f'{dataset_file_cache_dir}\*\*\selenium-dataset-*')

52 else:

53 user_datasets = glob.glob(f'{root_dir}/*/*/datasets/selenium-dataset-*')

54 cache_datasets = glob.glob(f'{dataset_file_cache_dir}/*/*/selenium-dataset-*')

estim_mp_sparse_mat.py (https://gitlab.com/kyrgyzov/lsa_slurm) Python · 110 lines

53 #rName = 'phylum'

54

55 LS = glob.glob(pDir+'dicts/'+rName+'/*.dc')

56 print len(LS)

57 nbr_C = load_data(pDir+'dicts/'+rName+'/nbr_cols.txt',fl='nbr')

processor.py (https://github.com/blackeagle01/Abnormal_Event_Detection.git) Python · 120 lines

64

65 def remove_old_images(path):

66 filelist = glob.glob(os.path.join(path, "*.png"))

67 for f in filelist:

68 os.remove(f)

netperf.py (https://github.com/thearn/OpenMDAO-Framework.git) Python · 132 lines

125 out.write('\n')

126

127 for path in glob.glob('Echo_*'):

128 shutil.rmtree(path, onerror=onerror)

129

local.py (https://github.com/Roguelazer/mrjob.git) Python · 86 lines

34

35 def ls(self, path_glob):

36 for path in glob.glob(path_glob):

37 if os.path.isdir(path):

38 for dirname, _, filenames in os.walk(path):

50

51 def path_exists(self, path_glob):

52 return bool(glob.glob(path_glob))

53

54 def path_join(self, dirname, filename):

57

58 def rm(self, path_glob):

59 for path in glob.glob(path_glob):

60 if os.path.isdir(path):

61 log.debug('Recursively deleting %s' % path)

firefox_media_tests_buildbot.py (https://github.com/rillian/firefox.git) Python · 122 lines

96

97 # logs to upload: broadest level (info), error, screenshots

98 uploads = glob.glob(os.path.join(log_screenshots_dir, '*'))

99 log_files = self.log_obj.log_files

100 log_level = self.log_obj.log_level

unsupportedsavestates.py (https://github.com/poliva/pyqtggpo.git) Python · 152 lines

33 if d:

34 localjson = os.path.join(d, SyncWorker.JSON_INDEX_FILENAME)

35 for filename in glob.glob(os.path.join(d, '*.fs')):

36 localJsonDigest[os.path.basename(filename)] = sha256digest(filename)

37 # noinspection PyBroadException

gotoolchain.py (https://github.com/openbmc/openbmc.git) Python · 71 lines

20 pattern = os.path.join(tmpdir_SDKQA, "environment-setup-*")

21 # FIXME: this is a very naive implementation

22 return glob.glob(pattern)[0]

23

24 @staticmethod

simple_track_dataloader.py (https://github.com/argoai/argoverse-api.git) Python · 150 lines

116 ply_fpaths: List of strings, representing paths to ply files in this log

117 """

118 ply_fpaths = sorted(glob.glob(f"{self.data_dir}/{log_id}/lidar/PC_*.ply"))

119 return ply_fpaths

120

128 for a specific camera

129 """

130 cam_img_fpaths = sorted(glob.glob(f"{self.data_dir}/{log_id}/{camera_name}/{camera_name}_*.jpg"))

131 return cam_img_fpaths

132

getsplitresmask.py (https://bitbucket.org/sstaggal/staggware.git) Python · 122 lines

43 outerdiam=0

44 apix=float(sys.argv[2])

45 sets=glob.glob('set_*')

46

47 basedir=os.getcwd()

workspace_commands.py (https://github.com/andreikop/completer.git) Python · 237 lines

148 """Check if command is complete and ready to execute

149 """

150 files = glob.glob(os.path.expanduser(self._path))

151 return len(files) > 0 and \

152 all([os.path.isfile(p) for p in files])

samplesheet.py (https://github.com/kdaily/bcbb.git) Python · 108 lines

93 for ss_dir in (s for s in sheet_dirs if os.path.exists(s)):

94 with utils.chdir(ss_dir):

95 for ss in glob.glob("*.csv"):

96 fc_ids = _get_flowcell_id(ss, require_single)

97 for fcid in fc_ids:

posix_apps.py (https://gitlab.com/victorl/PX4Firmware) Python · 148 lines

34

35 import glob

36 builtins = glob.glob("builtin_commands/COMMAND*")

37

38 apps = []

test.py (https://github.com/hbutsuak95/monolayout.git) Python · 158 lines

91 elif os.path.isdir(args.image_path):

92 # Searching folder for images

93 paths = glob.glob(os.path.join(

94 args.image_path, '*.{}'.format(args.ext)))

95 output_directory = args.out_dir

rebal.py (https://github.com/RoDaniel/featurehouse.git) Python · 321 lines

197 res = os.listdir(resdir)

198

199 dirs = glob.glob(setprefix + "*")

200

201 if not dirs:

nightly_test_niflheim.el6.py (https://gitlab.com/marcindulak/gpaw) Python · 119 lines

76 'http://wiki.fysik.dtu.dk/gpaw-files/gpaw-setups-latest.tar.gz')

77 os.system('tar xvzf gpaw-setups-latest.tar.gz')

78 setups = tmpdir + '/gpaw/' + glob.glob('gpaw-setups-[0-9]*')[0]

79

80 # Run test-suite:

setup.py (https://bitbucket.org/agaricusb/minecraftforge.git) Python · 113 lines

79

80 def copy_files(src_dir, dest_dir):

81 for file in glob.glob(os.path.join(src_dir, '*')):

82 if not os.path.isfile(file) or file.lower().endswith('.java'):

83 continue

gpgsign.py (https://gitlab.com/krt/fdroidserver.git) Python · 78 lines

50

51 # Process any apks that are waiting to be signed...

52 for f in sorted(glob.glob(os.path.join(output_dir, '*.*'))):

53 if common.get_file_extension(f) == 'asc':

54 continue

1d_profile_quantization.py (https://gitlab.com/IPMsim/DataAnalysis) Python · 79 lines

16 def exhaust_directory(directory, histogram, validity_condition, boundary_condition, quantization):

17 number_of_profiles = 0

18 for filepath in glob.glob(os.path.join(directory, xml_reader.pattern)):

19 profiles = xml_reader.extract_profiles_from_file(filepath)

20 profiles = filter(validity_condition, profiles) # filter to obtain good quality profiles

snippet.py (https://github.com/gistable/gistable.git) Python · 73 lines

11

12 _mcount = 0

13 for filename in glob.glob(_mtype):

14 # fh = open(filename, 'r')

15

transport.py (https://github.com/chdorner/titanium_mobile.git) Python · 143 lines

44 info("Migrating iOS project ... ")

45

46 files = glob.glob('%s/*.xcodeproj' % build_dir)

47 if len(files)!=1:

48 print "Couldn't find the .xcodeproj file at %s" % build_dir

build_web_page.py (https://gitlab.com/naagafreeman/ase) Python · 134 lines

66 shell=True)

67

68 tar = glob.glob('../dist/*.tar.gz')[0].split('/')[-1]

69 os.rename('../dist/' + tar, 'build/html/' + tar)

70

data_reader_DNN_v2.py (https://github.com/jtkim-kaist/VAD.git) Python · 177 lines

15 self._output_dir = output_dir

16 self._norm_dir = norm_dir

17 self._input_file_list = sorted(glob.glob(input_dir+'/*.bin'))

18 self._input_spec_list = sorted(glob.glob(input_dir+'/*.txt'))

19 self._output_file_list = sorted(glob.glob(output_dir+'/*.bin'))

20 self._file_len = len(self._input_file_list)

21 self._name = name

test_shelve.py (https://bitbucket.org/x893/sirflive.git) Python · 135 lines

16 s.close()

17 finally:

18 for f in glob.glob(self.fn+"*"):

19 os.unlink(f)

20

26 s.close()

27 finally:

28 for f in glob.glob(self.fn+"*"):

29 os.unlink(f)

30

36 s.close()

37 finally:

38 for f in glob.glob(self.fn+"*"):

39 os.unlink(f)

40

pilfile.py (https://github.com/gpolo/pil-py3k.git) Python · 93 lines

64 for file in files:

65 if glob.has_magic(file):

66 out.extend(glob.glob(file))

67 else:

68 out.append(file)

dbserve.py (https://github.com/adrianpike/wwscc.git) Python · 134 lines

76 response.headers['Content-type'] = 'text/plain'

77 data = ''

78 for file in glob.glob('%s/*.db' % (config['seriesdir'])):

79 try:

80 engine = create_engine('sqlite:///%s' % file, poolclass=NullPool)

_auxiliary.py (https://gitlab.com/cocorbin/development.git) Python · 134 lines

104 files = []

105

106 files = files + glob.glob('*.grm.*')

107

108 files = files + glob.glob('.grm.*')

109

110 files = files + glob.glob('*.ini')

111

112 files = files + glob.glob('*.pkl')

113

114 files = files + glob.glob('*.txt')

115

116 files = files + glob.glob('*.dat')

vocabulary_backup.py (https://gitlab.com/Seiris/annot.git) Python · 173 lines

46 else:

47 # get vocabularies app

48 ls_appon = glob.glob( "appon*" )

49 ls_appon.sort()

50 # reset queryset

90 s_version_latest = obj_n.version_latest

91 s_regexfixture = s_appon+"/fixtures/*_"+s_vocabulary+"_"+s_version_latest+"_backup.json"

92 ls_backuppathfile = glob.glob( s_regexfixture )

93 i_latest = 0

94 s_backuplatest = None

netplan.py (https://github.com/CanonicalLtd/subiquity.git) Python · 163 lines

150 paths = []

151 for d in dirs:

152 paths.extend(glob.glob(os.path.join(root, d, "netplan", wildcard)))

153

154 def mykey(path):

test_plotStrike.py (https://github.com/MTgeophysics/mtpy.git) Python · 76 lines

24 def _test_gen(edi_path):

25 def default(self):

26 edi_file_list = glob.glob(os.path.join(edi_path, "*.edi"))

27 pt_obj = PlotStrike(fn_list=edi_file_list, plot_yn='n', save_figure_path=self._temp_dir, fig_size=(8, 6), fig_dpi=100)

28 pt_obj.plot()

34

35 def rotation(self):

36 edi_file_list = glob.glob(os.path.join(edi_path, "*.edi"))

37 # change rotation

38 pt_obj = PlotStrike(fn_list=edi_file_list, plot_yn='n', rot_z=90, fig_size=(8, 6), fig_dpi=100)

41

42 def type(self):

43 edi_file_list = glob.glob(os.path.join(edi_path, "*.edi"))

44 # plot type

45 pt_obj = PlotStrike(fn_list=edi_file_list, plot_yn='n', plot_type=1, fig_size=(8, 6), fig_dpi=100)

mongo_schema.py (https://github.com/yandex/yandex-taxi-testsuite.git) Python · 83 lines

78 def _get_paths(directory) -> typing.Dict[str, str]:

79 result = {}

80 for path in glob.glob(os.path.join(directory, '*.yaml')):

81 collection, _ = os.path.splitext(os.path.basename(path))

82 result[collection] = path

fake_filesystem_unittest_test.py (https://gitlab.com/jonnialva90/iridium-browser) Python · 107 lines

74 def test_glob(self):

75 '''Fake glob module is bound'''

76 self.assertCountEqual(glob.glob('/test/dir1/dir*'),

77 [])

78 self.fs.CreateDirectory('/test/dir1/dir2a')

79 self.assertCountEqual(glob.glob('/test/dir1/dir*'),

80 ['/test/dir1/dir2a'])

81 self.fs.CreateDirectory('/test/dir1/dir2b')

82 self.assertCountEqual(glob.glob('/test/dir1/dir*'),

83 ['/test/dir1/dir2a', '/test/dir1/dir2b'])

84

fedora_epel_push.py (https://github.com/GunioRobot/cobbler.git) Python · 147 lines

85 # find the tarballs

86 tarsearch = "%s/*.tar.gz" % rpmbuild

87 tars = glob.glob(tarsearch)

88 if len(tars) != 1:

89 croak("expected to find just one tar.gz in %s, no luck") % rpmbuild

101 # find a specfile

102 specsearch = "%s/*.spec" % projdir

103 specs = glob.glob(specsearch)

104 if len(specs) != 1:

105 croak("need one and only one specfile in %s" % projdir)

spack.py (https://gitlab.com/polyphemus/core.git) Python · 112 lines

34 def dependency(self, path, exclude_dependency, build_dir=None):

35 path = os.path.abspath(path)

36 species_file = glob.glob(os.path.join(path, "*.species")) + \

37 glob.glob(os.path.join(path, "species"))

38 reactions_file = glob.glob(os.path.join(path, "*.reactions")) + \

39 glob.glob(os.path.join(path, "reactions"))

40 spack_config = glob.glob(os.path.join(path, "spack_config"))

41 if spack_config:

42 spack_config = spack_config[0]

mcdoc.py (https://github.com/paniwani/ITK.git) Python · 171 lines

109 d = sys.path[0]+"/../.."

110 cmm = os.path.abspath(d+"/*/*/*/itk-module.cmake")

111 for fname in glob.glob(cmm):

112 f = file(fname, "r")

113 mcontent = f.read()

115 module = re.search(r"itk_module\(([^ )]+)", mcontent).group(1)

116 dname = os.path.dirname(fname)

117 for fname2 in glob.glob(dname+"/include/*.h"):

118 setGroup(fname2, module)

119 return 0

130 for fname in files:

131 if os.path.isdir(fname):

132 for fname2 in glob.glob(fname+"/*.h"):

133 count += 1

134 ret = max( ret, checkGroup(fname2, module) )

test_functional.py (https://bitbucket.org/birkenfeld/sphinx-contrib/) Python · 231 lines ✨ Summary

This Python code tests the functionality of a Sphinx documentation generator, specifically its ability to render PlantUML diagrams in various formats (HTML, LaTeX, PDF). It creates temporary directories and files, runs Sphinx with different builders and options, and verifies that the generated output matches expected results. The tests cover various scenarios, including simple diagrams, captions, alignment, and non-ASCII characters.

65 Hello

66 """

67 pngfiles = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.png'))

68 assert len(pngfiles) == 1

69 svgfiles = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.svg'))

92 Hello

93 """

94 files = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.png'))

95 assert len(files) == 1

96 imgtags = [l for l in readfile('index.html').splitlines()

129 \u3042

130 """

131 files = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.png'))

132 content = readfile(files[0]).splitlines()

133 assert b'-charset utf-8' in content[0]

encodingtest.py (https://github.com/wehriam/awspider.git) Python · 169 lines

34 def setUp(self):

35

36 self.filenames = glob.glob( os.path.join(os.path.dirname(__file__), 'data', '**', '*.xml') )

37

38 config_path = os.path.abspath( os.path.join( os.path.dirname(__file__), "config.yaml" ) )

common_stats.py (https://github.com/erjiang/polyworld.git) Python · 194 lines

82 tables = __create_tables( path_run, quiet )

83

84 paths = glob.glob( os.path.join(path_run, 'stats', 'stat.*') )

85 paths.sort( lambda x, y: __path2step(x) - __path2step(y) )

86

base_check_version.py (https://gitlab.com/libvirt/autotest.git) Python · 69 lines

43 pythons = []

44 for glob_str in self.PYTHON_BIN_GLOB_STRINGS:

45 pythons.extend(glob.glob(glob_str))

46

47 possible_versions = []

utils.py (https://github.com/atareao/Touchpad-Indicator.git) Python · 71 lines

55 mypath = '/etc/apt/sources.list.d'

56 onlyfiles = [basename(f).replace('.list', '') for f in

57 glob.glob(join(mypath, '*.list'))

58 if isfile(join(mypath, f))]

59 for element in onlyfiles:

upload-node-headers.py (https://github.com/brave/muon.git) Python · 147 lines

110 with scoped_cwd(dist_dir()):

111 s3put(bucket, access_key, secret_key, dist_dir(),

112 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

113 s3put(bucket, access_key, secret_key, dist_dir(),

114 'atom-shell/dist/{0}'.format(version), glob.glob('iojs-*.tar.gz'))

sort+group.py (https://github.com/RoDaniel/featurehouse.git) Python · 124 lines

89 hdir = os.path.dirname(hdir)

90 sdir = os.path.dirname(sdir)

91 files = glob.glob(os.path.join(hdir, "*", "*", "*"))

92 if sdir != hdir:

93 files.extend(glob.glob(os.path.join(sdir, "*", "*", "*")))

94 else:

95 files = glob.glob(os.path.join(hdir, "*", "*"))

96 files.extend(glob.glob(os.path.join(sdir, "*", "*")))

jailreader.py (https://github.com/RoDaniel/featurehouse.git) Python · 143 lines

77 if opt == "logpath":

78 for path in self.__opts[opt].split("\n"):

79 pathList = glob.glob(path)

80 if len(pathList) == 0:

81 logSys.error("No file found for " + path)

purchases_to_jrows.py (https://github.com/datagym-ru/retailhero-recomender-baseline.git) Python · 161 lines

142 client_cnt = 0

143 print("calculate_unique_clients_from: {}".format(output_dir))

144 for js_file in glob.glob(output_dir + "/*.jsons"):

145 for _ in open(js_file):

146 client_cnt += 1

gyptest-all.py (https://bitbucket.org/jjgod/qt-vtl.git) Python · 94 lines

63 # Clean out files which may have been created if test.ALL was run.

64 def clean_dep_files():

65 for file in (glob.glob('relocate/src/dep_*.txt') +

66 glob.glob('relocate/src/deps_all_done_*.txt')):

common.py (https://gitlab.com/oryx/openembedded-core) Python · 58 lines

11 def test_readme(self):

12 # The top-level README file may have a suffix (like README.rst or README.txt).

13 readme_files = glob.glob(os.path.join(self.tc.layer['path'], 'README*'))

14 self.assertTrue(len(readme_files) > 0,

15 msg="Layer doesn't contains README file.")

utils.py (https://gitlab.com/bsuper/convnet-keras) Python · 178 lines

15 os.chdir(input_dir) # go to /images/

16 print "Count is: {0}".format(count)

17 print glob.glob("./*") # ./train, ./test, ./val

18 for ttv in glob.glob("./*"):

19 folders_list = glob.glob(ttv + "/*") # ./train/face ...

20 for folder in folders_list:

21 print folder

22 fldername = folder.split("/")[-1] # face or no_face

23 outfolder = "./" + ttv.split("/")[-1] + "/new_" + fldername + "/"

24 files_list = glob.glob(folder + "/*")

25 for f in files_list:

26 try:

42 oldwd = os.getcwd()

43 os.chdir(input_dir)

44 print glob.glob("./*") # ./train, ./teset, ./val

45 for ttv in glob.glob("./*"):

make_rst.py (https://gitlab.com/tlunet/casper) Python · 202 lines

190 if not doc_dir.endswith('/'):

191 doc_dir += '/'

192 for old_rst in glob.glob(doc_dir+'*.rst'):

193 os.remove(old_rst)

194 if code_dir.endswith('.py'):

email_input.py (https://github.com/JRMeyer/tensorflow-tutorial.git) Python · 162 lines

73 '''

74 pathLabelPairs={}

75 for hamPath in glob.glob(hamDir+'*'):

76 pathLabelPairs.update({hamPath:(0,1)})

77 for spamPath in glob.glob(spamDir+'*'):

joystick.py (https://github.com/ncsurobotics/seawolf5.git) Python · 219 lines

15 """ Return a list of connected joystick devices

16 """

17 return glob.glob("/dev/js*") + glob.glob("/dev/input/js*")

18

19

utils.py (https://bitbucket.org/darcyg/shenzhou-iv-stm32f107-rt-thread.git) Python · 132 lines

114 for pathname in args:

115 if string.find( pathname, '*' ) >= 0:

116 newpath = glob.glob( pathname )

117 newpath.sort() # sort files -- this is important because

118 # of the order of files

icon_handler.py (https://bitbucket.org/fox06/updatesprocessor.git) Python · 70 lines

16 # Use glob to locate ico files, and random.choice to pick one.

17 import glob, random

18 ico_files = glob.glob(os.path.join(sys.prefix, "*.ico"))

19 if not ico_files:

20 ico_files = glob.glob(os.path.join(sys.prefix, "PC", "*.ico"))

compile.py (https://github.com/esitarski/CrossMgr.git) Python · 121 lines

48 # Check if any of the help files need rebuilding.

49 doNothing = True

50 for fname in glob.glob("./*.txt"):

51 fbase = os.path.splitext(os.path.basename(fname))[0]

52 fhtml = os.path.join( '..', HtmlDocFolder, fbase + '.html' )

78 links = f.read()

79

80 for fname in glob.glob("./*.txt"):

81 print( fname, '...' )

82 with io.open(fname, 'r') as f:

102 ZipFileName = 'SeriesMgrDocHtml.zip'

103 zf = zipfile.ZipFile( ZipFileName, 'w' )

104 for fname in glob.glob("./*.html"):

105 if not ('prolog' in fname or 'epilog' in fname):

106 zf.write( fname )

fabfile.py (https://github.com/yyuu/fabfile-kyototycoon.git) Python · 119 lines

33 opt.target = os.path.realpath('./target')

34 ## kyotocabinet

35 opt.kc_archive = (lambda: glob.glob('kyotocabinet-*.tar.gz')[-1])

36 opt.kc_extracted = (lambda: os.path.splitext(os.path.splitext(opt.kc_archive)[0])[0])

37 opt.kc_patches = (lambda: opt.kc_extracted + '.patches')

38 ## kyototycon

39 opt.archive = (lambda: glob.glob('kyototycoon-*.tar.gz')[-1])

40 opt.extracted = (lambda: os.path.splitext(os.path.splitext(opt.archive)[0])[0])

41 opt.patches = (lambda: opt.extracted + '.patches')

14-top-Topics-jsons.py (https://gitlab.com/jaumetet/crossreads) Python · 66 lines

29 TGid = int(str(thetopic["tid"])[0])

30 print "----------- TGid: "+str(thetopic["mallet_ids_inluded"])

31 for d in glob.glob(path0+'*'):

32 #print d

33 f = open(d, "r")

test_functional.py (https://bitbucket.org/birkenfeld/sphinx-contrib) Python · 196 lines

60 Hello

61 """

62 pngfiles = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.png'))

63 assert len(pngfiles) == 1

64 svgfiles = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.svg'))

87 Hello

88 """

89 files = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.png'))

90 assert len(files) == 1

91 imgtags = [l for l in readfile('index.html').splitlines()

123 \u3042

124 """

125 files = glob.glob(os.path.join(_outdir, '_images', 'plantuml-*.png'))

126 content = readfile(files[0]).splitlines()

127 assert '-charset utf-8' in content[0]

util.py (https://github.com/apple/foundationdb.git) Python · 76 lines

59

60 def import_subclasses(filename, module_path):

61 for f in glob.glob(os.path.join(os.path.dirname(filename), '*.py')):

62 fn = os.path.basename(f)

63 if fn == '__init__.py':

make_data.py (https://github.com/qidane/openmicroscopy.git) Python · 98 lines

81 version = proc.communicate()[1].strip()

82 pat = "%s/ice*%s.jar" % (rep, version)

83 cp = ":".join(glob.glob(pat))

84 javac_cmd = "javac -target 1.6 -cp "

85 javac_cmd += ("%s %s/*.java""" % (cp, dat))

process_function_template.py (https://github.com/ricardogsilva/Quantum-GIS.git) Python · 139 lines

44

45

46 for f in sorted(glob.glob('resources/function_help/json/*')):

47 with open(f, encoding="utf-8") as function_file:

48 try:

129 cpp.write("\n );")

130

131 for f in sorted(glob.glob('resources/function_help/text/*')):

132 n = os.path.basename(f)

133

__init__.py (https://gitlab.com/abhi1tb/build) Python · 114 lines

56 # Actually look inside of WHEEL_DIR to find .whl files and add them to the

57 # front of our sys.path.

58 sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path

59

60 # Actually alias all of our vendored dependencies.

plugin_utils.py (https://bitbucket.org/spaetz/pyblosxom_blog) Python · 167 lines

153 plugin_list = []

154 for mem in plugin_dirs:

155 file_list = glob.glob(os.path.join(mem, "*.py"))

156

157 file_list = [get_module_name(filename) for filename in file_list]

get_wiki_articles_run.py (https://github.com/dedan/runs-gensim.git) Python · 149 lines

47

48 # get all txt files in a folder and iterate over them

49 filelist = glob.glob(os.path.join(base_path,

50 p['folder_path'],

51 "*.txt"))

_psposix.py (https://bitbucket.org/chenfuzhi/scan_proxy_ip.git) Python · 121 lines

110 def _get_terminal_map():

111 ret = {}

112 ls = glob.glob('/dev/tty*') + glob.glob('/dev/pts/*')

113 for name in ls:

114 assert name not in ret

individual_coverage.py (https://github.com/mitmproxy/mitmproxy.git) Python · 84 lines

64

65 excluded = ['mitmproxy/contrib/', 'mitmproxy/test/', 'mitmproxy/tools/', 'mitmproxy/platform/']

66 src_files = glob.glob('mitmproxy/**/*.py', recursive=True)

67 src_files = [f for f in src_files if os.path.basename(f) != '__init__.py']

68 src_files = [f for f in src_files if not any(os.path.normpath(p) in f for p in excluded)]

test.py (https://gitlab.com/pranith/gem5) Python · 48 lines

35 executable = binpath('gpu-hello')

36 kernel_path = os.path.dirname(executable)

37 kernel_files = glob.glob(os.path.join(kernel_path, '*.asm'))

38 if kernel_files:

39 print "Using GPU kernel code file(s)", ",".join(kernel_files)

fegba2lt_mapsprites.py (https://gitlab.com/Nick2001/lex-talionis) Python · 174 lines

64

65 # Get images

66 images = glob.glob('*.png')

67

68 # Pair images

create_resources_text_script.py (http://swingamesdk.googlecode.com/svn/trunk/) Python · 118 lines

90 def create_list():

91 f = open(get_test_directory() + "HowToResources.txt",'w')

92 dirList = glob.glob(os.path.join(get_test_directory(), "HowTo*.pas"))

93 for fname in dirList:

94 newFileName = os.path.basename(fname).split('.')[0]

cite.py (https://gitlab.com/dylan-ashley/minerva-python) Python · 95 lines

64 def find_lines_from_path(path):

65 lines = list()

66 for item in glob.glob("{}/*".format(path)):

67 if os.path.isdir(item):

68 for line in find_lines_from_path(item):

make-apt-cdrom.py (https://repo.or.cz/camarabuntu.git) Python · 114 lines

53 os.mkdir( os.path.join( apt_cdrom_dir, dir ) )

54

55 for package, filename in [(Package(filename=filename), filename) for filename in glob.glob( os.path.join( debdir, "*.deb" ) )]:

56 print "Found deb %s" % package

57 if package.name[0:3] == 'lib':

conversionstest.py (https://github.com/bendk/miro.git) Python · 160 lines

136

137 def test_parse_ffmpeg_output(self):

138 for mem in glob.glob(os.path.join(DATA, "ffmpeg_info*")):

139 lines = open(mem, "r").read().splitlines()

140 try:

eventparse.py (https://github.com/labx-technologies-llc/mb-linux-labx.git) Python · 93 lines

17 args = sys.argv[1:]

18 if not args:

19 args = filter(lambda s: 'A' <= s[0] <= 'Z', glob.glob("*.py"))

20 if not args:

21 print "No arguments, no [A-Z]*.py files."

setup.py (https://bitbucket.org/vionika/spin.android.git) Python · 73 lines

22

23 # Browser-specific requirements

24 requirements_files = glob.glob("requirements_*.txt")

25

26 profile_dest = None

index.py (https://github.com/Yell0wra1n/star.git) Python · 73 lines

3 def build(path):

4 db = anydbm.open('index', 'c')

5 files = glob.glob('%s/*.txt' % path)

6 db['_files'] = '\0'.join(files)

7 for fil in files:

most2geoclaw.py (https://github.com/dlgeorge/clawpack-4.x.git) Python · 107 lines

34 Converts MOST output files to fort.t files.

35 """

36 files = glob.glob(r'%s*' % fnameprefix)

37 files.sort()

38 s = r"%s(?P<hours>[0-9]*)h(?P<minutes>[0-9]*)m(?P<seconds>[0-9]*)s" \

66 Converts MOST output files to fort.q files.

67 """

68 files = glob.glob(r'%s*' % fnameprefix)

69 files.sort()

70 frameno = 1

prp_PyPack.py (https://github.com/H-uru/PyPRP.git) Python · 124 lines

107 ####pkg = alcpypack()

108 ####

109 ####for i in glob.glob("newpak/*.pyc"):

110 #### print "packing %s" %i

111 #### f = file(i,"rb")

pak_utils.py (https://bitbucket.org/MateuszBoryckiHG/magiccasino-buildscripts.git) Python · 126 lines

112 """Create separate pak files from each folder under rootDir (includes rootDir)"""

113 subfolders = [rootDir.as_posix()]

114 subfolders.extend(glob.glob(rootDir.as_posix() + "/*/"))

115 subfolders.extend(glob.glob(rootDir.as_posix() + "/**/*/", recursive=True))

second_phos_ratio.py (https://github.com/ecell/epdp.git) Python · 281 lines

271 print >> sys.stderr, 'pattern ', l, '\noutfile', outfilename

272

273 filelist = glob.glob( globpattern )

274

275

tests.py (https://github.com/fone4u/nodebox-pyobjc.git) Python · 59 lines

30 """

31

32 for testPath in glob.glob('%s/*' % TEST_PATH):

33 if not os.path.isdir(testPath): continue

34 name = os.path.basename(testPath)

35 print name

36 testFiles = glob.glob('%s/*.png' % testPath)

37 try:

38 testFiles.remove('%s/_compare.png' % testPath)

manager.py (https://github.com/log2timeline/dftimewolf.git) Python · 129 lines

91 path (str): path of the directory containing the recipes JSON files.

92 """

93 for file_path in glob.glob(os.path.join(path, '*.json')):

94 self.ReadRecipeFromFile(file_path)

95

test_isoinfo.py (https://gitlab.com/libosinfo/osinfo-db) Python · 60 lines

21

22 ret = []

23 allpaths = glob.glob(os.path.join(isodata_path, "*", "*"))

24 for osdir in sorted(allpaths, key=util.human_sort):

25 osname = os.path.basename(osdir)

26 isodatapaths = glob.glob(os.path.join(osdir, "*.txt"))

27 if len(isodatapaths):

28 ret.append((osname, isodatapaths))

setup.py (https://github.com/ericliang/matplotlib.git) Python · 76 lines

20 return [("HAVE_UPDATE_HEADER", "0")]

21

22 deps = glob.glob('src/*.c')

23

24 extensions = [Extension("proj4",deps,include_dirs = ['src'],)]

setup.py (https://github.com/0902horn/urlwatch-modified.git) Python · 71 lines

63 # Example files

64 (os.path.join('share', package, 'examples'),

65 glob.glob(os.path.join('examples', '*'))),

66 # Manual page

67 (os.path.join('share', 'man', 'man1'),

playVideo.py (https://gitlab.com/argenos/VirtualBlackboard) Python · 89 lines

11

12 path = 'images/frames/demo_class/'

13 length = glob.glob(path+'*.png').__len__()/2

14

15 def playSingleVideo(path, mask=True):

checkmate.py (https://github.com/vonclites/checkmate.git) Python · 149 lines

95 def _remove_outdated_checkpoint_files(self, worst_checkpoint):

96 os.remove(os.path.join(self._save_dir, 'checkpoint'))

97 for ckpt_file in glob.glob(worst_checkpoint + '.*'):

98 os.remove(ckpt_file)

99

pyportage.py (https://github.com/meeuw/portage-python.git) Python · 137 lines

112 pn = sys.argv[2]

113 x = XPAK(ftbz2)

114 for dir in glob.glob('/usr/portage/*-*')+glob.glob('/usr/portage/virtual*'): shutil.rmtree(dir)

115 try:

116 os.remove('/usr/portage/profiles/categories')

131 print splitebuildname(re.split('\[ebuild.*\] ', line)[1][:-1])['pn']

132

133 for dir in glob.glob('/usr/portage/*-*')+glob.glob('/usr/portage/virtual'): shutil.rmtree(dir)

134 try:

135 os.remove('/usr/portage/profiles/categories')

test_detectors.py (https://github.com/facebookresearch/maskrcnn-benchmark.git) Python · 143 lines

55 files = [os.path.join(cfg_root_path, x) for x in file_list]

56 else:

57 files = glob.glob(

58 os.path.join(cfg_root_path, "./**/*.yaml"), recursive=True)

59

data_parser.py (https://github.com/felipecode/coiltraine.git) Python · 68 lines

43 """

44

45 measurements_list = glob.glob(os.path.join(episode, 'measurement*'))

46 # Open a sample measurement

47 with open(measurements_list[0]) as f:

build-win-installer.py (https://github.com/blackberry/WebKit-Smartphone.git) Python · 97 lines

78 """

79

80 dlls = glob.glob(os.path.join(wxwebkit_dir, "*.dll"))

81 for dll in dlls:

82 if dll.find("wxbase") == -1 and dll.find("wxmsw") == -1:

test-lz4-versions.py (https://gitlab.com/adam.lukaitis/lz4) Python · 147 lines

86 print('Compress test.dat by all released lz4c and lz4c32')

87 os.chdir(tmp_dir)

88 for lz4 in glob.glob("*.lz4"):

89 os.remove(lz4)

90 for tag in tags:

95

96 print('Full list of compressed files')

97 lz4s = sorted(glob.glob('*.lz4'))

98 for lz4 in lz4s:

99 print(lz4 + ' : ' + repr(os.path.getsize(lz4)))

102 print('')

103 print('Duplicated files')

104 lz4s = sorted(glob.glob('*.lz4'))

105 for i, lz4 in enumerate(lz4s):

106 if not os.path.isfile(lz4):

sample-modelnet40.py (https://github.com/AlexGeControl/3D-Point-Cloud-Analytics.git) Python · 82 lines

67 # find all *.off and downsample:

68 pattern = os.path.join(input_dir, '*.off')

69 samples = sample(glob.glob(pattern), arguments.num_per_category)

70 # move the samples into output dir:

71 print(f'\t{category}')

distro_stats.py (https://github.com/mono/release.git) Python · 107 lines

64 # collect stats

65

66 for i in glob.glob("www_http/url_*.tab") + glob.glob("www_ftp/url_*.tab"):

67

68 fd = open(i)

sgd.py (https://github.com/flypythoncom/cs224n_2019.git) Python · 133 lines

16 """

17 st = 0

18 for f in glob.glob("saved_params_*.npy"):

19 iter = int(op.splitext(op.basename(f))[0].split("_")[2])

20 if (iter > st):

autoedit.py (https://github.com/freephys/Langtangen.git) Python · 165 lines

75 shutil.copy('F77WAVE.fcp.orig', 'F77WAVE.fcp')

76 # clean up the big files:

77 tmpfiles = glob.glob('tmp_*')

78 for file in tmpfiles: os.remove(file)

79

simulators.py (https://github.com/BlueBrain/BluePyOpt.git) Python · 164 lines

68 import glob

69 hoc_so_list = \

70 glob.glob(os.path.join(nrnpy_path, 'hoc*.so'))

71

72 if len(hoc_so_list) != 1:

post_pgrc.py (https://github.com/sslab-gatech/mosaic.git) Python · 171 lines

69 for original_path in original_paths:

70 prefix_pattern = "*/" + prefix + "*"

71 partial_files = glob.glob(os.path.join(original_path, prefix_pattern))

72 for single_file in partial_files:

73 filename = os.path.basename(single_file)

mouse_and_match.py (git://pkgs.fedoraproject.org/opencv) Python · 73 lines

56 cv.setMouseCallback("gray", onmouse)

57 '''Loop through all the images in the directory'''

58 for infile in glob.glob( os.path.join(path, '*.*') ):

59 ext = os.path.splitext(infile)[1][1:] #get the filename extenstion

60 if ext == "png" or ext == "jpg" or ext == "bmp" or ext == "tiff" or ext == "pbm":

tldr.py (https://github.com/bighuggies/Spellathon.git) Python · 131 lines

59 # Get each tldr file in the directory and parse it into the dict of tldr

60 # files to be returned.

61 for t in glob.glob(path + '*.tldr'):

62 name = t.split(os.sep)[-1].split('.')[0]

63 tldrs[name] = parse_tldr(t, name)

tosca.py (https://github.com/rusty1s/pytorch_geometric.git) Python · 97 lines

81 data_list = []

82 for cat in self.categories:

83 paths = glob.glob(osp.join(self.raw_dir, '{}*.tri'.format(cat)))

84 paths = [path[:-4] for path in paths]

85 paths = sorted(paths, key=lambda e: (len(e), e))

make_data.py (https://github.com/will-moore/openmicroscopy.git) Python · 111 lines

94 version = proc.communicate()[1].strip()

95 pat = "%s/ice*%s.jar" % (rep, version)

96 cp = ":".join(glob.glob(pat))

97 javac_cmd = "javac -target 1.7 -cp "

98 javac_cmd += ("%s %s/*.java""" % (cp, dat))

setup_package.py (https://github.com/crawfordsm/astropy.git) Python · 117 lines

15 ERFA_SRC = os.path.abspath(os.path.join(ERFAPKGDIR, '..', '..', 'cextern', 'erfa'))

16

17 SRC_FILES = glob.glob(os.path.join(ERFA_SRC, '*'))

18 SRC_FILES += [os.path.join(ERFAPKGDIR, filename)

19 for filename in ['core.py.templ', 'core.c.templ', 'erfa_generator.py']]

monochromatic.py (https://github.com/astrofrog/sedfitter.git) Python · 135 lines

49

50 # Find all SED files to convolve

51 sed_files = sorted(glob.glob(model_dir + '/seds/*.fits.gz') +

52 glob.glob(model_dir + '/seds/*/*.fits.gz') +

53 glob.glob(model_dir + '/seds/*.fits') +

54 glob.glob(model_dir + '/seds/*/*.fits'))

test_sub.py (https://github.com/weissms/owb-mirror.git) Python · 79 lines

15

16 def tearDown(self):

17 for file in glob.glob('planet/tests/data/cache/*'):

18 os.unlink(file)

19 os.removedirs('planet/tests/data/cache')