code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Carga de paños.py
#
# Copyright 2013 Akoharowen <alejandrofabrega@ingenieriapesquera.com.ar>
#
# 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 Foundat... | Alitux/LibreShen | Módulos Python/CargadePanos.py | Python | gpl-2.0 | 3,307 |
# 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
# d... | sebrandon1/nova | nova/tests/functional/db/test_connection_switch.py | Python | apache-2.0 | 2,651 |
# -*- coding: utf-8 -*-
#
# sbscraper documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 14 06:27:27 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | quoppy/sbscraper | docs/conf.py | Python | apache-2.0 | 9,939 |
"""
Run latency & thruput tests on various server configurations.
"""
import glob
import os.path
import shutil
import time
from openmdao.main.mp_util import read_server_config
from openmdao.main.objserverfactory import connect, start_server
from openmdao.util.fileutil import onerror
MESSAGE_DATA = []
def init_mess... | DailyActie/Surrogate-Model | 01-codes/OpenMDAO-Framework-dev/openmdao.main/src/openmdao/main/test/netperf.py | Python | mit | 3,996 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from __future__ import absolute_import
from rapidsms.message import Message
from rapidsms.connection import Connection
from . import backend
from email import message_from_string
from django.core.mail import *
class Backend(backend.Backend):
'''Uses the django ... | ewheeler/rapidsms-core | lib/rapidsms/backends/email.py | Python | lgpl-3.0 | 4,516 |
import copy
from fdisk_wrapper import FDisk
from parted_wrapper import Parted
from Partition import *
class BlockDeviceErr:
pass
class BlockDeviceErr_occupied(BlockDeviceErr):
pass
class BlockDeviceErr_cannotFit(BlockDeviceErr):
pass
class BlockDeviceErr_extended(BlockDeviceErr):
pass
class BlockDe... | andyvand/cygsystem-config-llvm | src/BlockDevice.py | Python | gpl-2.0 | 11,510 |
#!/usr/bin/env python
# str_methods.py -- Add __str__ and __unicode__ methods to financial objects
#
## @file
# @brief Add __str__ and __unicode__ methods to financial objects so that @code print object @endcode leads to human readable results
# @author Christoph Holtermann, c.holtermann@gmx.de
# @ingroup pyt... | hypatia/gnucash | src/optional/python-bindings/example_scripts/str_methods.py | Python | gpl-2.0 | 6,953 |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Command for deleting target pools."""
from googlecloudsdk.compute.lib import base_classes
class Delete(base_classes.RegionalDeleter):
"""Delete target pools."""
@staticmethod
def Args(parser):
cli = Delete.GetCLIGenerator()
base_classes.RegionalDelet... | wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/target_pools/delete.py | Python | apache-2.0 | 739 |
"""each attribute indicates a supported module or feature."""
import os
import sys
def module_exists(mod):
try:
__import__(mod)
except ImportError:
return False
else:
return True
sqlobject = module_exists('sqlobject')
sqlalchemy = module_exists('sqlalchemy')
elixir = module_e... | patrickod/fixture | fixture/test/env_supports.py | Python | lgpl-2.1 | 367 |
import copy
from difflib import SequenceMatcher
from coalib.results.Diff import ConflictError, Diff
from coalib.results.SourceRange import SourceRange
def filter_results(original_file_dict,
modified_file_dict,
original_results,
modified_results):
"""
F... | refeed/coala | coalib/results/ResultFilter.py | Python | agpl-3.0 | 9,630 |
# pylint: disable=invalid-name,unused-variable,invalid-name
"""Bitserial conv2d schedule on raspberry pi"""
from __future__ import absolute_import as _abs
from collections import namedtuple
import tvm
from .. import tag
from ..nn.pad import pad
from ..nn.bitserial_conv2d import bitserial_conv2d, _get_schedule, _get_wor... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/topi/python/topi/arm_cpu/bitserial_conv2d.py | Python | apache-2.0 | 15,086 |
from Products.DataCollector.plugins.CollectorPlugin import CommandPlugin
from Products.DataCollector.plugins.DataMaps import MultiArgs
CPUMULTIPLIER = {
'MHz' : 1,
'GHz' : 1000
}
L2MULTIPLIER = {
'kB' : 1,
'M' : 1024,
'MB' : 1024,
'Megabytes' : 1024,
}
class cpu(CommandPlugin):
"""
fi... | zenoss/ZenPacks.community.OSX | ZenPacks/community/OSX/modeler/plugins/zenoss/cmd/osx/cpu.py | Python | gpl-2.0 | 2,750 |
"""HTTP endpoints for the Teams API."""
from django.shortcuts import render_to_response
from django.http import Http404
from django.conf import settings
from django.core.paginator import Paginator
from django.views.generic.base import View
from rest_framework.generics import GenericAPIView
from rest_framework.response... | utecuy/edx-platform | lms/djangoapps/teams/views.py | Python | agpl-3.0 | 46,197 |
import unittest
from tahoma.action import Action
class TestAction(unittest.TestCase):
def test_empty(self):
act = Action(None)
self.assertEqual("", act.deviceURL)
self.assertEqual(0, len(act.commands))
def test_deviceURL(self):
act = Action("tst")
self.assertEqual('ts... | bpannier/TahomaProtocol | tests/test_action.py | Python | apache-2.0 | 2,699 |
#!/usr/bin/env python
import getopt
import os
import pathlib
import re
import sys
import libsvadarts as sva
from pprint import pprint
rootdir = os.path.dirname(os.path.abspath(__file__)) + '/../docs/data/'
def main(argv):
# per seizoen
data = {}
competitions = sva.exec_select_query('''
SELECT... | basbloemsaat/dartsense | bin/sva_darts_gen_json.py | Python | mit | 7,636 |
import attr
import datetime
import requests
import random
import re
import json
# TODO: Only import when required
# Or maybe just replace usage with `html.parser`?
import bs4
from ._common import log, kw_only
from . import _graphql, _util, _exception
from typing import Optional, Mapping, Callable, Any
SERVER_JS_DE... | carpedm20/fbchat | fbchat/_session.py | Python | bsd-3-clause | 19,974 |
#!/usr/bin/env python
"""Tests for grr.parsers.cron_file_parser."""
import os
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_paths
from grr.parsers import cron_file_parser
class TestCronTabParsing(test_lib.GRRBase... | destijl/grr | grr/parsers/cron_file_parser_test.py | Python | apache-2.0 | 1,434 |
from __future__ import absolute_import, unicode_literals
from django import forms
from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME
from django.forms.util import ErrorDict, ErrorList
from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory, BaseModelFormSet
from d... | dex4er/django | tests/model_formsets_regress/tests.py | Python | bsd-3-clause | 17,594 |
#05_03_converters_final
class ScaleConverter:
def __init__(self, units_from, units_to, factor):
self.units_from = units_from
self.units_to = units_to
self.factor = factor
def description(self):
return 'Convert ' + self.units_from + ' to ' + self.units_to
def convert(self, value):
return value * self.f... | simonmonk/prog_pi_ed2 | 05_03_converters_final.py | Python | mit | 864 |
# Copyright (C) 2015 Manuel Hirschauer (manuel@hirschauer.net)
#
# 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; either
# version 2.1 of the License, or (at your option) any later ve... | shouldmakemusic/yaas | util/RangeUtil.py | Python | gpl-2.0 | 6,378 |
# -*- coding: utf-8 -*-
u"""Test getting own and adm jobs.
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
import os
from pykern.pkcollections import PKDict
i... | mkeilman/sirepo | tests/adm_and_own_jobs_test.py | Python | apache-2.0 | 5,759 |
'''
TabbedPanel
===========
.. image:: images/tabbed_panel.jpg
:align: right
.. versionadded:: 1.3.0
The `TabbedPanel` widget manages different widgets in tabs, with a header area
for the actual tab buttons and a content area for showing the current tab
content.
The :class:`TabbedPanel` provides one default ta... | akshayaurora/kivy | kivy/uix/tabbedpanel.py | Python | mit | 29,195 |
__author__ = 'Paul Osborne'
__version__ = '0.2.3'
| posborne/putio-sync | putiosync/__init__.py | Python | mit | 50 |
import re # for regular expressions
import urllib # for url encoding
import urllib2 # for getting the gear from Wikipedia
from fusiontables.ftclient import *
from fusiontables.clientlogin import ClientLogin
from fusiontables.sqlbuilder import SQL
# Get a list of museums in England that have museums
url = 'http://en.w... | blackradley/heathmynd | data/src/xxxProgram.py | Python | mit | 2,028 |
import os
import codecs
import pytest
from mitmproxy.net import websockets
from mitmproxy.test import tutils
class TestFrameHeader:
@pytest.mark.parametrize("input,expected", [
(0, '0100'),
(125, '017D'),
(126, '017E007E'),
(127, '017E007F'),
(142, '017E008E'),
(6... | MatthewShao/mitmproxy | test/mitmproxy/net/websockets/test_frame.py | Python | mit | 5,155 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2017-12-27 14:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('candidates', '0026_auto_20171227_1429'),
]
operations = [
migrations.RemoveField(
... | macwis/simplehr | candidates/migrations/0027_auto_20171227_1432.py | Python | gpl-3.0 | 507 |
#!/usr/bin/env python
# coding=utf-8
import argparse
import os.path
from solc import compile_standard
from pathlib import Path
from util import findDict, run_command, path_leaf, add_hex_0x, solidity_file_dirname
import simplejson
def save_abi(abi):
abiFile = open("../output/compiled/abi", "w+")
abiFile.wr... | urugang/cita | admintool/txtool/txtool/compile.py | Python | gpl-3.0 | 2,806 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/merlin/merlin/components/Curator.py | Python | gpl-2.0 | 1,308 |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | shadowmint/nwidget | lib/cocos2d-0.5.5/cocos/actions/interval_actions.py | Python | apache-2.0 | 22,046 |
from widgy.site import WidgySite
class FusionboxDemoProject(WidgySite):
pass
site = FusionboxDemoProject()
| zmetcalf/fusionbox-demo-project | fusionbox_demo_project/widgy_site.py | Python | gpl-3.0 | 113 |
"""
Tests for the parts of jsonschema related to the :validator:`format` property.
"""
from jsonschema.tests.compat import mock, unittest
from jsonschema import FormatError, ValidationError, FormatChecker
from jsonschema.validators import Draft4Validator
class TestFormatChecker(unittest.TestCase):
def setUp(se... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/jsonschema/tests/test_format.py | Python | mit | 2,148 |
# Description: Shows why ReliefF needs to check the cached neighbours
# Category: statistics
# Classes: MeasureAttribute_relief
# Uses: iris
# Referenced: MeasureAttribute.htm
import orange
data = orange.ExampleTable("iris")
r1 = orange.MeasureAttribute_relief()
r2 = orange.MeasureAttribute_relief(chec... | yzl0083/orange | Orange/testing/regression/tests_20/reference_MeasureAttribute4.py | Python | gpl-3.0 | 468 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module defines the VaspInputSet abstract base class and a concrete
implementation for the parameters developed and tested by the core team
of pymatgen, including the Materials Virtual Lab, Materials Pr... | mbkumar/pymatgen | pymatgen/io/vasp/sets.py | Python | mit | 110,153 |
#-*- coding:utf-8 -*-
#########################################################################
# File Name: equationSets.py
# Author: Shen Bo
# mail: nichol_shen@yahoo.com
# Created Time: Thu, May 03, 2018 3:07:48 PM
#########################################################################
#!usr/bin/env python3
impo... | Yushenbo/Python_notes | mathmatics/linearAlgebra/chapter01/equationSets.py | Python | gpl-3.0 | 1,296 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | Panos512/invenio-records | invenio_records/signals.py | Python | gpl-2.0 | 1,969 |
import numpy as np
import glob
from scipy import misc
data_dir = '../../data/raw/Ara2013-Canon/'
target_dir = '../../data/processed/'
x_names = glob.glob(data_dir+'*rgb.png')
y_names = glob.glob(data_dir+'*label.png')
print(x_names)
x_train = np.array([np.array(misc.imresize(misc.imread(fname),(128,128)), dtype=np.i... | andrewkeenan/PlantSeg | src/data/resize.py | Python | mit | 848 |
import sketches
def get_sketch(sketch_type, hash_length, columns, rows, xi_func,
avg_func, hash_func):
if sketch_type=='AGMS':
if xi_func == "default": xi_func = "eh3"
if hash_length==8:
sketch = sketches.AGMS8(columns, rows, xi_func, avg_func)
elif hash_length=... | esterl/sketches-evaluation | scripts/utils.py | Python | gpl-3.0 | 2,589 |
import datetime
class Table(object):
def __init__(self):
self.idn = ''
self.q = []
self.min_wait = datetime.timedelta(minutes = 0) | aaronyan/line | functions/algorithms/classes/table.py | Python | mit | 138 |
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from pylab import rcParams
# import os
def create_plots(setup, cwd=''):
"""
Function to create detailed heatmaps and the iteration plot for a single fault
Args:
setup (str): name of the setup (heat or adve... | danielru/pySDC | projects/node_failure/postproc_hard_faults_detail.py | Python | bsd-2-clause | 5,651 |
#! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env w... | huran2014/huran.github.io | wot_gateway/usr/lib/python2.7/cgi.py | Python | gpl-2.0 | 34,505 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space 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 t... | mozts2005/OuterSpace | server/lib/ige/ospace/IFleet.py | Python | gpl-2.0 | 52,469 |
"""
David R. Rodriguez
Package containing UVW and XYZ functions
"""
from math import cos, sin
from astropy.coordinates import SkyCoord
import numpy as np
# ===================================================
def uvw(ra, dec, d, pmra, pmde, rv):
"""
Function to calculate UVW given RA, Dec, Distance, RV, and ... | dr-rodriguez/Kinematics-App | kinematics_app/druvw.py | Python | mit | 3,078 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 version.
#
# wger W... | rolandgeider/wger | wger/nutrition/tests/test_weight_unit.py | Python | agpl-3.0 | 3,882 |
#!/usr/bin/env python
# Z. Mashologu (SANBI-UWC)
# import dict as dict
from __future__ import print_function
import os
import sys
import logging
import argparse
import shlex
from subprocess import check_call, CalledProcessError
from json import loads, dumps
log = logging.getLogger(__name__)
DEFAULT_DATA_TABLE_NAME = ... | SANBI-SA/tools-sanbi-uwc | data_managers/data_manager_novocraft_index_builder/data_manager/novocraft_index_builder.py | Python | gpl-3.0 | 3,018 |
# Copyright 2014 Open vStorage NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | tcpcloud/openvstorage | ovs/extensions/rabbitmq/mappings/mapping.py | Python | apache-2.0 | 5,610 |
import yaml
def get_plot_data():
stream = open('../test/data/qa-snr-r0-00000000.yaml', 'r')
data = yaml.load(stream)
elg_mag = data['SNR']['VALUE']['ELG_SNR_MAG'][1]
elg_snr = data['SNR']['VALUE']['ELG_SNR_MAG'][0]
elg_fiber_id = data['SNR']['VALUE']['ELG_FIBERID']
lrg_mag = data['SNR']['V... | linea-it/qlf-frontend | viz/service.py | Python | gpl-3.0 | 1,214 |
#!/usr/bin/env python3
import sys
import argparse
import numpy as np
from mapTools import *
from utilities import filesFromList, writeLog
from plotTools import addImagePlot
import matplotlib.pyplot as plt
'''
Description:
Author: Mikko Auvinen
mikko.auvinen@helsinki.fi
University of Helsinki &
... | mjsauvinen/P4UL | pyRaster/maskFromRasterTile.py | Python | mit | 2,291 |
##-------------------------------------------------------------------------
## Author: Owen Arnold @ ISIS/Tessella
## Date: 24/03/2011
## Purpose: Show signal cell data as surface plot. Sets color range between 0 and 3 for signal value.
##
##-------------------------------------------------------------------------
try... | dymkowsk/mantid | qt/paraview_ext/PVPlugins/Macros/ShowSignal.py | Python | gpl-3.0 | 1,010 |
async def foo():
yield
| Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/badsyntax_async6.py | Python | gpl-3.0 | 27 |
from __future__ import print_function
import sys
from miasm.analysis.binary import Container
from miasm.analysis.machine import Machine
from miasm.core.locationdb import LocationDB
fdesc = open(sys.argv[1], 'rb')
loc_db = LocationDB()
# The Container will provide a *bin_stream*, bytes source for the disasm engine
# I... | serpilliere/miasm | example/disasm/dis_binary.py | Python | gpl-2.0 | 1,112 |
from __future__ import unicode_literals
from django.conf.urls import url
from pttrack.urls import wrap_url
from . import views
from . import models
unwrapped_urlconf = [ # pylint: disable=invalid-name
url(r'^new-referral/(?P<pt_id>[0-9]+)/(?P<rtype>[-a-z]+)$',
views.ReferralCreate.as_view(),
name... | SaturdayNeighborhoodHealthClinic/clintools | referral/urls.py | Python | mit | 1,035 |
# Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | rainaashutosh/MyTestRekall | rekall-core/rekall/plugins/tools/aff4acquire.py | Python | gpl-2.0 | 33,442 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from django.core.management i... | Finntack/pootle | tests/commands/initdb.py | Python | gpl-3.0 | 1,868 |
# Copyright (c) 2011 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 ... | citrix-openstack/build-python-troveclient | troveclient/diagnostics.py | Python | apache-2.0 | 1,654 |
from django import template
from django.core.urlresolvers import reverse
from django.utils.http import urlquote_plus
from apps.cms.models import Content
register = template.Library()
@register.simple_tag (takes_context=True)
def cms_content (context, key):
request = context['request']
can_edit = request.user.... | normalnorway/normal.no | django/apps/cms/templatetags/cms.py | Python | gpl-3.0 | 942 |
import pygame
class Ship():
def __init__(self, ai_settings, screen):
"""Initialize the ship and set its starting position."""
self.screen = screen
self.ai_settings = ai_settings
# Load the ship image and get its rect.
self.image = pygame.image.load('./ship.bmp')
self... | Code-In-Action/python-in-action | pcc/game/ship.py | Python | mit | 1,412 |
#!/usr/bin/env python
"""The EE Python library."""
__version__ = '0.1.102'
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
# pylint: disable=g-bad-import-order
import collections
import datetime
import inspect
import numbers
import os
import six
from . import batch
fro... | mortcanty/earthengine | src/ee/__init__.py | Python | mit | 11,847 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
long_desc = '''
This package contains the ${name} Sphinx extension.
.. add description here ..
'''
requires = ['Sphinx>=0.6']
setup(
name='sphinxcontrib-${name}',
version='0.1',
url='http://bitbucket.org/birkenfeld/sphinx-contrib',
... | Lemma1/MAC-POSTS | doc_builder/sphinx-contrib/_template/setup.py | Python | mit | 1,194 |
# coding=utf-8
import unittest
"""730. Count Different Palindromic Subsequences
https://leetcode.com/problems/count-different-palindromic-subsequences/description/
Given a string S, find the number of different non-empty palindromic
subsequences in S, and **return that number modulo`10^9 + 7`.**
A subsequence of a s... | openqt/algorithms | leetcode/python/lc730-count-different-palindromic-subsequences.py | Python | gpl-3.0 | 1,586 |
from django.contrib.localflavor.co.forms import CODepartmentSelect
from utils import LocalFlavorTestCase
class COLocalFlavorTests(LocalFlavorTestCase):
def test_CODepartmentSelect(self):
d = CODepartmentSelect()
out = u"""<select name="department">
<option value="AMA">Amazonas</option>
<option val... | disqus/django-old | tests/regressiontests/forms/localflavor/co.py | Python | bsd-3-clause | 1,661 |
import collections
from typing import Dict, List, Optional, Union
import numpy
import pandas as pd
from flask import flash, g, render_template, request, url_for
from flask_babel import format_number, lazy_gettext as _
from flask_wtf import FlaskForm
from werkzeug.utils import redirect, secure_filename
from werkzeug.wr... | craws/OpenAtlas-Python | openatlas/views/imports.py | Python | gpl-2.0 | 13,052 |
__author__ = 'nerocrux'
| nerocrux/wayterm | src/templates/__init__.py | Python | mit | 24 |
# Copyright 2015 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.
import logging
import chrome_proxy_metrics as metrics
from common import chrome_proxy_measurements as measurements
from telemetry.core import exceptions
fro... | axinging/chromium-crosswalk | tools/chrome_proxy/live_tests/chrome_proxy_measurements.py | Python | bsd-3-clause | 3,178 |
################################################################################
################################################################################
#
# Module: arm64_post_build.py
#
# Notes:
#
# This script is responsible for starting the x64 dotnet client. In order to
# do this it has to pass along the c... | sjsinju/coreclr | tests/scripts/arm64_post_build.py | Python | mit | 10,287 |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from .models import Comment
from .forms import CommentForm
from video.models import Video
# Create your views here.... | piocity/matsu | comment/views.py | Python | gpl-2.0 | 2,209 |
import sys
def solve():
moveList = sys.stdin.read().strip()
moves = {}
houseGrid = []
houseGrid.append([1])
moves['^'] = [-1, 0]
moves['v'] = [1, 0]
moves['<'] = [0, -1]
moves['>'] = [0, 1]
santa = {}
santa['x'] = 0
santa['y'] = 0
robo = {}
robo['x'] = 0
robo['y'] = 0
santaList = [(0,0)]
isSanta = Tr... | Jaemu/advent-of-code | python/day-3.py | Python | mit | 918 |
# Generated by Django 3.0.3 on 2020-03-06 10:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('WorkflowEngine', '0079_auto_20200131_1649'),
('ip', '0085_remove_inform... | ESSolutions/ESSArch_Core | ESSArch_Core/maintenance/migrations/0011_auto_20200306_1105.py | Python | gpl-3.0 | 5,985 |
from utils import CanadianJurisdiction
class Brossard(CanadianJurisdiction):
classification = 'legislature'
division_id = 'ocd-division/country:ca/csd:2458007'
division_name = 'Brossard'
name = 'Conseil municipal de Brossard'
url = 'http://www.ville.brossard.qc.ca'
| opencivicdata/scrapers-ca | ca_qc_brossard/__init__.py | Python | mit | 288 |
import internetarchive.exceptions
def test_AuthenticationError():
try:
raise internetarchive.exceptions.AuthenticationError('Authentication Failed')
except Exception as exc:
assert str(exc) == """Authentication Failed"""
| JesseWeinstein/internetarchive | tests/test_exceptions.py | Python | agpl-3.0 | 247 |
"""Fixer that changes unicode to str, unichr to chr, and u"..." into "...".
"""
import re
from ..pgen2 import token
from .. import fixer_base
_mapping = {u"unichr" : u"chr", u"unicode" : u"str"}
_literal_re = re.compile(ur"[uU][rR]?[\'\"]")
class FixUnicode(fixer_base.BaseFix):
PATTERN = "STRING |... | babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/lib2to3/fixes/fix_unicode.py | Python | mit | 721 |
#-------------------------------------------------------------------------------
#
# Generally useful developer related helper functions and classes.
#
# Package owner/architect: David C. Morrill
#
# Date: 07/04/2006
#
# (c) Copyright 2006 by David C. Morrill
#
# NOTE: Modifications to the contents of this package... | enthought/etsproxy | enthought/developer/helper/__init__.py | Python | bsd-3-clause | 696 |
import gevent
from gevent.pywsgi import WSGIServer, WSGIHandler
import logging
import os
import socket
import threading
import traceback
from ajenti.api import *
from ajenti.plugins import manager
from ajenti.util import public
@public
@rootcontext
@interface
class IPCHandler (object):
"""
Interface for cust... | lupyuen/RaspberryPiImage | usr/share/pyshared/ajenti/ipc.py | Python | apache-2.0 | 2,291 |
import datetime
from will.plugin import WillPlugin
from will.decorators import respond_to
class RemindPlugin(WillPlugin):
@respond_to("remind me to (?P<reminder_text>.*?) (at|on) (?P<remind_time>.*)")
def remind_me_at(self, message, reminder_text=None, remind_time=None):
"""remind me to ___ at ___: S... | Regner/will | will/plugins/productivity/remind.py | Python | mit | 1,881 |
"""
Check the speed of the conjugate gradient solver.
"""
from __future__ import division, print_function, absolute_import
import time
import numpy as np
from numpy.testing import Tester, TestCase, assert_allclose, assert_equal
from scipy import linalg, sparse
import scipy.sparse.linalg
def _create_sparse_poisson... | maciejkula/scipy | scipy/sparse/linalg/isolve/benchmarks/bench_cg.py | Python | bsd-3-clause | 2,905 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'nebbrowser.ui'
#
# Created: Mon Jan 21 17:38:15 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attr... | js850/PyGMIN | pygmin/gui/ui/nebbrowser.py | Python | gpl-3.0 | 1,343 |
import gdb
import gdb.printing
class MacroPrinter(object):
"Print a struct macro *"
def __init__(self, val):
self.val = val
def to_string(self):
result = ""
mp = self.val
while mp:
if len(result) > 1000:
return result + '...'
t = str(mp['type'])
if t == 'MACRO_ATOM':
... | dleonard0/state | macro-gdb.py | Python | bsd-3-clause | 2,169 |
#!/usr/bin/env python
#
# 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 ... | shutterfly/logtools | logtools/parsers.py | Python | apache-2.0 | 8,614 |
from . utils import * | svenfraeys/py-pinterest | pinterest/__init__.py | Python | mit | 21 |
from cbd.component import ComponentABC as _ComponentABC
from cbd.system import SystemABC as _SystemABC
from collections import namedtuple as _struct
from enum import Enum as _Enum
class _ControlComponent(_ComponentABC):
name = 'control'
class Inputs(_Enum):
LEFT = 0
RIGHT = 1
UP = 2
DOWN = 3
A = ... | jrburga/VGEngine | vgengine/systems/control.py | Python | mit | 4,386 |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Json reporting for coverage.py"""
import datetime
import json
import sys
from coverage import __version__
from coverage.report import get_analysis_to_report
fro... | hugovk/coveragepy | coverage/jsonreport.py | Python | apache-2.0 | 3,812 |
# Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# 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 ... | dsweet04/rekall | rekall-core/rekall/plugins/renderers/xls.py | Python | gpl-2.0 | 9,365 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import pytest
import atx
d = atx.connect(platform='dummy')
def setup_function(f):
d.resolution = (1280, 720)
def test_setget_resolution():
assert d.resolution == (720, 1280)
d.resolution = None # None is also OK to set
assert d.re... | Andy-hpliu/AirtestX | tests/test_dummy.py | Python | apache-2.0 | 1,852 |
# -*- coding: utf-8 -*-
from ircb.models import Network
from ircb.storeclient.base import BaseStore
from ircb.lib.constants.signals import (STORE_NETWORK_CREATE,
STORE_NETWORK_CREATED,
STORE_NETWORK_GET,
... | waartaa/ircb | ircb/storeclient/network.py | Python | mit | 760 |
# -*- coding: utf-8 -*-
#
# django-wiki documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 23 16:13:51 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | Attorney-Fee/django-wiki | docs/conf.py | Python | gpl-3.0 | 7,768 |
"""
Allows easy loading of pixmaps used in UI elements.
Provides support for frozen environments as well.
"""
import os, sys, pickle
from ..functions import makeQImage
from ..Qt import QtGui
if sys.version_info[0] == 2:
from . import pixmapData_2 as pixmapData
else:
from . import pixmapData_3 as pixmapData
... | jensengrouppsu/rapid | rapid/pyqtgraph/pixmaps/__init__.py | Python | mit | 768 |
#!/usr/bin/env python3
'''
lib/schema/completions.py
Schema definition for responses from completion requests.
'''
import logging
import re
from ..schema.request import RequestParameters
from ..util.format import json_parse
logger = logging.getLogger('sublime-ycmd.' + __name__)
class CompletionResponse(object):
... | sublime-ycmd/sublime-ycmd | lib/schema/completions.py | Python | mit | 18,503 |
import os
from string import Template
from robocompdsl.templates.common.templatedict import TemplateDict
from robocompdsl.templates.common.abstracttemplatesmanager import CustomTemplate as CTemplate
ICE_EXCEPTION_STR = """\
exception ${type_name}{${type_content}};
"""
ICE_SEQUENCE_STR = """\
sequence <${type_sequenc... | robocomp/robocomp | tools/cli/robocompdsl/robocompdsl/templates/templateICE/plugins/base/functions/TEMPLATE_ICE.py | Python | gpl-3.0 | 5,713 |
__version__ = '0.6-dev'
| whatevsz/rbackupd | rbackupd/version.py | Python | gpl-3.0 | 24 |
#!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | zstars/weblabdeusto | server/src/weblab/core/coordinator/redis/post_reservation.py | Python | bsd-2-clause | 4,437 |
# -*- coding: utf-8 -*-
# This file is part of the OpenSYMORO project. Please see
# https://github.com/symoro/symoro/blob/master/LICENCE for the licence.
"""This module contains the Symbol Manager tools."""
import itertools
import os
from sympy import sin, cos
from sympy import Symbol, Matrix, Expr
from sympy imp... | galou/symoro | symoroutils/symbolmgr.py | Python | mit | 22,121 |
#!/usr/bin/python
from Adafruit_I2C import Adafruit_I2C
import smbus
import time
import math
MCP23017_IODIRA = 0x00
MCP23017_IODIRB = 0x01
MCP23017_GPINTENA = 0x04
MCP23017_GPINTENB = 0x05
MCP23017_DEFVALA = 0x06
MCP23017_DEFVALB = 0x07
MCP23017_INTCONA = 0x08
MCP23017_INTCONB = 0x09
MCP23017_IOCON = 0x0A #0x0B is th... | Hydrosys4/Master | libraries/MCP/MCP23017/MCP23017.py | Python | gpl-3.0 | 15,024 |
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distri... | DolphinDream/sverchok | __init__.py | Python | gpl-3.0 | 3,287 |
"""
Test aptly task run
"""
| neolynx/aptly | system/t10_task/__init__.py | Python | mit | 28 |
# Reuben Thorpe (2015) 11th December Advent of Code [TSP]
from itertools import permutations
from math import factorial
import re
PARSE = r"(\S+) would (\S+) (\d+) happiness units by sitting next to (\S+)\."
def search(fileName):
data = re.compile(PARSE).findall(open(fileName, 'r').read())
names = list({line... | Reuben-Thorpe/Code.Eval | advent.of.code/2015/python/day13/dinner.table.py | Python | gpl-3.0 | 1,235 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | openthread/openthread | tools/harness-automation/cases_R140/ed_6_3_1.py | Python | bsd-3-clause | 1,869 |
# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | deepmind/mctx | mctx/__init__.py | Python | apache-2.0 | 2,421 |
# To build out the data you'll need to jump into the Django shell
#
# $ python manage.py shell
#
# and run the build script with
#
# $ from data.v2.build import build_all
# $ build_all()
#
# Each time the build script is run it will iterate over each table in the database,
# wipe it and rewrite each row... | phalt/pokeapi | data/v2/build.py | Python | bsd-3-clause | 71,280 |
# $Id$
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" command line util... | rdkit/rdkit-orig | rdkit/ML/AnalyzeComposite.py | Python | bsd-3-clause | 9,039 |
# -*- coding: utf-8 -*-
"""Module designed to handle the simple case when one wants to use Sprout but does not use the
parallelizer. Uses IPAppliance that is pushed on top of the appliance stack"""
import pytest
from threading import Timer
from fixtures.parallelizer import dump_pool_info
from fixtures.terminalreporte... | akrzos/cfme_tests | fixtures/single_appliance_sprout.py | Python | gpl-2.0 | 4,789 |
#!/usr/bin/env python
PERIOD2016 = [
(276262, 284484), # Hack, 2015, 1
(296939, 300287), # A
(300345, 300908), # B
(301912, 302393), # C
(302737, 303560), # D
(303638, 303892), # E
(303943, 304494), # F
(305291, 306714), # G
#(309314, 310216), # H, Low muon, Not used
(307124, 3... | xju2/xaodtools | scripts/data_period.py | Python | mit | 425 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.