repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
zstackio/zstack-utility | refs/heads/master | imagestorebackupstorage/ansible/imagestorebackupstorage.py | 1 | #!/usr/bin/env python
# encoding: utf-8
import re
import argparse
import os.path
from zstacklib import *
from datetime import datetime
# create log
logger_dir = "/var/log/zstack/"
create_log(logger_dir)
banner("Starting to deploy image store backup storage agent")
start_time = datetime.now()
# set default value
file_r... |
tylertian/Openstack | refs/heads/master | openstack F/horizon/horizon/dashboards/nova/images_and_snapshots/images/forms.py | 2 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
BT-rmartin/odoo | refs/heads/BT_2900 | addons/stock_invoice_directly/__openerp__.py | 260 | # -*- 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... |
expyriment/expyriment | refs/heads/master | expyriment/stimuli/_rectangle.py | 1 | #!/usr/bin/env python
"""
A Rectangle stimulus.
This module contains a class implementing a rectangle stimulus.
"""
__author__ = 'Florian Krause <florian@expyriment.org>, \
Oliver Lindemann <oliver@expyriment.org>'
__version__ = ''
__revision__ = ''
__date__ = ''
import pygame
from . import defaults
from ._visua... |
beetwo/toucan | refs/heads/master | toucan/invitations/__init__.py | 2 | default_app_config = 'toucan.invitations.apps.InvitationConfig'
|
adamcharnock/django-su | refs/heads/develop | django_su/templatetags/su_tags.py | 2 | # -*- coding: utf-8 -*-
from django import template
from ..utils import su_login_callback
register = template.Library()
@register.inclusion_tag('su/login_link.html', takes_context=False)
def login_su_link(user):
return {'can_su_login': su_login_callback(user)}
|
40423107/2016fallcadp_hw | refs/heads/gh-pages | plugin/summary/__init__.py | 368 | from .summary import *
|
DamonHao/sgboost | refs/heads/master | demo/regression.py | 1 | # -*- coding: utf-8 -*-
import numpy as np
from pandas import DataFrame
from sklearn.datasets import make_regression
from sgboost import SGBRegressor
if __name__ == '__main__':
X, y = make_regression(1000, n_features=5, n_informative=2, random_state=0)
df = DataFrame(np.hstack((X, y[:, None])), columns=['col'+str(... |
vroomDotClub/perkcoin | refs/heads/master | contrib/wallettools/walletunlock.py | 2299 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) |
chand3040/sree_odoo | refs/heads/master | openerp/addons/hr_payroll/res_config.py | 441 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
b12io/orchestra | refs/heads/autostaff-load-hours-once | orchestra/utils/revert.py | 2 | from enum import Enum
from django.db import transaction
from orchestra.core.errors import InvalidRevertError
from orchestra.models import Iteration
from orchestra.models import Task
from orchestra.models import TaskAssignment
from orchestra.project_api.serializers import IterationSerializer
from orchestra.project_api... |
mne-tools/mne-python | refs/heads/main | mne/channels/tests/test_standard_montage.py | 4 | # Authors: Joan Massich <mailsik@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_array_almost_equal,
assert_raises)
from mne import create_info
from mne.... |
valkjsaaa/sl4a | refs/heads/master | python/src/Tools/msi/sequence.py | 291 | AdminExecuteSequence = [
(u'InstallInitialize', None, 1500),
(u'InstallFinalize', None, 6600),
(u'InstallFiles', None, 4000),
(u'InstallAdminPackage', None, 3900),
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'InstallValidate', None, 1400),
]
AdminUISequence = [
(u'FileCos... |
raprasad/indiana-meth-labs | refs/heads/master | methlabs/methlabs/wsgi.py | 1 | """
WSGI config for milestone_reader project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLI... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/auth/admin.py | 62 | from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
AdminPasswordChangeForm)
from django.contrib.auth.models import User, Group
from django.contrib import messages
from django.core.exceptions imp... |
mrbox/django | refs/heads/master | django/contrib/messages/context_processors.py | 705 | from django.contrib.messages.api import get_messages
from django.contrib.messages.constants import DEFAULT_LEVELS
def messages(request):
"""
Returns a lazy 'messages' context variable.
"""
return {
'messages': get_messages(request),
'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS,
}
|
aleksandr-bakanov/astropy | refs/heads/master | astropy/io/fits/tests/test_table.py | 3 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import contextlib
import copy
import gc
import pickle
import re
import pytest
import numpy as np
from numpy import char as chararray
try:
import objgraph
HAVE_OBJGRAPH = True
except ImportError:
HAVE_OBJGRAPH = False
from astropy.io import f... |
sassoftware/mint | refs/heads/master | mint/django_rest/rbuilder/platforms/views/v1/urls.py | 1 | #
# Copyright (c) SAS Institute 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 w... |
friebsch/example-code | refs/heads/master | attic/futures/future_yield2.py | 7 | @asyncio.coroutine
def a(future):
print('a, future:', future, hex(id(future)))
res = yield from future
return res
def b():
future = asyncio.Future()
coro = a(future)
prime_result = next(coro)
print('b, prime_result:', prime_result, hex(id(future)))
loop = asyncio.get_event_loop()
future = ... |
windyuuy/opera | refs/heads/master | chromium/src/third_party/webdriver/pylib/selenium/webdriver/opera/webdriver.py | 14 | #!/usr/bin/python
#
# Copyright 2011 Webdriver_name committers
# Copyright 2011 Google 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
... |
dfdx2/django | refs/heads/master | tests/test_runner/runner.py | 57 | from django.test.runner import DiscoverRunner
class CustomOptionsTestRunner(DiscoverRunner):
def __init__(self, verbosity=1, interactive=True, failfast=True,
option_a=None, option_b=None, option_c=None, **kwargs):
super().__init__(verbosity=verbosity, interactive=interactive, failfast=fa... |
enikesha/toribash | refs/heads/master | main.py | 1 | import cgi
import sys
import logging
import traceback
import struct
import urllib
from datetime import datetime
from base64 import urlsafe_b64encode as b64encode, urlsafe_b64decode as b64decode
from google.appengine.api.datastore_errors import *
from google.appengine.ext import db
from google.appengine.ext import weba... |
yodalee/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/util.py | 497 | # Copyright 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... |
rodriggs/pipeline | refs/heads/master | classification_pipeline/classification_models.py | 6 | import sys, os, re
import pandas as pd
import numpy as np
|
Edraak/circleci-edx-platform | refs/heads/circleci-master | lms/djangoapps/certificates/admin.py | 15 | """
django admin pages for certificates models
"""
from django.contrib import admin
from django import forms
from config_models.admin import ConfigurationModelAdmin
from util.organizations_helpers import get_organizations
from certificates.models import (
CertificateGenerationConfiguration,
CertificateHtmlViewC... |
virt2real/linux-3.10 | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # 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... |
jemmy655/linux | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... |
jerli/sympy | refs/heads/master | sympy/physics/mechanics/tests/test_lagrange.py | 45 | from sympy.physics.mechanics import (dynamicsymbols, ReferenceFrame, Point,
RigidBody, LagrangesMethod, Particle,
inertia, Lagrangian)
from sympy import symbols, pi, sin, cos, tan, simplify, Function, \
Derivative, Matrix
def test_disc_on... |
piqueserver/piqueserver | refs/heads/master | piqueserver/core_commands/moderation.py | 1 | from random import choice
from twisted.internet import reactor
# aparently, we need to send packets in this file. For now, I give in.
from pyspades.contained import CreatePlayer, SetTool, KillAction, InputData, SetColor, WeaponInput
from pyspades.constants import (GRENADE_KILL, FALL_KILL, NETWORK_FPS)
from pyspades.com... |
aleju/ImageAugmenter | refs/heads/master | imgaug/augmenters/weather.py | 2 | """
Augmenters that create weather effects.
List of augmenters:
* :class:`FastSnowyLandscape`
* :class:`CloudLayer`
* :class:`Clouds`
* :class:`Fog`
* :class:`SnowflakesLayer`
* :class:`Snowflakes`
* :class:`RainLayer`
* :class:`Rain`
"""
from __future__ import print_function, divisio... |
fritsvanveen/QGIS | refs/heads/master | python/ext-libs/pygments/lexers/ezhil.py | 22 | # -*- coding: utf-8 -*-
"""
pygments.lexers.ezhil
~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Ezhil language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygme... |
Zhongqilong/mykbengineer | refs/heads/master | kbe/res/scripts/common/Lib/encodings/tis_620.py | 272 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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,errors='st... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/google/appengine/tools/devappserver2/inotify_file_watcher.py | 2 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
abhilashnta/edx-platform | refs/heads/master | common/djangoapps/django_locale/tests.py | 81 | # pylint: disable=invalid-name, line-too-long, super-method-not-called
"""
Tests taken from Django upstream:
https://github.com/django/django/blob/e6b34193c5c7d117ededdab04bb16caf8864f07c/tests/regressiontests/i18n/tests.py
"""
from django.conf import settings
from django.test import TestCase, RequestFactory
from djang... |
alexvanboxel/airflow | refs/heads/master | airflow/migrations/versions/211e584da130_add_ti_state_index.py | 60 | # -*- coding: utf-8 -*-
#
# 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
... |
GoogleCloudPlatform/training-data-analyst | refs/heads/master | courses/machine_learning/deepdive2/end_to_end_ml/labs/serving/application/lib/rsa/prime.py | 14 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
tlangerak/Multi-Agent-Systems | refs/heads/master | build/lib.win32-2.7/spade/pubsub.py | 3 | # -*- coding: utf-8 -*-
import itertools
from Behaviour import MessageTemplate, OneShotBehaviour
from xmpp.protocol import *
from xmpp.simplexml import Node
import uuid
def gen_id():
return str(uuid.uuid4())
#TODO: Implementar retrieve nodes y discovery
class PubSub(object):
def __init__(self, agent): # ... |
Francis-Liu/animated-broccoli | refs/heads/master | nova/compute/utils.py | 1 | # Copyright (c) 2011 OpenStack 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 ... |
cikelengfeng/HTTPIDL | refs/heads/master | Sources/Compiler/antlr4/CodePoints.py | 11 | #
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#
from __future__ import unicode_literals
import sys
def is_leading_surrogate(code_unit):
return 0xD800 <= code_unit <= 0x... |
gomiero/PTVS | refs/heads/master | Python/Tests/TestData/Grammar/TryStmtV3.py | 18 | try:
pass
except Exception as e:
pass |
jpshort/odoo | refs/heads/8.0 | addons/hr_recruitment/report/__init__.py | 442 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
tykling/tlsscout | refs/heads/master | src/alert/migrations/0002_foreignkeys.py | 1 | # -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('alert', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='groupalert',
name='group',
field=models.ForeignKey... |
j00bar/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/backup.py | 427 | # Copyright (c) 2015 Ansible, 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.
#
# Ansi... |
MyRobotLab/pyrobotlab | refs/heads/master | home/AdolphSmith/AmbyByeBye.py | 2 | arduino = Runtime.createAndStart("arduino","Arduino")
arduino.connect("COM9")
mouth = Runtime.create("mouth","Speech")
s8 = Runtime.createAndStart("s8","Servo")
s9 = Runtime.createAndStart("s9","Servo")
s10 = Runtime.createAndStart("s10","Servo")
s11 = Runtime.createAndStart("s11","Servo")
s13 = Runtime.createAndSt... |
boegel/easybuild-framework | refs/heads/master | test/framework/systemtools.py | 1 | ##
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
akostrikov/hadoop-1.2.1-in-action | refs/heads/master | contrib/hod/testing/testModule.py | 182 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... |
serrano-ipkeys/linux | refs/heads/ipkeys | Documentation/target/tcm_mod_builder.py | 2358 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
th3sys/transfixed | refs/heads/master | use_case/lambdatrader.py | 1 | import logging
import json
import datetime
from datetime import timedelta
import decimal
import boto3
from queue import Queue
from queue import Empty
from transfixed import gainfixtrader as gain
import base64
import hmac
import hashlib
import os
import smtplib
import atexit
from email.mime.multipart import MIMEMultipar... |
hynnet/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/idlelib/HyperParser.py | 89 | """
HyperParser
===========
This module defines the HyperParser class, which provides advanced parsing
abilities for the ParenMatch and other extensions.
The HyperParser uses PyParser. PyParser is intended mostly to give information
on the proper indentation of code. HyperParser gives some information on the
structure ... |
LEDS/gde | refs/heads/master | wsgi/gde/test/factories/usuario.py | 2 | import factory
from app.models import Usuario
from test.factories.user import UserFactory
from test.factories.setor import SetorFactory
class UsuarioFactory(factory.django.DjangoModelFactory):
class Meta:
model = Usuario
user = factory.SubFactory(UserFactory)
setor = factory.SubFactory(SetorFactory)
|
tornadozou/tensorflow | refs/heads/master | tensorflow/python/training/saver_test.py | 5 | # 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... |
maximumG/exscript | refs/heads/master | Exscript/protocols/osguesser.py | 3 | #
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# 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,... |
github-account-because-they-want-it/django-allauth | refs/heads/master | allauth/socialaccount/providers/twitch/urls.py | 76 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import TwitchProvider
urlpatterns = default_urlpatterns(TwitchProvider)
|
steffann/pylisp | refs/heads/master | unittests/test_packet_data.py | 1 | #!/usr/bin/env python
from unittests.utils import PacketTestCreator, PacketTest
# Add the parent directory to the start of the path
if __name__ == '__main__':
import sys
sys.path.insert(0, '.')
sys.path.insert(0, '..')
from pylisp.packet.lisp import data
import doctest
import unittest
def load_tests(loa... |
jonyroda97/redbot-amigosprovaveis | refs/heads/develop | lib/aiohttp/protocol.py | 20 | """Http related parsers and protocol."""
import collections
import functools
import http.server
import re
import string
import sys
import zlib
from abc import ABC, abstractmethod
from wsgiref.handlers import format_date_time
from multidict import CIMultiDict, istr
import aiohttp
from . import errors, hdrs
from .hel... |
paulfitz/phantomjs | refs/heads/master | src/qt/qtwebkit/Source/WebCore/inspector/inline-javascript-imports.py | 140 | #!/usr/bin/env python
#
# 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... |
laanwj/sundog | refs/heads/master | tools/endian.py | 1 | # Copyright (c) 2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
##### Endian/word handling
import struct
class BE:
@staticmethod
def getword(data, x):
return struct.unpack('>H', data[... |
HPPTECH/hpp_IOSTressTest | refs/heads/master | IOST_0.23/Libs/IOST_WRun/__init__.py | 4 | #!/usr/bin/python
#======================================================================
#
# Project : hpp_IOStressTest
# File : Libs/IOST_WRun/__init__.py
# Date : Nov 05, 2016
# Author : HuuHoang Nguyen
# Contact : hhnguyen@apm.com
# : hoangnh.hpp@gmail.com
# License : MIT License
# Copyright ... |
sachinpro/sachinpro.github.io | refs/heads/master | tensorflow/python/kernel_tests/clip_ops_test.py | 6 | # Copyright 2015 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 applicable law or a... |
timattox/lammps_USER-DPD | refs/heads/master | examples/SPIN/dipole_spin/exchange_fit_bcc_iron/exchange_fit.py | 27 | #Program fitting the exchange interaction
#Model curve: Bethe-Slater function
import numpy as np, pylab, tkinter
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from decimal import *
print("Loop begin")
#Definition of the Bethe-Slater function
def func(x,a,b,c):
return 4*a*((x/c)**2)*(1-b*(x/... |
fxfitz/ansible | refs/heads/devel | lib/ansible/cli/adhoc.py | 38 | # (c) 2012, Michael DeHaan <michael.dehaan@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
# (at your option) any lat... |
jcrist/blaze | refs/heads/master | blaze/tests/test_cached.py | 17 | from blaze.cached import CachedDataset
from blaze import symbol, discover, compute, into
import pandas as pd
from collections import Iterator
df = pd.DataFrame([['Alice', 100, 1],
['Bob', 200, 2],
['Alice', 50, 3]],
columns=['name', 'amount', 'id'])
t = symbol... |
xujun10110/kombu | refs/heads/master | kombu/transport/virtual/scheduling.py | 40 | """
kombu.transport.virtual.scheduling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consumer utilities.
"""
from __future__ import absolute_import
from itertools import count
class FairCycle(object):
"""Consume from a set of resources, where each resource gets
an equal chance to be consumed from."""
... |
diegofanesi/smartcab | refs/heads/master | smartcab/environment.py | 6 | import time
import random
from collections import OrderedDict
from simulator import Simulator
class TrafficLight(object):
"""A traffic light that switches periodically."""
valid_states = [True, False] # True = NS open, False = EW open
def __init__(self, state=None, period=None):
self.state = st... |
SeNeReKo/TCFlib | refs/heads/master | tcflib/tagsets/hits.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Frederik Elwert <frederik.elwert@web.de>
#
# 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... |
yawnosnorous/python-for-android | refs/heads/master | python3-alpha/extra_modules/twitter.py | 43 | #!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... |
wangjun/odoo | refs/heads/8.0 | addons/account/wizard/account_report_common.py | 342 | # -*- 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... |
williamHuang5468/parallelization | refs/heads/master | Mobile.py | 1 | # -*- coding: utf-8 -*-
from robot.api import logger
from uiautomator import Device
import subprocess
import os
import time
import datetime
from robot.output.monitor import CommandLineWriter as clm
from robot.libraries.BuiltIn import BuiltIn
# logger.info("Importing Android library")
# print "Importing Android library... |
rkday/lib-mp-info | refs/heads/master | MPInfo/setup.py | 1 | from distutils.core import setup
setup(
name='MPInfo',
version='0.2.0',
author='Robert Day',
author_email='rkd@rkd.me.uk',
packages=['mpinfo'],
scripts=['bin/postcode_json.py'],
url='http://pypi.python.org/pypi/MPInfo/',
license='LICENSE.txt',
description='Utilities to retrieve deta... |
Aaron1992/tornado | refs/heads/master | tornado/test/tcpclient_test.py | 19 | #!/usr/bin/env python
#
# Copyright 2014 Facebook
#
# 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 a... |
flgiordano/netcash | refs/heads/master | +/google-cloud-sdk/lib/surface/compute/instance_groups/unmanaged/list_instances.py | 1 | # Copyright 2015 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 applicable law or ag... |
chandlercr/aima-python | refs/heads/master | submissions/aardvark/vacuum2Runner.py | 15 | import agents as ag
import envgui as gui
# change this line ONLY to refer to your project
import submissions.miles.vacuum2 as v2
# ______________________________________________________________________________
# Vacuum environment
class Dirt(ag.Thing):
pass
class VacuumEnvironment(ag.XYEnvironment):
"""The ... |
certik/hermes1d-llnl | refs/heads/master | examples/system_chaotic/plot.py | 3 | from pylab import plot, show, legend
import numpy
data = numpy.loadtxt("solution.gp_0")
x = data[:, 0]
y = data[:, 1]
plot(x, y, label="bas-0")
data = numpy.loadtxt("solution.gp_1")
x = data[:, 0]
y = data[:, 1]
plot(x, y, label="bas-1")
data = numpy.loadtxt("solution.gp_2")
x = data[:, 0]
y = data[:, 1]
plot(x, y, lab... |
coreynoone/spring_one | refs/heads/master | plot.py | 1 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def plot_settings(fontsize=16,width=600):
from matplotlib import rcParams
# http://damon-is-a-geek.com/publication-ready-the-first-time-beautiful-reproducible-plots-with-matp... |
diagramsoftware/sale-workflow | refs/heads/8.0 | sale_order_type_sale_journal/tests/__init__.py | 8 | # -*- coding: utf-8 -*-
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_sale_order_type
|
mbareta/edx-platform-ft | refs/heads/open-release/eucalyptus.master | lms/djangoapps/courseware/access.py | 1 | """
This file contains (or should), all access control logic for the courseware.
Ideally, it will be the only place that needs to know about any special settings
like DISABLE_START_DATES.
Note: The access control logic in this file does NOT check for enrollment in
a course. It is expected that higher layers check f... |
Novamap-SAS/ZXing-GesMop | refs/heads/master | cpp/scons/scons-local-2.0.0.final.0/SCons/Builder.py | 34 | """SCons.Builder
Builder object subsystem.
A Builder object is a callable that encapsulates information about how
to execute actions to create a target Node (file) from source Nodes
(files), and how to create those dependencies for tracking.
The main entry point here is the Builder() factory method. This provides
a... |
TangHao1987/intellij-community | refs/heads/master | python/testData/surround/CustomFoldingRegionSingleCharacter_after.py | 79 | # <editor-fold desc="Description">
x = 'foo' + 'bar'
# </editor-fold> |
zliang7/crosswalk | refs/heads/master | app/tools/android/make_apk.py | 4 | #!/usr/bin/env python
# Copyright (c) 2013, 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=F0401
import atexit
import json
import optparse
import os
import re
import shutil
import struct
import subpro... |
robbiet480/home-assistant | refs/heads/dev | homeassistant/components/onvif/device.py | 3 | """ONVIF device abstraction."""
import asyncio
import datetime as dt
import os
from typing import List
from aiohttp.client_exceptions import ClientConnectionError, ServerDisconnectedError
import onvif
from onvif import ONVIFCamera
from onvif.exceptions import ONVIFError
from zeep.exceptions import Fault
from homeassi... |
klmitch/nova | refs/heads/master | nova/api/validation/extra_specs/traits.py | 3 | # Copyright 2020 Red Hat, 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 applicable law o... |
rapilabs/django | refs/heads/master | tests/migrations/migrations_test_apps/conflicting_app_with_dependencies/migrations/0001_initial.py | 241 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", ... |
hddn/studentsdb | refs/heads/master | students/tests/test_group_forms.py | 1 | from django.contrib.auth.models import User
from django.test import Client, TestCase
from django.urls import reverse
from students.models import Group
class TestGroupUpdateForm(TestCase):
"""Test for GroupEdit form"""
@classmethod
def setUpTestData(cls):
Group.objects.create(id=1, title='Group1'... |
Danisan/odoo-1 | refs/heads/8.0 | addons/crm_project_issue/__init__.py | 386 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | toontown/battle/HealJokes.py | 6 | from toontown.toonbase import TTLocalizer
toonHealJokes = TTLocalizer.ToonHealJokes
|
orekyuu/intellij-community | refs/heads/master | python/testData/psi/YieldFromNoExpr.py | 83 | def f():
yield from
|
zerkrx/zerkbox | refs/heads/develop | lib/youtube_dl/extractor/urplay.py | 50 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class URPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://urplay.se/program/190031-tripp-trapp-trad-sovkudde',
... |
openmv/micropython | refs/heads/master | tests/multi_net/uasyncio_tcp_readinto.py | 5 | # Test uasyncio stream readinto() method using TCP server/client
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
try:
import uarray as array
except ImportError:
try:
import array
except I... |
cecep-edu/edx-platform | refs/heads/eucalyptus.2 | common/djangoapps/enrollment/tests/test_data.py | 9 | """
Test the Data Aggregation Layer for Course Enrollments.
"""
import datetime
import unittest
import ddt
from mock import patch
from nose.tools import raises
from pytz import UTC
from django.conf import settings
from course_modes.models import CourseMode
from enrollment import data
from enrollment.errors import (
... |
elba7r/frameworking | refs/heads/master | frappe/email/__init__.py | 2 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def sendmail_to_system_managers(subject, content):
frappe.sendmail(recipients=get_system_managers(), subject=subject, content=content)
@frappe.whitelist()
def get... |
pablodanielrey/firmware | refs/heads/master | historico/tts/Main.py | 1 | # -*- coding: utf-8 -*-
import signal, sys
import inject
import thread
import time
import datetime
import Queue
from config import Config
from speaker import SpeakerThread
''' el core de websockets '''
from Ws.SimpleWebSocketServer import SimpleWebSocketServer
from websocketServer import WebsocketServer
def config_... |
offlinehacker/flumotion | refs/heads/master | flumotion/component/misc/httpserver/__init__.py | 133 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free ... |
moluzhang/flask | refs/heads/master | setup.py | 141 | """
Flask
-----
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
intentions. And before you ask: It's BSD licensed!
Flask is Fun
````````````
Save in a hello.py:
.. code:: python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hell... |
Bogh/django-oscar | refs/heads/master | sites/demo/apps/order/models.py | 44 | from oscar.apps.order.models import *
|
MakeHer/edx-platform | refs/heads/dashboard.2 | common/lib/xmodule/xmodule/contentstore/django.py | 261 | from __future__ import absolute_import
from importlib import import_module
from django.conf import settings
_CONTENTSTORE = {}
def load_function(path):
"""
Load a function by name.
path is a string of the form "path.to.module.function"
returns the imported python object `function` from `path.to.mod... |
robertdown/atlas_docs | refs/heads/master | atlas_doc/migrations/0015_auto_20170830_1836.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-30 22:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('atlas_doc', '0014_auto_20170830_1803'),
... |
umbraclet16/ardupilot | refs/heads/master | Tools/LogAnalyzer/UnitTest.py | 7 | #!/usr/bin/env python
#
#
# Unit and regression tests for the LogAnalyzer code
#
#
# TODO: implement more unit+regression tests
from __future__ import print_function
import DataflashLog
import traceback
from VehicleType import VehicleType
try:
# test DataflashLog reading 1
logdata = DataflashLog.DataflashLog()
... |
vmagamedov/grpclib | refs/heads/master | examples/helloworld/helloworld_pb2.py | 2 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: helloworld/helloworld.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_databas... |
SDSG-Invenio/invenio | refs/heads/invenio-inis | invenio/modules/jsonalchemy/jsonext/parsers/connect_parser.py | 17 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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 later... |
CodeOpsTechnologies/BookBot | refs/heads/master | lxml/__init__.py | 106 | # this is a package
def get_include():
"""
Returns a list of header include paths (for lxml itself, libxml2
and libxslt) needed to compile C code against lxml if it was built
with statically linked libraries.
"""
import os
lxml_path = __path__[0]
include_path = os.path.join(lxml_path, '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.