id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
/LogGrap-0.1.9.tar.gz/LogGrap-0.1.9/README.md | # PyLogs
### A logging package for your python project
***
## Description
PyLogs allow you to add a logger to your python project. This logger can send the logs directly to the terminal and/or save them in an external file. Several options are available, such as :
- format
- type
- more in coming...
If you need help,... | PypiClean |
/CellNet-1.1.1.3-py3-none-any.whl/cellphonedb/src/local_launchers/local_query_launcher.py | from cellphonedb.src.app.app_logger import app_logger
class LocalQueryLauncher:
def __getattribute__(self, name):
method = object.__getattribute__(self, name)
if hasattr(method, '__call__'):
app_logger.info('Launching Query {}'.format(name))
return method
def __init__(sel... | PypiClean |
/HiveNetConsole-0.1.0.tar.gz/HiveNetConsole-0.1.0/README.md | # HiveNetConsole
HiveNetConsole is a simple command line execution framework, which can be extended based on yaml configuration file to add different command support. The main features are as follows:
1. Support yaml to configure different command extensions;
2. Support multi language display;
3. Enter the console to... | PypiClean |
/BPTK_Py-1.8.0.tar.gz/BPTK_Py-1.8.0/BPTK_Py/scenariorunners/hybrid_runner.py |
import pandas as pd
import json
from .scenario_runner import ScenarioRunner
from ..logger import log
class HybridRunner(ScenarioRunner):
"""
This class runs agent-based and hybrid simulation models that are built using the Model class.
"""
def _get_agents_for_model(self, scenario):
agen... | PypiClean |
/Dovetail-1.0beta2.tar.gz/Dovetail-1.0beta2/dovetail/loader.py | from os import path, access, R_OK
from sys import modules, meta_path
from imp import new_module, load_source
from inspect import stack
from dovetail.util import InvalidBuildFile, NoSuchModule, NoSuchTask, Logger, tree
WARNING = "{0} is not being imported from under the build root. \
It will not participate in automati... | PypiClean |
/EnergyCapSdk-8.2304.4743.tar.gz/EnergyCapSdk-8.2304.4743/energycap/sdk/models/map_dashboard_settings_request.py |
from msrest.serialization import Model
class MapDashboardSettingsRequest(Model):
"""MapDashboardSettingsRequest.
All required parameters must be populated in order to send to Azure.
:param title: Required. The title of the dashboard. <span
class='property-internal'>Required</span>
:type title:... | PypiClean |
/AaronTools-1.0b14.tar.gz/AaronTools-1.0b14/config.py | import configparser
from difflib import SequenceMatcher as seqmatch
import itertools as it
import os
import re
from getpass import getuser
import AaronTools
from AaronTools import addlogger
from AaronTools.const import AARONLIB, AARONTOOLS
from AaronTools.theory import (
GAUSSIAN_COMMENT,
GAUSSIAN_CONSTRAINTS,... | PypiClean |
/B9gemyaeix-4.14.1.tar.gz/B9gemyaeix-4.14.1/docs/contributing/security.rst | Security and privacy
====================
.. tip::
At Weblate, security maintains an environment that values the privacy of our users.
Development of Weblate adheres to the `Best Practices of the Linux Foundation's Core Infrastructure Initiative <https://bestpractices.coreinfrastructure.org/projects/552>`_.
.. s... | PypiClean |
/Mopidy_Pandora-1.1.1-py3-none-any.whl/mopidy_pandora/frontend.py | import logging
import threading
import time
from collections import namedtuple
from difflib import SequenceMatcher
from functools import total_ordering
from queue import PriorityQueue
import pykka
from mopidy import audio, core
from mopidy.audio import PlaybackState
from mopidy_pandora import listener
from mopidy_pan... | PypiClean |
/DocOnce-1.5.15-py3-none-any.whl/doconce/doconce_config_default.py | help = False
debug = False
no_abort = False
#verbose =
#language =
preprocess_include_subst = False
#syntax_check =
skip_inline_comments = False
draft = False
#CC_license =
align2equations = False
force_tikz_conversion = False
#tikz_libs =
IBPLOT = False
#exercise_numbering =
exercises_in_zip = False
#exercises_in_zip_... | PypiClean |
/NodeGraphQt_QuiltiX_fork-0.6.0.tar.gz/NodeGraphQt_QuiltiX_fork-0.6.0/NodeGraphQt/base/model.py | import json
from collections import defaultdict
from NodeGraphQt.constants import LayoutDirectionEnum, NodePropWidgetEnum
from NodeGraphQt.errors import NodePropertyError
class PortModel(object):
"""
Data dump for a port object.
"""
def __init__(self, node):
self.node = node
self.typ... | PypiClean |
/LEPL-5.1.3.zip/LEPL-5.1.3/src/lepl/bin/_example/literal.py | if bytes is str:
print('Binary parsing unsupported in this Python version')
else:
from lepl.bin import *
from lepl._example.support import Example
# pylint: disable-msg=C0103, C0111, C0301, W0702, C0324, R0201
# (dude this is just a test)
class ParseExample(Example):
... | PypiClean |
/HydPy-5.0.1-cp38-cp38-win_amd64.whl/hydpy/docs/prepare.py | # import...
# ...from standard library
import importlib
import inspect
import os
import shutil
import sys
os.chdir(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.abspath(os.path.join("..", "..")))
# pylint: disable=wrong-import-position
# (changing the path is necessary when calling `prepare.py... | PypiClean |
/LinkChecker-10.2.1-py3-none-any.whl/linkcheck/plugins/regexcheck.py | import re
from . import _ContentPlugin
from .. import log, LOG_PLUGIN
class RegexCheck(_ContentPlugin):
"""Define a regular expression which prints a warning if it matches
any content of the checked link. This applies only to valid pages,
so we can get their content.
Use this to check for pages that ... | PypiClean |
/FSlash-0.17.0.tar.gz/FSlash-0.17.0/fslash/collections/list.py | import builtins
import sys
from abc import ABC, abstractmethod
from typing import Any, Callable, Iterable, Iterator, Optional, Sized, Tuple, TypeVar, Union, cast, overload
from fslash.core.option import Nothing, Option, Some, pipe
from . import seq
TSource = TypeVar("TSource")
TResult = TypeVar("TResult")
TState = T... | PypiClean |
/BIA_OBS-1.0.3.tar.gz/BIA_OBS-1.0.3/BIA/static/dist/node_modules/flowbite/.github/ISSUE_TEMPLATE/bug_report.md | ---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior... | PypiClean |
/Auptimizer-2.0.tar.gz/Auptimizer-2.0/src/aup/compression/torch/pruning/net_adapt_pruner.py |
# Modified work Copyright (c) 2018 LG Electronics Inc.
# SPDX-License-Identifier: GPL-3.0-or-later
import logging
import os
import copy
import json
import torch
from schema import And, Optional
from ..torch_utils import OptimizeMode
from ..compressor import Pruner
from ..utils.config_validation import CompressorSch... | PypiClean |
/NREL-jade-0.9.9.tar.gz/NREL-jade-0.9.9/jade/cli/auto_config.py |
import logging
import click
from jade.common import CONFIG_FILE
from jade.loggers import setup_logging
from jade.exceptions import InvalidExtension
from jade.extensions.registry import Registry, ExtensionClassType
from jade.jobs.job_post_process import JobPostProcess
# TODO: need one group command for auto-config;... | PypiClean |
/BitEx-2.0.0b3.zip/BitEx-2.0.0b3/bitex/interface/base.py | import logging
# Import Third-Party
# Import Homebrew
# Init Logging Facilities
log = logging.getLogger(__name__)
class Interface:
def __init__(self, *, name, rest_api):
self.REST = rest_api
self.name = name
try:
self._supported_pairs = self._get_supported_pairs()
ex... | PypiClean |
/Flask_AdminLTE3-1.0.9-py3-none-any.whl/flask_adminlte3/static/plugins/codemirror/mode/haskell/haskell.js |
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use s... | PypiClean |
/observations-0.1.4.tar.gz/observations-0.1.4/observations/r/doctor_aus.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def doctor_aus(path):
"""Doctor Visits in Australia
a cross-section from 1977–1978
*number ... | PypiClean |
/MadEngine_server_mess-1.1.0.tar.gz/MadEngine_server_mess-1.1.0/server/server/server_qui.py | import sys
from PyQt6.QtWidgets import QMainWindow, QApplication, QLabel, QTableView, QDialog, QPushButton, \
QLineEdit, QFileDialog, QMessageBox
import sys
from PyQt6.QtWidgets import (
QMainWindow, QApplication,
QLabel, QToolBar, QStatusBar
)
# from PyQt6 import qApp
from PyQt6.QtGui import QAction, QIcon... | PypiClean |
/Benker-0.5.4.tar.gz/Benker-0.5.4/benker/converters/ooxml2formex.py | from benker.builders.formex import FormexBuilder
from benker.converters.base_converter import BaseConverter
from benker.parsers.ooxml import OoxmlParser
class Ooxml2FormexConverter(BaseConverter):
"""
Office Open XML to Formex 4 converter
"""
parser_cls = OoxmlParser
builder_cls = FormexBuilder
... | PypiClean |
/DevGossip-Nosakhare-0.1.0.tar.gz/DevGossip-Nosakhare-0.1.0/DevGossip/DevGossip.py | from random import randint
import json
from classes.classes import bcolors as bc
from pusher import Pusher
import pysher
import os
from dotenv import load_dotenv
load_dotenv(dotenv_path='.env')
def verify_username(username):
username_list = []
with open("users.txt", "r") as open_file:
users_file = op... | PypiClean |
/Demographics_box-1.24.tar.gz/Demographics_box-1.24/Demographics_box/Job.py | import random
#age above which the person should be retired
retirement_age = 65
#age below which the person is a kid or student
job_entry = 23
def generate_job(age):
"""Function to return a type of profession
Args:
age: int representing the age of the person
Returns
Str... | PypiClean |
/Nuitka_fixed-1.1.2-cp310-cp310-win_amd64.whl/nuitka/code_generation/IntegerCodes.py | from nuitka.PythonVersions import python_version
from .CodeHelpers import (
decideConversionCheckNeeded,
generateChildExpressionsCode,
withObjectCodeTemporaryAssignment,
)
from .ErrorCodes import getErrorExitCode
from .PythonAPICodes import generateCAPIObjectCode
def generateBuiltinLong1Code(to_name, exp... | PypiClean |
/GeoNode-3.2.0-py3-none-any.whl/geonode/base/migrations/0036_auto_20190129_1433.py |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('base', '0035_resourcebase_dirty_state'),
]
operations = [
migrations.CreateModel(
name='Menu',
fields=[
('id', mod... | PypiClean |
/Aries-Python-0.1.330.tar.gz/Aries-Python-0.1.330/Aries/visual/plotly.py | import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, plot, iplot
def in_ipython_notebook():
"""Checks if the program is running in a ipython/jupyter notebook.
"""
try:
ipython_class = get_ipython().__class__.__name__
if 'ZMQInteractiveShell' in ipython_class:
... | PypiClean |
/Abies-0.0.5.tar.gz/Abies-0.0.5/extern/pybind11/pybind11/setup_helpers.py | # IMPORTANT: If you change this file in the pybind11 repo, also review
# setup_helpers.pyi for matching changes.
#
# If you copy this file in, you don't
# need the .pyi file; it's just an interface file for static type checkers.
import contextlib
import os
import platform
import shlex
import shutil
import sys
import s... | PypiClean |
/MDAKit-1.0.0-py3-none-any.whl/MDKit/tools/ChemicalShift/shiftx2-xtc.py |
import os
import sys
import argparse
import mdtraj as md
import pandas as pd
import numpy as np
import tempfile
def average():
css = [cs for cs in os.listdir('.') if cs.endswith('.cs')]
names = ['Num','RES','CA','CB','CO','N','H','HA']
dtypes = {'Num':int, "RES":str, "CA":np.float64,"CB":np.float64,
... | PypiClean |
/BlueWhale3-Recommendation-0.1.3.tar.gz/BlueWhale3-Recommendation-0.1.3/doc/source/scripting/ranking/climf.rst | CLiMF
=====
CLiMF (Collaborative Less-is-More Filtering) is used in scenarios with binary
relevance data. Hence, it's focused on improving top-k recommendations through
ranking by directly maximizing the Mean Reciprocal Rank (MRR).
Following a similar technique as other iterative approaches, the two low-rank matrices... | PypiClean |
/EPN-0.1.1.zip/EPN-0.1.1/epn/rpn.py | from petri_net import *
import pydot
class ResizablePetriNet(PetriNet):
def __init__(self, nome):
super(ResizablePetriNet, self).__init__()
print "New RPN created"
self.VP = set()
self.VT = set()
self.ID = nome
self.FITNESS_VALUE = 0
def setID(self,nome):
self.ID = nome
def subDumpToFile(self, path... | PypiClean |
/ISY994v5-0.9.7.tar.gz/ISY994v5-0.9.7/isy994/network/async_session.py |
import asyncio
import functools
import logging
import xml.etree.ElementTree as ET
import traceback
import aiohttp
from .websocket_event import Websocket_Event
logger = logging.getLogger(__name__)
ws_headers = {
"Sec-WebSocket-Protocol": "ISYSUB",
"Origin": "com.universal-devices.websockets.isy",
}
http_hea... | PypiClean |
/ATpy-0.9.7.tar.gz/ATpy-0.9.7/README.md | Introduction
============
ATpy is a high-level package providing a way to manipulate tables of
astronomical data in a uniform way.
Documentation is available from [http://atpy.readthedocs.org/]
ATpy is released under an MIT open-source license
Please Note
===========
Much of ATpy’s functionality has now been incor... | PypiClean |
/Nuitka_fixed-1.1.2-cp310-cp310-win_amd64.whl/nuitka/utils/MacOSApp.py | import os
from nuitka import Options, OutputDirectories
from nuitka.containers.OrderedDicts import OrderedDict
from .FileOperations import copyFile, makePath, openTextFile
from .Images import convertImageToIconFormat
def createPlistInfoFile(logger, onefile):
# Many details, pylint: disable=too-many-locals
... | PypiClean |
/KitronikPicoSimplyServos-1.0.1-py3-none-any.whl/SimplyServos.py | from machine import Pin
from rp2 import PIO, StateMachine, asm_pio
class KitronikSimplyServos:
#Servo 0 degrees -> pulse of 0.5ms, 180 degrees 2.5ms
#pulse train freq 50hz - 20mS
#1uS is freq of 1000000
#servo pulses range from 500 to 2500usec and overall pulse train is 20000usec repeat.
#servo pin... | PypiClean |
/ER-Evaluation-2.1.0.tar.gz/ER-Evaluation-2.1.0/er_evaluation/error_analysis/__init__.py | r"""
==============
Error Analysis
==============
The **error_analysis** module provides tools to analyze errors, given a set of ground truth clusters. These ground truth clusters may correspond to a benchmark dataset which is *complete* (all of the entities within it are fully resolved and have no missing elements), ... | PypiClean |
/Mopidy-NeoPixel-0.1.1.tar.gz/Mopidy-NeoPixel-0.1.1/README.rst | ****************************
Mopidy-NeoPixel
****************************
.. image:: https://img.shields.io/pypi/v/Mopidy-NeoPixel
:target: https://pypi.org/project/Mopidy-NeoPixel/
:alt: Latest PyPI version
.. image:: https://img.shields.io/circleci/build/gh/fmatray/mopidy-neopixel
:target: https://circl... | PypiClean |
/OctoBot-0.4.54.tar.gz/OctoBot-0.4.54/octobot/configuration_manager.py | import copy
import os
import shutil
import octobot.constants as constants
import octobot_commons.configuration as configuration
import octobot_commons.constants as common_constants
import octobot_commons.logging as logging
import octobot_commons.json_util as json_util
import octobot_tentacles_manager.constants as tent... | PypiClean |
/Finance-Python-0.9.10.tar.gz/Finance-Python-0.9.10/doc/dates/basics.md | # basics
## 如何使用
所有的公开`api`都在`PyFin.api`模块下:
```python
In [1]: from PyFin.api import *
```
## 测试日期
在某工作日历下,是否为工作日:
```python
In [2]: isBizDay('china.sse', '2017-03-19')
Out[2]: False
```
## 生成日期序列
生成区间内的所有日期:
```python
In [3]: datesList('2017-01-01', '2017-01-15')
Out[3]:
[datetime.datetime(2017, 1, 1, 0, 0),
... | PypiClean |
/DI_engine-0.4.9-py3-none-any.whl/dizoo/beergame/envs/plotting.py | import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from pylab import *
# plotting
def plotting(plt, data, colori, pltLabel):
# plt.hold(True)
for i in range(np.shape(data)[0]):
plt.subplot(4, 5, 5 * i + 1)
plt.plot(np.transpose(data[i])[0, :],... | PypiClean |
/HBT_IP_Test-1.0.1-py3-none-any.whl/HBT_IP_Test/libs/isom/python/IsomAccounts_e_pb2.py |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_in... | PypiClean |
/HOPP-0.0.5-py3-none-any.whl/tools/optimization/optimizer/IWDCEM.py | import math
from abc import ABC
from collections import deque
from typing import (
Optional,
Tuple,
)
# import shapely
from .DCEM_optimizer import DCEMOptimizer
# sys.path.append('../examples/flatirons')
# import func_tools
# matplotlib.use('tkagg')
class IWDCEM(DCEMOptimizer, ABC):
"""
A proto... | PypiClean |
/MDsrv-0.3.5.tar.gz/MDsrv-0.3.5/README.md |
[](LICENSE)
[](https://github.com/arose/mdsrv/releases/tag/v0.3.5)
[](CHANGELOG)
[![Travis Build ... | PypiClean |
/GaussANDBino_distribution-1.0.tar.gz/GaussANDBino_distribution-1.0/GaussANDBino_distribution/Gaussiandistribution.py | import math
import matplotlib.pyplot as plt
from .Generaldistribution import Distribution
class Gaussian(Distribution):
""" Gaussian distribution class for calculating and
visualizing a Gaussian distribution.
Attributes:
mean (float) representing the mean value of the distribution
stdev (float) representing ... | PypiClean |
/CEmu-0.7.tar.gz/CEmu-0.7/cemu/ui/mapping.py | from __future__ import annotations
from typing import TYPE_CHECKING
from PyQt6.QtWidgets import (
QCheckBox,
QDockWidget,
QGridLayout,
QHBoxLayout,
QLabel,
QLineEdit,
QMessageBox,
QPushButton,
QTableWidget,
QTableWidgetItem,
QVBoxLayout,
QWidget,
)
import cemu.core
fro... | PypiClean |
/Flask-CKEditor-0.4.6.tar.gz/Flask-CKEditor-0.4.6/flask_ckeditor/static/basic/lang/fr.js | /*
Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/license
*/
CKEDITOR.lang['fr']={"editor":"Éditeur de texte enrichi","editorPanel":"Tableau de bord de l'éditeur de texte enrichi","common":{"editorHelp":"Utilisez le raccourci Alt-0 pour... | PypiClean |
/CouchDB2-1.13.0.tar.gz/CouchDB2-1.13.0/couchdb2.py | __version__ = "1.13.0"
# Standard packages
import argparse
import collections
import getpass
import gzip
import io
import json
import mimetypes
import os
import os.path
import tarfile
import sys
import time
import urllib.parse
import uuid
if sys.version_info[:2] < (3, 7):
from collections import OrderedDict as di... | PypiClean |
/HBT_IP_Test-1.0.1-py3-none-any.whl/HBT_IP_Test/libs/isom/python/IsomSecurity_pb2.py |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_in... | PypiClean |
/Neuroharmony-0.1.13.tar.gz/Neuroharmony-0.1.13/neuroharmony/data/collect_tools.py | from pathlib import Path
from requests import get
from shutil import copyfile
from zipfile import ZipFile
import joblib
import os
from pandas import read_csv
from tqdm import tqdm
def _download(url, filepath):
dirpath = Path(filepath).parent
Path(dirpath).mkdir(exist_ok=True)
headers = {"user-agent": "Wg... | PypiClean |
/BeanCommonUtils-1.1.7.tar.gz/BeanCommonUtils-1.1.7/common_utils/htmlTestRunner.py | # URL: http://tungwaiyip.info/software/HTMLTestRunner.html
__version__ = "0.9.1"
"""
Change History
Version 0.9.1
* 用Echarts添加执行情况统计图 (灰蓝)
Version 0.9.0
* 改成Python 3.x (灰蓝)
Version 0.8.3
* 使用 Bootstrap稍加美化 (灰蓝)
* 改为中文 (灰蓝)
Version 0.8.2
* Show output inline instead of popup window (Viorel Lupu).
Version in 0.8.1
... | PypiClean |
/Netzob-2.0.0.tar.gz/Netzob-2.0.0/src/netzob/Inference/Vocabulary/FormatOperations/_AsciiAlign.py |
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocols |
#+-... | PypiClean |
/Chips-python-2.2.3.tar.gz/Chips-python-2.2.3/chips/compiler/verilog_area.py | __author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2013, Jonathan P Dawson"
from .utils import calculate_jumps
from textwrap import dedent
def log2(instructions):
"""Integer only algorithm to calculate the number of bits needed to store a number"""
bits = 1
power = 2
while power < instructions... | PypiClean |
/AeroSandbox-4.1.1.tar.gz/AeroSandbox-4.1.1/aerosandbox/library/propulsion_electric.py | import aerosandbox.numpy as np
from aerosandbox.tools import units as u
from typing import Union, Dict
def motor_electric_performance(
voltage: Union[float, np.ndarray] = None,
current: Union[float, np.ndarray] = None,
rpm: Union[float, np.ndarray] = None,
torque: Union[float, np.ndarr... | PypiClean |
/CHASM_NuSpacesim-1.0.0.tar.gz/CHASM_NuSpacesim-1.0.0/src/CHASM/counter_array.py | import numpy as np
from scipy.constants import value,nano
from scipy.stats import norm
from shower_axis import Shower as sh
from functools import lru_cache
class CounterArray(sh):
'''Class for calculating Cherenkov yield of upward going showers at a
hypothetical orbital telescope array_z
Parameters:
s... | PypiClean |
/Nuitka_fixed-1.1.2-cp310-cp310-win_amd64.whl/nuitka/build/inline_copy/lib/scons-4.4.0/SCons/Tool/rmic.py |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import SCons.Action
import SCons.Builder
import SCons.Node.FS
import SCons.Util
from SCons.Tool.JavaCommon import get_java_install_dirs
def emit_rmic_classes(target, source, env):
"""Create and return lists of Java RMI stub and skele... | PypiClean |
/CsuPMTD-1.0.27.tar.gz/CsuPMTD-1.0.27/PMTD/maskrcnn_benchmark/structures/image_list.py | from __future__ import division
import torch
class ImageList(object):
"""
Structure that holds a list of images (of possibly
varying sizes) as a single tensor.
This works by padding the images to the same size,
and storing in a field the original sizes of each image
"""
def __init__(self... | PypiClean |
/Avatar_Utils-1.8.11-py3-none-any.whl/avatar_utils/sso_helper/sso_helper.py | from functools import lru_cache
from logging import getLogger
from typing import Optional
import jwt
from jwt.exceptions import PyJWTError, InvalidTokenError
from keycloak import KeycloakOpenID
from avatar_utils.sso_helper.constants import (
ITMO_SSO_SERVER,
ITMO_REALM,
USER_TOKEN_AUDIENCE,
PUBLIC_KEY... | PypiClean |
/Fortpy-1.7.7.tar.gz/Fortpy-1.7.7/fortpy/isense/cache.py | from fortpy.code import CodeParser
from . import builtin
import time
import re
import pyparsing
from . import rtupdate
#Time cache has expiration on the items inside that get used only
#temporarily during code completion
_time_caches = []
#This is our instance of the CodeParser. It handles the parsing
#of all the Fort... | PypiClean |
/citus-0.0.3-py3-none-any.whl/citus/sessions.py | import hashlib
import typing as t
import warnings
from collections.abc import MutableMapping
from datetime import datetime
from itsdangerous import BadSignature
from itsdangerous import URLSafeTimedSerializer
from werkzeug.datastructures import CallbackDict
from .helpers import is_ip
from .json.tag import TaggedJSONS... | PypiClean |
/DataVipLibraries-0.0.1-py3-none-any.whl/metrics/check_overfit.py | def find_overfit_cat(model_obj, xtrain, xtest, ytrain, ytest):
"""
Data Science Library
method name: find_overfit_cat
desc: This is to find an overfit of model. Means sometimes we have faced
the overfit and underfit and best fit model issue that shows this mobel
author name: Ti... | PypiClean |
/FastAPI_SQLModel-0.0.1-py3-none-any.whl/fastapi_sqlmodel/middleware.py | from contextvars import ContextVar
from typing import Dict, Optional, Union
from sqlalchemy.engine import Engine
from sqlalchemy.engine.url import URL
from sqlmodel import create_engine, Session
from sqlalchemy.orm import sessionmaker as sessionmaker_
from starlette.middleware.base import (
BaseHTTPMiddleware,
... | PypiClean |
/Django_patch-2.2.19-py3-none-any.whl/django/contrib/gis/db/backends/postgis/schema.py | from django.db.backends.postgresql.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_alter_column_to_3d = "ALTER COLUMN %(column)s TYPE %(type)s USING ST_... | PypiClean |
/GeneticEngine-0.7.3.tar.gz/GeneticEngine-0.7.3/geneticengine/grammars/coding/numbers.py | from __future__ import annotations
from dataclasses import dataclass
from typing import Annotated
from typing import Any
from typing import Callable
from geneticengine.exceptions import GeneticEngineError
from geneticengine.grammars.coding.classes import Expr
from geneticengine.grammars.coding.classes import Number
f... | PypiClean |
/MindsDB-23.8.3.0.tar.gz/MindsDB-23.8.3.0/mindsdb/integrations/handlers/sheets_handler/sheets_handler.py | from typing import Optional
from collections import OrderedDict
import pandas as pd
import duckdb
from mindsdb_sql import parse_sql
from mindsdb.integrations.libs.base import DatabaseHandler
from mindsdb_sql.parser.ast.base import ASTNode
from mindsdb.utilities.log import get_log
from mindsdb.integrations.libs.resp... | PypiClean |
/Adafruit_Libraries-0.1.tar.gz/Adafruit_Libraries-0.1/Adafruit/MCP230xx/Adafruit_MCP230xx.py |
# Copyright 2012 Daniel Berlin (with some changes by Adafruit Industries/Limor Fried)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal MCP230XX_GPIO(1, 0xin
# the Software without restriction, including wit... | PypiClean |
/DEME-0.2.8.tar.gz/DEME-0.2.8/thirdparty/pybind11/docs/advanced/misc.rst | Miscellaneous
#############
.. _macro_notes:
General notes regarding convenience macros
==========================================
pybind11 provides a few convenience macros such as
:func:`PYBIND11_DECLARE_HOLDER_TYPE` and ``PYBIND11_OVERRIDE_*``. Since these
are "just" macros that are evaluated in the preprocessor ... | PypiClean |
/ARGs_OAP-2.3.2.tar.gz/ARGs_OAP-2.3.2/ARGs_OAP/bin/bbmap/kmercountexact.sh |
usage(){
echo "
Written by Brian Bushnell
Last modified December 19, 2019
Description: Counts the number of unique kmers in a file.
Generates a kmer frequency histogram and genome size estimate (in peaks output),
and prints a file containing all kmers and their counts.
Supports K=1 to infinity, though not all values... | PypiClean |
/CityLearn-1.3.1-py3-none-any.whl/citylearn/reward_function.py | from typing import Any, List, Mapping
import numpy as np
class RewardFunction:
def __init__(self, agent_count: int, electricity_consumption: List[float] = None, carbon_emission: List[float] = None, electricity_price: List[float] = None, **kwargs):
r"""Initialize `Reward`.
Parameters
------... | PypiClean |
/Mopidy_MFE-0.4.9.tar.gz/Mopidy_MFE-0.4.9/README.rst | ****************
Mopidy-MFE
****************
Mopidy-MFE is a `Mopidy <http://www.mopidy.com/>`_ web extension.
Installation
============
Install by running::
pip install Mopidy-MFE
Upgrade by running::
pip install Mopidy-MFE --upgrade
Project resources
=================
- `Source code <https://github.c... | PypiClean |
/Brian2-2.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl/brian2/core/base.py | import functools
import os
import sys
import traceback
import weakref
from brian2.core.names import Nameable
from brian2.units.allunits import second
from brian2.units.fundamentalunits import check_units
from brian2.utils.logger import get_logger
__all__ = [
"BrianObject",
"BrianObjectException",
]
logger = ... | PypiClean |
/Avanza-0.0.13.tar.gz/Avanza-0.0.13/README.rst | Avanza
======
=========== ====
**tests** |lint|
|docs|
**package** |pypi_version|
|pypi_license|
|pypi_pversion|
=========== ====
Based on https://github.com/fhqvst/avanza
Python wrapper for Unofficial Avanza API
Code is work in progress and is only meant as “proof of concept”
... | PypiClean |
/3d-converter-0.9.0.tar.gz/3d-converter-0.9.0/models_converter/utilities/reader.py | import typing
class Reader:
def __init__(self, buffer: bytes, endian: typing.Literal['big', 'little'] = 'big'):
self.buffer = buffer
self.endian = endian
self.i = 0
def read(self, length: int = 1) -> bytes:
result = self.buffer[self.i:self.i + length]
self.i += length
... | PypiClean |
/AlgorithmLib-4.0.3.tar.gz/AlgorithmLib-4.0.3/algorithmLib/commFunction.py | import sys
sys.path.append('../')
import os,time
import socket
import paramiko
from stat import S_ISDIR as isdir
import copy
from ctypes import *
import wave
import numpy as np
import math
import librosa
import numpy as np
class emxArray_real_T(Structure):
_fields_ = [
("pdata", POINTER(c_double)), # c... | PypiClean |
/netket-3.9.2.tar.gz/netket-3.9.2/netket/operator/boson.py |
from scipy import sparse as _sparse
from netket.utils.types import DType as _DType
from netket.hilbert import AbstractHilbert as _AbstractHilbert
from ._local_operator import LocalOperator as _LocalOperator
def destroy(
hilbert: _AbstractHilbert, site: int, dtype: _DType = float
) -> _LocalOperator:
"""
... | PypiClean |
/AnimeCrawler-0.2.0b0.tar.gz/AnimeCrawler-0.2.0b0/README.md | # README.md
<p align="center">曾几何时,打算看会动漫</p>
<p align="center">兴致勃勃,发现需要会员</p>
<p align="center">不负众望,找到免费网站</p>
<p align="center">网络原因,把我拒之门外</p>
<p align="center">惆怅万分,决定用爬虫改变现状</p>
<p align="center">离线播放,享受流畅的观看体验</p>
这是一款在Windows平台下基于轻量级框架<code>[**Ruia**](https://github.com/howie6879/ruia)</code>、专门爬取免费动漫的爬... | PypiClean |
/GSAS-II-WONDER_linux-1.0.1.tar.gz/GSAS-II-WONDER_linux-1.0.1/GSAS-II-WONDER/SUBGROUPS.py | ########### SVN repository information ###################
# $Date: 2018-07-10 11:41:00 -0500 (Tue, 10 Jul 2018) $
# $Author: vondreele $
# $Revision: 3465 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/kSUBGROUPSMAG.py $
# $Id: kSUBGROUPSMAG.py 3465 2018-07-10 16:41:00Z vondreele $
########### SVN reposito... | PypiClean |
/Nuitka-1.8.tar.gz/Nuitka-1.8/nuitka/code_generation/c_types/CTypeBases.py | type_indicators = {
"PyObject *": "o",
"PyObject **": "O",
"struct Nuitka_CellObject *": "c",
"nuitka_bool": "b",
"nuitka_ilong": "L",
}
class CTypeBase(object):
# For overload.
c_type = None
@classmethod
def getTypeIndicator(cls):
return type_indicators[cls.c_type]
@... | PypiClean |
/FlaskCms-0.0.4.tar.gz/FlaskCms-0.0.4/flask_cms/static/js/ckeditor/plugins/codemirror/js/mode/gfm/gfm.js |
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../markdown/markd... | PypiClean |
/Help-Tool-ThanhNv-1.1.4.tar.gz/Help-Tool-ThanhNv-1.1.4/cli/base/providers/ipc.py |
import json
import socket
from web3.providers.ipc import IPCProvider
from web3._utils.threads import (
Timeout,
)
from web3 import Web3
try:
from json import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
# Mostly copied from web3.py/providers/ipc.py. Supports batch requests.
# Will b... | PypiClean |
/Finance-Hermes-0.3.6.tar.gz/Finance-Hermes-0.3.6/hermes/factors/technical/factor_volatility_stock.py | import numpy as np
import pandas as pd
from alphakit.const import *
from alphakit.factor import *
from alphakit.portfolio import *
from alphakit.data import *
from hermes.factors.base import FactorBase, LongCallMixin, ShortCallMixin
class FactorVolatilityStock(FactorBase, LongCallMixin, ShortCallMixin):
def __i... | PypiClean |
/observations-0.1.4.tar.gz/observations-0.1.4/observations/r/iraq_vote.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def iraq_vote(path):
"""U.S. Senate vote on the use of force against Iraq, 2002.
On October 11... | PypiClean |
/Better-Than-You-Found-It-0.9.1.tar.gz/Better-Than-You-Found-It-0.9.1/README.md | pep8radius
----------
[PEP8](http://legacy.python.org/dev/peps/pep-0008/) clean only the parts of
the files touched since the last commit, a previous commit or (the merge-base
of) a branch.
[](https://pypi.python.org/pypi/pep8radius)
[![MIT licensed]... | PypiClean |
/DevContest-0.4.tar.gz/DevContest-0.4/devcontest/public/jsmath/extensions/AMSmath.js |
jsMath.Extension.Require("moreArrows");
jsMath.Package(jsMath.Parser,{
macros: {
intI: ['Macro','\\mathchoice{\\!}{}{}{}\\!\\!\\int'],
iint: ['Macro','\\!\\!\\!\\mathop{\\,\\,\\,\\int\\intI}'],
iiint: ['Macro','\\!\\!\\!\\mathop{\\,\\,\\,\\int\\intI\\intI}'],
iiiint: ['Macro','\... | PypiClean |
/Auto-Research-1.0.tar.gz/Auto-Research-1.0/src/arxiv_public_data/regex_arxiv.py | import re
# These are all the primary categories present in the OAI ArXiv metadata
CATEGORIES = [
"acc-phys", "adap-org", "alg-geom", "ao-sci", "astro-ph", "atom-ph",
"bayes-an", "chao-dyn", "chem-ph", "cmp-lg", "comp-gas", "cond-mat", "cs",
"dg-ga", "funct-an", "gr-qc", "hep-ex", "hep-lat", "hep-ph", "hep... | PypiClean |
/BRAILS-3.0.1.tar.gz/BRAILS-3.0.1/brails/modules/NumFloorDetector/lib/utils/sync_batchnorm/batchnorm.py |
import collections
import contextlib
import torch
import torch.nn.functional as F
from torch.nn.modules.batchnorm import _BatchNorm
try:
from torch.nn.parallel._functions import ReduceAddCoalesced, Broadcast
except ImportError:
ReduceAddCoalesced = Broadcast = None
try:
from jactorch.parallel.comm impo... | PypiClean |
/MoReSQUE-1.0.tar.gz/MoReSQUE-1.0/moresque/uqm.py | import copy
import time
import re
import numpy as np
from scipy.interpolate import griddata
import moresque.ustructures as us
import moresque.propagation as pf
class UQMI():
"""Uncertainty Quantification Module that provides input to an ensemble.
"""
def __init__(self, eid, samp_design, strat_num):
... | PypiClean |
/CoreMS-1.6.0.tar.gz/CoreMS-1.6.0/corems/transient/factory/TransientClasses.py | from os.path import basename, dirname, normpath
from matplotlib import rcParamsDefault, rcParams
from numpy import linspace
from corems.encapsulation.factory.parameters import MSParameters
from corems.mass_spectrum.factory.MassSpectrumClasses import MassSpecfromFreq
from corems.transient.calc.TransientCalc import Tra... | PypiClean |
/DI_engine-0.4.9-py3-none-any.whl/dizoo/beergame/envs/utils.py | import argparse
import os
import numpy as np
def str2bool(v):
return v.lower() in ('true', '1')
arg_lists = []
parser = argparse.ArgumentParser()
def add_argument_group(name):
arg = parser.add_argument_group(name)
arg_lists.append(arg)
return arg
# crm
game_arg = add_argument_group('BeerGame')
g... | PypiClean |
/AnkiServer-2.0.6.tar.gz/AnkiServer-2.0.6/anki-bundled/aqt/deckconf.py | from operator import itemgetter
from anki.consts import NEW_CARDS_RANDOM
from aqt.qt import *
import aqt
from aqt.utils import showInfo, showWarning, openHelp, getOnlyText, askUser, \
tooltip, saveGeom, restoreGeom
class DeckConf(QDialog):
def __init__(self, mw, deck):
QDialog.__init__(self, mw)
... | PypiClean |
/MdNotes_CC-1.0-py3-none-any.whl/md_notes_cc/http/http_client.py | from md_notes_cc.http.http_method_enum import HttpMethodEnum
from md_notes_cc.http.http_request import HttpRequest
class HttpClient(object):
"""An interface for the methods that an HTTP Client must implement
This class should not be instantiated but should be used as a base class
for HTTP Client classes... | PypiClean |
/CTid-programmer-1.4.2.tar.gz/CTid-programmer-1.4.2/ctid_programmer/sn.py | import pickle
from abc import ABC, abstractmethod # ABC = abstract base class
class Error(Exception):
pass
class SpaceExhausted(Error):
pass
class Manager(ABC):
def __init__(self, ui, state_path):
"""Create a SN manager object. UI is the QT user-interface object
that can be used to ... | PypiClean |
/HavNegpy-1.2.tar.gz/HavNegpy-1.2/docs/_build/doctrees/nbsphinx/_build/doctrees/nbsphinx/_build/doctrees/nbsphinx/hn_module_tutorial.ipynb | # Tutorial for the HN module of HavNegpy package
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
import HavNegpy as dd
%matplotlib qt
os.chdir(r'M:\Marshall_Data\mohamed_data\mohamed_data\n44')
def create_dataframe(f):
col_names = ['Freq', 'T', 'Eps1', 'Eps2']
#f ... | PypiClean |
/Electrum-VTC-2.9.3.3.tar.gz/Electrum-VTC-2.9.3.3/packages/dns/rdata.py | from io import BytesIO
import base64
import binascii
import dns.exception
import dns.name
import dns.rdataclass
import dns.rdatatype
import dns.tokenizer
import dns.wiredata
from ._compat import xrange, string_types, text_type
_hex_chunksize = 32
def _hexify(data, chunksize=_hex_chunksize):
"""Convert a binary ... | PypiClean |
/MSOIKK-1.0-py3-none-any.whl/flood_tool/geo.py | from numpy import array, asarray, mod, sin, cos, tan, sqrt, arctan2, floor, rad2deg, deg2rad, stack, pi
from scipy.linalg import inv
import numpy as np
__all__ = ['get_easting_northing_from_gps_lat_long',
'get_gps_lat_long_from_easting_northing']
class Ellipsoid(object):
""" Data structure for a globa... | PypiClean |
/Ax_Handoff-3.1.0.tar.gz/Ax_Handoff-3.1.0/axonchisel/handoff/protocol/__init__.py |
import math
import hashlib
import hmac
import axonchisel.handoff.config as config
import axonchisel.handoff.util as util
import axonchisel.handoff.error as error
# ----------------------------------------------------------------------------
def get_variant(encstr):
"""Given encoded object (string), return th... | PypiClean |
/MLcps-0.0.5.tar.gz/MLcps-0.0.5/README.md | # MLcps
**MLcps: Machine Learning cumulative performance score** is a performance metric that combines multiple performance metrics and reports a cumulative score enabling researchers to compare the ML models using a single metric. MLcps provides a comprehensive platform to identify the best-performing ML model on any ... | PypiClean |
/ClusterAPIServer-0.3.tar.gz/ClusterAPIServer-0.3/app/common/helper.py | import subprocess
import json
import xmltodict
from functools import wraps
from flask import make_response, jsonify
from app import app
def xml_to_json(xml_data):
return json.dumps(xmltodict.parse(xml_data))
def to_ascii(s):
'''
Convert the bytes string to a ASCII string
Usefull to remove accent (di... | PypiClean |
/NlpToolkit-FrameNet-Cy-1.0.8.tar.gz/NlpToolkit-FrameNet-Cy-1.0.8/README.md | Turkish FrameNet
============
## FrameNet
Introduced in 1997, FrameNet (Lowe, 1997; Baker et al., 1998; Fillmore and Atkins, 1998; Johnson et al., 2001) has been developed by the International Computer Science Institute in Berkeley, California. It is a growing computational lexicography project that offers in-depth s... | PypiClean |
/Django-4.2.4.tar.gz/Django-4.2.4/django/db/models/fields/related.py | import functools
import inspect
from functools import partial
from django import forms
from django.apps import apps
from django.conf import SettingsReference, settings
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models import Q... | PypiClean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.