gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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... | |
"""
Serialize data to/from CSV
Since CSV deals only in string values, certain conventions must be
employed to represent other data types. The conventions used in this
serializer implementation are as follows:
- Boolean values are serialized as 'TRUE' and 'FALSE'
- The strings 'TRUE' and 'FALSE' are serialized as "'T... | |
#!/usr/bin/python
#Standard python libs
import sys
import os
# import datetime
import numpy as np
import h5py
import matplotlib.pyplot as plt
from math import *
#Libs related to scipy and matplotlib
from scipy import *
from scipy.fftpack import fft
from scipy.fftpack.helper import fftfreq
sys.path.append("./" )
# tim... | |
# Copyright (C) 2011-2013 Claudio Guarnieri.
# Copyright (C) 2014-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import datetime
import hashlib
import logging
import os
import pkgutil
import socket
import struct
import ... | |
from __future__ import annotations
from typing import Dict, Text, Union, List, Tuple
from rasa.utils.io import WriteRow
from pathlib import Path
import csv
import numpy as np
from rasa.core.evaluation.marker_base import EventMetaData
def compute_statistics(
values: List[Union[float, int]]
) -> Dict[Text, Union... | |
from __future__ import division
from itertools import izip
import math, random, copy, sys
import pygame as pg
from .. import setup, observer
from .. import constants as c
#Python 2/3 compatibility.
if sys.version_info[0] == 2:
range = xrange
class Trigger(pg.sprite.Sprite):
def __init__(self, left, top):
... | |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import pytest
import numpy as np
from scipy import sparse
from scipy.sparse import csgraph
from scipy.linalg import eigh
from sklearn.manifold import SpectralEmbedding
from sklearn.manifold._spectral_embedding import _graph_is_connected
from sklearn.manifold._spectral_embedding import _graph_connected_component
from... | |
#!/usr/bin/env python3
"""IP4 VRF Multi-instance Test Case HLD:
**NOTES:**
- higher number of pg-ip4 interfaces causes problems => only 15 pg-ip4 \
interfaces in 5 VRFs are tested
- jumbo packets in configuration with 15 pg-ip4 interfaces leads to \
problems too
**config 1**
- add 15 pg-ip4 interf... | |
import collections
import itertools
import datetime
import isodate
from rdflib.compat import Mapping, MutableMapping
from rdflib.namespace import NamespaceManager
from rdflib import Variable, BNode, Graph, ConjunctiveGraph, URIRef, Literal
from rdflib.term import Node
from rdflib.plugins.sparql.parserutils import Co... | |
"""Test the condition helper."""
from logging import WARNING
from unittest.mock import patch
import pytest
from homeassistant.exceptions import ConditionError, HomeAssistantError
from homeassistant.helpers import condition
from homeassistant.helpers.template import Template
from homeassistant.setup import async_setup... | |
#
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Timothy Dozat
#
# 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... | |
import unittest
from urllib3_mock import Responses
import demisto_client
from datetime import datetime
import json
responses = Responses('requests.packages.urllib3')
api_key = 'sample_api_key'
host = 'http://localhost:8080'
def assert_reset():
assert len(responses._urls) == 0
assert len(responses.calls) == ... | |
import os
import struct
import subprocess
import sys
import time
import sharedstructures
POOL_NAME_PREFIX = "HashTableTest-py-pool-"
ALLOCATOR_TYPES = ('simple', 'logarithmic')
def get_current_process_lsof():
return subprocess.check_output(['lsof', '-p', str(os.getpid())])
def expect_key_missing(table, k):
tr... | |
"""
desispec.calibfinder
====================
Reading and selecting calibration data from $DESI_SPECTRO_CALIB using content of image headers
"""
import re
import os
import numpy as np
import yaml
import os.path
from desispec.util import parse_int_args, header2night
from desiutil.log import get_logger
def parse_date_... | |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 20 17:12:53 2014
author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from statsmodels.regression.linear_model import OLS, WLS
from statsmodels.sandbox.regression.predstd import wls_prediction_std
from statsmodels.regres... | |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def pred_visualization(fname, arrays, picks, img_shape, tile_spacing=(0,0),
scale_rows_to_unit_interval=True,
output_pixel_vals=True):
"""Used ... | |
import datetime
import time
from typing import List
from unittest import mock
from django.test import override_settings
from django.utils.timezone import now as timezone_now
from confirmation.models import one_click_unsubscribe_link
from zerver.lib.actions import do_create_user
from zerver.lib.digest import (
_en... | |
# Copyright 2015 Cloudbase Solutions SRL
# 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 r... | |
# 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 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... | |
# 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 ... | |
__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']
import sys
import numpy.core.numeric as N
from numpy.core.numeric import concatenate, isscalar, binary_repr, identity, asanyarray
from numpy.core.numerictypes import issubdtype
# make translation table
_numchars = '0123456789.-+jeEL'
if sys.version_info[0] >= 3:
cl... | |
from itertools import product
import numpy as np
from sympy import And
import pytest
from conftest import skipif, opts_tiling
from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa
Eq, Operator, Constant, Dimension, SubDimension, switchconfig,
... | |
# Copyright 2013-2014 MongoDB, 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 writin... | |
#! /usr/bin/python
#
# Copyright (c) 2014 IBM, 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
#
# ... | |
import os
import platform
import unittest
import pytest
import requests
from mock import Mock
from conans import DEFAULT_REVISION_V1
from conans.client.conf import ConanClientConfigParser
from conans.client.remote_manager import Remote
from conans.client.rest.auth_manager import ConanApiAuthManager
from conans.client... | |
from pygame import event as pygevent
from thorpy.elements.draggable import Draggable
from thorpy.miscgui import constants, functions, style, painterstyle
class Dragger(Draggable):
def __init__(self, slider, normal_params=None, press_params=None):
super(Dragger, self).__init__("", [], normal_params, pres... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import functools
from .. import backend as K
from keras import activations
from keras import initializers
from keras import regularizers
from keras import constraints
from keras.engine import Layer
from keras.engine import InputSpec
from keras.layers.convo... | |
from builtins import range, str, object
import os
import re
import copy
import json
import numpy as np
import pickle
from functools import partial
from contextlib import contextmanager
from peri import util, comp, models
from peri.logger import log as baselog
log = baselog.getChild('states')
class UpdateError(Excep... | |
#
# 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... | |
"""
Utililty objects for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
- `PolyError` -- base class for this sub-package's errors.
- `PolyDomainError` -- raised when ... | |
# -*- coding: utf-8 -*-
"""
File related views, including view_file, edit_file, view_history_file,
view_trash_file, view_snapshot_file
"""
import os
import hashlib
import json
import stat
import tempfile
import urllib
import urllib2
import chardet
from django.contrib.sites.models import Site, RequestSite
from django.... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterpolar"
_path_str = "scatterpolar.hoverlabel"
_valid_props = {
"align",
... | |
#!/usr/bin/env python
import os
import sys
import tempfile
import shutil
import glob
import atexit
import textwrap
import site
from scripttest import TestFileEnvironment, FoundDir
from tests.path import Path, curdir, u
from pip.util import rmtree
pyversion = sys.version[:3]
# the directory containing all the tests
h... | |
# Author: Jean-Remi King, <[email protected]>
# Marijn van Vliet, <[email protected]>
#
# License: BSD (3-clause)
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal)
import pytest
from mne.fixes import is_regressor, i... | |
# testing/assertsql.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from ..engine.default import DefaultDialect
from .. import util
import re
impor... | |
#!/usr/bin/env python
# Taken from https://gist.github.com/yudanta/ba476ba184652afc077a
import os
from wand.image import Image
from wand.color import Color
#create class for get exif data from image
class ExifData:
key_exif = ['date:create',
'date:modify',
'exif:ApertureValue',
'exif:BrightnessValue',
... | |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Rangeselector(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.xaxis"
_path_str = "layout.xaxis.rangeselector"
_valid_props = {
"a... | |
# 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... | |
"""Constants for the Xiaomi Miio component."""
from miio.vacuum import (
ROCKROBO_S5,
ROCKROBO_S6,
ROCKROBO_S6_MAXV,
ROCKROBO_S7,
ROCKROBO_V1,
)
DOMAIN = "xiaomi_miio"
# Config flow
CONF_FLOW_TYPE = "config_flow_device"
CONF_GATEWAY = "gateway"
CONF_DEVICE = "device"
CONF_MODEL = "model"
CONF_MAC ... | |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
import pytest
import codecs
from io import BytesIO
from zipfile import ZipFile
# package imports
from openpyxl.reader.excel import load_workbook
from openpyxl.utils.indexed_list import IndexedList
from openpyxl.styles.styleable import StyleArr... | |
"""
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | |
#!/usr/bin/env python
"""
seedBank setup tool
Copyright 2009-2011 Jasper Poppe <[email protected]>
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
Un... | |
import logging
import json
import redis
from django.contrib.auth.models import User
from django.conf import settings
from django.conf.urls import url
from django.shortcuts import get_object_or_404
from django.core.cache import cache
from tastypie import fields
from tastypie.authorization import DjangoAuthorization
fr... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | |
from __future__ import print_function
from __future__ import unicode_literals
from inspect import getdoc
from operator import attrgetter
import logging
import re
import signal
import sys
from docker.errors import APIError
import dockerpty
from .. import __version__
from .. import legacy
from ..const import DEFAULT_TI... | |
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from hyperadmin.links import LinkPrototype
from hyperadmin.resources.endpoints import ResourceEndpoint
class ListLinkPrototype(LinkPrototype):
"""
Resource Item Listing
"""
def get_link_kwargs(self, **kwargs):
... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import datetime
import logging
import numbers
import os
import sys
from collections import defaultdict
import Bio
import configargparse
import networkx
from Bio import SeqIO
from Bio.Alphabet import generic_dna
from Bio.Se... | |
"""
This module tests converting ordinal parameters to ordinal parameters.
"""
import unittest
import sqlparams
class OrdinalToOrdinal(unittest.TestCase):
"""
The :class:`OrdinalToOrdinal` class tests converting ordina
parameters to ordinal parameters.
From: format, qmark.
To: format, qmark.
"""
def test_1... | |
from operator import itemgetter
import gym
from gym import spaces
from gym.utils import seeding
from .game import Game
from .card import Card
from .player import PlayerAction, PlayerTools
from .agents.random import AgentRandom
class LoveLetterEnv(gym.Env):
"""Love Letter Game Environment
The goal of hotter... | |
from __future__ import absolute_import
import itertools
import json
import os
import zipfile
from collections import defaultdict
from six import StringIO
from datetime import datetime
from slyd.projecttemplates import templates
import six
REQUIRED_FILES = {'setup.py', 'scrapy.cfg', 'extractors.json', 'items.json',
... | |
# 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 ... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | |
from xml.dom import minidom
import shared
import templates
import classes
import c
import collections
import sys
from event import *
from actions import *
StreamonLogo = """
_____ _ __ __ ____ _ _
/ ____| | | \/ |/ __ \| \ | |
| (___ | |_ _ __ ___ __ _| \ / | | | | ... | |
# Copyright 2011 Justin Santa Barbara
# 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... | |
# -*- coding: utf-8 -*-
"""WebSocketBaseTestCase is based on combination of Tornado
and Django test systems. It require to use decorator '@gen.coroutine'
for each test case method( see documentation: http://www.tornadoweb.org/en/stable/testing.html).
It requires implementation of 'get_app' method to initialize tornado... | |
# Copyright (C) 2013-2015 MetaMorph Software, Inc
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data witho... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""fbscraper package.
This module is used for parsing or dumping a FB JSON (see help
command for further details).
Examples
--------
Using the CLI:
$ ./fbscraper.py dumper -s 10000 -c request_data.txt
$ ./fbscraper.py parser -m dl -d all -i output/*/c... | |
#
# 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
# ... | |
"""Base class for sparse matrix formats using compressed storage."""
from __future__ import division, print_function, absolute_import
__all__ = []
from warnings import warn
import operator
import numpy as np
from scipy._lib.six import zip as izip, xrange
from scipy._lib._util import _prune_array
from .base import s... | |
import os
import unittest
import tempfile
from diff_rulekeys import *
class MockFile(object):
def __init__(self, lines):
self._lines = lines
def readlines(self):
return self._lines
class TestRuleKeyDiff(unittest.TestCase):
def test_key_value_diff(self):
list_diff = KeyValueDiff... | |
# .\_eda.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:9f5b2e4c02a063822535af58fedb94550ecc79cc
# Generated 2014-11-18 14:25:23.927000 by PyXB version 1.2.3
# Namespace eda [xmlns:eda]
import pyxb
import pyxb.binding
import pyxb.binding.saxer
import io
import pyxb.utils.utility
import pyxb.utils.domutils
import sy... | |
import csv
class Student:
def __init__(self, fields):
self.fields = fields # hash table of user fields
students = [] # a list of dicts that describe a student
language_prof = {"elementary": 1, "limited": 2, "intermediate": 3, "nearly_proficient": 4}
def lookup(proficiency):
return language_prof[proficiency]
... | |
import logging
import multiprocessing
import re
import gevent
import gevent.server
import gevent.event
import exceptions
__all__ = [
'Server',
'BackgroundServer',
]
logger = logging.getLogger('pubres')
class Client(object):
def __init__(self, socket):
self._socket = socket
self._fp = so... | |
# 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... | |
#!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | |
# 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, distribute, sublicense, and/or sell
# copi... | |
# 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 BindingTestCase(Integrati... | |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
"""
SlipStream Client
=====
Copyright (C) 2015 SixSq Sarl (sixsq.com)
=====
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 ... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
#! /usr/bin/env python
import re
import math
import collections
import numpy as np
import time
import operator
from scipy.io import mmread, mmwrite
from random import randint
from sklearn import cross_validation
from sklearn import linear_model
from sklearn.grid_search import GridSearchCV
from sklearn import preproces... | |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to use the AWS SDK for Python (Boto3) with the Flask web framework to create
a web application that manages work items in a DynamoDB table and sends
email reports by using Amazon SES.
"""
... | |
#!/usr/bin/python
# Copyright 2012 Jurko Gospodnetic
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Temporarily enabled dummy test that always fails and is used to collect
# extra debugging information from Boost Build... | |
'''
'''
from __future__ import absolute_import, division
from collections import defaultdict
import numpy as np
import pandas as pd
from bokeh.charts import DEFAULT_PALETTE
from bokeh.core.enums import DashPattern
from bokeh.models.glyphs import Arc, Line, Patches, Rect, Segment
from bokeh.models.renderers import G... | |
from nose.tools import assert_equals, assert_almost_equals, assert_raises, assert_true
from scikits.crab.similarities.basic_similarities import UserSimilarity
from scikits.crab.metrics.pairwise import euclidean_distances, jaccard_coefficient
from scikits.crab.models.classes import MatrixPreferenceDataModel, \
Ma... | |
# 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... | |
#!/usr/bin/env python
# coding:utf-8
import urlparse
import os
import cgi
import time
import hashlib
from xlog import getLogger
xlog = getLogger("x_tunnel")
import simple_http_server
import global_var as g
import proxy_session
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | |
from UnitTest import UnitTest
from ClassTest import PassMeAClass
from ClassTest import ExampleChildClass
from ClassTest import ExampleMultiSuperclassParent1
import Factory2
import imports.decors # must be in this form
class Handler:
def __init__(self, x):
self._x = x
def handle(self, y):
re... | |
"""
Test of the classical LM model for language modelling
"""
from groundhog.datasets import LMIterator
from groundhog.trainer.SGD_momentum import SGD as SGD_m
from groundhog.trainer.SGD import SGD
from groundhog.mainLoop import MainLoop
from groundhog.layers import MultiLayer, \
RecurrentMultiLayer, \
Re... | |
"""
SocketIO-based rcstream client.
(c) 2014 Merlijn van Deen
This file is part of the Pywikibot framework, and is licensed under the MIT license.
This module requires socketIO_client to be installed:
pip install socketIO_client
"""
from __future__ import unicode_literals
import sys
import threading
if sys.ver... | |
#differential_expressed_gene_analysis.py
from Betsy.protocol_utils import Parameter
import normalize_file
PRETTY_NAME = "Find differentially expressed genes."
COMMON = 'Common Parameters'
NORMALIZE = 'Normalize Parameters'
OPTIONAL = 'Optional Parameters'
ILLUMINA = 'Illumina Normalize Parameters'
CLASS_NEIGHBORS = 'C... | |
import json
import time
from logger import logger
from perfrunner.helpers.cbmonitor import timeit, with_stats
from perfrunner.helpers.misc import pretty_dict, read_json
from perfrunner.helpers.profiler import with_profiles
from perfrunner.tests import PerfTest
from perfrunner.tests.analytics import BigFunTest
from per... | |
# 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... | |
from __future__ import print_function
from builtins import map
from threeML.io.file_utils import (
sanitize_filename,
if_directory_not_existing_then_make,
file_existing_and_readable,
)
from threeML.config.config import threeML_config
from threeML.io.download_from_http import ApacheDirectory, RemoteDirectory... | |
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('classic')
import matplotlib.dates as dts
import fredpy as fp
import pandas as pd
import runProcs
# get_ipython().run_line_magic('matplotlib', 'inline')
# In[3]:
# 0. Setup: Formatting commands and def... | |
# -*- coding: utf-8 -*-
"""
Database interface for automated ACL queue. Used primarily by ``load_acl`` and
``acl``` commands for manipulating the work queue.
>>> from trigger.acl.queue import Queue
>>> q = Queue()
>>> q.list()
(('dc1-abc.net.aol.com', 'datacenter-protect'), ('dc2-abc.net.aol.com',
... | |
#!/usr/bin/python
"""
Data Manager Frame
Copyright (c) 2014, 2015 Andrew Hawkins
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... | |
# 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... | |
# Copyright 2018-present Facebook, 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 i... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | |
# Copyright (C) 2021 Nippon Telegraph and Telephone 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/LICE... | |
#!/usr/bin/env python
import numpy as np
import math
def compute_kl(mean_1, log_prec_1, mean_2, log_prec_2):
"""
compute KL between two Gaussian distributions
"""
mean_1 = np.asarray(mean_1)
log_prec_1 = np.asarray(log_prec_1)
mean_2 = np.asarray(mean_2)
log_prec_2 = np.asarray(log_prec_2... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.