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 |
|---|---|---|---|---|---|---|
# Written by Vamei
import os
import multiprocessing
import time
#==================
# input worker
def inputQ(queue, info):
# info = str(os.getpid()) + '(put):' + str(time.time())
queue.put(info)
# output worker
def outputQ(queue,lock):
info = queue.get()
print(info)
# lock.acquire()
# print (s... | JeffpanUK/NuPyTools | multiprocessTutorial.py | Python | mit | 1,085 | 0.029493 |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
def h2o_H2OFrame_ascharacter():
"""
Python API test: h2o.frame.H2OFrame.ascharacter()
Copied from pyunit_... | spennihana/h2o-3 | h2o-py/tests/testdir_apis/Data_Manipulation/pyunit_h2oH2OFrame_ascharacter.py | Python | apache-2.0 | 734 | 0.013624 |
from datetime import datetime
from .base import BaseCarrier
class FakeCarrier(BaseCarrier):
id = 'fake'
name = 'Fake Carrier'
def _track_single(self, object_id):
package = self.create_package(
object_id=object_id,
service_name='Default',
)
for i in range(... | rpedigoni/trackr | trackr/carriers/fake.py | Python | mit | 572 | 0 |
"""
Provides ValueMeta metaclass - which allows its descendants to override
__instancecheck__ and __subclasscheck__ to be used as *classmethods*
"""
from __future__ import absolute_import
__all__ = [
'ValueMeta',
'ValueABC',
'InterfaceType',
'ExistingDirectory',
'ExistingFile'
]
from .existing_dir... | OaklandPeters/pyinterfaces | pyinterfaces/valueabc/__init__.py | Python | mit | 498 | 0 |
try: paraview.simple
except: from paraview.simple import *
import numpy as np
from mpi4py import MPI
import os
import csv
from scipy import interpolate
import gc
import sys
gc.enable()
comm = MPI.COMM_WORLD
label = 'm_25_3b'
labelo = 'm_25_3b'
basename = 'mli'
## READ archive (too many points... somehow)
# args: n... | jungla/ICOM-fluidity-toolbox | 2D/RST/extract_Scalar_temp.py | Python | gpl-2.0 | 3,216 | 0.03949 |
import re
import sublime
from ..versions import version_exclude_prerelease
def filter_releases(package, settings, releases):
"""
Returns all releases in the list of releases that are compatible with
the current platform and version of Sublime Text
:param package:
The name of the package
... | herove/dotfiles | sublime/Packages/Package Control/package_control/providers/release_selector.py | Python | mit | 2,521 | 0.003173 |
import flask
import json
import bson
import os
from flask import request, redirect
import sys
from fontana import twitter
import pymongo
DEFAULT_PORT = 2014
DB = 'fontana'
connection = pymongo.Connection("localhost", 27017)
db = connection[DB]
latest_headers = {}
MODERATED_SIZE = 40
class MongoEncoder(json.JSONE... | oaubert/TwitterFontana | backend/src/app.py | Python | mit | 7,176 | 0.007664 |
"""Askbot template context processor that makes some parameters
from the django settings, all parameters from the askbot livesettings
and the application available for the templates
"""
import sys
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import simplejson
import a... | jesonyang001/qarepo | askbot/context.py | Python | gpl-3.0 | 5,245 | 0.004385 |
#!/usr/bin/python
# Find all the three word sequences
import sys
for line in sys.stdin:
tok = line.strip().split()
if len(tok)>2:
for i in range(1, len(tok)-1):
word1, word2, word3 = tok[i-1], tok[i], tok[i+1]
word_str = word1 + " " + wo... | aphaea/exc-MapReduce-UoE | three_wrd_seq_count/mapper.py | Python | mit | 441 | 0.011338 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Interface documentation.
Maintainer: Itamar Shtull-Trauring
"""
from __future__ import division, absolute_import
from zope.interface import Interface, Attribute
from twisted.python import deprecate
from twisted.python.versions import Versi... | engdan77/edoAutoHomeMobile | twisted/internet/interfaces.py | Python | mit | 90,290 | 0.001207 |
# para os tipos numericos temos os seguintes operadores:
# + - * / % **
print "Numeros inteiros:"
x = 10
y = 3
print x, "+", y, "=", x + y
print x, "+", y, "=", x - y
print x, "+", y, "=", x*y
print x, "+", y, "=", x/y # repare como o resultado eh um inteiro
print x, "+", y, "=", x % y # esse eh o resto da divisao
pri... | folivetti/PI-UFABC | AULA_01/Python/operadores.py | Python | mit | 2,187 | 0.038866 |
# -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
# Copyright (c) 2015 Angelos Tzotsos
#
# Permission is hereby granted, free of charge, to any p... | tomkralidis/pycsw | pycsw/ogc/fes/fes2.py | Python | mit | 19,080 | 0.002358 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | mineo/picard | picard/util/icontheme.py | Python | gpl-2.0 | 2,350 | 0.00213 |
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
######################################################... | arrayfire/arrayfire_python | arrayfire/statistics.py | Python | bsd-3-clause | 8,560 | 0.003271 |
"""user permissions management
Revision ID: bd67c88713b8
Revises: 10023013f155
Create Date: 2021-03-31 21:31:47.278834
"""
# revision identifiers, used by Alembic.
import datetime
from sqlalchemy import orm, text
from sqlalchemy.engine.reflection import Inspector
revision = "bd67c88713b8"
down_revision = "1002301... | hasadna/anyway | alembic/versions/bd67c88713b8_user_permissions_management.py | Python | mit | 3,369 | 0.003562 |
#!/usr/bin/python
# -*- coding: utf8 -*-
from bs4 import BeautifulSoup as Soup
import urls
import re
import proxy
from datetime import *
import time
from time import mktime
import functions
def materials ( config ):
url = "https://www.lectio.dk/lectio/%s/MaterialOverview.aspx?holdelement_id=%s" % ( str(config["schoo... | boh1996/LectioAPI | scrapers/materials.py | Python | mit | 2,102 | 0.03568 |
"""
@name: Modules/Web/web_internet.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2020 by D. Brian Kimmel
@license: MIT License
@note: Created on Jun 3, 2013
@summary: Handle the "Internet" information for a house.
"""
__updated__ = '2020-01-02'
# Import system... | DBrianKimmel/PyHouse | Project/src/Modules/Computer/Web/web_internet.py | Python | mit | 1,421 | 0.000704 |
# Copyright (c) 2015, Matt Layman
from ConfigParser import ConfigParser, NoOptionError, NoSectionError
import os
import sys
import requests
API_URL = 'https://www.transifex.com/api/2'
LANGUAGES = [
'es',
'fr',
'it',
'nl',
]
def fetch_po_for(language, username, password):
print 'Downloading po f... | blakev/tappy | transifex.py | Python | bsd-2-clause | 1,750 | 0.000571 |
from django.db import models
from django_extensions.db.fields import CreationDateTimeField
from tower import ugettext_lazy as _
from .managers import NoticeLiveManager
class Notice(models.Model):
LIVE = 1
REMOVED = 2
STATUS_CHOICES = (
(LIVE, _('Published')),
(REMOVED, _('Unpublished')),
... | mozilla/popcorn_maker | popcorn_gallery/notifications/models.py | Python | bsd-3-clause | 906 | 0 |
__source__ = 'https://leetcode.com/problems/binary-tree-cameras/'
# Time: O(N)
# Space: O(H)
#
# Description: Leetcode # 968. Binary Tree Cameras
#
# Given a binary tree, we install cameras on the nodes of the tree.
#
# Each camera at a node can monitor its parent, itself, and its immediate children.
#
# Calculate the... | JulyKikuAkita/PythonPrac | cs15211/BinaryTreeCameras.py | Python | apache-2.0 | 4,264 | 0.003752 |
# Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
from datetime import datetime
# Your Account Sid and Auth Token from twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
au... | TwilioDevEd/api-snippets | sync/rest/documents/create-document/create-document.7.x.py | Python | mit | 864 | 0 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/r-ncbit/package.py | Python | lgpl-2.1 | 1,646 | 0.000608 |
# -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ...errors.httpnotfoundexception import HttpNotFoundException
import saklient
str = six.text_type
# module saklient.cloud.errors.resourcepathnotfoundexception
class ResourcePathNotFoundException(HttpNotFoundExceptio... | sakura-internet/saklient.python | saklient/cloud/errors/resourcepathnotfoundexception.py | Python | mit | 742 | 0.009174 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | yongshengwang/builthue | apps/hbase/src/hbase/management/commands/hbase_setup.py | Python | apache-2.0 | 3,274 | 0.007025 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | cdrooom/odoo | addons/mail/mail_mail.py | Python | agpl-3.0 | 18,908 | 0.004337 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | ovnicraft/odoo_addons | smile_access_control/tests/__init__.py | Python | agpl-3.0 | 1,040 | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_event.tests.common import TestEventOnlineCommon
class TestEventExhibitorCommon(TestEventOnlineCommon):
@classmethod
def setUpClass(cls):
super(TestEventExhibitorCommon, cls).se... | jeremiahyan/odoo | addons/website_event_exhibitor/tests/common.py | Python | gpl-3.0 | 1,021 | 0 |
from unittest import TestCase
from tcontrol.discretization import c2d
from ..transferfunction import tf
from ..model_conversion import *
from ..statespace import StateSpace
import numpy as np
from .tools.test_utility import assert_ss_equal
class TestDiscretization(TestCase):
def setUp(self):
self.s1 = tf... | DaivdZhang/tinyControl | tcontrol/tests/test_discretization.py | Python | bsd-3-clause | 1,236 | 0 |
try:
from xml.etree import ElementTree
except ImportError:
from elementtree import ElementTree
from client import *
from base_asset import BaseAsset
from cache_decorator import memoized
from special_class_methods import special_classes
from none_deref import NoneDeref
from string_utils import split_attribute
... | versionone/VersionOne.SDK.Python | v1pysdk/v1meta.py | Python | bsd-3-clause | 9,214 | 0.018016 |
##########################################################################
# Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L.
#
# This file is part of bioport.
#
# bioport 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 ... | jellegerbrandy/bioport-site | bioport/mail_validation.py | Python | gpl-3.0 | 1,103 | 0.004533 |
from ddt import ddt, data
from django.test import TestCase
from six.moves import mock
from waldur_core.core import utils
from waldur_core.structure import tasks
from waldur_core.structure.tests import factories, models
class TestDetectVMCoordinatesTask(TestCase):
@mock.patch('requests.get')
def test_task_se... | opennode/nodeconductor | waldur_core/structure/tests/unittests/test_tasks.py | Python | mit | 2,443 | 0.001228 |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Volcano Polygon on Population
Metadata Definitions.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 ... | cchristelis/inasafe | safe/impact_functions/volcanic/volcano_polygon_population/metadata_definitions.py | Python | gpl-3.0 | 4,986 | 0 |
"""
PLPY helper module for applying row events from pgq.logutriga().
"""
import plpy
import pkgloader
pkgloader.require('skytools', '3.0')
import skytools
## TODO: automatic fkey detection
# find FK columns
FK_SQL = """
SELECT (SELECT array_agg( (SELECT attname::text FROM pg_attribute
W... | overdrive3000/skytools | python/skytools/plpy_applyrow.py | Python | isc | 6,707 | 0.006113 |
# -*- coding: UTF-8 -*-
from __future__ import print_function
import csv
import os
ignored_views = set(["HHB", "FFO", "FFOI"])
seen_views = set([])
seen_aliases = set([])
seen_groups = set([])
tpl = "check_journal(u'{1}', u'{4}', u'{11}', u'{10}')"
print("""# -*- coding: UTF-8 -*-
from __future__ import print_functio... | lsaffre/blog | docs/blog/2016/0305.py | Python | agpl-3.0 | 1,941 | 0.00103 |
# Copyright 2013 Dell 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 app... | citrix-openstack-build/neutron-fwaas | neutron_fwaas/tests.skip/unit/services/firewall/drivers/linux/test_iptables_fwaas.py | Python | apache-2.0 | 11,580 | 0.00095 |
# -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck
... | giorgiop/scikit-learn | sklearn/metrics/pairwise.py | Python | bsd-3-clause | 46,491 | 0.000043 |
from __future__ import unicode_literals
from django.utils import six
from reviewboard.attachments.models import FileAttachment
from reviewboard.webapi.base import WebAPIResource
class BaseFileAttachmentResource(WebAPIResource):
"""A base resource representing file attachments."""
added_in = '1.6'
model... | sgallagher/reviewboard | reviewboard/webapi/resources/base_file_attachment.py | Python | mit | 2,246 | 0 |
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class ProductApphook(CMSApp):
name = _("Product Apphook")
urls = ["wlansi_store.urls"]
apphook_pool.register(ProductApphook) | matevzmihalic/wlansi-store | wlansi_store/cms_app.py | Python | agpl-3.0 | 264 | 0.011364 |
# -*- coding: UTF-8 -*-
"""
Package-wide constants.
"""
CALL = 'C'
PUT = 'P'
| zzzoidberg/landscape | finance/consts.py | Python | mit | 78 | 0 |
# -*- 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):
# Adding unique constraint on 'Vendeur', fields ['code_permanent']
db.create_unique(u'encefal_vendeur', ['co... | nilovna/EnceFAL | project/encefal/migrations/0003_auto__add_unique_vendeur_code_permanent.py | Python | gpl-3.0 | 8,651 | 0.007629 |
# Copyright 2015, 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... | kidaa/kythe | third_party/grpc/src/python/src/grpc/framework/common/cardinality.py | Python | apache-2.0 | 1,930 | 0.002591 |
from matplotlib import pyplot as plt
path = "C:/Temp/mnisterrors/chunk" + str(input("chunk: ")) + ".txt"
with open(path, "r") as f:
errorhistory = [float(line.rstrip('\n')) for line in f]
plt.plot(errorhistory)
plt.show()
| jabumaho/MNIST-neural-network | plot_error.py | Python | gpl-3.0 | 235 | 0.004255 |
'''OpenGL extension ARB.texture_gather
This module customises the behaviour of the
OpenGL.raw.GL.ARB.texture_gather to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a new set of texture functions
(textureGather) to the shading language that determine 2x2 footprint
that are... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/GL/ARB/texture_gather.py | Python | lgpl-3.0 | 1,072 | 0.015858 |
"""Collects and displays information to the user."""
from __future__ import print_function
import collections
import logging
import os
import Queue
import sys
import textwrap
import zope.interface
from letsencrypt import interfaces
from letsencrypt import le_util
logger = logging.getLogger(__name__)
class Report... | xgin/letsencrypt | letsencrypt/reporter.py | Python | apache-2.0 | 3,253 | 0 |
"""
Create a nearly orthogonal quad mesh by solving for stream function
and velocity potential inside a given boundary.
Still trying to improve the formulation of the Laplacian. Psi
(stream function) and phi (velocity potential) are solved
simultaneously. There are other options, and each field
uniquely constraints ... | rustychris/stompy | stompy/grid/quad_laplacian.py | Python | mit | 123,597 | 0.021538 |
"""
Goal: Define the routes for general pages
@authors:
Andrei Sura <sura.andrei@gmail.com>
Ruchi Vivek Desai <ruchivdesai@gmail.com>
Sanath Pasumarthy <sanath@ufl.edu>
@see https://flask-login.readthedocs.org/en/latest/
@see https://pythonhosted.org/Flask-Principal/
"""
import hashlib... | ctsit/barebones-flask-app | app/routes/pages.py | Python | bsd-3-clause | 11,826 | 0 |
import json
import requests
from transliterate import translit
_eng_chars = "~!@#$%^&qwertyuiop[]asdfghjkl;'zxcvbnm,./QWERTYUIOP{}ASDFGHJKL:\"|ZXCVBNM<>?"
_rus_chars = "ё!\"№;%:?йцукенгшщзхъфывапролджэячсмитьбю.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,"
_trans_table = dict(zip(_eng_chars, _rus_chars))
def _fix_layout(s):
... | bashkirtsevich/autocode | text_preprocessing/es_predict.py | Python | gpl-3.0 | 1,121 | 0.001898 |
#!/usr/bin/env python
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
import logging
from helper.pi_tool import PiTool
logging.basicConfig(filename='log/test_email.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s',... | m1ojk/nicedoormat | test_email.py | Python | mit | 898 | 0.004454 |
# type command prints file contents
from lib.utils import *
def _help():
usage = '''
Usage: type (file)
Print content of (file)
Use '%' in front of global
vars to use value as file
name.
'''
print(usage)
def main(argv):
if len(argv) < 1 or '-h' in argv:
_help()
return
# The shell ... | nayas360/pyterm | bin/type.py | Python | mit | 1,002 | 0 |
'''
This is a New BSD License.
http://www.opensource.org/licenses/bsd-license.php
Copyright (c) 2008-2009, Jonathan Hartley (tartley@tartley.com)
Copyright (c) 2012, Christian Fobel (christian@fobel.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitte... | wheeler-microfluidics/svg_model | svg_model/svgload/svg_parser.py | Python | lgpl-2.1 | 7,624 | 0.002361 |
class Solution(object):
def isPowerOfFour(self, num):
"""
:type num: int
:rtype: bool
"""
if num < 1:
return False
return num & (num - 1) == 0 and num & 0x55555555 > 0
| Jacy-Wang/MyLeetCode | PowerofFour342.py | Python | gpl-2.0 | 232 | 0 |
from .mim import Connection, match, MatchDoc, MatchList, BsonArith
| rick446/MongoTools | mongotools/mim/__init__.py | Python | mit | 67 | 0 |
from __future__ import print_function
from __future__ import absolute_import
# System modules
import os
# Third-party modules
# LLDB modules
import lldb
from .lldbtest import *
from . import configuration
from . import lldbutil
from .decorators import *
def source_type(filename):
_, extension = os.path.splitex... | youtube/cobalt | third_party/llvm-project/lldb/packages/Python/lldbsuite/test/lldbinline.py | Python | bsd-3-clause | 7,168 | 0.000279 |
#!/usr/bin/python
import json
import logging
import sys
from datetime import datetime
import csv
if __name__ == '__main__':
_loggingLevel = logging.DEBUG ## How much trace
logger = logging.getLogger(__name__)
logging.basicConfig(level=_loggingLevel)
a = {}
altmetricFile = sys.argv[1]
with op... | sinharrajesh/dbtools | google-plus-analysis/clarify.py | Python | apache-2.0 | 1,344 | 0.004464 |
# Copyright 2019 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... | cxxgtxy/tensorflow | tensorflow/python/eager/remote_test.py | Python | apache-2.0 | 24,106 | 0.008919 |
# Copyright 2022 The jax3d 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 applicable law or agreed to in wr... | google-research/jax3d | jax3d/projects/nesf/nerfstatic/utils/camera_utils_test.py | Python | apache-2.0 | 1,892 | 0.0037 |
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | UManPychron/pychron | pychron/hardware/linear_axis.py | Python | apache-2.0 | 2,566 | 0 |
#!/usr/bin/env python
#--------Include modules---------------
from copy import copy
import rospy
from visualization_msgs.msg import Marker
from std_msgs.msg import String
from geometry_msgs.msg import Point
from nav_msgs.msg import OccupancyGrid
import actionlib_msgs.msg
from move_base_msgs.msg import MoveBaseAction,... | hasauino/multi_kobuki_gazebo | scripts/tot_r1.py | Python | mit | 2,113 | 0.056791 |
#!/usr/bin/env python
# encoding: utf-8
"""
Waf tool for defining ardupilot's submodules, so that they are kept up to date.
Submodules can be considered dynamic sources, since they are updated during the
build. Furthermore, they can be used to generate other dynamic sources (mavlink
headers generation, for example). T... | aesaae/ardupilot_str | Tools/ardupilotwaf/git_submodule.py | Python | gpl-3.0 | 3,169 | 0.002524 |
import os
import unittest
from shutil import copyfile
from ruamel.yaml import YAML
from ukbrest.common.utils.auth import PasswordHasher
from tests.utils import get_repository_path
class WSGIFunctions(unittest.TestCase):
def load_data(self, filepath):
yaml = YAML()
with open(filepath, 'r') as f:
... | miltondp/ukbrest | tests/test_password_hasher.py | Python | gpl-3.0 | 5,529 | 0.000723 |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
ADMINS = (
("David Barra... | bameda/monarch | back/settings/common.py | Python | agpl-3.0 | 3,078 | 0.00195 |
"""Caching Library using redis."""
import logging
from functools import wraps
from flask import current_app
from walrus import Walrus
import api
import hashlib
import pickle
from api import PicoException
log = logging.getLogger(__name__)
__redis = {
"walrus": None,
"cache": None,
"zsets": {"scores": No... | royragsdale/picoCTF | picoCTF-web/api/cache.py | Python | mit | 4,558 | 0.000658 |
from .Lifeform import Lifeform
from erukar.system.engine import Indexer
from erukar.ext.math.Distance import Distance
class Player(Lifeform, Indexer):
def __init__(self, world=None):
Indexer.__init__(self)
super().__init__(world)
self.faction = 'iurian'
self.uid = '' # Player UID
... | etkirsch/legends-of-erukar | erukar/system/engine/lifeforms/Player.py | Python | agpl-3.0 | 1,072 | 0.027052 |
''' Test_RSS_Policy_JobEfficiencyPolicy
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import DIRAC.ResourceStatusSystem.Policy.JobEfficiencyPolicy as moduleTested
#######################################################################... | yujikato/DIRAC | src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobEfficiencyPolicy.py | Python | gpl-3.0 | 3,905 | 0.06274 |
"""Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | DmitryADP/diff_qc750 | vendor/nvidia/tegra/3rdparty/python-support-files/src/Lib/random.py | Python | gpl-2.0 | 31,938 | 0.002536 |
#! /usr/bin/python
"""
Runs GenomeMapper on single-end or paired-end data.
"""
import optparse, os, sys, tempfile
def stop_err( msg ):
sys.stderr.write( "%s\n" % msg )
sys.exit()
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
parser.add_option('', '--threads', dest='thread... | vipints/oqtans | oqtans_tools/PALMapper/0.5/galaxy/genomemapper_wrapper.py | Python | bsd-3-clause | 4,421 | 0.013798 |
# Configure SP Shasta CTC machine support
#
# Exensively uses the jmri.jmrit.ussctc package capabilities
#
# Author: Bob Jacobsen, copyright 2016-17
#
import jmri
from jmri.jmrit.ussctc import *
import jarray
import java.util
def arrayList(contents) :
retval = java.util.ArrayList()
for item in contents :
... | bobjacobsen/SPShasta | userfiles/ConfigureCtcControlLogic.py | Python | gpl-2.0 | 21,226 | 0.015076 |
"""
WSGI config for saleor project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | tfroehlich82/saleor | saleor/wsgi/__init__.py | Python | bsd-3-clause | 1,225 | 0.001633 |
from ._decorators import singleton,\
hide_field
__license__ = "MIT"
__version__ = "0.2.1"
__author__ = "Nikolay Romashchenko"
__maintainer__ = "Nikolay Romashchenko"
__email__ = "nikolay.romashchenko@gmail.com"
__status__ = "Development"
| nromashchenko/amquery | amquery/utils/decorators/__init__.py | Python | mit | 265 | 0 |
import inspect
import os
import sys
import scapy
# -- Linkcode resolver -----------------------------------------------------
# This is HEAVILY inspired by numpy's
# https://github.com/numpy/numpy/blob/73fe877ff967f279d470b81ad447b9f3056c1335/doc/source/conf.py#L390
# Copyright (c) 2005-2020, NumPy Developers.
# Al... | gpotter2/scapy | doc/scapy/_ext/linkcode_res.py | Python | gpl-2.0 | 3,293 | 0.002126 |
#!/usr/bin/env python
"""
Example of a model fitting script.
The user should modify the model
according to the characteristics of
the signal of interest.
Part of the code is taken from the
kmpfit examples:
http://www.astro.rug.nl/software/kapteyn/kmpfittutorial.html#profile-fitting
"""
import numpy as np
import argp... | astrofle/CRRLpy | examples/synth_spec/makemodel.py | Python | mit | 4,292 | 0.011883 |
# -*- coding: utf-8 -*-
from typing import Tuple
from asyncpg import Connection
from starlette.requests import Request
from starlette.responses import JSONResponse, RedirectResponse
from starlette.routing import Route
from qllr.app import App
from qllr.endpoints import Endpoint, HTTPEndpoint
from qllr.templating imp... | em92/pickup-rating | qllr/blueprints/player/__init__.py | Python | mit | 2,763 | 0.002533 |
"""Module with Caffe models."""
from django.db import models
from employees.models import Employee
class Caffe(models.Model):
"""Stores one cafe."""
name = models.CharField(max_length=100, unique=True)
city = models.CharField(max_length=100)
street = models.CharField(max_length=100)
# CharField... | VirrageS/io-kawiarnie | caffe/caffe/models.py | Python | mit | 931 | 0 |
import unittest
import os.path
import sys
import test.support
from ctypes import *
from ctypes.util import find_library
# On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode.
class Test_OpenGL_libs(unittest.TestCase):
@classmethod
def setUpClass(cls):
lib_gl = lib_glu = lib_gle = N... | yotchang4s/cafebabepy | src/main/python/ctypes/test/test_find.py | Python | bsd-3-clause | 3,948 | 0.000507 |
# -*- coding: utf-8 -*-
#
# Streaker documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 6 12:34:57 2016.
#
# 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.
#
# ... | aldialimucaj/Streaker | docs/source/conf.py | Python | mit | 11,449 | 0.006376 |
import re
import yaml
import subprocess
import os
import datetime
from . import AbstractCamera
from ..utils.logger import has_logger
from ..utils.config import load_config
from ..utils.indi import PanIndi
@has_logger
class Camera(AbstractCamera):
def __init__(self, device_name, client=PanIndi(), config=dict(), ... | fmin2958/POCS | panoptes/camera/canon_indi.py | Python | mit | 6,347 | 0.002521 |
# -*- coding: utf-8 -*-
'''
Created on 22 Ιαν 2013
@author: tedlaz
'''
from PyQt4 import QtGui, QtCore
from gui import ui_pro
class dlg(QtGui.QDialog):
def __init__(self, args=None, parent=None):
super(dlg, self).__init__(parent)
self.ui = ui_pro.Ui_Dialog()
se... | tedlaz/pyted | misthodosia/m13/f_pro.py | Python | gpl-3.0 | 1,976 | 0.013122 |
"""
:mod:`Selectors` -- selection methods module
==============================================================
This module have the *selection methods*, like roulette wheel, tournament, ranking, etc.
"""
import random
import Consts
def GRankSelector(population, **args):
""" The Rank Selector - This selector w... | UdeM-LBIT/GAPol | lib/ga/evolve/Selectors.py | Python | gpl-3.0 | 3,696 | 0.0046 |
#!/usr/bin/env python
"""
crate_anon/linkage/bulk_hash.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
it under th... | RudolfCardinal/crate | crate_anon/linkage/bulk_hash.py | Python | gpl-3.0 | 6,042 | 0 |
"""
flask.ext.acl
=============
This extension provides an Access Control implementation for `tipfy <http://www.tipfy.org/>`_.
Links
-----
* `Documentation <http://www.tipfy.org/wiki/extensions/acl/>`_
* `Source Code Repository <http://code.google.com/p/tipfy-ext-acl/>`_
* `Issue Tracker <http://code.google.com/p/tip... | guotie/flask-acl | setup.py | Python | mit | 1,588 | 0.019521 |
from django.conf.urls import patterns, include, url
try:
from djcelery.views import apply
urlpatterns = patterns('',
url(r'^apply/(?P<task_name>.+?)/', apply, name='celery-apply'),
url(r'^celery/', include('djcelery.urls')),
)
except ImportError:
urlpatterns = patterns('')
| PolicyStat/jobtastic | test_projects/django/testproj/urls.py | Python | mit | 307 | 0.003257 |
from miro.test.framework import MiroTestCase
from miro.frontends.widgets.widgetstatestore import WidgetStateStore
from miro.frontends.widgets.itemlist import SORT_KEY_MAP
class WidgetStateConstants(MiroTestCase):
def setUp(self):
MiroTestCase.setUp(self)
self.display_types = set(WidgetStateStore.ge... | debugger06/MiroX | lib/test/widgetstateconstantstest.py | Python | gpl-2.0 | 2,572 | 0.002722 |
# Copyright 2014 Michael Frank <msfrank@syntaxjockey.com>
#
# This file is part of Mandelbrot.
#
# Mandelbrot 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... | msfrank/mandelbrot | mandelbrot/timerange.py | Python | gpl-3.0 | 6,251 | 0.004799 |
#
# Licensed under the GNU General Public License Version 3
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This p... | xkollar/spacewalk | spacecmd/src/lib/misc.py | Python | gpl-2.0 | 28,096 | 0.000285 |
import json
from kolekto.printer import printer
from kolekto.commands import Command
class Restore(Command):
""" Restore metadata from a json dump.
"""
help = 'Restore metadata from a json dump'
def prepare(self):
self.add_arg('file', help='The json dump file to restore')
def run(self... | NaPs/Kolekto | kolekto/commands/restore.py | Python | mit | 657 | 0 |
# proxy module
from __future__ import absolute_import
from apptools.type_manager.hook import *
| enthought/etsproxy | enthought/type_manager/hook.py | Python | bsd-3-clause | 95 | 0 |
from __future__ import print_function
from argparse import ArgumentParser, Namespace
TEMPLATE_SEPARATOR = '#####'
OUTPUT_PREFIX = '''
// This file is the result of rendering `{filepath}`.
// You should make changes to this code by editing that template; not
// this file.
'''
def main(argv):
args = parse_args... | mcinglis/libpp | templates/render.py | Python | agpl-3.0 | 2,004 | 0.001497 |
"""
Wind Turbine Company - 2013
Author: Stephan Rayner
Email: stephan.rayner@gmail.com
"""
import time
from test.Base_Test import Base_Test
class Maintenance_153Validation(Base_Test):
def setUp(self):
self.WindSpeedValue = "4.5"
self.interface.reset()
self.interface.write("Yaw_Generation... | stephan-rayner/HIL-TestStation | Tests/e3120/Maintenance/TransitionIntoState0.py | Python | mit | 3,533 | 0.012171 |
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from provider import StackExchangeProvider
urlpatterns = default_urlpatterns(StackExchangeProvider)
| HackerEarth/django-allauth | allauth/socialaccount/providers/stackexchange/urls.py | Python | mit | 178 | 0.005618 |
# Copyright (c) 2020 PaddlePaddle 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 app... | luotao1/Paddle | python/paddle/regularizer.py | Python | apache-2.0 | 5,630 | 0.007282 |
import time
import RPi.GPIO as GPIO
LED_VERDE = 22
LED_VERMELHO = 18
GPIO.setmode(GPIO.BOARD)
GPIO.setup(LED_VERDE, GPIO.OUT)
GPIO.output(LED_VERDE, GPIO.LOW)
GPIO.setup(LED_VERMELHO, GPIO.OUT)
GPIO.output(LED_VERMELHO, GPIO.LOW)
while True:
GPIO.output(LED_VERDE, GPIO.HIGH)
GPIO.output(LED_VERMELHO, GPIO.LO... | ocarneiro/minecraft-pi | lab/blinky.py | Python | apache-2.0 | 441 | 0 |
from ._terminator import Terminator
__all__ = ("Terminator",)
| nikitanovosibirsk/vedro | vedro/plugins/terminator/__init__.py | Python | apache-2.0 | 63 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"Fully test this module's functionality through the use of fixtures."
from megacosm.generators import Generator
import unittest2 as unittest
import json
from mock import Mock, patch, MagicMock
import fakeredis
import fixtures
from config import TestConfiguration
from ppr... | CityGenerator/Megacosm-Generator | tests/test_generator.py | Python | gpl-2.0 | 8,144 | 0.007859 |
#!/usr/bin/env python2
print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print 'Yay! Printing.'
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'
print "Some text"
| christianheinrichs/learning-lpthw | ex01/ex1-sd1.py | Python | gpl-3.0 | 226 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0016_auto_20151128_2006'),
]
operations = [
migrations.CreateModel(
name='Comment',
field... | atuljain/coderbounty | website/migrations/0017_comment.py | Python | agpl-3.0 | 819 | 0.001221 |
import logging
from shapely.geometry import *
from lib.raster import Raster
import numpy as np
from os import path
import sys
sys.path.append(path.abspath(path.join(path.dirname(__file__), "../../..")))
from lib.shapefileloader import Shapefile
from lib.exception import DataException, MissingException
from lib.metrics ... | SouthForkResearch/CHaMP_Metrics | tools/topometrics/methods/thalweg.py | Python | gpl-3.0 | 6,178 | 0.003237 |
from collections import OrderedDict
import logging
import os
import shutil
import subprocess
import simtk.unit as units
from intermol.desmond.desmond_parser import load, save
DES_PATH = ''
logger = logging.getLogger('InterMolLog')
# terms we are ignoring for now.
#'en': 'Raw Potential',
#'E_x': 'Extended En.',
un... | ctk3b/InterMol | intermol/desmond/__init__.py | Python | mit | 3,879 | 0.003094 |
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs45_detached_award_financial_assistance'
def test_column_headers(database):
expected_subset = {'row_number', 'indirect_federal_sha... | fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs45_detached_award_financial_assistance.py | Python | cc0-1.0 | 3,014 | 0.006636 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
from subprocess import check_call, CalledProcessError
import shlex
import sys
import logging
log = logging.getLogger( __name__ )
def novo_sort( bam_filename, output_filename ):
cmdline_str = "novosort -c 8 -m 8G -s -f {} -o {}".format( ba... | SANBI-SA/tools-sanbi-uwc | tools/novo_sort/novo_sort.py | Python | gpl-3.0 | 986 | 0.008114 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | GeoNode/geonode-notification | notification/migrations/0001_initial.py | Python | mit | 2,390 | 0.003766 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.