text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# ftp-master-doc documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 4 21:44:03 2014.
#
# 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.
... | paultag/ftp-master-doc | doc/conf.py | Python | gpl-3.0 | 7,820 | 0.007545 |
import datetime
import hashlib
import itertools
import logging
import os
import time
from collections import defaultdict
from dataclasses import asdict, dataclass, field
from operator import itemgetter
from typing import (
IO,
AbstractSet,
Any,
Callable,
Collection,
Dict,
Iterable,
List,... | andersk/zulip | zerver/lib/actions.py | Python | apache-2.0 | 325,551 | 0.001554 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestWriteWorksheet(unittest.TestCase):
"""
... | jvrsantacruz/XlsxWriter | xlsxwriter/test/worksheet/test_write_worksheet.py | Python | bsd-2-clause | 887 | 0.001127 |
from collections import OrderedDict
import os
from os.path import abspath, dirname
from django.core.exceptions import ImproperlyConfigured
ENV_VARIABLE_PREFIX = 'LL'
def get_env_variable(var_name):
"""Get the environment variable or return exception"""
if not ENV_VARIABLE_PREFIX:
raise ImproperlyCon... | 596acres/django-livinglots-template | project_name/project_name/settings/base.py | Python | gpl-3.0 | 8,268 | 0.002056 |
import xdrlib
xdrlib._test()
| zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_xdrlib.py | Python | epl-1.0 | 30 | 0 |
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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... | rigetticomputing/grove | grove/pyqaoa/maxcut_qaoa.py | Python | apache-2.0 | 4,142 | 0.002414 |
#diferent_digits
while True:
try:
n1, n2 = map(int,raw_input().split())
n_casas = n2 - n1 + 1
n = 0
for i in range(n1, n2 + 1):
c = str(i)
c_nrep = set(c)
if len(c) != len(c_nrep):
n += 1
print n_casas - n
except: break
| clarammdantas/Online-Jugde-Problems | online_judge_solutions/diferent_digits.py | Python | mit | 250 | 0.068 |
from data import *
from draw import *
img, hiden_x = get_img_class()
print img.shape
print img
d_idx = np.random.randint(0, 50)
x_x, obs_x, obs_y, obs_tfs, new_ob_x, new_ob_y, new_ob_tf, imgs = gen_data()
print show_dim(x_x)
print show_dim(obs_x)
print show_dim(obs_y)
print show_dim(obs_tfs)
print show_dim(new_ob_... | evanthebouncy/nnhmm | mnist_haar/check_data.py | Python | mit | 735 | 0.006803 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.common.provider import cleanup_vm
from cfme.provisioning import do_vm_provisioning
from cfme.services import requests
from cfme.web_ui import fill
from utils import normalize_text, testgen
from utils.blockers import BZ
from utils.log import logger
from... | akrzos/cfme_tests | cfme/tests/infrastructure/test_provisioning.py | Python | gpl-2.0 | 7,759 | 0.003093 |
import logging
from shlex import quote
from findd.cli.widgets import hr
from findd.cli.widgets import ProgressBarManager
__LOG__ = logging.getLogger(__name__)
class BaseView(object):
def __init__(self, show_progressbars):
self.pbm = ProgressBarManager() if show_progressbars else None
def __enter__... | schnittstabil/findd | findd/cli/views.py | Python | mit | 1,481 | 0 |
#!/usr/bin/python
#-------------------------------------------------------------------------------
#License GPL v3.0
#Author: Alexandre Manhaes Savio <alexsavio@gmail.com>
#Grupo de Inteligencia Computational <www.ehu.es/ccwintco>
#Universidad del Pais Vasco UPV/EHU
#Use this at your own risk!
#-----------------------... | alexsavio/aizkolari | matrans.py | Python | bsd-3-clause | 10,313 | 0.029089 |
# Replaces the ctf values in input star file with the values in a reference star file
import argparse
import os
from star import *
def parse_args():
parser = argparse.ArgumentParser(description="Replaces the ctf values in input star file with the values in a reference star file.")
parser.add_argument('--input', me... | KryoEM/relion2 | python/star/replace_ctf.py | Python | gpl-2.0 | 2,295 | 0.031808 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from playhouse.migrate import migrate
from peewee import TextField
logger = logging.getLogger('data')
def forward(migrator):
migrate(
migrator.add_column('task', 'mode', TextField(default='uninitialize... | andrewhead/Package-Qualifiers | migrate/0002_add_column_task_mode.py | Python | mit | 386 | 0.002591 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
| kxepal/phoxpy | phoxpy/tests/modules/__init__.py | Python | bsd-3-clause | 216 | 0 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | datacommonsorg/data | scripts/eurostat/regional_statistics_by_nuts/population_density/PopulationDensity_preprocess_gen_tmcf.py | Python | apache-2.0 | 3,311 | 0.000604 |
import json
from idpproxy.social.oauth import OAuth
import oauth2 as oauth
#from xml.etree import ElementTree as ET
import logging
logger = logging.getLogger(__name__)
__author__ = 'rohe0002'
class LinkedIn(OAuth):
def __init__(self, client_id, client_secret, **kwargs):
OAuth.__init__(self, client_id, cli... | rohe/IdPproxy | src/idpproxy/social/linkedin/__init__.py | Python | bsd-2-clause | 1,002 | 0.002994 |
# 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... | mojwang/selenium | py/test/selenium/webdriver/common/results_page.py | Python | apache-2.0 | 1,408 | 0 |
import _plotly_utils.basevalidators
class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="showticklabels",
parent_name="contourcarpet.colorbar",
**kwargs
):
super(ShowticklabelsValidator, self).__init__(
... | plotly/plotly.py | packages/python/plotly/plotly/validators/contourcarpet/colorbar/_showticklabels.py | Python | mit | 476 | 0 |
import os
import sys
import time
import subprocess
import select
from optparse import make_option
from django.conf import settings
from django.db import connection
from django.core.cache import cache
from django.core.management.base import BaseCommand, CommandError
from wp_frontman.blog import Blog
from wp_frontman.... | ludoo/wpkit | attic/wpfrontman/wp_frontman/management/commands/wpf_maintenance.py | Python | bsd-3-clause | 9,051 | 0.007071 |
from setuptools import setup
from ngmaster import __version__
def readme():
with open('README.md', encoding='utf-8') as f:
return f.read()
setup(name='ngmaster',
version=__version__,
description='In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST)',
long_descri... | MDU-PHL/ngmaster | setup.py | Python | gpl-2.0 | 1,595 | 0.000627 |
import os, sys
import time
import unittest
import operator as ops
sys.path.append("..")
from baserecord import BaseRecord
from fields import StringField, IntegerField, DateTimeField, \
OneToManyRelation, FloatField, OptionField, ManyToOneRelation, \
ManyToManyRelation
from core import Database
fro... | daringer/pyORM | tests/field_ex_test.py | Python | gpl-2.0 | 1,954 | 0.013818 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | miumok98/weblate | weblate/accounts/management/commands/changesite.py | Python | gpl-3.0 | 2,417 | 0 |
# Copyright (C) 2008 Canonical Ltd
#
# 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 ... | Distrotech/bzr | bzrlib/tests/fake_command.py | Python | gpl-2.0 | 859 | 0 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-coral/project-keyword-spotter | mel_features.py | Python | apache-2.0 | 9,761 | 0.004815 |
# codegen.py
# Copyright (C) 2006, 2007, 2008, 2009, 2010 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
"""provides functionality for rendering a parsetree constructing into module source code."""... | codendev/rapidwsgi | src/mako/codegen.py | Python | gpl-3.0 | 39,495 | 0.007368 |
#!/usr/bin/env python
from plasTeX import Command, Environment, sourceChildren
from plasTeX.Base.LaTeX.Arrays import Array
from plasTeX.Base.LaTeX.Math import EqnarrayStar, equation, eqnarray, MathEnvironment
#### Imports Added by Tim ####
from plasTeX.Base.LaTeX.Math import math
class pmatrix(Array):
pass
class... | marcio-curl/EPUB-plasTeX | pacotes/amsmath.py | Python | lgpl-3.0 | 2,208 | 0.018569 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Vincent A
#
# 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, either version 3 of the License, or
# (at your opt... | yannrouillard/weboob | modules/lutim/browser.py | Python | agpl-3.0 | 1,503 | 0.000665 |
from __future__ import absolute_import
from django.contrib import admin
from django.contrib.admin.models import DELETION
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from django.utils.html import escape
from osf.models import AdminLogEntry
from osf.models import Admin... | TomBaxter/osf.io | admin/common_auth/admin.py | Python | apache-2.0 | 2,590 | 0.001544 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"debug camera"
__author__ = "baixue"
from ctypes import *
import os, sys
from time import sleep
from binascii import unhexlify
import serial
DIR_ROOT = os.getcwd()
HEADER = 'AABB'
ADDR = '01'
RELAY_NO = ['%02d' % (i+1) for i in range(16)]
# config camera info
GROUP_A... | baixuexue123/note | python/others/serialport/camera.py | Python | bsd-2-clause | 3,086 | 0.010313 |
# -*- coding: utf-8 -*-
"""
tests.views
~~~~~~~~~~~
Pluggable views.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import flask.views
from werkzeug.http import parse_set_header
def common_test(app):
c = app.test_client(... | dawran6/flask | tests/test_views.py | Python | bsd-3-clause | 6,085 | 0 |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | lmaycotte/quark | quark/db/migration/alembic/cli.py | Python | apache-2.0 | 7,166 | 0 |
# Author: Samuel Genheden, samuel.genheden@gmail.com
"""
Program to calculate how many water molecules are leaking into the membrane
"""
import argparse
import math
import numpy as np
from sgenlib import parsing
from sgenlib import mol
def _count_water_inside(dens1, dens2, fi, li, fx, lx) :
return sum(dens1[... | SGenheden/Scripts | Membrane/water_leakage.py | Python | mit | 3,011 | 0.008303 |
# Change the following to True to get a much more comprehensive set of tests
# to run, albeit, which take considerably longer.
full_tests = False
def test(fmt, *args):
print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<')
test("}}{{")
test("{}-{}", 1, [4, 5])
test("{0}-{1}", 1, [4, 5])
test("{1}-{0}", 1, [... | adamkh/micropython | tests/basics/string_format.py | Python | mit | 4,990 | 0.001603 |
# encoding: utf-8
"""Tests of Branding API """
from __future__ import unicode_literals
from django.test import TestCase
import mock
from branding.api import get_logo_url, get_footer
from django.test.utils import override_settings
class TestHeader(TestCase):
"""Test API end-point for retrieving the header. """
... | synergeticsedx/deployment-wipro | lms/djangoapps/branding/tests/test_api.py | Python | agpl-3.0 | 4,864 | 0.005345 |
def bulk_detect_face(images, detection_window_size_ratio, model, threshold, factor):
# im: input image
# minsize: minimum of faces' size
# pnet, rnet, onet: caffemodel
# threshold: threshold=[th1 th2 th3], th1-3 are three steps's threshold [0-1]
all_scales = [None] * len(images)
images_with_b... | liuzz1983/open_vision | openvision/facenet/align/bulk_detec_face.py | Python | mit | 9,832 | 0.00356 |
# prepare_receptors.py
# Create the .pdbqt files and receptors coordinates file of receptors
# for VinaMPI Docking
# Usage:
# python prepare_receptors.py
#
# Specify the correct paths of prepare_receptor4.py pythonsh VMD
# Make sure the get_AS_grid.tcl file uses the correct residue number
# of the active sites
# Run th... | Xiaofei-Zhang/NAMD_Docking_pipeline | pre_DOCKING/prepare_receptors.py | Python | mit | 1,588 | 0.015113 |
# Copyright (c) 2015-2019 Patricio Cubillos and contributors.
# pytips is open-source software under the MIT license (see LICENSE).
from .tips import __all__
from .tips import *
# Clean up top-level namespace--delete everything that isn't in __all__
# or is a magic attribute, and that isn't a submodule of this packa... | pcubillos/pytips | pytips/__init__.py | Python | mit | 491 | 0.002037 |
import bpy
from ... base_types.node import AnimationNode
class InvertNode(bpy.types.Node, AnimationNode):
bl_idname = "an_InvertNode"
bl_label = "Invert Boolean"
def create(self):
self.newInput("Boolean", "Input", "input")
self.newOutput("Boolean", "Output", "output")
def getExecution... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/boolean/invert_node.py | Python | gpl-3.0 | 368 | 0.002717 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tornado.web import RequestHandler, HTTPError
from schema import Session, Feed
from jinja2.exceptions import TemplateNotFound
class Base(RequestHandler):
@property
def env(self):
return self.application.env
def get_error_html(self, status_code, *... | mfussenegger/Huluobo | base.py | Python | mit | 1,242 | 0 |
from logbot.daemonizer import Daemonizer
from logbot.irc_client import IrcClient
from logbot.logger import Logger
from logbot.parser import Parser
| mlopes/LogBot | logbot/__init__.py | Python | mit | 147 | 0 |
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
]
} | agundy/Whiteboard | trackSchool/trackSchool/settings/common.py | Python | mit | 258 | 0.003876 |
# coding=utf-8
"""InaSAFE Wizard Step InaSAFE Raster Default Fields."""
# noinspection PyPackageRequirements
import logging
from parameters.qt_widgets.parameter_container import ParameterContainer
from safe import messaging as m
from safe.utilities.i18n import tr
from safe.common.parameters.default_value_parameter i... | Gustry/inasafe | safe/gui/tools/wizard/step_kw49_inasafe_raster_default_values.py | Python | gpl-3.0 | 7,187 | 0 |
#
# Module for starting a process object using os.fork() or CreateProcess()
#
# multiprocessing/forking.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
import os
import sys
import signal
from multiprocess import util, process
__all__ = ['Popen', 'assert_spawning', 'exit', 'duplicate', 'close', 'Forki... | seishei/multiprocess | py2.6/multiprocess/forking.py | Python | bsd-3-clause | 14,448 | 0.001453 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0003_auto_20150115_1939'),
]
operations = [
migrations.AddField(
model_name='calendalluser',
... | calendall/calendall | calendall/profiles/migrations/0004_auto_20150117_1017.py | Python | bsd-3-clause | 703 | 0.001422 |
'''
Flask-uWSGI-WebSocket
---------------------
High-performance WebSockets for your Flask apps powered by `uWSGI <http://uwsgi-docs.readthedocs.org/en/latest/>`_.
'''
__docformat__ = 'restructuredtext'
__version__ = '0.6.1'
__license__ = 'MIT'
__author__ = 'Zach Kelling'
import sys
from ._async import *
from ._uws... | zeekay/flask-uwsgi-websocket | flask_uwsgi_websocket/__init__.py | Python | mit | 1,032 | 0.012597 |
# coding=utf-8
__author__ = 'DM_'
import platform
import ctypes
import sys
USE_WINDOWS_COLOR = False
if platform.system() == "Windows":
USE_WINDOWS_COLOR = True
# #########################################
#windows color.
BLACK = 0x0
BLUE = 0x01
GREEN = 0x02
CYAN = 0x03
RED = 0x04
... | walkinreeds/MultiProxies | lib/EchoColor.py | Python | gpl-3.0 | 1,788 | 0.002237 |
# 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... | Lekensteyn/buildbot | master/buildbot/www/auth.py | Python | gpl-2.0 | 6,728 | 0.000297 |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame import *
from pygame.locals import *
import time
from colorsys import *
import sys
import json
import datetime
# scroll text across canopto. blocks. fg & bg are colors
def scrollText (canopto, text, fg = (0xFF, 0x33, 0xFF), bg = (0x00, 0x00, 0x00, 0... | fenceFoil/canopto | text.py | Python | bsd-3-clause | 3,088 | 0.038212 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | freedesktop-unofficial-mirror/gstreamer-sdk__cerbero | cerbero/bootstrap/__init__.py | Python | lgpl-2.1 | 1,054 | 0 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py | Python | mit | 4,057 | 0.003451 |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting tools/perf/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about th... | Just-D/chromium-1 | tools/perf/PRESUBMIT.py | Python | bsd-3-clause | 4,403 | 0.010902 |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 29 11:09:48 2015
@author: joris.berkhout@quintel.com & chael.kruip@quintel.com
"""
#==============================================================================
# This script can be used to generate typical domestic hot water (DHW) profiles
# for a period of one year a... | quintel/etmoses | scripts/power_to_heat/p2h_profile_generator.py | Python | mit | 7,575 | 0.011485 |
#!/usr/bin/python
"""
Every 30 minutes backs up database to S3. To recover the database, (i.e. reverse the process)
simply download the file from S3, un-tar it, and use the command:
(./)mongorestore --host {hostname} --port {port} path/to/dump/mongodump
where {hostname} and {port} are as they are below
"""
import sys... | lalitkumarj/NEXT-psych | next/database/database_backup.py | Python | apache-2.0 | 2,053 | 0.026303 |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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... | TribeMedia/synapse | tests/api/test_filtering.py | Python | apache-2.0 | 15,549 | 0.000064 |
# set S-JTSK axes orientation
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib.pyplot as plt
ax=plt.gca()
#ax.set_ylim(ax.get_ylim()[::-1])
# direction of axes
ax.invert_xaxis()
ax.invert_yaxis()
# ticks position
for tick in ax.xaxis.get_major_ticks():
tick.label1On = False
tick.label2... | gizela/gizela | example/matplotlib/axis.py | Python | gpl-3.0 | 782 | 0.021739 |
import sys
from _pydevd_bundle import pydevd_xml
from os.path import basename
import traceback
try:
from urllib import quote, quote_plus, unquote, unquote_plus
except:
from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimport @UnresolvedImport
#==============================================... | da1z/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_referrers.py | Python | apache-2.0 | 8,753 | 0.005141 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import smuggle_url
class AENetworksIE(InfoExtractor):
IE_NAME = 'aenetworks'
IE_DESC = 'A+E Networks: A&E, Lifetime, History.com, FYI Network'
_VALID_URL = r'https?://(?:www\.)?(?:(?:history|aetv|mylifetime)\.com|fyi\.... | dyn888/youtube-dl | youtube_dl/extractor/aenetworks.py | Python | unlicense | 2,401 | 0.002082 |
# -*- coding: utf-8 -*-
from pysignfe.xml_sped import *
from .Rps import IdentificacaoPrestador, IdentificacaoRps
import os
DIRNAME = os.path.dirname(__file__)
class MensagemRetorno(XMLNFe):
def __init__(self):
super(MensagemRetorno, self).__init__()
self.Codigo = TagCaracter(nome=u'Codigo', tama... | thiagopena/PySIGNFe | pysignfe/nfse/bhiss/v10/ConsultarSituacaoLoteRps.py | Python | lgpl-2.1 | 5,547 | 0.010817 |
import logging
try:
import queue
except ImportError: # pragma: no cover
import Queue as queue
import signal
import threading
import time
import six
from six.moves import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: #... | max00xam/service.maxxam.teamwatch | lib/engineio/client.py | Python | gpl-3.0 | 25,302 | 0.00004 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | aokolnychyi/spark | python/pyspark/shell.py | Python | apache-2.0 | 3,126 | 0.003199 |
'''
Implementation of the workflow used in :
Schaper,E. et al. (2014) Deep conservation of human protein tandem repeats within the eukaryotes. Molecular Biology and Evolution. 31, 1132–1148 .
'''
import logging
import logging.config
import os
from tral.paths import config_file, PACKAGE_DIRECTORY
from tral.sequence ... | elkeschaper/tral | tral/examples/example_workflow_MBE2014.py | Python | gpl-2.0 | 4,872 | 0.001643 |
# encoding: utf-8
#
# Copyright 2017 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 op... | unioslo/cerebrum | Cerebrum/modules/event_publisher/event.py | Python | gpl-2.0 | 11,579 | 0 |
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from .. import views
urlpatterns = [
url(r'^$',
views.NewWizardView.as_view(),
),
url(r'^new/$',
views.NewWizardView.as_view(),
name='wizard_new',
... | scattermagic/django-wizard-builder | wizard_builder/tests/urls.py | Python | bsd-3-clause | 534 | 0 |
def test_imprint(app, client):
app.config["SKYLINES_IMPRINT"] = u"foobar"
res = client.get("/imprint")
assert res.status_code == 200
assert res.json == {u"content": u"foobar"}
def test_team(client):
res = client.get("/team")
assert res.status_code == 200
content = res.json["content"]
... | skylines-project/skylines | tests/api/views/about_test.py | Python | agpl-3.0 | 664 | 0.001506 |
#!/usr/bin/env python3
"""
Created on 27 May 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import sys
import time
from scs_dfe.gas.isi.elc_dsi_t1 import ElcDSIt1
from scs_dfe.interface.interface_conf import InterfaceConf
from scs_host.bus.i2c import I2C
from scs_host.sys.host import Host
# ... | south-coast-science/scs_dfe_eng | tests/gas/isi/elc_dsi_t1_test.py | Python | mit | 1,580 | 0 |
from datetime import datetime, timedelta
from django import template
from package.models import Commit
from package.context_processors import used_packages_list
register = template.Library()
class ParticipantURLNode(template.Node):
def __init__(self, repo, participant):
self.repo = template.Variable(... | audreyr/opencomparison | package/templatetags/package_tags.py | Python | mit | 1,974 | 0.001013 |
# The MIT License (MIT)
#
# Copyright (c) 2015-2016 Massachusetts Institute of Technology.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | yvesalexandre/bandicoot | bandicoot/helper/tools.py | Python | mit | 8,941 | 0.000895 |
'''
ΪÁËÈÃÄãµÄ´úÂ뾡¿ÉÄÜ¿ì, µ«Í¬Ê±±£Ö¤¼æÈݵͰ汾µÄ Python ,Äã¿ÉÒÔʹÓÃÒ»¸öС¼¼ÇÉÔÚ cStringIO ²»¿ÉÓÃʱÆôÓà StringIO Ä£¿é, Èç ÏÂÀý Ëùʾ.
'''
try:
import cStringIO
StringIO = cStringIO
except ImportError:
import StringIO
print StringIO | iamweilee/pylearn | cstringio-example-2.py | Python | mit | 249 | 0.012048 |
#from distutils.core import setup
import setuptools
setuptools.setup(
name = 'p3270',
packages = ['p3270'],
version = '0.1.3',
description = 'Python library to communicate with IBM hosts',
author = 'Mossaab Stiri',
author_email = 'mossaab.stiri@gmail.com',
url = ... | mstiri/p3270 | setup.py | Python | gpl-3.0 | 1,698 | 0.014134 |
import ChromaPy32 as Chroma # Import the Chroma Module
from time import sleep
Keypad = Chroma.Keypad() # Initialize a new Keypad Instance
RED = (255, 0, 0) # Initialize a new color by RGB (RED,GREEN,BLUE)
Keypad.setbyRow(2, RED) # sets the whole third row of the Keyboad-Grid to red
Keypad.applyGrid() # applies... | Vaypron/ChromaPy | Example Scripts/Keypad/3. setbyRow.py | Python | mit | 370 | 0 |
import numpy as np
def test_levels_property(excitation_energy):
assert np.isclose(excitation_energy.ix[2].ix[0].ix[1], 3.17545416e-11)
def test_lines_property(lines):
assert np.isclose(lines.ix[564954]['wavelength'], 10833.307)
assert lines.index[124] == 564954
def test_lines_lower_level_index_property(l... | utkbansal/tardis | tardis/plasma/tests/test_property_atomic.py | Python | bsd-3-clause | 836 | 0.009569 |
__author__ = 'tester'
from sys import maxsize
import re
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s:%s:%s" % (self.id, self.na... | EwgOskol/python_training | model/group.py | Python | apache-2.0 | 683 | 0.002928 |
import os
import cv2
from crop_pictures import CropFace
file_dir = os.path.dirname(os.path.realpath(__file__))
cropped_photos_dir = os.path.join(file_dir,
'cropped_photos',
'')
eye_cascade_filepath = os.path.join(file_dir, 'haarcascade_eye.xml')
e... | benhoff/facebook_api_script | eye_aligner.py | Python | gpl-3.0 | 1,214 | 0.004942 |
import requests
from bs4 import BeautifulSoup
def trade_spider(max_pages):
page = 1
while page <= max_pages:
url = "https://thenewboston.com/videos.php?cat=98&video=20144" #+ str(page)
source_code = request.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
... | Tbear1981/bitcoin-overseer | files/webcrawler.py | Python | gpl-3.0 | 705 | 0.009929 |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... | f3at/feat | src/feat/test/integration/test_simulation_graph.py | Python | gpl-2.0 | 19,012 | 0.000263 |
#!/usr/bin/python
"""sc_initkey.py: utility script forS-CRIB Scramble device to format initialisation key
it requires input string of 40 hex characters - project sCribManager - Python."""
'''
@author: Dan Cvrcek
@copyright: Copyright 2013-14, Smart Crib Ltd
@credits: Dan Cvrcek
@license: GPL version 3 (e.g., https:/... | smartcrib/password-scrambler-ws | ScramblerTools/sc_initkey.py | Python | gpl-3.0 | 1,190 | 0.020168 |
#
# PRIVATE DATA
#
SECRET_KEY = ''
EMAIL_HOST_USER = ""
EMAIL_HOST_PASSWORD = ""
DEFAULT_FROM_EMAIL = ""
#
# SOCIAL
#
FACEBOOK_APP_ID = ''
FACEBOOK_API_SECRET = ''
TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''
LINKEDIN_CONSUMER_KEY = ''... | marco-lancini/Showcase | settings_private.py | Python | mit | 984 | 0.012195 |
from PySide import QtGui
from PySide.QtCore import Signal
from elo_button_row import EloButtonRow
from picture_area import PictureArea
class CentralWidget(QtGui.QWidget):
left_chosen = Signal()
right_chosen = Signal()
left_deleted = Signal()
right_deleted = Signal()
def __init__(self, left_image... | mmanhertz/elopic | elopic/ui/central_widget.py | Python | bsd-2-clause | 1,328 | 0 |
import os
import csv
import json
from tables.templates import (
ResponseTemplate
)
from seeders.base_seeder import BaseSeeder, print_delete_count
class TemplateSeeder(BaseSeeder):
def __init__(self, session):
BaseSeeder.__init__(self, session)
self.template_data = os.path.join(self.database_d... | Tactique/common | database/sql_scripts/seeders/template.py | Python | mit | 1,052 | 0.003802 |
#!/usr/bin/python2.4
#
# Copyright 2009 Empeeric LTD. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | katemsu/kate_website | kate3/utils/bitly.py | Python | mit | 6,991 | 0.013446 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from psd_tools import PSDImage
from psd_tools.constants import TaggedBlock, SectionDivider, BlendMode
from .utils import decode_psd
def test_1layer_name():
psd = decode_psd('1layer.psd')
layers = psd.layer_and_mask_data.layers.la... | stefanklug/psd-tools | tests/test_info.py | Python | mit | 1,195 | 0.005887 |
# output from elife04493.xml
expected = [
{
"mime-subtype": "mov",
"mimetype": "video",
"xlink_href": "elife04493v001.mov",
"content-type": "glencoe play-in-place height-250 width-310",
"component_doi": "10.7554/eLife.04493.007",
"type": "media",
"sibling_ordi... | elifesciences/elife-tools | tests/fixtures/test_media/content_07_expected.py | Python | mit | 7,974 | 0 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.DeadCrypter import DeadCrypter
class FiredriveCom(DeadCrypter):
__name = "FiredriveCom"
__type = "crypter"
__version = "0.03"
__pattern = r'https?://(?:www\.)?(firedrive|putlocker)\.com/share/.+'
__config = [] #@TODO: Remove in 0.4.10
... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/FiredriveCom.py | Python | gpl-3.0 | 474 | 0.012658 |
#!/usr/bin/env python
import qa
import re
import numpy
have_use = re.compile("^\s{1,12}use\s")
remove_warn = re.compile('''(?!.*QA_WARN .+)''', re.VERBOSE)
unwanted = re.compile("(\s|&|\n)", re.VERBOSE)
def do_magic(files, options):
name = files[0]
glob = []
temp = []
for f in files[2:]:
lin... | varadarajan87/piernik | bin/generate_public.py | Python | gpl-3.0 | 1,873 | 0.003203 |
from flask import Blueprint
admin = Blueprint("admin", __name__)
from . import views
| zengxs667/tiblog | asterisk/admin/__init__.py | Python | mit | 87 | 0.011494 |
from __future__ import unicode_literals
import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
def test_sts_get_session_token():
backend = server.create_backend_app("sts")
test_client = backend.test_client()
res = test_client.get('/?Action=GetSessionToken')
res... | botify-labs/moto | tests/test_sts/test_server.py | Python | apache-2.0 | 1,095 | 0 |
from telecommand import Telecommand
class GetCompileInfoTelecommand(Telecommand):
def __init__(self):
Telecommand.__init__(self)
def apid(self):
return 0x27
def payload(self):
return [] | PW-Sat2/PWSat2OBC | integration_tests/telecommand/compile_info.py | Python | agpl-3.0 | 236 | 0.004237 |
from kapteyn import maputils
from matplotlib import pylab as plt
import numpy
header = {'NAXIS' : 2, 'NAXIS1': 800, 'NAXIS2': 800,
'CTYPE1' : 'RA---TAN',
'CRVAL1' : 0.0, 'CRPIX1' : 1, 'CUNIT1' : 'deg', 'CDELT1' : -0.05,
'CTYPE2' : 'DEC--TAN',
'CRVAL2' : 0.0, 'CRPIX2' : 1, 'CUNI... | kapteyn-astro/kapteyn | doc/source/EXAMPLES/mu_externaldata.py | Python | bsd-3-clause | 977 | 0.0174 |
"""
This is an example settings/test.py file.
Use this settings file when running tests.
These settings overrides what's in settings/base.py
"""
from .base import *
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
"USER": "",
"PASSWORD": "",
... | oskarm91/sis | sis/settings/test.py | Python | bsd-3-clause | 435 | 0 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_spark_job_definition_operations.py | Python | mit | 45,127 | 0.005097 |
import os
import sys
import re
from bento.compat \
import \
inspect as compat_inspect
from bento.commands.core \
import \
command
SAFE_MODULE_NAME = re.compile("[^a-zA-Z_]")
__HOOK_REGISTRY = {}
__PRE_HOOK_REGISTRY = {}
__POST_HOOK_REGISTRY = {}
__COMMANDS_OVERRIDE = {}
__INIT_FUNCS = {}
def... | abadger/Bento | bento/commands/hooks.py | Python | bsd-3-clause | 3,935 | 0.00737 |
def main(i):
ins = i.split("\n")
arr = [int(i) for i in ins]
index =0
iterations = 0
while (index>=0 and index < len(arr)):
arr[index], index = arr[index] + 1, index + arr[index];
iterations = iterations+1
print(iterations)
def main2(i):
ins = i.split("\n")
arr = [int(i) for i in ins]
inde... | stanzheng/advent-of-code | 2017/day5/main.py | Python | apache-2.0 | 5,444 | 0.004041 |
# scan a set of file
from __future__ import print_function
import os
import fnmatch
import tempfile
from ScanFile import ScanFile
class FileScanner:
def __init__(self, handler=None, ignore_filters=None, scanners=None,
error_handler=None, ram_bytes=10 * 1024 * 1024,
skip_handler=None... | alpine9000/amiga_examples | tools/external/amitools/amitools/scan/FileScanner.py | Python | bsd-2-clause | 3,414 | 0.01406 |
# -*- coding: utf-8 -*-
from pyknyx.common.singleton import *
import unittest
# Mute logger
from pyknyx.services.logger import logging; logger = logging.getLogger(__name__)
from pyknyx.services.logger import logging
logger = logging.getLogger(__name__)
logging.getLogger("pyknyx").setLevel(logging.ERROR)
@six.add_me... | knxd/pKNyX | tests/common/singleton.py | Python | gpl-3.0 | 617 | 0.006483 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing M2M table for field guests on 'Event'
db.delete_table(db.shorten_name(u'rsvp_event_guests'))
... | gboone/wedding.harmsboone.org | rsvp/migrations/0020_auto__add_field_guest_hotel.py | Python | mit | 8,280 | 0.005797 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import os
from telemetry.core import util
from telemetry.core import memory_cache_http_server
from telemetry.testing ... | catapult-project/catapult | telemetry/telemetry/core/memory_cache_http_server_unittest.py | Python | bsd-3-clause | 3,837 | 0.001824 |
#!/usr/bin/python
# ------------------------------------------------------------------------------
# Copyright (C) 2012, Robert Johansson <rob@raditex.nu>, Raditex Control AB
# All rights reserved.
#
# This file is part of the rSCADA system.
#
# rSCADA
# http://www.rSCADA.se
# info@rscada.se
# ------------------------... | luminize/libcanopen | python/examples/canopen-dump.py | Python | bsd-3-clause | 649 | 0.001541 |
def rng():
pass | arun1729/road-network | rng/__init__.py | Python | mit | 19 | 0.052632 |
# coding: utf-8
from mnist import MNIST
import math
import numpy as np
import itertools
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from random import randint
def get_np_array(path='data'):
"""
Get images and install converter:
1. install MNIST from the command line with 'pip insta... | mlhhu2017/identifyDigit | marc/mnist_util.py | Python | mit | 5,121 | 0.004687 |
"""
Various containers.
"""
def recursion_lock(retval, lock_name = "__recursion_lock__"):
def decorator(func):
def wrapper(self, *args, **kw):
if getattr(self, lock_name, False):
return retval
setattr(self, lock_name, True)
try:
return fun... | mekolat/manachat | external/construct/lib/container.py | Python | gpl-2.0 | 6,139 | 0.00619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.