gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from multiprocessing import Process, Queue
import sys
import os
from couchdbkit import ResourceNotFound, ResourceConflict
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from http_parser.http import ParserError
from restkit import RequestError
from corehq.apps.domain.m... | |
import cPickle as pickle
import os
import shutil
import sys
import warnings
import rope.base.fscommands
from rope.base import exceptions, taskhandle, prefs, history, pycore, utils
from rope.base.resourceobserver import *
from rope.base.resources import File, Folder, _ResourceMatcher
class _Project(object):
def ... | |
'''
Determine optimum aperture and use Source Extractor to get photometry
'''
import sys
import os
from subprocess import call, Popen, PIPE
import glob
import math
import numpy as np
import Sources
import Quadtree
import createSexConfig
import createSexParam
import findBestAperture
import calcZeropoint
import makeRegi... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | |
"""
simple, elegant templating
(part of web.py)
Template design:
Template string is split into tokens and the tokens are combined into nodes.
Parse tree is a nodelist. TextNode and ExpressionNode are simple nodes and
for-loop, if-loop etc are block nodes, which contain multiple child nodes.
Each node can emit som... | |
from kqml import KQMLList, KQMLString
from tfta.tfta import TFTA
from tfta.tfta_module import TFTA_Module
from bioagents.tests.util import ekb_from_text, ekb_kstring_from_text, \
get_request, agent_clj_from_text
from bioagents.tests.integration import _IntegrationTest, _FailureTest
from... | |
#!/usr/bin/env python
#
# $Id: check_disabled_tests.py 9317 2011-06-10 02:09:04Z nathan_george $
#
# Proprietary and confidential.
# Copyright $Date:: 2011#$ Perfect Search Corporation.
# All rights reserved.
#
import os
import sys
buildscriptDir = os.path.dirname(__file__)
buildscriptDir = os.path.abspath(os.path.join... | |
#!/usr/bin/env python
from .. import exceptions as exc
from ..traitlets import Float, Int, Instance, AfgenTrait
from ..decorators import prepare_rates, prepare_states
from ..base_classes import ParamTemplate, StatesTemplate, RatesTemplate, \
SimulationObject
from .nutrients import NPK_Translocation
from .nutrient... | |
# -*- coding: utf-8 -*-
#
# This file is part of couchapp released under the Apache 2 license.
# See the NOTICE for more information.
from __future__ import with_statement
import base64
import copy
from hashlib import md5
import logging
import os
import os.path
from couchapp.errors import AppError
from couchapp imp... | |
from __future__ import absolute_import
import os
import six
import sys
import boto
import json
import random
from .. import views, feeds
from django.db import models
from .. import static_views
from django.conf import settings
from .. import models as bmodels
from django.http import HttpResponse
from django.core.manage... | |
# Filename: test_evt.py
# pylint: disable=locally-disabled,C0111,R0904,C0301,C0103,W0212
from io import StringIO
from os.path import join, dirname
import numpy as np
from km3pipe.testing import TestCase, skip, data_path
from km3pipe.io.evt import EvtPump, EVT_PARSERS
__author__ = "Tamas Gal"
__copyright__ = "Copyri... | |
# -*- coding: utf-8 -*-
'''
Jinja loading utils to enable a more powerful backend for jinja templates
'''
# Import python libs
from os import path
import logging
import json
import pprint
from functools import wraps
# Import third party libs
from jinja2 import BaseLoader, Markup, TemplateNotFound, nodes
from jinja2.e... | |
from typing import Optional, TextIO, Dict, Any, List
from sys import stdout
from fragment_capping.config import ILP_SOLVER_TIMEOUT
from fragment_capping.helpers.types_helpers import Atom, MIN, MAX
from fragment_capping.helpers.parameters import MAX_ABSOLUTE_CHARGE, MIN_ABSOLUTE_CHARGE, MAX_NONBONDED_ELECTRONS, MAX_BON... | |
from collections import defaultdict
import numpy as np
import torch
from numpy.random import choice, random
from scipy.sparse import csr_matrix
from metal.multitask.task_graph import TaskHierarchy
from synthetic.words1k import vocab1k
def singletask_synthetic(n, m, k, **kwargs):
data = SingleTaskTreeDepsGenerat... | |
# -*- coding: utf-8 -*-
import numpy as np
import cantera as ct
import pandas as pd
import re
import warnings
import copy
###################################
# 3b. output data analysis
###################################
def branching_ratios(df, solution, compound, production = False):
"""
This method looks at... | |
"""Panda package management
Usage:
pkgpanda activate <id>... [options]
pkgpanda swap <package-id> [options]
pkgpanda active [options]
pkgpanda fetch --repository-url=<url> <id>... [options]
pkgpanda add <package-tarball> [options]
pkgpanda list [options]
pkgpanda remove <id>... [options]
pkgpanda setup... | |
#!/usr/bin/env python
"""Parsers for Linux PAM configuration files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
import re
from future.builtins import zip
from grr_response_core.lib import parsers
from grr_response_core.lib import utils
f... | |
import os
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Registry',
'Author': ['@mattifestation', '@harmj0y'],
'Description': ('Persist a stager (or script) via the HKLM:SOFTWARE\Microsoft\Windows\C... | |
import contextlib
import datetime
import mock
import os
import subprocess
from flask_migrate import upgrade
import pytest
from responses import RequestsMock
import sqlalchemy
from app.main.models import User
from app.config import SQLALCHEMY_DATABASE_URI
from app.extensions import db as _db, user_datastore
from app.f... | |
#!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
"""
Example use of Forward Mo... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from collections import defaultdict
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
from dj... | |
# Adopted from https://github.com/airaria/TextBrewer
# Apache License Version 2.0
import torch
import torch.nn.functional as F
from hanlp_common.configurable import AutoConfigurable
def kd_mse_loss(logits_S, logits_T, temperature=1):
'''
Calculate the mse loss between logits_S and logits_T
:param logit... | |
# 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 re
import datetime
from collections import defaultdict
import dateutil.parser
import pytz
from django import forms
from django.db.models import Count
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.utils.timezone import utc
from django.utils.safestring import mar... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# Copyright 2012 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 agree... | |
#!/usr/bin/env python
"""Implementation of various cryptographic types."""
import binascii
import hashlib
import logging
import os
from typing import Text
from cryptography import exceptions
from cryptography import x509
from cryptography.hazmat.backends import openssl
from cryptography.hazmat.primitives import ciphe... | |
#!/usr/bin/env python
# vim: sw=4 ts=4 et smarttab encoding=UTF-8
from __future__ import print_function
import sys, subprocess, shlex
from copy import deepcopy
BLACK, R, G, Y, B, M, C = ["\x1b[3"+str(x)+"m" for x in range(0, 7)]
N = "\x1b[0m"
class Regs(object):
valids = (['rax', 'rbx', 'rcx', 'rdx', 'rdi', 'rs... | |
# RiveScript-Python
#
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# https://www.rivescript.com/
from __future__ import unicode_literals
import copy
class SessionManager(object):
"""Base class for session management for RiveScript.
The session manager keeps ... | |
# Copyright 2011 Justin Santa Barbara
# Copyright 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/l... | |
# python 2
from __future__ import absolute_import, unicode_literals
from builtins import bytes
# builtins
from unittest import TestCase, main
import sys
from io import StringIO
import os
# custom
from blowdrycss.utilities import unittest_file_path, delete_file_paths
import blowdrycss.blowdry as blowdry
import blowdryc... | |
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | |
"""Core views, including the main homepage, post-commit build hook,
documentation and header rendering, and server errors.
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import NoReverseMatch, reverse
from django.conf import settings
from django.http import HttpResponse, HttpResponseRed... | |
# Python
import json
# Django
from django.core.urlresolvers import reverse
# AWX
from awx.main.models import * # noqa
from awx.main.tests.base import BaseTest, QueueStartStopTestMixin
__all__ = ['SurveyPasswordRedactedTest']
PASSWORD="5m/h"
ENCRYPTED_STR='$encrypted$'
TEST_PLAYBOOK = u'''---
- name: test success
... | |
#!/usr/bin/python
import sys, getopt
from random import random
verbose = False
output = sys.stdout
from encode import *
def generateSequences(number=1, means = [0.1, 0.3, 0.5, 0.7, 0.9], meanBlockLength=1000, sdBlockLength=200, regLength=100000):
from random import gauss as normal
for i in xrange(1,number... | |
# 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
# --------------------------------------------------------------------------
# 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 ... | |
# Copyright (c) 2016-present, Facebook, 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... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from django.db.models import IntegerField, FloatField
from django.db.models.functions import Cast
from django_filters import filters
from rest_framework_datatables.django_filters.filterset import DatatablesFilterSet
from rest_framework import serializers
from .models import AnalyzedExperiment
class AnalyzedExperimentF... | |
from mongoengine import *
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.hashers import make_password, check_password
from django.contrib.auth.models import _user_has_perm, _user_get_all_permissions, _user_has_module_perms
from django.contrib.contenttypes.models import Conten... | |
from django.core.files.uploadedfile import SimpleUploadedFile
import mock
from nose.tools import eq_
from mkt.comm.forms import CommAttachmentFormSet
from mkt.comm.tests.test_views import AttachmentManagementMixin
from mkt.comm.utils import create_comm_note
from mkt.constants import comm
from mkt.site.tests import Te... | |
# 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... | |
### Read from F24 files and construct EventStatistic models
import utils.xmls as xml_utils
import datetime
import os
import time
from teams.models import Team
from games.models import Game
from players.models import Player
from eventstatistics.models import EventStatistic
from qualifiers.models import Qualifier
from ... | |
import os
import logging
import json
from djpcms import forms
from djpcms.forms import form_kwargs
from djpcms.utils import force_str
from djpcms.utils.text import capfirst, nicename
from djpcms.utils.formjson import form2json
_plugin_dictionary = {}
_wrapper_dictionary = {}
def ordered_generator(di):
cmp = lam... | |
"""Tests for the Start.ca sensor platform."""
import asyncio
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.sensor.startca import StartcaData
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@asyncio.coroutine
def test_capped_setup(hass, aioclient_mock)... | |
# 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 appl... | |
"""
States for managing zpools
:maintainer: Jorge Schrauwen <sjorge@blackdot.be>
:maturity: new
:depends: salt.utils.zfs, salt.modules.zpool
:platform: smartos, illumos, solaris, freebsd, linux
.. versionadded:: 2016.3.0
.. versionchanged:: 2018.3.1
Big refactor to remove duplicate code, better t... | |
"""
This module contains the basic event types used in SimPy.
The base class for all events is :class:`Event`. Though it can be directly
used, there are several specialized subclasses of it.
.. autosummary::
~simpy.events.Event
~simpy.events.Timeout
~simpy.events.Process
~simpy.events.AnyOf
~simp... | |
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# Copyright 2012 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | |
#
# 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... | |
"""
Hard-coded tic-tac-toe.
author: Jyler
date: 2018/01/06
Before starting reinforcement learning, where we can make a program learn
how to play tic-tac-toe itself, let's start by hard-coding the rules.
"""
import random
class tictactoeBoard():
def __init__(self):
self.boardState = {
1:" ",
2:... | |
# 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 ... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | |
import logging
import os
import sys
import json
import re
import tempfile
import shutil
import glob
import textwrap
from abc import ABCMeta
try:
JSONDecodeError = json.decoder.JSONDecodeError
except AttributeError:
JSONDecodeError = ValueError
import pyp2rpm.exceptions as exc
import pyp2rpm.logger
from pyp2rpm... | |
#
# 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
# ... | |
from durable.lang import *
import math
import datetime
import json
_fact_count = 0
def create_and_post(host, fact):
global _fact_count
fact['id'] = _fact_count
fact['sid'] = 1
host.post('waltzdb', fact)
_fact_count += 1
def create_and_assert(host, fact):
global _fact_count
fact['id'] = _fa... | |
import collections
import json
import mock
import pytest
from mock import patch
from restea import errors
from restea import formats
from restea import fields
from restea.resource import Resource
def create_resource_helper(
method='GET',
headers={},
data=None,
formatter=None
):
request = mock.Mo... | |
from .plugin import SimStatePlugin
class SimStateLibc(SimStatePlugin):
"""
This state plugin keeps track of various libc stuff:
"""
#__slots__ = [ 'heap_location', 'max_str_symbolic_bytes' ]
LOCALE_ARRAY = [
b"\000\000", b"\000\000", b"\000\000", b"\000\000", b"\000\000", b"\000\000", # ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.tests.helper import assert_quantity_allclose
from numpy.ma import is_masked
from ... import jplhorizons
@pytest.mark.remote_data
class TestHorizonsClass:
def test_ephemerides_query(self):
# check values of Ceres... | |
from collections import defaultdict
from typing import Dict
import click
import yaml
from cumulusci.core.utils import process_list_arg, process_bool_arg
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
from cumulusci.core.exceptions import TaskOptionsError
class GenerateMapping(BaseSalesforceApiTask):
... | |
# Generated from /home/marisa/Work/tvm/python/tvm/relay/grammar/Relay.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3*")
... | |
# 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 ... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
from pylib import constants
from pylib import ports
from pylib.base import test_run
from pylib.device import device_errors
from py... | |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT t... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-16 23:12:48
import sys
import inspect
import functools
import fractions
import six
from six import add_metaclass, iteritems
from pyspider.libs.lo... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
#!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | |
import itertools
import pytest
from diofant import (Add, Eq, Function, Idx, ImmutableDenseMatrix,
ImmutableSparseMatrix, IndexedBase, Matrix, MatrixSymbol,
MutableDenseMatrix, MutableSparseMatrix, O, Piecewise,
Pow, Rational, RootOf, Subs, Symbol, Tuple, ... | |
# -*- coding: utf-8 -*-
"""Plist_interface contains basic interface for plist plugins within Plaso.
Plist files are only one example of a type of object that the Plaso tool is
expected to encounter and process. There can be and are many other parsers
which are designed to process specific data types.
PlistPlugin def... | |
"""The tests for the geojson platform."""
import datetime
from asynctest.mock import patch, MagicMock, call
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.nsw_rural_fire_service_feed.geo_location import (
ATTR_EXTERNAL_I... | |
# Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
from tempfile import mktemp
import os
import shlex
import... | |
import email.mime.text
import hashlib
import json
import math
import os
import smtplib
import cherrypy
import azureutil
import util
import v2.main
class Confirm:
@util.expose
@util.db
def index(self, cursor=None, venue_id=None, user_id=None, hashd=None,
**kwargs):
if not venue... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Infer testing data with rules from training datapre
"""
import os, json, random
import numpy
from bs4 import BeautifulSoup
if __name__ == '__main__':
current_dir = os.path.dirname(__file__)
trial_dir = os.path.join(current_dir, 'trial')
input_dir = os.path.j... | |
# 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... | |
# Copyright (c) 2009 Alexandre Quessy, Arjan Scherpenisse
# See LICENSE for details.
"""
Tests for txosc/async.py
Maintainer: Arjan Scherpenisse
"""
from twisted.trial import unittest
from twisted.internet import reactor, defer, task
from txosc import osc
from txosc import async
from txosc import dispatch
class Cl... | |
# Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Parser for Unicode data files (as distributed by unicode.org)."""
import os
import re
import urllib2
# Directory or URL where Unicode tables reside.
_UNICOD... | |
# Copyright 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
"""
Milton Orlando Sarria Paja
USC
Kinect and camera use
"""
import sys, os, random
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import numpy as np
import matplotlib.pyplot as ... | |
import sys, os, time, json, datetime, errno, stat, getpass, requests, pprint
if sys.version_info[0] < 3: import urlparse
else: import urllib.parse as urlparse
import h2o
debug_rest = False
verbosity = 0 # 0, 1, 2, 3
pp = pprint.PrettyPrinter(indent=4) # pretty printer for debugging
def setVerbosity(level):
glob... | |
import collections
import gzip
import logging
import socket
from tornado.ioloop import IOLoop
from tornado.simple_httpclient import SimpleAsyncHTTPClient, _DEFAULT_CA_CERTS
from tornado.test.httpclient_test import HTTPClientCommonTestCase, ChunkHandler, CountdownHandler, HelloWorldHandler
from tornado.testing import... | |
import scipy as SP
import numpy as NP
import scipy.linalg as LA
import scipy.optimize as opt
import scipy.stats as ST
import scipy.special as SS
from fastlmm.util.mingrid import *
from fastlmm.util.util import *
import time
import warnings
import logging
class LMM(object):
"""
linear mixed model with up to two... | |
"""Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from ..utils import check_random_state
from ..utils.arpack import eigsh
from ..utils.validation import check_is_fitted
from ..exceptions import NotFittedErro... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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/lice... | |
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Andrew Dykstra <andrew.r.dykstra@gmail.com>
# Mads Jensen <mje.mads@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from copy import deepcopy
import warnings
import ... | |
# Copyright 2013 Google Inc. All Rights Reserved.
"""Creates a new Cloud SQL instance."""
import argparse
import logging
from googlecloudapis.apitools.base import py as apitools_base
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions... | |
import mptt
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.db.models import Q
from django.contrib.auth import models as auth_models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core import urlresolvers
from filer.m... | |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... | |
# sympy/galgebra/tests/test_ga.py
"""
The reference D&L is "Geometric Algebra for Physicists" by Doran and Lasenby
"""
from sympy.core import expand, Rational, S, Symbol, symbols
from sympy.functions import sin, cos
from sympy.galgebra.ga import MV, Nga, Com
from sympy.galgebra.printing import GA_Printer
from sympy.m... | |
"""
Oracle database backend for Django.
Requires cx_Oracle: http://www.python.net/crew/atuining/cx_Oracle/
"""
import os
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures, BaseDatabaseOperations, util
from django.db.backends.oracle import query
from django.utils.datastructures import SortedDic... | |
# Copyright (c) 1998-2000 John Aycock
#
# 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 typing import Callable, List, Union
import numpy as np
import bottleneck as bn
INT_DTYPES = [np.int64, np.int32]
FLOAT_DTYPES = [np.float64, np.float32]
DTYPES = tuple(FLOAT_DTYPES + INT_DTYPES)
def get_functions(
module_name: str, as_string: bool = False
) -> List[Union[str, Callable[[np.array], Union[in... | |
from typing import Any
from typing import Callable
from typing import Iterator
from typing import List
from typing import Type
from typing import TYPE_CHECKING
from typing import Union
from alembic import util
from alembic.operations import ops
if TYPE_CHECKING:
from alembic.operations.ops import AddColumnOp
... | |
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of... | |
''' Implements the often needed split, map, combine paradigm '''
from __future__ import division
import os
import shutil
import tempfile
from collections import Iterable
from multiprocessing import Pool, cpu_count
import dill
import numpy as np
import tables as tb
def apply_async(pool, fun, args=None, **kwargs):
... | |
'''
whooshalchemy flask extension
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds whoosh indexing capabilities to SQLAlchemy models for Flask
applications.
:copyright: (c) 2012 by Karl Gyllstrom
:license: BSD (see LICENSE.txt)
'''
from __future__ import with_statement
from __future__ import absolute_imp... | |
import unittest
from multiprocessing import Process
import requests
import json
import time
from ..exchange import Exchange
from ..config import DefaultConfig
from ..auth import Auth
from ..error import TimeoutError,ResponseError
from grabbag.list import first_not_none
from grabbag.dict import merge
TEST_METHODS = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.