code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011, Martín Raúl Villalba
#
# 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 So... | mch/python-ant | src/ant/core/exceptions.py | Python | mit | 1,792 |
"""Models for Hydra Classes."""
from sqlalchemy import create_engine, ForeignKey
from sqlalchemy.sql import func
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.sql import func
from typing import Any
import datetime
import uuid
# from hyd... | xadahiya/hydrus | hydrus/data/db_models.py | Python | mit | 7,768 |
"""
Copyright Yasutaka Nishimura 2017, 2019
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... | nishi2go/maximo-docker | maximo/StopAllServers.py | Python | apache-2.0 | 976 |
# -*- coding: UTF-8 -*-
# The source code contained in this file is licensed under the MIT license.
# See LICENSE.txt in the main project directory, for more information.
# For the exact contribution history, see the git revision log.
from libkne.util import APPLICATION_NUMBER_TRANSACTION_DATA, \
APPLICATION_NUMBE... | FelixSchwarz/libkne | libkne/controlrecord.py | Python | mit | 4,395 |
import aislib
import time
import sys
ships={'kornaros':(239311000,'kornaros.txt','!AIVDM,1,1,,A,53T>HV01hAoM=PqP001HUA<DqA`u>0du8p58u<0t891::40Ht;@00000000000000000000,2*04'),
'highspeed4':(239658000,'highspeed4.txt','!AIVDM,1,1,,A,53TST402<`;M=L`@000PTLQ=0DDB3@000000000`5hf<<40Ht7P00000000000000000000,2*1D'),
... | hongmeister/aislib | playtrack.py | Python | gpl-2.0 | 1,861 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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 ... | MSusik/invenio | invenio/modules/communities/admin/__init__.py | Python | gpl-2.0 | 1,712 |
from src.hw2_Cluster import *
from src.hw2_Cluster.Utils import *
import random
from functools import reduce
from datetime import datetime
def rand_centroids(point_set, k):
'''
at the begining, pick random k point as centroids
:param point_set:
:param k:
:return:
'''
rand_index = random.sa... | MyXOF/Data-Mining-Algorithm | src/hw2_Cluster/K_means.py | Python | mit | 4,494 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
import re
import urllib2
import csv
#mapdata_wk = json.load(open("map-weekday.json"))
#mapdata_hl = json.load(open("map-holiday.json"))
#stopsdata = json.load(open("stops.json"))
#mobiletracker_data = json.load(open("mobiletracker-combined.json"))
#... | busradar/busradar | data/combine-stops.py | Python | gpl-3.0 | 2,819 |
"""The WaveBlocks Project
Compute the norms of the inhomogeneous wavepackets as well as the sum of all norms.
@author: R. Bourquin
@copyright: Copyright (C) 2010, 2011 R. Bourquin
@license: Modified BSD License
"""
from WaveBlocks import PotentialFactory
from WaveBlocks import HagedornWavepacketInhomogeneous
def c... | WaveBlocks/WaveBlocks | src/scripts/NormWavepacketInhomog.py | Python | bsd-3-clause | 2,202 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Callable, Dict, Iterable, List, Tuple
from django.test import override_settings
from zerver.lib.test_classes import (
ZulipTestCase,
)
from zerver.lib.utils import statsd
import mock
impor... | blaze225/zulip | zerver/tests/test_report.py | Python | apache-2.0 | 5,347 |
"""Support for setting the Deluge BitTorrent client in Pause."""
from __future__ import annotations
import logging
from deluge_client import DelugeRPCClient, FailedToReconnectException
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import (... | rohitranjan1991/home-assistant | homeassistant/components/deluge/switch.py | Python | mit | 3,515 |
#!/usr/bin/env python
"""
@package ion.services.mi.instrument_fsm Instrument Finite State Machine
@file ion/services/mi/instrument_fsm.py
@author Edward Hunter
@brief Simple state machine for driver and agent classes.
"""
__author__ = 'Edward Hunter'
__license__ = 'Apache 2.0'
from threading import RLock
from mi.co... | oceanobservatories/mi-instrument | mi/core/instrument/instrument_fsm.py | Python | bsd-2-clause | 6,326 |
class ScopedSet(object):
def __init__(self, initial_set = None):
self.sets = []
self.push(initial_set if initial_set is not None else [])
def push(self, new_set = None):
if new_set is None:
new_set = set([])
elif not isinstance(new_set, set):
new_set = set(new_set)
self.sets.append(... | iskandr/dsltools | dsltools/scoped_set.py | Python | bsd-3-clause | 705 |
class MyClass:
attr: int
def __init___(self, x):
self.attr = x
self.at<caret>tr
| siosio/intellij-community | python/testData/intentions/PyAnnotateVariableTypeIntentionTest/notSuggestedInstanceAttributeWithAnnotation.py | Python | apache-2.0 | 105 |
# Generated by Django 2.2 on 2019-06-04 12:17
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('company', '0005_auto_20190525_2356'),
... | inventree/InvenTree | InvenTree/order/migrations/0001_initial.py | Python | mit | 2,316 |
import dj_database_url
import os
from .base import *
# Parse database configuration from $DATABASE_URL
DATABASES = { 'default': {} }
DATABASES['default'] = dj_database_url.config()
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# Allow a... | kern3020/opportunity | opportunity/settings/prod.py | Python | mit | 575 |
from django.db import models
from django.contrib.auth.models import User
from django.utils.timezone import now
from markdown import markdown
from vodkamartiniarticle.helper import unique_slugify
from django.contrib.comments.models import Comment
from django.contrib.comments.signals import comment_will_be_posted
from dj... | alexisbellido/django-vodkamartini-article | vodkamartiniarticle/models.py | Python | bsd-3-clause | 5,101 |
#sqlite3 test.db
#create table student( id, name, room, tel );
#insert into student values( 666, 'zhan', '6-303', 83272451 );
#insert into student values( 777, 'zhang', '6-404', 83423567 );
#insert into student values( 888, 'zhuang', '6-707', 83256673 );
#select * from student;
#select name from student;
#select name f... | hacpai/show-me-the-code | Python/0020/main.py | Python | gpl-2.0 | 618 |
# Copyright (c) Pedro Matiello <pmatiello@gmail.com>
#
# 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, m... | wdv4758h/ZipPy | edu.uci.python.benchmark/src/benchmarks/python-graph/tests/unittests-accessibility.py | Python | bsd-3-clause | 10,695 |
""" Lexemes base definitions for the lexemes module. """
from enum import Enum
# Definitions
# ============================================================================
# Characters
# ----------------------------------------------------------------------------
def char_range(first, last):
""" Set of charact... | Hibou57/PostiATS-Utilities | postiats/lexemes_defs.py | Python | bsd-2-clause | 25,678 |
from django import template
register = template.Library()
@register.filter
def hashtospace(value):
return value.replace("_"," ")
| CodeForAfrica/WAZImap.Kenya | hurumap_land/templatetags/hashtospace.py | Python | gpl-3.0 | 135 |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | Southpaw-TACTIC/TACTIC | src/pyasm/application/maya/maya_builder.py | Python | epl-1.0 | 5,227 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-14 17:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('spirit_user', '0007_auto_20161114_1536'),
]
operations = [
migrations.RemoveField(
... | battlecat/Spirit | spirit/user/migrations/0008_auto_20161114_1707.py | Python | mit | 574 |
# -*- coding: utf-8 -*-
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 v... | tfroehlich82/EventGhost | plugins/AtiRemoteWonder2WinUsb/__init__.py | Python | gpl-2.0 | 5,213 |
import clr
clr.AddReferenceByPartialName("PythonLibs")
from c<caret>om.just.like import java
print java.LikeJavaClass | idea4bsd/idea4bsd | python/testData/dotNet/import_module_from_package.py | Python | apache-2.0 | 120 |
import os
import sys
from setuptools import setup, find_packages, Command
from commands import *
tests_require=['pytest-cov', 'pytest', 'testfixtures']
setup(
name=name,
version=read_version(),
description='A regex based file organizer',
long_description=open(os.path.join(base_dir, 'description.txt')... | chriscz/pySorter | setup.py | Python | gpl-3.0 | 1,350 |
#!/usr/bin/env python3
'''
A SPARQL driver
Copyright 2012-2020 Codinuum Software Lab <https://codinuum.com>
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/... | ebt-hpc/cca | cca/scripts/sparql.py | Python | apache-2.0 | 7,056 |
# -*- coding: utf-8 -*-
import codecs
from decimal import Decimal
from datetime import datetime
from mock import MagicMock
from base import BraspagTestCase, RegexpMatcher
from braspag.utils import spaceless
class IssueBilletTest(BraspagTestCase):
def setUp(self):
super(IssueBilletTest, self).setUp()
... | TracyWebTech/braspag | tests/test_billet_data.py | Python | lgpl-3.0 | 2,618 |
#!/usr/bin/env python
"""
Check your inbox for code reviews.
"""
from collections import defaultdict
from optparse import OptionParser
import os
import sys
from textwrap import dedent
from diffscuss.mailbox.common import get_inbox_name, get_inbox_path, \
check_inited
from diffscuss import walker, header, dates
... | tomheon/diffscuss | diffscuss/mailbox/check.py | Python | mit | 5,882 |
from gh.base import Command
from gh.util import tc
class MyCommand(Command):
name = 'my'
usage = '%prog [options] my [options] [sub-command]'
summary = 'Access to authorized user content'
subcommands = {
'dashboard': 'Print your received events',
'issues': 'Print your issues',
... | sigmavirus24/github-cli | gh/commands/my/__init__.py | Python | gpl-3.0 | 8,099 |
# coding=utf-8
"""InaSAFE Disaster risk assessment tool developed by AusAid -
*Clipper implementation.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software ... | Jannes123/inasafe | safe/utilities/clipper.py | Python | gpl-3.0 | 24,296 |
#!/usr/bin/python3
import sys
if sys.path[0].endswith("worker"):
sys.path[0] = sys.path[0][:-6]
from utils import env, tools
config = env.getenv("CONFIG")
#config = "/opt/docklet/local/docklet-running.conf"
tools.loadenv(config)
from utils.log import initlogging
initlogging("docklet-taskcontroller")
from utils.log ... | FirmlyReality/docklet | src/worker/taskcontroller.py | Python | bsd-3-clause | 19,328 |
from multilingual.languages import (
get_language_code_list,
get_default_language_code)
def multilingual(request):
"""
Returns context variables containing information about available languages.
"""
return {'LANGUAGE_CODES': get_language_code_list(),
'DEFAULT_LANGUAGE_CODE': get_de... | markherringer/waywayd | third-party/django_multilingual/multilingual/context_processors.py | Python | agpl-3.0 | 343 |
# Copyright (C) 2011 Mattias Slabanja <slabanja@chalmers.se>
#
# 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... | slabanja/dynsf | dsf/binner.py | Python | gpl-2.0 | 3,214 |
import cherrypy
import hashlib
import mock
import mongomock
import os
import pytest
import shutil
from .utils import uploadFile, MockSmtpReceiver, request as restRequest
def _uid(node):
"""
Generate a unique name from a pytest request node object.
"""
return '_'.join((node.module.__name__, node.cls._... | data-exp-lab/girder | pytest_girder/pytest_girder/fixtures.py | Python | apache-2.0 | 7,272 |
""" This module contains testcase_06_inittab test """
from testcase import Testcase
class testcase_07_libc6_xen_conf(Testcase):
"""
Check for /etc/ld.so.conf.d/libc6-xen.conf absence on RHEL
"""
stages = ['stage1']
applicable = {'platform': '(?i)RHEL|BETA|ATOMIC'}
tags = ['default']
# py... | RedHatQE/dva | dva/test/testcase_07_libc6_xen_conf.py | Python | gpl-2.0 | 539 |
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
import os
from . import log
logger = log.setup_logger(__name__)
def getuser():
"Returns the name of the current user"
import getpass
return getpass.getuser()
def gethomedir(user=''):
return os.pat... | ClusterLabs/crmsh | crmsh/userdir.py | Python | gpl-2.0 | 1,970 |
#GAME ENGINE AUTO RIG
import maya.cmds as cmds
import maya.mel as mel
from functools import partial
import os, cPickle, ast, time, subprocess
import traceback
#get existing instances
try:
import gc
for obj in gc.get_objects():
if isinstance(obj, SkeletonBuilder_UI):
#set the joint mover mo... | PopCap/GameIdea | Engine/Extras/Maya_AnimationRiggingTools/MayaTools/General/Scripts/ART_skeletonBuilder_UI.py | Python | bsd-2-clause | 739,414 |
"""AWS plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ..util import (
ApplicationError,
display,
is_shippable,
ConfigParser,
)
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
... | thaim/ansible | test/lib/ansible_test/_internal/cloud/aws.py | Python | mit | 3,947 |
import json
from django.db import migrations, models, transaction
def text_to_json(apps, schema_editor):
Document = apps.get_model("document", "Document")
documents = Document.objects.all().iterator()
with transaction.atomic():
for document in documents:
document.content = json.loads(d... | fiduswriter/fiduswriter | fiduswriter/document/migrations/0004_move_json_data.py | Python | agpl-3.0 | 3,812 |
def myscan(n):
for ii in range(n):
yield from dmesh(dets1, zpssy, -0.5, 0.5, 40, zpssz, -0.5, 0.5, 40, 3)
| NSLS-II-HXN/ipython_ophyd | startup/users_plans.py | Python | bsd-2-clause | 119 |
import logging
import xml.etree.ElementTree as ET
from django.conf import settings
from django.urls import reverse
import requests
from furl import furl
from users.models import User
logger = logging.getLogger(__name__)
class UlbCasBackend:
CAS_ENDPOINT = "https://auth.ulb.be/"
LOGIN_METHOD = "ulb-cas"
... | UrLab/DocHub | users/authBackend.py | Python | agpl-3.0 | 3,830 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ListOrders
# Returns orders created during a time frame that you specify.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# y... | MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Amazon/Marketplace/Orders/ListOrders.py | Python | gpl-3.0 | 8,478 |
# -*- encoding: utf-8 -*-
from supriya.tools.synthdeftools.SignalRange import SignalRange
from supriya.tools.ugentools.UGen import UGen
class Dust(UGen):
r'''A unipolar random impulse generator.
::
>>> dust = ugentools.Dust.ar(
... density=23,
... )
>>> dust
Dus... | andrewyoung1991/supriya | supriya/tools/ugentools/Dust.py | Python | mit | 2,414 |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Find files on the client."""
import stat
from grr.client.client_actions import searching as searching_actions
from grr.lib import aff4
from grr.lib import flow
from grr.lib.aff4_objects import aff4_grr
from grr.lib.aff4_objects import standard
... | destijl/grr | grr/lib/flows/general/find.py | Python | apache-2.0 | 4,185 |
# 007. Reverse Integer
import unittest
class Solution(object):
def reverse(self, x):
"""
:type x: int
:rtype: int
"""
if x < 0:
x = -x
print(x)
# my_string[::-1] is used to reverse string.
x = -int(str(x)[::-1])
else:
... | hanlin-he/UTD | leetcode/py/007.py | Python | mit | 763 |
'''
Copyright (C) 2014 Parrot SA
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following di... | 149393437/ARSDKBuildUtils | Utils/Python/Unix_BuildLibrary.py | Python | bsd-3-clause | 3,507 |
# Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | tensorflow/graphics | tensorflow_graphics/nn/layer/__init__.py | Python | apache-2.0 | 984 |
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import unittest
try:
import typing
except ImportError:
pass
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
try:
import spiffsgen
except I... | espressif/esp-idf | components/spiffs/test_spiffsgen/test_spiffsgen.py | Python | apache-2.0 | 2,295 |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import logging
from oauthlib import common
from oauthlib.uri_validate import is_absolute_uri
from .base import GrantTypeBase
from .. import errors
from ..r... | b0ttl3z/SickRage | lib/oauthlib/oauth2/rfc6749/grant_types/implicit.py | Python | gpl-3.0 | 17,622 |
# Copyright 2014 Open vStorage NV
#
# 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 writ... | tcpcloud/openvstorage | ovs/extensions/rabbitmq/processor.py | Python | apache-2.0 | 8,625 |
"""
Flow tracker was made to easily apply dynamic ACLs
to count packets to see if traffic is received or sent on our switches.
"""
import argparse
import re
import json
def arg_parse():
"""arg_parse is used to capture user arguments and add them into a dictionary depending on what arguments are used.
This dic... | extremenetworks/xkit | EXOS/Python/flowtracker/flowtrack.py | Python | bsd-2-clause | 17,591 |
import logging
import numpy as np
import openpathsampling as paths
from openpathsampling.numerics import (
Histogram, histograms_to_pandas_dataframe, LookupFunction, Histogrammer
)
from openpathsampling.numerics import WHAM
from openpathsampling.netcdfplus import StorableNamedObject
from openpathsampling.analysi... | jhprinz/openpathsampling | openpathsampling/high_level/transition.py | Python | lgpl-2.1 | 19,446 |
""" Page Object Model that deals with common desktop functionality """
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from liveobs_ui.selectors.desktop.navigation_selectors import \
LEFT_NAVIGATION_ITEMS, LEFT_NAVIGATION_ITEMS_NAME
from liveobs_ui.selectors.desktop.searc... | bjss/BJSS_liveobs_automation | liveobs_ui/page_object_models/desktop/desktop_common.py | Python | gpl-3.0 | 9,110 |
from setuptools import setup, find_packages
setup(
# Application name:
name="Stormy",
# Version number (initial):
version="0.1.0",
# Application author details:
author="stormy author",
author_email="author@stormy.com",
scripts = ["StormyApps"], # scrypt for first call on this ... | printerpam/Stormy | desktop_gui/setup.py | Python | gpl-2.0 | 806 |
__author__ = 'jrootham'
import os.path
import sqlite3 as sq
import tkinter as tk
import undo
def menu(menuBar, dependencies, frame):
global __dependencies
__dependencies = dependencies
__dependencies['frame'] = frame
fileMenu = tk.Menu(menuBar)
menuBar.add_cascade(label='File', menu= fileMenu... | jrootham/smte | file.py | Python | gpl-2.0 | 2,615 |
'''
New Integration Test for vip qos.
@author: Legion
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.config_operations as conf_ops
import os
test_stub = test_lib.lib_get_test_stub()
te... | zstackio/zstack-woodpecker | integrationtest/vm/mini/vip_qos/test_flat_vip_qos_1m.py | Python | apache-2.0 | 1,272 |
import sys
import spotipy
''' shows the albums and tracks for a given artist.
'''
def get_artist(name):
results = sp.search(q='artist:' + name, type='artist')
items = results['artists']['items']
if len(items) > 0:
return items[0]
else:
return None
def show_album_tracks(album):
tra... | rcompton/spotipy | examples/artist_discography.py | Python | mit | 1,593 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger
import operator as op
import re
from ..common.compat import string_types, zip, zip_longest, text_type
from ..exceptions import CondaValueError, InvalidVersionSpecError
try:
from... | Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/models/version.py | Python | apache-2.0 | 21,278 |
# set command to set global variables
from lib.utils import *
def _help():
usage = '''
Usage: set [options] (var) [value]
[options]:
-h Print this help.
-del (var) Delete variable
(var) if defined.
where (var) is a valid
global variable
if [value] is not given,
current v... | nayas360/pyterm | bin/set.py | Python | mit | 1,471 |
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | koditraquinas/koditraquinas.repository | plugin.video.traquinas/resources/lib/sources/movienight_mv.py | Python | gpl-2.0 | 3,240 |
"""All minimum dependencies for scikit-learn."""
import platform
import argparse
# numpy scipy and cython should by in sync with pyproject.toml
if platform.python_implementation() == 'PyPy':
SCIPY_MIN_VERSION = '1.1.0'
NUMPY_MIN_VERSION = '1.14.0'
else:
SCIPY_MIN_VERSION = '0.19.1'
NUMPY_MIN_VERSION =... | bnaul/scikit-learn | sklearn/_build_utils/min_dependencies.py | Python | bsd-3-clause | 2,230 |
class NipapError(Exception):
""" NIPAP base error class.
"""
error_code = 1000
class NipapInputError(NipapError):
""" Erroneous input.
A general input error.
"""
error_code = 1100
class NipapMissingInputError(NipapInputError):
""" Missing input.
Most input is passed ... | SoundGoof/NIPAP | nipap/nipap/errors.py | Python | mit | 1,301 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'openPathTool.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(... | david2777/DavidsTools | Standalone/openPathTool/UI_openPathTool.py | Python | gpl-2.0 | 3,656 |
# Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.com>
#
# 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,... | wdv4758h/ZipPy | edu.uci.python.benchmark/src/benchmarks/python-graph/core/pygraph/readwrite/__init__.py | Python | bsd-3-clause | 1,258 |
"""WebSocket protocol versions 13 and 8."""
import base64
import binascii
import collections
import hashlib
import os
import random
from struct import Struct
from aiohttp import errors, hdrs
from aiohttp.log import ws_logger
__all__ = ('WebSocketParser', 'WebSocketWriter', 'do_handshake',
'Message', 'WebS... | kehao95/Wechat_LearnHelper | src/env/lib/python3.5/site-packages/aiohttp/websocket.py | Python | gpl-3.0 | 14,073 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | dims/cinder | cinder/tests/unit/brick/test_brick_lvm.py | Python | apache-2.0 | 15,126 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh}.
"""
from __future__ import division, absolute_import
import struct
try:
import cryptography
except ImportError:
cryptography = None
try:
import pyasn1
except ImportError:
pyasn1 = None
from ... | EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/src/twisted/conch/test/test_ssh.py | Python | mit | 32,076 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-10 04:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0009_fix_billing_year_1353'),
]
operations = [
migrations.AlterField... | ocwc/ocwc-members | members/crm/migrations/0011_update_year_0408.py | Python | mit | 654 |
from rain.redis._placeholder import BaseMix
class ServerMix(BaseMix):
async def select(self, db):
await self._send(b'SELECT', db)
async def auth(self, password):
await self._send(b'AUTH', password)
async def echo(self, message):
return await self._send(b'ECHO', message)
async def ping(self, cost_time=Fal... | ztkIsAlreadyTaken/rain | rain/redis/c4server.py | Python | unlicense | 594 |
""" CStoJSONSynchronizer
Module that keeps the pilot parameters file synchronized with the information
in the Operations/Pilot section of the CS. If there are additions in the CS,
these are incorporated to the file.
The module uploads to a web server the latest version of the pilot scripts.
"""
from __future__... | yujikato/DIRAC | src/DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py | Python | gpl-3.0 | 14,410 |
from .sport import SportAdmin
from .attribute import AttributeAdmin
from .club import ClubAdmin
from .team import TeamAdmin
from .npc import NpcAdmin
from .npc_attribute import NpcAttributeAdmin
from .match import MatchAdmin
from .match_team import MatchTeamAdmin
from .manager import ManagerAdmin
from .manager_attr... | alumarcu/dream-framework | dream/core/admin/__init__.py | Python | gpl-3.0 | 501 |
#!/usr/bin/python -u
#
# Copyright (c) 2016 Balazs Nemeth
#
# This file 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 file i... | 5GExchange/mapping | generator/sg_generator.py | Python | apache-2.0 | 7,483 |
# Copyright (c) 2015-2016 Cisco Systems, 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... | rgreinho/molecule | test/unit/conftest.py | Python | mit | 10,037 |
# All cahmpions available
from ..champion.champion import Champion
from .list_of_abilities import *
# Normal Ahri
ahri = Champion('Ahri (Normal)',
abilities={
'Q': ahri_q,
'W': ahri_w,
'E': ahri_e,
'R': ahri_r,
},
ocean={
'O':0.2,
'C':1.0,
'E':0.9,
... | JakeCowton/Pok-e-Lol | environment/list_of_champions.py | Python | mit | 1,229 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
play audio via system call
Tested environment:
Mac OS X 10.6.8
Linux 3.0 KDE 4.6.5
alsa-utils: /usr/bin/aplay
"""
import os
import threading
import subprocess
import sys
if sys.platform == "darwin":
player_name = "afplay"
elif sys.platform == "linux2":
... | alexlib/Qt-Python-Binding-Examples | audio_video/play_wav_in_sys_call.py | Python | bsd-3-clause | 1,187 |
# 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... | rabipanda/tensorflow | tensorflow/python/debug/cli/analyzer_cli_test.py | Python | apache-2.0 | 79,326 |
pps = """bdwdjjo avricm cjbmj ran lmfsom ivsof
mxonybc fndyzzi gmdp gdfyoi inrvhr kpuueel wdpga vkq
bneh ylltsc vhryov lsd hmruxy ebnh pdln vdprrky
fumay zbccai qymavw zwoove hqpd rcxyvy
bcuo khhkkro mpt dxrebym qwum zqp lhmbma esmr qiyomu
qjs giedut mzsubkn rcbugk voxk yrlp rqxfvz kspz vxg zskp
srceh xdwao reshc shecr... | justanotherdot/advent-linguist | 2017/aoc_04.py | Python | mit | 23,369 |
#!/usr/bin/env/python
import sys
import argparse
from bokpipe.bokastrom import scamp_solve
parser = argparse.ArgumentParser()
parser.add_argument("image",type=str,
help="input FITS image")
parser.add_argument("catalog",type=str,
help="input FITS catalog")
parser.add_argument("... | legacysurvey/rapala | bokpipe/tools/bokwcs.py | Python | bsd-3-clause | 1,410 |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | CMUSV-VisTrails/WorkflowRecommendation | vistrails/core/log/opm_graph.py | Python | bsd-3-clause | 3,382 |
"""A module which implements the time frequency estimation.
Authors : Alexandre Gramfort, alexandre.gramfort@telecom-paristech.fr
Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
License : BSD 3-clause
Morlet code inspired by Matlab code from Sheraz Khan & Brainstorm & SPM
"""
import warnings
from math import sq... | matthew-tucker/mne-python | mne/time_frequency/tfr.py | Python | bsd-3-clause | 46,795 |
from setuptools import setup, find_packages
import version
# temporary chdir is needed so that scons can build this from another cwd
import os
old_dir = os.getcwd()
new_dir = os.path.dirname(__file__)
if new_dir:
os.chdir(new_dir)
else:
new_dir = "."
long_desc = open("%s/README.rst" % new_dir).read()
depends... | ohmu/poni | setup.py | Python | apache-2.0 | 1,507 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Sandesh Logger
#
import logging
import logging.handlers
from gen_py.sandesh.ttypes import SandeshLevel
class SandeshLogger(object):
"""Sandesh Logger Implementation."""
_logger = None
_DEFAULT_LOG_FILE = '<stdout>'
_DEFAULT_SY... | JioCloud/contrail-sandesh | library/python/pysandesh/sandesh_logger.py | Python | apache-2.0 | 6,598 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | fluendo/cerbero | cerbero/packages/osx/packager.py | Python | lgpl-2.1 | 27,799 |
import socket
import sys
import sickbeard
from sickbeard import logger
from lib.growl import gntp
def send_growl(options,message=None):
#Send Registration
register = gntp.GNTPRegister()
register.add_header('Application-Name',options['app'])
register.add_notification(options['name'],True)
if options['password... | wimoverwater/Sick-Beard | sickbeard/notifiers/growl.py | Python | gpl-3.0 | 2,463 |
class FileFormatError(Exception):
"""Raised when an error is found in an input file"""
pass
class DataProcessingError(Exception):
"""Raised when an error occurs during processing of the data"""
pass
| NLeSC/MAGMa | job/magma/errors.py | Python | apache-2.0 | 217 |
#!/usr/bin/env python
'''
Emulate a USB device to be used for fuzzing
Usage:
umap2fuzz -P=PHY_INFO -C=DEVICE_CLASS [-q] [--vid=VID] [--pid=PID] [-i=FUZZER_IP] [-p FUZZER_PORT] [-v ...]
Options:
-P --phy PHY_INFO physical layer info, see list below
-C --class DEVICE_CLASS class of the device ... | nccgroup/umap2 | umap2/apps/fuzz.py | Python | agpl-3.0 | 3,867 |
# Copyright 2021 DeepMind Technologies 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | deepmind/deepmind-research | ogb_lsc/mag/csr_builder.py | Python | apache-2.0 | 4,710 |
#!/usr/bin/env python
import pubsubclient
import time
# This will run when we get a reply
def handle_nodes(node_list):
# This function should take one argument, a list of pubsubclient.Node objects
global client
# We've received a reply, so reduce the amount we're waiting for by one
global wait
wait -= 1
for nod... | Warbo/pubsubclient | test.py | Python | agpl-3.0 | 1,192 |
#!/usr/bin/env python
#
# Generate the absolute paths to files within subdirectories for a given top
# level directory.
#
import os
import sys
if len(sys.argv) != 2:
print "Usage: generate_paths path_to_top_level_dir"
sys.exit()
dir = sys.argv[1]
for path, dirs, files in os.walk(dir):
for f in files:
... | wjbeksi/rgbd-covariance-descriptors | utilities/generate_paths.py | Python | bsd-2-clause | 401 |
from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (Person, Group, Membership, CustomMembership,
PersonSelfRefM2M, Friendship)
class M2mThroughTests(TestCase):
def setUp(self):
self.bob = Person.... | yceruto/django | tests/m2m_through/tests.py | Python | bsd-3-clause | 12,856 |
#!/usr/bin/env python
# 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
#... | phenoxim/cinder | tools/config/generate_cinder_opts.py | Python | apache-2.0 | 9,608 |
"""
Multinet utility functions to communicate with the master and the worker machines
"""
import requests
import sys
import multiprocessing
import json
import time
import logging
import argparse
logging.getLogger().setLevel(logging.DEBUG)
def parse_arguments():
"""Reads the arguments passed from command line.
... | intracom-telecom-sdn/multinet | util/multinet_requests.py | Python | epl-1.0 | 8,130 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-21 21:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('contacts',... | zapcoop/vertex | vertex_api/inventory/migrations/0001_initial.py | Python | agpl-3.0 | 16,227 |
import pdb
#pdb.set_trace()
import sys
from PyQt4.QtGui import QApplication, QGraphicsScene, QGraphicsTextItem, QGraphicsView
from PyQt4.QtCore import QPointF
from PyQt4.QtCore import Qt
import config
# from graph.plotter import Plotter
from graph.graph import Graph
# More imports below
config.debug.plotter.show_... | khedron/Plot | plot.py | Python | gpl-3.0 | 4,260 |
#!/usr/bin/env python
#
# cnc25d_example_generator.py
# it generates examples of python scripts that use the cnc25d package
# created by charlyoleg on 2013/06/03
#
# (C) Copyright 2013 charlyoleg
#
# This file is part of the Cnc25D Python package.
#
# Cnc25D is free software: you can redistribute it and/or modify
# it... | charlyoleg/Cnc25D | bin/cnc25d_example_generator.py | Python | gpl-3.0 | 167,833 |
'''
Copyright 2009, 2010 Anthony John Machin. All rights reserved.
Supplied subject to The GNU General Public License v3.0
Created on 07 Aug 2010
Last Updated on 08 Aug 2010
Stress tests - situations, scalability
Related:
test24stress-30a - tests indirect relationships from generated data
... | Semanticle/Semanticle | sm-mt-devel/src/metabulate/tests/test24stess-30c.py | Python | gpl-2.0 | 26,007 |
"""SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted... | OpenKore/OpenKore | src/scons-local-3.1.2/scons-local-3.1.2/SCons/Tool/mslink.py | Python | gpl-2.0 | 14,751 |
#!/usr/bin/env python
# On Darwin, dynamic libraries have an install name. At link time, the
# linker can work with a dylib anywhere in the filesystem, but it will
# write the dylib's install name into the resulting image, and at load
# time that dylib will normally be expected to be found at exactly that
# path. Ho... | rudkx/swift | utils/swift-rpathize.py | Python | apache-2.0 | 3,634 |
import struct
import ctypes.wintypes
from ctypes.wintypes import DWORD, WCHAR, BYTE, BOOL
# from mprapi.h
MAX_INTERFACE_NAME_LEN = 2**8
# from iprtrmib.h
MAXLEN_PHYSADDR = 2**3
MAXLEN_IFDESCR = 2**8
# from iptypes.h
MAX_ADAPTER_ADDRESS_LENGTH = 8
MAX_DHCPV6_DUID_LENGTH = 130
class MIB_IFROW(ctypes.Structure):
_f... | clinton-hall/nzbToMedia | libs/win/jaraco/windows/api/inet.py | Python | gpl-3.0 | 5,825 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.