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 |
|---|---|---|---|---|---|
""" Functions to solve for antenna/station gain
"""
from processing_components.calibration.calibration import solve_gaintable | SKA-ScienceDataProcessor/algorithm-reference-library | wrappers/serial/calibration/calibration.py | Python | apache-2.0 | 127 |
# -*- coding: utf-8 -*-
import KBEngine
import KBExtend
from KBEDebug import *
from interfaces.GameObject import GameObject
class NPC(GameObject):
def __init__(self):
GameObject.__init__(self)
| harmy/kbengine | demo/res/scripts/client/NPC.py | Python | lgpl-3.0 | 206 |
# Copyright 2012 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... | sebrandon1/tempest | tempest/api/image/v1/test_images.py | Python | apache-2.0 | 15,031 |
"""
Configuration of unit tests here.
"""
from __future__ import print_function
def setup_module():
""" Setup
"""
print(__name__, ': setup_conf_test() ***')
def teardown_module():
""" Teardown
"""
print(__name__, ': teardown_conf_test() ***')
import os
import sys
root = os.path.join(os.path.... | BartGo/bottle-stack | tests/conf_test.py | Python | mit | 510 |
import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name': 'BACK-REF TRAN ID', 'number': '3'},
... | h4ck3rm1k3/FEC-Field-Documentation | fec/version/v5_1/SH3.py | Python | unlicense | 805 |
#
# 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... | tgroh/incubator-beam | sdks/python/setup.py | Python | apache-2.0 | 6,961 |
# -*- coding: utf-8 -*-
from antidox import perspective
import unittest
import sys
if sys.version_info >= (3, 3):
from unittest import mock
else:
import mock
class TestPerspective(unittest.TestCase):
def test_contains_pii_true(self):
dlp_response = \
{
"result": {
"findings": [
{
... | conversationai/wikidetox | antidox/perspective_test.py | Python | apache-2.0 | 9,456 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#########################################################################
# Author: jonyqin
# Created Time: Thu 11 Sep 2014 03:55:41 PM CST
# File Name: demo.py
# Description: WXBizMsgCrypt 使用demo文件
#########################################################################
f... | sharkspeed/dororis | platforms/weixin/miniapp/miniapp_0_selfhost_server/wxserver-backup/Sample_v3.py | Python | bsd-2-clause | 2,417 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
# 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 Founda... | ludmilamarian/invenio | invenio/modules/access/admin_lib.py | Python | gpl-2.0 | 154,307 |
# Copyright 2019 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | cirq-core/cirq/protocols/measurement_key_protocol.py | Python | apache-2.0 | 13,195 |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
default_app_config = 'pdc.apps.repository.apps.RepositoryConfig'
| tzhaoredhat/automation | pdc/apps/repository/__init__.py | Python | mit | 174 |
from graphene_sqlalchemy import SQLAlchemyObjectType
from graphene import relay
from .model import Audit
class AuditSchema(SQLAlchemyObjectType):
class Meta:
model = Audit
interfaces = (relay.Node, )
| maschinendeck/frauk | backend/audit/schema.py | Python | mit | 221 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 23:05:26 2015
@author: Wasit
"""
import random
y=-1
x=random.randint(0,32)
while x!=y:
y=int(raw_input("guess a number:"))
if y<x:
print y," is LESS than the corrected number"
if x<y:
print y," is LARGER than the corrected number"
print y,... | wasit7/tutorials | iddcdt_day2/01guess.py | Python | mit | 334 |
# Copyright (c) 2010-2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 ... | vineodd/PIMSim | GEM5Simulation/gem5/configs/example/ruby_gpu_random_test.py | Python | gpl-3.0 | 6,436 |
# Copyright 2019 The Sonnet 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 applicable l... | deepmind/sonnet | sonnet/src/conv_transpose.py | Python | apache-2.0 | 16,137 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def printHelloWorld():
print 'Hello World' | pdehaye/edx-presenter | presentations/skeleton/src/hello.py | Python | agpl-3.0 | 92 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('master', '0028_localesnulos'),
('imports', '0006_ventacompleta'),
]
operations = [
migrations.AddField(
... | Teino1978-Corp/Teino1978-Corp-light_.gitignore | light_imports_migrations_0007_ventacompleta_periodo.py | Python | mit | 499 |
import sys
import signal
import serial
import threading
import time
import RPi.GPIO as GPIO
import Adafruit_CharLCD as LCD
from screens import SCREENS
class Ammonia(object):
"""Class to interact with EC, ORP, and TEMP probes and an HD44780 character LCD display."""
# debounce time
DEBOUNCE = 0.1
# c... | potomak/ammonia-rpi | ammonia.py | Python | mit | 5,697 |
# pylint: disable=C0301
import decimal
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import timezone
from django.contrib.auth import authenticate, login, logout
from mock import Mock
from ..middleware import ActiveSubscriptionMiddlew... | wahuneke/django-stripe-payments | payments/tests/test_middleware.py | Python | bsd-3-clause | 3,692 |
import os
import re
import shutil
import subprocess
import sys
import unittest
from types import SimpleNamespace as Empty
import flextGLgen
# https://stackoverflow.com/a/12867228
_camelcase_to_snakecase = re.compile('((?<=[a-z0-9])[A-Z]|(?!^)[A-Z](?=[a-z]))')
# The test files are automatically detected from derived... | mosra/flextgl | test/test_generate.py | Python | mit | 7,126 |
# coding=utf-8
from threading import Lock
import time
class Resource:
def __init__(self, name = ""):
self.lock = Lock()
self.name = name
self.owner = None
def __str__(self):
return self.name + ((" (currently owned by <%s>)" % self.owner) if self.owner else " (not currently owne... | chili-epfl/pyrobots | src/robots/resources/resources.py | Python | isc | 2,851 |
from credentials_hana import db_HOST, db_PORT, db_USER, db_PASSWORD
import pyhdb
class DatabaseConnection:
def __init__(self, queryName):
self.path = queryName
self._connector = None
def __str__(self):
return str(self.path)
def __eq__(self, name):
if type(name) == str:
return self.__str__ == name
els... | mockingbird2/EPIC-ness | flask_app/database_connection.py | Python | mit | 627 |
# Copyright (C) 2011 Aaron Lindsay <aaron@aclindsay.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 License, or
# (at your option) any later version... | aclindsa/asink-python | src/server/database.py | Python | gpl-2.0 | 2,596 |
'''
:module: requests (pyCurl based Requests)
a lightweight small footprint interface to pyCurl provides the base for twtCurl
.. Warning:: although classes defined here can possibly be used for generic http(s)
requests those have only been tested for requests
to twitter REST and streaming API
'''
import simplej... | nickmilon/twtPyCurl | twtPyCurl/py/requests.py | Python | lgpl-3.0 | 29,234 |
from __future__ import print_function
import os
import sys
from argparse import ArgumentParser, SUPPRESS
from genomic_neuralnet.config import data
from subprocess import call
_parser = ArgumentParser()
_parser.add_argument('-s', '--species', default='arabidopsis', choices=data.keys(), help='Species')
_parser.add_arg... | rileymcdowell/genomic-neuralnet | genomic_neuralnet/util/param_parser.py | Python | mit | 6,606 |
def propertycached(fn):
attr_name = "_cached_" + fn.__name__
@property
def _propertycached(self):
if not hasattr(self, attr_name):
setattr(self, attr_name, fn(self))
return getattr(self, attr_name)
return _propertycached
| koyadovic/Dia | predictive/systems/statistical/analysis/tools/property.py | Python | gpl-2.0 | 271 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pontocerto.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| willemarcel/pontocerto | pontocerto/manage.py | Python | agpl-3.0 | 259 |
# 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.
import collections
import logging
import numbers
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from dashboard.pinpoint im... | sahiljain/catapult | dashboard/dashboard/pinpoint/models/job.py | Python | bsd-3-clause | 9,842 |
from numba import cuda, int32, float64, void
from numba.core.errors import TypingError
from numba.cuda.testing import unittest, CUDATestCase, skip_on_cudasim
import numpy as np
from numba.np import numpy_support as nps
from .extensions_usecases import test_struct_model_type, TestStruct
recordwith2darray = np.dtype(... | IntelLabs/numba | numba/cuda/tests/cudapy/test_sm.py | Python | bsd-2-clause | 14,079 |
"""Implementation of the Range type and adaptation
"""
# psycopg/_range.py - Implementation of the Range type and adaptation
#
# Copyright (C) 2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public ... | nwokeo/supysonic | venv/lib/python2.7/site-packages/psycopg2/_range.py | Python | agpl-3.0 | 17,270 |
n = int(input())
count = 0
while count < 6:
if n%2 != 0:
print(n)
count += 1
n += 1 | henrywm/URI | src/beginner/1070.py | Python | apache-2.0 | 89 |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | tensorflow/agents | tf_agents/bandits/agents/examples/v2/train_eval_structured_linear.py | Python | apache-2.0 | 4,783 |
#!/usr/bin/env python3
## Copyright (C) 2009 David Baddeley <d.baddeley@auckland.ac.nz>
## Copyright (C) 2020 Mick Phillips <mick.phillips@gmail.com>
##
## This file is part of Microscope.
##
## Microscope is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License a... | carandraug/microscope | microscope/cameras/pvcam.py | Python | gpl-3.0 | 59,214 |
import time
from flask import request
from mock import patch
from tests import BaseTestCase
from redash import models, settings
from redash.authentication import (api_key_load_user_from_request,
get_login_url, hmac_load_user_from_request,
sign)
fro... | EverlyWell/redash | tests/test_authentication.py | Python | bsd-2-clause | 8,273 |
from io import BytesIO
import logging
logger = logging.getLogger(__name__)
class CorruptDataError(Exception):
pass
class LZWDecoder:
def __init__(self, fp):
self.fp = fp
self.buff = 0
self.bpos = 8
self.nbits = 9
self.table = None
self.prevbuf = None
... | goulu/pdfminer | pdfminer/lzw.py | Python | mit | 2,810 |
#!/usr/bin/python3
import cherrypy, json, csv, re, time, datetime, uuid, os, sys,string, subprocess, arrow
import logging
from collections import OrderedDict
from database import *
# TODO: Remove this from model & keep in view..
from jinja2 import Environment, PackageLoader
# TODO: Security check fid variable
# TODO: ... | citizensense/pasture | model.py | Python | gpl-2.0 | 43,115 |
#!/usr/bin/env python
from setuptools import setup, os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='PyBabel-hbs',
version='0.4.0',
description='PyBabel handlebars gettext strings extractor',
author='Anton Bykov aka Tigra San',
author_email=... | sbrieuc/pybabel-hbs | setup.py | Python | mit | 674 |
"""
ORCA grid specific methods
"""
from collections import defaultdict
import numpy as np
def north_fold(longitudes, latitudes):
"""Northern hemisphere tri-polar fold
:param longitudes: 1D array representing longitudes on north fold
:param latitudes: 1D array representing latitudes on north fold
:ret... | met-office-ocean/obsoper | obsoper/orca.py | Python | bsd-3-clause | 1,075 |
''' Golix: A python library for Golix object manipulation.
Golix: a python library for Golix object manipulation. Create and
read encrypted Golix file objects.
Notes to self
-----
BUILD WITH:
python setup.py sdist
python setup.py bdist_wheel
DISTRIBUTE WITH:
twine upload dist/<version>*
'''
import sys
# Always pre... | Muterra/py_muse | setup.py | Python | lgpl-2.1 | 3,836 |
from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... | aaronmyatt/mv_shorl | tests/engine.py | Python | bsd-3-clause | 5,403 |
#Copyright 2018 Tim Wentlau.
#Distributed under the MIT License. See LICENSE in root of project.
import os
from kervi.hal.one_wire import OneWire
BASE_DIR = '/sys/bus/w1/devices/'
class OneWireDeviceDriver(OneWire):
def __init__(self, address):
OneWire.__init__(self, address)
os.system('modprobe ... | kervi/kervi | ukervi/ukervi/platforms/upython/one_wire.py | Python | mit | 534 |
# coding: UTF-8
"""
Copyright (c) 2009 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions a... | sushi-irc/tekka | tekka/dialogs/dcc.py | Python | bsd-2-clause | 5,531 |
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U.
# © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
"""These tests try to mimic the behavior of the UI form.
The form operates in onchange mode, with its limitations.
"""
fr... | sergiocorato/partner-contact | partner_second_lastname/tests/test_onchange.py | Python | agpl-3.0 | 7,604 |
import numpy as np
from scipy.io.wavfile import read,write
def speedup(soundarray, factor):
indices = np.round(np.arange(0,len(soundarray),factor))
indices = indices[indices < len(soundarray)].astype(int)
return soundarray[indices.astype(int)]
def stretch(soundarray, factor, window_size, h):
phase = ... | robertsiegel/AudioFFT | shiftpitch.py | Python | mit | 1,248 |
'''
for use to generate flatland_simulator_api documentation with doxygen
'''
# -*- coding: utf-8 -*-
#
# Flatland documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 15 13:55:12 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not a... | avidbots/flatland | docs/doxygen/conf.py | Python | bsd-3-clause | 5,327 |
#!/usr/bin/python2.7
import re, ast, random, argparse, os
from time import time, strftime, sleep
from datetime import datetime
from cStringIO import StringIO
from Queue import Queue
from threading import Thread
try:
import simplejson as json
except:
import json
#local libraries
from lib.helper import sqlQuery, thisSy... | jontaimanglo/pyrcron | pyrcron.py | Python | gpl-2.0 | 35,301 |
# Django settings for pyjsDemo project.
import os
STATIC = str(os.path.join(os.path.dirname(__file__), 'media').replace('\\','/'))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql... | Hasimir/pyjs | examples/misc/djangotasks/settings.py | Python | apache-2.0 | 2,910 |
TEMPLATE_DIR = '/Users/marcoslh/Documents/waku/templates'
STATIC_URL = ''
| marcoslhc/waku | settings.py | Python | mit | 74 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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) a... | egabancho/invenio | invenio/modules/oauth2server/views/server.py | Python | gpl-2.0 | 6,368 |
# -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
from json import (
dump as default_dump,
dumps as default_dumps,
load,
loads,
JSONDecoder,
JSONEncoder as DefaultJSONEncoder,
)
__all__ = ('dump', 'dumps', 'load', 'loads', 'JSONDec... | samuelmaudo/yepes | yepes/utils/json.py | Python | bsd-3-clause | 1,864 |
# -*- coding: utf-8 -*-
"""Tests for course home page date summary blocks."""
from datetime import datetime, timedelta
import ddt
import waffle
from django.contrib.messages.middleware import MessageMiddleware
from django.urls import reverse
from django.test import RequestFactory
from freezegun import freeze_time
from ... | Stanford-Online/edx-platform | lms/djangoapps/courseware/tests/test_date_summary.py | Python | agpl-3.0 | 39,275 |
import grpc
import json
class ConfigException(RuntimeError):
pass
class RpcException(Exception):
code = None
details = None
def __init__(self, message=None, *args, **kwargs):
if isinstance(message, (list, dict)):
message = json.dumps(
message, default=str, ensur... | yandy/sea | sea/exceptions.py | Python | mit | 754 |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 29 10:34:00 2012
Author: Josef Perktold
"""
from statsmodels.compat import lrange
from itertools import combinations, zip_longest
from numpy.testing import assert_
def test_zip_longest():
lili = [
["a0", "b0", "c0", "d0"],
["a1", "b1", "c1"],
... | bashtage/statsmodels | statsmodels/compat/tests/test_itercompat.py | Python | bsd-3-clause | 1,185 |
# -*- coding: utf-8 -*-
import MySQLdb
import functools
import time
import datetime
import urllib
import urllib2
import Logger
class DataAccess:
###################
@staticmethod
def GetDb():
conn = None
conn = MySQLdb.connect(host="irweb", port=3306,user="root", passwd="root",db="mydb",charset=... | zhaochl/python-utils | python_jobs_tpl/data_util_demo.py | Python | apache-2.0 | 4,507 |
from functools import wraps
import time
import traceback
import inspect
import threading
import types
class LoggerException(Exception):
pass
class ReturnTypeMismatchError(Exception):
pass
def _raiseReturnTypeMismatchError(expctedType, actualType):
raise ReturnTypeMismatchError(
"Type mismatch:... | lbusoni/pi_gcs | pi_gcs/decorator.py | Python | mit | 4,972 |
# Copyright (c) 2013 Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | scroiset/climate-nova | climate/tests/test_climate_scheduler.py | Python | apache-2.0 | 1,034 |
"""
Imports Cell datastructures for merging and dealing with partial information.
"""
__version__ = "0.1"
from cell import Cell
from bools import *
from numeric import *
from sets import *
from lists import *
from strings import *
from posets import *
from dicts import *
# special cells
from colors import *
from spa... | EventTeam/beliefs | src/beliefs/cells/__init__.py | Python | gpl-2.0 | 1,491 |
# -*- coding: utf-8 -*-
import errno
import logging
import os
from atomicwrites import atomic_write
from .base import normalize_meta_value
from ._rust import RustStorage
from .. import native
from ..utils import checkdir, expand_path
logger = logging.getLogger(__name__)
class FilesystemStorage(RustStorage):
... | untitaker/vdirsyncer | vdirsyncer/storage/filesystem.py | Python | mit | 1,959 |
import string
import httplib, sys
import myparser
import re
import time
class search_google_labs:
def __init__(self,list):
self.results=""
self.totalresults=""
self.server="labs.google.com"
self.hostname="labs.google.com"
self.userAgent="(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/201001... | WesternCyber/Hacking-Tools | the-harvester/theHarvester/discovery/googlesets.py | Python | gpl-3.0 | 956 |
from multiprocessing import Pool
import os, time, random
def long_time_task(name):
print 'Run task %s (%s)...' % (name, os.getpid())
start = time.time()
time.sleep(random.random() * 3)
end = time.time()
print 'Task %s runs %0.2f seconds.' % (name, (end - start))
if __name__ == '__main__':
p... | Jayin/practice_on_py | Process&Thread/PoolTest.py | Python | mit | 1,094 |
from .tree import *
from .node import *
from . import query
| mbodenhamer/syn | syn/tree/b/__init__.py | Python | mit | 60 |
__author__ = 'ehonlia'
from rdflib import Namespace
SSN = Namespace('http://purl.oclc.org/NET/ssnx/ssn#')
DUL = Namespace('http://www.loa-cnr.it/ontologies/DUL.owl#')
GEO = Namespace('http://www.w3.org/2003/01/geo/wgs84_pos#')
SAO = Namespace('http://purl.oclc.org/NET/sao/')
CT = Namespace('http://www.insight-centre... | EricssonResearch/iot-framework-engine | semantic-adapter/lib/constants.py | Python | apache-2.0 | 542 |
"""
test_case_3_simple_mk_msh.py is a simulation example for EMUstack.
Copyright (C) 2015 Bjorn Sturmberg, Kokou Dossou, Felix Lawrence
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 Found... | gevero/EMUstack | tests/test_case_3_simple_mk_msh.py | Python | gpl-3.0 | 4,511 |
from . import purchase_order
from . import res_partner
| OCA/purchase-workflow | purchase_partner_incoterm/models/__init__.py | Python | agpl-3.0 | 55 |
# Copyright (c) 2013 Rackspace Hosting
# 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 req... | frossigneux/blazar | climate/openstack/common/db/api.py | Python | apache-2.0 | 5,989 |
""" Provides Access to the GitHub API """
from __future__ import absolute_import
from __future__ import print_function, unicode_literals
from datetime import datetime, timedelta, time
import logging
import os
import socket
import backoff
from github import Github
from github.PullRequest import PullRequest
from github... | eltoncarr/tubular | tubular/github_api.py | Python | agpl-3.0 | 31,256 |
#!python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#... | dostavro/dotfiles | sublime2/Packages/SublimeCodeIntel/libs/codeintel2/database/projlib.py | Python | mit | 8,984 |
def classify(text):
return True
| checkr/fdep | tests/fixtures/serve/app.py | Python | mit | 36 |
#!/usr/bin/python
import sys
li = open(sys.argv[2],'r')
dictionary = {}
for line in li:
splt = line.strip().split('.')
dictionary[splt[0]]= splt[0]
li.close()
com = open(sys.argv[1],'r')
for line in com:
if (dictionary.has_key(line.strip())):
print line.strip() +" yes"
else :
print l... | germs-lab/RefSoil | not_contains.py | Python | gpl-2.0 | 332 |
'''
test iam2 volume operations by platform admin/operator/member
# 1 create project
# 2 create virtual id (project admin/operator/member)
# 3 operations on volume with virtual id
# 4 delete
@author: quarkonics
'''
import os
import time
import zstackwoodpecker.test_util as test_util
import apibinding.inventory as inv... | zstackio/zstack-woodpecker | integrationtest/vm/simulator/iam2/test_iam2_project_basic_ops_volume.py | Python | apache-2.0 | 9,214 |
#!usr/bin/python
# -*- coding: utf-8 -*-
from datetime import datetime
import json
from utils import log
class MessageParser():
"""
Parse json and create Message object with the parse-method.
"""
@staticmethod
def parse(json_string):
dictionary = json.loads(json_string)
type = dic... | knutgoetz/evka01 | gatttool_scripts/parser.py | Python | mit | 1,291 |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | adrianschroeter/kiwi | kiwi/repository/template/apt.py | Python | gpl-3.0 | 2,728 |
# -*- coding: utf-8 -*-
import httplib as http
from flask import request
from modularodm.exceptions import ValidationError, ValidationValueError
from framework import forms, status
from framework.auth import cas
from framework.auth import User
from framework.auth.core import get_user, generate_verification_key
from ... | hmoco/osf.io | website/project/views/contributor.py | Python | apache-2.0 | 32,645 |
# 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/.
from __future__ import absolute_import, unicode_literals
import cPickle as pickle
import os
import sys
import mozpack.... | Yukarumya/Yukarum-Redfoxes | python/mozbuild/mozbuild/testing.py | Python | mpl-2.0 | 23,808 |
#!/usr/bin/env python
from flask import Flask, request
import couchdb, json, datetime
app = Flask(__name__)
''' *** List of accessible api urls ***
***NOTE: until Akash finishes user authentication/security, <string:id> will be the name of the user
1. '/' is a get request that tests accessibility to the flask serv... | ByronBecker/rmp | newUser.py | Python | mit | 8,411 |
from django import forms
from django.utils.translation import ugettext as _
import autocomplete_light
from .models import GardenItem
class AddProduceForm(autocomplete_light.ModelForm):
class Meta:
model = GardenItem
exclude = ['owner',]
class ProduceSearchForm(autocomplete_light.Mode... | jmickela/stalkexchange | produce/forms.py | Python | apache-2.0 | 721 |
#!/usr/bin/python
"""
Solution based on Algorithm L by Donald Knuth,
see The Art of Computer Programming vol. 4
"""
def next(perm):
tmp = list(perm)
k = lastNotLast(tmp)
if not k:
return ''
tmp = increase(k, tmp)
tmp = first(k, tmp)
return tmp
def lastNotLast(perm):
l = len(perm... | cifvts/PyEuler | euler024.py | Python | mit | 1,259 |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multisig RPCs"""
import binascii
import decimal
import itertools
import json
import os
from test_... | rnicoll/dogecoin | test/functional/rpc_createmultisig.py | Python | mit | 9,973 |
from landlab import Component
from ...utils.decorators import use_file_name_or_kwds
import numpy as np
_VALID_METHODS = set(['Grid'])
def _assert_method_is_valid(method):
if method not in _VALID_METHODS:
raise ValueError('%s: Invalid method name' % method)
class Radiation(Component):
"""Compute ... | laijingtao/landlab | landlab/components/radiation/radiation.py | Python | mit | 9,349 |
"""
Data Aggregation Layer of the Enrollment API. Collects all enrollment specific data into a single
source to be used throughout the API.
"""
import logging
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.db import transaction
from opaque_keys.edx.keys im... | EDUlib/edx-platform | openedx/core/djangoapps/enrollments/data.py | Python | agpl-3.0 | 12,273 |
import argparse
import os
from gittalk import GitTalk
from gittalk.utils import which, make_sure_path_exists
def run():
"""
`run` drives the command line interface for Git Talk.
It exposes a command line interface through which users
can interact with Git Talk to configure or invoke various
funct... | sandeepraju/git-talk | cli.py | Python | bsd-3-clause | 1,686 |
import modules.options_helper as opt_helper
from modules.file.file_helper import File
import sys
def main(options):
# available config keys
options_registry = ["path","find","replace_with"]
# verify config option provided match registry
opt_helper.check_options(options, options_re... | dkoudlo/py-manage-server | modules/file/replace.py | Python | apache-2.0 | 1,593 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v1_rule_with_operations.py | Python | apache-2.0 | 9,436 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import SetPasswordForm
urlpatterns = [
url(
r"^login/$",
auth_views.login,
{"template_name": "registration/log... | hzlf/openbroadcast.org | website/tools/registration/auth_urls.py | Python | gpl-3.0 | 1,439 |
# -*- coding: utf-8 -*-
#
# hl_api_simulation.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 Licen... | lekshmideepu/nest-simulator | pynest/nest/lib/hl_api_simulation.py | Python | gpl-2.0 | 15,584 |
# Copyright 2015 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 req... | openstack/glance | glance/tests/unit/v2/test_image_actions_resource.py | Python | apache-2.0 | 6,487 |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import r... | Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api/models/amount.py | Python | mit | 3,493 |
#!/usr/bin/env python
import os
import pprint
import xml.dom.minidom
_MIN_PROJECT_ID = 0
_MAX_PROJECT_ID = 255
_MIN_FEATURE_ID = 0
_MAX_FEATURE_ID = 255
_MIN_CLASS_ID = 0
_MAX_CLASS_ID = 255
_MIN_CMD_ID = 0
_MAX_CMD_ID = 65535
_FTR_GEN = 'generic'
#=================================================================... | 2016-Capstone/PythonController | arsdk-xml/arsdkparser.py | Python | bsd-3-clause | 41,476 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/use_item_move_reroll_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message... | bellowsj/aiopogo | aiopogo/pogoprotos/networking/requests/messages/use_item_move_reroll_message_pb2.py | Python | mit | 3,241 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# ============================================================================
# Project Name : iTrade
# Module Name : itrade_quotes_hong-kong.py
#
# Description: List of quotes from http://www.hkex.com.hk/
# The Original Code is iTrade code (http://itrade.sour... | eternallyBaffled/itrade | ext/itrade_quotes_hong-kong.py | Python | gpl-3.0 | 5,840 |
from suds.client import Client
from suds.xsd.doctor import ImportDoctor, Import
import difflib
class Status(object):
AWAITING_COMPILATION = -1
DONE = 0
COMPILING = 1
RUNNING = 3
class Result(object):
NOT_RUN = 0
COMPILATION_ERROR = 11
RUNTIME_ERROR = 12
TIME_LIMIT_EXCEEDED = 13
SUC... | ronreiter/interactive-tutorials | ideone/__init__.py | Python | apache-2.0 | 10,805 |
"""
Automatically generate marking helpers functions.
"""
import sys
from .objects import Mark
class SimpleHelpers(object):
"""
A class that is designed to act as a module and implement magic helper
generation.
"""
def __init__(self):
self.__helpers = {}
def make_helper(self, color... | freelan-developers/chromalog | chromalog/mark/helpers.py | Python | mit | 5,224 |
#===========================================================================================================================
# aims : This script takes the frame file in input and gives it back adding the context to each frame
#
# input : input_filepath : folder containing subjects' cepstra. It takes the s... | allspeak/api.allspeak.eu | web/project/training_api/libs/context.py | Python | mit | 4,350 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" 工程文件生成
so_ 模块方案
pj_ 模块工程
tp_ 测试工程
"""
import basebuilder
import os
import hashlib as md5
import web.template
render = web.template.render(os.path.join( os.path.split(os.path.realpath(__file__))[0], "template") ,
globals={'type':type,"hasattr":hasattr})
class Msvc20... | LMiceOrg/Modelingtools | autotools/builder/msvc2008solutionbuilder.py | Python | mit | 1,544 |
from __future__ import division
from collections import defaultdict
from operator import itemgetter
from readdata import read_data
import csv
import sys
RN = ['I', 'bII', 'II', 'bIII', 'III', 'IV', 'bV', 'V', 'bVI', 'VI', 'bVII', 'VII', 'NonHarmonic']
for j in range(0,4):
z = ['4','4','4','4']
t = ['1','2','... | corpusmusic/billboardcorpus | 4Bars_PerSong_EachBar.py | Python | gpl-3.0 | 4,066 |
"""Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
import pytest
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import coo_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils._testing import assert_a... | kevin-intel/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | Python | bsd-3-clause | 21,053 |
import os
import hashlib
import random
import warnings
from tempfile import mkdtemp, TemporaryFile
from shutil import rmtree
from twisted.trial import unittest
from scrapy.item import Item, Field
from scrapy.http import Request, Response
from scrapy.settings import Settings
from scrapy.pipelines.images import ImagesP... | wenyu1001/scrapy | tests/test_pipeline_images.py | Python | bsd-3-clause | 18,224 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Satpy developers
#
# This file is part of satpy.
#
# satpy 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 Licens... | pytroll/satpy | satpy/readers/modis_l1b.py | Python | gpl-3.0 | 11,468 |
from __future__ import print_function, division
from functools import reduce
import copy
class Grid:
def __init__( self, width=3, height=3 ):
self.grid = [[0 for _ in range(width)] for _ in range(height)]
@staticmethod
def make_move( row, column, grid, first_player ):
grid = copy.deepcopy(... | shanesatterfield/tic-tac-toe | tic-tac-toe/grid.py | Python | mit | 2,134 |
import time
import numpy as np
from openest.curves import basic, ushape_analytic, ushape_numeric
curve = basic.ZeroInterceptPolynomialCurve([-10, 30], [1, 1, -.03]) # u-shaped to about 22
fillxxs = np.arange(-10, 30)
fillyys = curve(fillxxs)
ucurve_old = ushape_numeric.UShapedCurve(curve, 0, lambda x: x, ordered=Fal... | ClimateImpactLab/open-estimate | openest/test/curves/test_ucurve.py | Python | gpl-3.0 | 2,048 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.