gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2011 Adi Roiban.
# See LICENSE for details.
"""
PQM related targets for paver.
"""
from __future__ import (
absolute_import,
print_function,
with_statement,
unicode_literals,
)
import os
import re
import sys
from paver.easy import call_task, needs, task
from paver.tasks import envi... | |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:4364")
else:
access = Ser... | |
#!/usr/bin/env python3
"""
This script holds the functions that make the API requests, process the
JSON data and build a single grid in HTML where each tile holds movie
data (graphic, YouTube trailer link, story etc.)
Attributes:
API_KEY (str): YouTube Data API key.
PLAYLIST_ID (str): YouTube playlist id.
... | |
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
from scipy import sparse
from math import sqrt
fro... | |
"""
Support for Z-Wave.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zwave/
"""
import logging
import os.path
import time
from pprint import pprint
import voluptuous as vol
from homeassistant.helpers import discovery, customize
from homeassistant.co... | |
# Copyright (c) 2011 - 2017, Intel Corporation.
#
# 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 agre... | |
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import intel64
from chainer import function_node
from chainer.utils import collections_abc
from chainer.utils import type_check
import chainerx
_numpy_split_ok = numpy.lib.NumpyVersion(numpy.__version__) >= '1.11.0'
def _fix_n... | |
# -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, ProxyManager
from .packages.urllib3.response import... | |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | |
#!/usr/bin/python
#
# Written by Gavin Heverly-Coulson
# Email: gavin <at> quantumgeranium.com
#
# Reads the energies from the Quantum Espresso output files
# that result from running the jobs built by pes_builder.py
# Prints a file containing the surface energies (in J/m^2) for each
# point on the PES. Also writes a... | |
# Copyright (c) 2009, Peter Sagerson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice, this
# list of conditions and the ... | |
"""Category operations used by neo4j graph rewriting tool."""
from . import generic
from . import rewriting
from regraph.exceptions import (HierarchyError,
TypingWarning)
def pullback(b, c, d, a=None, inplace=False):
"""Find the pullback from b -> d <- c.
Returns
------... | |
# Copyright 2014 Mellanox Technologies, Ltd
#
# 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 t... | |
#takes an article, finds heads of verbs and extracts all features
print 'importing'
from nltk.tree import *
from nltk.corpus import verbnet as vn
import csv
import os
import sys
from parc_reader import ParcCorenlpReader as P
import multiprocessing
from multiprocessing import Manager
print 'imports done'
import time
im... | |
# -*- coding: utf-8 -*-
"""Supports the Ion Velocity Meter (IVM)
onboard the Ionospheric Connections (ICON) Explorer.
Parameters
----------
platform : string
'icon'
name : string
'ivm'
tag : string
None supported
sat_id : string
'a' or 'b'
Warnings
--------
- No download routine as ICON has not yet b... | |
# -*- coding: utf-8 -*-
"""Factories for the OSF models, including an abstract ModularOdmFactory.
Example usage: ::
>>> from tests.factories import UserFactory
>>> user1 = UserFactory()
>>> user1.username
fred0@example.com
>>> user2 = UserFactory()
fred1@example.com
Factory boy docs: http://f... | |
"""
This is a very carefully-controlled file used to allow all other python modules
to log their activity in a sane manner. Code which wishes to log its activity
will usually include lines such as the following at the top:
####################################
# SETTING UP THE LOGGER
import os
from Lit... | |
"""Beatles Dataset Loader
.. admonition:: Dataset Info
:class: dropdown
The Beatles Dataset includes beat and metric position, chord, key, and segmentation
annotations for 179 Beatles songs. Details can be found in http://matthiasmauch.net/_pdf/mauch_omp_2009.pdf and
http://isophonics.net/content/refe... | |
# Copyright 2013 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.
"""Parses the command line, discovers the appropriate benchmarks, and runs them.
Handles benchmark configuration, but all the logic for
actually running the... | |
# -*- coding: utf-8 -*-
""" Core components """
from boto.exception import JSONResponseError, BotoServerError
from dynamic_dynamodb import calculators
from dynamic_dynamodb.aws import dynamodb, sns
from dynamic_dynamodb.core import circuit_breaker
from dynamic_dynamodb.statistics import gsi as gsi_stats
from dynamic_d... | |
#!/usr/bin/env python3
import can
from functools import reduce
import logging
from operator import xor
import RPi.GPIO as GPIO
import signal
from time import sleep
from sys import exit
import socketcanopen
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
DEFAULT_CAN_INTERFACE = "vcan0"
RE... | |
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# 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 a... | |
import unittest
from feedly.storage.redis.structures.hash import RedisHashCache,\
ShardedHashCache, FallbackHashCache
from feedly.storage.redis.structures.list import RedisListCache,\
FallbackRedisListCache
from feedly.storage.redis.connection import get_redis_connection
from functools import partial
from feedl... | |
"""
This module contains functions for building and loading NMODL mechanisms
Author: Thomas G. Close (tclose@oist.jp)
Copyright: 2012-2014 Thomas G. Close.
License: This file is part of the "NineLine" package, which is released under
the MIT Licence, see LICENSE for details.
"""
from __future__ imp... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
TODO: Modify module doc.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "... | |
"""
.. module:: dj-stripe.tests.test_managers
:synopsis: dj-stripe Model Manager Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
"""
from copy import deepcopy
import datetime
import decimal
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from d... | |
from __future__ import print_function, division, absolute_import
import itertools
from numba import types, intrinsics
from numba.utils import PYVERSION, RANGE_ITER_OBJECTS, operator_map
from numba.typing.templates import (AttributeTemplate, ConcreteTemplate,
AbstractTemplate, built... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
flask-07-upgrade
~~~~~~~~~~~~~~~~
This command line script scans a whole application tree and attempts to
output an unified diff with all the changes that are necessary to easily
upgrade the application to 0.7 and to not yield deprecation warnings.
... | |
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory
from importlib import import_module
from django_cas_ng.models ... | |
# 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... | |
from typing import Any, List, Mapping, Set
from unittest import mock
import orjson
from django.db import connection
from django.http import HttpResponse
from zerver.lib.actions import do_change_stream_invite_only
from zerver.lib.fix_unreads import fix, fix_unsubscribed
from zerver.lib.message import (
MessageDict... | |
#
# 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... | |
""" Comverted from matlab code
Source: http://www.robots.ox.ac.uk/~fwood/teaching/AIMS_CDT_ML_2015/homework/HW_1_sum_product/
main_big_alarm_net
This file creates the graph structure needed for the big alarm network.
Creating the graph structure includes creating all nodes, placing the
nodes into the stucture wi... | |
import xmlrpc.client
import ssl
import socket # Required for network/socket connections
import os # Required for Forking/child processes
import time # Required for sleep call
import threading
import datetime
import dbm
import argparse
import random
import certs.gencert as gencert
import config
import ... | |
import base64
import hashlib
import io
import json
import os
import threading
import traceback
import socket
import sys
from abc import ABCMeta, abstractmethod
from http.client import HTTPConnection
from typing import Any, Callable, ClassVar, Optional, Tuple, Type, TYPE_CHECKING
from urllib.parse import urljoin, urlspl... | |
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Viewfinder BuildArchiveOperation.
This operation builds an archive of content for a given user and sends the user
an email with a link that can be used to retrieve a zip file of their content.
The zip contains all source needed to invoke the web client and disp... | |
"""
This script performs an out of core groupby operation for different datasets.
The datasets to be processed are normally in CSV files and the key and
value to be used for the grouping are defined programatically via small
functions (see toy_stream() and statsmodel_stream() for examples).
Those datasets included in... | |
#!/usr/bin/env python
#
# 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, softwa... | |
# Copyright (c) 2018 PaddlePaddle 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 app... | |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from collections import namedtuple
import json
import os
import random
from string import ascii_lett... | |
# -*- coding: utf-8 -*-
import datetime
import random
import re
import string
from lxml import html
from urllib2 import urlopen
from urlparse import urljoin
from urlparse import urlparse
from werkzeug import url_encode
from openerp import models, fields, api, _
from openerp.tools import ustr
URL_REGEX = r'(\bhref=[\... | |
#!/usr/bin/env python
from __future__ import print_function
import unittest
import shutil
from ruffus import add_inputs, suffix, mkdir, regex, Pipeline, output_from, touch_file
import ruffus
import sys
"""
Demonstrates the new Ruffus syntax in version 2.6
"""
import os
tempdir = os.path.relpath(os.path.absp... | |
from __future__ import absolute_import
from bot.pluginDespatch import Plugin
import re
import logging
import pytz
import time
from twisted.internet.task import LoopingCall
from datetime import datetime, timedelta
from django.utils import timezone
from django.conf import settings
from .models import DownVotes, Penalty, ... | |
"""The test for light device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.light import DOMAIN
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.helpers import device_registry
from ... | |
import os
import sys
import subprocess
import time
from threading import Thread
class IpproofController:
IPPROOF_SERVER_NAME = "ipproof-server"
output_redirected = False
def __init__(self, arguments_dictionary, ipproof_server_name):
self.stdout_save = sys.stdout
self.stderr_save = sys.... | |
"""
Usecases of recursive functions.
Some functions are compiled at import time, hence a separate module.
"""
from numba import jit
@jit("i8(i8)", nopython=True)
def fib1(n):
if n < 2:
return n
# Note the second call uses a named argument
return fib1(n - 1) + fib1(n=n - 2)
def make_fib2():
... | |
from unittest import mock
from unittest.mock import Mock, sentinel, ANY
from urllib.parse import urlparse
import pytest
from django.urls import resolve
from hamcrest import assert_that, contains_inanyorder
from requests import HTTPError
from rest_framework.reverse import reverse
from osmaxx.conversion import output_f... | |
"""Primary techniques for the core functionality of namebot."""
from __future__ import absolute_import
from __future__ import division
import re
from collections import defaultdict
from random import choice
from string import ascii_uppercase
import nltk
from . import nlp
from . import normalization
from . import se... | |
# Copyright 2015 FUJITSU LIMITED
#
# 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... | |
from future import standard_library
standard_library.install_aliases()
from future.builtins import str, bytes
from future.utils import iteritems
import gevent
import gevent.pool
import os
import signal
import datetime
import time
import socket
import traceback
import psutil
import sys
import json as json_stdlib
import ... | |
# Copyright 2016 Dravetech AB. All rights reserved.
#
# The contents of this file are 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 req... | |
#!/usr/bin/python
# Copyright (C) 2012-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... | |
import numpy as np
import scipy as sp
from itertools import product
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_gre... | |
import datetime
import itertools
import unittest
from copy import copy
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
from django.db.models import Model
from django.db.models.fields import (
AutoField, BigIntegerField, BinaryField, BooleanField, CharField,
DateTimeFi... | |
# Copyright 2013 Huawei Technologies Co.,LTD.
# 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
#
# Unl... | |
import pytest
import decimal
import numpy as np
import pandas as pd
from pandas import to_numeric
from pandas.util import testing as tm
from numpy import iinfo
class TestToNumeric(object):
def test_empty(self):
# see gh-16302
s = pd.Series([], dtype=object)
res = to_numeric(s)
... | |
#!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# 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/lic... | |
"""A Python API for the MiniSat_ and MiniCard_ constraint solvers.
.. _MiniSat: http://minisat.se/
.. _MiniCard: http://git.io/minicard
Classes:
Solver
An abstract base class for the other classes.
SubsetMixin
A mixin class adding 'subset' functionality to Solver subclasses.
:class:`MinisatSolver`
... | |
# Copyright (c) 2010-2012 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 law or agree... | |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2007 STFC <http://www.stfc.ac.uk>
#
# Authors :
# Oliver Clements <olcl@pml.ac.uk>
#
# Contact email: olcl@pml.ac.uk
# =======================... | |
from gosubl import about
from gosubl import gs
from gosubl import gsq
from gosubl import gsshell
from gosubl import mg9
from gosubl import sh
import datetime
import json
import os
import re
import shlex
import string
import sublime
import sublime_plugin
import uuid
import webbrowser
DOMAIN = "9o"
AC_OPTS = sublime.INH... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
import codecs
from getpass import getpass
from os.path import abspath, expanduser
import re
import socket
from .compat import input, on_... | |
"""
Support for constructing and viewing custom "track" browsers within Galaxy.
Track browsers are currently transient -- nothing is stored to the database
when a browser is created. Building a browser consists of selecting a set
of datasets associated with the same dbkey to display. Once selected, jobs
are started to... | |
#!/usr/bin/env python
# vim: ft=python:
import sys
import os
import os.path
import argparse
import configparser
import sh
import stat
import glob
import shutil
cmdparser = None
def check_binary():
"""Ensure all needed binaries are available in the PATH"""
binaries = ["git", "svn", "svnversion"]
unavailab... | |
import logging
from term import reserve
from term import Line, Cell
from term import TextMode
LOGGER = logging.getLogger('screen_buffer')
class ScreenBuffer(object):
def __init__(self, max_lines=1000):
super(ScreenBuffer, self).__init__()
self._max_lines = max_lines
self._lines = []
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | |
# -*- coding: utf-8 -*-
"""
Plotting utility for the production of Keepout Map Related Products
Generalized from makeKeepoutMap.py (authored by Gabriel Soto)
Written by: Dean Keithly
Written on: 3/6/2019
"""
import os
from EXOSIMS.util.vprint import vprint
import random as myRand
import sys, os.path, EXOSIMS, EXOSIMS.... | |
# Copyright 2014 PerfKitBenchmarker 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 appli... | |
from __future__ import print_function
import glob,sys,os
from collections import Counter
import dresher_LSA as d
"""This script is adapted from dresherClean_run in order to address fully
iterated efficient trees.
next tasks: verify that novel outputs of total trees are viable trees. REMINDER, the FOR LOOP NEEDS TO... | |
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# noti... | |
# Copyright 2013 IBM Corp.
# 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 app... | |
import datetime
import hypothesis.strategies as st
import pytest
import pytz
from dateutil.tz import tzlocal
from freezegun import freeze_time
from hypothesis import given
from todoman.cli import cli
from todoman.model import Database, FileTodo
def test_basic(tmpdir, runner, create):
result = runner.invoke(cli,... | |
__author__ = 'frank'
import os.path
import traceback
from kvmagent import kvmagent
from zstacklib.utils import jsonobject
from zstacklib.utils import http
from zstacklib.utils import log
from zstacklib.utils import shell
from zstacklib.utils import linux
import zstacklib.utils.uuidhelper as uuidhelper
logger = log.g... | |
from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | |
# Natural Language Toolkit: Interface to MaltParser
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
import os
import tempfile
import glob
from operator import add
from fun... | |
# Copyright 2013 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.
import collections
import datetime
import os.path
import sys
import code
import cpp_util
import model
try:
import jinja2
except ImportError:
sys.path.a... | |
"""
Copyright 2021 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, software
d... | |
# -----------------------------------------------------------------------------
# A Three-Pronged Approach to Exploring the Limits of Static Malware Analyses:
# Callsite Parameter Cardinality (CPC) Counting: callee_context.py
#
# This is keeps track of argument registers at the callee level and performs
# cpc calculati... | |
from typing import Iterator, Tuple, List
import os
import json
import urllib
import urllib.parse
import logging
import warnings
import shutil
import glob
import git
import yaml
from .build import BuildManager
from ..exceptions import NameInUseError, BadManifestFile
from ..compiler import Compiler
from ..core import T... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core import mail
from django.utils import timezone
from sentry.models import (
Activity, Commit, CommitAuthor, Deploy, Environment, GroupSubscriptionReason, Release,
ReleaseCommit, Repository, UserEmail, UserOption, UserOptionValue
)
... | |
"""Active Directory authentication backend."""
from __future__ import absolute_import, unicode_literals
import itertools
import logging
import dns
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.encoding import force_text
from django.utils.translation import ugettext_la... | |
# Copyright 2015 Google Inc. 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 applicable law or a... | |
#!/usr/bin/env python
#
#===- exploded-graph-rewriter.py - ExplodedGraph dump tool -----*- python -*--#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------... | |
"""
Web socket API for Zigbee Home Automation devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import logging
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.const import ATTR_ENTITY_ID
im... | |
# Copyright (C) 2020 Atsushi Togo
# All rights reserved.
#
# This file is part of phono3py.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# noti... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A basic command line interface for a local version of The Cannon.
"""
import argparse
import logging
import multiprocessing as mp
import numpy as np
import os
from random import shuffle
from six.moves import cPickle as pickle
from six import string_types
from astropy... | |
import dilap.core.vector as dpv
import dilap.core.model as dmo
import dilap.core.tools as dpr
import dilap.mesh.pointset as dps
import dilap.mesh.tools as dtl
import dilap.mesh.pointset as dps
import matplotlib.pyplot as plt
import math
import pdb
sqrt3 = math.sqrt(3)
class triangulation:
def plot(self,ax ... | |
import PythonQt
from PythonQt import QtCore, QtGui
import re
import ddapp.objectmodel as om
import ddapp.visualization as vis
from ddapp.timercallback import TimerCallback
from ddapp import affordanceitems
#from ddapp import lcmUtils
from ddapp import callbacks
from ddapp import cameracontrol
#from ddapp import midi
fr... | |
from logic.v1.api import BaseAPI, need, hook
from logic.v1.args import KeyArg, Arg
from logic.v1.core.models import User
from .models import Hashtag, Tag
from mongoengine import Q
from . import models
import json
def process_hashtags(hashtags):
"""takes a string of hashtags and returns a list of Hashtag objects
... | |
# Copyright 2016 Google Inc. 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 applicable law or ag... | |
import re
import npc
from npc.character.tags import TagContainer
from npc.character import Spirit
from mako.template import Template
def template_output(character, header_level=3):
template_path = str(npc.settings.InternalSettings().get('listing.templates.markdown.character.spirit'))
character_template = Templ... | |
"""Unicode Properties (autogen)."""
from __future__ import unicode_literals
unicode_blocks = {
"basiclatin": "\u0000-\u007f",
"^basiclatin": "\u0080-\U0010ffff",
"latin1supplement": "\u0080-\u00ff",
"^latin1supplement": "\u0000-\u007f\u0100-\U0010ffff",
"latinextendeda": "\u0100-\u017f",
"^lati... | |
"""
sentry.models.project
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import warnings
import six
from bitfield import BitField
from django.conf ... | |
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Yuriy Movchan
#
import java
import json
from com.toopher import RequestError
from com.toopher import ToopherAPI
from java.util import Arrays
from org.xdi.model.custom.script.... | |
# -*- coding: UTF-8 -*-
from __future__ import with_statement
import random
import urllib
from decimal import Decimal
import os.path
from django import forms
from django import http
from django.conf import settings as dsettings
from django.contrib import messages
from django.contrib.auth.decorators import login_requi... | |
# Copyright (c) 2013,2014 Burkhard Ritter
# This code is distributed under the two-clause BSD License.
import _qca
from collections import OrderedDict
import math
class Layout(object):
def __init__(self):
self._pl = _qca.Layout()
@property
def primitive_layout(self):
return self._pl
... | |
#!/usr/bin/python3
r"""
A generic bot to do data ingestion (batch uploading) of photos or other files.
In addition it installs related metadata. The uploading is primarily from a url
to a wiki-site.
Required configuration files
============================
- a 'Data ingestion' template on a wiki site that specifi... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.