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 |
|---|---|---|---|---|---|
#!/usr/bin/env python3
from distutils.core import setup
# Read README for long description
readme = open('README').read()
try:
import pypandoc
pypandoc.get_pandoc_formats()
readme = pypandoc.convert_text(readme, to='rst', format='markdown')
except:
pass
with open('pylibscrypt/__init__.py') as f:
... | jvarho/pylibscrypt | setup.py | Python | isc | 1,236 |
''' Print the supplementary part of Barron 800 wordlists
with respect to Magoosh GRE flashcards and New GRE Upgrade
'''
import json
from util.common import load_wordlist
magoosh_path = 'wordlists/magoosh-gre'
upgrade_path = 'wordlists/gre-upgrade'
old_words = set(load_wordlist(magoosh_path)) | set(load_wordlist(u... | Czxck001/wordlists | script/wordbook/magoosh_upgrade_supple.py | Python | mit | 697 |
r"""
Metadata template objects (:mod: `qiita_db.metadata_template)
=============================================================
..currentmodule:: qiita_db.metadata_template
This module provides the MetadataTemplate base class and the subclasses
SampleTemplate and PrepTemplate.
Classes
-------
..autosummary::
:... | wasade/qiita | qiita_db/metadata_template.py | Python | bsd-3-clause | 82,170 |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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 your option) any later version.
#
# This library ... | FedoraScientific/salome-paravis | test/VisuPrs/DeformedShape/E8.py | Python | lgpl-2.1 | 1,522 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-07 17:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('ordini', '0002_auto_20151206_1346'),
... | Byx69/SMes | programma/migrations/0001_initial.py | Python | gpl-2.0 | 1,146 |
""" Base file for all Pythran tests. """
from imp import load_dynamic
from numpy import float32, float64
from numpy import int8, int16, int32, int64, uint8, uint16, uint32, uint64
from numpy import ndarray, isnan, isinf, isneginf, complex128, complex64, bool_
from textwrap import dedent
import copy
import math
import ... | hainm/pythran | pythran/tests/test_env.py | Python | bsd-3-clause | 17,316 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | pmghalvorsen/gramps_branch | gramps/gui/editors/displaytabs/citationbackreflist.py | Python | gpl-2.0 | 1,398 |
from legitfs.util import split_using, split_git
import pytest
@pytest.mark.parametrize('input, top, tail', [
([5, 4, 2, 9, 8, 3], [5, 4, 2, 9], [8, 3]),
([9, 8, 4], [9], [8, 4]),
])
def test_split_using(input, top, tail):
assert split_using(lambda v: v > 5, input) == (top, tail)
def test_split_not_found... | mbr/legitfs | tests/test_utils.py | Python | mit | 1,282 |
from bias import BiasCalculator
from sources import SourceAnalyser
from media import MediaAnalyser
from topics import TopicAnalyser
from xlsx_export import XLSXExportBuilder
from ratings import ChildrenRatingExport, MediaDiversityRatingExport
from fdi_xlsx_export import FDIExportBuilder
| Code4SA/mma-dexter | dexter/analysis/__init__.py | Python | apache-2.0 | 289 |
"""The tests for reproduction of state."""
import pytest
from homeassistant.components.climate import async_reproduce_states
from homeassistant.components.climate.const import (
ATTR_AUX_HEAT,
ATTR_HUMIDITY,
ATTR_PRESET_MODE,
ATTR_SWING_MODE,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
DO... | fbradyirl/home-assistant | tests/components/climate/test_reproduce_state.py | Python | apache-2.0 | 3,414 |
from __future__ import unicode_literals
from django.apps import AppConfig
class BlogFrontendConfig(AppConfig):
name = 'blog_frontend'
| Raulios/django-blog | blog_frontend/apps.py | Python | mit | 141 |
# This file is part of actools
# Copyright (c) 2010 Gianni Tedesco
# This is free software released under the terms of the GNU GPL v3
class ACG_Exception:
def __init__(self):
self.msg = msg
class ACG_EEPROM_Error(ACG_Exception):
def __init__(self, msg = None):
if not msg:
msg = "EEPROM format error"
self.ms... | giannitedesco/acgtools | acg/errors.py | Python | gpl-3.0 | 2,086 |
from database import db
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(225), nullable=False, unique=True)
password = db.... | sunrein/statisfy | statisfy/users/models.py | Python | mit | 1,364 |
import json
from django.http import JsonResponse
from django.views.generic import TemplateView
class JsonView(TemplateView):
force_ajax = False
def render(self, data):
if self.request.is_ajax() or self.force_ajax:
return JsonResponse(data, safe=False)
else:
return supe... | ilvar/eyes-of-time | eot/views.py | Python | mit | 518 |
import ctor
ctor.register_pattern("$.*?-auto.py^")
class AutogenTarget(BaseTarget):
pass
| tomerfiliba/ctor | test/test_project/.ctor/autogen.py | Python | mit | 97 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TeachingAssignment.default_skill_level'
db.add_column(u'gsaudit_teachingassignment', 'defaul... | schnapptack/gskompetenzen | features/gsaudit/migrations/0016_auto__add_field_teachingassignment_default_skill_level__add_field_skil.py | Python | agpl-3.0 | 14,579 |
from folder import Folder
from article import Article
import permissions
from pyramid import security
from bson.objectid import ObjectId
import pyes
from cms import dbutil
from users import UserCollection, GroupCollection, User, generate_random_password
from trash import Trash
class Root(Folder):
_object_ty... | sbrauer/recms | cms/resources/root.py | Python | mit | 9,167 |
#!/usr/bin/env python
#
# Rebuilds the version using git describe
#
from sys import exit
from subprocess import check_output, check_call
from os.path import join, dirname, abspath, exists
from os import EX_OK, EX_USAGE, EX_IOERR
def main():
root = dirname(dirname(abspath(__file__)))
git_path = join(root, '.gi... | bengardner/uncrustify | scripts/make_version.py | Python | gpl-2.0 | 1,342 |
#!/usr/bin/env python
"""
NAME
irm_magic.py
DESCRIPTION
Creates MagIC file from an IRM excel file. If you have multiple Excel files you will have to run the
program for each Excel file and combine each type of file (locations.txt, sites.txt, etc.) manually
using "combine_magic.py"
The program cre... | lfairchild/PmagPy | programs/conversion_scripts/irm_magic.py | Python | bsd-3-clause | 3,055 |
from abc import ABCMeta, abstractmethod
try:
from pymongo import MongoClient, DESCENDING, ASCENDING
except ImportError:
pass
import json
import os
from .config import Config
def get_state(state=None, config=None):
if state is None and config is None:
config = Config()
if state is None:
... | Grungnie/microsoftbotframework | microsoftbotframework/state.py | Python | mit | 23,867 |
import asyncio
import discord
import config
from animethemes import findAnimeOpening, findAnimeEnding
from discord.ext import commands
import glob
import random
if not discord.opus.is_loaded():
discord.opus_load('/mnt/c/Projects/opusfile/libopus.so')
client = discord.Client()
class VoiceEntry:
def... | rchea1/AsunaBot | AsunaBot/Music.py | Python | mit | 11,776 |
# 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.
import os
import StringIO
import unittest
from telemetry import benchmark
from telemetry.page import page_set
from telemetry.results import html_output_forma... | 7kbird/chrome | tools/telemetry/telemetry/results/html_output_formatter_unittest.py | Python | bsd-3-clause | 7,826 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible by Red Hat, inc
# 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',
... | roadmapper/ansible | lib/ansible/modules/network/eos/_eos_l3_interface.py | Python | gpl-3.0 | 9,217 |
from nose.tools import eq_, ok_
from django.core.urlresolvers import reverse
from django.conf import settings
from crashstats.crashstats.tests.test_views import BaseTestViews
class TestViews(BaseTestViews):
def test_home(self):
url = reverse('home:home', args=('WaterWolf',))
response = self.cli... | m8ttyB/socorro | webapp-django/crashstats/home/tests/test_views.py | Python | mpl-2.0 | 2,682 |
from django.apps import AppConfig
class SimpleSSOServer(AppConfig):
name = 'simple_sso.sso_server'
| mediafactory/yats | modules/simple_sso/sso_server/apps.py | Python | mit | 105 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import os
from google.appengine.api import users
import jinja2
import webapp2
from components import decorators
from components... | nicko96/Chrome-Infra | appengine/cr-doc/handlers.py | Python | bsd-3-clause | 1,778 |
#!/usr/bin/env python
from pylab import *
from numpy import *
import sys
def corr(i,x,mean,var):
N=len(x)
if var==0:#if the variance is 0 return an effectively infinity corr
return 1e100
corr=1.0/var*1.0/(N-i)*sum((x[0:N-i]-mean)*(x[i:N]-mean))
return corr
def Stats(x):
N=len(x)
mean=s... | habanero-rice/hcpp | test/performance-regression/full-apps/qmcpack/utils/PlotDMC.py | Python | bsd-3-clause | 2,372 |
import os
from MooseMarkdown import MooseMarkdown
from markdown.util import etree
def get_collection_items(info_objects, show_hidden=False):
"""
Returns li html elements for each object in a system.
Input:
info_objects: A list of MooseInfoBase objects to collect.
"""
items = []
# Alphabe... | backmari/moose | python/MooseDocs/extensions/__init__.py | Python | lgpl-2.1 | 3,261 |
"""
This is a test to interpolate the NIST Spectra with Simulation format
change C to X
change spectra to something more general that covers Xsec, absorbance, Transmittance
move the interpolation to another module
"""
#from imports import *
import numpy as np
from scipy import interpolate
import os
import sys
impo... | azariven/BioSig_SEAS | SEAS_Main/atmosphere_effects/depr_BioSig_Triage.py | Python | gpl-3.0 | 12,061 |
# -*- coding: utf-8 -*-
import hashlib
import random
from ciphers.primer import get_prime
def generate_key(size=6):
"""Generate all keys we need to encrypt hash"""
min_p, max_p = 10**(size-1), 10**size
p = get_prime(random.randint(min_p, max_p))
g = get_prime(random.randint(3, p-1))
x = random.ra... | alexei-alexov/information_protection | ciphers/elgamal.py | Python | mit | 2,852 |
#!/usr/bin/env python
import sys
import glob
import numpy as np
import pylab as pl
from ring import *
files = glob.glob(sys.argv[1])
out = open("rings.dat", "w")
pl.figure()
for file in files:
print file
hdu = pyfits.open(file)
(data, header) = (hdu[0].data, hdu[0].header)
etalon = int(header['ET-ST... | saltastro/FP_utils | rings.py | Python | bsd-3-clause | 1,240 |
from builtins import object
import clarify
from openelex.base.load import BaseLoader
from openelex.models import RawResult
from openelex.lib.insertbuffer import BulkInsertBuffer
from openelex.lib.text import ocd_type_id
from .datasource import Datasource
class LoadResults(object):
"""Entry point for data loading.... | openelections/openelections-core | openelex/us/sc/load.py | Python | mit | 3,284 |
import pytest
from django.contrib.contenttypes.models import ContentType
from erudit.test.factories import JournalFactory
from base.test.factories import UserFactory
from core.authorization.defaults import AuthorizationConfig as AC
from core.authorization.models import Authorization
from apps.userspace.journal.edito... | erudit/zenon | tests/functional/apps/userspace/journal/editor/test_forms.py | Python | gpl-3.0 | 1,186 |
"""
Login page for Studio.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from common.test.acceptance.pages.studio import LMS_URL
from common.test.acceptance.pages.studio.course_page import CoursePage
from common.test.acceptance.pages.studio.utils import HelpMixin
class Log... | philanthropy-u/edx-platform | common/test/acceptance/pages/studio/login.py | Python | agpl-3.0 | 1,718 |
"""
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | ericfc/django | django/db/models/sql/query.py | Python | bsd-3-clause | 92,658 |
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.utils import cstr, cint, flt, comma_or, nowdate
from frappe import _ ,msgprint
from erpnext.stock.utils import get_incoming_rate
from erpnext.stock.stock_ledger import get_previous_sle
from erpnext.controllers.queries import get_... | indictranstech/vestasi-erpnext | erpnext/stock/custom_methods.py | Python | agpl-3.0 | 35,839 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | armab/st2contrib | packs/networking_utils/actions/is_valid_asa_nameif.py | Python | apache-2.0 | 1,374 |
class FedexInterface(object):
def identify(self, tracking_number):
return len(tracking_number) in (12, 15)
def track(self, tracking_number):
raise NotImplementedError
def url(self, tracking_number):
return('https://wsbeta.fedex.com:443/web-services'
% tracking_number)
# ... | etothemanders/GoingPostal | packagetrack/fedex.py | Python | mit | 479 |
# Copyright 2015 Observable Networks
#
# 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 ... | obsrvbl/ona | src/scripts/ona_service/tcpdump_pusher.py | Python | apache-2.0 | 2,495 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | stonebig/bokeh | bokeh/protocol/messages/error.py | Python | bsd-3-clause | 3,301 |
import matplotlib.pyplot as plt
import numpy as np
import random
BOARDWIDTH = 7
BOARDHEIGHT = 6
EMPTY = 0
def make_autopct(values):
def my_autopct(pct):
if pct == 0:
return ""
else:
return '{p:.2f}% '.format(p=pct)
return my_autopct
def plotResults(red_wins, black_w... | ElchinValiyev/GameAI | Project_2/connect4/TD_learning/connect4.py | Python | mit | 4,336 |
#!/usr/bin/env python
# DX_APP_WIZARD_NAME DX_APP_WIZARD_VERSION
# Generated by dx-app-wizard.
#
# Parallelized execution pattern (GTable input): Your app will
# subdivide a large chunk of work (in the form of an existing
# GenomicTable) into multiple pieces that can be processed in parallel
# and independently of each... | andyshinn/dx-toolkit | src/python/dxpy/templating/templates/python/parallelized/src/code-input-gtable.py | Python | apache-2.0 | 5,402 |
print ('Ум - это не сосуд, который надо заполнить, а факел, который необходимо зажечь.')
print ('\n\t\t\t\t\t\t\t\t\tПлутарх')
input ('Для выхода нажмите enter')
| Mariaanisimova/pythonintask | PMIa/2015/KRAVCHENKO_A_A/Zadacha_2.py | Python | apache-2.0 | 246 |
"""
Tests for literal transformers
"""
from collections import OrderedDict
from decimal import Decimal
from itertools import islice
from ..literals import (
islice_literals,
overloaded_dicts,
overloaded_bytes,
overloaded_floats,
overloaded_lists,
overloaded_sets,
overloaded_slices,
over... | llllllllll/codetransformer | codetransformer/transformers/tests/test_literals.py | Python | gpl-2.0 | 4,872 |
# -*- coding: utf-8 -*-
r"""
Graph-directed iterated function system (GIFS)
See [JK14]_ or [BV20]_ or
- http://larryriddle.agnesscott.org/ifs/ifs.htm
- https://encyclopediaofmath.org/wiki/Iterated_function_system
We allow the functions to be contracting or not. When the functions are
inflations, it allows to represe... | seblabbe/slabbe | slabbe/graph_directed_IFS.py | Python | gpl-2.0 | 26,146 |
#
# Copyright 2008 Spencer Davis <SpencerDavis91@gmail.com>
#
# This file is part of Tuxedo.
#
# Tuxedo 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) an... | Alwnikrotikz/tuxedo | src/database.py | Python | gpl-2.0 | 9,178 |
from __future__ import print_function
__author__ = """Alex "O." Holcombe, Charles Ludowici, """ ## double-quotes will be silently removed, single quotes will be left, eg, O'Connor
import time, sys, platform, os
from math import atan, atan2, pi, cos, sin, sqrt, ceil, radians, degrees
import numpy as np
import psychopy, ... | alexholcombe/dot-jump | dataRaw/Fixed Cue/test_dot-jump21Nov2016_13-55.py | Python | gpl-3.0 | 26,149 |
from proboscis import test
@test(groups=['benchmark.discovery'])
class BenchmarkDiscoveryTests(object):
def __init__(self):
pass
| jlongever/RackHD | test/benchmark/api_v2_0/discovery_tests.py | Python | apache-2.0 | 142 |
"""Storage providers backends for Memory caching."""
import re
import os
import os.path
import datetime
import json
import shutil
import warnings
import collections
import operator
import threading
from abc import ABCMeta, abstractmethod
from ._compat import with_metaclass, _basestring
from .backports import concurre... | TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/joblib/_store_backends.py | Python | gpl-3.0 | 14,379 |
import sys
sys.path.insert(0,'../')
if sys.version_info[:2] == (2,6):
import unittest2 as unittest
else:
import unittest
import os
import re
import datetime,time
from rivets_test import RivetsTest
import rivets
import execjs
import lean
class EnvironmentTests(object):
def testWorkingDirectoryIsDefaultRoot(self):
... | OiNutter/rivets | test/test_environment.py | Python | mit | 25,980 |
'''This module provides the object representation of a CurrencyCloud Transaction'''
from currencycloud.resources.resource import Resource
class Transaction(Resource):
'''This class represents a CurrencyCloud Transaction'''
pass
| CurrencyCloud/currencycloud-python | src/currencycloud/resources/transaction.py | Python | mit | 239 |
import logging
from .abstractprotocol import AbstractProtocol
from .protocol_helpers import crcPI as crc
from .protocol_helpers import crc8P1 as chk
log = logging.getLogger("pi30revo")
COMMANDS = {
"PQSE": {
"name": "PQSE",
"description": "Read current machine configuration information",
... | jblance/mpp-solar | mppsolar/protocols/pi30revo.py | Python | mit | 15,179 |
#!/usr/bin/env python
"""
filegen.py
File generation utility.
Copyright (C) 2013 William Kettler <william.p.kettler@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 Software Foundation, either version 3 of ... | wkettler/pyio | filegen.py | Python | gpl-2.0 | 4,738 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | markope/AutobahnPython | examples/twisted/websocket/echo_service/echows/echoservice.py | Python | mit | 2,929 |
import sys
from nose.plugins.skip import SkipTest
from bugsnag import Configuration
from bugsnag.delivery import (UrllibDelivery, RequestsDelivery,
create_default_delivery)
from tests.utils import IntegrationTest
class DeliveryTest(IntegrationTest):
def setUp(self):
super... | overplumbum/bugsnag-python | tests/test_delivery.py | Python | mit | 2,670 |
# encoding: utf-8
import datetime
from django.db import models
from south.db import db
from south.v2 import DataMigration
class Migration(DataMigration):
def copy_revision(self, orm, source_revision):
question = getattr(source_revision, 'question', None)
answer = getattr(source_revision, 'answer... | samhoo/askbot-realworld | askbot/migrations/0050_move_qa_revisions_to_postrevision.py | Python | gpl-3.0 | 30,419 |
# File: D (Python 2.4)
from otp.ai.AIBaseGlobal import *
import DistributedCCharBaseAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.task import Task
import random
from toontown.toonbase import ToontownGlobals
from toontown.toonbase... | Spiderlover/Toontown | toontown/classicchars/DistributedMinnieAI.py | Python | mit | 6,755 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | jiaphuan/models | research/domain_adaptation/pixel_domain_adaptation/pixelda_eval.py | Python | apache-2.0 | 11,077 |
"""Precompute coefficients of several series expansions
of Wright's generalized Bessel function Phi(a, b, x).
See https://dlmf.nist.gov/10.46.E1 with rho=a, beta=b, z=x.
"""
from argparse import ArgumentParser, RawTextHelpFormatter
import numpy as np
from scipy.integrate import quad
from scipy.optimize import minimize... | scipy/scipy | scipy/special/_precompute/wright_bessel.py | Python | bsd-3-clause | 12,882 |
#
# biscuit - Modular HTTP cookie parser
# Copyright (C) 2012 Andrea Cardaci <cyrus.and@gmail.com>
#
# This file is part of biscuit.
#
# biscuit 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... | ksmaheshkumar/biscuit | core/service_wrapper.py | Python | gpl-3.0 | 1,846 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import pytest # type: ignore
import pickle
import os
import numpy as np
import warnings
import scipy.constants as const
from pathlib import Path
from monty.tempfile import ScratchDir
from pyma... | mbkumar/pymatgen | pymatgen/io/vasp/tests/test_inputs.py | Python | mit | 34,382 |
import re
import numpy as np
from pandas.util._decorators import Appender
from pandas.core.dtypes.common import is_extension_type, is_list_like
from pandas.core.dtypes.generic import ABCMultiIndex
from pandas.core.dtypes.missing import notna
from pandas.core.arrays import Categorical
from pandas.core.frame import _... | cbertinato/pandas | pandas/core/reshape/melt.py | Python | bsd-3-clause | 15,651 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from app.openapi_server.models.base_model_ import Model
from app.openapi_server.models.extension_class_impllinks import ExtensionClassImpllinks # noqa: F401,E501
from ... | cliffano/swaggy-jenkins | clients/python-blueplanet/generated/app/openapi_server/models/extension_class_impl.py | Python | mit | 3,230 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
# 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/... | psiwczak/openstack | nova/tests/test_melange_ipam_lib.py | Python | apache-2.0 | 10,757 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | jcftang/ansible | lib/ansible/modules/network/eos/eos_command.py | Python | gpl-3.0 | 7,658 |
#!/usr/bin/env python
"""
Enable heaters with a pin.
Author: Elias Bakken
email: elias(dot)bakken(at)gmail(dot)com
Website: http://www.thing-printer.com
License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html
Redeem is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pub... | intelligent-agent/redeem | redeem/Enable.py | Python | gpl-3.0 | 1,146 |
from dict_validator import Field
class Choice(Field):
"""
Accept any type of input as long as it matches on of the choices
mentioned in the provided list.
:param choices: list of choices to match against
>>> from dict_validator import validate, describe
>>> class Schema:
... field =... | gurunars/dict-validator | dict_validator/fields/choice_field.py | Python | mit | 1,274 |
#! /usr/bin/env python
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | thiagodasilva/swift | swift/cli/ringbuilder.py | Python | apache-2.0 | 45,256 |
from setuptools import setup
setup_kwargs = dict(
name='tombstones',
version='0.1',
description='Python package to mark dead code.',
license='BSD',
author='Per Classon',
author_email='perwclasson@gmail.com',
url='https://github.com/perclasson/python-tombstones',
download_url='https://gi... | perclasson/python-tombstones | setup.py | Python | bsd-2-clause | 705 |
#!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | donspaulding/adspygoogle | examples/adspygoogle/dfp/v201211/get_all_orders.py | Python | apache-2.0 | 1,619 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Kevin Ross
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class ModifiesCerts(Signature):
name = "modifies_certs"
description = "尝试创建或更改系统证... | lixiangning888/whole_project | modules/signatures_merge_tmp/modifies_certs.py | Python | lgpl-3.0 | 700 |
# 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 req... | atheendra/access_keys | keystone/openstack/common/network_utils.py | Python | apache-2.0 | 2,687 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
import random
import time
from urlparse import urlparse
from cfme.common.vm import VM
from cfme.configure import tasks
from cfme.exceptions import CFMEException
from cfme.web_ui import flash, toolbar
from fixtures.pytest_store import store
from utils import test... | thom-at-redhat/cfme_tests | cfme/tests/infrastructure/test_vm_analysis.py | Python | gpl-2.0 | 19,762 |
from empty import Empty
from doublyLinkedBase import _DoublyLinkedBase
import unittest
class PositionalList(_DoublyLinkedBase):
class Position:
__slots__ = '_container', '_node'
def __init__(self, container, node):
self._container = container
self._node = node
... | jward6/academics-python | datastructures/positionalList.py | Python | mit | 3,812 |
from flask import Blueprint
NAME = "Searchable Map Template"
blueprint = Blueprint('base', __name__)
| eads/tarbell-searchable-map | _base/base.py | Python | mit | 103 |
# Copyright (c) 2018 PaddlePaddle 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 app... | chengduoZH/Paddle | python/paddle/fluid/tests/unittests/test_sampling_id_op.py | Python | apache-2.0 | 2,626 |
#Задача 9. Вариант 1.
#Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробовать отга... | Mariaanisimova/pythonintask | BITs/2014/Abdrahmanova_G_I/task_9_1.py | Python | apache-2.0 | 1,510 |
import os
import sqlite3
from datetime import datetime, timedelta
import pytest
import persistent
class A(persistent.Persistent):
pass
class B(persistent.Persistent):
references = [ 'ref0' ]
class C(persistent.Persistent):
references = [ 'ref0', 'ref1' ]
def test_connect():
persistent.connect(... | fictorial/python-object-persistence | tests.py | Python | mit | 18,982 |
# source: http://stackoverflow.com/questions/2835559/parsing-values-from-a-json-file-in-python
import unittest
from PipedJSON import PipedJSON
import json
import time
class Test(unittest.TestCase):
def test_parseJSON(self):
jsonText = "{ \"Markers\": [{ \"ID\": 8, \"T\": { \"x\"... | RahulChidurala/SeniorDesign2 | source/Navigation/PipedJSONTest.py | Python | gpl-3.0 | 1,982 |
from setuptools import setup, find_packages
version = '1.0.7'
LONG_DESCRIPTION = """
How to use django-pagination
----------------------------
``django-pagination`` allows for easy Digg-style pagination without modifying
your views.
There are really 5 steps to setting it up with your projects (not including
install... | imanhodjaev/django-pagination | setup.py | Python | bsd-3-clause | 4,169 |
#!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# 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': ['preview'],
... | alxgu/ansible | lib/ansible/modules/storage/netapp/na_ontap_cg_snapshot.py | Python | gpl-3.0 | 7,970 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ganeshnalawade/ansible | lib/ansible/template/__init__.py | Python | gpl-3.0 | 47,264 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
'''
Created on Jul 9, 2013
@author: Chunwei Yan @ pkusz
@mail: yanchunwei@outlook.com
'''
import re
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from pyquery import PyQuery as pq
def hash_node_include_childnodes(body, hashs):
ha... | Superjom/bad_source | python/paper/analysis/html_2_node_hash.py | Python | gpl-2.0 | 1,612 |
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""Utilitie... | nuclear-wizard/moose | python/MooseDocs/common/read.py | Python | lgpl-2.1 | 1,466 |
# Copyright 2020 by Kurt Rathjen. All Rights Reserved.
#
# 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 3 of the License, or
# (at your option) any later version. This ... | krathjen/studiolibrary | src/mutils/tests/test_attribute.py | Python | lgpl-3.0 | 5,307 |
#!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... | sagiss/sardana | src/sardana/sardanamodulemanager.py | Python | lgpl-3.0 | 9,493 |
# Copyright 2015 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... | ghchinoy/tensorflow | tensorflow/compiler/tests/sparse_to_dense_op_test.py | Python | apache-2.0 | 4,522 |
# $Id: pjsua_app.py 1438 2007-09-17 15:44:47Z bennylp $
#
# Sample and simple Python script to make and receive calls, and do
# presence and instant messaging/IM using PJSUA-API binding for Python.
#
# Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
#
import py_pjsua
import sys
import thread
#
# ... | silvansky/pjsip_mod | pjsip-apps/src/py_pjsua/pjsua_app.py | Python | gpl-2.0 | 22,424 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-12 11:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | REBradley/WineArb | winearb/reviews/migrations/0002_auto_20161112_0348.py | Python | bsd-3-clause | 871 |
from django.utils.formats import date_format
from django.utils.safestring import mark_safe
from django.utils.timezone import localtime
def datetime_with_by(attr, short_description):
def f(self, obj):
d = getattr(obj, attr)
if d:
d_formated = date_format(localtime(d), "SHORT_DATETIME_FO... | leprikon-cz/leprikon | leprikon/admin/utils.py | Python | bsd-3-clause | 608 |
"""Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'. 'mktemp' is subject to race conditions and
should not be used; it is prov... | prefetchnta/questlab | bin/x64bin/python/37/Lib/tempfile.py | Python | lgpl-2.1 | 27,541 |
from __future__ import absolute_import
import re
import logging
from functools import partial
from typing import Any, Callable, Text, Dict, Optional
from django.http import HttpRequest, HttpResponse
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.lib.request im... | jainayush975/zulip | zerver/webhooks/github_webhook/view.py | Python | apache-2.0 | 13,915 |
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debugging API.
... | kikocorreoso/brython | www/src/Lib/email/iterators.py | Python | bsd-3-clause | 2,135 |
#!/usr/bin/python
# (c) 2016-2021 Huwenbo Shi
import numpy as np
import pandas as pd
import argparse, math, sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from matplotlib import gridspec
import matplotlib.ticker as ticker
from matplotlib.ticker import For... | huwenboshi/hess | misc/local_rhog_manhattan.py | Python | gpl-3.0 | 7,113 |
# -*- coding: utf-8 -*-
"""Redundancy.
---
layout: post
source: David Foster Wallace
source_url: http://bit.ly/1c85lgR
title: Redundancy
date: 2014-06-10 12:31:19
categories: writing
---
Points out use redundant phrases.
"""
from proselint.tools import memoize, preferred_forms_check
@memoize
def... | jstewmon/proselint | proselint/checks/wallace/redundancy.py | Python | bsd-3-clause | 659 |
import json
import os
import copy
from modules import *
from image_modules import *
import pdb
import unicodedata
import argparse
TEMP_DIRECTORY = './cache'
HISTORY_PATH = os.path.join(TEMP_DIRECTORY, '.history')
parser = argparse.ArgumentParser(description='Run an easygen program.')
parser.add_argument('program', h... | markriedl/easygen | easygen.py | Python | mit | 6,132 |
# -*- coding: utf-8 -*-
#
#
# (DC)² - DataCenter Deployment Control
# Copyright (C) 2010, 2011, 2012, 2013, 2014 Stephan Adig <sh@sourcecode.de>
# 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; ... | sadig/DC2 | components/dc2-client/dc2/client/api/dc2/objects/installstate.py | Python | gpl-2.0 | 4,109 |
# ======================================================================
# USER-GFMD - Elastic half-space methods for LAMMPS
# https://github.com/Atomistica/user-gfmd
#
# Copyright (2011-2016,2021)
# Lars Pastewka <lars.pastewka@imtek.uni-freiburg>,
# Tristan A. Sharp and others.
# See the AUTHORS file in the top... | Atomistica/user-gfmd | tests/TEST_energy_conservation_two_layers/eval.py | Python | gpl-2.0 | 1,345 |
# Copyright 2020 Google LLC
# 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 a... | googleinterns/commentaries | models.py | Python | apache-2.0 | 7,751 |
from flask import jsonify
def make_json_response(json):
response = jsonify(json)
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
response.headers.add('Access-Control-Allow-Methods', 'GET')
return response
d... | baering/thingmenn | thingmenn-api/api/helpers/__init__.py | Python | mit | 720 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.