gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import absolute_import
import os
import re
import json
import base64
import inspect
import requests
import mimetypes
from StringIO import StringIO
from pytz import utc
from datetime import datetime, timedelta
from random import randint
from contextlib import contextmanager
from django.conf import set... | |
from pyhamtools.consts import LookupConventions as const
def freq_to_band(freq):
"""converts a Frequency [kHz] into the band and mode according to the IARU bandplan
Args:
frequency (float): Frequency in kHz
Returns:
dict: Dictionary containing the band (int) and mode (str... | |
#################################################
# #
# This class takes in a text file input of the #
# tax defaulters list, and parses it to extract #
# individual defaulter information such as #
# name, address and fine amount. #
# #
# Author: Shane Brennan #
# Date: 20171216 ... | |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
from rx.disposable import Disposable, CompositeDisposable, SingleAssignmentDisposable, SerialDisposable
from rx.internal import Struct
from rx.observable import Producer
import rx.linq.sink
from collections import deque
from threading import RLock
class Buffer(Producer):
def __init__(self, source, count=0, skip=0, ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# FILE: FriendsFollowers.py
#
# Object to request friends and followers of the specified user. This request
# requires cursoring. This really requires throttling because of the number of
# friends/followers are very large. Therefore, throttling this on by default.
#... | |
# Copyright (c) 2013 eBay Inc.
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
import re
import os
import csv
import xml.etree.ElementTree as ET
import logging
import glob
import json
from datetime import datetime
from collections import OrderedDict
from bs4 import BeautifulSoup # html parser
from io import open
class RunParser(object):
"""Parses an Illumina run folder. It generates data ... | |
#!/usr/bin/python
import cwiid
import sys
import time
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
import atexit
# create a default object, no changes to I2C address or frequency
mh = Adafruit_MotorHAT(addr=0x60)
mesg = False
led = 0
rpt_mode = 0
rumble = 0
erect_state = 0 # Thing is down (1 is ... | |
# Copyright (c) 2013 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 writi... | |
#! /usr/bin/env python
import mock
import errno
import socket
import ssl
from collections import deque
from nsq import connection
from nsq import constants
from nsq import exceptions
from nsq import response
from nsq import util
from nsq import json
from common import MockedSocketTest, HttpClientIntegrationTest
cl... | |
import pandas as pd
import numpy as np
import datetime
import math
import configuration
import rews
import binning
import warnings
warnings.simplefilter('ignore', np.RankWarning)
def getSeparatorValue(separator):
try:
return {"TAB":"\t",
"SPACE":" ",
"COMMA": ",",
... | |
import datetime
import unittest
import pymantic.rdf
import pymantic.util
from pymantic.primitives import *
XSD = Prefix('http://www.w3.org/2001/XMLSchema#')
RDF = Prefix("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
class TestRDF(unittest.TestCase):
def tearDown(self):
pymantic.rdf.MetaResource._classe... | |
# coding: utf-8
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from datetime import datetime
from pprint import pformat
from six import iterit... | |
'''
Entry point module to start the interactive console.
'''
from _pydev_imps._pydev_saved_modules import thread
from _pydevd_bundle.pydevd_constants import IS_JYTHON, dict_iter_items
start_new_thread = thread.start_new_thread
try:
from code import InteractiveConsole
except ImportError:
from _pydevd_bundle.pyd... | |
import bpy
from bpy.props import StringProperty, BoolProperty, EnumProperty
from ..rfb_utils import shadergraph_utils
from ..rfb_utils import object_utils
from ..rfb_logger import rfb_log
from .. import rman_bl_nodes
from ..rman_constants import RMAN_STYLIZED_FILTERS, RMAN_STYLIZED_PATTERNS, RMAN_UTILITY_PATTERN_NAMES ... | |
"""
xarray extensions (accessors).
"""
from collections import defaultdict
import warnings
import attr
import numpy as np
from xarray import as_variable, Dataset, register_dataset_accessor
from .drivers import XarraySimulationDriver
from .model import get_model_variables, Model
from .utils import Frozen, variables_d... | |
import numpy as np
import pytest
from pandas.core.dtypes.common import is_categorical_dtype
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,
Index,
Interval,
Series,
Timestamp,
)
from pandas.api.types ... | |
# Copyright (c) 2016 Anton Kozhevnikov, Thomas Schulthess
# 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | |
"""Functions for scoring frame-level diarization output."""
# TODO: Module is too long. Refactor.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import shutil
import subprocess
import tempfile
impo... | |
import numpy as np
import lxml.etree as lxml
import datetime
import sys
from __tools__ import XmlParser
from __xtpMolecule__ import *
ryd2ev=13.605692
hrt2ev=2*ryd2ev
def appendarrayorNone(datalist):
if type(datalist)==list:
if len(datalist)==0:
return None
else:
for eleme... | |
# 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... | |
# Copyright 2013 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 req... | |
# -*- 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... | |
from jirabulkloader.task_extractor_exceptions \
import TaskExtractorTemplateErrorProject
from mock import MagicMock, call
import pytest
def test_create_issue_replace_rt_variable(te, tf):
tf.write("\nh5. h5 task1 *assignee* [TASK_KEY1]"
"\nh5. h5 task2 *assignee* [TASK_KEY2]"
"\nh5. h... | |
'''tests for weightstats, compares with replication
no failures but needs cleanup
update 2012-09-09:
added test after fixing bug in covariance
TODOs:
- I do not remember what all the commented out code is doing
- should be refactored to use generator or inherited tests
- still gaps in test coverag... | |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
"""HTTP API implementation.
"""
import sys
from docopt import docopt
from flask import Flask
from flask import make_response
from flask import request
import numpy as np
import ujson
from werkzeug.exceptions import BadRequest
from . import __version__
from .fit import activate as activate_base
from .fit import fit a... | |
# Copyright 2017 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, s... | |
##########################################################################
#Copyright 2015 Rasmus Dall #
# #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#you may not use thi... | |
import os
import re
import inspect
def file_content(filepath):
""" Fetches and formats file's content to perform the required operation.
"""
infile = open(filepath, 'r')
filelines = tuple(infile)
infile.close()
comment_indexes = []
comments = []
for line in enumerate(filelines):
if "@startDocuB... | |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | |
#populate.py
def print_crafting_tree(context):
#item = Recipe.objects.get(output_item_id=19714)
item = Item.objects.get(pk=45868)
tree = item.buy_or_craft()
print('For item: ' + item.name)
shopping_list = {}
print_list(tree, shopping_list)
context['shopping_list'] = shopping_list
def pr... | |
"""
Tests for EntityData generic list view
This test suite focuses on listing of record fields used by
record views and lists. This serves two purposes:
- it tests some additional options of the entity list logic
that are not tested by the dfeault list view, and
- it tests the logic that access site-wide data in ... | |
from django.db import models, connection
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from scipy_central.person.models import User
from scipy_central.utils import rest_help_extra
rest_help = ('Let the community know what your submission does, how it solves '
... | |
import cPickle
import math
import random
import types
import hlib
import hlib.api
import hlib.engine
import hlib.events
import lib.datalayer
import hlib.log
import games
import games.color
import games.settlers.board_def
# pylint: disable-msg=F0401
import hruntime # @UnresolvedImport
InactivePathError = lambda: g... | |
# coding=utf-8
import os
import tempfile
import shutil
from django.core.files.uploadedfile import UploadedFile
from django.test import TransactionTestCase
from django.contrib.auth.models import Group
from hs_core.testing import MockIRODSTestCaseMixin
from hs_core import hydroshare
from hs_core.models import BaseResou... | |
"""Tests for the WLED config flow."""
from unittest.mock import MagicMock
from wled import WLEDConnectionError
from homeassistant.components.wled.const import CONF_KEEP_MASTER_LIGHT, DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_... | |
"""
@file inv/api/methods.py
@author Brian Kim
@brief this module defines the list of api methods supported by inv
as well as the authorization scheme of user groups
"""
from model import *
from datetime import datetime
# definition of the methods
def save():
db.session.commit()
def list_obj2dic... | |
import os
import unittest
from conans.client import tools
from conans.model.ref import ConanFileReference
from conans.test.utils.tools import TestClient
from conans.util.files import load, mkdir, rmdir
conanfile = '''
from conans import ConanFile
from conans.util.files import save, load
import os
class ConanFileTool... | |
# Copyright 2016 James Hensman, alexggmatthews, Mark van der Wilk
# Copyright 2017 Thomas Viehmann
#
# 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... | |
'''
Code for simulating secure key rate, twofolds, and quantum bit error rate
Written in Python and QuTIP by Catherine Holloway (c2hollow@iqc.ca).
Detector model and squashing functions by Catherine Holloway,
based on code by Dr. Thomas Jennewein (tjennewe@iqc.ca).
Contributed to the QuTiP project on June 06, 2012 by... | |
# -*- coding: utf-8 -*-
import basic
import site_builder
import re
from sets import Set
from functions import getReadbleTime, prettyItemBonus, getDisplayPages
import math
from guild import guildsController
import json
import random
import cherrypy
class miscController(basic.defaultController):
@basic.printpage
def... | |
# Copyright (c) 2015 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 writ... | |
from datetime import timedelta, datetime, time
import json
from couchdbkit import ResourceNotFound
from django.contrib import messages
from django.utils.decorators import method_decorator
import pytz
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404, HttpResponse
from dj... | |
# encoding: utf-8
import 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 'Language'
db.create_table('journalmanager_language', (
('id', self.gf('django.... | |
# pylint: disable=E1101
"""
BaseWorker.py
"""
import random
import logging
import logging.config
import msgpack
import zmq
from zmq.log.handlers import PUBHandler
from zmq.eventloop.zmqstream import ZMQStream
from zmq.eventloop.ioloop import IOLoop, DelayedCallback, PeriodicCallback
from cps2zmq.gather import mdp, log
... | |
# 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 applicable law or agree... | |
import numpy as np
import pytest
import pytz
import pandas as pd
from pandas import DataFrame, Index, Series, date_range
import pandas._testing as tm
class TestDataFrameAlign:
def test_frame_align_aware(self):
idx1 = date_range("2001", periods=5, freq="H", tz="US/Eastern")
idx2 = date_range("2001... | |
# Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import pytest
import math
from ezdxf.path import (
Path,
make_path,
converter,
Command,
tools,
)
from ezdxf.math import (
Vec3,
Vec2,
Matrix44,
Bezier4P,
Bezier3P,
close_vectors,
OCS,
)
from ezdxf.entities impor... | |
# game.py
# -------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkel... | |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# This script will locally construct a merge commit for a pull request on a
# github repository, inspect it, ... | |
#!/usr/bin/env python
"""
map.py
State Estimation and Analysis for PYthon
Utilities for dealing with basemap plotting. These routnes are simply
abstractions over the existing basemap to make it quicker for generating
basemap plots and figures.
Examples
-------
Assume you have longitude, latitu... | |
#!/usr/bin/env python
"""Operations on a series of points, indexed by time.
"""
import copy
from grr.lib import rdfvalue
NORMALIZE_MODE_GAUGE = 1
NORMALIZE_MODE_COUNTER = 2
class Timeseries(object):
"""Timeseries contains a sequence of points, each with a timestamp."""
def __init__(self, initializer=None):
... | |
import cookielib
import urllib
import urllib2
import os
import pickle
import pymongo
import pygal
import locale
from bson.son import SON
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
from flask import Flask, session, render_template, request
from pprint import pprint
app = Flask(__name__)
use... | |
#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
import os
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
from tests.common.impala_cluster import ImpalaCluster
from tests.common.skip impor... | |
#!/usr/bin/python
import sys, os, re, platform
from os.path import exists, abspath, dirname, join, isdir
try:
# Allow use of setuptools so eggs can be built.
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
from distutils.extension import Extension
from ... | |
# sshrepo.py - ssh repository proxy class for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import bin, hex
from i18n import _
import repo, util, error,... | |
import sys
if sys.version_info < (3,):
range = xrange
import numpy as np
import pandas as pd
import scipy.stats as ss
from patsy import dmatrices, dmatrix, demo_data
from .. import families as fam
from .. import output as op
from .. import tests as tst
from .. import tsm as tsm
from .. import data_check as dc
fr... | |
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# 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, t... | |
import tensorflow as tf
import settings #hy: collection of global variables
settings.set_global()
####################################################### Header begin ################################################
dropout = [0.3, 0.3, 0.5, 0.5] #3,4,5,5
dropout_1s = [1]*len(dropout)
n_hidden = 360 #162*6 # 128
n_cl... | |
# log_gabor filter and __frequency_butterworth_filter are derived from Matlab
# scripts written by Peter Kovesi. We maintain his copyright notice below.
#
# Copyright (c) 1999 Peter Kovesi
# School of Computer Science & Software Engineering
# The University of Western Australia
# http://www.csse.uwa.edu.au/
#
# Permis... | |
import os
import mimetypes
from ems.converter.inputreader import InputReader
from ems.converter.outputwriter import OutputWriter
from ems.converter.tag import Tag
from ems.converter.modifier import Modifier, ModifierException
from ems.converter.plugin import Plugin
from ems.converter.preprocessor import PreProcessor
f... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | |
"""Purge old data helper."""
from __future__ import annotations
from datetime import datetime
import logging
from typing import TYPE_CHECKING, Callable
from sqlalchemy.orm.session import Session
from sqlalchemy.sql.expression import distinct
from .const import MAX_ROWS_TO_PURGE
from .models import Events, RecorderRu... | |
# 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.
''' TraceEventImporter imports TraceEvent-formatted data
into the provided model.
This is a port of the trace event importer from
https://code.google.com/p/tr... | |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import vim
import re
import xml.etree.ElementTree as ET
import coqtop as CT
import project_file
from collections import deque
import vimbufsync
vimbufsync.check_version([0,1,0], who="coquille")
# Define un... | |
import matplotlib.pyplot as plt
def plot_surf_stat_map(coords, faces, stat_map=None,
elev=0, azim=0,
cmap='jet',
threshold=None, bg_map=None,
mask=None,
bg_on_stat=False,
alpha='auto',
vmax=None, symmetric_cbar="auto", returnAx=False,
figsize=(14,11), lab... | |
"""
Global variables.
WARNING: Never use `from globals import *`!
Since these global variables are modified during runtime, using `import *`
would lead to unpredictable consequences.
"""
# Imports, sorted alphabetically.
# Python packages
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
import ar... | |
######################
# MEZZANINE SETTINGS #
######################
# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
# common enough to be put here, commented out, for convenient
# overriding. Please consult the settings documen... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, platform, cgi, socket
import datetime
HEADER_TEMPLATE = \
"HTTP/1.1 200 OK\r\n" \
"Server: webhttpd/2.0\r\n" \
"Cache-Control: no-cache, no-store, must-revalidate\r\n" \
"Connection: close\r\n" \
"Content-Type: text/html; charset=utf-8\r\n" \
"Date: {}\r\... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
# plugin/plugin_base.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Testing extensions.
this module is designed to work as a testing-framewor... | |
"""Support for monitoring a Sense energy sensor."""
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity,
)
from homeassistant.const import (
ATTR_ATTRIBUTION,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
ELECTRIC_POTENTIAL_VOLT,
E... | |
# 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 sys
from unittest import SkipTest
import numpy as np
from numpy.testing import assert_array_almost_equal
from vispy.testing import run_tests_if_main
from vispy.geometry.triangulation import Triangulation as T
def assert_array_eq(a, b):
assert a.shape == b.shape
assert a.dtype == b.dtype
mask = np... | |
#
# 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
# ... | |
'''
cache.py
Cache which manages all of the data storage and access as needed
'''
import sqlite3
import os
import uuid
import json
import time
class Cache:
'''
SQLite 3 wrapper to cache the data associated
with hitting the NYTimes API
'''
# static name for db file
# by default, it uses an in-memo... | |
import pytest
import pandas._testing as tm
from pandas.io.formats.css import CSSResolver, CSSWarning
def assert_resolves(css, props, inherited=None):
resolve = CSSResolver()
actual = resolve(css, inherited=inherited)
assert props == actual
def assert_same_resolution(css1, css2, inherited=None):
re... | |
class Selecter(object):
pass
class Parent(Selecter):
def __call__(self, parent_data_object, child_data_object):
return parent_data_object
class Child(Selecter):
def __call__(self, parent_data_object, child_data_object):
return child_data_object
class Accessor(object):
def __init_... | |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | |
"""OpenAPI core validation request validators module"""
import warnings
from openapi_core.casting.schemas.exceptions import CastError
from openapi_core.deserializing.exceptions import DeserializeError
from openapi_core.exceptions import MissingParameter
from openapi_core.exceptions import MissingRequestBody
from opena... | |
# 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... | |
# Copyright 2016 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.
"""A collection of ResourceGraphs.
Processes multiple ResourceGraphs, all presumably from requests to the same
site. Common urls are collected in Bags and d... | |
# -*- coding: utf-8 -*-
import json
import base64
from functools import partial
from pytest import fixture
from flask import url_for
from flask_perm.services import SuperAdminService
class Client(object):
def __init__(self, app, current_user=None):
self.app = app
self.current_user = current_user
... | |
#!/usr/bin/env python
# Copyright (c) 2016 - 2017, Intel 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 ... | |
"""
HTML Widget classes
"""
import copy
import datetime
import re
from itertools import chain
from django.conf import settings
from django.forms.utils import to_current_timezone
from django.templatetags.static import static
from django.utils import datetime_safe, formats
from django.utils.dates import MONTHS
from dja... | |
from __future__ import absolute_import, division, print_function
import logging
import os
import signal
import subprocess
import sys
from tornado.httpclient import HTTPClient, HTTPError
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log import gen_log
from tornado.process imp... | |
# -*- coding: utf-8 -*-
#
# Copyright 2014 Thomas Amland <thomas.amland@gmail.com>
#
# 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
#
# Unles... | |
from spasm.web.core import Web
from spasm.web.util import *
import re
import urllib2
import time
from datetime import datetime
class Google(Web):
INTERVAL = 6.0
SEARCH_URL = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=%s&rsz=large&start=%s"
INTERVIEW_QUERY = '"%s" interview'
RE... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, 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/LI... | |
# Copyright 2017 Nokia.
# 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... | |
#!/usr/bin/env python
#
# Copyright 2017 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... | |
# -*- coding: utf-8 -*-
# (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""Unit test for lock_manager.py"""
import os
import sys
import unittest
from tempfile import gettempdir
from time im... | |
'''
Copyright (C) 2014 Parrot SA
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following di... | |
#!/usr/bin/python
#============================ adjust path =====================================
import sys
import os
if __name__ == "__main__":
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..', '..'))
#============================ verify installation =============================
from SmartMe... | |
# Natural Language Toolkit: SVM-based classifier
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Leon Derczynski <leon@dcs.shef.ac.uk>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A classifier based on a support vector machine. This code uses Thorsten Joachims'
SVM^light implementa... | |
# =============================================================================
# Copyright (c) 2016, Cisco Systems, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sour... | |
'''
Spatial Two Stages Least Squares
'''
__author__ = "Luc Anselin luc.anselin@asu.edu, David C. Folch david.folch@asu.edu"
import copy
import numpy as np
import pysal
import numpy.linalg as la
import twosls as TSLS
import robust as ROBUST
import user_output as USER
import summary_output as SUMMARY
from utils import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.