text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
raise NotImplementedError("markupbase is not yet implemented in Skulpt")
| ArcherSys/ArcherSys | skulpt/src/lib/markupbase.py | Python | mit | 73 | 0 |
def verificaPalindrome(frase):
removeWhiteSpaces = [] ### Array util para remover os espaços em brancos
removeHypen = [] ### Array util para remover os hifen
palindromo = str(frase).lower().strip() ### Remove os espaços em brancos no inicio e final e coloca toda a palavra em letra minuscula
if (len(pa... | ysrodrigues/Fund-Prog | AD1-Exerc2.py | Python | gpl-3.0 | 1,948 | 0.019608 |
from django.contrib import admin
# Register your models here.
from .models import Environment,EnvironmentAdmin,Component,ComponentAdmin,Environment_property,Environment_propertyAdmin,Component_attribute,Component_attributeAdmin
admin.site.register(Environment,EnvironmentAdmin)
admin.site.register(Component,Component... | wdq007/supreme-garbanzo | fkkenv/fukoku/env/admin.py | Python | gpl-3.0 | 461 | 0.02603 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansHebrew-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #null ????
chars.append(0x200C) #uni200C ZERO WIDTH NON-JOINER
chars.append(0x000D) #nonmarkingreturn ????
ch... | davelab6/pyfontaine | fontaine/charsets/noto_chars/notosanshebrew_regular.py | Python | gpl-3.0 | 9,355 | 0.015927 |
#!/usr/bin/env python3
import argparse
import logging
import string
# Quiet scapy
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy import volatile # noqa: E402
from scapy import sendrecv # noqa: E402
from scapy import config # noqa: E402
from scapy.layers import l2 # noqa: E402
from scapy.la... | mschwager/dhcpwn | dhcpwn.py | Python | gpl-3.0 | 2,829 | 0 |
# Copyright (C) 2016-2019 Dmitry Marakasov <amdmi3@amdmi3.ru>
#
# This file is part of repology
#
# repology 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 optio... | repology/repology | repology/parsers/parsers/cpan.py | Python | gpl-3.0 | 4,152 | 0.002168 |
"""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 agreed to in writing, software
distr... | googleinterns/via-content-understanding | VideoClassification/SegmentLevelClassifier/writer.py | Python | apache-2.0 | 13,749 | 0.014183 |
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden
from django.contrib.auth import login, logout
from django.core.cache import cache
from django.shortcuts import render
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from ipware.ip import get_ip
impor... | rockychen-dpaw/oim-cms | core/views.py | Python | apache-2.0 | 11,814 | 0.001608 |
#!/usr/bin/python -u
# 18-08-04
# v1.1.1
# http.py
# A simple CGI script, to explore http headers, cookies etc.
# Copyright Michael Foord
# Free to use, modify and relicense.
# No warranty express or implied for the accuracy, fitness to purpose or otherwise for this code....
# Use at your own risk !!!
# E-mail or mi... | ActiveState/code | recipes/Python/298336_http__Exploring_Headers_Cookies/recipe-298336.py | Python | mit | 9,871 | 0.005471 |
from click.testing import CliRunner
from sqlitebiter.__main__ import cmd
from sqlitebiter._const import ExitCode
from .common import print_traceback
class Test_version_subcommand:
def test_smoke(self):
runner = CliRunner()
result = runner.invoke(cmd, ["version"])
print_traceback(result)
... | thombashi/sqlitebiter | test/test_version_subcommand.py | Python | mit | 373 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('article', '0019_remove_article_ordering_featured'),
]
operations = [
migrations.RemoveField(
model_name='article... | F483/trainlessmagazine.com | article/migrations/0020_remove_article_issue.py | Python | mit | 366 | 0 |
import logging
import os
import environ
import datetime
from olympia.lib.settings_base import * # noqa
environ.Env.read_env(env_file='/etc/olympia/settings.env')
env = environ.Env()
CDN_HOST = 'https://addons-stage-cdn.allizom.org'
CSP_FONT_SRC += (CDN_HOST,)
CSP_FRAME_SRC += ('https://www.sandbox.paypal.com',)
CSP... | Prashant-Surya/addons-server | src/olympia/conf/stage/settings.py | Python | bsd-3-clause | 8,094 | 0 |
# -*- coding: utf-8 -*-
'''
Created on 19 Dec 2013
@author: Kimon Tsitsikas
Copyright © 2012-2013 Kimon Tsitsikas, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License version 2 as published by the Free Software
Fou... | gstiebler/odemis | src/odemis/acq/align/test/find_overlay_test.py | Python | gpl-2.0 | 3,688 | 0.003526 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyColorpy(PythonPackage):
"""ColorPy is a Python package to convert physical descriptions ... | rspavel/spack | var/spack/repos/builtin/packages/py-colorpy/package.py | Python | lgpl-2.1 | 902 | 0.002217 |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Module for Clause model."""
from ggrc import db
from ggrc.models.mixins import CustomAttributable
from ggrc.models.deferred import deferred
from ggrc.models.mixins import Described
from ggrc.models.mixin... | j0gurt/ggrc-core | src/ggrc/models/clause.py | Python | apache-2.0 | 1,804 | 0.006652 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
"""
Utilities for using modules
"""
import frappe, os, json
import frappe.utils
from frappe import _
def export_module_json(doc, is_standard, module):
"""Make a... | paurosello/frappe | frappe/modules/utils.py | Python | mit | 7,994 | 0.026395 |
# 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 ag... | devendermishrajio/nova_test_latest | nova/tests/unit/objects/test_block_device.py | Python | apache-2.0 | 16,751 | 0.00006 |
"""
File: algorithms.py
Algorithms configured for profiling.
"""
from profiler import Profiler
def selectionSort(lyst, profiler):
i = 0
while i < len(lyst) - 1: # Do n - 1 searches
minIndex = i # for the largest
j = i + 1
while j < len(lyst)... | gregpuzzles1/Sandbox | Example Programs/Ch_11_Student_Files/Case Study/algorithms.py | Python | gpl-3.0 | 1,983 | 0.004539 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import mysql.connector
#from token find userId
#return 0 for error
def findUser(userToken, cnx):
userQuery = 'SELECT user_id FROM user_token WHERE user_token = %s'
try:
userCursor = cnx.cursor()
userCursor.execute(userQuery, (userToken, ))
retur... | byn9826/Thousand-Day | handlers/token.py | Python | bsd-3-clause | 1,530 | 0.007843 |
# -*- coding: UTF-8 -*-
import os.path
import re
from outwiker.core.tree import WikiDocument
from outwiker.utilites.textfile import readTextFile, writeTextFile
from .exporterfactory import ExporterFactory
from .indexgenerator import IndexGenerator
class BranchExporter (object):
def __init__ (self, startpage, n... | unreal666/outwiker | plugins/export2html/export2html/branchexporter.py | Python | gpl-3.0 | 7,572 | 0.008429 |
__author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
# RiBuild Modules
from delphin_6_automation.database_interactions.db_templates import delphin_entry
from delphin_6_autom... | thp44/delphin_6_automation | data_process/wp6_v2/not_in_sample.py | Python | mit | 3,478 | 0.003163 |
# -*- coding: utf-8 -*-
# Build configuration file.
# 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 default; values that are commented out
# serve to show the ... | a25kk/apm | docs/conf.py | Python | mit | 5,991 | 0.006343 |
import torch
from hypergan.train_hooks.base_train_hook import BaseTrainHook
class NegativeMomentumTrainHook(BaseTrainHook):
def __init__(self, gan=None, config=None, trainer=None):
super().__init__(config=config, gan=gan, trainer=trainer)
self.d_grads = None
self.g_grads = None
def gradients(sel... | 255BITS/HyperGAN | hypergan/train_hooks/negative_momentum_train_hook.py | Python | mit | 887 | 0.021421 |
#!/usr/bin/python
import time, sys
if(len(sys.argv) > 0):
video = sys.argv[1]
else:
video = "REjj1ruFQww"
try:
import pychromecast
pychromecast.play_youtube_video(video, pychromecast.PyChromecast().host)
except:
pass
| probonopd/video2smarttv | yt2chromecast.py/usr/bin/video2chromecast.py | Python | mit | 240 | 0.008333 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import json
import logging
import sys
import time
from itertools import tee, islice, chain
from orgformat import OrgFormat
from memacs.lib.orgproperty import OrgProperties
from memacs.lib.reader import UnicodeDictReader
from .csv import Csv
# stolen fro... | novoid/Memacs | memacs/kodi.py | Python | gpl-3.0 | 6,858 | 0.00175 |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | fengbeihong/tempest_automate_ironic | tempest/api/volume/test_volume_transfers.py | Python | apache-2.0 | 4,317 | 0 |
import os
import django
from django.conf import settings; settings.configure()
from docx.engines.base import Engine as base
from django.template import Template
from django.template import Template, Context
"""
Engine for Django
"""
class Engine(base):
def __init__(self):
self.tag_re = "(\{[^\}]+?\}\}?)"
... | holli-holzer/python-docx | docx/engines/DjangoEngine.py | Python | mit | 1,123 | 0.010686 |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
from math import sqrt
from math import log
dx = [1/sqrt(16), 1/sqrt(64), 1/sqrt(256), 1/sqrt(1024)]
dx_tri = [1/sqrt(32), 1/sqrt(128), 1/sqrt(512), 1/sqrt(2048)]
dx_pert = [0.0270466, 0.0134827, 0.00680914, 0.00367054]
dx_fp = [0.122799, 0.081584, 0.0445639, 0.022... | Rob-Rau/EbbCFD | ms_refinement/plot_conv.py | Python | mit | 2,727 | 0.005501 |
#!/usr/bin/env python
#
# Copyright 2015 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 requir... | Aloomaio/googleads-python-lib | examples/ad_manager/v201811/proposal_service/submit_proposals_for_approval.py | Python | apache-2.0 | 2,333 | 0.00943 |
from IPython import embed
import annotateit
from annotateit import model, db, es
from flask import g
def main():
app = annotateit.create_app()
with app.test_request_context():
g.user = model.User.fetch('admin')
embed(display_banner=False)
if __name__ == '__main__':
main()
| openannotation/annotateit | console.py | Python | agpl-3.0 | 306 | 0.009804 |
# -*- coding: utf-8 -*-
"""Round-robin scheduling."""
# Copyright (C) 2015 Alexander Jones
#
# This program 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 yo... | happy5214/competitions-scheduler | competitions/scheduler/roundrobin.py | Python | lgpl-3.0 | 9,367 | 0.000641 |
class Blood(object):
uid = "blood"
name = "Blood"
"""
Most characters will have ordinary blood but some could have acidic blood or with other properties.
"""
| ChrisLR/Python-Roguelike-Template | bodies/blood/base.py | Python | mit | 178 | 0.005618 |
import logging
from django.contrib.auth.backends import (
RemoteUserBackend,
get_user_model,
)
from django.contrib.auth.models import (
Group,
)
from django.utils.translation import ugettext as _
from rest_framework import exceptions
from rest_framework_auth0.settings import (
auth0_api_settings,
)
fro... | mcueto/djangorestframework-auth0 | rest_framework_auth0/authentication.py | Python | mit | 6,383 | 0.000783 |
import logging
pvl_logger = logging.getLogger('pvlib')
import datetime
import numpy as np
import pandas as pd
from nose.tools import raises
from nose.tools import assert_almost_equals
from pvlib.location import Location
from pvlib import solarposition
from pvlib import atmosphere
# setup times and location to be ... | rubennj/pvlib-python | pvlib/test/test_atmosphere.py | Python | bsd-3-clause | 1,611 | 0.017381 |
'''
Nesse exer você deve casar linha que tem 'tio', mas que tenham 1 caractere
antes.
Para fixação, usar o '.' (ponto).
'''
import re
import sys
REGEX = r''
lines = sys.stdin.readlines()
for line in lines:
if re.search(REGEX, line):
print(line.replace('\n', ''))
| deniscostadsc/regex-tutorial | 17-exercises/01-ponto/regex.py | Python | mit | 282 | 0 |
import heapq, itertools
def factorisation(number):
"""Returns a list of the prime factors of a number in ascending order."""
factors = []
while number > 1:
for factor in range(2, number + 1):
if number % factor == 0:
factors.append(factor)
# floor divisi... | natabbotts/math-prog-club | prime.py | Python | mit | 1,686 | 0.007711 |
from django.conf.urls import url
from profiles import views
urlpatterns = [
url(r"users$", views.UserList.as_view(),
name="api-user-list"),
url(r"user/(?P<pk>[0-9]+)$", views.UserSingle.as_view(),
name="api-review-list"),
url(r"userlogin$", views.UserLogin.as_view(),
name="api-lo... | oktayuyar/Velespi | profiles/urls.py | Python | gpl-3.0 | 328 | 0.006098 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
widgetBatchBase.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
************... | camptocamp/QGIS | python/plugins/GdalTools/tools/widgetBatchBase.py | Python | gpl-2.0 | 5,310 | 0.030697 |
# -*- coding: utf-8 -*-
__title__ = 'latinpigsay'
__license__ = 'MIT'
__author__ = 'Steven Cutting'
__author_email__ = 'steven.c.projects@gmail.com'
__created_on__ = '12/7/2014'
if __name__ == "__main__":
from tests import testscript as ts
from tests import contstests
from latinpigsay.tmp.experiments impor... | steven-cutting/latinpigsay | test.py | Python | mit | 636 | 0 |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | quantumlib/OpenFermion-FQE | src/fqe/fqe_ops/fqe_ops_utils.py | Python | apache-2.0 | 2,752 | 0 |
# tests/test_configuration.py
# vim: ai et ts=4 sw=4 sts=4 ft=python fileencoding=utf-8
from io import StringIO
from pcrunner.configuration import (
read_check_commands,
read_check_commands_txt,
read_check_commands_yaml,
)
def test_read_check_commmands_txt_with_extra_lines():
fd = StringIO(
... | maartenq/pcrunner | tests/test_configuration.py | Python | isc | 1,602 | 0 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | wangyum/tensorflow | tensorflow/python/debug/lib/stepper_test.py | Python | apache-2.0 | 45,190 | 0.012304 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import random
from django.conf import settings
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Page
from wagtail.wagtailimages.models import get_image_model
from privagal.gallery.factories import Gal... | ychab/privagal | privagal/core/management/commands/genfactories.py | Python | bsd-3-clause | 1,893 | 0 |
import json
from datetime import datetime
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
set_session(tf.Session(config=config))
from keras.models import Sequential, Model
from ker... | amoshyc/tthl-code | train_resnet.py | Python | apache-2.0 | 1,324 | 0.005287 |
from __future__ import absolute_import, print_function
from sentry.testutils import APITestCase
class SharedGroupDetailsTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
group = self.create_group()
event = self.create_event(group=group)
url = '/api/0/shared... | mitsuhiko/sentry | tests/sentry/api/endpoints/test_shared_group_details.py | Python | bsd-3-clause | 1,141 | 0.000876 |
#!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import mapnik
from nose.tools import eq_
from .utilities import execution_path, run_all
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution... | manz/python-mapnik | test/python_tests/cairo_test.py | Python | lgpl-2.1 | 8,571 | 0.015634 |
from setuptools import setup
exec(open('mirror_seq/version.py').read())
LONG_DESCRIPTION = '''
Please visit the GitHub repo (https://github.com/Zymo-Research/mirror-seq) for detail information.
'''
INSTALL_REQUIRES = [
'pandas>=0.18.0',
'pysam>=0.9.0',
'cutadapt==1.9.1',
]
setup(name='mirror_seq',
v... | Zymo-Research/mirror-seq | setup.py | Python | apache-2.0 | 939 | 0.017039 |
#!/usr/bin/env python
import hal
class HandlerClass:
def on_led_change(self,hal_led,data=None):
'''
the gladevcp.change led had a transition
'''
if hal_led.hal_pin.get():
if self.halcomp["number"] > 0.0:
self.change_text.set_label("Insert too number %d"... | CalvinHsu1223/LinuxCNC-EtherCAT-HAL-Driver | configs/sim/remap/manual-toolchange-with-tool-length-switch/python/gladevcp-handler.py | Python | gpl-2.0 | 801 | 0.014981 |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-dialogflow-cx | samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_sync.py | Python | apache-2.0 | 1,436 | 0.000696 |
import sys
import re
def cleancss(text):
text=re.compile('\s+').sub(' ', text)
text=re.compile('\s*(?P<a>,|:)\s*').sub('\g<a> ', text)
text=re.compile('\s*;\s*').sub(';\n ', text)
text=re.compile('\s*\{\s*').sub(' {\n ', text)
text=re.compile('\s*\}\s*').sub('\n}\n\n', text)
return text
... | trosa/forca | scripts/cleanhtml.py | Python | gpl-2.0 | 2,334 | 0.065981 |
#!/usr/bin/env python2
# coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper 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 you... | idl3r/Ropper | ropperapp/loaders/pe_intern/__init__.py | Python | gpl-2.0 | 729 | 0 |
class VectorizableBackedModel(object):
r"""
Mixin for models constructed from a set of :map:`Vectorizable` objects.
Supports models for which visualizing the meaning of a set of components
is trivial.
Requires that the following methods are implemented:
1. `component_vector(index)`
2. `in... | yuxiang-zhou/menpo | menpo/model/vectorizable.py | Python | bsd-3-clause | 6,200 | 0.000484 |
###
# Copyright 2011 Diamond Light Source Ltd.
#
# 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 agr... | erwindl0/python-rpc | org.eclipse.triquetrum.python.service/scripts/scisoftpy/python/pycomparisons.py | Python | epl-1.0 | 1,127 | 0.008873 |
# -*- coding: utf-8 -*-
'''
script.matchcenter - Football information for Kodi
A program addon that can be mapped to a key on your remote to display football information.
Livescores, Event details, Line-ups, League tables, next and previous matches by team. Follow what
others are saying about the match ... | enen92/script.matchcenter | resources/lib/tweets.py | Python | gpl-2.0 | 4,506 | 0.025522 |
"""This module tests events that are invoked by Cloud/Infra VMs."""
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.cloud.provider.gce import GCEProvider
from cfme.control.explorer.policies import VMControlPolicy
from cfme.infrastructure.provi... | izapolsk/integration_tests | cfme/tests/cloud_infra_common/test_events.py | Python | gpl-2.0 | 3,523 | 0.001419 |
# coding: utf-8
"""
>>> from pyun import *
>>> yun = YunBridge('192.168.2.9')
>>> yun.pinMode(13, INPUT)
'input'
>>> yun.digitalRead(13)
0
>>> yun.digitalWrite(13, 1)
1
>>> yun.digitalWrite(13, 0)
0
>>> 0 <= yun.analogRead(5) < 1024
True
"""
import doctest
doctest.te... | oturing/pyun | pyun_tests.py | Python | mit | 373 | 0 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | sevein/archivematica | src/dashboard/src/components/ingest/views_NormalizationReport.py | Python | agpl-3.0 | 4,152 | 0.007225 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['PolyTrend'] , ['Seasonal_Minute'] , ['NoAR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_Seasonal_Minute_NoAR.py | Python | bsd-3-clause | 161 | 0.049689 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-29 01:58
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('magic', '0006_auto_20170928_2238'),
]
o... | Angoreher/xcero | magic/migrations/0007_auto_20170928_2258.py | Python | mit | 2,691 | 0.004088 |
# -*- coding: utf-8 -*-
# Page model for Intel->Chargeback->Rates.
from . import ChargebackView
from cached_property import cached_property
from navmazing import NavigateToSibling, NavigateToAttribute
from utils.appliance import Navigatable
from utils.appliance.implementations.ui import navigator, navigate_to, CFMENav... | jteehan/cfme_tests | cfme/intelligence/chargeback/rates.py | Python | gpl-2.0 | 9,761 | 0.001332 |
#PART 1: Terminology
#1) Give 3 examples of boolean expressions.
#a) "apple" == "apple"
#b) 1 != 1
#c) 5 >= 6
#2) What does 'return' do?
#'Return' returns a value. It can be used after an calculation is
#executed. When the python interpreter solves a math problem, you can
#"return" the value back into the interpreter... | jaejun1679-cmis/jaejun1679-cmis-cs2 | cs2quiz2.py | Python | cc0-1.0 | 2,209 | 0.024898 |
# -*- coding: utf-8 -*-
"""
# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U
#
# This file is part of Orion Context Broker.
#
# Orion Context Broker is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foun... | gavioto/fiware-orion | test/acceptance/lettuce/integration/steps_lib/ngsi_request.py | Python | agpl-3.0 | 5,069 | 0.004933 |
"""
spells.py
Python recipes to solve frequently requested tasks with Stimfit.
You can find a complete description of these functions in the
Stimfit online documentation (http://www.stimfit.org/doc/sphinx/index.html)
Check "The Stimfit Book of Spells" for details.
Authors: Jose Guzman, Alois Schloegl and Christoph S... | JoseGuzman/stimfit | src/stimfit/py/spells.py | Python | gpl-2.0 | 18,106 | 0.011046 |
from qit.base.bool import Bool
from qit.base.struct import Struct
from qit.domains.domain import Domain
from qit.domains.iterator import Iterator
from qit.base.function import Function
from qit.functions.int import multiplication_n
class Product(Domain):
""" Cartesian product of domains """
def __init__(self... | spirali/qit | src/qit/domains/product.py | Python | gpl-3.0 | 3,854 | 0.002076 |
# 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/.
"""
Audit groups and removes inactive users.
"""
import datetime
from django.contrib.auth.models import Group, User
fr... | lonnen/socorro | webapp-django/crashstats/authentication/management/commands/auditgroups.py | Python | mpl-2.0 | 4,373 | 0.000686 |
# Note: run this server by using python2.7 instead of python3.2
from asyncore import dispatcher
from asynchat import async_chat
import socket, asyncore
IP = ''
PORT = 5555
SEP = '\n'
class ChatSession(async_chat):
"""
A simple chat session corresponding to a client
"""
def __init__(self,sock):
async_chat.__init... | justasabc/python_tutorials | project/chat/chatserver.py | Python | gpl-3.0 | 1,221 | 0.039312 |
def genbox(i):
i = int(i)
def draw(size, yc, xc):
y = yc
for _ in range(0,size):
if _ == 0 or _ == size-1:
x = xc
i = 0
while i < size:
if not g[_+y][x]=="x": g[_+y][x] = "x"
x += 2
i+=1
else:
if not g[_+y][xc]=="x": g[_+y][xc... | bearbear12345/school_SDD_prelimYear | Assessments/AS4 - NCSS Python Programming Challenge/NCSS Challenge (Advanced) 2016/1.2.3 - Box in a Box.py | Python | gpl-3.0 | 736 | 0.046196 |
from turtle import *
from random import *
speed(0)
colormode(255)
for side_n in range(15,2,-1):
color((randint(1, 255),randint(1, 255),randint(1, 255)),(randint(1, 255),randint(1, 255),randint(1, 255)))
begin_fill()
for i in range(side_n):
forward(100)
left(360/side_n)
end_fill()
| hanamvu/C4E11 | SS1/tur_a_circle.py | Python | gpl-3.0 | 313 | 0.025559 |
# Generated by Django 2.2.1 on 2019-09-19 11:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dojo', '0021_cve_index'),
]
operations = [
migrations.AddField(
model_name='system_settings',
name='credentials',
... | rackerlabs/django-DefectDojo | dojo/db_migrations/0022_google_sheet_sync_additions.py | Python | bsd-3-clause | 963 | 0 |
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | ctiller/grpc | tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py | Python | apache-2.0 | 3,227 | 0 |
#!/usr/bin/env python
''' flashbake - wrapper script that will get installed by setup.py into the execution path '''
# copyright 2009 Thomas Gideon
#
# This file is part of flashbake.
#
# flashbake is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | commandline/flashbake | src/flashbake/console.py | Python | gpl-3.0 | 11,505 | 0.005389 |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Aleksandar Topuzović <aleksandar.topuzovic@gmail.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrictio... | atopuzov/pyzebos | setup.py | Python | mit | 2,544 | 0.00118 |
"""
Name : Stegano Extract and Read File From Image
Created By : Agus Makmun (Summon Agus)
Blog : bloggersmart.net - python.web.id
License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Documentation : https://github.com/agusmakmun/Some-Examples-of-Simple-Python-Script/
"... | agusmakmun/Some-Examples-of-Simple-Python-Script | Stegano-Extract-and-Read-File-From-Image/script.py | Python | agpl-3.0 | 2,974 | 0.025891 |
import numpy
import six
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class NegativeSamplingFunction(function.Function):
def __init__(self, sampler, sample_size):
self.sampler = sampler
self.sample_size = sample_size
def _make_samples(self, t):
... | AlpacaDB/chainer | chainer/functions/loss/negative_sampling.py | Python | mit | 6,667 | 0 |
input = """
p24|p8|not_p15:-p7,p2,not p25.
p11|not_p20|p8|not_p15:-p24,p2.
p3|p20|p18|p3:-p1,not p22.
not_p5|not_p5|not_p19|p22.
p1|p12|p2|not_p16:-not p23,not p3.
p3|not_p20|p18:-p13,not p22,not p14.
p17|p12|p8|not_p8.
p15|not_p22|p24|not_p12.
not_p21|p20|p18:-p1,not p22.
p24|p9|p24|not_p22:-p12,p23.
not_p2|... | Yarrick13/hwasp | tests/asp/gringo/modelchecker.046.test.py | Python | apache-2.0 | 186,113 | 0.00029 |
""" test positional based indexing with iloc """
from datetime import datetime
import re
from warnings import (
catch_warnings,
simplefilter,
)
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
NA,
Categorical,
CategoricalDtype,
DataFrame,
In... | rs2/pandas | pandas/tests/indexing/test_iloc.py | Python | bsd-3-clause | 46,354 | 0.001079 |
#!/usr/bin/env python
#########################################################################################
# KLEE-Unit
# Author: Jacob Torrey
# Date: 3/15/2016
#
# Script to auto-generate test harness and execute symbolically with KLEE for a passed C
# file
########################################################... | ranok/sledgehammer | klee-unit/klee-unit.py | Python | mit | 4,806 | 0.007491 |
sandwich_orders = ['Bacon','Bacon, egg and cheese','Bagel toast','pastrami','pastrami','pastrami']
print ('pastrami sandwich was sold out')
finished_sandwiches = []
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
print(sandwich_orders) | lluxury/pcc_exercise | 07/pastrami.py | Python | mit | 265 | 0.030189 |
#! /usr/bin/python
# Version info: $Id: NonLinearFit2D.py 230 2010-06-30 20:20:14Z zunzun.com $
# the pythonequations base is located up one directory from the top-level examples
# directory, go up one directory in the path from there for the import to work properly
import sys, os
if os.path.join(sys.path[0][:sys.p... | JMoravec/unkRadnet | zunzunCode/pythonequations/Examples/SimpleExamples/NonLinearFit2D.py | Python | bsd-3-clause | 1,888 | 0.009534 |
import lib.result_functions_file as RFF
import lib.maglib as MSG
import os
#这个库是统计各个词语的出现次数,并显示
#这是tieba-zhuaqu项目的用户端基本插件
def satisticWord(word,datalist):
os.system('cls')
print('>>>>>开始统计【',word,'】出现次数....')
sum=1
mlist=[]
for item in datalist:
if item.find(word) != -1:
sum+=1... | ankanch/tieba-zhuaqu | user-application/KCrawlerControal/Debug/plugins/trash/singleword.py | Python | gpl-3.0 | 978 | 0.032663 |
import pytest
np = pytest.importorskip("numpy")
npt = pytest.importorskip("numpy.testing")
import networkx as nx
from .base_test import BaseTestAttributeMixing, BaseTestDegreeMixing
class TestDegreeMixingDict(BaseTestDegreeMixing):
def test_degree_mixing_dict_undirected(self):
d = nx.degree_mixing_dict... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/assortativity/tests/test_mixing.py | Python | gpl-3.0 | 5,415 | 0.000923 |
import collections
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.core.cache import cache
from django.contrib import messages
from django.shortcuts import render, redirect
from django.db import transaction
from django.db.models import Q
from funfactory.urlresolvers imp... | zofuthan/airmozilla | airmozilla/manage/views/users.py | Python | bsd-3-clause | 3,960 | 0 |
import pytest
import numpy as np
from numpy import testing
from clifford import Cl
from clifford.tools import orthoFrames2Versor as of2v
from clifford._numba_utils import DISABLE_JIT
from clifford import tools
from . import rng # noqa: F401
too_slow_without_jit = pytest.mark.skipif(
DISABLE_JIT, reason="test ... | arsenovic/clifford | clifford/test/test_tools.py | Python | bsd-3-clause | 8,422 | 0.0019 |
# Copyright (c) 2014 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 applicable law or agreed to ... | ramineni/my_congress | congress/tests/dse2/test_datasource.py | Python | apache-2.0 | 8,631 | 0 |
# 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... | leezu/mxnet | python/mxnet/gluon/contrib/estimator/event_handler.py | Python | apache-2.0 | 33,227 | 0.002889 |
import clr
clr.AddReference("mscorlib")
clr.AddReference("PresentationFramework")
from System.Windows import Application
from System.IO import StreamReader
from System.Threading import Thread
from System.Windows.Markup import XamlReader
from System.Reflection import Assembly
from System import Action
class ViewModel:... | mrrodd/Samples | DLR-IronPython/IronPython.UI/Scripts/SampleScript02.py | Python | lgpl-3.0 | 1,026 | 0.024366 |
# Copyright 2016 Adler Brediks Medrado
#
# 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... | adlermedrado/abbr | setup.py | Python | apache-2.0 | 1,346 | 0 |
__author__ = 'tsungyi'
from __future__ import print_function
import numpy as np
import datetime
import time
from collections import defaultdict
import mask
import copy
class COCOeval:
# Interface for evaluating detection on the Microsoft COCO dataset.
#
# The usage for CocoEval is as follows:
# cocoG... | rishita/mxnet | example/rcnn/rcnn/pycocotools/cocoeval.py | Python | apache-2.0 | 19,780 | 0.009757 |
#! /usr/bin/python2
# -*- coding: utf-8; -*-
#
# (c) 2013 booya (http://booya.at)
#
# This file is part of the OpenGlider project.
#
# OpenGlider 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 ... | hiaselhans/OpenGlider | tests/visual_test_flatten_glider.py | Python | gpl-3.0 | 4,457 | 0.004487 |
__author__ = 'McDaemon'
from models import Weather
from rest_framework import serializers
class WeatherSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Weather
fields = ('datum', 'stadt', 'anbieter', 'anbieter', 'wetter', 'tagestemperatur', 'einheit', 'kondition'... | Benxxen/pythonwetter | pythonwetter/serializers.py | Python | mit | 385 | 0.007792 |
"""Setup the application's CLI commands."""
from example import app, db
@app.manage
def hello(name, upper=False):
"""Write command help text here.
:param name: Write your name
:param upper: Use uppercase
"""
greetings = f"Hello {name}!"
if upper:
greetings = greetings.upper()
p... | klen/muffin-example | example/manage.py | Python | mit | 817 | 0.001224 |
# -*- coding: utf-8 -*-
def social_eyebrow(entity, argument):
return True
#- Fine Funzione -
| Onirik79/aaritmud | src/socials/social_eyebrow.py | Python | gpl-2.0 | 98 | 0.010204 |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2021] EMBL-European Bioinformatics Institute
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... | RNAcentral/rnacentral-import-pipeline | rnacentral_pipeline/cli/cpat.py | Python | apache-2.0 | 1,587 | 0 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | diogocs1/comps | web/addons/account/wizard/account_report_common_partner.py | Python | apache-2.0 | 1,999 | 0.004502 |
"""
Configuration tasks
This module provides tools to load yaml configuration files.
"""
import os
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.colors import red, green
try:
import yaml
except ImportError:
print(red('pyYaml module not installed. Run the following commands t... | hglattergotz/sfdeploy | bin/config.py | Python | mit | 2,796 | 0.002146 |
import sys
def updt(total, progress, extra=""):
"""
Displays or updates a console progress bar.
Original source: https://stackoverflow.com/a/15860757/1391441
"""
barLength, status = 20, ""
progress = float(progress) / float(total)
if progress >= 1.:
progress, status = 1, "\r\n"
... | asteca/ASteCA | packages/update_progress.py | Python | gpl-3.0 | 553 | 0 |
# -*- coding: utf-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... | repotvsupertuga/tvsupertuga.repository | script.module.openscrapers/lib/openscrapers/sources_openscrapers/en/coolmoviezone.py | Python | gpl-2.0 | 2,749 | 0.001091 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0003_auto_20150618_1121'),
]
operations = [
migrations.AddField(
model_name='project',
n... | gdebure/cream | projects/migrations/0004_project_status.py | Python | gpl-3.0 | 466 | 0 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
import sys
if sys.version_info[0] >= 3:
basestr = str
else:
basestr = basestring
from .converters import (Lang... | clinton-hall/nzbToMedia | libs/common/babelfish/__init__.py | Python | gpl-3.0 | 761 | 0.003942 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from django import forms
from django.core.mail import send_mail
from django.template import Context
from ProyectoDeGrado.settings import MEDIA_ROOT
from apps.administrador.models import *
from django.contrib.auth.models import User
class PerfilForm(forms.M... | edwar/repositio.com | ProyectoDeGrado/forms.py | Python | mit | 2,750 | 0.016364 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.