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 -*-
"""
Created on Fri Nov 6 21:06:20 2015
\@author: Carlos Luis Hernandez-Cedillo))
\@email: carlosluis1@gmail.com
"""
""" Control MOT using Stream Mode """
from time import sleep
from datetime import datetime
from lj_functions import *
import pandas as pd
import numpy as np
"""Open the LabJack c... | LAMAC-IFUNAM/lafrioc-electronics-labjack | Control_MOT_STM.py | Python | gpl-3.0 | 6,024 |
# -*- coding: utf-8 -*-
"""
Created on Thu May 18 15:55:54 2017
@author: AmatVictoriaCuramIII
"""
import webbrowser as web
import requests
from io import StringIO
import pandas as pd
import time as t
starttime = t.time()
ticker = "CXW"
artificialcrumb = "1.ZWRp1I9ZS"
downloadurl = ("https://query1.financ... | adamrvfisher/TechnicalAnalysisLibrary | SingleCSVFetchYahoo.py | Python | apache-2.0 | 866 |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | shootstar/novatest | nova/scheduler/filter_scheduler.py | Python | apache-2.0 | 17,706 |
"""
https://leetcode.com/explore/challenge/card/march-leetcoding-challenge-2021/589/week-2-march-8th-march-14th/3666/
"""
from typing import List
from unittest import TestCase
from kevin.leet.add_one_row import Solution
from kevin.utils.bst import BST, TreeNode
class TestAddOneRow(TestCase):
def _base_test_add_... | kalyons11/kevin | kevin/tests/leet/test_add_one_row.py | Python | mit | 1,134 |
# © 2018 Akretion (Florian da Costa)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import base64
from datetime import date, timedelta
from odoo import api, exceptions
from odoo.tests import common
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
class TestVacuumRule(common.TransactionCase):
d... | OCA/server-tools | autovacuum_message_attachment/tests/test_vacuum_rule.py | Python | agpl-3.0 | 6,454 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Test Sim Multi
# Generated: Wed Dec 30 18:39:39 2015
##################################################
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio im... | osh/gr-eventsim | apps/test_sim_multi.py | Python | gpl-3.0 | 5,398 |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files... | faith0811/zerorpc-python | zerorpc/core.py | Python | mit | 15,042 |
# Copyright 2017 Hewlett-Packard Enterprise Company, L.P.
#
# 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... | NaohiroTamura/ironic | ironic/tests/unit/drivers/test_ilo.py | Python | apache-2.0 | 3,203 |
################################################################################
## Created by Fernando Damian Nieuwveldt
## Date : 26 October 2009
## email : fdnieuwveldt@gmail.com
## This was part work of my masters thesis i... | ActiveState/code | recipes/Python/577133_new_method_computing_hypergeometric/recipe-577133.py | Python | mit | 1,922 |
# Copyright (C) 2012 Google 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 must retain the above copyright
# notice, this list of conditions and the ... | chromium/chromium | third_party/blink/tools/blinkpy/web_tests/lint_test_expectations.py | Python | bsd-3-clause | 19,979 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
clean_html,
parse_duration,
str_to_int,
unified_strdate,
)
class CamdemyIE(InfoExtractor):
_V... | rg3/youtube-dl | youtube_dl/extractor/camdemy.py | Python | unlicense | 5,772 |
# Copyright (C) 2013 Codethink Limited.
#
# 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.
#
# This program is distribute... | CodethinkLabs/python-consonant | consonant/transaction/actions.py | Python | gpl-2.0 | 6,271 |
"""
An implementation of a RequestCache. This cache is reset at the beginning
and end of every request.
"""
import crum
import threading
class _RequestCache(threading.local):
"""
A thread-local for storing the per-request cache.
"""
def __init__(self):
super(_RequestCache, self).__init__()
... | romain-li/edx-platform | common/djangoapps/request_cache/middleware.py | Python | agpl-3.0 | 3,875 |
import json
import logging
import os
from argparse import ArgumentParser
from typing import Dict, Tuple, List
import psutil
from core.factories import OptimizationFactory
from core.lassim_context import OptimizationArgs
from utilities.logger_setup import LoggerSetup
"""
This scripts contains all the possible termina... | gmariotti/lassim | source/utilities/terminal.py | Python | gpl-3.0 | 11,245 |
# -*- coding: utf-8 -*-
"""
Abstract Classes for Providers
------------------------------
Abstract base classes for implementation of protocol specific providers.
.. note::
Attributes prefixed with ``_x_`` serve the purpose of unification
of differences across providers.
.. autosummary::
login_... | abusalimov/github-migrator-gae | authomatic/providers/__init__.py | Python | mit | 30,290 |
import logging
import os
from .. import auth, settings
def userkey_validator(userkey):
if auth.is_key_valid(settings.APPKEY, userkey):
logging.info('...klucz jest poprawny')
return userkey
else:
raise ValueError('Niepoprawny lub nieaktualny klucz.')
def source_validator(source):
... | kosior/taktyk | taktyk/commands/validators.py | Python | mit | 1,085 |
"""
Milestone related tests for the mobile_api
"""
import six
from crum import set_current_request
from django.conf import settings
from mock import patch
from lms.djangoapps.courseware.access_response import MilestoneAccessError
from lms.djangoapps.courseware.tests.test_entrance_exam import add_entrance_exam_milest... | cpennington/edx-platform | lms/djangoapps/mobile_api/tests/test_milestones.py | Python | agpl-3.0 | 5,718 |
import django
from django.conf import settings
from django.db import transaction
from django.db.models import connection
from django.test import testcases
from fixture import DjangoFixture
_DJANGO_MAJOR_MINOR_VERSION = django.VERSION[:2]
if _DJANGO_MAJOR_MINOR_VERSION < (1, 3):
check_supports_transactions = lambd... | patrickod/fixture | fixture/django_testcase.py | Python | lgpl-2.1 | 2,189 |
# Copyright (C) 2009, Tomeu Vizoso
#
# 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.
#
# This program is distributed in ... | nemesiscodex/JukyOS-sugar | src/jarabe/journal/listmodel.py | Python | gpl-2.0 | 9,663 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['LSTM'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_None/model_control_one_enabled_None_Lag1Trend_Seasonal_Hour_LSTM.py | Python | bsd-3-clause | 152 |
# Copyright 2016 Capital One Services, 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... | andrewalexander/cloud-custodian | c7n/resources/ami.py | Python | apache-2.0 | 5,071 |
import configargparse
import core.common as common
import pandas as pd
from core.bots.paper import Paper
from termcolor import colored
from core.bots.backtest import Backtest
from core.bots.enums import TradeMode
from core.bots.live import Live
from core.plot import Plot
from core.report import Report
from core.wallet ... | miti0/mosquito | core/engine.py | Python | gpl-3.0 | 8,609 |
"""Core module. Provides the basic operations needed in sympy.
"""
from basic import Basic, S
from symbol import Symbol, Wild, symbols
from numbers import Number, Real, Rational, Integer
from power import Pow
from mul import Mul
from add import Add
from relational import Equality, Inequality, Unequality, StrictInequal... | certik/sympy-oldcore | sympy/core/__init__.py | Python | bsd-3-clause | 672 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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 v... | pmghalvorsen/gramps_branch | gramps/gen/plug/menu/_placelist.py | Python | gpl-2.0 | 1,794 |
# Copyright (c) 2010-2012 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 agree... | openstack/swift | swift/account/server.py | Python | apache-2.0 | 15,279 |
import random
import string
import sys
from django.core.urlresolvers import reverse
from django.template import Context, RequestContext, Template
from django.test import TestCase
from django.test.client import Client, RequestFactory
from shortener.baseconv import base62, DecodingError, EncodingError
from shortener.f... | tehranian/django-url-shortener | shortener/tests.py | Python | mit | 9,097 |
import sys
import time
import traceback
import dis
from browser import document as doc, window, alert
Debugger = window.Brython_Debugger
# set height of container to 66% of screen
_height = doc.documentElement.clientHeight
_s = doc['container']
_s.style.height = '%spx' % int(_height * 0.66)
has_ace = True
try:
... | Isendir/brython | www/tests/debugger/__init__.py | Python | bsd-3-clause | 4,452 |
"""Some functions for working with contingency tables (i.e. cross tabulations).
"""
from __future__ import division, print_function, absolute_import
from functools import reduce
import numpy as np
from scipy import special
from .stats import power_divergence
__all__ = ['margins', 'expected_freq', 'chi2... | beiko-lab/gengis | bin/Lib/site-packages/scipy/stats/contingency.py | Python | gpl-3.0 | 9,515 |
##
# Copyright 2009-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | pescobar/easybuild-easyblocks | easybuild/easyblocks/s/scalapack.py | Python | gpl-2.0 | 9,785 |
# -*- coding: utf-8 -*-
import numpy as np
np.set_printoptions(precision=3, linewidth=256)
from dyconnmap.fc import mi
if __name__ == "__main__":
data = np.load(
"/home/makism/Github/dyconnmap/examples/data/eeg_32chans_10secs.npy")
data = data[0:5, :]
fs = 128
fb_lo = [1.0, 4.0]
fb_hi =... | makism/dyfunconn | examples/fc_mi.py | Python | bsd-3-clause | 390 |
"""Define our own locale negotiator that looks at the browser
preferences, as well as the ``_`` translation function.
"""
from pyramid.i18n import TranslationStringFactory
from webob.acceptparse import NilAccept
_ = TranslationStringFactory('yait')
def locale_negotiator(request):
"""Return a locale name by lo... | dbaty/Yait | yait/i18n.py | Python | bsd-3-clause | 900 |
"""
Implementation of the class `GEOFile` used to generate a .geo file.
"""
import os
import numpy
class GEOFile(object):
def __init__(self, name='mesh'):
self.name = name
self.domain = None
self.body = None
self.boxes = []
def define_domain(self,
bottom_left=[-1.0, -1.0],
... | mesnardo/snake | snake/openfoam/GEOFile.py | Python | mit | 7,625 |
""" Copyright (C) 2011 ESO/Centre de Recherche Astronomique de Lyon (CRAL)
print pygme.__LICENSE__ for the terms of use
This package allows the use of Multi Gaussian Expansion models (Monnet et al.
1992, Emsellem et al. 1994). It can read and write MGE input ascii files and
computes a number of basic... | emsellem/pygme | pygme/__init__.py | Python | bsd-3-clause | 4,366 |
#program prints the full path of files in current directory.
import pathlib
pth = pathlib.Path('./')
for f in pth.iterdir():
print(f)
| UWPCE-PythonCert/IntroPython2016 | students/enrique_silva/session04/printPath.py | Python | unlicense | 139 |
#!/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.
"""This script is used to download prebuilt clang binaries.
It is also used by package.py to build the prebuilt clang binaries."""... | Workday/OpenFrame | tools/clang/scripts/update.py | Python | bsd-3-clause | 32,218 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from odoo.addons.test_mail.tests.common import TestMailCommon, TestRecipients
from odoo.tools import mute_logger
class TestMailTemplate(TestMailCommon, TestRecipients):
@classmethod
def setUpCla... | rven/odoo | addons/test_mail/tests/test_mail_template.py | Python | agpl-3.0 | 7,756 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | jmesteve/saas3 | openerp/addons/fetchmail/fetchmail.py | Python | agpl-3.0 | 14,522 |
#!/usr/bin/python
# encoding: utf-8
#
# Copyright © 2017 Adam Skołuda
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2017-11-06
#
"""
Translate DeepL API - available languages
"""
# AVAILABLE_LANGS = {
# 'German': {'iso_code': 'DE', 'icon': 'lang_icons/de.png'},
# 'English': {'iso_code... | Skoda091/alfred-deepl | deepl_available_langs.py | Python | mit | 1,127 |
from billow import billow
from flask import Flask, redirect, render_template
from pprint import pprint, pformat
import datetime
import yaml
from billow_web import app, config
def header():
nav = {
'name': 'billow-web',
'logourl': config.config['logourl'],
'title': config.config[... | WrathOfChris/billow-web | billow_web/main.py | Python | bsd-2-clause | 10,593 |
# Copyright 2011 The greplin-twisted-utils 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Cue/greplin-twisted-utils | src/greplin/net/dnsCache.py | Python | apache-2.0 | 2,900 |
# Copyright (c) 2019 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 app... | luotao1/Paddle | python/paddle/fluid/incubate/fleet/parameter_server/distribute_transpiler/distributed_strategy.py | Python | apache-2.0 | 16,410 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Packet-based Server-side Socket Interface.
Copyright (c) 2017 Michael Roland <mi.roland@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, e... | michaelroland/wdnas-dl2100-hwtools | threadedsockets/packetserver.py | Python | gpl-3.0 | 3,348 |
import os
import subprocess
from StringIO import StringIO
import pycurl
from bs4 import BeautifulSoup
from RequestHandler import RequestHandler
class MotifAuthorizationManager(object):
URL_AUTH_STEP1 = "https://auth.motifinvesting.com/authenticate"
URL_AUTH_STEP2 = "https://trader.motifinvesting.com/two-facto... | audrummer15/motif-crawler | lib/MotifAuthorizationManager.py | Python | mit | 7,365 |
import os
import traceback
import json
import requests
from flask import Flask, request
from cities_list import CITIES
from messages import get_message, search_keyword
token = os.environ.get('FB_ACCESS_TOKEN')
api_key = os.environ.get('WEATHER_API_KEY')
app = Flask(__name__)
def location_quick_reply(sender, text=N... | beckenkamp/weatherbot | index.py | Python | gpl-3.0 | 7,204 |
# 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 https://mozilla.org/MPL/2.0/.
from django.http import HttpResponse
from bedrock.mozorg.decorators import cache_control_expires
RESPONSE_CONTENT = "... | flodolo/bedrock | bedrock/mozorg/tests/views.py | Python | mpl-2.0 | 553 |
# GromacsWrapper: formats.py
# Copyright (c) 2009-2011 Oliver Beckstein <orbeckst@gmail.com>
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.
"""
Gromacs NDX index file format
=============================
The `.ndx file`_ contains lists of atom indices that are g... | PicoCentauri/GromacsWrapper | gromacs/fileformats/ndx.py | Python | gpl-3.0 | 7,868 |
# Copyright 2017 The Tangram Developers. See the AUTHORS file at the
# top-level directory of this distribution and at
# https://github.com/renatoGarcia/tangram/blob/master/AUTHORS.
#
# This file is part of Tangram.
#
# Tangram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | renatoGarcia/tangram | test/test_message.py | Python | lgpl-3.0 | 1,168 |
import json
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
from msmbuilder import version
if not version.release:
print("This is not a release.")
exit(0)
URL = 'http://www.msmbuilder.org'
versions = json.load(urlopen(URL + '/versions.json'))
# new release so ... | rmcgibbo/msmbuilder | devtools/ci/update_versions_json.py | Python | lgpl-2.1 | 661 |
from .ws_server import *
| lap00zza/arc | ws_server/arc_ws/__init__.py | Python | gpl-3.0 | 25 |
# scan parameters configured here
# are used by all the scripts
freqCenter = 21000000 # example: if you want to scan from 17 to 25 MHz you enter here 21000000 as center frequency and 8000000 below as bandwidth
freqBandwidth = 8000000
upconvFreqHz = 125000000 # this is your upconverter offset frequency in Hz, set ... | mariocannistra/radio-astronomy-fftw | radioConfig-example.py | Python | mit | 3,514 |
import datetime
DATETIME_FORMAT = 'd/m/Y H:i:s'
DATE_FORMAT = 'd/m/Y'
| anselmobd/fo2 | src/fo2/formats/pt/formats.py | Python | mit | 72 |
import datetime
import gzip
import os
import pickle
from typing import Optional, Union, Dict
import dateutil
import scipy.constants
from ... import classes2
from ...misc.errorvalue import ErrorValue
class Header(classes2.Header):
"""Header file written by SAXSCtrl"""
@classmethod
def new_from_file(cls,... | awacha/sastool | sastool/io/credo_cct/header.py | Python | bsd-3-clause | 13,555 |
from __future__ import print_function, absolute_import
from distutils import sysconfig
from distutils import version
from distutils.core import Extension
import glob
import io
import multiprocessing
import os
import re
import subprocess
import sys
from textwrap import fill
try:
from subprocess import check_outpu... | RobertABT/heightmap | build/matplotlib/setupext.py | Python | mit | 59,397 |
#
# Copyright (C) 2011 - 2015 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# Some XML modules may be missing and Base.{load,dumps}_impl are not overriden:
# pylint: disable=import-error
"""XML files parser backend, should be available always.
.. versionchanged:: 0.1.0
Added XML dump support.
- Format to supp... | pmquang/python-anyconfig | anyconfig/backend/xml.py | Python | mit | 6,370 |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | falbassini/googleads-dfa-reporting-samples | python/v1.3/get_all_files.py | Python | apache-2.0 | 1,910 |
'''
Created on Mar 4, 2012
@author: dsussman
'''
# RandomGraph.py
"""Graphs and Random Graphs
========================
This module provides classes to store graphs and generate random graphs.
It also has methods to manipulate graphs.
Classes:
Graph -- Parent class that stores Adjacency as well as graph propertie... | jovo/PyGraphStat | code/adjacency.py | Python | apache-2.0 | 17,045 |
import discord
from discord.ext import commands
# Alle weiteren benötigten Imports einfach zwischen diesem und dem nächsten Kommentar hinzufügen
# Ende der Imports
def is_in_guild(guild_id):
async def predicate(ctx):
return ctx.guild and ctx.guild.id == guild_id
return commands.check(is_in_guild)
"... | PilleniusMC/Pixeldrohne | server_specifics.py | Python | lgpl-2.1 | 688 |
from io import Parser, Encoder
from null import Null
def dumps(obj):
return Encoder(obj).writeSI().writeOLI().writeData().export()
def loads(string):
return Parser(string).parseSI().parseOLI().parseValue()
class Channel():
def __init__(self, spec):
self.spec = spec
def dumps(self, obj):
return Encode... | raypulver/pyleon | pyleon/leon.py | Python | mit | 460 |
from .owlpropertyaxiom import OWLPropertyAxiom
class OWLSubPropertyAxiom(OWLPropertyAxiom):
"""TODO: implement"""
def __init__(self, sub_property, super_property, annotations):
"""
:param sub_property: an owlapy.model.OWLPropertyExpression object
:param super_property: an owlapy.model... | patrickwestphal/owlapy | owlapy/model/owlsubpropertyaxiom.py | Python | gpl-3.0 | 563 |
import pkgutil
import os.path
__path__ = [
os.path.abspath(path)
for path in pkgutil.extend_path(__path__, __name__)
]
| jeremiahyan/odoo | odoo/upgrade/__init__.py | Python | gpl-3.0 | 127 |
#!/usr/bin/env python
import argparse
def read_file_data(filename):
if filename is None:
return None
with open(filename, mode='r') as file:
data = list()
for line in file:
data.append(line.strip().split('\t'))
return data
def main():
parser = argparse.ArgumentP... | trevorlewis/csci572dr | benchmark/report.py | Python | apache-2.0 | 4,559 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_mpodster
----------------------------------
Tests for `mpodster` module.
"""
import pytest
from mpodster import mpodster
class TestMpodster(object):
@classmethod
def setup_class(cls):
pass
def test_something(self):
pass
@cl... | bnara/mpodster | tests/test_mpodster.py | Python | mit | 373 |
# Copyright 2015. 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 la... | vpramo/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/vnc_client/router_res_handler.py | Python | apache-2.0 | 24,484 |
"""Test encoding and decoding of request URLs of IIIF Image API v3.0.
This test includes only test cases for the table in section 8,
at <http://iiif.io/api/image/3.0/#uri-encoding-and-decoding>. See
test_request_3_0.py for more examples that test other cases and alter
default forms which should still be decoded correc... | zimeon/iiif | tests/test_request_spec_3_0.py | Python | gpl-3.0 | 2,897 |
# Generated by Django 2.2.13 on 2020-12-07 19:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('community', '0036_auto_20201206_2042'),
]
operations = [
migrations.AlterField(
model_name='community',
name='follo... | jeromecc/doctoctocbot | src/community/migrations/0037_auto_20201207_2058.py | Python | mpl-2.0 | 659 |
import math
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
def q_multi(p, q):
# quaternion multiplication
p0, p1, p2, p3 = p
q0, q1, q2, q3 = q
w = p0 * q0 - p1 * q1 - p2 * q2 - p3 * q3
x = p0 * q1 + p1 * q0 + p2 * q3 - p3 * q2
y = p0 * q2 - p1 * q3 + p2 * q0 + p3... | jials/CS4243-labs | lab6n7/camera_translation.py | Python | mit | 4,677 |
#!/usr/bin/env python3
__author__ = 'Anton Melnikov'
# http://ostensible.me
from pprint import pprint
from phonemelib import Phoneme, FeatureValue, phonemes
def print_distinctive_features(phoneme: Phoneme):
for feature, value in phoneme:
if value is FeatureValue.yes:
output_value = '+'
... | notnami/phonemes | phonemeviewer.py | Python | mit | 1,604 |
#!/usr/bin/python
def application(environ,start_response):
start_response('200 OK',[('Content-Type','text/html')])
return '<b>Hello,world!</b>' | AirChen/PythonPractic | serverDemo/demo1/webapp.py | Python | mit | 146 |
'''
NSSpeechSynthesizer driver.
Copyright (c) 2009, 2013 Peter Parente
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND TH... | parente/pyttsx | pyttsx/drivers/nsss.py | Python | isc | 3,939 |
"""This is the extract from test_signal.py that runs forever until it fails.
It reproduces the bug where SIGCHLD either not delivered or somehow lost and thus
if libev does not poll waitpid() periodically, popen.wait() blocks forever.
The patch that fixes it: https://bitbucket.org/denis/gevent/changeset/adb8b5ac698c
... | ubuntuvim/GoAgent | local/gevent-1.0rc2/greentest/xtest_signal.py | Python | mit | 2,560 |
#!/usr/bin/python
from appcomposer.translator.tasks import cel
import sys
cel.worker_main(sys.argv + ['--concurrency=1', '--queues=single-sync-tasks'])
| porduna/appcomposer | run_celery_single_queue.py | Python | bsd-2-clause | 153 |
# -*- coding: utf-8 -*-
"""Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
me... | deanishe/alfred-duden | src/lib/bs4/tests/test_tree.py | Python | mit | 82,177 |
import pytest
@pytest.fixture(params=["--setup-only", "--setup-plan", "--setup-show"], scope="module")
def mode(request):
return request.param
def test_show_only_active_fixtures(testdir, mode):
p = testdir.makepyfile(
'''
import pytest
@pytest.fixture
def _arg0():
... | pyfisch/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/python/setup_only.py | Python | mpl-2.0 | 6,685 |
"""
This module implements the FormRequest class which is a more convenient class
(than Request) to generate Requests based on form data.
See documentation in docs/topics/request-response.rst
"""
from six.moves.urllib.parse import urljoin, urlencode
import lxml.html
from parsel.selector import create_root_node
import... | nfunato/scrapy | scrapy/http/request/form.py | Python | bsd-3-clause | 6,853 |
from xlrd import open_workbook
from xlwt import Workbook
import pandas as pd
import sys
loan_file = 'd:\\projects\\vip\\vip_loan.xls'
profit_file = 'd:\\projects\\vip\\vip_profit.xls'
repay_file = 'd:\\projects\\vip\\vip_repay.xls'
loan_book = open_workbook(loan_file)
profit_book = open_workbook(profit_file)
repay_bo... | maxwell-lv/MyQuant | vip.py | Python | gpl-3.0 | 2,247 |
class Order(dict):
"""
Dictionary Object storing the representation of an Order
"""
def __init__(self, order):
"""
@symbol eg, GOOGL
@orderid eg, 3245
@action eg, A
@exchange eg, 3
@quantity eg, 148000
@news eg, 0
@side eg, S
@descr... | albhu/finance | order.py | Python | mit | 1,604 |
#uses Pandas to save simple dict of arrays as an hdf file
import pandas as pd
def convertArraysToFrame(dictOfArrays):
return pd.DataFrame(dictOfArrays)
def saveIt(datFr, fname):
datFr.save(fname)
| psammetichus/morlet | morlet/oldstuff/pandaEEG.py | Python | gpl-3.0 | 204 |
"""SysCA - Certificate tool for sysadmins.
"""
# pylint: disable=import-outside-toplevel
__version__ = "2.0"
def _version_info():
"""Info string for --version.
"""
try:
import cryptography
from cryptography.hazmat.backends import default_backend
cver = cryptography.__version__
... | markokr/sysca | sysca/__init__.py | Python | isc | 638 |
#!/usr/bin/python3
# -*- coding: utf-8
"""Letscode is just a language-aware tool to quickly perform a bunch of usual
actions on a piece of code.
Letscode provides some kind of convenient abstraction over the different
languages you are working with and the related tools (compiler, interpreter,
etc). You might not want... | SylvainDe/letscode | letscode.py | Python | mit | 5,212 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['RelativeDifference'] , ['PolyTrend'] , ['Seasonal_DayOfWeek'] , ['NoAR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_PolyTrend_Seasonal_DayOfWeek_NoAR.py | Python | bsd-3-clause | 171 |
from nameparts import Name, MultiName | polera/nameparts | __init__.py | Python | bsd-2-clause | 37 |
class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
:type D: List[int]
:rtype: int
"""
from collections import defaultdict
rec = defaultdict(int)
for i in C:
... | xingjian-f/Leetcode-solution | 454. 4Sum II.py | Python | mit | 506 |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | yeming233/rally | rally/common/db/sqlalchemy/migrations/versions/a6f364988fc2_change_tag_type_enum.py | Python | apache-2.0 | 1,864 |
"""
Copyright (c) 2013, Thom Leggett.
License: MIT (see LICENSE for details)
"""
| tteggel/tally | tally/__init__.py | Python | mit | 81 |
#! /usr/bin/env python
#
# Connect to the NETCONF server passed on the command line and
# display their capabilities. This script and the following scripts
# all assume that the user calling the script is known by the server
# and that suitable SSH keys are in place. For brevity and clarity
# of the examples, we omit p... | einarnn/ncclient | examples/nxosapi.py | Python | apache-2.0 | 4,592 |
"""PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
import itertools
from functools import wraps
try:
from urllib.parse import splituser
except ImportError:
from urllib2 import splituser
from setuptools.extern import six
from setupt... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/setuptools/package_index.py | Python | mit | 39,970 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 3 of the License, or
(at your option) any later version.
T... | repotvsupertuga/tvsupertuga.repository | script.vodextende/scrapers/watchepisodes_scraper.py | Python | gpl-2.0 | 5,783 |
#-----------------------------------------------------------------------------
# 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/tools/test_reset_tool.py | Python | bsd-3-clause | 4,656 |
#!/usr/bin/python
import os
import sys
import pymongo
import time
import datetime
import math
from bson import BSON
from bson import json_util
from calibration import *
import dateutil.parser
from dateutil import tz
MONGODB_URI_LOCAL = 'mongodb://user:passw@mongolab:12345/collectionname'
MONGODB_COLLECTION = 'collec... | oschumac/python-uart-pi-xbridge | mongo.py | Python | mit | 4,766 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'matt'
__date__ = '3/2/14'
from dataplunger.processors import *
import os
import tempfile
from nose.tools import raises
class RecordConstructorMock(object):
def __init__(self, **kwargs):
self.records = []
class TestBase(object):
def __init__... | mattmakesmaps/DataPlunger | dataplunger/tests/tests_processors.py | Python | gpl-2.0 | 13,458 |
# Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | jonparrott/gcloud-python | storage/google/cloud/storage/iam.py | Python | apache-2.0 | 2,803 |
"""Event tracker backend that saves events to a python logger."""
import json
import logging
from django.conf import settings
from common.djangoapps.track.backends import BaseBackend
from common.djangoapps.track.utils import DateTimeJSONEncoder
log = logging.getLogger('common.djangoapps.track.backends.logger')
app... | eduNEXT/edx-platform | common/djangoapps/track/backends/logger.py | Python | agpl-3.0 | 1,576 |
from ImageScripter import *
from elan import *
def Check_If_Blue_Screen_Exists():
Blue = '[254 0 0]'
if Viewer.bluescreen.GetDominantColor(threshold=.70) == Blue:
raise ValueError('Blue Screen')
Blue = '[255 0 0]'
if Viewer.bluescreen.GetDominantColor(threshold=... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/elan/onHoldScripts/Blue_Video_on_Reboot_Elan.py | Python | gpl-3.0 | 1,030 |
"""Unit tests for the doorstop.vcs plugin modules."""
import unittest
from unittest.mock import patch, Mock, call
from doorstop.core.vcs import load
class BaseTestCase(unittest.TestCase): # pylint: disable=R0904
"""Base TestCase for tests that need a working copy."""
DIRECTORY = None
path = "path/to... | elewis33/doorstop | doorstop/core/vcs/test/test_commands.py | Python | lgpl-3.0 | 5,711 |
# Copyright 2021 RedHat Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | openstack/glance_store | glance_store/common/cinder_utils.py | Python | apache-2.0 | 8,906 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Version: 2.75 (March 4, 2017)
# Author: Giuseppe Attardi (attardi@di.unipi.it), University of Pisa
#
# Contributors:
# Antonio Fuschetto (fuschett@aol.com)
# Leonardo Souza (lsouza@amt... | sobhe/hazm | hazm/WikiExtractor.py | Python | mit | 116,216 |
# -*- coding: utf-8 -*-
# 2014-11-18T22:48+08:00
import unittest
class OutOfRangeError(ValueError): pass
roman_numeral_map = (('M', 1000),
('CM', 900),
('D', 500),
('CD', 400),
('C', 100),
('XC', 90),
... | myd7349/DiveIntoPython3Practices | chapter_09_UnitTesting/roman2.py | Python | lgpl-3.0 | 4,834 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#******************************************************************************
#
# Project: GDAL
# Purpose: Command line raster calculator with numpy syntax
# Author: Chris Yesson, chris.yesson@ioz.ac.uk
#
#**************************************************************... | GeoscienceAustralia/PyRate | scripts/gdal_calc_local.py | Python | apache-2.0 | 17,099 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
# from salt_mq import MQServer
# import time
# def run(q, w, e, t):
# global a
# print(t)
# a.channel.close()
# a.close()
#
#
# while True:
# m = MQServer("127.0.0.1", exchange="pub", exchange_type="topic")
# m.publish... | zengchunyun/s12 | day9/temp/c1.py | Python | gpl-2.0 | 1,179 |
import unittest
import mock
from collections import namedtuple
import util
import mail, exceptions
class FakeEmail(object):
def __init__(self, subject, message_id, body=""):
self.subject = subject
self.message_id = message_id
self.body = body
def body():
return self.body
c... | DavidWittman/serverless-southwest-check-in | lambda/tests/test_mail.py | Python | mit | 6,176 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.