gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import datetime as dt
import psycopg2
import pytest
import sqlalchemy as sa
from nycodex import db
from nycodex.db.queue import queue
def test_update_from_metadata_empty(conn):
query = sa.select([sa.func.count()]).select_from(queue)
assert 0 == conn.execute(query).fetchone()[0]
db.queue.update_from_met... | |
# 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/env python
# encoding: utf-8
# Carlos Rafael Giani, 2006 (dv)
# Tamas Pal, 2007 (folti)
# Nicolas Mercier, 2009
# Matt Clarkson, 2012
"""
Microsoft Visual C++/Intel C++ compiler support
Usage::
$ waf configure --msvc_version="msvc 10.0,msvc 9.0" --msvc_target="x64"
or::
def configure(conf):
conf.env... | |
import pytest
from nbformat.v4 import new_notebook, new_output
from ...preprocessors import SaveCells, SaveAutoGrades
from ...api import Gradebook
from ...utils import compute_checksum
from .base import BaseTestPreprocessor
from .. import (
create_grade_cell, create_grade_and_solution_cell, create_solution_cell)
... | |
# 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... | |
"""HTTP Client for asyncio."""
import asyncio
import base64
import hashlib
import os
import sys
import traceback
import warnings
import http.cookies
import urllib.parse
from multidict import MultiDictProxy, MultiDict, CIMultiDict, upstr
import aiohttp
from .client_reqrep import ClientRequest, ClientResponse
from .er... | |
#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you... | |
import os
import sys
import zipfile
from cStringIO import StringIO
from os.path import basename, getsize, isfile, isdir, join
import metadata
import dist_naming
from requirement import Req, add_Reqs_to_spec, filter_name, dist_as_req
from enstaller.utils import (comparable_version, md5_file,
... | |
# 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... | |
"""Data iterators for common data formats."""
from __future__ import absolute_import
from collections import OrderedDict, namedtuple
import sys
import ctypes
import logging
import threading
import numpy as np
from .base import _LIB
from .base import c_array, c_str, mx_uint, py_str
from .base import DataIterHandle, NDA... | |
# Necessary set-up.
from app import db
from app.models import *
from app.utils import *
import datetime
import time
# Drop all database tables.
db.drop_all()
# Create new database tables.
db.create_all()
# Create colored pins.
cp_yellow = ColoredPin(
color_name="Yellow",
hex_color="fdd800",
pin_image_na... | |
#
# 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
# ... | |
import logging
from collections import defaultdict
from django.utils import six
from django.utils.safestring import mark_safe
from .base import (
Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs,
)
from .library import Library
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
logger... | |
# Copyright 2020 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... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | |
#!/bin/env python
# Automatically translated python version of
# OpenSceneGraph example program "osgprecipitation"
# !!! This program will need manual tuning before it will work. !!!
import sys
from osgpypp import osg
from osgpypp import osgDB
from osgpypp import osgGA
from osgpypp import osgParticle
from osgpypp i... | |
# -*- coding: utf-8 -*-
"""Configuration introspection and defaults."""
from __future__ import absolute_import, unicode_literals
import sys
from collections import deque, namedtuple
from datetime import timedelta
from celery.five import items, keys, python_2_unicode_compatible
from celery.utils.functional import memo... | |
# Copyright (c) 2018-2019, 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
# 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 (c) 2010 Citrix 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-2.0
#
# Unless required by applicab... | |
from __future__ import absolute_import
import datetime
import ujson
import zlib
from django.utils.translation import ugettext as _
from six import binary_type, text_type
from zerver.lib.avatar import get_avatar_url
from zerver.lib.avatar_hash import gravatar_hash
import zerver.lib.bugdown as bugdown
from zerver.lib.... | |
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from Selenium2Library import utils
from Selenium2Library.locators import ElementFinder
from keywordgroup import KeywordGroup
class _ElementKeywords(KeywordGroup):
def __init__(self):
self._elem... | |
# 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... | |
'''
Created on Apr 8, 2014
@author: cmills
'''
from tasr_test import TASRTestCase
from tasr.headers import SchemaHeaderBot, SubjectHeaderBot
import unittest
from webtest import TestApp
import StringIO
import tasr.app
APP = tasr.app.TASR_APP
APP.set_config_mode('local')
class TestTASRTopicApp(TASRTestCase):
''... | |
#
# Module providing the `Process` class which emulates `threading.Thread`
#
# processing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
__all__ = [
'Process', 'currentProcess', 'activeChildren'
]
#
# Imports
#
import os
import sys
import time
import signal
import atexit
import weakr... | |
import typing
import binascii
import themis.cbuild
import themis.auto
import themis.channel
import themis.codegen
import themis.codehelpers
import themis.joystick
import themis.pwm
import themis.timers
Mode = themis.channel.Discrete("DISABLED AUTONOMOUS TELEOP TESTING")
JOYSTICK_NUM = 6
AXIS_NUM = 12
MAX_BUTTON_NUM ... | |
'''
Created on December 25, 2016
Yes, I created this on Christmas day.
This is my gift to you.
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
import importlib
import datetime
import utilities.utilities as utiliti... | |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from __future__ import print_function
import os, shutil
import numpy
import random
from random import shuffle
def saveFile(path, content):
with open(path, 'a') as out:
out.write(content + '\n')
def generate_qualification(user_dict, quality_file, promotio... | |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/lice... | |
# -*- coding: utf-8 -*-
"""
Tests that don't hit the Google Music servers.
"""
from collections import namedtuple
import logging
import os
import time
from mock import MagicMock, patch
from proboscis.asserts import (
assert_raises, assert_true, assert_false, assert_equal,
assert_is_not, Check
)
from probosci... | |
# Copyright 2015 Infoblox 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... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# type: ignore
'''Fixtures for Selenium end-to-end tests.'''
import contextlib
import json
import logging
import os.path
import time
import urllib
from typing import Optional
import pytest
from selenium import webdriver
from selenium.common.exceptions import WebDriver... | |
# -*- coding: utf-8 -*-
#
# Copyright 2020 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
# Copyright (C) 2013 Rackspace Hosting 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 ... | |
__all__ = [
'recvfile',
]
import contextlib
import http.client
import logging
import re
import socket
from g1.asyncs.bases import adapters
from g1.bases import loggings
from g1.bases import pools
from g1.bases.assertions import ASSERT
LOG = logging.getLogger(__name__)
_CHUNK_SIZE = 8192
_BUFFER_POOL = pools.Tim... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | |
import datetime
import pytz
from juliabox.cloud import Compute
from juliabox.jbox_tasks import JBoxAsyncJob
from juliabox.jbox_util import JBoxCfg
from juliabox.jbox_container import BaseContainer
from juliabox.vol import VolMgr, JBoxVol
import docker.utils
from docker.utils import Ulimit
class SessContainer(BaseCon... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License
"""
This module implements reading and writing of ShengBTE CONTROL files.
"""
import warnings
from typing import Any, Dict, List, Optional, Union
import numpy as np
from monty.dev import requires
from monty.js... | |
#-*- coding: utf-8 -*-
#import wxversion
#wxversion.select('2.8')
import wx
import os
import re
import json
import sys
import string
import sqlite3
import datetime
#import psycopg2
import wx.grid as gridlib
import wx.lib.masked as masked
import Printer as PRx
import HandyUtilities as HU
import Common_Dialogs as CDialo... | |
import hashlib
import json
import os
import uuid
from django import forms
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.core.paginator import Emp... | |
import collections
import operator
import pytest
from pandas.compat import PY36
import pandas as pd
from pandas.tests.extension import base
import pandas.util.testing as tm
from .array import JSONArray, JSONDtype, make_data
@pytest.fixture
def dtype():
return JSONDtype()
@pytest.fixture
def data():
"""L... | |
from __future__ import absolute_import
from six.moves.urllib.parse import urlparse
from django.utils.translation import ugettext_lazy as _
from django import forms
from sentry import http
from sentry.web.helpers import render_to_response
from sentry.identity.pipeline import IdentityProviderPipeline
from sentry.identi... | |
#!/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 __future__ import absolute_import, unicode_literals
from collections import Counter
from itertools import chain, groupby
import json
from operator import itemgetter
import numpy as np
import pytz
from django.conf import settings
from django.db import models, transaction
from django.db.models import Count, Q, F
... | |
from typing import List, Dict, Callable, Tuple, Optional, Iterable, Any, cast
from thinc.api import Config, Model, get_current_ops, set_dropout_rate, Ops
from thinc.api import Optimizer
from thinc.types import Ragged, Ints2d, Floats2d, Ints1d
import numpy
from ..compat import Protocol, runtime_checkable
from ..scorer... | |
from __future__ import unicode_literals
import copy
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test import TestCase
from django.utils._os import upath
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.... | |
from datetime import date, datetime
import getpass
import json
import logging
from os.path import join
import re
import shutil
import subprocess
import tempfile
import uuid
from urllib.parse import urljoin
from xml.etree import ElementTree
import argh
from argh.interaction import safe_input
import arghlog
import reque... | |
'''
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Author(s):
Norton Luo
This test validate the system level function of RackHD image-service. This test include VMware ESXi install and node
rediscover.It use image server to store ESXi image and microkernel used for RackHD discovery.
You need put a... | |
"""Tornado handlers for nbgrader course list web service."""
import os
import contextlib
import json
import traceback
from tornado import web
from tornado.httpclient import AsyncHTTPClient, HTTPError
from tornado import gen
from textwrap import dedent
from urllib.parse import urlparse
from notebook.utils import url_... | |
from distutils.version import LooseVersion
from dipy.utils.optpkg import optional_package
tf, have_tf, _ = optional_package('tensorflow')
if have_tf:
if LooseVersion(tf.__version__) < LooseVersion('2.0.0'):
raise ImportError('Please upgrade to TensorFlow 2+')
class SingleLayerPerceptron(object):
d... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
"""
Utilities for streaming from several file-like data storages: S3 / HDFS / standard
filesystem / compressed files..., us... | |
import unittest
import mock
from requests.exceptions import ConnectionError
from tsuru_unit_agent.main import parse_args, main, TEMP_ENV_FILE
class TestMain(unittest.TestCase):
def test_parse_args(self):
args = parse_args(['a', 'b', 'c', 'd', 'run'])
self.assertEqual(args.action, 'run')
... | |
# -*- coding: utf-8 -*-
'''
Salt module to manage Unix mounts and the fstab file
'''
# Import python libs
from __future__ import absolute_import
import os
import re
import logging
# Import salt libs
import salt.utils
from salt.utils import which as _which
from salt.exceptions import CommandNotFoundError, CommandExecu... | |
# Copyright 2016 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 requi... | |
"""
This is a reference LSTM numpy implementation adapted from Karpathy's code:
The adaptation includes
- interface to use the same initialization values
- being able to read out intermediate values to compare with another LSTM
implementation
"""
import numpy as np
class LSTM:
@staticmethod
def init... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# 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... | |
from django.conf import settings
from common.tests import ViewTestCase
from common import api
from common import clean
from common import exception
from common import util
class LoginTest(ViewTestCase):
def test_login_when_signed_out(self):
r = self.login_and_get(None, '/login')
self.assertContains(r, "Forg... | |
#1
#v 0.001
'''
description:
UMC's GUI, instead of using the GL Feedback Buffer like any normal GUI,
uses it's own interface based on hitdefs.
how it works is it fills 2 buffers with data:
- Widgets:
holds the widget data (info), event states, and hitdef
- layer:
holds a complex arrangement of polygon layer... | |
from ctypes import *
import os
# Function definitions for C api
buffer_operation_func_t = CFUNCTYPE(c_int32, POINTER(c_uint8), c_uint32)
check_operation_func_t = CFUNCTYPE(c_int32)
# transport struct definition for C api
class TM_transport(Structure):
_fields_ = [("read", buffer_operation_func_t),
(... | |
##########################################################################
#
# Copyright (c) 2018, Image Engine Design 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:
#
# * Redistrib... | |
from PySide import QtSql, QtCore, QtGui
from openpyxl import Workbook, load_workbook
import datetime
import Util
import shutil
import os
tableMember = None
tableGear = None
tableTransaction = None
tableArchiveTrans = None
tableAdmin = None
tableFinancialTran = None
tableGearMaintenance = None
fullFirstLast = None
gea... | |
import json
import re
from django.core.serializers.json import DjangoJSONEncoder
from django.shortcuts import render
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.decorators import permission_required
from survey.forms.logic import LogicForm
from... | |
# Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""\
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O er... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from ...extern.six.moves import range
from ... import units as u
from ..baseframe import frame_transfo... | |
# 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 utils.decisions_constants as log
from mahjong.tile import TilesConverter
from mahjong.utils import is_chi, is_honor, is_man, is_pin, is_pon, is_sou, is_terminal, plus_dora, simplify
from utils.decisions_logger import MeldPrint
class BaseStrategy:
YAKUHAI = 0
HONITSU = 1
TANYAO = 2
FORMAL_TEMPAI... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'config_dialog.ui'
#
# Created: Mon Jun 13 02:31:42 2016
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QS... | |
# -*- coding: utf-8 -*-
"""
gspread.models
~~~~~~~~~~~~~~
This module contains common spreadsheets' models
"""
import re
from collections import defaultdict
from itertools import chain
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, SubElement
from .ns import _ns, _ns1, ATOM_NS, BATC... | |
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; -*-
"""Module providing class for Wang sense disambiguation.
Attributes:
WangExplicitSenser (class):
class that predict senses of explicit relations
"""
##################################################################
# Imports
from __future__ import ... | |
#!/usr/bin/python
import datetime
ANSIBLE_METADATA = {
'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ceph_volume
short_description: Create ceph OSDs with ceph-volume
description:
- Using the ceph-volume utility available in Ceph this ... | |
import time
import tqdm
import logging
import itertools
import functools
import collections
import networkx as nx
from indra.util import fast_deepcopy
from indra.statements import *
from indra.statements import stmt_type as indra_stmt_type
from .refinement import *
logger = logging.getLogger(__name__)
class Preassem... | |
#!/usr/bin/env python
##########################################################################################
# Developer: Luan,Jingchao Project: HuMaIN (http://humain.acis.ufl.edu)
# Description:
# Extract the individual line images from a binarized image, based on the default
# parameters or parameter... | |
from collections import defaultdict
from typing import Any, Dict, List, Union
from ..users.projector import get_user_name
from ..utils.projector import (
AllData,
ProjectorElementException,
get_config,
register_projector_slide,
)
# Important: All functions have to be prune. This means, that thay can ... | |
import pytest
from marshmallow import Schema, fields
from sqlalchemy import Column, Integer, String, sql
from flask_resty import Api, FixedSorting, GenericModelView, Sorting
from flask_resty.testing import assert_response
# -----------------------------------------------------------------------------
@pytest.fixtur... | |
#!/usr/bin/env python
#
# Copyright 2018 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 require... | |
#!/usr/bin/env python
# coding=utf-8
import unittest
from ipapy import invalid_ipa_characters
from ipapy import ipa_substrings
from ipapy import is_valid_ipa
from ipapy import remove_invalid_ipa_characters
from ipapy import split_using_dictionary
class TestInit(unittest.TestCase):
def do_test(self, values, func... | |
"""The following methods may be used to describe the fit between the model
simulation and the observations.
.. currentmodule:: pastas.modelstats.Statistics
.. autosummary::
:nosignatures:
:toctree: ./generated
summary
Examples
========
These methods may be used as follows.
>>> ml.stats.summary(stats=... | |
#!/usr/bin/env python
"""
For a VEGAS'd VCF file, calculate a distance score for each motif delta score, ChIP z-score, and gene expression
z-score set for each variant. These values will be plotted in 3 dimensional space. Additionally, simple bed-like files
are provided as output. One contains the scores for all motif,... | |
"""
Centralized database access testsfor the American Gut web portal
"""
__author__ = "Emily TerAvest"
__copyright__ = "Copyright 2014, American Gut Project"
__credits__ = ["Emily TerAvest"]
__license__ = "GPL"
__version__ = "1.0.0.dev"
__maintainer__ = ["Emily TerAvest"]
__email__ = "emily.teravest@colorado.edu"
__st... | |
# -*- encoding: utf-8
from sqlalchemy import Column
from sqlalchemy import engine_from_config
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy.dialects.mssql import base ... | |
import json
import os
import tempfile
from collections.abc import Sized
from functools import partial
from io import StringIO
from pathlib import Path
from typing import Dict
import pytest
from schema_salad.utils import yaml_no_ts
import cwltool.pack
import cwltool.workflow
from cwltool.context import LoadingContext
... | |
#!/usr/bin/python3
"""Script to manage creation/deletion of BTRFS subvolumes/snapshots.
This script helps facilitate the creation of BTRFS subvolumes and
snapshots, with an end towards enabling better SSD utilization for
Android development. Android "repo" clients can be very large: 60-70GB
for a fully built AOSP clie... | |
from datetime import date
from itertools import accumulate
from calendar import monthrange
from collections import Counter
from kernel.IssuesModel import backlogIssuesModel
from kconfig import calendar as FWcalendar
from kconfig import workGroupBook
from kernel.Recorder import Recorder
__author__ = "Manuel Escriche <... | |
import sys
import subprocess
from urllib.parse import urlencode
import logging
import types
from functools import partial, wraps
from datetime import datetime, time, timezone
import warnings
from werkzeug.local import LocalProxy
from flask import g
from werkzeug.utils import import_string
import dateutil
class class... | |
def update_classes_table(filename):
import sqlite3
from datetime import datetime
import globalvars
conn = sqlite3.connect(globalvars.database_path)
cur = conn.cursor()
# Make some fresh tables using executescript()
cur.executescript('''
DROP TABLE IF EXISTS Classes;
DROP TABLE IF EXISTS Professors;
DROP T... | |
import asyncio
import collections
import warnings
from typing import List # noqa
from typing import Awaitable, Callable, Generic, Optional, Tuple, TypeVar
from .base_protocol import BaseProtocol
from .helpers import BaseTimerContext, set_exception, set_result
from .log import internal_logger
try: # pragma: no cover... | |
"""Tests for the OAuth applications web API,."""
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.utils import six
from djblets.db.query import get_object_or_none
from djblets.testing.decorators import add_fixtures
from djblets.webapi.errors import DOES_NOT_EXIST
from dj... | |
#!/usr/bin/python
# Copyright (c) 2009, Purdue University
# 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 ... | |
from __future__ import print_function, unicode_literals
from six.moves.http_client import HTTPMessage
from six.moves.urllib_parse import urlparse
from copy import deepcopy
from .content import decoders
from .messages import split_start_line, HTTPRequest, HTTPResponse
from .encapsulated import encapsulated_offsets
from ... | |
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
#### time parameters ####
#########################
T = 100
R = 1
#### model parameters ####
##########################
Np = 200
weight_limit = 1 / (Np ** 3.0)
ess = 10.0 / Np
# nu = 1.0 / (2 ** Np)
phi = 0.23
sigma = 0.1
vol = [-2.5, -... | |
#!/usr/bin/env python3
# Copyright 2017 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.
"""Parser for linker map files.
The format of a linker map file depends on the linker that generates it. This
file uses "coded linker... | |
#!/usr/bin/env python
# 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.
"""Central list of tests to run (as appropriate for a given config). Add tests
to run by modifying this file.
Note that this file is b... | |
"""
====================
Scheme Editor Widget
====================
"""
import sys
import logging
import itertools
import unicodedata
import copy
from operator import attrgetter
from urllib.parse import urlencode
from PyQt4.QtGui import (
QWidget, QVBoxLayout, QInputDialog, QMenu, QAction, QActionGroup,
QKe... | |
# Copyright (c) 2008, Humanized, 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | |
# Copyright 2015-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
from c7n.exceptions import PolicyValidationError
from c7n.executor import MainThreadExecutor
from c7n.resources.elb import ELB, SetSslListenerPolicy
class ELBTag... | |
# Copyright 2009-2010 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
import time
import logging
logger = logging.getLogger(__name__)
import synapse.glob as s_glob
import synapse.synasync as s_async
import synapse.common as s_common
import synapse.eventbus as s_eventbus
import synapse.telepath as s_telepath
import synapse.lib.tags as s_tags
import synapse.lib.scope as s_scope
import s... | |
# 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... | |
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
from chainer.links.model.vision.resnet import BuildingBlock
from chainercv.links.model.faster_rcnn.region_proposal_network \
import RegionProposalNetwork
from chainer_mask_rcnn import functions
from chainer_mask_rcnn.models... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.