code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
class TestStockLandedCostsCommon(AccountingTestCase):
def setUp(self):
super(TestStockLandedCostsCommon, self).setUp()
# Objects
self.Product = self.env['product.product']
self.Pi... | Aravinthu/odoo | addons/stock_landed_costs/tests/common.py | Python | agpl-3.0 | 3,168 |
from django.conf import settings
from django.db import models
class PermittedManager(models.Manager):
def get_query_set(self):
# Get base queryset and exclude based on state.
queryset = super(PermittedManager, self).get_query_set().exclude(
state='unpublished'
)
# Excl... | unomena/jmbo-unomena-old | jmbo/managers.py | Python | bsd-3-clause | 657 |
# -*- coding: utf-8 -*-
# MLC (Machine Learning Control): A genetic algorithm library to solve chaotic problems
# Copyright (C) 2015-2017, Thomas Duriez (thomas.duriez@gmail.com)
# Copyright (C) 2015, Adrian Durán (adrianmdu@gmail.com)
# Copyright (C) 2015-2017, Ezequiel Torres Feyuk (ezequiel.torresfeyuk@gmail.com)
# ... | MachineLearningControl/OpenMLC-Python | MLC/db/sqlite/sql_statements_board_configuration.py | Python | gpl-3.0 | 7,456 |
"""Config flow for RFXCOM RFXtrx integration."""
import copy
import os
import RFXtrx as rfxtrxmod
import serial
import serial.tools.list_ports
import voluptuous as vol
from homeassistant import config_entries, exceptions
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_C... | GenericStudent/home-assistant | homeassistant/components/rfxtrx/config_flow.py | Python | apache-2.0 | 21,583 |
"""
Code Sources Used:
https://gist.github.com/mythz/5723202
https://github.com/dartist/sudoku_solver/blob/master/benchmarks/sudoku.py
https://github.com/gioGats/sudoku
http://norvig.com/sudoku.html
"""
import random
# API/Adapted Code ##################################################################################... | gioGats/sudoku | v0.1/generate_sudoku.py | Python | gpl-3.0 | 7,033 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#Copyright (C) 2007 Adam Spencer - Free Veterinary Management Suite
#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 ... | cyncyncyn/evette | appointmentsearchmethods.py | Python | gpl-2.0 | 18,586 |
"""
Test Options
------------
"""
from virtstrap.options import *
def test_initialize_cli_list():
l = CLIList()
assert isinstance(l, list)
def test_cli_list_acts_like_list():
"""Ensure that CLIList still acts like a list"""
l = CLIList([1,2,3,4])
assert l[0] == 1
assert l[1:] == [2,3,4]
l... | ravenac95/virtstrap | virtstrap-core/tests/test_options.py | Python | mit | 1,488 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Common codegen classes.
from collections import defaultdict
from itertools import groupby
import operator
import os
... | jaysonsantos/servo | components/script/dom/bindings/codegen/CodegenRust.py | Python | mpl-2.0 | 279,760 |
"""Unit tests for the Bugzilla hosting service."""
from reviewboard.hostingsvcs.testing import HostingServiceTestCase
class BugzillaTests(HostingServiceTestCase):
"""Unit tests for the Bugzilla hosting service."""
service_name = 'bugzilla'
fixtures = ['test_scmtools']
def test_service_support(self)... | reviewboard/reviewboard | reviewboard/hostingsvcs/tests/test_bugzilla.py | Python | mit | 929 |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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 applicabl... | briancurtin/rpc-maas | playbooks/files/rax-maas/plugins/nova_api_metadata_local_check.py | Python | apache-2.0 | 3,057 |
#pylint: disable=C0111
#pylint: disable=W0621
from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror
from nose.tools import assert_in # pylint: disable=E0611
@step(u'I go to the course updates page')
def go_to_updates(_step):
menu_css = 'li.nav-cour... | XiaodunServerGroup/xiaodun-platform | cms/djangoapps/contentstore/features/course-updates.py | Python | agpl-3.0 | 3,799 |
# coding=utf-8
# This file is part of SickRage.
#
# Git: https://github.com/PyMedusa/SickRage.git
#
# SickRage 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 op... | Thraxis/pymedusa | tests/sickrage_tests/providers/nzb_provider_tests.py | Python | gpl-3.0 | 5,810 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import random
import re
from odoo import api, fields, models, modules
class ImLivechatChannel(models.Model):
""" Livechat Channel
Define a communication channel, which can be accessed with 'sc... | ddico/odoo | addons/im_livechat/models/im_livechat_channel.py | Python | agpl-3.0 | 15,347 |
from idbase.middleware import (LoginUrlMiddleware, SessionTimeoutMiddleware,
get_authenticated_uwnetid)
from pytest import fixture, raises, mark
from django.core.exceptions import ImproperlyConfigured
from idbase.exceptions import InvalidSessionError, LoginNotPerson, ServiceError
@fixtu... | jeffFranklin/iam-idbase | tests/test_middleware.py | Python | apache-2.0 | 5,568 |
#!/usr/bin/env python3
from collections import namedtuple
from selfdrive.car.chrysler.values import CAR as CHRYSLER
from selfdrive.car.gm.values import CAR as GM
from selfdrive.car.honda.values import CAR as HONDA
from selfdrive.car.hyundai.values import CAR as HYUNDAI
from selfdrive.car.nissan.values import CAR as NI... | commaai/openpilot | selfdrive/test/test_routes.py | Python | mit | 12,465 |
""".. Ignore pydocstyle D400.
================================
Knowledge Base App Configuration
================================
"""
from django.apps import AppConfig
class KnowledgeBaseConfig(AppConfig):
"""App configuration."""
name = "resolwe_bio.kb"
label = "resolwe_bio_kb"
verbose_name = "Reso... | genialis/resolwe-bio | resolwe_bio/kb/apps.py | Python | apache-2.0 | 558 |
"""
A simple command-line interface for Mininet.
The Mininet CLI provides a simple control console which
makes it easy to talk to nodes. For example, the command
mininet> h27 ifconfig
runs 'ifconfig' on host h27.
Having a single console rather than, for example, an xterm for each
node is particularly convenient for... | ool2016-seclab/quarantineSystem | mininet/cli.py | Python | mit | 15,798 |
"""
FacetGrid with custom projection
================================
_thumb: .33, .5
"""
import numpy as np
import pandas as pd
import seaborn as sns
sns.set()
# Generate an example radial datast
r = np.linspace(0, 10, num=100)
df = pd.DataFrame({'r': r, 'slow': r, 'medium': 2 * r, 'fast': 4 * r})
# Convert the d... | phobson/seaborn | examples/facet_projections.py | Python | bsd-3-clause | 741 |
# Egill Sveinbjornsson
# Reykjavik University 2015-1
def parse_code(c):
tuples = {}
times = 1
idx = 0
for b in c.split('>'): # Split by nesting level
idx += 1
tuples[idx] = []
for t in b.split('+'):
if '*' not in t:
times = 1
tuples[id... | Kallehz/Python | Verkefni 2/ZenCoding.py | Python | apache-2.0 | 1,814 |
# Fantasy Game Inventory -1 practice problem from Automate Boring Stuff - Chapter 5
# https://automatetheboringstuff.com/chapter5/
def displayInventory(inventory):
totalItems = 0
print('Inventory:')
for k in inventory.keys():
totalItems = totalItems + inventory[k]
print(str(inventory[k]) + ' ' + k)
print('Tot... | anirudhvarma12/learning-python | chapter5/fantasyGameInventory.py | Python | mit | 470 |
import socket
import subprocess
from subprocess import call
import shlex
file_type_dict = {
'Cxx': ['.c', '.cpp', '.cc', '.h', '.hh', '.hpp'],
'Java': ['.java'] }
class YavideUtils():
@staticmethod
def file_type_to_programming_language(file_type):
for lang, file_types in file_type_dict.iterite... | JBakamovic/yavide | core/common/yavide_utils.py | Python | gpl-2.0 | 1,452 |
import unittest
import random
import time
from dreamland import LRUCache
class TestLRUCache(unittest.TestCase):
def setUp(self):
print '\n'
print '='*64
def print_node(self, node):
return "Node: %s \n\tkey: %s, value: %s, \n\tprev: %s, \n\tnext: %s" \
% (node, node... | ksang/dreamland | tests/lrucache.py | Python | mit | 1,686 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | enapps/enapps-openerp-server | openerp/addons/base/ir/ir_ui_view.py | Python | agpl-3.0 | 10,473 |
# 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... | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorboard/version.py | Python | mit | 744 |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
PYTHON_VERSION_COMPATIBILITY = "PY3"
DEPS = [
'recipe_engine/context',
'recipe_engine/step',
'run',
]
| youtube/cobalt | third_party/skia_next/third_party/skia/infra/bots/recipe_modules/doxygen/__init__.py | Python | bsd-3-clause | 272 |
from .models import ssm_backends
from ..core.models import base_decorator
mock_ssm = base_decorator(ssm_backends)
| spulec/moto | moto/ssm/__init__.py | Python | apache-2.0 | 115 |
from redis import Redis
from redis.lock import Lock
import logging
import base64
import os
from datetime import datetime
from cryptography.fernet import Fernet
from uuid import uuid4
TASK_LIST_KEY = 'dataplatform.service.tasks'
def task_list(redis):
return redis.hkeys(TASK_LIST_KEY)
def task_authenticate(redis,k... | alexmilowski/python-hadoop-rest-api | pyox/apps/tracker/tasks.py | Python | apache-2.0 | 2,289 |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import hashlib
import unittest
from harvester import harvester
class CubeuploadTest(unittest.TestCase):
def setUp(self):
self.nick = "test"
self.chan = '#brotherBot'
self.mask = "brotherBox!~brotherBo@unaffiliated/brotherbox"
self.h ... | luceatnobis/harvester | harvester/tests/test_cubeupload.py | Python | unlicense | 1,072 |
# -*- coding: utf-8 -*-
"""
End-to-end tests for Student's Profile Page.
"""
from contextlib import contextmanager
from datetime import datetime
from bok_choy.web_app_test import WebAppTest
from nose.plugins.attrib import attr
from ...pages.common.logout import LogoutPage
from ...pages.lms.account_settings import Acc... | alu042/edx-platform | common/test/acceptance/tests/lms/test_learner_profile.py | Python | agpl-3.0 | 34,219 |
#!/usr/bin/env python
# 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 distributed in the hope that ... | kenorb/BitTorrent | torrentinfo-console.py | Python | gpl-3.0 | 4,948 |
"""The tests for the MQTT subscription component."""
from unittest import mock
from homeassistant.components.mqtt.subscription import (
async_subscribe_topics,
async_unsubscribe_topics,
)
from homeassistant.core import callback
from tests.common import async_fire_mqtt_message, async_mock_mqtt_component
asyn... | fbradyirl/home-assistant | tests/components/mqtt/test_subscription.py | Python | apache-2.0 | 5,237 |
#!/usr/bin/env python
# This file is copied from Printator.
#
# Printator 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.
#
# Printato... | iXce/Printator | printator.py | Python | gpl-3.0 | 15,417 |
# -*- coding: utf8 -*-
from django.db import models
from holonet_django.models import MailMapping
class TestRecipientModel(models.Model):
username = models.CharField(max_length=100)
email = models.EmailField()
class Mapping1(MailMapping):
recipients = models.ManyToManyField(TestRecipientModel)
i... | webkom/django-holonet | tests/models.py | Python | mit | 510 |
import os
from ehive.runnable.IGFBaseProcess import IGFBaseProcess
from igf_data.utils.config_genome_browser import Config_genome_browser
class BuildGenomeBrowserConfigForProject(IGFBaseProcess):
def param_defaults(self):
params_dict=super(BuildGenomeBrowserConfigForProject,self).param_defaults()
params_dict... | imperial-genomics-facility/data-management-python | ehive/runnable/process/alignment/BuildGenomeBrowserConfigForProject.py | Python | apache-2.0 | 3,272 |
#!/bin/sh
"""": # -*-python-*-
bup_python="$(dirname "$0")/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
import sys, getopt, socket, subprocess, fcntl
from bup import options, path
from bup.helpers import *
optspec = """
bup daemon [options...] -- [bup-server options...]
--
l,liste... | tjanez/bup | cmd/daemon-cmd.py | Python | lgpl-2.1 | 2,128 |
from go.vumitools.tests.helpers import djangotest_imports
with djangotest_imports(globals()):
from django.core.urlresolvers import reverse
from go.apps.tests.view_helpers import AppViewsHelper
from go.base.tests.helpers import GoDjangoTestCase
class TestHttpApiNoStreamViews(GoDjangoTestCase):
def s... | praekelt/vumi-go | go/apps/http_api_nostream/tests/test_views.py | Python | bsd-3-clause | 11,177 |
"""Our app specific CEF loggers."""
from django.conf import settings
from django.http import HttpRequest
from cef import log_cef as _log_cef
heka = settings.HEKA
class CEFLogger:
"""Abstract base CEF logger.
Class attributes to set in a concrete class:
**sig_prefix**
Prefix to the CEF signature.... | shahbaz17/zamboni | lib/cef_loggers.py | Python | bsd-3-clause | 3,376 |
import sys
from ga144 import GA144
# Output a square wave on node 708's pin 1.
# The frequency is about 20 MHz.
prg708 = """
@p a! @p @p \ a points to the io port
io
2 \ stack literal 2 and 3
3
over over over \ replicate 2,3 all down the stack
over over over
over... | jamesbowman/ga144tools | src/square1.py | Python | mit | 493 |
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | innovimax/vxquery | vxquery-benchmark/src/main/resources/util/diff_xml_files.py | Python | apache-2.0 | 3,401 |
import wx
import threading
import time
import json
import sys
from loginDialog import LoginDialog
from udpsocket import Udpsocket
reload(sys)
sys.setdefaultencoding('utf8')
def call_after(func):
def _wrapper(*args, **kwargs):
return wx.CallAfter(func, *args, **kwargs)
return _w... | LiSheep/udpchat | src/client-python/client.py | Python | gpl-3.0 | 3,906 |
#!/usr/bin/env python3
import glob
import io
import os
import subprocess
import sys
import time
import xml.etree.ElementTree as ET
suffix = sys.argv[1]
cmd = sys.argv[2:]
# get the list of input files to process
infiles = sorted(glob.glob('inputs/*.' + suffix))
testsuites = ET.Element('testsuites')
suite = ET.SubEl... | russross/codegrinder | files/riscvinout/lib/inout-runner.py | Python | agpl-3.0 | 3,381 |
# 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 use ... | apache/libcloud | libcloud/test/compute/test_types.py | Python | apache-2.0 | 3,169 |
import logging
import shlex
import warnings
from flask import request
from jinja2 import Markup
from flask_admin.base import BaseView, expose
from flask_admin.babel import gettext
from flask_admin._compat import VER
# Set up logger
log = logging.getLogger("flask-admin.redis")
class CommandError(Exception):
""... | Widiot/simpleblog | venv/lib/python3.5/site-packages/flask_admin/contrib/rediscli.py | Python | mit | 5,966 |
from PyGMO.problem import base as base_problem
from PyKEP.core import epoch, fb_con, EARTH_VELOCITY, AU, MU_SUN
from PyKEP.planet import jpl_lp
from PyKEP.sims_flanagan import leg, spacecraft, sc_state
class mga_lt_nep(base_problem):
"""
This class is a PyGMO (http://esa.github.io/pygmo/) problem representin... | krzysztof/pykep | PyKEP/trajopt/_mga_lt_nep.py | Python | gpl-3.0 | 15,675 |
# -*- coding: utf-8 -*-
"""
Contains a custom QTableWidget for easier displaying of CheckerMessages
"""
from pyqode.core.api.utils import memoized
from pyqode.core.modes import CheckerMessage, CheckerMessages
from pyqode.qt import QtCore, QtWidgets, QtGui
COL_TYPE = 0
COL_FILE_NAME = 1
COL_LINE_NBR = 2
COL_MSG = 3
... | jmwright/cadquery-x | gui/libs/pyqode/core/widgets/errors_table.py | Python | lgpl-3.0 | 5,638 |
# Copyright 2013 Devsim 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 agreed to in writing, s... | devsim/devsim | examples/diode/ssac_diode.py | Python | apache-2.0 | 1,935 |
"""
Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of
the Revised BSD License, included in this distribution as LICENSE.txt
"""
import geoid
import geoid.acs
import geoid.census
import geoid.civick
import geoid.tiger
from rowgenerators.valuetype import (FailedValue, GeoMixin, IntDimensio... | CivicKnowledge/rowgenerators | rowgenerators/valuetype/geo.py | Python | mit | 7,843 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | froyobin/ironic | ironic/tests/drivers/ilo/test_power.py | Python | apache-2.0 | 10,139 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" sysdiag
Pierre Haessig — September 2013
"""
from __future__ import division, print_function
def _create_name(name_list, base):
'''Returns a name (str) built on `base` that doesn't exist in `name_list`.
Useful for automatic creation of subsystems or wires
... | pierre-haessig/sysdiag | sysdiag.py | Python | mit | 21,428 |
#!/usr/bin/env python
# encoding: utf-8
from celery.task import task
from colorama import Fore
from utils.constants import CP_NAME
from utils.constants import AGENCY
from utils.constants import ROUTE
from utils.constants import STOP
from utils.constants import TRIP
from utils.constants import STOPTIME
from utils.const... | OneStopTransport/OST-FiWare-Lisbon | fiware_lisbon/fiware/tasks.py | Python | mit | 2,779 |
# Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in ... | ceos-seo/Data_Cube_v2 | ui/django_site_v2/data_cube_ui/utils/dc_mosaic.py | Python | apache-2.0 | 7,933 |
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from collections import defaultdict
#***************************************************************
class Tarjan:
"""
Computes Tarjan's algorithm for finding strongly connected components (cycles) of a graph
... | Northeaster/TargetSentimentAnalysis | lib/etc/tarjan.py | Python | apache-2.0 | 2,339 |
# Copyright 2020 Google
#
# 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 applicable law or agreed to in writing, soft... | quantumlib/ReCirq | recirq/readout_scan/tasks.py | Python | apache-2.0 | 4,314 |
import click
from . import logging_helper, util
from .chrome_store import commands as chrome_commands
from .firefox_store import commands as firefox_commands
from .script_parser.parser import Parser
logger = logging_helper.get_logger(__file__)
@click.group()
@click.option('-v', '--verbose', count=True,
... | melkamar/webstore-manager | webstore_manager/manager.py | Python | mit | 972 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
演示Wing IDE 101的goto define功能。使用Wing IDE 101或Spyder打开本程序之后,
按住Ctrl的同时点击signal, pl, HasTraits等跳转到定义它们的程序。
"""
from scipy import signal
import pylab as pl
from enthought.traits.api import HasTraits, Instance
from enthought.traits.ui.api import View, Item
signal... | Akagi201/akcode | python/gotodefine.py | Python | gpl-2.0 | 419 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ver... | taigaio/taiga-back | tests/integration/resources_permissions/test_epics_resources.py | Python | agpl-3.0 | 38,177 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | V155/qutebrowser | tests/unit/browser/webengine/test_webenginedownloads.py | Python | gpl-3.0 | 1,495 |
#
import numpy as np
import healpy as hp
import astropy.io.fits as pyfits
from multiprocessing import Pool
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from quicksipManera import *
import fitsio
### ------------ A couple of useful conversions -----------------------
def zeropointToScale(z... | legacysurvey/pipeline | validationtests/DESIccdManera.py | Python | gpl-2.0 | 38,903 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from .index import TableIndices, TableLoc, TableILoc, TableLocIndices
import sys
from collections import OrderedDict
from collections.abc import Mapping
import warnings
from copy import deepcopy
import numpy as np
from numpy import ma
from astropy impo... | bsipocz/astropy | astropy/table/table.py | Python | bsd-3-clause | 123,044 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 30 14:49:04 2017
@author: Sebastijan Mrak <smrak@gmail.com>
"""
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
def plotGpsPolarTrajectory(azimuth=[],elevation=[],labels... | aldebaran1/gsit | gsit/pyGpsUtils.py | Python | mit | 4,890 |
__author__ = 'ntrepid8'
import agilebot.cmd_util
import logging
from logging import NullHandler
import json
import sys
import argparse
from agilebot import util
from functools import partial
import os
logger = logging.getLogger('agilebot.slack')
logger.addHandler(NullHandler())
def create_bot(args, conf):
# updat... | ntrepid8/agilebot | agilebot/cmd_slack.py | Python | mit | 2,977 |
import hashlib
from django.core.cache import cache
from django.utils import six
from django.template.defaultfilters import slugify
try:
from django.utils.encoding import force_bytes
except ImportError:
force_bytes = str
try:
from django.contrib.auth import get_user_model
except ImportError:
from djan... | barbuza/django-avatar | avatar/util.py | Python | bsd-3-clause | 4,051 |
# Copyright 2019 the gRPC 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 in wri... | grpc/grpc-ios | native_src/examples/python/cancellation/test/_cancellation_example_test.py | Python | apache-2.0 | 3,200 |
# -*- coding:utf-8 -*-
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import vm
vm_ops = None
def test():
global vm_ops
vm_ops = vm.VM()
vm_ops.cancel_create_operation(res_type='vm', close=False)
vm_ops.cancel_create_operation(res_type='vm', close=True)
... | zstackio/zstack-woodpecker | integrationtest/vm/e2e_mini/vm/test_cancel_create_vm.py | Python | apache-2.0 | 627 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | belokop/indico_bare | indico/core/signals/users.py | Python | gpl-3.0 | 1,899 |
# 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... | dennybaa/st2 | st2common/st2common/exceptions/workflow.py | Python | apache-2.0 | 908 |
# Yith Library Server is a password storage server.
# Copyright (C) 2012-2013 Yaco Sistemas
# Copyright (C) 2012-2013 Alejandro Blanco Escudero <alejandro.b.e@gmail.com>
# Copyright (C) 2012-2013 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is... | lorenzogil/yith-library-server | yithlibraryserver/oauth2/client.py | Python | agpl-3.0 | 3,226 |
"""
Transitland Python Client.
This library implements an interface for the Transitland Feed Registry, Transitland Datastore, and working with Onestop IDs:
https://github.com/transit-land/onestop-id
Modules:
registry - Feed Registry reader
entities - Transitland entities
geom - Geometry utilities
util - ... | transitland/transitland-python-client | transitland/__init__.py | Python | mit | 463 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Publishes a set of extensions to the webstore.
Given an unpacked extension, compresses and sends to the Chrome webstore.
Relea... | danakj/chromium | chrome/browser/resources/chromeos/chromevox/tools/publish_webstore_extension.py | Python | bsd-3-clause | 4,983 |
import receipt
import account_voucher
import receiptbook
import receipt_pay
import report
| pronexo-odoo/odoo-argentina | l10n_ar_receipt/__init__.py | Python | agpl-3.0 | 97 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('bookqa',
url(r'^$', 'views.qa_list', {'category_id':"0",'page_num':"0"}),
url(r'^qa_list/(\... | jintianfree/bookbook | bookqa/urls.py | Python | gpl-3.0 | 1,015 |
# Copyright 2017, Google LLC 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 a... | googleapis/python-vision | google/cloud/vision_helpers/decorators.py | Python | apache-2.0 | 4,181 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2012 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# ----------------------------------------------------------... | duyuan11/glumpy | glumpy/ext/freetype/ft_enums/ft_encodings.py | Python | bsd-3-clause | 4,049 |
import doctest
import pytest
from insights.parsers import ParseException, SkipException
from insights.parsers import sctp
from insights.parsers.sctp import SCTPEps
from insights.parsers.sctp import SCTPAsc, SCTPAsc7
from insights.parsers.sctp import SCTPSnmp
from insights.tests import context_wrap
SCTP_EPS_DETAILS = ... | RedHatInsights/insights-core | insights/parsers/tests/test_sctp.py | Python | apache-2.0 | 13,044 |
##########################################################################
#
# Copyright (c) 2019, Image Engine Design 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:
#
# * Redistrib... | lucienfostier/gaffer | startup/view/previews.py | Python | bsd-3-clause | 1,959 |
#! /usr/bin/python2.6
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness ha... | 2ndy/RaspIM | usr/lib/python2.6/test/pystone.py | Python | gpl-2.0 | 7,366 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | xorpaul/check_mk | mkeventd/web/plugins/config/mkeventd.py | Python | gpl-2.0 | 1,968 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "si_py.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | xuanthuong/python-myocr | si_py/manage.py | Python | mit | 803 |
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2016 mrknow
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 l... | mrknow/filmkodi | plugin.video.mrknowtv/resources/lib/indexers/tvshows.py | Python | apache-2.0 | 51,870 |
#codeing=utf-8
def a(m,n):
n.append(m)
print(n)
if __name__ == "__main__":
a([9,8,7],[])
a([4,4,4],[])
| bosichong/17python.com | deftest/deftest.py | Python | apache-2.0 | 121 |
import sys
import matplotlib.pyplot as plt
import numpy as np
a = np.fromfile(sys.stdin, dtype='>u2')
for ch in xrange(4):
plt.plot(a[ch::4], alpha=.7, label='ch%d'%ch)
plt.legend()
plt.show() | thotypous/AcqSys | src/emu/plotdac.py | Python | mit | 197 |
import json
from discord.ext import commands
from audio import AudioPlayer
def load_credentials():
with open('creds.json') as f:
return json.load(f)
cmd_extensions = [
'cogs.ping',
'cogs.foam',
'cogs.bizkit',
'cogs.response'
]
description = "The ultimate annoy bot"
cmd_prefix = '--'
bot... | Flamacue/foambot | foambot/bot.py | Python | apache-2.0 | 573 |
#!/usr/bin/python
# -*-coding:utf8-*-
"""
Decompression all the zip and rar files in the specific directory.
"""
import os
import zipfile
import traceback
import argparse
from pprint import pprint
def find_path_file(specific_file, search_directory):
"""
result_path_filename
"""
result_path_filen... | openslack/openslack-crawler | scripts/decomperssion.py | Python | apache-2.0 | 2,025 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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 prog... | TheBraveWarrior/pyload | module/common/JsEngine.py | Python | gpl-3.0 | 6,373 |
from scipy.stats import mstats
from pylab import plot, title, xlabel, ylabel, show
from numpy import array, zeros, sqrt, shape
epsilon[]
MEAN_REVERTING_PERIOD = 60
epsilon = list[]
X_t = list[]
for i in range(0, MEAN_REVERTING_PERIOD-1):
X_t[i] = sum(epsilon[0:i])
X_t
# Gradient & intercept
# a = 0.00019405... | AvengersPy/MyPairs | Simulation/OU.py | Python | apache-2.0 | 1,045 |
# =============================================================================
# Authors: PAR Government
# Organization: DARPA
#
# Copyright (c) 2016 PAR Government
# All rights reserved.
#==============================================================================
from os.path import expanduser
import new
from typ... | rwgdrummer/maskgen | maskgen/support.py | Python | bsd-3-clause | 7,641 |
import os, sys, shlex
from base import *
from task import *
from tmux import *
__all__ = [ 'create_layout', 'create_window', 'layout2tmux', 'all_context_templates', 'site_dir_contexts', 'user_dir_contexts', 'all_windows' ]
#DEBUG ONLY
__all__ += [ 'layout', 'reg_order' ]
all_context_templates = {}
T_OPEN = '('
T_CL... | bl0b/hack-ide | py/layout.py | Python | bsd-3-clause | 8,034 |
# coding=utf8
#
# Copyright 2013 Dreamlab Onet.pl
#
# This library 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;
# version 3.0.
# This library is distributed in the hope that it will be useful,
# bu... | tikan/rmock | src/rmock/core/spec.py | Python | lgpl-3.0 | 1,016 |
"""Project Euler - Problem 1 - http://projecteuler.net/problem=1"""
import sys
import time
import tools.timeutils as timeutils
def sum_numbers():
"""
Sums all natural numbers below 1000 that are multiples of 3 or 5
Returns: int
"""
a, b = 1, 0
while a < 1000:
if (a % 3 == 0) or (a % 5 ... | rentes/Euler | problem1.py | Python | mit | 577 |
"""This module provides the blueprint for some basic API endpoints.
For more information please refer to the documentation: http://bigchaindb.com/http-api
"""
import logging
from flask import current_app, request, jsonify
from flask_restful import Resource, reqparse
from bigchaindb.common.exceptions import SchemaVal... | stanta/darfchain | darfchain_docker_vagrant/bigchaindb/web/views/transactions.py | Python | gpl-3.0 | 3,446 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import codecs
import shutil
import sys
import os
import commands
from time import time
ratio_10=0
tiempo_10=0
ratio_100=0
tiempo_100=0
ratio_1000=0
tiempo_1000=0
ratio_10000=0
tiempo_10000=0
ratio_100000=0
tiempo_100000=0
file=open('bzip2.txt')
for line in file:
line=line.spl... | pasilvagh/U | compresionTexto/extract.py | Python | mit | 7,682 |
# 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... | ucloud/uai-sdk | examples/mxnet/train/imagenet/code/symbols/googlenet.py | Python | apache-2.0 | 4,152 |
# Generated by Django 3.0.4 on 2020-10-21 15:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0121_auto_20201020_1707'),
]
operations = [
migrations.AlterField(
model_name='book',
name='savings',
... | openstax/openstax-cms | books/migrations/0122_auto_20201021_1050.py | Python | agpl-3.0 | 394 |
import inspect
# from collections import OrderedDict as odict
import numpy as np
from galry import Manager, TextVisual, get_color, NavigationEventProcessor, \
DefaultEventProcessor, EventProcessor, GridEventProcessor, ordict, \
log_debug, log_info, log_warn
__all__ = ['InteractionManager']
class ... | DavidTingley/ephys-processing-pipeline | installation/klustaviewa-0.3.0/galry/interactionmanager.py | Python | gpl-3.0 | 4,278 |
fib1 = 1
fib2 = 2
temp = 0
count = 3
while(len(str(fib2)) < 1000):
temp = fib2
fib2 = fib1 + fib2
fib1 = temp
count += 1
print count
| dlakata/projecteuler | p25.py | Python | gpl-2.0 | 138 |
#!/usr/bin/env python
'''Parser for the plain text version of congressional record documents
outputs the text marked up with xml
'''
import datetime
import os
import argparse
from .fdsys.cr_parser import parse_directory, parse_single
from .fdsys.simple_scrape import find_fdsys
def daterange(start, end, date_for... | jprinc16/congressional-record | congressionalrecord/cli.py | Python | bsd-3-clause | 6,024 |
'''This gives a main() function that serves as a nice wrapper
around other commands and presents the ability to serve up multiple
command-line functions from a single python script.
'''
import os, os.path, tempfile, sys, shutil, logging, argparse
import util.version
__author__ = "dpark@broadinstitute.org"
__version__... | broadinstitute/cms | cms/util/cmd.py | Python | bsd-2-clause | 7,134 |
import os
import mimetypes
import logging
from datetime import datetime, date
from dateutil.tz import tzutc
import dateutil.parser
from sqlalchemy import and_, or_, func, asc as ascending, desc as descending, event
from sqlalchemy.types import *
from sqlalchemy.sql.functions import coalesce
from sqlalchemy.orm import ... | jessedhillon/roxy | roxy/model.py | Python | mit | 18,838 |
# -*- coding: utf-8 -*-
from mock import Mock, patch
from flask.ext.login import login_user
from feedback_test.unit.test_base import BaseTestCase
from feedback_test.unit.util import insert_a_user
from feedback.user.models import User
class TestLoginAuth(BaseTestCase):
render_template = True
def setUp(self)... | codeforamerica/mdc-feedback | feedback_test/unit/public/test_public.py | Python | mit | 2,042 |
"""Wrapper functions for Tcl/Tk.
Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.
... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/tkinter/__init__.py | Python | mit | 158,068 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.