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 |
|---|---|---|---|---|---|---|
from . import integ_test_base
class TestCustomEvaluateTimeout(integ_test_base.IntegTestBase):
def _get_evaluate_timeout(self) -> str:
return "3"
def test_custom_evaluate_timeout_with_script(self):
# Uncomment the following line to preserve
# test case output and other files (config, s... | tableau/TabPy | tests/integration/test_custom_evaluate_timeout.py | Python | mit | 1,223 | 0.000818 |
import dynet_config
dynet_config.set_gpu()
import dynet as dy
import os
import pickle
import numpy as np
import numpy as np
import os,sys
from sklearn import preprocessing
import pickle, logging
import argparse
debug = 0
class falcon_heavy(object):
def __init__(self, model, args):
self.pc = model.add_su... | saikrishnarallabandi/clustergen_steroids | building_blocks/falcon_models.py | Python | apache-2.0 | 7,925 | 0.029653 |
from django.contrib import admin
from .models import Lesson, Course, CourseLead, QA
# from django.utils.translation import ugettext_lazy as _
from ordered_model.admin import OrderedModelAdmin
from core.models import User
# from adminfilters.models import Species, Breed
class UserAdminInline(admin.TabularInline):
... | pashinin-com/pashinin.com | src/pashinin/admin.py | Python | gpl-3.0 | 1,211 | 0 |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
import sys
import re
import os
import argparse
import requests
from lxml import html as lxml_html
try:
import html
except ImportError:
import HTMLParser
html = HTMLParser.HTMLParser()
try:
import cPickle as pk
except ImportError:
import pickle as pk
c... | RadonX/iScript | leetcode_problems.py | Python | mit | 4,146 | 0.002894 |
"""
preHeatEx.py - (Run this before heatExchanger2.py)
Performs inital energy balance for a basic heat exchanger design
Originally built by Scott Jones in NPSS, ported and augmented by Jeff Chin
NTU (effectiveness) Method
Determine the heat transfer rate and outlet temperatures when the type ... | whiplash01/pyCycle | src/pycycle/heat_exchanger.py | Python | apache-2.0 | 4,907 | 0.01773 |
# -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | PyBossa/pybossa | pybossa/flickr_client.py | Python | agpl-3.0 | 2,464 | 0.000406 |
"""
tests.pytests.unit.beacons.test_bonjour_announce
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bonjour announce beacon test cases
"""
import pytest
import salt.beacons.bonjour_announce as bonjour_announce
@pytest.fixture
def configure_loader_modules():
return {
bonjour_announce: {"last... | saltstack/salt | tests/pytests/unit/beacons/test_bonjour_announce.py | Python | apache-2.0 | 801 | 0.003745 |
class Interval(object):
"""
Represents an interval.
Defined as half-open interval [start,end), which includes the start position but not the end.
Start and end do not have to be numeric types.
"""
def __init__(self, start, end):
"Construct, start must be <= end."
if s... | ActiveState/code | recipes/Python/576816_Interval/recipe-576816.py | Python | mit | 3,064 | 0.014034 |
#
# $Filename$$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
... | DLR-SC/DataFinder | test/unittest/datafinder_test/gui/user/dialogs/datastore_dialog/__init__.py | Python | bsd-3-clause | 1,798 | 0.017798 |
"""
Publishes the Referee Box's messages as a ROS topic named "refbox" with type "referee"
"""
from referee_pb2 import SSL_Referee
import rospy
# Substitute "ekbots" here with your ROS package name
from ekbots.msg import referee, team_info
from socket import socket, inet_aton, IPPROTO_IP, IP_ADD_MEMBERSHIP
from soc... | eagle-knights-ITAM/ssl-refbox-ros | scripts/refbox.py | Python | gpl-2.0 | 1,934 | 0.023785 |
"""Support for Ambient Weather Station Service."""
import asyncio
import logging
from aioambient import Client
from aioambient.errors import WebsocketError
import voluptuous as vol
from homeassistant.components.binary_sensor import DEVICE_CLASS_CONNECTIVITY
from homeassistant.config_entries import SOURCE_IMPORT
from ... | tchellomello/home-assistant | homeassistant/components/ambient_station/__init__.py | Python | apache-2.0 | 20,729 | 0.001495 |
from __future__ import division
from PIL import Image
from . import modes
from .transform import Transform
class ImageSize(object):
@property
def image(self):
if not self._image and self.path:
self._image = Image.open(self.path)
return self._image
def __init__(self, path=No... | knadir/Flask-Images | flask_images/size.py | Python | bsd-3-clause | 3,727 | 0.00322 |
# -*- coding: utf-8 -*-
from datetime import datetime
from app import db
from app.models import components_tags
from app.users.models import User
from app.tags.models import Tag
from app.util import unix_time
class WebComponent(db.Model):
__tablename__ = 'web_component'
id = db.Column(db.Integer, primary_ke... | nrempel/rucksack-api | app/web_components/models.py | Python | mit | 1,563 | 0 |
# 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.
from telemetry.core.backends.chrome import timeline_recorder
from telemetry.timeline import inspector_timeline_data
class TabBackendException(Exception):
... | TeamEOS/external_chromium_org | tools/telemetry/telemetry/core/backends/chrome/inspector_timeline.py | Python | bsd-3-clause | 3,318 | 0.005425 |
#!/usr/local/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2016, Intel Corporation
#
#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; Version 2.
#
#This pr... | raisfathin/chipsec | source/tool/chipsec/hal/spi_uefi.py | Python | gpl-2.0 | 26,618 | 0.018859 |
from __future__ import division
import numpy as np
from . import common_args
from ..util import scale_samples, read_param_file
def sample(problem, N, seed=None):
"""Generate model inputs using Latin hypercube sampling (LHS).
Returns a NumPy matrix containing the model inputs generated by Latin
... | willu47/SALib | src/SALib/sample/latin.py | Python | mit | 1,859 | 0 |
#!/usr/bin/env python
'''
Define functions to query the twitch.tv streaming
websites.
More info on the Twitch.tv REST api here:
https://github.com/justintv/twitch-api
'''
import sys
import logging
import requests
'''
Twitch.tv API stream listing request. This API call takes a comma
separated list of channel names... | gpittarelli/reddit-twitch-bot | lib/twitchtv.py | Python | mit | 1,061 | 0 |
from __future__ import with_statement
from fabric.contrib.console import confirm
from fabric.api import local
import fileinput
def server(port=""):
replace_for_local()
if port:
local("python manage.py runserver 0.0.0.0:" + port + " --settings=linkedin_search.local")
else:
local("python ma... | ahmedhosnycs/linkedin-search | fab.py | Python | gpl-2.0 | 575 | 0.003478 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/backup_request.py | Python | mit | 3,146 | 0.001589 |
from __future__ import print_function
import numpy as np
import turtle
from argparse import ArgumentParser
from base64 import decodestring
from zlib import decompress
# Python 2/3 compat
try:
_input = raw_input
except NameError:
_input = input
'''TODO:
* add a matplotlib-based plotter
* add a path export functi... | perimosocordiae/pyhrm | extract_images.py | Python | mit | 2,304 | 0.009549 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/krl1to5/Work/FULL/Sequence-ToolKit/2016/resources/ui/genrep/dialogs/apply_this_to.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
c... | carlos-ferras/Sequence-ToolKit | view/genrep/dialogs/ui_apply_this_to.py | Python | gpl-3.0 | 11,221 | 0.000891 |
from functools import wraps
import numpy
from theano import scalar as scal, Constant
from theano.gof import local_optimizer
from theano.tensor import (DimShuffle, get_scalar_constant_value,
NotScalarConstantError)
from .basic_ops import GpuFromHost, HostFromGpu
from .elemwise import GpuDim... | nke001/attention-lvcsr | libs/Theano/theano/sandbox/gpuarray/opt_util.py | Python | mit | 4,761 | 0 |
from __future__ import with_statement
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
import random
import pickle
from itertools import chain
from scipy import zeros, resize, ravel, asarray
import scipy
from pybrain.utilities import Serializable
class OutOfSyncError(Exception): pass
class VectorFormatError(E... | hassaanm/stock-trading | src/pybrain/datasets/dataset.py | Python | apache-2.0 | 13,198 | 0.001743 |
from twisted.web.server import Site
from .root import RootResource
from .auth import AuthResource
def make_site(**kwargs):
root_resource = RootResource()
auth_resource = AuthResource(kwargs['authenticator'])
root_resource.putChild('auth', auth_resource)
return Site(root_resource)
| shyba/cryptosync | cryptosync/resources/__init__.py | Python | agpl-3.0 | 300 | 0 |
"""
.. todo::
WRITEME
"""
import os
import gc
import warnings
try:
import tables
except ImportError:
warnings.warn("Couldn't import tables, so far SVHN is "
"only supported with PyTables")
import numpy
from theano import config
from pylearn2.datasets import dense_design_matrix
from pylearn2.uti... | skearnes/pylearn2 | pylearn2/datasets/svhn.py | Python | bsd-3-clause | 18,086 | 0.007796 |
## This file is part of conftron.
##
## Copyright (C) 2011 Matt Peddie <peddie@jobyenergy.com>
##
## 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 (a... | peddie/conftron | settings.py | Python | gpl-2.0 | 8,250 | 0.00897 |
# 1. del: funkcije
#gender: female = 2, male = 0
def calculate_score_for_gender(gender):
if gender == "male":
return 0
else: return 2
#age: 0-100 if age < 10 --> 0, 11 < age < 20 --> 5, 21 < age < 35 --> 2, 36 < age < 50 --> 4, 50+ --> 1
def calculate_score_for_age(age):
if (age > 11 and age <= 20) or (age >... | CodeCatz/litterbox | ajda/complicajda.py | Python | mit | 5,477 | 0.023553 |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import os
import sys
import re
import gettext
from oxy.arg import parse as argparse
from oxy.verbose import VerboseOutput
class Mbox():
NONE = 0
READ = 1
HEADERCANDIDATE = 2
COPY = 3
END = 4
vOut = None
state = NONE
nLine = 0
header... | anselmobd/mb2e | mb2e.py | Python | mit | 8,171 | 0.000122 |
from gui import playerDialog
name = "haha"
name = playerDialog().show()
print(name)
| SGover/monopoly | test1.py | Python | unlicense | 84 | 0 |
import json
import platform
from datetime import timedelta
from unittest import SkipTest
from nose.tools import nottest
from functools import wraps
from acouchbase.cluster import (Cluster, get_event_loop,
close_event_loop)
from couchbase_tests.async_base import AsyncioTestCase
from couc... | couchbase/couchbase-python-client | acouchbase/tests/cases/transcoder_t.py | Python | apache-2.0 | 31,512 | 0.001111 |
import wx
import sys
import os
import time
import threading
import math
import pynotify
import pygame.mixer
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/ext/pprzlink/lib/v1.0/python")
from pprzlink.ivy import IvyMessagesInterface
WIDTH = 150
HEIGHT = 40
UPDATE_INTERVAL = 250
class RadioWatchFrame(wx.Frame):... | baspijhor/paparazzi | sw/ground_segment/python/dashboard/radiowatchframe.py | Python | gpl-2.0 | 2,290 | 0.00131 |
#import wrftools
#from exceptions import ConfigError, DomainError, ConversionError
#import tools
#import io
#__all__ = ['wrftools', 'tools', 'io']
| envhyf/wrftools | wrftools/__init__.py | Python | gpl-3.0 | 148 | 0.033784 |
import sys
import types
import typing as t
import decorator as deco
from gssapi.raw.misc import GSSError
if t.TYPE_CHECKING:
from gssapi.sec_contexts import SecurityContext
def import_gssapi_extension(
name: str,
) -> t.Optional[types.ModuleType]:
"""Import a GSSAPI extension module
This method im... | pythongssapi/python-gssapi | gssapi/_utils.py | Python | isc | 5,004 | 0 |
from mio import runtime
from mio.utils import method
from mio.object import Object
from mio.lexer import encoding
from mio.core.message import Message
from mio.errors import AttributeError
class String(Object):
def __init__(self, value=u""):
super(String, self).__init__(value=value)
self.create_... | prologic/mio | mio/types/string.py | Python | mit | 3,962 | 0.000252 |
registry = set()
def register(active=True):
def decorate(func):
print('running register(active=%s)->decorate(%s)' % (active, func))
if active:
registry.add(func)
else:
registry.discard(func)
return func
return decorate
@register(active=False... | stephenl6705/fluentPy | registration_param.py | Python | mit | 451 | 0.017738 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
"""OVH DynHost IP Updater.
Updates at least every 15 minutes the DynHost Record IP of the server.
Uses the OVH API.
Requires:
* ovh - https://github.com/ovh/python-ovh
* ipgetter - https://github.com/phoemur/ipgetter
"""
import re
import time
import os.path
import ConfigPar... | tuxite/ovh-dynhost-updater | updater.py | Python | apache-2.0 | 4,677 | 0.002138 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-18 23:22
from __future__ import unicode_literals
from django.db import migrations
import enumfields.fields
import wallet.enums
import enum
class TrxType(enum.Enum):
FINALIZED = 0
PENDING = 1
CANCELLATION = 2
class Migration(migrations.Migr... | uppsaladatavetare/foobar-api | src/wallet/migrations/0010_auto_20170218_2322.py | Python | mit | 640 | 0 |
"""
Tests for miscellaneous models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
import re
import warnings
from statsmodels.tsa.statespace import mlemodel
from statsmodels import datasets
from numpy.te... | yl565/statsmodels | statsmodels/tsa/statespace/tests/test_models.py | Python | bsd-3-clause | 6,374 | 0.000157 |
BACKUPPC_DIR = "/usr/share/backuppc"
TARGET_HOST = "192.168.1.65"
BACKUPPC_USER_UID = 110
BACKUPPC_USER_GID = 116
DEBUG = False
TRANSLATIONS = {
'Status_idle': 'inattivo',
'Status_backup_starting': 'avvio backup',
'Status_backup_in_progress': 'backup in esecuzione',
'Status_restore_starting': 'avvio ri... | GiorgioAresu/backuppc-pi-display | settings.py | Python | mit | 1,278 | 0.000782 |
'''
Created on Aug 1, 2012
@author: ouayed
'''
import logging,os
import hdsr_controle.realtech_hdsr.models as model
from django.contrib.gis.utils import LayerMapping,LayerMapError
from django.db import transaction,IntegrityError
from django.utils.datetime_safe import datetime
from hdsr_controle.realtech_hdsr import e... | pombredanne/lizard-progress | hdsr_controle/realtech_hdsr/data_loader.py | Python | gpl-3.0 | 11,413 | 0.013669 |
# Copyright (c) 2018 PaddlePaddle 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 app... | PaddlePaddle/Paddle | python/paddle/fluid/tests/book/test_recommender_system.py | Python | apache-2.0 | 12,089 | 0.000662 |
import asyncio
import gc
import os
import signal
import sys
import threading
import weakref
from datetime import timedelta
from time import sleep
import psutil
import pytest
from tornado import gen
from tornado.locks import Event
from distributed.compatibility import WINDOWS
from distributed.metrics import time
from ... | dask/distributed | distributed/tests/test_asyncprocess.py | Python | bsd-3-clause | 11,851 | 0.000506 |
'''
A Multilayer Perceptron implementation example using TensorFlow library.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
from __future__ import print_function
import tensorf... | isabellewei/deephealth | data/network.py | Python | mit | 3,768 | 0.004777 |
'''
Authors: Donnie Marino, Kostas Stamatiou
Contact: dmarino@digitalglobe.com
Unit tests for the gbdxtools.Idaho class
'''
from gbdxtools import Interface
from gbdxtools.idaho import Idaho
from auth_mock import get_mock_gbdx_session
import vcr
from os.path import join, isfile, dirname, realpath
import tempfile
impor... | michaelconnor00/gbdxtools | tests/unit/test_idaho.py | Python | mit | 2,604 | 0.003072 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | dochang/ansible | lib/ansible/constants.py | Python | gpl-3.0 | 20,345 | 0.01332 |
from coinpy.lib.serialization.structures.s11n_tx import TxSerializer
from coinpy.model.constants.bitcoin import MAX_BLOCK_SIZE, is_money_range
from coinpy.lib.serialization.scripts.serialize import ScriptSerializer
class TxVerifier():
def __init__(self, runmode):
self.runmode = runmode
self.tx_ser... | sirk390/coinpy | coinpy-lib/src/coinpy/lib/transactions/tx_checks.py | Python | lgpl-3.0 | 2,364 | 0.004653 |
""" Simple JSON-RPC 2.0 protocol for aiohttp"""
from .exc import (ParseError, InvalidRequest, InvalidParams,
InternalError, InvalidResponse)
from .errors import JError, JResponse
from validictory import validate, ValidationError, SchemaError
from functools import wraps
from uuid import uuid4
from aio... | zloidemon/aiohttp_jrpc | aiohttp_jrpc/__init__.py | Python | bsd-2-clause | 6,064 | 0 |
import SocketServer
class ProtoHandler(SocketServer.BaseRequestHandler):
def handle(self):
msg = self.request.recv(1024)
a = msg.split(" ",2)
if len(a) >1 and a[0] == "GET":
a = a[1].split("/")
a =[i for i in a if i != '']
if len(a) == 0:
... | wizgrav/protobot | server.py | Python | bsd-3-clause | 861 | 0.020906 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Database Module
# --------------------
from __future__ import unicode_literals
import warnings
import datetime
import frappe
import frappe.defaults
import frappe.async
import re
import frappe.model.meta
from frappe.u... | manassolanki/frappe | frappe/database.py | Python | mit | 30,790 | 0.02897 |
def get_stack_elements(stack):
return stack[1:stack.top].elements
def get_queue_elements(queue):
if queue.head <= queue.tail:
return queue[queue.head:queue.tail - 1].elements
return queue[queue.head:queue.length].elements + queue[1:queue.tail - 1].elements
| wojtask/CormenPy | test/queue_util.py | Python | gpl-3.0 | 279 | 0.003584 |
"""
.. module:: editor_subscribe_label_deleted
The **Editor Subscribe Label Deleted** Model.
PostgreSQL Definition
---------------------
The :code:`editor_subscribe_label_deleted` table is defined in the MusicBrainz Server as:
.. code-block:: sql
CREATE TABLE editor_subscribe_label_deleted
(
editor... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/models/editor_subscribe_label_deleted.py | Python | gpl-2.0 | 1,251 | 0.000799 |
from distutils.core import setup
from setuptools import find_packages
setup(name='blitzdb',
version='0.2.12',
author='Andreas Dewes - 7scientists',
author_email='andreas@7scientists.com',
license='MIT',
entry_points={
},
url='https://github.com/adewes/blitzdb',
packages=find_packages(),
zip_safe=False,
description... | programmdesign/blitzdb | setup.py | Python | mit | 3,033 | 0.008243 |
"""
.. todo::
WRITEME
"""
import theano.tensor as T
from theano.gof.op import get_debug_values
from theano.gof.op import debug_assert
import numpy as np
from theano.tensor.xlogx import xlogx
from pylearn2.utils import contains_nan, isfinite
def entropy_binary_vector(P):
"""
.. todo::
WRITEME pro... | JazzeYoung/VeryDeepAutoEncoder | pylearn2/pylearn2/expr/information_theory.py | Python | bsd-3-clause | 1,193 | 0 |
import re
import unicodedata
from injector import inject, AssistedBuilder
import cx_Oracle as pyoracle
class Oracle(object):
"""Wrapper to connect to Oracle Servers and get all the metastore information"""
@inject(oracle=AssistedBuilder(callable=pyoracle.connect), logger='logger')
def __init__(self, orac... | scm-spain/slippin-jimmy | src/slippinj/databases/drivers/oracle.py | Python | apache-2.0 | 7,437 | 0.004303 |
"""
A python class to encapsulate the ComicBookInfo data
"""
"""
Copyright 2012-2014 Anthony Beville
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... | dickloraine/EmbedComicMetadata | comicbookinfo.py | Python | gpl-3.0 | 4,500 | 0.001778 |
# 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 use ... | illfelder/libcloud | libcloud/compute/drivers/ec2.py | Python | apache-2.0 | 256,785 | 0.000008 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-09 22:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comercial', '0061_auto_20160206_2052'),
]
operations = [
migrations.AddField(
... | dudanogueira/microerp | microerp/comercial/migrations/0062_dadovariavel_tipo.py | Python | lgpl-3.0 | 549 | 0.001821 |
from __future__ import absolute_import, unicode_literals
from collections import namedtuple
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models.fields import FieldDoesNotExist
from django.test.client import RequestFactory
from drf_toolbox.compat import django_pgfields_installed,... | pombredanne/drf-toolbox | tests/test_serializers.py | Python | bsd-3-clause | 23,089 | 0.00078 |
def extractChuunihimeWordpressCom(item):
'''
Parser for 'chuunihime.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loi... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractChuunihimeWordpressCom.py | Python | bsd-3-clause | 560 | 0.033929 |
import functools
import itertools
import json
import multiprocessing
import os
import shutil
import sys
import time
import cv2
import numpy
import utility.config
import utility.cv
import utility.geometry
import utility.gui
import utility.image
import utility.log
# Explicitly disable OpenCL. Querying for OpenCL suppo... | joeydong/endless-lake-player | player.py | Python | mit | 4,891 | 0.002045 |
# Copyright 2015 ARM Limited
#
# 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 writin... | ep1cman/workload-automation | wlauto/instrumentation/energy_model/__init__.py | Python | apache-2.0 | 42,085 | 0.00354 |
# encoding: utf-8
# Copyright 2012 Red Hat, 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 applica... | cgwalters/imagefactory | imagefactory_plugins/Rackspace/__init__.py | Python | apache-2.0 | 667 | 0 |
import requests
class DrygDAO:
def __init__(self):
pass
def get_days_for_year(self, year):
response = requests.get("http://api.dryg.net/dagar/v2.1/%s" % year)
data = response.json()
workdays = [x["datum"] for x in data["dagar"] if x["arbetsfri dag"] == "Nej"]
return wo... | cederstrom/natet-sos-generator | generator/integration/dryg.py | Python | mit | 327 | 0.003058 |
{'level_mc': {'_txt': {'text': '6'},
'currentLabel': 'up',
'progress_mc': {'currentLabel': '_0'}}} | ethankennerly/hotel-vs-gozilla | user/h4.news.py | Python | mit | 126 | 0.007937 |
# coding=utf8
r"""
csection.py -- Create a tree of contents, organized by sections and inside
sections the exercises unique_name.
AUTHOR:
- Pedro Cruz (2012-01): initial version
- Pedro Cruz (2016-03): improvment for smc
An exercise could contain um its %summary tag line a description of section
in form:... | jpedroan/megua | megua/csection.py | Python | gpl-3.0 | 10,442 | 0.009289 |
# Copyright 2017-present Open Networking 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 agr... | opencord/xos | xos/core/migrations/0012_backupoperation_decl_uuid.py | Python | apache-2.0 | 1,124 | 0.00089 |
#!/usr/bin/env python
# Copyright (C) 2011 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This... | klim-iv/phantomjs-qt5 | src/webkit/Tools/efl/common.py | Python | bsd-3-clause | 1,100 | 0.000909 |
import base64
import logging
import platform
from datetime import date, timedelta
from invoke import run, task
from elasticsearch import helpers
from dateutil.parser import parse
from six.moves.urllib import parse as urllib_parse
import scrapi.harvesters # noqa
from scrapi import linter
from scrapi import registry
f... | alexgarciac/scrapi | tasks.py | Python | apache-2.0 | 6,604 | 0.002574 |
# Created by Sean Nelson on 2018-08-19.
# Copyright 2018 Sean Nelson <audiohacked@gmail.com>
#
# This file is part of pyBusPirate.
#
# pyBusPirate 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... | audiohacked/pyBusPirate | tests/test_buspirate_onewire.py | Python | gpl-2.0 | 3,002 | 0.000333 |
from django import template
import clevercss
register = template.Library()
@register.tag(name="clevercss")
def do_clevercss(parser, token):
nodelist = parser.parse(('endclevercss',))
parser.delete_first_token()
return CleverCSSNode(nodelist)
class CleverCSSNode(template.Node):
def __init__(self, node... | amitu/gitology | src/gitology/d/templatetags/clevercsstag.py | Python | bsd-3-clause | 480 | 0.008333 |
from django.contrib.auth.models import User
from rest_framework import serializers
from servicelevelinterface.models import Monitor, Contact, Command
class MonitorSerializer(serializers.ModelSerializer):
owner = serializers.CharField(source='owner.username', read_only=True)
class Meta:
model = Monitor
... | lesavoie/nagiosservice | controlserver/servicelevelinterface/serializers.py | Python | gpl-2.0 | 816 | 0.015931 |
import datetime
import logging
try:
import threading
except ImportError:
threading = None
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
class ThreadTrackingHandler(logging.Handler):
def __init__(self):... | none-da/zeshare | debug_toolbar/panels/logger.py | Python | bsd-3-clause | 2,377 | 0.002945 |
import globus_sdk
CLIENT_ID = 'f7cfb4d6-8f20-4983-a9c0-be3f0e2681fd'
client = globus_sdk.NativeAppAuthClient(CLIENT_ID)
#client.oauth2_start_flow(requested_scopes="https://auth.globus.org/scopes/0fb084ec-401d-41f4-990e-e236f325010a/deriva_all")
client.oauth2_start_flow(requested_scopes="https://auth.globus.org/scopes... | informatics-isi-edu/webauthn | webauthn2/scripts/globus_oauth_client.py | Python | apache-2.0 | 1,011 | 0.004946 |
"""
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous row.
For example,
Consider the following matrix:
[
[1... | dominjune/LeetCode | 074 Search a 2D Matrix.py | Python | mit | 1,679 | 0.011316 |
from django.core.exceptions import MultipleObjectsReturned
from django.shortcuts import redirect
from django.urls import reverse, path
from wagtail.api.v2.router import WagtailAPIRouter
from wagtail.api.v2.views import PagesAPIViewSet, BaseAPIViewSet
from wagtail.images.api.v2.views import ImagesAPIViewSet
from wagtai... | openstax/openstax-cms | openstax/api.py | Python | agpl-3.0 | 2,453 | 0.003675 |
# Copyright 2021 Akretion (http://www.akretion.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "No automatic deletion of SMS",
"summary": "Avoid automatic delete of sended sms",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/conn... | OCA/connector-telephony | sms_no_automatic_delete/__manifest__.py | Python | agpl-3.0 | 543 | 0 |
##########################################################################
#
# Copyright (c) 2007-2010, Image Engine Design 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:
#
# * Redis... | appleseedhq/cortex | test/IECore/ops/presetParsing/presetParsing-1.py | Python | bsd-3-clause | 3,526 | 0.047646 |
#
# Copyright 2018 Analytics Zoo 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 law or agreed to... | intel-analytics/analytics-zoo | pyzoo/test/zoo/chronos/detector/anomaly/test_ae_detector.py | Python | apache-2.0 | 2,541 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | vidartf/hyperspy | hyperspy/io_plugins/__init__.py | Python | gpl-3.0 | 2,279 | 0.000439 |
#
# Autogenerated by Thrift Compiler (0.10.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys
import logging
f... | aweisberg/cassandra-dtest | thrift_bindings/thrift010/Cassandra.py | Python | apache-2.0 | 403,615 | 0.002118 |
"""
This DatabaseHandler is used when you do not have a database installed.
"""
import proof.ProofConstants as ProofConstants
import proof.adapter.Adapter as Adapter
class NoneAdapter(Adapter.Adapter):
def __init__(self):
pass
def getResourceType(self):
return ProofConstants.NONE
def ge... | mattduan/proof | adapter/NoneAdapter.py | Python | bsd-3-clause | 653 | 0.009188 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains Custom Exception Class"""
class CustomError(Exception):
"""
Attributes:
None
"""
def __init__(self, message, cause):
"""Custom Error that stores error reason.
Args:
cause (str): Reason for error.
... | ModestoCabrera/is210-week-12-synthesizing | task_02.py | Python | mpl-2.0 | 616 | 0 |
"""The pioneer component."""
| aronsky/home-assistant | homeassistant/components/pioneer/__init__.py | Python | apache-2.0 | 29 | 0 |
#!/usr/bin/python
"""
m5subband.py ver. 1.1 Jan Wagner 20150603
Extracts a narrow subband via filtering raw VLBI data.
Reads formats supported by the mark5access library.
Usage : m5subband.py <infile> <dataformat> <outfile>
<if_nr> <factor> <Ldft>
<start_bin> <stop_bi... | demorest/mark5access | python/examples/m5subband.py | Python | gpl-3.0 | 8,051 | 0.033288 |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | googleads/google-ads-python | google/ads/googleads/v9/services/services/bidding_seasonality_adjustment_service/transports/grpc.py | Python | apache-2.0 | 12,389 | 0.001291 |
#coding: utf-8
from scapy.all import *
class WILDCARD:
""" Used to indicate that some fields in a scapy packet should be ignored when comparing """
pass
class NO_PKT:
""" Indicate that a sent packet should have no reply """
pass
def pkt_match(expected, actual):
""" Check if all fields described i... | Zashas/segway | structs.py | Python | gpl-3.0 | 5,933 | 0.008933 |
# -*- coding: utf-8 -*-
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**metadata module.**
Contact : ole.moller.nielsen@gmail.com
.. 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 Sof... | Gustry/inasafe | safe/metadata/property/boolean_property.py | Python | gpl-3.0 | 1,696 | 0 |
# 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... | guschmue/tensorflow | tensorflow/contrib/framework/python/ops/variables.py | Python | apache-2.0 | 29,690 | 0.005322 |
#!/usr/bin/python2
# -- coding: utf-8 --
# Converts a .qm file to a .ts file.
# More info: http://www.mobileread.com/forums/showthread.php?t=261771
# By pipcat & surquizu. Thanks to: tshering, axaRu, davidfor, mobileread.com
import codecs, cgi
def clean_text(txt, is_utf) :
if is_utf == False:
txt = txt.decode('u... | pipcat/kobo | translation-tools/qm2ts.py | Python | gpl-3.0 | 3,181 | 0.033008 |
# -*- coding:utf-8 -*-
import abc
import sys
import inspect
import types
import itertools
import networkx as nx
from pandaspipe.util import patch_list, isSubset
from pandaspipe.base import PipelineEntity
import logging
_log = logging.getLogger(__name__)
_log.addHandler(logging.StreamHandler(stream=sys.stdout))
class... | SirEdvin/Pandas-Pipe | pandaspipe/pipeline.py | Python | apache-2.0 | 10,315 | 0.002714 |
#-*- encoding: utf-8 -*-
"""
Right triangles with integer coordinates
The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form ΔOPQ.
There are exactly fourteen triangles containing a right angle that can be formed when each co-ordinate lies between 0 and... | zlsun/ProjectEuler | 091.py | Python | mit | 484 | 0.008421 |
# Copyright (C)2016 D. Plaindoux.
#
# 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 2, or (at your option) any
# later version.
import unittest
from fluent_rest.spec.rest ... | d-plaindoux/fluent-rest | tests/verb_test.py | Python | lgpl-2.1 | 1,943 | 0 |
# Copyright 2010-2021 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of SkoolKit.
#
# SkoolKit is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) an... | skoolkid/skoolkit | skoolkit/skoolctl.py | Python | gpl-3.0 | 29,525 | 0.001897 |
from django.db.models import Count
from django.conf import settings
from solo.models import SingletonModel
import loader
MAX_REVIEWERS = settings.MAX_REVIEWERS
# Simple algorithm that checks to see the number of years the studies span and
# returns one study per year
def one_per_year(candidate_studies, user, annotatio... | chop-dbhi/django-dicom-review | dicom_review/prioritizers.py | Python | bsd-2-clause | 1,748 | 0.014302 |
##############################################################################
# Copyright (c) 2017, Los Alamos National Security, LLC
# Produced at the Los Alamos National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, ... | TheTimmy/spack | var/spack/repos/builtin/packages/quinoa/package.py | Python | lgpl-2.1 | 2,175 | 0.00092 |
from django.conf import settings
from django.contrib import messages
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth i... | ekesken/istatistikciadamlazim | allauth/socialaccount/helpers.py | Python | gpl-3.0 | 7,010 | 0.00271 |
import pygame
import sys
import os
class Env:
def __init__(self, teamA, teamB, field_size, display, robots=None,
debug=False):
self.teamA = teamA
self.teamB = teamB
self.width = field_size[0]
self.height = field_size[1]
self.display = display
self.b... | xlcteam/py-soccersim | soccersim/env.py | Python | apache-2.0 | 1,133 | 0 |
import StringIO
class Plugin(object):
ANGULAR_MODULE = None
JS_FILES = []
CSS_FILES = []
@classmethod
def PlugIntoApp(cls, app):
pass
@classmethod
def GenerateHTML(cls, root_url="/"):
out = StringIO.StringIO()
for js_file in cls.JS_FILES:
js_file = js... | dsweet04/rekall | rekall-gui/manuskript/plugin.py | Python | gpl-2.0 | 836 | 0 |
# -*- coding: utf-8 -*-
#
# Read the Docs Template documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 26 14:19:49 2014.
#
# 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
# autogenera... | DigitalSkills-fr/Docs | docs/conf.py | Python | apache-2.0 | 8,474 | 0.006136 |
import pytest
import os
@pytest.fixture(autouse=True)
def change_tempory_directory(tmpdir):
tmpdir.chdir()
yield
if os.path.exists("tarnow.tmp"):
os.remove("tarnow.tmp")
@pytest.fixture(autouse=True)
def patch_subprocess(mocker):
mocker.patch("subprocess.call")
| steffenschroeder/tarnow | tests/conftest.py | Python | mit | 290 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.