src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging as loggers
import numpy as np
import theano
import theano.tensor as T
from theano.ifelse import ifelse
from ..utils import FLOATX, dim_to_var, EPSILON
from .util import wrap_core, multiple_l2_norm
from ..conf import TrainerConfig
logging = loggers.getLog... |
# Copyright 2014 Mirantis, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import re
import sqlalchemy as sa
from sqlalchemy.ext.hybrid import Comparator, hybrid_property
from sqlalchemy.ext.declarative import declared_attr
from hyputils.memex._compat import string_types
from hyputils.memex.db import Base
from ... |
#!/usr/bin/env python
# ============================================================================
# Project Name : iTrade
# Module Name : itrade_liveupdate_euronext.py
#
# Description: Live update quotes from euronext.com : EURONEXT, ALTERNEXT,
# MARCHE LIBRE (PARIS & BRUXELLES)
#
# The Original Code is iTr... |
r"""
Authors: Chase Coleman, Spencer Lyon, Daisuke Oyama, Tom Sargent,
John Stachurski
Filename: core.py
This file contains some useful objects for handling a finite-state
discrete-time Markov chain.
Definitions and Some Basic Facts about Markov Chains
----------------------------------------------------
L... |
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
from pyclaw import data
#------------------------------
def setrun(claw_pkg='geoclaw'):
#------------------------------
"""
... |
import os.path
from sp_glob import ICONS_PATH
# Frames
APP_ICON = os.path.join(ICONS_PATH, "app.ico")
APP_CHECK_ICON = os.path.join(ICONS_PATH, "appcheck.ico")
APP_EXPORT_PDF_ICON = os.path.join(ICONS_PATH, "appexport-pdf.ico")
# For the toolbar of the main frame
EXIT_ICON = os.path.join(IC... |
#
# Albow - Menu bar
#
from pygame import Rect
from widget import Widget, overridable_property
class MenuBar(Widget):
menus = overridable_property('menus', "List of Menu instances")
def __init__(self, menus=None, width=0, **kwds):
font = self.predict_font(kwds)
height = font.get_linesize... |
#!/usr/bin/env python
#
# Copyright 2015 Paul Donohue <python_proc_events@PaulSD.com>
#
# 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 3 of the
# License, or (at your option) any ... |
import logging
from uamqp import errors as AMQPErrors, constants as AMQPConstants
from azure.servicebus.exceptions import (
_create_servicebus_exception,
ServiceBusConnectionError,
ServiceBusError
)
def test_link_idle_timeout():
logger = logging.getLogger("testlogger")
amqp_error = AMQPErrors.Lin... |
#------------------------------------------------------------------------------
# interpreter/interpreter.py
# Copyright 2011 Joseph Schilz
# Licensed under Apache v2
#------------------------------------------------------------------------------
articles = [" a ", " the "]
def verb(command):
# A function ... |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
import logging
from AnyQt.QtWidgets import QTreeView
from AnyQt.QtCore import QSettings
from ...gui import test
from ..settings import UserSettingsDialog, UserSettingsModel
from ...utils.settings import Settings, config_slot
class TestUserSettings(test.QAppTestCase):
def setUp(self):
logging.basicConfig... |
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... |
#!/usr/bin/env python
"""
pytest plugin script.
This script is an extension to py.test which
installs SQLAlchemy's testing plugin into the local environment.
"""
import sys
import os
from lib.sqlalchemy_bulk_lazy_loader import BulkLazyLoader
from sqlalchemy.testing import plugin
BulkLazyLoader.register_loader()
#... |
# You may need to use setuptools.distutils depending on Python distribution.
import distutils
import glob
import os
import pkgutil
import sys
def get_python_library():
# Get list of the loaded source modules on sys.path.
modules = {
module
for _, module, package in list(pkgutil.iter_modules())
if... |
# -*- coding: utf-8 -*-
from formalchemy.tests import *
def test_renderer_names():
"""
Check that the input name take care of multiple primary keys::
>>> fs = FieldSet(primary1)
>>> print fs.field.render()
<input id="PrimaryKeys-1_22-field" maxlength="10" name="PrimaryKeys-1_22-field" ... |
import calendar
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import gettext, ngettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ngettext_lazy('%d year', '%d years')),
(60 * 60 * 24 * 30, ngettext_lazy('%d month'... |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
response.logo = A(
B('Mídia Capoeira'),
XML('™ '),
_class="brand",
_href=domainname
)
response.title = 'Mídia Capoeira'
response.subtitle = 'garimpando no lado de baixo do tapete'
response.meta.autho... |
# coding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... |
#coding:utf-8
import _compat_pickle
import hashlib
class UrlManager(object):
def __init__(self):
#self.new_urls = set()
#self.old_urls = set()
self.new_urls = self.load_progress('new_urls.txt')#未爬取的url集合
self.old_urls = self.load_progress('old_urls.txt')#已爬取的URL集合
def ... |
from typing import Dict, List, Tuple, Set, Optional
from abc import abstractmethod
import numpy
class Location:
name: str = ""
long_name: str = ""
border_x: List[numpy.ndarray]
border_hull_x: List[numpy.ndarray]
border_y: List[numpy.ndarray] = []
border_hull_y: List[numpy.ndarray] = []
... |
# -*- coding: utf-8 -*-
"""
================================================
Source localization with a custom inverse solver
================================================
The objective of this example is to show how to plug a custom inverse solver
in MNE in order to facilate empirical comparison with the methods M... |
from chainer.functions.evaluation import accuracy
from chainer.functions.loss import softmax_cross_entropy
from chainer import link
from chainer import reporter
class Classifier(link.Chain):
"""A simple classifier model.
This is an example of chain that wraps another chain. It computes the
loss and accu... |
# Copyright 2017 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... |
from nose.tools import ok_, eq_, raises
from flask import Flask, request
from flask.views import MethodView
from flask.ext.admin import base
class MockView(base.BaseView):
# Various properties
allow_call = True
allow_access = True
@base.expose('/')
def index(self):
return 'Success!'
... |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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 applicabl... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Generated by Django 2.1.2 on 2018-12-11 19:08
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("survey", "0008_translated_name_for_models")]
operations = [
migrations.AlterField(
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'sup... |
'''
Utilities for contentstore tests
'''
import json
import textwrap
import six
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import Client
from mock import Mock
from opaque_keys.edx.keys import AssetKey, CourseKey
from contentstore.utils import reverse_url
fro... |
# Setup
import numpy as np
import json
import sys
import matplotlib
matplotlib.use('GTK')
import matplotlib.pyplot as plt
from pylab import axis
def main(jsonfile):
with open(jsonfile) as data_file1:
data1 = json.load(data_file1)
pms = data1['pointmatches']
pointmatches = []
for i in range(0,... |
from collections import defaultdict
import numpy as np
from scipy.special import psi
from scipy.stats import pearsonr, chisquare, f_oneway, kruskal
from scipy.spatial.distance import dice, sokalsneath, yule, rogerstanimoto, sokalmichener
from sklearn.decomposition import FastICA
from boomlet.metrics import categorica... |
"""
Startup script for the pyTanks server
Requirements:
Python 3.5 or newer
websockets 7.0 (pip install websockets==7.0)
Usage:
python start.py
The pyTanks server uses the settings found in config.py to control how the server works. Those values can be
changed directly or be overridden by appendi... |
# Portions Copyrights (C) 2015 Intel Corporation
''' Calculate solar photovoltaic system output using our special financial model. '''
import json
import os
import sys
import shutil
import math
import datetime as dt
import __metaModel__
import logging
import traceback
from numpy import npv, pmt, ppmt, ipmt, irr
from j... |
# Generated by Django 2.0.13 on 2019-04-25 17:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("site_message", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="TargetSite",
fields=[
... |
# -*- coding: utf-8 -*-
"""
This module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.
The SOCKS implementation supports t... |
# Copyright 2015 OpenStack Foundation
# 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 requ... |
#!/usr/bin/env python
# make tarball!
VERSION = '0.3'
PACKAGENAME = 'libgmail-docs_'
import os
print "\nCreate API docs"
os.system('epydoc -o API ../libgmail.py')
def cleanup(*args):
"""Used by os.path.walk to traverse the tree and remove CVS dirs"""
if os.path.split(args[1])[1] == "CVS":
print "Remo... |
#----------------------------------------------------------------------
# This file was generated by D:\personal\src\airs\gui\images\make_images.py
#
from wx import ImageFromStream, BitmapFromImage, EmptyIcon
import cStringIO, zlib
def getData():
return zlib.decompress(
'x\xda\x01\xbe\x06A\xf9\x89PNG\r\n... |
#!/usr/bin/env python
# Copyright (c) 2011 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.
import time
import pyauto_functional
import pyauto
class NetflixTestHelper():
"""Helper functions for Netflix tests.
F... |
#
# Copyright 2015-present Boling Consulting Solutions, bcsw.net
#
# 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 requir... |
#******************************************************************************
# (C) 2018, Stefan Korner, Austria *
# *
# The Space Python Library is free software; you can redistribute it and/or *
... |
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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... |
#!/usr/bin/python
from __future__ import print_function
from builtins import zip
from builtins import range
import sys
import math
import os
import forgi.graph.bulge_graph as cgb
import forgi.utilities.debug as cud
import forgi.utilities.stuff as cus
from optparse import OptionParser
def print_rosetta_constraints(b... |
#!BPY
"""
Name: 'GAMX OBJ/IPO Bind Check & Auto-Fix'
Blender: 247
Group: 'Animation'
Tooltip: 'Checks OBJ/IPO binds for correct frame 1 transform and provides capabilities to fix broken OBJ/IPOs before export to GAMX asset manifest file (.gamx)'
"""
__author__ = "Johanna Wolf"
__url__ = ("http://gewizes.sourceforge.ne... |
__author__ = 'mdavid'
# Setup our test environment
import os
os.environ['NETKI_ENV'] = 'test'
from unittest import TestCase
from mock import patch
from StringIO import StringIO
from netki.common.config import ConfigManager
class ConfigManagerTestCase(TestCase):
def tearDown(self):
super(ConfigManagerTe... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2016 Roberto Alsina and others.
# 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/python
# Written by Stjepan Horvat
# ( zvanstefan@gmail.com )
# by the exercises from David Lucal Burge - Perfect Pitch Ear Traning Supercourse
# Thanks to Wojciech M. Zabolotny ( wzab@ise.pw.edu.pl ) for snd-virmidi example
# ( wzab@ise.pw.edu.pl )
import random
import time
import sys
import re
fname="/de... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
from argparse import ArgumentParser
import os
import sys
import django
from django.conf import settings
from coverage import Coverage
from termcolor import colored
TESTS_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
TESTS_THRESHOLD = 100
def main():
parser = ArgumentParser(description='Run... |
import numpy as np
import pytest
from pandas import DataFrame, Index, IndexSlice, MultiIndex, Series, concat, date_range
import pandas._testing as tm
import pandas.core.common as com
@pytest.fixture
def four_level_index_dataframe():
arr = np.array(
[
[-0.5109, -2.3358, -0.4645, 0.05076, 0.364... |
#!/usr/bin/python
#
# Copyright (c) SAS Institute 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 python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
"""
Description: Move Joint
"""
import os
import sys
import time
import math
sys.path.append(os.path.join(os.path.dirname(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import argparse
import glob
import os
import numpy as np
import pandas as pd
from geopy.distance import vincenty as point_distance
def ingest(fn, route_id, begin_latlng, end_latlng):
df = pd.read_csv(fn, parse_dates=[... |
from __future__ import absolute_import
from datetime import datetime
from flexmock import flexmock
import pony.tasks
from tests.test_base import BaseTest
class SendReportSummaryTest(BaseTest):
def setUp(self):
super(SendReportSummaryTest, self).setUp()
self.bot.storage.set('report', {})
... |
import glob
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib
import os
os.chdir('/Users/evanbiederstedt/Downloads/RRBS_data_files')
pcells = glob.glob("RRBS_NormalBCD19pCD27pcell*")
newdf1 = pd.DataFrame()
for filename in pcells:
df = pd.read_table(... |
import os.path
import sys
import csv
from progressbar import ProgressBar, Percentage, Bar, ETA
from modoboa.core.models import User
from modoboa.lib import events
from modoboa.lib.exceptions import Conflict
from ... import lib
def import_csv(filename, options):
"""Import objects from a CSV file."""
superadm... |
import logging
from xml.dom import minidom
import time
try:
from xml.etree import ElementTree
except ImportError:
from elementtree import ElementTree
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
try:
from urllib import urlopen
except ImportError:
fro... |
# generated by gen-config.py DO NOT edit
# vim:fileencoding=utf-8
import typing
from kitty.conf.utils import (
merge_dicts, positive_float, positive_int, to_bool, to_cmdline, to_color, to_color_or_none,
unit_float
)
from kitty.options.utils import (
active_tab_title_template, adjust_baseline, adjust_line_h... |
import torch
import torch.optim as optim
import torch.nn as nn
from torchup.agents.DQN import DQNAgent
from torchup.utils.utils import Transition
from torchup.base.models import Variable
class DoubleDQNAgent(DQNAgent):
'''
The DoubleDQNAgent is an implemenation of the Deep Reinforcement Agent
outlined in ... |
#
# We set the medcoeff to 1.0 (if you don't want any normalization)
# We use these medcoeffs for the f77 MCS PSF construction, to get initial values, for instance.
#
execfile("../config.py")
from kirbybase import KirbyBase, KBError
#from calccoeff_fct import *
from variousfct import *
import star
print "We will set ... |
import pytest
from skidl import *
from .setup_teardown import *
def test_index_slicing_1():
mcu = Part("GameteSnapEDA", "STM32F767ZGT6", pin_splitters="/()")
mcu.match_pin_regex = False
assert len(mcu["FMC_D[0:15]"]) == 16
assert len(mcu["FMC_D[15:0]"]) == 16
mcu.match_pin_regex = True
asser... |
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will ... |
'''
Created on 2009-08-24
This module contains the main OpenGL application window that is used by all SNM applications
@author: beaudoin
'''
import wx
import UI
class MainWindow(wx.Frame):
"""The class for the main window."""
MIN_TOOLPANEL_WIDTH = 200
MIN_CONSOLE_HEIGHT = 100
... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import os
from django.test import TestCase
from mock import patch
from ui.views import parse_search_results
FIXTURES_ROOT = os.path.join(os.path.dirname(__file__), 'fixtures')
FX = lambda *relpath: os.path.join(FIXTURES_ROOT, *relpath)
@patch('ui.views.get_repo_type')
@patch('ui.views.CODE_ROOT', '/opt/botanist/re... |
#!/usr/bin/env python
"""Some utility functions for operating on a cluster or MP machine."""
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
# remember to add yourself if you make changes
__credits__ = ["Jens Reeder", "Rob Knight", "Nigel Cook", "Jai Ram Rideout"]
__license__ = "GPL"
__... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Define a class for creating the jailed context."""
import os
import shutil
import stat
from pathlib import Path
from retry.api import retry_call
import framework.utils as utils
import framework.defs as de... |
from urlparse import urljoin
import requests
from flowzillow import constants
from flowzillow.exceptions import ZillowError
def _trim_none_values(dict_):
new_dict = dict(dict_)
del_keys = []
for k, v in new_dict.iteritems():
if not v:
del_keys.append(k)
for key in del_keys:
... |
import pytest
def test_types_analysis_title(
testapp,
analysis_released,
encode4_award,
ENCODE3_award,
encode_lab,
file_bam_1_1,
file_bam_2_1,
analysis_step_run_chip_encode4,
analysis_step_run_dnase_encode4,
pipeline_dnase_encode4,
pipeline_chip_encode4,
):
testapp.pat... |
# Copyright 2014 Google 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 law or agre... |
"""Pseudo terminal utilities. (Slightly modified to work on FreeBSD)"""
# Bugs: No signal handling. Doesn't set slave termios and window size.
# Only tested on Linux.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions ... |
# coding=utf-8
"""
Pinyto cloud - A secure cloud database for your personal data
Copyright (C) 2019 Pina Merkert <pina@pinae.net>
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 3 of t... |
"""
# Default config. Change these in your personal ~/.config/workspace.cfg ::
###########################################################################################################
# Define product groups to take action upon (such as wst checkout, develop, or bump)
#########################################... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table('forums_category', (
('id', self.gf('django.db.model... |
# TheGamesDb API, Python Wrapper - http://wiki.thegamesdb.net/index.php/Main_Page
# Copyright (C) 2015 Rogerio Hilbert Lima <rogerhil@gmail.com>
# 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, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
"""
transform wav files to tfrecords.
usage : python wavtotfrecords.py dirname tfrecordsFileName
egg : python wavtotfrecords.py train-dir train.tfrecords
"""
import os
import sys
import tensorflow as tf
import numpy as np
from features.utils.load_audio_to_mem import g... |
import tox
import py
import pytest
from tox._pytestplugin import ReportExpectMock
try:
import json
except ImportError:
import simplejson as json
pytest_plugins = "pytester"
from tox._cmdline import Session
from tox._config import parseconfig
def test_report_protocol(newconfig):
config = newconfig([], """... |
# Copyright (c) 2009 Participatory Culture Foundation
# See LICENSE for details.
from django.http import HttpResponse
from channelguide.testframework import TestCase
class NotificationViewTestCase(TestCase):
def test_add_notification(self):
"""
Test that notifications are added when request.add_... |
# -*- coding: utf-8 -*-
import vim
from orgmode._vim import echo, echom, echoe, ORGMODE, apply_count, repeat, insert_at_cursor, indent_orgmode
from orgmode.menu import Submenu, Separator, ActionEntry, add_cmd_mapping_menu
from orgmode.keybinding import Keybinding, Plug, Command
from orgmode.liborgmode.checkboxes impor... |
# -*- coding: utf-8 -*-
import logging
from neuron.models import DataSet
import dateutil.parser as DP
loggermsg = logging.getLogger('django')
def saveClosedPossition(jsondata):
#loggermsg.info(len(jsondata))
# Проверяем есть ли такой ордер в БД
ifExistOrdernum = DataSet.objects.filter(open_magicnum=j... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# transvoyage.py
# Version 0.3
#
# Copyright 2014 Guénaël Muller <contact@inkey-art.net>
#
# 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; eit... |
#!/usr/bin/env python
# plot interval CSV output from perf/toplev
# perf stat -I1000 -x, -o file ...
# toplev -I1000 -x, -o file ...
# interval-plot.py file (or stdin)
# delimeter must be ,
# this is for data that is not normalized
# TODO: move legend somewhere else where it doesn't overlap?
from __future__ import prin... |
#####################################################################
# s12f17.py
#
# (c) Copyright 2021, Benjamin Parzella. All rights reserved.
#
# 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 Fou... |
from unittest import mock
from django.test import TestCase
from waldur_core.structure import models as structure_models
from waldur_core.structure.tests import factories, fixtures
class LogProjectSaveTest(TestCase):
@mock.patch('waldur_core.structure.handlers.event_logger')
def test_logger_called_once_on_pr... |
from app.deck import Deck
class Hand(Deck):
"""In real play we would also need to know the total number of players so that we could deal the cards out in the correct order. However, here we are only interested in our hand (we never fully know our
opponent's hand); which will later be compared to an opening ra... |
# The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# 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 wi... |
BANG_DICT = {
"!allegro": "Allegro",
"!cakebook": "CakePHP Cookbook",
"!animeka": "Animeka",
"!webcams": "webcams.travel",
"!ipernity": "Ipernity",
"!trademe": "TradeMe",
"!anidb": "aniDB",
"!nuget": "nuget gallery",
"!pgp": "MIT PGP Public Key Server Lookup",
"!endthelie": "End ... |
from datetime import datetime
from app import app
from app.authentication import with_login
from app.tasks import import_aws_client_bills, import_aws_elb_infos, process_aws_key
from flask import Blueprint, jsonify
from app.request_schema import with_request_schema
from app.models import db, AWSKey, AWSKeyS3Bucket
from ... |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## Customize your APP title, subtitle and menus here
#########################################################################
response.logo... |
import os
import time
import numpy as np
import argparse
import functools
from PIL import Image
import paddle.fluid as fluid
import reader
from pyramidbox import PyramidBox
from visualize import draw_bboxes
from utility import add_arguments, print_arguments
parser = argparse.ArgumentParser(description=__doc__)
add_arg... |
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from dialogBase import GdalToolsBaseDialog as BaseDialog
import GdalTools_utils as Utils
class GdalToolsBasePluginWidget:
def __init__(self, iface, commandName, helpFileBaseName = None, paren... |
#!/usr/bin/env python
'''
@author: Graham Rockwell
@organization: Church Lab Harvard Genetics
@version: 03/04/2013
--Rename to metabolic-model parser
'''
import string, sets, re
from util.Report import Report
class TagedElement(dict):
def __init__(self):
self.annotation = {}
def __str__... |
import json
from django.shortcuts import render
from django.conf import settings
from django.http import JsonResponse
from django.db import models
from django.core import exceptions
from django.db.utils import IntegrityError
from django.contrib.auth.decorators import login_required
from keops.api.services import ViewS... |
import re
import struct
import socket
import traceback
import time
import sys
import os
if not globals().get('skip_imports'):
import ssnet
import helpers
import hostwatch
import compat.ssubprocess as ssubprocess
from ssnet import Handler, Proxy, Mux, MuxWrapper
from helpers import log, debug1, d... |
urls = [
"pagecounts-20121001-000000.gz",
"pagecounts-20121001-010000.gz",
"pagecounts-20121001-020000.gz",
"pagecounts-20121001-030000.gz",
"pagecounts-20121001-040000.gz",
"pagecounts-20121001-050000.gz",
"pagecounts-20121001-060001.gz",
"pagecounts-20121001-070000.gz",
"pagecounts-20121001-080000.gz",
"pagecounts-20... |
#
#********************************************************************
#* Copyright (C) 2004 LSI Logic Corporation. *
#* All Rights Reserved. *
#********************************************************************
#
# Sample Test program to try O... |
#!/usr/bin/env python3
#
# Unit tests for the notification control
# Copyright (C) Stefan Metzmacher 2016
#
# 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 3 of the License, or
# ... |
import sys
import time
import random
#this sucks.. cannot find dis since "root" path is blah/test
#we might need to create a variable we pass via the brython function
# to state what the root path is.
# For now, we'll hardcode a relative path. :(
sys.path.append("../Lib")
import dis
_rand=random.random()
editor=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.