code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python3
# uses the following encoding: utf-8
import logging
import os
import readline
import traceback
import termcolor
from mesh import config
from mesh import history
from mesh import session
from mesh.command import CommandFactory
def setup():
FORMAT = '%(asctime)s - %(name)s - %(levelname)s -... | mmichie/mesh | msh.py | Python | mit | 1,838 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | jerome-jacob/selenium | py/test/selenium/webdriver/firefox/ff_select_support_class_tests.py | Python | apache-2.0 | 1,419 |
import copy
from tornadowebapi.resource import Resource
from traitlets import HasTraits, List, Int, Type
class ItemsResponse(HasTraits):
"""This class can be returned by items() to inform about the nature of
the response, especially when partial, e.g. how many total items actually
exist, and which ones a... | simphony/tornado-webapi | tornadowebapi/items_response.py | Python | bsd-3-clause | 2,462 |
# GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | MagazinnikIvan/pywinauto | pywinauto/controlproperties.py | Python | bsd-3-clause | 9,133 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Wilson Pinto Júnior <wilsonpjunior@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | wpjunior/telecentros | src/TeleCentros/ui/__init__.py | Python | gpl-3.0 | 837 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | jmcnamara/XlsxWriter | xlsxwriter/test/comparison/test_chart_axis44.py | Python | bsd-2-clause | 1,703 |
#
# Copyright 2014 Red Hat, Inc
#
# Author: Chris Dent <chdent@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/tests/ipmi/notifications/test_ironic.py | Python | gpl-2.0 | 8,529 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | vicnet/weboob | modules/logicimmo/module.py | Python | lgpl-3.0 | 3,322 |
#!/usr/bin/env python
import env
import os
import sys
from subprocess import Popen, call
from tempfile import TemporaryFile
from run_unit_tests import run_unit_tests
ROBOT_ARGS = [
'--doc', 'SeleniumSPacceptanceSPtestsSPwithSP%(browser)s',
'--outputdir', '%(outdir)s',
'--variable', 'browser:%(browser)s',... | jussimalinen/robotframework-selenium2library | test/run_tests.py | Python | apache-2.0 | 3,359 |
#This file is part of ClusterMass
#
# Copyright 2014 Uladox
#
# ClusterMass 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.... | Uladox/ClusterMass | PYSTARS.py | Python | gpl-2.0 | 1,968 |
from unittest import TestCase
from chatterbot.conversation import Statement
from chatterbot.adapters.input import TerminalAdapter
class TerminalAdapterTests(TestCase):
"""
The terminal adapter is designed to allow
interaction with the chat bot to occur through
a command line interface.
"""
de... | osDanielLee/SelfThinkingRobot | AnalyzeData/tests/input_adapter_tests/test_terminal_adapter.py | Python | bsd-3-clause | 376 |
from contextlib import contextmanager
import pickle
import sqlalchemy as tsa
from sqlalchemy import ARRAY
from sqlalchemy import bindparam
from sqlalchemy import BLANK_SCHEMA
from sqlalchemy import Boolean
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchem... | monetate/sqlalchemy | test/sql/test_metadata.py | Python | mit | 176,328 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 28 08:55:41 2017
@author: jogipam
"""
import sys
import json
datos={}
def cargaJson(fichero):
try:
f=open(fichero)
txt=f.read()
f.close()
datos=json.loads(txt)
print(datos['c79a3bf9293f290f3942e7451559c91f'])
... | laydrot/text2stru | src/cargaJson.py | Python | gpl-3.0 | 622 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-07 06:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('admin', '0008_vm_system'),
]
operations = [
migrations.AddField(
... | 827992983/yue | admin/migrations/0009_auto_20160507_0638.py | Python | gpl-3.0 | 1,363 |
from django.http import HttpResponse
from django.shortcuts import render
from ophasebase.helper import LaTeX
def generate_orga_cert(queryset):
""" Generates a PDF file with orga certificates for staff people in the queryset """
(pdf, pdflatex_output) = LaTeX.render({"items": queryset},
... | d120/pyophase | staff/reports.py | Python | agpl-3.0 | 1,056 |
import mpi
import os
import sys
sys.exit(0)
| steder/maroonmpi | test/ptest.py | Python | gpl-2.0 | 44 |
"update version string during build"
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
import os
import re
import time
from distutils.dist import Di... | Glottotopia/aagd | moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/support/passlib/_setup/stamp.py | Python | mit | 2,140 |
#!/usr/bin/env python
# encoding: utf-8
from fabric.api import (
env, run, local, put, cd, settings, lcd
)
app_name = "app_name"
home_dir = '/home/deploy'
project_dir = home_dir + '/' + app_name
general_app_dir = '/mnt/%s' % app_name
source_dir = project_dir + '/htdocs'
log_dir = general_app_dir + '/log'
run_d... | zhkzyth/storm_maker | template/deploy/fabfile.py | Python | mit | 3,482 |
# pylint: skip-file
from __future__ import absolute_import, division, print_function
import functools
import os
import socket
import unittest
from salt.ext.tornado.platform.auto import set_close_exec
skipIfNonWindows = unittest.skipIf(os.name != 'nt', 'non-windows platform')
@skipIfNonWindows
class WindowsTest(unit... | saltstack/salt | salt/ext/tornado/test/windows_test.py | Python | apache-2.0 | 877 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | var/spack/repos/builtin/packages/py-protobuf/package.py | Python | lgpl-2.1 | 2,192 |
from os import path
import re
class aMSNLang(object):
lang_keys = {}
lang_dirs = []
base_lang = 'en'
lang_code = base_lang
default_encoding = 'utf-8'
lineRe = re.compile('\s*([^\s]+)\s+(.+)', re.UNICODE) # whitespace? + key + whitespace + value
langRe = re.compile('(.+)-.+', re.UNICOD... | kakaroto/amsn2 | amsn2/core/lang.py | Python | gpl-2.0 | 3,787 |
# Copyright (C) 2010 Steven Van Bael <steven.v.bael@gmail.com>
#
# This file is part of Telemeter Python wrapper.
#
# Telemeter Python wrapper 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 o... | vbsteven/Telemeter-Python-wrapper | TelemeterService.py | Python | gpl-3.0 | 3,275 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('catering', '0002_catering_distance'),
]
operations = [
migrations.AddField(
model_name='catering',
n... | Guest007/vgid | apps/catering/migrations/0003_catering_delivery.py | Python | mit | 507 |
'''
Created on 29.04.2017
@author: Mr. Jones
'''
import Queue
from visitors import constantvisitor
class PrintTraversal(object):
def __init__(self,nodes):
self.node_list = Queue.Queue()
self.temp_blacklist = []
if isinstance(nodes, list):
for i in nodes:... | mrj0n3s/jimplify | Jimplify/jimplify/cfg.py | Python | mit | 2,028 |
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | tensorflow/tfx | tfx/orchestration/beam/legacy/beam_dag_runner_test.py | Python | apache-2.0 | 5,486 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/utils/scp_copy.py
# Copy files using scp
# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
# @date 2011-06-07
# ==================================================================... | OstapHEP/ostap | ostap/utils/scp_copy.py | Python | bsd-3-clause | 5,244 |
class Owner(object):
def __init__(self, since, id):
self.id = id
self.since = since
def __eq__(self, other):
return self.id == other.id
| dip-proto/eris | eris/owner.py | Python | bsd-2-clause | 170 |
from __future__ import absolute_import
from django.contrib import admin
from .models import Story
admin.site.register(Story)
raise Exception("Bad admin module")
| willingc/oh-mainline | vendor/packages/Django/tests/regressiontests/bug8245/admin.py | Python | agpl-3.0 | 165 |
#!/usr/bin/env python3
#Copyright 2010 Sebastian Hagen
# This file is part of liasis.
#
# liasis 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... | sh01/liasis | src/misc/lnfs_fuse.py | Python | gpl-2.0 | 6,043 |
#!/usr/bin/python
# Copyright (C) 2013 Red Hat, Inc.
# Copyright (C) 2013 Ian McLeod <imcleod@redhat.com>
#
# 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... | imcleod/anaconda-ec2 | aws_utils.py | Python | lgpl-2.1 | 26,742 |
from .. import base_ip
import os
'''
#an example of io_dic of i2c_master io
'''
#return the class name for query
def get_ip_name():
return "I2C_MASTER"
class I2C_MASTER(base_ip.base_ip):
ID = "__I2C_MASTER"
ALT = ["a", "b", "c"]
def __init__(self, io_hash):
self.dicts = io_hash
self.alt = "a"
def se... | hakehuang/pycpld | ips/ip/i2c_master/i2c_master_partial.py | Python | mit | 1,857 |
# Copyright 2013 NEC 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
#
# Unless required ... | pczerkas/tempest | tempest/scenario/test_stamp_pattern.py | Python | apache-2.0 | 8,121 |
#!/usr/bin/env python
# Setuptools install description file.
from setuptools import setup, find_packages
with open('README.md') as readme:
long_description = readme.read()
with open('requirements.txt') as f:
requirements = [line.strip() for line in f.readlines()]
setup(
name='wildfly-py',
version='... | cenx-cf/wildfly-py | setup.py | Python | apache-2.0 | 1,083 |
from __future__ import absolute_import
from django.db.models.query import QuerySet
from typing import TypeVar, List
T = TypeVar('T')
def last_n(n, query_set):
# type: (int, QuerySet[T]) -> List[T]
"""Get the last n results from a Django QuerySet, in a semi-efficient way.
Returns a list."""
# We d... | Vallher/zulip | zerver/lib/query.py | Python | apache-2.0 | 501 |
"""TilePyramid creation."""
import pytest
from shapely.geometry import Point
from shapely.ops import unary_union
from types import GeneratorType
from tilematrix import TilePyramid, snap_bounds
def test_init():
"""Initialize TilePyramids."""
for tptype in ["geodetic", "mercator"]:
assert TilePyramid(... | ungarj/tilematrix | test/test_tilepyramid.py | Python | mit | 12,182 |
# __init__.py
# Copyright (C) 2006, 2007 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
| tebeka/pythonwise | tagcloud/mako/__init__.py | Python | bsd-3-clause | 205 |
from .scaler_base import *
from .generalized_linear_scaler import *
from .thermodynamic_scaler import *
from .null_scaler import *
| mhoffman/catmap | catmap/scalers/__init__.py | Python | gpl-3.0 | 131 |
#!/usr/bin/env python2
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(s... | The-Cypherfunks/The-Cypherfunks | share/rpcuser/rpcuser.py | Python | mit | 1,117 |
# Copyright 2012 Pedro Navarro Perez
# Copyright 2013 Cloudbase Solutions Srl
# 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... | vmthunder/nova | nova/virt/hyperv/volumeops.py | Python | apache-2.0 | 11,578 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SpidieFace.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| espenfjo/FjoSpidie-Interface | manage.py | Python | gpl-3.0 | 253 |
#coding=utf-8
#author: wwj718
#author_email: wuwenjie718@gmail.com
#author_blog: wwj718.github.io
""" youkuXBlock main Python class"""
import pkg_resources
from django.template import Context, Template
from xblock.core import XBlock
from xblock.fields import Scope, Integer, String, Boolean
from xblock.fragment impor... | wwj718/youkuXBlock | youku/youku.py | Python | agpl-3.0 | 4,590 |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | blrm/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_openshift/library/oc_image.py | Python | apache-2.0 | 54,415 |
import pytest
import sys
sys.path.append("../src/")
import cryspy
from cryspy.fromstr import fromstr as fs
import numpy as np
def test_Karussell():
metric = cryspy.geo.Cellparameters(1, 1, 1, 90, 90, 90).to_Metric()
k = cryspy.utils.Karussell(metric, fs("d 1 0 0"), fs("d 0 1 0"))
d1 = k.direction(0)
a... | cryspy-team/cryspy | tests/test_utils.py | Python | gpl-3.0 | 1,181 |
import datetime
from django.test import TestCase
from dojo.models import Test, Finding
from dojo.tools.sarif.parser import SarifParser
class TestSarifParser(TestCase):
def common_checks(self, finding):
self.assertLessEqual(len(finding.title), 250)
self.assertIn(finding.severity, Finding.SEVERITIE... | rackerlabs/django-DefectDojo | dojo/unittests/tools/test_sarif_parser.py | Python | bsd-3-clause | 9,844 |
from django.contrib import admin
# Register your models here.
from .models import Service, Skill, Rating
class ServiceAdmin(admin.ModelAdmin):
list_display = ['user_request', 'state', 'priority', 'no_people', 'cancellable', 'short_description']
def short_description(self, obj):
return obj.request[:10... | kikofernandez/match-django | ask/instance/admin.py | Python | apache-2.0 | 545 |
# -*- coding: utf-8 -*-
#
# sheetparser documentation build configuration file, created by
# sphinx-quickstart on Fri May 05 21:59:06 2017.
#
# 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.
#... | gcoffin/sheetparser | docs/conf.py | Python | gpl-3.0 | 5,005 |
from math import sqrt
from ert.geo.geometry_tools import GeometryTools
from ert.test import ExtendedTestCase
class PolygonSlicingTest(ExtendedTestCase):
def test_slicing_internal_hull(self):
polygon = [(2,2),(2,1),(1,1),(1,5),(5,5),(5,4),(4,4)]
edge = [(0,0) , (10,0) , (10,10), (0,10) , (0,0)]
... | arielalmendral/ert | python/tests/core/geometry/test_polygon_slicing.py | Python | gpl-3.0 | 4,227 |
from __future__ import absolute_import
from rest_framework.response import Response
from sentry.app import ratelimiter
from sentry.utils import auth, metrics
from sentry.utils.hashlib import md5_text
from sentry.api.base import Endpoint
from sentry.api.serializers.base import serialize
from sentry.api.serializers.mod... | mvaled/sentry | src/sentry/api/endpoints/auth_login.py | Python | bsd-3-clause | 2,601 |
default_app_config = 'snoopy.apps.SnoopyConfig'
| Pradeek/django-snoopy | snoopy/__init__.py | Python | mit | 48 |
#!/usr/bin/env python
__author__ = 'greghines'
import numpy as np
import os
import pymongo
import sys
import cPickle as pickle
import bisect
import csv
import matplotlib.pyplot as plt
import random
import math
import urllib
import matplotlib.cbook as cbook
from scipy.stats.stats import pearsonr
from scipy.stats import ... | zooniverse/aggregation | experimental/penguins/dkMeans.py | Python | apache-2.0 | 8,197 |
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
| VitalPet/addons-onestein | web_widget_float_highlight/__init__.py | Python | agpl-3.0 | 146 |
import asposecellscloud
from asposecellscloud.CellsApi import CellsApi
from asposecellscloud.CellsApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
apiServer = "http://api.aspose.com/v1.1"
data_fol... | asposecells/Aspose_Cells_Cloud | Examples/Python/Examples/SplitExcelWorkbooks.py | Python | mit | 1,486 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.core.management.base import BaseCommand
from django.db.transaction import atomic
from ... | hrayr-artunyan/shuup | shuup/core/management/commands/compute_bought_with_relations.py | Python | agpl-3.0 | 1,164 |
#! /usr/bin/env python
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base64 encoding of a zip file, this zip file contains
# a fully functional basic pytest script.
#
# Pyt... | sportsy/sports-stats | runtests.py | Python | mit | 236,333 |
"Taken from django.middleware.locale: this is the locale selecting middleware that will look at accept headers"
from django.utils.cache import patch_vary_headers
from django.utils import translation
from askbot.conf import settings
class LocaleMiddleware(object):
"""
This is a very simple middleware that pars... | PearsonIOKI/compose-forum | askbot/middleware/locale.py | Python | gpl-3.0 | 1,027 |
# -*- coding: utf-8 -*-
import os
from Config import Config
from Options import Options
from definitions import *
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
def celsius():
config = Config()
regions = config.getSolids() + config.getFluids()
for region in regions:
... | zagl/chtrun | lib/cht/celsius.py | Python | gpl-3.0 | 526 |
"""
Problem Statement
Jim is doing his discrete maths homework which requires him to repeatedly calculate nCr(n choose r) for different values
of n. Knowing that this is time consuming, he goes to his sister June for help. June, being a computer science student
knows how to convert this into a computer program and gen... | algorhythms/HackerRankAlgorithms | nCr table.py | Python | apache-2.0 | 1,393 |
import logging
import os
import re
import urllib
import urlparse
import gobject
gobject.threads_init()
import gst
import gtk
import random
from blockify import util
log = logging.getLogger("player")
class InterludePlayer(object):
"A simple gstreamer audio player to play interlude music."
def __init__(self,... | ysangkok/blockify | blockify/interludeplayer.py | Python | mit | 10,647 |
import os
import sys
import shutil
from subprocess import check_call, call
from contextlib import contextmanager
from pathlib import Path
import click
try:
str = unicode
except:
pass
windows = sys.platform == 'win32'
bin = 'Scripts' if windows else 'bin'
def virtual_env():
"""Find the current environ... | ryanhiebert/pew2 | pew.py | Python | mit | 4,896 |
###################################################################################################
# Interlocks: example on creating and installing device interlock rules.
###################################################################################################
class MyInterlock1 (Interlock):
#Motor and ... | paulscherrerinstitute/pshell | src/main/assembly/help/Tutorial_py/5_Utils/55_Interlocks.py | Python | gpl-3.0 | 1,076 |
"""TELNET client class.
Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds
Example:
>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79) # connect to finger port
>>> tn.write('guido\r\n')
>>> print tn.read_all()
Login Name TTY Idle When ... | mpenning/exscript | src/Exscript/protocols/telnetlib.py | Python | gpl-2.0 | 24,224 |
__version__ = '0.8'
__author__ = 'ArmedGuy'
import b3, time, threading, re, socket, thread, sys, pyircbot
from pyircbot import IrcEvent, IrcUser
from b3 import clients
import b3.events
import b3.plugin
import datetime, string
from b3 import functions
#------------------------------------------------------------------... | ArmedGuy/ircboot | ircboot.py | Python | mit | 16,101 |
# pylint: skip-file
# vim: expandtab:tabstop=4:shiftwidth=4
#pylint: disable=too-many-branches
def main():
''' ansible module for gcloud iam servicetaccount'''
module = AnsibleModule(
argument_spec=dict(
# credentials
state=dict(default='present', type='str',
... | appuio/ansible-role-openshift-zabbix-monitoring | vendor/openshift-tools/ansible/roles/lib_gcloud/build/ansible/gcloud_iam_sa.py | Python | apache-2.0 | 2,675 |
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'LoginHook',
# list of one or more authors for the module
... | frohoff/Empire | lib/modules/python/persistence/osx/loginhook.py | Python | bsd-3-clause | 4,626 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of AudioLazy, the signal processing Python package.
# Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini
#
# AudioLazy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | antiface/audiolazy | examples/dft_pitch.py | Python | gpl-3.0 | 3,525 |
#!/usr/bin/env
from setuptools import setup
import strif
setup(
name="strif",
version=strif.VERSION,
py_modules=["strif"],
author="Joshua Levy",
license="Apache 2",
url="https://github.com/jlevy/strif",
install_requires=[],
description=strif.DESCRIPTION,
long_description=strif.LONG_DESCRIPTION,
c... | intermezzo-fr/strif | setup.py | Python | apache-2.0 | 720 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import boto3
from argparse import ArgumentParser
import csv
import sys
sys.path.insert(0, '../')
if __name__ == "__main__":
bucket = sys.argv[1]
data = sys.argv[2] # the name of the text file with the arguments for (typically "arguments.txt")
s3 = bot... | NeuroDataDesign/seelviz | Docker/jon/batch/upload/preupload/execute.py | Python | apache-2.0 | 1,074 |
##
# Copyright 2009-2017 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | ULHPC/easybuild-easyblocks | easybuild/easyblocks/n/numpy.py | Python | gpl-2.0 | 13,885 |
import pyglet
from caladbolg.graphics import graphics_context
class Window:
"""
Represents the window that is drawn to for all graphics.
Various events including key handlers and timer events are handled here.
"""
def __init__(self, title, width, height):
"""
Initializ... | MikeHoffert/caladbolg-engine | caladbolg/graphics/window.py | Python | mit | 3,118 |
#!/usr/bin/python -Wall
# -*- coding: utf-8 -*-
"""
<div id="content">
<div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div>
<h2>Coin sums</h2><div id="problem_info" class="info"><h3>Problem 31</h3><span>Published on Friday, 22nd Novembe... | beyoungwoo/C_glibc_Sample | _Algorithm/ProjectEuler_python/euler_31.py | Python | gpl-3.0 | 1,303 |
# This script generates an intermediate representation of the data model ready for translation into CSV
import json
import operator # Used in sorting
from sets import Set
from genmodel import generateModel, getName
# Change final parameter to False / True depending on whether you want roll-ups or not.
# Note to self: ... | ThreeSixtyGiving/prototype-tools | scripts/gen-docs.py | Python | mit | 4,111 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_l10n_es_aeat_mod347
| OCA/l10n-spain | l10n_es_aeat_mod347/tests/__init__.py | Python | agpl-3.0 | 104 |
# vim: set fileencoding=utf-8:
#
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
#
# Copyright (c) 2016-2021 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2017-2021 Ben Nuttall <ben@bennuttall.com>
# Copyright (c) 2019 Jeevan M R <14.jeevan@gmail.com>
# Copyright (c) 2019 Andrew Scheller <github... | EternityForest/KaithemAutomation | kaithem/src/thirdparty/lowpriority/gpiozero/internal_devices.py | Python | gpl-3.0 | 26,989 |
import base64
import json
import responses
from mapbox.services.datasets import Datasets
username = 'testuser'
access_token = 'pk.{0}.test'.format(
base64.b64encode(b'{"u":"testuser"}').decode('utf-8'))
def test_class_attrs():
"""Get expected class attr values"""
serv = Datasets()
assert serv.api_... | mapbox/mapbox-sdk-py | tests/test_datasets.py | Python | mit | 8,145 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-24 23:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('members', '0017_auto_20170225_0026'),
]
operations = [
migrations.AlterField(... | diegojromerolopez/djanban | src/djanban/apps/members/migrations/0018_auto_20170225_0040.py | Python | mit | 522 |
#! /usr/bin/python
# Copyright (C) 2016 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list o... | Debian/openjfx | modules/web/src/main/native/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py | Python | gpl-2.0 | 8,428 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache... | mycFelix/heron | heron/tools/cli/src/python/jars.py | Python | apache-2.0 | 1,996 |
# coding: utf-8
#
# Copyright 2016 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | souravbadami/oppia | core/storage/activity/gae_models_test.py | Python | apache-2.0 | 2,350 |
from twisted.trial import unittest
from axiom.attributes import integer
from axiom.errors import NoCrossStoreReferences
from axiom.item import Item
from axiom.sequence import List
from axiom.store import Store
from functools import total_ordering
from operator import lt, eq
@total_ordering
class SomeItem(Item):
... | twisted/axiom | axiom/test/test_sequence.py | Python | mit | 19,449 |
class NoisyImplementationRunner:
def __init__(self, deploy_message, audit_stream):
self._deploy_message = deploy_message
self._audit_stream = audit_stream
def run(self):
self._audit_stream.log(self._deploy_message)
| julianghionoiu/tdl-client-python | test/runner/noisy_implementation_runner.py | Python | apache-2.0 | 249 |
'''
Created on Nov 13, 2014
@author: ronald
'''
from collatex.core_classes import create_table_visualization
# optionally load the IPython dependencies
try:
from IPython.display import HTML
from IPython.display import SVG
from IPython.core.display import display
# import graphviz python library
fr... | rhdekker/collatex | collatex-pythonport/collatex/display_module.py | Python | gpl-3.0 | 1,956 |
# Pass to the get_reply() method's groups parameter to match all groups
class AnyGroup:
pass
| FujiMakoto/AgentML | agentml/constants.py | Python | mit | 97 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# =========================================================================
#
# Copyright © 2016 BIREME/PAHO/WHO
#
# This file is part of API-NLM.
#
# API-NLM is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pu... | bireme/api-nlm | src/RegularExpression.py | Python | lgpl-2.1 | 1,907 |
# -*- coding:utf-8 -*-
'''
请实现一个函数,将一个字符串中的空格替换成“%20”。
例如,当字符串为Python is a useful language.则经过替换之后的字符串为Python%20is%20a%20useful%20language.
同时可以将替换字符变成变量, 用任意字符替换空格
同时还可以设置被替换字符为变量,替换任意字符
'''
'''
方法一:
对字符串逐一判断并替换
方法二:
利用字符串的replace函数
'''
class Solution_1:
def replace_space(self, source_string, replace_item):... | shabbylee/algorithm | 替换空格.py | Python | apache-2.0 | 3,056 |
# -*- coding: utf-8 -*-
# Documentaçao do BeautifulSoup: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
import requests
import sys
from bs4 import BeautifulSoup
page = requests.get('http://stackoverflow.com/questions/tagged/python?sort=frequent&pageSize=15/')
soup = BeautifulSoup(page.content, 'html.parser... | davidalves1/dojo-python | desafio.py | Python | mit | 1,410 |
import os
import unittest
import vtrace.tests as vt_tests
class VtraceBasicTest(vt_tests.VtraceProcessTest):
breakpoints = {
'windows': 'ntdll.NtTerminateProcess',
'linux': 'libc.exit',
'freebsd': 'libc.exit',
}
def test_vtrace_getregisters(self):
self.assertTrue(self.tra... | bat-serjo/vivisect | vtrace/tests/testbasic.py | Python | apache-2.0 | 2,094 |
#!/usr/bin/env python
import os
import sys
# Edit this if necessary or override the variable in your environment.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mozlex.settings')
# Add a temporary path so that we can import the funfactory
tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
... | glogiotatidis/mozlex | manage.py | Python | bsd-3-clause | 666 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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_version': '1.1',
... | trondhindenes/ansible | lib/ansible/modules/network/f5/bigip_ssl_certificate.py | Python | gpl-3.0 | 14,453 |
# Generated by Django 3.0.4 on 2020-03-17 07:42
import django.core.validators
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
... | GSC-RNSIT/bookmark-manager | bookmarks/migrations/0001_initial.py | Python | mit | 1,920 |
from functools import wraps
from typing import Callable
from great_expectations.cli.pretty_printing import cli_message
class Mark:
"""
Marks for feature readiness.
Usage:
from great_expectations.cli.mark import Mark as mark
@mark.blah
def your_function()
"""
@staticmethod
def c... | great-expectations/great_expectations | great_expectations/cli/mark.py | Python | apache-2.0 | 1,639 |
import logging
import os
import sys
PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
# Overrides for os.environ
env_ext = {'DJANGO_SETTINGS_MODULE': 'settings'}
def setup_env():
"""Configures app engine environment for command-line apps."""
# Try to import the appengine code from the... | MediaSapiens/wavesf | djangoappengine/boot.py | Python | bsd-3-clause | 7,691 |
from __future__ import absolute_import, print_function
import six
from datetime import timedelta
from django.db import models, transaction
from django.utils import timezone
from uuid import uuid4
from sentry.models.apiscopes import HasApiScopes
from sentry.db.models import (
Model, BaseManager, FlexibleForeignKe... | ifduyue/sentry | src/sentry/models/apitoken.py | Python | bsd-3-clause | 2,385 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | felipenaselva/felipe.repository | script.module.placenta/lib/resources/lib/indexers/episodes.py | Python | gpl-2.0 | 68,855 |
from .serialize import loads, dumps # noqa
# keep this file for BC
| google-research/ssl_detection | third_party/tensorpack/tensorpack/utils/compatible_serialize.py | Python | apache-2.0 | 69 |
#!/usr/bin/python
# Loading CellBase and configuration clients
from pycellbase.cbconfig import ConfigClient
from pycellbase.cbclient import CellBaseClient
# Initializing CellBaseClient
cc = ConfigClient("../conf/client-configuration.yml")
cbc = CellBaseClient(cc)
# Initializing gene client
gc = cbc.get_gene_client()... | opencb/cellbase | cellbase-app/app/scripts/pycellbase/gene_query.py | Python | apache-2.0 | 653 |
import urllib
import json
import shelve
import grequests
import traceback
from datetime import date, timedelta
from bans import create_image
__docformat__ = 'reStructuredText'
class League:
"""
Helper class for handling **lol** related requests received by the GanjaClient.
"""
def __init__(self, open_... | bvwman/GanjaBot-V2 | league.py | Python | mit | 20,177 |
import networkx as nx
import numpy as np
import pytest
import pyquil.simulation.matrices as qmats
from pyquil import Program
from pyquil.api import QuantumComputer
from pyquil.device import NxDevice
from pyquil.experiment import ExperimentSetting, Experiment, zeros_state
from pyquil.gates import CNOT, H, I, MEASURE, P... | rigetticomputing/pyquil | pyquil/simulation/tests/test_reference_density.py | Python | apache-2.0 | 13,541 |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
import requests
def get_proxy():
return requests.get("http://127.0.0.1:5000/get/").content
def get_all_proxy():
return requests.get("http://127.0.0.1:5000/get_all/").content
def delete_proxy(proxy):
return requests.get("http://127.0.0.1:5000/delete/{}".form... | bernieyangmh/spider | spider_y/common_method.py | Python | gpl-3.0 | 338 |
import os
import json
import argparse
from datetime import datetime
import heapq
#from customer_info import customer_info
#from time_frame import time_frame
class customer_info(object):
def __init__(self, customer_id):
# Customer ID
self.customer_id = customer_id
# Record all the orders
# HashMap<order_id, ... | xuwenyihust/Shutterfly-Customer-Lifetime-Value | src/clv.py | Python | mit | 5,329 |
"""
Copyright (c) 2015, 2018, 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import hashlib
from itertools import chain
import json
import io
import os
import re
import requests
from requests.exceptions imp... | DBuildService/atomic-reactor | atomic_reactor/util.py | Python | bsd-3-clause | 68,400 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.