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 |
|---|---|---|---|---|---|
print("Hello from Python")
| cemc/safeexec | tests/hello.py | Python | agpl-3.0 | 27 |
"""Execute Ansible sanity tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import glob
import json
import os
import re
import collections
from .. import types as t
from ..util import (
ApplicationError,
SubprocessError,
display,
import_plugi... | thaim/ansible | test/lib/ansible_test/_internal/sanity/__init__.py | Python | mit | 35,939 |
from django.conf.urls.defaults import *
urlpatterns = patterns('apps.network.views',
url(r'^add/', 'add'),
url(r'^edit/', 'edit'),
url(r'^delete/(?P<pk>\d+)/', 'delete'),
url(r'^(?P<pk>\d+)/', 'overview'),
url(r'$', 'index'),
)
| jawr/kontrolvm | apps/network/urls.py | Python | mit | 239 |
import os
import sys
from Bio.Seq import Seq
def main(*args, **kwargs):
fpath = os.path.join(os.getcwd(), args[-2])
tmp = []
with open(fpath,'r') as f:
for line in f:
txt = line.strip()
tmp.append(txt)
S1 = set(tmp)
S2 = set([str(Seq(s).reverse_complement()) for s ... | crf1111/Bio-Informatics-Learning | Bio-StrongHold/src/Constructing_a_De_Bruijn_Graph.py | Python | mit | 685 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2015 SciFabric LTD.
#
# PyBossa 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 License, or
# (at your op... | geotagx/pybossa | test/test_web.py | Python | agpl-3.0 | 167,235 |
import urllib.request
from html.parser import HTMLParser
def get_refs_list(filename):
refs_source_file = open(filename, 'r')
refs_source_list = []
line_index = 0
recording = False
current_entry = ""
for line in refs_source_file:
line_index += 1
l = line.strip()
if l == "" or l[0] == "#":
# Skip ... | ConradCB/DBLPTeX | bib_generator.py | Python | unlicense | 2,318 |
#!/usr/bin/python
#
# Teleportation quantum circuit simulation proof-of-concept
# Copyright (C) 2008 Robert Nowotniak
#
# Based on:
# [Bras98] Gilles Brassard. Teleportation as a quantum computation. 1998
#
from numpy import *
from random import random
from math import *
import sys
s2 = sqrt(2) / 2
# basic quant... | rnowotniak/qclib | old/teleportation.py | Python | gpl-3.0 | 2,982 |
#!/usr/bin/env python
"""A script to prepare the source tree for building."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# This script must have no special requirements because it wont be able to
# import any GRR ... | dunkhong/grr | grr/proto/makefile.py | Python | apache-2.0 | 2,468 |
from __future__ import print_function
from __future__ import unicode_literals
import re
import time
import socket
from netmiko.cisco_base_connection import CiscoSSHConnection
class HPProcurveSSH(CiscoSSHConnection):
def session_preparation(self):
"""
Prepare the session after the connection has b... | shamanu4/netmiko | netmiko/hp/hp_procurve_ssh.py | Python | mit | 2,061 |
"""
WSGI config for locallibrary 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("DJANGO... | evan-mp/django_local_library | locallibrary/wsgi.py | Python | gpl-3.0 | 582 |
# coding=utf-8
"""This file, docker_api.py, provides a wrapper abstraction for Docker containers (over a 3rd party abstraction)."""
from libraries.python.common_traits.trait_name import TraitName
from libraries.python.universal_utilities.system import colored_output as L
from time import sleep
class Container(Tra... | utarsuno/quasar_source | libraries/python/docker/container.py | Python | mit | 1,660 |
"""
Django settings for openshift 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, ...)
i... | snocorp/meansweep | wsgi/openshift/settings.py | Python | mit | 3,625 |
"""Methods for running the Terminal GUI"""
import argparse
import json
import sys
import os
import datetime
import logging
import threading
from collections import OrderedDict as odict
import numpy as np
from PySide2 import QtCore, QtGui, QtSvg, QtWidgets
from autopilot import prefs
from autopilot.core import styles
... | wehr-lab/RPilot | autopilot/core/terminal.py | Python | gpl-3.0 | 33,971 |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The American Gut Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------... | squirrelo/american-gut-web | amgut/lib/util.py | Python | bsd-3-clause | 9,073 |
from optparse import OptionParser
import os,sys
from oldowan.mitotype.matcher import HVRMatcher
from oldowan.mitotype.prevalidate import prevalidate_submission
def run_command():
"""Perform automated human mtDNA haplotype identification."""
# Set up the options parser
usage = "usage: %prog [options] sequ... | ryanraaum/oldowan.mitotype | oldowan/mitotype/commandline.py | Python | mit | 3,160 |
from sip import *
from random import *
###################### defines: ############################
true=1
false=0
###################### MAIN WIDGETS: #######################
def getMainControl():
return MainControl.getInstance(0)
def getMolecularStructure():
return MolecularStructure.getInstance(0)
def getMolecu... | tkemmer/ball | data/startup.py | Python | lgpl-2.1 | 9,387 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""yamltodb - generate SQL statements to update a PostgreSQL database
to match the schema specified in a YAML file"""
from __future__ import print_function
import sys
from argparse import FileType
import yaml
from pyrseas import __version__
from pyrseas.database import D... | dvarrazzo/Pyrseas | pyrseas/yamltodb.py | Python | bsd-3-clause | 3,088 |
from abc import ABCMeta, abstractmethod
from typing import List
from minesweeper.common.values import Board, CellType, InvalidBoard
from minesweeper.create_minefield import CreateMinefieldUseCase
class CreateBoardUseCaseObserver(metaclass=ABCMeta):
@abstractmethod
def did_create_board(self,
... | wileykestner/minesweeper | minesweeper/create_board.py | Python | mit | 1,404 |
from django.core.urlresolvers import reverse
from django.http import HttpResponseBadRequest
from django.views.generic import View
from pulp.server import exceptions as pulp_exceptions
from pulp.server.auth import authorization
from pulp.server.db import model
from pulp.server.db.model.consumer import ConsumerGroup
fro... | rbramwell/pulp | server/pulp/server/webservices/views/consumer_groups.py | Python | gpl-2.0 | 15,945 |
import os, json, logging
import shared
from subprocess import Popen, CalledProcessError
import multiprocessing
from tools.shared import check_call
stdout = None
stderr = None
def call_process(cmd):
proc = Popen(cmd, stdout=stdout, stderr=stderr)
proc.communicate()
if proc.returncode != 0:
# Deliberately do ... | slightperturbation/Cobalt | ext/emsdk_portable/emscripten/1.27.0/tools/system_libs.py | Python | apache-2.0 | 23,035 |
#!/usr/bin/python
#
# 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 b... | cctaylor/googleads-python-lib | examples/dfp/v201505/line_item_service/get_line_items_by_statement.py | Python | apache-2.0 | 2,425 |
#!/cygdrive/c/Python27
# 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
# "L... | GabrielBrascher/cloudstack | tools/apidoc/gen_toc.py | Python | apache-2.0 | 9,699 |
from odoo import api, models
class AccountMove(models.Model):
_inherit = "account.move"
@api.onchange("partner_id")
def _onchange_partner_id(self):
res = super(AccountMove, self)._onchange_partner_id()
self._onchange_partner_shipping_id()
return res
@api.onchange("partner_shi... | OCA/account-fiscal-rule | account_avatax_sale/models/account_move.py | Python | agpl-3.0 | 536 |
# -*- coding: utf-8 -*-
import hr_employee
import hr_operational_department
import res_users
| xcgd/hr_streamline | model/__init__.py | Python | agpl-3.0 | 93 |
"""
URLs for the CCX Feature.
"""
from django.conf.urls import url
import ccx.views
urlpatterns = [
url(r'^ccx_coach$', ccx.views.dashboard, name='ccx_coach_dashboard'),
url(r'^create_ccx$', ccx.views.create_ccx, name='create_ccx'),
url(r'^save_ccx$', ccx.views.save_ccx, name='save_ccx'),
url(r'^ccx_i... | lduarte1991/edx-platform | lms/djangoapps/ccx/urls.py | Python | agpl-3.0 | 909 |
"""Visualize the outcome of computer experiment.
TODOs
-----
Explore Parameterspace3D
see: http://matplotlib.org/examples/mplot3d/contour3d_demo3.html
fig = plt.figure()
ax = fig.gca(projection="3d")
ax.plot_surface(X, Y, values, rstride=1, cstride=1, alpha=0.3,
cmap=cm.PiYG)
cs... | wbarfuss/pymofa | pymofa/experiment_visualization.py | Python | mit | 3,206 |
# -*- coding: utf-8 -*-
# © 2016-TODAY LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo.tests.common import TransactionCase
import mock
model_file = 'openerp.addons.base_fax.models.fax_adapter'
model = '%s.FaxAdapter' % model_file
class TestFaxAdapter(TransactionCase):
... | laslabs/odoo-telephony | base_fax/tests/test_fax_adapter.py | Python | agpl-3.0 | 2,569 |
from enum import Enum
from typing import Sequence, List
from PyQt5 import QtWidgets, QtCore
from .spacerselector_ui import Ui_Dialog
class SpacerSelectorDialog(QtWidgets.QDialog, Ui_Dialog):
class TargetTypes(Enum):
L1= 1
L2=2
FlightPipes=3
spacers: List[float]
title: str
ta... | awacha/cct | cct/qtgui2/setup/geometry/spacerselector.py | Python | bsd-3-clause | 1,431 |
#!/usr/bin/env python
from pyqlight import QLight
from collections import OrderedDict
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
def main():
parser = ArgumentParser(description="control a Q-Light warning tower. "
"All lamps should have red, yellow and green "
... | cryptk/pyqlight | pyqlight/command_line.py | Python | mit | 3,294 |
# Copyright (c) 2020, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import fields
import cybox.bindings.unix_network_route_entry_object as unix_network_route_entry_binding
from cybox.common import String, UnsignedInteger, UnsignedLong
from cybox.objects.network_route_en... | CybOXProject/python-cybox | cybox/objects/unix_network_route_entry_object.py | Python | bsd-3-clause | 967 |
from Screens.Wizard import WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Wizard import wizardManager
from Screens.Rc import Rc
from Screens.Screen import Screen
from Components.Label import Label
from Components.MenuList import MenuList
from Components.PluginComponent import plugins
from ... | postla/e2-gui | lib/python/Plugins/SystemPlugins/SoftwareManager/ImageWizard.py | Python | gpl-2.0 | 6,107 |
import unittest
from collections import namedtuple
from io import BytesIO
import codecs
import sha2
import hmac
class TestSHA2(unittest.TestCase):
# test vectors from https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values
TestVector = namedtuple('TestVector', ['digestcls', 'text'... | olbat/o1b4t | coding/crypto/test_hmac.py | Python | gpl-3.0 | 10,162 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-aiplatform | google/cloud/aiplatform_v1/services/migration_service/async_client.py | Python | apache-2.0 | 21,005 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
#------------------------------------------------------------
import selenium
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import time
import urlparse,urllib2,urllib,re,... | Reat0ide/plugin.video.pelisalacarta | pelisalacarta/channels/itastreaming.py | Python | gpl-3.0 | 11,292 |
from dotenv import load_dotenv
load_dotenv('./.env') | mbernson/iscp-search-engine | retrouve/__init__.py | Python | gpl-3.0 | 53 |
"""
Management commands for third_party_auth
"""
import logging
from django.core.management.base import BaseCommand, CommandError
from common.djangoapps.third_party_auth.tasks import fetch_saml_metadata
class Command(BaseCommand):
""" manage.py commands to manage SAML/Shibboleth SSO """
help = '''Configur... | edx/edx-platform | common/djangoapps/third_party_auth/management/commands/saml.py | Python | agpl-3.0 | 1,687 |
# Now we refactor star_thompsonlike.py into lower-level code. Instead
# of a set, the states are a list, together with a boolean array
# ('occupied') saying for each state whether it's on the list. We
# represent the set with this combo of datastructures to make it
# efficient both to enumerate the states in the set a... | darius/regexercise_solutions | star_thompsonlike_lowlevel.py | Python | gpl-3.0 | 2,044 |
from django.conf.urls import url
from django.contrib.admin.utils import quote
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from wagtail.contrib.modeladmin.options import ModelAdmin
from wagtail.contrib.modeladmin.helpers import ButtonHelper
from wagtailmenus.con... | rkhleics/wagtailmenus | wagtailmenus/modeladmin.py | Python | mit | 4,086 |
""" SQLAlchemy support. """
from __future__ import absolute_import
import datetime
from types import GeneratorType
import decimal
from sqlalchemy import func
# from sqlalchemy.orm.interfaces import MANYTOONE
from sqlalchemy.orm.collections import InstrumentedList
from sqlalchemy.sql.type_api import TypeDecorator
try:... | Nebucatnetzer/tamagotchi | pygame/lib/python3.4/site-packages/mixer/backend/sqlalchemy.py | Python | gpl-2.0 | 8,887 |
from rest_framework import viewsets
from web_db.models import Album, Song
from web_endpoints.serializers import AlbumSerializer, SongSerializer
class AlbumViewSet(viewsets.ModelViewSet):
queryset = Album.objects.all()
serializer_class = AlbumSerializer
class SongViewSet(viewsets.ModelViewSet):
queryse... | octaflop/django_music | apps/web_endpoints/views.py | Python | mit | 381 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "Anscombe", sigma = 0.0, exog_count = 100, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Anscombe/trend_PolyTrend/cycle_7/ar_12/test_artificial_1024_Anscombe_PolyTrend_7_12_100.py | Python | bsd-3-clause | 266 |
# -*- coding: utf-8 -*-
import numpy as np
from scipy import linalg
from copy import deepcopy
from ..bem import _check_origin
from ..io.constants import FIFF
from ..io.pick import pick_types, pick_info
from ..surface import get_head_surf, get_meg_helmet_surf
from ..io.proj import _has_eeg_average_ref_proj, make_proj... | cmoutard/mne-python | mne/forward/_field_interpolation.py | Python | bsd-3-clause | 16,212 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
try:
import boto
except ImportError: # pragma: no cover
boto = Attributes = BatchResults = None # noqa
class _void(object):
pass
regions = SQSConnection = Queue = _void
RawMessage = Message = MHMessage = \... | Elastica/kombu | kombu/async/aws/sqs/ext.py | Python | bsd-3-clause | 907 |
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* ... | bblacey/FreeCAD-MacOS-CI | src/Mod/Test/TestApp.py | Python | lgpl-2.1 | 4,356 |
import numpy as np
""" This is an adhoc integrator made for DDE"""
class myintegrator:
def __init__(self,D,dt,N,tmax):
self.npts=np.floor(D/dt)+1 # points delay
self.dt=dt
self.N=N
self.tmax=tmax
self.D=D
self.fast=True
def DDE_Inh(self,f,x0,uI0,W0,WEI0,stim):
'''In this method we use the ... | ulisespereira/PereiraBrunel2016 | figure7/myintegrator.py | Python | gpl-2.0 | 1,422 |
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | apyrgio/synnefo | snf-webproject/setup.py | Python | gpl-3.0 | 5,921 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "5.0.6"
| lfalcao/thumbor | thumbor/__init__.py | Python | mit | 316 |
import time
from bitalino import BITalino
# The macAddress variable on Windows can be "XX:XX:XX:XX:XX:XX" or "COMX"
# while on Mac OS can be "/dev/tty.BITalino-XX-XX-DevB" for devices ending with the last 4 digits of the MAC address or "/dev/tty.BITalino-DevB" for the remaining
macAddress = "00:00:00:00:00:00"
# Thi... | BITalinoWorld/revolution-python-api | samples/sample.py | Python | gpl-3.0 | 1,152 |
class Manager(object):
_user = None
_enabled = True
_user_required = True
def set_user_required(self, user_required):
self._user_required = user_required
def get_user_required(self):
return self._user_required
def set_user(self, user):
self._user = user
def get_u... | dz0ny/vaultier | vaultier/libs/version/context.py | Python | bsd-3-clause | 1,091 |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | looooo/pivy | scons/scons-local-1.2.0.d20090919/SCons/Options/PathOption.py | Python | isc | 2,773 |
# Copyright 2013-2021 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)
from spack import *
class PyPytimeparse(PythonPackage):
"""A small Python library to parse various kinds of time exp... | LLNL/spack | var/spack/repos/builtin/packages/py-pytimeparse/package.py | Python | lgpl-2.1 | 585 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from .data_l... | nistormihai/superdesk-core | apps/common/models/io/base_proxy.py | Python | agpl-3.0 | 2,002 |
#!/usr/bin/env python
"""
Test of the HDF storage for the Tables API.
Copyright 2009 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import unittest, os, tempfile, exceptions, time
import omero.columns
import omero.tables
import portalocker
import log... | joshmoore/openmicroscopy | components/tools/OmeroPy/test/tablestest/hdfstorage.py | Python | gpl-2.0 | 6,978 |
__author__ = 'cag2as'
from helper import greeting
#calls from helper
greeting("hello")
| cag2as/cs3240-labdemo | hello.py | Python | mit | 90 |
# -*- coding: utf-8 -
#
# 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, software
... | JoseKilo/bucky | bucky/metrics/gauge.py | Python | apache-2.0 | 922 |
# Version string following PEP 386
# http://www.python.org/dev/peps/pep-0386/
__version__ = "0.6"
| seanbrant/django-queued-storage | queued_storage/__init__.py | Python | bsd-3-clause | 98 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
from django.db import migrations, models
import articl... | albertoconnor/website | articles/migrations/0001_initial.py | Python | mit | 7,175 |
import numpy as np
from falass import readwrite, dataformat
import os
class Job():
"""The catch all.
This class is used for setting up the falass job -- and is generally a catch all for inputs that do not fit into
other parts.
Parameters
----------
files: falass.readwrite.Files
A Fil... | arm61/falass | falass/job.py | Python | mit | 8,517 |
import unittest
from stratuslab_usecases.cli.TestUtils import sshConnectionOrTimeout
import BasicVmLifecycleTestBase
class testVmIsAccessibleViaSsh(BasicVmLifecycleTestBase.BasicVmTestBase):
vmName = 'ttylinux'
def test_usecase(self):
sshConnectionOrTimeout(self.ip_addresses[0])
def suite():
... | StratusLab/use-cases | src/main/python/stratuslab_usecases/api/testVmIsAccessibleViaSsh.py | Python | apache-2.0 | 398 |
import os
import shutil
from bears.vcs.CommitBear import _CommitBear
from coala_utils.ContextManagers import change_directory
from coalib.misc.Shell import run_shell_command
class HgCommitBear(_CommitBear):
LANGUAGES = {'Hg'}
CAN_DETECT = {'Formatting'}
ASCIINEMA_URL = 'https://asciinema.org/a/3Kfn2EDjYL... | coala/coala-bears | bears/vcs/mercurial/HgCommitBear.py | Python | agpl-3.0 | 779 |
NAME='capture'
GCC_LIST=['v4l']
| unbit/uwsgi-capture | uwsgiplugin.py | Python | mit | 32 |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Designed For QingDao Xiangjie Company
# Powered By Rainsoft(QingDao) Author:Kevin Kong 2014 (kfx2007@163.com)
#
# This program is free software: you can redistribute it and/or modify
# it under ... | kevin8909/xjerp | openerp/addons/Rainsoft_Xiangjie/wizard/rainsoft_partner_update_credit.py | Python | agpl-3.0 | 1,527 |
from django.core.urlresolvers import reverse # noqa
from django import http
from mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from novaclient.v1_1 import flavors
class FlavorsTests(test.BaseAdminViewTests):
@test.create_stubs({api.nova: ('flavo... | deepakselvaraj/federated-horizon | openstack_dashboard/dashboards/admin/flavors/tests.py | Python | apache-2.0 | 10,073 |
# -*- test-case-name: twisted.test.test_ftp -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An FTP protocol implementation
@author: Itamar Shtull-Trauring
@author: Jp Calderone
@author: Andrew Bennetts
"""
# System Imports
import os
import time
import re
import operator
impo... | eunchong/build | third_party/twisted_10_2/twisted/protocols/ftp.py | Python | bsd-3-clause | 93,283 |
from pycp2k.inputsection import InputSection
class _each140(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Just_energy = None
self.Powell_opt = None
self.Qs_scf = None
self.Xas_scf = None
self.Md = None
self.Pint = None
self.Meta... | SINGROUP/pycp2k | pycp2k/classes/_each140.py | Python | lgpl-3.0 | 1,114 |
# -*- coding: utf-8 -*-
import os
import time
import struct
import json
import requests
from requests import exceptions
from werkzeug.urls import url_fix
from collections import OrderedDict
from pysteamkit.protobuf import steammessages_clientserver_pb2
from pysteamkit.steam_base import EMsg, EResult
from pysteamkit.s... | adamb70/CSGO-Market-Float-Finder | FloatGetter.py | Python | mit | 12,393 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | yvaucher/account-financial-tools | __unported__/account_credit_control/wizard/credit_control_communication.py | Python | agpl-3.0 | 8,761 |
#!/usr/bin/env python
# Copyright (C) 2011-2019 Alexandre Gramfort
# <alexandre.gramfort@inria.fr>
import os
import os.path as op
from setuptools import setup
# get the version (don't import mne here, so dependencies are not needed)
version = None
with open(op.join('mne', '_version.py'), 'r') as fid:
for line i... | Teekuningas/mne-python | setup.py | Python | bsd-3-clause | 3,898 |
# -*- coding: utf-8 -*-
#!/usr/bin/python2.7
#description :This file creates a plot: Number of contributers and their cummulated percentage of contributions. This is calculated for object-creations and -edits ordered (DESC) by contributions
#author :Christopher Barron @ http://giscience.uni-hd.de/
#date ... | zehpunktbarron/iOSMAnalyzer | scripts/c7_user_created_edited_98.py | Python | gpl-3.0 | 6,716 |
RPI_USER_AGENT = "Raspberry Pi WS"
SITE_SERVER_ADDRESS = "127.0.0.1:8000"
SITE_USER_AGENT = "Raspberry Site"
HMAC_TOKEN = "super secret token"
| blaisejarrett/PiIO.WS | rpi_ws/settings.py | Python | gpl-3.0 | 143 |
#! /usr/bin/python
#
# train_model.py
# used to create a training model and store it in data.inl
#
#
BATCH_SIZE = 100
from subprocess import call
import json
import string
call( "rm train ; g++ -o train train_model.cpp -std=c++0x" , shell=True)
o = json.loads(open("../training_data.json","r").read())
para... | theshark08/howtobreakacaptcha01 | src/train_model.py | Python | mit | 592 |
# django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2010 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | nekohayo/snowy | lib/django_openid_auth/models.py | Python | agpl-3.0 | 2,355 |
import os
import sys
from pprint import pprint
from resources.terrain import TerrainFile
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: t.py <filename>")
print(sys.argv)
sys.exit()
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | joetsoi/moonstone | python/terrain.py | Python | agpl-3.0 | 533 |
"""Cache"""
# standard library
import logging
from datetime import datetime, timedelta
from typing import Callable, Optional
# third-party
import arrow
from requests import Session
# first-party
from tcex.api.tc.v2.datastore.datastore import DataStore
from tcex.utils import Utils
# get tcex logger
logger = logging.g... | ThreatConnect-Inc/tcex | tcex/api/tc/v2/datastore/cache.py | Python | apache-2.0 | 7,077 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 Simone Donadello
#
# 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) an... | simondona/exp-control-bec-tn | libraries/command.py | Python | gpl-3.0 | 2,495 |
# Copyright (c) 2016-2018, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
"""Mempool handling."""
import asyncio
import itertools
import time
from abc import ABC, abstractmethod
from asyncio import Lock, sleep
from collections... | lbryio/lbry | torba/torba/server/mempool.py | Python | mit | 13,901 |
import unittest
from etk.extractors.spacy_ner_extractor import SpacyNerExtractor
class TestSpacyNerExtractor(unittest.TestCase):
def test_spacy_ner_extractor(self) -> None:
get_attr = ['PERSON', 'ORG', 'GPE']
extractor = SpacyNerExtractor(extractor_name='spacy_ner_extractor')
text = 'Napo... | usc-isi-i2/etk | etk/unit_tests/test_spacy_ner_extractor.py | Python | mit | 2,668 |
# This file contains default config info for downloading and installing dictionaries
# The template placeholders are filled by setup.py.
# Local path for dictionaries
default_dict_path = r'$path'
# path for the metadata file
default_dict_info_path = ur'$path'
# URL of the repository for dictionaries
default_reposi... | GraceJonn123/github-resources | PyHyphen-2.0.5/2.x/config.py | Python | mit | 831 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | jonparrott/google-cloud-python | logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py | Python | apache-2.0 | 32,657 |
# Django settings for test_remote_project project.
import os.path
import posixpath
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
FIXTURE_DIRS = [
os.path.join(PROJECT_ROOT, 'fixtures'... | dsanders11/django-autocomplete-light | test_remote_project/test_remote_project/settings.py | Python | mit | 5,785 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pubmed.py -- tools for identifying pubmed papers, retrieving citation data for pubmed papers, and loading those
papers into VIVO
"""
import logging
import httplib
__author__ = "Michael Conlon"
__copyright__ = "Copyright (c) 2016 Michael Conlon"
__license__ = "... | mconlon17/vivo-pump | pubmed/pubmed.py | Python | bsd-2-clause | 10,551 |
"""
Django settings for voting_framework project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Bui... | jwebbed/student-voting-framework | voting_framework/settings.py | Python | gpl-3.0 | 2,750 |
import pdb
import numpy as np
import cPickle as pickle
from utils import black
from utils import loggen
#from astropy.cosmology import FlatLambdaCDM
from astropy.cosmology import Planck15 as cosmo
import astropy.units as u
from lmfit import Parameters, minimize, fit_report
L_sun = 3.839e26 # W
c = 299792458.0 # m/s
d... | marcoviero/Utils | invert_sed.py | Python | mit | 12,970 |
# This file is part of Checkmate.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distribute... | esrefozturk/checkmate | CheckmateServerTests/test1-2.py | Python | gpl-3.0 | 1,343 |
import logging
from .Parameter import Parameter
from .Statement import Statement, InsertStatement, SelectStatement
logger = logging.getLogger('Procedure').print_pos
class Procedure(object):
READ = 'READ'
WRITE = 'WRITE'
@property
def is_read(self):
return self.mode == self.READ
@proper... | bmstu-iu9/mill-db | pymilldb/context/Procedure.py | Python | mit | 1,431 |
from django.conf.urls import patterns, include, url
from matches import urls
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^', include(urls)),
# url(r'^Dota2Stats/', include('Dota2Stats.foo.urls')... | mmbob/Dota2Stats | Dota2Stats/urls.py | Python | mit | 568 |
""""""
import os
import abc
import sys
import logging
# environment variable for configuration
CONFIG_ENV_VAR = "CONFIG"
LOGGER_NAME = "logger_for_template" # CHOOSE YOUR OWN NAME FOR YOUR APP
def configure_logging(log_level):
"""Configure a logger with sane datetime and path info for the calling function"""
... | ianozsvald/python_template_with_config | python_template_with_config/config.py | Python | mit | 2,420 |
"""
Mouse events.
How it works
------------
The renderer has a 2 dimensional grid of mouse event handlers.
(`prompt_toolkit.layout.MouseHandlers`.) When the layout is rendered, the
`Window` class will make sure that this grid will also be filled with
callbacks. For vt100 terminals, mouse events are received through ... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/prompt_toolkit/mouse_events.py | Python | bsd-2-clause | 1,380 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/monitor/operations/log_analytics_cluster.py | Python | mit | 2,202 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
unescapeHTML,
)
class BlipTVIE(InfoExtractor):
_VALID_URL = ... | Nikoli/youtube-dl | youtube_dl/extractor/bliptv.py | Python | unlicense | 10,506 |
from unittest import TestCase
import numpy as np
from numpy.linalg import inv
from tcontrol.statespace import *
from tcontrol.transferfunction import *
from ..model_conversion import *
from ..exception import WrongNumberOfArguments
from ..discretization import c2d
from .tools.test_utility import assert_ss_equal
clas... | DaivdZhang/tinyControl | tcontrol/tests/test_statespace.py | Python | bsd-3-clause | 5,656 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011, 2013 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
# Li... | crepererum/invenio | invenio/ext/email/errors.py | Python | gpl-2.0 | 1,187 |
from .deviceaction import *
from .uiobjectaction import *
from .adbfunction import *
from .device import *
from .devicemanage import *
from .frameworkkey import *
from .flow import Flow
from .configparser import *
from .testtemplate import *
from .otherdatastruct import *
from .cmdlineparser import *
from .xmlfile imp... | libyoung/yaya-engine | yaya/__init__.py | Python | mit | 2,298 |
#!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 limi... | sasmita/upm | examples/python/grovewfs.py | Python | mit | 2,489 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... | ubuntu/ubuntu-make | tests/data/duplicatedframeworks/samecategory.py | Python | gpl-3.0 | 1,683 |
# encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __f... | klahnakoski/Bugzilla-ETL | vendor/pyLibrary/aws/s3.py | Python | mpl-2.0 | 16,082 |
#coding: utf-8
__author__ = 'zheng'
import re
import tornado.gen
from tornado.httpclient import AsyncHTTPClient
from BeautifulSoup import BeautifulSoup
from chat.handler import BaseHandler
class TumblrHandler(BaseHandler):
@tornado.gen.coroutine
def get(self):
http_client = AsyncHTTPClie... | yunlzheng/chat | chat/handler/tumblr.py | Python | mit | 664 |
#!/usr/bin/env python
#
# 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
# ... | mgoulish/qpid-dispatch | tools/scraper/parser.py | Python | apache-2.0 | 51,059 |
import httplib
from pyamf import AMF0, AMF3
from pyamf import remoting
from pyamf.remoting.client import RemotingService
height = 1080
def build_amf_request(const, playerID, videoPlayer, publisherID):
env = remoting.Envelope(amfVersion=3)
env.bodies.append(
(
"/1",
remotin... | aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.kidsplace/brightcovePlayer.py | Python | apache-2.0 | 1,587 |
#!/usr/bin/env python
# Copyright 2005-2009,2011 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import glob
import os
import shutil
import sys
import subprocess
impor... | LordSputnik/mutagen | setup.py | Python | gpl-2.0 | 9,430 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.