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 |
|---|---|---|---|---|---|
mcinif='mcini_weihera'
mcpick='gen_weihera.pickle'
runname='gen_test3213'
pathdir='/beegfs/work/ka_oj4748/echoRD'
wdir='/beegfs/work/ka_oj4748/gen_tests'
update_prec=0.06
legacy_pick=True
import sys
sys.path.append(pathdir)
import run_echoRD as rE
rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=runname,wdir=wdir,pa... | cojacoo/testcases_echoRD | gen_test3213a.py | Python | gpl-3.0 | 383 |
# This file is part of EAP.
#
# EAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# EAP is distributed in ... | marcioweck/PSSLib | reference/deap/examples/gp/multiplexer.py | Python | lgpl-3.0 | 3,307 |
from rest_framework import viewsets, permissions
import models
import serializers
class PageViewSet(viewsets.ModelViewSet):
"""
This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions.
"""
queryset = models.Page.objects.all()
serializer_class = seriali... | esitamon/django-skeleton | app/website/api.py | Python | gpl-3.0 | 840 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | glemaitre/scikit-learn | examples/decomposition/plot_pca_3d.py | Python | bsd-3-clause | 2,311 |
from collections import deque
import io
import itertools
import logging
import multiprocessing
import multiprocessing.pool
import numpy
import PIL.Image
import PIL.ImageFile
from smqtk.algorithms.descriptor_generator import \
DescriptorGenerator, \
DFLT_DESCRIPTOR_FACTORY
from smqtk.utils.bin_utils import re... | Purg/SMQTK | python/smqtk/algorithms/descriptor_generator/caffe_descriptor.py | Python | bsd-3-clause | 20,609 |
import hashlib
import os
import os.path
import re
import zipfile
from io import BytesIO
from urllib.parse import urlencode
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.core.paginator import Paginator
from django.http import... | mbi/django-rosetta | rosetta/views.py | Python | mit | 29,017 |
import datetime
import random
import numpy as np
from hyperopt import hp, fmin, tpe
import os
import sys
from sklearn.linear_model import Ridge
sys.path.insert(0, os.getcwd())
import qml_workdir.classes.config
from qml.cv import QCV
from qml.helpers import get_engine
from qml.models import QXgb, QAvg, QRankedAvg,... | quantum13/mlbootcamp5 | qml_workdir/ensembling/level3_model02s.py | Python | mit | 3,403 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
import nose.tools
import nose.plugins.skip
from . import util
class GlobalInitTest(unittest.TestCase):
def test_global_init_default(self):
# initialize libcurl with DEFAULT flags
pycurl.global_init(pycurl.GL... | buaabyl/pycurl-win32 | tests/global_init_test.py | Python | lgpl-2.1 | 1,063 |
#
# 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... | kevinyu98/spark | python/pyspark/ml/pipeline.py | Python | apache-2.0 | 15,535 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# web-of-science documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in thi... | chendaniely/web-of-science | docs/conf.py | Python | mit | 8,474 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=unused-variable
import os
import re
import sys
import logging
import importlib
from datetime import datetime
from logging.handlers import SMTPHandler
import jinja2
from celery import Celery
from werkzeug.urls import iri_to_uri
from werkzeug.utils impor... | andreymal/mini_fiction | mini_fiction/application.py | Python | gpl-3.0 | 21,619 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/models/object_detection/builders/box_coder_builder.py | Python | bsd-2-clause | 2,313 |
# -*- coding: utf-8 -*-
"""Manages settings and config file.
Manages the settings of the program.
Settings are loaded from a configuration file. If they don't exists, default
values are provided.
When an option is set, the config file is updated.
Before any use, the module must be initialized by calling ``load()``.
... | Bajoo/client-pc | bajoo/common/config.py | Python | gpl-3.0 | 6,387 |
from citrination_client.search.pif.query.core.base_object_query import BaseObjectQuery
from citrination_client.search.pif.query.core.field_query import FieldQuery
from citrination_client.search.pif.query.core.value_query import ValueQuery
class ProcessStepQuery(BaseObjectQuery):
"""
Class to query against a p... | CitrineInformatics/python-citrination-client | citrination_client/search/pif/query/core/process_step_query.py | Python | apache-2.0 | 3,084 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=no-init,attribute-defined-ou... | mganeva/mantid | Testing/SystemTests/tests/analysis/MagnetismReflectometryReductionTest.py | Python | gpl-3.0 | 25,025 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | ShaheenHossain/eagle-medical | medical_medicament_attributes/models/medical_medicament_attribute_color.py | Python | agpl-3.0 | 1,207 |
__author__ = 'tiefkuehlpizze'
__version__ = '0.1'
__all__ = [
'exception',
'session',
'client',
'user',
'anime',
'manga',
'character',
'staff',
'studio',
'review',
'forum',
'anilist',
]
from pyanilist import *
| Tiefkuehlpizze/pyanilist | pyanilist/__init__.py | Python | gpl-3.0 | 260 |
from KTrade import Trade
from KTradeReader import TradeReader
from KPortfolio import Portfolio
class ResultsViewer(object):
''' Responsible for presenting the results.
'''
def __init__(self, filePath):
self.filePath = filePath
def PrintPortfolioInformation(self):
trades = TradeReader... | Kolguyev/samples | compute_rpl/main.py | Python | gpl-2.0 | 865 |
from c2corg_api.search import create_search, elasticsearch_config, \
get_text_query_on_title
from c2corg_api.views.document_listings import get_documents
from elasticsearch_dsl.search import MultiSearch
def search_for_types(search_types, search_term, limit, lang):
"""Get results for all given types.
"""
... | c2corg/v6_api | c2corg_api/search/search.py | Python | agpl-3.0 | 2,314 |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from... | jimmykiselak/lbrycrd | qa/rpc-tests/bip68-112-113-p2p.py | Python | mit | 27,304 |
""" Use the following config with caution.
"""
from parsl.config import Config
from parsl.executors.ipp import IPyParallelExecutor
from parsl.executors.ipp_controller import Controller
config = Config(
executors=[
IPyParallelExecutor(
label='local_ipp_reuse',
),
],
controller=Co... | swift-lang/swift-e-lab | parsl/configs/local_ipp_reuse.py | Python | apache-2.0 | 344 |
#!/usr/bin/env python
# Simple script for shutting down the raspberry Pi at the press of a button.
# by Inderpreet Singh
import RPi.GPIO as GPIO
import time
import os
# Use the Broadcom SOC Pin numbers
# Setup the Pin with Internal pullups enabled and PIN in reading mode.
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.IN,... | JohSchneider/piboy-zero | software/powerbutton/power.py | Python | mit | 901 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from subways import views as subways
urlpatterns = patterns('',
url(r'^(?P<map_name>[\w.]+)/$', subways.map, {'template_name': "subways/subwayMap.htm"}, name='subway_map'),
url(r'^longest_ride/(?P<map_name>[\w.]+)/$', subways.longest... | mouradmourafiq/django-subways | subways/urls.py | Python | bsd-2-clause | 564 |
# -*- coding: utf-8 -*-
from webob import Request
from webob import Response
from webob import exc
from .compat import b
def input_app(environ, start_response):
resp = Response()
req = Request(environ)
if req.path_info == '/':
resp.body = b('<input name="youyou" type="text" value="" />')
elif ... | ekeyme/pyquery | tests/apps.py | Python | bsd-3-clause | 1,068 |
#/usr/bin/python
# -*- coding: utf-8 -*-
#
# parse Gcode
#
"""Module to simulate a plotter"""
import threading
import sys
import logging
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
import pygame
import time
class PlotterSimulator(threading.Thread):
"""Pygame Simulation of Plotter"""
def __... | gunny26/python-gcode | PlotterSimulator.py | Python | gpl-2.0 | 10,231 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import sentry.db.models.fields.gzippeddict
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Nod... | beeftornado/sentry | src/sentry/nodestore/migrations/0001_initial.py | Python | bsd-3-clause | 654 |
from __future__ import division
from __future__ import print_function
from datetime import datetime
import sys, string, os
import logging
sys.path.insert(0, "/home/lom/users/cll/pytroll/install/lib/python2.6/site-packages")
from mpop.satellites import GeostationaryFactory
from mpop.projector import get_area_def
from m... | meteoswiss-mdr/monti-pytroll | scripts/plot_hrw.py | Python | lgpl-3.0 | 12,338 |
import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template1", \
path_list=[[TestAction.create_volume_snapshot, "vm1-root", "snapshot1"], \
[TestAction.stop_vm, "vm1"], \
[TestAction.sta... | zstackorg/zstack-woodpecker | integrationtest/vm/multihosts/snapshots/paths/path7.py | Python | apache-2.0 | 717 |
import json
from urllib import quote_plus
from urlparse import urljoin
import requests
METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']
class Method(object):
def __init__(self, method, url, auth, serialize_payload, headers):
self.method = getattr(requests, method.lower())
self.ur... | olegpidsadnyi/restart | restart/api.py | Python | mit | 2,054 |
'''
Created on May 7, 2011
@author: jake
'''
from decimal import Decimal
from warnings import warn
import moneyed
from django.test import TestCase
from moneyed import Money
from .testapp.forms import MoneyForm, MoneyModelForm
from .testapp.models import ModelWithVanillaMoneyField
class MoneyFormTestCase(TestCase):... | renefs87/project-payment-manager | app/djmoney/tests/form_tests.py | Python | gpl-3.0 | 1,880 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import time
from datetime import datetime
import sys
from ics import Calendar, Event
import progressbar
import logging
import sys
import os
debug = False
if os.isatty(sys.stdin.fileno()):
debug = True
logging.basicConfig(stream=sys.stderr, level=logging... | Epictek/Hull-Timetable-ical | app.py | Python | gpl-2.0 | 3,990 |
# NSDict - Generate dictionaries from Nationstates API queries and dumps
# Copyright 2017 Khronion <khronion@gmail.com>
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | khronion/ns_utilities | NSDict.py | Python | gpl-3.0 | 7,368 |
##
# Copyright 2019-2020 Bart Oldeman, McGill University, Compute Canada
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent Universi... | pescobar/easybuild-easyblocks | easybuild/easyblocks/i/iccifort.py | Python | gpl-2.0 | 3,264 |
#
# helpers.py
#
# Copyright (C) 2011, 2013, 2015 Uli Fouquet
# 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 p... | ulif/ulif.openoffice | src/ulif/openoffice/helpers.py | Python | gpl-2.0 | 22,408 |
#!/usr/bin/python
# Copyright (c) 2015, Michael LeBeane
# The University of Texas at Austin
# The Laboratory for Computer Architecture (LCA)
# All rights reserved.
#
# Redistribution of this source or derived binaries is not authorized without
# the express written consent of the original copyright holders.
#
# THIS SO... | mlebeane/wattwatcher | run_mcpat.py | Python | bsd-3-clause | 11,231 |
"""
Plugin for ResolveUrl
Copyright (C) 2015 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.
... | dknlght/dkodi | src/script.module.resolveurl/lib/resolveurl/plugins/videowood.py | Python | gpl-2.0 | 2,046 |
# Loosely based on https://github.com/Skarlso/SublimeGmailPlugin by Skarlso
import sublime
import sublime_plugin
from smtplib import SMTP
from email.mime.text import MIMEText
from email.header import Header
# from email.headerregistry import Address
# from email.utils import parseaddr, formataddr
config = {
# TO... | jbjornson/SublimeGMail | GMail.py | Python | mit | 4,056 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/subnets_operations.py | Python | mit | 17,678 |
#!/usr/bin/env python
#
# Copyright 2015 BMC Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | boundary/pulse-api-cli | tests/unit/boundary/metric_create_batch_test.py | Python | apache-2.0 | 2,094 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... | westurner/pwd | setup.py | Python | bsd-3-clause | 1,441 |
import os
import subprocess
import time
import pytest
from kazoo.testing import KazooTestHarness
from kazoo.exceptions import (
AuthFailedError,
NoAuthError,
)
from kazoo.tests.util import CI_ZK_VERSION
class TestLegacySASLDigestAuthentication(KazooTestHarness):
def setUp(self):
try:
... | python-zk/kazoo | kazoo/tests/test_sasl.py | Python | apache-2.0 | 5,528 |
"""Untappd plugin forms."""
from django import forms
WIDE_TEXT = forms.TextInput(attrs={"class": "input-block-level"})
class SiteSettingsForm(forms.Form):
client_id = forms.CharField(
required=False, widget=WIDE_TEXT, help_text="Untappd API Client ID."
)
client_secret = forms.CharField(
... | Kegbot/kegbot-server | pykeg/contrib/untappd/forms.py | Python | gpl-2.0 | 568 |
"""
Created on Mar 13, 2012
@author: moloch
Copyright 2012 Root the Box
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... | moloch--/RootTheBox | libs/SecurityDecorators.py | Python | apache-2.0 | 6,035 |
"""add_staging_tables
Revision ID: 50faca665f9c
Revises: 7833b2378161
Create Date: 2016-08-01 13:52:53.038526
"""
# revision identifiers, used by Alembic.
revision = '50faca665f9c'
down_revision = '7833b2378161'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engi... | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | dataactcore/migrations/versions/50faca665f9c_add_staging_tables.py | Python | cc0-1.0 | 24,606 |
from chiplotle.hpgl.abstract.hpglprimitive import _HPGLPrimitive
from chiplotle.geometry.core.coordinatearray import CoordinateArray
class _TwoPoint(_HPGLPrimitive):
'''Abstract class for commands with 2 coordinate pairs: x1, y1, x2, y2.'''
def __init__(self, coords=None):
self.coords = coords
... | drepetto/chiplotle | chiplotle/hpgl/abstract/twopoint.py | Python | gpl-3.0 | 994 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-02-06 08:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hkm', '0003_productorder_product_name'),
]
operations = [
migrations.Remove... | andersinno/kuvaselaamo | hkm/migrations/0004_auto_20170206_1023.py | Python | mit | 1,395 |
# Copyright (C) 2009 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... | cattleprod/samsung-kernel-gt-i9100 | external/webkit/WebKitTools/QueueStatusServer/model/queues.py | Python | gpl-2.0 | 1,648 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | petewarden/tensorflow | tensorflow/python/data/experimental/__init__.py | Python | apache-2.0 | 7,881 |
# Python 3 program for soundscape generation. (C) P.B.L. Meijer 2015
# Direct port of the hificode.c C program
# Last update: October 6, 2015; released under the Creative
# Commons Attribution 4.0 International License (CC BY 4.0),
# see http://www.seeingwithsound.com/im2sound.htm for details
#
# Beware that this progr... | joshainglis/python-soundscape | soundscape.py | Python | mit | 14,885 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyTabulate(PythonPackage):
"""Pretty-print tabular data"""
homepage = "https://bitbuc... | LLNL/spack | var/spack/repos/builtin/packages/py-tabulate/package.py | Python | lgpl-2.1 | 1,021 |
# Copyright 2021 DeepMind Technologies Limited.
#
# 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... | deepmind/dmvr | setup.py | Python | apache-2.0 | 2,126 |
import re
from pyrem_torq.utility import split_to_strings_iter
from _prepscript_default_defs import build_decoder
import _prepscript_util as _pu
import pyrem_torq.expression as _pte
from nodeformatter import *
_optiion_description = """
--annotation: keep annotations.
--array_initialization: keeps array ini... | viswimmer1/PythonGenerator | data/python_files/28486512/prep_java.py | Python | gpl-2.0 | 18,061 |
from setuptools import setup
setup(name="MySQLdatagen",
version="0.1",
description="A package to help generate data for a mysql database",
url="https://github.com/zombiecollin/MySQLdatagen",
author="zombiecollin",
license="MIT",
packages=['MySQLdatagen'],
install_requires=[
'MYSQL-python',
'configparser',
... | zombiecollin/MySQLdatagen | setup.py | Python | mit | 398 |
from datetime import timedelta
from unittest.mock import patch, MagicMock
from libfaketime import fake_time
import pytest
def test_purge(SETTINGS):
SETTINGS.CACHE_LIFE = 10
SETTINGS.REPOSITORIES = 'owner/repository1 owner/repository2'
from jenkins_epo.cache import MemoryCache
cache = MemoryCache()
... | novafloss/jenkins-epo | tests/test_cache.py | Python | gpl-3.0 | 1,527 |
from doajtest.helpers import DoajTestCase
from portality import models
import time
class TestTick(DoajTestCase):
def setUp(self):
super(TestTick, self).setUp()
self.j_correct = models.Journal(created_date="2014-06-28T11:26:42Z")
self.j_correct.set_in_doaj(True)
self.j_correct.save(... | DOAJ/doaj | doajtest/unit/test_tick.py | Python | apache-2.0 | 2,665 |
#!/usr/bin/python3
import sqlite3
import os, sys, time, datetime, random, string
import urllib.request, urllib.error
import configparser
from flask import Flask, request, session, redirect
from flask import render_template, g, flash, url_for
from contextlib import closing
from .modules import Pagi
from pxeat import ap... | wnereiz/pxeat | pxeat/views.py | Python | gpl-3.0 | 12,105 |
# -*- coding: utf-8 -*-
from moha.vm import code as Code
class W_Root(object):
def str(self):
return ''
class Type(object):
def __init__(self, typeval):
self.typeval = typeval
class Null(W_Root):
def str(self):
return 'null'
def __repr__(self):
return 'null'
@c... | mohalang/moha | moha/vm/objects.py | Python | apache-2.0 | 9,139 |
SEQUENCE = [
'is_private',
]
| chazy/reviewboard | reviewboard/accounts/evolutions/__init__.py | Python | mit | 33 |
# -*- coding: utf-8 -*-
#:-----------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para enlaces a torrent y magnet versión mínima
# adaptadtado a livestream
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#-------------------------------------------------------... | gypogypo/plugin.video.gypo | servers/pulsar.py | Python | gpl-3.0 | 511 |
# -*- coding: utf-8 -*-
import os
import unittest
import dukpy
from diffreport import report_diff
from dukpy.lessc import LessCompilerError
class TestTranspilers(unittest.TestCase):
def test_coffee(self):
ans = dukpy.coffee_compile('''
fill = (container, liquid = "coffee") ->
"Filling the #{c... | amol-/dukpy | tests/test_transpilers.py | Python | mit | 3,375 |
# -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2015 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | ivoire/DataTag | DataTag/urls.py | Python | agpl-3.0 | 2,869 |
from app import app, gl
from database import db, rds
import json
from flask import jsonify
from flask import stream_with_context
from flask import render_template
from flask import url_for
from flask import redirect
from flask import Response
from flask import request
from flask import make_response
from flask import a... | giantoak/tempus | app/views.py | Python | mit | 11,432 |
import sublime
import sublime_plugin
from ... import utils
testbox_function_names = [
"describe",
"it",
"feature",
"scenario",
"story",
"given",
"when",
"then",
]
func_call_scope = "meta.function-call.cfml variable.function.cfml"
string_scope = "meta.function-call.cfml meta.function-cal... | jcberquist/sublimetext-cfml | src/plugins_/testbox/testbox_spec_outline.py | Python | mit | 4,033 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Script to generate libyal m4 files."""
import argparse
import logging
import os
import sys
from yaldevtools import configuration
def Main():
"""The main program function.
Returns:
bool: True if successful or False if not.
"""
a... | libyal/libyal | scripts/m4-generate.py | Python | apache-2.0 | 2,209 |
'''
Created on May 7, 2014
@author: cmills
'''
from client_test import TestTASRAppClient
import unittest
import tasr.registered_schema
import tasr.client_legacy
import copy
import httmock
APP = tasr.app.TASR_APP
APP.set_config_mode('local')
class TestTASRLegacyClientMethods(TestTASRAppClient):
def setUp(self... | ifwe/tasr | test/pyunit/test_client_legacy_methods.py | Python | apache-2.0 | 8,858 |
# -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2017 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... | SylvainCecchetto/plugin.video.catchuptvandmore | plugin.video.catchuptvandmore/resources/lib/channels/be/rtbf.py | Python | gpl-2.0 | 19,074 |
'''
neurosynth: plugin for the deepdive python package
functions for working with neurosynth database
'''
from neurosynth.base.dataset import Dataset
from neurosynth.base.dataset import FeatureTable
from wordfish.plugins.pubmed.functions import get_articles
from neurosynth.analysis import meta
from scipy.stats import... | word-fish/wordfish-plugins | neurosynth/functions.py | Python | mit | 5,917 |
#
# Copyright 2011-2013 Blender Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | Microvellum/Fluid-Designer | win64-vc/2.78/scripts/addons/cycles/presets.py | Python | gpl-3.0 | 2,576 |
import pytz
from datetime import datetime
from catalyst.api import symbol
from catalyst.utils.run_algo import run_algorithm
coin = 'btc'
quote_currency = 'usd'
def initialize(context):
context.symbol = symbol('%s_%s' % (coin, quote_currency))
def handle_data_polo_partial_candles(context, data):
history = d... | enigmampc/catalyst | catalyst/support/issue_274.py | Python | apache-2.0 | 1,075 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('comercial', '0008_auto_20141023_1202'),
]
operations = [
migrations.AddField(
model_name='propostacomercial',
... | dudanogueira/microerp | microerp/comercial/migrations/0009_propostacomercial_tipos.py | Python | lgpl-3.0 | 532 |
from enigma import eConsoleAppContainer
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.ScrollLabel import ScrollLabel
from Components.Sources.StaticText import StaticText
class Console(Screen):
def __init__(self, session, title = "Console", cmdlist = None, finishedCallbac... | sklnet/opendroid-enigma2 | lib/python/Screens/Console.py | Python | gpl-2.0 | 2,566 |
# 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 the hope that it will be useful,
# but... | beagles/sosreport-neutron | __run__.py | Python | gpl-2.0 | 744 |
# Copyright 2016 Battelle Energy Alliance, 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 agre... | idaholab/civet | ci/tests/test_commands.py | Python | apache-2.0 | 15,609 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-24 08:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20170721_1851'),
]
operations = [
migrations.AddField(
... | schiller/cartolafc | core/migrations/0005_partida_rodada.py | Python | mit | 482 |
#!/usr/bin/python2.4
# Copyright 2009, 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... | plxaye/chromium | src/native_client_sdk/src/site_scons/site_tools/component_targets.py | Python | apache-2.0 | 8,395 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import erpnext
import calendar
from erpnext.accounts.utils import get_fiscal_year
from frappe.utils import getdate, nowdat... | njmube/erpnext | erpnext/hr/doctype/salary_slip/test_salary_slip.py | Python | agpl-3.0 | 14,121 |
from guizero import App, Box, Text
from common_test import (
schedule_after_test,
schedule_repeat_test,
destroy_test,
display_test,
color_test,
size_pixel_test,
size_fill_test,
events_test,
cascading_enable_test,
cascading_properties_test,
inheriting_properties_test,
add_... | lawsie/guizero | tests/test_box.py | Python | bsd-3-clause | 2,906 |
from sympy import I, sqrt, log, exp, sin, asin, factorial
from sympy.core import Symbol, S, Rational, Integer, Dummy, Wild, Pow
from sympy.core.facts import InconsistentAssumptions
from sympy import simplify
from sympy.core.compatibility import range
from sympy.utilities.pytest import raises, XFAIL
def test_symbol_u... | sahilshekhawat/sympy | sympy/core/tests/test_assumptions.py | Python | bsd-3-clause | 27,164 |
from pathlib import Path
import unittest
from saw_client import *
from saw_client.llvm import Contract, elem, field, i32, alias_ty
# like test_nested_struct.py but using cute __getitem__ indexing on SetupVals
class FContract1(Contract):
def specification(self):
tp = self.alloc(alias_ty('struct.t'))
... | GaloisInc/saw-script | saw-remote-api/python/tests/saw/test_nested_struct2.py | Python | bsd-3-clause | 1,218 |
import os
from optparse import OptionParser
import pandas as pd
from sklearn.preprocessing import normalize
from ..util import file_handling as fh
from ..util import dirs
def main():
usage = "%prog project lda_output_dir"
parser = OptionParser(usage=usage)
#parser.add_option('--keyword', dest='key', de... | dallascard/guac | core/lda/lda_postprocessing.py | Python | apache-2.0 | 2,175 |
# -*- coding: utf-8 -*-
'''Setup script
'''
import os
from setuptools import setup, find_packages
WORK_DIR = os.path.dirname(os.path.abspath(__file__))
os.chdir(WORK_DIR)
os.sys.path.insert(1, WORK_DIR)
PKG_NAME = os.path.basename(WORK_DIR)
PKG_MOD = __import__(PKG_NAME)
PKG_AUTHOR_NAME, PKG_AUTHOR_EMAIL = PKG_M... | soutys/metricol | setup.py | Python | mit | 1,465 |
#!/usr/bin/env python
#coding:utf-8
# Author: mozman (python version)
# Purpose: avl tree module (Julienne Walker's unbounded none recursive algorithm)
# source: http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx
# Created: 01.05.2010
# Copyright (c) 2010-2013 by Manfred Moitzi
# License: MIT License
... | zdvresearch/fast15-paper-extras | cache-simulator/cache_model_evaluation/bintrees/avltree.py | Python | mit | 10,082 |
# -*- coding: utf-8 -*-
"""
Test formatters:
* behave.formatter.tags.TagsCountFormatter
* behave.formatter.tags.TagsLocationFormatter
"""
from __future__ import absolute_import
from .test_formatter import FormatterTests as FormatterTest
from .test_formatter import MultipleFormattersTests as MultipleFormattersTest
... | jenisys/behave | tests/unit/test_formatter_tags.py | Python | bsd-2-clause | 2,181 |
"""Shared exceptions among the various command line scripts installed here."""
from __future__ import absolute_import, division, print_function, unicode_literals
class MismatchError(Exception):
def __init__(self, subsystem, expected, found):
super(MismatchError, self).__init__()
self.message = "I... | iotile/typedargs | .multipackage/scripts/shared_errors.py | Python | lgpl-3.0 | 2,032 |
import numpy
from ._gouraud_triangles import lib as _gouraud
from ._gouraud_triangles import ffi as _ffi
def _cast(ptype, array):
return _ffi.cast(ptype, array.ctypes.data)
def draw_mask(image_shape, geometry, antialias=False):
"""Draw a mask (0-255) from a given celiagg path. Requires celiagg installed.
... | zplab/zplib | zplib/image/draw.py | Python | mit | 7,001 |
import json
import logging
from uuid import UUID
import zlib
from django.core.cache import cache
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.http import JsonResponse
from django.views.generic import View
from zentral.contrib.inventory.conf import macos_version_from_build
from ze... | zentralopensource/zentral | zentral/contrib/santa/views/api.py | Python | apache-2.0 | 11,377 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 University of Liège
#
# 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
#
# ... | rboman/progs | classes/sph0/louis/build.py | Python | apache-2.0 | 1,413 |
"""
:Created: 16 August 2015
:Author: Lucas Connors
"""
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.views.static import serve
from contest.models import Vote
from contest.views import (
Co... | RevolutionTech/flamingo | flamingo/urls.py | Python | isc | 1,970 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0018_auto_20170505_1531'),
]
operations = [
migrations.AddField(
model_name='syncjob',
... | KerkhoffTechnologies/django-connectwise | djconnectwise/migrations/0019_syncjob_entity_name.py | Python | mit | 461 |
# pylint: disable=missing-docstring,import-error,unused-import,assignment-from-no-return
# pylint: disable=invalid-name, too-few-public-methods, useless-object-inheritance
from __future__ import print_function
from UNINFERABLE import uninferable_func
try:
from functools import singledispatch
except ImportError:
... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/s/singledispatch_functions_py3.py | Python | mit | 1,470 |
__version__ = '3.1.7'
from .lib.main import Sequent
from .lib.sequent_types import SequentError, RunMode, StepReplay, StepStatus
from .lib.utils import or_
STEP_READY = StepStatus.ready # step is ready
STEP_ACTIVE = StepStatus.active # step is active
STEP_SUCCESS = StepStatus.success # step succeeded
STEP_FAILURE ... | Acrisel/sequent | sequent/sequent/__init__.py | Python | mit | 794 |
# Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
import json
# Find your credentials at twilio.com/console
# To set up environmental variables, see http://twil.io/secure
api_key_sid = os.environ['TWILIO_API_KEY']
api_key_secret = os.environ['TWILIO_API_K... | TwilioDevEd/api-snippets | video/rest/compositions/compose-chess/compose-chess.6.x.py | Python | mit | 1,166 |
# -*- coding: utf-8 -*-
from apps.registro.models.ExtensionAulicaConexionInternet import ExtensionAulicaConexionInternet
from apps.registro.models.TipoConexion import TipoConexion
from django.core.exceptions import ValidationError
from django import forms
class ExtensionAulicaConexionInternetForm(forms.ModelForm):
... | MERegistro/meregistro | meregistro/apps/registro/forms/ExtensionAulicaConexionInternetForm.py | Python | bsd-3-clause | 1,222 |
import math
print(math.pi)
from math import *
print(pi)
from math import cos
print(cos(pi))
| lstorchi/teaching | modules/testimport.py | Python | gpl-3.0 | 95 |
def save():
import datetime
from bson import ObjectId
from util.mongodbutil import get_db
db = get_db()
device = db.ebc_device.find_one({"_id": "10279010865051"})
print(device)
obj = {
"_id": "2_oYazTsp2lBjzD_dNoFX17eVGIIcIACCF23576547",
"user_id": "1_oYazTsp2l... | cherrishes/weilai | xingxing/test/dbtest.py | Python | apache-2.0 | 1,375 |
"""Lead interface for scattering models
The only way to create leads is using the :meth:`.Model.attach_lead` method.
The classes represented here are the final product of that process, listed
in :attr:`.Model.leads`.
"""
import numpy as np
import matplotlib.pyplot as plt
from math import pi
from scipy.sparse import cs... | dean0x7d/pybinding | pybinding/leads.py | Python | bsd-2-clause | 7,279 |
# -*-coding: utf-8 -*-
"""
Copyright (c) 2015 by rapidhere, RANTTU. INC. All Rights Reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your optio... | rapidhere/fpjs | fpjs/conv/converter.py | Python | lgpl-3.0 | 13,074 |
#!/usr/bin/env python3
from decimal import Decimal
import http.client
import subprocess
import time
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.blocktools import *
from test_framework.messages import *
from test_framework.mininode import *
from ... | qtumproject/qtum | test/functional/qtum_rpc_bitcore.py | Python | mit | 3,988 |
from django.contrib.sitemaps import Sitemap
from .models import Concert, Artist, Venue
class ConcertSitemap(Sitemap):
changefreq = "daily"
priority = 0.5
def items(self):
return Concert.objects.all()
def lastmod(self, obj):
return obj.modify_date
class ArtistSiteMap(Sitemap):
ch... | suriya/rasikapriya | rasikapriya/sitemaps.py | Python | mit | 770 |
from stt_watson.SttWatsonAbstractListener import SttWatsonAbstractListener
class SttWatsonLogListener(SttWatsonAbstractListener):
def __init__(self):
pass
def listenHypothesis(self, hypothesis):
print "Hypothesis: {0}".format(hypothesis)
def listenPayload(self, payload):
print(u"... | HomeHabbit/stt-watson | stt_watson/SttWatsonLogListener.py | Python | mit | 490 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.