gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from pymongo import MongoClient
import pymongo
from datetime import datetime,time
import time
from bson.code import Code
mongo_client=MongoClient('mongodb://localhost:27017/')
db=mongo_client.mydb
db_col=db.things
dbc = mongo_client.mydb.things
print mongo_client
print(db)
print("connected")
def first_querry():
... | |
import binascii
from unittest import TestCase
from bitmerchant.network import BitcoinMainNet
from bitmerchant.network import BitcoinTestNet
from bitmerchant.network import DogecoinMainNet
from bitmerchant.network import LitecoinMainNet
from bitmerchant.wallet import Wallet
from bitmerchant.wallet.bip32 import Insuffic... | |
#!/usr/bin/env python
# for instrument/phone setting
# William Chang
#Test for git
#Instrument setting
Instrument_GPIB = 14 #GPIB
Average_times = 20 # average times for Txp and ACLR measurement
IMSI = '001010123456789'
path_loss = {700: -0.3, 1200: -0.3, 1500: -0.6, 2300: -0.6, 2500: -0.7, 2700: -0.7} #initiate pa... | |
import unittest
import functools
import math
import mock
import numpy
from operator import mul
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from cha... | |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | |
# 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 ... | |
# ******************************************************************************
# pysimm.forcefield.tip3p module
# ******************************************************************************
#
# ******************************************************************************
# License
# ******************************... | |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# -*- coding: utf-8 -*-
#
# Project: weechat-notify-send
# Homepage: https://github.com/s3rvac/weechat-notify-send
# Description: Sends highlight and private-message notifications through
# notify-send. Requires libnotify.
# License: MIT (see below)
#
# Copyright (c) 2015-2016 by Petr Zemek <s3r... | |
# -*- 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... | |
# Copyright 2014 Rackspace Hosting
# 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 require... | |
"""Sparse rational function fields. """
from __future__ import print_function, division
from operator import add, mul, lt, le, gt, ge
from sympy.core.compatibility import reduce, string_types
from sympy.core.expr import Expr
from sympy.core.symbol import Symbol
from sympy.core.sympify import CantSympify, sympify
fro... | |
# -*- 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
#... | |
# -*- encoding: utf-8 -*-
#
# Author: John Tran <jhtran@att.com>
# Julien Danjou <julien@danjou.info>
#
# 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/li... | |
#!/usr/bin/env python
import sys
import numpy as np
from sklearn import tree
from sklearn.metrics import accuracy_score
from sklearn import cross_validation
# Contains data about the match and each of the players in the game.
class Match():
def __init__(self, matchId, matchDuration = None, queueType = None, mapId =... | |
# Copyright 2013 Cloudbase Solutions Srl
# 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 r... | |
import contextlib
import sys
import os
import itertools
import hashlib
import queue
import random
import select
import time
import OpenSSL.crypto
import logging
from mitmproxy.test.tutils import treq
from mitmproxy.utils import strutils
from mitmproxy.net import tcp
from mitmproxy import certs
from mitmproxy.net impo... | |
"""
Support for apk
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
.. versionadded:: 2017.7.0
"""
import c... | |
import asyncio
import traceback
from httptools import HttpParserUpgrade
from httptools import HttpRequestParser, parse_url
from httptools.parser.errors import HttpParserError
from typing import Dict, List, Any, Awaitable
from mach9.response import ALL_STATUS_CODES
from mach9.websocket import upgrade_to_websocket
from ... | |
import cupy
from cupy import _util
from cupyx.scipy.ndimage import _filters_core
def _get_sub_kernel(f):
"""
Takes the "function" given to generic_filter and returns the "sub-kernel"
that will be called, one of RawKernel or ReductionKernel.
This supports:
* cupy.RawKernel
no checks are p... | |
# 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... | |
# coding=utf-8
# Copyright 2022 The Tensor2Tensor 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... | |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import time, json, warnings
from collections import deque
from .utils.generic_utils import Progbar
class CallbackList(object):
def __init__(self, callbacks=[], queue_length=10):
self.callbacks = [c for c in c... | |
from __future__ import print_function
import unittest
from robot.output.listeners import Listeners, LibraryListeners
from robot.output import LOGGER
from robot.utils.asserts import *
from robot.utils import JYTHON
from robot.running.outputcapture import OutputCapturer
LOGGER.unregister_console_logger()
class Mock... | |
# 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 pprint
import argparse
import os
import json
import sys
import re
import zk_utils
import seldon_utils
import spark_utils
gdata = {
'all_clients_node_path': "/all_clients",
}
def pp(o):
p = pprint.PrettyPrinter(indent=4)
p.pprint(o)
def getOpts(args):
parser = argparse.ArgumentParser(prog='sel... | |
from __future__ import print_function
try:
from http.server import HTTPServer, SimpleHTTPRequestHandler
except ImportError:
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import os
import sys
try:
from urlparse import urlparse
from urllib import unquote
e... | |
from __future__ import division, print_function, unicode_literals
import six
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import pyglet
from pyglet.gl import *
from pyglet import image
from cocos.director import *
from cocos.menu import *
from cocos.scene import *
from cocos... | |
# Copyright 2014 NeuroData (http://neurodata.io
# Upload Sizes for max memory and number of fields
#
# 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/LICE... | |
"""Batch CLI provide a simple API to manage batch process via CLI.
The API can be used when one or more tasks need to be executed
providing output messages to the user.
It is also possible to request input to the user.
Author: siasi@cisco.com
Date: December 2013
"""
class TaskEngine():
"""The Task Engine is able... | |
from collections import deque
import gym
import gym_minigrid
import numpy as np
import sys
import unittest
import ray
from ray import tune
from ray.rllib.agents.callbacks import DefaultCallbacks
import ray.rllib.agents.ppo as ppo
from ray.rllib.utils.test_utils import check_learning_achieved, \
framework_iterator
... | |
import requests
import xml.etree.ElementTree as XML
from decimal import Decimal
import defaults, templates, tests
class USPS():
def __init__(self, user_id=None, settings_file=defaults, templates=templates):
self.request = None
self.user_id = user_id if user_id else settings_file.USPS_USER_ID
self.base_shippi... | |
# 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 required by applicable ... | |
import json
from deuce.util import client as p3k_swiftclient
from deuce.tests.util.mockfile import MockFile
from deuce.tests import V1Base
from swiftclient.exceptions import ClientException
import mock
import asyncio
class Response(object):
def __init__(self, status, content=None):
self.status = status
... | |
from textblob import TextBlob
from Voice.SelectTask import *
import numpy as np
import math
import json
import logging
import copy
Responses = {"search": ["who is donald trump", "what is cnc machine", "how to implement quicksort algorithm",
"can you search how to remove stop words", "what is t... | |
import pandas
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from hmmlearn import hmm
from hmmlearn import utils
table = pandas.read_csv('euro.csv', delimiter=';')
rate = np.array(table["Kurs"])
change = np.array(table["Zmiana"])
change = np.diff(rate)
# comb = np.column_stack((rate... | |
'''
Created on 09/09/2014
@author: u76345
'''
from __future__ import absolute_import
import sys, logging
from eotools.utils import log_multiline
from agdc import DataCube
# Set top level standard output
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setLevel(logging.INFO)
console_formatter = log... | |
"""
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | |
from __future__ import absolute_import
from __future__ import unicode_literals
import random
import string
import requests
import time
from boto3.session import Session
import responses
from moto.core import BaseBackend, BaseModel
from .utils import create_id
from .exceptions import StageNotFoundException, ApiKeyNotF... | |
import re
import json
import datetime
import traceback
import dns.name
import dns.reversename
from distutils.version import StrictVersion
from flask import Blueprint, render_template, make_response, url_for, current_app, request, redirect, abort, jsonify, g, session
from flask_login import login_required, current_user,... | |
"""
A generic comment-moderation system which allows configuration of
moderation options on a per-model basis.
To use, do two things:
1. Create or import a subclass of ``CommentModerator`` defining the
options you want.
2. Import ``moderator`` from this module and register one or more
models, passing the model... | |
#!/usr/bin/env python
# Copyright 2016 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 o... | |
#
#
# Copyright (C) 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 conditions and ... | |
#!/usr/bin/python
"""
" @section DESCRIPTION
" Configurations for different RF models
"""
def _get_model_params(name='glm',
solver='linreg',
multilin=False,
rf_type='lin_rfs',
rf_truncated=False,
cf_type=None... | |
# Copyright 2011 Justin Santa Barbara
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | |
# politician/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
import re
from django.db import models
from django.db.models import Q
import wevote_functions.admin
from exception.models import handle_exception, handle_record_found_more_than_one_exception
from tag.models import Tag
from wevote_func... | |
from django.views import generic
from django.http import Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
from django.contrib.auth import login, mixins, get_user
from django.contrib.auth.forms import AuthenticationForm
from django.core.exceptions import ObjectDoesNotExist
from django.cor... | |
# 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 or agreed to in writing,... | |
from __future__ import annotations
from typing import Callable, Generic, TypeVar
T = TypeVar("T")
U = TypeVar("U")
class DoubleLinkedListNode(Generic[T, U]):
"""
Double Linked List Node built specifically for LFU Cache
>>> node = DoubleLinkedListNode(1,1)
>>> node
Node: key: 1, val: 1, freq: 0,... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Create the UCSC chain file which is needed to lift over from one coordinate
system to another.
File format:
<http://genome.ucsc.edu/goldenPath/help/chain.html>
chain 4900 chrY 58368225 + 25985403 25985638 chr5 151006098 - 43257292 43257528 1
9 1 0
10 ... | |
"""Test for the LCN cover platform."""
from unittest.mock import patch
from pypck.inputs import ModStatusOutput, ModStatusRelays
from pypck.lcn_addr import LcnAddr
from pypck.lcn_defs import MotorReverseTime, MotorStateModifier
from homeassistant.components.cover import DOMAIN as DOMAIN_COVER
from homeassistant.compo... | |
'''
Created on Feb 02, 2014
@author: Mark V Systems Limited
(c) Copyright 2014 Mark V Systems Limited, All rights reserved.
'''
try:
import regex as re
except ImportError:
import re
from collections import defaultdict
import os, io, json
from datetime import datetime, timedelta
from arelle import XbrlConst
fro... | |
"""
Copyright Sergey Karayev - 2013.
Written during internship at Adobe CTL, San Francisco.
Every feature imported in features/__init__.py must take
image_filenames and image_ids, and returns good_image_ids and feats,
where good_image_ids may be a subset of image_ids.
"""
import os
import sys
import functools
import p... | |
# Copyright 2010 Google Inc.
# All Rights Reserved.
#
# Author: Tim Haloun (thaloun@google.com)
# Daniel Petersson (dape@google.com)
#
import os
# Keep a global dictionary of library target params for lookups in
# ExtendComponent().
_all_lib_targets = {}
def _GenericLibrary(env, static, **kwargs):
"""Extend... | |
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.core.paginator import InvalidPage, Paginator
from django.db import models
from django.http import HttpResponseRedirect
from django.template.response import SimpleTemplateResponse, TemplateResponse
from django.utils.datastructures import... | |
# 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 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... | |
#
# 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... | |
# Copyright 2013: 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... | |
# 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 ... | |
# -*- coding: 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):
# Changing field 'Park_fee.car_number'
db.alter_column(u'SmartDataApp_park_fee', 'car_number', self.gf('dja... | |
# 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... | |
# run with: python manage.py test hs_core.tests.serialization.test_resourcemeta_sax_parsing
import unittest
import xml.sax
from hs_core.serialization import GenericResourceSAXHandler
from hs_geo_raster_resource.serialization import RasterResourceSAXHandler
from hs_app_netCDF.serialization import NetcdfResourceSAXHandl... | |
# -*- coding: 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 field 'Encounter.notes'
db.add_column(u'dm_encounter', 'notes',
self.gf('djan... | |
""" @package antlr3.tree
@brief ANTLR3 runtime package, treewizard module
A utility module to create ASTs at runtime.
See <http://www.antlr.org/wiki/display/~admin/2007/07/02/Exploring+Concept+of+TreeWizard> for an overview. Note that the API of the Python implementation is slightly different.
"""
# begin[licence]
#... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE = [
'django.middleware.cache.UpdateCacheMiddl... | |
# 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... | |
from __future__ import unicode_literals
import re
import unittest
from unittest import skipUnless
from django.db import connection
from django.contrib.gis import gdal
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import (
HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite,
m... | |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import io
import os
import platform
import re
import subprocess
import sys
class TestFailedError(Exception):
pass
def escapeCmdArg(arg):
if '"' in arg or ' ' in arg:
return '"%s"' % arg.replace('"', '\\"')
else:
... | |
# -*- coding: utf-8 -*-
"""
Class for "reading" fake data from an imaginary file.
For the user, it generates a :class:`Segment` or a :class:`Block` with a
sinusoidal :class:`AnalogSignal`, a :class:`SpikeTrain` and an
:class:`EventArray`.
For a developer, it is just an example showing guidelines for someone who wants... | |
#!/usr/bin/env python
#
# Copyright 2012 eNovance <licensing@enovance.com>
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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.a... | |
"""The tests the for Locative device tracker platform."""
from unittest.mock import patch, Mock
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import locative
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN
from homeassistant.components.locati... | |
from __future__ import absolute_import
import errno
from datetime import datetime, timedelta
from mock import Mock, call, patch
from nose import SkipTest
from pickle import dumps, loads
from celery import beat
from celery.five import keys, string_t
from celery.schedules import schedule
from celery.utils import uuid
... | |
import logging
log = logging.getLogger(__name__)
from flask import request
from bokeh import protocol
from .bbauth import (
check_read_authentication_and_create_client,
check_write_authentication_and_create_client
)
from ..app import bokeh_app
from ..crossdomain import crossdomain
from ..serverbb import pru... | |
""" Testing DTI
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from nose.tools import (assert_true, assert_equal,
assert_almost_equal, assert_raises)
import numpy.testing as npt
from numpy.testing import assert_array_equal, assert_array_almost_equal, as... | |
#!/usr/bin/env python
"""Tests for administrative flows."""
import os
import subprocess
import sys
import time
import psutil
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import flags
from grr.lib import flow
from grr.lib imp... | |
import yaml
class RoleBuilder():
# Global list of roles
ROLE_LIST = ['clc',
'user-facing',
'console',
'walrus',
'cluster-controller',
'storage-controller',
'node-controller',
'midonet-api',
... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) The James Hutton Institute 2017-2019
# (c) University of Strathclyde 2019-2020
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@strath.ac.uk
#
# Leighton Pritchard,
# Strathclyde Institute for Pharmacy and Biomedical Sciences,
# 161 Cathedral Street,
# ... | |
# Lint as: python3
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
#Embedded file name: ACEStream\Core\BitTornado\bencode.pyo
from types import IntType, LongType, StringType, ListType, TupleType, DictType
from ACEStream.Core.Utilities.odict import odict
try:
from types import BooleanType
except ImportError:
BooleanType = None
try:
from types import UnicodeType
except Impo... | |
# -*- 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 jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9302")
else:
access = Ser... | |
import sys
import re
import os
# import string
import numpy as np
import subprocess as sub
from Bio import SeqIO
from Bio.Data import CodonTable
import pandas as pd
# import scipy.sparse as sparse
# import scipy.stats as st
# import flu_module as flu
from Bio import SeqIO
from Bio.Data import CodonTable
import itertool... | |
from six import print_ as xprint
from six.moves import input
import random
HANGMANPICS = ['''
+---+
| |
|
|
|
|
=========''', '''
+---+
| |
O |
|
|
|
=========''', '''
+---+
| |
O |
| |
|
|
=========''', '''
+---+
| |
O |... | |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | |
import logging
from .client import Client
from .lock import Lock
_log = logging.getLogger(__name__)
# Prevent "no handler" warnings to stderr in projects that do not configure
# logging.
try:
from logging import NullHandler
except ImportError:
# Python <2.7, just define it.
class NullHandler(logging.Handl... | |
from __future__ import absolute_import
import numpy as nm
import numpy.linalg as nla
from sfepy.base.base import assert_, Struct
from sfepy.discrete import PolySpace
from sfepy.linalg import combine, insert_strided_axis
from six.moves import range
from functools import reduce
# Requires fixed vertex numbering!
vertex... | |
from flask import Flask, jsonify
from datetime import datetime, timedelta
from DBManager import DBManager
from Scraper import Scraper
from multiprocessing.pool import ThreadPool
import requests
import json
import time
app = Flask(__name__)
apiUrl = "http://ergast.com/api/f1/current"
@app.route('/')
def homepage():... | |
#!/usr/bin/env python
"""
Unit test for the Gps2Udp server.
"""
import gps2udp
import hashlib
import os
import time
import unittest
class TestGps2UdpServer(unittest.TestCase):
"""
Unit test for the Gps2Udp server internal functions.
"""
def test_parse_packet(self):
"""
Test the gps2... | |
#!/usr/bin/env python
"""Ninja toolchain abstraction for XCode toolchain"""
import os
import subprocess
import toolchain
import syntax
def make_target(toolchain, host, target):
return XCode(toolchain, host, target)
class XCode(object):
def __init__(self, toolchain, host, target):
self.toolchain = toolchain... | |
# -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... | |
'''
Utils
=====
'''
# pylint: disable=useless-object-inheritance
__all__ = ('platform', 'reify', 'deprecated')
from os import environ
from os import path
from sys import platform as _sys_platform
class Platform(object):
'''
Refactored to class to allow module function to be replaced
with module variabl... | |
# Copyright 2013 Canonical Ltd.
# 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... | |
#!/usr/bin/env python
##
## Copyright 2016 SRI International
## See COPYING file distributed along with the package for the copyright and license terms.
##
import pandas
import string
import time
import datetime
import numpy
#
# High-Risk Status
#
# List of SSAGA variables to recode as: 1=>12, 2=>14, 3=>17, 4=>AG... | |
# Source activate.sh (of QIIME) before running QIIME on EC2 because non-interactive shell (such as ssh) has $PATH set
# differently compared to interactive (logged in) shell.
import os
import commands
import sys
import re
import subprocess
import logging
from datetime import datetime
def input_file_help():
print ""... | |
import sys
import configparser
import requests
import dateutil.parser
import argparse
import csv
import os
def get_configs(conf_file):
result = {}
cp = configparser.ConfigParser()
cp.read(conf_file)
result['server'] = cp.get('Octopus', 'server')
result['api_key'] = cp.get('Octopus', 'api_key')
... | |
# Copyright (c) 2010-2013 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 ... | |
# TODO:
# - Front matter documentation.
# - Actions should be loaded from a python file provided via the command line.
# - Alert email from address should be configurable from the command line.
# - It should be possible to disable the alert emails.
# - The logging level should be configurable from the command line.
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.