text stringlengths 12 6.59M |
|---|
import os
import signal
import time
import subprocess
import atexit
import logging
import cPickle
try:
import tensorflow
except ImportError:
pass
try:
import pandas as pd
except ImportError:
pass
import scipy
import numpy
import numpy as np
import ssl
if hasattr(ssl, '_create_unverified_context'):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
## Binary Analysis Tool
## Copyright 2009-2014 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
Program to process a whole directory full of compressed source code archives
to create a knowledgebase. Needs a... |
# -*- coding: utf-8 -*-
import logging
import os
import shutil
import tempfile
import unittest
from mock import patch
# Patch the logger file before import any custom file
abs_log_file = '%s/test_log.LOG' % os.path.dirname(__file__)
try:
os.remove(abs_log_file)
except OSError:
pass
test_handler = logging.Fil... |
from __future__ import absolute_import
from django.conf import settings
import git
import time
from subprocess import Popen, PIPE
import os
from datetime import datetime
import pytz
def get_project_info(commits=5):
repo = get_project_repo()
return {'repo': repo,
'last_commits': get_latest_commit_inf... |
"""
Core operations on Kruskal tensors.
"""
import numpy as np
from .base import fold, tensor_to_vec
from .tenalg import khatri_rao
from matplotlib import gridspec
import matplotlib.pyplot as plt
import itertools as itr
# Author: Jean Kossaifi
# License: BSD 3 clause
def kruskal_to_tensor(factors):
"""Turns th... |
import asyncio
import logging
import random
import shlex
import subprocess
import unicodedata
from datetime import datetime
from datetime import timedelta
import discord
import emoji
from discord.errors import HTTPException
from discord.ext.commands import (BucketType, check, bot_has_permissions)
from numpy import sqr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in th... |
from __future__ import absolute_import
import sys
import traceback
import logging
LOG_LEVELS = {
"CRITICAL": logging.CRITICAL,
"ERROR": logging.ERROR,
"WARNING": logging.WARNING,
"INFO": logging.INFO,
"DEBUG": logging.DEBUG
}
def get_log_level(level):
return LOG_LEVELS.get(level, logging.INFO... |
from __future__ import division, print_function, absolute_import
from multiprocessing import cpu_count, Pool
from itertools import repeat
from os import path
from warnings import warn
from dipy.utils.six.moves import xrange
from nibabel.tmpdirs import InTemporaryDirectory
import numpy as np
import scipy.optimize as... |
from __future__ import division, print_function, absolute_import
import logging
import numpy as np
import nibabel as nib
from dipy.align.imaffine import AffineMap, transform_centers_of_mass, \
MutualInformationMetric, AffineRegistration
from dipy.align.imwarp import SymmetricDiffeomorphicRegistration
from dipy.al... |
# -*- coding: utf-8 -*-
import numpy as np
from symfit.api import Fit # Should be ...api import fit. Or something. Relative imports.
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
import itertools
from scipy.interpolate import NearestNDInterpolator, LinearNDInterpolator
import functool... |
from cherrypy import wsgiserver
import os
import django.core.handlers.wsgi
import zerorpc
c = zerorpc.Client()
c.connect(os.getenv('DIRECTOR_PORT'))
password = c.start_dispatcher(os.getenv('HOSTNAME'))
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ipydispatch.settings")
server... |
import re
import pytest
import urllib
import datetime
from redwind.models import User
from testutil import FakeResponse, assert_urls_match
def test_empty_db(client):
"""Make sure there are no articles when the database is empty"""
rv = client.get('/')
assert '<article' not in rv.get_data(as_text=True)
d... |
import subprocess
def pep8(changed, **kwargs):
"""Runs the pep8 checker against the changed file."""
_required('pep8')
print 'Checking PEP 8 compliance of %s...\n' % _short_path(changed)
subprocess.call(['pep8', changed])
print '\nDone.\n'
def pyflakes(changed, **kwargs):
"""Runs pyflakes a... |
"""
The TextMagicClient class implements the TextMagic HTTPS API.
An application must instantiate a TextMagicClient object, initializing it
with a username and password. Now the API can be used by calling methods
on this instance.
The API is implemented on the _TextMagicClientBase class.
The TextMagicClient class de... |
#
# Copyright (c) 2020 SUNET
# 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 conditi... |
"""Base classes for filters."""
from distance.base import Transform, TransformError
from distance.level import Level
from distance._default_probers import DefaultProbers
_ANIM_FRAG_TAGS = (
'Animator',
'EventListener',
'TrackAttachment',
)
ANIM_FRAG_SECTIONS = {DefaultProbers.fragments.base_container_k... |
#!/usr/bin/python
# File: leaderboard.py
# Description: leaderboard
# Created: 2017-06-27
from .section import Section, SECTION_TYPE, SECTION_UNK_2
class Entry(object):
replay = None
def __init__(self, dbytes, version):
self.unknown = unknown = []
if version >= 1:
un... |
import datetime
import functools
import os
import subprocess
import sys
from distutils.version import LooseVersion
# Private, stable API for detecting the Python version. PYXY means "Python X.Y
# or later". So that third-party apps can use these values, each constant
# should remain as long as the oldest supported Dja... |
"""
Init
"""
from __future__ import unicode_literals
import datetime
import os
import subprocess
VERSION = (2, 3, 6, 'final', 0)
def get_version(version=None):
"""
Returns a PEP 386-compliant version number from VERSION.
"""
if not version:
version = VERSION
else:
assert len(vers... |
# coding: utf-8
import math
import re
import urllib2
from datetime import timedelta
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.sites.models import... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from copy import deepcopy
from aldryn_apphooks_config.admin import BaseAppHookConfig, ModelAppHookConfig
from cms.admin.placeholderadmin import FrontendEditableAdminMixin, PlaceholderAdminMixin
from cms.models import CMSP... |
"""Django Feed Aggregator."""
VERSION = (0, 2, 84)
__version__ = ".".join(map(str, VERSION))
__author__ = "Ask Solem"
__contact__ = "askh@opera.com"
__homepage__ = "http://github.com/ask/django-feeds/"
__docformat__ = "restructuredtext"
|
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
__all__ = ('RawField', 'ListField', 'DictField', 'SetField',
'BlobField', 'EmbeddedModelField')
class ... |
import pytest
from pkg_resources import resource_listdir
from snovault.schema_utils import load_schema
SCHEMA_FILES = [
f for f in resource_listdir('encoded', 'schemas')
if f.endswith('.json')
]
@pytest.fixture(scope='module')
def master_mixins():
return load_schema('encoded:schemas/mixins.json')
@pytest... |
# -*- coding: utf-8 -*-
"""
Created on Wed February 15, 2017
"""
import time
from datetime import datetime, date
from urllib.parse import urljoin
import logging
import re
import csv
import collections
import pandas
import calendar
import copy
import collections
from lxml import etree
import requests
from dlstats.ut... |
# -*- coding: utf-8 -*-
from dlstats.fetchers._commons import Fetcher, Category, Series, Dataset, Provider, CodeDict
import urllib
import xlrd
import csv
import codecs
from datetime import datetime
import pandas
import pprint
from collections import OrderedDict
from re import match
from time import sleep
import sdmx
... |
# -*- coding: utf-8 -*-
from dlstats.fetchers._commons import (Fetcher, Categories,
Series, Datasets, Providers)
import urllib
import xlrd
import csv
import codecs
from datetime import datetime
import pandas
from collections import OrderedDict
from re import match, sub
from time ... |
import argparse
CONFIG_GENERAL = ['embedding_size', 'window_size', 'num_sampled',
'batch_size', 'num_epochs', 'learning_rate', 'print_step']
CONFIG_CHARS_VOCAB = ['chars', 'vocab', 'vocab_size']
# convert JSON to config
def read_config(js, chars_vocab):
config = argparse.Namespace()
for att... |
#!/usr/bin/env python
# dnaseLaunch.py 0.0.1
import argparse,os, sys, json
import dxpy
from launch import Launch
#from template import Launch # (does not use dxencode at all)
class DnaseLaunch(Launch):
'''Descendent from Launch class with 'rampage' methods'''
PIPELINE_NAME = "dnase-seq"
''' This must ma... |
#!/usr/bin/env python
# spp 0.0.1
# Generated by dx-app-wizard.
#
# Basic execution pattern: Your app will run on a single machine from
# beginning to end.
#
# See https://wiki.dnanexus.com/Developer-Portal for documentation and
# tutorials on how to modify this file.
#
# DNAnexus Python Bindings (dxpy) documentation:
... |
#!/usr/bin/python
"""
Filter the results of munki's MANAGED_INSTALL_REPORT.plist
to these items: 'EndTime', 'StartTime', 'ManifestName', 'ManagedInstallVersion'
'Errors', 'Warnings', 'RunType'
"""
import plistlib
import sys
import os
import CoreFoundation
DEBUG = False
# Path to the default munki install dir
default... |
import sys
from sklearn.ensemble import RandomForestRegressor
from models import train_predict
sys.path.append("../")
import pandas as pd
from utils.utils import *
from config import config
params = {"features": ["ltdata.pkl", "saaf.pkl", "dmop_count_1h.pkl", "evtf_states.pkl"], "model": "rf", "n_estimators": 10, "... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
from __future__ import print_function, absolute_import, division
import re
import types
import numpy as np
from numba.cuda.testing import unittest, skip_on_cudasim, SerialMixin
from numba import cuda, jit, int32
from numba.errors import TypingError
class TestDeviceFunc(SerialMixin, unittest.TestCase):
def te... |
# -*- coding: utf-8 -*-
"""
Type inference for NumPy binary ufuncs and their methods.
"""
from __future__ import print_function, division, absolute_import
import numpy as np
from numba import *
from numba import typesystem
from numba.typesystem import numpy_support
from numba.type_inference.module_type_inference impo... |
from collections import OrderedDict
from django.db.models import Count, Case, When, IntegerField, Sum
from onadata.apps.fieldsight.models import Site
from onadata.apps.fsforms.models import FInstance, FieldSightXF
class BarGenerator(object):
def __init__(self, sites):
self.data = OrderedDict()
s... |
from __future__ import unicode_literals
import xlwt
import json
from .. models import Project, Site
from .. rolemixins import DonorRoleMixin, ProjectRoleMixin
from django.views.generic import TemplateView, View
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
from onadata.apps... |
import requests
import requests.auth
class GTMetrixAPI(object):
"""docstring for GTMetrixAPI"""
API_URL = "https://gtmetrix.com/api/0.1/test"
def __init__(self, email, apiToken):
self._email = email
self._apiToken = apiToken
self._httpAuthentication = requests.auth.HTTPBasicAuth(... |
import Map
tile_information = {
'Farm': {
'image': 'assets/tile_farm.png',
'build': {
'energy': 1,
'food': 1,
},
'consume': {
'water': 1,
},
'produce': {
'food': 3,
}
},
'LaunchPad' : {
'image' : ... |
"""Ensemble square-root filters for the Lorenz 96 model"""
import numpy as np
import sys
from L96 import L96
from enkf import serial_ensrf, bulk_ensrf, etkf, letkf, etkf_modens,\
serial_ensrf_modens, bulk_enkf, getkf, getkf_modens
np.seterr(all='raise') # raise error when overflow occurs
if len(sys.ar... |
{
'name': 'Sync pickings IT',
'description': "Synchronize with odoo spain when the products arrive",
'version': '11.0.0.0.1',
'author': 'Visiotech',
'category': '',
'depends': ['stock', 'base_synchro', 'picking_incidences', 'queue_job'],
'data': ["views/stock_picking_view.xml"],
'active'... |
#!/usr/local/bin/env python
"""
Test YANK using simple models.
DESCRIPTION
This test suite generates a number of simple models to test the 'Yank' facility.
COPYRIGHT
Written by John D. Chodera <jchodera@gmail.com> while at the University of California Berkeley.
LICENSE
This code is licensed under the latest avai... |
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, get_host
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from djang... |
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#!/usr/bin/env python
from cStringIO import StringIO
from urllib2 import urlopen
import numpy as np
from numpy import ma
from metpy.cbook import loadtxt, mloadtxt #Can go back to numpy once it's updated
from metpy.cbook import (is_string_like, lru_cache, rec_append_fields,
add_dtype_titles)
__all__ = ['remote_meso... |
#!/usr/bin/env python3
# Fast Exponentiation
# jill-jenn vie et christoph durr - 2014-2015
# snip{
def fast_exponentiation(a, b, q):
"""Compute (a pow b) % q
:complexity: O(log b)
"""
assert a >= 0 and b >= 0 and q >= 1
result = 1
while b:
if b & 1:
result = (result * a) % ... |
# Licensed under an MIT open source license - see LICENSE
'''
Test functions for Cramer
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import Cramer_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
class testCramer... |
import httpretty
from nose.tools import assert_equal
from lettuce import *
import json
from requests import get
from pubs_ui.pubswh.utils import (pull_feed, pubdetails, getbrowsecontent, create_display_links,
jsonify_geojson, add_relationships_graphs, SearchPublications,
... |
import os, json, unittest, time, shutil, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_hosts
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global local_host
local_host = not 'ho... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 05 07:55:56 2016
@author: Suhas Somnath, Chris Smith, Rama K. Vasudevan
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from os import path
from warnings import warn
import h5py
import matplotlib.pyplot as plt
import numpy as np
i... |
from pylearn2.train import Train
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.models.model import Model
from pylearn2.space import VectorSpace
from pylearn2.utils import sharedX
from pylearn2.training_algorithms.bgd import BGD
from pylearn2.training_algorithms.sgd import EpochCounte... |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2019 PyMeasure 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 restriction, including without limit... |
"""
This file is part of the PyMeasure package.
Copyright (c) 2013-2015 Colin Jermain, Graham Rowlands
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 limi... |
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import os
i... |
import os
import sys
import subprocess
import time
import unittest
if sys.platform != 'win32':
sys.path.append(".")
from pywinauto.atspi_element_info import AtspiElementInfo
app_name = r"gtk_example.py"
def _test_app():
test_folder = os.path.join(os.path.dirname
(os.path.di... |
#The MIT License (MIT)
#
#Copyright (c) 2014, Sam Bayless
#
#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, mer... |
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import logging
import os
import sys
from io import open
import psutil
from google.protobuf import json_format as jsonpb
from google.protobuf im... |
# Orca
#
# Copyright 2004-2008 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This ... |
# -*- coding: utf-8 -*-
'''
This module contained a series classes that use for maintain informations of
Areca Backup.
'''
import pathlib
import arrow
import zipfile
import gzip
import io
import os.path
import xml.etree.ElementTree as etree
from . import abhealer
def folder_to_int(name):
parts = name.split("_")... |
#! /usr/bin/python
import math
import numpy as np
import os
import random
import re
from sklearn import datasets, cross_validation
from sklearn.base import TransformerMixin
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics impo... |
from IPy import IP
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy
from django.db import models, connection
from django.db.models import sql, query
# FIXME decide if we should use custom lookup names instead of overrides.
# FIXME decide if other "standard" lookups... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
#
# Library: steady
#
# Copyright 2015 Kitware, Inc., 28 Corporate Dr., Clifton Park, NY 12065, USA.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... |
# Django settings for comic project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
# Sjoerd: used as starting points for various other paths.
# realpath(__file__) starts in the "Comic" app dir. We need to
# go one dir higher so path.join("..")
SITE_ROOT ... |
from django.contrib import admin
from django.conf import settings
from django.db.models import F
from .job import FailedJob, QueuedJob, DequeuedJob, ScheduledJob
from .queue import FailedQueue
from .flow import FlowStore
from .worker import Worker
CONN = getattr(settings, 'PQ_ADMIN_CONNECTION', 'default')
def requeue... |
import warnings
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.urlresolvers import LocaleRegexURLResolver
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
def i18n_patterns(prefix, *args):
"""
Adds the language code prefi... |
import times
from django.db import transaction
from django.db import models
from django.conf import settings
from .job import Job
PQ_DEFAULT_JOB_TIMEOUT = 180 if not hasattr(
settings, 'PQ_DEFAULT_JOB_TIMEOUT') else settings.PQ_DEFAULT_JOB_TIMEOUT
class Queue(models.Model):
connection = None
name = mod... |
import django.db.models.manipulators
import django.db.models.manager
from django.core import validators
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.fields import AutoField, ImageField, FieldDoesNotExist
from django.db.models.fields.related import OneToOneRel, ManyToOneRel
from django.db.... |
from django.core import validators
from django.core.exceptions import PermissionDenied
from django.utils.html import escape
from django.conf import settings
from django.utils.translation import gettext, gettext_lazy, ngettext
FORM_FIELD_ID_PREFIX = 'id_'
class EmptyValue(Exception):
"This is raised when empty dat... |
from django.conf import settings
from django.template import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
class D... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... |
#!/usr/bin/env python
# coding=utf-8
import numbers
from . import trit
from . import integer
class Register(trit.Trits):
"""A fixed-length, mutable, ordered sequence of trits.
A Register's length is set when it is created, and is fixed for the
lifetime of the Register. The contents of the Register with... |
"""
This module converts requested URLs to callback view functions.
URLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
import functools
import inspect
import re
import string
from i... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio 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 opt... |
"""Migrate attachments from couchdb to an external blob store
## Running migrations
Use the `run_blob_migration` management command to transfer attachments
on selected models from couchdb to the external blob database. Run the
command without arguments to get a list of possible migrations that
can be run:
./mana... |
import warnings
import numpy as np
import scipy.stats, scipy.optimize
from ultranest import ReactiveNestedSampler
__all__ = ['bexvar', 'bexvar_from_table']
def _lscg_gen(src_counts, bkg_counts, bkg_area, rate_conversion, density_gp):
"""
Generates a `log_src_crs_grid` applicable to this particular li... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from .templatetags.gravatar import gravatar_url, gravatar
class TestGravatar(TestCase):
def test_gravatar_url(self):
self.assertEqual('http://www.gravatar.com/avatar/d7935ea08d17e261d3b0d12c04759c9d?s=80&d=', gravatar_url('alexis.couronne@gmail.com... |
# Class Compacter
import sys
from math import ceil
from fractions import gcd
if sys.platform.startswith( 'win' ):
sys.path.append( '..\\3rdParty\\pyelftools-0.20' )
elif sys.platform.startswith( 'linux' ):
sys.path.append( '../3rdParty/pyelftools-0.20' )
else:
exit( 'Apple?' )
from elftools.elf.elffile ... |
import sublime
import sublime_plugin
import os
import urllib
import json
import threading
import time
import pprint
import urllib.parse
import shutil
import datetime
from xml.sax.saxutils import unescape
from . import requests, context, util
from .context import COMPONENT_METADATA_SETTINGS
from .util import getUniqueE... |
#!/usr/bin/env python
"""
Converting a file tree into partitioned, space-controlled TAR files.
This module attempts to address the following problems:
* Storing individual small files can be very time consuming because of
per-file overhead.
* It is desirable to maintain UNIX metadata on a file, and that's not
al... |
"""Migrate attachments from couchdb to an external blob store
## Running migrations
Use the `run_blob_migration` management command to transfer attachments
on selected models from couchdb to the external blob database. Run the
command without arguments to get a list of possible migrations that
can be run:
./mana... |
import os
import requests
from six.moves.urllib.parse import urljoin
class GM(object):
base_url = 'https://www.stockfighter.io/gm/'
def __init__(self, api_key=None):
self.api_key = os.environ['API_KEY'] if api_key is None else api_key
self.headers = {'Cookie': 'api_key={api_key}'.format(api_k... |
"""
sash Activity
"""
from sugar.activity import activity
from sugar.datastore import datastore
import pygame
import logging
_logger = logging.getlogger('Sash')
class SashActivity(activity.Activity):
def __init__(self, handle):
print "running activity init", handle
activity.Activity.__init__(sel... |
"""
============
django-slack
============
-------------------------------------
Seamless Slack integration for Django
-------------------------------------
This project provides easy-to-use integration between
`Django <http://www.djangoproject.com/>`_ projects and the
`Slack <https://www.slack.com>`_ group chat and ... |
# coding: utf-8
from datetime import datetime
from mock import patch
from unittest import TestCase
from notification.models import save_task, TaskHistory
from notification.tests.factory import TaskHistoryFactory
@patch('notification.models.get_redis_connection')
class SaveTaskTestCase(TestCase):
def setUp(self):... |
#!/usr/bin/env python
"""
ts.py
A "tandem simulator," which wraps an alignment tool as it runs, eavesdrops on
input and output, simulates a new dataset similar to the input data, aligns
it, uses those alignments as training data to build a model to predict MAPQ,
then re-calcualtes MAPQs for the original input using t... |
import sublime
import sublime_plugin
import os
import urllib
import json
import threading
import time
import pprint
import base64
import zipfile
import shutil
import sys
try:
# Python 3.x
import urllib.parse
from . import requests
from . import context
from .salesforce import util
from .contex... |
# -*- coding: utf-8 -*-
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = '$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $'
import os
import re
from hashlib import sha1
from django.db import models
from django.core.urlresolvers import reverse
from django.core.mail import send_mail
from ... |
"""
CONVENTIONS:
- All longitudes and latitudes below are referenced to the WGS84 ellipsoid, unless stated otherwise
"""
import os
from functools import wraps
import datetime as dt
import json
from math import ceil, floor
from itertools import product
from pathlib import Path
import shutil
import re
import subproc... |
# Lint as: python2, python3
# Copyright 2017 PerfKitBenchmarker 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
... |
from typograf import RemoteTypograf
import binascii
def get_typograf_field_name(field_name):
""" Return field_name with typograf prefix """
return 'typograf_{field}'.format(field=field_name)
def get_typograf_hash_field_name(field_name):
""" Return field_name with typograf prefix, and hash suffix """
... |
"""TFTA module is to receive and decode messages and send responses from
and to other agents in the system"""
import sys
import logging
logging.basicConfig(format='%(levelname)s: %(name)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger('TFTA')
from kqml import KQMLModule, KQMLPerformative, KQMLLis... |
#!/usr/bin/env python
# Copyright (c) 2016 Ryan Collins <rcollins@chgr.mgh.harvard.edu>
# Distributed under terms of the MIT license.
"""
Calculates non-duplicate primary-aligned binned coverage
of a chromosome from an input BAM file
"""
#Import libraries
import argparse
import sys
from subprocess import call
import... |
# 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 distributed in the hope that it will be useful, but ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
"""
weasyprint.document
-------------------
"""
import collections
import functools
import hashlib
import io
import math
import shutil
import zlib
from os.path import basename
from urllib.parse import unquote, urlsplit
import pydyf
from weasyprint.layout import LayoutContext
from . import Attachment, CSS, _... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Daniel Zhang (張道博)'
__copyright__ = 'Copyright (c) 2014, University of Hawaii Smart Energy Project'
__license__ = 'https://raw.github' \
'.com/Hawaii-Smart-Energy-Project/Maui-Smart-Grid/master/BSD' \
'-LICENSE.txt'
from msg_logg... |
__version__ = '0.9.4'
|
# -*- coding: utf-8 -*-
"""Test GUI component."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
from pytest import yield_fixture, fixture
import numpy as np
from numpy.testing import assert_arr... |
import re
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
import jsonfield
from corehq.motech.auth import api_auth_settings_choices
from corehq.motech.const import ALGO_AES, AUTH_TYPES, PASSWORD_PLACEHOLDER
from corehq.motech.utils import b64_aes_decrypt, b64_aes_encrypt
cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.