repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
google/rekall | rekall-core/rekall/plugins/addrspaces/vmem.py | from __future__ import print_function
# Rekall Memory Forensics
#
# Copyright (C) 2012 Nir Izraeli (nirizr at gmail dot com)
# Copyright 2012 Sebastien Bourdon-Richard
# Copyright 2013 Google Inc. All Rights Reserved.
# Authors:
# Sebastien Bourdon-Richard, Nir Izraeli
# Adapted for Rekall by Michael Cohen <scudette@g... |
stefanseefeld/qmtest | qm/test/execution_thread.py | ########################################################################
#
# File: execution_thread.py
# Author: Mark Mitchell
# Date: 2001-08-04
#
# Contents:
# Code for coordinating the running of tests.
#
# Copyright (c) 2001, 2002 by CodeSourcery, LLC. All rights reserved.
#
# For license terms see the file... |
sjreggel/swarming_turtles | swarming_turtles_smach/scripts/smach_communicate.py | #!/usr/bin/env python
#import roslib; roslib.load_manifest('swarming_turtles_smach')
import rospy
import smach
import smach_ros
import tf
import math
from socket import gethostname
from swarming_turtles_msgs.msg import Turtles, Turtle, CommunicationProtocol
from swarming_turtles_communicate.communicate import connec... |
yramagicman/stow-dotfiles | config/ranger/colorschemes/jungle.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from ranger.gui.color import *
from ranger.colorschemes.default import Default
class Scheme(Default):
progress_bar_color = green
def use(self, context):
fg, bg, attr = Default.u... |
CatalansMB/War1714 | src/module_scenes.py | from header_common import *
from header_operations import *
from header_triggers import *
from header_scenes import *
from module_constants import *
####################################################################################################################
# Each scene record contains the following fields:
#... |
kingvuplus/boom2 | lib/python/Components/PluginComponent.py | # Embedded file name: /usr/lib/enigma2/python/Components/PluginComponent.py
import os
from shutil import rmtree
from bisect import insort
from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS
from Tools.Import import my_import
from Tools.Profile import profile
from Plugins.Plugin import Plugin... |
QEF/q-e_schrodinger | dev-tools/src-normal.py | #!/usr/bin/env python3
# (C) 2010 Norbert Nemec
#
# USAGE: src-normal.py < input.f90 > output.f90
#
# Script to normalize Fortran source code:
# a) expand tabs to spaces (tab width 8 characters)
# b) remove trailing space
# c) normalize multiword keywords
# d) normalize capitalization of keywords and intrinsic... |
pmisik/buildbot | master/buildbot/test/integration/test_graphql.py | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
siemens/django-mantis-actionables | mantis_actionables/migrations/0021_auto_20150309_1037.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mantis_actionables', '0020_auto_20150304_0834'),
]
operations = [
migrations.AddField(
model_name='status',
... |
Kev/SleekBot | plugins/uptime.py | import logging
import datetime, time
class uptime(object):
def __init__(self, bot, config):
self.bot = bot
self.config = config
self.about = "Allows users to query the bot's uptime."
self.bot.addIMCommand('uptime', self.handle_uptime)
self.bot.addMUCCommand('uptime', self.handle_uptime)
self.bot.addHelp('... |
wunderlins/learning | python/zodb/lib/osx/ZODB/tests/testConfig.py | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
crobinso/virt-manager | virtManager/device/netlist.py | # Copyright (C) 2014 Red Hat, Inc.
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from gi.repository import Gtk
import virtinst
from virtinst import log
from ..lib import uiutil
from ..baseclass import vmmGObjectUI
NET_ROW_LABEL = 0
NET_ROW_SENSITIVE = 1
... |
squaregoldfish/QuinCe | external_scripts/NRT/Saildrone_conversion/saildrone_module/nrtftp.py | import pysftp
from io import BytesIO
# Upload result codes
UPLOAD_OK = 0
NOT_INITIALISED = 1
FILE_EXISTS = 2
# Get a connection to the FTP server
def connect_ftp(ftp_config):
return pysftp.Connection(host=ftp_config["server"],
username=ftp_config["user"],
private_key=ftp_config["private_key_file"],
... |
martinling/imusim | imusim/behaviours/sampling.py | """
Sampling behaviours.
"""
# Copyright (C) 2009-2011 University of Edinburgh
#
# This file is part of IMUSim.
#
# IMUSim 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
# ... |
ukanga/SickRage | tests/sickrage_tests/providers/torrent/parsing_tests.py | # coding=utf-8
# This file is part of SickRage.
#
# URL: https://SickRage.GitHub.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... |
thomasvs/morituri | morituri/test/test_image_table.py | # -*- Mode: Python; test-case-name: morituri.test.test_image_table -*-
# vi:si:et:sw=4:sts=4:ts=4
from morituri.image import table
from morituri.test import common as tcommon
def h(i):
return "0x%08x" % i
class TrackTestCase(tcommon.TestCase):
def testRepr(self):
track = table.Track(1)
se... |
arjclark/rose | lib/python/rose/run_source_vc.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-7 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
lootr/netzob | netzob/test/src/test_netzob/suite_DocTests.py | # !/usr/bin/python
# -*- coding: utf-8 -*-
# +---------------------------------------------------------------------------+
# | 01001110 01100101 01110100 01111010 01101111 01100010 |
# | |
# | Netzob : Inferring... |
Gustry/inasafe | safe/report/extractors/infographics.py | # coding=utf-8
"""Infographic extractor class for standard reporting.
"""
from safe.common.utilities import safe_dir
from safe.definitions.concepts import concepts
from safe.report.extractors.util import (
resolve_from_dictionary,
layer_hazard_classification)
from safe.utilities.resources import resource_url
_... |
kernevil/samba | third_party/waf/waflib/Tools/fc.py | #! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2016-2018 (ita)
"""
Fortran support
"""
from waflib import Utils, Task, Errors
from waflib.Tools import ccroot, fc_config, fc_scan
from waflib.TaskGen import extension
from waflib.Configure import conf
ccroot.USELIB_VARS['fc'] = set(['FCFLAGS', 'DEFINE... |
smurfix/MoaT | irrigation/rainman/migrations/0002_QBroker.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-19 10:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rainman', '0001_initial_stuff'),
]
operations = [
migrations.AddField(
... |
oracc/pyoracc | pyoracc/model/line.py | '''
Copyright 2015, 2016 University College London.
This file is part of PyORACC.
PyORACC 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.
... |
LPM-HMS/COSMOS-2.0 | cosmos/job/drm/drm_lsf.py | import subprocess as sp
import re
import os
from cosmos.job.drm.DRM_Base import DRM
from cosmos.job.drm.util import exit_process_group
from cosmos import TaskStatus
decode_lsf_state = dict(
[
("UNKWN", "process status cannot be determined"),
("PEND", "job is queued and active"),
("PSUSP", ... |
sanger-pathogens/iva | iva/kmers.py | # Copyright (c) 2014-2016 Genome Research Ltd.
#
# This file is part of IVA.
#
# IVA 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.
# ... |
AlienCowEatCake/ImageViewer | src/ThirdParty/Exiv2/exiv2-0.27.5-Source/tests/bugfixes/github/test_CVE_2017_14863.py | # -*- coding: utf-8 -*-
import system_tests
class TestCvePoC(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/132"
filename = "$data_path/01-Null-exiv2-poc"
commands = ["$exiv2 $filename"]
stdout = [
"""File name : $filename
File size : 24550 Bytes
... |
jat255/hyperspy | hyperspy/tests/model/test_model2d.py | # -*- coding: utf-8 -*-
# Copyright 2007-2022 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 y... |
tinutomson/wikicoding | wiki/plugins/images/south_migrations/0003_label_v01_rename.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db... |
qtproject/qt-creator | share/qtcreator/debugger/opencvtypes.py | ############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... |
boland1992/SeisSuite | build/lib/ambient/ant/psconfig.py | """
Module that parses global parameters from a configuration
file at first import, to make them available to the other
parts of the program.
"""
import ConfigParser
import os
import glob
import json
import datetime as dt
import numpy as np
def select_and_parse_config_file(basedir='.', ext='cnf', verbose=True):
... |
sergiopasra/megaradrp | megaradrp/recipes/calibration/trace.py | #
# Copyright 2011-2021 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
"""Fiber tracing Recipe."""
from __future__ import division, print_function
import logging
import warnings
import numpy
import numpy.polynomial.polyno... |
ares/robottelo | robottelo/ui/lifecycleenvironment.py | # -*- encoding: utf-8 -*-
"""Implements Lifecycle content environments."""
from robottelo.ui.base import Base
from robottelo.ui.locators import common_locators, locators, tab_locators
from robottelo.ui.navigator import Navigator
class LifecycleEnvironment(Base):
"""Manipulates lifecycle environments from UI."""
... |
eliasdesousa/indico | indico/legacy/services/interface/rpc/process.py | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... |
pwyliu/cloud-init-0.6.3 | cloudinit/CloudConfig/cc_mounts.py | # vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# ... |
kamawanu/pydbgr | trepan/vprocessor.py | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2010, 2012-2013 Rocky Bernstein <rocky@gnu.org>
#
# 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... |
CSB-IG/miRNAseq_rnw | source_scripts_data/circos_plots/mimat_positions.py | positions = {
'MIMAT0000062' : "hs9 94175957 94176036",
'MIMAT0000062' : "hs11 122146522 122146593",
'MIMAT0000062' : "hs22 46112749 46112822",
'MIMAT0000063' : "hs22 46113686 46113768",
'MIMAT0000064' : "hs21 16539828 16539911",
'MIMAT0000065' : "hs9 94178834 94178920",
'MIMAT0000066' : "hs19 51692786 51692864",
'MIMA... |
javierdallamore/ioriodb | tools/resttest.py | #!/usr/bin/env python3
'''module to test all rest api behavior, for correct paths and also handling
errors, check returned status code, content type and body'''
from __future__ import print_function
import sys
import time
import argparse
import iorio
MT_JSON = 'application/json'
MT_XML = 'application/xml'
def p(buck... |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/dogapi/common.py | import logging
import socket
import sys
from dogapi.exceptions import *
from dogapi.constants import *
log = logging.getLogger('dd.dogapi')
def is_p3k(): return sys.version_info[0] == 3
if is_p3k():
import urllib.request, urllib.error, urllib.parse
else:
import urllib2
def get_ec2_instance_id():
try:
... |
pirata-cat/agora-ciudadana | agora_site/agora_core/forms/election.py | # Copyright (C) 2013 Eduardo Robles Elvira <edulix AT wadobo DOT com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... |
mysociety/yournextrepresentative | elections/models.py | from __future__ import unicode_literals
from collections import defaultdict
from datetime import date
from django.db import models
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from popolo.models import Organization
from compat import python_2_unicode_compati... |
onaio/kpi | hub/utils/i18n.py | # coding: utf-8
from django.db.models import Q
from django.db.models.functions import Length
from django.utils.translation import get_language
from ..models import SitewideMessage
class I18nUtils:
@staticmethod
def get_sitewide_message(slug="welcome_message", lang=None):
"""
Returns a sitewi... |
superdesk/Live-Blog | documentor/libraries/Sphinx-1.1.3-py3.2/sphinx/builders/epub.py | # -*- coding: utf-8 -*-
"""
sphinx.builders.epub
~~~~~~~~~~~~~~~~~~~~
Build epub files.
Originally derived from qthelp.py.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import sys
import time
import codecs
impo... |
ioanpocol/superdesk-core | superdesk/media/renditions.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from __futur... |
jmesteve/medical | openerp/oemedical/oemedical/oemedical_lab/oemedical_lab.py | # coding=utf-8
# Copyright (C) 2012-2013 Federico Manuel Echeverri Choux
# 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) ... |
raoanirudh/oq-risklib | setup.py | # oq-risklib: The OpenQuake Risk Library
# Copyright (C) 2013-2015, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option)... |
redhat-cip/numeter | web-app/numeter_webapp/web_app/settings_local.py | """
Dynamic settings file for site customization.
"""
from core.utils.configparser import Custom_ConfigParser
config = Custom_ConfigParser()
config.read('/etc/numeter/numeter_webapp.cfg')
import os
BASEDIR = os.path.dirname(os.path.abspath(__file__))
# Use a file to get SECRET_KEY
SECRET_KEY_FILE = config.get_d('glo... |
ahmedaljazzar/edx-platform | lms/djangoapps/verify_student/views.py | """
Views for the verification flow
"""
import datetime
import decimal
import json
import logging
import urllib
import analytics
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.mail import se... |
SambitAcharya/coala | coalib/tests/results/DiffTest.py | import unittest
import json
from bears.tests.c_languages import skip_if_no_clang
from coalib.results.Diff import Diff, ConflictError, SourceRange
from clang.cindex import Index
from coalib.output.JSONEncoder import JSONEncoder
class DiffTest(unittest.TestCase):
def setUp(self):
self.file = ["1", "2", "3... |
topecz/Odoo_Samples | scheduler_demo/models/scheduler_model.py | # -*- coding: utf-8 -*-
from openerp import models, fields, api
#Import logger
import logging
#Get the logger
_logger = logging.getLogger(__name__)
#External import
import datetime
class scheduler_demo(models.Model):
_name = 'scheduler.demo'
name = fields.Char(required=True)
numberOfUpdates = fields.Integ... |
odoousers2014/LibrERP | core_extended/ir_attachment.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved
#
# This program is free software: you can redistr... |
eduNEXT/edunext-platform | lms/djangoapps/certificates/tasks.py | """
Tasks that generate a course certificate for a user
"""
from logging import getLogger
from celery import shared_task
from celery_utils.persist_on_failure import LoggedPersistOnFailureTask
from django.contrib.auth import get_user_model
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_ke... |
philanthropy-u/edx-platform | openedx/features/course_duration_limits/migrations/0004_auto_20181128_1521.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-28 20:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_duration_limits', '0003_auto_20181128_1407'),
]
operations = [
migr... |
crystalspace/CS | docs/support/docutils/core.py | # Authors: David Goodger
# Contact: goodger@python.org
# Revision: $Revision$
# Date: $Date$
# Copyright: This module has been placed in the public domain.
"""
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior. For custom behav... |
freedesktop-unofficial-mirror/gstreamer-sdk__cerbero | cerbero/commands/package.py | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
cbeck88/fifengine | demos/rpg/scripts/scene.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU ... |
chenbojian/SU2 | SU2_PY/filter_adjoint.py | #!/usr/bin/env python
## \file filter_adjoint.py
# \brief Applies various filters to the adjoint surface sensitivities of an airfoil
# \author T. Lukaczyk, F. Palacios
# \version 3.2.9 "eagle"
#
# SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
# Dr. Thomas D. Ec... |
iulian787/spack | var/spack/repos/builtin/packages/cantera/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class Cantera(SConsPackage):
"""Cantera is a suite of object-oriented software tools f... |
kumy/pycaching | test/test_point.py | #!/usr/bin/env python3
import unittest
from pycaching import Point
class TestPoint(unittest.TestCase):
def test_from_string(self):
with self.subTest("normal"):
self.assertEqual(Point.from_string("N 49 45.123 E 013 22.123"), Point(49.75205, 13.36872))
with self.subTest("south and wes... |
mbonani/aseba | docs/en/conf.py | # -*- coding: utf-8 -*-
#
# Aseba documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 22 09:18:32 2018.
#
# 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... |
kohout/drf-demo | src/demo4/renderers.py | # -*- coding: utf-8 -*-
from rest_framework import renderers
from wkhtmltopdf.utils import wkhtmltopdf, make_absolute_paths
from tempfile import NamedTemporaryFile
class TemplateHTMLRenderer(renderers.TemplateHTMLRenderer):
def get_template_names(self, response, view):
"""
generic template name b... |
jmakov/ggrc-core | test/integration/ggrc/converters/test_multi_import_csv.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from flask import json
from sqlalchemy import or_, and_
from ggrc.models import... |
NetApp/manila | manila/share/drivers/nexenta/options.py | # Copyright 2016 Nexenta Systems, 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 req... |
phoad/rsocket-cpp | build/fbcode_builder/getdeps/buildopts.py | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import a... |
hkariti/mopidy | tests/test_version.py | from __future__ import absolute_import, unicode_literals
import unittest
from distutils.version import StrictVersion
from mopidy import __version__
class VersionTest(unittest.TestCase):
def assertVersionLess(self, first, second): # noqa: N802
self.assertLess(StrictVersion(first), StrictVersion(second)... |
brendangregg/bcc | tools/cachestat.py | #!/usr/bin/python
#
# cachestat Count cache kernel function calls.
# For Linux, uses BCC, eBPF. See .c file.
#
# USAGE: cachestat
# Taken from funccount by Brendan Gregg
# This is a rewrite of cachestat from perf to bcc
# https://github.com/brendangregg/perf-tools/blob/master/fs/cachestat
#
# Copyrigh... |
cshallue/models | research/differential_privacy/dp_sgd/per_example_gradients/per_example_gradients.py | # 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... |
suneeth51/neutron | neutron/db/ipam_backend_mixin.py | # Copyright (c) 2015 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... |
darina/omim | tools/python/maps_generator/utils/file.py | import errno
import functools
import glob
import logging
import os
import shutil
from functools import partial
from multiprocessing.pool import ThreadPool
from typing import AnyStr
from typing import Dict
from typing import List
from typing import Optional
from urllib.parse import unquote
from urllib.parse import urljo... |
apache/tinkerpop | gremlin-python/src/main/python/gremlin_python/driver/remote_connection.py | #
# 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... |
Juniper/nova | nova/api/openstack/compute/server_tags.py | # 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
# d... |
aranjan7/contrail-controller-aranjan | src/config/utils/provision_static_route.py | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import argparse
import ConfigParser
from vnc_api.vnc_api import *
from vnc_api.gen.resource_xsd import RouteType
from vnc_api.gen.resource_xsd import RouteTableType
from vnc_api.gen.resource_client import InterfaceRouteT... |
jasonkuster/incubator-beam | sdks/python/apache_beam/runners/google_cloud_dataflow/template_runner_test.py | #
# 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 us... |
yandex-qatools/UISoup | uisoup/win_soup/mouse.py | #!/usr/bin/env python
# Copyright (c) 2014 Max Beloborodko.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
cc1-cloud/cc1 | src/cm/views/admin_cm/farm.py | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... |
rackerlabs/lunr | testlunr/unit/storage/helper/utils/client/test_disk_client.py | #!/usr/bin/env python
# Copyright (c) 2011-2016 Rackspace US, 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 app... |
15Dkatz/pants | src/python/pants/util/contextutil.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... |
mahak/cinder | cinder/tests/unit/group/test_groups_api.py | # Copyright (C) 2016 EMC Corporation.
# 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... |
tdifg/pyspider | pyspider/scheduler/task_queue.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-07 13:12:10
import time
import heapq
import logging
import threading
from six.moves import queue as Queue
try:
from UserDict import DictMixin
e... |
benjyw/pants | src/python/pants/fs/fs.py | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import hashlib
import os
# The max filename length for HFS+, extX and NTFS is 255, but many systems also have limits on the
# total path length (made up of multiple filenames), so we incl... |
Onager/dftimewolf | tests/lib/processors/grepper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests the activity_triage recipe and grepper processor."""
import unittest
from dftimewolf import config
from dftimewolf.lib import state
from dftimewolf.lib.containers import containers
from dftimewolf.lib.processors import grepper
class GrepperTest(unittest.TestCas... |
w1ll1am23/home-assistant | homeassistant/components/squeezebox/media_player.py | """Support for interfacing to the Logitech SqueezeBox API."""
import asyncio
import json
import logging
from pysqueezebox import Server, async_discover
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassist... |
krlinus/Spectrum-Access-System | src/prop/itm/test_itm.py | # Copyright 2016 SAS Project 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... |
fhuertas/mock_decorators | tests/mock_decorators/test_function_mock.py | import sys
import unittest
from mock_decorators.function_mock import FunctionMock
from mock_decorators.function_mock import FunctionMockResult
from mock_decorators.function_mock import FunctionMockChangeResult
from mock_decorators.function_mock import FunctionMockCheckCall
from tests.mock_decorators import module_test
... |
CloudVLab/professional-services | tools/kunskap/main.py | # Copyright 2019 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 or agreed to in writing, ... |
icereval/osf.io | api_tests/base/test_views.py | # -*- coding: utf-8 -*-
import httplib as http
import pkgutil
import mock
from nose import SkipTest
from nose.tools import * # flake8: noqa
from tests.base import ApiTestCase
from osf_tests import factories
from framework.auth.oauth_scopes import CoreScopes
from api.base.settings.defaults import API_BASE
from api... |
stdweird/aquilon | tests/broker/test_show_service_all.py | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
Brocade-OpenSource/OpenStack-DNRM-Nova | nova/cmd/baremetal_deploy_helper.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, 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.apach... |
clarkperkins/stackdio | stackdio/ui/management/commands/build_ui.py | # -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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... |
sekikn/ambari | ambari-common/src/main/python/ambari_commons/repo_manager/choco_manager.py | """
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 this ... |
0--key/lib | portfolio/Python/scrapy/instrumart/myflukestore.py | import re
import json
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from product_spiders.items import Product, ProductLoaderWithNameStrip as Produc... |
iotivity/iotivity | test/test_manager/devunittest_reporter.py | #!/usr/bin/python
'''
/******************************************************************
*
* Copyright 2018 Samsung Electronics 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... |
ehelms/Opus | opus/lib/prov/instance.py | ##############################################################################
# Copyright 2010 North Carolina State University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# ... |
proevo/pythondotorg | successstories/views.py | from django.contrib import messages
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.generic import CreateView, DetailView, ListView
from honeypot.decorators import check_honeypot
from .forms import StoryForm
from .models import Story, StoryCategory
class Contex... |
lpagliari/etherpad-lite | bin/dirty-db-cleaner.py | #!/usr/bin/env PYTHONUNBUFFERED=1 python2
#
# Created by Bjarni R. Einarsson, placed in the public domain. Go wild!
#
import json
import os
import sys
try:
dirtydb_input = sys.argv[1]
dirtydb_output = '%s.new' % dirtydb_input
assert(os.path.exists(dirtydb_input))
assert(not os.path.exists(dirtydb_outpu... |
tombstone/models | research/object_detection/model_lib_tf1_test.py | # Copyright 2017 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... |
openstack/tacker | tacker/api/v1/resource_helper.py | # (c) Copyright 2014 Cisco Systems 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 re... |
pombredanne/ninja | platform_helper.py | #!/usr/bin/env python
# Copyright 2011 Google Inc.
# Copyright 2013 Patrick von Reth <vonreth@kde.org>
# 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://ww... |
zoofIO/flexx | flexxamples/demos/d3_collision.py | # doc-export: CollisionWidget
"""
Example using 3D. Adapted from a demo by Mike Bostock.
"""
from flexx import flx
from pscript import RawJS
from pscript.stubs import Math, d3, window
flx.assets.associate_asset(__name__, 'https://d3js.org/d3.v3.min.js')
class CollisionWidget(flx.Widget):
""" A widget showing a ... |
macropin/xml-models-redux | xml_models/xpath_twister.py | """
Copyright 2009 Chris Tarttelin and Point2 Technologies
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 following dis... |
ArcaniteSolutions/truffe2 | truffe2/communication/migrations/0008_auto__add_logoviews__add_websitenewsviews__add_agepslideviews.py | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'LogoViews'
db.create_table(u'communication_logoviews', (
... |
sklam/numba | numba/core/compiler_machinery.py | import timeit
from abc import abstractmethod, ABCMeta
from collections import namedtuple, OrderedDict
import inspect
from numba.core.compiler_lock import global_compiler_lock
from numba.core import errors, config, transforms
from numba.core.tracing import event
from numba.core.postproc import PostProcessor
from numba.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.