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 |
|---|---|---|---|---|---|
import unittest
from programy.config.file.factory import ConfigurationFactory
from programy.config.client.client import ClientConfiguration
class ConfigurationFactoryTests(unittest.TestCase):
def test_guess_format_from_filename(self):
config_format = ConfigurationFactory.guess_format_from_filename("file.... | dkamotsky/program-y | src/test/config/file/test_factory.py | Python | mit | 1,628 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | pgmillon/ansible | lib/ansible/module_utils/network/common/network.py | Python | gpl-3.0 | 8,128 |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | pyfa-org/eos | tests/integration/effect_mode/force_stop/test_active.py | Python | lgpl-3.0 | 5,056 |
# -*- coding: utf-8 -*-
"""Download helper object implementations."""
from __future__ import unicode_literals
import re
from l2tdevtools.download_helpers import project
class GitHubReleasesDownloadHelper(project.ProjectDownloadHelper):
"""Helps in downloading a project with GitHub releases."""
_VERSION_EXPRES... | rgayon/l2tdevtools | l2tdevtools/download_helpers/github.py | Python | apache-2.0 | 9,673 |
# Copyright (c) 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | li-ma/homework | decorator/lockdb.py | Python | apache-2.0 | 1,874 |
# Utilities to generate Unicode data for glibc from upstream Unicode data.
#
# Copyright (C) 2014, 2015 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License a... | lbxl2345/glibc | localedata/unicode-gen/unicode_utils.py | Python | gpl-2.0 | 21,965 |
from challenge import Challenge
import flask
class c1(Challenge):
'''
Challenge 1
Hidden element with CSS
'''
def __init__(self):
super()
self._id = 'f6fd1656d79b06918bb5cf85c8bae58c3884deaf'
self._hints = {1: 'CSS'}
def get_response(self, app):
return app.send... | GunshipPenguin/billionaire_challenge | challenges/c1.py | Python | mit | 350 |
#!/usr/bin/python
from gi.repository.LibHdateGlib import Hdate
h = Hdate.new()
h.set_use_hebrew(True)
print (h.to_string());
| yaacov/libhdate-glib | examples/test.py | Python | gpl-3.0 | 127 |
import os, sys
PATH = os.path.join(os.path.dirname(__file__), '..')
sys.path += [
os.path.join(PATH, 'project/apps'),
os.path.join(PATH, 'project'),
os.path.join(PATH, '..'),
PATH]
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings.production'
import django.core.handlers.wsgi
application = django.core.hand... | claudiob/pypeton | pypeton/files/django/deploy/django_wsgi_production.py | Python | mit | 344 |
"""
WSGI config for dynamic_forms project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | aruntakkar/dj-dynamic-forms | dynamic_forms/wsgi.py | Python | mit | 404 |
from base64 import b64decode
from datetime import datetime
from email.parser import FeedParser
from email.utils import parseaddr, parsedate
from optparse import make_option
import socket
import sys
import time
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models... | 66eli77/fle-home | fle_site/apps/articles/management/commands/check_for_articles_from_email.py | Python | mit | 12,511 |
from __future__ import unicode_literals
import datetime
import os
from decimal import Decimal
from unittest import skipUnless
import warnings
from django import forms
from django.core.exceptions import FieldError, NON_FIELD_ERRORS
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validato... | DrMeers/django | tests/model_forms/tests.py | Python | bsd-3-clause | 81,728 |
#!/usr/bin/env python
#codign:utf-8
import sys
import os
def main():
while True:
try:
cmd = raw_input("% ")
cmd = cmd.strip().lower()
print cmd
if cmd == 'q':
print "Bye!"
sys.exit()
argv = cmd.split()
... | matrix65537/xgo | src/python/bin/fork.py | Python | mit | 753 |
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | tlakshman26/cinder-bug-fix-volume-conversion-full | cinder/tests/unit/api/v2/stubs.py | Python | apache-2.0 | 8,750 |
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# utils
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.six import iteritems
from ansible_collections.ansible.... | azaghal/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/utils/utils.py | Python | gpl-3.0 | 5,828 |
from JumpScale import j
class EventHandler:
def __init__(self):
self.__jslocation__ = "j.events"
def bug_critical(self, msg, source=""):
"""
will die
@param e is python error object when doing except
"""
print("change your code to no longer use j.events...., b... | Jumpscale/jumpscale_core8 | lib/JumpScale/core/errorhandling/EventHandler.py | Python | apache-2.0 | 1,381 |
# Copyright 2021 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 o... | GoogleCloudPlatform/declarative-resource-client-library | python/services/compute/alpha/interconnect.py | Python | apache-2.0 | 18,818 |
# *****************************************************************************
#
# 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
#
# ... | Thrameos/jpype | test/jpypetest/test_classhints.py | Python | apache-2.0 | 2,899 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='WebsiteContact',
fields=[
('id', models.AutoFie... | omerturner/manakinproducts | contact/migrations/0001_initial.py | Python | mit | 618 |
# SCBdo : DISC Track Racing Management Software
# Copyright (C) 2010 Nathan Fraser
#
# 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 ... | gusgollings/scbdo | scbdo/uscbsrv.py | Python | gpl-3.0 | 14,259 |
from . import test_website_event_questions_template
| OCA/event | website_event_questions_template/tests/__init__.py | Python | agpl-3.0 | 52 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-present, CloudZero, Inc. All rights reserved.
# Licensed under the BSD-style license. See LICENSE file in the project root for full license information.
import requests_mock
from reactor.utils.slack import SlackWeb
def test_slack_message_no_webhook():
slack = SlackWeb... | Cloudzero/cloudzero-reactor-aws | test/unit/utils/test_slack.py | Python | bsd-3-clause | 2,274 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | kayhayen/Nuitka | tests/standalone/PmwUsing.py | Python | apache-2.0 | 1,051 |
from signedheaders import add_signed_header, HeaderSignatureCheckingMiddleware
import os
def test_header_signing():
environ = {'morx' : 'fleem'}
add_signed_header(environ, 'REMOTE_USER', 'ausername', 'secret')
assert environ['morx'] == 'fleem'
assert 'HTTP_REMOTE_USER_SIGNED' in environ
header = en... | socialplanning/signedheaders | signedheaders/test.py | Python | gpl-3.0 | 1,132 |
"""Virial isotherm model."""
import numpy
from scipy import optimize
from pygaps import logger
from pygaps.graphing.calc_graphs import virial_plot
from pygaps.modelling.base_model import IsothermBaseModel
from pygaps.utilities.exceptions import CalculationError
class Virial(IsothermBaseModel):
r"""
A virial... | pauliacomi/pyGAPS | src/pygaps/modelling/virial.py | Python | mit | 8,794 |
import io
import struct
from address import Address
def is_unit_stub(program, offset):
return program[offset] == 0xcd and \
program[offset + 1] == 0x3f and \
program[offset + 2] == 0x00 and \
program[offset + 3] == 0x00
class Unit(object):
def __init__(self, program, offset, overla... | patriksevallius/dcc_ng | overlay.py | Python | gpl-3.0 | 2,770 |
# -*- coding: utf-8 -*-
import sys
from optparse import OptionParser;
from xml.dom import minidom;
import re
import os
import csv
import hashlib
import shutil
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import HorizonBuildFileUtil
from HorizonBuildFileUtil import HorizonBuildFileUtil
import subpr... | dorgonman/HorizonBuildTool | HorizonBuildTool/Source/HorizonCMakeBuild/HorizonCMakeBuild.py | Python | mit | 16,320 |
import hashlib
from itertools import count, groupby, islice
def find_sequences(s):
for c, g in groupby(s):
yield c, len(list(g))
def hashes(salt):
salt_h = hashlib.new("md5", salt)
for i in count():
h = salt_h.copy()
h.update(str(i).encode("ascii"))
yield h.hexdigest()
de... | suprzer0/aoc2016 | day14/solve.py | Python | mit | 989 |
"""
WSGI config for nest project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... | ImmaculateObsession/nest | nest/wsgi.py | Python | mit | 1,418 |
def add(a, b):
return a + b
def
| punch2177-cmis/punch2177-cmis-cs2 | structure.py | Python | cc0-1.0 | 34 |
# Clang Compiler
from bit.compiler.cc import CC
class Clang(CC):
def __init__(self, project_name):
CC.__init__(self, project_name)
self.executable = 'clang'
def __str__(self):
return 'Clang'
@property
def CXX(self):
self.executable = 'clang++'
sel... | am0d/bit | bit/compiler/clang.py | Python | bsd-3-clause | 341 |
"""set inbox folder exposed name
Revision ID: 52a9a976a2e0
Revises: 40629415951c
Create Date: 2014-05-15 22:57:47.913610
"""
# revision identifiers, used by Alembic.
revision = '52a9a976a2e0'
down_revision = '40629415951c'
from sqlalchemy.ext.declarative import declarative_base
def upgrade():
from inbox.model... | EthanBlackburn/sync-engine | migrations/versions/029_set_inbox_folder_exposed_name.py | Python | agpl-3.0 | 904 |
from .benchmark import run_benchmark
| mgabay/Variable-Size-Vector-Bin-Packing | vsvbp/__init__.py | Python | gpl-3.0 | 37 |
'''
Created on Nov 6, 2011
@author: ajju
'''
from xoze.snapvideo import VideoHost, Video, STREAM_QUAL_SD
from xoze.utils import http
import re
def getVideoHost():
video_host = VideoHost()
video_host.set_icon('http://www.digitaldeparture.com/wp-content/images/zshare.jpg')
video_host.set_name('ZShare')
... | JRepoInd/plugin.video.tvondesizonexl | xoze/snapvideo/ZShare.py | Python | gpl-3.0 | 1,119 |
"""calc.py: A simple Python calculator."""
import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__ == '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif c... | martaenciso/calc | calc.py | Python | bsd-3-clause | 529 |
# -*- coding: utf-8 -*-
"""
Linear chain of reactions.
"""
from __future__ import print_function, division
import tellurium as te
model = '''
model feedback()
// Reactions:
J0: $X0 -> S1; (VM1 * (X0 - S1/Keq1))/(1 + X0 + S1 + S4^h);
J1: S1 -> S2; (10 * S1 - 2 * S2) / (1 + S1 + S2);
J2: S2 -> S3; (10 * S2... | kirichoi/tellurium | examples/tellurium-files/linearChain.py | Python | apache-2.0 | 685 |
from crispy_forms.utils import render_field
from django.template.loader import render_to_string
from crispy_forms.layout import TEMPLATE_PACK
class BaseTable(object):
template = "%s/table_elements.html" % TEMPLATE_PACK
def __init__(self, *fields, **kwargs):
self.fields = fields
if hasattr(s... | basilfx/BierApp-Server | lib/crispy_forms_extra/layout.py | Python | gpl-3.0 | 1,055 |
import re
from django.utils.translation import get_language
from django.conf import settings
from models import Language
from utils import get_default_language
lang_pattern = '|'.join([i[0] for i in settings.LANGUAGES])
def languages(request):
"""
This context processor adds three context variables::
... | yawd/yawd-translations | translations/context_processors.py | Python | bsd-3-clause | 1,306 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | huiyiqun/check_mk | cmk_base/inventory_plugins.py | Python | gpl-2.0 | 6,568 |
import os
import click
from flask.cli import FlaskGroup
from . import create_app, db
def create_cli_app(info):
return create_app()
@click.group(cls=FlaskGroup, create_app=create_cli_app)
@click.option('--debug', is_flag=True, default=False)
def cli(debug):
if debug:
os.environ['FLASK_DEBUG'] = '1'... | bovarysme/whisper | whisper/commands.py | Python | mit | 524 |
#!/usr/bin/env python
"""Tests for the raw_doc module."""
__author__ = 'Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>'
# TODO(holtgrew): Implement test for Class, Function, Metafunction, Macro, Page, Group, Tag.
import unittest
import seqan.dox.lexer as lexer
import seqan.dox.raw_doc as raw_doc
class TestDoxFo... | holtgrewe/seqan | util/py_lib/seqan/dox/test/test_raw_doc.py | Python | bsd-3-clause | 22,062 |
# vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Sof... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/ibus/application.py | Python | mit | 1,350 |
from .file_watch import init_app
| LonglyCode/flask-blog | app/Watch/__init__.py | Python | mit | 33 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Christophe Benz, Romain Bignon, John Obbele, Nicolas Duhamel
#
# This file is part of weboob.
#
# weboob 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,... | franek/weboob | weboob/applications/videoob/videoob.py | Python | agpl-3.0 | 7,480 |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.forms import ModelForm
from vice.models import Vice, GiftCard
class ViceForm(ModelForm):
class Meta:
model = Vice
fields = ('user', 'sponsor', 'end_date',)
class ... | ViceVersusMe/ViceVersus | ViceVersus/vice/forms.py | Python | mit | 459 |
#!/usr/local/bin/python2.7
from os import environ
environ['KERAS_BACKEND'] = 'tensorflow'
import numpy as np
import utils
top_arr = np.load('/home/snarayan/hscratch/baconarrays/v3/RSGluonToTT_M_1000_13TeV_pythia8_Output_job3_file0_4_singletons.npy')[:,5]
qcd_arr = np.load('/home/snarayan/hscratch/baconarrays/v3/QCD... | sidnarayanan/BAdNet | train/pf/testplot.py | Python | mit | 804 |
#!/usr/bin/env python
'''
Use Paramiko to retrieve the entire 'show version' output.
'''
import paramiko
import time
from getpass import getpass
MAX_BUFFER = 65535
def clear_buffer(remote_conn):
'''
Clear any data in the receive buffer
'''
if remote_conn.recv_ready():
return remote_conn.recv(... | ayosef/pynet_test | class4_ex1.py | Python | apache-2.0 | 1,621 |
import os, sys, pprint
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings
PROJECT_NAME = settings.SETTINGS_MODULE.split('.')[0]
class Command(BaseCommand):
requires_model_validation = False
option_list = BaseCommand.option_list ... | mark0978/deployment | deployment/management/commands/show_configuration.py | Python | mit | 1,790 |
import urlparse
from services.common import UrlError
from services.youtube import resolve as youtube_resolve
from services.vimeo import resolve as vimeo_resolve
YOUTUBE_HOSTNAMES = ( "youtu.be", "youtube.com" )
VIMEO_HOSTNAMES = ( "vimeo.com" )
def resolve(url):
parts = urlparse.urlparse(url)
if parts... | jwmcglynn/videosync | server/video_resolver.py | Python | isc | 1,033 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | Petr-Kovalev/nupic-win32 | tests/unit/py2/nupic/math/array_algorithms_test.py | Python | gpl-3.0 | 1,533 |
import xml.dom.minidom
import sys
sys.path.append('py')
import ColladaScene
import ColladaAnim
import os
import shutil
import re
#matchThis = '.'
matchThis = 'space-station'
outFolder = './json/'
#if os.path.exists(outFolder[:-1]):
# shutil.rmtree(outFolder[:-1])
#os.makedirs(outFolder[:-1])
fileHandle = open(outFo... | operasoftware/Odin | ColladaExport.py | Python | bsd-3-clause | 2,086 |
#!/usr/bin/env python
import unittest
from test import support
import smtplib
support.requires("network")
class SmtpSSLTest(unittest.TestCase):
testServer = 'smtp.gmail.com'
remotePort = 465
def test_connect(self):
support.get_attribute(smtplib, 'SMTP_SSL')
server = smtplib.SMTP_SSL(self... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_smtpnet.py | Python | mit | 494 |
# Copyright (C) 2008 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at you... | mytliulei/DCNRobotInstallPackages | windows/win32/paramiko-1.14.0/tests/test_auth.py | Python | apache-2.0 | 8,501 |
"""Support for alarm control panels that can be controlled through IFTTT."""
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import DOMAIN, PLATFORM_SCHEMA
from homeassistant.components.alarm_control_panel... | qedi-r/home-assistant | homeassistant/components/ifttt/alarm_control_panel.py | Python | apache-2.0 | 6,305 |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | enthought/etsproxy | enthought/util/math.py | Python | bsd-3-clause | 1,984 |
import socket
import time
import httplib
import sys
from urllib import urlencode
from threading import Lock, Event
from django.conf import settings
from django.core.cache import cache
from graphite.node import LeafNode, BranchNode
from graphite.readers import FetchInProgress
from graphite.logger import log
from graphit... | g76r/graphite-web | webapp/graphite/remote_storage.py | Python | apache-2.0 | 8,686 |
#!/usr/bin/env python
"""
Usage:
find-package.py --repourl=<repo-url> --package=<package-name> [--env|--iam] [--debug] [--filter=<filter>]
Attributes:
--repourl=<repourl> -r Repository URL eg. https://BUCKET_NAME.s3.amazonaws.com/cent6/
--package=<package-name> -p Package name to search for... | bemehow/yum-s3-tools | scripts/find-package.py | Python | apache-2.0 | 1,355 |
"""Unit test for Treadmill ZK apptrace module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import time
import sqlite3
import mock
import kazoo
import kazoo.client
from treadmill.apptrace impo... | bretttegart/treadmill | tests/apptrace/zk_test.py | Python | apache-2.0 | 14,073 |
#!/usr/bin/env python
"""\
Tabhouse
A site to find quality guitar tabs.
"""
from datetime import datetime
from logging import error, info
from logging.config import dictConfig
from urllib import urlencode
from flask import (Flask, g, request, render_template, redirect, url_for,
jsonify)
from raven.contrib.flask i... | joeyespo/tabhouse.org | tabhouse.py | Python | mit | 2,454 |
import synapse.lib.module as s_module
class MediaMod(s_module.CoreModule):
@staticmethod
def getBaseModels():
modl = {
'types': (
('media:news', {'subof': 'guid', 'doc': 'A GUID for a news article or report'}),
# TODO types and forms...
# ('m... | vivisect/synapse | synapse/models/media.py | Python | apache-2.0 | 2,187 |
#!/usr/bin/env python
#-*-coding:utf-8-*-
'''
The number, 1406357289, is a 0 to 9 pandigital number
because it is made up of each of the digits 0 to 9 in some order,
but it also has a rather interesting sub-string divisibility property.
Let d1 be the 1st digit, d2 be the 2nd digit, and so on.
In this way, we note the... | smrmkt/project_euler | problem_043.py | Python | mit | 1,303 |
# coding: utf-8
from __future__ import unicode_literals
import re
import base64
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_parse_qs,
)
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
unsmuggle_url,
smuggle_url,
)
class KalturaIE(InfoEx... | hakatashi/youtube-dl | youtube_dl/extractor/kaltura.py | Python | unlicense | 15,137 |
##############################################################################
# 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... | lgarren/spack | var/spack/repos/builtin/packages/r/package.py | Python | lgpl-2.1 | 8,023 |
from pycp2k.inputsection import InputSection
class _pade1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self._name = "PADE"
self._attributes = ['Section_parameters']
| SINGROUP/pycp2k | pycp2k/classes/_pade1.py | Python | lgpl-3.0 | 253 |
import psycopg2
from Sequence import ScenarioSequence
class Scenario(object):
"""A simple example class"""
_id_name = "scenario_id"
_table_name = "scenario"
_insert_order = """
(scenario_id ,
algorithm_type ,
benchmark_type ,
config_id,
scenario_description )"""
#scenario ... | CG-F16-16-Rutgers/steersuite-rutgers | steerstats/steersuitedb/Scenario.py | Python | gpl-3.0 | 2,417 |
import mock
import pytest
from django.utils import timezone
from nose.tools import * # flake8: noqa
from datetime import datetime
from framework.guid.model import Guid
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from tests.base import ApiTestCase
from osf_tests.factories... | mluo613/osf.io | api_tests/comments/views/test_comment_report_list.py | Python | apache-2.0 | 16,506 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import re
import webapp2
import jinja2
import logging
import StringIO
from markupsafe import Markup, escape # https://pypi.python.org/pypi/MarkupSafe
import parsers
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
from google.ap... | URXtech/schemaorg | sdoapp.py | Python | apache-2.0 | 66,116 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon/polyaxon | core/polyaxon/polyflow/containers/__init__.py | Python | apache-2.0 | 683 |
import os
import sys
from setuptools import setup, find_packages
from setuptools import find_packages, setup
import sys
import os
def local_file(name):
return os.path.relpath(os.path.join(os.path.dirname(__file__), name))
SOURCE = local_file("src")
README = local_file("README.rst")
setup(
name='conjecture'... | gardnervickers/conjecture | bindings/python/setup.py | Python | gpl-3.0 | 1,049 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/scripts/dataspec.py | Python | gpl-2.0 | 1,548 |
import logging
import datetime
from flask import Blueprint, render_template, request, abort, redirect, url_for, jsonify
from . import db
from .db import session_scope
logger = logging.getLogger("quoted-forsooth.source")
source = Blueprint('source', __name__)
source_types = {
'source' : db.Source,
'epis... | sopoforic/quoted-forsooth | source.py | Python | mit | 12,028 |
import unittest
from streamlink.stream import StreamIOIterWrapper
class TestPluginStream(unittest.TestCase):
def test_iter(self):
def generator():
yield b"1" * 8192
yield b"2" * 4096
yield b"3" * 2048
fd = StreamIOIterWrapper(generator())
self.assertEq... | beardypig/streamlink | tests/streams/test_stream_wrappers.py | Python | bsd-2-clause | 655 |
# -*- coding: utf-8 -*-
from collections import defaultdict
from unittest import SkipTest
from nose import with_setup
from clustertools.environment import Environment
from clustertools.experiment import Computation
from clustertools.storage import Storage, Architecture, PickleStorage
__author__ = "Begon Jean-Michel... | jm-begon/clustertools | clustertools/test/util_test.py | Python | bsd-3-clause | 4,400 |
#!/usr/bin/env python
###
# Copyright (c) 2002-2007 Systems in Motion
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS I... | bleepbloop/Pivy | examples/Mentor/05.3.TriangleStripSet.py | Python | isc | 4,616 |
#!/usr/bin/env python
# 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 program is distributed in the hope that i... | sacsant/avocado-misc-tests | fs/fsx.py | Python | gpl-2.0 | 3,750 |
#!/usr/bin/env python3
#################################################
# Theseus Services automatic deployment script #
# (~ ACE3 8e9c275) #
# ============================================= #
# This is not meant to be run directly! #
##############################################... | kotaco/SpartanTacticalPMC | tools/deploy.py | Python | gpl-2.0 | 2,139 |
# -*- coding: utf-8 -*-
#
# Python JiraClient documentation build configuration file, created by
# sphinx-quickstart on Thu May 17 12:12:09 2012.
#
# 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 fil... | Badger32d/JiraClient | docs/conf.py | Python | gpl-3.0 | 7,935 |
# 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 u... | mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/topi/python/topi/x86/nn.py | Python | apache-2.0 | 1,803 |
#!/usr/bin/env python3
from flask import Flask, request, render_template
import os
import json
import time
import datetime
from smarthomemongo import SmartHomeDB
app = Flask(__name__)
smartDB = SmartHomeDB()
@app.route('/')
def index():
records = smartDB.getCurrentStats('raspberry')
if( 'timestamp' in records.keys... | bharath2020/SmartHome | temperature_server.py | Python | apache-2.0 | 1,401 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AppraisalRateScoreCard(Document):
pass | gangadhar-kadam/hrerp | erpnext/hr/doctype/appraisal_rate_score_card/appraisal_rate_score_card.py | Python | agpl-3.0 | 266 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from decimal import Decimal
import django
from django.utils import six
from django.core.exceptions import ValidationError
from django.core.serializers import serialize, deserialize
from django.forms import modelform_factory
from django.test... | escer/django-collectionfield | collectionfield/tests/tests.py | Python | mit | 48,972 |
import logging.config
import os
import platform
from datetime import datetime
from requests import Request, Session
from bs4 import BeautifulSoup
logging.config.fileConfig('logging.conf')
logr = logging.getLogger('pylog')
google_url = 'https://duckduckgo.com/'
def main():
logr.info('start')
try:
... | ajeetmurty/ReferenceCode | python/src/ajeetmurty/reference/http/html_parser.py | Python | mit | 1,613 |
##Copyright 2009 Thomas Paviot (tpaviot@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your opti... | tpaviot/pythonocc-core | src/Display/backend.py | Python | lgpl-3.0 | 6,828 |
# 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 pytest
from pages.firefox.browsers.browser_history import BrowserHistoryPage
@pytest.mark.nondestructive
@pyte... | MichaelKohler/bedrock | tests/functional/firefox/browsers/test_browser_history.py | Python | mpl-2.0 | 633 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools for loading example datasets, from both
within photutils and remote servers.
"""
from urllib.error import HTTPError, URLError
from astropy.io import fits
from astropy.table import Table
from astropy.utils.data import downlo... | astropy/photutils | photutils/datasets/load.py | Python | bsd-3-clause | 9,209 |
def load(info):
import plugin_module
plugin_module.test()
| adsorensen/girder | tests/packaging/entry_point_json_plugin/entry_point_json_plugin.py | Python | apache-2.0 | 66 |
import os
import subprocess
import sys
from redash.query_runner import *
def query_to_script_path(path, query):
if path != "*":
script = os.path.join(path, query.split(" ")[0])
if not os.path.exists(script):
raise IOError("Script '{}' not found in script directory".format(query))
... | moritz9/redash | redash/query_runner/script.py | Python | bsd-2-clause | 2,419 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | nzlosh/st2 | st2client/tests/unit/test_util_misc.py | Python | apache-2.0 | 1,737 |
import sys
import gevent
from locust.env import Environment
from locust.event import EventHook
from locust.log import setup_logging
from locust.stats import stats_printer
from locustfile import StudioDesktopBrowserUser
setup_logging("DEBUG", None)
def error_output(*args, **kwargs):
print("Error: {}, {}".format(ar... | DXCanas/content-curation | performance/run_perftests.py | Python | mit | 975 |
"""
Converter contrib is managing migrating from another controller.
"""
from pyplanet.contrib.converter.expansion import ExpansionConverter
from pyplanet.contrib.converter.xaseco2 import Xaseco2Converter
from pyplanet.contrib.converter.uaseco import UasecoConverter
from pyplanet.contrib.converter.maniacontrol import M... | PyPlanet/PyPlanet | pyplanet/contrib/converter/__init__.py | Python | gpl-3.0 | 677 |
#!/usr/bin/env python
"""Test case."""
import os
import subprocess
import sys
try:
import unittest2 as unittest # Python 2.6
except ImportError:
import unittest
ROOT_DIR = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
sys.path.append(ROOT_DIR)
class Tests(unittest.TestCase):
def test_s... | aeszter/heatmap | test/test_shp_file.py | Python | agpl-3.0 | 916 |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | sebgoa/kubeless | vendor/github.com/google/go-jsonnet/cpp-jsonnet/case_studies/micromanage/util.py | Python | apache-2.0 | 1,098 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | xzturn/tensorflow | tensorflow/python/keras/saving/saved_model/load.py | Python | apache-2.0 | 39,955 |
# -*- coding: utf-8 -*-
import re
import os
import random
from six.moves import cPickle
import six
from smart_qq_bot.logger import logger
from smart_qq_bot.signals import (
on_all_message,
on_group_message,
)
TUCAO_PATH = 'smart_qq_plugins/tucao/'
class TucaoCore(object):
def __init__(self):
se... | renothing/SmartQQBot | src/smart_qq_plugins/tucao.py | Python | gpl-3.0 | 5,444 |
#
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... | mandeepdhami/netvirt-ctrl | sdncon/clusterAdmin/tests/urls.py | Python | epl-1.0 | 1,708 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Chinmaya Pancholi <chinmayapancholi13@gmail.com>
# Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Scikit learn interface for gensim for easy use of gensim with scikit-lear... | markroxor/gensim | gensim/sklearn_api/lsimodel.py | Python | lgpl-2.1 | 3,449 |
from __future__ import unicode_literals
import io
import os
import subprocess
import time
import re
from .common import AudioConversionError, PostProcessor
from ..compat import (
compat_subprocess_get_DEVNULL,
)
from ..utils import (
encodeArgument,
encodeFilename,
get_exe_version,
is_outdated_v... | luceatnobis/youtube-dl | youtube_dl/postprocessor/ffmpeg.py | Python | unlicense | 23,848 |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | guillaume-philippon/aquilon | tools/build_schema_htdocs.py | Python | apache-2.0 | 8,911 |
from scipy.optimize import fmin_ncg, fmin_tnc
import __main__
import numpy
import pylab
import sys
sys.path.append('/home/antolikjan/topographica/Theano/')
import theano
from theano import tensor as T
from topo.misc.filepath import normalize_path, application_path
from contrib.modelfit import *
import contrib.dd
impor... | jesuscript/topo-mpi | contrib/JanA/SCM.py | Python | bsd-3-clause | 10,507 |
# coding=utf8
from . import http
user = {
"username": "test",
"password": "1234",
}
def test_register():
# http.post('user/register', json=user)
pass
| docloud/fourmilk | tests/test_users.py | Python | mit | 170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.