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 |
|---|---|---|---|---|---|
#
# This file is part of GNU Enterprise.
#
# GNU Enterprise 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.
#
# GNU Enterprise is distributed ... | fxia22/ASM_xf | PythonD/lib/python2.4/site-packages/display/cursing/MsgBoxOK.py | Python | gpl-2.0 | 1,972 |
# 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
import traceback
from data_source import DataSource
from extensions_paths import PRIVATE_TEMPLATES
from file_system import FileNotFoundEr... | qtekfun/htcDesire820Kernel | external/chromium_org/chrome/common/extensions/docs/server2/template_data_source.py | Python | gpl-2.0 | 1,141 |
import pygame
import random
from pygame.locals import *
"""
leikur 1 i verk 2
game of dice
"""
pygame.init()
displaywidth, displayheight = 640,480
gamescreen = pygame.display.set_mode((displaywidth,displayheight))
pygame.display.set_caption('dices')
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)
green = (0,2... | njalsson/FOR3G3U | verk2/hluti1.py | Python | gpl-3.0 | 3,288 |
"""
Module for performing batch gradient methods.
Technically, SGD and BGD both work with any batch size, but SGD has no line
search functionality and is thus best suited to small batches, while BGD
supports line searches and thuse works best with large batches.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyr... | skearnes/pylearn2 | pylearn2/training_algorithms/bgd.py | Python | bsd-3-clause | 20,506 |
# Copyright (c) 2015 Fabian Kochem
| jameshy/libtree | tests/__init__.py | Python | mit | 35 |
from Components.config import config
from Components.VariableText import VariableText
from Renderer import Renderer
from Screens.InfoBar import InfoBar
from Tools.Directories import resolveFilename, SCOPE_SYSETC
from enigma import eLabel
class VtiEmuInfo(VariableText, Renderer):
def __init__(self):
Render... | Open-Plus/opgui | lib/python/Components/Renderer/VtiEmuInfo.py | Python | gpl-2.0 | 1,081 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pipes import quote
import shutil, os, re, subprocess
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.html import escape
from checker.basemodels import Checker, ... | KITPraktomatTeam/Praktomat | src/checker/checker/RChecker.py | Python | gpl-2.0 | 4,473 |
#coding:utf8
DEBUG = True
try:
import sae
DBNAME = sae.const.MYSQL_DB
USER = sae.const.MYSQL_USER
PASSWD = sae.const.MYSQL_PASS
HOST = sae.const.MYSQL_HOST
PORT = sae.const.MYSQL_PORT
SQLALCHEMY_DATABASE_URI = "mysql://%s:%s@%s:%s/%s" %(USER, PASSWD, HOST, PORT, DBNAME)
except:
SQLALCH... | prikevs/KevBlog | config.py | Python | mit | 437 |
#######################################################################################################################
# #
# HERMES is a straightforward index which tries to summarize the mitochondrial e... | mozoo/HERMES | HERMES.py | Python | gpl-3.0 | 11,176 |
"""engine.SCons.Tool.f77
Tool-specific initialization for the generic Posix f77 Fortran compiler.
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, 2002, 2003, 2004, 2005, 2006, 2007, 2... | barnone/EigenD | tools/packages/SCons/Tool/f77.py | Python | gpl-3.0 | 2,048 |
from datetime import datetime
from typing import Dict, List, Optional
from szurubooru import db, errors, model, rest, search
from szurubooru.func import (
auth,
favorites,
mime,
posts,
scores,
serialization,
snapshots,
tags,
versions,
)
_search_executor_config = search.configs.Post... | rr-/szurubooru | server/szurubooru/api/post_api.py | Python | gpl-3.0 | 10,581 |
# -*- coding: utf-8 -*-
#
# sanpera documentation build configuration file, created by
# sphinx-quickstart2 on Sat May 12 21:24:07 2012.
#
# 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... | eevee/sanpera | doc/conf.py | Python | isc | 7,742 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: KevinMidboe
# @Date: 2017-03-04 13:47:32
# @Last Modified by: KevinMidboe
# @Last Modified time: 2017-03-04 13:53:12
import re
testFile = '/Volumes/media/tv/New Girl/New Girl Season 06/New Girl S06E18/New.Girl.S06E18.Young.Adult.1080p.WEB-DL.DD5.1.H264-[ezt... | KevinMidboe/seasonedShows | app/modules/removeUploader.py | Python | mit | 780 |
from lib import wifi_utils
# Load simulated output
SIMULATED_ROUTER = open("simulator/data/olsr.txt").read()
SIMULATED_FPING = open("simulator/data/fping.txt").read()
def parse_tables(data):
return wifi_utils.parse_tables(data)
def get_tables(olsr_ip = None):
return parse_tables(SIMULATED_ROUTER)
def parse_fpin... | galaxor/Nodewatcher | nodewatcher/monitor/simulator/wifi_utils.py | Python | agpl-3.0 | 455 |
'''This is an implementation of a priority queue that supports
the remove operation as well as insert and deletemin.
It is based on the heapdict implementation at
https://github.com/DanielStutzbach/heapdict
S. Tanimoto, Oct. 20, 2017.
A method getpriority(elt) was added on Oct. 21.
This data structure is provided to ... | vaibhavi-r/CSE-415 | Assignment3/priorityq.py | Python | mit | 1,289 |
from __future__ import unicode_literals
import warnings
from django.db import models
from django.test import TestCase, override_settings
from django.utils import six
class FieldDeconstructionTests(TestCase):
"""
Tests the deconstruct() method on all core fields.
"""
def test_name(self):
"""... | oscaro/django | tests/field_deconstruction/tests.py | Python | bsd-3-clause | 17,552 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
parser = argparse.ArgumentParser(description="Test")
parser.add_argument("--output-dir", dest="output_dir", action="store")
args = parser.parse_args()
with open(os.path.join(args.output_dir, "extra.txt"), "w") as o:
o.write("... | brettwooldridge/buck | test/com/facebook/buck/doctor/testdata/report/extra.py | Python | apache-2.0 | 343 |
# coding: utf-8
# python imports
from functools import wraps
import json
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError:
from django.contrib.auth.models import User
# django imports
from django import template
from django.contrib.contenttypes.models import... | roberzguerra/scout | grappelli/templatetags/grp_tags.py | Python | gpl-2.0 | 6,154 |
# 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/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py | Python | mit | 4,697 |
"""Support for deCONZ devices."""
from __future__ import annotations
from typing import cast
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_HOST,
CONF_PORT,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import HomeAssistant, callback
im... | jawilson/home-assistant | homeassistant/components/deconz/__init__.py | Python | apache-2.0 | 3,591 |
#!/usr/bin/env python
import sys
import logging
from error import debugExceptHook
sys.excepthook = debugExceptHook
log = logging.getLogger()
logging.basicConfig(level=logging.DEBUG)
from model5 import Action
data = { "action" : "create",
"tag" : "symlink",
"values" : [ {"path/to/fil... | xbcsmith/frell | test/model5_test.py | Python | apache-2.0 | 776 |
import sys
import re
class Parse:
"""class for parsing templates"""
templated_html = ""
@staticmethod
def parse_custom_template(text, json_obj, root):
"""parse statements and operations in the template"""
indent = ""
next_indent = ""
block = ""
Parse.templated_html = ""
num_line = 0
lines = text.sp... | linostar/python-JSOV | JSOV/parse.py | Python | bsd-3-clause | 4,646 |
"""Urls for the Zinnia authors"""
from django.conf.urls import url
from django.conf.urls import patterns
from zinnia.urls import _
from zinnia.views.authors import AuthorList
from zinnia.views.authors import AuthorDetail
urlpatterns = patterns(
'',
url(r'^$',
AuthorList.as_view(),
name='autho... | 1844144/django-blog-zinnia | zinnia/urls/authors.py | Python | bsd-3-clause | 568 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from pip._vendor import pkg_resources
from pip._internal.commands.list import ListCommand
def get_dist(dist_name, lookup_dirs=None):
"""Get dist for installed version of dist_name avoiding pkg_resources cache
"""
# note: base... | glomex/gcdt | gcdt/package_utils.py | Python | mit | 1,465 |
import main, news # noqa
| LikeMyBread/Saylua | saylua/modules/general/views/__init__.py | Python | agpl-3.0 | 25 |
# Generated by Django 2.1.3 on 2018-12-05 17:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("events", "0057_auto_20181024_1757")]
operations = [
migrations.AddField(
model_name="event",
name="scanner_category",
... | lafranceinsoumise/api-django | agir/events/migrations/0058_auto_20181205_1844.py | Python | agpl-3.0 | 819 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import gdspy
import picwriter.toolkit as tk
from picwriter.components.mmi1x2 import MMI1x2
from picwriter.components.mmi2x2 import MMI2x2
from picwriter.components.waveguide import Waveguide
fro... | DerekK88/PICwriter | picwriter/components/mzi.py | Python | mit | 53,110 |
# Copyright (c) 2001-2011 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to be driven by the Qt mainloop.
In order to use this support, simply do the following::
| app = QApplication(sys.argv) # your code to init Qt
| import qt4reactor
| qt4reactor... | FreshXOpenSource/wallaby-frontend-qt | wallaby/frontends/qt/reactor/qt4reactor.py | Python | bsd-2-clause | 10,475 |
###############################################################################
# Name :
# Purpose :
# Author : Austin Gross
# Created : 2015-04-24
# Copyright : Copyright (c) 2015 Velotron Heavy Industries.
###############################################################################
import pa... | jsheedy/affogato | gelato/gelato.py | Python | unlicense | 2,710 |
# A little test server, complete with typelib, we can use for testing.
# Originally submitted with bug:
# [ 753154 ] memory leak wrapping object having _typelib_guid_ attribute
# but modified by mhammond for use as part of the test suite.
import sys, os
import pythoncom
import win32com
import winerror
from win32com.ser... | koyuawsmbrtn/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32com/test/pippo_server.py | Python | gpl-2.0 | 2,613 |
__all__ = ["ebc", "matrix"] | blpercha/ebc | __init__.py | Python | mit | 27 |
"""SCons.Tool.Packaging
SCons Packaging Tool.
"""
#
# __COPYRIGHT__
#
# 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, ... | timj/scons | src/engine/SCons/Tool/packaging/__init__.py | Python | mit | 10,505 |
#!/usr/bin/env python
''' Geometry: orthogonality.'''
'''
Copyright 2010, 2011 Lloyd Konneker
This file is part of Pensool.
Pensool 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... | bootchk/pensool | source/base/orthogonal.py | Python | gpl-3.0 | 5,620 |
from .find_embryo import find_embryo
from .extract_pattern import extract_pattern
from .cluster_patterns import cluster_patterns
from .cluster_patterns import pattern_distance
from .Image import Image
| ilyapatrushev/isimage | isimage/__init__.py | Python | gpl-2.0 | 201 |
from unittest import mock
from rest_framework import status, test
from waldur_mastermind.marketplace.tests.factories import OfferingFactory
from waldur_mastermind.marketplace_rancher import PLUGIN_NAME
from waldur_rancher.tests import factories, fixtures
MOCK_CLUSTER = {
"id": "new_cluster_id",
"name": "cust... | opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/marketplace_rancher/tests/test_import.py | Python | mit | 3,692 |
GENOMES_DIR='/home/cmb-panasas2/skchoudh/genomes'
OUT_DIR = '/staging/as/skchoudh/rna/HuR_results/human/ribo-seq-rsem'
SRC_DIR = '/home/cmb-panasas2/skchoudh/github_projects/ribo-seq-snakemake/scripts'
GENOME_BUILD = 'hg38'
GENOME_FASTA = GENOMES_DIR + '/' + GENOME_BUILD + '/fasta/'+ GENOME_BUILD+ '.fa'
STAR_INDEX = GE... | saketkc/ribo-seq-snakemake | configs/config_HuR_Penalva_L_01182017.human.rsem.py | Python | bsd-3-clause | 2,165 |
from __future__ import absolute_import
from django.conf import settings as dj_settings
from django.core.signals import setting_changed
from django.utils.translation import ugettext_lazy as _
from .constants import STRICTNESS
from .utils import deprecate
DEFAULTS = {
'DISABLE_HELP_TEXT': False,
'HELP_TEXT_F... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/django_filters/conf.py | Python | mit | 3,262 |
import json
from api.schema import schema
from django.core.management.base import BaseCommand
from graphql import get_introspection_query, graphql_sync
class Command(BaseCommand):
def handle(self, *args, **options):
query = get_introspection_query(descriptions=False)
result = graphql_sync(schema,... | patrick91/pycon | backend/api/management/commands/graphql_schema.py | Python | mit | 594 |
class OperationError(Exception):
"""Error response from Management API"""
class AuthError(Exception):
"""Management API Authentication Error"""
| jairojunior/jboss-py | jboss/exceptions.py | Python | gpl-3.0 | 153 |
import webapp2
from views import *
app = webapp2.WSGIApplication([
('/', MainHandler),
('/create', CreateHandler),
('/edit', EditHandler)
], debug=True)
| leofournier/gae-veiculos-crud | main.py | Python | gpl-3.0 | 166 |
"""
Filesystem-related utilities.
"""
from threading import Lock
from tempfile import mkdtemp
import posixpath
import ntpath
import os.path
import shutil
import os
import re
import stat
class TempDirs(object):
"""Tempdir manager."""
def __init__(self, tmpdir, prefix="rez_"):
self.tmpdir = tmpdir
... | saddingtonbaynes/rez | src/rez/utils/filesystem.py | Python | gpl-3.0 | 9,573 |
"""
OAuth backend for LinkedIn
"""
import json
import logging
import requests
from oic.utils.authn.authn_context import UNSPECIFIED
from oic.oauth2.consumer import stateID
from oic.oauth2.message import AuthorizationResponse
from satosa.backends.oauth import _OAuthBackend
from satosa.internal import AuthenticationInf... | its-dirg/SATOSA | src/satosa/backends/github.py | Python | apache-2.0 | 4,519 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
import time
from frappe import _, msgprint, is_whitelisted
from frappe.utils import flt, cstr, now, get_datetime_str, file_lock, date_diff
from frappe.model.base_document import BaseDocument, get_controller... | mhbu50/frappe | frappe/model/document.py | Python | mit | 43,429 |
#Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Simple Fun #3: Late Ride
#Problem level: 7 kyu
def late_ride(n):
return sum([int(x) for x in list(str(n//60)+str(n%60))])
| Kunalpod/codewars | simple_fun_#3_late_ride.py | Python | mit | 178 |
#!/usr/bin/env python
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2012 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 op... | pombredanne/openaire | bibsched/lib/bibsched_tasklets/bst_openaire_keywords.py | Python | gpl-2.0 | 4,095 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def remove_duplicate_renditions(apps, schema_editor):
Rendition = apps.get_model('wagtailimages.Rendition')
# Find all filter_id / image_id pairings that appear multiple times in the renditions table
... | inonit/wagtail | wagtail/wagtailimages/migrations/0004_make_focal_point_key_not_nullable.py | Python | bsd-3-clause | 1,559 |
import os
import nose
import django
NAME = os.path.basename(os.path.dirname(__file__))
ROOT = os.path.abspath(os.path.dirname(__file__))
os.environ['DJANGO_SETTINGS_MODULE'] = 'fake_settings'
os.environ['PYTHONPATH'] = os.pathsep.join([ROOT,
os.path.join(ROOT, 'examples')]... | jbalogh/jingo | run_tests.py | Python | bsd-3-clause | 522 |
# Various uses of GET Command Generator uses
from pysnmp.entity.rfc3413.oneliner import cmdgen
cmdGen = cmdgen.CommandGenerator()
# Send SNMP GET request
# with SNMPv2c, community 'public'
# over IPv4/UDP
# to an Agent at localhost:161
# for two OIDs in string form
errorIndication, errorStatus, error... | xfguo/pysnmp | examples/v3arch/oneliner/manager/getgen.py | Python | bsd-3-clause | 5,446 |
from flask import flash
FLASH_MESSAGE_INFO = "info"
FLASH_MESSAGE_ERROR = "error"
FLASH_MESSAGE_WARNING = "warning"
def set_template(prefix, name, ext=".html"):
"""
This will return a safe template file path based on given params
:param prefix: template root for module
:param name: template name
... | sabbir360/mvc-flask | helpers/generic.py | Python | mit | 603 |
#!/usr/bin/env python
import sys
import json
import os
import datetime
import time
from pprint import pprint
default_os = '8-stream'
##next_os = 'RHEL8.4'
#next_branch_base = 'rhel-8'
jenkins_url = 'https://jenkins-networkmanager.apps.ocp.ci.centos.org/'
class GitlabTrigger(object):
def __init__(self, data):
... | NetworkManager/NetworkManager-ci | run/centos-ci/cico_gitlab_trigger.py | Python | gpl-3.0 | 12,762 |
"""A module containing analytical objects specific to a particular experiment.
"""
import os
import numpy as np
import pandas as pd
from whaler.analysis import Analysis
class Reactions():
"""
"""
def __init__(self):
self.A = Analysis()
# Analysis output filenames.
self.cr... | tristanbrown/whaler | whaler/custom.py | Python | mit | 7,129 |
#!/usr/bin/env python
"""
Copyright 2017 The Trustees of Princeton University
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
Unle... | iychoi/syndicate-core | demo/registrar/syndicate_signup.py | Python | apache-2.0 | 10,196 |
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from electrum_gui.kivy.i18n import _
from datetime import datetime
from electrum.util import InvalidPassword
Builder.load_str... | cryptapus/electrum-uno | gui/kivy/uix/dialogs/tx_dialog.py | Python | mit | 5,821 |
#-*-coding:utf-8-*-
import re
import web
import os
import json
from pymongo import MongoClient
from lrucache import lrucache
__author__ = 'george.yang'
def getInput(input):
return htmlquote(dict(input))
def htmlquote(inputData):
if isinstance(inputData,dict) == False:
return web.net.htmlquote(inpu... | qq179157977/codingwebpyblog | utils/webpyutil.py | Python | mit | 4,924 |
plot = data.plot(insetlabels=True)
ax = plot.gca()
ax.set_xscale('seconds', epoch=1187008882)
ax.axvline(1187008882, color='orange', linestyle='--')
ax.set_title('LIGO-Livingston data quality around GW170817')
plot.show() | gwpy/gwpy.github.io | docs/latest/examples/timeseries/statevector-3.py | Python | gpl-3.0 | 221 |
#!/usr/bin/env python3
"""
Download http/https/ftp/file URLs.
"""
import argparse
import glob
import http
import json
import os
import shutil
import signal
import socket
import sys
import time
import urllib.request
from typing import List, Tuple
import config_mod
import file_mod
import task_mod
class Options:
"... | drtuxwang/system-config | bin/fget.py | Python | gpl-2.0 | 8,457 |
#!/usr/bin/env py.test
"""Unit tests for the fem interface"""
# Copyright (C) 2016 Chris Richardson
#
# This file is part of DOLFIN.
#
# DOLFIN 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 v... | FEniCS/dolfin | test/unit/python/fem/test_petsc_transfer_matrix.py | Python | lgpl-3.0 | 5,618 |
import collections
import inspect
import six
from wiring.providers import (
FactoryProvider,
FunctionProvider,
InstanceProvider
)
__all__ = (
'InvalidConfigurationError',
'Module',
'provides',
'scope',
)
class InvalidConfigurationError(Exception):
"""
Raised when there is some ... | msiedlarek/wiring | wiring/configuration.py | Python | apache-2.0 | 9,239 |
from django.core.management import BaseCommand
class Command(BaseCommand):
# This is not used as it's done through django-cron, see cron-folder for the jobs
def handle(self, *args, **options):
from pastebin import maintainer
maintainer.cleanup_db() | johannessarpola/django-pastebin | pastebin/management/commands/maintenance.py | Python | mit | 289 |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
class ArgumentParseError(Exception):
pass
class LimitExceededException(Exception):
pass
| mic4ael/indico | indico/web/http_api/exceptions.py | Python | mit | 313 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complia... | Hybrid-Cloud/conveyor | conveyor/server/manager.py | Python | apache-2.0 | 2,094 |
# -*- coding: utf-8 -*-
# Written (W) 2008-2012 Christian Widmer
# Written (W) 2008-2010 Cheng Soon Ong
# Written (W) 2012-2014 Daniel Blanchard, dblanchard@ets.org
# Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS
# This file is part of GridMap.
# GridMap is free software: you can redistribute it and/or m... | dan-blanchard/gridmap | setup.py | Python | gpl-3.0 | 2,696 |
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | mxOBS/deb-pkg_trusty_chromium-browser | v8/tools/js2c.py | Python | bsd-3-clause | 16,168 |
#!/usr/bin/env python2
# server.py by JB@KIT 01/2018
'''
Server script for DC DAC LTC2666 to be run on Raspberry Pi mounted in the DC DAC rack.
Raspberry Pi 3 model pin configuration: MOSI: 19, MISO: 21, SCLK: 23, Chip select CE0: 24 (in use with dac0), CE1: 26 (dac1).
DAC model: LTC2666-16
Internal reference: REFC... | qkitgroup/qkit | qkit/services/raspi_misc/dc_dac/server.py | Python | gpl-2.0 | 2,679 |
import _plotly_utils.basevalidators
class UnselectedValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="unselected", parent_name="scatterpolargl", **kwargs
):
super(UnselectedValidator, self).__init__(
plotly_name=plotly_name,
par... | plotly/python-api | packages/python/plotly/plotly/validators/scatterpolargl/_unselected.py | Python | mit | 901 |
# Copyright 2017 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... | jbedorf/tensorflow | tensorflow/python/data/experimental/kernel_tests/serialization/dataset_serialization_test_base.py | Python | apache-2.0 | 26,060 |
# Truth and guesses should be lists of (commit_id, classification_id)
def score(truth, guesses):
truth = dict(truth)
correct_matches = 0
incorrect_matches = 0
for commit_id, classification_id in guesses:
assert(commit_id in truth)
if truth[commit_id] == classification_id:
correct_matches += 1
... | mglidden/git-analysis | analysis/score_matches.py | Python | mit | 598 |
import os
import functools
from typing import Callable, Dict, IO, List, Optional, Tuple, Union
from .argtypes import KeyValueArg
from .constants import (
SEPARATORS_GROUP_MULTIPART, SEPARATOR_DATA_EMBED_FILE_CONTENTS,
SEPARATOR_DATA_EMBED_RAW_JSON_FILE, SEPARATOR_GROUP_NESTED_JSON_ITEMS,
SEPARATOR_DATA_RAW... | PKRoma/httpie | httpie/cli/requestitems.py | Python | bsd-3-clause | 7,179 |
# -*- 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
#... | subodhchhabra/airflow | tests/contrib/hooks/test_wasb_hook.py | Python | apache-2.0 | 5,851 |
#----------------------------
# Python Test Calculator!!! -
# Created by Austin Wheeler -
# austnwheel@gmail.com -
#----------------------------
print("Welcome to Python-Calc!")
print("This calculator is still a work in progress, so please be nice.")
def add(x, y):
"""Add the two given values!"""
return x... | wheelfilm/Python-Calc | Calculator.py | Python | gpl-2.0 | 1,168 |
# Copyright 2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import errno
import re
from itertools import chain
from portage import os
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
from portage.util import grabfile, writ... | fastinetserver/portage-idfetch | pym/portage/sets/files.py | Python | gpl-2.0 | 10,676 |
"""Configuration definitions
"""
import numpy
from astropy import units as u
from astropy.coordinates import EarthLocation
from processing_library.util.coordinate_support import xyz_at_latitude
from data_models.memory_data_models import Configuration
from data_models.parameters import arl_path, get_parameter
from pr... | SKA-ScienceDataProcessor/algorithm-reference-library | processing_components/simulation/configurations.py | Python | apache-2.0 | 11,417 |
### This is a util script that generates the basic Automation scripts for a Demisto BYOI integration.
### This gives you a good starting point from which to enhance your script to format output, handle errors etc.
### INPUTS: BYOI integration yaml file (such as those that appear in https://github.com/demisto/content/t... | demisto/tools | basic-function-generator/FunctionGenerator.py | Python | mit | 4,244 |
#!/usr/bin/env python3
#
# This program creates a ks.cfg file based of the configuration options given.
#
# Copyright (C) 2015 Dennis Chen <barracks510@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | barracks510/ks-generator | groups.py | Python | gpl-3.0 | 2,577 |
import unittest
from mock import MagicMock, ANY
from boto.kms.layer1 import KMSConnection
from boto.dynamodb2.exceptions import ItemNotFound
from boto.dynamodb2.table import Table
from flotilla.agent.db import FlotillaAgentDynamo
ASSIGNED = 'e697b6b7cef7faba1bc7cbd20e0d247fdb46f96231cdef8897de0b6e19468c76'
UNIT_1_HAS... | pebble/flotilla | src/test/agent/test_db.py | Python | mit | 4,505 |
"""
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
imp... | luo66/scikit-learn | sklearn/linear_model/logistic.py | Python | bsd-3-clause | 63,107 |
##//
##// Copyright 2011 Paul White
##//
##// This file is part of py-airfoil.
##//
##// This 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
##... | pokemon4ik2008/py-airfoil | airfoil.py | Python | gpl-3.0 | 27,206 |
# -*- coding: utf-8 -*-
#
# plugins/CM11A /__init__.py
#
# Written by Silviu Marghescu
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2019 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 L... | topic2k/EventGhost | plugins/CM11A/__init__.py | Python | gpl-2.0 | 14,924 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | agry/NGECore2 | scripts/mobiles/endor/putrid_borgle.py | Python | lgpl-3.0 | 1,572 |
#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2005, 2006, 2007 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# ... | bcl/pykickstart | pykickstart/commands/upgrade.py | Python | gpl-2.0 | 5,221 |
#!/usr/bin/env python
import sys
import string
import subprocess
#----------------------------------------------------------------------
# Define some handy functions
#----------------------------------------------------------------------
def get_contents(file):
f = open(file,'r')
fc = f.readlines()
f.clo... | hermes47/QUACCS_2.0_Shython | py2/scan_dihedral.py | Python | mit | 6,460 |
#!/usr/bin/env python3
#
# pacman_conf.py
#
# Based on pyalpm code Copyright (C) 2011 Rémy Oudompheng <remy@archlinux.org>
# Copyright © 2013-2015 DSGos
#
# This file is part of DSGos_Installer.
#
# DSGos_Installer is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | DecisionSystemsGroup/DSGos | airootfs/usr/share/DSGos-Installer/DSGos_Installer/pacman/pacman_conf.py | Python | mit | 7,754 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# timetable documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 16 16:32:24 2016.
#
# 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
# ... | BeerTheorySociety/timetable | docs/conf.py | Python | bsd-3-clause | 9,474 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Vers... | sparkslabs/kamaelia_ | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/Contrib/Kamaelia.Apps.SA/PeriodicTick.1.py | Python | apache-2.0 | 1,130 |
from __future__ import print_function, division
"""
Derived from acq4 and cnmodel code originally developed by Luke Campagnola and Paul B. Manis,
Univerity of North Carolina at Chapel Hill.
"""
import numpy as np
import lmfit
from ..stats import weighted_std
class FitModel(lmfit.Model):
""" Simple extension of l... | campagnola/neuroanalysis | neuroanalysis/fitting/fitmodel.py | Python | mit | 5,550 |
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from lyricwiki.items import LyricWikiItem
class LyricWikiSpider(CrawlSpider):
name = "theroots" #CHANGE NAME
... | elainekmao/hiphoptextanalysis | lyricwiki-scraper/lyricwiki/spiders/theroots_spider.py | Python | gpl-2.0 | 1,138 |
#!/usr/bin/python
# coding: utf-8
from sets import Set
class Solution(object):
def containsNearbyDuplicate(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: bool
"""
s = Set()
for i, v in enumerate(nums):
if i > k:
s.... | Lanceolata/code-problems | python/leetcode/Question_219_Contains_Duplicate_II.py | Python | mit | 574 |
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
's... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2_vpc_nacl_facts.py | Python | bsd-3-clause | 6,352 |
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score, accuracy_score
import CS6140_A_MacLeay.Homeworks.HW4.ecoc2 as ecoc
import CS6140_A_MacLeay.utils.Adaboost as adar
__author__ = 'Allison MacLeay'
"""
Decision stump - feature (fi) threshold (tij) pair
{1, -1} 1 if featu... | alliemacleay/MachineLearning_CS6140 | Homeworks/hw4.py | Python | mit | 9,285 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "EuroDrivers.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| pilhoo/EuroDriversWebSite | old/manage.py | Python | gpl-3.0 | 254 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | LoHChina/nova | nova/api/openstack/__init__.py | Python | apache-2.0 | 19,025 |
import os
import re
from autotest.client import test, utils, os_dep
from autotest.client.shared import error
class qemu_iotests(test.test):
"""
This autotest module runs the qemu_iotests testsuite.
@copyright: Red Hat 2009
@author: Yolkfull Chow (yzhou@redhat.com)
@see: http://www.kernel.org/pu... | rajashreer7/autotest-client-tests | qemu_iotests/qemu_iotests.py | Python | gpl-2.0 | 3,900 |
# This scipt will generate the ctl and idx files of the grib2 data of
# Models 2010 data
import os
walk = os.walk('/mnt/MODEL_DATA/CMC')
for root, sub, files in walk:
print root
os.chdir(root)
for f in files:
if f.endswith('_anl.grib') and not f.endswith('.idx') \
and not... | arulalant/mmDiagnosis | diagnosis1/extra/gribfiles/generate_idx_ctl_files_grib2.py | Python | gpl-3.0 | 1,630 |
from django.db import models
from django_orm.postgresql.hstore.query import HStoreQuerySet
from django_orm.manager import Manager
class HStoreManager(Manager):
"""
Object manager which enables hstore features.
"""
use_for_related_fields = True
def get_query_set(self):
return HStoreQuerySe... | EnTeQuAk/django-orm | django_orm/postgresql/hstore/managers.py | Python | bsd-3-clause | 636 |
#!/usr/bin/python
import re,cgi,cgitb,sys
import os
import urllib
import Cookie
import datetime
import meowaux as mew
cgitb.enable()
login_signup="""
<ul class='nav navbar-nav' style='float:right; margin-top:7px; margin-right:5px; ' >
<li>
<form action='/login' style='display:inline;' >
<button class='bt... | abetusk/www.meowcad.com | cgi/about.py | Python | agpl-3.0 | 1,664 |
##################################################################################################
# Copyright (c) 2012 Brett Dixon
#
# 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 r... | theiviaxx/Frog | frog/admin.py | Python | mit | 3,156 |
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
from falcon import HTTPNotFound, HTTP_204, HTTPBadRequest
from ujson import dumps as json_dumps
from ... import db
from ...auth import login_required, check_use... | diegocepedaw/oncall | src/oncall/api/v0/user.py | Python | bsd-2-clause | 5,466 |
#!/usr/bin/env python
# coding=utf-8
"""
Copyright 2015-2016 Sukbeom Kim
This file is part of NdriveFuse (https://github.com/seokbeomKim/NdriveFUSE/)
NdriveFUSE 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, ei... | seokbeomKim/NdriveFUSE | NdriveFUSE/modules/confgen.py | Python | gpl-2.0 | 6,365 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_FixedDurationTuplet_scale_01():
r'''Double tuplet.
'''
tuplet = scoretools.FixedDurationTuplet(Duration(2, 8), "c'8 d'8 e'8")
mutate(tuplet).scale(Multiplier(2))
assert systemtools.TestManager.compare(
tuplet,
r'''... | mscuthbert/abjad | abjad/tools/scoretools/test/test_scoretools_FixedDurationTuplet_scale.py | Python | gpl-3.0 | 4,681 |
#-*- coding=utf-8 -*-
'''
@description: 影讯信息获取类。
@author: miliang<miliang@baidu.com>
'''
import sys
sys.path.append('../')
import copy
import urllib
import urllib2
import json
import hashlib
import time
import MySQLdb
import redis
import socket
from monitor.settings import MODE,MYSQL,SEQ_INFO_FILE,RED... | deevarvar/myLab | baidu_code/bcoreapi/monitor/seq_info_collector.py | Python | mit | 4,963 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.