code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# Copyright 2017 Starbot Discord Project # # 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...
dhinakg/BitSTAR
api/database/table.py
Python
apache-2.0
1,329
# Copyright 2014 - Rackspace Hosting # # 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 ...
stackforge/solum
solum/objects/sqlalchemy/image.py
Python
apache-2.0
5,222
"""Auto-generated file, do not edit by hand. MM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_MM = PhoneMetadata(id='MM', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_length=(3,)), em...
gencer/python-phonenumbers
python/phonenumbers/shortdata/region_MM.py
Python
apache-2.0
548
# Copyright 2014 Intel Corp. # # 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, soft...
noironetworks/heat
heat/objects/software_config.py
Python
apache-2.0
2,376
# 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...
GabrielBrascher/cloudstack
test/integration/plugins/test_quota.py
Python
apache-2.0
9,748
import os import re import sys import time import fcntl import types import shelve import random import datetime import commands import threading import userinterface.Client as Client from dataservice.DDM import ddm from dataservice.DDM import dashBorad from taskbuffer.OraDBProxy import DBProxy from taskbuffer.TaskBuff...
fbarreir/panda-server
pandaserver/test/deleteJobs.py
Python
apache-2.0
5,897
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project """ Run the Rez GUI application. """ def setup_parser(parser, completions=False): parser.add_argument( "--diff", nargs=2, metavar=("RXT1", "RXT2"), help="open in diff mode with the given contexts") FILE_action ...
nerdvegas/rez
src/rez/cli/gui.py
Python
apache-2.0
648
# Generated by Django 2.1.14 on 2019-11-14 10:41 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('auth', '0009_alter_user_last_name_max_length'), ('contenttypes', '0002_remove_cont...
lukaszb/django-guardian
example_project/articles/migrations/0002_custom_generic_permissions.py
Python
bsd-2-clause
3,127
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('feti', '0004_auto_20150428_1412'), ] operations = [ migrations.AlterField( model_n...
cchristelis/feti
django_project/feti/migrations/0005_auto_20150428_1519.py
Python
bsd-2-clause
604
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org # from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompar...
jmcnamara/XlsxWriter
xlsxwriter/test/comparison/test_chart_chartarea02.py
Python
bsd-2-clause
1,604
# Generated by Django 2.0.1 on 2018-02-04 19:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("core", "0003_auto_20171001_1018")] operations = [ migrations.AddField( model_name="entry", name="datetime_end", field...
cdubz/timestrap
core/migrations/0004_auto_20180204_1439.py
Python
bsd-2-clause
553
""" $url tvpstream.vod.tvp.pl $type live $region Poland """ import logging import re from streamlink.plugin import Plugin, PluginError, pluginmatcher from streamlink.stream.hls import HLSStream from streamlink.stream.http import HTTPStream log = logging.getLogger(__name__) @pluginmatcher(re.compile( r'https?:/...
streamlink/streamlink
src/streamlink/plugins/tvp.py
Python
bsd-2-clause
1,684
"""Tests of NetCDF functionality including enforcement of CF standards, metadata gleaning, CF-Station data conversion, and maybe more, like opendap. """ import os import unittest from netCDF4 import Dataset from numpy import ravel, shape, sum from ..netcdf import utm2latlon, ncgen_from_template # include tests f...
VirtualWatershed/vw-py
vwpy/test/test_netcdf.py
Python
bsd-2-clause
16,089
from webassets import six import contextlib import os import sys from itertools import takewhile from .exceptions import BundleError __all__ = ('md5_constructor', 'pickle', 'set', 'StringIO', 'common_path_prefix', 'working_directory') if sys.version_info >= (2, 5): import hashlib md5_constructor...
0x1997/webassets
src/webassets/utils.py
Python
bsd-2-clause
6,584
from constraint_handler import * from rated_statistic_storage import * import rospy from arni_msgs.msg import RatedStatistics from arni_core.host_lookup import * from std_srvs.srv import Empty import helper import time class CountermeasureNode(object): """A ROS node. Evaluates incoming rated statistics with ...
andreasBihlmaier/arni
arni_countermeasure/src/arni_countermeasure/countermeasure_node.py
Python
bsd-2-clause
3,842
""" Script that saves memory and idmapper data over time. Data will be saved to game/logs/memoryusage.log. Note that the script will append to this file if it already exists. Call this module directly to plot the log (requires matplotlib and numpy). """ import os, sys import time sys.path.insert(0, os.path.dirname(os...
GhostshipSoftware/avaloria
src/utils/dummyrunner/memplot.py
Python
bsd-3-clause
3,601
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save class UserProfile(models.Model): user = models.OneToOneField(User) is_beneficiary = models.BooleanField(default=False) is_donor = models.BooleanField(default=False) class Meta: ...
agiliq/fundraiser
profiles/models.py
Python
bsd-3-clause
666
"""NDG XACML Context Action type NERC DataGrid """ __author__ = "P J Kershaw" __date__ = "24/03/10" __copyright__ = "(C) 2010 Science and Technology Facilities Council" __contact__ = "Philip.Kershaw@stfc.ac.uk" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __re...
cedadev/ndg_xacml
ndg/xacml/core/context/action.py
Python
bsd-3-clause
495
# Generated by Django 3.1.2 on 2021-05-19 20:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('eventkit_cloud_auth', '0002_auto_20191127_1425'), ] operations = [ migrations.AlterField( model_name='oauth', name='...
venicegeo/eventkit-cloud
eventkit_cloud/auth/migrations/0003_auto_20210519_2024.py
Python
bsd-3-clause
399
# (C) Datadog, Inc. 2015-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from collections import defaultdict import logging import os from urlparse import urljoin # project from util import check_yaml from utils.checkfiles import get_conf_path from utils.http import retrieve_...
cberry777/dd-agent
utils/kubernetes/kubeutil.py
Python
bsd-3-clause
8,888
from __future__ import print_function from pandas import DataFrame from pandas.compat import range, zip import timeit setup = """ from pandas import Series import pandas._tseries as _tseries from pandas.compat import range import random import numpy as np def better_unique(values): uniques = _tseries.fast_unique(...
linebp/pandas
bench/better_unique.py
Python
bsd-3-clause
2,143
#!/usr/bin/env python from tools.load import LoadMatrix from numpy import where import shogun as sg lm=LoadMatrix() traindat = lm.load_numbers('../data/fm_train_real.dat') testdat = lm.load_numbers('../data/fm_test_real.dat') parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 10.0]] def kernel_wave (fm_train...
shogun-toolbox/shogun
examples/undocumented/python/kernel_wave.py
Python
bsd-3-clause
846
import os import unittest from ..weights import W from ..util import lat2W from ..spatial_lag import lag_spatial, lag_categorical import numpy as np class Test_spatial_lag(unittest.TestCase): def setUp(self): self.neighbors = {'c': ['b'], 'b': ['c', 'a'], 'a': ['b']} self.weights = {'c': [1.0], '...
sjsrey/pysal_core
pysal_core/weights/tests/test_spatial_lag.py
Python
bsd-3-clause
2,394
__all__ = ["machsuite", "shoc", "datatypes", "params"]
andrewfu0325/gem5-aladdin
sweeps/benchmarks/__init__.py
Python
bsd-3-clause
55
"""A grid plane component. """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005-2006, Enthought, Inc. # License: BSD Style. # Enthought library imports. from traits.api import Instance, Enum, Int, Range from traitsui.api import View, Group, Item from tvtk.api import tvtk from apptools.persis...
liulion/mayavi
mayavi/components/grid_plane.py
Python
bsd-3-clause
6,556
import json import os import sys from unittest import TestCase from urllib import quote_plus from xmlrpclib import loads, dumps data_dir = os.path.dirname(os.path.abspath(__file__)) try: shutil.rmtree(data_dir) except: pass cur_dir = os.path.dirname(os.path.abspath(__file__)) pylons_root = os.path.dirnam...
moreati/pylons
tests/test_units/__init__.py
Python
bsd-3-clause
2,788
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
Karel-van-de-Plassche/bokeh
bokeh/application/handlers/code.py
Python
bsd-3-clause
6,686
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Audio.encoding' db.delete_column(u'multimedia_audio', '...
teury/django-multimedia
multimedia/south_migrations/0020_auto__del_field_audio_encoding__del_field_audio_encoded__del_field_vid.py
Python
bsd-3-clause
7,755
import numpy as np import pytest from pandas.errors import NullFrequencyError import pandas as pd from pandas import ( DatetimeIndex, Index, NaT, Series, TimedeltaIndex, date_range, offsets, ) import pandas._testing as tm from pandas.tseries.offsets import BDay class TestShift: @pyt...
jreback/pandas
pandas/tests/series/methods/test_shift.py
Python
bsd-3-clause
13,266
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
stonebig/bokeh
bokeh/protocol/tests/test_receiver.py
Python
bsd-3-clause
5,446
""" Unit tests for \ landlab.components.vegetation_dynamics.vegetation_dynamics """ import numpy as np import pytest from numpy.testing import assert_array_almost_equal (_SHAPE, _SPACING, _ORIGIN) = ((20, 20), (10e0, 10e0), (0.0, 0.0)) _ARGS = (_SHAPE, _SPACING, _ORIGIN) def test_name(veg): assert veg.name =...
landlab/landlab
tests/components/vegetation_dynamics/test_vegetation_dynamics.py
Python
mit
3,024
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class Workflow(Document): def validate(self): self.set_active() self.create_custom_field_f...
cadencewatches/frappe
frappe/core/doctype/workflow/workflow.py
Python
mit
1,714
from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import testing from sqlalchemy.testing import eq_ from sqlalchemy.testing import fixtures from sqlalchemy.testing.fixtures import fixture_session from sqlalchemy.testing.schema import Column from sqlalchemy.te...
monetate/sqlalchemy
test/orm/inheritance/test_abc_polymorphic.py
Python
mit
3,596
""" This module contains variables with global |jedi| settings. To change the behavior of |jedi|, change the variables defined in :mod:`jedi.settings`. Plugins should expose an interface so that the user can adjust the configuration. Example usage:: from jedi import settings settings.case_insensitive_comple...
sserrot/champion_relationships
venv/Lib/site-packages/jedi/settings.py
Python
mit
3,527
"""Associate review-conditions with editable types Revision ID: 3c5462aef0b7 Revises: 6444c893a21f Create Date: 2020-03-31 12:51:40.822239 """ from alembic import op # revision identifiers, used by Alembic. revision = '3c5462aef0b7' down_revision = '6444c893a21f' branch_labels = None depends_on = None def upgrade...
mic4ael/indico
indico/migrations/versions/20200331_1251_3c5462aef0b7_review_conditions_editable_types.py
Python
mit
845
""" Support for python 2 & 3, ripped pieces from six.py """ import sys PY3 = sys.version_info[0] == 3 if PY3: string_types = str, else: string_types = basestring,
drewrobb/marathon-python
marathon/_compat.py
Python
mit
173
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 from pandas.compat import range, zip from pandas import compat import itertools import re import numpy as np from pandas.core.dtypes.common import ( _ensure_platform_int, is_list_like, is_bool_dtype, needs_i8_conversion) from pandas.c...
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/core/reshape/reshape.py
Python
mit
45,575
#!/usr/bin/python # Copyright (c) 2016 Intel Corporation. # SPDX-License-Identifier: MIT import unittest as u import re, fnmatch, os, sys sampleMappingFile = '../examples/samples.mapping.txt' cSamplesDir = '../examples/' javaSamplesDir = '../examples/java/' cppSamplesDir = '../examples/c++/' class SampleNames(u.Test...
Propanu/mraa
tests/check_samplenames.py
Python
mit
2,291
## Copyright (c) 2001-2009, Scott D. Peckham ## November 2009 (converted from IDL) #----------------------------------------------------------------------- # Notes: Use the random midpoint displacement method to create # a fractal surface/landscape (due to Mandelbrot). # This can be used as initial s...
mdpiper/topoflow
topoflow/utils/midpoints.py
Python
mit
10,558
# encoding: utf-8 """ Custom element classes related to run properties (font). """ from .. import parse_xml from ...enum.dml import MSO_THEME_COLOR from ...enum.text import WD_COLOR, WD_UNDERLINE from ..ns import nsdecls, qn from ..simpletypes import ( ST_HexColor, ST_HpsMeasure, ST_String, ST_VerticalAlignRun ) ...
python-openxml/python-docx
docx/oxml/text/font.py
Python
mit
10,114
""" Unit tests for the configuration loader module. """ import os import json from pycraft.configuration import ConfigurationLoader DEFAULT_CONFIG = { "window": { "width": 800, "height": 600, "ticks_per_second": 60, "resizeable": True, "exclusive_mouse": True, }, "...
Hispar/pycraft
tests/test_configuration.py
Python
mit
3,042
# -*- coding: utf-8 -*- from __future__ import print_function from acq4.util import Qt class Module(Qt.QObject): # User-readable name for this module moduleDisplayName = None # Override this class attribute to have this module appear # under different category sections in the manager window's module ...
pbmanis/acq4
acq4/modules/Module.py
Python
mit
1,133
class Solution(object): def minCostII(self, costs): """ :type costs: List[List[int]] :rtype: int """ if not costs or not costs[0]: return 0 min1 = min2 = -1 for i in range(len(costs)): last1, last2 = min1, min2 min1 = min2 = -1 ...
Mlieou/oj_solutions
leetcode/python/ex_265.py
Python
mit
782
from django import template from projects.version_handling import comparable_version register = template.Library() @register.filter def sort_version_aware(versions): """ Takes a list of versions objects and sort them caring about version schemes """ return sorted( versions, key=lamb...
raven47git/readthedocs.org
readthedocs/projects/templatetags/projects_tags.py
Python
mit
554
""" Print out some handy system info. """ import os import platform import sys print("Build system information") print() print("sys.version\t\t", sys.version.split("\n")) print("os.name\t\t\t", os.name) print("sys.platform\t\t", sys.platform) print("platform.system()\t", platform.system()) print("platform.machine()\...
scottclowe/python-continuous-integration
.github/workflows/system_info.py
Python
mit
575
# -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2013 Vassilii Khachaturov # # 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 L...
Nick-Hall/gramps
gramps/gen/datehandler/_datestrings.py
Python
gpl-2.0
15,116
# Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk> # # 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...
CZ-NIC/conpot
conpot/protocols/kamstrup/usage_simulator.py
Python
gpl-2.0
4,908
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under t...
codewarrior0/Shiboken
tests/samplebinding/virtualmethods_test.py
Python
gpl-2.0
5,040
""" Author: Justin Cappos Start Date: Feb 27th, 2009 Description: Exits if they are using an unsupported Python version... """ import sys def ensure_python_version_is_supported(): # sys.version_info looks like this: # (2, 5, 0, 'final', 0) # Let's get the version number they have majorversionnumber, min...
drewwestrick/Repy-Web-Server
seattle_repy/checkpythonversion.py
Python
gpl-2.0
902
from __future__ import division, absolute_import, unicode_literals import json from .. import core from .. import utils from ..git import git from ..observable import Observable # put summary at the end b/c it can contain # any number of funky characters, including the separator logfmt = 'format:%H%x01%P%x01%d%x01%an...
wojnilowicz/git-cola
cola/models/dag.py
Python
gpl-2.0
8,995
#!/usr/bin/env python # # Copyright (c) 2014-2016 Apple Inc. All rights reserved. # Copyright (c) 2014 University of Washington. 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. Redistribution...
Debian/openjfx
modules/web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py
Python
gpl-2.0
5,876
"""Tests for Openstack cloud volumes""" import fauxfactory import pytest from cfme.cloud.provider.openstack import OpenStackProvider from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.blockers import BZ from cfme.utils.log import logger pytestmark = [ pytest.mark.usefixtures("setup_...
jkandasa/integration_tests
cfme/tests/openstack/cloud/test_volumes.py
Python
gpl-2.0
1,818
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2016 CERN. # # Zenodo 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...
slint/zenodo
zenodo/modules/records/serializers/schemas/marc21.py
Python
gpl-2.0
12,434
# Generated by Django 2.1.2 on 2018-10-05 03:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ffdonations', '0012_remove_donationmodel_tracked'), ] operations = [ migrations.AlterField( model_name='participantmodel', ...
fragforce/fragforce.org
ffdonations/migrations/0013_auto_20181004_2337.py
Python
gpl-2.0
437
''' Created on Aug 4, 2015 @author: amcmahon ''' from BasicProcessing import UnispecProcessing from BasicProcessing import consts import os.path import sys def main(): """ Main function for generating CSV files from a directory of Unispec data. Input/Output paths, white plate identifier string and h...
serbinsh/UniSpec_Processing
src/BasicProcessing/Main.py
Python
gpl-2.0
2,919
# # Copyright 2011 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 in th...
edwardbadboy/vdsm-ubuntu
vdsm/supervdsm.py
Python
gpl-2.0
3,064
# pylint: disable=too-many-lines import json from copy import deepcopy from unittest import ( TestCase, mock, ) from pcs import settings from pcs.common import ( file_type_codes, reports, ) from pcs.common.file import RawFileError from pcs.common.host import Destination from pcs.common.ssl import ( ...
tomjelinek/pcs
pcs_test/tier0/lib/commands/cluster/test_setup.py
Python
gpl-2.0
116,523
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
baoboa/pyqt5
examples/richtext/calendar.py
Python
gpl-3.0
7,071
import arduino from arduino import Commands from arduino import Arduino from time import sleep TRIGGER_PIN = arduino.A3 class Ultrasound(): def __init__(self): self.board = Arduino() self.board.connect() def getDistance(self): distance = int(self.board.sendCommand(Commands.RE...
pi-bot/.v2
python-code/ultrasound.py
Python
gpl-3.0
680
#!/usr/bin/env python # # Copyright 2006,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr from gnuradio import blocks from argparse import ArgumentParser import sys try: from gnuradio import audio except ImportErr...
dl1ksv/gnuradio
gnuradio-runtime/examples/network/audio_sink.py
Python
gpl-3.0
1,818
import shlex import textwrap from ert_gui.shell.libshell import autoCompleteList, ShellFunction, ShellProperty, widthAsPercentageOfConsoleWidth, getTerminalSize class ShellCollection(object): command_help_message = "The command: '%s' supports the following keywords:" def __init__(self, name, parent=None, des...
arielalmendral/ert
python/python/ert_gui/shell/libshell/shell_collection.py
Python
gpl-3.0
5,721
# electronics.py --- # # Filename: electronics.py # Description: # Author: Subhasis Ray # Maintainer: # Created: Wed Feb 22 00:53:38 2012 (+0530) # Version: # Last-Updated: Tue Jul 10 10:28:40 2012 (+0530) # By: subha # Update #: 221 # URL: # Keywords: # Compatibility: # # # Commentary: # # ...
BhallaLab/moose
moose-examples/squid/electronics.py
Python
gpl-3.0
3,885
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
aperigault/ansible
docs/docsite/rst/conf.py
Python
gpl-3.0
8,952
############################################################################ # This file is part of LImA, a Library for Image Acquisition # # Copyright (C) : 2009-2011 # European Synchrotron Radiation Facility # BP 220, Grenoble 38043 # FRANCE # # This is free software; you can redistribute it and/or modify # it under ...
serge-cohen/Lima
common/python/Debug.py
Python
gpl-3.0
2,593
"""Askbot template context processor that makes some parameters from the django settings, all parameters from the askbot livesettings and the application available for the templates """ import sys from django.conf import settings from django.core.urlresolvers import reverse from django.utils import simplejson import a...
jesonyang001/qarepo
askbot/context.py
Python
gpl-3.0
5,245
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2017-2020) # # This file is part of GWpy. # # GWpy 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)...
gwpy/gwpy
gwpy/timeseries/io/wav.py
Python
gpl-3.0
3,595
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
photoninger/ansible
lib/ansible/modules/network/f5/bigip_gtm_facts.py
Python
gpl-3.0
31,508
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import unittest class TestPOSProfileUser(unittest.TestCase): pass
frappe/erpnext
erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py
Python
gpl-3.0
157
# 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/. import pytest from pages.firefox.desktop.desktop import DesktopPage @pytest.mark.skip_if_firefox(reason='Download but...
analytics-pros/mozilla-bedrock
tests/functional/firefox/desktop/test_desktop.py
Python
mpl-2.0
633
from sympy.core import Basic, C from sympy.core.compatibility import is_sequence, iterable #logically, they belong here import random def flatten(iterable, levels=None, cls=None): """ Recursively denest iterable containers. >>> from sympy.utilities.iterables import flatten >>> flatten([1, 2, 3]) ...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sympy/utilities/iterables.py
Python
agpl-3.0
34,793
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: David Coninckx <david@coninckx.com> # # The licence is in the file __manifest__.p...
eicher31/compassion-modules
hr_planning/models/hr_planning_day_move_request.py
Python
agpl-3.0
6,277
import random import math import numpy as np def generate(data): canvas_width = 300 canvas_height = 300 data["params"]["canvas_width"] = canvas_width data["params"]["canvas_height"] = canvas_height # Creating all variables, even knowing that just a few would be used in this Ex...
rbessick5/PrairieLearn
exampleCourse/questions/examplePLDrawingSimpleTutorial/server.py
Python
agpl-3.0
4,964
from __future__ import absolute_import # Some utilities for speaking s3g import struct import array import time import serial import makerbot_driver import uuid class s3g(object): """ Represents an interface to a s3g driven bot. Contains methods and functions to read and write data to the bot. No data is c...
Jnesselr/s3g
makerbot_driver/s3g.py
Python
agpl-3.0
55,182
# Copyright (c) 2011, 2012 Free Software Foundation # 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 vers...
gnowledge/ncert_nroer
gstudio/tests/url_shortener.py
Python
agpl-3.0
5,124
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) cornelius kölbel, privacyidea.org # # 2014-12-08 Cornelius Kölbel, <cornelius@privacyidea.org> # Complete rewrite during flask migration # Try to provide REST API # # privacyIDEA is a fork of LinOTP. Some code is adapted from # the syste...
woddx/privacyidea
privacyidea/api/realm.py
Python
agpl-3.0
10,603
# -*- coding: utf-8 -*- """ Tests for Python APIs of the Teams app """ from uuid import uuid4 import ddt import mock from opaque_keys.edx.keys import CourseKey from course_modes.models import CourseMode from lms.djangoapps.teams import api as teams_api from lms.djangoapps.teams.models import CourseTeam from lms.djan...
appsembler/edx-platform
lms/djangoapps/teams/tests/test_api.py
Python
agpl-3.0
16,102
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
EmreAtes/spack
var/spack/repos/builtin/packages/nekbone/package.py
Python
lgpl-2.1
3,143
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Glm(CMakePackage): """OpenGL Mathematics (GLM) is a header only C++ mathematics library fo...
rspavel/spack
var/spack/repos/builtin/packages/glm/package.py
Python
lgpl-2.1
666
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Mosh(AutotoolsPackage): """Remote terminal application that allows roaming, supports inter...
iulian787/spack
var/spack/repos/builtin/packages/mosh/package.py
Python
lgpl-2.1
1,152
# -*- coding: utf-8 -*- # Copyright (C) 2014 Accuvant, Inc. (bspengler@accuvant.com) # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.abstracts import Signature class Authenticode(Signature): name = "static_authentico...
lixiangning888/whole_project
modules/signatures_merge_tmp/static_authenticode.py
Python
lgpl-3.0
876
import re import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( unified_strdate, compat_urllib_parse, ) class GameSpotIE(InfoExtractor): _VALID_URL = r'(?:http://)?(?:www\.)?gamespot\.com/.*-(?P<page_id>\d+)/?' _TEST = { u"url": u"http://www.gamespot.com/arma-iii...
joksnet/youtube-dl
youtube_dl/extractor/gamespot.py
Python
unlicense
2,196
from __future__ import print_function import xml.dom.minidom import DWML import datetime import pyxb.binding.datatypes as xsd import urllib2 import time import collections import sys # Get the next seven days forecast for two locations zip = [ 85711, 55108 ] if 1 < len(sys.argv): zip = sys.argv[1:] begin = xsd.dat...
jonfoster/pyxb-upstream-mirror
examples/ndfd/forecast.py
Python
apache-2.0
2,426
""" Volumio Platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.volumio/ """ import logging import asyncio import aiohttp import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_NEXT_TRACK, SUPPORT_PAU...
alexmogavero/home-assistant
homeassistant/components/media_player/volumio.py
Python
apache-2.0
6,979
# # Copyright (c) 2015 Juniper Networks, Inc. # import json import logging import requests VROUTER_AGENT_PORT = 9091 class ContrailVRouterApi(object): def __init__(self): pass def add_port(self, instanceId, nicId, sysIfName, macAddress, **kwargs): data = { "id": nicId, ...
pupapaik/contrail-kubernetes
scripts/opencontrail-kubelet/opencontrail_kubelet/vrouter_api.py
Python
apache-2.0
1,675
"""Library from Pub/sub messages, events and device triggers.""" from google_nest_sdm.camera_traits import ( CameraMotionTrait, CameraPersonTrait, CameraSoundTrait, ) from google_nest_sdm.doorbell_traits import DoorbellChimeTrait from google_nest_sdm.event import ( CameraMotionEvent, CameraPersonEv...
jawilson/home-assistant
homeassistant/components/nest/events.py
Python
apache-2.0
2,037
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils from xml.dom import Node import os.path xsd='''<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSch...
jonfoster/pyxb-upstream-mirror
tests/trac/test-trac-0111.py
Python
apache-2.0
1,835
''' @author: frank ''' import simplejson import json import types import inspect class NoneSupportedTypeError(Exception): '''not supported type error''' class JsonObject(object): def __init__(self): pass def put(self, name, val): setattr(self, name, val) ...
SoftwareKing/zstack-utility
zstacklib/zstacklib/utils/jsonobject.py
Python
apache-2.0
5,869
"""Registers functions to be called if an exception or signal occurs.""" import functools import logging import os import signal import traceback from certbot import errors logger = logging.getLogger(__name__) # _SIGNALS stores the signals that will be handled by the ErrorHandler. These # signals were chosen as the...
bsmr-misc-forks/letsencrypt
certbot/error_handler.py
Python
apache-2.0
5,089
# # 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 # ...
miguelgrinberg/heat
heat/tests/keystone/test_role_assignments.py
Python
apache-2.0
12,401
# -*- encoding: utf-8 -*- # # Copyright 2013 IBM Corp # # Author: Tong Li <litong01@us.ibm.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...
rickerc/ceilometer_audit
ceilometer/publisher/file.py
Python
apache-2.0
3,579
import ast import label import repository import os class IncludeDef: """ Represents build file include definition like include_defs("//include/path"). """ def __init__(self, ast_call: ast.Call) -> None: self.ast_call = ast_call def get_location(self) -> str: """ ...
LegNeato/buck
scripts/migrations/include_def.py
Python
apache-2.0
1,059
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, 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/lic...
devoid/nova
nova/virt/vmwareapi/host.py
Python
apache-2.0
8,021
#!/usr/bin/env python # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
luci/luci-py
appengine/third_party/python-adb/adb/fastboot_debug.py
Python
apache-2.0
1,879
# 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 ...
iPlantCollaborativeOpenSource/libcloud
libcloud/loadbalancer/drivers/elb.py
Python
apache-2.0
12,957
from lymph.core.monitoring.metrics import Aggregate from lymph.core.monitoring.global_metrics import RUsageMetrics, GeventMetrics, GarbageCollectionMetrics, ProcessMetrics class Aggregator(Aggregate): @classmethod def from_config(cls, config): tags = config.get_raw('tags', {}) # FIXME: move de...
vpikulik/lymph
lymph/core/monitoring/aggregator.py
Python
apache-2.0
509
# 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 (t...
heiths/allura
Allura/allura/tests/unit/test_mixins.py
Python
apache-2.0
3,087
# Copyright 2013 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
takeshineshiro/nova
nova/tests/functional/v3/test_console_auth_tokens.py
Python
apache-2.0
2,711
""" Test imageio avbin functionality. """ from pytest import raises from imageio.testing import run_tests_if_main, get_test_dir, need_internet import imageio from imageio import core from imageio.core import get_remote_file # if IS_PYPY: # skip('AVBIn not supported on pypy') test_dir = get_test_dir() mean = la...
patricksnape/imageio
tests/test_avbin.py
Python
bsd-2-clause
5,018
"""Add position and category in each message, so as to order the XML Revision ID: 435d360d3398 Revises: 2a68ba66c32b Create Date: 2015-05-03 19:00:38.124617 """ # revision identifiers, used by Alembic. revision = '435d360d3398' down_revision = '2a68ba66c32b' from alembic import op import sqlalchemy as sa def upgr...
porduna/appcomposer
alembic/versions/435d360d3398_add_position_and_category_in_each_.py
Python
bsd-2-clause
1,306
from paging.paginators import * def paginate(request, queryset_or_list, per_page=25, endless=True): if endless: paginator_class = EndlessPaginator else: paginator_class = BetterPaginator paginator = paginator_class(queryset_or_list, per_page) query_dict = request.GET.copy() ...
alex/django-paging
paging/helpers.py
Python
bsd-3-clause
652