gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import json import os from django.conf import settings from django.core.files.storage import default_storage as storage import mock from nose import SkipTest from nose.tools import eq_ from PIL import Image import amo import amo.tests from amo.tests.test_helpers import get_image_path from amo.urlresolvers import rev...
import sys import xlrd import pandas as pd import gzip, math #reference = sys.argv[1] #metadata = sys.argv[2] #doseResponse = sys.argv[3] #screenedCompounds = sys.argv[4] #lnOuput = sys.argv[5] #aucOutput = sys.argv[6] #rmseOutput = sys.argv[7] #racs = sys.argv[8] #racsOutput = sys.argv[9] #wes = sys.argv[10] #wesOutp...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
# 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...
__author__ = 'jbosley2' import sql_settings as SQLS import sql_selects as SELECT import sql_inserts as INSERT def admin_check_login(request): user_id = SQLS.db_fetch("SELECT username FROM userAccess WHERE username = '%s';" % request[2]) if len(user_id) > 0: user_id = user_id[0][0] password = S...
# -*- coding: utf-8 -*- # Copyright (C) 2012 Sun Ning<classicning@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 t...
"""The tests for the MQTT sensor platform.""" import copy from datetime import datetime, timedelta import json from unittest.mock import patch import pytest import homeassistant.components.sensor as sensor from homeassistant.const import EVENT_STATE_CHANGED, STATE_UNAVAILABLE import homeassistant.core as ha from home...
"""Some basic tests of the dimension class, independent of configuration.""" from django.test import TestCase import mock from msgvis.apps.dimensions import models class MappedValuesQuerySetTest(TestCase): def setUp(self): # Query against django.contrib.auth.models.Permissions just for fun from ...
# Copyright 2013 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 in...
## Copyright (c) 2010, Coptix, Inc. All rights reserved. ## See the LICENSE file for license terms and warranty disclaimer. """aio -- asynchronous IO""" from __future__ import absolute_import import socket, ssl, select, errno, logging, fcntl from tornado.ioloop import IOLoop __all__ = ( 'TCPServer', 'TCPClient'...
"""Backup methods and utilities""" import couchdb import logging import os import re import sys import shutil import subprocess as sp import time from datetime import datetime from taca.utils.config import CONFIG from taca.utils import filesystem, misc logger = logging.getLogger(__name__) class run_vars(object): ...
#!/usr/bin/env python """ dnolivieri: (started: 23 september 2014) - doing multiple binary trainings. """ import pylab as pl import numpy as np import sys import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn.cross_val...
# Copyright 2012, Intel, 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 agree...
import abc from copy import deepcopy import numpy as np from menpo.visualize import AlignmentViewer2d from menpo.visualize.base import Viewable class Alignable(object): r""" Mixin for Transforms that can be constructed from an optimisation aligning a source PointCloud to a target PointCloud. Constru...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
# -*- coding: utf-8 -*- """ pygments.lexers.c_cpp ~~~~~~~~~~~~~~~~~~~~~ Lexers for C/C++ languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, \ this...
import mock from django.core.urlresolvers import reverse from django.conf import settings from slumber.exceptions import HttpClientError from cla_common.constants import DISREGARDS, SPECIFIC_BENEFITS from core.testing.test_base import CLATFrontEndTestCase class LegalHelpFormTestCase(CLATFrontEndTestCase): zon...
from App.Proxys import * data = IKVMCController( name = '', controlParamsList = [ ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ), ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0, 1.0 ) )...
from PyQt4 import QtCore, QtGui, uic from PyQt4.QtCore import Qt, QSize from PyQt4.QtGui import QApplication ##----------------------------------------------------------------## class no_editItemDelegate( QtGui.QStyledItemDelegate ): def createEditor( *args ): return None ##----------------------------------------...
#!/usr/bin/env python3 # Copyright (c) 2016 Crypto Realities Ltd # # 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 3 of the License, or # (at your option) any later version. # # ...
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
"""Highly flexible OpenID based authentication middleware .. Note:: If you want to test this module feel free to setup an account at passurl.com. The site is in alpha and any accounts will be deleted before launch but it might help with testing. Full documentation on the use of this OpenID module is in t...
# 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...
# # Copyright 2016 Quantopian, 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 wr...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
""" :maintainer: Alberto Planas <aplanas@suse.com> :maturity: new :depends: None :platform: Linux """ import functools import logging import os.path import tempfile from salt.exceptions import CommandExecutionError log = logging.getLogger(__name__) __virtualname__ = "btrfs" def _mount(device, u...
import math import const import base_player from random import randint, shuffle class Player(base_player.BasePlayer): def __init__(self): base_player.BasePlayer.__init__(self) self._playerName = "BitRandomHunt" # Can be whatever you want as long as it is a sensible one. ...
# Copyright 2012 OpenStack Foundation. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# # Neo4jGitHubMetadataStore.py # """ package oompa.tracking.github """ import json import os from oompa.tracking.github.GitHubMetadataStore import GitHubMetadataStore from oompa.tracking.github.EntityMetadata import EntityMetadata from bulbs.neo4jserver import Graph from bulbs.neo4jserver import Config cl...
"""CSE script written by Serge! """ import ast import astunparse import functools from copy import deepcopy import sys import os import itertools from sspam.tools import asttools COMMUTATIVE_OPERATORS = ast.Add, ast.Mult, ast.BitOr, ast.BitXor, ast.BitAnd ASSOCIATIVE_OPERATORS = COMMUTATIVE_OPERATORS BINARY_OPERATO...
# 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 ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
__all__ = ['XunleiClient'] import urllib import urllib2 import cookielib import re import time import os.path import json from ast import literal_eval USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0' def retry(f_or_arg, *args): #retry_sleeps = [1, 1, 1] retry_sleeps = [1, 2,...
# -*- coding: utf-8 -*- from adminsortable.admin import NonSortableParentAdmin, SortableTabularInline from django.contrib import admin from django.db import models from .forms import CenterMapForm, OffsetMarkerIconForm from .models import (BlockedIP, CategoryPlacemark, CategoryPolygon, CategoryPol...
#!/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 "License");...
# -*- coding: utf-8 -*- # 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 # ...
"""Extract, format and print information about Python stack traces.""" import sys import operator import linecache2 as linecache from six import u, PY2 __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc',...
from math import sqrt from ..geometry import Vector from .mesh import Material, MeshPart Vertex = Vector TexCoord = Vertex Normal = Vertex Color = Vertex class FaceVertex: """Contains the information a vertex needs in a face In contains the index of the vertex, the index of the texture coordinate and the...
from __future__ import absolute_import import theano import theano.tensor as T from .utils.theano_utils import shared_zeros, shared_scalar, floatX from .utils.generic_utils import get_from_module from six.moves import zip def clip_norm(g, c, n): if c > 0: g = T.switch(T.ge(n, c), g * c / n, g) return...
# -*- coding: utf-8 -*- from __future__ import print_function from warnings import catch_warnings from datetime import datetime import itertools import pytest from numpy.random import randn from numpy import nan import numpy as np from pandas.compat import u from pandas import (DataFrame, Index, Series, MultiIndex...
""" Accelerated Failure Time (AFT) Model with empirical likelihood inference. AFT regression analysis is applicable when the researcher has access to a randomly right censored dependent variable, a matrix of exogenous variables and an indicatior variable (delta) that takes a value of 0 if the observation is censored ...
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
# # Copyright 2015 LinkedIn 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
#! /usr/bin/python3 """ Extract times from results csv files, and generate plots according to the given parameters. Author Dimitar Misev """ from matplotlib import pyplot as plt import matplotlib import math import argparse import csv import sys import re COLORS = ['black', 'red', 'gold', 'green', 'blue', 'm...
import os import signal import time from FileManager import * from internal.ChromosomeType import * from internal.GenerationType import * class EvolutionManager(object): def __init__(self, fitnessFunction, individualsPerGeneration=100, elitism=1, ...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
#! /usr/bin/env python2 # -*- coding: utf-8 -*- import Tkinter import math import sys import os import os.path import stat import socket import subprocess import time import traceback import json import signal import atexit SPLIT_INTERVAL_SEC = 60 MAX_PITCH = 500.0 MAX_FMT = 4000.0 WAVEFORM_TOP_FREQ = 10000 conf_fil...
import os import unittest import anyconfig from tinydb import TinyDB, Query from tests import TEST_PATH def initialize(): import genrss import logging test_config_path = [*genrss.config_path, TEST_PATH / "data" / "custom.yml"] context = {"ROOT_DIR": TEST_PATH} genrss.CONFIG = anyconfig.load(test...
# 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...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base import serialize from twilio.base.exceptions import TwilioException from twilio.http.response import Response...
"""distutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. """ __revision__ = "$Id: util.py 59116 2007-11-22 10:14:26Z ronald.oussoren $" import sys, os, string, re from distutils.errors import DistutilsPlatformError from distutils.dep_util import newer fro...
# 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...
import sys import os import shutil import mmap import pytest from pathlib import Path from tempfile import NamedTemporaryFile, TemporaryFile, mktemp, mkdtemp from numpy import ( memmap, sum, average, product, ndarray, isscalar, add, subtract, multiply) from numpy import arange, allclose, asarray from numpy.testin...
# 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...
import numpy as np from ..errors import KaffeError, print_stderr from ..graph import GraphBuilder, NodeMapper from ..layers import NodeKind from ..transformers import (DataInjector, DataReshaper, NodeRenamer, ReLUFuser, BatchNormScaleBiasFuser, BatchNormPreprocessor, ParameterNamer) from ....
"""Support for DoorBird devices.""" import logging from urllib.error import HTTPError import voluptuous as vol from homeassistant.components.http import HomeAssistantView from homeassistant.const import ( CONF_DEVICES, CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME) ...
"""Test UniFi setup process.""" from unittest.mock import Mock, patch from homeassistant.components import unifi from homeassistant.components.unifi import config_flow from homeassistant.setup import async_setup_component from homeassistant.components.unifi.const import ( CONF_POE_CONTROL, CONF_CONTROLLER, CONF_SI...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# -*- 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# Copyright (c) 2013 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 ...
# Standard Library import argparse import base64 from datetime import datetime import os import re import textwrap # external from stix2validator import validate_string from stix2validator.validator import FileValidationResults # internal from stix2elevator.options import info, warn def find_string_in_list_case_inse...
import array import collections import logging import socket import ssl import struct import time from gearman.errors import ConnectionError, ProtocolError, ServerUnavailable from gearman.constants import DEFAULT_GEARMAN_PORT, _DEBUG_MODE_ from gearman.protocol import GEARMAN_PARAMS_FOR_COMMAND, GEARMAN_COMMAND_TEXT_C...
"""Support for interfacing to iTunes API.""" import logging import requests import voluptuous as vol from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_NEXT_TRACK, ...
"""Deep Q learning graph The functions in this file can are used to create the following functions: ======= act ======== Function to chose an action given an observation Parameters ---------- observation: object Observation that can be feed into the output of make_obs_ph stochastic: bool...
# # 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...
# multiagentTestClasses.py # ------------------------ # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to ...
#!/usr/bin/env python '''Sync metadata accross a family of fonts assuming standard UFO file naming''' __url__ = 'http://github.com/silnrsi/pysilfont' __copyright__ = 'Copyright (c) 2017 SIL International (http://www.sil.org)' __license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)' __author__...
from __future__ import division from collections import defaultdict import dask from dask import delayed, multiprocessing, threaded from dask.diagnostics import ProgressBar import numpy as np import pandas as pd from sklearn.model_selection import StratifiedKFold, KFold, GridSearchCV from sklearn.metrics import get_sc...
################################################################################ # Copyright (c) 2015 IBM Corporation # # 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, in...
# -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np from .frame import Frame from .base_frames import FramesSequence class Spec(object): """SPE file specification data Tuples of (offset, datatype, count), where offset is the offset in the SPE file and datatype is the datat...
#!/usr/bin/env python """ This is an Ansible dynamic inventory for OpenStack. It requires your OpenStack credentials to be set in clouds.yaml or your shell environment. """ from __future__ import print_function from collections import Mapping import json import os import shade def base_openshift_inventory(cluste...
"""Manage config entries in Home Assistant.""" import asyncio import functools import logging from types import MappingProxyType from typing import Any, Callable, Dict, List, Optional, Set, Union, cast import uuid import weakref import attr from homeassistant import data_entry_flow, loader from homeassistant.core imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 15 11:44:20 2019 @author: nadiablago """ import pysynphot as ps import numpy as np import os if not 'PYSYN_CDBS' in os.environ.keys(): print ("Adding the Pysynphot environment:") try: os.environ['PYSYN_CDBS'] = "PATH_TO_YOUR_PYSYNP...
from __future__ import print_function import datetime as dt import requests from os.path import expanduser from six.moves import configparser as cp home = expanduser('~') CONFIG_PATH = home + '/commute.config' class CommuteHandler(object): ''' This plugin provides information regarding commuting from an ...
# urlpath.py # 0.1.0 # 2005/08/20 # Functions that handle url paths. # Part of Pythonutils # http://www.voidspace.org.uk/python/pythonutils.html # Copyright Michael Foord, 2004 & 2005. # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # For information about bugfixe...
# -*- encoding=utf-8 -*- # Copyright 2016 David Cary; licensed under the Apache License, Version 2.0 import unittest import _test_aids from _src import sb1288 from sb1288 import decimal5 ONECK = 100000 D5 = decimal5.Decimal5 D5TOTAL = decimal5.Decimal5Total def test_compare(test_case, x, y, comparison): """Test a...
import os from Cookie import SimpleCookie, CookieError from pprint import pformat from urllib import urlencode from urlparse import urljoin try: # The mod_python version is more efficient, so try importing it first. from mod_python.util import parse_qsl except ImportError: from cgi import parse_qsl from dj...
# -*- coding: utf-8 -*- from django import forms from django_countries.fields import countries from api.models import Event from api.models.events import EventTheme, EventAudience class AddEventForm(forms.ModelForm): email_errors = { 'required': u'Please enter a valid email, so we can contact you in case...
import warnings from . import Force from . import Potential from . import planarPotential from . import linearPotential from . import verticalPotential from . import MiyamotoNagaiPotential from . import IsochronePotential from . import LogarithmicHaloPotential from . import DoubleExponentialDiskPotential from . import ...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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 witho...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
"""The tests for the ASUSWRT device tracker platform.""" import os from datetime import timedelta import unittest from unittest import mock import voluptuous as vol from homeassistant.setup import setup_component from homeassistant.components import device_tracker from homeassistant.components.device_tracker import (...
from tests.testing_harness import PyAPITestHarness import openmc import numpy as np class HexLatticeOXTestHarness(PyAPITestHarness): def _build_inputs(self): materials = openmc.Materials() fuel_mat = openmc.Material(material_id=1, name="UO2") fuel_mat.set_density('sum') fuel_mat....
# # 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...
# -*- coding: utf-8 -*- u"""Auth database :copyright: Copyright (c) 2018-2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern.pkcollections import PKDict from pykern.pkdebug import pkdc, pkde...
from __future__ import absolute_import from __future__ import unicode_literals import json import logging import os import re import sys import six from docker.utils.ports import split_port from jsonschema import Draft4Validator from jsonschema import FormatChecker from jsonschema import RefResolver from jsonschema i...
# Copyright 2015-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
import numpy import scipy.stats import matplotlib.pylab as pt import statsmodels.api as sm #import scipy.optimize.minimize def narrow_sense_hsq(genotype_mat, phenotype_list): ##Calculates narrow-sense heritability for a given phenotype (length n_segs), with genotypes specified by genotype_mat (n_segs x n_loci). ##Th...
from scipy.interpolate import interp1d import time import numpy as np debug = False cols = np.array([(166,206,227),(31,120,180),(178,223,138),(51,160,44),(251,154,153),(227,26,28),(253,191,111),(255,127,0),(202,178,214),(106,61,154)], dtype=float)/255 def running_average(obs, ws): try: tmp_vals = np.convolve(np....
#!/usr/bin/env python # # Created by Samvel Khalatyan on Mar 15, 2014 # Copyright (c) 2014 Samvel Khalatyan. All rights reserved # # Use of this source code is governed by a license that can be found in # the LICENSE file. # # The code is tested under Python 3.3.5 # Doc: http://docs.python.org/3/library/threading.html ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache...
# Copyright 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 copy import logging import optparse import os import shlex import socket import sys from telemetry.core import browser_finder from telemetry.core imp...
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
import copy import unittest from unittest import mock from slack_backup import client from slack_backup import objects as o CHANNELS = {"ok": True, "channels": [{"id": "C00000000", "name": "somechannel", "is_channel": True, "cre...
# -*- coding: utf-8 -*- # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 __author__ = "Ole Christian Weidner" __copyright__ = "Copyright 2012, Ole Christian Weidner" __license__ = "MIT" import bliss.saga from bliss.saga.Object import Object from bliss.saga.Attributes import AttributeInterface class St...
""" Superfences. pymdownx.superfences Neseted Fenced Code Blocks This is a modification of the original Fenced Code Extension. Algorithm has been rewritten to allow for fenced blocks in blockquotes, lists, etc. And also , allow for special UML fences like 'flow' for flowcharts and `sequence` for sequence diagrams. ...
#!/usr/bin/env python3 # Copyright (c) 2014-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. """Test RPCs related to blockchainstate. Test the following RPCs: - getblockchaininfo - gettxouts...
from ConfigParser import ConfigParser from OpenGL.GLUT import * import multiprocessing as mp import hyped.rrt as rrt import data import graphics import input import random try: import hyped.interpreter as itp except ImportError: sys.path.append(os.path.dirname( os.path.dirname(os.path.abspath(__file__...
from allgo_utils import PCA9685,ultrasonic,ir_sens import wiringpi as wp import time DIR_DISTANCE_ALERT = 20 preMillis = 0 ULTRASONIC_TRIG = 3 # TRIG port is to use as output signal ULTRASONIC_ECHO = 23 # ECHO port is to use as input signal OUT = {'front_left_led':5, 'front_right_led':0, 'rear_right_le...
# 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...