gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import division
import errno
import os
import shutil
import time
import uuid
from collections import namedtuple
from itertools import izip as zip
from itertools import repeat
from cassandra import WriteFailure
from cassandra.concurrent import (execute_concurrent,
exec... | |
#
# 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... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding M2M table for field removed_collaborators on 'Makey'
m2m_table_n... | |
# 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... | |
# Authors: Adam Li <adam2392@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
from collections import OrderedDict
from datetime import datetime, timezone
import numpy as np
from ..base import BaseRaw
from ..constants import FIFF
from ..meas_info import create_info
from ..utils import _mult_cal_on... | |
# sql/ddl.py
# Copyright (C) 2009-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them f... | |
# -*- coding: utf-8 -*-
"""core -- core behaviors for Owyl.
Copyright 2008 David Eyk. All rights reserved.
$Author$\n
$Rev$\n
$Date$
"""
__author__ = "$Author$"[9:-2]
__revision__ = "$Rev$"[6:-2]
__date__ = "$Date$"[7:-2]
import logging
try:
from mx.Stack import Stack, EmptyError
except ImportError:
from s... | |
# 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... | |
"""Linux mount(2) API wrapper module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import itertools
import logging
import operator
import os
import ctypes
from ctypes import (
c_int,
c_char_p,
c_ul... | |
from threading import Thread
import logging
import time
from datetime import datetime, timedelta
import random
import Settings
s = Settings.Settings()
LED_MIN = 0
LED_MAX = 4095
logger = logging.getLogger('__main__')
class Channel(Thread):
def __init__(self, c_id, pwm, channel_info):
super(Channel, self... | |
"""Functions for FIR filter design."""
from __future__ import division, print_function, absolute_import
from math import ceil, log
import numpy as np
from numpy.fft import irfft
from scipy.special import sinc
from . import sigtools
__all__ = ['kaiser_beta', 'kaiser_atten', 'kaiserord',
'firwin', 'firwin2',... | |
import asyncio
import unittest
from .http import *
from .http import read_headers
class HTTPAsyncTests(unittest.TestCase):
def setUp(self):
super().setUp()
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.loop)
self.stream = asyncio.StreamReader(loop=self.loop)
... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
we want to make sure that our SR network behavior in terms of degree assortativity is not accident
for that reason, we will mix (randomize) the CV vectors input and calculate new "SR values"
with which we can recalculate "random" SR networs and see their behavior
... | |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton
# www.bluepines.org
# Copyright (c) 2012 42 Lines Inc., Jim Browne
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy... | |
"""Test inter-conversion of different polynomial classes.
This tests the convert and cast methods of all the polynomial classes.
"""
from __future__ import division, absolute_import, print_function
import operator as op
from numbers import Number
import numpy as np
from numpy.polynomial import (
Polynomial, Leg... | |
# This file is part of Charlton
# Copyright (C) 2011 Nathaniel Smith <njs@pobox.com>
# See file COPYING for license information.
# This file defines the ModelDesc class, which describes a model at a high
# level, as a list of interactions of factors. It also has the code to convert
# a formula parse tree (from charlto... | |
import urllib
import sys
import os
from cStringIO import StringIO
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.core.handlers.base import BaseHandler
from django.core.handlers.wsgi import WSGIRequest
from django.core.signals import got_request_exception
from django.dis... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# 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... | |
#!/usr/bin/python
# this defaults to python 2 on my machine
# (c) 2017 Treadco software.
#
# python version of the fuzzy rbm
# supports the non-fuzzy version.
#
#
license ='''
Copyright (c) 2017 Treadco LLC, Amelia Treader, Robert W Harrison
Permission is hereby granted, free of charge, to any person obtaining a co... | |
#
# 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 us... | |
import sys
import inspect
import argparse
from dipy.workflows.docstring_parser import NumpyDocString
def get_args_default(func):
if sys.version_info[0] >= 3:
sig_object = inspect.signature(func)
params = sig_object.parameters.values()
names = [param.name for param in params if param.name ... | |
import csv
import os
from json import loads
from os.path import exists
from old.project import CassandraInsert
from old.project import CassandraUtils
cassandra = CassandraUtils()
QTD_STS_KEY = 'quotedStatus'
RTD_STS_KEY = 'retweetedStatus'
MT_STS_KEY = 'userMentionEntities'
def check_mention_entities(tweet):
r... | |
"""
Test suite for Cython utilities.
"""
import numpy as np
def interp_conserve(x, xp, fp, left=0., right=0.):
"""
Interpolate `xp`,`yp` array to the output x array, conserving flux.
`xp` can be irregularly spaced.
"""
midpoint = (x[1:]-x[:-1])/2.+x[:-1]
midpoint = np.append(midpoint, np.arra... | |
#!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
from os import path
import sys
if sys.version_info[0] >= 3:
xrange = range
__all__ = ['libsvm', 'svm_problem', 'svm_parameter',
'toPyModel', 'gen_svm_nodearray', 'print_null', 'svm_node', 'C_SVC',
'EPSILON_SVR', 'L... | |
# 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... | |
#!/usr/bin/env python
# tile-generator
#
# Copyright (c) 2015-Present Pivotal Software, 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... | |
"""Implements a layer of neurons."""
from parameter import *
import matplotlib.pyplot as plt
plt.ion()
class Layer(Parameter):
def __init__(self, proto, t_op=None, tied_to=None):
super(Layer, self).__init__()
self.tied_to = tied_to
if proto.tied:
tied_to.num_shares += 1
proto = util.LoadMissi... | |
import random
from django.contrib.auth.models import AnonymousUser, Group, User
from django.db import connection
from django.test import RequestFactory
from django.test.utils import override_settings
import mock
import waffle
from test_app import views
from waffle.middleware import WaffleMiddleware
from waffle.model... | |
import os
import logging
import logging.handlers
import environment
import logconfig
# If using a separate Python package (e.g. a submodule in vendor/) to share
# logic between applications, you can also share settings. Just create another
# settings file in your package and import it like so:
#
# from comrade.co... | |
#!/usr/bin/env python2.7
#
# This is the Telegraf build script.
#
# Current caveats:
# - Does not checkout the correct commit/branch (for now, you will need to do so manually)
# - Has external dependencies for packaging (fpm) and uploading (boto)
#
import sys
import os
import subprocess
import time
import datetime... | |
# Copyright (c) Ralph Meijer.
# See LICENSE for details.
"""
Tests for L{udplog.redis}.
"""
from __future__ import division, absolute_import
import simplejson
from twisted.application.internet import TCPClient
from twisted.internet import defer
from twisted.trial import unittest
from udplog import redis
from udplo... | |
# 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... | |
# Emote Trainer Wrapper / Mass Analyzer
# Command line interface for mass analysis for Emote, and to train Emote's classification system using TextBlob's API
# Note: Training features have not yet been implemented yet
# All that's really working is mass analyzing text files through the CLI
#!/usr/bin/python
# -*- codi... | |
import fnmatch
import glob
import os
import re
import tempfile
from datetime import datetime
from gppylib import gplog
from gppylib.commands.base import WorkerPool, Command, REMOTE
from gppylib.commands.unix import Scp
from gppylib.db import dbconn
from gppylib.db.dbconn import execSQL
from gppylib.gparray import GpArr... | |
"""Gaussian processes regression. """
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base im... | |
"""
snackPacket.py
class for collected snack icon that follows dino to station after collection
"""
import pygame
import dinosInSpace
import infoGraphic56
import gfx56
import fpsSwitch
WHITE = (255,255,255)
BLACK = (0,0,0)
FONTCOLOR = BLACK
FONTSIZE = 16
RELATIVE_TO_DINO_CENTER = (-40,-40)
SCALESTEP = 2
SCALES... | |
# Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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... | |
import socket, select, time, struct, random
from libs.dae.socks import network_socket
REALM_MESSAGE_KEEP_ALIVE = 1
REALM_MESSAGE_KEEP_ALIVE_OPEN = 1
REALM_MESSAGE_KEEP_ALIVE_CLOSE = 2
REALM_MESSAGE_USER_LOGIN = 2
GAME_MESSAGE_UPDATE_PLAYER_POSITION = 3
GAME_MESSAGE_CREATE_PLAYER = 5
GAME_MESSAGE_UPDATE_PLAYER = 6... | |
# !/usr/bin/python
# (c) Shahar Gino, June-2017, sgino209@gmail.com
from sys import exit, argv
from getopt import getopt, GetoptError
from numpy import loadtxt, savetxt, float32, empty
from os import path, mkdir, chdir, system, listdir
from cv2 import imread, imwrite, cvtColor, COLOR_RGB2GRAY
__version__ = "1.0"
# P... | |
#!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... | |
""" List of all possible 'tasks', i.e. ci configurations.
WARNING : this is siconos specific!!
A task, see :class:`machinery.ci_tasks.CiTask` must be defined with at least:
* a name (ci_config)
* a distribution (name:version)
* a list of dependencies (pkgs)
"""
from machinery.ci_task import CiTask
import os
# not g... | |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2022 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
import re
import sys
import threading
from collections import defaultdict
fro... | |
# coding=utf-8
# Copyright 2015 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 os
from colle... | |
#!/usr/bin/env python
#
# Copyright (c) 2011, Andres Moreira <andres@andresmoreira.com>
# 2011, Felipe Cruz <felipecruz@loogica.net>
# 2012, JT Olds <jt@spacemonkey.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitte... | |
# 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... | |
#
# Handler library for Linux IaaS
#
# Copyright 2014 Microsoft Corporation
#
# 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... | |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify impo... | |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import cPickle as pickle
class HWaitingRuleLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HWaitingRuleLHS.
"""
# Create the himesis graph
EDG... | |
"""
An extension of the Python stdlib SimpleHTTPServer module, to
support the "Range" header in HTTP requests, as needed by iOS Safari
to support (some) MP3s.
Some methods are modifications to the original SimpleHTTPServer that is
part of the Python stdlib. This uses the versions that ship with Python
2.7 on Fedora 1... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Delta(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "indicator"
_path_str = "indicator.delta"
_valid_props = {
"decreasing",
"font... | |
from __future__ import absolute_import
import logging
import datetime
import iso8601
import elasticsearch
from six import iteritems
from six.moves.urllib.parse import urlparse
log = logging.getLogger(__name__)
RESULTS_MAX_SIZE = 200
RESULTS_DEFAULT_SIZE = 20
class ElasticSearch(object):
"""
Thin wrapper ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
#sys.path.append("".join([os.path.dirname(__file__), "/../"]))
from libnmap.parser import NmapParser
from libnmap.diff import NmapDiffException
class TestNmapParser(unittest.TestCase):
def setUp(self):
fdir = os.path.dirname(os.path... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
programs
----------------------------------
The different programs feeding into the UGS
service. They handle seeding, updating the different
data sources.
"""
import ConfigParser
import csv
import cx_Oracle
import glob
import models
import resultmodels as resultmodel
... | |
import hashlib
import logging
import os
import threading
import time
import types
import uuid
from collections import namedtuple
from kazoo import security
from kazoo.client import KazooClient
from kazoo.exceptions import NoNodeError
from kazoo.exceptions import KazooException
from pykit import config
from pykit impor... | |
import os
import subprocess as sp
from tqdm import tqdm
from moviepy.config import get_setting
from moviepy.decorators import (requires_duration,use_clip_fps_by_default)
from moviepy.tools import verbose_print, subprocess_call
import numpy as np
try:
from subprocess import DEVNULL # py3k
except ImportError:
D... | |
from __future__ import unicode_literals
import os.path
import optparse
import shlex
import sys
from .compat import (
compat_expanduser,
compat_getenv,
)
from .utils import (
get_term_width,
write_string,
)
from .version import __version__
def parseOpts(overrideArguments=None):
def _readOptions(f... | |
from __future__ import unicode_literals
import re
import six
from six.moves.urllib.parse import parse_qs, urlparse
import xmltodict
from moto.core.responses import _TemplateEnvironmentMixin
from moto.s3bucket_path.utils import bucket_name_from_url as bucketpath_bucket_name_from_url, parse_key_name as bucketpath_par... | |
'''
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 ... | |
#!/usr/bin/env python2.5
"""
test_tasks.py
"""
#88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
# options
#88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
from optparse import OptionParser
import sys, os
import os.path
imp... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Colorscale(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "sankey.link"
_path_str = "sankey.link.colorscale"
_valid_props = {"cmax", "cmin", "color... | |
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | |
# -*- coding: utf-8 -*-
from EXOSIMS.Prototypes.OpticalSystem import OpticalSystem
import astropy.units as u
import numpy as np
import scipy.stats as st
import scipy.optimize as opt
from numpy import nan
class Nemati(OpticalSystem):
"""Nemati Optical System class
This class contains all variables and meth... | |
#www.stuffaboutcode.com
#Raspberry Pi, Minecraft - Create 3D Model from Obj file
# Version 2 - draws complete faces rather than wireframes and uses materials
#import the minecraft.py module from the minecraft directory
import sys
sys.path.append("../")
import mcpi.minecraft as minecraft
#import minecraft block module... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
from contextlib import contextmanager
from distutils.version import LooseVersion
import re
import numpy as np
from numpy.testing import assert_array_equal
from xarray.core.duck_array_ops import ... | |
""" Python back-end. Generates python code from ir-code. """
import contextlib
import io
import logging
import time
from ... import ir
from ...graph import relooper
def literal_label(lit):
""" Invent a nice label name for the given literal """
return "{}_{}".format(lit.function.name, lit.name)
def ir_to_py... | |
"""Tests for Philips Hue config flow."""
import asyncio
from unittest.mock import Mock, patch
import aiohue
import pytest
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import ssdp
from homeassistant.components.hue import config_flow, const
from tests... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# coding:utf-8
"""
Spelling corrector library, used to correct common typos in domains like
gmal.com instead of gmail.com.
The spelling corrector uses difflib which in turn uses the
Ratcliff-Obershelp algorithm [1] to compute the similarity of two strings.
This is a very fast an accurate algorithm for domain spelling ... | |
""" Tests for engine queries """
import six
from flywheel import (Field, Composite, Model, NUMBER, STRING_SET, GlobalIndex,
DuplicateEntityException, EntityNotFoundException, Limit)
from flywheel.tests import DynamoSystemTest
# pylint: disable=C0121
class User(Model):
""" Model for testing... | |
# Author: Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from nose.tools import assert_equal
import numpy as np
from numpy.testing import (assert_array_equal, assert_almost_equal,
assert_allclose, assert_array_almost_equal)
from mne.channels.montage i... | |
import target
import selectiondag
from vis import irvis
from vis import dagvis
from vis import interferencevis
from passes import jumpfix
from passes import blockmerge
from passes import unused
from passes import branchreplace
from passes import constantfold
from passes import copypropagation
from passes import mem2r... | |
# -*- coding: utf-8 -*-
"""Test tables"""
import pytest
from pyrseas.testutils import DatabaseToMapTestCase
from pyrseas.testutils import InputMapToSqlTestCase, fix_indent
CREATE_STMT = "CREATE TABLE t1 (c1 integer, c2 text)"
COMMENT_STMT = "COMMENT ON TABLE t1 IS 'Test table t1'"
CREATE_STOR_PARAMS = CREATE_STMT + ... | |
import warnings
import numpy as np
from .base import _fit_liblinear, BaseSVC, BaseLibSVM
from ..base import BaseEstimator, RegressorMixin
from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \
LinearModel
from ..feature_selection.from_model import _LearntSelectorMixin
from ..utils import check_X... | |
"""
Extensible validation for Python dictionaries.
This module implements Cerberus Validator class
:copyright: 2012-2015 by Nicola Iarocci.
:license: ISC, see LICENSE for more details.
Full documentation is available at http://cerberus.readthedocs.org/
"""
import sys
import re
import copy
from da... | |
# Copyright (C) 2015 Artem Chepurnoy <artemchep@gmail.com>
#
# This script is published under the terms of the MIT license.
# See http://opensource.org/licenses/mit-license.php
# Python 3 is required
import itertools
from sudoku import Clue
class _Data:
pass
class _Ceil:
def __init__(self, data):
... | |
import itertools
import logging
import os
import shutil
from typing import List, Tuple, Dict, TypeVar, Generator
import numpy as np
import vcf
from .segment_quality_utils import HMMSegmentationQualityCalculator
from .. import types
from ..io import io_consts, io_commons, io_denoising_calling, io_intervals_and_counts... | |
#! /usr/bin/env python
"""Regression test.
This will find all modules whose name is "test_*" in the test
directory, and run them. Various command line options provide
additional facilities.
Command line options:
-v: verbose -- run tests in verbose mode with output to stdout
-w: verbose2 -- re-run failed tests... | |
from __future__ import print_function, unicode_literals, absolute_import
import glob
import io
import itertools
import os
import compdb
from compdb.backend.json import (JSONCompilationDatabase,
compile_commands_to_json)
from compdb.backend.memory import InMemoryCompilationDatabase
fro... | |
# Copyright (c) 2013 Michael Bitzi
# Licensed under the MIT license http://opensource.org/licenses/MIT
import logging
from pwm.config import config
from pwm.ffi.xcb import xcb
import pwm.bar
import pwm.windows
import pwm.layout
import pwm.events
workspaces = []
current_workspace_index = 0
class Workspace:
def ... | |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | |
import unittest
import os
import sys
from unittest import mock
from tempfile import TemporaryDirectory
from mkdocs.structure.pages import Page
from mkdocs.structure.files import File, Files
from mkdocs.tests.base import load_config, dedent
class PageTests(unittest.TestCase):
DOCS_DIR = os.path.join(os.path.absp... | |
# Copyright 2015-2016 Florian Lehner. All rights reserved.
#
# The contents of this file are 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
#
# Unl... | |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | |
#!/usr/bin/python
# Time-stamp: <2015-12-13 20:06:19 marine>
# Project : Snow in the F - layer
# Subproject : seismic observations
# Author : Marine Lasbleis
import math
import scipy.io as io
import numpy as np
import json # for writing in files
import os.path
import matplotlib.pyplot as plt
import param
# Compute... | |
from __future__ import absolute_import
from unet_collection.layer_utils import *
from tensorflow.keras.layers import Input, Conv3D
from tensorflow.keras.layers import BatchNormalization, Activation, concatenate, multiply
from tensorflow.keras.layers import ReLU, LeakyReLU, PReLU, ELU
from tensorflow.keras.models impo... | |
""" Tests internal math routines
"""
import random
import itertools
import numpy as np
import pytest
import moldesign
from moldesign import units as u
from moldesign.mathutils import spherical_harmonics as harmonics
from . import helpers
from .molecule_fixtures import *
registered_types = {}
__PYTEST_MARK__ = ['m... | |
from __future__ import division
from math import ceil
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.http import Http404
from django.shortcuts import redirect, render
from redis.exceptions import ResponseError
from rq import requeue_job, Worker... | |
# 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 time
from typing import Tuple, cast
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from dateutil import parser
MAX_INCIDENTS_TO_FETCH = 250
class Client(BaseClient):
def __init__(self, server_url, verify, proxy, headers, auth):
super().__init__(base_url... | |
from __future__ import unicode_literals, division, absolute_import
import sys
from distutils.version import LooseVersion
from ssl import SSLError
from urllib2 import URLError
from sqlalchemy import Column, Integer, String
from flexget import db_schema, plugin, options
from flexget.event import event
from flexget.log... | |
"""Recurrent neural network language model with static graph optimizations.
This is a modified version of the standard Chainer Penn Tree Bank (ptb)
example that
includes static subgraph optimizations. It is mostly unchanged
from the original model except that that the RNN is unrolled for `bproplen`
slices inside of a ... | |
"""Translation helper functions."""
import locale
import os
import re
import sys
import warnings
import gettext as gettext_module
from cStringIO import StringIO
from threading import local
from django.utils.importlib import import_module
from django.utils.safestring import mark_safe, SafeData
# Translations are cac... | |
from unittest import mock, skipUnless
from django.db import connection
from django.db.models import Index
from django.db.utils import DatabaseError
from django.test import TransactionTestCase, skipUnlessDBFeature
from .models import Article, ArticleReporter, City, District, Reporter
class IntrospectionTests(Transac... | |
"""
Basic unit tests for the HTTP Router.
Not complete by any means, but having something to start with means we can
add issues as they occur so we have automated regression testing.
"""
import time
from datetime import datetime
from django.test import TestCase, TransactionTestCase
from nose.tools import nottest
fr... | |
'''
Integration tests for backend locks.
'''
import etcd
import pylibmc
import redis
import sherlock
import time
import unittest
class TestRedisLock(unittest.TestCase):
def setUp(self):
try:
self.client = redis.StrictRedis(host='redis')
except Exception as err:
print... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.