code stringlengths 1 199k |
|---|
import pageadmin
import useradmin
import permissionadmin
import settingsadmin
from cms import plugin_pool
from cms.apphook_pool import apphook_pool
plugin_pool.plugin_pool.discover_plugins()
apphook_pool.discover_apps() |
"""
Module documentation string.
"""
from PyQt4 import QtCore
__version__ = "$Revision-Id:$"
class ErrorHandler(object):
""" Class handles display of wizard error messages. """
__ERROR_TEMPLATE = "<p><img src=':icons/icons/cross16.png' /> %s</p>"
def __init__(self, creationWizard):
"""
Con... |
from .fetchers import NUPermissionsFetcher
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from bambou import NURESTObject
class NUEnterprisePermission(NURESTObject):
""" Represents a EnterprisePermission in the VSD
Notes:
Represents Enterprise Permission ... |
X=1 |
import json
import os
from django.core.urlresolvers import reverse
from django.utils.text import slugify
import mock
from elasticsearch_dsl.search import Search
from mpconstants import collection_colors as coll_colors
from nose.tools import eq_, ok_
import mkt
import mkt.carriers
import mkt.feed.constants as feed
impor... |
import zeit.content.link.browser.form
import zeit.campus.browser.social
base = zeit.content.link.browser.form.Base
field_groups = base.link_field_groups + (
zeit.campus.browser.social.SocialBase.social_fields,)
class Add(zeit.campus.browser.social.SocialBase,
zeit.content.link.browser.form.Add):
field... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from sentry.utils.db import is_postgres
class Migration(SchemaMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for... |
from __future__ import with_statement
import os
import maya.cmds
import IECore
import IECoreMaya
class FnSceneShapeTest( IECoreMaya.TestCase ) :
__testFile = "test/test.scc"
def setUp( self ) :
scene = IECore.SceneCache( FnSceneShapeTest.__testFile, IECore.IndexedIO.OpenMode.Write )
sc = scene.createChild( str(1)... |
logins = ["account1@mail.ru", "account2@mail.ru", "account3@bk.ru"]
passes = ["111111", '222222', '333333']
log_filename = "sms.log" |
'''
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
'''
from node_struct import TreeNode
class Solution:
# @param num, a list of integers
# @return a tree node
def sortedArrayToBST(self, num):
size = len(num)
if size == 0:
return ... |
"""
This module provides solvers for the Lindblad master equation and von Neumann
equation.
"""
__all__ = ['mesolve']
import numpy as np
import scipy.integrate
from qutip.qobj import Qobj, isket, isoper, issuper
from qutip.superoperator import spre, spost, liouvillian, vec2mat, lindblad_dissipator
from qutip.expect imp... |
""" test fancy indexing & misc """
import pytest
import weakref
from warnings import catch_warnings
from datetime import datetime
from pandas.core.dtypes.common import (
is_integer_dtype,
is_float_dtype)
from pandas.compat import range, lrange, lzip, StringIO
import numpy as np
import pandas as pd
from pandas.c... |
import numpy as np
from scipy import linalg
import pyquat as pq
from pyquat import Quat
import pyquat.wahba.valenti as pqv
import pyquat.random as pqr
from test.assertions import QuaternionTest
import math
import unittest
class TestWahbaValenti(QuaternionTest):
def test_q_acc_points_down(self):
""" Tests th... |
"""
"""
from __future__ import annotations
import re
from typing import Dict, Set, Tuple
from .enums import VersionType
from .logger import LOG, Scrubber
__all__ = ("Config",)
ANY_VERSION = re.compile(r"^((\d+)\.(\d+)\.(\d+))((dev|rc)(\d+))?$")
FULL_VERSION = re.compile(r"^(\d+\.\d+\.\d+)$")
class Config:
def __ini... |
from django.contrib.contenttypes.models import ContentType
def fetch_content_objects(tagged_items, select_related_for=None):
"""
Retrieves ``ContentType``s and content objects for the given list of
``TaggedItems``, grouping the retrieval of content objects by model
to reduce the number of queries execut... |
from rest_framework import serializers
from .models import Organization, OrganizationProfile, Category, OrganizationProfileProposedChange, Person
from taggit_serializer.serializers import (TagListSerializerField, TaggitSerializer)
class OrganizationProfileSerializer(TaggitSerializer, serializers.ModelSerializer):
c... |
from lamarepy import geometry as g
from show_q import show_q |
import sys
import pymongo
import gridfs
source_db = pymongo.Connection(port=27019).regulations
dest_db = pymongo.Connection().regulations_demo
source_fs = gridfs.GridFS(source_db, 'files')
dest_fs = gridfs.GridFS(dest_db, 'files')
agency = sys.argv[1]
for doc in source_db.docs.find({'agency': agency}):
print "Copyi... |
"""Data accessor class for data and metadata from various sources in v4 format."""
import logging
import dask.array as da
import katpoint
import numpy as np
from .applycal import (CAL_PRODUCT_TYPES, INVALID_GAIN, add_applycal_sensors,
apply_flags_correction, apply_vis_correction,
... |
from django.db import transaction
from django.db.models.signals import post_save
from django.apps import AppConfig
from .notifications import send_notifications
class BuggyConfig(AppConfig):
name = 'buggy'
def ready(self):
from .models import Action
post_save.connect(self.on_action_save, sender=... |
from os.path import abspath, dirname, basename, join
ROOT_PATH = abspath(dirname(__file__))
PROJECT_NAME = basename(ROOT_PATH)
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqli... |
"""Tests for Vispy's IPython bindings"""
from numpy.testing import assert_equal, assert_raises
from vispy.testing import requires_ipython
@requires_ipython(2.0)
def test_webgl_loading():
"""Test if the vispy.ipython extension loads the webGL backend
on IPython 3.0 and greater.
Test if it fails to load the w... |
"""
zseqfile - transparently handle compressed files
"""
from .zseqfile import ( # noqa
open,
open_gzip,
open_bzip2,
open_lzma,
)
open_gz = open_gzip
open_bz2 = open_bzip2
open_xz = open_lzma |
"""
Contains helper classes and methods for tests.
"""
from statsite.aggregator import Aggregator
from statsite.collector import Collector
from statsite.metrics_store import MetricsStore
class DumbAggregator(Aggregator):
def __init__(self, *args, **kwargs):
super(DumbAggregator, self).__init__(*args, **kwar... |
import cv2
import numpy as np
import os
import fnmatch
import xml.etree.ElementTree as ET
gTemplateNames = [
"scissors", #0
"simpleDaisy", #1
"eye", #2
"ok", #3
"candle", #4
"bomb", #5
"lightning", #6
"cheese", #7
"fire", #8
"cactus", #9
"tree", #10
"sunSpark", #11
... |
from typing import Dict
import pytest
from moneyed import USD, Money
@pytest.fixture(autouse=True)
def add_entities(doctest_namespace: Dict[str, object]) -> None:
"""
Inserts entities into doctest namespaces so that imports don't have to be added to
all examples.
https://docs.pytest.org/en/stable/doctes... |
class DeleteSubscriberIdRequest(object):
def __init__(self):
self.subscriber_id = ''
self.subscriber_type = '' |
from __future__ import absolute_import
import logging
from rest_framework import serializers
from rest_framework.response import Response
from uuid import uuid4
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationRepositoryPermission
from sentry.api.excepti... |
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 'Document.document'
db.alter_column('mediaman_document', 'document', self.gf('django.db.models.fields.files.FileField'... |
from django.http import *
from forms import UploadForm
from django import template
from django.template.loader import get_template
from django.template import Context, RequestContext
from django.utils.decorators import method_decorator
from django.shortcuts import render_to_response
from django.contrib.auth import auth... |
from __future__ import absolute_import, print_function
import logging
import six
import threading
import weakref
from contextlib import contextmanager
from django.conf import settings
from django.db import router
from django.db.models import Model
from django.db.models.manager import Manager, QuerySet
from django.db.mo... |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
INSTALLED_APPS = (
# tested package
'translatable',
# test packages
'package',
'models',
'admin',
)
try:
import coverage
import testcoverage
except ImportError:
pass
else:
TEST_RUNNER = 'testc... |
from .fetchers import NUPermissionsFetcher
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from bambou import NURESTObject
class NUKeyServerMonitorSEK(NURESTObject):
""" Represents a KeyServerMonitorSEK in the VSD
Notes:
Represents a Keyserver Monitor SEK ... |
from ..misc import mkdir_p
from ..misc import list_to_aligned_text
import os
import ROOT
class TblTree(object):
def __init__(self, analyzerName, fileName, treeName, outPath):
self.analyzerName = analyzerName
self.fileName = fileName
self.treeName = treeName
self.outPath = outPath
... |
"""
api/Zapi.py
@author: Josh Williams
Date Added: Tue Feb 21 15:15:15 CST 2006
This API takes care of all ZAPI direct DB access (api keys, account verification, etc)
"""
import datetime, md5, xmlrpclib
from pprint import pformat
from AZTKAPI import AZTKAPI
import errors, validation, utils
from decorators import stack,... |
import os, string
args = ""
flag = True
with open('WhatHappened.txt', 'w+') as WH:
WH.write("hello" + "\n")
with open('parameters.txt', 'r+') as file:
for line in file:
if flag:
line = line.split(":")
print line[1]
if line[0] == "tempo":
args += " -q " + line[1].translate(string.maketrans("\r\n", " ")... |
"""
These are helper scripts to populate the database
"""
import sys,os,re,time,csv
import sqlalchemy
import getpass
import numpy as np
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from htsint import Configure
from .DatabaseTables import Base,Taxon,Gene,Uniprot,GoTerm,GoAnnotation
from .... |
'''
Created on 2014年12月31日
@author: amaozhao
'''
from django.conf.urls import url
from blog.views import Home
urlpatterns = [
url(r'^$', Home.as_view(), name='home'),
url(r'^[a-zA-Z]', Home.as_view(), name='home'),
] |
import pytest
import numpy as np
np.seterr(all='raise')
import ss_generator as ssg
def test_build_beta_sheet():
print("test build beta sheet.")
res_list = ssg.beta_sheet.build_ideal_flat_beta_sheet('parallel', 10, 2)
#res_list = ssg.beta_sheet.build_ideal_flat_beta_sheet('antiparallel', 41, 2)
ssg.IO.sa... |
"""
Print (average) channel values for a collection of models, such as that
serialized by TrainCV. Based on print_monitor.py.
usage: print_monitor_cv.py model.pkl [-a]
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
__maintainer__ = "Steven Kearnes"
i... |
import collections
import json
import os
import re
import subprocess
import sys
from telemetry.core import util
from telemetry.internal import forwarders
NamedPort = collections.namedtuple('NamedPort', ['name', 'port'])
class LocalServerBackend(object):
def __init__(self):
pass
def StartAndGetNamedPorts(self, a... |
from .gridding_functions import * # noqa: F403
from .points import * # noqa: F403
from .triangles import * # noqa: F403
from .polygons import * # noqa: F403
from .interpolation import * # noqa: F403
__all__ = gridding_functions.__all__[:] # pylint: disable=undefined-variable
__all__.extend(interpolation.__all__) ... |
import subprocess
import os
import sys
def run_gate_annotator(xgappfile, source_folder, target_folder):
# Using __file__ instead of pkg_resources prevents .egg being packaged which would make Java execution impossible
cwd = os.path.split(os.path.abspath(__file__))[0] + '/gateannotator'
mvn = subprocess.Pope... |
from django import forms
from helpme.models import Point
from django.forms import ModelForm, Textarea
class CreatePoint(forms.ModelForm):
class Meta:
model = Point
exclude = ['state'] |
from django import forms
from django.conf import settings
from django.contrib.gis.geoip2 import GeoIP2, GeoIP2Exception
from django.core.validators import validate_ipv46_address
from django.db import models
from django.utils import translation
from extended_choices import Choices
from geoip2.errors import GeoIP2Error
f... |
import os
version_file = os.path.join(os.path.dirname(__file__), "VERSION")
with open(version_file, 'rb') as f:
__version__ = f.read().decode('utf-8').strip()
from djdd.initialize_build import install_build_environment, uninstall_build_environment
from djdd.add_software import add_software
from djdd.add_variant imp... |
import ctypes
from hydromet.hydromath import __lib, __ffi
mse_c = __lib.mse
def mse(obs, sim):
assert len(obs) == len(sim)
return mse_c(__ffi.cast('double *', obs.ctypes.data),
__ffi.cast('double *', sim.ctypes.data),
len(obs)) |
import os
import sys
import platform
import subprocess
from setuptools import setup, find_packages
if platform.system() == 'Windows':
if sys.maxsize > 2**32:
subprocess.call(
['easy_install', "http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.1.win-amd64-py2.7.exe"]
)
eli... |
import numpy as np
from glumpy import app, gloo, gl
import triangle
A = dict(vertices=np.array(((-1, -1), (1, -1), (1, 1), (-1, 1))))
B = triangle.triangulate(A, 'qa0.01')
vertices = B['vertices']
indices = B['triangles']
vertex = '''
attribute vec2 a_position;
void main()
{
gl_Position = vec4(a_pos... |
import os
import re
import sys
import xml
import ctypes
import struct
import pickle
import logging
import binascii
import traceback
from io import BytesIO
from collections import namedtuple
import windows
import windows.generated_def as gdef
from windows.winobject import event_log
""" ParsedElement : This represent a d... |
from pytest import mark
from intervals import IntInterval
@mark.parametrize(('interval', 'string'), (
(IntInterval((1, 3)), '2'),
(IntInterval([1, 1]), '1'),
(IntInterval([1, 3]), '1 - 3'),
(IntInterval.from_string('(1, 5]'), '2 - 5'),
(IntInterval.from_string('[1,]'), '1 -')
))
def test_hyphenized(... |
import autograd.numpy as np
from pymanopt import Problem
from pymanopt.manifolds import Elliptope
from pymanopt.solvers import ConjugateGradient
def packing_on_the_sphere(n, k, epsilon):
manifold = Elliptope(n, k)
solver = ConjugateGradient(mingradnorm=1e-8, maxiter=1e5)
def cost(X):
Y = np.dot(X, X... |
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
DESCRIPTOR = descriptor.FileDescriptor(
name='sensor_output.proto',
package='semantic_output',
serialized_pb='\n\x13sensor_output.proto\x12\x0fsemantic_outpu... |
from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.winwcprawio import WinWcpRawIO
class WinWcpIO(WinWcpRawIO, BaseFromRaw):
"""
Class for reading data from WinWCP, a software tool written by
John Dempster.
WinWCP is free:
http://spider.science.strath.ac.uk/sipbs/software.htm
"""
_pr... |
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 'Video.is_from_webcam'
#db.add_column('audio_video_video', 'is_from_webcam', self.gf('django.db.models.fields.BooleanFie... |
"""
Allows editing of a line plot.
Left-dragging a point will move its position.
Right-drag pans the plot.
Mousewheel up and down zooms the plot in and out.
Pressing "z" brings up the Zoom Box, and you can click-drag a rectangular region to
zoom. If you use a sequence of zoom boxes, pressing alt-left-arrow and
alt-rig... |
"""
raven.utils.json
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import datetime
import uuid
try:
import simplejson as json
except ImportError:
import json
try:
JSONDecodeError = json.JSONDecodeError
ex... |
"""
Tests of neo.io.alphaomegaio
"""
from __future__ import absolute_import, division
import unittest
from neo.io import AlphaOmegaIO
from neo.test.iotest.common_io_test import BaseTestIO
class TestAlphaOmegaIO(BaseTestIO, unittest.TestCase):
files_to_test = ['File_AlphaOmega_1.map',
'File_Alph... |
from poapextensions.SimpleWorkers import (
SimpleRecoverableSocketWorker,
)
from poapextensions.RecoveryStates import (
BasicLock,
BasicStateObject,
)
from poapextensions.PreemptibleControllers import (
RecoverableThreadedTCPServer,
)
from poapextensions.RecoverableStrategies import (
RecoverableFix... |
import logging
import os.path
import shutil
import subprocess
import sys
import tempfile
import unittest
import numpy as np
import rasterio
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class WindowTest(unittest.TestCase):
def test_window_shape_errors(self):
# Positive height and width are nee... |
from django.db import models
from airmozilla.main.models import Event
class StaticPage(models.Model):
url = models.CharField(max_length=100, db_index=True)
title = models.CharField(max_length=200)
content = models.TextField(blank=True)
template_name = models.CharField(max_length=100, blank=True)
# p... |
from __future__ import print_function
from permuta import *
import permstruct
import permstruct.dag
from permstruct import *
from permstruct.dag import taylor_dag
import sys
is_classical = True
perm_bound = 10
verify_bound = 12
ignored = 0
max_len_patt = None
upper_bound = None
remove = True
max_rule_s... |
import collections
from hm import managers, log, model, config
class Host(model.BaseModel):
def __init__(self, id, dns_name, conf=None, alternative_id=0, **kwargs):
self.id = id
self.dns_name = dns_name
self.manager = None
self.extra_args = set()
self.config = conf
se... |
import redis
import os
DEBUG = True
SECRET_KEY = "9e2e3c2d-8282-41b2-a027-de304c0bc3d944963c9a-4778-43e0-947c-38889e976dcab9f328cb-1576-4314-bfa6-70c42a6e773c"
NEVERCACHE_KEY = "7b205669-41dd-40db-9b96-c6f93b66123496a56be1-607f-4dbf-bf62-3315fb353ce6f12a7d28-06ad-4ef7-9266-b5ea66ed2519"
ALLOWED_HOSTS = "*"
REDIS_HOST =... |
"""
Vector Autoregressive Moving Average with eXogenous regressors model
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
from warnings import warn
from statsmodels.compat.collections import OrderedDict
import pandas as pd
import numpy as np
from .kalman_f... |
from __future__ import print_function
from contextlib import contextmanager
import logging
import platform
import six
import unittest
class TestBase(unittest.TestCase):
def setUp(self):
self.logger = logging.getLogger(__name__)
self.base_logger_name = __name__
def _get_prefix(self):
if s... |
CONDOR_RAM_GB = 1000
condorBinaryUpload = 'condor_exec'
condorScriptUpload = 'condor_jobs' |
import os
from setuptools import setup, find_packages
setup(name="static_tl",
version="0.5.3",
description="Generate a static HTML website from your twitter time line",
url="https://github.com/dmerejkowsy/static_tl",
author="Dimitri Merejkowsky",
author_email="d.merej@gmail.com",
pac... |
import sys
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
try:
import multiprocessing
except ImportError:
pass
PY3 = sys.version_info[0] == 3
install_requires = [
"Django>=1.6.2,<1.7",
"South>=0.8.4",
"django-compressor>=1.4",
"djang... |
from __future__ import with_statement
from numpy import array, transpose, ndarray, empty
from traits.api import Instance, DelegatesTo, Bool, Int
from enable.api import transparent_color_trait
from chaco.color_mapper import ColorMapper
from chaco.base_xy_plot import BaseXYPlot
from chaco.linear_mapper import LinearMappe... |
"""Tool for uploading diffs from a version control system to the codereview app.
Usage summary: upload.py [options] [-- diff_options] [path...]
Diff options are passed to the diff command of the underlying system.
Supported version control systems:
Git
Mercurial
Subversion
Perforce
CVS
It is important for Git... |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('challenges.views',
url(r'$', 'show', name='challenge_show'),
url(r'entries/$', 'entries_all', name='entries_all'),
url(r'entries/add/$', 'create_entry', name='entry_create'),
url(r'entries/(?P<entry_id>\d+)/$', 'entry_show',
... |
import fnmatch
import imp
import itertools
import os
from contextlib import contextmanager
from . import command
from . import statusfile
from . import utils
from ..objects.testcase import TestCase
from .variants import ALL_VARIANTS, ALL_VARIANT_FLAGS
STANDARD_VARIANT = set(["default"])
class VariantsGenerator(object):... |
import django.db.models.deletion
from django.db import migrations, models
import dimagi.utils.couch.migration
import corehq.apps.sms.models
class Migration(migrations.Migration):
dependencies = [
('smsforms', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Messagi... |
import numpy as np
import time
import random
from File import *
from UtilImage import *
from DataObject import *
DILATION_STRUCTURE = (5,5)
EQUALIZATION = NORMALIZE_CONTRAST_STRETCHING
INFO_SIZE_X = 0
INFO_SIZE_Y = 1
INFO_PAD_X = 2
INFO_PAD_Y = 3
INFO_DIAPHRAGM_X1 = 4
INFO_DIAPHRAGM_X2 = 5
INFO_DIAPHRAGM_Y1 = 6
INFO_DI... |
class PyBase:
def __init__(self):
self._fa = 10
self._fb = 20
@property
def a(self):
return self._fa
@property
def b(self):
return self._fb
@a.setter
def a(self, val):
self._fa = val
@b.setter
def b(self, val):
self._fb = val |
"""Top-level presubmit script for Chromium.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""
_EXCLUDED_PATHS = (
r"^breakpad[\\\/].*",
r"^net/tools/spdyshark/[\\\/].*",
r"^skia[\\\/].*",
r"^v8[\\\/].*",
r".*MakeF... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 100, ar_order = 12); |
from functools import partial
from collections import defaultdict
import numpy as np
from matplotlib.artist import Artist
from matplotlib.axes import Axes, subplot_class_factory
from matplotlib.transforms import Affine2D, Bbox, Transform
from ...coordinates import SkyCoord, BaseCoordinateFrame
from ...wcs import WCS
fr... |
from __future__ import division, print_function, absolute_import
import os.path
import numpy as np
from numpy.testing import (assert_, assert_array_almost_equal, assert_equal,
assert_almost_equal, assert_array_equal,
assert_raises)
from scipy._lib._numpy_compat impo... |
import pytest
from unittest import mock
from taskplus.core.shared.response import ResponseFailure
from taskplus.core.actions import UpdateTaskStatusAction, UpdateTaskStatusRequest
def test_update_task_status_request():
request = UpdateTaskStatusRequest(id=1, name='new')
assert request.id == 1
assert request... |
import sys, getopt, os, json, mapnik, tempfile, urllib2
from xml.dom import minidom
try:
from mapnik import ProjTransform, Projection, Box2d, Image
except ImportError, E:
sys.exit("Requires Mapnik SVN r822 or greater:\n%s" % E)
def main(argv):
b = "-180,-90,180,90"
i = ""
o = ""
l = "-1"
try:
opts, args = g... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = 'make-this-something-that-nobody-would-ever-guess-5632344'
OPENID_PROVIDERS = [
{ 'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id' },
{ 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
SQLALCH... |
"""Find absolute URLs from strings"""
__version__ = "3.0.3"
import re
import string
_countrycodes = [
"ac",
"ad",
"ae",
"af",
"ag",
"ai",
"al",
"am",
"an",
"ao",
"aq",
"ar",
"as",
"at",
"au",
"aw",
"ax",
"az",
"ba",
"bb",
"bd",
"be"... |
from pkg_resources import DistributionNotFound, get_distribution
import os
from os.path import dirname, basename, isfile
import glob
try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = get_distribution(dist_name).version
except DistributionNotFound... |
import copy, datetime
from django.conf import settings
from django import template
from django.contrib.auth import models as auth_models
from tagging.models import Tag
from cms.utils import get_language_from_request
from cmsplugin_blog.models import Entry, EntryTitle
from cms.models import Placeholder
from simple_trans... |
"""Trajectory Utilities Module
Tasks:
- generate trajectories
- produce dumps of trajectories for saving/sending (ie. JSON, CSV, ...)
"""
from __future__ import division
import datetime
import numpy as np
import scipy as sci
import scipy.misc
import matplotlib.pyplot as plt
np.set_printoptions(precision=3, supp... |
"""
Run CD32 games using fsuae
It will use compressed directories, and create 7z archive for save state dirs.
It is assumed, that filename of cue file (without extension) is the same as
archive with game assets, while using config name (without extension) will be
used as a base for save state (it will append '_save.7z'... |
import base64
import errno
import httplib
import json
import socket
import sys
import time
def do(method, connection, headers, path, body=None):
connection.request(method, path, headers=headers, body=json.dumps(body))
resp = connection.getresponse()
content = resp.read()
if resp.status != 200:
r... |
from corehq.apps.users.models import Permissions
from corehq.apps.domain.decorators import login_and_domain_required
from corehq.apps.users.decorators import require_permission
def require_cloudcare_access_ex():
"""
Decorator for cloudcare users. Should require either data editing
permissions or they should... |
"""Blogger to Zinnia command module
Based on Elijah Rutschman's code"""
import sys
from getpass import getpass
from datetime import datetime
from optparse import make_option
from django.conf import settings
from django.utils import timezone
from django.utils.text import Truncator
from django.utils.html import strip_tag... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AlternativeName',
fields=[
... |
import os
import string
import stat
srcRoot = "../../scite"
srcDir = os.path.join(srcRoot, "src")
docFileName = os.path.join(srcRoot, "doc", "SciTEDoc.html")
propsFileName = os.path.join(srcDir, "SciTEGlobal.properties")
try: # Old Python
identCharacters = "_*." + string.letters + string.digits
except AttributeError: ... |
import ast, sys
data = ""
with open(sys.argv[1], 'r') as f:
data = f.read()
ip_dat = ast.literal_eval("{\n" + data + "}")
def is_cbit(ident):
if "_ENABLE" in ident or "DELAYED" in ident:
return True
else:
return False
def is_bus(ident):
return ident.startswith("SB")
ips = sorted(ip_dat)
... |
import subprocess,os,sys
sys.path.append('/home/shangzhong/Codes/Pipeline')
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # disable buffer
from Modules.f00_Message import Message
from Modules.f01_list_trim_fq import list_files,Trimmomatic
from Modules.p01_FileProcess import get_parameters
def kallisto_index(trans... |
from files import *
from loaders.gene_loader import GeneLoader
from loaders.disease_loader import DiseaseLoader
import csv
import gzip
from mod import MOD
class ZFIN(MOD):
species = "Danio rerio"
loadFile = "ZFIN_0.6.1_10.tar.gz"
@staticmethod
def gene_href(gene_id):
return "http://zfin.org/" + ... |
from msrest.serialization import Model
class TermsPaging(Model):
"""Paging details.
:param total: Total details.
:type total: int
:param limit: Limit details.
:type limit: int
:param offset: Offset details.
:type offset: int
:param returned: Returned text details.
:type returned: int... |
"""
Adapted from https://github.com/darius/circuitexpress/blob/master/sketchpad/tttplaybitboard.py
Super-fancy console tic-tac-toe.
Derived from tttplay.py
Bitboards from https://gist.github.com/pnf/5924614
grid_format from https://github.com/gigamonkey/gigamonkey-tic-tac-toe/blob/master/search.py
"""
import sys
from c... |
""" msginit tool
Tool specific initialization of msginit tool.
"""
__revision__ = "src/engine/SCons/Tool/msginit.py 2014/01/04 01:12:18 root"
import SCons.Warnings
import SCons.Builder
import re
def _optional_no_translator_flag(env):
""" Return '--no-translator' flag if we run *msginit(1)* in non-interactive
... |
"""distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
__revision__ = "$Id: sdist.py 81261 2010-05-17 10:54:43Z tarek.ziade $"
import os
import string
import sys
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.