repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
BorisJeremic/Real-ESSI-Examples | refs/heads/master | parallel/test_cases/27NodeBrick/cantilever_different_Poisson/NumberOfDivision4/PoissonRatio0.10/compare_txt.py | 637 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
ehamiter/pyufc | refs/heads/master | pyufc/__init__.py | 1 | from .pyufc import Fighter, PyUFCError
|
iansf/engine | refs/heads/master | sky/tools/roll/patch.py | 27 | #!/usr/bin/env python
# Copyright 2014 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
import subprocess
import utils
def patch_and_filter(dest_dir, relative_patches_dir):
os.chdir(dest_dir)
utils.filter_fi... |
xen0l/ansible | refs/heads/devel | lib/ansible/plugins/callback/dense.py | 9 | # (c) 2016, Dag Wieers <[email protected]>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: dense
type: stdout
short_description: mi... |
shivam1111/odoo | refs/heads/8.0 | addons/purchase/stock.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
sajeeshcs/nested_quota | refs/heads/master | nova/tests/cells/test_cells_rpc_driver.py | 29 | # Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# Copyright 2013 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/license... |
arista-eosplus/ansible-modules-extras | refs/heads/devel | cloud/misc/ovirt.py | 65 | #!/usr/bin/python
# (c) 2013, Vincent Van der Kussen <vincent at vanderkussen.org>
#
# 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,... |
driera/vz-beauty | refs/heads/master | dev/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/common_test.py | 2542 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
joaormatos/anaconda | refs/heads/master | Anaconda/standalone/trunk/buildtests/libraries/test_Image2.py | 2 | #
# Copyright (C) 2007, Giovanni Bajo
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... |
bdfoster/blumate | refs/heads/master | tests/components/sensor/test_rfxtrx.py | 1 | """The tests for the Rfxtrx sensor platform."""
import unittest
from blumate.bootstrap import _setup_component
from blumate.components import rfxtrx as rfxtrx_core
from blumate.const import TEMP_CELSIUS
from tests.common import get_test_home_assistant
class TestSensorRfxtrx(unittest.TestCase):
"""Test the Rfxtr... |
szeged/servo | refs/heads/master | python/tidy/servo_tidy_tests/test_tidy.py | 7 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... |
rs/petl | refs/heads/master | src/petl/io/db.py | 1 | from __future__ import absolute_import, print_function, division
__author__ = 'Alistair Miles <[email protected]>'
# standard library dependencies
import logging
# internal dependencies
from petl.util import RowContainer
logger = logging.getLogger(__name__)
warning = logger.warning
info = logger.info
deb... |
wakermahmud/sync-engine | refs/heads/master | inbox/models/event.py | 1 | import arrow
from datetime import datetime
from dateutil.parser import parse as date_parse
import ast
from sqlalchemy import (Column, String, ForeignKey, Text, Boolean, Integer,
DateTime, Enum, Index, event)
from sqlalchemy.orm import relationship, backref, validates, reconstructor
from sqlalch... |
xrmx/django | refs/heads/master | django/conf/locale/cy/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '25 Hy... |
sonali0901/zulip | refs/heads/master | api/integrations/hg/zulip-changegroup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Zulip hook for Mercurial changeset pushes.
# Copyright © 2012-2014 Zulip, Inc.
#
# 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 res... |
jkenn99/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/win_unittest.py | 115 | # Copyright (C) 2011 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... |
hpe-storage/horizon-hpe-storage-ui | refs/heads/master | horizon_hpe_storage/storage_panel/overview/panel.py | 2 | # (c) Copyright [2015] Hewlett Packard Enterprise Development LP
#
# 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 r... |
ZenHarbinger/snapcraft | refs/heads/master | snapcraft/internal/sources/_local.py | 3 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
patrys/autocomplete-python | refs/heads/master | lib/jedi/__init__.py | 34 | """
Jedi is a static analysis tool for Python that can be used in IDEs/editors. Its
historic focus is autocompletion, but does static analysis for now as well.
Jedi is fast and is very well tested. It understands Python on a deeper level
than all other static analysis frameworks for Python.
Jedi has support for two di... |
clumsy/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_basestring.py | 326 | """Fixer for basestring -> str."""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixBasestring(fixer_base.BaseFix):
BM_compatible = True
PATTERN = "'basestring'"
def transform(self, node, results):
return Name(u"str", prefix=node.prefix)... |
Fokko/incubator-airflow | refs/heads/master | airflow/utils/sqlalchemy.py | 1 | # -*- coding: utf-8 -*-
#
# 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
#... |
potash/scikit-learn | refs/heads/master | sklearn/metrics/tests/test_common.py | 7 | from __future__ import division, print_function
from functools import partial
from itertools import product
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils.multiclass import type_of_target
fro... |
lingxiaoyang/N2O | refs/heads/master | app/modules/poll/api.py | 1 | from django.utils import timezone
from common.headers import *
from app.models import *
VALIDATION_FAILED = L('Form validation failed.')
def urlpatterns():
return patterns('',
url('^list/$', get_list),
url('^add/$', add),
url('^item:(?P<pk>.*)/$', item),... |
engine95/navel-990 | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
Taapat/enigma2-openpli-fulan | refs/heads/master | lib/python/Components/Converter/RotorPosition.py | 29 | # -*- coding: utf-8 -*-
from Converter import Converter
from Components.Element import cached
from Components.config import config
from Tools.Transponder import orbpos
from Components.NimManager import nimmanager
from enigma import eDVBSatelliteEquipmentControl
class RotorPosition(Converter, object):
DEFAULT = 0
WIT... |
huoxudong125/poedit | refs/heads/master | deps/boost/libs/python/example/quickstart/test_extending.py | 53 | # Copyright Ralf W. Grosse-Kunstleve 2006. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# Using the doctest module here to ensure that the results are as expected.
r'''>>> from extending import *
>>> hi = hell... |
bendavis78/django-storages | refs/heads/master | examples/libcloud_project/urls.py | 28 | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'libcloud_project.views.home', name='home'),
# url(r'^libcloud_project/', include('... |
SpamExperts/SpamPAD | refs/heads/master | oa/message.py | 2 | """Internal representation of email messages."""
from builtins import str
from builtins import set
from builtins import list
from builtins import dict
from builtins import object
import re
import time
import email
import hashlib
import calendar
import functools
import ipaddress
import email.utils
import html.parser
i... |
MarcJoan/django | refs/heads/master | tests/queryset_pickle/tests.py | 209 | from __future__ import unicode_literals
import datetime
import pickle
import unittest
import warnings
from django.test import TestCase
from django.utils import six
from django.utils.encoding import force_text
from django.utils.version import get_version
from .models import Container, Event, Group, Happening, M2MMode... |
owenmorris/pylucene | refs/heads/master | python/collections.py | 7 | # 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
# distribu... |
dguo-coursera/arcanist | refs/heads/master | externals/pep8/pep8.py | 1 | #!/usr/bin/env python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006-2009 Johann C. Rocholl <[email protected]>
# Copyright (C) 2009-2014 Florent Xicluna <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this soft... |
ishay2b/tensorflow | refs/heads/segnet | tensorflow/python/kernel_tests/argmax_op_test.py | 56 | # 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... |
altairpearl/scikit-learn | refs/heads/master | examples/mixture/plot_bayesian_gaussian_mixture.py | 2 | """
======================================================
Bayesian Gaussian Mixture Concentration Prior Analysis
======================================================
Plot the resulting ellipsoids of a mixture of three Gaussians with
variational Bayesian Gaussian Mixture for three different values on the
prior the d... |
dyyi/moneybook | refs/heads/master | venv/Lib/site-packages/pkg_resources/_vendor/packaging/version.py | 1151 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... |
StanleyRoboticsInc/vector | refs/heads/master | vector_common/vector_third_party/ds4drv/src/ds4drv/utils.py | 5 | import sys
from .device import DS4Report
VALID_BUTTONS = DS4Report.__slots__
def iter_except(func, exception, first=None):
"""Call a function repeatedly until an exception is raised.
Converts a call-until-exception interface to an iterator interface.
Like __builtin__.iter(func, sentinel) but uses an e... |
mgadi/naemonbox | refs/heads/master | sources/psdash/Werkzeug-0.7/tests/test_compat.py | 2 | # -*- coding: utf-8 -*-
import sys
import warnings
from subprocess import Popen, PIPE
from werkzeug.test import create_environ
import_code = '''\
import sys
sys.path.insert(0, '..')
import werkzeug.%s
print ':'.join([k[9:] for k, v in sys.modules.iteritems()
if v is not None and k.startswith('werkzeu... |
dcrosta/synk | refs/heads/master | synk/web.py | 1 | from synk.models import User
from synk.forms import UserForm
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from google.appengine.ext.webapp import template
# utilities
def render(request, template_filename, **kwargs):
template_filen... |
2013Commons/HUE-SHARK | refs/heads/master | apps/oozie/src/oozie/migrations/0016_auto__add_field_coordinator_job_properties.py | 1 | # 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 field 'Coordinator.job_properties'
db.add_column('oozie_coordinator', 'job_properties', self.gf('django.d... |
turbidsoul/tsutil | refs/heads/master | __test__/util_test.py | 1 | # -*- coding: utf-8 -*-
from tsutil.util import singleton, singleton_fun
from unittest import TestCase, main
@singleton
class SingleSample(object):
pass
@singleton_fun
def single_sample(a, b):
return a + b
class SingleTest(TestCase):
def test_singleclass(self):
s1 = SingleSample()
s2 = SingleSample(... |
hachard/Cra-Magnet | refs/heads/master | flask/lib/python3.5/site-packages/flask/cli.py | 42 | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock, Thread
from functools import update_wrapper
import click
... |
mikegrima/botor | refs/heads/master | botor/aws/iam.py | 1 | from botor.aws.sts import sts_conn
from botor.decorators import rate_limited
from joblib import Parallel, delayed
@sts_conn('iam')
@rate_limited()
def list_roles(**kwargs):
client = kwargs['client']
roles = []
marker = {}
while True:
response = client.list_roles(**marker)
roles.extend... |
LukeHoersten/ansible-modules-core | refs/heads/devel | cloud/amazon/iam_cert.py | 102 | #!/usr/bin/python
# 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 distributed... |
dimdung/boto | refs/heads/develop | tests/integration/datapipeline/test_layer1.py | 136 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
libracore/erpnext | refs/heads/v12 | erpnext/patches/v8_10/change_default_customer_credit_days.py | 11 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("selling", "doctype", "customer")
frappe.reload_doc("buying", "doctype", "supplier")
frappe.reload_doc("setup", "doctype", "supplier_type")
frappe.reload_doc("accounts", "doctype", "payment_term")
frappe.reload_doc("accounts",... |
aleida/django | refs/heads/master | django/contrib/localflavor/at/forms.py | 109 | """
AT-specific Form helpers
"""
from __future__ import unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
re_ssn = re.compile(r'^\d{4} \d{... |
qiang437587687/pythonBrother | refs/heads/master | docopt-master-zhangTest/examples/git/git_branch.py | 17 | """
usage: git branch [options] [-r | -a] [--merged=<commit> | --no-merged=<commit>]
git branch [options] [-l] [-f] <branchname> [<start-point>]
git branch [options] [-r] (-d | -D) <branchname>
git branch [options] (-m | -M) [<oldbranch>] <newbranch>
Generic options
-h, --help
-v, --verbos... |
yichaoS/cbioportal | refs/heads/master | core/src/main/scripts/flagStudyForProductionPortalDeployment.py | 25 | #! /usr/bin/env python
# ------------------------------------------------------------------------------
# Script which flags a study within the triage portal for deployment into
# production portal.
# ------------------------------------------------------------------------------
# ----------------------------------... |
da1z/intellij-community | refs/heads/master | python/testData/typeshed/conftest.py | 22 | import re
import os
import pip
import pytest
@pytest.fixture(scope='module')
def requirements(request):
requirements_path = re.sub(r'(.*)_test\.py', r'\1_requirements.txt',
request.module.__file__)
if os.path.exists(requirements_path):
pip.main(['install', '-r', requirem... |
adamdempsey90/fargo3d | refs/heads/master | utils/python/streamfunction.py | 1 | import matplotlib.pyplot as plt
import numpy as np
import scipy.integrate as integrate
def streamfunction(u,v,dx,dy):
term1 = np.ndarray([u.shape[0],u.shape[1]])
term2 = np.ndarray([u.shape[0],u.shape[1]])
for i in range(u.shape[1]):
for j in range(u.shape[0]):
#integral en x para y0 fijo
... |
ftkghost/SuperSaver | refs/heads/master | supersaver/core/middleware/minidetector/tests/__init__.py | 7 | from unittest import TestSuite, TestCase, TextTestRunner, TestLoader
import minidetector
import os.path
class DummyRequest(object):
def __init__(self, useragent):
self.META = {'HTTP_USER_AGENT': useragent}
class TestHTTPHeaders(TestCase):
"""Everything that Isn't a User-Agent Header"""
... |
chippey/gaffer | refs/heads/master | python/GafferUI/LayoutMenu.py | 4 | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
AwesomeTurtle/personfinder | refs/heads/master | app/vendors/unidecode/x084.py | 252 | data = (
'Hu ', # 0x00
'Qi ', # 0x01
'He ', # 0x02
'Cui ', # 0x03
'Tao ', # 0x04
'Chun ', # 0x05
'Bei ', # 0x06
'Chang ', # 0x07
'Huan ', # 0x08
'Fei ', # 0x09
'Lai ', # 0x0a
'Qi ', # 0x0b
'Meng ', # 0x0c
'Ping ', # 0x0d
'Wei ', # 0x0e
'Dan ', # 0x0f
'Sha ', # 0x10
'Hu... |
crosswalk-project/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | third_party/cython/src/Cython/Compiler/PyrexTypes.py | 87 | #
# Cython/Python language types
#
from Code import UtilityCode, LazyUtilityCode, TempitaUtilityCode
import StringEncoding
import Naming
import copy
from Errors import error
class BaseType(object):
#
# Base class for all Cython types including pseudo-types.
# List of attribute names of any subtypes
... |
cchurch/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/macports.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jimmy Tang <[email protected]>
# Based on okpg (Patrick Pelletier <[email protected]>), pacman
# (Afterburn) and pkgin (Shaun Zinck) modules
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ... |
esakellari/my_root_for_test | refs/heads/master | interpreter/llvm/src/tools/clang/bindings/python/tests/cindex/test_token_kind.py | 97 | from clang.cindex import TokenKind
from nose.tools import eq_
from nose.tools import ok_
from nose.tools import raises
def test_constructor():
"""Ensure TokenKind constructor works as expected."""
t = TokenKind(5, 'foo')
eq_(t.value, 5)
eq_(t.name, 'foo')
@raises(ValueError)
def test_bad_register():... |
rahushen/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/assert.py | 67 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
alu0100207385/dsi_3Django | refs/heads/master | django/contrib/staticfiles/management/commands/runserver.py | 243 | from optparse import make_option
from django.conf import settings
from django.core.management.commands.runserver import Command as RunserverCommand
from django.contrib.staticfiles.handlers import StaticFilesHandler
class Command(RunserverCommand):
option_list = RunserverCommand.option_list + (
make_optio... |
kenwang815/KodiPlugins | refs/heads/master | script.module.oceanktv/lib/youtube_dl/extractor/ellentv.py | 11 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class EllenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:ellentv|ellentube)\.com/videos/(?P<id>[a-z0-9_-]+)'
_TEST = {
'url': 'http://www.elle... |
andhit-r/account-financial-tools | refs/heads/8.0 | account_default_draft_move/__init__.py | 17 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publis... |
bonus85/csv-analytics | refs/heads/master | plot_months.py | 1 | # -*- coding: utf-8 -*-
import process_data
from matplotlib import pyplot as plt
file_name = 'test.csv'
excel_output = 'test.xlsx'
analyzer = process_data.PowerConsumptionAnalyzer(file_name, excel_output)
for month in analyzer.months():
analyzer.write_month(month)
#print month.size
analyzer.close_wb()
|
OpenTrons/opentrons_sdk | refs/heads/master | robot-server/robot_server/service/json_api/errors.py | 3 | from typing import Optional, List, Dict
from pydantic import BaseModel, Field
from .resource_links import ResourceLinks
class ErrorSource(BaseModel):
pointer: Optional[str] = \
Field(None,
description="a JSON Pointer [RFC6901] to the associated"
" entity in the req... |
maclandrol/ete | refs/heads/master | examples/treeview/random_draw.py | 2 | import os
from ete2 import Tree, faces
from ete2.treeview.main import TreeStyle, NodeStyle, random_color
import colorsys
import random
# ::::::::::::::
# Layout actions
# ::::::::::::::
def sphere_map(node):
# Creates a random color sphere face that will be floating over nodes
bubble = faces.CircleFace(rando... |
IsCoolEntertainment/debpkg_python-boto | refs/heads/master | boto/ec2/elb/attributes.py | 8 | # 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, merge, publish, dis-
# tribute, sublicense, and/or sell co... |
Khan/khan-linter | refs/heads/master | vendor/py3/pyflakes/scripts/pyflakes.py | 50 | """
Implementation of the command-line I{pyflakes} tool.
"""
from __future__ import absolute_import
# For backward compatibility
__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']
from pyflakes.api import check, checkPath, checkRecursive, iterSourceCode, main
|
kyroskoh/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/credentials_unittest.py | 124 | # Copyright (C) 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 of conditions and the f... |
vabs22/zulip | refs/heads/master | zerver/migrations/0062_default_timezone.py | 14 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-16 12:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0061_userprofile_timezone'),
]
operations = [
migrations.AlterFie... |
cesarpazguzman/The-Eternal-Sorrow | refs/heads/master | dependencies/luabind/boost-build/test/conditionals2.py | 4 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Regression test: it was possible that due to evaluation of conditional
# requirements, two different values of non-free... |
leafo/FrameworkBenchmarks | refs/heads/master | pyramid/setup_benchmark.py | 5 | import subprocess
import setup_util
import multiprocessing
import os
home = os.path.expanduser('~')
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
NCPU = multiprocessing.cpu_count()
proc = None
def start(args):
global proc
setup_util.replace_text(
"frameworkbenchmarks/models.... |
lucasvo/heroku-buildpack-python-with-node | refs/heads/master | test/django-1.4-skeleton/haystack/urls.py | 128 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'haystack.views.home', name='home'),
# url(r'^haystack/', include('haystack.foo.urls')),
... |
alyosha1879/ryu | refs/heads/dev | ryu/lib/hub.py | 21 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
nadley/Sick-Beard | refs/heads/development | lib/requests/packages/urllib3/response.py | 65 | # urllib3/response.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import gzip
import logging
import zlib
from io import BytesIO
from .exceptions import Decode... |
davidpng/FCS_Database | refs/heads/master | FlowAnal/subcommands/template-query_do.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Template script for selecting a set of .fcs files and operating on them one-by-one
NOTE: There are some files that are not found because of discordance of filename \
and filename internal to .fcs file (meta info)
"""
import logging
from os import path
from FlowAnal.da... |
bearstech/modoboa | refs/heads/master | modoboa/relaydomains/apps.py | 1 | """AppConfig for relaydomains."""
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext as _
def load_relaydomains_settings():
"""Load application settings."""
from modoboa.parameters import tools as param_tools
from .app_settings import ... |
siavooshpayandehazad/SoCDep2 | refs/heads/master | src/main/python/Simulator/simulator_functions.py | 2 | # Copyright (C) 2016 Siavoosh Payandeh Azad
import numpy
import copy
from ast import literal_eval
from ConfigAndPackages import Config
from SystemHealthMonitoring import SHMU_Functions
import matplotlib.pyplot as plt
def generate_random_fault_time_dict(runtime, shm):
"""
generates random fault time dictionar... |
alexbruy/QGIS | refs/heads/master | python/ext-libs/future/future/moves/http/cookies.py | 83 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from http.cookies import *
else:
__future_module__ = True
from Cookie import *
from Cookie import Morsel # left out of __all__ on Py2.7!
|
sjfloat/eucalyptus | refs/heads/master | clc/eucadmin/eucadmin/validator.py | 7 | #!/usr/bin/python
#
# Copyright 2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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... |
romanornr/viacoin | refs/heads/master | test/functional/test_framework/bignum.py | 59 | #!/usr/bin/env python3
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Big number routines.
This file is copied from python-bitcoinlib.
"""
import struct
# generic big endian MPI format
def bn_bytes(v, have_ext=False):
... |
JackNokia/robotframework | refs/heads/master | atest/testdata/test_libraries/MyLibDir/ClassLib.py | 37 | class ClassLib(object):
def keyword_in_mylibdir_classlib(self):
pass
|
krzysztof/invenio-sipstore | refs/heads/master | invenio_sipstore/archivers/bagit_archiver.py | 1 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016, 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... |
liw/daos | refs/heads/master | src/tests/ftest/erasurecode/ec_offline_rebuild.py | 1 | #!/usr/bin/python
'''
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from ec_utils import ErasureCodeIor
from apricot import skipForTicket
class EcOfflineRebuild(ErasureCodeIor):
# pylint: disable=too-many-ancestors
"""
Test Class Description: To validate ... |
GeneralizedLearningUtilities/Dinosaurs | refs/heads/master | Student_Model/Tests/Concept_UnitTests.py | 1 | # -*- coding: utf-8 -*-
import os
import unittest.case
from Student_Model.Concept import (Concept,)
from Util.Paths import getBasePath
from Util.JSInterpreter import executeJS
from Util.Serialization import (StorageToken, Serializable, makeNative, untokenizeObject)
class ConceptTest(unittest.case.TestCase):
""" Un... |
wangyixiang/atserver | refs/heads/master | streaminfoextractor.py | 1 | #!/usr/bin/env python
#coding:utf-8
# Author: Yixiang.Wang
# Purpose:
# Created: 2013/12/12
import filecmp
import hashlib
import logging
import os
import subprocess
import torndb
STREAM_FILE_EXTS = ('.ts','.trp','.mpg')
# EPG_Test.exe (Standard) (source file) (log path) (language code)
# i.e: "FULLSEG" "E:\ch20_51... |
ChenJunor/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/http/utils.py | 134 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_3/django/contrib/admin/sites.py | 70 | import re
from django import http, template
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.contenttypes import views as contenttype_views
from django.views.decorators.csrf import ... |
semonte/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/models/query.py | 71 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
from itertools import izip
from django.db import connections, router, transaction, IntegrityError
from django.db.models.aggregates import Aggregate
from django.db.models.fields import DateField
from django.db.models.query_utils import... |
radical-cybertools/radical.ensemblemd | refs/heads/master | src/radical/entk/utils/__init__.py | 1 |
# ------------------------------------------------------------------------------
#
from .prof_utils import get_hostmap
from .prof_utils import get_hostmap_deprecated
from .prof_utils import get_session_profile
from .prof_utils import write_session_description
from .prof_utils im... |
rohitwaghchaure/digitales_erpnext | refs/heads/develop | erpnext/selling/doctype/sales_order/sales_order.py | 1 | # 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 frappe
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and, cint
from frappe import _
from frappe.model.mapper import g... |
snahelou/awx | refs/heads/devel | awx/main/management/commands/register_queue.py | 1 | # Copyright (c) 2017 Ansible Tower by Red Hat
# All Rights Reserved.
import sys
from awx.main.utils.pglock import advisory_lock
from awx.main.models import Instance, InstanceGroup
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
opti... |
Asdamp/StabilityBugsAnalysis | refs/heads/master | Progetto/main.py | 1 | from openpyxl import load_workbook
from Progetto import parserGetAllClasses
from Progetto.diffClassiVersioni import diff
from Progetto.getClassiModificate import count_class_mod
from Progetto.request import getNumIssue
from Progetto.getCoreCallsInstabilityValues import getCoreCallsValues
#definizione delle variabili p... |
julianschweizer/kernel_23.0.1.A.0.xxx | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
tizianasellitto/servo | refs/heads/master | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-line-height-tests.py | 829 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... |
dpaiton/OpenPV | refs/heads/master | pv-core/analysis/python/plot_save_layer_timing.py | 1 | import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.cm as cm
import PVReadSparse as rs
import PVReadWeights as rw
import PVConversions as conv
import scipy.cluster.vq as sp
import math
from scipy.sparse import lil_matrix as lm
extended = False
l1a = rs.PVRea... |
Weihonghao/ECM | refs/heads/master | Vpy34/lib/python3.5/site-packages/tensorflow/python/training/proximal_adagrad.py | 33 | # 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... |
elzaggo/pydoop | refs/heads/develop | examples/self_contained/check_results.py | 1 | # BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 agree... |
saimn/astropy | refs/heads/main | astropy/io/misc/__init__.py | 19 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains miscellaneous utility functions for data
input/output with astropy.
"""
from .pickle_helpers import *
|
eonpatapon/rally | refs/heads/master | rally/verification/tempest/diff.py | 7 | # Copyright 2014 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... |
IndonesiaX/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_bulk_assertions.py | 173 | import ddt
import itertools
from xmodule.tests import BulkAssertionTest, BulkAssertionError
STATIC_PASSING_ASSERTIONS = (
('assertTrue', True),
('assertFalse', False),
('assertIs', 1, 1),
('assertEqual', 1, 1),
('assertEquals', 1, 1),
('assertIsNot', 1, 2),
('assertIsNone', None),
('as... |
thanhacun/odoo | refs/heads/8.0 | addons/product_extended/product_extended.py | 185 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero G... |
aicjofs/android_kernel_fuhu_t8400n | refs/heads/custom | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
xshotD/pyglet | refs/heads/master | pyglet/gl/lib_glx.py | 44 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.