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 |
|---|---|---|---|---|---|
###
# Copyright (c) 2004-2005, Jeremiah Fincher
# 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 co... | ProgVal/Limnoria-test | plugins/Owner/config.py | Python | bsd-3-clause | 2,883 |
import subprocess
import os
import shutil
from urllib.parse import urlparse
import feedparser
import requests
import newspaper
from ffmpy import FFmpeg
feed = feedparser.parse('http://feeds.feedburner.com/iolandachannel')
chapters = []
for entry in feed['entries']:
title = entry['title']
print(f'Parsing: {tit... | julio-vaz/iolanda | main.py | Python | apache-2.0 | 1,453 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': [... | amenonsen/ansible | lib/ansible/modules/database/postgresql/postgresql_user.py | Python | gpl-3.0 | 35,874 |
from __future__ import absolute_import
from builtins import object
from proteus import *
from proteus.default_p import *
from math import *
try:
from .rotation2D import *
except:
from rotation2D import *
from proteus.mprans import NCLS
#import Profiling
LevelModelType = NCLS.LevelModel
logEvent = Profiling.log... | erdc/proteus | proteus/tests/levelset/rotation/ls_rotation_2d_p.py | Python | mit | 6,625 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SpatialDecision
A QGIS plugin
This is a SDSS template for the GEO1005 course
-------------------
begin : 2015-11-02
git... | VagosAplas/GEO1005-Fire | SpatialDecision/utility_functions.py | Python | gpl-2.0 | 32,661 |
# -*- coding: utf-8 -*-
import system_tests
class TestCvePoC(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/138"
filename = "$data_path/007-heap-buffer-over"
commands = ["$exiv2 $filename"]
stdout = [
"""File name : $filename
File size : 331696 By... | AlienCowEatCake/ImageViewer | src/ThirdParty/Exiv2/exiv2-0.27.5-Source/tests/bugfixes/github/test_CVE_2017_14858.py | Python | gpl-3.0 | 1,274 |
"""
decorstate
~~~~~~~~~~
Simple "state machines" with Python decorators.
:copyright: (c) 2015-2017 Andrew Hawker
:license: Apache 2.0, see LICENSE for more details.
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='decorstate',
... | ahawker/decorstate | setup.py | Python | apache-2.0 | 1,177 |
#!/usr/bin/python3
# This file is part of Cockpit.
#
# Copyright (C) 2016 Red Hat, Inc.
#
# Cockpit 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 2.1 of the License, or
# (at your opti... | deryni/cockpit | test/selenium/testlib_avocado/timeoutlib.py | Python | lgpl-2.1 | 8,919 |
from __future__ import unicode_literals
import sys, locale
from dialog import Dialog
import configuration as conf
# This is almost always a good thing to do at the beginning of your programs.
locale.setlocale(locale.LC_ALL, '')
# Initialize a dialog.Dialog instance
d = Dialog(dialog="dialog")
d.set_background_title("... | mmontone/acme | acme/frontend/dialog/cfgdialog.py | Python | mit | 935 |
"""Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
Authors
-------
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/external/ssh/tunnel.py | Python | lgpl-3.0 | 12,285 |
# -*- coding: utf-8 -*-
#
# OpenStack Command Line Client documentation build configuration file, created
# by sphinx-quickstart on Wed May 16 12:05:58 2012.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# aut... | dtroyer/python-openstackclient | doc/source/conf.py | Python | apache-2.0 | 9,014 |
#!/usr/bin/env python
"""Setup script for the pyparsing module distribution."""
from distutils.core import setup
from pyparsing import __version__
setup(# Distribution meta-data
name = "pyparsing",
version = __version__,
description = "Python parsing module",
author = "Paul McGuire",
author_e... | chrisdew/pyparsing-autocomplete | setup.py | Python | mit | 882 |
# 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) any later version.
#
# Invenio is d... | zenodo/invenio | invenio/modules/formatter/format_elements/bfe_arxiv_link.py | Python | gpl-2.0 | 1,776 |
from django.conf.urls.defaults import *
from piston.resource import Resource
from fumblerooski.api.handlers import CollegeHandler, CoachHandler
college_handler = Resource(CollegeHandler)
coach_handler = Resource(CoachHandler)
urlpatterns = patterns('',
url(r'^college/teams/(?P<slug>[^/]+)/$', college_handler),
... | dwillis/fumblerooski | api/urls.py | Python | bsd-3-clause | 371 |
from pyramid.httpexceptions import HTTPSeeOther
from pyramid.response import Response
from weasyl.controllers.decorators import login_required, token_checked
from weasyl.error import WeasylError
from weasyl import (
define, favorite, followuser, frienduser, ignoreuser, note, profile)
# User interactivity functio... | Weasyl/weasyl | weasyl/controllers/interaction.py | Python | apache-2.0 | 6,443 |
#! /usr/bin/python -S
#
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Perform simple librarian operations to verify the current configuration.
"""
from cStringIO import StringIO
import datetime
import sys
import urlli... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/librarian/smoketest.py | Python | agpl-3.0 | 2,205 |
import difflib
import nltk.corpus
arpabet = nltk.corpus.cmudict.dict()
def similarity(A, B):
"""Crude measure of how similar two words sounds."""
total = 0.0
for a, b in zip(A[0], B[0]):
s = difflib.SequenceMatcher(None, a, b)
print(a, b, s.ratio())
total += s.ratio()
return t... | rwindegger/nuclai15 | voice/3_similarity.py | Python | gpl-3.0 | 620 |
import cv2
import numpy as np
import logging
from lib.timing import timing
logger = logging.getLogger(__name__)
class Blob(object):
id = 0
@classmethod
def create(cls, ts, bbox, cxy, img):
blob = cls(ts, bbox, cxy, img)
if blob.desc is None:
return None
return blob
... | MirichST/patchcap | src/daemon/blobs.py | Python | gpl-2.0 | 4,902 |
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils import timezone
from django.utils.encoding import force_str, force_text
from django.utils.func... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/django/views/generic/dates.py | Python | mit | 26,061 |
"""Database of AVR chips for avr_isp programming.
Contains signatures and flash sizes from the AVR datasheets. To support
more chips add the relevant data to the avrChipDB list.
"""
__copyright__ = 'Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License'
avrChipDB = {
'ATMega1280': {
... | Swind/TuringCoffee | src/avr_isp/chipDB.py | Python | mit | 674 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-23 02:11
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | chronossc/notes-app | notes/migrations/0001_initial.py | Python | mit | 993 |
from lxml import etree
from iati import models
from iati.management.commands.total_budget_updater import TotalBudgetUpdater
from re import sub
from django.conf import settings
import time
from datetime import datetime
from deleter import Deleter
import gc
from iati.filegrabber import FileGrabber
from iati_synchroniser.... | bryanph/OIPA | OIPA/iati/parser.py | Python | agpl-3.0 | 70,147 |
"""
Collection of utils for working with the
PCRaster python bindings.
"""
import os.path
import numpy
from math import *
import sys
if sys.version_info[0] == 2 and sys.version_info[1] >=6:
try:
from pcraster import *
from pcraster.framework import *
except:
from PCRas... | openstreams/wflow | doc/plots/pcrut.py | Python | gpl-3.0 | 12,982 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
from src.utils.utils import Dataset, gen_embeddings
from src.EN import EntityNetwork
from src.trainer.train import train
imp... | andreamad8/QDREN | bAbI/run_final.py | Python | mit | 2,986 |
#!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
# create planes
# Create the RenderWindow, Renderer
#
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer( ren )
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# create pipeline
#
pl3d = vtk.vtkMulti... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/Core/Testing/Python/streamSurface2.py | Python | gpl-3.0 | 2,063 |
"""
WSGI config for septimoarte project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | malon/septimoarte | backend/septimoarte/wsgi.py | Python | mit | 399 |
import io
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
import numpy as np
import random
import math
from scipy import optimize
E = 205000.0
L = 2.0 * 1.0e+3
P1 = 400.0 * 1.0e+3
P2 = 200.0 * 1.0e+3
sigma_bar = 235.0
u_ba... | o-kei/design-computing-aij | ch5/truss_SA.py | Python | mit | 2,688 |
#!/usr/bin/python
import requests, os, sys
from pyquery import PyQuery
import subprocess
from distutils import dir_util
url = 'http://downloads.puppetlabs.com/mac/'
req = requests.get(url)
packages = {'puppet': '0', 'facter': '0', 'hiera': '0'}
print 'Checking puppet packages'
for item in PyQuery(url).items('a'):
... | aloyr/system_config_files | lib/getPuppet.py | Python | gpl-3.0 | 2,179 |
from django.contrib.auth.models import User
from django import forms
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput)
class Meta:
model = User
fields = ['username', 'email', 'password']
class LoginForm(forms.ModelForm):
username = forms.CharField(wid... | mbuciora/eWallet | eWallet_app/forms.py | Python | mit | 479 |
"""
Test basic std::pair functionality.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(["libc++"])
@skipIf(compiler=no_match("clang"))
def te... | google/llvm-propeller | lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py | Python | apache-2.0 | 789 |
"""
Based entirely on Django's own ``setup.py`` for now.
"""
from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
class osx_install_data(install_data):
# On MacOS, the platform-specific lib di... | YAmikep/django-feedstorage | setup.py | Python | bsd-3-clause | 3,733 |
from . import Draft
from ... import _tl
from ..._misc import utils, tlobject
class Dialog:
"""
Custom class that encapsulates a dialog (an open "conversation" with
someone, a group or a channel) providing an abstraction to easily
access the input version/normal entity/message etc. The library will
... | LonamiWebs/Telethon | telethon/types/_custom/dialog.py | Python | mit | 4,998 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | rosmo/ansible | lib/ansible/modules/network/fortios/fortios_firewall_wildcard_fqdn_group.py | Python | gpl-3.0 | 9,158 |
input = """
b(1).
a(X) :- b(X).
:- p(X).
"""
output = """
{a(1), b(1)}
"""
| Yarrick13/hwasp | tests/wasp1/AllAnswerSets/rewriting_3a.test.py | Python | apache-2.0 | 76 |
# ~*~ coding: utf-8 ~*~
#
from ops.utils import run_AdHoc
def test_admin_user_connective_manual(asset):
if not isinstance(asset, list):
asset = [asset]
task_tuple = (
('ping', ''),
)
summary, _ = run_AdHoc(task_tuple, asset, record=False)
if len(summary['failed']) != 0:
ret... | choldrim/jumpserver | apps/assets/utils.py | Python | gpl-2.0 | 361 |
"""
Main test configuration, used to fix fixture loading
"""
import pytest
from pytest_ansible_docker import AnsibleDockerTestinfraBackend
@pytest.fixture
def TestinfraBackend(request):
"""
Entry point to boot and stop a docker image.
"""
return AnsibleDockerTestinfraBackend(request)
| infOpen/ansible-role-elasticsearch | conftest.py | Python | mit | 306 |
from Screen import Screen
from Components.ServiceScan import ServiceScan as CScan
from Components.ProgressBar import ProgressBar
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.FIFOList import FIFOList
from Components.Sources.FrontendInfo import FrontendInfo
from Components... | vit2/vit-e2 | lib/python/Screens/ServiceScan.py | Python | gpl-2.0 | 3,943 |
import pytest
from pybind11_tests import exceptions as m
import pybind11_cross_module_tests as cm
def test_std_exception(msg):
with pytest.raises(RuntimeError) as excinfo:
m.throw_std_exception()
assert msg(excinfo.value) == "This exception was intentionally thrown."
def test_error_already_set(msg)... | BYVoid/OpenCC | deps/pybind11-2.5.0/tests/test_exceptions.py | Python | apache-2.0 | 4,922 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-01-11 20:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crm', '0017_auto_20180111_2022'),
]
operations = [
migrations.AlterModelOptions(
... | scaphilo/koalixcrm | koalixcrm/crm/migrations/0018_auto_20180111_2031.py | Python | bsd-3-clause | 2,198 |
from mitmproxy.addons import wsgiapp
from mitmproxy.addons.onboardingapp import app
from mitmproxy import ctx
APP_HOST = "mitm.it"
APP_PORT = 80
class Onboarding(wsgiapp.WSGIApp):
name = "onboarding"
def __init__(self):
super().__init__(app, None, None)
def load(self, loader):
loader.ad... | vhaupert/mitmproxy | mitmproxy/addons/onboarding.py | Python | mit | 1,087 |
#! /usr/bin/python3
import xlrd
from datetime import datetime
import sys
book = xlrd.open_workbook(sys.argv[1])
print(book)
sh = book.sheet_by_index(0)
f = open(sys.argv[2],'w')
for rx in range(sh.nrows):
for cx in range(sh.ncols):
if cx != 0:
f.write(",")
if rx != 0 and (cx == 2 or cx =... | sansna/PythonWidgets.py | xl2csv-date.py | Python | lgpl-3.0 | 556 |
"""star_a_project
Revision ID: c34f4b09ef18
Revises: 8a5d68f74beb
Create Date: 2017-07-07 00:08:18.257075
"""
# revision identifiers, used by Alembic.
revision = 'c34f4b09ef18'
down_revision = '8a5d68f74beb'
from alembic import op
import sqlalchemy as sa
def upgrade():
''' Add a new table to store data about ... | pypingou/pagure | alembic/versions/c34f4b09ef18_star_a_project.py | Python | gpl-2.0 | 1,282 |
# -*- coding: utf-8 -*-
from openerp import models, fields
class product_template(models.Model):
""" Add recurrent_invoice field to product template if it is true,
it will add to related contract.
"""
_inherit = "product.template"
recurring_invoice = fields.Boolean(
string='Recurrent Inv... | ubic135/odoo-design | addons/account_analytic_analysis/product_template.py | Python | agpl-3.0 | 600 |
def add_one_hundred():
again = 'yes'
while again == 'yes':
number = input("Enter a number between 1 and 10: ")
new_number = (int(number) + 100)
print("{} plus 100 is {}!".format(number, new_number))
again = input("Another round, my friend? ('yes' or 'no') ")
print("Goodbye!")... | imajunryou/RealPython2 | debugging/post_mortem_pdb.py | Python | mit | 321 |
#!/usr/bin/env python
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| tomi77/django-chat | manage.py | Python | mit | 195 |
"""
This file should only work on Python 3.6 and newer.
Its purpose is to test a correct installation of Python 3.
"""
from random import randint
print("Generating one thousand random numbers...")
for i in range(1000):
random_number = randint(0, 100000)
print(f"Number {i} was: {random_number}")
| PhantomAppDevelopment/python-getting-started | step-1/myscript.py | Python | mit | 308 |
import inspect
import json
from datetime import timedelta
from logging import getLogger
import pytz
from dateutil.parser import parse
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.serializers import serialize
from django.utils import timezone
from django.db import... | andytwoods/zappa-call-later | zappa-call-later/models.py | Python | mit | 7,289 |
import sys
import os
import numpy as np
import h5py
import multiprocessing
import cPickle
import ephem
import matplotlib.pyplot as plt
import types
from sklearn.gaussian_process import GaussianProcess
from sklearn.cross_validation import train_test_split
from sklearn import metrics, linear_model, tree, ensemble
# NOTE... | acbecker/solar | regress2.py | Python | mit | 10,935 |
#!/usr/bin/env python3
# Copyright 2021 The Kubernetes 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 appl... | monopole/test-infra | hack/analyze-memory-profiles.py | Python | apache-2.0 | 5,404 |
from gene_shapes import Triangle
from gene_shapes import OpenTriangle
import matplotlib.patches as patches
from matplotlib.path import Path
from matplotlib.text import Text
def draw_region(
seq,
start=None,
end=None,
intron_threshold=1,
exon=Triangle(width=1),
intron=Op... | PlummerLab/2015-04-15-AvrRvi5_candidate_synteny | lib/draw_wrappers.py | Python | mit | 16,259 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | elfnor/sverchok | nodes/list_struct/numpy_array.py | Python | gpl-3.0 | 2,901 |
from setuptools import setup, Extension, find_packages
from glob import glob
setup(
name='expresso',
version='0.2',
description='A symbolic expression manipulation library.',
license='MIT',
author='Lars Melchior',
author_email='thelartians@gmail.com',
url='https://github.com/TheLartians/Ex... | TheLartians/Expresso | setup.py | Python | mit | 1,181 |
# livepayload.py
# Live media software payload management.
#
# Copyright (C) 2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version... | kparal/anaconda | pyanaconda/packaging/livepayload.py | Python | gpl-2.0 | 21,271 |
from django.shortcuts import render
def exercise(request, exercise_id):
context = {'exercise_id': exercise_id}
return render(request, 'codes/exercise.html', context)
| akiross/novecode | codes/views.py | Python | mit | 175 |
from django.contrib import admin
from edc_base.constants import DEFAULT_BASE_FIELDS
from edc_model_admin import audit_fieldset_tuple
from .admin_site import edc_identifier_admin
from .models import IdentifierModel
@admin.register(IdentifierModel, site=edc_identifier_admin)
class IdentifierModelAdmin(admin.ModelAdmin... | botswana-harvard/edc-identifier | edc_identifier/admin.py | Python | gpl-2.0 | 1,545 |
# coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | brianrodri/oppia | core/jobs/io/job_io.py | Python | apache-2.0 | 3,620 |
#encoding: utf-8
from django.shortcuts import render,redirect
from django.http import HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate , login , logout
from django.contrib.auth.decorators import login_requ... | fenexomega/Plebicite | Pleby/views.py | Python | gpl-2.0 | 3,748 |
#!/usr/bin/env python3
# Biligrab-Danmaku2ASS
#
# Author: Beining@ACICFG https://github.com/cnbeining
# Author: StarBrilliant https://github.com/m13253
#
# Biligrab is licensed under MIT licence
# Permission has been granted for the use of Danmaku2ASS in Biligrab
#
# Copyright (c) 2014
#
# Permission is hereby granted... | doublehou/BiliDan | bilidan.py | Python | mit | 23,014 |
from sanic import Sanic
import asyncio
from sanic.response import text
from sanic.exceptions import RequestTimeout
from sanic.config import Config
Config.REQUEST_TIMEOUT = 1
request_timeout_app = Sanic('test_request_timeout')
request_timeout_default_app = Sanic('test_request_timeout_default')
@request_timeout_app.ro... | Tim-Erwin/sanic | tests/test_request_timeout.py | Python | mit | 1,104 |
from alvi.client.scenes.create_tree import CreateTree
class TraverseTreeDepthFirst(CreateTree):
def traverse(self, marker, tree, node):
marker.append(node)
tree.stats.traversed_nodes += 1
tree.sync()
for child in node.children:
self.traverse(marker, tree, child)
de... | alviproject/alvi | alvi/client/scenes/traverse_tree_depth_first.py | Python | mit | 588 |
# -*- coding: utf-8 -*-
"""
================================================
Source localization with a custom inverse solver
================================================
The objective of this example is to show how to plug a custom inverse solver
in MNE in order to facilate empirical comparison with the methods M... | mne-tools/mne-tools.github.io | stable/_downloads/cf4ca70961fa0e58ffb73038d9d66b21/custom_inverse_solver.py | Python | bsd-3-clause | 6,340 |
''' main.py '''
import logging
import os
import sys
import tornado.ioloop
import tornado.escape
import tornado.web
from heron.common.src.python.utils import log
RESULTS_DIRECTORY = "results"
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Heron integration-test helper")
class FileHan... | streamlio/heron | integration_test/src/python/http_server/main.py | Python | apache-2.0 | 3,237 |
from datetime import datetime
from grazyna.utils import register
@register(cmd='weekend')
def weekend(bot):
"""
Answer to timeless question - are we at .weekend, yet?
"""
current_date = datetime.now()
day = current_date.weekday()
nick = bot.user.nick
if day in (5, 6):
answer = "Ocz... | firemark/grazyna | grazyna/plugins/weekend.py | Python | gpl-2.0 | 562 |
from Converter import Converter
from Components.Element import cached
from time import localtime, strftime
from Components.config import config
class StandbyClockVFD(Converter, object):
def __init__(self, type):
Converter.__init__(self, type)
self.seg = 0
self.type = 1
@cached
def getText(self):
time... | OpenSPA/dvbapp | lib/python/Components/Converter/StandbyClockVFD.py | Python | gpl-2.0 | 986 |
"""
Samplers create images from generators.
"""
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f)]
| 255BITS/HyperGAN | hypergan/samplers/__init__.py | Python | mit | 213 |
#!/usr/bin/env python
#
# Print the aliases of buddies who have a buddy-icon set.
#
# Purple is the legal property of its developers, whose names are too numerous
# to list here. Please refer to the COPYRIGHT file distributed with this
# source distribution.
#
# This program is free software; you can redistribute it a... | An-HwiHoon/PCClient | pidgin-2.10.11/libpurple/plugins/dbus-buddyicons-example.py | Python | gpl-2.0 | 1,437 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('codecompetitions', '0006_auto_20140805_2234'),
]
operations = [
migrations.AddField(
model_name='problem',
... | baryon5/mercury | codecompetitions/migrations/0007_auto_20140805_2253.py | Python | gpl-2.0 | 1,067 |
from . import Resource
class ServiceOffering(Resource):
"""
A representation of a service offering
Args:
base (base): See :py:class:`nflex_connector_utils.resource.Resource` for common resource args.
type_id: Type of service offering. Free text.
""" # noqa
def _... | ntt-nflex/nflex_connector_utils | nflex_connector_utils/service_offering.py | Python | gpl-2.0 | 779 |
#! /usr/bin/python
import os
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
import sys
sys.path.append(SCRIPT_PATH + '/../src')
import subprocess
import multiprocessing
import shutil
import basicdefines
ASSEMBLER_URL = 'http://sourceforge.net/projects/soapdenovo2/files/SOAPdenovo2/bin/r240/SOAPdenovo2-b... | kkrizanovic/NanoMark | wrappers-other/wrapper_soap.py | Python | mit | 5,413 |
#/usr/bin/env python
# coding: utf-8
"""
Python experiment for minifying and concatenation of css + js files
"""
# meta data
__title__ = 'Minipy'
__description__ = 'Minifying and concatenation of css + js files'
__version__ = '0.1'
__author__ = 'Anders Aarvik'
__license__ = 'MIT'
| adionditsak/Minipy | minipy/__init__.py | Python | mit | 288 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information.py | Python | mit | 1,856 |
# --------------------------------------------------------
# Fully Convolutional Instance-aware Semantic Segmentation
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Guodong Zhang
# --------------------------------------------------------
# Based on:
# MX-RCNN
# C... | msracver/FCIS | fcis/operator_py/box_annotator_ohem.py | Python | mit | 4,925 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-notebooks | samples/generated_samples/notebooks_v1beta1_generated_notebook_service_delete_instance_async.py | Python | apache-2.0 | 1,595 |
from buildpal_client import compile as buildpal_compile
import os
import subprocess
import asyncio
import sys
import struct
import threading
import pytest
from buildpal.common import MessageProtocol
class ProtocolTester(MessageProtocol):
@classmethod
def check_exit_code(cls, code):
if ... | pkesist/buildpal | Python/test/test_client.py | Python | gpl-3.0 | 4,561 |
# Version: 0.18
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
* [![Latest Version]
... | jtwhite79/pyemu | versioneer.py | Python | bsd-3-clause | 68,612 |
from datetime import datetime
import re
from custom.ilsgateway.tanzania.handlers.keyword import KeywordHandler
from custom.ilsgateway.models import SupplyPointStatusValues, SupplyPointStatus, SupplyPointStatusTypes
from custom.ilsgateway.tanzania.reminders import SUPERVISION_HELP, SUPERVISION_CONFIRM_NO, SUPERVISION_C... | qedsoftware/commcare-hq | custom/ilsgateway/tanzania/handlers/supervision.py | Python | bsd-3-clause | 1,376 |
# -*- coding: utf-8 -*-
# © 2016 AvanzOsc (http://www.avanzosc.es)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class MrpProductProduceLine(models.TransientModel):
_inherit = 'mrp.product.produce.line'
allow_locked = fields.Boolean(string='All... | akretion/stock-logistics-workflow | mrp_lock_lot/wizard/mrp_product_produce.py | Python | agpl-3.0 | 731 |
import itertools
def gap(T, R):
print("gap " + str(T) + " " + R)
all_results = set()
for i in range(1, len(T)+1):
for T_part in itertools.combinations(T, i):
if (len(T_part) == 1):
all_results.add(T_part[0])
else:
pass
min_res = 1
wh... | mariusj/contests | criteo12/test.py | Python | unlicense | 708 |
''' rdforest.py
# Author : Shivam Chaturvedi
# Created : 10:25 PM, 9th September 2013
# Last Modified : 03:39 AM, 10th September 2013
# Purpose : [Machine Learning] Random Decision Forest Implementation (using ID3 classifier [by Shivam Chaturvedi])
# Copyright : (C) 2013
'''
from builddt import *
from random im... | devs4v/DecisionTreeAndRDF | rdforest.py | Python | mit | 3,280 |
# This script creates a Windows .def file containing all the functions
# and static class variables to be exported by a DLL. The symbols are
# extracted from the output of dumpbin.
#
# To use this script, first generate a normal .lib library file, with
# no special command line options. Then create a .def file with thi... | amonmoce/corba_examples | omniORB-4.2.1/bin/scripts/makedeffile.py | Python | mit | 3,552 |
import os
import os.path as osp
import unittest
import platform
from docido_sdk.toolbox.contextlib_ext import (
mkstemp,
popen,
pushd,
restore_dict_kv,
tempdir,
)
class TestRestoreDictKV(unittest.TestCase):
def test_unknown_key(self):
d = {'a': 'b'}
with restore_dict_kv(d, 'UN... | cogniteev/docido-python-sdk | tests/test_contextlib_ext.py | Python | apache-2.0 | 2,052 |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2002-2018, Neo4j
#
# 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... | nigelsmall/cypy | test/graph/test_path.py | Python | gpl-3.0 | 3,271 |
#!/usr/bin/env python3
import frontend
import shutil
from dmm import *
from collections import defaultdict
def merge_map(new_map, old_map, delete_unused=False):
if new_map.key_length != old_map.key_length:
print("Warning: Key lengths differ, taking new map")
print(f" Old: {old_map.key_length}")
... | Iamgoofball/-tg-station | tools/mapmerge2/mapmerge.py | Python | agpl-3.0 | 3,540 |
# Generated by Django 2.2.9 on 2020-01-26 18:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bom', '0031_auto_20200104_1352'),
]
operations = [
migrations.RenameField(
model_name='manufacturerpart',
old_name='... | mpkasp/django-bom | bom/migrations/0032_auto_20200126_1806.py | Python | gpl-3.0 | 678 |
# -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org>
#
# 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 Foundatio... | phoebusliang/parallel-lettuce | tests/integration/test_couves.py | Python | gpl-3.0 | 1,700 |
#!/usr/bin/env python
from python.decorators import euler_timer
def inc_or_dec(n):
digs = [dig for dig in str(n)]
if sorted(digs) == digs:
return True
elif sorted(digs) == digs[::-1]:
return True
else:
return False
def main(verbose=False):
n = 21780
B = 19602 # 90%
... | dhermes/project-euler | python/complete/no112.py | Python | apache-2.0 | 501 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-02 16:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0066_auto_20160123_1610'),
]
operations = [
migrations.AddField(... | n2o/guhema | products/migrations/0067_auto_20160202_1651.py | Python | mit | 1,528 |
# Copyright 2016 Bridgewater Associates
#
# 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 appli... | Netflix/security_monkey | security_monkey/watchers/vpc/networkacl.py | Python | apache-2.0 | 3,808 |
# -*- 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... | omprakasha/odoo | addons/purchase/purchase.py | Python | agpl-3.0 | 92,732 |
# Copyright 2021 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, ... | google-research/DBAP-algorithm | third_party/rlkit_library/rlkit/torch/sac/policies/policy_from_q.py | Python | apache-2.0 | 1,875 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import locale
import os
from codecs import open
from shutil import copy, rmtree
from tempfile import mkdtemp
from pelican.generators import (ArticlesGenerator, Generator, PagesGenerator,
StaticGenerator, TemplatePagesGene... | zackw/pelican | pelican/tests/test_generators.py | Python | agpl-3.0 | 39,179 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/SHH_WT_models_highres32152.py | Python | gpl-3.0 | 88,232 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | Comunitea/CMNT_00040_2016_ELN_addons | master_procurement_schedule/master_procurement_schedule.py | Python | agpl-3.0 | 29,317 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from couchbase.bucket import Bucket
from multiprocessing import Process
from geoip import geolite2
import requests
import datetime
import ConfigParser
import couchbase
import sqlite3
import time
import os
import hashlib as h
class Db(object):
def __init__(self, method)... | yigitbasalma/EQL | source/eql.py | Python | mit | 14,406 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | kayhayen/Nuitka | tests/benchmarks/constructs/CallCompiledFunctionKwArgsVariable.py | Python | apache-2.0 | 1,532 |
def _reset_sys_path():
# Clear generic sys.path[0]
import sys, os
resources = os.environ['RESOURCEPATH']
while sys.path[0] == resources:
del sys.path[0]
_reset_sys_path()
"""
sys.argv emulation
This module starts a basic event loop to collect file- and url-open AppleEvents. Those get
converte... | alset333/NetworkedLearningChatbot | PeterMaar-NetLrnChatBot/Client/PeterMaarNetworkedChatClientGUI.app/Contents/Resources/__boot__.py | Python | bsd-3-clause | 11,026 |
class TestBot():
"""
Test bot that "messages" players on terminal.
"""
def message_players(self, uids, message):
for uid in uids:
print(str(uid) + ': ' + message)
| dramborleg/text-poker | testbot.py | Python | bsd-2-clause | 200 |
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from itertools import product
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn... | BiaDarkia/scikit-learn | sklearn/linear_model/tests/test_ridge.py | Python | bsd-3-clause | 31,078 |
import os
__version__ = "2020.2.3"
decide_base_path = os.path.dirname(os.path.abspath(__file__))
log_filename = os.path.join(decide_base_path, "decide.log")
data_folder = os.path.join(decide_base_path, "..", "data")
input_folder = os.path.join(data_folder, "input")
| foarsitter/equal-gain-python | decide/__init__.py | Python | gpl-3.0 | 270 |
"""empty message
Revision ID: 418982ee27e2
Revises: 0ac4b88c909f
Create Date: 2017-05-02 12:05:13.995805
"""
# revision identifiers, used by Alembic.
revision = '418982ee27e2'
down_revision = '0ac4b88c909f'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
... | uwcirg/true_nth_usa_portal | portal/migrations/versions/418982ee27e2_.py | Python | bsd-3-clause | 2,885 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.