repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
bclau/nova | refs/heads/master | nova/tests/integrated/v3/test_instance_actions.py | 11 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
caneruguz/osf.io | refs/heads/develop | website/archiver/signals.py | 79 | import blinker
signals = blinker.Namespace()
archive_fail = signals.signal('archive-fail')
|
intgr/django | refs/heads/master | tests/fixtures_model_package/tests.py | 84 | from django.core import management
from django.core.management import CommandError
from django.test import TestCase
from .models import Article
class SampleTestCase(TestCase):
fixtures = ['fixture1.json', 'fixture2.json']
def testClassFixtures(self):
"Test cases can load fixture objects into models ... |
spektom/incubator-airflow | refs/heads/master | airflow/providers/google/cloud/hooks/tasks.py | 4 | #
# 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... |
ComputationalRadiationPhysics/pyDive | refs/heads/master | pyDive/arrays/gpu_ndarray.py | 2 | """
Copyright 2015 Heiko Burau
This file is part of pyDive.
pyDive is free software: you can redistribute it and/or modify
it under the terms of of either the GNU General Public License or
the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your ... |
yiwen-luo/LeetCode | refs/heads/master | Python/summary-ranges.py | 3 | # Time: O(n)
# Space: O(1)
#
# Given a sorted integer array without duplicates,
# return the summary of its ranges.
#
# For example, given [0,1,2,4,5,7],
# return ["0->2","4->5","7"].
#
class Solution:
# @param {integer[]} nums
# @return {string[]}
def summaryRanges(self, nums):
ranges = []
... |
o3project/odenos | refs/heads/develop | src/test/python/org/o3project/odenos/core/component/network/flow/ofpflow/test_ofp_flow_action_pop_mpls.py | 6 | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... |
Noahs-ARK/ARKcat | refs/heads/master | src/generate_vocab.py | 1 | import sys, re
from sklearn.feature_extraction.text import TfidfVectorizer
from cnn_methods import *
import argparse
# import scipy
def main(files):
word2vec_file_path = files[0]
output_file_path = files[1]
input_file_paths = files[2:]
print 'processing files:', input_file_paths, 'using word vector fil... |
sandvine/horizon | refs/heads/master | openstack_dashboard/test/test_plugins/panel_group_config/_40_admin_add_panel_to_second_group.py | 69 | # The name of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'second_panel'
# The name of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The name of the panel group the PANEL is associated with.
PANEL_GROUP = 'second_panel_group'
# Python panel class of the PANEL to be added... |
ashhher3/cvxpy | refs/heads/master | cvxpy/constraints/eq_constraint.py | 7 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
ThinkOpen-Solutions/odoo | refs/heads/stable | doc/_themes/odoodoc/odoo_pygments.py | 129 | # -*- coding: utf-8 -*-
import imp
import sys
from pygments.style import Style
from pygments.token import *
# extracted from getbootstrap.com
class OdooStyle(Style):
background_color = '#ffffcc'
highlight_color = '#fcf8e3'
styles = {
Whitespace: '#BBB',
Error: 'bg:#FAA #A00',
Key... |
coldeasy/python-driver | refs/heads/master | tests/unit/cqlengine/test_udt.py | 1 | # Copyright 2013-2017 DataStax, 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 writi... |
ventrixcode/yowsup | refs/heads/pr/2 | yowsup/layers/protocol_media/protocolentities/message_media.py | 1 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from yowsup.layers.protocol_messages.protocolentities import MessageProtocolEntity
class MediaMessageProtocolEntity(MessageProtocolEntity):
'''
<message t="{{TIME_STAMP}}" from="{{CONTACT_JID}}"
offline="{{OFFLINE}}" type="text" id="{{MESSAGE_I... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/python/test/test_hashlib.py | 3 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.hashlib}
"""
from twisted.trial.unittest import TestCase
from twisted.trial import util
class HashObjectTests(TestCase):
"""
Tests for the hash object APIs presented by L{hashlib}, C{md5} and C{sha1}.
... |
cordis/pycloudia | refs/heads/master | pycloudia/explorer/consts.py | 1 | class EXPLORER(object):
PROTOCOL_PREFIX = 'CLD'
IMMEDIATE_HEARTBEAT_INTERVAL = 5
BROADCAST_HEARTBEAT_INTERVAL = 2
|
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/indirect_parameters.py | 9 | '''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
_... |
refnode/django-material | refs/heads/master | material/templatetags/material_form.py | 10 | import os
from collections import defaultdict
from django.forms.forms import BoundField
from django.template.base import (
TemplateSyntaxError, Library,
Node, Variable, token_kwargs)
from django.template.loader import get_template
from django.template.loader_tags import IncludeNode
register = Library()
def... |
aYukiSekiguchi/ACCESS-Chromium | refs/heads/master | native_client_sdk/src/build_tools/tests/update_manifest_test.py | 7 | #!/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.
"""Unit tests for update_manifest.py."""
__author__ = '[email protected] (Matt Ball)'
import errno
import os
import SimpleHTTPServ... |
sightmachine/SimpleCV | refs/heads/master | SimpleCV/examples/display/videowriter.py | 13 | #!/usr/bin/python
from SimpleCV import *
import time
c = Camera()
vs = VideoStream("foo.avi")
for i in range(0,500):
c.getImage().edges().invert().save(vs)
time.sleep(0.05)
|
timj/scons | refs/heads/master | test/DVIPS/DVIPS.py | 1 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... |
SivagnanamCiena/pynos | refs/heads/master | tests/versions/base/test_lldp.py | 1 | #!/usr/bin/env python
"""
Copyright 2015 Brocade Communications Systems, 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 applicab... |
smsaladi/moltemplate | refs/heads/master | moltemplate/bonds_by_type.py | 1 | #!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# License: MIT License (See LICENSE.md)
# Copyright (c) 2013
"""
bonds_by_type.py reads a LAMMPS data file (or an excerpt of a LAMMPS)
data file containing bonded many-body interactions by atom type
(and bond type), and generates a list... |
coreyoconnor/nixops | refs/heads/master | nixops/resources/azure_availability_set.py | 6 | # -*- coding: utf-8 -*-
# Automatic provisioning of Azure availability sets.
import os
import azure
from nixops.util import attr_property
from nixops.azure_common import ResourceDefinition, ResourceState, normalize_location
from azure.mgmt.compute import AvailabilitySet
class AzureVirtualNetworkDefinition(Resource... |
tboyce021/home-assistant | refs/heads/dev | tests/components/ambient_station/test_config_flow.py | 21 | """Define tests for the Ambient PWS config flow."""
import json
from unittest.mock import patch
import aioambient
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.ambient_station import CONF_APP_KEY, DOMAIN, config_flow
from homeassistant.config_entries import SOURCE_USER
from hom... |
knoopr/ShotForTheHeart | refs/heads/master | mailin.py | 2 | import httplib2
import json
class Mailin:
""" This is the Mailin client class
"""
def __init__(self,base_url,api_key):
self.base_url = base_url
self.api_key = api_key
def do_request(self,resource,method,indata):
url = self.base_url + "/" + resource
h = httplib2.Http(disable_ssl_certificate_val... |
bradojevic/django-prod | refs/heads/master | src/manage.py | 404 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
jbouse-debian/paramiko | refs/heads/master | paramiko/sftp_server.py | 3 | # Copyright (C) 2003-2007 Robey Pointer <[email protected]>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... |
ibab/tensorflow | refs/heads/master | tensorflow/python/ops/histogram_ops.py | 9 | # 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... |
shsingh/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_receive.py | 57 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, John Westcott IV <[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': ... |
akash1808/nova | refs/heads/master | nova/tests/functional/v3/test_create_backup.py | 29 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
twitter/pants | refs/heads/master | src/python/pants/util/socket.py | 2 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import errno
import io
import select
import socket
from builtins import object
def tear... |
chirpradio/chirpradio-volunteers | refs/heads/master | site-packages/django/core/management/commands/sqlflush.py | 36 | from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed."
output_transaction = True
def handle_noargs(self, **options):
f... |
AleCandido/Lab3 | refs/heads/master | Esercitazione7/Esercitazione7.py | 1 | import getpass
import sys
from uncertainties import unumpy
import numpy as np
if getpass.getuser() == "alessandro":
path = "/home/alessandro/Documents/Università/3°anno/Laboratorio3/Lab3/"
elif getpass.getuser() == "Roberto":
path = "C:\\Users\\Roberto\\Documents\\GitHub\\Lab3\\"
elif getpass.getuser() == "Stu... |
wavicles/pycode-browser | refs/heads/master | Code/Physics/spring3d.py | 6 | #spring3d.py
from visual import *
base = box (pos=(0,-1,0), length=16, height=0.1, width=4, color=color.blue)
wall = box (pos=(0,0,0), length=0.1, height=2, width=4, color=color.white)
ball = sphere (pos=(4,0,0), radius=1, color=color.red)
spring = helix(pos=(0,0,0), axis=(4,0,0), radius=0.5, color=color.red)
ball2 = ... |
wilebeast/FireFox-OS | refs/heads/master | B2G/gecko/testing/mozbase/moztest/moztest/output/base.py | 12 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import with_statement
from contextlib import closing
from StringIO import StringIO
try:
from abc i... |
ktok07b6/polyphony | refs/heads/master | tests/testbench/tb08.py | 1 | from polyphony import testbench
@testbench
def test():
sum = 0
for i in range(2, 5):
sum += i-1
print(sum)
assert sum == 6
test()
|
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bicep_l.py | 14 | import sys
def setup(core, object):
object.setStringAttribute('armor_category', '@obj_attr_n:armor_battle')
object.setStringAttribute('required_faction', 'Rebel')
object.setIntAttribute('cat_armor_standard_protection.kinetic', 5664)
object.setIntAttribute('cat_armor_standard_protection.energy', 5664)
object.setIn... |
gevero/py_matrix | refs/heads/master | py_matrix/utils.py | 1 | import numpy as np
import scipy as sp
z0 = sp.constants.value('characteristic impedance of vacuum')
def rot_ell(m_rt_ps):
'''Utility to compute rotation and ellipticity
starting from reflection and transmission matrix
Parameters
----------
'm_RTsp' = sp reflection and transmission matrix
R... |
stevehof/location-ninja | refs/heads/master | lib/sqlalchemy/ext/orderinglist.py | 22 | # ext/orderinglist.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""A custom list that manages index/position information for contained
elements.... |
geerlingguy/ansible | refs/heads/devel | test/units/plugins/inventory/test_constructed.py | 48 | # -*- coding: utf-8 -*-
# Copyright 2019 Alan Rominger <[email protected]>
#
# 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
# ... |
amwelch/a10sdk-python | refs/heads/master | a10sdk/core/vrrp/vrrp_a_vrid_tracking_options_gateway_ipv6_gateway.py | 2 | from a10sdk.common.A10BaseClass import A10BaseClass
class Ipv6Gateway(A10BaseClass):
"""Class Description::
IPv6 Gateway.
Class ipv6-gateway supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param ipv6_address: {"optional... |
alirizakeles/zato | refs/heads/dsuch-f-gh723-add-exe-agent | code/zato-web-admin/src/zato/admin/static/brython/_brython/Lib/external_import.py | 9 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
s... |
san-mate/python-social-auth | refs/heads/master | examples/pyramid_example/example/views.py | 62 | from pyramid.view import view_config
@view_config(route_name='home', renderer='templates/home.pt')
def home(request):
return {}
@view_config(route_name='done', renderer='templates/done.pt')
def done(request):
return {}
|
dgzurita/odoo | refs/heads/8.0 | addons/web_kanban_gauge/__openerp__.py | 428 | {
'name': 'Gauge Widget for Kanban',
'category': 'Hidden',
'description': """
This widget allows to display gauges using justgage library.
""",
'version': '1.0',
'depends': ['web_kanban'],
'data' : [
'views/web_kanban_gauge.xml',
],
'qweb': [
],
'auto_install': True,
}
|
otherness-space/myProject003 | refs/heads/master | my_project_003/lib/python2.7/site-packages/django/contrib/gis/tests/inspectapp/tests.py | 109 | from __future__ import absolute_import
import os
from django.db import connections
from django.test import TestCase
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TEST_DATA
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.utils.unittest import skipU... |
ncloudioj/splice | refs/heads/master | migrations/versions/171b15035012_.py | 3 | """empty message
Revision ID: 171b15035012
Revises: 456611d35239
Create Date: 2016-03-02 16:14:18.962790
"""
# revision identifiers, used by Alembic.
revision = '171b15035012'
down_revision = '456611d35239'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine_na... |
merfii/PythonExercises | refs/heads/master | llluiop/0005/changeResolution.py | 38 | #!/usr/bin/env python
from __future__ import division
import os
import Image
resolution_IP4 = (800, 600)
def ChgResolution(image):
img = Image.open(image)
ratio = max(img.size[0]/resolution_IP4[0], img.size[1]/resolution_IP4[1])
if ratio > 1:
imgNew = img.resize(( int(img.size[0]/ratio), int(img... |
peri-source/peri | refs/heads/master | peri/viz/plots.py | 1 | # monkey-batch the matplotlibrc for peri:
from peri.viz import base
from builtins import range
import matplotlib as mpl
import matplotlib.pylab as pl
from matplotlib import ticker
from matplotlib.gridspec import GridSpec
from matplotlib.offsetbox import AnchoredText
from mpl_toolkits.axes_grid1.inset_locator import ... |
super7ramp/vertaal | refs/heads/master | projects/views.py | 2 | # -*- coding: utf-8 -*-
"""Copyright (c) 2012 Sergio Gabriel Teves
All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any... |
mattrobenolt/django | refs/heads/master | tests/gis_tests/geo3d/views.py | 6027 | # Create your views here.
|
s0enke/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 ... |
dliessi/frescobaldi | refs/heads/master | frescobaldi_app/scorewiz/parts/brass.py | 3 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... |
aajanki/youtube-dl | refs/heads/master | youtube_dl/extractor/youjizz.py | 148 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class YouJizzIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?youjizz\.com/videos/[^/#?]+-(?P<id>[0-9]+)\.html(?:$|[?#])'
_TEST = {
'url': 'http://www.youjizz.com/video... |
cherez/youtube-dl | refs/heads/master | youtube_dl/extractor/rtlnl.py | 102 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
)
class RtlNlIE(InfoExtractor):
IE_NAME = 'rtl.nl'
IE_DESC = 'rtl.nl and rtlxl.nl'
_VALID_URL = r'''(?x)
https?://(?:www\.)?
(?:
... |
PennyDreadfulMTG/Penny-Dreadful-Discord-Bot | refs/heads/master | decksite/data/models/person.py | 1 | from typing import List
from decksite.data import deck
from shared.container import Container
class Person(Container):
__decks = None
@property
def decks(self) -> List[deck.Deck]:
if self.__decks is None:
self.__decks = deck.load_decks(f'd.person_id = {self.id}', season_id=self.season... |
Thraxis/SickRage | refs/heads/master | lib/unidecode/x04d.py | 252 | data = (
'[?] ', # 0x00
'[?] ', # 0x01
'[?] ', # 0x02
'[?] ', # 0x03
'[?] ', # 0x04
'[?] ', # 0x05
'[?] ', # 0x06
'[?] ', # 0x07
'[?] ', # 0x08
'[?] ', # 0x09
'[?] ', # 0x0a
'[?] ', # 0x0b
'[?] ', # 0x0c
'[?] ', # 0x0d
'[?] ', # 0x0e
'[?] ', # 0x0f
'[?] ', # 0x10
'[?] ... |
tanmaykm/edx-platform | refs/heads/master | openedx/core/lib/block_structure/tests/test_block_structure.py | 5 | """
Tests for block_structure.py
"""
# pylint: disable=protected-access
from collections import namedtuple
from copy import deepcopy
import ddt
import itertools
from nose.plugins.attrib import attr
from unittest import TestCase
from openedx.core.lib.graph_traversals import traverse_post_order
from ..block_structure i... |
guru81/test | refs/heads/master | 2.py | 1 | import numpy as np
f = open('data.txt', 'w')
for a in np.arange(0.0, 10, 1):
for b in np.arange(0.0, 10, 1):
data = (a,b,a/b)
f.close()
|
tecan/xchat-rt | refs/heads/master | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/src/__init__.py | 5 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 co... |
lufan82/p2pool | refs/heads/master | wstools/Namespaces.py | 292 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... |
sbbic/core | refs/heads/master | writerfilter/source/ooxml/factory_ns.py | 4 | #!/usr/bin/env python
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from __future__ import print_function
from x... |
KonstantinRitt/qmqtt | refs/heads/master | tests/gtest/gtest/googletest/googlemock/scripts/upload_gmock.py | 770 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
SUSE-Cloud/nova | refs/heads/stable/havana | nova/virt/libvirt/imagecache.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Michael Still and Canonical 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:... |
axbaretto/beam | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 762 | import hashlib
import os
from pip._vendor.lockfile import LockFile
from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
... |
amenonsen/ansible | refs/heads/devel | lib/ansible/modules/network/vyos/vyos_l3_interfaces.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... |
facelessuser/Pywin32 | refs/heads/master | lib/x32/win32com/universal.py | 27 | # Code that packs and unpacks the Univgw structures.
# See if we have a special directory for the binaries (for developers)
import types
import pythoncom
from win32com.client import gencache
com_error = pythoncom.com_error
_univgw = pythoncom._univgw
def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_... |
t-miyamae/teuthology | refs/heads/master | scripts/run.py | 10 | """
usage: teuthology --help
teuthology --version
teuthology [options] [--] <config>...
Run ceph integration tests
positional arguments:
<config> one or more config files to read
optional arguments:
-h, --help show this help message and exit
-v, --verbose be m... |
smartsheet-platform/smartsheet-python-sdk | refs/heads/master | smartsheet/models/copy_or_move_row_directive.py | 1 | # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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.... |
avanzosc/avanzosc6.1 | refs/heads/master | avanzosc_tire_management/wizard/wizard_vehicle_locations.py | 1 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011-2012 Daniel (Avanzosc) <http://www.avanzosc.com>
# 28/03/2012
#
# This program is free software: you can redistribute it and/or modify
#... |
vnsofthe/odoo-dev | refs/heads/master | addons/base_action_rule/test_models.py | 333 | from openerp.osv import fields, osv
from openerp import api
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Cancelled'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Closed')
]
class lead_test(osv.Model):
_name = "base.action.rule.lead.test"
_columns = {
'name': f... |
xen0l/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group.py | 20 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
dezgeg/debbindiff | refs/heads/master | debbindiff/presenters/html.py | 1 | # -*- coding: utf-8 -*-
#
# debbindiff: highlight differences between two builds of Debian packages
#
# Copyright © 2014-2015 Jérémy Bobbio <[email protected]>
# © 2015 Reiner Herrmann <[email protected]>
# © 2012-2013 Olivier Matz <[email protected]>
# © 2012 Alan De Smet <ad... |
htomeht/euler | refs/heads/master | util/primes.py | 1 | #! /bin/env python
import math
class Sieve:
def __init__(self, size):
self._sieve = [False] * (size)
def flip(self, n):
self._sieve[n-1] = not self._sieve[n-1]
def reset(self, n):
self._sieve[n-1] = False
def isPrime(self, n):
return self._sieve[n-1]
class Primes:
def __init__... |
Cinntax/home-assistant | refs/heads/dev | homeassistant/components/upnp/const.py | 7 | """Constants for the IGD component."""
import logging
CONF_ENABLE_PORT_MAPPING = "port_mapping"
CONF_ENABLE_SENSORS = "sensors"
CONF_HASS = "hass"
CONF_LOCAL_IP = "local_ip"
CONF_PORTS = "ports"
DOMAIN = "upnp"
LOGGER = logging.getLogger(__package__)
SIGNAL_REMOVE_SENSOR = "upnp_remove_sensor"
|
jorik041/weevely3 | refs/heads/master | testsuite/test_shell_sh.py | 14 | from testsuite.base_test import BaseTest
from core.weexceptions import ArgparseError
from core.vectors import PhpCode
from core.vectors import Os
from core import modules
from core.sessions import SessionURL
from core import messages
import logging
import os
class SystemInfo(BaseTest):
def setUp(self):
se... |
MattRijk/django-ecomsite | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/__main__.py | 200 | '''
support ';python -m charade <file1> [file2] ...' package execution syntax (2.7+)
'''
from charade import charade_cli
charade_cli()
|
chbrun/behavui | refs/heads/master | behavui/features/config.py | 1 | FEATURE_NB_MAX=5
|
yjxtogo/horizon | refs/heads/master | openstack_dashboard/dashboards/project/data_processing/nodegroup_templates/tables.py | 5 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
rafalo1333/kivy | refs/heads/master | kivy/tests/test_uix_anchorlayout.py | 21 | '''
Anchor layout unit test
=======================
'''
from kivy.tests.common import GraphicUnitTest
class UIXAnchorLayoutTestcase(GraphicUnitTest):
def box(self, r, g, b):
from kivy.uix.widget import Widget
from kivy.graphics import Color, Rectangle
wid = Widget(size_hint=(None, None),... |
GoogleCloudPlatform/solutions-cloud-orchestrate | refs/heads/main | cli/src/orchestrate/commands/broker/machines/unassign.py | 1 | # python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/module_loading.py | 38 | import os
import sys
import unittest
from zipimport import zipimporter
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
class DefaultLoader(unittest.TestCase):
def test_loader(self):
"Normal module existence can be tested"
test_module = ... |
cloudrain21/googletest | refs/heads/master | scripts/fuse_gtest_files.py | 2577 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
zerothi/sids | refs/heads/master | sisl/io/siesta/fdf.py | 1 | import warnings
from datetime import datetime
import numpy as np
import scipy as sp
from os.path import isfile
import itertools as itools
from ..sile import add_sile, get_sile_class, sile_fh_open, sile_raise_write, SileError
from .sile import SileSiesta
from .._help import *
from sisl._internal import set_module
from... |
tukutela/Kay-Framework | refs/heads/master | kay/lib/babel/plural.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... |
arpruss/raspberryjam-pe | refs/heads/master | p2/scripts3/squarecurve.py | 2 | #
# Code by Alexander Pruss and under the MIT license
#
import lsystem
from mineturtle import *
t = Turtle()
t.pendelay(0)
t.turtle(None)
t.penblock(block.BRICK_BLOCK)
t.gridalign()
# http://mathforum.org/advanced/robertd/lsys2d.html
rules = { 'X': 'XF-F+F-XF+F+XF-F+F-X' }
def go():
t.startface()... |
ocadotechnology/boto | refs/heads/develop | tests/integration/awslambda/__init__.py | 586 | # Copyright (c) 2015 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 limitation the rights ... |
romilbhardwaj/OlaDash | refs/heads/master | OlaDashServer/OlaDash/views.py | 1 | from django.shortcuts import render, HttpResponse
from django.conf import settings
def requestcab(request):
Lat = float(getattr(settings, "USER_LAT", None))
Lon = float(getattr(settings, "USER_LON", None))
print Lat
print Lon
#TODO: INSERT OLA API CALL
return HttpResponse("Cab requested at {0}... |
BT-fgarbely/odoo | refs/heads/8.0 | openerp/report/render/rml2pdf/color.py | 443 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
GPflow/GPflow | refs/heads/develop | doc/source/notebooks/advanced/advanced_many_points.pct.py | 1 | # ---
# jupyter:
# jupytext:
# formats: ipynb,.pct.py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
... |
MaxQu/MAVProxy | refs/heads/master | setup.py | 2 | from setuptools import setup
version = "1.4.24"
setup(name='MAVProxy',
version=version,
zip_safe=True,
description='MAVProxy MAVLink ground station',
long_description='''A MAVLink protocol proxy and ground station. MAVProxy
is oriented towards command line operation, and is suitable for embedd... |
VanirAOSP/external_chromium_org | refs/heads/kk44 | tools/telemetry/telemetry/unittest/options_for_unittests.py | 63 | # 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.
"""This module provides the global variable options_for_unittests.
This is set to a BrowserOptions object by the test harness, or None
if unit tests are... |
davidvon/pipa-pay-server | refs/heads/master | admin/posplat/services/query_merchant_rsp.py | 1 | # coding=utf-8
from posplat.ISO8583.ISO8583 import ISO8583
from posplat.services import PosResponse
from posplat.services.query_merchant_service import QueryMerchantService
class QueryMerchantResponse(PosResponse):
def __init__(self, msg):
super(QueryMerchantResponse, self).__init__(msg)
self.serv... |
yetu/repotools | refs/heads/master | third_party/boto/mashups/order.py | 101 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
dracos/django | refs/heads/master | tests/template_tests/templatetags/inclusion.py | 65 | import operator
from django.template import Engine, Library
engine = Engine(app_dirs=True)
register = Library()
@register.inclusion_tag('inclusion.html')
def inclusion_no_params():
"""Expected inclusion_no_params __doc__"""
return {"result": "inclusion_no_params - Expected result"}
inclusion_no_params.any... |
hassanshamim/ask-alexa-pykit | refs/heads/master | tests/test_response_builder.py | 3 | from unittest import skip
from nose.tools import assert_equal, assert_dict_equal
from .context import ask
RAW_TEMPLATE = {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Some default text goes here."
},
"shouldEndSession... |
EducationalTestingService/rsmtool | refs/heads/stable | tests/test_utils_prmse.py | 1 | import os
import warnings
from pathlib import Path
import numpy as np
import pandas as pd
from nose.tools import assert_almost_equal, eq_, ok_, raises
from numpy.testing import assert_array_equal
from pandas.testing import assert_frame_equal
from rsmtool.utils.prmse import (get_n_human_scores,
... |
a-olszewski/django-s3direct | refs/heads/master | s3direct/tests.py | 5 | import json
from django.test.utils import override_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse, resolve
from django.test import TestCase
from s3direct import widgets
HTML_OUTPUT = (
'<div class="s3direct" data-policy-url="/get_upload_params/">'
' <a cla... |
udxxabp/zulip | refs/heads/master | zerver/management/commands/realm_emoji.py | 114 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import Realm
from zerver.lib.actions import do_add_realm_emoji, do_remove_realm_emoji
import sys
class Command(BaseCommand):
help = """Manage emoji for the specified realm
Example: python manage.py realm... |
texastribune/tx_salaries | refs/heads/master | tx_salaries/utils/transformers/ut_health_northeast.py | 1 | from . import base
from . import mixins
from datetime import date
class TransformedRecord(
mixins.GenericCompensationMixin,
mixins.GenericDepartmentMixin, mixins.GenericIdentifierMixin,
mixins.GenericJobTitleMixin, mixins.GenericPersonMixin,
mixins.MembershipMixin, mixins.Organization... |
kleientertainment/ds_mod_tools | refs/heads/master | pkg/win32/Python27/Lib/encodings/cp037.py | 93 | """ Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.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 deco... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.