repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
PanyiDong/AutoML | archive/_discard.py | <filename>archive/_discard.py
"""
File: _discard.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Relative Path: /archive/_discard.py
File Created: Friday, 25th February 2022 6:13:42 pm
Author: <NAME> (<EMAIL>)
-----
L... |
PanyiDong/AutoML | My_AutoML/_utils/_data.py | """
File: _data.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_utils/_data.py
File Created: Wednesday, 6th April 2022 12:01:26 am
Author: <NAME> (<EMAIL>)
-----
Last M... |
PanyiDong/AutoML | My_AutoML/_hyperparameters/_ray/_classifier_hyperparameter.py | """
File: _classifier_hyperparameter.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_hyperparameters/_ray/_classifier_hyperparameter.py
File Created: Friday, 8th April 2... |
PanyiDong/AutoML | tests/test_encoder/test_encoder.py | """
File: test_encoder.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /tests/test_encoder/test_encoder.py
File Created: Saturday, 9th April 2022 10:09:13 pm
Author: <NAME> (<EMAIL>... |
PanyiDong/AutoML | My_AutoML/_model/_legacy.py | """
File: _legacy.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_model/_legacy.py
File Created: Friday, 8th April 2022 9:18:08 pm
Author: <NAME> (<EMAIL>)
-----
Last M... |
PanyiDong/AutoML | setup.py | <filename>setup.py
"""
File: setup.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.0.2
Relative Path: /setup.py
File Created: Friday, 4th March 2022 11:33:55 pm
Author: <NAME> (<EMAIL>)
-----
Last Mo... |
PanyiDong/AutoML | tests/test_balancing/test_balancing.py | """
File: test_balancing.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /tests/test_balancing/test_balancing.py
File Created: Saturday, 9th April 2022 11:03:41 pm
Author: <NAME> (<... |
PanyiDong/AutoML | My_AutoML/_hyperparameters/_hyperopt/_balancing_hyperparameter.py | """
File: _balancing_hyperparameter.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_hyperparameters/_hyperopt/_balancing_hyperparameter.py
File Created: Tuesday, 5th Apr... |
PanyiDong/AutoML | My_AutoML/_model/_FNN.py | <reponame>PanyiDong/AutoML
"""
File: _FNN.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_model/_FNN.py
File Created: Tuesday, 5th April 2022 11:46:17 pm
Author: <NAME> ... |
PanyiDong/AutoML | main.py | <reponame>PanyiDong/AutoML<gh_stars>0
"""
File: main.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /main.py
File Created: Friday, 25th February 2022 6:13:42 pm
Author: <NAME> (<EM... |
PanyiDong/AutoML | tests/test_scaling/test_scaling.py | <reponame>PanyiDong/AutoML<filename>tests/test_scaling/test_scaling.py<gh_stars>1-10
"""
File: test_scaling.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /tests/test_scaling/test_... |
PanyiDong/AutoML | My_AutoML/_encoding/_encoding.py | """
File: _encoding.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_encoding/_encoding.py
File Created: Friday, 25th February 2022 6:13:42 pm
Author: <NAME> (<EMAIL>)
-... |
PanyiDong/AutoML | My_AutoML/_hyperparameters/_ray/_imputer_hyperparameter.py | """
File: _imputer_hyperparameter.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_hyperparameters/_ray/_imputer_hyperparameter.py
File Created: Wednesday, 6th April 2022... |
PanyiDong/AutoML | My_AutoML/_hyperparameters/_hyperopt/_feature_selection_hyperparameter.py | <gh_stars>1-10
"""
File: _feature_selection_hyperparameter.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_hyperparameters/_hyperopt/_feature_selection_hyperparameter.py... |
PanyiDong/AutoML | tests/test_hyperparameters/test_hyperparameters.py | """
File: test_hyperparameters.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /tests/test_hyperparameters/test_hyperparameters.py
File Created: Thursday, 14th April 2022 12:25:53 a... |
PanyiDong/AutoML | My_AutoML/_scaling/_scaling.py | <gh_stars>1-10
"""
File: _scaling.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_scaling/_scaling.py
File Created: Friday, 25th February 2022 6:13:42 pm
Author: <NAME> ... |
PanyiDong/AutoML | tests/test_feature_selection/test_feature_selection.py | """
File: test_feature_selection.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /tests/test_feature_selection/test_feature_selection.py
File Created: Friday, 15th April 2022 12:27:... |
PanyiDong/AutoML | My_AutoML/_feature_selection/_legacy.py | """
File: _legacy.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_feature_selection/_legacy.py
File Created: Friday, 8th April 2022 9:20:27 pm
Author: <NAME> (<EMAIL>)
... |
PanyiDong/AutoML | My_AutoML/_utils/_file.py | <gh_stars>1-10
"""
File: _file.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_utils/_file.py
File Created: Wednesday, 6th April 2022 6:25:09 pm
Author: <NAME> (<EMAIL>)... |
PanyiDong/AutoML | My_AutoML/_hyperparameters/_hyperopt/_imputer_hyperparameter.py | """
File: _imputer_hyperparameter.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_hyperparameters/_hyperopt/_imputer_hyperparameter.py
File Created: Tuesday, 5th April 2... |
PanyiDong/AutoML | My_AutoML/_balancing/_mixed_sampling.py | <gh_stars>1-10
"""
File: _mixed_sampling.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_balancing/_mixed_sampling.py
File Created: Wednesday, 6th April 2022 12:27:23 am... |
PanyiDong/AutoML | My_AutoML/_constant.py | """
File: _constant.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_constant.py
File Created: Sunday, 10th April 2022 4:50:47 pm
Author: <NAME> (<EMAIL>)
-----
Last Mod... |
PanyiDong/AutoML | My_AutoML/_imputation/__init__.py | """
File: __init__.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_imputation/__init__.py
File Created: Tuesday, 5th April 2022 11:49:07 pm
Author: <NAME> (<EMAIL>)
---... |
PanyiDong/AutoML | My_AutoML/_utils/_preprocessing.py | <filename>My_AutoML/_utils/_preprocessing.py
"""
File: _preprocessing.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_utils/_preprocessing.py
File Created: Wednesday, 6t... |
Stuti82/pandas | pandas/tests/extension/test_boolean.py | <reponame>Stuti82/pandas<filename>pandas/tests/extension/test_boolean.py
"""
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests ... |
Stuti82/pandas | pandas/tests/groupby/aggregate/test_aggregate.py | <filename>pandas/tests/groupby/aggregate/test_aggregate.py<gh_stars>1-10
"""
test .agg behavior / note that .apply is tested generally in test_groupby.py
"""
import datetime
import functools
from functools import partial
import re
import numpy as np
import pytest
from pandas.errors import PerformanceWarning
from pan... |
nwy140/algosand | ch2.py | # Super power of ordered arrays
n = 101
binarray = range(n)
# 4 primary operations in an array algo
# Read
# Search
# Insert
# Delete
# This is the most basic code, but will be updated
# with algorithms while we play along.
# Read
def aread(arr, i):
return arr[i]
# Search
def asearch(arr, s):
# TODO, bin_s... |
asa-leholland/SudokuSolver | consoleSudoku.py | # filename: consoleSudokuUI.py
# author: <NAME>
# Import random to randomly select which puzzle is chosen
import random
# import regex to match validity for user-provided input
import re
# import json to read and handle the Sudoku puzzle library (which is stored in a .json format)
import json
# perform a local imp... |
asa-leholland/SudokuSolver | backupConsoleUI.py | # filename: consoleSudokuUI.py
# author: <NAME>
import random
import time
import re
import main as main_sudoku
import json
def welcome():
"""
Welcomes the user to Console Sudoku.
"""
print("""
Welcome to Console Sudoku!""")
def describe_sudoku():
print('The goal of Sudoku is to completely fill a 9×9 gri... |
asa-leholland/SudokuSolver | main.py | # main.py
# Author: <NAME>
def npdisplay(board):
"""
Function to dislay the provded board to the user through a series of print statements to the console.
"""
# Output the column header and establish the column borders
print()
column_header = ' Columns '
print(column_heade... |
asa-leholland/SudokuSolver | test.py | # test.py
# import numpy to handle array board
import numpy as np
# source: https://www.geeksforgeeks.org/print-colors-python-terminal/
def prRed(text): print("\033[91m {}\033[00m" .format(text))
def prGreen(text): print("\033[92m {}\033[00m" .format(text))
def prYellow(text): print("\033[93m {}\033[00m" .format... |
asa-leholland/SudokuSolver | tests.py | <gh_stars>0
# test.py
# Author: <NAME>
import unittest
import main as main_sudoku
# Puzzle Source: https://dingo.sbs.arizona.edu/~sandiway/sudoku/examples.html
puzzle = [
[0,0,0, 2,6,0, 7,0,1],
[6,8,0, 0,7,0, 0,9,0],
[1,9,0, 0,0,4, 5,0,0],
[8,2,0, 1,0,0, 0,4,0],
[0,0,4, 6,0,2, 9,0,0],
[0,5,0, 0,0,3, 0,2,8],
[0,0,9, ... |
AishikaBanik98/challenges | code.py | <filename>code.py
"""
Load module to filter data on fly
"""
from __future__ import print_function
#import os
#import sys
import pandas as pd
#import numpy as np
#import re
class Load():
"""
Load class is used for exclusive dataframe filtering
which takes `df` a csv file and convert into dataframe
"""
... |
VarunGaikwad-XenStack/Intelligence-Extraction | ETM_CSV/__init__.py | from ETM_CSV.CSV import csv
|
VarunGaikwad-XenStack/Intelligence-Extraction | ETM_CSV/CSV.py | <filename>ETM_CSV/CSV.py
import csv
import pandas as pd
class csv():
def uOpen():
a= input('Enter the name of your input file: ')
global y
y= input("Enter the name of column to split: ")
with open(a,'r') as csv_fi... |
jainmickey/admin_scraper | scraper.py | <filename>scraper.py
import config
import json
import requests
from bs4 import BeautifulSoup
def get_page_links(bs4_parsed_content):
theaders = bs4_parsed_content.find(id="content-main").find_all("th")
all_links = [head.find("a") for head in theaders]
valid_links = [link for link in all_links
... |
jainmickey/admin_scraper | config.py | username=''
password=''
base_url=''
admin_url=''
login_url=''
username=''
password=''
|
spr-networks/super | api/scripts/iw_dev.py | <filename>api/scripts/iw_dev.py
"""jc - JSON Convert `foo` command output parser
<<Short foo description and caveats>>
Usage (cli):
$ iw list | jc --iw_dev
or
$ jc iw dev
Usage (module):
import jc
result = jc.parse('iw_dev', foo_command_output)
Schema:
[
{
"foo": strin... |
spr-networks/super | api/scripts/iw_list.py | """jc - JSON Convert `foo` command output parser
<<Short foo description and caveats>>
Usage (cli):
$ iw list | jc --iw_list
or
$ jc iw list
Usage (module):
import jc
result = jc.parse('iw_list', foo_command_output)
Schema:
[
{
"foo": string,
"bar": boolean... |
tactile-graphics/3d-printing-tools | scad_generator.py | # Copyright 2022 Adventium Labs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softw... |
tactile-graphics/3d-printing-tools | braille_text_converter.py | # Copyright 2022 Adventium Labs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softw... |
tactile-graphics/3d-printing-tools | svg_braille_converter.py | # Copyright 2022 Adventium Labs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softw... |
RiverHeart/Python | extended_features.py | # Provides useful functions
import os
import sys
import argparse
import subprocess
import signal
# Default arguments
ex_parser = argparse.ArgumentParser()
ex_parser.add_argument("-V", "--version",action="store_true", help="Show version")
ex_parser.add_argument("-q", "--quiet", action="store_true", help="Disable outpu... |
BrainInnovation/bvbabel | bvbabel/vtc.py | <reponame>BrainInnovation/bvbabel
"""Read, write, create Brainvoyager VTC file format."""
import struct
import numpy as np
from bvbabel.utils import read_variable_length_string
from bvbabel.utils import write_variable_length_string
# =============================================================================
def r... |
BrainInnovation/bvbabel | wip/batch_convert-neuroparc.py | <reponame>BrainInnovation/bvbabel<filename>wip/batch_convert-neuroparc.py
"""Convert Nifti images with labels (integers only) to BrainVoyager VOI.
TODO:
[ ] Read labels from csvs
[ ] Read anatomical nifti to adjust voi headers
"""
import os
import csv
import numpy as np
import nibabel as nb
import matplotlib... |
BrainInnovation/bvbabel | wip/read_gii_fsaverage_write_obj.py | <filename>wip/read_gii_fsaverage_write_obj.py
"""Convert Freesurfer *.gii triangular mesh surface to Wavefront .obj file."""
import os
import numpy as np
import nibabel as nb
import bvbabel
import timeit
FILE = "/home/faruk/Documents/temp_bv_fsaverage/white_left.gii"
# -----------------------------------------------... |
BrainInnovation/bvbabel | wip/read_freesurfer_surface_map_write_smp.py | <gh_stars>1-10
"""Convert Freesurfer *.pct.mgh file into BrainVoyager SMP format."""
import os
import numpy as np
import nibabel as nb
import bvbabel
# NOTE: Full path to `<subjid>/surf/?h.w-g.pct.mgh` file. This file is a
# surface map that has gray to white matter signal intensity ratios for each
# vertex (ref: <ht... |
BrainInnovation/bvbabel | wip/smp_compute_cortical_magnification.py | """Read Brainvoyager srf & smp files to compute cortical magnification."""
import os
import numpy as np
from copy import copy
import bvbabel
FILE_SRF = "/home/faruk/Documents/test_bvbabel/SRF/surface.srf"
FILE_SMP = "/home/faruk/Documents/test_bvbabel/SRF/maps.smp"
# These values are required to compute vertex-wise... |
BrainInnovation/bvbabel | wip/read_gii_fsaverage_write_srf.py | <filename>wip/read_gii_fsaverage_write_srf.py<gh_stars>0
"""Convert Freesurfer *.gii triangular mesh surface to Wavefront .obj file."""
import os
import numpy as np
import nibabel as nb
import bvbabel
import timeit
FILE = "/home/faruk/Documents/temp_bv_fsaverage/white_left.gii"
# ------------------------------------... |
BrainInnovation/bvbabel | examples/create_vtc.py | """Create Brainvoyager VTC file."""
import bvbabel
OUTNAME = "/home/faruk/Documents/test_bvbabel/vtc/default_bvbabel.vtc"
# -----------------------------------------------------------------------------
header, data = bvbabel.vtc.generate_vtc()
bvbabel.vtc.write_vtc(OUTNAME, header, data)
print("Finished.")
|
BrainInnovation/bvbabel | wip/read_mgz_write_voi.py | <reponame>BrainInnovation/bvbabel
"""Convert mgz to nifti.
Dependencies
------------
- Freesurfer color look up table text file from:
<https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI/FreeSurferColorLUT>
- `aparc+aseg.mgz` file from Freesurfer.
"""
import os
import csv
import numpy as np
import nib... |
wrighting/upgrade-assist | src/java_compare.py | import os
import getopt
import sys
import re
import xml.etree.ElementTree as ET
import string
import difflib
import xmlUtil
import copy
import fnmatch
import filecmp
import json
import report
class JavaCompare(object):
nsbeansuri = 'http://www.springframework.org/schema/beans'
nsbeans = '{' + nsbeansuri +'}'... |
wrighting/upgrade-assist | src/compare_alfresco.py | <gh_stars>1-10
import getopt
import sys
import os
import re
import filecmp
import difflib
import sys
import json
import report
import java_compare
import comparitor
class ScriptChecker():
def collectExtensions(self, startDir, extHomes):
srcFileList = {}
for dirName, subdirList, fileList in os.wal... |
wrighting/upgrade-assist | src/xmlUtil.py | import string
def cmp_to_key(mycmp):
'Convert a cmp= function into a key= function'
class K(object):
def __init__(self, obj, *args):
self.obj = obj
def __lt__(self, other):
return mycmp(self.obj, other.obj) < 0
def __gt__(self, other):
return mycmp(se... |
wrighting/upgrade-assist | src/report.py | <reponame>wrighting/upgrade-assist<filename>src/report.py
class Report(object):
def actionRequired(self, message, customFile, oldFile, newFile):
print()
print("You need to check: " + customFile)
print(message)
print("Old file:" + oldFile)
print("New file:" + newFile)
... |
wrighting/upgrade-assist | src/comparitor.py | <filename>src/comparitor.py
import filecmp
import difflib
import sys
import os
class Comparitor(object):
def __init__(self, reporter):
self.reporter = reporter
def compareXML(self, myOtherXML, oldOtherXML, newOtherXML):
for xmlFile in myOtherXML:
oldPath = oldOtherXML[... |
wrighting/upgrade-assist | src/test/XMLutilTest.py | import unittest
import os
import xmlUtil
import xml.etree.ElementTree as ET
import java_compare
import report
import copy
class XMLutilTest(unittest.TestCase):
def testCompareDifferent(self):
filePath = 'test/bean-diff.xml'
tree = ET.parse(filePath)
bean1 = {}
bean2 = {}
#A... |
ipspace/ansible_helpers | filter_plugins/confparse.py | <reponame>ipspace/ansible_helpers
from __future__ import unicode_literals
from __future__ import print_function
from ciscoconfparse import CiscoConfParse
def confparse_parent(config, parent, child):
"""Returns [match, parent_line, child_line]
Where match is boolean indicating whether a match happened.
p... |
fferen/makeheaders | __main__.py | """
Copyright (c) 2012, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following di... |
handsomeWeiye/TaobaoSpider | goods_spider.py | import os
import re
import json
import time
import random
import requests
import pandas as pd
from retrying import retry
from taobao_login import TaoBaoLogin
goodsSearchName = '零食'
# 关闭警告
requests.packages.urllib3.disable_warnings()
# 登录与爬取需使用同一个Session对象
req_session = requests.Session()
# 淘宝商品excel文件... |
shuntingyard/flowproc | src/flowproc/v9_fieldtypes.py | <filename>src/flowproc/v9_fieldtypes.py
# -*- coding: utf-8 -*-
"""
Code snippet copied from:
https://raw.githubusercontent.com/bitkeks/python-netflow-v9-softflowd/master/src/netflow/collector_v9.py
Copyright 2017, 2018 <NAME> <<EMAIL>>
Licensed under MIT License. See LICENSE.
Noted by shuntingyard:
In resource... |
shuntingyard/flowproc | src/flowproc/testasync.py | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Experimental
"""
import json
import logging
from datetime import datetime
from flowproc import __version__
from flowproc.collector_state import Collector
from flowproc.util import stopwatch
from flowproc.v9_classes import OptionsTemplate
from flowproc.v9_classes import Templat... |
shuntingyard/flowproc | src/flowproc/v9_parser.py | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Parser for NetFlow V9 packets
"""
import logging
import struct
from ipaddress import ip_address
from flowproc import util
from flowproc import v9_fieldtypes
from flowproc.collector_state import Collector
from flowproc.v9_classes import OptionsTemplate
from flowproc.v9_classes ... |
shuntingyard/flowproc | src/flowproc/collector_state.py | <reponame>shuntingyard/flowproc<gh_stars>0
# -*- coding: utf-8 -*-
"""
Experiment on dealing with state
"""
import logging
from abc import ABC
from abc import abstractmethod
from collections import deque
from datetime import datetime
from ipaddress import ip_address
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__l... |
shuntingyard/flowproc | src/flowproc/flowprocctrl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The flow collector daemon control program
"""
import argparse
import asyncio
import json
import pprint
import sys
from flowproc import __version__
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__license__ = "mit"
def parse_args(args):
"""
Parse command lin... |
shuntingyard/flowproc | src/flowproc/__init__.py | <reponame>shuntingyard/flowproc
# -*- coding: utf-8 -*-
"""
tbd
"""
import logging
from pkg_resources import DistributionNotFound
from pkg_resources import get_distribution
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__license__ = "mit"
logger = logging.getLogger(__name__)
# retrieve version info
try:
dist_... |
shuntingyard/flowproc | src/flowproc/util.py | <reponame>shuntingyard/flowproc
# -*- coding: utf-8 -*-
"""
Various utility functions to convert port numbers, tcpflags, ICMP-type and code
to text
A `dict` to look up textual labels for protocol numbers and
a stopwatch decorator function
A class to reflect netflow exporter attributes and options
"""
import functool... |
shuntingyard/flowproc | codesnippets/asyncio_echo_C35.py | import asyncio
@asyncio.coroutine
def tcp_echo_client(message, loop):
reader, writer = yield from asyncio.open_unix_connection("./echosocket")
print('Send: %r' % message)
writer.write(message.encode())
data = yield from reader.read(100)
print('Received: %r' % data.decode())
print('Close the... |
shuntingyard/flowproc | src/flowproc/fluent.py | # https://gist.github.com/thinkingserious/d1b06ee12a3613c0dc3b
import sys
from ipaddress import ip_address
class Fluent:
def __init__(self, cache=None):
self._cache = cache or []
# Build the cache, and handle special cases
def _(self, name):
# Enables method chaining
return Flue... |
shuntingyard/flowproc | src/flowproc/netflowV5_lab.py | <reponame>shuntingyard/flowproc<gh_stars>0
# -*- coding: utf-8 -*-
"""
NetFlow v5 collector implementation
"""
import logging
import struct
from collections import namedtuple
from datetime import datetime
from flowproc import util
from ipaddress import ip_address
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__lic... |
shuntingyard/flowproc | tests/test_collector_state.py | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Tests for 'util' module
"""
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__license__ = "mit"
import logging
import time
from datetime import datetime
from flowproc import testasync
from flowproc.collector_state import AbstractTemplate
from flowproc.collector_state import Co... |
shuntingyard/flowproc | codesnippets/example_udp_run_for_5.py | loop = asyncio.get_running_loop()
transport, protocol = await loop.create_datagram_endpoint(
lambda: EchoServerProtocol(),
local_addr=('127.0.0.1', 9999))
try:
await asyncio.sleep(5) # Serve for 5 seconds.
finally:
transport.close()
|
shuntingyard/flowproc | src/flowproc/v9_classes.py | """
Template classes for NetFlow V9 parsing
"""
import logging
from datetime import datetime
from flowproc import v9_fieldtypes
from flowproc.collector_state import AbstractTemplate
from flowproc.collector_state import Collector
# global settings
logger = logging.getLogger(__name__)
class Template(AbstractTemplat... |
shuntingyard/flowproc | src/flowproc/testreader.py | <reponame>shuntingyard/flowproc
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test parsers using raw NetFlow/IPFIX input from disk
"""
import argparse
import struct
import sys
import logging
from flowproc import __version__
from flowproc import testasync
# from flowproc import v5_parser
from flowproc import v9_pa... |
shuntingyard/flowproc | src/flowproc/testlistener.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test UDP listener
"""
import argparse
import asyncio
import sys
import logging
import os
from importlib import reload
from flowproc import __version__
from flowproc import testasync
# from flowproc import v5_parser
from flowproc import v9_classes
from flowproc import... |
shuntingyard/flowproc | src/flowproc/flowprocd.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The flow collector daemon
"""
import argparse
import logging
import socketserver
import sys
from flowproc import process
from flowproc import __version__
__author__ = "<NAME>"
__copyright__ = "Tobias Frei"
__license__ = "mit"
logger = logging.getLogger(__name__)
d... |
shuntingyard/flowproc | tests/test_util.py | # -*- coding: utf-8 -*-
"""
Tests for 'util' module
"""
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__license__ = "mit"
import logging
from flowproc import util
# globals
logger = logging.getLogger().setLevel(logging.DEBUG)
@util.stopwatch
def test_watch():
pass
def test_port():
assert util.port_to_s... |
zyq-zhang/test001 | test/login.py | <reponame>zyq-zhang/test001
hahahaha
num1 = 10
num = 20
num = 300
num = 30
num = 40
num = 50
|
smamidi15/two-player-uno | Uno.py | # CS Seminar Quarter Project: A Game of UNO
# Author: <NAME>
# Date: 3/14/2021
import random
# Allows the user to play UNO with the computer -- through the terminal!
class Uno:
user_turn = True
user_cards = []
comp_cards = []
discard_pile = []
turns = 0
current_card = list()
... |
woogyumi/flaskvue | server.py | from flask import Flask, request, jsonify
from flask_cors import CORS
import pandas as pd
# set the project root directory as the static folder, you can set others.
app = Flask(__name__, static_url_path='')
data = {
"fields": ['host', 'cpu', 'mem', 'hdd'],
"data": [
{'host':'wgkim', 'cpu':'30', ... |
qkrdmsghk/ssl | ssl_graphmodels/utils/AnchorPool.py | import torch
from torch.nn import Parameter
from torch_scatter import scatter_add, scatter_max
from torch_geometric.utils import softmax
from torch_geometric.nn.inits import uniform
from torch_geometric.utils.num_nodes import maybe_num_nodes
def topk(x, ratio, batch, min_score=None, tol=1e-7):
if min_score is no... |
qkrdmsghk/ssl | ssl_graphmodels/config/parameters.py | import numpy as np
import random
import pandas as pd
param_grid = {
'patience': list(range(20, 21)),
'lr': list(np.logspace(np.log10(0.0005), np.log10(0.1), base=10, num=100)),
'lr_decay': list(np.linspace(0.6, 1, num=8)),
'weight_decay': [5e-6, 5e-5, 1e-5, 5e-4, 1e-4, 5e-3, 1e-3],
'drop_out': [0... |
qkrdmsghk/ssl | ssl_graphmodels/config/conf.py | <gh_stars>10-100
import argparse
def arg_config():
parse = argparse.ArgumentParser('TextSSL Parameters')
parse.add_argument('--name', type=str, default='R8')
parse.add_argument('--pre_trained', type=str, default='')
parse.add_argument('--type', type=str, default='inter_all', help='')
parse.add_a... |
qkrdmsghk/ssl | ssl_make_graphs/PairData.py | <reponame>qkrdmsghk/ssl
from torch_geometric.data import Data
class PairData(Data):
def __init__(self, x_n=None, edge_index_n=None, y_n=None, batch_n=None, pos_n=None,
x_p=None, edge_index_p=None, y_p=None, edge_attr_p=None):
super(PairData, self).__init__()
self.edge_index_... |
qkrdmsghk/ssl | re-extract_data/mk_R8_R52.py | <filename>re-extract_data/mk_R8_R52.py
import pandas as pd
pd.set_option('display.max_columns', 1000)
pd.set_option('display.max_rows', 1000)
import os
import shutil
import argparse
from tqdm import tqdm
'''
make R8 and R52 dataset!
using filtering methods in https://ana.cachopo.org/datasets-for-single-label-text-cate... |
qkrdmsghk/ssl | ssl_graphmodels/utils/LoadData.py | import sys, os
Your_path = '/data/project/yinhuapark/ssl/'
sys.path.append(Your_path+'ssl_make_graphs')
from PygDocsGraphDataset import PygDocsGraphDataset as PDGD
from torch_geometric.data import DataLoader
import torch
import numpy as np
import random
import argparse
from gensim.models import Word2Vec
import pandas a... |
qkrdmsghk/ssl | ssl_graphmodels/config/Tokenizer.py | <gh_stars>10-100
import numpy as np
from tqdm import tqdm
import os
class GloveTokenizer:
def __init__(self, filename, unk='<unk>', pad='<pad>'):
self.filename = filename
self.unk = unk
self.pad = pad
self.stoi = dict()
self.itos = dict()
self.embedding_matrix = li... |
qkrdmsghk/ssl | re-extract_data/remove_words.py | import os
import re
from nltk.tokenize import sent_tokenize
from tqdm import tqdm
import argparse
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
"""
string = re.sub(r"... |
qkrdmsghk/ssl | ssl_make_graphs/create_cooc_document.py |
from __future__ import absolute_import
from __future__ import print_function
import os, sys
import argparse
from tqdm import tqdm
sys.path.append('../ssl_make_graphs')
from document_utils import *
def process_partition(partition, window_size, max_len):
output_dir = os.path.join(args.pre_path, args.name, partit... |
qkrdmsghk/ssl | ssl_make_graphs/ConstructDatasetByDocs.py | import pandas as pd
import networkx as nx
import numpy as np
from scipy import sparse
import torch, sys
Your_path = '/data/project/yinhuapark/ssl/'
sys.path.append(Your_path+'ssl_make_graphs')
sys.path.append(Your_path+'ssl_graphmodels')
from PairData import PairData
pd.set_option('display.max_columns', None)
import os... |
qkrdmsghk/ssl | ssl_graphmodels/pyg_models/train_docs.py | import sys, os
Your_path = '/data/project/yinhuapark/ssl/'
sys.path.append(Your_path+'ssl_graphmodels')
import random
from config.conf import arg_config
from utils.LoadData import LoadDocsData
from models_docs import DocNet
import torch
import numpy as np
import pandas as pd
from tqdm import tqdm
use_gpu = torch.cuda.... |
qkrdmsghk/ssl | ssl_make_graphs/document_utils.py | <reponame>qkrdmsghk/ssl
import pandas as pd
import torch
import numpy as np
class COOC():
def __init__(self, window_size):
# self.item_lists = item_lists
self.window_size = window_size
super(COOC, self).__init__()
self.item_pair_set = {}
self.windows = 0
def make_item_... |
qkrdmsghk/ssl | ssl_make_graphs/PygDocsGraphDataset.py | from torch_geometric.data import InMemoryDataset
import os, sys
import os.path as osp
import torch
Your_path = '/data/project/yinhuapark/ssl/'
sys.path.append(Your_path+'ssl_make_graphs')
from ConstructDatasetByDocs import *
import argparse
class PygDocsGraphDataset(InMemoryDataset):
def __init__(self, name, sp... |
qkrdmsghk/ssl | ssl_graphmodels/pyg_models/layers_docs.py | <filename>ssl_graphmodels/pyg_models/layers_docs.py
import torch
from torch_geometric.nn.inits import glorot, zeros, reset
from torch.nn import Parameter
from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool
import sys
sys.path.append('../ssl_graphmodels')
from utils.SSL_GCN import SSL_GCN
f... |
qkrdmsghk/ssl | ssl_graphmodels/pyg_models/models_docs.py | import sys
Your_path = '/data/project/yinhuapark/ssl/'
sys.path.append(Your_path+'ssl_graphmodels')
import torch
from layers_docs import READOUTLayer, DENSELayer, GRAPHLayer
use_gpu = torch.cuda.is_available()
class DocNet(torch.nn.Module):
def __init__(self, params):
super(DocNet, self).__init__()
... |
Mrprogrammernobrainz/duplicatefunc | main (5).py | def duplicate(iterat, word):
ans = ''
if iterat == 0:
return ''
for i in range(len(word)):
if word[i] != ' ' and word[i] != ',' and word[i] != '!' and word[i] != '?' and word[i] != '(' and word[i] != ')' and word[i] != ";" and word[i] != ":" and word[i] != '[' and word[i] != ']' and wor... |
CristianContrera95/strict_df | src/strictdf/utils/dtypes.py | <gh_stars>0
"""
Author: <NAME> <<EMAIL>>
Date: 10/12/2020
License: MIT
"""
import re
__str_check_functions = {
# check boolean in this forms: [0, 1, .0, .1, 0., 1., true, false, t, f]
'bool': re.compile('^([.]?0|[.]?1|true|false|f|t){1}[.]?[0]*$'),
# check int in this forms: [11, -1, 1., -2., .000]
'... |
CristianContrera95/strict_df | src/strictdf/utils/dataset.py | <gh_stars>0
"""
Author: <NAME> <<EMAIL>>
Date: 10/12/2020
License: MIT
"""
import requests
import pandas as pd
from pathlib import Path
import os
def load_credit_data():
"""
Download credit_data file from S3 and load it with pandas in DataFrame
:return: pd.DataFrame
"""
local_file = Path.home() /... |
CristianContrera95/strict_df | src/strictdf/__init__.py | """
Author: <NAME> <<EMAIL>>
Date: 10/12/2020
License: MIT
"""
from .StrictDataFrame import StrictDataFrame
try:
import findspark
findspark.init()
except:
pass
|
CristianContrera95/strict_df | src/strictdf/StrictDataFrame.py | """
StrictDataFrame
---------------
A pd.DataFrame wrapper that provides utilities to handle in a "strict" DataFrames way with respect to the data schema
"""
import pandas as pd
import numpy as np
from copy import copy
from typing import Union, List
from .utils.dtypes import str_check_bool, str_check_int, str_check_fl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.