src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""replaygain
Calculate replaygain values for a set of files
Usage:
replaygain [-v...] FILE...
Options:
-v --verbose Set logging level, repeat to increase verbosity
"""
from __future__ import print_function, unicode_literals
import logging
import sys
from ... |
"""The WaveBlocks Project
The basic common algorithms for evaluation Hagedorn basis functions
of the new kind.
@author: R. Bourquin
@copyright: Copyright (C) 2016 R. Bourquin
@license: Modified BSD License
"""
from numpy import complexfloating, dot, vstack, zeros, identity, diag, real
from numpy.linalg import eigh
f... |
# -*- 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os
from functools import partial
from calibre import prepare_string_f... |
# -*- coding: utf-8 -*-
"""
OnionShare | https://onionshare.org/
Copyright (C) 2014 Micah Lee <micah@micahflee.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, o... |
# Copyright 2012 Nebula, 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 agree... |
import json
import time
import sys
import hashlib
import os
import re
import gevent
from Config import config
from Site import SiteManager
from Debug import Debug
from util import QueryJson, RateLimit
from Plugin import PluginManager
@PluginManager.acceptPlugins
class UiWebsocket(object):
def __init__(self, ws... |
#
# Copyright (c) 2016, SUSE LLC All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... |
# Copyright 2018 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
class TestBatchComputeEnvironment(BaseTest):
def test_batch_compute_update(self):
session_factory = self.replay_flight_data("test_batch_compute_update")
... |
# This test makes sure that the i/o interfaces work with CMR.
# CMR itself does not have to be installed for this test.
#
# The reason why CMR cannot use direct writes to DB/GPAW files is that
# GPAW cannot always write a GPAW without performing a new calculation e.g.
# GPAW(filename).write(...)
# fails in some ra... |
from __future__ import absolute_import
# Project imports
import os
import sys
import unittest
from mock import patch
from tempfile import gettempdir
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))))
from elodie import constants
from elodie.config im... |
#!/usr/bin/env python
"""
Instagram to LiveJournal cross-poster
"""
import sys
import os
import time
import cgi
import pickle
import argparse
import logging
import ConfigParser
from instagram import client, subscriptions
from jinja2 import PackageLoader, Environment
from lj import lj
def load_config(configFile):
C... |
from pytest import fixture, raises
from flask import Markup
from flask.ext.navigation.item import Item, ItemReference, ItemCollection
@fixture
def items():
items = {'biu': Item(u'Biu', endpoint='biu.biu'),
'boom1': Item(u'Boom', endpoint='biu.boom', args={'num': 1}),
'boom2': Item(u'Boo... |
import pyspark
from pyspark.mllib.regression import LabeledPoint
from pyspark.mllib.classification import LogisticRegressionWithSGD
from pyspark.mllib.tree import DecisionTree
from pyspark import SparkContext
from pyspark.sql import SQLContext
##If running through pyspark, start pyspark as follows: pyspark --pa... |
import os
import requests
from flask import redirect, url_for, render_template, request, flash
from forms import RegisterForm, CredentialForm
from petlib.pack import encode, decode
from .cred_user import CredentialUser
def setUpViews(app, crypto_dir, credential_url=None, info_url=None, params=None, ipub=None):
c... |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import datetime
from typing import Optional
from azure.core.exceptions import HttpResponseError
from azure.core.polling import AsyncLROPoller
from azure.c... |
"""
Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable.
"""
"""
This is the interface that will need to be overloaded by the customer so
that his/her code can receive in... |
# -*- test-case-name: txweb2.test.test_httpauth -*-
##
# Copyright (c) 2006-2009 Twisted Matrix Laboratories.
# Copyright (c) 2010-2015 Apple Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),... |
from collections import namedtuple
import argparse
'''
When you execute the program without any arguments, it returns RX and TX bytes
for each of the network devices. However, you can also specify the network
device you may be interested in. For example:
$ ./net_devs_2.py --help
usage: net_devs_2.py [-h] [-i IFACE]
... |
import sys
sys.path.insert(1, "../../../")
import h2o
import random
def cv_carsGBM(ip,port):
# read in the dataset and construct training set (and validation set)
cars = h2o.import_file(path=h2o.locate("smalldata/junit/cars_20mpg.csv"))
# choose the type model-building exercise (multinomial classificati... |
import logging
from twisted.internet.protocol import Factory, Protocol
from frame import decode_frame
from message import decode_message
log = logging.getLogger(__name__)
class ConnectionManager(object):
def __init__(self, backmonitor, addr):
self.backmonitor = backmonitor
self.addr = addr
... |
# Copyright 2012-2017 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Custom model and form fields."""
__all__ = [
"CIDRField",
"EditableBinaryField",
"Field",
"HostListFormField",
"IPListFormField",
"IPv4CIDRField",
... |
# vim:ts=4:et
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This prog... |
"""Main file for HassIO."""
import asyncio
from concurrent.futures import ThreadPoolExecutor
import logging
import sys
import hassio.bootstrap as bootstrap
import hassio.core as core
_LOGGER = logging.getLogger(__name__)
# pylint: disable=invalid-name
if __name__ == "__main__":
bootstrap.initialize_logging()
... |
"""
Implementation of a API specific HTTP service view.
"""
import colander
import simplejson as json
import six
from ichnaea.api.exceptions import (
DailyLimitExceeded,
InvalidAPIKey,
ParseError,
)
from ichnaea.api.rate_limit import rate_limit_exceeded
from ichnaea.models.api import ApiKey
from ichnaea i... |
import asyncio
import pytest
import pytest_asyncio.plugin # noqa F401
from pypeman import nodes, msgstore, channels
from pypeman.channels import BaseChannel
from pypeman.remoteadmin import RemoteAdminClient, RemoteAdminServer
from pypeman.test import TearDownProjectTestCase as TestCase
from pypeman.tests.common impo... |
"""
CBMPy: CBQt4 module
===================
Constraint Based Modelling in Python (http://pysces.sourceforge.net/getNewReaction)
Copyright (C) 2009-2018 Brett G. Olivier, VU University Amsterdam, Amsterdam, The Netherlands
This program is free software: you can redistribute it and/or modify
it under the terms of the GN... |
#
# Created by Roxane P. on 15/01/2016
# Parse fonts styles.css from fontastic or icomoon
#
import tinycss
names = []
glyphs = []
prefix = ''
fontName = ''
def parseCSS(file):
parser = tinycss.make_parser('page3')
stylesheet = parser.parse_stylesheet_file(file);
global prefix
global fontName
firs... |
import importscan
import sentaku
from widgetastic.utils import deflatten_dict
from widgetastic.utils import Parameter
from widgetastic.utils import ParametrizedLocator
from widgetastic.utils import ParametrizedString
from widgetastic.widget import ParametrizedView
from widgetastic.widget import Select
from widgetastic.... |
# Test class and utilities for functional tests
#
# Copyright (c) 2018 Red Hat, Inc.
#
# Author:
# Cleber Rosa <crosa@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
import logging
import os
import sys
import uuid
import tem... |
# % ---------------------------------
# % filename: initialize_data_structure.py
# %
# % we set the physical data of the structure.
# %============================================================
# % physical data of the structure
# %===========================================================
import numpy as np
... |
# Copyright (c) 2013 - 2015 EMC Corporation.
# 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
#
# Unle... |
# (C) Datadog, Inc. 2010-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
from distutils.version import LooseVersion # pylint: disable=E0611,E0401
from datadog_checks.zk import ZookeeperCheck
ZK_VERSION = os.environ['ZK_VERSION']
STAT_METRICS = [
'zookeeper.latency... |
# -*- coding: UTF-8 -*-
# -*- coding: utf-8 -*-
"""
otpauth
~~~~~~~
Implements two-step verification of HOTP/TOTP.
:copyright: (c) 2013 - 2014 by Hsiaoming Yang.
:license: BSD, see LICENSE for more details.
"""
import base64
import hashlib
import hmac
import struct
import sys
import time
import ... |
import webbrowser
import re
import urllib.request
import urllib.parse
import json
# as keyword creates an alias for xml.etree.ElementTree as ET, so we can use ET to reference xml.etree.ElementTree.
import xml.etree.ElementTree as eT
class Movie:
def __init__(self, title, plot, poster, trailer_url):
self.t... |
import os
import logging
import traceback
import shlex
import subprocess
import string
from collections import defaultdict
from loader import Loader, LoadResult, Timeout, TimeoutError
CURL = '/usr/bin/env curl'
class CurlLoader(Loader):
'''Subclass of :class:`Loader` that loads pages using curl.
.. note:... |
import fileinput
from dlx import DLX
from numpy import array, unique
from optparse import OptionParser
class SudokuError(Exception):
"""Raised when any error related to Sudoku is found during construction
and validation such as unexpected values or contradictions.
"""
def __init__(self, value):
... |
# coding: utf-8
from flask import request, redirect, url_for, current_app
from flask.views import MethodView
from quokka.utils import get_current_user
from quokka.modules.cart.models import Cart, Item
from quokka.core.templates import render_template
from quokka.core.models.channel import Channel
from .models import D... |
# -*- coding: utf-8 -*-
# Copyright (C) 2006 Frederic Back (fredericback@gmail.com)
# Copyright (C) 2007 Kristoffer Lundén (kristoffer.lunden@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 Fou... |
import pytest
import mock
from hamcrest import assert_that
from matchmock import called_once_with
from smoke import signal, Broker
class Source(object):
spam = signal()
egg = signal(name='egg')
class Mixed(Source, Broker):
pass
@pytest.fixture
def listener():
return mock.Mock()
@pytest.fixture
d... |
#!/usr/bin/env python
"""Setup script for DropTheBeat."""
import os
import sys
import setuptools
PACKAGE_NAME = 'dtb'
MINIMUM_PYTHON_VERSION = 3, 4
def check_python_version():
"""Exit when the Python version is too low."""
if sys.version_info < MINIMUM_PYTHON_VERSION:
sys.exit("Python {}.{}+ is r... |
"""
AST nodes specific to the C family of languages
"""
from sympy.core.basic import Basic
from sympy.core.compatibility import string_types
from sympy.core.containers import Tuple
from sympy.core.sympify import sympify
from sympy.codegen.ast import Attribute, Declaration, Node, String, Token, Type, none, FunctionCall... |
import sys
import types
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import string
import logging
import dataEntry
import cuon.XMLRPC.xmlrpc
import cuon.TypeDefs
import cuon.Windows.cyr_load_entries
import os
import os.path
from cuon.Windows.windows import windows
class chooseWindows(windows):
... |
#!/usr/bin/env python3
"""Global Position System (GPS) file reader for captured IQ signal
The Standard Positioning Service (SPS) spec can be found at
https://www.navcen.uscg.gov/pubs/gps/sigspec/gpssps1.pdf
"""
# Copyright (c) 2021 Andrew Rogers
#
# Permission is hereby granted, free of charge, to any person obt... |
import sys
import re
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import urlparse
import urllib
import CommonFunctions
import random
common = CommonFunctions
common.plugin = 'kasetophono-1.0'
base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
xbmcplugin.setContent(addon_handle, 'musicvideos')
arg... |
import gp
import glob
import mahotas as mh
import numpy as np
import os
import time
def read_section(path, z, verbose=True, withNP=True):
'''
'''
image = sorted(glob.glob(os.path.join(path, 'image', '*_'+str(z).zfill(9)+'_image.png')))
mask = sorted(glob.glob(os.path.join(path, 'mask', 'z'+str(z).zfill(8)+'.pn... |
#!/usr/bin/env python
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
import logging
from fuocore.models import (
BaseModel,
SongModel,
AlbumModel,
ArtistModel,
SearchModel,
)
from .provider import provider
logger = logging.getLogger(__name__)
class LBaseModel(BaseModel):
_detail_fields = ()
class Meta:
allow_get = True
provider = provide... |
import os
class MenuItem(object):
'''A single menu item which can contain child menu items'''
def __init__(self, title, items=None, refresh_callback=None, refresh_callback_args = None):
self._title = title
self._items = items
self._refresh_callback = refresh_callback
self._refr... |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import copy
from Normalizador import normalizador
class Propiedades(object):
def __init__(self, **props):
self._props = props
def __repr__(self):
return str(self._props)
def props(self):
return self._props
def __add__(self, o... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apach... |
"""
In mathematics, a (real) interval is a set of real
numbers with the property that any number that lies
between two numbers in the set is also included in the set.
"""
class Interval:
"""
A set of real numbers with methods to determine if other
numbers are included in the set.
Includes related m... |
passports, lines = [], []
while True:
try:
line = input().strip()
if line == "":
passports.append(' '.join(lines))
lines = []
else:
lines.append(line)
except Exception:
if lines:
passports.append(' '.join(lines))
break
'''... |
# -*- coding: utf-8 -*-
"""
@author : Armando Casillas <armcasillas@ucdavis.edu>
@author : Marco Pritoni <marco.pritoni@gmail.com>
Created on Wed Jul 26 2017
Update Aug 08 2017
"""
from __future__ import division
import pandas as pd
import os
import sys
import requests as req
import json
import numpy as np
import dat... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import os
import pytest
from django.core.urlresolvers import rev... |
#*******************************************************************************
# Copyright (C) 2015, CERN
# This software is distributed under the terms of the GNU General Public
# License version 3 (GPL Version 3), copied verbatim in the file "LICENSE".
# In applying this license, CERN does not waive the privileges ... |
"""Order dummy data."""
from store.orders.models import Order
# from store.orders.models import OrderConsistsOf
# Orders
o1 = Order('cid1')
o2 = Order('cid2')
o3 = Order('cid3')
o4 = Order('cid4')
o5 = Order('cid5')
o6 = Order('cid6')
o7 = Order('cid7')
o8 = Order('cid8')
o9 = Order('cid9')
o10 = Order('cid10')
o11 ... |
#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import print_function
import json
from ethereum import tester
from ethereum import slogging
from raiden.utils import privatekey_to_address, get_contract_path, safe_lstrip_hex
slogging.configure(":INFO")
log = slogging.getLogger(__name__)
TARGETS = dict(
... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from abc import ABCMeta, abstractmethod
from itertools import product
import numpy as np
from joblib import Parallel
from joblib import delayed
from six import moves, string_types, with_metaclass
from .split i... |
#/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This toolkit is free software; you can redistribute it and/or m... |
"""Admin site registration models for Caluma"""
from django.contrib import admin
from .models import SemesterDate
from .models import Student, Course, Level, Exam, Timetable, CourseLabel, Degree
from .models import Subject, Teacher, TeachingSubject, School, University
@admin.register(Subject)
class SubjectAdmin(admi... |
"""
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 later version.
This program is distributed in the hope that it will be useful,
but WITHOUT... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from copy import deepcopy
def get_currently_trainable_layers(net):
layers = [l for l in net.keys() if hasattr(net[l], 'W') if 'trainable' in list(net[l].params[net[l].W])]
return layers
def get_all_trainable_layer... |
# -*- coding: utf-8 -*-
#
# eduextractor documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 10 17:16:14 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... |
''' tools for working with .sas7bdat files '''
import os
from collections import OrderedDict
import pandas as pd
from sas7bdat import SAS7BDAT
from .knowledge.questionnaires import map_ph4, map_ph4_ssaga
map_subject = {'core': {'file_pfixes': []}}
parent_dir = '/processed_data/zork/zork-phase4-69/sessi... |
#!/usr/bin/python
import os
import datetime
import hashlib
import redis
class MaxOutConfig():
def __init__(self):
self.read_config()
def read_config(self):
# connection settings
self.host = os.environ['REDIS_MAXOUT_HOST']
self.port = os.environ['REDIS_MAXOUT_PORT']
s... |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE 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... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == '__main__':
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings_travis'
## initialize dummy envvars u... |
#!/usr/bin/python
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from django.conf import settings
from django.contrib.admin.util import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404... |
#!/usr/bin/env python
###############################################################################
# Copyright 2019 The Apollo 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 ... |
import types
import gdata.spreadsheet.service
from config import *
def get_spreadsheet_client():
''' Prepares and returns the spreadsheet client.'''
spr_client = gdata.spreadsheet.service.SpreadsheetsService()
spr_client.ClientLogin(email, password)
return spr_client
def get_feed_from_spreadsheet(spr... |
#
# 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... |
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... |
"""Skypipe client
This contains the client implementation for skypipe, which operates in
two modes:
1. Input mode: STDIN -> Skypipe satellite
2. Output mode: Skypipe satellite -> STDOUT
The satellite is a server managed by the cloud module. They use ZeroMQ
to message with each other. They use a simple protocol on to... |
""" JobLoggingDB class is a front-end to the Job Logging Database.
The following methods are provided
addLoggingRecord()
getJobLoggingInfo()
getWMSTimeStamps()
"""
import time
import sys
from types import StringTypes, IntType, LongType
from DIRAC import gLogger, S_OK, S_... |
########################################################################
# $HeadURL $
# File: RequestDB.py
# Date: 2012/12/04 08:06:30
########################################################################
from types import ListType
""" :mod: RequestDB
=======================
.. module: RequestDB
:synops... |
#!/usr/bin/python2
import sys
import time
from chains.service import Service
from chains.common import log
import serial
from . import iscp
class IntegraService(Service):
def onInit(self):
log('IntegraService init.')
self.model = self.config.get('model')
self.ser_dev = self.config.get('... |
import sys
sys.path.append('../../')
import gp
import glob
import mahotas as mh
import numpy as np
import os
import time
def read_section(path, z, verbose=True, withNP=True):
'''
'''
image = sorted(glob.glob(os.path.join(path, 'image', '*_'+str(z).zfill(9)+'_image.png')))
mask = sorted(glob.glob(os.path.join(p... |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import re
from dosagelib import scraper
from dosagelib.plugins import old... |
# jsb/plugs/grep.py
#
#
""" grep the output of bot comamnds. """
## jsb imports
from jsb.lib.commands import cmnds
from jsb.utils.generic import waitforqueue
from jsb.lib.examples import examples
## basic imports
import getopt
import re
## grep command
def handle_grep(bot, ievent):
""" grep the result list. ... |
'''
Created on 13.05.2016
@author: mkennert
'''
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.scrollview import ScrollView
from ownComponents.design import Design
from ownComponents.ownButton import OwnButton
from ownComponents.ownGraph ... |
"""
Management of Zeuthen Batch farmjobs
"""
import sys
#
#import shlex
#import sys
#import tarfile
#import time
#import logging
#import zmq
#import os
#import sqlite3
#import re
#
#from .. import CONFIG, Logger
#from .metascript import MetaScript
#from .utils import ListSlicer, RotatingFileNamer, GetEnvshells, ExitF... |
# Made by Mr. - Version 0.3 by DrLecter
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
qn = "316_DestroyPlaguebringers"
WERERAT_FANG = 1042
VAROOL_FOULCLAWS_FANG = ... |
from ...symbols import ORTH, NORM
_exc = {}
_abbr_exc = [
{ORTH: "м", NORM: "метър"},
{ORTH: "мм", NORM: "милиметър"},
{ORTH: "см", NORM: "сантиметър"},
{ORTH: "дм", NORM: "дециметър"},
{ORTH: "км", NORM: "километър"},
{ORTH: "кг", NORM: "килограм"},
{ORTH: "мг", NORM: "милиграм"},
{... |
import logging
import re
import socket
import threading
from os import path, chdir
try:
from urllib import request as urllib_request
except ImportError:
import urllib as urllib_request
try:
from http.server import HTTPServer, SimpleHTTPRequestHandler
from socketserver import ThreadingMixIn
except Impor... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... |
# -*- coding: utf-8 -*-
from operator import itemgetter, attrgetter
from accessor.exceptions import ResolverException
from accessor.utils import indexgetter
class Accessor(object):
"""
Utility to resolve path on an object. Example:
> obj = [{'a': 'abc'}, 1]
> a = Accessor('0.a.upper')
> a.re... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import json
import os
import yaml
from elasticsearch.client import Elasticsearch
def main():
if os.path.isfile('../config.yaml'):
filename = '../config.yaml'
elif os.path.isfile('config.yaml'):
filename = 'co... |
################################################################
# File: ch.py
# Title: Chatango Library
# Original Author: Lumirayz/Lumz <lumirayz@gmail.com>
# Current Maintainers and Contributors:
# Nullspeaker <import codecs;codecs.encode('aunzzbaq129@tznvy.pbz','rot_13')>
# asl97 <asl97@outlook.com>
# pystub
# ... |
# -*- coding: utf-8 -*-
# Copyright 2014 The Arobito Project
#
# 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 applicab... |
# Mark Gatheman <markrg@protonmail.com>
#
# This file is part of Hydrus.
#
# Hydrus 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 version.
#
... |
import argparse
import ast
import sys
from keras_wrapper.extra.read_write import pkl2dict
def parse_args():
parser = argparse.ArgumentParser("Rebuilds a python file (like config.py) from a given config instance.")
parser.add_argument("-c", "--config", required=False, help="Config pkl for loading the model con... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.datasets.base import Bunch
from os.path import join
PATH = "d:\\data"
# class Bunch(dict):
# """Container object for datasets
# Dictionary-like object that exposes its keys as attributes.
#
# See... |
# -*- coding: utf-8 -*-
import sys
import json
import threading
import six
from funcy import select_keys, cached_property, once, once_per, monkey, wraps, walk
from funcy.py2 import mapcat, map
from .cross import pickle, md5
import django
from django.utils.encoding import smart_str, force_text
from django.core.exceptio... |
class BuildRetention(object):
def __init__(self,
count=None,
delete_build_artifacts=None,
build_numbers_not_to_be_discarded=None):
super(BuildRetention, self).__init__()
self._count = count
self._delete_build_artifacts = delete_build_artif... |
###################################################
# header_common.py
# This file contains common declarations.
# DO NOT EDIT THIS FILE!
###################################################
#client events
multiplayer_event_set_item_selection = 0
multiplayer_event_set_bot_selection ... |
"""
CSVWriter.py contains the CSVWriter class that is used to create a clean.psv
file that can later be used to load to the database.
"""
from csv import DictWriter
import os
import copy
import uuid
logging_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.p... |
# unit tests
try:
import unittest2 as unittest
except ImportError:
import unittest
import mimerender
from mimerender import _MIME_TYPES
class TestMimeRender(mimerender.MimeRenderBase):
def __init__(self, request_parameters=None, accept_header=None,
*args, **kwargs):
super(TestMimeRen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.