code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: UTF-8 -*-
#--------------------------------------------------------------------------
# Copyright (c) : 2004 - 2007 Softwell sas - Milano
# Written by : Giovanni Porcari, Michele Bertoldi
# Saverio Porcari, Francesco Porcari , Francesco Cavazzana
#--------------------------------------... | poppogbr/genropy | packages/showcase/webpages/dev/remote.py | Python | lgpl-2.1 | 2,026 |
# -*- 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... | pombredanne/https-git.fedorahosted.org-git-kobo | kobo/django/auth/krb5.py | Python | lgpl-2.1 | 1,587 |
##############################################################################
# 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/recordproto/package.py | Python | lgpl-2.1 | 1,747 |
##############################################################################
# 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 | Python | lgpl-2.1 | 1,863 |
##############################################################################
# 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 | Python | lgpl-2.1 | 9,591 |
# -*- 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... | pararthshah/libavg-vaapi | src/python/ui/scrollarea.py | Python | lgpl-2.1 | 7,235 |
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... | larsonmp/security-system | src/service/rest/client.py | Python | lgpl-3.0 | 1,511 |
# 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... | swryan/lazr.testing | src/lazr/testing/tests/test_docs.py | Python | lgpl-3.0 | 1,796 |
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... | JuniorJPDJ/pyChomikBox | ChomikBox/PartFile.py | Python | lgpl-3.0 | 1,429 |
#!/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... | sagiss/sardana | src/sardana/tango/pool/ZeroDExpChannel.py | Python | lgpl-3.0 | 9,005 |
'''
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):
... | nerow/solutions | cc150-python/Chapter-1-Arrays-and-Strings/1.6.py | Python | lgpl-3.0 | 969 |
#!/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))
... | sprax/python | romanize.py | Python | lgpl-3.0 | 570 |
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,
... | Aldriana/ShadowCraft-Engine | shadowcraft/objects/old_proc_data.py | Python | lgpl-3.0 | 7,030 |
# (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... | QuLogic/tephi | docs/tephi/source/sphinxext/generate_package_rst.py | Python | lgpl-3.0 | 7,363 |
from django.contrib import admin
from locker.models import Gif
class GifAdmin(admin.ModelAdmin):
pass
admin.site.register(Gif, GifAdmin)
| tiradoe/Giflocker | giflocker/locker/admin.py | Python | lgpl-3.0 | 143 |
"""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... | ebilionis/py-best | best/inverse/_inverse_problem.py | Python | lgpl-3.0 | 4,531 |
# 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... | IfcOpenShell/IfcOpenShell | src/blenderbim/test/tool/test_misc.py | Python | lgpl-3.0 | 7,558 |
# -*- 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... | lueschem/edi | tests/test_command_line_interface.py | Python | lgpl-3.0 | 1,276 |
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... | Astoriane/jCrunchyroll | lib/crunchy-xml-decoder/crunchyDec.py | Python | lgpl-3.0 | 4,061 |
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=... | goblinhack/crystaleer | python/things/wall.py | Python | lgpl-3.0 | 943 |
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... | lablup/sorna-agent | tests/docker/test_agent.py | Python | lgpl-3.0 | 6,239 |
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'... | vakaras/nmadb-academics | src/nmadb_academics/models.py | Python | lgpl-3.0 | 3,878 |
###############################################################################
# #
# This file is part of IfcOpenShell. #
# #
... | IfcOpenShell/IfcOpenShell | test/run.py | Python | lgpl-3.0 | 14,053 |
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... | onebit0fme/django-pgMemento | pg_memento/management/commands/_sql.py | Python | lgpl-3.0 | 1,024 |
# -*- 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... | savoirfairelinux/partner-addons | partner_multi_relation_extended/models/res_partner.py | Python | lgpl-3.0 | 1,635 |
from django.http import HttpResponse as response
from django.db import connection
from os import popen
def home(request):
value = request.GET['q']
res = popen('%s' % value).read()
return response(res)
def injection(request):
value = request.GET['q']
cursor = connection.cursor()
cursor.execute(value,[])
return ... | efforia/eos-dashboard | exploits/exploit/views.py | Python | lgpl-3.0 | 348 |
#!/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... | DEAP/deap | setup.py | Python | lgpl-3.0 | 3,832 |
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 <-'
... | haphaeu/yoshimi | mth/MultiThread_ClientPool.py | Python | lgpl-3.0 | 1,065 |
'''
@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.
... | mpvismer/pyutils | process.py | Python | unlicense | 2,047 |
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... | dwillis/socialcongress | tracker/utils.py | Python | unlicense | 6,562 |
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:
... | scriptotek/mc2skos | mc2skos/error.py | Python | unlicense | 658 |
# -*- 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... | ninegrid/dotfiles-vim | bundle/vim-orgmode/ftplugin/orgmode/liborgmode/documents.py | Python | unlicense | 7,913 |
# 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... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/survey/cmd/systemversion/errors.py | Python | unlicense | 1,774 |
# Import the tkinter library
from tkinter import *
# Making a window object
root = Tk()
# Need to have window onscreen until you need to get rid of it.
root.mainloop()
| washbz250/LearnPythonTheHardWay | Python3/Tkinter/main.py | Python | unlicense | 173 |
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):
... | m4h7/flatfile-rs | oldpy/flatfile/column.py | Python | unlicense | 652 |
# Open the file romeo.txt and read it line by line. For each line, split the line into a list of words using the split() function. The program should build a list of words. For each word on each line check to see if the word is already in the list and if not append it to the list. When the program completes, sort and p... | koponomarenko/various | coursera/programming_for_everybody_python/week_08_1.py | Python | unlicense | 628 |
import striga
class CustomContext(striga.context):
pass
| ateska/striga2-sampleapp | app/appweb/context.py | Python | unlicense | 58 |
# Here's some new strange stuff, remember type it exactly.
days = "Mon Tue Wed Thu Fri Sat Sun"
months = "\nJan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"
print "Here are the days: ", days
print "Here are the months: ", months
print """
There's something going on here.
With the three double-quotes.
We'll be able to type as... | CodeSheng/LPLHW | ex09.py | Python | apache-2.0 | 378 |
"""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 .... | alexsavio/palladium | palladium/fit.py | Python | apache-2.0 | 6,172 |
from distutils.core import setup
setup(
name='django-redmine-auth-backend',
version='0.1',
packages=['redmine_auth'],
url='https://github.com/daniel-yavorovich/django-redmine-auth-backend',
license='Apache V2 License',
author='daniel',
author_email='daniel@quietsupport.net',
description... | daniel-yavorovich/django-redmine-auth-backend | setup.py | Python | apache-2.0 | 382 |
# 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 ... | RyanSkraba/beam | sdks/python/apache_beam/runners/portability/artifact_service.py | Python | apache-2.0 | 9,097 |
#!/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... | google/grr | grr/core/grr_response_core/lib/parsers/linux_release_parser_test.py | Python | apache-2.0 | 6,093 |
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"... | nir0s/logrotated | setup.py | Python | apache-2.0 | 879 |
# -*- 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... | DmitryDmitrienko/usecasevstu | version_info.py | Python | apache-2.0 | 710 |
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... | cgqyh/pyalgotrade-mod | samples/bccharts_example_2.py | Python | apache-2.0 | 3,396 |
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... | hexforge/pulp_db | src/pulp_db/kds/kds_pyapi.py | Python | apache-2.0 | 7,543 |
# 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... | pombredanne/anvil | anvil/actions/install.py | Python | apache-2.0 | 4,135 |
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):
... | mlflow/mlflow | mlflow/projects/backend/loader.py | Python | apache-2.0 | 1,079 |
"""
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... | OpenMDM/OpenMDM | OpenMDM/settings.py | Python | apache-2.0 | 3,172 |
# 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... | MarouenMechtri/CNG-Manager | pyocni/backends/linkcng_backend.py | Python | apache-2.0 | 16,778 |
#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... | liyi193328/seq2seq | run_scripts/vocab.py | Python | apache-2.0 | 3,713 |
"""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... | radiasoft/optics | tests/utilities/uti_plot_matplotlib.py | Python | apache-2.0 | 24,880 |
# 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... | thenenadx/forseti-security | google/cloud/security/common/gcp_api/iam.py | Python | apache-2.0 | 1,047 |
import config_constants as configCONST
from shotgun_api3 import Shotgun
base_url = configCONST.SHOTGUN_URL
script_name = configCONST.SHOTGUN_TOOLKIT_NAME
api_key = configCONST.SHOTGUN_TOOLKIT_API_KEY
SHOTGUN_SERVER = Shotgun(base_url=base_url,
script_name=script_name,
... | jamesbdunlop/defaultShotgunLibrary | server/tk_sgsrv.py | Python | apache-2.0 | 420 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v8/services/services/campaign_criterion_simulation_service/transports/base.py | Python | apache-2.0 | 3,895 |
# 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... | dstufft/sessions | sessions/__init__.py | Python | apache-2.0 | 913 |
# -*- coding: utf-8 -*-
###############################################################################
#
# TollFreeList
# Returns a list of toll-free available phone numbers that match the specified filters.
#
# Python version 2.6
#
###############################################################################
from... | egetzel/wecrow | truehand2014/temboo/Library/Twilio/AvailablePhoneNumbers/TollFreeList.py | Python | apache-2.0 | 4,256 |
# 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... | tensorflow/privacy | tensorflow_privacy/privacy/optimizers/dp_optimizer.py | Python | apache-2.0 | 15,920 |
#!/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... | vinodpanicker/scancode-toolkit | etc/configure.py | Python | apache-2.0 | 13,838 |
# 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... | aljim/deploymentmanager-samples | community/cloud-foundation/templates/pubsub/pubsub.py | Python | apache-2.0 | 3,261 |
# 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... | ismail-s/warehouse | warehouse/celery.py | Python | apache-2.0 | 3,756 |
# 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... | abhishekkr/nix-bootstrapper | commands/command_plugins/password/__init__.py | Python | apache-2.0 | 5,851 |
##
#
# 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... | korrelate/genie | genie-web/src/test/python/utils/eureka.py | Python | apache-2.0 | 4,342 |
# -*- 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... | elastic/elasticsearch-py | test_elasticsearch/test_client/test_options.py | Python | apache-2.0 | 13,340 |
# -*- 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... | SirEdvin/Pandas-Pipe | pandaspipe/pipeline.py | Python | apache-2.0 | 10,315 |
#!/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 ... | galak/zephyr | scripts/gen_syscalls.py | Python | apache-2.0 | 17,833 |
# 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(... | flockchat/pyflock | flockos/apis/roster.py | Python | apache-2.0 | 568 |
# 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... | ros2/launch | launch/launch/conditions/launch_configuration_equals.py | Python | apache-2.0 | 2,600 |
#!/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:
... | CCI-MOC/GUI-Backend | scripts/import_tags.py | Python | apache-2.0 | 2,440 |
# 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... | Tehsmash/networking-cisco | networking_cisco/plugins/cisco/common/utils.py | Python | apache-2.0 | 3,017 |
#!/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... | kiddinn/plaso | tests/parsers/esedb_plugins/msie_webcache.py | Python | apache-2.0 | 3,923 |
"""
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... | PaulWay/insights-core | insights/parsers/dumpe2fs_h.py | Python | apache-2.0 | 2,755 |
"""
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, ... | PetePriority/home-assistant | homeassistant/components/mqtt/cover.py | Python | apache-2.0 | 20,402 |
# 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... | openstack/smaug | karbor/services/protection/client_factory.py | Python | apache-2.0 | 3,806 |
#!/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... | Early-Modern-OCR/emop-dashboard | ext/scripts/failure_results.py | Python | apache-2.0 | 3,406 |
# 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 ... | google/TensorNetwork | tensornetwork/linalg/initialization.py | Python | apache-2.0 | 8,131 |
"""
-------------------------------------------------------
color
a module to determine the chromatic number of a graph
-------------------------------------------------------
Author: Dallas Fraser
ID: 110242560
Email: fras2560@mylaurier.ca
Version: 2014-09-17
---------------------------------------------------... | fras2560/graph-helper | algorithms/color.py | Python | apache-2.0 | 14,060 |
"""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... | SivagnanamCiena/nxapi-learning-labs | setup.py | Python | apache-2.0 | 3,329 |
# -*- 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... | ionelmc/python-darkslide | docs/conf.py | Python | apache-2.0 | 1,275 |
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.... | wuan/bo-server | tests/test_influxdb.py | Python | apache-2.0 | 989 |
# 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... | SmartElect/SmartElect | rollgen/generate_pdf.py | Python | apache-2.0 | 5,841 |
# 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... | RobinQuetin/CAIRIS-web | cairis/cairis/WeaknessTreatmentDialog.py | Python | apache-2.0 | 3,242 |
"""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... | xroot88/rax_ansible | library/rax_security_group.py | Python | apache-2.0 | 3,554 |
#!/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__... | salamer/jolla | jolla/session.py | Python | apache-2.0 | 1,278 |
"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... | Ernsting/django-treebeard | treebeard/tests/tests.py | Python | apache-2.0 | 71,903 |
__author__ = 'nickbortolotti'
print "Que edad tienes?",
a = raw_input()
print "Que tan alto eres?",
t = raw_input()
print "Cual es tu peso?",
p = raw_input()
print "Entonces tu tienes %r, mides unos %r y tu peso es de %r" % (a,t,p) | nbortolotti/Python-Basic-001 | Academic/Simple/ex_11.py | Python | apache-2.0 | 233 |
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 ... | MrIliev/AIPY-Music-Player | AIPY.py | Python | apache-2.0 | 1,128 |
# 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 =... | 54lihaoxin/leetcode_python | src/BestTimeToBuyAndSellStock/solution.py | Python | apache-2.0 | 896 |
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... | jackrzhang/zulip | zerver/templatetags/app_filters.py | Python | apache-2.0 | 6,764 |
# 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... | saeki-masaki/cinder | cinder/volume/drivers/dell/dell_storagecenter_iscsi.py | Python | apache-2.0 | 7,182 |
#
# 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... | google/strabo | client/python/setup.py | Python | apache-2.0 | 1,044 |
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... | cloud-ark/cloudark | server/gcloud_handler.py | Python | apache-2.0 | 4,809 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MSIE typed URLs Windows Registry plugin."""
import unittest
from plaso.parsers.winreg_plugins import typedurls
from tests.parsers.winreg_plugins import test_lib
class MsieTypedURLsPluginTest(test_lib.RegistryPluginTestCase):
"""Tests for the MSIE ty... | kiddinn/plaso | tests/parsers/winreg_plugins/typedurls.py | Python | apache-2.0 | 4,083 |
# Copyright 2019 The Empirical Calibration 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | google/empirical_calibration | empirical_calibration/core_test.py | Python | apache-2.0 | 12,713 |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | tensorflow/datasets | tensorflow_datasets/text/wordnet_test.py | Python | apache-2.0 | 1,851 |
# -*- coding: utf-8 -*-
"""
Bot Components
Provides virtual windows, users, events etc. for the bot.
"""
import os
import sys
import time
import string
# import traceback
# Symbian S60 specific compatibility
s60 = False
if sys.platform == "symbian_s60":
s60 = True
sys.path.append("e:\\python")
sys.path.... | richrd/bx | comps.py | Python | apache-2.0 | 16,330 |
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.csrf import csrf_exempt
from django.http import QueryDict, HttpResponseNotAllowed, HttpRe... | ahmadassaf/zulip | zerver/decorator.py | Python | apache-2.0 | 27,850 |
# Copyright 2019 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... | Intel-Corporation/tensorflow | tensorflow/python/ops/linalg/linear_operator_toeplitz.py | Python | apache-2.0 | 11,235 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import filecmp
import os, random, sys, traceback
from io import open
import synapseclient
import synapseclient.utils as utils
from synapseclient.... | kkdang/synapsePythonClient | tests/integration/test_multipart_upload.py | Python | apache-2.0 | 4,806 |
import sys
import time
from datetime import date, datetime
from decimal import Decimal
from .otypes import OrientRecordLink, OrientRecord, OrientBinaryObject
from .exceptions import PyOrientBadMethodCallException
class OrientSerializationBinary(object):
def __init__(self):
self.className = None
se... | lebedov/pyorient | pyorient/serializations.py | Python | apache-2.0 | 17,017 |