repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
raykallen/clx | clx/tests/test_fs_reader.py | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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... |
raykallen/clx | clx/tests/test_port_heuristic.py | <gh_stars>0
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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 ... |
raykallen/clx | clx/tests/test_dga_detector.py | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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... |
raykallen/clx | examples/train_dga_detector.py | import os
import time
import cudf
import argparse
import logging
from datetime import datetime
from clx.analytics.dga_detector import DGADetector
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
def train(
dd,
partitioned_dfs,
dataset_len,
test_partitioned_dfs,
test_dataset_len,
e... |
raykallen/clx | clx/tests/test_dns_extractor.py | <filename>clx/tests/test_dns_extractor.py
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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
#
# Unle... |
raykallen/clx | clx/analytics/stats.py | <gh_stars>0
# Copyright (c) 2019, <NAME>ATION.
#
# 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 agre... |
raykallen/clx | setup.py | <filename>setup.py
from setuptools import setup, find_packages
install_requires = ["confluent_kafka", "python-whois", "requests", "torch"]
setup(
name="clx",
version="0.11.0",
description="CLX",
author="<NAME>",
packages=find_packages(include=["clx", "clx.*"]),
package_data={
... |
raykallen/clx | clx/tests/test_ip.py | <gh_stars>0
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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 ... |
raykallen/clx | clx/parsers/event_parser.py | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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... |
raykallen/clx | clx/tests/test_whois.py | <reponame>raykallen/clx
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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 app... |
raykallen/clx | clx/parsers/windows_event_parser.py | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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... |
raykallen/clx | clx/tests/test_fs_writer.py | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# 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... |
svlandeg/sense2vec | scripts/03_glove_build_counts.py | <reponame>svlandeg/sense2vec<gh_stars>1000+
#!/usr/bin/env python
import os
from pathlib import Path
from wasabi import msg
import typer
def main(
# fmt: off
glove_dir: str = typer.Argument(..., help="Directory containing the GloVe build"),
in_dir: str = typer.Argument(..., help="Directory with preprocess... |
svlandeg/sense2vec | sense2vec/sense2vec.py | from typing import Tuple, List, Union, Sequence, Dict, Callable, Any
from pathlib import Path
from spacy.vectors import Vectors
from spacy.strings import StringStore
from spacy.util import SimpleFrozenDict
import numpy
import srsly
from .util import registry, cosine_similarity
class Sense2Vec(object):
def __init... |
svlandeg/sense2vec | scripts/04_glove_train_vectors.py | <reponame>svlandeg/sense2vec<gh_stars>1000+
#!/usr/bin/env python
import os
from pathlib import Path
from wasabi import msg
import typer
def main(
# fmt: off
glove_dir: str = typer.Argument(..., help="Directory containing the GloVe build"),
in_file: str = typer.Argument(..., help="Input file (shuffled coo... |
svlandeg/sense2vec | scripts/02_preprocess.py | <filename>scripts/02_preprocess.py<gh_stars>1000+
#!/usr/bin/env python
from sense2vec.util import make_key, make_spacy_key, merge_phrases
import spacy
from spacy.tokens import DocBin
from wasabi import msg
from pathlib import Path
import tqdm
import typer
def main(
# fmt: off
in_file: str = typer.Argument(..... |
svlandeg/sense2vec | scripts/04_fasttext_train_vectors.py | #!/usr/bin/env python
from typing import Optional
from pathlib import Path
from wasabi import msg
import fasttext
from errno import EPIPE
import typer
# python 04_fasttext_train_vectors.py /path/to/output/director/ -in /path/to/input/directory
def main(
# fmt: off
out_dir: str = typer.Argument(..., help="Pat... |
svlandeg/sense2vec | scripts/06_precompute_cache.py | #!/usr/bin/env python
from typing import Optional
import tqdm
import numpy
import srsly
from wasabi import msg
from pathlib import Path
import typer
def main(
# fmt: off
vectors: str = typer.Argument(..., help="Path to sense2vec component directory"),
gpu_id: int = typer.Option(-1, "--gpu-id", "-g", help=... |
svlandeg/sense2vec | sense2vec/tests/test_component.py | <reponame>svlandeg/sense2vec<filename>sense2vec/tests/test_component.py
import pytest
import numpy
import spacy
from spacy.vocab import Vocab
from spacy.tokens import Doc, Span
from sense2vec import Sense2VecComponent
from pathlib import Path
@pytest.fixture
def doc():
vocab = Vocab()
doc = Doc(vocab, words=[... |
Anuradhe007/InstaClient | client/ClientView.py | <filename>client/ClientView.py
from tkinter import *
from tkinter import messagebox
from InstagramAPI import InstagramAPI
import time
from ClientScheduler import ClientScheduler
import sys
def handleStartBtn():
pwd1 = ents[0][1].get().strip()
uname1 = ents[1][1].get().strip()
pwd2 = ents[2][1].get().strip... |
Anuradhe007/InstaClient | client/__init__.py | from .UserPostDetails import *
from .FileGenerator import *
from .ClientScheduler import *
from .UserDetails import * |
Anuradhe007/InstaClient | client/ClientScheduler.py | <gh_stars>1-10
import schedule
import time
import datetime
from tkinter import messagebox
from UserDetails import UserDetails
from UserPostDetails import UserPostDetails
class ClientScheduler:
def __init__(self, time1, proxyPath, filesPath, credentials):
self.time1 = time1
self.proxyPath = str(pro... |
Anuradhe007/InstaClient | client/UserPostDetails.py | from FileGenerator import FileGenerator
import datetime
import time
class UserPostDetails:
def postFilterByTime(self, userPost, clientStartedTime, clientEndingTime):
postCreatedTime = datetime.datetime.fromtimestamp(userPost['taken_at'])
if (postCreatedTime > clientStartedTime) and (postCreatedTim... |
Anuradhe007/InstaClient | client/UserDetails.py | <reponame>Anuradhe007/InstaClient
from openpyxl import Workbook
import datetime
class UserDetails:
def getTotalFollowers(self, credentials, filePath):
for key, value in credentials.items():
user_id = value.username_id
followers = []
next_max_id = True
todayD... |
Anuradhe007/InstaClient | client/FileGenerator.py | <reponame>Anuradhe007/InstaClient
from openpyxl import Workbook
import datetime
import math
class FileGenerator:
def createExcelFile(self, userName, postCreatedTime, detailsList, filePath):
fg = FileGenerator()
fileName = fg.fileNameCreator(userName, postCreatedTime)
workbook = Workbook()
... |
jacklul/openvr_fsr_app | tests/test_app/test_openvr_mod.py | import json
import shutil
from pathlib import Path
from typing import Tuple
import pytest
import app.mod
from app import app_fn, globals
from app.app_settings import AppSettings
from app.mod import BaseModType
from app.mod.fsr_mod import FsrMod
from tests.conftest import create_manipulated_settings, test_data_output_... |
jacklul/openvr_fsr_app | tests/test_app/test_mod_utils.py | <reponame>jacklul/openvr_fsr_app
from pathlib import WindowsPath
from app.mod import BaseModType
from app.mod.mod_utils import update_mod_data_dirs
from app.globals import get_data_dir
def test_get_mod_data_dirs(app_settings, open_vr_fsr_test_mod_dir):
test_dirs = dict()
for mod_type in BaseModType.mod_types... |
jacklul/openvr_fsr_app | app/__init__.py | from . import globals
from .util import utils
from .valve import steam
from .app_main import expose_main, CLOSE_EVENT
__all__ = ['utils', 'globals', 'steam', 'expose_app_methods', 'CLOSE_EVENT']
def expose_app_methods():
expose_main()
|
jacklul/openvr_fsr_app | tests/conftest.py | <reponame>jacklul/openvr_fsr_app
import shutil
from typing import Tuple
import pytest
from pathlib import Path, WindowsPath
from distutils.dir_util import copy_tree, remove_tree
import app
import app.mod
import app.app_fn
from app.app_settings import AppSettings
from app.util.manifest_worker import ManifestWorker
fro... |
jacklul/openvr_fsr_app | app/util/custom_app.py | <filename>app/util/custom_app.py
import logging
from pathlib import Path
from typing import Optional
import app
import app.mod
from app.util.manifest_worker import ManifestWorker, run_update_steam_apps
from app.util.utils import get_name_id
def create_custom_app(app_id: str, path: Path, name: str = None, scan=True) ... |
jacklul/openvr_fsr_app | app/app_settings.py | import json
import logging
from pathlib import Path
import app.globals as app_globals
from app.util.utils import JsonRepr
class AppSettings(JsonRepr):
skip_keys = ['open_vr_fsr_versions', 'open_vr_foveated_versions', 'vrperfkit_versions',
'current_fsr_version', 'current_foveated_version', 'curre... |
jacklul/openvr_fsr_app | tests/test_app/test_custom_dir.py | <reponame>jacklul/openvr_fsr_app
import json
from pathlib import Path
from app import app_fn
from test_app.test_app_fn import test_keys
def test_add_custom_library(app_settings, input_path, custom_lib_path, custom_dir_id, custom_app_id):
app_settings.user_app_directories.pop(custom_dir_id, None)
# -- Test a... |
jacklul/openvr_fsr_app | app/events.py | <filename>app/events.py
import logging
from typing import Optional
import eel
import gevent
import gevent.event
class AppBaseEvent:
@classmethod
def get_nowait(cls) -> Optional[gevent.event.AsyncResult]:
if hasattr(cls, 'result'):
try:
return cls.result.get_nowait()
... |
jacklul/openvr_fsr_app | app/log.py | <filename>app/log.py
import logging
import logging.config
from pathlib import Path
from app.globals import APP_NAME, DEFAULT_LOG_LEVEL, get_log_file
def setup_logging(logger_name: str = APP_NAME):
log_level = DEFAULT_LOG_LEVEL
log_handlers = ['file', 'console']
log_file_path: Path = get_log_file()
... |
jacklul/openvr_fsr_app | app/mod/fsr_mod.py | <reponame>jacklul/openvr_fsr_app
from app.cfg.fsr_cfg import FsrSettings
from app.mod import BaseMod, BaseModType
class FsrMod(BaseMod):
TYPE = BaseModType.fsr
VAR_NAMES = {
'installed': 'fsrInstalled',
'version': 'fsrVersion',
'settings': 'settings',
}
def __init__(self, mani... |
jacklul/openvr_fsr_app | tests/test_app/test_user_apps.py | <reponame>jacklul/openvr_fsr_app<filename>tests/test_app/test_user_apps.py
import logging
import json
from pathlib import Path
from app import app_fn
from tests.conftest import user_app_path
LOGGER = logging.getLogger(__name__)
def test_add_custom_app_fn(app_settings, user_app):
# -- Remove Text env user app fi... |
jacklul/openvr_fsr_app | tests/test_valve/test_steam_lib.py | <reponame>jacklul/openvr_fsr_app<filename>tests/test_valve/test_steam_lib.py<gh_stars>0
import logging
from pathlib import Path
from tests.conftest import test_app_path
LOGGER = logging.getLogger(__name__)
def test_load_steam_lib(steam_apps_obj, steam_test_path):
for app_id, app_dict in steam_apps_obj.steam_app... |
jacklul/openvr_fsr_app | app/cfg/base_mod_cfg.py | import logging
from pathlib import Path
from shutil import copyfile
from typing import List, Iterator
from app.cfg import ModCfgJsonHandler, ModCfgYamlHandler
from app.util.utils import JsonRepr
class BaseModCfgSetting(JsonRepr):
export_skip_keys = ['settings', 'category', 'desc', 'category']
def __init__(s... |
jacklul/openvr_fsr_app | app/mod/foveated_mod.py | from app.cfg.foveated_cfg import FoveatedSettings
from app.mod import BaseMod, BaseModType
class FoveatedMod(BaseMod):
TYPE = BaseModType.foveated
VAR_NAMES = {
'installed': 'fovInstalled',
'version': 'fovVersion',
'settings': 'fov_settings',
}
def __init__(self, manifest: dic... |
jacklul/openvr_fsr_app | app/cfg/__init__.py | from .cfg_file_handler import ModCfgJsonHandler, ModCfgYamlHandler
from .base_mod_cfg import BaseModCfgSetting, BaseModSettings, BaseModCfgType
from .fsr_cfg import FsrSettings
from .foveated_cfg import FoveatedSettings
from .vrperfkit_cfg import VRPerfKitSettings
__all__ = ['BaseModCfgSetting', 'BaseModSettings', 'Ba... |
jacklul/openvr_fsr_app | app/mod/__init__.py | from .base_mod_type import BaseModType
from .mod_utils import get_mod, get_available_mods, check_mod_data_dir, update_mod_data_dirs, get_mod_version_from_dll
from .base_mod import BaseMod
from .fsr_mod import FsrMod
from .foveated_mod import FoveatedMod
from .vrperfkit_mod import VRPerfKitMod
__all__ = ['BaseMod', 'Ba... |
jacklul/openvr_fsr_app | tests/test_app/test_app_fn.py | import json
import logging
from pathlib import Path
from app import app_fn
from app.mod import FsrMod, FoveatedMod, VRPerfKitMod
from tests.conftest import test_app_path, user_app_path, test_user_app_id
LOGGER = logging.getLogger(__name__)
test_keys = {'name', 'path', 'openVrDllPaths', 'openVrDllPathsSelected', 'exe... |
jacklul/openvr_fsr_app | app/mod/base_mod_type.py | <gh_stars>0
class BaseModType:
invalid = -1
fsr = 0
foveated = 1
vrp = 2
mod_types = {0: 'FsrMod', 1: 'FoveatedMod', 2: 'VRPerfKitMod'}
mod_data_dir_names = {0: 'openvr_fsr', 1: 'openvr_foveated', 2: 'vrperfkit'}
|
jacklul/openvr_fsr_app | app/mod/base_mod.py | import logging
from pathlib import Path
from shutil import copyfile
from typing import Optional
import app.cfg
from app.cfg import BaseModCfgType, BaseModSettings
from app.mod import BaseModType, update_mod_data_dirs, get_mod_version_from_dll
class BaseMod:
TYPE = BaseModType.invalid
VAR_NAMES = {
'i... |
jacklul/openvr_fsr_app | app/app_fn.py | <gh_stars>0
import json
import logging
import subprocess
from pathlib import WindowsPath, Path
import app
import app.mod
import app.util.utils
from app.app_settings import AppSettings
from app.mod import get_available_mods
from app.util.manifest_worker import run_update_steam_apps
from app.util.custom_app import creat... |
jacklul/openvr_fsr_app | tests/test_app/test_vrperfkit_mod.py | <filename>tests/test_app/test_vrperfkit_mod.py<gh_stars>0
import json
import shutil
from pathlib import Path
import app.mod
from app import app_fn, globals
from app.app_settings import AppSettings
from app.cfg.cfg_file_handler import ModCfgYamlHandler
from app.mod import BaseModType, VRPerfKitMod
from tests.conftest i... |
jacklul/openvr_fsr_app | app/mod/vrperfkit_mod.py | from app.cfg.vrperfkit_cfg import VRPerfKitSettings
from app.globals import DXGI_DLL
from app.mod import BaseModType, BaseMod
class VRPerfKitMod(BaseMod):
TYPE = BaseModType.vrp
VAR_NAMES = {
'installed': 'vrpInstalled',
'version': 'vrpVersion',
'settings': 'vrp_settings',
}
DL... |
jacklul/openvr_fsr_app | app/util/manifest_worker.py | <reponame>jacklul/openvr_fsr_app<gh_stars>0
import threading
from queue import Queue
import concurrent.futures
import logging
import os
from pathlib import Path
from typing import Optional, List
import gevent
from app.globals import OPEN_VR_DLL, EXE_NAME
from app.mod import get_available_mods
from app.events import p... |
jacklul/openvr_fsr_app | app/cfg/cfg_file_handler.py | import json
import logging
import shutil
from pathlib import Path
from ruamel.yaml import YAML, CommentedMap
class ModCfgJsonHandler:
@classmethod
def read_cfg(cls, settings, cfg_file) -> dict:
""" Update a ModSettings object from an CFG file
:param app.cfg.base_mod_cfg.BaseModSettings setti... |
jacklul/openvr_fsr_app | app/mod/mod_utils.py | <filename>app/mod/mod_utils.py
from pathlib import Path, WindowsPath
from typing import Dict, Optional
import app.mod
from app.app_settings import AppSettings
from app.globals import get_data_dir
from app.mod import BaseModType
from app.util.utils import get_file_hash
def get_mod(manifest, mod_type):
""" Get Mod... |
bodharma/webdriverdownloader | tests/test_browsers.py | from selenium import webdriver
from webdriverdownloader2 import ChromeDriverDownloader
def test_chromedriver():
src_file, dest_file = ChromeDriverDownloader().download_and_install()
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--wi... |
bodharma/webdriverdownloader | webdriverdownloader2/__init__.py | <gh_stars>0
try:
from webdriverdownloader2 import (
ChromeDriverDownloader,
GeckoDriverDownloader,
)
except ImportError:
from .webdriverdownloader2 import (
ChromeDriverDownloader,
GeckoDriverDownloader,
)
__all__ = [
"ChromeDriverDownloader",
"GeckoDriverDownloa... |
bodharma/webdriverdownloader | webdriverdownloader2/util.py | """
Module for utility functions.
This code is released under the MIT license.
"""
from cpuinfo import get_cpu_info
def get_architecture_bitness() -> str:
"""
Function for getting the "bitness" of the underlying architecture i.e. if it is 32-bit or 64-bit.
:return: The bitness of the underlying architect... |
bodharma/webdriverdownloader | webdriverdownloader2/webdriverdownloader2.py | <filename>webdriverdownloader2/webdriverdownloader2.py<gh_stars>0
"""
Module for managing the download of Selenium webdriver binaries.
This code is released under the MIT license.
"""
import abc
import os
import os.path
from pathlib import Path
import platform
import shutil
import tarfile
from urllib.parse import urlp... |
pgajdos/mox3 | mox3/fixture.py | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... |
alvinwan/wut-ipython | setup.py | import setuptools
import os
install_requires = ["ipython>=1.0"]
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
VERSION = "0.0.4"
setuptools.setup(
name="iwut",
version=VERSION,
author="<NAME>",
aut... |
alvinwan/wut-ipython | iwut/__init__.py | from IPython.core.magic import (
Magics, magics_class, line_magic, cell_magic,
line_cell_magic
)
from IPython.core.display import HTML, display
from IPython import get_ipython
from traceback import FrameSummary, linecache
from html import escape
import sys
CSS = """
<style>
.output_subarea { /* HACK to make t... |
TilakPatel/Game-Day-Pizza-Order | pizzapi/order.py | <filename>pizzapi/order.py<gh_stars>0
import requests
from .menu import Menu
from .urls import Urls, COUNTRY_USA
# TODO: Add add_coupon and remove_coupon methods
class Order(object):
"""Core interface to the payments API.
The Order is perhaps the second most complicated class - it wraps
up all the lo... |
TilakPatel/Game-Day-Pizza-Order | itemselect.py | from pizzapi import address, store, menu, Address
import config as credentials
print('Make sure that you have set up your config file correctly!')
while True:
address = Address(credentials.credentials['addressLine'], credentials.credentials['city'],
credentials.credentials['state'], credenti... |
TilakPatel/Game-Day-Pizza-Order | MAIN.py | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pizzapi import *
import config as credentials
import datetime
import time
WINDOW_SIZE = "1920,1080"
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--window-size=%s" % WINDOW_SIZE... |
architsangal/Jenkins-Assignment | program.py | def string_numbers_till_n(n):
string_var = "0"
for i in range(n):
string_var = string_var + " " + str(i+1)
return string_var
print(string_numbers_till_n(5))
|
architsangal/Jenkins-Assignment | test.py | <reponame>architsangal/Jenkins-Assignment<filename>test.py<gh_stars>0
import unittest
from program import string_numbers_till_n
class TestString(unittest.TestCase):
def test1(self):
result1 = string_numbers_till_n(2)
self.assertEqual(result1, "0 1 2")
def test2(self):
result2 = string_n... |
Meluiscruz/challenge-python-04 | html_decorators.py | <reponame>Meluiscruz/challenge-python-04<filename>html_decorators.py
def div(func):
# You have to code here!
def wrapper(*arg, **kwargs):
answer_1 = f'<div>{func(*arg, **kwargs)}</div>'
return answer_1
return wrapper
def article(func):
# You have to code here!
def wrapper(*ar... |
mathcube7/sympymod | sympymod/pick.py | from sympy import Wild
def select_by_pattern(expr, pattern, which):
matches = expr.match(pattern)
if matches:
return matches[which]
return None
def select_atoms(expr, atom_type):
return list(expr.atoms(atom_type))
a__ = Wild('a')
b__ = Wild('b')
c__ = Wild('c')
d__ = Wild('d')
e__ = Wild('e... |
mathcube7/sympymod | sympymod/utils.py |
from sympy import sqrt, symbols
def norm(vec):
return sqrt(vec.dot(vec))
|
mathcube7/sympymod | tests/test_calculus.py | <filename>tests/test_calculus.py
import unittest
from sympy import *
from sympy.abc import *
from sympymod.calculus import *
class TestCalculus(unittest.TestCase):
def test_partial_deriv_xy(self):
d_xy = PartialDerivative(x, y)
self.assertEqual(r"\partial_{xy}", str(d_xy))
self.assertEq... |
mathcube7/sympymod | tests/test_pick.py | <reponame>mathcube7/sympymod<gh_stars>0
import unittest
from sympy.abc import *
from sympy import *
from sympymod import *
class TestPicker(unittest.TestCase):
def test_pick_denominator(self):
eq = Eq((x + I * y + 2 + 3 * I) / (2 * x + 2 * I * y - 3), I + 2)
actual = select_by_pattern(eq.lhs, a_... |
mathcube7/sympymod | tests/test_utils.py | import unittest
from sympy import *
from sympymod.utils import *
class TestUtils(unittest.TestCase):
def test_norm_of_vector(self):
v = Matrix([3, 4])
actual = norm(v)
expected = 5
self.assertEqual(expected, actual)
|
mathcube7/sympymod | sympymod/calculus.py | <reponame>mathcube7/sympymod
from IPython.display import Math, display
from sympy import diff, limit, Mul
import sympy
class Integral(sympy.Integral):
def by_parts(self, u, vp):
return integrate_by_parts(self, u, vp)
class PartialDerivative:
def __init__(self, *wrt):
self.wrt = wrt
de... |
mathcube7/sympymod | sympymod/__init__.py | import types
import sys
from .equation import *
from .pick import *
from .calculus import *
from functools import wraps
this_module = sys.modules[__name__]
def _get_imported_names(module):
names = module.__all__ if hasattr(module, '__all__') else dir(module)
return [name for name in names if not name.start... |
santoshdkolur/RegProg | preprocess.py | # Author: <NAME>
# Purpose: Return the uploded data with some basic preprocessing
import pandas as pd
from sklearn.preprocessing import LabelEncoder, StandardScaler, OrdinalEncoder
def retProcessedData(df):
#df=pd.read_csv('insurance.csv')
# ************ Drop rows and columns with null values ***... |
santoshdkolur/RegProg | KNeighboursClassifier.py | from preprocess import retProcessedData
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import cross_val_score,GridSearchCV
from sklearn.metrics import confusion_matrix
import pick... |
santoshdkolur/RegProg | LogisticRegression.py | from sklearn.metrics import confusion_matrix
import pandas as pd
from sklearn.linear_model import LogisticRegression
from preprocess import retProcessedData
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
import pickle as pl
data_path = "winequality-red.csv"... |
santoshdkolur/RegProg | LinearRegression.py | from sklearn.metrics import confusion_matrix
import pandas as pd
from sklearn.linear_model import LinearRegression
from preprocess import retProcessedData
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
data_path = "winequality-red.csv"
df=pd.read_csv(data_p... |
santoshdkolur/RegProg | RidgeRegression.py | <reponame>santoshdkolur/RegProg
from sklearn.linear_model import Ridge
from preprocess import retProcessedData
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import GridSearchCV
import pandas as pd
import pickle as pl
data_path ... |
santoshdkolur/RegProg | KMeans.py | import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.cluster import KMeans
from sklearn.model_selection import cross_val_score,GridSearchCV
from sklearn.metrics import confusion_matrix
import pickle as pl
import pandas ... |
dericf/sendgrid-examples | examples-python/send-with-unsubscribe-group.py | <filename>examples-python/send-with-unsubscribe-group.py
# Standard Library
from typing import Union, List
# SendGrid
from sendgrid import SendGridAPIClient, Asm
from sendgrid.helpers.mail import Mail
# Dotenv
from dotenv import dotenv_values
config = dotenv_values(".env")
def send_with_unsubscribe_group(to_emails... |
dericf/sendgrid-examples | examples-python/send-with-dynamic-template.py | # Standard Library
from typing import Union, List
# SendGrid
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
# Dotenv
from dotenv import dotenv_values
config = dotenv_values(".env")
def send_with_dynamic_template(to_emails: Union[str, List[str]]):
#
# Build Sendgrid Mail Objec... |
dericf/sendgrid-examples | examples-python/send-with-dynamic-template-and-unsubscribe.py | # Standard Library
from typing import Union, List
# SendGrid
from sendgrid import SendGridAPIClient, Asm
from sendgrid.helpers.mail import Mail
# Dotenv
from dotenv import dotenv_values
config = dotenv_values(".env")
def send_with_dynamic_template_and_unsubscribe(to_emails: Union[str, List[str]]):
#
# Buil... |
dericf/sendgrid-examples | examples-python/send-basic.py | # Standard Library
from typing import Union, List
# SendGrid
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
# Dotenv
from dotenv import dotenv_values
config = dotenv_values(".env")
def send_basic_email(to_emails: Union[str, List[str]], subject: str, html_content: str):
#
# Bu... |
alexa-00/all-hello-world | src/python.py | # Hello world in Python
print("Hello world")
|
alexmitchell/file_manipulations | data_wrangling/legacy_code/Qs_pickle_processor.py | #!/usr/bin/env python3
# This script will load Qs# chunk pickles according to the omnipickle and
# combine them into complete Qs pickles
#
# Qs_omnipickle = {period_path: Qs_pickle_paths}
#
# Qs# pickles are panda dataframes directly translated from the raw txt files
import matplotlib
import matplotlib.pyplot as plt... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/extraction_crawler.py | import os
import numpy as np
# From Helpyr
import data_loading
from helpyr_misc import nsplit
from helpyr_misc import ensure_dir_exists
from logger import Logger
from crawler import Crawler
from xlrd.biffh import XLRDError
# ISSUE TO ADDRESS:
# ExtractionCrawler appears to be out of date. Might not function withou... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/manual_processor.py |
from os.path import join as pjoin
from os.path import split as psplit
import numpy as np
import pandas as pd
from time import asctime
from xlrd.biffh import XLRDError
#import re
#import matplotlib.pyplot as plt
#import scipy as scp
#import statsmodels.api as sm
# From helpyr
from helpyr import data_loading
from help... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/process_all.py | #!/usr/bin/env python3
import Qs_pickle_processor as QsPP
primary = QsPP.PrimaryPickleProcessor(output_txt=True)
primary.run()
secondary = QsPP.SecondaryPickleProcessor() # Creates the omnimanager
secondary.run()
import manual_processor as MP
manual_processor = MP.ManualProcessor()
manual_processor.run()
import dem_... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/tokens.py | <filename>data_wrangling/legacy_code/tokens.py<gh_stars>0
#!/usr/bin/env python3
from os.path import join as pjoin
from time import asctime
import numpy as np
import pandas as pd
# From Helpyr
from helpyr.helpyr_misc import nsplit
import global_settings as settings
# These classes were originally coded for the Qs s... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/universal_grapher.py | #!/usr/bin/env python3
from os.path import join as ospath_join
from time import asctime
from time import sleep
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
#import seaborn as sns
import statsmodels.api as sm
# From Helpyr
from helpyr import helpyr_misc as hm
from hel... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/__init__.py | <filename>data_wrangling/legacy_code/__init__.py
#!/usr/bin/env python3
name = "data_wrangling"
#import data_wrangling.global_settings
#import data_wrangling.tokens
#import data_wrangling.omnipickle_manager
|
alexmitchell/file_manipulations | data_wrangling/legacy_code/eosc_510_gsd_Qs_pca.py | #!/usr/bin/env python3
from os.path import join as pjoin
from os.path import isfile as os_isfile
import numpy as np
import pandas as pd
from scipy.stats import linregress as stats_linregress
from scipy.cluster import hierarchy as scipy_hierarchy
from sklearn import decomposition as skl_decomposition
from sklearn.mod... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/linking_crawler.py | <filename>data_wrangling/legacy_code/linking_crawler.py
import os
from crawler import Crawler
class LinkingCrawler (Crawler):
def __init__(self, log_filepath="./log-crawler.txt"):
Crawler.__init__(self, log_filepath)
self.set_links_dir("./links/")
self.mode_dict['2m-photos'] = self.run_2... |
alexmitchell/file_manipulations | data_wrangling/data_collectors/__init__.py | <reponame>alexmitchell/file_manipulations
#!/usr/bin/env python3
from .data_collector_base import DataCollectorBase
from .lighttable_collector import LightTableCollector
__all__ = [
"DataCollectorBase",
"LightTableCollector",
]
|
alexmitchell/file_manipulations | data_wrangling/data_collectors/trap_mass_collector.py | <reponame>alexmitchell/file_manipulations
#!/usr/bin/env python3
from data_wrangling.data_collectors.data_collector_base import DataCollectorBase
class MyCollector(DataCollectorBase):
def __init__(self, data_root_dir, output_dir):
super().__init__(data_root_dir, output_dir)
self.name = 'my collec... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/global_settings.py | <filename>data_wrangling/legacy_code/global_settings.py
#!/usr/bin/env python3
import numpy as np
from os.path import join as pjoin
gravity = 9.81 #m/s^2
water_density = 1000 # kg/m^3
sediment_density = 2650 # kg/m^3
flume_slope = 0.022
flume_width = 1 #m
init_bed_height = 21 #cm ### Double check this!
stationing_2m... |
alexmitchell/file_manipulations | tests/collectors/test_data_collector_base.py | #!/usr/bin/env python3
import pytest
import os.path
from io import StringIO
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
from data_wrangling import DataCollectorBase
class FakeCollector(DataCollectorBase):
def __init__(self, data_root_dir, output_dir):
super().__i... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/dem_processor.py |
from os.path import join as pjoin
from os.path import split as psplit
import numpy as np
import pandas as pd
from time import asctime
from xlrd.biffh import XLRDError
#import re
#import matplotlib.pyplot as plt
#import scipy as scp
#import statsmodels.api as sm
# From helpyr
from helpyr import data_loading
from help... |
alexmitchell/file_manipulations | data_wrangling/data_collectors/data_collector_base.py | #!/usr/bin/env python3
from os import walk as os_walk
from os.path import join as path_join
from os.path import (
basename,
dirname,
splitext,
)
import fnmatch
class DataCollectorBase:
def __init__(self, data_root_dir, output_dir):
# Initialize the Collector base.
... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/update_tokens.py | #!/usr/bin/env python3
# Updates the Omnipickle tree definitions.
from os.path import join as pjoin
from time import asctime
# From helpyr
from helpyr.logger import Logger
from omnipickle_manager import OmnipickleManager
import global_settings as settings
# Start up logger
log_filepath = pjoin(settings.log_dir, "upd... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/read_depths.py | <filename>data_wrangling/legacy_code/read_depths.py
#!/usr/bin/env python3
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
# prototyping code to read depth data
datapath = '/home/alex/feed-timing/data/data-links/manual-data/'
figpath = '/home/alex/feed-timing/data/data... |
alexmitchell/file_manipulations | data_wrangling/legacy_code/Qs_grapher.py | <reponame>alexmitchell/file_manipulations
#!/usr/bin/env python3
from os.path import join as ospath_join
from time import asctime
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
# From Helpyr
from helpyr_misc import *
from logger import Logger
from... |
alexmitchell/file_manipulations | data_wrangling/data_collectors/lighttable_collector.py | <reponame>alexmitchell/file_manipulations
#!/usr/bin/env python3
from data_wrangling.data_collectors.data_collector_base import DataCollectorBase
class LightTableCollector(DataCollectorBase):
def __init__(self, data_root_dir, output_dir):
super().__init__(data_root_dir, output_dir)
self.name = '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.