repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
intel/intel-iot-refkit | meta-iotqa/lib/oeqa/runtime/connectivity/wifi/wifi_stability.py | 6 | 1229 | import time
import os
import string
from oeqa.runtime.wifi import wifi
try:
import ConfigParser
except:
import configparser as ConfigParser
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import shell_cmd_timeout
ssid_config = ConfigParser.ConfigParser()
config_path = os.path.join(os.path.dirname(__file... | mit | 08d398a9d3550b53e271bdb017fd2a83 | 24.604167 | 73 | 0.606998 | 3.852665 | false | true | false | false |
mwouts/jupytext | tests/test_preserve_empty_cells.py | 1 | 1065 | import pytest
from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook
import jupytext
from jupytext.compare import compare, compare_notebooks
@pytest.mark.parametrize("blank_lines", range(1, 6))
def test_file_with_blank_lines(blank_lines):
py_script = """# Markdown cell{0}
# Another one{0}
... | mit | c7cbd859a5faa84202b49e0dfcdf62c1 | 30.323529 | 77 | 0.660094 | 3.237082 | false | true | false | false |
mwouts/jupytext | jupytext/cli.py | 1 | 43968 | """`jupytext` as a command line tool"""
import argparse
import glob
import json
import os
import re
import shlex
import subprocess
import sys
import warnings
from copy import copy
from tempfile import NamedTemporaryFile
from .combine import combine_inputs_with_outputs
from .compare import NotebookDifference, compare,... | mit | c0d1dac6b1bc3789868885137d92dcb9 | 34.429492 | 114 | 0.563637 | 4.13039 | false | false | false | false |
mwouts/jupytext | tests/utils.py | 1 | 4583 | import itertools
import json
import re
import sys
from pathlib import Path
import pytest
from jupyter_client.kernelspec import find_kernel_specs, get_kernel_spec
from jupytext.cell_reader import rst2md
from jupytext.cli import system
from jupytext.myst import is_myst_available
from jupytext.pandoc import is_pandoc_av... | mit | e339a99961859808eaa71eba1b432c73 | 32.698529 | 98 | 0.667903 | 3.301873 | false | true | false | false |
mwouts/jupytext | tests/test_active_cells.py | 1 | 7938 | import pytest
from nbformat import NotebookNode
import jupytext
from jupytext.compare import compare, compare_cells
HEADER = {
".py": """# ---
# jupyter:
# jupytext:
# main_language: python
# ---
""",
".R": """# ---
# jupyter:
# jupytext:
# main_language: python
# ---
""",
".md": """---
jupy... | mit | 7de47d390e23afd1bda55fc5e2cd80f1 | 24.361022 | 87 | 0.579239 | 2.900256 | false | true | false | false |
mwouts/jupytext | tests/notebooks/mirror/ipynb_to_script_vscode_folding_markers/World population.py | 1 | 2735 | # ---
# jupyter:
# jupytext:
# cell_markers: region,endregion
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # A quick insight at world population
#
# ## Collecting population data
#
# In the below we retrieve population data from the
# [World Bank](http://www.wor... | mit | a2d30e51a82f6e468cd45c7c973d5aa7 | 27.789474 | 78 | 0.684095 | 3.19883 | false | false | false | false |
pureqml/qmlcore | test/lit/formats/shtest.py | 13 | 1055 | from __future__ import absolute_import
import lit.TestRunner
import lit.util
from .base import FileBasedTest
class ShTest(FileBasedTest):
"""ShTest is a format with one file per test.
This is the primary format for regression tests as described in the LLVM
testing guide:
http://llvm.org/docs/T... | mit | f1f10cec07c6551a5d22010c81daa126 | 34.166667 | 79 | 0.627488 | 4.83945 | false | true | false | false |
pureqml/qmlcore | compiler/__init__.py | 1 | 10722 | from __future__ import print_function
from future import standard_library
from future.utils import PY2
standard_library.install_aliases()
from builtins import object, str
import compiler.doc.json
import compiler.grammar
import compiler.grammar2
import compiler.manifest
from compiler.manifest import merge_properties
im... | mit | c6629fd5e0e47e1e6a542ab6c0fd3158 | 29.373938 | 265 | 0.665641 | 3.136005 | false | false | false | false |
acq4/acq4 | acq4/drivers/xkeys/pie.py | 3 | 18467 | # sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
# import acq4.util.clibrary as clib
from __future__ import print_function
import os, sys, struct, ctypes, ctypes.wintypes, time, threading, platform
import numpy as np
if platform.architecture()[0] != '64bit':
raise Exception("32-bit PIE... | mit | b36d897be81fc920141dc655c59d5210 | 35.424063 | 182 | 0.591054 | 3.53165 | false | false | false | false |
acq4/acq4 | acq4/drivers/Scientifica/scientifica.py | 3 | 19323 | """
Driver for communicating with Scientifica motorized devices by serial interface.
"""
from __future__ import print_function
from __future__ import division
import serial, struct, time, collections, re
import numpy as np
from acq4.util.Mutex import RecursiveMutex as RLock
from acq4.util.debug import printExc
from ..... | mit | 19a9ad2f069b3dcf3b09d557b6ef5922 | 39.006211 | 149 | 0.583088 | 3.848437 | false | false | false | false |
acq4/acq4 | acq4/analysis/modules/MapImager/MapImager.py | 3 | 8749 | from __future__ import print_function
from acq4.util import Qt
import os
from acq4.analysis.AnalysisModule import AnalysisModule
from collections import OrderedDict
import pyqtgraph as pg
from pyqtgraph.metaarray import MetaArray
import numpy as np
import scipy
import acq4.util.functions as fn
from acq4.util.HelpfulExc... | mit | 638829b4911bd7aa31e1e022a663e5e0 | 43.642857 | 188 | 0.592068 | 3.874668 | false | false | false | false |
acq4/acq4 | acq4/devices/Screen.py | 3 | 4187 | from __future__ import print_function
from acq4.devices.Device import Device, DeviceTask, TaskGui
from acq4.util import Qt
from six.moves import range
class Screen(Device):
"""
Device used for screen output.
Currently, this is only used to blank the screen temporarily to avoid
contaminating sen... | mit | 5792c39f0f3d973798d8b8a0c13d5982 | 29.569343 | 91 | 0.5861 | 4.100881 | false | false | false | false |
acq4/acq4 | acq4/util/flowchart/EventDetection.py | 3 | 16553 | # -*- coding: utf-8 -*-
from __future__ import print_function
from pyqtgraph.flowchart.library.common import CtrlNode, PlottingCtrlNode
from pyqtgraph.graphicsItems.InfiniteLine import InfiniteLine
import numpy as np
import acq4.util.functions as functions
from six.moves import range
class Threshold(CtrlNode):
""... | mit | 6ca27276a9ae38690d0143faae32ec5e | 46.159544 | 323 | 0.569625 | 3.590672 | false | false | false | false |
acq4/acq4 | acq4/analysis/modules/MapImager/MapConvolver.py | 3 | 10010 | from __future__ import print_function
import numpy as np
import scipy
import pyqtgraph as pg
from acq4.analysis.tools import functions as afn
from acq4.util import Qt
Ui_Form = Qt.importTemplate('.MapConvolverTemplate')
class MapConvolver(Qt.QWidget):
sigOutputChanged = Qt.Signal(object, object)
sigFi... | mit | 9c76da80f462725d75a6d8560d058ccf | 38.56917 | 182 | 0.586513 | 4.146645 | false | false | false | false |
acq4/acq4 | acq4/modules/MultiPatch/tests/test_logfile.py | 4 | 1831 | from __future__ import print_function
import numpy as np
from acq4.modules.MultiPatch.logfile import MultiPatchLog, IrregularTimeSeries
def test_timeseries_index():
ts1 = [
(10, 0.5),
(12, 13.4),
(29.8, 5),
(29.8, 5.5),
(29.9, 6),
(30.0, 7),
(30.1, 8),
... | mit | d1f68161476d05bd66676a4fe83893e1 | 25.171429 | 78 | 0.413981 | 3.234982 | false | false | false | false |
acq4/acq4 | acq4/devices/NiDAQ/resample_test.py | 3 | 4804 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import time
import numpy as np
from pyqtgraph import PlotWindow
from six.moves import zip
sys.path.append('../../util')
sys.path.append('../..')
from .nidaq import NiDAQ
from pyqtgraph.functions import mkPen, mkColor
pw = PlotWindow()
time.... | mit | f93282c4d87fc0b99fb64429b7131d33 | 35.120301 | 179 | 0.591174 | 2.909752 | false | false | false | false |
acq4/acq4 | acq4/util/generator/SeqParamSet.py | 3 | 7028 | from __future__ import print_function
import pyqtgraph.units as units
from pyqtgraph.parametertree.parameterTypes import SimpleParameter, GroupParameter
import pyqtgraph as pg
import numpy as np
import acq4.util.functions as fn
import sys, collections
class SequenceParamSet(GroupParameter):
## top-level parameter... | mit | be1314a8e10c0d0978129cbc3e322134 | 35.604167 | 109 | 0.498577 | 4.3925 | false | false | false | false |
acq4/acq4 | acq4/analysis/modules/Photostim/DBCtrl.py | 3 | 15152 | # -*- coding: utf-8 -*-
from __future__ import print_function
from acq4.util import Qt
from collections import OrderedDict
from .Map import Map
import acq4.util.DatabaseGui as DatabaseGui
from acq4.Manager import logMsg, logExc
import pyqtgraph as pg
import os
Ui_Form = Qt.importTemplate('.MapCtrlTemplate')
class DB... | mit | 17192ca88eee57cde98c8cbab1199285 | 35.078571 | 186 | 0.575172 | 3.980037 | false | false | false | false |
acq4/acq4 | acq4/modules/TaskRunner/analysisModules/__init__.py | 3 | 1466 | from __future__ import print_function
import os
from acq4.analysis.AnalysisModule import AnalysisModule
mdir = os.path.split(__file__)[0]
MODULES = []
for f in os.listdir(mdir):
if os.path.isdir(os.path.join(mdir, f)):
MODULES.append(f)
elif f.endswith('.py'):
f = os.path.splitext(f)[0]
... | mit | 2989df5364bb32dadfb982a8004f6f5d | 30.191489 | 87 | 0.612551 | 4.129577 | false | false | false | false |
acq4/acq4 | acq4/drivers/Scientifica/test.py | 4 | 1976 | from __future__ import print_function
import sys, os, time, logging
#logging.basicConfig(level=logging.DEBUG)
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from acq4.drivers.Scientifica import Scientifica
if len(sys.argv) < 2:
print("Usage: python -i test.py com4 [9600|38400]\n ... | mit | 11fd094255cfa8900e92810a8604ee71 | 29.4 | 92 | 0.607287 | 2.60686 | false | false | false | false |
acq4/acq4 | acq4/util/imaging/bg_subtract_ctrl.py | 3 | 4254 | from __future__ import print_function
import scipy.ndimage
import numpy as np
from acq4.util import Qt
import pyqtgraph as pg
Ui_Form = Qt.importTemplate('.bg_subtract_template')
class BgSubtractCtrl(Qt.QWidget):
"""Widget for controlling background subtraction for live imaging.
Provides:
* background c... | mit | f62119c66763a73634581a828559b78f | 35.672414 | 106 | 0.621063 | 4.05916 | false | false | false | false |
acq4/acq4 | acq4/devices/Scanner/scan_program/rect.py | 3 | 37384 | # -*- coding: utf8 -*-
from __future__ import print_function
from __future__ import division
import weakref
import numpy as np
from collections import OrderedDict
import pyqtgraph as pg
from acq4.util import Qt
import pyqtgraph.parametertree.parameterTypes as pTypes
from pyqtgraph.parametertree import Parameter, Para... | mit | 2c007c9d78b84d902b0492604ae6df0a | 36.949239 | 158 | 0.56549 | 3.958069 | false | false | false | false |
acq4/acq4 | acq4/analysis/modules/STDPAnalyzer/STDPFileLoader.py | 4 | 2264 | from __future__ import print_function
from acq4.util.FileLoader import FileLoader
from acq4.util import Qt
class STDPFileLoader(FileLoader):
def __init__(self, dataManager, host=None, showFileTree=True):
FileLoader.__init__(self, dataManager, host, showFileTree)
self.ui.loadBtn.setText('Load EPSP... | mit | b9969b7e3d48c9da674d59994b1b5ee3 | 39.446429 | 78 | 0.587014 | 3.985915 | false | false | false | false |
acq4/acq4 | acq4/util/flowchart/Filters.py | 3 | 1916 | # -*- coding: utf-8 -*-
from __future__ import print_function
import acq4.util.functions as functions
from pyqtgraph.flowchart.library.common import CtrlNode
class ExpDeconvolve(CtrlNode):
"""Exponential deconvolution filter."""
nodeName = 'ExpDeconvolve'
uiTemplate = [
('tau', 'spin', {'value': ... | mit | 0c60c9ec753cc28ddcf90887a55fafbc | 36.568627 | 141 | 0.573591 | 3.361404 | false | false | false | false |
acq4/acq4 | acq4/devices/ThorlabsMFC1/MFC1.py | 2 | 7249 | # -*- coding: utf-8 -*-
from __future__ import print_function
from acq4.util import Qt
from ..Stage import Stage, StageInterface, MoveFuture
from acq4.drivers.ThorlabsMFC1 import MFC1 as MFC1_Driver
from acq4.util.Mutex import Mutex
from acq4.util.Thread import Thread
from pyqtgraph import debug
import time
class Chan... | mit | 1f082fe893257b2d9eba21238c868f6b | 30.380952 | 105 | 0.571251 | 3.849708 | false | false | false | false |
acq4/acq4 | acq4/devices/Camera/Camera.py | 1 | 38134 | # -*- coding: utf-8 -*-
from __future__ import print_function, with_statement
import threading
import time
import numpy as np
import pyqtgraph as pg
from pyqtgraph import Vector, SRTTransform3D, MetaArray
from pyqtgraph.debug import Profiler
from pyqtgraph.metaarray import axis
from six.moves import range
import acq... | mit | 39d9f7e68da5fe1ecc7ba29bc870f8b2 | 38.972746 | 161 | 0.584518 | 4.28761 | false | false | false | false |
acq4/acq4 | setup.py | 3 | 7414 | from __future__ import print_function
DESCRIPTION = """\
ACQ4 is a python-based platform for experimental neurophysiology.
It includes support for standard electrophysiology, multiphoton imaging,
scanning laser photostimulation, and many other experimental techniques. ACQ4 is
highly modular and extensible, allowing ... | mit | e884949b3ad3cd25658914b81500ff43 | 36.07 | 109 | 0.607904 | 3.695912 | false | false | false | false |
zalando/patroni | tests/test_config.py | 1 | 6576 | import os
import sys
import unittest
import io
from mock import MagicMock, Mock, patch
from patroni.config import Config, ConfigParseError
from six.moves import builtins
class TestConfig(unittest.TestCase):
@patch('os.path.isfile', Mock(return_value=True))
@patch('json.load', Mock(side_effect=Exception))
... | mit | 8effa2fbd1cbc6eba24c718aabbd42d5 | 44.666667 | 113 | 0.560371 | 3.556517 | false | true | false | false |
zalando/patroni | patroni/psycopg.py | 1 | 1378 | __all__ = ['connect', 'quote_ident', 'quote_literal', 'DatabaseError', 'Error', 'OperationalError', 'ProgrammingError']
_legacy = False
try:
from psycopg2 import __version__
from . import MIN_PSYCOPG2, parse_version
if parse_version(__version__) < MIN_PSYCOPG2:
raise ImportError
from psycopg2 i... | mit | 127419cb47eae97869cb540965bf2a26 | 33.45 | 119 | 0.664006 | 3.937143 | false | false | false | false |
ckan/ckanext-qa | ckanext/qa/lib.py | 1 | 3580 | import os
import json
import re
import logging
from ckan.plugins.toolkit import config
from ckan import plugins as p
from ckanext.qa.tasks import update_package, update
log = logging.getLogger(__name__)
_RESOURCE_FORMAT_SCORES = None
def compat_enqueue(name, fn, queue, args=None):
u'''
Enqueue a backgroun... | mit | d2bc80e085c9af2fd031589416758eb9 | 33.757282 | 82 | 0.599721 | 4.05436 | false | false | false | false |
ckan/ckanext-qa | ckanext/qa/views.py | 1 | 3768 | from flask import Blueprint
import json
import mimetypes
import posixpath
import sys
from ckan.plugins.toolkit import request
from ckanext.archiver.tasks import link_checker, LinkCheckerError
from ckan.lib import helpers as ckan_helpers
from ckan.lib.helpers import parse_rfc_2822_date
if sys.version_info[0] >= 3:
... | mit | 8e9899b0917ef915d7224cf9eba86674 | 29.387097 | 91 | 0.651008 | 3.829268 | false | false | false | false |
ckan/ckanext-qa | ckanext/qa/helpers.py | 1 | 1121 | import copy
from ckan.plugins import toolkit as tk
def qa_openness_stars_resource_html(resource):
qa = resource.get('qa')
if not qa:
return tk.literal('<!-- No qa info for this resource -->')
if not isinstance(qa, dict):
return tk.literal('<!-- QA info was of the wrong type -->')
# Ta... | mit | a1110db97ff4a3e5c3da79fdad02ee69 | 35.16129 | 79 | 0.629795 | 3.6875 | false | false | false | false |
snap-stanford/ogb | examples/nodeproppred/mag/graph_saint.py | 1 | 11450 | from copy import copy
import argparse
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torch.nn import ModuleList, Linear, ParameterDict, Parameter
from torch_sparse import SparseTensor
from torch_geometric.utils import to_undirected
from torch_geometric.data import Data, GraphSAINTRandomWalkSam... | mit | e1031491decae1448a3e8e95d6533d90 | 33.802432 | 79 | 0.604891 | 3.292122 | false | false | false | false |
snap-stanford/ogb | ogb/linkproppred/make_master_file.py | 1 | 6451 | ### script for writing meta information of datasets into master.csv
### for link property prediction datasets.
import pandas as pd
dataset_dict = {}
dataset_list = []
### add meta-information about protein function prediction task
name = 'ogbl-ppa'
dataset_dict[name] = {'eval metric': 'hits@100', 'task type': 'link p... | mit | 94a40dc126f626e6a0fc3a805c79bbef | 50.608 | 131 | 0.722989 | 3.26964 | false | false | false | false |
snap-stanford/ogb | examples/graphproppred/mol/gnn.py | 1 | 2620 | import torch
from torch_geometric.nn import MessagePassing
from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool, GlobalAttention, Set2Set
import torch.nn.functional as F
from torch_geometric.nn.inits import uniform
from conv import GNN_node, GNN_node_Virtualnode
from torch_scatter import ... | mit | 1b0626a6a8d860c874da9f15924d4e71 | 38.119403 | 188 | 0.617939 | 3.433814 | false | false | false | false |
snap-stanford/ogb | examples/linkproppred/ddi/mlp.py | 1 | 7577 | import argparse
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch_geometric.utils import negative_sampling
from ogb.linkproppred import PygLinkPropPredDataset, Evaluator
from logger import Logger
class LinkPredictor(torch.nn.Module):
def __init__(self, in_channels,... | mit | 0299556649641aab68b6f63655f22904 | 35.253589 | 79 | 0.573182 | 3.349691 | false | true | false | false |
snap-stanford/ogb | examples/linkproppred/biokg/dataloader.py | 1 | 5193 | #!/usr/bin/python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
from torch.utils.data import Dataset
class TrainDataset(Dataset):
def __init__(self, triples, nentity, nrelation, negative_sample_size, mode, count, tru... | mit | 13e731987832f7c767c2cbf06109dbe7 | 42.283333 | 137 | 0.60543 | 3.680369 | false | false | false | false |
ianmiell/shutit | shutit_exam.py | 1 | 6068 | from __future__ import print_function
import sys
import time
import signal
class ShutItExamSessionStage(object):
# difficulty - a proportion of the default difficulty=1
# reduction_per_minute - the degree to which success value decreases every minute
# reduction_per_reset - the degree to which a reset a... | mit | a8369602eb13855a60e4531ac52b9dac | 31.623656 | 130 | 0.6353 | 3.046185 | false | false | false | false |
smicallef/spiderfoot | modules/sfp_strangeheaders.py | 1 | 3806 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_strangeheaders
# Purpose: SpiderFoot plug-in for identifying non-standard HTTP headers
# in web server responses.
#
# Author: Steve Micallef <steve@binarypool.com>
#
# Cr... | mit | d735b786bab0e8a3fe3339fef604d88f | 25.802817 | 114 | 0.577246 | 3.83283 | false | false | false | false |
smicallef/spiderfoot | test/unit/modules/test_sfp_malwarepatrol.py | 1 | 1503 | import pytest
import unittest
from modules.sfp_malwarepatrol import sfp_malwarepatrol
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModulemalwarepatrol(unittest.TestCase):
def test_opts(self):
module = sfp_malwarepatrol()
... | mit | 67df5579727446228827f3564fcc7989 | 29.673469 | 81 | 0.675981 | 3.621687 | false | true | false | false |
smicallef/spiderfoot | modules/sfp_cookie.py | 1 | 2320 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_cookie
# Purpose: SpiderFoot plug-in for extracting cookies from HTTP headers.
#
# Author: Steve Micallef <steve@binarypool.com>
#
# Created: 06/04/2014
# Copyright: (c) Steve Mi... | mit | 32eb7ba6d0a806947fa744f48ff2594a | 28.367089 | 104 | 0.568966 | 4.18018 | false | false | false | false |
smicallef/spiderfoot | test/integration/modules/test_sfp_hosting.py | 1 | 2345 | import pytest
import unittest
from modules.sfp_hosting import sfp_hosting
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationHosting(unittest.TestCase):
@unittest.skip("todo")
def test_handleEvent_event_data_ip_address_ho... | mit | 8f647cd38bdf05de33f722a735633bfe | 30.689189 | 88 | 0.632409 | 3.716323 | false | true | false | false |
smicallef/spiderfoot | modules/sfp_countryname.py | 1 | 8208 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_countryname
# Purpose: SpiderFoot plug-in for scanning retrieved content by other
# modules (such as sfp_iban, sfp_phone, sfp_whois) and identifying country names
#
# Author: ... | mit | e9fd54d105991a81a998b79b3fbd6ef3 | 33.779661 | 138 | 0.603801 | 4.177099 | false | false | false | false |
smicallef/spiderfoot | test/unit/modules/test_sfp_jsonwhoiscom.py | 1 | 2505 | import pytest
import unittest
from modules.sfp_jsonwhoiscom import sfp_jsonwhoiscom
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleJsonwhoiscom(unittest.TestCase):
def test_opts(self):
module = sfp_jsonwhoiscom()
sel... | mit | 7f5f99c60fc674a4ced91e11033d368c | 33.791667 | 90 | 0.632735 | 3.72214 | false | true | false | false |
smicallef/spiderfoot | modules/sfp_threatminer.py | 1 | 9341 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_threatminer
# Purpose: Query ThreatMiner.org using their API.
#
# Author: Steve Micallef
#
# Created: 12/07/2019
# Copyright: (c) Steve Micallef 2019
# Licence: MIT
# -------... | mit | bd9128a12f1c956ea5c128060cd83789 | 38.247899 | 159 | 0.551654 | 4.114978 | false | false | false | false |
smicallef/spiderfoot | modules/sfp_onyphe.py | 1 | 15289 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_onyphe
# Purpose: SpiderFoot plug-in to check if the IP is included on Onyphe
# data (threat list, geo-location, pastries, vulnerabilities)
#
# Author: Filip Aleksić <fal... | mit | 763dc68e98bc9cc1caea15c993299931 | 35.227488 | 147 | 0.501047 | 4.516396 | false | false | false | false |
smicallef/spiderfoot | modules/sfp_tool_wafw00f.py | 1 | 4786 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_tool_wafw00f
# Purpose: SpiderFoot plug-in for using the WAFW00F tool.
# Tool: https://github.com/EnableSecurity/wafw00f
#
# Author: <bcoles@gmail.com>
#
# Created: 2021... | mit | 9b1d8cb797a46a04b7c1857045c1bd54 | 29.484076 | 138 | 0.540744 | 3.935855 | false | false | false | false |
smicallef/spiderfoot | modules/sfp_emailrep.py | 1 | 5166 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_emailrep
# Purpose: Searches EmailRep.io for email address reputation.
#
# Author: <bcoles[at]gmail[.]com>
#
# Created: 2019-08-07
# Copyright: (c) bcoles 2019
# Licence: MIT... | mit | e4f567686d0817ba7ef3563dad5f0132 | 30.120482 | 117 | 0.545877 | 4.061321 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/utils/strutils.py | 2 | 7581 | import codecs
import io
import re
from typing import Iterable, Union, overload
# https://mypy.readthedocs.io/en/stable/more_types.html#function-overloading
@overload
def always_bytes(str_or_bytes: None, *encode_args) -> None:
...
@overload
def always_bytes(str_or_bytes: Union[str, bytes], *encode_args) -> byt... | mit | d11e300b0b46cd6fca8cf4d3ae5412bb | 28.956522 | 131 | 0.603906 | 3.357997 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/contrib/wbxml/ASWBXMLCodePage.py | 11 | 1764 | #!/usr/bin/env python3
'''
@author: David Shaw, shawd@vmware.com
Inspired by EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com
----- The MIT License (MIT) -----
Filename: ASWBXMLCodePage.py
Copyright (c) 2014, David P. Shaw
Permission is hereby granted, free of charge, to any person obtaining a ... | mit | f40999e63999128dcb9e68fc7484c0b2 | 32.923077 | 77 | 0.757937 | 3.713684 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/test/tutils.py | 2 | 2715 | from mitmproxy import dns
from mitmproxy import http
def tdnsreq(**kwargs) -> dns.Message:
"""
Returns:
mitmproxy.dns.Message
"""
default = dict(
timestamp=946681200,
id=42,
query=True,
op_code=dns.op_codes.QUERY,
authoritative_answer=False,
trun... | mit | 08a5b0885e1daa16d4fbe923fd405d77 | 25.359223 | 82 | 0.558011 | 3.567674 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/addons/tlsconfig.py | 2 | 16359 | import ipaddress
import logging
import os
from pathlib import Path
from typing import Any, Optional, TypedDict
from OpenSSL import SSL, crypto
from mitmproxy import certs, ctx, exceptions, connection, tls
from mitmproxy.net import tls as net_tls
from mitmproxy.options import CONF_BASENAME
from mitmproxy.proxy import c... | mit | 1ff2ec2cd5c303d1bd6d64a8d6b5b51d | 42.05 | 117 | 0.621676 | 3.780679 | false | false | false | false |
mitmproxy/mitmproxy | test/helper_tools/dumperview.py | 2 | 1597 | #!/usr/bin/env python3
import asyncio
import click
from mitmproxy.addons import dumper
from mitmproxy.test import tflow
from mitmproxy.test import taddons
def run_async(coro):
"""
Run the given async function in a new event loop.
This allows async functions to be called synchronously.
"""
loop = ... | mit | 99d165f1b211db01d82801626d246aa5 | 19.74026 | 61 | 0.612398 | 3.094961 | false | false | false | false |
mitmproxy/mitmproxy | test/mitmproxy/utils/test_human.py | 2 | 2297 | import time
import pytest
from mitmproxy.utils import human
def test_format_timestamp():
assert human.format_timestamp(time.time())
def test_format_timestamp_with_milli():
assert human.format_timestamp_with_milli(time.time())
def test_parse_size():
assert human.parse_size("0") == 0
assert human.pa... | mit | ba91071904713748ac7b10d9151fff7a | 34.890625 | 80 | 0.629952 | 3.034346 | false | true | false | false |
mitmproxy/mitmproxy | examples/contrib/tls_passthrough.py | 2 | 3687 | """
This addon allows conditional TLS Interception based on a user-defined strategy.
Example:
> mitmdump -s tls_passthrough.py
1. curl --proxy http://localhost:8080 https://example.com --insecure
// works - we'll also see the contents in mitmproxy
2. curl --proxy http://localhost:8080 https://exampl... | mit | 6910800eca98edcec43de0d3ae7bddba | 32.825688 | 117 | 0.687008 | 4.025109 | false | false | false | false |
mitmproxy/mitmproxy | test/mitmproxy/addons/test_termlog.py | 1 | 1793 | import asyncio
import builtins
import io
import logging
import pytest
from mitmproxy.addons import termlog
from mitmproxy.test import taddons
from mitmproxy.utils import vt_codes
@pytest.fixture(autouse=True)
def ensure_cleanup():
yield
assert not any(
isinstance(x, termlog.TermLogHandler)
f... | mit | 5b50a9d70e84d8a93a1b971055dfa5a4 | 22.906667 | 69 | 0.652538 | 3.448077 | false | true | false | false |
mitmproxy/mitmproxy | mitmproxy/net/http/http1/assemble.py | 2 | 2832 | def assemble_request(request):
if request.data.content is None:
raise ValueError("Cannot assemble flow with missing content")
head = assemble_request_head(request)
body = b"".join(
assemble_body(
request.data.headers, [request.data.content], request.data.trailers
)
)
... | mit | a3186524662ff641c3d0c9b7077032b1 | 27.606061 | 86 | 0.596045 | 3.682705 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/addons/command_history.py | 2 | 3448 | import logging
import os
import pathlib
from collections.abc import Sequence
from mitmproxy import command
from mitmproxy import ctx
class CommandHistory:
VACUUM_SIZE = 1024
def __init__(self) -> None:
self.history: list[str] = []
self.filtered_history: list[str] = [""]
self.current_... | mit | 69f9cc50271853ab11d3c45998c2d134 | 34.916667 | 113 | 0.611949 | 3.963218 | false | false | false | false |
mitmproxy/mitmproxy | examples/contrib/webscanner_helper/urlindex.py | 2 | 5317 | import abc
import datetime
import json
import logging
from pathlib import Path
from typing import Optional, Union
from mitmproxy import flowfilter
from mitmproxy.http import HTTPFlow
logger = logging.getLogger(__name__)
class UrlIndexWriter(abc.ABC):
"""Abstract Add-on to write seen URLs.
For example, thes... | mit | 85959196e3d0f425d79e8410f69f8116 | 31.03012 | 118 | 0.611247 | 4.061879 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/addons/stickyauth.py | 2 | 1157 | from typing import Optional
from mitmproxy import exceptions
from mitmproxy import flowfilter
from mitmproxy import ctx
class StickyAuth:
def __init__(self):
self.flt = None
self.hosts = {}
def load(self, loader):
loader.add_option(
"stickyauth",
Optional[str]... | mit | a45174fab20113aafe5b596a399bac1b | 29.447368 | 76 | 0.557476 | 4.43295 | false | false | false | false |
mitmproxy/mitmproxy | test/mitmproxy/io/test_io.py | 2 | 1307 | import io
import pytest
from hypothesis import example, given
from hypothesis.strategies import binary
from mitmproxy import exceptions, version
from mitmproxy.io import FlowReader, tnetstring
class TestFlowReader:
@given(binary())
@example(b"51:11:12345678901#4:this,8:true!0:~,4:true!0:]4:\\x00,~}")
@e... | mit | d8c563f017358ae833a7b13065b10204 | 30.878049 | 84 | 0.603673 | 3.889881 | false | true | false | false |
mitmproxy/mitmproxy | mitmproxy/contentviews/protobuf.py | 1 | 3051 | import io
from typing import Optional
from kaitaistruct import KaitaiStream
from . import base
from mitmproxy.contrib.kaitaistruct import google_protobuf
def write_buf(out, field_tag, body, indent_level):
if body is not None:
out.write(
"{: <{level}}{}: {}\n".format(
"",
... | mit | 982217be6915170afddc418478bdec86 | 29.51 | 101 | 0.577516 | 3.81375 | false | false | false | false |
mitmproxy/mitmproxy | mitmproxy/tools/console/window.py | 2 | 10714 | import os
import re
import urwid
from mitmproxy import flow
from mitmproxy.tools.console import commands
from mitmproxy.tools.console import common
from mitmproxy.tools.console import eventlog
from mitmproxy.tools.console import flowlist
from mitmproxy.tools.console import flowview
from mitmproxy.tools.console import ... | mit | f42e18dd0b0f069f6b965917d2dcc657 | 33.012698 | 126 | 0.583816 | 3.999253 | false | false | false | false |
choderalab/openmoltools | devtools/scripts/create_conda_env.py | 1 | 3867 | import argparse
import os
import re
import glob
import shutil
import subprocess as sp
from tempfile import TemporaryDirectory
from contextlib import contextmanager
# YAML imports
try:
import yaml # PyYAML
loader = yaml.load
except ImportError:
try:
import ruamel_yaml as yaml # Ruamel YAML
exce... | mit | 9abefeec3a9d0db28ef35ec3335fc34c | 39.705263 | 117 | 0.631239 | 4.019751 | false | false | false | false |
cebrusfs/217gdb | pwndbg/symbol.py | 2 | 7028 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Looking up addresses for function names / symbols, and
vice-versa.
Uses IDA when available if there isn't sufficient symbol
information available.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... | mit | d42fca19bd478f773c2a2aaa0db9850e | 25.126394 | 96 | 0.608139 | 3.57659 | false | false | false | false |
cebrusfs/217gdb | pwndbg/emu/emulator.py | 1 | 14797 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Emulation assistance from Unicorn.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import binascii
import re
import capstone as C
import gdb
import unicorn as U
i... | mit | cbd289df6338d7cdddab6bbdb541bfc2 | 30.482979 | 115 | 0.567547 | 3.387592 | false | false | false | false |
cebrusfs/217gdb | pwndbg/proc.py | 1 | 2118 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides values which would be available from /proc which
are not fulfilled by other modules and some process/gdb flow
related information.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ i... | mit | 55aeaca488c076ca3cbd4c84757a3e66 | 24.518072 | 85 | 0.628423 | 3.914972 | false | false | false | false |
cebrusfs/217gdb | pwndbg/commands/procinfo.py | 1 | 6103 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import string
import gdb
import pwndbg.auxv
import pwndbg.commands
import pwndbg.file
import pwndbg.memoize
impo... | mit | d2d2d750c953c1a81658217ce5bffe67 | 23.608871 | 88 | 0.518434 | 3.163815 | false | false | false | false |
sissaschool/xmlschema | xmlschema/validators/facets.py | 1 | 31723 | #
# Copyright (c), 2016-2021, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | mit | f89b5ef6a211e38d1255bd28747f797c | 35.75898 | 98 | 0.599565 | 3.794163 | false | false | false | false |
sissaschool/xmlschema | tests/test_cli.py | 1 | 11973 | #!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... | mit | 1d057c51a4612b92f85f5e215634eb13 | 43.344444 | 94 | 0.652134 | 3.451427 | false | true | false | false |
sissaschool/xmlschema | xmlschema/validators/exceptions.py | 1 | 14998 | #
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | mit | 2300a36c4a39a1cefca8d1cd2a4a95fe | 37.358056 | 99 | 0.601947 | 4.324683 | false | false | false | false |
sissaschool/xmlschema | xmlschema/converters/abdera.py | 1 | 5977 | #
# Copyright (c), 2016-2021, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | mit | 746f58334f338fcb2bd3a02f6be2bb50 | 41.692857 | 97 | 0.535386 | 4.55564 | false | false | false | false |
sissaschool/xmlschema | xmlschema/validators/xsdbase.py | 1 | 41135 | #
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | mit | 555df8f878f3fa28a03bea0f091aad27 | 39.04187 | 100 | 0.605719 | 4.34704 | false | false | false | false |
commaai/openpilot | selfdrive/car/chrysler/interface.py | 1 | 4200 | #!/usr/bin/env python3
from cereal import car
from panda import Panda
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config
from selfdrive.car.chrysler.values import CAR, DBC, RAM_HD, RAM_DT
from selfdrive.car.interfaces import CarInterfaceBase
class... | mit | 94c9ef8a93e1ed2efc893eae9a685135 | 37.53211 | 137 | 0.683333 | 2.918694 | false | true | false | false |
commaai/openpilot | selfdrive/locationd/paramsd.py | 1 | 9300 | #!/usr/bin/env python3
import math
import json
import numpy as np
import cereal.messaging as messaging
from cereal import car
from common.params import Params, put_nonblocking
from common.realtime import config_realtime_process, DT_MDL
from common.numpy_fast import clip
from selfdrive.locationd.models.car_kf import Ca... | mit | a9be3c090c8a1fbed3a17220f5c0b47c | 41.465753 | 171 | 0.672366 | 3.406593 | false | false | false | false |
commaai/openpilot | tools/gpstest/remote_checker.py | 1 | 1297 | #!/usr/bin/env python3
import sys
import time
from typing import List
from common.params import Params
import cereal.messaging as messaging
from selfdrive.manager.process_config import managed_processes
DELTA = 0.001
# assume running openpilot for now
procs: List[str] = []#"ubloxd", "pigeond"]
def main():
if len(... | mit | 8aaf52e6afa60ce85b4a46eff961c774 | 23.018519 | 67 | 0.655359 | 3.267003 | false | false | false | false |
commaai/openpilot | common/window.py | 1 | 1867 | import sys
import pygame # pylint: disable=import-error
import cv2 # pylint: disable=import-error
class Window:
def __init__(self, w, h, caption="window", double=False, halve=False):
self.w = w
self.h = h
pygame.display.init()
pygame.display.set_caption(caption)
self.double = double
self.ha... | mit | 83d120b7ee459acfb25728975d059f19 | 29.606557 | 132 | 0.61864 | 3.055646 | false | false | false | false |
commaai/openpilot | selfdrive/car/mock/interface.py | 1 | 2712 | #!/usr/bin/env python3
import math
from cereal import car
from common.conversions import Conversions as CV
from system.swaglog import cloudlog
import cereal.messaging as messaging
from selfdrive.car import gen_empty_fingerprint, get_safety_config
from selfdrive.car.interfaces import CarInterfaceBase
# mocked car inter... | mit | 373dbad9165223ed7309484c7bc53644 | 31.285714 | 103 | 0.686947 | 3.088838 | false | false | false | false |
commaai/openpilot | selfdrive/controls/lib/desire_helper.py | 1 | 4985 | from cereal import log
from common.conversions import Conversions as CV
from common.realtime import DT_MDL
LaneChangeState = log.LateralPlan.LaneChangeState
LaneChangeDirection = log.LateralPlan.LaneChangeDirection
LANE_CHANGE_SPEED_MIN = 20 * CV.MPH_TO_MS
LANE_CHANGE_TIME_MAX = 10.
DESIRES = {
LaneChangeDirection... | mit | cdc27c6ba3f4eea7eeecdf08d1e8eb6c | 43.115044 | 133 | 0.718756 | 3.256042 | false | false | false | false |
commaai/openpilot | tools/zookeeper/power_monitor.py | 1 | 1136 | #!/usr/bin/env python3
import sys
import time
import datetime
from common.realtime import Ratekeeper
from common.filter_simple import FirstOrderFilter
from tools.zookeeper import Zookeeper
if __name__ == "__main__":
z = Zookeeper()
z.set_device_power(True)
z.set_device_ignition(False)
duration = None
if le... | mit | fd7b54a69f2ed33b7159056e313da748 | 27.4 | 71 | 0.667254 | 3.236467 | false | false | false | false |
commaai/openpilot | selfdrive/car/fw_versions.py | 1 | 11991 | #!/usr/bin/env python3
from collections import defaultdict
from typing import Any, Optional, Set, Tuple
from tqdm import tqdm
import panda.python.uds as uds
from cereal import car
from selfdrive.car.ecu_addrs import get_ecu_addrs
from selfdrive.car.interfaces import get_interface_attr
from selfdrive.car.fingerprints i... | mit | 1d53a89c9bb243d2a4f8c5c5195de051 | 34.581602 | 148 | 0.659161 | 3.377746 | false | false | false | false |
commaai/openpilot | selfdrive/car/toyota/toyotacan.py | 1 | 2594 | def create_steer_command(packer, steer, steer_req):
"""Creates a CAN message for the Toyota Steer Command."""
values = {
"STEER_REQUEST": steer_req,
"STEER_TORQUE_CMD": steer,
"SET_ME_1": 1,
}
return packer.make_can_msg("STEERING_LKA", 0, values)
def create_lta_steer_command(packer, steer, steer_... | mit | c2519f194187d166fb53026f2639c915 | 25.20202 | 113 | 0.60717 | 2.494231 | false | false | false | false |
commaai/openpilot | selfdrive/sensord/rawgps/structs.py | 1 | 15367 | from struct import unpack_from, calcsize
LOG_GNSS_POSITION_REPORT = 0x1476
LOG_GNSS_GPS_MEASUREMENT_REPORT = 0x1477
LOG_GNSS_CLOCK_REPORT = 0x1478
LOG_GNSS_GLONASS_MEASUREMENT_REPORT = 0x1480
LOG_GNSS_BDS_MEASUREMENT_REPORT = 0x1756
LOG_GNSS_GAL_MEASUREMENT_REPORT = 0x1886
LOG_GNSS_OEMDRE_MEASUREMENT_REPORT = 0x14DE
... | mit | 7a058fee5597d473fe943008e2105d29 | 42.409605 | 403 | 0.664281 | 3.231077 | false | false | false | false |
commaai/openpilot | selfdrive/athena/tests/helpers.py | 1 | 3430 | import http.server
import random
import requests
import socket
import time
from functools import wraps
from multiprocessing import Process
from common.timeout import Timeout
class MockResponse:
def __init__(self, json, status_code):
self.json = json
self.text = json
self.status_code = status_code
cla... | mit | a49e96ccc5091f8d5c332290185d1e29 | 25.589147 | 427 | 0.665889 | 3.024691 | false | false | false | false |
commaai/openpilot | selfdrive/debug/sensor_data_to_hist.py | 1 | 2975 | #!/usr/bin/env python3
'''
printing the gap between interrupts in a histogram to check if the
frequency is what we expect, the bmx is not interrupt driven for as we
get interrupts in a 2kHz rate.
'''
import argparse
import sys
import numpy as np
from collections import defaultdict
from tools.lib.logreader import LogR... | mit | c929c30fbf20eaeea92b558a1a4e5dc2 | 25.801802 | 80 | 0.655798 | 2.739411 | false | false | false | false |
commaai/openpilot | selfdrive/car/ecu_addrs.py | 1 | 3713 | #!/usr/bin/env python3
import capnp
import time
from typing import Optional, Set, Tuple
import cereal.messaging as messaging
from panda.python.uds import SERVICE_TYPE
from selfdrive.car import make_can_msg
from selfdrive.boardd.boardd import can_list_to_can_capnp
from system.swaglog import cloudlog
def make_tester_p... | mit | a98861bbbfdee325343f722d94873349 | 39.802198 | 170 | 0.674387 | 3.170794 | false | true | false | false |
commaai/openpilot | tools/camerastream/compressed_vipc.py | 1 | 4502 | #!/usr/bin/env python3
import av
import os
import sys
import argparse
import numpy as np
import multiprocessing
import time
import cereal.messaging as messaging
from cereal.visionipc import VisionIpcServer, VisionStreamType
W, H = 1928, 1208
V4L2_BUF_FLAG_KEYFRAME = 8
def decoder(addr, sock_name, vipc_server, vst, n... | mit | 6b34715a28a378ae2f2c3e4071ba66d8 | 37.810345 | 310 | 0.659929 | 2.925276 | false | false | false | false |
commaai/openpilot | selfdrive/locationd/models/gnss_kf.py | 1 | 6722 | #!/usr/bin/env python3
import sys
from typing import List
import numpy as np
from selfdrive.locationd.models.constants import ObservationKind
from selfdrive.locationd.models.gnss_helpers import parse_pr, parse_prr
if __name__ == '__main__': # Generating sympy
import sympy as sp
from rednose.helpers.ekf_sym impo... | mit | eda69ed90e81c60d2eacd32bd2d3ca8a | 34.378947 | 136 | 0.593871 | 2.762844 | false | false | false | false |
commaai/openpilot | selfdrive/test/process_replay/model_replay.py | 1 | 7355 | #!/usr/bin/env python3
import os
import sys
import time
from collections import defaultdict
from typing import Any
from itertools import zip_longest
import cereal.messaging as messaging
from cereal.visionipc import VisionIpcServer, VisionStreamType
from common.spinner import Spinner
from common.timeout import Timeout
... | mit | d434c7662c1d4a75cc8bc1a7f053825c | 33.85782 | 134 | 0.653161 | 3.319043 | false | true | false | false |
commaai/openpilot | selfdrive/thermald/thermald.py | 1 | 17437 | #!/usr/bin/env python3
import datetime
import os
import queue
import threading
import time
from collections import OrderedDict, namedtuple
from pathlib import Path
from typing import Dict, Optional, Tuple
import psutil
import cereal.messaging as messaging
from cereal import log
from common.dict_helpers import strip_d... | mit | 61758575c0bc019d5611cc5ef369cea9 | 38.901602 | 162 | 0.690658 | 3.361025 | false | false | false | false |
ursgal/ursgal | ursgal/wrappers/msgfplus2csv_v1_2_1.py | 2 | 9412 | #!/usr/bin/env python
import ursgal
import importlib
import os
import sys
import pickle
import csv
import copy
import re
import pprint
import gzip
import subprocess
# from .msgfplus_C_mzid2csv_v2017_07_04 import msgfplus_C_mzid2csv_v2017_07_04 as msgfc
class msgfplus2csv_v1_2_1(ursgal.UNode):
"""
msgfplus2cs... | mit | cb44ba56969df528c9e82848c26d1762 | 36.349206 | 209 | 0.483957 | 4.02911 | false | false | false | false |
ursgal/ursgal | ursgal/wrappers/ptmshepherd_0_3_5.py | 2 | 21177 | #!/usr/bin/env python3.4
import ursgal
import os
import sys
import shutil
import csv
import re
import pickle
class ptmshepherd_0_3_5(ursgal.UNode):
"""
ptmshepherd_0_3_5 for validation and annotation of mass sifts from
open modeification search results
"""
META_INFO = {
"edit_version": 1.... | mit | ae1613a9acbb9fa49f00d3596882c217 | 40.200389 | 125 | 0.474524 | 4.046045 | false | false | false | false |
workhorsy/py-cpuinfo | tests/test_linux_fedora_29_x86_64_ryzen_7.py | 1 | 24450 |
import unittest
from cpuinfo import *
import helpers
class MockDataSource:
bits = '64bit'
cpu_count = 8
is_windows = False
arch_string_raw = 'x86_64'
uname_string_raw = 'x86_64'
can_cpuid = False
@staticmethod
def has_proc_cpuinfo():
return True
@staticmethod
def has_lscpu():
return True
@staticme... | mit | 6194d0b0e858685ed7cbd91c5156c5cf | 41.894737 | 441 | 0.51272 | 3.699501 | false | false | false | false |
ursgal/ursgal | ursgal/resources/platform_independent/arc_independent/combine_pep_1_0_0/combine_pep_1_0_0.py | 2 | 17837 | #!/usr/bin/python
import csv
import os
import functools
import operator
import itertools
import collections
def adjust_window_size(desired_window_size, iter_len, minimum=29):
"""
Dynamically adjusts the sliding window size depending on the total
length of values. When there are few values (below 1/5 of ... | mit | a6dff0b6bf05c8cdd36455010355275b | 34.961694 | 99 | 0.554017 | 3.864168 | false | false | false | false |
ursgal/ursgal | example_scripts/msgf_version_comparison.py | 2 | 3231 | #!/usr/bin/env python3
# encoding: utf-8
import ursgal
import os
def main():
"""
Executes a search with a current maximum of 3 versions of MSGF+ on an
example file from the data from Barth et al. (2014)
usage:
./msgf_version_comparison.py
This is a simple example file to show the strai... | mit | 4532270de85d4d7883d6bd47dc795b35 | 29.481132 | 123 | 0.593934 | 3.103746 | false | false | false | false |
ursgal/ursgal | ursgal/wrappers/get_http_files_1_0_0.py | 2 | 2116 | #!/usr/bin/env python
import ursgal
import os
class get_http_files_1_0_0(ursgal.UNode):
"""
get_http_files_1_0_0 UNode
Downloads files via http
Args:
* http_url
* http_output_folder
Note:
meta info param 'output_extensions' is by default txt, so that the
temporar... | mit | d37e232e0db330b1c4b6537ceddba5fa | 28.802817 | 83 | 0.523157 | 3.503311 | false | false | false | false |
ursgal/ursgal | ursgal/resources/platform_independent/arc_independent/add_estimated_fdr_1_0_0/add_estimated_fdr_1_0_0.py | 2 | 2896 | #!/media/lukas/storage/uni/forschungsmodul_proteomics/pypercolator/pypercolator/bin/python
"""
Parses a target/decoy search result file and adds a column called "estimated_FDR".
The CSV has to contain: a column with a quality score for each PSM (e-value, error probability etc.)
and a column called "Is decoy" indicatin... | mit | 8127f99aed0b225bd7342e9ea944c7bb | 30.813187 | 115 | 0.594128 | 3.565271 | false | false | false | false |
ursgal/ursgal | ursgal/wrappers/mzml2mgf_1_0_0.py | 2 | 2796 | #!/usr/bin/env python
import ursgal
import importlib
import os
import sys
class mzml2mgf_1_0_0(ursgal.UNode):
"""
mzml2mgf_1_0_0 UNode
Converts .mzML files into .mgf files
"""
META_INFO = {
"edit_version": 1.00,
"name": "mzml2mgf",
"version": "1.0.0",
"release_dat... | mit | f2b25d93f4bb9197ed86058aec110618 | 33.097561 | 87 | 0.497139 | 3.664482 | false | false | false | false |
ursgal/ursgal | ursgal/resources/platform_independent/arc_independent/mzml2mgf_1_0_0/mzml2mgf_1_0_0.py | 2 | 5762 | #!/usr/bin/env python
"""
Converts mzML to mgf
Usage:
./_mzml_2_mgf.py <mzML File1> ... <mzML FileN>
Note:
1) A new mgf file will be created at the same location as the mzML file
2) only ms2 are converted to mgf
"""
# 18.11.2014
# By C. Fufezan
from __future__ import print_function
import sys
import os
import argpar... | mit | 731bb6edea91f34794e11ee8bad715bb | 28.701031 | 108 | 0.549115 | 3.348053 | false | false | false | false |
ursgal/ursgal | ursgal/wrappers/kojak_1_5_3.py | 2 | 12239 | #!/usr/bin/env python
import ursgal
import os
import shutil
class kojak_1_5_3(ursgal.UNode):
"""
Kojak UNode
Parameter options at http://www.kojak-ms.org/param/index.html
Reference:
Hoopmann MR, Zelter A, Johnson RS, Riffle M, Maccoss MJ, Davis TN, Moritz RL (2015) Kojak: Efficient analysis of c... | mit | a43c8e616b8494e006246ff76c804dc2 | 37.240625 | 187 | 0.552995 | 3.561409 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.