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 |
|---|---|---|---|---|---|
def delta_pole(nu, k, l, series):
"""
Returns the pole of a meromorphic global conformal block given by the
parameters in arXiv:1406.4858 by Kos, Poland and Simmons-Duffin.
Parameters
----------
nu: `(d - 2) / 2` where d is the spatial dimension.
k: The parameter k indexing the var... | cbehan/pycftboot | blocks1.py | Python | mit | 15,739 |
# -*- coding: utf-8 -*-
'''
python-capture-agent
~~~~~~~~~~~~~~~~~~~~
:copyright: 2014-2017, Lars Kiesow <lkiesow@uos.de>
:license: LGPL – see license.lgpl for more details.
'''
from pyca.config import config
from pyca import db
from datetime import datetime
from dateutil.tz import tzutc
import errno
... | opencast/pyCA | pyca/utils.py | Python | lgpl-3.0 | 8,273 |
# Copyright 2012 VPAC, http://www.vpac.org
#
# This file is part of Patchman.
#
# Patchman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 only.
#
# Patchman is distributed in the hope that it will b... | VPAC/patchman | patchman/operatingsystems/views.py | Python | gpl-3.0 | 6,552 |
"""LTI integration tests"""
from collections import OrderedDict
import json
import mock
from nose.plugins.attrib import attr
import oauthlib
import urllib
from django.conf import settings
from django.core.urlresolvers import reverse
from courseware.tests import BaseTestXmodule
from courseware.views import get_course... | jbassen/edx-platform | lms/djangoapps/courseware/tests/test_lti_integration.py | Python | agpl-3.0 | 9,375 |
import sys
# Should be in EXACT same order as from src/mongoc/mongoc-handshake-private.h.
# The values are implicit (so we assume 1st entry is 1 << 0,
# second entry is 1 << 1 and so on).
MD_FLAGS = [
"MONGOC_MD_FLAG_ENABLE_CRYPTO",
"MONGOC_MD_FLAG_ENABLE_CRYPTO_CNG",
"MONGOC_MD_FLAG_ENABLE_CRYPTO_COMMON_C... | ajdavis/mongo-c-driver | src/libmongoc/examples/parse_handshake_cfg.py | Python | apache-2.0 | 2,113 |
# -*- coding: utf-8 -*-
import base64
import datetime
import json
import time
import mock
from nose.tools import eq_, ok_
from nose.plugins.attrib import attr
from pyquery import PyQuery as pq
from urlparse import urlparse
from django.conf import settings
from django.contrib.sites.models import Site
from django.core... | varunkamra/kuma | kuma/wiki/tests/test_views.py | Python | mpl-2.0 | 167,376 |
#
# Author: Travis Oliphant, 2002
#
from __future__ import division, print_function, absolute_import
import operator
import numpy as np
import math
from scipy._lib.six import xrange
from numpy import (pi, asarray, floor, isscalar, iscomplex, real,
imag, sqrt, where, mgrid, sin, place, issubdtype,
... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/special/basic.py | Python | mit | 62,914 |
def main():
f = open("test.txt","w")
f.write("A"*10000000)
main() | mrinalpande/Music_Encrypt | misc/text.py | Python | mit | 73 |
def f(x,y,z):
return (x+y)/z
a=5
b=6
c=8
result = f(a,b,c)
print(result)
| yw-fang/readingnotes | machine-learning/McKinney-pythonbook2013/chapter03/simple01.py | Python | apache-2.0 | 78 |
from shutil import which
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
@linter(executable='perl',
output_format='regex',
output_regex=r'.+:(?P<line>\d+):(?P<severity>.*) - (?P<message>.*)')
c... | coala-analyzer/coala-bears | bears/vhdl/VHDLLintBear.py | Python | agpl-3.0 | 2,011 |
# 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... | gooddata/openstack-nova | nova/objects/cell_mapping.py | Python | apache-2.0 | 10,122 |
# -*- coding: utf-8 -*-
#
# tco2 documentation build configuration file, created by
# sphinx-quickstart.
#
# 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.
#
# All configuration values have a de... | tpugsley/tco2 | docs/conf.py | Python | bsd-3-clause | 7,729 |
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config import cfg
cfg = __C
#
# Common
#
__C.SUB_CONFIG_FILE = []
__C.DATASET = './experiments/dataset/shapenet_1000.json' # yaml/json file that specifies a dataset (training/testing)
__C.NET_NAME = 'res_gru_net'
_... | chrischoy/3D-R2N2 | lib/config.py | Python | mit | 5,099 |
print '############################################################################################'
print '# #'
print '# Plot_libRadtran_Output ( out_file, out_file_abs=None, fig_title="libRadtran output" ) #'
print '# ... | tenstream/tenstream | src_ANN/Plot_libRadtran_Output.py | Python | gpl-3.0 | 5,298 |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... | YaningX/open-hackathon | open-hackathon-client/src/client/config_sample.py | Python | mit | 12,229 |
#!/usr/bin/env python
import subprocess
import re
import os
import sys
import argparse
import commands
from multiprocessing import Process, Queue
# Module import of openstack control script
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
sys.path.append('../openstack_con... | includeos/includeos-tools | bombardment/bombardment.py | Python | apache-2.0 | 8,263 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("DummyClassifier" , "BinaryClass_100" , "hive")
| antoinecarme/sklearn2sql_heroku | tests/classification/BinaryClass_100/ws_BinaryClass_100_DummyClassifier_hive_code_gen.py | Python | bsd-3-clause | 144 |
########################################################################
#
# (C) 2015, Brian Coca <bcoca@ansible.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... | hkariti/ansible | lib/ansible/galaxy/role.py | Python | gpl-3.0 | 15,068 |
#!/usr/bin/env python
import sys
import glob
import subprocess
from collections import defaultdict
all = defaultdict(lambda : {'D':0, 'R':0, 'T':0, 'B':0})
for o in glob.glob('*/netbsd*'):
release = o.split('/')[0]
output = subprocess.Popen(['nm', o], stdout=subprocess.PIPE).communicate()[0]
for line in o... | razvanm/fs-expedition | bsd/netbsd/expsyms.py | Python | unlicense | 667 |
# 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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py | Python | mit | 4,595 |
print('Money')
| NaderMaharmeh/cs3240-labdemo | file.py | Python | mit | 15 |
# encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
)
class XNXXIE(InfoExtractor):
_VALID_URL = r'^https?://(?:video|www)\.xnxx\.com/video(?P<id>[0-9]+)/(.*)'
_TEST = {
'url': 'http://video.xnxx.com/vide... | raymondanthony/youtube-dl | youtube_dl/extractor/xnxx.py | Python | unlicense | 1,491 |
# 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/.
import boto
import hashlib
import mock
import moto
import os
from contextlib import contextmanager
from datetime import... | Callek/build-relengapi | relengapi/blueprints/tooltool/test_grooming.py | Python | mpl-2.0 | 14,434 |
import bpy
from bpy.props import *
from ..rfb_utils import shadergraph_utils
from ..rfb_utils import draw_utils
# update node during ipr for a socket default_value
def update_func(self, context):
# check if this prop is set on an input
node = self.node if hasattr(self, 'node') else self
__CYCLES_GROUP_NODES__... | adminradio/RenderManForBlender | rman_bl_nodes/rman_bl_nodes_sockets.py | Python | mit | 12,316 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# lis... | stormi/tsunami | src/reseau/connexions/serveur.py | Python | bsd-3-clause | 14,501 |
# -*- coding: utf-8 -*-
"""
# Plugins
Plugins allow flexible modification and execution of OpenNFT without touching the core codebase. Plugins can access data, process them in a specific way,
and they can be switched on and off according to the user's need.
Each plugin has to be a subclass of *Process class specified... | OpenNFT/OpenNFT | opennft/plugins/onp_roiswglm.py | Python | gpl-3.0 | 3,813 |
from pyfcm import FCMNotification
from fcm_django.models import FCMDevice
def send_notification(body_signal, msg="O paciente {0} teve um sinal alterado"):
patient = body_signal.owner
monitor_tokens = patient.get_monitor_tokens()
message_title = "Paciente {} Alerta".format(patient)
message_body = msg.f... | CadeiraCuidadora/UMISS-backend | umiss_project/notification/utils.py | Python | gpl-3.0 | 1,023 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['Lag1Trend'] , ['Seasonal_Second'] , ['MLP'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_Lag1Trend_Seasonal_Second_MLP.py | Python | bsd-3-clause | 154 |
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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
# ... | KDB2/veusz | veusz/utils/formatting.py | Python | gpl-2.0 | 7,908 |
from .ngender import guess
__all__ = ['guess']
| observerss/ngender | ngender/__init__.py | Python | mit | 48 |
"""Pagination serializers determine the structure for paginated responses."""
from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
from rest_framework.utils.serializer_helpers import ReturnList
from .helpers import JSONReturnList... | paulcwatts/drf-json-schema | rest_framework_json_schema/pagination.py | Python | mit | 1,186 |
# Copyright 2014 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.
"""An auto-roller for GN binaries into Chromium.
This script is used to update the GN binaries that a Chromium
checkout uses. In order to update the binarie... | Just-D/chromium-1 | tools/gn/bin/roll_gn.py | Python | bsd-3-clause | 12,787 |
"""Module for evaluating two-center integrals.
Contains classes for evaluating integrals of the form::
/
| _ _a _ _b _
Theta = | f(r - R ) g(r - R ) dr ,
|
/
with f and g each being given as a radial function times a spherical
harmonic.
Important class... | ajylee/gpaw-rtxs | gpaw/lcao/overlap.py | Python | gpl-3.0 | 27,997 |
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.conf import settings
def display_agreement_middleware(get_response):
def middleware(request):
if 'agreement_to_show' in request.session:
url = reverse('agreements:agreement', kwargs={'agreement': request... | jzapal/django-agreements | middleware.py | Python | mit | 581 |
"""
WSGI config for FestPal_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | amentis/FestPal-Server | FestPal_server/wsgi.py | Python | apache-2.0 | 405 |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | alexryndin/ambari | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/YARN/package/scripts/mapreduce2_client.py | Python | apache-2.0 | 1,759 |
#!/usr/bin/env python
# (c) Copyright [2016] Hewlett Packard Enterprise Development LP 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 Unless required by applicable
# law or agreed to in writ... | ThreatCentral/blackberries | src/ThreatCentral/transforms/CommentToThreatCentral.py | Python | apache-2.0 | 4,224 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('neuroelectro', '0017_datatable_currently_irrelevant_flag'),
]
operations = [
migrations.AddField(
model_name='me... | neuroelectro/neuroelectro_org | neuroelectro/migrations/0018_metadata_ref_text.py | Python | gpl-2.0 | 456 |
from django import forms
from crits.core import form_consts
from crits.core.forms import add_bucketlist_to_form, add_ticket_to_form, SourceInForm
from crits.core.handlers import get_source_names
from crits.core.user_tools import get_user_organization
from crits.vocabulary.relationships import RelationshipTypes
relati... | Magicked/crits | crits/pcaps/forms.py | Python | mit | 1,511 |
__author__ = 'halley'
from inspect import getmembers, isfunction
import celltransforms as ct
import random
import preferences as pref
import harmony as hm
import functionalhelpers as fh
import gencell as gc
import rhythmhelpers as rhy
from chunk import *
#the list of functions
transform_cell_functions = dict([(o[0], ... | caromedellin/tweets-sounds | transformcell.py | Python | mit | 2,018 |
from __future__ import absolute_import
from future.utils import PY3
if PY3:
from copyreg import *
else:
__future_module__ = True
from copy_reg import *
| noisemaster/AdamTestBot | future/moves/copyreg.py | Python | mit | 173 |
import sys
t = 0
for i in range(int(sys.stdin.readline())):
line = input().split()
t += float(line[0])*float(line[1])
print("{0:0.3f}".format(t))
| SirDavidLudwig/KattisSolutions | problems/qaly/qaly.py | Python | gpl-3.0 | 149 |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from typing import Iterable, Mapping
from packaging.utils import canonicalize_name as canonicalize_project_name
from pants.backend.python.ma... | pantsbuild/pants | src/python/pants/backend/python/macros/poetry_requirements_caof.py | Python | apache-2.0 | 3,874 |
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import train_test_split
# NOTE: Make sure that the class is labeled 'class' in the data file
tpot_data = np.recfromcsv('PATH/TO/DATA/FILE', delimiter='COLUMN_SEPARATOR', dtype=np.float64)
features = np.delete(tpot_... | deo1/deo1 | KaggleTitanic/models/model_2017_09_17_09_24_18-0.9989.py | Python | mit | 835 |
import mock
import six
from tvrenamer.core import formatter
from tvrenamer.tests import base
class FormatterTest(base.BaseTest):
def test_replace_series_name(self):
self.CONF.set_override('input_series_replacements', dict())
name = 'Reign'
self.assertEqual(
formatter._replace... | shad7/tvrenamer | tvrenamer/tests/core/test_formatter.py | Python | mit | 11,698 |
""" This module mainly focuses on the details of the IRC protocol, so it covers
actions such as line parsing and validation.
"""
import socket
import struct
import re
#TODO: Add in mode parsing support.
name_symbols = {
"+": "voice",
"%": "halfop",
"@": "op",
"&": "protectedop",
"~": "owner"
... | Alakala/eggpy | ircutils/protocol.py | Python | mit | 5,859 |
"""Support for MQTT sensors."""
from __future__ import annotations
from datetime import timedelta
import functools
import voluptuous as vol
from homeassistant.components import sensor
from homeassistant.components.sensor import DEVICE_CLASSES_SCHEMA, SensorEntity
from homeassistant.const import (
CONF_DEVICE_CLA... | w1ll1am23/home-assistant | homeassistant/components/mqtt/sensor.py | Python | apache-2.0 | 6,130 |
import re
import pandas as pd
ACLED_FILE = 'ACLED-All-Africa-File_20170101-to-20170429.csv'
def clean_and_save():
encoding_key = 'iso-8859-1'
df = pd.read_csv(ACLED_FILE, encoding=encoding_key)
print df.head()
print df.columns
print df.describe()
cleaned_file = 'cleaned_{}'.format(ACLED_FILE)... | ONEcampaign/humanitarian-data-service | resources/data/raw/example/transform_scripts/parse_acled_all_africa.py | Python | mit | 1,542 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 0, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Anscombe/trend_ConstantTrend/cycle_0/ar_/test_artificial_32_Anscombe_ConstantTrend_0__20.py | Python | bsd-3-clause | 266 |
# 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/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_integration_runtimes_operations.py | Python | mit | 8,470 |
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pysnmp.sf.net/license.html
#
from pysnmp.proto import rfc1157, rfc1905
readClassPDUs = {
rfc1157.GetRequestPDU.tagSet: 1,
rfc1157.GetNextRequestPDU.tagSet: 1,
rfc1905.GetRequestPDU.tagS... | k11a/snmpconverter | pysnmp/proto/rfc3411.py | Python | gpl-3.0 | 1,365 |
import ast,os,setuptools
from pg13 import version
def get_version(fname):
"grab __version__ variable from fname (assuming fname is a python file). parses without importing."
assign_stmts = [s for s in ast.parse(open(fname).read()).body if isinstance(s,ast.Assign)]
valid_targets = [s for s in assign_stmts i... | abe-winter/pg13-py | setup.py | Python | mit | 1,274 |
import json
import logging
import ddt
from django.core.urlresolvers import reverse
from django.http import Http404
from django.test.client import Client, RequestFactory
from django.test.utils import override_settings
from django.utils import translation
from lms.lib.comment_client.utils import CommentClientPaginatedRe... | itsjeyd/edx-platform | lms/djangoapps/discussion/tests/test_views.py | Python | agpl-3.0 | 63,213 |
import web;
urls = (
"/", "LoginPage",
);
class LoginPage:
def GET(self):
render = web.template.render(WEBCONFIG["templateDir"], base='base')
return render.LoginForm();
app = web.application(urls, locals()) | gokulchittaranjan/QuaintEgg | framework/controllers/Pages.py | Python | apache-2.0 | 219 |
import rules
from involvement.models import Role
from involvement.rule_utils import is_super, is_admin, is_fum, \
is_board, has_role_perm
# Contact card predicates
@rules.predicate
def member_of_team_contactcard(user, card):
return card is not None and member_of_team_position(user, card.position)
@rules.pre... | UTNkar/moore | src/involvement/rules.py | Python | agpl-3.0 | 4,881 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Onto2nx documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 20 09:28:38 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
# au... | cthoyt/onto2nx | docs/source/conf.py | Python | gpl-3.0 | 5,431 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# #
# This file is part of 3d Brain Atlas Reconstructor #
# ... | pmajka/3dbar | bin/parsers/whs_0.5_symm/data.py | Python | gpl-3.0 | 6,871 |
"""Xception V1 model for Keras.
On ImageNet, this model gets to a top-1 validation accuracy of 0.790
and a top-5 validation accuracy of 0.945.
Do note that the input image format for this model is different than for
the VGG16 and ResNet models (299x299 instead of 224x224),
and that the input preprocessing function
is... | ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/keras_applications/xception.py | Python | mit | 14,008 |
# -*- coding: utf-8 -*-
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker 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 Licen... | nicolashainaux/mathmaker | mathmaker/cli.py | Python | gpl-3.0 | 7,609 |
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
TEST_ROOT = os.path.join(os.path.dirname(PROJECT_ROOT), "tests")
SINGLE_ORCA_RUN_FILE = os.path.join(PROJECT_ROOT, "code", "single_core_run_orca.py")
SINGLE_RUN_MOB_KMC_FILE = os.path.join(
PROJECT_ROOT, "code", "single_core_run_mob_KMC.py"
)
SING... | matty-jones/MorphCT | morphct/definitions.py | Python | gpl-3.0 | 419 |
#! /usr/bin/env python3.3
########################################################################################
import argparse
import csv
import datetime
import json
import os
import os.path
import sys
########################################################################################
def main(conf):
with... | ahamez/pnmc | analyse/spans.py | Python | bsd-2-clause | 2,107 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011, 2012 Sebastian Wiesner <lunaryorn@gmail.com>
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at... | luv/impulse-cube | deps/pyudev-0.16.1/tests/test_core.py | Python | gpl-3.0 | 3,163 |
# coding=utf-8
"""
The Automation Removed Subscribers endpoint
Note: This is a paid feature
Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/removed-subscribers/
Schema: https://api.mailchimp.com/schema/3.0/Automations/RemovedSubscribers/Instance.json
"""
from __future__ imp... | charlesthk/python-mailchimp | mailchimp3/entities/automationremovedsubscribers.py | Python | mit | 2,175 |
from __future__ import print_function
from corpkit.constants import STRINGTYPE, PYTHON_VERSION, INPUTFUNC
"""
This file contains a number of functions used in the corpus building process.
None of them is intended to be called by the user him/herself.
"""
def download_large_file(proj_path, url, actually_download=True,... | interrogator/corpkit | corpkit/build.py | Python | mit | 25,507 |
"""This class handles nearly every aspect of dialogue. See docstring. """
import pygame
class DialogueHandler(object):
"""The class that handles dialogue.
This class can store fonts, render text, determine proper spacing
for text, and in the future possibly determine where to split
up long text inpu... | JarvisTheJelly/IdleCargo | DialogueHandler.py | Python | gpl-2.0 | 3,888 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see winpython/__init__.py for details)
"""
Created on Thu Oct 04 11:02:40 2012
@author: Pierre Raybaut
"""
from __future__ import print_function
import sys
import os
import os.path as osp
im... | stonebig/winpython | test.py | Python | mit | 1,099 |
from .base import *
DISABLE_GA = True # don't log to Google Analytics when we are running tests
INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS.append('aloe_django',)
NOSE_ARGS = [
'--verbosity=2',
'--nologcapture',
'--nocapture',
]
MIGRATION_MODULES = {
app: '{}.nomigrations'.format(app)
f... | chris48s/UK-Polling-Stations | polling_stations/settings/testing.py | Python | bsd-3-clause | 395 |
class min_heap(object):
"""docstring for heap"""
def __init__(self, nums = []):
self.s = nums
self.PQ_SIZE = 10
self.q = [-1 for x in xrange(self.PQ_SIZE+1)]
self.n = 0
if len(nums)>0:
for num in nums:
self.pq_insert(num)
def pq_parent(self,n):
"""return the index of parent item"""
if n ==... | comicxmz001/LeetCode | sort/heap.py | Python | mit | 1,938 |
# 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 ... | spring-week-topos/cinder-week | cinder/volume/driver.py | Python | apache-2.0 | 40,963 |
#!/usr/bin/env python
"""
changelog.py helps generate the CHANGELOG.md message for a particular release.
"""
import argparse
import subprocess
import shlex
import re
def run(cmd, *args, **kwargs):
return subprocess.check_output(shlex.split(cmd), *args, **kwargs)
def get_commit_ids(from_commit, to_commit):
... | Eva-xiaohui-luo/opa | build/changelog.py | Python | apache-2.0 | 2,474 |
from src.lib.printable import Printable
from src.lib.utils import ensure_tuple
class PropertiesHolderMixin:
def properties_as_dict(self):
props = {}
for prop in self.properties:
props[prop.key] = prop.value
return props
class IdentifierHolderMixin:
def get_identifiers(sel... | alexnad/PyFlyDB | src/query_processor/query_ast/models.py | Python | gpl-3.0 | 5,699 |
"""Config flow to configure the Synology DSM integration."""
from __future__ import annotations
import logging
from typing import Any
from urllib.parse import urlparse
from synology_dsm import SynologyDSM
from synology_dsm.exceptions import (
SynologyDSMException,
SynologyDSMLogin2SAFailedException,
Synol... | FreekingDean/home-assistant | homeassistant/components/synology_dsm/config_flow.py | Python | apache-2.0 | 12,875 |
#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Licens... | nijel/weblate | weblate/addons/apps.py | Python | gpl-3.0 | 905 |
from unittest.mock import create_autospec, sentinel
import pytest
from h_matchers import Any
from pyramid.testing import DummyRequest
from via.views.debug import debug_headers
class TestDebugHeaders:
def test_it(self, pyramid_request):
pyramid_request.headers = {"Key": "Value"}
response = debug_... | hypothesis/via | tests/unit/via/views/debug_test.py | Python | bsd-2-clause | 2,050 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | rahul003/mxnet | python/mxnet/initializer.py | Python | apache-2.0 | 24,963 |
# debug.py
# Copyright (C) 2012 Ulrich Hecht
# This file is part of 6502 Decompiler.
# 6502 Decompiler is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3 as published
# by the Free Software Foundation.
# 6502 Decompiler is distributed in the hope ... | pfalcon-mirrors/decomp-6502-arm | debug.py | Python | gpl-3.0 | 1,296 |
"""
WSGI config for tutuvideo3 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | priestc/MultiExplorer | multiexplorer/multiexplorer/wsgi.py | Python | mit | 400 |
import numpy as np
from featureEngineering.FeatureExtractor import FeatureExtractor
from tools import journals_citation_graph
class JournalFeatureExtractor(FeatureExtractor):
columns = ["ACiteB", "meanJournalACiteJournalB", "dice_similarity"]
def __init__(self, node_information_df, verbose=False, freq=10000... | Edouard360/text-mining-challenge | featureEngineering/journalFeatures/journalFeatureExtractor.py | Python | apache-2.0 | 2,273 |
#!/usr/bin/env python
"""
ADS to BibDesk -- frictionless import of ADS publications into BibDesk
Copyright (C) 2013 Rui Pereira <rui.pereira@gmail.com> and
Jonathan Sick <jonathansick@mac.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Genera... | wschoenell/ads_bibdesk | adsbibdesk.py | Python | gpl-3.0 | 55,654 |
data_frame_idx = 0
smach_state_idx = 1
data_header_idx = 2
| birlrobotics/HMM | hmm_for_baxter_using_only_success_trials/hmm_online_service/constant.py | Python | bsd-3-clause | 59 |
# 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
# distribu... | eshijia/magnum | magnum/conductor/handlers/indirection_api.py | Python | apache-2.0 | 3,130 |
# Paperwork - Using OCR to grep dead trees the easy way
# Copyright (C) 2012-2014 Jerome Flesch
# Copyright (C) 2012 Sebastien Maccagnoni-Munch
#
# Paperwork 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 Soft... | jflesch/paperwork-backend | paperwork_backend/img/doc.py | Python | gpl-3.0 | 7,221 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.utils.decorators import ReductionMethodFor
from rbnics.problems.parabolic.parabolic_coercive_problem import ParabolicCoerciveProblem
from rbnics.problems.parabolic.parabolic_probl... | mathLab/RBniCS | rbnics/reduction_methods/parabolic/parabolic_rb_reduction.py | Python | lgpl-3.0 | 949 |
# encoding: utf-8
"""
ChartData and related objects.
"""
from __future__ import absolute_import, print_function, unicode_literals
from xml.sax.saxutils import escape
from ..oxml import parse_xml
from ..oxml.ns import nsdecls
from .xlsx import WorkbookWriter
from .xmlwriter import ChartXmlWriter
class ChartData(ob... | neerajvashistha/pa-dude | lib/python2.7/site-packages/pptx/chart/data.py | Python | mit | 10,529 |
#!/usr/bin/env python
# Database tool to interact with pDNS2, query a populated Redis database
# this version works well
import datetime
import time
# needed for counting function
from string import count
from collections import Counter
import redis # https://github.com/andymccurdy/redis-py
# http://www.iana.org/a... | bez0r/pDNS2 | pdns2_query_api.py | Python | gpl-3.0 | 23,440 |
#!/usr/bin/env python
parameter_list=[['../data/train_sparsereal.light']]
def features_read_svmlight_format_modular (fname):
import os
from modshogun import SparseRealFeatures
from modshogun import LibSVMFile
f=SparseRealFeatures()
lab=f.load_with_labels(LibSVMFile(fname))
f.save_with_labels(LibSVMFile('tmp/tes... | AzamYahya/shogun | examples/undocumented/python_modular/features_read_svmlight_format_modular.py | Python | gpl-3.0 | 499 |
"""
Support for Denon Network Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.denon/
"""
import logging
import telnetlib
import voluptuous as vol
from homeassistant.components.media_player import (
PLATFORM_SCHEMA, SUPPORT_NE... | hexxter/home-assistant | homeassistant/components/media_player/denon.py | Python | mit | 4,898 |
import numpy
import cv2
import sys
import os
from TouchStyle import *
#camera section
WIDTH=320
HEIGHT=(WIDTH*3/4)
FPS=10
# check if there's a camera device index supplied via
# the environment
CAM_DEV = os.environ.get('FTC_CAM')
if CAM_DEV == None: CAM_DEV = 0
else: CAM_DEV = int(CAM_DEV)
class CamW... | ski7777/ftcommunity-apps | packages/iolyser/camera.py | Python | gpl-3.0 | 1,859 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | zhouyao1994/incubator-superset | tests/db_engine_specs/base_engine_spec_tests.py | Python | apache-2.0 | 8,276 |
# -*- coding: utf-8 -*-
"""Improved replacement for the Gnuplot.Gnuplot class.
This module imports Gnuplot and replaces some of its functionality with
improved versions. They add better handling of arrays for plotting and more
convenient PostScript generation, plus some fixes for hardcopy().
It also adds a convenient... | mastizada/kuma | vendor/packages/ipython/IPython/Gnuplot2.py | Python | mpl-2.0 | 26,564 |
from flask_restful import Resource
class WaterBase(Resource):
pass | PBLV-HM/WaterServer | resource/BaseClass.py | Python | gpl-3.0 | 72 |
class Solution(object):
def minPatches(self, nums, n):
"""
:type nums: List[int]
:type n: int
:rtype: int
"""
miss = 1
added, i = 0, 0
while miss <= n:
if i < len(nums) and nums[i] <= miss:
miss += nums[i]
i ... | ChuanleiGuo/AlgorithmsPlayground | LeetCodeSolutions/python/330_Patching_Array.py | Python | mit | 418 |
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
"""ACE -- Automated Coordinate Extraction.
"""
__all__ = ["config", "database", "datatable", "exporter", "set_logging_level", "scrape", "sources", "tableparser", "tests", "__version__"]
import log... | neurosynth/ACE | ace/__init__.py | Python | mit | 1,044 |
from tests.testing_harness import TestHarness
def test_energy_grid():
harness = TestHarness('statepoint.10.h5')
harness.main()
| mit-crpg/openmc | tests/regression_tests/energy_grid/test.py | Python | mit | 137 |
#!/usr/bin/env python3
"""
Tools and utilities for analyzing Kappa objects. The `scripts` submodule contains command line utilities (installed via
SetupTools EntryPoints under the namespace `kappa_[object type]`), for which the functions are located under
`functions`. A low-level API is provided under `core`.
To view ... | hmedina/KaSaAn | KaSaAn/__init__.py | Python | mit | 767 |
#!/usr/bin/env python
#./knn-pairs.gz words-file knn-file number-of-knn
#Example
#./knn-pairs.gz enw.words.gz enw.knn.gz 10
import sys, gzip
from itertools import izip_longest
i = 0
pairs = []
knn = int(sys.argv[2])
for l1, l2 in izip_longest(gzip.open(sys.argv[1]),
sys.stdin,
fillvalue=None):
if l1 == None or ... | ai-ku/upos_2014 | src/scripts/knn-pairs.py | Python | mit | 671 |
from __future__ import division
import pytest
import numpy as np
import itertools
from sklearn.exceptions import ConvergenceWarning
from sklearn.utils import check_array
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import... | vortex-ape/scikit-learn | sklearn/decomposition/tests/test_dict_learning.py | Python | bsd-3-clause | 14,472 |
# -*- coding: utf-8 -*-
from logging import getLogger
def log(obj):
"""
:rtype: logging.Logger
"""
name = '{0}.{1}'.format(obj.__module__.split('.')[-1], obj.__class__.__name__)
return getLogger(name)
| k-vinogradov/isgtool | isgtool/contrib.py | Python | gpl-2.0 | 237 |
import unittest
from testutils import system, if_atomic
class TestBase(unittest.TestCase):
@unittest.expectedFailure
def test_selinux(self):
"Tests the SELinux"
out, err, eid = system('sudo getenforce')
out = out.strip()
self.assertEquals(out, 'Enforcing')
def test_loggin... | rtnpro/tunirtests | cloudtests.py | Python | gpl-2.0 | 1,042 |
"""Basic checks for HomeKitclimate."""
from unittest.mock import patch
from aiohomekit.model.characteristics import (
ActivationStateValues,
CharacteristicsTypes,
CurrentHeaterCoolerStateValues,
SwingModeValues,
TargetHeaterCoolerStateValues,
)
from aiohomekit.model.services import ServicesTypes
f... | kennedyshead/home-assistant | tests/components/homekit_controller/test_climate.py | Python | apache-2.0 | 27,335 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.