repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
mscuthbert/abjad | experimental/tools/constrainttools/Domain.py | 2 | 2226 | # -*- encoding: utf-8 -*-
import random
from abjad.tools.abctools import AbjadObject
class Domain(AbjadObject):
r'''A two-dimensional constraints search domain:
::
>>> from experimental.tools.constrainttools import Domain
May be instantiated from a non-empty sequence of non-empty sequences.
... | gpl-3.0 |
torchingloom/edx-platform | lms/djangoapps/courseware/models.py | 10 | 8881 | """
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration courseware --auto description_of_your_change
3. Add the migration file created... | agpl-3.0 |
Xeralux/tensorflow | tensorflow/python/debug/cli/curses_ui.py | 4 | 58731 | # 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... | apache-2.0 |
ltilve/ChromiumGStreamerBackend | tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/reenable_after_bypass.py | 31 | 1426 | # 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.
from telemetry.page import page as page_module
from telemetry import story
class ReenableAfterBypassPage(page_module.Page):
"""A test page for the re-ena... | bsd-3-clause |
malkavi/Flexget | flexget/components/archive/db.py | 3 | 6022 | import re
from datetime import datetime
from loguru import logger
from sqlalchemy import Column, DateTime, ForeignKey, Index, Integer, Table, Unicode
from sqlalchemy.orm import relationship
from sqlalchemy.orm.exc import NoResultFound
from flexget import db_schema
from flexget.utils.sqlalchemy_utils import get_index_... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/raw/GL/ARB/sparse_texture.py | 9 | 1535 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
odoo-brazil/l10n-brazil-wip | sped_imposto/models/sped_aliquota_icms_proprio.py | 3 | 4492 | # -*- coding: utf-8 -*-
#
# Copyright 2016 Taŭga Tecnologia
# Aristides Caldeira <aristides.caldeira@tauga.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#
from __future__ import division, print_function, unicode_literals
import logging
from odoo import api, fields, models, _
from odoo.except... | agpl-3.0 |
pyrochlore/cycles | src/blender/addon/__init__.py | 1 | 3388 | #
# Copyright 2011-2013 Blender Foundation
#
# 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... | apache-2.0 |
batxes/4c2vhic | Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models37455.py | 4 | 18201 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
JonathanStein/odoo | addons/account/wizard/account_report_partner_balance.py | 364 | 2199 | # -*- 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... | agpl-3.0 |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/sched.py | 88 | 6354 | """A generally useful event scheduler class.
Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.
Each instance is parametrized with two functions, one that is
supposed to return the current time, one that i... | lgpl-3.0 |
leppa/home-assistant | homeassistant/components/minio/__init__.py | 1 | 8056 | """Minio component."""
import logging
import os
from queue import Queue
import threading
from typing import List
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
import homeassistant.helpers.config_validation as cv
from .minio_helper import MinioEventThread... | apache-2.0 |
h3biomed/ansible | lib/ansible/modules/network/nxos/nxos_install_os.py | 3 | 21986 | #!/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 distribut... | gpl-3.0 |
louietsai/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/utils/compat.py | 361 | 4060 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... | apache-2.0 |
mscuthbert/abjad | abjad/tools/quantizationtools/test/test_quantizationtools_QEventSequence_from_millisecond_durations.py | 2 | 8554 | # -*- encoding: utf-8 -*-
from abjad import *
def test_quantizationtools_QEventSequence_from_millisecond_durations_01():
r'''Test basic functionality.
'''
durations = mathtools.difference_series(
[x[0] for x in quantizationtools.make_test_time_segments()])
q_events = quantizationtools.QEventS... | gpl-3.0 |
itsjeyd/edx-platform | openedx/core/lib/time_zone_utils.py | 7 | 2080 | """
Utilities related to timezones
"""
from datetime import datetime
from pytz import common_timezones, timezone, utc
def get_user_time_zone(user):
"""
Returns pytz time zone object of the user's time zone if available or UTC time zone if unavailable
"""
#TODO: exception for unknown timezones?
ti... | agpl-3.0 |
RichardLitt/wyrd-django-dev | tests/regressiontests/localflavor/generic/tests.py | 57 | 4361 | from __future__ import unicode_literals
import datetime
from django.contrib.localflavor.generic.forms import DateField, DateTimeField
from django.test import SimpleTestCase
class GenericLocalFlavorTests(SimpleTestCase):
def test_GenericDateField(self):
error_invalid = ['Enter a valid date.']
va... | bsd-3-clause |
zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/pf/test_vm_ops.py | 2 | 2651 | '''
Test Port Forwarding with TCP connection with vm operations, e.g. reboot, stop/start etc.
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.net_operations as net_ops
imp... | apache-2.0 |
jiangzhixiao/odoo | addons/account/wizard/account_vat.py | 378 | 2896 | # -*- 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... | agpl-3.0 |
dushu1203/chromium.src | tools/auto_bisect/source_control_test.py | 13 | 3232 | # 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.
"""Unit tests for the source_control module."""
import unittest
import mock
import source_control
class SourceControlTest(unittest.TestCase):
@mock.pa... | bsd-3-clause |
jordiclariana/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_domain.py | 50 | 7144 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
solashirai/edx-platform | lms/startup.py | 9 | 5429 | """
Module for code that should run during LMS startup
"""
import django
from django.conf import settings
# Force settings to run so that the python path is modified
settings.INSTALLED_APPS # pylint: disable=pointless-statement
from openedx.core.lib.django_startup import autostartup
import edxmako
import logging
im... | agpl-3.0 |
moyalco/littleb | wrappers/nbind/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
phyxl/subber | lib/werkzeug/contrib/limiter.py | 319 | 1333 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.limiter
~~~~~~~~~~~~~~~~~~~~~~~~
A middleware that limits incoming data. This works around problems with
Trac_ or Django_ because those directly stream into the memory.
.. _Trac: http://trac.edgewall.org/
.. _Django: http://www.djangoproject.com/
... | gpl-2.0 |
ATIX-AG/ansible | lib/ansible/plugins/action/dellos9_config.py | 29 | 4277 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2017 Dell 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 L... | gpl-3.0 |
eamuntz/Django-Tut | env/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py | 213 | 14674 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
matejsuchanek/pywikibot-scripts | fix_qualifiers.py | 1 | 4360 | #!/usr/bin/python
"""This script is obsolete!"""
import pywikibot
from pywikibot import pagegenerators
from .query_store import QueryStore
from .wikidata import WikidataEntityBot
class QualifiersFixingBot(WikidataEntityBot):
blacklist = frozenset(['P143', 'P248', 'P459', 'P518', 'P577', 'P805',
... | gpl-2.0 |
william-richard/moto | tests/test_swf/responses/test_timeouts.py | 2 | 4658 | from freezegun import freeze_time
import sure # noqa
from moto import mock_swf_deprecated
from ..utils import setup_workflow, SCHEDULE_ACTIVITY_TASK_DECISION
# Activity Task Heartbeat timeout
# Default value in workflow helpers: 5 mins
@mock_swf_deprecated
def test_activity_task_heartbeat_timeout():
with freez... | apache-2.0 |
davislidaqing/Mcoderadius | toughradius/console/admin/product.py | 5 | 11107 | #!/usr/bin/env python
# coding:utf-8
from bottle import Bottle
from bottle import request
from bottle import response
from bottle import redirect
from bottle import static_file
from tablib import Dataset
from toughradius.console import models
from toughradius.console.admin import product_forms
from toughradius.console... | agpl-3.0 |
acshi/osf.io | framework/addons/utils.py | 35 | 2274 | import os
from json import load as load_json
from mako.lookup import TemplateLookup
CLASS_MAP = {
'full': 'success',
'partial': 'warning',
'none': 'danger',
}
CAPABILITY_SET = [
'Permissions',
'View / download file versions',
'Add / update files',
'Delete files',
'Logs',
'Forking',... | apache-2.0 |
chienlieu2017/it_management | odoo/addons/pos_cache/models/pos_cache.py | 13 | 3449 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from ast import literal_eval
from odoo import models, fields, api
from odoo.tools import pickle as cPickle
class pos_cache(models.Model):
_name = 'pos.cache'
cache = fields.Binary(attachment=True... | gpl-3.0 |
victorkeophila/alien4cloud-cloudify3-provider | src/test/resources/outputs/blueprints/openstack/new_scalable_compute/plugins/custom_wf_plugin/plugin/workflow.py | 35 | 1379 | import json
# class Activity(object):
#
# def __init__(self, name):
# self.name = name
#
#
# class SetActivity(Activity):
#
# def __init__(self, stat_name):
# Activity.__init__(self, "set")
# self.stat_name = stat_name
#
#
# class CallActivity(Activity):
#
# def __init__(self, fqn)... | apache-2.0 |
ramitalat/odoo | addons/mrp/__openerp__.py | 259 | 3564 | # -*- 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... | agpl-3.0 |
joshbohde/scikit-learn | examples/plot_roc_crossval.py | 2 | 2019 | """
=============================================================
Receiver operating characteristic (ROC) with cross validation
=============================================================
Example of Receiver operating characteristic (ROC) metric to
evaluate the quality of the output of a classifier using
cross-valid... | bsd-3-clause |
MQQiang/kbengine | kbe/res/scripts/common/Lib/tkinter/test/test_ttk/test_extensions.py | 71 | 10338 | import sys
import unittest
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest, swap_attr
from tkinter.test.support import AbstractTkTest, destroy_default_root
requires('gui')
class LabeledScaleTest(AbstractTkTest, unittest.TestCase):
def tearDown(self):
self.root.updat... | lgpl-3.0 |
tbetbetbe/grpc | src/python/grpcio_test/grpc_test/framework/common/__init__.py | 1496 | 1530 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
kdar/Wox | PythonHome/Lib/site-packages/pip/_vendor/requests/models.py | 277 | 26436 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | mit |
ppke-nlpg/purepos-python3 | purepos.py | 1 | 17540 | #!/usr/bin/env python3
# -*- coding: utf-8, vim: expandtab:ts=4 -*-
###############################################################################
# Copyright (c) 2015 Móréh, Tamás
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Lesser Public License v... | lgpl-3.0 |
TOPEET-Develop/iTop4412_kernel_public | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
sestrella/ansible | test/lib/ansible_test/_internal/provider/layout/__init__.py | 14 | 7847 | """Code for finding content."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import collections
import os
from ... import types as t
from ...util import (
ANSIBLE_SOURCE_ROOT,
)
from .. import (
PathProvider,
)
class Layout:
"""Description of conte... | gpl-3.0 |
sandeepkbhat/pylearn2 | pylearn2/expr/information_theory.py | 45 | 1193 | """
.. todo::
WRITEME
"""
import theano.tensor as T
from theano.gof.op import get_debug_values
from theano.gof.op import debug_assert
import numpy as np
from theano.tensor.xlogx import xlogx
from pylearn2.utils import contains_nan, isfinite
def entropy_binary_vector(P):
"""
.. todo::
WRITEME pro... | bsd-3-clause |
KelSolaar/Manager | manager/tests/tests_manager/tests_globals/tests_constants.py | 1 | 5659 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**tests_constants.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
Defines units tests for :mod:`manager.globals.constants` module.
**Others:**
"""
from __future__ import unicode_literals
import sys
if sys.version_info[:2] <= (2, 6):
imp... | gpl-3.0 |
don-github/edx-platform | common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py | 114 | 1674 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.expiration_date'
db.add_column('course_modes_coursemode', 'expiration_date',
... | agpl-3.0 |
android-ia/platform_external_chromium_org | tools/swig/swig.py | 133 | 1304 | #!/usr/bin/env python
# Copyright (c) 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.
"""Wrapper around swig.
Sets the SWIG_LIB environment var to point to Lib dir
and defers control to the platform-specific swig bin... | bsd-3-clause |
bulentsoykan/or-tools | examples/python/data/nonogram_regular/nonogram_gondola.py | 74 | 2187 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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... | apache-2.0 |
onitake/ansible | lib/ansible/modules/storage/netapp/_sf_check_connections.py | 59 | 5302 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# 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',
'status': ['deprecated'],
... | gpl-3.0 |
xiaolihope/PerfKitBenchmarker-1.7.0 | perfkitbenchmarker/linux_packages/sysbench05plus.py | 6 | 2963 | # Copyright 2014 PerfKitBenchmarker 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 appli... | apache-2.0 |
sixuanwang/SAMSaaS | wirecloud-develop/src/wirecloud/semanticwiring/models.py | 4 | 1951 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Conwet Lab., Universidad Politécnica de Madrid
# Copyright (c) 2013 Center for Open Middleware
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published ... | gpl-2.0 |
aimeescoin/aimeescoin | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
DanWBR/dwsim5 | DWSIM/Lib/lib2to3/fixes/fix_dict.py | 326 | 3824 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | gpl-3.0 |
nkgilley/home-assistant | homeassistant/components/config/config_entries.py | 5 | 11634 | """Http views to control the config manager."""
import aiohttp.web_exceptions
import voluptuous as vol
import voluptuous_serialize
from homeassistant import config_entries, data_entry_flow
from homeassistant.auth.permissions.const import CAT_CONFIG_ENTRIES, POLICY_EDIT
from homeassistant.components import websocket_ap... | apache-2.0 |
pwong-mapr/private-hue | apps/useradmin/src/useradmin/tests.py | 1 | 40345 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 ... | apache-2.0 |
aozarov/appengine-mapreduce | python/src/mapreduce/api/map_job/datastore_input_reader.py | 35 | 1273 | #!/usr/bin/env python
"""Datastore Input Reader implementation for the map_job API."""
import logging
from mapreduce import datastore_range_iterators as db_iters
from mapreduce import errors
from mapreduce.api.map_job import abstract_datastore_input_reader
# pylint: disable=invalid-name
class DatastoreInputReader(a... | apache-2.0 |
jakbob/guitarlegend | gamescene.py | 1 | 13650 | # -*- coding: utf-8 -*-
#
# gamescene.py
# Defines the behaviour of the actual game scene
#
# (c) Jakob Florell and Jonne Mickelin 2009
import error
####################
# Standard library #
####################
import math
import heapq
import os
####################
# Required Modules #
####################
impor... | gpl-3.0 |
Jayflux/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_path/cacheutil.py | 278 | 3333 | """
This module contains multithread-safe cache implementations.
All Caches have
getorbuild(key, builder)
delentry(key)
methods and allow configuration when instantiating the cache class.
"""
from time import time as gettime
class BasicCache(object):
def __init__(self, maxentries=128):
self.maxe... | mpl-2.0 |
mediatum/mediatum | workflow/addtofolder.py | 1 | 4475 | # -*- coding: utf-8 -*-
"""
mediatum - a multimedia content repository
Copyright (C) 2011 Arne Seifert <arne.seifert@tum.de>
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 ... | gpl-3.0 |
christianeisendle/linux | tools/perf/scripts/python/netdev-times.py | 1544 | 15191 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
greggian/TapdIn | django/core/handlers/base.py | 1 | 9267 | import sys
from django import http
from django.core import signals
from django.utils.encoding import force_unicode
from django.utils.importlib import import_module
class BaseHandler(object):
# Changes that are always applied to a response (in this order).
response_fixes = [
http.fix_location... | apache-2.0 |
luksan/kodos | modules/urlDialog.py | 1 | 1874 | # -*- coding: utf-8; mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: 0 -*-
# vi: set fileencoding=utf-8 filetype=python expandtab tabstop=4 shiftwidth=4 softtabstop=4 cindent:
# :mode=python:indentSize=4:tabSize=4:noTabs=true:
#-----------------------------------------------------... | gpl-2.0 |
joker946/nova | nova/virt/xenapi/image/glance.py | 9 | 3637 | # Copyright 2013 OpenStack Foundation
# 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 requ... | apache-2.0 |
mythos234/AndromedaN910F-LL | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # 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... | gpl-2.0 |
luzhuomi/collamine-client-python | scrapybot/scrapybot/spiders/hwz.py | 1 | 1627 | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from scrapybot.items import ScrapybotItem
from scrapybot.utils import normalizeFriendlyDate
import datetime
from dateutil.parser import parse
from django... | apache-2.0 |
anupcshan/bazel | tools/build_defs/docker/rewrite_json.py | 5 | 9999 | # Copyright 2015 The Bazel 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 applicable la... | apache-2.0 |
ticosax/django | django/utils/dates.py | 590 | 2296 | "Commonly-used date structures"
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
WEEKDAYS = {
0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'),
5: _('Saturday'), 6: _('Sunday')
}
WEEKDAYS_ABBR = {
0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),... | bsd-3-clause |
kmiku7/vitess-annotated | test/worker.py | 6 | 21520 | #!/usr/bin/env python
#
# Copyright 2013, 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.
"""Tests the robustness and resiliency of vtworkers."""
import logging
import unittest
import urllib
import urllib2
from collections import na... | bsd-3-clause |
carlgao/lenga | images/lenny64-peon/usr/share/python-support/python-sqlalchemy/sqlalchemy/orm/unitofwork.py | 2 | 40604 | # orm/unitofwork.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The internals for the Unit Of Work system.
Includes hooks into the attributes package e... | mit |
oudalab/phyllo | phyllo/extractors/germanicusDB.py | 1 | 3002 | import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
def main():
# The collection URL below.
collURL = 'http://www.thelatinlibrary.com/germanicus.html'
collOpen = urllib.request.urlopen(collURL)
collSOUP = BeautifulSoup(collOpen, 'html5lib')
autho... | apache-2.0 |
bird-house/esgf-pyclient | pyesgf/test/test_context.py | 1 | 7082 | """
Test the SearchContext class
"""
from pyesgf.search import SearchConnection, not_equals
from unittest import TestCase
import os
class TestContext(TestCase):
def setUp(self):
self.test_service = 'http://esgf-index1.ceda.ac.uk/esg-search'
self.cache = os.path.join(os.path.dirname(__file__), 'u... | bsd-3-clause |
anaruse/chainer | tests/chainer_tests/functions_tests/connection_tests/test_n_step_gru.py | 4 | 15594 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def sigmoid(x):
return numpy.tanh(x * 0.5) * 0.5 + 0.5
def _split(inputs, pos):
return inputs[:pos], i... | mit |
klim-iv/phantomjs-qt5 | src/webkit/Tools/Scripts/webkitpy/common/system/executive_mock.py | 117 | 7106 | # 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... | bsd-3-clause |
ulrichard/electrum | lib/interface.py | 4 | 12444 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... | gpl-3.0 |
kubernetes-client/python | kubernetes/client/models/v1_job_spec.py | 1 | 13937 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 |
Nitaco/ansible | lib/ansible/modules/network/dellos9/dellos9_command.py | 50 | 7456 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell Inc.
# 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_versio... | gpl-3.0 |
andrewjpage/gubbins | python/scripts/gubbins_drawer.py | 1 | 26242 | #!/usr/bin/env python3
#################################
# Import some necessary modules #
#################################
import argparse
import pkg_resources
from Bio.Nexus import Trees, Nodes
from Bio.Graphics.GenomeDiagram._Colors import ColorTranslator
from Bio.GenBank import Scanner
from Bio.GenBank import _... | gpl-2.0 |
shsingh/ansible | lib/ansible/modules/network/fortios/fortios_user_quarantine.py | 7 | 11124 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
s20121035/rk3288_android5.1_repo | external/chromium_org/components/test/data/password_manager/run_tests.py | 43 | 4038 | # -*- coding: utf-8 -*-
# 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.
"""This file allows the bots to be easily configure and run the tests."""
import argparse
import os
import tempfile
from environmen... | gpl-3.0 |
jupyter/jupyterlab | examples/cell/main.py | 4 | 2644 | """
An example demonstrating a stand-alone "notebook".
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
Example
-------
To run the example, see the instructions in the README to build it. Then
run ``python main.py``.
"""
import os
import json
from jupyterlab_server i... | bsd-3-clause |
Carreau/songbook | utils/songbook-gtab.py | 4 | 2229 | #!/usr/bin/python
#
import sys
import glob
import re
from optparse import OptionParser
# Pattern set to ignore latex command in title prefix
gtabPattern = re.compile(r"\\gtab\{(.*)\}\{(.*)\}");
def main():
usage = "usage: %prog [options]"
parser = OptionParser(usage)
parser.add_option("-o", "--output", ... | gpl-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/pyflakes/test/test_doctests.py | 6 | 6653 | import textwrap
from pyflakes import messages as m
from pyflakes.test.test_other import Test as TestOther
from pyflakes.test.test_imports import Test as TestImports
from pyflakes.test.test_undefined_names import Test as TestUndefinedNames
from pyflakes.test.harness import TestCase, skip
class _DoctestMixin(object):
... | mit |
cjvogl/finite_volume_seismic_model | 3d/setplot_pwaves.py | 1 | 3701 |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
import numpy as np
import os, shutil
from mapping import Mapping
import dtopotools_horiz_okada_and_1d as dtopotools
lengt... | gpl-3.0 |
lfairchild/PmagPy | programs/deprecated/zeq_magic_redo.py | 3 | 13777 | #! /usr/bin/env python
from __future__ import print_function
from builtins import range
import sys
import string
import pmagpy.pmag as pmag
def main():
"""
NAME
zeq_magic_redo.py
DESCRIPTION
Calculate principal components through demagnetization data using bounds and calculation type st... | bsd-3-clause |
KarolBedkowski/kupfer-adds | kupfer/plugin/apt_tools.py | 4 | 4407 | __kupfer_name__ = _("APT")
__kupfer_sources__ = ()
__kupfer_text_sources__ = ()
__kupfer_actions__ = (
"ShowPackageInfo",
"SearchPackageName",
"InstallPackage",
)
__description__ = _("Interface with the package manager APT")
__version__ = ""
__author__ = ("Martin Koelewijn <martinkoelewijn@gmail.com>, "
... | gpl-3.0 |
ypu/tp-qemu | generic/tests/guest_test.py | 5 | 5018 | import os
import logging
import sys
from autotest.client.shared import error
from virttest import utils_misc
def run(test, params, env):
"""
A wrapper for running customized tests in guests.
1) Log into a guest.
2) Run script.
3) Wait for script execution to complete.
4) Pass/fail according t... | gpl-2.0 |
mknecht/blohg | docs/conf.py | 2 | 7298 | # -*- coding: utf-8 -*-
#
# blohg documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 26 23:45:47 2011.
#
# 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 c... | gpl-2.0 |
lijoantony/django-oscar | src/oscar/apps/dashboard/communications/views.py | 33 | 3118 | from django.utils import six
from django.contrib import messages
from django.contrib.sites.models import get_current_site
from oscar.core.loading import get_model
from django.template import TemplateSyntaxError
from django.utils.translation import ugettext_lazy as _
from django.views import generic
from oscar.core.lo... | bsd-3-clause |
VitorHugoAguiar/ProBot | ProBot_BeagleBone/PIDControllersFile.py | 1 | 4310 | #!/usr/bin/python
# Python Standard Library Imports
import time
# Local files
import ProBotConstantsFile
# Initialization of classes from local files
Pconst = ProBotConstantsFile.Constants()
# PID functions
class PIDControllersClass():
# Build a constructor
def __init__(self):
self.error = 0
... | agpl-3.0 |
rallylee/gem5 | src/mem/HMCController.py | 25 | 3819 | # Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | bsd-3-clause |
RubenKelevra/rethinkdb | test/rql_test/connections/http_support/flask/testsuite/reqctx.py | 557 | 5960 | # -*- coding: utf-8 -*-
"""
flask.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet = None... | agpl-3.0 |
CydarLtd/ansible | lib/ansible/modules/network/lenovo/cnos_portchannel.py | 30 | 22092 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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
# ... | gpl-3.0 |
softEcon/course | lectures/economic_models/generalized_roy/private_package/grmpy/tools/economics/simulation.py | 3 | 4111 | """ This module contains all functions related to the simulation of
a synthetic dataset from the generalized Roy model.
"""
# standard library
import numpy as np
import os
''' Main function '''
def simulate(init_dict, unobserved=False):
""" Simulate a model based on the initialization file.
"""
# ... | mit |
henocdz/dotcom-legacy | PIL/IcnsImagePlugin.py | 40 | 6137 | #
# The Python Imaging Library.
# $Id$
#
# Mac OS X icns file decoder, based on icns.py by Bob Ippolito.
#
# history:
# 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies.
#
# Copyright (c) 2004 by Bob Ippolito.
# Copyright (c) 2004 by Secret Labs.
# Copyright (c) 2004 by Fredrik Lundh.
#
# See the READ... | mit |
fti7/ansible-modules-core | files/fetch.py | 40 | 2324 | # this is a virtual module that is entirely implemented server side
DOCUMENTATION = '''
---
module: fetch
short_description: Fetches a file from remote nodes
description:
- This module works like M(copy), but in reverse. It is used for fetching
files from remote machines and storing them locally in a file ... | gpl-3.0 |
pfctdayelise/scrapy | tests/test_utils_spider.py | 147 | 1056 | import unittest
from scrapy.http import Request
from scrapy.item import BaseItem
from scrapy.utils.spider import iterate_spider_output, iter_spider_classes
from scrapy.spiders import CrawlSpider
class MyBaseSpider(CrawlSpider):
pass # abstract spider
class MySpider1(MyBaseSpider):
name = 'myspider1'
class ... | bsd-3-clause |
AustinRoy7/Pomodoro-timer | venv/Lib/site-packages/pip/_vendor/colorama/winterm.py | 578 | 6290 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... | mit |
FarzanHajian/CreateSwap | src/createswap2.py | 1 | 4347 | #!/usr/bin/env python
# encoding: utf-8
'''
create_swap.py
A Python 2 script for creating and removing Linux swap files.
Copyright (C) 2016 Farzan Hajian
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 Foundatio... | gpl-3.0 |
Ghini/ghini.desktop | bauble/prefs.py | 1 | 10011 | # -*- coding: utf-8 -*-
#
# Copyright 2008-2010 Brett Adams
# Copyright 2015 Mario Frasca <mario@anche.no>.
#
# This file is part of ghini.desktop.
#
# ghini.desktop 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 Foundat... | gpl-2.0 |
yangming85/lettuce | tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/views.py | 152 | 3360 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
class FlatpageViewTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
... | gpl-3.0 |
mgraupe/acq4 | acq4/pyqtgraph/widgets/RawImageWidget.py | 41 | 5410 | from ..Qt import QtCore, QtGui
try:
from ..Qt import QtOpenGL
from OpenGL.GL import *
HAVE_OPENGL = True
except ImportError:
HAVE_OPENGL = False
from .. import functions as fn
import numpy as np
class RawImageWidget(QtGui.QWidget):
"""
Widget optimized for very fast video display.
General... | mit |
SysTheron/adhocracy | src/adhocracy/tests/model/test_user.py | 6 | 1052 | from adhocracy.model import Delegation, Group
from adhocracy.tests import TestController
from adhocracy.tests.testtools import (tt_get_instance, tt_make_proposal,
tt_make_user)
class TestUserController(TestController):
def test_can_delegate_via_forward_on_user(self):
... | agpl-3.0 |
openthread/openthread | tools/otci/otci/utils.py | 4 | 2649 | #!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# 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 of source code must retain the above copyright
# ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.