repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
houssine78/addons | resource_activity/models/partner.py | # -*- coding: utf-8 -*-
# Copyright 2018 Coop IT Easy SCRLfs.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.multi
def _resource_activity_count(self):
for pa... |
mugurrus/superdesk-core | superdesk/io/feed_parsers/__init__.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 abc imp... |
houssine78/addons | mrp_brewing/models/stock.py | # -*- coding: utf-8 -*-
# Part of Open Architechts Consulting sprl. See LICENSE file for full copyright and licensing details. # noqa
# Copyright 2019 Coop IT Easy SCRLfs
from openerp import api, fields, models, _, SUPERUSER_ID
class StockMove(models.Model):
_inherit = "stock.move"
@api.model
... |
dokterbob/django-shopkit | shopkit/currency/__init__.py | # Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl>
#
# This file is part of django-shopkit.
#
# django-shopkit 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 2, or (at... |
henrytao-me/openerp.positionq | addons/positionq/pq_salary/pq_thang_luong.py | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
from openerp.tools.translate import _
import logging
from datetime import datetime
from openerp.osv.fields import datetime as datetime_field
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT
from unidecode import unidecode
i... |
CanonicalLtd/subiquity | subiquitycore/async_helpers.py | # Copyright 2019 Canonical, Ltd.
#
# 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 version.
#
# This program is distribute... |
itsjeyd/edx-platform | openedx/core/djangoapps/coursegraph/utils.py | """
Helpers for the CourseGraph app
"""
from django.core.cache import cache
from django.utils import timezone
class TimeRecordingCacheBase(object):
"""
A base class for caching the current time for some key.
"""
# cache_prefix should be defined in children classes
cache_prefix = None
_cache = ... |
gymnasium/edx-platform | lms/djangoapps/courseware/tests/test_video_mongo.py | # -*- coding: utf-8 -*-
"""
Video xmodule tests in mongo.
"""
import json
from collections import OrderedDict
from uuid import uuid4
from tempfile import mkdtemp
import shutil
import ddt
from django.conf import settings
from django.core.files import File
from django.core.files.base import ContentFile
from django.test... |
xkmato/ureport | ureport/polls/migrations/0026_auto_20160202_0950.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0025_auto_20160129_1422'),
]
operations = [
migrations.AddField(
model_name='pollquestion',
... |
gem/sidd | ui/helper/ms_attr_delegate.py | # Copyright (c) 2011-2013, ImageCat Inc.
#
# 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 version.
#
# This program is... |
sim0629/irc | irc/tests/test_schedule.py | import random
import datetime
import pytest
from irc import schedule
def test_delayed_command_order():
"""
delayed commands should be sorted by delay time
"""
null = lambda: None
delays = [random.randint(0, 99) for x in range(5)]
cmds = sorted([
schedule.DelayedCommand.after(delay, null)
for delay in dela... |
DeepSOIC/Lattice | latticeShapeString.py | #***************************************************************************
#* *
#* Copyright (c) 2015 - Victor Titov (DeepSOIC) *
#* <vv.titov@gmail.com> *
#* ... |
jaraco/paramiko | paramiko/common.py | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# 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... |
oubiwann/openpix | openpix/util.py | import os
import re
import crypt
import random
import readline
from datetime import datetime
from pyparsing import oneOf
import openpix
from openpix import art
from openpix import meta
dividerSegment = "_" * 34
bannerDivider = "\n %s .:|:. %s\n" % (dividerSegment, dividerSegment)
starterHelp = "Type help or '?' fo... |
thebjorn/pymagic | magicmethods.py | # -*- coding: utf-8 -*-
"""
From http://www.wellho.net/mouth/3002_a-list-of-special-method-and-attribute-names-in-python.html
and also http://www.rafekettler.com/magicmethods.html
__new__ True constructor - usually wraps __init__
__init__ Object constructor
__call__
__getattr__ Handling object attributes [example] an... |
daniellustig/pipecheck | parse_litmus_test_results.py | #!/usr/bin/env python
################################################################################
## PipeCheck: Specifying and Verifying Microarchitectural ##
## Enforcement of Memory Consistency Models ##
## ... |
Ripsnorta/pyui2 | docs/demos/widgetdemo/widgetdemo.py | ###################################################################################
# Copyright (c) 2005 John Judd
#
# 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, inclu... |
poppogbr/genropy | packages/showcase/webpages/dev/remote.py | # -*- coding: UTF-8 -*-
#--------------------------------------------------------------------------
# Copyright (c) : 2004 - 2007 Softwell sas - Milano
# Written by : Giovanni Porcari, Michele Bertoldi
# Saverio Porcari, Francesco Porcari , Francesco Cavazzana
#--------------------------------------... |
pombredanne/https-git.fedorahosted.org-git-kobo | kobo/django/auth/krb5.py | # -*- coding: utf-8 -*-
"""
# This is authentication backend for Django middleware.
# In settings.py you need to set:
MIDDLEWARE_CLASSES = (
...
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.RemoteUserMiddleware',
...
)
AUTHENTICATION_BACKENDS = (
'kob... |
skosukhin/spack | var/spack/repos/builtin/packages/recordproto/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
skosukhin/spack | var/spack/repos/builtin/packages/py-macs2/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
skosukhin/spack | lib/spack/spack/util/naming.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
pararthshah/libavg-vaapi | src/python/ui/scrollarea.py | # -*- coding: utf-8 -*-
# libavg - Media Playback Engine.
# Copyright (C) 2003-2011 Ulrich von Zadow
#
# This library 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 of the License, o... |
larsonmp/security-system | src/service/rest/client.py | from io import BytesIO
from json import dumps
from mimetypes import guess_all_extensions
from os.path import join
from requests import delete, get, post
from tempfile import gettempdir
def guess_extension(mimetype):
#there's an oddity on raspbian wherein guess_extension is non-deterministic
return sorted(guess_all_e... |
swryan/lazr.testing | src/lazr/testing/tests/test_docs.py | # Copyright 2009 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.testing
#
# lazr.testing 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, version 3 of the License.
#
# lazr.testing is... |
JuniorJPDJ/pyChomikBox | ChomikBox/PartFile.py | import io
import os
def total_len(o):
# Stolen from requests_toolbelt and modified
if hasattr(o, '__len__'):
return len(o)
if hasattr(o, 'len'):
return o.len
if hasattr(o, 'fileno'):
try:
fileno = o.fileno()
except io.UnsupportedOperation:
pass... |
sagiss/sardana | src/sardana/tango/pool/ZeroDExpChannel.py | #!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... |
nerow/solutions | cc150-python/Chapter-1-Arrays-and-Strings/1.6.py | '''
1.6 Given an image represented by an NxN matrix, where each pixel in the image is 4
bytes, write a method to rotate the image by 90 degrees Can you do this in place?
'''
def demo(matrix):
N = len(matrix)
if N == 0:
return matrix
# up <===> down
for i in range(0, N / 2) :
for j in range(N):
... |
sprax/python | romanize.py | #!/usr/bin/env python3
'''Convert decimal number to Roman numerals'''
@file: romanize.py
@auth: Sprax Lines
@date: 2017-07-29 15:32:03 Sat 29 Jul
NUMERAL = (
("M", 1000), ("CM", 900), ("D", 500), ("CD", 400), ("C", 100), ("XC", 90),
("L", 50), ("XL", 40), ("X", 10), ("IX", 9), ("V", 5), ("IV", 4), ("I", 1))
... |
Aldriana/ShadowCraft-Engine | shadowcraft/objects/old_proc_data.py | allowed_procs = {
'heroic_grace_of_the_herald': {
'stat': 'crit',
'value': 1710,
'duration': 10,
'proc_name': 'Herald of Doom',
'behaviours': {'default': 'grace_of_the_herald'}
},
'heroic_key_to_the_endless_chamber': {
'stat': 'agi',
'value': 1710,
... |
QuLogic/tephi | docs/tephi/source/sphinxext/generate_package_rst.py | # (C) British Crown Copyright 2010 - 2012, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... |
ebilionis/py-best | best/inverse/_inverse_problem.py | """Define the InverseProblem class.
Author:
Ilias Bilionis
Date:
1/14/2013
1/21/2013
"""
__all__ = ['InverseProblem']
import numpy as np
import itertools
from ..random import StudentTLikelihoodFunction
from ..random import RandomWalkProposal
from ..random import SequentialMonteCarlo
class InversePro... |
IfcOpenShell/IfcOpenShell | src/blenderbim/test/tool/test_misc.py | # BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on 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 Foundati... |
lueschem/edi | tests/test_command_line_interface.py | # -*- coding: utf-8 -*-
# Copyright (C) 2017 Matthias Luescher
#
# Authors:
# Matthias Luescher
#
# This file is part of edi.
#
# edi 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 3 of... |
Astoriane/jCrunchyroll | lib/crunchy-xml-decoder/crunchyDec.py | import gzip, lxml, math, sha, zlib
from Base64Decoder import Base64Decoder
from binascii import hexlify, unhexlify
from bs4 import BeautifulSoup
from Common import Common
from crypto.cipher.aes_cbc import AES_CBC
from crypto.cipher.base import noPadding, padWithPadLen
class crunchyDec:
def __init__(self):
pass
de... |
goblinhack/crystaleer | python/things/wall.py | import tp
def thing_init(t):
return
def wall_init(name, short_name, tiles=[]):
x = tp.Tp(name)
x.set_short_name(short_name)
x.set_is_movement_blocking(True)
x.set_is_wall(True)
x.set_is_solid_ground(True)
if tiles is not None:
for t in tiles:
x.set_tile(t, delay_ms=... |
lablup/sorna-agent | tests/docker/test_agent.py | import signal
from typing import (
Any,
Mapping,
)
from unittest.mock import AsyncMock
from aiodocker.exceptions import DockerError
from ai.backend.common.exception import ImageNotAvailable
from ai.backend.common.types import AutoPullBehavior
from ai.backend.common.docker import ImageRef
from ai.backend.agen... |
vakaras/nmadb-academics | src/nmadb_academics/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from nmadb_students.models import Student
class Section(models.Model):
""" Information about section.
"""
title = models.CharField(
max_length=45,
unique=True,
verbose_name=_(u'title'... |
IfcOpenShell/IfcOpenShell | test/run.py | ###############################################################################
# #
# This file is part of IfcOpenShell. #
# #
... |
onebit0fme/django-pgMemento | pg_memento/management/commands/_sql.py | from django.db import connection
INIT_PG_MOMENTO = """
-- 'Create event trigger to log schema changes ...'
SELECT pgmemento.create_schema_event_trigger(0);
-- 'Creating triggers for tables in ':schema_name' schema ...'
SELECT pgmemento.create_schema_log_trigger('public', string_to_array('%s',','));
-- 'Creating aud... |
savoirfairelinux/partner-addons | partner_multi_relation_extended/models/res_partner.py | # -*- coding: utf-8 -*-
# © 2017 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import _, api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.onchange('parent_id')
def onchange_parent_id(self):
res = super(ResPartner, s... |
DEAP/deap | setup.py | #!/usr/bin/env python
import sys
warnings = list()
try:
from setuptools import setup, Extension, find_packages
modules = find_packages(exclude=['examples'])
except ImportError:
warnings.append("warning: using distutils.core.setup, cannot use \"develop\" option")
from distutils.core import setup, Exten... |
haphaeu/yoshimi | mth/MultiThread_ClientPool.py | import threading
import Queue
from random import random
theVar = 0
class MyThread ( threading.Thread ):
def run ( self ):
global theVar
while True:
client=myPool.get()
print '- iniciando thread-'
if client=='stop':
print 'Thread terminou <-'
... |
mpvismer/pyutils | process.py | '''
@author Mark Vismer
Functions related to string stuff
'''
from string import *
import win32api, win32process, win32con
import subprocess
import threading
def set_app_id(app_id='mycompany.myproduct.subproduct.version'):
'''
This is necessary to use the main window (or app icon) as the task bar
icon.
... |
dwillis/socialcongress | tracker/utils.py | import datetime
from tracker.models import Member, Report
from django.template.defaultfilters import slugify
import csv
import urllib
import simplejson as json
from dateutil.parser import *
import time
def update_twitter(branch='house', official=True, batch=1):
if official:
screen_names = [x.official_twit... |
scriptotek/mc2skos | mc2skos/error.py |
class InvalidRecordError(RuntimeError):
def __init__(self, msg, control_number=None):
super(InvalidRecordError, self).__init__(msg)
self.control_number = control_number
class UnknownSchemeError(InvalidRecordError):
def __init__(self, code=None, **kwargs):
if code is None:
... |
ninegrid/dotfiles-vim | bundle/vim-orgmode/ftplugin/orgmode/liborgmode/documents.py | # -*- coding: utf-8 -*-
"""
documents
~~~~~~~~~
TODO: explain this :)
"""
from UserList import UserList
from orgmode.liborgmode.base import MultiPurposeList, flatten_list, Direction, get_domobj_range
from orgmode.liborgmode.headings import Heading, HeadingList
class Document(object):
u"""
Representation of a... |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/survey/cmd/systemversion/errors.py | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: errors.py
import mcl.status
ERR_SUCCESS = mcl.status.MCL_SUCCESS
ERR_INVALID_PARAM = mcl.status.framework.ERR_START
ERR_MARSHAL_FAILED = mcl.status.f... |
m4h7/flatfile-rs | oldpy/flatfile/column.py | import struct
class MetadataColumn:
"""One column with type and additional information"""
def __init__(self, name, type_, meaning = None, compression = None):
self.name = name
self.type_ = type_
self.meaning = meaning
self.compression = compression
def encode_uint(self, v):
... |
alexsavio/palladium | palladium/fit.py | """Utilities for fitting modles.
"""
import sys
from datetime import datetime
from docopt import docopt
from pprint import pformat
from sklearn.grid_search import GridSearchCV
from .interfaces import annotate
from .util import apply_kwargs
from .util import args_from_config
from .util import initialize_config
from .... |
RyanSkraba/beam | sdks/python/apache_beam/runners/portability/artifact_service.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 ... |
google/grr | grr/core/grr_response_core/lib/parsers/linux_release_parser_test.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Unit test for the linux distribution parser."""
import io
import os
from absl import app
from grr_response_core.lib.parsers import linux_release_parser
from grr_response_core.lib.rdfvalues import anomaly as rdf_anomaly
from grr_response_core.lib.rdfvalues import pa... |
nir0s/logrotated | setup.py | from setuptools import setup, find_packages
import os
import codecs
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
return codecs.open(os.path.join(here, *parts), 'r').read()
install_requires = [
"click==6.6",
"jinja2==2.8"... |
DmitryDmitrienko/usecasevstu | version_info.py | # -*- coding: utf-8 -*-
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(4, 0, 0, 0),
prodvers=(4, 0, 0, 0),
mask=0x3f,
flags=0x0,
OS=0x4,
fileType=0x1,
subtype=0x0,
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringT... |
cgqyh/pyalgotrade-mod | samples/bccharts_example_2.py | from pyalgotrade import bar
from pyalgotrade import strategy
from pyalgotrade import plotter
from pyalgotrade.technical import vwap
from pyalgotrade.barfeed import csvfeed
from pyalgotrade.bitstamp import broker
from pyalgotrade import broker as basebroker
class VWAPMomentum(strategy.BacktestingStrategy):
MIN_TRA... |
hexforge/pulp_db | src/pulp_db/kds/kds_pyapi.py | import os
from cffi import FFI
ffi = FFI()
# This is just a placeholder for the c implementation.
# Some of it is thinking of the c and is not very pythony.
# We are thinkling alot about chunking the data.
# Stored separately to be more continuous. Meta gets queried.
# overall_meta
# meta1
# meta2
# meta3
# meta4
# me... |
pombredanne/anvil | anvil/actions/install.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... |
mlflow/mlflow | mlflow/projects/backend/loader.py | import entrypoints
import logging
from mlflow.projects.backend.local import LocalBackend
ENTRYPOINT_GROUP_NAME = "mlflow.project_backend"
__logger__ = logging.getLogger(__name__)
# Statically register backend defined in mlflow
MLFLOW_BACKENDS = {
"local": LocalBackend,
}
def load_backend(backend_name):
... |
OpenMDM/OpenMDM | OpenMDM/settings.py | """
Django settings for OpenMDM project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... |
MarouenMechtri/CNG-Manager | pyocni/backends/linkcng_backend.py | # Copyright 2013 Institut Mines-Telecom - Telecom SudParis
#
# 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... |
liyi193328/seq2seq | run_scripts/vocab.py | #encoding=utf-8
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "liyi"
__date__ = "2017-07-06"
import os
import sys
import argparse
import collections
import logging
import codecs
import charset
def generate_vocab(source_paths, save_path, d... |
radiasoft/optics | tests/utilities/uti_plot_matplotlib.py | """uti_plot backend for matplotlib
.. moduleauthor:: O. Chubar, N. Canestrari
"""
import os
import sys
import subprocess
import platform
from array import *
from math import *
import numpy as np
import tests.utilities.uti_plot_com as uti_plot_com
import tests.utilities.uti_math as uti_math
import tests.utilities.uti_p... |
thenenadx/forseti-security | google/cloud/security/common/gcp_api/iam.py | # Copyright 2017 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, s... |
googleads/google-ads-python | google/ads/googleads/v8/services/services/campaign_criterion_simulation_service/transports/base.py | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
dstufft/sessions | sessions/__init__.py | # Copyright 2014 Donald Stufft
#
# 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, so... |
egetzel/wecrow | truehand2014/temboo/Library/Twilio/AvailablePhoneNumbers/TollFreeList.py | # -*- coding: utf-8 -*-
###############################################################################
#
# TollFreeList
# Returns a list of toll-free available phone numbers that match the specified filters.
#
# Python version 2.6
#
###############################################################################
from... |
tensorflow/privacy | tensorflow_privacy/privacy/optimizers/dp_optimizer.py | # Copyright 2020, The TensorFlow Authors.
#
# 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 t... |
vinodpanicker/scancode-toolkit | etc/configure.py | #!/usr/bin/python
# Copyright (c) 2015 nexB Inc. http://www.nexb.com/ - All rights reserved.
"""
This script a configuration helper to select pip requirement files to install
and python and shell configuration scripts to execute based on provided config
directories paths arguments and the operating system platform. T... |
aljim/deploymentmanager-samples | community/cloud-foundation/templates/pubsub/pubsub.py | # Copyright 2018 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... |
ismail-s/warehouse | warehouse/celery.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
# distributed under the Li... |
abhishekkr/nix-bootstrapper | commands/command_plugins/password/__init__.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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... |
korrelate/genie | genie-web/src/test/python/utils/eureka.py | ##
#
# Copyright 2013 Netflix, 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 l... |
elastic/elasticsearch-py | test_elasticsearch/test_client/test_options.py | # -*- coding: utf-8 -*-
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "Licens... |
SirEdvin/Pandas-Pipe | pandaspipe/pipeline.py | # -*- coding:utf-8 -*-
import abc
import sys
import inspect
import types
import itertools
import networkx as nx
from pandaspipe.util import patch_list, isSubset
from pandaspipe.base import PipelineEntity
import logging
_log = logging.getLogger(__name__)
_log.addHandler(logging.StreamHandler(stream=sys.stdout))
class... |
galak/zephyr | scripts/gen_syscalls.py | #!/usr/bin/env python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
Script to generate system call invocation macros
This script parses the system call metadata JSON file emitted by
parse_syscalls.py to create several files:
- A file containing weak aliases of any potentially ... |
flockchat/pyflock | flockos/apis/roster.py | # coding: utf-8
# python 2 and python 3 compatibility library
from six import iteritems
from ..api_client import call_api
def list_contacts(token, **kwargs):
"""
This method makes a synchronous HTTP request.
:param str token: (required)
:return: response dict
"""
params = locals(... |
ros2/launch | launch/launch/conditions/launch_configuration_equals.py | # Copyright 2020 Open Source Robotics Foundation, 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... |
CCI-MOC/GUI-Backend | scripts/import_tags.py | #!/usr/bin/env python
import json
import logging
from optparse import OptionParser
from service_old.models import Instance
import django
django.setup()
def export_instance_tags():
instance_tags = []
instances = Instance.objects.all()
added = 0
for i in instances:
if i.instance_tags:
... |
Tehsmash/networking-cisco | networking_cisco/plugins/cisco/common/utils.py | # Copyright 2015 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 requir... |
kiddinn/plaso | tests/parsers/esedb_plugins/msie_webcache.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Microsoft Internet Explorer WebCache database."""
import unittest
from plaso.lib import definitions
from plaso.parsers.esedb_plugins import msie_webcache
from tests.parsers.esedb_plugins import test_lib
class MsieWebCacheESEDBPluginTest(test_lib.ESEDB... |
PaulWay/insights-core | insights/parsers/dumpe2fs_h.py | """
DumpE2FS - Command ``dumpe2fs -h``
==================================
This parser handles ``dumpe2fs`` output.
The object provides access to this data using a dictionary. Particular keys
are stored as lists:
* Filesystem features
* Filesystem flags
* Default mount options
Other keys are stored as strings. The... |
PetePriority/home-assistant | homeassistant/components/mqtt/cover.py | """
Support for MQTT cover devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.components import cover, mqtt
from homeassistant.components.cover import (
ATTR_POSITION, ... |
openstack/smaug | karbor/services/protection/client_factory.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... |
Early-Modern-OCR/emop-dashboard | ext/scripts/failure_results.py | #!/usr/bin/env python
import json
import os
import re
import ConfigParser
import logging
import requests
import sys
from urlparse import urljoin
config_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.ini')
Config = ConfigParser.ConfigParser()
Config.read(config_path)
api_version = Config.ge... |
google/TensorNetwork | tensornetwork/linalg/initialization.py | # Copyright 2019 The TensorNetwork Authors
#
# 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 ... |
fras2560/graph-helper | algorithms/color.py | """
-------------------------------------------------------
color
a module to determine the chromatic number of a graph
-------------------------------------------------------
Author: Dallas Fraser
ID: 110242560
Email: fras2560@mylaurier.ca
Version: 2014-09-17
---------------------------------------------------... |
SivagnanamCiena/nxapi-learning-labs | setup.py | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... |
ionelmc/python-darkslide | docs/conf.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sphinx_py3doc_enhanced_theme
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.e... |
wuan/bo-server | tests/test_influxdb.py | import datetime
import unittest
from assertpy import assert_that
from blitzortung_server.influxdb import DataPoint
class TestAS(unittest.TestCase):
def testEmptyDataPoint(self):
timestamp = datetime.datetime.utcnow()
data_point = DataPoint("meas", time=timestamp)
json_repr = data_point.... |
SmartElect/SmartElect | rollgen/generate_pdf.py | # 3rd party imports
from reportlab.platypus import Image, Paragraph, PageBreak, Table, Spacer
from reportlab.lib.units import cm
from reportlab.lib.pagesizes import A4
# Django imports
from django.conf import settings
# Project imports
from .arabic_reshaper import reshape
from .pdf_canvas import NumberedCanvas, getAr... |
RobinQuetin/CAIRIS-web | cairis/cairis/WeaknessTreatmentDialog.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... |
xroot88/rax_ansible | library/rax_security_group.py | """Dummy module to create rax security groups"""
#!/usr/bin/env python
import pyrax
from ansible.module_utils.basic import *
uri_sgs = 'https://dfw.networks.api.rackspacecloud.com/v2.0/security-groups'
def get_sg(cnw, name):
try:
result, sgs = cnw.identity.method_get(uri_sgs)
if result.status_co... |
salamer/jolla | jolla/session.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class buffer(object):
def __init__(self):
self._data = {}
class SessionError(Exception):
def __str__(self):
return "<NO SUCH SESSION>"
class session(buffer):
def __str__(self):
return "Jolla.jolla_sessionObject"
def __repr__... |
Ernsting/django-treebeard | treebeard/tests/tests.py | "Unit/Functional tests"
import os
from django.contrib.admin.options import ModelAdmin
from django.contrib.admin.sites import AdminSite
from django.test import TestCase
from django.db import models, transaction
from django.contrib.auth.models import User
from django.db.models import Q
from django.conf import settings
f... |
MrIliev/AIPY-Music-Player | AIPY.py | import sys
from PyQt4 import Qt
from PyQt4.phonon import Phonon
class AIPYbody():
# in the class body are all functionalities of the AIPY Music Player
# body will be one window from PyQT
def __init__ (self):
pass
def Display():
# used for showing the remaining time, or elapsed time of song, it is posible to ... |
54lihaoxin/leetcode_python | src/BestTimeToBuyAndSellStock/solution.py | # Best Time to Buy and Sell Stock
#
# Say you have an array for which the ith element is the price of a given stock on day i.
#
# If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
debug = True
debug =... |
jackrzhang/zulip | zerver/templatetags/app_filters.py | import os
from html import unescape
from typing import Any, Dict, List, Optional
import markdown
import markdown.extensions.admonition
import markdown.extensions.codehilite
import markdown.extensions.extra
import markdown.extensions.toc
import markdown_include.include
from django.conf import settings
from django.templ... |
saeki-masaki/cinder | cinder/volume/drivers/dell/dell_storagecenter_iscsi.py | # Copyright 2015 Dell 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 agree... |
google/strabo | client/python/setup.py | #
# Copyright 2015 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 writi... |
cloud-ark/cloudark | server/gcloud_handler.py | import ast
from os.path import expanduser
from stevedore import extension
from common import common_functions
from common import fm_logger
from dbmodule.objects import app as app_db
from dbmodule.objects import environment as env_db
from server.server_plugins.gcloud import gcloud_helper
home_dir = expanduser("~")
A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.