gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from .filesystem import *
import sys
# Make a new file system, i.e., format the disk so that it
# is ready for other file system operations.
class MKFS():
def __init__(self, shell):
self.shell = shell
self.file_system = self.shell.file_system
def run(self):
self.file_system.initialize... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, with_statement
from behave import model, i18n
from behave.textutil import text as _text
import six
import re
DEFAULT_LANGUAGE = 'en'
def parse_file(filename, language=None):
with open(filename, 'rb') as f:
# file encoding is assumed to be u... | |
import logging
from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
import numpy as np
import tensorflow as tf
from pathlib import Path
from typing import Any, List, Optional, Text, Dict, Type, TYPE_CHECKING
import rasa.utils.common
from rasa.engine.graph import ExecutionContext
from r... | |
import datetime
from django.test import TestCase
from django.urls import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from feder.cases.models import Case
from feder.cases.factories import CaseFactory
from feder.main.tests import PermissionStatusMixin
from feder.parcels.factories import Incomin... | |
import yaml as yaml
from astropy import units
import re
class DefaultParser:
"""Not invented here syndrome"""
__check = {}
__convert = {}
__list_of_leaf_types = []
def __init__(self, default_dict):
self.__register_leaf('list')
self.__register_leaf('int')
self.__r... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, unicode_literals
import logging
import os
import sys
from collections import namedtuple
import extra_views
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.forms import modelform_factory
from django.util... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
try:
import cPickle as pickle
except ImportError:
import pickle
from src.utils.utils import to_str, to_unicode
from src.typeclasses.models import PackedDBobject,PackedDict,PackedList
from ... | |
import re
import string
import random
import os
from kodi_voice import KodiConfigParser, Kodi
config_file = os.path.join(os.path.dirname(__file__), "kodi.config")
config = KodiConfigParser(config_file)
kodi = Kodi(config)
# Generate MUSICARTISTS Slot
retrieved = kodi.GetMusicArtists()
all = []
if 'result' in retri... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import glob
from collections import OrderedDict, Sequence
import six
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
try:
import mayavi
from mayavi import mlab
HAVE_MAYAVI = True
except ImportError:
... | |
#
# 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... | |
############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2013 PauLLA
#
# 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 re... | |
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
from pyqtgraph.graphicsItems.ROI import ROI
import pyqtgraph as pg
from . import TransformGuiTemplate_pyqt as TransformGuiTemplate
from pyqtgraph import debug
class SelectBox(ROI):
def __init__(self, scalable=False, rotatable=True):
#Q... | |
# BSD 3-Clause License
#
# Copyright (c) 2012, the Sentry Team, see AUTHORS for more details
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Red... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Shubhodeep Mukherjee
# 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.apac... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import os
import mock
import pytest
from flexget.utils.bittorrent import Torrent
class TestInfoHash(object):
config = """
tasks:
test:
mock... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from time import time
from pathlib import Path
import os, os.path
import numpy as np
from numpy import random
# from excited_util import to_rng, uuid_source
from zlib import crc32
import pickle
import warnings
from .test_sets import MEXICAN_SINGER
pd.se... | |
from __future__ import unicode_literals
import argparse
import json
import re
import sys
from threading import Lock
import six
from flask import Flask
from flask.testing import FlaskClient
from six.moves.urllib.parse import urlencode
from werkzeug.routing import BaseConverter
from werkzeug.serving import run_simple
... | |
from datetime import date, datetime, time, timedelta
import importlib
from dateutil.relativedelta import relativedelta
from django.db import models
import numpy as np
import pandas as pd
import pytz
from ctrack import categories
class Transaction(models.Model):
"""A single one-way transaction."""
when = mode... | |
from six.moves import xrange
import theano
def make_declare(loop_orders, dtypes, sub):
"""
Produce code to declare all necessary variables.
"""
decl = ""
for i, (loop_order, dtype) in enumerate(zip(loop_orders, dtypes)):
var = sub['lv%i' % i] # input name corresponding to ith loop variab... | |
# Author: Nikolay Mayorov <n59_ru@hotmail.com>
# License: 3-clause BSD
from __future__ import division
import numpy as np
from scipy.sparse import issparse
from scipy.special import digamma
from ..externals.six import moves
from ..metrics.cluster.supervised import mutual_info_score
from ..neighbors import NearestNeig... | |
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | |
# -*- coding: utf-8 -*-
"""
test cython .agg behavior
"""
from __future__ import print_function
import pytest
import numpy as np
from numpy import nan
import pandas as pd
from pandas import (bdate_range, DataFrame, Index, Series, Timestamp,
Timedelta, NaT)
from pandas.core.groupby.groupby impor... | |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# X.509 certificate Request Message Format (CRMF) syntax
#
# ASN.1 source from:
# http://tools.ietf.org/html/rfc2511
#
# Sample captures could be obtained with O... | |
from __future__ import with_statement
import errno
from contextlib import contextmanager
from plumbum.path.base import Path, FSUser
from plumbum.lib import _setdoc, six
from plumbum.commands import shquote
class StatRes(object):
"""POSIX-like stat result"""
def __init__(self, tup):
self._tup = tuple(t... | |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | |
from flask import Flask, redirect, render_template, request, make_response
from druvw import xyz, uvw
import pandas as pd
from bokeh.plotting import figure, gridplot
from bokeh.embed import components
from bokeh.models import ColumnDataSource, HoverTool, DataTable, TableColumn, NumberFormatter
from astroquery.simbad im... | |
__all__ = ['imread', 'imsave']
import numpy as np
from six import string_types
from PIL import Image
from ...util import img_as_ubyte, img_as_uint
def imread(fname, dtype=None, img_num=None, **kwargs):
"""Load an image from file.
Parameters
----------
fname : str or file
File name or file-li... | |
import os
import abc
from pascal_utils import VOC2006AnnotationParser, all_classes
import numpy as np
import settings
import cv2
import utils
from parts import CUBParts
from itertools import ifilter
class Dataset(object):
def __init__(self, base_path):
self.base_path = base_path
@abc.abstractmethod
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | |
from bbrc.xnat.mailing import *
def check_last_uploads(folder, today_date = None):
config_file = '/home/grg/.xnat_bsc.cfg'
from glob import glob
import pandas as pd
import logging as log
import os.path as osp
from pyxnat import Interface
central = Interface(config=config_file)
# get ... | |
import logging
from datetime import datetime, timedelta
import webapp2
from google.appengine.ext import ndb, deferred, blobstore
from google.appengine.api import memcache, mail, images, taskqueue, search
import json
from constants import *
import tools
from oauth2client import client
import httplib2
class User(ndb.Mod... | |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
'''Code representing an IP block for reggen'''
from typing import Dict, List, Optional, Sequence, Set, Tuple
import hjson # type: ignore
from .alert import Alert
from .... | |
from __future__ import with_statement
from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
from django.utils.unittest import skip
from models import Person
class SkippingTestCase(TestCase):
def test_skip_unless_db_feature(self):
"A test that might be skipped is actually called."
... | |
"""
Load tests from generators.
This plugin implements :func:`loadTestFromTestCase`,
:func:`loadTestsFromName` and :func:`loadTestFromModule` to enable
loading tests from generators.
Generators may be functions or methods in test cases. In either case,
they must yield a callable and arguments for that callable once f... | |
"""Tests for vumi.application.sandbox."""
import base64
import os
import sys
import json
import resource
import pkg_resources
import logging
from collections import defaultdict
from datetime import datetime
import warnings
from OpenSSL.SSL import (
VERIFY_PEER, VERIFY_FAIL_IF_NO_PEER_CERT, VERIFY_NONE,
SSLv3_... | |
from basic import Basic, S
from operations import AssocOp
from cache import cacheit
from logic import fuzzy_not
# internal marker to indicate:
# "there are still non-commutative objects -- don't forget to process them"
class NC_Marker:
is_Order = False
is_Mul = False
is_Number = False
is_Po... | |
import test.test_support
compiler = test.test_support.import_module('compiler', deprecated=True)
from compiler.ast import flatten
import os, sys, time, unittest
from random import random
from StringIO import StringIO
# How much time in seconds can pass before we print a 'Still working' message.
_PRINT_WORKING_MSG_INTE... | |
# Copyright (c) 2014 Cisco Systems, 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 r... | |
# -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | |
from datetime import datetime, timedelta, time
from collections import MutableMapping
import numpy as np
from pandas._libs import tslib
from pandas._libs.tslibs.strptime import array_strptime
from pandas._libs.tslibs import parsing, conversion
from pandas._libs.tslibs.parsing import ( # noqa
parse_time_string,
... | |
"""
.. todo::
WRITEME
"""
import warnings
from theano.gof import Apply
from theano.sandbox.cuda import CudaNdarrayType
from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable
from theano.sandbox.cuda.basic_ops import gpu_contiguous
from theano.sandbox.cuda import GpuOp
from theano.tensor import get_sca... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
from Chandra.Time import DateTime
from kadi.commands.states import get_states
import Ska.DBI
from kadi import events
from astropy.table import Table
from mica.utils import get_timeline_at_date
from mica.common import MICA_ARCHIVE
DEF... | |
"""Module for compiling codegen output, and wrap the binary for use in
python.
.. note:: To use the autowrap module it must first be imported
>>> from sympy.utilities.autowrap import autowrap
This module provides a common interface for different external backends, such
as f2py, fwrap, Cython, SWIG(?) etc. (Curren... | |
__author__ = 'frank'
import os
import os.path
import pprint
import traceback
import urllib2
import zstacklib.utils.daemon as daemon
import zstacklib.utils.http as http
import zstacklib.utils.jsonobject as jsonobject
from zstacklib.utils import log
from zstacklib.utils.bash import *
from zstacklib.utils.report import ... | |
#!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2016 Charles Lin
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, c... | |
"""
Cog for interacting with various image APIs.
"""
import asyncio
import random
from io import BytesIO
import aiohttp
import aiopixiv
import arrow
import discord
import pytz
from dateutil.parser import parse
from discord.ext import commands
from joku import VERSION
from joku.cogs._common import Cog
from joku.core.b... | |
#!/usr/bin/env python
"""
SYNOPSIS
ProcessRSData [-h,--help] [-v,--verbose] [--version]
DESCRIPTION
This script reads a Yaml config file and processes the
contents. The config file may contain a set of one or
more 'run' instructions for processing of remote
sensing data.
EXAMPLES
TODO: Show... | |
# 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 (t... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend worldbits 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 worldbitd or W... | |
################################################################################
# Copyright (C) 2011-2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
General numerical functions and methods.
"""
import functool... | |
#!/usr/bin/env python
"""GUI elements to display usage statistics."""
import operator
from grr.gui import renderers
from grr.gui.plugins import semantic
from grr.gui.plugins import statistics
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import events
from grr.lib import rdfvalue
from grr.lib.... | |
""" The aim of this file is to contain all the functions
and the main which have to do with emotion recognition, especially
with the Kanade and Multi PiE databases. Note that the versions of both databases I used
the faces were already aligned. Those databases are not publicly available. """
__author__ = "Mihaela Rosc... | |
import uuid
from . import TestController
from sword2 import Connection, Entry, Error_Document, Atom_Sword_Statement, Ore_Sword_Statement
from sword2.compatible_libs import etree
PACKAGE = "tests/databank/example.zip"
PACKAGE_MIME = "application/zip"
SSS_URL = "http://localhost:5000/swordv2/service-document"
SSS_UN = "... | |
#!/usr/bin/env python
# Source: http://code.activestate.com/recipes/475116/, with
# modifications by Daniel Dunbar.
import sys, re, time
class TerminalController:
"""
A class that can be used to portably generate formatted output to
a terminal.
`TerminalController` defines a set of instance va... | |
"""Support for TPLink lights."""
import asyncio
from datetime import timedelta
import logging
import time
from typing import Any, Dict, NamedTuple, Tuple, cast
from pyHS100 import SmartBulb, SmartDeviceException
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
... | |
from direct.directnotify import DirectNotifyGlobal
import random
MAX_PLAYERS_PER_HOLE = 4
GOLF_BALL_RADIUS = 0.25
GOLF_BALL_VOLUME = 4.0 / 3.0 * 3.14159 * GOLF_BALL_RADIUS ** 3
GOLF_BALL_MASS = 0.5
GOLF_BALL_DENSITY = GOLF_BALL_MASS / GOLF_BALL_VOLUME
GRASS_SURFACE = 0
BALL_SURFACE = 1
HARD_SURFACE = 2
HOLE_SURFACE = 3... | |
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `slices` module."""
import numpy as np
import pytest
import xarray as xr
from metpy.interpolate import cross_section, geodesic, interpolate_to_slice
from metpy.testing ... | |
import os
import gzip
import time
import pickle
import operator
import collections
import itertools
import numpy as np
from scipy.misc import logsumexp
import matplotlib.pyplot as plt
from hips.plotting.layout import create_axis_at_location, create_figure
import brewer2mpl
from pgmult.lds import MultinomialLDS
from ... | |
class A:
def foo():
result = type(message)("")
# Don't merge multiline (e.g. triple-quoted) strings.
def foo():
query = (
"""SELECT xxxxxxxxxxxxxxxxxxxx(xxx)"""
""" FROM xxxxxxxxxxxxxxxx WHERE xxxxxxxxxx AND xxx <> xxxxxxxxxxxxxx()""")
# There was a bug where tuples were being identif... | |
# -*- coding: utf-8 -*-
import os
from io import TextIOWrapper
__author__ = "Arijit Basu"
__email__ = "sayanarijit@gmail.com"
__homepage__ = "https://github.com/sayanarijit/expandvars"
__description__ = "Expand system variables Unix style"
__version__ = "v0.9.0" # Also update pyproject.toml
__license__ = "MIT"
__all... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# MLN Query Tool
#
# (C) 2012-2015 by Daniel Nyga
# 2006-2011 by Dominik Jain
#
# 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... | |
#
# 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 Tesora, 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 ... | |
import unittest
import os
import numpy as np
import pytest
import scipy
import deepchem as dc
from deepchem.data import NumpyDataset
from deepchem.models import GraphConvModel, DAGModel, WeaveModel, MPNNModel
from deepchem.molnet import load_bace_classification, load_delaney
from deepchem.feat import ConvMolFeaturizer... | |
import unittest
import numpy as np
import chainer
from chainer import cuda
from chainer import testing
from chainer.testing import attr
import six
class Constant(chainer.Function):
def __init__(self, outputs):
self.outputs = outputs
def forward_cpu(self, inputs):
return self.outputs
... | |
#!/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.
"""Tests for jni_generator.py.
This test suite contains various tests for the JNI generator.
It exercises the low-level parser all... | |
# Copyright 2018 The Oppia 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 applicable ... | |
"""
Training costs for unsupervised learning of energy-based models
"""
import functools
from itertools import izip
import logging
import numpy as np
import sys
from theano.compat.python2x import OrderedDict
from theano import scan
import theano.tensor as T
from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin
... | |
################################################################################
# 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... | |
# coding: utf-8
#
# Copyright 2013 Red Hat, 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
#
# ... | |
# -*- coding: utf-8 -*-
import datetime
import json
from .common import *
from oss2 import to_string
class TestBucketVersioning(OssTestCase):
def setUp(self):
OssTestCase.setUp(self)
self.endpoint = OSS_ENDPOINT
def test_bucket_versioning_wrong(self):
from oss2.models import Bucke... | |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
$ python... | |
# 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
"""Provides vectorization of graphs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import joblib
import networkx as nx
import math
import numpy as np
from sklearn import metrics
from sklearn.cluster import MiniBatchKMeans
from sci... | |
"""
Microsoft Document summaries structures.
Documents
---------
- Apache POI (HPSF Internals):
http://poi.apache.org/hpsf/internals.html
"""
from lib.hachoir_parser import HachoirParser
from lib.hachoir_core.field import (FieldSet, ParserError,
RootSeekableFieldSet, SeekableFieldSet,
Bit, Bits, NullBits,... | |
# 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... | |
import sys
if sys.version_info >= (2, 7):
import unittest
else:
import unittest2 as unittest
import os
import time
import shutil
import commands
from configuration import FEDERATION
if FEDERATION.LOCAL_IRODS_VERSION < (4, 1, 0):
import lib_pre410 as lib
else:
import lib
SessionsMixin = lib.make_session... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | |
import functools
import unittest
import itertools
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def _skip_if(cond, reason):
"""Skip test if cond(self) is True"... | |
from __future__ import absolute_import
import types
import weakref
from collections import deque
from . import config
from .util import decorator
from .. import event, pool
import re
import warnings
class ConnectionKiller(object):
def __init__(self):
self.proxy_refs = weakref.WeakKeyDictionary()
... | |
""" parquet compat """
from distutils.version import LooseVersion
from warnings import catch_warnings
from pandas.compat import string_types
from pandas.errors import AbstractMethodError
from pandas import DataFrame, get_option
from pandas.io.common import get_filepath_or_buffer, is_s3_url
def get_engine(engine):... | |
import ast
import copy
import json
import logging
import uuid
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from django.db.models import F
from django.db.models import Max
from d... | |
# 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 ag... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# -*- coding: utf-8 -*-
"""
profiling.__main__
~~~~~~~~~~~~~~~~~~
The command-line interface to profile a script or view profiling results.
.. sourcecode:: console
$ profiling --help
"""
from __future__ import absolute_import
from datetime import datetime
from functools import partial, wraps
impo... | |
# -*- coding: ISO-8859-1 -*-
# std library
# custom
from DataTypeConverters import readBew
from DataTypeConverters import toBytes
# uhh I don't really like this, but there are so many constants to
# import otherwise
from constants import *
class EventDispatcher:
def __init__(self, outstream):
... | |
"""
This module contains the high-level functions to access the library.
Care is taken to make this as pythonic as possible and hide as many of the gory
implementations as possible.
This module provides "syntactic sugar" around the lower-level, but almost
identical, module :py:mod:`puresnmp.api.raw`.
The "raw" modul... | |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | |
import numpy as np
import scipy.sparse
from collections import defaultdict
from scipy import stats
import ncut
import sklearn.metrics.pairwise
import time
import matplotlib.pyplot as plt
import time
def reindex_W_with_classes(W,C):
"""
Function that reindexes W according to communities/classes
Usag... | |
"""This module can be used for finding similar code"""
import re
import rope.refactor.wildcards
from rope.base import codeanalyze, evaluate, exceptions, ast, builtins
from rope.refactor import (patchedast, sourceutils, occurrences,
wildcards, importutils)
class BadNameInCheckError(exceptio... | |
from __future__ import absolute_import
from celery import shared_task
import datetime
from api.ecs_api import EcsApi
from api.vpc_api import VpcApi
import log.log as log
from time import sleep
from account.models import Account
from ecs.models import Ecs
def sync_ecs_north():
try:
account_data = Account.ob... | |
# Copyright 2020 The Cirq Developers
#
# 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 ... | |
#
# 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... | |
from promise import Promise
from graphql import graphql
from graphql.type import (
GraphQLSchema,
GraphQLObjectType,
GraphQLInt,
GraphQLField,
GraphQLInputObjectField
)
from ..mutation import mutation_with_client_mutation_id
class Result(object):
def __init__(self, result, clientMutationId=... | |
import json
from datetime import datetime
import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.event_type import EventType
from consts.playoff_type import PlayoffType
from datafeeds.parsers.fms_api.fms_api_match_parser import FMSAPIHybridScheduleParser
from helpe... | |
#------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions d... | |
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtCore, QtGui
import weakref
from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject
import pyqtgraph.functions as fn
from pyqtgraph.Point import Point
#from PySide import QtCore, QtGui
from .eq import *
class Terminal(object):
def __init__(self, node, nam... | |
# 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... | |
from __future__ import unicode_literals
import os
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse, clear_url_caches
from django.test import TestCase
from django.test.utils import override_settings
from django.template import Template, Context
from django.utils._os ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.