text stringlengths 17 737k |
|---|
from __future__ import absolute_import
import operator
from collections import OrderedDict, namedtuple
from ctypes import c_double, c_int
from functools import reduce
from hashlib import sha1
from os import path
import cgen as c
import numpy as np
from devito.compiler import (get_compiler_from_env, get_tmp_dir,
... |
#!/usr/bin/env python
#
# Copyright (C) 2010-2011 Hideo Hattori
# Copyright (C) 2011-2013 Hideo Hattori, Steven Myint
# Copyright (C) 2013-2014 Hideo Hattori, Steven Myint, Bill Wendling
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation file... |
# -*- coding: utf-8 -*-
# Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
#... |
import logging
from debian.deb822 import Packages, Sources
from .errors import NoValidCandidatesError
from .index import IndexFile
from .internals import parse_contents, joinurl, simple_repr
log = logging.getLogger(__name__)
class Component:
def __init__(self, suite, name):
# not f... |
# Copyright (c) 2005 Iowa State University
# http://mesonet.agron.iastate.edu/ -- mailto:akrherz@iastate.edu
#
# 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 the License, or... |
'''
A no-dependencies AWS4 signing library / tool.
'''
import copy
import hashlib
import hmac
import re
import time
import urllib
import urlparse
def aws4_signature_parts(
aws_key,
aws_key_secret,
method,
url,
data='',
headers=None,
now=None,
region=Non... |
import os
from types import SimpleNamespace
from django.core.files.base import File
from django.db.models.fields.files import FieldFile
from django.forms.forms import NON_FIELD_ERRORS
from django.template.defaultfilters import filesizeformat
from django.utils.translation import ugettext_lazy as _
from form_designer i... |
CAD_SYSTEM_HEEKS = 1
WIDGETS_WX = 1
WIDGETS_QT = 2
tree = None
program = None
cad_system = CAD_SYSTEM_HEEKS
widgets = WIDGETS_WX
heekscnc_path = None
if cad_system == CAD_SYSTEM_HEEKS:
import HeeksPython as heekscad
import platform
from Program import Program
from Operations import AddOperat... |
__version__ = "0.6.4"
__author__ = "David Whittingham; David Payne; Adam Kerz; Peter Reyne; Daniel Baternik; Chris Blanchfield"
__copyright__ = "Copyright (C) 2019 David Whittingham"
|
import unittest
import responses
from unittest import TestCase
from unittest.mock import patch
from requests.exceptions import HTTPError
from arpa import Arpa, arpafy, process, parse_args, post
from rdflib import Graph, Literal, URIRef
candidate_response = {
"locale": "fi",
"results": {
"Ha": [
... |
#-*- coding: utf-8 -*-
import time
import datetime
import utils
import config
from scrapy import Request
from scrapy.spiders import Spider
from sqlhelper import SqlHelper
class Validator(Spider):
name = 'base'
concurrent_requests = 16
retry_enabled = False
def __init__(self, name = None, **kwargs):... |
#!/usr/bin/env python2
# 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 "Lice... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.categorical import Categorical
import torch_rl
# Function from https://github.com/ikostrikov/pytorch-a2c-ppo-acktr/blob/master/model.py
def initialize_parameters(m):
classname = m.__class__.__name__
if classname.find('L... |
"""
Methods for working with snpEff.
"""
from collections import defaultdict
from collections import OrderedDict
from itertools import chain
import os
import re
from string import Template
import subprocess
import sys
from Bio import SeqIO
from django.conf import settings
from django import template
import vcf
from ... |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
import os
import requests
import socket
import sys
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.syncstep import SyncStep
from observer.ansible import run_template_ssh
from core.models import Service
from cord.models import VCPEService, VCPETenant, VBNGTenant, VBNGService
f... |
import copy
from scrapy.http import Request
from scrapy.spider import BaseSpider
from scrapy.item import ScrapedItem
from scrapy.conf import settings
class Rule(object):
"""
A rule for crawling, which receives the following constructor arguments:
link_extractor (required)
A LinkExtractor which def... |
import os
from unittest import skipIf
from django.contrib.messages import constants as MSG
from django.core.urlresolvers import reverse
from django.test import override_settings
from nose.plugins.skip import SkipTest
from oscar.core.loading import get_model
from oscar.test import factories
from selenium.common.excepti... |
#!/usr/bin/env python
"""Classes that keep track of the board."""
from bogglesolver.twl06 import WORD_LIST
import random
class Boggle:
"""
The boggle board.
This represents the physical board and where each letter is.
"""
def __init__(self, num_columns=5, num_rows=5):
self.num_column... |
#!/usr/bin/python
# Copyright 2010 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Download all Native Client toolchains for this platform.
This module downloads multiple tgz's and expands them.
"""
import optpa... |
"""Install software and configure package managers.
"""
import os
from fabric.api import env, cd
from cloudbio.custom.shared import _make_tmp_dir
from cloudbio.package.deb import (_apt_packages, _add_apt_gpg_keys,
_setup_apt_automation, _setup_apt_sources)
from cloudbio.package.rpm i... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt, cint, cstr, now
from frappe.modules import load_doctype_module
from frappe.model.base_document import... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
# If Django is set up without a database, importing this widget gives RuntimeError
from django.contrib.auth.forms import ReadOnlyPasswordHashWidget
except RuntimeError:
ReadOnlyPasswordHashWidget = None
from django.forms import (
Tex... |
# coding:utf8
import time
import re
import random
import traceback
from threading import Thread
from plugins.pluginmanager import Pluginmanager
import utils
import vkrequests as vkr
AUTHOR_VK_ID = 180850898
AUTHOR = u'[id%d|Евгений Ершов]' % AUTHOR_VK_ID
VK_MESSAGE_LEN_LIMIT = 4096
MAX_LAST_MESSAGES = 50
class... |
#!/usr/bin/env python3
import re
import sys
import os
import tempfile
try:
import yaml
except ImportError:
print('Missing yaml dependency. Please install with:')
print('pip install pyyaml')
sys.exit(1)
CONFIG_FILE = './bankaccounts.yml'
LEDGER_FILE = './csv2journal.txt'
RE_LEDGER_FST_LINE_TRANSACTION ... |
# coding:utf8
import time
import re
import math
import random
from threading import Thread
import requests as r
from utils import TOKEN_FILE_PATH, load_custom_commands,\
save_custom_commands, load_blacklist, save_blacklist,\
CUSTOM_COMMAND_OPTIONS_COUNT
import vkrequests as vkr
__version__ = '0.1.0dev'
AUTHOR_VK... |
""" Core Bot Functions """
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Import Libraries
import os
import logging
import random
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, Job, CallbackQueryHandler
from bot import gov
from bot import draw
from bot import promo
from bot import fina... |
#!/usr/bin/env python
import os
import sys
import subprocess
import sqlite3
import base64
import gzip
from xml.etree import cElementTree as ElementTree
if len(sys.argv) == 1:
print("Basic Usage: ./convert.py mediawiki.dump")
print("")
print('White list: ./convert.py mediawiki.dump "Main Page" "File:Example... |
# Copyright (C) 2005-2007 by Jelmer Vernooij
#
# 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 the License, or
# (at your option) any later version.
#
# This program is dist... |
def decorated(origFunc, newFunc, decoration=None):
"""
Copies the original function's name/docs/signature to the new function, so that the docstrings
contain relevant information again.
Most importantly, it adds the original function signature to the docstring of the decorating function,
a... |
import os
import random
import numpy as np
import importlib
def get_listfile(image_dir, extension = ".jpg"):
if not image_dir.endswith("/"):
image_dir = image_dir + "/"
image_list = os.listdir(image_dir)
image_list = [image_dir + image for image in image_list if image.endswith(extension)]
ret... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights t... |
#!/usr/bin/env python3
import sys
import os
import re
import collections
from typing import Any, Dict, List, Set, Tuple
import utils
def quoteme(to_quote, quote_char):
return "".join((quote_char, to_quote, quote_char))
def quoteme_list(to_quote_list, quote_char):
return [quoteme(to_q, quote_char) for to... |
import numpy as np
import matplotlib.pyplot as plt
from astropy import constants as c, units as u, table as t
from astropy.io import fits
from astropy import coordinates as coords
import os
import sys
import cPickle as pkl
import spec_tools
import ssp_lib
import manga_tools as m
from itertools import izip, product
... |
# byteplay: CPython assembler/disassembler
# Copyright (C) 2006 Noam Raphael | Version: http://code.google.com/p/byteplay
# Rewritten 2009 Demur Rumed | Version: http://github.com/serprex/byteplay
# Screwed the style over, modified stack logic to be more flexible, updated to Python 3
#
# This... |
class Crawler(object):
def __init__(self, start_url):
visited_urls = set()
unvisited_urls = {}
self._start_url = start_url
if __name__ == '__main__':
c = Crawler('http://www.imdb.com/genre/') |
#!/usr/bin/python3.5
from __future__ import print_function
import subprocess
import shlex
import argparse
import os
import sys
import threading
import time
from queue import Queue
import json
import inspect
import datetime
import pprint
def synopsis(ab_shortOnly = False):
str_sc... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os
from frappe.website.utils import (can_cache, delete_page_cache, extract_title,
extract_comment_tag)
from frappe.model.document import get_controller
from six i... |
#
# Copyright (C) 2019 by frePPLe bv
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This library is distri... |
# -*- test-case-name: go.api.conversation_api.tests.test_conversation_api -*-
from twisted.web.server import NOT_DONE_YET
from twisted.web.resource import NoResource
from twisted.web import http
from twisted.internet.defer import inlineCallbacks, Deferred, succeed
from vumi.config import ConfigText, ConfigDict, Confi... |
# Django settings for astrobin project.
import os
from django.conf import global_settings
from django.utils.translation import ugettext_lazy as _
local_path = lambda path: os.path.join(os.path.dirname(__file__), path)
DEBUG = False
CACHE = not DEBUG
LOCAL_STATIC_STORAGE = True
TEMPLATE_DEBUG = DEBUG
MAINTENANCE_MODE ... |
"""
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... |
# -*- encoding: utf-8 -*-
import re
import decimal
from xml.etree.cElementTree import fromstring, tostring
from xml.etree.cElementTree import Element, iselement
from authorize import responses
API_SCHEMA = 'https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd'
API_SCHEMA_NS = "AnetApi/xml/v1/schema/AnetApiSchem... |
# Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of condition... |
# Python
from collections import namedtuple
import contextlib
import logging
import sys
import threading
import time
import StringIO
import traceback
import six
# Django
from django.conf import LazySettings
from django.conf import settings, UserSettingsHolder
from django.core.cache import cache as django_cache
from d... |
"""Base class for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD Style
import copy
import inspect
import numpy as np
from .metrics import r2_score
###############################################################################
def clone(estimator, safe=True):
""" Const... |
from pprint import pprint as pp
from scout.constants import SPIDEX_HUMAN
from scout.utils.convert import amino_acid_residue_change_3_to_1
def add_gene_links(gene_obj, build=37):
"""Update a gene object with links
Args:
gene_obj(dict)
build(int)
Returns:
gene_obj(dict): gene_obj ... |
#!/bin/python
from __future__ import print_function
import subprocess
from util import appendline
def install_JDK():
# Install JDK 1.6
if 'java-1.6.0-openjdk-amd64' not in subprocess.check_output(['ls', '/usr/lib/jvm']):
update = subprocess.Popen(["sudo", "apt-get", "update"])
if update.wait() == 0:
jdk_insta... |
#coding=UTF-8
# See BuildArchetypes for details on environment
# BuildDemos needs git in PATH and depends on gitpython library
# gitpython can be installed with python installer script "pip":
# pip install gitpython
#
# Deployment dependency: requests
# pip install requests
# Deploy depends on .deployUrl and .deployC... |
# -*- coding: iso8859-1 -*-
#
# Copyright (C) 2003, 2004 Edgewall Software
# Copyright (C) 2003, 2004 Jonas Borgstrm <jonas@edgewall.com>
#
# Trac 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 versio... |
#!/bin/python3
import requests
import grequests
import multiprocessing
assets = ['USD', 'USDT', 'EUR', 'BTC', 'XRP', 'ETH', 'HKD', 'LTC', 'RUR',
'CNY', 'DASH', 'ZEC']
#btce
def btc_e(assets):
retval = []
r = requests.get('https://btc-e.com/api/3/info').json()
urls=[]
pairs = []
for k, v ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2013 Edgewall Software
# Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2006 Christian Boos <cboos@edgewall.org>
# Copyright (C) 2006 Matthew Good <trac@matt-good.net>
# All rights reserved.
#
# This software is licensed as described in the fi... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
#!/usr/bin/python
import json, urllib, urllib2, pprint, re, datetime, time, threading, gviz_api
from threading import Thread
########################
# define league ID here
# change for YOUR league
########################
league_id = '1514'
########################
# define other global variables
this_wee... |
"""
The spm module provides basic functions for interfacing with matlab and spm to
access spm tools.
these functions include
Realign: within-modality registration
Coregister: between modality registration
Normalize: non-linear warping to standard space
Segment: bias correction, segmentati... |
from __future__ import unicode_literals
import datetime
import os
import subprocess
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
if version is None:
from django import VERSION as version
else:
assert len(version) == 5
assert version[3] i... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Utility routines for workflow graphs
"""
from copy import deepcopy
from glob import glob
import os
import pickle
import pwd
import re
from uuid import uuid1
import numpy as np
from nipype.utils.misc im... |
import re
import time
import math
import copy
from datetime import timedelta, datetime
from trac.util.datefmt import format_date, utc
from trac.ticket.query import Query
from trac.config import IntOption, Option, ExtensionOption
from trac.core import implements, Component, TracError, Interface, ExtensionPoint
from p... |
#!/usr/bin/env python
#
# dials.command_line.index_symops.py
#
# Copyright (C) 2015 Diamond Light Source
#
# Author: Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
from __future__ import division
from libtbx.phil import comman... |
# Good news everyone
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3)
def tearDown(self):
self.browser.quit()
... |
#!/usr/bin/env python
#########################################################################################
#
# Image class implementation
#
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca>
# Authors: Augus... |
# -*- coding: utf-8 -*-
from datetime import datetime
from bleach import linkify
from flask import g, redirect, request, Markup, abort, flash, escape
from sqlalchemy import or_
from coaster.utils import make_name
from coaster.views import ModelView, UrlChangeCheck, UrlForView, jsonp, render_with, requires_permission,... |
# Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
import select
import socket
import time
import struct
try:
import sphinxapi
except ImportError:
import api117 as sphinxapi
from django.db.models.query import QuerySet
from django.conf import settings
__all__ = ('SearchError', 'ConnectionError', 'SphinxSearch', 'SphinxRelation')
from django.contrib.contentty... |
# Natural Language Toolkit: A Chunk Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for identifying non-... |
'''
Created on Apr 26, 2010
@author: jnaous
'''
import re
from django.db import models
from django.conf import settings
from expedient.clearinghouse.resources import models as resource_models
from expedient.clearinghouse.slice import models as slice_models
from expedient.clearinghouse.aggregate import models as aggre... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 10 11:35:26 2015
@author: salimeh
"""
from dlstats.fetchers._skeleton import Skeleton, Category, Series, Dataset, Provider, CodeDict
from dlstats.fetchers.make_elastic_index import ElasticIndex
import urllib
import xlrd
import csv
import codecs
from datetime import datet... |
#-------------------------------------------------------------------------------
#
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... |
# coding: utf-8
""" """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Third-party
import numpy as np
from numpy import cos, sin
import astropy.coordinates as coord
import astropy.units as u
__all__ = ["vgsr_to_vhel", "vhel_to_vgsr", "gal_xyz_to_hel", "hel_to_gal_x... |
import numpy as np
from scipy.stats import multivariate_normal
import pandas as pd
from scipy.stats import skew, kurtosis
from matplotlib import pyplot, animation
from flowstats import cluster
class DataSet(object):
"""
A single multi-variate data set
"""
def __init__(self, parameter_count):
i... |
"""
Raw radar PPIs processing. Quality control, filtering, attenuation correction,
dealiasing, unfolding, hydrometeors calculation, rainfall rate estimation.
Tested on CPOL.
@title: cpol_processing
@author: Valentin Louf <valentin.louf@monash.edu>
@institution: Monash University
@date: 13/03/2019
@version: 2
.. autos... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re, urllib, hashlib
from urllib2 import urlopen
from datetime import timedelta
import pymongo, htmlentitydefs
from twisted.internet import defer, reactor
from twisted.internet.threads import deferToThreadPool
from gazouilleur import config
from gazouilleur.lib.log i... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import base64
import sys
TEMPLATE = """\
#cloud-config
packages:
- bzr
runcmd:
# Setup environment
- export HOME={homedir}
- export BUILD_ID=root
- export CHROOT_ROOT={homedir}/build-$BUILD_ID/chroot-autobuild
# Setup build chroot
- wget ht... |
import ply.yacc as yacc
from . import utils
from .sdflex import tokens
timings = dict()
header = dict()
delays_list = list()
cells = dict()
tmp_delay_list = list()
tmp_equation = list()
tmp_constr_list = list()
def remove_quotation(s):
return s.replace('"', '')
def p_sdf_file(p):
'''sdf_file : LPAR DELA... |
"""This file contains variables that are shared by several modules.
Also useful to hold command line arguments.
"""
# define variables used to initialise the sector mask
init_centre = (0, 0)
init_radius = 100
init_theta = (0, 360)
# segmentator main command line variables
filename = 'sample_filename_here'
gramag = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__version__ = '1.1.0'
|
#!/usr/bin/env python
'''USAGE: bigsmall.py KO_expressionfile --name organism_name --iters 1000
The function of this script is to convert lists of genes to unweighted,
directed graphs and compute importance of each compound to metabolism
based on the expression of surrounding enzyme nodes.
'''
# Written by Matthew J... |
from .plugin import * |
# Copyright (c) 2015, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
ONE_HOUR = "One_Hour"
THREE_HOURS = "Three_Hours"
SIX_HOURS = "Six_Hours"
TWELVE_HOURS = "Twelve_Hours"
TWENTYFOUR_HOURS = "TwentyFour_Hou... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
from sklearn import datasets
from sklearn.cluster import KMeans
# import numpy
import traceback
from submissions.Ottenlips import billionaires
from submissions.Ottenlips import billionaires
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
bill = DataFrame()
list_of_billi... |
##
# Copyright (c) 2005-2008 Apple 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 l... |
"""
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django.conf import settings
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql.operations import DatabaseOperations as PostgresqlDataba... |
import json
import logging
import asyncio
import aiohttp
import base64
import traceback
from hailtop.utils import time_msecs, sleep_and_backoff, is_transient_error
from .globals import complete_states, tasks
from .batch_configuration import KUBERNETES_TIMEOUT_IN_SECONDS, \
KUBERNETES_SERVER_URL
from .utils import ... |
"""Python library for interfacing with Beebotte.
Contains methods for sending persistent and transient messages and for reading data.
"""
__version__ = '0.3.1'
import json
import time
import hmac
import base64
import hashlib
import requests
from email import utils
try: import urllib.parse as urllib
except ImportErro... |
# This file is part of beets.
# Copyright 2012, Adrian Sampson.
#
# 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, ... |
#!/usr/bin/env python
import itertools as it
import platform
import math
import subprocess
import sys
#DBS = ('mysql', 'bdb', 'ndb-proto1', 'ndb-proto2')
#DBS = ('ndb-proto1', 'ndb-proto2')
#DBS = ('ndb-proto2', 'kvdb')
#DBS = ('kvdb', 'ndb-proto2')
DBS = ('ndb-proto1',)
# config for tom
#THREADS = (1, 2, 4, 8, 12, ... |
# Copyright 2013 Lars Butler & individual contributors
#
# 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... |
# !/usr/local/bin/python3.4
## Argument[0] is script to run
## Argument[1] is path to countryDict
import httplib2
import json
import lxml
import os
import sys
import time
from bs4 import BeautifulSoup
filePath_1 = sys.argv[1]
with open(filePath_1, 'rU') as f1:
countries = json.load(f1)
for country in countr... |
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it w... |
#!/usr/bin/env python3
"""Create a JACK client that copies input audio directly to the outputs.
This is somewhat modeled after the "thru_client.c" example of JACK 2:
http://github.com/jackaudio/jack2/blob/master/example-clients/thru_client.c
If you have a microphone and loudspeakers connected, this might cause an
ac... |
import tempfile
import os
import random
from django.core.files.base import File
from django.db import models
from django.conf import settings
class SongManager(models.Manager):
def make_song(self, username, date, access_token):
"""Creates a new song by fetching users data from Beddit and
storing ... |
#!/usr/bin/python2
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""EC-3PO Interactive Console Interface
console provides the console interface between the user and the interpreter. It
handles the p... |
import os
import re
import json
import string
import socket
import tempfile
from random import randrange
from datetime import datetime as dt
from fabfile.config import *
from fabfile.utils.host import *
from fabfile.utils.interface import *
from fabfile.utils.multitenancy import *
from fabfile.utils.fabos import detec... |
import os
import boto3
from botocore.exceptions import ClientError
from django.contrib.auth.models import User
def check_users():
"""
Checks if the CMS has any user and at least one of them is a staff.
Returns
-------
has_n_staff: bool
Has users and at least one of them is a staff.
... |
import os
from gitdb import GitDB
from git import Repo, Git
from gpm.utils.operation import LocalOperation
from gpm.utils.log import Log
from gpm.utils.console import gets
from gpm.const.status import Status
class GitClient(LocalOperation):
_GITIGNORE_NAME = ".gitignore"
def __init__(self, config = None):
... |
#!/usr/bin/env python
import datetime
import os
from RAPIDpy.rapid import RAPID
from RAPIDpy.make_CF_RAPID_output import ConvertRAPIDOutputToCF
import sys
#local imports
from spt_ecmwf_autorapid_process.imports.CreateInflowFileFromECMWFRunoff import CreateInflowFileFromECMWFRunoff
from spt_ecmwf_autorapid_process.impo... |
from django.shortcuts import render, render_to_response
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.views.generic import FormView
from .serializers import serialize_comments, retrie... |
#!/usr/bin/env python3
import time
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
connect_nodes_bi,
get_auth_cookie,
get_datadir_path,
rpc_port,
p2p_port,
assert_raises_rpc_error,
assert... |
#!/usr/bin/env python
"""Make sure the data in BOTMETA.yml is valid"""
import glob
import os
import re
import sys
import yaml
from voluptuous import Any, MultipleInvalid, Required, Schema
from voluptuous.humanize import humanize_error
from ansible.module_utils.six import string_types
list_string_types = list(string... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.