content stringlengths 4 20k |
|---|
import cgi
import random
import urllib
import flask
# [START taskq-imp]
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
# [END taskq-imp]
class Note(ndb.Model):
"""Models an individual Note entry with content."""
content = ndb.StringProperty()
def parent_key(page_name):
... |
"""This pip smoke test verifies dependency files exist in the pip package.
This script runs bazel queries to see what python files are required by the
tests and ensures they are in the pip package superset.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_functio... |
import itertools
import math
import numpy
class ParameterMeshIterator(object):
def __init__(self, names, parameter_sets):
self.names = names
self.parameter_sets = itertools.product(*parameter_sets)
def __iter__(self):
return self
def next(self):
next_parameter_sets = ... |
# ihmAppTests.py
# sutbs
class Q:
def __init__(self):
self.q=[]
def push(self,e):
self.q.append(e)
class Thing:
def __init__(self,n,t=True):
self.name=n
self.yes = t
def pollFunc(self):
return (self.name, self.yes)
# end stubs
class PollMgr:
cl... |
from xlgui.preferences import widgets
from xl import xdg
from xl.nls import gettext as _
# TODO: If we ever add another engine, need to make sure that
# gstreamer-specific stuff doesn't accidentally get loaded
from xl.player.gst.sink import get_devices, SINK_PRESETS
name = _('Playback')
icon = 'media-playback-s... |
"""
Parses an XML feed into a Python representation. You should probably use L{iface_cache.iface_cache} rather than the functions here.
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _, logger
import os
import errno
from zeroinstall i... |
import wx
import matplotlib
# We want matplotlib to use a wxPython backend
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from traits.api import Any, Instance
f... |
"""This pip smoke test verifies dependency files exist in the pip package.
This script runs bazel queries to see what python files are required by the
tests and ensures they are in the pip package superset.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_functio... |
from django.db.models.aggregates import StdDev
from django.db.utils import ProgrammingError
from django.utils.functional import cached_property
class BaseDatabaseFeatures(object):
gis_enabled = False
allows_group_by_pk = False
allows_group_by_selected_pks = False
empty_fetchmany_value = []
update_... |
'''
@version: 0.8.1
@author: Adam Atlas
@copyright: Copyright 2006-2007 Adam Atlas. Released under the MIT license (see LICENSE.txt).
@contact: <EMAIL>
@group Parsing: Parser,Tokens
@group Utilities: AHT,DebuggingParser
'''
from Parser import *
from Tokens import *
from AHT import *
from DebuggingParser import *
from... |
from django.db import models
from django.core.exceptions import ValidationError
import cyder
from cyder.cydns.validation import validate_label, validate_name
from cyder.cydns.cname.models import CNAME
from cyder.cydns.ip.models import Ip
from cyder.cydns.models import CydnsRecord
import pdb
class AddressRecord(Ip, ... |
"""
This module handles various householder operations which we anticipate plugging into
a stepwise regression functionality
"""
import unittest
import numpy as np
import math
from sys import stdout
import pdb
def householder(x) :
"""
x is a vector
Compute a householder vector that is capable of... |
def adagrad(opfunc, x, config, state=None):
"""ADAGRAD implementation
ARGS:
- `opfunc` : a function that takes a single input (X), the point of
evaluation, and returns f(X) and df/dX
- `x` : the initial point
- `state` : a table describing the state of the optimizer; after each
... |
"""
:mod:`util` --- SCION crypto utilities
===============================
Various utilities for SCION functionality.
"""
# Stdlib
import os
CERT_DIR = 'certs'
KEYS_DIR = 'keys'
def get_online_key_file_path(conf_dir):
"""
Return the online key file path.
"""
return os.path.join(conf_dir, KEYS_DIR, "... |
import pandas as pd
print(pd.__version__)
# 1.2.2
df = pd.read_csv('data/src/sample_date.csv',
index_col='date', parse_dates=True).head(3)
print(df)
# val_1 val_2
# date
# 2017-11-01 65 76
# 2017-11-07 26 66
# 2017-11-18 47 47
print(type(df.i... |
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage
from django.utils.functional import LazyObject
from django.utils.importlib import import_module
from ..conf import settings
__all__ = [ 'default_storage', 'media_storage', 'static_storage', 'private_storage' ... |
# -*- coding:utf-8 -*-
import os,sys
import re
import shutil
from autotest.client import test, utils
from autotest.client.shared import error
# lpt env set
from autotest.client.shared.settings import settings
try:
autodir = os.path.abspath(os.environ['AUTODIR'])
except KeyError:
autodir = settings.get_value('... |
import os
import doctest
try:
import unittest2 as unittest
except:
import unittest
import sys
def ispackage(path):
return os.path.isdir(path) and \
os.path.isfile(os.path.join(path, '__init__.py'))
def getpackage(fname):
if not fname.endswith('.py') and not ispackage(fname):
return N... |
# This file reference all the versions of the depedencies we use in kiwix-build.
main_project_versions = {
'libzim': '7.0.0', # Because of bump of version in libzim. No release made for now.
'libkiwix': '9.4.1',
'kiwix-tools': '3.1.2',
'zim-tools': '2.1.0',
'kiwix-desktop': '2.0.5' # Also change KI... |
from collections import namedtuple
import datetime
import ddt
from freezegun import freeze_time
from mock import patch, PropertyMock
import itertools
from edx_ace.utils.date import serialize
from edx_ace.message import Message
from courseware.models import DynamicUpgradeDeadlineConfiguration
@ddt.ddt
@freeze_time('... |
import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="colorbar", parent_name="choroplethmapbox", **kwargs
):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_... |
import random
import math
import numpy as np
import pygame
from pygame.color import THECOLORS
import pymunk
import pymunk.pygame_util
from pymunk.vec2d import Vec2d
class GameState:
def __init__(self, game):
# Global-ish.
self.game = game
self.crashed = False
# Physics stuff.
... |
from erukar.system.engine import ErukarActor, Rarity
from erukar.ext.math import Curves
import functools
import operator
class Item(ErukarActor):
generic_description = 'This is {BaseName}, but it otherwise has no real description whatsoever'
IsInteractible = True
BaseName = 'base'
InventoryDescription... |
import datetime
import random
import getpass
from uuid import uuid4
from flask import current_app
from flask.ext.security.utils import encrypt_password
from app.models import user_datastore, Player, GoServer, Game, User, RATINGS_ADMIN_ROLE, SERVER_ADMIN_ROLE, USER_ROLE, db
sgf_data = b'(;FF[4]GM[1]SZ[19]CA[UTF-8]SO... |
"""
Unit tests for bayespy.utils.linalg module.
"""
import warnings
warnings.simplefilter("error")
import numpy as np
from .. import misc
from .. import linalg
class TestDot(misc.TestCase):
def test_dot(self):
"""
Test dot product multiple multi-dimensional arrays.
"""
# If no ... |
import pymysql
from .verbosity import Verbosity
class Database(object):
def __init__(self, host, port, database, user, password, verbosity=0):
self.__verbosity = Verbosity(verbosity)
self.__db_host = str(host)
self.__db_port = int(port)
self.__db_database = str(database)
s... |
# -*- coding: utf-8 -*-
import email
import hashlib
import base64
import re
from email.header import decode_header
from email.utils import parseaddr
from email.utils import parsedate_tz, mktime_tz
import datetime
import settings
import logging
logger = logging.getLogger(__name__)
class MailTicket:
""" Classe qu... |
from bisect import bisect
from mlperf_log_utils import log_event
from mlperf_logging.mllog import constants as mlperf_constants
class MLPerfLearningRateScheduler:
_MLPERF_BASE_LR = 2.5e-3
def __init__(self, learning_rate=_MLPERF_BASE_LR,
decay_factor=None, decay_epochs=None,
... |
from time import sleep
#from quick2wire.i2c import I2CMaster, reading
# Define class
class mfc:
@staticmethod
def _getRaw(fun, ch):
return fun(ch)
# External getter
def get(self, fun, ch):
raw = self._getRaw(fun, ch)
rate = raw/5.0*1.5
return rate
# External gette... |
"""
stubo.match
~~~~~~~~~~~
Matchers
:copyright: (c) 2015 by OpenCredo.
:license: GPLv3, see LICENSE for more details.
"""
import logging
import copy
from hamcrest.core.string_description import StringDescription
from hamcrest import all_of, is_not
from .request_matcher import (
bod... |
from unittest import mock
from osprofiler.drivers.elasticsearch_driver import ElasticsearchDriver
from osprofiler.tests import test
class ElasticsearchTestCase(test.TestCase):
def setUp(self):
super(ElasticsearchTestCase, self).setUp()
self.elasticsearch = ElasticsearchDriver("elasticsearch://lo... |
def RESET(db, cache):
"""
Truncates the entire database and clears the cache.
This will commit to the database, all database information
WILL be lost!
"""
cache.ram.clear()
cache.disk.clear()
for table in db.tables:
db[table].truncate("CASCADE")
db.commit()
class DBRows... |
# -*- coding: utf-8 -*-
from outwiker.core.attachment import Attachment
from outwiker.core.commands import isImage
import wx
from .thumbdialog import ThumbDialog
class ThumbDialogController (object):
def __init__(self, parent, page, selectedText):
"""
parent - родительское окно
page - т... |
"""The ordered logistic distribution class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_probability.python import math as tfp_math
from tensorflow_probability.python.bijectors impo... |
'''
Contains a whole bunch of game-specific miscellaneous constants, functions,
utilities, etc. It's a Python convention to call this sort of file config.py.
'''
from time import strftime
from functools import lru_cache
from os import environ
from os.path import join
import sys
import pygame.image
from ... |
"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
http://arduino.cc/en/Reference/HomePage
"""
# Extends: https://github.com/platfo... |
from __future__ import absolute_import, division, print_function
import os
from re import compile, IGNORECASE
from ..helpers import bounceStarter, indirectStarter, xpath_class
from ..scraper import _BasicScraper, _ParserScraper
from ..util import tagre
from .common import _ComicControlScraper, _WordPressScraper, _WPN... |
from datetime import datetime, timedelta
from openerp import models, fields, api
from openerp.tools.translate import _
class FleetWorkOrderType(models.Model):
_inherit = "fleet.work.order.type"
schedule_ids = fields.One2many(
string="Schedules",
comodel_name="fleet.work.order.type.schedule",
... |
import logging
import os
import time
import sys
from itertools import combinations, product
from queue import Empty
import dill
import numpy as np
from hyperspy.signal import BaseSignal
from hyperspy.utils.model_selection import AICc
_logger = logging.getLogger(__name__)
class Worker:
def __init__(self, identit... |
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ImproperlyConfigured
from django.core.validators import email_re
from django.db import models
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth.mod... |
"""
Get training set business features by averaging image features
"""
__author__ = 'bshang'
import numpy as np
import pandas as pd
import h5py
train_photo_to_biz = pd.read_csv('/data/train_photo_to_biz_ids.csv')
cols = []
cols.append('rid')
cols.extend(["L" + str(i+1) for i in range(0, 9)])
cols.append("path")
ph... |
"""Gold subscription forms"""
from __future__ import absolute_import
from builtins import object
from django import forms
from stripe.error import InvalidRequestError
from readthedocs.payments.forms import StripeModelForm, StripeResourceMixin
from .models import LEVEL_CHOICES, GoldUser
class GoldSubscriptionForm(S... |
import os
import re
import json
try:
from urlparse import urlparse, parse_qs
from urllib import urlencode, unquote
except ImportError: # py 3.x
from urllib.parse import urlparse, parse_qs, urlencode, unquote
from xbox.vendor import requests
from .exceptions import AuthenticationException, InvalidReques... |
"""
"Load" HQIP data from DGU.
The original version of this script was provided by @rossjones
"""
import os
import datetime
import hashlib
import sys
import urllib
import ckanapi
from ckanapi.errors import NotFound, ValidationError
from dc import ckan as catalogue
from dc import _org_existsp, Dataset
import ffs
fro... |
from lib_openmolar.client.qt4.widgets.chart_widgets import tooth_data
from lib_openmolar.client.qt4.widgets.chart_widgets import perio_data
class ChartDataModel(object):
'''
a custom set of dictionaries which holds data about all teeth in the mouth.
ChartWidgets hold no data, but are "views" to this model... |
'''
This comment holds the basics behind the exploit. Don't remove!
In the SQS queue we'll find a message holding this information:
eyJib2R5IjogImdBSjljUUVvVlFkbGVIQnBjbVZ6Y1FKT1ZRTjFkR054QTRoVkJHRnlaM054QkZnZE
FBQUFhSFIwY0RvdkwyaDBkSEJpYVc0dWIzSm5MM1Z6WlhJdFlXZGxiblJ4QllWeEJsVUZZMmh2Y21S
eEIwNVZDV05oYkd4aVlXTnJjM0VJ... |
import os
import env_settings as env
from gi.repository import Gtk
from lxml import etree
class NavPoint(object):
def __init__(self, label, contentsrc, children=[]):
self._label = label
self._contentsrc = contentsrc
self._children = children
def get_label(self):
return self._... |
"""
Provide the class Message and its subclasses.
"""
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, loc):
self.filename = filename
self.lineno = loc.lineno
self.col = getattr(loc, 'col_offset', 0)
def __str__(self):
return '%s:%s: ... |
import m5
import _m5
from m5.objects import *
m5.util.addToPath('../configs/')
from common.Caches import *
class Sequential:
"""Sequential CPU switcher.
The sequential CPU switches between all CPUs in a system in
order. The CPUs in the system must have been prepared for
switching, which in practice me... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
xpath_text,
)
class AdultSwimIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<is_playlist>playlist... |
import datetime
import django
from django.contrib.auth.hashers import check_password, make_password
from django.contrib.auth.models import User
from django.test import TestCase, modify_settings, override_settings
from django.urls import reverse
import pytz
from ..models import PasswordExpiry, PasswordHistory
from ..... |
#!/usr/bin/env python
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
"""
Usage: python show_samples <path_to_a_saved_DBM.pkl>
Displays a batch of data from the DBM's training set.
Then int... |
__author__ = 'kobi'
import requests
import json
################## END_POINTS #################################:
NAME = 'name_en'
PARENT = 'parent'
###############################################################
def get_data_as_dict(url):
"""
Get data from a URL as a python dictionary
:param url: the ... |
from django.db.models import Q
from rest_framework import permissions
from rest_framework import viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.generics import GenericAPIView, ListAPIView, get_object_or_404
from rest_framework.mixins import CreateModelMixin, DestroyModelMixin
from re... |
from .Buffer import TexContent
####################################################################################################
class Environment(TexContent):
##############################################
def __init__(self, name, options=''):
super().__init__()
self._name = name
... |
# Nertz! card game, rules based on julie's variant
# Last updated: Jan 2014
# todo: activity log for rollback
# make private/public variables and function names
# http://stackoverflow.com/questions/70528/why-are-pythons-private-methods-not-actually-private
# http://www.diveintopython.net/object_oriented_framework/... |
"""
This script is used in most of the hacker-script programs to do the initial stuff
"""
#################################################################################
# Copyright (C) 2016 Areeb Beigh <<EMAIL>> #
# ... |
import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import tmp_dnn
import tta
features = [
# "hu",
# "tutorial",
"haralick",
# "aaronmoments",
# "lbp",
# "pftas",
# "zernike_moments",
# "image_siz... |
"""
A Commuter has the following properties
- drives a car
- follow a given route to work
- has a RefillStrategy
- works
- leaves for work at a certain time
@author: benjamin
"""
import random
import datetime as dt
tz = dt.timezone(dt.timedelta(hours=1))
class Commuter(object):
"""The Commuter is a s... |
from libs.misc import decorator_combine
from libs.pyramid_helpers import set_cookie
from libs.pyramid_helpers.auto_format import action_ok, action_error
from libs.pyramid_helpers.etag import etag_decorator
__all__ = [
'web',
'action_ok',
'action_error',
'etag_decorator',
'set_cookie',
'cache',... |
from __future__ import absolute_import
import os
import sys
import json
from todo.commands.base import Command
from todo.utils.styles import Fore, Style
class AddCommand(Command):
def update_todos(self, todos=[]):
"""Creates a copy of the todo list with the new item"""
new_todos = todos.copy()
... |
import webracer
from wolis import utils
from wolis.test_case import WolisTestCase
class RegisterTestCase(WolisTestCase):
def test_register(self):
self.get('/ucp.php?mode=register')
self.assert_successish()
assert 'Registration' in self.response.body
form = self.res... |
"""`load_horsager2009`"""
from os.path import dirname, join
import numpy as np
try:
import pandas as pd
has_pandas = True
except ImportError:
has_pandas = False
def load_horsager2009(subjects=None, electrodes=None, stim_types=None,
shuffle=False, random_state=0):
"""Load data fr... |
"""
Test function
:func:`iris.experimental.regrid.regrid_weighted_curvilinear_to_rectilinear`.
"""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# import iris tests first so that some things can be initialised before
# importing anyt... |
"""Accesses the google.cloud.speech.v1 Speech API."""
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.client_options
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.gr... |
import serial
from queue import Queue
from time import sleep
import socket
from Nextion_config import *
end = b'\xff\xff\xff'
q_write_list = Queue()
q_get_list = Queue()
def run_async(func):
from threading import Thread
from functools import wraps
@wraps(func)
def async_func(*args, **kwargs):
... |
"""Python compatibility wrappers."""
"from __future__ import absolute_import"
from third_party import itertools
import sys
from struct import pack
MAX_INT = sys.maxsize
MAX_INT64 = (1 << 63) - 1
MAX_INT32 = (1 << 31) - 1
MAX_INT16 = (1 << 15) - 1
PY2 = sys.version_info[0] == 2
# Determine the word size of the proc... |
from __future__ import unicode_literals
from frappe import _
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """ERP made simple"""
app_icon = "fa fa-th"
app_color = "#e74c3c"
app_email = "<EMAIL>"
app_license = "GNU General Public License (v3)"
source_link =... |
#!/usr/bin/python
# ZALOZENIA CO DO USTAWIN GRY
#
# - okno gry na fullscreen 1365x767
# - lewy panel max w prawo (najwiekszy)
# - prawy panel max w lewo (najwiekszy)
# - gorny panel max w dol (najwiekszy)
# - dolny panel max w dol (najmniejszy)
# - minimapa lewy gorny rog, jeden raz '-' od najwiekszego powiekszenia
# ... |
"""
Views for managing Neutron Subnets.
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from horizon.utils import memoized
from horizon import workflows
from openstack_dashboard import api
from openstack_... |
"""
TODO(hjensas): This module should be deleted once neutron-lib containing
Change-Id: Ibd1b565a04a6d979b6e56ca5469af644894d6b4c is released.
"""
from neutron_lib.api.definitions import segment
ALIAS = 'segments-peer-subnet-host-routes'
IS_SHIM_EXTENSION = True
IS_STANDARD_ATTR_EXTENSION = False
NAME = 'Segments pe... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A module that implements the AdaGrad optimizer.
"""
import numpy
import theano.tensor as tensor
from theanolm.backend import Parameters
from theanolm.training.basicoptimizer import BasicOptimizer
class AdaGradOptimizer(BasicOptimizer):
"""AdaGrad Optimization Met... |
import os
import xlrd
from pychron.loggable import Loggable
DATA_FILE_COL = 1
SAMPLE_COL = 5
MATERIAL_COL = 7
J_COL = 1
JERR_COL = 2
IRRADIATION_COL = 18
class WiscArMetaParser(Loggable):
def populate_spec(self, path, spec):
if path.endswith('.xls'):
self._populate_xls(path, spec)
... |
from __future__ import division
import hmac
import hashlib
import sys
if sys.version_info[0] == 3:
buffer = lambda x: x
def hkdf_extract(salt, input_key_material, hash=hashlib.sha512):
'''
Extract a pseudorandom key suitable for use with hkdf_expand
from the input_key_material and a salt using HMAC with the
pro... |
#!/usr/bin/env python
import logging
from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property
log = logging.getLogger("Thug")
class HTMLImageElement(HTMLElement):
align = attr_property("align")
alt = attr_property("alt")
border = a... |
import csv
from django.views.generic.list import ListView
from django.http import Http404, HttpResponse
from django.contrib import messages
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _, activate
from django.core.urlresolvers import reverse
from django.db.models import ... |
import logging
from scap.model.oval_5.defs.linux.ObjectType import ObjectType
logger = logging.getLogger(__name__)
class RpmVerifyObjectElement(ObjectType):
MODEL_MAP = {
'tag_name': 'rpmverify_object',
'elements': [
{'tag_name': 'behaviors', 'class': 'RpmVerifyBehaviors', 'min': 0, 'm... |
from collections import OrderedDict
with open("NLTK_function") as f:
content = f.readlines()
content = [x.strip('\n') for x in content]
# output.write(content)
module_name = "nltk_lexicon"
is_class = False
is_def = False
is_doc_string = False
is_first = True
function_name = ""
doc_string = "\t\"\"\"\n"
dict = Orde... |
from ui.menu.menu import Menu
from ui.factory import Factory
from util.keys import GENRE, V_ALIGN_TOP
from util.config import USAGE, USE_VOICE_ASSISTANT, SCREENSAVER, NAME, CLOCK, LOGO, SLIDESHOW, VUMETER, \
ACTIVE_SAVERS, DISABLED_SAVERS
from ui.layout.buttonlayout import TOP, CENTER
ICON_LOCATION = TOP
BUTTON_PA... |
"""Genotype module."""
import sys
import scipy.stats
class Genotype(list):
"""A Genotype object."""
def __init__(self, nref, nalt):
"""
Genotype object.
nref is the amount of evidence supporting the reference allele,
nalt is the evidence supporting an alternative allele.
... |
#!/usr/bin/python
# -*-coding:utf-8-*-
import sys
import string
#ͳ¼Æ
def satisics(numbers):
my_numbers = []
last_row = []
for row in numbers:
assert len(row) == 7
last_row.append(row[6])
del row[6]
my_numbers.extend(row)
print 'ǰ6ÐÐ(Êý×Ö£¬´ÎÊý):'
print_frequency(my_numbers)
print 'µÚ7ÐÐ(Êý×Ö£¬´ÎÊý):... |
import configparser
import engine
import csv
import math
import sys
def EngineTechFromParserSection(section):
return engine.Tech(section['optimalTmr'],
section['tmrScaling'],
section['maxIsp'],
section['minIsp'],
section['exponent'],
s... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/chernomirdinmacuvele/Documents/workspace/PescArt2.0/UserInt/ui_simpleSearch.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class ... |
import conceptdb
from conceptdb.assertion import Assertion, Expression, Sentence
from conceptdb.metadata import Dataset
from conceptdb.justify import ReasonConjunction
conceptdb.connect_to_mongodb('test')
#clean out whatever was in test before
Assertion.drop_collection()
Dataset.drop_collection()
Expression.drop_coll... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.exception import SqlmapUnsupportedFeatureException
from plugins.generic.takeover import Takeover as GenericTakeover
class Takeover(GenericTakeover):
def __i... |
import unittest
from airflow.www import app as application
class TestPluginsRBAC(unittest.TestCase):
def setUp(self):
self.app, self.appbuilder = application.create_app(testing=True)
def test_flaskappbuilder_views(self):
from tests.plugins.test_plugin import v_appbuilder_package
appb... |
import subprocess
import sympy
from sympy.core.decorators import call_highest_priority
from sympy import Expr, Matrix, Mul, Add, diff
from sympy.core.numbers import Zero
class D(Expr):
_op_priority = 11.
is_commutative = False
def __init__(self, *variables, **assumptions):
super(D, self).__init__(... |
#!/usr/bin/env python
from __future__ import print_function
import sys, os, datetime, time, shutil, tempfile, subprocess, random
from optparse import OptionParser
from ._backup import *
info = "'rethinkdb index-rebuild' recreates outdated secondary indexes in a cluster.\n" + \
" This should be used after upgr... |
from spack import *
import spack.hooks.sbang as sbang
class GobjectIntrospection(Package):
"""The GObject Introspection is used to describe the program APIs and
collect them in a uniform, machine readable format.Cairo is a 2D graphics
library with support for multiple output"""
homepage = "https://wi... |
from tempest.api.compute import base
from tempest.lib import decorators
class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
max_microversion = '2.56'
@classmethod
def setup_clients(cls):
super(AbsoluteLimitsTestJSON, cls).setup_clients()
cls.client = cls.limits_client
@decorators.i... |
"""
Serialization support for compiled functions.
"""
import sys
import abc
import io
import copyreg
import pickle
from numba import cloudpickle
#
# Pickle support
#
def _rebuild_reduction(cls, *args):
"""
Global hook to rebuild a given class from its __reduce__ arguments.
"""
return cls._rebuild(*... |
"""Runs some tests about the Sequenced mixin.
You can run only these tests by issuing::
$ go apc
$ python manage.py test tests.test_sequenced
"""
from __future__ import unicode_literals
from __future__ import print_function
from builtins import str
from django.core.exceptions import ValidationError
from lino.u... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants.backend.core.tasks.task import Task, TaskBase
from pants.backend.jvm.subsystems.jvm import JVM
from pants.backend.jvm.tasks.jvm_tool_task_mixin i... |
import logging
import zmq
import conf
import subprocess
import threading
import time
import sys
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
UP_MESSAGE = "UP!"
DOWN_MESSAGE = "DOWN!"
process_registerer_address = "ipc://address_list"
front_end_process_dealer = "ipc://pront_end_process_de... |
# Tarbell template fabfile
from fabric import api as fab
import os
import jinja2
import codecs
from tarbell.app import TarbellSite as _TarbellSite
import inspect
from apiclient import errors
from apiclient import discovery
from apiclient.http import MediaFileUpload as _MediaFileUpload
from oauth2client import client
fr... |
import matplotlib.pyplot as plt
import numpy as np
import re
import argparse
res = [re.compile('.*Epoch\[(\d+)\] .*Train-accuracy.*=([.\d]+)'),
re.compile('.*Epoch\[(\d+)\] Validation-accuracy.*=([.\d]+)')]
def plot_acc(log_name, color="r"):
train_name = log_name.replace(".log", " train")
... |
# -*- coding: utf-8 -*-
from selenium_base import SeleniumTestCase
class MapTest(SeleniumTestCase):
# These tests run against a MockAPIServer started by the
# custom_runner
def test_map_slider(self):
self.browser.get(
self.live_server_url +
'/analyse/#org=CCG&numIds=0212000... |
from zipfile import ZipFile
from datetime import datetime
# test imports
import pytest
# package imports
from openpyxl.tests.helper import compare_xml
from openpyxl.reader.workbook import read_properties_core
from openpyxl.writer.workbook import (
write_properties_core,
write_properties_app
)
from openpyxl.xm... |
from Products.CMFCore.utils import getToolByName
from bika.lims.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.utils import formatDateQuery, formatDateParms, formatDuration
from... |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.