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 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of PyDownTV.
#
# PyDownTV 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) a... | aabilio/PyDownTV | Servers/tve.py | Python | gpl-3.0 | 6,285 | 0.006712 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pokemongo_bot import inventory
from pokemongo_bot.constants import Constants
from pokemongo_bot.walkers.walker_factory import walker_factory
from pokemongo_bot.worker_result import WorkerResult
from pokemongo_bot.base_task import BaseTask
from utils ... | dhluong90/PokemonGo-Bot | pokemongo_bot/cell_workers/move_to_fort.py | Python | mit | 5,477 | 0.003104 |
# This file is part of blender_io_f3b. blender_io_f3b 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY;... | f3b/blender_f3b_exporter | src/f3b_export.py | Python | gpl-3.0 | 48,666 | 0.01426 |
from __future__ import print_function
import side_effect
def useless_function(first, second):
print("I have the wrong number of arguments.")
def function(frame, bp_loc, dict):
side_effect.bktptcmd = "function was here"
def another_function(frame, bp_loc, extra_args, dict):
se_value = extra_args.GetValueF... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/functionalities/breakpoint/breakpoint_command/bktptcmd.py | Python | bsd-3-clause | 812 | 0.006158 |
from djangosanetesting.cases import HttpTestCase
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core import mail
from accounts.tests import testdata
class TestResetPassword(HttpTestCase):
def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*a... | sramana/pysis | apps/passwords/tests/test_reset_password.py | Python | unlicense | 1,236 | 0.004045 |
'''
Created on Feb 02, 2014
@author: Mark V Systems Limited
(c) Copyright 2014 Mark V Systems Limited, All rights reserved.
'''
try:
import regex as re
except ImportError:
import re
from collections import defaultdict
import os, io, json
from datetime import datetime, timedelta
from arelle import XbrlConst
fro... | Arelle/Arelle | arelle/TableStructure.py | Python | apache-2.0 | 28,566 | 0.005776 |
from __future__ import print_function
__author__ = 'breddels'
# import astropy.vo.samp as sampy
import platform
import vaex.utils
import sys
import threading
import vaex.export
import vaex.utils
import vaex.promise
import vaex.settings
import vaex.remote
import psutil
from vaex.parallelize import parallelize
from vae... | maartenbreddels/vaex | packages/vaex-ui/vaex/ui/main.py | Python | mit | 89,877 | 0.002348 |
import uuid
from motey.models.image import Image
from motey.models.service_state import ServiceState
class Service(object):
"""
Model object. Represent a service.
A service can have multiple states, action types and service types.
"""
def __init__(self, service_name, images, id=uuid.uuid4().hex,... | Neoklosch/Motey | motey/models/service.py | Python | apache-2.0 | 2,107 | 0.000949 |
#!/usr/env python
# -*- coding: utf-8 -*-
__author__ = 'eduardo'
import unittest
import uuid
from . import config
from ..model import cs
from cassandra.cluster import Session
class TestCassandra(unittest.TestCase):
"""
Test interação com o banco de dados Cassandra
"""
def setUp(self):
"""
... | eduardosan/csindex | csindex/tests/test_cassandra.py | Python | gpl-2.0 | 2,692 | 0.000373 |
# Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | leighpauls/k2cro4 | third_party/WebKit/Tools/Scripts/webkitpy/common/net/credentials_unittest.py | Python | bsd-3-clause | 9,141 | 0.002297 |
import sublime_plugin
import sublime
SUB_RE = '\d\d:\d\d:\d\d,\d\d\d'
def find_subtitles(view):
subs = []
sel = view.sel()
for match in view.find_all(SUB_RE):
if sel.contains(match):
subs.append(match)
# sel.clear()
# sel.add_all(subs)
return subs
def convert_to_time(s... | apiad/sublime-subtitle-sync | subtitle_sync.py | Python | mit | 1,030 | 0.009709 |
# 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... | nanditav/15712-TensorFlow | tensorflow/python/kernel_tests/resource_variable_ops_test.py | Python | apache-2.0 | 3,885 | 0.008752 |
# Copyright 2016 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, ... | quom/google-cloud-python | runtimeconfig/unit_tests/test_variable.py | Python | apache-2.0 | 7,382 | 0.000135 |
#!/usr/bin/env python
def get_db(db_name):
from pymongo import MongoClient
client = MongoClient('localhost:27017')
db = client[db_name]
return db
def make_pipeline():
# complete the aggregation pipeline
match = {"$match": {"created": {"$exists": 1}}}
group = {"$group": {"_id": "$created.... | MayukhSobo/OpenStreetMap | test/test.py | Python | mit | 799 | 0 |
import sys
import argparse
def parseArgument():
# Parse the input
parser=argparse.ArgumentParser(description=\
"Filter Homer motifs to remove those with a low % of hits in target sites and a low value of target/background")
parser.add_argument("--HomerMotifsFileName", required=True,\
help='Name of file with H... | imk1/IMKTFBindingCode | filterHomerMotifs.py | Python | mit | 2,184 | 0.028388 |
"""
word_counter
Provides helper functions for word counts.
"""
import os
import re
from collections import Counter
STOPWORDS_FILE = os.path.join(os.path.dirname(__file__), "STOPWORDS")
# Get the frequencies of each word as a dictionary.
# strings = a list of strings, can be strings of any length/number of wo... | mjmeli/facebook-chat-word-cloud | facebook_wordcloud/word_counter.py | Python | mit | 2,049 | 0.00244 |
# encoding=utf-8
import codecs
import sys
from src.view.FileProcessingOutput import FileProcessingOutput
class FileProcessing():
def __init__(self):
self.fileProcessingOutput = FileProcessingOutput()
def read_input_file(self, file_path, file_type):
'''
Lectura de archivo y procesamie... | r4wd3r/VAGO | src/controller/FileProcessing.py | Python | gpl-2.0 | 2,276 | 0.004394 |
#
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
##############################################################################
# ... | ctuning/ck-env | soft/lib.opencv/customize.py | Python | bsd-3-clause | 8,458 | 0.033932 |
#!/usr/bin/env python
#
# Copyright (c) 2013, Thomas P. Robitaille
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | astrofrog/psrecord | setup.py | Python | bsd-2-clause | 2,302 | 0.001303 |
# -*- coding: utf-8 -*-
"""
quinoa.py
=========
Create QUINOA compressed dataset.
QUINOA (QUasi Integer Noise Offset Adjustment) compression is a lossy compression
algorithm for floating point data, and is similar to the RICE-based compression
technique that FPACK uses on floating point data.
The FITS compression pa... | telegraphic/fits2hdf | aadnc_benchmarks/quinoa_idea/quinoa.py | Python | mit | 4,834 | 0.005176 |
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | gam-phon/taiga-back | taiga/auth/tokens.py | Python | agpl-3.0 | 2,045 | 0 |
# Copyright (C) 2007-2010 Richard Lincoln
#
# PYPOWER 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.
#
# PYPOWER is distributed in the... | rwl/pyreto | pyreto/continuous/task.py | Python | gpl-3.0 | 6,830 | 0.00366 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This bot regenerates the page VEIDs
The following parameters are supported:
-debug If given, doesn't do any real changes, but only shows
what would have been changed.
"""
__version__ = '$Id: basic.py 4946 2008-01-29 14:58:25Z wikipedian $'... | sicekit/sicekit | robots/tool-list_networks.py | Python | mit | 2,437 | 0.0119 |
# -*- coding: utf8 -*-
__version__ = "$Revision$ $Date$"
__author__ = "Guillaume Bour <guillaume@bour.cc>"
__license__ = """
Copyright (C) 2010-2011, Guillaume Bour <guillaume@bour.cc>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License a... | gbour/Strawberry | strawberry/tag.py | Python | agpl-3.0 | 3,892 | 0.031346 |
# ----------------------------------------------------------------------------
# Copyright (c) 2015--, micronota development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ---------------------------------------------... | tkosciol/micronota | micronota/cli.py | Python | bsd-3-clause | 3,634 | 0 |
import gettext
class I18n:
"""
This class is used for internationalization without a specific language.
Objects can be stored as msgid from gettext or as str.
"""
def __init__(self, msg, isSTR=False):
if isSTR:
self.content = [msg]
else:
self.content = [self... | mgard/epater | i18n.py | Python | gpl-3.0 | 2,337 | 0.001712 |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import redirect, request
from indico.modules.categories.compat import compat_category
from ind... | indico/indico | indico/modules/categories/blueprint.py | Python | mit | 8,380 | 0.006683 |
# -*- coding: utf-8 -*-
# ===========================================================================
#
# Copyright (C) 2014 Samuel Masuy. All rights reserved.
# samuel.masuy@gmail.com
#
# ===========================================================================
"""
Calendar controller.
~~~~~~~~~~~~~~~~~~... | samuelmasuy/Concordia-Schedule-to-Gcal | app/scheduletogcal/calendar_controller.py | Python | gpl-2.0 | 5,318 | 0 |
"""tweetme URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | dubirajara/django_my_ideas_wall | myideas/api/urls.py | Python | agpl-3.0 | 931 | 0 |
#!/usr/bin/env python
"""Messages are written to stdout instead of the normal stderr.
"""
import logging
from themelog import init_log
logger = logging.getLogger()
init_log(stdout=True)
logger.debug('This is a debug message')
logger.info('This is a info message')
logger.warning('This is a warning message')
logger.erro... | mjem/themelog | tests/test_stdout.py | Python | apache-2.0 | 395 | 0 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | dvliman/jaikuengine | .google_appengine/google/appengine/tools/devappserver2/module_test.py | Python | apache-2.0 | 90,007 | 0.002822 |
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import xgboost as xgb
import argparse
from os import path
import os
from hyperopt import fmin, tpe, hp, STATUS_OK, Trials
from utils import *
import pi... | jingxiang-li/kaggle-yelp | model/level3_model.py | Python | mit | 5,368 | 0 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | whitepages/nova | nova/tests/functional/api_sample_tests/test_shelve.py | Python | apache-2.0 | 2,280 | 0 |
# -*- coding: utf-8 -*-
# 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 o... | javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/google/api/config_change_pb2.py | Python | apache-2.0 | 8,266 | 0.000484 |
from __future__ import unicode_literals
import logging
import re
from datetime import datetime
from bson import ObjectId
from bson.json_util import loads
from flask import request
from flask_classy import route
from flask_login import current_user
from core import investigation
from core.entities import Entity
from ... | yeti-platform/yeti | core/web/api/investigation.py | Python | apache-2.0 | 5,579 | 0.001255 |
# -*- coding: utf-8 -*-
# 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 your option) any later version.
from tests import TestCase, mkstemp
import os
... | elbeardmorez/quodlibet | quodlibet/tests/test_qltk_cbes.py | Python | gpl-2.0 | 4,802 | 0.000208 |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (c) 2016 David Topping.
# All Rights Reserved.
# This file is part of umansysprop.
#
# umansysprop 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, eit... | loftytopping/UManSysProp_public | umansysprop/partition_models.py | Python | gpl-3.0 | 17,483 | 0.004519 |
# -*- coding:utf-8 -*-
# Cyril Fournier
# 10/08/2016
# =======================================
# Update the trackList.json of a JBrowse,
# by adding category, description, color
# =======================================
import os,sys
import json
from Hero import Hero
from Monster import Monster
from Item import Item... | Jidgdoi/MythologyQuest | src/JsonParser.py | Python | gpl-3.0 | 1,734 | 0.03291 |
# -*- coding: utf-8 -*-
"""
Given an array of integers, every element appears twice except for one. Find
that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it
without using extra memory?
"""
__author__ = 'yelongyu1024@gmail.com'
class Solution(object):
def __init_... | yelongyu/leetcode | 136.single_number.py | Python | apache-2.0 | 801 | 0 |
import numpy as np
from ._utils import move_axis_to_end, suppress_warnings
def brier_score(observations, forecasts):
"""
Calculate the Brier score (BS)
The Brier score (BS) scores binary forecasts $k \in \{0, 1\}$,
..math:
BS(p, k) = (p_1 - k)^2,
where $p_1$ is the forecast probability... | TheClimateCorporation/properscoring | properscoring/_brier.py | Python | apache-2.0 | 7,326 | 0.000956 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import random
from collections impo... | hrayr-artunyan/shuup | shuup/front/basket/objects.py | Python | agpl-3.0 | 14,937 | 0.001674 |
import os
import posixpath
import random
import string
import logging
import tempfile
import time
from .extract_images import ExtractImages
logger = logging.getLogger(__name__)
class ExtractImagesToS3(ExtractImages):
'''
This KnowledgePostProcessor subclass extracts images from posts to S3. It
is desig... | airbnb/knowledge-repo | knowledge_repo/postprocessors/extract_images_to_s3.py | Python | apache-2.0 | 2,903 | 0.001033 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'unique_cards'
db.delete_table(u'card_game_unique_cards'... | AndrewRook/game_designer | card_game/migrations/0002_auto__del_unique_cards__del_cards__del_versions__del_unique_versions__.py | Python | mit | 7,131 | 0.006731 |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
from phystricks import *
def VGZooJnvvZc():
n_ssfig=6
pspictQuestion,figQuestion = SinglePicture("TangenteQuestionOM",script_filename="RechercheTangente")
pspictDetail,figDetail = SinglePicture("TangenteDetailOM",script_filename="RechercheTang... | Naereen/mazhe | phystricksRechercheTangente.py | Python | gpl-3.0 | 3,050 | 0.041981 |
from .client import Client
from .auth import OAuth
__version__ = '0.0.8'
| steinitzu/spotify-api | spotify/__init__.py | Python | mit | 75 | 0.013333 |
'''Contains AJAX apps of mother app'''
| piotrmaslanka/bellum | mother/ajax/__init__.py | Python | agpl-3.0 | 39 | 0 |
# -*- coding: utf-8 -*-
# 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_vizier_service_complete_trial_sync.py | Python | apache-2.0 | 1,480 | 0.000676 |
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | nwjs/chromium.src | third_party/blink/web_tests/http/tests/websocket/echo-with-no-extension_wsh.py | Python | bsd-3-clause | 2,057 | 0 |
# coding: utf-8
#--------------//////////----------------------
#Projeto Criado por: Lário Diniz
#Contatos: developer.lario@gmail.com
#Data: 06/08/2015
#--------------//////////----------------------
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugett... | lariodiniz/GrimorioTRPG | grimorio/core/models.py | Python | gpl-2.0 | 3,520 | 0.011691 |
class YowConstants:
DOMAIN = "s.whatsapp.net"
ENDPOINTS = (
("e1.whatsapp.net", 443),
("e2.whatsapp.net", 443),
("e3.whatsapp.net", 443),
("e4.whatsapp.net", 443),
("e5.whatsapp.net", 443),
("e6.whatsapp.net", 443),
("e7.whatsapp.net", 443),
... | mangadul/WhatsAppy | yowsup/common/constants.py | Python | gpl-3.0 | 837 | 0.003584 |
import time
import threading
from time import gmtime, strftime
from muntjac.api import Button, VerticalLayout, Label, TextArea
from muntjac.terminal.theme_resource import ThemeResource
from muntjac.ui.button import IClickListener
class JSApiExample(VerticalLayout):
def __init__(self):
super(JSApiExamp... | rwl/muntjac | muntjac/demo/sampler/features/commons/JSApiExample.py | Python | apache-2.0 | 4,137 | 0.000242 |
arr=[]
n=int(input("Please enter the number of elements and then the actual elements themselves!"))
for i in range(n):
x=int(input())
arr.append(x)
for i in range(n-1):
for j in range(0,n-i-1):
if arr[j]>arr[j+1]:
arr[j],arr[j+1]=arr[j+1],arr[j]
print("The sorted arr is",arr)
| WebClub-NITK/Hacktoberfest-2k17 | Sorting/Bubble_Sort/nishanthebbar2011.py | Python | mit | 318 | 0.034591 |
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'resources', 'lib'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'resources', 'lib', 'pyscraper'))
from matcher import Matcher
import util as util
import unittest
class TestM... | bruny/romcollectionbrowser | resources/tests/test_matcher.py | Python | gpl-2.0 | 2,187 | 0.037401 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
DOCUMENTATION = r'''
---
module: bigiq_regkey_license_as... | F5Networks/f5-ansible-modules | ansible_collections/f5networks/f5_modules/plugins/modules/bigiq_regkey_license_assignment.py | Python | mit | 19,962 | 0.001904 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
from pants.backend.codegen.thrift.lib.thrift import Thrift
from pant... | foursquare/pants | contrib/go/src/python/pants/contrib/go/tasks/go_thrift_gen.py | Python | apache-2.0 | 7,092 | 0.010011 |
import re
import logging
from autotest.client.shared import error
from virttest import utils_v2v
def run(test, params, env):
"""
Check VM after conversion
"""
target = params.get('target')
check_obj = utils_v2v.LinuxVMCheck(test, params, env)
logging.info("Check guest os info")
os_info =... | rbian/tp-libvirt | v2v/tests/linux_vm_check.py | Python | gpl-2.0 | 3,241 | 0.000309 |
import pytest
@pytest.fixture
def create_repo(remote, token):
"""
Creates a Repository "testrepo0" with a mirror "http://www.sample.com/path/to/some/repo" and the attribute
"mirror_locally=0".
:param remote: The xmlrpc object to connect to.
:param token: The token to authenticate against the remo... | cobbler/cobbler | tests/xmlrpcapi/repo_test.py | Python | gpl-2.0 | 3,559 | 0.000843 |
#!/usr/bin/env python
"""
6809 unittests
~~~~~~~~~~~~~~
Test CPU with BASIC Interpreter from simple6809 ROM.
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014-2015 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
... | jedie/DragonPy | dragonpy/tests/test_BASIC_simple09.py | Python | gpl-3.0 | 25,042 | 0.000958 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | abhikeshav/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_syslog_oper.py | Python | apache-2.0 | 26,188 | 0.017413 |
# -*- coding: utf-8 -*-
try:
import json
except ImportError:
import simplejson as json
import calendar
import datetime
import decimal
from functools import partial
import locale
import math
import re
import time
import dateutil
import numpy as np
import pytest
import pytz
import pandas._libs.json as ujson
fr... | GuessWhoSamFoo/pandas | pandas/tests/io/json/test_ujson.py | Python | bsd-3-clause | 38,511 | 0 |
import logging
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from survey.exporter.tex.question2tex import Question2Tex
LOGGER = logging.getLogger(__name__)
class Question2TexChart(Question2Tex):
"""
This class permit to generate latex code directly from the Questi... | Pierre-Sassoulas/django-survey | survey/exporter/tex/question2tex_chart.py | Python | agpl-3.0 | 4,424 | 0.000226 |
from django.views.decorators.cache import never_cache
from django.views.generic.base import RedirectView
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse_lazy
from C4CApplication.views.utils import create_user
class RemoveFavoriteRedirectView(RedirectView):
... | dsarkozi/care4care-sdp-grp4 | Care4Care/C4CApplication/views/RemoveFavoriteRedirectView.py | Python | agpl-3.0 | 926 | 0.007559 |
# 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/GaussPoints/C1.py | Python | lgpl-2.1 | 2,013 | 0.002981 |
"""
<Program Name>
deploy_server_final.py
<Started>
July 2009
<Author>
n2k8000@u.washington.edu
Konstantin Pik
<Purpose>
This is a fully automated webserver that handles only certain web requests. The server assumes files exist
in the locations that they're supposed to exist, and the files are placed th... | sburnett/seattle | deploymentscripts/attic/deploy_server_final.py | Python | mit | 13,882 | 0.01592 |
from django.test import TestCase
from ..models import l_artist_release
class test_l_artist_release(TestCase):
def setUp(self):
"""
Set up the test subject.
"""
self.subject = l_artist_release()
def test__l_artist_release__instance(self):
self.assertIsInstance(self.subj... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/tests/test_l_artist_release.py | Python | gpl-2.0 | 451 | 0 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s12_gen1.if... | obi-two/Rebelion | data/scripts/templates/object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s12_gen1.py | Python | mit | 497 | 0.044266 |
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Parts Copyright 2016 C. Strassburg (lib.utils) c.strassburg@gmx.de
# Copyright 2017- Serge Wagener serge@wagener.family
##... | Foxi352/netlib | network.py | Python | gpl-3.0 | 39,974 | 0.003402 |
# -*- coding: utf-8 -*-
import os
import signal
import time
import subprocess
import pytest
class Mode(object):
STANDALONE = "standalone.sh"
DOMAIN = "domain.sh"
class InfinispanServer(object):
DOWNLOAD_URL = "http://downloads.jboss.org/infinispan/%s.Final/"
ZIP_NAME = "infinispan-server-%s.Final-b... | VaclavDedik/infinispan-py | tests/func/server.py | Python | mit | 2,231 | 0 |
# created by Chirath R, chirath.02@gmail.com
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from workshop.views import WorkshopRegistrationListView, WorkshopDetailView, WorkshopRegistrationUpdateView, \
WorkshopRegisterFormVi... | amfoss/fosswebsite | workshop/urls.py | Python | mit | 2,168 | 0.007841 |
"""LISY System 1/80 platform."""
| missionpinball/mpf | mpf/platforms/lisy/__init__.py | Python | mit | 33 | 0 |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch
)
fro... | stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/states/selinux_test.py | Python | apache-2.0 | 5,176 | 0.000193 |
"""
This module contains a class, :class:`Query`, that was implemented to provide
users with means to programmatically query the
`ACS Zeropoints Calculator <https://acszeropoints.stsci.edu>`_.
The API works by submitting requests to the
ACS Zeropoints Calculator referenced above and hence, it is only valid for ACS
spec... | jhunkeler/acstools | acstools/acszpt.py | Python | bsd-3-clause | 14,427 | 0.000416 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, getdate
from frappe import _
from erpnext.utilities.transaction_base import delete_events
from frappe.m... | indictranstech/focal-erpnext | projects/doctype/project/project.py | Python | agpl-3.0 | 2,450 | 0.023673 |
# Copyright (c) 2015-2017 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | retr0h/molecule | molecule/util.py | Python | mit | 5,717 | 0.00035 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, re, time, sys
import hashlib, bencode
import requests
from bs4 import BeautifulSoup
reload(sys)
#print sys.getdefaultencoding()
#sys.setdefaultencoding('utf-8')
print sys.getdefaultencoding()
def parse_tor(file):
bt_path = {}
bt_... | dannywxh/mypy | MyPys/common.py | Python | apache-2.0 | 3,687 | 0.034014 |
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
import sys
from pyasn1.compat.octets import null
from pysnmp.proto import rfc3411, error
from pysnmp.proto.api import v1, v2c # backend is always SMIv2 compliant
from pysnm... | filippog/pysnmp | pysnmp/entity/rfc3413/ntfrcv.py | Python | bsd-3-clause | 4,010 | 0.001746 |
#!/usr/bin/env python
import csv
import getopt
import os
import sys
from ConfigParser import ConfigParser
from tempfile import NamedTemporaryFile
# Defaults
VERBOSE = True
CONFIG_SECTION = 'common'
DEFAULT_CONFIG_FILE = 'batch.cfg'
DEFAULT_RECIPIENTS_FILE = 'recipients.csv'
DEFAULT_MESSAGE_FILE = 'message.txt'
# Com... | nmalkin/multimail | multimail.py | Python | gpl-3.0 | 4,444 | 0.006076 |
from django.contrib import admin
from imager_images.models import Photo, Album
# class PhotoAdmin(admin.ModelAdmin):
# list_display = ("title", "description")
# fields = ('title',
# 'description',
# 'published',
# 'owner')
# class AlbumAdmin(admin.ModelAdmin):
# ... | midfies/django-imager | imagersite/imager_images/admin.py | Python | mit | 728 | 0 |
from django.apps import AppConfig
class CalcConfig(AppConfig):
name = 'apps.calc'
| IT-PM-OpenAdaptronik/Webapp | apps/calc/apps.py | Python | mit | 88 | 0 |
# Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2020 Nick Boultbee
#
# 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 yo... | Mellthas/quodlibet | quodlibet/qltk/renamefiles.py | Python | gpl-2.0 | 18,543 | 0 |
#-----------------------------------------------------------------------------
# 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/core/property/numeric.py | Python | bsd-3-clause | 8,603 | 0.003487 |
def zip(*arg):
Result = []
Check = 1
#check if every item in arg has the same length
for i in arg:
if len(i) != len(arg[0]):
print 'please make sure enter all items with the same length'
Check = 0
break
while (Check):
for j in range(0,len(arg[0])):... | DataMonster/Python | exer/zipunzip/zip.py | Python | unlicense | 1,230 | 0.034959 |
#!/usr/bin/env python3
# This source file is part of Obozrenie
# Copyright 2015 Artem Vorotnikov
# For more information, see https://github.com/obozrenie/obozrenie
# Obozrenie is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by th... | skybon/obozrenie | obozrenie/launch_gtk.py | Python | gpl-3.0 | 1,061 | 0 |
class JointMotor():
def __init__(self, _callDevice, _readDevice):
self._callDevice = _callDevice
self._readDevice = _readDevice
self._angle = 0
def sendAngle(self, _angle):
self._callDevice(_angle)
self._angle = _angle
def getAngle(self):
return self._angl... | robocomp/learnbot | learnbot_dsl/Clients/Devices/JointMotor.py | Python | gpl-3.0 | 379 | 0 |
try:
from urllib.parse import parse_qsl, urlencode
except ImportError:
from urllib import urlencode
from urlparse import parse_qsl
import requests
class OAuth2Error(Exception):
pass
class OAuth2Client(object):
def __init__(self, request, consumer_key, consumer_secret,
access_tok... | houssemFat/bloodOn | bloodon/accounts/social/providers/oauth2/client.py | Python | mit | 2,095 | 0.000955 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-09-21 18:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('core', '0018_auto_20180921_1... | interlegis/saap | saap/core/migrations/0019_auto_20180921_1540.py | Python | gpl-3.0 | 943 | 0.002123 |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
args_linear = ['/openmp', '/O2', '/favor:INTEL64']
args_nonlinear = ['/openmp', '/O2', '/favor:INTEL64', '/fp:fast']
ext_modules = [
Extension('clpt_commons_bc1', ['clpt_commons_bc1.pyx'],
... | albertoferna/compmech | compmech/conecyl/clpt/setup_clpt_bc1.py | Python | bsd-3-clause | 472 | 0.021186 |
#!/usr/bin/python
#
# Copyright 2012 Lee Verberne <lee@blarg.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... | kafana/ubik | lib/ubik/rug/cli.py | Python | gpl-3.0 | 2,912 | 0.002747 |
"""wrapper for cmake tool"""
import subprocess
from subprocess import PIPE
import platform
from mod import log,util
from mod.tools import ninja
name = 'cmake'
platforms = ['linux', 'osx', 'win']
optional = False
not_found = 'please install cmake 2.8 or newer'
#--------------------------------------------------------... | code-disaster/fips | mod/tools/cmake.py | Python | mit | 4,302 | 0.009298 |
# Copyright 2016 Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | googleapis/protoc-java-resource-names-plugin | plugin/templates/resource_name.py | Python | bsd-3-clause | 13,100 | 0 |
#!/usr/bin/python
# This script is a slightly modified version of the original found at
#
# https://wiki.wxwidgets.org/Embedding_PNG_Images-Bin2c_In_Python
#
# without any copyright attribution so it is assumed it can be used under
# wxWindows licence as the rest of the wiki material.
import sys
import os
impor... | ric2b/Vivaldi-browser | update_notifier/thirdparty/wxWidgets/misc/scripts/png2c.py | Python | bsd-3-clause | 3,184 | 0.005653 |
import pickle
from revscoring.datasources import revision_oriented
from revscoring.dependencies import solve
from revscoring.languages import hungarian
from .util import compare_extraction
BAD = [
"anyad",
"anyád",
"anyádat",
"anyátok",
"anyátokat",
"apád",
"asd",
"balfasz",
"basz... | wiki-ai/revscoring | tests/languages/test_hungarian.py | Python | mit | 3,830 | 0 |
#!/usr/bin/env python
"""
crossref-client.py - Implement a tool for interaction with the api.crossref.org
Usage:
crossref-client.py -h | --help
crossref-client.py [-c]
Options:
-h --help Show the help message
-c --count-publishers Display the number of publishers available
... | indera/crossref-client | crossref-client.py | Python | mit | 1,731 | 0 |
import pygame, logging
from random import randint
from game import generate_random_level
class Target(pygame.sprite.Sprite):
def __init__(self, x, y, textures, color=(30,0,150), width=23, height=23):
super().__init__()
self.width = width
self.height = height
self.textures = texture... | RealOrangeOne/attack-on-blocks | target.py | Python | mit | 3,542 | 0.009881 |
def remove_exclamation_marks(s):
return s.replace('!', '')
| the-zebulan/CodeWars | katas/kyu_8/remove_exclamation_marks.py | Python | mit | 63 | 0 |
"""
Component to keep track of user controlled booleans for within automation.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_boolean/
"""
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_ICON, C... | tinloaf/home-assistant | homeassistant/components/input_boolean.py | Python | apache-2.0 | 3,609 | 0 |
import tornado.testing
from testexample import ExampleApp
class TestExampleApp(tornado.testing.AsyncHTTPTestCase,
tornado.testing.LogTrapTestCase):
def get_app(self):
return ExampleApp()
def test_home(self):
response = self.fetch('/')
self.assertEqual(response.cod... | wmalinowski/test-example | testexample/test/test_example_app.py | Python | unlicense | 442 | 0.002262 |
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.map_message_type import *
REQUEST_TYPE = MAP_EXECUTEONALLKEYS
RESPONSE_TYPE = 117
RETRYABLE... | cangencer/hazelcast-python-client | hazelcast/protocol/codec/map_execute_on_all_keys_codec.py | Python | apache-2.0 | 1,451 | 0.002068 |
from contextlib import contextmanager
from functools import wraps
from werkzeug.local import LocalProxy, LocalStack
_additional_ctx_stack = LocalStack()
__all__ = ("current_additions", "Additional", "AdditionalManager")
@LocalProxy
def current_additions():
"""
Proxy to the currently added requirements
... | justanr/flask-allows | src/flask_allows/additional.py | Python | mit | 5,469 | 0.000549 |
# Copyright (c) 2018 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 ... | openstack/networking-arista | networking_arista/tests/unit/ml2/security_groups/sg_test_base.py | Python | apache-2.0 | 3,145 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.