code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | ravibhure/ansible | test/units/modules/network/f5/test_bigip_config.py | Python | gpl-3.0 | 3,507 |
"""This module contains the general information for BiosVfPOSTErrorPause ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfPOSTErrorPauseConsts:
VP_POSTERROR_PAUSE_DISABLED = "Disabled"
VP_POSTERROR_PAUSE_ENAB... | ragupta-git/ImcSdk | imcsdk/mometa/bios/BiosVfPOSTErrorPause.py | Python | apache-2.0 | 3,763 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ... | goldcoin/goldcoin | qa/rpc-tests/zapwallettxes.py | Python | mit | 2,879 |
"""Calendar backend definition."""
from importlib import import_module
from modoboa.lib.cryptutils import decrypt
class CalendarBackend(object):
"""Base backend class."""
def __init__(self, calendar=None):
"""Default constructor."""
self.calendar = calendar
def create_event(self, event... | modoboa/modoboa-radicale | modoboa_radicale/backends/__init__.py | Python | mit | 1,224 |
>>> s = 'How might I make alternating caps in python?'
>>> ''.join([l.upper() if i % 2 != 0 else l for i, l in enumerate(s)])
'HOw mIgHt I mAkE AlTeRnAtInG CaPs iN PyThOn?'
| bandarji/lekhan | python/reddit/altcaps.py | Python | apache-2.0 | 173 |
# -*- coding: utf-8 -*-
from south.v2 import DataMigration
class Migration(DataMigration):
depends_on = (
('avocado', '0036_initialize_indexable'),
)
def forwards(self, orm):
"Perform a 'safe' load using Avocado's backup utilities."
from avocado.core import backup
backup.sa... | chop-dbhi/varify | varify/migrations/0002_avocado_metadata_migration.py | Python | bsd-2-clause | 490 |
import logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils import timezone
from djblets.siteconfig.models import SiteC... | atagar/ReviewBoard | reviewboard/notifications/email.py | Python | mit | 13,727 |
# -*- coding: utf-8 -*-
"""
Unit tests for instructor.api methods.
"""
import datetime
import ddt
import functools
import random
import pytz
import io
import json
import shutil
import tempfile
from urllib import quote
from django.conf import settings
from django.contrib.auth.models import User
from django.core import ... | IndonesiaX/edx-platform | lms/djangoapps/instructor/tests/test_api.py | Python | agpl-3.0 | 212,156 |
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
def test_phones_... | volkodav1985/volkodavpython | test 1/test_phones.py | Python | apache-2.0 | 1,116 |
'''
HashDb2
Usage:
hashdb2 -h | --help
hashdb2 --version
hashdb2 hash [-f|-q|-n] DATABASE -- INPUTS...
hashdb2 comp [-f|-q|-n] [-steb0cid] [--separator SEP] ((--lhs-db LHSDB [(--lhs-path LHSPATH [--lhs-update])]) | --lhs-path LHSPATH) [(--rhs-db RHSDB ([--rhs-path RHSPATH [--rhs-update]])) | --rhs-path... | WHenderson/HashDb | hashdb2/command_line.py | Python | apache-2.0 | 4,335 |
from pyparsing import *
class VmiPlGrammar ():
ParserElement.setDefaultWhitespaceChars(" ")
@staticmethod
def parse(input_string):
tab = Suppress('\t')
newline = Suppress('\n')
ob = Suppress('(')
cb = Suppress(')')
ocb = Suppress('{')
ccb = Suppress('}')
comma = Suppress(',')
colon = Suppress(':')... | FlorianWestphal/VMI-PL | front_end/vmipl/vmipl_grammar.py | Python | mit | 3,942 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class IrConfigParameter(models.Model):
_inherit = 'ir.config_parameter'
def init(self, force=False):
super(IrConfigParameter, self).init(force=force)
if force:
... | richard-willowit/odoo | addons/auth_oauth/models/ir_config_parameter.py | Python | gpl-3.0 | 540 |
import numpy as np
import pandas as pd
# from matplotlib.pyplot import plot,show,draw
import scipy.io
import sys
sys.path.append("../")
from functions import *
from pylab import *
from sklearn.decomposition import PCA
import _pickle as cPickle
import matplotlib.cm as cm
import os
#####################################... | gviejo/ThalamusPhysio | python/figure_article/main_article_fig_6.py | Python | gpl-3.0 | 14,479 |
import pandas as pd
import networkx as nx
import sys
import os
class GraphCombiner(object):
"""docstring for GraphCombiner"""
def __init__(self, handle):
super(GraphCombiner, self).__init__()
self.handle = handle
self.G = nx.read_gpickle('{0} Initialized Graph.pkl'.format(handle))
... | ericmjl/influenza-reassortment-detector | graph_combiner.py | Python | mit | 1,214 |
# -*- coding: utf-8 -*-
import subprocess
import sys
from distutils.cmd import Command
from setuptools import setup
try:
from babel import __version__
except SyntaxError as exc:
sys.stderr.write("Unable to import Babel (%s). Are you running a supported version of Python?\n" % exc)
sys.exit(1)
class imp... | mitsuhiko/babel | setup.py | Python | bsd-3-clause | 3,111 |
#!/usr/bin/env python
# coding=utf-8
"""
Sub-string divisibility
Problem 43
The number, 1406357289, is a 0 to 9 pandigital number because it is made up of
each of the digits 0 to 9 in some order, but it also has a rather interesting
sub-string divisibility property.
Let d1 be the 1st digit, d2 be the 2nd digit, and s... | openqt/algorithms | projecteuler/ac/old/pe043_sub_string_divisibility.py | Python | gpl-3.0 | 1,213 |
# coding: utf-8
# In[1]:
import csv
from scipy.misc import imread, imsave
import cv2
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout, Lambda
from keras.layers.convolutional import Convolution2D
from keras.layers.pooling import MaxPooling2D
impo... | DrClick/ARCRacing | ros_system_ws/src/vector79/scripts/transfer_learn.py | Python | mit | 3,149 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
im... | djkonro/client-python | kubernetes/client/apis/authentication_v1_api.py | Python | apache-2.0 | 9,608 |
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import decimal
import re
from decimal import Decimal
from typing import Any, Optional, Tuple, Union
from mbstrdecoder import MultiByteStrDecoder
from typepy import Integer, RealNumber, TypeConversionError
decimal.setcontext(decimal.Context(prec... | thombashi/DataProperty | dataproperty/_function.py | Python | mit | 3,554 |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from hashlib import md5
import logging
import os
import platform
import re
import signal
import socket
import sys
import time
import types
import urllib2
import uuid
# 3p
import simplejson as json
import... | c960657/dd-agent | util.py | Python | bsd-3-clause | 19,873 |
def fibonacci(num):
previous, current, n = 0, 1, num - 1
yield previous
yield current
while n:
previous, current, n = current, previous + current, n - 1
yield current
| PavlovVitaly/python__homework_ITMO | task_07_01.py | Python | gpl-3.0 | 200 |
"""
Utility functions for transcripts.
++++++++++++++++++++++++++++++++++
"""
import copy
import logging
import os
from functools import wraps
import requests
import simplejson as json
import six
from django.conf import settings
from lxml import etree
from opaque_keys.edx.locator import BundleDefinitionLocator
from ... | appsembler/edx-platform | common/lib/xmodule/xmodule/video_module/transcripts_utils.py | Python | agpl-3.0 | 40,929 |
# Generated by Django 1.11.12 on 2018-05-25 12:19
from django.db import migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [("blog", "0012_auto_20180425_1523")]
operations = [
migrations.AlterField(
model_name="post",
name="genre",
... | manti-by/M2-Blog-Engine | manti_by/apps/blog/migrations/0013_auto_20180525_1219.py | Python | bsd-3-clause | 600 |
# Test for one implementation of the interface
from lexicon.providers.nsone import Provider
from integration_tests import IntegrationTests
from unittest import TestCase
import pytest
# Hook into testing framework by inheriting unittest.TestCase and reuse
# the tests which *each and every* implementation of the interfa... | tnwhitwell/lexicon | tests/providers/test_nsone.py | Python | mit | 972 |
"""
SoftLayer.tests.CLI.modules.vs_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import mock
from SoftLayer import testing
import json
class VirtTests(testing.TestCase):
def test_list_vs(self):
result = self.run_command(['vs', 'list', '--tag=ta... | briancline/softlayer-python | SoftLayer/tests/CLI/modules/vs_tests.py | Python | mit | 5,479 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | ryfeus/lambda-packs | Selenium_Chromium/source/selenium/webdriver/remote/remote_connection.py | Python | mit | 24,770 |
# Copyright 2013: Mirantis 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 b... | amit0701/rally | tests/unit/test_osclients.py | Python | apache-2.0 | 34,441 |
import signal, sys, ssl
from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer, SimpleSSLWebSocketServer
from optparse import OptionParser
from thread import start_new_thread
import time
import websocket
import json
import codecs
import os
clients = []
class MessageBroker(WebSocket):
def __init__(s... | huvermann/MyPiHomeAutomation | HomeAutomation/MessageBroker.py | Python | mit | 7,901 |
import logging
import numpy as np
import zmq
import osgeo.osr
import shapely.geometry
from . import send_array, recv_array
logging.basicConfig()
logger = logging.getLogger(__name__)
class Views(object):
# TODO: rewrite using config file per engine
@staticmethod
def grid(context):
meta = context... | openearth/mmi-python | mmi/tracker_views.py | Python | gpl-3.0 | 1,352 |
"""Everything that has to do with authentication."""
from flask import abort, g, request, session
from flask.ext.login import UserMixin, current_user
from flask.ext.restful import abort as abort_rest
from functools import wraps
from itsdangerous import (
TimedJSONWebSignatureSerializer as Serializer, SignatureExpi... | ecclesianuernberg/genesis | app/auth.py | Python | mit | 9,309 |
# -*- coding: utf-8 -*-
# Ensure backwards compatibility with Python 2
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals)
from builtins import *
def {{cookiecutter.cli_entry_point_function_name }}():
""" Command-line entry point for {{ cookiecutter.repo_name }} ... | DC23/cookiecutter-dcpypackage | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}.py | Python | mit | 662 |
# 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... | jhseu/tensorflow | tensorflow/python/compiler/tensorrt/trt_convert_windows.py | Python | apache-2.0 | 5,368 |
"""
$Id: __init__.py,v 1.2 2005/02/26 17:56:10 sidnei Exp $
"""
from zope.interface import Interface
class IAddProject(Interface):
"""Marker interface that indicates OpenProjects can be added.
"""
class IAddSubProject(IAddProject):
"""I add sub-projects"""
class IAmAPeopleFolder(Interface):
"""Marker... | socialplanning/opencore | opencore/interfaces/adding.py | Python | gpl-3.0 | 497 |
"""Config flow to configure the LCN integration."""
import logging
import pypck
from homeassistant import config_entries
from homeassistant.const import (
CONF_HOST,
CONF_IP_ADDRESS,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
)
from .const import CONF_DIM_MODE, CONF_SK_NUM_TRIES, DOMAIN
_LOGGER = ... | kennedyshead/home-assistant | homeassistant/components/lcn/config_flow.py | Python | apache-2.0 | 3,022 |
#!/usr/bin/python3
import argparse
OUTPUT_FILENAME = 'SerializationMacros.hpp'
### Boilerplate Code Templates ###
pragma_once = '#pragma once\n'
include_header = '#include {path}\n'
serialize_begin = '#define DEFAULT_SERIALIZE{count}({args_list}) std::size_t to_bytes(char* ret) const {{ \\\n'
to_bytes_first_lin... | mpmilano/mutils-serialization | generate_macros.py | Python | lgpl-3.0 | 7,501 |
import os
import sys
import codecs
from django.core.management import call_command
from django.core.management.base import CommandError
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.logger.models.xform import XForm
from onadata.libs.utils.logger_tools import report_exception
class TestPub... | eHealthAfrica/onadata | onadata/apps/logger/tests/test_publish_xls.py | Python | bsd-2-clause | 3,788 |
#!/usr/bin/python
# pieces.py
# fishlamp-install
#
# Created by Mike Fullerton on 8/3/13.
#
# begin boilerplate
import sys
import os
scriptName = os.path.basename(sys.argv[0])
scriptPath = os.path.dirname(sys.argv[0])
sharedPath = os.path.join(scriptPath, "../../shared/")
sys.path.append(os.path.abspath(sharedPath... | mikefullerton/Piecemeal-Scripts | Scripts/pieces/commands/pieces.py | Python | mit | 1,105 |
#
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
from ..defs import (task_name_sep, task_state_to_int, task_int_to_state)
from ...util import option_list
from ...io import find... | desihub/desispec | py/desispec/pipeline/tasks/starfit.py | Python | bsd-3-clause | 6,596 |
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import sys
import logging
import unittest
impor... | catapult-project/catapult | dashboard/dashboard/common/clustering_change_detector_test.py | Python | bsd-3-clause | 6,038 |
import django_rq
def clear_failed():
queue = django_rq.get_failed_queue()
return queue.empty()
def clear_all():
queue = django_rq.get_queue()
return queue.empty()
| tndatacommons/tndata_backend | tndata_backend/utils/queue.py | Python | mit | 183 |
# tests
from __future__ import absolute_import
from django.test import TestCase
# Import the plugin you wish to test
from .bot_plugin import TwitterPlugin
# Subclass your test class from LogosTestCase
from bot.testing.utils import LogosTestCase
class TestTwitter(LogosTestCase):
# set plugin_class to the actual ... | kiwiheretic/logos-v2 | twitterapp/tests.py | Python | apache-2.0 | 1,274 |
#
# Copyright (C) 2013-2015 RoboIME
#
# 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 distrib... | roboime/pyroboime | roboime/core/skills/followandcover.py | Python | agpl-3.0 | 1,829 |
from importlib import import_module
import numpy as np
import pandas as pd
from pandas.util import testing as tm
for imp in ['pandas.util', 'pandas.tools.hashing']:
try:
hashing = import_module(imp)
break
except (ImportError, TypeError, ValueError):
pass
class Factorize:
params... | cbertinato/pandas | asv_bench/benchmarks/algorithms.py | Python | bsd-3-clause | 4,333 |
#!/usr/bin/env python
"""Tests for the SimpleAPIAuthManager."""
from absl import app
from grr_response_core.lib.rdfvalues import structs as rdf_structs
from grr_response_core.lib.util import compatibility
from grr_response_proto import tests_pb2
from grr_response_server.authorization import groups
from grr_response_s... | google/grr | grr/server/grr_response_server/gui/api_auth_manager_test.py | Python | apache-2.0 | 10,454 |
# (c) The James Hutton Institute 2013
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@hutton.ac.uk
#
# Leighton Pritchard,
# Information and Computing Sciences,
# James Hutton Institute,
# Errol Road,
# Invergowrie,
# Dundee,
# DD6 9LH,
# Scotland,
# UK
#
# This program is free software: you can redistri... | bluegenes/MakeMyTranscriptome | scripts/util/KGML_pathway.py | Python | bsd-3-clause | 28,215 |
# pylint: disable-msg=E1101,W0612
import operator
from datetime import datetime
import nose
from numpy import nan
import numpy as np
import pandas as pd
dec = np.testing.dec
from pandas.util.testing import (assert_almost_equal, assert_series_equal,
assert_frame_equal, assert_panel_e... | dssg/wikienergy | disaggregator/build/pandas/pandas/sparse/tests/test_sparse.py | Python | mit | 60,675 |
# Copyright (C) 2011 Jason Anderson
#
#
# This file is part of PseudoTV.
#
# PseudoTV 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.... | yolanother/script.pseudotv.live | resources/lib/parsers/FLVParser.py | Python | gpl-3.0 | 4,336 |
"""distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: bdist_dumb.py,v 1.25 2004/11/10 22:23:14 loewis Ex... | trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9-SunOS-i386/lib/python/lib/python2.4/distutils/command/bdist_dumb.py | Python | gpl-2.0 | 4,572 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nicolas Badoux <n.badoux@hotmail.com>
#
# The licence is in the file __manifest__... | ecino/compassion-switzerland | muskathlon/migrations/10.0.2.0.0/pre-migration.py | Python | agpl-3.0 | 623 |
#From https://gist.github.com/EndingCredits/b5f35e84df10d46cfa716178d9c862a3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import hyperchamber as hc
import numpy as np
import inspect
from operator import itemgetter
from hypergan.train_hooks.base_train_hook... | 255BITS/HyperGAN | hypergan/train_hooks/experimental/rolling_memory_train_hook.py | Python | mit | 7,133 |
# PyVision License
#
# Copyright (c) 2006-2009 David S. Bolme
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | mikeseven/pyvision | src/pyvision/types/img.py | Python | bsd-3-clause | 46,803 |
from django.contrib.auth.models import User, check_password
class EmailAuthBackend(object):
"""Email Authentication Backend
Allows users to sign in using email/password pair.
"""
supports_anonymous_user = False
supports_object_permissions = False
def authenticate(self, username=None, passwo... | jacobjbollinger/sorbet | sorbet/core/backends.py | Python | bsd-2-clause | 680 |
# 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 unde... | openstack/senlin | senlin/tests/unit/profiles/test_heat_stack.py | Python | apache-2.0 | 38,522 |
from django import forms
from astrobin_apps_json_api.models import CkEditorFile
class CkEditorUploadForm(forms.ModelForm):
class Meta:
model = CkEditorFile
fields = ('upload',)
| astrobin/astrobin | astrobin_apps_json_api/common/forms/CkEditorUploadForm.py | Python | agpl-3.0 | 200 |
"""Define tests for device-related endpoints."""
from datetime import timedelta
from homeassistant.components.flo.const import DOMAIN as FLO_DOMAIN
from homeassistant.components.flo.device import FloDeviceDataUpdateCoordinator
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.setup import... | sdague/home-assistant | tests/components/flo/test_device.py | Python | apache-2.0 | 2,344 |
# -*- coding: utf-8 -*-
# EDIS - a simple cross-platform IDE for C
#
# This file is part of Edis
# Copyright 2014-2015 - Gabriel Acosta <acostadariogabriel at gmail>
# License: GPLv3 (see http://www.gnu.org/licenses/gpl.html)
import os
from PyQt4.QtCore import (
QObject,
QFile,
QIODevice,
QTextStream,... | centaurialpha/edis | src/core/object_file.py | Python | gpl-3.0 | 3,249 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | kuno/ansible | lib/ansible/constants.py | Python | gpl-3.0 | 6,435 |
#!/usr/bin/env python
# Python modules
import sys
import time
import md5
import os
# 3rd party modules
import shm
# Modules for this project
import DemoConstants
def WriteToMemory(MemoryHandle, s):
MemoryHandle.attach()
say("writing %s " % s)
MemoryHandle.write(s + (MemoryHandle.size - len(s)) * ' ')
... | mharradon/SHMArrays | shm-1.2.2/demo/ConclusionUsingShm.py | Python | mit | 1,866 |
#!/usr/bin/env python3
import base64
import os
import re
import sys
import tarfile
import anchore_engine.analyzers.utils
import anchore_engine.utils
analyzer_name = "retrieve_files"
try:
config = anchore_engine.analyzers.utils.init_analyzer_cmdline(
sys.argv, analyzer_name
)
except Exception as err:... | anchore/anchore-engine | anchore_engine/analyzers/modules/13_retrieve_files.py | Python | apache-2.0 | 2,629 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Michael Droettboom All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, t... | mdboom/freetypy | docstrings/tt_os2.py | Python | bsd-2-clause | 21,909 |
# pro-forma settings file.
#~ from djangosite import NoLocalSite as Site
from djangosite import Site
#~ SITE = Site(__file__,globals(),languages="en de fr nl et",no_local=True)
SITE = Site(globals(),no_local=True)
SECRET_KEY = "20227" # see :djangoticket:`20227`
| lsaffre/djangosite | docs/settings.py | Python | bsd-2-clause | 263 |
#!/usr/bin/env python
#
#
#
# Copyright (c) 2009-2015 University of Dundee.
#
# 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 la... | openmicroscopy/stats | omerostats/registry/urls.py | Python | agpl-3.0 | 1,687 |
# This directory is a Python package.
from .cpp import *
from .java import *
from .root_paths import *
from .deploy import *
| fifoforlifo/pynja | test2/build/repo/__init__.py | Python | apache-2.0 | 126 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains the class describing the coordination geometries that can exist in a given structure. These
"model" coordination geometries are described in the following articles :
- Pure Appl. Chem... | mbkumar/pymatgen | pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py | Python | mit | 58,667 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import json
import unittest
import mock
import... | endlessm/chromium-browser | third_party/catapult/dashboard/dashboard/graph_json_test.py | Python | bsd-3-clause | 32,592 |
import unittest
import unittest.mock as mock
import blivet
from pyanaconda.modules.storage.disk_initialization import DiskInitializationConfig
from pyanaconda.modules.storage.devicetree import create_storage
from pyanaconda.core.constants import CLEAR_PARTITIONS_ALL, CLEAR_PARTITIONS_LINUX, CLEAR_PARTITIONS_NONE
from... | jkonecny12/anaconda | tests/unit_tests/pyanaconda_tests/modules/storage/test_clearpart.py | Python | gpl-2.0 | 8,807 |
# xorn.geda.netlist - gEDA Netlist Extraction and Generation
# Copyright (C) 1998-2010 Ales Hvezda
# Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
# Copyright (C) 2013-2017 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Genera... | bert/geda-gaf | xorn/src/backend/gnet_vipec.py | Python | gpl-2.0 | 4,057 |
from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
# Add a test command to setup.py
# Code borrowed from: http://da44en.wordpress.com/2002/11/22/using-distutils/
from distutils.core import Command
from uni... | robmoggach/python-dirtt | setup.py | Python | mit | 6,693 |
# Simpler (but far more limited) API for ID3 editing
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# $Id: id3.py 3086 2006-04-04 02:13:21Z piman... | hzlf/openbroadcast.org | website/tools/mutagen-v1.20.1/easyid3.py | Python | gpl-3.0 | 14,109 |
"""
E271
Multiple spaces after keyword
"""
| landscape-test/all-messages | messages/pep8/E271.py | Python | unlicense | 44 |
# Rekall Memory Forensics
# Copyright (C) 2007-2011 Volatile Systems
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Additional Authors:
# Michael Cohen <scudette@users.sourceforge.net>
# Mike Auty <mike.auty@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms ... | dsweet04/rekall | rekall-core/rekall/plugins/windows/taskmods.py | Python | gpl-2.0 | 6,207 |
# Copyright 2017, 2018, 2021 Stefan Richthofer
#
# 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... | Stewori/pytypes | tests/testhelpers/override_testhelper_py3.py | Python | apache-2.0 | 7,697 |
# Calculator project for collaboration
a = raw_input("Enter the first number :")
b = raw_input("\nEnter the second Number :")
def addition(x, y):
return a + b
def sum(a,b):
return (a + b)
def division(x, y):
if(y!=0):
return(x/y)
else:
return("Division by Zero not defined")
def mul(a,b):
return(a*b)
de... | beniza/learningPython | myCalc.py | Python | mit | 404 |
from django.db.backends.mysql.base import DatabaseOperations
from django.contrib.gis.db.backends.adapter import WKTAdapter
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
class MySQLOperations(DatabaseOperations, BaseSpatialOperat... | ulope/django | django/contrib/gis/db/backends/mysql/operations.py | Python | bsd-3-clause | 1,888 |
from django.conf.urls import include, url
from rest_framework import routers
from bills import api
router = routers.DefaultRouter()
router.register(r'bills', api.BillViewSet, base_name='bills')
urlpatterns = [
url(r'^', include(router.urls))
]
| gnmerritt/dailyrippl | rippl/bills/urls.py | Python | mit | 251 |
# 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... | tensorflow/tensorflow | tensorflow/python/data/experimental/ops/error_ops.py | Python | apache-2.0 | 2,627 |
'''Test cases for connecting signals between threads'''
import unittest
from PySide.QtCore import QThread, QObject, SIGNAL, QCoreApplication
thread_run = False
class Source(QObject):
def __init__(self, *args):
QObject.__init__(self, *args)
def emit_sig(self):
self.emit(SIGNAL('source()'))
... | M4rtinK/pyside-android | tests/QtCore/qthread_signal_test.py | Python | lgpl-2.1 | 1,393 |
# -*- 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/v9/services/services/asset_service/__init__.py | Python | apache-2.0 | 674 |
"""This module contains the class used to represent disassembly code."""
from mythril.ethereum import util
from mythril.disassembler import asm
from mythril.support.signatures import SignatureDB
from typing import Dict, List, Tuple
class Disassembly(object):
"""Disassembly class.
Stores bytecode, and its di... | b-mueller/mythril | mythril/disassembler/disassembly.py | Python | mit | 3,790 |
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals, absolute_import
import logging
from io import BytesIO
from collections import OrderedDict
from requests import HTTPError
import itertools
from warnings import warn
from concurrent.futures import Future, as_completed
from PIL import Image
im... | catmaid/catpy | catpy/image.py | Python | mit | 27,623 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-language | samples/generated_samples/language_v1_generated_language_service_analyze_syntax_sync.py | Python | apache-2.0 | 1,530 |
"""
WSGI config for reminders project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | Silvian/Reminders-App | reminders/wsgi.py | Python | gpl-3.0 | 395 |
for i in range(1,100000000):
x = 1;
x = x >> 1;
x = x >> 6;
| damijanc/algorithms | algorithms/bitwise/rshift/bitwise/rshift.py | Python | apache-2.0 | 66 |
from io import BytesIO
from translate.convert import po2prop, test_convert
from translate.storage import po
class TestPO2Prop:
def po2prop(self, posource):
"""helper that converts po source to .properties source without requiring files"""
inputfile = BytesIO(posource.encode())
inputpo = p... | miurahr/translate | translate/convert/test_po2prop.py | Python | gpl-2.0 | 17,884 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 4 12:22:42 2020
@author: kpmurphy
"""
# https://gist.github.com/FedeMiorelli/640bbc66b2038a14802729e609abfe89
# This script registers the "turbo" colormap to matplotlib, and the reversed version as "turbo_r"
# Reference: https://ai.googleblog.c... | probml/pyprobml | scripts/colormap_turbo.py | Python | mit | 14,343 |
"""
WSGI config for panda_prospecting project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("D... | helanan/Panda_Prospecting | panda_prospecting/panda_prospecting/wsgi.py | Python | mit | 412 |
#!../bin/python
"""
HipparchiaSQLoader: archive and restore a database of Greek and Latin texts
Copyright: E Gunderson 2016-18
License: GNU GENERAL PUBLIC LICENSE 3
(see LICENSE in the top level directory of the distribution)
"""
import gzip
import io
import os
import pickle
from multiprocessing import Manager, P... | e-gun/HipparchiaSQLoader | reloadhipparchiaDBs.py | Python | gpl-3.0 | 11,369 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ----------... | Ecpy/ecpy | tests/measurement/monitors/text_monitor/test_manifest.py | Python | bsd-3-clause | 1,543 |
import cherrypy, locations, os, ythelper, json
from processpipe import ExternalProcess, ProcessException, OUT_FILE
YTDL_PATH = os.path.join(locations.YTUBE_PATH, "youtube_dl")
YTDL_PATH = os.path.join(YTDL_PATH, "__main__.py")
class YoutubeDlProcess(ExternalProcess):
def __init__(self, url):
ExternalProcess.__... | blissland/devflixx | lib/player/ytdlproc.py | Python | gpl-2.0 | 2,028 |
from app import app
# Start the server
app.run(debug=True)
| arpitbbhayani/flask-template | run.py | Python | mit | 60 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Quote.published_on'
db.add_column('quotes_quote', 'published_on',
self... | rollstudio/DjangoDash | quotes/quotes/migrations/0004_auto__add_field_quote_published_on__chg_field_quote_language.py | Python | mit | 6,283 |
from numpy import sin, cos, pi, array
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate as integrate
import matplotlib.animation as animation
from matplotlib.widgets import Slider, Button, RadioButtons
global G, L1, L2, M1, M2
G = 9.8 # gravitational acceleration (unit: m/(s^2))
L1 = 1.0 # firs... | GitYiheng/reinforcement_learning_test | test00_previous_files/pendulum_test/pendulum_test_090920170002.py | Python | mit | 6,240 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
DWF Python Example 2
Modified by: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
Revised: 2016-04-21
Original Author: Digilent, Inc.
Original Revision: 10/17/2013
Requires:
Python 2.7, 3.3 or later
"""
import dwf
im... | amuramatsu/dwf | examples/AnalogOut_Sync.py | Python | mit | 1,317 |
import tensorflow as tf
try:
from tensorflow.python.ops.rnn_cell_impl import RNNCell
except ImportError:
from tensorflow.python.ops.rnn_cell_impl import _RNNCell as RNNCell
# Modified from "https://github.com/teganmaharaj/zoneout/blob/master/zoneout_seq2seq.py"
# Wrapper for the TF RNN cell
class ZoneoutWrapp... | MU94W/TFCommon | RNNCell.py | Python | mit | 9,893 |
# Copyright (c) 2013 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 ... | ykaneko/neutron | neutron/plugins/ml2/config.py | Python | apache-2.0 | 1,496 |
"""Docstring manipulation functions.
These functions are generally work-arounds to fix deficiencies in Sphinx's
autodoc capabilities.
"""
import inspect
from six import iteritems
def add_int_enums_to_docstring(enum):
"""Decorator for IntEnum which re-writes the documentation string so that
Sphinx enumerate... | project-rig/rig | rig/utils/docstrings.py | Python | gpl-2.0 | 6,023 |
from reportlab.platypus import SimpleDocTemplate, Paragraph, Image, ParagraphAndImage
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_JUSTIFY, TA_CENTER
from reportlab.lib.units import cm
from StringIO import StringIO
from datetime import tzinfo, timedelta, dateti... | ikudriavtsev/personal | utils.py | Python | mit | 8,429 |
import unicodecsv as csv
from MongoManager import MongoManager
import argparse
import ConfigParser
import os
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Script to find data stats.')
parser.add_argument('--config', default='../config/config.cnf',
hel... | SubhasisDutta/CAMEO-JRC-Database | ir-scripts/extractCSVcameojrc.py | Python | apache-2.0 | 2,895 |
import os
from slackclient import SlackClient
BOT_NAME = 'taigabot'
slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN'))
if __name__ == "__main__":
api_call = slack_client.api_call("users.list")
if api_call.get('ok'):
# retrieve all users so we can find our bot
users = api_call.get(... | sopitz/taigabot | bot/print_bot_id.py | Python | agpl-3.0 | 579 |
#!/usr/bin/env python
#coding: utf-8
import sys
import time
import numpy as np
import random
import rospy
import tf
from geometry_msgs.msg import PointStamped
from std_msgs.msg import String, Empty, Header
from learningSignals.agents import Drqn
############################################# publish action to main_ac... | alexis-jacq/signals | nodes/brain.py | Python | isc | 2,636 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.