gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- import sys, os, re # Check Sphinx version import sphinx if sphinx.__version__ < "1.1": raise RuntimeError("Sphinx 1.1 or newer required") needs_sphinx = '1.1' # ----------------------------------------------------------------------------- # General configuration # -----------------------...
""" Tests for finder. """ from django.template.response import TemplateResponse from django.test import RequestFactory from mock import Mock, patch from tests import case class FinderDecoratorTest(case.DBTestCase): """Tests for the finder view decorator.""" @property def finder(self): """The d...
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2013 Keita Kita # # 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...
''' Created on 2016/3/24 :author: hubo ''' from vlcp.config.config import defaultconfig import vlcp.service.kvdb.storage as storage import vlcp.service.kvdb.redisnotifier as redisnotifier from vlcp.server.module import depend, Module, call_api, api import vlcp.utils.dataobject as dataobj from vlcp.event.runnable impor...
from datetime import timedelta import pytest from django.urls import reverse from django.core.files.uploadedfile import SimpleUploadedFile from django.utils import timezone from conference.cfp import dump_relevant_talk_information_to_dict from conference.models import TALK_STATUS, TALK_LEVEL try: from pycon.sett...
#!/usr/bin/env python """Deform the lithosphere with 1D or 2D flexure. Landlab component that implements a 1 and 2D lithospheric flexure model. Examples -------- Create a grid on which we will run the flexure calculations. >>> from landlab import RasterModelGrid >>> from landlab.components.flexure import Flexure >>...
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints """ __author__ = 'stevenbarnhurst@gmail.com (Steven Barnhurst)' from datetime import datetime import endpoints from protorpc import messages from protorpc import message_types from protor...
""" General utilities. MIT license. Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com> """ from ..markdown.inlinepatterns import InlineProcessor import xml.etree.ElementTree as etree from collections import namedtuple import sys import copy import re import html.parser from urllib.request import pathname2url, url2pa...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'FamilleRatings' db.create_table(u'famille_familleratings'...
""" LambdaMART ---------- Applies a LambdaMART, a pairwise learning to rank technique, for recommending reviews. Usage: $ python -m algo.ltr.lambdamart [-l <learning_rate>] [-n <leaves>] [-t <trees>] [-f <feature_set>] [-b <bias>] where: <learning_rate> is a float which update st...
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/docco/examples.py import string testannotations=""" def annotations(canvas): from reportlab.lib.units import inch canvas.drawString(inch...
# The core functionalty of PyEphem lives in the C-language _libastro # module, which packages the astronomy routines from XEphem as # convenient Python types. import ephem._libastro as _libastro from math import pi __version__ = '3.7.6.0' twopi = pi * 2. halfpi = pi / 2. quarterpi = pi / 4. eighthpi = pi / 8. degre...
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
from __future__ import absolute_import import time import json import datetime from datetime import date from django.db import transaction from django.contrib.gis.geos import Point from celery import shared_task from onadata.apps.fieldsight.models import Organization, Project, Site, Region, SiteType from onadata.apps.u...
#!/usr/bin/env python import sys import json import shlex import subprocess from collections import MutableMapping, Mapping def check_output(*popenargs, **kwargs): """Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. ...
""" Run a Job """ import yaml import json import decimal import re import sys import time import commands import subprocess from log import log from error import Error import platform class InputNotCollectable(Exception): """Cannot collect all required input from available collection methods and inputs""" de...
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack Foundation # Copyright 2012 Grid Dynamics # Copyright 2013 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...
# Copyright 2017, David Wilson # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2....
# -*- coding: utf-8 -*- """ Test pylti/test_flask.py module """ from __future__ import absolute_import import unittest import httpretty import mock import oauthlib.oauth1 from six.moves.urllib.parse import urlencode from pylti.common import LTIException from pylti.flask import LTI from pylti.tests.test_flask_app imp...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Citrix Systems, 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/LICE...
#!/usr/bin/env python """VFS-related test classes.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import os import time from absl.testing import absltest from future.builtins import str from future.utils import iteritems import mock from typing impo...
# -*- coding: ascii -*- r""" :Copyright: Copyright 2006 - 2015 Andr\xe9 Malo or his licensors, as applicable :License: 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....
import unittest from pywin32_testutil import str2bytes, TestSkipped, testmain import win32api, win32file, win32pipe, pywintypes, winerror, win32event import win32con, ntsecuritycon import sys import os import tempfile import threading import time import shutil import socket import datetime import random import win32tim...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# -*- coding: utf-8 -*- """ Created on Thu Aug 24 17:35:00 2017 @author: eyt21 This module contains the live graph classes to the acquisition window. Attributes ---------- CHANLVL_FACTOR: float Not used TRACE_DECAY: float The decay factor of the peak plots TRACE_DURATION: float Duration before the peak p...
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
# sql/types_api.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 """Base types API. """ from .. import exc, util from . import operators from .vi...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """build query for doclistview and return results""" import frappe, json import frappe.defaults import frappe.permissions from frappe.utils import flt from frappe import _ cl...
# 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 ...
import slackclient import markovify import os import time import argparse import re import sys import json STATE_SIZE = 2 USER_ID_REGEX = r"\<\@(.+?)\>" global username projectname = "andrey3000" if os.name != "posix": import win32com from win32com.shell import shellcon, shell homedir = shell.SHGetFold...
# 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...
import code import sys import threading from kivy.uix.textinput import TextInput from kivy.uix.boxlayout import BoxLayout from kivy.base import runTouchApp from kivy.clock import Clock from kivy.properties import ObjectProperty, ListProperty,\ StringProperty, NumericProperty, partial from kivy.lang import Builder ...
from __future__ import print_function import caffe from caffe.model_libs import * from google.protobuf import text_format import math import os import shutil import stat import subprocess import sys # Add extra layers on top of a "base" network (e.g. VGGNet or Inception). def AddExtraLayers(net, use_batchnorm=True, l...
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project from __future__ import print_function from rez.resolved_context import ResolvedContext from rez.utils.colorize import heading, local, critical, Printer from rez.utils.data_utils import cached_property from rez.utils.formatting import c...
# coding=utf-8 # Copyright 2014 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 logging impor...
""" Support for interacting with Spotify Connect. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.spotify/ """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.http import HomeAssistantVie...
# Copyright 2015: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
'''Lightweight declarative YAML and XML data binding for Python.''' import yaml try: from yaml import CSafeLoader as SafeLoader, CSafeDumper as SafeDumper except: from yaml import SafeLoader, SafeDumper import datetime import calendar import re import sys import time import math import types import platform f...
# Generated by Haxe 3.3.0 import math as python_lib_Math import math as Math import pandas as pandas_Pandas_Module import functools as python_lib_Functools import inspect as python_lib_Inspect import random as python_lib_Random class _hx_AnonObject: def __init__(self, fields): self.__dict__ = fields cl...
"""Tests for media.views.""" # pylint: disable=protected-access,maybe-no-member,invalid-name import json from django.conf import settings from django.core.urlresolvers import reverse from django.test import Client, TestCase, RequestFactory from django.test.utils import override_settings from mock import patch from op...
# Copyright 2014 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. from page_sets import press_story from telemetry import story class WebrtcPage(press_story.PressStory): def __init__(self, url, page_set, name, tags, ex...
from itertools import tee, chain, combinations from collections import defaultdict from pgmpy.factors import Factor from pgmpy.factors.Factor import factor_product from pgmpy.inference import Inference, BeliefPropagation class DBNInference(Inference): def __init__(self, model): """ Class for perf...
#coding: utf-8 from __future__ import print_function, division from argparse import ArgumentParser import math import sys import time import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import utils import numpy as np import cPickle import chainer from chainer import cuda import ch...
from sqlalchemy import Column from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import Table from sqlalchemy import util from sqlalchemy.ext.hybrid import hybrid_method from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import aliased from s...
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing the various stages that a builder runs.""" from __future__ import print_function import json import os from chromite.cbuildbot...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
"""GTFS Feed Reader.""" import csv import zipfile import collections import json import os import tempfile import glob import subprocess import csv try: import unicodecsv except ImportError: unicodecsv = None import util import entities import validation class Feed(object): """Read a GTFS feed.""" # Classes...
# 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 ...
import datetime from collections import OrderedDict from django.conf import settings from django_remote_forms import logger, widgets class RemoteField(object): """ A base object for being able to return a Django Form Field as a Python dictionary. This object also takes into account if there is ini...
# 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 ag...
# Copyright 2014-2016 Presslabs SRL # # 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...
"""Create web2py model (python code) to represent MS SQL Server tables. Features: * Uses ANSI Standard INFORMATION_SCHEMA (might work with other RDBMS) * Detects legacy "keyed" tables (not having an "id" PK) * Handles 'funny' column names. web2py requires all column names be valid python identifiers. This script uses r...
# Python imports import base64 import json # 3rd party imports from django.db import connection from django.test import TestCase # Project imports from register.models import RegistrationCenter from register.tests.factories import RegistrationFactory from reporting_api import create_test_data, reports, tasks, views f...
import math import numpy import six import chainer from chainer import backend from chainer.backends import cuda from chainer.backends import intel64 from chainer import function_node import chainer.functions from chainer.functions.math import floor as _floor from chainer import utils from chainer.utils import type_c...
"""Dependency Resolution The dependency resolution in pip is performed as follows: for top-level requirements: a. only one spec allowed per project, regardless of conflicts or not. otherwise a "double requirement" exception is raised b. they override sub-dependency requirements. for sub-dependencies ...
# -*- coding: utf-8 -*- """ The idea of MultilingualManager is taken from django-linguo by Zach Mathew https://github.com/zmathew/django-linguo """ from django.db import models from django.db.models import FieldDoesNotExist from django.db.models.fields.related import RelatedField, RelatedObject from django.db.models.s...
from model.address import Adress import re class Address: def __init__(self, app): self.app = app def create_new_address(self, address): wd = self.app.wd # open home page self.app.open_home_page_address() # add_new_address wd.find_element_by_link_text("add ne...
# 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...
# Generated from left.g4 by ANTLR 4.5.1 # encoding: utf-8 from antlr4 import * from io import StringIO def serializedATN(): with StringIO() as buf: buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\35") buf.write("\u00b1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.wr...
import numpy as np from typing import Any, List, Tuple from ray.rllib.models.torch.misc import Reshape from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.utils.framework import try_import_torch from ray.rllib.utils.framework import TensorType torch, nn = try_import_torch() if torch: from ...
# -*- coding: utf-8 -*- """ Disaster Victim Identification, Controllers """ if not settings.has_module(c): raise HTTP(404, body="Module disabled: %s" % c) # ----------------------------------------------------------------------------- def s3_menu_postp(): # @todo: rewrite this for new framework menu_sele...
"""Support for ISY994 binary sensors.""" from __future__ import annotations from datetime import timedelta from pyisy.constants import ( CMD_OFF, CMD_ON, ISY_VALUE_UNKNOWN, PROTO_INSTEON, PROTO_ZWAVE, ) from pyisy.nodes import Group, Node from homeassistant.components.binary_sensor import ( D...
# Copyright 2016 NEC 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 # # Unless required ...
"""The exceptions used by Home Assistant.""" from __future__ import annotations from collections.abc import Generator, Sequence from typing import TYPE_CHECKING import attr if TYPE_CHECKING: from .core import Context # mypy: disallow-any-generics class HomeAssistantError(Exception): """General Home Assist...
from __future__ import unicode_literals import time import hmac import hashlib import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse, ) from ..utils import ( int_or_none, float_or_none, sanitized_Request, xpath_text, ExtractorError, ) class At...
from flask import json from nose.tools import assert_equal, assert_in from app import db from app.models import Supplier, ContactInformation, AuditEvent, \ SelectionAnswers, Framework from ..helpers import BaseApplicationTest, JSONUpdateTestMixin class TestGetSupplier(BaseApplicationTest): def setup(self): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2014, Nigel Small # # 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...
""" Filename: lqcontrol.py Authors: Thomas J. Sargent, John Stachurski Provides a class called LQ for solving linear quadratic control problems. """ from textwrap import dedent import numpy as np from numpy import dot from scipy.linalg import solve from .matrix_eqn import solve_discrete_riccati class LQ(object): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import sys import csv import requests import datetime AUTH = (os.environ.get("DCC_API_KEY"), os.environ.get("DCC_SECRET_KEY")) BASE_URL = 'https://www.encodeproject.org/{}/?format=json' ENCODE4_DNASE_PIPELINES = ['/pipelines/ENCPL848KLD/'] PREFER...
#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 required by applicable law or agr...
import os import re import random import string import subprocess import warnings import logging from tempfile import mkdtemp from datetime import datetime from functools import reduce try: from urllib import urlencode except ImportError: from urllib.parse import urlencode from hetzner import RobotError, Web...
# # aac_map.py, doom-net # # Created by Andrey Kolishchak on 01/21/17. # import torch import torch.nn as nn import torch.nn.functional as F from device import device from collections import namedtuple from aac_base import AACBase import random class ResidualBlock(nn.Module): def __init__(self, in_channels, out_ch...
#pylint: disable=W0703,R0915,R0912,R0914,R0904,W0223,W0105 """ Base class for package download and manifest create operations """ import pylons import os import time from agent.lib.errors import Errors, AgentException from agent.lib.utils import calcProgress, rchown, rchmod, isHigherPrivilegeService, \ chmod, getu...
from Tkinter import * import ttk, tkFont, tkMessageBox import itertools import datetime from Connect_Brisco_DB import Connect_DB from DB_searchandFill import DB_search from psycopg2 import sql import serial from psycopg2.extensions import AsIs class GUIatFrontDesk: def __init__(self,master): from PIL imp...
# Python import operator import datetime import random import time # Django from django.shortcuts import render_to_response, get_object_or_404, HttpResponse, HttpResponseRedirect, Http404 from django.http import HttpResponse, Http404 from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from ...
import logging import datetime import os import pytest import mongomock from mock import Mock from bripipetools import model as docs from bripipetools import database logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) def test_database_connection(): # TODO: come up with a better way ...
import gzip import os import pathlib import sys from functools import partial from time import sleep import cloudpickle import pytest from fsspec.compression import compr from fsspec.core import open_files from fsspec.implementations.local import LocalFileSystem from packaging.version import parse as parse_version fro...
import pytest import numpy as np import numpy.ma as ma from numpy.ma.mrecords import MaskedRecords from numpy.ma.testutils import assert_equal from numpy.testing import assert_, assert_raises from numpy.lib.recfunctions import ( drop_fields, rename_fields, get_fieldstructure, recursive_fill_fields, find_duplic...
#!/usr/bin/env python import operator import abc class Expression(object): __metaclass__ = abc.ABCMeta def __init__(self): pass @abc.abstractmethod def get_value(self): pass @abc.abstractmethod def __str__(self): pass @abc.abstractmethod def copy(self): ...
import collections import glob import os import pickle from typing import Dict, Iterator, List, NamedTuple, Tuple import cv2 import numpy as np from data import data from data.image import component from puzzle.problems.image import image_problem from puzzle.puzzlepedia import prod_config prod_config.init() _CLASS...
# Dynamic Mode Decomposition based on http://arxiv.org/pdf/1312.0041v1.pdf import numpy as np import pandas as pd from sklearn.preprocessing import normalize from bacteriopop_utils import prepare_DMD_matrices def find_fixed_adjacency_matrix(min_abundance=0.0, phylo_column='order', ful...
"""Terminal reporting of the full testing process. This is a good source for looking at the various reporting hooks. """ import argparse import datetime import inspect import platform import sys import warnings from collections import Counter from functools import partial from pathlib import Path from typing import An...
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
from ply.lex import TOKEN, lex # token with reserved words and sign alternative t_OR = r"\|\|" t_AND = r"&&" # tokens without reserved words, only signs t_GEQ = r">=" t_LEQ = r"<=" t_NEQ = r"!=" t_EQ = r"==" # line 331 t_LSH = r"<<" t_RSH = r">>" # line XXX literals = ["+", "-", "*", "/", ":", "[", "]", ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-05 20:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Catego...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright 2015 Conchylicultor. All Rights Reserved. # Modifications copyright (C) 2016 Carlos Segura # # 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/L...
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # # 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 ANS...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import argparse import ConfigParser import logging import math import itertools from api_utils import TokensAPI, SimilarityAPI class ComputeSimilarity( object ): """ Similarity measures. Compute term similarity based on co-occurrence and collocation like...
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
"""Tests for the TP-Link component.""" from typing import Any, Dict from unittest.mock import MagicMock, patch from pyHS100 import SmartBulb, SmartDevice, SmartDeviceException, SmartPlug import pytest from homeassistant import config_entries, data_entry_flow from homeassistant.components import tplink from homeassist...
itera=input("How many results do you want? \n") for iteracje in range(0,itera): #************************************************************************************************** #Program description * #Simulation of chromosome te...
# -*- coding: iso-8859-1 -*- # """ """ #Create a Python couchdb attachment: #curl -H "Content-Type: application/python" -X PUT --data-binary "@-" http://server:5984/test1/$docid/attachment?rev=$rev < spam.rsheet #Note: attachments must always be on a doc, and rev is mandatory. #See: http://wiki.apache.org/couchdb/HT...
""" inertia.py ------------- Functions for dealing with inertia tensors. Results validated against known geometries and checked for internal consistency. """ import numpy as np from trimesh import util def cylinder_inertia(mass, radius, height, transform=None): """ Return the inertia tensor of a cylinder....
''' Created on 03 Aug 2017 @author: ernesto ''' import os import subprocess import gzip import re from collections import namedtuple from Utils.RunProgram import RunProgram class VcfUtils(object): """ Class to represent a misc of actions that can be done on a single or multiple VCF files """ def __in...
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
#!/usr/bin/env python # -*- coding: utf-8 -*- # type: ignore # Compiled with Coconut version 1.2.3-post_dev1 [Colonel] """Built-in Coconut utilities.""" # Coconut Header: -------------------------------------------------------- from __future__ import print_function, absolute_import, unicode_literals, division impor...
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import re import pkg_resources import os import logging import struct import json try: import hashlib md5 = hashlib.md5 except ImportError: # for Python << 2.5 import md5 md5 = md5.new # import codecs import numpy as np from numpy i...
#!/usr/bin/env python3 # Copyright 2021 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 applic...