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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# This assumes an id on each field.
import logging
import hashlib
import random
log = logging.getLogger('anonymize')
common_hash_secret = "%016x" % (random.getrandbits(128))
def get_truncates(config):
database = config.get('database', {})
truncates = database.get('truncate', [])
sq... | davedash/mysql-anonymous | anonymize.py | Python | mit | 3,818 |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.fmt as fmt
def fbcode_builder_spec(builder):
return {
"depends_on": [f... | rsocket/rsocket-cpp | build/fbcode_builder/specs/folly.py | Python | apache-2.0 | 803 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010, 2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you c... | inspyration/odoo | openerp/tools/func.py | Python | agpl-3.0 | 3,942 |
from __future__ import print_function
import sys
import time
import problem
import threading
class ProblemWatchThread(threading.Thread):
def __init__(self):
super(ProblemWatchThread, self).__init__()
self.pwatch = problem.get_problem_watcher()
self.pwatch.add_callback(self.handle)
... | mhabrnal/abrt | src/python-problem/examples/thread_watch_example.py | Python | gpl-2.0 | 911 |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | pywinauto/pywinauto | pywinauto/unittests/test_actionlogger.py | Python | bsd-3-clause | 6,874 |
import logging
import os
import time
import inspect
import shutil
import threading
import traceback
import uuid
from functools import partial
from numbers import Number
from ray.tune.registry import parameter_registry
from six.moves import queue
from ray.util.debug import log_once
from ray.tune import TuneError, sess... | robertnishihara/ray | python/ray/tune/function_runner.py | Python | apache-2.0 | 22,495 |
# -*- coding: utf-8 -*-
"""
@brief test log(time=33s)
"""
import sys
import os
import unittest
import pyquickhelper
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.ipythonhelper import execute_notebook_list, execute_notebook_list_finalize_ut
from pyquic... | sdpython/pymyinstall | _unittests/ut_documentation/test_run_notebooks.py | Python | mit | 2,438 |
""" Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... | atmark-techno/atmark-dist | user/python/Lib/locale.py | Python | gpl-2.0 | 26,992 |
#!/usr/bin/env python
# cardinal_pythonlib/bulk_email/constants.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal ([email protected]).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Ver... | RudolfCardinal/pythonlib | cardinal_pythonlib/bulk_email/constants.py | Python | apache-2.0 | 1,941 |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | wizmer/NeuroM | neurom/view/common.py | Python | bsd-3-clause | 16,929 |
import json
import logging
import os
import sys
from biothings.utils.version import get_software_info
logger = logging.getLogger(__name__)
class FieldNote:
def __init__(self, path):
try: # populate field notes if exist
inf = open(path, 'r')
self._fields_notes = json.load(inf)
... | biothings/biothings.api | biothings/utils/info.py | Python | apache-2.0 | 2,057 |
from Plugins.Plugin import PluginDescriptor
def videoFinetuneMain(session, **kwargs):
from VideoFinetune import VideoFinetune
session.open(VideoFinetune)
def startSetup(menuid):
if menuid != "system":
return [ ]
return [(_("Testscreens"), videoFinetuneMain, "video_finetune", None)]
def Plugins(**kwargs):
re... | kingvuplus/ops | lib/python/Plugins/SystemPlugins/VideoTune/plugin.py | Python | gpl-2.0 | 514 |
# Copyright (c) 2016-2017 Adobe Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | adobe-apiplatform/user-sync.py | user_sync/engine/umapi.py | Python | mit | 67,959 |
#!/usr/bin/env python3
'''
Exome aggregation consortium annotation tool, Version 0.8
This program is designed to use the ExAC VCF data from the broad institute (downloadable from the link below).
ftp://ftp.broadinstitute.org/pub/ExAC_release
You will first need to run the library generation function using the commandli... | michael-weinstein/ExACto | ExACto0.8.3.py | Python | gpl-2.0 | 59,744 |
import pandas as pd, numpy as np
def estimate(dset,config,year=None,show=True,variables=None):
return
def simulate(dset,config,year=None,show=True,variables=None,subtract=False):
assert "table" in config
assert "writetotmp" in config
assert "geography_field" in config
assert "control_totals" in config or "v... | apdjustino/DRCOG_Urbansim | synthicity/urbansim/transitionmodel.py | Python | agpl-3.0 | 4,937 |
import os, subprocess, time, signal
import gym
from gym import error, spaces
from gym import utils
from gym.utils import seeding
try:
import hfo_py
except ImportError as e:
raise error.DependencyNotInstalled("{}. (HINT: you can install HFO dependencies with 'pip install gym[soccer].)'".format(e))
import loggi... | machinaut/gym | gym/envs/soccer/soccer_env.py | Python | mit | 6,769 |
"""Install instructions for non-packaged java programs.
"""
import os
from fabric.api import *
from fabric.contrib.files import *
from shared import (_if_not_installed, _make_tmp_dir)
from cloudbio.custom import shared
@_if_not_installed("lein -v")
def install_leiningen(env):
"""Clojure tool for project configur... | heuermh/cloudbiolinux | cloudbio/custom/java.py | Python | mit | 756 |
a = 1.if<caret> | hurricup/intellij-community | python/testData/postfix/if/nonApplicable.py | Python | apache-2.0 | 15 |
# -*- coding: utf-8 -*-
#
# mimms - mms stream downloader
# Copyright © 2008 Wesley J. Landaker <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | aabilio/PyDownTV | Servers/pylibmms/core.py | Python | gpl-3.0 | 7,710 |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
imp... | FeatherCoin/Feathercoin | test/functional/wallet_txn_clone.py | Python | mit | 6,352 |
"""
A simple list of endpoints that will be matched in order.
Each entry is a tuple with
1. A regex to match incoming requests against. Special notation is used to
represent arguments.
2. The path for the YAPWAF controller that handles this request.
"""
import controllers as controllers
routes = []
routes.append... | bis12/yapwaf | tests/test_routes.py | Python | mit | 347 |
from models import Event
from django.views.generic import DetailView, ListView
class EventListView(ListView):
template_name = 'agenda/event_list.html'
queryset = Event.objects.upcoming()
paginate_by = 20
class EventArchiveview(EventListView):
queryset = Event.objects.past()
class EventDetailV... | feinheit/feincms-elephantagenda | elephantagenda/views.py | Python | mit | 403 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import sys
from path import Path
import flexget
from flexget import options
from flexget.event import event
from flexget.terminal import console
from flexget.utils.tools ... | gazpachoking/Flexget | flexget/plugins/cli/debug_info.py | Python | mit | 932 |
# -*- coding: utf-8 -*-
__title__ = 'gameoflife'
__version__ = '0.4.0-dev'
__author__ = 'wlof'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015 wlof'
| wlof/gameoflife | gameoflife/__init__.py | Python | mit | 154 |
def is_float(s):
try:
float(s)
return True
except ValueError:
return False | sirk390/coinpy | coinpy-lib/src/coinpy/tools/float.py | Python | lgpl-3.0 | 107 |
#!/usr/bin/python
# vi: ts=4 expandtab syntax=python
##############################################################################
# Copyright (c) 2008 IBM Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which acco... | Awingu/open-ovf | py/tests/OvfEnvironmentTestCase.py | Python | epl-1.0 | 22,345 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_INV_models/SHH_INV_models_final_output_0.2_-0.1_10000/SHH_INV_models8594.py | Python | gpl-3.0 | 17,566 |
import logging
import requests
from django.shortcuts import render
from ..utils.lgUtils import *
from ..utils.earthquakesUtils import *
from ..utils.cylinders.cylindersHeatMap import *
from django.http import HttpResponse
from json.decoder import JSONDecodeError
from django.views.decorators.csrf import csrf_exempt
log... | LiquidGalaxyLAB/FlOYBD | Django/mysite/floybd/earthquakes/viewsEarthquakes.py | Python | mit | 22,217 |
"""Test AdaNet single graph candidate implementation.
Copyright 2018 The AdaNet 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
https://www.apache.org/licenses/LI... | tensorflow/adanet | adanet/core/candidate_test.py | Python | apache-2.0 | 4,613 |
# -*- coding: utf-8 -*-
from flask import Blueprint
# 创建蓝本
auth = Blueprint('auth', __name__)
from . import views
| seagullbird/BLEXT | app/auth/__init__.py | Python | mit | 122 |
# Copyright (C) 2017 Fujitsu Limited
# 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 requi... | mahak/neutron | neutron/services/logapi/rpc/agent.py | Python | apache-2.0 | 1,952 |
# Copyright (C) 2016 Red Hat, Inc., Tomas Tomecek <ttomecek@redhat>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | marcli/sos | sos/plugins/npm.py | Python | gpl-2.0 | 4,061 |
"""
:mod:`tslearn.deprecated` should not be considered as a `tslearn` package, it
stores deprecated code from old tslearn versions. Use at your own risk.
"""
# Code for soft DTW is by Mathieu Blondel under Simplified BSD license
if True: # pragma: no cover
import numpy
from scipy.interpolate import interp1d... | rtavenar/tslearn | tslearn/deprecated.py | Python | bsd-2-clause | 11,956 |
import weakref
import logging
logger = logging.getLogger(__name__)
import core.cons as cons
from core.api import api
from core.config import conf
from qt import signals
#Config parser
OPTION_IP_RENEW_ACTIVE = "ip_renew_active"
OPTION_RENEW_SCRIPT_ACTIVE = "renew_script_active"
class IPRenewerGUI:
""""""
de... | nitely/ochDownloader | addons/ip_renewer/ip_renewer_gui.py | Python | lgpl-3.0 | 2,017 |
# -*- coding: iso-8859-2 -*-
# $Date: 2009-03-02 21:05:04 $, $Revision: 1.4 $
#
# TreeModel that encapsulates any python sequence of other seqences of same size
#
# Author: Wojciech Mu³a
# e-mail: [email protected]
# www: http://0x80.pl/
#
# Initial release: 2010-01-24
#
# License: public domain
import ... | WojciechMula/toys | pygtk/pythonlistmodel.py | Python | bsd-2-clause | 2,635 |
from .analysis import *
from .toolbox import *
from . import utils
| Geosyntec/python-tidegates | tidegates/__init__.py | Python | bsd-3-clause | 67 |
# -*- coding: cp936 -*-
from weibo import APIClient
from datetime import datetime
import urllib
import json
import webbrowser
APP_KEY = ''
APP_SECRET = ''
CALLBACK_URL = None#'127.0.0.1'
SOME_CODE = None
UID_C = None #�û�ID
text_towrite = '' #����ȡ������д���ı�
ACCESS_TOKEN = ''
TEXT_TO = None
PIC_TO = None
weibo_tex... | owenyang0/sinaweibopy | WeiboClass.py | Python | apache-2.0 | 4,471 |
# coding: utf-8
"""
MIT License
Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limit... | epeios-q37/epeios | other/exercises/basics/workshop/fr/_.py | Python | agpl-3.0 | 1,481 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from ast import NodeTransformer
from itertools import chain
from six import iteritems
from warnings import warn
from cobra.core import Gene, Metabolite, Reaction
from cobra.core.gene import ast2str
from cobra.manipulation.delete import get_compiled_gene... | zakandrewking/cobrapy | cobra/manipulation/modify.py | Python | lgpl-2.1 | 9,924 |
""" support for skip/xfail functions and markers. """
from _pytest.config import hookimpl
from _pytest.mark.evaluate import MarkEvaluator
from _pytest.outcomes import fail
from _pytest.outcomes import skip
from _pytest.outcomes import xfail
from _pytest.store import StoreKey
skipped_by_mark_key = StoreKey[bool]()
eva... | alfredodeza/pytest | src/_pytest/skipping.py | Python | mit | 6,499 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | tdtrask/ansible | lib/ansible/modules/network/ios/ios_linkagg.py | Python | gpl-3.0 | 9,311 |
from django.db.models import Q
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext_lazy as _
from django_filters import ChoiceFilter, MultipleChoiceFilter
from mapentity.filters import PolygonFilter, PythonPolygonFilter
from geotrek.... | makinacorpus/Geotrek | geotrek/maintenance/filters.py | Python | bsd-2-clause | 5,979 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.translate
import frappe.modules.patch_handler
import frappe.model.sync
from frappe.utils.fixtures import sync_fixtures
from frappe.sessions import cle... | Amber-Creative/amber-frappe | frappe/migrate.py | Python | mit | 1,223 |
# pylint: disable=preferred-module # FIXME: remove once migrated per GH-725
import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.rules.MetaChangeFromDefaultRule import MetaChangeFromDefaultRule
from ansiblelint.testing import RunFromText
DEFAULT_GALAXY_INFO = '''
galaxy_info:
author: your... | willthames/ansible-lint | test/TestMetaChangeFromDefault.py | Python | mit | 1,169 |
# taken from https://dev.mysql.com/doc/connector-python/en/connector-python-example-cursor-transaction.html
from __future__ import print_function
from datetime import date, datetime, timedelta
import mysql.connector
cnx = mysql.connector.connect(user='scott', database='employees')
cursor = cnx.cursor()
tomorrow = dat... | github/codeql | python/ql/test/library-tests/frameworks/mysql-connector-python/pep249.py | Python | mit | 1,173 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | dset0x/invenio | invenio/ext/es.py | Python | gpl-2.0 | 8,586 |
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass
from pygments.token import Token
__all__ = (
'PromptStyle',
'IPythonPrompt',
'ClassicPrompt',
)
class PromptStyle(with_metaclass(ABCMeta, object)):
"""
Base class for all prompts.
""... | technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/ptpython/prompt_style.py | Python | gpl-3.0 | 1,807 |
#
# 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... | apache/incubator-airflow | airflow/providers/airbyte/example_dags/example_airbyte_trigger_job.py | Python | apache-2.0 | 2,129 |
#!/usr/bin/env python
'''
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")... | arenadata/ambari | ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py | Python | apache-2.0 | 6,045 |
# pragma: no cover
# kept for backward compatibility with previous versions
from .utils import ( # noqa
CreateConfigMixin,
CreateConfigTemplateMixin,
CreateDeviceMixin,
CreateTemplateMixin,
CreateVpnMixin,
TestVpnX509Mixin,
)
| nemesisdesign/openwisp2 | openwisp_controller/config/tests/__init__.py | Python | gpl-3.0 | 251 |
import pytest
from bugsnag import Breadcrumbs
# resize the breadcrumb list to 0 before each test to prevent tests from
# interfering with eachother
@pytest.fixture(autouse=True)
def reset_breadcrumbs():
Breadcrumbs(0).resize(0)
| bugsnag/bugsnag-python | tests/conftest.py | Python | mit | 234 |
#
# 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... | apache/incubator-airflow | airflow/providers/google/cloud/transfers/s3_to_gcs.py | Python | apache-2.0 | 9,595 |
import openerp.tests
class TestUi(openerp.tests.HttpCase):
def test_01_public_homepage(self):
self.phantom_js("/", "console.log('ok')", "'website.snippets.animation' in odoo.__DEBUG__.services")
def test_02_admin_homepage(self):
self.phantom_js("/", "console.log('ok')", "'website.snippets.edi... | vileopratama/vitech | src/addons/website/tests/test_ui.py | Python | mit | 791 |
"""
Component to interface with garage doors that can be controlled remotely.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/garage_door/
"""
import logging
import os
import voluptuous as vol
from blumate.config import load_yaml_config_file
from bluma... | bdfoster/blumate | blumate/components/garage_door/__init__.py | Python | mit | 3,604 |
#!/usr/bin/env python
import os
import subprocess
SRCDIR = os.path.abspath('../../..')
os.chdir(SRCDIR)
subprocess.check_call('fakeroot debian/rules binary', shell=True)
subprocess.check_call('fakeroot debian/rules clean', shell=True)
subprocess.check_call('mv ../*.deb installs/debian/ubuntu', shell=True)
| tquilian/exelearningTest | installs/debian/ubuntu/make.py | Python | gpl-2.0 | 309 |
#!/usr/bin/python3
import unittest
import matcher
import mmi_token
import uuid
def anything():
pass
class MockToken(object):
def __init__(self, value):
self.raw_value = value
class MockPassingMatcher(object):
def __init__(self, raw_value = 'some parsed value'):
self.raw_value = raw_valu... | PolyglotSymposium/mm-i | src/matcher_specs.py | Python | mit | 6,846 |
import json
import pytest
from marshmallow.fields import Field, DateTime, Dict, String, Nested, List, TimeDelta
from marshmallow import Schema
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec.ext.marshmallow import common
from apispec.exceptions import APISpecError
from ... | marshmallow-code/apispec | tests/test_ext_marshmallow.py | Python | mit | 52,913 |
from permission import registry, PermissionHandler
from models import Topic
class TopicPermissionHandler(PermissionHandler):
def has_perm(self, user, perm, obj=None):
"""
topic.add_topic
topic.view_topic
topic.change_topic
topic.delete_topic
topic.moderate_topic
... | ozgurgunes/django-filizver | filizver/_apps/topic/permissions.py | Python | mit | 1,081 |
"""Person model"""
from sqlalchemy import Column, UniqueConstraint, ForeignKey
from sqlalchemy import schema as saschema
from sqlalchemy.types import Integer, String, Unicode, Float, UnicodeText
from discariche.model.meta import Base
class Status(Base):
__tablename__ = "status"
id = Column(Integer, primary_k... | mov-q/dumpy | discariche/model/status.py | Python | gpl-3.0 | 738 |
import asyncio
import logging
import time
from .controllers import BaseController, NotFoundController
from .parsers import HttpParser, ParseError
from .responses import Response
from .utils import create_critical_task
logger = logging.getLogger('sniper.application')
class BaseApp:
def __init__(self, urls=[], co... | lexdene/py-sniper | sniper/app.py | Python | gpl-3.0 | 4,606 |
"""List the keymaps for a specific keyboard
"""
from milc import cli
import qmk.keymap
from qmk.decorators import automagic_keyboard
from qmk.path import is_keyboard
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
@cli.subcommand("List the keymaps for a specific keybo... | kmtoki/qmk_firmware | lib/python/qmk/cli/list/keymaps.py | Python | gpl-2.0 | 687 |
#!/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.
"""Test BIP68 implementation."""
from test_framework.test_framework import BitcoinTestFramework
from test... | destenson/bitcoin--bitcoin | test/functional/bip68-sequence.py | Python | mit | 17,560 |
#!/usr/bin/env python
class Message(object):
"""
Base type of a message sent through the pipeline.
Define some attributes and methods to form your message.
I suggest you don't alter this class. You're are free to do so, of course. It's your own decision.
Though, I suggest you creat... | lumannnn/pypifi | pypifi/message.py | Python | gpl-3.0 | 397 |
"""
keyring_demo.py
This demo shows how to create a new keyring and enable it in keyring lib.
Created by Kang Zhang on 2009-07-12
"""
import os
KEYRINGRC = "keyringrc.cfg"
def load_keyring_by_config():
"""This function shows how to enable a keyring using config file
"""
# create the config file
co... | robinson96/GRAPE | keyring/demo/keyring_demo.py | Python | bsd-3-clause | 2,347 |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | Acidburn0zzz/servo | python/servo/testing_commands.py | Python | mpl-2.0 | 41,755 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_container_registry_management_client.py | Python | mit | 4,789 |
#!/usr/bin/env python3
# --------------------- #
# -- SEVERAL IMPORTS -- #
# --------------------- #
from pathlib import Path
from pytest import fixture
from orpyste.data import ReadBlock as READ
# ------------------- #
# -- MODULE TESTED -- #
# ------------------- #
from mistool import datetime_use
# ---------... | bc-python-tools/mistool | test/datetime/build_ddatetime/test_build_ddatetime.py | Python | gpl-3.0 | 1,374 |
class Hello:
__gui = None
def __init__(self, gui):
self.__gui = gui
def run(self):
print 'Hello world from Python!' | SnorkelApp/snorkel-integration | hello.py | Python | apache-2.0 | 155 |
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from construct import Const, Int8ul, Int16ul, Int32ul, PaddedString, Struct
from .utils import (BYTES_PER_DIRECTORY_ENTRY, get_fatfs_type, get_non_data_sectors_cnt, number_of_clusters,
read... | espressif/esp-idf | components/fatfs/fatfsgen_utils/fatfs_parser.py | Python | apache-2.0 | 3,138 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import time
import subprocess
# Import parameters from the setup file.
sys.path.append('.')
from setup import (
setup_dict, get_project_files, print_success_message,
print_failure_message, _lint, _test, _test_all,
CODE_DIR... | sintax1/o365-email-processor | pavement.py | Python | mit | 7,373 |
# Author: Drone
import web
from app.helpers import utils
from app.helpers import formatting
projectName = 'Remote Function Trainer'
listLimit = 40
# connect to database
db = web.database(dbn='mysql', db='rft', user='root', passwd='1234')
t = db.transaction()
#t.commit()
# in development debug error messages and r... | gcobos/rft | config.py | Python | agpl-3.0 | 673 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: leepstools.file.elastic
.. moduleauthor:: Hendrix Demers <[email protected]>
Read and generate LEEPS elastic file .ees.
"""
###############################################################################
# Copyright 2017 Hendrix Dem... | drix00/leepstools | leepstools/file/elastic.py | Python | apache-2.0 | 1,272 |
# -*- coding: utf-8 -*-
"""
Metadata about stations and pollutants for this sos.
@author: Joris Van den Bossche
"""
from . import SOS
from ._stations import STATIONS
contents = SOS.contents
POLLUTANTS = {key: {'id': contents[key].id,
'name': contents[key].name,
'features_of_i... | jorisvandenbossche/ircelsos | ircelsos/metadata.py | Python | bsd-2-clause | 1,031 |
from django.conf.urls import url
from poradnia.users import views
urlpatterns = [
# URL pattern for the UserListView # noqa
url(regex=r"^$", view=views.UserListView.as_view(), name="list"),
# URL pattern for the UserRedirectView
url(
regex=r"^~przekieruj/$", view=views.UserRedirectView.as_vie... | watchdogpolska/poradnia.siecobywatelska.pl | poradnia/users/urls.py | Python | bsd-3-clause | 933 |
class CloudObject(object):
UNIQUE_PATTERN_IN_NAME = 'sqe-'
def __init__(self, cloud, dic):
self.dic_from_os = dic
self.cloud = cloud
self.role = self.__class__.__name__.replace('Cloud', '').lower()
if cloud:
getattr(cloud, self.role + 's').append(self)
@property... | CiscoSystems/os-sqe | lab/cloud/__init__.py | Python | apache-2.0 | 1,925 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2007 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | Forage/Gramps | gramps/gui/views/pageview.py | Python | gpl-2.0 | 22,248 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015. Tšili Lauri Johannes
#
# 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 ... | tsili/datpy | datpy/user_modules/parsers/elsevier_parser.py | Python | agpl-3.0 | 5,782 |
# template for "Guess the number" mini-project
# input will come from buttons and an input field
# all output for the game will be printed in the console
#import libraries
import simplegui
import random
#set initial global value for max range and number of guesses
max_range = 100
number_tries = 7
# helper function t... | joshsomma/rice_python_1 | guess_number_2.py | Python | apache-2.0 | 3,035 |
# Time: O(1)
# Space: O(1)
# Given an integer, return its base 7 string representation.
#
# Example 1:
# Input: 100
# Output: "202"
# Example 2:
# Input: -7
# Output: "-10"
# Note: The input will be in range of [-1e7, 1e7].
class Solution(object):
def convertToBase7(self, num):
if num < 0:
r... | kamyu104/LeetCode | Python/base-7.py | Python | mit | 811 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 Andrea Cometa.
# Email: [email protected]
# Web site: http://www.andreacometa.it
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 ... | scigghia/l10n-italy | l10n_it_ricevute_bancarie/__openerp__.py | Python | agpl-3.0 | 2,231 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dummy conftest.py for data.
If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
https://pytest.org/latest/plugins.html
"""
from __future__ import print_function, absolute_import, division
import pytest
| totalgood/pug-data | tests/conftest.py | Python | mit | 310 |
import hashlib
from CommonServerPython import *
class Client:
"""
Client to use in the APN-OS Policy Optimizer integration.
"""
def __init__(self, url: str, username: str, password: str, vsys: str, device_group: str, verify: bool, tid: int):
# The TID is used to track individual commands sen... | VirusTotal/content | Packs/PANOSPolicyOptimizer/Integrations/PANOSPolicyOptimizer/PANOSPolicyOptimizer.py | Python | mit | 18,763 |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... | ionutbalutoiu/ironic | ironic/drivers/fake.py | Python | apache-2.0 | 11,459 |
import pyRead, sys, coapSender, asyncio
# Check File
pyRead.checkArg(sys.argv)
# Read File
file = pyRead.readFile(sys.argv[1])
# Send each line to the server
for line in file:
split = line.split()
# Make sure we wait until msg is send to server
asyncio.get_event_loop().run_until_complete(coapSender.send(s... | gzsierra/pycoap | pycoap.py | Python | mit | 340 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
class BlogCategory(WebsiteGenerator):
def autoname(self... | gangadhar-kadam/verve_live_frappe | frappe/website/doctype/blog_category/blog_category.py | Python | mit | 573 |
#
# Generate math tests
#
import random
random.seed(412)
monitor = [ord(x) for x in open("..\monitor_rom\monitor.bin","rb").read(-1)]
mvars = { "C":10,"D":20,"Z":33 }
def rnd(maxval):
n = maxval+1
term = ""
while n >= maxval:
n = random.randrange(0,255)
term = str(n)
if random.randrange(0,3) == 0:
k = m... | paulscottrobson/wallpaper-one | software/minol - arithmetic/generate.py | Python | mit | 1,446 |
import asyncio
import os
import streamlit as st
import solvebio
from solvebio_auth import SolveBioOAuth2
class SolveBioStreamlit:
"""SolveBio OAuth2 wrapper for restricting access to Streamlit apps"""
# App settings loaded from environment variables or .env file
CLIENT_ID = os.environ.get("CLIENT_ID", ... | solvebio/solvebio-python | solvebio/contrib/streamlit/solvebio_streamlit.py | Python | mit | 3,924 |
'''
Created on 17.08.2015
@author: vvladych
'''
from gi.repository import Gtk
class AbstractMask(Gtk.Grid):
def __init__(self, main_window):
Gtk.Grid.__init__(self)
self.main_window=main_window
# Main working pane: contains left pane with actions and working area pane
sel... | vvladych/forecastmgmt | src/forecastmgmt/ui/abstract_mask.py | Python | unlicense | 1,776 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, First Party Software
# 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... | filipp/Servo | servo/lib/middleware.py | Python | bsd-2-clause | 2,970 |
import math
import queue
import time
from common import const, plot
class HeadingPlot(plot.PlotBase):
def plot(self, hdg, elev):
try:
self._q.put_nowait((hdg, elev))
except queue.Full:
pass
@staticmethod
def _daemon(q):
from matplotlib import transforms
... | cuauv/software | hydrocode/modules/pinger/headingplot.py | Python | bsd-3-clause | 1,604 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Red Hat, inc
# Written by Seth Vidal
# based on the mount modules from salt and puppet
#
# 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 ... | raags/ansible-modules-core | system/mount.py | Python | gpl-3.0 | 12,050 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.conf.urls.defaults import *
import reporters.views as views
urlpatterns = patterns('',
url(r'^reporters$', views.index),
url(r'^reporters/inactive/csv$', views.view_inactive_reporters_csv),
url(r'^reporters/reporter$', ... | pivotaccess2007/RapidSMS-Rwanda | apps/reporters/urls.py | Python | lgpl-3.0 | 1,390 |
# macros.py
"""
This module is an integeral part of the program
MMA - Musical Midi Accompaniment.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option... | pauljohnleonard/MusicBox | attic/thirdparty/srcMMA/MMA/macro.py | Python | gpl-2.0 | 24,965 |
class Token:
"""
Class representing a token.
kind: the kind of token, e.g. filename, number, other
value: specific instance value, e.g. "/tmp/foo.c", or 5
offset: byte offset from start of parse string
"""
def __init__(self, kind, value=None, offset=None):
self.offset = offset
... | rocky/python3-trepan | trepan/processor/parse/tok.py | Python | gpl-3.0 | 1,426 |
import connexion
import six
from openapi_server.models.branch_impl import BranchImpl # noqa: E501
from openapi_server.models.favorite_impl import FavoriteImpl # noqa: E501
from openapi_server.models.github_organization import GithubOrganization # noqa: E501
from openapi_server.models.github_scm import GithubScm # ... | cliffano/swaggy-jenkins | clients/python-flask/generated/openapi_server/controllers/blue_ocean_controller.py | Python | mit | 16,249 |
import json
import django
import urllib3
if __name__ == '__main__':
django.setup()
from infrastructure.models import Server, CustomField
from resourcehandlers.aws.models import AWSHandler
from common.methods import set_progress
from django.core.serializers.json import DjangoJSONEncoder
def fetch_arns_for_findi... | CloudBoltSoftware/cloudbolt-forge | ui_extensions/aws_network_policy/actions/fetch_update_findings.py | Python | apache-2.0 | 4,209 |
#!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("docs/README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomb... | Accruent/zoomba | setup.py | Python | apache-2.0 | 1,573 |
# Copyright (c) 2014 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | scality/manila | manila/tests/share/drivers/emc/test_driver.py | Python | apache-2.0 | 4,820 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for `astropy.vo.validator.validate`.
.. note::
This test will fail if external URL query status
changes. This is beyond the control of AstroPy.
When this happens, rerun or update the test.
"""
from __future__ import absolute_import,... | joergdietrich/astropy | astropy/vo/validator/tests/test_validate.py | Python | bsd-3-clause | 3,067 |
import decimal, logging
from django.db import models
from shops.models import Shop
from preferences.models import ShippingItem, ShippingPrice, ShippingWeight, TaxState
class ShippingCalculator():
@classmethod
def get_charge(cls, cart):
total_price = cart.total()
total_weight = cart.total... | StephenPower/CollectorCity-Market-Place | stores/apps/payments/shipping.py | Python | apache-2.0 | 1,703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.