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 |
|---|---|---|---|---|---|---|
##############################################################################
# Copyright (c) 2013-2018, 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... | krafczyk/spack | var/spack/repos/builtin/packages/r-seqinr/package.py | Python | lgpl-2.1 | 1,941 | 0.000515 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gotapi.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | kushsharma/GotAPI | manage.py | Python | apache-2.0 | 804 | 0 |
# -*- coding: utf-8 -*-
import json
from unittest import mock
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.openid import RequestValidator, UserInfoEndpoint
from tests.unittest import TestCase
def set_scopes_valid(token, scopes, request):
request.scopes = ["openid", "bar"]
return True
class Use... | idan/oauthlib | tests/openid/connect/core/endpoints/test_userinfo_endpoint.py | Python | bsd-3-clause | 2,522 | 0 |
#!/usr/bin/python
import memcache
import json
print "Content-Type: application/json"
print
mc = memcache.Client(['127.0.0.1:11211'], debug=0)
data = mc.get_multi(["meta", "latest"])
print(json.dumps(data, separators=(",", ":")))
| Selfnet/dashboard | cgi/latest.json.py | Python | bsd-2-clause | 232 | 0 |
from django.contrib import admin
from team.models import Member
# Register your models here.
class MemberAdmin(admin.ModelAdmin):
fields = ['last_name', 'first_name']
ordering = ['last_name', 'first_name']
admin.site.register(Member, MemberAdmin)
| HuayraLinux/cuaderno | cuaderno/team/admin.py | Python | gpl-2.0 | 260 | 0 |
from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... | megcunningham/django-diesel | tests/engine.py | Python | bsd-3-clause | 5,088 | 0.000786 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis_louvain | base/forms/learning_unit_specifications.py | Python | agpl-3.0 | 3,409 | 0.002054 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('lizard_efcis', '0090_auto_20160222_1439'),
]
operations = [
migrations.AlterField(
model_name='mappingfield',
... | lizardsystem/lizard-efcis | lizard_efcis/migrations/0091_auto_20160315_0924.py | Python | gpl-3.0 | 1,198 | 0.000835 |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
An aggregator of sensors values
Created on 10 juil. 2012
:author: Thomas Calmant
"""
# ------------------------------------------------------------------------------
from pelix.ipopo import constants
from pelix.ipopo.decorators import ComponentFactory, Prov... | isandlaTech/cohorte-demos | temper/src/aggregator/aggregator.py | Python | apache-2.0 | 6,713 | 0.00283 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (... | 1ukash/horizon | horizon/dashboards/project/images_and_snapshots/views.py | Python | apache-2.0 | 3,222 | 0.001241 |
hmm = [
"https://media3.giphy.com/media/TPl5N4Ci49ZQY/giphy.gif",
"https://media0.giphy.com/media/l14qxlCgJ0zUk/giphy.gif",
"https://media4.giphy.com/media/MsWnkCVSXz73i/giphy.gif",
"https://media1.giphy.com/media/l2JJEIMLgrXPEbDGM/giphy.gif",
"https://media0.giphy.com/media/dgK22exekwOLm/giphy.gif"... | garr741/mr_meeseeks | rtmbot/plugins/hmm.py | Python | mit | 322 | 0.003106 |
#!/usr/bin/env python
import fileinput
from pylab import *
for line in fileinput.input():
print line
| arturocastro/portable-performance | previous_work/PURE-C/timings/plot.py | Python | mit | 107 | 0 |
"""map types"""
def main():
a = map[string]int{
'x': 1,
'y': 2,
'z': 3,
}
print( a['x'] )
assert a['x']==1
b = map[int]string{ 0:'a', 1:'b' }
print( b[0] )
print( b[1] )
assert b[0]=='a'
assert b[1]=='b'
## infers type of key and value ##
c = {'x':100, 'y':200}
print( c['x'] )
print( c['y'] )
a... | pombredanne/Rusthon | regtests/go/maps.py | Python | bsd-3-clause | 359 | 0.116992 |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Clinton Knight. 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://w... | NetApp/manila | manila/tests/share/drivers/netapp/dataontap/client/test_client_base.py | Python | apache-2.0 | 6,186 | 0 |
"""
afplot.variation
~~~~~~~~~~~~~~~~
:copyright: (c) 2017 Sander Bollen
:copyright: (c) 2017 Leiden University Medical Center
:license: MIT
"""
def get_all_allele_freqs(record, sample_name):
fmt = record.genotype(sample_name)
if not hasattr(fmt.data, 'AD'):
return []
ad = fmt.data.AD
if not a... | sndrtj/afplot | afplot/variation.py | Python | mit | 2,720 | 0 |
# -*- coding: utf-8 -*-
from datetime import datetime as dt
import copy
import random
import os
import traceback
from tg import redirect, flash, expose, request, override_template
from tg.decorators import paginate
from ordering.controllers.basicMaster import *
from ordering.model import *
from ordering.util.common i... | LamCiuLoeng/jcp | ordering/controllers/master.py | Python | mit | 23,382 | 0.013942 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | dhermes/google-cloud-python | bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/enums.py | Python | apache-2.0 | 5,008 | 0.001997 |
# Copyright (c) 2010 Christopher Rebert <code@rebertia.com>
#
# 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 rights
# to use, copy, mod... | cvrebert/TritonScraper | src/triton_scraper/cape.py | Python | mit | 11,607 | 0.008529 |
'''
Defines the preferences dialog.
@author: Eitan Isaacson
@organization: Mozilla Foundation
@copyright: Copyright (c) 2006, 2007 Mozilla Foundation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distribution, and
... | javihernandez/accerciser-mirror | src/lib/accerciser/prefs_dialog.py | Python | bsd-3-clause | 6,660 | 0.008859 |
import pytest
from plenum.test.delayers import icDelay
from plenum.test.helper import checkViewNoForNodes
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.stasher import delay_rules
from plenum.test.test_node import checkProtocolInstanceSetup
from plenum.test.view_change.hel... | evernym/plenum | plenum/test/view_change/test_no_future_view_change_while_view_change.py | Python | apache-2.0 | 1,825 | 0.003836 |
# -*- coding: utf-8 -*-
"""
Add first_answer_email_sent and first_l10n_email_sent fields to Profile.
"""
from __future__ import unicode_literals
from django.db import models, migrations
import kitsune.sumo.models # noqa
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_201504... | mozilla/kitsune | kitsune/users/migrations/0004_auto_add_contrib_email_flags.py | Python | bsd-3-clause | 897 | 0.00223 |
from django.core import serializers
from django.http import HttpResponse
from django.template import loader
from django.utils import translation
from django import http
from django.conf import settings
from .versions import versions
def index(request):
template = loader.get_template('index.html')
return Http... | iHamsterball/stellaris_tech_tree | stellaris_tech_tree/views.py | Python | gpl-2.0 | 508 | 0 |
def transpose(a):
return list(map(list, zip(*a)))
| Kallehz/Python | Verkefni 2/Transpose.py | Python | apache-2.0 | 55 | 0.018182 |
###########################################################################
#
# Copyright 2021 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/l... | google/starthinker | cloud_function/main.py | Python | apache-2.0 | 1,752 | 0.005137 |
'''
This program illustrates the use of findContours and drawContours.
The original image is put up along with the image of drawn contours.
Usage:
contours.py
A trackbar is put up which controls the contour level from -3 to 3
'''
import numpy as np
import cv2
name_file_tile = "0.45-nd.png"
file_tile = "../../wp-... | Null01/detect-polygons-from-image | src/generate-polygons/vectorize-img-03.py | Python | gpl-3.0 | 1,108 | 0.01083 |
import numpy as np
import math
from numpy.random import RandomState
import pytest
from cryptorandom.cryptorandom import SHA256
from ..stratified import stratified_permutationtest as spt
from ..stratified import stratified_permutationtest_mean as sptm
from ..stratified import corrcoef, sim_corr, stratified_two_sample
... | statlab/permute | permute/tests/test_stratified.py | Python | bsd-2-clause | 3,861 | 0.003108 |
#!/usr/bin/env python
"""
This is an example MIDAS module
"""
from os.path import isfile
from os import chmod
from time import time, gmtime, strftime
import logging
from sys import argv
from lib.ty_orm import TyORM
from lib.plist import read_plist, get_plist_key
from lib.config import Config
from lib.data_science imp... | serbyy/MIDAS | midas/modules/example_analyzeplist.py | Python | mit | 7,999 | 0.000125 |
# Copyright 2016, 2017, 2018, 2019, 2020 Joachim Wolff
# PhD Thesis
#
# Copyright 2015, 2016 Joachim Wolff
# Master Thesis
# Tutor: Fabrizio Costa
# Winter semester 2015/2016
#
# Chair of Bioinformatics
# Department of Computer Science
# Faculty of Engineering
# Albert-Ludwigs-University Freiburg im Breisgau
__author_... | joachimwolff/minHashNearestNeighbors | sparse_neighbors_search/neighbors/wtaHashClassifier.py | Python | mit | 15,173 | 0.003691 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py | Python | mit | 21,016 | 0.00452 |
from scrapy.downloadermiddlewares.retry import RetryMiddleware
import logging
logger = logging.getLogger(__name__)
class RedisRetryMiddleware(RetryMiddleware):
def __init__(self, settings):
RetryMiddleware.__init__(self, settings)
def _retry(self, request, reason, spider):
retries = request.... | derekluo/scrapy-cluster | crawler/crawling/redis_retry_middleware.py | Python | mit | 1,117 | 0.008953 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-04 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0041_remove_siteconfiguration__allowed_segment_events'),
]
operations = [
migrations.AddField(
... | eduNEXT/edunext-ecommerce | ecommerce/core/migrations/0042_siteconfiguration_enable_partial_program.py | Python | agpl-3.0 | 612 | 0.001634 |
"""Test the Dyson 360 eye robot vacuum component."""
import unittest
from unittest import mock
from libpurecool.const import Dyson360EyeMode, PowerMode
from libpurecool.dyson_360_eye import Dyson360Eye
from homeassistant.components.dyson import vacuum as dyson
from homeassistant.components.dyson.vacuum import Dyson36... | jnewland/home-assistant | tests/components/dyson/test_vacuum.py | Python | apache-2.0 | 6,611 | 0 |
# -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2016 Scifabric LTD.
#
# PYBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | PyBossa/pybossa | test/test_importers/test_s3_importer.py | Python | agpl-3.0 | 6,099 | 0.003771 |
from __future__ import absolute_import
if __name__ == '__main__':
import jamenson.compiler.bind
jamenson.compiler.bind.test()
exit()
from ..runtime.ports import (Port, PortList, connect, disconnect, disconnect_all, replace_connection,
count_connections, get_cell, get_cells, ... | matthagy/Jamenson | jamenson/compiler/bind.py | Python | apache-2.0 | 9,851 | 0.004061 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0008_auto_20151028_1931'),
('newsletter', '0005_auto_20150927_1517'),
]
operations = [
migrations.AddField(
... | rogerhil/flaviabernardes | flaviabernardes/flaviabernardes/newsletter/migrations/0006_auto_20151110_2139.py | Python | apache-2.0 | 1,147 | 0.001744 |
#! /usr/bin/env python3
import json
import logging
import sys
import zmq
def msg_loop(sock):
while True:
try:
message = sock.recv_json()
except Exception as e:
logging.error(e)
continue
logging.info(str(message))
def start_sub(addr):
ctx = zmq.Context()
sock = ctx.socket(zmq.SUB)
logging.info("c... | BeeeOn/server | tools/zmqdump.py | Python | bsd-3-clause | 1,577 | 0.039315 |
"""
Simple Scatter Plot with Labels
===============================
This example shows a basic scatter plot with labels created with Altair.
"""
# category: scatter plots
import altair as alt
import pandas as pd
data = pd.DataFrame({
'x': [1, 3, 5, 7, 9],
'y': [1, 3, 5, 7, 9],
'label': ['A', 'B', 'C', 'D',... | ellisonbg/altair | altair/vegalite/v2/examples/scatter_with_labels.py | Python | bsd-3-clause | 517 | 0 |
# Copyright 2015 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.
import unittest
from catapult_base.dependency_manager import dependency_info
class DependencyInfoTest(unittest.TestCase):
def testInitRequiredInfo(self):... | Bysmyyr/chromium-crosswalk | tools/telemetry/catapult_base/dependency_manager/dependency_info_unittest.py | Python | bsd-3-clause | 19,819 | 0.001716 |
# 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... | mattjhayes/nmeta2 | nmeta2/api.py | Python | apache-2.0 | 36,008 | 0.004832 |
from django.conf.urls.defaults import patterns, url
from commons.views import redirect_to
from . import views
urlpatterns = patterns('',
url(r'^$', redirect_to, {'url': 'eol.home'}),
url(r'^home$', views.home, name='eol.home'),
url(r'^newsletter', views.newsletter, name='eol.newsletter'),
url(r'^m/$'... | mozilla/spark-eol | apps/eol/urls.py | Python | bsd-3-clause | 644 | 0.003106 |
from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.nzb.base import NZBProvider
from dateutil.parser... | jayme-github/CouchPotatoServer | couchpotato/core/providers/nzb/nzbclub/main.py | Python | gpl-3.0 | 2,892 | 0.00657 |
#####################################################################
# Example : decision tree learning
# basic illustrative python script
# For use with test / training datasets : car.{train | test}
# Author : Toby Breckon, toby.breckon@durham.ac.uk
# Version : 0.4 (OpenCV 3 / Python 3 fixes)
# Copyright (c) 2014... | tobybreckon/python-examples-ml | decisiontrees/dtree1.py | Python | lgpl-3.0 | 4,168 | 0.016315 |
#
# Copyright (c) 2013,2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the... | scavarda/mysql-dbcompare | mysql-utilities-1.6.0/mysql/fabric/failure_detector.py | Python | apache-2.0 | 8,960 | 0.000446 |
# -*- coding: utf-8 -*-
from .base import _Base, Base
from .base_collection import BaseCollection
from .habit_groups import HabitGroups
from .habit_groups_collection import HabitGroupsCollection
from .habits import Habits
from .habits_collection import HabitsCollection
from .users import Users
from .users_collection i... | dnguyen0304/mfit_service | mfit/mfit/resources/__init__.py | Python | mit | 1,041 | 0.000961 |
#!/usr/bin/env python
# Copyright 2013 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.
import json
import unittest
from compiled_file_system import CompiledFileSystem
from object_store_creator import ObjectStoreCreator
fr... | s20121035/rk3288_android5.1_repo | external/chromium_org/chrome/common/extensions/docs/server2/redirector_test.py | Python | gpl-3.0 | 7,651 | 0.00183 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | maropu/spark | python/pyspark/mllib/feature.py | Python | apache-2.0 | 28,134 | 0.001102 |
"""
Chunk (N number of bytes at M offset to a source's beginning) provider.
Primarily for file sources but usable by any iterator that has both
seek and read( N ).
"""
import os
import base64
import base
import exceptions
import logging
log = logging.getLogger( __name__ )
# -----------------------------------------... | icaoberg/cellorganizer-galaxy-tools | datatypes/dataproviders/chunk.py | Python | gpl-3.0 | 2,581 | 0.020922 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from functools import partial
from .core import Kernel, Kernel1D, Kernel2D, MAX_NORMALIZATION
from ..utils.exceptions import AstropyUserWarning
from ..utils.console import human_file_size
from ..utils.decorators impor... | funbaker/astropy | astropy/convolution/convolve.py | Python | bsd-3-clause | 35,929 | 0.001169 |
# Terrain Data [ Tools ]
# -> PencilCurves [ ToolList ]
# -> Tool Data [ Radius, Distribution(Uniform(Min/Max), Gaussian(Mean, Falloff)), Scale(Min/max), Rotation(Min/Max), Offset, TypeData ]
# -> Type Data [ Density, (Scale, Rotation, Offset)Absolute, ObjectData ]
# -> Object Data [... | TomMinor/mesh-surface-spawner | FreeformAttributes.py | Python | gpl-2.0 | 15,123 | 0.009588 |
#!/usr/bin/env python
from lib.swap import *
def insertion_sort(L=[]):
''' Unstable implementation of insertion sort.
:param L: list of sortable elements.
'''
if len(L) < 2: return L
for i in range(len(L)):
j = i
while j and L[j] < L[j-1]:
swap(L, j, j-1)
j -... | pymber/algorithms | algorithms/sorting/insertion_sort.py | Python | mit | 336 | 0.008929 |
"""Tests for Climacell weather entity."""
from __future__ import annotations
from datetime import datetime
import logging
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.components.climacell.config_flow import (
_get_config_schema,
_get_unique_id,
)
from homeassistant.... | kennedyshead/home-assistant | tests/components/climacell/test_weather.py | Python | apache-2.0 | 15,479 | 0 |
"""
GuARDIANs (packaGe for Ao eRror breakDown estImation And exploitatioN)
"""
__all__ = ["groot", "gamora", "roket", "drax", "starlord"]
| ANR-COMPASS/shesha | guardians/__init__.py | Python | gpl-3.0 | 138 | 0 |
'''
TestPyRAMmp unit test class.
Uses configuration file TestPyRAMmp_Config.xml.
Computational range and depth steps and number of repetitions are configurable.
Number of PyRAM runs = number of frequencies * number of repetitions.
Tests should always pass but speedup will depend upon computing environment.
'''
import ... | marcuskd/pyram | pyram/Tests/TestPyRAMmp.py | Python | bsd-3-clause | 4,888 | 0.001432 |
import sys
import os
from django.test import TestCase, override_settings, Client
from django.conf import settings
from ..conf import (DatabaseUndefined, validate_database,
InaccessibleSettings, _load_py_file, load_py_settings,
load_colab_apps, load_widgets_settings)
from mock ... | colab/colab | colab/utils/tests/test_conf.py | Python | gpl-2.0 | 4,536 | 0 |
# -*- coding: utf-8 -*-
# YAFF is yet another force-field code.
# Copyright (C) 2011 Toon Verstraelen <Toon.Verstraelen@UGent.be>,
# Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>, Center for Molecular Modeling
# (CMM), Ghent University, Ghent, Belgium; all rights reserved unless otherwise
# stated.
#
# This file is pa... | molmod/yaff | yaff/analysis/test/test_blav.py | Python | gpl-3.0 | 1,509 | 0.001325 |
#!/usr/bin/env python
###############################################################
# AniConvert: Batch convert directories of videos using
# HandBrake. Intended to be used on anime and TV series,
# where files downloaded as a batch tend to have the same
# track layout. Can also automatically select a single audio
# ... | apsun/AniConvert | aniconvert.py | Python | mit | 34,380 | 0.001716 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.mrtrix.tracking import DiffusionTensorStreamlineTrack
def test_DiffusionTensorStreamlineTrack_inputs():
input_map = dict(args=dict(argstr='%s',
),
cutoff_value=dict(argstr='-cutoff %s',
... | dmordom/nipype | nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py | Python | bsd-3-clause | 3,157 | 0.029142 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011 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 (a... | jmacmahon/invenio | modules/bibformat/lib/elements/bfe_year.py | Python | gpl-2.0 | 1,262 | 0.003962 |
"""Test lazymod.py"""
import sys
import unittest
from capa.safe_exec.lazymod import LazyModule
class ModuleIsolation(object):
"""
Manage changes to sys.modules so that we can roll back imported modules.
Create this object, it will snapshot the currently imported modules. When
you call `clean_up()`,... | angelapper/edx-platform | common/lib/capa/capa/safe_exec/tests/test_lazymod.py | Python | agpl-3.0 | 2,041 | 0.00049 |
import pcl
p = pcl.PointCloud()
p.from_file("test_pcd.pcd")
fil = p.make_statistical_outlier_filter()
fil.set_mean_k (50)
fil.set_std_dev_mul_thresh (1.0)
fil.filter().to_file("inliers.pcd") | hunter-87/binocular-dense-stereo | cpp_pcl_visualization/pcl_visualization_pcd/pcl_test.py | Python | gpl-2.0 | 190 | 0.015789 |
import datetime
import re
from django.http import HttpResponse
from django.utils.http import urlencode
import smsgateway
from smsgateway.models import SMS
from smsgateway.backends.base import SMSBackend
from smsgateway.utils import check_cell_phone_number
class MobileWebBackend(SMSBackend):
def get_send_url(self... | peterayeni/django-smsgateway | smsgateway/backends/mobileweb.py | Python | bsd-3-clause | 2,600 | 0.002692 |
from django.core.management.base import BaseCommand
from django.db import connection
from .createopenslidesuser import Command as CreateOpenslidesUser
class Command(BaseCommand):
"""
Command to create an OpenSlides user.
"""
help = "Creates an OpenSlides user with id=2 if no other user than the admi... | FinnStutzenstein/OpenSlides | server/openslides/users/management/commands/createinitialuser.py | Python | mit | 1,391 | 0.002157 |
# Copyright (c) 2013 Mirantis 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 writ... | keedio/sahara | sahara/utils/openstack/heat.py | Python | apache-2.0 | 10,597 | 0 |
""" Python Character Mapping Codec generated from 'CP437.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,error... | remybaranx/qtaste | tools/jython/lib/Lib/encodings/cp437.py | Python | gpl-3.0 | 7,146 | 0.039603 |
from django.conf import settings
import mock
from nose.tools import eq_
from test_utils import RequestFactory
from commonware.request.middleware import (SetRemoteAddrFromForwardedFor,
is_valid)
mw = SetRemoteAddrFromForwardedFor()
def get_req():
req = RequestFactory(... | mozilla/captain | vendor/lib/python/commonware/request/tests.py | Python | mpl-2.0 | 2,104 | 0 |
from __future__ import unicode_literals
import logging
import hashlib
from mopidy.backends import base
from mopidy.models import Artist, Album, Track, SearchResult
logger = logging.getLogger('mopidy.backends.gmusic')
class GMusicLibraryProvider(base.BaseLibraryProvider):
def find_exact(self, query=None, uris=... | jeh/mopidy-gmusic | mopidy_gmusic/library.py | Python | apache-2.0 | 11,350 | 0.00141 |
"""Adds a simulated sensor."""
from datetime import datetime
import logging
import math
from random import Random
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpe... | nkgilley/home-assistant | homeassistant/components/simulated/sensor.py | Python | apache-2.0 | 4,609 | 0.000434 |
# -*- coding: utf-8 -*-
# Zeobuilder is an extensible GUI-toolkit for molecular model construction.
# Copyright (C) 2007 - 2012 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center
# for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights
# reserved unless otherwise stated.
#
# This file is part of Z... | molmod/zeobuilder | share/plugins/basic/point.py | Python | gpl-3.0 | 7,413 | 0.002698 |
# -*- coding: utf-8 -*-
#
# Discover the target host types in the subnet
#
# @author: Sreejith Kesavan <sreejithemk@gmail.com>
import arp
import oui
import ipcalc
import sys
class Discovery(object):
""" Find out the host types in the Ip range (CIDR)
NOTE: This finds mac addresses only within the subnet.
... | semk/iDiscover | idiscover/discover.py | Python | mit | 1,840 | 0.00163 |
"""
Implements counterwallet asset-related support as a counterblock plugin
DEPENDENCIES: This module requires the assets module to be loaded before it.
Python 2.x, as counterblock is still python 2.x
"""
import os
import sys
import time
import datetime
import logging
import decimal
import urllib.request
import urlli... | CounterpartyXCP/counterblock | counterblock/lib/modules/dex/__init__.py | Python | mit | 32,660 | 0.004195 |
import floq.core.fixed_system as fs
import floq.evolution as ev
import floq.errors as er
import floq.helpers.index as h
class ParametricSystemBase(object):
"""
Base class to specify a physical system that still has open parameters,
such as the control amplitudes, the control duration, or other arbitrary
... | sirmarcel/floq | benchmark/museum_of_evolution/uncompiled_floq/parametric_system.py | Python | mit | 2,852 | 0.002454 |
# Copyright 2015 Ian Lynn
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distribute... | Swabboy/ImageDateSort | ImageDateSort.py | Python | gpl-3.0 | 7,213 | 0.014973 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_surlin_rolei_q1_recruitment_disk.iff"
res... | anhstudios/swganh | data/scripts/templates/object/tangible/mission/quest_item/shared_surlin_rolei_q1_recruitment_disk.py | Python | mit | 511 | 0.043053 |
# 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... | tiagofrepereira2012/tensorflow | tensorflow/python/util/nest.py | Python | apache-2.0 | 21,628 | 0.00504 |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | nebril/fuel-web | nailgun/nailgun/test/integration/test_node_allocation_stats_handler.py | Python | apache-2.0 | 1,552 | 0 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from pycket import impersonators as imp
from pycket import values
from pycket import values_parameter, values_struct
from pycket.arity import Arity
from pycket.error import SchemeException
from pycket.prims.expose import... | pycket/pycket | pycket/prims/struct_structinfo.py | Python | mit | 11,050 | 0.006063 |
# -*- coding: utf-8 -*-
"""
This module allows running system commands directly
from Rabbithole. This can be good for simple commands
such as ping. There is currently no way to filter arguments
given to wrapped commands. For that kind of functionality,
a separate module should be created,
"""
import rh.common as common... | dragonrider23/rabbithole | modules/cmd_wrappers.py | Python | bsd-3-clause | 673 | 0.001486 |
from .path import Path
class Morphism(object):
def __init__(self, arrows):
self.arrows = arrows
def __call__(self, domain):
codomain = {}
for arrow in self.arrows:
codomain = arrow.apply(domain, codomain)
return codomain
@classmethod
def compile(cls, *exp... | cieplak/morf | morf/morphism.py | Python | mit | 2,478 | 0 |
# -*- coding: UTF-8 -*-
"""
$Id$
$URL$
Copyright (c) 2010 foption
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 rights
to use, copy, modif... | msteinhoff/foption-bot | src/python/tools/cleandb.py | Python | mit | 1,658 | 0.001809 |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright (C) 2020 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import subprocess
from .base import Installer
__author__ =... | kYc0o/RIOT | dist/tools/dhcpv6-pd_ia/pkg/apt.py | Python | lgpl-2.1 | 703 | 0 |
#!/usr/bin/env python
""" fs_setup.py - set up directories for freesurfer analysis
"""
## Copyright 2011, Russell Poldrack. All rights reserved.
## Redistribution and use in source and binary forms, with or without modification, are
## permitted provided that the following conditions are met:
## 1. Redistributions... | poldrack/openfmri | pipeline/fs_setup.py | Python | bsd-2-clause | 2,291 | 0.030554 |
# encoding: 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 model 'ImportedFile'
db.create_table('projects_importedfile', (
('id', self.gf('djang... | KamranMackey/readthedocs.org | readthedocs/projects/migrations/0006_add_imported_file.py | Python | mit | 8,964 | 0.008701 |
from django.contrib import admin
from .models import Question
# Register your models here.
admin.site.register(Question)
| BeardedPlatypus/capita-selecta-ctf | ctf/players/admin.py | Python | mit | 126 | 0.007937 |
#!/usr/bin/env python
import sys
import os
import logging
from extensions import valid_tagging_extensions
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4
from tmdb_mp4 import tmdb_mp4
from autoprocess import plex
from post_processor import PostProcessor
from logging.config import fileConfig
logpat... | Collisionc/sickbeard_mp4_automator | postCouchPotato.py | Python | mit | 2,496 | 0.002804 |
#!/usr/bin/env python
'''
Files and renames your films according to genre
using IMDb API
supert-is-taken 2015
'''
from imdb import IMDb
import sys
import re
import os
import errno
import codecs
db=IMDb()
def main(argv):
for filename in sys.argv[1:]:
print filename
movie_list=db.search_movie( c... | supert-is-taken/film-sorter | film_sorter.py | Python | gpl-3.0 | 3,764 | 0.005579 |
"""Diagnostics support for the Mazda integration."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics.util import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core ... | rohitranjan1991/home-assistant | homeassistant/components/mazda/diagnostics.py | Python | mit | 1,836 | 0.000545 |
# ###
# Copyright (c) 2010 Konstantinos Spyropoulos <inigo.aldana@gmail.com>
#
# This file is part of inimailbot
#
# inimailbot 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, ... | edu-zamora/inimailbot | cron_updater.py | Python | gpl-3.0 | 2,032 | 0.02313 |
from setuptools import setup, find_packages
setup(
name='roster',
version='1.0',
description='Roster: A library for simple service discovery using Dynamodb for Python',
long_description=open('README.md').read(),
author='Tim Rijavec',
author_email='tim@trustedhousesitters.com',
url='https:/... | trustedhousesitters/roster-python | setup.py | Python | mit | 860 | 0.003488 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-08 21:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0003_auto_20160508_2115'),
]
operations = [
migrations.AlterField(
... | porimol/django-blog | cms/migrations/0004_auto_20160508_2117.py | Python | mit | 468 | 0 |
#!/usr/bin/python
#First Method taking in file "matrix.txt" and printing list of lists
#Function1
def readmatrix( file ):
list = open( file, 'r' )
return list.readlines();
#Calling function
print readmatrix( 'matrix.txt' )
#Funtion2
def reverse( list, matrixfile ):
file = open( matrixfile, 'w' )
for i i... | gjwajda/Computational-Tools-For-Big-Data | Exercise2/exercise2_1.py | Python | mit | 449 | 0.062361 |
# -*- coding: utf-8 -*-
import romspy
romspy.hview('nc/ob500_grd-v5.nc',
'ob500_grd-v5.png',
vname='h',
cblabel='Depth[m]',
vmax=0, vmin=-120, interval=20, cff=-1,
obsfile='nc/ob500_obs_tsdc.nc')
| okadate/romspy | example/OB500/hview_ob500_grd.py | Python | mit | 263 | 0 |
from django.db.models import signals
from django.utils.functional import curry
from django.contrib.contenttypes.models import ContentType
from django.core import serializers
from django.contrib.admin.models import LogEntry
from django.contrib.sessions.models import Session
from django_extlog.models import ExtLog
cla... | AxiaCore/django-extlog | django_extlog/middleware.py | Python | mit | 2,967 | 0 |
from appkit.api.v0_2_8 import App
app = App(__name__)
@app.route("/")
def home():
return '<a href="#" target="_blank">Clique</a>'
app.run()
| diogocs1/facebookexplorer | teste.py | Python | apache-2.0 | 144 | 0.020833 |
#Copyright 2012 Thomas A Caswell
#tcaswell@uchicago.edu
#http://jfi.uchicago.edu/~tcaswell
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 3 of the License, or (at
#your option) an... | soft-matter/mr | customized_trackpy/tracking.py | Python | gpl-3.0 | 24,253 | 0.001938 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | dtaht/ns-3-dev | src/flow-monitor/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 411,996 | 0.015158 |
import requests
import unicodecsv
from io import StringIO
#what country has the most serious earthquakes lately?
url = "http://python-gijc15.s3.eu-central-1.amazonaws.com/all_month.csv"
r = requests.get(url)
text = StringIO(r.text)
reader = unicodecsv.DictReader(text, dialect='excel')
new_collection = []
for row i... | tommeagher/pythonGIJC15 | scripts/completed/quakes_complete.py | Python | mit | 980 | 0.006122 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
# This file is based upon the file generated by sphinx-quickstart. However,
# where sphinx-quickstart hardcodes values in this file that you input, this
# file has been changed to pull from your module's metadata module.
#
# This file is execfile(... | echevemaster/fedora-college | docs/source/conf.py | Python | bsd-3-clause | 8,753 | 0.004798 |
import os
from glob import glob
from itertools import chain
from typing import Iterable
import json
import jinja2
import shutil
from bank_wrangler import schema
def _generate_data_json(transactions, accounts):
transactions = [list(map(str, row))
for row in transactions]
return json.dumps({... | tmerr/bank_wrangler | bank_wrangler/report/__init__.py | Python | gpl-3.0 | 2,519 | 0.000794 |
# subject.py
# Implements Subject.
#
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is ... | rpm-software-management/dnf | dnf/subject.py | Python | gpl-2.0 | 1,150 | 0.00087 |
# Copyright (C) 2012 Red Hat, 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 ... | HybridF5/jacket | jacket/tests/compute/unit/virt/disk/test_inject.py | Python | apache-2.0 | 11,880 | 0.000084 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.