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 |
|---|---|---|---|---|---|---|
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/sched-migration.py | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <[email protected]>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | 11,965 | 24.956616 | 88 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/net_dropmonitor.py | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | 1,749 | 22.026316 | 90 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/failed-syscalls-by-pid.py | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | 2,233 | 27.278481 | 112 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/netdev-times.py | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | 15,191 | 31.670968 | 89 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/futex-contention.py | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | 1,508 | 28.588235 | 96 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/check-perf-trace.py | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | 2,539 | 29.60241 | 78 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/event_analyzing_sample.py | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | 7,393 | 37.915789 | 117 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/syscall-counts-by-pid.py | # system call counts, by pid
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | 2,105 | 27.08 | 77 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/sctop.py | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | 2,102 | 24.962963 | 75 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/syscall-counts.py | # system call counts
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | 1,700 | 25.169231 | 77 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <[email protected]>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | 1,935 | 21.252874 | 72 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <[email protected]>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | 5,411 | 28.254054 | 158 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <[email protected]>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | 3,300 | 25.837398 | 86 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | 3,596 | 36.863158 | 125 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/tools/perf/tests/attr.py | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | 9,441 | 27.354354 | 79 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/Documentation/networking/cxacru-cf.py | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | 1,626 | 32.204082 | 78 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/Documentation/target/tcm_mod_builder.py | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: [email protected]
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | 40,692 | 37.792183 | 162 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/scripts/analyze_suspend.py | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... | 120,394 | 32.517539 | 438 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/scripts/tracing/draw_functrace.py | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | 3,560 | 26.392308 | 70 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/scripts/rt-tester/rt-tester.py | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | 5,305 | 23.228311 | 70 | py |
f2fs-stable-linux-3.18.y | f2fs-stable-linux-3.18.y/arch/ia64/scripts/unwcheck.py | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | 1,714 | 25.384615 | 89 | py |
EnergyVariables | EnergyVariables-main/src/3_ERA5_PopWeightedTemp.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remade on 21 feb 2022
@author: Laurens Stoop - [email protected]
Following example by Matteo de Felice: http://www.matteodefelice.name/post/aggregating-gridded-data/
"""
#%%
# =============================================================================
# Dependencies... | 11,529 | 42.183521 | 292 | py |
EnergyVariables | EnergyVariables-main/src/1_ERA5_CF-MZ_to-csv.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Restructered on Sun 26 Jan 2022 17:04
@author: Laurens Stoop - [email protected]
Following example by Matteo de Felice: http://www.matteodefelice.name/post/aggregating-gridded-data/
"""
#%%
# ============================================================================... | 3,355 | 29.788991 | 100 | py |
EnergyVariables | EnergyVariables-main/src/1B_ERA5_PECD_comp.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 27 09:34:10 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Imp... | 1,104 | 25.95122 | 149 | py |
EnergyVariables | EnergyVariables-main/src/6_LoadModelLSTR.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Made on 28 feb 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Importing modules... | 4,636 | 27.447853 | 142 | py |
EnergyVariables | EnergyVariables-main/src/2_ERA5_EV_ApplyTYNDP.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 27 09:34:10 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Imp... | 8,708 | 38.949541 | 152 | py |
EnergyVariables | EnergyVariables-main/src/4_TYNDP_demand.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remade on 25 feb 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Importing modul... | 5,569 | 34.031447 | 131 | py |
EnergyVariables | EnergyVariables-main/src/rtts.py | from itertools import chain
import pandas
import sklearn.model_selection
import sklearn.utils
def _generate_region_labels(x, region_length='7h'):
"""Return indices that label contigious groups of length region_length.
:param pandas.DataFrame x: must be time indexed.
:param region_length: must be interpr... | 6,463 | 42.38255 | 111 | py |
EnergyVariables | EnergyVariables-main/src/5B_Combine_fix-it.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Made on 28 feb 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Importing modules... | 6,718 | 32.427861 | 102 | py |
EnergyVariables | EnergyVariables-main/src/1B_output_viz.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 27 09:34:10 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Imp... | 2,478 | 28.86747 | 156 | py |
EnergyVariables | EnergyVariables-main/src/5_Combine_PWT-Dem.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remade on 25 feb 2022
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Importing modul... | 7,123 | 36.104167 | 144 | py |
EnergyVariables | EnergyVariables-main/src/1_ERA5_marketzones.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Restructered on Sun 26 Jan 2022 17:04
@author: Laurens Stoop - [email protected]
Following example by Matteo de Felice: http://www.matteodefelice.name/post/aggregating-gridded-data/
"""
#%%
# ============================================================================... | 16,160 | 40.122137 | 288 | py |
EnergyVariables | EnergyVariables-main/src/archive/1_ERA5_ENTSO-E_StudyZones.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Restructered on Thu 19 May 2021 21:40
@author: Laurens Stoop - [email protected]
Following example by Matteo de Felice: http://www.matteodefelice.name/post/aggregating-gridded-data/
"""
#%%
# ============================================================================... | 4,650 | 34.776923 | 239 | py |
EnergyVariables | EnergyVariables-main/src/archive/2_NUTS0_TYNDP.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remade on Sun 30 May 2021 22:32
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Impor... | 24,490 | 57.590909 | 337 | py |
EnergyVariables | EnergyVariables-main/src/archive/2_TYNDP_MarketZones.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remade on Sun 30 May 2021 22:32
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## Impor... | 10,284 | 40.471774 | 192 | py |
EnergyVariables | EnergyVariables-main/src/archive/1_ERA5_ENTSO-E_MarketZones.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Restructered on Sun 26 Jan 2022 17:04
@author: Laurens Stoop - [email protected]
Following example by Matteo de Felice: http://www.matteodefelice.name/post/aggregating-gridded-data/
"""
#%%
# ============================================================================... | 11,419 | 41.932331 | 261 | py |
EnergyVariables | EnergyVariables-main/src/archive/2_CountryDefinitions.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Restructered on Wed 11 Nov 2020 14:15
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## ... | 5,181 | 33.778523 | 122 | py |
EnergyVariables | EnergyVariables-main/src/archive/4_EnergyVariables_ERA5-EU_Zuijlen.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Spyder Editor
Restructered on Wed 10 Nov 2020 14:15
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# ===================================================================... | 5,131 | 37.014815 | 170 | py |
EnergyVariables | EnergyVariables-main/src/archive/2NEW_CountryDefinitions.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Restructered on Wed 11 Nov 2020 14:15
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# =============================================================================
## ... | 5,181 | 33.778523 | 122 | py |
EnergyVariables | EnergyVariables-main/src/archive/3_DistributeCapacity-TYNDP.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Spyder Editor
Restructered on Tue 10 Nov 2020 14:15
@author: Laurens Stoop - [email protected]
"""
#%%
# =============================================================================
# Dependencies
# ===================================================================... | 676 | 18.342857 | 79 | py |
BL-TESSsearch | BL-TESSsearch-main/recreate-Traas/FindPlotEvents_pipeline.py | # Combined pipeline to simplify analysis of turboSETI files
# Uses both find_event_pipeline and plot_event_pipeline turboSETI methods
# to create waterfall plots of the events found in a full cadence
def FindPlotEvents(dataDir, threshold=3):
'''
dataDir : string with directory housing both the .dat and .h5 fi... | 1,589 | 36.857143 | 128 | py |
BL-TESSsearch | BL-TESSsearch-main/recreate-Traas/.ipynb_checkpoints/FindPlotEvents_pipeline-checkpoint.py | # Combined pipeline to simplify analysis of turboSETI files
# Uses both find_event_pipeline and plot_event_pipeline turboSETI methods
# to create waterfall plots of the events found in a full cadence
def FindPlotEvents(dataDir, threshold=3):
'''
dataDir : string with directory housing both the .dat and .h5 fi... | 1,589 | 36.857143 | 128 | py |
BL-TESSsearch | BL-TESSsearch-main/Target-Selection/gbt-inTransit.py | # Imports
import os
import pandas as pd
import numpy as np
import pymysql
import urllib
from barycorrpy import utc_tdb
from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord
from astropy import units as u
# tunable variables for later
numobs = 3 # Set minumum number of observations fo... | 4,140 | 32.395161 | 82 | py |
BL-TESSsearch | BL-TESSsearch-main/Target-Selection/.ipynb_checkpoints/gbt-inTransit-checkpoint.py | # Imports
import os
import pandas as pd
import numpy as np
import pymysql
import urllib
from barycorrpy import utc_tdb
from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord
from astropy import units as u
# tunable variables for later
numobs = 3 # Set minumum number of observations fo... | 4,140 | 32.395161 | 82 | py |
BL-TESSsearch | BL-TESSsearch-main/Target-Selection/locate-TIC-files/read-targets-location.py | import numpy as np
import csv
targetLocs = np.loadtxt('targets-location.csv', dtype=str)
targets = np.loadtxt('target-list.csv', dtype=str)
whereTIC = {}
for target in targets:
ticid = target[1:-1]
listPaths = []
print('starting on {}'.format(ticid))
for path in targetLocs:
if path.find(tic... | 584 | 19.172414 | 58 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/plot_dat_mod.py | import os, glob, sys
from turbo_seti.find_event.plot_dat import plot_dat
from turbo_seti import find_event as find
import numpy as np
def main():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dir', default=os.getcwd())
parser.add_argument('--minHit', type=float, default=None... | 1,710 | 29.553571 | 83 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/noahf_plot_event_pipeline.py | #!/usr/bin/env python3
r"""
Front-facing script to plot drifting, narrowband events in a set of generalized
cadences of ON-OFF radio SETI observations.
"""
import os
from operator import attrgetter
import pandas
from blimpy import Waterfall
import noahf_plot_event as plot_event
class PathRecord:
r''' Definition... | 6,336 | 40.418301 | 122 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/assign-band.py | import os, sys, glob
import subprocess as sp
import numpy as np
from analysis_pipeline import getPaths, multiCommand
from blimpy.io.hdf_reader import H5Reader
def band(dir, tol=0.7):
L = [1.10, 1.90]
S = [1.80, 2.80]
C = [4.00, 7.80]
X = [7.80, 11.20]
h5List = glob.glob(dir+'/*.h5')
minFreq... | 1,602 | 20.958904 | 65 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/noahf_plot_event.py | #!/usr/bin/env python3
r'''
Backend script to plot drifting, narrowband events in a generalized cadence of
ON-OFF radio SETI observations. The main function contained in this file is
:func:`~.plot_candidate_events` uses the other helper functions
in this file (described below) to plot events from a turboSETI event .cs... | 16,187 | 36.472222 | 151 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/analysis_pipeline.py | import os, glob, sys
import subprocess as sp
import numpy as np
def getPaths():
cmd = 'find /mnt_blc*/datax2/scratch/noahf/ -type d -name *TOI*'
find = sp.Popen(cmd, stdout=sp.PIPE, shell=True)
dirs = find.communicate()[0].split(b'\n')
dirsToReturn = []
for dir in dirs:
dd = dir.decode()... | 1,669 | 24.692308 | 125 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/find_target_transitTimes.py | # Imports
import os
import pandas as pd
import numpy as np
import pymysql
import urllib
from barycorrpy import utc_tdb
from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord
from astropy import units as u
# tunable variables for later
numobs = 3 # Set minumum number of observations fo... | 5,498 | 32.944444 | 105 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/FindPlot.py | # Combined pipeline to simplify analysis of turboSETI files
# Uses both find_event_pipeline and plot_event_pipeline turboSETI methods
# to create waterfall plots of the events found in a full cadence
import os, glob, sys
import subprocess as sp
import urllib
import pandas as pd
import pymysql
import numpy as np
from b... | 9,930 | 36.617424 | 144 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/.ipynb_checkpoints/FindPlot-checkpoint.py | # Combined pipeline to simplify analysis of turboSETI files
# Uses both find_event_pipeline and plot_event_pipeline turboSETI methods
# to create waterfall plots of the events found in a full cadence
import os, glob, sys
import urllib
import pandas as pd
import pymysql
import numpy as np
from barycorrpy import utc_tdb... | 5,695 | 34.6 | 128 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/.ipynb_checkpoints/find_target_transitTimes-checkpoint.py | # Imports
import os
import pandas as pd
import numpy as np
import pymysql
import urllib
from barycorrpy import utc_tdb
from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord
from astropy import units as u
# tunable variables for later
numobs = 3 # Set minumum number of observations fo... | 5,498 | 32.944444 | 105 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/.ipynb_checkpoints/noahf_plot_event_pipeline-checkpoint.py | #!/usr/bin/env python3
r"""
Front-facing script to plot drifting, narrowband events in a set of generalized
cadences of ON-OFF radio SETI observations.
"""
import os
from operator import attrgetter
import pandas
from blimpy import Waterfall
import noahf_plot_event as plot_event
class PathRecord:
r''' Definition... | 6,336 | 40.418301 | 122 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/.ipynb_checkpoints/plot_dat_mod-checkpoint.py | import os, glob, sys
from turbo_seti.find_event.plot_dat import plot_dat
from turbo_seti import find_event as find
import numpy as np
def main():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dir', default=os.getcwd())
parser.add_argument('--minHit', type=float, default=None... | 1,710 | 29.553571 | 83 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/.ipynb_checkpoints/FindPlotEvents_pipeline-checkpoint.py | # Combined pipeline to simplify analysis of turboSETI files
# Uses both find_event_pipeline and plot_event_pipeline turboSETI methods
# to create waterfall plots of the events found in a full cadence
import os, glob
import urllib
import pandas as pd
import pymysql
import numpy as np
from barycorrpy import utc_tdb
from... | 5,325 | 35.231293 | 128 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/.ipynb_checkpoints/noahf_plot_event-checkpoint.py | #!/usr/bin/env python3
r'''
Backend script to plot drifting, narrowband events in a generalized cadence of
ON-OFF radio SETI observations. The main function contained in this file is
:func:`~.plot_candidate_events` uses the other helper functions
in this file (described below) to plot events from a turboSETI event .cs... | 16,187 | 36.472222 | 151 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/4band_compare.py | from color_coded_ET_power_law import *
import matplotlib
#matplotlib.rcParams['text.usetex'] = True
#import matplotlib.pyplot as plt
from LBand_SETI_compare import lband_compare
from SBand_SETI_compare import sband_compare
from CBand_SETI_compare import cband_compare
from XBand_SETI_compare import xband_compare
import ... | 4,432 | 48.808989 | 635 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/CBand_SETI_compare.py | from ET_power_law import *
import matplotlib.pylab as plt
def cband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: C-Band' #Project name
telescope =... | 2,623 | 32.641026 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/SBand_SETI_compare.py | from ET_power_law import *
import matplotlib.pylab as plt
def sband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: S-Band' #Project name
telescope =... | 2,618 | 33.012987 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/XBand_SETI_compare.py | from ET_power_law import *
import matplotlib.pylab as plt
def xband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: X-Band' #Project name
telescope =... | 2,630 | 33.168831 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/color_coded_ET_power_law.py | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from astropy import units as u
from matplotlib.patches import Polygon
#plt.savefig(image_filename, format='png',bbox_inches='tight')
from scipy import stats
#import add_SETI_limits
def calc_DishArea(d):
""" Compute dish area
d = dish diameter... | 24,973 | 38.144201 | 286 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/LBand_SETI_compare.py | from ET_power_law import *
import matplotlib.pylab as plt
def lband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: L-Band' #Project name
telescope =... | 2,641 | 32.025 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/ET_power_law.py | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from astropy import units as u
from matplotlib.patches import Polygon
#plt.savefig(image_filename, format='png',bbox_inches='tight')
from scipy import stats
def calc_DishArea(d):
""" Compute dish area
d = dish diameter
"""
return np.... | 23,244 | 36.920065 | 277 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/XBand_SETI_compare-checkpoint.py | from ET_power_law import *
import matplotlib.pylab as plt
def xband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: X-Band' #Project name
telescope =... | 2,630 | 33.168831 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/CBand_SETI_compare-checkpoint.py | from ET_power_law import *
import matplotlib.pylab as plt
def cband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: C-Band' #Project name
telescope =... | 2,623 | 32.641026 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/ET_power_law-checkpoint.py | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from astropy import units as u
from matplotlib.patches import Polygon
#plt.savefig(image_filename, format='png',bbox_inches='tight')
from scipy import stats
def calc_DishArea(d):
""" Compute dish area
d = dish diameter
"""
return np.... | 23,243 | 36.918434 | 277 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/color_coded_ET_power_law-checkpoint.py | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from astropy import units as u
from matplotlib.patches import Polygon
#plt.savefig(image_filename, format='png',bbox_inches='tight')
from scipy import stats
#import add_SETI_limits
def calc_DishArea(d):
""" Compute dish area
d = dish diameter... | 24,987 | 38.166144 | 286 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/4band_compare-checkpoint.py | from color_coded_ET_power_law import *
import matplotlib
#matplotlib.rcParams['text.usetex'] = True
#import matplotlib.pyplot as plt
from LBand_SETI_compare import lband_compare
from SBand_SETI_compare import sband_compare
from CBand_SETI_compare import cband_compare
from XBand_SETI_compare import xband_compare
import ... | 4,400 | 48.449438 | 635 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/LBand_SETI_compare-checkpoint.py | from ET_power_law import *
import matplotlib.pylab as plt
def lband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: L-Band' #Project name
telescope =... | 2,641 | 32.025 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/analysis/seti_limits_py3/.ipynb_checkpoints/SBand_SETI_compare-checkpoint.py | from ET_power_law import *
import matplotlib.pylab as plt
def sband_compare(max_distance, save=False):
#---------------------------
# Edit values below vvvvvv
#---------------------------
# Your new values ( e.g. Enriquez 2017 x 100)
project = 'This Study: S-Band' #Project name
telescope =... | 2,618 | 33.012987 | 145 | py |
BL-TESSsearch | BL-TESSsearch-main/run-turboSETI/wrapTurbo.py | # Imports
import os, sys, time
import numpy as np
import pandas as pd
import pymysql
from turbo_seti.find_doppler.find_doppler import FindDoppler
def wrap_turboSETI(iis, outDir, sqlTable, t=True, test=False):
'''
outDir : directory to store output subdirectories
sqlTable : input SQL table name
t : bool... | 4,765 | 30.773333 | 103 | py |
BL-TESSsearch | BL-TESSsearch-main/run-turboSETI/multiTurbo.py | # Imports
import os, sys, time
import subprocess as sp
import numpy as np
import pandas as pd
import pymysql
def getNodes(nnodes):
'''
Get a list of compute nodes based on the number of nodes given
nnodes [int] : number of nodes to run the commands on
returns : list of compute nodes to run on at GBT
... | 6,522 | 32.280612 | 226 | py |
BL-TESSsearch | BL-TESSsearch-main/run-turboSETI/prepTurbo/turboSETI-wrapper.py | # Imports
import os, sys, time
import pandas as pd
import numpy as np
from turbo_seti.find_doppler.find_doppler import FindDoppler
import gspread
from oauth2client.service_account import ServiceAccountCredentials
def getSheet():
'''
gains access to the necessary google spreadsheet
returns google spreadshe... | 4,535 | 30.5 | 104 | py |
BL-TESSsearch | BL-TESSsearch-main/run-turboSETI/connect-spreadsheet/connectSheet.py | # Imports
import pandas as pd
import os
import gspread
from oauth2client.service_account import ServiceAccountCredentials
def getSheet():
'''
gains access to the necessary google spreadsheet
returns google spreadsheet client
'''
# Gain access to the google sheets and read in table with pandas
... | 1,757 | 28.79661 | 104 | py |
fat-albert | fat-albert-master/abmn/__init__.py | 0 | 0 | 0 | py | |
fat-albert | fat-albert-master/abmn/src/eval_ensemble.py | # compute accuracy of majority vote of all prediction files (probabilities_{MODEL_NANE} in ensemble directory
import glob
import numpy as np
import argparse
import os
def eval_ensemble(ensemble_directory, gold_labels_file, predictions_file, evaluation_file, ensemble_name):
# read the gold labels
with open(g... | 3,799 | 45.341463 | 118 | py |
fat-albert | fat-albert-master/abmn/src/main.py | import sys
import os
import numpy as np
import argparse
sys.path.append('movieqa')
sys.path.append('glove')
sys.path.append('core')
def set_data_conf_values(model, mode, model_name, evaluation_file_version):
data_conf = model.data_conf
data_conf.MODEL_NAME = model_name
data_conf.TRAIN_DIR = data_conf.OU... | 4,431 | 41.209524 | 119 | py |
fat-albert | fat-albert-master/abmn/src/eval_ensemble_test.py |
# compute accuracy of majority vote of all prediction files (probabilities_{MODEL_NANE} in ensemble directory
import glob
import numpy as np
import argparse
import os
def eval_ensemble(ensemble_directory, gold_labels_file, predictions_file, evaluation_file, ensemble_name):
# read the gold labels
with open(... | 4,134 | 44.944444 | 118 | py |
fat-albert | fat-albert-master/abmn/src/adversarial_sentence_level_black_box.py | """
Calls the sentence-level black-box adversarial attacks,
which are our reimplementation and extension of Jia and Liang (2017)'s AddAny attack
"""
import glob
import sys
import os
import numpy as np
import argparse
os.chdir("movieqa")
from movieqa.adversarial_addAny import create_addAny_examples as create_addany
fr... | 3,443 | 46.833333 | 120 | py |
fat-albert | fat-albert-master/abmn/src/__init__.py | 1 | 0 | 0 | py | |
fat-albert | fat-albert-master/abmn/src/adversarial_white_box.py | import glob
import sys
import os
import numpy as np
import argparse
sys.path.append('movieqa')
sys.path.append('glove')
sys.path.append('core')
def main(mode, model_type, models_folder, dropout, learning_rate, loss_function, batch_size, attack_level,
num_modified_words, percentage_attacked_samples):
os.... | 4,867 | 43.254545 | 117 | py |
fat-albert | fat-albert-master/abmn/src/ensemble_folder/refine.py | import numpy as np
predictions = np.loadtxt('preds.txt')
for i in predictions:
print(int(i))
| 98 | 15.5 | 37 | py |
fat-albert | fat-albert-master/abmn/src/core/stats.py | def dumb_method_to_test():
print("yay")
class Statistics:
def __init__(self, name):
self.name = name
self.min = 100000000000.0
self.max = 0.0
self.total = 0
self.instances = 0
self.values = []
def update(self, value):
"""
updates min, max, t... | 1,362 | 26.26 | 82 | py |
fat-albert | fat-albert-master/abmn/src/core/model.py | import re
import tensorflow as tf
initializer = "xavier"
def _activation_summary(x):
tensor_name = re.sub('%s_[0-9]*/', x.op.name)
tf.compat.v1.summary.histogram(tensor_name + '/activations', x)
tf.compat.v1.summary.scalar(tensor_name + '/sparsity',
tf.nn.zero_fraction(x))
# Dropou... | 10,768 | 38.16 | 127 | py |
fat-albert | fat-albert-master/abmn/src/core/util.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# contains utility functions, also takes care of creation of vocabulary and word embedding files
import numpy as np
import tensorflow as tf
import re
import os
import time
#from tensorflow.contrib.tensorboard.plugins import projector
from distutils.dir_util import copy_tree
f... | 11,079 | 30.036415 | 120 | py |
fat-albert | fat-albert-master/abmn/src/core/__init__.py | 1 | 0 | 0 | py | |
fat-albert | fat-albert-master/abmn/src/movieqa/conf_cnn.py | # hierarchical CNN training config
# model config
FILTER_SIZES = [1, 3, 5]
HIDDEN_SIZE = 150
# train config
INITIAL_LEARNING_RATE = 0.001
BATCH_SIZE = 30
MAX_STEPS = 50000
DROPOUT_RATE = 0.0
LOSS_FUNC = 'entropy'
OPTIMIZER = "adam"
NUM_EPOCHS = 1
| 249 | 15.666667 | 34 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/conf_cnn_word_level.py | # word-level-only CNN training config
#model config
FILTER_SIZES = [1,3,5]
HIDDEN_SIZE = 150
# train config
INITIAL_LEARNING_RATE = 0.002
BATCH_SIZE = 30
MAX_STEPS = 50000
DROPOUT_RATE = 0.0
LOSS_FUNC = 'entropy'
OPTIMIZER = "adam"
NUM_EPOCHS = 1 | 249 | 16.857143 | 37 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/run_lstm.py | # train and evaluation functions for hierarchical LSTM model
import glob
import os
import tensorflow as tf
tf.compat.v1.disable_v2_behavior()
import time
import core.model as model
import core.util as util
import movieqa.data_conf as data_conf
import movieqa.conf_lstm as model_conf
import numpy as np
from tensorflow... | 18,358 | 43.132212 | 120 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/data_conf.py | # global initial configuration for the dataset paths for the models
# preprocessing options
P_MAX_WORD_PER_SENT_COUNT = 100
Q_MAX_WORD_PER_SENT_COUNT = 50
P_MAX_SENT_COUNT = 101
# model config
EMBEDDING_SIZE = 300
MODEL_NAME = 'model'
# path settings
DATA_PATH = "data"
RECORD_DIR = "records_new"
TRAIN_RECORD_PATH = ... | 1,023 | 29.117647 | 86 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/conf_lstm.py | # hierarchical CLSTM training config
# model config
HIDDEN_SIZE = 150
# train config
INITIAL_LEARNING_RATE = 0.0025
BATCH_SIZE = 30
MAX_STEPS = 50000
DROPOUT_RATE = 0.0
LOSS_FUNC = 'entropy'
OPTIMIZER = "adam"
NUM_EPOCHS = 1
| 227 | 15.285714 | 36 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/get_validation_labels.py | import sys
from modify_movieqa import read_qa_json
qas = read_qa_json('data/data/qa.json', split='val')
labels = [qa.correct_index for qa in qas]
f = open("evaluation_file.txt", "x")
counter = 0
for l in labels:
f.write("test:" + str(counter) + " " + int(l))
counter = counter + 1
f.close()
| 300 | 24.083333 | 52 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/run_cnn.py | # train and evaluation functions for hierarchical CNN model
import glob
import os
import tensorflow as tf
tf.compat.v1.disable_v2_behavior()
import time
import core.model as model
import core.util as util
import movieqa.data_conf as data_conf
import movieqa.conf_cnn as model_conf
from random import randrange
from ran... | 20,000 | 43.25 | 144 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/run_adversarial_white_box.py | # word-level and sentence-level white-box adversarial attack for hierarchical CNN and RNN-LSTM model
import glob
import os
import sys
import tensorflow as tf
import core.model as model
import core.util as util
import movieqa.data_conf as data_conf
from random import randrange
from random import shuffle
import numpy ... | 22,121 | 40.897727 | 144 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/run_cnn_word_level.py | # original baseline for movieqa without sentence attention, may be not up to date
import glob
import os
import tensorflow as tf
tf.compat.v1.disable_v2_behavior()
import core.model as model
import core.util as util
import movieqa.data_conf as data_conf
import movieqa.conf_cnn_word_level as model_conf
import numpy a... | 12,860 | 39.316614 | 115 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/convert_movieqa_to_python3.py | import os
import re
def read_lines(fname):
with open(fname, "r") as f:
return f.readlines()
def write_lines(lines, fname):
with open(fname, "w") as f:
for line in lines:
f.write(line)
def convert_print_statements(py2_lines):
py3_lines = []
for py2_line in py2_lines:
... | 1,571 | 24.770492 | 77 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/preprocess.py | # prepare word embeddings, records and vocabulary
import sys
import os
import numpy as np
import tensorflow as tf
import _pickle as pickle
present_path = os.path.dirname(os.path.realpath(sys.argv[0]))
sys.path.append(os.path.join(present_path, '../'))
import core.util as util
import movieqa.data_conf as data_conf
if... | 7,931 | 33.637555 | 106 | py |
fat-albert | fat-albert-master/abmn/src/movieqa/data/data/data_loader.py | """MovieQA - Story Understanding Benchmark.
Data loader for reading movies and multiple-choice QAs
http://movieqa.cs.toronto.edu/
Release: v1.0
Date: 18 Nov 2015
"""
from collections import namedtuple
import json
import config as cfg
import story_loader
TextSource = namedtuple('TextSource', 'plot dvs subtitle sc... | 6,504 | 32.188776 | 95 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.