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 |
|---|---|---|---|---|---|---|
from handler.base import BaseHandler
import glob
import json
import rospy
class pymlabBase(BaseHandler):
def get(self, path = None):
print('OK')
file = rospy.get_param('/arom/node/pymlab_node/feature/pymlab_structure/cfg')
self.render('modules/features/pymlab.hbs', current_file = file)
... | Robozor-network/arom-web_ui | src/aromweb/node_handlers/pymlab_handler.py | Python | gpl-3.0 | 1,316 | 0.009119 |
import json
import subprocess
import sublime
try:
from urllib.parse import urlencode
from urllib.request import urlopen
except ImportError:
from urllib import urlencode, urlopen
BASE_URL = 'https://slack.com/api/'
def api_call(method, call_args={}, loading=None, filename=None, icon=None):
if icon:
... | simion/sublime-slack-integration | api.py | Python | gpl-2.0 | 1,631 | 0.000613 |
#!/usr/bin/env python
# Aravis - Digital camera library
#
# Copyright (c) 2011-2012 Emmanuel Pacaud
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, o... | lu-zero/aravis | tests/python/arv-enum-test.py | Python | lgpl-2.1 | 1,513 | 0.001322 |
"""
Tests for Django's bundled context processors.
"""
from django.test import SimpleTestCase, TestCase, override_settings
@override_settings(
ROOT_URLCONF='context_processors.urls',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS':... | DONIKAN/django | tests/context_processors/tests.py | Python | bsd-3-clause | 3,031 | 0 |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import entities
from mixbox import fields
import cybox.bindings.dns_cache_object as dns_cache_binding
from cybox.common import ObjectProperties, PositiveInteger
from cybox.objects.dns_record_object impo... | CybOXProject/python-cybox | cybox/objects/dns_cache_object.py | Python | bsd-3-clause | 990 | 0.00101 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2015 Andrew Ziem
# http://bleachbit.sourceforge.net
#
# 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... | uudiin/bleachbit | tests/TestWinapp.py | Python | gpl-3.0 | 11,482 | 0.001132 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import oauth2client.django_orm
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Profile',... | thecut/thecut-googleanalytics | thecut/googleanalytics/migrations/0001_initial.py | Python | apache-2.0 | 1,911 | 0.003663 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/dc_elements_1_1/Rights.py | Python | gpl-3.0 | 765 | 0.001307 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/account/models/firewall_rule.py | Python | mit | 1,956 | 0.000511 |
"""Basic Thrift server that uses the Milo Protocol"""
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer
from hellow... | lenn0x/Milo-Tracing-Framework | src/py/examples/milo_server.py | Python | apache-2.0 | 861 | 0.012776 |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import argparse
def getOptions():
# Parse command line arguments
parser = argparse.ArgumentParser(description="Merge tappAS DEA output files with detection flags")
# Input data
parser.add_argument("-t", "--input-directory", dest="inDir", re... | McIntyre-Lab/papers | nanni_maize_2022/scripts/merge_tappas_DEA_results.py | Python | lgpl-3.0 | 4,326 | 0.017337 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import pkg... | megaserg/pants | src/python/pants/backend/python/tasks/python_eval.py | Python | apache-2.0 | 6,421 | 0.009967 |
import pushmanager.core.db as db
import pushmanager.core.util
from pushmanager.core.db import InsertIgnore
from pushmanager.core.mail import MailQueue
from pushmanager.core.requesthandler import RequestHandler
from pushmanager.core.xmppclient import XMPPQueue
class AddRequestServlet(RequestHandler):
def post(sel... | Yelp/pushmanager | pushmanager/servlets/addrequest.py | Python | apache-2.0 | 2,713 | 0.001843 |
from pycp2k.inputsection import InputSection
from ._external_potential1 import _external_potential1
from ._rescale_forces1 import _rescale_forces1
from ._mixed1 import _mixed1
from ._dft1 import _dft1
from ._mm1 import _mm1
from ._qmmm1 import _qmmm1
from ._eip1 import _eip1
from ._bsse1 import _bsse1
from ._subsys1 im... | SINGROUP/pycp2k | pycp2k/classes/_force_eval2.py | Python | lgpl-3.0 | 1,808 | 0.002212 |
#!/usr/bin/env python
"""\
Test the 2e integral code.
"""
from PyQuante.pyints import contr_coulomb as pycc
from PyQuante.rys import contr_coulomb as ryscc
from PyQuante.hgp import contr_coulomb as hgpcc
from PyQuante.cints import contr_coulomb as ccc
from PyQuante.crys import contr_coulomb as cryscc
from PyQuante.c... | berquist/PyQuante | Tests/integrals.py | Python | bsd-3-clause | 3,015 | 0.026866 |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from librehatti.catalog.models import PurchaseOrder
from librehatti.catalog.models import Category
from librehatti.catalog.models import PurchasedItem
from librehatti.catalog.models import ModeOfPayment
from librehatti.cata... | s-monisha/LibreHatti | src/librehatti/bills/views.py | Python | gpl-2.0 | 7,704 | 0.005452 |
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.urls import reverse
from django.utils.timezone import now
from django.utils.translation import ug... | SmartElect/SmartElect | help_desk/models.py | Python | apache-2.0 | 20,453 | 0.001125 |
ThemeID = 'UI/ColorThemes/Custom'
#themeID, baseColor, hiliteColor
THEMES = (('UI/ColorThemes/Custom', (0.05, 0.05, 0.05), (0.4, 0.8, 1.0)),)
| EVEModX/Mods | mods/CustomThemeColor/ThemeConfig.py | Python | mit | 143 | 0.006993 |
# Created By: Virgil Dupras
# Created On: 2010-09-09
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... | tuxlifan/moneyguru | core/tests/gui/general_ledger_table_test.py | Python | gpl-3.0 | 4,362 | 0.005961 |
"модуль із класом Core що включає в собі деякі методи комбінаторики, які використовуються в програмі"
import itertools
from math import factorial as fact
class Core:
# Методи-генератори комбінацій/перестановок
#perm = itertools.permutations # перестановки
comb = ite... | bodik10/Combinatorics | core.py | Python | gpl-3.0 | 3,143 | 0.013309 |
from datetime import datetime
from NetCatKS.Logger import Logger
from NetCatKS.Components import BaseRootAPI
class Time(BaseRootAPI):
def __init__(self, factory):
super(Time, self).__init__(factory)
self.factory = factory
self.logger = Logger()
def process_factory(self):
... | dimddev/NetCatKS | examples/projects/rootapis/web_time_server/components/adapters/time/__init__.py | Python | bsd-2-clause | 587 | 0.003407 |
"""
Given two strings s and t which consist of only lowercase letters.
String t is generated by random shuffling string s and then add one more letter at a random position.
Find the letter that was added in t.
Example:
Input:
s = "abcd"
t = "abcde"
Output:
e
Explanation:
'e' is the letter that was added.
"""
... | franklingu/leetcode-solutions | questions/find-the-difference/Solution.py | Python | mit | 760 | 0.001316 |
from codecs import open
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='serpy',
version='0.3.1',
description='ridiculously fast object ... | clarkduvall/serpy | setup.py | Python | mit | 1,452 | 0 |
from __future__ import print_function
from pylab import *
import numpy as np
import cv2
import sys
def main(filenames):
for filename in filenames:
print("Processing %s" % filename)
img = cv2.imread(filename)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# Using opencv
cv2.imshow('image %dx%d' % (... | Elucidation/ChessboardDetect | base_imgload.py | Python | mit | 538 | 0.01487 |
import unittest
import os
import flask
from model import *
from controller import controller
from Herkansing6B import views
from Herkansing6B import app
import tempfile
modelClass = Model()
class Test_Model_InputuserTest(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.app.t... | John078/DEV6B | Herkansing6B/test_unit.py | Python | mit | 2,881 | 0.03228 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 0, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_RelativeDifference/trend_MovingAverage/cycle_0/ar_12/test_artificial_32_RelativeDifference_MovingAverage_0_12_0.py | Python | bsd-3-clause | 276 | 0.083333 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
PYPI_RST_FILTERS = (
# Replace code-blocks
(r'\.\.\s? code-block::\s*(\... | badele/serialkiller-plugins | setup.py | Python | gpl-3.0 | 1,664 | 0 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2010-2022, GEM Foundation
#
# OpenQuake 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 Lice... | gem/oq-engine | openquake/hazardlib/gsim_lt.py | Python | agpl-3.0 | 22,252 | 0 |
from copy import deepcopy
from casexml.apps.case.models import CommCareCase
from casexml.apps.phone.data_providers.case.utils import CaseSyncUpdate
from casexml.apps.phone.xml import get_case_element
from corehq.toggles import ENABLE_LOADTEST_USERS
def get_loadtest_factor(domain, user):
"""
Gets the loadtest ... | puttarajubr/commcare-hq | corehq/ex-submodules/casexml/apps/phone/data_providers/case/load_testing.py | Python | bsd-3-clause | 1,857 | 0.001616 |
import pygame
from utils import load_image, laserSound, rocketSound, explodeSound, \
missleExplosion, scream, load_sliced_sprites, chickenSound
import stats
class Shot(pygame.sprite.Sprite):
def __init__(self, x, y, image, enemies, power, speed, maxspeed=None):
pygame.sprite.Sprite.__init__(self)
... | kelvan/pyspaceshooter | objects.py | Python | gpl-3.0 | 7,112 | 0 |
###
#Various nose tests. If you want to adapt this for your own use, be aware that the start/end block list has a very specific formatting.
###
import date_chopper
import arrow
from pymongo import MongoClient
import secrets.admin_secrets
import secrets.client_secrets
MONGO_CLIENT_URL = "mongodb://{}:{}@localh... | zenranda/proj10-final | test_main.py | Python | artistic-2.0 | 2,958 | 0.014875 |
import os
import csv
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage, PDFTextExtractionNotAllowed
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfdevice import PDFDevice
from pdfminer.layout import LAParams... | zzyxzz/T2-list-parser | t2-parser.py | Python | mit | 4,480 | 0.012723 |
import pyxb_114.binding.generate
import pyxb_114.binding.datatypes as xs
import pyxb_114.binding.basis
import pyxb_114.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:trac-0071" targetNamespace="urn:trac-0071">
<xs:elem... | msherry/PyXB-1.1.4 | tests/trac/test-trac-0071.py | Python | apache-2.0 | 5,134 | 0.002922 |
from .backends import AzureActiveDirectoryBackend
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME, login
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.cache ... | csabatini/deploy-azurerm-django | azure_ad_auth/views.py | Python | bsd-3-clause | 2,354 | 0.000425 |
"""
Settings and actions for the dummyrunner
This module defines dummyrunner settings and sets up
the actions available to dummy accounts.
The settings are global variables:
TIMESTEP - time in seconds between each 'tick'
CHANCE_OF_ACTION - chance 0-1 of action happening
CHANCE_OF_LOGIN - chance 0-1 of login happenin... | jamesbeebop/evennia | evennia/server/profiling/dummyrunner_settings.py | Python | bsd-3-clause | 8,806 | 0.000227 |
# Generated by Django 2.2.24 on 2021-11-11 08:49
import django.core.validators
from django.db import migrations, models
from django.db.models import Count
def add_shard_to_no_rule_configurations(apps, schema_editor):
Configuration = apps.get_model("santa", "Configuration")
for configuration in Configuration.... | zentralopensource/zentral | zentral/contrib/santa/migrations/0026_configuration_allow_unknown_shard.py | Python | apache-2.0 | 1,128 | 0.001773 |
#!/usr/bin/env python
import argparse
import csv
import random
import sys
import math
from math import inf
from textwrap import dedent
from editCIGAR import CIGAR
from textwrap import dedent
# Don't throw an error if output is piped into a program that doesn't
# read all of its input, like `head`.
from signal import ... | mlell/tapas | scripts/src/indel.py | Python | mit | 16,326 | 0.011889 |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | amarant/servo | python/servo/testing_commands.py | Python | mpl-2.0 | 31,871 | 0.002134 |
from .. import DStateSpace
def extension_method(cls):
def decorator(func):
setattr(cls, func.__name__, func)
return func
return decorator
def extension_class(name, bases, namespace):
assert len(bases) == 1, "Exactly one base class required"
base = bases[0]
for name, value in na... | Ajoo/pySystems | pysystems/ident/systems.py | Python | mit | 549 | 0.009107 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tagging', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='tagavailablevalues',
options={'ordering': ('id',), 'verbose... | edx-solutions/edx-platform | cms/lib/xblock/tagging/migrations/0002_auto_20170116_1541.py | Python | agpl-3.0 | 571 | 0.003503 |
from typing import List, Set, Tuple, Dict
import numpy
from allennlp.common.checks import ConfigurationError
def decode_mst(
energy: numpy.ndarray, length: int, has_labels: bool = True
) -> Tuple[numpy.ndarray, numpy.ndarray]:
"""
Note: Counter to typical intuition, this function decodes the _maximum_
... | allenai/allennlp | allennlp/nn/chu_liu_edmonds.py | Python | apache-2.0 | 10,283 | 0.000486 |
# -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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... | joaduo/mepinta | core/python_core/common/type_checking/isiterable.py | Python | gpl-3.0 | 972 | 0 |
#
# Copyright (C) 2014 Dell, 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 wri... | JPWKU/unix-agent | src/dcm/agent/messaging/utils.py | Python | apache-2.0 | 2,118 | 0 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | ageron/tensorflow | tensorflow/python/keras/layers/core_test.py | Python | apache-2.0 | 11,584 | 0.004575 |
'''
Created on Nov 26, 2014
@author: Yury Zhauniarovich <y.zhalnerovich{at}gmail.com>
'''
import os, time
from interfaces.adb_interface import AdbInterface
from bboxcoverage import BBoxCoverage
from running_strategies import IntentInvocationStrategy
import smtplib
import email.utils
from email.mime.text import MIMET... | zyrikby/BBoxTester | BBoxTester/main_intents_strategy.py | Python | apache-2.0 | 5,189 | 0.007901 |
# 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/_src/scipy/stats/geom.py | Python | apache-2.0 | 1,244 | 0.002412 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet keypool and interaction with wallet encryption/locking."""
from test_framework.test_fr... | earonesty/bitcoin | test/functional/keypool.py | Python | mit | 3,529 | 0.002834 |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | grehx/spark-tk | regression-tests/sparktkregtests/testcases/dicom/take_dicom_test.py | Python | apache-2.0 | 3,835 | 0 |
import gtk
import pango
import math
from core.world import TheWorld
class TextEditor(object):
def __init__(self, text):
self.__text = text
self.cursorindex = 0
self.padding = 10.0
self.width = 0.0
self.height = 0.0
self.pixel_width = 0.0
self.pixel_height = 0.0
# create te... | antoinevg/survival | widgets/texteditor.py | Python | gpl-2.0 | 7,247 | 0.019594 |
def main():
pass
def generateBlock():
| willybh11/python | tetris/tetris.py | Python | gpl-3.0 | 48 | 0.083333 |
#!/usr/bin/env python
import tornado
import socket
import maproxy.proxyserver
class Session(object):
"""
The Session class if the heart of the system.
- We create the session when a client connects to the server (proxy). this connection is "c2p"
- We create a connection to the server (p2s)
- Ea... | zferentz/maproxy | maproxy/session.py | Python | apache-2.0 | 16,890 | 0.013914 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.filtering.extractskeleton import ExtractSkeleton
def test_ExtractSkeleton_inputs():
input_map = dict(InputImageFileName=dict(argstr='%s',
position=-2,
),
OutputImageFileName=dict(... | mick-d/nipype_source | nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py | Python | bsd-3-clause | 1,344 | 0.022321 |
Experiment(description='Synthetic data sets of interest',
data_dir='../data/synth/',
max_depth=9,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
max_jobs=300, ... | ekamioka/gpss-research | experiments/synth/synth.py | Python | mit | 1,731 | 0.010976 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from pootle_format.models imp... | ta2-1/pootle | tests/pootle_fs/receivers.py | Python | gpl-3.0 | 1,046 | 0 |
"""
Revision ID: 0212_remove_caseworking
Revises: 0211_email_branding_update
Create Date: 2018-07-31 18:00:20.457755
"""
from alembic import op
revision = '0212_remove_caseworking'
down_revision = '0211_email_branding_update'
PERMISSION_NAME = "caseworking"
def upgrade():
op.execute("delete from service_perm... | alphagov/notifications-api | migrations/versions/0212_remove_caseworking.py | Python | mit | 586 | 0.005119 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | google-research/google-research | kws_streaming/layers/lstm.py | Python | apache-2.0 | 10,610 | 0.005467 |
"""SCons.Tool.sunlink
Tool-specific initialization for the Sun Solaris (Forte) linker.
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 Th... | Eigenlabs/EigenD | tools/packages/SCons/Tool/sunlink.py | Python | gpl-3.0 | 2,437 | 0.002052 |
# coding: 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/.
from operator import itemgetter
import re
from datetime import datetime
from random import randrange
f... | SujaySKumar/bedrock | bedrock/mozorg/forms.py | Python | mpl-2.0 | 30,635 | 0.00062 |
class IoConfig:
def __init__(self, i_path, mode, o_pin=None, set_temp=None, buffer_temp=None, direction=None):
self.i_path = i_path
self.mode = mode
self.o_pin = o_pin
self.set_temp = set_temp
self.buffer_temp = buffer_temp
self.on_fn = self.get_on_fn(direction)
self.off_fn = self.get_off_fn(direction)
... | rj3d/PiTempController | config_reader.py | Python | gpl-2.0 | 1,798 | 0.05228 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Ali Sabil <ali.sabil@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later... | billiob/papyon | papyon/gnet/message/SOAP.py | Python | gpl-2.0 | 5,704 | 0.003857 |
# This file is part of MyPaint.
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2019 by the MyPaint Development Team.
#
# 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 Licen... | mypaint/mypaint | gui/device.py | Python | gpl-2.0 | 22,624 | 0.000575 |
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import grdab
class qa_measure_processing_rate(gr_unittest.TestCase):
"""
@brief QA for measure processing rate sink.
This class implements a test bench to verify the corresponding C++ class.
"""
def setUp(self):
self.tb = ... | andrmuel/gr-dab | python/qa/qa_measure_processing_rate.py | Python | gpl-3.0 | 1,233 | 0.030819 |
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, unicode_literals
import operator
from datetime import datetime
from functools import reduce
import extra_views
from django.conf import settings
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import (Pass... | andrewsmedina/django-admin2 | djadmin2/views.py | Python | bsd-3-clause | 21,359 | 0.00014 |
# Copyright 2014 Diamond Light Source 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 applicable law or agreed t... | rcatwood/Savu | savu/plugins/loaders/multi_modal_loaders/i18_loaders/i18stxm_loader.py | Python | gpl-3.0 | 1,776 | 0.001689 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 ... | dsiddharth/access-keys | keystone/tests/contrib/kds/paths.py | Python | apache-2.0 | 915 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT | AlphaCluster/NewsBlur | vendor/paypal/standard/pdt/forms.py | Python | mit | 240 | 0.004167 |
from identifier import Result
RPM_PATTERNS = [
'ED AB EE DB'
]
class RpmResolver:
def identify(self, stream):
return Result('RPM')
def load(hound):
hound.add_matches(RPM_PATTERNS, RpmResolver())
| Bindernews/TheHound | identifiers/rpm_identifier.py | Python | mit | 205 | 0.04878 |
from .mutationstester import MutationsTester
| Lydwen/Mr.Statamutation | Mr.Statapython/statapython/stataspoon/__init__.py | Python | mit | 45 | 0 |
"""Ansible integration test infrastructure."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import contextlib
import json
import os
import shutil
import tempfile
from .. import types as t
from ..target import (
analyze_integration_target_dependencies,
walk_integrati... | kvar/ansible | test/lib/ansible_test/_internal/integration/__init__.py | Python | gpl-3.0 | 11,813 | 0.00364 |
import web
import uuid
from jinja2 import Environment, FileSystemLoader
import os
files_directory = "db/data"
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
urls = (
'/', 'Index',
'/upload', 'Upload'
)
class Index:
def GET(self):
j2_env = Environment(loader=FileSystemLoader(THIS_DIR+"/... | tiagoft/sampleseeker | sampleseeker.py | Python | gpl-3.0 | 1,431 | 0.01188 |
#!/usr/bin/env python
"""Script to read the libphonenumber per-prefix metadata and generate Python code.
Invocation:
buildprefixdata.py [options] indir outfile module_prefix
Processes all of the per-prefix data under the given input directory and emit
generated Python code.
Options:
--var XXX : use this prefix f... | Mitali-Sodhi/CodeLingo | Dataset/python/buildprefixdata.py | Python | mit | 8,450 | 0.002604 |
import os
from setuptools import setup
def read(fname):
with open(fname) as fhandle:
return fhandle.read()
def readMD(fname):
# Utility function to read the README file.
full_fname = os.path.join(os.path.dirname(__file__), fname)
if 'PANDOC_PATH' in os.environ:
import pandoc... | OpenGov/grid_walker | setup.py | Python | bsd-3-clause | 1,495 | 0.002676 |
import copy
from types import GeneratorType
class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given dictionaries, only the
first occurrenc... | skevy/django | django/utils/datastructures.py | Python | bsd-3-clause | 15,444 | 0.001684 |
#!/usr/bin/env python
import re
import glob
class FileReader(object):
OPTION_LINE_RE = re.compile(r'^#!\s*(.+?)\s*=(.+?)\s*$')
def __init__(self):
self.opts = {
'sep': ' ',
'cols': 'sum',
}
def read_option_line(self, l):
m = self.OPTION_LINE_RE.match(l)... | amiraliakbari/grade-analyzer | pan/pan.py | Python | mit | 414 | 0.007246 |
"""Mixin classes for custom array types that don't inherit from ndarray."""
from numpy.core import umath as um
__all__ = ['NDArrayOperatorsMixin']
def _disables_array_ufunc(obj):
"""True when __array_ufunc__ is set to None."""
try:
return obj.__array_ufunc__ is None
except AttributeError:
... | charris/numpy | numpy/lib/mixins.py | Python | bsd-3-clause | 7,052 | 0 |
"""AsciiTable is the main table class. To be inherited by other tables. Define convenience methods here."""
from terminaltables.base_table import BaseTable
from terminaltables.terminal_io import terminal_size
from terminaltables.width_and_alignment import column_max_width, max_dimensions, table_width
class AsciiTabl... | Robpol86/terminaltables | terminaltables/ascii_table.py | Python | mit | 2,734 | 0.004389 |
# -*- coding: utf-8 -*-
# Copyright (C) 2007, 2008, 2014 Toms Bauģis <toms.baugis at gmail.com>
# This file is part of Project Hamster.
# Project Hamster 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, eith... | wreckJ/hamster | src/hamster/preferences.py | Python | gpl-3.0 | 22,492 | 0.006269 |
#!/usr/bin/python3
#
# Copyright: Conor O'Callghan 2016
# Version: v1.1.3
#
# Please feel free to fork this project, modify the code and improve
# it on the github repo https://github.com/brioscaibriste/iarnrod
#
# Powered by TfL Open Data
# This program is free software: you can redistribute it and/or modi... | brioscaibriste/iarnrod | coire.py | Python | gpl-3.0 | 6,003 | 0.01316 |
# 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
# distributed under the... | Metaswitch/horizon | openstack_dashboard/contrib/sahara/content/data_processing/cluster_templates/workflows/create.py | Python | apache-2.0 | 12,426 | 0.000161 |
__author__ = 'george'
from baseclass import Plugin
import time
from apscheduler.scheduler import Scheduler
class AreWeDone(Plugin):
def __init__(self, skype):
super(AreWeDone, self).__init__(skype)
self.command = "arewedoneyet"
self.sched = Scheduler()
self.sched.start()
sel... | jvlomax/Beaker-bot | plugins/arewedone.py | Python | gpl-2.0 | 1,837 | 0.006532 |
# DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
from app import app
import gevent
from gevent.pywsgi import WSGIServer
from gevent.pool import Pool
from gevent import monkey
import signal
monkey.patch_all()
server = WSGIServer(('', 5000), app, spawn=Pool(None))
def stop():
se... | Jumpscale/go-raml | codegen/fixtures/congo/python_server/server.py | Python | bsd-2-clause | 425 | 0 |
from django.utils.translation import ugettext, ugettext_lazy as _
from django.conf import settings
STATE_CHOICES = [
('AN', 'Ancona'),
('AP', 'Ascoli Piceno'),
('FM', 'Fermo'),
('MC', 'Macerata'),
('PU', 'Pesaro Urbino')
]
SUPPLIER_FLAVOUR_LIST = [
('COMPANY', _('Company')),
('COOPERATING'... | michelesr/gasistafelice | gasistafelice/gf/base/const.py | Python | agpl-3.0 | 851 | 0.00235 |
# This file is part of the Fluggo Media Library for high-quality
# video and audio processing.
#
# Copyright 2010-2 Brian J. Crowell <brian@fluggo.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 Foun... | fluggo/Canvas | fluggo/editor/model/commands.py | Python | gpl-3.0 | 38,160 | 0.004271 |
#!/home/vincenzo/Development/RobHome/venv/bin/python
# $Id: rst2s5.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Chris Liechti <cliechti@gmx.net>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML slides using
the S5 template system.
"""... | burzillibus/RobHome | venv/bin/rst2s5.py | Python | mit | 671 | 0.00149 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | google-research/google-research | etcmodel/models/openkp/run_finetuning_lib_test.py | Python | apache-2.0 | 7,530 | 0.001726 |
"""
Tests for botogram/utils.py
Copyright (c) 2015 Pietro Albini <pietro@pietroalbini.io>
Released under the MIT license
"""
import botogram.decorators
def test_help_message_for(bot):
@bot.command("test")
def func():
"""docstring"""
pass
cmd = {cmd.name: cmd for cmd in bot.... | thesharp/botogram | tests/test_decorators.py | Python | mit | 535 | 0 |
import galaxy.model
from galaxy.model.orm import *
from base.twilltestcase import TwillTestCase
class UploadData( TwillTestCase ):
def test_000_upload_files_from_disk( self ):
"""Test uploading data files from disk"""
self.logout()
self.login( email='tst@bx.psu.edu' )
history1 = gal... | dbcls/dbcls-galaxy | test/functional/test_get_data.py | Python | mit | 4,761 | 0.031086 |
#! /usr/bin/python
# this module is for jenkins attacks
from core.webModule import webModule
from requests import session
import requests
import re
from argparse import ArgumentParser
from lxml import html
import random
class jenkinsBrute(webModule):
def __init__(self, config, display, lock):
super(jenkin... | MooseDojo/myBFF | modules/jenkinsBrute.py | Python | mit | 1,691 | 0.009462 |
from google.appengine.ext import vendor
vendor.add('extensions')
from google.appengine.api import mail
import jinja2
import os
import premailer
_appid = os.getenv('APPLICATION_ID').replace('s~', '')
EMAIL_SENDER = 'noreply@{}.appspotmail.com'.format(_appid)
class Emailer(object):
def __init__(self, sender=Non... | grow/grow-ext-build-server | grow_build_server/emailer.py | Python | mit | 1,438 | 0.002782 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('patchwork', '0002_fix_pat... | joselamego/patchwork | patchwork/migrations/0003_series.py | Python | gpl-2.0 | 2,993 | 0.003007 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from collections import namedtuple
from functools import partial
from pkg_resour... | clinton-hall/nzbToMedia | libs/common/babelfish/country.py | Python | gpl-3.0 | 3,242 | 0.001851 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generate-diffs.py - generate changes and diff files for new packages
#
# Copyright © 2008 Canonical Ltd.
# Author: Scott James Remnant <scott@ubuntu.com>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of version 3 of the GNU... | dbnicholson/merge-our-misc | generate_diffs.py | Python | gpl-3.0 | 4,253 | 0.006115 |
#!/usr/bin/env python3
# export_to_pdf.py
#
# references
# - https://onesheep.org/scripting-libreoffice-python/
# - http://christopher5106.github.io/office/2015/12/06/openoffice-lib
# reoffice-automate-your-office-tasks-with-python-macros.html
import uno
from com.sun.star.beans import PropertyValue
localCont... | pchaitat/invrcptexporter | sample-code/misc/hello_world_librecalc.py | Python | gpl-3.0 | 1,240 | 0.006452 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/ValueSet) on 2017-03-22.
# 2017, SMART Health IT.
from . import domainresource
class ValueSet(domainresource.DomainResource):
""" A set of codes drawn from one or more code systems.
... | all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/valueset.py | Python | bsd-3-clause | 21,281 | 0.007753 |
#!/usr/bin/env python
""" =================================================
execute.py - Top-level hybrid controller executor
=================================================
This module executes a hybrid controller for a robot in a simulated or real environment.
:Usage: ``execute.py [-hn] [-p liste... | VerifiableRobotics/LTLMoP | src/lib/execute.py | Python | gpl-3.0 | 17,245 | 0.005683 |
#!/usr/bin/python
"""
Step file creator/editor.
:copyright: Red Hat Inc 2009
:author: mgoldish@redhat.com (Michael Goldish)
"""
import os
import glob
import shutil
import sys
import logging
import pygtk
import gtk
from virttest import ppm_utils
pygtk.require('2.0')
# General utilities
def corner_and_size_clippe... | lmr/avocado-vt | virttest/step_editor.py | Python | gpl-2.0 | 50,744 | 0.000158 |
import logging
from pprint import pprint
from flask_wtf import Form
from wtforms import IntegerField, BooleanField
from flask import Blueprint, send_from_directory
from flask import Flask, redirect, url_for, session, request, jsonify, g,\
make_response, Response, render_template
from werkzeug.utils ... | RealTimeWeb/Blockpy-Server | controllers/services.py | Python | mit | 2,386 | 0.003353 |
#!/usr/bin/env python
"""Parses language data from IANA subtag registry plus several other files,
and outputs JSON data in the following format:
[
{
'name': 'Ghotuo',
'code': { 'three': 'aaa' },
'country': ['Nigeria'],
'altNames': [],
},
{
'name': 'Alumu',
'c... | sil-jterm-2015/sfwebchecks | src/scripts/language picker/build-json-language-data.py | Python | mit | 8,241 | 0.004004 |
func int suma(int a, int b)
return a+b
endfunc
func int absdif(int a, int b)
if(a>b)
return a-b
else
return b-a
endif
endfunc
int i, a, b,B[200], aux, A[100]
int z=suma(2*5+a,aux*A[0])-absdif(10000, 500)
int w=10, C[a/b**aux]
double x=0, y, z, pi=3.141592
a=0
b=1
A[0]=10
A[a+b]=pi**x
for(i=0,i<10,i+=1)
... | TachoMex/Compiladores-14b | Parser/compilador/programa.py | Python | gpl-2.0 | 888 | 0.108108 |
"""
Integration Tests for LMS instructor-initiated background tasks.
Runs tasks on answers to course problems to validate that code
paths actually work.
"""
from collections import namedtuple
import ddt
import json
import logging
from mock import patch
from nose.plugins.attrib import attr
import textwrap
from celery... | deepsrijit1105/edx-platform | lms/djangoapps/instructor_task/tests/test_integration.py | Python | agpl-3.0 | 29,509 | 0.003728 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.