gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
from js9 import j
from nacl.public import PrivateKey, SealedBox
import nacl.signing
import nacl.secret
import nacl.utils
import nacl.hash
import nacl.encoding
import hashlib
# from .AgentWithKeyname import AgentWithName
import binascii
from nacl.exceptions import BadSignatureError
JSBASE = j.application.jsbase_get_cla... | |
# Copyright 2013 Canonical Ltd.
# 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... | |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at:
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011, Cisco Systems, 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-... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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.apach... | |
#! /usr/bin/env python
#
# Copyright (C) 2012 Lorne Liechty
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
import base64
import urllib2
from email import message_from_string
from email.utils import parseaddr
from django.conf import settings
from django.core.files.storage import get_storage_class
import commonware.log
import waffle
from email_reply_parser import EmailReplyParser
from access.models import Group
from users.... | |
import numpy as np
from assay import assert_raises
from pytz import timezone
from skyfield.constants import DAY_S
from skyfield.timelib import JulianDate, utc
from datetime import datetime
one_second = 1.0 / DAY_S
epsilon = one_second * 42.0e-6 # 20.1e-6 is theoretical best precision
time_parameter = ['tai', 'tt', '... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | |
import argparse
import numpy as NP
from astropy.io import fits
from astropy.io import ascii
import scipy.constants as FCNST
from scipy import interpolate
import matplotlib.pyplot as PLT
import matplotlib.colors as PLTC
import matplotlib.animation as MOV
from scipy.interpolate import griddata
import datetime as DT
impo... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
import socket
import time
import fcntl
import random
import struct
from zope.interface import implements
from twisted.internet import task, defer, reactor, udp
from twisted.internet.protocol import DatagramProtocol
from twisted.internet.interfaces import ISystemHandle
# OMG SHUT UP
class STFU(object):
msg = lamb... | |
import uuid
from importlib import import_module
import os
import numbers
try:
from urllib import parse
except ImportError:
from urlparse import urlparse as parse
import ipywidgets as widgets
from traitlets import List, Unicode, Dict, observe, Integer
from .basedatatypes import BaseFigure, BasePlotlyType
from ... | |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import sys
import unittest
from django.conf import settings
from django.contrib.admindocs import utils
from django.contrib.admindocs.views import get_return_data_type, simplify_regex
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settin... | |
import copy
import unittest
import mock
import numpy
import chainer
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import initializers
from chainer import testing
from chainer.testing import attr
class TestLink(unittest.TestCase):
def setUp(self):
x_shape_0 = 2
... | |
from __future__ import absolute_import
from collections import defaultdict
import functools
import itertools
import logging
import os
from pip._vendor import pkg_resources
from pip._vendor import requests
from pip.download import (url_to_path, unpack_url)
from pip.exceptions import (InstallationError, BestVersionAlr... | |
import numpy as np
from pystella.rf import band
from pystella.rf.ts import TimeSeries, SetTimeSeries
__author__ = 'bakl'
class LightCurve(TimeSeries):
def __init__(self, b, time, mags, errs=None, tshift=0., mshift=0.):
"""Creates a Light Curve instance. Required parameters: b (band), time, mags."""
... | |
import math
import torch
from functools import reduce
from ._utils import _range
class __PrinterOptions(object):
precision = 4
threshold = 1000
edgeitems = 3
linewidth = 80
PRINT_OPTS = __PrinterOptions()
SCALE_FORMAT = '{:.5e} *\n'
# We could use **kwargs, but this will give better docs
def set_p... | |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
import math, copy
from map_data import mapImageList, terrainList
from characters_data import charactersData
from AttackCharacter import AttackCharacter
from Enemy import Enemy
from pylash.core import stage, init, addChild
from pylash.loaders import LoadManage
from pylas... | |
import struct
from impacket import ntlm
# Hexdump packets
def pretty_print(x):
if x in '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ ':
return x
else:
return '.'
def hexdump(data):
x=str(data)
strLen = len(x)
i = 0
while i < s... | |
"""Template helper methods for rendering strings with HA data."""
# pylint: disable=too-few-public-methods
import json
import logging
import jinja2
from jinja2.sandbox import ImmutableSandboxedEnvironment
from blumate.components import group
from blumate.const import STATE_UNKNOWN, ATTR_LATITUDE, ATTR_LONGITUDE
from ... | |
#!/usr/bin/env python
# encoding: utf-8
import os
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth.core import User
from website import settings
from website.app import init_app
from website.conferences.model import Conference
def main():
init_app(set_backends... | |
# Copyright (c) 2015 Clinton Knight. 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 requir... | |
# 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... | |
#!/usr/bin/python
# Standard library imports
from subprocess import Popen, PIPE
from sys import argv
from imp import load_source
from os.path import dirname, isfile, join, realpath
from fcntl import flock, LOCK_EX, LOCK_UN, LOCK_NB
from OmsConfigH... | |
"""
kombu.utils.eventio
===================
Evented IO support for multiple platforms.
"""
from __future__ import absolute_import
import errno
import socket
from select import select as _selectf, error as _selecterr
try:
from select import epoll
except ImportError:
epoll = None # noqa
try:
from selec... | |
# stdlib
from typing import Any
from typing import List as TypeList
from typing import Optional
from typing import Tuple as TypeTuple
# third party
import numpy as np
from scipy import optimize
from sympy.core.basic import Basic as BasicSymbol
# relative
from ...common import UID
from ..entity import Entity
from ..se... | |
# -*- encoding: UTF8 -*-
from __future__ import print_function
import glob, sys, time, stat
pathToBuild = glob.glob('build/lib*')
if len(pathToBuild) > 0:
versionString = "%d.%d" % (sys.version_info[0], sys.version_info[1])
for i in pathToBuild:
if versionString in i:
sys.path.insert(0, i)
import P4
from P4 i... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, AGB & GC
# Full license can be found in License.md
# -----------------------------------------------------------------------------
""" Tests the ocb_scaling class and functions
"""
import datetime as dt
import numpy as np
import os
from sys import vers... | |
'''
Author: Hans Erik Heggem
Email: hans.erik.heggem@gmail.com
Project: Master's Thesis - Autonomous Inspection Of Wind Blades
Repository: Master's Thesis - CV (Computer Vision)
'''
import serial, math, threading, time, timeit
from . Storm32bgcProtocol.Storm32bgcProtocol import Storm32bgcProtocol
'''
@brieaf Th... | |
#!/usr/bin/env python
#
# create Eclipse projects corresponding to make targets
#
# this script can be used in two different ways:
#
# 1) if you simply run it, the configurations relevant to the OS where you
# run it from will be output to "bld/makeclipse". On Linux, you will get
# configurations for the gcc and ... | |
"""
sentry.testutils.cases
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = (
'TestCase', 'TransactionTestCase', 'APITestCase', 'AuthProviderTestCase',
'RuleTest... | |
import inspect
import time
import os
import pytest
import shutil
import sys
from unittest.mock import MagicMock, patch
from typing import Callable, Union
import ray
from ray import tune
from ray.rllib import _register_all
from ray.cluster_utils import Cluster
from ray._private.test_utils import run_string_as_driver_... | |
from grafanalib.core import *
dashboard = Dashboard(
title='Nodes',
version=2,
description='Dashboard to get an overview of one server',
gnetId=22,
graphTooltip=0,
refresh=False,
schemaVersion=14,
time=Time(start='now-1h'),
timezone='browser',
inputs=[
{
'na... | |
import asyncio
import concurrent.futures
import logging
import signal
import sys
import typing
from dataclasses import dataclass
from pathlib import Path
from typing import Dict
from urllib.parse import urlparse, urlunparse
import aiohttp.client
import aiojobs
import aiojobs.aiohttp
import pymongo.errors
from aiohttp.... | |
# $Id$
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
I/O classes provide a uniform API for low-level input and output. Subclasses
exist for a variety of input/output mechanisms.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
im... | |
"""
Deprecated: This is included only to support the use of the old v1 client
class. It will be removed once v2 is at parity with v1. Do not use this for any
new functionality.
A simple JSON REST request abstraction layer that is used by the
``dropbox.client`` and ``dropbox.session`` modules. You shouldn't need to use... | |
from __future__ import unicode_literals
import logging
import sys
import types
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core import signals
from django.core.exceptions import MiddlewareNotUsed, PermissionDenied, SuspiciousOperation
from django.db import... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from preggy import expect
from tornado.testing import gen_test
from tornado.httpclient import HTTPError
from ujson import loads, dumps
from tests.unit.base import ApiTestCase
from tests.fixtures import LimiterFactory, UserFactory
from holmes.models import Limiter, User
cla... | |
#!/usr/bin/python
import sys
import socket
import math
import re
sys.path.append("../")
#from TorCtl import *
from TorCtl import TorUtil, PathSupport, TorCtl
from TorCtl.TorUtil import control_port, control_host, control_pass
from TorCtl.TorUtil import *
from TorCtl.PathSupport import *
import atexit
TorUtil.loglevel... | |
import random
import uuid
import mock
import six
from olympia import amo, core
from olympia.activity.models import ActivityLog
from olympia.addons.models import Addon
from olympia.amo.tests import TestCase, addon_factory, collection_factory
from olympia.bandwagon.models import (
Collection, CollectionAddon, Featu... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.lang.javascript.sourcemaps import (
SourceMap, parse_vlq, parse_sourcemap, sourcemap_to_index, find_source, get_inline_content_sources
)
from sentry.testutils import TestCase
from sentry.utils import json
sourcemap = """{
"version":... | |
"""
nodes for costs/losses
"""
import theano.tensor as T
from .. import core
from .. import utils
from . import simple
from . import containers
AGGREGATORS = {
'mean': T.mean,
'sum': T.sum,
}
@core.register_node("aggregator")
class AggregatorNode(core.NodeImpl):
"""
node that aggregates a tensor i... | |
import warnings
from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.te... | |
# Copyright 2012 NetApp
# 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 applic... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for twisted.enterprise.adbapi.
"""
from twisted.trial import unittest
import os, stat
import types
from twisted.enterprise.adbapi import ConnectionPool, ConnectionLost
from twisted.enterprise.adbapi import Connection, Transaction
fro... | |
# -*- coding: utf-8 -*-
# Copyright 2021 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 o... | |
import pymel.core as pm
import logging
import Renderer as Renderer
import traceback
import sys
import os
import path
import optimizeTextures
import Lux.aeNodeTemplates as LuxTemplates
reload(Renderer)
log = logging.getLogger("mtLuxLogger")
RENDERER_NAME="Lux"
class LuxRenderer(Renderer.MayaToRenderer):
theRen... | |
import re
import pytest
from django.urls import reverse
from rdmo.views.models import View
from ..models import Project
users = (
('owner', 'owner'),
('manager', 'manager'),
('author', 'author'),
('guest', 'guest'),
('user', 'user'),
('site', 'site'),
('anonymous', None),
)
view_project... | |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright (c) 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... | |
# 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 unde... | |
# 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... | |
#!/usr/bin/env python
#Copyright (C) 2012 by Glenn Hickey
#
#Released under the MIT license, see LICENSE.txt
import os
import sys
import copy
import random
import math
from heapq import heappush, heappop
from contig import CircularContig
from contig import LinearContig
from contig import Contig
from dcj import dcj
f... | |
from django.db import models
from django.core.exceptions import ValidationError
from datetime import date, datetime, timedelta
# from .person import Person
class Position(models.Model):
# For ForeignKey, not using the class name Person but rather the string 'Person'
# so we don't have circular dependencies,... | |
from app import address
from app import naturalgas
from app import electricity
from app import codeviolation
from app import totaltuples
from app import water
from app import funFacts
from app import app
from flask import json, request
# Sets up the routes, really
from flask import render_template
# Sets up the rou... | |
import sys
import warnings
from numpy.testing import *
import numpy.lib
from numpy.lib import *
from numpy.core import *
class TestAny(TestCase):
def test_basic(self):
y1 = [0,0,1,0]
y2 = [0,0,0,0]
y3 = [1,0,1,0]
assert(any(y1))
assert(any(y3))
assert(not any(y2))
... | |
#!/usr/bin/env python
#
# Copyright 2014-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 appli... | |
# -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of RFC2617: HTTP Digest Authentication
@see: U{http://www.faqs.org/rfcs/rfc2617.html}
"""
import time
import md5, sha
from zope.interface import implements
from t... | |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
import codecs
import ntpath
from random import random
from time import time
import numpy as np
from pandas import read_csv, Series, merge, concat
from jnt.common import exists
from jnt.isas.isas import ISAs
from jnt.freq import FreqDictionary
from jnt.isas.taxo import TaxonomyResources
MAX_PROXY_ISAS = 10
def taxo2... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pyisaf.builder.base import DATE_FORMAT, ISAFBuilder
from xml.etree.ElementTree import Element, SubElement
def date_or_empty(v):
return '' if v is None else v.strftime(DATE_FORMAT)
def int_or_empty(v):
return '%d' % v if v else ''
def s... | |
# 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... | |
# 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/licenses/LICENSE-2.0
#
# Unless requ... | |
# Author: Jeffrey Armstrong <jeff@approximatrix.com>
# April 4, 2011
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (assert_equal,
assert_array_almost_equal, assert_array_equal,
assert_allclose, assert... | |
"""
This custom backend checks the responses from ElasticSearch for errors,
which the Haystack and ElasticSearch libraries totally ignore.
It also allows the use of Model instances in queries, automatically
converting them into the format used by ForeignKeyField and ManyToManyField.
"""
import haystack
import loggin... | |
import numpy as np
from ctypes import c_int, c_double, c_bool, c_float, c_void_p
import ctypes
import os
from .. import utils
def recompile(path):
print( path )
dir_bak = os.getcwd()
os.chdir( path)
os.system("make" )
os.chdir( dir_bak )
print( os.getcwd() )
LIB_PATH = os.path.dirname(... | |
#! /usr/bin/env python
'''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 the same thing as the option keywords for the RC... | |
# 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... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2011 Olle Johansson
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 ... | |
# Copyright (c) 2015-2017 Cisco Systems, Inc.
#
# 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... | |
import pygame, random, sys, math
from pygame.locals import *
from robot_algorithm import *
from robot import Sprite
from time import sleep
input = """
fd
fd
sh
rr
fd
sh
sh
fd
rl
sh
rl
sh
"""
# if el
# rl
# sh
# sh
# sh
# fd
# rr
# end
# if er
# rr
# sh
# sh
# sh
# fd
# r... | |
import os,sys,re
import numpy as np
import pandas as pd
import sqlite3
import uuid
from functools import reduce
import itertools
# many data files are still located at data folder (actually symlink to other dir)
DATA = os.path.abspath('../data')
# list of one-letter aa and physical properties
aa = ['R','H','K','D','... | |
# 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | |
"""This test creates two top level actors and one sub-actor and
verifies that the actors can exchange sequences of messages."""
import time
from thespian.actors import *
from thespian.test import *
class rosaline(Actor):
name = 'Rosaline'
class Romeo(Actor):
def receiveMessage(self, msg, sender):
... | |
import os
import cv2
import numpy as np
import pandas as pd
from scipy import stats
from plotnine import ggplot, aes, geom_line, scale_x_continuous, scale_color_manual, labs
from plantcv.plantcv import fatal_error
from plantcv.plantcv import deprecation_warning
from plantcv.plantcv import params
from plantcv.plantcv._d... | |
# Macaroon - a desktop macro tool
# Copyright (C) 2007 Eitan Isaacson <eitan@ascender.com>
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Foundation.
# This file is distributed without any warranty;... | |
# coding: utf-8
import os
import sys
import requests
from tests.node import File
from tests.node import Dir
from tests.node import random_name
from tests.process import BlobFS
from tests.process import BlobStash
# TODO(tsileo): test `blobfs` checkout, log
# TODO(tsileo): use pytest with custom error?
# TODO(tsileo): ... | |
from __future__ import with_statement
from hashlib import md5
import os
from urllib import urlopen, urlencode, quote, unquote
from django.contrib import admin
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.sites.models import Site
from django.core.files import File
from django.core.files.stor... | |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# Certificate Management Protocol structures as per RFC4210
#
# Based on Alex Railean's work
#
from pyasn1.type import char
from pyasn1.type import constra... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
'''
Import operations for ID mapping tables. (Ensembl ENSG<->ENSP and Ensembl ENSG
<-> EntreZ Gene)
@author: Patrick Flick
'''
# TODO list for this file:
# - ensg <-> ensp mapping directly via the biomart table
# - find rationale for MIN(id) to resolve ambiguties
# - idk what else yet
import csv
from . import sql... | |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import time
import conf
import g
from grax.access_level import Access_Level
from gwis.query_filters import Query_Filters
from gwis.exception.gwis_error import GWIS_Error
from gwis.exception.gwis_nothing_fou... | |
# 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... | |
import urllib2, urllib
import csv
import logging
import json
from datetime import datetime
import re
from geopy.geocoders import GoogleV3
import nominatim
from omgeo import Geocoder
from config import GOOGLE_API_KEY, logger
def encode(s, encoding="utf8"):
if type(s) == unicode:
return s.encode(encoding)
... | |
"""
dto.Record is an abstract base class. Its subclasses hold
information about individual data records, which are
represented by individual lines in the HonSSH-generated files,
individual rows in the local db storage tables, or individual
"documents" in the ElasticSearch database.
"""
import abc
fr... | |
def add_enrichr_cats(df, inst_rc, run_enrichr, num_terms=10):
from copy import deepcopy
tmp_gene_list = deepcopy(df.index.tolist())
gene_list = []
if type(tmp_gene_list[0]) is tuple:
for inst_tuple in tmp_gene_list:
gene_list.append(inst_tuple[0])
else:
gene_list = tmp_gene_list
orig_gene_l... | |
# -*- coding: utf-8 -*-
import pickle
from _thread import start_new_thread
from threading import Timer
from time import sleep
import traceback
from pysimplelog import Logger
from werkzeug.wrappers import Request, Response
from werkzeug.serving import run_simple
from FoodScan.ShopSync.metaShop import MetaShop
class S... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Task queue task which migrates a TestMetadata and its Rows to a new name.
A rename consists of listing all TestMetadata entities which match the old_name,... | |
#!/usr/bin/env python3
# Copyright (c) 2014-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.
"""Base class for RPC testing."""
from collections import deque
from enum import Enum
import logging
impo... | |
import argparse
import json
import os
import subprocess
from os import makedirs, remove
from os.path import abspath, join, exists, dirname
from jinja2 import Template
CMDS = ["list", "add", "del", "gen"]
VHOSTM_CONFIG = ".vhostm.conf"
DEFAULT_NGINX_TEMPLATE = """
upstream {{domain}} {
server {{address}}:{{port}... | |
# set-alias blender "D:\Program Files\Blender\blender.exe"
# blender --background --python .\impexp.py
import logging
import bpy
import os
from mathutils import Vector
import json
import shutil
import re
def center_object(o):
local_bbox_center = 0.125 * sum((Vector(b) for b in o.bound_box), Vector())
#global_... | |
"""
parser.http.characterParser module (imdb package).
This module provides the classes (and the instances), used to parse
the IMDb pages on the akas.imdb.com server about a character.
E.g., for "Jesse James" the referred pages would be:
main details: http://www.imdb.com/character/ch0000001/
biography: ... | |
# 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... | |
# Copyright (C) 2014, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
"""
This module exposes utilities to illustrate objects and their references as
(directed) graphs. The current implementation requires 'graphviz' to be
installed.
"""
from pympler.asizeof import Asizer, named_refs
from pympler.util.stringutils import safe_repr, trunc
from pympler.util.compat import encode4pipe
from gc... | |
"""
Django settings for wye project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths in... | |
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging f... | |
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.