section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
models | property_definition | from django.contrib.postgres.fields import ArrayField
from django.db import models
from posthog.models.property_definition import PropertyDefinition
class EnterprisePropertyDefinition(PropertyDefinition):
description: models.TextField = models.TextField(blank=True, null=True, default="")
updated_at: models.Da... |
engine | middlewares | import datetime
import logging
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import OperationalError
from django.utils.deprecation import MiddlewareMixin
logger = logging.getLogger(__name__)
class RequestTimeLoggingMiddleware(MiddlewareMixin):
@staticmethod
... |
serializers | escalation_policy_snapshot | from apps.alerts.models.custom_button import CustomButton
from apps.alerts.models.escalation_policy import EscalationPolicy
from apps.schedules.models import OnCallSchedule
from apps.user_management.models import User
from apps.webhooks.models import Webhook
from rest_framework import serializers
class PrimaryKeyRela... |
localFighter | add | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.fighter.localAdd import CalcAddLocalFighterCommand
from gui.fitCommands.helpers import FighterInfo, InternalCommandHistory
from service.fit import Fit
from service.market import Market
class GuiAddLocalFighterCom... |
chardet | gb2312prober | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
grammar | HogQLParser | # Generated from HogQLParser.g4 by ANTLR 4.13.0
# encoding: utf-8
import sys
from io import StringIO
from antlr4 import *
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
return [
4,1,242,919,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,... |
Part | PartEnums | # ***************************************************************************
# * *
# * Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net> *
# * *
# * Th... |
extractor | tele13 | # coding: utf-8
from __future__ import unicode_literals
from ..utils import determine_ext, js_to_json, qualities
from .common import InfoExtractor
from .youtube import YoutubeIE
class Tele13IE(InfoExtractor):
_VALID_URL = r"^https?://(?:www\.)?t13\.cl/videos(?:/[^/]+)+/(?P<id>[\w-]+)"
_TESTS = [
{
... |
pwidgets | unitctrls | # -*- 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.... |
qltk | info | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2011-2020 Nick Boultbee
# 2014 Christoph Reiter
#
# 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 ver... |
trust-calculation | graph_positioning | import random
import networkx as nx
class GraphPositioning:
"""
This class is for the calculation of the positions of the nodes of
a given tree and from the perspective of a given central node
"""
@staticmethod
def hierarchy_pos(G, root=None, width=1.0, vert_gap=0.2, vert_loc=0, xcenter=0.5)... |
views | paging | from apps.alerts.paging import DirectPagingAlertGroupResolvedError, direct_paging
from apps.api.permissions import RBACPermission
from apps.api.serializers.paging import DirectPagingSerializer
from apps.auth_token.auth import PluginAuthentication
from common.api_helpers.exceptions import BadRequest
from rest_framework ... |
views | alert_group | from datetime import timedelta
from apps.alerts.constants import ActionSource
from apps.alerts.models import (
Alert,
AlertGroup,
AlertReceiveChannel,
EscalationChain,
ResolutionNote,
)
from apps.alerts.paging import unpage_user
from apps.alerts.tasks import send_update_resolution_note_signal
from ... |
models | element_group | import hashlib
import json
from typing import Any, Dict, List
from django.db import models, transaction
from django.forms.models import model_to_dict
from posthog.models.element import Element
from posthog.models.team import Team
def hash_elements(elements: List) -> str:
elements_list: List[Dict] = []
for el... |
ipv8 | protocol_decorator | from functools import wraps
from ipv8.lazy_community import lazy_wrapper
from ipv8.messaging.lazy_payload import VariablePayload
def make_protocol_decorator(protocol_attr_name):
"""
A decorator factory that generates a lazy_wrapper-analog decorator for a specific IPv8 protocol.
IPv8 has `lazy_wrapper` d... |
Spreadsheet | TestSpreadsheet | # ***************************************************************************
# * Copyright (c) 2016 Werner Mayer <wmayer[at]users.sourceforge.net> *
# * Copyright (c) 2016 Eivind Kvedalen <eivind@kvedalen.name> *
# * *
# * Th... |
pyload | setup | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ____________
# ___/ | \_____________ _ _ ___
# / ___/ | _ __ _ _| | ___ __ _ __| | \
# / \___/ ______/ | '_ \ || | |__/ _ \/ _` / _` | \
# \ ◯ | | .__/\_, |____\___/\__,_\__,_| /
# \_______\... |
extractor | wwe | from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import try_get, unescapeHTML, url_or_none, urljoin
from .common import InfoExtractor
class WWEBaseIE(InfoExtractor):
_SUBTITLE_LANGS = {
"English": "en",
"Deutsch": "de",
}
def _extract_entry(... |
grc | gen_rfnoc_rx_radio_block_yml | """
Copyright 2023 Ettus Research, A National Instruments Brand.
SPDX-License-Identifier: GPL-3.0-or-later
"""
import sys
MAX_NUM_CHANNELS = 4
MAIN_TMPL = """\
id: uhd_rfnoc_rx_radio
label: RFNoC RX Radio
flags: [python, throttle]
category: '[Core]/UHD/RFNoC/Blocks'
parameters:
- id: num_chans
label: Channel cou... |
grc | gen_rfnoc_fir_filter_block_yml | """
Copyright 2022 Ettus Research, A National Instruments Brand.
SPDX-License-Identifier: GPL-3.0-or-later
"""
import sys
MAX_NUM_CHANNELS = 16
MAIN_TMPL = """\
id: uhd_rfnoc_fir_filter
label: RFNoC FIR Filter Block
category: '[Core]/UHD/RFNoC/Blocks'
parameters:
- id: num_chans
label: Channel count
dtype: int... |
scripts | deluge_remote | #!/usr/bin/python
#
# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# deluge_config.py
# This code (at least in theory) allows one to alter configuration settings
# on a deluge backend. At the ... |
dev | misc_checks | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Various small code checkers."""
import argparse
import os
import os.path
import pathlib
import re
import subprocess
import sys
import tokenize
import traceback
from t... |
fta | xorgate | """XOR gate item definition."""
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, IconBox, Text, stroke
from gaphor.diagram.support import r... |
PyObjCTest | test_metadata_imp | """
Tests for the new-style metadata format interface.
Note: Tests for calling from ObjC into python are in test_metadata_py.py
TODO:
- Add tests for calling functions instead of methods
- The python->C interface (that is the contents of the metadata object) is
likely to change when the bridge is feature-complete.
... |
sqlite | 20171230 | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2017 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
# Converts ids from hex-encoded strings to binary data
import argparse
import sqlite3
from uuid import UUID
parser = a... |
engines | currency_convert | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
currency convert (DuckDuckGo)
"""
import json
# about
about = {
"website": "https://duckduckgo.com/",
"wikidata_id": "Q12805",
"official_api_documentation": "https://duckduckgo.com/api",
"use_official_api": False,
"require_api_key": False,
"res... |
migrations | 0029_update_inkscape_svg_command | """Stop using sudo in the `Transcoding to plain svg with inkscape` command."""
from django.db import migrations
INKSCAPE_TOOL_UUID = "34afccc3-2cfd-4780-ba56-06221f1bfe18"
# Normalization rules using `Transcoding to plain svg with inkscape`.
INKSCAPE_SVG_RULES = (
"363f452e-a41b-46f3-865b-80a249493dfd",
"9591... |
api | job | __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
from flask import abort, jsonify, request
from octoprint.access.permissions import ... |
CTFd | views | import os # noqa: I001
from CTFd.cache import cache
from CTFd.constants.config import (
AccountVisibilityTypes,
ChallengeVisibilityTypes,
ConfigTypes,
RegistrationVisibilityTypes,
ScoreVisibilityTypes,
)
from CTFd.constants.themes import DEFAULT_THEME
from CTFd.models import (
Admins,
File... |
schema | cohort_people | from typing import Any, Dict, List
from posthog.hogql.database.models import (
FieldOrTable,
IntegerDatabaseField,
LazyJoin,
LazyTable,
StringDatabaseField,
Table,
)
from posthog.hogql.database.schema.persons import PersonsTable, join_with_persons_table
COHORT_PEOPLE_FIELDS = {
"person_id"... |
implant | changeMeta | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.implant.add import CalcAddImplantCommand
from gui.fitCommands.helpers import ImplantInfo, InternalCommandHistory
from service.fit import Fit
class GuiChangeImplantMetaCommand(wx.Command):
def __init__(self, f... |
meshes | mesh_contact_box_halfcylinder_tetra10 | def create_nodes(femmesh):
# nodes
femmesh.addNode(286.0, 25.0, -247.0, 1)
femmesh.addNode(286.0, 25.0, 253.0, 2)
femmesh.addNode(286.0, 0.0, -247.0, 3)
femmesh.addNode(286.0, 0.0, 253.0, 4)
femmesh.addNode(186.0, 25.0, -247.0, 5)
femmesh.addNode(186.0, 25.0, 253.0, 6)
femmesh.addNode(18... |
core | realization | """Realization of specific lists of account postings into reports.
This code converts a list of entries into a tree of RealAccount nodes (which
stands for "realized accounts"). The RealAccount objects contain lists of
Posting instances instead of Transactions, or other entry types that are
attached to an account, such... |
web | utils | #!/usr/bin/env python
"""
General Utilities
(part of web.py)
"""
__all__ = [
"Storage", "storage", "storify",
"Counter", "counter",
"iters",
"rstrips", "lstrips", "strips",
"safeunicode", "safestr", "utf8",
"TimeoutError", "timelimit",
"Memoize", "memoize",
"re_compile", "re_subm",
"group", "uniq"... |
mylar | comicbookdb |
import datetime
import re
import sys
from decimal import Decimal
from time import strptime
import helpers
import logger
import urllib2
from bs4 import BeautifulSoup, UnicodeDammit
from HTMLParser import HTMLParseError
def cbdb(comicnm, ComicYear):
#comicnm = 'Animal Man'
#print ( "comicname: " + str(comicnm... |
analog | qa_pll_freqdet | #!/usr/bin/env python
#
# Copyright 2004,2007,2010-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import analog, blocks, gr, gr_unittest
class test_pll_freqdet(gr_unittest.TestCase):
def setUp(self):
sel... |
schemas | submissions | from CTFd.models import Submissions, ma
from CTFd.schemas.challenges import ChallengeSchema
from CTFd.schemas.teams import TeamSchema
from CTFd.schemas.users import UserSchema
from CTFd.utils import string_types
from marshmallow import fields
class SubmissionSchema(ma.ModelSchema):
challenge = fields.Nested(Chall... |
beetsplug | subsonicupdate | # This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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, ... |
downloaders | DownsterNet | # -*- coding: utf-8 -*-
from ..accounts.DownsterNet import DownsterApi
from ..base.multi_downloader import MultiDownloader
class DownsterNet(MultiDownloader):
__name__ = "DownsterNet"
__type__ = "downloader"
__version__ = "0.04"
__status__ = "testing"
__pattern__ = r"^unmatchable$"
__config_... |
femtaskpanels | task_constraint_centrif | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
builder | constants | #!/usr/bin/python3 -OO
# Copyright 2008-2017 The SABnzbd-Team (sabnzbd.org)
#
# 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
# of the License, or (at your option) any later ver... |
metadata | wav | # Copyright (C) 2008-2010 Adam Olsen
#
# 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... |
handlers | upload | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import mimetypes
import uuid
from thumbor.engines import BaseEngine... |
serializers | routes | from apps.alerts.models import AlertReceiveChannel, ChannelFilter, EscalationChain
from apps.api.serializers.alert_receive_channel import (
valid_jinja_template_for_serializer_method_field,
)
from apps.base.messaging import get_messaging_backend_from_id, get_messaging_backends
from common.api_helpers.custom_fields ... |
plugins | plugin | # -*- coding: utf-8 -*-
"""
Operating with plugins
"""
import logging
import pkg_resources
logger = logging.getLogger("default")
def get_plugins(group, point="", name=None, fallback=None):
"""
:param str group: plugin group
:param str point: plugin name prefix
:param name: exact plugin name
:par... |
models | faster_rcnn_nas_feature_extractor | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
cactus | ui | # coding:utf-8
from __future__ import print_function
from six.moves import input, urllib
class InvalidInput(Exception):
"""
Raised when an input is invalid.
You should use this in your `coerce_fn` passed to `prompt`, to indicate that the
input you received was no valid.
"""
def __init__(self... |
gui | contextMenu | # =============================================================================
# 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 ... |
validator | wiki | # 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, ... |
extractor | inc | from __future__ import unicode_literals
from .common import InfoExtractor
from .kaltura import KalturaIE
class IncIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?inc\.com/(?:[^/]+/)+(?P<id>[^.]+).html"
_TESTS = [
{
"url": "http://www.inc.com/tip-sheet/bill-gates-says-these-5-books-wi... |
PyObjCTest | test_nslocale | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSLocale(TestCase):
def testConstants(self):
self.assertIsInstance(NSCurrentLocaleDidChangeNotification, unicode)
self.assertIsInstance(NSLocaleIdentifier, unicode)
... |
plugins | btv | """
$description A privately owned Bulgarian live TV channel.
$url btvplus.bg
$type live
$region Bulgaria
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
log = logging.getLogger(__name__)
@plugin... |
aliceVision | MergeMeshes | __version__ = "1.0"
from meshroom.core import desc
class MergeMeshes(desc.AVCommandLineNode):
commandLine = "aliceVision_mergeMeshes {allParams}"
category = "Utils"
documentation = """
This node allows to merge two meshes in one.
Operation types used to merge two meshes:
- boolean_union: Create a new ... |
launcher | open_in_beancount | #!/usr/bin/env python3
"""Launcher script that will open a Beancount file in an editor at a specific line number.
How to install this on Ubuntu
-----------------------------
1. Copy "beancount.desktop" to /usr/share/applications
2. Edit the file to reflect the location of this script.
3. Update the database of desk... |
config | controls | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from enum import Enum
from typing import List, Optional, Union
from octoprint.schema import BaseModel
from octoprint.vendor.wi... |
queries | breakdown_props | from typing import Any, Dict, List, Optional, Tuple, Union, cast
from django.forms import ValidationError
from posthog.constants import (
BREAKDOWN_TYPES,
MONTHLY_ACTIVE,
WEEKLY_ACTIVE,
PropertyOperatorType,
)
from posthog.hogql.hogql import HogQLContext
from posthog.models.cohort import Cohort
from po... |
Dressup | DogboneII | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
utils | cycles | # Borrowed from new eos
from utils.repr import makeReprStr
class CycleInfo:
def __init__(self, activeTime, inactiveTime, quantity, isInactivityReload):
self.activeTime = activeTime
self.inactiveTime = inactiveTime
self.quantity = quantity
self.isInactivityReload = isInactivityRel... |
jobs | decisions | """
Jobs relating to user decisions.
"""
import abc
import logging
import threading
from collections import OrderedDict
from main import models
from server.db import auto_close_old_connections
from server.jobs.base import Job
from server.processing_config import load_preconfigured_choice, load_processing_xml
from serv... |
builtinMarketBrowser | itemView | import gui.builtinMarketBrowser.pfSearchBox as SBox
import wx
from config import slotColourMap
from eos.saveddata.module import Module
from gui.builtinMarketBrowser.events import RECENTLY_USED_MODULES, ItemSelected
from gui.contextMenu import ContextMenu
from gui.display import Display
from gui.utils.staticHelpers impo... |
jobs | chain | """
Job chain logic.
The `JobChain` class determines which job should be run next, based on
the workflow and the exit code of the previous job. It also stores context
provided by previous jobs in the same chain (e.g. choices for a decision).
This module knows about all `Job` subclasses, and will instantiate the corre... |
layer | core | # This file is part of MyPaint.
# Copyright (C) 2011-2018 by the MyPaint Development Team.
# Copyright (C) 2007-2012 by Martin Renold <martinxyz@gmx.ch>
#
# 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 Fou... |
youtube-dl | jsinterp | from __future__ import unicode_literals
import itertools
import json
import operator
import re
from functools import update_wrapper
from .compat import compat_basestring, compat_chr
from .compat import compat_collections_chain_map as ChainMap
from .compat import compat_itertools_zip_longest as zip_longest
from .compa... |
archivebox | config | """
ArchiveBox config definitons (including defaults and dynamic config options).
Config Usage Example:
archivebox config --set MEDIA_TIMEOUT=600
env MEDIA_TIMEOUT=600 USE_COLOR=False ... archivebox [subcommand] ...
Config Precedence Order:
1. cli args (--update-all / --index-only / etc.)
... |
Code | TurnOnLights | import codecs
import datetime
import os
import random
from Code import ControlPosicion, PGNreader, Util, VarGen
QUALIFICATIONS = (
("Mind-bending", "7", 0.7, 0.5),
("Grandmaster", "6", 1.0, 0.8),
("International Master", "5", 1.5, 1.0),
("Master", "4", 2.2, 1.3),
("Candidate Master", "3", 3.1, 1.6... |
draftguitools | gui_tool_utils | # ***************************************************************************
# * (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
gpodder | common | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder 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 Licens... |
scorewiz | build | # 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
... |
file-list | trash_list | from gi.repository import Gtk
from sunflower.operation import DeleteOperation
from .file_list import FileList
from .gio_provider import TrashProvider
class TrashList(FileList):
"""Trash file list plugin
Generic operations related to trash management are provided with this
class. By extending FileList st... |
cohort | sql | from posthog.clickhouse.table_engines import CollapsingMergeTree
from posthog.models.person.sql import PERSON_STATIC_COHORT_TABLE
from posthog.settings import CLICKHOUSE_CLUSTER
CALCULATE_COHORT_PEOPLE_SQL = """
SELECT {id_column} FROM ({GET_TEAM_PERSON_DISTINCT_IDS}) WHERE {query}
"""
COHORTPEOPLE_TABLE_ENGINE = lam... |
extensions | update_feeds_on_startup | # -*- coding: utf-8 -*-
# Starts episode update search on startup
#
# (c) 2012-10-13 Bernd Schlapsi <brot@gmx.info>
# Released under the same license terms as gPodder itself.
import logging
import gpodder
logger = logging.getLogger(__name__)
_ = gpodder.gettext
__title__ = _("Search for new episodes on startup")
_... |
extractor | rumble | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import determine_ext, int_or_none, parse_iso8601, try_get
from .common import InfoExtractor
class RumbleEmbedIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?rumble\.com/embed/(?:[0-9a-z]+\.)?(?P<id... |
metadata | _apev2 | # Copyright (C) 2008-2010 Adam Olsen
#
# 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... |
calculix | write_femelement_material | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
browsers | iradio | # Copyright 2011 Joe Wreschnig, Christoph Reiter
# 2013-2022 Nick Boultbee
#
# 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 of the License, or
# (at your option) any later... |
api | prompt | import json
from typing import Any, Dict, List
from dateutil import parser
from django.db import IntegrityError
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from posthog.api.routing import StructuredViewSetMixin
from posthog.api.utils import get_token
from posthog.celery im... |
config | configcache | # SPDX-FileCopyrightText: Jay Kamat <jaygkamat@gmail.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Implementation of a basic config cache."""
from typing import Any, Dict
from qutebrowser.config import config
class ConfigCache:
"""A 'high-performance' cache for the config system.
Useful for areas... |
prototypes | jsnumber | import six
if six.PY3:
basestring = str
long = int
xrange = range
unicode = str
RADIX_SYMBOLS = {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "a",
11: "b",
12: "c",
13: "d",
14: "e",
15: "f",
1... |
notifications | tests | from __future__ import annotations
from abilian.core.models.subjects import User
from abilian.sbe.app import Application
from abilian.sbe.apps.communities.models import WRITER, Community
from abilian.sbe.apps.notifications.tasks.social import (
CommunityDigest,
generate_unsubscribe_token,
)
from abilian.servic... |
tools | cppfile_editor | #
# Copyright 2013, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Edit C++ files for bindings """
import logging
import re
logger = logging.getLogger(__name__)
class CPPFileEditor(object):
"""A tool for editing CMakeLists.txt files.... |
TemplatePyMod | Mesh2Shape | # FreeCAD TemplatePyMod module
# (c) 2010 Werner Mayer LGPL
import Mesh
import MeshPart
import Part
faces = []
mesh = App.ActiveDocument.ActiveObject.Mesh
segments = mesh.getPlanarSegments(0.00001) # use rather strict tolerance here
for i in segments:
if len(i) > 0:
# a segment can have inner holes
... |
draftfunctions | dxf | # -*- coding: utf8 -*-
# ***************************************************************************
# * Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
utils | object_detection_evaluation | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
plugins | currency_accounts_test | __copyright__ = "Copyright (C) 2019 Martin Blais"
__license__ = "GNU GPLv2"
import unittest
from beancount import loader
from beancount.core import data
from beancount.parser import cmptest
from beancount.plugins import currency_accounts
class TestCurrencyTradingAccounts(cmptest.TestCase):
@loader.load_doc()
... |
versions | 095_9fadda785b07_drop_continuity_id_constraints | # encoding: utf-8
"""drop continuity_id constraints
Revision ID: 9fadda785b07
Revises: 588d7cfb9a41
Create Date: 2020-04-26 22:27:35.761525
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "9fadda785b07"
down_revision = "588d7cfb9a41"
branch_labels = None
depends_on = None
def upgrad... |
PyObjCTest | test_cvpixelbufferpool | from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestCVPixelBufferPool(TestCase):
def testTypes(self):
self.assertIsCFType(CVPixelBufferPoolRef)
def testContants(self):
self.... |
posthog | permissions | from typing import cast
from django.db.models import Model
from posthog.auth import SharingAccessTokenAuthentication
from posthog.cloud_utils import is_cloud
from posthog.exceptions import EnterpriseFeatureException
from posthog.models import Organization, OrganizationMembership, Team, User
from posthog.utils import g... |
PyObjCTest | test_nsrange | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestNSRange(TestCase):
def testStructs(self):
v = NSRange()
self.assertHasAttr(v, "location")
self.assertHasAttr(v, "l... |
accounts | MegaDebridEu | # -*- coding: utf-8 -*-
import json
from functools import reduce
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.multi_account import MultiAccount
def args(**kwargs):
return kwargs
class MegaDebridEu(MultiAccount):
__name__ = "MegaDebridEu"
__type__ = "account"
... |
bitmessageqt | foldertree | """
Folder tree and messagelist widgets definitions.
"""
# pylint: disable=too-many-arguments,bad-super-call
# pylint: disable=attribute-defined-outside-init
from cgi import escape
from bmconfigparser import config
from helper_sql import sqlExecute, sqlQuery
from PyQt4 import QtCore, QtGui
from settingsmixin import S... |
backends | rtmidi | """Backend for python-rtmidi:
http://pypi.python.org/pypi/python-rtmidi/
"""
from __future__ import absolute_import
import threading
import rtmidi
from .. import ports
from ..messages import Message
from ._parser_queue import ParserQueue
from .rtmidi_utils import expand_alsa_port_name
def _get_api_lookup():
a... |
audioinfo | apev2 | from copy import deepcopy
from mutagen.apev2 import BINARY, TEXT, APENoHeaderError, APEv2File, APEValue
from mutagen.monkeysaudio import MonkeysAudio, MonkeysAudioHeaderError
from mutagen.musepack import Musepack, MusepackHeaderError
from mutagen.wavpack import WavPack, WavPackHeaderError
from . import util
from .uti... |
youtube-dl | compat | # coding: utf-8
from __future__ import division, unicode_literals
import base64
import binascii
import collections
import ctypes
import datetime
import email
import getpass
import io
import itertools
import optparse
import os
import platform
import re
import shlex
import shutil
import socket
import struct
import subpr... |
saveddata | fit | # ===============================================================================
# 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, ... |
moodbar | prefs | # moodbar - Replace Exaile's seekbar with a moodbar
# Copyright (C) 2018 Johannes Sasongko <sasongko@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, either version 2 of the License... |
cargo | remove | import wx
from gui.fitCommands.helpers import CargoInfo
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcRemoveCargoCommand(wx.Command):
def __init__(self, fitID, cargoInfo):
wx.Command.__init__(self, True, "Remove Cargo")
self.fitID = fitID
self... |
mmkeys | keybinder | # Copyright 2014 Christoph Reiter
# 2018 Ludovic Druette
#
# 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 of the License, or
# (at your option) any later version.
im... |
Settings | CuraContainerRegistry | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
import os
import re
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import cura.CuraApplication
from cura.Machines.ContainerTree import ContainerTree
from cura.ReaderWriters.ProfileRead... |
linux | wmctrl_x11 | from Xlib import X, display
from Xlib.error import BadWindow
from Xlib.protocol.event import ClientMessage
class WmCtrl:
def __init__(self):
self._display = display.Display()
self._root = self._display.screen().root
self._atoms = {
name: self._display.intern_atom(name)
... |
Show | ShowUtils | # /***************************************************************************
# * Copyright (c) 2019 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.