CombinedText stringlengths 4 3.42M |
|---|
import sys
import dbus
import core.module
import core.widget
import core.input
import core.decorators
"""Displays the current song being played and allows pausing, skipping ahead, and skipping back.
Requires the following library:
* python-dbus
Parameters:
* spotify-buttons.format: Format string (defaults ... |
#!/usr/bin/env python
import cv2
import numpy as np
import rospy
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Image
from sensor_msgs.msg import LaserScan
from math import sin, cos, pi
image_width = rospy.get_param("image_width")
image_height = rospy.get_param("image_height")
pixels_per_m... |
from flask import Flask
from flask import render_template
from pygments import highlight
import pygments.lexers as pyg_lexers
from pygments.formatters import HtmlFormatter
import requests, re
from flask import request
from urlparse import urlparse
from flask import redirect, url_for
app = Flask(__name__)
@app.route("/... |
from discord.ext import commands
from .utils import checks, db, fuzzy
import asyncio
import discord
import re
import lxml.etree as etree
from collections import Counter
DISCORD_API_ID = 81384788765712384
DISCORD_BOTS_ID = 110373943822540800
USER_BOTS_ROLE = 178558252869484544
CONTRIBUTORS_ROLE = 11117309788899... |
#!/bin/env python
import aiohttp
import discord
from discord.ext import commands
from bs4 import BeautifulSoup
from utils import aiohttp_wrap as aw
class AskAsk:
def __init__(self, bot):
self.bot = bot
self.aio_session = bot.aio_session
self.scrape_uri = 'http://www.ask.com/web?q={}&o=0&q... |
check_cd takes a Member, not an int
|
import random
import urllib.parse
import sqlite3
import asyncio
import aiohttp
import discord
from discord.ext import commands
import loadconfig
class fun(commands.Cog):
db = 'reaction.db'
def __init__(self, bot):
self.bot = bot
async def cog_command_error(self, ctx, error):
... |
import random
from discord.ext.commands import bot
class Fun():
def __init__(self, Bot):
self.bot = Bot
@bot.command(pass_context=True)
async def roll(self, ctx, die):
"""
Rolls a die using ndx format.
Usage:
{command_prefix}roll ndx
Example:
.roll 2d20 # Rolls two D20s
"""
# TODO: Change to n... |
#!/bin/env python3
import discord
from discord.ext import commands
class Moderator:
def __init__(self, bot):
self.bot = bot
async def on_command_error(self, ctx, error):
if isinstance(error, commands.BadArgument):
return await ctx.send(f'Sorry, I can not kick/ban that user.')
... |
from discord.ext import commands
from .utils import checks, db, time, cache, formats
from collections import Counter, defaultdict
from inspect import cleandoc
import re
import json
import discord
import enum
import datetime
import asyncio
import argparse, shlex
import logging
log = logging.getLogger(__name__)
## Mis... |
import asyncio
import os
import random
import re
from concurrent import futures
from typing import Dict, List, Tuple, Union
import discord
from discord.ext import commands
from discord.ext.commands import Cog
from bot import BeattieBot
from context import BContext
from utils.genesys import die_names, genesysroller
R... |
"""
Class Name : ACL
Description:
Class that handles Access Control Lists for bot users
This class serves as a RESTful abstration to the user database
Contributors:
- Patrick Hennessy
- Aleksandr Tihomirov
License:
Arcbot is free software: you can r... |
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""The tests for the person component."""
from unittest.mock import Mock
from homeassistant.components.person import (
ATTR_SOURCE, ATTR_USER_ID, DOMAIN, PersonManager)
from homeassistant.const import (
ATTR_ID, ATTR_LATITUDE, ATTR_LONGITUDE, ATTR_GPS_ACCURACY,
STATE_UNKNOWN, EVENT_HOMEASSISTANT_START)
fro... |
# -*- coding: utf-8 -*-
"""
jinja2.testsuite.fixtures
~~~~~~~~~~~~~~~~~~~~~~~~~
Contains fixtures used by tests.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import re
import sys
from traceback import format_exception
from jinja2... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from opps.channels.models import Channel
from opps.core.permissions.models import ... |
#!/usr/bin/python
import baseclass
import os
import unittest
import time
import blivet.devicelibs.mdraid as mdraid
import blivet.errors as errors
from blivet.size import Size
class MDRaidTestCase(unittest.TestCase):
def testMDRaid(self):
##
## getRaidLevel
##
self.assertEqual(mdr... |
#!/usr/bin/env python3
"""
Created on 3 May 2021
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import json
from scs_core.data.json import JSONify
from scs_core.estate.package_version import PackageVersions
from scs_host.sys.host import Host
# -----------------------------------------------------... |
from . import functions
import os
import plistlib
import re
import sublime
import yaml
ST_SUPPORT_SYNTAX = int(sublime.version()) >= 3084
ST_LANGUAGES = [".sublime-syntax", ".tmLanguage"] if ST_SUPPORT_SYNTAX else [".tmLanguage"]
class SyntaxMappings:
settings = None
logger = None
# contents of this lis... |
import pytest
from mfr.extensions.video import VideoRenderer
@pytest.fixture
def url():
return 'http://osf.io/file/video.mp4'
@pytest.fixture
def download_url():
return 'http://wb.osf.io/file/video.mp4?token=1234'
@pytest.fixture
def file_path():
return '/tmp/video.mp4'
@pytest.fixture
def assets_u... |
# encoding: utf-8
""" library for the thunk.us API """
import urllib
import urllib2
import json
class Thunk:
""" class for creating an object which can talk to the
thunk.us API
"""
def __init__(self):
self.base_url = "http://thunk.us/"
def create(self, name=None):
""" method ... |
# -*- coding: utf8 -*-
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# avalaible on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
"""
This module represent all of behaviors used in the
Idea management process definition.
"""
import datetime
from pyramid.httpexceptions imp... |
#!/usr/bin/python
from __future__ import with_statement
import sys
import os
import datetime
from itertools import repeat
from pyrap.quanta import quantity
from lofarpipe.support.control import control
from lofarpipe.support.utilities import log_time
from lofarpipe.support.parset import patched_parset
from tkp.data... |
"""
Classes for generating random sets of intervals over larger regions.
"""
from bx.bitset import *
import bisect
random = __import__( 'random' )
class MaxtriesException( Exception ):
pass
def throw_random_list( lengths, mask, allow_overlap=False ):
rval = []
throw_random_gap_list( lengths, mask, lambda... |
from flask import render_template, safe_join, send_file
from flask_login import login_required
from redash import settings
from redash.handlers import routes
from redash.handlers.authentication import base_href
from redash.handlers.base import org_scoped_rule
def render_index():
if settings.MULTI_ORG:
re... |
from r2.lib.plugin import Plugin
from r2.lib.js import Module
class Adzerk(Plugin):
needs_static_build = True
js = {
'reddit': Module('reddit.js',
'adzerk/adzerk.js',
)
}
def load_controllers(self):
# replace the standard Ads view with an Adzerk specific one.
... |
# -*- coding: utf-8 -*-
"""
sets
~~~~~
The `sets` module contains a standard collection, :class:`Set`, which is based
on Python's built-in set type.
Its elements are stored in a Redis `set <http://redis.io/commands#set>`_
structure.
"""
from __future__ import division, print_function, unicode_literals
import collect... |
"""Base stuff for testing.
"""
import subprocess
assert not 'twill' in subprocess.__file__
from flask.ext.testing import TestCase
from abilian.application import Application
from abilian.core.entities import db
__all__ = ['TestConfig', 'BaseTestCase']
class TestConfig(object):
SQLALCHEMY_DATABASE_URI = "sqlite:... |
# -*- coding: utf-8 -*-
import os
import logging
import httplib as http
import math
from collections import defaultdict
from itertools import islice
from bs4 import BeautifulSoup
from flask import request
from django.apps import apps
from django.core.exceptions import ValidationError
from django.db.models import Count... |
# coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# 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 ap... |
# -*- coding: utf-8 -*-
import logging
import httplib as http
from flask import request
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework import status
from framework.mongo import StoredObject
from framework.auth.decorators import must_be_logged_in, collect_auth
from framew... |
"""
I lifted from stackoverflow and hacked it
import os
import glob
files = glob.glob(os.path.dirname(__file__)+"/*.py")
modules = []
for f in files:
if os.path.isfile(f) and not f.endswith('__init__.py'):
modules[] = os.path.basename(f)[:-3]
__all__ = modules
del files
del modules
"""
import os
import re
... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generic utils."""
import codecs
import errno
import logging
import os
import Queue
import re
import stat
import sys
import tempfile
import threading
... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generic utils."""
import codecs
import logging
import os
import pipes
import Queue
import re
import stat
import subprocess
import sys
import tempfile... |
import types
from django.core import urlresolvers as django_urlresolvers
from django.utils.functional import curry
class DecoratorMixin(object):
"""
Mixin class to return decorated views from RegexURLPattern/RegexURLResolver
"""
def __init__(self, *args, **kwargs):
super(DecoratorMixin, s... |
import numpy
__all__ = ['enumarray']
class enumarray:
def __init__(self, labels, data=None):
"""An enumerated NumPy array.
Create an enumarray with the given *labels*, which must be specified as
an iterable of iterables. If *data* is supplied (optional), it forms
the values in th... |
import os
from .exceptions import ImproperlyConfigured
from .utils import safe_join
class BaseFinder(object):
def find(self, path, all=False):
raise NotImplementedError()
class FileSystemFinder(BaseFinder):
def __init__(self, directories):
self.locations = []
if not isinstance(dire... |
# -*- coding: utf-8 -*-
__author__ = 'Blake Printy'
__email__ = 'bprinty@gmail.com'
__version__ = '0.2.9'
from .datatypes import composite
from .datatypes import filetree
from .decorators import require
from .decorators import exception
from .decorators import keywords
from .decorators import cached
from .metaclas... |
from .models import Client
from .models import Contact
from .models import Contract
from .models import Estimate
from .models import File
from .models import Invoice
from .models import Newsletter
from .models import Note
from .models import Profile
from .models import Project
from .models import Proposal
from .models ... |
from boto.exception import BotoServerError
from collections import OrderedDict
from decimal import Decimal
from django.conf import settings as django_settings
from django.contrib import messages
from django.contrib.gis.geoip2 import GeoIP2
from django.core.mail import send_mail
from django.core.paginator import Paginat... |
from decimal import Decimal
from django.conf import settings as django_settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.gis.geoip2 import GeoIP2
from django.core.mail import send_mail as django_send_mail
from django.core.paginator import Paginator
from django.... |
#!/usr/bin/env python
from argparse import ArgumentParser
from ServerConfig import General
from ServerConfig import Storage
from ServerConfig import Microbench
from ServerConfig import TellStore
from mbclient import startMBClient
from mbserver import startMBServer
from storage import *
from observer import *
from func... |
from collections import OrderedDict
from decimal import Decimal
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.core.paginator import Paginator
from django.core.paginator import EmptyPage
from django.core... |
from django.http import HttpResponse
import datetime
import json
from api.models import Client, Event, Coc
from django.http import HttpResponseRedirect
import collections
from decimal import Decimal
from django.forms.models import model_to_dict
from django.db.models import F
from dateutil import parser
from django.db.m... |
from .forms import ClientForm
from .forms import CompanyForm
from .forms import ContactForm
from .forms import EstimateForm
from .forms import InvoiceForm
from .forms import MailForm
from .forms import NoteForm
from .forms import ProfileForm
from .forms import ProjectForm
from .forms import ReportForm
from .forms impor... |
import json
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from rest_framework import viewsets
from rest_framework import exceptions
from rest_framework import permissions
from rest_framework.... |
# from django.shortcuts import render
# Create your views here.
from django.contrib.auth.models import User
from rest_framework import viewsets, mixins, permissions, exceptions
from .models import Notebook, Note, Task
from .serializers import UserSerializer, NotebookSerializer, NoteSerializer, TaskSerializer
class... |
import re
import json
from decimal import Decimal
from django import forms
from django.conf import settings
from django.utils.safestring import mark_safe
re_id = re.compile('id="([^"]+)"')
class DateWidget(forms.TextInput):
def __init__(self, attrs={}):
super(DateWidget, self).__init__(attrs={
... |
# coding=utf-8
from rest_framework import viewsets
from .models import AirCondition, AirAverage
from .serializers import AirAverageSerializer, AirConditionSerializer
class AirConditionViewSets(viewsets.ReadOnlyModelViewSet):
queryset = AirCondition.objects.all().order_by('-time')[:12] # 12 hours
serialize... |
# This file is part of beets.
# Copyright 2015
#
# 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, pu... |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 2012 CERN.
##
## Invenio 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... |
"""Provides classes for handling API requests."""
# -*- coding: utf-8 -*-
from distutils.util import strtobool
from itertools import chain
import logging
import json
from django.utils import timezone
from datetime import timedelta
import dateutil.parser
import requests
from cachetools.func import ttl_cache
from django... |
# This file is part of beets.
# Copyright 2012, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# 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 limitati... |
from django.db.models.query import RawQuerySet, RawQuerySet
from django.template import RequestContext
from django.shortcuts import redirect, get_object_or_404, render_to_response
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.http import Http404,HttpResponseServerError,HttpResponseRedi... |
[Python] Singleton class example
|
from . quote_fields import quote_definitions, quote_dtypes
from io import StringIO
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
from requests import Session
# TODO look into read_csv use_cols option for speedups
# TODO Fix doc comment formatting on methods
class ActiveTick:
def ... |
from django.core.management.base import BaseCommand
from morphgnt_api.models import Word
def u(s):
return s.decode("utf-8")
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("filename", help="filename to import")
def handle(self, *args, **options):
filen... |
#!/usr/bin/env python
import rospy
import math
import time
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
class WallAvoid(object):
def __init__(self, timeout=None):
rospy.init_node("WallAvoid")
self.turnCoef = [(x ** 2 - 8100) / 10000000.0 for x in range(-90, 0)] + [(-x... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import datetime
import time
from django.db.models.query import RawQuerySet, RawQuerySet
from django.template import RequestContext
from django.shortcuts import redirect, get_object_or_404, render_to_response
from django.core.paginator import Paginator, InvalidPage, ... |
#!/usr/bin/env python
import rospy
import math
import time
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
class WallAvoid(object):
def __init__(self, timeout=None):
rospy.init_node("WallAvoid")
self.turnCoef = [(x ** 2 - 8100) / 10000000.0 for x in range(-90, 0)] + [(-x... |
import os, os.path as path
import re
import SCons.Variables
import SCons.Environment
class BuildConfig(object):
def __init__(self, **kwargs):
if not hasattr(os, 'uname') or self.matches('CYGWIN'):
self.os = 'win32'
elif self.matches('Darwin'):
self.os = 'osx'
elif self.matches('Linux'):
self.os = 'lin... |
##
# Registry is a GeniServer that implements the Registry interface
import tempfile
import os
import time
import sys
from geni.util.credential import Credential
from geni.util.hierarchy import Hierarchy
from geni.util.trustedroot import TrustedRootList
from geni.util.cert import Keypair, Certificate
from geni.util.g... |
from Cookie import Cookie
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import SESSION_KEY
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from django.utils.translation import ugettext_lazy as _
from socke... |
import math
import numpy as np
import random
import copy
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
from tools import action as a
from tools import Simulation as Sim
from naoth import math2d as m2d
from tools import tools
from tools import field_info as field
from tools import raw_attack... |
# ActivitySim
# See full license in LICENSE.txt.
import os
import logging
import logging.config
import sys
import time
from collections import OrderedDict
import yaml
import numpy as np
import pandas as pd
from activitysim.core import inject
import inject_defaults
import config
# Configurations
ASIM_LOGGER = 'ac... |
from datetime import datetime
import requests
import json
from auth import TTRAuth
from exceptions import raise_on_error
class TTRClient(object):
"""
This is the actual client interface to Tiny Tiny RSS.
This object retains a http session with the needed session cookies. From
the client you can fetch... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2018, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
'''
This script allows to split the dataset of songs into training/validation/test
splits. It is done at the song granularity in order to prevent leaking
information within each song (compared to splitting at block level).
Also this approach is invariant to the block/hop size of features like
chromagram. This allows t... |
"""Pump simulated OpenStack notificationss into RabbitMQ.
You need to install rabbitqm-server and
pip install librabbitmq
pip install --pre notabene
pip install --pre notification_utils
"""
import datetime
from notabene import kombu_driver as driver
import notification_utils
import notigen
connection = driver.cre... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Address(dict):
"""
Dictionary class that provides some convenience wrappers for accessing
commonly used data elements on an Address.
"""
def __init__(self, address_dict, order='lat'):
super(Address, self).__init__(address_dict)
s... |
#
# Copyright (c) 2004 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... |
from datetime import datetime
import requests
import json
from auth import TTRAuth
from exceptions import raise_on_error
class TTRClient(object):
"""
This is the actual client interface to Tiny Tiny RSS.
This object retains a http session with the needed session cookies. From
the client you can fetch... |
"""
@package mi.instrument.sunburst.sami2_pco2.pco2a.test.test_driver
@file marine-integrations/mi/instrument/sunburst/sami2_pco2/pco2a/driver.py
@author Christopher Wingard
@brief Test cases for pco2a driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_dri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
import subprocess
from import_abstr import ImportAbstraction
class ImportSTM( ImportAbstraction ):
SCRIPT = """# Load an STM model and save its content as Termite Data Server files
# Load required libraries
library(stm)
library(lda)
# Define ... |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
import json
def boundingBoxAroundPolyCoords(coords):
"""
bounding box
"""
x_all = []
y_all = []
for first in coords[0]:
x_all.append(first[1])
y_all.append(first[0])
return [min(x_all), min(y_all), max(x_all), max(y_all)]
def pointInBoundingBox(point, bounds):
"""
... |
#
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
"""
Module implementing the "macro" dictionary class
"""
import log
class Macros(dict):
def __setitem__(self, name, value):
# only expand references to ourself
d = {name: self.get(name)}
# escape any macros in the new value
... |
"""
Tukio Workflow Engine
"""
import asyncio
import logging
import weakref
from tukio.workflow import OverrunPolicy, new_workflow
from tukio.broker import get_broker
from tukio.task import tukio_factory
from tukio.utils import Listen
log = logging.getLogger(__name__)
class _WorkflowSelector:
"""
This clas... |
# -*- coding: utf-8 -*-
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
import os
#DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT = ... |
# Copyright (c) 2011, 2012, 2013 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... |
#
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import imp, sys
import os
import util
import build
import package
import shutil
import types
import inspect
import lookaside
import rpmhelper
import gzip
baseMacros = (
# Note that these macros cannot be represented as a dictionary,
# because the it... |
"""便利関数とか"""
def generate_token():
# まだスタブ
return 'N0IHdzb2MiLCJzdWIiOiJBQkNERUYiLCJhdWQiOiJJSktMTU4iLCJ'
トークンを生成する関数
"""便利関数とか"""
import base64
import uuid
def generate_token():
"""アクセストークンの生成."""
return base64.b64encode(uuid.uuid4().bytes).decode()
|
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
tests.integration.states.pip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
import os
import glob
import shutil
import sys
try... |
# Copyright (c) 2011, 2012, 2013 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... |
#
# Copyright (c) 2004-2005 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.o... |
'''
@author: Remi Cattiau
'''
from nxdrive.logging_config import get_logger
from nxdrive.engine.workers import Worker, ThreadInterrupt
from nxdrive.engine.blacklist_queue import BlacklistQueue
from nxdrive.engine.watcher.local_watcher import DriveFSEventHandler, normalize_event_filename
from nxdrive.engine.activity imp... |
import os
import tempfile
import pytest
from rancher import ApiError
from kubernetes.client import CoreV1Api
from .common import auth_check, random_str, string_to_encoding
from .conftest import wait_for
import time
def test_node_fields(admin_mc):
cclient = admin_mc.client
fields = {
'annotations': 'cr... |
# -*- coding: utf-8 -*-
import FreeCAD,Draft,Spreadsheet
# create spreadsheet and prepere it for data
if FreeCAD.ActiveDocument.getObject("toCut"):
FreeCAD.ActiveDocument.removeObject("toCut")
result = FreeCAD.ActiveDocument.addObject("Spreadsheet::Sheet","toCut")
result.mergeCells('B1:D1')
result.set( 'A1', 'Typ'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from spiderx.httpclient.ipshardclient import IPShardDelayClient
from spiderx.xml.sax.htmlparser import HTMLParser
from spiderx.core.ilog import get
import re
import socket
logger = get(__file__)
class Meta :
def __init__(self) :
self.sip6 = sip4 = None
... |
#
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# copied from harvest_template.py which is due to:
# (C) 2013 Multichill, Amir
# (C) 2013 Pywikipediabot team
#
# Distributed under the terms of MIT License.
#
import re
import json
import pywikibot
from pywikibot import pagegenerators as pg
from pywikibot import textlib
impo... |
# Copyright 2020 Planet Labs, 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 wr... |
import re
from collections import OrderedDict
import json
import xmltodict
from share.transform.base import BaseTransformer
from share.transform.chain.links import Context
# NOTE: Context is a thread local singleton
# It is assigned to ctx here just to keep a family interface
ctx = Context()
class ChainTransforme... |
'''
PathwayGenie (c) GeneGenie Bioinformatics Ltd. 2018
PathwayGenie is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
# pylint: disable=too-many-arguments
# pylint: disable=too-many-locals
import random
import sys
... |
import os
import re
import sys
import json
import math
import crayons
import requests
import collections
import better_exceptions
from dateutil import parser
from bs4 import BeautifulSoup
from operator import itemgetter
from datetime import date, datetime
better_exceptions.MAX_LENGTH = None
THIS_DIR = os.path.dirname... |
import json
from onadata.apps.api.tests.viewsets.test_abstract_viewset import\
TestAbstractViewSet
from onadata.apps.api.viewsets.project_viewset import ProjectViewSet
from onadata.libs.permissions import (
OwnerRole, ReadOnlyRole, ManagerRole, DataEntryRole, EditorRole)
from onadata.apps.api.models import Proj... |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
from base64 import b64encode
import json
import pytest
from six import text_type
from openapi_core.schema.media_types.exceptions import (
InvalidContentType, InvalidMediaTypeValue,
)
from openapi_core.extensions.models.models import BaseModel
from openapi_core.schema.operations.exceptions import InvalidOperation
f... |
#!/usr/bin/env python
# build_script.py - Build, install, and test XCTest -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/L... |
#!/usr/bin/env python3
import hexchat
import requests
import sys
import threading
__module_name__ = "Twitch Title"
__module_author__ = "Poorchop"
__module_version__ = "1.0"
__module_description__ = "Display stream status and description for TwitchTV streams"
t = None
twitch_chans = {}
def is_twitch():
server =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.