text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# Copyright 2010, 2012 Canonical Ltd. This software is licensed under
# the GNU Affero General Public License version 3 (see the file
# LICENSE).
import logging
import re
from datetime import datetime
from django.core.validators import validate_email
from django.db import models
from django.utils.translation import... | miing/mci_migo | identityprovider/models/emailaddress.py | Python | agpl-3.0 | 4,191 | 0 |
# -*- coding: utf-8 -*-
"""Terrain slope calculation, and ground range spacing calculation from
DEM.
Author: Michael Denbina
Copyright 2016 California Institute of Technology. All rights reserved.
United States Government Sponsorship acknowledged.
This program is free software: you ... | mdenbina/kapok | kapok/lib/slope.py | Python | gpl-3.0 | 2,658 | 0.007524 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RTriebeard(RPackage):
"""triebeard: 'Radix' Trees in 'Rcpp'"""
homepage = "https://gi... | LLNL/spack | var/spack/repos/builtin/packages/r-triebeard/package.py | Python | lgpl-2.1 | 652 | 0.003067 |
Flask==0.10.1
Jinja2==2.7.2
MarkupSafe==0.18
Werkzeug==0.9.4
distribute==0.6.31
itsdangerous==0.23
lxml==3.3.1
pygal==1.3.1
wsgiref==0.1.2
| birknilson/oyster | examples/piechart/requirements.py | Python | mit | 139 | 0.064748 |
import pickle
from sklearn.model_selection import train_test_split
from preprocess.feature import FeatureFile
from network.model import FC1Net, FC4Net, MLPModel, SaNet
from network.evaluate import NetEvaluator
class Trainer:
def __init__(self, feature_file=None):
self.exclude_features_keys = None
... | NTHU-CVLab/ActivityProps | network/trainer.py | Python | apache-2.0 | 2,961 | 0.001351 |
"""Tests for the pylint checker in :mod:`pylint.extensions.check_elif
"""
import os
import os.path as osp
import unittest
from pylint import checkers
from pylint.extensions.check_elif import ElseifUsedChecker
from pylint.lint import PyLinter
from pylint.reporters import BaseReporter
class TestReporter(BaseReporter)... | justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/pylint/test/extensions/test_elseif_used.py | Python | gpl-3.0 | 1,359 | 0 |
# importing 'argv' from 'sys' library
from sys import argv
# assigning the variables 'script' (which is the name of the script), and 'filename' (which is the name of a file) to the command line argument array 'argv'
script, filename = argv
# printing string with formatter representing 'filename'
print "We're going to ... | SaileshPatel/Python-Exercises | ex16.py | Python | mit | 1,257 | 0.001591 |
"""Test Google Smart Home."""
from unittest.mock import patch, Mock
import pytest
from homeassistant.core import State, EVENT_CALL_SERVICE
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS, __version__
from homeassistant.setup import async_setup_component
from homeassistant.components import camer... | joopert/home-assistant | tests/components/google_assistant/test_smart_home.py | Python | apache-2.0 | 28,484 | 0.000807 |
# Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions a... | xenserver/auto-cert-kit | autocertkit/operations_tests.py | Python | bsd-2-clause | 13,353 | 0.001573 |
import os.path
from enum import Enum
class NamedEnum(Enum):
def __init__(self, name):
self.display_name = name
@classmethod
def get_names(cls):
return [name for name, _ in cls.__members__.items()]
class Role(NamedEnum):
solver = ('Solver')
tester = ('Tester')
class Status(NamedE... | jsannemo/programming-battle | battle/battle/api/__init__.py | Python | bsd-2-clause | 1,247 | 0.005613 |
# Copyright (c) 2018 PaddlePaddle 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 app... | baidu/Paddle | python/paddle/fluid/tests/unittests/test_pool3d_op.py | Python | apache-2.0 | 13,221 | 0.000454 |
################################################################################
# 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... | apache/flink | flink-python/pyflink/datastream/tests/test_connectors.py | Python | apache-2.0 | 20,161 | 0.004018 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_helmet.iff"
re... | obi-two/Rebelion | data/scripts/templates/object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_helmet.py | Python | mit | 494 | 0.044534 |
import os
import operator
import sys
from collections import defaultdict
import matplotlib.pyplot as pp
import CommonConf
BASE = 'ksp'
algs = ['mcf', 'raeke', 'edksp', 'vlb', 'ksp', 'ecmp']
def setupMPPDefaults():
pp.rcParams['font.size'] = 66
pp.rcParams['mathtext.default'] = 'regular'
pp.rcParams['ytick... | merlin-lang/kulfi | simulate/viz/LatencyDiffPoints.py | Python | lgpl-3.0 | 5,142 | 0.004084 |
from flask import Blueprint, render_template
from ...middlewares import auth_manager
from .middlewares import s
from ...container import container
account = Blueprint('account', __name__, url_prefix='/account')
def view():
account = container.account
return render_template('accounts/view.html', account=acco... | masom/doorbot-api-python | doorbot/views/dashboard/account.py | Python | mit | 610 | 0.001639 |
import pytest
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.networks.provider import NetworkProviderCollection
from cfme.utils import testgen
from cfme.utils.appliance.implementations.ui import na... | okolisny/integration_tests | cfme/tests/networks/test_sdn_crud.py | Python | gpl-2.0 | 1,613 | 0.00124 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 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 your optio... | sam-m888/gprime | gprime/filters/rules/media/_hasnotematchingsubstringof.py | Python | gpl-2.0 | 1,769 | 0.005653 |
from datetime import datetime, tzinfo
try:
import pytz
except ImportError:
pytz = None
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import timezone
register = Library()
# HACK: datetime is an old-style class, create a new-style equivalent
# so ... | adrianholovaty/django | django/templatetags/tz.py | Python | bsd-3-clause | 5,488 | 0 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_chest_plate.i... | anhstudios/swganh | data/scripts/templates/object/tangible/wearables/armor/stormtrooper/shared_armor_stormtrooper_chest_plate.py | Python | mit | 507 | 0.043393 |
#!/usr/bin/env python3
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google/pigweed | pw_presubmit/py/presubmit_test.py | Python | apache-2.0 | 1,944 | 0 |
# coding: utf-8
#
# Copyright 2012 NAMD-EMAP-FGV
#
# This file is part of PyPLN. You can get more information at: http://pypln.org/.
#
# PyPLN 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 o... | NAMD/pypln.backend | tests/test_worker_bigrams.py | Python | gpl-3.0 | 2,288 | 0.000874 |
#{#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK core.
#
# REDHAWK core 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 Fre... | RedhawkSDR/framework-codegen | redhawk/codegen/jinja/python/ports/templates/generic.provides.py | Python | lgpl-3.0 | 1,314 | 0.005327 |
from phystricks import *
def exCircleThree():
pspict,fig = SinglePicture("exCircleThree")
circle = Circle(Point(0,0),1.5)
circle.angleI = 45
circle.angleF = 380
circle.wave(0.1,0.1)
circle.parameters.color = "green"
circleB = Circle(Point(0,0),1.5)
circleB.angleI = circle.angleF-360
... | LaurentClaessens/phystricks | testing/demonstration/exCircleThree.py | Python | gpl-3.0 | 652 | 0.015337 |
from Framework.Resposta import Resposta
from Models.Grau.Grau import Grau as ModelGrau
class RespostaEditar(Resposta):
def __init__(self,mensagem):
self.corpo = mensagem
| AEDA-Solutions/matweb | backend/Models/Grau/RespostaEditar.py | Python | mit | 179 | 0.039106 |
# -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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... | 1flow/1flow | oneflow/core/admin/__init__.py | Python | agpl-3.0 | 2,818 | 0.00284 |
"""
API for communicating with the i3 window manager.
"""
import json
import subprocess
class I3Msg(object):
"""Send messages to i3."""
def __init__(self, socket=None, msgbin=None):
"""
Initialize the messager.
@param socket The socket to connect to i3 via.
@param msgbin The... | BlueDragonX/fm-dot | i3/lib/i3.py | Python | bsd-3-clause | 4,205 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('forums', '0017_auto_20150517_1552'),
]
operations = [
migrations.AlterField(
model_name='post',
name=... | Aurora0000/descant | forums/migrations/0018_auto_20150518_1634.py | Python | mit | 467 | 0.002141 |
#!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['preview'],
... | jimi-c/ansible | lib/ansible/modules/storage/netapp/sf_snapshot_schedule_manager.py | Python | gpl-3.0 | 13,004 | 0.002538 |
#!/usr/bin/python
# 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',
'supported_by': 'community',
'status': ['preview']
}
... | tersmitten/ansible | lib/ansible/modules/remote_management/lxca/lxca_cmms.py | Python | gpl-3.0 | 4,442 | 0.001576 |
# Generated by Django 3.0.5 on 2020-04-07 10:39
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("spectator_events", "0041_event_ticket"),
]
operations = [
migrations.AlterField(
model_name="venue... | philgyford/django-spectator | spectator/events/migrations/0042_auto_20200407_1039.py | Python | mit | 1,302 | 0 |
def create_pos_n_neg():
for file_type in ['neg']:
for img in os.listdir(file_type):
if file_type == 'pos':
line = file_type+'/'+img+' 1 0 0 50 50\n'
with open('info.dat','a') as f:
f.write(line)
elif file_type == 'neg':
... | Tianyi94/EC601Project_Somatic-Parkour-Game-based-on-OpenCV | Old Code/ControlPart/Create_pos&neg.py | Python | mit | 444 | 0.006757 |
# -*- 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-policy-troubleshooter | google/cloud/policytroubleshooter_v1/services/iam_checker/async_client.py | Python | apache-2.0 | 11,763 | 0.00204 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... | imbstack/pasquino | migrations/env.py | Python | mit | 2,643 | 0.001135 |
##
# api.py
#
# This file is the workhorse for the the entire web application.
# It implements and provides the API required for the iOS portion
# of the project as well as interacting with Google's datastore
# for persistent storage of our models.
##
# for sending mail
from google.appengine.api import mail
# Used i... | zaffra/Inquire | GAE/api.py | Python | bsd-3-clause | 17,740 | 0.003439 |
import numpy as np
import os
# APOGEE-APOKASC overlap
inputf = "/home/annaho/TheCannon/examples/example_apokasc/apokasc_DR12_overlap.npz"
apogee_apokasc = np.load(inputf)['arr_0']
# APOGEE-LAMOST overlap
inputf = "/home/annaho/TheCannon/examples/example_DR12/Data"
apogee_lamost = np.array(os.listdir(inputf))
# APO... | annayqho/TheCannon | code/apokasc_lamost/kepler_apogee_lamost_overlap.py | Python | mit | 2,584 | 0.011223 |
#
# OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc.
##############################################################################
#
# OpenCenter is licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. This
# version of ... | rcbops/opencenter | tests/test_expressions.py | Python | apache-2.0 | 11,034 | 0 |
from os.path import join, dirname
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_equal
import pytest
from pytest import raises as assert_raises
from scipy.fftpack._realtransforms import (
dct, idct, dst, idst, dctn, idctn, dstn, idstn)
# Matlab reference data
MDATA = np.load(join(... | mdhaber/scipy | scipy/fftpack/tests/test_real_transforms.py | Python | bsd-3-clause | 23,941 | 0.000877 |
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# 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 ... | Micronaet/micronaet-mx8 | sale_box_volume/__openerp__.py | Python | agpl-3.0 | 1,492 | 0.002011 |
from datetime import tzinfo, timedelta, datetime
ZERO = timedelta(0)
HOUR = timedelta(hours=1)
# A UTC class.
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return ZERO
utc = UTC()
# A class building... | MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Doc/includes/tzinfo-examples.py | Python | gpl-2.0 | 5,063 | 0.003555 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file include_bib.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# authors Richard Heck and [SchAirport]
# Full author contact details are available in file CREDITS
# This script is intended to include a BibTe... | hashinisenaratne/HSTML | lib/scripts/include_bib.py | Python | gpl-2.0 | 2,972 | 0.01817 |
# -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, fields, exceptions, api
from openerp.tools.translate import _
class ProjectTemplateWizard(models.TransientModel):
_name = 'project.template.wizard'
project_id = fields.Many2one(
comodel... | Endika/event | event_project/wizard/project_template_wizard.py | Python | agpl-3.0 | 1,219 | 0 |
bind = 'unix:/run/emojiweather.sock'
pythonpath = 'emojiweather'
workers = 2
accesslog = '-' | richardcornish/smsweather | gunicorn.py | Python | bsd-3-clause | 95 | 0.010526 |
from revscoring.features import user
from revscoring.features.modifiers import not_, log
from ..features import diff, revision
class properties:
"""
Mapping of english descriptions to property identifiers
"""
IMAGE = 'P18'
SEX_OR_GENDER = 'P21'
COUNTRY_OF_CITIZENSHIP = 'P27'
INSTANCE_OF =... | wiki-ai/wb-vandalism | wb_vandalism/feature_lists/wikidata.py | Python | mit | 6,094 | 0.003446 |
from .expression import Expression, Bool, BitVec, Array, BitVecConstant, issymbolic # noqa
from .constraints import ConstraintSet # noqa
from .solver import * # noqa
from . import operators as Operators # noqa
import logging
logger = logging.getLogger(__name__)
| trailofbits/manticore | manticore/core/smtlib/__init__.py | Python | agpl-3.0 | 268 | 0 |
import time, sys, os, helper
from comodit_client.api import Client
from comodit_client.api.exceptions import PythonApiException
from comodit_client.rest.exceptions import ApiException
from combox.config import config
from helper import create_host, get_short_hostname, exec_cmd, exec_cmds, fork_cmd
def stop():
pr... | comodit/combox | combox/control.py | Python | mit | 569 | 0.010545 |
import sys, os, platform, math
import Sofa
import Flexible.IO
import Flexible.sml
import SofaPython.Tools
from SofaPython.Tools import listToStr as concat
import numpy
from numpy import linalg
# variables
__file = __file__.replace('\\', '/') # windows
CURRENTDIR = os.path.dirname(os.path.abspath(__fil... | FabienPean/sofa | applications/plugins/SofaPython/examples/sceneDataIO_write.py | Python | lgpl-2.1 | 5,843 | 0.004963 |
#!/usr/bin/python3
import _thread
import RPi.GPIO as GPIO
import socket
import time
from time import sleep
from sys import exit
import datetime
#import MySQLdb
# Start task command
# sleep 30 && python /home/pi/Scripts/Sprinkler/Sprinkler.py > /home/pi/Scripts/Sprinkler/log.txt 2>&1
# Set GPIO output poi... | Makerblaker/Sprinkler | server.py | Python | gpl-3.0 | 4,160 | 0.040625 |
# -*- coding: utf-8 -*-
"""
Class stores integer values for various types of moves in algebraic notation.
Copyright © 2016 Aubhro Sengupta. All rights reserved.
"""
MOVEMENT = 0
CAPTURE = 1
KING_SIDE_CASTLE = 2
QUEEN_SIDE_CASTLE = 3
EN_PASSANT = 4
PROMOTE = 5
CAPTURE_AND_PROMOTE = 6
NOT_IMPLEMENTED = 7
LONG... | LordDarkula/chess_py | chess_py/core/algebraic/notation_const.py | Python | mit | 330 | 0 |
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | google/openhtf | openhtf/util/xmlrpcutil.py | Python | apache-2.0 | 4,133 | 0.008226 |
# -*- encoding: utf-8 -*-
__author__ = 'kotaimen'
__date__ = '2/19/15'
class FormatError(Exception):
pass
class InvalidMapType(FormatError):
pass
class InvalidTileFormat(FormatError):
pass
class NoMatchingMapWriter(FormatError):
pass
| Kotaimen/stonemason | stonemason/formatbundle/exceptions.py | Python | mit | 259 | 0 |
# 1.
print_log('\n1. Creates Issuer wallet and opens it to get handle.\n')
await
wallet.create_wallet(pool_name, issuer_wallet_name, None, None, None)
issuer_wallet_handle = await
wallet.open_wallet(issuer_wallet_name, None, None)
# 2.
print_log('\n2. Cre... | srottem/indy-sdk | docs/how-tos/negotiate-proof/python/step2.py | Python | apache-2.0 | 2,916 | 0.006859 |
import gdb
import pwndbg.decorators
import pwndbg.events
import pwndbg.gdbutils
import pwndbg.memoize
from pwndbg.color import disable_colors
from pwndbg.color import message
funcs_list_str = ', '.join(message.notice('$' + f.name) for f in pwndbg.gdbutils.functions.functions)
hint_lines = (
'loaded %i commands. ... | pwndbg/pwndbg | pwndbg/prompt.py | Python | mit | 1,730 | 0.001734 |
# 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 ... | Azure/azure-sdk-for-python | sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value.py | Python | mit | 3,167 | 0.000316 |
"""
Sample a specific geometry or set of geometries.
"""
import numpy as np
import nomad.core.glbl as glbl
import nomad.core.trajectory as trajectory
import nomad.core.log as log
def set_initial_coords(wfn):
"""Takes initial position and momentum from geometry specified in input"""
coords = glbl.properties['i... | mschuurman/FMSpy | nomad/initconds/explicit.py | Python | lgpl-3.0 | 1,004 | 0.003984 |
# coding: utf-8
def ugettext(message):
'''返回原字符串
为了使用 _('') 方式标记字符串
'''
return message
| gwind/YWeb | yweb/yweb/utils/i18n.py | Python | mit | 142 | 0 |
# Copyright 2013 Mario Graff Guerrero
# 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 wri... | mgraffg/simplegp | SimpleGP/tests/test_gpmae.py | Python | apache-2.0 | 1,069 | 0.000935 |
# Source Generated with Decompyle++
# File: session_recording.pyc (Python 2.5)
from __future__ import absolute_import
from pushbase.session_recording_component import FixedLengthSessionRecordingComponent
class SessionRecordingComponent(FixedLengthSessionRecordingComponent):
def __init__(self, *a, **k):
... | phatblat/AbletonLiveMIDIRemoteScripts | Push2/session_recording.py | Python | mit | 842 | 0.014252 |
__all__ = ["md5", "size", "calculate", "scan"]
from md5hash.md5hash import md5, size, calculate, scan
| valsaven/md5hash | md5hash/__init__.py | Python | mit | 103 | 0 |
"""
Module to control libvirtd service.
"""
import re
import logging
import aexpect
from avocado.utils import path
from avocado.utils import process
from avocado.utils import wait
from virttest import libvirt_version
from virttest import utils_split_daemons
from . import remote as remote_old
from . import utils_misc... | sathnaga/avocado-vt | virttest/utils_libvirtd.py | Python | gpl-2.0 | 15,212 | 0.000197 |
# Copyright (c) 2016-present, Facebook, 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... | xzturn/caffe2 | caffe2/python/rnn/__init__.py | Python | apache-2.0 | 821 | 0.001218 |
# coding=utf-8
import abc
import logging
import tempfile
from bireus.client.download_service import AbstractDownloadService
from bireus.client.notification_service import NotificationService
from bireus.shared import *
from bireus.shared.diff_head import DiffHead
from bireus.shared.diff_item import DiffItem
from bireu... | Brutus5000/BiReUS | bireus/client/patch_tasks/base.py | Python | mit | 3,803 | 0.003681 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import time
import functools
import random
import inspect
from ._compat import string_types
from .client import Client
from nsq import protocol
from . import async
logger = logging.getLogger(__name__)
class Writer(Client):
"""
A ... | virtuald/pynsq | nsq/writer.py | Python | mit | 7,774 | 0.002059 |
import errno
import os
import pwd
import shutil
import sys
from jinja2 import Environment, FileSystemLoader
class TutorialEnv:
LOCAL_MACHINE = ("Local Machine Condor Pool", "submit-host")
USC_HPCC_CLUSTER = ("USC HPCC Cluster", "usc-hpcc")
OSG_FROM_ISI = ("OSG from ISI submit node", "osg")
XSEDE_BOSC... | pegasus-isi/pegasus | packages/pegasus-python/src/Pegasus/init-old.py | Python | apache-2.0 | 14,973 | 0.001069 |
# -*- 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):
# Changing field 'Graph.slug'
db.alter_column('muparse_graph', 'slug', self.gf('django.db.models.fields.Slu... | grnet/mupy | muparse/migrations/0004_auto__chg_field_graph_slug__chg_field_graph_name.py | Python | gpl-3.0 | 4,828 | 0.007457 |
# Copyright (c) 2015 Mirantis, 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 writin... | scripnichenko/glance | glance/db/sqlalchemy/models_artifacts.py | Python | apache-2.0 | 12,959 | 0 |
from django.shortcuts import render_to_response,RequestContext
from django.http import HttpResponse,HttpResponseRedirect
from urllib import urlencode
from time import sleep
from vertex.models import *
from django.core.exceptions import ObjectDoesNotExist
from login.views import authDetail
def home(request):
if not a... | bardia-heydarinejad/Graph | home/views.py | Python | mit | 852 | 0.038732 |
import unittest
from efront import repo
from mock import Mock
class TestTarget(unittest.TestCase):
def setUp(self):
self.target = repo.Target("myTarget")
self.target.root_names = ["git", "svn"]
def test_print_svn(self):
self.target.add("svn")
self.assertEqual(str(s... | sbergot/python | efront/test/testTarget.py | Python | bsd-3-clause | 696 | 0.002874 |
# -*- coding: utf-8 -*-
from protoLib.getStuff import getDjangoModel
from protoExt.utils.utilsWeb import JsonError , doReturn
from . import validateRequest
import json
from django.contrib.admin.sites import site
from protoExt.utils.utilsBase import traceError
def protoExecuteAction(request):
""" Ejecuta una ... | DarioGT/docker-carra | src/protoExt/views/protoActionAction.py | Python | mit | 3,186 | 0.015066 |
class CSharpReference():
def __init__(self,):
self.reference_object = None
self.line_in_file = -1
self.file_name = ''
| adrianogil/SublimeUnityIntel | unityparser/csharp/csharp_reference.py | Python | mit | 147 | 0 |
"""OpenID Extension modules."""
__all__ = ['ax', 'pape', 'sreg']
from openid.extensions.draft import pape5 as pape
| SohKai/ChronoLogger | web/flask/lib/python2.7/site-packages/openid/extensions/__init__.py | Python | mit | 117 | 0 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
astroquery.solarsystem.jpl
--------------------------
a collection of data services provided by JPL
"""
from .sbdb import *
from .horizons import *
from . import *
| imbasimba/astroquery | astroquery/solarsystem/jpl/__init__.py | Python | bsd-3-clause | 235 | 0 |
__author__ = 'ray'
import wave
import numpy as np
wav_1_path = "origin.wav"
wav_2_path = "clap.wav"
wav_out_path = "mixed.wav"
wav_1 = wave.open(wav_1_path, 'rb')
wav_2 = wave.open(wav_2_path, 'rb')
wav_out = wave.open(wav_out_path, 'wb')
len_1 = wav_1.getnframes()
len_2 = wav_2.getnframes()
if len_1>len_2:
w... | raybrshen/pattern_recognition | noise_detection/tools/mix_wav.py | Python | apache-2.0 | 864 | 0.005787 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
"""HITAP Nufus Guncelle
Hitap'a personelin Nufus bilgilerinin guncellenmesini yapar.
"""
from ulakbus.services.personel.hitap.hitap_service import Za... | zetaops/ulakbus | ulakbus/services/personel/hitap/hizmet_nufus_guncelle.py | Python | gpl-3.0 | 1,651 | 0.001821 |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, dist... | bl4ckdu5t/registron | tests/interactive/test_pyqt4.py | Python | mit | 1,490 | 0.00472 |
from functools import wraps
from flask import Flask, request, jsonify, g
import base64
import libs.db_connector as dbconn
import libs.db_query as dao
import libs.json_keys as jkey
import libs.json_builder as jparse
import config.api_config as apiconf
# region constants
DEBUG = True
LOCAL_NETWORK = "0.0.0.0"
V = apicon... | Python3Development/KodiAPI | api.py | Python | gpl-3.0 | 3,710 | 0 |
# import needed models
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
# create user object
class Person(User):
internal_id = models.CharField(max_length=25, null=True, blank=True)
verified = models.NullBoolean... | prakashksinha/playground | bookmarks/models.py | Python | apache-2.0 | 1,100 | 0.012727 |
# -*- coding: utf-8 -*-
''' Small Dictionary '''
class SD:
def translate_in(language):
words = {}
words["English"] = "in"
words["Chinese"] = "在"
words["Dutch"] = "in"
words["French"] = "dans"
words["Italian"] = "nel"
words["Japanese"] = "に"
words["K... | mdmintz/SeleniumBase | seleniumbase/fixtures/words.py | Python | mit | 4,708 | 0 |
# -*- coding: utf-8 -
#
# This file is part of couchdbkit released under the MIT license.
# See the NOTICE for more information.
""" properties used by Document object """
import decimal
import datetime
import re
import time
try:
from collections import MutableSet, Iterable
def is_iterable(c):
retur... | benoitc/couchdbkit | couchdbkit/schema/properties.py | Python | mit | 35,449 | 0.003836 |
#!/usr/bin/env python
u"""
notation3.py - Standalone Notation3 Parser
Derived from CWM, the Closed World Machine
Authors of the original suite:
* Dan Connolly <@@>
* Tim Berners-Lee <@@>
* Yosi Scharf <@@>
* Joseph M. Reagle Jr. <reagle@w3.org>
* Rich Salz <rsalz@zolera.com>
http://www.w3.org/2000/10/swap/notation3.... | mr-niels-christensen/finna-be-octo-archer | briefme/src/main/rdflib/plugins/parsers/notation3.py | Python | gpl-2.0 | 61,070 | 0.002554 |
# 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... | jendap/tensorflow | tensorflow/python/data/experimental/kernel_tests/restructured_dataset_test.py | Python | apache-2.0 | 3,111 | 0.004179 |
import widgy
from widgy.models import Content
from widgy.utils import update_context, render_to_string
@widgy.register
class Adaptive(Content):
def render(self, context):
template = 'widgy/adaptive/render.html'
size = context.get('device_info')
if size['type'] == 'tablet':
t... | zmetcalf/fusionbox-demo-project | adaptive/models.py | Python | gpl-3.0 | 558 | 0 |
#
# The Python Imaging Library.
# $Id: GifImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $
#
# GIF file handling
#
# History:
# 1995-09-01 fl Created
# 1996-12-14 fl Added interlace support
# 1996-12-30 fl Added animation support
# 1997-01-05 fl Added write support, fixed local colour map bug
# 1997-02-23 fl ... | tkaitchuck/nupic | external/linux64/lib/python2.6/site-packages/PIL/GifImagePlugin.py | Python | gpl-3.0 | 10,996 | 0.003183 |
class Solution(object):
def generateParenthesis(self, n):
if n < 1: return []
parens=[]
def generate(p, left, right):
if left:
generate(p + '(', left-1, right)
if right > left:
generate(p + ')', left, right-1)
if not right: ... | ravyg/algorithms | python/22_generateParentheses.py | Python | gpl-3.0 | 529 | 0.009452 |
'''
Name: Weather Application
Author: Redder04
Extra Requirements: Unirest, Mashape Key
Unirest: http://unirest.io/
Mashape: https://www.mashape.com/
Description: This application will connect to a Mashape Weather API. The user will
supply a City or State (I might add GPS Capabilites later) and send the request. The ... | Redder/Weather-App-Python | Weather.py | Python | mit | 4,583 | 0.031857 |
"""
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import decimal
import re
import platform
import sys
import warnings
def _setup_environment(environ):
# Cygwin requires some special voodoo to set the environment variables
... | adambrenecki/django | django/db/backends/oracle/base.py | Python | bsd-3-clause | 40,557 | 0.001381 |
#!/usr/bin/env python
# game.py
#
# Copyright (C) 2013, 2014 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
import stage
import gameloop
import math
import random
import config
import gamestate as gs
direction = (0, 0)
lastPos = (0, 0)
snake = []
speed = 1
ap... | alexaverill/make-snake | snake/game.py | Python | gpl-2.0 | 3,912 | 0.000256 |
# A funny, but common thing you'll see in python scipts is that if __name__ ...
# block below
# To start off, just run this script and see what happens.
# Then run the test and note that it fails in a curious way!
print "I was run - maybe by a test?"
if __name__ == '__main__':
# The problem is that this variab... | marwahaha/python-fundamentals | challenges/04-Functions/B_script_conventions.py | Python | apache-2.0 | 610 | 0 |
import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from apps.admin.utils.exception_handling import ExceptionHandler
from apps.commission.models import Commission
from apps.seller.models.product import Product
from settings.people import support_team
import re
from apps... | tomcounsell/Cobra | apps/public/views/custom_order.py | Python | gpl-2.0 | 4,294 | 0.015137 |
from .registry import Registry
from drole.types import Permission
def action(f):
"""
mark a method as being an action.
"""
if isinstance(f, Permission):
def decorator(decorated):
decorated.action = True
decorated.permission = f
return decorated
re... | wheelcms/wheelcms_axle | wheelcms_axle/actions.py | Python | bsd-2-clause | 3,462 | 0.003177 |
#!/usr/bin/env python
import sys
def run_277853s():
N = 1
while N<16384:
run_277853(N)
N = N*2
def run_277853(N):
cnt = 0
#for (int i = 1; i*i <= N; i = i*2)
i = 1
while i*i <= N:
cnt += 1
print(N, i, cnt)
i = i*4
#print "{:>5}=N {:>5}=cnt".format(N, cnt)
def run_605062s():
N = 1... | dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/testcode/order.py | Python | gpl-2.0 | 768 | 0.041667 |
#
# 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... | prestona/qpid-proton | tests/java/shim/curl.py | Python | apache-2.0 | 1,678 | 0.004768 |
# 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/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/aio/operations/_iot_hub_resource_operations.py | Python | mit | 67,149 | 0.004914 |
"""
This module is about 'property' descriptors.
"""
import sys
from functools import wraps
from easypy.caching import cached_property # public import, for back-compat
_builtin_property = property
def safe_property(fget=None, fset=None, fdel=None, doc=None):
"""
A pythonic property which raises a RuntimeE... | weka-io/easypy | easypy/properties.py | Python | bsd-3-clause | 1,878 | 0.002662 |
#!/usr/bin/env python
import subprocess, shutil, shlex, os
from sys import exit, argv
from netCDF4 import Dataset as NC
import numpy as np
def process_arguments():
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("PISM_PATH")
parser.add_argument("MPIEXEC")
parser.a... | talbrecht/pism_pik06 | test/regression/test_29.py | Python | gpl-3.0 | 4,068 | 0.009095 |
from PyQRNative import *
from PIL.Image import BILINEAR, BICUBIC, ANTIALIAS, NEAREST
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import portrait, A4
from reportlab.lib.units import cm, mm
from StringIO import StringIO
from plant.tag import create_tag
import time
from datetime import datetime
QR_TY... | andbof/plantdb | qr/functions.py | Python | gpl-2.0 | 4,614 | 0.007152 |
"""SCons.Tool.m4
Tool-specific initialization for m4.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to a... | stonekyx/binary | vendor/scons-local-2.3.4/SCons/Tool/m4.py | Python | gpl-3.0 | 2,309 | 0.003898 |
# Version: 6.3
# Architecture: i386
# CompanyName: Microsoft Corporation
# FileDescription: NT Layer DLL
# FileVersion: 6.3.9600.17031 (winblue_gdr.140221-1952)
# InternalName: ntdll.dll
# LegalCopyright: Microsoft Corporation. All rights reserved.
# OriginalFilename: ntdll.dll
# ProductName: Microsoft Windows Operati... | atlas0fd00m/CanCat | cancat/vstruct/defs/windows/win_6_3_i386/ntdll.py | Python | bsd-2-clause | 239,574 | 0.002162 |
from say import *
from say.styling import StyleDef
import six
def test_basic_styling():
fmt = Fmt()
assert fmt('this', style='green+underline') == six.u('\x1b[32;4mthis\x1b[0m')
assert fmt('this', style='bold+red') == six.u('\x1b[31;1mthis\x1b[0m')
def test_readme_example():
fmt = Fmt()
fmt.st... | nrgaway/qubes-tools | builder-tools/libs/say-1.4.2/test/test_styling.py | Python | gpl-2.0 | 4,257 | 0.005168 |
#!/usr/bin/env python
"""
This utility extracts media urls from tweet jsonl.gz and save them as warc records.
Warcio (https://github.com/webrecorder/warcio) is a dependency and before you can use it you need to:
% pip install warcio
You run it like this:
% python media2warc.py /mnt/tweets/ferguson/tweets-0001.jsonl... | edsu/twarc | utils/media2warc.py | Python | mit | 8,273 | 0.003143 |
"""
What
-----
A Markov Chain is a sequence of values where the next value
depends only on the current value (and not past values). It's
basically a really simple state machine, where given the present
state, the future state is conditionally independent of the past.
Thus we can ask the question: Given the present ... | tedlee/markov | markovgen.py | Python | mit | 2,709 | 0.032484 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.