gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from datetime import datetime
import re
from tower import ugettext_lazy as _
# Add-on and File statuses.
STATUS_NULL = 0
STATUS_UNREVIEWED = 1
STATUS_PENDING = 2
STATUS_NOMINATED = 3
STATUS_PUBLIC = 4
STATUS_DISABLED = 5
STATUS_LISTED = 6
STATUS_BETA = 7
STATUS_LITE = 8
STATUS_LITE_AND_NOMINATED = 9
STATUS_PURGATORY... | |
from __future__ import division, print_function, absolute_import
import numpy.testing as npt
import numpy as np
from scipy._lib.six import xrange
import pytest
from scipy import stats
from .common_tests import (check_normalization, check_moment, check_mean_expect,
check_var_expect, check_sk... | |
# Copyright (c) 2014 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... | |
#! /usr/bin/env python
# $Header$
'''Compound typecodes.
'''
from ZSI import _copyright, _children, _child_elements, \
_inttypes, _stringtypes, _seqtypes, _find_arraytype, _find_href, \
_find_type, _find_xmlns_prefix, _get_idstr, EvaluateException, \
ParseException
from TC import _get_element_nsuri_na... | |
"""
.. _tut_io_export_pandas:
=================================
Export epochs to Pandas DataFrame
=================================
In this example the pandas exporter will be used to produce a DataFrame
object. After exploring some basic features a split-apply-combine
work flow will be conducted to examine the laten... | |
import sys
import os
import io
import psycopg2
import xml.etree.ElementTree as ET
from lxml import etree
import math
from collections import Counter
from operator import itemgetter
import datetime
import nltk
import collections
#For use in reading LGL test sets
def block(ch):
'''
Return the Unicode block nam... | |
# Copyright 2010-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... | |
from django.apps.registry import Apps
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from django.db.migrations.exceptions import InvalidBasesError
from django.db.migrations.operations import (
AddField, AlterField, DeleteModel, RemoveField,
)
from django.db.migrations.... | |
"""
Simplifying the evaluation of a model. Multiple attacks are initialized and
run against a model at every evaluation step.
"""
import logging
import tensorflow as tf
from cleverhans.utils_tf import model_eval
from cleverhans.attacks import FastGradientMethod
from cleverhans.attacks import MadryEtAl
from attacks_m... | |
# -*- coding: utf-8 -*-
import sys
import re
from .input import Input
class ArgvInput(Input):
def __init__(self, argv=None, definition=None):
super(ArgvInput, self).__init__(definition)
if argv is None:
argv = sys.argv[:]
argv.pop(0)
self.__tokens = argv
s... | |
"""
The `ModelSerializer` and `HyperlinkedModelSerializer` classes are essentially
shortcuts for automatically creating serializers based on a given model class.
These tests deal with ensuring that we correctly map the model fields onto
an appropriate set of serializer fields for each case.
"""
from __future__ import ... | |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated with protoc 3.10.0 - different (older/newer) versions might not be compatible
# source: site_data.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descri... | |
# Copyright (c) 2014 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
#
# Unless require... | |
# Values are in big endian
# Data block width 34 byte (4 blocks each second = one slot update each second)
import struct
import time
import signal
import threading
SERIAL = "/dev/ttyUSB0"
CSV_OUTPUT = "output.csv"
# Open serial device for reading
fp = open(SERIAL, "rb")
# Synchronize
print "Synchronizing..."
syn... | |
"""Handler for request validation"""
import warnings
import os
import sys
import datetime
import base64
import six
from six.moves.urllib_parse import urlparse
from six.moves.urllib.request import urlopen
from six.moves.urllib_error import HTTPError
from cryptography import x509
from cryptography.hazmat.backends impor... | |
"""
Filename: plot_hemispheric_heat_barchart.py
Author: Damien Irving, irving.damien@gmail.com
Description: Plot barchart comparing heat uptake/storage in either hemisphere
"""
# Import general Python modules
import sys, os, pdb
import re
import argparse
import itertools
import matplotlib.pyplot as plt
im... | |
import keyword
import re
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.models.constants import LOOKUP_SEP
class Command(BaseCommand):
help = "Introspects the database tables in the given database and outputs a Django model mod... | |
"""
My own variation on function-specific inspect-like features.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import itertools
import inspect
import warnings
import os
def get_func_code(func):
""" Attempts to retrieve... | |
from lightbulb.core.base import options_as_dictionary
from lightbulb.core.utils.httphandler import HTTPHandler
from lightbulb.core.utils.common import findlibrary
from collections import OrderedDict
from lightbulb.core.modules.sfadiff import SFADiff
from symautomata.alphabet import createalphabet
from lightbulb.core.op... | |
# Copyright (c) 2012 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... | |
#!/usr/bin/python
import cv2
import numpy as np
import math
from numpy import linalg as LA
import Queue
def smaller(x,y):
"""This function does something.
:param name: The name to use.
:type name: str.
:param state: Current state to be in.
:type state: bool.
:returns: int -- the return code.
... | |
"""Misc utilities which did not find they way elsewhere."""
import sys
import os
import re
from os.path import join as pjoin, dirname as pdirname, basename as pbasename
import numscons
_CONFDIR = pjoin(pdirname(numscons.__file__), 'configurations')
# XXX: this is ugly, better find the mathlibs with a checker
# XX... | |
# Copyright (c) 2017 Yubico AB
# 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, this list of conditi... | |
#!/usr/bin/env python3
#
# Import all necessary libraries
#
import argparse
from lcrequest import LCRequest
#
# Define some global constants
#
VERSION= '0.1.0'
GRADES= map(chr, range(ord('A'), ord('G')+1))
# Lending Club API data structure keys
KEY_COUNT= 'count'
KEY_TOTAL= 'total'
KEY_NOTES= 'myNotes'
KEY_GRAD... | |
#!/usr/bin/env python3
"""
For the specified vcf and expression file, determine which genes are located within a
specific range from each variant. These are noted and their z-scores determined for
samples with vs without the variant.
Usage: python3 gene_expression.py -i <input.vcf> -e <expression.bed>
-ov <output.... | |
# client.py -- Implementation of the server side git protocols
# Copyright (C) 2008-2013 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2008 John Carr
#
# 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 F... | |
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from regressiontests.generic_views.models import Book
class ArchiveIndexViewTests(TestCase):
fixtures = ['generic-views-test-data.json']
urls = 'regressiontests.generic_views.urls'
def _make_books(se... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SomeClass, SomeOtherException, UTF8Class, setup
class FilterSyntaxTests(SimpleTestCase):
@setup({'filter-syntax01': '{{ var|upper }}'})
def test_filter_syntax01(self):
"""
Basic filter ... | |
""" Test script for the unicodedata module.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import sys
import unittest
import hashlib
import subprocess
import test.support
encoding = 'utf-8'
errors = 'surrogatepass'
### Run tests
class UnicodeMe... | |
# Copyright 2012 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... | |
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
# Copyright 2009-2020 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""Defines the "store" and its "fields" .
During startup, Lino instantiates a "store" and its "fields" (aka
"atomizers") for every table. These were used originally for dealing
with Sencha ExtJS GridPan... | |
# -*- coding: utf-8 -*-
# Django settings for layer zero pinax project.
import os.path
import posixpath
import pinax
PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
PYCON_YEAR = "2012"
# tells Pinax to use the default theme
PINAX_THEME = "defau... | |
import tkinter as tk
import math
from graph.graphIO import loadgraph
from graph.graphs import Graph, Vertex, Edge
from isomorphism import ColorRefinementChecker
from isomorphism.FastPartitionRefinement import FastPartitionRefinementChecker
from isomorphism.Mock import Partitioner
from isomorphism.SimulatingColorRefin... | |
# 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 frasco import (Feature, Service, action, signal, command, cached_property, expose,\
request_param, current_app, ServiceError, jsonify, lazy_translate)
from frasco_models import transaction, save_model
from suds.client import Client as SudsClient
from suds import WebFault
import requests
import ... | |
"""
cancel out the basic system load and replace it with a convex combination of bids
note: the demand_module (or some subsidiary module) may store calibration data
at the module level (not in the model), so this module should only be used with one
model at a time. An alternative approach would be to receive a calibr... | |
"""
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import platform
import sys
import warnings
def _setup_environment(environ):
# Cygwin requires some special voodoo to set the environm... | |
# Copyright 2021 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
# -*- coding: utf-8 -*-
__author__ = 'valerio cosentino'
from util.db_util import DbUtil
class BugzillaDao():
"""
This class handles the persistence and retrieval of Bugzilla issue tracker data
"""
def __init__(self, config, logger):
"""
:type config: dict
... | |
""" Generic file header helper.
This can be seen as a follow up of the struct module [1] or the
construct module [2].
[1]
[2] http://construct.readthedocs.io/en/latest
"""
import struct
# TODO: deprecate this header!
class Header:
""" Base header structure.
Inherit this class to define a file header.
... | |
import os
import random
import re
import socket
import subprocess
import sys
import threading
import time
import urllib.error
import urllib.parse
import urllib.request
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.protocols.basic import LineReceiver
from syncplay import constants, util... | |
# Copyright 2011-2012 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... | |
#
# Task.py -- Basic command pattern and thread pool implementation.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import absolute_import, print_function
from ..util import six
from ..util.six.moves import map, zip
import sys
import time... | |
from math import isnan
import itertools
import numpy as np
from PyQt4.QtGui import QTableView, QColor, QItemSelectionModel, \
QItemDelegate, QPen, QBrush, QItemSelection, QHeaderView
from PyQt4.QtCore import Qt, SIGNAL, QAbstractTableModel, QModelIndex, QSize
from Orange.data import Table, Variable, ContinuousVar... | |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HAssignmentInstance_UniqueAssignment_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HAssignmentInstance_UniqueAssignment_Isolated... | |
from io import StringIO
import json
import logging
import sys
import uuid
import csv
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
import atsd_client
from atsd_client.exceptions import SQLException
from atsd_client.services import SQLServ... | |
#!/usr/bin/env python
"""
BuildrecordsApi.py
Copyright 2015 Reverb Technologies, 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
... | |
#!/usr/bin/env python
from __future__ import print_function
import json
import click
import yaml
@click.group()
def cli():
pass
@click.command()
@click.option('--input-swagger-file', help='Path to input Swagger file.', required=True, type=click.File('rb'))
@click.option('--output-swagger-file', help='Path to ou... | |
"""
Tests for L{xquotient.mimepart}.
"""
import os
import email.quopriMIME
from StringIO import StringIO
from twisted.trial import unittest
from twisted.python import filepath
from epsilon import extime
from axiom.store import Store, AtomicFile
from xquotient import mimepart, smtpout
from xquotient.mimestorage imp... | |
from io import BytesIO
from unittest.mock import Mock
import pytest
from mitmproxy import exceptions
from mitmproxy.net.http import Headers
from mitmproxy.net.http.http1.read import (
read_request, read_response, read_request_head,
read_response_head, read_body, connection_close, expected_http_body_size, _get_... | |
#!/bin/env python
'''NCBI Gene Downloading Tool
This program downloads gene data from the ftp server and \
converts data to xml file by using linux.gene2xml tool.
This program checks the last modified time of the database in the server, \
when it tries to download the gene database from the server. \
If the same vers... | |
#!/opt/anaconda2/bin/python
# -*- coding: utf-8 -*-
"""
################################################################################
#
# Copyright (c) 2016 Wojciech Migda
# All rights reserved
# Distributed under the terms of the MIT license
#
####################################################################... | |
#!/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 mock
from django import test
from django.contrib.contenttypes.models import ContentType
from django.utils import unittest
from django.contrib.auth.models import User
from dynamic_rules import models as rule_models
from dynamic_validation import models
from dynamic_validation.tests.utils import get_violation
... | |
"""
Copyright 2017 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 or agreed to in writing, software
dis... | |
#!/usr/bin/env vpython
# Copyright 2018 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 argparse
import sys
import tempfile
import unittest
from pylib.utils import test_filter
class ParseFilterFileTest(unittest.Te... | |
# Copyright 2011 OpenStack Foundation
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | |
# Copyright 2012 SINA 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 app... | |
"""Helpers for components that manage entities."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Iterable
from datetime import timedelta
from itertools import chain
import logging
from types import ModuleType
from typing import Any
import voluptuous as vol
from homeassistant... | |
from .main import *
import hmac
import hashlib
# Electrum wallets
def electrum_stretch(seed):
return slowsha(seed)
# Accepts seed or stretched seed, returns master public key
def electrum_mpk(seed):
if len(seed) == 32:
seed = electrum_stretch(seed)
return privkey_to_pubkey(seed)[2:]
# Accepts... | |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... | |
from flask import request, url_for, session, g
from flask.ext.restful import Api, Resource
from collections import defaultdict
from functools import partial
from pocket_change import sqlalchemy_db
from itertools import chain
class RestfulApi(Api):
def __init__(self, *args, **kwargs):
super(R... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# script.py
#
# This file is modified from python-electrumlib.
#
"""Scripts
Functionality to build sc... | |
# coding: utf-8
# ## Apply Beta-sigma SNR estimates on the CRIRES Spectra
#
# Using the berved spectra
#
# Should compare weith berved masked but assume it will be small differences.
#
#
# In[147]:
from astropy.io import fits
import os
from PyAstronomy import pyasl
import matplotlib.pyplot as plt
import numpy ... | |
import os
from AlGDock import path_tools
from AlGDock.BindingPMF import DEBUG
from AlGDock.BindingPMF import HMStime
import time
import numpy as np
import MMTK
import MMTK.Units
from MMTK.ParticleProperties import Configuration
import multiprocessing
from multiprocessing import Process
# In APBS, minimum ratio of ... | |
"""Constraints definition for minimize."""
import numpy as np
from ._hessian_update_strategy import BFGS
from ._differentiable_functions import (
VectorFunction, LinearVectorFunction, IdentityVectorFunction)
from ._optimize import OptimizeWarning
from warnings import warn
from numpy.testing import suppress_warnings... | |
# 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 t... | |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2017 the HERA Collaboration
# Licensed under the 2-clause BSD license.
"""Handle weather data sourced from meerkat's katportalclient."""
import numpy as np
from astropy.time import Time
from math import floor, isnan
from sqlalchemy import Column, BigInteger, Float, St... | |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import namedtuple
import logging
import os
import numpy as np
from numpy.testing import assert_allclose
import pytest
from jax import device_put, disable_jit, grad, jit, random, tree_map
import jax.numpy as jnp
impo... | |
"""
sentry.web.frontend.teams
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from ... | |
"""
Some utilities for work with units of physical quantities.
"""
from __future__ import absolute_import
import six
from six.moves import range
try:
import sympy as sm
except ImportError:
sm = None
import numpy as nm
from sfepy.base.base import get_default, invert_dict, is_sequence, Struct
default_units_of_... | |
from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.db.models import F
from django.test import TestCase
from .models import Article, Author, Reference
class OrderingTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
... | |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1alpha1... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | |
"""HTTP library functions.
This module contains functions for building an HTTP application
framework: any one, not just one whose name starts with "Ch". ;) If you
reference any modules from some popular framework inside *this* module,
FuManChu will personally hang you up by your thumbs and submit you
to a public canin... | |
# 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 ... | |
# portfolio_value.py
'''
Software used:
http://wiki.quantsoftware.org/index.php?title=QSTK_License
Created on October 16, 2014
Updated on October 29, 2014
@author: James Corsini
@summary: Takes buy and sell data in csv format and outputs the portfolio's
value. Should be used in conjunction with portfolio_analyze.py t... | |
import viper.lexer as vl
import os
import pytest
from importlib import import_module
from typing import List, Type
###############################################################################
#
# INDIVIDUAL TOKENS
#
###############################################################################
def _test_singl... | |
#!/usr/bin/env python
import argparse
import calendar
import json
import logging
import os
import re
import string
import sys
import multiprocessing as mp
from datetime import datetime
from subprocess import PIPE, Popen
from pymongo import MongoClient, DESCENDING, ASCENDING
from _pybgpstream import BGPStream, BGPRec... | |
# Copyright (C) 2014-2015 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
# This file is shared:
# reprozip/reprozip/common.py
# reprounzip/reprounzip/common.py
"""Common functions between reprozip and reprounzip.
Th... | |
import concurrent.futures
import copy
import json
import mimetypes
import os
import re
import shutil
import tempfile
import time
import uuid
from urllib.parse import urljoin
from urllib.parse import urlparse
from urllib.request import url2pathname
import chardet
import requests
import selenium.webdriver.support.ui as ... | |
'''
Functions to compute fast distance covariance using mergesort.
'''
import warnings
from numba import float64, int64, boolean
import numba
import numpy as np
from ._utils import CompileMode, _transform_to_2d
def _compute_weight_sums(y, weights):
n_samples = len(y)
weight_sums = np.zeros((n_samples,) ... | |
# 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 ... | |
"""
clone - client-side Clone Pattern class
Author: Min RK <benjaminrk@gmail.com>
"""
import logging
import threading
import time
import zmq
from zhelpers import zpipe
from kvmsg import KVMsg
# If no server replies within this time, abandon request
GLOBAL_TIMEOUT = 4000 # msecs
# Server considered dead if si... | |
"""Entry point for the tej utility.
"""
from __future__ import unicode_literals
import argparse
import codecs
import functools
import locale
import logging
import sys
from tej import __version__ as tej_version
from tej.submission import DEFAULT_TEJ_DIR, Error, JobNotFound, RemoteQueue
logger = logging.getLogger('t... | |
# Author : Martin Luessi mluessi@nmr.mgh.harvard.edu (2012)
# License : BSD 3-clause
# Parts of this code were copied from NiTime http://nipy.sourceforge.net/nitime
from warnings import warn
import numpy as np
from scipy import fftpack, linalg
import warnings
from ..parallel import parallel_func
from ..utils import ... | |
from cornice.service import Service
from logging import getLogger
from os import path, system
from .. import nuimo_setup
# TODO: We better rename `config.path` to something else. Conflicts with `os.path`
from cornice.validators import colander_body_validator
# import colander
from ..config import path as service_path
... | |
#!/usr/bin/env python
"""Utils common to macOS and Linux."""
import io
import logging
import os
import threading
import time
from typing import Text
import psutil
import xattr
from google.protobuf import message
from grr_response_core import config
from grr_response_core.lib import rdfvalue
from grr_response_core.li... | |
import sublime, sublime_plugin, threading, re, os
from . import requests
from .requests.auth import HTTPBasicAuth
timeout = 20
verify = True
class CodiadDirectCommand(sublime_plugin.TextCommand):
def run(self, edit, action):
self.edit = edit
self.action = action
self.session = None
self.login = False... | |
# Copyright 2011 OpenStack LLC.
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | |
# -*- coding: utf-8 -*-
"""
A module for marshalling data in and out of redis and back into the python
data type we expect.
Used extensively in the `redpipe.keyspaces` module for type-casting keys and
values.
"""
import json
import re
import six
from .exceptions import InvalidValue
__all__ = [
'IntegerField',
... | |
# -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Asynchronous client DNS
The functions exposed in this module can be used for asynchronous name
resolution and dns queries.
If you need to create a resolver with specific requirements, s... | |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mptt.models import MPTTModel, TreeForeignKey
from django.db.models.loading import get_model
from Kraggne.fields import TemplateField, ContextNameValidator
from Kraggne.contrib.flatblocks.fields import JSONField
from Kraggne.parser... | |
import sys
import re
import gevent
import urlparse
from gevent.pywsgi import WSGIHandler
from socketio import transports
class SocketIOHandler(WSGIHandler):
RE_REQUEST_URL = re.compile(r"""
^/(?P<resource>.+?)
/1
/(?P<transport_id>[^/]+)
/(?P<sessid>[^/]+)/?$
""", re.X... | |
# -*- coding: utf-8 -*-
import plotly as plotly
from plotly.graph_objs import *
import networkx as nx
import json
import pickle
import numpy as np
from networkx.readwrite import json_graph
# Some useful plotting code (uses plotly)
# Should put this into a separate file
class VariationalLDAPlotter(object):
def __... | |
#!/usr/bin/env python
# Drag and Drop file converter.
import pygtk
pygtk.require('2.0')
import gtk
import gio
import sys
import magic
import urlparse
import os.path
class ToJPEG:
def __init__(self):
self.jpeg_quality = 80
self.delete_orig = True
self.icon_size = gtk.ICON_SIZE_BUTTON
self.window = None
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.