gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python3
"""
Template by pypi-mobans
"""
import os
import sys
import codecs
import locale
import platform
from shutil import rmtree
from setuptools import Command, setup, find_packages
PY2 = sys.version_info[0] == 2
PY26 = PY2 and sys.version_info[1] < 7
PY33 = sys.version_info < (3, 4)
# Work around... | |
# Copyright 2015 Rackspace All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Jacqueline Kory Westlund
# May 2016
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Personal Robots Group
#
# 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 w... | |
"""
UDisks wrapper utilities.
These act as a convenience abstraction layer on the UDisks DBus service.
Requires UDisks 1.0.5 as described here:
http://udisks.freedesktop.org/docs/1.0.5/
This wraps the DBus API of Udisks2 providing a common interface with the
udisks2 module.
Overview: This module exports the cla... | |
from twisted.python import failure
from twisted.internet import defer
from ooni.tasks import BaseTask, TaskWithTimeout
from ooni.managers import TaskManager
class MockMeasurementFailOnce(BaseTask):
def run(self):
f = open('dummyTaskFailOnce.txt', 'w')
f.write('fail')
f.close()
if ... | |
#!/usr/bin/env python
"""PyTorch-specific functionality
"""
import itertools
from functools import reduce
from operator import mul
from wandb import util
from wandb.data_types import Node
import wandb
torch = None
def nested_shape(array_or_tuple, seen=None):
"""Figures out the shape of tensors possibly embedd... | |
import sys
import os
import io
import psycopg2
import xml.etree.ElementTree as ET
from lxml import etree
import math
from collections import Counter
from operator import itemgetter
import datetime
import collections
#For use with Tr-ConLL
def parse_xml(afile):
#print afile
xmldoc = ET.parse(file(afile))
root =... | |
# Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | |
import numpy as np
import scipy.sparse as sparse
from menpo.landmark import LandmarkGroup
from . import (PointCloud, UndirectedGraph, DirectedGraph, Tree, TriMesh,
PointUndirectedGraph, PointDirectedGraph, PointTree)
def stencil_grid(stencil, shape, dtype=None, format=None):
"""Construct a sparse ... | |
# -*- coding: utf-8 -*-
"""Windows EventLog resources database reader."""
import collections
import os
import sqlite3
from plaso.containers import artifacts
from plaso.engine import path_helper
from plaso.helpers.windows import resource_files
from plaso.output import logger
class Sqlite3DatabaseFile(object):
"""C... | |
"""Each of the data structures relevant to the API (regulations, notices,
etc.), implemented using Django models"""
import collections
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from regcore.db import interface
from regcore.models import Diff, Layer, Notice, Document
def ... | |
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
'''
List View
===========
.. versionadded:: 1.5
.. note::
ListView is planned to be deprecated once `RecycleView \
<https://github.com/kivy-garden/garden.recycleview>`_ becomes stable.
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
The :class:`~... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
from __future__ import absolute_import
from __future__ import with_statement
import warnings
from mock import patch
from kombu.connection import BrokerConnection
from kombu.exceptions import StdChannelError
from kombu.transport import virtual
from kombu.utils import uuid
from kombu.tests.compat import catch_warning... | |
# 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... | |
"""
cf_stack.py
CloudFormation Stack help methods - currently extending boto3
Note:
Credentials are required to communicate with AWS.
aws cli profile can be passed in using --profile, or
the following ENVIRONMENT VARIABLES can be set before
running this script:
AWS_ACCESS_KEY_ID
AWS_SE... | |
# 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... | |
# 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... | |
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
from functools import reduce
from docker.errors import APIError
from docker.errors import NotFound
from . import parallel
from .config import ConfigurationError
from .config.sort_services import get_service_name_from_net
fr... | |
#!/usr/bin/env python
# MBUtil: a tool for MBTiles files
# Supports importing, exporting, and more
#
# (c) Development Seed 2012
# Licensed under BSD
# for additional reference on schema see:
# https://github.com/mapbox/node-mbtiles/blob/master/lib/schema.sql
import sqlite3, sys, logging, time, os, json, zlib, re
l... | |
import numpy as np
from numpy.random import rand
import scipy.linalg as la
from numpy.testing import assert_, assert_equal, run_module_suite
import scipy
from qutip import (rand_dm, rand_unitary, spre, spost, vector_to_operator,
operator_to_vector, mat2vec, vec2mat, vec2mat_index,
... | |
"""
bughipster.website.views
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2014 by Xavier Ordoquy, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django import http
from django.views import generic
from django.core.urlresolvers import reverse
from bughipster.project import models, fil... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*- #
import twitterbot
import yaml
import random
import sys
import re
import time
import identify_contests as ic
import tweepy
from httplib import IncompleteRead
class MyTwitterBot(twitterbot.TwitterBot):
def bot_init(self, home='./'):
"""
Initialize and... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | |
# Copyright 2019 The gRPC 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 wri... | |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | |
"""Common IO api utilities"""
import os
import csv
import codecs
import mmap
from contextlib import contextmanager, closing
from pandas.compat import StringIO, BytesIO, string_types, text_type
from pandas import compat
from pandas.io.formats.printing import pprint_thing
from pandas.core.common import AbstractMethodEr... | |
import os
import sys
import subprocess
from six import print_
from ccmlib import common, repository
from ccmlib.cluster import Cluster
from ccmlib.cluster_factory import ClusterFactory
from ccmlib.cmds.command import Cmd
from ccmlib.common import ArgumentError
from ccmlib.dse_cluster import DseCluster
from ccmlib.dse... | |
"""Classes that abstract reading from various types of filesystems.
Currently two types of 'filesystem' are supported:
* the local file system, via python's native file() objects
* Amazon's S3 or Google Storage, using the boto library (only if boto is installed; boto is not a requirement)
For each filesystem, two t... | |
from array import array
from heapdict import heapdict
from .win_detector import WinDetector
from .color import IllegalAction, COLOR_NONE, COLOR_BLACK, COLOR_WHITE, ORIENTATION, COLOR_SYMBOLS, \
NUM_PLAYERS, color_to_player, next_player, player_to_color, cell_str, \
cell_str_to_cell
def prod(*l):
s = 1
... | |
"""Pylons Decorators
Common decorators intended for use in controllers. Additional
decorators for use with controllers are in the
:mod:`~pylons.decorators.cache`, :mod:`~pylons.decorators.rest` and
:mod:`~pylons.decorators.secure` modules.
"""
import logging
import sys
import warnings
import formencode
import simple... | |
import pdb
import numpy as np
from astropy.wcs import WCS
from shift import shift_twod
from VieroLibrary.dist_idl import dist_idl
from lmfit import Parameters, minimize, fit_report
from smoothmap import smoothmap
from gauss_kern import gauss_kern
def simultaneous_stack_array_oned(p, layers_1d, data1d, err1d = None):
... | |
import os
from os.path import join, abspath
import numpy as np
import itertools
import h5py
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
from bigstats.hist import RHist
from simfMRI.io import read_hdf_inc, get_model_meta, get_model_names
def noise_spectrum(noise, name=None):
... | |
from django.contrib.auth.models import User
from django.urls import reverse
from django.test import Client, TestCase
from ...model_generator import get_alphabetic_user_profiles, create_profiled_user
from ddcz.tavern import (
LIST_ALL,
LIST_FAVORITE,
create_tavern_table,
get_tavern_table_list,
book... | |
#!/usr/bin/env python
from plasTeX.Renderers import Renderer as BaseRenderer
import textwrap, re, string
class ManPageRenderer(BaseRenderer):
""" Renderer for UNIX man pages """
outputType = unicode
fileExtension = '.man'
aliases = {
'superscript': 'active::^',
'subscript': 'acti... | |
# 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, distribute, sublicense, and/or sell
# copi... | |
# This Python module is part of the PyRate software package.
#
# Copyright 2022 Geoscience Australia
#
# 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/... | |
#!/usr/bin/env python
import argparse
import os
import shutil
import subprocess
import sys
class ConfigInstaller(object):
def __init__(self):
self.options = []
self.home = os.environ['HOME']
self.command = ''
def parse_arguments(self):
formatter = argparse.RawDescriptionHelp... | |
"""
Tests for fixing the values of some parameters and estimating others
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pytest
from statsmodels import datasets
from statsmodels.tsa.statespace import (
initialization, mlem... | |
from math import ceil
import numpy as np
from scipy.fftpack import fft, ifft, fftfreq
from ..utils import logger, verbose
@verbose
def stft(x, wsize, tstep=None, verbose=None):
"""STFT Short-Term Fourier Transform using a sine window.
The transformation is designed to be a tight frame that can be
perfec... | |
# 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
# not use this file except in compliance with the... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
#! /usr/bin/env python
import sys
import os.path
import re
import uuid
import signal
import fileinput
import subprocess
from argparse import ArgumentParser
import dnapilib
from dnapilib.io_utils import get_file_obj
from dnapilib.apred import adapter_prediction
from dnapilib.apred import iterative_adapter_prediction
f... | |
__gamename__ = "uno"
#Copyright (c) 2010 Thomas Watson
#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... | |
"""Common functions. """
import pysam
import logging
import subprocess
from contextlib import contextmanager
# create logger for the entire program
log = logging.getLogger('riboplot')
log.setLevel(logging.DEBUG)
# create console handler with a higher log level
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
... | |
# Copyright (c) 2007, Linden Research, Inc.
# Copyright (c) 2007, 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 require... | |
#!/usr/bin/env python
import json
import os.path
from time import time
from pysnap.utils import (encrypt, decrypt, decrypt_story,
make_media_id, request)
MEDIA_IMAGE = 0
MEDIA_VIDEO = 1
MEDIA_VIDEO_NOAUDIO = 2
FRIEND_CONFIRMED = 0
FRIEND_UNCONFIRMED = 1
FRIEND_BLOCKED = 2
PRIVACY_EVERYONE ... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Contains code for non-linear model multi-fidelity model.
It is based on this paper:
Nonlinear information fusion algorithms for data-efficient multi-fidelity modelling.
P. Perdikaris, M. Raissi, A. Da... | |
import idaapi
from . import exceptions
from awesome.context import ignored
DEFMASK = idaapi.BADADDR
ENUM_ERROR_MAP = {
idaapi.ENUM_MEMBER_ERROR_NAME:
(exceptions.SarkErrorEnumMemberName, "already have member with this name (bad name)"),
idaapi.ENUM_MEMBER_ERROR_VALUE:
(exceptions.SarkErrorEnum... | |
"""Test the zerproc lights."""
from unittest.mock import MagicMock, patch
import pytest
import pyzerproc
from homeassistant import setup
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_RGB_COLOR,
ATTR_XY_COLOR,
SCAN_INTERVAL,
SUPPORT_BRIGHTNESS,
SUPPORT_CO... | |
from datetime import date, datetime, timedelta
from decimal import Decimal
import pytest
from freezegun import freeze_time
from notifications_utils.timezones import convert_utc_to_bst
from app import db
from app.dao.fact_billing_dao import (
delete_billing_data_for_service_for_day,
fetch_billing_data_for_day,... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import stat
import unittest
import mock
from pyfakefs import fake_filesystem_unittest
from catapult_base import cloud_storage
from catapult_base.... | |
# -*- coding: utf-8 -*-
import logging
import re
from babelfish import Language, language_converters
from guessit import guessit
from requests import Session
from . import ParserBeautifulSoup, Provider
from ..cache import SHOW_EXPIRATION_TIME, region
from ..exceptions import AuthenticationError, ConfigurationError, D... | |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2013 VMware, 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... | |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import os
import mimetypes
from tweepy.binder import bind_api
from tweepy.error import TweepError
from tweepy.parsers import ModelParser, RawParser
from tweepy.utils import list_to_csv
class API(object):
"""Twitter API"""
def __init... | |
# pyOCD debugger
# Copyright (c) 2018-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | |
from .base import Renderer, RenderContext
from . import index as indexrenderer
from . import compound as compoundrenderer
from docutils import nodes
import textwrap
class RstContentCreator(object):
def __init__(self, list_type, dedent):
self.list_type = list_type
self.dedent = dedent
def _... | |
# 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... | |
# Copyright 2013, Big Switch Networks, 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 applic... | |
import fcntl
import os
import random
import requests
import shutil
import subprocess
import time
import heroku
from will.mixins import StorageMixin
from will.utils import Bunch
from will import settings
STACK_NAMES = [
"alder",
"ash",
"aspen",
"basswood",
"birch",
"buckeye",
"buckthorn",
... | |
"""Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import make_dataset
from .sag_fast import sag
from ..exceptions import ConvergenceWarning
from ..utils import check_arra... | |
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import
import sys
import os
import json
import click
import hashlib
import cProfile
import StringIO
import pstats
import frappe
import frappe.utils
from frappe.utils ... | |
from io import StringIO
import random
import string
import numpy as np
from pandas import Categorical, DataFrame, date_range, read_csv, to_datetime
from ..pandas_vb_common import BaseIO, tm
class ToCSV(BaseIO):
fname = "__test__.csv"
params = ["wide", "long", "mixed"]
param_names = ["kind"]
def s... | |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | |
import logging
import ailment
from ..analysis import Analysis
from .structurer import SequenceNode, CodeNode, MultiNode, LoopNode, ConditionNode
l = logging.getLogger(name=__name__)
class RegionSimplifier(Analysis):
def __init__(self, region):
self.region = region
self.result = None
... | |
# Copyright 2008-2009 ITA Software, 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 ... | |
# 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... | |
#
#
# Copyright (C) 2009, 2010, 2012 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | |
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
# 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/LI... | |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""XML reporting for coverage.py"""
import os
import os.path
import sys
import time
import xml.dom.minidom
from coverage import __url__, __version__, files
from c... | |
# Copyright 2015 Hewlett-Packard Development Company, L.P.dsvsv
# Copyright 2015 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
#
# ... | |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | |
from base64 import urlsafe_b64decode, urlsafe_b64encode
import config
from datetime import datetime
import flask
import GeoIP
import geoip2.errors
import geoip2.database
import glob
import hashlib
import json
import logging
from netaddr import IPNetwork
import os
import random
import re
import requests
import string
fr... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014 NaviNet 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
#
# ... | |
# Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
#
# File : mkdir.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of th... | |
import json
import sqlite3
import os
import re
from random import randint, choice
from bs4 import BeautifulSoup as BS
from discord.ext.commands import Bot
import requests
import pymongo
from constants import CLIENT_ID, KHALED_CHOICES, ZOLTAR_CHOICES, IMPLANT_TYPES, add_quote, update_quotes, ValidationError, QUOTE_LIS... | |
# -*- 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 field 'ExperimentSampleToAlignment.data'
db.add_column(u'main_ex... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test objects... | |
## @package memonger
# Module caffe2.python.memonger
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import networkx as nx
import collections
import time
import heapq
import copy
from caffe2.python import workspace
fro... | |
try:
import StringIO
except ImportError:
from io import StringIO
import crianza
import operator
import random
import sys
import unittest
import six
try:
from crianza import native
CRIANZA_NATIVE = True
except ImportError:
CRIANZA_NATIVE = False
fibonacci_source = \
"""
# The Fibonacci Sequence
:... | |
import urllib2
import pycmds
_RATES = {}
class Currency(str):
currencies = {
'Maltese Lira (MTL)': 'MTL',
'Ukraine Hryvnia (UAH)': 'UAH',
'Rwanda Franc (RWF)': 'RWF',
'Mauritania Ougulya (MRO)': 'MRO',
'Ugandan Shilling (UGX)': 'UGX',
'Swedish Krona (SEK)': 'SE... | |
from wtforms import fields, validators
from sqlalchemy import Boolean, Column
from flask.ext.admin import form
from flask.ext.admin.form import Select2Field
from flask.ext.admin.model.form import (converts, ModelConverterBase,
InlineModelConverterBase, FieldPlaceholder)
from fla... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2014 Kitware 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 cop... | |
import sys
import os
import codecs
import pygettext
MESSAGES = []
def detect_unicode_encoding(bytes):
encodings_map = [
(3, codecs.BOM_UTF8, 'UTF-8'),
(4, codecs.BOM_UTF32_LE, 'UTF-32LE'),
(4, codecs.BOM_UTF32_BE, 'UTF-32BE'),
(2, codecs.BOM_UTF16_LE, 'UTF-16LE'),
(2, codec... | |
"""
Basic commonly used builder classes
"""
import numpy as np
import pandas as pa
from ..nodes import MDFNode, MDFEvalNode
from collections import deque, defaultdict
import datetime
import operator
import csv
import matplotlib.pyplot as pp
import sys
import types
if sys.version_info[0] > 2:
basestring = str
def ... | |
# Copyright 2019 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... | |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | |
# Copyright 2012 Nebula, Inc.
# 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... | |
#!/usr/bin/env python
# Copyright 2013 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.
"""This script searches for unused art assets listed in a .grd file.
It uses git grep to look for references to the IDR resource id or... | |
# Copyright (c) 2011 Bastian Venthur
#
# 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, dis... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
import settings
import helpers
import SimpleITK # conda install -c https://conda.anaconda.org/simpleitk SimpleITK
import numpy
import pandas
import ntpath
import cv2 # conda install -c https://conda.anaconda.org/menpo opencv3
import shutil
import random
import math
import multiprocessing
from bs4 import BeautifulSoup... | |
# 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... | |
"""
The frames module is composed of two classes, the Frame, and the FrameBuffer.
Each frame stores data on state, and the time the sample was received.
The FrameBuffer is a collection of Frames that we use for filtering and extrapolation functions.
"""
import math
import time
import numpy as np
from scipy import si... | |
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def metric_accessors():
cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv"))
r = cars[0].runif()
train = cars[r > .2]
valid = car... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.