repo_name stringlengths 7 65 | path stringlengths 5 186 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 941 973k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 5 100 | line_max int64 26 999 | alpha_frac float64 0.25 0.93 | ratio float64 1.5 7.35 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rbrito/pkg-youtube-dl | youtube_dl/extractor/inc.py | 24 | 2299 | from __future__ import unicode_literals
from .common import InfoExtractor
from .kaltura import KalturaIE
class IncIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?inc\.com/(?:[^/]+/)+(?P<id>[^.]+).html'
_TESTS = [{
'url': 'http://www.inc.com/tip-sheet/bill-gates-says-these-5-books-will-make-you-s... | unlicense | a90e74a7b8d5c2a4623c150d172c1126 | 37.966102 | 141 | 0.544585 | 3.036988 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/ctvnews.py | 24 | 2276 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import orderedSet
class CTVNewsIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P<id>[0-9.]+)'
_TESTS = [{
'url': 'http://www.ctvn... | unlicense | f59ff8f3b7d39d780a956a65c23dd35a | 32.470588 | 109 | 0.522408 | 3.13931 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/soundgasm.py | 30 | 2414 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class SoundgasmIE(InfoExtractor):
IE_NAME = 'soundgasm'
_VALID_URL = r'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_-]+)/(?P<display_id>[0-9a-zA-Z_-]+)'
_TEST = {
'url': 'http://soundga... | unlicense | 8ccd9c0632d14da17ffeb86c62bda6f2 | 30.350649 | 111 | 0.508699 | 3.25776 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/egghead.py | 3 | 4767 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
int_or_none,
try_get,
unified_timestamp,
url_or_none,
)
class EggheadBaseIE(InfoExtractor):
def _call_api(self, path, video_id, resour... | unlicense | 15ee99f60e99ce12eb17593c6d2930a7 | 34.574627 | 132 | 0.538913 | 3.523282 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/rtlnl.py | 8 | 5896 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
)
class RtlNlIE(InfoExtractor):
IE_NAME = 'rtl.nl'
IE_DESC = 'rtl.nl and rtlxl.nl'
_VALID_URL = r'''(?x)
https?://(?:(?:www|static)\.)?
(?:
... | unlicense | e649c63c75942534ca2aa43c25414b1e | 39.369863 | 247 | 0.551748 | 2.875122 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/kusi.py | 7 | 3118 | # coding: utf-8
from __future__ import unicode_literals
import random
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
from ..utils import (
int_or_none,
float_or_none,
timeconvert,
update_url_query,
xpath_text,
)
class KUSIIE(InfoExtractor):
... | unlicense | 83f7d882477e36127e3b12fc26625de0 | 34.431818 | 124 | 0.556126 | 3.464444 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/instagram.py | 1 | 16595 | from __future__ import unicode_literals
import itertools
import hashlib
import json
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_HTTPError,
)
from ..utils import (
ExtractorError,
get_element_by_attribute,
int_or_none,
lowercase_escape,
std_headers,... | unlicense | a366d764901754567175a4557adca68c | 35.959911 | 105 | 0.478759 | 3.963458 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/yourporn.py | 12 | 2062 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
parse_duration,
urljoin,
)
class YourPornIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sxyprn\.com/post/(?P<id>[^/?#&.]+)'
_TESTS = [{
'url': 'https://sxyprn.... | unlicense | 921bb6e4b26e6b2c9b5bac242b6c95ea | 29.776119 | 76 | 0.489816 | 3.425249 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/apa.py | 19 | 3173 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
js_to_json,
url_or_none,
)
class APAIE(InfoExtractor):
_VALID_URL = r'https?://[^/]+\.apa\.at/embed/(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})... | unlicense | b3568d6dda3d7b350b901c505d9ee76d | 32.744681 | 149 | 0.500315 | 3.094634 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/lenta.py | 28 | 1682 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class LentaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?lenta\.ru/[^/]+/\d+/\d+/\d+/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://lenta.ru/news/2018/03/22/savshenko_go/',
'info_dict': {
... | unlicense | 5c10c70a1b83265c2c0b37423ade22be | 29.849057 | 83 | 0.48318 | 3.162476 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/channel9.py | 13 | 10284 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
parse_iso8601,
qualities,
unescapeHTML,
)
class Channel9IE(InfoExtractor):
IE_DESC = 'Channel 9'
IE_NAME = 'channel9'
_VALID_URL = r'... | unlicense | 40aa57f1273eae5a70192257771f4b13 | 38.251908 | 267 | 0.494846 | 3.80607 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/niconico.py | 5 | 20357 | # coding: utf-8
from __future__ import unicode_literals
import datetime
import functools
import json
import math
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
determine_ext,
dict_get,
ExtractorError,
float_or_non... | unlicense | c9ca088625dfc37c317638c87b5bbf92 | 37.887379 | 113 | 0.492285 | 3.770853 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/skyit.py | 7 | 8937 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
dict_get,
int_or_none,
parse_duration,
unified_timestamp,
)
class SkyItPlayerIE(InfoExtractor... | unlicense | 84eaff4ed0e14aad5cbe3b5dbb39e981 | 36.384937 | 130 | 0.554673 | 2.823065 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/sendtonews.py | 62 | 3833 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_iso8601,
update_url_query,
int_or_none,
determine_protocol,
unescapeHTML,
)
class SendtoNewsIE(InfoExtractor):
_VALID_URL = r'https?://embed\.sen... | unlicense | a3a806a263b6212d94f8fc6b7205dcb4 | 35.504762 | 170 | 0.507957 | 3.710552 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/msn.py | 13 | 7584 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
unescapeHTML,
)
class MSNIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|preview)\.)?msn\.com... | unlicense | 61e626f986287d2cc471ad809f50f3e5 | 43.327485 | 170 | 0.50686 | 3.55368 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/trutv.py | 20 | 2532 | # coding: utf-8
from __future__ import unicode_literals
import re
from .turner import TurnerBaseIE
from ..utils import (
int_or_none,
parse_iso8601,
)
class TruTVIE(TurnerBaseIE):
_VALID_URL = r'https?://(?:www\.)?trutv\.com/(?:shows|full-episodes)/(?P<series_slug>[0-9A-Za-z-]+)/(?:videos/(?P<clip_slug>... | unlicense | 42a1290eced9b8d3a2efc766f990ad19 | 32.76 | 156 | 0.521327 | 3.511789 | false | false | false | false |
rbrito/pkg-youtube-dl | test/test_age_restriction.py | 171 | 1379 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import try_rm
from youtube_dl import YoutubeDL
def _download_restricted(url, filename, age):
... | unlicense | c0bfef172a920e10c77f6f532e65c26c | 26.58 | 89 | 0.651197 | 3.291169 | false | true | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/bibeltv.py | 5 | 1102 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class BibelTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bibeltv\.de/mediathek/videos/(?:crn/)?(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.bibeltv.de/mediathek/videos/329703-sprachkurs-in-malaiisch',
... | unlicense | 28fc08e591b77f253f7bcf1361137992 | 35.733333 | 117 | 0.597096 | 2.946524 | false | false | false | false |
eliben/code-for-blog | 2009/csp_for_euler68/csplib.py | 13 | 9926 | """ Based on the AIMA Python code.
"""
from collections import deque
class CSP(object):
""" A finite-domain Constraint Satisfaction Problem.
Specified by the following:
vars:
A list of variables (ints or strings)
domains:
A dict holding for ea... | unlicense | d7afdafcff73112f366184b572d0a545 | 34.723247 | 82 | 0.523071 | 4.737947 | false | false | false | false |
eliben/code-for-blog | 2018/clone/plot-time.py | 1 | 1384 | # Helper script for making run-time plots.
#
# Requires a Python installation with the full numeric stack (Numpy, Matplotlib)
# including Seaborn (for prettier plots).
#
# Eli Bendersky [http://eli.thegreenplace.net]
# This code is in the public domain.
import numpy as np
import matplotlib.pyplot as plt
import seaborn
... | unlicense | 5c7b8ec8903a3bb067bee4e7d9b559a7 | 25.615385 | 80 | 0.609827 | 2.784708 | false | false | false | false |
eliben/code-for-blog | 2018/type-inference/lexer.py | 1 | 4425 | #-------------------------------------------------------------------------------
# lexer.py
#
# A generic regex-based Lexer/tokenizer tool.
# See the if __main__ section in the bottom for an example.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#----------------------------------------------... | unlicense | 3c72404db85d5bfc6e8738153e283309 | 29.944056 | 80 | 0.484068 | 4.346758 | false | false | false | false |
eliben/code-for-blog | 2010/eps-removal/eps_removal.py | 1 | 6350 | # Epsilon production removal from grammars
#
# Eli Bendersky [https://eli.thegreenplace.net]
# This code is in the public domain.
import sys, os
from collections import defaultdict
class CFG(object):
def __init__(self):
self.prod = defaultdict(list)
self.start = None
def set_start_symbol(self... | unlicense | 9d0d7e83304bf8e460e2dfc14620e953 | 32.246073 | 74 | 0.500787 | 4.177632 | false | false | false | false |
eliben/code-for-blog | 2018/covar/covar-typecheck.py | 1 | 1166 | # Sample of using typing.TypeVar with covariant settings.
# Run with python3.6+
#
# For type-checking with mypy:
#
# > mypy covar-typecheck.py
#
# Eli Bendersky [https://eli.thegreenplace.net]
# This code is in the public domain.
from typing import List, TypeVar, Iterable, Generic
class Mammal:
pass
class Cat(Mam... | unlicense | 5cf6565cf1586e7e1d06d8fea80dd029 | 24.347826 | 73 | 0.693825 | 2.886139 | false | false | false | false |
eliben/code-for-blog | 2016/readline-samples/python/readline-complete-subcommand.py | 1 | 2233 | # Subcommand completion with the readline module.
#
# Tested with Python 3.4
#
# Eli Bendersky [http://eli.thegreenplace.net]
# This code is in the public domain.
import glob
import readline
def make_subcommand_completer(commands):
def custom_complete(text, state):
# Simplistic parsing of the command-line ... | unlicense | 5e7dccad6c6723d176129a65fe08913e | 35.016129 | 80 | 0.55665 | 3.94523 | false | false | false | false |
eliben/code-for-blog | 2018/unif/unifier.py | 1 | 6432 | # Python 3.6
import lexer
class Term:
pass
# In App, function names are always considered to be constants, not variables.
# This simplifies things and doesn't affect expressivity. We can always model
# variable functions by envisioning an apply(FUNCNAME, ... args ...).
class App(Term):
def __init__(self, fna... | unlicense | 4b9d52165ff928b3f4b5d8ca72577b62 | 28.369863 | 82 | 0.540112 | 3.805917 | false | false | false | false |
cfpb/owning-a-home-api | ratechecker/views.py | 1 | 7002 | from decimal import Decimal
from django.db.models import Q, Sum
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
from ratechecker.models import Adjustment, Rate, Region
from ratechecker.ratechecker_p... | cc0-1.0 | 76048478d53e2df35ae66025414cfe4d | 34.543147 | 79 | 0.584119 | 3.635514 | false | false | false | false |
cfpb/owning-a-home-api | countylimits/data_collection/county_data_monitor.py | 1 | 2533 | import os
from difflib import ndiff
from django.core.mail import send_mail
import requests
from bs4 import BeautifulSoup as bs
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
CENSUS_CHANGELOG = "https://www.census.gov/geo/reference/county-changes.html"
LAST_CHANGELOG = "{}/last_changelog.txt".format(BASE_DIR)... | cc0-1.0 | 76daa4ef3d8b7501b851210cc888b8dc | 30.271605 | 77 | 0.604816 | 3.676343 | false | false | false | false |
cfpb/owning-a-home-api | ratechecker/validation.py | 1 | 2622 | import json
from collections import OrderedDict
from ratechecker.ratechecker_parameters import ParamsSerializer
from ratechecker.views import get_rates
class ScenarioValidationError(BaseException):
pass
class ValidationError(BaseException):
pass
class ScenarioValidator(object):
def __init__(self, ver... | cc0-1.0 | b9e560e156397e4f2782f30ba8201920 | 29.847059 | 77 | 0.656369 | 4.648936 | false | false | false | false |
cfpb/owning-a-home-api | ratechecker/loader.py | 1 | 5088 | import csv
import itertools
from decimal import Decimal
from django.utils import timezone
from ratechecker.models import Adjustment, Product, Rate, Region
class LoaderError(BaseException):
pass
def split(iterable, chunk_size=1000):
sourceiter = iter(iterable)
while True:
chunk = list(itertools... | cc0-1.0 | 423b651fcecb56946ac20e82aaa4d5d0 | 30.8 | 74 | 0.574292 | 3.837104 | false | false | false | false |
mozilla-services/tokenserver | tokenserver/views.py | 1 | 22173 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import os
import re
import time
import logging
from cornice import Service
from mozsvc.metrics import metric... | mpl-2.0 | 2cf5a26f5ae0f71da4cd0e93b607c843 | 38.736559 | 79 | 0.656158 | 4.150693 | false | false | false | false |
pycket/pycket | pycket/regexp.py | 1 | 40459 | import sys
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rstring import UnicodeBuilder
from rpython.rlib.rsre.rsre_core import CompiledPattern
from rpython.rlib.rsre.rsre_constants import (OPCODE_LITERAL, OPCODE_LITERAL_IGNORE,
OPCODE_SUCCESS... | mit | 75af817da3ab54cba7beb5a04849da81 | 28.683786 | 131 | 0.572184 | 3.776274 | false | false | false | false |
pycket/pycket | pycket/prims/random.py | 6 | 1926 | from rpython.rlib import rrandom, rarithmetic
from pycket.prims.expose import default, expose, expose_val
from pycket import values, values_parameter
from pycket import vector as values_vector
from pycket.error import SchemeException
# XXX for now just always use a global rng
rng = r... | mit | 1c1b3d42cef7f88cea8be48318ddf72f | 35.339623 | 109 | 0.722741 | 3.390845 | false | false | false | false |
onecodex/onecodex | onecodex/models/collection.py | 1 | 23393 | from collections import defaultdict, OrderedDict
from datetime import datetime
import json
import warnings
import numpy as np
import pandas as pd
from onecodex.exceptions import OneCodexException
from onecodex.lib.enums import Metric, FunctionalAnnotations, FunctionalAnnotationsMetric
try:
from onecodex.analyses... | mit | 52763315551efa42ec5cff4baf799092 | 36.36901 | 113 | 0.573975 | 4.383174 | false | false | false | false |
pycket/pycket | pycket/assign_convert.py | 2 | 12937 |
from pycket.ast_visitor import ASTVisitor
from pycket.env import SymList
from pycket.interpreter import (
App,
Begin,
Begin0,
BeginForSyntax,
CaseLambda,
Cell,
CellRef,
DefineValues,
If,
Lambda,
Let,
Letrec,
LexicalVar,
Module,
ModuleVar,
LinkletV... | mit | 46be016d53fa5310ea29925d64f5c4f7 | 39.052632 | 96 | 0.6064 | 3.549246 | false | false | false | false |
pycket/pycket | pycket/prims/foreign.py | 1 | 7268 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from pycket import values
from pycket.error import SchemeException, FSException, ContractException, ArityException
from pycket.foreign import (
W_CType,
W_PrimitiveCType,
W_DerivedCType,
W_CStructType,
W_CPointer,
... | mit | 3287a9da19df7a8fc20edd39f330b937 | 33.609524 | 121 | 0.579527 | 3.186322 | false | false | false | false |
pycket/pycket | pycket/prims/numeric.py | 1 | 30012 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import math
import operator
from pycket import values
from pycket import vector as values_vector
from pycket.arity import Arity
from pycket.error import... | mit | 16e900f3d76307859bd01492a65b5e52 | 34.475177 | 118 | 0.59203 | 3.157496 | false | false | false | false |
pycket/pycket | pycket/util.py | 2 | 11486 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
import string
from rpython.rlib import streamio as sio
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib import jit, objectmodel, rtime
from rpython.rlib.unroll import unrolling_iterable
def os_check_env_var(var_str... | mit | fc198ccfa8298739e5238bdc64fc0700 | 33.389222 | 103 | 0.572349 | 3.57374 | false | false | false | false |
pycket/pycket | pycket/test/test_larger.py | 3 | 1854 | import pytest
from pycket.expand import expand, expand_string
from pycket.pycket_json import loads
from pycket.interpreter import *
from pycket.values import *
from pycket.prims import *
from pycket.test.testhelper import run_file
def test_puzzle():
run_file("puzzle.rkt", ("1048575", "460"), ("50", "1"))
def tes... | mit | fb3ee456f7319ee46f985903476978d2 | 25.112676 | 111 | 0.653182 | 2.821918 | false | true | false | false |
pycket/pycket | pycket/interpreter.py | 1 | 84467 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from pycket import config
from pycket import values, values_string, values_parameter
from pycket import vector
from pycket.AST import AST
from pycket.arity import Arity
from pycket.cont ... | mit | 942540cd01cfdc19565b981c5dad752f | 31.499038 | 133 | 0.570828 | 3.566783 | false | false | false | false |
pycket/pycket | pycket/test/test_vector.py | 2 | 11833 | import pytest
from pycket.expand import expand
from pycket.interpreter import *
from pycket.values import *
from pycket.impersonators import *
from pycket.vector import *
from pycket.prims import *
from pycket.test.testhelper import run_fix, run, run_mod, execute, check_equal
import sys
def test_vec():
assert isin... | mit | fd3084003710c262aa35dd082992824a | 40.374126 | 162 | 0.613876 | 2.951609 | false | true | false | false |
onecodex/onecodex | onecodex/lib/enums.py | 1 | 2677 | from enum import Enum
__all__ = ["Metric", "AbundanceMetric", "AlphaDiversityMetric", "BetaDiversityMetric"]
class BaseEnum(str, Enum):
@classmethod
def has_value(cls, value):
return value in cls.values()
@classmethod
def values(cls):
return [e.value for e in cls]
class AbundanceMe... | mit | 85c6912580c6dd81dcbef4e305d08bfd | 20.58871 | 89 | 0.63093 | 3.138335 | false | false | false | false |
kibitzr/kibitzr | kibitzr/bash.py | 1 | 6480 | """
Kibitzr accepts shell scripts in 3 places:
* Fetch
* Transform
* Notify
Execute code from notifier with transformation result passed via stdin.
Here is a simplistic example of ``kibitzr.yml`` file, that uses all three:
.. code-block:: yaml
checks:
- name: Shell example
script: |
for... | mit | 3ea741f3c06534c1d92a8dbfb4437492 | 28.058296 | 117 | 0.636111 | 3.506494 | false | false | false | false |
kibitzr/kibitzr | kibitzr/notifier/telegram.py | 1 | 1800 | from __future__ import absolute_import
import logging
from ..conf import settings
logger = logging.getLogger(__name__)
class TelegramBot:
def __init__(self, chat_id=None, split_on=None):
from telegram.bot import Bot
telegram_creds = settings().creds['telegram']
token = telegram_creds['t... | mit | 19b323a68984eb5486a4604ecde70af1 | 25.086957 | 70 | 0.553889 | 3.726708 | false | false | false | false |
demisto/content | Packs/AHA/Integrations/AHA/AHA.py | 2 | 8055 | from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
import requests
from typing import Dict
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # type: ignore[attr-defined] # pylint: disable=no-member
''' CONSTANTS '''... | mit | 71c06428d87c0e91e8bcbfcdca9d982f | 34.641593 | 123 | 0.560025 | 4.109694 | false | false | false | false |
demisto/content | Packs/IntegrationsAndIncidentsHealthCheck/Scripts/IntegrationsCheck_Widget_IntegrationsErrorsInfo/IntegrationsCheck_Widget_IntegrationsErrorsInfo.py | 2 | 1360 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
list_data = demisto.executeCommand("getList", {"listName": "XSOAR Health - Failed Integrations Table"})
list_content = list_data[0].get('Contents', '')
list_table = []
if list_content:
try:... | mit | c52b7ee8075ed856ce445531b8135926 | 36.777778 | 115 | 0.581618 | 3.695652 | false | false | false | false |
demisto/content | Packs/Hey/Scripts/Hey/Hey.py | 2 | 7584 | import re
import subprocess
from typing import Tuple
import urllib3
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# disable insecure warnings
urllib3.disable_warnings()
# ---------- CONSTANTS ---------- #
FLOAT_RE = r'\d+\.\d+'
INT_RE = r'\d+'
BYTES_RE = r'\d+ bytes'
... | mit | 1080c619d4d7ec6b7ac28c55704bdc8e | 36.92 | 120 | 0.496176 | 4.081808 | false | false | false | false |
demisto/content | Packs/FortiSIEM/Integrations/FortiSIEMV2/FortiSIEMV2.py | 2 | 77765 | # type: ignore
import json
import re
from typing import Dict, Tuple, Callable
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import copy
''' CONSTANTS'''
DEFAULT_LIMIT = '50'
DEFAULT_PAGE = '1'
DEFAULT_PAGE_SIZE = DEFAULT_LIMIT
MAX_FETCH = 200
MAX_EVENTS_FETCH = 50
DEFAULT_... | mit | 7b3aa2c6a554ea17f238d1981313e721 | 40.232768 | 120 | 0.610262 | 4.053216 | false | false | false | false |
demisto/content | Packs/Netmiko/Integrations/Netmiko/Netmiko.py | 2 | 6499 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' IMPORTS '''
import sys
from datetime import datetime
import paramiko
from netmiko import Netmiko
''' HELPER FUNCTIONS '''
def return_file(keys):
return_file.readlines = lambda: keys.split("\n") # type: ignore
... | mit | ce4fa2386e87da288e15cbc92f1e3d20 | 34.708791 | 123 | 0.605786 | 4.066959 | false | false | false | false |
demisto/content | Packs/OpenCTI/Integrations/OpenCTI/OpenCTI_test.py | 2 | 11339 | import pytest
from OpenCTI import *
from test_data.data import RESPONSE_DATA, RESPONSE_DATA_WITHOUT_INDICATORS
from CommonServerPython import CommandResults
from pycti import StixCyberObservable, MarkingDefinition, Label, ExternalReference
class Client:
temp = ''
stix_cyber_observable = StixCyberObservable
... | mit | 72f4aefeec96087391b36bcf39318a0d | 34.769716 | 118 | 0.634447 | 4.173353 | false | true | false | false |
demisto/content | Packs/CyberTriage/Integrations/CyberTriage/CyberTriage.py | 2 | 5087 | from typing import Any, Tuple
import demistomock as demisto # noqa: F401
import requests
import urllib3
from CommonServerPython import * # noqa: F401
# Disable warning for insecure requests when cert validation is disabled
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def IS_2XX(x: int) -> b... | mit | d98a6d3594a7e0cee6103680b0e32aac | 37.832061 | 116 | 0.617653 | 3.754244 | false | false | false | false |
demisto/content | Packs/FortiGate/Integrations/FortiGate/FortiGate.py | 2 | 43119 | import demistomock as demisto
from CommonServerPython import *
''' IMPORTS '''
import json
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
USER_NAME = demisto.params().get('credentials').get('identifier')
PASSWORD = demisto.params().get('credentials').... | mit | 2ff48b34742338e616fc0fc2d04acd9b | 31.89016 | 129 | 0.613164 | 3.847849 | false | false | false | false |
demisto/content | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass_test.py | 2 | 10101 | import json
import io
import HPEArubaClearPass
from HPEArubaClearPass import *
from freezegun import freeze_time
import pytest
from pytest import raises
CLIENT_ID = "id123"
CLIENT_SECRET = "secret123"
CLIENT_AUTH = \
{
"access_token": "auth123",
"expires_in": 28800,
"token_type": "Bearer",
... | mit | 9023598fd721b91707dde17c2b2c628e | 36.550186 | 118 | 0.675379 | 3.770437 | false | true | false | false |
demisto/content | Packs/NutanixHypervisor/Integrations/NutanixHypervisor/NutanixHypervisor.py | 2 | 42344 | import copy
from typing import Dict
import pytz
import urllib3
from CommonServerPython import *
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
USECS_ENTRIES_MAPPING = {'boot_time_in_usecs': 'boot_time',
'create_time_usecs': 'create_time',
'... | mit | 1d8b0aeea6f1ed4f5990eb53a3887ea5 | 40.800592 | 120 | 0.629086 | 4.134349 | false | false | false | false |
demisto/content | Packs/CrowdStrikeFalcon/Integrations/CrowdStrikeFalcon/test_data/input_data.py | 2 | 29006 | from CommonServerPython import IncidentStatus, EntryType
response_incident = {"incident_id": "inc:afb5d1512a00480f53e9ad91dc3e4b55:1cf23a95678a421db810e11b5db693bd",
"cid": "24ab288b109b411aba970e570d1ddf58",
"host_ids": [
... | mit | 45cc2b5764fd65293e6f8b7cd08d942e | 52.615527 | 130 | 0.397469 | 4.824684 | false | false | false | false |
demisto/content | Packs/ApiModules/Scripts/AnsibleApiModule/AnsibleApiModule_test.py | 2 | 12992 | import os
from AnsibleApiModule import dict2md, rec_ansible_key_strip, generate_ansible_inventory, generic_ansible
from TestsInput.markdown import MOCK_SINGLE_LEVEL_LIST, EXPECTED_MD_LIST, MOCK_SINGLE_LEVEL_DICT, EXPECTED_MD_DICT
from TestsInput.markdown import MOCK_MULTI_LEVEL_DICT, EXPECTED_MD_MULTI_DICT, MOCK_MULTI... | mit | 1553f22ab308cbb042a221cb50e270bb | 44.268293 | 124 | 0.607759 | 3.599889 | false | true | false | false |
demisto/content | Packs/CyrenInboxSecurity/Scripts/CyrenShowThreatIndicators/CyrenShowThreatIndicators.py | 2 | 2482 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# noqa: F401
# noqa: F401
# type: ignore
import json
def stringify_indicators(threat_indicators):
#
indicator_type = threat_indicators.get('type')
# url indicators
if indicator_type == 'url':
return t... | mit | 15b4da900ede37ca01aa182cd1bd8c8f | 28.547619 | 106 | 0.565673 | 3.927215 | false | false | false | false |
demisto/content | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetPCAP/ForescoutEyeInspectButtonGetPCAP_test.py | 2 | 1394 | from pytest_mock.plugin import MockerFixture
import demistomock as demisto
import ForescoutEyeInspectButtonGetPCAP
from CommonServerPython import EntryFormat, EntryType
from ForescoutEyeInspectButtonGetPCAP import get_pcap, main
def test_get_pcap(mocker: MockerFixture):
alert_id = 1
mock_file_result = {
... | mit | 394d2a596b4a0e81099da6d8b387de9f | 33.85 | 97 | 0.688666 | 3.547074 | false | true | false | false |
demisto/content | Packs/AzureCompute/Integrations/AzureCompute_v2/AzureCompute_v2_test.py | 2 | 7416 | import pytest
import json
from AzureCompute_v2 import MsGraphClient, screen_errors, assign_image_attributes, list_vms_command,\
create_vm_parameters, get_network_interface_command, get_public_ip_details_command, create_nic_command
# test_create_vm_parameters data:
CREATE_VM_PARAMS_ARGS = {"resource_group": "compu... | mit | 20e611b6eddf6ec91015d5efb635a582 | 38.446809 | 122 | 0.560545 | 3.722892 | false | true | false | false |
demisto/content | Packs/PhishLabs/Integrations/PhishLabsIOC/PhishLabsIOC.py | 2 | 27913 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import json
import requests
from typing import Callable
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # type: ignore
''' GLOBALS/PARAMS '''
HEADERS: dict = {
'Content-T... | mit | 702e46371ed6e6045ddd18bad9efb9bc | 37.02861 | 129 | 0.572278 | 3.972815 | false | false | false | false |
demisto/content | Packs/QRadar/Integrations/QRadar_v3/QRadar_v3.py | 2 | 182657 | import concurrent.futures
import secrets
from enum import Enum
from ipaddress import ip_address
from typing import Tuple, Set, Dict
from urllib import parse
import dateparser
import pytz
import urllib3
from CommonServerUserPython import * # noqa
from CommonServerPython import * # noqa # pylint: disable=unused-wildc... | mit | 40f7878b693b8247265d1092f7e24478 | 42.813145 | 130 | 0.623814 | 3.874038 | false | false | false | false |
demisto/content | Packs/MicroFocusSMAX/Integrations/MicroFocusSMAX/MicroFocusSMAX.py | 2 | 23179 | from CommonServerPython import *
import requests
import traceback
from typing import Dict, Any
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
''' CLIENT CLASS '''
class Client(BaseClient):
def __init__(self, base_url: str, toke... | mit | 2da0178dd6a404d7481f9fd4a29443ed | 36.205457 | 116 | 0.642996 | 3.942677 | false | false | false | false |
demisto/content | Packs/CommonScripts/Scripts/ParseHTMLIndicators/ParseHTMLIndicators.py | 2 | 2911 | import re
import demistomock as demisto # noqa: F401
import requests
from bs4 import BeautifulSoup
from CommonServerPython import * # noqa: F401
from tld import get_tld
def strip_html_tags(page):
# Parse the HTML content
soup = BeautifulSoup(page.content, "html.parser")
# Strip irrelevant tags
for ... | mit | 4d94ab63041cb663db416b3729137b9a | 36.320513 | 129 | 0.618001 | 3.038622 | false | false | false | false |
demisto/content | Packs/NTT_Cyber_Threat_Sensor/Integrations/NTT_Cyber_Threat_Sensor/NTT_Cyber_Threat_Sensor.py | 2 | 10177 | import json
import base64
from datetime import datetime
from datetime import timezone
from datetime import timedelta
import requests
import dateutil.parser
# Local imports
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
# Disable insecure warnings
requests.packages.... | mit | 40ffcc144718f3e6f9cb3ac8a23f60f7 | 33.265993 | 100 | 0.557433 | 3.854924 | false | false | false | false |
demisto/content | Packs/FireEyeCM/Integrations/FireEyeCM/test_data/result_constants.py | 2 | 6310 | QUARANTINED_EMAILS_CONTEXT = [
{'appliance_id': 'appliance_id', 'completed_at': '2021-02-14T09:42:48',
'email_uuid': 'uuid', 'from': 'test@malicious.net',
'message_id': 'queue-id@no-message-id',
'quarantine_path': '/data/email-analysis/quarantine2/2021-02-14/09/queue_id',
'queue_id': 'queue_id',... | mit | caf1430d94aa43b586c8ff32ccfc4ba8 | 40.513158 | 122 | 0.543106 | 2.754256 | false | true | true | false |
demisto/content | Packs/Infinipoint/Integrations/Infinipoint/Infinipoint.py | 2 | 14350 | from CommonServerPython import *
from typing import Any, Dict, List, Optional, cast
''' IMPORTS '''
import jwt
import math
import dateparser
from datetime import timezone
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBAL VARS '''
BASE_URL = "https://console.infinipoint.io"
MAX_INC... | mit | 61c9645c830f85ef3213c584c1ece3f2 | 29.860215 | 113 | 0.546132 | 3.86064 | false | false | false | false |
demisto/content | Packs/ThycoticDSV/Integrations/ThycoticDSV/ThycoticDSV.py | 1 | 3032 | import urllib3
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
# from typing import Dict
# Disable insecure warnings
urllib3.disable_warnings()
class Client(BaseClient):
def __init__(self, server_url: str, client_id: str, client_secret: str, proxy: bool, veri... | mit | 11b805ba8306887c2b36952fedfef125 | 31.255319 | 115 | 0.603892 | 3.86242 | false | false | false | false |
demisto/content | Packs/PassiveTotal/Integrations/PassiveTotal_v2/PassiveTotal_v2.py | 2 | 104354 | from CommonServerPython import *
''' IMPORTS '''
from typing import Dict, Any, List, Union, Tuple, Optional
from requests import ConnectionError
from requests.exceptions import MissingSchema, InvalidSchema
import urllib3
import traceback
import re
from urllib import parse
# Disable insecure warnings
urllib3.disable_... | mit | 86c418c01ce8e5f818a19ef65ab61003 | 37.196925 | 127 | 0.62563 | 3.882651 | false | false | false | false |
demisto/content | Packs/MicrosoftGraphIdentityandAccess/Integrations/MicrosoftGraphIdentityandAccess/MicrosoftGraphIdentityandAccess.py | 2 | 36049 | """
An integration to MS Graph Identity and Access endpoint.
https://docs.microsoft.com/en-us/graph/api/resources/serviceprincipal?view=graph-rest-1.0
"""
from typing import Tuple
import urllib3
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # no... | mit | db9a46baf257c7733a12b3b56088923e | 37.592077 | 152 | 0.596588 | 3.883323 | false | false | false | false |
demisto/content | Packs/CimTrak-SystemIntegrityAssurance/Integrations/CimTrak/CimTrak.py | 2 | 129282 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import urllib3
import dateparser
import traceback
from typing import Any, Dict, List, Optional, Union
################################################################
# CimTrak Python API Begin
##################################... | mit | 046e481176c9618e34bd27490ac5959b | 33.641479 | 126 | 0.557603 | 4.112415 | false | false | false | false |
demisto/content | Packs/CrowdStrikeFalconX/Integrations/CrowdStrikeFalconX/TestsInput/http_responses.py | 2 | 27808 | SEND_UPLOADED_FILE_TO_SANDBOX_ANALYSIS_HTTP_RESPONSE = {
"errors": [],
"meta": {
"powered_by": "falconx-api",
"query_time": 0.163158146,
"quota": {
"in_progress": 3,
"total": 100,
"used": 36
},
"trace_id": "trace_id"
},
"resourc... | mit | 40eae789261134705c7b45b1a6179f37 | 36.176471 | 114 | 0.304625 | 5.081871 | false | false | true | false |
demisto/content | Packs/RiskSense/Scripts/RiskSenseDisplayCVEChartScript/RiskSenseDisplayCVEChartScript.py | 2 | 1256 | from CommonServerPython import *
from typing import Dict, Any
def display_cve_chart() -> Dict[str, Any]:
cves_count = demisto.args().get('CvesCount', 0)
trending_cves_count = demisto.args().get('TrendingCvesCount', 0)
entry_result = {
"Type": 17,
"ContentsFormat": "bar",
"Contents... | mit | 01535e6dec7a08f637bb286895f31384 | 26.911111 | 68 | 0.423567 | 3.987302 | false | false | false | false |
demisto/content | Packs/Uptycs/Integrations/Uptycs/Uptycs.py | 2 | 79993 | import demistomock as demisto
from CommonServerPython import *
###############################################################################
# import required libraries package
###############################################################################
import os
import ast
import json
import jwt
from datetime i... | mit | 28e732d596d74e763448064f7182ccbf | 32.358215 | 95 | 0.532959 | 3.716456 | false | false | false | false |
demisto/content | Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.py | 2 | 10527 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Any, Tuple
""" CONSTANT VARIABLES """
CONTEXT_PREFIX = "TAXII2"
COMPLEX_OBSERVATION_MODE_SKIP = "Skip indicators with more than a single observation"
COMPLEX_OBSERVATION_MODE_CREATE_ALL = "Create in... | mit | e958498bed765a41b3abaeb070d79ff1 | 34.207358 | 120 | 0.627529 | 3.930919 | false | false | false | false |
demisto/content | Packs/RSANetWitness_v11_1/Integrations/RSANetWitness_v11_1/RSANetWitness_v11_1_test.py | 2 | 8614 | import demistomock as demisto
INCIDENT_NEW = {
"items": [{
"eventCount": 1,
"alertMeta": {
"SourceIp": ["8.8.8.8"],
"DestinationIp": ["8.8.4.4"]
},
"openRemediationTaskCount": 0,
"sources": [
None
],
"id": "INC-3",
... | mit | c528f13eae490bdfa25425746647e870 | 28.003367 | 103 | 0.523798 | 3.531775 | false | false | false | false |
demisto/content | Packs/Base/Scripts/FindSimilarIncidentsByText/FindSimilarIncidentsByText.py | 2 | 7203 | # type: ignore
import dateutil.parser
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
from six import string_types
from CommonServerPython import *
INCIDENT_TEXT_FIELD = 'incident_text_for_tfidf'
def parse_datetime(datetime_str):
return dateutil.pars... | mit | 58063592dd24d224e701e725a252b978 | 39.016667 | 119 | 0.618909 | 3.661922 | false | false | false | false |
demisto/content | Packs/PAN-OS/Scripts/PanoramaSecurityPolicyMatchWrapper/PanoramaSecurityPolicyMatchWrapper.py | 2 | 4839 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Dict, Any
''' STANDALONE FUNCTION '''
def fix_nested_dicts(rules):
for key, value in rules.items():
if isinstance(value, dict):
if members := value.get('member'):
... | mit | bbdf568b3e89c40304613531ca089967 | 34.321168 | 115 | 0.598471 | 4.019103 | false | false | false | false |
demisto/content | Packs/Jira/Integrations/JiraV2/JiraV2.py | 2 | 63432 | from typing import Union, Optional
from requests_oauthlib import OAuth1
from dateparser import parse
from datetime import timedelta
from CommonServerPython import *
import urllib3
urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
BASE_URL = demisto.getParam('url').rstrip('/') + '/'
API_TOKEN = demisto.getParam('APIto... | mit | 402ca9d092ff15002d11b877a7861381 | 40.594754 | 128 | 0.611127 | 3.87987 | false | false | false | false |
demisto/content | Packs/Sixgill-Darkfeed/Integrations/Sixgill_Darkfeed/Sixgill_Darkfeed.py | 2 | 13666 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from typing import Dict, List, Set, Any, Callable, Optional
from collections import OrderedDict
import traceback
import requests
from sixgill.sixgill_request_classes.sixgill_auth_request import SixgillA... | mit | 990fc70d71de7d7572816d58930e9224 | 42.384127 | 129 | 0.586492 | 3.692516 | false | false | false | false |
demisto/content | Packs/Malware/Scripts/AppendindicatorFieldWrapper/AppendindicatorFieldWrapper.py | 2 | 1991 | """
A wrapper script to the 'AppendindicatorField' script, that enables adding tags to certain indicators.
Note: You can use this script as a layout button that allows adding tags to indicators.
"""
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import ... | mit | 9d52ea07ff5e7974872343bd331a15d5 | 30.603175 | 114 | 0.671522 | 4.28172 | false | false | false | false |
demisto/content | Packs/DigitalShadows/Scripts/DsSearchQueryArray/DsSearchQueryArray_test.py | 2 | 1951 | import pytest
from DsSearchQueryTestData import *
@pytest.mark.parametrize(
"query, output",
[
("alarmautomatika.com", 2),
('"alarmautomatika.com"', 1),
('"Term 1"', 1),
('Term1 AND "Term 2" OR (Term3 Term4)', 4),
('frumvarpið "stæðist ekki" AND stjórnarskrá', 3),
... | mit | a94237a12e5fcedd4c0c243f8a0e6488 | 35.698113 | 78 | 0.610797 | 3.043818 | false | true | false | false |
demisto/content | Packs/ExpanseV2/Integrations/ExpanseV2/ExpanseV2_test.py | 2 | 80230 | """Expanse V2 Integration for Cortex XSOAR - Unit Tests file
"""
import json
import io
import copy
import demistomock as demisto
import pytest
from ExpanseV2 import DEPRECATED_COMMANDS, DeprecatedCommandException
INTEGRATION_NAME = 'ExpanseV2'
@pytest.fixture(autouse=True)
def handle_calling_context(mocker):
m... | mit | fae8c7f8d025e3905043b16957d9d225 | 38.079396 | 126 | 0.649919 | 3.296762 | false | true | false | false |
demisto/content | Packs/DNSDB/Integrations/DNSDB_v2/DNSDB_v2.py | 2 | 29542 | import inspect
import locale
from typing import Iterator, Dict, List, Tuple, Union, Any, Callable, Iterable
import urllib
import urllib.parse
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
import datetime # type: ignore[no-redef]
import json
import re
import requests
# Disable insecure w... | mit | bc6a7f3755597f9f3dec54ea3f776764 | 37.871053 | 130 | 0.520987 | 3.942087 | false | false | false | false |
demisto/content | Packs/GreatHorn/Integrations/GreatHorn/GreatHorn.py | 2 | 17801 | import json
import traceback
from typing import Any, Dict, Optional
import demistomock as demisto # noqa: F401
import urllib3
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
urllib3.disable_warnings()
''' CLIENT CLASS '''
class Client(BaseClient):
"""Client class to interact with th... | mit | a42cec07bfc8d2dc7fc24fbc34fb30e3 | 35.627572 | 127 | 0.553452 | 4.20033 | false | false | false | false |
demisto/content | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalHostPairsChildrenWidgetScript/RiskIQPassiveTotalHostPairsChildrenWidgetScript_test.py | 2 | 2976 | from RiskIQPassiveTotalHostPairsChildrenWidgetScript import set_arguments_for_widget_view
def test_for_host_pairs_children_widget_set_arguments_when_indicator_type_riskiqasset_and_riskiqassettype_is_empty():
# Configure
# set argument for command
indicator_data = {
'indicator_type': 'RiskIQAsset'... | mit | 1bd634ae0e8cba92b27cdc4530655b79 | 28.176471 | 120 | 0.641801 | 3.973298 | false | false | false | false |
demisto/content | Utils/github_workflow_scripts/create_internal_pr.py | 2 | 3438 | #!/usr/bin/env python3
import json
import urllib3
from blessings import Terminal
from github import Github
from utils import get_env_var, timestamped_print
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print = timestamped_print
def main():
"""Creates Internal PRs from Merged External PRs... | mit | 385e258f5744fb8e385dc405a3da1d5d | 39.928571 | 106 | 0.691099 | 3.483283 | false | false | false | false |
demisto/content | Packs/GLIMPS_Detect/Integrations/GLIMPSDetect/GLIMPSDetect_test.py | 2 | 18678 | import GLIMPSDetect
def mocked_gdetect_get():
return {
"uuid": "23465d22-3464-39ce-b8b3-bc2ee7d6eecf",
"sha256": "005b00d41749f7b0336d4d5fe0402dcfc95ae0df44a2231a89a59919eeb30b31",
"sha1": "2159b8d8b985f32641314220bb24126747b71d13",
"md5": "c24d410c7e7d4b6066e09ceee057fbf9",
... | mit | c0ce0a98bd09ff435c431d3597809290 | 38.995717 | 129 | 0.607238 | 2.797364 | false | false | false | false |
demisto/content | Packs/ComputerVisionEngine/Integrations/ComputerVisionEngine/ComputerVisionEngine.py | 2 | 6495 | import os
import cv2
import demistomock as demisto
import numpy as np
from CommonServerPython import * # noqa: F401
# The command demisto.command() holds the command sent from the user.
if demisto.command() == 'test-module':
demisto.results('ok')
sys.exit(0)
if demisto.command() == 'yolo-coco-process-image'... | mit | 4a58a33a775507006e293ddde05fb055 | 41.45098 | 99 | 0.597998 | 3.696642 | false | false | false | false |
demisto/content | Packs/GoogleDorking/Scripts/ExtractUsernames/ExtractUsernames.py | 2 | 2208 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import traceback
import re
''' STANDALONE FUNCTION '''
def extract_users_from_file(entry_id: str, pattern: Optional[str]) -> list:
users = []
res = demisto.getFilePath(entry_id)
if not res:
raise DemistoExc... | mit | 68c474aa4a71ff5f0ca2256c8dd9dc75 | 28.052632 | 129 | 0.593297 | 3.686144 | false | false | false | false |
demisto/content | Packs/CommonScripts/Scripts/FilterByList/FilterByList.py | 2 | 2896 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
def empty_list_context(items, list_name):
ec = {'List.In': [], 'List.NotIn': items}
human_readable = 'The list ' + list_name + ' is empty'
return human_readable, ec
def build_filtered_data(lst, items, ig... | mit | 7acd0ca9abe41f564aef4d4d1c5de766 | 32.287356 | 110 | 0.592196 | 3.825627 | false | false | false | false |
demisto/content | Packs/PopularCybersecurityNews/Integrations/PopularNews/PopularNews.py | 2 | 3732 | import demistomock as demisto # noqa: F401
import requests
from bs4 import BeautifulSoup
from CommonServerPython import * # noqa: F401
TABLE = []
VERIFY = demisto.params()['insecure']
def scrape_kos():
articles = []
links = []
dates = []
response = requests.get("https://krebsonsecurity.com/", verif... | mit | 64f0be5d752abf5974d42d36f7b2b3b5 | 30.897436 | 122 | 0.606645 | 3.623301 | false | false | false | false |
demisto/content | Packs/AttivoBotsink/Integrations/AttivoBotsink/AttivoBotsink.py | 2 | 31036 | import base64
import json
import os
import socket
import time
from datetime import datetime
import requests
import urllib3
import demistomock as demisto
from CommonServerPython import *
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
SERVER = demisto.params()['server']
API_USER = demisto.params(... | mit | 906cfe89a17b98dbe1ff6e8456b9ecbc | 37.941029 | 128 | 0.564474 | 3.783955 | false | false | false | false |
demisto/content | Packs/CrowdStrikeIntel/Integrations/CrowdStrikeFalconIntel_v2/CrowdStrikeFalconIntel_v2.py | 2 | 24511 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from datetime import datetime, timezone
from typing import Union, Any, Dict
from dateparser import parse
import urllib3
import traceback
# Disable insecure warnings
urllib3.disable_warnings()
''' GLOBAL VARIABLES '''
... | mit | 9edac88f92d1523b79a836751c53909f | 39.116203 | 119 | 0.589694 | 3.934982 | false | false | false | false |
demisto/content | Packs/AccentureCTI/Integrations/ACTIVulnerabilityQuery/ACTIVulnerabilityQuery.py | 2 | 10431 | import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
import requests
import traceback
from typing import List
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%d %H:%... | mit | 2855cf65770da75cbbd5965a69c5cdc2 | 37.069343 | 220 | 0.603969 | 3.8125 | false | false | false | false |
demisto/content | Packs/TrendMicroCAS/Integrations/TrendMicroCAS/test_data/commands_raw_response.py | 2 | 6669 | SECURITY_EVENTS_LIST_RESULT = {
"current_link": "",
"last_log_item_generation_time": "2020-07-19T22:51:40.000Z",
"next_link": "",
"security_events": [
{
"event": "security_risk_scan",
"log_item_id": "a9e2990a-8d7c-45e9-84a8-84b59087b2dd",
"message": {
... | mit | 0bdb707321c9a618ecefa65039e92b72 | 33.205128 | 185 | 0.54296 | 2.715391 | false | false | false | false |
demisto/content | Tests/scripts/utils/compare_staging_graph.py | 1 | 8762 | # function to compare two zip files
import argparse
import filecmp
import json
import os
from pathlib import Path
import shutil
from zipfile import ZipFile
import difflib
from contextlib import redirect_stdout
import dictdiffer
from ruamel.yaml import YAML
from slack_sdk import WebClient
yaml = YAML()
SKIPPED_FILE... | mit | 4fdffa69daf0a43321b6001b7be18991 | 35.508333 | 115 | 0.613901 | 3.428013 | false | false | false | false |
demisto/content | Packs/ExpanseV2/Scripts/ExpanseRefreshIssueAssets/ExpanseRefreshIssueAssets.py | 2 | 2643 | import demistomock as demisto # noqa # pylint: disable=unused-wildcard-import
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from typing import Dict, Any
''' COMMAND FUNCTION '''
def refresh_issue_assets_command(args: Dict[str, Any]) -> CommandResults:
incident = demisto.inc... | mit | 7b00e58fc17f130c0b4d956189d541e2 | 32.455696 | 114 | 0.593265 | 3.892489 | false | false | false | false |
demisto/content | Packs/FeedCyrenThreatInDepth/Scripts/CyrenThreatInDepthRandomHunt/CyrenThreatInDepthRandomHunt.py | 2 | 3166 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from enum import Enum
from random import randrange
import yaml
class FeedName(str, Enum):
IP_REPUTATION = "ip_reputation"
PHISHING_URLS = "phishing_urls"
MALWARE_URLS = "malware_urls"
MALWARE_FILES = ... | mit | 26113d9118b087a4b7f8a698cfcfbe7f | 32.326316 | 95 | 0.64561 | 3.430119 | false | false | false | false |
demisto/content | Packs/Palo_Alto_Networks_Enterprise_DLP/Scripts/DlpAskFeedback/DlpAskFeedback.py | 2 | 6547 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import dateparser
DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
OPTIONS = [
{
'text': 'Yes',
'style': 'primary'
},
{
'text': 'No',
'style': 'primary'
}
]
def create_blocks(message: str, e... | mit | 241300466fe43245ae91ba1ed142209f | 30.781553 | 112 | 0.501604 | 4.096996 | false | false | false | false |
demisto/content | Packs/Jira/Integrations/JiraEventCollector/JiraEventCollector.py | 2 | 6839 | from enum import Enum
import urllib3
from CommonServerPython import *
import demistomock as demisto
from pydantic import BaseConfig, BaseModel, AnyUrl, Json, Field # pylint: disable=no-name-in-module
import requests
from requests.auth import HTTPBasicAuth
import dateparser
from datetime import datetime, timedelta
url... | mit | 485e37de33d7dcd9e9d4c28aac5761b5 | 31.879808 | 120 | 0.592777 | 3.962341 | false | false | false | false |
demisto/content | Packs/Exabeam/Integrations/Exabeam/Exabeam.py | 2 | 75438 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Tuple, Dict, List, Any, Optional, Union
import requests
import dateparser
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
TOKEN_INPUT_IDENTIFIER = '__token'
class Client(Ba... | mit | ddb91d08832d0e398a4275e91d6a21a0 | 37.177126 | 120 | 0.605782 | 3.9083 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.