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 |
|---|---|---|---|---|---|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_account_scenarios.py | Python | mit | 5,423 |
import re
from ..clients.github_client import GitHubClient
from ..downloaders.downloader_exception import DownloaderException
from ..clients.client_exception import ClientException
from .provider_exception import ProviderException
class GitHubUserProvider():
"""
Allows using a GitHub user/organization as th... | herove/dotfiles | sublime/Packages/Package Control/package_control/providers/github_user_provider.py | Python | mit | 5,870 |
# -*- coding: utf-8 -*-
import unittest
import plivohelper
import re
class PlivoTest(unittest.TestCase):
def strip(self, xml):
return re.sub(r'\n|\t', '', str(xml).strip())
def improperAppend(self, verb):
self.assertRaises(plivohelper.PlivoException, verb.append, plivohelper.Speak(""))
... | plivo/plivohelper-python | tests/test_restxml.py | Python | mit | 11,498 |
"""A collection of ORM sqlalchemy models for Caravel"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import json
import logging
import textwrap
from collections import namedtuple
from copy import de... | giaosudau/caravel | caravel/models.py | Python | apache-2.0 | 56,649 |
# vim:ts=4:et
# ##### 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 prog... | luaman/qforge-1 | tools/io_qfmap/map.py | Python | gpl-2.0 | 8,426 |
# -*- coding: UTF-8 -*-
'''
magento.checkout
Checkout API for magento
Allows you to manage shopping carts and the checkout process.
:copyright: (c) 2010 by Sharoon Thomas.
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD.
:license: AGPLv3, see LICENSE for more details
'''
f... | Mohitsahu123/magento-1 | magento/checkout.py | Python | agpl-3.0 | 12,274 |
from __future__ import print_function
import gevent
from opentracing.mocktracer import MockTracer
from opentracing.scope_managers.gevent import GeventScopeManager
from ..testcase import OpenTracingTestCase
class TestGevent(OpenTracingTestCase):
def setUp(self):
self.tracer = MockTracer(GeventScopeManage... | opentracing/opentracing-python | testbed/test_active_span_replacement/test_gevent.py | Python | apache-2.0 | 1,595 |
"""Helpers that help with state related things."""
import asyncio
from collections import defaultdict
import datetime as dt
import logging
from types import ModuleType, TracebackType
from typing import Any, Dict, Iterable, List, Optional, Type, Union
from homeassistant.components.sun import STATE_ABOVE_HORIZON, STATE_... | tchellomello/home-assistant | homeassistant/helpers/state.py | Python | apache-2.0 | 3,890 |
# Display animations of data, similar to the IDL routine
# of the same name
#
# Ben Dudson, University of York, July 2009
#
#
try:
print "Trying to import GTK..."
import gobject
widget = "gtk"
except:
print "failed\nTrying to import WX..."
try:
from wx import *
widget = "wx"
exc... | bendudson/BOUT-1.0 | tools/pylib/boututils/showdata.py | Python | gpl-3.0 | 4,241 |
#from Domain import Domain
# from .HelicopterHover import HelicopterHover, HelicopterHoverExtended
# from .HIVTreatment import HIVTreatment
# from .PuddleWorld import PuddleWorld
from .GridWorld import GridWorld
from .GridWorldInter import GridWorldInter
from .GridWorldTime import GridWorldTime
# from .BlocksWorld impo... | BerkeleyAutomation/rlpy | rlpy/CustomDomains/__init__.py | Python | bsd-3-clause | 1,218 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2017 Andrew Ziem
# https://www.bleachbit.org
#
# 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
# ... | brahmastra2016/bleachbit | bleachbit/RecognizeCleanerML.py | Python | gpl-3.0 | 5,942 |
# Copyright (c) 2017-2018 Martin Olejar
#
# SPDX-License-Identifier: BSD-3-Clause
# The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution
# or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText
from easy_enum import Enum
from struct import pack, unpack_from, ca... | molejar/pyIMX | imx/img/header.py | Python | bsd-3-clause | 4,906 |
${library_name_suffix}_${type_name} = ${python_module_name}.${type_name}()
| libyal/libyal | data/source/tests/pyyal_test_type/open_close-initialize.py | Python | apache-2.0 | 80 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012-2013 Zdenko Podobný
# Author: Zdenko Podobný
#
# 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/license... | zooniverse/aggregation | blog/old_weather/tess2.py | Python | apache-2.0 | 2,474 |
from collections import defaultdict
lines = []
with open('input', 'r') as f:
for line in f: lines.append(line)
graph = defaultdict(set)
def parse(l):
out, inner = l.split(' contain ')
out = ' '.join(out.split()[:-1])
if 'no other' in inner: return out, []
parts = inner.split(', ')
inner = []
... | jan25/code_sorted | adventofcode/2020/7/1.py | Python | unlicense | 769 |
from ..phone import phone_number
def BWCellNumber(value):
regex = '^[7]{1}[12345678]{1}[0-9]{6}$'
phone_number(value, regex, 'cell')
def BWTelephoneNumber(value):
regex = '^[0-9+\(\)#\.\s\/ext-]+$'
phone_number(value, regex, 'telephone')
| botswana-harvard/edc-base | edc_base/model_validators/bw/validators.py | Python | gpl-2.0 | 258 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pushkin', '0004_command_device_type'),
]
operations = [
migrations.CreateModel(
name='AuthParam',
fi... | ilique/webpushkin | pushkin/migrations/0005_authparam.py | Python | mit | 728 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | migua1204/jikexueyuan | 极客学院/BusStopBoard/node_modules/.3.4.0@node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | Python | apache-2.0 | 65,937 |
# -*- coding: utf-8 -*-
from sqlalchemy import func, asc
from operator import itemgetter
from bartendro import app, db
from flask import Flask, request, redirect, render_template
from flask.ext.login import login_required
from bartendro.model.drink import Drink
from bartendro.model.booze import Booze
from bartendro.mod... | stattenf/bartendro | ui/bartendro/view/admin/drink.py | Python | gpl-2.0 | 1,021 |
#!/usr/bin/env python
# encoding: utf-8
import logging
import datetime
from modularodm import Q
from dateutil.relativedelta import relativedelta
from framework.celery_tasks import app as celery_app
from scripts import utils as scripts_utils
from website.app import init_app
from website.addons.box.model import Box
... | jnayak1/osf.io | scripts/refresh_addon_tokens.py | Python | apache-2.0 | 2,733 |
import glob
import os
import pytest
import shutil
import requests
from .conftest import message, raiseYunohostError, get_test_apps_dir
from moulinette.utils.filesystem import mkdir
from yunohost.app import (
app_install,
app_remove,
app_ssowatconf,
_is_installed,
app_upgrade,
app_map,
)
from ... | YunoHost/yunohost | src/tests/test_apps.py | Python | agpl-3.0 | 12,737 |
# 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.
"""Provides fakes for several of Telemetry's internal objects.
These allow code like story_runner and Benchmark to be run and tested
without compiling or st... | Chilledheart/chromium | tools/telemetry/telemetry/testing/fakes/__init__.py | Python | bsd-3-clause | 6,686 |
import os
import sys
class RedirectStdStreams(object):
def __init__(self, stdout=None, stderr=None):
self._stdout = stdout or sys.stdout
self._stderr = stderr or sys.stderr
def __enter__(self):
self.old_stdout, self.old_stderr = sys.stdout, sys.stderr
self.old_stdout.flush(); ... | AlexandreOuellet/halite-bot | nn/CattleV2.py | Python | mit | 7,971 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-service-directory | samples/generated_samples/servicedirectory_v1beta1_generated_registration_service_delete_service_async.py | Python | apache-2.0 | 1,500 |
# Copyright (c) 2013 Yogesh Panchal, yspanchal@gmail.com
# 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 ... | yspanchal/bitbucketcli | bitbucket/ssh.py | Python | apache-2.0 | 6,208 |
class Solution:
# @param num, a list of integers
# @return a string
def largestNumber(self, num):
num.sort(lambda x, y: int(str(y) + str(x)) - int(str(x) + str(y)) )
return str(int("".join( str(x) for x in num )))
sol = Solution()
print sol.largestNumber([3, 30, 34, 5, 9])
print sol.largestNumber([0])
prin... | kikimo/leetcode | LargestNumber.py | Python | gpl-3.0 | 348 |
from __future__ import unicode_literals
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from email.utils import formatdate
fro... | postrational/django | django/utils/http.py | Python | bsd-3-clause | 8,412 |
__author__ = "Christian Kongsgaard"
__license__ = 'MIT'
import numpy as np
import typing
def algae(relative_humidity: typing.List[float], temperature: typing.List[float], material_name, porosity, roughness,
total_pore_area):
"""
UNIVPM Algae Model
Currently a dummy function!
:param relativ... | thp44/delphin_6_automation | data_process/algae_script/algae_model.py | Python | mit | 9,472 |
'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
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 Founda... | mradamcox/afrh | wsgi.py | Python | agpl-3.0 | 1,357 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/rss-student/rss-2014-team-3/install/include".split(';') if "/home/rss-student/rss-2014-team-3/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "std_msgs;message_runtime".replace(';', ' ')
... | WeirdCoder/rss-2014-team-3 | build/gc_msgs/catkin_generated/pkg.installspace.context.pc.py | Python | mit | 504 |
# Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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) a... | jasonxmueller/gcc-python-plugin | tests/plugin/parameters/script.py | Python | gpl-3.0 | 1,463 |
"""
Matrix functions that use Pade approximation with inverse scaling and squaring.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.linalg._matfuncs_sqrtm import SqrtmError, _sqrtm_triu
from scipy.linalg.decomp_schur import schur, rsf2csf
from scipy... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/linalg/_matfuncs_inv_ssq.py | Python | mit | 28,050 |
import mock
import librarian.routes.dashboard as mod
@mock.patch.object(mod, 'exts')
@mock.patch.object(mod.Dashboard, 'request')
def test_dashboard_get(request, exts, strip_wrappers):
request.no_auth = True
route = mod.Dashboard()
get_fn = strip_wrappers(route.get)
assert get_fn(route) == {'plugins'... | Outernet-Project/librarian | tests/routes/test_dashboard.py | Python | gpl-3.0 | 346 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | zakdoek/django-simple-resizer | simple_resizer/_version.py | Python | mit | 7,478 |
# ######################### LICENSE ############################ #
# Copyright (c) 2005-2015, Michele Simionato
# 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 so... | WarrenWeckesser/scipy | scipy/_lib/decorator.py | Python | bsd-3-clause | 15,059 |
# 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/lib/messaging.py | Python | apache-2.0 | 4,634 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""This file contains useful classes for working with SNMP filling."""
from collections import Mapping
from cfme.web_ui import Select, Form, fill, Input
from cfme.fixtures import pytest_selenium as sel
from utils.log import logger
from utils.pretty import Pretty
class ... | lehinevych/cfme_tests | cfme/control/snmp_form.py | Python | gpl-2.0 | 5,515 |
"""SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted... | xiaohaidao007/pandoraBox-SDK-mt7620 | staging_dir/host/lib/scons-2.5.0/SCons/Tool/mslink.py | Python | gpl-2.0 | 14,458 |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# 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 applicab... | ntts-clo/ryu | ryu/lib/ofctl_v1_2.py | Python | apache-2.0 | 27,760 |
import numpy as np
import scipy.stats.stats
from . import distributions
from .._lib._bunch import _make_tuple_bunch
__all__ = ['_find_repeats', 'linregress', 'theilslopes', 'siegelslopes']
# This is not a namedtuple for backwards compatibility. See PR #12983
LinregressResult = _make_tuple_bunch('LinregressResult',
... | WarrenWeckesser/scipy | scipy/stats/_stats_mstats_common.py | Python | bsd-3-clause | 16,438 |
xxx_in_use = True
| pytest-dev/pytest-incremental | tests/sample-inc/tt/conftest.py | Python | mit | 18 |
"""
ACTIVE Plugin for Testing for Web Application Fingerprint (OWASP-IG-004)
https://www.owasp.org/index.php/Testing_for_Web_Application_Fingerprint_%28OWASP-IG-004%29
"""
from framework.dependency_management.dependency_resolver import ServiceLocator
DESCRIPTION = "Active probing for fingerprint analysis"
def run(... | DarKnight24/owtf | plugins/web/active/Web_Application_Fingerprint@OWTF-IG-004.py | Python | bsd-3-clause | 660 |
import bpy
from math import radians
from mathutils import Vector, Matrix
from lindenmaker.turtle_interpretation_error import TurtleInterpretationError
class Turtle:
"""This is the base class of the turtle that does not create any objects, but can be used to perform a dry-run interpretation to query the turtle sta... | mangostaniko/lpy-lsystems-blender-addon | turtle.py | Python | gpl-3.0 | 13,609 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
#... | Eric89GXL/vispy | examples/tutorial/gloo/outlined_cube.py | Python | bsd-3-clause | 3,457 |
"""
Implements the MICA algorithm
"""
from __future__ import print_function, division
import sys
import numpy as np
import scipy.sparse as sp
from cvxopt import matrix as cvxmat, sparse, spmatrix
from cvxopt.solvers import lp
import inspect
from misvm.quadprog import IterativeQP, spzeros as spz, speye as spI, _apply_op... | garydoranjr/misvm | misvm/mica.py | Python | bsd-3-clause | 9,207 |
from StringIO import StringIO
import unittest
import lob
# Setting the API key
lob.api_key = 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc'
class ObjectFunctions(unittest.TestCase):
def setUp(self):
lob.api_key = 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc'
self.obj = lob.Object.list(count=1).data[0]
... | ami/lob-python | tests/test_object.py | Python | mit | 2,744 |
import sqlalchemy
from .enums import CardClass, CardSet, CardType, Rarity
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
from sqlalchemy import Column, Integer, String, Enum, DateTime, Boolean
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.associationproxy import... | Seek/ValueTrackerQT | hearthstone/objects.py | Python | gpl-3.0 | 3,584 |
from django import template
register = template.Library()
@register.filter
def get_rank(page, loop_counter):
"""
Calculates the player rank from current page and loop index.
:param page: Current page number
:param loop_counter: Loop index
:return: rank
"""
rank = page.start_index() + loop... | RaghavPro/Runescape-Hiscores | hiscores/templatetags/hiscores_tags.py | Python | gpl-2.0 | 1,077 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# (c) 2014, Epic Games, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | stansonhealth/ansible-modules-core | packaging/os/yum.py | Python | gpl-3.0 | 38,851 |
from django.db import models
from django.db.models import permalink
from django.contrib.auth.models import User
from populous.podcasts.managers import EpisodeManager
class ParentCategory(models.Model):
"""Parent Category model."""
PARENT_CHOICES = (
('Arts', 'Arts'),
('Business', 'Business'),
... | caiges/populous | populous/podcasts/models.py | Python | bsd-3-clause | 30,030 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('r_gap', '0005_auto_20150221_1541'),
]
operations = [
migrations.AlterModelOptions(
name='item',
opti... | dplin/woola | woola/r_gap/migrations/0006_auto_20150228_1239.py | Python | bsd-3-clause | 694 |
from autotest.client.shared import utils, base_packages
SitePackageManager = utils.import_site_class(
__file__, "autotest.client.shared.site_packages",
"SitePackageManager", base_packages.BasePackageManager)
class PackageManager(SitePackageManager):
pass
| nacc/autotest | client/shared/packages.py | Python | gpl-2.0 | 271 |
# -*- coding: utf-8 -*-
"""Tools to create or manage PLC"""
import os
from os import system
import math
import numpy as np
import pygimli as pg
def polyCreateDefaultEdges_(poly, boundaryMarker=1, isClosed=True, **kwargs):
"""INTERNAL"""
nEdges = poly.nodeCount()-1 + isClosed
bm = None
if hasattr(bou... | KristoferHellman/gimli | python/pygimli/meshtools/polytools.py | Python | gpl-3.0 | 20,313 |
#!/usr/bin/env python
import argparse
import functools
import math
import random
import numpy
import matplotlib.pyplot as plt
import scipy.special
from config import config
import PID
MAX_K = 10
MAX_MUTATION = 3
class GAConfigError(Exception):
'''
Error representing incorrect configuration of the genetic a... | ayeganov/SmartFlappy | ga_optimize.py | Python | mit | 13,378 |
"""Plot options of varying FRB number densities."""
import matplotlib.pyplot as plt
import numpy as np
from frbpoppy import CosmicPopulation, unpickle
from tests.convenience import plot_aa_style, rel_path
MAKE = True
NUM_FRBS = True
DENSITY_FRBS = True
pop = {}
pop_types = ('cst', 'sfr', 'smd', 'shallow', 'steep')
ti... | davidgardenier/frbpoppy | tests/distance/number_densities.py | Python | mit | 2,994 |
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Amazon AppIntegrations"
prefix = "app-integrations"
class Action(BaseAction):
def __init__(self, action: str = None) -... | cloudtools/awacs | awacs/app_integrations.py | Python | bsd-2-clause | 1,748 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | eadgarchen/tensorflow | tensorflow/contrib/distributions/python/ops/mvn_tril.py | Python | apache-2.0 | 7,524 |
"""
Methods for analyzing two-way contingency tables (i.e. frequency
tables for observations that are cross-classified with respect to two
categorical variables).
The main classes are:
* Table : implements methods that can be applied to any two-way
contingency table.
* SquareTable : implements methods that can... | kiyoto/statsmodels | statsmodels/stats/contingency_tables.py | Python | bsd-3-clause | 43,471 |
import os
import sys
from time import sleep
# Ambari includes
from resource_management.core.exceptions import ComponentIsNotRunning
from resource_management.libraries.script import Script
# Custom service test classes includes
from integrated_base_test import IntegratedBaseTestCase
SCRIPT_DIR = os.path.dirname(os.pa... | supergarotinho/ambari-mongodb | package/test/unit_client_test.py | Python | bsd-3-clause | 3,628 |
"""
Surveilr - Log aggregation, analysis and visualisation
Copyright (C) 2011 Linux2Go
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... | Linux2Go/Surveilr | surveilr/messaging/fake.py | Python | agpl-3.0 | 1,038 |
#
# Copyright 2015-2017 Red Hat, Inc.
#
# 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 distributed ... | nirs/vdsm | tests/storage/blockvolume_test.py | Python | gpl-2.0 | 8,185 |
from django.conf.urls import include, url
from demo.views import common
from demo.views.visadirect import fundstransfer, mvisa, reports, watchlist
from demo.views.pav import pav
from demo.views.dcas import cardinquiry
from demo.views.merchantsearch import search
from demo.views.paai.fundstransferattinq.cardattributes.... | ppokrovsky/pyvdp | demo/demo/urls.py | Python | mit | 2,820 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | MDAnalysis/mdanalysis | package/MDAnalysis/analysis/legacy/x3dna.py | Python | gpl-2.0 | 35,151 |
"""
OpenStreetMap to Land Use/Land Cover Maps
"""
def osm_to_sqdb(osmXml, osmSQLITE):
"""
Convert OSM file to SQLITE DB
"""
from gasp.toshp.gdal import ogr_btw_driver
return ogr_btw_driver(osmXml, osmSQLITE, supportForSpatialLite=True)
def osm_project(osmSQLITE, srs_epsg):
"""
R... | JoaquimPatriarca/senpy-for-gis | gasp/osm2lulc/grs.py | Python | gpl-3.0 | 17,992 |
# Copyright 2014 The Spitfire 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 copy
import gc
import os.path
import sys
from spitfire.compiler import analyzer
from spitfire.compiler import codegen
from spitfire.compiler import... | spt/spitfire | spitfire/compiler/compiler.py | Python | bsd-3-clause | 12,724 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Script to checks the current position of the motors
import scanconfig
import scansupport as sws
#### START EXECUTION ######
sws.enableMotors()
print("Check motor positions")
if not scanconfig.cte_use_motorsim:
# TODO: INCORPORATE 'OST' COMMAND HANDLING TO MOTORSIM
... | EST-EAST/FoVScanTester | enablemotors.py | Python | gpl-3.0 | 446 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | pacoqueen/bbinn | formularios/resultados_espesor.py | Python | gpl-2.0 | 13,638 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | rwl/PyCIM | CIM14/IEC61970/Core/Bay.py | Python | mit | 4,730 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_nba_prediction
----------------------------------
Tests for `nba_prediction` module.
"""
import sys
import unittest
from contextlib import contextmanager
from click.testing import CliRunner
from nba_prediction import nba_prediction
from nba_prediction import c... | classtag/nba-prediction | tests/test_nba_prediction.py | Python | mit | 875 |
#
# Copyright (C) 2013 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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 the hope... | hmpf/nav | python/nav/web/graphite/urls.py | Python | gpl-3.0 | 929 |
from tests.test_gitkitclient import GitkitClientTestCase
from tests.test_rpchelper import RpcHelperTestCase
| google/identity-toolkit-python-client | tests/__init__.py | Python | apache-2.0 | 108 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2010 Jérémie Balagna-Ranin <jeremie.balagna@autistici.org>
# update_db.py
# A new way to update sqlite DB from lpi.txt file
#
# This is free and unencumbered software released into the public domain.
# See LICENCE file for more information
#
#
# Some importa... | Meier-Link/LPIC_irc_bot | src/update_db.py | Python | unlicense | 3,683 |
from Screens.Wizard import WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Wizard import wizardManager
from Screens.Rc import Rc
from Screens.Screen import Screen
from Components.Label import Label
from Components.MenuList import MenuList
from Components.PluginComponent import plugins
from ... | devclone/enigma2-9f38fd6 | lib/python/Plugins/SystemPlugins/SoftwareManager/ImageWizard.py | Python | gpl-2.0 | 6,772 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consists of ... | alon/polinax | libs/external_libs/Genshi-0.5.1/genshi/filters/tests/transform.py | Python | gpl-2.0 | 46,798 |
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import os
import tempfile
import shutil
from .. import unittest
import mock
from compose.cli import main
from compose.cli.main import TopLevelCommand
from compose.cli.errors import ComposeFileNotFound
from six import StringI... | abesto/fig | tests/unit/cli_test.py | Python | apache-2.0 | 4,148 |
#!/usr/bin/env python
import sys
import unittest
try:
from setuptools import setup, Command
have_setuptools = True
except ImportError:
from distutils.core import setup, Command
have_setuptools = False
from distutils.command.build import build
try:
import sphinx
from sphinx.setup_command import... | JonnyJD/musicbrainz-isrcsubmit | setup.py | Python | gpl-3.0 | 4,218 |
import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerCoffeeButtonV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'mug_pos... | rlworkgroup/metaworld | metaworld/policies/sawyer_coffee_button_v1_policy.py | Python | mit | 1,025 |
import unittest
import sys
import os
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class ForwardTest(base_test.WebDriverBaseTest):
# Get a static page that must be the same upon refresh
def test_forward(self):
self.driver.get(self.webserver.where_is('navigation... | youtube/cobalt | third_party/web_platform_tests/webdriver/navigation/forward.py | Python | bsd-3-clause | 848 |
# -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org),
# Guilh... | erggo/Harpy | harpia/update.py | Python | gpl-3.0 | 4,182 |
import Numberjack as Nj
class Teachers(object):
"""Will be expanded to allow constraints for individual teachers"""
def __init__(self):
self.store = list()
def add(self, teachers):
if isinstance(teachers, (list, tuple)):
self.store.extend(teachers)
elif isinstance(teac... | mitchoneill/timesync-solver | timesyncsolver/solver.py | Python | apache-2.0 | 2,189 |
# -*- coding: utf-8 -*-
#
# 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
#... | artwr/airflow | tests/contrib/operators/test_gcp_sql_operator_system.py | Python | apache-2.0 | 2,927 |
import DeepFried2 as df
from train import *
from test import *
from model import *
def main(params):
# c ^= coarse, f ^= fine
(Xtr, ytr_c, ytr_f), (Xva, yva_c, yva_f), (Xte, yte_c, yte_f), (le_c, le_f) = df.datasets.cifar100.data()
model = cnn(32,
df.Parallel(
df.Sequential(df.Linear... | lucasb-eyer/DeepFried2 | examples/MultipleOutputs/run.py | Python | mit | 1,325 |
# -*- 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... | googleapis/python-vision | samples/generated_samples/vision_v1p3beta1_generated_product_search_list_products_sync.py | Python | apache-2.0 | 1,507 |
#!/usr/bin/python
#
# Copyright (C) 2009-2012 Chris Ball <cjb@laptop.org>
# W. Trevor King <wking@tremily.us>
#
# This file is part of Bugs Everywhere.
#
# Bugs Everywhere is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published ... | Warbo/bugseverywhere | release.py | Python | gpl-2.0 | 6,962 |
#!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
v = api.db_version(SQLALCHEMY_DATABASE_URI, from config import SQLALCHEMY_MIGRATE_REPO)
print('Current database versio... | ForrestSutton/flasky | db_upgrade.py | Python | bsd-3-clause | 335 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('maximo', '0006_auto_20151111_2021'),
]
operations = [
migrations.AlterField(
model... | luiscberrocal/homeworkpal | homeworkpal_project/maximo/migrations/0007_auto_20151117_1038.py | Python | mit | 506 |
from pyffi.formats.nif import NifFormat
from OpenGL.GL import *
def Radius( block ):
if not block: return
if not isinstance( block, NifFormat.NiTriBasedGeom ): return 0
mesh = block.data
if not mesh: return 0
return mesh.radius
def Draw( block ):
if not block: return
if not isinstance( b... | griest024/PokyrimTools | pyffi-develop/todo/NifVis/lizers/NiTriBasedGeom.py | Python | mit | 946 |
# Copyright (C) 2015 Chen Chin Jieh <cchen@hsr.ch>
#
# This file is part of mugenplcfg.
#
# mugenplcfg 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... | chinjieh/mugenplcfg | src/creator.py | Python | gpl-3.0 | 29,855 |
import datetime as date
from django.db import models
from mixins.models import ModifiedDate
from photosync.flickr import Flickr
# Create your models here.
class Collection(ModifiedDate):
title = models.CharField(max_length=250)
slug = models.CharField(max_length=250)
total = models.PositiveIntegerField(... | useEvil/flickr-photo-sync | flickrphotosync/photosync/models.py | Python | mit | 4,333 |
import requests
import csv
import os
import logging
import json
import sys
url = "http://reaction.fe.up.pt/portugal/tweets/select"
username = "popstar_pedrosaleiro"
password = "p3dr0@2013!"
rowsPerRequest = 1000
baseQuery = "created_at:[\"2014-01-01T00:00:00Z\" TO \"2015-12-31T00:00:00Z\"] AND text:({})"
logging.basic... | mspkvp/MiningOpinionTweets | src/tweet_extractor.py | Python | mit | 2,875 |
import pytest
import plotly.io.json as pio
import plotly.graph_objects as go
import plotly.express as px
import numpy as np
import pandas as pd
import json
import datetime
import sys
from pytz import timezone
from _plotly_utils.optional_imports import get_module
orjson = get_module("orjson")
eastern = timezone("US/Ea... | plotly/plotly.py | packages/python/plotly/plotly/tests/test_io/test_to_from_plotly_json.py | Python | mit | 7,093 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# (c) 2013, Héctor Acosta <hector.acosta@gazzang.com>
#
# 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_functio... | ppanczyk/ansible | lib/ansible/modules/packaging/os/rpm_key.py | Python | gpl-3.0 | 6,784 |
# Copyright (c) 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | openstack/sahara | sahara/service/castellan/sahara_key_manager.py | Python | apache-2.0 | 2,907 |
# -*- coding: utf-8 -*-
"""
__init__.py
~~~~~~~~~~~
:copyright: (c) 2015 by Lu Tianchao.
:license: Apache, see LICENSE for more details.
"""
from .crawler_manager import initial_craw
from .crawler_manager import summary_craw | luviiv/Smaug | Smaug/crawler/__init__.py | Python | apache-2.0 | 240 |
def configure(app):
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = 'ayushman.dey97'
app.config['MYSQL_DB'] = 'udhaarify_web'
app.config['MYSQL_CURSORCLASS'] = 'DictCursor'
| ayushmandey97/Udhaarify-web | sql_config.py | Python | mit | 234 |
import webbrowser
class Movie():
"""Movie Model"""
def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube):
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = poster_image
self.trailer_youtube_url = trailer_youtube
| chenkanck/UdacityFullStackProjects | Project_1_MovieTrailer/media.py | Python | mit | 283 |
import pjsua2 as pj
import sys
import time
write=sys.stdout.write
#
# Basic data structure test, to make sure basic struct
# and array operations work
#
def ua_data_test():
#
# AuthCredInfo
#
write("UA data types test..")
the_realm = "pjsip.org"
ci = pj.AuthCredInfo()
ci.r... | AlexanderVangelov/pjsip | pjsip-apps/src/swig/python/test.py | Python | gpl-2.0 | 3,897 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... | kshimo69/IkaLog | ikalog/outputs/alive_squids_csv.py | Python | apache-2.0 | 3,445 |
import threading
import logging
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(message)s',
)
class MyThread(threading.Thread):
def run(self):
logging.debug('running')
return
for i in range(5):
t = MyThread()
t.start()
| filipealmeida/dataminion | src/threadsample.py | Python | unlicense | 315 |
import json
import os
from unittest import TestCase
from nba_data.deserializers.season_players import SeasonPlayersDeserializer
from tests.config import ROOT_DIRECTORY
class TestSeasonPlayersDeserializer(TestCase):
def test_instantiation(self):
self.assertIsNotNone(SeasonPlayersDeserializer())
def t... | jaebradley/nba_data | tests/test_seasonPlayersDeserializer.py | Python | mit | 634 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.