content stringlengths 7 928k | avg_line_length float64 3.5 33.8k | max_line_length int64 6 139k | alphanum_fraction float64 0.08 0.96 | licenses list | repository_name stringlengths 7 104 | path stringlengths 4 230 | size int64 7 928k | lang stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
'''
Copyright 2022 Airbus SAS
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
dis... | 46.913793 | 138 | 0.60076 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | os-climate/witness-core | climateeconomics/tests/_l1_test_gradient_services_discipline.py | 8,163 | Python |
import logging
import json
from http import HTTPStatus
from typing import Any, Dict # noqa: F401
from flask import Response, jsonify, make_response, request
from flask import current_app as app
from flask.blueprints import Blueprint
from amundsen_application.log.action_log import action_logging
from amundsen_appli... | 38.389474 | 118 | 0.656019 | [
"Apache-2.0"
] | ai-platform/amundsenfrontendlibrary | amundsen_application/api/search/v0.py | 7,294 | Python |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: gen_dataset_ops.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
f... | 41.46114 | 318 | 0.724694 | [
"MIT"
] | aMp37/SimpleHTR | venv/lib/python3.7/site-packages/tensorflow_core/contrib/ignite/python/ops/gen_dataset_ops.py | 8,002 | Python |
import os
from typing import List
project_dir = os.path.abspath(os.path.dirname(__file__))
c_file_suffix = ('.c', '.cc', '.cpp')
def read_file(file_name: str) -> List[str]:
_f = open(file_name, 'r')
lines = _f.readlines()
_f.close()
return lines
| 20.384615 | 56 | 0.65283 | [
"MIT"
] | whbjzzwjxq/llvm-ir2json | utils.py | 265 | Python |
import functools
from django import http
from django.shortcuts import get_object_or_404, redirect
from conference import models, settings
def speaker_access(f): # pragma: no cover
"""
Decorator that protects the view relative to a speaker.
"""
@functools.wraps(f)
def wrapper(request, slug, **kwa... | 39.706422 | 110 | 0.588031 | [
"BSD-2-Clause"
] | cezar77/epcon | conference/decorators.py | 4,328 | Python |
# 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
# distributed under t... | 45.242105 | 88 | 0.746626 | [
"Apache-2.0"
] | AKhodus/adcm | tests/functional/test_objects_issues.py | 4,298 | Python |
# -*- coding: utf-8 -*-
"""Worker Remote Control Client.
Client for worker remote control commands.
Server implementation is in :mod:`celery.worker.control`.
"""
from __future__ import absolute_import, unicode_literals
import warnings
from billiard.common import TERM_SIGNAME
from kombu.matcher import match
from komb... | 34.924843 | 79 | 0.593819 | [
"MIT"
] | DTrafford/IDPS | idps/lib/python3.7/site-packages/celery/app/control.py | 16,729 | Python |
from __future__ import annotations
import asyncio
import logging
from collections import defaultdict, deque
from math import log2
from time import time
from typing import Container
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from .comm.addressi... | 34.15942 | 88 | 0.537123 | [
"BSD-3-Clause"
] | ncclementi/distributed | distributed/stealing.py | 18,856 | Python |
# Solution for the test LAB
#!/usr/bin/env python
print("Solucionado")
| 17.75 | 27 | 0.732394 | [
"Apache-2.0"
] | ManuelLecaro/simplePythonAutograderAutolab | autograder_test/src/test.py | 71 | Python |
# coding=utf-8
# Copyright 2021 The Eleuther AI and HuggingFace Inc. team. 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-... | 41.982206 | 130 | 0.641886 | [
"MIT"
] | Snarp/nostalgebraist-autoresponder | src/stable_library_code/transformers/gpt_neo/modeling_gpt_neo.py | 35,391 | Python |
from django.http.response import HttpResponseRedirect
from django.shortcuts import redirect, render
from django.contrib.auth.decorators import login_required
from itertools import chain
from .models import Image, Profile, Comment
from .forms import NewProfileForm, NewImageForm
import string
import random
# Create your... | 36.980645 | 153 | 0.666957 | [
"MIT"
] | g90tony/insta-clone | image/views.py | 5,732 | Python |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import image_transform
import layers
import preprocess
import postprocess
import objectives
import theano_print... | 46.165803 | 176 | 0.715937 | [
"MIT"
] | Keesiu/meta-kaggle | data/external/repositories_2to3/267667/kaggle-heart-master/configurations/je_ss_smcrps_nrmsc200_500_dropnorm.py | 8,910 | Python |
#!/usr/bin/env python
## Filter small sequences out of a fasta file. For use with flies,
## for example, where scaffolds of length <200kb seem to be considered
## no mans land
import os
from optparse import OptionParser
from sonLib.bioio import fastaRead
from sonLib.bioio import fastaWrite
from sonLib.bioio import ... | 33.79798 | 94 | 0.582188 | [
"MIT-0"
] | adf-ncgr/cactus | preprocessor/cactus_filterSmallFastaSequences.py | 3,346 | Python |
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009-2018 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Helper functions for pickling and unpickling... | 24.875639 | 88 | 0.658061 | [
"BSD-3-Clause"
] | antoinecollet5/Jsonpickle | jsonpickle/util.py | 14,602 | Python |
import argparse
def train_args():
"""
Retrieves and parses the 3 command line arguments provided by the user when
they run the program from a terminal window. This function uses Python's
argparse module to created and defined these 3 command line arguments. If
the user fails to pro... | 38.236364 | 119 | 0.523062 | [
"MIT"
] | victoray/ImageClasssifier | train_args.py | 2,103 | Python |
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.figure_factory as ff
import numpy as np
from plotly.subplots import make_subplots
from tqdm import tqdm
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.feature_selectio... | 29.027778 | 89 | 0.796172 | [
"MIT"
] | kguarian/Classification-Algorithms | knn/main.py | 1,045 | Python |
import sys
import json
from appscale.common.service_stats import stats_manager
from mock import mock, patch
from tornado.testing import AsyncHTTPTestCase
from appscale.common.unpackaged import APPSCALE_PYTHON_APPSERVER
from appscale.taskqueue import appscale_taskqueue, rest_api, statistics
sys.path.append(APPSCALE... | 38.424779 | 78 | 0.697835 | [
"Apache-2.0"
] | HafeezRai/appscale | AppTaskQueue/test/unit/test_service_stats.py | 8,684 | Python |
import os
from setuptools import Extension, setup
import sys
from Cython.Build import build_ext
import numpy
NAME = "olive-camera-dcamapi"
VERSION = "0.1"
DESCRIPTION = "A small template project that shows how to wrap C/C++ code into python using Cython"
URL = "https://github.com/liuyenting/olive-camera-dca... | 28.820144 | 107 | 0.590864 | [
"Apache-2.0"
] | liuyenting/olive-camera-dcamapi | setup.py | 4,006 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AntMerchantExpandBenefitConfirmResponse(AlipayResponse):
def __init__(self):
super(AntMerchantExpandBenefitConfirmResponse, self).__init__()
self._benef... | 28.868421 | 112 | 0.662261 | [
"Apache-2.0"
] | articuly/alipay-sdk-python-all | alipay/aop/api/response/AntMerchantExpandBenefitConfirmResponse.py | 2,194 | Python |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 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 __future__ import absolute_import, unicode_literals
import traceback
from uuid import uuid4
from fl... | 36.792079 | 109 | 0.694564 | [
"MIT"
] | fweng322/indico | indico/web/errors.py | 3,716 | Python |
"""Tests for iterating over expression clauses.
Since BooleanExpressions's iter_clauses variations are basically wrappers
around the functions of the same name from ExpressionTreeNode, they are not
tested in-depth here. Instead, take a look at the unit tests for
ExpressionTreeNode's implementation.
"""
import unitte... | 32.951807 | 75 | 0.609141 | [
"MIT"
] | fkromer/tt | tt/tests/unit/expressions/test_bexpr_iter_clauses.py | 2,735 | Python |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-01 09:58
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0018_project_properties'),
]
operations = [
migrations.AlterModelOption... | 32.03125 | 107 | 0.580488 | [
"MIT"
] | GETLIMS/LIMS-Backend | lims/projects/migrations/0019_auto_20180301_0958.py | 1,025 | Python |
#
# MythBox for XBMC - http://mythbox.googlecode.com
# Copyright (C) 2011 analogue@yahoo.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at yo... | 38.277108 | 144 | 0.627951 | [
"Apache-2.0"
] | C6SUMMER/allinclusive-kodi-pi | .kodi/addons/script.mythbox/resources/src/mythbox/mythtv/publish.py | 3,177 | Python |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... | 35.776471 | 83 | 0.680368 | [
"Apache-2.0"
] | ashing-zhang/oneflow | oneflow/python/test/ops/test_reduce_mean.py | 3,041 | Python |
from hazelcast.protocol.codec import \
semaphore_acquire_codec, \
semaphore_available_permits_codec, \
semaphore_drain_permits_codec, \
semaphore_init_codec, \
semaphore_reduce_permits_codec, \
semaphore_release_codec, \
semaphore_try_acquire_codec
from hazelcast.proxy.base import PartitionS... | 52.495868 | 141 | 0.720875 | [
"Apache-2.0"
] | Kilo59/hazelcast-python-client | hazelcast/proxy/semaphore.py | 6,352 | Python |
from nose.tools import *
import networkx as nx
import networkx.algorithms.approximation as a
def test_min_maximal_matching():
# smoke test
G = nx.Graph()
assert_equal(len(a.min_maximal_matching(G)),0)
| 24.666667 | 51 | 0.720721 | [
"MIT"
] | kushgrover/apt-vs-dift | src/prism-fruit/Games-DQL/examples/games/car/networkx/algorithms/approximation/tests/test_matching.py | 222 | Python |
import keyboard
import settings
from key_sender import *
import utils
class HotKey(object):
def __init__(self):
pass
def regist_hotkey(self, hotkey_group, queue_h):
if settings.test:
keyboard.add_hotkey('F10', self.f10_fun)
keyboard.add_hotkey('F11', self.f11_fun)
... | 28.245902 | 58 | 0.614045 | [
"Apache-2.0"
] | Llona/hotkey | send_key_explame/pypiwin32/hot_key.py | 1,727 | Python |
import os
import re
import sys
import json
import time
import requests
import downloader
from config import TEMP_FOLDER
# 爬虫请求头
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7',
'User-Agent': 'Mozilla/5.0 (Windows ... | 29.746753 | 134 | 0.59201 | [
"MIT"
] | JiangGua/classin-downloader | src/bbparser.py | 4,781 | Python |
# This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from builtins import object
import json
import logging
import re
import os
import math
impor... | 42.341701 | 170 | 0.592794 | [
"MIT"
] | creativechain/crea-python-lib | crea/crea.py | 82,655 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
from lxml import html
import requests
page = requests.get('http://stmary-338.com/')
tree = html.fromstring(page.content)
info = tree.xpath('//*[@id="panel-w5840cbe2b571d-0-1-0"]/div/div/h6[1]')
for i in info:
print "ST MARY", i.encode(page.encoding)
| 28.636364 | 72 | 0.68254 | [
"MIT"
] | linuxkay/python | test-stmary.py | 315 | Python |
"""
U{Corelan<https://www.corelan.be>}
Copyright (c) 2011-2017, Peter Van Eeckhoutte - Corelan GCV
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 ... | 45.156384 | 368 | 0.46592 | [
"BSD-3-Clause"
] | Shtrikh17/mona | monaFile.py | 833,632 | Python |
import pytest
from pretalx.event.models import Organiser
from pretalx.event.utils import create_organiser_with_team
@pytest.mark.django_db
def test_user_organiser_init(user):
assert Organiser.objects.count() == 0
assert user.teams.count() == 0
create_organiser_with_team(name='Name', slug='slug', users=[u... | 31.2 | 70 | 0.741453 | [
"Apache-2.0"
] | orlando/pretalx | src/tests/event/test_event_utils.py | 468 | Python |
# -*- coding: utf-8 -*-
import sys
from django.test import SimpleTestCase
from django.test.utils import override_settings
from .forms import (CustomNamingForm, DefaultNamingForm, MixedNamingForm,
MultipleNamingForm)
class TestWidget(SimpleTestCase):
def test_custom_naming(self):
html = CustomNamin... | 36.965812 | 100 | 0.589364 | [
"MIT"
] | sinnwerkstatt/django-osm-field | tests/test_forms.py | 4,325 | Python |
""" Visualize the single different data samples or averages
All visualization nodes are zero-processing nodes, i.e. their execute method
returns exactly the data that it gets as parameter. However, when the data
is passed through the visualization node, it performs different kinds of
analysis and creates some plots o... | 49.066667 | 78 | 0.80163 | [
"BSD-3-Clause"
] | pyspace/pyspace | pySPACE/missions/nodes/visualization/__init__.py | 736 | Python |
from distutils.core import setup
setup(name='geoNet',
version='1.0',
packages=['geoNet',
'geoNet.gmpe',
],
)
| 17.777778 | 32 | 0.475 | [
"MIT"
] | ucgmsim/Pre-processing | geoNet/setup.py | 160 | Python |
"""CovidDetector URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 34.73913 | 77 | 0.704631 | [
"Unlicense",
"MIT"
] | anupam-tiwari/Def-Hacks-2020 | CovidDetector/urls.py | 799 | Python |
#-----------------------------------------------------------------------------
# Name: GraphModels
# Purpose: To store graphs used in network translations
# Author: Aric Sanders
# Created: 4/6/2016
# License: MIT License
#--------------------------------------------------------------------------... | 49.816969 | 136 | 0.603793 | [
"Unlicense"
] | aricsanders/pyMez3 | Code/DataHandlers/GraphModels.py | 52,258 | Python |
from ..utils import Object
class ChatEventAction(Object):
"""
Represents a chat event
No parameters required.
"""
ID = "chatEventAction"
def __init__(self, **kwargs):
pass
@staticmethod
def read(q: dict, *args) -> "ChatEventStickerSetChanged or ChatEventMemberLeft... | 42.869565 | 653 | 0.792089 | [
"MIT"
] | iTeam-co/pytglib | pytglib/api/types/chat_event_action.py | 986 | Python |
"""
Module: 'uerrno' on esp32 1.12.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.12.0', version='v1.12 on 2019-12-20', machine='ESP32 module (spiram) with ESP32')
# Stubber: 1.3.2
EACCES = 13
EADDRINUSE = 98
EAGAIN = 11
EALREADY = 114
EBADF = 9
ECONNABORTED = 103
ECONNREFUSED = 111
ECONNRESET = 104
EEXIST... | 17.862069 | 135 | 0.69112 | [
"MIT"
] | AssimilatedGuy/micropython-stubs | stubs/micropython-esp32-1_12/uerrno.py | 518 | Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from include import IncludeManager
from osf.models.base import BaseModel, ObjectIDMixin
from osf.utils.workflows import RequestTypes
from osf.models.mixins import NodeRequestableMixin, PreprintRequestableMixin
class Abstrac... | 31.135135 | 104 | 0.757813 | [
"Apache-2.0"
] | CenterForOpenScience/osf.io | osf/models/request.py | 1,152 | Python |
""""""
import os
import uuid
import bz2
import pickle
import traceback
import zlib
from abc import ABC
from copy import copy,deepcopy
from typing import Any, Callable
from logging import INFO, ERROR
from datetime import datetime
from vnpy.trader.constant import Interval, Direction, Offset, Status, OrderType, Color, Ex... | 39.78922 | 136 | 0.53135 | [
"MIT"
] | UtorYeung/vnpy | vnpy/app/cta_strategy_pro/template.py | 107,524 | Python |
#!/usr/bin/python
import pathlib
import requests
import smtplib
import logging
import coloredlogs
import verboselogs
from etc.api.keys import *
path_atual_tl = str(pathlib.Path(__file__).parent.absolute())
path_tl_final = path_atual_tl.replace('/etc/notification','')
def logando_notification(tipo, mensagem):
... | 28.326923 | 106 | 0.644942 | [
"BSD-3-Clause"
] | 4jinetes/Oblivion | Linux/etc/notification/telegram.py | 2,948 | Python |
import logging
from abc import abstractmethod
from .input import Input
from .input_config import assert_keycode_list
class Switch(Input):
"""Switch input class
Implement custom on() and off() logic
Read more about defaults from input_config.py
"""
def validate_defaults(self, defaults):
... | 24.643478 | 75 | 0.565279 | [
"MIT"
] | SurrogateInc/surrortg-sdk | surrortg/inputs/switch.py | 2,834 | Python |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
"""
@ide: PyCharm
@author: Pedro Silva
@contact: pedroh21.silva@gmail.com
@created: out-10 of 2019
"""
import os
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as kback
from tensorflow import keras
class QRSNet(object):
@classmethod
d... | 40.093407 | 139 | 0.647252 | [
"MIT"
] | ufopcsilab/ECGClassification | python/qrs/qrs_net.py | 7,297 | Python |
"""
MIT License
Copyright (c) 2019 YangYun
Copyright (c) 2020 Việt Hùng
Copyright (c) 2020-2021 Hyeonki Hong <hhk7734@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... | 35.663636 | 80 | 0.590874 | [
"MIT"
] | fcakyon/tensorflow-yolov4 | py_src/yolov4/tf/dataset/keras_sequence.py | 7,849 | Python |
from amaru.utilities import constants
def generate_subsets(current_tree_bottom):
current_distances = []
subsets = []
current_point = 0
while current_point < len(current_tree_bottom) - 1:
current_distances.append(current_tree_bottom[current_point + 1][1] - current_tree_bottom[current_point][1])... | 33.962264 | 120 | 0.662222 | [
"BSD-3-Clause"
] | TeamSerpentine/angry-birds-level-gen-2020 | amaru/utilities/subsets.py | 1,800 | Python |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from Logger.models import Run, Process
from Logger.libs import log_dealer
import json
# Create your views here.
def listen(request):
log_dealer(request)
context_dict = {}
response = render(request, 'index.html',... | 27.880597 | 92 | 0.67773 | [
"MIT"
] | MenheraMikumo/Nextflow-Kanban | Logger/views.py | 1,868 | Python |
# MIT License
# Copyright (c) 2020 Simon Schug, João Sacramento
# 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, ... | 33.253521 | 89 | 0.703939 | [
"MIT"
] | SudeepSarkar/equilibrium-propagation | lib/config.py | 2,362 | Python |
'''
Created on Feb 4, 2021
@author: paepcke
'''
import io
import os
import pickle
import tempfile
import unittest
from experiment_manager.neural_net_config import NeuralNetConfig
#from experiment_manager.dottable_config import DottableConfigParser
TEST_ALL = True
#TEST_ALL = False
class NeuralNetConfigTest(unittes... | 35.294821 | 384 | 0.53076 | [
"BSD-3-Clause"
] | paepcke/ml_experiment_manager | src/experiment_manager/tests/test_neural_net_config.py | 8,859 | Python |
""" Dynamic bicycle model.
Use Dynamic class to:
1. simulate continuous model
2. linearize continuous model
3. discretize continuous model
4. simulate continuously linearized discrete model
5. compare continuous and discrete models
"""
__author__ = 'Achin Jain'
__email__ = 'achinj@seas.upenn.edu'
import num... | 29.858268 | 93 | 0.616913 | [
"MIT"
] | KlrShaK/bayesrace | bayes_race/models/dynamic.py | 11,384 | Python |
#!/usr/bin/env python3
# This script is part of the WhiteboxTools geospatial analysis library.
# Authors: Dr. John Lindsay, Rachel Broders
# Created: 28/11/2017
# Last Modified: 05/11/2019
# License: MIT
import __future__
import sys
# if sys.version_info[0] < 3:
# raise Exception("Must be using Python 3")
import ... | 44.054805 | 207 | 0.551235 | [
"MIT"
] | luzpaz/whitebox-tools | wb_runner.py | 58,681 | Python |
import datetime, pandas as pd, warnings
from time import strftime, localtime
from twint.tweet import Tweet_formats
Tweets_df = None
Follow_df = None
User_df = None
_object_blocks = {
"tweet": [],
"user": [],
"following": [],
"followers": []
}
weekdays = {
"Monday": 1,
"Tuesday": 2,
... | 32.20297 | 114 | 0.558493 | [
"MIT"
] | hellpanderrr/twint | twint/storage/panda.py | 6,505 | Python |
import sys
from sqlalchemy import create_engine
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import func
from sqlalchemy import INT
from sqlalchemy import MetaData
from sqlalchemy import pool as _pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy import util
fr... | 34.509615 | 79 | 0.608352 | [
"MIT"
] | 418sec/sqlalchemy | test/engine/test_transaction.py | 57,424 | Python |
#----------------#
# Name: Mod_Obj #
# Author: Photonic #
# Date:U/N #
#----------------#
import urllib2
import os
import sys
# Class Mod defines the mod object
'''
#############################
# Class for "mod" objects. #
# Used to store all data #
# related to mods. #
##########################... | 44.370968 | 157 | 0.57361 | [
"BSD-2-Clause"
] | photonic-bit/TripleM | Main/Mod_Obj.py | 5,502 | Python |
from datetime import datetime, timedelta
from io import IOBase
from typing import Dict, Generic, List, Optional, Tuple, TypeVar
from injector import inject, singleton
from .backupscheme import GenerationalScheme, OldestScheme, DeleteAfterUploadScheme
from backup.config import Config, Setting, CreateOptions
fr... | 38.662921 | 194 | 0.596338 | [
"MIT"
] | voxipbx/hassio-addons | hassio-google-drive-backup/backup/model/model.py | 13,764 | Python |
# -*- coding: utf8 -*-
'''
Dummy callback object definition
@author: Luis Barrios Hernández
@version: 1.0
'''
from network.manager.networkManager import NetworkCallback
class DummyCallback(NetworkCallback):
def processPacket(self, packet):
print packet._serialize()
| 21.538462 | 58 | 0.739286 | [
"Apache-2.0"
] | lbarriosh/cygnus-cloud | src/Infraestructura/network/tests/dummyCallback.py | 281 | Python |
# Copyright (c) 2015 Dell 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 a... | 47.487374 | 79 | 0.516733 | [
"Apache-2.0"
] | bswartz/cinder | cinder/tests/unit/test_dellscapi.py | 344,141 | Python |
from vec2d_jdm import Vec2D
import math
class Robot(object):
ROBOT_WIDTH = 10
ROBOT_HEIGHT = 15
ROBOT_EDGE = 2
TRAJ_THICKNESS = 4
def __init__(self, speed, canvaswidth, canvasheight, path,
color = "blue", trajColor = "red"):
self.canvaswidth = canvaswidth
self.canvasheigh... | 33.916129 | 72 | 0.531101 | [
"Apache-2.0"
] | harveybia/the-flash-sudo | Mobot_simulation/Robot.py | 5,257 | Python |
#!/usr/bin/env python
def main():
print("test script")
if __name__ == '__main__':
main() | 12.375 | 26 | 0.59596 | [
"MIT"
] | sdementen/gnucash-utilities | scripts/gc_test.py | 99 | Python |
import pomdp_py
class Observation(pomdp_py.Observation):
"""Defines the Observation for the continuous light-dark domain;
Observation space:
:math:`\Omega\subseteq\mathbb{R}^2` the observation of the robot is
an estimate of the robot position :math:`g(x_t)\in\Omega`.
"""
# the n... | 29.854167 | 81 | 0.604327 | [
"MIT"
] | Deathn0t/pomdp-py | pomdp_problems/light_dark/domain/observation.py | 1,433 | Python |
from ermaket.api.scripts import ReturnContext, UserScript
__all__ = ['script']
script = UserScript(id=2)
@script.register
def no_way(context):
return ReturnContext(abort=418, abort_msg="I am a teapot")
| 19.090909 | 62 | 0.752381 | [
"Apache-2.0"
] | SqrtMinusOne/ERMaket | ermaket/tests/dummy_scripts/script_abort.py | 210 | Python |
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save, pre_save
from .utils import Mailchimp
class MarketingPreference(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
subscribed = models.Boolean... | 33.903226 | 85 | 0.692198 | [
"MIT"
] | felipebrigo/Python-Projects | eCommerce-master/src/marketing/models.py | 2,102 | Python |
"""
Run x12/x13-arima specs in a subprocess from Python and curry results back
into python.
Notes
-----
Many of the functions are called x12. However, they are also intended to work
for x13. If this is not the case, it's a bug.
"""
import os
import subprocess
import tempfile
import re
from warnings import warn
import... | 36.837971 | 79 | 0.608095 | [
"BSD-3-Clause"
] | diego-mazon/statsmodels | statsmodels/tsa/x13.py | 22,508 | Python |
from ib_tws_server.codegen.generator_utils import GeneratorUtils
from ib_tws_server.api_definition import *
from ib_tws_server.codegen.generator_utils import *
import inspect
def forward_method_parameters_dict_style(params: List[inspect.Parameter]) -> str:
return ",".join([ f"{v.name} = {v.name}" for v in params ]... | 38.153631 | 207 | 0.628157 | [
"MIT"
] | ncpenke/ib_tws_server_py | ib_tws_server/codegen/asyncio_client_generator.py | 13,659 | Python |
import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
FS = 48000.0
FREQ = 9000
omega = 2 * np.pi * FREQ
r = np.array([251589, -130428 - 4165j, -130428 + 4165j, 4634 - 22873j, 4634 + 22873j])
p = np.array([-46580, -55482 + 25082j, -55482 - 25082j, -26292 - 59437j, -26292 + 59437j])
r = np.a... | 22.666667 | 109 | 0.589572 | [
"BSD-3-Clause"
] | jatinchowdhury18/BBDDelay | sim/filter_design.py | 1,496 | Python |
#
# 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... | 30.964029 | 92 | 0.681227 | [
"Apache-2.0"
] | AI-ML-Projects/airflow | airflow/providers/sendgrid/utils/emailer.py | 4,304 | Python |
#!/usr/bin/env python
# Copyright 2017 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 require... | 52.194444 | 119 | 0.695583 | [
"Apache-2.0"
] | 0olwzo0/cloudml-samples | cloudml-template/examples/housing-regression/trainer/metadata.py | 3,758 | Python |
# Copyright (c) 2010-2020 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Bool,
Integer,
Sequence,
Alias,
)
from openpyxl.descriptors.excel import ExtensionList
from openpyxl.descriptors.nested import (
NestedNoneSet,
NestedSet,
... | 28.793103 | 103 | 0.634251 | [
"Apache-2.0"
] | AdrianaViabL/Curso-Python-udemy | venv/lib/python3.8/site-packages/openpyxl/chart/bar_chart.py | 4,175 | Python |
import unittest
from pycoin.coins import tx_utils
from pycoin.cmds.tx import DEFAULT_VERSION
from pycoin.ecdsa.secp256k1 import secp256k1_generator
from pycoin.encoding.hexbytes import h2b
from pycoin.solve.utils import build_hash160_lookup, build_p2sh_lookup
from pycoin.symbols.btc import network
from pycoin.ui.key_f... | 55.366667 | 120 | 0.725467 | [
"MIT"
] | Anappau/pycoin | tests/sign_test.py | 8,305 | Python |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 42.675439 | 78 | 0.599383 | [
"Apache-2.0"
] | yudongcao/OpenFermion | src/openfermion/transforms/_jordan_wigner_test.py | 14,595 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# oz_cli documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 29.628049 | 77 | 0.684091 | [
"MIT"
] | shaneleonard/oz | docs/conf.py | 4,859 | Python |
def dfs(graph, start, end):
stack = [start]
visited = []
while stack:
u = stack.pop() # stack에서 아이템을 빼낸다.
visited.append(u)
if end in visited:
return 1
for v in graph[u]:
if v not in visited and v not in stack:
stack.append(v)
retu... | 26.518519 | 51 | 0.480447 | [
"MIT"
] | mrbartrns/swacademy_structure | swea/stack/dfs_p1.py | 734 | Python |
# -*- coding: utf-8 -*-
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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.o... | 24.264103 | 120 | 0.537356 | [
"ECL-2.0",
"Apache-2.0"
] | HelioGuilherme66/RIDE | src/robotide/context/__init__.py | 9,464 | Python |
# Copyright 2018 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... | 39.64497 | 83 | 0.647015 | [
"Apache-2.0"
] | jdavidagudelo/tensorflow-models | research/minigo/preprocessing_test.py | 6,700 | Python |
# -*- coding: utf-8 -*-
"""
Criado por Lucas Fonseca Lage em 04/03/2020
"""
import re, os, spacy
import numpy as np
from my_wsd import my_lesk
from unicodedata import normalize
from document import Document
from gensim.models import Phrases
# Carregamento do modelo Spacy
nlp = spacy.load('pt_core_news_lg')
# Carrega... | 33.725 | 80 | 0.621794 | [
"MIT"
] | lflage/complexidade_textual | complexidade_textual.py | 6,783 | Python |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with th... | 36.2 | 78 | 0.753223 | [
"Apache-2.0"
] | xuweiliang/Codelibrary | openstack_dashboard/dashboards/admin/network_topology/panel.py | 1,086 | Python |
def erat2():
D = {}
yield 2
for q in itertools.islice(itertools.count(3), 0, None, 2):
p = D.pop(q, None)
if p is None:
D[q*q] = q
yield q
else:
x = p + q
while x in D or not (x&1):
x += p
D[x] = p
| 22.142857 | 62 | 0.367742 | [
"Apache-2.0"
] | asukumari/python-cookbook-2e-alexmartelli | cb2_examples/cb2_18_10_exm_2.py | 310 | Python |
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmdet.models.builder import HEADS
from .bbox_head import BBoxHead
@HEADS.register_module()
class ConvFCBBoxHeadSeparate(BBoxHead):
r"""More general bbox head, with shared conv and fc layers and two optional
separated branches.
.. code-block:: no... | 37.804598 | 79 | 0.564001 | [
"Apache-2.0"
] | Qianna00/mmdetection | mmdet/models/roi_heads/bbox_heads/bbox_head_separate.py | 6,578 | Python |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import Re... | 34.221453 | 78 | 0.642568 | [
"MIT"
] | Ahmed-Gemmy/recipe-app-api | app/recipe/tests/test_recipe_api.py | 9,890 | Python |
# Copyright (c) 2021. Slonos Labs. All rights Reserved.
| 28.5 | 56 | 0.719298 | [
"MIT"
] | kapousa/BrontoMind2 | app/base/gg.py | 57 | Python |
from django.conf.urls import include, url
from django.views.generic.base import TemplateView
from antioch.plugins.signup.views import ActivationView
from antioch.plugins.signup.views import RegistrationView
app_name='signup'
urlpatterns = [
url(r'^activate/complete/$',
TemplateView.as_view(template_name=... | 39.9 | 86 | 0.716792 | [
"MIT"
] | philchristensen/antioch | antioch/plugins/signup/urls.py | 1,197 | Python |
"""Trains a hypergraph machine on MNIST and generates Figure 1 panels b and c
of Discrete and continuous learning machines
"""
import numpy as np
import torch
import torch.nn.functional as F
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from hypergraph_machines.hypergraph_mach... | 40.871795 | 82 | 0.737139 | [
"MIT"
] | Veos-Digital/hypergraph_machines | hypergraph_machines/examples/generate_figure.py | 1,594 | Python |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 10 08:10:27 2018
@author: lenovo-pc
"""
file_path='D://aaa//kaifangX.txt'
email_path='D://aaa//99.txt'
file_path=open(file_path,'w',encoding='utf-8')
email_path=open(email_path,'w',encoding='utf-8')
for i in range(10000):
try:
c=b.readline().spl... | 22.631579 | 49 | 0.574419 | [
"Apache-2.0"
] | 15048040369/-1 | Frank.py | 438 | Python |
from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 35.433566 | 89 | 0.625222 | [
"MIT"
] | EnricoMagnago/F3 | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/17-extending_bound_30.py | 10,134 | Python |
from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/7353.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
ti... | 23 | 116 | 0.722222 | [
"BSD-2-Clause"
] | LoopTilingBenchmark/benchmark | experiments/fdtd-2d/tmp_files/7353.py | 414 | Python |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_2
from i... | 24.04878 | 109 | 0.730223 | [
"Unlicense"
] | Isilon/isilon_sdk_python | isi_sdk_8_2_2/test/test_cluster_firmware_status_node.py | 986 | Python |
from argparse import ArgumentParser
import enum
from pathlib import Path
from matplotlib import pyplot as plt
from matplotlib.lines import Line2D
import numpy as np
import yaml
import pandas as pd
METRICS = ['total_L1', '0_to10mm_L1', '10_to20mm_L1', 'above20mm_L1']
METRICS_TITLE = ['L1Loss', 'L1Loss in [0,10) mm', ... | 36.097297 | 116 | 0.628182 | [
"MIT"
] | alr-internship/self-supervised-depth-denoising | src/evaluate/plot_evaluation.py | 6,678 | Python |
from gosubl import gs
import os
import sublime_plugin
def _stx(v):
old = [
'GoSublime.tmLanguage',
'GoSublime-next.tmLanguage',
]
fn = 'Packages/GoSublime/syntax/GoSublime-Go.tmLanguage'
if not os.path.exists(gs.dist_path('syntax/GoSublime-Go.tmLanguage')):
return
stx = v.settings().get('syntax')
if stx:... | 20.424242 | 71 | 0.646884 | [
"MIT"
] | MiYogurt/my-sublimetext3-plugin | GoSublime/gssynforce.py | 674 | Python |
###########################################################################
#
# 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/l... | 29.559701 | 79 | 0.434991 | [
"Apache-2.0"
] | quan/starthinker | starthinker/task/dcm_api/schema/targetableRemarketingListsListResponse.py | 3,961 | Python |
from flask import Flask, request, jsonify
from flask_jsonrpc import JSONRPC
# import json_to_db
import psycopg2
import sys
from obs import *
import config
app = Flask(__name__)
app.config.from_object(config.DevelopmentMaxConfig)
jsonrpc = JSONRPC(app,'/api')
sys.path.insert(0,app.config['SQL_PATH'])
from sql_method... | 27.895833 | 137 | 0.705751 | [
"MIT"
] | ilvivl/Python_Project | server_data_tmp/app/local_server.py | 1,339 | Python |
# Copyright 2015: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 39.52381 | 78 | 0.616867 | [
"Apache-2.0"
] | LorenzoBianconi/rally | rally/plugins/openstack/scenario.py | 3,320 | Python |
"""Tests for ArgComb. """
# pylint: disable=unused-argument, unused-variable
from typing import Any, Callable
import pytest
from argcomb import And, Else, InvalidArgumentCombination, Not, Or, Xor, argcomb
def test_default() -> None:
"""Test the ``default`` parameter of :function:``argcomb.__init__``.
Thi... | 24.459064 | 80 | 0.562941 | [
"MIT"
] | jacobunna/argcomb | test.py | 8,368 | Python |
# -*- 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... | 35.254237 | 86 | 0.646635 | [
"Apache-2.0"
] | igor-solomatov/python-compute | google/cloud/compute_v1/services/addresses/transports/base.py | 6,240 | Python |
#
# 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... | 37.254753 | 110 | 0.640794 | [
"Apache-2.0"
] | 094459/airflow | tests/providers/google/cloud/operators/test_bigquery.py | 39,192 | Python |
# Generated by Django 2.2.12 on 2020-11-10 19:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0039_auto_20201110_2132'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='address_1',
... | 26.576923 | 88 | 0.591896 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | EslamRM/Eshhnli | core/migrations/0040_auto_20201110_2136.py | 691 | Python |
""" http://www.python-course.eu/tkinter_layout_management.php """
from tkinter import *
root = Tk()
w = Label(root, text="Red Sun", bg="red", fg="white")
w.pack()
w = Label(root, text="Green Grass", bg="green", fg="black")
w.pack(ipadx=10)
w = Label(root, text="Blue Sky", bg="blue", fg="white")
w.pack()
mainloop()
| 28.727273 | 65 | 0.651899 | [
"Apache-2.0"
] | modal/tktoolbox | tktoolbox/examples/layout/pack_ipadx.py | 316 | Python |
"""This is a python module containing a cog that implements commands that are
used to manage messages in the server.
e.g. "clear", delete all instances of a certain word, etc.
"""
import discord
from discord.ext import commands
import typing # For optional parameters.
import datetime # For comparing mess... | 40.176991 | 123 | 0.59141 | [
"MIT"
] | ThomScottW/DiscordBot | cogs/Message Management.py | 4,540 | Python |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Power law model variants
"""
# pylint: disable=invalid-name
import numpy as np
from astropy.units import Quantity
from .core import Fittable1DModel
from .parameters import InputParameterError, Parameter
__all__ = ['PowerLaw1D', 'BrokenPowerLaw1D', '... | 32.896166 | 97 | 0.577332 | [
"BSD-3-Clause"
] | JefftheCloudDog/astropy | astropy/modeling/powerlaws.py | 20,593 | Python |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
http://www.scipy.org/Cookbook/Least_Squares_Circle
"""
from numpy import *
# Coordinates of the 2D points
# x = r_[ 9, 35, -13, 10, 23, 0]
# y = r_[ 34, 10, 6, -14, 27, -10]
x = r_[36, 36, 19, 18, 33, 26]
y = r_[14, 10, 28, 31, 18, 26]
# R0 = 25
# nb_pts ... | 26.829268 | 109 | 0.598961 | [
"BSD-3-Clause"
] | AlexEMG/scipy-cookbook | ipython/attachments/Least_Squares_Circle/least_squares_circle_v3.py | 7,700 | Python |
import click
from config.settings import app
@click.group()
def cli():
"""
Serves the application for testing locally. If you want to test it
in a production like environment, please deploy with Docker.\n
:return: Application instance
"""
click.echo('\033[95mINFO: Starting the app..\033[0m')
... | 19.764706 | 70 | 0.678571 | [
"MIT"
] | laith43d/JUJU-User-Example | cli/commands/cmd_serve.py | 336 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.