gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""
pygments.lexers.rebol
~~~~~~~~~~~~~~~~~~~~~
Lexers for the REBOL and related languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from ..lexer import RegexLexer, bygroups
from ..token impor... | |
import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... | |
"""
@package mi.instrument.um.thsph.thsph.driver
@file marine-integrations/mi/instrument/um/thsph/thsph/driver.py
@author Richard Han
@brief Driver for the thsph
Release notes:
Vent Chemistry Instrument Driver
"""
__author__ = 'Richard Han'
__license__ = 'Apache 2.0'
import time
import re
from ion.agents.instrum... | |
import re
import sys
from collections import defaultdict, namedtuple
from checkfort.exceptions import *
from checkfort.logging import p_debug, p_verbose, p_info
class EventInstance(object):
def __init__(self, code, culprit, linenum=None, filename=None):
assert not filename or "../" not in filename
... | |
# Copyright 2016 Kevin B Jacobs
#
# 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... | |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: November 25, 2009
# Author: Francesc Alted - faltet@pytables.com
#
# $Id$
#
########################################################################
"""Create links in the HDF5 file.
This modu... | |
# Copyright 2017-present Adtran, 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 writ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | |
# Copyright 2015 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... | |
"""The Shelly integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
from typing import Any, Final, cast
import aioshelly
from aioshelly.block_device import BlockDevice
from aioshelly.rpc_device import RpcDevice
import async_timeout
import voluptuous as vol
fr... | |
from __future__ import print_function
import os
import subprocess
import sys
import textwrap
from tracing import Tracing
from buck_tool import BuckTool, JAVA_MAX_HEAP_SIZE_MB, platform_path
from buck_tool import BuckToolException, RestartBuck
from subprocess import check_output
from subprocutils import which
import bu... | |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import logging
import argparse
import platform
import subprocess
os.environ["PYTHONUNBUFFERED"] = "y"
PY2 = sys.version_info[0] == 2
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.app... | |
import json
from django.contrib.auth.decorators import user_passes_test
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from crits.backdoors.forms import AddBack... | |
#!/usr/bin/env python
# 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.
"""Issues sharded slavekill, delete build directory, and reboot commands."""
import multiprocessing
import optparse
import os
impo... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
from collections.abc import MappingView
from types import MappingProxyType
import numpy as np
from astropy import units as u
from astropy.utils.state import ScienceState
from astropy.utils.decorators import format_doc... | |
# Copyright 2015 SimpliVity Corp.
#
# 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 o... | |
#!/usr/bin/env python
#
# Copyright (c) 2015 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.
"""Adds the code parts to a resource APK."""
import argparse
import itertools
import os
import shutil
import sys
import zipfile
... | |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | |
import afnumpy
import numpy
import afnumpy as af
import numpy as np
from asserts import *
import pytest
xfail = pytest.mark.xfail
def test_zeros():
a = afnumpy.zeros(3)
b = numpy.zeros(3)
iassert(a, b)
def test_fromstring():
iassert(afnumpy.fromstring('\x01\x02', dtype=numpy.uint8),numpy.fromstring('\... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-,
from __future__ import absolute_import
from __future__ import print_function
import ROOT
ROOT.PyConfig.IgnoreCommandLineOptions = True
import csv
import numpy as np
def init_palette():
from rootpy.plotting.style import set_style, get_style
atlas = get_style("... | |
import threading
from socket import AF_UNSPEC
from pyroute2.netlink.rtnl.rtmsg import rtmsg
from pyroute2.netlink.rtnl.req import IPRouteRequest
from pyroute2.ipdb.transactional import Transactional
class Metrics(Transactional):
def __init__(self, *argv, **kwarg):
Transactional.__init__(self, *argv, **kw... | |
#!/usr/bin/env python
# vim: et :
import logging
import re
import sys
import time
sys.path.append('../../nipap/')
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
log_format = "%(levelname)-8s %(message)s"
log_stream = logging.StreamHandler()
log_stream.setFormatter(logging.Formatter("%(asctime)s: " + log... | |
# [ Ripping trackerjacker like crazy ]#
from netaddr import *
from scapy.all import *
from boop.lib import *
from pyric.utils import channels
class Dot11Frame:
TO_DS = 0x1
FROM_DS = 0x2
def __init__(self, frame):
self.frame = frame
self.bssid = None
self.ssid = None
se... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | |
# External Dependencies
from __future__ import division
from math import sqrt
from numpy import poly1d
from warnings import warn
import os
from svgpathtools import (Path, Line, polyroots, real,
imag, disvg, wsvg)
from svgpathtools.misctools import isclose
poly_imag_part = imag
poly_real_part =... | |
# -*- coding: utf-8 -*-
import unittest
import jwt
from eve import Eve
from eve_auth_jwt import JWTAuth
from flask import g
from eve_auth_jwt.tests import test_routes
settings = {
'JWT_SECRET': 'secret',
'JWT_ISSUER': 'https://domain.com/token',
'JWT_ROLES_CLAIM': 'roles',
'JWT_SCOPE_CLAIM': 'scope',... | |
from distutils.dir_util import copy_tree
import glob
import os
import shutil
from django.core.management import BaseCommand, CommandError
from django.conf import settings
from django.core.management import call_command
from django.db import connection
from gcutils.bigquery import Client as BQClient, DATASETS, build_... | |
import numpy as np
import itertools
import random
from qitensor import qudit, direct_sum, NotKetSpaceError, \
HilbertSpace, HilbertArray, HilbertError, HilbertShapeError, MismatchedSpaceError
from qitensor.space import create_space2
toler = 1e-12
# FIXME - some methods don't have docs
# FIXME - use CP_Map in the... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import os
import shutil
from contextlib import contextmanager
from textwrap i... | |
# -*- coding: utf-8 -*-
import random
import uuid
from unittest import TestCase
from faker import Faker
from rwslib.builders.admindata import Location
from rwslib.builders.constants import QueryStatusType
from rwslib.builders.clinicaldata import ClinicalData, FormData, ItemData, ItemGroupData, MdsolQuery, StudyEvent... | |
"""
:class:`.YahooPlaceFinder` geocoder.
"""
from functools import partial
try:
from requests import get, Request
from requests_oauthlib import OAuth1
requests_missing = False
except ImportError:
requests_missing = True
from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT
from geopy.exc import ... | |
"""
Event parser and human readable log generator.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logbook/
"""
import asyncio
import logging
from datetime import timedelta
from itertools import groupby
import voluptuous as vol
from homeassistant.core ... | |
from __future__ import absolute_import
from sentry.api.bases.project import ProjectPermission
from sentry.models import ApiKey
from sentry.testutils import TestCase
class ProjectPermissionBase(TestCase):
def setUp(self):
self.org = self.create_organization()
self.team = self.create_team(organizat... | |
import sys
from pysamimport import pysam
import re
import inspect
class BadRead(RuntimeError):
def __init__(self):
RuntimeError.__init__(self, self.header)
class IsBadRead(BadRead):
header = "BadRead"
class IsDuplicate(BadRead):
header = "Alignment:IsDuplicate"
class IsQCFail(BadRead):
... | |
# -*- coding: utf-8 -*-
from opensextant.TaxCat import Taxon, get_taxnode, TaxCatalogBuilder, get_starting_id
import json
catalog = "WFB" # WFB = World FactBook
min_len = 4
min_len_acronym = 3
def evaluate_text(txn, stop):
"""
Consolidate evaluations of text if it is valid to tag or not.
:param txn: Ta... | |
# 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... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Assets Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 withou... | |
from __future__ import unicode_literals
from collections import OrderedDict
import copy
from django.apps import AppConfig
from django.apps.registry import Apps, apps as global_apps
from django.db import models
from django.db.models.options import DEFAULT_NAMES, normalize_together
from django.db.models.fields.related i... | |
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""The Viewfinder schema definition.
The schema contains a set of tables. Each table is described by name,
key, a set of columns, and a list of versions.
The table name is the name used to access the database. The table key
is used to segment index terms by table... | |
#!/usr/bin/env python
# Copyright (c) 2015 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.
from __future__ import absolute_import
import argparse
import logging
import os
import platform
import shutil
import stat
import su... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
"""
Module provides the api connection class for pulling DHCD DFD data
on projects pending funding and development
from https://octo.quickbase.com/db/<DB_ID>
Quickbase API
"""
import sys, os
import string
# Enable relative package imports when running this file as a script (i.e. for testing purposes).
python_filepat... | |
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
import commonware
from rest_framework import status
from rest_framework.mixins import (CreateModelMixin, DestroyModelMixin,
ListModelMixin, RetrieveModelMixin,
... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from datetime import datetime
from functools import wraps
from werkzeug.local import LocalProxy
from flask import (request, Response, after_this_request, make_response, session, redirect,
jsonify, current_app)
from flask_login import login_user as _login_user, logout_user, current_user, login_requir... | |
#!/usr/bin/env python
# Copyright (C) 2020 T. Zachary Laine
#
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import lzw
constants_header_form = '''\
// Copyright (C) 2020 T. Zachary Laine
//
// Distributed under... | |
"""Benchmark to help choosing the best chunksize so as to optimize the access
time in random lookups."""
import subprocess
from pathlib import Path
from time import perf_counter as clock
import numpy as np
import tables as tb
# Constants
NOISE = 1e-15 # standard deviation of the noise compared with actual values
... | |
#!/usr/bin/env python3
#
# Copyright (c) 2012 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
# Copyright (c) 2012 Michal J Wallace. <http://www.michaljwallace.com/>
# Copyright (c) 2012, 2016 Charles Childers <http://forthworks.com/>
#
# Permission is hereby granted, free of charge, to any person obtaining a c... | |
#!/usr/bin/env python
# Copyright (C) 2015 The Android Open Source Project
#
# 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 requi... | |
# -*- coding: utf-8 -*-
#
# This file is part of GetTor.
#
# :authors: Israel Leiva <ilv@torproject.org>
# Based on BridgeDB Twitter distributor (PoC) by wfn
# - https://github.com/wfn/twidibot
#
# :copyright: (c) 2008-2015, The Tor Project, Inc.
# (c) 2015, Israel Leiva
#
# :license... | |
# Calculates and optionally plots the entropy of input files.
import os
import math
import zlib
import binwalk.core.common
from binwalk.core.compat import *
from binwalk.core.module import Module, Option, Kwarg
class Entropy(Module):
XLABEL = 'Offset'
YLABEL = 'Entropy'
XUNITS = 'B'
YUNITS = 'E'
... | |
import unittest
import visgraph.graphcore as v_graphcore
s1paths = [
('a','c','f'),
('a','b','d','f'),
('a','b','e','f'),
]
s2paths = [
('a','b'),
('a','b','c'),
]
class GraphCoreTest(unittest.TestCase):
def getSampleGraph1(self):
# simple branching/merging graph
g = v_graphc... | |
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import glob
class VisualStudioVersion(ob... | |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import random
import math
##############################################
def sepLine(w, x):
return -((w[0]+w[1]*x)/w[2])
#end
def drawSepLine(w, minX, maxX):
sepx = range(minX, maxX)
sepy = []
for e in sepx:
tm... | |
# AnalogClock's base classes
# E. A. Tacao <e.a.tacao |at| estadao.com.br>
# http://j.domaindlx.com/elements28/wxpython/
# 15 Fev 2006, 22:00 GMT-03:00
# Distributed under the wxWidgets license.
from time import strftime, localtime
import math
import wx
from styles import *
#-----------------------------------... | |
import unittest
import numpy as np
import pysal
from pysal.spreg.twosls import BaseTSLS, TSLS
class TestBaseTSLS(unittest.TestCase):
def setUp(self):
db = pysal.open(pysal.examples.get_path("columbus.dbf"),'r')
self.y = np.array(db.by_col("CRIME"))
self.y = np.reshape(self.y, (49,1))
... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import L... | |
"""
Helpers for working with ``eazy-py``.
"""
import numpy as np
def fix_aperture_corrections(tab, verbose=True, ref_filter=None):
"""
June 2020: Reapply total corrections using fixed bug for the kron total
corrections where the necessary pixel scale wasn't used.
"""
from grizli import prep, util... | |
#!/usr/bin/python
from string import Template
import os
import io
import glob
import shutil
from mimetypes import guess_type
from mimetypes import add_type
platforms = ("win32", "android", "macosx", "ios", "cmake", "emscripten", "all")
def relpath(a, b):
try:
return os.path.relpath(a, b)
except Val... | |
"""Incremental Feature Dependency Discovery"""
# iFDD implementation based on ICML 2011 paper
from copy import deepcopy
import numpy as np
from rlpy.Tools import printClass, PriorityQueueWithNovelty
from rlpy.Tools import powerset, combinations, addNewElementForAllActions
from rlpy.Tools import plt
from .Representati... | |
# Copyright 2012-2013 OpenStack Foundation
#
# 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 la... | |
# -*- coding: utf-8 -*-
from datetime import timedelta
import arrow
import mock
from django import http
from django import test
from django.conf import settings
from django.utils import timezone
from cradmin_legacy import cradmin_testhelpers
from model_bakery import baker
from devilry.apps.core import models as cor... | |
#!/usr/bin/env python
#
# Website info gathering
#
# TODO collect WHOIS information
# TODO add choice to select different report types about website
# TODO add choice to select different report format (text, json, html) about website
# TODO add sitemap-image support (http://support.google.com/webmasters/bin/answer.p... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
import datetime
import json
import logging
import mock
import six
import zlib
from sentry import tagstore
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_setti... | |
#!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 The Electrum developers
#
# 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... | |
from __future__ import unicode_literals
from django.views.generic import View
from django.shortcuts import render_to_response, RequestContext, Http404, HttpResponseRedirect
from gge_proxy_manager.models import ProductionJob, ProductionLog, Player
from django.core.urlresolvers import reverse
from intern.forms.my import... | |
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, HttpResponseBadRequest
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from ... | |
from direct.fsm import ClassicFSM, State
from toontown.shtiker.OptionsPageGUI import OptionButton
from toontown.toonbase.TTLocalizer import Controls, RemapPrompt, RemapPopup
from toontown.toonbase.ToontownGlobals import OptionsPageHotkey
from toontown.toontowngui import TTDialog
class ControlRemap:
UP = 0
LE... | |
"""
BOOTMACHINE: A-Z transmutation of aluminium into rhodium.
"""
import copy
import getpass
import logging
import sys
import telnetlib
from fabric.api import env, local, run, sudo
from fabric.decorators import parallel, task
from fabric.colors import blue, cyan, green, magenta, red, white, yellow # noqa
from fabric.... | |
from dataserv_client import common
import os
import tempfile
import unittest
import datetime
import json
import psutil
from future.moves.urllib.request import urlopen
from dataserv_client import cli
from dataserv_client import api
from btctxstore import BtcTxStore
from dataserv_client import exceptions
url = "http://... | |
from approver.models import Person, Project, Keyword, ClinicalArea, ClinicalSetting, BigAim, Descriptor, Contact
from approver.constants import SESSION_VARS
from approver.utils import extract_tags, update_tags, extract_model
import approver.utils as utils
from approver.utilities import send_email
from approver.constant... | |
from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import *
import DistributedPhysicsWorldAI
from direct.fsm.FSM import FSM
from toontown.ai.ToonBarrier import *
from toontown.golf import GolfGlobal... | |
"""
This allows creation of a community of groups without a graphical user interface.
WARNING: As these routines run in administrative mode, no access control is used.
Care must be taken to generate reasonable metadata, specifically, concerning
who owns what. Non-sensical options are possible to create.
This code is n... | |
"""Database support module for the benchbuild study."""
import logging
from sqlalchemy.exc import IntegrityError
from benchbuild.settings import CFG
LOG = logging.getLogger(__name__)
def validate(func):
def validate_run_func(run, session, *args, **kwargs):
if run.status == 'failed':
LOG.de... | |
"""Adds LRU cache management and automatic data timeout to Python's Shelf.
Classes:
LRUShelf: A shelf with LRU cache management.
TimeoutShelf: A shelf with automatic data timeout features.
LRUTimeoutShelf: A shelf with LRU cache management and data timeout.
Functions:
open: Open a database file as a p... | |
"""
These tests were brought over from UrbanSim.
"""
from __future__ import division
import os.path
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from patsy import dmatrix
from choicemodels import mnl
@pytest.fixture
def num_alts():
return 4
@pytest.fixture(scope='module',... | |
"""
Base and utility classes for tseries type pandas objects.
"""
import warnings
from datetime import datetime, timedelta
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas.core.tools.timedeltas import to_timedelta
import numpy as np
from pandas.core.dtypes.common import (
is_i... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import shlex
import subprocess
import sys
import logging
from xml.etree import ElementTree as ET
from multiprocessing import Process
FORMAT = '[%(asctime)-15s] [%(levelname)s] [%(filename)s %(levelno)s line] %(message)s'
logger = logging.getLogger(_... | |
import argparse
import io
import logging
import os
import sys
import xml.etree.ElementTree as etree
from diff_cover import DESCRIPTION, VERSION
from diff_cover.config_parser import Tool, get_config
from diff_cover.diff_reporter import GitDiffReporter
from diff_cover.git_diff import GitDiffTool
from diff_cover.git_path... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
"""CLI Module
This module helps enable the CLI."""
import sys
import logging
import traceback
import time, datetime
from colorama import Fore
from mookfist_lled_controller import scan_bridges
from mookfist_lled_controller import create_bridge
from mookfist_lled_controller import logger
from mookfist_lled_controller.... | |
#
# 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 writing, software
# ... | |
# Generated by Django 2.1.2 on 2018-10-17 18:46
from decimal import Decimal
import django.contrib.postgres.fields.jsonb
import django.core.validators
import django.db.models.deletion
from django.db import migrations, models
import saleor.payment
class Migration(migrations.Migration):
initial = True
depen... | |
#!/usr/bin/env python3
# IPFIX support for Scapy (RFC7011)
from scapy.all import bind_layers, FieldLenField, IntField, Packet, \
PacketListField, ShortEnumField, ShortField, StrLenField
from scapy.layers.inet import UDP
# IPFIX Information Elements http://www.iana.org/assignments/ipfix/ipfix.xhtml
information_el... | |
"""
Default settings for the ``mezzanine.core`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
mak... | |
# Copyright (c) 2019, Xilinx, Inc.
# 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 notice,
# this list of con... | |
"""
General serializer field tests.
"""
from __future__ import unicode_literals
import datetime
from decimal import Decimal
from uuid import uuid4
from django.core import validators
from django.db import models
from django.test import TestCase
from django.utils.datastructures import SortedDict
from rest_framework impo... | |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | |
from collections import Counter
from datetime import datetime
from django.contrib import messages
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth import login as login_user
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
from django.ht... | |
""" Functionality for managing child processes. """
# Don't import signal from this package
from __future__ import absolute_import
import os.path, struct, cPickle, sys, signal, traceback, subprocess, errno, \
stat, time
from srllib import threading, util
from srllib._common import *
from srllib.error import BusyEr... | |
import atexit
import glob
import logging
import os
import random
import re
import signal
import subprocess
import sys
import time
import irc.client
PYTHON = os.getenv('PYTHON', "python3")
class Client(irc.client.SimpleIRCClient):
def __init__(self):
irc.client.SimpleIRCClient.__init__(self)
self.... | |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | |
# These are tests for Zulip's database migrations. System documented at:
# https://zulip.readthedocs.io/en/latest/subsystems/schema-migrations.html
#
# You can also read
# https://www.caktusgroup.com/blog/2016/02/02/writing-unit-tests-django-migrations/
# to get a tutorial on the framework that inspired this featu... | |
# Copyright 2015 Cloudera 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 writing, softw... | |
# Copyright (c) 2014 Hoang Do, Phuc Vo, P. Michiardi, D. Venzano
#
# 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 appli... | |
from datetime import datetime
import importlib
from io import StringIO
import os
import sys
from types import ModuleType
from typing import Union, Optional, Set, Tuple, Callable
from hwt.doc_markers import internal
from hwt.hdl.types.bits import Bits
from hwt.hdl.types.enum import HEnum
from hwt.hdl.value import HValu... | |
#!/usr/bin/env python
"""push.py - Send a notification using Pushover"""
__version__ = "0.1"
__author__ = "Brian Connelly"
__copyright__ = "Copyright (c) 2014 Brian Connelly"
__credits__ = ["Brian Connelly"]
__license__ = "MIT"
__maintainer__ = "Brian Connelly"
__email__ = "bdc@bconnelly.net"
__status__ = "Beta"
imp... | |
import os
import sys
import errno
import uuid
from atomicwrites import atomic_write
__version__ = '0.1.0'
PY2 = sys.version_info[0] == 2
class cached_property(object):
'''A read-only @property that is only evaluated once. Only usable on class
instances' methods.
'''
def __init__(self, fget, doc=Non... | |
# -*- coding: utf-8 -*-
"""
core
~~~~
Core functionality shared between the extension and the decorator.
:copyright: (c) 2016 by Cory Dolphin.
:license: MIT, see LICENSE for more details.
"""
import re
import logging
try:
# on python 3
from collections.abc import Iterable
except ImportError... | |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.