code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page
from telemetry import story
class ServiceWorkerBenchmarkPage(page.Page):
"""Page for workload to measure some spe... | axinging/chromium-crosswalk | tools/perf/page_sets/service_worker_micro_benchmark.py | Python | bsd-3-clause | 1,389 |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import sys
from pyasn1.codec.der import decoder as der_decoder
from pyasn1.codec.der import encoder as der_encoder
from pyasn1_modules import pem
from pyasn1_m... | catapult-project/catapult | third_party/gsutil/third_party/pyasn1-modules/tests/test_rfc2314.py | Python | bsd-3-clause | 2,078 |
import numpy as np
import pytest
from pandas._libs.tslibs import iNaT
from pandas._libs.tslibs.period import IncompatibleFrequency
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays import (
PeriodArray,
period_array,
)
@pytest.mark.parametrize(
"data, freq, expected",
[
... | rs2/pandas | pandas/tests/arrays/period/test_constructors.py | Python | bsd-3-clause | 3,116 |
# Do not edit this file, pipeline versioning is governed by git tags
__version__=0.0.0 | ecolell/aquire | version.py | Python | mit | 86 |
# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
# Copyright (C) 2012 Rackspace US, Inc.,
# Justin Shepherd <jshepher@rackspace.com>
# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com>
# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
# This pr... | csutherl/sos | sos/plugins/openstack_cinder.py | Python | gpl-2.0 | 3,713 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.HIGHEST
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Replaces instances like 'CONCAT(... | pwnieexpress/raspberry_pwn | src/pentest/sqlmap/tamper/concat2concatws.py | Python | gpl-3.0 | 766 |
"""
Command to migrate transcripts to django storage.
"""
import logging
from django.core.management import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import CourseLocator
from cms.djangoapps.contentstore.tasks import (
... | Stanford-Online/edx-platform | cms/djangoapps/contentstore/management/commands/migrate_transcripts.py | Python | agpl-3.0 | 4,653 |
# -*- coding: utf-8 -*-
# Copyright 2015 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
#
# U... | sandeepdsouza93/TensorFlow-15712 | tensorflow/python/kernel_tests/io_ops_test.py | Python | apache-2.0 | 3,819 |
import logging
from flask import request, flash, abort, Response
from flask_admin import expose
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import wrap_fields_in_fieldlist
from flask_admin.model.fields import ListEditableFieldLi... | hexlism/css_platform | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/contrib/mongoengine/view.py | Python | apache-2.0 | 20,150 |
import logging
import multiprocessing
import os
from mimetypes import guess_type
from django.conf import settings
from django.core.cache import cache
from django.db import connection
from zerver.lib.avatar_hash import user_avatar_path
from zerver.lib.upload import S3UploadBackend, upload_image_to_s3
from zerver.model... | andersk/zulip | zerver/lib/transfer.py | Python | apache-2.0 | 3,678 |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | edespino/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/gpinitstandby/__init__.py | Python | apache-2.0 | 6,141 |
import functools
from django import http
from django.core.exceptions import PermissionDenied
from django.shortcuts import redirect
from olympia import amo
from olympia.access import acl
from olympia.addons.decorators import addon_view_factory
from olympia.addons.models import Addon
from olympia.amo.decorators import ... | aviarypl/mozilla-l10n-addons-server | src/olympia/devhub/decorators.py | Python | bsd-3-clause | 2,494 |
# -*- coding: utf-8 -*-
"""
The rrule module offers a small, complete, and very fast, implementation of
the recurrence rules documented in the
`iCalendar RFC <https://tools.ietf.org/html/rfc5545>`_,
including support for caching of results.
"""
import itertools
import datetime
import calendar
import re
import sys
try:... | ledtvavs/repository.ledtv | script.tvguide.Vader/resources/lib/dateutil/rrule.py | Python | gpl-3.0 | 64,642 |
""" API v0 views. """
import logging
from django.http import Http404
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.exceptions import AuthenticationFailed
from rest_... | naresh21/synergetics-edx-platform | lms/djangoapps/grades/api/views.py | Python | agpl-3.0 | 6,482 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.p... | cevaris/pants | src/python/pants/backend/python/targets/python_requirement_library.py | Python | apache-2.0 | 1,293 |
# Copyright 2015 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 by applicable law or a... | peterbraden/tensorflow | tensorflow/python/framework/framework_lib.py | Python | apache-2.0 | 3,634 |
#! /usr/bin/env python
# Selectively preprocess #ifdef / #ifndef statements.
# Usage:
# ifdef [-Dname] ... [-Uname] ... [file] ...
#
# This scans the file(s), looking for #ifdef and #ifndef preprocessor
# commands that test for one of the names mentioned in the -D and -U
# options. On standard output it write... | google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/ifdef.py | Python | apache-2.0 | 3,829 |
"""Auto-generated file, do not edit by hand. IE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IE = PhoneMetadata(id='IE', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[159]\\d{2,4}', possible_number_pattern... | dongguangming/python-phonenumbers | python/phonenumbers/shortdata/region_IE.py | Python | apache-2.0 | 993 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | liukaijv/XlsxWriter | xlsxwriter/test/comparison/test_image_anchor05.py | Python | bsd-2-clause | 1,181 |
""" Unit tests for nonlinear solvers
Author: Ondrej Certik
May 2007
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import assert_
import pytest
from scipy._lib.six import xrange
from scipy.optimize import nonlin, root
from numpy import matrix, diag, dot
from numpy.linalg impor... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/optimize/tests/test_nonlin.py | Python | mit | 15,054 |
#!/usr/bin/python
import ldns
pkt = ldns.ldns_pkt.new_query_frm_str("www.google.com",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
rra = ldns.ldns_rr.new_frm_str("www.google.com. IN A 192.168.1.1",300)
rrb = ldns.ldns_rr.new_frm_str("www.google.com. IN TXT Some\ Description",300)
list =... | fangdingjun/dnsproxy | third-part/ldns-1.6.17/contrib/python/examples/python3/ldns-newpkt.py | Python | gpl-3.0 | 476 |
"""add message column to event
Revision ID: 211e93aff1e1
Revises: 2493281d621
Create Date: 2015-03-20 18:50:29.961734
"""
# revision identifiers, used by Alembic.
revision = '211e93aff1e1'
down_revision = '2f3c8fa3fc3a'
from alembic import op
from sqlalchemy.sql import text
def upgrade():
conn = op.get_bind()... | nylas/sync-engine | migrations/versions/152_add_message_id_to_event.py | Python | agpl-3.0 | 867 |
"""
Test cases for tabs.
"""
from mock import MagicMock, Mock, patch
from courseware.courses import get_course_by_id
from courseware.views import get_static_tab_contents
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from student.tests.factories import UserFactory
from x... | huchoi/edx-platform | lms/djangoapps/courseware/tests/test_tabs.py | Python | agpl-3.0 | 4,042 |
# Copyright 2014 Scality
# 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 appli... | varunarya10/tempest | tempest/scenario/test_shelve_instance.py | Python | apache-2.0 | 4,194 |
# Lint as: python3
# Copyright 2020 The Bazel 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 requir... | twitter-forks/bazel | tools/ctexplain/types.py | Python | apache-2.0 | 3,539 |
'''
Created on Jun 27, 2010
@author: jnaous
'''
from openflow.dummyom.models import DummyOM
def run():
for om in DummyOM.objects.all():
om.delete()
for i in xrange(3):
om = DummyOM.objects.create()
om.populate_links(10, 20)
| ict-felix/stack | vt_manager_kvm/src/python/scripts/create_oms.py | Python | apache-2.0 | 273 |
#
# 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 us... | maropu/spark | python/pyspark/mllib/feature.py | Python | apache-2.0 | 28,134 |
"""Tests for the Bond cover device."""
from datetime import timedelta
from bond_api import Action, DeviceType
from homeassistant import core
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_CLOSE_COVER,
SERVICE_OPEN_COVER,
SERV... | sdague/home-assistant | tests/components/bond/test_cover.py | Python | apache-2.0 | 4,207 |
#!/usr/bin/python
# Creator: Daniel Wooten
# License: GPL
# import the python logging utility as log
import logging as log
# Set the root logger level ( what messages it will print )
log.basicConfig( level = 10 )
# Some sample messages for the root logger
log.debug( "This is the debug level reporting in" )
log.info(... | jnaulty/berkeley | python_logger/log_pres_2.py | Python | bsd-3-clause | 529 |
from __future__ import print_function
from django.core.management.base import BaseCommand
from optparse import make_option
from laws.models import Bill
from laws.vote_choices import BILL_STAGE_CHOICES
from mks.models import Knesset
class Command(BaseCommand):
help = "Freeze bills staged in previous knessets"
... | noamelf/Open-Knesset | laws/management/commands/freeze_bills.py | Python | bsd-3-clause | 1,347 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import abs, cos, exp, log, arange, pi, roll, sin, sqrt, sum
from .go_benchmark import Benchmark
class BartelsConn(Benchmark):
r"""
Bartels-Conn objective function.
The BartelsConn [1]_ global optimizatio... | chatcannon/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_B.py | Python | bsd-3-clause | 21,639 |
from __future__ import unicode_literals
import datetime
import re
import sys
from unittest import skipIf
import warnings
from xml.dom.minidom import parseString
try:
import pytz
except ImportError:
pytz = None
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db.mod... | deployed/django | tests/timezones/tests.py | Python | bsd-3-clause | 55,059 |
# Example using PIO to create a UART TX interface
from machine import Pin
from rp2 import PIO, StateMachine, asm_pio
UART_BAUD = 115200
PIN_BASE = 10
NUM_UARTS = 8
@asm_pio(sideset_init=PIO.OUT_HIGH, out_init=PIO.OUT_HIGH, out_shiftdir=PIO.SHIFT_RIGHT)
def uart_tx():
# fmt: off
# Block with TX deasserted un... | pfalcon/micropython | examples/rp2/pio_uart_tx.py | Python | mit | 1,250 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | Jorge-Rodriguez/ansible | lib/ansible/modules/cloud/google/gcp_spanner_database_facts.py | Python | gpl-3.0 | 4,857 |
# Copyright 2013 Intel Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | LoHChina/nova | nova/api/openstack/compute/plugins/v3/pci.py | Python | apache-2.0 | 5,476 |
from rest_framework import serializers as ser
from rest_framework import exceptions
from framework.auth.oauth_scopes import public_scopes
from website.models import ApiOAuth2PersonalToken
from api.base.serializers import JSONAPISerializer, LinksField, IDField, TypeField
class ApiOAuth2PersonalTokenSerializer(JSONAP... | ticklemepierce/osf.io | api/tokens/serializers.py | Python | apache-2.0 | 2,864 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 Softw... | hzruandd/AutobahnPython | examples/twisted/websocket/streaming/message_based_server.py | Python | mit | 2,143 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | GdZ/scriptfile | software/googleAppEngine/google/appengine/api/datastore_errors.py | Python | mit | 4,172 |
import binascii
import itertools
import os
import random
import subprocess
from weaver.stack import WeaverNests
from weaver.util import Stash
def nstdir(path):
return os.path.join(CurrentNest().work_dir, path)
# Thoughts:
# - For shared files: fifo-0,push-async-1 is equivalent to fifo-0,pull-inf
TASKS = 25
SHAR... | nkremerh/cctools | chirp/tools/workflows/pull-tests.py | Python | gpl-2.0 | 2,512 |
# -*- coding: utf-8 -*-
from ansible.compat.tests import unittest
from ansible.modules.packaging.os.yum import YumModule
yum_plugin_load_error = """
Plugin "product-id" can't be imported
Plugin "search-disabled-repos" can't be imported
Plugin "subscription-manager" can't be imported
Plugin "product-id" can't be imp... | maartenq/ansible | test/units/modules/packaging/os/test_yum.py | Python | gpl-3.0 | 9,340 |
# Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
from __future__ import division, absolute_import, print_function
import os, signal
import warnings
import sys
fr... | JFriel/honours_project | venv/lib/python2.7/site-packages/numpy/distutils/command/config.py | Python | gpl-3.0 | 17,986 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-Guillaume (Camptocamp)
# Copyright 2010-2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pub... | scigghia/account-invoicing | account_invoice_validation_workflow/__openerp__.py | Python | agpl-3.0 | 1,645 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
class URLMappings(object):
def __init__(self, src_root, build_dir):
self.mappings = {
'dart:mojo.internal': os.path.join(s... | xunmengfeng/engine | sky/tools/skypy/url_mappings.py | Python | bsd-3-clause | 878 |
'''
WikiLinks Extension for Python-Markdown
======================================
Converts [[WikiLinks]] to relative links.
See <https://pythonhosted.org/Markdown/extensions/wikilinks.html>
for documentation.
Original code Copyright [Waylan Limberg](http://achinghead.com/).
All changes Copyright The Python Markdo... | andela-bojengwa/talk | venv/lib/python2.7/site-packages/markdown/extensions/wikilinks.py | Python | mit | 2,901 |
#!/usr/bin/python
#
# Scaleway SSH keys management module
#
# Copyright (C) 2018 Online SAS.
# https://www.scaleway.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_function
__metaclass__ = type
ANSIBLE_METADATA... | hryamzik/ansible | lib/ansible/modules/cloud/scaleway/scaleway_sshkey.py | Python | gpl-3.0 | 5,245 |
#!/usr/bin/env $PYTHON$
# Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import os
import socket
import struct
import sys
import traceback
# See com.intellij.idea.SocketLock for the server side of this interface.
RUN_PATH = u... | siosio/intellij-community | platform/platform-resources/src/launcher.py | Python | apache-2.0 | 4,104 |
#
# 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 us... | mahak/spark | python/pyspark/ml/recommendation.py | Python | apache-2.0 | 24,774 |
s = rf"f<caret>oo{'bar'}"
| siosio/intellij-community | python/testData/intentions/convertingRawFStringQuotes_after.py | Python | apache-2.0 | 26 |
"""Proides the constants needed for component."""
ATTR_APP_ID = "app_id"
ATTR_APP_NAME = "app_name"
ATTR_INPUT_SOURCE = "source"
ATTR_INPUT_SOURCE_LIST = "source_list"
ATTR_MEDIA_ALBUM_ARTIST = "media_album_artist"
ATTR_MEDIA_ALBUM_NAME = "media_album_name"
ATTR_MEDIA_ARTIST = "media_artist"
ATTR_MEDIA_CHANNEL = "medi... | fbradyirl/home-assistant | homeassistant/components/media_player/const.py | Python | apache-2.0 | 1,935 |
##########################################################################
#
# Copyright (c) 2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | lento/cortex | test/IECore/IgnoredExceptionsTest.py | Python | bsd-3-clause | 2,674 |
"""
Empty
"""
| fallisd/validate | unittests/__init__.py | Python | gpl-2.0 | 14 |
#!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.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_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | alxgu/ansible | lib/ansible/modules/cloud/azure/azure_rm_servicebusqueue.py | Python | gpl-3.0 | 12,400 |
#!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | WillianPaiva/ycmd | ycmd/server_state.py | Python | gpl-3.0 | 4,592 |
# 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/python/debug/cli/analyzer_cli.py | Python | apache-2.0 | 58,062 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from setup.installer import VMInstaller
from setup import Command
class Linux32(VM... | ashang/calibre | setup/installer/linux/__init__.py | Python | gpl-3.0 | 792 |
import requests
import time
import dblayer
from sklearn.cluster import DBSCAN
import plotly
import plotly.graph_objs as go
import pandas as pd
import numpy as np
import random
import testfile
# Create random colors in list
color_list = []
def generate_color(ncluster):
for i in range(ncluster):
color = '... | abhishek8gupta/sp17-i524 | project/S17-IO-3017/code/projectearth/dbscanplot.py | Python | apache-2.0 | 3,601 |
"""Support for MySensors covers."""
from homeassistant.components import mysensors
from homeassistant.components.cover import ATTR_POSITION, DOMAIN, CoverEntity
from homeassistant.const import STATE_OFF, STATE_ON
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the ... | tchellomello/home-assistant | homeassistant/components/mysensors/cover.py | Python | apache-2.0 | 3,250 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | sjperkins/tensorflow | tensorflow/tensorboard/backend/event_processing/plugin_asset_util.py | Python | apache-2.0 | 3,278 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | annarev/tensorflow | tensorflow/python/autograph/pyct/testing/basic_definitions.py | Python | apache-2.0 | 1,533 |
#!/usr/bin/env python
""" hg-to-git.py - A Mercurial to GIT converter
Copyright (C)2007 Stelian Pop <stelian@popies.net>
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 versi... | pniebla/test-repo-console | svn/git-1.8.3.3.tar/git-1.8.3.3/git-1.8.3.3/contrib/hg-to-git/hg-to-git.py | Python | mit | 8,052 |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright (C) 2020 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import subprocess
from .base import Installer
__author__ =... | kYc0o/RIOT | dist/tools/dhcpv6-pd_ia/pkg/apt.py | Python | lgpl-2.1 | 703 |
# Copyright (c) 2014 Dell 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 a... | nikesh-mahalka/cinder | cinder/tests/unit/test_dellsc.py | Python | apache-2.0 | 85,579 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = '''
callback: default
type:... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/callback/default.py | Python | bsd-3-clause | 13,463 |
# coding: utf-8
"""
Compatibility functions for unified behavior between Python 2.x and 3.x.
:author: Alex Grönholm
"""
from __future__ import unicode_literals, absolute_import
import inspect
import sys
from threading import Thread
if sys.version_info[0] < 3:
def items(d):
return d.items()
def iteri... | fouzelddin/py4j | py4j-python/src/py4j/compat.py | Python | bsd-3-clause | 2,249 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImportedFile'
db.create_table('projects_importedfile', (
('id', self.gf('djang... | KamranMackey/readthedocs.org | readthedocs/projects/migrations/0006_add_imported_file.py | Python | mit | 8,964 |
# Copyright 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 requ... | eharney/nova | nova/tests/api/openstack/compute/test_image_metadata.py | Python | apache-2.0 | 9,569 |
# Copyright 2015 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/keras/python/keras/layers/merge.py | Python | bsd-2-clause | 18,999 |
"""AXScript Client Framework
This module provides a core framework for an ActiveX Scripting client.
Derived classes actually implement the AX Client itself, including the
scoping rules, etc.
There are classes defined for the engine itself, and for ScriptItems
"""
import sys
from win32com.axscript import axscr... | leighpauls/k2cro4 | third_party/python_26/Lib/site-packages/win32comext/axscript/client/framework.py | Python | bsd-3-clause | 36,696 |
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Ansible Project
# 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
import pytest
from ansible.module_utils.common.arg_spec import ArgumentSpecVa... | privateip/ansible | test/units/module_utils/common/arg_spec/test_validate_invalid.py | Python | gpl-3.0 | 3,830 |
# Copyright 2011 Shinichiro Hamaji. 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
# notice, this list of conditions ... | lebauce/darling | tools/gdb_maloader.py | Python | gpl-3.0 | 2,497 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, an open source suite of business apps
# This module copyright (C) 2014-2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | amoya-dx/account-financial-tools | account_reset_chart/__openerp__.py | Python | agpl-3.0 | 1,329 |
import os
from django.contrib.auth import authenticate
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.context_processors import PermWrapper, PermLookupDict
from djan... | simbha/mAngE-Gin | lib/django/contrib/auth/tests/test_context_processors.py | Python | mit | 7,020 |
#!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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',
'status': ['... | alxgu/ansible | lib/ansible/modules/network/netvisor/pn_port_cos_bw.py | Python | gpl-3.0 | 4,163 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | WALR/taiga-back | taiga/projects/services/bulk_update_order.py | Python | agpl-3.0 | 5,428 |
# -*- coding: utf-8 -*-
#
# 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
... | MetrodataTeam/incubator-airflow | airflow/contrib/operators/file_to_gcs.py | Python | apache-2.0 | 2,453 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from profile_creators import cookie_profile_extender
from profile_creators import history_profile_extender
from profile_creators import profile_extender
cla... | guorendong/iridium-browser-ubuntu | tools/perf/profile_creators/large_profile_extender.py | Python | bsd-3-clause | 713 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-08 09:18
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import tinymce.models
class Migration(migrations.Migration):
in... | GunnerJnr/_CodeInstitute | Stream-3/Full-Stack-Development/20.Deployment/4.Populating-our-database/we_are_social/threads/migrations/0001_initial.py | Python | mit | 2,276 |
from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from django.utils.six.moves import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObject... | havard024/prego | venv/lib/python2.7/site-packages/django/db/models/base.py | Python | mit | 44,041 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetR... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Rendering/Core/Testing/Python/CamBlur.py | Python | gpl-3.0 | 1,969 |
# -*- coding: utf-8 -*-
from . import test_convert
from . import test_env
| ddico/odoo | odoo/addons/test_convert/tests/__init__.py | Python | agpl-3.0 | 74 |
"""
This module contains a set of functions for vectorized string
operations and methods.
.. note::
The `chararray` class exists for backwards compatibility with
Numarray, it is not recommended for new development. Starting from numpy
1.4, if one needs arrays of strings, it is recommended to use arrays of
... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/numpy/core/defchararray.py | Python | mit | 67,393 |
# -*- coding: utf-8 -*-
# Copyright 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
| akretion/stock-logistics-workflow | stock_picking_manual_procurement_group/__init__.py | Python | agpl-3.0 | 149 |
# Copyright 2012 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 by applicable law or ... | haoyuchen1992/CourseBuilder | modules/admin/config.py | Python | apache-2.0 | 13,933 |
### main - create and run lexer from stdin
if __name__ == '__main__' :
import sys
import antlr
import rewrite_l
### create lexer - shall read from stdin
L = rewrite_l.Lexer()
try:
L.mSTART(1);
token = L.getTokenObject()
except antlr.TokenStreamException, e:
print "error: exception caug... | scottstephens/boo | lib/antlr-2.7.5/examples/python/lexRewrite/rewrite.py | Python | bsd-3-clause | 355 |
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
#
# 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 published by
# the Free Software Foundation, either... | attakei/ansible | lib/ansible/executor/module_common.py | Python | gpl-3.0 | 8,252 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Finds revisions from the Thunderbird migration that don't have based_on
set correctly, and are still relavent, and fixes that.
Run this script like `./manage.py runscript fix_tb_basedon`.
"""
import sys
from traceback import print_exc
from django.db.models import Q
... | feer56/Kitsune1 | scripts/fix_tb_basedon.py | Python | bsd-3-clause | 1,520 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, IBM Corp
# Author(s): Andreas Nafpliotis <nafpliot@de.ibm.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_function
__metaclass__ = type
ANSIBLE... | hryamzik/ansible | lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py | Python | gpl-3.0 | 6,371 |
#!/usr/bin/env python2.7
from __future__ import print_function
import struct
import sys
import numpy
class Analyzer:
"""
The binary format is
time since the beginning of the measurement : double
unknown and irrelevant field : double
momentary consumption calculated for the current tim... | rokuz/omim | tools/python/InstrumentsTraceParser.py | Python | apache-2.0 | 1,746 |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | c1728p9/mbed-os | tools/host_tests/host_tests_plugins/module_copy_mbed.py | Python | apache-2.0 | 2,899 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... | caio2k/RIDE | src/robotide/lib/robot/libraries/dialogs_jy.py | Python | apache-2.0 | 3,458 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is very different to AboutModules in Ruby Koans
# Our AboutMultipleInheritance class is a little more comparable
#
from runner.koan import *
#
# Package hierarchy of Python Koans project:
#
# contemplate_koans.py
# koans/
# __init__.py
# about_asserts.py... | tokyo-jesus/university | src/python/koans/python3/koans/about_packages.py | Python | unlicense | 1,909 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | xuleiboy1234/autoTitle | tensorflow/tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler_test.py | Python | mit | 44,613 |
#!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | Tatsh-ansible/ansible | lib/ansible/modules/cloud/openstack/os_server_facts.py | Python | gpl-3.0 | 3,271 |
# Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | newrocknj/horizon | openstack_dashboard/dashboards/project/firewalls/views.py | Python | apache-2.0 | 14,127 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]] | saurabh6790/test-med-app | hr/doctype/designation/test_designation.py | Python | agpl-3.0 | 215 |
# Copyright 2017 Google 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 writing, ... | tartavull/google-cloud-python | trace/tests/__init__.py | Python | apache-2.0 | 575 |
"""Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | vermouthmjl/scikit-learn | sklearn/learning_curve.py | Python | bsd-3-clause | 14,601 |
#!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | andreaso/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py | Python | gpl-3.0 | 8,929 |
#!/usr/bin/env python2
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set... | appuio/ansible-role-openshift-zabbix-monitoring | vendor/openshift-tools/ansible/inventory/aws/ec2.py | Python | apache-2.0 | 55,406 |
#
# Copyright (C) 2012-2014 The Paparazzi Team
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# any later version.
#
# P... | LodewijkSikkel/paparazzi | sw/tools/parrot/parrot_utils.py | Python | gpl-2.0 | 2,820 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.