gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Lint as: python3
# 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 ... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import time
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils
class HistoryTe... | |
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.mail import send_mail
from django.core.validators import validate_email, RegexValidator
from django.core.validators import MinValueValidator
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolver... | |
"""
***************
Graphviz AGraph
***************
Interface to pygraphviz AGraph class.
Examples
--------
>>> G=nx.complete_graph(5)
>>> A=nx.to_agraph(G)
>>> H=nx.from_agraph(A)
See Also
--------
Pygraphviz: http://pygraphviz.github.io/
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# ... | |
"""Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it."""
from baseCmd import *
from baseResponse import *
class createVolumeCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the account associated... | |
from datetime import datetime
from datetime import timedelta
import http.client
from unittest import mock
import os
import shutil
import tempfile
import unittest
from cumulusci.core.github import get_github_api
import responses
from cumulusci.core.exceptions import GithubApiError
from cumulusci.core.exceptions 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
# d... | |
from __future__ import unicode_literals
import json
import random
import re
import time
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
KNOWN_EXTENSIONS,
parse_filesize,
unescapeHT... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | |
# Copyright 2017 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
__license__ = 'BSD'
from threading import Thread, Lock
import sys
import rospy
import time
from dynamixel_driver.dynamixel_serial_proxy import SerialProxy
from dynamixel_driver.dynamixel_io import DynamixelIO
from dynamixel_msgs... | |
try:
import capstone
except ImportError as e:
capstone = None
import pytest
import windows.native_exec.simple_x86 as x86
from windows.native_exec.simple_x86 import *
del Test # Prevent pytest warning
from windows.pycompat import int_types
VERBOSE = False
if capstone:
disassembleur = capstone.Cs(capston... | |
import os
from front_base.config import ConfigBase
import simple_http_client
import utils
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))
module_da... | |
# Python 3
from __future__ import print_function
import csv
from pathlib import Path
import sys
import functools
import multiprocessing
import itertools
import axelrod as axl
import pandas as pd
from axelrod import ApproximateMoranProcess, Pdf
from generate_cache import read_csv
# For tests
import collections
impo... | |
# Copyright 2014 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
"""
Code to manage the creation and SQL rendering of 'where' constraints.
"""
from django.core.exceptions import EmptyResultSet
from django.utils import tree
from django.utils.functional import cached_property
# Connection types
AND = 'AND'
OR = 'OR'
class WhereNode(tree.Node):
"""
Used to represent the SQL... | |
#!/usr/bin/env python
# coding=utf-8
"""
color multi universe pattern.
generates a test pattern:
history:
see git commits
todo:
~ all fine :-)
"""
import sys
import array
# import colorsys
import pattern
##########################################
# globals
#########################... | |
# -*- coding: utf-8 -*-
"""
legit.cli
~~~~~~~~~
This module provides the CLI interface to legit.
"""
import os
import click
from clint import resources
from clint.textui import columns
import crayons
from .core import __version__
from .scm import SCMRepo
from .settings import legit_settings
from .utils import black... | |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core import serializers
from django.core.paginator import Paginator, InvalidPage
import json as simplejson
from django.http import (
HttpResponseNotAllowed,
# HttpResponseForbidden,
HttpResponse,
Http404,
HttpResponseBadRequest
)
... | |
from flask import flash, redirect, render_template, request, url_for
from flask.ext.login import (current_user, login_required, login_user,
logout_user)
from flask.ext.rq import get_queue
from . import account
from .. import db
from ..email import send_email
from ..models import User
from ... | |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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
# encoding:utf-8
# Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of cond... | |
""" This module gets used by :class:`ircutils.client.SimpleClient` and
:class:`ircutils.bot.SimpleBot` for event handling and management.
Each line sent from the IRC server represents its own event. This information
is parsed to fill in the values for the event object. In some cases, these
single-line events are comb... | |
# 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.
import base64
import logging
import urlparse
from integration_tests import chrome_proxy_metrics as metrics
from metrics import loading
from telemetry.core i... | |
# 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/LICENSE-2.0
#
# Unless required by applicab... | |
#!/usr/bin/env python
"""
Trolley syncs issues between CSV, Github, and Buffer with Trello.
"""
import csv
import datetime
import os
import random
import click
import click_config
import github3
from buffpy.api import API as BufferAPI
from buffpy.managers.profiles import Profiles
from buffpy.managers.updates import... | |
from __future__ import unicode_literals
import hashlib
import json
import time
import warnings
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import (
authenticate,
get_backends,
login as django_login,
logout as django_logout,
)
f... | |
"""
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import abc
import os
import time
import lockfile
import numpy as np
from ParamSklearn.classification import ParamSklearnClassifier
from ParamSklearn.regression import ParamSklearnRegressor
from autosklearn.scores import libscores
from autosklearn.constants import *
try:
import cPickle as pickle
except:
imp... | |
# This files creates all the needed data structures that relab needs
# User gives the option for training and testing mode
import numpy as np
import os
import xml.etree.ElementTree as ET
from numpy import linalg as LA
import matplotlib.pyplot as plt
import cv2
from faster_rcnn import network
from faster_rcnn.faster_rc... | |
"""Review Bot tool to run FBInfer."""
from __future__ import unicode_literals
import json
import logging
import shlex
from reviewbot.tools import RepositoryTool
from reviewbot.utils.process import execute, is_exe_in_path
logger = logging.getLogger(__name__)
class FBInferTool(RepositoryTool):
"""Review Bot to... | |
#!/usr/bin/env python
# Copyright 2011 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... | |
# Under MIT License, see LICENSE.txt
import time
import math
from Util import Pose
from Util.constant import IN_PLAY_MIN_DISTANCE, ROBOT_RADIUS
from Util.role import Role
from ai.Algorithm.evaluation_module import closest_players_to_point_except, \
ball_going_toward_player
from ai.GameDomainObjects import Player
... | |
# Copyright 2020 The gRPC 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 or agreed to in wri... | |
# -*- coding: utf-8
from copy import deepcopy
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from django.core.urlresolvers import reverse
from bccf.admin import make_featured, make_unfeatured
from mezzanine.core.admin import DisplayableAdmin
from pybb.models import Category,... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from decimal import Decimal
from io import BytesIO
from test_framewo... | |
# Copyright 2011 VMware, 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 ... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# Copyright 2013 dotCloud 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... | |
# Copyright (c) 2014 Montavista Software, 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... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import datetime
import pytest
import pytz
from cryptography import x50... | |
import json, sys, re, hashlib, smtplib, base64, urllib, os, difflib
from auth import *
from django.http import *
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
from django.core.context_processors import csrf
from django.db.utils import IntegrityError
from utils im... | |
"""Support for interface with an LG webOS Smart TV."""
import asyncio
from contextlib import suppress
from datetime import timedelta
from functools import wraps
import logging
from aiopylgtv import PyLGTVCmdException, PyLGTVPairException, WebOsClient
from websockets.exceptions import ConnectionClosed
from homeassista... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | |
import json
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sites.models import Site
from django.test.utils import override_settings
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.flagit.models import FlaggedObject
from kitsune.prod... | |
"""This module contains async actions used to interact
with the spider metadata cache via the service's API.
"""
import base64
import hashlib
import httplib
import json
import logging
import tornado.httpclient
import async_actions
import spider_metadata_cache
import spider_metadata_cache.jsonschemas
_logger = loggi... | |
# Copyright 2011 Andrew Bogott for the Wikimedia Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://w... | |
__author__ = "Andre Merzky, Ole Weidner"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
import os
import sys
import pwd
import time
import string
import getpass
import radical.utils as ru
import radical.utils.logger as rul
import saga
import saga.exceptions as... | |
# Copyright (c) 2012 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.
"""Purpose of this module is to hold common script/commandline functionality.
This ranges from optparse, to a basic script wrapper setup (much like
w... | |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Determining whether files are being measured/reported or not."""
import importlib.util
import inspect
import itertools
import os
import platform
import re
impor... | |
# Copyright 2013 Georgia Tech Research Corporation
#
# 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 applicab... | |
# -*- coding:utf-8 -*-
import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duratio... | |
"""Support for the Netatmo cameras."""
import logging
from pyatmo import NoDevice
import requests
import voluptuous as vol
from homeassistant.components.camera import (
CAMERA_SERVICE_SCHEMA,
PLATFORM_SCHEMA,
SUPPORT_STREAM,
Camera,
)
from homeassistant.const import CONF_VERIFY_SSL, STATE_OFF, STATE_O... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
#!/usr/bin/python
import sys
import time
import math
import pdb
from Utils import GeomUtils
import Stroke
from SketchFramework import Point
from Tkinter import *
from tkMessageBox import *
# Constants
TEMPLATE_FILE = "board_templates.dat"
TEMPLATE_SAMPLE = 64 #num points in a template
WIDTH = 800
HEIGHT = 600
MID_... | |
import traceback, sys
from unittest import TestResult
import datetime
from tcmessages import TeamcityServiceMessages
PYTHON_VERSION_MAJOR = sys.version_info[0]
def strclass(cls):
if not cls.__name__:
return cls.__module__
return "%s.%s" % (cls.__module__, cls.__name__)
def smart_str(s):
encoding = 'utf-... | |
#
# Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 co... | |
import sys
import pytest
from numpy.testing import assert_allclose
import numpy as np
import scipy.sparse as sparse
from keras.backend import theano_backend as KTH
from keras.backend import tensorflow_backend as KTF
from keras.utils.np_utils import convert_kernel
def check_single_tensor_operation(function_name, inpu... | |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import socket
import sys
import threading
import time
class Server:
def __init__(self, port, listen=20):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.port = port
self.listen = listen
def start(self):
self.socket.bind(('',self.port))
self.socket.l... | |
"""Provides functionality to interact with climate devices."""
from abc import abstractmethod
from datetime import timedelta
import functools as ft
import logging
from typing import Any, Dict, List, Optional
import voluptuous as vol
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_TENTHS,
PRE... | |
import os
import json
import logging
import mimetypes
import md5
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404, render_to_respon... | |
"""Contains a class for clang binary based completion.
Attributes:
log (logging.Logger): logger for this module
"""
import re
import sublime
import time
import logging
from os import path
from ..utils.tools import Tools
from ..utils.file import File
from ..utils.subl.row_col import ZeroIndexedRowCol
from ..utils... | |
import hashlib
import json
import os
import pickle
import shutil
from datetime import date, datetime
from django.conf import settings
from django.utils import timezone
from django_test_tools.exceptions import DjangoTestToolsException
BLOCKSIZE = 65536
def create_dated(filename):
"""
Based on the filename w... | |
# Copyright (c) 2015 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... | |
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
import os
import sys
import pygame
import copy
from pygame.locals import *
import drawable
import util
import mapitem
import hare, cat, fox
from common.constants import *
from client.constants import *
from common import boundint
class MapChar(mapitem.MapItem):
def __init__(self, mapCloneMethod, battleCloneM... | |
# -*- coding: utf-8 -*-
import datetime
import json
import logging
from cronq import interval_parser
from cronq.backends.mysql import Storage
from cronq.utils import json_serial
from cronq.utils import query_category_id
from cronq.utils import query_category_name
from cronq.utils import query_id
from cronq.utils impor... | |
# 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 os
import sys... | |
import quex.blackboard as blackboard
import quex.input.regular_expression.core as regular_expression
import quex.input.files.code_fragment as code_fragment
import quex.input.files.indentation_setup as indentation_setup
import quex.input.files.consistency_check ... | |
# PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# All rights reserved.
#
# 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, thi... | |
# -*- coding: utf-8 -*-
"""
eve.utils
~~~~~~~~~
Utility functions and classes.
:copyright: (c) 2015 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
import sys
import eve
import hashlib
import werkzeug.exceptions
from cerberus import Validator
from copy import copy
from flask ... | |
import unittest
import os
import sys
sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/.."))
from courier import widgets, templates
from courier.app import serialize_
class ButtonWidgetTests(unittest.TestCase):
def test_isdict(self):
btn = widgets.Button (None, None)
self.assertTrue... | |
#
# 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... | |
from __future__ import absolute_import, division, print_function
from operator import getitem
from tornado import gen
from dask.compatibility import apply
from dask.base import tokenize
from distributed.client import default_client
from .core import Stream
from . import core, sources
class DaskStream(Stream):
... | |
"""Utilities for input validation"""
# Authors: Olivier Grisel and Gael Varoquaux and others (please update me)
# License: BSD 3
import warnings
import numbers
import numpy as np
from scipy import sparse
from ..externals import six
from .fixes import safe_copy
def _assert_all_finite(X):
"""Like assert_all_fini... | |
from landlab import Component
from landlab.utils.decorators import use_file_name_or_kwds
import numpy as np
import six
_VALID_METHODS = set(['Grid', 'Multi'])
def assert_method_is_valid(method):
if method not in _VALID_METHODS:
raise ValueError('%s: Invalid method name' % method)
class SoilMoisture(Co... | |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
import hmac
import base64
from dash_utils import *
from dash_hashs import *
from dash_jacobian import *
def get_pubkey_format(pub):
two = 2
three = 3
four = 4
if isinstance(pub, (tuple, list)):
return 'decima... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
#This script recognize set of reflectors, and allows only according movement, while iterating it.
#Written by Michael Simkin 2014
import golly as g
import copy
data = []
data.append(["2o5b2o$2o5bo$5bobo$5b2o$b2o$bobo$2bo2$5b3o$5b3o$5b3o$8b3o$8b3o$8b3o!", "P8 Reflector"])
data.append(["22b2o$22bo$11b2o7bobo$11bobo6b2... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
('hs_app_timeseries', '0004_auto_20160526_2026'),
]
operations = [
migrations.CreateMode... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | |
# Copyright (c) 2016 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 applic... | |
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import re
from imp import load_source
from os import listdir
from os.path import isdir, isfile, join
import click
from platformio import exception, util
from platformio.app import get_state_item, set_state_item
from platformio.pkgmanager impor... | |
import subprocess
import unittest2 as unittest
from gevent.queue import Queue, Empty
from mock import Mock, call, patch
from pytz import utc
from job_runner_worker.worker import (
execute_run, kill_run, _get_child_pids, _truncate_log
)
class ModuleTestCase(unittest.TestCase):
"""
Tests for :mod:`job_run... | |
# card-fight-thingy - Simplistic battle card game... thingy
#
# The MIT License (MIT)
#
# Copyright (c) 2015 The Underscores
#
# 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 restrict... | |
# 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... | |
#!/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... | |
"""
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | |
import pickle
from sh import fgrep
from sh import nova
from sh import tail
from datetime import datetime
import json
import sys
import os
import pprint
pp = pprint.PrettyPrinter(indent=4)
# import shelve
from cloudmesh.config.cm_config import cm_config
# from openstack.cm_compute import openstack as os_client
# Error... | |
from thespian.test import *
from time import sleep
import pytest
from thespian.actors import *
from datetime import timedelta
class PreRegActor(ActorTypeDispatcher):
def receiveMsg_str(self, regaddr, sender):
self.preRegisterRemoteSystem(regaddr, {})
self.send(sender, 'Registered')
@pytest.fixtu... | |
# Copyright 2012 Nicira, 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 agr... | |
"""Integration testing."""
import unittest
import time
from test import regnet
class TestChannel(unittest.TestCase):
"""Run basic tests on payment channels."""
@classmethod
def setUpClass(cls):
cls.cache = regnet.make_cache()
@classmethod
def tearDownClass(cls):
cls.cache.cleanup... | |
"""
Assign geographically density value to a points.
"""
from scipy.spatial import KDTree
from scipy.spatial.distance import cdist
from scipy.stats import norm
from scipy.optimize import minimize
import numpy as np
def general_density_assignation(locs, parameters, values=None, locs2=None):
"Density assignation ... | |
# 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 writi... | |
from __future__ import absolute_import
from __future__ import print_function
import sys
import tornado.web
import logging
from django import http
from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest, get_script_name
from django.core.handlers import base
from django.core.urlresolvers impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.