gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2013-2021 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
#!/usr/bin/env python3 import unittest import numpy as np from typing import Optional from panda import Panda from panda.tests.safety import libpandasafety_py import panda.tests.safety.common as common from panda.tests.safety.common import CANPackerPanda, make_msg, MAX_WRONG_COUNTERS, UNSAFE_MODE class Btn: CANCEL ...
#!/usr/bin/env python import roslib roslib.load_manifest('crazyflie_control') import rospy import sys from geometry_msgs.msg import Vector3 from nav_msgs.msg import Odometry from crazyflie_driver.msg import RPYT import dynamic_reconfigure.server from crazyflie_control.cfg import CrazyflieControlConfig from math imp...
# Copyright (c) 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from hwt.code import If from hwt.interfaces.std import HandshakeSync, VectSignal from hwt.interfaces.utils import addClkRstn, propagateClkRstn from hwt.synthesizer.param import Param from hwtLib.abstract.busBridge import BusBridge from hwtLib.amba.axi4 import Axi4, Axi4_a...
# Copyright (c) 2018 PaddlePaddle 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 app...
from datetime import date from itertools import accumulate from calendar import monthrange from collections import Counter from kconfig import enablersBook, toolsBook from kconfig import chaptersBook from kernel.Backlog import Backlog, Issue from kernel.IssuesModel import backlogIssuesModel from kernel import calendar...
# 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 argparse import json import datetime import os import pickle import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from tensorflow.python.framework.ops import disable_eager_execution #from tensorflow.python import keras import keras #from donkeycar.parts.keras import KerasVAE #from vae_mode...
# Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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.apach...
import re from collections import Counter, defaultdict from datetime import datetime from hamper.interfaces import ChatCommandPlugin, Command from hamper.utils import ude, uen import pytz from pytz import timezone from pytz.exceptions import UnknownTimeZoneError from sqlalchemy import Column, DateTime, Integer, Stri...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) # from builtins import (bytes, dict, int, list, object, range, str, ascii, chr, hex, input, next, oct, open, pow, round, super, filter, map, zip...
import sqlite3 import datetime import calendar import time import threading import subprocess import re import sys import time class SensorStore: def __init__(self): # reentrant lock used for all sqlite3 operations self.lock = threading.RLock() def __acquire_lock(self): self.l...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
#!/usr/bin/env python3 # Copyright (c) 2015 The Presidentielcoin 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 * f...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import warnings import numpy as np from sklearn.neighbors import NearestNeighbors from sklearn.utils import check_array, check_random_state from collections import Counte...
# -*- coding: utf-8 -*- #/usr/bin/python2 ''' June 2017 by kyubyong park. kbpark.linguist@gmail.com. https://www.github.com/kyubyong/transformer ''' from __future__ import print_function import tensorflow as tf def normalize(inputs, epsilon = 1e-8, scope="ln", reuse=None): ...
try: from pyb import CAN except ImportError: print("SKIP") raise SystemExit from uarray import array import micropython import pyb # test we can correctly create by id (2 handled in can2.py test) for bus in (-1, 0, 1, 3): try: CAN(bus, CAN.LOOPBACK) print("CAN", bus) except ValueEr...
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of ...
#!/usr/bin/env python '''====================================================== Created by: D. Spencer Maughan Last updated: February 2015 File name: DF_experiment_joy.py Organization: RISC Lab, Utah State University Notes: This file is meant to allow use of the joystick to tog...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Contributing: 1. Add the .csv file 2. Run import 3. Then run translate """ # loading # doctype, page, report # boot(startup) # frappe.require # frappe._ import frappe, o...
''' Created on Jun 10, 2015 @author: mzwier ''' import logging log = logging.getLogger(__name__) from .core import ZMQCore, Message, Task, Result, ZMQWorkerMissing, ZMQWMEnvironmentError, IsNode from .core import randport from .worker import ZMQWorker from .node import ZMQNode import work_managers from work_managers...
#!/usr/bin/env python # # Project: # glideinWMS # # File Version: # # Description: # This is the main of the glideinFrontend # # Arguments: # $1 = parent PID # $2 = work dir # $3 = group_name # # Author: # Igor Sfiligoi (was glideinFrontend.py until Nov 21, 2008) # import signal import sys import os impor...
__author__ = 'henningo' from ..tiremodelbase import TireModelBase from ..solvermode import SolverMode import math import numpy as np from opentire.TireModel.PAC2002.PAC2002_Core import PAC2002_Core class PAC2002(TireModelBase): def createmodel(self): self.ModelInfo = dict() self.Coefficients = dic...
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
# 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...
import datetime import json import logging import urllib from jinja2 import Environment from jinja2 import PackageLoader from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Content from sendgrid.helpers.mail import Email from sendgrid.helpers.mail import Mail from sendgrid.helpers.mail import To f...
from twisted.internet.protocol import Protocol, Factory, ClientFactory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor, error import json import base64 from database import * from packettypes import * from datahandler import * from utils.utils import * from gui.dialogs import ale...
'''blox/base.py The base for all blox Copyright (C) 2015 Timothy Edmund Crosley 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...
""" """ # Standard library modules. import unittest import logging import datetime # Third party modules. # Local modules. from pyhmsa.util.parameter import \ (Parameter, _Attribute, FrozenAttribute, NumericalAttribute, TextAttribute, AtomicNumberAttribute, UnitAttribute, XRayLineAttribute, ObjectAttribute,...
from netaddr import IPNetwork from rest_framework import status from rest_framework.test import APITestCase from django.contrib.auth.models import User from django.urls import reverse from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site from ipam.models import ( Aggregate, IPAddress, IP_PRO...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2011 Ken Pepple # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
''' .. _simple_netem_daemon: serve_pyro4r module for the simple_netem package :module: daemon :copyright: Copyright 2017 Serban Teodorescu 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 th...
"""Support for August devices.""" import asyncio import itertools import logging from aiohttp import ClientError from august.authenticator import ValidationResult from august.exceptions import AugustApiAIOHTTPError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homea...
""" pocket.py PocketWorld and PocketChunksFile for reading saved files from Minecraft Pocket Edition. Currently, only Block editing is supported. Little-endian NBT support is needed before Entity and Player editing is possible. """ from __future__ import absolute_import import logging import os im...
# Copyright 2021 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...
# -*- coding: utf-8 -*- # # Copyright 2012-2020 BigML # # 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 ...
from rathings.phase_unwrap import phase_unwrapp1d import numpy as np from scipy.optimize import least_squares TECU = 1e16 def calc_phase(tec, freqs, cs = 0.): '''Return the phase (num_freqs, num_times) from tec and CS. `tec` : `numpy.ndarray` tec in TECU of shape (num_times,) `freqs` : `numpy.nd...
'''tzinfo timezone information for Europe/Tirane.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Tirane(DstTzInfo): '''Europe/Tirane timezone definition. See datetime.tzinfo for details''' zone = 'Europe/Tirane' _ut...
""" Profiling hooks This module contains a couple of decorators (`profile` and `coverage`) that can be used to wrap functions and/or methods to produce profiles and line coverage reports. There's a third convenient decorator (`timecall`) that measures the duration of function execution without the extra profiling ove...
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import matplotlib.cbook as cbook import matplotlib.axes as maxes #import matplotlib.colorbar as mcolorbar from . import colorbar as mcolorbar import matplotlib as mpl impo...
# 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 # distrib...
# lrucache.py -- a simple LRU (Least-Recently-Used) cache class # Copyright 2004 Evan Prodromou <evan@bad.dynu.ca> # Licensed under the Academic Free License 2.1 # arch-tag: LRU cache main module """a simple LRU (Least-Recently-Used) cache module This module provides very simple LRU (Least-Recently-Used) cache func...
"""This module contains client that wrap requests and response to Knoema API""" import json import urllib.parse import urllib.request import time import datetime import hmac import base64 import hashlib import random import string import io import os import knoema.api_definitions as definition import knoema.api_defini...
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
from datetime import datetime import hashlib from werkzeug.security import generate_password_hash, check_password_hash from flask_login import UserMixin, AnonymousUserMixin from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask import current_app, request from . import db, login_manager cla...
import numpy as np import scipy as sp import scipy.linalg as LA from .covar_base import Covariance from limix.hcache import cached import pdb import logging as LG class FreeFormCov(Covariance): """ General semi-definite positive matrix with no contraints. A free-form covariance matrix of dimension d has 1...
from itertools import count from math import ceil, sqrt from functools import wraps import bisect import os from toolz import (merge, partial, accumulate, unique, first, dissoc, valmap, first, partition) from operator import getitem, setitem import pandas as pd import numpy as np import operator import gzip imp...
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
import numpy as n, calendar, datetime def circularStatistics(population, period): pop=n.array(population) pop_=pop*2*n.pi/period j=n.complex(0,1) vec_n=n.e**(j*pop_) mean_vec=vec_n.sum()/len(vec_n) # first moment mean_angle=n.arctan2(mean_vec.real,mean_vec.imag) size_mean_vec=n.abs(mean_vec...
from __future__ import absolute_import, division, print_function import sys import platform import _pytest._code import pytest def runpdb_and_get_report(testdir, source): p = testdir.makepyfile(source) result = testdir.runpytest_inprocess("--pdb", p) reports = result.reprec.getreports("pytest_runtest_log...
from copy import deepcopy from datetime import date, datetime, timedelta import pytz from mock import patch from werkzeug.exceptions import InternalServerError from rdr_service import config from rdr_service.api_util import HEALTHPRO, PTC from rdr_service.dao import database_factory from rdr_service.dao.deceased_repor...
""" Parser for TOPOLOGY.xml ---------------------------- PDB2PQR -- An automated pipeline for the setup, execution, and analysis of Poisson-Boltzmann electrostatics calculations Copyright (c) 2002-2010, Jens Erik Nielsen, University College Dublin; Nathan A. Baker, Washington University in St. ...
# Django settings for webapp project. import os.path PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG SERVE_MEDIA = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ('Jeffrey', 'golettoo@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { ...
"""This component provides basic support for Foscam IP cameras.""" import asyncio from libpyfoscam import FoscamCamera import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, SUPPORT_STREAM, Camera from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( ...
from collections import namedtuple import cx_Oracle from django.db import models from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo, ) from django.utils.functional import cached_property FieldInfo = namedtuple('FieldInfo', BaseFieldInfo._fields + ...
import os from unittest import skip from django.core.files.base import ContentFile from django.core.urlresolvers import reverse from onadata.apps.main.views import show, form_photos, update_xform, profile,\ enketo_preview from onadata.apps.logger.models import XForm from onadata.apps.logger.views import download_...
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ ============================================= fMRI: OpenfMRI.org data, FSL, ANTS, c3daffine ============================================= A growing number of datasets are availabl...
import asyncio import datetime import discord import dateutil.parser from .. import utils, errors, cmd from ..servermodule import ServerModule from ..enums import PrivilegeLevel class Voting(ServerModule): MODULE_NAME = "Voting" MODULE_SHORT_DESCRIPTION = "Facilities for simple votes/polls." RECOMMENDED_CM...
# Copyright 2017 New Vector Ltd # Copyright 2019 Matrix.org Foundation C.I.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 req...
""" desispec.io.meta ================ IO metadata functions. """ import os import os.path import datetime import glob import re def findfile(filetype, night=None, expid=None, camera=None, brickname=None, band=None, spectrograph=None, rawdata_dir=None, specprod_dir=None, download=False, outdir=None): """...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
from peewee import * from playhouse.fields import ManyToManyField from playhouse.tests.base import database_initializer from playhouse.tests.base import ModelTestCase db = database_initializer.get_in_memory_database() class BaseModel(Model): class Meta: database = db class User(BaseModel): username ...
# Copyright 2020 The TensorFlow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
import os,sys,math,pickle import random as lrand import rpy2.robjects as robjects import argparse import numpy #import svmutil def init(): lrand.seed(1982) robjects.r('library(splines)') robjects.r('library(stats4)') robjects.r('library(survival)') robjects.r('library(mvtnorm)') robjects.r('library(modeltools)'...
"""Plugin common functions.""" import os import re import shutil import tempfile import OpenSSL import pkg_resources import zope.interface from acme.jose import util as jose_util from certbot import constants from certbot import interfaces from certbot import util def option_namespace(name): """ArgumentParser ...
# Copyright (c) 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2022 F4PGA 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 # # Unl...
import copy import unittest import numpy import pytest from cupy_backends.cuda import stream as stream_module import cupy from cupy import _util from cupy import _core from cupy import cuda from cupy import get_array_module from cupy import testing def wrap_take(array, *args, **kwargs): if get_array_module(arra...
# encoding: utf-8 """ Test suite for the docx.table module """ from __future__ import absolute_import, print_function, unicode_literals import pytest from docx.enum.table import WD_TABLE_ALIGNMENT from docx.oxml import parse_xml from docx.oxml.table import CT_Tc from docx.shared import Inches from docx.table import...
# 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 Li...
""" This module implements a parser for language tags, according to the RFC 5646 (BCP 47) standard. Here, we're only concerned with the syntax of the language tag. Looking up what they actually mean in a data file is a separate step. For a full description of the syntax of a language tag, see page 3 of http://too...
#!/usr/bin/env python from __future__ import print_function import os import sys import logging import argparse import platform import subprocess os.environ["PYTHONUNBUFFERED"] = "y" PY2 = sys.version_info[0] == 2 ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(ZULIP_PATH) f...
# 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 agreed to in...
"""Views from ecommerce""" import logging import traceback from urllib.parse import urljoin from django.conf import settings from django.db import transaction from django.http.response import Http404 from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from django.views.d...
import pytest import demistomock as demisto from CommonServerPython import formatEpochDate SERVER_URL = "https://1.2.3.4" @pytest.fixture(autouse=True) def get_params(requests_mock, mocker): mocker.patch.object( demisto, "params", return_value={ "server": SERVER_URL, ...
import gzip import os import shutil import sys import warnings from ..extern.six import print_, string_types from ..file import _File from ..util import (_is_int, _tmp_name, _pad_length, ignore_sigint, _get_array_mmap, indent, fileobj_closed, PyfitsDeprecationWarning) from ..ver...
# Copyright (c) 2014 Baidu.com, 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 o...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ------...
"""Support for Huawei LTE routers.""" from __future__ import annotations from collections import defaultdict from collections.abc import Callable from contextlib import suppress from datetime import timedelta import logging import time from typing import Any, cast import attr from huawei_lte_api.AuthorizedConnection ...
from __future__ import unicode_literals import json from django.contrib import admin from django.conf.urls import patterns, url from django.core import urlresolvers from django.template.defaultfilters import capfirst from django.utils.translation import ugettext, ugettext_lazy as _ # from vesper.apps import site #...
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from numpy import abs, sum, sin, cos, asarray, arange, pi, exp, log, sqrt from scipy.optimize import rosen from .go_benchmark import Benchmark class Rana(Benchmark): r""" Rana objective function. This class defines...
# 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/python import pprint MLAB_ORG_DOMAIN = 'measurement-lab.org' def breakdown(host_index, v4prefix): octet_list = v4prefix.split('.') assert(len(octet_list) == 4) net_prefix = ".".join(octet_list[0:3]) net_offset = int(octet_list[3]) mlab_offset = net_offset + ((host_index - 1) * 13) + 9...
from bika.lims.browser import BrowserView from bika.lims.interfaces import IAnalysis from bika.lims.interfaces import IFieldIcons from bika.lims import bikaMessageFactory as _ from bika.lims.utils import t, isnumber from bika.lims import logger from bika.lims.utils import to_utf8 from Products.Archetypes.config import ...
# # 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 n...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ %prog demo Illustrate three different types of alignments. - Pairwise sequence alignment, aka, "dot plot" - Read alignment, similar to the visualization of a BAM file - Optical map alignment, matchings between restriction fragments """ import sys from bisect import...
import sys import socket import select import threading import struct import time class S5Req: def __init__(self,buf): self.ver, self.cmd, self.rsv, self.atyp = struct.unpack("BBBB", buf[0:4]) self.dst_addr = None self.dst_port = None def parse_port(self,buf): if len(buf) < 2: retu...
from ConfigParser import SafeConfigParser import json from feedgen.feed import FeedGenerator from bs4 import BeautifulSoup import threading import operator import datetime import requests import pickle import pytz import time import os # Initialize conf cust_path = os.path.dirname(os.path.realpath(__file__)) parser =...
""" Contains a CLICommand that implements ping test functionality. Uses the following from :py:class:`swiftly.cli.context.CLIContext`: =============== ==================================================== client_manager For connecting to Swift. concurrency The number of concurrent actions that can be ...
# Copyright (c) 2015-2020 Cloudify Platform Ltd. 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...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# -*- coding: utf-8 -*- import argparse import logging import csv import os import random import six import sys this_dir = os.path.realpath(os.path.dirname(__file__)) sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir))) from geodata.address_expansions.abbreviations import abbreviate from geodata.add...
# -*- coding: utf-8 -*- """ .. _tut-events-vs-annotations: Parsing events from raw data ============================ This tutorial describes how to read experimental events from raw recordings, and how to convert between the two different representations of events within MNE-Python (Events arrays and Annotations obje...
# 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...
###################################################################################### # Date: 2016/June/03 # # Module: manager_color.py # # VERSION: 1.0 # # AUTHOR: Miguel Ibarra (miguelib@ufl.edu) ed. Matt Thoburn (mthoburn@ufl.edu) # # DESCRIPTION: This module a class to manage color for use in plotting # #######...
from __future__ import unicode_literals import datetime from xml.dom import minidom try: import pytz except ImportError: pytz = None from django.contrib.syndication import views from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.utils.feedgenerator import rfc...
import random from monkeygod import models def test_avatar(session): """Gravatar URL should be generated""" m1 = models.Monkey( name='monkey1', age=10, email='monkey1@example.com' ) session.add(m1) session.commit() avatar = m1.avatar(128) expected = ( 'http:...
import threading import Queue import logging WAIT_QUEUE_TIMEOUT = 2 # in seconds class WikipediaPreProcessor(threading.Thread): '''The WikipediaPreProcessor class preprocesses text and removes tags, unnecessary links and other information and keeps the text only ''' '''constructor @param i...