gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from flask import Flask, jsonify, request
from src.webapp.webapps import *
app = Flask(__name__)
matchDF = get_match_df()
playerPerformanceObj = PlayerPerformance()
########### DropDown Lists ###########
seasonList = get_dropdown_list(matchDF,"season",1,"int")
lboundList = get_dropdown_list(matchDF,"season",1,"int")... | |
#-------------------------------------------------------------------------------
# bob: parser.py
#
# Parser for a subset of Scheme. Follows the grammar defined in R5RS
# 7.1.2 (External Representations).
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#----------------------------------------... | |
# 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 ... | |
import os, sys, hashlib, re, gzip, random
from os.path import isdir, basename
# We use forward slashes for paths even on Windows
# in order for consistency with URLs.
# For now, still use os.path.join instead of posixpath.join
# in case we're relying on correct behavior with absolute
# Windows paths. Also consider i... | |
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | |
__author__ = 'mramire8'
__copyright__ = "Copyright 2014, ML Lab"
__version__ = "0.1"
__status__ = "Research"
import sys
import os
sys.path.append(os.path.abspath("."))
sys.path.append(os.path.abspath("../"))
sys.path.append(os.path.abspath("../experiment/"))
from experiment_utils import *
import argparse
import nump... | |
# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ProcessPoolExecutor.
The follow diagram and text describe the data-flow through the system::
|==================== In-process ====================|== Out-of-process ==|
+----------+ +-----... | |
import unittest
import opentuner
import mock
import random
import numpy
from opentuner.search import manipulator
def faked_random(nums):
f = fake_random(nums)
def inner(*args, **kwargs):
return f.next()
return inner
def fake_random(nums):
i = 0
while True:
yield nums[i]
i =... | |
#-*- coding: utf-8 -*-
import os
from django.test import TestCase
from django.core.urlresolvers import reverse
import django.core.files
from django.contrib.admin import helpers
from django.contrib.auth.models import User
from django.conf import settings
from filer.models.filemodels import File
from filer.models.folder... | |
import pandas as pd
import geohash
import time
import itertools
import numpy as np
import random
'''
This module is meant to be used in conjunction with pipekml however I could see how it could have other uses.
Module: pipegeohash.py
Purpose: A simple tool for geohashing an entire table at once,and allowing you to ... | |
# Copyright 2020 DeepMind Technologies Limited.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | |
"""The tests for the Xiaomi router device tracker platform."""
import logging
import requests
from homeassistant.components.device_tracker import DOMAIN
import homeassistant.components.xiaomi.device_tracker as xiaomi
from homeassistant.components.xiaomi.device_tracker import get_scanner
from homeassistant.const impor... | |
# Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Mikolaj Magnuski <mmagnuski@swps.edu.pl>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD (3-clause)
from copy import deepcopy
from distutils.version import LooseVersion
import os.path as op
import shutil
from unittest import Sk... | |
#!/usr/bin/python
# Copyright (c) 2015, Cloudera, 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 ag... | |
#!/usr/bin/python
import sys
import itertools
import getopt
import copy
from fractions import gcd
from math import exp,log,sqrt,ceil,factorial
from time import time, gmtime, strftime
# Don't print debug info by default
debug = 0
# Overall reduction ratio
ratio_m = 60
ratio_n = 1
# Number of gear sets
stages = 2
# ... | |
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# 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 condit... | |
"""
UNIT 3: Functions and APIs: Polynomials
A polynomial is a mathematical formula like:
30 * x**2 + 20 * x + 10
More formally, it involves a single variable (here 'x'), and the sum of one
or more terms, where each term is a real number multiplied by the variable
raised to a non-negative integer power. (Remembe... | |
#!/usr/bin/env python
"""Bootstrap setuptools installation
To use setuptools in your package's setup.py, include this
file in the same directory and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
To require a specific version of setuptools, set a download
mirror, ... | |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
import functools
import arrow
import datetime
from typing import List, Dict, Set, Union, Generator
from merakicommons.cache import lazy, lazy_property
from merakicommons.container import searchable, SearchableList, SearchableLazyList, SearchableDictionary
from .. import configuration
from ..data import Region, Platfo... | |
#! /usr/bin/env python
__author__ = "Fabio Giuseppe Di Benedetto"
import socket
import select
import Queue
import re
import json
import subprocess
import rospy
from robotics_msgs.msg import Robot_Event
from robotics_msgs.msg import CB_Event
from robotics_msgs.srv import FIROS_Info, FIROS_InfoResponse
class RCMDrive... | |
"""Test the Nanoleaf config flow."""
from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
from aionanoleaf import InvalidToken, NanoleafException, Unauthorized, Unavailable
import pytest
from homeassistant import config_entries
from homeassistant.components.nanoleaf.const import D... | |
# Copyright 2016 SAS Project 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 requ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical Corp.
# 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
... | |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import netutil
from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str
from tornado import gen
from tornado.http1connection import HTTP1Connection
from tornado... | |
#!/usr/bin/env python
"""
chex
Indexes chess game states from one or more PGN files
(https://en.wikipedia.org/wiki/Portable_Game_Notation) with Spotify's annoy
(https://github.com/spotify/annoy) so the user can search for game states
similar to a game state they input as well as the games in which they're
found.
Requ... | |
# -*- 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 model 'Conference'
db.create_table(u'conference', (
... | |
import logging
import time
import requests
import six.moves.urllib.parse as urlparse
from .. import client
from ..common import constants
from ..common import exceptions
from ..common import serializer
from ..common import utils
from ..i18n import _
_logger = logging.getLogger(__name__)
def exception_handler_v20(s... | |
from itertools import product
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.common.exceptions as com
clickhouse_driver = pytest.importorskip("clickhouse_driver")
@pytest.fixture(scope='module')
def diamonds(con):
return con.table('diamonds')
@pytest.fixture(scope='modu... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ApplicationTestCase(Integ... | |
# coding= utf-8
'''
unregistered setup:
1. at .do creation, unique hash ID from SITE is used. So it being per-project.
2. any access to SITE using that ID is granted to anon
registered setup:
0. user can secure his ID's by applying his hash (username+pass) in config
1. same as unregistered.1
2. any access to SITE usi... | |
"""The tests for the hassio component."""
from datetime import timedelta
import os
from unittest.mock import patch
import pytest
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import frontend
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from home... | |
# 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) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2021 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:/... | |
""" path.py - An object representing a path to a file or directory.
Example:
from path import path
d = path('/home/guido/bin')
for f in d.files('*.py'):
f.chmod(0755)
This module requires Python 2.2 or later.
URL: http://www.jorendorff.com/articles/python/path
Author: Jason Orendorff <jason@jorendorff.com... | |
# Copyright 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
from __future__ import print_function, absolute_import
from builtins import str
import os
import copy
import shutil
from os.path import relpath, join, exists, dirname, basename
from os import makedirs, remove
from json import load
from tools.export.exporters import Exporter, apply_supported_whitelist
from tools.targ... | |
# -*- coding: utf-8 -*-
"""
Class for reading data from Alpha Omega .map files.
This class is an experimental reader with important limitations.
See the source code for details of the limitations.
The code of this reader is of alpha quality and received very limited testing.
This code is written from the incomplete ... | |
import tensorflow as tf
from sklearn import datasets
from sklearn.cross_validation import train_test_split
import sys
# # Vhanilla RNN class and functions
class RNN_cell(object):
"""
RNN cell object which takes 3 arguments for initialization.
input_size = Input Vector size
hidden_layer_size = Hidden... | |
# -*- coding: utf-8 -*-
'''
Support for rpm
'''
# Import python libs
from __future__ import absolute_import
import logging
import os
import re
import datetime
# Import Salt libs
import salt.utils
import salt.utils.itertools
import salt.utils.decorators as decorators
import salt.utils.pkg.rpm
# pylint: disable=import-... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Third Party Stuff
from django import forms
from django.utils.safestring import mark_safe
from django.utils.timezone import now
from pagedown.widgets import PagedownWidget
# Junction Stuff
from junction.base.constants import (
Confe... | |
import time
from hashlib import md5
import requests
from django.conf import settings
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.status import HTTP_400_BAD_REQUEST
from rest_framework.views import APIView
from rest_framework_extensions.cache.d... | |
from __future__ import division
import numpy as np
from pandas import Interval, Timestamp, Timedelta
import pandas.core.common as com
import pytest
import pandas.util.testing as tm
@pytest.fixture
def interval():
return Interval(0, 1)
class TestInterval(object):
def test_properties(self, interval):
... | |
"""
Support for Z-Wave lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.zwave/
"""
import logging
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from threading import Timer
from homeassistant.components.light impo... | |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | |
import os
import unittest
from datetime import datetime
from test.config import config
from pysmap import SmappCollection
class TestSmappCollection(unittest.TestCase):
def test_control(self):
self.assertTrue(True)
def test_smapp_bson_collection_iterates(self):
file_path = '{}/{}'.format(os.path.... | |
"""
Package WAGL HDF5 Outputs
This converts the HDF5 file (and sibling fmask/gqa files) into
GeoTIFFS (COGs) with datacube metadata using the DEA naming conventions
for files.
"""
import contextlib
import os
import re
import sys
from datetime import datetime, timedelta
from enum import Enum
from pathlib import Path
fr... | |
import numpy
from residuals import Robust
import result as pod_result
try:
from scipy.optimize import leastsq
except:
print 'Scipy is not installed'
try:
from lmfit import minimize, Parameters
except:
print 'lmfit-py is not installed'
class Algorithm(object):
def __init__(self):
pass
... | |
# 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... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains the classes to build a ConversionElectrode.
"""
from typing import Iterable, Dict
from dataclasses import dataclass
from monty.dev import deprecated
from scipy.constants import N_A
fr... | |
# -*- encoding: utf-8 -*-
import json
import os
import unittest
from cas_client import CASClient, CASResponse
try:
from urlparse import parse_qs
except ImportError:
from urllib.parse import parse_qs
try:
import mock
except ImportError:
from unittest import mock
class TestCase(unittest.TestCase):
... | |
import datetime
import json
import math
from string import Template
import sys
import traceback
import random
from asgiref.sync import async_to_sync
from EOSS.analyst.helpers import feature_expression_to_string
from EOSS.critic.critic import Critic
from EOSS.data_mining.api import DataMiningClient
from EOSS.data_mini... | |
# -*- 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 model 'ArticleAsset'
db.create_table('journalmanager_articleasse... | |
# Copyright 2022 The jax3d 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 applicable law or agreed to in wr... | |
## client.py
# Basic IRC client implementation.
import time
import datetime
import itertools
import logging
from . import async
from . import connection
from . import protocol
__all__ = [ 'Error', 'AlreadyInChannel', 'NotInChannel', 'BasicClient' ]
PING_TIMEOUT = 720
DEFAULT_NICKNAME = '<unregistered>'
class Error(... | |
#!/usr/bin/env python
## Bacon Game Jam 08
## Harry Beadle
## Solo Entry
#### Theme: "Millions of them."
#### Interpritation: "Google Searches"
# Requires Random and Urllib2
from random import shuffle
from urllib2 import urlopen
# Requires Pygame
import pygame as p
p.init()
X = 1280
Y = 720
Origin = (0, 0)
scr = p... | |
# 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... | |
"""
Test Workspace client
"""
__author__ = 'dang'
## Imports
# System
import logging
import time
import unittest
# Local
from . import shared
from doekbase.data_api import core, wsfile
from doekbase.workspace import client as ws_client
_log = logging.getLogger('doekbase.tests.test_ws_client')
genome_new = "Reference... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | |
# Copyright 2017 CBSD Project 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 applic... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | |
# -*- coding: utf-8 -*-
"""
This code isn't to be called directly, but is the core logic of the KaplanMeierFitter.fit_interval_censoring
References
https://upcommons.upc.edu/bitstream/handle/2117/93831/01Rop01de01.pdf
https://docs.ufpr.br/~giolo/CE063/Artigos/A4_Gomes%20et%20al%202009.pdf
"""
from collections import ... | |
# 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... | |
"""
Module that contains many useful utilities
for validating data or function arguments
"""
import warnings
from pandas.core.dtypes.common import is_bool
def _check_arg_length(fname, args, max_fname_arg_count, compat_args):
"""
Checks whether 'args' has length of at most 'compat_args'. Raises
a TypeErro... | |
from sympy.core import (S, symbols, Eq, pi, Catalan, EulerGamma, Lambda,
Dummy, Function)
from sympy.core.compatibility import StringIO
from sympy import erf, Integral, Piecewise
from sympy import Equality
from sympy.matrices import Matrix, MatrixSymbol
from sympy.printing.codeprinter import Ass... | |
#!/usr/bin/env python
'''
Created on 4 Feb 2010
@author: tcezard
'''
import os, sys, logging
from optparse import OptionParser
import utils
from utils import utils_param, utils_logging, compare_version_number,\
get_bwa_version, longest_common_substr_from_start
import command_runner
from utils.GenomeLoader import G... | |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9817")
else:
access = Ser... | |
# To run:
# python example-riaks.py deploy
# python example-riaks.py add_haproxies
# solar changes stage
# solar changes process
# solar orch run-once last
import click
import sys
from solar.core import resource
from solar.core import signals
from solar.core import validation
from solar.core.resource import virtual_... | |
from functools import reduce
import operator, readtime
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.utils import timezone
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.fields import Gen... | |
# coding: utf-8
import datetime, hashlib, decimal
from sqlalchemy import sql, Column, String, Integer, Boolean, DateTime, Float, ForeignKey
from sqlalchemy.orm import relation, backref, column_property, synonym
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from tornado.options import options
fr... | |
# Copyright 2011 James McCauley
#
# 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 writi... | |
"""Implement the rules of each Python build utility type."""
import compileall
import logging
import os
import subprocess
import zipfile
import mool.shared_utils as su
MAIN_FILE_NAME = '__main__.py'
INIT_FILE_NAME = '__init__.py'
PY_SHEBANG_HEADER = '#!/usr/bin/env python2.7\n'
SHEBANG_SYMBOL = '#!'
# Thanks to the ... | |
import sublime, sublime_plugin
from threading import Timer
import threading
### set global variables
atshape = "non-rotated"
baseline = 0
forceshapelimit = 5
game = 0
shapesPlayed = 0
shapeheight = 0
shapewidth = 0
solidifiedRegions = []
text = []
shapeDetails = {}
gameOver = 0
illegalMove = 0
forceSolidify = 0
... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gym
import logging
import numpy as np
from functools import partial
from ray.tune.registry import RLLIB_MODEL, RLLIB_PREPROCESSOR, \
RLLIB_ACTION_DIST, _global_registry
from ray.rllib.models.extra_... | |
'''
MIT License
Copyright (c) 2017 Matej Usaj
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, publish, di... | |
# -*- 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... | |
"""Provides a set of functions nad clases for different purpose."""
import logging
from logging.handlers import WatchedFileHandler
import socket
import codecs
import time
import re
import os
import yaml
def delegate(attribute_name, method_names):
"""Pass the call to the attribute called attribute_name for every ... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... | |
from os import path
import pyteomics
import pickle
#pyteomics.__path__ = [path.abspath(path.join(path.dirname(__file__), path.pardir, 'pyteomics'))]
import unittest
import random
from pyteomics import auxiliary, mass
from pyteomics import cmass, cparser
cmass.nist_mass = mass.nist_mass
import gzip
class MassTest(uni... | |
# Copyright 2014 IBM Corp.
# 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 app... | |
""" Access and control log capturing. """
import logging
import re
from contextlib import contextmanager
import py
import pytest
from _pytest.compat import nullcontext
from _pytest.config import create_terminal_writer
from _pytest.pathlib import Path
DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(line... | |
from .. xmlstream.stanzabase import registerStanzaPlugin, ElementBase, ET, JID
from .. stanza.iq import Iq
from .. stanza.message import Message
from .. basexmpp import basexmpp
from .. xmlstream.xmlstream import XMLStream
import logging
from . import xep_0004
class PubsubState(ElementBase):
namespace = 'http://jabb... | |
from ..utils import Scraper
from bs4 import BeautifulSoup
from collections import OrderedDict
from operator import itemgetter
from pprint import pprint
from queue import Queue
from threading import Thread, Lock
from time import time
import os
import re
import sys
class Textbooks:
"""A scraper for UofT's book stor... | |
import os
import re
from time import sleep
from opensextant import Place
from opensextant.gazetteer import DB, estimate_name_bias, GazetteerIndex, get_default_db
from opensextant.utility import replace_diacritics, load_list
def filter_out_feature(pl: Place, feats):
"""
Filter out places by their feature type... | |
# Copyright 2016 Twitter. 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 agree... | |
'''
nlp:part of the wordfish python package: extracting relationships of terms from corpus
functions for simple natural language processing
Copyright (c) 2015-2018 Vanessa Sochat
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "So... | |
# Copyright 2013 Nebula 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... | |
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal, run_module_suite
from scipy.stats import \
binned_statistic, binned_statistic_2d, binned_statistic_dd
class TestBinnedStatistic(object):
@classmethod
def setup_class(c... | |
"""
dj-stripe Charge Model Tests.
"""
from copy import deepcopy
from decimal import Decimal
from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.test.testcases import TestCase
from djstripe.enums import ChargeStatus, LegacySourceType
from djstripe.models import (
Account, Charge... | |
import unittest
import pprint
import jsonschema
from scenario.player import play_scenario
from scenario.tests.consts import EXECUTABLE, DIALOUGE_PIECES
from scenario.consts import SCENARIO_JSON_SCHEMA
class PlayerTest(unittest.TestCase):
def _generate_scenario(self, name, args, dialogue, strictness=False):
... | |
"""
A :class:`FieldData` is used by :class:`~xblock.core.XBlock` to read and write
data to particular scoped fields by name. This allows individual runtimes to
provide varied persistence backends while keeping the API used by the `XBlock`
simple.
"""
import copy
from abc import ABCMeta, abstractmethod
from collections... | |
import numpy as np
import fitsio
from astrometry.util.fits import fits_table
from astrometry.util.resample import resample_with_wcs, OverlapError
from legacypipe.bits import DQ_BITS
from legacypipe.survey import tim_get_resamp
from legacypipe.utils import copy_header_with_wcs
import logging
logger = logging.getLogger(... | |
#! /usr/bin/env python
# Copyright (c) 2010-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 ... | |
r"""
Implements turbulence closure model stability functions.
.. math::
S_m &= S_m(\alpha_M, \alpha_N) \\
S_\rho &= S_\rho(\alpha_M, \alpha_N)
where :math:`\alpha_M, \alpha_N` are the normalized shear and buoyancy frequency
.. math::
\alpha_M &= \frac{k^2}{\varepsilon^2} M^2 \\
\alpha_N &... | |
# -*- coding: utf-8 -*-
from helper import IcebergUnitTestCase, get_api_handler
from helpers.login_utils import IcebergLoginUtils
class WebhookTestCase(IcebergUnitTestCase):
@classmethod
def setUpClass(cls):
cls.my_context_dict = {}
cls._objects_to_delete = []
cls.api_handler = get_a... | |
import uuid, json
from flask import Blueprint, request, url_for, flash, redirect, make_response
from flask import render_template, abort
from flask.ext.login import login_user, logout_user, current_user
from flask_wtf import Form
from wtforms.fields import TextField, TextAreaField, SelectField, HiddenField, PasswordFi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.