gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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... | |
##### Versions of key Torps functions to implement congestion-aware Tor #####
# Re-implemented functions:
# - create_circuit():
# "Builds" k=3 circuits, measures congestion with m=5 circuit pings, and
# chooses the best one. Also makes m additional pings and stores average.
# - client_assign_stream():
# ... | |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from rest_framework import serializers
from django.core.exceptions import FieldError
from pdc.apps.common.fields import ChoiceSlugField
from pdc.apps.common import models as common_models
from pdc.apps.common.s... | |
"""Common functionality."""
import os.path
import tempfile
import shutil
import sys
import six
from nose2.compat import unittest
from nose2 import discover, util
HERE = os.path.abspath(os.path.dirname(__file__))
SUPPORT = os.path.join(HERE, 'functional', 'support')
class TestCase(unittest.TestCase):
"""TestC... | |
from __future__ import unicode_literals
from tests.utils import ConverterTestCase
class TypeReferencingCases:
#######################################################################
# This base class defined a spanning set of type referencing cases.
# By subclassing and providing a template, a wide range... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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 t... | |
# ##HPanda3D
# ##HGameObject
from direct.actor.Actor import Actor
from HUtils import *
from panda3d.bullet import BulletCharacterControllerNode, BulletRigidBodyNode, BulletGhostNode
from panda3d.bullet import BulletClosestHitSweepResult
from panda3d.core import TransformState, BitMask32, VBase3, Point3, Vec3, NodePat... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
import os
import time
from datetime import datetime
import threading
import sqlite3 as lite
from kervi.core.utility.thread import KerviThread
from kervi.plugin.storage.storage_plugin import StoragePlugin
_DB_CREATE_SQL = """
CREATE TABLE `log` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
... | |
"""Simple implementation of the RSA cryptosystem.
This module is meant to show a simple and clear implementation of the
RSA algorithm: http://en.wikipedia.org/wiki/RSA_(cryptosystem). It is meant
to be readable, not fast.
The usage is simple. First, create a random key pair:
>>> public_key, private_key = make_ke... | |
import os
import dill
import matplotlib.ticker as ticker
import numpy as np
import pySDC.helpers.plot_helper as plt_helper
from pySDC.helpers.stats_helper import filter_stats, sort_stats
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right
from pySDC.implementations.controller_... | |
#!/usr/bin/env python
# encoding: utf-8
'''
Created by Brian Cherinka on 2016-03-28 23:30:14
Licensed under a 3-clause BSD license.
Revision History:
Initial Version: 2016-03-28 23:30:14 by Brian Cherinka
Last Modified On: 2016-03-28 23:30:14 by Brian
'''
from __future__ import print_function, division
from ... | |
# -*- coding: utf-8 -*-
import os
import shutil
import unittest
import bpy
from math import pi
from mathutils import Euler
from mathutils import Vector
from mmd_tools.core import pmx
from mmd_tools.core.model import Model
from mmd_tools.core.pmd.importer import import_pmd_to_pmx
from mmd_tools.core.pmx.importer impo... | |
# Copyright 2011 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 l... | |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | |
'''User API unittest'''
import tests
import model.user
from unittest import TestCase
class TestRegister(TestCase):
'''Register unittest.'''
@tests.async_test
async def test_register(self):
'''Test register.'''
response = await tests.request('/user/register', {
'mail': 'text... | |
# JoinRefseqMouseGeneSymbol/JoinRefseqMouseGeneSymbol.py - a self annotated version of rgToolFactory.py generated by running rgToolFactory.py
# to make a new Galaxy tool called JoinRefseqMouseGeneSymbol
# User mika.yoshimura@riken.jp at 02/02/2015 15:15:09
# rgToolFactory.py
# see https://bitbucket.org/fubar/galaxytool... | |
# Portions Copyright (c) 2008-2009 Nokia Corporation
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, mac, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, ntpath, or macpath
- os.name is 'posix', 'nt', 'os2', 'ma... | |
from dectate.app import App, directive
from dectate.config import commit, Action, Composite
from dectate.error import ConflictError, ConfigError
import pytest
def test_simple():
class MyDirective(Action):
config = {"my": list}
def __init__(self, message):
self.message = message
... | |
#!/usr/bin/python
#----------------------------------------------------------------------
# Copyright (c) 2013-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... | |
# Copyright 2013-2016 DataStax, 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 writi... | |
#! /usr/bin/python2
#
# Copyright 2016 the V8 project 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 argparse
import collections
import re
import subprocess
import sys
__DESCRIPTION = """
Processes a perf.data sample file a... | |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | |
# 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 os
import shutil
import time
from loguru import logger
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.utils.pathscrub import pathscrub
from flexget.utils.template import RenderError
def get_directory_size(directory):
"""
:param di... | |
# -*- coding: utf-8 -*-
""" This module contains classes:
HostsEntry:
A representation of a hosts file entry, i.e. a line containing an IP address
and name(s), a comment, or a blank line/line separator.
Hosts:
A representation of a hosts file, e.g. /etc/hosts and
c:\\\\windows\\\\system32\\\\drivers\\\\etc\\\\hosts fo... | |
from typing import Optional, Dict
import abc
import os
import subprocess as sp
import uuid
import time
import copy
from shlex import quote as shq
import webbrowser
import warnings
from hailtop.config import get_deploy_config, get_user_config
import hailtop.batch_client.client as bc
from hailtop.batch_client.client imp... | |
# -*- encoding: utf-8 -*
import json
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ValidationError
from django.core.mail import send_mail
from django.c... | |
#!/usr/bin/env python
import os
import shutil
import fnmatch
import json
import re
from optparse import OptionParser
import logging
section_line = re.compile('\[(?P<section>.*)\]')
import_line = re.compile('@import url\((?P<filename>.*)\)')
property_line = re.compile('(?P<id>.*)\s*[:=]\s*(?P<value>.*)')
def _get_loc... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 13:58:50 2015
@author: ktritz
"""
from __future__ import print_function
from builtins import str
from builtins import zip
from builtins import object
import os
import inspect
import types
import numpy as np
import xml.etree.ElementTree as ET
# import kernprof
from . ... | |
#
# 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... | |
"""
Submlime Text Package File Search.
Licensed under MIT
Copyright (c) 2012 Isaac Muse <isaacmuse@gmail.com>
"""
import sublime
import re
from os import walk, listdir
from os.path import basename, dirname, isdir, join, normpath, splitext, exists
from fnmatch import fnmatch
import zipfile
__all__ = (
"sublime_pac... | |
from __future__ import absolute_import
__author__ = 'chris'
import json
import errno
import os
import re
import sys
import six
import uuid
import traceback
from operator import itemgetter
from collections import OrderedDict, defaultdict
from pkg_resources import parse_version
from django.conf import settings
from djan... | |
# -*- coding: utf-8 -*-
import sys
exceptions = None
if sys.version_info[0] >= 3:
exceptions = (ImportError, ModuleNotFoundError)
else:
exceptions = ImportError
try:
# for Fusion 6 and 7
import PeyeonScript as bmf
except exceptions:
# for Fusion 8+
try:
# for Fusion inside Resolve
... | |
# Copyright 2015 Internap.
#
# 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, so... | |
"""Tools to align a reconstruction to GPS and GCP data."""
import logging
import math
import numpy as np
from opensfm import multiview
from opensfm import transformations as tf
logger = logging.getLogger(__name__)
def align_reconstruction(reconstruction, gcp, config):
"""Align a reconstruction with GPS and GCP... | |
import os
from generic import obj
from developer import DevBase
from simulation import Simulation,SimulationInput,SimulationAnalyzer
# PLEASE READ THIS
#
# depending on what you want to do with a simulation
# you will have to implement different functions below
# here are a few use cases and the functio... | |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Low-level logic for a certificate authority.
We have three categories of certificates:
1. Control service, used by AMP and REST API servers. Needs to be
validated over HTTP by 3rd party clients, as well as by AMP clients.
2. Node agents, used by AMP cl... | |
# 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 law or agreed to... | |
#!/usr/bin/python
import sys
import os
from subprocess import Popen, PIPE
import optparse
import tempfile
import shutil
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
def which(program):
assert isinstance(program, str)
fpath, fname = os.path.split(program)
if fpath:
... | |
#!/usr/bin/env python3
# encoding: utf-8
# 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
#
# ... | |
""" Karr Lab build utilities
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2016-10-27
:Copyright: 2018, Karr Lab
:License: MIT
"""
import cement
from karr_lab_build_utils.core import BuildHelper, BuildHelperError
import karr_lab_build_utils
import os
import sys
import traceback
class BaseController(cement.Controlle... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GroupedMessage'
db.create_table(
'sentry_groupedmessage', (
(
... | |
# 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 ... | |
# -*- coding: utf-8 -*-
# Copyright 2015 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.
"""Install/copy the image to the device."""
from __future__ import division
from __future__ import print_function
import os
impo... | |
"""Test APRS device tracker."""
from unittest.mock import Mock, patch
import aprslib
import homeassistant.components.aprs.device_tracker as device_tracker
DEFAULT_PORT = 14580
TEST_CALLSIGN = "testcall"
TEST_COORDS_NULL_ISLAND = (0, 0)
TEST_FILTER = "testfilter"
TEST_HOST = "testhost"
TEST_PASSWORD = "testpass"
d... | |
'''
Data classes representing references to files in model objects. Manager class
for common operations with files. Manager encapsulate knowledge on where and
how to store transient and persistent files.
'''
import os
import base64
import errno
import mimetypes
from shutil import copyfileobj
from ...utils import cache... | |
# Copyright (c) 2010-2021 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 agree... | |
import socket
import re
import datetime
import sys
import threading
class TimeoutError(Exception): pass
def timelimit(timeout):
def internal(function):
def internal2(*args, **kw):
class Calculator(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.result = None
self.e... | |
#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice... | |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# $Id: TestDomHelpers.py 1058 2009-01-26 10:39:19Z graham $
#
# Unit testing for WebBrick library functions (Functions.py)
# See http://pyunit.sourceforge.net/pyunit.html
#
import sys
import unittest
import logging
from os import *
from os.path import *
sys.path.append("../..")
from MiscLib.DomHelpers import *
class... | |
"""
API for the command-line I{pyflakes} tool.
"""
from __future__ import with_statement
import sys
import os
import re
import _ast
from pyflakes import checker, __version__
from pyflakes import reporter as modReporter
__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']
PYTHON_SHEBANG_REGE... | |
import functools
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.schema import DDLElement, Column, \
ForeignKeyConstraint, CheckConstraint
from sqlalchemy import Integer
from sqlalchemy import types as sqltypes
from sqlalchemy.sql.visitors import traverse
from .. import util
if util.sqla_09:
from... | |
import asyncio
import discord
import os
import psutil
import platform
import time
import sys
import fnmatch
import subprocess
import pyspeedtest
from PIL import Image
from discord.ext import commands
from Cogs import Settings
from Cogs import DisplayName
from Cogs import ReadableTime
from Cogs impor... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2019-2021 Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Iterable, List, Union
from ezdxf.lldxf.attributes import (
DXFAttr,
DXFAttributes,
DefSubclass,
XType,
group_code_mapping,
)
from ezdxf.lldxf.const import (
SUBCLASS_MARKER,
DXF2000,
DXFType... | |
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys, re, string
sys.path.append( "../glapi_parser" )
import apiutil
line_re = re.compile (r'^(\S+)\s+(GL_\S+)\s+(.*)\s*$')
extensions_line_re = re.compile(r'^... | |
import re
import os.path as path
from twisted.words.protocols import irc
from twisted.internet import defer
from twisted.internet import protocol
from twisted.internet import reactor
from twisted.internet.interfaces import ISSLTransport
from twisted.python.util import InsensitiveDict
from mk2.plugins import Plugin
fr... | |
# Copyright 2011 James McCauley
#
# 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 writi... | |
# -*- coding: utf-8 -*-
import mechanize
import cookielib
import error
import models
import urllib2
import codecs
import datetime
import re
from lxml import etree
class MCMApi(object):
base = 'https://www.magiccardmarket.eu/'
def __init__(self, username, password):
self.username = username
s... | |
from django.db import models
from formatChecker import ContentTypeRestrictedFileField
class taxonomy(models.Model):
kingdom = models.CharField(max_length=255)
kingdomTaxonomy = models.IntegerField()
group = models.CharField(max_length=255) #fungi has no group info
# virus has family, bacteria has ge... | |
"""
Object oriented (read-only) access to CLDF data
To read ORM objects from a `pycldf.Dataset`, use two methods
* `pycldf.Dataset.objects`
* `pycldf.Dataset.get_object`
Both will return default implementations of the objects, i.e. instances of the corresponding
class defined in this module. To customize these objec... | |
# -*- coding: utf-8 -*-
"""
unit tests for the InfluxDBClient.
NB/WARNING :
This module implements tests for the InfluxDBClient class
but does so
+ without any server instance running
+ by mocking all the expected responses.
So any change of (response format from) the server will **NOT** be
detected by this module.... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a totallylegitcoi... | |
#
# Copyright 2012 eNovance
#
# 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, ... | |
#
# 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... | |
"""watershed.py - watershed algorithm
This module implements a watershed algorithm that apportions pixels into
marked basins. The algorithm uses a priority queue to hold the pixels
with the metric for the priority queue being pixel value, then the time
of entry into the queue - this settles ties in favor of the closes... | |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | |
#
# Copyright (c) SAS Institute 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 w... | |
#!/usr/bin/env python
# Copyright 2013 Google Inc.
#
# This file is part of Ansible
#
# Ansible 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 ... | |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | |
#
#
# 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... | |
import datetime
import pytest
import random
import string
import subprocess
import time
try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
from symantecssl.order import ModifyOperation
from symantecssl.order import ProductCode
from symantecssl.exceptions import Symantec... | |
# -*- coding: utf-8 -*-
import datetime as dt
import itertools
import logging
import re
import urlparse
from copy import deepcopy
import bson
import pytz
import itsdangerous
from modularodm import fields, Q
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationError, ValidationV... | |
"""
sentry.templatetags.sentry_helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
# XXX: Import django-paging's template tags so we don't have to worry about
# INSTALLED_APPS
import datetime
impor... | |
from __future__ import division, absolute_import, print_function
import collections
import pickle
import sys
from os import path
import numpy as np
from numpy.compat import asbytes
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, ass... | |
# Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD-3-Clause
from io import BytesIO
import os
import os.path as op
from functools import reduce, partial
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_equ... | |
#!/usr/bin/env python3
# Provides utilities for standalone test scripts.
# This script is not intended to be run directly.
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
import stat
import odrive
from odrive.enums import *
import odrive.utils
import fibre
from fibre import Logger... | |
# Copyright (c) 2016 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""py.test for... | |
'''
.. currentmodule:: skrf.util
========================================
util (:mod:`skrf.util`)
========================================
Holds utility functions that are general conveniences.
General
------------
.. autosummary::
:toctree: generated/
now_string
find_nearest
find_nearest_index
ge... | |
from copy import copy
from inspect import getmembers
from warnings import warn
from makefun import wraps, with_signature
try:
from inspect import signature, Parameter, Signature
except ImportError:
from funcsigs import signature, Parameter, Signature
try:
from typing import Any, Tuple, Callable, Union, T... | |
# wireproto.py - generic wire protocol support functions
#
# Copyright 2005-2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import urllib, tempfile, os, sys
from i18n import _
from node import b... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, imageio contributors
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
""" Functionality used for testing. This code itself is not covered in tests.
"""
from __future__ import absolute_import, print_function, division
import os
import sys
import i... | |
from datetime import date, datetime
from functools import partial
from django.urls import reverse
from trainings.filters import filter_trainees_by_instructor_status
from trainings.views import all_trainees_queryset
from workshops.models import (
Award,
Event,
Organization,
Person,
Role,
Tag,
... | |
__author__ = 'jtromo'
#Developed at : SEFCOM Labs by James Romo
from bluetooth import *
from Crypto.Cipher import AES
import threading
import time
import base64
import os
import uuid
# /////////////////////////////////////////////////////////////////////////////
# Configuration
# ////////... | |
# Copyright 2015 ETH Zurich
#
# 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, sof... | |
#!/usr/bin/python
# 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 r... | |
#!/usr/bin/python
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('NetworkStateAnalyzer')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import inspect
import threading
from DustLinkData import DustLinkData
from EventBus import Ev... | |
from functools import reduce, partial
import inspect
import operator
from operator import attrgetter
from textwrap import dedent
from .compatibility import PY3, PY33, PY34, PYPY, import_module
from .utils import no_default
__all__ = ('identity', 'thread_first', 'thread_last', 'memoize', 'compose',
'pipe',... | |
# Copyright 2011 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 l... | |
#C++ original by Pavel Strakhov ( https:#github.com/Riateche/toolwindowmanager )
from ToolWindowManagerWrapper import ToolWindowManagerWrapper
from ToolWindowManagerArea import ToolWindowManagerArea
from PyQt4 import QtCore, QtGui, uic
from PyQt4.QtGui import QApplication, QCursor, QSplitter, QWidget
from PyQt... | |
import os
from datetime import datetime
from time import time
from django.http import JsonResponse
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from xlrd import open_workbook, xldate_as_tuple
from it... | |
# 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 ... | |
"""
Support for RFXtrx components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/rfxtrx/
"""
import logging
from collections import OrderedDict
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.util impor... | |
from scipy.misc import imread, imresize, imsave, fromimage, toimage
from scipy.optimize import fmin_l_bfgs_b
import scipy.interpolate
import scipy.ndimage
import numpy as np
import time
import argparse
import warnings
from sklearn.feature_extraction.image import reconstruct_from_patches_2d, extract_patches_2d
from ke... | |
###############################################################################
#
# Copyright (c) 2011 Ruslan Spivak
#
# 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, inc... | |
# -*- coding: utf-8 -*-
from ome.base import NotFoundError
from ome.util import scrub_gene_id, load_tsv
from ome import settings
import re
import cobra
import cobra.io
from cobra.core import Formula
from os.path import join
import hashlib
import logging
def hash_reaction(reaction, string_only=False):
"""Generate... | |
#!/usr/bin/python
import sys, os
sys.path.append('..')
import socket
import session, config
from common import tool
from server import zygote
import json, copy, base64
sockFile = '/tmp/d2'
def send(module, message):
if message is None:
message = {}
else:
message = copy.deepcopy(message)
message['module'] = ... | |
#!/usr/bin/env python
# Copyright (c) 2019 Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
"""Test the arm toolchain."""
import os
import sys
from unittest import TestCase
import mock
ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "..", "..")
)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.