repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
blitzmann/Pyfa | eos/saveddata/fighterAbility.py | 1 | 5887 | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... | gpl-3.0 |
davidwaroquiers/pymatgen | pymatgen/io/abinit/tests/test_inputs.py | 5 | 10923 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import tempfile
import unittest
import numpy as np
from pymatgen.core.structure import Structure
from pymatgen.io.abinit.inputs import (
BasicAbinitInput,
BasicMultiDataset,
ShiftMode,
... | mit |
yasoob/youtube-dl-GUI | youtube_dl/extractor/glide.py | 64 | 1543 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class GlideIE(InfoExtractor):
IE_DESC = 'Glide mobile video messages (glide.me)'
_VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
_TEST = {
'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dC... | mit |
acshi/osf.io | website/util/rubeus.py | 7 | 11153 | # -*- coding: utf-8 -*-
"""Contains helper functions for generating correctly
formatted hgrid list/folders.
"""
import logging
import hurry.filesize
from django.utils import timezone
from framework import sentry
from framework.auth.decorators import Auth
from django.apps import apps
from website import settings
fro... | apache-2.0 |
daafgo/Server_LRS | lrs/util/retrieve_statement.py | 1 | 11615 | import bencode
import hashlib
import json
from datetime import datetime
from itertools import chain
from django.core.cache import cache
from django.conf import settings
from django.core.paginator import Paginator
from django.db.models import Q
from util import convert_to_utc, convert_to_dict
from ..models import Stat... | apache-2.0 |
RAtechntukan/CouchPotatoServer | libs/subliminal/services/tvsubtitles.py | 106 | 6240 | # -*- coding: utf-8 -*-
# Copyright 2012 Nicolas Wack <wackou@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of the Licen... | gpl-3.0 |
ds-hwang/chromium-crosswalk | remoting/tools/zip2msi.py | 89 | 8691 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Generates .msi from a .zip archive or an unpacked directory.
The structure of the input archive or directory should look like t... | bsd-3-clause |
rolobio/DictORM | dictorm/pg.py | 1 | 10974 | """
This module is used to build queries for Postgresql. You shouldn't really need
to import anything from this file because they can all be built using
dictorm.Table.
Sqlite queries are slightly different, but use these methods as their base.
"""
from copy import copy
from typing import Union
global sort_keys
sort_... | apache-2.0 |
megraf/asuswrt-merlin | release/src/router/libxml2/python/tests/xpath.py | 87 | 1188 | #!/usr/bin/python -u
#
# this test exercise the XPath basic engine, parser, etc, and
# allows to detect memory leaks
#
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
doc = libxml2.parseFile("tst.xml")
if doc.name != "tst.xml":
print "doc.name error"
sys.exit(1);
ctxt = doc.xpathNewC... | gpl-2.0 |
mmatyas/skia | tools/misc_utils.py | 68 | 7711 | # Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module to host the VerboseSubprocess, ChangeDir, and ReSearch classes.
"""
import os
import re
import subprocess
def print_subprocess_args(prefix, *args, **kwargs):
"""Print o... | bsd-3-clause |
mbauskar/helpdesk-frappe | frappe/patches/v5_2/change_checks_to_not_null.py | 58 | 1267 | from __future__ import unicode_literals
import frappe
from frappe.utils import cint
from frappe.model import default_fields
def execute():
for table in frappe.db.get_tables():
doctype = table[3:]
if frappe.db.exists("DocType", doctype):
fieldnames = [df["fieldname"] for df in
frappe.get_all("DocField", fie... | mit |
wiltonlazary/arangodb | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/tests/lru_test.py | 6 | 6265 | #!/usr/bin/env python
# Copyright 2013 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
import json
import logging
import os
import sys
import tempfile
import unittest
ROOT_DIR = os.path.dirname(os.path.dirn... | apache-2.0 |
kkampardi/Plinth | plinth/modules/matrixsynapse/views.py | 2 | 2670 | #
# This file is part of Plinth.
#
# 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 version.
#
# This program is distribute... | agpl-3.0 |
ZihengJiang/mxnet | python/mxnet/profiler.py | 31 | 2161 | # 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... | apache-2.0 |
critiqjo/key-mon | src/keymon/options.py | 15 | 14492 | #!/usr/bin/python
#
# Copyright 2010 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 a... | apache-2.0 |
maciekcc/tensorflow | tensorflow/python/ops/linalg_grad.py | 23 | 9040 | # 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... | apache-2.0 |
kirkbroadhurst/sudokupy | test_moves.py | 1 | 3391 | from moves import find_possible_moves, find_impossible_moves, resolve_moves
def test_find_possible_moves_1():
# the first item, with value 0, is 'missing'. find_possible_moves will tell us it should be a 9.
state = [((i,i), i) for i in range(9)]
moves = find_possible_moves(state)
assert len(moves... | mit |
Fireblend/chromium-crosswalk | tools/cygprofile/cyglog_to_orderfile.py | 6 | 8358 | #!/usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Symbolizes a log file produced by cyprofile instrumentation.
Given a log file and the binary being profiled, creates an orderfile.
"""
... | bsd-3-clause |
sqlalchemy/sqlalchemy | test/orm/test_rel_fn.py | 3 | 45031 | from sqlalchemy import and_
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from ... | mit |
igor-rangel7l/novoigorrangel.repository | plugin.video.SportsDevil/service/asn1crypto/keys.py | 13 | 35048 | # coding: utf-8
"""
ASN.1 type classes for public and private keys. Exports the following items:
- DSAPrivateKey()
- ECPrivateKey()
- EncryptedPrivateKeyInfo()
- PrivateKeyInfo()
- PublicKeyInfo()
- RSAPrivateKey()
- RSAPublicKey()
Other type classes are defined that help compose the types listed above.
"""
... | gpl-2.0 |
bhansa/fireball | pyvenv/Lib/site-packages/pip/vcs/bazaar.py | 514 | 3803 | from __future__ import absolute_import
import logging
import os
import tempfile
# TODO: Get this into six.moves.urllib.parse
try:
from urllib import parse as urllib_parse
except ImportError:
import urlparse as urllib_parse
from pip.utils import rmtree, display_path
from pip.vcs import vcs, VersionControl
fro... | gpl-3.0 |
codingjoe/viewflow | tests/integration/tests/test_flow_func.py | 2 | 2022 | from django.test import TestCase
from viewflow import flow
from viewflow.base import Flow, this
from .. import integration_test
def create_test_flow(activation):
activation.prepare()
activation.done()
return activation
@flow.flow_func(task_loader=lambda flow_task, process: process.get_task(FunctionFlo... | agpl-3.0 |
noroutine/ansible | lib/ansible/playbook/role_include.py | 23 | 5507 |
#
# 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 version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope th... | gpl-3.0 |
hnousiainen/pghoard | pghoard/pgutil.py | 2 | 3543 | # Copied from https://github.com/ohmu/ohmu_common_py ohmu_common_py/pgutil.py version 0.0.1-0-unknown-fa54b44
"""
pghoard - postgresql utility functions
Copyright (c) 2015 Ohmu Ltd
See LICENSE for details
"""
try:
from urllib.parse import urlparse, parse_qs # pylint: disable=no-name-in-module, import-error
excep... | apache-2.0 |
vgkholla/ambry | ambry-tools/scripts/layout-analyzer.py | 7 | 7025 | #!/usr/bin/python2.7
import argparse
import json
import sys
from collections import defaultdict
class Node(object):
def __init__(self, node, datacenter):
self.node = node
self.datacenter = datacenter
self.partitions = set()
@property
def hostname(self):
return self.node["... | apache-2.0 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/topi/python/topi/testing/roi_align_python.py | 2 | 3126 | # 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... | apache-2.0 |
zhouxiao-coder/Paddle | demo/introduction/trainer_config.py | 3 | 1344 | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 |
caesar2164/edx-platform | common/djangoapps/track/transformers.py | 51 | 16677 | """
EventTransformers are data structures that represents events, and modify those
events to match the format desired for the tracking logs. They are registered
by name (or name prefix) in the EventTransformerRegistry, which is used to
apply them to the appropriate events.
"""
import json
import logging
from opaque_... | agpl-3.0 |
luci/luci-py | appengine/swarming/server/task_request_test.py | 2 | 86434 | #!/usr/bin/env vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import datetime
import logging
import random
import string
import sys
import unittest
import test_env
test_env.setup_test_... | apache-2.0 |
Clemson-DPA/dpa-pipe | dpa/app/session.py | 1 | 9786 |
from abc import ABCMeta, abstractmethod, abstractproperty
import importlib
import os
import shlex
import subprocess
import socket
import time
import rpyc
from dpa.app.entity import EntityRegistry
from dpa.env.vars import DpaVars
from dpa.ptask.area import PTaskArea
from dpa.ptask import PTaskError, PTask
from dpa.si... | mit |
h2non/paco | paco/wait.py | 1 | 3118 | # -*- coding: utf-8 -*-
import asyncio
from .assertions import isiter
from .concurrent import ConcurrentExecutor
@asyncio.coroutine
def wait(*coros_or_futures, limit=0, timeout=None, loop=None,
return_exceptions=False, return_when='ALL_COMPLETED'):
"""
Wait for the Futures and coroutine objects given... | mit |
BehavioralInsightsTeam/edx-platform | lms/djangoapps/grades/apps.py | 16 | 1502 | """
Grades Application Configuration
Signal handlers are connected here.
"""
from django.apps import AppConfig
from django.conf import settings
from edx_proctoring.runtime import set_runtime_service
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
class Gra... | agpl-3.0 |
akopich/spark | python/pyspark/java_gateway.py | 56 | 5851 | #
# 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... | apache-2.0 |
MatriX-Coder/wsploit | modules/wjoomlacomponents.py | 1 | 8322 | #!/usr/bin/python
# Wsploit Project
'''
this is simple joomla
components scanner
'''
try:
import urllib2, Queue
except:
print 'You need urllib2 and Queue librarys installed.'
try:
from threading import Thread
except:
print 'You need threading library installed.'
try:
from time import sleep
except:
print 'You ... | artistic-2.0 |
anentropic/django-oscar | tests/integration/offer/availability_tests.py | 40 | 1143 | from django.test import TestCase
from oscar.apps.offer import models
from oscar.test.factories import (
create_order, OrderDiscountFactory, UserFactory)
class TestAPerUserConditionalOffer(TestCase):
def setUp(self):
self.offer = models.ConditionalOffer(max_user_applications=1)
self.user = Us... | bsd-3-clause |
uskudnik/ggrc-core | src/ggrc/migrations/versions/20130910232450_53ef72c8a867_remove_old_audit_tab.py | 2 | 13296 | """Remove old audit tables
Revision ID: 53ef72c8a867
Revises: 526117e15ce4
Create Date: 2013-09-10 23:24:50.751098
"""
# revision identifiers, used by Alembic.
revision = '53ef72c8a867'
down_revision = '526117e15ce4'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
NOT_NULL_COLS... | apache-2.0 |
ryokochang/Slab-GCS | ExtLibs/Mavlink/pymavlink/generator/lib/genxmlif/xmlifApi.py | 12 | 54395 | #
# genxmlif, Release 0.9.0
# file: xmlifapi.py
#
# API (interface) classes for generic interface package
#
# history:
# 2007-06-29 rl created, classes extracted from xmlifbase.py
#
# Copyright (c) 2005-2008 by Roland Leuthe. All rights reserved.
#
# ------------------------------------------------------------------... | gpl-3.0 |
shaistaansari/django | tests/admin_widgets/tests.py | 55 | 57921 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gettext
import os
from datetime import datetime, timedelta
from importlib import import_module
from unittest import skipIf
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import ... | bsd-3-clause |
stefelisabeth/dplace | dplace_app/api_views.py | 1 | 21716 | import json
import re
import datetime
from itertools import groupby
import logging
from django.db import connection
from django.db.models import Prefetch, Q, Count
from django.shortcuts import get_object_or_404
from django.http import Http404
from rest_framework import viewsets
from rest_framework.pagination import P... | mit |
vjmac15/Lyilis | lib/youtube_dl/extractor/aparat.py | 15 | 2195 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
mimetype2ext,
)
class AparatIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?aparat\.com/(?:v/|video/video/embed/videohash/)(?P<id>[a-zA-Z0-9]+)'
_TEST = {
'url': ... | gpl-3.0 |
denys-duchier/django | tests/file_uploads/tests.py | 45 | 23742 | import base64
import hashlib
import os
import shutil
import sys
import tempfile as sys_tempfile
import unittest
from io import BytesIO, StringIO
from urllib.parse import quote
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser i... | bsd-3-clause |
onyxfish/agate | agate/table/bar_chart.py | 3 | 1303 | #!/usr/bin/env python
# pylint: disable=W0212
import leather
from agate import utils
def bar_chart(self, label=0, value=1, path=None, width=None, height=None):
"""
Render a bar chart using :class:`leather.Chart`.
:param label:
The name or index of a column to plot as the labels of the chart.
... | mit |
heiscsy/evolutus_ros_src | evolutus_filter/build/catkin_generated/installspace/_setup_util.py | 4 | 12275 | #!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, 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:
#
# * Redistributions of source code mu... | gpl-2.0 |
robhudson/kuma | vendor/packages/translate/storage/wordfast.py | 25 | 16043 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | mpl-2.0 |
cpanelli/-git-clone-https-chromium.googlesource.com-chromium-tools-depot_tools | third_party/pylint/checkers/similar.py | 64 | 14174 | # pylint: disable=W0622
# Copyright (c) 2004-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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 ver... | bsd-3-clause |
wnesl/gnuradio-IA | gnuradio-core/src/python/gnuradio/gr/qa_hier_block2.py | 18 | 13570 | #!/usr/bin/env python
from gnuradio import gr, gr_unittest
class test_hier_block2(gr_unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_001_make(self):
hblock = gr.hier_block2("test_block",
gr.io_signature(1,1,gr.sizeof_int),
gr.io_signature(1,1,gr.sizeof_int))
... | gpl-3.0 |
chubbymaggie/claripy | claripy/vsa/bool_result.py | 2 | 5012 | from ..backend_object import BackendObject
class BoolResult(BackendObject):
def __init__(self, op=None, args=None):
self._op = op
self._args = args
def value(self):
raise NotImplementedError()
def __len__(self):
return BackendError()
def __eq__(self, other):
r... | bsd-2-clause |
emilyvon/titanium_mobile | support/android/android.py | 33 | 15397 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
# Copyright (c) 2011-2013 by Appcelerator, Inc. All Rights Reserved.
# Licensed under the terms of the Apache Public License
# Please see the LICENSE included with this distribution for details.
#
# Android Application Script
#
import os, s... | apache-2.0 |
will4906/PatentCrawler | config/crawler_config.py | 1 | 8899 | # -*- coding: utf-8 -*-
"""
Created on 2018/3/14
@author: will4906
采集的内容、方式定义
"""
from bs4 import BeautifulSoup
from controller.url_config import url_search, url_detail, url_related_info, url_full_text
from crawler.items import DataItem
from entity.crawler_item import BaseItem, ResultItem
class PatentId(BaseItem):... | apache-2.0 |
w1ll1am23/home-assistant | tests/components/minio/common.py | 27 | 1804 | """Minio Test event."""
TEST_EVENT = {
"Records": [
{
"eventVersion": "2.0",
"eventSource": "minio:s3",
"awsRegion": "",
"eventTime": "2019-05-02T11:05:07Z",
"eventName": "s3:ObjectCreated:Put",
"userIdentity": {"principalId": "SO9KNO6Y... | apache-2.0 |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/distutils/tests/test_config.py | 90 | 3148 | """Tests for distutils.pypirc.pypirc."""
import sys
import os
import unittest
import tempfile
from distutils.core import PyPIRCCommand
from distutils.core import Distribution
from distutils.log import set_threshold
from distutils.log import WARN
from distutils.tests import support
from test.support import run_unittes... | lgpl-3.0 |
moccu/django-cruditor | tests/test_views.py | 1 | 15414 | import pytest
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages import SUCCESS as SUCCESS_LEVEL
from django.contrib.messages import get_messages
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.urls import reverse
from cruditor.views import Cruditor4... | mit |
MoritzS/django | tests/urlpatterns_reverse/included_namespace_urls.py | 72 | 1059 | from django.conf.urls import include, url
from .utils import URLObject
from .views import empty_view, view_class_instance
testobj3 = URLObject('testapp', 'test-ns3')
testobj4 = URLObject('testapp', 'test-ns4')
app_name = 'included_namespace_urls'
urlpatterns = [
url(r'^normal/$', empty_view, name='inc-normal-vie... | bsd-3-clause |
iwconfig/svtplay-dl | lib/svtplay_dl/fetcher/rtmp.py | 4 | 1391 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import subprocess
import shlex
from svtplay_dl.log import log
from svtplay_dl.utils import is_py2
from svtplay_dl.fetcher import VideoRetriever
from svtplay_dl.output import output
class RT... | mit |
ryfx/modrana | modules/mod_options/mod_options.py | 1 | 66705 | # -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Handle option menus
#----------------------------------------------------------------------------
# Copyright 2008, Oliver White
#
# This program is free software: you can redistribute it and/or modify
# it under the... | gpl-3.0 |
wetek-enigma/enigma2 | lib/python/Screens/ChannelSelection.py | 2 | 110011 | # -*- coding: utf-8 -*-
from boxbranding import getMachineBuild, getMachineBrand, getMachineName
import os
from Tools.Profile import profile
from Screen import Screen
import Screens.InfoBar
import Components.ParentalControl
from Components.Button import Button
from Components.ServiceList import ServiceList, refreshSer... | gpl-2.0 |
justinlulejian/fah-gae | lib/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
Johnzero/OE7 | openerp/report/render/rml2pdf/customfonts.py | 57 | 6317 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com)
#
# This program is free so... | agpl-3.0 |
yaqiyang/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_custom_header_operations.py | 4 | 15472 | # 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 ... | mit |
fedorpatlin/ansible | lib/ansible/modules/windows/win_firewall_rule.py | 41 | 3499 | #!/usr/bin/env python
# (c) 2014, Timothy Vandenbrande <timothy.vandenbrande@gmail.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 version 3 of the Lic... | gpl-3.0 |
gannetson/django | django/core/serializers/xml_serializer.py | 16 | 15345 | """
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | bsd-3-clause |
jgoclawski/django | django/contrib/auth/hashers.py | 211 | 17463 | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from d... | bsd-3-clause |
dandan94/OpenGLTest | finalOpenGL/HelloGLFW/lib/boost_1_59_0/libs/python/test/shared_ptr.py | 46 | 2017 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from shared_ptr_ext import *
Test that shared_ptr<Derived> can be converted to shared_ptr<Base>
>>> Y.store(YYY(42))
>>> ... | gpl-3.0 |
Rogdham/pelican | pelican/tests/test_urlwrappers.py | 7 | 3417 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pelican.tests.support import unittest
from pelican.urlwrappers import Author, Category, Tag, URLWrapper
class TestURLWrapper(unittest.TestCase):
def test_ordering(self):
# URLWrappers are sorted by name
wrapper_a = URLWrapper(na... | agpl-3.0 |
gklyne/annalist | src/annalist_root/annalist/views/form_utils/fieldchoice.py | 1 | 5788 | """
This module defines a class used to represent a choice for an
enumerated-value field.
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2015, G. Klyne"
__license__ = "MIT (htt... | mit |
kaczla/PJN | src/Przecinki/scikit.py | 1 | 1048 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn.cross_validation import cross_val_predict
from sklearn import linear_model
from sklearn import datasets
X = []
Y = []
for line in sys.stdin:
line = line.rstrip()
X... | gpl-2.0 |
maoy/zknova | nova/tests/api/openstack/test_faults.py | 1 | 7383 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# 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/... | apache-2.0 |
hfp/tensorflow-xsmm | tensorflow/python/training/basic_loops.py | 13 | 2348 | # 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... | apache-2.0 |
Sylrob434/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/fourtube.py | 19 | 3728 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_request,
unified_strdate,
str_to_int,
parse_duration,
clean_html,
)
class FourTubeIE(InfoExtractor):
IE_NAME = '4tube'
_VALID_URL = r'https?://(?:www\.)?4tube\.com/vide... | gpl-3.0 |
srluge/SickRage | lib/sqlalchemy/orm/mapper.py | 75 | 108686 | # orm/mapper.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logic to map Python classes to and from selectables.
Defines the :class:`~sqlalchemy... | gpl-3.0 |
hojel/calibre | src/calibre/library/restore.py | 14 | 11515 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re, os, traceback, shutil
from threading import Thread
from operator import itemgetter
from calibre.ptempfile impo... | gpl-3.0 |
perlygatekeeper/glowing-robot | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/sanitizer.py | 56 | 26248 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from pip._vendor.six.moves import urllib_parse as urlparse
from . import base
from ..constants import namespaces, prefixes
__all__ = ["Filter"]
allowed_elements = frozenset((
(namespaces[... | artistic-2.0 |
zasdfgbnm/tensorflow | tensorflow/contrib/kernel_methods/python/losses_test.py | 23 | 11003 | # 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... | apache-2.0 |
dhamaniasad/mythbox | resources/lib/twisted/twisted/test/test_logfile.py | 59 | 9810 | # Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
# system imports
import os, time, stat
# twisted imports
from twisted.python import logfile, runtime
class LogFileTestCase(unittest.TestCase):
"""
Test the rotating log file.
"""
de... | gpl-2.0 |
svn2github/django | django/core/management/commands/test.py | 111 | 2965 | import sys
import os
from optparse import make_option, OptionParser
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput',
actio... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.2/Lib/plat-linux2/DLFCN.py | 2 | 1632 | # Generated by h2py from /usr/include/dlfcn.h
_DLFCN_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC99_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L
_XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE = 1
_SV... | mit |
hoevenvd/weewx_poller | bin/weedb/sqlite.py | 1 | 4562 | #
# Copyright (c) 2012 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
# $Revision: 829 $
# $Author: tkeffer $
# $Date: 2013-01-19 08:05:49 -0800 (Sat, 19 Jan 2013) $
#
"""Driver for sqlite"""
import os.path
# Import sqlite3. If it does not support the 'with' stateme... | gpl-3.0 |
mozilla/make.mozilla.org | vendor-local/lib/python/celery/tests/test_backends/test_redis.py | 14 | 3385 | from __future__ import absolute_import
from __future__ import with_statement
import sys
import socket
from nose import SkipTest
from celery.exceptions import ImproperlyConfigured
from celery import states
from celery.utils import uuid
from celery.backends import redis
from celery.backends.redis import RedisBackend
... | bsd-3-clause |
hryamzik/ansible | lib/ansible/modules/windows/win_package.py | 4 | 9677 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Trond Hindenes <trond@hindenes.com>, and others
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA... | gpl-3.0 |
thaddeusdiamond/Social-Hierarchical-Learning | ext/protobuf/python/google/protobuf/internal/test_util.py | 295 | 27103 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | mit |
chatelak/RMG-Py | rmgpy/solver/__init__.py | 11 | 1557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | mit |
danforthcenter/plantcv | plantcv/plantcv/photosynthesis/analyze_fvfm.py | 2 | 5529 | # Fluorescence Analysis
import os
import cv2
import numpy as np
import pandas as pd
from plotnine import ggplot, geom_label, aes, geom_line
from plantcv.plantcv import print_image
from plantcv.plantcv import plot_image
from plantcv.plantcv import fatal_error
from plantcv.plantcv import params
from plantcv.plantcv impo... | mit |
vicky2135/lucious | oscar/lib/python2.7/site-packages/urllib3/exceptions.py | 223 | 6603 | from __future__ import absolute_import
from .packages.six.moves.http_client import (
IncompleteRead as httplib_IncompleteRead
)
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class Po... | bsd-3-clause |
tutengfei/zerorpc-python | tests/zmqbug.py | 94 | 5183 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
chachan/nodeshot | nodeshot/community/notifications/migrations/0001_initial.py | 5 | 4082 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Notification',
fields=[
... | gpl-3.0 |
waveform80/lars | lars/datatypes/url.py | 1 | 10354 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2013 Mime Consulting Ltd. <info@mimeconsulting.co.uk>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docum... | mit |
adobdin/timmy | timmy/analyze_modules/rabbitmq.py | 1 | 7526 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2016 Mirantis, 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-... | apache-2.0 |
smcantab/pele | playground/amber/driver_sanitycheck.py | 7 | 1208 | from pele.amber import amberSystem as amb
# create a new amber system and load database to be pruned
sys = amb.AMBERSystem('coords.prmtop', 'coords.inpcrd')
dbcurr = sys.create_database(db="aladipep.db")
print 'Collecting minima to delete .. '
listTODel = []
for minimum in dbcurr.minima():
testOutCome1 = sy... | gpl-3.0 |
sorenk/ansible | lib/ansible/utils/module_docs_fragments/ipa.py | 27 | 2627 | # Copyright (c) 2017-18, Ansible Project
# Copyright (c) 2017-18, Abhijeet Kasurde (akasurde@redhat.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Parameters for FreeIPA/IPA modules
DOCUMENTATION = '''
options:
ipa_port:
... | gpl-3.0 |
barykaed/Pelican-Test | activate/Lib/rlcompleter.py | 100 | 5763 | """Word completion for GNU readline.
The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.
It's very cool to do "import sys" type "sys.", hit the com... | mit |
feigames/Odoo | addons/survey/__init__.py | 385 | 1037 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
mfortner/MyPythonKoans | python2/koans/about_true_and_false.py | 1 | 1502 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTrueAndFalse(Koan):
def truth_value(self, condition):
if condition:
return 'true stuff'
else:
return 'false stuff'
def test_true_is_treated_as_true(self):
self.assertEqu... | mit |
llazzaro/analyzerstrategies | tests/test_sma_strategy.py | 1 | 1444 | import random
import unittest
from pyStock.models import (
Exchange,
Stock,
Account,
Owner,
)
from pyStock.models.money import Currency
from analyzer.backtest.constant import (
SELL,
BUY_TO_COVER,
)
from analyzerstrategies.sma_strategy import SMAStrategy
class TestSMAStrategy(unittest.TestCa... | bsd-3-clause |
takeshineshiro/keystone | keystone/common/extension.py | 31 | 1652 | # Copyright 2013 OpenStack Foundation
#
# 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... | apache-2.0 |
bankonmeOS/cjdns | node_build/dependencies/libuv/build/gyp/pylib/gyp/generator/android.py | 15 | 43658 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | gpl-3.0 |
ichuang/sympy | sympy/polys/domains/gmpyrationalfield.py | 3 | 3001 | """Implementaton of :class:`GMPYRationalField` class. """
from sympy.polys.domains.rationalfield import RationalField
from sympy.polys.domains.groundtypes import (
GMPYRationalType, SymPyRationalType,
gmpy_numer, gmpy_denom, gmpy_factorial,
)
from sympy.polys.polyerrors import CoercionFailed
class GMPYRatio... | bsd-3-clause |
cipriancraciun/extremely-simple-cluster-platform | components/py-tools/sources/escp/tools/enforcements.py | 1 | 23625 |
import re
import types
import escp.tools.callables as callables
import escp.tools.outcomes as outcomes
_e_debug = False
class Enforcer (object) :
def __init__ (self) :
return
def __nonzero__ (self) :
return _e_debug
def enforce (self, _condition) :
if _condition is not True :
raise Enforc... | gpl-3.0 |
linearregression/mpld3 | mpld3/__init__.py | 20 | 1109 | """
Interactive D3 rendering of matplotlib images
=============================================
Functions: General Use
----------------------
:func:`fig_to_html`
convert a figure to an html string
:func:`fig_to_dict`
convert a figure to a dictionary representation
:func:`show`
launch a web server to view... | bsd-3-clause |
edgedb/edgedb | edb/edgeql/compiler/inference/multiplicity.py | 1 | 21233 | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2020-present MagicStack Inc. and the EdgeDB authors.
#
# 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... | apache-2.0 |
luzheqi1987/nova-annotation | nova/vnc/__init__.py | 38 | 1810 | #!/usr/bin/env python
# Copyright (c) 2010 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/LICEN... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.