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 |
|---|---|---|---|---|---|---|
gunyah-hypervisor-develop | gunyah-hypervisor-develop/tools/build/__init__.py | 0 | 0 | 0 | py | |
gunyah-hypervisor-develop | gunyah-hypervisor-develop/tools/build/gen_ver.py | #!/usr/bin/env python3
# coding: utf-8
#
# © 2021 Qualcomm Innovation Center, Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
import argparse
import subprocess
import sys
from datetime import datetime
from genfile import GenFile
def main():
args = argparse.ArgumentParser()
args.add_argu... | 2,389 | 31.297297 | 78 | py |
EmpTransfo | EmpTransfo-master/train_full.py | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import ... | 15,365 | 59.496063 | 183 | py |
EmpTransfo | EmpTransfo-master/evaluate.py | # # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import random
from argparse import ArgumentParser
from itertools import chain
from pprint import pforma... | 8,472 | 42.229592 | 156 | py |
EmpTransfo | EmpTransfo-master/utils.py | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import json
import logging
import os
import tarfile
import tempfile
import re
import torch
from pytorch_pretrained_bert ... | 8,740 | 37.676991 | 124 | py |
EmpTransfo | EmpTransfo-master/train_emotion_recognition.py | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import ... | 16,552 | 56.675958 | 183 | py |
EmpTransfo | EmpTransfo-master/interact.py | # # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import random
from argparse import ArgumentParser
from itertools import chain
from pprint import pforma... | 6,871 | 41.419753 | 151 | py |
EmpTransfo | EmpTransfo-master/config.py | import json
class Config:
def __init__(self,
dataset_path="",
dataset_cache="",
model_checkpoint="",
num_candidates=2,
do_lower_case=True,
max_history=2,
train_batch_size=4,
val... | 3,331 | 29.290909 | 70 | py |
EmpTransfo | EmpTransfo-master/train.py | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import ... | 14,215 | 58.233333 | 183 | py |
EmpTransfo | EmpTransfo-master/train_multihead.py | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import ... | 17,664 | 55.800643 | 174 | py |
EmpTransfo | EmpTransfo-master/eval_emotion_recognition.py | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
import logging
from pprint import pformat
from collections import defaultdict
from itertools import chain
import torch
from... | 11,203 | 52.607656 | 182 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/optimization.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | 13,028 | 42 | 139 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/optimization_openai.py | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 5,517 | 42.109375 | 134 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/__main__.py | # coding: utf8
def main():
import sys
if (len(sys.argv) != 4 and len(sys.argv) != 5) or sys.argv[1] not in [
"convert_tf_checkpoint_to_pytorch",
"convert_openai_checkpoint",
"convert_transfo_xl_checkpoint",
"convert_gpt2_checkpoint",
]:
print(
"Should be used ... | 4,393 | 51.309524 | 145 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/convert_gpt2_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 3,017 | 40.342466 | 111 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/convert_openai_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 3,106 | 41.561644 | 118 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/tokenization.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | 18,169 | 40.770115 | 135 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/modeling.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 85,247 | 51.524954 | 187 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/modeling_gpt2.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | 38,587 | 45.944039 | 146 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/modeling_openai.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | 53,002 | 47.626606 | 186 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/convert_transfo_xl_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 5,671 | 47.478632 | 121 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/file_utils.py | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import sys
import json
import logging
import os
impor... | 9,347 | 32.385714 | 98 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,593 | 37.716418 | 101 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/__init__.py | __version__ = "0.6.2"
from .tokenization import BertTokenizer, BasicTokenizer, WordpieceTokenizer
from .tokenization_openai import OpenAIGPTTokenizer
from .tokenization_transfo_xl import (TransfoXLTokenizer, TransfoXLCorpus)
from .tokenization_gpt2 import GPT2Tokenizer
from .modeling import (BertConfig, BertModel, Ber... | 1,498 | 54.518519 | 124 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/tokenization_gpt2.py | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 13,902 | 43.560897 | 116 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/modeling_transfo_xl.py | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 59,065 | 41.40201 | 131 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/tokenization_transfo_xl.py | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 22,060 | 36.582624 | 110 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/tokenization_openai.py | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 13,922 | 43.340764 | 129 | py |
EmpTransfo | EmpTransfo-master/pytorch_pretrained_bert/modeling_transfo_xl_utilities.py | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 16,108 | 38.972705 | 132 | py |
potapov_interpolation | potapov_interpolation-master/setup.py | from setuptools import setup
setup(name='Potapov_interpolation',
version='0.1',
description='Treating feedback with delays in quantum systems',
url='https://github.com/tabakg/potapov_interpolation/',
author='Gil Tabak',
author_email='tabak.gil@gmail.com',
license='GNU',
packages=['Potapov_C... | 555 | 25.47619 | 67 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/Roots.py | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 28 20:15:35 2015
@author: gil
@title: Rootfinder
Find the roots of a function f in the complex plane inside of a rectangular region.
We implement the method in the following paper:
Delves, L. M., and J. N. Lyness. "A numerical method for locating the zeros of
an analy... | 16,077 | 31.220441 | 91 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/phase_matching.py | import sympy as sp
import numpy as np
import scipy.constants
from sympy.utilities.autowrap import ufuncify
from scipy import interpolate
import scipy.constants as consts
import matplotlib.pyplot as plt
from functions import timeit
from functions import make_dict_values_to_lists_of_inputs
import itertools
@timeit
def s... | 6,774 | 37.714286 | 111 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/Time_Sims_nonlin.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 31 2015
@author: gil
@title: Time_Sims_Nonlin.py
"""
import Roots
import Potapov
import Time_Delay_Network
import functions
import Hamiltonian
import numpy as np
import numpy.linalg as la
import sympy as sp
import itertools
import matplotlib.pyplot as plt
from scipy.in... | 4,036 | 29.816794 | 135 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/functions.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 13:59:30 2015
@author: Gil Tabak
@title: Potapov
Functions used by other files.
"""
import numpy as np
import numpy.linalg as la
import scipy.constants as consts
from fractions import gcd
import time
import math
def make_dict_values_to_lists_of_inputs(values,inputs... | 14,913 | 30.006237 | 109 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/Time_Delay_Network.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 17:37:37 2015
@author: gil
@title: examples
"""
import Roots
import Potapov
import numpy as np
import numpy.linalg as la
from numpy import pi
from colorsys import hls_to_rgb
import sympy as sp
import matplotlib.pyplot as plt
#import mpmath as mp ## for complex-valued ... | 37,357 | 32.385165 | 108 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/Hamiltonian.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 31 2015
@author: gil
@title: Hamiltonian.py
"""
import Roots
import Potapov
import Time_Delay_Network
import functions
import phase_matching
import phase_matching_hash
import numpy as np
import numpy.linalg as la
import sympy as sp
import scipy.constants as consts
from ... | 33,044 | 38.527512 | 142 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/__init__.py | import Roots
import Potapov
import Time_Delay_Network
import Time_Sims
import functions
import tests
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
def contour_plot(Mat):
fig = plt.figure()
ax = fig.add_subplot(111)
cax = ax.matshow(abs(Mat), interpolation='nearest')
fig.... | 745 | 18.631579 | 76 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/Potapov.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 13:59:30 2015
@author: Gil Tabak
@title: Potapov
The code in this file implements the procedure for finding Blaschke-Potapov
products to approximate given functions near poles.
Please see section 6.2 in our manuscript for details: http://arxiv.org/abs/1510.08942
(to ... | 8,231 | 27.28866 | 85 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/Time_Sims.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 15:52:32 2015
@author: gil
@title: Time_Sims
"""
#example for using ODE library
from scipy.integrate import ode
import numpy as np
import matplotlib.pyplot as plt
import Time_Delay_Network
import Potapov
def time_sim(Example, omega = 0., t1=150, dt=0.05, freq=None,
... | 3,668 | 29.831933 | 78 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/phase_matching_hash.py | import sympy as sp
import numpy as np
import scipy.constants
from sympy.utilities.autowrap import ufuncify
from scipy import interpolate
import matplotlib.pyplot as plt
from functions import timeit
from functions import make_dict_values_to_lists_of_inputs
def generate_k_func_4wv(pols=(-1,-1,-1,-1), n_symb = None):
... | 6,627 | 31.019324 | 91 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_Hamiltonian_dict.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 4,177 | 32.693548 | 99 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_commensurate_root.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 1,218 | 26.088889 | 82 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_phase_matching.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 3,821 | 31.389831 | 115 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_time_perturbations.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 4,649 | 34.769231 | 91 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_Hamiltonian.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 3,371 | 33.762887 | 87 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_Time_Delay_Network.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 1,887 | 23.205128 | 63 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/__init__.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 380 | 21.411765 | 33 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_Potapov.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 1,120 | 28.5 | 95 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_Roots.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.const... | 5,024 | 28.733728 | 127 | py |
potapov_interpolation | potapov_interpolation-master/Potapov_Code/tests/tests_phase_matching_hash.py | from .. import Potapov
from .. import Roots
from .. import Time_Delay_Network
from .. import functions
from .. import Time_Sims_nonlin
from .. import Hamiltonian
from .. import phase_matching_hash
import numpy.testing as testing
import numpy as np
import numpy.linalg as la
from scipy.integrate import ode
import scipy.... | 2,465 | 31.88 | 120 | py |
potapov_interpolation | potapov_interpolation-master/docs/conf.py | # -*- coding: utf-8 -*-
#
# Potapov_interpolation documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 25 15:36:39 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerat... | 10,438 | 30.923547 | 85 | py |
gnn_cff | gnn_cff-main/graphconv.py | """Torch modules for graph convolutions(GCN)."""
# pylint: disable= no-member, arguments-differ, invalid-name
import torch as th
from torch import nn
from torch.nn import init
from .... import function as fn
from ....base import DGLError
from ....utils import expand_as_pair
from ....transform import reverse
from ....c... | 30,598 | 40.072483 | 102 | py |
gnn_cff | gnn_cff-main/models/gcn.py | import numpy as np
from dgl.nn.pytorch import GraphConv
import dgl
import torch
# class GCNGraphNew(torch.nn.Module):
# def __init__(self, in_feats, h_feats):
# super(GCNGraphNew, self).__init__()
# self.conv1 = GraphConv(in_feats, h_feats)
# self.conv2 = GraphConv(h_feats, h_feats)
# ... | 4,777 | 36.622047 | 112 | py |
gnn_cff | gnn_cff-main/models/explainer_models.py | from re import S
import numpy as np
import torch
import math
import tqdm
import sys
import matplotlib.pyplot as plt
import networkx as nx
from utils.common_utils import mutag_dgl_to_networkx, get_mutag_color_dict, ba_shapes_dgl_to_networkx
class GraphExplainerEdge(torch.nn.Module):
def __init__(self, base_model, ... | 27,933 | 40.079412 | 142 | py |
gnn_cff | gnn_cff-main/scripts/exp_node_tree_cycles.py | import os
import numpy as np
import torch
from utils.argument import arg_parse_exp_node_tree_cycles
from models.explainer_models import NodeExplainerEdgeMulti
from models.gcn import GCNNodeTreeCycles
from utils.preprocessing.tree_cycles_preprocessing import TreeCyclesDataset
import sys
if __name__ == "__main__":
... | 1,650 | 35.688889 | 116 | py |
gnn_cff | gnn_cff-main/scripts/exp_node_ba_shapes.py | import os
import numpy as np
import torch
from utils.argument import arg_parse_exp_node_ba_shapes
from models.explainer_models import NodeExplainerEdgeMulti
from models.gcn import GCNNodeBAShapes
from utils.preprocessing.ba_shapes_preprocessing import BAShapesDataset
import sys
if __name__ == "__main__":
torch.ma... | 1,646 | 37.302326 | 116 | py |
gnn_cff | gnn_cff-main/scripts/train_graph_classification.py | import numpy as np
import torch
import os
import time
from pathlib import Path
from models.gcn import GCNGraph
from utils.argument import arg_parse_train_graph_mutag_0
from utils.graph_init import graph_init_real
from torch.utils.data.sampler import SubsetRandomSampler
from dgl.dataloading import GraphDataLoader
def ... | 3,833 | 39.787234 | 117 | py |
gnn_cff | gnn_cff-main/scripts/exp_graph.py | import os
import numpy as np
import torch
from utils.argument import arg_parse_exp_graph_mutag_0
from models.explainer_models import GraphExplainerEdge
from models.gcn import GCNGraph
from utils.preprocessing.mutag_preprocessing_0 import MutagDataset0
import sys
if __name__ == "__main__":
np.set_printoptions(thre... | 1,428 | 32.232558 | 96 | py |
gnn_cff | gnn_cff-main/scripts/train_node_classification.py | import numpy as np
import torch
import os
import time
from pathlib import Path
from models.gcn import GCNNodeBAShapes
from utils.argument import arg_parse_train_node_ba_shapes
from utils.graph_init import graph_init_real
from torch.utils.data.sampler import SubsetRandomSampler
from dgl.dataloading import GraphDataLoade... | 4,554 | 38.95614 | 104 | py |
gnn_cff | gnn_cff-main/utils/graph_init.py | import numpy as np
def graph_init_real(dataset):
if dataset == "Mutagenicity_0":
from utils.preprocessing.mutag_preprocessing_0 import mutag_preprocessing_0
G_dataset = mutag_preprocessing_0(dataset_dir="datasets/Mutagenicity_0")
elif dataset == "NCI1":
from utils.preprocessing.nci1_pr... | 1,117 | 47.608696 | 91 | py |
gnn_cff | gnn_cff-main/utils/argument.py | import argparse
def arg_parse_train_graph_mutag_0():
parser = argparse.ArgumentParser()
parser.add_argument("--dataset", dest="dataset", type=str, default="Mutagenicity_0",
help="choose a graph classification task")
parser.add_argument("--gpu", dest="gpu", action="store_false", hel... | 8,301 | 71.191304 | 121 | py |
gnn_cff | gnn_cff-main/utils/common_utils.py | import numpy as np
import networkx as nx
def mutag_dgl_to_networkx(dgl_G):
component_dict = {0: 'C', 1: 'O', 2: 'Cl', 3: 'H', 4: 'N', 5: 'F', 6: 'Br', 7: 'S',
8: 'P', 9: 'I', 10: 'Na', 11: 'K', 12: 'Li', 13: 'Ca'}
nodes = dgl_G.nodes().numpy()
edges = np.array(list(zip(dgl_G.edges()[... | 3,366 | 35.204301 | 108 | py |
gnn_cff | gnn_cff-main/utils/preprocessing/ba_shapes_preprocessing.py | """Read the Mutag dataset and create the graphx"""
import numpy as np
import os
import dgl
from dgl.data import DGLDataset
import torch
import networkx as nx
import matplotlib.pyplot as plt
from dgl import save_graphs, load_graphs
from utils.common_utils import read_file
from utils.common_utils import ba_shapes_dgl_to... | 5,366 | 37.335714 | 109 | py |
gnn_cff | gnn_cff-main/utils/preprocessing/mutag_preprocessing_0.py | """Read the Mutag dataset and create the graphx"""
import numpy as np
import os
import dgl
from dgl.data import DGLDataset
import torch
from dgl import save_graphs, load_graphs
from utils.common_utils import read_file
class MutagDataset0(DGLDataset):
def __init__(self, edges=None, graph_indicator=None, node_labe... | 5,400 | 41.865079 | 128 | py |
gnn_cff | gnn_cff-main/utils/preprocessing/tree_cycles_preprocessing.py | """Read the Mutag dataset and create the graphx"""
import numpy as np
import os
import dgl
from dgl.data import DGLDataset
import torch
import networkx as nx
import matplotlib.pyplot as plt
from dgl import save_graphs, load_graphs
from utils.common_utils import read_file
from utils.common_utils import ba_shapes_dgl_to... | 5,903 | 36.367089 | 109 | py |
gnn_cff | gnn_cff-main/utils/preprocessing/citeseer_preprocessing.py | """Read the Mutag dataset and create the graphx"""
import numpy as np
import os
import dgl
from dgl.data import DGLDataset
import torch
import networkx as nx
import matplotlib.pyplot as plt
from dgl import save_graphs, load_graphs
from utils.common_utils import read_file_citeseer
from utils.common_utils import ba_shap... | 5,767 | 34.170732 | 109 | py |
gnn_cff | gnn_cff-main/utils/preprocessing/nci1_preprocessing.py | """Read the Mutag dataset and create the graphx"""
import numpy as np
import os
import dgl
from dgl.data import DGLDataset
import torch
from dgl import save_graphs, load_graphs
from utils.common_utils import read_file
class NCI1Dataset(DGLDataset):
def __init__(self, edges=None, graph_indicator=None, node_labels... | 4,663 | 41.4 | 112 | py |
hifi-gan | hifi-gan-master/inference.py | from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import argparse
import json
import torch
from scipy.io.wavfile import write
from env import AttrDict
from meldataset import mel_spectrogram, MAX_WAV_VALUE, load_wav
from models import Generator
h = None
device = N... | 2,652 | 26.635417 | 107 | py |
hifi-gan | hifi-gan-master/inference_e2e.py | from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import numpy as np
import argparse
import json
import torch
from scipy.io.wavfile import write
from env import AttrDict
from meldataset import MAX_WAV_VALUE
from models import Generator
h = None
device = None
de... | 2,444 | 25.868132 | 105 | py |
hifi-gan | hifi-gan-master/meldataset.py | import math
import os
import random
import torch
import torch.utils.data
import numpy as np
from librosa.util import normalize
from scipy.io.wavfile import read
from librosa.filters import mel as librosa_mel_fn
MAX_WAV_VALUE = 32768.0
def load_wav(full_path):
sampling_rate, data = read(full_path)
return data... | 6,314 | 36.366864 | 115 | py |
hifi-gan | hifi-gan-master/utils.py | import glob
import os
import matplotlib
import torch
from torch.nn.utils import weight_norm
matplotlib.use("Agg")
import matplotlib.pylab as plt
def plot_spectrogram(spectrogram):
fig, ax = plt.subplots(figsize=(10, 2))
im = ax.imshow(spectrogram, aspect="auto", origin="lower",
interpolatio... | 1,377 | 22.355932 | 63 | py |
hifi-gan | hifi-gan-master/models.py | import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d
from torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm
from utils import init_weights, get_padding
LRELU_SLOPE = 0.1
class ResBlock1(torch.nn.Module):
def __init__... | 9,905 | 33.880282 | 107 | py |
hifi-gan | hifi-gan-master/train.py | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import itertools
import os
import time
import argparse
import json
import torch
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DistributedSampler, DataLoader
import torch.multip... | 12,153 | 43.683824 | 123 | py |
hifi-gan | hifi-gan-master/env.py | import os
import shutil
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def build_env(config, config_name, path):
t_path = os.path.join(path, config_name)
if config != t_path:
os.makedirs(path, exist_... | 394 | 23.6875 | 64 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/clang-format/clang-format-diff.py | #!/usr/bin/env python
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------... | 4,454 | 35.516393 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/clang-format/clang-format-sublime.py | # This file is a minimal clang-format sublime-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Put this file into your sublime Packages directory, e.g. on Linux:
# ~/.config/sublime-text-2/Packages/User/clang-format-sublime.py
# - Add a key binding:
# { "keys": ["... | 2,440 | 40.372881 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/clang-format/clang-format.py | # This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
#
# The first line enables clang-fo... | 4,222 | 35.094017 | 82 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-view/share/ScanView.py | import BaseHTTPServer
import SimpleHTTPServer
import os
import sys
import urllib, urlparse
import posixpath
import StringIO
import re
import shutil
import threading
import time
import socket
import itertools
import Reporter
import ConfigParser
###
# Various patterns matched or replaced by server.
kReportFileRE = re.... | 25,495 | 32.197917 | 154 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-view/share/startfile.py | """Utility for opening a file using the default application in a cross-platform
manner. Modified from http://code.activestate.com/recipes/511443/.
"""
__version__ = '1.1x'
__all__ = ['open']
import os
import sys
import webbrowser
import subprocess
_controllers = {}
_open = None
class BaseController(object):
''... | 5,991 | 28.372549 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-view/share/Reporter.py | """Methods for reporting bugs."""
import subprocess, sys, os
__all__ = ['ReportFailure', 'BugReport', 'getReporters']
#
class ReportFailure(Exception):
"""Generic exception for failures in bug reporting."""
def __init__(self, value):
self.value = value
# Collect information about a bug.
cl... | 8,153 | 31.746988 | 105 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libear/__init__.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module compiles the intercept library. """
import sys
import os
import os.path
import re
import tempfile
import shuti... | 8,405 | 31.206897 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/__init__.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import unittest
import tests.unit
import tests.functional.cases
def suite():
loader = unittest.TestLoader()
suite =... | 489 | 24.789474 | 71 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_libear.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear as sut
import unittest
import os.path
class TemporaryDirectoryTest(unittest.TestCase):
def test_creates_di... | 964 | 30.129032 | 71 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_compilation.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libscanbuild.compilation as sut
import unittest
class CompilerTest(unittest.TestCase):
def test_is_compiler_call... | 5,144 | 40.829268 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_analyze.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libscanbuild.analyze as sut
| 229 | 27.75 | 71 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_clang.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
import libscanbuild.clang as sut
import unittest
import os.path
import sys
class ClangGetVersion(unittest.Test... | 3,287 | 33.610526 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_intercept.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
import libscanbuild.intercept as sut
import unittest
import os.path
class InterceptUtilTest(unittest.TestCase)... | 3,694 | 36.323232 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_runner.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
import libscanbuild.runner as sut
import unittest
import re
import os
import os.path
class FilteringFlagsTest(... | 12,015 | 36.201238 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/__init__.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
from . import test_libear
from . import test_compilation
from . import test_clang
from . import test_runner
from . import test... | 949 | 34.185185 | 71 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_report.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
import libscanbuild.report as sut
import unittest
import os
import os.path
def run_bug_parse(content):
wit... | 6,173 | 37.111111 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/unit/test_shell.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libscanbuild.shell as sut
import unittest
class ShellTest(unittest.TestCase):
def test_encode_decode_are_same(se... | 1,502 | 33.953488 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/functional/__init__.py | 0 | 0 | 0 | py | |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/functional/cases/test_create_cdb.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
from . import make_args, silent_check_call, silent_call, create_empty_file
import unittest
import os.path
impor... | 7,754 | 39.390625 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/functional/cases/test_from_cdb.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
from . import call_and_report
import unittest
import os.path
import string
import glob
def prepare_cdb(name, ... | 7,382 | 39.344262 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/functional/cases/test_exec_anatomy.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
import unittest
import os.path
import subprocess
import json
def run(source_dir, target_dir):
def execute... | 1,595 | 30.294118 | 75 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/functional/cases/test_from_cmd.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libear
from . import make_args, check_call_and_report, create_empty_file
import unittest
import os
import os.path
impo... | 4,701 | 38.512605 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/tests/functional/cases/__init__.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import re
import os.path
import subprocess
def load_tests(loader, suite, pattern):
from . import test_from_cdb
suite... | 2,273 | 30.583333 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/clang.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module is responsible for the Clang executable.
Since Clang command line interface is so rich, but this project is us... | 5,577 | 34.303797 | 77 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/intercept.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module is responsible to capture the compiler invocation of any
build process. The result of that should be a compilat... | 13,164 | 37.720588 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/shell.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module implements basic shell escaping/unescaping methods. """
import re
import shlex
__all__ = ['encode', 'decode']... | 2,157 | 31.208955 | 79 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.