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 |
|---|---|---|---|---|---|---|
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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... | MangoMangoDevelopment/neptune | lib/ros_comm-1.12.0/utilities/roswtf/src/roswtf/graph.py | Python | bsd-3-clause | 14,968 | 0.008485 |
import opendbpy as odb
import helper
import odbUnitTest
class TestWireCodec(odbUnitTest.TestCase):
#This Function is called before each of the test cases defined below
def setUp(self):
self.db, self.tech, self.m1, self.m2, self.m3, self.v12, self.v23 = helper.createMultiLayerDB()
self.chip = ... | The-OpenROAD-Project/OpenROAD | src/odb/test/unitTestsPython/TestWireCodec.py | Python | bsd-3-clause | 5,470 | 0.005484 |
import os
import sys
import argparse
import ConfigParser
import testcase_service
from bantorra.util import define
from bantorra.util.log import LOG as L
class TestCase_Base(testcase_service.TestCaseUnit):
config = {}
"""
TestCase_Base.
- Parse Command Line Argument.
- Create Se... | TE-ToshiakiTanaka/bantorra.old | script/testcase_base.py | Python | mit | 1,751 | 0.001142 |
self.description = "incoming package replaces symlink with directory (order 1)"
lp = pmpkg("pkg1")
lp.files = ["usr/lib/foo",
"lib -> usr/lib"]
self.addpkg2db("local", lp)
p1 = pmpkg("pkg1", "1.0-2")
p1.files = ["usr/lib/foo"]
self.addpkg2db("sync", p1)
p2 = pmpkg("pkg2")
p2.files = ["lib/bar"]
self.addp... | kylon/pacman-fakeroot | test/pacman/tests/sync701.py | Python | gpl-2.0 | 504 | 0 |
# Learn Python -- level 2 logic
# Copyright (C) 2013 Cornell FB Hackathon Team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) an... | pniedzielski/fb-hackathon-2013-11-21 | src/py/level3.py | Python | agpl-3.0 | 1,260 | 0.001587 |
from __future__ import absolute_import
__all__ = ('get_auth_header',)
def get_auth_header(client, api_key=None, secret_key=None):
header = [
('sentry_client', client),
('sentry_version', '5'),
]
if api_key:
header.append(('sentry_key', api_key))
if secret_key:
header.... | jokey2k/sentry | src/sentry/testutils/helpers/auth_header.py | Python | bsd-3-clause | 431 | 0 |
"""Code representing a query."""
import six
from ichnaea.api.locate.constants import (
DataAccuracy,
MIN_WIFIS_IN_QUERY,
)
from ichnaea.api.locate.schema import (
CellAreaLookup,
CellLookup,
FallbackLookup,
WifiLookup,
)
try:
from collections import OrderedDict
except ImportError: # prag... | therewillbecode/ichnaea | ichnaea/api/locate/query.py | Python | apache-2.0 | 10,806 | 0 |
"""Defines serializers used by the Team API."""
from copy import deepcopy
from django.contrib.auth.models import User
from django.db.models import Count
from django.conf import settings
from django_countries import countries
from rest_framework import serializers
from openedx.core.lib.api.serializers import Collapsed... | solashirai/edx-platform | lms/djangoapps/teams/serializers.py | Python | agpl-3.0 | 7,981 | 0.00213 |
import argparse
from getpass import getpass
import json
import sys
import textwrap
import zmq
import colorama
from colorama import Fore
def execute(code):
ctx = zmq.Context.instance()
ctx.setsockopt(zmq.LINGER, 50)
repl_in = ctx.socket(zmq.PUSH)
repl_in.connect('tcp://127.0.0.1:2000')
repl_out = ... | lablup/sorna-repl | python-tensorflow/test_run.py | Python | lgpl-3.0 | 2,665 | 0.001876 |
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, ... | Gorbeh/sf | src/WindowManager.py | Python | agpl-3.0 | 16,966 | 0.0234 |
import numpy as np
import gelato
import pytest
@pytest.fixture()
def seeded():
gelato.set_tt_rng(42)
np.random.seed(42)
| ferrine/gelato | gelato/tests/conftest.py | Python | mit | 130 | 0 |
import subprocess
import json
import math
import re
import lizard
from jinja2 import Environment, FileSystemLoader
from xml.dom import minidom
from decimal import Decimal
from analyzr.settings import CONFIG_PATH, PROJECT_PATH, LAMBDA
XML_ILLEGAL = u'([\u0000-\u0008\u000b-\u000c\u000e-\u001f\ufffe-\uffff])|([%s-%s][... | frontendphil/analyzr | parsr/checkers.py | Python | mit | 15,240 | 0.001247 |
def json_headers(f):
def wrapped(*args, **kwargs):
resp = f(*args, **kwargs)
resp.headers['Content-Type'] = 'application/json'
return resp
return wrapped
def max_age_headers(f):
def wrapped(*args, **kwargs):
resp = f(*args, **kwargs)
resp.headers['Access-Control-Max-... | ryepdx/scale_proxy_server | header_decorators.py | Python | agpl-3.0 | 376 | 0.005319 |
from __future__ import unicode_literals
from datetime import date, time, datetime
import django
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, Client
from django.test.clien... | pombredanne/django-custard | custard/tests/test.py | Python | mit | 17,657 | 0.003908 |
# BurnMan - a lower mantle toolkit
# Copyright (C) 2012-2014, Myhill, R., Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
# Released under GPL v2 or later.
# This is a standalone program that converts a tabulated version of the Stixrude and Lithgow-Bertelloni data format into the standard burnman format (printed ... | QuLogic/burnman | burnman/data/input_raw_endmember_datasets/HHPH2013data_to_burnman.py | Python | gpl-2.0 | 3,130 | 0.01246 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/12/7 17:13
# @Author : Zhiwei Yang
# @File : call_str_repr.py.py
class print_name(object):
def __init__(self,name):
self.name = name
class print_name_pro(object):
def __int__(self,name):
self.name = name
def __str__(self)... | tencrance/cool-config | python_tricks/call_str_repr.py | Python | mit | 510 | 0.018595 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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.or... | cidadania/e-cidadania | src/core/spaces/models.py | Python | apache-2.0 | 8,796 | 0.003183 |
# Copyright 2014-2017 by Akira Yoshiyama <akirayoshiyama@gmail.com>.
# 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... | yosshy/osclient2 | osclient2/cinder/v2/volume_backup.py | Python | apache-2.0 | 4,420 | 0 |
"""
Example: parse JSON.
"""
from peglet import Parser, hug, join, attempt
literals = dict(true=True,
false=False,
null=None)
mk_literal = literals.get
mk_object = lambda *pairs: dict(pairs)
escape = lambda s: s.decode('unicode-escape')
mk_number = float
# Following http://www.... | JaDogg/__py_playground | reference/peglet/examples/json.py | Python | mit | 2,243 | 0.012929 |
# -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import sys
import datetime
from core.transmissionrpc.constants import PRIORITY, RATIO_LIMIT, IDLE_LIMIT
from core.transmissionrpc.utils import Field, format_timedelta
from six import integer_types... | bbsan2k/nzbToMedia | core/transmissionrpc/torrent.py | Python | gpl-3.0 | 16,349 | 0.001529 |
import array
import itertools
import logging
import multiprocessing
import numpy
import scipy.sparse
import sharedmem
import sppy
import time
from sandbox.misc.RandomisedSVD import RandomisedSVD
from sandbox.recommendation.AbstractRecommender import AbstractRecommender
from sandbox.recommendation.IterativeSoftImput... | charanpald/sandbox | sandbox/recommendation/MaxLocalAUC.py | Python | gpl-3.0 | 37,126 | 0.016134 |
try:
import traceback
import argparse
import textwrap
import glob
import os
import logging
import datetime
import multiprocessing
from libs import LasPyConverter
except ImportError as err:
print('Error {0} import module: {1}'.format(__name__, err))
traceback.print_exc()
e... | KAMI911/lactransformer | lactransformer/lasdiff.py | Python | mpl-2.0 | 6,565 | 0.003656 |
"""An implementation of Matching Layer."""
import typing
import tensorflow as tf
from keras.engine import Layer
class MatchingLayer(Layer):
"""
Layer that computes a matching matrix between samples in two tensors.
:param normalize: Whether to L2-normalize samples along the
dot product axis befor... | faneshion/MatchZoo | matchzoo/layers/matching_layer.py | Python | apache-2.0 | 5,753 | 0 |
from list_node import ListNode
from instruction import Instruction, Subneg4Instruction
def sr_mult(WM, LM):
namespace_bak = WM.getNamespace(string=False)
WM.setNamespace(["sr","mult"])
c_0 = WM.const(0)
c_1 = WM.const(1)
c_m1 = WM.const(-1)
c_32 = WM.const(32)
a = WM.addDataWord(0, "arg1")
b = W... | AZQ1994/s4compiler | sr_mult.py | Python | gpl-3.0 | 5,281 | 0.065897 |
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | openstack/horizon | openstack_dashboard/dashboards/project/networks/ports/urls.py | Python | apache-2.0 | 1,111 | 0 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/models/_models.py | Python | mit | 674,347 | 0.003676 |
# -*- coding: utf-8 -*-
# Main kivy import
import kivy
# Additional kivy imports
from kivy.app import App
from kivy.config import Config
# Screens
from screens import screenmanager
from screens.mainscreen import MainScreen
from screens.ingamescreen import IngameScreen
# Cause program to end if the required kivy ver... | ohaz/Colours | main.py | Python | apache-2.0 | 1,269 | 0.002364 |
import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.provider import ContainersTestItem
from cfme.utils.appliance.implementations.ui impor... | nachandr/cfme_tests | cfme/tests/containers/test_containers_smartstate_analysis.py | Python | gpl-2.0 | 5,838 | 0.002398 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jendap/tensorflow | tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py | Python | apache-2.0 | 10,917 | 0.005954 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PortalTab'
db.create_table('lizard_box_portaltab', (
('id', self.gf('django.db... | lizardsystem/lizard-box | lizard_box/migrations/0008_auto__add_portaltab__add_layoutportaltab__chg_field_box_url.py | Python | gpl-3.0 | 5,651 | 0.007963 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2011 Chris D. Lasher & Phillip Whisenhunt
#
# This software is released under the MIT License. Please see
# LICENSE.txt for details.
"""A program to detect Process Linkage Networks using
Simulated Annealing.
"""
import collections
import itertools
impo... | gotgenes/BiologicalProcessNetworks | bpn/mcmc/sabpn.py | Python | mit | 3,485 | 0.003156 |
from misc_utils import get_config, get_logger, tokenize
from discourse_relation import DiscourseRelation
from collections import Counter, defaultdict
import json
import abc
import numpy as np
from os.path import join
import os
logger = get_logger(__name__)
class Resource(metaclass=abc.ABCMeta):
def __init__(self,... | jimmycallin/master-thesis | architectures/svm_baseline/resources.py | Python | mit | 5,218 | 0.002108 |
# -*- coding: utf-8 -*-
"""Test suite for the TG app's models"""
from __future__ import unicode_literals
from nose.tools import eq_
from wiki20 import model
from wiki20.tests.models import ModelTest
class TestGroup(ModelTest):
"""Unit test case for the ``Group`` model."""
klass = model.Group
attrs = dict(... | txdywy/wiki20 | wiki20/tests/models/test_auth.py | Python | gpl-2.0 | 1,523 | 0.009849 |
from annoying.decorators import ajax_request, render_to
from blogs.views import blog_list
from django.db.models import Count
from django.http import HttpResponseRedirect, HttpResponseBadRequest
from snipts.utils import get_lexers_list
from taggit.models import Tag
@render_to('homepage.html')
def homepage(request):
... | nicksergeant/snipt | views.py | Python | mit | 1,815 | 0.000551 |
""" Set-up script to install PyFAST locally
"""
from setuptools import setup
setup(name='pyfast',
version='0.1',
description='Tools for working with wind turbine simulator FAST',
url='https://github.com/jennirinker/PyFAST.git',
author='Jenni Rinker',
author_email='jennifer.m.rinker@gmail.... | jennirinker/PyFAST | setup.py | Python | gpl-3.0 | 395 | 0.002532 |
from dominoes import players
from dominoes import search
from dominoes.board import Board
from dominoes.domino import Domino
from dominoes.exceptions import EmptyBoardException
from dominoes.exceptions import EndsMismatchException
from dominoes.exceptions import GameInProgressException
from dominoes.exceptions import G... | abw333/dominoes | dominoes/__init__.py | Python | mit | 675 | 0 |
# wsse/client/requests/tests/test_auth.py
# coding=utf-8
# pywsse
# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso
# Date: September 1st, 2016
# Description: Test the requests authentication implementation
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.c... | PrincetonUniversity/pywsse | wsse/client/requests/tests/test_auth.py | Python | lgpl-3.0 | 2,780 | 0.026278 |
# -*- coding: utf-8 -*-
#
# This file is part of django-email-change.
#
# django-email-change adds support for email address change and confirmation.
#
# Development Web Site:
# - http://www.codetrax.org/projects/django-email-change
# Public Source Code Repository:
# - https://source.codetrax.org/hgroot/djang... | novapost/django-email-change | src/email_change/__init__.py | Python | apache-2.0 | 1,088 | 0.001838 |
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, user, password):
wd = self.app.wd
self.app.open_home_page()
self.app.type_text("user", user)
self.app.type_text("pass", password)
wd.find_element_by_css_selector("input[value='Login']").... | obutkalyuk/Python_15 | fixture/session.py | Python | apache-2.0 | 1,157 | 0.002593 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm
fig = plt.figure()
ax = {}
ax["DropOut"] = fig.add_subplot(121)
ax["NoDropOut"] = fig.add_subplot(122)
dList = {}
dList["DropOut"] = ["DropOut1","DropOut2","DropOut3"]
dList["NoDropOut"] = ["NoDropOut1","NoDropOut2"]
d... | ysasaki6023/NeuralNetworkStudy | cifar02/analysis_DropTest.py | Python | mit | 925 | 0.028108 |
from bayes_opt import BayesianOptimization
'''
Example of how to use this bayesian optimization package.
'''
# Lets find the maximum of a simple quadratic function of two variables
# We create the bayes_opt object and pass the function to be maximized
# together with the paraters names and their bounds.
bo = BayesianO... | mpearmain/BayesBoost | examples/usage.py | Python | apache-2.0 | 1,604 | 0.00187 |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from . import _wrap_numbers, Symbol, Number, Matrix
def symbols(s):
""" mimics sympy.symbols """
tup = tuple(map(Symbol, s.replace(',', ' ').split()))
if len(tup) == 1:
return tup[0]
else:
return... | bjodah/pysym | pysym/util.py | Python | bsd-2-clause | 2,569 | 0 |
from typing import Any, Dict, Mapping, Optional, Tuple
from .exceptions import UnknownUpdateCardAction
SUPPORTED_CARD_ACTIONS = [
u'updateCard',
u'createCard',
u'addLabelToCard',
u'removeLabelFromCard',
u'addMemberToCard',
u'removeMemberFromCard',
u'addAttachmentToCard',
u'addChecklist... | tommyip/zulip | zerver/webhooks/trello/view/card_actions.py | Python | apache-2.0 | 10,437 | 0.004791 |
import numpy as np
import plotly.graph_objs as go
def p2c(r, theta, phi):
"""Convert polar unit vector to cartesians"""
return [r * np.sin(theta) * np.cos(phi),
r * np.sin(theta) * np.sin(phi),
r * np.cos(theta)]
# return [-r * np.cos(theta),
# r * np.sin(theta) * np.sin(... | cydcowley/Imperial-Visualizations | visuals_EM/Waves and Dielectrics/plotly_arrows.py | Python | mit | 2,137 | 0.003745 |
from customers.models import Client
from django.conf import settings
from django.db import utils
from django.views.generic import TemplateView
from tenant_schemas.utils import remove_www
class HomeView(TemplateView):
template_name = "index_public.html"
def get_context_data(self, **kwargs):
context =... | mcanaves/django-tenant-schemas | examples/tenant_tutorial/tenant_tutorial/views.py | Python | mit | 1,030 | 0.000971 |
from oscar_vat_moss import fields
from oscar.apps.address.abstract_models import AbstractShippingAddress
from oscar.apps.address.abstract_models import AbstractBillingAddress
class ShippingAddress(AbstractShippingAddress):
vatin = fields.vatin()
class BillingAddress(AbstractBillingAddress):
vatin = fields.v... | hastexo/django-oscar-vat_moss | oscar_vat_moss/order/models.py | Python | bsd-3-clause | 375 | 0 |
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... | konradxyz/cloudify-manager | rest-service/manager_rest/workflow_client.py | Python | apache-2.0 | 1,585 | 0 |
#! /usr/bin/env python
import vcsn
from test import *
algos = ['distance', 'inplace', 'separate']
# check INPUT EXP ALGORITHM
# -------------------------
def check_algo(i, o, algo):
i = vcsn.automaton(i)
o = vcsn.automaton(o)
print("using algorithm: ", algo)
print("checking proper")
# We call sort().stri... | pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | tests/python/proper.py | Python | gpl-3.0 | 11,408 | 0.006837 |
class Token:
"""
Class representing a token.
kind: the kind of token, e.g. filename, number, other
value: specific instance value, e.g. "/tmp/foo.c", or 5
offset: byte offset from start of parse string
"""
def __init__(self, kind, value=None, offset=None):
self.offset = offset
... | rocky/python3-trepan | trepan/processor/parse/tok.py | Python | gpl-3.0 | 1,426 | 0 |
# Copyright (C) 2015 Ross D Milligan
# GNU GENERAL PUBLIC LICENSE Version 3 (full notice can be found at https://github.com/rdmilligan/SaltwashAR)
class Speaking:
# initialize speaking
def __init__(self, text_to_speech):
self.is_speaking = False
self.text_to_speech = text_to_speech
# te... | rdmilligan/SaltwashAR | scripts/features/base/speaking.py | Python | gpl-3.0 | 476 | 0.006303 |
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | Dev-Cloud-Platform/Dev-Cloud | dev_cloud/cc1/src/ec2/helpers/query.py | Python | apache-2.0 | 3,363 | 0.000595 |
"""HTTP Client for asyncio."""
import asyncio
import base64
import hashlib
import json
import os
import sys
import traceback
import warnings
from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr
from yarl import URL
from . import connector as connector_mod
from . import client_exceptions, client_reqrep,... | Eyepea/aiohttp | aiohttp/client.py | Python | apache-2.0 | 26,125 | 0.000153 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ddplot.py can create plots from plot results created using dd_single.py and
dd_time.py
Copyright 2014,2015 Maximilian Weigand
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 ... | m-weigand/ccd_tools | src/ddplot/ddplot.py | Python | gpl-3.0 | 16,512 | 0.000666 |
"""Network subnets."""
| softlayer/softlayer-python | SoftLayer/CLI/subnet/__init__.py | Python | mit | 23 | 0 |
#!/usr/bin/env python3
# encoding: utf-8
from nose import with_setup
from tests.utils import *
@with_setup(usual_setup_func, usual_teardown_func)
def test_negative():
create_file('xxx', 'b.png')
create_file('xxx', 'a.png')
create_file('xxx', 'a')
head, *data, footer = run_rmlint('-i')
assert footer... | SeeSpotRun/rmlint | tests/test_options/test_match_without_extension.py | Python | gpl-3.0 | 718 | 0.001393 |
import GPy
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
# ~~~~WARNING: ONLY SUPPORT FOR 1D RIGHT NOW~~~~ #
# TODO
def batch():
pass
# Calculates GP from input and output vectors X and Y respectively
def calcGP(X, Y, kernel='rbf', variance=1., lengthscale=1.):
# Reshape in 1D Cas... | ericlee0803/surrogate-GCP | gp/GPhelpers.py | Python | bsd-3-clause | 2,253 | 0.030626 |
"""
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians with EM
and variational Dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... | RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/mixture/plot_gmm.py | Python | bsd-3-clause | 2,817 | 0 |
"""
Copyright (c) 2016 Genome Research Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distr... | jeremymcrae/mupit | mupit/mutation_rates.py | Python | mit | 8,652 | 0.007397 |
# -*- coding: utf-8 -*-
# flake8: noqa
import datetime
import logging
import json
import os.path
import prison
import urllib.parse
from .util import EAException
from .util import lookup_es_key
from .util import ts_add
kibana_default_timedelta = datetime.timedelta(minutes=10)
kibana5_kibana6_versions = frozenset(['5.... | Yelp/elastalert | elastalert/kibana_discover.py | Python | apache-2.0 | 5,644 | 0.003189 |
# -*- coding: utf-8 -*-
# Copyright (c) 2006 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the VCS status monitor thread class for Subversion.
"""
from __future__ import unicode_literals
import os
import pysvn
from VCS.StatusMonitorThread import VcsStatusMonitorThread
import Prefer... | testmana2/test | Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py | Python | gpl-3.0 | 6,360 | 0.00173 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2011 Thomas Schreiber
#
# 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 l... | ubiquill/Potluck | src/view/Changes.py | Python | gpl-2.0 | 2,296 | 0.003486 |
info = {
"name": "sw",
"date_order": "DMY",
"january": [
"jan",
"januari"
],
"february": [
"feb",
"februari"
],
"march": [
"mac",
"machi"
],
"april": [
"apr",
"aprili"
],
"may": [
"mei"
],
"june":... | scrapinghub/dateparser | dateparser/data/date_translation_data/sw.py | Python | bsd-3-clause | 4,155 | 0 |
# coding=UTF-8
# URL: https://github.com/SickRage/SickRage
#
# 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 License, or
# (at your option)... | jackkiej/SickRage | tests/notifier_tests.py | Python | gpl-3.0 | 10,384 | 0.003371 |
# 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... | cshallue/models | research/differential_privacy/multiple_teachers/analysis.py | Python | apache-2.0 | 10,988 | 0.012013 |
import itertools
import struct
def ip4_to_int32(str_ip, order='>'):
return struct.unpack(order+"I",struct.pack("BBBB",*map(int,str_ip.split("."))))[0]
def int32_to_ip4(big_int, order='>'):
return '.'.join(map(str, struct.unpack("BBBB",struct.pack(order+"I",big_int))))
def gen_get_n_bit(data, bit=1):
mask = 1 <... | k3idii/pykpyk | datatools.py | Python | mit | 955 | 0.034555 |
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | swtp1v07/Savu | savu/data/structures.py | Python | apache-2.0 | 17,375 | 0 |
from distutils.core import Extension
from collections import defaultdict
def get_extensions():
import numpy as np
exts = []
# malloc
mac_incl_path = "/usr/include/malloc"
cfg = defaultdict(list)
cfg['include_dirs'].append(np.get_include())
cfg['include_dirs'].append(mac_incl_path)
c... | adrn/gala | gala/integrate/setup_package.py | Python | mit | 1,672 | 0 |
# 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 agreed to in writing, ... | google/fuzzbench | analysis/coverage_data_utils.py | Python | apache-2.0 | 9,404 | 0.000638 |
"""Utilities for running individual tests"""
import itertools
import os
import re
import time
from cram._diff import esc, glob, regex, unified_diff
from cram._process import PIPE, STDOUT, execute
__all__ = ['test', 'testfile']
_needescape = re.compile(br'[\x00-\x09\x0b-\x1f\x7f-\xff]').search
_escapesub = re.compil... | brodie/cram | cram/_test.py | Python | gpl-2.0 | 7,518 | 0.000532 |
#!/usr/bin/env python
import os, sys
from Bio import SeqIO
from Bio.Blast import NCBIWWW
from time import sleep
from helpers import parse_fasta, get_opts
def usage():
print """Usage: blast_fasta.py [OPTIONS] seqs.fasta
Options:
-t blast_type blastn, blastp, blastx, tblastn, tblastx, default: blastn... | Serpens/small_bioinfo | blast_fasta.py | Python | gpl-3.0 | 1,496 | 0.007353 |
from diary import DiaryDB, Event
import unittest
import sqlite3
import os.path
class TestDiaryDB(unittest.TestCase):
TEMP_DB_PATH = os.path.join(os.path.dirname(__file__),
'testing_dir', 'temp.db')
SIMPLE_EVENT = Event("INFO", "LEVEL")
def setUp(self):
self.logdb ... | GreenVars/diary | tests/logdb_test.py | Python | mit | 2,455 | 0.002037 |
import time
import datetime
import oauth2 as oauth
from provider import scope as oauth2_provider_scope
from rest_framework.test import APIClient
from rest_framework_oauth.authentication import (
oauth2_provider,
OAuthAuthentication,
OAuth2Authentication
)
from rest_framework import status, permissions
from ... | jlafon/django-rest-framework-oauth | tests/test_oauth.py | Python | mit | 19,202 | 0.003854 |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2015 Thomas Perl and the gPodder Team
#
# gPodder 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... | daneoshiga/gpodder | src/gpodder/gtkui/interface/__init__.py | Python | gpl-3.0 | 764 | 0.001309 |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
"""
doc2md.py generates Python documentation in the Markdown (md) format. It was
written to automatically generate documentation that can be put on Github
or Bitbucket wiki pages. It is initially based on Ferry Boender's pydocmd.
It is as of yet not very complete and is more... | blasterbug/doc2md.py | doc2md.py | Python | gpl-2.0 | 7,823 | 0.005497 |
#!/usr/bin/env python
import sys
import textwrap
names = sorted(sys.modules.keys())
name_text = ', '.join(names)
print textwrap.fill(name_text)
| talapus/Ophidian | Academia/Modules/list_all_installed_modules.py | Python | bsd-3-clause | 147 | 0 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# Created Time: Fri Jul 17 00:58:20 2015
# Purpose: generate a bidirected graph
# Mail: hewr2010@gmail.com
__author__ = "Wayne Ho"
import sys
import random
if __name__ == "__main__":
if len(sys.argv) < 3:
print("./%s [#vertices] [#edges]" % sys.argv[0])
exi... | manene/SAE_Sampling | spark/genGraph.py | Python | mit | 715 | 0 |
import site
import sys, os
from peewee import *
import datetime
import time
import calendar
import sqlite3
import gzip
import shutil
#-----------------------------------------------------------------------
if os.path.exists('/storage/extSdCard'):
database = SqliteDatabase('/storage/extSdCard/mydb/lessonplan20... | mwbetrg/skripbatak | createlp2016table.py | Python | bsd-3-clause | 2,171 | 0.004606 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | Pistachitos/Sick-Beard | sickbeard/notifiers/growl.py | Python | gpl-3.0 | 6,111 | 0.014237 |
#
# Copyright 2019 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | candlepin/virt-who | virtwho/virt/kubevirt/client.py | Python | gpl-2.0 | 4,273 | 0.000468 |
import sys
sys.path.insert(1, "../../../")
import h2o
import random
def test_get_future_model(ip,port):
covtype=h2o.upload_file(h2o.locate("smalldata/covtype/covtype.altered.gz"))
myY=54
myX=list(set(range(54)) - set([20,28])) # Cols 21 and 29 are constant, so must be explicitly ignored
... | weaver-viii/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_covtype_get_future_model.py | Python | apache-2.0 | 1,261 | 0.014274 |
#@result Submitted a few seconds ago • Score: 10.00 Status: Accepted Test Case #0: 0s Test Case #1: 0.01s Test Case #2: 0s Test Case #3: 0s Test Case #4: 0.01s Test Case #5: 0s
for i in range(int(raw_input())): #More than 4 lines will result in 0 score. Blank lines won't be counted.
a = int(raw_input()); A = set(r... | FeiZhan/Algo-Collection | answers/hackerrank/Check Subset.py | Python | mit | 423 | 0.016627 |
###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distrib... | cynapse/cynin | src/ubify.cyninv2theme/ubify/cyninv2theme/browser/addcontentselector.py | Python | gpl-3.0 | 3,531 | 0.016709 |
from __future__ import nested_scopes
import traceback
import os
try:
from urllib import quote
except:
from urllib.parse import quote # @UnresolvedImport
import inspect
from _pydevd_bundle.pydevd_constants import IS_PY3K
import sys
from _pydev_bundle import pydev_log
def save_main_module(file, module_name):... | asedunov/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_utils.py | Python | apache-2.0 | 7,871 | 0.004447 |
# -*- coding: utf-8 -*-
"""
A window with a unicode textfield where the user can edit.
Useful for editing the contents of an article.
"""
from __future__ import absolute_import, unicode_literals
#
# (C) Rob W.W. Hooft, 2003
# (C) Daniel Herding, 2004
# Wikiwichtel
# (C) Pywikibot team, 2008-2014
#
# Distributed ... | icyflame/batman | pywikibot/userinterfaces/gui.py | Python | mit | 21,774 | 0.000413 |
"""Helper functions for Flask-Statics."""
from flask_statics import resource_base
from flask_statics import resource_definitions
def priority(var):
"""Prioritizes resource position in the final HTML. To be fed into sorted(key=).
Javascript consoles throw errors if Bootstrap's js file is mentioned before jQu... | Robpol86/Flask-Statics-Helper | flask_statics/helpers.py | Python | mit | 1,406 | 0.004979 |
from django.test import TestCase as DjangoTestCase
from django.conf import settings
from seeder.models import *
from seeder.posters import TwitterPoster
from random import randint as random
from datetime import datetime
import time
import mox
import re
def generate_random_authorized_account():
u = User(username = ... | tswicegood/seeder | seeder/tests.py | Python | gpl-3.0 | 11,995 | 0.009587 |
from transifex.projects.models import Project
from transifex.teams.models import Team
from transifex.txcommon.tests import base
class TestTeamModels(base.BaseTestCase):
def test_available_teams(self):
"""
Test whether monkey-patch of Project class with a 'available_teams'
instance method r... | rvanlaar/easy-transifex | src/transifex/transifex/teams/tests/models.py | Python | bsd-2-clause | 1,066 | 0.005629 |
#-*- coding: utf-8 -*-
# Implements Colobot model formats
# Copyright (c) 2014 Tomasz Kapuściński
import modelformat
import geometry
import struct
class ColobotNewTextFormat(modelformat.ModelFormat):
def __init__(self):
self.description = 'Colobot New Text format'
def get_extension(self):
... | tomaszkax86/Colobot-Model-Converter | colobotformat.py | Python | bsd-2-clause | 11,044 | 0.006249 |
# Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
import json
import urllib2
import urllib
import pprint
from base import (site_url, api_key)
org_filename = './data/orgs_list.json'
data_string = json.dumps({'all_fields' : True})
org_list = [... | gjlawran/ckanext-bcgov | ckanext/bcgov/scripts/save_orgs.py | Python | agpl-3.0 | 1,656 | 0.010266 |
# Add ability to pass TF_Input_Dialog a data structure
# instead of an XML filename. XML file is only for
# initial creation, but for updates or showing user-
# modified settings, need this other option.
#---------------------------------------------------------
#!/usr/bin/env python
# August 8 & 11, 2008
# Febru... | peckhams/topoflow | topoflow/gui/Input_Dialog.py | Python | mit | 21,814 | 0.011094 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SuroLeveling
A QGIS plugin
todo
-------------------
begin : 2016-02-12
git sha : $Format:%H$
copyr... | ctu-osgeorel-proj/bp-pesek-2016 | src/position_correction.py | Python | gpl-2.0 | 7,629 | 0.003016 |
#! /usr/local/bin/stackless2.6
# by pts@fazekas.hu at Sat Apr 24 00:25:31 CEST 2010
import errno
import logging
import socket
import sys
import unittest
from syncless import coio
from syncless import wsgi
def TestApplication(env, start_response):
if env['PATH_INFO'] == '/answer':
start_response('200 OK', [('Co... | HanWenfang/syncless | test/wsgi_test.py | Python | apache-2.0 | 9,998 | 0.005501 |
# coding: utf-8
__version__ = '0.1.0'
| Locu/djredis | djredis/__init__.py | Python | mit | 38 | 0 |
"""
Copyright (c) 2018 Doyub Kim
I am making my contributions/submissions to this project solely in my personal
capacity and am not conveying any rights to any intellectual property of any
third parties.
"""
import numpy as np
import pyjet
from pytest import approx
from pytest_utils import *
cnt = 0
def test_grid... | doyubkim/fluid-engine-dev | src/tests/python_tests/test_cell_centered_scalar_grid.py | Python | mit | 12,197 | 0 |
# -*- coding: utf-8 -*-
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
from odoo.tests import tagged
from odoo import Command
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestL10nBeEdi(AccountEdiTestCommon):
@classmethod
def setUpClass(cls, chart_template_ref='l10n... | jeremiahyan/odoo | addons/l10n_be_edi/tests/test_ubl.py | Python | gpl-3.0 | 8,636 | 0.002432 |
# Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | Cisco-Talos/pyrebox | volatility/volatility/plugins/overlays/windows/vista_sp12_x64_syscalls.py | Python | gpl-2.0 | 43,395 | 0.053693 |
# (C) Copyright 2017, 2019-2020 by Rocky Bernstein
"""
CPython 3.0 bytecode opcodes
This is a like Python 3.0's opcode.py with some classification
of stack usage.
"""
from xdis.opcodes.base import (
def_op,
extended_format_ATTR,
extended_format_CALL_FUNCTION,
finalize_opcodes,
format_MAKE_FUNCTION... | TeamSPoon/logicmoo_workspace | packs_web/butterfly/lib/python3.7/site-packages/xdis/opcodes/opcode_30.py | Python | mit | 1,967 | 0.004067 |
""" Local dev settings and globals. """
from base import *
""" DEBUG CONFIGURATION """
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
""" LOGGING """
for logger_key in LOGGING['loggers'].ke... | WimpyAnalytics/django-readonly-schema | readonly/readonly/settings/local.py | Python | mit | 1,156 | 0.00519 |
#!/usr/bin/env python3
#
# build-utilities
# Copyright (c) 2015, Alexandre ACEBEDO, All rights reserved.
#
# 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 3.0 of the Lice... | aacebedo/build-utilities | setup.py | Python | lgpl-3.0 | 2,674 | 0.008975 |
from zeit.cms.i18n import MessageFactory as _
import copy
import grokcore.component as grok
import lxml.objectify
import zeit.cms.content.property
import zeit.cms.interfaces
import zeit.cms.syndication.feed
import zeit.cms.syndication.interfaces
import zeit.content.cp.blocks.block
import zeit.content.cp.interfaces
impo... | ZeitOnline/zeit.content.cp | src/zeit/content/cp/blocks/teaser.py | Python | bsd-3-clause | 7,905 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.