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 |
|---|---|---|---|---|---|---|
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import account_journal
from . import account_tax
from . import acc... | bmya/odoo-argentina | l10n_ar_account/models/__init__.py | Python | agpl-3.0 | 929 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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 = {'status': ['preview'],
... | bearstech/ansible | lib/ansible/modules/network/netscaler/netscaler_cs_action.py | Python | gpl-3.0 | 9,091 | 0.00242 |
"""Some utility functions"""
# Authors: Eric Larson <larsoner@uw.edu>
#
# License: BSD (3-clause)
import warnings
import operator
from copy import deepcopy
import subprocess
import importlib
import os
import os.path as op
import inspect
import sys
import time
import tempfile
import traceback
import ssl
from shutil im... | drammock/expyfun | expyfun/_utils.py | Python | bsd-3-clause | 30,243 | 0 |
# -*- coding: utf-8 -*-
import os
import platform
import subprocess
import unittest
import pytest
import six
from conans.client import tools
from conans.client.conf import get_default_settings_yml
from conans.client.tools.files import which
from conans.client.tools.win import vswhere
from conans.errors import ConanE... | conan-io/conan | conans/test/functional/util/tools_test.py | Python | mit | 5,578 | 0.002868 |
#
# 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
# ... | steveb/heat | heat/db/sqlalchemy/models.py | Python | apache-2.0 | 17,625 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 15:45
from __future__ import unicode_literals
from django.db import migrations
import share.robot
class Migration(migrations.Migration):
dependencies = [
('share', '0001_initial'),
('djcelery', '0001_initial'),
]
operatio... | zamattiac/SHARE | providers/org/sldr/migrations/0001_initial.py | Python | apache-2.0 | 649 | 0 |
from keras.layers.core import Dropout, Flatten
from keras.layers.convolutional import MaxPooling2D, Conv2D
from keras.models import Model
from keras.layers import Input, Dense
FRAME_H = 70
FRAME_W = 180
def build_model():
inp = Input(shape=(FRAME_H, FRAME_W, 3))
x = Conv2D(filters=8, kernel_size=(5, 5), acti... | raghakot/keras-vis | applications/self_driving/model.py | Python | mit | 845 | 0 |
from __future__ import print_function, division
from sympy.core import Basic
from sympy.core.compatibility import xrange
import random
class GrayCode(Basic):
"""
A Gray code is essentially a Hamiltonian walk on
a n-dimensional cube with edge length of one.
The vertices of the cube are represented by... | hrashk/sympy | sympy/combinatorics/graycode.py | Python | bsd-3-clause | 11,202 | 0.000357 |
# -*- coding: utf-8 -*-
# This file is part of Mumoro.
#
# Mumoro is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | Tristramg/mumoro | server.py | Python | gpl-3.0 | 26,253 | 0.020876 |
#!/usr/bin/env python3
"""Test behaviour of the test running and the term program interaction."""
import sys
import pexpect
from testrunner import run
def _shellping(child, timeout=1):
"""Issue a 'shellping' command.
Raises a pexpect exception on failure.
:param timeout: timeout for the answer
"""
... | cladmi/RIOT | tests/test_tools/tests/01-run.py | Python | lgpl-2.1 | 1,512 | 0 |
#
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | intel-analytics/analytics-zoo | pyzoo/zoo/examples/orca/learn/tf/image_segmentation/image_segmentation.py | Python | apache-2.0 | 9,188 | 0.001741 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | mkheirkhah/mptcp | src/dsdv/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 466,437 | 0.015177 |
#!/usr/bin/env python
"""
Echo the s3s3 configuration template.
"""
from pkg_resources import Requirement, resource_string
def try_resource(location):
"""
Try to get the resource in ``location``.
"""
try:
return resource_string(Requirement.parse('s3s3'), location)
except FileNotFoundError:... | lsst-sqre/s3s3 | s3s3/scripts/echo_s3s3_ini_template.py | Python | mit | 978 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import applications.utils.captcha.utils
class Migration(migrations.Migration):
dependencies = [
('authModel', '0007_email_test'),
]
operations = [
migrations.AddField(
mo... | AlexStarov/Shop | applications/authModel/migrations/0008_email_hash.py | Python | apache-2.0 | 508 | 0.001969 |
# -*- coding: utf-8 -*-
"""The zip file system implementation."""
import zipfile
# This is necessary to prevent a circular import.
import dfvfs.vfs.zip_file_entry
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.path import zip_path_spec
from dfvfs.resolver import resolver
from dfvfs.vfs imp... | dc3-plaso/dfvfs | dfvfs/vfs/zip_file_system.py | Python | apache-2.0 | 4,907 | 0.006521 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
import djangobmf.storage
import djangobmf.fields.file
import django.utils.timezone
import djangobmf.utils.generate_filename
class Migration(migrat... | django-bmf/django-bmf | djangobmf/migrations/0001_squashed_0_2_9.py | Python | bsd-3-clause | 12,381 | 0.005169 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ardrone_autonomy/navdata_time.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class navdata_time(genpy.Message):
_md5sum = "8642a5656fdcc931093... | aslab/rct | mrt/src/tum_simulator_ws/devel/lib/python2.7/dist-packages/ardrone_autonomy/msg/_navdata_time.py | Python | gpl-3.0 | 6,555 | 0.019222 |
#!/usr/bin/env python
"""
Framework to start a simulated vehicle and connect it to MAVProxy.
Peter Barker, April 2016
based on sim_vehicle.sh by Andrew Tridgell, October 2011
"""
import atexit
import getpass
import optparse
import os
import os.path
import signal
import subprocess
import sys
import tempfile
import ti... | hsteinhaus/ardupilot | Tools/autotest/sim_vehicle.py | Python | gpl-3.0 | 31,053 | 0.00293 |
from pyIST import *
##############
terra_dir = '/Users/tohodson/Desktop/modis_download/MOST/MOD29E1D.005/'
aqua_dir = '/Users/tohodson/Desktop/modis_download/MOSA/MYD29E1D.005/'
hdf_file = '/Users/tohodson/Desktop/AQ_IST.hdf5'
DATAFIELD_NAME='Ice_Surface_Temperature_SP'
aqua_count = count_files(aqua_dir,'*.hdf')
te... | tohodson/modis-hdf5 | code/compile_hdf.py | Python | gpl-2.0 | 1,818 | 0.008801 |
#!/usr/bin/env python
from __future__ import print_function
## Automatically adapted for numpy.oldnumeric Sep 06, 2007 by alter_code1.py
# ImageD11_v0.4 Software for beamline ID11
# Copyright (C) 2005 Jon Wright
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | jonwright/ImageD11 | scripts/huber2bruker.py | Python | gpl-2.0 | 20,959 | 0.015172 |
from dolfin import error, info
class Heart:
def __init__(self, cell_model):
self._cell_model = cell_model
# Mandatory stuff
def mesh(self):
error("Need to prescribe domain")
def conductivities(self):
error("Need to prescribe conducitivites")
# Optional stuff
def a... | Juanlu001/CBC.Solve | cbc/beat/heart.py | Python | gpl-3.0 | 897 | 0.001115 |
from __future__ import absolute_import
import six
from collections import defaultdict
from django.conf import settings
from sentry.app import env
from sentry.api.serializers import Serializer, register
from sentry.models import AuthIdentity, Authenticator, User, UserAvatar, UserOption
from sentry.utils.avatar import... | alexm92/sentry | src/sentry/api/serializers/models/user.py | Python | bsd-3-clause | 4,943 | 0.000809 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | huntxu/neutron | neutron/agent/linux/interface.py | Python | apache-2.0 | 19,111 | 0 |
#!/bin/env python3
# -*- coding: utf-8 -*-
#
# Hid replay / hid.py: table of hid usages and definitions
#
# Copyright (c) 2012-2017 Benjamin Tissoires <benjamin.tissoires@gmail.com>
# Copyright (c) 2012-2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | bentiss/hid-replay | tools/hid.py | Python | gpl-2.0 | 3,108 | 0.009653 |
# Copyright (c) 2014 Red Hat, 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... | pnavarro/neutron | neutron/tests/functional/agent/test_l3_agent.py | Python | apache-2.0 | 53,684 | 0.000112 |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | samedder/azure-cli | src/azure-cli-nspkg/setup.py | Python | mit | 1,582 | 0.000632 |
from __future__ import print_function, unicode_literals
import sys
from resources.lib.kodiutils import params as decode
class Params:
handle = int(sys.argv[1]) if len(sys.argv) > 1 else -1
orig_args = sys.argv[2] if len(sys.argv) > 2 else ''
args = decode(sys.argv[2]) if len(sys.argv) > 2 else {}
res... | bbaronSVK/plugin.video.stream-cinema | resources/lib/params.py | Python | gpl-3.0 | 420 | 0 |
"""
Common tests shared by test_str, test_unicode, test_userstring and test_string.
"""
import unittest, string, sys, struct
from test import support
from collections import UserList
class Sequence:
def __init__(self, seq='wxyz'): self.seq = seq
def __len__(self): return len(self.seq)
def __getitem__(self... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/test/string_tests.py | Python | mit | 58,093 | 0.001635 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# This simple example on how to do animations using graph-tool. Here we do a
# simple simulation of an S->I->R->S epidemic model, where each vertex can be in
# one of the following states: Susceptible (S), infected (I), recovered (R). A
# vertex in the S state becomes inf... | jim-pansn/graph-tool | doc/demos/animation_zombies.py | Python | gpl-3.0 | 5,436 | 0.001288 |
# <hr>Calculates the tangents and bitangents for the imported meshes.
#
# Does nothing if a mesh does not have normals. You might want this post
# processing step to be executed if you plan to use tangent space calculations
# such as normal mapping applied to the meshes. There's a config setting,
# <tt>#AI_CONFIG_P... | ivansoban/ILEngine | thirdparty/assimp/port/PyAssimp/pyassimp/postprocess.py | Python | mit | 23,509 | 0.012676 |
import re
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy.http import FormRequest
from productloader import load_product
im... | 0--key/lib | portfolio/Python/scrapy/inkshop/cartridgesavecouk.py | Python | apache-2.0 | 2,521 | 0.004363 |
#!/usr/bin/python3
"""
A script to get the public ip address from http://checkip.dyndns.org
"""
import urllib.error
import urllib.request
import re
import time
def contact_server():
"""
Try to get public ip address
"""
ipv4_address_pattern=re.compile(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
ip_addresses... | Bolt64/my_code | twitter_bot/get_ip.py | Python | mit | 881 | 0.010216 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2019 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU L... | fifengine/fifengine | tests/swig_tests/action_tests.py | Python | lgpl-2.1 | 4,655 | 0.02986 |
# on success, nothing is printed
import simplexorrequestor
# I'm keeping some of these datastructures tiny in order to make the output
# more readable if an error is discovered
mirrorinfolist = [{'name':'mirror1'}, {'name':'mirror2'}, {'name':'mirror3'}, {'name':'mirror4'}, {'name':'mirror5'}]
blocklist = [12,34]
#... | scotfu/uppir | test_simplexorrequestor.py | Python | mit | 2,272 | 0.011884 |
import datetime
from django.apps import apps
from django.core.mail import EmailMessage, EmailMultiAlternatives
import olympia.core.logger
from olympia import amo
from olympia.activity.models import ActivityLog
from olympia.amo.celery import task
from olympia.amo.utils import get_email_backend
from olympia.bandwagon.... | lavish205/olympia | src/olympia/amo/tasks.py | Python | bsd-3-clause | 2,217 | 0 |
from distutils.core import setup
setup(
name='MetCalcs',
version='0.1.1',
author='Peter D. Willetts',
author_email='peterwilletts24@gmail.com',
packages=['metcalcs',],
#scripts=[],
license='LICENSE.txt',
description='Some functions for calculating met parameters from sounding variab... | peterwilletts24/MetCalcs | setup.py | Python | gpl-3.0 | 459 | 0.010893 |
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo, mepinta@joaquinduo.com.ar
This file is part of Mepinta under GPL 3
'''
import unittest
from mepinta.pipelineview.actiontree.data_model import ActionTree
from mepinta.pipelineview.actiontree.ActionTreeManager import ActionTreeManager
from pprint import pprint, pforma... | joaduo/mepinta | core/python_core/mepinta/pipelineview/actiontree/tests/test_ActionTreeManager.py | Python | gpl-3.0 | 2,762 | 0.00181 |
import lxml.html
from html import escape
import chevron
import math
import prairielearn as pl
import numpy as np
import random
WEIGHT_DEFAULT = 1
CORRECT_ANSWER_DEFAULT = None
LABEL_DEFAULT = None
SUFFIX_DEFAULT = None
DISPLAY_DEFAULT = 'inline'
def prepare(element_html, data):
element = lxml.html.fragment_from... | mwest1066/PrairieLearn | elements/pl-integer-input/pl-integer-input.py | Python | agpl-3.0 | 8,803 | 0.001022 |
import unittest
from highest_number_cubed import highest_number_cubed
class TestHighestNumberCubed(unittest.TestCase):
def test_three(self):
self.assertEqual(highest_number_cubed(30), 3)
def test_two(self):
self.assertEqual(highest_number_cubed(12), 2)
def test_one(self):
self.... | rmotr-group-projects/itp-w1-highest-number-cubed | tests/test_main.py | Python | mit | 443 | 0 |
""" Defines the ScalesTickGenerator class.
"""
from numpy import array
from traits.api import Any
from enable.font_metrics_provider import font_metrics_provider
from ticks import AbstractTickGenerator
# Use the new scales/ticks library
from scales.api import ScaleSystem
class ScalesTickGenerator(AbstractTickGenerat... | tommy-u/chaco | chaco/scales_tick_generator.py | Python | bsd-3-clause | 1,682 | 0.004162 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | vlegoff/tsunami | src/secondaires/navigation/editeurs/shedit/__init__.py | Python | bsd-3-clause | 10,053 | 0.001802 |
"""
XML handler for calibrations
"""
# Standard library modules.
# Third party modules.
# Local modules.
from pyhmsa.spec.condition.calibration import \
(CalibrationConstant, CalibrationLinear,
CalibrationPolynomial, CalibrationExplicit)
from pyhmsa.fileformat.xmlhandler.condition.condition import _Conditio... | pyhmsa/pyhmsa | pyhmsa/fileformat/xmlhandler/condition/calibration.py | Python | mit | 965 | 0.006218 |
from .features import Dictionary, RegexMatches, Stemmed, Stopwords
name = "dutch"
try:
import enchant
dictionary = enchant.Dict("nl")
except enchant.errors.DictNotFoundError:
raise ImportError("No enchant-compatible dictionary found for 'nl'. " +
"Consider installing 'myspell-nl'.")... | yafeunteun/wikipedia-spam-classifier | revscoring/revscoring/languages/dutch.py | Python | mit | 3,534 | 0 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from views import HomeView, SimpleChainView, MultipleChainView, ModelChainView, EditCarView, DeleteCarView, \
AjaxChainedNames, AjaxChainedCountries, AjaxCh... | PragmaticMates/django-clever-selects | example/example/urls.py | Python | mit | 1,638 | 0.007326 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-23 19:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | wetneb/dissemin | deposit/migrations/0008_userpreferences.py | Python | agpl-3.0 | 1,117 | 0.003581 |
##########################################################################
#
# This file is part of Lilith
# made by J. Bernon and B. Dumont
#
# Web page: http://lpsc.in2p3.fr/projects-th/lilith/
#
# In case of questions email bernon@lpsc.in2p3.fr dum33@ibs.re.kr
#
#
# Lilith is free software: you can redistribu... | jeremy-bernon/Lilith | lilith/internal/effectivemu.py | Python | gpl-3.0 | 2,350 | 0.00383 |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | tonybaloney/st2 | contrib/runners/mistral_v2/tests/unit/test_mistral_v2_policy.py | Python | apache-2.0 | 11,045 | 0.00335 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('hack_plot', '0009_auto_20150703_2236'),
]
operations = [
migrations.CreateModel(
name='SshHackLocation',
... | hellsgate1001/graphs | hack_plot/migrations/0010_auto_20150705_2020.py | Python | mit | 1,309 | 0.002292 |
#!/usr/bin/env python
# The function declaration of Boost::Python objects are hardcoded
# as string. This Script should show changes/update this strings.
#
# (Example of such issue in Civ4:BTS is CyPlayer::initUnit.)
#
import os
import glob
import pdb
# pdb.set_trace()
REWRITE_FILES = True
VERBOSE = 1
DEBUG_WRITE =... | Zulan/PBStats | CvGameCoreDLL/update_interface_docstrings.py | Python | gpl-2.0 | 5,421 | 0.00535 |
"""Support for RainMachine devices."""
import asyncio
from datetime import timedelta
import logging
from regenmaschine import Client
from regenmaschine.errors import RainMachineError
import voluptuous as vol
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_IP_ADDRESS,
CONF_PASSWORD,
CONF_PORT,... | balloob/home-assistant | homeassistant/components/rainmachine/__init__.py | Python | apache-2.0 | 15,955 | 0.001818 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Cloudbase Solutions Srl
#
# 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/LICEN... | cernops/cloudbase-init | cloudbaseinit/tests/metadata/services/test_ec2service.py | Python | apache-2.0 | 5,279 | 0 |
import pkg_resources
from datetime import datetime
import re
from inbox.api.validation import (
get_recipients, get_attachments, get_thread, get_message)
from inbox.api.err import InputError
from inbox.contacts.process_mail import update_contacts_from_message
from inbox.models import Message, Part
from inbox.model... | nylas/sync-engine | inbox/sendmail/base.py | Python | agpl-3.0 | 13,544 | 0.000074 |
"""
Helper for keeping processes singletons
"""
__license__ = """
This file is part of RAPD
Copyright (C) 2016-2018 Cornell University
All rights reserved.
RAPD 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 Founda... | RAPD/RAPD | src/utils/lock.py | Python | agpl-3.0 | 1,987 | 0.002013 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | jocave/snapcraft | snapcraft/tests/test_commands_prime.py | Python | gpl-3.0 | 5,460 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-16 10:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('foxy_player_api', '0009_auto_20170415_2318'),
]
operations = [
migrations.AlterUnique... | TheCheshireFox/foxy-player | foxy_player/foxy_player_api/migrations/0010_auto_20170416_1306.py | Python | apache-2.0 | 419 | 0 |
# Copyright (c) 2019 2021 by Rocky Bernstein
#
# 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 License, or
# (at your option) any later version.
#
# This program is... | rocky/python-uncompyle6 | uncompyle6/semantics/customize26_27.py | Python | gpl-3.0 | 2,225 | 0.002247 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | jlongever/redfish-client-python | on_http_redfish_1_0/models/computer_system_1_0_0_system_type.py | Python | apache-2.0 | 2,513 | 0.002388 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/perl-font-ttf/package.py | Python | lgpl-2.1 | 1,568 | 0.001913 |
#-*- coding: utf-8 -*-
'''
Created on 24 авг. 2010
@author: ivan
'''
from gi.repository import Gtk
import logging
from foobnix.fc.fc import FC
from foobnix.helpers.image import ImageBase
from foobnix.util.const import SITE_LOCALE, ICON_FOOBNIX
from foobnix.util.localization import foobnix_localization
from foobnix.gu... | kagel/foobnix | foobnix/helpers/dialog_entry.py | Python | gpl-3.0 | 12,111 | 0.004625 |
"""
Description : This file implements the LogSig algorithm for log parsing
Author : LogPAI team
License : MIT
"""
from datetime import datetime
import random
import math
import time
import operator
import re
import os
import pandas as pd
import hashlib
class Para:
def __init__(self, p... | logpai/logparser | logparser/LogSig/LogSig.py | Python | mit | 12,489 | 0.003043 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | diogocs1/comps | web/addons/email_template/wizard/email_template_preview.py | Python | apache-2.0 | 3,851 | 0.002597 |
"""
The Fibonacci Sequence is the series of numbers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
The next number is found by adding up the two numbers before it.
The 2 is found by adding the two numbers before it (1+1)
Similarly, the 3 is found by adding the two numbers before it (1+2),
And the 5 is (2+3),
... | crazcalm/PyTN_talk_proposal | recipies/recipe1/fib.py | Python | mit | 2,169 | 0.004149 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017,2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | chipaca/snapcraft | tests/unit/plugins/v1/python/test_sitecustomize.py | Python | gpl-3.0 | 5,261 | 0.00076 |
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: syslog_json
callback_type: notification
... | thaim/ansible | lib/ansible/plugins/callback/syslog_json.py | Python | mit | 3,681 | 0.004075 |
"""
Initialize models
"""
| myadventure/myadventure-api | app/models/__init__.py | Python | apache-2.0 | 27 | 0 |
import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag import protocols
import ztag.test
class FtpCesarFtpd(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port = None
impl_re = re.compile("^220[- ]CesarFTP 0\.\d+", re.IGNORECAS... | zmap/ztag | ztag/annotations/FtpCesarFtpd.py | Python | apache-2.0 | 1,652 | 0.003632 |
#!/usr/bin/env python
"""
Purpose : Extract next sequence number of auto-scaled instance and set new tag to self instance. Script will be running from new instance.
will take input from command line instead of from json file
Future Plan :
will associate instance to a role based IAM profile
Usage :
python ec2-autoscale-... | kmaiti/AWSAutoScalingWithF5andCloudFormation | aws-autoscale-ec2-instance-modify.py | Python | gpl-3.0 | 6,954 | 0.012511 |
"""
categories: Types,bytes
description: Bytes subscr with step != 1 not implemented
cause: Unknown
workaround: Unknown
"""
print(b'123'[0:3:2])
| cwyark/micropython | tests/cpydiff/types_bytes_subscrstep.py | Python | mit | 145 | 0 |
import imp
import os.path
import pkgutil
import six
import unittest
import streamlink.plugins
from streamlink import Streamlink
class PluginTestMeta(type):
def __new__(mcs, name, bases, dict):
plugin_path = os.path.dirname(streamlink.plugins.__file__)
plugins = []
for loader, pname, ispk... | back-to/streamlink | tests/test_plugins.py | Python | bsd-2-clause | 1,609 | 0.000622 |
#!/usr/bin/python3
"""
Cleans-up Sphinx-only constructs (ie from README.rst),
so that *PyPi* can format it properly.
To check for remaining errors, install ``sphinx`` and run::
python setup.py --long-description | sed -file 'this_file.sed' | rst2html.py --halt=warning
"""
import re
import sys, io
def yie... | iSTB/python-schemata | rst_cleaner.py | Python | mit | 1,813 | 0.006067 |
#!/usr/bin/env python
#
# Copyright (C) 2013-2017(H)
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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, ei... | espressopp/espressopp | testsuite/AdResS/TDforce/test_TDforce.py | Python | gpl-3.0 | 16,457 | 0.010634 |
import contextlib
import logging
import os
import tempfile
from django.db.utils import InternalError
from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
from botocore.exceptions import ConnectionClosedError
from unittest.mock import patch
from casexml.apps.case.exce... | dimagi/commcare-hq | corehq/apps/receiverwrapper/tests/test_submit_errors.py | Python | bsd-3-clause | 14,436 | 0.00194 |
#
# To test this, first have a running local zookeeper installation
# (See http://zookeeper.apache.org/)
# Next, open a couple of shells
# Run this in the first one, watch the output. It will create a lock and hold it for 20 seconds.
# Run it again in the second one, watch that it doesn't acquire the lock until the f... | tinyogre/zklock | zklocktest.py | Python | lgpl-3.0 | 1,271 | 0.010228 |
#!/usr/bin/env python
"""Wordnik.com's Swagger generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of
the methods and models for each application are generated from the Swagger
templates."""
import sys
import os
import re
import urllib.request, u... | liosha2007/temporary-groupdocs-python3-sdk | groupdocs/ApiClient.py | Python | apache-2.0 | 11,500 | 0.004609 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Pexego Sistemas Informáticos (http://www.pexego.es) All Rights Reserved
# $Jesús Ventosinos Mayor$
# $Javier Colmenero Fernández$
# Copyright (c) 2014 Dido... | odoousers2014/LibrERP | task_time_control/project_task.py | Python | agpl-3.0 | 7,349 | 0.004084 |
import Base
import sys
import industrial_lib
time_of_day='_night'
(landing_platform,bar,weap) = industrial_lib.MakeCorisc (time_of_day,'bases/bartender_university.py')
| vinni-au/vega-strike | data/bases/university_night.py | Python | gpl-2.0 | 169 | 0.035503 |
#!/usr/bin/env python
"""
Check if an FST has only zero weights.
"""
import argparse
import fst
import sys
def main(args):
L = fst.read(args.fst_file)
for state in L:
for arc in state:
if arc.weight != fst.TropicalWeight(0.0):
sys.stderr.write(
"Nonze... | rizar/attention-lvcsr | bin/check_all_fst_weights_are_zero.py | Python | mit | 633 | 0.004739 |
from unittest import TestCase
from aq.sqlite_util import connect, create_table, insert_all
class TestSqliteUtil(TestCase):
def test_dict_adapter(self):
with connect(':memory:') as conn:
conn.execute('CREATE TABLE foo (foo)')
conn.execute('INSERT INTO foo (foo) VALUES (?)', ({'bar'... | lebinh/aq | tests/test_sqlite_util.py | Python | mit | 2,855 | 0.001051 |
#!/usr/bin/env python2.7
import networkx as nx
import matplotlib.pyplot as plt
import sys, argparse, os, re
parser = argparse.ArgumentParser(description='''Visualizes connections in assembly
using networkx_viewer module.''',
formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
#Required argumen... | alexherns/biotite-scripts | build_connection_graph.py | Python | mit | 1,780 | 0.03427 |
import pandas as pd
import numpy as np
from sklearn import linear_model, cluster
from collections import defaultdict, Iterable
from itertools import chain, combinations
import operator
import psycopg2
conn = psycopg2.connect("dbname='postgres' user='pbailis' host='localhost'")
cur = conn.cursor()
cols = "hardware_ma... | stanford-futuredata/macrobase | tools/py_analysis/analyze_cluster.py | Python | apache-2.0 | 3,142 | 0.005729 |
#!/usr/bin/python
import sys
import remote_core as core
import radio_lights
def main(argv):
config = core.load_config()
lights_config_names = {"1":"door_light", "2":"desk_light", "3": "shelf_light"}
if len(argv) == 1 and len(argv[0]) == 2:
if argv[0] == "an":
argv = ["1n", "2n", "3n"]
elif argv[0] == "af"... | sradevski/homeAutomate | scripts/lights_controller.py | Python | mit | 665 | 0.040602 |
from django.test import TestCase
from .models import Profile
from django.contrib.auth.models import User
# models test
class ProfileTest(TestCase):
def setUp(self):
self.user = User.objects.create(username='user1', password='123456')
Profile.objects.create(city='noida', contact_no='1234567890')
... | ChillarAnand/junction | junction/profiles/tests.py | Python | mit | 519 | 0 |
import os
import imp
from tinydb import TinyDB
from paths import DB_DIR
def scan_plugins_dir(plugins_dir='plugins'):
"""Scan the given dir for files matching the spec for plugin files"""
for plugin_file in os.listdir(plugins_dir):
plugin_path = os.path.join(plugins_dir, plugin_file)
if (not pl... | sentriz/steely | steely/utils.py | Python | gpl-3.0 | 800 | 0 |
# 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/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_kql_script_operations.py | Python | mit | 24,579 | 0.005167 |
# portage.py -- core Portage functionality
# Copyright 1998-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
VERSION="HEAD"
# ===========================================================================
# START OF IMPORTS -- START OF IMPORTS -- START OF IMPORTS -- START OF IMPO... | devurandom/portage | pym/portage/__init__.py | Python | gpl-2.0 | 21,844 | 0.031038 |
"""
This module implements the FormRequest class which is a more convenient class
(than Request) to generate Requests based on form data.
See documentation in docs/topics/request-response.rst
"""
import six
from six.moves.urllib.parse import urljoin, urlencode
import lxml.html
from parsel.selector import create_root... | Ryezhang/scrapy | scrapy/http/request/form.py | Python | bsd-3-clause | 7,658 | 0.001306 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FormText'
db.create_table(u'landing_formtext', (
(u'id', self.gf('django.db.mode... | andresfcardenas/marketing-platform | landing/migrations/0003_auto__add_formtext.py | Python | bsd-3-clause | 3,656 | 0.008206 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v8/services/services/product_bidding_category_constant_service/client.py | Python | apache-2.0 | 18,954 | 0.001636 |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | DataONEorg/d1_python | gmn/src/d1_gmn/app/urls.py | Python | apache-2.0 | 8,003 | 0.00025 |
# Copyright (c) 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for debugging with JLink.'''
from os import path
import os
from .core import ZephyrBinaryRunner, get_env_or_bail
DEFAULT_JLINK_GDB_PORT = 2331
class JLinkBinaryRunner(ZephyrBinaryRunner):
'''Runner front-end for the J-Link ... | fbsder/zephyr | scripts/support/runner/jlink.py | Python | apache-2.0 | 3,770 | 0 |
"""
Django settings for blog project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Buil... | Dingo5733/djangoblog19 | src/trydjango19/settings.py | Python | mit | 3,453 | 0.001448 |
# 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... | chemelnucfin/tensorflow | tensorflow/python/data/experimental/ops/batching.py | Python | apache-2.0 | 13,674 | 0.003145 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | StackStorm/st2 | st2tests/integration/orquesta/test_wiring_functions_task.py | Python | apache-2.0 | 3,825 | 0.000523 |
#!/usr/bin/env python
# pmx Copyright Notice
# ============================
#
# The pmx source code is copyrighted, but you can freely use and
# copy it as long as you don't change or remove any of the copyright
# notices.
#
# ----------------------------------------------------------------------
# pmx is Copyright (C... | Alwnikrotikz/pmx | scripts/mdsetup_407.py | Python | lgpl-3.0 | 22,643 | 0.019035 |
# Copyright 2017-2018 IBM Corp. All Rights Reserved.
# See LICENSE for details.
#
# Author: Henrik Loeser
#
# Manage workspaces for IBM Watson Assistant service on IBM Cloud.
# See the README for documentation.
#
import json, argparse, importlib
from os.path import join, dirname
from ibm_watson import AssistantV1
from... | data-henrik/watson-conversation-tool | wctool.py | Python | apache-2.0 | 13,189 | 0.012207 |
#!/usr/bin/env python -i
# preceeding line should have path for Python on your machine
# vizplotgui_gl.py
# Purpose: viz running LAMMPS simulation via GL tool with plot and GUI
# Syntax: vizplotgui_gl.py in.lammps Nfreq compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point and viz s... | slitvinov/lammps-sph-multiphase | python/examples/vizplotgui_gl.py | Python | gpl-2.0 | 4,373 | 0.02424 |
import struct
import time
from .types import t_string, t_list, t_set, t_zset, t_hash
from .errors import *
class Coloradoes(object):
STRUCT_KEY = '!ic'
STRUCT_KEY_VALUE = '!icd'
STRUCT_ID = '!i'
def __init__(self, storage=None):
if storage is None:
raise ValueError('A storage is ... | pombredanne/coloradoes.py | src/coloradoes/coloradoes.py | Python | bsd-2-clause | 3,539 | 0.001413 |
from sympy.logic.boolalg import *
import equibel as eb
def test_global_completion_cardinality():
G = eb.star_graph(3)
G.add_formula(1, 'p')
G.add_formula(2, 'p')
G.add_formula(3, '~p')
R_semantic = eb.global_completion(G, method=eb.SEMANTIC, opt_type=eb.CARDINALITY, simplify=True)
assert(R_se... | asteroidhouse/equibel | tests/completion_tests.py | Python | mit | 2,605 | 0.002303 |
# Copyright (c) 2020 Aldo Hoeben / fieldOfView
# OctoPrintPlugin is released under the terms of the AGPLv3 or higher.
from cura.PrinterOutput.GenericOutputController import GenericOutputController
try:
# Cura 4.1 and newer
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState... | fieldOfView/OctoPrintPlugin | OctoPrintOutputController.py | Python | agpl-3.0 | 1,276 | 0.003135 |
from django.conf.urls import url, patterns, include
from accounts import views
user_tool_patterns = patterns(
"",
url(r"^lending/$", views.LendingManager.as_view(), name="lending"),
url(r"^manager/$", views.ToolManager.as_view(), name="manager"),
)
# namespaced under account:
urlpatterns = patterns(
... | toolhub/toolhub.co | accounts/urls.py | Python | bsd-3-clause | 1,267 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.