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 |
|---|---|---|---|---|---|
from setuptools import setup, find_packages
setup(name='BIOMD0000000322',
version=20140916,
description='BIOMD0000000322 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/BIOMD0000000322',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/BIOMD0000000322 | setup.py | Python | cc0-1.0 | 377 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-19 15:22
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 = [
('caffe',... | VirrageS/io-kawiarnie | caffe/hours/migrations/0001_initial.py | Python | mit | 2,243 |
#! /usr/bin/env python
import sys
import os
sys.path.append(os.path.join('..', '..'))
import unittest
from ibe.commons import gen_public_key
class Test(unittest.TestCase):
def test_gen_public_key(self):
pkey1 = gen_public_key('a@a.com', 'pkg public key 1')
pkey2 = gen_public_key('b@b.com', 'pkg pu... | lucasperin/IBE | ibe/test/test.py | Python | mit | 673 |
from django.contrib import admin
'''from tester.models import Club,Member,Signup,Event
class admin_club(admin.ModelAdmin):
list_display=["club_name"]
class admin_event(admin.ModelAdmin):
list_display=["event_name"]
class admin_student(admin.ModelAdmin):
list_display=["usn","name"]
class admin_membe... | anirudhagar13/PES-Portal | pes_portal/club/admin.py | Python | apache-2.0 | 548 |
#!/usr/bin/python3
from gi.repository import Gio, GObject
from SettingsWidgets import *
from TreeListWidgets import List
import collections
import json
import operator
CAN_BACKEND.append("List")
JSON_SETTINGS_PROPERTIES_MAP = {
"description" : "label",
"min" : "mini",
"max" : "maxi"... | collinss/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/bin/JsonSettingsWidgets.py | Python | gpl-2.0 | 11,380 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmLocatorFilter.py
-------------------------
Date : May 2017
Copyright : (C) 2017 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
******... | stevenmizuno/QGIS | python/plugins/processing/gui/AlgorithmLocatorFilter.py | Python | gpl-2.0 | 3,785 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Rocky Bernstein
#
# 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 vers... | pombreda/pydbgr | trepan/bwprocessor/command/mock.py | Python | gpl-3.0 | 3,931 |
import unittest
class TestAction(unittest.TestCase):
def test_execute_action(self):
from coopy.foundation import Action, RecordClock
from datetime import datetime
from coopy.utils import inject
class Dummy(object):
def __init__(self):
self.exec_count = 0... | felipecruz/coopy | tests/unit/test_foundation.py | Python | bsd-3-clause | 2,547 |
#!python
import sys
import io
import re
import urllib
import urllib2
import urlparse
import lxml.etree
def get_outlinks(url):
'''
url: the url to the page to crawl
'''
result = []
if url is None:
return result
html = None
resp = None
try:
url = url.strip()
resp = url... | ecologylab/BigSemanticsService | Scripts/utils/crawl.py | Python | apache-2.0 | 3,552 |
import numpy as np
import pytest
import pandas as pd
from pandas import (
MultiIndex,
Series,
)
import pandas._testing as tm
@pytest.mark.parametrize("operation, expected", [("min", "a"), ("max", "b")])
def test_reductions_series_strings(operation, expected):
# GH#31746
ser = Series(["a", "b"], dtype... | pandas-dev/pandas | pandas/tests/series/test_reductions.py | Python | bsd-3-clause | 3,878 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: uploader
Author: David Leclerc
Version: 0.1
Date: 01.07.2017
License: GNU General Public License, Version 3
(http://www.gnu.org/licens... | mm22dl/MeinKPS | uploader.py | Python | gpl-3.0 | 3,745 |
# Copyright 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 agreed to in... | takeshineshiro/keystone | keystone/tests/unit/test_auth.py | Python | apache-2.0 | 61,769 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Visibility analysis for QGIS (**to be installed in ViewshedAnalysis folder**)
-------------------
begin : 2018-03-18
cop... | zoran-cuckovic/QGIS-visibility-analysis | visibility_plugin.py | Python | gpl-3.0 | 2,064 |
# python
from datetime import datetime
import time
# sql
from sqlalchemy import create_engine
from sqlalchemy.sql.expression import ClauseElement, desc
from sqlalchemy.orm import relationship, backref, scoped_session, sessionmaker
from sqlalchemy import (Column, Integer, String, Table,
DateTime... | rmcgibbo/webstat | webstat/models.py | Python | gpl-3.0 | 6,995 |
# Copyright (c) 2012 - 2014 EMC Corporation, 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
#
# ... | hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | volume/drivers/emc/emc_cli_fc.py | Python | apache-2.0 | 8,684 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-15 23:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | tassolom/twq-app | api/users/migrations/0001_initial.py | Python | mit | 1,356 |
class SASTask:
def __init__(self, variables, init, goal, operators, axioms, metric):
self.variables = variables
self.init = init
self.goal = goal
self.operators = operators
self.axioms = axioms
self.metric = metric
def output(self, stream):
print >> stream, "begin_metric"
print >> st... | dpattiso/igraph | lama/translate/sas_tasks.py | Python | gpl-2.0 | 3,804 |
from django.shortcuts import render
def index(request):
return render(request, 'index.html', {
})
| robrocker7/h1z1map | server/common/views.py | Python | apache-2.0 | 111 |
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
# create our little application :)
app = Flask(__name__)
app.config.from_object(__name__)
# Load default config and override config from an environment variable
app.config.update(dict(
DA... | steelium/wardkeeper | wardkeeper/flaskr.py | Python | mit | 2,571 |
from django.shortcuts import render, redirect, get_object_or_404
from miniURL.models import Redirection
from miniURL.forms import RedirectionForm
from django.core.paginator import Paginator
# Create your views here.
from numpy.core.umath import minimum
#def home(request):
# urls = Redirection.objects.all().order_... | guillaume-havard/testdjango | sitetest/miniURL/views.py | Python | mit | 3,277 |
import numpy as np
from numpy import linalg as la
import time
import subprocess
from streaming import Oja
from streaming import BlockOrthogonal
import MovieLens
if __name__ == "__main__":
#oja=Oja(Ceta=1e-3,k=1,stream=MovieLens.UserStream())
boi1=BlockOrthogonal(k=1,stream=MovieLens.User... | mitliagkas/pyliakmon | main.py | Python | mit | 931 |
from stard.services import BaseService
class Service(BaseService):
def init_service(self):
self.children = {self.service('child')}
| DexterLB/stard | src/stard/test_samples/father.py | Python | mit | 144 |
from dnfpy.core.constantMap import ConstantMap
import unittest
import numpy as np
from rsdnfMap import RsdnfMap
import dnfpy.view.staticViewMatplotlib as view
class RsdnfMapTestSequence(unittest.TestCase):
def setUp(self):
self.size = 51
self.activation = np.zeros((self.size,se... | bchappet/dnfpy | src/test_dnfpy/cellular/rsdnfMapTest2.py | Python | gpl-2.0 | 4,424 |
from paypalrestsdk import BillingAgreement
import logging
BILLING_AGREEMENT_ID = "I-HT38K76XPMGJ"
try:
billing_agreement = BillingAgreement.find(BILLING_AGREEMENT_ID)
print("Billing Agreement [%s] has state %s" % (billing_agreement.id, billing_agreement.state))
suspend_note = {
"note": "Suspendin... | stafur/pyTRUST | paypal-rest-api-sdk-python/samples/subscription/billing_agreements/suspend_and_re_activate.py | Python | apache-2.0 | 1,184 |
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
"""
Run the Rez GUI application.
"""
def setup_parser(parser, completions=False):
parser.add_argument(
"--diff", nargs=2, metavar=("RXT1", "RXT2"),
help="open in diff mode with the given contexts")
FILE_action ... | nerdvegas/rez | src/rez/cli/gui.py | Python | apache-2.0 | 648 |
import discord
from asyncio import TimeoutError
from database.model import NHLTeams, NHLPlayers
from datetime import datetime
from rapidfuzz import process
from utilities.format import format_list
from utilities.request import fetch
class Game:
__slots__ = (
'status',
'home_id',
'home_name... | braycarlson/viking | utilities/nhl.py | Python | mit | 15,534 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 University of Southern California
#
# 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/... | tylertian/Openstack | openstack F/nova/nova/tests/baremetal/test_tilera.py | Python | apache-2.0 | 3,342 |
#Author: Damodar Rajbhandari
#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plot
from random import *
L = 10
"""
This represents, there are "L" (eg. 3) either in
one row or column. Hence,
Total sites = L*L
"""
for i in range(L):
for j in range(L):
if randint(0, 1) > 0.5:
plot.scatter(i... | Damicristi/Ising-Model-in-2D | Tools/Initialize_lattice_plot.py | Python | gpl-3.0 | 547 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 applicable law o... | ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/endpoints-1.0/endpoints/apiserving.py | Python | lgpl-3.0 | 18,737 |
# Copyright (C) 2009-2015 Contributors as noted in the AUTHORS file
#
# This file is part of Autopilot.
#
# Autopilot 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 y... | rogerlindberg/autopilot | src/lib/guinatives/ctrlfinder.py | Python | gpl-3.0 | 11,309 |
"""
radish
~~~~~~
The root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import sys
from pathlib import Path
import click
import colorful as cf
from radish.config import Config
from radish.terrain import world
fro... | radish-bdd/radish | src/radish/parser/__main__.py | Python | mit | 2,847 |
# -*- coding: utf-8 -*-
# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import re
from datetime import datetime
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.excep... | fnp/django-migdal | migdal/models.py | Python | agpl-3.0 | 7,640 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from functools import partial
from PyQt5 import QtWidgets, QtCore
from controller.gensec.dialogs.processes.information import Information
from view.dialogs.base_dialog import BaseDialog
from view.gensec.dialogs.processes.ui_posl ... | carlos-ferras/Sequence-ToolKit | controller/gensec/dialogs/processes/posl.py | Python | gpl-3.0 | 6,732 |
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... | maui-packages/qt-creator | tests/system/suite_QMLS/tst_QMLS01/test.py | Python | lgpl-2.1 | 6,329 |
#!/usr/bin/env python
## \file set_ffd_design_var.py.py
# \brief Python script for automatically generating a list of FFD variables.
# \author T. Economon, F. Palacios
# \version 4.0.0 "Cardinal"
#
#
# SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
# Dr. Thomas D... | huahbo/SU2 | SU2_PY/set_ffd_design_var.py | Python | lgpl-2.1 | 5,373 |
# -*- coding: utf-8 -*-
import pycurl
import re
import time
from module.common.json_layer import json_loads
from module.plugins.internal.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class RapiduNet(SimpleHoster):
__name__ = "RapiduNet"
__type__ ... | Zerknechterer/pyload | module/plugins/hoster/RapiduNet.py | Python | gpl-3.0 | 2,781 |
import os
import sys
import math
import time
import random
import bintrees
import blist
import btree
import BTrees.OOBTree
sys.path.extend(['..', '../..'])
import banyan
import _src
def _bintrees(es):
t = bintrees.FastRBTree([(e, None) for e in es])
def _blist(es):
t = blist.sortedset(es)
def _set(es):
... | pyannote/pyannote-banyan | performance_tests/_set_create.py | Python | bsd-3-clause | 1,814 |
from urllib.request import urlopen
import urllib.error
import twurl
import json
import sqlite3
TWITTER_URL = 'https://api.twitter.com/1.1/friends/list.json'
conn = sqlite3.connect('spider.sqlite')
cur = conn.cursor()
cur.execute('''
CREATE TABLE IF NOT EXISTS Twitter
(name TEXT, retrieved INTEGER, friends INTEG... | mkhuthir/learnPython | Book_pythonlearn_com/twitter/twspider.py | Python | mit | 1,781 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, absolute_import
"""
This module implements classes for reading and generating Lammps inputset.
For the ease of management we divide LAMMPS in... | johnson1228/pymatgen | pymatgen/io/lammps/sets.py | Python | mit | 4,785 |
# Generated by Django 2.2.13 on 2020-06-26 20:53
from django.db import migrations, models
import django.db.models.deletion
# This migration will remove the default='H' kwarg from the `coordinate_acquisition_code` field
# definition on ActivitySubmission. This default 'H' value is used when creating a new
# ActivitySu... | bcgov/gwells | app/backend/wells/migrations/0117_no_default_coord_code_20200626_2053.py | Python | apache-2.0 | 5,606 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NetApp, 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.or... | tomasdubec/openstack-cinder | cinder/tests/test_netapp_nfs.py | Python | apache-2.0 | 21,262 |
class MutableValue:
"""
Used to avoid warnings (and in future errors) from aiohttp when the app context is modified.
"""
__slots__ = 'value',
def __init__(self, value=None):
self.value = value
def change(self, new_value):
self.value = new_value
def __len__(self):
... | samuelcolvin/aiohttp-devtools | aiohttp_devtools/runserver/utils.py | Python | mit | 732 |
# -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | tseaver/google-cloud-python | automl/tests/unit/gapic/v1beta1/test_tables_client_v1beta1.py | Python | apache-2.0 | 58,104 |
# Copyright (C) 2011-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | adam-iris/mailman | src/mailman/app/events.py | Python | gpl-3.0 | 1,804 |
import datetime
from ansible.runner import Runner
from ansible import constants
from bson import ObjectId
from celery import Celery
from celery.exceptions import SoftTimeLimitExceeded
from celery_redis_sentinel import register
import spot.tasks.celeryconfig
from spot.spotconfig import SpotConfig
from spot.spotutils i... | Shaps/spot | spot/tasks/__init__.py | Python | gpl-3.0 | 7,266 |
from juju.lib.testing import TestCase
from juju.state.endpoint import RelationEndpoint
class RelationEndpointTest(TestCase):
def test_may_relate_to(self):
# TODO: Needs a doc string
mysql_ep = RelationEndpoint("mysqldb", "mysql", "db", "server")
blog_ep = RelationEndpoint("blog", "mysql",... | anbangr/trusted-juju | juju/state/tests/test_endpoint.py | Python | agpl-3.0 | 1,469 |
# -*- coding: utf-8 -*-
# Copyright 2017 DST Controls
#
# 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 ... | dstcontrols/osisoftpy | src/osisoftpy/elements.py | Python | apache-2.0 | 1,714 |
"""
Copyright (C) 2010-2013, Ryan Fan
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... | rfancn/myprojects | analyzesr/srInfo.py | Python | mit | 891 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-18 17:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('training', '0008_remove_challenge_terminal_password'),
]
operations = [
migr... | pattyjogal/wy_ctf_website | wy_ctf_website/training/migrations/0009_challenge_will.py | Python | mit | 469 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the PyNeurActiv project, which aims at providing tools
# to study and model the activity of neuronal cultures.
# Copyright (C) 2017 SENeC Initiative
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | SENeC-Initiative/PyNeurActiv | analysis/bayesian_blocks.py | Python | gpl-3.0 | 13,573 |
00000 0 output/evolve2.py.err
00000 0 output/evolve2.py.out
53974 2 output/evolve2.py.series
| Conedy/Conedy | testing/dynNetwork/expected/sum_evolve2.py | Python | gpl-2.0 | 105 |
__author__ = 'TPei'
from tkinter import *
from data.manager import *
from data.DataHandler import DataHandler
class App:
def __init__(self, master):
master.wm_title("Jawbone Visualizer")
self.button_width = 25
self.description = Label(master, text="Please choose a visualization mode:")
... | TPei/jawbone_visualizer | main_gui.py | Python | mit | 3,797 |
# Copyright (C) 2016 Noah Meltzer
#
# 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 t... | nmGit/MView | MNodeEditor/MNodes/MDeviceNode.py | Python | gpl-3.0 | 3,749 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2012,2013 Contributor
#
# 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
#... | jrha/aquilon | lib/python2.6/aquilon/worker/commands/update_address.py | Python | apache-2.0 | 3,917 |
# -*- coding: utf-8 -*-
"""
Set up or update Jenkins Jobs
=============================
Update Jenkins jobs for GitHub repositories.
"""
#########################################
# import
import sys
import os
from pyquickhelper.loghelper import get_keyword
#########################################
# logging
from p... | sdpython/ensae_teaching_cs | _doc/examples/automation/jenkins_setup.py | Python | mit | 1,450 |
# Copyright (c) 2013 David Holm <dholmster@gmail.com>
# This file is part of SimpleGUITk - https://github.com/dholm/simpleguitk
# See the file 'COPYING' for copying permission.
from .plot import plot_lines
| dholm/simpleguitk | simpleplot/__init___flymake.py | Python | bsd-3-clause | 207 |
"""Unit tests for the solve function on manifolds
embedded in higher dimensional spaces."""
# Copyright (C) 2012 Imperial College London and others.
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | maciekswat/dolfin_1.3.0 | test/unit/fem/python/manifolds.py | Python | gpl-3.0 | 10,270 |
#!/usr/bin/env python
import smtplib
import os
import ConfigParser
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
confpath = os.path.dirname(__file__)
config = ConfigParser.ConfigParser()
config.read(confpath + "/sendmail.conf")
def sendmail(subject=None,strmsg=None):
'''
... | romeroj1/potential-batman | scripts/python/sendemail.py | Python | apache-2.0 | 1,831 |
"""
Local settings for nomadgram project.
- Run in Debug mode
- Use mailhog for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TE... | bokjk/nomadgram | config/settings/local.py | Python | mit | 1,897 |
# -*- 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-dialogflow-cx | samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_sync.py | Python | apache-2.0 | 1,554 |
# -*- coding: utf-8 -*-
"""Preprocessing related functions and classes for testing."""
from artifacts import reader as artifacts_reader
from artifacts import registry as artifacts_registry
from dfvfs.helpers import fake_file_system_builder
from dfvfs.helpers import file_system_searcher
from dfvfs.lib import definition... | joachimmetz/plaso | tests/preprocessors/test_lib.py | Python | apache-2.0 | 5,825 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import crm_lead
from . import mailing_mailing
from . import utm
| jeremiahyan/odoo | addons/mass_mailing_crm/models/__init__.py | Python | gpl-3.0 | 171 |
#!/usr/bin/python
# Copyright 2012 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 by applic... | pnakka/googlecrisismap | index_test.py | Python | apache-2.0 | 2,127 |
"""
Render a set of GeoTIFF files to images.
Stretched renderers may have one of the following colormap values:
1.0 (absolute)
max (calculate max across datasets)
0.5*max (calculate max across datasets, and multiply by value)
"""
import importlib
import os
import glob
import click
import json
import numpy
from PIL.I... | consbio/clover | trefoil/cli/render_tif.py | Python | bsd-3-clause | 13,680 |
# 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 u... | Acehaidrey/incubator-airflow | airflow/providers/apache/livy/hooks/livy.py | Python | apache-2.0 | 15,883 |
# coding: utf-8
from getpass import getpass
class CLIInput():
def get_user_name(self):
return input('user name: ')
def get_password(self):
return getpass()
def entry_selector(self, entries):
if not entries:
return None, None
titles = list(entries.keys())
... | meganehouser/pww | pww/inputs.py | Python | mit | 1,117 |
""" Utilities to fuse trees and wheels
To "fuse" is to merge two binary libraries of different architectures - see
func:`delocate.tools.lipo_fuse`.
The procedure for fusing two trees (or trees in wheels) is similar to updating
a dictionary. There is a lhs of an update (fuse) called ``to_tree`` and a rhs
called ``fro... | matthew-brett/delocate | delocate/fuse.py | Python | bsd-2-clause | 3,819 |
"""Support for views."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable
from http import HTTPStatus
import json
import logging
from typing import Any
from aiohttp import web
from aiohttp.typedefs import LooseHeaders
from aiohttp.web_exceptions import (
HTTPBadReq... | jawilson/home-assistant | homeassistant/components/http/view.py | Python | apache-2.0 | 5,288 |
# Copyright 2018 ACSONE SA/NV
# Copyright 2019 Eficent and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import date, timedelta
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class SaleOrder(models.Model):
_inherit ... | OCA/sale-workflow | sale_blanket_order/models/sale_orders.py | Python | agpl-3.0 | 6,042 |
import random
number = random.randint(1,100)
def guessAgain():
i = input("Again? y/n ")
i = i.lower()
if i == "y":
return True
elif i == "n":
return False
else:
print("I don't understand? Try y or n.")
return None
pr... | disasterisk/itc110 | guess.py | Python | mit | 1,117 |
"""
Copyright 2009, Red Hat, Inc and Others
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... | spotify/cobbler | tests/mgmtclass_test.py | Python | gpl-2.0 | 1,286 |
# =============================================================================
# Copyright [2013] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code provided. Consult the ... | cloudnull/tribble-api | tribble/info.py | Python | gpl-3.0 | 903 |
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
# init contact creations
wd.find_element_by_link_text("add new").click()
# fill contact form
self.fill_contact_... | sabinaczopik/python_training | fixture/contact.py | Python | apache-2.0 | 7,165 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-03 19:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dmax_website', '0009_auto_20160103_1911'),
]
operations = [
migrations.RenameField(
... | maxwelld90/personal_web | django_project/personal_web/dmax_website/migrations/0010_auto_20160103_1917.py | Python | gpl-2.0 | 457 |
# -*- coding: utf-8 -*-
{
'!=': '!=',
'!langcode!': 'it',
'!langname!': 'Italiano',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati ... | dbmi-pitt/EvidenceType-Calculator | source/evidence_type_calculator/languages/it.py | Python | apache-2.0 | 12,432 |
from django.core.validators import RegexValidator
from django.db import models
from event.models import Event
class Job(models.Model):
id = models.AutoField(primary_key=True)
event = models.ForeignKey(Event)
name = models.CharField(
max_length=75,
validators=[
RegexValidator(
... | willingc/vms | vms/job/models.py | Python | gpl-2.0 | 675 |
#!/usr/bin/python3
"""
Script to check recently uploaded files.
This script checks if a file description is present and if there are other
problems in the image's description.
This script will have to be configured for each language. Please submit
translations as addition to the Pywikibot framework.
Everything that ... | wikimedia/pywikibot-core | scripts/checkimages.py | Python | mit | 76,106 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | bobobox/ansible | lib/ansible/plugins/callback/default.py | Python | gpl-3.0 | 13,893 |
"Example of application main using import."
import mymodule
import mypkg
from mypkg import pkg_mod
print(__doc__)
print(mymodule.fun())
print(mypkg.f1())
print(pkg_mod.f2()) | keobox/yap101 | main.py | Python | mit | 175 |
# -*- coding: utf-8 -*-
"""Test dbtoyaml and yamltodb using pagila schema
See http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/dbsamples/pagila/
pagila-schema.sql?rev=1.8
"""
from difflib import unified_diff
from pyrseas.testutils import DbMigrateTestCase
class PagilaTestCase(DbMigrateTestCase):
def setUp(self):
... | perseas/Pyrseas | tests/functional/test_pagila.py | Python | bsd-3-clause | 3,085 |
######
##
## The Python3 code
## is generated from ATS source by atscc2py3
## The starting compilation time is: 2016-7-21: 12h:55m
##
######
######
#ATSextcode_beg()
######
######
from ats2pypre_basics_cats import *
######
from ats2pypre_integer_cats import *
from ats2pypre_bool_cats import *
######
######
#ATSextcode... | githwxi/ATS-Postiats-frozen | projects/SMALL/openshift-flask-2016-07-20/libatscc2py3/ats2pypre_stream_dats.py | Python | mit | 10,563 |
# 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 ... | highweb-project/highweb-webcl-html5spec | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py | Python | bsd-3-clause | 61,133 |
import numpy
import h5py
import cPickle as pickle
class Serializer(object):
def __init__(self, parent, socket = None):
self._parent = parent
self._socket = socket
if(socket):
import threading
self.lock = threading.Lock()
else:
# Use an internal ... | FilipeMaia/h5proxy | h5proxy/serializer.py | Python | bsd-2-clause | 5,488 |
import sys
import numpy as np
import unittest as ut
import espressomd
import espressomd.observables
import espressomd.lb
from espressomd import utils
import tests_common
@ut.skipIf(
not espressomd.has_features('LB_GPU') or espressomd.has_features('SHANCHEN'),
"LB_GPU not compiled in or SHANCHEN activated, can... | KonradBreitsprecher/espresso | testsuite/observable_cylindricalLB.py | Python | gpl-3.0 | 12,645 |
# coding=utf-8
import re
from typing import Optional, List
from PyQt5.QtCore import QObject, QRegularExpression, pyqtProperty, pyqtSlot
from PyQt5.QtCore import QVariant
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtGui import QColor, QFont
from PyQt5.QtGui import QTextCharFormat
from PyQt5.QtQml import QJSValue
f... | thejoeejoee/VUT-FIT-IFJ-2017-toolkit | ifj2017/ide/code/expression/exp_syntax_highlighter.py | Python | gpl-3.0 | 4,135 |
from dolfin import *
from dolfin_adjoint import *
if not hasattr(dolfin, "FunctionAssigner"):
info_red("Need dolfin.FunctionAssigner for this test.")
import sys
sys.exit(0)
mesh = UnitIntervalMesh(2)
V = VectorFunctionSpace(mesh, "CG", 2)
P = FunctionSpace(mesh, "CG", 1)
Z = MixedFunctionSpace([V, P])
de... | pf4d/dolfin-adjoint | tests_dolfin/function_assigner/function_assigner.py | Python | lgpl-3.0 | 2,022 |
from pythonthegathering import ManaPool, spell
pool = ManaPool()
@spell('WBB')
def boop(x):
print(x)
pool.tap('plains').tap('swamp').tap('swamp')
boop('boop', mana_pool=pool, mana_pay={'W': 1, 'B': 2})
| linky00/pythonthegathering | test.py | Python | mit | 209 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 29/09/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | InakiZabala/odoomrp-wip | mrp_byproduct_operations/models/__init__.py | Python | agpl-3.0 | 982 |
"""Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
.. warning::
The WebSocket protocol was recently finalized as `RFC 6455
<http://tools.ietf.org/html/rfc6455>`_ and is not yet supported in
al... | hiphopsmurf/bitcoin-secured | online/build/tornado/tornado/websocket.py | Python | mit | 29,915 |
#!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| ... | ypid-bot/check_mk | web/htdocs/htmllib.py | Python | gpl-2.0 | 90,601 |
"""
Django settings for uicloud project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | hongchhe/mypython | django/projects/uicloud/uicloud/settings.py | Python | apache-2.0 | 5,473 |
#!/usr/bin/python
import functools
import math
# N.B. pygame coordinate system has origin in the upper-left, so these
# directions are y-inverted from standard Cartesian.
EAST = 0
NORTHEAST = math.pi * 1.75
NORTH = math.pi * 1.5
NORTHWEST = math.pi * 1.25
WEST = math.pi
SOUTHWEST = math.pi * 0.75
SOUTH = math.pi * 0.... | bstpierre/yendor | yendor/coord.py | Python | mit | 3,711 |
import os
import re
import yaml
try:
from packaging.version import parse as parse_version
except ImportError:
from pkg_resources import parse_version
from toolbox.config.common import BUTTON_CONFIG_KEYS, CRP_TYPES, CURRENT_MAX_VERSION, CURRENT_MIN_VERSION, PROTOCOLS
from .utils import counted_error, fatal_e... | avatao-content/challenge-toolbox | toolbox/utils/config.py | Python | apache-2.0 | 4,202 |
"""
Update the IP addresses of your Cloudflare DNS records.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/cloudflare/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_EMAIL,... | PetePriority/home-assistant | homeassistant/components/cloudflare/__init__.py | Python | apache-2.0 | 2,351 |
#!/usr/bin/env python
import pytest
import py.test
import datetime
from BeautifulSoup import BeautifulSoup
import wpl
import kpl
from data import Hold
from data import LoginError
from fakes import MyCard
from fakes import MyOpener
def test__parse_holds__numeric_position__reads_position():
response = BeautifulS... | blairconrad/LibraryHippo | Tests/test_wpl.py | Python | mit | 43,177 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (c) 2013 Ulrich Mierendorff
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the right... | ganwell/ktasync | files/kyototycoon_orig.py | Python | agpl-3.0 | 7,463 |
#/usr/bin/env python
import codecs
import os
import sys
from setuptools import setup, find_packages
if 'publish' in sys.argv:
os.system('python setup.py sdist upload')
sys.exit()
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
# Dynamically calculate the version based on galeria.VERSIO... | zokeber/django-galeria | setup.py | Python | bsd-3-clause | 1,378 |
from .base import BaseEncoder
import gzip
try:
from io import BytesIO as StringIO
except ImportError:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class Gzip(BaseEncoder):
content_encoding = 'gzip'
def __init__(self, *args, **kwargs):
... | allanlei/flask-content-encoding | flask_contentencoding/gzip.py | Python | bsd-3-clause | 763 |
#!/usr/bin/env python3
# Copyright (C) 2014 University Radio York
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | CaptainHayashi/permtools | roleperms.py | Python | mit | 1,470 |
from django.shortcuts import render
from manabi.apps.flashcards.models import Deck
def homepage(request):
if request.user.is_anonymous:
return render(request, 'landing_page.html')
decks = Deck.objects.of_user(request.user)
return render(request, 'homepage.html', {
'decks': decks,
})... | aehlke/manabi | manabi/views.py | Python | mit | 321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.