gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
#
# ... | |
"""Library providing some custom Lasagne layers.
"""
import lasagne
import theano
import theano.tensor as T
import numpy as np
from lasagne.layers.dnn import Conv2DDNNLayer, Conv3DDNNLayer, MaxPool2DDNNLayer, MaxPool3DDNNLayer
from lasagne.utils import as_tuple
from lasagne.layers import Conv1DLayer, MaxPool1DLayer, ... | |
# Copyright 2009 Shikhar Bhushan
#
# 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 writin... | |
# coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from unittest import TestCase
import mock
from mock import MagicMock, patch
from pyqrllib.pyqrllib import sha2_256
from pyqryptonight.pyqryptonight import StringToUInt... | |
from datetime import datetime
from django.core.management.base import BaseCommand
from schedule.models import Track, Session, Slot
friday_plenaries = [
[
{
"start": datetime(2011, 3, 11, 7, 0),
"end": datetime(2011, 3, 11, 8, 0),
},
{
"start": datetime... | |
"""Module calculates interactions between two molecules
(proein-protein, protein-ligand, small-small).
Currently following interacions are implemented:
* hydrogen bonds
* halogen bonds
* pi stacking (parallel and perpendicular)
* salt bridges
* hydrophobic contacts
* pi-cation
* metal coordi... | |
import hashlib
import io
import mimetypes
import os
import shutil
import socket
import sys
import tempfile
from cgi import parse_header
from http.client import BadStatusLine
from urllib.parse import unquote
from loguru import logger
from requests import RequestException
from flexget import options, plugin
from flexge... | |
# coding=utf-8
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdi... | |
import json
import string
import uuid
from copy import copy
from datetime import datetime
from django.apps import apps
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from djan... | |
import sys
import re
import pprint
import string
import nltk
from nltk.collocations import *
import nltk.data
from nltk.tokenize import word_tokenize, regexp_tokenize
from replacers import RegexpReplacer
"""
This contains classes used for filtering words, sentences, ngrams, etc to be used in statistical analysis
""... | |
"""Tests for indenter.py."""
# Author: Prabhu Ramachandran
# License: BSD style
# Copyright (c) 2004, Enthought, Inc.
import unittest
import cStringIO
from tvtk import indenter
class TestIndent(unittest.TestCase):
def test_basic(self):
"""Simple tests for indenter."""
id = indenter.Indent()
... | |
#!/usr/bin/env python3
# author: @netmanchris
# This section imports required libraries
import requests
import json
from pyhpeimc.plat.device import *
HEADERS = {'Accept': 'application/json', 'Content-Type':
'application/json', 'Accept-encoding': 'application/json'}
"""
This section deals with HPE IMC Custom ... | |
#!/usr/bin/env python
'''
Quantile regression model
Model parameters are estimated using iterated reweighted least squares. The
asymptotic covariance matrix estimated using kernel density estimation.
Author: Vincent Arel-Bundock
License: BSD-3
Created: 2013-03-19
The original IRLS function was written for Matlab by... | |
# -*- coding: utf-8 -*-
# Import Elasticsearch library
import elasticsearch
from elasticsearch_dsl import Search, Q, A
# Import advanced python collections
import collections
# Import JSON operations
import json
# Import global functions
from global_functions import escape
#----------------- Main Functions ---------... | |
from pyon.core import bootstrap, exception
from pyon.core.exception import IonException
from pyon.util.log import log
from pyon.net.transport import NameTrio
from pyon.ion.endpoint import ProcessRPCClient, ProcessRPCServer, ProcessRPCResponseEndpointUnit, ProcessRPCRequestEndpointUnit
from gevent import queue as gqueu... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
import json
import urllib.parse
from datetime import datetime, timedelta
from urllib.parse import urlencode
from django.urls import reverse
from corehq.apps.api.tests.utils import APIResourceTest
from corehq.apps.sms.models import MessagingEvent, MessagingSubEvent, Email, SMS
from corehq.apps.sms.tests.data_generator... | |
__author__ = 'Mark Dickinson'
__source__ = 'http://code.activestate.com/recipes/578507-strongly-connected-components-of-a-directed-graph/'
def strongly_connected_components_path(vertices, edges):
"""
Find the strongly connected components of a directed graph.
Uses a recursive linear-time algorithm descri... | |
"""
Adminstration.py allows users to control ArcGIS Server 10.1+
through the Administration REST API
"""
from .._abstract.abstract import BaseAGSServer
from ..security import OAuthSecurityHandler, NTLMSecurityHandler, PKISecurityHandler, \
PortalServerSecurityHandler, PortalTokenSecurityHandler, \
ArcGIS... | |
# -*- coding: utf-8 -*-
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.forms.models import ModelForm
from django.template import TemplateSyntaxError
from django.test.utils import override_settings
from django.urls import reverse
from django.utils.encoding import smart_text... | |
"""SCons.SConf
Autoconf-like configuration support.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Sof... | |
"""
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | |
import cPickle
import pipeline
from importlib import import_module
from mapreduce import context
from mapreduce.mapper_pipeline import MapperPipeline
from mapreduce.mapreduce_pipeline import MapreducePipeline
from mapreduce import pipeline_base
from mapreduce.model import MapreduceState
from mapreduce.input_readers im... | |
# Test the functions and main class method of FormatParagraph.py
import unittest
from idlelib import FormatParagraph as fp
from idlelib.EditorWindow import EditorWindow
from Tkinter import Tk, Text
from test.test_support import requires
class Is_Get_Test(unittest.TestCase):
"""Test the is_ and get_ functions"""
... | |
from django.forms import models as model_forms
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateResponseMixin, View
from django.views.generic.detail import (SingleObjectMixin,
SingleObjectTemplateRe... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Config file for various nacl compilation scenarios
#
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
imp... | |
# Loops through ML models for classification
# Basic code borrowed from RAYID GHANI, with extensive edits.
## https://github.com/rayidghani/magicloops/blob/master/magicloops.py
from __future__ import division
import pandas as pd
import numpy as np
import random
import os
from scipy.sparse import isspmatrix_csc, csc_m... | |
# Lint as: python2, python3
# Copyright 2018 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
#
#... | |
# Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | |
__author__ = "pyton_guy"
"""
Commands for the #/r/nyc Freenode IRC bot
This module is used by bot.py and is separate so that it can be hot-swapped.
So if a command breaks, or a new one needs to be added, we don't need to
disconnect the bot from IRC to fix it. This bot is built for five-nines!
"""
import sys
import r... | |
"""Benchmark for SQLAlchemy.
An adaptation of Robert Brewers' ZooMark speed tests. """
import datetime
import sys
import time
from sqlalchemy import *
from test.lib import *
ITERATIONS = 1
dbapi_session = engines.ReplayableSession()
metadata = None
class ZooMarkTest(fixtures.TestBase):
"""Runs the ZooMark and... | |
#!/usr/bin/env python3
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test activation of the first version bits soft fork.
This soft fork will activate the following BIPS:
BIP 6... | |
"""
:Author: Akshay Paropkari
:Date Created: 10/13/2014
:Abstract: Automated tests for util.py functions.
"""
import os
import unittest
import tempfile
from collections import namedtuple
from phylotoast import util as ut
class util_Test(unittest.TestCase):
def setUp(self):
"""
Setting up files, o... | |
from __future__ import absolute_import
import etcd
import logging
import os
import random
import requests
import socket
import time
import urllib3
from dns.exception import DNSException
from dns import resolver
from patroni.dcs import AbstractDCS, Cluster, DCSError, Leader, Member, parse_connection_string
from patroni... | |
from __future__ import unicode_literals, division, absolute_import
import logging
from datetime import datetime, timedelta
from sqlalchemy import Table, Column, Integer, Float, String, Unicode, Boolean, DateTime, delete
from sqlalchemy.schema import ForeignKey, Index
from sqlalchemy.orm import relation, joinedload_all... | |
import logging
import traceback
from celery.task import task
import CifFile
from django.conf import settings
from django.core.cache import get_cache
from django.db import transaction
from django.utils import timezone
from tardis.tardis_portal.models import Schema, Experiment, \
ExperimentParameter, ExperimentParam... | |
import sys
import warnings
import numpy as np
import scipy.sparse as sp
from . import ch, utils
from .ch import pif
from .utils import timer
def clear_cache_single(node):
node._cache['drs'].clear()
if hasattr(node, 'dr_cached'):
node.dr_cached.clear()
def vstack(x):
x = [a if not isinstance(a, sp... | |
# coding: utf-8
#
# Copyright 2020 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 datetime import datetime, date
import sys
if sys.version_info >= (2, 7):
from nose.tools import assert_dict_equal
import xlwings as xw
try:
import numpy as np
from numpy.testing import assert_array_equal
def nparray_equal(a, b):
try:
assert_array_equal(a, b)
except Asse... | |
# -*- coding: utf-8 -*-
# vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4
# Copyright 2009, 2010, 2011 Praekelt Foundation <dev@praekeltfoundation.org>
# BSD - see LICENSE for details
"""Python module for SSMI protocol to send/receive USSD and SMS."""
# Imports
from types import StringTypes
from twisted.protocols.basi... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#!/usr/bin/python
#
# Copyright 2014 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 b... | |
# -*- coding: utf-8 -*-
# Create your models here
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils import timezone
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.core.validators import ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 23 13:39:01 2017
@author: immersinn
"""
import os
import pickle
import xml.etree.ElementTree as ET
import numpy
import pandas
#from textacy.corpus import Corpus
senator_data_session_key = {"2017" : "North Carolina General Assembly - N.C. Senator... | |
import collections
import datetime
import logging
import smtplib
import sys
import time
from optparse import make_option
from os import path
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
import owl_config
import monitor.dbutil
imp... | |
# Copyright 2018 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... | |
from gosubl import gs
from gosubl import gsq
from gosubl import mg9
import os
import re
import sublime
import sublime_plugin
DOMAIN = 'GsDoc'
GOOS_PAT = re.compile(r'_(%s)' % '|'.join(gs.GOOSES))
GOARCH_PAT = re.compile(r'_(%s)' % '|'.join(gs.GOARCHES))
EXT_EXCLUDE = [
'out', 'exe', 'o', 'dll', 'so', 'a', 'dynlib', ... | |
# 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,... | |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/markers.py
"""
This modules defines a collection of markers used in charts.
"""
__version__=''' $Id: markers.py 3140 2007-09-13 10:17:... | |
import logging
import pickle
import os
import idaapi
import idc
import idautils
from DIE.Lib.DbgImports import StaticImports
from DIE.Lib.IDAConnector import *
from DIE.Lib.DIE_Exceptions import UnrecognizedCallInstruction
import DIE.Lib.DIEDb
# Was user breakpoint flag definition
WAS_USER_BREAKPOINT = 0x1
# Mat... | |
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing ... | |
import time
import datetime
import os
import sys
import subprocess
import yaml
import shutil
from helpers import get_options, make_logger, runCommand,which,run_cmd
import os.path
from pkg_resources import resource_filename, resource_stream
from pandas import DataFrame
import pandas as pd
import numpy as np
#from tabula... | |
import os
import sys
import copy
import json
import time
import logging
import asyncio
import ipaddress
import subprocess
import collections
import numpy as np
import aiohttp.web
import ray
import psutil
import pytest
import redis
import requests
from ray import ray_constants
from ray.test_utils import (format_web_ur... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte.
#
# 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 ... | |
from __future__ import print_function
import mock
import pytest
from flowpipe.errors import CycleError
from flowpipe.graph import Graph, get_default_graph, reset_default_graph
from flowpipe.node import INode, Node
from flowpipe.plug import InputPlug, InputPlugGroup, OutputPlug, SubInputPlug
@pytest.fixture
def clea... | |
#
# 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... | |
# $Id$
#
# Copyright (c) 2009, Novartis Institutes for BioMedical Research 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:
#
# * Redistributions of source code must retain the above... | |
import warnings
import numpy as np
import pytest
from pandas import (
Categorical,
DataFrame,
DatetimeIndex,
Index,
Series,
TimedeltaIndex,
Timestamp,
date_range,
period_range,
timedelta_range,
)
import pandas._testing as tm
from pandas.core.arrays import PeriodArray
from panda... | |
''' Create rst documentation of the examples directory.
This uses screenshots in the screenshots_dir
(currently doc/sources/images/examples) along with source code and files
in the examples/ directory to create rst files in the generation_dir
(doc/sources/examples) gallery.rst, index.rst, and gen__*.rst
'''
import ... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import io
import os
import sys
import pickle
import subprocess
import unittest
from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
class TestCleanUp(unittest.TestCase):
def testCleanUp(self):
class TestableTest(unittest.TestCase):
def testNothing(self):
p... | |
"""
Created on Sat Oct 22 21:02:33 2016
@authors: William Jones & Luc Moseley
History:
22/10/2016: WJ - Created file, replicating matlab script collisiontrial.m
26/10/2016: LM - Fixed array-making bugs, animated properly
1/11/2016: WJ - Added collision code back in, currently not working properly
3/11... | |
import re
from pynmea.utils import checksum_calc
class NMEASentence(object):
""" Base sentence class. This is used to pull apart a sentence.
It will not have any real reference to what things mean. Things that
subclass this base class should all the additional functionality.
"""
def __init... | |
# 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... | |
# -*- coding: utf-8 -*-
from __future__ import division
from numpy import (
allclose, asanyarray, cross, dot, errstate, isclose, mean, nan_to_num,
nanmean, newaxis, stack, zeros, zeros_like)
from numpy.linalg import det, norm
from .config import config
from .bound_vector import BoundVector
from .line_segment ... | |
# -*- coding: utf-8 -*-
"""scheduler for regular tasks"""
import atexit
import collections
import contextlib
import datetime
import functools
import hashlib
import logging
import os
import time
import threading
import psutil
import callable_ref
LOG = logging.getLogger(__name__)
Env = collections.namedtuple('Env',... | |
# 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... | |
from __future__ import absolute_import, print_function
import os
import sys
import tempfile
import string
import time
from numpy.testing import TestCase, assert_, run_module_suite
from scipy.weave import inline_tools, ext_tools, c_spec
from scipy.weave.build_tools import msvc_exists, gcc_exists
from scipy.weave.cata... | |
from netaddr import IPNetwork, cidr_merge
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models.expressions import RawSQL... | |
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""
from ast import *
BOOLOP_SYMBOLS = {
And: 'and',
Or: 'or'
}
BINOP_SYMBOLS = {
Add: '+',
S... | |
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... | |
#!/usr/bin/env python2
"""
Authors: Gabriel Grill, Anton Ovchinnikov
"""
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from cassandra.cluster import Cluster
import logging
import time
import json
import io
import sys
import csv
import os
from datetime import date, datetime
import threading
import re
from time i... | |
# Copyright 2015 gRPC authors.
#
# 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... | |
import json
from aleph.core import db
from aleph.model import Collection, Entity
from aleph.index import index_entity, flush_index
from aleph.tests.util import TestCase
class EntitiesApiTestCase(TestCase):
def setUp(self):
super(EntitiesApiTestCase, self).setUp()
self.rolex = self.create_user(fo... | |
"""Module containing canned measurement validators.
Additional validators may be registered by passing them to the Register()
method. They can then be accessed directly as attributes on the validators
module, and will typically be a type, instances of which are callable:
from openhtf.util import validators
from ... | |
import collections
import time
import pathofexile.ladder
'''
Path of Exile API Client
- Analytics
'''
def percentage(player_count, ladder_size=15000):
''' Returns the percentage of players given a player count and a ladder
size. Converts both to floats before division to retain precision.
:param player... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
import os
import frappe
from frappe import _
from frappe.core.doctype.data_import.exporter import Exporter
from frappe.core.doctype.data_import.importer import Importer
from frappe.mode... | |
from __future__ import unicode_literals
import json
import six
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import dynamodb_backend2, dynamo_json_dump
GET_SESSION_TOKEN_RESULT = """
<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06... | |
# Copyright 2013-2015 David Mohr
#
# 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 writi... | |
# 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 use ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import time
import random
import textwrap
import re
import socket
import curses
import string
import inspect
import threading
import math
import pymysql
import json
# for putty connections we need the following env
os.environ['NCURSES_NO_UTF8_ACS'] = "1"
... | |
__author__ = 'Lstevens'
# stdlib modules
from xml.etree import ElementTree as et
import hashlib
import re
import logging
# pypi modules
import requests
import xmltodict
logging.basicConfig(
filename='webservices.log',
format='%(asctime)s | %(levelname)s | %(name)s | %(funcName)s | Line:%(lineno)d | %... | |
import argparse
import datetime
import logging
import os.path
import sys
import urllib
import urllib2
import urlparse
import xml.etree.cElementTree as ET
import base.atom
import base.log
import base.paths
import base.url_fetcher
import base.worker
_BASE_PARAMETERS = {
'client': 'reader-feed-archive'
}
_READER_SHAR... | |
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
# Copyright 2013 eNovance
# Copyright 2014 Red Hat, Inc
#
# Authors: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
# Eoghan Glynn <eglynn@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "Licens... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | |
import ipaddress
from flask import request, redirect, url_for, current_app
from flask_jsonschema import validate
from sqlalchemy.exc import IntegrityError
from app.core import ApiResponse, ApiException
from . import api
from ..import db
from ..models import Organization, Email, ContactEmail
@api.route('/organizations... | |
# Copyright (C) 2016-2019 SignalFx, Inc. All rights reserved.
# Copyright (C) 2020 Splunk, Inc. All rights reserved.
import logging
import pprint
import requests
from . import constants, version
# TODO: this file needs rework. We want the REST API client to expose the same
# object abstractions as the API itself, wi... | |
"""
Fast cryptographic hash of Python objects, with a special case for fast
hashing of numpy arrays.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import pickle
import hashlib
import sys
import types
import struct
import io... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
# Copyright 2019 DeepMind Technologies 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 agr... | |
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:9332")
else:
access = Ser... | |
from django.db import models
from django.db.models.signals import post_save
from django.db.models.query_utils import Q
from django.db.utils import DatabaseError
from django.core.exceptions import ValidationError
from django.contrib.contenttypes import generic
from django.contrib.sessions.models import Session
from dj... | |
"""
title::
Facial Detection and Recognition using Eigenfaces and Haar Cascades
description::
An implementation of a unique facial detection and recognition algorithm
that utalises Haar Cascades for initial positioning and detection of
faces, then implements eigenfaces to match them to a subject. This
current ver... | |
# Copyright (c) 2012 OpenStack, LLC.
# 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 ebu_tt_live.bindings import ttd, tt_type, body_type, d_body_type, \
div_type, d_div_type, p_type, d_p_type, span_type, d_span_type, \
br_type, d_br_type, d_head_type, d_style_type, \
d_styling_type, head_type, style_type, styling, layout, d_layout_type, \
region_type, d_region_type, ebuttdt, Styled... | |
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import sys
import time
import logging
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import numpy as np
import tensorflow as tf
from tensorboard.plugins import projector
from text_cnn import TextCNN
from utils import checkmate as cm
fro... | |
# 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... | |
"""Routes trie for mapping grow documents to paths."""
import collections
from grow.common import utils
PREFIX_PARAMETER = ':'
PREFIX_WILDCARD = '*'
URL_SEPARATOR = '/'
SHARD_KEY_DEFAULT = '_default'
TEMPLATE_CHAR = '{'
class Error(Exception):
"""Base routes error."""
def __init__(self, message):
... | |
"""
Defines the unit tests for the :mod:`colour.models.rgb.transfer_functions.aces`
module.
"""
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import (
log_encoding_ACESproxy,
log_decoding_ACESproxy,
log_encoding_ACEScc,
log_decoding_ACEScc,
log_encoding_ACEScct,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.