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 |
|---|---|---|---|---|---|
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | SeleniumHQ/selenium | py/test/selenium/webdriver/chrome/chrome_network_emulation_tests.py | Python | apache-2.0 | 1,447 |
from __future__ import absolute_import
from __future__ import unicode_literals
import collections
def auto_namedtuple(classname='auto_namedtuple', **kwargs):
"""Returns an automatic namedtuple object.
Args:
classname - The class name for the returned object.
**kwargs - Properties to give the... | ucarion/git-code-debt | testing/utilities/auto_namedtuple.py | Python | mit | 416 |
#!/data/project/nullzerobot/python/bin/python
from flask.ext.wtf import Form
import wtforms.validators as v
from wtforms import TextField, TextAreaField, BooleanField
from messages import msg
from wpcgi.form import getField
class Template(Form):
pid = TextField(id='txt-pid', validators=[v.Required(), v.Number()])... | nullzero/wpcgi | wpcgi/tools/letstranslate/form.py | Python | mit | 2,538 |
"""
commands.py: operations on Gists
Part of gist3.py
(c) John Still 2016, MIT License
"""
import os
import json
from abc import ABCMeta, abstractmethod
import requests as req
from .utils import AccessTokenAuth, copy_clipboard, open_browser, noop
from .models import Page, Gist
API_BASE = 'https://api.github.com'
... | jmsdvl/gist3.py | gist3/commands.py | Python | mit | 7,401 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Triangle Project Code.
# Triangle analyzes the lengths of the sides of a triangle
# (represented by a, b and c) and returns the type of triangle.
#
# It returns:
# 'equilateral' if all sides are equal
# 'isosceles' if exactly 2 sides are equal
# 'scalene' ... | gerardolopezduenas/python-koans-solutions | triangle.py | Python | mit | 980 |
from sockfilter import SockFilterError
def test_error_equality():
assert SockFilterError(address=('google.com', 80)) \
== SockFilterError(address=('google.com', 80))
def test_error_inequality():
assert SockFilterError(address=('google.com', 80)) \
!= SockFilterError(address=('google.com', 81... | cardforcoin/sockfilter | tests/test_error.py | Python | mit | 323 |
# Copyright 2014 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | redhat-openstack/trove | trove/tests/api/mgmt/configurations.py | Python | apache-2.0 | 8,091 |
import enum
import typing as tp
import warnings
from inspect import Parameter, signature
from queue import Queue
from satella.coding.recast_exceptions import rethrow_as
from queue import Empty
def enum_value(value):
"""
If value is an enum, extract and return it's value.
Otherwise, return it as-is.
... | piotrmaslanka/satella | satella/coding/misc.py | Python | mit | 13,498 |
# -*- coding: utf-8 -*-
try:
import json
except ImportError:
import simplejson as json
import math
import pytest
import time
import datetime
import calendar
import re
import decimal
from functools import partial
from pandas.compat import range, zip, StringIO, u
import pandas._libs.json as ujson
import pandas.c... | lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/io/json/test_ujson.py | Python | mit | 56,033 |
# Copyright (C) 2013 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
from ..constants.fiscal import TAX_FRAMEWORK
class DocumentLine(models.Model):
_name = 'l10n_br_fiscal.document.line'
_inherit = 'l10n_br_fiscal.document.line.mi... | kmee/l10n-brazil | l10n_br_fiscal/models/document_line.py | Python | agpl-3.0 | 7,829 |
#!/usr/bin/env python3.8
# Copyright (c) 2016-2017 Eric Eisenhart
# This software is released under an MIT-style license.
# See LICENSE.md for full details.
import pprint
import sys
import feedparser
# feedparser.PREFERRED_XML_PARSERS.remove("drv_libxml2")
# 0 is command itself:
if len(sys.argv) == 2:
feed_url ... | freiheit/discord_rss_bot | show_sample_entry.py | Python | mit | 804 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
# Copyright (C) 2005 Michael Urman
#
# 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... | mineo/picard | picard/formats/mutagenext/compatid3.py | Python | gpl-2.0 | 2,161 |
from banana.templatetags.units import units_map
from django import template
register = template.Library()
@register.inclusion_tag('tags/flux_units_dropdown.html',takes_context=True)
def flux_units_dropdown(context):
simple_units_map = units_map.copy()
del simple_units_map[None]
context['units_map'] = simp... | bartscheers/banana | banana/templatetags/flux_units_dropdown.py | Python | bsd-3-clause | 352 |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django_orm.core.sql import RawExpression, SqlExpression, SqlFunction, AND, OR
from .models import Person, Profile
class BitLength(SqlFunction):
sql_function = "bit_length"
class SqlExpressionsTests(TestCase):
def setUp(self):
Person.obje... | cr8ivecodesmith/django-orm-extensions-save22 | tests/modeltests/pg_expressions/tests.py | Python | bsd-3-clause | 1,466 |
import unittest
from altgraph import GraphStat
from altgraph import Graph
import sys
class TestDegreesDist (unittest.TestCase):
def test_simple(self):
a = Graph.Graph()
self.assertEqual(GraphStat.degree_dist(a), [])
a.add_node(1)
a.add_node(2)
a.add_node(3)
self.... | hujiajie/chromium-crosswalk | tools/telemetry/third_party/altgraph/altgraph_tests/test_graphstat.py | Python | bsd-3-clause | 1,919 |
#!/usr/bin/env python
""" generated source for module ScannerSubscription """
#
# Original file copyright original author(s).
# This file copyright Troy Melhase, troy@gci.net.
#
# WARNING: all changes to this file will be lost.
from ib.lib import Double, Integer
from ib.lib.overloading import overloaded
# package: com... | chris-ch/IbPy | ib/ext/ScannerSubscription.py | Python | bsd-3-clause | 7,918 |
"""
Contains base data structures for defining graph constrained group testing problem,
and interfaces to operate on them.
Basic structure to exchange graph constrained group testing problem definition is :class:`Problem`.
It consists of enumeration of faulty elements, graph of links between elements and natural langu... | szredinger/graph-constr-group-testing | graph_constr_group_testing/core/base_types.py | Python | mit | 5,126 |
#!/usr/bin/env python
import logging
from src.crawler import Crawler
if '__main__' == __name__:
logging.basicConfig(level=logging.DEBUG)
Crawler().crawl()
| kkurian/craigsgigs | crawl.py | Python | unlicense | 167 |
from codecs import encode
import logging
import zlib
def substr(string, pos, length):
return string[pos:pos+length]
def to_hex(_bytes, width=4):
if len(_bytes) == 0:
return None
string = ""
bytes_iter = iter(_bytes)
try:
if width < 1:
while True:
... | datamachine/twx.mtproto | twx/mtproto/util.py | Python | mit | 791 |
# -*- coding: utf-8 -*-
'''
Splits up a Unicode string into a list of tokens.
Recognises:
- Abbreviations
- URLs
- Emails
- #hashtags
- @mentions
- emojis
- emoticons (limited support)
Multiple consecutive symbols are also treated as a single token.
'''
import re
# Basic patterns.
RE_NUM = ur'[0-9]+'
RE_WORD = ur'[a... | bfelbo/deepmoji | deepmoji/tokenizer.py | Python | mit | 3,389 |
# Copyright 2013-2020 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 Cardioid(CMakePackage):
"""Cardiac simulation suite."""
homepage = 'https://baasic.ll... | rspavel/spack | var/spack/repos/builtin/packages/cardioid/package.py | Python | lgpl-2.1 | 1,962 |
# Copyright (C) 2013 by Thomas Keane (tk2@sanger.ac.uk)
#
# 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, copy, modify, ... | BD2KGenomics/slugflow | src/toil/batchSystems/lsf.py | Python | apache-2.0 | 14,703 |
import sys
import importlib
import unittest
import subprocess
import time
import logging
import warnings
from psutil import cpu_count
import numpy as np
import numpy.testing as npt
import pandas as pd
import swifter
from tqdm.auto import tqdm
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.INFO)
ch = logging... | jmcarpenter2/swifter | swifter/swifter_tests.py | Python | mit | 31,276 |
"""
A setuptools-based setup module.
"""
import os
import re
from setuptools import setup, find_packages
from codecs import open
def read(*names, **kwargs):
with open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8")
) as fp:
re... | QuantGov/quantgov | setup.py | Python | mit | 2,099 |
# coding: utf-8
import flask
import auth
import model
import util
from main import app
instagram_config = dict(
access_token_method='POST',
access_token_url='https://api.instagram.com/oauth/access_token',
authorize_url='https://instagram.com/oauth/authorize/',
base_url='https://api.instagram.com/v1... | ssxenon01/music-app | main/auth/instagram.py | Python | mit | 1,538 |
#!/usr/bin/python
#Crosslink Copyright (C) 2016 NIAB EMR see included NOTICE file for details
#
# count imputing errors
#
import sys
f1 = open(sys.argv[1]) #original
f2 = open(sys.argv[2]) #with missing
f3 = open(sys.argv[3]) #imputed
total = 0
errors = 0
while True:
line1 = f1.readline()
line2 = f2.readlin... | eastmallingresearch/crosslink | scripts/check_imputing.py | Python | gpl-2.0 | 778 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xml.dom.minidom as dom
import xml.dom
import os
import socket
import re
import sys
import datetime
import codecs
from SPARQLWrapper import SPARQLWrapper, JSON
endpoint = "http://vtentacle.techfak.uni-bielefeld.de:443/sparql/"
sparql = SPARQLWrapper(endpoint)
# Doku... | ag-sc/QALD | 4/scripts/XMLGenerator.py | Python | mit | 22,039 |
"""Variable class."""
import tensorflow.python.platform
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import state_ops
class Variable(object):
"""See the [Variables How To](../../how_tos/variable... | rickyHong/Tensorflow_modi | tensorflow/python/ops/variables.py | Python | apache-2.0 | 19,452 |
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
verbose_name = "Users"
def ready(self):
import signals | jomauricio/abgthe | abgthe/users/apps.py | Python | bsd-3-clause | 155 |
from flask import make_response, request, render_template, current_app, g, \
Blueprint
from wopr.models import MasterTable, MetaTable
from wopr.database import session
from datetime import datetime, timedelta
views = Blueprint('views', __name__)
@views.route('/')
def index():
return render_template('index.htm... | UrbanCCD-UChicago/sf-plenario-backend | wopr/views.py | Python | mit | 1,258 |
# Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
# This file is part of Open5GS.
# This program 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
# (at your op... | acetcom/cellwire | lib/pfcp/support/pfcp-tlv.py | Python | gpl-3.0 | 28,412 |
from . import errordocument
from . import recursive
from . import static
| ryanpetrello/pecan | pecan/middleware/__init__.py | Python | bsd-3-clause | 73 |
#!/usr/bin/env python
'''
Exercise 1a - Class 2 - Check module loading
Changes to use exceptions to check if module exist. So this could be used to
make the programa compatible with more than one specific module if the
preferred one isn't found on the system (like pysnmp and netsnmp)
Gleydson Mazioli da Silva <gleydso... | gleydsonm/pynet_ex | class2/exercise1a.py | Python | apache-2.0 | 674 |
# encoding: utf-8
from django.contrib import admin
from django.conf import settings
from leonardo_kkadavy_orders.models import KkadavyOrders, KkadavyProducts
class KkadavyProductInline(admin.TabularInline):
model = KkadavyProducts
extra = 1
class KkadavyOrdersAdmin(admin.ModelAdmin):
model = KkadavyOrde... | dresl/leonardo-kkadavy-orders | leonardo_kkadavy_orders/admin.py | Python | bsd-3-clause | 735 |
from django.conf.urls import *
from drawquest.apps.palettes.views import ColorPackList, ColorList
urlpatterns = patterns('drawquest.apps.palettes.views',
url(r'^$', ColorList.as_view()),
url(r'^/packs$', ColorPackList.as_view()),
)
| drawquest/drawquest-web | website/drawquest/apps/palettes/urls.py | Python | bsd-3-clause | 243 |
" seen.py: written by sklnd in about two beers July 2009"
import time
import re
import sys
import os
from util import hook, timesince
db_ready = False
def db_init(db, bot):
"check to see that our db has the the seen table and return a connection."
try:
db.execute("create table if not exists seen(na... | FrozenPigs/Taigabot | plugins/seen.py | Python | gpl-3.0 | 4,970 |
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def hasCycle(self, head):
"""
:type head: ListNode
:rtype: bool
"""
slow = fast = head
while fast and... | zqfan/leetcode | algorithms/141. Linked List Cycle/solution.py | Python | gpl-3.0 | 473 |
import sys
import threading
import time
import unittest
from bank_account import BankAccount
class BankAccountTest(unittest.TestCase):
def test_newly_opened_account_has_zero_balance(self):
account = BankAccount()
account.open()
self.assertEqual(account.get_balance(), 0)
def test_can_... | N-Parsons/exercism-python | exercises/bank-account/bank_account_test.py | Python | mit | 4,295 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Hewlett Packard Enterprise Development LP
#
# 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
#
# U... | open-switch/ops-cli | ops-tests/component/test_vtysh_ct_vrf.py | Python | gpl-2.0 | 17,797 |
#!/usr/bin/python3
'''
Author : Zachary Harvey
'''
from mtgsdk import Card
class CardItem(Card):
def __init__(self, response_dict={}):
super().__init__(response_dict)
self.quantity = response_dict.get('quantity', 1)
| zedth2/mtgcollector | utils/__init__.py | Python | mit | 245 |
from setuptools import setup
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='rabbot',
version='0.0.1-dev',
description='A Telegram bot to track schedule mutations',
url='https://github.com/nihlaeth/WhiteRabbot',
author='Tamara van... | nihlaeth/WhiteRabbot | setup.py | Python | gpl-3.0 | 437 |
from flask import Flask
from celery import Celery
from werkzeug.debug import DebuggedApplication
from snakeeyes.blueprints.page import page
from snakeeyes.blueprints.contact import contact
from snakeeyes.extensions import debug_toolbar, mail, csrf, flask_static_digest
def create_celery_app(app=None):
"""
Cre... | nickjj/build-a-saas-app-with-flask | snakeeyes/app.py | Python | mit | 1,832 |
import ConfigParser
import errno
import socket
import os
import shutil
import tempfile
import platform
def platform_information(_linux_distribution=None):
""" detect platform information from remote host """
linux_distribution = _linux_distribution or platform.linux_distribution
distro, release, codename ... | ddiss/ceph-deploy | ceph_deploy/hosts/remotes.py | Python | mit | 9,783 |
"""
Module for loading binary files
Currently only loades 32 and 64 bit elf files
Top Level Interface:
Load_elf(filename): Returns populated ELF object
"""
import struct
import reil.x86.translator as lift
def btoi8(f):
"""Converts 8 bytes of binary to integer """
return struct.unpack("Q",f.read(8))[0]
def btoi4(... | enjhnsn2/reilex | loader.py | Python | gpl-3.0 | 8,419 |
import logging
from app import app, db, models, lm, LoginManager
from flask import render_template, request, redirect, url_for, g
from flask.ext.login import login_user, current_user, logout_user, login_required
from .forms import SignupForm, LoginForm
from .models import User
@app.route('/')
def index():
if curr... | DuyBach/studentenfutter | app/views.py | Python | gpl-2.0 | 2,199 |
"""
Tutorial - Sessions
Storing session data in CherryPy applications is very easy: cherrypy
provides a dictionary called "session" that represents the session
data for the current user. If you use RAM based sessions, you can store
any kind of object into that dictionary; otherwise, you are limited to
objects that can... | JonnyWong16/plexpy | lib/cherrypy/tutorial/tut07_sessions.py | Python | gpl-3.0 | 1,228 |
# -*- encoding: utf-8 -*-
from __future__ import print_function
import enum
import inspect
import importlib
import os
import re
import shutil
import types
class SupriyaDocumentationManager(object):
@staticmethod
def build_attribute_section(
cls,
attrs,
directive,
title,
... | andrewyoung1991/supriya | supriya/tools/documentationtools/SupriyaDocumentationManager.py | Python | mit | 25,757 |
# encoding: utf-8
from bson import ObjectId as oid
from bson.code import Code
from marrow.schema import Attribute
from ..core import Field
try:
unicode
bytes = str
str = unicode
except:
str = str
bytes = bytes
class String(Field):
__foreign__ = 'string'
def to_foreign(self, obj, name, value):
return st... | djdduty/mongo | marrow/mongo/field/base.py | Python | mit | 1,813 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from setuptools.extension import Extension
from seqlib.version import __version__
from Cython.Build import cythonize
ext_modules = [Extension('seqlib.align', ['seqlib/align.pyx'])]
setup(name='seqlib',
version=__version__,
descrip... | kepbod/seqlib | setup.py | Python | mit | 1,265 |
# Copyright 2018 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... | ghchinoy/tensorflow | tensorflow/python/compiler/tensorrt/test/multi_connection_neighbor_engine_test.py | Python | apache-2.0 | 2,612 |
###########################################################################
#
# Copyright 2008, 2009 Zenoss, Inc. All Rights Reserved.
#
###########################################################################
__doc__="""WindowsDeviceMap
Uses WMI to map Windows OS & hardware information
"""
from ZenPacks.zenoss.W... | dougsyer/ZenPacks.NWN.WindowsDevModeler | ZenPacks/NWN/WindowsDevModeler/modeler/plugins/NWN/wmi/NewWindowsDeviceMap.py | Python | gpl-2.0 | 3,238 |
from __future__ import unicode_literals
import logging
import six
from rbtools.api.errors import APIError
from rbtools.commands import Command, CommandError, Option, OptionGroup
from rbtools.utils.commands import stamp_commit_with_review_url
from rbtools.utils.console import confirm
from rbtools.utils.review_request... | reviewboard/rbtools | rbtools/commands/stamp.py | Python | mit | 6,258 |
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | Donkyhotay/MoonPy | zope/app/renderer/interfaces.py | Python | gpl-3.0 | 1,482 |
#!/usr/bin/env python3
#
# Copyright 2017 LibertadVoluntaria
#
# 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.
#
# This ... | LibertadVoluntaria/4chan-dl | fourchandl.py | Python | gpl-3.0 | 4,888 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Sales Partner')
test_ignore = ["Item Group"]
| gsnbng/erpnext | erpnext/setup/doctype/sales_partner/test_sales_partner.py | Python | agpl-3.0 | 269 |
import os
import locale
import sys
import asyncio
try:
import ujson as json
except ImportError:
import json
import traceback
import aiohttp
from . import __version__
class MineRequest(object):
def __init__(self, method, url, access_key, *,
callback=None,
max_retries=No... | jjjake/iamine | iamine/requests.py | Python | agpl-3.0 | 2,759 |
from mock import Mock, patch
from dusty.systems.nfs import client
from ....testcases import DustyTestCase
class TestNFSClient(DustyTestCase):
@patch('dusty.systems.nfs.client.get_host_ip')
def test_mount_args_string(self, fake_get_host_ip):
fake_get_host_ip.return_value = '192.168.59.3'
fake_r... | gamechanger/dusty | tests/unit/systems/nfs/client_test.py | Python | mit | 655 |
#from vsg.vhdlFile import utils
from vsg.vhdlFile.classify import assertion_statement
from vsg.vhdlFile.classify import case_statement
from vsg.vhdlFile.classify import exit_statement
from vsg.vhdlFile.classify import if_statement
from vsg.vhdlFile.classify import loop_statement
from vsg.vhdlFile.classify import next... | jeremiah-c-leary/vhdl-style-guide | vsg/vhdlFile/classify/sequential_statement.py | Python | gpl-3.0 | 3,197 |
import sys
from collections import defaultdict
def evaluate(prediction, ground_truth):
"""
Evaluation matrix.
:param prediction: a dictionary of labels. e.g {0:[1,0],1:[2],2:[3,4],3:[5,6,7]}
:param ground_truth: a dictionary of labels
:return:
"""
print "prediction:%d, ground:%d"%(len(pred... | shanzhenren/PLE | Evaluation/evaluation.py | Python | gpl-3.0 | 3,006 |
# Copyright (c) spdx contributors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | spdx/tools-python | spdx/writers/write_anything.py | Python | apache-2.0 | 1,355 |
from django.db import models
class events(models.Model):
id = models.AutoField(primary_key=True)
note_id = models.BigIntegerField(null=True, blank=True)
tweet_id = models.BigIntegerField()
type = models.IntegerField(null=True, blank=True)
timestamp = models.DateTimeField()
from_user = models.Ch... | webisteme/punkmoney | web/tracker/models.py | Python | mit | 2,653 |
# -*- coding: utf-8 -*-
"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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,... | WillianPaiva/1flow | oneflow/core/forms/mailfeed.py | Python | agpl-3.0 | 1,077 |
# -*- coding: utf-8 -*-
#
# Tigramite documentation build configuration file, created by
# sphinx-quickstart on Fri May 12 11:37:33 2017.
#
# 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
# autogenerated file.
#
#... | jakobrunge/tigramite | docs/conf.py | Python | gpl-3.0 | 5,990 |
import pytest
| massmutual/py4jdbc | tests/test_ResultSet.py | Python | bsd-3-clause | 15 |
"""
Copyright (C) 2014-2016 Jakub Krajniak <jkrajniak@gmail.com>
This file is part of Backmapper.
Backmapper 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) a... | MrTheodor/bakery | src/files_io.py | Python | gpl-3.0 | 53,980 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | aperigault/ansible | lib/ansible/modules/cloud/google/gcp_compute_network_info.py | Python | gpl-3.0 | 7,665 |
#!/usr/bin/env python
import mirheo as mir
import trimesh, argparse
parser = argparse.ArgumentParser()
parser.add_argument("--mesh", type=str, required=True)
args = parser.parse_args()
ranks = (1, 1, 1)
domain = (12, 8, 10)
rc=1.0
u = mir.Mirheo(ranks, domain, debug_level=3, log_filename='log', no_splash=True)
m... | dimaleks/uDeviceX | tests/dump/h5.mesh.sdf.py | Python | gpl-3.0 | 1,381 |
from django.apps import AppConfig
class CasesConfig(AppConfig):
name = 'cases'
| antonow/concept-to-clinic | interface/backend/cases/apps.py | Python | mit | 85 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A complex testcase."""
EXPENSE = 14.23
LOOKS_NICE = True
MAX_EXPENSE = 12
GET_OUT_ALIVE = False
SACRIFICE = (LOOKS_NICE and EXPENSE <= MAX_EXPENSE) or GET_OUT_ALIVE is False
| Logan213/is210-week-04-warmup | task_03.py | Python | mpl-2.0 | 225 |
# Copyright (c) 2016-present, Facebook, 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 or agreed... | Yangqing/caffe2 | caffe2/python/modeling/net_modifier.py | Python | apache-2.0 | 1,568 |
import pytest
import json
from webtest import TestApp as Client
from graphql_wsgi import graphql_wsgi, graphql_wsgi_dynamic
from graphql.type import (
GraphQLObjectType,
GraphQLField,
GraphQLArgument,
GraphQLNonNull,
GraphQLSchema,
GraphQLString,
)
def raises(*_):
raise Exception("Throws!... | faassen/wsgi_graphql | tests/test_graphql_wsgi.py | Python | mit | 13,236 |
# -*- coding: utf-8 -*-
"""
Module implementing genre.
"""
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from Ui_genre import Ui_genre
class Genre(QDialog, Ui_genre):
"""
handle genre editing with dialog
"""
def __init__(self, c, conn, path, parent = None):
"""
Constructor
... | cedi4155476/musicmanager | music_manager/genre.py | Python | mit | 5,490 |
# Copyright (C) 2015 Statoil ASA, Norway.
#
# The file 'test_ecl_init_file.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 vers... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_restart_file.py | Python | gpl-3.0 | 1,488 |
#!/usr/bin/env python
"""Author: Michal Zmuda
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
A script to brings up a set of onezone nodes. They can create separate
clusters.
Run the script with -h flag to learn about script's running options.
"""
from __fut... | onedata/web-client | bamboos/docker/zone_worker_up.py | Python | mit | 812 |
""" Caches tiles to Amazon S3.
Requires boto (2.0+):
http://pypi.python.org/pypi/boto
Example configuration:
"cache": {
"name": "S3",
"bucket": "<bucket name>",
"access": "<access key>",
"secret": "<secret key>"
}
S3 cache parameters:
bucket
Required bucket name for S3. If it doesn't ex... | aaronr/TileStache | TileStache/S3.py | Python | bsd-3-clause | 3,010 |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... | EmanueleCannizzaro/scons | test/option--random.py | Python | mit | 3,323 |
from .style import Citation_Style
evidence_style = {
'ESM93': Citation_Style(
category='Archives & Artifacts',
type='Archived Material: Artifact, Creator as lead element in Source List',
biblio='{Creator (Last)}, {Creator (First)}. "{Artifact Title}." {Item Type}. {Creation Date}. {Collecti... | briot/geneapro | backend/geneaprove/utils/citations/evidence_style.py | Python | gpl-2.0 | 102,608 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing, threading, traceback, json
import gobject, dbus, dbus.service
import sqlite3, mx.DateTime, re, uuid
import urlshorter, storage, network, util, config
from gettext import lgettext as _
import signal
from util import log
from util import resources
fr... | rhg/Qwibber | gwibber/microblog/dispatcher.py | Python | gpl-2.0 | 34,302 |
# -*- coding: utf-8 -*-
default_app_config = 'spirit.user.admin.apps.SpiritUserAdminConfig'
| nitely/Spirit | spirit/user/admin/__init__.py | Python | mit | 93 |
import sht21
with sht21.SHT21(1) as sht21:
print "temp: %s"%sht21.read_temperature()
print "humi: %s"%sht21.read_humidity()
| BollMose/daynote | test_sht.py | Python | apache-2.0 | 132 |
# Copyright 2014 PerfKitBenchmarker 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 appli... | xiaolihope/PerfKitBenchmarker-1.7.0 | perfkitbenchmarker/linux_benchmarks/__init__.py | Python | apache-2.0 | 1,064 |
"""
This should replace the howMuchOfATautologyItIs-file.
The function should make sure that Frank doesn't find
dumb functions like 0 = 0.
"""
def howMuchOfATautologyItIs(database,hyp):
"""
The database part is self-explanatory.
The hyp is a hypothesis-object.
It should return ... | ViktorWase/Frank-the-Science-Bot | Templates/tautologytemplate.py | Python | apache-2.0 | 338 |
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['R_Recombination'],
kineticsEstimator = 'rate rules',
)
species(
label='ethane',
reactive=True,
structure=SMILES("CC"),
)
simp... | Molecular-Image-Recognition/Molecular-Image-Recognition | code/rmgpy/rmg/test_data/mainTest/input.py | Python | mit | 951 |
# Copyright (c) 2010, individual contributors (see AUTHORS file)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" ... | rcos/Observatory | observatory/dashboard/models/EventSet.py | Python | isc | 4,939 |
import json
import re
from collections import OrderedDict
from typing import List
from pyxdameraulevenshtein import normalized_damerau_levenshtein_distance as ndld
from twisted.plugin import IPlugin
from zope.interface import implementer
from desertbot.message import IRCMessage
from desertbot.moduleinterface import I... | DesertBot/DesertBot | desertbot/modules/utils/StringUtils.py | Python | mit | 3,807 |
import numpy as np
from .exceptions import InstrumentError
from .tools import (_CleanArgs, _scalar, calculate_projection_hwhm, ellipse,
project_into_plane)
class GeneralInstrument(object):
r"""Class containing methods general to both Triple Axis and Time of Flight
instruments.
Method... | granrothge/neutronpy | neutronpy/instrument/general.py | Python | mit | 10,888 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Adriano Monteiro Marques.
#
# Author: Bartosz SKOWRON <getxsick at gmail dot com>
#
# This library 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 Softwa... | umitproject/umpa | tests/a_unit/test_config.py | Python | lgpl-2.1 | 1,401 |
#!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | MTG/essentia | packaging/darwin/darwin_build_tools.py | Python | agpl-3.0 | 9,204 |
from sympy.core.basic import Basic, S, C, sympify, Wild
from sympy.core.function import Lambda, Function, Function, expand_log
from sympy.core.cache import cacheit
from sympy.utilities.decorator import deprecated
class exp(Function):
nargs = 1
def fdiff(self, argindex=1):
if argindex == 1:
... | hazelnusse/sympy-old | sympy/functions/elementary/exponential.py | Python | bsd-3-clause | 17,819 |
"""
Support the sensor of a BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.bloomsky/
"""
import logging
from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.helpers.entity import Entity
from homeassistant.... | mikaelboman/home-assistant | homeassistant/components/sensor/bloomsky.py | Python | mit | 2,985 |
import os
from django.db import models
from django.conf import settings
class Organism(models.Model):
class Meta:
ordering = ['common_name']
taxonomy_id = models.PositiveIntegerField(db_index=True)
name = models.CharField(max_length=50)
common_name = models.CharField(max_length=50, blank=True,... | maglab/naked-mole-rat-portal | genomeportal/annotations/models.py | Python | gpl-2.0 | 3,868 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v1beta2_user_subject.py | Python | apache-2.0 | 3,674 |
global returnCode
returnCode = {
'100': 'TV Show modified',
'101': 'TV Show scheduled',
'102': 'TV Show keywords reseted',
'103': 'TV Show unscheduled',
'104': 'Torrent manually pushed',
'105': 'Torrent not found in Transmission. Reseting status',
'200': 'OK',
'210': 'Not yet aired',
'220': 'Torrent not foun... | kavod/TvShowWatch | messages.py | Python | gpl-2.0 | 1,810 |
'''
'''
# 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");... | pbchou/trafficserver | tests/gold_tests/continuations/double_h2.test.py | Python | apache-2.0 | 6,561 |
"""
Predictions widget
"""
from collections import OrderedDict, namedtuple
import numpy
from PyQt4 import QtCore, QtGui
import Orange
from Orange.base import Model
from Orange.data import ContinuousVariable, DiscreteVariable
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
from Ora... | PythonCharmers/orange3 | Orange/widgets/evaluate/owpredictions.py | Python | gpl-3.0 | 8,203 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import re
import frappe
from frappe.website.utils import get_shade
from frappe.website.doctype.website_theme.website_theme import get_active_theme
no_sitemap = 1
base_template_pa... | ESS-LLP/frappe | frappe/www/website_theme.py | Python | mit | 1,669 |
# -*- coding: utf-8
"""
ain7/news/urls_events.py
"""
#
# Copyright © 2007-2018 AIn7 Devel Team
#
# 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
# ... | ain7/www.ain7.org | ain7/news/urls_events.py | Python | lgpl-2.1 | 2,309 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you ... | 3n73rp455/api | manage.py | Python | gpl-3.0 | 535 |
import django_tables2 as tables
from django.utils.translation import ugettext_lazy as _
from .models import Operation
def sum_amount(table) -> float:
total = sum(x.gross_amount for x in table.data)
return round(total, 2)
class OperationTable(tables.Table):
account = tables.Column(footer=_('Total Amount ... | datiti/django_compta | compta/tables.py | Python | apache-2.0 | 1,125 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from eth.decoder import Decoder
from json import loads
class TestDecoder(TestCase):
test_abi = loads(
'[{"inputs": [{"type": "address", "name": ""}], "constant": true, "name": "isInstantiation", "payable": '
... | ConsenSys/eth-alerts | alerts/eth/tests/test_decoder.py | Python | gpl-3.0 | 3,450 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.