text stringlengths 12 6.59M |
|---|
version = "0.4.4"
protoVersion = "400" |
def wrap_method(cls, method):
from copy import copy
method_name = method.__func__.__name__
method_param = method
if hasattr(cls, method_name):
orig_cls_method = getattr(cls, method_name)
@classmethod
def wrap(cls_):
setattr(cls, method_name, method_param)
... |
import numpy as np
from six.moves import map, range, zip
from collections import namedtuple
from functools import partial
from itertools import tee
class Bunch(dict):
"""
Container object for datasets: dictionary-like object that exposes
its keys as attributes.
Examples
--------
>>> b = Bun... |
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import pickle
import numpy as np
import os.path
from collections impor... |
from collections import OrderedDict
from copy import copy
from mo_dots import relative_field, listwrap, split_field, join_field, wrap, startswith_field, concat_field, Null, coalesce, set_default
from mo_logs import Log
from jx_sqlite import quote_table, typed_column, UID, quoted_UID, quoted_GUID,sql_types, quoted_PAR... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# 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 restric... |
# -*- coding: utf-8 -*-
#
# Copyright 2007 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... |
# -*- coding: utf-8 -*-
#
# Copyright 2007 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... |
#!/usr/bin/env python
"""Comand line interface of Kerncraft."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
# Version check
import sys
if sys.version_info[0] == 2 and sys.version_info < (2, 7) or \
sys.vers... |
import cgi
import re
import urlparse
from lxml import builder
from lxml import etree
from lxml.html import builder as E
from lxml.html import tostring
from lxml.html.clean import clean_html
from vidscraper.decorators import provide_shortmem, parse_url, returns_unicode
from vidscraper import errors
EMaker = builder.... |
# -*- coding: utf-8 -*-
import json
import os
import re
import textwrap
import urlparse
import psycopg2
import requests
import zulip
class KaomojiBot():
# Recognised command:
command = '@kao'
help = command + ' help'
# Available kaomojis:
kaomojis = {
# Happy
'yay': '\(^▽^)/',
... |
import click
import cli_syncthing_adapter
import os
import json
from time import sleep
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.version_option()
@click.group(
epilog="Run 'kdr COMMAND --help' for more information on a command.",
context_settings=CONTEXT_SETTINGS
#add_help_option... |
import time, urllib
import sys
import numpy as np
from astropy.io import fits as pyfits
from matplotlib import pyplot as plt
import kepio, kepmsg, kepkey, kepstat
def keptrim(infile,outfile,kepid,column,row,imsize,clobber,verbose,logfile,status):
# startup parameters
status = 0
# log the call
hashline = '-... |
import os
from os import path
from subprocess import Popen, PIPE
import logging
from time import time
from contextlib import contextmanager
import argparse
import picklemsg
from checksum import FileItem, repo_file_events
from uilib import ColorfulUi, DummyUi, pretty_bytes
UI_UPDATE_TIME = 0.5 # half a second
log = ... |
#!/usr/bin/env python
'''
Path: magpy.opt.stormdet
Part of package: stormdet
Type: Library of functions for storm detection
PURPOSE:
Script containing all programs needed for storm detection algorithm.
All functions called by seekStorm().
Require PyWav... |
# Copyright 2010 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community 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 ... |
# coding: utf8
from __future__ import unicode_literals
STOP_WORDS = set("""
à às acerca adeus agora ainda algo algumas alguns ali além ambas ambos ano
anos antes ao aos apenas apoio apoia apontar após aquela aquelas aquele aqueles
aqui aquilo área as assim através atrás até aí
baixo bastante bem boa bom breve
cada ... |
"""
URLs for LMS
"""
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import RedirectView
fro... |
# -*- coding: utf-8 -*-
import logging
import os
import subprocess
import urllib
def process_image(image_path, url):
"""
process_image receives facebook URL and add primitive filter to it
"""
filename = None
if '.png' in url:
filename = "input.png"
elif '.jpg' in url:
filename ... |
# Copyright 2009 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community 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 ... |
# -*- coding: utf-8 -*-
'''
====================
spam-lists library
====================
spam-lists provides common interfaces for querying whitelists and
blacklists containing web addresses: hostnames, IP addresses or urls.
It supports the following third party services:
* `Spamhaus ZEN https://www.spamhaus.org... |
# *****************************************************************************
# Copyright (c) 2014, 2016 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distrib... |
"""
Mail merge using CSV database and jinja2 template email.
Command line interface implementation.
Andrew DeOrio <awdeorio@umich.edu>
"""
import os
import io
import sys
import csv
import socket
import configparser
import smtplib
import jinja2
import click
from .message_template import MessageTemplate
from .sendmail_... |
#!/usr/bin/python
# This file is part of python-registry.
#
# python-registry 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 3 of the License, or
# (at your option) any later ve... |
import datetime
from django import forms
from django.contrib.admin import widgets
from django.core import validators
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from main.models import SiteConfig, UserProfile, Module, StatusSiteDomain
class ProfileForm(forms.Mod... |
from threading import Lock, Event
from weakref import WeakValueDictionary
class TransferEventManager(object):
def __init__(self):
self.events = WeakValueDictionary(dict())
self.events_lock = Lock()
def acquire_event(self, path, force_clear=False):
with self.events_lock:
i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import component
from IO import O, ImageData
import os
class Reader(component.Component):
attr_description = component.Component.attr_description + "pathes:list(string):lists of file or folder pathes,\
length:int:images count,key_points:list:osef,mean_color... |
#!/usr/bin/env python
import os
import re
import sys
import ftplib
import shutil
def firstLines(filename, n):
fd = file(filename)
lines = []
while n:
n -= 1
lines.append(fd.readline().rstrip('\r\n'))
return lines
def firstLine(filename):
return firstLines(filename, 1)[0]
def erro... |
"""
Generates appropriate replacements (masses, BC conditions, and abundances for MESA
inlist files. Outputs lists of replacements that are inputs to make_replacements.py
Args:
runname: the name of the grid
Z: the mass fraction in metals
startype: the mass range of the models
Returns:
the list of rep... |
if __name__ == "__main__":
__version__ = "0.11.0"
else:
from . import animatedsprite
from . import tilemap
from . import layers
from . import camera
|
# -*- coding: utf-8 -*-
"""
Base module for loading and running the main SasView application.
"""
################################################################################
# This software was developed by the University of Tennessee as part of the
# Distributed Data Analysis of Neutron Scattering Experiments (DA... |
"""
Base module for loading and running the main SasView application.
"""
################################################################################
#This software was developed by the University of Tennessee as part of the
#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
#project funded by th... |
import sys
import numpy as np
from scipy.io import savemat
from my_settings import (source_folder, conditions)
subject = sys.argv[1]
for condition in conditions:
data = np.load(source_folder + "ave_ts/%s_%s_ts_DKT_snr-3-epo.npy" %
(subject, condition))
savemat(source_folder +
"... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import binascii
import os
import json
from datetime import timedelta, datetime
from sc2reader.log_utils import loggable
from sc2reader.exceptions import MPQError
from sc2reader.constants import COLOR_CODES, COLO... |
from cassandra.cqlengine import columns
from cassandra.cqlengine import connection
from cassandra.cqlengine.models import Model
from cassandra.cqlengine.management import sync_table, drop_table
from cassandra.cqlengine.management import create_keyspace_simple
class BaseModel(Model):
__abstract__ = True
@class... |
# coding=utf-8
"""
Generate all possible scales with no more than 2 semitones in sequence.
We want to generate some scales.
The scales must cover a single octave, and they must satisfy the requirements:
- No sequence of three notes can be semitones apart. (Two notes is fine,)
This is equivalent to the following:
- ... |
# Copyright (C) 2009 Duncan Hawthorne, Oliver Stevens
#
# This file is part of Trufflepig.
#
# Trufflepig 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 ... |
#!/usr/bin/env python2.7
# Copyright 2014 Virantha Ekanayake 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 ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Grégoire Détrez
#
# 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 License, or
# (at your option) any later version.
#
... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for snapshot model."""
from ggrc.app import app
from ggrc.models import all_models
from ggrc.snapshotter.rules import Types
from integration.ggrc import TestCase
from integration.ggrc.models import... |
#!/usr/bin/env python
"""tzwhere.py - time zone computation from latitude/longitude.
Ordinarily this is loaded as a module and instances of the tzwhere
class are instantiated and queried directly, but the module can be run
as a script too (this requires the docopt package to be installed).
Run it with the -h option t... |
# One Convergence, Inc. CONFIDENTIAL
# Copyright (c) 2012-2015, One Convergence, Inc., USA
# All Rights Reserved.
#
# All information contained herein is, and remains the property of
# One Convergence, Inc. and its suppliers, if any. The intellectual and
# technical concepts contained herein are proprietary to One Conv... |
import re
import time
import xml.etree.ElementTree as et
def wait(delay):
def decorator(method):
def clocked(self, *args, **kwargs):
if self.clock:
elapsed = time.time() - self.clock
if elapsed < delay:
time.sleep(delay - elapsed)
... |
from __future__ import division
__all__ = ["PoissonZeroInflated"]
import numpy as np
import statsmodels.base.model as base
import statsmodels.base.wrapper as wrap
import statsmodels.regression.linear_model as lm
from statsmodels.discrete.discrete_model import (DiscreteModel, CountModel,
... |
import os
import base64
import indigo
indigo = indigo.Indigo("/var/www/gga/ketcher/lib")
from django.conf.urls.defaults import patterns, url
from django.http import Http404, HttpResponse
def handle_knock(request):
return HttpResponse(content="You are welcome!", mimetype='text/plain')
def handle_layout(request):... |
# -*- coding: utf-8 -*-
__version__ = "v0.0.3 - 2015-07-06T14:31:47.419000"
# Third-party libs from PyPI
import unicodedata # for slugifying
import win32com.client # part of pypiwin32
import pywintypes # Part of pypiwin32
import pytz # timezones info - for converting local time to UTC
import e... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2020 Daniel Schick
#
# 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 with... |
#!/usr/bin/python2.7
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
def printBits(facilityCode,cardCode):
print "FC = "
print facilityCode
print ", CC = "
print "\n", cardCode
def INT0(channel):
global bitCount
bitCount += 1
global flagDone
flagDone = 0
global weigan... |
import copy
import datetime
import json
import dateutil.parser
import pytest
# TODO switch to upload_file_form in all uid(-match)/label/reaper upload tests
# after #772 (coverage-low-hanging 3) gets merged to avoid conflict hell
@pytest.fixture(scope='function')
def upload_file_form(file_form, merge_dict, randstr):
... |
import requests
import urllib2
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
try:
from django.utils import simplejson as json
except ImportError:
raise ImportError('A json library is required to use ' + \
... |
"""Tensorflow Estimator using TF Hub universal sentence encoder."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tensorflow_hub as hub
from tf_trainer.common import base_model
from typing import List
FLAGS = tf.app.flags.F... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines class Rietveld to easily access a rietveld instance.
Security implications:
The following hypothesis are made:
- Rietveld enforces:
- Nobod... |
#!/usr/bin/env python
import sys
import json
# python json_csv.py instances.json Reservations.Instances.PublicDnsName,Reservations.Instances.PrivateDnsName
# {'Reservations': {'Instances': {'PrivateDnsName': {}, 'PublicDnsName': {}}}}
def parse_filter_opts(filter_ops):
pieces = filter_opts.split(',')
tree =... |
__version__ = "0.1.16.deva"
__changelog__ ="""
0.1.16dev update bids layout import
0.1.15dev cleanupt mkdir log
0.1.14dev added gstat RUNNING to check logfiles
0.1.13dev added gstat to check logfiles
0.1.12dev fix version arg issue
0.1.11dev added wait for nfs
0.1.10dev fixed docker_opt bug
0.1.9.dev added --docker_op... |
"""
config.py -- contains all constants needed by scrabble module
"""
import json
import os
BOARD_NUM_COLUMNS = 15
BOARD_NUM_ROWS = 15
PLAYER_RACK_SIZE = 7
BINGO_SCORE = 50
DICTIONARY_FILENAME = 'dictionary.json'
RESOURCE_PACKAGE = 'scrabble'
START_SQUARE_CHARACTER = '★'
BLANK_SQUARE_CHARACTER = '_'
LOWEST_COLUMN_CHA... |
import argparse
import copy
import json
import logging
import math
import random
import string
from abc import ABC, abstractmethod
from enum import Enum
from functools import reduce
from itertools import product
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, Dict, Iterable, Lis... |
# Copyright 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 agreed to in... |
"""
RenderWidget
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkRenderer
from vtk import vtkVolume
from vtk import vtkInteractorStyleTrackballCamera
from vtk import vtkOpenGLGPUVolumeRayCastMapper
from vtk import vtkVersion
from vtk import vtkOrientationMarkerWidget
from vtk import vtkAxesActor
from vtk impo... |
#!/usr/bin/env python
# coding: utf-8
"""
Parses the output of the system ping command.
Code originally taken from https://github.com/gg/pingparser
"""
__version__ = '0.3'
from optparse import OptionGroup,OptionParser
import re
import sys
def _get_match_groups(ping_output, regex):
match = regex.search(ping_out... |
"""
Models:
- Problem: 题目。
- TestData: 测试数据。
"""
from django.db import models
from django.utils import timezone
from ckeditor_uploader.fields import RichTextUploadingField
from main.utils.compare_utils import validate_compare_file, get_compare_func
class Problem(models.Model):
"""题目"""
class Met... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<https://micronaet.com>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebr... |
import os
import bson
import numpy as np
import operator
import util.database_helpers as dh
import util.associate
import util.transform as tf
import util.dict_utils as du
import core.image_source
import core.sequence_type
import core.benchmark
import metadata.camera_intrinsics as cam_intr
import metadata.image_metadata... |
#!/usr/bin/python
#
# Copyright 2008 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 ag... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2014-2020 BigML
#
# 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 requi... |
import os
import requests
from bs4 import BeautifulSoup
#Constants---------------------
BASE_URL = "https://registroapps.uniandes.edu.co/"
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36"
EXTRA_SCHEDULE = 26
MARKER = 'marked'
MARKE... |
#!/usr/bin/env python3
# coding=UTF-8
#
# Copyright (c) 2015 ChangZhuo Chen (陳昌倬) <czchen@gmail.com>
#
# 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 l... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... |
#!/usr/bin/python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this scrip... |
#!/usr/bin/env python
# Copyright (c) 2014 Eugene Zhuk.
# Use of this source code is governed by the MIT license that can be found
# in the LICENSE file.
"""Checks AWS usage.
This script retrieves and displays an estimated total statement amount for
the specified billing period.
Usage:
./check_usage.py [options]... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Compatibility functionality for Windbg users.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import math
import sys
from builtins imp... |
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt. Contact: ctb@msu.edu
#
import os
import argparse
import khmer
DEFAULT_K = 32
DEFAULT_N_HT = 4
DEFAULT_MIN_HASHSIZE = 1... |
# stdlib, alphabetical
import ast
import datetime
import errno
import json
import logging
from lxml import etree
import math
import os
import shutil
import stat
import subprocess
import tempfile
# Core Django, alphabetical
from django.conf import settings
from django.core import validators
from django.core.exceptions ... |
import unittest
import utils
class ListNode:
def __init__(self, val):
self.val = val
self.next = None
class MyLinkedList:
def __init__(self):
self.head = None
def get(self, index: int) -> int:
if not self.head:
return -1
curr = self.head
fo... |
# -*- coding: utf-8 -*-
"""
SPECTRA: A simple one dimensional spectra reduction and analysis package
Created with the Apache Point Observatory (APO) 3.5-m telescope's
Dual Imaging Spectrograph (DIS) in mind. YMMV
e.g. DIS specifics:
- have BLUE/RED channels
- hand-code in that the RED channel wavelength is backwards
... |
# -*- coding: utf-8 -*-
from cms.exceptions import DuplicatePlaceholderWarning
from cms.models.placeholdermodel import Placeholder
from cms.tests.base import CMSTestCase
from cms.utils.placeholder import PlaceholderNoAction, MLNGPlaceholderActions
from cms.utils.plugins import get_placeholders
from django.conf import s... |
"""This module contains data structures that are robocup specific, ie. Robot, Ball,
WorldState"""
from enum import Enum
from typing import List
import numpy as np
import warnings
RobotId = int
class Robot:
"""State of a robot. Pose: [x, y, theta]. Twist: [dx, dy, dtheta]. Properties are
to enforce that ins... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import tensorflow as tf
import numpy as np
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string(
"train_dir", "logo_images/cropped",
"Directory where to write event logs and checkpoint.")
def train():
pass
def main():... |
# 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... |
# http://www.openstreetmap.org/way/219071307
assert_has_feature(
16, 10478, 25338, 'roads',
{ 'id': 219071307, 'kind': 'minor_road', 'service': 'drive_through' })
# http://www.openstreetmap.org/way/258020271
assert_has_feature(
16, 11077, 25458, 'roads',
{ 'id': 258020271, 'kind': 'aerialway', 'kind_de... |
from pkg_resources import resource_string
import json
import tornado
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.websocket
class RootHandler(tornado.web.RequestHandler):
def get(self):
self.write(resource_string(__name__, "index.html"))
class WebSocketHandler(tornado.... |
# stdlib
import json
import ssl
# requests
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
# keen
from keen import exceptions, utilities
from keen.utilities import KeenKeys, requires_key
# json
from requests.compat import json
__author__ = 'dk... |
#!/usr/bin/python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this scrip... |
#!/usr/bin/env python
# Copyright (c) 2014 Eugene Zhuk.
# Use of this source code is governed by the MIT license that can be found
# in the LICENSE file.
"""Checks AWS usage.
This script retrieves and displays an estimated total statement amount for
the specified billing period.
Usage:
./check_usage.py [options]... |
"""
Find intermediate evalutation results in assert statements through builtin AST.
This should replace _assertionold.py eventually.
"""
import sys
import ast
import py
from py._code.assertion import _format_explanation, BuiltinAssertionError
if sys.platform.startswith("java") and sys.version_info < (2, 5, 2):
... |
# -*- coding: utf-8 -*-
"""
runner.py
Copyright 2017 CodeRatchet
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
"""
import loggi... |
import sys
import logging
import matplotlib.pyplot as plt
import numpy as np
import faulthandler
faulthandler.enable()
plt.ion()
handler = logging.StreamHandler(sys.stderr)
fmt = logging.Formatter("%(asctime)-15s [%(name)5s:%(levelname)s] %(message)s")
handler.setFormatter(fmt)
handler.setLevel(logging.INFO)
logging... |
# Copyright 2015 Canonical, Ltd.
#
# 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
# License, or (at your option) any later version.
#
# This program is distribute... |
'''
Created on Dec 14, 2016
@author: lubo
'''
import numpy as np
from views.base import ViewerBase
import webbrowser
class SamplesViewer(ViewerBase):
def __init__(self, model):
super(SamplesViewer, self).__init__(model)
self.start_pos = None
self.end_pos = None
def calc_chrom_lines(... |
"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import shutil
import logging
import datetime
import argparse
import hashlib
join = os.path.join
from flask import Flask, make_response, request, abort, jsonify
from flask.ext.httpauth import HTTPBasicAuth
from flask.ext.restful import Resource, Api
f... |
import os
import sys
import re
from collections import OrderedDict
import json
import glob
import markdown
import uuid
import hashlib
def process(input_filename, source_path):
output_path = os.path.abspath(os.path.dirname(input_filename))
story = Story()
story.set_id(os.path.abspath(input_filename))
... |
import pygame
class KeyHandler():
def __init__(self):
self._special_keys = []
#self.message_event = message_event
self.text = ""
self.shift = False
self.cursor_pos = 0
self.actual_event = None
#using to handle continuos pressing
"""self.start_tic... |
# vim: set fileencoding=utf-8 :
from __future__ import division, print_function, unicode_literals
from subprocess import Popen, PIPE
from collections import namedtuple
from . import matchers
from .functionlist import FunctionList
import sys
import os
import subprocess
import json
import time
import signal
Script = na... |
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from pyL... |
'''
Scroll View
===========
.. versionadded:: 1.0.4
The :class:`ScrollView` widget provides a scrollable/pannable viewport that is
clipped at the scrollview's bounding box.
Scrolling Behavior
------------------
The ScrollView accepts only one child and applies a viewport/window to it
according to the :data:`scroll... |
from django.core.management.base import BaseCommand
from django.utils import timezone
from event.models import Event, Participation, Frame, Comment, Question, Answer
from group.models import Group, Membership
from user.models import User
from tag.models import Tag
username_sample=[
"koshiba_takahiro"
,"yusuke0803"
,"_... |
#!/usr/bin/python
# coding: utf-8
'''
Latexmk.py completely automates the process of generating
a LaTeX document. Given the source files for a document,
latexmk.py issues the appropriate sequence of commands to
generate a .dvi or .pdf version of the document. It can
also be set to run continuously with a ... |
import numpy as nm
import sfepy.linalg as la
from sfepy.discrete.integrals import Integral
def prepare_remap(indices, n_full):
"""
Prepare vector for remapping range `[0, n_full]` to its subset given
by `indices`.
"""
remap = nm.empty((n_full,), dtype=nm.int32)
remap.fill(-1)
remap[indices... |
#!/usr/bin/python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this scrip... |
import json
import math
import logging
import collections
from tornado import ioloop, httpclient
from tornado.httputil import url_concat
from .resources import *
logger = logging.getLogger(__name__)
class BillomapyResponseError(Exception):
def __init__(self, code, message):
self.code = code
se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.