code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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 v... | pmghalvorsen/gramps_branch | gramps/gen/plug/menu/_placelist.py | Python | gpl-2.0 | 1,794 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django import VERSION
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SignalDeferredDispatch'
db.cre... | ilstreltsov/django-db-mailer | dbmail/south_migrations/0032_auto__add_signaldeferreddispatch__add_index_signaldeferreddispatch_eta.py | Python | gpl-2.0 | 16,851 |
"""
The OpenMP package does contain all code templates required for the openMP
code generation in ANNarchy.
BaseTemplates:
defines the basic defintions common to all sparse matrix formates, e. g. projection header
[FORMAT]_SingleThread:
defines the format specific defintions for the currently available form... | vitay/ANNarchy | ANNarchy/generator/Projection/OpenMP/__init__.py | Python | gpl-2.0 | 1,202 |
import urllib.request
import time
preço = 99.99 #algum valor maior
while preço >= 4.74:
pagina = urllib.request.urlopen(
'http://beans.itcarlow.ie/prices-loyalty.html')
texto = pagina.read().decode('utf8')
onde = texto.find('>$')
início = onde + 2
fim = início + 4
preço = float(t... | wsricardo/mcestudos | treinamento-webScraping/Abraji/p11.py | Python | gpl-3.0 | 468 |
# Copyright (c) 2003-2015 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
import pcapy
import socket
import time
from random import randint
from mitmflib.impacket import struc... | CiuffysHub/MITMf | mitmflib-0.18.4/mitmflib/impacket/dhcp.py | Python | gpl-3.0 | 8,466 |
from parso.python import tree
from parso.python.token import PythonTokenTypes
from parso.parser import BaseParser
NAME = PythonTokenTypes.NAME
INDENT = PythonTokenTypes.INDENT
DEDENT = PythonTokenTypes.DEDENT
class Parser(BaseParser):
"""
This class is used to parse a Python file, it then divides them into ... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/jedi_deps/parso/parso/python/parser.py | Python | gpl-3.0 | 8,227 |
# This file is part of Lerot.
#
# Lerot 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 later version.
#
# Lerot is distributed in the hope tha... | hubert667/AIR | src/python/ranker/AbstractRankingFunction.py | Python | gpl-3.0 | 2,935 |
# Copyright (C) 2015 Custodia Project Contributors - see LICENSE file
import json
from six import string_types
from custodia.message.common import InvalidMessage
from custodia.message.common import MessageHandler
class SimpleKey(MessageHandler):
"""Handles 'simple' messages"""
def parse(self, msg, name):... | simo5/custodia | custodia/message/simple.py | Python | gpl-3.0 | 1,145 |
import math as m
def near_to_target(lbot, targetX, targetY, nearDist = 50):
x, y, alpha = lbot.getPose()
distToTarget = m.sqrt(m.pow(x-targetX, 2) + m.pow(y-targetY, 2))
if distToTarget <= nearDist:
return True
return False
| robocomp/learnbot | learnbot_dsl/functions/proprioceptive/base/near_to_target.py | Python | gpl-3.0 | 232 |
import sys,os
import numpy as np
#os.environ["EPICS_CA_AUTO_ADDR_LIST"] = "NO"
#os.environ["EPICS_CA_ADDR_LIST"] = "192.168.82.10"
#os.environ["EPICS_CA_MAX_ARRAY_BYTES"] = "10000000000"
import velaINJMagnetControl as VIMC
a = VIMC.velaINJMagnetController(True,False)
print( np.array(a.getQuadNames()))
| mothyjohn/VELA-CLARA-Controllers | General/enums/bin/Release/test.py | Python | gpl-3.0 | 307 |
'''
This file must hold keys for translatable messages
that are used as variables
it is important that a dummy _() function is used here
this way message key will be pulled into django.po
and can still be used as a variable in python files.
'''
_ = lambda v:v
#NOTE: all strings must be explicitly put into this diction... | PearsonIOKI/compose-forum | askbot/const/message_keys.py | Python | gpl-3.0 | 1,683 |
import json
import sys
import requests
from collections import Counter
from wapy.api import Wapy
from http.server import BaseHTTPRequestHandler, HTTPServer
wapy = Wapy('frt6ajvkqm4aexwjksrukrey')
def removes(yes):
no = ["Walmart.com", ".", ","]
for x in no:
yes = yes.replace(x, '')
return yes
def... | Pennapps-XV/backend | root/parse-server.py | Python | gpl-3.0 | 2,081 |
import sys
import unittest
import cbind
cbind.choose_cindex_impl(cbind.CLANG_CINDEX)
import suite_all
if __name__ == '__main__':
runner = unittest.TextTestRunner()
sys.exit(not runner.run(suite_all.suite_all).wasSuccessful())
| anthrotype/ctypes-binding-generator | test/suite_clang_cindex.py | Python | gpl-3.0 | 238 |
# -*- encoding: utf-8 -*-
from abjad.tools.durationtools import Duration
from abjad.tools.rhythmtreetools import RhythmTreeContainer, RhythmTreeLeaf
def test_rhythmtreetools_RhythmTreeNode_duration_01():
tree = RhythmTreeContainer(preprolated_duration=1, children=[
RhythmTreeLeaf(preprolated_duration=1),... | mscuthbert/abjad | abjad/tools/rhythmtreetools/test/test_rhythmtreetools_RhythmTreeNode_duration.py | Python | gpl-3.0 | 1,469 |
import os
import sys
HOSTNAME = os.environ.get('QLF_HOSTNAME', 'localhost')
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.abspath(__file__))
)
SECRET_KEY = os.environ.get('SECRET_KEY', os.urandom(32))
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', HOSTNAME).split(',')
SITE_PAGES_DIRECTORY = os.path.join... | linea-it/qlf | backend/framework/qlf/qlf/settings.py | Python | gpl-3.0 | 3,872 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The module file for iosxr_facts
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata... | roadmapper/ansible | lib/ansible/modules/network/iosxr/iosxr_facts.py | Python | gpl-3.0 | 6,288 |
# $Id: tfont.py,v 1.2 2003/09/14 04:31:39 riq Exp $
#
# Tenes Empanadas Graciela
# Copyright 2000,2003 Ricardo Quesada (riq@coresecurity.com)
#
import pygame
if not pygame.font.get_init():
pygame.font.init()
TFont = {
'helvetica 8' : pygame.font.SysFont('helvetica',8),
'helvetica 10' : pygame.font... | JeroenDeDauw/teg | python/client/gui/tfont.py | Python | gpl-3.0 | 655 |
#!/usr/bin/env python
"""
@file generateITetrisIntersectionMetrics.py
@author Daniel Krajzewicz
@author Lena Kalleske
@author Michael Behrisch
@date 2007-10-25
@version $Id: generateITetrisIntersectionMetrics.py 14425 2013-08-16 20:11:47Z behrisch $
SUMO, Simulation of Urban MObility; see http://sumo-sim.org... | cathyyul/sumo-0.18 | tools/output/generateITetrisIntersectionMetrics.py | Python | gpl-3.0 | 12,974 |
from .polarpoint import PolarPoint
__all__ = [
'PolarPoint',
]
| dfroger/geomalgo | geomalgo/polar/__init__.py | Python | gpl-3.0 | 68 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from django.template import C... | claudep/pootle | tests/pootle_misc/templatetags.py | Python | gpl-3.0 | 1,836 |
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 | Six_zebra_models/Six_zebra_models_final_output_0.1_-0.1_13000/Six_zebra_models8148.py | Python | gpl-3.0 | 13,920 |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import errno, socket, select, os
from Cookie import SimpleCookie
from contex... | hazrpg/calibre | src/calibre/srv/utils.py | Python | gpl-3.0 | 15,349 |
../../../../../../../../share/pyshared/papyon/service/AddressBook/scenario/contacts/block_contact.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/papyon/service/AddressBook/scenario/contacts/block_contact.py | Python | gpl-3.0 | 100 |
# Speak.activity
# A simple front end to the espeak text-to-speech engine on the XO laptop
# http://wiki.laptop.org/go/Speak
#
# Copyright (C) 2008 Joshua Minor
# Copyright (C) 2014 Walter Bender
# This file is part of Speak.activity
#
# Parts of Speak.activity are based on code from Measure.activity
# Copyright (C) ... | walterbender/speak | sleepy.py | Python | gpl-3.0 | 2,928 |
""" UserProfileDB class is a front-end to the User Profile Database
"""
from __future__ import print_function
__RCSID__ = "$Id$"
import os
import sys
import hashlib
from DIRAC import S_OK, S_ERROR, gLogger, gConfig
from DIRAC.Core.Utilities import Time
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
fr... | fstagni/DIRAC | FrameworkSystem/DB/UserProfileDB.py | Python | gpl-3.0 | 26,525 |
import argparse
import os
from config import *
def main():
parser = argparse.ArgumentParser(prog=os.path.basename(__file__))
globals().update(load_config(parser))
parser.add_argument('--dataset', choices=datasets, required=False)
args = parser.parse_args()
# override default values
if args.... | dsibournemouth/autoweka | scripts/launch_default_experiments.py | Python | gpl-3.0 | 782 |
# -*- coding: utf-8 -*-
import system_tests
class TestFuzzedPoC(metaclass=system_tests.CaseMeta):
url = [
"https://github.com/Exiv2/exiv2/issues/210",
"https://github.com/Exiv2/exiv2/issues/209"
]
filename = system_tests.path("$data_path/2018-01-09-exiv2-crash-002.tiff")
commands = ... | AlienCowEatCake/ImageViewer | src/ThirdParty/Exiv2/exiv2-0.27.5-Source/tests/bugfixes/github/test_CVE_2017_17724.py | Python | gpl-3.0 | 654 |
from .parser import IEMLParser | IEMLdev/propositions-restful-server | ieml/usl/parser/__init__.py | Python | gpl-3.0 | 30 |
# Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk>
#
# 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.
#
# This ... | threatstream/mnemosyne | webapi/admin.py | Python | gpl-3.0 | 2,846 |
__author__ = 'sushil'
class InvalidDateFormat(BaseException):
pass
class DateOutOfRange(BaseException):
pass
class InvalidDate(BaseException):
pass | ayys/siya | pyBSDate/cexceptions.py | Python | gpl-3.0 | 162 |
"""Example of how to convert a RayTransform operator to a tensorflow layer.
This example is similar to ``tensorflow_layer_matrix``, but demonstrates how
more advanced operators, such as a ray transform, can be handled.
"""
from __future__ import print_function
import tensorflow as tf
import numpy as np
import odl
imp... | kohr-h/odl | odl/contrib/tensorflow/examples/tensorflow_layer_ray_transform.py | Python | mpl-2.0 | 1,582 |
#!/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet Zika modeling interface.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/zika
#
# This Source Code Form is... | ecaldwe1/zika | website/mixins.py | Python | mpl-2.0 | 1,140 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import logg... | petrjasek/superdesk-ntb | server/ntb/io/feeding_services/newsworthy.py | Python | agpl-3.0 | 6,489 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | is06/navitia | source/monitor/monitor_kraken/app.py | Python | agpl-3.0 | 3,672 |
from django.db import models
# Create your models here.
from core.models import BillingSchedule
from core.models import Bill
from core.models import Account
from core.models import FileRepo
from core.models import Config
from core.models import Task | tombs/Water-Billing-System | waterbilling/tasks/models.py | Python | agpl-3.0 | 250 |
"""
Classes used to model the roles used in the courseware. Each role is responsible for checking membership,
adding users, removing users, and listing members
"""
import logging
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from django.contrib.auth.models import User
from opaque_keys.ed... | ahmedaljazzar/edx-platform | common/djangoapps/student/roles.py | Python | agpl-3.0 | 13,043 |
# -*- coding: utf-8 -*-
"""WebUI."""
from .websocket import WebsocketProxyHandler
def create_webapp(naumanni, **kwargs):
"""App factory.
:param CircleCore core: CircleCore Core
:param str base_url: ベースURL
:param int ws_port: Websocket Port Number
:return: WebUI App
:rtype: CCWebApp
"""
... | glucoseinc/naumanni-server | naumanni/web/__init__.py | Python | agpl-3.0 | 422 |
#!/usr/bin/env python
import os
import sys
import dotenv
dotenv.read_dotenv()
if __name__ == "__main__":
ENVIRONMENT = os.getenv('ENVIRONMENT')
if ENVIRONMENT == 'STAGING':
settings = 'staging'
elif ENVIRONMENT == 'PRODUCTION':
settings = 'production'
else:
settings = 'devel... | GetBlimp/boards-backend | manage.py | Python | agpl-3.0 | 584 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | rosenvladimirov/addons | printer_tray/__openerp__.py | Python | agpl-3.0 | 1,538 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video_pipeline', '0001_initial'),
]
operations = [
migrations.AddField(
m... | ESOedX/edx-platform | openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py | Python | agpl-3.0 | 837 |
#!/usr/bin/python
import os
import selinux
import tempfile
import unittest
import blivet
from tests import loopbackedtestcase
import blivet.formats.fs as fs
from blivet.size import Size
@unittest.skipUnless(selinux.is_selinux_enabled() == 1, "SELinux is disabled")
class SELinuxContextTestCase(loopbackedtestcase.LoopB... | vojtechtrefny/blivet | tests/formats_test/selinux_test.py | Python | lgpl-2.1 | 2,792 |
# -*- coding: utf-8 -*-
# Copyright(C) 2018 Phyks
#
# This file is part of weboob.
#
# weboob 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 ... | vicnet/weboob | weboob/tools/capabilities/housing/housing_test.py | Python | lgpl-3.0 | 5,981 |
# coding: utf-8
#This file is part of numword. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
'''
numword for EN_GB
'''
from numword_en import NumWordEN
class NumWordENGB(NumWordEN):
'''
NumWord EN_GB
'''
def currency(self, val, longva... | soshial/text-normalization | numword/numword_en_gb.py | Python | lgpl-3.0 | 1,631 |
# -*- Mode:Python -*-
##########################################################################
# #
# Guacamole Tree printer #
# ... | vrsys/avango | avango-utils/python/_guajacum.py | Python | lgpl-3.0 | 9,600 |
# -*- coding: utf-8 -*-
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``args``:
A dictionary of the arguments being sent to Request().
``pre_request``:
The Request object, directly before being sent.
``post_request``:
The Reques... | DarthMaulware/EquationGroupLeaks | Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/EXPLOITS/ELCO/fosho/requests/hooks.py | Python | unlicense | 898 |
# Generated by Django 2.1 on 2018-11-15 13:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gw_app', '0002_auto_20181101_1545'),
]
operations = [
migrations.AddField(
model_name='nasmodel',
name='enabled',
... | bashmak/djing | gw_app/migrations/0003_nasmodel_enabled.py | Python | unlicense | 410 |
from vt_manager.controller.actions.ActionController import ActionController
from vt_manager.controller.drivers.VTDriver import VTDriver
from vt_manager.models.Action import Action
from vt_manager.models.VirtualMachine import VirtualMachine
import xmlrpclib, threading, logging, copy
from vt_manager.communication.utils.X... | dana-i2cat/felix | vt_manager/src/python/vt_manager/controller/dispatchers/xmlrpc/InformationDispatcher.py | Python | apache-2.0 | 7,769 |
import numbers
from six import string_types
from pypif.obj.common.pio import Pio
from pypif.obj.common.scalar import Scalar
from pypif.obj.common.file_reference import FileReference
class Value(Pio):
"""
Information about a scalar, vector, or matrix, or a list of one of those.
"""
def __init__(self, ... | maxhutch/pypif | pypif/obj/common/value.py | Python | apache-2.0 | 4,437 |
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
# Import Salt Libs
from salt import acl
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
)
from salttesting.helpers import ensure_in_syspath
ensure_i... | stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/acl/client_test.py | Python | apache-2.0 | 1,751 |
# Monary - Copyright 2011-2013 David J. C. Beach
# Please see the included LICENSE.TXT and NOTICE.TXT for licensing information.
from time import time
class profile(object):
def __init__(self, name):
self._name = name
def __enter__(self):
self._start = time()
def __e... | ksuarz/mongo-monary-driver | timing/profile.py | Python | apache-2.0 | 429 |
import pytest
from indy import IndyError
from indy import did
from indy import wallet
from indy.error import ErrorCode
@pytest.mark.asyncio
@pytest.mark.parametrize("wallet_handle_cleanup", [False])
async def test_import_wallet_works(wallet_handle, wallet_config, credentials, export_config):
(_did, _verkey) = aw... | srottem/indy-sdk | wrappers/python/tests/wallet/test_import_wallet.py | Python | apache-2.0 | 1,307 |
# Copyright 2015 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... | jeffzheng1/tensorflow | tensorflow/contrib/layers/python/layers/feature_column_ops.py | Python | apache-2.0 | 36,030 |
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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.apa... | Jokeren/neon | neon/visualizations/data.py | Python | apache-2.0 | 7,474 |
#
# 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
# ... | rdo-management/heat | heat/db/sqlalchemy/migrate_repo/versions/024_event_resource_name.py | Python | apache-2.0 | 807 |
import logging
import StringIO
from iso8601 import parse_date
from datetime import datetime
from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from lr.model.base_model import appConfig
from lr.lib.base import BaseController, render
import json
impo... | jimklo/LearningRegistry | LR/lr/controllers/extract.py | Python | apache-2.0 | 10,398 |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from http.cookiejar import LWPCookieJar
from pants.process.lock import OwnerPrintingInterProcessFileLock
from pants.subsystem.subsystem import Subsystem
from pants.util.dirutil ... | tdyas/pants | src/python/pants/auth/cookies.py | Python | apache-2.0 | 2,261 |
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | gregbdunn/aws-ec2rescue-linux | tools/moduletests/unit/test_arpcache.py | Python | apache-2.0 | 12,661 |
#!/usr/bin/env python
#
# Copyright 2017 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 require... | frlen/simian | src/tests/simian/auth/x509_test.py | Python | apache-2.0 | 37,278 |
# 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 os
import sys
im... | djkonro/client-python | kubernetes/test/test_v1beta1_pod_security_policy_list.py | Python | apache-2.0 | 967 |
#__author__ = 'hello'
# -*- coding: cp936 -*-
import re
import os
import random
import json
import string
import ctypes
from myexception import *
PATH = './img/'
dm2 = ctypes.WinDLL('./CrackCaptchaAPI.dll')
if not os.path.exists('./img'):
os.mkdir('./img')
def str_tr(content):
instr = "0123456789"
outs... | dading/iphone_order | util.py | Python | apache-2.0 | 3,365 |
# 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 u... | Huyuwei/tvm | tests/python/relay/test_pass_alter_op_layout.py | Python | apache-2.0 | 22,068 |
"""Let's Encrypt client errors."""
class Error(Exception):
"""Generic Let's Encrypt client error."""
class AccountStorageError(Error):
"""Generic `.AccountStorage` error."""
class AccountNotFound(AccountStorageError):
"""Account not found error."""
class ReverterError(Error):
"""Let's Encrypt Re... | mitnk/letsencrypt | letsencrypt/errors.py | Python | apache-2.0 | 2,342 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | sandeepdsouza93/TensorFlow-15712 | tensorflow/python/client/timeline_test.py | Python | apache-2.0 | 7,065 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudwatt
# 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/licen... | eltonkevani/tempest_el_env | tempest/api/object_storage/test_container_quotas.py | Python | apache-2.0 | 4,616 |
from .Node import error
SYNTAX_NODE_SERIALIZATION_CODES = {
# 0 is 'Token'. Needs to be defined manually
# 1 is 'Unknown'. Needs to be defined manually
'UnknownDecl': 2,
'TypealiasDecl': 3,
'AssociatedtypeDecl': 4,
'IfConfigDecl': 5,
'PoundErrorDecl': 6,
'PoundWarningDecl': 7,
'Pou... | atrick/swift | utils/gyb_syntax_support/NodeSerializationCodes.py | Python | apache-2.0 | 7,910 |
"""Support for RFXtrx devices."""
import binascii
from collections import OrderedDict
import logging
import RFXtrx as rfxtrxmod
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
ATTR_STATE,
CONF_DEVICE,
CONF_DEVICES,
CONF_HOST,
CONF_PORT,
EVENT_HOMEA... | nkgilley/home-assistant | homeassistant/components/rfxtrx/__init__.py | Python | apache-2.0 | 13,930 |
def split_camel_case(input):
def remove_camel_case(camel_case_input):
no_camel_case = ""
if len(camel_case_input) <= 0:
return ""
no_camel_case += camel_case_input[0].lower()
for c in camel_case_input[1:]:
if c.isupper():
no_camel_case += "_" +... | blxble/mesh-core-on-nrf | nrf5_sdk/external/nano-pb/generator/camel_case_splitter.py | Python | apache-2.0 | 854 |
# Copyright 2012 Big Switch Networks, 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... | shakamunyi/neutron-dvr | neutron/plugins/bigswitch/plugin.py | Python | apache-2.0 | 51,022 |
# -*- coding: utf-8 -*-
#
# fi-ware-chef_validator documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 15 12:28:39 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | ging/fiware-chef_validator | doc/source/conf.py | Python | apache-2.0 | 9,737 |
# Copyright 2017 OP5 AB
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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... | stackforge/monasca-api | monasca_api/tests/policy/base.py | Python | apache-2.0 | 3,063 |
# -*- Python -*-
import os
import platform
import re
import subprocess
import tempfile
import lit.formats
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
# Configuration file for the 'lit' integration test runner.
# name: The name of this integration test suite.
config.name = ... | google/llvm-propeller | mlir/integration_test/lit.cfg.py | Python | apache-2.0 | 1,725 |
# Copyright 2012 Twitter
#
# 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, softw... | clutchio/clutch | admin_ext/views.py | Python | apache-2.0 | 2,305 |
import unittest
from robot.parsing.model import TestCase, TestCaseFile
from robot.utils.asserts import assert_equals
from robotide.controller.commands import ChangeTag
from robotide.controller.filecontrollers import TestCaseFileController
from robotide.controller.macrocontrollers import TestCaseController
from robotide... | caio2k/RIDE | utest/controller/ui/test_treecontroller.py | Python | apache-2.0 | 6,000 |
from __future__ import print_function
import os
import sys
import warnings
sys.path.insert(1, os.path.join("..","..","..",".."))
import h2o
from h2o.estimators import H2OTargetEncoderEstimator
from h2o.exceptions import H2ODeprecationWarning
from h2o.utils.metaclass import fullname
from tests import pyunit_utils as p... | h2oai/h2o-3 | h2o-py/tests/testdir_algos/targetencoder/pyunit_te_deprecated_params.py | Python | apache-2.0 | 7,090 |
#!/usr/bin/env python
"""Tests the mysql data store."""
import unittest
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
import logging
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_st... | ksmaheshkumar/grr | lib/data_stores/mysql_advanced_data_store_test.py | Python | apache-2.0 | 2,003 |
# The content of this file was generated using the Python profile of libCellML 0.2.0.
from enum import Enum
from math import *
__version__ = "0.3.0"
LIBCELLML_VERSION = "0.2.0"
STATE_COUNT = 3
VARIABLE_COUNT = 19
class VariableType(Enum):
VARIABLE_OF_INTEGRATION = 1
STATE = 2
CONSTANT = 3
COMPUTED... | cellml/libcellml | tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py | Python | apache-2.0 | 5,138 |
# Copyright 2013 - Red Hat, 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 writ... | stackforge/solum | solum/tests/api/controllers/v1/test_trigger.py | Python | apache-2.0 | 14,612 |
#!/usr/bin/env python
"""Test the flow archive."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
from absl import app
import mock
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import paths as rdf_paths
from grr... | dunkhong/grr | grr/server/grr_response_server/gui/selenium_tests/flow_archive_test.py | Python | apache-2.0 | 8,184 |
"""Commands related to networks are in this module"""
import click
import sys
from hil.cli.client_setup import client
@click.group()
def network():
"""Commands related to network"""
@network.command(name='create', short_help='Create a new network')
@click.argument('network')
@click.argument('owner')
@click.opti... | SahilTikale/haas | hil/cli/network.py | Python | apache-2.0 | 2,277 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import gtk
from objects.gradientcolor import GradientColor
from objects.gradient import Gradient
from interfaces.signalizable import Signalizable
class GradientLine(gtk.Viewport):
def __init__(self, moving_callback=None, color_callback=None, gradient=None):
"""
... | jaliste/sanaviron | sanaviron/ui/gradienteditor.py | Python | apache-2.0 | 10,331 |
import argparse
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.command.config import CmdConfig
from dvc.compare import TabularData
from dvc.config import ConfigError
from dvc.exceptions import DvcException
from dvc.types import Dict, List
from dvc.ui import ui
from dvc.utils import form... | dmpetrov/dataversioncontrol | dvc/command/machine.py | Python | apache-2.0 | 16,882 |
import os
from os import walk
templatePath = r'templates/serviceTemplate.txt'
writePath = r'/Source/Api/service-hmlFhirConverter/src/main/java/org/nmdp/hmlfhirconverter/service'
class ServiceGenerator:
def get_template(self):
with open(templatePath, 'r') as fileReader:
return fileReader.read(... | nmdp-bioinformatics/service-hml-fhir-converter | CodeGen/hmlFhirConverterCodeGenerator/codegen/service/ServiceGenerator.py | Python | apache-2.0 | 776 |
#coding:UTF-8
"""
磁盘监控模块
"""
from config import disk
from lib import core
import os,re
def init():
"对外接口"
sign=True
for t in disk.DISK_PATH:
warn,data=check(t)
if not warn:
login_time=time.time()
message="磁盘监控预警提示,磁盘使用率超过%s"%(disk.DISK_USED)+"%\n监控结果:"+data
... | yubang/smallMonitor | lib/disk.py | Python | apache-2.0 | 903 |
from a10sdk.common.A10BaseClass import A10BaseClass
class DfBitTransparency(A10BaseClass):
"""Class Description::
Add an empty IPv6 fragmentation header if IPv4 DF bit is zero (default:disabled).
Class df-bit-transparency supports CRUD Operations and inherits from `common/A10BaseClass`.
This cla... | amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_nat64_fragmentation_df_bit_transparency.py | Python | apache-2.0 | 1,367 |
# Copyright (c) 2013 Bull.
#
# 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, sof... | paramite/blazar | climate/tests/api/v1/oshosts/test_service.py | Python | apache-2.0 | 1,584 |
import dpkt
import socket
import logging
l = logging.getLogger("simuvex.s_pcap")
class PCAP(object):
def __init__(self,path, ip_port_tup, init=True):
self.path = path
self.packet_num = 0
self.pos = 0
self.in_streams = []
self.out_streams = []
#self.in_buf = ''
... | chubbymaggie/simuvex | simuvex/s_pcap.py | Python | bsd-2-clause | 2,173 |
from syslog import syslog
module_name = "Syslog"
config = {
"prefix": "Default Prefix"
}
def handle_alert(message):
syslog("{} - {}".format(config["prefix"], message))
| camerongray1515/Prophasis | application/prophasis_common/prophasis_common/alert_modules/syslog.py | Python | bsd-2-clause | 179 |
#
# CORE
# Copyright (c)2010-2013 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# authors: Tom Goff <thomas.goff@boeing.com>
# Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
session.py: defines the Session class used by the core-daemon daemon program
that manages a CORE ses... | D3f0/coreemu | daemon/core/session.py | Python | bsd-2-clause | 46,224 |
"""
sphinxcontrib.httpdomain
~~~~~~~~~~~~~~~~~~~~~~~~
The HTTP domain for documenting RESTful HTTP APIs.
:copyright: Copyright 2011 by Hong Minhee
:license: BSD, see LICENSE for details.
"""
import re
from docutils import nodes
from docutils.parsers.rst.roles import set_classes
from pygments.l... | cutoffthetop/httpdomain | sphinxcontrib/httpdomain.py | Python | bsd-2-clause | 16,298 |
from lino.api import dd
class Tag(dd.Model):
name = dd.CharField(max_length=100)
def __str__(self):
return self.name
@dd.receiver(dd.auto_create)
def my_auto_create_handler(sender, **kw):
print("My handler was called with {}".format(sender))
| lino-framework/book | lino_book/projects/auto_create/models.py | Python | bsd-2-clause | 267 |
from pathutils import full_path
CONFIG = {
"entityid" : "urn:mace:example.com:saml:roland:sp",
"name" : "urn:mace:example.com:saml:roland:sp",
"description": "My own SP",
"service": {
"sp": {
"endpoints":{
"assertion_consumer_service": ["http://lingon.catalogix.se:80... | arbn/pysaml2 | tests/sp_2_conf.py | Python | bsd-2-clause | 1,571 |
# Copyright (c) 2014 Alexander Bredo
# 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, this list of conditions ... | alexbredo/ipfix-receiver | base/cache.py | Python | bsd-2-clause | 4,389 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'county_vmt.ui'
#
# Created: Thu Nov 21 11:10:25 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... | anl-tracc/polaris-analyser | county_vmt.py | Python | bsd-3-clause | 1,297 |
import itertools
from django.conf import settings
from django.db import models
from django.utils import translation as translation_utils
from olympia.addons.query import IndexCompiler, IndexQuery
def order_by_translation(qs, fieldname):
"""
Order the QuerySet by the translated field, honoring the current a... | andymckay/addons-server | src/olympia/translations/query.py | Python | bsd-3-clause | 5,271 |
from .iqr_session import IqrSession
from .iqr_controller import IqrController
__all__ = [
'IqrController',
'IqrSession',
]
| Purg/SMQTK | python/smqtk/iqr/__init__.py | Python | bsd-3-clause | 132 |
import pytz
from django.conf import settings
from django.utils.dates import MONTHS, WEEKDAYS, WEEKDAYS_ABBR
from django.utils.translation import gettext as _
# Wagtail languages with >=90% coverage
# This list is manually maintained
WAGTAILADMIN_PROVIDED_LANGUAGES = [
('ar', 'Arabic'),
('ca', 'Catalan'),
... | gasman/wagtail | wagtail/admin/localization.py | Python | bsd-3-clause | 4,210 |
class NamespaceAlreadyRegistered(Exception):
pass
class NoParentFound(Exception):
pass
| rsalmaso/django-cms | menus/exceptions.py | Python | bsd-3-clause | 97 |
"""This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Histogram class which lets you build your histograms just passing
the arguments to the Chart class and calling the proper functions.
"""
#-------------------------------------------------------------... | srinathv/bokeh | bokeh/charts/builder/histogram_builder.py | Python | bsd-3-clause | 3,598 |
#!/usr/bin/env python
import sys
sys.path.extend(['.', '..'])
import unittest
suite = unittest.TestLoader().loadTestsFromNames(
[
'test_c_lexer',
'test_c_ast',
'test_general',
'test_c_parser',
]
)
unittest.TextTestRunner(verbosity=1).run(suite)
| kk1987/pycparser | tests/all_tests.py | Python | bsd-3-clause | 294 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Fixes usercache processing
# If there are any errors in the usercache processing, fix them and reload the data
# Basic flow
# - Copy data back to user cache
# - Attempt ... | shankari/e-mission-server | bin/debug/fix_usercache_processing.py | Python | bsd-3-clause | 1,917 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.