text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
"""compute number of reads/alignments from BAM file
===================================================
This is a benchmarking utility script with limited functionality.
Compute simple flag stats on a BAM-file using
the pysam python interface.
"""
import sys
import pysam
assert len(sys.argv) == 2, "USAGE: {} filena... | bioinformed/pysam | benchmark/python_flagstat.py | Python | mit | 622 | 0.003215 |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterternary.hoverlabel"
_path_str = "scatterternary.hoverlabel.font"
_valid_props = {"color... | plotly/python-api | packages/python/plotly/plotly/graph_objs/scatterternary/hoverlabel/_font.py | Python | mit | 11,245 | 0.0008 |
'''
Created on 2013-01-22
@author: levi
'''
import unittest
import time
from path_condition_generator import PathConditionGenerator
from t_core.matcher import Matcher
from t_core.rewriter import Rewriter
from t_core.iterator import Iterator
from t_core.messages import Packet
from t_core.tc_python.frule import FRul... | levilucio/SyVOLT | tests/combine_test.py | Python | mit | 20,391 | 0.01025 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.urls import reverse
from django.test import TestCase
from django.utils import timezone
import copy
from django.contrib.auth.models import User, Group
from .models import Restaurant, Type, Cuisine, Food, Booking
from .views ... | srijanss/rhub | webapp/tests.py | Python | mit | 28,803 | 0.020067 |
import string
from TagObject import TagObject
from BaseResource import BaseResource
import gettext
_ = gettext.gettext
TAG_NAME = "apache"
RESOURCE_TYPE = _("Apache Server")
class Apache(BaseResource):
def __init__(self):
BaseResource.__init__(self)
self.TAG_NAME = TAG_NAME
self.resource_type = RESOURC... | andyvand/cygsystem-config-cluster | src/Apache.py | Python | gpl-2.0 | 327 | 0.006116 |
"""
Interact with the world:
- swing the arm, sneak, sprint, jump with a horse, leave the bed
- look around
- dig/place/use blocks
- use the held (active) item
- use/attack entities
- steer vehicles
- edit and sign books
By default, the client sends swing and look packets like the vanilla client.
This can be disabled ... | luken/SpockBot | spockbot/plugins/helpers/interact.py | Python | mit | 9,523 | 0 |
"""
Example of module documentation which can be
multiple-lined
"""
from sqlalchemy import Column, Integer, String
from wopmars.Base import Base
class FooBaseH(Base):
"""
Documentation for the class
"""
__tablename__ = "FooBaseH"
id = Column(Integer, primary_key=True, autoincrement=True)
na... | aitgon/wopmars | wopmars/tests/resource/model/FooBaseH.py | Python | mit | 472 | 0 |
#!/usr/bin/env python
'''
This program illustrates the use of findContours and drawContours.
The original image is put up along with the image of drawn contours.
Usage:
contours.py
A trackbar is put up which controls the contour level from -3 to 3
'''
# Python 2/3 compatibility
from __future__ import print_funct... | makelove/OpenCV-Python-Tutorial | 官方samples/contours.py | Python | mit | 2,455 | 0.019145 |
"""
Timezone-related classes and functions.
This module uses pytz when it's available and fallbacks when it isn't.
"""
from datetime import datetime, timedelta, tzinfo
from threading import local
import sys
import time as _time
try:
import pytz
except ImportError:
pytz = None
from django.conf import setting... | zzeleznick/zDjango | venv/lib/python2.7/site-packages/django/utils/timezone.py | Python | mit | 9,180 | 0.002288 |
#-------------------------------------------------------------------------
#
# Copyright (c) 2009, IMB, RWTH Aachen.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in simvisage/LICENSE.txt and may be redistributed only
# under the conditions described... | simvisage/oricreate | oricreate/fu/fu_poteng_bending.py | Python | gpl-3.0 | 1,193 | 0.000838 |
"""Contains the implementation for the DirectoryWatcher class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.platform import gfile
from tensorflow.python.platform import logging
class DirectoryWatcher(object):
"""A ... | arunhotra/tensorflow | tensorflow/python/summary/impl/directory_watcher.py | Python | apache-2.0 | 4,586 | 0.00785 |
# This file is part of the MapProxy project.
# Copyright (C) 2014 Omniscale <http://omniscale.de>
#
# 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... | olt/mapproxy | mapproxy/test/system/test_wms_srs_extent.py | Python | apache-2.0 | 6,717 | 0.006253 |
"""
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | chenyyx/scikit-learn-doc-zh | examples/zh/applications/plot_tomography_l1_reconstruction.py | Python | gpl-3.0 | 5,478 | 0.001278 |
# -*- coding: UTF-8 -*-
import logging
from model_utils import Choices
from simptools.wrappers.http import HttpClient, HttpRequest
from requests.exceptions import ConnectionError
from payway.merchants.models import Merchant
__author__ = 'Razzhivin Alexander'
__email__ = 'admin@httpbots.com'
RESPONSE_STATUS = Choices(... | RANUX/django-payway | payway/merchants/http.py | Python | bsd-2-clause | 1,585 | 0.001893 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | tysonholub/twilio-python | twilio/rest/serverless/v1/service/environment/deployment.py | Python | mit | 15,554 | 0.003665 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | google/pyctr | core/qual_names.py | Python | apache-2.0 | 8,100 | 0.01 |
from datetime import datetime, timedelta
from django import http
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.test import RequestFactory
from django.utils.encoding import force_text
from unittest import mock
import pytest
from olympia import amo... | eviljeff/olympia | src/olympia/amo/tests/test_decorators.py | Python | bsd-3-clause | 5,649 | 0 |
from __future__ import unicode_literals
from django.apps import AppConfig
class RfhistoryConfig(AppConfig):
name = 'RFHistory'
| Omenia/RFHistory | ServerApp/apps.py | Python | mit | 134 | 0 |
import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerCoffeeButtonV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'mug_pos... | rlworkgroup/metaworld | metaworld/policies/sawyer_coffee_button_v1_policy.py | Python | mit | 1,025 | 0.000976 |
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy import GeometryColumn, LineString, GeometryDDL
engine = create_engine('postgres://michel@localhost/featureserver', echo=False)
session = sessionmaker(bind=engine)()
metadata = MetaData(engine)
... | guolivar/totus-niwa | service/thirdparty/featureserver/tests/geoalchemy_model.py | Python | gpl-3.0 | 605 | 0.004959 |
"""
WSGI config for artge 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/dev/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTING... | neslihanturan/artge | artge/wsgi.py | Python | gpl-3.0 | 387 | 0 |
from FileBundleTestCase import FileBundleTestCase
import unittest
class BasicTests(unittest.TestCase, FileBundleTestCase):
pass | gobstones/PyGobstones-Lang | tests/basictests/basictests_test.py | Python | gpl-3.0 | 132 | 0.015152 |
__all__ = ['E']
import operator
import sys
import threading
import numpy
# Declare a double type that does not exist in Python space
double = numpy.double
# The default kind for undeclared variables
default_kind = 'double'
type_to_kind = {bool: 'bool', int: 'int', long: 'long', float: 'float',
doub... | erdc-cm/numexpr | numexpr/expressions.py | Python | mit | 14,057 | 0.006189 |
"""
Test the Hold API.
"""
import dbus
from dbus.exceptions import DBusException
from functools import partial
from servicetest import call_async, EventPattern, assertEquals, assertLength
from jingletest2 import test_all_dialects
from gabbletest import sync_stream
from call_helper import CallTest, run_call_test
import... | Ziemin/telepathy-gabble | tests/twisted/jingle/call-hold-audio.py | Python | lgpl-2.1 | 28,484 | 0.015974 |
from .pyvatebin import app
| yossarianirving/pyvatebin | pyvatebin/__init__.py | Python | mit | 27 | 0 |
# coding=utf-8
"""
Lets the user assign groups to all cards, which have no group yet.
"""
import data
cards = [data.database_manager.get_card(card_id) for card_id, in data.database_manager.get_connection().execute(
"SELECT card_id FROM card WHERE card_id NOT IN (SELECT card_id FROM card_group_membership)").fetch... | Julian24816/lHelper | assign_group_name.py | Python | gpl-3.0 | 786 | 0.002545 |
from markdown import markdown
from django.db import models
from django.core.urlresolvers import reverse
class Tag(models.Model):
"""
A subject-matter tag for blog posts
"""
slug = models.CharField(max_length=200, unique=True)
name = models.SlugField(max_length=200, unique=True)
def __str__(s... | blcook223/bencook.info | blog/models.py | Python | isc | 1,100 | 0.001818 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Jono Bacon <jono@ubuntu.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foun... | jonobacon/ubuntu-accomplishments-viewer | accomplishments_viewer_lib/Builder.py | Python | gpl-3.0 | 11,454 | 0.00096 |
# (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | andrewcbennett/iris | lib/iris/tests/test_cdm.py | Python | gpl-3.0 | 49,510 | 0.004161 |
"""
Parses the results found for the ETW started on a machine,
downloads the results and stops the ETW.
All credit to pauldotcom-
http://pauldotcom.com/2012/07/post-exploitation-recon-with-e.html
Module built by @harmj0y
"""
import settings
from lib import command_methods
from lib import helpers
from lib im... | Exploit-install/Veil-Pillage | modules/enumeration/host/etw_results.py | Python | gpl-3.0 | 3,006 | 0.006986 |
from .Condition import Condition
from .Configuration import Configuration
from .Classifier import Classifier
from .ClassifiersList import ClassifiersList
from .XCS import XCS
from .GeneticAlgorithm import *
| ParrotPrediction/pyalcs | lcs/agents/xcs/__init__.py | Python | mit | 207 | 0 |
# Copyright 2014 NEC Corporation. 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 ... | openstack/tempest-lib | tempest_lib/api_schema/response/compute/v2_1/services.py | Python | apache-2.0 | 2,380 | 0 |
import wx
import wx.calendar
from wx.lib.masked import TimeCtrl
from wx.lib.agw import hypertreelist as HTL
from datetime import datetime, time
from lib import Task, DATA, PRIORITIES, DEFAULT_PRIORITY
from decorators import requires_selection
ID_ADD_TASK = 1000
ID_ADD_SUBTASK = 1010
ID_COLLAPSE = 1020
ID_EXPAND = 103... | codekoala/treedo | treedo/gui.py | Python | bsd-3-clause | 12,628 | 0.003405 |
from distutils.core import setup
import py2exe
setup(console=['newsputnik.py']) | maxikov/tatmon | trash/setup.py | Python | gpl-3.0 | 83 | 0.012048 |
import os
from setuptools import setup
########## autover ##########
def get_setup_version(reponame):
"""Use autover to get up to date version."""
# importing self into setup.py is unorthodox, but param has no
# required dependencies outside of python
from param.version import Version
return Ver... | ioam/param | setup.py | Python | bsd-3-clause | 2,203 | 0.005447 |
# -*- coding: utf-8 -*-
from django.forms import fields
from django.forms import widgets
from djng.forms import field_mixins
from . import widgets as bs3widgets
class BooleanFieldMixin(field_mixins.BooleanFieldMixin):
def get_converted_widget(self):
assert(isinstance(self, fields.BooleanField))
if... | dpetzold/django-angular | djng/styling/bootstrap3/field_mixins.py | Python | mit | 1,771 | 0.001129 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron
# Copyright 2015, TODAY Clouder SASU
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License with Attribution
# ... | YannickB/odoo-hosting | __unfinished__/clouder_template_taiga/template.py | Python | agpl-3.0 | 3,298 | 0 |
zoo_animals = ["pangolin", "cassowary", "sloth", "tiger"]
# Last night our zoo's sloth brutally attacked
#the poor tiger and ate it whole.
# The ferocious sloth has been replaced by a friendly hyena.
zoo_animals[2] = "hyena"
# What shall fill the void left by our dear departed tiger?
# Your code here!
zoo_animals[3] ... | vpstudios/Codecademy-Exercise-Answers | Language Skills/Python/Unit 5/1-Python Lists and Dictionaries/Lists/3-New Neibors.py | Python | mit | 329 | 0.00304 |
"""
Classes::
VASPData -- A collection of functions that wrap bash code to extract
data from VASP output into managable .dat (.txt) files.
"""
import numpy as np
from subprocess import call, check_output
from ast import literal_eval
class VASPData(object):
"""
A collection of functions that wrap bash c... | mmb90/dftintegrate | dftintegrate/fourier/vaspdata.py | Python | mit | 3,878 | 0 |
from cStringIO import StringIO
from datetime import datetime
from functools import partial
from itertools import chain, imap, izip
from logging import StreamHandler
import os
from os import chdir
from os.path import join, basename, split, dirname, relpath
from sys import stderr
from time import time
from mimetypes impo... | gartung/dxr | dxr/app.py | Python | mit | 20,359 | 0.001326 |
from django.views.generic.edit import CreateView, UpdateView
from .models import AuthoredMock, EditoredMock
from .forms import AuthoredModelFormMock, EditoredModelFormMock
class FormKwargsRequestMixin(object):
def get_form_kwargs(self):
kwargs = super(EditoredMockUpdateView, self).get_form_kwargs(self)
... | audiolion/django-behaviors | tests/views.py | Python | mit | 635 | 0 |
"""
********
Matching
********
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# Copyright (C) 2011 by
# Nicholas Mancuso <nick.mancuso@gmail.com>
# All rights reserved.
# ... | ltiao/networkx | networkx/algorithms/matching.py | Python | bsd-3-clause | 32,997 | 0.001879 |
from collections import defaultdict
class Solution(object):
def minWindow(self, S, T):
"""
:type S: str
:type T: str
:rtype: str
"""
pre = defaultdict(list)
for i, c in enumerate(T, -1):
pre[c].append(i)
for val in pre.values():
... | wufangjie/leetcode | 727. Minimum Window Subsequence.py | Python | gpl-3.0 | 1,035 | 0.001932 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | yanheven/console | openstack_dashboard/dashboards/project/volumes/volumes/tests.py | Python | apache-2.0 | 48,594 | 0.001173 |
#!/usr/bin/python
# -*- coding: utf_8 -*-
# Autopsy Forensic Browser
#
# Copyright 2013 Basis Technology Corp.
#
# 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/l... | eugene7646/autopsy | test/script/regression.py | Python | apache-2.0 | 93,572 | 0.00451 |
# Copyright 2016 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... | rew4332/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/graph_io_test.py | Python | apache-2.0 | 14,145 | 0.006999 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weibome.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| qingtech/weibome | manage.py | Python | gpl-2.0 | 250 | 0 |
import binascii
from unittest import TestCase
from aioquic.buffer import encode_uint_var
from aioquic.h3.connection import (
H3_ALPN,
ErrorCode,
FrameType,
FrameUnexpected,
H3Connection,
StreamType,
encode_frame,
)
from aioquic.h3.events import DataReceived, HeadersReceived, PushPromiseRece... | KiChjang/servo | tests/wpt/web-platform-tests/tools/third_party/aioquic/tests/test_h3.py | Python | mpl-2.0 | 45,118 | 0.000997 |
# -*- coding:utf-8 -*-
from django import test
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.management import call_command
from mock import patch
from nose.tools import eq_
class BcryptTests(test.TestCase):
def setUp(se... | fwenzel/django-sha2 | test/django13/tests/test_bcrypt.py | Python | bsd-3-clause | 6,294 | 0 |
#####################################
# Example how to control Agilent Function egenrator over GPIB
# Author, Peter Vago, NI Systems Engineer, 2016
#
# PyVISA 1.8 version is used.
# For migrating from older version (<1.5) read this: https://media.readthedocs.org/pdf/pyvisa/master/pyvisa.pdf
#
########################... | petervago/instrument-control | Python_client/test_tcp.py | Python | gpl-3.0 | 5,163 | 0.025567 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
'''
narralyzer.config
~~~~~~~~~~~~~~~~~
Handle misc config variables.
:copyright: (c) 2016 Koninklijke Bibliotheek, by Willem-Jan Faber.
:license: GPLv3, see licence.txt for more details.
'''
from os import path, listdir
from ConfigParser import Con... | WillemJan/Narralyzer | narralyzer/config.py | Python | gpl-3.0 | 7,418 | 0.001213 |
# Shorten the import for this because it will be used in configs
from libqtile.backend.wayland.inputs import InputConfig # noqa: F401
| qtile/qtile | libqtile/backend/wayland/__init__.py | Python | mit | 135 | 0 |
import unittest
from datetime import date
from binder.col import *
from binder.table import Table, SqlCondition, SqlSort, AND, OR
from bindertest.tabledefs import Foo, Bar
class TableTest(unittest.TestCase):
def test_init_2_AutoIdCols(self):
# Table can have only 1 AutoIdCol
try:
T... | divtxt/binder | bindertest/test_table.py | Python | mit | 9,815 | 0.002038 |
"""
General utility functions that are not specific to Maya Commands or the
OpenMaya API.
Note:
By default, handlers are installed for the root logger. This can be overriden
with env var MAYA_DEFAULT_LOGGER_NAME.
Env vars MAYA_GUI_LOGGER_FORMAT and MAYA_SHELL_LOGGER_FORMAT can be used to
override the default format... | AtonLerin/pymel | maya/utils.py | Python | bsd-3-clause | 9,716 | 0.003396 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutView.
.. note:: 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.
"""
__a... | nirvn/QGIS | tests/src/python/test_qgslayoutview.py | Python | gpl-2.0 | 27,525 | 0.00436 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("zerver", "0301_fix_unread_messages_in_deactivated_streams"),
]
operations = [
# We do Stream lookups case-insensitively with respect to the name, but we were missing
# the appropriate (realm... | andersk/zulip | zerver/migrations/0302_case_insensitive_stream_name_index.py | Python | apache-2.0 | 706 | 0.004249 |
from kombu.tests.utils import unittest
from kombu import BrokerConnection, Exchange
from kombu import compat
from kombu.tests.mocks import Transport, Channel
class test_misc(unittest.TestCase):
def test_iterconsume(self):
class Connection(object):
drained = 0
def drain_events(... | mzdaniel/oh-mainline | vendor/packages/kombu/kombu/tests/test_compat.py | Python | agpl-3.0 | 10,185 | 0.000295 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.7.2",
"llvm": "6.0.0",
"moztools": "0.0.1-5",
"ninja": "1.7.1",
"openss... | dati91/servo | python/servo/packages.py | Python | mpl-2.0 | 343 | 0 |
from __future__ import absolute_import
import logging
import re
import pip
from pip.req import InstallRequirement
from pip.req.req_file import COMMENT_RE
from pip.utils import get_installed_distributions
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.p... | BitWriters/Zenith_project | zango/lib/python3.5/site-packages/pip/operations/freeze.py | Python | mit | 5,194 | 0 |
"""
slackrealtime/event.py - Event handling for Slack RTM.
Copyright 2014-2020 Michael Farrell <http://micolous.id.au>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the L... | micolous/python-slackrealtime | src/slackrealtime/event.py | Python | gpl-3.0 | 5,496 | 0.025837 |
# Copyright (c) 2013 OpenStack Foundation.
# 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... | dims/neutron | neutron/db/extradhcpopt_db.py | Python | apache-2.0 | 6,854 | 0 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
def execute(filters=None):
data = []
parents = {
"Sales BOM Item": "Sales BOM",
"BOM Explosion Item": "BOM",
"BOM ... | mbauskar/Das_Erpnext | erpnext/stock/report/bom_search/bom_search.py | Python | agpl-3.0 | 1,068 | 0.034644 |
"""
Template tags for reversion application.
"""
| oblalex/django-workflow | src/workflow/templatetags/__init__.py | Python | mit | 49 | 0 |
"""
Django settings for proxyme project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | alexsilva/proxyme | proxyme/settings.py | Python | mit | 2,487 | 0.000402 |
import math
import unicodedata as uda
from binascii import unhexlify, hexlify
from torba.rpc.jsonrpc import RPCError
from torba.server.hash import hash_to_hex_str
from torba.server.session import ElectrumX
from torba.server import util
from lbry.schema.result import Outputs
from lbry.schema.url import URL
from lbry.w... | lbryio/lbry | lbry/lbry/wallet/server/session.py | Python | mit | 16,685 | 0.003776 |
import functools
import typing
import inspect
import itertools
import supycache
from telegram import Bot, User
@supycache.supycache(cache_key='admin_ids_{1}', max_age=10 * 60)
def get_admin_ids(bot: Bot, chat_id):
return [admin.user.id for admin in bot.get_chat_administrators(chat_id)]
def is_user_group_admin(... | Djaler/ZloyBot | utils.py | Python | mit | 2,934 | 0.001961 |
# Let's import the teq module. Make sure the dynamic linker is setup to find libteq.so. Also
# make sure that python finds teq.so (the python module).
#
import teq
# Let's import the little python library that makes some things a little easier
from pyteq import *
# Create a teq object. This creates the jack client, ... | fps/teq | example.py | Python | lgpl-3.0 | 2,171 | 0.012897 |
#pylint: skip-file
import io
import struct
import pytest
from kafka.protocol.api import RequestHeader
from kafka.protocol.commit import GroupCoordinatorRequest
from kafka.protocol.fetch import FetchRequest, FetchResponse
from kafka.protocol.message import Message, MessageSet, PartialMessage
from kafka.protocol.metada... | ohmu/kafka-python | test/test_protocol.py | Python | apache-2.0 | 12,430 | 0.001287 |
import numpy as np
from numpy import linalg as la
from numpy import testing as np_testing
from pymanopt.manifolds import FixedRankEmbedded
from .._test import TestCase
class TestFixedRankEmbeddedManifold(TestCase):
def setUp(self):
self.m = m = 10
self.n = n = 5
self.k = k = 3
se... | pymanopt/pymanopt | tests/test_manifolds/test_fixed_rank.py | Python | bsd-3-clause | 7,028 | 0 |
# -*- coding: utf-8 -*-
""" Thermodynamic analysis for Flux-Based Analysis
.. moduleauthor:: pyTFA team
"""
from .thermo.tmodel import ThermoModel
| EPFL-LCSB/pytfa | pytfa/__init__.py | Python | apache-2.0 | 151 | 0 |
# -*- coding: ISO-8859-1 -*-
#
# Copyright (C) 2011 Michael Schindler <m-schindler@users.sourceforge.net>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX 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... | paradigmsort/MagicValidate | pyx/metapost/path.py | Python | mit | 12,868 | 0.003575 |
"""Support for the Torque OBD application."""
import logging
import re
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_EMAIL, CONF_NAME
from hom... | fbradyirl/home-assistant | homeassistant/components/torque/sensor.py | Python | apache-2.0 | 3,807 | 0 |
import doublyPeriodic
import numpy as np; from numpy import pi
import time
class model(doublyPeriodic.numerics):
def __init__(
self,
name = "hydrostaticWaveEquationExample",
# Grid parameters
nx = 128,
Lx = 2.0*pi,
ny = None,
Ly ... | glwagner/py2Periodic | build/lib/py2Periodic/hydrostaticWavesInXY.py | Python | mit | 10,836 | 0.01698 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/v1_resource_quota.py | Python | apache-2.0 | 7,239 | 0.001796 |
class CreateMapping(object):
def __init__(self):
self.request_id = ''
self.mapping = '' | M4gn4tor/mastercard-api-python | Services/moneysend/domain/card_mapping/createmapping.py | Python | bsd-3-clause | 108 | 0.009259 |
from __future__ import print_function
from contextlib import closing
import cmd
import codecs
import inspect
import json
import os
import random
import re
import socket
import sqlite3
import string
import subprocess
import sys
import traceback
#=================================================
# SUPPORT CLASSES
#=====... | praetorian-inc/pentestly | recon/core/framework.py | Python | gpl-3.0 | 40,377 | 0.003715 |
import sys
import os
import os.path
import json
import filelock
import tempfile
import logging
import warnings
import multiprocessing
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import LazyObject, empty
from biohub.utils.collections import unique
from biohub.utils.module impor... | igemsoftware2017/USTC-Software-2017 | biohub/core/conf/__init__.py | Python | gpl-3.0 | 10,903 | 0.000459 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('artist', '0002_auto_20150322_1630'),
]
operations = [
migrations.CreateModel(
name='Event',
fields=[... | fotcorn/liveinconcert | event/migrations/0001_initial.py | Python | mit | 777 | 0.003861 |
# -*- coding: utf-8 -*-
"""template tags""" | ljean/coop_cms | coop_cms/templatetags/__init__.py | Python | bsd-3-clause | 43 | 0.023256 |
# encoding: utf8 | CooperLuan/sasoup | examples/__init__.py | Python | mit | 16 | 0.0625 |
#
# Copyright (c) 2014, Arista Networks, 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 condit... | arista-eosplus/pyeapi | test/system/test_api_system.py | Python | bsd-3-clause | 9,596 | 0.000625 |
"""Import Module Plotly To Ploting Graph"""
import plotly.plotly as py
import plotly.graph_objs as go
"""Open and Read CSV from database"""
data = open('Real_Final_database_02.csv')
alldata = data.readlines()
listdata = []
for i in alldata:
listdata.append(i.strip().split(','))
type_z = ['Flood', 'Epidemic', 'Drou... | pdeesawat/PSIT58_test_01 | Code_Affect_Damage_Death_countries/Myanmar_total_death.py | Python | apache-2.0 | 1,846 | 0.026002 |
import json
import mock
from django.test import TestCase
from django.core.urlresolvers import reverse
class TestAPI(TestCase):
@mock.patch('ldap.initialize')
def test_exists(self, mocked_initialize):
connection = mock.MagicMock()
mocked_initialize.return_value = connection
url = re... | mozilla/medlem | medlem/api/tests.py | Python | mpl-2.0 | 5,529 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2021 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | hivesolutions/appier | src/appier/legacy.py | Python | apache-2.0 | 13,083 | 0.02217 |
# -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
| pmrowla/p101stat | tests/test_functional.py | Python | bsd-3-clause | 101 | 0 |
import json
import time
import sched
from api import send_message
scheduler = sched.scheduler(time.time, time.sleep)
def load_reminders():
reminders = {}
try:
with open("data/reminders.json") as fp:
reminders = json.load(fp)
except Exception:
with open("data/reminders.json",... | lucasberti/telegrao-py | plugins/melenbra.py | Python | mit | 2,962 | 0.002701 |
'''
Created on Jun 11, 2011
@author: mkiyer
'''
class Breakpoint(object):
def __init__(self):
self.name = None
self.seq5p = None
self.seq3p = None
self.chimera_names = []
@property
def pos(self):
"""
return position of break along sequence measured fr... | madhavsuresh/chimerascan | chimerascan/deprecated/breakpoint.py | Python | gpl-3.0 | 751 | 0.003995 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | forkbong/qutebrowser | qutebrowser/config/config.py | Python | gpl-3.0 | 23,166 | 0.000216 |
#!/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.
"""Gets and writes the configurations of the attached devices.
This configuration is used by later build steps to determine which de... | Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/build/android/gyp/get_device_configuration.py | Python | mit | 2,134 | 0.007498 |
'''
Test particle generator, that the resulting PSD curve matches the one on input.
'''
import unittest
from woo.core import *
from woo.dem import *
from minieigen import *
import numpy
class PsdSphereGeneratorTest(unittest.TestCase):
def setUp(self):
self.gen=PsdSphereGenerator(psdPts=[(.05,0),(.1,20),(.2... | sjl767/woo | py/tests/psd.py | Python | gpl-2.0 | 5,075 | 0.032906 |
# -*- coding: utf-8 -*-
'''
Created on 18 oct 2013
@author: franck
'''
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from movesevent.models.movesApp import MovesApp
class MovesUser(models.Mod... | francxk/moves-event | movesevent/models/movesUser.py | Python | mit | 1,082 | 0.014787 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0012_auto_20160204_1503'),
]
operations = [
migrations.AlterModelOptions(
name='eventassignment',
... | blossomica/airmozilla | airmozilla/main/migrations/0013_auto_20160223_1757.py | Python | bsd-3-clause | 1,622 | 0.00185 |
import foo, bar | asedunov/intellij-community | python/testData/joinLines/BackslashBetweenTargetsInImport-after.py | Python | apache-2.0 | 15 | 0.133333 |
# Copyright 2016 David Lapsley
#
# 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... | delapsley/relman | relman/test.py | Python | apache-2.0 | 1,179 | 0.000848 |
import os
import sys
import subprocess
testP = {
"2005": [
{
"date": "2005-10-17",
"videos": [
"http://thecolbertreport.cc.com/videos/61f6xj/intro---10-17-05",
"http://thecolbertreport.cc.com/videos/w9dr6d/first-show",
"http://thecolbertreport.cc.com/videos/63ite2/the-word---t... | traltixx/pycolbert | pycolbert.py | Python | gpl-2.0 | 853,594 | 0.004569 |
import os, sys; sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
import pytest
from lasio import read
test_dir = os.path.dirname(__file__)
egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn)
def test_open_url():
l = read("https://raw.githubusercontent.com/kinverarity1/"
... | Kramer477/lasio | tests/test_open_file.py | Python | mit | 2,943 | 0.002718 |
"""bla"""
# pylint: disable=no-absolute-import
__revision__ = 'yo'
from input import func_w0233
class Aaaa(func_w0233.AAAA):
"""test dotted name in ancestors"""
def __init__(self):
func_w0233.AAAA.__init__(self)
| devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/pylint/test/input/func_dotted_ancestor.py | Python | agpl-3.0 | 231 | 0.004329 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... | fretsonfire/fof-python | src/NetworkTest.py | Python | mit | 2,106 | 0.004274 |
from distutils.core import setup
setup (
name = 'quaternion_class'
author = 'Matthew Nichols'
author_email = 'mattnichols@gmail.com'
packages = ['quaternion']
package_dir = {'quaternion':src}
) | mlnichols/quaternion_class | setup.py | Python | mit | 214 | 0.060748 |
from django.shortcuts import render
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from edamame import base, utils, generic
from . import models
class SiteViews(base.... | tokibito/django-edamame | example/note/views.py | Python | mit | 1,407 | 0.002132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.