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 |
|---|---|---|---|---|---|---|
def action_vakai_load_more(context, action, parent_entity_bundle, last_id, parent_entity_id, **args):
try:
parent_entity_type = 'Vakai'
parent_entity_id = int(parent_entity_id)
last_id = int(last_id)
output = Object()
db = IN.db
connection = db.connection
# TODO: paging
# get total
... | vinoth3v/In | In/vakai/page/load_more.py | Python | apache-2.0 | 2,553 | 0.061888 |
# Klippy WebHooks registration and server connection
#
# Copyright (C) 2020 Eric Callahan <arksine.code@gmail.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license
import logging, socket, os, sys, errno, json, collections
import gcode
REQUEST_LOG_SIZE = 20
# Json decodes strings as unicode ty... | KevinOConnor/klipper | klippy/webhooks.py | Python | gpl-3.0 | 20,782 | 0.001203 |
# -*- coding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
pytestmark = pytest.mark.django_db
global_footer_links = [
'About',
'Developers',
'Privacy',
'Report an issue',
]
def assert_title_and_links_on_page(browser, url, title, links_text):
browser.visit(url)
assert... | vipul-sharma20/fossevents.in | tests/frontend/test_page_contents.py | Python | mit | 869 | 0.002301 |
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
class MassMailController(http.Controller):
@http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none')
def track_mail_open(self, mail_id, **post):
""" Email tracking. """
mail_mail_stats... | 3dfxsoftware/cbss-addons | mass_mailing/controllers/main.py | Python | gpl-2.0 | 2,342 | 0.005978 |
# coding: utf-8
"""
mistune
~~~~~~~
The fastest markdown parser in pure Python with renderer feature.
:copyright: (c) 2014 by Hsiaoming Yang.
"""
import re
import inspect
__version__ = '0.4.1'
__author__ = 'Hsiaoming Yang <me@lepture.com>'
__all__ = [
'BlockGrammar', 'BlockLexer',
'InlineGra... | neuroo/equip | examples/sample-test-program/test_module/mistune.py | Python | apache-2.0 | 31,391 | 0 |
# -*- coding: utf-8 -*-
#
# zambiaureport documentation build configuration file, created by
# sphinx-quickstart.
#
# 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.
#
# All configuration values ... | unicef-zambia/zambia-ureport | docs/conf.py | Python | bsd-3-clause | 7,753 | 0.007739 |
from .binary_search_tree import BinarySearchTree
| dskoda1/hpds | hpds/trees/__init__.py | Python | bsd-2-clause | 49 | 0 |
# -*- coding: utf-8 -*
from distutils.core import setup
import os
PACKAGE_NAME = "railgun"
def recurse(d):
ret = []
for f in os.listdir(d):
if f.startswith("."): continue
df = os.path.join(d, f)
if os.path.isfile(df):
ret.append(df)
elif f != "build":
re... | evolvIQ/railgun | setup.py | Python | apache-2.0 | 990 | 0.017189 |
# 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__cerbero | cerbero/utils/__init__.py | Python | lgpl-2.1 | 10,438 | 0.000958 |
from __future__ import unicode_literals
from django.test import TestCase
from accelerator.tests.factories import ProgramPartnerTypeFactory
class TestProgramPartnerType(TestCase):
def test_str(self):
program_partner_type = ProgramPartnerTypeFactory()
assert program_partner_type.partner_type in s... | masschallenge/django-accelerator | accelerator/tests/test_program_partner_type.py | Python | mit | 423 | 0 |
#!/usr/bin/python3
from tkinter import *
from tkinter.messagebox import *
fenetre = Tk()
fenetre.title("The Enigma Machine")
fenetre.configure(background='white')
fenetre.geometry("550x800")
class AutoScrollbar(Scrollbar):
#create a 'responsive' scrollbar
def set(self, lo, hi):
if float(lo) <= 0.0 and ... | omnitrogen/enigma | gui/enigma-gui-resizable-window.py | Python | mit | 11,660 | 0.038346 |
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *
class Frame1Client:
def main(self):
UI.OpenDialog(
VBox(
Frame("Hey! I&mportant!", Label("Hello, World!")),
PushButton("&OK")
)
)
UI.UserInput()
UI.CloseDialog()
Fra... | yast/yast-python-bindings | examples/Frame1.py | Python | gpl-2.0 | 340 | 0.017647 |
import django_filters
from django_filters import rest_framework as filters
from django_rv_apps.apps.believe_his_prophets.models.book import Book
from django_rv_apps.apps.believe_his_prophets.models.bible_read import BibleRead
from django_rv_apps.apps.believe_his_prophets.models.testament import Testament
class B... | davrv93/creed-en-sus-profetas-backend | django_rv_apps/apps/believe_his_prophets_api/views/book/filters.py | Python | apache-2.0 | 550 | 0.001818 |
# Copyright (c) 2012 Citrix Systems, 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 ... | ewindisch/nova | nova/tests/api/openstack/compute/contrib/test_aggregates.py | Python | apache-2.0 | 20,787 | 0.000625 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | omelkonian/cds | cds/modules/deposit/receivers.py | Python | gpl-2.0 | 2,693 | 0 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/pyre/pyre/inventory/Configurable.py | Python | gpl-2.0 | 9,858 | 0.006898 |
import synapse.tests.utils as s_t_utils
class UsGovTest(s_t_utils.SynTest):
async def test_models_usgov_cage(self):
async with self.getTestCore() as core:
input_props = {
'street': '123 Main St',
'city': 'Smallville',
'state': 'Kansas',
... | vertexproject/synapse | synapse/tests/test_model_gov_us.py | Python | apache-2.0 | 1,328 | 0.000753 |
'''
PyDALI proxyLinda module to encapsulate DALI agent communication
in the ASP solver case study
Licensed with Apache Public License
by AAAI Research Group
Department of Information Engineering and Computer Science and Mathematics
University of L'Aquila, ITALY
http://www.disim.univaq.it
'''
__autho... | AAAI-DISIM-UnivAQ/ASP_DALI | LindaProxy/proxyLinda.py | Python | apache-2.0 | 10,523 | 0.002946 |
"""
This module defines the following constants:
*InputText options*
* BGUI_INPUT_NONE = 0
* BGUI_INPUT_SELECT_ALL = 1
* BGUI_INPUT_DEFAULT = BGUI_INPUT_NONE
"""
from .widget import Widget, WeakMethod, BGUI_DEFAULT, BGUI_CENTERY, \
BGUI_NO_FOCUS, BGUI_MOUSE_ACTIVE, BGUI_MOUSE_CLICK, BGUI_MOUSE_RELEASE, \
BGUI_... | folkrav/rts-b51 | src/projectX/bgui/text_input.py | Python | gpl-3.0 | 15,841 | 0.031816 |
"""
Copyright 2017-present Airbnb, 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 law or agreed to in writing, sof... | airbnb/streamalert | streamalert_cli/athena/helpers.py | Python | apache-2.0 | 9,745 | 0.00236 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | helldorado/ansible | lib/ansible/modules/network/f5/bigip_dns_cache_resolver.py | Python | gpl-3.0 | 16,802 | 0.000595 |
import numpy as np
from ..filters import gaussian
def binary_blobs(length=512, blob_size_fraction=0.1, n_dim=2,
volume_fraction=0.5, seed=None):
"""
Generate synthetic binary image with several rounded blob-like objects.
Parameters
----------
length : int, optional
Linear... | Hiyorimi/scikit-image | skimage/data/_binary_blobs.py | Python | bsd-3-clause | 1,995 | 0 |
c = get_config()
# NEVER NAG ME
c.TerminalInteractiveShell.confirm_exit = False
# Configuration file for ipython.
# ------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
# -----------------------------------------------------------------------... | npotts/dotfiles | ipython/profile_default/ipython_config.py | Python | unlicense | 38,662 | 0.005276 |
"""SCons.Tool.zip
Tool-specific initialization for zip.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCon... | Distrotech/scons | build/scons/engine/SCons/Tool/zip.py | Python | mit | 3,328 | 0.005709 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (C) XXN, 2017
#
from __future__ import absolute_import, unicode_literals
import os, re, sys, time
import pywikibot
def main():
site = pywikibot.Site('wikidata', 'wikidata')
repo = site.data_repository()
mylist = \
[
u"Q3001778",
... | XXN/pwb-custom | wd-videogame.descriptions.py | Python | mit | 7,056 | 0.004789 |
# Copyright 2014 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 ... | GirlsCodePy/girlscode-coursebuilder | modules/math/math.py | Python | gpl-3.0 | 4,047 | 0.000494 |
"""
ICS Ops Common Library
"""
import os
from os.path import dirname
from os.path import realpath
from os.path import join as pathjoin
import boto
__version__ = "0.0.3.3"
__release__ = "alpha"
CONFIG = "opslib.ini"
LOG_NAME = "opslib"
AWS_ACCESS_KEY_NAME = "aws_access_key_id"
AWS_SECRET_KEY_NAME = "aws_secret_acces... | henrysher/opslib | opslib/__init__.py | Python | apache-2.0 | 1,905 | 0.000525 |
from __future__ import print_function, division, absolute_import
from mdtraj.utils.six import PY2
from mdtraj.utils.six.moves import xrange
import sys
import types
import random
import numpy as np
try:
import fastcluster
except ImportError:
pass
import scipy.cluster.hierarchy
import mdtraj as md
from msmbuild... | mpharrigan/msmbuilder | MSMBuilder/clustering.py | Python | gpl-2.0 | 49,464 | 0.002628 |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 ... | theanalyst/cinder | cinder/volume/drivers/windows/constants.py | Python | apache-2.0 | 742 | 0 |
"""timezone at metavj level
Revision ID: 224621d9edde
Revises: 14346346596e
Create Date: 2015-12-21 16:52:30.275508
"""
# revision identifiers, used by Alembic.
revision = '224621d9edde'
down_revision = '5a590ae95255'
from alembic import op
import sqlalchemy as sa
import geoalchemy2 as ga
def upgrade():
op.cr... | TeXitoi/navitia | source/sql/alembic/versions/224621d9edde_timezone_at_metavj_level.py | Python | agpl-3.0 | 1,446 | 0.01314 |
__author__ = 'mk'
import matplotlib.pyplot as plt
import sys
import math
import numpy as np
dataDir = sys.argv[1]
resDir = sys.argv[2]
plt.figure(figsize=(8,4))
algLabel=['naive','cou','zigzag','pingpong','MK','LL']
for i in range(0,6,1):
filePath = dataDir + str(i) + '_overhead.dat'
file = open(filePath)
... | bombehub/SEconsistent | diagrams/overhead_savePDF.py | Python | gpl-3.0 | 699 | 0.020029 |
from django.utils.translation import ugettext_lazy as _
# Legend Position
def get_legend_class(position):
return 'legend-' + str(position)
class LEGEND_POSITIONS:
BOTTOM = _('bottom')
TOP = _('top')
LEFT = _('left')
RIGHT = _('right')
get_choices = ((get_legend_class(BOTTOM), BOTTOM),
... | mcldev/DjangoCMS_Charts | djangocms_charts/base/consts.py | Python | mit | 824 | 0.002427 |
import asyncio
from collections import OrderedDict
from functools import partial
import logging
from quamash import QtGui, QtCore
from pyqtgraph import dockarea
from pyqtgraph import LayoutWidget
from artiq.protocols.sync_struct import Subscriber
from artiq.tools import short_format
from artiq.gui.tools import DictSy... | kgilmo/penning_artiq | artiq/gui/datasets.py | Python | gpl-3.0 | 5,603 | 0.000714 |
#!/usr/bin/env python
# Load common imports and system envs to build the core object
import sys, os
# Load the Environment:
os.environ["ENV_DEPLOYMENT_TYPE"] = "JustRedis"
from src.common.inits_for_python import *
#####################################################################
#
# Start Arg Processing:
#
act... | jay-johnson/sci-pype | bins/ml/extractors/extract_and_upload_iris_classifier.py | Python | apache-2.0 | 2,955 | 0.01286 |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NetworkMethods import NetworkMethod, NetworkMethods
from PLC.Auth import Auth
class AddNetworkMethod(Method):
"""
Adds a new network method.
Returns 1 if successful, faults otherwise.
"""
ro... | dreibh/planetlab-lxc-plcapi | PLC/Methods/AddNetworkMethod.py | Python | bsd-3-clause | 651 | 0.006144 |
#!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or module 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 ... | lovexiaov/python-in-practice | texteditor2/Display.py | Python | gpl-3.0 | 4,435 | 0.005187 |
# Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | openstack/tempest | tempest/api/compute/admin/test_migrations.py | Python | apache-2.0 | 7,577 | 0 |
# This module should be imported from REPL, not run from command line.
import socket
import uos
import network
import uwebsocket
import websocket_helper
import _webrepl
listen_s = None
client_s = None
def setup_conn(port, accept_handler):
global listen_s
listen_s = socket.socket()
listen_s.setsockopt(sock... | trezor/micropython | extmod/webrepl/webrepl.py | Python | mit | 2,184 | 0.001374 |
from .game import Board
for i in range(10):
Board.all()
print(i)
| jorgebg/tictactoe | time.py | Python | mit | 74 | 0 |
#!/usr/bin/env python
import os
import sys # provides interaction with the Python interpreter
from functools import partial
from PyQt4 import QtGui # provides the graphic elements
from PyQt4.QtCore import Qt # provides Qt identifiers
from PyQt4.QtGui import QPushButton
t... | AlManja/logs.py | logsgui3.py | Python | mit | 9,203 | 0.004781 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_browserstep
----------------------------------
Tests for `browserstep` module.
"""
import sys
import unittest
from browserstep import browserstep
class TestBrowserstep(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
p... | threeaims/browserstep | tests/test_browserstep.py | Python | mit | 432 | 0.00463 |
from sympy import I, sqrt, log, exp, sin, asin, factorial
from sympy.core import Symbol, S, Rational, Integer, Dummy, Wild, Pow
from sympy.core.facts import InconsistentAssumptions
from sympy import simplify
from sympy.core.compatibility import range
from sympy.utilities.pytest import raises, XFAIL
def test_symbol_u... | sahilshekhawat/sympy | sympy/core/tests/test_assumptions.py | Python | bsd-3-clause | 27,164 | 0.00011 |
recording = '''jtfxgqec
zxoeuddn
anlfufma
dxuuyxkg
ttnewhlw
sjoyeiry
rgfwwdhw
qymxsllk
forftdvy
rzmnmewh
hogawihi
mtsyexba
mrjzqqfk
ypmkexpg
pjuyopgv
rtqquvaj
evubmlrq
bqlrtuce
ndidnbps
vqukosam
mzdyfkcd
rrbwdimb
uhnvxgly
aaimxpcv
acxvinqj
muaeikzy
lhzbosjd
fflqqiit
unfhzfrs
gmwoyvob
cculubmy
zqbugcwa
ijouicwt
bildjjww... | Korred/advent_of_code_2016 | day_6_part_2.py | Python | mit | 5,783 | 0.001383 |
# 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, ... | google/jax | jax/interpreters/sharded_jit.py | Python | apache-2.0 | 22,527 | 0.006659 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class ContactFormConfig(AppConfig):
"""The default AppConfig for admin which does autodiscovery."""
name = 'django_contact'
verbose_name = _("Contact") | arkanister/django-contact-form-site | django_contact/apps.py | Python | bsd-3-clause | 255 | 0.003922 |
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | soltanmm-google/grpc | src/python/grpcio/grpc/beta/_client_adaptations.py | Python | bsd-3-clause | 26,840 | 0.000261 |
import datetime
class Historico:
def __init__(self):
self.data_abertura = datetime.datetime.today()
self.transacoes = []
def imprime(self):
print('data abertura: {}'.format(self.data_abertura))
print('transações: ')
for t in self.transacoes:
print('... | dariosena/LearningPython | PY-14/conta.py | Python | gpl-3.0 | 1,698 | 0.00708 |
'''
Created on 03.05.2015
@author: vvladych
'''
from gi.repository import Gtk
from forecastmgmt.model.organisation import Organisation
from masterdata_abstract_window import AbstractAddMask
class OrganisationAddMask(AbstractAddMask):
def __init__(self, main_window, reset_callback):
super(OrganisationAd... | vvladych/forecastmgmt | src/forecastmgmt/ui/masterdata/organisation_add_mask.py | Python | unlicense | 1,939 | 0.017535 |
import base64
import cPickle as pickle
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.utils.hashcompat import md5_constructor
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the gi... | nycholas/ask-undrgz | src/ask-undrgz/django/contrib/sessions/models.py | Python | bsd-3-clause | 2,675 | 0.001495 |
#!/usr/bin/env python
import optparse
import os
import sys
import tempfile
import datetime
from xml.etree import ElementTree as etree
from convert import read_messages, read_calls
import yaffs
def read_chunk(fd, size):
s = fd.read(size)
if len(s) > 0 and len(s) != size:
raise IOError("Broken image fi... | abbot/android-restore-tools | extract.py | Python | mit | 9,201 | 0.003261 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | daodaoliang/bokeh | bokeh/server/websocket/manager.py | Python | bsd-3-clause | 3,294 | 0.00425 |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/sockeye/sockeye/train.py | Python | apache-2.0 | 46,961 | 0.004152 |
# -*- coding: utf-8 -*-
import pytest
import env # noqa: F401
from pybind11_tests import pickling as m
try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
import pickle
@pytest.mark.parametrize("cls_name", ["Pickleable", "PickleableNew"])
def test_roundtrip(cls_name):
cls = ... | YannickJadoul/Parselmouth | pybind11/tests/test_pickling.py | Python | gpl-3.0 | 1,191 | 0.00084 |
# dialogs - provide common dialogs
#
# Copyright (c) 2006 FSF Europe
#
# Authors:
# Sebastian Heinlein <glatzor@ubuntu.com>
# Michael Vogt <mvo@canonical.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | ruibarreira/linuxtrail | usr/lib/python3/dist-packages/softwareproperties/gtk/dialogs.py | Python | gpl-3.0 | 1,305 | 0.009962 |
#!/usr/bin/env python
# Copyright (c) 2011 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/LICE... | openstack/cinder | cinder/cmd/volume_usage_audit.py | Python | apache-2.0 | 10,093 | 0.000694 |
import graphene
from ...core.permissions import DiscountPermissions
from ...discount import models
from ..core.mutations import ModelBulkDeleteMutation
class SaleBulkDelete(ModelBulkDeleteMutation):
class Arguments:
ids = graphene.List(
graphene.ID, required=True, description="List of sale ID... | maferelo/saleor | saleor/graphql/discount/bulk_mutations.py | Python | bsd-3-clause | 839 | 0.002384 |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | oppia/oppia | core/domain/event_services.py | Python | apache-2.0 | 12,316 | 0.000081 |
'''
'''
from __future__ import absolute_import
from ...exceptions import ProtocolError
index = {}
def register(cls):
''' Decorator to add a Message (and its revision) to the Protocol index.
'''
key = (cls.msgtype, cls.revision)
if key in index:
raise ProtocolError("Duplicate message specifi... | htygithub/bokeh | bokeh/server/protocol/messages/__init__.py | Python | bsd-3-clause | 643 | 0.021773 |
# Copyright 2017 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.
"""Provides the web interface for adding and editing sheriff rotations."""
from __future__ import print_function
from __future__ import division
from __futur... | endlessm/chromium-browser | third_party/catapult/dashboard/dashboard/create_health_report.py | Python | bsd-3-clause | 4,168 | 0.007917 |
""" progressbar2 related utils"""
from codekit.codetools import warn
from public import public
from time import sleep
import progressbar
import functools
@public
def setup_logging(verbosity=0):
"""Configure progressbar sys.stderr wrapper which is required to play nice
with logging and not have strange format... | lsst-sqre/sqre-codekit | codekit/progressbar.py | Python | mit | 2,070 | 0 |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.scala.goals.tailor import classify_source_files
from pants.backend.scala.target_types import (
ScalaJunitTestsGeneratorTarget,
ScalaSourcesGeneratorTarget,
... | pantsbuild/pants | src/python/pants/backend/scala/goals/tailor_test.py | Python | apache-2.0 | 802 | 0 |
#=====
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source cod... | lento/cortex | test/IECoreHoudini/procedurals/subdRender/subdRender-1.py | Python | bsd-3-clause | 2,590 | 0.011583 |
import unittest
import dbt.exceptions
import dbt.utils
from dbt.parser.schema_renderer import SchemaYamlRenderer
class TestYamlRendering(unittest.TestCase):
def test__models(self):
context = {
"test_var": "1234",
"alt_var": "replaced",
}
renderer = SchemaYamlRend... | analyst-collective/dbt | test/unit/test_yaml_renderer.py | Python | apache-2.0 | 2,904 | 0.000344 |
import urllib.parse
import sys
from ccs import core
from ccs import constants
from . import response
def ticker():
s = __name__.split(".")[1]
r = sys._getframe().f_code.co_name
# complete request
cr = core.request(s, r)
return core.get(core.hostname(s), cr, core.header(s), core.compression(s), ... | Honzin/ccs | dev/bitnz/public/__init__.py | Python | agpl-3.0 | 1,090 | 0.006422 |
#!/usr/bin/env python
# This file is part of the OpenMV project.
# Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
# This work is licensed under the MIT license, see the file LICENSE for
# details.
"""This module implements enough functionality to program the STM32F4xx over
DFU, without requiring d... | glennrub/micropython | tools/pydfu.py | Python | mit | 20,108 | 0.001392 |
import argparse
import configparser
from codepunks.config import (Config, INISource, XMLSource, JSONSource,
YAMLSource, ArgParserSource)
ARGS1 = argparse.Namespace()
ARGS1.apkey1 = "apval1"
ARGS1.apkey2 = "apval2"
ARGS1.apkey3 = "apval3"
def testEmptyCfg():
Config()
def testINISo... | redshodan/codepunks | tests/testconfig.py | Python | apache-2.0 | 1,388 | 0 |
class Dudle(object):
def __init__(self):
self.baseurl = 'https://dudle.inf.tu-dresden.de/?create_poll='
def getDudle(self, name, type='time', url=''):
return(self.baseurl + name + '&poll_type=' + type + '&poll_url=' + url)
| ccc-ffm/christian | modules/dudle.py | Python | gpl-3.0 | 250 | 0 |
from django.apps import AppConfig
class UniversityCreditsConfig(AppConfig):
name = 'university_credits'
| dhavalmanjaria/dma-student-information-system | university_credits/apps.py | Python | gpl-2.0 | 110 | 0 |
#!/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 ... | vrbagalkote/avocado-misc-tests-1 | perf/libunwind.py | Python | gpl-2.0 | 3,140 | 0.000318 |
"""
pyfire.contact
~~~~~~~~~~
Handles Contact ("roster item") interpretation as per RFC-6121
:copyright: 2011 by the pyfire Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import xml.etree.ElementTree as ET
from sqlalchemy import Table, Column, Boolean, Integ... | IgnitedAndExploded/pyfire | pyfire/contact.py | Python | bsd-3-clause | 3,814 | 0.001049 |
import re
from collections import defaultdict, Counter
from ttlser import natsort
from pyontutils.core import LabelsBase, Collector, Source, resSource, ParcOnt
from pyontutils.core import makePrefixes
from pyontutils.config import auth
from pyontutils.namespaces import nsExact
from pyontutils.namespaces import NIFRID, ... | tgbugs/pyontutils | nifstd/nifstd_tools/parcellation/paxinos.py | Python | mit | 40,653 | 0.007306 |
from __future__ import absolute_import
from __future__ import print_function
from .ChessFile import ChessFile, LoadingError
from pychess.Utils.GameModel import GameModel
from pychess.Utils.const import WHITE, BLACK, WON_RESIGN, WAITING_TO_START, BLACKWON, WHITEWON, DRAW
from pychess.Utils.logic import getStatus
from py... | Karlon/pychess | lib/pychess/Savers/epd.py | Python | gpl-3.0 | 5,385 | 0.011513 |
# -*- python-mode -*-
# -*- coding: UTF-8 -*-
## Copyright (C) 2012-2013 Daniel Pavel
##
## 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 opti... | Lekensteyn/Solaar | lib/logitech_receiver/hidpp20.py | Python | gpl-2.0 | 14,409 | 0.028732 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | Diti24/python-ivi | ivi/lecroy/lecroyWR44MXIA.py | Python | mit | 1,652 | 0.001816 |
#!/usr/bin/env python
import os
import re
import sys
def stamp(html):
"""Stamp a Python HTML documentation page with the SourceForge logo"""
def replace(m):
return ('<span class="release-info">%s '
'Hosted on <a href="http://sourceforge.net">'
'<img src="http://sourcef... | PyQwt/PyQwt3D | Doc/sourceforge.py | Python | gpl-2.0 | 924 | 0.002165 |
from simpleGossip.gossiping.gossip import RemoteGossipService
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
t = ThreadedServer( RemoteGossipService, port=18861 )
t.start()
| streed/simpleGossip | run.py | Python | mit | 211 | 0.009479 |
# Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""PyCrypto AES implementation."""
from .cryptomath import *
from .aes import *
if pycryptoLoaded:
import Crypto.Cipher.AES
def new(key, mode, IV):
return PyCrypto_AES(key, mode, IV)
c... | rebolinho/liveit.repository | script.video.F4mProxy/lib/f4mUtils/pycrypto_aes.py | Python | gpl-2.0 | 869 | 0 |
# -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2016 Trustcode - www.trustcode.com.br #
# Danimar Ribeiro <danimaribeiro@gmail.co... | Trust-Code/trust-addons | trust_crm/models/crm_lead.py | Python | agpl-3.0 | 2,232 | 0 |
class SpellPickerController:
def render(self):
pass
_controller_class = SpellPickerController
| battlemidget/conjure-up | conjureup/controllers/spellpicker/tui.py | Python | mit | 108 | 0.009259 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
from nose.tools import eq_, assert_raises
from mosql.query import select, insert, replace
from mosql.util import param, ___, raw, DirectionError, OperatorError, autoparam
def test_select_customize():
gen = select('person', Order... | moskytw/mosql | tests/test_query.py | Python | mit | 2,404 | 0.000416 |
"""
.. _tut_stats_cluster_source_rANOVA:
======================================================================
Repeated measures ANOVA on source data with spatio-temporal clustering
======================================================================
This example illustrates how to make use of the clustering funct... | jaeilepp/mne-python | tutorials/plot_stats_cluster_spatio_temporal_repeated_measures_anova.py | Python | bsd-3-clause | 12,088 | 0.000083 |
#!/usr/bin/python
#
# convert .po to .js
#
import json
import optparse
import os
import polib
import re
import string
import sys
parser = optparse.OptionParser(usage="usage: %prog [options] pofile...")
parser.add_option("--callback", default="_.setTranslation", dest="callback", help="callback function to call with da... | ToureNPlaner/tourenplaner-web | js/lang/po2js.py | Python | apache-2.0 | 1,277 | 0.022709 |
#!/usr/bin/python
import unittest, pprint, sys
sys.path.append( '../siux' )
import siuxlib
class TestSourceInfo(unittest.TestCase):
# config
auth = '<YOUR_API_KEY>'
def checkSourceInfo( self,retList ):
"""
Method tests sourceInfo structure
:param retList: - structure reported by API
"""
self.assert... | eSiUX/siux-python | tests/sourceinfo_test.py | Python | mit | 4,760 | 0.070168 |
#!/usr/bin/env python
from pymongo import MongoClient
import json
import sys
# print message and die
def msgDie(msg):
print msg
sys.exit(2)
if len(sys.argv) != 4:
msgDie("usage: unifi-minder.py config.json site-name minSNR")
# load config
cfgFile = sys.argv[1]
siteName = sys.argv[2]
minSNR = sys.argv[3]
with ope... | jda/unifi-tools | gen-minrssi.py | Python | mit | 828 | 0.018116 |
#!/usr/bin/env python
'''
decode an stm32 ICSR register value
'''
import sys
import optparse
def num(s):
try:
return int(s)
except ValueError:
return int(s, 16)
parser = optparse.OptionParser(__file__)
opts, args = parser.parse_args()
if len(args) == 0:
print(parser.usage)
sys.exi... | squilter/ardupilot | Tools/scripts/decode-ICSR.py | Python | gpl-3.0 | 2,047 | 0 |
import math
def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False):
"""
Add suffix to value, transform value to match new suffix and round it.
Keyword arguments:
val -- value to process
prec -- precision of final number (number of significant positions to show)
lo... | bsmr-eve/Pyfa | gui/utils/numberFormatter.py | Python | gpl-3.0 | 5,541 | 0.002166 |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
# $URI:$
__version__=''' $Id$ '''
__doc__='''Gazillions of miscellaneous internal utility functions'''
import os, sys, imp, time, types
from base64 import decodestring as base64_decodestring, encodestring as base64_encodestring
try:
fr... | ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/reportlab/lib/utils.py | Python | gpl-3.0 | 45,338 | 0.017491 |
"""
A Printer for generating executable code.
The most important function here is srepr that returns a string so that the
relation eval(srepr(expr))=expr holds in an appropriate environment.
"""
from printer import Printer
from sympy.core import Basic
import sympy.mpmath.libmp as mlib
from sympy.mpmath.libmp import p... | tarballs-are-good/sympy | sympy/printing/repr.py | Python | bsd-3-clause | 4,037 | 0.004706 |
# -*- coding: utf-8 -*-
from eventlet import httpc
from zenqueue.client.http.common import HTTPQueueClient
class QueueClient(HTTPQueueClient):
def send(self, url, data=''):
# Catch non-successful HTTP requests and treat them as if they were.
try:
result = httpc.post(url, data=da... | zacharyvoase/zenqueue | zenqueue/client/http/async.py | Python | mit | 507 | 0.00789 |
from django.contrib import admin
from . import models
from .models import Hollywood, Profession, Artist, Xaxis, Yaxis, MovieImage, ArtistImage
class ArtistInline(admin.StackedInline):
model = Artist
extra = 4
class ProfessionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['prof_... | ANKRAJG/movieStats | movieGraphs/admin.py | Python | bsd-3-clause | 570 | 0.007018 |
"""
Public views
"""
from django_future.csrf import ensure_csrf_cookie
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.conf import settings
from edxmako.shortcuts import render_to_response
from external_auth.views import (s... | huchoi/edx-platform | cms/djangoapps/contentstore/views/public.py | Python | agpl-3.0 | 2,264 | 0.001325 |
#!/usr/bin/env python
'Unit test for debugger info file'
import inspect, unittest
from trepan import debugger as Mdebugger
from trepan.processor.command import info as Minfo
from trepan.processor.command.info_subcmd import files as MinfoFile
from cmdhelper import dbg_setup
class TestInfoFile(unittest.TestCase):
... | rocky/python2-trepan | test/unit/test-info-files.py | Python | gpl-3.0 | 1,573 | 0.001271 |
"""
Test for the bandicoot.helper.group module.
"""
import bandicoot as bc
from bandicoot.core import Record, Position
import unittest
import datetime
from bandicoot.tests.generate_user import random_burst
from bandicoot.helper.group import group_records
from bandicoot.helper.tools import std, mean
from datetime impor... | econandrew/bandicoot | bandicoot/tests/test_group.py | Python | mit | 7,063 | 0.004247 |
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (c) 2013, Intel Corporation.
# 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 version 2 as
# published by the Free ... | marcosbontempo/inatelos | poky-daisy/scripts/lib/mic/utils/oe/misc.py | Python | mit | 4,324 | 0.004625 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Lester R Claudio <claudiol@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | ATIX-AG/foreman-ansible-modules | plugins/modules/realm.py | Python | gpl-3.0 | 2,670 | 0.001498 |
from src.tools.enum import enum
import pyxbmct.addonwindow as pyxbmct
from src.tools.dialog import dialog
EnumMode = enum(SELECT=0, ROTATE=1)
class EnumButton(object):
def __init__(self, label, values, current, default, changeCallback=None, saveCallback=None, customLabels=None, mode=EnumMode.SELECT, returnValue... | SportySpice/Collections | src/gui/EnumButton.py | Python | gpl-2.0 | 4,537 | 0.020719 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
import numpy as np
from rmgpy import getPath
from rmgpy.qm.main import QMCalculator
from rmgpy.molecule import Molecule
from rmgpy.qm.mopac import MopacMolPM3, MopacMolPM6, MopacMolPM7
mopacEnv = os.getenv('MOPAC_DIR', default="/opt/mopac")
if os.... | chatelak/RMG-Py | rmgpy/qm/mopacTest.py | Python | mit | 7,951 | 0.043013 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# face_recognition documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in t... | ageitgey/face_recognition | docs/conf.py | Python | mit | 8,789 | 0.005461 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as publish... | rogerscristo/BotFWD | env/lib/python3.6/site-packages/telegram/files/venue.py | Python | mit | 2,201 | 0.000909 |
# -*- coding:utf-8 -*-
from django.utils.translation import ugettext_lazy as _
# SearchForm's strings
SEARCH_FORM_KEYWORDS = _(u'Key Words / Profession')
SEARCH_FORM_LOCATION = _(u'City, State or Zip Code')
# SearchFiltersForm's strings
SEARCH_FILTERS_FORM_JOB_POSITION = _(u'Job Position')
SEARCH_FILTERS_FORM_EXPERIE... | hellhovnd/dentexchange | dentexchange/apps/search/strings.py | Python | bsd-3-clause | 551 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.