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
# Copyright 2016-present Sergey Demyanov. All Rights Reserved. # # Contact: my_name@my_sirname.net # # 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/LI...
sdemyanov/tensorflow-worklab
classes/writer.py
Python
apache-2.0
1,634
#!/usr/bin/python #---------------------------------------------------------------------- # Be sure to add the python path that points to the LLDB shared library. # # To use this in the embedded python interpreter using "lldb": # # cd /path/containing/crashlog.py # lldb # (lldb) script import crashlog # "crash...
apple/swift-lldb
examples/python/crashlog.py
Python
apache-2.0
45,121
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-05-29 13:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0054_add_field_user_to_productionform'), ] operations = [ migration...
efornal/pulmo
app/migrations/0055_applicationform_requires_development.py
Python
gpl-3.0
523
import os import shutil from jinja2 import Environment, FileSystemLoader import config from config import THEME_PATH, CONTENT_PATH, OUTPUT_PATH from model import Chapter, Section, Theme from utils import force_copy from logger import logger class FlatBuilder(object): def __init__(self, book_path): self.e...
zhy0216/mkbook
mkbook/builder.py
Python
mit
2,653
from plasmaBot.plugin import PBPlugin, PBPluginMeta, Response, PBPluginConfig import discord import asyncio from SQLiteHelper import SQLiteHelper as sq from plasmaBot import exceptions import logging log = logging.getLogger('discord') # Database Default Classes class dbt_moderation_settings(object): def __init...
PlasmaRobotics2403/PlasmaBot
plasmaBot/plugins/moderation.py
Python
mit
32,260
from __future__ import print_function, division """ plot spectra and overplot survey filters """ import os import sys import subprocess import sys import os import shutil import argparse import warnings import datetime import numpy as np from matplotlib import pyplot as plt import lsst.sims.photUtils.Bandpass ...
dhroth/count_quasars
plotBandpasses.py
Python
mit
2,431
from django.core.management.base import BaseCommand from treatment_sheets.models import TxSheet from datetime import date, timedelta class Command(BaseCommand): @staticmethod def _delete_expired_lists(): old_days = timedelta(days=3) old_date = date.today() - old_days old_sheets = Tx...
onnudilol/vetcalc
common/management/commands/delete_expired_sheets.py
Python
mit
550
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.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; either version 2 of the License, or # (at y...
odahoda/noisicaa
noisicaa/builtin_nodes/cv_mapper/node_ui.py
Python
gpl-2.0
3,410
def gen_list(): list = [] for i in range(9): list.append(2**i) return list if __name__ == '__main__': print(gen_list())
maxiee/DataStructuresAlgorithmsPythonExercises
chapter1/r_1_11.py
Python
gpl-2.0
145
# Copyright (c) 2017 IBM # 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 appli...
openstack/neutron-lib
neutron_lib/tests/unit/api/definitions/test_dns_domain_ports.py
Python
apache-2.0
936
#!/usr/bin/env python ''' Affine invariant feature-based image matching sample. This sample is similar to find_obj.py, but uses the affine transformation space sampling technique, called ASIFT [1]. While the original implementation is based on SIFT, you can try to use SURF or ORB detectors instead. Homography RANSAC ...
dewtx29/python_ann
python/p4_easy/noo/asift.py
Python
gpl-3.0
5,225
''' Android Gyroscope --------------------- ''' from plyer_lach.facades import Gyroscope from jnius import PythonJavaClass, java_method, autoclass, cast from plyer_lach.platforms.android import activity Context = autoclass('android.content.Context') Sensor = autoclass('android.hardware.Sensor') SensorManager = autocl...
locksmith47/turing-sim-kivy
src/plyer_lach/platforms/android/gyroscope.py
Python
mit
2,142
# -*- coding: utf-8 -*- ########################################################################### # OCRFeeder - The complete OCR suite # Copyright (C) 2009 Joaquim Rocha # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
ackalker/ocrfeeder
src/ocrfeeder/studio/dataHolder.py
Python
gpl-3.0
8,231
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="candlestick.hoverlabel.font", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=plotly_name, pare...
plotly/plotly.py
packages/python/plotly/plotly/validators/candlestick/hoverlabel/font/_family.py
Python
mit
576
def extractWwwDevilfoxxBlog(item): ''' Parser for 'www.devilfoxx.blog' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('MWBT', 'In the Future, My Whole Body is a Treasure', ...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractWwwDevilfoxxBlog.py
Python
bsd-3-clause
644
from __future__ import absolute_import, unicode_literals from celery import shared_task from .models import * from django.db.models import Q, F, Sum, Count, FloatField, Case, When import lda import numpy as np import pandas as pd from sklearn.decomposition import NMF, LatentDirichletAllocation as LDA from sklearn.fea...
mcallaghan/tmv
BasicBrowser/tmv_app/tasks.py
Python
gpl-3.0
26,386
# Licensed under the GPLv3 - see LICENSE import os import copy import pickle import pytest import numpy as np import astropy.units as u from astropy.time import Time from ... import gsb from ..payload import decode_4bit, encode_4bit from ...data import (SAMPLE_GSB_RAWDUMP_HEADER as SAMPLE_RAWDUMP_HEADER, ...
mhvk/baseband
baseband/gsb/tests/test_gsb.py
Python
gpl-3.0
52,105
from django.contrib.auth import authenticate, login from django.contrib.auth.models import User, AnonymousUser from django.contrib.sessions.backends.db import SessionStore from django.http import HttpRequest from django.test import TestCase from django.test.client import Client from cyder.core.ctnr.models import Ctnr,...
ngokevin/cyder
cyder/core/cyuser/tests.py
Python
bsd-3-clause
12,300
#!/usr/bin/env python3 # 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 https://mozilla.org/MPL/2.0/. import json import os import re import sys import urllib.request from html import escape as htm...
splav/servo
tests/wpt/reftests-report/gen.py
Python
mpl-2.0
5,915
# -*- coding: utf-8 -*- """ *************************************************************************** ParametersPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya (C) 2013 by CS Systemes d'information (CS SI) ...
jef-n/QGIS
python/plugins/processing/gui/ParametersPanel.py
Python
gpl-2.0
11,428
import pyglet class Label(pyglet.text.Label): def update(self): self._update() def unload(self): self.delete() class InputLabel(pyglet.text.Label): def _get_left(self): if self._multiline: width = self._width else: width = self.content_width ...
jorgecarleitao/pyglet-gui
pyglet_gui/override.py
Python
bsd-3-clause
2,479
# -*- coding: utf-8 -*- import time import numpy as np from pyodesys import ODESys as _ODESys from pyodesys.results import Result from chempy.units import get_derived_unit, unitless_in_registry, uniform, patched_numpy as pnp from .integrate import run from ._chemreac import cvode_predefined_durations_fields class ODE...
chemreac/chemreac
chemreac/_odesys.py
Python
bsd-2-clause
4,778
# Copyright 2017 - Nokia # # 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...
openstack/vitrage
vitrage/tests/unit/entity_graph/test_processor_service.py
Python
apache-2.0
2,582
# Copyright 2016 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. def CheckChangeOnUpload(input_api, output_api): return _CommonChecks(input_api, output_api) def CheckChangeOnCommit(input_api, output_api): return _Com...
endlessm/chromium-browser
ui/file_manager/PRESUBMIT.py
Python
bsd-3-clause
896
""" Configuration for a project. """ rails = { 'models.engine': 'sqlalchemy', 'models.db.type': 'postgres', 'models.db.user': 'rails', 'models.db.password': 'rails', 'views.engine': 'jinja', }
PythonRails/examples
blog/config.py
Python
mit
218
# connectors/pyodbc.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re from . import Connector from .. import util class PyODBCConnector(...
graingert/sqlalchemy
lib/sqlalchemy/connectors/pyodbc.py
Python
mit
5,586
# -*- coding: utf-8 -*- from FileInfoViewTemplate import * from PyQt4 import QtCore, QtGui from acq4.util.DataManager import DirHandle import acq4.Manager as Manager #import sip import time import acq4.util.configfile as configfile from acq4.util.DictView import * class FocusEventCatcher(QtCore.QObject): sigL...
mgraupe/acq4
acq4/modules/DataManager/FileInfoView.py
Python
mit
5,784
# -*- coding: utf-8 -*- from efesto.Version import version def test_version(): assert version == '1.1.8'
getefesto/efesto
tests/unit/Version.py
Python
gpl-3.0
111
from __future__ import absolute_import, unicode_literals from django.conf import settings from django.http import HttpResponse from django.test.utils import override_settings from ..base import BaseTestCase @override_settings(DEBUG_TOOLBAR_CONFIG={'INTERCEPT_REDIRECTS': True}) class RedirectsPanelTestCase(BaseTestC...
Endika/django-debug-toolbar
tests/panels/test_redirects.py
Python
bsd-3-clause
3,223
# Licensed under a 3-clause BSD style license - see LICENSE.rst # LOCAL from .. import exceptions from .. import tree from ....tests.helper import raises @raises(exceptions.W07) def test_check_astroyear_fail(): config = {'pedantic': True} field = tree.Field(None, name='astroyear') tree.check_astroyear('X2...
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/io/votable/tests/tree_test.py
Python
mit
807
#!/usr/bin/env python import os from subprocess import Popen, STDOUT, PIPE, call import filecmp import glob from optparse import OptionParser parser = OptionParser() parser.add_option('--mpi_exec', dest='mpi_exec', default='') parser.add_option('--mpi_np', dest='mpi_np', default='3') parser.add_option('--exe', dest='...
nhorelik/openmc
tests/test_statepoint_batch/test_statepoint_batch.py
Python
mit
2,470
#!/usr/bin/env python # Copyright (c) 2009 Matt Harrison import ConfigParser from contextlib import contextmanager import datetime import optparse import os import sys from poachplatelib import meta DEFAULT_CONFIG = """ [properties] author : 'FILL IN' email : 'FILL IN' version : 0.1 """ CONFIG_LOC = os.path.expand...
mattharrison/poachplate
poachplatelib/package.py
Python
mit
9,046
__author__ = 'dstrohl' import unittest import logging from testfixtures import LogCapture from python_log_indenter.pli import IndentedLoggerAdapter from testfixtures import compare class TestIndentedLogging(unittest.TestCase): def test_passthrough_logging(self): with LogCapture() as l: log = ...
dstrohl/Python_log_indenter
python_log_indenter/tests/test_indent_logger.py
Python
gpl-2.0
3,293
from .base import Model # noqa: F401 from .base import TransformBoundsWrapper # noqa: F401 from .pytorch import PyTorchModel # noqa: F401 from .tensorflow import TensorFlowModel # noqa: F401 from .jax import JAXModel # noqa: F401 from .numpy import NumPyModel # noqa: F401 from .wrappers import ThresholdingWrapp...
bethgelab/foolbox
foolbox/models/__init__.py
Python
mit
337
print("hello world!")
Pyroseza/Random
test.py
Python
mit
23
from setuptools import setup, find_packages setup(name="intintervals", version="0.02", description="Efficiently store disjoint integer intervals", packages=find_packages())
ndryden/IntIntervals
setup.py
Python
bsd-3-clause
193
import json import pprint import re from HTMLParser import HTMLParser from utils import utils import threading with open('patterns.txt', 'r') as f: patterns = json.load(f) pprint.pprint(patterns, indent=4) test_strings = [ "[tag:cv-pls-too-broad-offsite-resource-unclear-whatever] http://stackoverflow.com/qu...
AWegnerGitHub/SE_Zephyr_VoteRequest_bot
show_patterns.py
Python
gpl-2.0
7,554
"""Views for the D3M configuration module""" import json from django.views.decorators.csrf import csrf_exempt from django.shortcuts import render from django.http import JsonResponse, HttpResponse, Http404 from tworaven_apps.configurations.models_d3m import D3MConfiguration # Create your views here. @csrf_exempt def ...
vjdorazio/TwoRavens
tworaven_apps/configurations/views.py
Python
bsd-3-clause
2,399
# Copyright (C) 2021 Nippon Telegraph and Telephone Corporation # 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/LICE...
openstack/tacker
tacker/sol_refactored/objects/v2/terminate_vnf_request.py
Python
apache-2.0
1,260
# -*- coding: utf-8 -*- from contextlib import contextmanager import inspect from itertools import chain from django.conf import settings from django.utils.decorators import method_decorator from django.utils.termcolors import colorize from sekizai.helpers import validate_template from cms import constants from cms.m...
czpython/django-cms
cms/utils/check.py
Python
bsd-3-clause
16,633
"""Provide the functionality to group entities.""" from __future__ import annotations from abc import abstractmethod import asyncio from contextvars import ContextVar import logging from typing import Any, Iterable, List, cast import voluptuous as vol from homeassistant import core as ha from homeassistant.const imp...
w1ll1am23/home-assistant
homeassistant/components/group/__init__.py
Python
apache-2.0
22,278
from setuptools import setup import os import codecs here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding an encoding option to open return codecs.open(os.path.join(here, *parts), 'r').read() setup( name='cloudify-agent-packager', version='3.5.2', url...
codilime/cloudify-agent-packager
setup.py
Python
apache-2.0
930
# -*- coding: UTF-8 -*- from leancloud import Object from leancloud.query import Query __author__ = 'Panmax' class LeanCloudObject(Object): def __getattr__(self, attr): return self.get(attr) class MedicalTemplate(Object): """ 病历模板库 """ @property def name(self): return self.get...
Panmax/leancloud-medical
models/medical.py
Python
mit
3,262
from configobj import ConfigObj, flatten_errors from validate import Validator _spec = '''\ [global] persistent = boolean(default=False) base = string container_id = string(default=None) user = string(default=None) sudo = boolean(default=False) on_activate = force_list(min=0, default=None) ...
peick/cleanenv
cleanenv/cleanenv_inside/config.py
Python
gpl-3.0
1,673
''' Created on 28/set/2014 @author: Vincenzo Pirrone <pirrone.v@gmail.com> ''' import serial, time class Connector: def readline(self): pass def writeline(self, line): pass def close(self): pass class FakeSerial(Connector): def __init__(self, port): p...
sp4x/osnf
osnf/connectors.py
Python
apache-2.0
1,423
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2009 Vincent # Copyright (c) 2009 Mads Kiilerich <mads@kiilerich.com> # Copyright (c) 2012-2014 Google, Inc. # Copyright (c) 2014-2018, 2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014-2015 Michal Nowikowski <godfr...
PyCQA/pylint
pylint/message/__init__.py
Python
gpl-2.0
2,726
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from django.db import transaction from sentry import options from sentry.utils import json from sentry.utils.compat import filter from sentry.utils.http import absolute_uri from sentry.integrations.base import ( Integ...
beeftornado/sentry
src/sentry/integrations/pagerduty/integration.py
Python
bsd-3-clause
7,387
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from app import db __author__ = 'Xiaoxiao.Xiong' class Region(db.Model): """ Region list """ __tablename__ = 'Region' id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(30), nullable=False) ...
dhrproject/mydatasource
DataSource/app/model/region.py
Python
mit
496
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
lmazuel/azure-sdk-for-python
azure-mgmt-servicefabric/setup.py
Python
mit
2,826
import Tkinter as tk from versionControl import greeting import AppKit from infoTwitterGet import getFollower from infoFindEdge import followerInfo import threading start_bt_ms = "Get information about followers/friends of an account~" class App(tk.Frame): def __init__(self, master): tk.Frame.__init__(sel...
orangeYao/twiOpinion
dustbin/py2app/guiInfo.py
Python
mit
6,273
import luigi import sciluigi import pyannote_workflows.tasks.speech import pyannote_workflows.tasks.face import pyannote_workflows.tasks.evaluation import pyannote_workflows.tasks.tvd_dataset import pyannote_workflows.tasks.propagation import pyannote_workflows.utils from pyannote.core import Segment, Annotation impor...
pyannote/pyannote-workflows
pyannote_workflows/workflows/acmmm2016/face_linear.py
Python
mit
7,977
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-18 08:45 from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('reference', '0016_auto_20170410_1318'), ('base', '0...
uclouvain/OSIS-Louvain
base/migrations/0168_auto_20171018_1045.py
Python
agpl-3.0
1,497
#!/usr/bin/env python import requests import json import pylab as pl import numpy as np import sys class FlairCount: ''' Class wrapper for fetching data and generating stats. ''' def __init__(self, subreddit): self.subreddit = subreddit self.api = 'http://reddit.com/r/' + self.subreddit + '/ap...
pranavrc/flaircount
flaircount.py
Python
mit
2,228
from mozdef_util.utilities.toUTC import toUTC from mq.plugins.stackdriver_audit import message class TestStackDriverAudit(object): def setup(self): self.plugin = message() self.metadata = {"index": "events"} # Should never match and be modified by the plugin def test_notags_log(self): ...
jeffbryner/MozDef
tests/mq/plugins/test_stackdriver_audit.py
Python
mpl-2.0
16,321
from django.apps import AppConfig class EventConfig(AppConfig): name = 'event' verbose_name = 'Django Event'
joshmarlow/crowdpact
crowdpact/apps/event/app.py
Python
mit
119
#! /usr/bin/env python from __future__ import print_function from .message_channel import MessageChannelCollection from .orderbookwatch import OrderbookWatch from .enc_wrapper import (as_init_encryption, init_keypair, init_pubkey, NaclError) from .protocol import (COMMAND_PREFIX, ORDER_KEYS, ...
chris-belcher/joinmarket-clientserver
jmdaemon/jmdaemon/daemon_protocol.py
Python
gpl-3.0
24,228
# -*- coding: utf-8 -*- """ Interfaces for homeslick """ import logging import zope.interface DEV_LOGGER = logging.getLogger(__name__) class ICastle(zope.interface.Interface): ''' All castle's implement ICastle ''' def pull(): ''' Update castle from remote source and run any events th...
cscutcher/homeslick
homeslick/interfaces.py
Python
unlicense
626
# Copyright 2013 Red Hat, 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 agre...
Metaswitch/calico-nova
nova/openstack/common/report/guru_meditation_report.py
Python
apache-2.0
7,557
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['ConstantTrend'] , ['Seasonal_Hour'] , ['NoAR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_ConstantTrend_Seasonal_Hour_NoAR.py
Python
bsd-3-clause
162
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
cloudify-cosmo/cloudify-manager
workflows/cloudify_system_workflows/snapshots/fix_snapshot_ssh_db.py
Python
apache-2.0
6,654
import os import predix.config import predix.admin.service import predix.admin.cf.spaces class Logging(object): """ An Elasticsearch ELK distribution to centralize Cloud Foundry log aggregation and analysis. You need to install the Kibana-Me-Logs application separately to make use of the logging...
j12y/predixpy
predix/admin/logstash.py
Python
bsd-3-clause
1,891
################################################################################ # # This program is part of the HPMon Zenpack for Zenoss. # Copyright (C) 2008, 2009, 2010, 2011 Egor Puzanov. # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zen...
epuzanov/ZenPacks.community.HPMon
ZenPacks/community/HPMon/modeler/plugins/community/snmp/HPLogicalDiskMap.py
Python
gpl-2.0
1,489
from globals import * from tiles import * import graphics as gfx import life as lfe import maputils import bad_numbers import drawing import effects import weather import mapgen import logic import items import zones import alife import tiles import fov import logging import random import numpy ...
flags/Reactor-3
maps.py
Python
mit
21,816
# basic_source.py # Copyright (c) 2013-2016 Pablo Acosta-Serafini # See LICENSE for details # pylint: disable=C0103,C0111,E0611,R0201,R0204,W0212,W0232,W0612 # PyPI imports from numpy import array import pytest # Putil imports from putil.plot import BasicSource as FUT from putil.test import AE, AI, APROP, AROPROP ##...
pmacosta/putil
tests/plot/basic_source.py
Python
mit
9,026
# Copyright (c) 2013 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. # This dict determines how chrome.dll is split into multiple parts. { 'parts': [ # These sections are matched in order, and a matching input will g...
loopCM/chromium
build/split_link_partition.py
Python
bsd-3-clause
5,626
#!/usr/bin/python from mininet.topo import Topo from mininet.net import Mininet from mininet.cli import CLI from mininet.log import setLogLevel, info, debug from mininet.node import Host, RemoteController QUAGGA_DIR = '/usr/lib/quagga' # Must exist and be owned by quagga user (quagga:quagga by default on Ubuntu) QUAG...
zsh2938/onos
tools/tutorials/sdnip/tutorial.py
Python
apache-2.0
4,919
from sentry.utils.avatar import get_letter_avatar def test_letter_avatar(): # Test name as display name and email as identifier letter_avatar = get_letter_avatar('Jane Doe', 'janedoe@example.com') assert 'JD' in letter_avatar assert '#E56AA6' in letter_avatar assert 'svg' in letter_avatar # T...
mitsuhiko/sentry
tests/sentry/utils/test_letter_avatar.py
Python
bsd-3-clause
1,553
import os import shutil import tarfile import zipfile import gzip import subprocess from lutris.util.system import merge_folders from lutris.util.log import logger def extract_archive(path, to_directory='.', merge_single=True, extractor=None): path = os.path.abspath(path) logger.debug("Extracting %s to %s", p...
malkavi/lutris
lutris/util/extract.py
Python
gpl-3.0
3,476
#!/usr/bin/python3 # # This program parses the google books ngram dataset and adds it to a # sqlite database. # # Copyright 2015 Peter M. Jones # # 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 ...
vathpela/ngram-tools
db.py
Python
gpl-3.0
16,105
# 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...
yajiedesign/mxnet
example/restricted-boltzmann-machine/binary_rbm_gluon.py
Python
apache-2.0
7,114
f = open('test_content.txt', 'r') print(f.read()) f.close() # using context manager with open('test_content.txt', 'r') as f: print(f.read())
yrunts/python-for-qa
3-python-intermediate/examples/file.py
Python
cc0-1.0
148
# Copyright (c) 2021, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import numpy as np import os import pytest import shutil import tempfile import coremltools from coreml...
apple/coremltools
coremltools/test/modelpackage/test_modelpackage.py
Python
bsd-3-clause
20,269
import pymongo from pymongo import MongoClient from datetime import datetime import sys import bcrypt sys.path.insert(0, '/opt/C3STEM/Middleware') from DAO import TrafficLightDAO from simulation_related import * from junction1_data import * from junction2_data import * from junction3_data import * from junction4_data ...
shekharshank/c2sumo
src/C3STEM/DB/c2sumo_schema.py
Python
mit
14,785
def bar(): a = 1 b = 2 foo(a) foo(b) def foo(a_new): print a_new
Lekanich/intellij-community
python/testData/refactoring/extractmethod/DuplicateWithRename.after.py
Python
apache-2.0
88
# This is the Python restserver module used in the websocket server by # restserver_wsh.py and AJAX server by ajaxserver.py. import logging, sqlite3, json, time, random, re logger = logging.getLogger('restserver') class Database(): def __init__(self, filename="restserver.db"): self.conn = sqlite3.connect...
theintencity/vvowproject
server/restserver.py
Python
lgpl-3.0
9,342
# doctest r''' Test the .npy file format. Set up: >>> import sys >>> from io import BytesIO >>> from numpy.lib import format >>> >>> scalars = [ ... np.uint8, ... np.int8, ... np.uint16, ... np.int16, ... np.uint32, ... np.int32, ... np.uint6...
madphysicist/numpy
numpy/lib/tests/test_format.py
Python
bsd-3-clause
38,261
from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEventAsync from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList from couchpotato.core.helpers.variable import cleanHost from couchpotato.core.logger import CPLog from couchpotato.environment import ...
heathseals/CouchPotatoServer
couchpotato/core/downloaders/putio/main.py
Python
gpl-3.0
6,596
""" Weld: A Gmail XMPP Gateway Copyright (C) 2010 Lance Stout This file is part of Weld. See the file LICENSE for copying permission. """ import sleekxmpp from sleekxmpp.xmlstream import ElementBase, ET def load_config(filename): """ Create a configuration stanza object from the given fi...
legastero/Weld
weld/config.py
Python
mit
2,853
#!/usr/bin/env python3 # transpiled with BefunCompile v1.3.0 (c) 2017 import gzip, base64 _g = ("AR+LCAAAAAAABADt2slqwzAQgOFXcb1cIi8jxzpEBNEHCUkPBV110skPnwmmgdCWlDaB0PzfRaPRgpDxnJQLPJIKAAAAAAAAAAAAAAAAAIB/4OqDuZA/gvPcfIq2d3qg" + "9+RC+V5OK28lObdaiSSRGGzn/ajhbhz8HDSMu6baH/xaklkv49qt8/XtcQOz/zKdjB2i2ChjszT8IreX6/qin6z...
Mikescher/Project-Euler_Befunge
compiled/Python3/Euler_Problem-021.py
Python
mit
2,840
# coding: utf-8 import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-info_screen', ...
OPpuolitaival/django-info-screen
setup.py
Python
mit
1,195
"""Support for One-Time Password (OTP).""" import time import logging import voluptuous as vol from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import (CONF_NAME, CONF_TOKEN) from homeassis...
molobrakos/home-assistant
homeassistant/components/otp/sensor.py
Python
apache-2.0
2,288
# 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...
TakayukiSakai/tensorflow
tensorflow/python/ops/gradients_test.py
Python
apache-2.0
16,103
from framework.dependency_management.dependency_resolver import ServiceLocator """ GREP Plugin for Testing for CSRF (OWASP-SM-005) https://www.owasp.org/index.php/Testing_for_CSRF_%28OWASP-SM-005%29 NOTE: GREP plugins do NOT send traffic to the target and only grep the HTTP Transaction Log """ import string, re import...
sharad1126/owtf
plugins/web/grep/Testing_for_CSRF@OWTF-SM-005.py
Python
bsd-3-clause
578
#!/usr/bin/env python #sgillen - this program serves as a node that offers the arduino up to the rest of the ros system. # the packets send to the arduino should be in the following format: p<data>! # p tells the arduino which command to execute, the data that follows will depend on which command this is # in genera...
robotics-at-maryland/qubo
src/vl_qubo/src/arduino_node.py
Python
mit
7,826
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2009 Almacom (Thailand) Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
jeffery9/mixprint_addons
ineco_thai_account/report/num2word.py
Python
agpl-3.0
3,998
""" This module contains functional tests for the 23rd migration. """ import os import shutil import stat import tempfile import unittest import mock from pulp.server.db import connection from pulp.server.db.migrate.models import _import_all_the_way migration = _import_all_the_way('pulp.server.db.migrations.0023_im...
ulif/pulp
server/test/unit/server/db/migrations/test_0023_importer_tls_storage.py
Python
gpl-2.0
12,384
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt import frappe import unittest test_records = frappe.get_test_records('C-Form') class TestC-Form(unittest.TestCase): pass
gangadharkadam/v5_erp
erpnext/accounts/doctype/c_form/test_c_form.py
Python
agpl-3.0
232
import pickle import pytest from doit.cmdparse import DefaultUpdate, CmdParseError, CmdOption, CmdParse class TestDefaultUpdate(object): def test(self): du = DefaultUpdate() du.set_default('a', 0) du.set_default('b', 0) assert 0 == du['a'] assert 0 == du['b'] ...
lelit/doit
tests/test_cmdparse.py
Python
mit
5,264
# -*- coding: utf-8 -*- # Copyright (2018) 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
HewlettPackard/oneview-redfish-toolkit
oneview_redfish_toolkit/event_dispatcher.py
Python
apache-2.0
2,615
import OOMP newPart = OOMP.oompItem(8762) newPart.addTag("hexID", "BHS1220M") newPart.addTag("oompSort", "BAHOCR1220SMDS") newPart.addTag("oompType", "BAHO") newPart.addTag("oompSize", "CR1220") newPart.addTag("oompColor", "M") newPart.addTag("oompDesc", "SMDS") newPart.addTag("oompIndex", "01") newPart.addTag("oo...
oomlout/oomlout-OOMP
test/BAHO-CR1220-M-SMDS-01.py
Python
cc0-1.0
849
from . import common from . import purchase_test from . import test_base_exception
brain-tec/server-tools
base_exception/tests/__init__.py
Python
agpl-3.0
84
import re import time from bs4 import BeautifulSoup from decksite.data import deck from magic import decklist, legality, seasons from shared import dtutil, fetch_tools, logger from shared.container import Container from shared.pd_exception import InvalidDataException def scrape(limit: int = 1) -> None: page = 1...
PennyDreadfulMTG/Penny-Dreadful-Tools
decksite/scrapers/mtggoldfish.py
Python
gpl-3.0
4,529
# Copyright (C) Schweizerische Bundesbahnen SBB, 2016 # Python 3.4 __author__ = 'florianseidl' from output import AbstractBuildAmpel from datetime import datetime def create(configuration, key=None): return ConsoleOutput(build_filter_pattern=configuration.get("buildFilterPattern", None), c...
SchweizerischeBundesbahnen/cimon_controller
src/consoleoutput.py
Python
apache-2.0
1,323
import logging import httplib import requests from werkzeug.exceptions import Unauthorized from flask import current_app, request, escape from flask_restful import abort from base64 import urlsafe_b64encode from drift.core.extensions.schemachecker import check_schema log = logging.getLogger(__name__) # TODO: Whil...
1939Games/drift
drift/auth/psn.py
Python
mit
5,220
# Copyright 2013 Answers for AWS 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
Answers4AWS/backup-monkey
backup_monkey/core.py
Python
apache-2.0
7,791
import collections # n = int(input()) n = 11527523930876953 f = collections.deque([1, 1]) for i in range(2, n): f.append((f[0] + f[1]) % 26673) f.popleft() print(f[-1])
alvin777/excelsior
codeforces.com/267/fib2.py
Python
gpl-2.0
179
# Copyright (C) 2011-2015 Codethink Limited # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but...
padrigali/ybd
ybd/utils.py
Python
gpl-2.0
10,381
# -*- coding: utf-8 -*- """ Started on Wed Sep 13 15:55:22 2017 @author: carlos.arana Descripcion: Creación de dataset para el parámetro 0311 "Superficie Agricola" Informacion disponible para 2015 """ import pandas as pd import numpy as np import sys # Librerias locales utilizadas module_path = r'D:\PCCS\01_Dmine\...
Caranarq/01_Dmine
03_UsoDeSuelo/P0311/P0311.py
Python
gpl-3.0
8,216
""" Test rebatch action """ import numpy as np import pytest from batchflow import Dataset, Pipeline, Batch class MyBatch(Batch): components = ('dummy', ) DATASET_SIZE = 60 PARAMETERS = [(20, 30), (1, 10), (10, 60), (1, 60), (15, 40), (13, 17)] PARAMETERS = PARAMETERS + [(b, a) for a, b in PARAMETERS] def c...
analysiscenter/dataset
batchflow/tests/rebatch_test.py
Python
apache-2.0
2,331
""" An answer to http://fivethirtyeight.com/features/how-long-will-your-smartphone-distract-you-from-family-dinner/ """ from random import choice if __name__ == '__main__': tasks = [1,2,3,4,5] total = [] for i in range(1000): mine = choice(tasks) sisters = choice(tasks) while mine ...
linsalrob/EdwardsLab
bin/riddler.py
Python
mit
470