gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import shutil
import subprocess
import tempfile
import unittest
import git
import testutils
class TestChanges(unittest.TestCase):
def _output(self, command):
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return proc.communicate()[0].strip()
de... | |
# python -m unittest discover
import unittest
from datetime import datetime
from tasks.issue_score_calculator import ScoreCalculator
class TestScore(unittest.TestCase):
def test_each_contribution(self):
scorer = ScoreCalculator(data={
'contributors': [
{ 'login': 'user1', 'co... | |
# Copyright (c) 2014 Ahmed H. Ismail
# 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... | |
'''
Created on 11 May 2012
@author: Jeff
'''
import os
import unittest
from google.appengine.ext import testbed, ndb
from actions import register_new_user, get_profiles, _get_my_profile, \
NoUserException, ActionException, NoUserNameException, get_my_profile_name, \
set_playing, create_role
from model import... | |
from java.lang import String
import random
from threading import Timer
import math
#OPTIONS
faceRecognizer=False
joystick=False
randomMove=False
headTracking=True
lastName="christian"
leftPort="COM20"
rightPort="COM21"
webgui=Runtime.create("WebGui","WebGui")
webgui.autoStartBrowser(False)
webgui.startService()
#s... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
from the month of edge formation, find the SR before, at the time and after
"""
from collections import defaultdict
import codecs
import os
import json
import numpy as np
from igraph import *
IN_DIR = "../../../DATA/General/"
os.chdir(IN_DIR)
F_IN = "mention/edge_for... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved.
import torch
from torch.nn import functional as F
from maskrcnn_benchmark.layers import smooth_l1_loss
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_... | |
# -*- coding: utf-8 -*-
'''
Interaction with Mercurial repositories
=======================================
Before using hg over ssh, make sure the remote host fingerprint already exists
in ~/.ssh/known_hosts, and the remote host has this host's public key.
.. code-block:: yaml
https://bitbucket.org/example_user... | |
# Copyright 2013 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 pipes
import sys
import time
from telemetry.core import exceptions
from telemetry.core import forwarders
from telemetry.core import ut... | |
# Copyright (c) 2013 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 ... | |
import luigi
import subprocess
import glob
import os
from time import strftime, gmtime
#############################################################################################################
#This pipeline automates genome downloading and processing from CGHub. The bottom of the file is the head of the graph.
##... | |
# (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.modules.storage.netapp.netapp_e_iscsi_interface import IscsiInterface
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
__metaclass__ = type... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################
# Originally From https://github.com/mdipierro/kryten
# modified by fsp
# created by Massimo Di Pierro
# license: http://opensource.org/licenses/BSD-2-Clause
#
# Commands in shell:
# SPACE execute and next lin... | |
# -*- coding: utf-8 -*-
"""
Some utilities and common stuff for tests
"""
import os
from boussole.conf.model import Settings
from boussole.inspector import ScssInspector
from boussole.watcher import SassLibraryEventHandler, SassProjectEventHandler
class DummyBaseEvent(object):
"""
Dummy event base to pass to... | |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | |
# 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... | |
import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.paginator import Paginator, InvalidPage
from django.db import models
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts impor... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the conversion to/from astropy.table
"""
import io
import os
import pathlib
import pytest
import numpy as np
from astropy.config import set_temp_config, reload_config
from astropy.utils.data import get_pkg_data_filename, get_pkg_data_fileobj
fro... | |
#!/usr/bin/env python
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.model.meta
from frappe.model.dynamic_links import get_dynamic_link_map
import frappe.defaults
from frappe.utils.file_manager import remove_all
from fr... | |
#!/usr/bin/env python
import sys
try:
import json
except ImportError:
import simplejson as json
from optparse import OptionParser
import time
import logging
from twisted.words.protocols import irc
from twisted.internet import protocol, reactor
from twisted.web.server import Site
from twisted.web import server... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# The idea for this module (but no code) was borrowed from the
# quantities (http://pythonhosted.org/quantities/) package.
"""Helper functions for Quantity.
In particular, this implements the logic that determines scaling and resul... | |
#!/use/bin/env python2
from pwn import *
r = remote('140.112.31.96', 10120)
# warmup
r.recvuntil('= ')
m1 = r.recvline().rstrip('\n\r')
r.recvuntil(': ')
r.sendline(m1)
# round 1
# 1 -> a, 2 -> b ...
print 'Round 1'
r.recvuntil('c1 = ')
c1 = r.recvline().rstrip('\n\r')
r.recvuntil(': ')
m1 = []
for tok in c1.split... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Yahoo! 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... | |
from sympy.integrals.transforms import (mellin_transform,
inverse_mellin_transform, laplace_transform, inverse_laplace_transform,
fourier_transform, inverse_fourier_transform,
sine_transform, inverse_sine_transform,
cosine_transform, inverse_cosine_transform,
hankel_transform, inverse_hankel_transfo... | |
import io
import json
import tempfile
import zipfile
from uuid import uuid4
from django.core.files.uploadedfile import SimpleUploadedFile
from model_bakery import baker
from datetime import date, timedelta
from unittest.mock import patch, PropertyMock, Mock
from django.conf import settings
from django.contrib import ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import time
import json
from collections import defaultdict
import logging
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
from speech2text import log_kv
from text2stats import IBM_TRANSCRIPT_STATS_FILENAME, GOOGLE_TRAN... | |
#!/usr/bin/python
# Copyright (c) 2013 The Native Client 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 logging
import os
import platform
import subprocess
import sys
sys.path.append(os.path.join(os.path.dirnam... | |
#!/usr/bin/env python
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# Based on openvswitch agent.
#
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You ma... | |
# Copyright 2014 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 ... | |
import numpy as np
from scipy import ndimage as ndi
from ..measure import block_reduce
from ._geometric import (warp, SimilarityTransform, AffineTransform,
_convert_warp_input, _clip_warp_output,
_to_ndimage_mode)
def resize(image, output_shape, order=1, mode='consta... | |
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.mutable import MutableDict
from sqlalchemy.orm import sessionmaker, scoped_session, column_property, deferred
from sqlalchemy.sql.expression import and_
from sqlalchemy.ext.declarati... | |
# Copyright 2007-2009 by Peter Cock. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package..
"""Bio.SeqIO support for the "genbank" and "embl" file formats.
You are expected to use ... | |
# Natural Language Toolkit: Internal utility functions
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Steven Bird <[email protected]>
# Edward Loper <[email protected]>
# Nitin Madnani <[email protected]>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from... | |
# Generated from /Users/xudong/git/HTTPIDL/Grammar/HTTPIDL.g4 by ANTLR 4.7
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3")
... | |
import random
import unittest
from ..models import CaseData
from ..exceptions import PropertyExpectedException
from .fixtures import get_default_case_data
class TestCaseData(unittest.TestCase):
def test_total_income_calculation(self):
default_data = get_default_case_data(
you__income__earnings... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# Copyright (c) 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 functionality ... | |
# Copyright 2015 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
import io
import json
import pytest
import aiohttpretty
from waterbutler.core import streams
from waterbutler.core import exceptions
from waterbutler.providers.figshare import metadata
from waterbutler.providers.figshare import provider
from waterbutler.providers.figshare.path import FigsharePath
from waterbutler.pro... | |
import unicodedata
from collections import defaultdict
from itertools import zip_longest
from .porter import Stemmer
def _normalize(s):
return unicodedata.normalize("NFKD", s)
def _check_type(s):
if not isinstance(s, str):
raise TypeError("expected str or unicode, got %s" % type(s).__name__)
def l... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest
from sqlalchemy.exc import IntegrityError
from woodbox.access_control.record import And, Or, OpSwitch, IsOwner, IsUser1, HasRole, InRecordACL
from woodbox.db import db
from woodbox.models.record_acl_model... | |
"""Tests for the Roku component."""
from http import HTTPStatus
import re
from socket import gaierror as SocketGIAError
from homeassistant.components.roku.const import DOMAIN
from homeassistant.components.ssdp import (
ATTR_SSDP_LOCATION,
ATTR_UPNP_FRIENDLY_NAME,
ATTR_UPNP_SERIAL,
)
from homeassistant.cons... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# Copyright Kitware 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 t... | |
# Copyright (C) 2013 eNovance SAS <[email protected]>
#
# Author: Sylvain Afchain <[email protected]>
#
# 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.apach... | |
"""KDE of Temps."""
import calendar
from datetime import date, datetime
import pandas as pd
from pyiem.plot.util import fitbox
from pyiem.plot import figure
from pyiem.util import get_autoplot_context, get_sqlalchemy_conn
from pyiem.exceptions import NoDataFound
from matplotlib.ticker import MaxNLocator
from scipy.sta... | |
"""Applications models tests"""
from functools import reduce
from operator import or_, itemgetter
from unittest.mock import PropertyMock
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
import pytest
from django_fsm import Tra... | |
"""
A simple Python Geojson file reader and writer.
Author: Karim Bahgat, 2014
Contact: [email protected]
License: MIT License
"""
try:
import simplejson as json
except:
import json
class Geometry:
"""
A geometry instance.
Can be created from args, or without any to create an empty one... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# 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... | |
# Natural Language Toolkit: Combinatory Categorial Grammar
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Graeme Gange <[email protected]>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals
from nltk.compat import python_2_unicode_compatible
from n... | |
"""
Test suite for _osx_support: shared OS X support functions.
"""
import os
import platform
import stat
import sys
import unittest
from test.support import os_helper
import _osx_support
@unittest.skipUnless(sys.platform.startswith("darwin"), "requires OS X")
class Test_OSXSupport(unittest.TestCase):
def setU... | |
"""
pyText2Pdf - Python script to convert plain text files into Adobe
Acrobat PDF files.
Version 1.2
Author: Anand B Pillai <abpillai at lycos dot com>
Keywords: python, tools, converter, pdf, text2pdf, adobe, acrobat,
processing.
Copyright (C) 2003-2004 Free Software Foundation, Inc.
This file is... | |
"""
Spin-projected MP2
"""
import h5py
import numpy as np
import scipy.linalg as slg
from frankenstein import sgscf
from frankenstein.tools.spscf_utils import (sp2block, get_grid, get_Rbeta)
from frankenstein.tools.perf_utils import TIMER
from frankenstein.mp.romp2 import lorentz_regularization
from pyscf import sc... | |
# 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 a... | |
#!/usr/bin/env python
from __future__ import print_function, division, unicode_literals, absolute_import
import sys
import pytest
from espwrap.base import batch, MIMETYPE_HTML, MIMETYPE_TEXT
from espwrap.adaptors.noop import NoopMassEmail
if sys.version_info < (3,):
range = xrange
def generate_recipients(cou... | |
from coda.compiler import genbase
from coda import types
import os
import re
from abc import abstractmethod
reUpperFirst = re.compile('(.)([A-Z][a-z]+)')
reUpperRest = re.compile('([a-z0-9])([A-Z])')
def toUpperUnderscore(s):
s = reUpperFirst.sub(r'\1_\2', s)
return reUpperRest.sub(r'\1_\2', s).upper()
def getQ... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Document Library
@copyright: 2011-2016 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software wi... | |
import collections, re
import hindkit as k
from generate_GOADB import Glyph
DO_HACK_FOR_CORE_TEXT = True
DO_OUTPUT_INDIC1 = True
DO_OUTPUT_INDIC2 = True
DO_OUTPUT_USE = True
PREFIX = "dv"
def indent(line):
return " " + line
def comment(line):
return "# " + line
def add_prefix(name):
return PREFIX + n... | |
""" Tools for using spherical harmonic models to fit diffusion data
References
----------
Aganj, I., et. al. 2009. ODF Reconstruction in Q-Ball Imaging With Solid
Angle Consideration.
Descoteaux, M., et. al. 2007. Regularized, fast, and robust analytical
Q-ball imaging.
Tristan-Vega, A., et. al. 2010. A new me... | |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
# Python stdlib imports
import pytest
from openpyxl.compat import zip
# package imports
from .. named_range import split_named_range, NamedRange, NamedValue
from openpyxl.workbook.names.named_range import read_named_ranges
from openpyxl.utils... | |
#
# 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... | |
"""watershed.py - watershed algorithm
This module implements a watershed algorithm that apportions pixels into
marked basins. The algorithm uses a priority queue to hold the pixels
with the metric for the priority queue being pixel value, then the time
of entry into the queue - this settles ties in favor of the closes... | |
# Copyright 2013-2020 The Meson development team
# 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
#
# Copyright 2005 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... | |
""" Lib to manage an ATM (Automatic Teller Machine).
Important classes: User, Persistence.
"""
from decimal import Decimal
import hashlib
import sqlite3
import os
from datetime import datetime
class User(object):
""" Bank user. Can log in and do some actions or just act as a passive object.
Another class mus... | |
# -*- test-case-name: twisted.test.test_process -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
UNIX Process management.
Do NOT use this module directly - use reactor.spawnProcess() instead.
Maintainer: Itamar Shtull-Trauring
"""
from __future__ import division, absolute_import, prin... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
"""
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 this ... | |
# General Utilities for Systems Management Ultra Thin Layer
#
# Copyright 2017 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/LI... | |
#
# Copyright (c) SAS Institute, 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 ... | |
# Parts are courtesey of `Ben Hogdson <http://benhodgson.com/>`_.
# Python imports
import logging
import re
# Project imports
from classified.probe.base import Probe, isdigit
decimal_decoder = lambda s: int(s, 10)
decimal_encoder = lambda i: str(i)
def luhn_sum_mod_base(string, base=10, decoder=decimal_decoder):
... | |
# 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... | |
import sys
sys.path.append('C:/Users/dmccloskey-sbrg/Documents/GitHub/SBaaS_base')
from SBaaS_base.postgresql_settings import postgresql_settings
from SBaaS_base.postgresql_orm import postgresql_orm
# read in the settings file
filename = 'C:/Users/dmccloskey-sbrg/Google Drive/SBaaS_settings/settings_metabolomics.ini';... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import models, migrations
import datetime
import tests.models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
# ('contenttypes', '0002_remove_content_type_name'),
mig... | |
# 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... | |
import hashlib
import json
import os
import tarfile
import warnings
from django.db import models
from semantic_version.django_fields import VersionField
from .constants import MODULE_REGEX
from .storage import ForgeStorage
class AuthorManager(models.Manager):
def get_by_natural_key(self, name):
return s... | |
from __future__ import absolute_import
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import numpy as np
import scipy.stats
class Link(object):
"""
A generic link function for one-parameter exponential
family, with call, inverse and deriv ... | |
from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import RequestFactory
from kgb import SpyAgency
from reviewboard.attachments.models import FileAttachment
from ... | |
# Copyright 2016 Virantha Ekanayake 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 la... | |
from __future__ import division
# at this stage in the book we haven't actually installed matplotlib,
# comment this out if you need to
from matplotlib import pyplot as plt
##########################
# #
# FINDING KEY CONNECTORS #
# #
##########################
users = [... | |
"""
.. todo::
WRITEME
"""
import functools
from pylearn2.datasets.dataset import Dataset
from pylearn2.utils import wraps
import logging
import numpy
import warnings
import cPickle
# data are in pytables
try:
import tables
except ImportError:
warnings.warn("data are in pytables")
try:
import scipy.spa... | |
# pylint: skip-file
import json
import os
import pickle
import struct
import subprocess
import tempfile
import threading
from enum import IntEnum
from functools import wraps
import numpy as np
from lru import LRU
import _io
from tools.lib.cache import cache_path_for_file_path
from tools.lib.exceptions import DataUnre... | |
from contextlib import contextmanager
import datetime
from fabric import operations
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.contrib.files import upload_template, append
import os.path
import posixpath
PROJ_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
CONF... | |
# 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... | |
"""Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#### Mozu Auth - Upload - GetKey ####
def get_mozu_authtoken(tenant_url):
import requests, json
# "http://requestb.in/q66719q6" #
auth_url = "https://home.staging.mozu.com/api/platform/applications/authtickets"
tenant_url = tenant_url
headers = {'Conte... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.forms import (
CharField, DateField, FileField, Form, IntegerField, SplitDateTimeField,
ValidationError, formsets,
)
from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.utils import ErrorLi... | |
# 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 th... | |
#!/usr/bin/env python
import os
from collections import defaultdict
import numpy as np
from scipy.stats import scoreatpercentile
from astropy.stats import sigma_clip
from astropy.time import Time,TimeDelta
import fitsio
import matplotlib.pyplot as plt
from matplotlib import ticker
#from .ubercal import CalibrationOb... | |
#!/usr/bin/env python3
#
# This file is part of Linux-on-LiteX-VexRiscv
#
# Copyright (c) 2019-2021, Linux-on-LiteX-VexRiscv Developers
# SPDX-License-Identifier: BSD-2-Clause
import os
import sys
import argparse
from litex.soc.integration.builder import Builder
from litex.soc.cores.cpu.vexriscv_smp import VexRiscvS... | |
#!/usr/bin/python
# -*- coding: utf-8; mode: python; indent-tabs-mode: t; tab-width:4 -*-
"""
::
This program loads calibration data from a directory, processes it, and loads it into a connected device
Not for regular users!
Maybe dont include this in the main package
"""
from __future__ import print_function
im... | |
"""
(C) 2014-2019 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import json
import logging
import webbrowser
import ctypes
from threading import Event, Semaphore
import Foundation
import AppKit
import WebKit
from PyObjCTools import AppHelper
from objc import _objc, n... | |
# Copyright (c) 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 ... | |
#!/usr/bin/env python
"""Tests for grr.lib.aff4_objects.filestore."""
import hashlib
import os
import StringIO
import time
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import events
from grr.lib import flags
from grr.lib import rd... | |
# occiput
# Stefano Pedemonte
# April 2014
# Harvard University, Martinos Center for Biomedical Imaging
# Boston, MA, USA
__all__ = ['vNAV_MPRage']
import Image
from occiput.Core import Image3D, Transform_Affine
import numpy
import nibabel
import dicom
import pylab
import os
import copy
from occiput.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.