gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging
import os.path
import shutil
import requests
from contextlib import closing
from cattle.type_manager import get_type, MARSHALLER
from cattle.storage import BaseStoragePool
from cattle.agent.handler import KindBasedMixin
from cattle.plugins.volmgr import volmgr
from cattle.plugins.docker.util import is_no... | |
import numpy as np
import scipy.misc
import scipy.signal
import math
import draw
import ref
# =============================================================================
# General image processing functions
# =============================================================================
def get_transform(center, sc... | |
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | |
# Copyright 2013 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
#
# Unless required by applicable law or agreed to in writing, soft... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'EVS.aa_ac_alt'
db.alter_column('evs', 'aa_ac_alt', self.gf('django.db.models.fields.Char... | |
from datetime import time, timedelta
import numpy as np
import pytest
import pandas as pd
from pandas import Series, TimedeltaIndex, isna, to_timedelta
import pandas._testing as tm
class TestTimedeltas:
@pytest.mark.parametrize("readonly", [True, False])
def test_to_timedelta_readonly(self, readonly):
... | |
from statsmodels.compat.python import lzip
import numpy as np
from scipy import stats
from statsmodels.distributions import ECDF
from statsmodels.regression.linear_model import OLS
from statsmodels.tools.decorators import cache_readonly
from statsmodels.tools.tools import add_constant
from . import utils
__all__ = ... | |
# -*- test-case-name: twisted.application.test.test_internet,twisted.test.test_application,twisted.test.test_cooperator -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Reactor-based Services
Here are services to run clients, servers and periodic services using
the reactor.
If you want... | |
# Zawgyi<>Unicode converter python module
# Based on rules from Parabaik Myanmar Text Converter
# Copyright (C) 2014 Ngwe Tun (Solveware Solution)
# Copyright (C) 2014 Thura Hlaing
# Copyright (C) 2015 Kaung Htet Zaw
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and ... | |
from __future__ import print_function, division
from sympy.core import S, sympify, Dummy, Mod
from sympy.core.cache import cacheit
from sympy.core.compatibility import reduce, range, HAS_GMPY
from sympy.core.function import Function, ArgumentIndexError
from sympy.core.logic import fuzzy_and
from sympy.core.numbers imp... | |
# Copyright (C) 2012 - 2014 EMC Corporation.
# 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
#
# Unle... | |
# occiput
# Stefano Pedemonte
# April 2014
# Harvard University, Martinos Center for Biomedical Imaging
# Boston, MA, USA
import Scintillators
import Collimators
from mMR import UncompressedProjection
from numpy import *
from numpy.random import randint
# Import NiftyCore ray-tracers
from occiput.Core.Nif... | |
# 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 ... | |
from PIL import Image, ImageTk
from Tkinter import Frame, Button
from time import sleep
class BoardFrame(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.configure(background="#336600")
# Divide screen in horizontal zones
self.infoFrame = Frame(self) # c... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
"""The tests for the nx584 sensor platform."""
import requests
import unittest
from unittest import mock
from nx584 import client as nx584_client
from homeassistant.components.binary_sensor import nx584
from homeassistant.bootstrap import setup_component
class StopMe(Exception):
"""Stop helper."""
pass
c... | |
import dragonfly
import dragonfly.pandahive
import bee
from bee import connect
import dragonfly.scene.unbound, dragonfly.scene.bound
import dragonfly.std
import dragonfly.io
import dragonfly.canvas
import dragonfly.convert.pull
import dragonfly.logic
import dragonfly.bind
import Spyder
# ## random matrix generator
f... | |
import decimal
import json
import unittest
import uuid
from django import forms
from django.core import exceptions, serializers, validators
from django.core.exceptions import FieldError
from django.core.management import call_command
from django.db import IntegrityError, connection, models
from django.test import Tran... | |
#!/usr/bin/env python
"""
Lamina specification
"""
import csv
import os
import collections
import numpy as np
import gzip
import networkx as nx
class hex_array(object):
"""
0 1 2 3 4
----------------------> cols (X=cols*sqrt(3))
0| 0 2 4
| 1 3
1| 5 7 9
... | |
# pylint: disable=too-many-locals,too-many-branches,too-many-statements
import enum
import logging as log
import time
from collections import namedtuple
from datetime import datetime, timedelta
from . import git, gitlab
from .branch import Branch
from .interval import IntervalUnion
from .merge_request import MergeRequ... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
# CAU: Adaptation of the cpython 2.2 test_array.py for jython 2.2
# Formerly test_jarray.py, now test_array.py so that this
# test completely supercedes the cpthyhon test. It would
# be better to simply complement the cpython test, but that
# test bombs out too early due to basic incompatibilities... | |
"""The sensor tests for the nut platform."""
from homeassistant.const import UNIT_PERCENTAGE
from .util import async_init_integration
async def test_pr3000rt2u(hass):
"""Test creation of PR3000RT2U sensors."""
await async_init_integration(hass, "PR3000RT2U", ["battery.charge"])
registry = await hass.he... | |
# -*- coding: utf-8 -*-
import os
import urllib
import uuid
import ssl
from pymongo import MongoClient
import requests
from bs4 import BeautifulSoup
from addons.wiki import settings as wiki_settings
from addons.wiki.exceptions import InvalidVersionError
# MongoDB forbids field names that begin with "$" or contain ".... | |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.time import Time, TimeDelta
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from astropy.timeseries.periodograms.lombscargle import LombScargle
ALL_METHODS = LombScargle.available_methods
... | |
#!/usr/bin/env python
'''
This script will accept a username and password from OpenVPN, and use them to obtain
an authentication token from Azure AD.
'''
#pylint: disable=invalid-name
import binascii
#import hashlib
#from hmac import compare_digest
from backports.pbkdf2 import pbkdf2_hmac, compare_digest
import logg... | |
"""
Handles all requests relevant to the verification service of the API.
"""
from hutts_verification.image_processing.sample_extract import TextExtractor
from hutts_verification.image_preprocessing.face_manager import FaceDetector
from hutts_verification.verification.text_verify import TextVerify
from hutts_verificat... | |
# 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... | |
# 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... | |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
import time
class TestFtu(GaiaTestCase):
_activation_section_locator = ('id', ... | |
import functools
import os
from flask import Blueprint
from flask import abort
from flask import flash
from flask import g
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from flask import url_for
from peewee import *
from wtforms import Form
from wtform... | |
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
# Name: xgrablib.py
# Purpose: Create a File Geo database from a xGRAB-file
# Author: Kay Warrie
#
# Created: 28/05/2017
# Licence: MIT
#-----------------------------------------------------... | |
from os.path import join as ojoin
def ground(data_path):
# authors
authors = []
author_fname = ojoin(data_path, 'author.txt')
with open(author_fname) as f:
for line in f:
line = line.strip()
if not line: continue
authors.append(line.split()[0])
# papers
... | |
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright n... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cStringIO
import os
import re
import subprocess
import sys
import threading
try:
import git_cache
except ImportError:
for p... | |
"""
Tests for splitter objects.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar, Aneesh Pappu"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import tempfile
import unittest
import numpy as np
... | |
# encoding: utf-8
import contextlib
import os
from xml.dom import minidom
from config import CREATE_OUTPUT, TEAMBEAM_EXE, UPLOAD_FOLDER
from engine.datastore.models.paper import Paper
from engine.datastore.models.reference import ReferenceType
from engine.datastore.models.text import TextType
from engine.importer.imp... | |
# 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... | |
# Nimble Storage, Inc. (c) 2013-2014
# 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... | |
"""
This file contains models for the Quiz module of the e-learning platform
It has models defined for the Quiz, QuestionModule, Question and Submissions
Also defines the model for saving the history for the above
"""
import json
from django.contrib.auth.models import User
from django.db import models
from django.db.m... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | |
# Copyright 2013 SolidFire 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... | |
"""
kombu.serialization
===================
Serialization utilities.
"""
from __future__ import absolute_import
import codecs
import os
import sys
import pickle as pypickle
try:
import cPickle as cpickle
except ImportError: # pragma: no cover
cpickle = None # noqa
from collections import namedtuple
from ... | |
from pandas import read_csv
from nlp.common import prt
from time import time
from nlp.common import exists
import cPickle as pickle
import gzip
import codecs
from os.path import splitext, join
from collections import Counter
from nlp.morpho.mystem import get_pos
from collections import defaultdict
from sys import stder... | |
"""
Test lldb core component: SourceManager.
Test cases:
o test_display_source_python:
Test display of source using the SBSourceManager API.
o test_modify_source_file_while_debugging:
Test the caching mechanism of the source manager.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.deco... | |
"""Metrics utility functions."""
import enum
import io
from typing import Tuple
import imageio
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
from sklearn import metrics
class EvaluationMetric(enum.Enum):
"""Evaluation metric kinds."""
def _generate_next_value_(name, sta... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
"""phy main CLI tool.
Usage:
phy --help
"""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import sys
import os.path as op
im... | |
# -*- coding: utf-8 -*-
import json
import unittest
from datetime import datetime
from flask.ext.testing import TestCase
from flask import url_for
from app import create_app, db
from app.models import User, Todo, TodoList
class TodolistAPITestCase(TestCase):
def create_app(self):
return create_app('te... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from matplotlib.pyplot import axes
import hickle as hkl
import numpy as np
np.random.seed(2 ** 10)
import tensorflow as tf
from keras import backend as K
K.set_image_dim_ordering('tf')
from keras import regul... | |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# execsnoop Trace new processes via exec() syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: execsnoop [-h] [-T] [-t] [-x] [-q] [-n NAME] [-l LINE]
# [--max-args MAX_ARGS]
#
# This currently will print up to a maximu... | |
from rdflib.namespace import RDF
from rdflib.term import BNode, URIRef
from random import randint
__all__ = ["Container", "Bag", "Seq", "Alt", "NoElementException"]
class Container(object):
"""A class for constructing RDF containers, as per https://www.w3.org/TR/rdf11-mt/#rdf-containers
Basic usage, creatin... | |
#!/usr/bin/env python -u
from operator import add
import time
import sys
import numpy as np
import glob
from operator import add
from optparse import OptionParser
from sets import Set
import l_bp
def get_p(ls):
return np.exp(ls)
def get_ls(p):
if p == 0:
return float("-inf")
else:
return n... | |
"""Proxy camera platform that enables image processing of camera data."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import io
import logging
from PIL import Image
import voluptuous as vol
from homeassistant.components.camera import (
PLATFORM_SCHEMA,
Camera,
async_g... | |
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ap... | |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# 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 (c) Citrix Systems 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 condition... | |
# SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import functools
import json
import logging
import os
import re
from collections import defaultdict
from copy import deepcopy
import junit_xml
from tiny_test_fw import TinyFW, Utility
from .DebugUtils import... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the file system searcher."""
import os
import unittest
from dfvfs.lib import definitions
from dfvfs.helpers import fake_file_system_builder
from dfvfs.helpers import file_system_searcher
from dfvfs.path import fake_path_spec
from dfvfs.path import os_path_spec
fr... | |
# Copyright 2020 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <[email protected]>
## This program is published under a GPLv2 license
"""
NetBIOS over TCP/IP
[RFC 1001/1002]
"""
import struct
from scapy.packet import *
from scapy.fields import *
from sc... | |
from __future__ import division
import numpy as np
from numpy.fft import fft2, ifft2
import pyfftw
from .utils import fft_shift_phasor_2d, yxoffset
from .psffuncs import gaussian_moffat_psf
__all__ = ["TabularPSF", "GaussianMoffatPSF"]
class PSFBase(object):
"""Base class for 3-d PSFs."""
def __init__(sel... | |
import pytest
import mock
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
ForkFactory
)
from rest_framework import exceptions
from website import mails
from webs... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
import re
from pytest import raises
from jenkinsflow.flow import serial, parallel, FailedChildJobException
from .cfg import ApiType
from .framework import api_select
from .framework... | |
import argparse
import asyncio
import gc
import os.path
import pathlib
import socket
import ssl
PRINT = 0
async def echo_server(loop, address, unix):
if unix:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.... | |
import asyncio
import logging
import re
import traceback
from contextlib import suppress
from http import HTTPStatus
from urllib.parse import parse_qs
import aiohttp_jinja2
import jinja2
from aiohttp import web
from aiohttp.web_exceptions import HTTPNotFound, HTTPPermanentRedirect
from aiohttp.web_middlewares import n... | |
from __future__ import print_function
from acq4.util import Qt
import acq4.Manager
import acq4.pyqtgraph as pg
import acq4.pyqtgraph.opengl as gl
import numpy as np
import acq4.util.functions as fn
import re
man = acq4.Manager.getManager()
## update DB field to reflect dir meta info
#for i in db.select('Cell', ['row... | |
# Copyright (c) 2014 Mirantis, 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... | |
from octopy.utils import *
import java.lang
import jarray
from ru.parallel.octotron.generators.tmpl import VarTemplate
OCTO_PACKAGE = "ru.parallel.octotron"
class Rule(object):
def __init__(self, args):
self.args = args
def GetOcto(self):
c = java.lang.Class.forName(OCTO_PACKAGE + ".rules." + type(self).__na... | |
# 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 ... | |
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
# Copyright 2013 IBM Corp.
# Copyright 2013 eNovance <[email protected]>
# Copyright Ericsson AB 2013. All rights reserved
# Copyright 2014 Hewlett-Packard Company
# Copyright 2015 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0... | |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: [email protected]
##
## This file is part of VisTrails.
##
## ... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from nose.tools import eq_, ok_, raises
from wtforms import fields
from flask.ext.admin import form
from flask.ext.admin._compat import as_unicode
from flask.ext.admin._compat import iteritems
from flask.ext.admin.contrib.sqla import ModelView, filters
from flask.ext.babelex import Babel
from . import setup
from da... | |
# -*- coding: utf-8 -*-
import re
class Lexer:
def __init__(self,source):
"source's newline must be '\n'. '\r' is regarded as normal charactor"
self.source = source
self.len_ = len(self.source)
self.pos_ = 0
self.nextl = -1
def __getitem__(self,i):
return self.s... | |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, publish... | |
#
# (C) Copyright 2003-2011 Jacek Konieczny <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | |
from functools import partial
from itertools import chain
import pytest
import numpy as np
from sklearn.metrics.cluster import adjusted_mutual_info_score
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import rand_score
from sklearn.metrics.cluster import completeness_score
from s... | |
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
#-------------------------------------------------------------------------------
# Name: Notional SQLite module
# Purpose: Provides an object class for decoding and interpreting a SQLite
# DB data from a forenic perspective. Note: this module does not
# provide querying capabilities... | |
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponsePermanentRedirect
from django.middleware.locale import LocaleMiddleware
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from dja... | |
# 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 ... | |
# 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 agree... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
#!/usr/bin/env python
# test_connection.py - unit test for connection attributes
#
# Copyright (C) 2008-2011 James Henstridge <[email protected]>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foun... | |
# Copyright 2019 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 print_function, absolute_import
from distutils import sysconfig
from distutils import version
from distutils.core import Extension
import glob
import io
import multiprocessing
import os
import re
import subprocess
import sys
from textwrap import fill
try:
from subprocess import check_outpu... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import zip
from builtins import object
import numpy as np
from .generalTools import sym_to_name
from scipy.int... | |
# Copyright (C) 2015 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 appli... | |
import os
import time
import M2Crypto.threading
import hashlib
import logging
import threading
import unittest
from M2Crypto import m2, SSL
from . import ssl, util as testutil, node as node_util
from .. import util, errors
from ..client.chunk import split_file
from ..jsonrpc import gen_storage_node_proxy_creator, Sto... | |
import json
from collections import OrderedDict
import pyomo.kernel as pmo
import numpy
import relaxations
registered_problems = {}
class Problem(object):
def create_model(self):
raise NotImplementedError
def transform_to_convex(self, model):
raise NotImplementedError
def restore_from_... | |
#!/usr/bin/env python3
#
# A plugin for the Unbound DNS resolver to resolve DNS records in
# multicast DNS [RFC 6762] via Avahi.
#
# Copyright (C) 2018-2019 Internet Real-Time Lab, Columbia University
# http://www.cs.columbia.edu/irt/
#
# Written by Jan Janak <[email protected]>
#
# Permission is hereby granted, f... | |
#!/usr/bin/env python3
import collections
import functools
import importlib
import multiprocessing
import os
import sys
import json
import qtutil
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtGui import QApplication
from datadialog import DataDialog
from pipeconf import PipeconfDialog, PipelineMod... | |
"""
A module for sharing intermediates between contractions.
Copyright (c) 2018 Uber Technologies
"""
import contextlib
import functools
import numbers
import threading
from collections import Counter, defaultdict
from typing import Any
from typing import Counter as CounterType
from typing import Dict, Generator, Lis... | |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.ops import sigmoid_focal_loss as _sigmoid_focal_loss
from ..builder import LOSSES
from .utils import weight_reduce_loss
# This method is only for debugging
def py_sigmoid_focal_loss(pred,
... | |
# Copyright 2013: Mirantis 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.