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 |
|---|---|---|---|---|---|
# System imports
import os
from os.path import join
import pytest
from PyGitUp.git_wrapper import GitError
from PyGitUp.tests import basepath
test_name = 'git-not-in-path'
repo_path = join(basepath, test_name + os.sep)
def setup():
os.makedirs(repo_path, 0o700)
def test_not_a_git_repo():
""" Run 'git up'... | msiemens/PyGitUp | PyGitUp/tests/test_git_not_in_path.py | Python | mit | 701 |
"""
This script allows you to delete articles in bulk from a query or from a csv.
If you provide a csv, you may also provide a second column containing the delete action, which may be one of:
* delete - actually delete the article
* remove_doi - keep the article, but remove its DOI
* remove_fulltext - keep the articl... | DOAJ/doaj | portality/scripts/articlerm.py | Python | apache-2.0 | 4,752 |
#!/usr/bin/python
#Targets: create screen, load image to surface, move surface on the screen until any key is pressed
import pygame
import time
pygame.init()
screen_size=(640,480)
disp=pygame.display.set_mode(screen_size)
face=pygame.image.load('1.png').convert()
default_font=pygame.font.get_default_font()
font=pygame... | amarao/fun_came | learn/pygame_learn/pygame_1st.py | Python | gpl-3.0 | 1,000 |
from datetime import datetime
import mock
import pytz
import time
import urllib2
import zeit.cms.checkout.interfaces
import zeit.cms.testing
import zope.app.locking.lockinfo
class TimeFreezeLockInfo(zope.app.locking.lockinfo.LockInfo):
def __init__(self, *args, **kw):
super(TimeFreezeLockInfo, self).__in... | ZeitOnline/zeit.cms | src/zeit/cms/locking/browser/tests/test_lock.py | Python | bsd-3-clause | 2,514 |
import hildon
import gtk
import pge_window
import cPickle
import pge_window
import os
class Prefs():
def __init__(self):
self.prefs_dict = {}
def load(self):
try:
f = open(os.path.expanduser("~")+"/.pygtkeditor",'r')
self.prefs_dict = cPickle.load(f)
if not self.prefs_dict.has_key('auto_... | khertan/PyGTKEditor | pge_preferences.py | Python | gpl-3.0 | 7,831 |
# pylint: skip-file
# flake8: noqa
class Repoquery(RepoqueryCLI):
''' Class to wrap the repoquery
'''
# pylint: disable=too-many-arguments,too-many-instance-attributes
def __init__(self, name, query_type, show_duplicates,
match_version, ignore_excluders, verbose):
''' Construc... | ewolinetz/openshift-ansible | roles/lib_utils/src/class/repoquery.py | Python | apache-2.0 | 6,322 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cstr
from frappe import _
from frappe.model.document import Document
class CustomField(Document):
def autoname(self):
self.s... | rohitwaghchaure/frappe | frappe/custom/doctype/custom_field/custom_field.py | Python | mit | 3,459 |
tabby_cat = "\tI'm tabbed in."
persian_cat = "I'm split\non a line."
backslash_cat = "I'm \\ a \\ cat."
fat_cat = '''
I'll do a list:
\t* Cat food
\t* Fishes
\t* Catnip\n\t* Grass'''
print tabby_cat + "\n" + persian_cat
print backslash_cat
print fat_cat | srinivasanmit/all-in-all | 1/ex10.py | Python | gpl-3.0 | 255 |
# Copyright (c) 2014 Rackspace, 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 wr... | fengbeihong/tempest_automate_ironic | tempest/api/messaging/test_claims.py | Python | apache-2.0 | 4,431 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | grehujt/SmallPythonProjects | object_detection/create_my_pascal_tf_record.py | Python | mit | 5,864 |
#! /usr/bin/env python
"""Mimification and unmimification of mail messages.
Decode quoted-printable parts of a mail message or encode using
quoted-printable.
Usage:
mimify(input, output)
unmimify(input, output, decode_base64 = 0)
to encode and decode respectively. Input and output may be the name
of... | huran2014/huran.github.io | wot_gateway/usr/lib/python2.7/mimify.py | Python | gpl-2.0 | 15,021 |
# Copyright (c) 2016-2021 Adobe Inc. All rights reserved.
#
# 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, modif... | adobe-apiplatform/umapi-client.py | umapi_client/version.py | Python | mit | 1,138 |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | alexlo03/ansible | lib/ansible/modules/network/avi/avi_gslbhealthmonitor.py | Python | gpl-3.0 | 6,453 |
# ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/furnace/firmware/client.py | Python | apache-2.0 | 4,555 |
import sys
from threading import Lock
import time
import types
from . import values # retain this import style for testability
from .context_managers import ExceptionCounter, InprogressTracker, Timer
from .metrics_core import (
Metric, METRIC_LABEL_NAME_RE, METRIC_NAME_RE,
RESERVED_METRIC_LABEL_NAME_RE,
)
fro... | kawamon/hue | desktop/core/ext-py/prometheus_client-0.7.1/prometheus_client/metrics.py | Python | apache-2.0 | 21,319 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'valerio cosentino'
import mysql.connector
class DbUtil():
"""
This class provides database utilities
"""
def get_connection(self, config):
"""
gets DB connection
:type config: dict
:param config: the DB conf... | SOM-Research/Gitana | util/db_util.py | Python | mit | 12,774 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | var/spack/repos/builtin/packages/glm/package.py | Python | lgpl-2.1 | 1,663 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README_PYPI.rst') as file:
long_description = file.read()
setup(name='poirot',
version='1.0.1',
author='Emanuel Feld',
author_email='elefbet@gmail.com',
description="Search a Git repo... | emanuelfeld/poirot | setup.py | Python | mit | 1,442 |
from django.db import models
from django.contrib.auth import models as auth
import datetime
from application import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
typeChoices = (
('task', 'Task'),
('userStory', 'User Story'),
)
statusChoices = (
('toDo', 'To do')... | Die-Turtles/application | taskCards/models.py | Python | gpl-2.0 | 3,381 |
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | mogoweb/webkit_for_android5.1 | webkit/Tools/Scripts/webkitpy/tool/multicommandtool_unittest.py | Python | apache-2.0 | 7,516 |
import json
from collections import OrderedDict, namedtuple
from contextlib import contextmanager
from celery import states
from celery.exceptions import Ignore
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from memoized import memoized
from corehq.apps.ca... | dimagi/commcare-hq | corehq/apps/case_importer/util.py | Python | bsd-3-clause | 7,577 |
# Copyright 2017 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017 Thorsten Vocks <thorsten.vocks@openbig.org>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import SavepointCase
from odoo.exceptions import ValidationError
class TestProductCatalogPrint(SavepointCase... | openbig/saleorderdetails | product_catalog_print/tests/test_product_catalog_print.py | Python | agpl-3.0 | 2,074 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='wrabbit',
version='0.1',
description='warren rabbitmq wrapper',
author='Jeremiah Campbell',
author_email='jeremy@meantheory.com',
url='https://github.com/warrenprotocol/wrabbit',
download_url='https://github.com/war... | meantheory/wrabbit | setup.py | Python | mit | 572 |
"""Implements a Deep Belief Network."""
from dbm import *
class DBN(DBM):
def __init__(self, net, t_op=None, e_op=None):
rbm, upward_net, downward_net, junction_layers = DBN.SplitDBN(net)
self.rbm = DBM(rbm, t_op, e_op)
self.upward_net = NeuralNet(upward_net, t_op, e_op)
self.downward_net = NeuralNe... | abdulqayyum/deepnet | deepnet/dbn.py | Python | bsd-3-clause | 9,260 |
"""Users and groups.
"""
__docformat__ = 'restructuredtext en'
from .utils import *
from .enums import *
class User(Cached):
"""Represents a Skype user.
"""
_ValidateHandle = str
def __repr__(self):
return Cached.__repr__(self, 'Handle')
def _Property(self, PropName, Set=None, Cache=Tr... | FloatingGhost/skype4py | Skype4Py/user.py | Python | bsd-3-clause | 12,859 |
# Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | Sutto/cloud-custodian | tools/c7n_gcp/tests/test_output_gcp.py | Python | apache-2.0 | 3,349 |
"""
=============================================
Effect of varying threshold for self-training
=============================================
This example illustrates the effect of a varying threshold on self-training.
The `breast_cancer` dataset is loaded, and labels are deleted such that only 50
out of 569 samples h... | glemaitre/scikit-learn | examples/semi_supervised/plot_self_training_varying_threshold.py | Python | bsd-3-clause | 4,072 |
# -*- encoding: utf-8 -*-
import pytest
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from block.models import (
BlockError,
Document,
Link,
Url,
)
from block.tests.factories import (
DocumentFactory,
LinkCategory,
LinkCategoryFa... | pkimber/block | block/tests/test_view_link_library.py | Python | apache-2.0 | 7,936 |
import os.path
import os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from utils import log, info, warning, error
from qgis.gui import QgsMessageBar
class DialogProvider(QObject):
"""
A class to handle opening user form and creating all the required bindings
@note: There is a little too much work ... | NathanW2/qmap | src/qmap/dialog_provider.py | Python | gpl-2.0 | 4,539 |
"""
SpaceHub
Copyright (C) 2013 Ryan Brown <sb@ryansb.com>, Sam Lucidi <mansam@csh.rit.edu>,
Ross Delinger <rossdylan@csh.rit.edu>, Greg Jurman <jurman.greg@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as publ... | ryansb/spacehub | wsgi/spacehub/spacehub/errors.py | Python | agpl-3.0 | 1,133 |
# -*-coding:Utf-8 -*
# Copyright (c) 2013 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
# lis... | stormi/tsunami | src/secondaires/navigation/equipage/ordres/virer.py | Python | bsd-3-clause | 3,807 |
from django.test import TestCase
class CollectionTests(TestCase):
pass
| takeplace/django-composite | composite/tests/urls.py | Python | bsd-3-clause | 77 |
# -*- coding: utf-8 -*-
#
# CoAPy documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 17 15:46:19 2010.
#
# 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.
#
# All c... | umeckel/FS_coapy | doc/conf.py | Python | bsd-3-clause | 6,468 |
# Copyright (c) 2010 Franz Allan Valencia See
#
# 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... | edbrannin/Robotframework-SQLAlchemy-Library | src/SQLAlchemyLibrary/connection_manager.py | Python | apache-2.0 | 1,995 |
# -*- coding: utf-8 -*-
"""
@brief test log(time=10s)
"""
import unittest
import numpy
from scipy.linalg.lapack import dgelss as scipy_dgelss # pylint: disable=E0611
from pyquickhelper.pycode import ExtTestCase
from cpyquickhelper.numbers.direct_blas_lapack import dgelss # pylint: disable=E0611
from cpyquickhelp... | sdpython/cpyquickhelper | _unittests/ut_numbers/test_direct_blas_lapack.py | Python | mit | 3,451 |
from slackrtm.channel import Channel
import pytest
def test_Channel(channel):
assert type(channel) == Channel
@pytest.mark.xfail
def test_Channel_send_message(channel):
channel.send_message('hi')
| llimllib/slackrtm | tests/test_channel.py | Python | mit | 206 |
from datetime import timedelta, datetime
import json
import logging
from random import random
import re
import dateutil.parser
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from django.db.mod... | cmjatai/cmj | cmj/videos/management/commands/pull_youtube.py | Python | gpl-3.0 | 4,572 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/dialogs/search_item.ui'
#
# Created: Thu Oct 25 16:54:55 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
... | yeyanchao/calibre | src/calibre/gui2/dialogs/search_item_ui.py | Python | gpl-3.0 | 1,707 |
from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.urlresolvers import reverse_lazy
def sadmin_prerequisites(function):
actual_decorator = user_passes_test(
lambda u: u.is_authenticated() and u.is_staff and u.is_superuser,
... | animekita/selvbetjening | selvbetjening/sadmin2/decorators.py | Python | mit | 457 |
class TreeAsBin:
def __init__(self, key, child = None, sibling = None):
self.key = key
self.child = child
self.sibling = sibling
| omar94250/Algo-Epita | TreeAsBin.py | Python | gpl-3.0 | 158 |
""" Serial communication with Korad KA3xxxP power supplies.
The intent is to give easy access to the power supply as Python objects, eliminating the need to know
special codes.
The object supports the python `with` statement to release the serial port automatically:
from koradserial import KoradSerial
with KoradSer... | starforgelabs/py-korad-serial | koradserial.py | Python | mit | 10,720 |
import _plotly_utils.basevalidators
class TextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="textsrc", parent_name="histogram", **kwargs):
super(TextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/histogram/_textsrc.py | Python | mit | 440 |
from __future__ import absolute_import
from __future__ import with_statement
from mock import Mock, patch
from celery import Celery
from celery.bin.camqadm import (
AMQPAdmin,
AMQShell,
dump_message,
AMQPAdminCommand,
camqadm,
main,
)
from celery.tests.utils import AppCase, WhateverIO
class... | mozilla/firefox-flicks | vendor-local/lib/python/celery/tests/bin/test_camqadm.py | Python | bsd-3-clause | 4,659 |
import re
import sys
if sys.version_info < (3,):
from urllib2 import urlopen, Request
from urlparse import urljoin
else:
from urllib.request import urlopen, Request
from urllib.parse import urljoin
class InvalidID(Exception):
pass
class InvalidHost(Exception):
pass
class BaseExtractor(obje... | marcwebbie/pycis | pycis/extractors/base_extractor.py | Python | mit | 1,922 |
from django.core.urlresolvers import reverse
def test_role_merge_page(admin_webtest_client, factories):
role = factories.RoleFactory()
url = reverse('admin:role-merge', kwargs={
'department_pk': role.department_id,
'pk': role.pk,
})
response = admin_webtest_client.get(url)
assert r... | Apogaea/voldb | tests/departments/admin/test_role_merge_page.py | Python | gpl-3.0 | 1,165 |
# 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 (t... | apache/incubator-allura | Allura/allura/model/monq_model.py | Python | apache-2.0 | 11,231 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
from spack import *
class Dyninst(CMakePackage):
"""API for dynamic binary instrumentation. Modify ... | LLNL/spack | var/spack/repos/builtin/packages/dyninst/package.py | Python | lgpl-2.1 | 6,257 |
import pandas as pd
import numpy as np
from datetime import datetime
from datetime import timedelta
import math
from utility.datafilepath import g_singletonDataFilePath
class GenerateResultCsv:
def __init__(self):
return
def generateTestDate_0(self):
startDate = datetime.strptime('2016-01-01', ... | LevinJ/Supply-demand-forecasting | evaluation/evaluate.py | Python | mit | 4,270 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'transitions'
# TODO: put package requirements here
]
test_requirem... | trottmpq/test_manager | setup.py | Python | mit | 1,716 |
# coding=utf-8
# Copyright 2022 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | tensorflow/tensor2tensor | tensor2tensor/utils/rouge_test.py | Python | apache-2.0 | 4,407 |
import numpy as np
import tensorflow as tf
from tensorflow.contrib import legacy_seq2seq
from tensorflow.contrib import rnn
# Cloned from https://github.com/sherjilozair/char-rnn-tensorflow
# Used to sample trained models without having to call sample.py every time
# which is extremely slow. Instead we load the data ... | s0hvaperuna/Not-a-bot | char_rnn/model.py | Python | mit | 5,892 |
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.Sources.StaticText import StaticText
from Components.config import config, ConfigSubsection, ConfigBoolean, getConfigListEntry, ConfigSelection, ConfigYesNo, ConfigIP
from Components.Network import iNetwork
from Compone... | 0sc0d3r/enigma2 | lib/python/Screens/InstallWizard.py | Python | gpl-2.0 | 5,657 |
from direct.task.Task import Task
import random
from toontown.classicchars import CCharPaths
from toontown.safezone import Playground
from toontown.toonbase import TTLocalizer
class TTPlayground(Playground.Playground):
def enter(self, requestStatus):
Playground.Playground.enter(self, requestStatus)
... | Spiderlover/Toontown | toontown/safezone/TTPlayground.py | Python | mit | 783 |
##
# Copyright (c) 2012-2014 Apple 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 applicable l... | trevor/calendarserver | contrib/performance/sqlusage/requests/sync.py | Python | apache-2.0 | 3,208 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | inovtec-solutions/OpenERP | openerp/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py | Python | agpl-3.0 | 2,240 |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 07 16:25:23 2014
@author: Yang Xuefeng
"""
from __future__ import division
import numpy as np
import cPickle as cp
import sys
import scipy.stats as ss
import bisect
import argparse
class evaluation(object):
def __init__(self, wl):
s = set(wl.keys())
f... | YangXuefeng/SWEL | train_embedding_git.py | Python | mit | 12,334 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import os.path
import biplist
settingsFilename = inspect.getframeinfo(inspect.currentframe()).filename
settingsPath = os.path.dirname(os.path.abspath(settingsFilename))
#
# Example settings file for dmgbuild
#
# Use like this: dmgbuild ... | OpenEstate/OpenEstate-Tool-Server | src/dmgbuild/settings.py | Python | apache-2.0 | 8,372 |
import locale
from jinja2.utils import generate_lorem_ipsum
from pelican.contents import Article, Author
from pelican.paginator import Paginator
from pelican.settings import DEFAULT_CONFIG
from pelican.tests.support import get_settings, unittest
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generat... | getpelican/pelican | pelican/tests/test_paginator.py | Python | agpl-3.0 | 4,173 |
class Time(object):
def __init__(self, hours=0, minutes=0, seconds=0):
self.hours = hours
self.minutes = minutes
self.seconds = seconds
def __str__(self):
return str(self.hours) + ":" + \
str(self.minutes) + ":" + \
str(self.seconds) | medifle/python_6.00.1x | classTime.py | Python | mit | 306 |
#
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']
import sys
import os
import threading
import collections
import time
import atexit
import weakref
from queue import Empty, Full
import _multipr... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/multiprocessing/queues.py | Python | mit | 10,719 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
'''
Creation of a FA file from a compacted fact int file.
@author pierre peterlongo pierre.peterlongo@inria.fr
'''
import sys
import K3000_common as kc
def index_sequences_seek(compacted_facts_fa_file_name):
'''
Stores for each sequence header its position in... | GATB/DiscoSnp | scripts/k3000/K3000_node_ids_to_node_sequences.py | Python | agpl-3.0 | 10,467 |
"""
"""
def decode(ciphertext):
key = ''.join([(" " * 32), "xz.~^7;>od-DF )}uS1[=cU`mGWis3MT4{N%9Zq2/Ew(&+",
"vkV:l\!hKp8fCOAR6?0|nYbI_LtPB'H<Q$Xy\"aJ@g#j5],*re"])
plaintext = ''.join([key[ord(x)] for x in ciphertext])
return (ciphertext[0:4] + "... " + plaintext)
print(decode('P~})s... | martyn-smith/ursnif_decoder | acuzamu.py | Python | lgpl-3.0 | 1,362 |
#! /usr/bin/env python
"""
Module with post-processing related functions called from within the NFC
algorithm.
"""
__all__ = ['cube_planet_free']
import numpy as np
from ..phot import cube_inject_companions
import math
from matplotlib.pyplot import plot, xlim, ylim, hold, axes, gca, show
def cube_planet_free(plane... | henry-ngo/VIP | vip_hci/negfc/utils_negfc.py | Python | mit | 7,251 |
"""
@file
@brief Subpart related to the documentation generation.
"""
from .conf_path_tools import find_graphviz_dot
from .default_conf import set_sphinx_variables, custom_setup
from .helpgen_exceptions import HelpGenException, ImportErrorHelpGen, HelpGenConvertError
from .help_usage import get_help_usage
from .pandoc_... | sdpython/pyquickhelper | src/pyquickhelper/helpgen/__init__.py | Python | mit | 705 |
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.co... | Perkville/django-tastypie | docs/code/myproject/wsgi.py | Python | bsd-3-clause | 409 |
# -*- coding: UTF-8 -*-
from scheduler import Scheduler
from state import StateMachine
import datetime
import logging
import timer
import asyncio
class Engine:
"""Core of the application"""
def __init__(self, channels):
"""
:param channels: a list of Channel object
"""
self... | pade/sprinkler | src/engine.py | Python | gpl-3.0 | 9,380 |
from sqlalchemy import (
Column,
Float,
Index,
Integer,
Unicode,
UnicodeText
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_session,
sessionmaker
)
from zope.sqlalchemy import ZopeTransactionExtension
import time
DBSession = sco... | zmarvel/coffeespot | coffeespot/models/tables.py | Python | gpl-2.0 | 1,545 |
import celery
def test_run(django_scheduler, django_schedule):
django_scheduler.set_task()
assert(isinstance(django_scheduler.celery_task, celery.Task))
def test_add_schedule(django_scheduler, django_schedule):
assert(not django_scheduler.jobs)
django_scheduler.add(django_schedule)
assert(django... | kuc2477/news | tests/test_scheduler.py | Python | mit | 559 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ... | b0ttl3z/SickRage | sickbeard/classes.py | Python | gpl-3.0 | 8,105 |
import sys
import os
import pickle
import re
import getpass
from mechanicalsoup import Browser
from .config import CONFIG_DIR_NAME
def login(username=None, password=None):
if username is None:
username = input('Please provide username: ')
if password is None:
password = getpass.getpass('Plea... | floydwch/kaggle-cli | kaggle_cli/common.py | Python | mit | 1,733 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PracticaP5.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| PaulDiaconescu/pentagram | PracticaP5/manage.py | Python | gpl-3.0 | 263 |
# coding: utf-8
"""
Utilities for dealing with text encodings
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part... | mattvonrocketstein/smash | smashlib/ipy3x/utils/encoding.py | Python | mit | 2,881 |
# Tweepy
# Copyright 2009-2022 Joshua Roesslein
# See LICENSE for details.
"""
Tweepy Twitter API library
"""
__version__ = '4.6.0'
__author__ = 'Joshua Roesslein'
__license__ = 'MIT'
from tweepy.api import API
from tweepy.auth import (
AppAuthHandler, OAuthHandler, OAuth1UserHandler, OAuth2AppHandler,
OAuth2... | tweepy/tweepy | tweepy/__init__.py | Python | mit | 1,051 |
import json
import random
random_samples = {
"documents": []
}
for i in range(200):
new_sample = {
"id": "twitter_handle_ayy"+str(i),
"user": "twitter_handle_ayy"+str(i),
"type": "activity",
"vote": random.choice(["true", "false"]),
"lat": str(random.uniform(56.0, 58.0)),
"lng": str(random.uniform(21.0,... | charleslai/geotap-node | make_samples.py | Python | mit | 449 |
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, ... | AlbertoPeon/invenio | modules/bibrank/lib/bibrankadminlib.py | Python | gpl-2.0 | 41,781 |
# coding = utf-8
"""
Shopping and shopkeepers.
'Tale' mud driver, mudlib and interactive fiction framework
Copyright by Irmen de Jong (irmen@razorvine.net)
Shopping related commands will be roughly:
SHOP/LIST [item type]
list what the shop has for sale
INFO/INQUIRE/ASK about [item/number]
same as "ask [shopk... | sils1297/Tale | tale/shop.py | Python | gpl-3.0 | 17,240 |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | onshape-public/onshape-clients | python/onshape_client/oas/models/btm_individual_query_with_occurrence811.py | Python | mit | 9,868 |
import random
from apps.algorithms.mean import Mean
from apps.algorithms.standart_deviation import StandartDeviation
from apps.algorithms.z_value import ZValue
from apps.datasets.dataset import DataSet
__author__ = 'cenk'
def demo2():
data_list = []
value_size = 10000
val = 0
while val < value_size... | cenkbircanoglu/Anomaly-Detection | demos/demo2.py | Python | mit | 1,996 |
import waffle
from rest_framework.exceptions import NotFound
def waffle_feature_is_active(request, instance_type, instance_name):
"""
Determine if flag, switch, or sample is active for the given user.
:param request: Django request
:param instance_type: Either "flag", "switch", or "sample"
:param ... | pattisdr/osf.io | api/base/waffle_decorators.py | Python | apache-2.0 | 1,958 |
# -*- coding: utf-8 -*-
import os
class CronParser(object):
def __init__(self, logger=None):
self.logger = logger
def parse_cron_string(self, cron_string):
"""
Parse a cron data string
:param cron_string:
:return:
"""
formatted_cron_data = []
... | ian-wilson/cron-admin | nextrun/cron_parser.py | Python | mit | 3,747 |
# Spiel.py
import pygame
from pygame.locals import *
class Spiel(object):
def __init__(self):
self.Datum = "01-01"
self.Takt = 0
def Zyklus_Morgen_Schule(self):
| Aurora-Beta/VinVG | experiments/spiel.py | Python | mit | 175 |
# 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... | Laurawly/tvm-1 | python/tvm/autotvm/graph_tuner/utils/utils.py | Python | apache-2.0 | 4,682 |
version='alpha9'
version_info = (0,0,9)
| chaomodus/pixywerk | pixywerk/version.py | Python | mit | 40 |
from setuptools import setup, find_packages
setup(name='MODEL6399676120',
version=20140916,
description='MODEL6399676120 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL6399676120',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/MODEL6399676120 | setup.py | Python | cc0-1.0 | 377 |
# -*- coding: utf-8 -*-
""" test_dirtools.py - Test the dirtools module with pyfakefs. """
import shutil
import unittest
import os
import tarfile
import time
try:
import fake_filesystem
import fake_filesystem_shutil
except ImportError:
print "You must install pyfakefs in order to run the test suite."
imp... | tsileo/dirtools | test_dirtools.py | Python | mit | 6,852 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Federico Ficarelli
#
# 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... | nazavode/observer | setup.py | Python | apache-2.0 | 2,604 |
# -*- coding: utf-8 -*-
def social_eyebrow(entity, argument):
return True
#- Fine Funzione -
| Onirik79/aaritmud | src/socials/social_eyebrow.py | Python | gpl-2.0 | 98 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, 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 progra... | numenta/nupic.research | packages/ray/src/nupic/research/frameworks/ray/command_line_args.py | Python | agpl-3.0 | 2,825 |
from datetime import datetime
import numpy as np
import pytest
import pandas as pd
from pandas import NaT, Series, Timestamp
import pandas._testing as tm
from pandas.core.internals.blocks import IntBlock
class TestSeriesInternals:
# GH 10265
def test_convert(self):
# Tests: All to nans, coerce, tru... | TomAugspurger/pandas | pandas/tests/series/test_internals.py | Python | bsd-3-clause | 8,912 |
# Copyright (c) 2006 Nathan Binkert <nate@binkert.org>
# 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 condi... | rjschof/gem5 | util/style/region.py | Python | bsd-3-clause | 9,612 |
from batch_iv_analysis.ivAnalyzer import ivAnalyzer
import argparse
def runCLI(analyzer,args):
analyzer.setup()
print ("Got args:", args)
def handle_cli():
parser = argparse.ArgumentParser(description='Process some iv data.')
parser.add_argument('-f', '--files', default=None, type=argparse.FileType('r'), hel... | greysAcademicCode/batch-iv-analysis | batch_iv_analysis/cli.py | Python | mit | 1,115 |
#
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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
... | idkwim/pysmt | pysmt/test/test_interpolation.py | Python | apache-2.0 | 4,190 |
# -*- coding: utf-8 -*-
#
# 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
#... | sid88in/incubator-airflow | airflow/hooks/presto_hook.py | Python | apache-2.0 | 4,438 |
from django.dispatch import Signal
location_created = Signal(providing_args=['loc'])
location_edited = Signal(providing_args=['loc', 'moved'])
| puttarajubr/commcare-hq | corehq/apps/locations/signals.py | Python | bsd-3-clause | 144 |
from corehq.apps.commtrack.models import StockState
from custom.ilsgateway.models import SupplyPointStatus, SupplyPointStatusValues, SupplyPointStatusTypes
from custom.ilsgateway.tanzania.reminders import DELIVERY_PARTIAL_CONFIRM, NOT_DELIVERED_CONFIRM, \
DELIVERY_CONFIRM_DISTRICT, DELIVERY_CONFIRM_CHILDREN
from cu... | puttarajubr/commcare-hq | custom/ilsgateway/tanzania/test/delivered.py | Python | bsd-3-clause | 3,569 |
"""Raw SNMP SMI module dumps.
As dumped by smidump dump using the python format option.
"""
from __future__ import absolute_import
from itertools import chain
import importlib
from django.utils import six
from nav.config import NAV_CONFIG
from nav.oids import OID
_mib_map = {}
def get_mib(mib_module):
"""Re... | hmpf/nav | python/nav/smidumps/__init__.py | Python | gpl-3.0 | 1,524 |
import pickle
import matplotlib.pyplot as plt
import matplotlib.patches
import matplotlib as mpl
import numpy as np
import sys, argparse
sys.path.append("../")
import Plotting
colors=[
'#d7191c',
'#fdae61',
'#abd9e9',
'#2c7bb6',
]
Names = {
'mini_gb2': 'VC-GB2',
'mini_gb5': 'VC-GB5',
'm... | akshaykr/oracle_cb | semibandits/sequential_plot.py | Python | mit | 3,374 |
#!/usr/bin/python
import realog.debug as debug
import lutin.tools as tools
import os
def get_type():
return "LIBRARY"
def get_desc():
return "opencv Image processing library"
def get_licence():
return "APAPCHE-2"
def get_maintainer():
return ["Maksim Shabunin <maksim.shabunin@itseez.com>"]
def get_version():
... | generic-library/opencv-lutin | lutin_opencv-superres.py | Python | apache-2.0 | 1,814 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | jumpstarter-io/nova | nova/exception.py | Python | apache-2.0 | 49,700 |
# Copyright (c) 2019 Ericsson
#
# 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... | masayukig/tempest | tempest/lib/services/network/qos_minimum_bandwidth_rules_client.py | Python | apache-2.0 | 3,226 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.