index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
65,564 | wubozhi/itc-testing-tools | refs/heads/master | /python/cppcheck.py | import sys
import os.path
import system
import dirutils
import tempfile
import xml.etree.ElementTree as ET
import shutil
from pathlib import Path
xml_report_path = os.path.abspath(sys.argv[1])
temp_path = os.path.abspath(sys.argv[2])
directory = os.path.abspath(sys.argv[3])
csv = os.path.abspat... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,565 | wubozhi/itc-testing-tools | refs/heads/master | /benchmark.py | import sys
import os.path
import os
import python.system
import python.clanalyze
import python.latex
rep_directory = os.path.realpath(sys.argv[1])
print("Results dir:", rep_directory, "\n")
# ## Location of ITC workbench: this should be modified by need
W_C_DEFECTS_DIR = "../itc-benchmarks/01.w_Defects/"
W_CPP_DEFEC... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,566 | wubozhi/itc-testing-tools | refs/heads/master | /python/system.py |
import shlex
from subprocess import Popen, PIPE
import time
# simply run a system command and return the needed info
def system_call(cmd, dir="."):
print("[CMD]:", cmd)
vtime = time.time();
process = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE, cwd=dir)
(output, err) = process.communicate()
... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,567 | wubozhi/itc-testing-tools | refs/heads/master | /python/statistics.py | import sys
import os
from collections import defaultdict
from math import sqrt
# input files
merged_csv_filename=sys.argv[1]
tool_filename_w_defects=sys.argv[2]
tool_filename_wo_defects=sys.argv[3]
tool_out_subdefects=sys.argv[4]
tool_out_defects=sys.argv[5]
tool_out_total=sys.argv[6]
# handle list of tools to detect... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,568 | wubozhi/itc-testing-tools | refs/heads/master | /python/flawfinder.py | import sys
import os.path
import system
import dirutils
import tempfile
import shutil
from pathlib import Path
temp_path = os.path.abspath(sys.argv[1])
directory = os.path.abspath(sys.argv[2])
csv = os.path.abspath(sys.argv[3])
exe = sys.argv[4]
# create temporary dir to run the analyzer
tmpdir_path = os.... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,569 | wubozhi/itc-testing-tools | refs/heads/master | /python/clang++.py | import sys
import os.path
import system
import dirutils
import tempfile
import platform
import shutil
import re
from pathlib import Path
temp_path = os.path.abspath(sys.argv[1])
directory = os.path.abspath(sys.argv[2])
csv = os.path.abspath(sys.argv[3])
exe = sys.argv[4]
opts = sys.argv[5]
def detect... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,570 | wubozhi/itc-testing-tools | refs/heads/master | /python/infer.py | import json
import sys
import os.path
import system
import shutil
import tempfile
import dirutils
from pathlib import Path
temp_path = os.path.abspath(sys.argv[1])
directory = os.path.abspath(sys.argv[2])
csv = os.path.abspath(sys.argv[3])
exe = sys.argv[4]
# create temporary dir to run the analyzer
tmpdi... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,571 | wubozhi/itc-testing-tools | refs/heads/master | /python/uno.py | import sys
import os.path
import system
import dirutils
import tempfile
from itertools import takewhile
import shutil
from pathlib import Path
temp_path = os.path.abspath(sys.argv[1])
directory = os.path.abspath(sys.argv[2])
csv = os.path.abspath(sys.argv[3])
exe = sys.argv[4]
if (len(sys.argv) > 5):
o... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,618 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/preprocessing.py | import pandas as pd
import math
import numpy as np
import random as rand
from recordclass import recordclass
from statsmodels import robust
class PreprocessedData:
def __init__(self, voltammogram_data, muLabels, window_size=1500, trainingSampleSize=500,corr_over=False):
if corr_over:
print("C... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,619 | amnahEltahir/voltammetry | refs/heads/main | /misc/run_calibration_imped.py | import voltammetry
import sys
import matplotlib.pyplot as plt
import numpy as np
import random as rand
plt.style.use('ggplot')
plt.rcParams['axes.facecolor'] = [1, 1, 1]
plt.rcParams['axes.edgecolor'] = 'k'
random_seed = 0
rand.seed(random_seed)
abfpath = sys.argv[1]
vg = voltammetry.Data(abfpath)
labels = voltammetr... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,620 | amnahEltahir/voltammetry | refs/heads/main | /misc/plot_vgram_ave.py | import voltammetry
import sys
import matplotlib.pyplot as plt
import numpy as np
abfpath = sys.argv[1]
vg = voltammetry.Data(abfpath)
labels = voltammetry.Mulabels(abfpath, 'run.csv')
data = voltammetry.PreprocessedData(vg.Voltammogram, labels, trainingSampleSize=125)
testing_vgram_rms = np.sqrt((data.testing.vgrams *... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,621 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/__init__.py | from __future__ import absolute_import
import sys
from .abfConvert import *
from .LabelData import *
from .preprocessing import *
from .calibrate import *
from .save_output import *
sys.path.append(os.path.join(os.path.dirname(__file__)))
| {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,622 | amnahEltahir/voltammetry | refs/heads/main | /misc/loocv.py | import voltammetry
import sys
import matplotlib.pyplot as plt
import numpy as np
abfpath = sys.argv[1]
loc = sys.argv[2]
vg = voltammetry.Data(abfpath)
labels = voltammetry.Mulabels(abfpath, 'run.csv')
data = voltammetry.PreprocessedData(vg.Voltammogram, labels, trainingSampleSize=125, window_size=1500)
data.training... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,623 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/calibrate.py | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from recordclass import recordclass
import scipy.io
import random as rand
import time
from glmnet_python import cvglmnet, cvglmnetPredict
from joblib import Parallel, delayed
def best_alpha(training, nAlpha... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,624 | amnahEltahir/voltammetry | refs/heads/main | /misc/split_channels.py | import os
import pyabf
import glob
import sys
import h5py
import numpy as np
abf_path = sys.argv[1] # path of directory containing abf data files
replace_str = sys.argv[2] # path of substring to be replaced in file name
ch1 = sys.argv[3] # first channel name
ch2 = sys.argv[4] # second channel name
out_path = os.pat... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,625 | amnahEltahir/voltammetry | refs/heads/main | /misc/run_calibration_10percent.py | import voltammetry
import sys
import matplotlib.pyplot as plt
import numpy as np
import h5py
plt.style.use('ggplot')
plt.rcParams['axes.facecolor']=[1,1,1]
plt.rcParams['axes.edgecolor']='k'
abfpath = sys.argv[1]
vg = voltammetry.Data(abfpath)
labels = voltammetry.Mulabels(abfpath, 'run.csv')
idx = np.loadtxt('/Users/... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,626 | amnahEltahir/voltammetry | refs/heads/main | /misc/run_calibration.py | import voltammetry
import sys
import matplotlib.pyplot as plt
import numpy as np
import h5py
plt.style.use('ggplot')
plt.rcParams['axes.facecolor']=[1,1,1]
plt.rcParams['axes.edgecolor']='k'
abfpath = sys.argv[1]
vg = voltammetry.Data(abfpath)
labels = voltammetry.Mulabels(abfpath, 'run.csv')
data = voltammetry.Prepro... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,627 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/LabelData.py | import pandas as pd
import numpy as np
class Mulabels:
"""
Concentration labels according to their order in the sequence
"""
def __init__(self, data_dir, label_file_name):
"""
Initialize MuLabels class
:param data_dir: string, directory containing label file
:param lab... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,628 | amnahEltahir/voltammetry | refs/heads/main | /misc/split_directories_2.py | import os
import sys
import glob
from shutil import copyfile
# Check that this is the right type of directory to split
path = sys.argv[1]
if ("YYY" not in path) | (not os.path.isdir(path)):
print("Not a valid directory!!!")
exit(1)
# Get relevant information about the path for making directories
data_parent =... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,629 | amnahEltahir/voltammetry | refs/heads/main | /misc/split_directories.py | import os
import sys
import glob
from shutil import copyfile
# Check that this is the right type of directory to split
path = sys.argv[1]
replace_str = sys.argv[2] # path of substring to be replaced in file name
f1 = sys.argv[3] # first channel name
f2 = sys.argv[4] # second channel name
if (replace_str not in path) ... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,630 | amnahEltahir/voltammetry | refs/heads/main | /misc/calc_impedance.py | import os
import voltammetry
import sys
import numpy as np
abfpath = sys.argv[1]
abfname = os.path.basename(os.path.split(abfpath)[0])
if os.path.isdir(abfpath):
pass
else:
print('Not a valid path!!!')
exit(1)
vg = voltammetry.Data(abfpath)
len_measure = 1500
sweep_start = int(np.ceil(vg.sweep_point_coun... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,631 | amnahEltahir/voltammetry | refs/heads/main | /misc/select_idx.py | import voltammetry
import sys
import numpy as np
import matplotlib.pyplot as plt
import h5py
abfpath = sys.argv[1]
vg = voltammetry.Data(abfpath)
labels = voltammetry.Mulabels(abfpath, 'run.csv')
idx =np.where((labels.labels['5HT']==0) | (labels.labels['DA'] == 0))
labels.labels = labels.labels.iloc[idx]
data = volta... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,632 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/abfConvert.py | import os
import glob
import pyabf
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cmx
import h5py
import matplotlib as mpl
import shutil
from numpy.core.multiarray import ndarray
import matplotlib.colors as colors
class Data:
"""
Experimental data taken from directory of abf files.... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,633 | amnahEltahir/voltammetry | refs/heads/main | /misc/plot_total_results.py | import h5py
import matplotlib.pyplot as plt
import numpy as np
import sys
from matplotlib.gridspec import GridSpec
import glob
plt.style.use('ggplot')
plt.rcParams.update({'font.size': 24})
concentrations = np.arange(0,2750,50)
results_glob = sorted(glob.glob("2019*.h5"))
num_datafiles=len(results_glob)
SNR=[]
RMSE=[]... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,634 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/save_output.py | import pickle
import os
from collections import Iterable
import numpy as np
from voltammetry import calcStepStats
import scipy.io as sio
def save_model(prefix, cvFit, predictions, data, labels, out_dir="OUT"):
"""
:param prefix: str - prefix of hdr, mat and pkl files generated for model
:param cvFit: fit ... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,635 | amnahEltahir/voltammetry | refs/heads/main | /misc/save_results_for_figs.py | import voltammetry
import sys
import h5py
import os
import glmnet_python
from glmnet_python import cvglmnetCoef
import numpy as np
abfpath = sys.argv[1]
abf_name = os.path.basename(abfpath)
out_dir = os.path.split(abfpath)[0]
vg = voltammetry.Data(abfpath)
labels = voltammetry.Mulabels(abfpath, 'run.csv')
#idx =np.... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,636 | amnahEltahir/voltammetry | refs/heads/main | /misc/mk1Dresults.py | import h5py
import matplotlib.pyplot as plt
import numpy as np
import sys
from matplotlib.gridspec import GridSpec
plt.style.use('ggplot')
data_file = sys.argv[1]
data = h5py.File(data_file)
num_samples = data['predictions'].shape[0]
X = np.arange(num_samples)
Y = data['predictions']
L = np.array(data['actual'])
tar... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,637 | amnahEltahir/voltammetry | refs/heads/main | /voltammetry/setup.py | from setuptools import setup
setup(name="voltammetry",
version="0.0.1",
author="AmnahEltahir"
) | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,638 | amnahEltahir/voltammetry | refs/heads/main | /misc/split_directories_3.py | import os
import sys
import glob
from shutil import copyfile
# Check that this is the right type of directory to split
path = sys.argv[1]
if ("YYY" not in path) | (not os.path.isdir(path)):
print("Not a valid directory!!!")
exit(1)
# Get relevant information about the path for making directories
data_parent =... | {"/misc/run_calibration_imped.py": ["/voltammetry/__init__.py"], "/misc/plot_vgram_ave.py": ["/voltammetry/__init__.py"], "/voltammetry/__init__.py": ["/voltammetry/abfConvert.py", "/voltammetry/LabelData.py", "/voltammetry/preprocessing.py", "/voltammetry/calibrate.py", "/voltammetry/save_output.py"], "/misc/loocv.py"... |
65,639 | carlsunderman/graph-builder | refs/heads/master | /main.py | import json
import random
import os
import networkx as nx
from io import BytesIO
import base64
import matplotlib.pyplot as plt
from flask import Flask, request, render_template, redirect, url_for, session
import graph as g
app = Flask(__name__)
app.secret_key = os.urandom(24)
def getSessionGraph():
return nx.adja... | {"/main.py": ["/graph.py"], "/tests/test_complement.py": ["/graph.py"], "/tests/test_add.py": ["/graph.py"], "/tests/test_toggleEdge.py": ["/graph.py"], "/tests/test_remove.py": ["/graph.py"]} |
65,640 | carlsunderman/graph-builder | refs/heads/master | /graph.py | def add(graph):
for i in range(len(graph.nodes)+1):
if i not in graph.nodes:
graph.add_node(i)
break
def remove(graph,node):
if graph.has_node(node):
graph.remove_node(node)
def toggle(graph,edge):
if len(edge) != 2 or edge[0] == edge[1]: return
if graph.has_edge(edge[0],edge[1]):
graph.remove_edge(... | {"/main.py": ["/graph.py"], "/tests/test_complement.py": ["/graph.py"], "/tests/test_add.py": ["/graph.py"], "/tests/test_toggleEdge.py": ["/graph.py"], "/tests/test_remove.py": ["/graph.py"]} |
65,641 | carlsunderman/graph-builder | refs/heads/master | /tests/test_complement.py | import networkx as nx
import graph
simpleGraph = {
0: [1,2],
1: [0,3,4],
2: [0],
3: [1,4],
4: [1,3]
}
edgelessGraph = {
0: [],
1: [],
2: []
}
def makeGraph(edgeList):
return nx.Graph(edgeList)
def sortedPairList(pairList):
return sorted([tuple(sorted(pair)) for pair in pairList])
def test_populated():
n... | {"/main.py": ["/graph.py"], "/tests/test_complement.py": ["/graph.py"], "/tests/test_add.py": ["/graph.py"], "/tests/test_toggleEdge.py": ["/graph.py"], "/tests/test_remove.py": ["/graph.py"]} |
65,642 | carlsunderman/graph-builder | refs/heads/master | /tests/test_add.py | import networkx as nx
import graph
simpleGraph = {
0: [1,2],
1: [0,3,4],
2: [0],
3: [1,4],
4: [1,3]
}
def makeGraph(edgeList):
return nx.Graph(edgeList)
def test_populated():
name = 'populated'
g = makeGraph(simpleGraph)
want = [0,1,2,3,4,5]
graph.add(g)
assert list(g.nodes) == want, name
def test_empt... | {"/main.py": ["/graph.py"], "/tests/test_complement.py": ["/graph.py"], "/tests/test_add.py": ["/graph.py"], "/tests/test_toggleEdge.py": ["/graph.py"], "/tests/test_remove.py": ["/graph.py"]} |
65,643 | carlsunderman/graph-builder | refs/heads/master | /tests/test_toggleEdge.py | import networkx as nx
import graph
simpleGraph = {
0: [1,2],
1: [0,3,4],
2: [0],
3: [1,4],
4: [1,3]
}
def makeGraph(edgeList):
return nx.Graph(edgeList)
def sortedPairList(pairList):
return sorted([tuple(sorted(pair)) for pair in pairList])
def test_populated():
name = 'populated'
g = makeGraph(simpleGraph... | {"/main.py": ["/graph.py"], "/tests/test_complement.py": ["/graph.py"], "/tests/test_add.py": ["/graph.py"], "/tests/test_toggleEdge.py": ["/graph.py"], "/tests/test_remove.py": ["/graph.py"]} |
65,644 | carlsunderman/graph-builder | refs/heads/master | /tests/test_remove.py | import networkx as nx
import graph
simpleGraph = {
0: [1,2],
1: [0,3,4],
2: [0],
3: [1,4],
4: [1,3]
}
def makeGraph(edgeList):
return nx.Graph(edgeList)
def test_populated():
name = 'populated'
g = makeGraph(simpleGraph)
want = [0,1,2,4]
graph.remove(g,3)
assert list(g.nodes) == want, name
def test_emp... | {"/main.py": ["/graph.py"], "/tests/test_complement.py": ["/graph.py"], "/tests/test_add.py": ["/graph.py"], "/tests/test_toggleEdge.py": ["/graph.py"], "/tests/test_remove.py": ["/graph.py"]} |
65,723 | ngouzy/smartchangelog | refs/heads/master | /tests/integration/__init__.py | import os
import shutil
import tempfile
import pytest
from smartchangelog.gitcmd import git_command
@pytest.fixture(scope='function')
def temp_dir():
temporary_directory = tempfile.mkdtemp()
old_cwd = os.getcwd()
os.chdir(temporary_directory)
git_command('init')
git_command('config', 'user.name... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,724 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/commit.py | import re
from datetime import datetime
from typing import NamedTuple, cast
from smartchangelog import datetools
from smartchangelog.commitmsg import CommitType, CommitMsg, CommitSyntaxError
class _Commit(NamedTuple):
id: str
author: str
date: datetime
type: CommitType = None
scope: str = None
... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,725 | ngouzy/smartchangelog | refs/heads/master | /setup.py | from setuptools import setup, find_packages
from codecs import open
from os import path
from smartchangelog import __version__
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
name, description = long_description.split('\n')[0... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,726 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/datetools.py | from datetime import datetime
date_format = "%Y-%m-%d %H:%M:%S %z"
def str2date(string: str) -> datetime:
return datetime.strptime(string, date_format)
def date2str(dt: datetime) -> str:
return dt.strftime(date_format) | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,727 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/__init__.py | __version__ = '0.1.3-dev'
| {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,728 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/test_commit.py | from smartchangelog import datetools
from smartchangelog.commit import Commit
from smartchangelog.commitmsg import CommitType
from tests.unit import data_file_path
class TestCommit:
def test_parse(self):
# GIVEN
with open(data_file_path('one.gitlog'), encoding='utf-8') as log_file:
log... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,729 | ngouzy/smartchangelog | refs/heads/master | /tests/integration/test_githook.py | import os
import shutil
import pytest
from smartchangelog import githook
# noinspection PyUnresolvedReferences
from tests.integration import hook_path, temp_dir
@pytest.mark.usefixtures("temp_dir")
def test_githook_install():
# GIVEN
# WHEN
commitmsg_hook_path = githook.install()
# THEN
assert o... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,730 | ngouzy/smartchangelog | refs/heads/master | /tests/integration/test_changelog_script.py | import inspect
import pytest
import smartchangelog
from smartchangelog.scripts import changelog_script
from smartchangelog.tools import set_args
from smartchangelog.gitcmd import tag
"""Path of the file containing changelog_script.py file"""
changelog_script_path = inspect.getfile(changelog_script)
def test_range_... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,731 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/test_changelog.py | from smartchangelog import datetools
from smartchangelog.changelog import Changelog, Node
from smartchangelog.commit import Commit
from smartchangelog.commitmsg import CommitType
from tests.unit import data_file_path
class TestChangelog:
def test_parse(self):
# GIVEN
with open(data_file_path('big.... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,732 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/__init__.py | import inspect
import os
def data_dir_path() -> str:
return os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
def data_file_path(filename: str) -> str:
return os.path.join(data_dir_path(), 'data', filename)
| {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,733 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/tools.py | import inspect
import os
import sys
from contextlib import contextmanager
from io import StringIO
from typing import Iterator, TextIO, cast
from smartchangelog.scripts import commitmsg_script
"""Path of the file containing commitmsg_script.py file"""
commitmsg_script_path = inspect.getfile(commitmsg_script)
@conte... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,734 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/changelog.py | import re
from collections import Iterable
from io import StringIO
from itertools import groupby
from typing import List, Tuple, Callable, Any, IO, cast
from smartchangelog import datetools
from smartchangelog.commit import Commit
class Node:
def __init__(self, name: str = None, criterion: property = None, chil... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,735 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/test_static_types_check.py | import inspect
from smartchangelog import commitmsg
from mypy import api
from smartchangelog import changelog
def test_static_type_check_with_mypy():
commitmsg_file = inspect.getfile(commitmsg)
changelog_file = inspect.getfile(changelog)
params = ['--ignore-missing-imports', commitmsg_file, changelog_fi... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,736 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/githook.py | import os
import shutil
git_path = os.path.join('.git')
hooks_path = os.path.join(git_path, 'hooks')
commitmsg_hook_path = os.path.join(hooks_path, 'commit-msg')
def install():
check_git_path()
if not os.path.isdir(hooks_path):
os.makedirs(hooks_path, mode=0o755, exist_ok=True)
uninstall()
c... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,737 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/scripts/changelog_script.py | import argparse
from smartchangelog.gitcmd import log
from smartchangelog import __version__
from smartchangelog.changelog import Changelog
from smartchangelog.commit import Commit
def main() -> None:
parser = argparse.ArgumentParser(description="Smart changelog report",
form... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,738 | ngouzy/smartchangelog | refs/heads/master | /tests/integration/test_commitmsg_script.py | import pytest
import smartchangelog.scripts.commitmsg_script
from smartchangelog.tools import set_args, set_commit_editmsg, commitmsg_script_path
from smartchangelog import githook
# noinspection PyUnresolvedReferences
from tests.integration import temp_dir
def test_help_arg():
# GIVEN
with set_args(commitms... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,739 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/scripts/commitmsg_script.py | #!/usr/bin/env python3
"""
Git commit hook:
.git/hooks/commit-msg
"""
import argparse
from smartchangelog.commitmsg import CommitMsg, CommitSyntaxError
from smartchangelog import __version__
from smartchangelog.githook import install, uninstall
def main() -> None:
parser = argparse.ArgumentParser(description="... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,740 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/commitmsg.py | import inspect
import re
from enum import Enum
from typing import NamedTuple, Optional, Any
class CommitSyntaxError(Exception):
"""
Invalid commit syntax error
"""
class CommitType(Enum):
feat = 'new feature for the user, not a new feature for build script'
fix = 'bug fix for the user, not a fi... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,741 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/test_commitmsg.py | import pytest
from smartchangelog.commitmsg import CommitMsg, CommitSyntaxError, CommitType
class TestCommitMsg:
class TestParseFirstLine:
def test_with_type_and_scope_and_subject(self):
# GIVEN
firstline = "feat(ui main): add button"
# WHEN
parsed_firstlin... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,742 | ngouzy/smartchangelog | refs/heads/master | /smartchangelog/gitcmd.py | import subprocess
import os
from typing import cast, List
class GitCmdError(Exception):
"""
Git command error
"""
def git_command(*git_args: str) -> str:
args = ['git'] + cast(List[str], list(git_args))
cp = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if cp.returnco... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,743 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/test_datetools.py | from datetime import datetime, timezone, timedelta
from smartchangelog import datetools
def test_str2date():
# GIVEN
expected = datetime(
year=2017,
month=3,
day=21,
hour=16,
minute=9,
second=13,
tzinfo=timezone(timedelta(hours=1))
)
string = '2... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,744 | ngouzy/smartchangelog | refs/heads/master | /tests/integration/test_gitusage.py | import os
import shutil
import tempfile
import pytest
from smartchangelog import githook
from smartchangelog.gitcmd import git_command, GitCmdError
# noinspection PyUnresolvedReferences
from tests.integration import temp_dir
@pytest.fixture(scope='function')
def add_sample_file(temp_dir):
temporary_directory = ... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,745 | ngouzy/smartchangelog | refs/heads/master | /tests/unit/test_gitcmd.py | import os
import pytest
from smartchangelog.gitcmd import GitCmdError, is_inside_work_tree, get_gitdir, tag
from tests.unit import data_dir_path
@pytest.fixture(scope='function')
def cmd():
old_cmd = os.getcwd()
yield None
os.chdir(old_cmd)
@pytest.mark.usefixtures('cmd')
def test_is_inside_work_tree_o... | {"/tests/integration/__init__.py": ["/smartchangelog/gitcmd.py"], "/smartchangelog/commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commitmsg.py"], "/setup.py": ["/smartchangelog/__init__.py"], "/tests/unit/test_commit.py": ["/smartchangelog/__init__.py", "/smartchangelog/commit.py", "/smartchangelog/commit... |
65,746 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/migrations/0005_auto_20201219_1312.py | # Generated by Django 3.1.4 on 2020-12-19 04:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0001_initial'),
('user', '0004_auto_20201217_1957'),
]
operations = [
migrations.AlterFi... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,747 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /board/views.py | import json
from django.http import JsonResponse
from django.views import View
from django.core.exceptions import ValidationError
from .models import Review, Question
from user.utils import signin_decorator
class ReviewView(View):
@signin_decorator
def post(self, request):
tr... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,748 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /board/migrations/0002_auto_20201217_1745.py | # Generated by Django 3.1.4 on 2020-12-17 08:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('board', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='review',
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,749 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /product/migrations/0002_auto_20201217_2010.py | # Generated by Django 3.1.4 on 2020-12-17 11:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='product',
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,750 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/migrations/0004_remove_oftenbuying_quantity.py | # Generated by Django 3.1.4 on 2020-12-21 01:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0003_auto_20201217_1756'),
]
operations = [
migrations.RemoveField(
model_name='oftenbuying',
name='quantity',
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,751 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/migrations/0001_initial.py | # Generated by Django 3.1.4 on 2020-12-16 11:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Gender',
fields=[
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,752 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /board/urls.py | from django.urls import path
from .views import QuestionView, QuestionListView
from .views import ReviewView, ReviewListView
urlpatterns = [
path('/question', QuestionView.as_view()),
path('/question/<int:question_id>', QuestionView.as_view()),
path('/question/product/<int:product_id>', QuestionList... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,753 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json, jwt
from django.http import JsonResponse
from django.core.exceptions import ObjectDoesNotExist
from my_settings import SECRET_KEY, ALGORITHM
from .models import User
def signin_decorator(func):
def wrapper(s... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,754 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /order/migrations/0001_initial.py | # Generated by Django 3.1.4 on 2020-12-16 11:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('product', '0001_initial'),
('user', '0001_initial'),
]
operations = [
migration... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,755 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/urls.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.urls import path
from .views import SignupView, SigninView
urlpatterns = [
path('/signup', SignupView.as_view()),
path('/signin', SigninView.as_view()),
]
| {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,756 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /product/urls.py | from django.urls import path
from product.views import (
ProductDetailView,
ProductListView,
MdChoiceView,
CategoryView,
)
urlpatterns = [
path('', ProductListView.as_view()),
path('/<int:product_id>', ProductDetailView.as_view()),
path('/md-choice', MdChoiceView.as_view()),
pat... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,757 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /product/views.py | import json
from django.http import JsonResponse
from django.views import View
from .models import Category, Subcategory, Product
class ProductDetailView(View):
def get(self, request, product_id):
try:
product = Product.objects.select_related('discount', 'delivery_type... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,758 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /product/migrations/0001_initial.py | # Generated by Django 3.1.4 on 2020-12-16 11:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,759 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /product/models.py | from django.db import models
class Category(models.Model):
name = models.CharField(max_length=45)
class Meta:
db_table = 'categories'
class Subcategory(models.Model):
name = models.CharField(max_length=45)
category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,760 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/migrations/0002_auto_20201217_1745.py | # Generated by Django 3.1.4 on 2020-12-17 08:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0001_initial'),
('user', '0001_initial'),
]
operations = [
migrations.AlterField(
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,761 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/models.py | from django.db import models
from product.models import Product
class User(models.Model):
account = models.CharField(max_length=45, unique=True)
password = models.CharField(max_length=2000)
name = models.CharField(max_length=45)
email = models.... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,762 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/views.py | import json, bcrypt, jwt
import re
from django.views import View
from django.http import JsonResponse
from django.db import transaction
from .models import User, Gender, Grade, TermsAndCondition, Address
from my_settings import SECRET_KEY, ALGORITHM
from datetime import datetime, timedelta
f... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,763 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/migrations/0006_merge_20201222_1547.py | # Generated by Django 3.1.4 on 2020-12-22 06:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user', '0005_auto_20201219_1312'),
('user', '0004_remove_oftenbuying_quantity'),
]
operations = [
]
| {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,764 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /board/migrations/0001_initial.py | # Generated by Django 3.1.4 on 2020-12-16 11:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('product', '0001_initial'),
('user', '0001_initial'),
]
operations = [
migration... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,765 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /product/migrations/0003_detailedimage_productdescription.py | # Generated by Django 3.1.4 on 2020-12-19 05:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0002_auto_20201217_2010'),
]
operations = [
migrations.CreateModel(
name='DetailedIm... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,766 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /board/models.py | from django.db import models
from user.models import User
from product.models import Product
class Review(models.Model):
author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
product = models.ForeignKey(Product, on_delete=models.SET_NULL, null=True)
title ... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,767 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /order/migrations/0002_auto_20201217_1745.py | # Generated by Django 3.1.4 on 2020-12-17 08:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0001_initial'),
('order', '0001_initial'),
]
operations = [
migrations.AddField(
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,768 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /user/migrations/0004_auto_20201217_1957.py | # Generated by Django 3.1.4 on 2020-12-17 10:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('user', '0003_auto_20201217_1756'),
]
operations = [
migrations.RemoveField(
model_name='user',
... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,769 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /order/views.py | import json
from datetime import datetime
from django.http import JsonResponse
from django.views import View
from django.db import transaction
from order.models import Cart, Order
from user.models import Address, OftenBuying, User
from product.models import Product
from user.utils import signin_decorator... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,770 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /order/models.py | from django.db import models
class Order(models.Model):
user = models.ForeignKey("user.User", on_delete=models.PROTECT)
order_number = models.CharField(max_length=45)
status = models.ForeignKey("OrderStatus", on_delete=models.PROTECT)
address = models.ForeignKey("user.Addres... | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,771 | wecode-bootcamp-korea/15-1st-MarketBully-backend | refs/heads/master | /order/urls.py | from django.urls import path
from .views import CartView, OftenBuyingView
urlpatterns = [
path('/cart', CartView.as_view()),
path('/often_buying', OftenBuyingView.as_view()),
] | {"/board/views.py": ["/board/models.py", "/user/utils.py"], "/board/urls.py": ["/board/views.py"], "/user/utils.py": ["/user/models.py"], "/user/urls.py": ["/user/views.py"], "/product/urls.py": ["/product/views.py"], "/product/views.py": ["/product/models.py"], "/user/models.py": ["/product/models.py"], "/user/views.p... |
65,805 | ajayiezekiel/linuxjobber | refs/heads/master | /ajayiezekiel9000scrumy/urls.py | from django.urls import path
from ajayiezekiel9000scrumy import views
urlpatterns= [
path('', views.get_grading_parameters, name="get_grading_parameters"),
path('movegoal/<int:goal_id>', views.move_goal, name="movegoal" ),
path('addgoal/', views.add_goal, name="addgoal"),
path('home/', views.home, name... | {"/ajayiezekiel9000scrumy/views.py": ["/ajayiezekiel9000scrumy/models.py"]} |
65,806 | ajayiezekiel/linuxjobber | refs/heads/master | /ajayiezekiel9000scrumy/migrations/0002_auto_20200515_2252.py | # Generated by Django 3.0.6 on 2020-05-15 21:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ajayiezekiel9000scrumy', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='goalstatus',
name='sta... | {"/ajayiezekiel9000scrumy/views.py": ["/ajayiezekiel9000scrumy/models.py"]} |
65,807 | ajayiezekiel/linuxjobber | refs/heads/master | /django-ajayiezekiel9000scrumy/ajayiezekiel9000scrumy/urls.py | from django.urls import path
from ajayiezekiel9000scrumy import views
urlpatterns= [
path('', views.get_grading_parameters, name="get_grading_parameters")
] | {"/ajayiezekiel9000scrumy/views.py": ["/ajayiezekiel9000scrumy/models.py"]} |
65,808 | ajayiezekiel/linuxjobber | refs/heads/master | /django-ajayiezekiel9000scrumy/ajayiezekiel9000scrumy/views.py | from django.http import HttpResponse
def get_grading_parameters(request):
return HttpResponse("Welcome to Django") | {"/ajayiezekiel9000scrumy/views.py": ["/ajayiezekiel9000scrumy/models.py"]} |
65,809 | ajayiezekiel/linuxjobber | refs/heads/master | /ajayiezekiel9000scrumy/views.py | from django.http import HttpResponse
from django.shortcuts import render
from django.contrib.auth.models import User
from .models import GoalStatus, ScrumyGoals, ScrumyHistory
import random
def get_grading_parameters(request):
goal = ScrumyGoals.objects.get(pk=1)
return HttpResponse(goal)
def move_goal(requ... | {"/ajayiezekiel9000scrumy/views.py": ["/ajayiezekiel9000scrumy/models.py"]} |
65,810 | ajayiezekiel/linuxjobber | refs/heads/master | /ajayiezekiel9000scrumy/models.py | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class GoalStatus(models.Model):
status_name = models.CharField(max_length = 150)
def __str__(self):
return self.status_name
class ScrumyGoals(models.Model):
goal_name = mo... | {"/ajayiezekiel9000scrumy/views.py": ["/ajayiezekiel9000scrumy/models.py"]} |
65,813 | luoheng/TCssrbm | refs/heads/master | /CrossCorrelation.py | import numpy
class CrossCorrelation(object):
def __init__(self, test_image, samples, window_size, seed=98987, n_patches_of_samples=0):
"""
self.test_image = numpy.asarray((test_image - test_image.min()) / \
(test_image.max() - test_image.min() + 1e-6)) ... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,814 | luoheng/TCssrbm | refs/heads/master | /test_CrossCorrelation.py | import numpy
import theano
from CrossCorrelation import CrossCorrelation
floatX=theano.config.floatX
arrayX = lambda X : numpy.asarray(X, dtype=floatX)
def rand(shp, dtype=floatX):
return numpy.random.rand(*shp).astype(dtype)
test_image_shp = (1,4,4)
n_sample=2
n_patches_of_samples=1
samples_shp = (n_sample,n_pa... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,815 | luoheng/TCssrbm | refs/heads/master | /test_NCC.py | from CrossCorrelation import NCC
import numpy
test_img = numpy.random.randn(2,2)
inpaited_img = numpy.random.randn(2,2)
print | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,816 | luoheng/TCssrbm | refs/heads/master | /tests/test_unshared_conv_diagonally.py | import sys
import unittest
import pdb
import numpy
import theano
from theano.tests.unittest_tools import verify_grad
from unshared_conv_diagonally import FilterActs
from unshared_conv_diagonally import WeightActs
from unshared_conv_diagonally import ImgActs
def rand(shp, dtype):
# return numpy.ones(shp, dtype=d... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,817 | luoheng/TCssrbm | refs/heads/master | /TCrbm.py | """
This file extends the mu-ssRBM for tiled-convolutional training
"""
import cPickle, pickle
import numpy
numpy.seterr('warn') #SHOULD NOT BE IN LIBIMPORT
from PIL import Image
import theano
from theano import tensor
from theano.tensor import nnet,grad
from pylearn.io import image_tiling
from pylearn.a... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,818 | luoheng/TCssrbm | refs/heads/master | /Brodatz_p.py | import theano
import numpy
from PIL import Image
from protocol_ import TensorFnDataset
floatX=theano.config.floatX
def Brodatz_op(s_idx, filename, patch_shape=(1,98,98), noise_concelling=100, seed=3322, batchdata_size=64, rescale=1.0, validation=False):
"""Return symbolic Brodatz_images[s_idx]
If s_idx is a ... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,819 | luoheng/TCssrbm | refs/heads/master | /unshared_conv_diagonally.py | """
XXX
"""
import pdb
import numpy
import theano
import StringIO
from theano.tensor import blas
from theano import gof, tensor, scalar
def any_symbolic(*args):
"""
Return True iff any a in `args` is a theano Variable
"""
for a in args:
if isinstance(a, theano.Variable):
return Tr... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,820 | luoheng/TCssrbm | refs/heads/master | /test_Brodatz.py | import theano
from Brodatz import Brodatz_op, Brodatz
import numpy
from PIL import Image
from TCssrbm import tile_conv_weights
s_idx=theano.tensor.lscalar()
batch_range =s_idx*128 + numpy.arange(128)
n_examples = 16
n_img_channels = 1
n_img_rows = 98
n_img_cols = 98
batch_x = Brodatz_op(batch_range,
... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,821 | luoheng/TCssrbm | refs/heads/master | /TCssDBN_filter_bias.py | """
This file implements the binary convolutional ssRBM as a second layer in DBN
"""
import cPickle, pickle
import numpy
numpy.seterr('warn') #SHOULD NOT BE IN LIBIMPORT
from PIL import Image
import theano
from theano import tensor
from theano.tensor import nnet,grad
from theano.tensor.nnet.conv import co... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
65,822 | luoheng/TCssrbm | refs/heads/master | /Draw_pics.py | import numpy
from PIL import Image
def most_square_shape(N):
"""rectangle (height, width) with area N that is closest to sqaure
"""
for i in xrange(int(numpy.sqrt(N)),0, -1):
if 0 == N % i:
return (i, N/i)
def tile_conv_weights(w,flip=False, scale_each=False):
"""
Return some... | {"/test_NCC.py": ["/CrossCorrelation.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.