code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# 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 may ... | Azure/azure-sdk-for-python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_services_operations.py | Python | mit | 15,335 |
"""
=======================================================
Permutation F-test on sensor data with 1D cluster level
=======================================================
One tests if the evoked response is significantly different
between conditions. Multiple comparison problem is addressed
with cluster level permuta... | kambysese/mne-python | examples/stats/plot_cluster_stats_evoked.py | Python | bsd-3-clause | 3,021 |
#__ LGPL 3.0, 2014 Alexander Soloviev (no.friday@yandex.ru)
from re import match, VERBOSE
from comine.iface.maps import *
class Maps(object):
__PL = '''
\s*([\w]+)\s*-\s*([\w]+)
\s+([rwxps-]{4})
\s+(\w+)
\s+(\d+):(\d+)
\s+(\d+)
\s+(.*)
... | for-the-repose/comine | source/comine/arch/proc.py | Python | lgpl-3.0 | 1,973 |
"""1074. Number of Submatrices That Sum to Target
https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/
Given a matrix and a target, return the number of non-empty submatrices that
sum to target.
A submatrix x1, y1, x2, y2 is the set of all cells matrix[x][y] with x1 <= x
<= x2 and y1 <= y <= y2.
T... | isudox/leetcode-solution | python-algorithm/leetcode/problem_1074.py | Python | mit | 1,769 |
""" Base worker module """
import abc
class BaseWorker(metaclass=abc.ABCMeta):
""" Base worker
Inherit from this class to add a worker
"""
need_session = False
def __init__(self, server):
self.server = server
self.log = server.log
@abc.abstractmethod
def handle(self... | ningirsu/stepmania-server | smserver/listener/workers/base.py | Python | mit | 503 |
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
class Command(BaseCommand):
help = "TEST i18n"
def add_arguments(self, parser):
parser.add_argument('action', nargs='?', help='action ?')
def handle(self, *args, **options):
from... | gzqichang/wa | qi18n/qi18n/management/commands/test_i18n.py | Python | mit | 418 |
{
'name': 'Discount prepaid order',
'version': '1.0',
'category': 'Custom',
'description': """
Order Discount when it's prepaid and margin is between specific values
""",
'author': 'Nadia Ferreyra',
'website': '',
'depends': ['base',
'sale',
'pro... | Comunitea/CMNT_004_15 | project-addons/prepaid_order_discount/__manifest__.py | Python | agpl-3.0 | 697 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | ericmjl/bokeh | tests/integration/widgets/test_paragraph.py | Python | bsd-3-clause | 2,083 |
import sys
# Module containing non-deprecated functions borrowed from Numeric.
__docformat__ = "restructuredtext en"
# functions that are now methods
__all__ = ['take', 'reshape', 'choose', 'repeat', 'put',
'swapaxes', 'transpose', 'sort', 'argsort', 'argmax', 'argmin',
'searchsorted', 'alen',
... | teoliphant/numpy-refactor | numpy/core/fromnumeric.py | Python | bsd-3-clause | 71,781 |
import sys
from omniORB import CORBA, PortableServer
import Example, Example__POA
class EchoServer (Example__POA.Echo):
def echoString(self, mesg):
print "Got \"%s\", sending it back."%mesg
return mesg
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
poa = orb.resolve_initial_references("RootPOA")
ei = EchoSer... | amonmoce/corba_examples | python/server.py | Python | mit | 447 |
'''
Defines each of the benchmark problems used as well as the function sets
for those problems.
'''
from operator import or_, and_, add, sub, mul, div, xor
import itertools
import random
import math
def nand(x, y):
'''
Simple Nand function for inclusion in function sets.
'''
return not (x and y)
de... | brianwgoldman/cgp | problems.py | Python | bsd-2-clause | 15,308 |
#!usr/bin/env python
# add species name to m8
import sys
from Bio import SeqIO
if len(sys.argv[1:]) < 1:
print 'python this.py foo.fsa'
raise SystemExit()
fasta = sys.argv[1]
f = open(fasta, 'r')
for i in f:
if i.startswith('>'):
j = i[i.find('../')+3: i.find('|')]
hd = i.split(' ')[0][1:]... | Rinoahu/fastclust | example/deprecate/add_taxon2fas.py | Python | gpl-3.0 | 390 |
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import _, fields, models
from odoo.exceptions import UserError
from odoo.addons.l10n_br_fiscal.constants.fiscal import SITUACAO_EDOC_EM_DIGITACAO
class FiscalDocument(models.Model):
_in... | OCA/l10n-brazil | l10n_br_account/models/fiscal_document.py | Python | agpl-3.0 | 832 |
'''
Structure definitions for the OSX MachO binary format.
'''
import vstruct
import vstruct.primitives as vs_prim
from vstruct.defs.macho.const import *
from vstruct.defs.macho.fat import *
from vstruct.defs.macho.loader import *
| AbhishekShah212/School_Projects | esDay/rfcat_150225/vstruct/defs/macho/__init__.py | Python | mit | 235 |
"""Module will not import due to invalid blahblah import."""
import blahblah.blah
print("I dont do much")
def arbmodinvalid_attribute():
"""Can't ever run on account of how blah doesn't exist."""
blahblah.blah.blah()
| pypyr/pypyr-cli | tests/arbpack/arbinvalidimportmod.py | Python | apache-2.0 | 229 |
from flask import Blueprint, request
from skylines import api
from .json import jsonify
from .parser import parse_location
waves_blueprint = Blueprint('waves', 'skylines')
@waves_blueprint.route('/mountain_wave_project/')
@waves_blueprint.route('/mountain_wave_project', endpoint='list')
def _list():
location = ... | kerel-fs/skylines | skylines/api/views/waves.py | Python | agpl-3.0 | 405 |
#-*- coding: utf-8 -*-
#Venom.
from resources.lib.gui.hoster import cHosterGui
from resources.lib.handler.hosterHandler import cHosterHandler
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.handler.inputParameterHandler import cInputParameterHandler
from re... | Brahimbaz/venom-xbmc-addons-beta | plugin.video.vstream/resources/sites/trash/full_streaming_org.py | Python | gpl-2.0 | 12,837 |
#
# Copyright (C) 2012 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... | hmpf/nav | python/nav/eventengine/plugins/linkstate.py | Python | gpl-3.0 | 8,992 |
"""
Facade methods to WFS HERBIE
Note: Herbie Species is a WFS 'feature' with the following structure (as of 18/08/2016).
All species information are in the properties field.
{
'geometry': None,
'id': 'herbie_hbvspecies_public.fid--57d0ec5d_156a0d39c8d_-2266',
'type': 'Feature'
'properties': {
'... | gaiaresources/biosys | biosys/apps/main/utils_species.py | Python | apache-2.0 | 5,514 |
#!/usr/bin/python
import sys, os, threading, re
import tornado.web
import tornado.gen
import logging
import random
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append('..')
import common
import config
from handler import RequestHandler
from db import MySQLHelper
logger = logging.getLogger('web')
class AuthKe... | codemeow5/travellers-acs | travellers/authkey.py | Python | gpl-2.0 | 1,320 |
#!/usr/bin/env python
#
# Tests for the dakotathon.method.vector_parameter_study module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
from nose.tools import raises, assert_is_instance, assert_true, assert_equal
from dakotathon.method.vector_parameter_study import VectorParameterStudy
# ... | csdms/dakota | dakotathon/tests/test_method_vector_parameter_study.py | Python | mit | 2,144 |
import os
import sys
import tempfile
import shutil
import pyfastaq
import pysam
from iva import common, mapping
class Error (Exception): pass
def _head_fastaq(reads1, reads2, outfile, count):
'''Takes first N sequences from a pair of interleaved fasta/q files. Output is in FASTA format. Returns hash of read lengt... | satta/iva | iva/kcount.py | Python | gpl-3.0 | 8,789 |
# -*- coding: utf-8 -*-
#
# django-dynamic-scraper documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 5 15:05:19 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerate... | c3pko/GovScrape | docs/conf.py | Python | bsd-3-clause | 7,910 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-webrisk | google/cloud/webrisk_v1beta1/types/__init__.py | Python | apache-2.0 | 1,284 |
# coding=utf-8
"""Mixins used to give common functionality to NimLime commands."""
import inspect
import sublime
from NimLime.core import settings
SUBLIME_VERSION = int(sublime.version())
EXE_NOT_FOUND_MSG = ('Unable to run command, the following executables could '
'not be found: ')
NO_SETTINGS... | Varriount/NimLime | core/utils/mixins.py | Python | mit | 5,478 |
import os
from azure.storage.common import CloudStorageAccount
class DownLoadJob():
"This is the class for download job"
def __init__(self, jobSession, targetFolder, sourceShare, sourceDir=None):
print('+++++ Create download job +++++')
self.jobSession = jobSession
self.sour... | nazheng/Scrach | Download.py | Python | mit | 2,495 |
# Copyright (c) 2019-2020 Alexander Todorov <atodorov@MrSenko.com>
# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
from django.urls import re_path
from . import views
urlpatterns = [
re_path(r"^(?P<pk>\d+)/$", views.Get.as_view(), name="bugs-get"),
re_path(r"^new/$", vie... | kiwitcms/Kiwi | tcms/bugs/urls.py | Python | gpl-2.0 | 583 |
#!/usr/bin/python
### TBLASTX formatting
### MATCH = Only the first match keeped
MATCH = 0 # Only 1rst match Wanted
#MATCH = 1 # All match want
### SUBMATCH = several part of a same sequence match with the query
SUBMATCH = 0 # SUBMATCH NOT WANTED (ONLY 1rst HIT)
#SUBMATCH =1 # SUBMATCH WANTED
### NAME F... | abice-sbr/adaptsearch | 12_scriptExtractMatch_v20_BLASTX.py | Python | gpl-3.0 | 24,382 |
"""Helpers for config validation using voluptuous."""
from datetime import (timedelta, datetime as datetime_sys,
time as time_sys, date as date_sys)
import os
import re
from urllib.parse import urlparse
from socket import _GLOBAL_DEFAULT_TIMEOUT
import logging
import inspect
from typing import Any... | tinloaf/home-assistant | homeassistant/helpers/config_validation.py | Python | apache-2.0 | 18,532 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from quarry.net.server import ServerFactory, ServerProtocol
from random import randint
import packet as p
import permissions as perms
import randomdata as dats
import commands as cmd
import json
from sys import exit as sysex
from serve... | Armored-Dragon/pymineserver | server_core/server.py | Python | bsd-2-clause | 6,160 |
edad = 24
mensaje = "¡Feliz cumpleaños número " + str(edad) + "!"
print(mensaje)
| byque/programacion_en_python | b-variables_y_tipos_simples_de_datos/bf-imprimir_numeros_sin_error.py | Python | gpl-3.0 | 85 |
#!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | trondhindenes/ansible | lib/ansible/modules/net_tools/nios/nios_host_record.py | Python | gpl-3.0 | 8,805 |
TThostFtdcTraderIDType = "string"
TThostFtdcInvestorIDType = "string"
TThostFtdcBrokerIDType = "string"
TThostFtdcBrokerAbbrType = "string"
TThostFtdcBrokerNameType = "string"
TThostFtdcExchangeInstIDType = "string"
TThostFtdcOrderRefType = "string"
TThostFtdcParticipantIDType = "string"
TThostFtdcUserIDType = "string"... | bigdig/vnpy | vnpy/api/nh/generator/futures/nh_typedef.py | Python | mit | 27,858 |
import praw
import re
from re import findall
def deletemsg():
r = praw.Reddit(user_agent="Samachar Bot for /r/india by /u/sallurocks")
r.login("samacharbot2", "prawisverygood")
unread = r.get_unread(limit=None)
print "here"
for msg in unread:
print msg.body
if msg.body.lower() ==... | SalmaanP/samacharbot2 | WIP/deletemsg.py | Python | gpl-3.0 | 1,429 |
#from plfit import discrete_likelihood
from plfit import plfit
from plfit import test_fitter,pl_inv,plexp_inv,plexp_cdf, plexp_pdf, plfit_lsq
from plfit_py import plfit as plfit_py
| giserh/plfit | plfit/__init__.py | Python | mit | 181 |
#!/usr/bin/env python
"""
distutils setup (setup.py).
This is just boilerplate code, since we do like to try to keep data separate
from code as much as possible. The customizable information really comes
from file __pkginfo__.py.
"""
import os, sys
if not ((2, 4) <= sys.version_info[0:2] < (3, 0)):
mess = "Only... | rocky/python2-trepan | setup.py | Python | gpl-3.0 | 2,146 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | fiete201/qutebrowser | tests/unit/commands/test_userscripts.py | Python | gpl-3.0 | 7,833 |
import textwrap
def parse_script_args(args):
"""
Separate the command line arguments into arguments for pip
and arguments to Python.
>>> parse_script_args(['foo', '--', 'bar'])
(['foo'], ['bar'])
>>> parse_script_args(['foo', 'bar'])
(['foo', 'bar'], [])
"""
try:
pivot = args.index('--')
except ValueErr... | jaraco/rwt | pip_run/commands.py | Python | mit | 1,282 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 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 optio... | CERNDocumentServer/invenio | modules/bibcheck/lib/bibcheck_task.py | Python | gpl-2.0 | 37,836 |
from django.conf import settings
from django.utils.text import slugify
from django.test import Client, override_settings
from django.urls import reverse
from evennia.utils import class_from_module
from evennia.utils.test_resources import EvenniaTest
class EvenniaWebTest(EvenniaTest):
# Use the same classes the v... | jamesbeebop/evennia | evennia/web/website/tests.py | Python | bsd-3-clause | 9,576 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-09-14 11:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0028_uniqueify_rfid'),
]
operations = [
migrations.Alter... | dotKom/onlineweb4 | apps/authentication/migrations/0029_auto_20180914_1305.py | Python | mit | 1,623 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | lahwaacz/qutebrowser | qutebrowser/browser/network/proxy.py | Python | gpl-3.0 | 2,666 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Deuscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import DeuscoinTestFramework
from test_framework.util import *
# Cre... | deuscoin-org/deuscoin-core | qa/rpc-tests/fundrawtransaction.py | Python | mit | 24,552 |
from tempfile import TemporaryFile
from time import sleep
from subprocess import Popen, PIPE
from ..shell import BaseShellExec
from ....util import Bunch, kill_pid
from logging import getLogger
log = getLogger(__name__)
TIMEOUT_ERROR_MESSAGE = u'Execution timed out'
TIMEOUT_RETURN_CODE = -1
DEFAULT_TIMEOUT = 60
DEFA... | ssorgatem/pulsar | pulsar/managers/util/cli/shell/local.py | Python | apache-2.0 | 1,918 |
"""
This file is part of DeepConvSep.
Copyright (c) 2014-2017 Marius Miron <miron.marius at gmail.com>
DeepConvSep 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... | gerruz/DeepConvSep | examples/bach10/compute_features_bach10sibelius.py | Python | agpl-3.0 | 5,850 |
import argparse, os, sys, subprocess
from pathlib import Path
from distutils.spawn import find_executable
from . import alias, autocomplete
BASH_LOGIN_FILES = ['~/.bash_profile', '~/.bash_login', '~/.profile', '~/.bashrc']
def get_bash_file() -> str:
paths = [str(Path(_).expanduser()) for _ in BASH_LOGIN_FILES]... | trek10inc/awsume | awsume/configure/main.py | Python | mit | 5,698 |
'''
This script enables Kafka listening
for rPi captured data
@author: devopsec
'''
import subprocess
def kafkaCapture():
#allow traffic on port 6667
subprocess.run("ufw allow 6667", shell=True)
#start kafka producer
subprocess.run("pycapa --producer --kafka node1:6667 --topic pcap -i eno1",... | flyballlabs/threatdetectionservice | agents/host/EnableKafkaCapture.py | Python | apache-2.0 | 353 |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | sadanandb/pmt | src/pyasm/search/upgrade/project/prod_upgrade.py | Python | epl-1.0 | 27,273 |
from baseneuron import BaseNeuron
import numpy as np
import pycuda.gpuarray as garray
from pycuda.tools import dtype_to_ctype
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
cuda_src = """
// %(type)s and %(nneu)d must be replaced using Python string foramtting
#define NNEU %(nneu)d
__global__ ... | cerrno/neurokernel | neurokernel/LPU/neurons/LeakyIAF_bias.py | Python | bsd-3-clause | 11,076 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db.models import Q, QuerySet
from django.http import HttpRequest
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from djangorestframework_camel_case.render import CamelCaseJSONR... | astrobin/astrobin | astrobin/api2/views/gear_migration_strategy_view_set.py | Python | agpl-3.0 | 7,751 |
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from __future__ import absolute_import
import argparse
import logging
import os
import sys
import alot
from alot.settings import sett... | fnurl/alot | alot/__main__.py | Python | gpl-3.0 | 5,368 |
# Chris Bugg
# 10/1/14
# NOTE: Runs on Python 2.7.6
# UPDATE:
# 10/10/14
# -> Now runs with 8 sub-processes using
# the [a-z,A-Z,0-9] alphabet
#
# 10/12/2014 UPDATE: Ubuntu 14.04, OS X, and Windows 7 have commited to this project by Chris H
# Ubuntu GUI ran 1.71 million hashe... | COCS4950G7/COSC4950 | Source/demoCrack3.py | Python | gpl-3.0 | 6,305 |
"""Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
# Brython: asyncio is not available
# import asyncio.events
import collections.abc
import contextlib
import errno
import faulthandler
import fnmatch
impo... | kikocorreoso/brython | www/src/Lib/test/support/__init__.py | Python | bsd-3-clause | 115,373 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
import erpnext
test_dependencies = ["Employee", "Leave Type", "Leave Policy"]
class TestLeavePeriod(unittest.TestCase):
pass
def create_leave_period(from_date, to_date, company=None):
leave_perio... | mhbu50/erpnext | erpnext/hr/doctype/leave_period/test_leave_period.py | Python | gpl-3.0 | 775 |
import numpy as np
from menpo.base import Copyable
class LinearModel(Copyable):
r"""
A Linear Model contains a matrix of vector components, each component
vector being made up of `features`.
Parameters
----------
components : ``(n_components, n_features)`` `ndarray`
The components arr... | mozata/menpo | menpo/model/linear.py | Python | bsd-3-clause | 11,640 |
import RPi.GPIO as GPIO
import time
#Intialization
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#Intialize Push Button
GPIO.setup(18, GPIO.IN,pull_up_down=GPIO.PUD_UP)
#Intialize LED
GPIO.setup(17, GPIO.OUT)
# When Button is PRESSED
def buttonPressed():
GPIO.output(17,GPIO.HIGH)
return
# When Button is... | greenSyntax/AWS-RaspberryPi | RaspberyPi AWS/push.py | Python | mit | 565 |
import os
import glob
all_in_ones = glob.glob("*.all_in_one")
for all_in_one in all_in_ones:
gene_call = open(os.path.join(all_in_one, all_in_one.split(".")[0] + ".fasta"), "r").readline()
gene_call = gene_call.strip().replace(">","")
os.rename(all_in_one, gene_call + ".all_in_one")
| merenlab/web | data/sar11-saavs/files/rename_all_in_ones.py | Python | mit | 298 |
#!/bin/env python2.7
import sys
import os
import argparse
from collections import defaultdict
import re
def main():
args=processArgs()
assemblyValues = {}
with open(args.seqfile,'r') as fh :
priorcomp = ""
priorsub = ""
priorseq = ""
for line in fh :
line =... | sanjuroj/bioscripts | characterizeTrinity.py | Python | mit | 3,442 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
from urlparse import parse_qs
from django.test import override_settings
from django.test.client import Requ... | schalkneethling/bedrock | bedrock/firefox/tests/test_views.py | Python | mpl-2.0 | 40,623 |
#
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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
... | agriggio/pysmt | pysmt/solvers/z3.py | Python | apache-2.0 | 40,131 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-28 08:09
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('news', '0002_auto_20170728_1008'),
]
operations = [
migrations.RenameField(
... | DarkArtek/FFXIVITAFC | news/migrations/0003_auto_20170728_1009.py | Python | unlicense | 431 |
from unittest import TestCase
from scrapy.http import Response, Request
from scrapy.spider import Spider
from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware
from scrapy.utils.test import get_crawler
class TestOffsiteMiddleware(TestCase):
def setUp(self):
self.spider = self._get_spider(... | joshlk/scrapy | scrapy/tests/test_spidermiddleware_offsite.py | Python | bsd-3-clause | 1,982 |
# Author: Tyler Fenby <tylerfenby@gmail.com>
# URL: https://sickrage.tv
# Git: https://github.com/SiCKRAGETV/SickRage.git
#
# 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 Free Software Fou... | xNovax/SickRage | sickbeard/failed_history.py | Python | gpl-3.0 | 8,655 |
from xbeecoord import getRssi
from time import sleep
while True:
getRssi()
sleep(2)
| updewsprado/updews-datalogger | rpi/LUNAS/rssi.py | Python | unlicense | 87 |
"""
This module is responsible for shimming out the auto generated libraries found
under library.py. The intension for the extension classes is to fix up or
improve on the default COM API behaviour and auto generated Python library
file when interacting through an Interface to the Main library API.
"""
from __fut... | mjdorma/pyvbox | virtualbox/library_ext/__init__.py | Python | apache-2.0 | 1,345 |
#!/usr/bin/python
#This is the old version of Tactix befor I decided to make the C version.
#I hope you all like it.
#I wanted to include it to make sure even if you only have a monochrome display you can still play!
# * HORRAY FOR GAMERS!
#I may very well have modded this a bit too, just so it feels more like the fu... | M3TIOR/Tactix | Tactix.py | Python | mit | 2,700 |
#!/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.
"""code generator for GLES2 command buffers."""
import filecmp
import os
import os.path
import sys
from optparse import OptionParse... | chromium/chromium | gpu/command_buffer/build_gles2_cmd_buffer.py | Python | bsd-3-clause | 116,487 |
from __future__ import print_function
import os.path
from binding import LLVM_VERSION
above_33 = ("MC")
last_mtime = 0
def _init(root=__name__, file=__file__):
"""
This is reimported in everything subpackages and must be run in the
__init__.py of them.
"""
global last_mtime
base = os.path.di... | llvmpy/llvmpy | llvmpy/src/__init__.py | Python | bsd-3-clause | 1,204 |
# Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such ... | prefetchnta/questlab | bin/x64bin/python/36/Lib/email/feedparser.py | Python | lgpl-2.1 | 23,311 |
"""Various support methods for stresses"""
import numpy as np
import functools
import time
class Timer(object):
"""Simple timer used to measure real and cpu time of stresses."""
def __init__(self):
self.spent = "undefined", "undefined"
def start(self):
self.start_time = np.array([time.... | strohel/PyBayes | pybayes/stresses/support.py | Python | gpl-2.0 | 839 |
import os
import abc
import numpy as np
__all__ = ['BaseLowLevelWCS', 'validate_physical_types']
class BaseLowLevelWCS(metaclass=abc.ABCMeta):
"""
Abstract base class for the low-level WCS interface.
This is described in `APE 14: A shared Python interface for World Coordinate
Systems <https://doi.o... | stargaser/astropy | astropy/wcs/wcsapi/low_level_api.py | Python | bsd-3-clause | 14,978 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2018-2021 Blaise Frederick
#
# 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... | bbfrederick/rapidtide | rapidtide/workflows/parser_funcs.py | Python | apache-2.0 | 21,939 |
from __future__ import absolute_import
from .. import log; log = log[__name__]
from .file import (
DoesNotExist, Key, Directory, File,
MemFile, TemporaryFile, root_open)
__all__ = [
'DoesNotExist',
'Key',
'Directory',
'File',
'MemFile',
'TemporaryFile',
'root_open',
]
| ndawe/rootpy | rootpy/io/__init__.py | Python | bsd-3-clause | 307 |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | akash1808/nova_test_latest | nova/tests/unit/virt/vmwareapi/test_volumeops.py | Python | apache-2.0 | 15,579 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from builtins import str
from builtins import range
from past.utils import old_div
from boututils import shell, launch, plotdata
from boutdata import collect
import numpy as np
from sys import argv
from math import sqrt, log, p... | kevinpetersavage/BOUT-dev | examples/non-local_1d/analyseboundary-Ts.py | Python | gpl-3.0 | 1,736 |
'''
A bunch of support functions used for GD optimisation. They depend on the
parallel implementation framework, but may change for other optimisers.
'''
import glob
import numpy
from os.path import splitext
from local_MapReduce import load, save
'''
Initialisation for local statistics
'''
def embeddings_set_grads(fo... | TianpeiLuke/GParML | gd_local_MapReduce.py | Python | bsd-3-clause | 3,855 |
#
# 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
# ... | paninetworks/neutron | neutron/tests/unit/agent/linux/test_ipset_manager.py | Python | apache-2.0 | 6,084 |
#!/usr/local/bin python
#-*-*- encoding: utf-8 -*-*-
import json
import random
import datetime
from flask import Flask, request, url_for, redirect
app = Flask(__name__)
###############################
#
# Store in DATA dictionaries
# representing users.
#
DATA = {
}
##################################
#
# Store... | zstars/weblabdeusto | experiments/unmanaged/http/python/flask/sample.py | Python | bsd-2-clause | 4,706 |
"""Tests for the Bond integration."""
| jawilson/home-assistant | tests/components/bond/__init__.py | Python | apache-2.0 | 38 |
import FWCore.ParameterSet.Config as cms
#---------------------------------------------------------------------------------------------------
# M A I N
#---------------------------------------------------------------------------------------------------
# create the process
pro... | cpausmit/Kraken | filefi/043/mc.py | Python | mit | 9,190 |
from django import template
from dojango.conf import settings # using the app-specific settings
from dojango.util import json_encode as util_json_encode
from dojango.util.config import Config
register = template.Library()
class DojangoParamsNode(template.Node):
'''We set the DOJANGO context with this node!'''
... | ricard33/dojango | dojango/templatetags/dojango_base.py | Python | bsd-3-clause | 1,688 |
# 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, ... | mlperf/training_results_v0.5 | v0.5.0/intel/intel_minigo_submission_public_tensorflow/code/minigo/tensorflow/minigo/oneoffs/inspect_game.py | Python | apache-2.0 | 1,967 |
from __future__ import unicode_literals
import json
import logging
import requests
from requests.exceptions import HTTPError
from requests_hawk import HawkAuth
# When releasing a new version to PyPI please also file a bug to request
# that it is uploaded to http://pypi.pub.build.mozilla.org/pub/ too.
# See bug 11914... | gbrmachado/treeherder | treeherder/client/thclient/client.py | Python | mpl-2.0 | 31,703 |
"""
Test some SBModule and SBSection APIs.
"""
import os, time
import re
import unittest2
import lldb
from lldbtest import *
from lldbutil import symbol_type_to_str
class ModuleAndSectionAPIsTestCase(TestBase):
mydir = os.path.join("python_api", "module_section")
@python_api_test
def test_module_and_sec... | s20121035/rk3288_android5.1_repo | external/lldb/test/python_api/module_section/TestModuleAndSection.py | Python | gpl-3.0 | 4,688 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | javrasya/luigi | luigi/__init__.py | Python | apache-2.0 | 2,212 |
# 恒投交易客户端 文件接口
# 1. 支持csv/dbf文件的读写
# 2. 采用tdx作为行情数据源
# 华富资产 李来佳 28888502
import os
import sys
import copy
import csv
import dbf
import traceback
import pandas as pd
from typing import Any, Dict, List
from datetime import datetime, timedelta
from time import sleep
from functools import lru_cache
from collections import... | msincenselee/vnpy | vnpy/gateway/pb/pb_gateway.py | Python | mit | 112,435 |
"""
Copyright 2018-present Engie SA.
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, softwa... | epierce/gimme-aws-creds | gimme_aws_creds/aws.py | Python | apache-2.0 | 4,984 |
# vim:set fileencoding=utf-8
import unittest
from unittest.mock import patch, sentinel, DEFAULT
from blivet.actionlist import ActionList
from blivet.deviceaction import ActionDestroyFormat
from blivet.devices import DiskDevice
from blivet.devices import DiskFile
from blivet.devices import LVMLogicalVolumeDevice
from ... | rhinstaller/blivet | tests/unsupported_disklabel_test.py | Python | lgpl-2.1 | 7,672 |
# Copyright 2013 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... | miyakz1192/neutron | neutron/tests/api/test_extra_dhcp_options.py | Python | apache-2.0 | 4,030 |
# coding=utf-8
# Copyright 2019-present CNRS, Facebook Inc. and the HuggingFace Inc. team.
#
# 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
#... | huggingface/transformers | src/transformers/models/flaubert/configuration_flaubert.py | Python | apache-2.0 | 8,543 |
#!/usr/bin/env python
"""
Demonstrate use of pysnmp walks
"""
import sys
import re
from pysnmp.entity.rfc3413.oneliner import cmdgen
cmdGen = cmdgen.CommandGenerator()
devip = sys.argv.pop(1)
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd(
cmdgen.CommunityData('server', 'galileo', 1),
... | patrebert/pynet_cert | class2/walk2.py | Python | apache-2.0 | 1,368 |
"""0MQ Error classes and functions."""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distribut... | ellisonbg/pyzmq | zmq/error.py | Python | lgpl-3.0 | 4,885 |
#!/usr/bin/env python
from siconos.tests_setup import working_dir
import os
def test_bouncing_ball1():
from siconos.kernel import LagrangianLinearTIDS, NewtonImpactNSL, \
LagrangianLinearTIR, Interaction, Model, MoreauJeanOSI, TimeDiscretisation, LCP, TimeStepping
from numpy import array, eye, empty
... | siconos/siconos-deb | kernel/swig/tests/test_bouncing_ball.py | Python | apache-2.0 | 7,255 |
from config import *
import scripts.butil
def run_TLD(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
m.workspace['subS'] = se... | stevenwudi/Kernelized_Correlation_Filter | scripts/bscripts/run_TLD.py | Python | gpl-3.0 | 595 |
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
try:
import simplejson as json
except ImportError:
import json
import geojson
GEO_INTERFACE_MARKER = "__geo_interface__"
def is_mapping(obj):
"""
Checks if the object is an instance o... | flavour/eden | modules/geojson/mapping.py | Python | mit | 812 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hook', '0003_add_subset_fields_to_hook_model'),
]
operations = [
migrations.AddField(
model_name='hook',
name='payload_template',
... | kobotoolbox/kpi | kobo/apps/hook/migrations/0004_add_payload_template.py | Python | agpl-3.0 | 385 |
for i in range(1, 3):
# print(i) # error, need at least one space
print(i)
print('the same block')
print('completed') | matiishyn/py-learning | 2-program-flow-control/1-intro.py | Python | mit | 125 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2009-2010 Craig J. Anderson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | arunkgupta/gramps | gramps/plugins/drawreport/descendtree.py | Python | gpl-2.0 | 66,162 |
from __future__ import absolute_import
import logging
import io
import os
import os.path
import shutil
import tempfile
import urllib
import zipfile
import csv
from datetime import datetime
from org.bccvl import movelib
from org.bccvl.movelib.utils import build_source, build_destination
from org.bccvl.movelib.utils imp... | BCCVL/org.bccvl.tasks | src/org/bccvl/tasks/datamover/zoatrack.py | Python | gpl-2.0 | 8,153 |
import os
import django
# placeholder for gettext
def _(s):
return s
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'j#zwt2c!*(7(jz!m(tr$+jq^1d(+)e(^059f^nd_(*zj!gv0x)'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = (
'modeltranslation',
'suit',
'... | mtrgroup/django-mtr-sync | tests/app/settings.py | Python | mit | 3,396 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.