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 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def read(*names, **kwargs):
return io.open(
... | hsharrison/history-queue | setup.py | Python | bsd-2-clause | 1,610 | 0.001242 |
# 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/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py | Python | mit | 3,173 | 0.001891 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import re
import tablemanager.models
import django.utils.timezone
import borg_utils.resource_status
import django.core.validators
class Migration(migrations.Migration):
depen... | parksandwildlife/borgcollector | tablemanager/migrations/0021_auto_20160219_0803.py | Python | bsd-3-clause | 2,007 | 0.003986 |
class HostCommands(object):
def __new__(cls, host):
if host.is_ol6:
return HostCommandOL6(host)
if host.is_ol7:
return HostCommandOL7(host)
class HostBaseCommands(object):
def __init__(self, host):
self.host = host
self.infra = host.infra
self.e... | globocom/database-as-a-service | dbaas/physical/commands.py | Python | bsd-3-clause | 3,573 | 0 |
# --- job 1/8 & 2/8 : check_etablissements & extract_etablissements
DISTINCT_DEPARTEMENTS_HAVING_OFFICES = 15
# --- job 5/8 : compute_scores
SCORE_COEFFICIENT_OF_VARIATION_MAX = 8
MINIMUM_OFFICES_REQUIRED_TO_TRAIN_MODEL = 0
MAXIMUM_COMPUTE_SCORE_JOB_FAILURES = 94 # 96 departements == 2 successes + 94 failures
RMSE_MA... | StartupsPoleEmploi/labonneboite | labonneboite/importer/conf/development.py | Python | agpl-3.0 | 497 | 0.002012 |
from django import forms
from ..models import BaseDemographic
class BaseDemographicForm(forms.ModelForm):
class Meta:
model = BaseDemographic
fields = ['first_name','last_name','phone','dob']
| rdespoiu/QTitan | QTitan/QTSurvey/Controllers/BaseDemographicForm.py | Python | gpl-3.0 | 214 | 0.023364 |
# All the code samples below have one parameter, which is where the protection level name
# for that storage type will be inserted, e.g. NSDataWritingFileProtectionCompleteUnlessOpen
CODE_SAMPLE_CORE_DATA = """
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
if (persistentStoreCoordinator_ != nil) {
... | erikr/howtostoreiosdata | howtostoreiosdata/wizard/code_samples.py | Python | mit | 1,995 | 0.002506 |
import __init__
import math
import numpy as np
class Point:
'''Point at 3D. Some method for it. '''
def __init__ (self, x=0.0, y=0.0 ,z=0.0):
self.x=x
self.y=y
self.z=z
def coors(self):
coor=(self.x,self.y,self.z)
return coor
def dist_to(self,a... | platinhom/CADDHom | python/basic/HHGeometry.py | Python | gpl-2.0 | 2,547 | 0.016097 |
from collections import namedtuple
from cairo import LINE_JOIN_ROUND
from zorro.di import di, dependency, has_dependencies
from tilenol.groups import GroupManager
from tilenol.commands import CommandDispatcher
from .base import Widget
from tilenol.theme import Theme
from tilenol.window import Window
GroupState = na... | tailhook/tilenol | tilenol/widgets/groupbox.py | Python | mit | 3,880 | 0.000258 |
import os
import sys
import golem
from golem.core import (utils, session, suite as suite_module, test,
settings_manager, test_directory)
from golem.core.project import Project, create_project
from golem.gui import gui_start
from golem.test_runner.execution_runner import ExecutionRunner
from gol... | lucianopuccio/golem | golem/cli/commands.py | Python | mit | 8,682 | 0.001497 |
"""This tutorial introduces the LeNet5 neural network architecture
using Theano. LeNet5 is a convolutional neural network, good for
classifying images. This tutorial shows how to build the architecture,
and comes with all the hyper-parameters you need to reproduce the
paper's MNIST results.
This implementation simpl... | webeng/DeepLearningTutorials | code/convolutional_mlp.py | Python | bsd-3-clause | 12,771 | 0.001175 |
#!/usr/bin/env python
# 2015 Copyright (C) White
#
# 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 of the License.
#
# This program is distributed in the hope that it will be useful,
#... | 7anshuai/white | white/domain/storage.py | Python | gpl-2.0 | 2,170 | 0.001382 |
#!/usr/bin/python
#
# Copyright (c) 2016, Nest Labs, 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:
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | JiahuiZHONG/Internship_Thread | tests/scripts/thread-cert/Cert_6_4_01_LinkLocal.py | Python | bsd-3-clause | 2,986 | 0.001005 |
# Copyright (c) Mathias Kaerlev 2012.
# This file is part of Anaconda.
# Anaconda 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.
# ... | joaormatos/anaconda | mmfparser/player/players.py | Python | gpl-3.0 | 6,005 | 0.006828 |
import inspect
import pytest
def parametrize(tests, arity=None):
'''Helper for parametrizing pytest tests.
Expects a list of lambdas, one per test. Each lambda must return
the parameters for its respective test.
Test identifiers will be automatically generated, from the test
number and its lamb... | stanographer/plover | plover_build_utils/testing/parametrize.py | Python | gpl-2.0 | 1,189 | 0.000841 |
#!/usr/bin/python2.7
# cuon_server install
import os, sys, platform
import subprocess, shlex, shutil
import commands
import locale
import pwd, grp
from gi.repository import Gtk
import ConfigParser
class cssi():
def __init__(self, user=None):
self.user = user
self.win = None
... | CuonDeveloper/cuon | Distributionen/CuonServer/cuon-simple-server-install.py | Python | gpl-3.0 | 21,083 | 0.014846 |
#
# (c) 2018 Extreme Networks Inc.
#
# 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) any later version.
#
# Ans... | maartenq/ansible | test/units/modules/network/exos/test_exos_config.py | Python | gpl-3.0 | 10,664 | 0.001407 |
from __future__ import unicode_literals
import datetime
import types
import os
from importlib import import_module
from django.utils import six
from django.db import models
from django.db.models.loading import cache
from django.db.migrations.loader import MigrationLoader
from django.utils.encoding import force_text
fro... | ZhaoCJ/django | django/db/migrations/writer.py | Python | bsd-3-clause | 7,931 | 0.001891 |
from __future__ import absolute_import
from mock import patch
from datadog.util.hostname import get_hostname
from sentry.metrics.datadog import DatadogMetricsBackend
from sentry.testutils import TestCase
class DatadogMetricsBackendTest(TestCase):
def setUp(self):
self.backend = DatadogMetricsBackend(pr... | Kryz/sentry | tests/sentry/metrics/test_datadog.py | Python | bsd-3-clause | 979 | 0 |
# -*- coding: utf-8 -*-
# A WordPress compiler plugin for Nikola
#
# Copyright (C) 2014-2015 by Felix Fontein
# Copyright (C) by the WordPress contributors
#
# 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... | pluser/nikola_plugins | v7/wordpress_compiler/wordpress/wordpress.py | Python | mit | 11,780 | 0.002547 |
from __future__ import division
import math as m
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as pl
from scipy.optimize import fmin, fmin_powell, minimize
from numpy import (any, array, asarray, ones, ones_like, zeros, isfinite, inf, concatenate, arange, unique, delete,
... | OxES/k2sc | src/detrender.py | Python | gpl-3.0 | 7,258 | 0.012951 |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 17 17:19:10 2016
@author: Michael
"""
from PyQt5 import QtWidgets
class AboutWindow(QtWidgets.QTextEdit):
def __init__(self, parent=None):
super().__init__(parent)
self.setReadOnly(True)
self.setHtml(
"""
<h1 id="kano">Kano</h1>
<p>Co... | MichaelSchreier/Kano | class_UI_aboutWindow.py | Python | gpl-3.0 | 4,429 | 0.029153 |
# -*- coding: utf8 -*-
"""
Physical and Chemical data
"""
from csv import reader as csvreader
from mathics.builtin.base import Builtin
from mathics.core.expression import (Expression, from_python, Symbol, String,
strip_context)
from mathics.settings import ROOT_DIR
def load_ele... | benley/Mathics | mathics/builtin/physchemdata.py | Python | gpl-3.0 | 5,698 | 0.000527 |
#
# (c) 2016 Red Hat Inc.
#
# 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) any later version.
#
# Ansible is d... | mikewiebe-ansible/ansible | lib/ansible/plugins/action/nxos.py | Python | gpl-3.0 | 8,307 | 0.003732 |
#
# Implements encrypting functions.
#
# Copyright (c) 2008, F S 3 Consulting Inc.
#
# Maintainer:
# Alec Joseph Rivera (agi<at>fs3.ph)
# refactored by Antony Lesuisse <al<at>openerp.com>
#
import hashlib
import hmac
import logging
from random import sample
from string import ascii_letters, digits
import openerp
from... | jaggu303619/asylum | openerp/addons/auth_crypt/auth_crypt.py | Python | agpl-3.0 | 5,849 | 0.009574 |
sabor = input()
quantidade = int(input())
if sabor.lower() == "morango" or sabor.lower() == "cereja":
total = quantidade*4.50
elif sabor.lower() == "damasco" or sabor.lower() == "siriguela":
total = quantidade*3.80
else:
total = quantidade*2.75
print("%.2f"%total)
if quantidade > 2:
print ("COM CALDA"... | SANDEISON/The-Huxley | Python/Sorveteria Tropical,py.py | Python | gpl-3.0 | 351 | 0.005698 |
from todoman import version # type: ignore
__version__ = version.version
__documentation__ = "https://todoman.rtfd.org/en/latest/"
| pimutils/todoman | todoman/__init__.py | Python | isc | 133 | 0 |
#!/usr/bin/python3
from . tkLEDTable import *
try:
import serial
except:
import sys
print("Install the serial module width '{} -m pip install PySerial'.".format(sys.executable))
raise
import threading
try:
from queue import Queue
except ImportError:
from Queue import Queue
import itertools
def... | niccokunzmann/ledtable | python/ledtable/SerialLEDTable.py | Python | mit | 4,859 | 0.004322 |
from Alignment import Alignment
import sys,time,os
import pf,func
from Var import var
from Glitch import Glitch
class Data:
"""All the alignments that you want to work with, in one place.
Initialize this with one of
- nothing (or None),
- a list of Alignment objects, or
- a single Alignment... | Linhua-Sun/p4-phylogenetics | p4/Data.py | Python | gpl-2.0 | 31,372 | 0.005355 |
from sys import argv
script, user_name = argv
prompt = '> '
print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)
print "Where do you live %s?" % user_name
lives = raw_input(prompt)
print "What kind of co... | Skreex/LPTHW | ex14.py | Python | mit | 529 | 0.00189 |
import string, copy
def joinHeaders(first, second, joined, on):
joined.headers = first.headers[:]
mappedHeaders = {}
for header in second.headers:
if header == on:
continue
i = 0
newHeader = header
while newHeader in first.headers:
newHeader = '{0}_{1}'.format(newHeader, i)
i += 1
if i > 0:
ma... | dwilmer/rcpsp-testing-framework | dataset.py | Python | mit | 3,291 | 0.036159 |
"""Auto-generated file, do not edit by hand. 881 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_881 = PhoneMetadata(id='001', country_code=881, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[0-36-9]\\d{8}', possible_length=(9,)... | daviddrysdale/python-phonenumbers | python/phonenumbers/data/region_881.py | Python | apache-2.0 | 569 | 0.008787 |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | chessco/cursus | controllers/utils.py | Python | apache-2.0 | 25,293 | 0.000474 |
#!/usr/bin/env python
import re,urllib2
class Get_public_ip:
def getip(self):
try:
myip = self.visit("http://www.whereismyip.com/")
except:
try:
myip = self.visit("http://www.ip138.com/ip2city.asp")
except:
myip = "So sorry!!!"
... | ielnehc/ltmh | tools/get_public_ip.py | Python | mit | 610 | 0.02623 |
"""
Copyright (C) 2017-2021 Vanessa Sochat.
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/.
"""
from django.contrib.sitemaps import Sitemap
from shub.apps.main.models imp... | singularityhub/sregistry | shub/apps/base/sitemap.py | Python | mpl-2.0 | 917 | 0.001091 |
'''This folder contains various example scripts demonstrating MAVLink functionality.'''
| AndreasAntener/mavlink | pymavlink/examples/__init__.py | Python | lgpl-3.0 | 88 | 0.011364 |
from NVDAObjects.IAccessible import IAccessible
import nvwave
import speech
import os
class AutocompleteList(IAccessible):
def event_selection(self):
speech.cancelSpeech()
speech.speakText(self.name)
| ThomasStivers/nvda-notepadPlusPlus | addon/appModules/notepad++/autocomplete.py | Python | gpl-2.0 | 210 | 0.033333 |
"""file_parser.py reads text file and parse the item into a list."""
def file_to_list(input_file):
data_list_trim = []
try:
with open(input_file) as in_put:
input_data = in_put.readlines()
if len(input_data) == 1:
print()
data_list = input_data[0... | roy-boy/python_scripts | file_parser.py | Python | gpl-3.0 | 847 | 0 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBigmemorySri(RPackage):
"""This package provides a shared resource interface
for t... | iulian787/spack | var/spack/repos/builtin/packages/r-bigmemory-sri/package.py | Python | lgpl-2.1 | 708 | 0.00565 |
import pytest
from .utils import digit_float
import numpy as np
vowel_data_y_dimension = 11
@pytest.fixture
def vowel_data():
from esl_model.datasets import VowelDataSet
data = VowelDataSet()
return data.return_all()
@pytest.fixture
def SAHeart_data():
from esl_model.datasets import SAHeartDataSet... | littlezz/ESL-Model | tests/test_ch4.py | Python | mit | 5,437 | 0.002391 |
import os
import sys
from pathlib import Path
class Setup:
CONFIGURATION_FILE = os.path.join(Path(__file__).parents[1], "config", "server.cfg")
VLC_DEFAULT_COMMAND = "vlc -f"
POSIX = 'posix' in sys.builtin_module_names
VLC_PLAYLIST_END = "vlc://quit"
| danfr/RemoteTV | Server/bin/Setup.py | Python | mit | 269 | 0.003717 |
"""
Proposal Target Operator selects foreground and background roi and assigns label, bbox_transform to them.
"""
from __future__ import print_function
import mxnet as mx
import numpy as np
from distutils.util import strtobool
from rcnn.io.rcnn import sample_rois
DEBUG = False
class ProposalTargetOperator(mx.opera... | likelyzhao/mxnet | example/rcnn/rcnn/symbol/proposal_target.py | Python | apache-2.0 | 3,893 | 0.002312 |
"""
Tests for structural time series 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 warnings
from statsmodels.datasets import macrodata
from statsmodels.tsa.statespace import structural
fr... | saketkc/statsmodels | statsmodels/tsa/statespace/tests/test_structural.py | Python | bsd-3-clause | 9,003 | 0.001666 |
from __future__ import absolute_import
from .base import Filter
from six.moves.urllib.parse import urlparse
from sentry.utils.data_filters import FilterStatKeys
LOCAL_IPS = frozenset(['127.0.0.1', '::1'])
LOCAL_DOMAINS = frozenset(['127.0.0.1', 'localhost'])
class LocalhostFilter(Filter):
id = FilterStatKeys.LO... | ifduyue/sentry | src/sentry/filters/localhost.py | Python | bsd-3-clause | 996 | 0.002008 |
'''
Puck: FreeBSD virtualization guest configuration server
Copyright (C) 2011 The Hotel Communication Network inc.
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 Lic... | masom/Puck | server/controllers/root.py | Python | lgpl-3.0 | 2,450 | 0.002041 |
# -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2014 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
from amoco.arch.avr.env import *
from amoco.cas.mapper import mapper
# ------------------------------------------------------------------------------
# low level functions :
def... | LRGH/amoco | amoco/arch/avr/asm.py | Python | gpl-2.0 | 10,020 | 0.000499 |
"""T2W modality class."""
import warnings
import numpy as np
import SimpleITK as sitk
from .standalone_modality import StandaloneModality
from ..utils.validation import check_path_data
class T2WModality(StandaloneModality):
"""Class to handle T2W-MRI modality.
Parameters
----------
path_data : st... | glemaitre/protoclass | protoclass/data_management/t2w_modality.py | Python | gpl-2.0 | 8,496 | 0 |
import os
import errno
def delete_file(file_name, dry=False):
if dry:
print(' DRY DELETED: {}'.format(file_name))
else:
os.remove(file_name)
try:
dirname = os.path.dirname(file_name)
os.rmdir(dirname)
print(' DELETED DIR: {}'.format(dirname))
... | logston/python-dircmp | dircmppy/dircmpdel.py | Python | bsd-2-clause | 2,648 | 0.000755 |
'''
This component package and its subpackages contain wrapper and glue code for database operations.
''' | exratione/thywill-python | thywill_server/src/thywill_server/database/__init__.py | Python | mit | 105 | 0.028571 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/tabs/campaign.py
#
# 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
# not... | securestate/king-phisher | king_phisher/client/tabs/campaign.py | Python | bsd-3-clause | 32,510 | 0.027592 |
# Copyright 2013-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 w... | Sticklyman1936/workload-automation | wlauto/common/resources.py | Python | apache-2.0 | 1,635 | 0.001223 |
"""This module implements the Lovins stemming algorithm. Use the ``stem()``
function::
stemmed_word = stem(word)
"""
from whoosh.util.collections2 import defaultdict
# Conditions
def A(base):
# A No restrictions on stem
return True
def B(base):
# B Minimum stem length = 3
return len(base) >... | archatas/whoosh | whoosh/lang/lovins.py | Python | apache-2.0 | 12,657 | 0.003871 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | cinderella/incubator-cloudstack | test/integration/component/test_snapshots.py | Python | apache-2.0 | 57,945 | 0.001778 |
# Copyright 2015 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.
import argparse
class CustomHelpAction(argparse.Action):
'''Allows defining custom help actions.
Help actions can run even when the parser would oth... | ric2b/Vivaldi-browser | chromium/build/android/pylib/utils/argparse_utils.py | Python | bsd-3-clause | 1,695 | 0.00649 |
import pytest
from marshmallow import ValidationError
from skylines.schemas import ClubSchema
def test_deserialization_fails_for_empty_name():
with pytest.raises(ValidationError) as e:
ClubSchema(only=("name",)).load(dict(name=""))
errors = e.value.messages
assert "name" in errors
assert "M... | skylines-project/skylines | tests/schemas/schemas/test_club.py | Python | agpl-3.0 | 1,722 | 0.000581 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasinfoPro.py
---------------------
Date : October 2014 and May 2016
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
***... | AsgerPetersen/QGIS | python/plugins/processing/algs/lidar/lastools/lasinfoPro.py | Python | gpl-2.0 | 5,416 | 0.001846 |
import asyncio
import datetime
import logging
import signal
import yaml
import passlib.context
from merc import config
from merc import config_format
from merc import channel
from merc import feature
from merc import server
from merc import user
from merc import util
logger = logging.getLogger(__name__)
class App... | merc-devel/merc | merc/application.py | Python | mit | 4,731 | 0.013316 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_deathstar_debris_cultist_hum_m_02.iff"
result.attribut... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_deathstar_debris_cultist_hum_m_02.py | Python | mit | 464 | 0.047414 |
#!/usr/bin/python
import sys
print "divsum_analysis.py DivsumFile NumberOfNucleotides"
try:
file = sys.argv[1]
except:
file = raw_input("Introduce RepeatMasker's Divsum file: ")
try:
nucs = sys.argv[2]
except:
nucs = raw_input("Introduce number of analysed nucleotides: ")
nucs = int(nucs)
data = o... | fjruizruano/ngs-protocols | divsum_analysis.py | Python | gpl-3.0 | 974 | 0.011294 |
"""
This script is responsible for generating recommendations for the users. The general flow is as follows:
The best_model saved in HDFS is loaded with the help of model_id which is fetched from model_metadata_df.
`spark_user_id` and `recording_id` are fetched from top_artist_candidate_set_df and are given as input t... | metabrainz/listenbrainz-server | listenbrainz_spark/recommendations/recording/recommend.py | Python | gpl-2.0 | 19,039 | 0.004254 |
#!/usr/bin/env python
import os, re, sys
if len(sys.argv) < 2:
print "usage: %s <recordfile>" % sys.argv[0]
sys.exit(1)
# Read record
filename = sys.argv[1]
fd = file(filename)
record = fd.read()
fd.close()
# Update revision
newrecord = []
lbreak = "\r\n"
for line in record.splitlines():
if line.startsw... | BackupTheBerlios/namingmuse | tools/freedb-submit.py | Python | gpl-2.0 | 936 | 0.001068 |
from graphql_relay.node.node import from_global_id
def get_errors(e):
# transform django errors to redux errors
# django: {"key1": [value1], {"key2": [value2]}}
# redux: ["key1", "value1", "key2", "value2"]
fields = e.message_dict.keys()
messages = ['; '.join(m) for m in e.message_dict.values()]
... | teamtaverna/core | app/api/cruds/utils.py | Python | mit | 760 | 0.002632 |
########################################################################
# $HeadURL$
# File : SSHComputingElement.py
# Author : Dumitru Laurentiu, A.T.
########################################################################
""" SSH (Virtual) Computing Element: For a given IP/host it will send jobs directly through ... | calancha/DIRAC | Resources/Computing/SSHComputingElement.py | Python | gpl-3.0 | 24,359 | 0.036332 |
"""
Small POP server. Heavilly based on
pypopper: a file-based pop3 server (http://code.activestate.com/recipes/534131-pypopper-python-pop3-server/)
Useage:
python server.py
Will return all mail*.txt in the current folder as mail. Output is also printed.
"""
import logging
import socket
import glob
loggi... | ebu/PlugIt | tests/helpers/pop_server/server.py | Python | bsd-3-clause | 4,827 | 0.001243 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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
#... | sacharya/nova | nova/tests/api/openstack/compute/plugins/v3/test_admin_password.py | Python | apache-2.0 | 5,987 | 0 |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... | kubevirt/client-python | test/test_v1_i6300_esb_watchdog.py | Python | apache-2.0 | 927 | 0.001079 |
# Copyright 2014 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | openstack/mistral | mistral/tests/unit/api/v2/test_cron_triggers.py | Python | apache-2.0 | 8,830 | 0 |
"""
MobileRobots Advanced Robotics Interface for Applications (ARIA)
Copyright (C) 2004, 2005 ActivMedia Robotics LLC
Copyright (C) 2006, 2007, 2008, 2009 MobileRobots 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 b... | charismaticchiu/Robotics | ArNetworking/pythonExamples/drawingsExample.py | Python | gpl-2.0 | 6,718 | 0.018904 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "asuna.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| rogeliorv/asuna | manage.py | Python | apache-2.0 | 250 | 0.004 |
# -*- coding: latin-1 -*-
import re
import math
import urllib
from string import join
import traceback, sys
class JsUnwiser:
def unwiseAll(self, data):
try:
in_data=data
sPattern = 'eval\\(function\\(w,i,s,e\\).*?}\\((.*?)\\)'
wise_data=re.compile(sPattern).findall(in_... | siouka/dmind | plugin.video.tvpor/resources/lib/unwise.py | Python | gpl-2.0 | 2,506 | 0.027933 |
from django.conf.urls import patterns, url
from .views import info, useradmin, user_info, user_remove
urlpatterns = patterns(
'',
url('^info/$', info, name="info"),
url('^useradmin/$', useradmin, name="useradmin"),
url(r'^useradmin/info/(?P<email>[^/]+)/$', user_info, name='user_info'),
url(r'^use... | saukrIppl/seahub | seahub/institutions/urls.py | Python | apache-2.0 | 391 | 0.002558 |
'''
urlresolver XBMC Addon
Copyright (C) 2013 Bstrdsmkr
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 distri... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.module.urlresolver/lib/urlresolver/plugins/promptfile.py | Python | gpl-2.0 | 3,129 | 0.004155 |
# Copyright (c) 2013 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | shakamunyi/neutron-vrrp | neutron/tests/unit/linuxbridge/test_agent_scheduler.py | Python | apache-2.0 | 1,192 | 0.002517 |
{
'name' : 'Custom pos session report (2)',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category' : 'Custom',
'website' : 'https://yelizariev.github.io',
'description': """
Tested on Odoo 8.0 258a4cac82ef3b7e6a086f691f3bf8140d37b51c
""",
'dat... | bmya/pos-addons | pos_session_custom2/__openerp__.py | Python | lgpl-3.0 | 583 | 0.012007 |
# Copyright (c) 2016 Uber Technologies, Inc.
#
# 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, publ... | uber/tchannel-python | tchannel/rw.py | Python | mit | 19,427 | 0 |
from django.conf.urls import url
from redisca.frontend import views
app_name = 'frontend'
urlpatterns = [
url(r'^$', views.template_list, name='template_list'),
url(r'^([a-zA-Z0-9_\./\-]+)$', views.static_template, name='template'),
]
| redisca/django-redisca | redisca/frontend/urls.py | Python | mit | 246 | 0 |
#open a gsd file and write out a subsampled version, keeping only every N timesteps
#useful if you want to be analyzing a shorter trajectory
import gsd.hoomd
import argparse
import time
start = time.time()
parser = argparse.ArgumentParser(description='Subsamble GSD trajectory')
parser.add_argument('fname',metavar='inpu... | ramansbach/cluster_analysis | clustering/scripts/gsdSubsample.py | Python | mit | 959 | 0.023983 |
import unittest2 as unittest
from ..models import TestStorage
from ..strategy import TestStrategy
from ...backends.utils import load_backends, get_backend
from ...backends.github import GithubOAuth2
from ...exceptions import MissingBackend
class BaseBackendUtilsTest(unittest.TestCase):
def setUp(self):
s... | tobias47n9e/social-core | social_core/tests/backends/test_utils.py | Python | bsd-3-clause | 1,767 | 0 |
"""
Methods for importing Helios data.
"""
from datetime import date, time, datetime, timedelta
import os
import pathlib
import urllib.error
from urllib.error import URLError
from collections import OrderedDict
import warnings
import astropy.constants as constants
import astropy.units as u
import numpy as np
import pa... | dstansby/heliopy | heliopy/data/helios.py | Python | gpl-3.0 | 38,861 | 0 |
# coding=utf-8
# Copyright (c) 2001, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and op... | CanalTP/kirin | tests/mock_navitia/vj_bad_order.py | Python | agpl-3.0 | 13,166 | 0.000228 |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... | pierrelb/RMG-Py | rmgpy/quantityTest.py | Python | mit | 38,311 | 0.007021 |
import re, os
import util
from InputParameters import InputParameters
from MooseObject import MooseObject
class Tester(MooseObject):
@staticmethod
def validParams():
params = MooseObject.validParams()
# Common Options
params.addRequiredParam('type', "The type of test of Tester to crea... | backmari/moose | python/TestHarness/testers/Tester.py | Python | lgpl-2.1 | 18,823 | 0.004835 |
"""
provide a generic structure to support window functions,
similar to how we have a Groupby object
"""
from __future__ import division
import warnings
import numpy as np
from collections import defaultdict
from datetime import timedelta
from pandas.core.dtypes.generic import (
ABCSeries,
ABCDataFrame,
... | Winand/pandas | pandas/core/window.py | Python | bsd-3-clause | 68,740 | 0.000029 |
#!/usr/bin/env python
#### Sudoku generator ####
import random
import time
from collections import defaultdict
class Square(object):
'''Main class holding the attributes for each square of the sudoku'''
def __init__(self, x, y):
self.value = None
self.x = x
self.y = y
... | michalczaplinski/sudoku | sudoku_generator.py | Python | bsd-3-clause | 5,317 | 0.00583 |
#!/usr/bin/env python
from __future__ import absolute_import
import urllib2
from pytomo import lib_youtube_download
from pytomo import start_pytomo
start_pytomo.configure_log_file('http_test')
ip_address_uri = ("http://173.194.5.107/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor... | Jamlum/pytomo | test_http_server.py | Python | gpl-2.0 | 1,820 | 0.006044 |
from django.contrib import admin
from models import FileSet
admin.site.register(FileSet)
| oswalpalash/OctaveCodeShare | scipy_central/filestorage/admin.py | Python | bsd-3-clause | 89 | 0 |
from node import DotXMLDoc, AttributeParsingError
class SimpleXmlApi(object):
"""
The main API class, comprising a map of attributes to dotted path names.
Accessing an attribute that has been mapped to a dotted name will return
the text value of that node/attribute. If an attribute is passed that
... | iancmcc/simplexmlapi | simplexmlapi/api.py | Python | mit | 3,090 | 0.002913 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with a double-spend conflict
#
from test_framework.test_framework import Bits... | madzebra/BitSend | qa/rpc-tests/txn_doublespend.py | Python | mit | 6,649 | 0.004362 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Idea.color'
db.add_column(u'brainstorming_idea', 'color',... | atizo/braindump | brainstorming/migrations/0005_auto__add_field_idea_color.py | Python | mit | 4,031 | 0.007938 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import o... | jyt109/gensim | gensim/test/test_models.py | Python | gpl-3.0 | 23,020 | 0.006125 |
#!/usr/bin/env python
"""Robobonobo setup script.
Usage:
./get_ready.py [options]
Options:
-h, --help Show this help screen
--version Show the version.
"""
from docopt import docopt
from glob import glob
import os
GPIOS = [30, 31, 112, 113, 65, 27]
GPIO_BASE = "/sys/class/gpio"
SLOTS_GLOB = "/s... | dunmatt/robobonobo | scripts/get_ready.py | Python | mit | 979 | 0 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script is used by chrome_tests.gypi's js2webui action to maintain the
argument lists and to generate inlinable tests.
"""
... | hgl888/chromium-crosswalk | tools/gypv8sh.py | Python | bsd-3-clause | 2,927 | 0.012641 |
#! /usr/bin/env python
from __future__ import print_function
import os
import time
from github import Github
gh = Github(os.environ['DMWMBOT_TOKEN'])
codeRepo = os.environ.get('CODE_REPO', 'WMCore')
teamName = os.environ.get('WMCORE_REPO', 'dmwm')
repoName = '%s/%s' % (teamName, codeRepo)
issueID = None
if 'ghprb... | dmwm/Docker | jenkins_python/scripts/PullRequestTestBegin.py | Python | apache-2.0 | 887 | 0.001127 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Manage data for pretraining and RL tasks."""
import ast
from collections import namedtuple
from absl import logging
from single_task import code_tasks # brain coder
RLBatch = namedtuple('RLBatch', ['re... | jiaphuan/models | research/brain_coder/single_task/data.py | Python | apache-2.0 | 3,685 | 0.004071 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 16:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0020_auto_20160602_1607'),
]
operations = [
migrations.AddField(
... | softwaresaved/fat | lowfat/migrations/0021_blog_status.py | Python | bsd-3-clause | 627 | 0.001595 |
import website_forum
| lamaisondub/lamaisondub-custom | website_forum_private/models/__init__.py | Python | agpl-3.0 | 21 | 0 |
from setuptools import setup
setup(name='ldsc',
version='1.0',
description='LD Score Regression (LDSC)',
url='http://github.com/bulik/ldsc',
author='Brendan Bulik-Sullivan and Hilary Finucane',
author_email='',
license='GPLv3',
packages=['ldscore'],
scripts=['ldsc.py', '... | bulik/ldsc | setup.py | Python | gpl-3.0 | 577 | 0.005199 |
import pandas as pd
import pandas.testing as tm
import pyspark.sql.functions as F
import pytest
from pyspark.sql import Window
import ibis
@pytest.mark.parametrize(
('ibis_windows', 'spark_range'),
[
([(ibis.interval(hours=1), 0)], (-3600, 0)), # 1h back looking window
([(ibis.interval(hours... | cloudera/ibis | ibis/backends/pyspark/tests/test_window_context_adjustment.py | Python | apache-2.0 | 13,958 | 0 |
import datetime
from django import template
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.syndication.views import Feed, add_domain
from django.utils import feedgenerator, tzinfo
from django.utils.encoding im... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/disqus/wxr_feed.py | Python | mit | 9,430 | 0.007529 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Pool'
db.create_table(u'storageadmin_pool', (
... | schakrava/rockstor-core | src/rockstor/storageadmin/south_migrations/0001_initial.py | Python | gpl-3.0 | 36,999 | 0.00746 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.