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 |
|---|---|---|---|---|---|
from .. syntax import (Expr, Assign, ExprStmt, ForLoop, If, Return, While, Comment, ParFor,
TypedFn, UntypedFn, Closure, ClosureElt, Select,
Attribute, Const, Index, PrimCall, Tuple, Var,
Alloc, Array, Call, Struct, Shape, Strides, Range, Ravel, ... | pombredanne/parakeet | parakeet/analysis/syntax_visitor.py | Python | bsd-3-clause | 9,020 |
from django.contrib.localflavor.gb.forms import GBPostcodeField
from utils import LocalFlavorTestCase
class GBLocalFlavorTests(LocalFlavorTestCase):
def test_GBPostcodeField(self):
error_invalid = [u'Enter a valid postcode.']
valid = {
'BT32 4PX': 'BT32 4PX',
'GIR 0AA': 'G... | disqus/django-old | tests/regressiontests/forms/localflavor/gb.py | Python | bsd-3-clause | 1,023 |
# -*- coding: 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):
# Deleting field 'Snippet.country'
db.delete_column(u'base_snippet', 'country')
def backwards(self, or... | bensternthal/snippets-service | snippets/base/migrations/0016_auto__del_field_snippet_country.py | Python | bsd-3-clause | 10,256 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import subprocess
from telemetry.core import exceptions
from telemetry.internal.platform import android_platform_backend as \
android_platf... | Pluto-tv/chromium-crosswalk | tools/telemetry/telemetry/internal/backends/chrome/android_browser_backend.py | Python | bsd-3-clause | 8,130 |
##########################################################################
#
# Copyright (c) 2009, 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... | appleseedhq/cortex | test/IECoreScene/CurveExtrudeOp.py | Python | bsd-3-clause | 2,392 |
from pydatacsvext import * | jnmclarty/trump | trump/extensions/source/tx-pydatacsv/__init__.py | Python | bsd-3-clause | 26 |
import sys
import re
from django import template
from django.template import TemplateSyntaxError
from django.template.defaulttags import URLNode
from openflow.common.utils.OptinThemeManager import OptinThemeManager
'''
@author: omoya
OCF Custom URL templatetag to support different themes with transp... | avlach/univbris-ocf | optin_manager/src/python/openflow/common/utils/templatetags/url.py | Python | bsd-3-clause | 2,734 |
from __future__ import absolute_import
from datetime import datetime
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase
class OrganizationProjectsSentFirstEventEndpointTest(APITestCase):
def setUp(self):
self.foo = self.create_user("foo@example.com")
self.org ... | beeftornado/sentry | tests/sentry/api/endpoints/test_organization_projects_sent_first_event.py | Python | bsd-3-clause | 2,479 |
# encoding: utf-8
"""
attribute/__init__.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
# Every Attribute should be imported from this file
# as it makes sure that all the registering decorator are run
from exabgp.bgp.message.update.attribute.attribute impor... | dneiter/exabgp | lib/exabgp/bgp/message/update/attribute/__init__.py | Python | bsd-3-clause | 1,850 |
# Copyright 2016 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.
"""Takes care of manipulating the chrome's HTTP cache.
"""
from datetime import datetime
import json
import os
import re
import shutil
import subprocess
imp... | was4444/chromium.src | tools/android/loading/chrome_cache.py | Python | bsd-3-clause | 14,619 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, DataCanvasIO
# 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 copyri... | dkuner/example-modules | modules/modeling/CDH4/demo_hero/sqoop2_importer/pysqoop2.py | Python | bsd-3-clause | 11,284 |
import os
SITE_ID = 1
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.staticfiles',
'd... | michaelkuty/form_designer | tests/testapp/settings.py | Python | bsd-3-clause | 1,646 |
#-----------------------------------------------------------------------------
# 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/server/tests/utils.py | Python | bsd-3-clause | 4,151 |
from numpy import asarray, cumprod, convolve, exp, ones
from numpy.random import lognormal, gamma, uniform
from bokeh.layouts import row, column, gridplot
from bokeh.models import ColumnDataSource, Slider, Select
from bokeh.plotting import curdoc, figure
from bokeh.driving import count
BUFSIZE = 200
MA12, MA26, EMA12... | phobson/bokeh | examples/app/ohlc/main.py | Python | bsd-3-clause | 3,828 |
from os.path import join as join_path
import os
abspath = os.path.dirname(os.path.abspath(__file__))
lock_file = '/home/ai/lock'
data_dir = join_path(abspath, '..', '99_data')
train_dir = join_path(data_dir, 'train')
validation_dir = join_path(data_dir, 'validation')
result_dir = join_path(abspath, '..', '90_result')... | mrm-xiefan/lunania-ai | vggtest/config.py | Python | mit | 420 |
"""This is the actual code we use to score people's solutions
server-side. The interfaces here are not yet stable, but we include
them so that people can reproduce our scoring calculations
independently.
We correspondly do not currently import this module.
"""
import numpy as np
import requests
import gym
def score... | machinaut/gym | gym/scoreboard/scoring.py | Python | mit | 6,275 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE.TXT file)
import os
import random
from django.http import HttpResponseRedirect
from django.views.decorators.http import require_http_methods
from apps.common.shortcuts import render_response
from apps.si... | F483/bikesurf.org | apps/site/views.py | Python | mit | 1,402 |
from collections import deque
from contextlib import contextmanager
import json
from jsonschema import FormatChecker, ValidationError
from jsonschema.tests.compat import mock, unittest
from jsonschema.validators import (
RefResolutionError, UnknownType, Draft3Validator,
Draft4Validator, RefResolver, create, ex... | vivekgalatage/libtracing | third-party/jsonschema/jsonschema/tests/test_validators.py | Python | mit | 32,355 |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | BurtBiel/autorest | ClientRuntimes/Python/msrest/msrest/serialization.py | Python | mit | 36,865 |
# --------------------------------------------------------------------------------------------
# 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 | scripts/live_test/clean.py | Python | mit | 2,035 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-05-09 21:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0067_auto_20170427_1442'),
]
operations = [
migrations.A... | fle-internal/content-curation | contentcuration/contentcuration/migrations/0068_auto_20170509_1456.py | Python | mit | 654 |
import gc
import sys
import unittest
import collections
import weakref
import operator
import contextlib
import copy
from test import support
# Used in ReferencesTestCase.test_ref_created_during_del() .
ref_from_del = None
class C:
def method(self):
pass
class Callable:
bar = None
def __call__... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_weakref.py | Python | mit | 47,954 |
import sys
import os
import time
import string
import __builtin__
from panda3d.core import *
from direct.showbase.MessengerGlobal import *
from direct.showbase.DirectObject import DirectObject
from direct.showbase.EventManagerGlobal import *
from direct.task.MiniTask import MiniTask, MiniTaskManager
from direct.directn... | Spiderlover/Toontown | otp/launcher/LauncherBase.py | Python | mit | 85,462 |
from ctypes import *
import ctypes.util;
import os, os.path
from common import *
import common
common.dll = dll = CDLL(os.path.abspath("libtest4.so"))
dll.test_pyd.restype = py_object
reg_fun('utf8_to_python', UTF8CONV(utf8_to_str))
a = dll.test_pyd(1)
assert a == u'Doctor!\0'
a = dll.test_pyd(2)
assert a == u'Doctor... | eugeneai/pyd | examples/misc/ctypes/test4.py | Python | mit | 421 |
# pylint: disable=W0223
import warnings
import numpy as np
from pandas.compat import range, zip
import pandas.compat as compat
from pandas.core.dtypes.generic import ABCDataFrame, ABCPanel, ABCSeries
from pandas.core.dtypes.common import (
is_integer_dtype,
is_integer, is_float,
is_list_like,
is_sequen... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/core/indexing.py | Python | mit | 73,228 |
createCancelServerTicket = {'id': 1234, 'title': 'Server Cancellation Request'}
getObject = {
"accountId": 1234,
"assignedUserId": 12345,
"createDate": "2013-08-01T14:14:04-07:00",
"id": 100,
"lastEditDate": "2013-08-01T14:16:47-07:00",
"lastEditType": "AUTO",
"modifyDate": "2013-08-01T14:16... | briancline/softlayer-python | SoftLayer/fixtures/SoftLayer_Ticket.py | Python | mit | 963 |
import six
from ctypes import c_ulong, c_ushort, c_void_p, c_ulonglong, POINTER,\
Structure, c_wchar_p, WINFUNCTYPE, windll, byref, cast
class Status(object):
SEC_E_OK = 0
SEC_I_CONTINUE_NEEDED = 0x00090312
SEC_I_COMPLETE_AND_CONTINUE = 0x00090314
SEC_I_INCOMPLETE_CREDENTIALS = 0x00090320
SEC_... | m32/pytds | src/pytds/sspi.py | Python | mit | 15,485 |
# coding=utf-8
"""
Collects data from php-fpm if the pm.status_path is enabled
#### Usage
A sample php-fpm config for this collector to work is
```
pm.status_path = /fpm-status
```
#### Dependencies
* urllib2
* json (or simeplejson)
"""
try:
import json
json # workaround for pyflakes issue #13
exce... | disqus/Diamond | src/collectors/phpfpm/phpfpm.py | Python | mit | 2,259 |
from .test_models import *
from .test_gcm_push_payload import *
from .test_apns_push_payload import *
from .test_management_commands import *
from .test_apns_certfilecheck import *
from .test_wns import *
# conditionally test rest_framework api if the DRF package is installed
try:
import rest_framework
except ImportE... | hylje/django-push-notifications | tests/__init__.py | Python | mit | 373 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import sorl.thumbnail.fields
from django.conf import settings
import cambiaahora.utils
import ckeditor.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(s... | CARocha/plataforma_fadcanic | cambiaahora/staff/migrations/0001_initial.py | Python | mit | 1,717 |
# -*- coding: utf-8 -*-
__version__ = '7.1.0'
| sbuss/voteswap | lib/bootstrap3/__init__.py | Python | mit | 47 |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# 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 right... | mattcaldwell/boto | tests/integration/dynamodb2/test_layer1.py | Python | mit | 10,268 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py | Python | mit | 870 |
'''OpenGL extension PGI.vertex_hints
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_PGI_vertex_hints'
_DEPRECATED = False
GL_VERTEX_DATA_HINT_... | D4wN/brickv | src/build_data/windows/OpenGL/raw/GL/PGI/vertex_hints.py | Python | gpl-2.0 | 2,221 |
from builtins import range
from idc import Byte, SegEnd
from idautils import Segments
from idaapi import is_mapped
from miasm.core.utils import int_to_byte
from miasm.core.bin_stream import bin_stream_str
class bin_stream_ida(bin_stream_str):
"""
bin_stream implementation for IDA
Don't generate xrange u... | mrphrazer/miasm | miasm/core/bin_stream_ida.py | Python | gpl-2.0 | 1,317 |
import os
import sys
import getpass
import select
import subprocess as proc
try:
import json
except ImportError:
import simplejson as json
_input = None
# read stdin, if there's anything to read
_stdin_data = {}
while sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
line = sys.stdin.readline()
i... | ClusterLabs/crmsh | utils/crm_script.py | Python | gpl-2.0 | 4,984 |
'''OpenGL extension NV.texture_shader3
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_NV_texture_shader3'
_DEPRECATED = False
GL_OFFSET_PROJEC... | D4wN/brickv | src/build_data/windows/OpenGL/raw/GL/NV/texture_shader3.py | Python | gpl-2.0 | 2,168 |
# -*- coding:utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any ... | CERNDocumentServer/invenio | modules/bibindex/lib/tokenizers/BibIndexFilteringTokenizer.py | Python | gpl-2.0 | 3,671 |
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... | pmghalvorsen/gramps_branch | gramps/webapp/init_gramps.py | Python | gpl-2.0 | 1,033 |
from PyQt4.QtCore import Qt, QPoint, QObject, pyqtSignal
from PyQt4.QtGui import QWidget, QVBoxLayout, QSizePolicy, QFrame, QColor, QLabel
class ErrorPopup(QWidget):
error_template = ("<html>"
"<table style='background-color: #ffdfdf;'width='100%%'>"
"<tr><td style='fo... | arielalmendral/ert | python/python/ert_gui/ertwidgets/validationsupport.py | Python | gpl-3.0 | 3,782 |
# This file is part of pybootchartgui.
# pybootchartgui is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# pybootchartgui is dis... | Alwnikrotikz/pybootchartgui | pybootchartgui/gui.py | Python | gpl-3.0 | 10,060 |
from twisted.internet import defer
from twisted.trial import unittest
from twisted.trial import runner, reporter, util
from twisted.trial.test import detests
class TestSetUp(unittest.TestCase):
def _loadSuite(self, klass):
loader = runner.TestLoader()
r = reporter.TestResult()
s = loader.l... | kenorb-contrib/BitTorrent | twisted/trial/test/test_deferred.py | Python | gpl-3.0 | 8,291 |
# -*- coding: utf-8 -*-
from outwiker.gui.baseaction import BaseAction
class CloseTabAction (BaseAction):
"""
Закрыть текущую вкладку
"""
stringId = u"CloseTab"
def __init__(self, application):
self._application = application
@property
def title(self):
return _(u"Close T... | unreal666/outwiker | src/outwiker/actions/tabs.py | Python | gpl-3.0 | 2,186 |
# This file is part of waymarkedtrails.org
# Copyright (C) 2012-2013 Espen Oldeman Lund
# Copyright (C) 2015 Sarah Hoffmann
#
# 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 2
# of the Li... | jschleic/waymarked-trails-site | api/elevation.py | Python | gpl-3.0 | 6,310 |
# -*- coding: utf-8 -*-
from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
class SecureUploadEu(XFSHoster):
__name__ = "SecureUploadEu"
__type__ = "hoster"
__version__ = "0.05"
__pattern__ = r'https?://(?:www\.)?secureupload\.eu/\w{12}'
__description__ = """SecureUplo... | sebdelsol/pyload | module/plugins/hoster/SecureUploadEu.py | Python | gpl-3.0 | 584 |
# Copyright (C) 2014 LiuLang <gsushzhsosgsu@gmail.com>
# Use of this source code is governed by GPLv3 license that can be found
# in http://www.gnu.org/licenses/gpl-3.0.html
import os
import time
from gi.repository import Gtk
from bcloud import Config
_ = Config._
from bcloud import util
from bcloud.Widgets import ... | ghbhaha/bcloud | bcloud/PropertiesDialog.py | Python | gpl-3.0 | 4,642 |
# 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... | andrewpaulreeves/soapy | soapy/_version.py | Python | gpl-3.0 | 7,416 |
# Support for the Dublin Core metadata extensions
# Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that... | SickGear/SickGear | lib/feedparser_py3/namespaces/dc.py | Python | gpl-3.0 | 4,446 |
# 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 ... | GirlsCodePy/girlscode-coursebuilder | modules/guide/messages.py | Python | gpl-3.0 | 1,542 |
"""
Django admin dashboard configuration for LMS XBlock infrastructure.
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from cms.djangoapps.xblock_config.models import StudioConfig
admin.site.register(StudioConfig, ConfigurationModelAdmin)
| eduNEXT/edx-platform | cms/djangoapps/xblock_config/admin.py | Python | agpl-3.0 | 290 |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | petervanderdoes/wger | wger/email/__init__.py | Python | agpl-3.0 | 839 |
sticker_list = {
'team2': u'BQADBAADGQADjGt_DbsN-MC0jtwKAg',
'team1': u'BQADBAADHQADjGt_DWh6bmUsF_GeAg',
'team3': u'BQADBAADGwADjGt_DcVn_7MprUVwAg',
'team0': u'BQADBAADHwADjGt_DWwRwTlwYq71Ag',
'pokestop': u'BQADBAADFwADjGt_DaQ-N7VAroZ7Ag',
'1': u'BQADBAADJwADA6ZnAU_NNRcf64d1Ag',
'2': u'BQADB... | xc0ut/PokeAlarm | PokeAlarm/Telegram/Stickers.py | Python | agpl-3.0 | 11,849 |
# This script is used to import boundary polygons and other information
# from the ONS's CD-ROM of Super Output Areas for England and Wales.
# Information about the CD-ROM here: http://bit.ly/63bX97
# Run as: ./manage.py mapit_UK_import_soa shapefile.shp
from django.core.management.base import LabelCommand
from djang... | chris48s/mapit | mapit_gb/management/commands/mapit_UK_import_soa.py | Python | agpl-3.0 | 2,689 |
# 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 Caffe(CMakePackage):
"""Caffe is a deep learning framework made with expression, speed, an... | iulian787/spack | var/spack/repos/builtin/packages/caffe/package.py | Python | lgpl-2.1 | 3,670 |
# 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 PyAstunparse(PythonPackage):
"""An AST unparser for Python.
This is a factored out ver... | iulian787/spack | var/spack/repos/builtin/packages/py-astunparse/package.py | Python | lgpl-2.1 | 976 |
# -*- 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):
# Changing field 'Revision.author'
db.alter_column(u'codespeed_revision'... | nomeata/codespeed | codespeed/migrations/0013_auto__chg_field_revision_author__chg_field_environment_kernel__chg_fie.py | Python | lgpl-2.1 | 9,704 |
# 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 textwrap import... | UnrememberMe/pants | tests/python/pants_test/targets/test_scala_library.py | Python | apache-2.0 | 3,132 |
"""The tests for the filesize sensor."""
import os
from unittest.mock import patch
import pytest
from homeassistant import config as hass_config
from homeassistant.components.filesize import DOMAIN
from homeassistant.components.filesize.sensor import CONF_FILE_PATHS
from homeassistant.const import SERVICE_RELOAD
from... | jawilson/home-assistant | tests/components/filesize/test_sensor.py | Python | apache-2.0 | 2,762 |
# Copyright (c) 2014 Cloudera, 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 o... | scalingdata/Impala | tests/comparison/query_generator.py | Python | apache-2.0 | 55,531 |
"""Vera tests."""
from unittest.mock import MagicMock
import pyvera as pv
from homeassistant.core import HomeAssistant
from .common import ComponentFactory, new_simple_controller_config
async def test_scene(
hass: HomeAssistant, vera_component_factory: ComponentFactory
) -> None:
"""Test function."""
v... | partofthething/home-assistant | tests/components/vera/test_scene.py | Python | apache-2.0 | 832 |
# Copyright 2018 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 agreed to in writing, s... | jonparrott/gcloud-python | datastore/synth.py | Python | apache-2.0 | 1,170 |
# Copyright 2005-2010 Wesabe, 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 ... | myfreecomm/fixofx | test/ofx_error.py | Python | apache-2.0 | 1,053 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2014 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
#
# Unl... | phoenixsbk/kvmmgr | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/firewall.py | Python | apache-2.0 | 2,217 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import ConfigParser
from pprint import pformat
try:
from neutron.openstack.common import log as logging
except ImportError:
from oslo_log import log as logging
from oslo.config import cfg
from httplib2 import Http
import re
import string
import sys
import cgitb
imp... | vpramo/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | Python | apache-2.0 | 6,906 |
#!/usr/bin/env python
# coding: utf-8
#
# Usage: python -matx screen [-s 0.8]
import os
import time
import traceback
import cv2
from functools import partial
from atx.adbkit.client import Client
from atx.adbkit.device import Device
from atx.adbkit.mixins import MinicapStreamMixin, RotationWatcherMixin, M... | codeskyblue/AutomatorX | atx/cmds/screen.py | Python | apache-2.0 | 7,668 |
#
# 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... | nathanielvarona/airflow | airflow/sensors/time_sensor.py | Python | apache-2.0 | 1,406 |
# 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... | mixturemodel-flow/tensorflow | tensorflow/python/ops/variable_scope.py | Python | apache-2.0 | 71,239 |
hiddenimports = ['sip', 'PyQt4.QtGui', 'PyQt4._qt']
from PyInstaller.hooks.hookutils import qt4_plugins_binaries
def hook(mod):
mod.binaries.extend(qt4_plugins_binaries('phonon_backend'))
return mod
| supercheetah/diceroller | pyinstaller/PyInstaller/hooks/hook-PyQt4.phonon.py | Python | artistic-2.0 | 210 |
# Generated by Django 2.2.5 on 2019-09-09 13:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('bhs', '0003_auto_20190906_2147'),
]
operations = [
migrations.RemoveField(
model_name='group',
name='chapters',
),
... | dbinetti/barberscore-django | project/apps/bhs/migrations/0004_auto_20190909_0637.py | Python | bsd-2-clause | 532 |
#! /usr/bin/env python
import os
import magic
import argparse
from termcolor import colored
from subprocess import Popen, PIPE
parser = argparse.ArgumentParser(description='Toby', epilog='Yes, a queer mongrel, with a most amazing power of scent')
parser.add_argument('-i', dest='case', action='store_true', default=Fal... | zigitax/toby | toby.py | Python | bsd-2-clause | 1,582 |
# -*- coding: utf-8 -*-
import pytest
from datetime import datetime
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import (Categorical, Index, Series, Timestamp,
CategoricalIndex, date_range, DatetimeIndex,
period_range, timedelta_range, Na... | louispotok/pandas | pandas/tests/categorical/test_constructors.py | Python | bsd-3-clause | 20,017 |
from __future__ import unicode_literals, print_function
import os
import io
import errno
import sys
import time
import subprocess
from itertools import tee
from six import BytesIO
from six.moves import zip
from pkg_resources import working_set, resource_filename
import pytest
from wex.readable import EXT_WEXIN
from wex... | gilessbrown/wextracto | tests/test_command.py | Python | bsd-3-clause | 5,108 |
import sys
#from CPAC.interfaces.afni import preprocess
from nipype.interfaces.afni import preprocess
import os
import commands
import nipype.pipeline.engine as pe
import nipype.algorithms.rapidart as ra
import nipype.interfaces.afni as afni
import nipype.interfaces.fsl as fsl
import nipype.interfaces.io as nio
import ... | danlurie/C-PAC | CPAC/sca/sca.py | Python | bsd-3-clause | 13,711 |
"""
Tests for discrete models
Notes
-----
DECIMAL_3 is used because it seems that there is a loss of precision
in the Stata *.dta -> *.csv output, NOT the estimator for the Poisson
tests.
"""
# pylint: disable-msg=E1101
import os
import numpy as np
from numpy.testing import (assert_, assert_raises, assert_almost_equa... | yarikoptic/pystatsmodels | statsmodels/discrete/tests/test_discrete.py | Python | bsd-3-clause | 49,558 |
import logging
import os
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.db import connections
from django.db.models import Q, F, Avg
import cronjobs
import multidb
from celery.task.sets import TaskSet
import waffle
from olympia import amo
from olympia.amo.celery imp... | andymckay/addons-server | src/olympia/addons/cron.py | Python | bsd-3-clause | 11,368 |
# Copyright Anne M. Archibald 2008
# Released under the scipy license
from __future__ import division, print_function, absolute_import
from numpy.testing import (assert_equal, assert_array_equal, assert_,
assert_almost_equal, assert_array_almost_equal)
from pytest import raises as assert_ra... | Eric89GXL/scipy | scipy/spatial/tests/test_kdtree.py | Python | bsd-3-clause | 42,617 |
# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
"""Locking primitives"""
from gevent.hub import getcurrent
from gevent._semaphore import Semaphore
__all__ = ['Semaphore', 'DummySemaphore', 'BoundedSemaphore', 'RLock']
class DummySemaphore(object):
# XXX what is this used for?
"""A Semapho... | ubuntuvim/GoAgent | local/gevent-1.0rc2/gevent/lock.py | Python | mit | 3,077 |
#
# Transmission Line Simulator
#
# Author(s): Jiacong Xu
# Created: Jun-27-2017
# | flyingbanana1024102/transmission-line-simulator | src/views/__init__.py | Python | mit | 83 |
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | joshowen/django-allauth | allauth/socialaccount/providers/kakao/provider.py | Python | mit | 1,264 |
#! /usr/env/python
"""
Python implementation of RadialModelGrid, a grid class used to create and
manage structured Voronoi-Delaunay grids for 2D numerical models.
Do NOT add new documentation here. Grid documentation is now built in a semi-
automated fashion. To modify the text seen on the web, edit the files
`docs/te... | csherwood-usgs/landlab | landlab/grid/radial.py | Python | mit | 8,078 |
# -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import logging
import datetime
from io import BytesIO
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
from .c... | lucashmorais/x-Bench | mozmill-env/python/Lib/site-packages/requests/models.py | Python | mit | 22,091 |
##########################################################################
# Copyright (c) 2009, 2013, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, C... | utsav2601/cmpe295A | tools/harness/siteconfig/uw.py | Python | mit | 1,471 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Will Bond <will@wbond.net>
#
# 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 limita... | croneter/PlexKodiConnect | resources/lib/watchdog/utils/unicode_paths.py | Python | gpl-2.0 | 2,171 |
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | nesi/easybuild-framework | test/framework/utilities.py | Python | gpl-2.0 | 15,056 |
#! /usr/bin/env python
"""Token constants (from "token.h")."""
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# python Lib/token.py
#--start constants--
ENDM... | sensysnetworks/uClinux | user/python/Lib/token.py | Python | gpl-2.0 | 2,941 |
#This converter script is created by windhamwong.
#This script is used for converting non-ASCII character in decompiled lua file generated by unluac into the correct character.
import re, sys, getopt
input_filepath = ''
output_filepath = ''
if (len(sys.argv) < 5):
print 'luaConverter.py -i <inputfile> -o... | AndreasWilliams/BotGravindo | plugins/needs-review/luaStringConverter/trunk/luaStringConverter.py | Python | gpl-2.0 | 1,268 |
# -*- coding: utf-8 -*-
#
# balancedneuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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,... | INM-6/nest-git-migration | pynest/examples/balancedneuron.py | Python | gpl-2.0 | 6,690 |
# Add root folder to python paths
# This must be done on every test in order to pass in Travis
import os
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..')))
from gui.aboutData import versionString, licenses, developers, credit... | blitzmann/Pyfa | tests/test_modules/test_gui/test_aboutData.py | Python | gpl-3.0 | 604 |
from geemusic import app
import os
if __name__ == '__main__':
port = int(os.environ.get("PORT", 4000))
app.run(host='0.0.0.0', port=port, debug=True)
| PostsDesert/geemusic | server.py | Python | gpl-3.0 | 159 |
# coding=utf-8
# Author: Dustyn Gibson <miigotu@gmail.com>
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fre$
# Foundation, either version 3 of the License... | b0ttl3z/SickRage | sickbeard/providers/ncore.py | Python | gpl-3.0 | 5,358 |
# This file is part of JujuPy, a library for driving the Juju CLI.
# Copyright 2013-2017 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the Lesser GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This program is di... | freyes/juju | acceptancetests/jujupy/backend.py | Python | agpl-3.0 | 12,440 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 08 16:45:12 2015
@author: thomas.douenne
"""
from __future__ import division
import pandas as pd
import numpy as np
from pandas import concat
from openfisca_france_indirect_taxation.examples.utils_example import get_input_data_frame
from openfisca_france_indirect_taxat... | thomasdouenne/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/almost_ideal_demand_system/aids_dataframe_builder_coicop.py | Python | agpl-3.0 | 8,551 |
"""
Models for Bookmarks.
"""
import logging
import six
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from jsonfield.fields import JSONField
from model_utils.models import TimeStampedModel
from opaque_keys.edx.django.models impo... | cpennington/edx-platform | openedx/core/djangoapps/bookmarks/models.py | Python | agpl-3.0 | 8,283 |
#!/usr/bin/env python
import os
import sys
# Horrible boilerplate - there must be a better way :)
sys.path.append(
os.path.abspath(
os.path.dirname(__file__) + '../../..'
)
)
import simplejson
from pprint import pprint
from django.utils.text import slugify
from django_date_extensions.fields impor... | patricmutwiri/pombola | pombola/core/kenya_import_scripts/import_parties_from_json.py | Python | agpl-3.0 | 1,011 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | chengdh/openerp-ktv | openerp/addons/stock/wizard/stock_partial_picking.py | Python | agpl-3.0 | 11,019 |
# Amara, universalsubtitles.org
#
# Copyright (C) 2015 Participatory Culture 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 opti... | ofer43211/unisubs | apps/api/pagination.py | Python | agpl-3.0 | 3,393 |
# Copyright 2013-2021 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 Piranha(CMakePackage):
"""Piranha is a computer-algebra library for the symbolic manipulat... | LLNL/spack | var/spack/repos/builtin/packages/piranha/package.py | Python | lgpl-2.1 | 1,547 |
import urllib
from xml.dom import minidom
import xml.dom.ext
import StringIO
import random
import string
import socket
import struct
import time
import uuid
import threading
import thread
BUFFER_SIZE = 0xffff
APP_MAX_DELAY = 500 # miliseconds
DP_MAX_TIMEOUT = 5000 # 5 seconds
MULTICAST_PORT = 3702
MUL... | MyPeWa/python-ws-discovery | WSDiscovery.py | Python | lgpl-3.0 | 46,468 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501
from tapi... | karthik-sethuraman/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_oam_meg_mip.py | Python | apache-2.0 | 5,067 |
#!/usr/bin/env python
import argparse
import plistlib
import json
import os
import sys
valid_bumps = ['major', 'minor', 'bugfix']
#
# Argparse
#
parser = argparse.ArgumentParser(description='Bump version in xcode project and podspec')
parser.add_argument('bump', type=str, nargs='?', default=valid_bumps[2], choices=va... | mogui/MDWamp | bump.py | Python | apache-2.0 | 2,994 |