repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
eubr-bigsea/py-st-dbscan | https://github.com/eubr-bigsea/py-st-dbscan/blob/297ccef21266dbd6b7e416c0ddf915f492ca8a64/python/src/stdbscan.py | python/src/stdbscan.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import timedelta
import pyproj
class STDBSCAN(object):
def __init__(self, spatial_threshold=500.0, temporal_threshold=60.0,
min_neighbors=15):
"""
Python ST-DBSCAN implementation.
Because this algorithm needs ... | python | Apache-2.0 | 297ccef21266dbd6b7e416c0ddf915f492ca8a64 | 2026-01-05T07:13:36.685442Z | false |
eubr-bigsea/py-st-dbscan | https://github.com/eubr-bigsea/py-st-dbscan/blob/297ccef21266dbd6b7e416c0ddf915f492ca8a64/python/src/coordinates.py | python/src/coordinates.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pyproj
def convert_to_utm(df, src_epsg, dst_epsg, col_lat, col_lon, alias_lon=None,
alias_lat=None):
"""
Cython wrapper to converts from geographic (longitude,latitude)
to native map projection (x,y) coordinates. Values of x and y a... | python | Apache-2.0 | 297ccef21266dbd6b7e416c0ddf915f492ca8a64 | 2026-01-05T07:13:36.685442Z | false |
eubr-bigsea/py-st-dbscan | https://github.com/eubr-bigsea/py-st-dbscan/blob/297ccef21266dbd6b7e416c0ddf915f492ca8a64/python/src/test_st_dbscan.py | python/src/test_st_dbscan.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import datetime
import pandas as pd
import numpy as np
from stdbscan import STDBSCAN
from coordinates import convert_to_utm
def parse_dates(x):
return datetime.strptime(x, '%Y-%m-%d %H:%M:%S.%f')
def plot_clusters(df, output_name):
import matplot... | python | Apache-2.0 | 297ccef21266dbd6b7e416c0ddf915f492ca8a64 | 2026-01-05T07:13:36.685442Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/demo_image.py | demo_image.py | # general includes
import os, sys
import argparse
import numpy as np
from PIL import Image
import cv2
import matplotlib.pyplot as plt
from collections import OrderedDict
from copy import deepcopy
# pytorch includes
import torch
import torch.nn.functional as F
from torch.autograd import Variable
# custom includes
impo... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/demo_video.py | demo_video.py | # general includes
import os, sys
import argparse
import numpy as np
from PIL import Image
import cv2
import matplotlib.pyplot as plt
from collections import OrderedDict
from copy import deepcopy
import re
import skvideo.io
# pytorch includes
import torch
import torch.nn.functional as F
from torch.autograd import Vari... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/__init__.py | __init__.py | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false | |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/models/__init__.py | models/__init__.py | from __future__ import absolute_import
from .google import *
| python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/models/google/inception3_spg.py | models/google/inception3_spg.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from torch.autograd import Variable
import os
import cv2
import numpy as np
__all__ = ['Inception3', 'inception_v3']
model_urls = {
# Inception v3 ported from TensorFlow
'inception_v3_google': 'https... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/models/google/__init__.py | models/google/__init__.py | from . import *
__all__=[
'inception3_spg',
]
| python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/Metrics.py | utils/Metrics.py | import torch
import cv2
import numpy as np
def accuracy(logits, target, topk=(1,)):
'''
Compute the top k accuracy of classification results.
:param target: the ground truth label
:param topk: tuple or list of the expected k values.
:return: A list of the accuracy values. The list has the same leng... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/LoadData.py | utils/LoadData.py | # from torchvision import transforms
from .transforms import transforms
from torch.utils.data import DataLoader
from .mydataset import dataset as my_dataset, dataset_with_mask
import torchvision
import torch
import numpy as np
def data_loader(args, test_path=False, segmentation=False):
if 'coco' in args.dataset:
... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/avgMeter.py | utils/avgMeter.py | class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
self.sum += val... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/visualize.py | utils/visualize.py | from graphviz import Digraph
import torch
from torch.autograd import Variable
def make_dot(var, params=None):
""" Produces Graphviz representation of PyTorch autograd graph
Blue nodes are the Variables that require grad, orange are Tensors
saved for backward in torch.autograd.Function
Args:
... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/tensorboard.py | utils/tensorboard.py |
from tensorboardX import SummaryWriter
import os
if not os.path.exists('../log'):
os.mkdir('../log')
writer = SummaryWriter(log_dir='../log')
| python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/Restore.py | utils/Restore.py | import os
import torch
__all__ = ['restore']
def restore(args, model, optimizer, istrain=True, including_opt=False):
if os.path.isfile(args.restore_from) and ('.pth' in args.restore_from):
snapshot = args.restore_from
else:
restore_dir = args.snapshot_dir
filelist = os.listdir(restore_... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/__init__.py | utils/__init__.py | from .avgMeter import *
| python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/save_atten.py | utils/save_atten.py | import numpy as np
import cv2
import os
import torch
import os
import time
from torchvision import models, transforms
from torch.utils.data import DataLoader
from torch.optim import SGD
from torch.autograd import Variable
idx2catename = {'voc20': ['aeroplane','bicycle','bird','boat','bottle','bus','car','cat','chair',... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/save_mask.py | utils/save_mask.py | from PIL import Image
import numpy as np
# Colour map.
label_colours = [(0,0,0)
# 0=background
,(128,0,0),(0,128,0),(128,128,0),(0,0,128),(128,0,128)
# 1=aeroplane, 2=bicycle, 3=bird, 4=boat, 5=bottle
,(0,128,128),(128,128,128),(64,0,0),(192,0,0),(64,128,... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/mydataset.py | utils/mydataset.py | from torch.utils.data import Dataset
import numpy as np
import os
import torch
from PIL import Image
import random
# from .transforms import functional
# random.seed(1234)
# from .transforms import functional
import cv2
import math
class dataset(Dataset):
"""Face Landmarks dataset."""
def __init__(self, data... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/save_det_heatmap.py | utils/save_det_heatmap.py |
import os
import cv2
import numpy as np
idx2catename = {'voc20': ['aeroplane','bicycle','bird','boat','bottle','bus','car','cat','chair','cow','diningtable','dog','horse',
'motorbike','person','pottedplant','sheep','sofa','train','tvmonitor']}
def get_imgId(path_str):
return path_str.... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/transforms/functional.py | utils/transforms/functional.py | from __future__ import division
import torch
import math
import random
from PIL import Image, ImageOps, ImageEnhance
try:
import accimage
except ImportError:
accimage = None
import numpy as np
import numbers
import types
import collections
import warnings
def _is_pil_image(img):
if accimage is not None:
... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/transforms/__init__.py | utils/transforms/__init__.py | from .transforms import * | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/utils/transforms/transforms.py | utils/transforms/transforms.py | from __future__ import division
import torch
import math
import random
from PIL import Image, ImageOps, ImageEnhance
try:
import accimage
except ImportError:
accimage = None
import numpy as np
import numbers
import types
import collections
import warnings
from . import functional as F
__all__ = ["Compose", "T... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/exper/val_frame.py | exper/val_frame.py | import sys
sys.path.append('../')
import torch
import torch.nn as nn
import argparse
import torch.optim as optim
import os
from tqdm import tqdm
import time
import numpy as np
from torchvision import models, transforms
from torch.utils.data import DataLoader
import shutil
import collections
from torch.optim import SGD... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/exper/my_optim.py | exper/my_optim.py | import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
import numpy as np
def get_finetune_optimizer(args, model):
lr = args.lr
weight_list = []
bias_list = []
last_weight_list = []
last_bias_list =[]
for name,value in model.named_parameters():
if 'cls' in name:
... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
xiaomengyc/SPG | https://github.com/xiaomengyc/SPG/blob/0006659c5be4c3451f8c9a188f1e91e9ff682fa9/exper/train_frame.py | exper/train_frame.py | import sys
sys.path.append('../')
import torch
import torch.nn as nn
import argparse
import os
import time
from torchvision import models, transforms
from torch.utils.data import DataLoader
import shutil
import json
import collections
import datetime
import my_optim
import torch.nn.functional as F
from models import *... | python | MIT | 0006659c5be4c3451f8c9a188f1e91e9ff682fa9 | 2026-01-05T07:13:29.995689Z | false |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/setup.py | setup.py | from pkg_resources import parse_requirements
from pathlib import Path
from setuptools import setup
exec(open("src/KubeLibrary/version.py").read())
with open("README.md", "r") as fh:
long_description = fh.read()
with Path("requirements.txt").open() as requirements:
install_requires = [
str(requirement... | python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | false |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/src/KubeLibrary/exceptions.py | src/KubeLibrary/exceptions.py | class BearerTokenWithPrefixException(Exception):
ROBOT_SUPPRESS_NAME = True
def __init__(self):
super().__init__("Unnecessary 'Bearer ' prefix in token")
pass
| python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | false |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/src/KubeLibrary/version.py | src/KubeLibrary/version.py | version = "0.8.10"
| python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | false |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/src/KubeLibrary/KubeLibrary.py | src/KubeLibrary/KubeLibrary.py | import ast
import json
import re
import ssl
import urllib3
from os import environ
from kubernetes import client, config, dynamic, stream
from robot.api import logger
from robot.api.deco import library
from string import digits, ascii_lowercase
from random import choices
from KubeLibrary.exceptions import BearerTokenW... | python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | true |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/src/KubeLibrary/__init__.py | src/KubeLibrary/__init__.py | from .KubeLibrary import KubeLibrary # noqa: F401
| python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | false |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/test/test_KubeLibrary.py | test/test_KubeLibrary.py | import json
import mock
import re
import ssl
import unittest
from KubeLibrary import KubeLibrary
from KubeLibrary.exceptions import BearerTokenWithPrefixException
from kubernetes.config.config_exception import ConfigException
from urllib3_mock import Responses
class AttributeDict(object):
"""
Based on http://... | python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | true |
devopsspiral/KubeLibrary | https://github.com/devopsspiral/KubeLibrary/blob/84532618cbf4a453fa307ab7d1747f465a8bd8ee/test/__init__.py | test/__init__.py | python | MIT | 84532618cbf4a453fa307ab7d1747f465a8bd8ee | 2026-01-05T07:13:37.979754Z | false | |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/setup.py | setup.py | #! /usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst', 'r') as f:
long_description = f.read()
setup_params = dict(
name='fontParts',
description=("An API for interacting with the parts of fonts "
"during the font development process."),
author='Just... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/ui.py | Lib/fontParts/ui.py | from fontParts.world import _EnvironmentDispatcher
def AskString(message, value='', title='FontParts'):
"""
An ask a string dialog, a `message` is required.
Optionally a `value` and `title` can be provided.
::
from fontParts.ui import AskString
print(AskString("who are you?"))
"... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/__init__.py | Lib/fontParts/__init__.py | try:
from ._version import __version__
except ImportError:
try:
from setuptools_scm import get_version
__version__ = get_version()
except ImportError:
__version__ = 'unknown'
| python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/world.py | Lib/fontParts/world.py | import os
import glob
def OpenFonts(directory=None, showInterface=True, fileExtensions=None):
"""
Open all fonts with the given **fileExtensions** located in
**directory**. If **directory** is ``None``, a dialog for
selecting a directory will be opened. **directory** may also
be a list of directori... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/contour.py | Lib/fontParts/base/contour.py | from fontParts.base.errors import FontPartsError
from fontParts.base.base import (
BaseObject,
TransformationMixin,
InterpolationMixin,
SelectionMixin,
IdentifierMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.compatibility import ContourCompati... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/compatibility.py | Lib/fontParts/base/compatibility.py | from fontParts.base.base import dynamicProperty
# ----
# Base
# ----
class BaseCompatibilityReporter(object):
objectName = "Base"
def __init__(self, obj1, obj2):
self._object1 = obj1
self._object2 = obj2
# status
fatal = False
warning = False
def _get_title(self):
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/lib.py | Lib/fontParts/base/lib.py | from fontParts.base.base import BaseDict, dynamicProperty, reference
from fontParts.base import normalizers
from fontParts.base.deprecated import DeprecatedLib, RemovedLib
class BaseLib(BaseDict, DeprecatedLib, RemovedLib):
"""
A Lib object. This object normally created as part of a
:class:`BaseFont`. An... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/image.py | Lib/fontParts/base/image.py | from fontTools.misc import transform
from fontParts.base.base import (
BaseObject,
TransformationMixin,
PointPositionMixin,
SelectionMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.color import Color
from fontParts.base.deprecated import DeprecatedI... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/deprecated.py | Lib/fontParts/base/deprecated.py | import warnings
# A collection of deprecated roboFab methods.
# Those methods are added to keep scripts and code compatible.
class RemovedError(Exception):
"""Exception for things removed from FontParts that were in RoboFab"""
# ========
# = base =
# ========
class RemovedBase(object):
def setParent(self... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/font.py | Lib/fontParts/base/font.py | import os
from fontTools import ufoLib
from fontParts.base.errors import FontPartsError
from fontParts.base.base import dynamicProperty, InterpolationMixin
from fontParts.base.layer import _BaseGlyphVendor
from fontParts.base import normalizers
from fontParts.base.compatibility import FontCompatibilityReporter
from fon... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/segment.py | Lib/fontParts/base/segment.py | from fontParts.base.errors import FontPartsError
from fontParts.base.base import (
BaseObject,
TransformationMixin,
InterpolationMixin,
SelectionMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.deprecated import DeprecatedSegment, RemovedSegment
from... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/layer.py | Lib/fontParts/base/layer.py | from fontParts.base.base import (
BaseObject,
InterpolationMixin,
SelectionMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.compatibility import LayerCompatibilityReporter
from fontParts.base.color import Color
from fontParts.base.deprecated import Depre... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/bPoint.py | Lib/fontParts/base/bPoint.py | from fontTools.misc import transform
from fontParts.base.base import (
BaseObject,
TransformationMixin,
SelectionMixin,
IdentifierMixin,
dynamicProperty,
reference
)
from fontParts.base.errors import FontPartsError
from fontParts.base import normalizers
from fontParts.base.deprecated import Depr... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/point.py | Lib/fontParts/base/point.py | from fontTools.misc import transform
from fontParts.base.base import (
BaseObject,
TransformationMixin,
PointPositionMixin,
SelectionMixin,
IdentifierMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.deprecated import DeprecatedPoint, RemovedPoint... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/guideline.py | Lib/fontParts/base/guideline.py | import math
from fontTools.misc import transform
from fontParts.base.base import (
BaseObject,
TransformationMixin,
InterpolationMixin,
SelectionMixin,
PointPositionMixin,
IdentifierMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.compatibili... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/glyph.py | Lib/fontParts/base/glyph.py | try:
from itertools import zip_longest as zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
import collections
import os
from copy import deepcopy
from fontParts.base.errors import FontPartsError
from fontParts.base.base import (
BaseObject,
TransformationMixin,
Inter... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/groups.py | Lib/fontParts/base/groups.py | from fontParts.base.base import BaseDict, dynamicProperty, reference
from fontParts.base import normalizers
from fontParts.base.deprecated import DeprecatedGroups, RemovedGroups
class BaseGroups(BaseDict, DeprecatedGroups, RemovedGroups):
"""
A Groups object. This object normally created as part of a
:cl... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/component.py | Lib/fontParts/base/component.py | from fontTools.misc import transform
from fontParts.base import normalizers
from fontParts.base.errors import FontPartsError
from fontParts.base.base import (
BaseObject,
TransformationMixin,
InterpolationMixin,
PointPositionMixin,
SelectionMixin,
IdentifierMixin,
dynamicProperty,
refere... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/anchor.py | Lib/fontParts/base/anchor.py | from fontTools.misc import transform
from fontParts.base import normalizers
from fontParts.base.base import (
BaseObject, TransformationMixin, InterpolationMixin, SelectionMixin,
PointPositionMixin, IdentifierMixin, dynamicProperty, reference
)
from fontParts.base.compatibility import AnchorCompatibilityReporte... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/errors.py | Lib/fontParts/base/errors.py | # -------------------
# Universal Exception
# -------------------
class FontPartsError(Exception):
pass
| python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/normalizers.py | Lib/fontParts/base/normalizers.py | # -*- coding: utf8 -*-
from collections import Counter
from fontTools.misc.fixedTools import otRound
# ----
# Font
# ----
def normalizeFileFormatVersion(value):
"""
Normalizes a font's file format version.
* **value** must be a :ref:`type-int`.
* Returned value will be a ``int``.
"""
if not... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/__init__.py | Lib/fontParts/base/__init__.py | from fontParts.base.errors import FontPartsError
from fontParts.base.font import BaseFont
from fontParts.base.info import BaseInfo
from fontParts.base.groups import BaseGroups
from fontParts.base.kerning import BaseKerning
from fontParts.base.features import BaseFeatures
from fontParts.base.lib import BaseLib
from font... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/kerning.py | Lib/fontParts/base/kerning.py | from fontParts.base.base import (
BaseDict,
dynamicProperty,
interpolate,
reference
)
from fontParts.base import normalizers
from fontParts.base.deprecated import DeprecatedKerning, RemovedKerning
class BaseKerning(BaseDict, DeprecatedKerning, RemovedKerning):
"""
A Kerning object. This objec... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/info.py | Lib/fontParts/base/info.py | from fontParts.base.base import (
BaseObject,
dynamicProperty,
interpolate,
reference
)
from fontParts.base import normalizers
from fontParts.base.errors import FontPartsError
from fontParts.base.deprecated import DeprecatedInfo, RemovedInfo
class BaseInfo(BaseObject, DeprecatedInfo, RemovedInfo):
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/color.py | Lib/fontParts/base/color.py | class Color(tuple):
"""
An color object. This follows the :ref:`type-color`.
"""
def _get_r(self):
return self[0]
r = property(_get_r,
"The color's red component as :ref:`type-int-float`.")
def _get_g(self):
return self[1]
g = property(_get_g,
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/base.py | Lib/fontParts/base/base.py | import math
from copy import deepcopy
from fontTools.misc import transform
from fontParts.base.errors import FontPartsError
from fontParts.base import normalizers
# -------
# Helpers
# -------
class dynamicProperty(object):
"""
This implements functionality that is very similar
to Python's built in prop... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/base/features.py | Lib/fontParts/base/features.py | from fontParts.base.base import BaseObject, dynamicProperty, reference
from fontParts.base import normalizers
from fontParts.base.deprecated import DeprecatedFeatures, RemovedFeatures
class BaseFeatures(BaseObject, DeprecatedFeatures, RemovedFeatures):
copyAttributes = ("text",)
def _reprContents(self):
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_contour.py | Lib/fontParts/test/test_contour.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestContour(unittest.TestCase):
def getContour_bounds(self):
contour, _ = self.objectGenerator("contour")
contour.appendPoint((0, 0), "line")
contour.appendPoint((0, 100), "line")
contour.appendPoin... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_color.py | Lib/fontParts/test/test_color.py | import unittest
from fontParts.base.color import Color
class TestComponent(unittest.TestCase):
def test_color_r(self):
color = Color((1.0, 0, 0, 0))
self.assertEqual(color.r, 1.0)
def test_color_g(self):
color = Color((0, 1.0, 0, 0))
self.assertEqual(color.g, 1.0)
def te... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_fuzzyNumber.py | Lib/fontParts/test/test_fuzzyNumber.py | import unittest
from fontParts.base.base import FuzzyNumber
class TestFuzzyNumber(unittest.TestCase):
def __init__(self, methodName):
unittest.TestCase.__init__(self, methodName)
def test_init(self):
fuzzyNumber1 = FuzzyNumber(value=0, threshold=1)
fuzzyNumber2 = FuzzyNumber(2, 3)
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_normalizers.py | Lib/fontParts/test/test_normalizers.py | import unittest
from fontParts.base import normalizers
class TestNormalizers(unittest.TestCase):
# ----
# Font
# ----
def getFont_layers(self):
font, _ = self.objectGenerator("font")
for name in ["A", "B", "C", "D", "E"]:
font.newLayer(name)
return font
# nor... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_glyph.py | Lib/fontParts/test/test_glyph.py | import unittest
import collections
from fontParts.base import FontPartsError
from .test_image import testImageData
class TestGlyph(unittest.TestCase):
def getGlyph_generic(self):
glyph, _ = self.objectGenerator("glyph")
glyph.name = "Test Glyph 1"
glyph.unicode = int(ord("X"))
gly... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_features.py | Lib/fontParts/test/test_features.py | import unittest
import collections
class TestFeatures(unittest.TestCase):
def getFeatures_generic(self):
features, _ = self.objectGenerator("features")
features.text = "# test"
return features
# ----
# repr
# ----
def test_reprContents(self):
font, _ = self.objec... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_guideline.py | Lib/fontParts/test/test_guideline.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestGuideline(unittest.TestCase):
def getGuideline_generic(self):
guideline, _ = self.objectGenerator("guideline")
guideline.x = 1
guideline.y = 2
guideline.angle = 90
guideline.name = "Test... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_bPoint.py | Lib/fontParts/test/test_bPoint.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestBPoint(unittest.TestCase):
def getBPoint_corner(self):
contour, _ = self.objectGenerator("contour")
contour.appendPoint((0, 0), "move")
contour.appendPoint((101, 202), "line")
contour.appendPoin... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_groups.py | Lib/fontParts/test/test_groups.py | import unittest
import collections
class TestGroups(unittest.TestCase):
def getGroups_generic(self):
groups, _ = self.objectGenerator("groups")
groups.update({
"group 1": ["A", "B", "C"],
"group 2": ["x", "y", "z"],
"group 3": [],
"group 4": ["A"]
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_anchor.py | Lib/fontParts/test/test_anchor.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestAnchor(unittest.TestCase):
def getAnchor_generic(self):
anchor, _ = self.objectGenerator("anchor")
anchor.name = "Anchor Attribute Test"
anchor.x = 1
anchor.y = 2
anchor.color = None
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_image.py | Lib/fontParts/test/test_image.py | import unittest
import collections
from fontParts.base import FontPartsError
testPNGData = """
89504e470d0a1a0a0000000d4948445200000080000000800806000000c33e61cb0000
02ee694343504943432050726f66696c65000078018554cf6b134114fe366ea9d02208
5a6b0eb27890224959ab6845d436fd11626b0cdb1fb64590643349d66e36ebee26b5a5
88e4e2d12ad... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_deprecated.py | Lib/fontParts/test/test_deprecated.py | import unittest
from fontParts.base.deprecated import RemovedError
class TestDeprecated(unittest.TestCase):
# ----
# Font
# ----
def getFont_glyphs(self):
font, _ = self.objectGenerator("font")
for name in "ABCD":
font.newGlyph(name)
return font
def test_font... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | true |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_font.py | Lib/fontParts/test/test_font.py | import unittest
import collections
import tempfile
import os
import shutil
class TestFont(unittest.TestCase):
# ------
# Layers
# ------
def getFont_layers(self):
font, _ = self.objectGenerator("font")
for name in "ABCD":
font.newLayer("layer " + name)
return font... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_segment.py | Lib/fontParts/test/test_segment.py | import unittest
import collections
class TestSegment(unittest.TestCase):
def getSegment_line(self):
contour, unrequested = self.objectGenerator("contour")
unrequested.append(contour)
contour.appendPoint((0, 0), "move")
contour.appendPoint((101, 202), "line")
segment = cont... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/legacyPointPen.py | Lib/fontParts/test/legacyPointPen.py | from fontPens.recordingPointPen import RecordingPointPen
class LegacyPointPen(RecordingPointPen):
"""
A point pen that accepts only the original
arguments in the various methods.
"""
def beginPath(self):
super(LegacyPointPen, self).beginPath()
def endPath(self):
super(Legacy... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_component.py | Lib/fontParts/test/test_component.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestComponent(unittest.TestCase):
def getComponent_generic(self):
layer, _ = self.objectGenerator("layer")
glyph = layer.newGlyph("A")
pen = glyph.getPen()
pen.moveTo((0, 0))
pen.lineTo((0, ... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/__init__.py | Lib/fontParts/test/__init__.py | from __future__ import print_function
import sys
import unittest
from fontParts.test import test_normalizers
from fontParts.test import test_font
from fontParts.test import test_info
from fontParts.test import test_groups
from fontParts.test import test_kerning
from fontParts.test import test_features
from fontParts.te... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_point.py | Lib/fontParts/test/test_point.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestPoint(unittest.TestCase):
def getPoint_generic(self):
contour, _ = self.objectGenerator("contour")
contour.appendPoint((0, 0), "move")
contour.appendPoint((101, 202), "line")
point = contour.poi... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_kerning.py | Lib/fontParts/test/test_kerning.py | import unittest
import collections
class TestKerning(unittest.TestCase):
def getKerning_generic(self):
font, _ = self.objectGenerator("font")
groups = font.groups
groups["public.kern1.X"] = ["A", "B", "C"]
groups["public.kern2.X"] = ["A", "B", "C"]
kerning = font.kerning
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_lib.py | Lib/fontParts/test/test_lib.py | import unittest
import collections
class TestLib(unittest.TestCase):
def getLib_generic(self):
lib, _ = self.objectGenerator("lib")
lib.update({
"key 1": ["A", "B", "C"],
"key 2": "x",
"key 3": [],
"key 4": 20
})
return lib
# --... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_world.py | Lib/fontParts/test/test_world.py | import unittest
import tempfile
import os
from fontParts.world import RFont, FontList, OpenFont, OpenFonts
class TestFontList(unittest.TestCase):
def getFont(self):
font, _ = self.objectGenerator("font")
return font
# ----
# Sort
# ----
def getFonts_sortBy(self, attr, values):
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_layer.py | Lib/fontParts/test/test_layer.py | import unittest
import collections
class TestLayer(unittest.TestCase):
# ------
# Glyphs
# ------
def getLayer_glyphs(self):
layer, _ = self.objectGenerator("layer")
for name in "ABCD":
layer.newGlyph(name)
return layer
def test_len(self):
layer = sel... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/test/test_info.py | Lib/fontParts/test/test_info.py | import unittest
import collections
class TestInfo(unittest.TestCase):
def getInfo_generic(self):
info, _ = self.objectGenerator("info")
info.unitsPerEm = 1000
return info
# ----------
# Dimensions
# ----------
def test_get_unitsPerEm(self):
info = self.getInfo_ge... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/contour.py | Lib/fontParts/fontshell/contour.py | import defcon
from fontParts.base import BaseContour
from fontParts.fontshell.base import RBaseObject
from fontParts.fontshell.point import RPoint
from fontParts.fontshell.segment import RSegment
from fontParts.fontshell.bPoint import RBPoint
class RContour(RBaseObject, BaseContour):
wrapClass = defcon.Contour
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/lib.py | Lib/fontParts/fontshell/lib.py | import defcon
from fontParts.base import BaseLib
from fontParts.fontshell.base import RBaseObject
class RLib(RBaseObject, BaseLib):
wrapClass = defcon.Lib
def _items(self):
return self.naked().items()
def _contains(self, key):
return key in self.naked()
def _setItem(self, key, valu... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/image.py | Lib/fontParts/fontshell/image.py | import defcon
from fontParts.base import BaseImage, FontPartsError
from fontParts.fontshell.base import RBaseObject
class RImage(RBaseObject, BaseImage):
wrapClass = defcon.Image
_orphanData = None
_orphanColor = None
# ----------
# Attributes
# ----------
# Transformation
def _get... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/font.py | Lib/fontParts/fontshell/font.py | import defcon
import os
from fontParts.base import BaseFont
from fontParts.fontshell.base import RBaseObject
from fontParts.fontshell.info import RInfo
from fontParts.fontshell.groups import RGroups
from fontParts.fontshell.kerning import RKerning
from fontParts.fontshell.features import RFeatures
from fontParts.fontsh... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/segment.py | Lib/fontParts/fontshell/segment.py | from fontParts.base import BaseSegment
from fontParts.fontshell.base import RBaseObject
class RSegment(BaseSegment, RBaseObject):
pass
| python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/layer.py | Lib/fontParts/fontshell/layer.py | import defcon
from fontParts.base import BaseLayer
from fontParts.fontshell.base import RBaseObject
from fontParts.fontshell.lib import RLib
from fontParts.fontshell.glyph import RGlyph
class RLayer(RBaseObject, BaseLayer):
wrapClass = defcon.Layer
libClass = RLib
glyphClass = RGlyph
# -----------
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/bPoint.py | Lib/fontParts/fontshell/bPoint.py | from fontParts.base import BaseBPoint
from fontParts.fontshell.base import RBaseObject
class RBPoint(BaseBPoint, RBaseObject):
pass
| python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/point.py | Lib/fontParts/fontshell/point.py | import defcon
from fontParts.base import BasePoint, FontPartsError
from fontParts.fontshell.base import RBaseObject
class RPoint(RBaseObject, BasePoint):
wrapClass = defcon.Point
def _init(self, wrap=None):
if wrap is None:
wrap = self.wrapClass((0, 0))
super(RPoint, self)._init(... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/guideline.py | Lib/fontParts/fontshell/guideline.py | import defcon
from fontParts.base import BaseGuideline
from fontParts.fontshell.base import RBaseObject
class RGuideline(RBaseObject, BaseGuideline):
wrapClass = defcon.Guideline
def _init(self, wrap=None):
if wrap is None:
wrap = self.wrapClass()
wrap.x = 0
wrap.... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/glyph.py | Lib/fontParts/fontshell/glyph.py | import defcon
import booleanOperations
from fontParts.base import BaseGlyph
from fontParts.base.errors import FontPartsError
from fontParts.fontshell.base import RBaseObject
from fontParts.fontshell.contour import RContour
from fontParts.fontshell.component import RComponent
from fontParts.fontshell.anchor import RAnch... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/groups.py | Lib/fontParts/fontshell/groups.py | import defcon
from fontParts.base import BaseGroups
from fontParts.fontshell.base import RBaseObject
class RGroups(RBaseObject, BaseGroups):
wrapClass = defcon.Groups
def _get_side1KerningGroups(self):
return self.naked().getRepresentation("defcon.groups.kerningSide1Groups")
def _get_side2Kerni... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/component.py | Lib/fontParts/fontshell/component.py | import defcon
from fontParts.base import BaseComponent
from fontParts.fontshell.base import RBaseObject
class RComponent(RBaseObject, BaseComponent):
wrapClass = defcon.Component
# ----------
# Attributes
# ----------
# baseGlyph
def _get_baseGlyph(self):
return self.naked().baseGl... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/anchor.py | Lib/fontParts/fontshell/anchor.py | import defcon
from fontParts.base import BaseAnchor
from fontParts.fontshell.base import RBaseObject
class RAnchor(RBaseObject, BaseAnchor):
wrapClass = defcon.Anchor
def _init(self, wrap=None):
if wrap is None:
wrap = self.wrapClass()
wrap.x = 0
wrap.y = 0
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/__init__.py | Lib/fontParts/fontshell/__init__.py | from fontParts.base.errors import FontPartsError
from fontParts.fontshell.font import RFont
from fontParts.fontshell.info import RInfo
from fontParts.fontshell.groups import RGroups
from fontParts.fontshell.kerning import RKerning
from fontParts.fontshell.features import RFeatures
from fontParts.fontshell.lib import RL... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/kerning.py | Lib/fontParts/fontshell/kerning.py | import defcon
from fontParts.base import BaseKerning
from fontParts.fontshell.base import RBaseObject
class RKerning(RBaseObject, BaseKerning):
wrapClass = defcon.Kerning
def _items(self):
return self.naked().items()
def _contains(self, key):
return key in self.naked()
def _setItem... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/info.py | Lib/fontParts/fontshell/info.py | import defcon
from fontParts.base import BaseInfo
from fontParts.fontshell.base import RBaseObject
class RInfo(RBaseObject, BaseInfo):
wrapClass = defcon.Info
def _getAttr(self, attr):
return getattr(self.naked(), attr)
def _setAttr(self, attr, value):
setattr(self.naked(), attr, value)... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
robotools/fontParts | https://github.com/robotools/fontParts/blob/cb4b90defb59d967d209d254659d7265fc1abd86/Lib/fontParts/fontshell/base.py | Lib/fontParts/fontshell/base.py | class RBaseObject(object):
wrapClass = None
def _init(self, wrap=None):
if wrap is None and self.wrapClass is not None:
wrap = self.wrapClass()
if wrap is not None:
self._wrapped = wrap
def changed(self):
self.naked().dirty = True
def naked(self):
... | python | MIT | cb4b90defb59d967d209d254659d7265fc1abd86 | 2026-01-05T07:13:38.892524Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.