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) 2010-2011 Richard Lincoln
#
# 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, merge, publish... | rwl/PyCIM | CIM14/IEC61970/LoadModel/PowerCutZone.py | Python | mit | 3,088 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history www.reportlab.co.uk/rl-cgi/viewcvs.cgi/rlextra/graphics/Csrc/renderPM/renderP.py
__version__=''' $Id: renderPM.py 3091 2007-05-23 16:12:00Z rgbecker $ '''
"""Usage:
from reportlab.graphics import renderPM
renderPM.drawToFil... | alexissmirnov/donomo | donomo_archive/lib/reportlab/graphics/renderPM.py | Python | bsd-3-clause | 24,436 |
# External Package dependencies
#import requests
from selenium.webdriver import Firefox, Ie, PhantomJS, Chrome, Safari, DesiredCapabilities
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
# Python built-in Packages
import types
import os
import sys
import inspect
import importlib
import configpar... | ldiary/marigoso | marigoso/test.py | Python | mit | 11,244 |
#!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, 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/lice... | openweave/happy | bin/happy-internet.py | Python | apache-2.0 | 2,244 |
import pandas as pd
import MySQLdb
import re
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
class MPAADataFrame:
def __init__(self, username, password):
"""
Pas... | hillnich/imdbML | imdbML.py | Python | gpl-2.0 | 3,507 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Most of this code was obtained from the Python documentation online.
"""Decorator utility functions.
decorators:
- synchronized
- propertyx
- accepts
- returns
- singleton
- attrs
- deprecated
"""
import functools
import warnings
import threading
import sys
def synch... | austinwagner/sublime-sourcepawn | watchdog/utils/decorators.py | Python | mit | 4,060 |
"""appsync module initialization; sets value for base decorator."""
from .models import appsync_backends
from ..core.models import base_decorator
mock_appsync = base_decorator(appsync_backends)
| spulec/moto | moto/appsync/__init__.py | Python | apache-2.0 | 195 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
try:
# The 1D interface
dim = 2
a = NumericalPoint(dim, -1.0)
b = NumericalPoint(dim, 2.0)
domain = Domain(Interval(a, b))
p1 = NumericalPoint(dim, 0.5)
p2 = NumericalPoint(dim, 2.5)
pr... | dubourg/openturns | python/test/t_Domain_std.py | Python | gpl-3.0 | 665 |
import pytest
from semantic_release import ci_checks
from semantic_release.errors import CiVerificationError
def test_circle_should_pass_if_branch_is_master_and_no_pr(monkeypatch):
monkeypatch.setenv('CIRCLE_BRANCH', 'master')
monkeypatch.setenv('CI_PULL_REQUEST', '')
assert ci_checks.circle('master')
... | wlonk/python-semantic-release | tests/ci_checks/test_circle.py | Python | mit | 1,089 |
import sys
def setup(core, object):
object.setStfFilename('static_item_n')
object.setStfName('item_wookiee_gloves_02_01')
object.setDetailFilename('static_item_d')
object.setDetailName('item_wookiee_gloves_02_01')
object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3)
object.setStringAttribute(... | agry/NGECore2 | scripts/object/tangible/wearables/wookiee/item_trader_gloves_02_01.py | Python | lgpl-3.0 | 355 |
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
def process(limit):
numberOf3 = (limit - 1) / 3
numberOf5 = (limit - 1) / 5
sumOfAll3 = sum([i * 3 for i in xrange(1... | zifter/projecteuler | 1-99/t1.py | Python | mit | 530 |
# -*- coding: utf-8 -*-
from nose.tools import eq_, ok_, assert_raises
from dao.dinpy.dinpy import *
from dao.dinpy.dinpy import DinpySyntaxError
from dao import *
from dao.builtins.io import prin
from dao.term import Var
from dao.dinpy.dexpr import _VarSymbol
from dao import special
from dao.builtins.rule... | chaosim/dao | dao/dinpy/tests/testdinpy.py | Python | gpl-3.0 | 9,844 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import json
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from behave import *
@step('I share first element in the history list')
def step_impl(... | jsargiot/restman | tests/steps/share.py | Python | mit | 2,709 |
# Given a linked list and a value x, partition it such that
# all nodes less than x come before nodes greater than or equal to x.
#
# You should preserve the original relative order of the nodes in each
# of the two partitions.
#
# For example,
# Given 1->4->3->2->5->2 and x = 3,
# return 1->2->2->4->3->5.
from node.s... | feigaochn/leetcode | p86_partition_list.py | Python | mit | 1,393 |
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template
class BirthdayPlugin(WillPlugin):
@periodic(month="4", day="9", minute="0", hour="0")
def happy_birthday_from_will(self):
self.say("@steven Happy Birthday!!!! :)")
| skoczen/my-will | plugins/birthdays.py | Python | mit | 309 |
# -*- coding: utf-8 -*-
"""Operating system independent (generic) preprocessor plugins."""
from dfvfs.helpers import file_system_searcher
from plaso.lib import definitions
from plaso.preprocessors import interface
from plaso.preprocessors import manager
class DetermineOperatingSystemPlugin(
interface.FileSystem... | log2timeline/plaso | plaso/preprocessors/generic.py | Python | apache-2.0 | 3,399 |
from datetime import timedelta
from dockerrotate.main import parse_arguments
def test_timestamp_parsing():
assert parse_arguments(['containers', '--created', '1h']).created == timedelta(hours=1)
assert parse_arguments(['containers', '--created', '23m']).created == timedelta(minutes=23)
assert parse_argu... | locationlabs/docker-rotate | tests/test_argparse.py | Python | apache-2.0 | 559 |
# -*- coding: utf-8 -
#
# This file is part of couchdb-requests released under the MIT license.
# See the NOTICE for more information.
#
from .exceptions import MultipleResultsFound, NoResultFound
class View(object):
"""
An iterable object representing a query.
Do not construct directly. Use :meth:`couch... | adamlofts/couchdb-requests | couchdbreq/view.py | Python | mit | 4,866 |
#!/usr/bin/python
import os
import multiprocessing
import shutil
# Provide access to the helper scripts
def modify_path():
scripts_dir = os.path.dirname(__file__)
while not 'Scripts' in os.listdir(scripts_dir):
scripts_dir = os.path.abspath(os.path.join(scripts_dir, '..'))
scripts_dir = os.path.jo... | mkraska/CalculiX-Examples | Thermal/Thermografie/test.py | Python | mit | 1,441 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-06 14:00
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
depe... | sutiialex/djangogirls | blog/migrations/0001_initial.py | Python | apache-2.0 | 1,051 |
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2016 Mercier Pierre-Olivier
#
# 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 yo... | nbr23/nemubot | nemubot/tools/xmlparser/__init__.py | Python | agpl-3.0 | 4,752 |
from datetime import datetime
#####################
# Account Test Data #
#####################
account = {
'name': 'Test Account Name',
'type': 'Checking',
'bank_name': 'Bank of Catonsville',
'account_num': '1234567890'
}
account_put = {
'name': 'Savings Account',
'type': 'Savings'
}
db_accou... | kschoelz/abacuspb | test/test_data.py | Python | gpl-2.0 | 5,915 |
#coding: utf-8
from functools import partial, update_wrapper
from django.utils.datastructures import MultiValueDictKeyError
from django.core.paginator import Paginator, EmptyPage
from django.http import Http404
from . import settings
from .utils import unicode_urlencode, get_instance_from_path
class SimplePaginato... | quantum13/hgh | apps/simplepagination/__init__.py | Python | gpl-2.0 | 5,458 |
from __future__ import annotations
from dataclasses import dataclass
import os
from ..typecheck import *
from ..import core
from .import dap
if TYPE_CHECKING:
from .session import Session
@dataclass
class SourceLocation:
source: dap.Source
line: int|None = None
column: int|None = None
@staticmethod
def from_... | dmilith/SublimeText3-dmilith | Packages/Debugger/modules/dap/variable.py | Python | mit | 2,214 |
__author__ = 'regu0004'
| its-dirg/id_token_verify | src/__init__.py | Python | apache-2.0 | 24 |
# Copyright (C) 2010 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 f... | danakj/chromium | third_party/WebKit/Tools/Scripts/webkitpy/tool/servers/rebaseline_server_unittest.py | Python | bsd-3-clause | 12,199 |
## \file
## \ingroup tutorial_pyroot
## \notebook -nodraw
## example of macro to read data from an ascii file and
## create a root file with a Tree.
##
## NOTE: comparing the results of this macro with those of staff.C, you'll
## notice that the resultant file is a couple of bytes smaller, because the
## code below str... | lgiommi/root | tutorials/pyroot/staff.py | Python | lgpl-2.1 | 2,307 |
"""json-rpc protocol handler."""
import json
import logging
import sys
from jsonrpc_pyclient.error import JsonRpcError
# configure logger
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.ERROR)
# get the proper JSONDecodeError exception type
if sys.version < '3.5':
JSONDecodeError = ... | tvannoy/jsonrpc_pyclient | jsonrpc_pyclient/protocolhandler.py | Python | mit | 3,539 |
# Sketch - A Python-based interactive drawing program
# Copyright (C) 1997, 1998, 1999, 2001, 2002 by Bernhard Herzog
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2... | shumik/skencil-c | Sketch/UI/linedlg.py | Python | gpl-2.0 | 11,272 |
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redi... | chronicwaffle/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/SelfTest/Signature/test_pkcs1_15.py | Python | mit | 8,992 |
import os
import unittest
from vsg import vhdlFile
from vsg.tests import utils
sLrmUnit = 'concurrent_assertion_statement'
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(os.path.dirname(__file__), sLrmUnit,'classification_test_input.vhd'))
oFile = vhdlFile.vhdlFile(lFile)
class test_token(unittest.TestC... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/vhdlFile/test_concurrent_assertion_statement.py | Python | gpl-3.0 | 722 |
# http://www.geeksforgeeks.org/count-triplets-with-sum-smaller-that-a-given-value/
def find_all_triplet(input, total):
input.sort()
result = 0
for i in range(len(input) - 2):
j = i + 1
k = len(input) - 1
while j < k:
if input[i] + input[j] + input[k] >= total:
... | rtkasodariya/interview | python/array/tripletsumlessthantotal.py | Python | apache-2.0 | 531 |
__version__ = "1.7.1"
| xmikos/hangupsbot | hangupsbot/version.py | Python | gpl-3.0 | 22 |
import argparse
import collections
import mock
import pytest
import subprocess
from ..cli import main
from .directory import directory
def test_help(tmpdir, cli):
with cli(
args=['ceph-deploy', 'mon', '--help'],
stdout=subprocess.PIPE,
) as p:
result = p.stdout.read()
assert '... | ddiss/ceph-deploy | ceph_deploy/tests/test_cli_mon.py | Python | mit | 3,325 |
#!/usr/bin/env python
# encoding: utf-8
"""A service to sync a local file tree to jottacloud.
Copies and updates files in the cloud by comparing md5 hashes, like the official client.
Run it from crontab at an appropriate interval.
"""
# This file is part of jottacloudclient.
#
# jottacloudclient is free software: you... | cowai/jottalib | src/jottalib/scanner.py | Python | gpl-3.0 | 4,824 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-04-25 21:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pattern', '0011_auto_20170425_1751'),
]
operations... | yaxu/patternlib | pattern/migrations/0012_pattern_child.py | Python | gpl-3.0 | 546 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2021 Martin Glueck All rights reserved
# Neugasse 2, A--2244 Spannberg, Austria. martin@mangari.org
# #*** <License> ************************************************************#
# This module is free software; you can redistribute it and/or modify
# it under the terms of th... | selfbus/development-tools | test-case-generator/STG/Program.py | Python | gpl-3.0 | 8,523 |
"""
Helpers to manipulate deferred DDL statements that might need to be adjusted or
discarded within when executing a migration.
"""
class Reference:
"""Base class that defines the reference interface."""
def references_table(self, table):
"""
Return whether or not this instance references th... | tysonclugg/django | django/db/backends/ddl_references.py | Python | bsd-3-clause | 5,519 |
"""A random walk proposal distribution.
Author:
Ilias Bilionis
Date:
1/15/2013
"""
__all__ = ['RandomWalkProposal']
import numpy as np
import math
from . import ProposalDistribution
class RandomWalkProposal(ProposalDistribution):
"""A random walk proposal distribution."""
def __init__(self, dt... | ebilionis/py-best | best/random/_random_walk_proposal.py | Python | lgpl-3.0 | 914 |
#!/usr/bin/env python
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/sup... | nistormihai/superdesk-core | tests/io/feed_parsers/pa_nitf_test.py | Python | agpl-3.0 | 2,808 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import datetime
from app import db
__author__ = 'Hanks'
import unittest
from app.models import User, Role, Permission, AnonymousUser, Follow
class UserModelTestCase(unittest.TestCase):
def test_password_setter(self):
u = User(password='cat')
self.ass... | hanks-zyh/Flask-blog | tests/test_user_model.py | Python | apache-2.0 | 2,611 |
# -*- coding: utf-8 -*-
# Downdload larrge-scale compounds' fingerprints from the PubChem Database.
# ?Calculate the similarities
# Songpeng Zu
# 2015-11-10
# import package
import pubchempy as pcb
import chemfp.bitops as chembit
import argparse # Temp for args.
# Functions
def chunks_get_compounds(l,n):
""" ... | biotcm/PICheM | ChemSpace/pubchem_similarity_calc.py | Python | mit | 4,625 |
from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| alberand/lemonbar | widgets/__init__.py | Python | mit | 284 |
# core django imports
from django.contrib import admin
# imports from your apps
from .models import Lookout
@admin.register(Lookout)
class LookoutAdmin(admin.ModelAdmin):
list_display = ('id', 'created', 'modified', 'owner', 'isbn')
list_filter = ('created', 'modified', 'owner')
| srct/bookshare | bookshare/lookouts/admin.py | Python | gpl-3.0 | 290 |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils.translation import ugettext
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.dec... | hzlf/openbroadcast | website/apps/invitation/views.py | Python | gpl-3.0 | 7,841 |
import os
import sys
import numba.cuda
from .. import submodules
from .localimport import localimport
def cuda_available():
available = numba.cuda.is_available()
if not available:
print('Warning! No GPU detected, so most models will fail... If you are in Colab, make sure you enable GPU in the menu: R... | ml4a/ml4a-guides | ml4a/models/submodules/__init__.py | Python | gpl-2.0 | 909 |
#!/usr/bin/env python3
'''Conway's Game of Life in a Curses Terminal Window
'''
import curses
import time
from GameOfLife import World, Cell, Patterns
from curses import ( COLOR_BLACK, COLOR_BLUE, COLOR_CYAN,
COLOR_GREEN, COLOR_MAGENTA, COLOR_RED,
COLOR_WHITE, COLOR_YELLOW ... | JnyJny/GameOfLife | contrib/CGameOfLife.py | Python | mit | 5,943 |
import pytest
from flexmock import flexmock
from f8a_worker.enums import EcosystemBackend
from f8a_worker.models import Base, Ecosystem, create_db_scoped_session
from f8a_worker.setup_celery import get_dispatcher_config_files
from f8a_worker.storages import AmazonS3
from selinon import Config
# To use fixtures from t... | fridex/fabric8-analytics-worker | tests/conftest.py | Python | gpl-3.0 | 2,886 |
"""Test."""
import numpy as np
from pybotics.geometry import matrix_2_vector
from pybotics.tool import Tool
def test_tool():
"""Test."""
tool = Tool()
cg = [1, 2, 3]
tool.cg = cg
np.testing.assert_allclose(tool.cg, cg)
p = [1, 2, 3]
tool.position = p
np.testing.assert_allclose(tool.... | nnadeau/pybotics | tests/test_tool.py | Python | mit | 407 |
# -*- coding: utf-8 -*-
# © 2018 Comunitea - Javier Colmenero <javier@comunitea.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models, fields, _
from odoo.exceptions import UserError
import xlrd
import xlwt
import base64
from odoo import http
from odoo.http import request
from ... | Comunitea/CMNT_00098_2017_JIM_addons | jim_product_import/wizard/product_import_wzd.py | Python | agpl-3.0 | 5,306 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | davidam/python-examples | poo/calculator/app/calculator.py | Python | gpl-3.0 | 1,230 |
# file openpyxl/shared/date_time.py
# Copyright (c) 2010 openpyxl
#
# 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... | ChristineLaMuse/mozillians | vendor-local/lib/python/tablib/packages/openpyxl/shared/date_time.py | Python | bsd-3-clause | 5,956 |
subs = {}
| leojohnthomas/ahkab | subs.py | Python | gpl-2.0 | 10 |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it unde... | chetan51/nupic.research | projects/rsm/util.py | Python | gpl-3.0 | 11,475 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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 ... | ipa-led/airbus_coop | airbus_cobot_gui/src/airbus_cobot_gui/res.py | Python | apache-2.0 | 28,643 |
from galaxy.web.base.controller import *
import pkg_resources
pkg_resources.require( "simplejson" )
pkg_resources.require( "SVGFig" )
import simplejson
import base64, httplib, urllib2, sgmllib, svgfig
import math
import zipfile, time, os, tempfile, string
from operator import itemgetter
from galaxy.web.framework.helpe... | WorkflowConversion/Galaxy2gUSE | lib/galaxy/web/controllers/workflow.py | Python | gpl-2.0 | 105,324 |
#!/usr/bin/env python3
import datetime
from itertools import groupby
class ProbabilityTable:
"""
Given a tree with values at the leaves in the form of nested lists,
return a Dict where the key is a leaf value and the value is the probability
of choosing that leaf from a unformly distributed random walk... | qtip/packwars-simulator | convert.py | Python | mit | 11,046 |
# -*- coding: utf-8 -*-
from setuptools import setup
import saml2idp
with open('README.md') as readme:
description = readme.read()
with open('HISTORY.md') as history:
changelog = history.read()
setup(
name='dj-saml-idp',
version=saml2idp.__version__,
author='Sebastian Vetter',
author_email... | mobify/dj-saml-idp | setup.py | Python | mit | 757 |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... | huggingface/transformers | tests/optimization/test_optimization.py | Python | apache-2.0 | 6,080 |
#! /usr/bin/env python3
# ****************************************************************************
# Copyright 2020 The Apollo 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 cop... | ApolloAuto/apollo | tools/bootstrap.py | Python | apache-2.0 | 36,519 |
# -*- coding: utf-8 -*-
'''
Tests payment
:copyright: (c) 2015 by Openlabs Technologies & Consulting (P) Ltd.
:license: GPLv3, see LICENSE for more details
'''
import unittest
import random
from ast import literal_eval
from decimal import Decimal
import json
from datetime import date
import trytond.tests... | aroraumang/nereid-checkout | tests/test_payment.py | Python | gpl-3.0 | 53,036 |
# Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | cscott/wikiserver | whoosh/filedb/filewriting.py | Python | gpl-2.0 | 25,621 |
# ***************************************************************************
# * Copyright (c) 2015 Przemo Firszt <przemo@firszt.eu> *
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... | Fat-Zer/FreeCAD_sf_master | src/Mod/Fem/femsolver/calculix/writer.py | Python | lgpl-2.1 | 99,378 |
#! /usr/bin/env python3
# Print the product of age and size of each file, in suitable units.
#
# Usage: byteyears [ -a | -m | -c ] file ...
#
# Options -[amc] select atime, mtime (default) or ctime as age.
import sys, os, time
from stat import *
def main():
# Use lstat() to stat files if it exists, else stat()
... | Immortalin/python-for-android | python3-alpha/python3-src/Tools/scripts/byteyears.py | Python | apache-2.0 | 1,651 |
from intermol.orderedset import OrderedSet
class MoleculeType(object):
"""An abstract container for molecules of one type. """
def __init__(self, name=None):
"""Initialize the MoleculeType container.
Args:
name (str): the name of the moleculetype to add
"""
if not ... | shirtsgroup/InterMol | intermol/moleculetype.py | Python | mit | 2,948 |
# Copyright (c) 2015-2016 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | psachin/swift | test/unit/common/middleware/crypto/test_encrypter.py | Python | apache-2.0 | 41,463 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the tracing_controller_backend.
These are written to test the public API of the TracingControllerBackend,
using a mock platform and mock t... | endlessm/chromium-browser | third_party/catapult/telemetry/telemetry/internal/platform/tracing_controller_backend_unittest.py | Python | bsd-3-clause | 10,619 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... | beav/pulp | client_lib/test/data/extensions_loader_tests/partial_fail_set/z_ext/pulp_cli.py | Python | gpl-2.0 | 754 |
# coding: utf8
from __future__ import unicode_literals
from .._messages import Messages
from ...compat import json_dumps, path2str
from ...util import prints
def conllu2json(input_path, output_path, n_sents=10, use_morphology=False):
"""
Convert conllu files into JSON format for use with train cli.
use_m... | ryfeus/lambda-packs | Spacy/source2.7/spacy/cli/converters/conllu2json.py | Python | mit | 3,175 |
import random
from pokemongo_bot import logger
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.worker_result import WorkerResult
from pokemongo_bot.human_behaviour import sleep
class CompleteTutorial(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
def initialize(self):
self.api = self.bo... | Compjeff/PokemonGo-Bot | pokemongo_bot/cell_workers/complete_tutorial.py | Python | mit | 4,839 |
import math
import time
t1 = time.time()
# read the words into a list
f = open('pb042_words.txt','r')
words = f.read().split(',')
for i in range(0,len(words)):
words[i] = words[i][1:len(words[i])-1]
f.close()
def valueOf(word):
value = 0
for i in range(0,len(word)):
value += ord(word[i])-64
... | Adamssss/projectEuler | Problem 001-150 Python/pb042.py | Python | mit | 615 |
from test.querybuildertestcase import QueryBuilderTestCase
EXPECTED_TYPES = ['Bank', 'Broke', 'Employment Period', 'Has Address',
'Has Secretarys', 'Important Person', 'Random Interface', 'Range', 'Secretary', 'Thing', 'Types']
class BrowseDataModelTest(QueryBuilderTestCase):
def test_browse_data_model(self)... | elsiklab/intermine | testmodel/webapp/selenium/test/browse-data-model-test.py | Python | lgpl-2.1 | 860 |
# Copyright (C) 2021 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 or agreed to in writing, ... | google-research/python-graphs | python_graphs/program_graph_dataclasses.py | Python | apache-2.0 | 2,074 |
#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
from collections import namedtuple
import rpmfluff
RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends'])
SPECS = [
RPM('dinginessentail', '1.0', '1', None, None),
... | dpassante/ansible | test/integration/targets/setup_rpm_repo/files/create-repo.py | Python | gpl-3.0 | 1,583 |
# Copyright 2015 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... | aselle/tensorflow | tensorflow/python/estimator/keras.py | Python | apache-2.0 | 21,876 |
# -*- coding: utf-8 -*-
#
# PythonVideoAnnotator documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 12 14:10:03 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
# autogenerate... | UmSenhorQualquer/pythonVideoAnnotator | docs/source/conf.py | Python | mit | 5,886 |
"""
Django settings for site_SE project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | collab-uniba/emotions-online-qa | site_SE/site_SE/settings.py | Python | mit | 2,124 |
#!/usr/bin/env python
# Copyright (c) 2016, Daniel Liew
# This file is covered by the license in LICENSE-SVCB.txt
# vim: set sw=4 ts=4 softtabstop=4 expandtab:
"""
Read a result info describing a set of KLEE test case replays.
"""
from load_klee_runner import add_KleeRunner_to_module_search_path
from load_klee_analysis... | delcypher/klee-runner | tools/result-info-native-replay-summary.py | Python | mit | 3,311 |
#
# Instant Python
# $Id: tkColorChooser.py,v 1.6 2003/04/06 09:00:52 rhettinger Exp $
#
# tk common colour chooser dialogue
#
# this module provides an interface to the native color dialogue
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#
# fixed initialcolor handling in August 1998
#
#
# op... | trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/lib-tk/tkColorChooser.py | Python | gpl-2.0 | 1,716 |
#!/usr/bin/env python
#
# Copyright 2016 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 require... | sillywilly42/simian | src/simian/mac/common/util.py | Python | apache-2.0 | 5,436 |
from .periodic_processor import PeriodicProcessor
from .simple_processor import SimpleProcessor
from .tarantool_processor import TarantoolProcessor
__all__ = ['SimpleProcessor', 'TarantoolProcessor', 'PeriodicProcessor']
| moelius/async-task-processor | async_task_processor/processors/__init__.py | Python | mit | 222 |
def _update_path():
import os, sys
resources = os.environ['RESOURCEPATH']
sys.path.append(os.path.join(
resources, 'lib', 'python%d.%d'%(sys.version_info[:2]), 'lib-dynload'))
sys.path.append(os.path.join(
resources, 'lib', 'python%d.%d'%(sys.version_info[:2])))
sys.path.append(os.pa... | orangeYao/twiOpinion | dustbin/py2app/.eggs/py2app-0.12-py2.7.egg/py2app/bootstrap/semi_standalone_path.py | Python | mit | 431 |
SECRET_KEY = ''
| joedborg/tapedeck | tapedeck/secrets.py | Python | gpl-2.0 | 16 |
"""
Django settings for pychart project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | CCallahanIV/PyChart | pychart/pychart/settings.py | Python | mit | 4,140 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# l... | stormi/tsunami | src/primaires/scripting/espaces.py | Python | bsd-3-clause | 2,229 |
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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... | sivaramakrishnansr/ryu | ryu/services/protocols/bgp/utils/bgp.py | Python | apache-2.0 | 4,919 |
import sys
print(sys.platform)
print(2**100)
x='Spam!'
print(x*8)
| dachuanz/python3 | script1.py | Python | apache-2.0 | 66 |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This file emits the list of reasons why a particular build needs to be clobbered
(or a list of 'landmines').
"""
import sys
impor... | vadimtk/chrome4sdp | build/get_landmines.py | Python | bsd-3-clause | 3,555 |
from pyknon.MidiFile import MIDIFile
from pyknon.music import Note, NoteSeq, Rest
class MidiError(Exception):
pass
class Midi(object):
def __init__(self, number_tracks=1, tempo=60, instrument=0, channel=None):
"""
instrument: can be an integer or a list
channel: can be an integer or ... | palmerev/pyknon | pyknon/genmidi.py | Python | mit | 2,565 |
from typing import Any, ClassVar, Dict, List, Optional, Type, Union
from commonmark.blocks import Parser
from . import box
from ._loop import loop_first
from ._stack import Stack
from .console import Console, ConsoleOptions, JustifyMethod, RenderResult
from .containers import Renderables
from .jupyter import JupyterM... | willmcgugan/rich | rich/markdown.py | Python | mit | 20,616 |
import os
from flask import render_template, request, send_from_directory, redirect
from threading import Thread
from app import app
from app import twitapp,tagcloud
from app.utils import maintenance,gettoken,process_source,process_uploaded_txt_file,allowed_file_img
@app.route('/',methods=['GET'])
def index():... | OlegPyatakov/tagclouds | source/app/views.py | Python | mit | 4,926 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest
from django.forms import ValidationError
from django.http import QueryDict
from django.test import TestCase
from django.test.client import Client
from paypal.pro.fields import CreditCardField
fr... | neumerance/deploy | paypal/pro/tests.py | Python | apache-2.0 | 4,946 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt, time_diff_in_hours, now, add_days, cint
from erpnext.stock.doctype.purchase_receipt.test_pu... | bhupennewalkar1337/erpnext | erpnext/manufacturing/doctype/production_order/test_production_order.py | Python | gpl-3.0 | 11,486 |
#-*- coding: utf-8 -*-
import os
import logging
import time
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from Common.CreatScreenshot import CreatScreenshot
from Common.CommonFunction import CommonFunc... | liumeixia/xiaworkspace | pythonProject/automate/busOnline/BusinessCount.py | Python | gpl-2.0 | 8,999 |
import contextlib
import os
import pytest
from dcos import constants, util
from dcos.errors import DCOSException
def test_open_file():
path = 'nonexistant_file_name.txt'
with pytest.raises(DCOSException) as excinfo:
with util.open_file(path):
pass
assert 'Error opening file [{}]: No ... | mesosphere/dcos-cli | tests/test_util.py | Python | apache-2.0 | 1,106 |
from collections import defaultdict
import logging
logger = logging.getLogger(__file__)
items_txt = """
:version 27
# Blocks
# ID NAME FILE CORDS DAMAGE
1 Stone terrain.png 1,0
2 Grass terrain.png 3,0
3 Dirt terr... | codewarrior0/pymclevel | items.py | Python | isc | 19,714 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/test/integration/test_configs.py | Python | gpl-2.0 | 3,540 |
"""Utility functions used by projects"""
from __future__ import absolute_import
import fnmatch
import logging
import os
import subprocess
import traceback
import redis
import six
from builtins import object
from django.conf import settings
from django.core.cache import cache
from httplib2 import Http
log = logging... | pombredanne/readthedocs.org | readthedocs/projects/utils.py | Python | mit | 6,236 |
# Copyright 2011 Omar Shammas
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... | ABlogiX/django-bigbluebutton | bbb_api.py | Python | gpl-2.0 | 14,816 |
# Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | UliceNix/CMPUT429Assignment3 | machine3.py | Python | gpl-2.0 | 6,047 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.