repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
mcking49/apache-flask
refs/heads/master
Python/Lib/site-packages/pylint/test/functional/yield_from_iterable_py33.py
15
""" Check that `yield from`-statement takes an iterable. """ # pylint: disable=missing-docstring def to_ten(): yield from 10 # [not-an-iterable]
Boyang--Li/ardupilot
refs/heads/master
Tools/ardupilotwaf/toolchain.py
12
""" WAF Tool to select the correct toolchain based on the target archtecture. This tool loads compiler_c and compiler_cxx, so you don't need to load them (and you must not load them before this tool). Use the environment variable TOOLCHAIN to define the toolchain. Example:: def configure(cfg): cfg.env.TO...
andrewramsay/ical_to_gcal_sync
refs/heads/master
ical_to_gcal_sync.py
1
from __future__ import print_function import logging import time import string import re import sys #import pickle import googleapiclient import arrow from icalevents.icalevents import events from dateutil.tz import gettz from datetime import datetime, timezone, timedelta from auth import auth_with_calendar_api fro...
lablup/sorna-manager
refs/heads/master
src/ai/backend/manager/models/alembic/versions/e18ed5fcfedf_add_superadmin_role_for_user.py
1
"""add superadmin role for user Revision ID: e18ed5fcfedf Revises: c5e4e764f9e3 Create Date: 2019-05-29 23:17:17.762968 """ import textwrap from alembic import op from ai.backend.manager.models import UserRole # revision identifiers, used by Alembic. revision = 'e18ed5fcfedf' down_revision = 'c5e4e764f9e3' branch_...
PrairieLearn/PrairieLearn
refs/heads/master
exampleCourse/questions/element/pythonVariable/test.py
3
df = pd.io.parsers.read_csv("breast-cancer-train.dat", header=None) df = df.head(15)
mozilla/spark
refs/heads/master
apps/mobile/tests/test_views.py
1
from django.conf import settings from django.http import HttpResponseRedirect from nose.tools import eq_ from pyquery import PyQuery as pq from spark.tests import TestCase, LocalizingClient from spark.urlresolvers import reverse from spark.models import City from mobile import forms from users.models import User c...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/platform/google_appengine/lib/PyAMF-0.6.1/pyamf/remoting/gateway/django.py
39
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Gateway for the Django framework. This gateway allows you to expose functions in Django to AMF clients and servers. @see: U{Django homepage<http://djangoproject.com>} @since: 0.1.0 """ django = __import__('django.http') http = django.http conf = ...
Som-Energia/somenergia-phonetimetable
refs/heads/master
tomatic/remote.py
1
# -*- coding: utf-8 -*- from paramiko import SSHClient,AutoAddPolicy, SFTPClient class Remote(object): def __init__(self, username, host): self.ssh = SSHClient() self.ssh.set_missing_host_key_policy(AutoAddPolicy()) self.ssh.connect(host, username=username) def __enter__(self): ...
Aptitudetech/ERPNext
refs/heads/master
erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py
121
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class LeaveBlockListAllow(Document): pass
Anderson-Lab/SNV-DA
refs/heads/master
SNV_calling_and_processing/identify_high_cov_SNVs.py
1
import sys import os variantDir = sys.argv[1] coverage = sys.argv[2] uniqueSNPs = set() os.system("mkdir freqs") for file in os.listdir(variantDir): if file.find("variant") != -1: input = open(variantDir + "/" + file, "r") print variantDir + "/" + file freqFile = open("freqs/" + file[:file.find(".variant")...
qedi-r/home-assistant
refs/heads/dev
homeassistant/auth/providers/homeassistant.py
3
"""Home Assistant auth provider.""" import asyncio import base64 from collections import OrderedDict import logging from typing import Any, Dict, List, Optional, Set, cast import bcrypt import voluptuous as vol from homeassistant.const import CONF_ID from homeassistant.core import callback, HomeAssistant from homeas...
2014c2g5/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_io.py
629
""" Python implementation of the io module. """ import os import abc import codecs import errno # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock import io #brython fix me #from io imp...
danielchalef/Arduino
refs/heads/esp8266
arduino-core/src/processing/app/i18n/python/requests/exceptions.py
276
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ class RequestException(RuntimeError): """There was an ambiguous exception that occurred while handling your request.""" class HTTPError(RequestException): """An HTTP error occ...
elijah513/django
refs/heads/master
tests/custom_pk/models.py
282
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
riveridea/gnuradio
refs/heads/master
gr-digital/python/digital/qa_mpsk_snr_est.py
11
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
kumar303/addons-server
refs/heads/master
settings.py
2
"""This is the standard development settings file. If you need to overload settings, please do so in a local_settings.py file (it won't be tracked in git). """ import os from six.moves.urllib_parse import urlparse from olympia.lib.settings_base import * # noqa WSGI_APPLICATION = 'olympia.wsgi.application' DEBUG =...
anntzer/scikit-learn
refs/heads/main
examples/linear_model/plot_sgd_comparison.py
23
""" ================================== Comparing various online solvers ================================== An example showing how different online solvers perform on the hand-written digits dataset. """ # Author: Rob Zinkov <rob at zinkov dot com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot a...
elric/virtaal-debian-snapshots
refs/heads/master
virtaal/controllers/cursor.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of Virtaal. # # 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 ...
alex/virtualenv-clone
refs/heads/master
tests/test_virtualenv_sys.py
2
import os import subprocess from unittest import TestCase import clonevirtualenv import sys from tests import venv_path, clone_path, versions, clean class TestVirtualenvSys(TestCase): def setUp(self): """Clean from previous testing""" clean() def tearDown(self): """Clean up our testin...
dsajkl/123
refs/heads/master
lms/envs/content.py
6
""" These are debug machines used for content creators, so they're kind of a cross between dev machines and AWS machines. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0614 from .aws import * DEBUG = True TEMPLA...
davidastephens/zipline
refs/heads/master
zipline/transforms/vwap.py
2
# # Copyright 2013 Quantopian, 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 wr...
ZLLab-Mooc/edx-platform
refs/heads/named-release/dogwood.rc
common/lib/xmodule/xmodule/assetstore/tests/test_asset_xml.py
113
""" Test for asset XML generation / parsing. """ from path import Path as path from lxml import etree from contracts import ContractNotRespected import unittest from opaque_keys.edx.locator import CourseLocator from xmodule.assetstore import AssetMetadata from xmodule.modulestore.tests.test_assetstore import AssetSto...
s20121035/rk3288_android5.1_repo
refs/heads/master
external/chromium_org/tools/telemetry/telemetry/page/actions/scroll_unittest.py
33
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.page.actions import scroll from telemetry.unittest import tab_test_case from telemetry.unittest import test class ScrollActionTes...
hwu25/AppPkg
refs/heads/trunk
Applications/Python/Python-2.7.2/Lib/xml/etree/cElementTree.py
32
# Wrapper module for _elementtree from _elementtree import *
nilbody/h2o-3
refs/heads/master
h2o-py/tests/testdir_algos/glm/pyunit_DEPRECATED_NOFEATURE_getLambdaModel_mediumGLM.py
1
from __future__ import print_function from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import random def getLambdaModel(): print("Read data") prostate = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate.csv")) myX = ["AGE","RAC...
PsychoTV/PsychoTeam.repository
refs/heads/master
plugin.video.specto/resources/lib/resolvers/videoweed.py
23
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
Unow/edx-platform
refs/heads/master
lms/envs/devgroups/m_6002.py
74
# We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0614 from .courses import * DATABASES = course_db_for('MITx/6.002x/2012_Fall')
freevo/kaa-base
refs/heads/master
src/callable.py
1
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # callable.py - Callable classes # ----------------------------------------------------------------------------- # kaa.base - The Kaa Application Framework # Copyright 2005-2012 Dirk Meyer, Jason Tackaberry, et ...
django-silk/silk
refs/heads/master
silk/auth.py
3
from functools import wraps from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.utils.decorators import available_attrs from silk.config import SilkyConfig def login_possibly_required(function=None, **kwargs): if SilkyConfig().SILKY_AUTHENTIC...
botswana-harvard/eit
refs/heads/develop
eit/apps/eit_lab/models/order.py
1
from datetime import datetime from django.db import models from edc.device.sync.models import BaseSyncUuidModel # from ..managers import OrderManager class Order(BaseSyncUuidModel): order_datetime = models.DateTimeField(default=datetime.today()) # objects = OrderManager() def natural_key(self): ...
noslenfa/tdjangorest
refs/heads/master
uw/lib/python2.7/site-packages/Crypto/SelfTest/Random/Fortuna/test_FortunaAccumulator.py
116
# -*- coding: utf-8 -*- # # SelfTest/Random/Fortuna/test_FortunaAccumulator.py: Self-test for the FortunaAccumulator module # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public dom...
fhaoquan/kbengine
refs/heads/master
kbe/src/lib/python/Lib/encodings/mac_iceland.py
272
""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
arokem/scipy
refs/heads/master
scipy/io/matlab/tests/test_pathological.py
26
""" Test reading of files not conforming to matlab specification We try and read any file that matlab reads, these files included """ from __future__ import division, print_function, absolute_import from os.path import dirname, join as pjoin from numpy.testing import assert_ from pytest import raises as assert_raise...
jelugbo/hebs_master
refs/heads/master
common/lib/xmodule/xmodule/modulestore/django.py
17
""" Module that provides a connection to the ModuleStore specified in the django settings. Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import from importlib import import_module from django.conf import settings if not settings.configured: settings.configure() fro...
statik/grr
refs/heads/master
lib/data_stores/mysql_advanced_data_store_test.py
4
#!/usr/bin/env python """Tests the mysql data store.""" import unittest import logging from grr.lib import access_control from grr.lib import data_store from grr.lib import data_store_test from grr.lib import flags from grr.lib import test_lib from grr.lib.data_stores import mysql_advanced_data_store class MysqlAd...
toshywoshy/ansible
refs/heads/devel
test/units/modules/network/nxos/test_nxos_interface.py
21
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is dis...
cruzegoodin/TSC-ShippingDetails
refs/heads/master
flask/lib/python2.7/site-packages/six.py
878
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
24HeuresINSA/pass-checker
refs/heads/master
tests/python/base/test_views.py
10
from django.core.urlresolvers import reverse from django.test import override_settings from rest_framework import status from rest_framework.test import APITestCase from tests.python.accounts.test_models import UserFactory from tests.python.accounts.test_views import get_basic_auth_header @override_settings(CELERY_E...
Yas3r/OWASP-ZSC
refs/heads/master
lib/encoder/linux_x86/mix_all.py
2
#!/usr/bin/env python ''' OWASP ZSC | ZCR Shellcoder ZeroDay Cyber Research Z3r0D4y.Com Ali Razmjoo ''' import random,binascii,string chars = string.digits + string.ascii_letters def start(shellcode,job): encodes = ['add_random','sub_random','xor_random','inc_timesyouwant','dec_timesyouwant'] #much junk codes, need ...
Vagab0nd/SiCKRAGE
refs/heads/master
lib3/tornado/test/import_test.py
11
# flake8: noqa import subprocess import sys import unittest _import_everything = b""" # The event loop is not fork-safe, and it's easy to initialize an asyncio.Future # at startup, which in turn creates the default event loop and prevents forking. # Explicitly disallow the default event loop so that an error will be r...
JianfengXu/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_default-src_cross-origin_multi_font_allowed_two-manual.py
25
def main(request, response): _URL = request.url _CSP = "default-src http://www.tizen.com " + \ _URL[:_URL.index('/csp') + 1] + "; style-src 'unsafe-inline'" _CSSURL = _URL[:_URL.index('/csp') + 1] + "csp/support/w3c/CanvasTest.ttf" print _CSSURL response.headers.set("Content-Security-Policy...
unsiloai/syntaxnet-ops-hack
refs/heads/master
tensorflow/python/profiler/internal/print_model_analysis_test.py
41
# 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...
Abce/googletest
refs/heads/master
test/gtest_throw_on_failure_test.py
2917
#!/usr/bin/env python # # Copyright 2009, 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...
stshine/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/_pytest/mark.py
168
""" generic mechanism for marking and selecting python functions. """ import inspect class MarkerError(Exception): """Error in use of a pytest marker/attribute.""" def pytest_namespace(): return {'mark': MarkGenerator()} def pytest_addoption(parser): group = parser.getgroup("general") group._addo...
JarbasAI/JarbasAI
refs/heads/patch-15
test/unittests/api/test_api.py
1
import unittest from copy import copy import mock import mycroft.api import mycroft.configuration CONFIG = { 'server': { 'url': 'https://api-test.mycroft.ai', 'version': 'v1', 'update': True, 'metrics': False } } mycroft.api.requests.post = mock.MagicMock() def create_respo...
amiramix/serna-free
refs/heads/master
serna/dist/plugins/dita/publishing/Dita.py
5
## ## Copyright(c) 2009 Syntext, Inc. All Rights Reserved. ## Contact: info@syntext.com, http://www.syntext.com ## ## This file is part of Syntext Serna XML Editor. ## ## COMMERCIAL USAGE ## Licensees holding valid Syntext Serna commercial licenses may use this file ## in accordance with the Syntext Serna Commercial...
cristian69/KernotekV3
refs/heads/master
venv/lib/python2.7/site-packages/jinja2/testsuite/regression.py
414
# -*- coding: utf-8 -*- """ jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Template, Enviro...
gnuhub/intellij-community
refs/heads/master
python/lib/Lib/dbexts.py
74
# $Id: dbexts.py 6638 2009-08-10 17:05:49Z fwierzbicki $ """ This script provides platform independence by wrapping Python Database API 2.0 compatible drivers to allow seamless database usage across implementations. In order to use the C version, you need mxODBC and mxDateTime. In order to use the Java version, you n...
doismellburning/edx-platform
refs/heads/master
common/djangoapps/student/migrations/0002_text_to_varchar_and_indexes.py
188
# 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): # Changing field 'UserProfile.name' db.alter_column('auth_userprofile', 'name', self.gf('django.db.models.fields....
myerpengine/odoo
refs/heads/master
addons/web_tests/__openerp__.py
382
{ 'name': 'Tests', 'category': 'Hidden', 'description': """ OpenERP Web test suite. ======================= """, 'version': '2.0', 'depends': ['web', 'web_kanban'], 'data' : [ 'views/web_tests.xml', ], 'auto_install': True, }
mnahm5/django-estore
refs/heads/master
Lib/site-packages/docutils/writers/xetex/__init__.py
86
#!/usr/bin/env python # -*- coding: utf-8 -*- # :Author: Günter Milde <milde@users.sourceforge.net> # :Revision: $Revision: 7668 $ # :Date: $Date: 2013-06-04 14:46:30 +0200 (Die, 04. Jun 2013) $ # :Copyright: © 2010 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: # # Co...
gengwg/leetcode
refs/heads/master
095_unique_bst_ii.py
1
# -*- coding: utf-8 -*- """ 95. Unique Binary Search Trees II Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. 1 3 3 2 1 \ / / / \ ...
nkgilley/home-assistant
refs/heads/dev
homeassistant/helpers/entity_registry.py
3
"""Provide a registry to track entity IDs. The Entity Registry keeps a registry of entities. Entities are uniquely identified by their domain, platform and a unique id provided by that platform. The Entity Registry will persist itself 10 seconds after a new entity is registered. Registering a new entity while a timer...
amplifylitco/asiaq
refs/heads/master
sample_configuration/test/test_pylint.py
2
"""Validates all python scripts for syntax and linting""" from unittest import TestCase import os import os.path from pylint import lint from pylint.reporters.text import TextReporter PYLINT_ARGS = ["--reports=n", "--output-format=colorized", "--rcfile=.pylintrc"] # inspired by http://stackoverflow.com/questions/20...
40223135/40223135-
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/importlib/_bootstrap.py
623
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
beck/django
refs/heads/master
tests/apps/default_config_app/__init__.py
553
default_app_config = 'apps.default_config_app.apps.CustomConfig'
omererdem/honeything
refs/heads/master
src/cwmp/tr/api_test.py
6
#!/usr/bin/python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
dropbox/hocrux
refs/heads/master
src/processimg.py
2
import sys import PIL.Image import PIL.ImageEnhance if __name__ == "__main__": img = PIL.Image.open(sys.argv[1]) img = img.convert("L") img = img.resize((img.size[0]/7, img.size[1]/7)) en = PIL.ImageEnhance.Contrast(img) img2 = en.enhance(2.5) br = PIL.ImageEnhance.Brightness(img2) img2 = b...
GunoH/intellij-community
refs/heads/master
python/testData/surround/SurroundWithTryExcept.py
8
def foo(): pr<caret>int("hello")
igor-rangel7l/igorrangelteste.repository
refs/heads/master
script.module.urlresolver/lib/urlresolver/plugins/vivosx.py
1
''' vivo.sx urlresolver plugin Copyright (C) 2015 y2000j 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 distr...
ToBeReplaced/ansible-modules-extras
refs/heads/devel
packaging/os/pkgin.py
69
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com> # Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to> # # Written by Shaun Zinck # Based on pacman module written by Afterburn <http://github.com/afterburn> # that was based on apt module written by Matthew Wi...
danking/hail
refs/heads/no-query-service-2
datasets/load/load.LDSC_baselineLD_v2.2_ld_scores.GRCh37.py
3
import hail as hl root = 'gs://hail-datasets-raw-data/LDSC/baselineLD_v2.2' mt = hl.import_matrix_table(f'{root}/ld_scores.GRCh37.tsv.bgz', row_fields={'CHR': hl.tstr, 'SNP': hl.tstr, 'BP': hl.tint}, entry_type=hl.tstr) mt = mt.annotate_entries(x=hl.float(mt['x'])) mt = mt.annotate_rows( locus=hl.locus(mt['...
baffolobill/mb_test_1
refs/heads/master
src/mbtest1/rest_framework_json_api/parsers.py
1
from rest_framework import parsers, relations from rest_framework_json_api.utils import ( get_related_field, is_related_many, model_from_obj, model_to_resource_type ) from django.utils import six class JsonApiMixin(object): media_type = 'application/vnd.api+json' def parse(self, stream, media_type=No...
mpetyx/palmdrop
refs/heads/master
venv/lib/python2.7/site-packages/cms/management/commands/cms.py
8
# -*- coding: utf-8 -*- from __future__ import absolute_import from cms.management.commands.subcommands.base import SubcommandsCommand from cms.management.commands.subcommands.check import CheckInstallation from cms.management.commands.subcommands.list import ListCommand from cms.management.commands.subcommands.moderat...
IvS-KULeuven/ComboCode
refs/heads/master
cc/tools/units/Equivalency.py
3
# -*- coding: utf-8 -*- """ Equivalencies for the astropy.units module for converting several quantities in both directions. Author: R. Lombaert """ from astropy import units as u from astropy import constants as cst import numpy as np def Tmb(diameter): ''' Converting main-beam temperature in K to Fnu i...
izonder/intellij-community
refs/heads/master
python/helpers/docutils/parsers/rst/languages/ca.py
57
# $Id: ca.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Ivan Vilata i Balaguer <ivan@selidor.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # tra...
meredith-digops/ansible
refs/heads/devel
lib/ansible/modules/storage/netapp/netapp_e_lun_mapping.py
27
#!/usr/bin/python # (c) 2016, NetApp, Inc # # This file is part of Ansible # # Ansible 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....
signed/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/gdal/prototypes/srs.py
321
from ctypes import c_char_p, c_int, c_void_p, POINTER from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import \ const_string_output, double_output, int_output, \ srs_output, string_output, void_output ## Shortcut generation for routines with known p...
jlegendary/scikit-learn
refs/heads/master
examples/feature_selection/plot_rfe_with_cross_validation.py
226
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
rpmcpp/Audacity
refs/heads/master
lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Logs.py
134
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re,traceback,sys try: import threading except ImportError: pass else: wlock=threading.Lock() class sync_stream(object): def __init__(self,stream): self.stre...
rootAvish/scrapy
refs/heads/master
tests/test_contracts.py
140
from unittest import TextTestResult from twisted.trial import unittest from scrapy.spiders import Spider from scrapy.http import Request from scrapy.item import Item, Field from scrapy.contracts import ContractsManager from scrapy.contracts.default import ( UrlContract, ReturnsContract, ScrapesContract, )...
KangBangKreations/KangBangKing
refs/heads/kb-stable
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
40223226/W17test2
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/xml/sax/expatreader.py
870
""" SAX driver for the pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. """ version = "0.20" from xml.sax._exceptions import * from xml.sax.handler import feature_validation, feature_namespaces from xml.sax.handler import feature_namespace_prefixes from xml.sax.handler import feature_external_...
pspacek/freeipa
refs/heads/master
ipatests/test_ipaserver/test_changepw.py
3
# Authors: # Martin Kosek <mkosek@redhat.com> # # Copyright (C) 2012 Red Hat # see file 'COPYING' for use and warranty information # # 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 ver...
kdrone/crazyflie-python-client
refs/heads/master
build/lib.linux-i686-2.7/cflib/utils/callbacks.py
40
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
uw-it-aca/uw-restclients
refs/heads/master
restclients/test/pws/photo.py
1
from django.test import TestCase from restclients.models.sws import Person from restclients.pws import PWS from restclients.exceptions import InvalidIdCardPhotoSize, InvalidNetID from restclients.exceptions import DataFailureException from restclients.test import fdao_pws_override @fdao_pws_override class IdCardTestP...
saurabh6790/omni-apps
refs/heads/master
selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import _, msgprint from webnotes.utils import flt import time from accounts.utils import get_fiscal_year from controlle...
drbothen/pyamazonclouddrive
refs/heads/master
pyacd/api.py
10
# Copyright (c) 2011 anatanokeitai.com(sakurai_youhei) # # 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, modify, ...
phoebusliang/parallel-lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/urlpatterns_reverse/no_urls.py
106
#from django.conf.urls.defaults import *
snnn/tensorflow
refs/heads/master
tensorflow/python/platform/build_info_test.py
71
# Copyright 2015 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...
dohoangkhiem/ansible
refs/heads/devel
contrib/inventory/consul_io.py
108
#!/usr/bin/env python # # (c) 2015, Steve Gargan <steve.gargan@gmail.com> # # This file is part of Ansible, # # Ansible 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 # (a...
PapenfussLab/Mungo
refs/heads/master
bin/fastaLengthsSimple.py
1
#!/usr/bin/env python """ fastaLengthsSimple.py Author: Tony Papenfuss Date: Wed Mar 26 15:03:28 EST 2008 """ import sys from mungo.fasta import FastaFile from optparse import OptionParser usage = "%prog <Input file1> [<Input file2> ...]" parser = OptionParser(usage=usage, version="%prog - Version 1") options, args...
acarmel/CouchPotatoServer
refs/heads/master
libs/pyutil/test/current/json_tests/test_dump.py
106
from unittest import TestCase from cStringIO import StringIO from pyutil import jsonutil as json class TestDump(TestCase): def test_dump(self): sio = StringIO() json.dump({}, sio) self.assertEquals(sio.getvalue(), '{}') def test_dumps(self): self.assertEquals(json.dumps({}), '...
agronick/django_viewlog
refs/heads/master
models.py
1
from django.db import models from django.contrib.auth.models import User class PageLog(models.Model): user = models.ForeignKey(User, blank=True, null=True) path = models.CharField(max_length=512) request_type = models.CharField(max_length=5) referrer = models.CharField(max_length=512) status_code =...
azureplus/hue
refs/heads/master
desktop/core/ext-py/Paste-2.0.1/paste/util/template.py
49
""" A small templating language This implements a small templating language for use internally in Paste and Paste Script. This language implements if/elif/else, for/continue/break, expressions, and blocks of Python code. The syntax is:: {{any expression (function calls etc)}} {{any expression | filter}} {{for...
danieljaouen/ansible
refs/heads/devel
lib/ansible/modules/monitoring/zabbix/zabbix_template.py
21
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, sookido # # This file is part of Ansible # # Ansible 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)...
andrewfu0325/gem5-aladdin
refs/heads/ruby
ext/ply/test/lex_optimize.py
174
# ----------------------------------------------------------------------------- # lex_optimize.py # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex tokens = ( 'NAME','NUMBER', 'PLUS','MINUS','TIMES'...
pnorman/mapnik
refs/heads/master
scons/scons-local-2.4.1/SCons/Tool/sunf95.py
6
"""SCons.Tool.sunf95 Tool-specific initialization for sunf95, the Sun Studio F95 compiler. 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 - 2015 The SCons Foundation # # Permission is...
GoogleCloudPlatform/compute-image-packages
refs/heads/master
packages/python-google-compute-engine/google_compute_engine/boto/boto_config.py
6
#!/usr/bin/python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Teamxrtc/webrtc-streaming-node
refs/heads/master
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/gslib/name_expansion.py
12
# -*- coding: utf-8 -*- # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
paladin74/linux
refs/heads/master
scripts/gdb/linux/modules.py
774
# # gdb helper commands and functions for Linux kernel debugging # # module tools # # Copyright (c) Siemens AG, 2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import cpus, utils module_type = utils.CachedType("str...
soumyanishan/azure-linux-extensions
refs/heads/master
DSC/azure/storage/cloudstorageaccount.py
55
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
konstruktoid/ansible-upstream
refs/heads/devel
test/units/playbook/test_attribute.py
119
# (c) 2015, Marius Gedminas <marius@gedmin.as> # # This file is part of Ansible # # Ansible 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 vers...
sestrella/ansible
refs/heads/devel
lib/ansible/module_utils/facts/network/nvme.py
92
# NVMe initiator related facts collection for Ansible. # # This file is part of Ansible # # Ansible 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 la...
aledbf/contrib
refs/heads/master
ansible/library/oc_atomic_container.py
3
#!/usr/bin/env python # Copyright 2017 The Kubernetes 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 appli...
pombredanne/TSP-CloudStack
refs/heads/master
src/it/tsp/cloudstack/api/occi/config.py
1
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # Copyright (C) 2011 Houssem Medhioub - Institut Telecom # # 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 Foundati...
jenshnielsen/HJCFIT
refs/heads/develop
documentation/source/conf.py
1
# -*- coding: utf-8 -*- # # DCProgs documentation build configuration file, created by # sphinx-quickstart on Wed Jul 31 17:46:57 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
exercism/xpython
refs/heads/master
exercises/simple-cipher/simple_cipher.py
3
class Cipher: def __init__(self, key=None): pass def encode(self, text): pass def decode(self, text): pass
yd0str/infernal-twin
refs/heads/master
build/pip/pip/commands/uninstall.py
798
from __future__ import absolute_import import pip from pip.wheel import WheelCache from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.basecommand import Command from pip.exceptions import InstallationError class UninstallCommand(Command): """ Uninstall packages. pip is a...
OpenCMISS-Bindings/ZincPythonTools
refs/heads/master
opencmiss/zincwidgets/sceneviewereditorwidget.py
1
""" Zinc Sceneviewer Editor Widget Widget for editing viewing controls for a Sceneviewer. 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/. """ try: from PySide import Qt...