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
import math import numpy as np import tensorflow as tf def radians(deg): return (math.pi / 180.0) * deg def normalize(v): """ NOTE: torch.norm() uses Frobineus norm which is Euclidean and L2 """ return v / tf.norm(v) def gen_look_at_matrix(pos, look, up): d = normalize(look - pos) right ...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/transform.py
0.909131
0.610337
transform.py
pypi
import tensorflow as tf import redner class RednerCameraType: __cameratypes = [ redner.CameraType.perspective, redner.CameraType.orthographic, redner.CameraType.fisheye, redner.CameraType.panorama, ] @staticmethod def asTensor(cameratype: redner.CameraType) -> tf.Tensor...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/redner_enum_wrapper.py
0.433862
0.433322
redner_enum_wrapper.py
pypi
import pyredner_tensorflow as pyredner import tensorflow as tf from typing import Optional class Object: """ Object combines geometry, material, and lighting information and aggregate them in a single class. This is a convinent class for constructing redner scenes. redner supports ...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/object.py
0.962568
0.81119
object.py
pypi
import tensorflow as tf import pyredner_tensorflow as pyredner import math class Texture: """ Representing a texture and its mipmap. Args ==== texels: torch.Tensor a float32 tensor with size C or [height, width, C] uv_scale: Optional[torch.Tensor] sc...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/texture.py
0.938308
0.678207
texture.py
pypi
import pyredner_tensorflow as pyredner import random import redner import tensorflow as tf import math from typing import Union, Tuple, Optional, List class DeferredLight: pass class AmbientLight(DeferredLight): """ Ambient light for deferred rendering. """ def __init__(self, ...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/render_utils.py
0.959856
0.405302
render_utils.py
pypi
import pyredner_tensorflow as pyredner import numpy as np import tensorflow as tf import math import pdb class EnvironmentMap: """ A class representing light sources infinitely far away using an image. Args ---------- values: Union[tf.Tensor, pyredner.Texture] a float32...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/envmap.py
0.929584
0.702725
envmap.py
pypi
import numpy as np import tensorflow as tf import math import pyredner_tensorflow as pyredner def generate_geometry_image(size: int): """ Generate an spherical geometry image [Gu et al. 2002 and Praun and Hoppe 2003] of size [2 * size + 1, 2 * size + 1]. This can be used for encoding a genus-0 ...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/geometry_images.py
0.813942
0.658472
geometry_images.py
pypi
import tensorflow as tf import numpy as np import redner import pyredner_tensorflow as pyredner import time import weakref import os from typing import List, Union, Tuple, Optional from .redner_enum_wrapper import RednerCameraType, RednerSamplerType, RednerChannels __EMPTY_TENSOR = tf.constant([]) use_correlated_rando...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/render_tensorflow.py
0.86501
0.390098
render_tensorflow.py
pypi
import tensorflow as tf import pyredner_tensorflow.transform as transform import redner import pyredner_tensorflow as pyredner import math from typing import Tuple, Optional, List class Camera: """ redner supports four types of cameras: perspective, orthographic, fisheye, and panorama. The camera t...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner_tensorflow/camera.py
0.950215
0.714068
camera.py
pypi
import pyredner import torch from typing import Union, Optional class Material: """ redner currently employs a two-layer diffuse-specular material model. More specifically, it is a linear blend between a Lambertian model and a microfacet model with Phong distribution, with Schilick's Fresne...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/material.py
0.909184
0.789396
material.py
pypi
import pyredner from typing import Union import os import torch def save_obj(shape: Union[pyredner.Object, pyredner.Shape], filename: str, flip_tex_coords = True): """ Save to a Wavefront obj file from an Object or a Shape. Args ==== shape: Union[pyredner.O...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/save_obj.py
0.727395
0.302224
save_obj.py
pypi
import torch import numpy as np import redner import pyredner import time import skimage.io from typing import List, Union, Tuple, Optional import warnings use_correlated_random_number = False def set_use_correlated_random_number(v: bool): """ | There is a bias-variance trade off in the backward pass. ...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/render_pytorch.py
0.950726
0.52543
render_pytorch.py
pypi
import pyredner import torch import math import redner from typing import Optional def compute_vertex_normal(vertices: torch.Tensor, indices: torch.Tensor, weighting_scheme: str = 'max'): """ Compute vertex normal by weighted average of nearby face normal...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/shape.py
0.938003
0.681061
shape.py
pypi
import torch import re import pyredner import os from typing import Optional class WavefrontMaterial: def __init__(self): self.name = "" self.Kd = (0.0, 0.0, 0.0) self.Ks = (0.0, 0.0, 0.0) self.Ns = 0.0 self.Ke = (0.0, 0.0, 0.0) self.map_Kd = None self.map_Ks...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/load_obj.py
0.853379
0.299824
load_obj.py
pypi
import pyredner import torch from typing import Optional, List class Scene: """ A scene is a collection of camera, geometry, materials, and light. Currently there are two ways to construct a scene: one is through lists of Shape, Material, and AreaLight. The other one is through a li...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/scene.py
0.902953
0.453746
scene.py
pypi
import math import numpy as np import torch def radians(deg): return (math.pi / 180.0) * deg def normalize(v): return v / torch.norm(v) def gen_look_at_matrix(pos, look, up): d = normalize(look - pos) right = normalize(torch.cross(d, normalize(up))) new_up = normalize(torch.cross(right, d)) z...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/transform.py
0.908038
0.642671
transform.py
pypi
import pyredner import torch from typing import Optional class Object: """ Object combines geometry, material, and lighting information and aggregate them in a single class. This is a convinent class for constructing redner scenes. redner supports only triangle meshes for now. It s...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/object.py
0.958265
0.814127
object.py
pypi
import torch import numpy as np import pyredner import torch import enum import math from typing import Optional class Texture: """ Representing a texture and its mipmap. Args ==== texels: torch.Tensor a float32 tensor with size C or [height, width, C] uv_scale:...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/texture.py
0.93847
0.740444
texture.py
pypi
import pyredner import random import redner import torch import math from typing import Union, Tuple, Optional, List class DeferredLight: pass class AmbientLight(DeferredLight): """ Ambient light for deferred rendering. """ def __init__(self, intensity: torch.Tensor): ...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/render_utils.py
0.954764
0.517205
render_utils.py
pypi
import pyredner import torch import math from typing import Union class EnvironmentMap: """ A class representing light sources infinitely far away using an image. Args ---------- values: Union[torch.Tensor, pyredner.Texture] a float32 tensor with size 3 or [height, widt...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/envmap.py
0.942414
0.779301
envmap.py
pypi
import numpy as np import torch import math import pyredner from typing import Optional def generate_geometry_image(size: int, device: Optional[torch.device] = None): """ Generate an spherical geometry image [Gu et al. 2002 and Praun and Hoppe 2003] of size [2 * size + 1...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/geometry_images.py
0.866239
0.720651
geometry_images.py
pypi
import torch import pyredner.transform as transform import redner import math import pyredner from typing import Tuple, Optional, List class Camera: """ Redner supports four types of cameras\: perspective, orthographic, fisheye, and panorama. The camera takes a look at transform or a cam_to_world m...
/redner-0.4.28-cp38-cp38-macosx_10_14_x86_64.whl/pyredner/camera.py
0.944536
0.775435
camera.py
pypi
from plone.indexer import indexer from Products.ATContentTypes.interfaces.interfaces import IATContentType from redomino.advancedkeyword.config import KEYWORD_SEPARATOR def subject_splitter(subject): """ >>> subject = 'redomino.prodotti.recatalog' >>> subject_splitter(subject) ['redomin...
/redomino.advancedkeyword-1.4.tar.gz/redomino.advancedkeyword-1.4/redomino/advancedkeyword/indexers.py
0.625209
0.202877
indexers.py
pypi
from Acquisition import aq_inner from Acquisition import aq_parent from zope.interface import implements from zope import schema from zope.schema.interfaces import IVocabularyFactory from zope.component import getUtility from zope.component import getMultiAdapter from z3c.form import form from z3c.form import field ...
/redomino.advancedkeyword-1.4.tar.gz/redomino.advancedkeyword-1.4/redomino/advancedkeyword/portlets/keywordportlet.py
0.675015
0.267068
keywordportlet.py
pypi
from zope.component import getUtility from Products.MimetypesRegistry.interfaces import IMimetypesRegistryTool from Products.PortalTransforms.interfaces import IPortalTransformsTool from redomino.appytransforms.transforms import initialize from redomino.appytransforms.mimetype import OdtTextTransformed from redomino....
/redomino.appytransforms-0.1.zip/redomino.appytransforms-0.1/redomino/appytransforms/setuphandlers.py
0.606848
0.241165
setuphandlers.py
pypi
from plone.app.layout.globals.layout import LayoutPolicy as LayoutPolicyOriginal from plone.app.layout.navigation.interfaces import INavigationRoot from zope.component import getMultiAdapter, getUtility from Acquisition import aq_base, aq_inner, aq_parent from plone.registry.interfaces import IRegistry from utility imp...
/redomino.css3theme-1.5.10.zip/redomino.css3theme-1.5.10/redomino/css3theme/browser/layout.py
0.535827
0.161089
layout.py
pypi
from zope.component import getUtility from Products.MimetypesRegistry.interfaces import IMimetypesRegistryTool from Products.PortalTransforms.interfaces import IPortalTransformsTool from redomino.odttransforms.transforms import initialize from redomino.odttransforms.mimetype import OdtTextTransformed class SetupVar...
/redomino.odttransforms-0.4.zip/redomino.odttransforms-0.4/redomino/odttransforms/setuphandlers.py
0.566978
0.232419
setuphandlers.py
pypi
from zope.interface import implements, alsoProvides from zope.viewlet.interfaces import IViewlet from Products.Five.browser import BrowserView from plone.app.layout.viewlets.common import ViewletBase from AccessControl import getSecurityManager from Products.CMFCore.permissions import ModifyPortalContent from redomino....
/redomino.redirectparent-0.3.zip/redomino.redirectparent-0.3/redomino/redirectparent/browser/viewlets.py
0.406037
0.169681
viewlets.py
pypi
from zope.interface import Interface from zope.interface import implements from plone.app.portlets.portlets import base from plone.portlets.interfaces import IPortletDataProvider from Products.CMFCore.utils import getToolByName from zope...
/redomino.social-1.2.tar.gz/redomino.social-1.2/redomino/social/portlets/socialportlet.py
0.615319
0.212773
socialportlet.py
pypi
from zope.interface import implements, Interface from Products.Five import BrowserView from zope.component import getMultiAdapter from redomino.tabsandslides.utility import filterById from Products.ATContentTypes.interface import IATTopic, IATFolder from Products.CMFCore.interfaces import IFolderish from Acquisition ...
/redomino.tabsandslides-0.9.11.tar.gz/redomino.tabsandslides-0.9.11/redomino/tabsandslides/browser/common.py
0.676513
0.171546
common.py
pypi
import random from zope import schema from zope.formlib import form from zope.interface import implements from zope.component import getUtility from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from plone.portlet.collection import PloneMessageFactory as _plone from plone.memoize.instance import ...
/redomino.tabsandslides-0.9.11.tar.gz/redomino.tabsandslides-0.9.11/redomino/tabsandslides/portlets/portlet_generic_talexp.py
0.560253
0.227856
portlet_generic_talexp.py
pypi
import decimal from enum import Enum class RoundType(Enum): ROUND_HALF_UP = 'ROUND_HALF_UP' ROUND_HALF_DOWN = 'ROUND_HALF_DOWN' ROUND_HALF_EVEN = 'ROUND_HALF_EVEN' def round_number( number_str: str, places: int = 2, precision: int = 8, round_type: RoundType = RoundType.RO...
/redondear-dsalinas-0.0.3.tar.gz/redondear-dsalinas-0.0.3/src/redondear/redondear.py
0.851645
0.259814
redondear.py
pypi
import base64 import hashlib import itertools import urllib.parse from pathlib import Path from typing import Dict, Iterable, List, Optional, Sequence, Set, Union import numpy as np from cc_net import jsonql from cc_net.execution import get_executor from cc_net.jsonql import mem_footprint_gb HASH_SIZE = 4 HASH_TYPE...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/minify.py
0.829285
0.323287
minify.py
pypi
import hashlib import json import time import warnings from argparse import ArgumentParser from collections import defaultdict from itertools import repeat from pathlib import Path from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Sequence, Tuple import func_argparse # Local scripts from cc_net impo...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/mine.py
0.767646
0.172311
mine.py
pypi
import argparse import gc import hashlib import logging import multiprocessing import os import tempfile import time from pathlib import Path from typing import Iterable, List, Optional, Set, Union import numpy as np from cc_net import jsonql from cc_net.flat_hash_set import HASH_TYPE, AbstractDedupHashSet, FlatHashS...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/dedup.py
0.608361
0.224714
dedup.py
pypi
import functools import itertools import logging import os import sys import time import warnings from pathlib import Path from typing import Callable, Dict, Iterable, List, Optional, Sequence, Sized import submitit from typing_extensions import Protocol class Executor(Protocol): def __call__(self, function: Ca...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/execution.py
0.567218
0.196845
execution.py
pypi
import time from typing import Dict, Optional import sacremoses # type: ignore from cc_net import jsonql, text_normalizer class RobustTokenizer(jsonql.Transformer): """Moses tokenizer with the expected preprocessing.""" LANG_WITHOUT_ACCENT = {"en", "my"} def __init__(self, lang: str): super(...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/tokenizer.py
0.810516
0.156137
tokenizer.py
pypi
import logging import subprocess from pathlib import Path from typing import List import func_argparse import numpy as np from cc_net import jsonql def get_index(file: Path) -> Path: return file.parent / (file.name + ".index") def _get_tmp(output: Path) -> Path: return output.parent / (output.stem + ".tm...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/regroup.py
0.568655
0.387459
regroup.py
pypi
import argparse import time from pathlib import Path from typing import Dict, List, Optional, Sequence, Tuple, Union import kenlm # type: ignore import numpy as np # type: ignore import pandas as pd # type: ignore import sentencepiece # type: ignore from cc_net import jsonql, text_normalizer LMDescriptor = Unio...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/perplexity.py
0.761538
0.159675
perplexity.py
pypi
import re import unicodedata UNICODE_PUNCT = { ",": ",", "。": ".", "、": ",", "„": '"', "”": '"', "“": '"', "«": '"', "»": '"', "1": '"', "」": '"', "「": '"', "《": '"', "》": '"', "´": "'", "∶": ":", ":": ":", "?": "?", "!": "!", "(": "(", "...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/text_normalizer.py
0.504394
0.363732
text_normalizer.py
pypi
import functools import re import subprocess import urllib.request from pathlib import Path from typing import Dict import func_argparse from bs4 import BeautifulSoup # type: ignore from cc_net import jsonql, text_normalizer CIRRUS_URL = "https://dumps.wikimedia.org/other/cirrussearch" CIRRUS_DUMP_RE = re.compile(r...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/get_wiki_cirrus.py
0.704668
0.307995
get_wiki_cirrus.py
pypi
import contextlib import functools import logging import re import tempfile import time import urllib.request from pathlib import Path from typing import ContextManager, Iterable, Iterator, List, Optional, Sequence from urllib.parse import urlparse import func_argparse from bs4 import BeautifulSoup # type: ignore f...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/process_wet_file.py
0.679179
0.15219
process_wet_file.py
pypi
import argparse import collections from pathlib import Path from typing import Dict, Optional import fasttext # type: ignore from cc_net import jsonql def get_args(): parser = argparse.ArgumentParser( description="Read a list of json files and split them ", parents=[jsonql.io_parser()], )...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/split_by_lang.py
0.865608
0.208179
split_by_lang.py
pypi
import contextlib import functools import gzip import logging import multiprocessing from collections import defaultdict from pathlib import Path from typing import Callable, Dict, Iterator, List, NamedTuple, Optional, Tuple import cc_net from cc_net import jsonql from cc_net.process_wet_file import CCSegmentsReader ...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/tools/dl_cc_100.py
0.640411
0.195517
dl_cc_100.py
pypi
import functools import logging import math import subprocess from collections import Counter from pathlib import Path from typing import Iterable, List, Optional, Set, Tuple import func_argparse import submitit from kenlm import Model as KenlmModel # type: ignore from sentence_splitter import SentenceSplitter # typ...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/tools/expand_corpus.py
0.598899
0.18797
expand_corpus.py
pypi
import urllib.request from io import StringIO from pathlib import Path from typing import Dict, Set from urllib.parse import urlparse import func_argparse from lxml import etree # type: ignore from cc_net import jsonql TaggedUrls = Dict[str, Set[str]] DMOZ_TAGS_URL = "https://web.archive.org/web/20140617145301/http...
/redpajama_data-0.0.1.tar.gz/redpajama_data-0.0.1/data_prep/cc/cc_net/cc_net/tools/make_dmoz_corpus.py
0.406509
0.150278
make_dmoz_corpus.py
pypi
import base64 import hashlib import itertools import urllib.parse from pathlib import Path from typing import Dict, Iterable, List, Optional, Sequence, Set, Union import numpy as np from cc_net import jsonql from cc_net.execution import get_executor from cc_net.jsonql import mem_footprint_gb HASH_SIZE = 4 HASH_TYPE...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/minify.py
0.829285
0.323287
minify.py
pypi
import hashlib import json import time import warnings from argparse import ArgumentParser from collections import defaultdict from itertools import repeat from pathlib import Path from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Sequence, Tuple import func_argparse # Local scripts from cc_net impo...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/mine.py
0.767646
0.172311
mine.py
pypi
import argparse import gc import hashlib import logging import multiprocessing import os import tempfile import time from pathlib import Path from typing import Iterable, List, Optional, Set, Union import numpy as np from cc_net import jsonql from cc_net.flat_hash_set import HASH_TYPE, AbstractDedupHashSet, FlatHashS...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/dedup.py
0.608361
0.224714
dedup.py
pypi
import functools import itertools import logging import os import sys import time import warnings from pathlib import Path from typing import Callable, Dict, Iterable, List, Optional, Sequence, Sized import submitit from typing_extensions import Protocol class Executor(Protocol): def __call__(self, function: Ca...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/execution.py
0.567218
0.196845
execution.py
pypi
import time from typing import Dict, Optional import sacremoses # type: ignore from cc_net import jsonql, text_normalizer class RobustTokenizer(jsonql.Transformer): """Moses tokenizer with the expected preprocessing.""" LANG_WITHOUT_ACCENT = {"en", "my"} def __init__(self, lang: str): super(...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/tokenizer.py
0.810516
0.156137
tokenizer.py
pypi
import logging import subprocess from pathlib import Path from typing import List import func_argparse import numpy as np from cc_net import jsonql def get_index(file: Path) -> Path: return file.parent / (file.name + ".index") def _get_tmp(output: Path) -> Path: return output.parent / (output.stem + ".tm...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/regroup.py
0.568655
0.387459
regroup.py
pypi
import argparse import time from pathlib import Path from typing import Dict, List, Optional, Sequence, Tuple, Union import kenlm # type: ignore import numpy as np # type: ignore import pandas as pd # type: ignore import sentencepiece # type: ignore from cc_net import jsonql, text_normalizer LMDescriptor = Unio...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/perplexity.py
0.761538
0.159675
perplexity.py
pypi
import re import unicodedata UNICODE_PUNCT = { ",": ",", "。": ".", "、": ",", "„": '"', "”": '"', "“": '"', "«": '"', "»": '"', "1": '"', "」": '"', "「": '"', "《": '"', "》": '"', "´": "'", "∶": ":", ":": ":", "?": "?", "!": "!", "(": "(", "...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/text_normalizer.py
0.504394
0.363732
text_normalizer.py
pypi
import functools import re import subprocess import urllib.request from pathlib import Path from typing import Dict import func_argparse from bs4 import BeautifulSoup # type: ignore from cc_net import jsonql, text_normalizer CIRRUS_URL = "https://dumps.wikimedia.org/other/cirrussearch" CIRRUS_DUMP_RE = re.compile(r...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/get_wiki_cirrus.py
0.704668
0.307995
get_wiki_cirrus.py
pypi
import contextlib import functools import logging import re import tempfile import time import urllib.request from pathlib import Path from typing import ContextManager, Iterable, Iterator, List, Optional, Sequence from urllib.parse import urlparse import func_argparse from bs4 import BeautifulSoup # type: ignore f...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/process_wet_file.py
0.679179
0.15219
process_wet_file.py
pypi
import argparse import collections from pathlib import Path from typing import Dict, Optional import fasttext # type: ignore from cc_net import jsonql def get_args(): parser = argparse.ArgumentParser( description="Read a list of json files and split them ", parents=[jsonql.io_parser()], )...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/split_by_lang.py
0.865608
0.208179
split_by_lang.py
pypi
import contextlib import functools import gzip import logging import multiprocessing from collections import defaultdict from pathlib import Path from typing import Callable, Dict, Iterator, List, NamedTuple, Optional, Tuple import cc_net from cc_net import jsonql from cc_net.process_wet_file import CCSegmentsReader ...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/tools/dl_cc_100.py
0.640411
0.195517
dl_cc_100.py
pypi
import functools import logging import math import subprocess from collections import Counter from pathlib import Path from typing import Iterable, List, Optional, Set, Tuple import func_argparse import submitit from kenlm import Model as KenlmModel # type: ignore from sentence_splitter import SentenceSplitter # typ...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/tools/expand_corpus.py
0.598899
0.18797
expand_corpus.py
pypi
import urllib.request from io import StringIO from pathlib import Path from typing import Dict, Set from urllib.parse import urlparse import func_argparse from lxml import etree # type: ignore from cc_net import jsonql TaggedUrls = Dict[str, Set[str]] DMOZ_TAGS_URL = "https://web.archive.org/web/20140617145301/http...
/redpajama-0.0.1-py3-none-any.whl/cc/cc_net/cc_net/tools/make_dmoz_corpus.py
0.406509
0.150278
make_dmoz_corpus.py
pypi
## Loading in the required packages ``` from skimage import io from skimage import color import redpatch as rp ``` ## Loading an image Loading the test image is straightforward. First we create a `FileBrowser object` and navigate to the file we want to use ``` f = rp.FileBrowser() f.widget() ``` The file path of ...
/redpatch-0.2.4-py3-none-any.whl/redpatch_notebooks/Redpatch Basic Use Example.ipynb
0.479747
0.9799
Redpatch Basic Use Example.ipynb
pypi
import redpic as rp import kenv as kv import pandas as pd import numpy as np from bokeh.models import (Panel, PreText, RadioButtonGroup, Select, FileInput, Button, TextInput, ColumnDataSource, RangeSlider) from bokeh.plotting import figure from bokeh.layouts import c...
/redpic-1.0.0.0-py3-none-any.whl/redapp/accelerator.py
0.427516
0.372305
accelerator.py
pypi
import redpic as rp import kenv as kv import pandas as pd import numpy as np import glob from scipy import interpolate from multiprocessing import Process from bokeh.models import (Panel, PreText, RadioButtonGroup, RadioGroup, Select, FileInput, Button, TextInput, ColumnDataSource, ...
/redpic-1.0.0.0-py3-none-any.whl/redapp/production.py
0.548674
0.3398
production.py
pypi
import six class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): """ Raises an exception for TypeErrors Args...
/redrover-api-1.9.tar.gz/redrover-api-1.9/redrover_api/exceptions.py
0.696268
0.26309
exceptions.py
pypi
import typing from typing import List, Dict, Tuple, Any import bs4 import validators # type: ignore from bs4 import element from loguru import logger # type: ignore from common.constants.common_constants import CommonConstants # type: ignore from common.io_operations.image_downloader import ImageDownloader # type...
/redscrap-0.0.4-py3-none-any.whl/core/scraper/comment_scraper.py
0.78469
0.393968
comment_scraper.py
pypi
import glob import re from pathlib import Path from typing import Dict, Tuple, List, Any, Union import validators # type: ignore from bs4 import BeautifulSoup, Tag from loguru import logger from common.constants.common_constants import CommonConstants # type: ignore from common.validations.url_validations import Ur...
/redscrap-0.0.4-py3-none-any.whl/core/scraper/scraper_helper.py
0.855565
0.325936
scraper_helper.py
pypi
import time from typing import Any, Optional, Dict, Union, List, Tuple from loguru import logger # type: ignore from bs4 import BeautifulSoup, ResultSet from common.exceptions.main_exceptions import TokenErrorException # type: ignore from common.logging.logging_setup import LoggingSetup # type: ignore from common.c...
/redscrap-0.0.4-py3-none-any.whl/core/scraper/thread_scraper.py
0.82251
0.204441
thread_scraper.py
pypi
import glob from pathlib import Path from typing import Any, Optional, List, Union from bs4 import ResultSet from loguru import logger # type: ignore from common.constants.common_constants import CommonConstants # type: ignore from common.constants.logging_constants import LoggingConstants # type: ignore from comm...
/redscrap-0.0.4-py3-none-any.whl/core/helper/main_helper.py
0.830491
0.263286
main_helper.py
pypi
from typing import Optional, Dict, Union from loguru import logger # type: ignore from common.exceptions.main_exceptions import UserNotFoundException, TokenErrorException # type: ignore from common.logging.logging_setup import LoggingSetup # type: ignore from common.constants.common_constants import CommonCon...
/redscrap-0.0.4-py3-none-any.whl/core/api/reddit_api.py
0.910806
0.301748
reddit_api.py
pypi
import sys from common.constants.logging_constants import LoggingConstants # type: ignore from common.logging.utils.log_rotator import LogRotator # type: ignore from common.logging.utils.padding_formatter import PaddingFormatter # type: ignore constants = LoggingConstants() class LoguruSetup: """ A class...
/redscrap-0.0.4-py3-none-any.whl/common/logging/loguru_setup.py
0.570212
0.256966
loguru_setup.py
pypi
import logging import sys from logging import handlers import colorama # type: ignore from colorama import Fore, Back, Style from common.constants.logging_constants import LoggingConstants # type: ignore logging_constants = LoggingConstants() class FilterByModule(logging.Filter): """ custom filter ...
/redscrap-0.0.4-py3-none-any.whl/common/logging/logging_setup.py
0.636918
0.231419
logging_setup.py
pypi
import functools import time from typing import Callable, Any from loguru import logger # type: ignore class LoguruWrappers: def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): #logger.debug("LoguruWrappers is invoked") return self.func(*args, **kwar...
/redscrap-0.0.4-py3-none-any.whl/common/logging/utils/loguru_wrappers.py
0.803174
0.178007
loguru_wrappers.py
pypi
import glob from contextlib import contextmanager from pathlib import Path from typing import List from urllib.parse import urlparse from loguru import logger # type: ignore from tqdm import tqdm import httpx from common.logging.utils.loguru_wrappers import logger_wraps # type: ignore from common.validations.url_val...
/redscrap-0.0.4-py3-none-any.whl/common/io_operations/image_downloader.py
0.696991
0.287912
image_downloader.py
pypi
from typing import Optional, List from loguru import logger # type: ignore import json from common.exceptions.main_exceptions import SubredditNotFoundException, UserNotFoundException, TokenErrorException # type: ignore from common.logging.logging_setup import LoggingSetup # type: ignore from common.constants....
/redscrap-0.0.4-py3-none-any.whl/common/validations/reddit_api_validations.py
0.86267
0.31871
reddit_api_validations.py
pypi
from typing import List, Optional import re import validators # type: ignore from loguru import logger # type: ignore from common.logging.logging_setup import LoggingSetup # type: ignore from common.constants.common_constants import CommonConstants # type: ignore logging_setup = LoggingSetup() constants = CommonC...
/redscrap-0.0.4-py3-none-any.whl/common/validations/url_validations.py
0.895759
0.485234
url_validations.py
pypi
import re from typing import List, Optional from loguru import logger # type: ignore from common.constants.common_constants import CommonConstants # type: ignore from common.exceptions.main_exceptions import SubredditNotFoundException # type: ignore from common.logging.logging_setup import LoggingSetup # type: ign...
/redscrap-0.0.4-py3-none-any.whl/common/validations/parameter_validations.py
0.856842
0.378919
parameter_validations.py
pypi
import datetime from collections import defaultdict from pathlib import Path import os class CommonConstants: """ A class that contains constants used throughout the application. Attributes: old_reddit_url (str): Old reddit base url. reddit_api_base_url (str): Reddit API base url. ...
/redscrap-0.0.4-py3-none-any.whl/common/constants/common_constants.py
0.734786
0.22642
common_constants.py
pypi
from datetime import time import loguru class LoggingConstants: """ A class that contains logging constants used for configuring logging settings. The properties of this class represent the logging levels and their corresponding severity levels, as well as various symbols and log formats used in the ...
/redscrap-0.0.4-py3-none-any.whl/common/constants/logging_constants.py
0.884152
0.381364
logging_constants.py
pypi
import psycopg2 as pg import pandas as pd import numpy as np import re from datetime import datetime from dateutil import parser from typing import List class RedshiftAutoSchema(): """RedshiftAutoSchema takes a delimited flat file or parquet file as input and infers the appropriate Redshift data type for each co...
/redshift_auto_schema-0.1.16-py3-none-any.whl/redshift_auto_schema/RedshiftAutoSchema.py
0.8059
0.417836
RedshiftAutoSchema.py
pypi
from datetime import date from datetime import datetime as Datetime from datetime import time from time import localtime def Date(year: int, month: int, day: int) -> date: """Constuct an object holding a date value. This function is part of the `DBAPI 2.0 specification <http://www.python.org/dev/peps/pep...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/objects.py
0.928672
0.611527
objects.py
pypi
class Warning(Exception): """Generic exception raised for important database warnings like data truncations. This exception is not currently used. This exception is part of the `DBAPI 2.0 specification <http://www.python.org/dev/peps/pep-0249/>`_. """ pass class Error(Exception): """Gen...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/error.py
0.81812
0.454835
error.py
pypi
from redshift_connector.config import max_int4, max_int8, min_int4, min_int8 class Interval: """An Interval represents a measurement of time. In Amazon Redshift, an interval is defined in the measure of months, days, and microseconds; as such, the interval type represents the same information. Note ...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/interval.py
0.924466
0.670588
interval.py
pypi
import datetime import logging import time import typing from abc import ABC, abstractmethod if typing.TYPE_CHECKING: import boto3 # type: ignore _logger: logging.Logger = logging.getLogger(__name__) class ABCCredentialsHolder(ABC): """ Abstract base class used to store credentials for establishing a ...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/credentials_holder.py
0.837968
0.214434
credentials_holder.py
pypi
import logging import re import typing from redshift_connector.error import InterfaceError from redshift_connector.plugin.saml_credentials_provider import SamlCredentialsProvider _logger: logging.Logger = logging.getLogger(__name__) class AdfsCredentialsProvider(SamlCredentialsProvider): """ Identity Provid...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/plugin/adfs_credentials_provider.py
0.564459
0.195095
adfs_credentials_provider.py
pypi
import logging import re import typing from redshift_connector.error import InterfaceError from redshift_connector.plugin.saml_credentials_provider import SamlCredentialsProvider from redshift_connector.redshift_property import RedshiftProperty _logger: logging.Logger = logging.getLogger(__name__) class PingCredent...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/plugin/ping_credentials_provider.py
0.55652
0.190404
ping_credentials_provider.py
pypi
import json import logging import typing from redshift_connector.error import InterfaceError from redshift_connector.plugin.credential_provider_constants import okta_headers from redshift_connector.plugin.saml_credentials_provider import SamlCredentialsProvider from redshift_connector.redshift_property import Redshift...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/plugin/okta_credentials_provider.py
0.691497
0.153962
okta_credentials_provider.py
pypi
import base64 import logging import typing from redshift_connector.error import InterfaceError from redshift_connector.plugin.credential_provider_constants import azure_headers from redshift_connector.plugin.saml_credentials_provider import SamlCredentialsProvider from redshift_connector.redshift_property import Redsh...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/plugin/azure_credentials_provider.py
0.708414
0.201185
azure_credentials_provider.py
pypi
import base64 import concurrent.futures import logging import random import socket import typing from redshift_connector.error import InterfaceError from redshift_connector.plugin.credential_provider_constants import azure_headers from redshift_connector.plugin.saml_credentials_provider import SamlCredentialsProvider ...
/redshift_connector-2.0.913-py3-none-any.whl/redshift_connector/plugin/browser_azure_credentials_provider.py
0.695648
0.167934
browser_azure_credentials_provider.py
pypi
(function (factory) { if (typeof define === 'function' && define.amd) { define(['moment'], factory); // AMD } else if (typeof exports === 'object') { module.exports = factory(require('../moment')); // Node } else { factory((typeof global !== 'undefined' ? global : this).moment); // ...
/redshift-console-0.1.3.tar.gz/redshift-console-0.1.3/redshift_console/static/dist/bower_components/momentjs/locale/sr.js
0.443118
0.525795
sr.js
pypi
from datetime import datetime from dateutil.relativedelta import relativedelta class DateFunctions(object): # this static method allows to use any of the other methods and apply them to a Pandas Dataframe @staticmethod def apply_to_df(df, new_col, col, func, *args): df[new_col] = df[col].apply(la...
/redshift-pandas-0.1.1.tar.gz/redshift-pandas-0.1.1/redshiftpandas/date_functions.py
0.550366
0.257094
date_functions.py
pypi
# redshift-query [![image](https://img.shields.io/pypi/v/redshift-query.svg)](https://pypi.python.org/pypi/redshift-query) [![image](https://img.shields.io/travis/helecloud/redshift-query.svg)](https://travis-ci.com/helecloud/redshift-query) [![image](https://readthedocs.org/projects/redshift-query/badge/?version=late...
/redshift-query-0.1.4.tar.gz/redshift-query-0.1.4/README.md
0.713531
0.883186
README.md
pypi
# Copyright (C) 2022 ETH Zurich, # Institute for Particle Physics and Astrophysics # Author: Silvan Fischbacher # package import import numpy as np from astropy.convolution import Gaussian1DKernel, convolve_fft from cosmic_toolbox import logger LOGGER = logger.get_logger(__name__) def smail(z, alpha=2.0, beta=2.0,...
/redshift_tools-0.2.0.tar.gz/redshift_tools-0.2.0/src/redshift_tools/create.py
0.867415
0.631452
create.py
pypi
# Copyright (C) 2022 ETH Zurich, # Institute for Particle Physics and Astrophysics # Author: Silvan Fischbacher import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from cycler import cycler import redshift_tools as rt from cosmic_toolbox import colors COLORS = list(colors.get_colors().values...
/redshift_tools-0.2.0.tar.gz/redshift_tools-0.2.0/src/redshift_tools/plot.py
0.778565
0.5169
plot.py
pypi
# Copyright (C) 2022 ETH Zurich, # Institute for Particle Physics and Astrophysics # Author: Silvan Fischbacher import numpy as np from scipy.interpolate import interp1d import PyCosmo import redshift_tools as rt from cosmic_toolbox import logger LOGGER = logger.get_logger(__name__) def load_bins(path): """ ...
/redshift_tools-0.2.0.tar.gz/redshift_tools-0.2.0/src/redshift_tools/base.py
0.758332
0.414069
base.py
pypi
# Copyright (C) 2022 ETH Zurich, # Institute for Particle Physics and Astrophysics # Author: Silvan Fischbacher & Tomasz Kacprzak import numpy as np from scipy.optimize import bisect from scipy.interpolate import interp1d def resample(xp, x, y, interp_kind="linear"): """ Resample a distribution with a given...
/redshift_tools-0.2.0.tar.gz/redshift_tools-0.2.0/src/redshift_tools/manipulate.py
0.897226
0.651105
manipulate.py
pypi
from psycopg2.sql import SQL, Identifier, Literal FIND_PRIMARY_KEY_COLUMNS = SQL("SELECT kcu.ordinal_position column_position, \ kcu.column_name column_name FROM \ information_schema.table_constraints tco \ JOIN information_schema.key_column_usage kcu ON kcu.constraint_name = \ tco.const...
/redshift-upload-1.0.1.tar.gz/redshift-upload-1.0.1/redshift_upload/queries.py
0.490968
0.237631
queries.py
pypi
from django.db.models import loading, Q from catalog import settings as catalog_settings from django.conf import settings import warnings def connected_models(): for model_str in catalog_settings.CATALOG_MODELS: if type(model_str) in (list, tuple): applabel = model_str[0] model_nam...
/redsolutioncms.django-catalog-2.0.2.tar.gz/redsolutioncms.django-catalog-2.0.2/catalog/utils.py
0.477067
0.152221
utils.py
pypi
from django.db import models, connection from django.db.models import FieldDoesNotExist, PositiveIntegerField # Almost clone of mptt.__init__ file. # Contains overrides for objects in catalog work properly __all__ = ('register',) class AlreadyRegistered(Exception): """ An attempt was made to register a model ...
/redsolutioncms.django-catalog-2.0.2.tar.gz/redsolutioncms.django-catalog-2.0.2/catalog/dummy_mptt.py
0.646237
0.185136
dummy_mptt.py
pypi
import datetime from django.conf import settings from django.core.urlresolvers import reverse from django.utils.dateformat import format from menuproxy.proxies import MenuProxy, FlatProxy, DoesNotDefined from easy_news.models import News EASY_NEWS_MENU_LEVEL = getattr(settings, 'EASY_NEWS_MENU_LEVEL', 3) class RootP...
/redsolutioncms.django-easy-news-0.2.4.tar.gz/redsolutioncms.django-easy-news-0.2.4/easy_news/menu.py
0.458349
0.188679
menu.py
pypi
import time from django import forms from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode from ratings import cookies, exceptions try: from django.utils.crypto import salted_hmac, constant_time_compare except ImportError: from ratings.utils import salted_h...
/redsolutioncms.django-generic-ratings-0.6.1.tar.gz/redsolutioncms.django-generic-ratings-0.6.1/ratings/forms/__init__.py
0.655336
0.213541
__init__.py
pypi