section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
natsort | ns_enum | # -*- coding: utf-8 -*-
"""This module defines the "ns" enum for natsort."""
from __future__ import absolute_import, division, print_function, unicode_literals
class ns(object):
"""
Enum to control the `natsort` algorithm.
This class acts like an enum to control the `natsort` algorithm. The
user may ... |
TechDrawTools | CommandMoveView | # ***************************************************************************
# * Copyright (c) 2022 Wanderer Fan <wandererfan@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
pwidgets | patternctrls | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 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.... |
migrations | 0028_alter_settings_language_alter_settings_timezone | # Generated by Django 4.2.2 on 2023-06-16 19:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("babybuddy", "0027_remove_standard_group"),
]
operations = [
migrations.AlterField(
model_name="settings",
name="langu... |
friture | generator | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timoth?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 distribu... |
blocks | qa_vector_sink_source | #!/usr/bin/env python
#
# Copyright 2008,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import pmt
from gnuradio import blocks, gr, gr_unittest
def make_tag(key, value, offset, srcid=None):
tag = gr.tag_t()
tag.key =... |
BasicDrawing | MyView | import AppDrawing
import FrameworkTextDrawing
import objc
import UIHandling
from Cocoa import *
# XXX: Why are these global?
_drawingCommand = UIHandling.kHICommandSimpleRect
_pdfDocument = None
class MyView(NSView):
currentMenuItem = objc.IBOutlet()
def initWithFrame_(self, frameRect):
self = super... |
Arch | import3DS | # ***************************************************************************
# * Copyright (c) 2016 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
app | test_installer | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * ... |
traffic | traffic | # 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, ... |
posthog | filters | from typing import List, Optional, Tuple, TypeVar, Union
from django.db import models
from django.db.models import Q
from django.db.models.query import QuerySet, RawQuerySet
from rest_framework import filters, settings
from rest_framework.request import Request
from rest_framework.views import APIView
_MT = TypeVar("... |
generate-fake-data | main | import argparse
import asyncio
import math
import random
import typing
import uuid
from datetime import datetime
import aiohttp
from faker import Faker
from tqdm.asyncio import tqdm
fake = Faker()
TEAMS_USERS_COMMAND = "generate_teams_and_users"
SCHEDULES_ONCALL_SHIFTS_COMMAND = "generate_schedules_and_oncall_shifts... |
scripts | check_gcode_buffer | #!/usr/bin/env python3
# Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import copy
import math
import os
import sys
from typing import Dict, List, Optional, Tuple
# ====================================
# Constants and Default Values
# ===================================... |
website | backends | import logging
from django.contrib.auth.backends import RemoteUserBackend
from django.contrib.auth.models import User
from papers.models import Researcher
from papers.utils import validate_orcid
from website.models import ShibbolethAccount
from website.utils import merge_users
logger = logging.getLogger("dissemin." +... |
extractor | mychannels | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MyChannelsIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?mychannels\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)"
_TEST = {
"url": "https://mychannels.com/missholland/miss-hollan... |
examples | list_classes | #!/usr/bin/python
"""This script lists classes and optionally attributes from UML model created
with Gaphor."""
import optparse
import sys
from gaphor import UML
from gaphor.application import Session
# Setup command line options.
usage = "usage: %prog [options] file.gaphor"
def main():
parser = optparse.Opti... |
metasync | itunes | # This file is part of beets.
# Copyright 2016, Tom Jaspers.
#
# 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, mod... |
bup | drecurse | from __future__ import absolute_import
import os
import stat
import bup.xstat as xstat
from bup.helpers import (
add_error,
debug1,
finalized,
resolve_parent,
should_rx_exclude_path,
)
from bup.io import path_msg
# the use of fchdir() and lstat() is for two reasons:
# - help out the kernel by no... |
femsolver | solverbase | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2017 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
chardet | sjisprober | ######################## 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... |
disabled-ZeronameLocal | SiteManagerPlugin | import json
import logging
import os
import re
import socket
import sys
import time
from base64 import b64encode
from http.client import HTTPConnection, HTTPException, HTTPSConnection
from Config import config
from Debug import Debug
from Plugin import PluginManager
allow_reload = False # No reload supported
@Plug... |
storages | file_storage | #!/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 hashlib
import os
from datetime import datetime
from json imp... |
decrypters | CzshareComFolder | # -*- coding: utf-8 -*-
import re
from ..base.decrypter import BaseDecrypter
class CzshareComFolder(BaseDecrypter):
__name__ = "CzshareComFolder"
__type__ = "decrypter"
__version__ = "0.27"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.+"
__co... |
extractor | ustudio | from __future__ import unicode_literals
import re
from ..utils import int_or_none, unescapeHTML, unified_strdate
from .common import InfoExtractor
class UstudioIE(InfoExtractor):
IE_NAME = "ustudio"
_VALID_URL = r"https?://(?:(?:www|v1)\.)?ustudio\.com/video/(?P<id>[^/]+)/(?P<display_id>[^/?#&]+)"
_TEST... |
util | Msgpack | import io
import os
import struct
import msgpack
import msgpack.fallback
def msgpackHeader(size):
if size <= 2**8 - 1:
return b"\xc4" + struct.pack("B", size)
elif size <= 2**16 - 1:
return b"\xc5" + struct.pack(">H", size)
elif size <= 2**32 - 1:
return b"\xc6" + struct.pack(">I"... |
QT | WBG_Training | from Code.QT import Colocacion, Controles, Iconos, QTUtil2, QTVarios
from PyQt4 import QtGui
class TConf(QtGui.QWidget):
def __init__(self, dicValoracion, dicVentaja):
QtGui.QWidget.__init__(self)
lyVal = Colocacion.V()
self.chbVal = Controles.CHB(self, _("All/None"), True).capturaCambiad... |
web | form | """
HTML forms
(part of web.py)
"""
import copy
import re
import net
import utils
import webapi as web
def attrget(obj, attr, value=None):
try:
if hasattr(obj, 'has_key') and obj.has_key(attr):
return obj[attr]
except TypeError:
# Handle the case where has_key takes different nu... |
femtaskpanels | task_constraint_initialflowvelocity | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
utils | translations | # -*- coding: utf-8 -*-
"""
flaskbb.utils.translations
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains the translation Domain used by FlaskBB.
:copyright: (c) 2016 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
import subprocess
import babel
from fl... |
senf | _winapi | # -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# 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... |
util | environment | # Copyright 2015 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 version 2 of the License, or
# (at your option) any later version.
"""Varisour function for figuring o... |
utils | blockutils | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Code that is shared between the host blocker and Brave ad blocker."""
import functools
import os
from typing import IO, List, Optional
from qutebrowser.api import config, downloads, message... |
gvim-viewer | plugin | from __future__ import absolute_import
import subprocess
from gi.repository import Gtk
from sunflower.plugin_base.viewer_extension import ViewerExtension
def register_plugin(application):
"""Register plugin class with application"""
application.register_viewer_extension(("text/plain",), GVimViewer)
class ... |
frescobaldi-app | definition | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2014 - 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
... |
utils | http | # -*- coding: utf-8 -*-
"""
flaskbb.utils.http
~~~~~~~~~~~~~~~~~~
Provides a utility function that attempts to validate an URL against
a set of valid hosts.
See https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet
for more information about this topic.
Note: Most... |
trends | formula | import math
import re
from itertools import accumulate
from string import ascii_uppercase
from typing import Any, Dict, List
from posthog.clickhouse.kafka_engine import trim_quotes_expr
from posthog.constants import NON_TIME_SERIES_DISPLAY_TYPES, TRENDS_CUMULATIVE
from posthog.models.filters.filter import Filter
from ... |
Code | Kibitzers | import os.path
from Code import EngineThread, MotoresExternos, Util, VarGen, XRun
from Code.QT import Iconos
from PyQt4 import QtGui
class Tipos:
def __init__(self):
self.liTipos = (
("M", _("Candidates"), Iconos.pmPuntoRojo()),
("I", _("Indexes") + " - RodentII", Iconos.pmPuntoNe... |
website | middleware | from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
from shibboleth.app_settings import GROUP_ATTRIBUTES
from shibboleth.middleware import (
ShibbolethRemoteUserMiddleware,
ShibbolethValidationError,
)
from website.backends import ShibbolethRemoteUserBackend
class Shibbolet... |
eva | container | from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Optional, TypeVar
from ipv8.types import Peer
from tribler.core.components.ipv8.eva.transfer.base import Transfer
if TYPE_CHECKING:
from tribler.core.components.ipv8.eva.protocol import EVAProtocol
T = TypeVar("T", bound=Transfer)
clas... |
database | _table_utils | #!/usr/bin/env python
#
# 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 Public L... |
src | guiHtml | # HTML GUI
# def GuiObject
def main():
import BaseHTTPServer
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def log_message(self, format, *args):
pass
def do_GET(self):
print("GET: %s" % self.path)
if self.path == "/":
return self.... |
plugins | trigger_fx | # -*- coding: utf-8 -*-
"""
This file is part of the Stargate project, Copyright Stargate Team
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 version 3 of the License.
This program is distributed in... |
lib | metrics | """
Exposes various metrics via Prometheus.
"""
import configparser
import datetime
import functools
import os
from common_metrics import (
PACKAGE_FILE_COUNT_BUCKETS,
PACKAGE_SIZE_BUCKETS,
PROCESSING_TIME_BUCKETS,
TASK_DURATION_BUCKETS,
)
from django.conf import settings
from django.db.models import S... |
gui | ctrlPanel | # =============================================================================
# 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 ... |
packages | requests_file | """
Copyright 2015 Red Hat, Inc.
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 applicable law or agreed to in wri... |
clientScripts | index_aip | #!/usr/bin/env python
import os
import sys
import traceback
from glob import glob
import django
import elasticSearchFunctions
import identifier_functions
import storageService as storage_service
from custom_handlers import get_script_logger
from main.models import UnitVariable
# dashboard
# archivematicaCommon
djang... |
plugins | limiter | # -*- coding: utf-8 -*-
"""
This file is part of the Stargate project, Copyright Stargate Team
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 version 3 of the License.
This program is distributed in... |
classes | version | """
@file
@brief This file get the current version of openshot from the openshot.org website
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an ... |
plugins | spec | # -*- coding: utf-8 -*-
"""
flaskbb.plugins.spec
~~~~~~~~~~~~~~~~~~~~~~~
This module provides the core FlaskBB plugin hook definitions
:copyright: (c) 2017 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from pluggy import HookspecMarker
spec = HookspecMarker("flaskbb")
#... |
CoreVideo | _metadata | # This file is generated by objective.metadata
#
# Last update: Fri Oct 19 09:50:50 2012
import sys
import objc
if sys.maxsize > 2**32:
def sel32or64(a, b):
return b
else:
def sel32or64(a, b):
return a
if sys.byteorder == "little":
def littleOrBig(a, b):
return a
else:
... |
user | update | # -*- coding: utf-8 -*-
"""
flaskbb.core.user.update
~~~~~~~~~~~~~~~~~~~~~~~~
This modules provides services used in updating user details
across FlaskBB.
:copyright: (c) 2014-2018 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from abc import ABC, abstractmethod
impor... |
utils | file_utils_test | """Tests for file utilities.
"""
__copyright__ = "Copyright (C) 2014, 2016 Martin Blais"
__license__ = "GNU GPLv2"
import os
import re
import tempfile
import unittest
from os import path
from beancount.utils import file_utils, test_utils
def clean(prefix, iterable):
return [re.sub("^{}/".format(re.escape(prefi... |
extractors | singlefile | __package__ = "archivebox.extractors"
import json
from pathlib import Path
from typing import Optional
from ..config import (
CHROME_BINARY,
DEPENDENCIES,
SAVE_SINGLEFILE,
SINGLEFILE_ARGS,
SINGLEFILE_VERSION,
TIMEOUT,
)
from ..index.schema import ArchiveError, ArchiveResult, Link
from ..loggin... |
rest | settings_endpoint | from aiohttp import web
from aiohttp_apispec import docs, json_schema
from ipv8.REST.schema import schema
from marshmallow.fields import Boolean
from tribler.core.components.libtorrent.download_manager.download_manager import (
DownloadManager,
)
from tribler.core.components.restapi.rest.rest_endpoint import (
... |
extractor | lcp | # coding: utf-8
from __future__ import unicode_literals
from .arkena import ArkenaIE
from .common import InfoExtractor
class LcpPlayIE(ArkenaIE):
_VALID_URL = (
r"https?://play\.lcp\.fr/embed/(?P<id>[^/]+)/(?P<account_id>[^/]+)/[^/]+/[^/]+"
)
_TESTS = [
{
"url": "http://play.l... |
usage-manual | export_usage_manual | # pip install selenium
# I had to also do pip install --upgrade requests
# Download geckodriver from here https://github.com/mozilla/geckodriver/releases and put it in Downloads
# sudo chmod +x geckodriver
# export PATH=$PATH:/home/marc/Downloads (or wherever you put it)
import os
import time
from html.parser import H... |
settings | base | import os
from distutils.util import strtobool
from django.utils.translation import gettext_lazy as _
from dotenv import find_dotenv, load_dotenv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Environme... |
protos | losses_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/losses.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pb2
from google.protobuf im... |
transmissionrpc | httphandler | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2013 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import sys
from six import PY3
from transmissionrpc.error import HTTPHandlerError
if PY3:
from http.client import BadStatusLine
from urllib.error import HTTPError, URLError
from urlli... |
utils | path | import re
from pathlib import Path
from typing import Callable, Optional, Union
from streamlink.compat import is_win32
REPLACEMENT = "_"
SPECIAL_PATH_PARTS = (".", "..")
_UNPRINTABLE = "".join(chr(c) for c in range(32))
_UNSUPPORTED_POSIX = "/"
_UNSUPPORTED_WIN32 = '\x7f"*/:<>?\\|'
RE_CHARS_POSIX = re.compile(f"[{r... |
DragItemAround | DragItemAround | # Updated by mvl on 2009-02-22 for PyObjC 2
import objc
from AppKit import *
from Foundation import *
from PyObjCTools import AppHelper
class DraggableItemView(NSView):
"""."""
_locationDefault = NSMakePoint(0.0, 0.0)
_itemColorDefault = NSColor.redColor()
_backgroundColorDefault = NSColor.whiteColo... |
PyObjCTest | test_cflocale | from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestLocale(TestCase):
def testTypes(self):
self.assertIsCFType(CFLocaleRef)
def testGetTypeID(self):
self.assertIsIns... |
actions | activity | from gaphor import UML
from gaphor.diagram.presentation import (
AttachedPresentation,
Classified,
ElementPresentation,
connect,
)
from gaphor.diagram.shapes import Box, JustifyContent, Text, TextAlign, draw_border
from gaphor.diagram.support import represents
from gaphor.diagram.text import FontStyle
f... |
Spreadsheet | Init | # ***************************************************************************
# * Copyright (c) 2001,2002 Juergen Riegel <juergen.riegel@web.de> *
# * Copyright (c) 2013 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2013 Eivind Kvedalen <eivind@kvedalen.name> *
# * ... |
objc | _pythonify | import sys
from objc import _objc
__all__ = []
class OC_PythonFloat(float):
__slots__ = ("__pyobjc_object__",)
def __new__(cls, obj, value):
self = float.__new__(cls, value)
self.__pyobjc_object__ = obj
return self
__class__ = property(lambda self: self.__pyobjc_object__.__clas... |
bleachbit | Command | # vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2023 Andrew Ziem
# https://www.bleachbit.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 3 of the License, or
# ... |
QT | PantallaMemoria | import random
import time
from Code import ControlPosicion
from Code.QT import Colocacion, Controles, Iconos, QTUtil2, QTVarios, Tablero
from PyQt4 import QtCore, QtGui
class WDatos(QtGui.QDialog):
def __init__(self, wParent, txtcategoria, maxNivel):
super(WDatos, self).__init__(wParent)
self.se... |
processor | rtmpdump | #!/usr/bin/env python
import os.path
import subprocess
def get_usable_rtmpdump(cmd):
try:
p = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
return cmd
except:
return None
RTMPDUMP = get_usable_rtmpdump("rtmpdump")
def ha... |
Gui | Surface | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
faulthandler | tests | from __future__ import with_statement
import datetime
import faulthandler
import os
import re
import signal
import subprocess
import sys
import tempfile
import unittest
from contextlib import contextmanager
try:
import threading
HAVE_THREADS = True
except ImportError:
HAVE_THREADS = False
TIMEOUT = 1
P... |
engines | sqlite | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
SQLite database (Offline)
"""
# pylint: disable=missing-function-docstring
import sqlite3
engine_type = "offline"
database = ""
query_str = ""
limit = 10
paging = True
result_template = "key-value.html"
def init(engine_settings):
if "query_str" not in engine_se... |
metadata | tags | from xl.nls import gettext
def N_(x):
return x
class _TD:
__slots__ = [
"name", # descriptive name
"translated_name", # translated name
"tag_name", # raw tag name
"type",
"editable",
"min",
"max",
"use_disk", # set true if should retrieve t... |
mr-tools | mr_tools | # 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, ... |
models | rules | # 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, ... |
views | sidebars | """Provides content for sidebars, accessible via the 'g' object.
TODO: make it smarter (direct access from 'g' using lazy objects?) and
cacheable.
"""
from __future__ import annotations
from datetime import datetime, timedelta
from abilian.core.models.subjects import User
from abilian.sbe.apps.communities.models im... |
deprecated | update_na_news_impprt | import glob
import logging
import os
from typing import Any, Dict, List, Text
import pandas as pd
from dag_factory.components.old_news_import import OldNewsImportSpec
from dag_factory.components.utils import (
date_str_to_unixtime,
get_all_csv_paths,
tag_dict_to_dict,
)
from newscrawler.crawler import extr... |
serializers | shift_swap | import datetime
import typing
from apps.schedules.models import OnCallSchedule, ShiftSwapRequest
from common.api_helpers.custom_fields import (
OrganizationFilteredPrimaryKeyRelatedField,
TimeZoneAwareDatetimeField,
)
from common.api_helpers.mixins import EagerLoadingMixin
from django.utils import timezone
fro... |
femexamples | ccx_cantilever_faceload | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com *
# * *
# * Th... |
views | insights | from typing import Any, Dict
from ee.clickhouse.queries.funnels.funnel_correlation import FunnelCorrelation
from ee.clickhouse.queries.paths import ClickhousePaths
from ee.clickhouse.queries.retention import ClickhouseRetention
from ee.clickhouse.queries.stickiness import ClickhouseStickiness
from posthog.api.insight ... |
extractor | wat | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import ExtractorError, int_or_none, try_get, unified_strdate
from .common import InfoExtractor
class WatIE(InfoExtractor):
_VALID_URL = r"(?:wat:|https?://(?:www\.)?wat\.tv/video/.*-)(?P<id>[0-9a-z]+)"
IE_NAM... |
Models | PrinterConfigurationModel | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal
MYPY = False
if MYPY:
from cura.PrinterOutput.Models.ExtruderConfigurationModel import (
ExtruderConfigurationModel,
)
c... |
neubot | runner_core | # neubot/runner_core.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 Public... |
gui | lists | # =============================================================================
# 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 ... |
blocks | qa_interleave | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012-2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest
class test_interleave(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_blo... |
models | ssd_inception_v2_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... |
digital | qa_lfsr | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import numpy as np
from gnuradio import digital, gr, gr_unittest
from gnuradio.digital.utils import lfsr_args
class test_lfsr(gr_unittest.TestCase... |
Bigfile | BigfilePlugin | import base64
import binascii
import collections
import json
import math
import os
import shutil
import subprocess
import time
import warnings
import gevent
import gevent.lock
from Crypt import CryptHash
from Debug import Debug
from Plugin import PluginManager
with warnings.catch_warnings():
warnings.filterwarnin... |
utils | parse | # -*- encoding: utf-8 -*-
from itertools import chain
from urllib.parse import unquote
import html5lib
def thread(data, default="Untitled.", id=None):
"""
Extract <h1> title from web page. The title is *probably* the text node,
which is the nearest H1 node in context to an element with the `isso-thread`... |
QT | PantallaPlayPGN | from Code import Partida, TrListas, Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
Grid,
Iconos,
PantallaPGN,
QTUtil2,
QTVarios,
)
class PlayPGNs(Util.DicSQL):
def __init__(self, fichero):
Util.DicSQL.__init__(self, fichero)
self.regKeys = self.keys(Tru... |
reader | bitmap_reader | # --------------------------------------------------------------------------
# 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... |
octoprint | _version | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
instruments | Instrument | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2009 Blazingamer ... |
extractor | rai | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str, compat_urlparse
from ..utils import (
ExtractorError,
GeoRestrictedError,
HEADRequest,
determine_ext,
find_xpath_attr,
fix_xml_ampersands,
int_or_none,
parse_duration,
remove_start,
... |
downloaders | MegaRapidoNet | # -*- coding: utf-8 -*-
import random
from ..base.multi_downloader import MultiDownloader
def random_with_n_digits(n):
rand = "0."
not_zero = 0
for i in range(1, n + 1):
r = random.randint(0, 9)
if r > 0:
not_zero += 1
rand += str(r)
if not_zero > 0:
retu... |
downloaders | FilefactoryCom | # -*- coding: utf-8 -*-
import re
from datetime import timedelta
from pyload.core.network.request_factory import get_url
from ..base.hoster import parse_file_info
from ..base.simple_downloader import SimpleDownloader
def get_info(urls):
for url in urls:
h = get_url(url, just_header=True)
m = re... |
disc | dbpoweramplog | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2022 Philipp Wolfer
#
# 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 Licen... |
extractor | dfb | from __future__ import unicode_literals
import re
from ..utils import unified_strdate
from .common import InfoExtractor
class DFBIE(InfoExtractor):
IE_NAME = "tv.dfb.de"
_VALID_URL = r"https?://tv\.dfb\.de/video/(?P<display_id>[^/]+)/(?P<id>\d+)"
_TEST = {
"url": "http://tv.dfb.de/video/u-19-em... |
migrations | 0096_plugins | import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0095_session_recording_event_table"),
]
operations = [
migrations.CreateModel(
name="Plugi... |
funnels | funnel_unordered | import uuid
from typing import Any, Dict, List, Optional, cast
from posthog.models.entity.entity import Entity
from posthog.queries.funnels.base import ClickhouseFunnelBase
from posthog.queries.util import correct_result_for_sampling
from rest_framework.exceptions import ValidationError
class ClickhouseFunnelUnorder... |
sabnzbd | getipaddress | #!/usr/bin/python3 -OO
# Copyright 2007-2023 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.