id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,284,600 | test_run.py | OpenwaterHealth_OpenLIFU-python/tests/test_run.py | from pathlib import Path
import pytest
from helpers import dataclasses_are_equal
from openlifu.plan import Run
@pytest.fixture()
def example_run() -> Run:
return Run(
id="example_run",
success_flag = True,
note="Example note",
session_id="example_session",
solution_id="ex... | 757 | Python | .py | 21 | 31.333333 | 83 | 0.70411 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,601 | test_mask_focus.py | OpenwaterHealth_OpenLIFU-python/tests/test_mask_focus.py | import numpy as np
import pytest
from xarray import DataArray, Dataset
from openlifu.bf import mask_focus
from openlifu.geo import Point
@pytest.fixture()
def example_focus() -> DataArray:
return Point(
id="test_focus_point",
radius=1.,
position=np.array([0.5, 0.5, 0.5]),
dims=("x... | 1,477 | Python | .py | 42 | 26.261905 | 93 | 0.524877 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,602 | test_seg_method.py | OpenwaterHealth_OpenLIFU-python/tests/test_seg_method.py | import pytest
from openlifu.seg import Material, SegmentationMethod
@pytest.fixture()
def example_seg_method() -> SegmentationMethod:
return SegmentationMethod(
materials = {
'water' : Material(
id="water",
name="water",
sound_speed=1500.0,
... | 1,335 | Python | .py | 32 | 30.6875 | 138 | 0.598613 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,603 | helpers.py | OpenwaterHealth_OpenLIFU-python/tests/helpers.py | """Helper utilities for unit tests"""
from dataclasses import fields, is_dataclass
import numpy as np
import xarray
def dataclasses_are_equal(obj1, obj2) -> bool:
"""Return whether two nested dataclass structures are equal by recursively checking for equality of fields,
while specially handling numpy arrays... | 1,289 | Python | .py | 30 | 36.466667 | 111 | 0.684211 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,604 | test_solution.py | OpenwaterHealth_OpenLIFU-python/tests/test_solution.py | from datetime import datetime
from pathlib import Path
import numpy as np
import pytest
import xarray as xa
from helpers import dataclasses_are_equal
from openlifu import Point, Pulse, Sequence, Solution, Transducer
from openlifu.xdc.element import Element
@pytest.fixture()
def example_transducer() -> Transducer:
... | 5,122 | Python | .py | 106 | 40.04717 | 135 | 0.641385 | OpenwaterHealth/OpenLIFU-python | 8 | 2 | 41 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,605 | setup.py | Mixdor_CircuiTikZ-Generator/setup.py | from cx_Freeze import setup, Executable
includefiles = [('images', 'lib/images'), ('list_components.txt', 'lib/list_components.txt')]
setup(
name="Circuitikz-Generator",
version="0.7",
description="Tool to design electronic circuits in LaTeX",
executables=[Executable('main.py', base=None, target_name=... | 443 | Python | .py | 13 | 28.923077 | 93 | 0.665888 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,606 | main.py | Mixdor_CircuiTikZ-Generator/main.py | import sys
from PyQt6 import QtCore
from PyQt6.QtWidgets import QApplication
from ui.Resources import Resources
from ui.Window import MainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setHighDpiScaleFactorRoundingPolicy(QtCore.Qt.HighDpiScaleFactorRoundingPolicy.Round)
app.setStyle(... | 658 | Python | .py | 18 | 32.5 | 93 | 0.770932 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,607 | ObjTool.py | Mixdor_CircuiTikZ-Generator/objects/ObjTool.py | class ObjTool:
def __init__(self, name, group_name, class_name, image, image_static, latex):
self.name = name
self.group_name = group_name
self.class_name = class_name
self.image = image
self.image_static = image_static
self.latex = latex
@property
def name(... | 1,300 | Python | .py | 44 | 22.704545 | 81 | 0.628319 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,608 | ObjComponent.py | Mixdor_CircuiTikZ-Generator/objects/ObjComponent.py | class ObjComponent:
def __init__(self, num, name, group_name, class_name, seed_latex, middle_point, angle, positions, label, drawables, latex):
self.num = num
self.name = name
self.group_name = group_name
self.class_name = class_name
self.seed_latex = seed_latex
self... | 2,271 | Python | .py | 79 | 21.835443 | 127 | 0.627017 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,609 | ObjEvent.py | Mixdor_CircuiTikZ-Generator/objects/ObjEvent.py |
class ObjEvent:
def __init__(self, id_event, type_event, component_before, component):
self.id_event = id_event
self.type_event = type_event
self.component_before = component_before
self.component = component
@property
def id_event(self):
return self._id_event
... | 992 | Python | .py | 30 | 26.266667 | 74 | 0.663866 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,610 | DrawAuxiliar.py | Mixdor_CircuiTikZ-Generator/drawables/DrawAuxiliar.py | from PyQt6.QtCore import Qt
from PyQt6.QtGui import QColor, QPen
from PyQt6.QtWidgets import QGraphicsLineItem, QGraphicsEllipseItem
from ui.Resources import Resources
class DrawAuxiliar:
def __init__(self, canvas):
self.resources = Resources()
self.canvas = canvas
self.scene = canvas.sc... | 2,275 | Python | .py | 53 | 32.358491 | 104 | 0.618487 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,611 | DrawComponent.py | Mixdor_CircuiTikZ-Generator/drawables/DrawComponent.py | import math
from PyQt6.QtCore import QPointF, Qt
from auxiliar.Calculate import Calculate
from drawables.Draw import Draw
class DrawComponent:
def __init__(self, scene):
self.scene = scene
self.draw = Draw(self.scene)
self.calculate = Calculate()
def one_pins(self, device_ratio, st... | 5,519 | Python | .py | 161 | 23.180124 | 118 | 0.548417 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,612 | Draw.py | Mixdor_CircuiTikZ-Generator/drawables/Draw.py | import math
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QImage, QPainter, QPixmap, QColor, QPen, QFont
from PyQt6.QtSvg import QSvgRenderer
from PyQt6.QtWidgets import QGraphicsPixmapItem, QGraphicsLineItem, QGraphicsTextItem, QGraphicsColorizeEffect
class Draw:
def __init__(self, scene):
self.f... | 8,974 | Python | .py | 183 | 39.125683 | 110 | 0.629003 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,613 | Window.py | Mixdor_CircuiTikZ-Generator/ui/Window.py | from PyQt6.QtCore import Qt, QThread, pyqtSignal, QUrl
from PyQt6.QtGui import QKeySequence, QShortcut, QIcon, QDesktopServices
from PyQt6.QtSvgWidgets import QSvgWidget
from PyQt6.QtWidgets import *
from auxiliar.SourceForge import SourceForge
from components.ComponentsCreator import ComponentsCreator
from components... | 13,257 | Python | .py | 262 | 40.545802 | 138 | 0.663724 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,614 | WindowGenerate.py | Mixdor_CircuiTikZ-Generator/ui/WindowGenerate.py | from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QWidget, QCheckBox, QVBoxLayout, QTextEdit, QPushButton, QDialog, QHBoxLayout, QApplication
from components.Latex import Latex
class WindowGenerate(QDialog):
def __init__(self, components):
super().__init__()
self.setWindowTitle('Generated')... | 2,528 | Python | .py | 52 | 39.365385 | 119 | 0.674258 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,615 | WindowNewVersion.py | Mixdor_CircuiTikZ-Generator/ui/WindowNewVersion.py | from PyQt6.QtCore import Qt, QUrl
from PyQt6.QtGui import QDesktopServices
from PyQt6.QtWidgets import QDialog, QVBoxLayout, QWidget, QLabel, QPushButton, QHBoxLayout
class WindowNewVersion(QDialog):
def __init__(self):
super().__init__()
self.setWindowTitle('New Version Available')
self... | 1,260 | Python | .py | 26 | 39.615385 | 120 | 0.690359 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,616 | MainCanvas.py | Mixdor_CircuiTikZ-Generator/ui/MainCanvas.py | from PyQt6.QtCore import Qt, QPoint, QRectF, QPointF
from PyQt6.QtGui import QColor
from PyQt6.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsRectItem, QGraphicsLineItem, \
QGraphicsTextItem
from auxiliar.Calculate import Calculate
from components.ComponentsRemover import ComponentsRemover
from component... | 9,920 | Python | .py | 197 | 35.649746 | 98 | 0.56838 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,617 | Resources.py | Mixdor_CircuiTikZ-Generator/ui/Resources.py | import os
import sys
from PyQt6 import QtGui
from PyQt6.QtGui import QGuiApplication, QColor, QPalette
class Resources:
def __init__(self):
self.main_path = None
self.pathResources = None
self.color_active = None
self.color_deactivate = None
self.color_canvas = None
... | 5,094 | Python | .py | 77 | 55.649351 | 108 | 0.696175 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,618 | SourceForge.py | Mixdor_CircuiTikZ-Generator/auxiliar/SourceForge.py | import platform
import re
import requests
class SourceForge:
def __init__(self):
self.project_name = "circuitikz-generator"
self.api_url = f"https://sourceforge.net/projects/{self.project_name}/best_release.json"
def check_version(self, name_app):
new_version_available = False
... | 1,591 | Python | .py | 34 | 32.735294 | 113 | 0.556132 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,619 | Calculate.py | Mixdor_CircuiTikZ-Generator/auxiliar/Calculate.py | import math
from PyQt6.QtCore import QPointF
class Calculate:
def __init__(self):
super().__init__()
def middle_point(self, start_point, final_point):
middle_point = QPointF(
(start_point.x() + final_point.x()) / 2,
(start_point.y() + final_point.y()) / 2
)
... | 1,776 | Python | .py | 50 | 25.38 | 75 | 0.523113 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,620 | TxtToComponents.py | Mixdor_CircuiTikZ-Generator/components/TxtToComponents.py | import os
import re
from objects.ObjTool import ObjTool
class TxtToComponents:
def __init__(self, base_path):
self.base_path = base_path
def get_groups(self):
path = os.path.join(self.base_path, 'list_components.txt')
with open(path, 'r') as file:
content = file.read()
... | 3,311 | Python | .py | 83 | 29.349398 | 83 | 0.524436 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,621 | History.py | Mixdor_CircuiTikZ-Generator/components/History.py | import copy
from objects.ObjComponent import ObjComponent
from objects.ObjEvent import ObjEvent
class History:
def __init__(self):
self.list_undo = []
self.list_redo = []
def new_event_undo(self, type_event, component_before, component):
event = ObjEvent(
len(self.list_... | 6,456 | Python | .py | 125 | 35.864 | 85 | 0.585017 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,622 | ComponentsSelector.py | Mixdor_CircuiTikZ-Generator/components/ComponentsSelector.py | from PyQt6.QtCore import QRectF, Qt
from PyQt6.QtGui import QColor
from PyQt6.QtWidgets import QGraphicsTextItem, QGraphicsLineItem, QGraphicsRectItem
from ui.Resources import Resources
class ComponentsSelector:
def __init__(self):
super().__init__()
self.resources = Resources()
def unselec... | 3,071 | Python | .py | 65 | 34.153846 | 99 | 0.585007 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,623 | ComponentsEditor.py | Mixdor_CircuiTikZ-Generator/components/ComponentsEditor.py | import copy
from PyQt6.QtWidgets import QGraphicsTextItem
from components.Latex import Latex
from drawables.Draw import Draw
from objects.ObjComponent import ObjComponent
class ComponentsEditor:
def __init__(self, history):
super().__init__()
self.history = history
self.latex = Latex()
... | 5,967 | Python | .py | 119 | 27.201681 | 75 | 0.457939 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,624 | Drawable.py | Mixdor_CircuiTikZ-Generator/components/Drawable.py | import math
from PyQt6.QtCore import Qt, QPointF
from PyQt6.QtGui import QColor, QPen, QPixmap, QPainter, QImage
from PyQt6.QtSvg import QSvgRenderer
from PyQt6.QtWidgets import QGraphicsEllipseItem, QGraphicsLineItem, QGraphicsPixmapItem, QGraphicsTextItem
pen = QPen(Qt.GlobalColor.black, 1.5, Qt.PenStyle.SolidLine)... | 13,415 | Python | .py | 333 | 29.60961 | 110 | 0.567328 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,625 | Latex.py | Mixdor_CircuiTikZ-Generator/components/Latex.py | from PyQt6.QtCore import QPoint
class Latex:
def __init__(self):
super().__init__()
self.cell_size = 50
def get_one_pin(self, start_point, final_point, latex, label):
draws = []
x1 = str(start_point.x() / self.cell_size)
y1 = str(start_point.y() / self.cell_size)
... | 4,994 | Python | .py | 100 | 40.12 | 113 | 0.519547 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,626 | ComponentsRemover.py | Mixdor_CircuiTikZ-Generator/components/ComponentsRemover.py | from components.ComponentsSelector import ComponentsSelector
class ComponentsRemover:
def __init__(self, history):
super().__init__()
self.history = history
self.components_selector = ComponentsSelector()
def delete_selected(self, canvas):
if canvas.component_selected:
... | 685 | Python | .py | 16 | 34.1875 | 60 | 0.691958 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,627 | ComponentsCreator.py | Mixdor_CircuiTikZ-Generator/components/ComponentsCreator.py | import os
from PyQt6.QtCore import Qt
from auxiliar.Calculate import Calculate
from components.ComponentsSelector import ComponentsSelector
from components.Latex import Latex
from objects.ObjComponent import ObjComponent
class ComponentsCreator:
def __init__(self, history):
self.draw_component = None
... | 7,937 | Python | .py | 204 | 24.877451 | 94 | 0.52922 | Mixdor/CircuiTikZ-Generator | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,628 | setup.py | cathedral30_pyRockBlock/setup.py | from setuptools import setup
project_urls = {
'Documentation': 'https://cathedral30.github.io/pyRockBlock/'
}
setup(
name='pyRockBlock',
version='1.0.6',
packages=['pyRockBlock'],
url='https://github.com/cathedral30/pyRockBlock',
license='',
author='Henry Cooper',
author_email='cooper.... | 482 | Python | .py | 16 | 26.25 | 65 | 0.709052 | cathedral30/pyRockBlock | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,629 | pyRockBlock.py | cathedral30_pyRockBlock/pyRockBlock/pyRockBlock.py | from datetime import datetime, timedelta
from serial import Serial, SerialException
from enum import Enum
import logging
import time
class RockBlockException(Exception):
pass
class RockBlockSignalException(RockBlockException):
pass
class SessionResponse:
"""Stores the result of an attempted GSS sessio... | 14,098 | Python | .py | 363 | 29.090909 | 117 | 0.582943 | cathedral30/pyRockBlock | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,630 | conf.py | cathedral30_pyRockBlock/docs/source/conf.py | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | 1,078 | Python | .py | 23 | 45.521739 | 87 | 0.651385 | cathedral30/pyRockBlock | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,631 | clean_random_noise.py | AISViz_AISdb/examples/clean_random_noise.py | import os
from datetime import datetime
import shapely
from aisdb.tests.test_09_marinetraffic import testdir
from dotenv import load_dotenv
import aisdb
from aisdb import DBQuery, DBConn
from aisdb.gis import Domain
load_dotenv()
dbpath = os.environ.get('EXAMPLE_NOISE_DB', 'AIS.sqlitedb')
trafficDBpath = os.path.j... | 2,473 | Python | .py | 56 | 33.089286 | 122 | 0.574105 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,632 | tutorial.ipynb | AISViz_AISdb/examples/tutorial.ipynb | {
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "02361ac8",
"metadata": {},
"source": [
"# AISdb Tutorial 1\n",
"\n",
"This tutorial will show you how to use the AISdb package to load AIS data into a database and query it."
]
},
{
"attachments": {},
"cell_type... | 48,467 | Python | .py | 1,733 | 17.894403 | 350 | 0.435828 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,633 | visualize.py | AISViz_AISdb/examples/visualize.py | import os
from datetime import datetime, timedelta
import aisdb.web_interface
from aisdb.tests.create_testing_data import (
sample_database_file,
random_polygons_domain,
)
domain = random_polygons_domain()
example_dir = 'testdata'
if not os.path.isdir(example_dir):
os.mkdir(example_dir)
dbpath = os.path... | 1,410 | Python | .py | 40 | 28.5 | 78 | 0.643644 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,634 | query_db_API.py | AISViz_AISdb/examples/query_db_API.py | # Python standard library packages
import asyncio
import os
import sys
from datetime import datetime, timedelta
# These packages need to be installed with pip
import orjson
import websockets.client
# Query the MERIDIAN web API, or reconfigure the URL with an environment variable
db_hostname = 'wss://aisdb.meridian.cs... | 3,999 | Python | .py | 92 | 36 | 81 | 0.644404 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,635 | database_creation.py | AISViz_AISdb/examples/database_creation.py | import os
import re
from collections import defaultdict
from urllib.parse import quote_plus
import glob2
import aisdb
psql_conn_string = f"postgresql://<USER>:{quote_plus('<PASSWORD>')}@<HOST>:<PORT>/<DATABASE>"
def process_csv(filepaths, source):
"""
Process CSV files and store the data in a PostgreSQL da... | 3,746 | Python | .py | 87 | 36.482759 | 106 | 0.650041 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,636 | conf.py | AISViz_AISdb/docs/source/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 2,282 | Python | .py | 56 | 38.660714 | 79 | 0.670439 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,637 | receiver.py | AISViz_AISdb/aisdb/receiver.py | import os
from aisdb.aisdb import receiver as _receiver
def start_receiver(sqlite_dbpath=os.path.abspath("./ais_rx.db"),
postgres_connection_string=None,
connect_addr="aisdb.meridian.cs.dal.ca:9920",
tcp_listen_addr=None,
udp_listen_addr=Non... | 2,471 | Python | .py | 51 | 34.215686 | 105 | 0.586164 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,638 | denoising_encoder.py | AISViz_AISdb/aisdb/denoising_encoder.py | import warnings
from functools import reduce
import numpy as np
from aisdb.aisdb import encoder_score_fcn
from aisdb.gis import delta_knots, delta_meters
def _score_idx(scores):
''' Returns indices of score array where value at index is equal to the
highest score. In tie cases, the last index will be se... | 9,125 | Python | .py | 210 | 32.880952 | 87 | 0.578378 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,639 | gis.py | AISViz_AISdb/aisdb/gis.py | '''Geometry and GIS utilities'''
import os
import pathlib
import tempfile
from datetime import datetime, timedelta
from functools import partial
import numpy as np
import shapely.geometry
import shapely.ops
from aisdb.aisdb import haversine
from shapely.geometry import Polygon, LineString, Point
from aisdb.proc_util... | 21,278 | Python | .py | 513 | 30.202729 | 128 | 0.527795 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,640 | __init__.py | AISViz_AISdb/aisdb/__init__.py | import logging
import os
import warnings
import toml
with open(
os.path.join(os.path.dirname(os.path.dirname(__file__)),
'pyproject.toml'), 'r') as tomlfile:
__version__ = toml.load(tomlfile).get('project').get('version')
import sqlite3
if (sqlite3.sqlite_version_info[0] < 3
... | 1,706 | Python | .py | 58 | 24.87931 | 79 | 0.703317 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,641 | web_interface.py | AISViz_AISdb/aisdb/web_interface.py | import asyncio
import http.server
import logging
import multiprocessing
import os
import socketserver
import webbrowser
from datetime import datetime
from functools import partial
from tempfile import SpooledTemporaryFile
import orjson
import websockets.server
logging.getLogger("websockets").setLevel(logging.WARNING)... | 7,670 | Python | .py | 184 | 31.945652 | 99 | 0.587832 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,642 | track_gen.py | AISViz_AISdb/aisdb/track_gen.py | ''' generation, segmentation, and filtering of vessel trajectories '''
import sqlite3
import types
import warnings
from datetime import timedelta
from functools import reduce
import numpy as np
from aisdb.aisdb import simplify_linestring_idx
from aisdb import Domain
from aisdb.gis import delta_knots
from aisdb.proc_... | 8,879 | Python | .py | 215 | 31.274419 | 115 | 0.56679 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,643 | proc_util.py | AISViz_AISdb/aisdb/proc_util.py | import csv
import io
import os
import re
import typing
from datetime import datetime, timedelta
from functools import partial, reduce
from tempfile import SpooledTemporaryFile
import numpy as np
def _sanitize(s):
# note: the first comma uses ASCII code 44,
# second comma uses ASCII decimal 130 !!
# not t... | 11,226 | Python | .py | 269 | 30.550186 | 104 | 0.539936 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,644 | network_graph.py | AISViz_AISdb/aisdb/network_graph.py | '''
collect vessel transits between domain zones (graph nodes), and aggregate
trajectory statistics within the overall domain
'''
import os
import pickle
import re
import tempfile
import types
import warnings
from datetime import timedelta
from functools import partial, reduce
import numpy as np
import aisdb... | 18,631 | Python | .py | 413 | 34.205811 | 83 | 0.584123 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,645 | interp.py | AISViz_AISdb/aisdb/interp.py | ''' linear interpolation of track segments on temporal axis '''
import warnings
from datetime import timedelta
import numpy as np
from pyproj import Transformer, Geod
from scipy.interpolate import CubicSpline
def np_interp_linear(track, key, intervals):
assert len(track['time']) == len(track[key])
return n... | 11,559 | Python | .py | 266 | 32.06015 | 106 | 0.525069 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,646 | wsa.py | AISViz_AISdb/aisdb/wsa.py | '''
Compute wetted surface area using denny-mumford regression on vessel summer
deadweight tonnage
See table 2 in below paper for coefficient and exponent by ship type
Reference:
Moser, Cameron S., et al. "Quantifying the total wetted surface area of the world fleet: a first step in determining the potential extent o... | 3,857 | Python | .py | 93 | 32.075269 | 205 | 0.590435 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,647 | test_005_dbqry.py | AISViz_AISdb/aisdb/tests/test_005_dbqry.py | import os
import warnings
from datetime import datetime, timedelta
from shapely.geometry import Polygon
from aisdb import (DBConn, DBQuery, Domain, sqlfcn, sqlfcn_callbacks, )
from aisdb.database.create_tables import sql_createtable_dynamic
from aisdb.tests.create_testing_data import (sample_database_file, sample_gul... | 2,595 | Python | .py | 47 | 48.148936 | 108 | 0.695156 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,648 | test_001_postgres.py | AISViz_AISdb/aisdb/tests/test_001_postgres.py | import os
from datetime import datetime, timedelta
from shapely.geometry import Polygon
from aisdb import (DBConn, DBQuery, Domain, PostgresDBConn, sqlfcn, sqlfcn_callbacks, )
from aisdb.database.decoder import decode_msgs
from aisdb.tests.create_testing_data import (sample_database_file, sample_gulfstlawrence_bbox, ... | 6,093 | Python | .py | 92 | 58.673913 | 110 | 0.690365 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,649 | test_012_interp.py | AISViz_AISdb/aisdb/tests/test_012_interp.py | import aisdb
from aisdb import dt_2_epoch
def test_track_interpolation():
import numpy as np
from datetime import timedelta, datetime
y1, x1 = -66.84683, -61.10595523571155
y2, x2 = -66.83036, -61.11595523571155
y3, x3 = -66.82036, -61.12595523571155
t1 = dt_2_epoch(datetime(2021, 1, 1, 1))
... | 821 | Python | .py | 18 | 39.611111 | 109 | 0.635338 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,650 | test_004_sqlfcn.py | AISViz_AISdb/aisdb/tests/test_004_sqlfcn.py | import os
from datetime import datetime, timedelta
import numpy as np
from aisdb import sqlfcn, sqlfcn_callbacks
y, x = 44., -63.
start = datetime(2021, 5, 1)
kwargs = dict(start=start, end=start + timedelta(days=7), xmin=x - 5, xmax=x + 5, ymin=y - 5, ymax=y + 5, )
def test_dynamic(tmpdir):
dbpath = os.path.j... | 2,292 | Python | .py | 46 | 43.804348 | 118 | 0.692342 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,651 | create_testing_data.py | AISViz_AISdb/aisdb/tests/create_testing_data.py | import os
import numpy as np
from shapely.geometry import Polygon
from aisdb import decode_msgs, DBConn
from aisdb.database.create_tables import (sql_createtable_dynamic, sql_createtable_static, )
from aisdb.gis import Domain
def sample_dynamictable_insertdata(*, dbconn):
# db = DBConn()
assert isinstance(d... | 2,768 | Python | .py | 54 | 45.259259 | 165 | 0.677407 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,652 | test_003_createtables.py | AISViz_AISdb/aisdb/tests/test_003_createtables.py | import os
import warnings
from aisdb.database.create_tables import (sql_createtable_dynamic, )
from aisdb.database.dbconn import DBConn
from aisdb.database.decoder import decode_msgs
def test_create_static_table(tmpdir):
dbpath = os.path.join(tmpdir, "test_create_static_table.db")
with DBConn(dbpath) as dbco... | 1,665 | Python | .py | 33 | 44.424242 | 99 | 0.704069 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,653 | test_011_ui.py | AISViz_AISdb/aisdb/tests/test_011_ui.py | import os
from datetime import datetime, timedelta
from shapely.geometry import Polygon
import aisdb
from aisdb import SQLiteDBConn, Domain, DBQuery, sqlfcn_callbacks
from aisdb.tests.create_testing_data import (sample_database_file, sample_gulfstlawrence_bbox, )
from aisdb.web_interface import serialize_zone_json, s... | 1,620 | Python | .py | 34 | 40.705882 | 99 | 0.679138 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,654 | test_015_raster_dist.py | AISViz_AISdb/aisdb/tests/test_015_raster_dist.py | import os
import numpy as np
from aisdb.webdata.shore_dist import ShoreDist, PortDist, CoastDist
y1, x1 = 48.271185186388735, -61.10595523571155
data_dir = os.environ.get("AISDBDATADIR",
os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "testdata", ), )
tracks_shor... | 1,129 | Python | .py | 22 | 43.727273 | 116 | 0.659672 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,655 | test_016_bathymetry.py | AISViz_AISdb/aisdb/tests/test_016_bathymetry.py | import os
import numpy as np
from aisdb.webdata.bathymetry import Gebco
data_dir = os.environ.get("AISDBDATADIR",
os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "testdata", ), )
y1, x1 = 48.271185186388735, -61.10595523571155
tracks_single = [dict(lon=np.array([x... | 1,183 | Python | .py | 24 | 42.958333 | 116 | 0.655352 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,656 | test_006_gis.py | AISViz_AISdb/aisdb/tests/test_006_gis.py | import os
import zipfile
import numpy as np
from shapely.geometry import Polygon
from aisdb.gis import (Domain, DomainFromPoints, DomainFromTxts, distance3D, shiftcoord, )
from aisdb.tests.create_testing_data import random_polygons_domain
from aisdb.tests.create_testing_data import sample_gulfstlawrence_bbox
def te... | 2,795 | Python | .py | 63 | 38.698413 | 119 | 0.637976 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,657 | test_013_proc_util.py | AISViz_AISdb/aisdb/tests/test_013_proc_util.py | import os
from datetime import datetime, timedelta
import numpy as np
import aisdb
from aisdb import track_gen, sqlfcn_callbacks
from aisdb.database import sqlfcn
from aisdb.database.dbconn import DBConn
from aisdb.database.dbqry import DBQuery
from aisdb.tests.create_testing_data import sample_database_file
from ais... | 3,631 | Python | .py | 67 | 50.238806 | 115 | 0.694045 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,658 | test_007_trackgen.py | AISViz_AISdb/aisdb/tests/test_007_trackgen.py | import os
from datetime import datetime, timedelta
import numpy as np
from aisdb import encode_greatcircledistance
from aisdb import track_gen, sqlfcn_callbacks
from aisdb.database.dbconn import DBConn
from aisdb.database.dbqry import DBQuery
from aisdb.gis import vesseltrack_3D_dist, mask_in_radius_2D
from aisdb.tes... | 2,105 | Python | .py | 42 | 43.452381 | 110 | 0.69508 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,659 | test_014_marinetraffic.py | AISViz_AISdb/aisdb/tests/test_014_marinetraffic.py | from datetime import datetime
from shapely.geometry import Polygon
from aisdb import DBConn
from aisdb import track_gen, decode_msgs, DBQuery, sqlfcn_callbacks, Domain
from aisdb.tests.create_testing_data import sample_gulfstlawrence_bbox
from aisdb.webdata._scraper import *
from aisdb.webdata.marinetraffic import ve... | 2,648 | Python | .py | 58 | 39.672414 | 115 | 0.70856 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,660 | test_009_wsa.py | AISViz_AISdb/aisdb/tests/test_009_wsa.py | import os
import warnings
from datetime import datetime, timedelta
from aisdb import encode_greatcircledistance
from aisdb import track_gen, DBQuery, sqlfcn_callbacks, DBConn
from aisdb.database import sqlfcn
from aisdb.tests.create_testing_data import sample_database_file
from aisdb.webdata.marinetraffic import vesse... | 1,541 | Python | .py | 29 | 47.448276 | 115 | 0.732226 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,661 | test_002_decode.py | AISViz_AISdb/aisdb/tests/test_002_decode.py | import os
from datetime import datetime
from aisdb.database.dbconn import DBConn
from aisdb.database.decoder import decode_msgs
def test_decode_1day(tmpdir):
dbpath = os.path.join(tmpdir, "test_decode_1day.db")
testing_data_zip = os.path.join(os.path.dirname(__file__), "testdata", "test_data_20211101.nm4.zip... | 1,244 | Python | .py | 19 | 60.052632 | 110 | 0.695332 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,662 | test_010_network_graph.py | AISViz_AISdb/aisdb/tests/test_010_network_graph.py | import os
import warnings
from datetime import datetime, timedelta
from shapely.geometry import Polygon
from aisdb.database import sqlfcn, sqlfcn_callbacks
from aisdb.database.dbconn import DBConn
from aisdb.database.dbqry import DBQuery
from aisdb.gis import Domain
from aisdb.network_graph import graph
from aisdb.te... | 1,913 | Python | .py | 38 | 45.342105 | 117 | 0.704777 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,663 | test_008_interp.py | AISViz_AISdb/aisdb/tests/test_008_interp.py | import os
from datetime import datetime, timedelta
from aisdb import track_gen, sqlfcn, sqlfcn_callbacks
from aisdb.database.dbconn import DBConn
from aisdb.database.dbqry import DBQuery
from aisdb.interp import interp_time, geo_interp_time
from aisdb.tests.create_testing_data import sample_database_file
def test_in... | 1,251 | Python | .py | 25 | 42.84 | 110 | 0.681706 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,664 | decoder.py | AISViz_AISdb/aisdb/database/decoder.py | import gzip
import os
import pickle
import tempfile
import zipfile
from copy import deepcopy
from datetime import timedelta
from functools import partial
from hashlib import md5
import psycopg
from aisdb.aisdb import decoder
from dateutil.rrule import rrule, MONTHLY
from aisdb import sqlpath
from aisdb.database.dbcon... | 13,079 | Python | .py | 299 | 33.394649 | 133 | 0.611469 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,665 | sql_query_strings.py | AISViz_AISdb/aisdb/database/sql_query_strings.py | import warnings
from aisdb.gis import dt_2_epoch, shiftcoord
# callback functions
def in_bbox(*, alias, xmin, xmax, ymin, ymax, **_):
''' SQL callback restricting vessels in bounding box region
args:
alias (string)
the 'alias' in a 'WITH tablename AS alias ...' SQL statement
... | 4,176 | Python | .py | 120 | 26.6 | 142 | 0.537488 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,666 | create_tables.py | AISViz_AISdb/aisdb/database/create_tables.py | import os
from aisdb import sqlpath
with open(os.path.join(sqlpath, 'createtable_dynamic_clustered.sql'),
'r') as f:
sql_createtable_dynamic = f.read()
with open(os.path.join(sqlpath, 'createtable_static.sql'), 'r') as f:
sql_createtable_static = f.read()
with open(os.path.join(sqlpath, 'createtab... | 387 | Python | .py | 9 | 39.111111 | 79 | 0.705882 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,667 | dbqry.py | AISViz_AISdb/aisdb/database/dbqry.py | ''' class to convert a dictionary of input parameters into SQL code, and
generate queries
'''
import sqlite3
import warnings
from collections import UserDict
from datetime import datetime, timedelta, date
from functools import reduce
import numpy as np
import psycopg
from aisdb.database import sqlfcn, sqlfcn_cal... | 13,360 | Python | .py | 280 | 34.189286 | 118 | 0.548127 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,668 | dbconn.py | AISViz_AISdb/aisdb/database/dbconn.py | ''' SQLite Database connection
Also see: https://docs.python.org/3/library/sqlite3.html#connection-objects
'''
import ipaddress
import os
import re
import warnings
from calendar import monthrange
from collections import Counter
from datetime import datetime
from enum import Enum
import numpy as np
import psycopg... | 18,615 | Python | .py | 427 | 30.466042 | 115 | 0.530855 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,669 | sqlfcn.py | AISViz_AISdb/aisdb/database/sqlfcn.py | ''' pass these functions to DBQuery.gen_qry() as the function argument '''
import os
from aisdb import sqlpath
with open(os.path.join(sqlpath, 'cte_dynamic_clusteredidx.sql'), 'r') as f:
sql_dynamic = f.read()
with open(os.path.join(sqlpath, 'cte_static_aggregate.sql'), 'r') as f:
sql_static = f.read()
with... | 2,785 | Python | .py | 60 | 40.733333 | 79 | 0.663341 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,670 | sqlfcn_callbacks.py | AISViz_AISdb/aisdb/database/sqlfcn_callbacks.py | ''' redefinitions of functions in :py:mod:`aisdb.database.sql_query_strings`,
combined into lambdas for convenience
'''
from datetime import datetime, timedelta
import numpy as np
from aisdb.database.sql_query_strings import (
has_mmsi,
in_bbox,
in_mmsi,
in_timerange,
valid_mmsi,
)
dt2months... | 1,739 | Python | .py | 51 | 30.490196 | 77 | 0.63161 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,671 | load_raster.py | AISViz_AISdb/aisdb/webdata/load_raster.py | import os
import numpy as np
from PIL import Image
from aisdb.aisdb import binarysearch_vector
Image.MAX_IMAGE_PIXELS = 650000000 # suppress DecompressionBombError warning
class _RasterFile_generic():
def __enter__(self):
assert hasattr(self, 'img')
return self
def __exit__(self, exc_type... | 2,386 | Python | .py | 51 | 37.607843 | 115 | 0.581967 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,672 | bathymetry.py | AISViz_AISdb/aisdb/webdata/bathymetry.py | """ load bathymetric data from GEBCO raster files """
import os
import warnings
from functools import reduce
import numpy as np
import py7zr
import requests
from tqdm import tqdm
from aisdb.gis import shiftcoord
from aisdb.webdata.load_raster import RasterFile
url = "http://bigdata5.research.cs.dal.ca/raster-bathy.... | 4,575 | Python | .py | 93 | 36.763441 | 120 | 0.556627 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,673 | marinetraffic.py | AISViz_AISdb/aisdb/webdata/marinetraffic.py | ''' scrape vessel information such as deadweight tonnage from marinetraffic.com '''
import os
import sqlite3
import numpy as np
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.support... | 11,282 | Python | .py | 278 | 31.165468 | 89 | 0.593353 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,674 | _scraper.py | AISViz_AISdb/aisdb/webdata/_scraper.py | ''' webscraper using selenium, firefox, and mozilla geckodriver '''
import os
import shutil
import requests
from bs4 import BeautifulSoup
import time
from random import randint
def firefox_driver():
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriv... | 7,335 | Python | .py | 169 | 36.272189 | 117 | 0.65802 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,675 | shore_dist.py | AISViz_AISdb/aisdb/webdata/shore_dist.py | """
This module calculates distances from the shore, coast, and the nearest port for given coordinates using raster
files from NASA and Global Fishing Watch. These calculations are valuable for various analyses, including
environmental impact studies, navigation safety assessments, and maritime activities monitoring.
... | 10,073 | Python | .py | 172 | 50.587209 | 120 | 0.667444 | AISViz/AISdb | 8 | 0 | 13 | AGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,676 | process_exllama.py | cg123_promptrate/process_exllama.py | # Copyright (C) 2023 Charles O. Goddard
#
# This software is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This software is d... | 5,165 | Python | .py | 141 | 29.751773 | 87 | 0.659804 | cg123/promptrate | 8 | 1 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,677 | prompts.py | cg123_promptrate/prompts.py | # Copyright (C) 2023 Charles O. Goddard
#
# This software is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This software is d... | 9,162 | Python | .py | 166 | 51.114458 | 300 | 0.755613 | cg123/promptrate | 8 | 1 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,678 | process_vllm.py | cg123_promptrate/process_vllm.py | # Copyright (C) 2023 Charles O. Goddard
#
# This software is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This software is d... | 2,683 | Python | .py | 69 | 31.826087 | 86 | 0.662058 | cg123/promptrate | 8 | 1 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,679 | main.py | cg123_promptrate/main.py | # Copyright (C) 2023 Charles O. Goddard
#
# This software is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This software is d... | 3,572 | Python | .py | 97 | 31.103093 | 88 | 0.67755 | cg123/promptrate | 8 | 1 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,680 | common.py | cg123_promptrate/common.py | # Copyright (C) 2023 Charles O. Goddard
#
# This software is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This software is d... | 3,214 | Python | .py | 87 | 31.563218 | 77 | 0.681672 | cg123/promptrate | 8 | 1 | 0 | LGPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,681 | face_blur.py | matin-ghorbani_face-blurring/face_blur.py | import cv2 as cv
from face_detector import FaceDetector
cap = cv.VideoCapture(0)
detector = FaceDetector(min_detection_con=.75)
while True:
_, frame = cap.read()
frame = cv.resize(frame, (0, 0), None, .5, .5)
frame, bboxs = detector.find_faces(frame, True)
if bboxs:
for i, bbox in enumerate(b... | 693 | Python | .py | 21 | 26.428571 | 54 | 0.568216 | matin-ghorbani/face-blurring | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,682 | face_detector.py | matin-ghorbani_face-blurring/face_detector.py | import cv2 as cv
from mediapipe.python.solutions.face_detection import FaceDetection
class FaceDetector:
"""
Find faces in realtime using the light weight model provided in the mediapipe
library.
"""
def __init__(self, min_detection_con=0.5, model_selection=0):
self.results = None
... | 1,759 | Python | .py | 33 | 38.545455 | 101 | 0.541231 | matin-ghorbani/face-blurring | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,683 | default.py | platzregen_audiobookshelf_simpleclient/default.py | import os
import xbmc
import xbmcgui
import xbmcaddon
from login_service import AudioBookShelfService
from library_service import AudioBookShelfLibraryService
#from media_item import Audiobook
from audio_book import AudioBookPlayer
MAX_COLUMNS = 3
MAX_ROWS = 2
MAX_PER_PAGE = MAX_COLUMNS * MAX_ROWS
COVER_WIDTH = 200
CO... | 10,877 | Python | .py | 264 | 37.530303 | 128 | 0.711779 | platzregen/audiobookshelf_simpleclient | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,684 | login_service.py | platzregen_audiobookshelf_simpleclient/login_service.py | import requests
class AudioBookShelfService:
def __init__(self, base_url):
self.base_url = base_url
def login(self, username, password):
url = f"{self.base_url}/login"
payload = {
"username": username,
"password": password
}
return self._post(url, payload).get("user")
def logout(self, socketId=Non... | 1,250 | Python | .py | 44 | 25.113636 | 70 | 0.689223 | platzregen/audiobookshelf_simpleclient | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,685 | audio_book.py | platzregen_audiobookshelf_simpleclient/audio_book.py | import xbmcgui
import xbmcaddon
import xbmc
import requests
import json
import threading
from library_service import AudioBookShelfLibraryService
class AudioBookPlayer(xbmcgui.WindowXMLDialog):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.id = kwargs['id']
self.title = kwargs['tit... | 6,036 | Python | .py | 172 | 31.069767 | 107 | 0.715342 | platzregen/audiobookshelf_simpleclient | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,686 | library_service.py | platzregen_audiobookshelf_simpleclient/library_service.py | import requests
import xbmc
import json
class AudioBookShelfLibraryService:
_instance = None
HEADERS_TEMPLATE = {
"Content-Type": "application/json"
}
def __new__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super(AudioBookShelfLibraryService, cls).__new__(cls)
return cls._instance
def ... | 4,647 | Python | .py | 116 | 36.551724 | 178 | 0.723385 | platzregen/audiobookshelf_simpleclient | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,687 | media_item.py | platzregen_audiobookshelf_simpleclient/media_item.py | from typing import List, Optional
class Metadata:
def __init__(self, title: str, title_ignore_prefix: Optional[str] = None,
subtitle: Optional[str] = None, author_name: str = '',
author_name_lf: Optional[str] = None, narrator_name: Optional[str] = None,
series_na... | 3,002 | Python | .py | 63 | 38.111111 | 92 | 0.612342 | platzregen/audiobookshelf_simpleclient | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,688 | config_parser.py | DvorakDwarf_fauxnix/src/fauxnix/config_parser.py | import os
import ruamel.yaml
DIRNAME = os.path.dirname(__file__)
POSSIBLE_PATHS = [
os.path.join(os.environ["HOME"], ".config/fauxnix/fauxnix.yaml"),
os.path.join(os.environ["HOME"], ".config/fauxnix/config.yaml"),
"/etc/fauxnix.yaml",
os.path.join(DIRNAME, "fauxnix.yaml"), #local
]
def find_config() ... | 1,755 | Python | .py | 44 | 34.136364 | 80 | 0.658235 | DvorakDwarf/fauxnix | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,689 | arguments.py | DvorakDwarf_fauxnix/src/fauxnix/arguments.py | import os
# import pwd
import subprocess
import ruamel.yaml
import json
import shutil
from datetime import date, datetime
import fauxnix.config_parser as config_parser
import fauxnix.utils as utils
const_yaml = ruamel.yaml.YAML()
#To keep GENERATION_DIR global, we break the rule of 1 yaml
GENERATION_DIR = utils.get... | 8,492 | Python | .py | 193 | 35.80829 | 139 | 0.626873 | DvorakDwarf/fauxnix | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,690 | utils.py | DvorakDwarf_fauxnix/src/fauxnix/utils.py | import os
import ruamel.yaml
import fauxnix.config_parser as config_parser
def get_gen(dir: str) -> int:
gen_section = dir.split("_")[0]
gen_num = int(gen_section[1:])
return gen_num
def get_sorted_gen(dirs: list) -> list:
return sorted(dirs, key=get_gen)
def get_gen_dir(yaml: ruamel.yaml.YAML) -> ... | 998 | Python | .py | 27 | 31.888889 | 75 | 0.669095 | DvorakDwarf/fauxnix | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,691 | main.py | DvorakDwarf_fauxnix/src/fauxnix/main.py | #!/usr/bin/env python
import os
import ruamel.yaml
import argparse
import fauxnix.arguments as arguments
import fauxnix.config_parser as config_parser
def main():
yaml = ruamel.yaml.YAML()
config = config_parser.load_config(yaml)
os.setegid(config["gid"])
os.seteuid(config["uid"])
parser = argp... | 2,722 | Python | .py | 62 | 34.903226 | 120 | 0.628702 | DvorakDwarf/fauxnix | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,692 | util.py | aaronWool_keygnet/util.py | class IOStream():
def __init__(self, path):
self.f = open(path, 'a')
def cprint(self, text):
print(text)
self.f.write(text+'\n')
self.f.flush()
def close(self):
self.f.close() | 229 | Python | .py | 9 | 18.555556 | 32 | 0.525114 | aaronWool/keygnet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,693 | train.py | aaronWool_keygnet/train.py | import torch
from torch.autograd import Variable
from torch import autograd
from tensorboardX import SummaryWriter
import open3d as o3d
import numpy as np
from model import KeyGNet
def cal_loss_dispersion(input,gamma):
'''
input: keypoint tensor [b,n,3]
b-batch
n-number of points
... | 15,054 | Python | .py | 330 | 32.651515 | 150 | 0.542199 | aaronWool/keygnet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,694 | data_loader.py | aaronWool_keygnet/data_loader.py | import os
import json
import torch
from torch.utils.data import Dataset
from PIL import Image
import numpy as np
import platform
import open3d as o3d
def rgbd_to_point_cloud(K, depth,rgb):
vs, us = depth.nonzero()
zs = depth[vs, us]
#print(zs.min())
#print(zs.max())
xs = ((us - K[0, 2]) * zs) / fl... | 6,662 | Python | .py | 144 | 36.256944 | 111 | 0.579668 | aaronWool/keygnet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,695 | model.py | aaronWool_keygnet/model.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
based on
@Author: Yue Wang
@Contact: yuewangx@mit.edu
@File: model.py
@Time: 2018/10/13 6:35 PM
modified by
@Author: Yangzheng Wu
@Contact: y.wu@queensu.ca
@File: model.py
"""
import os
import sys
import copy
import math
import numpy as np
import torch
import torch.nn... | 11,765 | Python | .py | 252 | 35.734127 | 181 | 0.563865 | aaronWool/keygnet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,696 | setup.py | dajuric_dark/dark-5/setup.py | from setuptools import setup
setup(
name="dark",
description="",
version="5.0",
packages=["dark"],
package_dir={"dark": "dark"},
install_requires = []
)
| 182 | Python | .py | 9 | 16 | 33 | 0.598837 | dajuric/dark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,697 | util.py | dajuric_dark/dark-5/samples/2.0-Func-logistic-regression/torch/util.py | import numpy as np
import matplotlib.pyplot as plt
ax = None
def plot(X, Y, eval_func):
global ax
if ax is None:
plt.ion()
plt.show()
ax = plt.figure().add_subplot(projection='3d')
ax.cla()
X_curve = np.meshgrid(np.linspace(0, 1, 25), np.linspace(0, 1, 25)... | 555 | Python | .py | 17 | 26.352941 | 70 | 0.605578 | dajuric/dark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,698 | train.py | dajuric_dark/dark-5/samples/2.0-Func-logistic-regression/torch/train.py | import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "True"
import numpy as np
import torch
import matplotlib.pyplot as plt
from util import *
from dataset import *
def sigmoid(x):
den = torch.add(1, torch.exp(torch.neg(x)))
return torch.div(1, den)
def bce_loss(predictions, targets):
lossA = torch.mul(targets... | 1,249 | Python | .py | 34 | 33.117647 | 92 | 0.690058 | dajuric/dark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |
2,284,699 | dataset.py | dajuric_dark/dark-5/samples/2.0-Func-logistic-regression/torch/dataset.py | import random
import torch
def get_data():
X = []; Y = []
for i in range(100):
x_1 = random.random()
x_2 = random.random()
y = 1 if x_1 < 0.5 else 0 #split
X.append((x_1, x_2))
Y.append([y])
X = torch.tensor(X, dtype=torch.float64)
Y = torch.tensor(Y,... | 357 | Python | .py | 13 | 20.923077 | 44 | 0.548193 | dajuric/dark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:43 PM (Europe/Amsterdam) |