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 |
|---|---|---|---|---|---|---|
# 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, software
# d... | jiahaoliang/group-based-policy | gbpservice/neutron/tests/unit/services/grouppolicy/test_group_proxy_extension.py | Python | apache-2.0 | 8,529 | 0 |
import LingvoObjects, Esperanto
def getAnalysis(NL):
# подгатавливаем текст
list_sentence = LangModule.Prepearing(NL)
# возвращаем предложения в виде объекта
obj_sentence = LingvoObjects.Sentence(list_sentence)
# делаем полный морфологический и синтаксический анализы
result, GrammarNazi = LangModule.NL2Re... | Ra93POL/EsperantoLanguage | HereIsYourCode.py | Python | gpl-2.0 | 713 | 0.022876 |
import asyncio
from functools import partial
class AsyncWrapper:
def __init__(self, target_instance, executor=None):
self._target_inst = target_instance
self._loop = asyncio.get_event_loop()
self._executor = executor
def __getattribute__(self, name):
try:
return su... | KeepSafe/translation-real-time-validaton | notifier/executor.py | Python | apache-2.0 | 708 | 0 |
# 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) any later version.
#
# This program is distributed in the hope that it will be usefu... | scylladb/scylla-cluster-tests | sdcm/sct_provision/aws/layout.py | Python | agpl-3.0 | 2,241 | 0.000446 |
# 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.
import logging
from telemetry.page.actions import all_page_actions
from telemetry.page.actions import page_action
def _GetActionFromData(action_data):
... | codenote/chromium-test | tools/telemetry/telemetry/page/page_test.py | Python | bsd-3-clause | 6,182 | 0.010191 |
"""Test if correct arguments are passed to Whoosh to search
indexed content
"""
from mock import patch
from pyramid import testing
from unittest import TestCase
class TestSearchAttr(TestCase):
attr = []
def _return_attr(self, *args, **kwargs):
"""Saves arguments passed to WhooshFulltext
sea... | GreenLunar/Bookie | bookie/tests/test_utils/test_search.py | Python | agpl-3.0 | 1,797 | 0 |
"""Progress API Tests for Version 1.0.
This is a testing template for the generated ProgressAPI Class.
"""
import unittest
import requests
import secrets
from py3canvas.apis.progress import ProgressAPI
from py3canvas.apis.progress import Progress
class TestProgressAPI(unittest.TestCase):
"""Tests for the Progres... | tylerclair/py3canvas | py3canvas/tests/progress.py | Python | mit | 858 | 0.001166 |
# Copyright 2014: Mirantis 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 b... | varunarya10/rally | rally/deploy/engines/fuel.py | Python | apache-2.0 | 6,902 | 0.000724 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | mrunge/openstack_horizon | openstack_horizon/dashboards/project/images/images/views.py | Python | apache-2.0 | 4,298 | 0 |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class TanitJobsCategory(models.Model):
name = models.CharField(max_length=255, unique=True)
def __str__(self):
return "%s" % self.name
cla... | firasbenmakhlouf/JobLookup | metadata/models.py | Python | mit | 467 | 0 |
"""Support for Tasmota fans."""
from hatasmota import const as tasmota_const
from homeassistant.components import fan
from homeassistant.components.fan import FanEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DATA_REMOVE_DISCOVE... | tboyce1/home-assistant | homeassistant/components/tasmota/fan.py | Python | apache-2.0 | 2,750 | 0.000364 |
# -*- coding: utf8 -*-
#****************************************************************************
#* *
#* Printed Circuit Board Workbench for FreeCAD PCB *
#* Flexible Printed Circuit Board Workbench for FreeCAD FP... | sgrogan/freecad-extras-eaglepcb2 | command/PCBexplode.py | Python | lgpl-2.1 | 23,993 | 0.00696 |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/os.py | Python | mit | 21,471 | 0.00312 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
from mingus.containers.track import Track
from mingus.containers.bar import Bar
from mingus.containers.instrument import Instrument, Piano, Guitar
import unittest
class test_Track(unittest.TestCase):
def setUp(self):
self.i = Track(... | speksi/python-mingus | unittest/test_track.py | Python | gpl-3.0 | 739 | 0.006766 |
#!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Fergus Noble <fergus@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITH... | madsryvang/LVsbp | python/sbp/navigation.py | Python | lgpl-3.0 | 28,612 | 0.009681 |
AR = '/usr/bin/ar'
ARFLAGS = 'rcs'
CCFLAGS = ['-g']
CCFLAGS_MACBUNDLE = ['-fPIC']
CCFLAGS_NODE = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
CC_VERSION = ('4', '4', '3')
COMPILER_CXX = 'g++'
CPP = '/usr/bin/cpp'
CPPFLAGS_NODE = ['-D_GNU_SOURCE']
CPPPATH_NODE = '/usr/local/include/node'
CPPPATH_ST = '-I%s'
CXX = [... | webofthings/wot-a-mashup | cs/proxy/node_modules/dtrace-provider/build/c4che/Release.cache.py | Python | gpl-3.0 | 1,407 | 0 |
#!/usr/bin/env python
from optparse import OptionParser
import glob
import os
import shutil
import unittest
import numpy as np
import pandas as pd
from scipy.stats import mannwhitneyu
from scipy.stats import ttest_ind
import slurm
class TestTrain(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.par... | calico/basenji | tests/test_train.py | Python | apache-2.0 | 6,235 | 0.013953 |
import requests
import httpretty
from nose.tools import nottest
from pyrelic import BaseClient
@nottest # Skip until we can properly simulate timeouts
@httpretty.activate
def test_make_request_timeout():
"""
Remote calls should time out
"""
httpretty.register_uri(httpretty.GET, "www.example.com",
... | andrewgross/pyrelic | tests/unit/test_base_client.py | Python | mit | 1,927 | 0 |
#! /usr/bin/python
######################
# views\Delegates.py #
######################
from PyQt5.QtWidgets import QStyleOptionViewItem, QDateEdit
from PyQt5.QtSql import QSqlRelationalDelegate
from PyQt5.QtCore import Qt, QDate
(TASK, WEIGHT, CATEGORY, DESCRIPTION, IMPORTANCE, URGENCY, DIFFICULTY,
DT_ADDED, DATE_DUE... | asconz/SystematicPrioritization | application/views/Delegates.py | Python | mit | 6,089 | 0.002135 |
# Copyright (c) 2016 SwiftStack, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | matthewoliver/swift | test/functional/s3api/test_presigned.py | Python | apache-2.0 | 9,841 | 0 |
fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/Survey.xml'
fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/bratton farm-2.0.xml'
# fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/test.xml'
fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/Portsmouth Heights.xml'
fn='/home/thomas/Dokumente/freecad_buc... | microelly2/geodata | geodat/my_xmlparser.py | Python | lgpl-3.0 | 9,730 | 0.069476 |
#!/usr/bin/env python
'''
Copyright (C) 2014, Digium, Inc.
John Bigelow <jbigelow@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import logging
import pjsua as pj
from twisted.internet import reactor
LOGGER = logging.getLogger(__name__)
URI = [... | auntieNeo/asterisk-testsuite | tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/transfer.py | Python | gpl-2.0 | 7,666 | 0.00013 |
# This file is part of Parti.
# Copyright (C) 2008, 2009 Nathaniel Smith <njs@pobox.com>
# Parti is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.
import gtk
import wimpiggy.lowlevel
from wimpiggy.wm import Wm
from wimpiggy.keys import HotkeyMan... | njsmith/partiwm | parti/parti_main.py | Python | gpl-2.0 | 2,693 | 0.002228 |
from conjureup import controllers
from conjureup.app_config import app
from conjureup.download import EndpointType
from conjureup.telemetry import track_event
from conjureup.ui.views.addons import AddonsView
class AddonsController:
def render(self, going_back=False):
if not app.addons:
if goin... | conjure-up/conjure-up | conjureup/controllers/base/addons/gui.py | Python | mit | 1,165 | 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-monitor/azure/mgmt/monitor/models/incident_py3.py | Python | mit | 2,119 | 0 |
from xml.etree import ElementTree
from os.path import dirname, realpath
directory_of_sources = dirname(realpath(__file__)) + "/sources/"
d = {}
d['AR'] = "Arabic"
d['EN'] = "English"
d['ES'] = "Spanish"
d['FR'] = "French"
d['RU'] = "Russian"
d['ZH'] = "Mandarin"
filepath = '/tmp/uncorpora_plain_20090831.tmx'
count... | DanielJDufour/language-detector | language_detector/prep/parse_un.py | Python | apache-2.0 | 986 | 0.004057 |
from pixelated.adapter.services.mail_service import MailService
from pixelated.adapter.model.mail import InputMail
from pixelated.adapter.services.mail_sender import MailSender
from pixelated.adapter.services.mailboxes import Mailboxes
from pixelated.adapter.soledad.soledad_querier import SoledadQuerier
from pixelated.... | alabeduarte/pixelated-user-agent | service/pixelated/config/services.py | Python | agpl-3.0 | 2,509 | 0.001196 |
# 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 Libidl(AutotoolsPackage):
"""libraries for Interface Definition Language files"""
ho... | iulian787/spack | var/spack/repos/builtin/packages/libidl/package.py | Python | lgpl-2.1 | 614 | 0.004886 |
import math
# Transforms trapezoidal breakwater into a hydraulically equivalent
# rectangular breakwater
# INPUT
# rechd: head difference across equivalent rectangular breakwater
# traphd: head difference across trapezoidal breakwater
# d: water depth
# nummat: number of materials in the breakwater
# numl... | allthroughthenight/aces | python/functions/EQBWLE.py | Python | gpl-3.0 | 1,556 | 0.003213 |
import os
import unittest
import tempfile
import pyoram.util.misc
class Test(unittest.TestCase):
def test_log2floor(self):
self.assertEqual(pyoram.util.misc.log2floor(1), 0)
self.assertEqual(pyoram.util.misc.log2floor(2), 1)
self.assertEqual(pyoram.util.misc.log2floor(3), 1)
self.... | ghackebeil/PyORAM | src/pyoram/tests/test_misc.py | Python | mit | 6,387 | 0.009238 |
#!/bin/python3
import bisect
def is_palindrome(n):
return str(n) == str(n)[::-1]
def generate_palindromes():
return [i * j
for i in range(100, 1000)
for j in range(100, 1000)
if is_palindrome(i * j)]
def find_lt(a, x):
'Find rightmost value less than x'
i = bis... | rootulp/hackerrank | python/euler004.py | Python | mit | 570 | 0 |
import pandas as pd
def handler(event, context):
return ':)'
| moesy/AWS-Lambda-ML-Microservice-Skeleton | app/main.py | Python | mit | 69 | 0.014493 |
# Copyright (C) 2004-2013 by Barry A. Warsaw
#
# This file is part of flufl.enum
#
# flufl.enum 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, version 3 of the License.
#
# flufl.enum is distributed in... | jakubfindura/vnos-nfc | nfc-server/RPLCD/enum.py | Python | mit | 11,214 | 0 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical 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
... | yrobla/nova | nova/tests/test_vmwareapi_vm_util.py | Python | apache-2.0 | 5,302 | 0.000943 |
import enum
class S3SignatureVersion(enum.Enum):
S3_V2 = 'S3_V2'
S3_V4 = 'S3_V4'
| bitmovin/bitmovin-python | bitmovin/resources/enums/s3_sig_version.py | Python | unlicense | 91 | 0 |
from pprint import pformat
from sqlalchemy import Column, ForeignKey, orm
from sqlalchemy.types import String, Integer, Boolean, Text
from sqlalchemy.schema import UniqueConstraint
from intranet3 import memcache
from intranet3.models import Base, User
from intranet3.log import WARN_LOG, INFO_LOG, DEBUG_LOG
LOG = INF... | pytlakp/intranetref | src/intranet3/models/project.py | Python | mit | 10,842 | 0.002121 |
import json
with open("birthdays.json", "r") as damnJson:
birthDays = json.load(damnJson)
print("We know the birth days of: ")
for i in birthDays:
print(i)
print("\nWould you like to add or retrieve a birth day?")
lol = input().strip().lower()
if lol == "add":
person = input("Who's the lucky one? ")
date = input... | daniLOLZ/variaRoba | Python/34.py | Python | mit | 633 | 0.023697 |
"""
PHCpy --- a package for Polynomial Homotopy Continuation
========================================================
PHCpy is a collection of Python modules to compute solutions
of polynomial systems using PHCpack.
A homotopy defines the deformation of a start system
(system with known solutions) into the target sys... | callmetaste/PHCpack | src/Python/PHCpy3/phcpy/__init__.py | Python | gpl-3.0 | 3,727 | 0.000268 |
from frappe import _
def get_data():
return {
'docstatus': 1,
'fieldname': 'request_for_quotation',
'transactions': [
{
'label': _('Related'),
'items': ['Supplier Quotation']
},
]
} | bhupennewalkar1337/erpnext | erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py | Python | gpl-3.0 | 206 | 0.058252 |
"""THis module contains the core functions needed to compute pam models"""
import logging
import random
import bpy
import mathutils
import numpy
from . import constants
from . import grid
from . import model
from . import exceptions
from . import layer
from . import connection_mapping
from .mesh import *
import mul... | MartinPyka/Parametric-Anatomical-Modeling | pam/pam.py | Python | gpl-2.0 | 34,811 | 0.004998 |
#!/usr/bin/env python
import sys
import re
def generateFilename(prefix, file_count, suffix):
return "%s_%04d.%s" % (prefix, file_count, suffix)
def split(filename, prefix, suffix, regexp, do_html, frequency=1):
file_count = 0
count = 0
f = open(filename,'r')
o = open(generateFilename(prefix, file... | rovere/utilities | split.py | Python | mit | 2,848 | 0.009129 |
import sys
from colorama import Fore, Style
from colorama import init
from .plain_reporter import PlainReporter
class ColorReporter(PlainReporter):
def __init__(self, number_of_messages):
super().__init__(number_of_messages)
# Override this method
def print_messages(self, level='all'):
... | shweta97/pyta | python_ta/reporters/color_reporter.py | Python | gpl-3.0 | 1,167 | 0.003428 |
import inspect
import json
import os
import random
import subprocess
import time
import requests
import ast
import paramiko
import rancher
from rancher import ApiError
from lib.aws import AmazonWebServices
DEFAULT_TIMEOUT = 120
DEFAULT_MULTI_CLUSTER_APP_TIMEOUT = 300
CATTLE_TEST_URL = os.environ.get('CATTLE_TEST_URL'... | sabiodelhielo/rancher-validation | tests/v3_api/common.py | Python | apache-2.0 | 41,077 | 0 |
# 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 io import BytesIO
import struct
import zlib
import os
from zipfile import (
ZIP_STORED,
ZIP_DEFLATED,
)
fro... | SlateScience/MozillaJS | js/src/python/mozbuild/mozpack/mozjar.py | Python | mpl-2.0 | 28,516 | 0.000245 |
from distutils.core import setup
import py2exe
import os
import sys
sys.argv.append('py2exe')
# The filename of the script you use to start your program.
target_file = 'main.py'
# The root directory containing your assets, libraries, etc.
assets_dir = '.\\'
# Filetypes not to be included in the above.
excluded_file... | lantra/vugamedev | src/setup.py | Python | mit | 1,710 | 0.008187 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from music21 import *
import os
import sys
localcorpus=os.getcwd()+'/localcorpus/'
localXML='mikro'+str(sys.argv[1])+'.xml'
localfile=localcorpus+localXML
MIKRO=converter.parse(localfile)
MIKRO.show('lily.pdf')
| glerm/ScriptsMusic21 | mostrascore.py | Python | gpl-3.0 | 263 | 0.019011 |
def test_image_export_reference(exporters, state, bpy_image_default, gltf_image_default):
state['settings']['images_data_storage'] = 'REFERENCE'
gltf_image_default['uri'] = '../filepath.png'
output = exporters.ImageExporter.export(state, bpy_image_default)
assert output == gltf_image_default
def test_... | Kupoman/blendergltf | tests/unit/test_image.py | Python | apache-2.0 | 2,570 | 0.002335 |
import datetime
import mock
from django.test import TestCase
from django.utils import timezone
from core.tests.mommy_utils import make_recipe, make_user
from cla_eventlog.tests.test_forms import BaseCaseLogFormTestCaseMixin, EventSpecificLogFormTestCaseMixin
from cla_eventlog.models import Log
from legalaid.models imp... | ministryofjustice/cla_backend | cla_backend/apps/call_centre/tests/test_forms.py | Python | mit | 24,898 | 0.003735 |
# -*- coding: utf-8 -*-
import os
import logging
import datetime
def get_logger(directory, name):
"""
"""
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
date_handler = DateFileHandler(directory, name)
fmt_str = '%(asctime)s %(process)d %(module)s.%(funcName)s.%(lineno)d %(level... | alen-alex/aqi_service | aqi_service/util/log_utils.py | Python | apache-2.0 | 2,106 | 0.001899 |
"""Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.vacuum import (
ATTR_FAN_SPEED,
ATTR_PARAMS,
DOMAIN,
SERVICE_CLEAN_SPOT,
SERVICE_LOCATE,
SERVICE_PAUSE,
... | jawilson/home-assistant | tests/components/vacuum/common.py | Python | apache-2.0 | 6,031 | 0.001326 |
# Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | Richard-Mathie/cassandra_benchmark | vendor/github.com/datastax/python-driver/tests/integration/cqlengine/statements/test_where_clause.py | Python | apache-2.0 | 1,642 | 0.000609 |
'''
File.zipExtract(strZipfile, strDirectory) // returns # of extracted files or false on error
File.zipList() //returns entries
File.zipList(true) //returns only files, not folders
File.zipCreate(strDirectory)
'''
import os
import zipfile
from io import StringIO
def zipfile_list( filename, includeFolders=False):
... | downpoured/lnzscript | lnzscript/util/python/zipfile_wrapper.py | Python | gpl-3.0 | 3,191 | 0.024444 |
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, JsonResponse
import re
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from core.models import User
fro... | MrHalfman/gabbler | social/views.py | Python | gpl-2.0 | 7,760 | 0.001289 |
QUERY_LOGGING = {
'formatters': {
'wrapper_verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'wrapper_simple': {
'format': '%(levelname)s %(message)s'
},
'wrapper_json': {
'()': 'jsonlogger.J... | MattBlack85/django-query-logger | query_logger/settings.py | Python | mit | 981 | 0.002039 |
# -*- coding: utf-8 -*-
"""'Books' part of product categories dictionary.
Must hold subcategories of 'Books'
category in the form of python dictionary data type.
"""
books = {('books', 'книги'): {
('audiobooks', 'аудиокниги'): {
('biography', 'биографии'): {},
('business, economics', 'бизнес, экон... | redmoo-info/proddict | ru/books.py | Python | mit | 8,821 | 0.000141 |
"""Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | vermouthmjl/scikit-learn | sklearn/learning_curve.py | Python | bsd-3-clause | 14,601 | 0 |
# coding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... | markflyhigh/incubator-beam | sdks/python/apache_beam/examples/snippets/transforms/element_wise/keys_test.py | Python | apache-2.0 | 1,774 | 0.002274 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jason Lowe-Power
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list o... | vineodd/PIMSim | GEM5Simulation/gem5/src/learning_gem5/part2/SimpleObject.py | Python | gpl-3.0 | 1,750 | 0.000571 |
#########
# 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... | lj020326/cloudify3-plugin-test | plugin/tests/file_server.py | Python | apache-2.0 | 3,222 | 0 |
import socket
import base64
def read_lines():
global client_socket
lines_buffer = ""
data = True
while data:
try:
data = client_socket.recv(4096)
lines_buffer += data
except socket.timeout:
break
return lines_buffer
print("thermeq3 delete devic... | autopower/thermeq3 | support/del_dev.py | Python | gpl-3.0 | 972 | 0.001029 |
from CIMC import app
if __name__ == '__main__':
app.run() | AndrewNeudegg/CIMC | run.py | Python | mit | 65 | 0.015385 |
from aiida.orm.calculation.job import JobCalculation
from aiida.orm.data.parameter import ParameterData
from aiida.orm.data.structure import StructureData
from aiida.common.exceptions import InputValidationError
from aiida.common.datastructures import CalcInfo, CodeInfo
from aiida.common.utils import classproperty
fro... | abelcarreras/aiida_extensions | plugins/jobs/lammps/md.py | Python | mit | 9,997 | 0.003201 |
#!/usr/bin/env python
#
# v0.1 --
#
# fmount <francesco.pantano@linux.com>
#
#
from argparse import ArgumentParser as argparser
import libtmux
import logging
import subprocess as sub
'''
'''
class Tmuxer(object):
def __init__(self, args):
self.logger = logging.getLogger('Tmuxer')
for attr in args.keys():
s... | fmount/tmux-layout | scripts/menu/tmuxer.py | Python | mit | 1,794 | 0.034002 |
# -*- coding: UTF-8 -*-
"""
muutama esimerkki komennoista
"""
import random, time, os
from subprocess import call
# tähän sanastoon lisätään komennot ja niitä vastaavat oliot
command_dict = {}
class Test:
def main(self, irc, line):
irc.send('PRIVMSG %s :Hell World!' % line[2])
command_dict[':!... | ETShax/Coffeebot | pybot/botcommands.py | Python | gpl-3.0 | 1,196 | 0.01113 |
# Copyright 2015, 2017 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | phenoxim/nova | nova/virt/powervm/tasks/storage.py | Python | apache-2.0 | 14,010 | 0.000071 |
# (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... | ralphbean/ansible | v2/ansible/plugins/connections/__init__.py | Python | gpl-3.0 | 1,862 | 0.001611 |
from django.db import models
class TextFieldSingleLine(models.TextField):
pass
class MetadataFormat(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
prefix = TextFieldSingleLine(unique=True)
schema = models.URLField(max_length=20... | Tima-Is-My-Association/TIMA | oai_pmh/models.py | Python | lgpl-3.0 | 3,783 | 0.005551 |
# -*- coding: UTF-8 -*-
# Copyright 2009-2018 Luc Saffre
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""
Import legacy data from TIM (basic version).
"""
import traceback
import os
from clint.textui import puts, progress
from django.conf import settings
from django.db import models
... | lino-framework/xl | lino_xl/lib/tim2lino/utils.py | Python | bsd-2-clause | 12,793 | 0.001564 |
"""
This file is a pre-setup environments file to make splinter play nice with behave
It is setup to take screenshots whenever of the browser if your steps fail
To change which browser you are using, change the string in Browser(). Note you may need to install Chromedriver for chrome
It is lovingly shared and free to u... | mc706/prog-strat-game | core/features/environment.py | Python | mit | 1,165 | 0.003433 |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | sjohannes/exaile | xl/metadata/mod.py | Python | gpl-2.0 | 2,441 | 0.000819 |
# -*- coding: utf-8 -*-
#
# M2Crypto documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 20 11:15:12 2017.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | Edzvu/Edzvu.github.io | M2Crypto-0.35.2/doc/conf.py | Python | mit | 9,150 | 0.007541 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | AMOboxTV/AMOBox.LegoBuild | plugin.video.salts/scrapers/moviexk_scraper.py | Python | gpl-2.0 | 7,244 | 0.005384 |
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | google/differentiable-atomistic-potentials | dap/tests/test_tf_neighborlist.py | Python | apache-2.0 | 10,324 | 0.005231 |
#!/usr/bin/env python
"""symbal.py: Check for braces to be balanced"""
from stack import Stack
__author__ = 'Rohit Sinha'
def match_braces(opener, closer):
return "({[".index(opener) == ")}]".index(closer)
def brace_checker(brace_string):
stack = Stack()
isbal = True
index = 0
while index < l... | rohitsinha54/Learning-Python | algorithms/symbal.py | Python | mit | 889 | 0.00225 |
"""
Database models for the badges app
"""
from importlib import import_module
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONF... | cecep-edu/edx-platform | lms/djangoapps/badges/models.py | Python | agpl-3.0 | 12,190 | 0.003035 |
from antlr4 import *
from autogen.CymbolParser import CymbolParser
from autogen.CymbolVisitor import CymbolVisitor
class Type:
VOID = "void"
INT = "int"
class CymbolCheckerVisitor(CymbolVisitor):
id_values = {}
def visitIntExpr(self, ctx:CymbolParser.IntExprContext):
print("visting "+Type.INT)
return Type.... | damorim/compilers-cin | antigo/ap3/CymbolCheckerVisitor.py | Python | mit | 1,390 | 0.039568 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... | hagleitn/Openstack-Devstack2 | devstack/components/quantum.py | Python | apache-2.0 | 8,662 | 0.001039 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from sys import hexversion
import copy
import bisect
import random
from .context import sortedcontainers
from sortedcontainers import SortedListWithKey
from nose.tools import raises
from functools import wraps
class SortedList(SortedListWithKey):
pass... | lrq3000/pyFileFixity | pyFileFixity/lib/sortedcontainers/tests/test_stress_sortedlistwithkey.py | Python | mit | 8,149 | 0.005522 |
from flask_simple_alchemy import Relator
from testers import db, app, FakeTable, OtherTable
this_table = Relator(db)
this_table.add('FakeTable')
this_table.add('OtherTable', foreign_key='uuid')
class ThirdTable(db.Model, this_table.HasOneToOneWith.FakeTable):
__tablename__ = 'thirdtable'
id = db.Column(db.Int... | elbow-jason/flask-simple-alchemy | tests/test_relator.py | Python | mit | 3,028 | 0.003633 |
#!/usr/bin/env python
# Copyright(C) 2012 thomasv@gitorious
# 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) any later version.
#
# ... | creditbit/electrum-creditbit-server | run_electrum_creditbit_server.py | Python | agpl-3.0 | 11,252 | 0.003022 |
"""
This module provides tools.
.. moduleauthor:: Felix Mueller
.. moduleauthor:: Pascal Wittmann
:copyright: PenchY Developers 2011-2012, see AUTHORS
:license: MIT License, see LICENSE
"""
import os.path
from penchy.jobs.elements import Tool
from penchy.jobs.hooks import Hook
from penchy.jobs.typecheck import T... | fhirschmann/penchy | penchy/jobs/tools.py | Python | mit | 2,762 | 0.002172 |
'''
eqtime: 30
'''
def main():
info('Felix CO2 analysis')
gosub('felix:WaitForCO2Access')
gosub('felix:PrepareForCO2Analysis')
set_motor('beam',beam_diameter)
if analysis_type=='blank':
info('is blank. not heating')
'''
sleep cumulative time to account for blank
... | USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/helix/extraction/felix_co2.py | Python | apache-2.0 | 2,035 | 0.010319 |
"""JOSE Base64.
`JOSE Base64`_ is defined as:
- URL-safe Base64
- padding stripped
.. _`JOSE Base64`:
https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-37#appendix-C
.. Do NOT try to call this module "base64", as it will "shadow" the
standard library.
"""
import base64
import six
def b6... | nohona/cron-crm | usr/local/certbot/acme/acme/jose/b64.py | Python | gpl-3.0 | 1,523 | 0 |
import _plotly_utils.basevalidators
class MetaValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="meta", parent_name="parcats", **kwargs):
super(MetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok=k... | plotly/plotly.py | packages/python/plotly/plotly/validators/parcats/_meta.py | Python | mit | 435 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ..model.attack import Attack
from ..config import Configuration
from ..tools.hashcat import HcxDumpTool, HcxPcapTool, Hashcat
from ..util.color import Color
from ..util.timer import Timer
from ..model.pmkid_result import CrackResultPMKID
from threading import Thread
... | derv82/wifite2 | wifite/attack/pmkid.py | Python | gpl-2.0 | 7,652 | 0.003921 |
#!/usr/bin/env python
# Mapnik uses the build tool SCons.
# This python file is run to compile a plugin
# It must be called from the main 'SConstruct' file like:
# SConscript('path/to/this/file.py')
# see docs at: http://www.scons.org/wiki/SConscript()
import os
# Give this plugin a name
# here this happens to be... | mojodna/debian-mapnik | plugins/input/templates/helloworld/build.py | Python | lgpl-2.1 | 2,425 | 0.002474 |
# Natural Language Toolkit: Glue Semantics
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2010 NLTK Project
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import os
import nltk
from nltk.internals import Counter
from nltk.parse import *
from nltk.parse import MaltPar... | markgw/jazzparser | lib/nltk/sem/glue.py | Python | gpl-3.0 | 27,061 | 0.008647 |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api_v3/models/preferences_v30_rc1.py | Python | mit | 3,447 | 0.00029 |
#! /usr/bin/env python3
import ast
import glob
import warnings
import numpy as np
from typing import List, Tuple
from .observable_plotter import observable_file_reader
from .numerical_sort import numerical_sort
def _find_data_files(pattern: str) -> List[str]:
"""Find files that match the pattern."""
file_lis... | hmedina/KaSaAn | KaSaAn/functions/observable_coplotter.py | Python | mit | 6,362 | 0.003458 |
#!/usr/bin/env python
## \file parallel_regression.py
# \brief Python script for automated regression testing of SU2 examples
# \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron
# \version 6.2.0 "Falcon"
#
# The current SU2 release has been coordinated by the
# SU2 International Developers Society ... | srange/SU2 | TestCases/parallel_regression.py | Python | lgpl-2.1 | 66,999 | 0.018254 |
"""
Django settings for blog project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Buil... | our-iot-project-org/pingow-web-service | src/blog/settings.py | Python | mit | 3,829 | 0.001567 |
import scrapy
from scrapy.selector import Selector
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from crawlers.items import JdItem
from scrapy.http import TextResponse,FormRequest,Request
import json
class JdHardwareSpider(scrapy.Spider):
name = 'jd-hardware'
allo... | jackliusr/scrapy-crawlers | crawlers/crawlers/spiders/jd_hardware.py | Python | apache-2.0 | 2,190 | 0.018265 |
from django.db import models
models.options.DEFAULT_NAMES += ('_DATABASE',)
class Weekstructure(models.Model):
setid = models.TextField(max_length=10)
weeknumber = models.BigIntegerField(null=True, blank=True)
startdate = models.DateField(primary_key=True)
description = models.TextField(null=True, ma... | uclapi/uclapi | backend/uclapi/timetable/models.py | Python | mit | 65,300 | 0 |
# -*- coding: utf-8 -*-
"""
Display logged-in username.
Configuration parameters:
format: display format for whoami (default '{username}')
Format placeholders:
{username} display current username
Inspired by i3 FAQ:
https://faq.i3wm.org/question/1618/add-user-name-to-status-bar.1.html
@author ultrabug
... | docwalter/py3status | py3status/modules/whoami.py | Python | bsd-3-clause | 1,179 | 0.000848 |
# -*- coding: utf-8 -*-
import sys
import json
import time
import uuid
import socket
import getpass
import argparse
import datetime
import platform
import socklusion
DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = 8888
DEFAULT_PATH = '/v1/on_import'
TIMEOUT = 5.0
INSTANCE_ID = uuid.uuid4()
IS_64BIT = sys.maxsize > 2 ** 3... | paypal/support | examples/python_analytics/client/collect.py | Python | bsd-3-clause | 2,659 | 0.000376 |
# 1. Strip non alphabetic
inputStr = "I may opt for a top yam for Amy, May, and Tommy."
import re
regex = re.compile('[^a-zA-Z ]')
output = regex.sub('',inputStr)
# 2. Convert letters to lower case
output = output.lower()
# 3. sort all the letters within each word
# 4. also eliminate duplicates
DicOfWords = {}
for word... | meisamhe/GPLshared | Research_Projects_UTD/Data_Science/some_python.py | Python | gpl-3.0 | 988 | 0.026316 |
import json, datetime, decimal
from django.http import HttpResponse
class EnhancedJSONEncoder(json.JSONEncoder):
"""
JSONEncoder subclass that knows how to encode date/time and decimal types.
"""
def default(self, o):
if isinstance(o, datetime.datetime):
return o.ctime()
el... | DeadWisdom/inreach | app/ajax.py | Python | mit | 1,366 | 0.005124 |
'''
This will store any menus all inherited from a prototype with two functions
update and execute. Update will change display based on cursor position, while
execute will process button clicks.
'''
import pygame, ai
from pygame.locals import *
from scrabble import DISPLAYSURF, CLICK
class Menu():
def __init__(sel... | grokcore/dev.lexycross | wordsmithed/menu.py | Python | mit | 7,437 | 0.045717 |
'''
Maze Generator
By Stephen Davies
Builds a maze using tree construction
'''
# Current idea:
# - Build maze and tree at the same time
# - Start at some square - say (0, 0) for now - and randomly add unused square to leaves of the tree
import random, json
from collections import namedtuple
SquareNode = namedtuple... | steve9164/maze-generator | maze.py | Python | mit | 6,550 | 0.003511 |
# Copyright 2016 Massachusetts Open Cloud
#
# 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... | CCI-MOC/moc-openstack-tools | setpass.py | Python | apache-2.0 | 1,945 | 0.001542 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.