gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
The :mod:`sklearn.model_selection._search` includes utilities to fine-tune the
parameters of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.... | |
"""
Module for fetching artifacts from Nexus 3.x
.. versionadded:: 2018.3.0
"""
import base64
import http.client
import logging
import os
import urllib.request
from urllib.error import HTTPError, URLError
import salt.utils.files
import salt.utils.stringutils
from salt.exceptions import CommandExecutionError
try:
... | |
from urllib.parse import urlencode
from django.apps import apps
from django.contrib.admin.utils import quote, unquote
from django.core.paginator import Paginator
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.ur... | |
# 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 a... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
# need linear algebra packages
import scipy.sparse.linalg as _sla
import scipy.linalg as _la
import scipy.sparse as _sp
import numpy as _np
from scipy.integrate import complex_ode
from joblib import delayed,Parallel
from numpy import vstack
... | |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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... | |
from django.http import HttpResponseRedirect as Redirect, Http404
from django_openid import consumer, signed
from django_openid.utils import hex_to_int, int_to_hex
from django.conf import settings
from django.contrib.auth import authenticate
from django.core.mail import send_mail
import datetime
from urlparse import u... | |
# Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Britta Westner <britta.wstnr@gmail.com>
#
# License: BSD 3 clause
import copy as cp
import os.path as op
import pytest
from numpy.testing import assert_array_equal, assert_allclose
import numpy as np
import mne
from mne.datasets import testing
from mne.... | |
#! /usr/bin/env python3
#
# Copyright 2017 Linaro Limited
# Copyright (c) 2018-2019, Arm 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/LICENS... | |
from funcs import *
from db import *
##
# GETTERS
##
@app.route('/'+app.config['RNG_ID']+'/data/get/<path:path>')
def get_log(path):
complete_path = os.path.join(app.config['UPLOAD_FOLDER'], path)
if not os.path.exists(complete_path):
print "complete path %s does not exists" % complete_... | |
# Copyright 2019, The TensorFlow 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 t... | |
"""Test report state."""
from unittest.mock import patch
from homeassistant import core
from homeassistant.components.alexa import state_report
from . import DEFAULT_CONFIG, TEST_URL
async def test_report_state(hass, aioclient_mock):
"""Test proactive state reports."""
aioclient_mock.post(TEST_URL, text="",... | |
# -*- coding: utf-8 -*-
"""
flask.ext.security.views
~~~~~~~~~~~~~~~~~~~~~~~~
Flask-Security views module
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from flask import current_app, redirect, request, render_template, jsonify, \
after_this_request, Blu... | |
# 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
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class MemberTestCase(Integratio... | |
"""Support for the Xiaomi IR Remote (Chuangmi IR)."""
import asyncio
from datetime import timedelta
import logging
import time
from miio import ChuangmiIr, DeviceException # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.remote import (
ATTR_DELAY_SECS,
ATTR_NUM_REPEATS,
... | |
import unittest
import pylab as pl
import matplotlib as mpl
import itertools
import sys
import math
import timeit
import copy
import time
import struct
import scipy.stats.mstats as stats
import ConfigParser
import os
import getopt
import h5py
import random as rnd
import cPickle as pickle
import operator
from gmm.gmm_s... | |
import json
import os
from dataclasses import dataclass
from os import path
from typing import Callable, Dict, Generator, Sequence
import pytest
import tests.functional.services.catalog.utils.api as catalog_api
import tests.functional.services.policy_engine.utils.api as policy_engine_api
from anchore_engine.db import... | |
import datetime
import logging
import os
import sys
import threading
import time
from argparse import ArgumentParser
from io import UnsupportedOperation
from queue import Queue, Empty as QueueEmpty
# This seems like a waste of an import
from .constants import TOKYO_TZ, HHMM_FMT
from .control import ShowroomLiveControl... | |
"""
Starting or restarting of services and daemons
==============================================
Services are defined as system daemons and are typically launched using system
init or rc scripts. This service state uses whichever service module is loaded
on the minion with the virtualname of ``service``. Services can... | |
from contextlib import contextmanager
from sqlalchemy.types import NULLTYPE, Integer
from sqlalchemy import schema as sa_schema
from . import util
from .compat import string_types
from .ddl import impl
__all__ = ('Operations',)
class Operations(object):
"""Define high level migration operations.
Each opera... | |
# coding=utf-8
import errno
import re
import socket
import ssl
import time
import signal
from collections import namedtuple
Prefix = namedtuple('Prefix', ['nick', 'user', 'host', 'raw'])
ServerCmd = namedtuple('ServerCmd', ['prefix', 'cmd', 'args'])
class IRCClient(object):
def __init__(self,
s... | |
#!/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
# ... | |
"""Treadmill initialization and server presence daemon.
This service register the node into the Treadmill cell and, as such, is
responsible for publishing the node's capacity to the scheduler.
This service is also responsible for shutting down the node, when necessary or
requested, by disabling all traffic from and t... | |
#!/usr/bin/python
#
# Copyright 2016 Ansible by Red Hat
#
# This file is part of ansible-container
#
DOCUMENTATION = '''
module: k8s_route
short_description: Create or remove a route on a Kubernetes or OpenShift cluster.
description:
- Create or remove a route on a Kubernetes or OpenShift cluster by setting the C... | |
#!/usr/bin/env python3
# When solving a bundle adjustment problem with pair-wise feature
# matches (i.e. no 3+ way matches), the bad matches will often find a
# zero error position when minimizing the mre, but they may be
# nonsensically far away from the other points. We can't catch every
# bad match this way, but w... | |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/r... | |
# encoding: utf-8
import hashlib
import falcon
import ldap
import os
import random
import re
import string
from base64 import b64decode
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import Encoding
from cryptography.x509.oid imp... | |
"""Supporting definitions for the Python regression tests."""
import sys
class Error(Exception):
"""Base class for regression test exceptions."""
class TestFailed(Error):
"""Test failed."""
class TestSkipped(Error):
"""Test skipped.
This can be raised to indicate that a test was deliberatly
ski... | |
""" Utilities for dealing with uploading to S3. """
import StringIO
import gzip
import boto
from django.conf import settings
from zope.interface import Interface, implements
from go.errors import VumiGoError
class BucketError(VumiGoError):
""" Raised when an error occurs during an operation on a bucket. """
... | |
# This file is a part of OMPC (http://ompc.juricap.com/)
#
# for testing:
# import ompclib_numpy; reload(ompclib_numpy); from ompclib_numpy import *
# TODO
# - remove all references to array, use "ompc_base._init_data" instead
import sys
from itertools import izip as _izip, cycle as _cycle, repeat as _repeat
impo... | |
#!/usr/bin/python3
#
# Copyright (c) 2013 Mikkel Schubert <MikkelSch@gmail.com>
#
# 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
... | |
from django.db.models import Q
from django.shortcuts import render
from django.utils.safestring import mark_safe
from django.views.decorators.cache import cache_page
import jingo
import jinja2
from tower import ugettext_lazy as _lazy
import amo
from amo.helpers import urlparams
from addons.models import Addon
from tr... | |
#!/usr/bin/env python3
# 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... | |
#
# Copyright (c) 2012 Patrice Munger
# This file is part of pynetdicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pynetdicom.googlecode.com
#
# Implementation of the OSI Upper Layer Services
# DICOM, Part 8, Section 7
import soc... | |
import sublime
import sublime_plugin
import os
import re
import time
import subprocess
import json
import datetime, calendar
PLUGIN_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
HELPER_DIRECTORY = PLUGIN_DIRECTORY + '/'
FLAT_YAML_KEYS = HELPER_DIRECTORY + 'flat_yaml_keys.rb'
# stolen from https://github.com... | |
#! /usr/bin/env python
#
# example2_tk.py -- Simple, configurable FITS viewer.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
im... | |
# -*- 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... | |
from __future__ import unicode_literals
import os
import fcntl
import select
import signal
import errno
import threading
from prompt_toolkit.terminal.vt100_input import InputStream
from prompt_toolkit.utils import DummyContext, in_main_thread
from .base import EventLoop, INPUT_TIMEOUT
from .callbacks import EventLoopC... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ProductDownloadableContent'
db.create_table(u'shop_produc... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) The python-semanticversion project
# This code is distributed under the two-clause BSD License.
"""Test the various functions from 'base'."""
import unittest
import sys
from semantic_version import base
class TopLevelTestCase(unittest.TestCase):
"""... | |
#Plots the Av magnitude due to the balmer decerment
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
import sys, os, string
import pandas as pd
from astropy.io import fits
import collections
#Folder to save the figures
figout = '/Users/blorenz/COSMOS/Reports/2018/Images/'
#The location ... | |
"""Support for the Tuya lights."""
from __future__ import annotations
from dataclasses import dataclass
import json
from typing import Any, cast
from tuya_iot import TuyaDevice, TuyaDeviceManager
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
COLOR_MODE_... | |
# Copyright (c) 2013 TrilioData, Inc.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | |
from ctypes import BigEndianStructure, Union, c_uint8, c_uint16, c_uint32
from .compat import *
from .error import *
from .packet import *
from .util import *
class Box(Packet):
def __init__(self, type, total_size, payload, extended_size=False):
self.type = type
self.total_size = total_size
... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 21 23:17:39 2016
Class files to store workflow information
@author: alex
"""
#Node object for use in a tree
class Node(object):
def __init__(self):
self.connections = []
self.data = None
#Tree datastructure to allow for storage of non-linear... | |
from scipy.io import wavfile
import subprocess
import time
import math
import glob
import os
import librosa
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from matplotlib.pyplot import specgram
import random
import shelve
from decimal import Decimal
import math
import argparse
import sys
i... | |
# -*- coding: utf-8 -*-
"""
Snake module.
"""
from pygame import Rect
from constants import (MAX_HITPOINTS,
INIT_SPEED, MIN_SPEED, MAX_SPEED)
from constants import INVINCIBILITY_BLINK_RATE
from utils import add_vecs, sub_vecs, normalize, m_distance
from core.map import wrap_around, on_edge
# -... | |
# import
import pandas as pd
from os.path import join
import xml.etree.ElementTree as ET
import os
import zipfile
from pypxlib import Table
from collections import OrderedDict
import shutil
'''
a shortcut to ET.SubElenment(parent, child).text ( and *.text = text )
'''
def add_node(parent, child, text):
if type(tex... | |
# copied from https://github.com/openai/universe-starter-agent/blob/master/envs.py
import cv2
from gym.spaces.box import Box
import numpy as np
import gym
from gym import spaces
import logging
import universe
from universe import vectorized
from universe.wrappers import BlockingReset, GymCoreAction, EpisodeID, Unvecto... | |
#----------------------------------------------------------------------
# Copyright (c) 2013 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... | |
#!/usr/bin/python -tt
# omega - python client
# https://github.com/jfillmore/Omega-API-Engine
#
# Copyright 2011, Jonathon Fillmore
# Licensed under the MIT license. See LICENSE file.
# http://www.opensource.org/licenses/mit-license.php
"""Omega client for talking to an Omega server."""
import pycurl
import urllib... | |
import abc
class A(object):
def __init__(self):
self._x = 1
@property
def foo(self):
return self._x
@foo.setter
def foo(self, x):
self._x = x
@foo.deleter
def foo(self):
pass
@property
def boo(self):
return self._x
<warning descr="Names of function and decorator don't matc... | |
#
# File : keil.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
import numpy as np
from astropy.coordinates import SkyCoord, ICRS, BaseCoordinateFrame
from astropy.io import fits
from astropy import wcs
import astropy.units as u
from astromodels.functions.function import Function2D, FunctionMeta
from astromodels.utils.angular_distance import angular_distance
from astromodels.utils... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# 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
#... | |
import copy
from re import compile
import time
import requests
from .rest import RequestsNetworkWrapper, ServiceClient
from .rest_client import RESTServiceClient, Endpoint
from .custom_query_object import CustomQueryObject
import os
import logging
logger = logging.getLogger(__name__)
_name_checker = compile(r"^[\w... | |
import os, sys
import operator
import glob
import numpy as np
# =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
def writeLog( parser , args, skip=False ):
try:
if( not skip ):
import time
td = time.localtime()
progname = parser.prog
fstr = '.'+progname.split('.py')[0]
fstr += ... | |
import sys
import mimetypes
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.utils.translation import ugettext as _
from django.contrib.sites.managers import CurrentSiteManager
from django.template.loader ... | |
# Copyright 2015 Isotoma 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 writing... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this swift except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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... | |
# Copyright (c) 2015 Tintri. All rights reserved.
# Copyright (c) 2012 NetApp, 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.apac... | |
import sublime
import sublime_plugin
import string
import re
import sys
import time
import base64
import html.entities
from cgi import escape
from hashlib import md5,sha1
from datetime import datetime
from random import sample, choice, randrange
import os, socket, urllib
import binascii
import json
import pprint
if sy... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.tests.menu_page_viewperm import ViewPermissionTests
from cms.utils.compat.dj import get_user_model
__all__ = [
'ViewPermissionComplexMenuStaffNodeTests',
]
class ViewPermissionComplexMenuStaffNodeTests(ViewPermissionTests):
"""
Test ... | |
from StringIO import StringIO
from sympy.core import symbols, Eq, pi, Catalan, Lambda, Dummy
from sympy.utilities.codegen import CCodeGen, Routine, InputArgument, Result, \
CodeGenError, FCodeGen, codegen, CodeGenArgumentListError, OutputArgument, \
InOutArgument
from sympy.utilities.pytest import XFAIL, raise... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import division
import sys
import albow # used for translation update
from pygame import Rect, Surface, image
from pygame.locals import K_RETURN, K_KP_ENTER, K_ESCAPE, K_TAB, KEYDOWN, SRCALPHA
from pygame.mouse import set_cursor
from pygame.cursors import arrow as arrow_cursor
from pygame.transform impo... | |
"""Public project views"""
import operator
import os
import json
import logging
import mimetypes
import md5
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.http... | |
import numpy as np
from PyQt4.QtGui import QIntValidator, QDoubleValidator, QApplication, QSizePolicy
from orangewidget import gui
from orangewidget.settings import Setting
from oasys.widgets import widget
import orangecanvas.resources as resources
import sys
import os
from crystalpy.diffraction.DiffractionSetup impo... | |
#! /usr/bin/env python
# Macro to scale histograms of all Pt-hard bins, using xsec and ntrials from AliAnalysisTaskPWGJEQA.
# This script expects files X/AnalysisResultsPtHardX.root, and will output scaled histograms
# to the same file, in a new output list with suffix "Scaled". The script will automatically loop over... | |
#!/usr/bin/python
# Copyright (c) 2012 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.
from __future__ import print_function
import os
import re
import struct
import subprocess
import sys
import tempfile
import test... | |
#!/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... | |
'''
This module defines classes needed to manipulate c++ types from pythran.
'''
from pythran.config import cfg
class Weak:
"""
Type Qualifier used to represent a weak type
When a weak type is combined with another type, the weak type is suppressed
"""
class Type(object):
"""
A generic typ... | |
# 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... | |
# 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 ... | |
# Copyright 2013 Lars Butler & individual contributors
#
# 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 applicab... | |
# 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... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.periodic_table import Element, Specie
from pymatgen.core.composition import Composition
from ... | |
import warnings
from functools import update_wrapper, wraps
from unittest import TestCase
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import (
login_required, permission_required, user_passes_test,
)
from django.http import HttpRequest, HttpResponse, ... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines a set of constants shared by test runners and other scripts."""
# TODO(jbudorick): Split these constants into coherent modules.
# pylint: di... | |
# Copyright 2014 Netflix, 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... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 applicab... | |
# 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 typing import Any, Collection, Dict, Optional, Tuple, cast
from ..language import ast, DirectiveLocation
from ..pyutils import inspect, is_description
from .assert_name import assert_name
from .definition import GraphQLArgument, GraphQLInputType, GraphQLNonNull, is_input_type
from .scalars import GraphQLBoolean, ... | |
"""
Runs taggd, a tool to demultiplex (link molecular barcodes back to) a file of genetic reads,
typically obtained by sequencing. For matched reads, the barcode and its related properties
are added to the read. Unmatched reads, ambiguously matched reads, and stats are by default
produced as output files as well.
The... | |
#!/usr/bin/env python
'''
Ansible module for user media
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix user media ansible module
#
#
# 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.
# ... | |
"""utils originally from torchvision https://github.com/pytorch/vision/blob/master/references/classification/utils.py
With some changes.
Removing iterable wrapper in MetricLogger
"""
from collections import defaultdict, deque
import datetime
from time import time
import torch
import torch.distributed as dist
impo... | |
###############################################################################
# encoding: utf-8
#
# Copyright (c) 2011 Ruslan Spivak
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | |
from ctypes import *
import unittest
import os
import ctypes
import _ctypes_test
class BITS(Structure):
_fields_ = [("A", c_int, 1),
("B", c_int, 2),
("C", c_int, 3),
("D", c_int, 4),
("E", c_int, 5),
("F", c_int, 6),
... | |
"""Tests for eval_lib.image_batches."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import unittest
from six import assertCountEqual
from eval_lib import image_batches
from eval_lib import submissions
from eval_lib.tests import fake_c... | |
from twisted.words.protocols import irc
from twisted.internet import protocol
import traceback,sys
import collections
import shlex
class Bot(irc.IRCClient):
def __init__(self):
self._is_signed_on = False
self._joined_channels = set()
self._msg_queue = []
self.command_modules =... | |
#! /usr/bin/env python
#
# example2.py -- Simple, configurable FITS viewer.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
import ginga.toolkit as ginga_toolkit
from ginga import colors
from ginga.canvas.CanvasObject import get_canvas_types
f... | |
import socket
from collections import deque
from threading import Thread
import logging
import Queue
import sys
from YamahaAV import YamahaAV
logger = logging.getLogger('yamaha-av')
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
# static / constants
# NUMCHAR_CODES[zone][action]
NUMCHAR_CODES = {
1... | |
# 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
# d... | |
from __future__ import absolute_import
import pickle
from mock import call
from kombu import Connection, Exchange, Queue, binding
from kombu.exceptions import NotBoundError
from .mocks import Transport
from .utils import TestCase
from .utils import Mock
def get_conn():
return Connection(transport=Transport)
... | |
from __future__ import print_function, division, absolute_import
from collections import namedtuple
import sys
from llvmlite.ir import Value
from llvmlite.llvmpy.core import Constant, Type, Builder
from . import (_dynfunc, cgutils, config, funcdesc, generators, ir, types,
typing, utils)
from .errors i... | |
'''Top-level entry points to yakonfig.
.. This software is released under an MIT/X11 open source license.
Copyright 2014-2015 Diffeo, Inc.
Most programs' `main()` functions will call yakonfig as::
parser = argparse.ArgumentParser()
yakonfig.parse_args(parser, [yakonfig, module, module...])
where the list... | |
# -*- coding: utf-8 -*-
from datetime import date
import json
from operator import itemgetter
import os
import warnings
from django.conf import settings
from django.core.urlresolvers import NoReverseMatch
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models import si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.