hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e84954cc34e4e4f3e0705d5ed1bb3cd494000a57 | 3,071 | py | Python | bayesiantesting/tests/models/test_continuous.py | SimonBoothroyd/bayesiantesting | d9602eb23c74884e6cc53b0c8533b65f7b315278 | [
"MIT"
] | 1 | 2020-03-25T02:41:59.000Z | 2020-03-25T02:41:59.000Z | bayesiantesting/tests/models/test_continuous.py | SimonBoothroyd/bayesiantesting | d9602eb23c74884e6cc53b0c8533b65f7b315278 | [
"MIT"
] | 19 | 2019-11-21T16:41:39.000Z | 2021-09-13T17:25:16.000Z | bayesiantesting/tests/models/test_continuous.py | SimonBoothroyd/bayesiantesting | d9602eb23c74884e6cc53b0c8533b65f7b315278 | [
"MIT"
] | null | null | null | """
Unit and regression test for the datasets module.
"""
from random import random
import autograd
import numpy
import pytest
from bayesiantesting.datasets.nist import NISTDataSet
from bayesiantesting.models import Model
from bayesiantesting.models.continuous import TwoCenterLJModel
from bayesiantesting.surrogates i... | 24.96748 | 74 | 0.674373 |
e8497f5d5e719756981f13943f69e3b24047a7d3 | 19,459 | py | Python | helpers/feature_extraction.py | zoegroes/Amazon | f8addfefcee80f0ca15e416954af3926f3007d16 | [
"MIT"
] | 144 | 2015-01-20T16:26:23.000Z | 2021-03-15T12:20:00.000Z | helpers/feature_extraction.py | zoegroes/Amazon | f8addfefcee80f0ca15e416954af3926f3007d16 | [
"MIT"
] | 1 | 2017-02-20T01:57:41.000Z | 2019-02-12T09:31:08.000Z | helpers/feature_extraction.py | zoegroes/Amazon | f8addfefcee80f0ca15e416954af3926f3007d16 | [
"MIT"
] | 119 | 2015-01-05T11:22:35.000Z | 2021-04-23T13:14:33.000Z | """feature_extraction.py
Create the requested datasets.
Author: Paul Duan <email@paulduan.com>
"""
from __future__ import division
import logging
import cPickle as pickle
import numpy as np
import math
from scipy import sparse
from sklearn import preprocessing
from external import greedy, ben
from data import sav... | 37.135496 | 79 | 0.566319 |
e849a52f7e91d517ebfcdc870c6bc3d74cfa5365 | 4,016 | py | Python | alipay/aop/api/request/AnttechBlockchainDefinBaseFileSubmitRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AnttechBlockchainDefinBaseFileSubmitRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AnttechBlockchainDefinBaseFileSubmitRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AnttechBlockchainDefinBaseFileSubmitModel import AnttechBlockchainDefinBaseFileSubmitModel
class AnttechBlockchainDefinBaseFileSubmi... | 27.696552 | 148 | 0.648406 |
e849af05a56ca26f021a83c079fbb7b8a45d5807 | 1,058 | py | Python | helloworld/translator/translator_test.py | paiforsyth/qml | 141e5c9ba653992565c54653f91e982f218f2f59 | [
"Apache-2.0"
] | null | null | null | helloworld/translator/translator_test.py | paiforsyth/qml | 141e5c9ba653992565c54653f91e982f218f2f59 | [
"Apache-2.0"
] | 29 | 2021-12-20T19:31:31.000Z | 2022-03-30T01:30:34.000Z | helloworld/translator/translator_test.py | paiforsyth/qml | 141e5c9ba653992565c54653f91e982f218f2f59 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import pytest
from helloworld.translator.translator import (
LanguageTranslator,
UnknownLanguage,
UnknownPhrase,
)
def test_language_translator() -> None:
translator = LanguageTranslator(
... | 29.388889 | 66 | 0.642722 |
e849b0cb772f96af045894df50a285c226d8a5e3 | 6,667 | py | Python | rbac/server/api/users.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | null | null | null | rbac/server/api/users.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | null | null | null | rbac/server/api/users.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | 1 | 2018-12-07T10:55:08.000Z | 2018-12-07T10:55:08.000Z | # Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | 33.00495 | 82 | 0.699115 |
e849b9fe37537740f251c911a53e93439353cb10 | 18,259 | py | Python | tests/app/questionnaire/test_router.py | ons-eq-team/eq-questionnaire-runner | 8d029097faa2b9d53d9621064243620db60c62c7 | [
"MIT"
] | null | null | null | tests/app/questionnaire/test_router.py | ons-eq-team/eq-questionnaire-runner | 8d029097faa2b9d53d9621064243620db60c62c7 | [
"MIT"
] | null | null | null | tests/app/questionnaire/test_router.py | ons-eq-team/eq-questionnaire-runner | 8d029097faa2b9d53d9621064243620db60c62c7 | [
"MIT"
] | null | null | null | from flask import url_for
from app.data_model.answer_store import AnswerStore
from app.data_model.list_store import ListStore
from app.data_model.progress_store import ProgressStore, CompletionStatus
from app.questionnaire.location import Location
from app.questionnaire.router import Router
from app.questionnaire.rout... | 32.146127 | 98 | 0.563722 |
e849f08d5d3f4127a2b1beb5a677e0fa60568a2f | 1,649 | py | Python | handler/notification.py | ddong8/ihasy | 52e04a56eb896709df7f9fc202238b88cac97b1e | [
"BSD-3-Clause"
] | 2 | 2018-03-09T03:56:21.000Z | 2019-04-10T02:14:07.000Z | handler/notification.py | ddong8/ihasy | 52e04a56eb896709df7f9fc202238b88cac97b1e | [
"BSD-3-Clause"
] | null | null | null | handler/notification.py | ddong8/ihasy | 52e04a56eb896709df7f9fc202238b88cac97b1e | [
"BSD-3-Clause"
] | 2 | 2017-12-22T10:07:33.000Z | 2018-04-10T16:32:50.000Z | #!/usr/bin/env python
# coding=utf-8
#
# Copyright 2017 ihasy.com
# Do have a faith in what you're doing.
# Make your life a story worth telling.
import uuid
import hashlib
from PIL import Image
import io
import time
import json
import re
import urllib.request
import tornado.web
import lib.jsonp
import pprint
from .b... | 33.653061 | 135 | 0.733172 |
e849f5b0d113f55985e023fa659431a71b25b50c | 9,004 | py | Python | openpype/pipeline/context_tools.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | 1 | 2022-02-08T15:40:41.000Z | 2022-02-08T15:40:41.000Z | openpype/pipeline/context_tools.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | openpype/pipeline/context_tools.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | """Core pipeline functionality"""
import os
import sys
import json
import types
import logging
import inspect
import platform
import pyblish.api
from pyblish.lib import MessageHandler
import openpype
from openpype.modules import load_modules, ModulesManager
from openpype.settings import get_project_settings
from ope... | 25.948127 | 75 | 0.611617 |
e849ffc5c343d44b2a0fbc02b2de6994cfbc24ac | 1,463 | py | Python | test/test_group_commands_api.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_group_commands_api.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_group_commands_api.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Esper APIs
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Yo... | 23.596774 | 72 | 0.702666 |
e84a07d0e97f14ca2d53808dbed605d2aa937bbb | 1,211 | py | Python | platon/_utils/async_transactions.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platon/_utils/async_transactions.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platon/_utils/async_transactions.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | from typing import (
TYPE_CHECKING,
Optional,
cast,
)
from platon.types import (
BlockIdentifier,
TxParams,
Von,
)
if TYPE_CHECKING:
from platon import Web3
from platon.platon import AsyncPlaton
async def get_block_gas_limit(
web3_platon: "AsyncPlaton", block_identifier: Optional... | 27.522727 | 91 | 0.699422 |
e84a1e8d9374d45561696119ab66ab35ec8b9e4e | 1,897 | py | Python | Transformer/TransformerEncoder.py | hengwei-chan/simpletransformer_keras | 286633d3f2286868ecedb647f9d564c4b21eebf7 | [
"MIT"
] | 13 | 2019-04-04T09:50:25.000Z | 2022-03-23T14:23:15.000Z | Transformer/TransformerEncoder.py | hengwei-chan/simpletransformer_keras | 286633d3f2286868ecedb647f9d564c4b21eebf7 | [
"MIT"
] | 1 | 2020-03-30T03:05:13.000Z | 2020-03-30T03:05:13.000Z | Transformer/TransformerEncoder.py | hengwei-chan/simpletransformer_keras | 286633d3f2286868ecedb647f9d564c4b21eebf7 | [
"MIT"
] | 3 | 2019-11-10T13:29:07.000Z | 2021-03-26T17:18:34.000Z | from keras import backend as K
from keras.engine.topology import Layer
from keras.layers import Add
import math
from Attention import MultiHeadedAttention
from LayerNormalization import LayerNormalization
from PositionWiseFeedForward import PositionWiseFeedForward
class TransformerEncoder():
'''
Main... | 43.113636 | 169 | 0.705324 |
e84a254e13dc6c87e575f5956793b1b3685ab4e0 | 21,044 | py | Python | vyperlogix/msi/msiMaker.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/msi/msiMaker.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/msi/msiMaker.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import msilib, schema, sequence, os, sets, glob
from msilib import Feature, CAB, Directory, Dialog, Binary, add_data
import uisample
from win32com.client import constants
import PyDialog
class msiMaker():
def __init__(self,_package_name,_package_author,_srcdir,_current_version):
msilib.Win64 = 0
se... | 52.741855 | 200 | 0.581971 |
e84a35d1fb049f779c608e7ad2a3768b21306446 | 1,221 | py | Python | todo-app/quarkus-todo-app/docker_build.py | rajesh-kumar/spring-native-quarkus | f0e097e17a5cc69839982ccfbf46e19378b1e6c9 | [
"MIT"
] | null | null | null | todo-app/quarkus-todo-app/docker_build.py | rajesh-kumar/spring-native-quarkus | f0e097e17a5cc69839982ccfbf46e19378b1e6c9 | [
"MIT"
] | null | null | null | todo-app/quarkus-todo-app/docker_build.py | rajesh-kumar/spring-native-quarkus | f0e097e17a5cc69839982ccfbf46e19378b1e6c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import re
import subprocess
from pathlib import Path
import docker
def main():
parser = argparse.ArgumentParser(description='This is the docker image builder for quarkus-todo-app')
parser.add_argument("build_type", help="set build type", default='jvm', choices=['jvm', ... | 31.307692 | 113 | 0.597871 |
e84a557e191f0e38aec045cd90c446af43e45667 | 9,743 | py | Python | cogs/Games.py | jakebacker/Gompei-Bot | dba3b11874ca19c22f170b8a01928af2b3fb2bd8 | [
"MIT"
] | 9 | 2020-02-14T02:07:39.000Z | 2022-01-08T03:25:22.000Z | cogs/Games.py | jakebacker/Gompei-Bot | dba3b11874ca19c22f170b8a01928af2b3fb2bd8 | [
"MIT"
] | 16 | 2020-02-14T02:10:29.000Z | 2022-02-04T14:50:58.000Z | cogs/Games.py | jakebacker/Gompei-Bot | dba3b11874ca19c22f170b8a01928af2b3fb2bd8 | [
"MIT"
] | 8 | 2020-02-21T14:28:07.000Z | 2022-02-04T14:49:04.000Z | from cogs.Permissions import command_channels, dm_commands
from discord.ext import commands
from typing import Dict, List
import discord
import random
import os
hangman_embed = discord.Embed(
title="Reaction Hangman",
color=discord.Color.red()
).set_footer(text='Tip: search "regional" in the reaction menu')
... | 33.4811 | 120 | 0.531869 |
e84aa453ff89a46e68ce4af6af24f60f87594ed0 | 930 | py | Python | src/oscar/test/factories/customer.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/test/factories/customer.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | 5 | 2021-05-28T19:38:28.000Z | 2022-03-12T00:45:39.000Z | src/oscar/test/factories/customer.py | Jean1508/ya-madoa | 1ffb1d11e15bf33e4c3a09698675a4357e887eaa | [
"BSD-3-Clause"
] | null | null | null | import factory
from oscar.core.compat import get_user_model
from oscar.core.loading import get_model
__all__ = ['ProductAlertFactory', 'UserFactory']
class ProductAlertFactory(factory.DjangoModelFactory):
class Meta:
model = get_model('customer', 'ProductAlert')
product = factory.SubFac... | 31 | 78 | 0.708602 |
e84aac8c82deed12b56a2ebbae7f8b859490d77c | 32,731 | py | Python | spoty/utils.py | dy-sh/spoty | 431a392707c8754da713871e0e7747bcc4417274 | [
"MIT"
] | 2 | 2022-02-01T16:49:32.000Z | 2022-03-02T18:30:31.000Z | spoty/utils.py | dy-sh/spoty | 431a392707c8754da713871e0e7747bcc4417274 | [
"MIT"
] | null | null | null | spoty/utils.py | dy-sh/spoty | 431a392707c8754da713871e0e7747bcc4417274 | [
"MIT"
] | null | null | null | import os.path
from datetime import datetime
import click
from spoty import settings
from typing import List
import dateutil.parser
import numpy as np
from multiprocessing import Process, Lock, Queue, Value, Array
import sys
import time
from time import strftime
from time import gmtime
import string
THREADS_COUNT = 12... | 31.716085 | 151 | 0.58993 |
e84ab513752b724abb7ea71cbb70aac0ef4931da | 2,100 | py | Python | bot/commands/abstract/speech.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 20 | 2017-09-08T21:13:38.000Z | 2022-01-29T03:24:13.000Z | bot/commands/abstract/speech.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 32 | 2017-08-20T17:46:14.000Z | 2021-11-18T22:54:59.000Z | bot/commands/abstract/speech.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 10 | 2017-08-19T01:13:41.000Z | 2021-08-07T08:45:30.000Z | """Commands: "@[botname] XXXXX"."""
import logging
import random
from abc import ABC
from twisted.internet import reactor
from bot.commands.abstract.command import Command
from bot.utilities.permission import Permission
class Speech(Command, ABC):
"""Natural language."""
perm = Permission.User
reloadab... | 29.577465 | 91 | 0.60381 |
e84ad6f44478caa4e81e3d679b00da2ea47f8274 | 401 | py | Python | sdk/communication/azure-communication-identity/azure/communication/identity/_version.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/communication/azure-communication-identity/azure/communication/identity/_version.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-identity/azure/communication/identity/_version.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
VERSION =... | 40.1 | 76 | 0.461347 |
e84ae00d66b1dda87cb16bcfda34fd1b5a326fa7 | 216 | py | Python | netbox_prometheus_sd/api/serializers.py | feuri/netbox-plugin-prometheus-sd | 0a294748541662cf0ce1dd87e2bc2462476312a4 | [
"MIT"
] | null | null | null | netbox_prometheus_sd/api/serializers.py | feuri/netbox-plugin-prometheus-sd | 0a294748541662cf0ce1dd87e2bc2462476312a4 | [
"MIT"
] | null | null | null | netbox_prometheus_sd/api/serializers.py | feuri/netbox-plugin-prometheus-sd | 0a294748541662cf0ce1dd87e2bc2462476312a4 | [
"MIT"
] | null | null | null | from rest_framework import serializers
class TargetSerializer(serializers.Serializer):
targets = serializers.ListField(serializers.CharField())
labels = serializers.DictField(child=serializers.CharField())
| 30.857143 | 65 | 0.810185 |
e84ae38531e2c739a4826eee41750e1592928e6b | 1,323 | py | Python | test/test_compEPH.py | whiskie14142/spktype21 | 7ed22365fe92cdb74c416d27634df96a45712953 | [
"MIT"
] | 1 | 2021-10-21T20:07:04.000Z | 2021-10-21T20:07:04.000Z | test/test_compEPH.py | whiskie14142/spktype21 | 7ed22365fe92cdb74c416d27634df96a45712953 | [
"MIT"
] | 1 | 2020-05-20T05:54:34.000Z | 2020-05-20T05:54:34.000Z | test/test_compEPH.py | whiskie14142/spktype21 | 7ed22365fe92cdb74c416d27634df96a45712953 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test Program for spktype21.
'Ryugu-21.bsp' is a SPK file for asteroid RYUGU from 2000-Jan-01 to
2100-Jan-01, with data type 21.
'RyuguEPH.csv' is ephemeris created by HORIZONS system for the same
object and the same period. The interval is 100 days.
This program computes difference between... | 27.5625 | 68 | 0.664399 |
e84b21145182c436a768960c77e08650061773f0 | 2,030 | py | Python | mmf/datasets/builders/mmimdb/masked_dataset.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | 2 | 2021-02-22T12:15:42.000Z | 2021-05-02T15:22:24.000Z | mmf/datasets/builders/mmimdb/masked_dataset.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | 7 | 2021-03-01T21:16:26.000Z | 2022-02-27T07:07:11.000Z | mmf/datasets/builders/mmimdb/masked_dataset.py | krantirk/MMF | 2e4acaad7ca8eee4319e1205a560eed81733a0be | [
"BSD-3-Clause"
] | 1 | 2022-03-04T14:19:43.000Z | 2022-03-04T14:19:43.000Z | import random
from mmf.common.sample import Sample
from mmf.datasets.builders.vqa2.dataset import VQA2Dataset
class MaskedMMImdbDataset(VQA2Dataset):
def __init__(self, config, dataset_type, imdb_file_index, *args, **kwargs):
super().__init__(
config,
dataset_type,
imd... | 32.222222 | 79 | 0.570936 |
e84b6345685cd8bf30b143071c397147689dfbf7 | 1,782 | py | Python | 3/server.py | mesilliac/multitude | eccab96f496217971d19d2a4592fe48ee837fb3e | [
"CC0-1.0"
] | 2 | 2017-08-22T19:11:58.000Z | 2017-10-10T22:14:33.000Z | 3/server.py | mesilliac/multitude | eccab96f496217971d19d2a4592fe48ee837fb3e | [
"CC0-1.0"
] | null | null | null | 3/server.py | mesilliac/multitude | eccab96f496217971d19d2a4592fe48ee837fb3e | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
"""A simple webserver."""
# python 2.7 compatibility
from __future__ import print_function, unicode_literals
# based on tornado
import tornado.ioloop
import tornado.web
import tornado.websocket
import sys
def make_app():
"""Create and return the main Tornado web application.
... | 29.213115 | 74 | 0.641975 |
e84b6a9c2f049c8964fc0b695a5ed46483e6e607 | 17,812 | py | Python | khfinal.py | adisen99/python_programs | a362661f46021845ec1efa5198521f7e1e0d313e | [
"MIT"
] | null | null | null | khfinal.py | adisen99/python_programs | a362661f46021845ec1efa5198521f7e1e0d313e | [
"MIT"
] | null | null | null | khfinal.py | adisen99/python_programs | a362661f46021845ec1efa5198521f7e1e0d313e | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from IPython import display
import time,math,sys
#meat-n-potatoes at the bottom. Happy St. Paddy's Day!
#CONTINUOUSLY VARYING PROFILE
def initContVar(Q,top,bottom,ny):
m=(top-bottom)/ny
for i in range(ny):
#first-order approximation to density variation in gravity... | 41.714286 | 344 | 0.63766 |
e84b9f80f2434e191a84ef13a6d48e6da48610b8 | 2,231 | py | Python | etl/jobs/transformation/host_strain_transformer_job.py | PDXFinder/pdcm-etl | 3caf80938d9e80f1fc7bb0724cba6ae68a8d315e | [
"Apache-2.0"
] | 1 | 2021-05-24T14:54:48.000Z | 2021-05-24T14:54:48.000Z | etl/jobs/transformation/host_strain_transformer_job.py | PDCMFinder/pdcm-etl | df0006e4ad5ca2ddf9c1387e28a0b7fb24f195de | [
"Apache-2.0"
] | 37 | 2022-02-09T18:19:13.000Z | 2022-03-29T12:14:19.000Z | etl/jobs/transformation/host_strain_transformer_job.py | PDCMFinder/pdcm-etl | df0006e4ad5ca2ddf9c1387e28a0b7fb24f195de | [
"Apache-2.0"
] | null | null | null | import sys
from pyspark.sql import DataFrame, SparkSession
from pyspark.sql.window import Window
from pyspark.sql.functions import col, row_number
from etl.jobs.util.cleaner import trim_all, lower_and_trim_all
from etl.jobs.util.id_assigner import add_id
def main(argv):
"""
Creates a parquet file with host ... | 38.465517 | 112 | 0.748543 |
e84ba4acf4141e5bc9f35cce03adb7dd5972fa35 | 40 | py | Python | beatbrain/fma/__init__.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | 1 | 2020-03-28T21:18:50.000Z | 2020-03-28T21:18:50.000Z | beatbrain/fma/__init__.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | null | null | null | beatbrain/fma/__init__.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | null | null | null | from . import utils, features, creation
| 20 | 39 | 0.775 |
e84ba60c628a9361780021390fc335d8a68ce56d | 21,266 | py | Python | sagify/sagemaker/sagemaker.py | barakbl/sagify | ffe3efd773e98e7c3f2afcaaa629740ccf528fd2 | [
"MIT"
] | null | null | null | sagify/sagemaker/sagemaker.py | barakbl/sagify | ffe3efd773e98e7c3f2afcaaa629740ccf528fd2 | [
"MIT"
] | null | null | null | sagify/sagemaker/sagemaker.py | barakbl/sagify | ffe3efd773e98e7c3f2afcaaa629740ccf528fd2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sagemaker as sage
import sagemaker.tuner
import sagemaker.huggingface
import sagemaker.xgboost
import sagemaker.sklearn.model
from six.moves.urllib.parse import urlparse
import boto3
import botocore
from sagify.log import logger
_FILE... | 35.681208 | 118 | 0.589486 |
e84baf01f77812a7e898d5518de045d9923a4ab9 | 989 | py | Python | trinity/utils/xdg.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 14 | 2020-08-24T18:23:31.000Z | 2021-11-04T14:11:04.000Z | trinity/utils/xdg.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 19 | 2020-08-25T15:57:05.000Z | 2021-07-07T00:49:45.000Z | trinity/utils/xdg.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 7 | 2020-08-24T22:53:02.000Z | 2022-03-28T18:51:48.000Z | import os
from pathlib import Path
from trinity.exceptions import (
AmbigiousFileSystem
)
def get_home() -> Path:
try:
return Path(os.environ['HOME'])
except KeyError:
raise AmbigiousFileSystem('$HOME environment variable not set')
def get_xdg_cache_home() -> Path:
try:
ret... | 21.5 | 71 | 0.643074 |
e84bb41d8d85a2ef22f396a96d836b8b78e8e10a | 92 | py | Python | lewis_emulators/ag33220a/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/ag33220a/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/ag33220a/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from .stream_interface import AG33220AStreamInterface
__all__ = ['AG33220AStreamInterface'] | 30.666667 | 53 | 0.858696 |
e84bd15821db373cba3ec60043d74e3a5cc04a02 | 16,905 | py | Python | tests/manage/z_cluster/nodes/test_disk_failures.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/z_cluster/nodes/test_disk_failures.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/z_cluster/nodes/test_disk_failures.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | import logging
import pytest
import random
import re
from ocs_ci.ocs import node, constants, ocp, cluster
from ocs_ci.framework import config
from ocs_ci.framework.testlib import (
tier4,
tier4b,
ignore_leftovers,
ManageTest,
cloud_platform_required,
vsphere_platform_required,
bugzilla,
)
f... | 39.590164 | 120 | 0.636202 |
e84bd73afc56a5c85927808f68b8563944e0e728 | 1,362 | py | Python | bot/utilities/dict_utilities.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 20 | 2017-09-08T21:13:38.000Z | 2022-01-29T03:24:13.000Z | bot/utilities/dict_utilities.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 32 | 2017-08-20T17:46:14.000Z | 2021-11-18T22:54:59.000Z | bot/utilities/dict_utilities.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 10 | 2017-08-19T01:13:41.000Z | 2021-08-07T08:45:30.000Z | import copy
def deep_merge_dict(base, custom, dict_path=""):
"""Intended to merge dictionaries created from JSON.load().
We try to preserve the structure of base, while merging custom to base.
The rule for merging is:
- if custom[key] exists but base[key] doesn't, append to base[key]
- if BOTH cu... | 37.833333 | 91 | 0.556535 |
e84c11c51a069e963172d6c993b9957e4e0ab852 | 27 | py | Python | src/__init__.py | EricSekyere/gtools | 781878c9bbc6f3698ae20cdca3b6a4a0b92502e7 | [
"MIT"
] | null | null | null | src/__init__.py | EricSekyere/gtools | 781878c9bbc6f3698ae20cdca3b6a4a0b92502e7 | [
"MIT"
] | 3 | 2020-03-24T16:23:15.000Z | 2021-02-02T21:53:53.000Z | src/__init__.py | EricSekyere/gentool | 781878c9bbc6f3698ae20cdca3b6a4a0b92502e7 | [
"MIT"
] | null | null | null | """
author : Esekyere
"""
| 6.75 | 18 | 0.518519 |
e84c265c1222724b494360cf35ab2edbc162717c | 2,552 | py | Python | main.py | longfight123/59-BlogCapstonePart2 | 7fcb9f344480d7525b5a26af386dbf4c66acd816 | [
"MIT"
] | null | null | null | main.py | longfight123/59-BlogCapstonePart2 | 7fcb9f344480d7525b5a26af386dbf4c66acd816 | [
"MIT"
] | null | null | null | main.py | longfight123/59-BlogCapstonePart2 | 7fcb9f344480d7525b5a26af386dbf4c66acd816 | [
"MIT"
] | null | null | null | """Personal Blog (Capstone Part 1)
This 'Flask' app website is the second part of a 'Blog Capstone' project.
It has 4 pages: The index, about, contact and an individual blog post page.
There are 2 HTML templates used in inheritance to keep specific elements on each page.
The blog posts data are obtained from an API. '... | 30.023529 | 122 | 0.698668 |
e84c37aad1310dae417066cfbc73450e2daf89f1 | 2,712 | py | Python | main/control/artist.py | ssxenon01/music-app | fcc562713a048f3a2d222756ce6fd9ed83386ff6 | [
"MIT"
] | null | null | null | main/control/artist.py | ssxenon01/music-app | fcc562713a048f3a2d222756ce6fd9ed83386ff6 | [
"MIT"
] | null | null | null | main/control/artist.py | ssxenon01/music-app | fcc562713a048f3a2d222756ce6fd9ed83386ff6 | [
"MIT"
] | null | null | null | # coding: utf-8
import flask
import auth
import model
import util
import wtforms
from flask.ext import wtf
from main import app
class ArtistUpdateForm(wtf.Form):
name = wtforms.StringField('Name', filters=[util.strip_filter])
artist_type = wtforms.StringField('Type', filters=[util.strip_filter])
gender =... | 29.802198 | 106 | 0.673673 |
e84c4e85c91f049653a20aa63ff3b9c7527ec72c | 370 | py | Python | codes/projects/test_continuous_parameter/utils_project/get_forward_operators_tf.py | hwangoh/uq-vae | 382548e6f6dd7f9d72feff0e0752beec871db348 | [
"MIT"
] | 2 | 2021-07-28T16:47:18.000Z | 2021-08-03T00:53:58.000Z | codes/projects/test_continuous_parameter/utils_project/get_forward_operators_tf.py | HwanGoh/uq-vae | 24a3d26987e2ec807d57601b14c68b22f3652a18 | [
"MIT"
] | null | null | null | codes/projects/test_continuous_parameter/utils_project/get_forward_operators_tf.py | HwanGoh/uq-vae | 24a3d26987e2ec807d57601b14c68b22f3652a18 | [
"MIT"
] | 2 | 2021-09-29T08:31:46.000Z | 2021-11-07T10:26:45.000Z | import tensorflow as tf
import pandas as pd
import pdb #Equivalent of keyboard in MATLAB, just add "pdb.set_trace()"
def load_forward_operator_tf(options, filepaths):
df_forward_operator = pd.read_csv(filepaths.project.forward_operator + '.csv')
forward_operator = df_forward_operator.to_numpy()
return tf... | 33.636364 | 82 | 0.783784 |
e84c53b48e976fd2f9e3afb62606110e9f2f004f | 456 | py | Python | sdk/communication/azure-communication-identity/azure/communication/identity/_api_versions.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/communication/azure-communication-identity/azure/communication/identity/_api_versions.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-identity/azure/communication/identity/_api_versions.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta
# pylint: disable=enum-must-be-uppercase
class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnum... | 28.5 | 63 | 0.655702 |
e84c682f4ae7d37ff443d596f5d745e7ff8457a6 | 4,091 | py | Python | pymoso/problems/bsprob.py | pymoso/PyMOSO | 72f43dc6b4259b4772db7c7ffa27e197e5d3367a | [
"MIT"
] | 9 | 2019-03-26T21:41:13.000Z | 2021-07-05T09:06:32.000Z | pymoso/problems/bsprob.py | pymoso/PyMOSO | 72f43dc6b4259b4772db7c7ffa27e197e5d3367a | [
"MIT"
] | null | null | null | pymoso/problems/bsprob.py | pymoso/PyMOSO | 72f43dc6b4259b4772db7c7ffa27e197e5d3367a | [
"MIT"
] | 4 | 2019-08-06T07:52:13.000Z | 2022-02-01T13:14:03.000Z | """
Summary
-------
Provides implementation of the Bus Scheduling problem for use in PyMOSO.
"""
from ..chnbase import Oracle
class BSProb(Oracle):
"""
An Oracle that simulates the Test Simple SO problem.
Attributes
----------
num_obj : int, 2
dim : int
The maximum numbe... | 32.991935 | 96 | 0.486189 |
e84c6ad4b6256369a6c12233436234a196d246a5 | 2,695 | py | Python | figure_4_5/sobolev_alignment/train_VAE.py | saroudant/sobolev_alignment_manuscript | 2b4d7ce4bbdac3a32ad8c02b950b4d1c91cda193 | [
"MIT"
] | null | null | null | figure_4_5/sobolev_alignment/train_VAE.py | saroudant/sobolev_alignment_manuscript | 2b4d7ce4bbdac3a32ad8c02b950b4d1c91cda193 | [
"MIT"
] | null | null | null | figure_4_5/sobolev_alignment/train_VAE.py | saroudant/sobolev_alignment_manuscript | 2b4d7ce4bbdac3a32ad8c02b950b4d1c91cda193 | [
"MIT"
] | null | null | null | """
This script:
- Train Sobolev Alignment.
- Save the two networks.
"""
import os, sys, getopt
import pandas as pd
import numpy as np
import re
from anndata import AnnData
import torch
from pickle import dump, load
from copy import deepcopy
import gc
from sobolev_alignment import SobolevAlignment
# Import params
fr... | 26.165049 | 119 | 0.721336 |
e84cb898e9999d3b73d37b08250a18b5e0f332a0 | 3,979 | py | Python | alipay/aop/api/request/AlipayFundAgreementQuotaModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayFundAgreementQuotaModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayFundAgreementQuotaModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayFundAgreementQuotaModifyModel import AlipayFundAgreementQuotaModifyModel
class AlipayFundAgreementQuotaModifyRequest(object):
... | 27.441379 | 148 | 0.645388 |
e84ce06cab00c16edffb42c4e92192c6a14d6114 | 21,347 | py | Python | welly/project.py | JesperDramsch/welly | 8a1e305b7c7274d83dd5c94f608f4a72ceb243ca | [
"Apache-2.0"
] | null | null | null | welly/project.py | JesperDramsch/welly | 8a1e305b7c7274d83dd5c94f608f4a72ceb243ca | [
"Apache-2.0"
] | null | null | null | welly/project.py | JesperDramsch/welly | 8a1e305b7c7274d83dd5c94f608f4a72ceb243ca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines a multi-well 'project'.
:copyright: 2016 Agile Geoscience
:license: Apache 2.0
"""
import glob
from collections import Counter
import re
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from .well import Well, WellError
from . import utils
from .defaults im... | 35.877311 | 139 | 0.458285 |
e84ceab72720c938ead93f5b2468e15b703df41b | 2,794 | py | Python | python/sdist/amici/conserved_quantities_rref.py | kristianmeyerr/AMICI | 15f14c24b781daf5ceb3606d79edbbf57155a043 | [
"CC0-1.0"
] | null | null | null | python/sdist/amici/conserved_quantities_rref.py | kristianmeyerr/AMICI | 15f14c24b781daf5ceb3606d79edbbf57155a043 | [
"CC0-1.0"
] | null | null | null | python/sdist/amici/conserved_quantities_rref.py | kristianmeyerr/AMICI | 15f14c24b781daf5ceb3606d79edbbf57155a043 | [
"CC0-1.0"
] | null | null | null | """Find conserved quantities deterministically"""
from typing import List, Literal, Optional, Union
import numpy as np
def rref(
mat: np.array,
round_ndigits: Optional[Union[Literal[False], int]] = None
) -> np.array:
"""
Bring matrix ``mat`` to reduced row echelon form
see https://en.w... | 27.94 | 76 | 0.544739 |
e84cf16e86b006ea4ea7b2ab394cdaf301d65513 | 2,519 | py | Python | hooks/post_gen_project.py | neuromation/cookiecutter-neuro-project | b21458d3fd9300237667ac67ba1811dc14012d7a | [
"Apache-2.0"
] | 5 | 2019-09-17T14:00:13.000Z | 2020-08-31T08:05:28.000Z | hooks/post_gen_project.py | neuromation/cookiecutter-neuro-project | b21458d3fd9300237667ac67ba1811dc14012d7a | [
"Apache-2.0"
] | 249 | 2019-09-10T13:41:30.000Z | 2020-09-16T10:12:05.000Z | hooks/post_gen_project.py | neuromation/cookiecutter-neuro-project | b21458d3fd9300237667ac67ba1811dc14012d7a | [
"Apache-2.0"
] | 1 | 2019-09-20T12:29:13.000Z | 2019-09-20T12:29:13.000Z | import re
import shutil
import sys
from pathlib import Path
# >>> Handling project owner
USERNAME = ""
try:
import asyncio
import neuro_sdk
async def get_username() -> str:
async with await neuro_sdk.get() as client:
return client.username
USERNAME = asyncio.run(get_username())
... | 29.988095 | 88 | 0.600635 |
e84cf9bbff685c313021c21ffce0bb2263ee01b2 | 968 | py | Python | setup.base.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | setup.base.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | setup.base.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | import setuptools
import os
own_dir = os.path.abspath(os.path.dirname(__file__))
def requirements():
in_list = ('yaml', 'yamllint', 'termcolor', 'urllib', 'elasticsearch')
with open(os.path.join(own_dir, 'requirements.txt')) as f:
for line in f.readlines():
line = line.strip()
... | 22 | 74 | 0.573347 |
e84d7051bd005429b415df65b4197c81e17a3d04 | 2,783 | py | Python | Tools/scons/scons-local/SCons/Tool/hpcxx.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/hpcxx.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/hpcxx.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """SCons.Tool.hpc++
Tool-specific initialization for c++ on HP/UX.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby gra... | 31.625 | 77 | 0.663313 |
e84d8a77a8cd619b4074e5cde2c0c7411d1d2946 | 601 | py | Python | tests/playbook/test_num_uri.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | 1 | 2020-04-24T16:09:14.000Z | 2020-04-24T16:09:14.000Z | tests/playbook/test_num_uri.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | tests/playbook/test_num_uri.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | import pytest
from ansiblemetrics.playbook.num_uri import NumUri
script_0_1 = '---\n-host: localhost'
script_0_2 = '- oasis_roles.rhsm\n- oasis_roles.molecule_openstack_ci\n- oasis_roles.molecule_docker_ci'
script_1 = '- name: Check that you can connect (GET) to a page and it returns a status 200\n\turi:\n\t\turl: ' \... | 30.05 | 112 | 0.702163 |
e84d9f6aef524a9e221699ab1881d7668f47aeaa | 2,238 | py | Python | test/test_cases/branch2d/generate_rl.py | gmaher/vessel_tracking | 3fd31f0b999bcd570199efd0dc7478924a90704e | [
"MIT"
] | 1 | 2019-12-16T23:07:51.000Z | 2019-12-16T23:07:51.000Z | test/test_cases/branch2d/generate_rl.py | gmaher/vessel_tracking | 3fd31f0b999bcd570199efd0dc7478924a90704e | [
"MIT"
] | null | null | null | test/test_cases/branch2d/generate_rl.py | gmaher/vessel_tracking | 3fd31f0b999bcd570199efd0dc7478924a90704e | [
"MIT"
] | null | null | null | import numpy as np
import os
import sys
import SimpleITK as sitk
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath('../../..'))
from vessel_tracking import util, rl
def vessel_func(i,j,I):
return np.mean(I[i-1:i+1,j-1:j+1])
def action_to_move(a):
if a == 0:
return (0,-1)
if a == 1:... | 17.083969 | 82 | 0.507596 |
e84dced79911a381e45b0fd20fe05b91d7c60cda | 2,292 | py | Python | test/test_func.py | dbuhryk/NN_app01 | d44558e3b7b8295bb847e85572cf76237a9cb6c5 | [
"MIT"
] | null | null | null | test/test_func.py | dbuhryk/NN_app01 | d44558e3b7b8295bb847e85572cf76237a9cb6c5 | [
"MIT"
] | null | null | null | test/test_func.py | dbuhryk/NN_app01 | d44558e3b7b8295bb847e85572cf76237a9cb6c5 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Test suite for testing isolated HTTP WEB Server in a standalone process
"""
from app01.app01_imp import app
from multiprocessing import Process
from time import sleep
import socket
import unittest
from urllib3 import HTTPConnectionPool
import os
import logging
import json
app.config["TESTING"] = Tr... | 30.972973 | 120 | 0.615183 |
e84de1bad9dc6b53fcd4f62c94185feb5f6a3100 | 11,699 | py | Python | tests/test_adapters.py | greggles/cutadapt | fb3e8f0828c2cb92bfaea69d91ffb539ab24cdd0 | [
"MIT"
] | 375 | 2015-01-16T14:04:50.000Z | 2022-03-16T02:19:43.000Z | tests/test_adapters.py | greggles/cutadapt | fb3e8f0828c2cb92bfaea69d91ffb539ab24cdd0 | [
"MIT"
] | 589 | 2015-03-05T20:06:03.000Z | 2022-03-29T22:49:56.000Z | tests/test_adapters.py | greggles/cutadapt | fb3e8f0828c2cb92bfaea69d91ffb539ab24cdd0 | [
"MIT"
] | 150 | 2015-02-10T12:19:40.000Z | 2022-03-25T05:06:50.000Z | import pytest
from dnaio import Sequence
from cutadapt.adapters import (
RemoveAfterMatch,
RemoveBeforeMatch,
FrontAdapter,
BackAdapter,
PrefixAdapter,
SuffixAdapter,
LinkedAdapter,
MultipleAdapters,
IndexedPrefixAdapters,
IndexedSuffixAdapters,
)
def test_back_adapter_absolut... | 30.625654 | 107 | 0.654586 |
e84e052ffce5709304055aaef8e4e3d16a592bc7 | 4,934 | py | Python | toontown/classicchars/DistributedDaleAI.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/classicchars/DistributedDaleAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/classicchars/DistributedDaleAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | # File: D (Python 2.4)
import random
from otp.ai.AIBaseGlobal import *
from toontown.classicchars.DistributedCCharBaseAI import DistributedCCharBaseAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.task import Task
from toontown.toonbase im... | 27.875706 | 99 | 0.599919 |
e84e15170fc6441e153c7a3bc75073a9cb8ec275 | 2,769 | py | Python | board_support/zest/amc7823.py | BerkeleyLab/Bedrock | fb6d23ae675d45cc9deb43361e20a88af9c64084 | [
"RSA-MD"
] | 17 | 2019-09-29T14:52:18.000Z | 2022-03-28T21:16:25.000Z | board_support/zest/amc7823.py | BerkeleyLab/Bedrock | fb6d23ae675d45cc9deb43361e20a88af9c64084 | [
"RSA-MD"
] | null | null | null | board_support/zest/amc7823.py | BerkeleyLab/Bedrock | fb6d23ae675d45cc9deb43361e20a88af9c64084 | [
"RSA-MD"
] | 4 | 2019-12-04T17:30:38.000Z | 2021-11-01T01:52:13.000Z | import sys
import time
class c_amc7823:
def __init__(self):
self.init()
def init(self):
pass
def cmd(self, rw=1, pg=1, saddr=0x1e, eaddr=0x1e):
return (rw << 15) + (pg << 12) + (saddr << 6) + eaddr
def dataaddr(self, data, addr):
res = (data << 16) + addr
ret... | 25.172727 | 99 | 0.508487 |
e84e22f77245bf104fbb2c8cc6f9fe448e6ee900 | 427 | py | Python | terrascript/libvirt/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/libvirt/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/libvirt/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/libvirt/d.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class libvirt_network_dns_host_template(terrascript.Data):
pass
class libvirt_network_dns_srv_templat... | 19.409091 | 79 | 0.798595 |
e84e3bb27a4dde54901f69720cb86ea3330a587a | 8,350 | py | Python | autodiff/optimizations.py | rocketscience0/cs207-FinalProject | bb2a38bc2ca341c55cf544d316318798b42efde7 | [
"MIT"
] | 1 | 2019-11-12T18:03:52.000Z | 2019-11-12T18:03:52.000Z | autodiff/optimizations.py | rocketscience0/cs207-FinalProject | bb2a38bc2ca341c55cf544d316318798b42efde7 | [
"MIT"
] | 3 | 2019-11-19T20:45:05.000Z | 2019-12-10T14:33:21.000Z | autodiff/optimizations.py | rocketscience0/cs207-FinalProject | bb2a38bc2ca341c55cf544d316318798b42efde7 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
import autodiff.operations as operations
from autodiff.structures import Number
from autodiff.structures import Array
import numpy as np
def bfgs_symbolic(func,gradient, initial_guess,iterations =100,tolerance=10**-8,verbose=False):
"""Use symbolic BFGS method to find the local mi... | 28.694158 | 106 | 0.497725 |
e84e4e82f73ad1b7aab3d91ebc178eec70179edb | 21,620 | py | Python | examples/adversarial_asr/generate_imperceptible_adv.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 21 | 2019-06-07T17:05:30.000Z | 2022-02-07T03:25:15.000Z | examples/adversarial_asr/generate_imperceptible_adv.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 1 | 2021-03-01T15:06:09.000Z | 2021-03-01T15:06:09.000Z | examples/adversarial_asr/generate_imperceptible_adv.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 8 | 2019-06-11T03:06:29.000Z | 2022-01-18T04:18:27.000Z | import tensorflow as tf
from lingvo import model_imports
from lingvo import model_registry
import numpy as np
import scipy.io.wavfile as wav
import generate_masking_threshold as generate_mask
from tool import Transform, create_features, create_inputs
import time
from lingvo.core import cluster_factory
from absl import ... | 50.162413 | 209 | 0.530019 |
e84e58de0d5fbdcc8f64be2b41b89b14c47ea08e | 27,203 | py | Python | dragons/plugins/stickers.py | TeamDragons/Dragons-Userbot | e40584f4dc898b785523adea4519ffb412dc92c4 | [
"MIT"
] | 3 | 2021-08-11T08:33:39.000Z | 2022-01-17T00:09:11.000Z | dragons/plugins/stickers.py | sophiashirashaki/Dragons-Userbot | 2255c18428e488a267eaec1ec8c081fabcde167a | [
"MIT"
] | null | null | null | dragons/plugins/stickers.py | sophiashirashaki/Dragons-Userbot | 2255c18428e488a267eaec1ec8c081fabcde167a | [
"MIT"
] | 6 | 2021-08-14T08:20:41.000Z | 2022-03-20T02:31:45.000Z | import asyncio
import base64
import io
import math
import random
import re
import string
import urllib.request
from os import remove
import cloudscraper
import emoji as drgemoji
from bs4 import BeautifulSoup as bs
from PIL import Image
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUser... | 36.174202 | 138 | 0.570305 |
e84e5cbf4b559827f16363201688107c5b883f0f | 5,958 | py | Python | prov/tests/test_model.py | krischer/prov | 26965dcc7147e4b37a5ae4ba327467c6429cb3d3 | [
"MIT"
] | null | null | null | prov/tests/test_model.py | krischer/prov | 26965dcc7147e4b37a5ae4ba327467c6429cb3d3 | [
"MIT"
] | null | null | null | prov/tests/test_model.py | krischer/prov | 26965dcc7147e4b37a5ae4ba327467c6429cb3d3 | [
"MIT"
] | null | null | null | """
Created on Jan 25, 2012
@author: Trung Dong Huynh
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import unittest
import logging
import os
from prov.model import ProvDocument, ProvException
from prov.tests import examples
from prov.tests.attributes... | 35.676647 | 114 | 0.622021 |
e84e653954b40df723fe17088423b4722b6fc27a | 8,551 | py | Python | tests/test_cli_analyze.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | 1 | 2019-12-20T00:32:45.000Z | 2019-12-20T00:32:45.000Z | tests/test_cli_analyze.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | null | null | null | tests/test_cli_analyze.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | null | null | null | """Test CLI usage.
These tests only ensure input/outputs from the CLI.
Results are compared against previously obtained results.
"""
import sys
import subprocess
from SALib.test_functions import Ishigami
import numpy as np
import pandas as pd
from io import StringIO
import re
import os
from os.path import join as pt... | 33.93254 | 230 | 0.672202 |
e84e6be12f1b9b42bab08d99f5c0ae71979f995c | 771 | py | Python | satchless/contrib/stock/singlestore/listeners.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | 1 | 2015-11-05T05:09:27.000Z | 2015-11-05T05:09:27.000Z | satchless/contrib/stock/singlestore/listeners.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | satchless/contrib/stock/singlestore/listeners.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | from django.utils.translation import ugettext as _
from satchless.cart.signals import cart_quantity_change_check
from .models import StockLevel
def max_stock_level_to_cart(sender, instance=None,
variant=None, old_quantity=None, new_quantity=None, result=None, **kwargs):
try:
level = variant.stocklevel
... | 36.714286 | 89 | 0.718547 |
e84e93a946dc37f9c962ad8121c6560f47e2f9ed | 9,079 | py | Python | tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | null | null | null | tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | null | null | null | tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 39.820175 | 78 | 0.727723 |
e84e9e91f3875156a054c8418370f4eb4621bceb | 9,610 | py | Python | utils/load_data_exp.py | kushalkolar/NuSeT | cea354634fe432027f5103752f323791b78e3afe | [
"MIT"
] | 18 | 2019-10-17T23:47:03.000Z | 2022-03-28T14:37:02.000Z | utils/load_data_exp.py | kushalkolar/NuSeT | cea354634fe432027f5103752f323791b78e3afe | [
"MIT"
] | 4 | 2020-08-18T20:02:03.000Z | 2022-02-23T00:16:45.000Z | utils/load_data_exp.py | kushalkolar/NuSeT | cea354634fe432027f5103752f323791b78e3afe | [
"MIT"
] | 8 | 2019-11-22T06:20:57.000Z | 2021-11-08T20:32:57.000Z | import pickle
from utils.normalization import whole_image_norm, foreground_norm
from tqdm import tqdm
from os import listdir
from PIL import Image
import numpy as np
from scipy.ndimage.measurements import label
from scipy import ndimage
import copy
def list_files(directory, extension):
return [f for f in listdir(... | 31.405229 | 94 | 0.585952 |
e84eb627db290dcc757aff92366c2eb9bea23ffa | 597 | py | Python | tests/test_filter/test_ipv4.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 86 | 2017-08-17T12:41:52.000Z | 2022-02-24T12:17:47.000Z | tests/test_filter/test_ipv4.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 10 | 2020-03-30T03:24:46.000Z | 2022-02-23T01:34:53.000Z | tests/test_filter/test_ipv4.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 7 | 2017-08-18T03:40:35.000Z | 2020-05-19T04:09:10.000Z | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2020
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '2020-04-13 14:17'
class TestIpv4:
def test_ipv4_smoke(self, client):
""" 测试IPV4地址验证
"""
resp = client.get("/ipv4", data={
"p1": "... | 21.321429 | 47 | 0.499162 |
e84ec42c9243a8a717bd3833cffc4c8373fd23da | 5,073 | py | Python | Assignment_04/fourier.py | sohamroy19/EE2703 | 7ea141082815d80fe765344303d98f96f7a9a492 | [
"MIT"
] | null | null | null | Assignment_04/fourier.py | sohamroy19/EE2703 | 7ea141082815d80fe765344303d98f96f7a9a492 | [
"MIT"
] | null | null | null | Assignment_04/fourier.py | sohamroy19/EE2703 | 7ea141082815d80fe765344303d98f96f7a9a492 | [
"MIT"
] | null | null | null | # %%
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import quad
from scipy.linalg import lstsq
# %% [markdown]
# ### 1. Define & Plot Python functions
# %%
def exp(x): # exponential function, supports value or vector
return np.exp(x)
def coscos(x): # cos of cos function, supports value... | 29.666667 | 102 | 0.599645 |
e84ecf7bdacb8d25b79cefadb3d2cbbea5a62334 | 5,456 | py | Python | experiments/vitchyr/probabilistic_goal_reaching/td3/door.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/probabilistic_goal_reaching/td3/door.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/probabilistic_goal_reaching/td3/door.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import gym
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.obs_dict_replay_buffer import ObsDictRelabelingBuffer
from rlkit.exploration_strategies.base import \
PolicyWrappedWithExplorationStrategy
from rlkit.exploration_strategies.gaussian_and_epislon import \
GaussianAndEpislonStrategy
from... | 30.824859 | 80 | 0.649377 |
e84f3e0ad076a5ce37cc095cb08be6a3075af5df | 1,094 | py | Python | djangoDemo/mysite/register/views.py | AirChen/PythonPractic | 676708237dc502ea9a60218a3ca134874bd18456 | [
"MIT"
] | null | null | null | djangoDemo/mysite/register/views.py | AirChen/PythonPractic | 676708237dc502ea9a60218a3ca134874bd18456 | [
"MIT"
] | null | null | null | djangoDemo/mysite/register/views.py | AirChen/PythonPractic | 676708237dc502ea9a60218a3ca134874bd18456 | [
"MIT"
] | null | null | null | # Create your views here.
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.shortcuts import redirect, render
from register.forms import SignUpForm
from feeds.models import Feed
def signup(request):
if request.method == 'POST':
form = SignUpForm(request... | 33.151515 | 72 | 0.659049 |
e84f9f0b40294664c12b5990ac30dcb2aac28c9e | 42 | py | Python | floatingobjects/__init__.py | MarcCoru/dino | 45c7c7e5ed4649fb74424eef6f64b46d460f745f | [
"Apache-2.0"
] | null | null | null | floatingobjects/__init__.py | MarcCoru/dino | 45c7c7e5ed4649fb74424eef6f64b46d460f745f | [
"Apache-2.0"
] | null | null | null | floatingobjects/__init__.py | MarcCoru/dino | 45c7c7e5ed4649fb74424eef6f64b46d460f745f | [
"Apache-2.0"
] | null | null | null | from .data import FloatingSeaObjectDataset | 42 | 42 | 0.904762 |
e84fbed8cc446b578f3ca917ddf27c8f569b7712 | 1,116 | py | Python | src/python/pants/backend/jvm/targets/scalac_plugin.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/targets/scalac_plugin.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/backend/jvm/targets/scalac_plugin.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.jvm.subsystems.scala_platform import ScalaPlatform
from pants.backend.jvm.targets.scala_library import ScalaLibrary
class ScalacPlugin(ScalaLibrary):
"""A Scala comp... | 33.818182 | 100 | 0.751792 |
e84fd90ac0146ba3a09767ca1698e1c9d168060d | 11,970 | py | Python | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/cloudfunctions/v1beta2/cloudfunctions_v1beta2_client.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/cloudfunctions/v1beta2/cloudfunctions_v1beta2_client.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/cloudfunctions/v1beta2/cloudfunctions_v1beta2_client.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | """Generated client library for cloudfunctions version v1beta2."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.cloudfunctions.v1beta2 import cloudfunctions_v1beta2_messages as messages
class CloudfunctionsV1beta2(base_... | 39.375 | 110 | 0.703091 |
e84fe4a6de950fc46b7425da49bd52aef9307f0b | 11,018 | py | Python | attacks/old/attack_pattern.py | dburihabwa/recast | f7adbc344e174f48a919a651df54945ec9672201 | [
"MIT"
] | null | null | null | attacks/old/attack_pattern.py | dburihabwa/recast | f7adbc344e174f48a919a651df54945ec9672201 | [
"MIT"
] | 1 | 2020-11-08T20:21:13.000Z | 2020-11-08T20:21:13.000Z | attacks/old/attack_pattern.py | dburihabwa/recast | f7adbc344e174f48a919a651df54945ec9672201 | [
"MIT"
] | 3 | 2018-05-24T14:40:54.000Z | 2021-07-10T17:54:26.000Z | import random
import sys
NDIGIT = 2 # Number of digits for the block index in files names
def blocks_to_nodes(Dict, KEYS, p):
# Dictionary that describes which blocks are hosted in which nodes
# Nodes ids are the keys of the dictionary
BLOCKSTONODES = {}
for k in KEYS:
mylist = Dict[k][2].sp... | 35.427653 | 125 | 0.554093 |
e850279798b8fd33596c4ec6822b949bd424e362 | 19 | py | Python | btd6_memory_info/generated/Assets/Scripts/Data/MapSets/map_sets.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Data/MapSets/map_sets.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Data/MapSets/map_sets.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class MapSets: pass | 19 | 19 | 0.842105 |
e85036e7b96db43012a0b72a94291ad89caab61a | 1,614 | py | Python | tests/petstore-full/setup.py | ppentchev/openapi-client-generator | a058af4ec28a1e53809273a662fb8cba0157695e | [
"MIT"
] | 6 | 2021-01-16T21:36:43.000Z | 2022-01-24T10:21:14.000Z | tests/petstore-full/setup.py | ppentchev/openapi-client-generator | a058af4ec28a1e53809273a662fb8cba0157695e | [
"MIT"
] | 11 | 2021-01-17T00:05:44.000Z | 2022-01-23T16:13:56.000Z | tests/petstore-full/setup.py | ppentchev/openapi-client-generator | a058af4ec28a1e53809273a662fb8cba0157695e | [
"MIT"
] | 2 | 2021-11-06T00:07:34.000Z | 2022-01-14T01:35:06.000Z | """ Auto-generated by openapi-client-generator
https://github.com/avanov/openapi-client-generator
"""
from pathlib import Path
from setuptools import setup
from setuptools import find_packages
here = Path(__file__).absolute().parent
EXTRAS = frozenset({
})
def extras_require(all_extras=EXTRAS):
""" Get map of... | 27.355932 | 102 | 0.627014 |
e8504c969d8c31d317e579e19c5ab230251a9593 | 5,287 | py | Python | py3status/modules/player_control.py | ChoiZ/py3status | bd2cd9053d45a0284c2fa31e2361d9e5071eae51 | [
"BSD-3-Clause"
] | null | null | null | py3status/modules/player_control.py | ChoiZ/py3status | bd2cd9053d45a0284c2fa31e2361d9e5071eae51 | [
"BSD-3-Clause"
] | null | null | null | py3status/modules/player_control.py | ChoiZ/py3status | bd2cd9053d45a0284c2fa31e2361d9e5071eae51 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Control music/video players.
Provides an icon to control simple functions of audio/video players:
- start (left click)
- stop (left click)
- pause (middle click)
Configuration parameters:
debug: enable verbose logging (bool) (default: False)
supported_players: supporte... | 28.12234 | 79 | 0.553244 |
e8504e95f4e9a1e1b911bbfad2a6f0f7d2109aaa | 3,254 | py | Python | tests/graph/test_graph_driveItem.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | tests/graph/test_graph_driveItem.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | tests/graph/test_graph_driveItem.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | import os
import uuid
from office365.graph.onedrive.drive import Drive
from office365.graph.onedrive.driveItem import DriveItem
from office365.graph.onedrive.file_upload import ResumableFileUpload
from tests.graph.graph_case import GraphTestCase
def create_list_drive(client):
list_info = {
"displayName":... | 35.758242 | 91 | 0.690227 |
e85072c0140d62a13b04b072fb1a3c4646809167 | 4,445 | py | Python | models/train_classifier.py | se-Laila/DRP | b3510b11792d41b3067445201a651da1eb7898a3 | [
"FTL",
"blessing"
] | null | null | null | models/train_classifier.py | se-Laila/DRP | b3510b11792d41b3067445201a651da1eb7898a3 | [
"FTL",
"blessing"
] | null | null | null | models/train_classifier.py | se-Laila/DRP | b3510b11792d41b3067445201a651da1eb7898a3 | [
"FTL",
"blessing"
] | null | null | null | import sys
import nltk
nltk.download(['punkt', 'stopwords', 'wordnet', 'averaged_perceptron_tagger'])
import re
import pickle
import numpy as np
import pandas as pd
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from sqlalchemy import create_engine
from sklearn.model_selection import G... | 29.243421 | 93 | 0.663217 |
e8507997e71a94f0f8b4326b2130f39967fe060d | 3,221 | py | Python | plastering/inferencers/scrabble/mongo_models.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 29 | 2018-09-19T01:16:27.000Z | 2022-03-29T14:35:36.000Z | plastering/inferencers/scrabble/mongo_models.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 14 | 2019-04-12T18:37:36.000Z | 2022-02-10T00:27:55.000Z | plastering/inferencers/scrabble/mongo_models.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 14 | 2019-03-05T23:44:11.000Z | 2022-03-18T07:29:31.000Z | from copy import copy
import pdb
import code
from pymongo import MongoClient
C = MongoClient()
DB = C.get_database('scrabble')
summary_query_template = {
'source_building': None,
'target_building': None,
'source_sample_num': None,
'use_cluster_flag': None
}
def get_summary_query_template():
ret... | 30.67619 | 90 | 0.619994 |
e85087368ca445c0307cb65371fd0c9dcd45269d | 8,443 | py | Python | watchlist_100eyes.py | brhahlen/3commas-cyber-bots | 39440219582aa5d5b3d2928a9f19295f322621ae | [
"MIT"
] | 107 | 2021-11-03T16:43:32.000Z | 2022-03-30T22:29:37.000Z | watchlist_100eyes.py | brhahlen/3commas-cyber-bots | 39440219582aa5d5b3d2928a9f19295f322621ae | [
"MIT"
] | 92 | 2021-10-13T22:20:42.000Z | 2022-03-27T14:24:41.000Z | watchlist_100eyes.py | brhahlen/3commas-cyber-bots | 39440219582aa5d5b3d2928a9f19295f322621ae | [
"MIT"
] | 47 | 2021-11-04T13:34:54.000Z | 2022-03-25T20:34:10.000Z | #!/usr/bin/env python3
"""Cyberjunky's 3Commas bot helpers."""
import argparse
import configparser
import json
import os
import re
import sys
import time
from pathlib import Path
from telethon import TelegramClient, events
from helpers.logging import Logger, NotificationHandler
from helpers.misc import format_pair
fr... | 30.701818 | 99 | 0.590904 |
e850957d38fdcb10d1166f7f6f1d2c7ef2403a6c | 5,615 | py | Python | metrics_layer/core/parse/github_repo.py | Zenlytic/metrics_layer | 45e291186c9171b44222a49444153c5df14985c4 | [
"Apache-2.0"
] | 5 | 2021-11-11T15:39:23.000Z | 2022-03-17T19:54:17.000Z | metrics_layer/core/parse/github_repo.py | Zenlytic/metrics_layer | 45e291186c9171b44222a49444153c5df14985c4 | [
"Apache-2.0"
] | 10 | 2021-11-23T21:44:56.000Z | 2022-03-21T02:01:51.000Z | metrics_layer/core/parse/github_repo.py | Zenlytic/metrics_layer | 45e291186c9171b44222a49444153c5df14985c4 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
from glob import glob
import git
import requests
from metrics_layer.core import utils
BASE_PATH = os.path.dirname(__file__)
class BaseRepo:
def get_repo_type(self):
if self.repo_type:
return self.repo_type
looker_files = list(self.search(pattern="*.model.*")... | 34.875776 | 110 | 0.636153 |
e850b08f5468a13e1d524cd7ffdad405bfa38d9f | 3,527 | py | Python | mplStyle/types/property/Enum.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 39 | 2015-03-08T23:05:01.000Z | 2022-02-07T16:03:35.000Z | mplStyle/types/property/Enum.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | null | null | null | mplStyle/types/property/Enum.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 23 | 2015-03-08T19:56:59.000Z | 2021-07-15T15:16:26.000Z | #===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | 41.011628 | 78 | 0.584349 |
e850c3194104ffc7e8a0196092457fbd6e493b54 | 286 | py | Python | setup.py | liuyuns/ezsync | 781b561f4416f64ba34c29b569cd07057fde1eb7 | [
"Apache-2.0"
] | 3 | 2015-12-14T01:38:00.000Z | 2018-10-08T03:54:25.000Z | setup.py | liuyuns/ezsync | 781b561f4416f64ba34c29b569cd07057fde1eb7 | [
"Apache-2.0"
] | null | null | null | setup.py | liuyuns/ezsync | 781b561f4416f64ba34c29b569cd07057fde1eb7 | [
"Apache-2.0"
] | null | null | null | from distutils.core import setup
setup(
name='ez_trans',
version='0.1',
author='Easton Liu',
author_email='easton.ysliu@gmail.com',
packages=['ez_trans',],
license=open('LICENSE.txt').read(),
long_description=open('README.md').read(),
)
| 23.833333 | 48 | 0.604895 |
e850d52d293f97db6b46f1eaa64bb9948277c8c9 | 2,326 | py | Python | matrix_extrapolation/bch_series_expansion/product_formula_test.py | ochsnerd/Hamiltonian_Extrapolation | a91e651a9515a22d6e279d567340182658bcd2f6 | [
"Apache-2.0"
] | null | null | null | matrix_extrapolation/bch_series_expansion/product_formula_test.py | ochsnerd/Hamiltonian_Extrapolation | a91e651a9515a22d6e279d567340182658bcd2f6 | [
"Apache-2.0"
] | null | null | null | matrix_extrapolation/bch_series_expansion/product_formula_test.py | ochsnerd/Hamiltonian_Extrapolation | a91e651a9515a22d6e279d567340182658bcd2f6 | [
"Apache-2.0"
] | null | null | null | import os, tempfile
import sympy as sp
from .product_formula import S2
from .operator import strOperator
def test_S2():
s2_1 = S2((strOperator('A'),), "s1")
s2_2 = S2((strOperator('2A'), strOperator('B')), "s2")
s2_3 = S2((strOperator('2A'), strOperator('2B'), strOperator('C')), "s3")
assert s2_1.a... | 38.131148 | 138 | 0.542132 |
e850d82130925ae651bf853c28b9bf06fdcacefe | 3,293 | py | Python | tests/test_e2e_environment.py | Kravcu/cyclonedx-python-lib | d4007bd5986173eb2645eebcdd2c6405150f1456 | [
"Apache-2.0"
] | 15 | 2021-09-08T19:01:48.000Z | 2022-02-15T17:42:02.000Z | tests/test_e2e_environment.py | Kravcu/cyclonedx-python-lib | d4007bd5986173eb2645eebcdd2c6405150f1456 | [
"Apache-2.0"
] | 124 | 2021-09-14T16:54:02.000Z | 2022-03-24T15:23:46.000Z | tests/test_e2e_environment.py | Kravcu/cyclonedx-python-lib | d4007bd5986173eb2645eebcdd2c6405150f1456 | [
"Apache-2.0"
] | 10 | 2021-09-24T11:35:14.000Z | 2022-01-28T01:56:06.000Z | # encoding: utf-8
# This file is part of CycloneDX Python Lib
#
# 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 applic... | 40.158537 | 110 | 0.698755 |
e850e99f6e5787b240fb33de353295843d6e670f | 1,661 | py | Python | hashTable/findPlayersWithZeroOrOneLosses.py | Jiganesh/High-On-DSA | 044a3941cec443a87e79d97962551d75a9639a57 | [
"MIT"
] | 76 | 2021-12-12T08:42:20.000Z | 2022-03-31T19:48:46.000Z | hashTable/findPlayersWithZeroOrOneLosses.py | Jiganesh/High-On-DSA | 044a3941cec443a87e79d97962551d75a9639a57 | [
"MIT"
] | 4 | 2022-01-04T09:58:39.000Z | 2022-03-30T17:00:39.000Z | hashTable/findPlayersWithZeroOrOneLosses.py | Jiganesh/High-On-DSA | 044a3941cec443a87e79d97962551d75a9639a57 | [
"MIT"
] | 13 | 2021-12-12T14:44:41.000Z | 2022-03-10T14:08:20.000Z | # https://leetcode.com/problems/find-players-with-zero-or-one-losses/
from collections import Counter
class Solution:
# Runtime: 2539 ms, faster than 63.65% of Python3 online submissions for Find Players With Zero or One Losses.
# Memory Usage: 69.3 MB, less than 30.02% of Python3 online submissions for... | 28.637931 | 117 | 0.508128 |
e85114eddf6e5476b4d7622c63998219ad1e1cbd | 2,964 | py | Python | tests/st/ops/ascend/cube/test_matmul_add_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/ascend/cube/test_matmul_add_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/ascend/cube/test_matmul_add_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.166667 | 173 | 0.65587 |
e85116531ecc26e219357c44269fd843e43a24c5 | 6,329 | py | Python | projects/DensePose/densepose/structures/mesh.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/structures/mesh.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/structures/mesh.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import pickle
from functools import lru_cache
from typing import Dict, Optional, Tuple
import torch
from detectron.utils.file_io import PathManager
from densepose.data.meshes.catalog import MeshCatalog, MeshInfo
def _maybe_copy_to_device(
a... | 37.011696 | 98 | 0.637857 |
e8519905c0b5d784caf744af547226fa7ef67ef2 | 916 | py | Python | jumpy/jumpy/spark/__init__.py | zhangy10/deeplearning4j | 9d31156ce600dee6ce4a7fac28286ebbaa211164 | [
"Apache-2.0"
] | 1 | 2018-12-14T02:56:28.000Z | 2018-12-14T02:56:28.000Z | jumpy/jumpy/spark/__init__.py | heronggen/deeplearning4j | 4670eee4f25cef84afca2ba2e2ebf46577968308 | [
"Apache-2.0"
] | null | null | null | jumpy/jumpy/spark/__init__.py | heronggen/deeplearning4j | 4670eee4f25cef84afca2ba2e2ebf46577968308 | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Copyright (c) 2015-2018 Skymind, Inc.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless... | 43.619048 | 80 | 0.651747 |
e851bf1bd65ce1deb9ec0dd8544b3bcc7e26cb8f | 367 | py | Python | geoq/workflow/urls.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 471 | 2015-01-05T15:16:26.000Z | 2022-03-28T05:06:11.000Z | geoq/workflow/urls.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 109 | 2015-01-06T20:00:58.000Z | 2022-03-11T23:17:53.000Z | geoq/workflow/urls.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 100 | 2015-01-05T15:16:39.000Z | 2021-12-01T12:13:13.000Z | from django.conf.urls.defaults import *
urlpatterns = patterns('',
# get a dotfile for the referenced workflow
url(r'^(?P<workflow_slug>\w+)/dotfile/$', 'workflow.views.dotfile', name='dotfile'),
# get a png image generated by graphviz for the referenced workflow
url(r'^(?P<workflow_slug>\w+).png$', ... | 40.777778 | 88 | 0.689373 |
e851c20ebcefddc4af9867491a86b8ad104c5ce6 | 2,876 | py | Python | qube/lint/domains/lib.py | qbicsoftware/qube | 59d6d034d6def13f6456cc80de0f56029b24af03 | [
"MIT"
] | 2 | 2020-04-16T18:50:06.000Z | 2020-04-19T10:39:50.000Z | qube/lint/domains/lib.py | qbicsoftware/qube-cli | 59d6d034d6def13f6456cc80de0f56029b24af03 | [
"MIT"
] | 202 | 2020-09-25T07:48:39.000Z | 2022-03-28T04:04:54.000Z | qube/lint/domains/lib.py | qbicsoftware/qube | 59d6d034d6def13f6456cc80de0f56029b24af03 | [
"MIT"
] | null | null | null | import os
from qube.lint.TemplateLinter import TemplateLinter, files_exist_linting, GetLintingFunctionsMeta
CWD = os.getcwd()
class LibJavaLint(TemplateLinter, metaclass=GetLintingFunctionsMeta):
def __init__(self, path):
super().__init__(path)
def lint(self):
super().lint_project(self, sel... | 31.26087 | 99 | 0.601878 |
e851f191869470ea0593b3bf4a40142ea971bb06 | 3,740 | py | Python | src/process/timealign.py | serapio/kwaras | e575ed2c3512c9517778d4108558f7e9680a93ee | [
"MIT"
] | 4 | 2016-10-03T00:52:00.000Z | 2021-07-26T00:32:32.000Z | src/process/timealign.py | ucsd-field-lab/kwaras | e575ed2c3512c9517778d4108558f7e9680a93ee | [
"MIT"
] | null | null | null | src/process/timealign.py | ucsd-field-lab/kwaras | e575ed2c3512c9517778d4108558f7e9680a93ee | [
"MIT"
] | null | null | null | import os
import re
import wave
def framesToSecs(nframes, wavfile):
return nframes / float(wavfile.getframerate())
def secsToFrames(nsecs, wavfile):
return nsecs * wavfile.getframerate()
def bytesToFrames(nbytes, wavfile):
return nbytes / wavfile.getsampwidth()
def framesToBytes(nframes, wavfile):
... | 38.163265 | 88 | 0.638235 |
e8520b542a9abcf528dc2960d99c594429b8ab0d | 174,975 | py | Python | LineAPI/akad/ChannelService.py | drwirot2532/10kickMoopor1 | 6d973ca6053b6c318ac31be09ab8eaecd83266a9 | [
"MIT"
] | 2 | 2019-08-13T13:10:43.000Z | 2019-09-29T04:48:33.000Z | LineAPI/akad/ChannelService.py | drwirot2532/10kickMoopor1 | 6d973ca6053b6c318ac31be09ab8eaecd83266a9 | [
"MIT"
] | null | null | null | LineAPI/akad/ChannelService.py | drwirot2532/10kickMoopor1 | 6d973ca6053b6c318ac31be09ab8eaecd83266a9 | [
"MIT"
] | 4 | 2019-08-13T13:10:44.000Z | 2019-08-21T10:52:30.000Z | #
# Autogenerated by Thrift Compiler (0.11.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | 35.542352 | 135 | 0.59868 |
e852212cbf7087d66d4e263b49b1c6bc81e88e45 | 2,944 | py | Python | nova/scheduler/filters/aggregate_instance_extra_specs.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/aggregate_instance_extra_specs.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/aggregate_instance_extra_specs.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation
# Copyright (c) 2012 Cloudscaling
# 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/l... | 40.328767 | 78 | 0.63519 |
e8522bac3de5cc467906d8ce948c866b219b2c79 | 3,489 | py | Python | server.py | nyucan/can-selfdriving | 2a0c68eb1e5ce01bf8fe1c408fbb256184376694 | [
"MIT"
] | 3 | 2019-02-19T22:22:07.000Z | 2019-03-16T04:58:58.000Z | server.py | nyucan/can-selfdriving | 2a0c68eb1e5ce01bf8fe1c408fbb256184376694 | [
"MIT"
] | null | null | null | server.py | nyucan/can-selfdriving | 2a0c68eb1e5ce01bf8fe1c408fbb256184376694 | [
"MIT"
] | null | null | null | # python 2.7
import io
import socket
import struct
import numpy as np
import cv2
from time import sleep, time
from PIL import Image
from config import configs
from fcn.predict import Predictor
from util.detect import Detector
from util import img_process
IMG_W = configs['data']['image_width']
IMG_H = configs['data'][... | 35.969072 | 120 | 0.644884 |
e852350c0857ee13f94c986b7e219de941c129ab | 17,428 | py | Python | unfurl/yamlloader.py | mehak151/unfurl | db4a0fd7163462156b5958103900942ae61c5d4c | [
"MIT"
] | null | null | null | unfurl/yamlloader.py | mehak151/unfurl | db4a0fd7163462156b5958103900942ae61c5d4c | [
"MIT"
] | null | null | null | unfurl/yamlloader.py | mehak151/unfurl | db4a0fd7163462156b5958103900942ae61c5d4c | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Adam Souzis
# SPDX-License-Identifier: MIT
import os.path
import sys
import codecs
import json
import functools
import six
from six.moves import urllib
try:
from urlparse import urljoin # Python2
except ImportError:
from urllib.parse import urljoin # Python3
pathname2url = urllib.request... | 35.066398 | 102 | 0.575453 |
e8526acb76d9b57029b38fbf954aaef5fc53159a | 2,457 | py | Python | leetcode_python/Array/majority-element.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/majority-element.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/majority-element.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
You may assume that the array is non-empty and the majority element always exist in the array.
Example 1:
Input: [3,2,3]
Output: 3
Example 2:
Input: [2,2,1,1,1,2,2]
Output: 2
"""
# V0
... | 24.088235 | 126 | 0.516077 |
e8527a737efba291fbe293e23243abdc0dac9e2e | 5,587 | py | Python | src/examples/python/symbolic_emulation_1.py | flokli/Triton | db520a9da012b28f23321ff082aa810e1f1552ff | [
"Apache-2.0"
] | 2 | 2019-08-01T06:58:30.000Z | 2020-03-28T04:38:12.000Z | src/examples/python/symbolic_emulation_1.py | Ahmadmansoor/Triton | e1a8538ee1512999589f58c0272f0ee33f33c377 | [
"Apache-2.0"
] | null | null | null | src/examples/python/symbolic_emulation_1.py | Ahmadmansoor/Triton | e1a8538ee1512999589f58c0272f0ee33f33c377 | [
"Apache-2.0"
] | 1 | 2018-12-08T11:13:43.000Z | 2018-12-08T11:13:43.000Z | #!/usr/bin/env python2
## -*- coding: utf-8 -*-
##
## Output:
##
## $ ./src/examples/python/symbolic_emulation_1.py
## 400000: movabs rax, 0x4142434445464748
## ref!0 = (_ bv4702394921427289928 64) ; MOVABS operation
## ref!1 = (_ bv4194314 64) ; Program Counter
##
## 40000a: mov rsi, 8
## ... | 39.06993 | 128 | 0.587793 |
e8528e9890ffc1dbf3432c819d18260d7475afbe | 5,276 | py | Python | tensorflow/contrib/layers/python/layers/encoders_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/contrib/layers/python/layers/encoders_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/layers/python/layers/encoders_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.899225 | 80 | 0.66376 |
e852911541a0ba919c0a7ab97d2451239cc677c3 | 1,274 | py | Python | setup.py | DNPLab/DNPLab | 78999a4e8320b6476a5aa55d9884c49d74149edc | [
"MIT"
] | 4 | 2020-09-23T08:09:33.000Z | 2022-02-10T22:02:11.000Z | setup.py | DNPLab/DNPLab | 78999a4e8320b6476a5aa55d9884c49d74149edc | [
"MIT"
] | 126 | 2020-09-16T22:25:59.000Z | 2022-03-29T17:15:27.000Z | setup.py | DNPLab/DNPLab | 78999a4e8320b6476a5aa55d9884c49d74149edc | [
"MIT"
] | 5 | 2020-09-24T20:57:31.000Z | 2021-08-19T01:52:16.000Z | import setuptools
from distutils.core import setup
with open("README.md", "r") as f:
long_description = f.read()
with open("dnplab/version.py", "r") as f:
# Define __version__
exec(f.read())
setup(
name="dnplab",
packages=setuptools.find_packages(),
version=__version__,
license="MIT",
... | 27.106383 | 80 | 0.596546 |
e8529cd31f9202a50b9c9774037ddc744ff92efa | 23,697 | py | Python | system_test/utils/system_test_utils.py | yobennett/kafka | e582447adb4708731aff74aa294e7ce2b30b0a41 | [
"Apache-2.0"
] | 2 | 2016-06-27T03:11:17.000Z | 2016-06-27T03:11:18.000Z | system_test/utils/system_test_utils.py | yobennett/kafka | e582447adb4708731aff74aa294e7ce2b30b0a41 | [
"Apache-2.0"
] | 3 | 2017-03-30T20:09:03.000Z | 2017-06-15T21:26:21.000Z | system_test/utils/system_test_utils.py | yobennett/kafka | e582447adb4708731aff74aa294e7ce2b30b0a41 | [
"Apache-2.0"
] | 2 | 2018-08-22T09:36:15.000Z | 2021-01-14T11:41:07.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 file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.084507 | 143 | 0.615479 |
e852a38f556436698a4e8591b94a857fa8acba14 | 1,452 | py | Python | do_hurricane_sz.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | do_hurricane_sz.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | do_hurricane_sz.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | 1 | 2022-02-11T23:22:41.000Z | 2022-02-11T23:22:41.000Z | import os
import numpy as np
datafolder="/home/jliu447/lossycompression/Hurricane/clean-data-Jinyang"
ebs=[i*1e-4 for i in range(1,10)]+[i*1e-3 for i in range(1,10)]+[i*1e-2 for i in range(1,11)]
fields=["CLOUD","PRECIP","QGRAUP","QRAIN","QVAPOR","U","W","P","QCLOUD","QICE","QSNOW","TC","V"]
cr=np.zeros((len(ebs)+1,... | 33 | 96 | 0.53719 |
e852a6898caf774046e6f47a1354b2bf7f27ea04 | 3,627 | py | Python | examples/ommhelper/reporter/groreporter.py | z-gong/openmm-velocityVerlet | 87783cdec2eb64cf0811707ebd97be656e23ab34 | [
"Unlicense"
] | 5 | 2021-04-02T06:08:57.000Z | 2022-02-13T17:37:28.000Z | examples/ommhelper/reporter/groreporter.py | z-gong/openmm-velocityVerlet | 87783cdec2eb64cf0811707ebd97be656e23ab34 | [
"Unlicense"
] | 5 | 2021-05-12T07:34:24.000Z | 2022-03-21T14:49:59.000Z | protex/scripts/ommhelper/reporter/groreporter.py | wiederm/protex | 7fb945dcee138705e28465f4657678185ed97cb8 | [
"MIT"
] | 1 | 2021-12-09T16:18:13.000Z | 2021-12-09T16:18:13.000Z | import math
from .. import GroFile
class GroReporter(object):
'''
GroReporter outputs a series of frames from a Simulation to a GRO file.
Parameters
----------
file : string
The file to write to
reportInterval : int
The interval (in time steps) at which to write frames
loga... | 38.178947 | 137 | 0.636063 |
e852af856200af152400f117330b6538dacf1f05 | 1,930 | py | Python | scripts/training-data-processing/training_set_creation/createBuildingBoundingBoxes.py | DDS-Lab/disaster-image-processing | 5d87e858c8d933bf4d5288061d121129fadb863d | [
"MIT"
] | 10 | 2018-11-07T14:39:15.000Z | 2022-03-30T11:27:27.000Z | scripts/training-data-processing/training_set_creation/createBuildingBoundingBoxes.py | DDS-Lab/disaster-image-processing | 5d87e858c8d933bf4d5288061d121129fadb863d | [
"MIT"
] | 1 | 2019-09-24T07:22:33.000Z | 2019-09-24T07:22:33.000Z | scripts/training-data-processing/training_set_creation/createBuildingBoundingBoxes.py | DDS-Lab/disaster-image-processing | 5d87e858c8d933bf4d5288061d121129fadb863d | [
"MIT"
] | 5 | 2018-08-02T21:25:30.000Z | 2020-08-08T18:52:50.000Z | import geopandas as gpd
import argparse
import os
import glob
import progressbar
def load_file(file_path):
shape = gpd.GeoDataFrame(gpd.read_file(file_path))
return shape
def create_bounding_box(file, new_name):
affected_structures = load_file(file)
polygons = gpd.GeoSeries(affected_structures.geome... | 26.805556 | 70 | 0.7 |
e852bbb9c08e098c0b54f2ca24662a27340ec7a3 | 3,727 | py | Python | scales/thriftmux/serializer.py | steveniemitz/scales | 153fff192a11fbda18afdea12652b090e33b3c59 | [
"MIT"
] | 48 | 2015-06-04T00:08:44.000Z | 2021-02-27T16:00:50.000Z | scales/thriftmux/serializer.py | steveniemitz/pynagle | 153fff192a11fbda18afdea12652b090e33b3c59 | [
"MIT"
] | 10 | 2015-07-30T20:54:02.000Z | 2020-02-24T15:39:49.000Z | scales/thriftmux/serializer.py | steveniemitz/pynagle | 153fff192a11fbda18afdea12652b090e33b3c59 | [
"MIT"
] | 11 | 2015-06-10T19:44:34.000Z | 2020-02-14T02:02:40.000Z | from struct import (pack, unpack)
from six import string_types
from ..constants import TransportHeaders
from ..message import (
MethodCallMessage,
MethodDiscardMessage,
MethodReturnMessage,
ServerError,
Deadline
)
from ..mux.sink import Tag
from ..thrift.serializer import MessageSerializer as ThriftMessageS... | 30.801653 | 81 | 0.688221 |
e852d9dab299e7672974c03db6bab49a9a535211 | 4,143 | py | Python | assets/advanced_regression/configs/advanced_regression_train_config.py | kerenleibovich/mlapp | 0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693 | [
"Apache-2.0"
] | 33 | 2021-02-26T10:41:09.000Z | 2021-11-07T12:35:32.000Z | assets/advanced_regression/configs/advanced_regression_train_config.py | kerenleibovich/mlapp | 0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693 | [
"Apache-2.0"
] | 17 | 2021-03-04T15:37:21.000Z | 2021-04-06T12:00:13.000Z | assets/advanced_regression/configs/advanced_regression_train_config.py | kerenleibovich/mlapp | 0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693 | [
"Apache-2.0"
] | 9 | 2021-03-03T20:02:41.000Z | 2021-10-05T13:03:56.000Z | import numpy as np
# train configurations
advanced_regression_config = {
"pipelines_configs": [
{
"data_settings": {
# load data
"data_sources": {
# local file
"local": {
"file_paths": ["data/diabete... | 41.43 | 114 | 0.314989 |
e852e054e1c151c94f86b59baed17cde67076668 | 3,996 | py | Python | challenges/misc/karel/source/karel/editor.py | infosec-ucalgary/magpieCTF-2021 | 78459a1e16ac3a135e891c2246232c4890960b92 | [
"MIT"
] | 18 | 2021-02-22T00:09:27.000Z | 2022-02-28T14:23:33.000Z | challenges/misc/karel/source/karel/editor.py | infosec-ucalgary/magpieCTF-2021 | 78459a1e16ac3a135e891c2246232c4890960b92 | [
"MIT"
] | null | null | null | challenges/misc/karel/source/karel/editor.py | infosec-ucalgary/magpieCTF-2021 | 78459a1e16ac3a135e891c2246232c4890960b92 | [
"MIT"
] | 6 | 2021-02-22T01:32:10.000Z | 2022-02-25T15:48:42.000Z | """
An implementation of Karel the Robot as described by Richard E. Pattis in
Karel the Robot: A Gentle Introduction to the Art of Programming, 2nd ed.
(John Wiley & Sons, 1995). This implementation has Karel using Python 3 syntax
and relies on the Booksite Library supporting Introduction to Programming in
Python by Ro... | 34.153846 | 78 | 0.586587 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.