section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
meshes
mesh_thermomech_flow1d_seg3
def create_nodes(femmesh): # nodes femmesh.addNode(0, 0, 50, 1) femmesh.addNode(0, 0, -50, 2) femmesh.addNode(0, 0, -4300, 3) femmesh.addNode(4950, 0, -4300, 4) femmesh.addNode(5000, 0, -4300, 5) femmesh.addNode(8535.53, 0, -7835.53, 6) femmesh.addNode(8569.88, 0, -7870.88, 7) femmes...
scripts
color_hex_interpolate
#!/usr/bin/env python3 import argparse def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( "start_color", help="The start_color color", ) parser.add_argument( "end_color", help="The end_color color", ) parser.add_argument( "--pos",...
migrations
0013_normalization_rules_mov
from django.db import migrations def data_migration(apps, schema_editor): """Create rules for Apple ProRes.""" FPRule = apps.get_model("fpr", "FPRule") format_apple_prores_id = "9dd2784d-fb57-44de-83b2-5cc54703476b" rules = [ { "uuid": "52db06e9-ed12-4ca3-83e6-6e867a171dba", ...
clientScripts
move_to_backlog
#!/usr/bin/env python """Index transfer, create BagIt and send to backlog. The transfer is indexed in Elasticsearch and converted into a BagIt. Finally, we request to Storage Service to copy the transfer in the backlog location. The local copy is removed. PREMIS events are created after this job runs as part of the w...
lib
formatters
# encoding: utf-8 import datetime from typing import Optional import pytz from ckan.common import _ from flask_babel import format_date, format_datetime, format_decimal, format_timedelta def localised_nice_date( datetime_: datetime.datetime, show_date: bool = False, with_hours: bool = False, with_se...
context
page_format
# -*- coding: utf-8 -*- # # Copyright (C) 2013 by Ihor E. Novikov # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
misc
msgbox
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Convenience functions to show message boxes.""" from qutebrowser.misc import objects from qutebrowser.qt.core import Qt from qutebrowser.qt.widgets import QMessageBox from qutebrowser.utils ...
PyObjCTest
test_nsusernotification
import Foundation from PyObjCTools.TestSupport import * try: unicode except NameError: unicode = str class UserNotificationHelper(Foundation.NSObject): def userNotificationCenter_shouldPresentNotification_(self, a, b): pass class TestNSUserNotification(TestCase): @min_os_level("10.8") d...
PyObjCTest
test_nstimer
import gc from Foundation import * from objc import * from PyObjCTools.TestSupport import * class PythonClass(object): def __init__(self): self.fireCount = 0 def fire_(self, timer): self.fireCount += 1 class TestNSTimer(TestCase): def _testHelp(self): obj = PythonClass() ...
blocks
qa_skiphead
#!/usr/bin/env python # # Copyright 2007,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import numpy import pmt from gnuradio import blocks, gr, gr_unittest def make_tag(key, value, offset, srcid=None): tag = gr.tag_t() tag.key =...
constants
plugins
from CTFd.plugins import get_admin_plugin_menu_bar, get_user_page_menu_bar from CTFd.utils.helpers import markup from CTFd.utils.plugins import get_registered_scripts, get_registered_stylesheets from flask import current_app class _PluginWrapper: @property def scripts(self): application_root = current...
migrations
0196_update_property_types
# Generated by Django 3.2.5 on 2022-01-12 10:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0195_group_type_name"), ] operations = [ migrations.RemoveConstraint( model_name="propertydefinition", nam...
history
history_preferences
# Copyright (C) 2011 Dustin Spicuzza # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that...
commands
fake
# -*- coding: utf-8 -*- from datetime import timedelta from decimal import Decimal from random import choice, choices, randint, uniform from core import models from django.core.management.base import BaseCommand from django.db import transaction from django.db.utils import IntegrityError from django.utils import timez...
scripts
refactored_mach3_mach4_post
# *************************************************************************** # * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> * # * Copyright (c) 2022 Larry Woestman <LarryWoestman2@gmail.com> * # * * # * Th...
mackup
mackup
""" The Mackup Class. The Mackup class is keeping all the state that Mackup needs to keep during its runtime. It also provides easy to use interface that is used by the Mackup UI. The only UI for now is the command line. """ import os import os.path import shutil import tempfile from . import appsdb, config, utils ...
extractor
maoritv
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class MaoriTVIE(InfoExtractor): _VALID_URL = ( r"https?://(?:www\.)?maoritelevision\.com/shows/(?:[^/]+/)+(?P<id>[^/?&#]+)" ) _TEST = { "url": "https://www.maoritelevision.com/shows/korero-mai/S01E05...
threads
download_thread
# -*- coding: utf-8 -*- import time import traceback from queue import Queue from ..network.exceptions import Abort, Fail, Reconnect, Retry, Skip from .plugin_thread import PluginThread class DownloadThread(PluginThread): """ thread for downloading files from 'real' downloader plugins. """ # ------...
sk1
app_plugins
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2018 by Ihor E. Novikov # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
misc
nativeeventfilter
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Native Qt event filter. This entire file is a giant WORKAROUND for https://bugreports.qt.io/browse/QTBUG-114334. """ import ctypes import ctypes.util import enum from typing import Optional...
snippet
insert
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
auth-token
crypto
import binascii from os import urandom as generate_bytes from typing import Tuple from apps.auth_token import constants from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.hashes import SHA512 sha = SHA512 def generate_token_...
extractor
vier
# coding: utf-8 from __future__ import unicode_literals import itertools import re from ..utils import int_or_none, unified_strdate, urlencode_postdata from .common import InfoExtractor class VierIE(InfoExtractor): IE_NAME = "vier" IE_DESC = "vier.be and vijf.be" _VALID_URL = r"""(?x) ...
downloaders
MegadyskPl
# -*- coding: utf-8 -*- import base64 import json import re import urllib.parse from ..base.simple_downloader import SimpleDownloader def xor_decrypt(data, key): data = base64.b64decode(data) return "".join( [ chr(ord(x[1]) ^ ord(key[x[0].format(len(key))])) for x in [(i, c) ...
PyObjCTest
test_ctests
""" This is the runner for the tests defined in Modules/objc/unittest.m. Those tests check a number lowlevel features of the bridge. This file provides a nice unittest wrapper around the functions in that file, the code in this file defines a class CTests that has the functions in the unitest.m file as its methods. ""...
views
cloud_connection
from apps.api.permissions import RBACPermission from apps.auth_token.auth import PluginAuthentication from apps.base.models import LiveSetting from apps.base.utils import live_settings from apps.oss_installation.cloud_heartbeat import get_heartbeat_link from apps.oss_installation.models import CloudConnector, CloudHear...
Scene
CuraSceneController
from cura.Machines.Models.MultiBuildPlateModel import MultiBuildPlateModel from cura.Scene.CuraSceneNode import CuraSceneNode from cura.UI.ObjectsModel import ObjectsModel from PyQt6.QtCore import QObject, Qt, QTimer, pyqtSlot from PyQt6.QtWidgets import QApplication from UM.Application import Application from UM.Logge...
PartDesignTests
TestInvoluteGear
# *************************************************************************** # * Copyright (c) 2021 Jonas Bähr <jonas.baehr@web.de> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
beets
random
# This file is part of beets. # Copyright 2016, Philippe Mongeau. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy...
App
LinkParams
import sys from os import path, sys # Actual code generation is done in Base/param_utils.py. # The following code is to import param_util.py without needing __init__.py in Base directory sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), "Base")) import params_utils from params_utils import...
grouptagger
gt_prefs
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 1, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY W...
Machines
QualityChangesGroup
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Any, Dict, Optional from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal class QualityChangesGroup(QObject): """Data struct to group several quality changes instance containers together. ...
utils
zipfile
""" Read and write ZIP files. Modified by Kovid Goyal to support replacing files in a zip archive, detecting filename encoding, updating zip files, etc. """ import binascii import io import os import re import shutil import stat import struct import sys import time from contextlib import closing from tempfile import Sp...
backends
pygame
""" Mido ports for pygame.midi. Pygame uses PortMidi, so this is perhaps not very useful. http://www.pygame.org/docs/ref/midi.html """ from __future__ import absolute_import from pygame import midi from ..ports import BaseInput, BaseOutput def _get_device(device_id): keys = ["interface", "name", "is_input", ...
views
user_notification_policy
from apps.api.permissions import IsOwnerOrHasRBACPermissions, RBACPermission from apps.api.serializers.user_notification_policy import ( UserNotificationPolicySerializer, UserNotificationPolicyUpdateSerializer, ) from apps.auth_token.auth import PluginAuthentication from apps.base.messaging import get_messaging...
schemas
awards
from CTFd.models import Awards, ma from CTFd.utils import string_types class AwardSchema(ma.ModelSchema): class Meta: model = Awards include_fk = True dump_only = ("id", "date") views = { "admin": [ "category", "user_id", "name", ...
transforms
lazy_tables
import dataclasses from typing import Dict, List, Optional, cast from posthog.hogql import ast from posthog.hogql.context import HogQLContext from posthog.hogql.database.models import LazyJoin, LazyTable from posthog.hogql.errors import HogQLException from posthog.hogql.resolver import resolve_types from posthog.hogql...
funnels
base
import urllib.parse import uuid from abc import ABC from typing import Any, Dict, List, Optional, Tuple, Union, cast from posthog.clickhouse.materialized_columns import ColumnName from posthog.constants import ( FUNNEL_WINDOW_INTERVAL, FUNNEL_WINDOW_INTERVAL_UNIT, LIMIT, OFFSET, TREND_FILTER_TYPE_A...
mylar
weeklypullit
# This file is part of Mylar. # # Mylar is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mylar is distributed in the hope that it wi...
parsers
pdf
# This file is a part of Lector, a Qt based ebook reader # Copyright (C) 2017-2019 BasioMeusPuga # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
options
metadata
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2006-2008, 2011 Lukáš Lalinský # Copyright (C) 2008-2009, 2018-2022 Philipp Wolfer # Copyright (C) 2011 Johannes Weißl # Copyright (C) 2011-2013 Michael Wiencek # Copyright (C) 2013, 2018, 2020-2021 Laurent Monin # Copyright (C...
friture
filter
# -*- coding: utf-8 -*- from friture_extensions.lfilter import pyx_lfilter_float64_1D from numpy import arange, array, sqrt, zeros from .signal.decimate import decimate NOCTAVE = 9 def ERBFilterBank(forward, feedback, x): # y=ERBFilterBank(forward, feedback, x) # This function filters the waveform x with th...
lilydoc
network
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
pol
client
from __future__ import absolute_import, division import warnings from twisted.internet import defer, protocol, reactor from twisted.python.failure import Failure from twisted.web._newclient import ( HTTP11ClientProtocol, PotentialDataLoss, Request, RequestGenerationFailed, RequestNotSent, Requ...
Gui
BitLibraryCmd
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
python
audio_to_file
#!/usr/bin/env python # # Copyright 2004,2007,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from argparse import ArgumentParser from gnuradio import audio, blocks, gr from gnuradio.eng_arg import eng_float class my_top_block(gr.top_block): ...
engines
mediathekviewweb
# SPDX-License-Identifier: AGPL-3.0-or-later """MediathekViewWeb (API) """ # pylint: disable=missing-function-docstring import datetime from json import dumps, loads about = { "website": "https://mediathekviewweb.de/", "wikidata_id": "Q27877380", "official_api_documentation": "https://gist.github.com/ba...
engines
www1x
# SPDX-License-Identifier: AGPL-3.0-or-later """ 1x (Images) """ from urllib.parse import urlencode, urljoin from lxml import etree, html from searx.utils import eval_xpath_getindex, eval_xpath_list, extract_text # about about = { "website": "https://1x.com/", "wikidata_id": None, "official_api_document...
lib
automoderator
# The contents of this file are subject to the Common Public Attribution # License Version 1.0. (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, ...
Site
SiteManager
import atexit import json import logging import os import re import time import gevent import util from Config import config from Content import ContentDb from Plugin import PluginManager from util import Cached, RateLimit, helper @PluginManager.acceptPlugins class SiteManager(object): def __init__(self): ...
aliceVision
PanoramaEstimation
__version__ = "1.0" import json import os from meshroom.core import desc class PanoramaEstimation(desc.AVCommandLineNode): commandLine = "aliceVision_panoramaEstimation {allParams}" size = desc.DynamicNodeSize("input") category = "Panorama HDR" documentation = """ Estimate relative camera rotations...
gui
FileDialogs
""" Copyright 2007 Free Software Foundation, Inc. This file is part of GNU Radio SPDX-License-Identifier: GPL-2.0-or-later """ from os import path from gi.repository import Gtk from . import Constants, Dialogs, Utils class FileDialogHelper(Gtk.FileChooserDialog, object): """ A wrapper class for the gtk ...
subtl
subtl
""" Based on the specification at http://bittorrent.org/beps/bep_0015.html """ import binascii import random import socket import struct import time from collections import defaultdict __version__ = "0.0.1" CONNECT = 0 ANNOUNCE = 1 SCRAPE = 2 ERROR = 3 class UdpTrackerClientException(Exception): pass class Ud...
QT
PantallaPGN
import codecs import copy import os from Code import GM, PGN, SQL, ControlPosicion, TrListas, Util, VarGen from Code.QT import ( Colocacion, Columnas, Controles, FormLayout, Grid, Iconos, PantallaAnalisisParam, PantallaBooks, PantallaSavePGN, QTUtil, QTUtil2, QTVarios, )...
api
ingestion_warnings
import json from datetime import timedelta from django.utils.timezone import now from posthog.api.routing import StructuredViewSetMixin from posthog.client import sync_execute from rest_framework import viewsets from rest_framework.request import Request from rest_framework.response import Response class IngestionWa...
migrations
0019_auto_20201130_1939
# Generated by Django 3.0.7 on 2020-11-30 19:39 import bookwyrm.models.fields from django.db import migrations def update_notnull(app_registry, schema_editor): db_alias = schema_editor.connection.alias users = app_registry.get_model("bookwyrm", "User") for user in users.objects.using(db_alias): i...
neubot
updater_runner
# neubot/updater_runner.py # # Copyright (c) 2012 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
temporal
worker
import signal import sys from datetime import timedelta from posthog.temporal.client import connect from posthog.temporal.workflows import ACTIVITIES, WORKFLOWS from temporalio.runtime import PrometheusConfig, Runtime, TelemetryConfig from temporalio.worker import UnsandboxedWorkflowRunner, Worker async def start_wo...
Op
PocketShape
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
saveddata
character
# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of eos. # # eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, ...
lib
brushes_migrate_json
# This file is part of MyPaint. # Copyright (C) 2012-2018 by the MyPaint Development Team. # Copyright (C) 2012 by Jon Nordby <jononor@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation...
OpenSCAD
OpenSCADCommands
# *************************************************************************** # * Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
v12-extra-public-dir
plugin
# encoding: utf-8 import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit from ckan.common import CKANConfig def most_popular_groups(): """Return a sorted list of the groups with the most datasets.""" # Get a list of all the site's groups from CKAN, sorted by number of # datasets. grou...
beetsplug
ipfs
# This file is part of beets. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribu...
downloaders
DebridlinkFr
# -*- coding: utf-8 -*- import json import pycurl from pyload.core.network.http.exceptions import BadHeader from ..base.multi_downloader import MultiDownloader def error_description(error_code): err_message = { "notLink": "Check the 'link' parameter (Empty or bad)", "notDebrid": "Maybe the file...
macosx
icon_drag_eventhandler
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2013 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
xl
formatter
# -*- coding: utf-8 -*- # Copyright (C) 2010 Mathias Brodala # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is dist...
controllers
fleur_ctrl
# -*- coding: utf-8 -*- # # Copyright (C) 2013 by Ihor E. Novikov # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
localDrone
changeMetas
import math import eos.db import gui.mainFrame import wx from gui import globalEvents as GE from gui.fitCommands.calc.drone.localAdd import CalcAddLocalDroneCommand from gui.fitCommands.calc.drone.localRemove import CalcRemoveLocalDroneCommand from gui.fitCommands.helpers import DroneInfo, InternalCommandHistory from ...
feature-flag
permissions
from posthog.constants import AvailableFeature from posthog.models.organization import OrganizationMembership def can_user_edit_feature_flag(request, feature_flag): # self hosted check for enterprise models that may not exist try: from ee.models.feature_flag_role_access import FeatureFlagRoleAccess ...
preferences
two_factor_auth
""" class views for 2FA management """ from datetime import datetime, timedelta import pyotp import qrcode import qrcode.image.svg from bookwyrm import forms, models from bookwyrm.settings import DOMAIN, TWO_FACTOR_LOGIN_MAX_SECONDS from bookwyrm.views.helpers import set_language from django.contrib.auth import login ...
gr
qa_uncaught_exception
#!/usr/bin/env python # # Copyright 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from multiprocessing import Process import numpy from gnuradio import blocks, gr, gr_unittest # This block just exists to pass data through and throw an except...
friture
dockmanager
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2013 Timothée Lecomte # This file is part of Friture. # # Friture is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # Friture is distri...
marketSources
evemarketer
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
cssselect
xpath
# coding: utf8 """ cssselect.xpath =============== Translation of parsed CSS selectors to XPath expressions. :copyright: (c) 2007-2012 Ian Bicking and contributors. See AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import sys from cssselec...
models
on_call_schedule
import copy import datetime import itertools import re import typing from collections import defaultdict from enum import Enum import icalendar import pytz from apps.schedules.constants import ( EXPORT_WINDOW_DAYS_AFTER, EXPORT_WINDOW_DAYS_BEFORE, ICAL_COMPONENT_VEVENT, ICAL_DATETIME_END, ICAL_DATE...
extractor
vtm
# coding: utf-8 from __future__ import unicode_literals from ..utils import int_or_none, parse_iso8601, try_get from .common import InfoExtractor class VTMIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?vtm\.be/([^/?&#]+)~v(?P<id>[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})" _TEST = { "url": "ht...
conversions
releaseJul2020
""" Conversion pack for July 2020 release """ CONVERSIONS = { # Renamed items, extracted via diff file "Basic EM Plating": "'Basic' EM Coating", "EM Plating I": "EM Coating I", "EM Plating II": "EM Coating II", "Basic Explosive Plating": "'Basic' Explosive Coating", "Explosive Plating I": "Expl...
data
surface
# -------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU...
utils
encryption
"""Support for encrypted tests. """ __copyright__ = "Copyright (C) 2015-2017 Martin Blais" __license__ = "GNU GPLv2" import re import subprocess from os import path def is_gpg_installed(): """Return true if GPG 1.4.x or 2.x are installed, which is what we use and support.""" try: pipe = subprocess.P...
Drawing
DrawingTests
import Drawing import Part Part.open("D:/_Projekte/FreeCAD/FreeCADData/Schenkel.stp") App.activeDocument().addObject("Drawing::FeaturePage", "Page") App.activeDocument().Page.Template = ( "D:/_Projekte/FreeCAD/FreeCAD_0.9_LibPack7/Mod/Drawing/Templates/A3_Landscape.svg" ) App.activeDocument().addObject("Drawing::F...
UltimakerMachineActions
UMOUpgradeSelection
# Copyright (c) 2017 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from cura.MachineAction import MachineAction from PyQt6.QtCore import pyqtProperty, pyqtSignal, pyqtSlot from UM.Application import Application from UM.i18n import i18nCatalog from UM.Settings.ContainerRegistry import Co...
migrations
upgrade22
""" Migration 22 - Adds the created and modified fields to most tables """ import sqlalchemy def upgrade(saveddata_engine): # 1 = created only # 2 = created and modified tables = { "boosters": 2, "cargo": 2, "characters": 2, # "crest": 1, "damagePatterns": 2, ...
cli
cli
# encoding: utf-8 from __future__ import annotations import logging import sys from collections import defaultdict from typing import Optional import ckan.cli as ckan_cli import ckan.plugins as p import click from ckan.config.middleware import make_app from ckan.exceptions import CkanConfigurationException from pkg_r...
components
session
from __future__ import annotations import logging import os import sys import time from asyncio import Event, create_task, gather, get_event_loop from pathlib import Path from typing import Dict, List, Optional, Type, TypeVar from tribler.core.components.component import Component from tribler.core.components.excepti...
extractor
tnaflix
from __future__ import unicode_literals import re from ..compat import compat_str from ..utils import ( fix_xml_ampersands, float_or_none, int_or_none, parse_duration, str_to_int, unescapeHTML, xpath_text, ) from .common import InfoExtractor class TNAFlixNetworkBaseIE(InfoExtractor): ...
fitLockTime
getter
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
API
ConnectionStatus
from typing import Optional from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal from UM.TaskManagement.HttpRequestManager import HttpRequestManager class ConnectionStatus(QObject): """Provides an estimation of whether internet is reachable Estimation is updated with every request through HttpRequestM...
utils
misc_utils_test
""" Tests for general utils. """ __copyright__ = "Copyright (C) 2014-2016 Martin Blais" __license__ = "GNU GPLv2" import operator import sys import textwrap import time import unittest from collections import namedtuple from unittest import mock from beancount.utils import misc_utils, test_utils def raise_import_e...
builtinContextMenus
itemMarketJump
import gui.mainFrame import wx from gui.contextMenu import ContextMenuSingle from service.market import Market _t = wx.GetTranslation class JumpToMarketItem(ContextMenuSingle): def __init__(self): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, callingWindow, srcContext, mai...
meshes
mesh_beamsimple_tetra10
def create_nodes(femmesh): # nodes femmesh.addNode(0.0, 0.0, 0.0, 1) femmesh.addNode(0.0, 100.0, 0.0, 2) femmesh.addNode(3000.0, 0.0, 0.0, 3) femmesh.addNode(3000.0, 100.0, 0.0, 4) femmesh.addNode(0.0, 25.0, 0.0, 5) femmesh.addNode(0.0, 50.0, 0.0, 6) femmesh.addNode(0.0, 75.0, 0.0, 7) ...
models
license
from typing import List, Optional from django.contrib.auth import get_user_model from django.db import models from django.db.models import Q from django.db.models.signals import post_save from django.dispatch.dispatcher import receiver from django.utils import timezone from posthog.celery import sync_all_organization_...
gr
qa_random
#!/usr/bin/env python # # Copyright 2006,2007,2010,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import numpy as np from gnuradio import gr, gr_unittest class test_random(gr_unittest.TestCase): # NOTE: For tests on the output distributio...
schedules
ical_utils
from __future__ import annotations import datetime import logging import re import typing from collections import namedtuple from typing import TYPE_CHECKING import pytz import requests from apps.api.permissions import RBACPermission from apps.schedules.constants import ( CALENDAR_TYPE_FINAL, ICAL_ATTENDEE, ...
scripts
create_plugin
""" Creates an empty plugin and links it from ~/.config/deluge/plugins This plugin includes the framework for using the preferences dialog example: python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name" --author-email "yourname@example.com" """ import os import sys from argparse import Argum...
CIMicroPaint
SampleCIView
""" SampleCIView - simple OpenGL based CoreImage view """ import CGL import objc from Cocoa import * from OpenGL.GL import * # XXX: this may or may not be a bug in the OpenGL bindings from OpenGL.GL.APPLE.transform_hint import * from Quartz import * # The default pixel format _pf = None class SampleCIView(NSOpenGL...
installer
analyze_bundle
"""Analyze the OS X app bundle for OpenShot, and find all external dependencies""" import os import subprocess PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) unique_dependencies = {} # Find files matching patterns for root, dirs, files in os.walk( os.path.join(PATH, "build", "OpenShot Video E...
bleachbit
DesktopMenuOptions
import os from pathlib import Path from bleachbit.Options import options def install_kde_service_menu_file(): try: # Honor the XDG Base Directory Specification first # and check if $XDG_DATA_HOME has already been defined. # The path default is $HOME/.local/share data_home_path = P...
tools
dnd
from gaphor.diagram.diagramtoolbox import get_tool_def from gaphor.diagram.drop import drop from gaphor.diagram.tools.placement import create_item from gaphor.event import Notification from gaphor.i18n import gettext from gaphor.transaction import Transaction from gi.repository import Gdk, GObject, Gtk class ElementD...
listener
mac
# coding:utf-8 import logging import os import threading import time from ctypes import * from cactus.utils.filesystem import fileList from cactus.utils.network import retry from fsevents import Observer, Stream class struct_timespec(Structure): _fields_ = [("tv_sec", c_long), ("tv_nsec", c_long)] class struct...