repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
flink | flink-master/flink-python/pyflink/fn_execution/table/aggregate_slow.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 23,406 | 37.43514 | 97 | py |
flink | flink-master/flink-python/pyflink/fn_execution/table/window_context.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 9,220 | 35.737052 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/table/window_assigner.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 11,840 | 36.590476 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/table/state_data_view.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 10,571 | 34.122924 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/table/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/table/operations.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 26,805 | 45.457539 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/table/window_aggregate_slow.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 20,522 | 42.115546 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/process/counter_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 1,782 | 34.66 | 86 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/process/distribution_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 1,312 | 40.03125 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/process/meter_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 1,657 | 37.55814 | 86 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/process/metric_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 4,138 | 38.798077 | 96 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/process/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/tests/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/tests/test_metric.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 4,322 | 43.112245 | 92 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/embedded/counter_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 1,511 | 35 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/embedded/distribution_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 1,278 | 41.633333 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/embedded/meter_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 1,426 | 37.567568 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/embedded/metric_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 2,607 | 41.064516 | 93 | py |
flink | flink-master/flink-python/pyflink/fn_execution/metrics/embedded/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/tests/test_coders.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 7,729 | 37.267327 | 97 | py |
flink | flink-master/flink-python/pyflink/fn_execution/tests/test_process_mode_boot.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 6,285 | 41.761905 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/tests/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/tests/test_flink_fn_execution_pb2.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 4,000 | 49.0125 | 93 | py |
flink | flink-master/flink-python/pyflink/fn_execution/embedded/state_impl.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 4,222 | 46.988636 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/embedded/java_utils.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 10,051 | 48.034146 | 98 | py |
flink | flink-master/flink-python/pyflink/fn_execution/embedded/operation_utils.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 6,187 | 37.675 | 98 | py |
flink | flink-master/flink-python/pyflink/fn_execution/embedded/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/embedded/operations.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 5,340 | 36.879433 | 90 | py |
flink | flink-master/flink-python/pyflink/fn_execution/embedded/converters.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 9,985 | 34.038596 | 98 | py |
flink | flink-master/flink-python/pyflink/fn_execution/utils/operation_utils.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 12,727 | 38.775 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/utils/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_sdk_worker_main.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 2,764 | 36.364865 | 87 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_coder_impl_slow.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 3,466 | 41.802469 | 98 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_coders.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 3,770 | 39.117021 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_stream_slow.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 2,503 | 35.823529 | 81 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_worker_pool_service.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 8,030 | 42.646739 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_operations_slow.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 9,035 | 38.982301 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/__init__.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 958 | 52.277778 | 80 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_boot.py | #!/usr/bin/env python
#################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.... | 5,403 | 42.580645 | 100 | py |
flink | flink-master/flink-python/pyflink/fn_execution/beam/beam_operations.py | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 9,647 | 41.502203 | 99 | py |
Robust-Training-for-Time-Series | Robust-Training-for-Time-Series-main/CNNmodel.py | import sys
import os
import numpy as np
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
import pickle as pkl
from GAK import tf_gak
def clip_tensor(X, eps, norm=np.inf):
if norm not ... | 12,895 | 42.275168 | 140 | py |
Robust-Training-for-Time-Series | Robust-Training-for-Time-Series-main/hyparamtuning.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 7 09:58:45 2020
@author: BkTaha
"""
import json
import pickle as pkl
import numpy as np
from sklearn.metrics import pairwise_distances
def get_hyparams(dataset_name):
json_param = "datasets_parameters.json"
with open(json_param) as jf:
info = json.load(... | 804 | 25.833333 | 83 | py |
Robust-Training-for-Time-Series | Robust-Training-for-Time-Series-main/preprocess_dataset.py | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 8 12:54:10 2019
@author: BkTaha
"""
import os
import json
import numpy as np
import pickle as pkl
import pandas as pd
from scipy.io import arff
from absl import app, flags
FLAGS = flags.FLAGS
def load_ucr_data(dataset_name, parent_file):
#Extract Data Dimensions
... | 5,982 | 35.481707 | 102 | py |
Robust-Training-for-Time-Series | Robust-Training-for-Time-Series-main/test_RO_TS_model.py | import sys
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3"
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="0,1"
import json
import pickle as pkl
from absl import app, flags
from CNNmodel import cnn_class
FLAGS = flags.FLAGS
def main(argv):
json_param = "dat... | 1,456 | 36.358974 | 118 | py |
Robust-Training-for-Time-Series | Robust-Training-for-Time-Series-main/GAK.py | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 20:31:54 2020
@author: BkTaha
"""
import numpy as np
import tensorflow as tf
def tf_cdist(s1, s2):
M1 = s1.shape[0]
M2 = s2.shape[0]
p1 = tf.matmul(tf.expand_dims(tf.reduce_sum(tf.square(s1), 1), 1),
tf.ones(shape=(1, M2), dtype=tf.... | 2,366 | 34.328358 | 108 | py |
Robust-Training-for-Time-Series | Robust-Training-for-Time-Series-main/RO_TS.py | import sys
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3"
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import json
import tensorflow as tf
import pickle as pkl
from absl import app, flags
from CNNmodel import cnn_class
from hyparamtuning import get_hyparams
FLAGS = flags... | 3,526 | 45.407895 | 165 | py |
LightDepth | LightDepth-main/torch_implementation/config.py | import datetime
import os
import json
class Config():
def __init__(self,base_kw_args):
self.update(base_kw_args)
def update(self,overload_config):
for k, v in overload_config.items():
try:
if hasattr(self,k):
self.k = v
el... | 2,285 | 35.870968 | 93 | py |
LightDepth | LightDepth-main/torch_implementation/scripts/dataloaders.py | # This file is mostly taken from BTS; author: Jin Han Lee, with only slight modifications
import os
import random
import numpy as np
import torch
import torch.utils.data.distributed
from torch.nn import MaxPool2d
from PIL import Image
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms... | 9,302 | 36.063745 | 109 | py |
LightDepth | LightDepth-main/torch_implementation/scripts/models/ordinary_unet.py | import torch
class OrdinaryUNet():
def __init__(self,config):
def UpConv2D(tensor, filters, name, concat_with):
up_i = torch.nn.Upsample((2, 2),mode='bilinear')(tensor)
up_i = torch.cat([up_i, encoder.get_layer(concat_with).output]) # Skip connection
up_i = Conv2D(filter... | 625 | 51.166667 | 110 | py |
LightDepth | LightDepth-main/tf_implementation/config.py | import datetime
import os
import json
class Config:
def __init__(self,base_kw_args):
self.update(base_kw_args)
def update(self,overload_config):
if overload_config == {}:
print('updated with empty config!')
for k, v in overload_config.items():
try:
... | 2,272 | 36.262295 | 93 | py |
LightDepth | LightDepth-main/tf_implementation/scripts/utils.py | from glob import glob
import os
import tensorflow as tf
import numpy as np
def good(image):
num_channels = image.shape[-1]
means = [123.68, 116.779, 103.939]
channels = tf.split(axis=2, num_or_size_splits=num_channels, value=image)
for i in range(num_channels):
channels[i] += means[i]
temp... | 2,184 | 36.033898 | 82 | py |
LightDepth | LightDepth-main/tf_implementation/scripts/dataloaders.py | import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras.layers import MaxPooling2D
import os
class OrdinaryDataloader(object):
def __init__(self, config,is_training=True,debug=False):
self.do_flip = config.do_flip
self.do_augment = config.do_augment
... | 8,542 | 39.488152 | 107 | py |
LightDepth | LightDepth-main/tf_implementation/scripts/models/efficient_unet.py | from tensorflow.keras.layers import Layer, InputSpec
import tensorflow as tf
from tensorflow.keras import applications
from tensorflow.keras.layers import Conv2D, Concatenate, LeakyReLU, UpSampling2D
import keras.backend as K
import keras.utils.conv_utils as conv_utils
from tensorflow.keras.models import Model
import n... | 9,917 | 45.345794 | 116 | py |
LightDepth | LightDepth-main/tf_implementation/scripts/models/ordinary_unet.py | from tensorflow.keras.layers import Layer, InputSpec
import tensorflow as tf
from tensorflow.keras import applications
from tensorflow.keras.layers import Conv2D, Concatenate, LeakyReLU, UpSampling2D
import keras.backend as K
import keras.utils.conv_utils as conv_utils
from tensorflow.keras.models import Model
import n... | 9,771 | 45.312796 | 116 | py |
dpkt | dpkt-master/setup.py | import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
package_name = 'dpkt'
description = 'fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols'
readme = open('README.md').read()
requirements = []
# PyPI Readme
long_description = ... | 1,701 | 33.04 | 103 | py |
dpkt | dpkt-master/examples/print_icmp.py | #!/usr/bin/env python
"""
This example expands on the print_packets example. It checks for ICMP packets and displays the ICMP contents.
"""
import dpkt
import datetime
from dpkt.utils import mac_to_str, inet_to_str
def print_icmp(pcap):
"""Print out information about each packet in a pcap
Args:
... | 2,076 | 34.810345 | 109 | py |
dpkt | dpkt-master/examples/print_dns_truncated.py | """
Use DPKT to read in a pcap file and print out the contents of truncated
DNS packets. This example show how to read/handle truncated packets
"""
import sys
import dpkt
import datetime
from dpkt.utils import mac_to_str, inet_to_str, make_dict
from pprint import pprint
def print_packet(buf):
"""Print out informa... | 3,422 | 33.575758 | 97 | py |
dpkt | dpkt-master/examples/print_packets.py | """
Use DPKT to read in a pcap file and print out the contents of the packets.
This example is focused on the fields in the Ethernet Frame and IP packet.
"""
import dpkt
import datetime
from dpkt.utils import mac_to_str, inet_to_str
def print_packets(pcap):
"""Print out information about each packet in a pcap
... | 1,744 | 31.924528 | 98 | py |
dpkt | dpkt-master/examples/__init__.py | 0 | 0 | 0 | py | |
dpkt | dpkt-master/examples/print_http_requests.py | """
This example expands on the print_packets example. It checks for HTTP request headers and displays their contents.
NOTE: We are not reconstructing 'flows' so the request (and response if you tried to parse it) will only
parse correctly if they fit within a single packet. Requests can often fit in a single pac... | 2,796 | 38.394366 | 127 | py |
dpkt | dpkt-master/examples/old/dnsping.py | #!/usr/bin/env python
from __future__ import print_function
import random
import socket
import dpkt
import ping
class DNSPing(ping.Ping):
def __init__(self):
ping.Ping.__init__(self)
self.op.add_option('-z', dest='zone', type='string',
default=socket.gethostname().spli... | 1,850 | 31.473684 | 73 | py |
dpkt | dpkt-master/examples/old/nbtping.py | #!/usr/bin/env python
import socket
from dpkt import netbios
import ping
class NBTPing(ping.Ping):
def __init__(self):
ping.Ping.__init__(self)
self.op.add_option('-p', dest='port', type='int', default=137,
help='Remote NetBIOS name server port')
def open_sock(self... | 1,480 | 30.510638 | 80 | py |
dpkt | dpkt-master/examples/old/ping.py | #!/usr/bin/env python
import math
import optparse
import random
import socket
import sys
import time
import dpkt
class Ping(object):
def __init__(self):
usage = '%prog [OPTIONS] <host>'
self.op = optparse.OptionParser(usage=usage)
self.op.add_option('-c', dest='count', type='int', default... | 3,810 | 30.237705 | 81 | py |
dpkt | dpkt-master/examples/old/dhcprequest.py | #!/usr/bin/env python
from __future__ import print_function
import sys
import socket
# Since pcapy is not a requirement of dpkt, test the import and give message
try:
import pcapy
except ImportError:
print('Could not import pcapy. Please do a $pip install pcapy')
sys.exit(1)
# dpkt imports
from dpkt impo... | 1,557 | 20.342466 | 76 | py |
dpkt | dpkt-master/dpkt/arp.py | # $Id: arp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Address Resolution Protocol."""
from __future__ import absolute_import
from . import dpkt
# Hardware address format
ARP_HRD_ETH = 0x0001 # ethernet hardware
ARP_HRD_IEEE802 = 0x0006 # IEEE 802 hardware
# Protocol address format
ARP_PRO_IP =... | 1,143 | 25.604651 | 61 | py |
dpkt | dpkt-master/dpkt/ip.py | # $Id: ip.py 87 2013-03-05 19:41:04Z [email protected] $
# -*- coding: utf-8 -*-
"""Internet Protocol."""
from __future__ import print_function
from __future__ import absolute_import
from . import dpkt
from .compat import iteritems
from .utils import inet_to_str, deprecation_warning
_ip_proto_names = {} # {1: 'IC... | 18,117 | 34.877228 | 117 | py |
dpkt | dpkt-master/dpkt/aim.py | # $Id: aim.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""AOL Instant Messenger."""
from __future__ import absolute_import
import struct
from . import dpkt
# OSCAR: http://iserverd1.khstu.ru/oscar/
class FLAP(dpkt.Packet):
"""Frame Layer Protocol.
See more about the FLAP on
https://e... | 5,353 | 32.4625 | 99 | py |
dpkt | dpkt-master/dpkt/udp.py | # $Id: udp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""User Datagram Protocol."""
from __future__ import absolute_import
from . import dpkt
UDP_HDR_LEN = 8
UDP_PORT_MAX = 65535
class UDP(dpkt.Packet):
"""User Datagram Protocol.
User Datagram Protocol (UDP) is one of the core members of ... | 985 | 28 | 94 | py |
dpkt | dpkt-master/dpkt/sip.py | # $Id: sip.py 48 2008-05-27 17:31:15Z yardley $
# -*- coding: utf-8 -*-
"""Session Initiation Protocol."""
from __future__ import absolute_import
from . import http
class Request(http.Request):
"""SIP request.
TODO: Longer class information....
Attributes:
__hdr__: Header fields of SIP request.... | 1,164 | 22.3 | 83 | py |
dpkt | dpkt-master/dpkt/sll.py | # $Id: sll.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Linux libpcap "cooked" capture encapsulation."""
from __future__ import absolute_import
from . import arp
from . import dpkt
from . import ethernet
class SLL(dpkt.Packet):
"""Linux libpcap "cooked" capture encapsulation.
TODO: Longer... | 1,741 | 31.867925 | 99 | py |
dpkt | dpkt-master/dpkt/llc.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import struct
from . import dpkt
from . import stp
class LLC(dpkt.Packet):
"""802.2 Logical Link Control (LLC) data communication protocol.
Attributes:
__hdr__ = (
('dsap', 'B', 0xaa), ... | 4,541 | 27.746835 | 88 | py |
dpkt | dpkt-master/dpkt/esp.py | # $Id: esp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Encapsulated Security Protocol."""
from __future__ import absolute_import
from . import dpkt
class ESP(dpkt.Packet):
"""Encapsulated Security Protocol.
Encapsulating Security Payload (ESP) is a member of the Internet Protocol Securit... | 1,026 | 37.037037 | 116 | py |
dpkt | dpkt-master/dpkt/dpkt.py | # $Id: dpkt.py 43 2007-08-02 22:42:59Z jon.oberheide $
# -*- coding: utf-8 -*-
"""Simple packet creation and parsing.
The dpkt project is a python module for fast, simple packet parsing, with definitions for the basic TCP/IP protocols.
"""
from __future__ import absolute_import, print_function
import copy
import stru... | 19,764 | 34.169039 | 126 | py |
dpkt | dpkt-master/dpkt/stp.py | # $Id: stp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Spanning Tree Protocol."""
from __future__ import print_function
from __future__ import absolute_import
from . import dpkt
class STP(dpkt.Packet):
"""Spanning Tree Protocol.
TODO: Longer class information....
Attributes:
... | 2,005 | 19.895833 | 102 | py |
dpkt | dpkt-master/dpkt/pppoe.py | # $Id: pppoe.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""PPP-over-Ethernet."""
from __future__ import absolute_import
import struct
import codecs
from . import dpkt
from . import ppp
# RFC 2516 codes
PPPoE_PADI = 0x09
PPPoE_PADO = 0x07
PPPoE_PADR = 0x19
PPPoE_PADS = 0x65
PPPoE_PADT = 0xA7
PPPoE_S... | 5,158 | 25.187817 | 117 | py |
dpkt | dpkt-master/dpkt/pim.py | # $Id: pim.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Protocol Independent Multicast."""
from __future__ import absolute_import
from . import dpkt
class PIM(dpkt.Packet):
"""Protocol Independent Multicast.
Protocol Independent Multicast (PIM) is a collection of multicast routing protoco... | 2,041 | 26.972603 | 119 | py |
dpkt | dpkt-master/dpkt/edp.py | """Extreme Discovery Protocol."""
from __future__ import absolute_import
import dpkt
class EDP(dpkt.Packet):
__hdr__ = (
('version', 'B', 1),
('reserved', 'B', 0),
('hlen', 'H', 0),
('sum', 'H', 0),
('seq', 'H', 0),
('mid', 'H', 0),
('mac', '6s', b'')
)... | 2,291 | 28.384615 | 127 | py |
dpkt | dpkt-master/dpkt/sll2.py | # -*- coding: utf-8 -*-
"""Linux libpcap "cooked v2" capture encapsulation."""
from __future__ import absolute_import
from . import arp
from . import dpkt
from . import ethernet
class SLL2(dpkt.Packet):
"""Linux libpcap "cooked v2" capture encapsulation.
See https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_... | 1,966 | 34.763636 | 100 | py |
dpkt | dpkt-master/dpkt/aoeata.py | # -*- coding: utf-8 -*-
"""ATA over Ethernet ATA command"""
from __future__ import print_function
from __future__ import absolute_import
from . import dpkt
ATA_DEVICE_IDENTIFY = 0xec
class AOEATA(dpkt.Packet):
"""ATA over Ethernet ATA command.
See more about the AOEATA on
https://en.wikipedia.org/wiki/... | 1,130 | 24.704545 | 117 | py |
dpkt | dpkt-master/dpkt/ipx.py | # $Id: ipx.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Internetwork Packet Exchange."""
from __future__ import absolute_import
from . import dpkt
IPX_HDR_LEN = 30
class IPX(dpkt.Packet):
"""Internetwork Packet Exchange.
Internetwork Packet Exchange (IPX) is the network layer protocol in... | 1,059 | 29.285714 | 113 | py |
dpkt | dpkt-master/dpkt/telnet.py | # $Id: telnet.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Telnet."""
from __future__ import print_function
from __future__ import absolute_import
import struct
from .compat import compat_ord
IAC = 255 # interpret as command:
DONT = 254 # you are not to use option
DO = 253 # please, you use opt... | 5,344 | 44.29661 | 114 | py |
dpkt | dpkt-master/dpkt/bgp.py | # $Id: bgp.py 76 2011-01-06 15:51:30Z dugsong $
# -*- coding: utf-8 -*-
"""Border Gateway Protocol."""
from __future__ import print_function
from __future__ import absolute_import
import struct
import socket
from . import dpkt
from .compat import compat_ord
# Border Gateway Protocol 4 - RFC 4271
# Communities Attri... | 51,351 | 31.37831 | 111 | py |
dpkt | dpkt-master/dpkt/qq.py | # $Id: qq.py 48 2008-05-27 17:31:15Z yardley $
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .dpkt import Packet
# header_type
QQ_HEADER_BASIC_FAMILY = 0x02
QQ_HEADER_P2P_FAMILY = 0x00
QQ_HEADER_03_FAMILY = 0x03
QQ_HEADER_04_FAMILY = 0x04
QQ_HEADER_05_FAMILY = 0x05
header_type_str = [
"QQ_... | 6,842 | 29.013158 | 59 | py |
dpkt | dpkt-master/dpkt/gre.py | # $Id: gre.py 75 2010-08-03 14:42:19Z jon.oberheide $
# -*- coding: utf-8 -*-
"""Generic Routing Encapsulation."""
from __future__ import absolute_import
import struct
import codecs
from . import dpkt
from . import ethernet
from .compat import compat_izip
GRE_CP = 0x8000 # Checksum Present
GRE_RP = 0x4000 # Routin... | 6,763 | 26.274194 | 120 | py |
dpkt | dpkt-master/dpkt/crc32c.py | # $Id: crc32c.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import array
# CRC-32C Checksum for SCTP
# http://tools.ietf.org/html/rfc3309
crc32c_table = (
0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F,
0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, 0x8A... | 4,364 | 42.65 | 76 | py |
dpkt | dpkt-master/dpkt/pmap.py | # $Id: pmap.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Portmap / rpcbind."""
from __future__ import absolute_import
from . import dpkt
PMAP_PROG = 100000
PMAP_PROCDUMP = 4
PMAP_VERS = 2
class Pmap(dpkt.Packet):
"""Portmap / rpcbind.
The port mapper (rpc.portmap or just portmap, or rpcb... | 1,032 | 28.514286 | 114 | py |
dpkt | dpkt-master/dpkt/sctp.py | # $Id: sctp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Stream Control Transmission Protocol."""
from __future__ import print_function
from __future__ import absolute_import
from . import dpkt
from . import crc32c
# Stream Control Transmission Protocol
# http://tools.ietf.org/html/rfc2960
# Chunk... | 6,399 | 33.594595 | 103 | py |
dpkt | dpkt-master/dpkt/ppp.py | # $Id: ppp.py 65 2010-03-26 02:53:51Z dugsong $
# -*- coding: utf-8 -*-
"""Point-to-Point Protocol."""
from __future__ import absolute_import
import struct
from . import dpkt
# XXX - finish later
# http://www.iana.org/assignments/ppp-numbers
PPP_IP = 0x21 # Internet Protocol
PPP_IP6 = 0x57 # Internet Protocol v6
... | 4,674 | 23.73545 | 116 | py |
dpkt | dpkt-master/dpkt/rpc.py | # $Id: rpc.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Remote Procedure Call."""
from __future__ import absolute_import
import struct
from . import dpkt
# RPC.dir
CALL = 0
REPLY = 1
# RPC.Auth.flavor
AUTH_NONE = AUTH_NULL = 0
AUTH_UNIX = 1
AUTH_SHORT = 2
AUTH_DES = 3
# RPC.Reply.stat
MSG_ACCEPT... | 9,475 | 27.035503 | 90 | py |
dpkt | dpkt-master/dpkt/utils.py | """Various Utility Functions"""
import socket
import warnings
from .compat import compat_ord
from .dns import DNS
def mac_to_str(address):
r"""Convert a MAC address to a readable/printable string
Args:
address (str): a MAC address in hex form (e.g. '\x01\x02\x03\x04\x05\x06')
Returns:
... | 2,354 | 28.4375 | 90 | py |
dpkt | dpkt-master/dpkt/stun.py | # $Id: stun.py 47 2008-05-27 02:10:00Z jon.oberheide $
# -*- coding: utf-8 -*-
"""Simple Traversal of UDP through NAT."""
from __future__ import print_function
from __future__ import absolute_import
import struct
from . import dpkt
# STUN - RFC 3489
# http://tools.ietf.org/html/rfc3489
# Each packet has a 20 byte he... | 2,884 | 27.564356 | 100 | py |
dpkt | dpkt-master/dpkt/tpkt.py | # $Id: tpkt.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""ISO Transport Service on top of the TCP (TPKT)."""
from __future__ import absolute_import
from . import dpkt
# TPKT - RFC 1006 Section 6
# http://www.faqs.org/rfcs/rfc1006.html
class TPKT(dpkt.Packet):
"""ISO Transport Service on top of... | 831 | 26.733333 | 111 | py |
dpkt | dpkt-master/dpkt/netflow.py | # $Id: netflow.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Cisco Netflow."""
from __future__ import print_function
from __future__ import absolute_import
import struct
from . import dpkt
from .compat import compat_izip
class NetflowBase(dpkt.Packet):
"""Base class for Cisco Netflow packets.
... | 13,857 | 39.052023 | 127 | py |
dpkt | dpkt-master/dpkt/yahoo.py | # $Id: yahoo.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Yahoo Messenger."""
from __future__ import absolute_import
from . import dpkt
class YHOO(dpkt.Packet):
"""Yahoo Messenger.
Yahoo! Messenger (sometimes abbreviated Y!M) was an advertisement-supported instant messaging client and ass... | 1,688 | 31.480769 | 119 | py |
dpkt | dpkt-master/dpkt/gzip.py | # $Id: gzip.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""GNU zip."""
from __future__ import print_function
from __future__ import absolute_import
import struct
import zlib
from . import dpkt
# RFC 1952
GZIP_MAGIC = b'\x1f\x8b'
# Compression methods
GZIP_MSTORED = 0
GZIP_MCOMPRESS = 1
GZIP_MPACKE... | 8,774 | 25.038576 | 79 | py |
dpkt | dpkt-master/dpkt/ethernet.py | # $Id: ethernet.py 65 2010-03-26 02:53:51Z dugsong $
# -*- coding: utf-8 -*-
"""
Ethernet II, LLC (802.3+802.2), LLC/SNAP, and Novell raw 802.3,
with automatic 802.1q, MPLS, PPPoE, and Cisco ISL decapsulation.
"""
from __future__ import print_function
from __future__ import absolute_import
import struct
from zlib impo... | 31,940 | 35.462329 | 114 | py |
dpkt | dpkt-master/dpkt/cdp.py | # $Id: cdp.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Cisco Discovery Protocol."""
from __future__ import absolute_import
from . import dpkt
CDP_DEVID = 1 # string
CDP_ADDRESS = 2
CDP_PORTID = 3 # string
CDP_CAPABILITIES = 4 # 32-bit bitmask
CDP_VERSION = 5 # string
CDP_PLATFORM = 6 # string... | 6,446 | 30.758621 | 113 | py |
dpkt | dpkt-master/dpkt/ssl_ciphersuites.py | # Copyright 2012 Google Inc. All rights reserved.
# -*- coding: utf-8 -*-
"""
Nicely formatted cipher suite definitions for TLS
A list of cipher suites in the form of CipherSuite objects.
These are supposed to be immutable; don't mess with them.
"""
class CipherSuite(object):
"""
Encapsulates a cipher suite.... | 38,198 | 51.042234 | 115 | py |
dpkt | dpkt-master/dpkt/radiotap.py | # -*- coding: utf-8 -*-
"""Radiotap"""
from __future__ import print_function
from __future__ import absolute_import
from . import dpkt
from . import ieee80211
from .compat import compat_ord
# Ref: http://www.radiotap.org
# Fields Ref: http://www.radiotap.org/defined-fields/all
# Present flags
_TSFT_SHIFT = 0
_FLAGS_... | 14,279 | 27.05501 | 115 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.