code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
from py2js import transpile
class js_renderer(object):
"""
Decorator that you can use to convert methods to JavaScript.
For example this code::
@JavaScript
class TestClass(object):
def __init__(self):
alert('TestClass created')
self.reset()
... | /ryzom-0.7.11.tar.gz/ryzom-0.7.11/src/py2js/renderer.py | 0.745213 | 0.402744 | renderer.py | pypi |
import torch
import torch.nn as nn
from .base_color import *
class SIGGRAPHGenerator(BaseColor):
def __init__(self, norm_layer=nn.BatchNorm2d, classes=529):
super(SIGGRAPHGenerator, self).__init__()
# Conv1
model1=[nn.Conv2d(4, 64, kernel_size=3, stride=1, padding=1, bias=True),]
... | /rz_colorization-1.0.5-py3-none-any.whl/colorizers/siggraph17.py | 0.933628 | 0.523055 | siggraph17.py | pypi |
import torch
import torch.nn as nn
import numpy as np
from IPython import embed
from .base_color import *
class ECCVGenerator(BaseColor):
def __init__(self, norm_layer=nn.BatchNorm2d):
super(ECCVGenerator, self).__init__()
model1=[nn.Conv2d(1, 64, kernel_size=3, stride=1, padding=1, bias=True),]
... | /rz_colorization-1.0.5-py3-none-any.whl/colorizers/eccv16.py | 0.910196 | 0.520862 | eccv16.py | pypi |
PPQN = 24
# Amount of velocity bins to use. Note that any velocity smaller than the bound of the smallest bin will be mapped to
# the velocity of the smallest bin
VELOCITY_BINS = 8
# The maximum velocity value
MAX_VELOCITY = 127
NOTE_LOWER_BOUND = 21
NOTE_UPPER_BOUND = 108
# Maximum power of 2 defining upper length of... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/settings.py | 0.795499 | 0.629746 | settings.py | pypi |
from __future__ import annotations
from pandas import DataFrame
from s_coda.elements.message import MessageType, Message
from s_coda.exception.exceptions import BarException
from s_coda.sequence.sequence import Sequence
from s_coda.settings import PPQN
from s_coda.util.logging import get_logger
from s_coda.util.music... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/elements/bar.py | 0.897841 | 0.278364 | bar.py | pypi |
from __future__ import annotations
from s_coda.elements.track import Track
from s_coda.sequence.sequence import Sequence
class Composition:
""" Class representing a composition that contains (multiple) tracks.
"""
def __init__(self, tracks: [Track]) -> None:
super().__init__()
self.trac... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/elements/composition.py | 0.936182 | 0.399987 | composition.py | pypi |
from __future__ import annotations
import copy
import math
import re
import time
from statistics import mean
from typing import TYPE_CHECKING
from s_coda.elements.message import Message, MessageType
from s_coda.exception.exceptions import SequenceException
from s_coda.sequence.abstract_sequence import AbstractSequenc... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/sequence/relative_sequence.py | 0.832237 | 0.240752 | relative_sequence.py | pypi |
from __future__ import annotations
import copy
import enum
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt, pyplot
from matplotlib.patches import Rectangle
from pandas import DataFrame
import s_coda
from s_coda.elements.message import MessageType, Message
from s_coda.sequence.absolute_seq... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/sequence/sequence.py | 0.917893 | 0.389053 | sequence.py | pypi |
from __future__ import annotations
import copy
from statistics import geometric_mean
from typing import TYPE_CHECKING
from s_coda.elements.message import Message, MessageType
from s_coda.exception.exceptions import SequenceException
from s_coda.sequence.abstract_sequence import AbstractSequence
from s_coda.settings i... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/sequence/absolute_sequence.py | 0.940271 | 0.355439 | absolute_sequence.py | pypi |
import math
from pathlib import Path
import numpy as np
from s_coda.settings import MAX_VELOCITY, VELOCITY_BINS, PPQN
def bin_from_velocity(velocity: int) -> int:
""" Returns the bin defined by the velocity.
Args:
velocity: The velocity to sort into a bin
Returns: The corresponding bin
""... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/util/util.py | 0.923863 | 0.693181 | util.py | pypi |
import enum
class Key(enum.Enum):
c = "C"
g = "G"
d = "D"
a = "A"
e = "E"
b = "B"
f_s = "F#"
c_s = "C#"
f = "F"
b_b = "Bb"
e_b = "Eb"
a_b = "Ab"
d_b = "Db"
g_b = "Gb"
c_b = "Cb"
KeyKeyMapping = {"C": Key.c, "G": Key.g, "D": Key.d, "A": Key.a, "E": Key.e, "... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/util/music_theory.py | 0.438785 | 0.386242 | music_theory.py | pypi |
from __future__ import annotations
import copy
import mido
import s_coda
from s_coda.elements.message import MessageType, Message
from s_coda.settings import PPQN
from s_coda.util.logging import get_logger
from s_coda.util.music_theory import Key, KeyKeyMapping
class MidiFile:
def __init__(self) -> None:
... | /s-coda-1.0.tar.gz/s-coda-1.0/s_coda/util/midi_wrapper.py | 0.816918 | 0.255199 | midi_wrapper.py | pypi |
[](https://opensource.org/licenses/Apache-2.0)
This file is also available as `README.nb` *Mathematica* notebook that replicates all derivations and plots.
# `s-curve-beta`: Efficient Python implementation of the smoothest S-curve robot motion planne... | /s-curve-beta-0.1.2.tar.gz/s-curve-beta-0.1.2/README.md | 0.811564 | 0.972441 | README.md | pypi |
"""Created by lashkov on 31.10.18"""
import math
import numpy as np
from scipy.spatial.distance import cdist
def calc_nearest_points(X, labels, unique_labels, centroids, metric):
"""
Calculation of coordinates of clusters points closest to their geometric centers
Parameters
----------
X : array... | /s_dbw-0.4.0.tar.gz/s_dbw-0.4.0/s_dbw/s_dbw.py | 0.900698 | 0.877582 | s_dbw.py | pypi |
import attr
from .lexer import lex, PARENS
@attr.s
class ParserConfig:
"""
Represents a parser configuration
Arguments:
prefix_symbols: Dictionary mapping individual characters to the special form
they represent: e.g., {"'" : "quote", "`" : "quasiquote"}
dots_are_cons: whethe... | /s-exp-parser-1.3.1.tar.gz/s-exp-parser-1.3.1/s_expression_parser/parser.py | 0.848502 | 0.293949 | parser.py | pypi |
PARENS = {"(": ")", "[": "]"}
def lex(data, special_symbols):
"""
Lexes the given string, as 61a-scheme compatible scheme code. This handles
numbers, parentheses, and the given special symbols.
Arguments
data: the data to parse
special_symbols: the set of symbols to handle
"""... | /s-exp-parser-1.3.1.tar.gz/s-exp-parser-1.3.1/s_expression_parser/lexer.py | 0.815122 | 0.398406 | lexer.py | pypi |
from s_interpreter.compiler import Program as _Program
from typing import (
Sequence as _Sequence,
Optional as _Optional
)
class InterpreterError(RuntimeError):
pass
class Interpreter:
from typing import Optional as _Optional
def __init__(self,
program: _Program):
from ... | /s_interpreter-1.0.0-py3-none-any.whl/s_interpreter/interpreter.py | 0.790813 | 0.235944 | interpreter.py | pypi |
from dataclasses import dataclass as _dataclass
import enum as _enum
from typing import (
ClassVar as _ClassVar,
Sequence as _Sequence,
Optional as _Optional
)
import re as _re
class CompilationError(RuntimeError):
pass
class EncodedPair:
def __init__(self,
first: int,
... | /s_interpreter-1.0.0-py3-none-any.whl/s_interpreter/compiler.py | 0.859531 | 0.238739 | compiler.py | pypi |
import os
import logging
from rich.console import Console
import questionary
log = logging.getLogger(__name__)
def file_exists(file_to_check):
"""
Input:
file_to_check # file name to check if exists
Return:
True if exists
"""
if os.path.isfile(file_to_check):
return Tru... | /s-rna_tools-0.0.3.tar.gz/s-rna_tools-0.0.3/s_rna_tools/utils.py | 0.424173 | 0.188063 | utils.py | pypi |
import urwid
DEFAULT_PALETTE = [
('body', 'default', 'default', 'standout'),
('header', 'default', 'dark red',),
('screen edge', 'light blue', 'brown'),
('main shadow', 'dark gray', 'black'),
('line', ... | /s-tui-1.1.4.tar.gz/s-tui-1.1.4/s_tui/sturwid/ui_elements.py | 0.516108 | 0.218065 | ui_elements.py | pypi |
""" This module implements a parent source class for s-tui"""
from collections import OrderedDict
import logging
class Source:
""" This is a basic source class for s-tui"""
def __init__(self):
self.edge_hooks = []
self.measurement_unit = ''
self.last_measurement = []
self.is_a... | /s-tui-1.1.4.tar.gz/s-tui-1.1.4/s_tui/sources/source.py | 0.886322 | 0.310093 | source.py | pypi |
__docformat__ = "reStructuredText"
import zope.schema
import m01.mongo.interfaces
import m01.mongo.schema
import m01.remote.interfaces
class IScrapyPackage(m01.mongo.interfaces.IMongoStorageItem):
"""ScrapySpider"""
serverName = zope.schema.TextLine(
title=u'Server Name',
description=u'Serve... | /s01.core-0.5.0.zip/s01.core-0.5.0/src/s01/core/interfaces.py | 0.604049 | 0.207315 | interfaces.py | pypi |
__docformat__ = 'restructuredtext'
import zope.interface
import m01.remote.job
from m01.mongo.fieldproperty import MongoFieldProperty
from s01.core import interfaces
class JobBase(m01.remote.job.Job):
"""Job with dict as input data"""
def applyInputData(self, data, input=None):
# update existing d... | /s01.core-0.5.0.zip/s01.core-0.5.0/src/s01/core/job.py | 0.564699 | 0.167661 | job.py | pypi |
__docformat__ = "reStructuredText"
import re
import time
import datetime
_marker = object()
# datetime
DATE_STRINGS = [
# day month year
'%d.%m.%Y',
'%d-%m-%Y',
# year month day
'%Y.%m.%d',
'%Y-%m-%d',
]
TIME_STRINGS = [
'',
'%H',
'%H:%M',
'%H:%M:%S',
]
TIMEZONE_STRIN... | /s01.scrapy-0.16.2.zip/s01.scrapy-0.16.2/src/s01/scrapy/converter.py | 0.528777 | 0.184363 | converter.py | pypi |
__docformat__ = "reStructuredText"
import zope.schema
import scrapy.exceptions
_marker = object()
def listConverter(value):
"""Convert a list to a single item"""
if isinstance(value, (list, tuple)):
value = ' '.join(value)
return value
class ScrapyFieldProperty(object):
"""Computed attrib... | /s01.scrapy-0.16.2.zip/s01.scrapy-0.16.2/src/s01/scrapy/fieldproperty.py | 0.683842 | 0.192634 | fieldproperty.py | pypi |
__docformat__ = "reStructuredText"
import os.path
import zope.interface
import zope.component.interfaces
import zope.location.interfaces
import z3c.jsonrpc.interfaces
import m01.mongo.interfaces
import m01.remote.interfaces
def isDirectory(path):
return os.path.isdir(path)
def isPath(path):
return os.path.is... | /s01.worker-0.5.0.zip/s01.worker-0.5.0/src/s01/worker/interfaces.py | 0.71889 | 0.246891 | interfaces.py | pypi |
import warnings
import asf_search as asf
import geopandas as gpd
from .formatter import format_results_for_sent1
def extract_secondary_date(gunw_scene_name: str) -> str:
"""Get Secondary Date from GUNW id"""
date_pair_str = gunw_scene_name.split('-')[6]
temp = date_pair_str.split('_')[1]
secondary_d... | /s1-enumerator-0.1.0.tar.gz/s1-enumerator-0.1.0/s1_enumerator/cmr.py | 0.51879 | 0.307254 | cmr.py | pypi |
import logging
import warnings
from datetime import datetime, timedelta
from typing import List
import geopandas as gpd
import pandas as pd
from rasterio.crs import CRS
from shapely.geometry import Polygon
from .gis import filter_by_intersection_km2, filter_by_intersection_percent, get_intersection_area_km2
from .sta... | /s1-enumerator-0.1.0.tar.gz/s1-enumerator-0.1.0/s1_enumerator/enum.py | 0.729905 | 0.325253 | enum.py | pypi |
import warnings
from concurrent import futures
from datetime import datetime, timedelta
from typing import List, Union
import asf_search as asf
import geopandas as gpd
import pandas as pd
from rasterio.crs import CRS
from shapely.geometry import Polygon
from tqdm import tqdm
from .constants import S1_EARLIEST_LOOKUP_... | /s1-enumerator-0.1.0.tar.gz/s1-enumerator-0.1.0/s1_enumerator/stack.py | 0.693161 | 0.215557 | stack.py | pypi |
import geopandas as gpd
import numpy as np
from rasterio.crs import CRS
from shapely.geometry import Polygon
def convert_4326_to_utm(lon: float, lat: float) -> int:
"""
From: https://gis.stackexchange.com/a/269552
"""
utm_band = str(int((np.floor((lon + 180) / 6) % 60) + 1))
if len(utm_band) == 1:... | /s1-enumerator-0.1.0.tar.gz/s1-enumerator-0.1.0/s1_enumerator/gis.py | 0.755366 | 0.661732 | gis.py | pypi |
Using The Example API
=====================
To use the artificial sample api in :any:`example_api` we can follow the steps below.
The code below is also in the "s100py/tests" folder in the "sample_api_test.py" file which should be runnable
assuming you have a compliant, working python environment.
Open a new file in ... | /s100py-1.0.0rc1.tar.gz/s100py-1.0.0rc1/docs/using_example_api.rst | 0.710929 | 0.704338 | using_example_api.rst | pypi |
An Example API
===============
.. _@property: https://docs.python.org/3/library/functions.html#property>
.. _Pycharm Live Template: https://www.jetbrains.com/help/pycharm/tutorial-creating-and-applying-live-templates-code-snippets.html
Let's create a new sample api to show the basic pieces of the s100py framework. ... | /s100py-1.0.0rc1.tar.gz/s100py-1.0.0rc1/docs/example_api.rst | 0.924862 | 0.688628 | example_api.rst | pypi |
Advanced Example API Usage
==========================
Using the data and api shown in :any:`example_api` and :any:`using_example_api` we can look at some advanced usage.
The sample code below is also in the s100py/tests/sample_api_test.py where it should run with pytest.
The S100+ files are built on HDF5 and use h5py... | /s100py-1.0.0rc1.tar.gz/s100py-1.0.0rc1/docs/advanced_example_api_usage.rst | 0.669205 | 0.719855 | advanced_example_api_usage.rst | pypi |
"Accuracy assessment and plotting for classifier"
import itertools
import logging
import time
from pathlib import Path
from typing import List, Optional
import fiona
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import rasterio
from rasterio import mask
from shapely.geometry ... | /s11-classifier-3.5.2.tar.gz/s11-classifier-3.5.2/classifier/accuracy.py | 0.934597 | 0.525369 | accuracy.py | pypi |
"The command line interface and entry point for classifier"
import logging
import pathlib
import sys
from typing import Union, Optional
import click
from classifier.accuracy import assess_accuracy
from classifier.classify import classify_, classify_timeseries
from classifier.settings import WORKSPACE
from classifier.... | /s11-classifier-3.5.2.tar.gz/s11-classifier-3.5.2/classifier/cli.py | 0.625095 | 0.158923 | cli.py | pypi |
import logging
from pathlib import Path
from typing import Any
import geopandas as gpd
import numpy as np
import fiona
import rasterio
from geopandas import GeoDataFrame
from rasterio import Affine
from rasterio.features import shapes
from rasterio.windows import Window
from shapely.geometry import MultiPolygon, Polyg... | /s11-classifier-3.5.2.tar.gz/s11-classifier-3.5.2/classifier/utils/vector.py | 0.908084 | 0.660816 | vector.py | pypi |
# pylint: disable=cyclic-import
import itertools
import logging
import os
import re
import subprocess
import sys
from pathlib import Path
from typing import Any, List, Tuple
import numpy as np
import rasterio
from rasterio.windows import Window
from classifier.utils.config import Configuration
UTILS_RASTER_LOGGER = ... | /s11-classifier-3.5.2.tar.gz/s11-classifier-3.5.2/classifier/utils/raster.py | 0.657318 | 0.207235 | raster.py | pypi |
class frequenciesOfItems:
"""
A class used to count the frequency of each sensor point from the provided relational database.
Attributes
----------
filename
the name of the relational database file
separator
the separator used in the relational database file
Methods
---... | /s1282003_learn-2023.8.5.3.tar.gz/s1282003_learn-2023.8.5.3/s1282003_learn/statistics/frequenciesOfItems.py | 0.902212 | 0.734489 | frequenciesOfItems.py | pypi |
import plotly.express as px
import sys
sys.path.append('s1282003_learn/s1282003_learn/visualization/heatMapItemsFrequencies.py')
from frequenciesOfItems import frequenciesOfItems
class HeatMapItemsFrequencies:
"""
A class to create a heatmap of item frequencies at specific geographical coordinates.
Attrib... | /s1282003_learn-2023.8.5.3.tar.gz/s1282003_learn-2023.8.5.3/s1282003_learn/visualization/heatMapItemsFrequencies.py | 0.847242 | 0.670042 | heatMapItemsFrequencies.py | pypi |
import plotly.express as px
import pandas as pd
import sys
sys.path.append('/Users/apple/Desktop/s1282006_learn/s1282006_learn/statistics')
from frequenciesOfItems import frequenciesOfItems
class heatMapItemsFrequencies:
def __init__(self, freq_dict):
self.freq_dict = freq_dict
def prepare_dataframe(sel... | /s1282006_learn-2023.7.31.tar.gz/s1282006_learn-2023.7.31/s1282006_learn/visualization/heatMapItemsFrequencies.py | 0.418935 | 0.25904 | heatMapItemsFrequencies.py | pypi |
class FrequenciesOfItems:
"""
A class to calculate item frequencies from a transactional database.
...
Attributes
----------
database : str
The filename of the transactional database.
separator : str, optional
The separator used in the transactional database file. Default i... | /s1290018_learn-1.0.1.tar.gz/s1290018_learn-1.0.1/s1290018_learn/statistics/frequenciesOfItems.py | 0.946088 | 0.538498 | frequenciesOfItems.py | pypi |
import pandas as pd
import plotly.express as px
class HeatMapItemsFrequencies:
"""
A class to calculate item frequencies from a transactional database and plot a heatmap
of the item frequencies on an OpenStreetMap using Plotly Express.
...
Attributes
----------
database : str
... | /s1290018_learn-1.0.1.tar.gz/s1290018_learn-1.0.1/s1290018_learn/visualization/heatMapItemsFrequencies.py | 0.946782 | 0.675923 | heatMapItemsFrequencies.py | pypi |
import pandas as pd
import plotly.express as px
import re
class heatMapItemsFrequencies:
"""
A class to ccept the itemsFrequenciesDictionary
and plot them on a map (plotly express open-street map)
Attributes
----------
itemsFrequenciesDictionary : str
A dictionary contains the poin... | /s129024_learn-0.1.1.tar.gz/s129024_learn-0.1.1/s1290224_learn/visualization/heatMapItemsFrequencies.py | 0.827515 | 0.599573 | heatMapItemsFrequencies.py | pypi |
from zope.interface import implements
from plone.portlets.interfaces import IPortletDataProvider
from plone.app.portlets.portlets import base
from zope import schema
from zope.formlib import form
from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
from zope.schema.interfaces import IContextSourceBinder
... | /s17.portlets-1.0b2.zip/s17.portlets-1.0b2/src/s17/portlets/whitepagesportlet.py | 0.486819 | 0.346928 | whitepagesportlet.py | pypi |
from plone import api
from plone.app.portlets.portlets import base
from plone.memoize import instance
from plone.memoize.compress import xhtml_compress
from plone.portlets.interfaces import IPortletDataProvider
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from s17.portlets import PersonPortle... | /s17.portlets-1.0b2.zip/s17.portlets-1.0b2/src/s17/portlets/personprofile.py | 0.746878 | 0.221203 | personprofile.py | pypi |
from plone import api
from s17.portlets.config import HAS_PERSON
# BBB: OrderedDict drop-in substitute that works in Python 2.6
try:
import collections
OrderedDict = collections.OrderedDict
except AttributeError:
import ordereddict
OrderedDict = ordereddict.OrderedDict
def get_portrait_url(user):
... | /s17.portlets-1.0b2.zip/s17.portlets-1.0b2/src/s17/portlets/utils.py | 0.754553 | 0.365712 | utils.py | pypi |
from dataclasses import dataclass
import zstandard
ID_POSITION = 0x0000008
NAMES_POSITION = 0x07A1208
META_POSITION = 0x2719C48
RUNDATA_POSITION = 0x29020C8
SCORES_POSITION = 0x30A32C8
BLOCK6_POSITION = 0x38444C8
BLOCK7_POSITION = 0x3C14DC8
NAME_LENGTH = 33
@dataclass
class Run:
id: int = None
name: str = ... | /s2-data-0.27.tar.gz/s2-data-0.27/src/s2_data/leaderboards.py | 0.459804 | 0.310172 | leaderboards.py | pypi |
import typing
from abc import ABC, abstractmethod
class Type(ABC):
@property
@abstractmethod
def size(self) -> int:
raise NotImplementedError()
@abstractmethod
def from_binary(self, binary: bytes) -> typing.Any:
raise NotImplementedError()
@abstractmethod
def to_binary(se... | /s2-data-0.27.tar.gz/s2-data-0.27/src/s2_data/saves/field_types.py | 0.835819 | 0.627552 | field_types.py | pypi |
import typing
from dataclasses import dataclass
from enum import IntEnum, IntFlag
from .field_types import (BoolType, ByteType, EnumType, FlagType, Int32Type,
Int64Type, Type, UInt8Type, UInt32Type)
class CharacterUnlockFlags(IntFlag):
Ana = 1 << 0
Margaret = 1 << 1
Col... | /s2-data-0.27.tar.gz/s2-data-0.27/src/s2_data/saves/field_descriptors.py | 0.427875 | 0.257634 | field_descriptors.py | pypi |
# Credits
The following people helped out tremendously in the Spelunky Community Discord:
https://mossranking.com/discord
* dextercd#7326
- Journal Entry Unlocks - https://pastebin.com/jEAGuxGD
- Constellations - https://pastebin.com/0pZZPt9F
* EngIo#7610
* iojonmbnmb#8149
* gary#9999
# TODO
- [ ] Con... | /s2-data-0.27.tar.gz/s2-data-0.27/docs/save-format.md | 0.66769 | 0.809389 | save-format.md | pypi |
import argparse
from collections import defaultdict
import pywraps2 as s2
def main():
parser = argparse.ArgumentParser(
description=(
"This example shows how to convert spatial data into index terms, "
"which can then be indexed along with the other document "
"informa... | /s2-py-0.10.0.tar.gz/s2-py-0.10.0/s2geometry/doc/examples/term_index.py | 0.642545 | 0.441131 | term_index.py | pypi |
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, Dict, Tuple, Union
from s2_wrapper.api import exceptions
if TYPE_CHECKING:
from httpx import Client
from s2_wrapper.api.base import BaseEndpoints
def _build_endpoint(api_path: str, endpoint: str) -> str:
return f"{api_path}{en... | /s2_wrapper-0.1.0-py3-none-any.whl/s2_wrapper/api/utils.py | 0.909604 | 0.356363 | utils.py | pypi |
from typing import Any, Dict, Generic, List, TypeVar, Union
from pydantic import BaseModel, Field
from pydantic.generics import GenericModel
class Author(BaseModel):
"""A class containing the information of a Semantic Scholar author."""
author_id: Union[str, None] = Field(alias="authorId")
external_ids:... | /s2_wrapper-0.1.0-py3-none-any.whl/s2_wrapper/api/academic_graph/v1/entities.py | 0.935214 | 0.40928 | entities.py | pypi |
from typing import Any, Dict, List, Union
from functools import partial
from s2_wrapper.api.base import BaseEndpoints
from s2_wrapper.api.utils import endpoint
from s2_wrapper.api.academic_graph.v1 import entities
SEARCH_PAPER_FIELDS = [
"paperId",
"externalIds",
"url",
"title",
"abstract",
"v... | /s2_wrapper-0.1.0-py3-none-any.whl/s2_wrapper/api/academic_graph/v1/endpoints.py | 0.951729 | 0.356251 | endpoints.py | pypi |
import os
from .static import ARR
class ExtAPI:
@property
def rl(self):
return self.map_data.rl
@property
def cl(self):
return self.map_data.cl
def get_arr_by_rd(self,arr:ARR,r:int,d:int):
return self.map_data.get_arr_by_rd(arr,r,d)
def get_chess_by_arr(self,arr:ARR)... | /s27a_jbq-1.1.0.tar.gz/s27a_jbq-1.1.0/src/s27a_jbq/game/extension.py | 0.423458 | 0.16502 | extension.py | pypi |
# S2AFF - Semantic Scholar Affiliations Linker
This repository contains code that links raw affiliation strings to ROR ids.
This is a 3-stage model:
1. Raw affiliation strings are run through a NER transformer that parses them into main institute, child institute, and address components.
2. A retrieval index fetches t... | /s2aff-0.61.tar.gz/s2aff-0.61/README.md | 0.842442 | 0.964656 | README.md | pypi |
.. image:: https://docs.s2cell.aliddell.com/_static/logo.min.svg
:width: 200
:height: 200
:alt: s2cell logo
s2cell
======
Minimal Python `S2 Geometry <https://s2geometry.io/>`__
`cell ID <https://s2geometry.io/devguide/s2cell_hierarchy.html>`__, token and lat/lon conversion
library.
`Docs <https://docs.s2ce... | /s2cell-1.6.0.tar.gz/s2cell-1.6.0/README.rst | 0.93992 | 0.836087 | README.rst | pypi |
## creative commons
# Attribution-ShareAlike 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its lic... | /s2cloudless-1.7.1-py3-none-any.whl/s2cloudless-1.7.1.dist-info/licenses/LICENSE.md | 0.739328 | 0.665132 | LICENSE.md | pypi |
# s2froms3
Get Sentinel-2 Cloud Optimized Geotiffs (COG) files from AWS S3.
## Installation
`pip install s2froms3`
## Dependencies
`mgrs`, `s3fs`
## Tutorial
The library is small and limited. It could be used to download Cloud Optimized
Geotiff files from AWS S3.
First of all we should import the library:
`impo... | /s2froms3-0.2.0.tar.gz/s2froms3-0.2.0/README.md | 0.48438 | 0.888904 | README.md | pypi |
# S2P - Satellite Stereo Pipeline
[](https://travis-ci.com/cmla/s2p)
[](https://pypi.org/project/s2p)
S2P is a Python library and command line tool that implements a stereo
pipeline which produces elevat... | /s2p-1.0b25.tar.gz/s2p-1.0b25/README.md | 0.891445 | 0.750118 | README.md | pypi |
### Details Flag
**m_timeLocalOffset**
> returns the offset for the timezone the replay was played in (users local timezone)
> ```m_timeUTC / (10 * 1000 * 1000) - 11644473600 - ((m_timeLocalOffset / 10000000)) ```
**m_title**
> Map name in users localization
**m_cacheHandles**
> describe the packages/components ... | /s2protocol-5.0.11.90870.0.tar.gz/s2protocol-5.0.11.90870.0/docs/flags/details.md | 0.569374 | 0.845209 | details.md | pypi |
# Spatial Shift ViT
S²-ViT is a hierarchical vision transformer with shifted window attention.
In contrast to Swin, the shift operation used is based on S²-MLP, which shifts in all four directions simultaneously, and does not use the roll or unroll operation.
Additionally, it leverages the patch embedding and position... | /s2vit-0.5.1.tar.gz/s2vit-0.5.1/README.md | 0.654784 | 0.978198 | README.md | pypi |
from typing import Dict, List, Tuple
import random
import os
import io
from s3aads.resources import s3_resource, s3_client
from s3aads import Copy
from collections import namedtuple
class Table(object):
def __init__(self, name, database, columns=[]):
self.name = name
if isinstance(database, str):
from... | /s3-as-a-datastore-2.13.6.tar.gz/s3-as-a-datastore-2.13.6/s3aads/table.py | 0.691497 | 0.19235 | table.py | pypi |
from typing import Dict, List, Tuple
import random
import os
import io
from s3aads.resources import s3_resource, s3_client
class Table(object):
def __init__(self, name, database, columns=[]):
self.name = name
if isinstance(database, str):
from s3aads import Database
self.database = Database(data... | /s3-as-a-service-2.7.0.tar.gz/s3-as-a-service-2.7.0/s3aads/table.py | 0.707708 | 0.176849 | table.py | pypi |
import os
def _annotate_bookmark(label, bookmark=None):
"""
Annotate a bookmark indicator onto the type indicator of a bucket or prefix
"""
if not bookmark:
return label
return '\x1b[33m${}\x1b[0m {}'.format(bookmark, label)
class S3Path(object):
"""
Represents a combination of ... | /s3_browser-0.3.6.tar.gz/s3_browser-0.3.6/s3_browser/paths.py | 0.854597 | 0.28743 | paths.py | pypi |
def tokenise(s):
"""Breaks a string down into variable tokens"""
acc = []
curr = ''
is_var = False
is_braced = False
is_escaped = False
for c in s:
if not is_var:
if c == '\\' and not is_escaped:
is_escaped = True
continue
if ... | /s3_browser-0.3.6.tar.gz/s3_browser-0.3.6/s3_browser/tokeniser.py | 0.493409 | 0.334019 | tokeniser.py | pypi |
import shutil
# TODO: This could probably be a couple of hundred content types
_SAFE_CONTENT_TYPE_PREFIXES = [
'application/json',
'application/xml',
'application/yaml',
'text/'
]
def _is_safe_content_type(ct):
"""Compare content type to the list of (likely) safe prefixes"""
if not ct:
... | /s3_browser-0.3.6.tar.gz/s3_browser-0.3.6/s3_browser/utils.py | 0.427516 | 0.464112 | utils.py | pypi |
import datetime
import json
import logging
import os
import re
logger = logging.getLogger(__name__)
class BookmarkManager(object):
KEY_REGEX = re.compile('^[a-zA-Z0-9_][a-zA-Z0-9_-]{0,15}$')
def __init__(self, bookmark_file):
self.bookmark_file = bookmark_file
self._bookmarks = None
@pr... | /s3_browser-0.3.6.tar.gz/s3_browser-0.3.6/s3_browser/bookmarks.py | 0.58948 | 0.216715 | bookmarks.py | pypi |
import logging
import os
from s3_client_lib.s3_client import S3Client
from s3_client_lib.utils import *
import multiprocessing as mp
logger = logging.getLogger(__name__)
class S3MultipartClient(S3Client):
def __init__(
self,
address,
access_key,
secret_access_key,
tenant=N... | /s3_client_lib-0.2.2.tar.gz/s3_client_lib-0.2.2/s3_client_lib/s3_multipart_client.py | 0.566738 | 0.159479 | s3_multipart_client.py | pypi |
# s3-client - Example python script to work with S3


[](https://codecov.io/gh/thobiast/s3... | /s3_client-0.1.2.tar.gz/s3_client-0.1.2/README.md | 0.500488 | 0.810479 | README.md | pypi |
import concurrent.futures
import logging
import re
logger = logging.getLogger(__name__)
# S3 multi-part upload parts must be larger than 5mb
KB = 1024
MB = KB**2
GB = KB**3
TB = KB**4
MIN_S3_SIZE = 5 * MB
def _thread_run(item, callback):
for _ in range(3):
# re try 3 times before giving up
try:
... | /s3-concat-0.2.4.tar.gz/s3-concat-0.2.4/s3_concat/utils.py | 0.575707 | 0.172207 | utils.py | pypi |
# Import packages
import pandas as pd
import pickle as pkl
import json
import s3fs
from tensorflow.keras.models import load_model
import os
class S3Connection():
"""The class that brings together all the s3 connection functions."""
def __init__(self, aws_access_key=None, aws_secret_key=None):
... | /s3_connection-0.1.2-py3-none-any.whl/s3_connection/s3_conn_class.py | 0.785925 | 0.269963 | s3_conn_class.py | pypi |
from concurrent.futures import ThreadPoolExecutor
from hashlib import md5
import logging
from os import listdir, stat
from shutil import rmtree
from subprocess import Popen, PIPE
from tempfile import mkdtemp
from time import sleep
from s3_consistency_checker import shm
LOGGER = logging.getLogger(__name__)
def run(... | /s3-consistency-checker-1.1.1.tar.gz/s3-consistency-checker-1.1.1/s3_consistency_checker/s3/etag.py | 0.551574 | 0.224247 | etag.py | pypi |
def read_write(bucket, prefix="*", extra_statements=None):
statements = read_write_statements(bucket, prefix=prefix)
if extra_statements:
statements.extend(extra_statements)
return wrap_policy(statements)
def read_write_statements(bucket, prefix="*"):
# https://github.com/simonw/s3-credentials... | /s3-credentials-0.15.tar.gz/s3-credentials-0.15/s3_credentials/policies.py | 0.57093 | 0.288243 | policies.py | pypi |
import logging
from six.moves import zip
logger = logging.getLogger(__name__)
def common_prefix(s1, s2):
"""Return the common prefix of strings s1 and s2."""
prefix = []
for c1, c2 in zip(s1, s2):
if c1 != c2:
break
prefix.append(c1)
return ''.join(prefix)
class _Node... | /s3-deploy-website-0.3.0.tar.gz/s3-deploy-website-0.3.0/s3_deploy/prefixcovertree.py | 0.868339 | 0.274356 | prefixcovertree.py | pypi |
from binascii import b2a_base64
from dataclasses import dataclass
from datetime import datetime, timedelta
from hashlib import sha256
from hmac import new as hmac
from json import dumps as json_dumps
from typing import Union
Signable = Union[str, bytes]
ACL_PRIVATE = "private"
ACL_PUBLIC = "public"
DEFAULT_CONTENT_TY... | /s3-direct-upload-0.1.0.tar.gz/s3-direct-upload-0.1.0/s3_direct_upload.py | 0.823719 | 0.176956 | s3_direct_upload.py | pypi |
import inspect
import os
from datetime import datetime
from typing import Any
class Format:
"""Initiates Format object to define variables that print the message in a certain format.
>>> Format
"""
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
ITALIC = '\x1B[3m'
class Colors:
"""Initiates Co... | /s3-downloader-0.0.7.tar.gz/s3-downloader-0.0.7/s3/display.py | 0.785473 | 0.214311 | display.py | pypi |
import base64
from botocore.response import StreamingBody
from .keys import DataKey
from .materials_providers import EncryptionContext, MaterialsProvider
class DecryptionStreamingBodyWrapper(object):
def __init__(self, streaming_body: StreamingBody, data_key: DataKey) -> None:
self._streaming_body = stre... | /s3-encryption-sdk-0.0.3.tar.gz/s3-encryption-sdk-0.0.3/s3_encryption_sdk/object.py | 0.805517 | 0.220259 | object.py | pypi |
from typing import Tuple
from ..keys import WrappingKey, DataKeyAlgorithms, DataKey
from ..materials import EncryptionMaterials, Metadata
from .base import MaterialsProvider
from .context import EncryptionContext
class WrappedMaterialsProvider(MaterialsProvider):
"""Cryptographic materials provider to use wrappe... | /s3-encryption-sdk-0.0.3.tar.gz/s3-encryption-sdk-0.0.3/s3_encryption_sdk/materials_providers/wrapped.py | 0.93823 | 0.2658 | wrapped.py | pypi |
from typing import Tuple
import botocore
from ..keys import DataKeyAlgorithms, DataKey
from ..materials import EncryptionMaterials, Metadata
from .base import MaterialsProvider
from .context import EncryptionContext
def _kms_encryption_context(encryption_context: EncryptionContext):
"""Build the KMS encryption c... | /s3-encryption-sdk-0.0.3.tar.gz/s3-encryption-sdk-0.0.3/s3_encryption_sdk/materials_providers/kms.py | 0.923135 | 0.190253 | kms.py | pypi |
import secrets
from enum import Enum
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
class DataKeyAlgorithms(Enum):
AES_128_GCM_IV12_TAG16 = ("AES/GCM/NoPadding", algorithms.AES, modes.GCM, 16, 12, 16)
AES_192_GCM_IV12_TAG16... | /s3-encryption-sdk-0.0.3.tar.gz/s3-encryption-sdk-0.0.3/s3_encryption_sdk/keys/data_key.py | 0.87232 | 0.270189 | data_key.py | pypi |
from datetime import datetime,timedelta
import boto3
def latest_files(s3client, bucket, prefix="", suffix="",last_modified_date=None):
"""
Generate details of the objects in an S3 bucket based on last_modified_date.
Args:
s3client:
boto3 S3 client
bucket:
Name of t... | /s3_last_modified_objects-0.0.3-py3-none-any.whl/s3_last_modified_objects/s3_objects.py | 0.765155 | 0.466663 | s3_objects.py | pypi |
import boto3
class s3_local_endpoint(object):
"""
Client to access to the S3 gateway.
"""
def __init__(self, access_key, secret_key, url, bucket):
"""
Connect a client to the S3 gateway.
:param access_key: The identifier used for the connection.
:type access_key: str
... | /s3_local_endpoint-1.0.4.tar.gz/s3_local_endpoint-1.0.4/s3_local_endpoint/s3_local_endpoint.py | 0.793346 | 0.180775 | s3_local_endpoint.py | pypi |
import logging
import boto3
import re
import pandas as pd
import concurrent.futures
from itertools import repeat
from typing import Dict, List, Union
from datetime import datetime
from dateutil.parser import parse
__author__ = "mikethoun"
__copyright__ = "mikethoun"
__license__ = "apache license 2.0"
class LogQuery:... | /s3_log_query-1.0.0-py3-none-any.whl/s3_log_query/S3LogQuery.py | 0.790773 | 0.308477 | S3LogQuery.py | pypi |
from contextlib import contextmanager
import tempfile
import logging
import os
from typing import Callable, Dict, Generator, NamedTuple
import boto3
from botocore.exceptions import ClientError
from mypy_boto3_s3.type_defs import HeadObjectOutputTypeDef
if os.environ.get('LOCALSTACK_S3_ENDPOINT_URL'):
s3_client = ... | /s3_metadata_tagger-1.0.1-py3-none-any.whl/metadata_tagger/object_tagger.py | 0.723212 | 0.156008 | object_tagger.py | pypi |
from typing import List, Optional
from urllib.parse import parse_qs, unquote, urlparse
from s3_parse_url.exceptions import InsecureNotAllowed, UnsupportedStorage
SECURE_HTTP_SCHEME = "https"
INSECURE_HTTP_SCHEME = "http"
INSECURE_SCHEME_SUFFIX = "+insecure"
class S3DataSource:
allowed_schemas: List[str] = ["s3"... | /s3_parse_url-0.3.3-py3-none-any.whl/s3_parse_url/base.py | 0.893649 | 0.207576 | base.py | pypi |
import logging
import re
from typing import Iterable, List, Optional, Union
LOGGER = logging.getLogger(__name__)
DNS_NAME_REGEX = r"(?![0-9]+$)(?!-)[a-zA-Z0-9-]{,63}(?<!-)"
S3_PATH_REGEX = r"^s3:\/\/(" + DNS_NAME_REGEX + r")\/(.+)$"
class InvalidPathError(ValueError):
pass
class UnknownBucketError(ValueError)... | /s3-path-wrangler-0.5.0.tar.gz/s3-path-wrangler-0.5.0/s3_path_wrangler/paths.py | 0.864582 | 0.390418 | paths.py | pypi |
import pandas as pd
from s3_prd_crypt.s3_connector import AWSS3BucketConnector
from s3_prd_crypt.file_type import to_file, from_file
def s3_put_df(
s3_access_key: str,
s3_access_secret_key: str,
bucket_name: str,
obj_path: str,
df: pd.DataFrame,
file_type: str = "parqu... | /s3_prd_crypt-0.0.2-py3-none-any.whl/s3_prd_crypt/prd.py | 0.761893 | 0.2906 | prd.py | pypi |
# S3 point in time restore
This is the repository for s3-restore, a point in time restore tool
for Amazon S3.
The typical scenario in which you may need this tool is when you have
enabled versioning on an S3 bucket and want to restore some or all of
the files to a certain point in time, to local file system, same s3 ... | /s3-restore-0.1.2.tar.gz/s3-restore-0.1.2/README.md | 0.763924 | 0.797478 | README.md | pypi |
import io
from datetime import datetime
from dateutil.parser import parse as date_parser
from typing import Tuple, Any
from urllib import parse
from .utils import nowut, info, warn, move_file
from .utils import add_utc_tz
class Scheduler:
def __init__(self, bucket: str, path: str, s3_resource, s3_client) -> Non... | /s3_scheduler-0.0.3.tar.gz/s3_scheduler-0.0.3/s3_scheduler/scheduler.py | 0.783658 | 0.187486 | scheduler.py | pypi |
import json
import gzip
import codecs
from functools import partial
from collections import namedtuple
from csv import (
DictReader,
reader as csv_reader,
excel_tab as csv_excel_tab
)
__all__ = ['deserialize', 'compression', 'StreamingBodyFileobj']
class FileLikeLineIterable(object):
def __init__(se... | /s3_streaming-0.0.3-py3-none-any.whl/s3streaming/stream.py | 0.502686 | 0.156685 | stream.py | pypi |
from typing import Dict, ClassVar
from s3_sync.schemas import StorageSchema, SyncObject
from s3_sync.services import S3SyncServices
from s3_sync.utils import scan_object
class SyncController:
def __init__(
self,
data_source: StorageSchema,
data_target: StorageSchema,
services: S3S... | /s3_sync-0.3.1-py3-none-any.whl/s3_sync/controllers/sync_controller.py | 0.864468 | 0.344471 | sync_controller.py | pypi |
import boto3 # package boto3
from botocore.exceptions import ClientError as AwsError # package boto3
from configparser import ConfigParser
from datetime import datetime, timedelta, timezone
from getpass import getuser
import gzip
import json
import os
import os.path
from pprint import pformat
import socket
import subp... | /s3-sysbackup-0.2.0.tar.gz/s3-sysbackup-0.2.0/src/s3_sysbackup/saver.py | 0.624294 | 0.248876 | saver.py | pypi |
"""Tools for inspecting the filesystem tree"""
from contextlib import contextmanager
import errno
import fcntl
import grp
import gzip
import hashlib
import io
import os, os.path
import pwd
import stat
import subprocess as subp
import time
from typing import Iterable, List, Tuple, Union as OneOf
import unicodedata
impo... | /s3-sysbackup-0.2.0.tar.gz/s3-sysbackup-0.2.0/src/s3_sysbackup/fs.py | 0.554953 | 0.229719 | fs.py | pypi |
import os
import fnmatch
import botocore
import boto3
def get_bucket(s3_path):
'''
Parses string of the s3_path to return the bucket.
'''
bucket_ = s3_path.replace('s3://','').split('/')[0]
return bucket_
def get_key(s3_path):
'''
Parses string of the s3_path to return the key + filename... | /s34me-0.1.7.tar.gz/s34me-0.1.7/s3/funcs.py | 0.416559 | 0.163512 | funcs.py | pypi |
import os.path
import re
import sys
import yaml
from datetime import timedelta
import logging
import log
from six import integer_types
def s3cmd_path():
"""
The full path of the s3cmd executable
"""
return 's3cmd'
def file_exists(file_path):
"""
Check to see if a file exists
:param fil... | /s3_cmd_website-0.6.0.tar.gz/s3_cmd_website-0.6.0/s3_website/helper.py | 0.558809 | 0.232898 | helper.py | pypi |
from functools import lru_cache
from typing import List
import re
import boto3
from IPython.core.completer import IPCompleter
from IPython.core.interactiveshell import InteractiveShell
PREFIX = re.compile(r's3\(["\']')
client = None
def s3(path: str) -> str:
"""Function whose name triggers s3 auto-complete. Ret... | /s3ac-0.0.3.tar.gz/s3ac-0.0.3/s3ac.py | 0.791217 | 0.17552 | s3ac.py | pypi |
[](https://www.yotron.de)
[YOTRON](https://www.yotron.de) is a consultancy company which is focused on DevOps, Cloudmanagement and
Data Management. Visit us on [www.yotron.de](https://www.yotron.de).
# S3App
S3 (Simple Storage Solution) is a object storage services ... | /s3app-1.2.1.tar.gz/s3app-1.2.1/README.md | 0.752831 | 0.921711 | README.md | pypi |
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
## http://www.logix.cz/michal
## License: GPL Version 2
## Copyright: TGRMN Software and contributors
from __future__ import absolute_import, print_function
from .BidirMap import BidirMap
class SortedDictIterator(object):
def __init__(self,... | /s3cmd-2.3.0.tar.gz/s3cmd-2.3.0/S3/SortedDict.py | 0.474875 | 0.221372 | SortedDict.py | pypi |
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
## http://www.logix.cz/michal
## License: GPL Version 2
## Copyright: TGRMN Software and contributors
from __future__ import absolute_import
import logging
from .SortedDict import SortedDict
from . import Utils
from . import Config
zero_length_... | /s3cmd-2.3.0.tar.gz/s3cmd-2.3.0/S3/FileDict.py | 0.549641 | 0.161353 | FileDict.py | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.