gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import sys
from django.utils.encoding import force_bytes
from email.Utils import formatdate
from time import time
from urlparse import parse_qsl
from services.utils import mypool, settings
# This has to be imported after the settings so statsd knows where to log to.
from django_statsd.clients import statsd
try:
... | |
from __future__ import absolute_import, unicode_literals
from django.db.backends import BaseDatabaseIntrospection
from . import ado_consts
try:
# Added with Django 1.7
from django.db.backends import FileInfo
except ImportError:
from collections import namedtuple
# Structure returned by the DB-API curs... | |
from __future__ import unicode_literals
import datetime
import re
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.backends.utils import truncate_name
from django.utils import six, timezone
from django.utils.encoding import force_bytes, ... | |
#!/usr/bin/env python2
import collections
import pyximport;
import re
pyximport.install()
from model import Ext, Chromosome
import argparse
import copy
import operator
import networkx as nx
from networkx.algorithms import connected_components, dfs_successors
import matplotlib.pyplot as plt
import file_ops
# HELPER ... | |
# Copyright 2013 IBM 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 or agree... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | |
# Copyright (c) 2011 Dave McCoy (dave.mccoy@cospandesign.com)
#
# This file is part of Nysa.
#
# (http://wiki.cospandesign.com/index.php?title=Nysa.org)
#
# Nysa 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 Found... | |
from datetime import datetime
import json
import time
import sys
from bs4 import BeautifulSoup
import dryscrape
class LinkScrape:
LOGIN_EMAIL = 'EMAIL'
LOGIN_PASSWORD = 'PASSWORD'
BASE_URL = 'https://www.linkedin.com'
sess = None
RESULTS = {}
def __init__(self, email, password, loadprevious)... | |
"""
Some quick and dirty tests for a very small subset of the code.
"""
import pytest
from testtools.assertions import assert_that
from testtools.matchers import MatchesSetwise
from xenserver import tasks
from xenserver.tests.helpers import VM_MEM
from xenserver.tests.matchers import (
ExtractValues, MatchesSetOf... | |
# -*- coding: utf-8 -*-
from abc import abstractmethod, ABCMeta
import numpy as np
import cv2
import scipy.ndimage as snd
# from skimage.feature import structure_tensor, structure_tensor_eigvals, hog
from sldc import Logger, StandardOutputLogger, SilentLogger
__author__ = "Rubens Ulysse <urubens@uliege.be>"
__versio... | |
import os
import sys
import errno
import pathlib
import tempfile
import unittest
import time
import shutil
import subprocess
from inspect import signature
from subprocess import Popen, PIPE
from tempfile import TemporaryDirectory
from multiprocessing.dummy import Pool
from memory_profiler import profile as profile_memo... | |
# -*- test-case-name: twisted.words.test.test_domish -*-
#
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DOM-like XML processing support.
This module provides support for parsing XML into DOM-like object structures
and serializing such structures to an XML string representation... | |
"""Implements directory watcher using ReadDirectoryChangesW.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import errno
import logging
import os
# E0401: Unable to import windows only pakages... | |
import sys
from copy import copy
from numpy import *
from scipy.signal import medfilt as MF
from numpy.random import normal, seed
from statsmodels.robust import mad
from .core import *
from .lpf import *
from .extcore import *
from .lpfsd import LPFSD
from george.kernels import ConstantKernel, Matern32Kernel
class L... | |
# Showroom Downloader
import subprocess
import threading
import datetime
import logging
import time
import os
import shutil
from .constants import TOKYO_TZ, FULL_DATE_FMT
from .utils import format_name, strftime
download_logger = logging.getLogger('showroom.downloader')
class Downloader(object):
"""
Handles... | |
## @file
# process FD Region generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license ... | |
# Copyright 2016 Capital One Services, 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 agreed to in... | |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | |
#!/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
# "... | |
import json
# django imports
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse
from django.http import Ht... | |
# Copyright 2018 The TensorFlow Probability 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 o... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Contains code for parsing and building a dictionary from text.
"""
from typing import Optional
from parlai.core.para... | |
import numpy as np
import os
import cPickle
import gzip
# np.seterr(all='raise')
import matplotlib.pyplot as plt
from sklearn.metrics import adjusted_mutual_info_score, \
adjusted_rand_score, roc_auc_score
from pyhawkes.models import \
DiscreteTimeNetworkHawkesModelSpikeAndSlab, \
DiscreteTimeStandardHaw... | |
from logging import Handler
from queue import Queue
from threading import Thread
import logging.config
import logging
import asyncio
import datetime
import yaml
import sys
import os
from git import Repo
from functools import partial, wraps
from pythonjsonlogger import jsonlogger
RED = '\033[91m'
BLUE = '\033[94m'
BO... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... | |
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def fill_contact_form(self, contact):
wd = self.app.wd
self.change_field_value("firstname", contact.firstname)
self.change_field_value("middlename", contact.middlename)
... | |
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | |
from collections import defaultdict, Counter
from constants import compare, RE_THRESHOLD, RE_DELIMITERS
from utils import list_get
import logging
import re
import settings
class RulesManager(object):
"""
To manage all of the rules. A rule is a single description centered around a metric. A rule can have a pa... | |
from binascii import hexlify
import vdf
from steam.enums import EResult, EServerType
from steam.enums.emsg import EMsg
from steam.core.msg import MsgProto
from steam.utils.proto import proto_fill_from_dict
class Apps(object):
licenses = None #: :class:`dict` Accounts' package licenses
def __init__(self, *ar... | |
import numpy as np
import plotly.offline as py
import plotly.graph_objs as go
py.init_notebook_mode(connected=True)
def plot1d(data_list, data_names=None, x_title='', y_title='',
x_log=False, y_log=False, show_dx=True):
"""
Produce a 1D plot
@param data_list: list of traces [ [x1, y1], [... | |
# This file is part of beets.
# Copyright 2016
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, pu... | |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (... | |
import json
from tempodb.temporal.validate import convert_iso_stamp, check_time_param
from cursor import DataPointCursor, SeriesCursor, SingleValueCursor
class JSONSerializable(object):
"""Base class for objects that are serializable to and from JSON.
This class defines default methods for serializing each wa... | |
# Verify that gdb can pretty-print the various PyObject* types
#
# The code for testing gdb was adapted from similar work in Unladen Swallow's
# Lib/test/test_jit_gdb.py
import os
import re
import subprocess
import sys
import sysconfig
import unittest
import locale
# Is this Python configured to support threads?
try:... | |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | |
import logbook
import logbook.queues
from jsonrpc.exceptions import JSONRPCError
from hologram import JsonSchemaMixin
from hologram.helpers import StrEnum
from dataclasses import dataclass, field
from datetime import datetime, timedelta
from queue import Empty
from typing import Optional, Any
from dbt.contracts.rpc i... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
#!/usr/bin/env python
"""Tests for export utils functions."""
import os
import stat
from grr.lib import aff4
from grr.lib import export_utils
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import sequential_collection
from grr.lib import test_lib
from grr.lib import utils
from grr.lib.aff4_objec... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
import os
import sys
from argparse import ArgumentTypeError
from datetime import datetime, timedelta
from c7n import cli, version, commands
from c7n.resolver import ValuesFrom
from c7n.resources import aws
from c7n.schema impor... | |
# XXX clean up these tests to use more uniform helpers
import py
from rpython.flowspace.model import Variable, Constant, checkgraph
from rpython.translator.backendopt import canraise
from rpython.translator.backendopt.inline import (simple_inline_function,
CannotInline, auto_inlining, Inliner, collect_called_graphs... | |
import re
import os
import six
class Compiler(object):
RE_INTERPOLATE = re.compile(r'(\\)?([#!]){(.*?)}')
doctypes = {
'5': '<!DOCTYPE html>'
, 'xml': '<?xml version="1.0" encoding="utf-8" ?>'
, 'default': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR... | |
"""
Tests for models in the photo application.
"""
from datetime import date
from django.core.exceptions import ValidationError
from django.test import TestCase
from photo import models
# Model tests
class FilmFormatTestCase(TestCase):
"""
Tests for :model:`photo.FilmFormat`
"""
def test_str(self):
... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Maintainer: Jonathan Lange
# Author: Robert Collins
import StringIO, os, sys
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial.itrial import IReporter, ITestCase
from twisted.trial import... | |
# -*- coding: utf-8 -*-
"""
IDL Ref:
https://thrift.apache.org/docs/idl
"""
from __future__ import absolute_import
import collections
import os
import sys
import types
from ply import lex, yacc
from .lexer import * # noqa
from .exc import ThriftParserError, ThriftGrammerError
from thriftpy2._compat import urlop... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2020 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 the fundrawtransaction RPC."""
from decimal import Decimal
from test_framework.descriptors import... | |
from math import sqrt
from node import *
class Point:
def __init__(self, x, y):
"""
Constructor : sets x and y co-ordinates
@param x: x co-ordinate
@param y: y co-ordinate
"""
self.x = x
self.y = y
def __eq__(self, other):
"""
Override m... | |
# Copyright (c) 2011-2021, Manfred Moitzi
# License: MIT License
"""
Tags
----
A list of :class:`~ezdxf.lldxf.types.DXFTag`, inherits from Python standard list.
Unlike the statement in the DXF Reference "Do not write programs that rely on
the order given here", tag order is sometimes essential and some group codes
may... | |
# coding=utf-8
"""
#### Grants
* Normal usage
```
GRANT REPLICATION CLIENT on *.* TO 'user'@'hostname' IDENTIFIED BY
'password';
```
* For innodb engine status
```
GRANT SUPER ON *.* TO 'user'@'hostname' IDENTIFIED BY
'password';
```
* For innodb engine status on MySQL versions 5.1.24+
```
GRANT PROCESS ON *.* ... | |
from flask import jsonify, request, g
from flask_cors import cross_origin
from alerta.app.auth.utils import permission
from alerta.app.exceptions import RejectException, RateLimit, BlackoutPeriod
from alerta.app.models.alert import Alert
from alerta.app.models.metrics import Timer, timer
from alerta.app.utils.api imp... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 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 BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b... | |
"""
Python module code representation.
:copyright: 2008 by Takanori Ishikawa
:license: MIT, see LICENSE for more details.
"""
from modipyd import utils, LOGGER, BYTECODE_PROCESSORS
from modipyd.resolve import ModuleNameResolver
from modipyd.utils import filepath_to_identifier
from modipyd.utils.decorators imp... | |
# coding=utf-8
# -*- coding: utf-8 -*-
u"""This module provides class for managing resource configuration."""
#
# Copyright 2017 F5 Networks 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 ... | |
# coding: utf-8
"""
Kubeflow Training SDK
Python SDK for Kubeflow Training # noqa: E501
The version of the OpenAPI document: v1.4.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubeflow.training.configuration import Configuration
class ... | |
"""The Game of Hog."""
from dice import four_sided, six_sided, make_test_dice
from ucb import main, trace, log_current_line, interact
GOAL_SCORE = 100 # The goal of Hog is to score 100 points.
######################
# Phase 1: Simulator #
######################
def roll_dice(num_rolls, dice=six_sided):
"""Roll ... | |
# Copyright 2017 The dm_control 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 i... | |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | |
# Copyright 2016 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 applicable ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Compatibility functionality for Windbg users.
"""
import codecs
import sys
import math
import gdb
import pwndbg.arch
import pwndbg.commands
import pwndbg.memory
import pwndbg.strings
import pwndbg.typeinfo
def get_type(size):
return {
1: pwndbg.typeinfo.uint8... | |
from common_fixtures import * # NOQA
from cattle import ApiError
def _create_stack(client):
env = client.create_stack(name=random_str())
env = client.wait_success(env)
assert env.state == "active"
return env
def test_create_duplicated_services(client, context):
env = _create_stack(client)
... | |
"""Tests for tools for solving inequalities and systems of inequalities. """
from sympy import (And, Eq, FiniteSet, Ge, Gt, Interval, Le, Lt, Ne, oo,
Or, S, sin, sqrt, Symbol, Union, Integral, Sum,
Function, Poly, PurePoly, pi, root, log, exp)
from sympy.solvers.inequalities impor... | |
from astroid.__pkginfo__ import author
import cgi
from collections import Counter
import logging
from math import log, exp
import math
from numpy import clip, mean
import os
import pyfscache
import re
from scipy import stats
import sqlite3
from sqlitedict import SqliteDict
import string
import tagme
import time
import... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | |
# -*- coding: utf-8 -*-
"""
Admin Controllers
"""
module = request.controller
resourcename = request.function
# S3 framework functions
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
module_name = settings.modules[module].name_nice
... | |
# -*- coding: utf-8 -*-
__author__ = 'pbmanis'
"""
ChR2TraceAnalyzer provides a platform for the analysis of voltage or current traces.
The module provides standard tools to access data and databases, and flowcharts.
Two "trace" windows (PSP Plot and Data Plot) are provided to facilitate interactive
adjustment of anal... | |
"""description: workflow for inference downstream
"""
import os
import re
import h5py
import glob
import logging
import numpy as np
import pandas as pd
from ggr.analyses.linking import regions_to_genes_w_correlation_filtering
from ggr.analyses.bioinformatics import run_gprofiler
from ggr.util.utils import run_shell_... | |
from ctypes import *
import unittest
import sys, struct
def valid_ranges(*types):
# given a sequence of numeric types, collect their _type_
# attribute, which is a single format character compatible with
# the struct module, use the struct module to calculate the
# minimum and maximum value allowed for... | |
from Quartz import *
import Quartz
import Utilities
import sys
def drawQuartzRomanText(context):
text = "Quartz"
textlen = len(text)
fontSize = 60
opaqueBlack = [0.0, 0.0, 0.0, 1.0]
opaqueRed = [0.663, 0.0, 0.031, 1.0]
# Set the fill color space. This sets the
# fill painting color to... | |
"""
Test cases for the Comparisons class over the Chart elements
"""
from unittest import SkipTest, skipIf
import numpy as np
from holoviews.core import NdOverlay
from holoviews.core.options import Store
from holoviews.element import (
Area, BoxWhisker, Curve, Distribution, HSpan, Image, Points,
Rectangles, ... | |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound, PermissionDenied
from framework.auth.oauth_scopes import CoreScopes
from osf.models import AbstractNode, Registration
from api.base import permissions as base_permissions
from api.base i... | |
"""Classes to (de)serialize various struct messages"""
import struct
import six
import vdf
from six.moves import range
from steam.enums import EResult, EUniverse
from steam.enums.emsg import EMsg
from steam.utils.binary import StructReader
_emsg_map = {}
def get_struct(emsg):
return _emsg_map.get(emsg, None)
cla... | |
# coding: utf-8
"""
A custom FileBrowseField.
"""
from django.db import models
from django import forms
from django.forms.widgets import Input
from django.db.models.fields import Field, CharField
from django.utils.safestring import mark_safe
from django.forms.util import flatatt
from django.utils.encoding import StrA... | |
# Copyright 2020 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 (c) 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 agreed to ... | |
# 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.apach... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | |
"""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, softwa... | |
'''
Copyright (c) 2014
Harvard FAS Research Computing
All rights reserved.
Created on May 6, 2014
@author: John Brunelle
@author: Aaron Kitzmiller
'''
# from util import runsh_i
import logging
import re
from datetime import datetime
from slyme.util import runsh_i
logger = logging.getLogger('slyme')
class JobStep(o... | |
# Copyright 2011 Rackspace
# 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 ... | |
from TASSELpy.java.lang.Object import Object
from TASSELpy.java.lang.Comparable import Comparable
from TASSELpy.java.lang.String import String, metaString
from TASSELpy.java.lang.Boolean import metaBoolean
from TASSELpy.java.lang.Integer import metaInteger
from TASSELpy.java.util.ArrayList import ArrayList
from TASSELp... | |
#!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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 (c) 2009-2015, Jack Poulson
# All rights reserved.
#
# This file is part of Elemental and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
from El.core import *
from El.blas_like import Copy, Cop... | |
#! python
# -*- coding: utf-8 -*-
# This is a utility module for integrating email functionality into VizAlerts.
import smtplib
import re
import os.path
from email.encoders import encode_base64
# added for MIME handling
from itertools import chain
from errno import ECONNREFUSED
from mimetypes import guess_type
from s... | |
import pytest
from awx.api.versioning import reverse
from awx.main.models import Project
@pytest.fixture
def organization_resource_creator(organization, user):
def rf(users, admins, job_templates, projects, inventories, teams):
# Associate one resource of every type with the organization
for i ... | |
# Copyright 2016 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... | |
"""Collection of useful functions for the HomeKit component."""
from collections import OrderedDict, namedtuple
import logging
import voluptuous as vol
from homeassistant.components import fan, media_player, sensor
from homeassistant.const import (
ATTR_CODE, ATTR_SUPPORTED_FEATURES, CONF_NAME, CONF_TYPE, TEMP_CE... | |
# Copyright 2000-2010 Michael Hudson-Doyle <micahel@gmail.com>
# Antonio Cuni
# Armin Rigo
#
# All Rights Reserved
#
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted without fe... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | |
from random import choice
import json
import sys
MAX_WAY = 7.8
def way_cost(way_length):
if way_length <= 1:
return way_length * 100
elif way_length < MAX_WAY:
return (way_length * 100) ** 2
return sys.float_info.max
print "read data...."
pref = ""
if len(sys.argv):
pref = "_%s" % ... | |
"""Make plots for displaying results of BEST test.
This module produces plots similar to those in
Kruschke, J. (2012) Bayesian estimation supersedes the t
test. Journal of Experimental Psychology: General.
"""
from __future__ import division
import numpy as np
from best import calculate_sample_statistics
import ... | |
import os, stat, socket
import re
import sys
import tempfile
tempprefix = 'hg-hghave-'
def matchoutput(cmd, regexp, ignorestatus=False):
"""Return True if cmd executes successfully and its output
is matched by the supplied regular expression.
"""
r = re.compile(regexp)
fh = os.popen(cmd)
s = f... | |
# Copyright 2016 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 .constraint import Constraint
import copy
class Solver(object):
def __order_domain_values(self, item, csp, possible_bags):
"""least constraining value (MRV) heuristic"""
# Number of constraints
bags_constraints = []
# Dictionary of possible bags
item_possible_bags = po... | |
#!/usr/bin/env python
"""Memory Map File Analyser for ARM mbed"""
import sys
import os
import re
import csv
import json
import argparse
from copy import deepcopy
from prettytable import PrettyTable
from utils import argparse_filestring_type, \
argparse_lowercase_hyphen_type, argparse_uppercase_type
RE_ARMCC = r... | |
#-*- coding: utf-8 -*-
'''
Created on 2017. 02. 13
Updated on 2017. 02. 13
'''
from __future__ import print_function
import os
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
class ExpBase(object):
def __init__(self):
... | |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
# 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... | |
# 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
# distributed under the... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.prolog
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Prolog and Prolog-like 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 im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.