hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4c14dac70f7ab53364c7e63f8afba6d9c98097a8 | 6,263 | py | Python | tests/unit/__init__.py | HumanCellAtlas/matrix-service | ed9a23d407cce89127b8f0b662c3d2ef2e8fec77 | [
"MIT"
] | 11 | 2018-10-26T20:47:55.000Z | 2022-02-02T10:32:42.000Z | tests/unit/__init__.py | HumanCellAtlas/matrix-service | ed9a23d407cce89127b8f0b662c3d2ef2e8fec77 | [
"MIT"
] | 379 | 2018-06-04T22:44:33.000Z | 2020-06-03T00:20:08.000Z | tests/unit/__init__.py | HumanCellAtlas/matrix-service | ed9a23d407cce89127b8f0b662c3d2ef2e8fec77 | [
"MIT"
] | 4 | 2018-11-22T01:00:27.000Z | 2020-09-01T16:42:05.000Z | import os
import unittest
import boto3
from moto import mock_dynamodb2, mock_s3, mock_sqs, mock_sts, mock_secretsmanager
os.environ['DEPLOYMENT_STAGE'] = "test_deployment_stage"
os.environ['AWS_DEFAULT_REGION'] = "us-east-1"
os.environ['AWS_ACCESS_KEY_ID'] = "test_ak"
os.environ['AWS_SECRET_ACCESS_KEY'] = "test_sk"
o... | 37.957576 | 96 | 0.631327 |
68d2f48de4ec802a711902993b2f426d05a46f6a | 3,838 | py | Python | tests/test_databaselayer_bulk_hash.py | aroiginfraplan/giscube-admin | b7f3131b0186f847f3902df97f982cb288b16a49 | [
"BSD-3-Clause"
] | 5 | 2018-06-07T12:54:35.000Z | 2022-01-14T10:38:38.000Z | tests/test_databaselayer_bulk_hash.py | aroiginfraplan/giscube-admin | b7f3131b0186f847f3902df97f982cb288b16a49 | [
"BSD-3-Clause"
] | 140 | 2018-06-18T10:27:28.000Z | 2022-03-23T09:53:15.000Z | tests/test_databaselayer_bulk_hash.py | aroiginfraplan/giscube-admin | b7f3131b0186f847f3902df97f982cb288b16a49 | [
"BSD-3-Clause"
] | 1 | 2021-04-13T11:20:54.000Z | 2021-04-13T11:20:54.000Z | from unittest import mock
from django.conf import settings
from django.urls import reverse
from django.utils import timezone
from giscube.models import DBConnection, GiscubeTransaction
from layerserver.model_legacy import create_dblayer_model
from layerserver.models import DataBaseLayer
from tests.common import BaseT... | 33.373913 | 78 | 0.583898 |
2a8bda0558d69dc0ca75e8b9e4834c31110c89fe | 2,300 | py | Python | src/modules/voice_roles.py | ProffDea/DiscordBot | 50948503a3b376c6a01ce0630bbf5684d28d08aa | [
"MIT"
] | null | null | null | src/modules/voice_roles.py | ProffDea/DiscordBot | 50948503a3b376c6a01ce0630bbf5684d28d08aa | [
"MIT"
] | null | null | null | src/modules/voice_roles.py | ProffDea/DiscordBot | 50948503a3b376c6a01ce0630bbf5684d28d08aa | [
"MIT"
] | null | null | null | import discord
from sqlalchemy.ext.asyncio import AsyncSession
from src.postgres import database
async def get_role(session: AsyncSession, voice_channel: discord.VoiceChannel):
voice_local_role_exist = await database.voice_local_role_exists(
session,
voice_channel.id
)
if voice_local_role... | 33.823529 | 79 | 0.636522 |
385c8df878a39027c74faa0185bb510f419016c2 | 1,925 | py | Python | evaluation/scripts/fix_bleu.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 15 | 2021-09-24T00:46:04.000Z | 2022-03-16T13:24:56.000Z | evaluation/scripts/fix_bleu.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 98 | 2021-09-22T12:33:21.000Z | 2022-03-21T22:23:52.000Z | evaluation/scripts/fix_bleu.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 12 | 2021-09-25T05:08:18.000Z | 2022-02-28T21:02:20.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# isort:skip_file
import functools
import json
import logging
import sys
import func_argparse
sys.path.append("..") # noqa
sys.path.append(".... | 32.627119 | 85 | 0.688312 |
dd6124e8f0b5401bce778ecc200d95282b456843 | 4,849 | py | Python | python_data/fintech/common_utils.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | python_data/fintech/common_utils.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | python_data/fintech/common_utils.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import time
import datetime
import hashlib
import traceback
import math
import numpy
class CommonUtils(object) :
def __init__(self) :
pass
def str_to_datetime(self,str_time) :
"""
将YY-mm-dd HH:MM:SS 类型字符串转化成datetime
"""
return da... | 26.353261 | 113 | 0.480305 |
3aae8c8694886233ed379a2e34713859bc724086 | 7,634 | py | Python | pypy/module/_cffi_backend/test/test_re_python.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | pypy/module/_cffi_backend/test/test_re_python.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | pypy/module/_cffi_backend/test/test_re_python.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 30 | 2018-08-20T03:16:34.000Z | 2022-01-12T17:39:22.000Z | import py
from rpython.tool.udir import udir
from pypy.interpreter.gateway import interp2app
from pypy.module._cffi_backend.newtype import _clean_cache
class AppTestRecompilerPython:
spaceconfig = dict(usemodules=['_cffi_backend'])
def setup_class(cls):
try:
from cffi import FFI ... | 35.672897 | 87 | 0.592874 |
198d03494610af81fb846d62298cb443e115fe82 | 22,467 | py | Python | pdfminer/layout.py | hason-contributions/pdfminer.six | fd63dbf62e291f6cba5beda968e6f9c480f20033 | [
"MIT"
] | null | null | null | pdfminer/layout.py | hason-contributions/pdfminer.six | fd63dbf62e291f6cba5beda968e6f9c480f20033 | [
"MIT"
] | null | null | null | pdfminer/layout.py | hason-contributions/pdfminer.six | fd63dbf62e291f6cba5beda968e6f9c480f20033 | [
"MIT"
] | null | null | null |
from .utils import INF
from .utils import Plane
from .utils import get_bound
from .utils import uniq
from .utils import csort
from .utils import fsplit
from .utils import bbox2str
from .utils import matrix2str
from .utils import apply_matrix_pt
import six # Python 2+3 compatibility
## IndexAssigner
##
class IndexAs... | 30.278976 | 142 | 0.53336 |
18012d0d6593846865b2666775666824ae35d768 | 2,626 | py | Python | 02_Recursive-decline-method/app/core.py | Mon-ius/Compiling-principle | 02ca432c3db143c02871fbca781654f9782ee464 | [
"MIT"
] | null | null | null | 02_Recursive-decline-method/app/core.py | Mon-ius/Compiling-principle | 02ca432c3db143c02871fbca781654f9782ee464 | [
"MIT"
] | 17 | 2020-01-28T22:21:54.000Z | 2020-03-30T20:29:39.000Z | 02_Recursive-decline-method/app/core.py | Mon-ius/Compiling-principle | 02ca432c3db143c02871fbca781654f9782ee464 | [
"MIT"
] | null | null | null | import re
import collections
# Token specification
NUM = r'(?P<NUM>\d+)'
PLUS = r'(?P<PLUS>\+)'
MINUS = r'(?P<MINUS>-)'
TIMES = r'(?P<TIMES>\*)'
DIVIDE = r'(?P<DIVIDE>/)'
LPAREN = r'(?P<LPAREN>\()'
RPAREN = r'(?P<RPAREN>\))'
WS = r'(?P<WS>\s+)'
master_pat = re.compile('|'.join([NUM, PLUS, MINUS, TIMES,
... | 29.505618 | 71 | 0.541508 |
b1f62e5b1c486c37fa1aa6f847366c5229cb8240 | 19,329 | py | Python | python/ee/data.py | yanggis/yanggis-earthengine-api | f4c0d6433399c7dfcfd151513ed4ed24d7ba4589 | [
"Apache-2.0"
] | 1 | 2018-09-22T18:03:25.000Z | 2018-09-22T18:03:25.000Z | python/ee/data.py | yanggis/yanggis-earthengine-api | f4c0d6433399c7dfcfd151513ed4ed24d7ba4589 | [
"Apache-2.0"
] | null | null | null | python/ee/data.py | yanggis/yanggis-earthengine-api | f4c0d6433399c7dfcfd151513ed4ed24d7ba4589 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Singleton for all of the library's communcation with the Earth Engine API."""
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
import json
import urllib
import deprecation
import ee_exception
import httplib2
# OAuth2 credentials object. This ... | 31.89604 | 80 | 0.670443 |
4d881a575ceb193c24d8efc41c124c77a2ee3b71 | 53 | py | Python | src/NotYetSelfAware/layers/__init__.py | ezalos/NotYetSelfAware | aa8374d24259be9c93b9b5fc00c07f03538a79df | [
"MIT"
] | 1 | 2021-10-02T09:17:46.000Z | 2021-10-02T09:17:46.000Z | src/NotYetSelfAware/layers/__init__.py | ezalos/NotYetSelfAware | aa8374d24259be9c93b9b5fc00c07f03538a79df | [
"MIT"
] | null | null | null | src/NotYetSelfAware/layers/__init__.py | ezalos/NotYetSelfAware | aa8374d24259be9c93b9b5fc00c07f03538a79df | [
"MIT"
] | null | null | null | from .dense import Dense
from .output import Output
| 13.25 | 26 | 0.792453 |
404c3057e1e03bb7f3bc9805f7979b78cb66b1e2 | 15,205 | py | Python | sdks/python/apache_beam/metrics/cells.py | bobingm/beam | 7dce40187f939424b8249c2c21eaeb4c70c26d31 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/apache_beam/metrics/cells.py | bobingm/beam | 7dce40187f939424b8249c2c21eaeb4c70c26d31 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/apache_beam/metrics/cells.py | bobingm/beam | 7dce40187f939424b8249c2c21eaeb4c70c26d31 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #
# 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 us... | 27.249104 | 80 | 0.683328 |
4c6f9363c40c3da5065496f1927f25950b3c1f0b | 124 | py | Python | posts/admin.py | renzo-raizer/HorizonTour | 7b2fa1953d4ed32603280059f24afe447d058a73 | [
"Apache-2.0"
] | null | null | null | posts/admin.py | renzo-raizer/HorizonTour | 7b2fa1953d4ed32603280059f24afe447d058a73 | [
"Apache-2.0"
] | null | null | null | posts/admin.py | renzo-raizer/HorizonTour | 7b2fa1953d4ed32603280059f24afe447d058a73 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Postagens
# Register your models here.
admin.site.register(Postagens) | 20.666667 | 32 | 0.814516 |
da5a3c27d987adeed2fcbca042c2e5f09e7d0ffb | 3,236 | py | Python | profiles_project/settings.py | TanishqGupta11/profiles-rest-api | 60e6fff08844a5c34897f189eb9b76d475781180 | [
"MIT"
] | 1 | 2020-01-27T14:21:51.000Z | 2020-01-27T14:21:51.000Z | profiles_project/settings.py | TanishqGupta11/profiles-rest-api | 60e6fff08844a5c34897f189eb9b76d475781180 | [
"MIT"
] | 5 | 2020-06-06T01:24:34.000Z | 2022-02-10T12:55:38.000Z | profiles_project/settings.py | TanishqGupta11/profiles-rest-api | 60e6fff08844a5c34897f189eb9b76d475781180 | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 25.68254 | 91 | 0.699938 |
079cedc6886584164dbd7eedb56f9fb1e5018d8b | 280 | py | Python | src/forms/search.py | anthony-chukwuemeka-nwachukwu/Movie-Recommender-System | 0684edd0c03289e949ef6481b291fc51a30856b5 | [
"MIT"
] | null | null | null | src/forms/search.py | anthony-chukwuemeka-nwachukwu/Movie-Recommender-System | 0684edd0c03289e949ef6481b291fc51a30856b5 | [
"MIT"
] | null | null | null | src/forms/search.py | anthony-chukwuemeka-nwachukwu/Movie-Recommender-System | 0684edd0c03289e949ef6481b291fc51a30856b5 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import SubmitField, SearchField, StringField
from wtforms.validators import DataRequired, Length
class SearchForm(FlaskForm):
query = SearchField(validators=[DataRequired(), Length(min=3)])
submit = SubmitField('Search')
| 31.111111 | 67 | 0.778571 |
e3f7a6705af325d6882b34f16a88d1df3b28e2bb | 9,350 | py | Python | app/buildhistory/models.py | Dhruv-Sachdev1313/macports-webapp | ed3d8efceac4cfb694a51241cf81023ed10aade6 | [
"BSD-2-Clause"
] | null | null | null | app/buildhistory/models.py | Dhruv-Sachdev1313/macports-webapp | ed3d8efceac4cfb694a51241cf81023ed10aade6 | [
"BSD-2-Clause"
] | null | null | null | app/buildhistory/models.py | Dhruv-Sachdev1313/macports-webapp | ed3d8efceac4cfb694a51241cf81023ed10aade6 | [
"BSD-2-Clause"
] | null | null | null | import urllib.request
import ssl
import json
import datetime
from django.db import models, transaction
from django.contrib.postgres.fields import JSONField
from config import BUILDERS_JSON_URL, BUILDBOT_URL_PREFIX, BUILDS_FETCHED_COUNT
from port.database import StringToArray
class BuilderModelManager(models.Manager... | 39.787234 | 144 | 0.629412 |
3af1f467c433f1770e569b45e09608ce6ebfb1b4 | 1,536 | py | Python | src/models/train_model.py | davidelofrese/dvc-dga-notebook | 31ab723c892851a3f7f2e15b49c6cced6a466cc0 | [
"MIT"
] | null | null | null | src/models/train_model.py | davidelofrese/dvc-dga-notebook | 31ab723c892851a3f7f2e15b49c6cced6a466cc0 | [
"MIT"
] | null | null | null | src/models/train_model.py | davidelofrese/dvc-dga-notebook | 31ab723c892851a3f7f2e15b49c6cced6a466cc0 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.ensemble import RandomForestClassifier
def train_model(all_domains, params):
# We exclude the weird class from our ML training
not_weird = all_domains[all_domains['class'] != 'weird']
# List of feature vectors (scikit learn uses 'X' for the matrix of feature vectors)
X = not_weird[... | 34.133333 | 100 | 0.751953 |
8295ace12affd4b2e2eb7fe673ebbffaacbe563a | 5,446 | py | Python | functionaltests/api/v2/test_zone.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | functionaltests/api/v2/test_zone.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | functionaltests/api/v2/test_zone.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2015 Rackspace
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
dist... | 38.083916 | 78 | 0.701249 |
05205c4dd31634dde8ae6cf12771a96787e98da0 | 6,434 | py | Python | various/iap_11_oop.py | Walber55/projects | 6c3de0797ffbc2dfcb5c4a1fa5a9ddd4580bbb1e | [
"MIT"
] | 15 | 2016-10-09T10:10:16.000Z | 2021-06-02T08:52:47.000Z | various/iap_11_oop.py | Walber55/projects | 6c3de0797ffbc2dfcb5c4a1fa5a9ddd4580bbb1e | [
"MIT"
] | null | null | null | various/iap_11_oop.py | Walber55/projects | 6c3de0797ffbc2dfcb5c4a1fa5a9ddd4580bbb1e | [
"MIT"
] | 9 | 2018-04-26T16:55:36.000Z | 2022-02-02T17:25:54.000Z | #!/usr/bin/env python2
# *-* coding: utf-8 *-*
"Interactive Python Part 11: OOP"
from __future__ import division
import turtle
from math import sqrt
class Point(object):
" Point class for representing and manipulation cartesian coordinates"
def __init__(self, x=0, y=0):
self.x = x
self.y... | 29.925581 | 81 | 0.594809 |
b66faf75754cb87c8e7fbdf952efd4361a772746 | 28,798 | py | Python | flink-python/pyflink/common/execution_config.py | madfrog2047/flink | 973dbc02ca8656ef4849abecac1652bbb7932107 | [
"Apache-2.0"
] | 3 | 2019-10-09T01:48:20.000Z | 2019-10-09T01:53:15.000Z | flink-python/pyflink/common/execution_config.py | madfrog2047/flink | 973dbc02ca8656ef4849abecac1652bbb7932107 | [
"Apache-2.0"
] | 1 | 2019-06-07T13:04:18.000Z | 2019-06-07T13:04:18.000Z | flink-python/pyflink/common/execution_config.py | madfrog2047/flink | 973dbc02ca8656ef4849abecac1652bbb7932107 | [
"Apache-2.0"
] | 2 | 2016-07-29T06:53:02.000Z | 2016-09-09T12:55:02.000Z | ################################################################################
# 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... | 39.941748 | 99 | 0.682061 |
91b2d800b8a43d4b0f5731accc1bf8521020eecf | 1,237 | py | Python | sqlparse/engine/filter_stack.py | medvykes/djang | 5b0619e0de0a80cae1a670726b9a8e68609420f5 | [
"MIT"
] | null | null | null | sqlparse/engine/filter_stack.py | medvykes/djang | 5b0619e0de0a80cae1a670726b9a8e68609420f5 | [
"MIT"
] | null | null | null | sqlparse/engine/filter_stack.py | medvykes/djang | 5b0619e0de0a80cae1a670726b9a8e68609420f5 | [
"MIT"
] | null | null | null | #
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
"""filter"""
from sqlparse import lexer
from sqlparse.engine import grouping
from sqlparse.... | 27.488889 | 65 | 0.616006 |
ab5d16560d72c7c24bef5e6279fe0a511bd2795a | 4,841 | py | Python | networks/FlowNetC.py | tomrunia/flownet2-pytorch | 759b09c375348cf64f52f914cf3bf3e9095cc959 | [
"Apache-2.0"
] | null | null | null | networks/FlowNetC.py | tomrunia/flownet2-pytorch | 759b09c375348cf64f52f914cf3bf3e9095cc959 | [
"Apache-2.0"
] | null | null | null | networks/FlowNetC.py | tomrunia/flownet2-pytorch | 759b09c375348cf64f52f914cf3bf3e9095cc959 | [
"Apache-2.0"
] | null | null | null | import warnings
warnings.filterwarnings("ignore")
import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
import math
import numpy as np
from .correlation_package.correlation import Correlation
from .submodules import *
'Parameter count , 39,175,298 '
class FlowNetC(nn.Module)... | 36.126866 | 123 | 0.628383 |
a4bc319c07aaaf0b634b4613dafc66092466d97b | 3,345 | py | Python | robonaldo/core.py | xtrm-en/robonaldo | 91601bad88043effbb717e40467526fe11bd4cb5 | [
"0BSD"
] | null | null | null | robonaldo/core.py | xtrm-en/robonaldo | 91601bad88043effbb717e40467526fe11bd4cb5 | [
"0BSD"
] | null | null | null | robonaldo/core.py | xtrm-en/robonaldo | 91601bad88043effbb717e40467526fe11bd4cb5 | [
"0BSD"
] | null | null | null | from argparse import ArgumentParser
from robonaldo.context.robot import RobotColor, RobotOwnership
from robonaldo.context.updater import ContextUpdater
from robonaldo.controller import GameController
from robonaldo.log import Logger, LogLevel
from robonaldo.network import NetworkHandler
from robonaldo.strategy import ... | 33.787879 | 80 | 0.655605 |
622e0a9c66f62bb7831c5fe1808530df92068514 | 1,497 | py | Python | Abstract_Base_Classes(ABC).py | maiconloure/Learning_Python | 2999508909ace5f8ca0708cdea93b82abaaeafb2 | [
"MIT"
] | null | null | null | Abstract_Base_Classes(ABC).py | maiconloure/Learning_Python | 2999508909ace5f8ca0708cdea93b82abaaeafb2 | [
"MIT"
] | null | null | null | Abstract_Base_Classes(ABC).py | maiconloure/Learning_Python | 2999508909ace5f8ca0708cdea93b82abaaeafb2 | [
"MIT"
] | null | null | null | import abc
# ABC é a superclasse para classes abstratas
# Uma classe abstrata nao pode ser instanciada e deve conter pelo menos um metodo abstrato
class Funcionario(abc.ABC): # agora não é possivel instânciar a classe => Funcionario()
def __init__(self, nome, cpf, salario):
self._nome = nome
se... | 31.1875 | 107 | 0.690715 |
7b079ec9deed15fc836045ae95b2a75fdae4a9d2 | 412 | py | Python | tests/h/traversal/profile_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | null | null | null | tests/h/traversal/profile_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | null | null | null | tests/h/traversal/profile_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | null | null | null | from unittest.mock import sentinel
import pytest
from h.traversal.profile import ProfileRoot
class TestProfileRoot:
def test_acl_for_profile(self, ACL):
acl = ProfileRoot(sentinel.request).__acl__()
ACL.for_profile.assert_called_once_with()
assert acl == ACL.for_profile.return_value
... | 22.888889 | 53 | 0.720874 |
fdeb86478b8afe44680864f285f575d71c40eb1f | 1,327 | py | Python | pydeel/Convert2fasta.py | alegione/pydeel | 6c02aa18e9d40b22746727e4718ed4f87cd574cd | [
"MIT"
] | null | null | null | pydeel/Convert2fasta.py | alegione/pydeel | 6c02aa18e9d40b22746727e4718ed4f87cd574cd | [
"MIT"
] | null | null | null | pydeel/Convert2fasta.py | alegione/pydeel | 6c02aa18e9d40b22746727e4718ed4f87cd574cd | [
"MIT"
] | null | null | null | '''
Module : Convert2fasta
Description : Tool to convert input files to fasta.
Copyright : (c) Alistair Legione, 11 Jul 2019
License : MIT
Maintainer : legionea@unimelb.edu.au
Portability : POSIX
'''
from Bio import SeqIO
def gbkToFasta(gbk_filename, fasta_filename):
input_handle = open(gbk_filenam... | 24.574074 | 70 | 0.629992 |
2c4879759b27fac876313d4a1202eaedc5c84f7f | 7,295 | py | Python | tests/gem5/suite.py | mrunalkp/cs251 | 894d1c7fa2e33c1af1844b4b3c420cf37d649027 | [
"BSD-3-Clause"
] | 135 | 2016-10-21T03:31:49.000Z | 2022-03-25T01:22:20.000Z | tests/gem5/suite.py | akeley98/FU-pools | dcd47b7dad279246093081cab24b95cae363c3b3 | [
"BSD-3-Clause"
] | 35 | 2017-03-10T17:57:46.000Z | 2022-02-18T17:34:16.000Z | tests/gem5/suite.py | akeley98/FU-pools | dcd47b7dad279246093081cab24b95cae363c3b3 | [
"BSD-3-Clause"
] | 48 | 2016-12-08T12:03:13.000Z | 2022-02-16T09:16:13.000Z | # Copyright (c) 2017 Mark D. Hill and David A. Wood
# 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 conditio... | 39.863388 | 78 | 0.650446 |
089da7bee36e711da7a2699152ae63c2c95b31b0 | 4,259 | py | Python | keep_backend/privacy/map.py | 9929105/KEEP | a3e8b00f82367e13835e5137bd5c0eaa7c8d26d2 | [
"MIT"
] | null | null | null | keep_backend/privacy/map.py | 9929105/KEEP | a3e8b00f82367e13835e5137bd5c0eaa7c8d26d2 | [
"MIT"
] | null | null | null | keep_backend/privacy/map.py | 9929105/KEEP | a3e8b00f82367e13835e5137bd5c0eaa7c8d26d2 | [
"MIT"
] | null | null | null | # -*-Python-*-
###############################################################################
#
# File: map2d.py
# RCS: $Header: $
# Description: Transform 2d map coordinates providing Differential Privacy
# Author: Staal Vinterbo
# Created: Wed Mar 27 17:07:29 2013
# Modified: Thu Mar... | 30.205674 | 86 | 0.577835 |
c79a02a7177c1f6098815e572edc3d1513691355 | 644 | py | Python | mundo-1/ex022.py | PedroSantana2/exercicios-python-canal-curso-em-video | 154ae9771e88906c7fcef5efc5799e44acfc2ae3 | [
"MIT"
] | 1 | 2021-03-17T20:16:36.000Z | 2021-03-17T20:16:36.000Z | mundo-1/ex022.py | PedroSantana2/exercicios-python-canal-curso-em-video | 154ae9771e88906c7fcef5efc5799e44acfc2ae3 | [
"MIT"
] | null | null | null | mundo-1/ex022.py | PedroSantana2/exercicios-python-canal-curso-em-video | 154ae9771e88906c7fcef5efc5799e44acfc2ae3 | [
"MIT"
] | null | null | null | '''
Crie um programa que leia o nome completo de uma pessoa e mostre:
- O nome com todas as letras maiúsculas e minúsculas.
- Quantas letras ao todo (sem considerar espaços).
- Quantas letras tem o primeiro nome.
'''
#Recebendo informações:
nome = input('Digite um nome: ')
#Declarando variaveis:
maiusculas = nome.u... | 33.894737 | 192 | 0.73913 |
4baa1a5b125a9a94fa9ced31389b3a0c5df815fe | 1,615 | py | Python | myapp/views.py | mathewlathara/TSAbaggagedetection | 7a83d756896e14e2d8bb62a9f1628d889778bddc | [
"MIT"
] | null | null | null | myapp/views.py | mathewlathara/TSAbaggagedetection | 7a83d756896e14e2d8bb62a9f1628d889778bddc | [
"MIT"
] | null | null | null | myapp/views.py | mathewlathara/TSAbaggagedetection | 7a83d756896e14e2d8bb62a9f1628d889778bddc | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
from .serializers import passengerSerializer
from .models import passenger
from .detectobject import a_test_file, process_image
# Create your views here.
from django.http import HttpResponse
import uuid
def hello(request):
return HttpRes... | 32.3 | 98 | 0.750464 |
bc7a741d62c461ab71a626aa903a1a0d8ad86def | 319 | py | Python | config/wsgi.py | uktrade/return-to-office | d4c53c734611413c9f8a7624e52dc35910c5ff57 | [
"MIT"
] | 1 | 2020-10-25T18:16:47.000Z | 2020-10-25T18:16:47.000Z | config/wsgi.py | uktrade/return-to-office | d4c53c734611413c9f8a7624e52dc35910c5ff57 | [
"MIT"
] | 1 | 2020-10-27T07:11:26.000Z | 2020-10-27T07:11:26.000Z | config/wsgi.py | uktrade/return-to-office | d4c53c734611413c9f8a7624e52dc35910c5ff57 | [
"MIT"
] | null | null | null | """
WSGI config for fido project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| 21.266667 | 78 | 0.777429 |
3da67df97dbf64d8c06321984efa18f285a6d5c8 | 1,932 | py | Python | model.py | ashwinmr/Ud_CarND_P4 | 85f1180051f887df81b9ea3c6be3c5894ff35322 | [
"MIT"
] | null | null | null | model.py | ashwinmr/Ud_CarND_P4 | 85f1180051f887df81b9ea3c6be3c5894ff35322 | [
"MIT"
] | null | null | null | model.py | ashwinmr/Ud_CarND_P4 | 85f1180051f887df81b9ea3c6be3c5894ff35322 | [
"MIT"
] | null | null | null |
# coding: utf-8
# # Imports
# In[2]:
import csv
import cv2
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda, Cropping2D, Conv2D, MaxPooling2D, Dropout, Activation
# # Read csv and load images
# In[3]:
correction = 0.2 # Corr... | 25.76 | 149 | 0.688406 |
7463ff0e4e82d3112d243339029a3e8c6e58b364 | 1,482 | py | Python | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/relationship_to_role_data.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/relationship_to_role_data.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/relationship_to_role_data.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import (
ModelNormal,
cached_property,
... | 23.903226 | 108 | 0.633603 |
27c74da3c5952b08e66c6cf4bfb8f61bc9c31cb1 | 580 | py | Python | Server.py | vuchampion/471A2 | d1156cd673715bb294d0d58dfea30f5b2eafd8ba | [
"MIT"
] | null | null | null | Server.py | vuchampion/471A2 | d1156cd673715bb294d0d58dfea30f5b2eafd8ba | [
"MIT"
] | null | null | null | Server.py | vuchampion/471A2 | d1156cd673715bb294d0d58dfea30f5b2eafd8ba | [
"MIT"
] | null | null | null | import sys, socket
from ServerWorker import ServerWorker
class Server:
def main(self):
try:
SERVER_PORT = int(sys.argv[1])
except:
print("[Usage: Server.py Server_port]\n")
rtspSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
rtspSocket.bind(('', SERVER_PORT))
rtspSocket.lis... | 22.307692 | 65 | 0.660345 |
805b8dfa261aadc216ee8db528cf4382ce3b8c55 | 3,963 | py | Python | nmapsummariser.py | cornerpirate/nmap-summariser | 9893e7db79b58bac52fa6c8cf9f856c62bafb78e | [
"Apache-2.0"
] | 29 | 2015-11-26T12:39:49.000Z | 2021-09-11T19:59:18.000Z | nmapsummariser.py | cornerpirate/nmap-summariser | 9893e7db79b58bac52fa6c8cf9f856c62bafb78e | [
"Apache-2.0"
] | null | null | null | nmapsummariser.py | cornerpirate/nmap-summariser | 9893e7db79b58bac52fa6c8cf9f856c62bafb78e | [
"Apache-2.0"
] | 13 | 2016-06-12T01:51:29.000Z | 2020-06-21T13:12:26.000Z | #! /usr/bin/python
#
# calling: ./nmapsummariser.py <nmap_xml_file>
# for example: ./nmapsummariser.py nmap-full-tcp.xml
#
# Copyright 2015 cornerpirate.
#
# 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 ... | 37.386792 | 156 | 0.571284 |
f27be19b17cff36f9c3d1e71eade08fe4f7ade36 | 4,017 | py | Python | neutron/plugins/openvswitch/common/config.py | ifzing/neutron | 446b13b1c9161048397a3f60306aeead432adbd8 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/openvswitch/common/config.py | ifzing/neutron | 446b13b1c9161048397a3f60306aeead432adbd8 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/openvswitch/common/config.py | ifzing/neutron | 446b13b1c9161048397a3f60306aeead432adbd8 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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
#
#... | 43.663043 | 78 | 0.630321 |
c0d56d9b547e9d84c30a75ec4f27b9e0e9653a35 | 4,906 | py | Python | src/dataloader.py | boostcampaitech2/model-optimization-level3-nlp-14 | b6f561bae7bd991ac7789bbdada7d6561c68092b | [
"MIT"
] | 3 | 2021-12-23T01:31:38.000Z | 2021-12-26T15:30:31.000Z | src/dataloader.py | boostcampaitech2/model-optimization-level3-nlp-14 | b6f561bae7bd991ac7789bbdada7d6561c68092b | [
"MIT"
] | 1 | 2021-12-23T01:31:21.000Z | 2021-12-23T01:31:21.000Z | src/dataloader.py | boostcampaitech2/model-optimization-level3-nlp-14 | b6f561bae7bd991ac7789bbdada7d6561c68092b | [
"MIT"
] | null | null | null | """Tune Model.
- Author: Junghoon Kim, Jongkuk Lim, Jimyeong Kim
- Contact: placidus36@gmail.com, lim.jeikei@gmail.com, wlaud1001@snu.ac.kr
- Reference
https://github.com/j-marple-dev/model_compression
"""
import glob
import os
from typing import Any, Dict, List, Tuple, Union
import torch
import yaml
from torch.u... | 32.706667 | 122 | 0.681818 |
c45fc9bfdd03f7bb9e2044a98cd2f5b40fcdd611 | 17,268 | py | Python | frappe/desk/reportview.py | 8848digital/frappe | 64b506d41ffde1257201fcbfc56de634cdef622b | [
"MIT"
] | null | null | null | frappe/desk/reportview.py | 8848digital/frappe | 64b506d41ffde1257201fcbfc56de634cdef622b | [
"MIT"
] | null | null | null | frappe/desk/reportview.py | 8848digital/frappe | 64b506d41ffde1257201fcbfc56de634cdef622b | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
"""build query for doclistview and return results"""
import frappe, json
import frappe.permissions
from frappe.model.db_query import DatabaseQuery
from frappe.model import default_fields, optional_fields, child_table_fiel... | 27.279621 | 133 | 0.697186 |
9fb090e931e88c651d2deef701c5ad299b67ecd9 | 12,152 | py | Python | E16_DL/src/cs231n/solver.py | Jed-Z/artificial-intelligence-lab | ca5335b13e164230aab4e4a950e930b4d0d94d21 | [
"MIT"
] | 6 | 2020-11-05T04:49:10.000Z | 2022-01-06T06:17:13.000Z | E16_DL/src/cs231n/solver.py | csJed/artificial-intelligence-lab | ca5335b13e164230aab4e4a950e930b4d0d94d21 | [
"MIT"
] | null | null | null | E16_DL/src/cs231n/solver.py | csJed/artificial-intelligence-lab | ca5335b13e164230aab4e4a950e930b4d0d94d21 | [
"MIT"
] | 2 | 2020-11-30T09:14:46.000Z | 2021-10-23T01:03:37.000Z | from __future__ import print_function, division
# from future import standard_library
# standard_library.install_aliases()
from builtins import range
from builtins import object
import os
import pickle as pickle
import numpy as np
from cs231n import optim
class Solver(object):
"""
A Solver encapsulates all ... | 39.583062 | 79 | 0.615454 |
384c5bfd0ae29d477b4d4d28208b5c19e9112c6b | 71,047 | py | Python | homeassistant/components/google_assistant/trait.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/google_assistant/trait.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 60 | 2020-07-06T15:10:30.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/google_assistant/trait.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 4 | 2017-01-10T04:17:33.000Z | 2021-09-02T16:37:24.000Z | """Implement the Google Smart Home traits."""
from __future__ import annotations
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
input_select,
light,
lock,
media_player,
scene,
scrip... | 34.640176 | 99 | 0.599688 |
7bc5da4a0e93f0b653be287151df8f075f11bffe | 6,270 | py | Python | sdk/python/pulumi_azure_native/delegatednetwork/v20200808preview/get_delegated_subnet_service_details.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/delegatednetwork/v20200808preview/get_delegated_subnet_service_details.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/delegatednetwork/v20200808preview/get_delegated_subnet_service_details.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 36.666667 | 189 | 0.657097 |
9972ab8c83a77737907ad98ff086fcd847fec56c | 14,809 | py | Python | experiment/generate_tests.py | haoshuwei/test-infra | 4696b77f4ee7cfffe8e86a8b8e84c797d6846bfd | [
"Apache-2.0"
] | null | null | null | experiment/generate_tests.py | haoshuwei/test-infra | 4696b77f4ee7cfffe8e86a8b8e84c797d6846bfd | [
"Apache-2.0"
] | null | null | null | experiment/generate_tests.py | haoshuwei/test-infra | 4696b77f4ee7cfffe8e86a8b8e84c797d6846bfd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2017 The Kubernetes 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 appl... | 37.586294 | 100 | 0.627254 |
e736ac3d849d12cc977b4baa2e2ed634ae8e2498 | 1,038 | py | Python | examples/script_archive/14b_tuun_minimize.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 33 | 2020-08-30T16:22:35.000Z | 2022-02-26T13:48:32.000Z | examples/script_archive/14b_tuun_minimize.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2021-01-18T19:46:43.000Z | 2021-03-24T09:59:14.000Z | examples/script_archive/14b_tuun_minimize.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2020-08-25T17:02:15.000Z | 2021-04-21T16:40:44.000Z | from tuun.main import Tuun
config = {
'seed': 12,
'acqfunction_config': {'name': 'default', 'acq_str': 'ucb'},
}
tu = Tuun(config)
# Update Tuun using set_config_from_search_space_list
#search_space_list = [('list', ['a', 'b', 'c', 'd', 'e']), ('real', [[-10, 10], [-4, 4]])]
#search_space_list = [('list', ['a... | 39.923077 | 98 | 0.512524 |
8c6523859a99b21393aade5902cdf696fedfdf87 | 4,049 | py | Python | lnbits/extensions/usermanager/views_api.py | blackcoffeexbt/lnbits-legend | a9f2877af77ea56d1900e2b5bc1c21b9b7ac2f64 | [
"MIT"
] | null | null | null | lnbits/extensions/usermanager/views_api.py | blackcoffeexbt/lnbits-legend | a9f2877af77ea56d1900e2b5bc1c21b9b7ac2f64 | [
"MIT"
] | 2 | 2022-03-22T06:27:41.000Z | 2022-03-23T02:05:30.000Z | lnbits/extensions/usermanager/views_api.py | blackcoffeexbt/lnbits-legend | a9f2877af77ea56d1900e2b5bc1c21b9b7ac2f64 | [
"MIT"
] | null | null | null | from http import HTTPStatus
from fastapi import Query
from fastapi.params import Depends
from starlette.exceptions import HTTPException
from lnbits.core import update_user_extension
from lnbits.core.crud import get_user
from lnbits.decorators import WalletTypeInfo, get_key_type
from . import usermanager_ext
from .cr... | 31.632813 | 88 | 0.75673 |
bf7204fc9f7517adcaffe75aa060caf74e0544ab | 2,067 | py | Python | cbagent/collectors/libstats/pool.py | jimwwalker/perfrunner | fda19ce9d860f8548b3feeb761b9a70598500cce | [
"Apache-2.0"
] | null | null | null | cbagent/collectors/libstats/pool.py | jimwwalker/perfrunner | fda19ce9d860f8548b3feeb761b9a70598500cce | [
"Apache-2.0"
] | 4 | 2021-04-20T17:14:17.000Z | 2022-02-11T03:42:49.000Z | cbagent/collectors/libstats/pool.py | jimwwalker/perfrunner | fda19ce9d860f8548b3feeb761b9a70598500cce | [
"Apache-2.0"
] | 1 | 2018-06-25T18:57:10.000Z | 2018-06-25T18:57:10.000Z | from queue import Empty, Queue
from threading import Lock
from time import time
from couchbase.bucket import Bucket
class ClientUnavailableError(Exception):
pass
class BucketWrapper(Bucket):
def __init__(self, **kwargs):
connection_string = 'couchbase://{}:{}/{}'.format(
kwargs['host']... | 27.56 | 76 | 0.565554 |
4ef45e3d7f81a3a42bb6b056c3d007c2f127501e | 1,357 | py | Python | location_analyzer.py | turbotardigrade/fly | b2f2675c9b5f921aecbc0ee1c5a78b4435bc642c | [
"MIT"
] | null | null | null | location_analyzer.py | turbotardigrade/fly | b2f2675c9b5f921aecbc0ee1c5a78b4435bc642c | [
"MIT"
] | null | null | null | location_analyzer.py | turbotardigrade/fly | b2f2675c9b5f921aecbc0ee1c5a78b4435bc642c | [
"MIT"
] | null | null | null | import json
import numpy as np
from sklearn import cluster
def analyze(raw_data):
data = json.loads(raw_data)['locations']
data_size = len(data)
print("# of locations %d" % data_size)
reduceByFactor = 50
locations = [None for _ in xrange(data_size/reduceByFactor+1)]
# Reduce the data size
... | 27.14 | 76 | 0.60059 |
40b7324ce7831c3981a74d978e20f6a008a7c2c3 | 4,685 | py | Python | ProtocolDetector/Engine.py | csandoval/ProtocolDetector | e71960cdba2adbe8e385c033dff1bbcdd6f998e1 | [
"MIT"
] | 9 | 2017-09-10T12:35:12.000Z | 2020-04-20T23:04:29.000Z | ProtocolDetector/Engine.py | csandoval/ProtocolDetector | e71960cdba2adbe8e385c033dff1bbcdd6f998e1 | [
"MIT"
] | null | null | null | ProtocolDetector/Engine.py | csandoval/ProtocolDetector | e71960cdba2adbe8e385c033dff1bbcdd6f998e1 | [
"MIT"
] | 7 | 2017-09-09T16:51:39.000Z | 2020-07-27T16:32:42.000Z | #!/usr/bin/env python
#
#=============================================================================
#
# File Name : Engine.py
# Author : Jose Ramon Palanco <jose.palanco@dinoflux.com>,
# Creation Date : October 2017
#
#
#
#====================================================================... | 26.027778 | 103 | 0.524653 |
c2eddce337241b09bbe13729db72bb8c232f1e63 | 3,340 | py | Python | simplemonitor/Alerters/telegram.py | danieleteti/simplemonitor | e2cb5c22dd72145035f2e68cd9ce90e77fd147c3 | [
"BSD-3-Clause"
] | null | null | null | simplemonitor/Alerters/telegram.py | danieleteti/simplemonitor | e2cb5c22dd72145035f2e68cd9ce90e77fd147c3 | [
"BSD-3-Clause"
] | null | null | null | simplemonitor/Alerters/telegram.py | danieleteti/simplemonitor | e2cb5c22dd72145035f2e68cd9ce90e77fd147c3 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from typing import cast
import requests
from ..Monitors.monitor import Monitor
from ..util import format_datetime
from .alerter import Alerter, register
@register
class TelegramAlerter(Alerter):
"""Send push notification via Telegram."""
type = "telegram"
def __init__(self, config_optio... | 30.09009 | 114 | 0.534731 |
242862b179e4636a0fe407e532968c01331ccb83 | 10,490 | py | Python | tasks.py | knowsuchagency/docker-compose-airflow | ab3fae08793bd304f0027fc9174544802fa2c3fa | [
"Apache-2.0"
] | 7 | 2019-02-23T03:32:12.000Z | 2022-02-14T00:46:09.000Z | tasks.py | knowsuchagency/docker-compose-airflow | ab3fae08793bd304f0027fc9174544802fa2c3fa | [
"Apache-2.0"
] | null | null | null | tasks.py | knowsuchagency/docker-compose-airflow | ab3fae08793bd304f0027fc9174544802fa2c3fa | [
"Apache-2.0"
] | 2 | 2021-09-09T15:39:00.000Z | 2021-12-30T10:16:49.000Z | from concurrent import futures
from functools import partial
from pprint import pprint
from pathlib import Path
import subprocess as sp
import itertools as it
import datetime as dt
import atexit
import os
import re
from importlib_resources import read_text
from invoke import task
from jinja2 import Template
shell ... | 27.036082 | 107 | 0.573403 |
d4d08769ebd2f9be5103cf28918fa5bfce1d615b | 8,584 | py | Python | src/algorithms/a2c_algorithm/a2c/bipedal_walker_agent.py | mnguyen0226/rl_value_based_vs_value_policy_based | 63c49388996c9b6bbe1d9fb3d302147311c8ad93 | [
"MIT"
] | null | null | null | src/algorithms/a2c_algorithm/a2c/bipedal_walker_agent.py | mnguyen0226/rl_value_based_vs_value_policy_based | 63c49388996c9b6bbe1d9fb3d302147311c8ad93 | [
"MIT"
] | null | null | null | src/algorithms/a2c_algorithm/a2c/bipedal_walker_agent.py | mnguyen0226/rl_value_based_vs_value_policy_based | 63c49388996c9b6bbe1d9fb3d302147311c8ad93 | [
"MIT"
] | null | null | null | import torch
import math
import time
import multiprocessing
from algorithms.utils import to_device
import numpy as np
from algorithms.utils import Memory
# Reference: https://github.com/pythonlessons/Reinforcement_Learning/blob/master/BipedalWalker-v3_PPO/BipedalWalker-v3_PPO.py
# Reference: https://slm-lab.gitbook.io... | 32.149813 | 125 | 0.596692 |
eb6cc55c566f1a2f5efc92ad36e74c79cf40334d | 4,180 | py | Python | CoGanh/pytorch/NNet.py | vietnguyen2000/Reversi | d920f574853f359d6f6e2c436bdd951b1759dcd7 | [
"MIT"
] | null | null | null | CoGanh/pytorch/NNet.py | vietnguyen2000/Reversi | d920f574853f359d6f6e2c436bdd951b1759dcd7 | [
"MIT"
] | 2 | 2021-07-18T13:18:00.000Z | 2021-07-18T13:19:35.000Z | CoGanh/pytorch/NNet.py | vietnguyen2000/Reversi | d920f574853f359d6f6e2c436bdd951b1759dcd7 | [
"MIT"
] | null | null | null | import os
import sys
import time
import numpy as np
from tqdm import tqdm
sys.path.append('../../')
from utils import *
from NeuralNet import NeuralNet
import torch
import torch.optim as optim
from .CoGanhNNet import CoGanhNNet as onnet
args = dotdict({
'lr': 0.001,
'dropout': 0.3,
'epochs': 10,
'... | 34.262295 | 141 | 0.586603 |
f04bcab66a3b1cd8218a459d28674499bbf0e175 | 160 | py | Python | yt/frontends/athena/api.py | Xarthisius/yt | 321643c3abff64a6f132d98d0747f3558f7552a3 | [
"BSD-3-Clause-Clear"
] | 360 | 2017-04-24T05:06:04.000Z | 2022-03-31T10:47:07.000Z | yt/frontends/athena/api.py | Xarthisius/yt | 321643c3abff64a6f132d98d0747f3558f7552a3 | [
"BSD-3-Clause-Clear"
] | 2,077 | 2017-04-20T20:36:07.000Z | 2022-03-31T16:39:43.000Z | yt/frontends/athena/api.py | stonnes/yt | aad3cfa3b4ebab7838352ab467275a27c26ff363 | [
"BSD-3-Clause-Clear"
] | 257 | 2017-04-19T20:52:28.000Z | 2022-03-29T12:23:52.000Z | from . import tests
from .data_structures import AthenaDataset, AthenaGrid, AthenaHierarchy
from .fields import AthenaFieldInfo
from .io import IOHandlerAthena
| 32 | 71 | 0.85 |
f336b3d3ebedfc8fb926a2206f15497b5ef28776 | 2,858 | py | Python | launch/obstacles.py | FaHoLo/Rocket_launch | 5c3c74ba7f6f8ab454bf875421c91a2d15ff16d8 | [
"MIT"
] | null | null | null | launch/obstacles.py | FaHoLo/Rocket_launch | 5c3c74ba7f6f8ab454bf875421c91a2d15ff16d8 | [
"MIT"
] | null | null | null | launch/obstacles.py | FaHoLo/Rocket_launch | 5c3c74ba7f6f8ab454bf875421c91a2d15ff16d8 | [
"MIT"
] | null | null | null | import asyncio
from utils import draw_frame
class Obstacle:
def __init__(self, row, column, rows_size=1, columns_size=1, uid=None):
self.row = row
self.column = column
self.rows_size = rows_size
self.columns_size = columns_size
self.uid = uid
def get_bounding_box_fra... | 31.406593 | 100 | 0.653604 |
da9d20770908712b38c3e472be0ce8609dd0f48b | 746 | py | Python | framework/dataset.py | Jincheng-Sun/Kylearn | ba6cd80c97e155d4bb4791b3ae74135bc1365064 | [
"Apache-2.0"
] | null | null | null | framework/dataset.py | Jincheng-Sun/Kylearn | ba6cd80c97e155d4bb4791b3ae74135bc1365064 | [
"Apache-2.0"
] | null | null | null | framework/dataset.py | Jincheng-Sun/Kylearn | ba6cd80c97e155d4bb4791b3ae74135bc1365064 | [
"Apache-2.0"
] | 3 | 2019-07-07T06:37:52.000Z | 2019-09-10T20:32:34.000Z | import numpy as np
from utils.mini_batch import random_index
class Dataset:
def __init__(self, **kwargs):
self.train_set = None
self.eval_set = None
self.test_set = None
def evaluation_generator(self, batch_size=100):
print(len(self.eval_set))
def generate():
... | 26.642857 | 80 | 0.636729 |
15ee06ae5d68c6219144e8165502ffb0d7a03a0a | 882 | py | Python | blockchain_base/readFAT.py | benevolentPreta/49900 | 77d6d36fca17876e588b7ab0858c334dc5f871de | [
"BSD-2-Clause"
] | null | null | null | blockchain_base/readFAT.py | benevolentPreta/49900 | 77d6d36fca17876e588b7ab0858c334dc5f871de | [
"BSD-2-Clause"
] | null | null | null | blockchain_base/readFAT.py | benevolentPreta/49900 | 77d6d36fca17876e588b7ab0858c334dc5f871de | [
"BSD-2-Clause"
] | null | null | null | from blockchain import Blockchain
local_blockchain = Blockchain()
# Note 'fat.txt' must be located in the same directory as readFAT.py
def add_block_from_file():
with open('fat.txt', 'r') as FAT:
data = FAT.read()
local_blockchain.add_block(data)
# save blockchain to file
def saveB... | 29.4 | 69 | 0.653061 |
8687be2904ec8ef1773b10209d9089232c101491 | 894 | py | Python | pip_http_cfb.py | YulongWu/my-utils | 37dff5abd6e27b69ee04ff8c194fcf2fb5178360 | [
"MIT"
] | null | null | null | pip_http_cfb.py | YulongWu/my-utils | 37dff5abd6e27b69ee04ff8c194fcf2fb5178360 | [
"MIT"
] | null | null | null | pip_http_cfb.py | YulongWu/my-utils | 37dff5abd6e27b69ee04ff8c194fcf2fb5178360 | [
"MIT"
] | null | null | null | #coding: u8
import sys
reload(sys)
sys.setdefaultencoding('u8')
from sets import Set
import urllib
import urllib2
import json
# call format:
ids = Set()
# call format: cat data_evaluate/top500.v2.type_heshe.docid.txt | python ~/gitsvnlib/YulongUtils/http_dataFetcher.py > data_evaluate/top500.v2.type_heshe.docid.re... | 28.83871 | 171 | 0.64877 |
a3daf966398100f2fad450bb08cece866fa135f3 | 3,026 | py | Python | pype/plugins/maya/publish/extract_animation.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | pype/plugins/maya/publish/extract_animation.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | pype/plugins/maya/publish/extract_animation.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | import os
from maya import cmds
import avalon.maya
import pype.api
from pype.maya.lib import extract_alembic
class ExtractAnimation(pype.api.Extractor):
"""Produce an alembic of just point positions and normals.
Positions and normals, uvs, creases are preserved, but nothing more,
for plain and predicta... | 32.891304 | 77 | 0.555849 |
796e30e65a74232dd879a0e86b919b3c9324935c | 11,119 | py | Python | security_monkey/tests/auditors/test_elasticsearch_service.py | cncoder/security_monkey | 7d14c00e6c18a0edf87830ff4191007b6296b945 | [
"Apache-2.0"
] | null | null | null | security_monkey/tests/auditors/test_elasticsearch_service.py | cncoder/security_monkey | 7d14c00e6c18a0edf87830ff4191007b6296b945 | [
"Apache-2.0"
] | null | null | null | security_monkey/tests/auditors/test_elasticsearch_service.py | cncoder/security_monkey | 7d14c00e6c18a0edf87830ff4191007b6296b945 | [
"Apache-2.0"
] | 1 | 2019-06-15T14:03:34.000Z | 2019-06-15T14:03:34.000Z | # Copyright 2014 Netflix, 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... | 30.051351 | 120 | 0.525587 |
3b62c7e55ca3c87ae0941699748e5ebc837b4f65 | 728 | py | Python | emit_logs.py | it490-wizards/logging-system | 19ba89315f1a4088adc595ce27687dc8688a8926 | [
"MIT"
] | null | null | null | emit_logs.py | it490-wizards/logging-system | 19ba89315f1a4088adc595ce27687dc8688a8926 | [
"MIT"
] | 1 | 2021-11-04T16:28:08.000Z | 2021-11-04T16:28:08.000Z | emit_logs.py | it490-wizards/logging-system | 19ba89315f1a4088adc595ce27687dc8688a8926 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import dotenv
import pika
dotenv.load_dotenv()
connection = pika.BlockingConnection(
pika.ConnectionParameters(
host=os.getenv("PIKA_HOST"),
port=os.getenv("PIKA_PORT"),
virtual_host=os.getenv("PIKA_VIRTUAL_HOST"),
credentials=pika.Pla... | 23.483871 | 68 | 0.681319 |
30759d17ffae0ed3731b72b481eeeacaa8c09464 | 378 | py | Python | TRANSFORM/Resources/Scripts/jModelica/Fluid/TraceComponents/Examples/TraceSeparator_Test.py | greenwoodms/TRANSFORM-Library | dc152d4f0298d3f18385f2ea33645d87d7812915 | [
"Apache-2.0"
] | 29 | 2018-04-24T17:06:19.000Z | 2021-11-21T05:17:28.000Z | TRANSFORM/Resources/Scripts/jModelica/Fluid/TraceComponents/Examples/TraceSeparator_Test.py | greenwoodms/TRANSFORM-Library | dc152d4f0298d3f18385f2ea33645d87d7812915 | [
"Apache-2.0"
] | 13 | 2018-04-05T08:34:27.000Z | 2021-10-04T14:24:41.000Z | TRANSFORM/Resources/Scripts/jModelica/Fluid/TraceComponents/Examples/TraceSeparator_Test.py | greenwoodms/TRANSFORM-Library | dc152d4f0298d3f18385f2ea33645d87d7812915 | [
"Apache-2.0"
] | 17 | 2018-08-06T22:18:01.000Z | 2022-01-29T21:38:17.000Z | from pymodelica import compile_fmu
from pyfmi import load_fmu
libPath = r'C:\Users\vmg\Documents\Modelica\TRANSFORM-Library/TRANSFORM'
modelName = 'TRANSFORM.Fluid.TraceComponents.Examples.TraceSeparator_Test'
fmu = compile_fmu(modelName,libPath,target='cs')
model = load_fmu(fmu)
opts = model.simulate_options()
opts... | 27 | 74 | 0.804233 |
7554ca373efa1f2003d3a5588e1d0731c8ac1a3d | 1,267 | py | Python | envisage/tests/eggs/acme.bar/acme/bar/bar_plugin.py | enthought/envisage | ca57225c4e9022d1ed5299a60e13dc2290d7d94e | [
"BSD-3-Clause"
] | 51 | 2015-05-12T01:34:15.000Z | 2022-03-20T19:11:22.000Z | envisage/tests/eggs/acme.bar/acme/bar/bar_plugin.py | enthought/envisage | ca57225c4e9022d1ed5299a60e13dc2290d7d94e | [
"BSD-3-Clause"
] | 347 | 2015-02-27T19:51:09.000Z | 2022-03-21T16:03:01.000Z | envisage/tests/eggs/acme.bar/acme/bar/bar_plugin.py | enthought/envisage | ca57225c4e9022d1ed5299a60e13dc2290d7d94e | [
"BSD-3-Clause"
] | 11 | 2015-02-11T04:32:54.000Z | 2021-09-13T10:50:05.000Z | # (C) Copyright 2007-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... | 27.543478 | 79 | 0.523283 |
af548069102b1e1044ae1af107914d13e27da094 | 7,538 | py | Python | pw_build/py/pw_build/generated_tests.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 86 | 2021-03-09T23:49:40.000Z | 2022-03-30T08:14:51.000Z | pw_build/py/pw_build/generated_tests.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 4 | 2021-07-27T20:32:03.000Z | 2022-03-08T10:39:07.000Z | pw_build/py/pw_build/generated_tests.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 22 | 2021-03-11T15:15:47.000Z | 2022-02-09T06:16:36.000Z | # Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.420091 | 80 | 0.632263 |
f3c4d7b2ed363bead210319e87549101af368edd | 18,628 | py | Python | tuun/probo/models/gpystan/gp_stan_matern.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 33 | 2020-08-30T16:22:35.000Z | 2022-02-26T13:48:32.000Z | tuun/probo/models/gpystan/gp_stan_matern.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2021-01-18T19:46:43.000Z | 2021-03-24T09:59:14.000Z | tuun/probo/models/gpystan/gp_stan_matern.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2020-08-25T17:02:15.000Z | 2021-04-21T16:40:44.000Z | """
Classes for GP models with Stan.
"""
from argparse import Namespace
import copy
import numpy as np
from .stan.gp import get_model as get_model_gp
from .stan.gp_fixedsig_matern import get_model as get_model_gp_fixedsig
from .gp.gp_utils import kern_matern, sample_mvn, gp_post
from .util.data_transform import DataT... | 35.823077 | 127 | 0.544127 |
0e830441d9c25e71605d6a476b796a10c6ebb0c9 | 223 | py | Python | src/cdf/__init__.py | ana-balica/classy-django-forms | fd44f365cd5da27ef7087977dd30f45501ecd338 | [
"MIT"
] | 23 | 2017-08-20T05:31:16.000Z | 2022-01-26T13:43:20.000Z | src/cdf/__init__.py | ana-balica/classy-django-forms | fd44f365cd5da27ef7087977dd30f45501ecd338 | [
"MIT"
] | null | null | null | src/cdf/__init__.py | ana-balica/classy-django-forms | fd44f365cd5da27ef7087977dd30f45501ecd338 | [
"MIT"
] | 1 | 2020-01-04T14:58:26.000Z | 2020-01-04T14:58:26.000Z | import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
)
django.setup()
| 15.928571 | 51 | 0.55157 |
327a8b147d9b80ee67753b73bd6e6ed731138beb | 418 | py | Python | UpdateDependencies.py | MarcelPiNacy/Zero | 4d5e01c01ffa171fe5db2b641eec7bca03ccea00 | [
"Apache-2.0"
] | null | null | null | UpdateDependencies.py | MarcelPiNacy/Zero | 4d5e01c01ffa171fe5db2b641eec7bca03ccea00 | [
"Apache-2.0"
] | null | null | null | UpdateDependencies.py | MarcelPiNacy/Zero | 4d5e01c01ffa171fe5db2b641eec7bca03ccea00 | [
"Apache-2.0"
] | null | null | null | import os
import pathlib
import json
wd = str(pathlib.Path().cwd())
file = open("dependencies.json")
d = json.load(file)
for name, url in d["dependencies"] :
print("--- Updating " + name + " ---")
if os.path.isdir(wd + "/dependencies/" + name + "/"):
os.system("git -C " + wd + "/dependencies/" + name +... | 29.857143 | 76 | 0.569378 |
b9ffd1cd9d8d96f4b3604983d57c44df65361616 | 3,290 | py | Python | scripts/update_dreqs/update_dreqs_0327.py | jonseddon/primavera-dmt | 1239044e37f070b925a3d06db68351f285df780c | [
"BSD-3-Clause"
] | null | null | null | scripts/update_dreqs/update_dreqs_0327.py | jonseddon/primavera-dmt | 1239044e37f070b925a3d06db68351f285df780c | [
"BSD-3-Clause"
] | 49 | 2018-11-14T17:00:03.000Z | 2021-12-20T11:04:22.000Z | scripts/update_dreqs/update_dreqs_0327.py | jonseddon/primavera-dmt | 1239044e37f070b925a3d06db68351f285df780c | [
"BSD-3-Clause"
] | 2 | 2018-07-04T10:58:43.000Z | 2018-09-29T14:55:08.000Z | #!/usr/bin/env python
"""
update_dreqs_0327.py
Remove from the DMT the CMCC tasmax and tasmin variables from all experiments
(there should be 40 datasets in total) as per
https://errata.es-doc.org/static/view.html?uid=9b40a054-21a7-5ae7-a3eb-8c373c5adddc
"""
import argparse
import logging.config
import sys
import dja... | 29.375 | 83 | 0.597568 |
d730293ba7127f680f41e73602fbb18d5e5060e2 | 1,958 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/base_theme_day.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/base_theme_day.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/base_theme_day.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram 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... | 30.59375 | 103 | 0.62666 |
f74e08e4c8d1d1fe496413d1edcd2c47c6720d19 | 1,230 | py | Python | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 9 | 2021-12-07T07:52:28.000Z | 2022-03-23T10:26:25.000Z | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 71 | 2021-12-03T09:40:56.000Z | 2022-03-29T21:47:38.000Z | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 3 | 2021-12-07T07:52:32.000Z | 2022-02-17T09:55:00.000Z | """ Module containing DocumentPublisher class """
from ..common.common import SectionHandler
# pylint: disable=too-few-public-methods
class DocumentPublisher(SectionHandler):
""" Responsible for converting the DocumentPublisher section:
- /cvrf:cvrfdoc/cvrf:DocumentPublisher
"""
type_category_mappi... | 36.176471 | 87 | 0.669919 |
cb9b2a22ce2ce8fb200db65114f83c6c7f74f6bd | 3,019 | py | Python | programaestudiante.py | josepive/bigdataclass | e432043eba23fef3e9a02df8a3a42a0a331a88e4 | [
"Apache-2.0"
] | null | null | null | programaestudiante.py | josepive/bigdataclass | e432043eba23fef3e9a02df8a3a42a0a331a88e4 | [
"Apache-2.0"
] | null | null | null | programaestudiante.py | josepive/bigdataclass | e432043eba23fef3e9a02df8a3a42a0a331a88e4 | [
"Apache-2.0"
] | null | null | null | from pyspark.sql import SparkSession
from pyspark.sql.types import (DateType, IntegerType, FloatType,
StringType, StructField, StructType, TimestampType)
from pyspark.sql.functions import sum, round, when, count
def join_dataframes(estudiante_df, curso_df, nota_df):
estudiant... | 33.175824 | 126 | 0.600199 |
3e858a880ed3cf2e17c514e41cd47a4f0ccbe43f | 912 | py | Python | backend/searchevents/migrations/0001_initial.py | buubblegun/berry | 5d0e27d39b618a7161b53e5bb735dab570faf14b | [
"MIT"
] | null | null | null | backend/searchevents/migrations/0001_initial.py | buubblegun/berry | 5d0e27d39b618a7161b53e5bb735dab570faf14b | [
"MIT"
] | null | null | null | backend/searchevents/migrations/0001_initial.py | buubblegun/berry | 5d0e27d39b618a7161b53e5bb735dab570faf14b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-02 00:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event'... | 31.448276 | 114 | 0.596491 |
b223f8f65b5c9fdb4dc325cdf92d113711f56c59 | 3,008 | py | Python | tests/test_jao.py | Open-Dataplatform/osiris-egress-api | e4f759b835ec06b129bb92409c06195c0cfb2492 | [
"MIT"
] | 1 | 2021-06-16T14:17:41.000Z | 2021-06-16T14:17:41.000Z | tests/test_jao.py | Open-Dataplatform/osiris-egress-api | e4f759b835ec06b129bb92409c06195c0cfb2492 | [
"MIT"
] | 5 | 2021-06-07T20:39:03.000Z | 2022-02-16T14:27:48.000Z | tests/test_jao.py | Open-Dataplatform/osiris-egress-api | e4f759b835ec06b129bb92409c06195c0cfb2492 | [
"MIT"
] | 1 | 2021-03-29T08:17:50.000Z | 2021-03-29T08:17:50.000Z | from http import HTTPStatus
from io import BytesIO
import pandas as pd
from tests.conftest import client
from tests.conftest import ACCESS_TOKEN
def test_download_jao(mocker):
import app.routers.jao
download_parquet_data = mocker.patch('app.routers.jao.download_parquet_data_v1')
download_parquet_data.retu... | 38.075949 | 135 | 0.668883 |
e8cb45198216b54a6b423939b444b9436a97e6f2 | 496 | py | Python | 1342.number-of-steps-to-reduce-a-number-to-zero.py | dely2p/Leetcode | 2463f512d9051707df9864dffe7f3f3c12d18eab | [
"MIT"
] | 1 | 2020-07-08T05:13:05.000Z | 2020-07-08T05:13:05.000Z | 1342.number-of-steps-to-reduce-a-number-to-zero.py | dely2p/Leetcode | 2463f512d9051707df9864dffe7f3f3c12d18eab | [
"MIT"
] | null | null | null | 1342.number-of-steps-to-reduce-a-number-to-zero.py | dely2p/Leetcode | 2463f512d9051707df9864dffe7f3f3c12d18eab | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=1342 lang=python3
#
# [1342] Number of Steps to Reduce a Number to Zero
#
# @lc code=start
class Solution:
def numberOfSteps (self, num: int) -> int:
result = num
cnt = 0
while True:
if result == 0:
break
if result % 2 == 0:
... | 19.84 | 51 | 0.469758 |
6b6add87e384994b77b69c941bb7bcfa57572b2d | 663 | py | Python | airflow/dags/my_dag_example.py | zkan/try-airflow | d2f008ce2e19983e88e77b46534824c214ad0399 | [
"MIT"
] | 1 | 2017-01-15T13:53:01.000Z | 2017-01-15T13:53:01.000Z | airflow/dags/my_dag_example.py | zkan/try-airflow | d2f008ce2e19983e88e77b46534824c214ad0399 | [
"MIT"
] | 10 | 2017-02-15T07:31:08.000Z | 2022-03-29T22:28:10.000Z | airflow/dags/my_dag_example.py | zkan/try-airflow | d2f008ce2e19983e88e77b46534824c214ad0399 | [
"MIT"
] | 1 | 2017-02-15T07:03:16.000Z | 2017-02-15T07:03:16.000Z | from datetime import datetime
from airflow import DAG
from airflow.operators.bash import BashOperator
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 5, 8),
'email': ['zkan@hey.com']
}
dag = DAG(
'my_dag_example',
default_args=default_args,
sche... | 16.575 | 47 | 0.627451 |
d37f6b6f65b2da4d2acf77cc286e32c51ffa165a | 314 | py | Python | benchmark/python-cgi/handler.py | rrramiro/dinosaur | 3fd147f204bae609717d7a2093a161849dc7e31a | [
"WTFPL"
] | 40 | 2017-04-27T00:07:16.000Z | 2019-08-20T00:54:52.000Z | benchmark/python-cgi/handler.py | rrramiro/dinosaur | 3fd147f204bae609717d7a2093a161849dc7e31a | [
"WTFPL"
] | null | null | null | benchmark/python-cgi/handler.py | rrramiro/dinosaur | 3fd147f204bae609717d7a2093a161849dc7e31a | [
"WTFPL"
] | 1 | 2019-10-22T12:28:13.000Z | 2019-10-22T12:28:13.000Z | #!/usr/bin/env python3
import os, cgi, sys
if __name__ == "__main__":
fields = cgi.FieldStorage()
path_info = os.environ.get("PATH_INFO","")
path_components = path_info.split("/")
sys.stdout.write("Content-type: text/html\r\n\r\n")
print("hello\n")
print(fields)
print(path_components) | 28.545455 | 55 | 0.659236 |
1e8098986583366a43db7aacfcd34400fd4a36af | 2,042 | py | Python | metaconfigure/collect_subprojects.py | njoy/pdqsort-adapter | 4da5dec7cc809a1b97c40a1fac4202565c08de7e | [
"Zlib"
] | null | null | null | metaconfigure/collect_subprojects.py | njoy/pdqsort-adapter | 4da5dec7cc809a1b97c40a1fac4202565c08de7e | [
"Zlib"
] | 3 | 2019-10-29T22:49:18.000Z | 2019-11-13T16:10:03.000Z | metaconfigure/collect_subprojects.py | njoy/knoop | 411e624a54f03969081b5b4dfa257ade5d979362 | [
"FSFAP"
] | null | null | null | #! /usr/bin/env python
"""
A script to generate a flat subproject directory from a tree of dependency directories
"""
import os
import subprocess
import textwrap
import json
import shutil
import sys
import warnings
def project_name():
return os.path.split( os.getcwd() )[1]
def dependency_directory():
"""
... | 32.935484 | 86 | 0.580803 |
1826a01666f56b2cf58fb06fc36fed38c3902d6f | 4,420 | py | Python | css/image-fit/reftests/img-jpg-wide/build.py | gsnedders/presto-testo | a0acfbef13a3f8cae67cc7145216d31b67aa8eb4 | [
"BSD-3-Clause"
] | null | null | null | css/image-fit/reftests/img-jpg-wide/build.py | gsnedders/presto-testo | a0acfbef13a3f8cae67cc7145216d31b67aa8eb4 | [
"BSD-3-Clause"
] | null | null | null | css/image-fit/reftests/img-jpg-wide/build.py | gsnedders/presto-testo | a0acfbef13a3f8cae67cc7145216d31b67aa8eb4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import sys
import os
sys.path.insert(0, os.path.abspath("../../include/"))
import allpairs
imgfilename = 'wide.jpg'
imgwidth = 240.0
imgheight = 128.0
test_template = """<!doctype html>
<!-- This file is generated by build.py. -->
<title>img %s; %s</title>
<link rel="stylesheet" href="../../support/... | 30.068027 | 101 | 0.500452 |
477ecbfb0e22de84f22778a42662ecd96182e4e9 | 34,235 | py | Python | integration-tests/clipper_admin_tests.py | Evan-JH-Kim/clipper | 85b508b2c2fdd6f6122a27648c8cdf5e69a751e9 | [
"Apache-2.0"
] | null | null | null | integration-tests/clipper_admin_tests.py | Evan-JH-Kim/clipper | 85b508b2c2fdd6f6122a27648c8cdf5e69a751e9 | [
"Apache-2.0"
] | null | null | null | integration-tests/clipper_admin_tests.py | Evan-JH-Kim/clipper | 85b508b2c2fdd6f6122a27648c8cdf5e69a751e9 | [
"Apache-2.0"
] | null | null | null | """
Executes a test suite consisting of two separate cases: short tests and long tests.
Before each case, an instance of Clipper is created. Tests
are then performed by invoking methods on this instance, often resulting
in the execution of docker commands.
"""
from __future__ import absolute_import, division, print_fu... | 38.552928 | 90 | 0.623076 |
01567cead6a49028215e38c5750da5add571280f | 3,788 | py | Python | graph_inference/solver/greedysolver.py | codyhan94/epidemic-graph-inference | 4b9f4cf76dd427bbc182e0f6d8fad8ce127172c0 | [
"MIT"
] | null | null | null | graph_inference/solver/greedysolver.py | codyhan94/epidemic-graph-inference | 4b9f4cf76dd427bbc182e0f6d8fad8ce127172c0 | [
"MIT"
] | null | null | null | graph_inference/solver/greedysolver.py | codyhan94/epidemic-graph-inference | 4b9f4cf76dd427bbc182e0f6d8fad8ce127172c0 | [
"MIT"
] | null | null | null | from pdb import set_trace
from graph_inference.solver.basesolver import BaseSolver
from collections import Counter
import numpy as np
import networkx as nx
class GreedySolver(BaseSolver):
"""A simple greedy algorithm for determining parental neighborhoods.
The algorithm comes from Netrapalli's paper.
"... | 35.735849 | 79 | 0.606125 |
e03336bb4d3a985046951faada01906906d2503e | 2,092 | py | Python | pystatsm/tests/lvcorr_test.py | lukepinkel/pystatsm | baa9078a73ab32ec21347aea65555a3f81f10149 | [
"MIT"
] | null | null | null | pystatsm/tests/lvcorr_test.py | lukepinkel/pystatsm | baa9078a73ab32ec21347aea65555a3f81f10149 | [
"MIT"
] | null | null | null | pystatsm/tests/lvcorr_test.py | lukepinkel/pystatsm | baa9078a73ab32ec21347aea65555a3f81f10149 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 9 14:09:39 2022
@author: lukepinkel
"""
import numpy as np
from pystatsm.pylvcorr.sim_lvcorr import LVCorrSim
from pystatsm.pylvcorr.lvcorr import Polychoric, Polyserial
from pystatsm.utilities.numerical_derivs import fo_fc_cd, so_gc_cd
def test... | 32.184615 | 93 | 0.663002 |
e4bb7224a410cb1bc79fb2b1cf9d6ca8119c27d7 | 6,988 | py | Python | synapse/config/appservice.py | nordeck/synapse | 637df95de63196033a6da4a6e286e1d58ea517b6 | [
"Apache-2.0"
] | 1 | 2021-05-10T09:44:01.000Z | 2021-05-10T09:44:01.000Z | synapse/config/appservice.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | null | null | null | synapse/config/appservice.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 1 | 2021-01-29T01:37:46.000Z | 2021-01-29T01:37:46.000Z | # Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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
#
# ... | 38.185792 | 88 | 0.617487 |
ace32ad48024bf33296c6a4a972fb33c11032244 | 2,387 | py | Python | configs/textdet/maskrcnn/mask_rcnn_r50_fpn_160e_ctw1500.py | xyzhu8/mmocr | f62b4513f5411bde9f24e1902b1cb1945340022a | [
"Apache-2.0"
] | null | null | null | configs/textdet/maskrcnn/mask_rcnn_r50_fpn_160e_ctw1500.py | xyzhu8/mmocr | f62b4513f5411bde9f24e1902b1cb1945340022a | [
"Apache-2.0"
] | null | null | null | configs/textdet/maskrcnn/mask_rcnn_r50_fpn_160e_ctw1500.py | xyzhu8/mmocr | f62b4513f5411bde9f24e1902b1cb1945340022a | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/models/ocr_mask_rcnn_r50_fpn_ohem_poly.py',
'../../_base_/schedules/schedule_160e.py', '../../_base_/runtime_10e.py'
]
dataset_type = 'IcdarDataset'
data_root = 'data/ctw1500/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
# img_norm... | 34.1 | 77 | 0.624214 |
ce50ab6d59bbc6c98edaa79debd16b6ea94c7ae1 | 1,742 | py | Python | tests/test_app.py | SkymindIO/policy-server | 167fcca8a6b808f70a9e9dff25d04eb54be73601 | [
"Apache-2.0"
] | null | null | null | tests/test_app.py | SkymindIO/policy-server | 167fcca8a6b808f70a9e9dff25d04eb54be73601 | [
"Apache-2.0"
] | null | null | null | tests/test_app.py | SkymindIO/policy-server | 167fcca8a6b808f70a9e9dff25d04eb54be73601 | [
"Apache-2.0"
] | null | null | null | import ray
from fastapi.testclient import TestClient
from app import app
from generate import CLI
# Set up server
CLI.copy_server_files("examples/mouse_and_cheese")
client = TestClient(app)
def test_health_check():
response = client.get("/")
assert response.status_code == 200
assert response.json() == "... | 23.540541 | 74 | 0.629736 |
c5333c27498927fbb68263641578a51baa1e4534 | 1,346 | py | Python | Algorithms on Strings/week2/_529f54ab2b45544c6c1f6b380b6cdeff_Programming-Assignment-2/bwmatching/bwmatching.py | DuyTungHa/Algorithms-and-Data-Structures | d8c40f9788f255ac28ab2f5a6cf7be73f8435412 | [
"MIT"
] | 26 | 2019-05-18T09:59:02.000Z | 2022-01-09T01:04:10.000Z | Algorithms on Strings/week2/_529f54ab2b45544c6c1f6b380b6cdeff_Programming-Assignment-2/bwmatching/bwmatching.py | DuyTungHa/Algorithms-and-Data-Structures | d8c40f9788f255ac28ab2f5a6cf7be73f8435412 | [
"MIT"
] | null | null | null | Algorithms on Strings/week2/_529f54ab2b45544c6c1f6b380b6cdeff_Programming-Assignment-2/bwmatching/bwmatching.py | DuyTungHa/Algorithms-and-Data-Structures | d8c40f9788f255ac28ab2f5a6cf7be73f8435412 | [
"MIT"
] | 8 | 2020-01-19T15:45:07.000Z | 2021-01-09T08:51:41.000Z | # python3
import sys
def PreprocessBWT(bwt):
compact = {'A':0, 'G':0, 'C':0, 'T':0, '$':0}
starts = dict()
occ_counts_before = dict()
for c in 'ACTG$':
occ_counts_before[c] = {0:0}
for i in range(len(bwt)):
compact[bwt[i]] += 1
for k in occ_counts_before:
occ_counts_before[k][i+1] = compac... | 26.392157 | 87 | 0.631501 |
70501a9106babc948b13894c3f63033293f4f73d | 3,032 | py | Python | mythril/support/opcodes.py | jhutchings1/mythril | 00d445ace1496afb54ee0936e1779216883f714a | [
"MIT"
] | 1 | 2020-09-26T07:42:03.000Z | 2020-09-26T07:42:03.000Z | mythril/support/opcodes.py | strawberrylady99/mythril | 727d5f3049333f71ccd90a95ca8fe13368aa9c15 | [
"MIT"
] | null | null | null | mythril/support/opcodes.py | strawberrylady99/mythril | 727d5f3049333f71ccd90a95ca8fe13368aa9c15 | [
"MIT"
] | 1 | 2020-08-28T01:17:16.000Z | 2020-08-28T01:17:16.000Z | # This pyethereum opcodes file with added opcodes
from typing import Dict, Tuple
opcodes = {
0x00: ("STOP", 0, 0, 0),
0x01: ("ADD", 2, 1, 3),
0x02: ("MUL", 2, 1, 5),
0x03: ("SUB", 2, 1, 3),
0x04: ("DIV", 2, 1, 5),
0x05: ("SDIV", 2, 1, 5),
0x06: ("MOD", 2, 1, 5),
0x07: ("SMOD", 2, 1, 5),... | 31.257732 | 58 | 0.460092 |
62c3189bf4790830f9a25c125516faf2e334316d | 832 | py | Python | examples/inverse/snr_estimate.py | stevemats/mne-python | 47051833f21bb372d60afc3adbf4305648ac7f69 | [
"BSD-3-Clause"
] | 1,953 | 2015-01-17T20:33:46.000Z | 2022-03-30T04:36:34.000Z | examples/inverse/snr_estimate.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | 8,490 | 2015-01-01T13:04:18.000Z | 2022-03-31T23:02:08.000Z | examples/inverse/snr_estimate.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | 1,130 | 2015-01-08T22:39:27.000Z | 2022-03-30T21:44:26.000Z | # -*- coding: utf-8 -*-
"""
==================================
Estimate data SNR using an inverse
==================================
This estimates the SNR as a function of time for a set of data
using a minimum-norm inverse operator.
"""
# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
# %%
... | 25.212121 | 68 | 0.692308 |
f3db4617d838e5a2a0a00c5911102b5b46a54cf9 | 522 | py | Python | 00_simple_examples/09_compress.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | 1 | 2020-05-11T18:39:54.000Z | 2020-05-11T18:39:54.000Z | 00_simple_examples/09_compress.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | null | null | null | 00_simple_examples/09_compress.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | null | null | null | # from itertools import compress
# data = range(10)
# print(list(data))
# even_selector = [1, 0] * 10
# odd_selector = [0, 1] * 10
# print(even_selector)
# even_numbers = list(compress(data, even_selector))
# #odd_numbers = list(compress(data, odd_selector))
# print(even_numbers)
# # print(odd_selector)
# # print(list(... | 26.1 | 52 | 0.718391 |
4af1082cc551c03303f68a3e51512f88b069a5b1 | 27,147 | py | Python | gcloud/test__helpers.py | waprin/google-cloud-python | 4456c707e7b915c28d5fdaf5771d203185830dd3 | [
"Apache-2.0"
] | null | null | null | gcloud/test__helpers.py | waprin/google-cloud-python | 4456c707e7b915c28d5fdaf5771d203185830dd3 | [
"Apache-2.0"
] | null | null | null | gcloud/test__helpers.py | waprin/google-cloud-python | 4456c707e7b915c28d5fdaf5771d203185830dd3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.603027 | 78 | 0.633882 |
cc729352cbcee7499b72167cb80659bf697e384e | 1,027 | py | Python | kubernetes/test/test_v1_controller_revision_list.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_controller_revision_list.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_controller_revision_list.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | 1 | 2018-07-19T16:37:20.000Z | 2018-07-19T16:37:20.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | 22.822222 | 105 | 0.727361 |
9b7ca8b0491df3b170b97e672cc888a7d287613f | 1,446 | py | Python | setup.py | bretth/auth0plus | a5e82b0cabe8a404530a3a444ab83ae352f59b66 | [
"0BSD"
] | 3 | 2016-09-15T14:57:23.000Z | 2021-03-21T08:16:21.000Z | setup.py | bretth/auth0plus | a5e82b0cabe8a404530a3a444ab83ae352f59b66 | [
"0BSD"
] | 1 | 2017-05-19T03:15:05.000Z | 2017-05-19T03:16:00.000Z | setup.py | bretth/auth0plus | a5e82b0cabe8a404530a3a444ab83ae352f59b66 | [
"0BSD"
] | 1 | 2020-10-15T06:43:35.000Z | 2020-10-15T06:43:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'req... | 24.508475 | 70 | 0.614799 |
954f093bd6af5ded50be52c3219d99f27ec05ded | 53,050 | py | Python | lib/tool_shed/util/admin_util.py | lesperry/Metagenomics | a1d8b7d96b32ab83cebe513e889b6ef82f7c1dd6 | [
"CC-BY-3.0"
] | null | null | null | lib/tool_shed/util/admin_util.py | lesperry/Metagenomics | a1d8b7d96b32ab83cebe513e889b6ef82f7c1dd6 | [
"CC-BY-3.0"
] | 2 | 2020-08-19T18:14:59.000Z | 2020-08-20T01:19:12.000Z | lib/tool_shed/util/admin_util.py | lesperry/Metagenomics | a1d8b7d96b32ab83cebe513e889b6ef82f7c1dd6 | [
"CC-BY-3.0"
] | null | null | null | import logging
import time
from sqlalchemy import false, func
from galaxy import util, web
from galaxy.security.validate_user_input import validate_password
from galaxy.util import inflector
from galaxy.util.hash_util import new_secure_hash
from galaxy.web.form_builder import CheckboxField
from tool_shed.util.web_uti... | 53.156313 | 159 | 0.508897 |
cd48ef126e05dffc36f9246a668539147c19f7d2 | 4,364 | py | Python | iminuit/_minuit_methods.py | rogovsky/iminuit | 9bffe21eafe3160ad43140570deeee1ebfede9d3 | [
"MIT"
] | null | null | null | iminuit/_minuit_methods.py | rogovsky/iminuit | 9bffe21eafe3160ad43140570deeee1ebfede9d3 | [
"MIT"
] | null | null | null | iminuit/_minuit_methods.py | rogovsky/iminuit | 9bffe21eafe3160ad43140570deeee1ebfede9d3 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
from warnings import warn
from iminuit.iminuit_warnings import InitialParamWarning
from iminuit import util as mutil
import numpy as np
def pedantic(self, parameters, kwds, errordef):
def w(msg):
warn(msg, InitialParamWarni... | 30.517483 | 89 | 0.566911 |
560ac21d4d4af680d4cef7520defb52bab5f7623 | 259 | py | Python | 1Dec/serializationDemo.py | universekavish/Python-Training | ccd7dfbc8802662de0e0fc20fe99bb3aae4c6e18 | [
"Apache-2.0"
] | null | null | null | 1Dec/serializationDemo.py | universekavish/Python-Training | ccd7dfbc8802662de0e0fc20fe99bb3aae4c6e18 | [
"Apache-2.0"
] | null | null | null | 1Dec/serializationDemo.py | universekavish/Python-Training | ccd7dfbc8802662de0e0fc20fe99bb3aae4c6e18 | [
"Apache-2.0"
] | null | null | null | import pickle
#serialization process
L = [10, 20, 'Hello', [30, 40], {1:2, 3:4}, 50]
fout = open('mydata.serialized', 'wb')
pickle.dump(L, fout)
fout.close()
#Deserialization
fin = open('mydata.serialized', 'rb')
L1 = pickle.load(fin)
fin.close()
print(L1) | 18.5 | 47 | 0.664093 |
99820f62e3a3d017fa61f7c6a7119d0613ccc035 | 5,946 | py | Python | test/functional/interface_zmq.py | DclrCoin/dclrcoin | 1ca3bd1f787fdead6ae84b7cda2bab6c6cb62b1d | [
"MIT"
] | null | null | null | test/functional/interface_zmq.py | DclrCoin/dclrcoin | 1ca3bd1f787fdead6ae84b7cda2bab6c6cb62b1d | [
"MIT"
] | 2 | 2021-12-18T03:02:54.000Z | 2022-01-17T17:55:36.000Z | test/functional/interface_zmq.py | DclrCoin/dclrcoin | 1ca3bd1f787fdead6ae84b7cda2bab6c6cb62b1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the ZMQ notification interface."""
import struct
from test_framework.address import ADDRESS_BCRT1... | 36.931677 | 126 | 0.634208 |
22aa4fc1db26fb483ad506ce084fd539b23a6e52 | 618 | py | Python | env/lib/python3.8/site-packages/plotly/validators/contour/hoverlabel/font/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/contour/hoverlabel/font/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/contour/hoverlabel/font/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="contour.hoverlabel.font", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 34.333333 | 83 | 0.619741 |
2710dad61612063f7cb0a36f5d388646684fb87e | 8,551 | py | Python | tests/integration/edges_settings.py | kytos-ng/pathfinder | 99cb431a76d9e0602f7ffb553cd57a91c11bb8e1 | [
"MIT"
] | null | null | null | tests/integration/edges_settings.py | kytos-ng/pathfinder | 99cb431a76d9e0602f7ffb553cd57a91c11bb8e1 | [
"MIT"
] | 10 | 2021-11-08T12:55:28.000Z | 2022-02-23T18:48:32.000Z | tests/integration/edges_settings.py | kytos-ng/pathfinder | 99cb431a76d9e0602f7ffb553cd57a91c11bb8e1 | [
"MIT"
] | 1 | 2021-11-30T14:53:17.000Z | 2021-11-30T14:53:17.000Z | """Module to overwrite all the needed methods."""
# Core modules to import
from kytos.core.link import Link
# pylint: disable=E0401
from tests.integration.test_paths import TestPaths
class EdgesSettings(TestPaths):
"""Class to setups all the settings related to topology."""
@staticmethod
def generate_t... | 30.758993 | 77 | 0.525319 |
bd30487c91c140290e8be25a09d1fef7eb3a234b | 3,700 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_single_alt_loc_files.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_single_alt_loc_files.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_single_alt_loc_files.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
#
#
# $Header: /opt/cvs/python/packages/share1.5/AutoDockTools/Utilities24/prepare_single_alt_loc_files.py,v 1.1.2.1 2012/04/13 21:30:24 rhuey Exp $
#
from MolKit import Read
def hasAt(name):
if '@' in name:
return 1
else:
return 0
def getAT_types(m):
AT_SET = m... | 28.461538 | 144 | 0.531081 |
a102baff0eb9ecbe56875c886ef2b311977eefbe | 11,092 | py | Python | ckan/cli/views.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 1 | 2022-02-14T20:25:34.000Z | 2022-02-14T20:25:34.000Z | ckan/cli/views.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 4 | 2020-03-24T17:53:23.000Z | 2021-03-31T19:19:03.000Z | ckan/cli/views.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 3 | 2020-01-02T10:32:37.000Z | 2021-12-22T07:20:21.000Z | # encoding: utf-8
import itertools
import click
import json
import ckan.logic as logic
import ckan.model as model
import ckan.plugins as p
from ckan.cli import error_shout
from ckan.lib.datapreview import (
add_views_to_dataset_resources,
get_view_plugins,
get_default_view_plugins,
)
_page_size = 100
... | 30.306011 | 79 | 0.618644 |
373732d2cedf7272dd600479238c6d6b4806d9be | 102 | py | Python | apps/inventory/apps.py | mikespux/prov-jewellery-cloud | 4bb16b74d4f32eec938e64325c39bb5770ad2848 | [
"MIT"
] | 1 | 2020-05-17T22:27:02.000Z | 2020-05-17T22:27:02.000Z | apps/inventory/apps.py | mikespux/prov-jewellery-cloud | 4bb16b74d4f32eec938e64325c39bb5770ad2848 | [
"MIT"
] | 7 | 2020-06-05T19:36:40.000Z | 2022-03-11T23:37:38.000Z | apps/inventory/apps.py | mikespux/prov-jewellery-cloud | 4bb16b74d4f32eec938e64325c39bb5770ad2848 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class InventoryItemConfig(AppConfig):
name = 'inventory_item'
| 17 | 37 | 0.784314 |
af1a6e9728363ac90be9a87ee8c90a2012aa73a0 | 3,115 | py | Python | battleship/ai/learner.py | agonopol/battleship-ai | eef51e972b26e5454dfc0d3685d417cc429969b1 | [
"MIT"
] | null | null | null | battleship/ai/learner.py | agonopol/battleship-ai | eef51e972b26e5454dfc0d3685d417cc429969b1 | [
"MIT"
] | null | null | null | battleship/ai/learner.py | agonopol/battleship-ai | eef51e972b26e5454dfc0d3685d417cc429969b1 | [
"MIT"
] | null | null | null | from battleship.ship import Ship
from battleship.grid import Grid
from battleship.ai.player import Player, Outcome
import numpy as np
import os
from tensorforce.agents import PPOAgent
def to_model(size, path):
return os.path.join(path, "%dx%d" % (size, size), "model")
def agent(size, path):
path = os.path.d... | 33.494624 | 132 | 0.552167 |
e26d2562e1acfef9b62c74f1e96a5e5df25acc03 | 3,198 | py | Python | dev_scripts/parallel_script_skeleton.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 5 | 2021-08-10T23:16:44.000Z | 2022-03-17T17:27:00.000Z | dev_scripts/parallel_script_skeleton.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 330 | 2021-06-10T17:28:22.000Z | 2022-03-31T00:55:48.000Z | dev_scripts/parallel_script_skeleton.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 6 | 2021-06-10T17:20:32.000Z | 2022-03-28T08:08:03.000Z | #!/usr/bin/env python
"""
This is an example of script using the `joblib_helpers` API to run jobs in
parallel.
# Run with:
> clear; parallel_script_skeleton.py --workload success --num_threads serial
> clear; parallel_script_skeleton.py --workload success --num_threads 2
> clear; parallel_script_skeleton.py --workloa... | 28.052632 | 81 | 0.666354 |
575574c4d030e09fcc6818ca2f344e27eb16b24e | 3,327 | py | Python | create_urls.py | vincentsarago/TileSiege | 51a7966ecfab225ae76bc6cadd4dcfbb5c920d39 | [
"BSD-2-Clause"
] | 19 | 2021-08-29T06:43:34.000Z | 2022-02-24T06:31:44.000Z | create_urls.py | vincentsarago/TileSiege | 51a7966ecfab225ae76bc6cadd4dcfbb5c920d39 | [
"BSD-2-Clause"
] | 3 | 2021-08-29T23:51:52.000Z | 2022-02-24T06:05:58.000Z | create_urls.py | vincentsarago/TileSiege | 51a7966ecfab225ae76bc6cadd4dcfbb5c920d39 | [
"BSD-2-Clause"
] | 2 | 2021-12-12T00:17:20.000Z | 2022-02-23T19:45:56.000Z | import bisect
import random
import csv
import os
import sys
import urllib.request
import lzma
import math
import argparse
parser = argparse.ArgumentParser(description='Create a urls.txt for siege.')
parser.add_argument('--maxzoom', type=int, default=19, help='Maximum zoom level, inclusive.')
parser.add_argument('--bbo... | 29.972973 | 104 | 0.60024 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.