gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python3
# Copyright (c) 2018-2019 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 the wallet balance RPC methods."""
from decimal import Decimal
import struct
from test_framework.... | |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | |
import socket
import string
from driver import driver
class AirHidDriver(driver):
SHIFT = "_SHIFT"
ALT = "_ALT"
CTRL = "_CTRL"
WIN = "_WIN"
VK_CAPS_LOCK = 0x14
VK_ESCAPE = 0x1B
VK_PAGE_UP = 0x21
VK_PAGE_DOWN = 0x22
V... | |
# -*- coding: utf-8 -*-
import json
import logging
from bson import ObjectId
from flask import Blueprint, Response, flash, jsonify, redirect, render_template, request, url_for
from flask_login import current_user
from werkzeug.datastructures import Headers
from scout.constants import ACMG_COMPLETE_MAP, ACMG_MAP, CASE... | |
# Copyright 2008, 2009 Neil Martinsen-Burrell
#
# 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, pub... | |
import unittest
import os
from os import path
import sys
import subprocess
import time
from errno import EPERM
from support import SpaghettiTestCase, randomdata
def wait_for_mount(mount_path):
for c in xrange(20):
if path.ismount(mount_path):
return True
time.sleep(.1)
else:
... | |
"""Support for Xiaomi binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.xiaomi import (PY_XIAOMI_GATEWAY, XiaomiDevice)
_LOGGER = logging.getLogger(__name__)
NO_CLOSE = 'no_close'
ATTR_OPEN_SINCE = 'Open since'
MOTION = 'motion'
NO_... | |
#===============================================================================
# Copyright (c) 2015, Max Zwiessele
# 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... | |
"""Helpers for script and condition tracing."""
from __future__ import annotations
from collections import deque
from contextlib import contextmanager
from contextvars import ContextVar
from functools import wraps
from typing import Any, Callable, Deque, Generator, cast
from homeassistant.helpers.typing import Templa... | |
# 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 writ... | |
# Python 2 compatibility.
from __future__ import print_function
import numpy
import scipy.optimize
import warnings
# Same as scipy.optimize.
_epsilon = numpy.sqrt(numpy.finfo(float).eps)
class Balance():
"""
Base class for balancing. Not intended to be used directly.
Subclasses should extend either ... | |
# Copyright (c) 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.
from __future__ import print_function
import argparse
import json
import os
import sys
import urlparse
from hooks import install
from paste import fil... | |
import __builtin__
import contextlib
import os
import unittest
import shutil
import tempfile
import StringIO
from pywatchman import bser, WatchmanError
from typing import Sequence
from .buck import BuildFileProcessor, Diagnostic, add_rule, process_with_diagnostics
def foo_rule(name, srcs=[], visibility=[], build_en... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh.keys}.
"""
try:
import Crypto.Cipher.DES3
except ImportError:
# we'll have to skip these tests without PyCypto and pyasn1
Crypto = None
try:
import pyasn1
except ImportError:
pyasn1 = None
i... | |
# darcs.py - darcs support for the convert extension
#
# Copyright 2007-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from common import NoRepo, checktool, commandline, commit, con... | |
#!/usr/bin/python
''' verify the cicd operation command coming in from Jenkins via SSH '''
# pylint: disable=invalid-name
# pylint: disable=bare-except
# pylint: disable=too-many-instance-attributes
#Jenkins:
#ssh use-tower1.ops.rhcloud.com -c clustername -o <operation> -e [approved_arg1] -e [approved_arg2] ...
# Cu... | |
"""
Unit tests for ./yaml_parse.py
"""
import os
import numpy as np
import cPickle
import tempfile
from numpy.testing import assert_
from pylearn2.config.yaml_parse import load, load_path, initialize
from os import environ
from decimal import Decimal
import yaml
from pylearn2.models.mlp import MLP, Sigmoid
from pylea... | |
#!/usr/bin/env python
import os, sys, time, getopt, math, sniper_lib
def max_diff(l_notsorted):
l = sorted(filter(lambda x:x != None, l_notsorted))
try:
l = map(float,l)
except ValueError, e:
l = map(str,l)
if len(set(l)) > 1:
return (1,100,True)
else:
return (0.0,0.0,False)
except... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
# 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... | |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
"""Tests for the forms of the ``task_list`` app."""
from datetime import date
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_libs.tests.factories import UserFactory
from ..forms import (
TaskCreateForm,
TaskD... | |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 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 the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | |
"""
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE!
All settings changes should be done by copy-pasting the variable and
its value to <gamedir>/conf/settings.py.
Hint: Don't copy&paste over more from this file than you actually want
to change. Anything you don't copy&paste... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A generic bot to do data ingestion (batch uploading).
usage: data_ingestion.py -csvdir:local_dir/ -page:config_page
"""
#
# (C) Pywikibot team, 2013
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id: eac28be7... | |
import os
import cgi
import logging
from StringIO import StringIO
import struct
import wsgiref.handlers
from datetime import date
from google.appengine.api import images
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.weba... | |
# coding=utf-8
# Copyright 2022 The Edward2 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 o... | |
import colander
from daybed import schemas
from daybed.tests.support import unittest
class PointFieldTests(unittest.TestCase):
def setUp(self):
self.schema = schemas.PointField.definition()
definition = self.schema.deserialize(
{'name': 'location',
'type': 'point'})
... | |
# A small helper class to house functions needed by KeplerMapper.visualize
import numpy as np
from sklearn import preprocessing
import json
from collections import defaultdict
from ast import literal_eval
colorscale_default = [
[0.0, "rgb(68, 1, 84)"], # Viridis
[0.1, "rgb(72, 35, 116)"],
[0.2, "rgb(64, ... | |
import urllib.parse
import requests
TRELLO_API_URL = 'https://trello.com/1'
class TrelloError(Exception):
def __init__(self, session, status_code, url, text, desc="API call error"):
self.session = session
self.status_code = status_code
self.url = url
self.text = text
max... | |
from js9 import j
from .SourceLoader import SourceLoader
from JumpScale9.errorhandling.ErrorConditionObject import ErrorConditionObject
import colored_traceback
import pygments.lexers
import cProfile
from contextlib import contextmanager
import asyncio
import functools
import logging
import traceback
from collections i... | |
#!/usr/bin/env python
'''Functions that interact with external tools/services
'''
from __future__ import absolute_import, print_function, division
from peyotl.nexson_syntax import get_ot_study_info_from_nexml, \
DEFAULT_NEXSON_VERSION, \
BY_ID_HONEY_BADG... | |
# Human friendly input/output in Python.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: October 9, 2016
# URL: https://humanfriendly.readthedocs.io
"""
Interaction with UNIX terminals.
The :mod:`~humanfriendly.terminal` module makes it easy to interact with UNIX
terminals and format text for renderin... | |
# -*- coding: utf-8 -*-
# Author: Florian Mayer <florian.mayer@bitsrc.org>
#
# This module was developed with funding provided by
# the ESA Summer of Code (2011).
# The template can be found in tools/hektemplate.py
# Unless you are editing the template, DO NOT EDIT THIS FILE.
# ALL CHANGES WILL BE LOST THE NEXT TIME I... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# -*- coding: utf-8 -*-
#
# _to_gssha.py
# GSSHApy
#
# Created by Alan D Snow, 2016.
# License BSD 3-Clause
import logging
from datetime import timedelta
from os import mkdir, path, remove, rename
import xarray as xr
from .grid_to_gssha import GRIDtoGSSHA
log = logging.getLogger(__name__)
# -------------------... | |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
"""
Data helper classes for constructing Transfer API documents. All classes should
extend ``dict``, so they can be passed seemlesly to
:class:`TransferClient <globus_sdk.TransferClient>` methods without
conversion.
"""
from __future__ import unicode_literals
import logging
from globus_sdk.base import safe_stringify
... | |
# coding=utf-8
# Copyright 2020 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 2014, Huawei, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
# 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... | |
# -*- coding: utf-8 -*-
import copy
import json
import sys
import traceback
from django.conf import settings
from django.core.files.storage import default_storage as storage
import mock
from nose.plugins.attrib import attr
from nose.tools import eq_
from pyquery import PyQuery as pq
import waffle
import amo
import a... | |
from django.db import models
from jamjar.base.models import BaseModel
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from django.conf import settings
from datetime import datetime, timedelta
from math import log
from lilo import Lilo
import logging, uuid, os, shutil
import lo... | |
# -*- coding: utf-8 -*-
"""
Communicating with docker via rancher
NOTE: to convert the output json and read it:
https://jsonformatter.curiousconcept.com/
API examples:
https://github.com/rancher/validation-tests/tree/master/tests/v2_validation/cattlevalidationtest/core
"""
import time
from seadata.apis.commons.clus... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
"""Logging
"""
import sys
import os
import logging
from pip import backwardcompat
from pip._vendor import colorama, pkg_resources
def _color_wrap(*colors):
def wrapped(inp):
return "".join(list(colors) + [inp, colorama.Style.RESET_ALL])
return wrapped
def should_color(consumer, environ, std=(sys.s... | |
#!/usr/bin/env python
# coding=utf-8
"""Dummy functions to replace functions from operations module.
It's a new module because i think that add dry-run cases to original operations
will be ugly and dirty.
Yes, i know, that separate module will be required more time energy for back
compability with original ope... | |
import datetime
from .converter import WaypointStyle
class Writer:
"""
A writer for SeeYou CUP files. Supports waypoints and tasks::
with open('competition.cup', 'wb') as fp:
writer = Writer(fp)
"""
HEADER = u'name,code,country,lat,lon,elev,style,rwdir,rwlen,freq,desc'
DIVID... | |
import rrdtool
import os
import shutil
import logging
from database.model import Session
from database.definition_model import RoutingDefiniton
logger = logging.getLogger('fm.rrd')
class RRD():
def __init__(self, device_id, service_name, service_number=1):
self.folder = device_id + '/'
self.fol... | |
from __future__ import unicode_literals
from datetime import date
import unittest
from django.test import TestCase
from .models import Author
from django.db import models
from django.db import connection
class Div3Lookup(models.Lookup):
lookup_name = 'div3'
def as_sql(self, qn, connection):
lhs, pa... | |
import tornado
import cProfile
import pstats
import time
from tornado import gen
import logging
from mutornadomon import net
from tornado.ioloop import IOLoop
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
logger = logging.getLogger('mutornadomon_profiler')
def LOCALHOST(requ... | |
# Copyright (c) 2014, Facebook, Inc. All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
from distutils.command.upload im... | |
# Copyright 2011 Gilt Groupe, INC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
"""Sensor for the Open Sky Network."""
from __future__ import annotations
from datetime import timedelta
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
... | |
#!/usr/bin/python
from pygame.sprite import DirtySprite
import random
import time
import logging
from pygame.surface import Surface
from src.Properties import Color, Size
from tts_client import invoke_tts
from utils import *
RATE_PERCENTAGE_MAX = 25
RATE_PERCENTAGE_MIN = -25
# RANGE_PERCENTAGE_MAX = 50 # RG
# RANGE... | |
"""Support for Sass's namespacing rules."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import logging
import six
from scss.types import Undefined
from scss.types import Value
log = logging.getLogger(__name__)
def normalize_var(name)... | |
from __future__ import unicode_literals, print_function, division
import feedparser
import dataset
from twisted.internet.reactor import callLater
from threading import Thread
import twisted.internet.error
import logging
logger = logging.getLogger("module_rss")
DATABASE = None
updater = None
botref = None
config = {}
... | |
from __future__ import absolute_import
# -*- coding: utf-8 -*-
from datetime import datetime
from xml.dom import minidom
from StringIO import StringIO
from django.conf import settings
from django.core import serializers
from django.db import transaction, connection
from django.test import TestCase, TransactionTestCas... | |
from __future__ import absolute_import, unicode_literals
import json
import os
from django.contrib.contenttypes.models import ContentType
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.shortcuts import render
from django.utils.encoding import python_2_unicode_compa... | |
#! /usr/bin/python
'''
Cisco Spark Bot for Room Finder Application
This Bot will use a provided bot Cisco Spark Account (identified by the Developer Token)
to interact with the Roomfinder application. Users can
check current available rooms, book them and found them on a map.
There are several p... | |
# 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 ... | |
# Copyright (c) 2013 Mattias Svala
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 dmpayton
# Copyright (c) 2014 dequis
# Copyright (c) 2014 Tycho Andersen
# Copyright (c) 2015 Serge Hallyn
#
# Permission is hereby granted, free of charge, to any person ob... | |
# classes for event-driven programming
# http://en.wikipedia.org/wiki/Event-driven_programming
__all__ = ['StateVar', 'FunctionCall', 'EnterExit', 'Pulse', 'EventPulse',
'EventArgument', ]
from direct.showbase.DirectObject import DirectObject
class PushesStateChanges:
# base class for objects that br... | |
from JumpScale import j
import struct
TIMES = {'s': 1,
'm': 60,
'h': 3600,
'd': 3600 * 24,
'w': 3600 * 24 * 7
}
import datetime
import time
from TimeInterval import TimeInterval
class Time_:
"""
generic provider of time functions
lives at j.data.time
"... | |
# -*- coding: utf-8 -*-
"""
@author: Federico Cerchiari <federicocerchiari@gmail.com>
Table Widget
"""
from copy import copy
from itertools import zip_longest
import tempy.tags as tags
from ..tools import AdjustableList
from ..exceptions import WidgetDataError
class TempyTable(tags.Table):
"""Table widget.
C... | |
#!/usr/bin/env python
#coding=utf-8
import urllib
import base64
import hmac
import time
from hashlib import sha1 as sha
import os
import sys
import md5
import StringIO
from threading import Thread
import Queue
import threading
import ConfigParser
import logging
from logging.handlers import RotatingFileHandler
from xml.... | |
from __future__ import absolute_import
from builtins import *
#!/usr/bin/env python
#Copyright (c) 2013, Eduard Broecker
#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 sou... | |
from __future__ import with_statement
import os
import sys
from StringIO import StringIO
from nose.tools import eq_, ok_
from fabric.state import env, output
from fabric.context_managers import (cd, settings, lcd, hide, shell_env, quiet,
warn_only, prefix, path)
from fabric.operations import run, local, _prefix_... | |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 12 11:28:37 2017
@author: tuili
"""
from __future__ import print_function
import numpy as np
import os
import pickle
import datetime
import tensorflow as tf
from tensorflow.contrib import learn
from tensorflow.python.platform import gfile
#from tensorflow.python import ... | |
"""Easy to use python subprocess interface."""
from easyprocess.unicodeutil import split_command, unidecode, uniencode
import logging
import os.path
import platform
import signal
import subprocess
import tempfile
import threading
import time
from easyprocess.about import __version__
log = logging.getLogger(__name__)... | |
"""
Default settings for the ``mezzanine.core`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
mak... | |
#!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 The Electrum developers
#
# 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... | |
#!/usr/bin/env python3
import os
import json
import sqlite3
from pathlib import Path
import tkinter as tk
import tkinter.scrolledtext as tkst
from tkinter import ttk
from tkinter import font
from tkinter import Menu
from tkinter import IntVar
from tkinter import PhotoImage
from tkinter import messagebox
from tkinter... | |
"""Support for repeating alerts when conditions are met."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_MESSAGE,
ATTR_TITLE,
DOMAIN as DOMAIN_NOTIFY,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
CON... | |
__author__ = 'saeedamen'
from pythalesians.util.loggermanager import LoggerManager
from datetime import datetime
class TimeSeriesRequest:
# properties
#
# data_source eg. bbg, yahoo, quandl
# start_date
# finish_date
# tickers (can be list) eg. EURUSD
# category (eg. fx, equities, fixed_i... | |
#! /usr/bin/env python
import click
import re
import sys
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
from datetime import datetime
# Usage something like:
# merge_callers.py -t TUMOR -n NORMAL -m1 MuTect1.vcf -m2 MuTec... | |
from modularodm import Q
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from api_tests import utils
from framework.auth.core import Auth
from tests.base import ApiTestCase
from osf_tests.factories import (
AuthUserFactory,
NodeFactory,
ProjectFactory,
Institu... | |
# Copyright 2012 Google Inc. All Rights Reserved.
__author__ = 'benvanik@google.com (Ben Vanik)'
import os
import string
import sublime
import sublime_plugin
import di
import views
PACKAGE_DIR = os.getcwdu()
# DEBUG: before possibly reloading the di module, we need to clean it up
views.cleanup_all()
di.cleanup_... | |
# 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.
import json
import logging
from cStringIO import StringIO
import posixpath
import sys
from zipfile import BadZipfile, ZipFile
import appengine_blobstore as ... | |
import json
from datetime import datetime
from unittest.mock import patch
from django.http import HttpRequest
from django.test import RequestFactory, SimpleTestCase, TestCase
from django.test.utils import override_settings
from django.utils import timezone
from cspreports import utils
from cspreports.models import CS... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author : Santosh
# e-mail : kcraj2[AT]gmail[DOT]com
# Date created : 08 Jul 2016
# Last modified : 11 Jul 2016
"""------------------------------------------------------------------------
Browse the WSJ0 and WSJ1 corpora, parse the prompts (transcriptions),
and categori... | |
# -*- 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... | |
import abc
from collections import OrderedDict
from datetime import date, datetime, timedelta
from io import BytesIO
import os
from textwrap import fill
from urllib.request import urlopen
from pandas._config import config
from pandas.errors import EmptyDataError
from pandas.util._decorators import Appender, deprecate... | |
#!/usr/bin/env python2
import os
import sys
import traceback
os.chdir(sys.path[0])
from subprocess import check_output, CalledProcessError
from time import sleep
from math import floor
from copy import deepcopy
import re
import pprint
from sqlalchemy import Column, ForeignKey, Integer, String, Date, DateTime,\
... | |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | |
#!/usr/bin/env python
#
# Copyright 2010 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... | |
# Copyright 2009 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 or agreed to in writing, ... | |
#!/usr/bin/env python
# usage:
# $ fontbakery check-profile fontbakery.profiles.googlefonts -h
import argparse
from importlib import import_module
import os
import sys
from collections import OrderedDict
from fontbakery.checkrunner import (
distribute_generator
, CheckRunner
, get... | |
# Copyright 2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# Copyright 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... | |
"""
missing types & inference
"""
from decimal import Decimal
from functools import partial
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
import pandas._libs.missing as libmissing
from pandas._libs.tslibs import (
NaT,
Period,
iNaT,
)
from pandas._typing import (
... | |
"""Class for printing reports on profiled python code."""
# Class for printing reports on profiled python code. rev 1.0 4/1/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# see profile.doc and profile.py for more info.
# Copyright 1994, by InfoSeek Co... | |
# coding: utf-8
#
# Copyright 2010 Alexandre Fiori
# based on the original Tornado by Facebook
#
# 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... | |
"""
Copyright 2015 Zalando SE
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 distrib... | |
# Copyright (c) 2014 Evalf
#
# 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, s... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
from mock import Mock, MagicMock, patch, call, PropertyMock
from nefertari.view import (
BaseView, error_view, key_error_view, value_error_view)
from nefertari.utils import dictset
from nefertari.json_httpexceptions import (
JHTTPBadRequest, JHTTPNotFound... | |
# HAppy
import os
import sys
import re
import signal
import socket
import logging
import logging.handlers
import threading
import ConfigParser
from time import sleep, time
from happy.resources import *
DEFAULT_LOG = 'syslog'
DEFAULT_LEVEL = 'warn'
DEFAULT_RESOURCES = 'haresources:/etc/ha.d/haresources'
DEFAULT_CONFI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.