gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
import unittest
import os
from xml.etree.ElementTree import ParseError
from programy.parser.aiml_parser import AIMLParser
from programy.parser.exceptions import ParserException
from programy.parser.pattern.nodes.root import PatternRootNode
from programy.parser.pattern.nodes.topic import PatternTopicNode
from programy.... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import pytest
import time
from rancher import ApiError
from .common import wait_for_template_to_be_created, \
wait_for_template_to_be_deleted, random_str, wait_for_atleast_workload
from .conftest import set_server_version, wait_for, DEFAULT_CATALOG
def test_catalog(admin_mc, remove_resource):
client = admin_m... | |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: __init__.py
import _dsz
import dsz
import dsz.data
import dsz.lp
import mcl.tasking
import re
import sys
import Queue
import xml
import xml.sax
impor... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend vivos 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 vivod or Vivo-Qt r... | |
import logging
import numpy as np
from .modest_image import extract_matched_slices
from ..core.exceptions import IncompatibleAttribute
from ..core.data import Data
from ..core.subset import Subset, RoiSubsetState
from ..core.roi import PolygonalROI
from ..core.edit_subset_mode import EditSubsetMode
from .viz_client ... | |
# --------------------------------------------------------------------------------------------------
# Name: MainWindow
# Purpose: Represents the Application MainWindow and hosts all components inside it:
# Canvas, Animation Display etc.
# Author: Rafael Vasco
#
# Created: 26/01/2013
# ... | |
# 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... | |
# -*- coding: utf-8 -*-
import sys, traceback
import os
import shutil
import requests
import time
import grequests
import itertools
from itertools import product
import multiprocessing as mp
from multiprocessing import Pool
import logging
import subprocess
from subprocess import check_call
import codecs
from xml.etree ... | |
#!/usr/bin/env python
# coding: utf-8
# Copyright (C) USC Information Sciences Institute
# Author: Vladimir M. Zaytsev <zaytsev@usc.edu>
# URL: <http://nlg.isi.edu/>
# For more information, see README.md
# For license information, see LICENSE
import logging
from hugin.pos import POS
from hugin.pos import Pos
class... | |
# Copyright 2015 Diamond Light Source Ltd.
#
# 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 t... | |
#!/usr/bin/env python3
# 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
# "L... | |
# -*- coding: utf-8 -*-
"""Full-featured O(1) LRU cache backported from Python3.3. The full
Py3.3 API is supported (thread safety, maxsize, keyword args, type
checking, __wrapped__, and cache_info). Includes Py3.3 optimizations
for better memory utilization, fewer dependencies, and fewer dict
lookups.
http://code.acti... | |
# cython: auto_cpdef=True
"""Python code for writing AVRO files"""
# This code is a modified version of the code at
# http://svn.apache.org/viewvc/avro/trunk/lang/py/src/avro/ which is under
# Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0)
try:
from fastavro._six import utob, MemoryIO, long, is_... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import numpy as np
import menpo
from nose.tools import raises
from numpy.testing import assert_allclose
from menpo.image import BooleanImage, Image, MaskedImage, OutOfMaskSampleError
from menpo.shape import PointCloud
from menpo.transform import Affine
import menpo.io as mio
# do the import to generate the expected ou... | |
# -*- coding: utf-8 -*-
import pytest
import ethereum.db
import ethereum.blocks
import ethereum.config
from ethereum import tester
from ethereum.utils import int_to_addr, zpad
from pyethapp.jsonrpc import address_decoder, data_decoder, quantity_decoder
from raiden.utils import privatekey_to_address
from raiden.tests.u... | |
# polling_location/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import PollingLocationListManager, PollingLocationManager
from config.base import get_environment_variable
from django.contrib import messages
import glob
import json
import requests
import wevote_functions.adm... | |
import json
import logging
from pathlib import Path
from threading import RLock
from uuid import uuid4
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.resource import ResourceManagementClient... | |
"""
TwoPhaseFlow
"""
from __future__ import division
from past.utils import old_div
import numpy as np
from proteus import (Domain, Context, Gauges,
MeshTools as mt)
from proteus.Profiling import logEvent
from proteus.mprans.SpatialTools import Tank2D
from proteus.mprans.SpatialTools import Tank3D
... | |
import sys, os, inspect
from abc import ABCMeta, abstractmethod
from ctypes import *
MY_DIR = os.path.dirname(os.path.abspath(inspect.getframeinfo(inspect.currentframe())[0]))
HELPER_DIR = os.path.abspath(os.path.join(MY_DIR, '..', 'helpers'))
sys.path.append(HELPER_DIR)
import dhlog
from dhcore import *
class MSAAMo... | |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | |
# 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... | |
"""
Contains the :class:`database <tinydb.database.TinyDB>` and
:class:`tables <tinydb.database.Table>` implementation.
"""
from . import JSONStorage
from .utils import LRUCache, iteritems, itervalues
class Element(dict):
"""
Represents an element stored in the database.
This is a transparent proxy for d... | |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import subprocess
import praw
import datetime
import pyperclip
from hashlib import sha1
from flask import Flask
from flask import Response
from flask import request
from cStringIO import StringI... | |
<<<<<<< HEAD
<<<<<<< HEAD
import os
import sys
import importlib.machinery
from idlelib.TreeWidget import TreeItem
from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem
from idlelib.PyShell import PyShellFileList
class PathBrowser(ClassBrowser):
def __init__(self, flist, _htest=False):
"""... | |
# -*- coding: utf-8 -*-
"""
.. module:: djstripe.event_handlers.
:synopsis: dj-stripe - webhook event handlers for the various models
.. moduleauthor:: Bill Huneke (@wahuneke)
.. moduleauthor:: Alex Kavanaugh (@akavanau)
.. moduleauthor:: Lee Skillen (@lskillen)
Stripe docs for Events: https://stripe.com/docs/api... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
# -*- coding: utf-8 -*-
"""
CKernel evaluation of blaze AIR.
"""
from __future__ import absolute_import, division, print_function
import operator
from pykit.ir import visit, copy_function
from dynd import nd, ndt
import blaze
import blz
import datashape
from ....datadescriptor import DyNDDataDescriptor, BLZDataDes... | |
import numpy as np
import pp
from pp.routing.connect import connect_strip
from pp.routing.connect import connect_elec
from pp.port import is_electrical_port
from pp.port import flipped
BEND_RADIUS = pp.config.BEND_RADIUS
def route_elec_ports_to_side(ports, side="north", wire_sep=20.0, x=None, y=None):
return rou... | |
import datetime
import os
import re
import shutil
from . import util
_rev_file = re.compile(r'.*\.py$')
_legacy_rev = re.compile(r'([a-f0-9]+)\.py$')
_mod_def_re = re.compile(r'(upgrade|downgrade)_([a-z0-9]+)')
_slug_re = re.compile(r'\w+')
_default_file_template = "%(rev)s_%(slug)s"
_relative_destination = re.compile... | |
import sys, os.path, time, pickle, bz2
from pprint import pprint
from zope.interface import implements
from twisted.python import usage
from twisted.internet import reactor
from foolscap.logging.interfaces import IIncidentReporter
from foolscap.logging import levels, app_versions
from foolscap.eventual import eventual... | |
'''
ChoiceGroup & Choice managing views
'''
from django import forms
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from django.views.generic import UpdateView
from django.views.gene... | |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... | |
from osuapi import OsuApi, AHConnector
from discord.ext import commands
from .utils import utils
import datetime
import discord
import logging
import aiohttp
import os
log = logging.getLogger(__name__)
class Core(commands.Cog):
"""
The core of Nurevam, just essentials.
"""
def __init__(self,bot):
... | |
import simplejson
import jsonpickle
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, make_response, jsonify, Markup, Response
def graph_line(pluginData, func_name, func_nfo):
"""
converts from the original format to highcharts format. returning the JSON
"""
... | |
""" Create a Nifti file from specified series data
Take the data in the specified series directory and convert it to a 4D
nifti image in RAS+ orientation, and then save the new data to disk.
If the series is an anatomical scan, the output Nifti will be 3D. If the series
is a functional scan, the output Nifti will be ... | |
# 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.path
from json_parse import OrderedDict
from memoize import memoize
class ParseException(Exception):
"""Thrown when data in the model is in... | |
# -*- coding: utf-8 -*-
import copy
import itertools
import types
import cv2
import numpy as np
from keras.models import Sequential
from keras.preprocessing.image import ImageDataGenerator
from sldc import DefaultTileBuilder, Image, TileTopologyIterator
from cell_counting.base_method import BaseMethod
from cell_coun... | |
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.interval.IntervalGlobal import *
from DistributedMinigame import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.toonbas... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import logging
import os
import random
import re
import sys
import time
import Queue
import threading
import shelve
import uuid
from logging import Formatter
from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from ... | |
"""RangeMap class definition."""
from abc import ABCMeta, abstractmethod
from bisect import bisect_left, bisect_right
from collections.abc import Collection, Mapping, Set
from .sentinel import NOT_SET
class MappedRange:
"""Represents a subrange of a RangeMap.
This is a glorified namedtuple.
"""
__slots__ = ('s... | |
# 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-2.0
#
# Unless requ... | |
"""
pythonUntappd.py - v0.1
Python wrapper for the Untappd API - https://untappd.com/api/docs
Author - Mackenzie Marshall <mackenziemarshall.com>
"""
import json
import urllib
import urllib.request
#import urllib2
class api:
"""
Arguments:
client_id = Untappd API Client ID
client_secret =... | |
# (c) 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 re... | |
# Copyright (c) 2016 Baidu, Inc. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
"""
Semiconducting Materials from Analogy and Chemical Theory
A collection of fast screening tools from elemental data
"""
# get correct path for datafiles when called from another directory
from builtins import filter
from builtins import map
from builtins import range
from builtins import object
from os import path... | |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | |
import difflib
from xml.dom import Node
from htmltreediff.text import is_text_junk
from htmltreediff.util import (
copy_dom,
HashableTree,
FuzzyHashableTree,
is_text,
get_child,
get_location,
remove_node,
insert_or_append,
attribute_dict,
walk_dom,
)
def match_node_hash(node):
... | |
# routines for generating a list of coordinate offsets for various template structures
import numpy as np
class Template:
"""Class template for generating lists of template voxels
Parameters
----------
type: string
Required by constructor. The type of template currently available types are:... | |
import django
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models, connection
from django.db.models.fields.related import create_many_related_manager, ManyToManyRel
from django.utils.translation import ugettext_lazy as _
from .compat import User
class Relationsh... | |
from typing import Optional, Tuple, Union
from hwt.code import If
from hwt.hdl.types.bits import Bits
from hwt.interfaces.std import Handshaked
from hwtLib.abstract.componentBuilder import AbstractComponentBuilder
class AbstractStreamBuilder(AbstractComponentBuilder):
"""
:note: see :class:`AbstractComponent... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# 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... | |
"""The tests for the NSW Rural Fire Service Feeds platform."""
import datetime
from unittest.mock import ANY
from aio_geojson_nsw_rfs_incidents import NswRuralFireServiceIncidentsFeed
from asynctest.mock import patch, MagicMock, call
from homeassistant.components import geo_location
from homeassistant.components.geo_... | |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
# -*- test-case-name: flocker.provision.test.test_install -*-
"""
Install flocker on a remote node.
"""
import posixpath
from textwrap import dedent
from urlparse import urljoin, urlparse
from effect import Func, Effect
import yaml
from zope.interface impo... | |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... | |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from ..externals.six import string_types
import os
from ..bem import fit_sphere_to_headshape
from ..io impor... | |
import logging, pickle, os, glob
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
import numpy as np
from scipy.special import erfinv
from bokeh.plotting import ColumnDataSource, Figure, save, output_file, show
from bokeh.models import HoverTool, TapTool, OpenURL
from bokeh.models import Row, Column
... | |
# Copyright 2015 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.
"""
The metaclasses used by the mojo python bindings for interfaces.
It is splitted from mojo_bindings.reflection because it uses some generated code
that w... | |
from __future__ import unicode_literals, division, absolute_import
import os
from datetime import datetime
from datetime import timedelta
from netrc import netrc, NetrcParseError
import logging
import base64
from flexget import plugin, validator
from flexget.entry import Entry
from flexget.event import event
from flex... | |
# 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 sub... | |
#!/usr/bin/env python
# Copyright (c) 2013 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 ... | |
import collections
import email
import types
import urllib
import urlparse
import responses
import times
# todo: implement own conversion utility
from django.utils.encoding import force_bytes
from .loading import load_resource
def parse_http_date(header, headers):
if header in headers and headers[header]:
... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend etps 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 etpd or Etp-Qt runn... | |
from collections import OrderedDict
import datetime
import math
# from util.singly import SinglyHelper]
from django.core.cache import cache
from django.db.models import Sum
from django.http import HttpResponseRedirect, HttpResponse
from django.template.loader import render_to_string
from django.views.decorators.csrf im... | |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.shortcuts import render, get_object_or_404
from django.conf import settings
from kobo.django.views.generic import DetailView, SearchView
from rest_framework import viewsets, mixins, stat... | |
import sys
from xml.parsers import expat
import copy
from . import syntax
from . import grammar
from . import error
from . import statements
from . import util
yin_namespace = "urn:ietf:params:xml:ns:yang:yin:1"
# We're using expat to parse to our own primitive dom-like
# structure, because we need to keep track of ... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2021 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 various command line arguments and configuration file parameters."""
import os
import time
from ... | |
import ptypes
from ptypes import *
import six,itertools,functools,operator
ptypes.Config.ptype.clone_name = '{}'
ptypes.Config.pbinary.littleendian_name = '{}'
ptypes.Config.pbinary.bigendian_name = 'be({})'
ptypes.setbyteorder(ptypes.config.byteorder.littleendian)
### utility functions
R = lambda f: list(reversed(f)... | |
import numpy
from six import moves
from chainer import cuda
from chainer import function
from chainer.utils import conv
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cuda.cudnn.cudnn
_fwd_pref = libcudnn.CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT
def _pair(... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
# Copyright 2015 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... | |
import logging
import time
from abc import abstractmethod
from typing import Dict, Any, Iterable, List
import numpy as np
from guacamol.utils.chemistry import canonicalize_list, is_valid, calculate_pc_descriptors, continuous_kldiv, \
discrete_kldiv, calculate_internal_pairwise_similarities
from guacamol.distributi... | |
"""
ANSI -> html converter
Credit for original idea and implementation
goes to Muhammad Alkarouri and his
snippet #577349 on http://code.activestate.com.
(extensively modified by Griatch 2010)
"""
from __future__ import absolute_import
from builtins import object
import re
import cgi
from .ansi import *
# All xte... | |
# -*- coding: utf-8 -*-
""" Simple Generic Location Tracking System
@copyright: 2011-12 (c) Sahana Software Foundation
@license: MIT
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 So... | |
# -*- coding: utf-8 -*-
"""
Test all terms in terms_dg. Performs numerical test on simple mesh.
"""
import functools
import inspect
import numpy as nm
import numpy.testing as nmts
import scipy.sparse as sp
from sfepy.base.base import Struct
from sfepy.base.testing import TestCommon
from sfepy.discrete import DGFieldV... | |
#!/usr/bin/env python
from nose.tools import *
import networkx
from test_graph import BaseGraphTester, BaseAttrGraphTester, TestGraph
class BaseDiGraphTester(BaseGraphTester):
def test_has_successor(self):
G=self.K3
assert_equal(G.has_successor(0,1),True)
assert_equal(G.has_successor(0,-1),... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import os.path
import time
from datetime import datetime
import json
from logger import Logger
import ogp2solr
import dateutil.parser
import sys
import urllib2
import re
import codecs
import zipfile
import pdb
import glob
try:
import zlib
... | |
# Copyright 2014 IBM Corp.
#
# 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 t... | |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | |
from unittest import mock
from django.apps.registry import apps as global_apps
from django.db import DatabaseError, connection, migrations, models
from django.db.migrations.exceptions import InvalidMigrationPlan
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import Migratio... | |
#pylint: disable-msg=C0103, C0301
"""
Pure Python implementation of RTree spatial index
Adaptation of
http://code.google.com/p/pyrtree/
R-tree.
see doc/ref/r-tree-clustering-split-algo.pdf
"""
__author__ = "Sergio J. Rey"
__all__ = ['RTree', 'Rect', 'Rtree']
MAXCHILDREN = 10
MAX_KMEANS = 5
BUFFER = 0.0000001
imp... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import httplib as http
from flask import request
from flask import send_from_directory
from django.core.urlresolvers import reverse
from geoip import geolite2
from framework import status
from framework import sentry
from framework.auth import ... | |
# 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 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.create_index('sentry_filtervalue', ['project_id', 'value', 'times_seen'])
def backwards(self, orm):
... | |
#!/usr/bin/python
"""Historian script for converting the timestamps in kernel trace to UTC.
TO USE:
kernel_trace.py --bugreport=<path to bugreport> --trace=<path to trace file>
--device=<device type hammerhead/shamu/flounder/flounder_lte>
"""
# Copyright 2016 Google LLC. All rights reserved.
#
# Licensed under the... | |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2016 ARM Limited
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 Insight Software Consortium
#
# 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... | |
#
# Kivy - Crossplatform NUI toolkit
# http://kivy.org/
#
from __future__ import print_function
import sys
from copy import deepcopy
import os
from os.path import join, dirname, sep, exists, basename, isdir, abspath
from os import walk, environ, makedirs, listdir
from distutils.version import LooseVersion
from collec... | |
# -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
## FIXME: disabling pylint error 1101 as a quick workaround a bad class
## design with classes Nginx, NginxStatic and NginxProxy
# pylint: disable=E1101
from os.path import join, devnull, exists
from os import kill, chown, setui... | |
import os
import os.path as op
import pytest
import numpy as np
from numpy.testing import (assert_array_equal, assert_equal, assert_allclose,
assert_array_less)
import itertools
import mne
from mne.datasets import testing
from mne.fixes import _get_img_fdata
from mne import read_trans, writ... | |
# -*- coding: utf-8 -*-
# Built-in
# Common
import numpy as np
import scipy.sparse as scpsp
# specific
from . import _generic_check
_LALGO = [
'inv_linear_augTikho_sparse',
'inv_linear_augTikho_dense',
'inv_linear_augTikho_chol_dense',
'inv_linear_augTikho_chol_sparse',
'inv_linear_augTikho_... | |
#
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
# Copyright 2018 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... | |
'''
This is a scaled down version of clingo-dl show casing how to implement a
propagator for difference logic.
'''
from typing import List, Sequence, Optional, MutableMapping, Tuple, Set, cast
import heapq
import sys
from clingo import ast
from clingo.symbol import Function, Number, Symbol, SymbolType, Tuple_
from cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.