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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5a62009ad2b82b577462a38161332570b8a7e124 | 4,314 | py | Python | tests/integration/tools/test_zoom_in_tool.py | karen-poon/bokeh | d0ecb0c9089fc0838ca36371814430af51901708 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/tools/test_zoom_in_tool.py | karen-poon/bokeh | d0ecb0c9089fc0838ca36371814430af51901708 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/tools/test_zoom_in_tool.py | karen-poon/bokeh | d0ecb0c9089fc0838ca36371814430af51901708 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 34.238095 | 102 | 0.541725 |
2c3e8616e1e60372adf57c7af481a68b4fb5a39c | 5,122 | py | Python | tests/keras/layers/pooling_test.py | kalyc/keras-apache-mxnet | 5497ebd50a45ccc446b8944ebbe11fb7721a5533 | [
"MIT"
] | 300 | 2018-04-04T05:01:21.000Z | 2022-02-25T18:56:04.000Z | tests/keras/layers/pooling_test.py | kalyc/keras-apache-mxnet | 5497ebd50a45ccc446b8944ebbe11fb7721a5533 | [
"MIT"
] | 163 | 2018-04-03T17:41:22.000Z | 2021-09-03T16:44:04.000Z | tests/keras/layers/pooling_test.py | kalyc/keras-apache-mxnet | 5497ebd50a45ccc446b8944ebbe11fb7721a5533 | [
"MIT"
] | 72 | 2018-04-21T06:42:30.000Z | 2021-12-26T06:02:42.000Z | import numpy as np
import pytest
from keras.utils.test_utils import layer_test
from keras.layers import pooling
from keras.layers import Masking
from keras.layers import convolutional
from keras.models import Sequential
@pytest.mark.parametrize(
'padding,stride,data_format',
[(padding, stride, data_format)
... | 32.833333 | 71 | 0.611089 |
a4908b2121809177e435d403900e1ccb8d0846e6 | 13,542 | py | Python | tests/delete_regress/tests.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 166 | 2015-01-07T08:23:17.000Z | 2022-02-23T00:09:44.000Z | tests/delete_regress/tests.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 107 | 2015-01-19T22:11:09.000Z | 2021-09-18T19:29:44.000Z | tests/delete_regress/tests.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 89 | 2015-01-08T19:52:16.000Z | 2021-12-17T11:26:53.000Z | from __future__ import absolute_import
import datetime
from django.conf import settings
from django.db import transaction, DEFAULT_DB_ALIAS, models
from django.db.utils import ConnectionHandler
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import (Book, Award, AwardNote, Per... | 36.899183 | 102 | 0.643775 |
8f0225557f5fd36f7a83d4b6c2fcda0e47312656 | 1,128 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_health_status.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_health_status.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_health_status.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 31.333333 | 78 | 0.603723 |
c05107a951cd71a03696cd3dc8c566d4b55d6b42 | 3,359 | py | Python | app/app/settings.py | mabdullahadeel/django-docker-basic | 697ca83be6a435ba65b8903cf0f9db01938fd828 | [
"MIT"
] | null | null | null | app/app/settings.py | mabdullahadeel/django-docker-basic | 697ca83be6a435ba65b8903cf0f9db01938fd828 | [
"MIT"
] | null | null | null | app/app/settings.py | mabdullahadeel/django-docker-basic | 697ca83be6a435ba65b8903cf0f9db01938fd828 | [
"MIT"
] | null | null | null | """
Django settings for app 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/
"""
import os
# Build... | 26.242188 | 91 | 0.699911 |
028c9c7de78dda1bc70db1045e021e5d1f844d92 | 15,778 | py | Python | electricitylci/upstream_dict.py | gschivley/ElectricityLCI | 1c1c1b69705d3ffab1e1e844aaf7379e4f51198e | [
"CC0-1.0"
] | 1 | 2019-04-15T18:11:16.000Z | 2019-04-15T18:11:16.000Z | electricitylci/upstream_dict.py | gschivley/ElectricityLCI | 1c1c1b69705d3ffab1e1e844aaf7379e4f51198e | [
"CC0-1.0"
] | 3 | 2019-05-07T19:04:22.000Z | 2019-09-30T21:29:59.000Z | electricitylci/upstream_dict.py | gschivley/ElectricityLCI | 1c1c1b69705d3ffab1e1e844aaf7379e4f51198e | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas as pd
from electricitylci.globals import output_dir, data_dir
from electricitylci.coal_upstream import (
coal_type_codes,
mine_type_codes,
basin_codes,
)
from electricitylci import write_process_dicts_to_jsonld
import logging
module_logger=logging.getLogger("upstream_... | 37.927885 | 128 | 0.597541 |
0711def3e684b17d5b73a833321f95c0b3ddefaf | 5,186 | py | Python | main.py | afrafaris72/BelajarGIS | 0166cd6d34537560e693b341d9861e1ef5347afb | [
"MIT"
] | null | null | null | main.py | afrafaris72/BelajarGIS | 0166cd6d34537560e693b341d9861e1ef5347afb | [
"MIT"
] | null | null | null | main.py | afrafaris72/BelajarGIS | 0166cd6d34537560e693b341d9861e1ef5347afb | [
"MIT"
] | null | null | null | import ketiga
import kedua
import pertama
pertama = pertama.Pertama()
# Harun Ar - Rasyid - 1174027
pertama.baak('BAAK')
# Harun Ar - Rasyid - 1174027
pertama.bauk('BAUK')
# Kadek Diva Krishna Murti - 1174006
pertama.ruangan111('Ruangan 111')
# Nico Ekklesia Sembiring - 1174096
pertama.ruangan113('Ruangan 113')
# Kad... | 23.898618 | 55 | 0.758774 |
52ffb1d740b8016dedbb200eab19a9f76d9f6cf3 | 884 | py | Python | src/pytorch_metric_learning/losses/cosface_loss.py | wconnell/pytorch-metric-learning | 1affee7c77bb5d6d4ee559bad62b910a21b39d48 | [
"MIT"
] | 1 | 2021-05-30T14:59:42.000Z | 2021-05-30T14:59:42.000Z | src/pytorch_metric_learning/losses/cosface_loss.py | umitkacar/pytorch-metric-learning | bf2b7675b7b80e5762b75428d51e4ab0a861e710 | [
"MIT"
] | null | null | null | src/pytorch_metric_learning/losses/cosface_loss.py | umitkacar/pytorch-metric-learning | bf2b7675b7b80e5762b75428d51e4ab0a861e710 | [
"MIT"
] | null | null | null | from .large_margin_softmax_loss import LargeMarginSoftmaxLoss
import numpy as np
import torch
class CosFaceLoss(LargeMarginSoftmaxLoss):
"""
Implementation of https://arxiv.org/pdf/1801.07698.pdf
"""
def __init__(self, *args, margin=0.35, scale=64, **kwargs):
super().__init__(*args, ma... | 34 | 96 | 0.669683 |
c89968a883c037d2b8abdb5c460ae75060befcaf | 15,028 | py | Python | pay-api/src/pay_api/services/fas/routing_slip.py | bcgov/sbc-pay | 142872e61109f097ee7f926375c3139421f38849 | [
"Apache-2.0"
] | 4 | 2020-03-23T21:37:02.000Z | 2021-06-15T11:25:22.000Z | pay-api/src/pay_api/services/fas/routing_slip.py | bcgov/sbc-pay | 142872e61109f097ee7f926375c3139421f38849 | [
"Apache-2.0"
] | 757 | 2019-05-02T17:53:52.000Z | 2022-03-31T22:42:01.000Z | pay-api/src/pay_api/services/fas/routing_slip.py | bcgov/sbc-pay | 142872e61109f097ee7f926375c3139421f38849 | [
"Apache-2.0"
] | 39 | 2019-01-30T20:05:36.000Z | 2022-03-24T15:07:54.000Z | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 37.949495 | 112 | 0.646061 |
ea2965c2c068b1b82137de3e4e1b55a657e1bdd8 | 8,510 | py | Python | 2021/src/Pre-processing/Isotropic/Noise/src/test/main.py | tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | [
"MIT"
] | null | null | null | 2021/src/Pre-processing/Isotropic/Noise/src/test/main.py | tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | [
"MIT"
] | null | null | null | 2021/src/Pre-processing/Isotropic/Noise/src/test/main.py | tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | [
"MIT"
] | null | null | null | import argparse
import cv2
import numpy as np
import tensorflow as tf
import dataset_reader
import samples_plt
from CNN_denoiser import CNN_denoiser
def load_datasets(img_width=64, img_height=64):
raw_mias = dataset_reader.read_mini_mias() # Read mias dataset
mias_images = np.zeros((raw_mias.shape[0], img_... | 50.35503 | 174 | 0.636193 |
30a282b3889f623a27c8fd7fef702aade67e132d | 6,264 | py | Python | server/galaxyls/tests/unit/test_context.py | blankenberg/galaxy-language-server | 5b56e56a16bf2d93a0cab1aced564bf1fa3f4f3b | [
"Apache-2.0"
] | null | null | null | server/galaxyls/tests/unit/test_context.py | blankenberg/galaxy-language-server | 5b56e56a16bf2d93a0cab1aced564bf1fa3f4f3b | [
"Apache-2.0"
] | null | null | null | server/galaxyls/tests/unit/test_context.py | blankenberg/galaxy-language-server | 5b56e56a16bf2d93a0cab1aced564bf1fa3f4f3b | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional
import pytest
from pygls.workspace import Position
from pytest_mock import MockerFixture
from ...services.context import XmlContext, XmlContextService, XsdNode, XsdTree
from ...services.xml.nodes import XmlAttribute, XmlAttributeKey, XmlAttributeValue, XmlElement
from ...services.xml... | 46.058824 | 112 | 0.646392 |
37596be79d321e633a44729dc88b84e9ab4c9600 | 1,495 | py | Python | miniworld/model/singletons/Singletons.py | miniworld-project/miniworld_core | c591bad232b78eae99e8f55cb1b907c1e228484b | [
"MIT"
] | 5 | 2019-05-11T14:57:15.000Z | 2021-07-05T00:35:25.000Z | miniworld/model/singletons/Singletons.py | miniworld-project/miniworld_core | c591bad232b78eae99e8f55cb1b907c1e228484b | [
"MIT"
] | 27 | 2017-03-17T07:11:02.000Z | 2019-05-26T23:36:56.000Z | miniworld/model/singletons/Singletons.py | miniworld-project/miniworld_core | c591bad232b78eae99e8f55cb1b907c1e228484b | [
"MIT"
] | 6 | 2017-05-03T12:11:33.000Z | 2020-04-03T11:44:27.000Z | __author__ = 'Nils Schmidt'
# TODO: #54,#55: adjust doc
class Singletons:
"""
Stores all singletons.
The module `SingletonInit` shall be used to initialize them. Therefore, we prevent cyclic imports.
Singletons which have state that shall be resetted when a new simulation is started, needs to
be r... | 29.9 | 102 | 0.64214 |
23a03efe86d66a3c85da63c1b91cb7fe5c8eb98c | 2,982 | py | Python | TellTheBell.py | ThatAuskeGuy/Taco-Bell-Survey | 5cb1cec11eb765fb496ae62591c5d05601ee4d80 | [
"MIT"
] | null | null | null | TellTheBell.py | ThatAuskeGuy/Taco-Bell-Survey | 5cb1cec11eb765fb496ae62591c5d05601ee4d80 | [
"MIT"
] | null | null | null | TellTheBell.py | ThatAuskeGuy/Taco-Bell-Survey | 5cb1cec11eb765fb496ae62591c5d05601ee4d80 | [
"MIT"
] | null | null | null | """ Taco Bell Survey Automation """
import random
import selenium
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import Select
# Get input from user from receipt
name = input("First and Last Name (Joe Mama): ").split()
phone = input("Pho... | 35.927711 | 199 | 0.630449 |
7bc8f9869d3cda6cd2464a43d8c8db7ed3eb7dbd | 790 | py | Python | distribution/translation.py | ASL-19/outline-distribution | 6ef595d59c0d7d9416cd1d3c0fb263ba83830126 | [
"Apache-2.0"
] | 5 | 2020-12-21T21:19:28.000Z | 2022-03-28T00:53:45.000Z | distribution/translation.py | ASL-19/outline-distribution | 6ef595d59c0d7d9416cd1d3c0fb263ba83830126 | [
"Apache-2.0"
] | 5 | 2021-01-07T02:32:47.000Z | 2022-03-28T14:28:52.000Z | distribution/translation.py | ASL-19/outline-distribution | 6ef595d59c0d7d9416cd1d3c0fb263ba83830126 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 ASL19 Organization
#
# 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 wr... | 35.909091 | 74 | 0.781013 |
1622b51fb3359252725dd26697f7ed305212cb84 | 4,015 | py | Python | eoxserver/resources/coverages/management/commands/browse.py | kalxas/eoxserver | 8073447d926f3833923bde7b7061e8a1658dee06 | [
"OML"
] | 25 | 2015-08-10T19:34:34.000Z | 2021-02-05T08:28:01.000Z | eoxserver/resources/coverages/management/commands/browse.py | kalxas/eoxserver | 8073447d926f3833923bde7b7061e8a1658dee06 | [
"OML"
] | 153 | 2015-01-20T08:35:49.000Z | 2022-03-16T11:00:56.000Z | eoxserver/resources/coverages/management/commands/browse.py | kalxas/eoxserver | 8073447d926f3833923bde7b7061e8a1658dee06 | [
"OML"
] | 10 | 2015-01-23T15:48:30.000Z | 2021-01-21T15:41:18.000Z | # ------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
#
# ------------------------------------------------------------------------------
# Copyright (C) 2017 EOX IT Services GmbH
#
# Permission... | 41.822917 | 80 | 0.648817 |
e432a976138e6bff013b57b0556f0168be9d7ae0 | 3,331 | py | Python | custom_components/bwt_perla/config_flow.py | dkarv/bwt_perla | 885472b3484349448f00d44678cd7c14132f862f | [
"MIT"
] | 9 | 2021-06-19T13:26:45.000Z | 2022-02-19T19:27:16.000Z | custom_components/bwt_perla/config_flow.py | dkarv/bwt_perla | 885472b3484349448f00d44678cd7c14132f862f | [
"MIT"
] | 6 | 2021-09-29T07:03:04.000Z | 2022-02-24T16:26:37.000Z | custom_components/bwt_perla/config_flow.py | dkarv/bwt_perla | 885472b3484349448f00d44678cd7c14132f862f | [
"MIT"
] | 4 | 2021-08-17T20:41:08.000Z | 2021-12-28T22:26:33.000Z | import logging
import voluptuous as vol
import traceback
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from .api import BWTPerlaApi
from .const import (
CONF_CODE,
CONF_HOST,
CONF_SYNC_INTERVAL,... | 30.009009 | 88 | 0.61363 |
6a207ac9d8a64829ac27a308db39096085cb5f17 | 1,978 | py | Python | mayan/apps/permissions/tests/test_events.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | null | null | null | mayan/apps/permissions/tests/test_events.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | 5 | 2021-03-19T22:56:45.000Z | 2022-03-12T00:08:43.000Z | mayan/apps/permissions/tests/test_events.py | Sumit-Kumar-Jha/mayan | 5b7ddeccf080b9e41cc1074c70e27dfe447be19f | [
"Apache-2.0"
] | 1 | 2020-07-29T21:03:27.000Z | 2020-07-29T21:03:27.000Z | from __future__ import unicode_literals
from actstream.models import Action
from mayan.apps.common.tests.base import GenericViewTestCase
from ..events import event_role_created, event_role_edited
from ..permissions import permission_role_create, permission_role_edit
from .mixins import RoleTestMixin, RoleViewTestMi... | 34.701754 | 80 | 0.734075 |
30179d1606b1f659ef1e815eb63a14f7fc43a757 | 2,928 | py | Python | utilities/dump-save-file.py | jhartz/gradefast | 0390eb605c56bfc8a02cfb34340fa4dbd52b4c44 | [
"MIT"
] | 5 | 2017-09-10T22:11:01.000Z | 2018-08-28T23:08:27.000Z | utilities/dump-save-file.py | jhartz/gradefast | 0390eb605c56bfc8a02cfb34340fa4dbd52b4c44 | [
"MIT"
] | 1 | 2018-09-06T12:53:45.000Z | 2018-09-11T15:37:26.000Z | utilities/dump-save-file.py | jhartz/gradefast | 0390eb605c56bfc8a02cfb34340fa4dbd52b4c44 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Utility script to dump the contents of a GradeFast save file.
Licensed under the MIT License. For more, see the LICENSE file.
Author: Jake Hartz <jake@hartz.io>
"""
import argparse
import json
import os
import pickle
import shelve
import sqlite3
import sys
from collections import OrderedDi... | 26.618182 | 95 | 0.615437 |
b2771cccec24c57721a531c19ac06e0c4d02a997 | 768 | py | Python | dffml/config/json.py | iamandeepsandhu/dffml | 16b3234f7850f73163de61e21741ac5816cbf531 | [
"MIT"
] | 1 | 2020-02-07T07:33:15.000Z | 2020-02-07T07:33:15.000Z | dffml/config/json.py | sourabhyadav999/dffml | beda53caf483f4d010d97795f13527b4b573fa37 | [
"MIT"
] | null | null | null | dffml/config/json.py | sourabhyadav999/dffml | beda53caf483f4d010d97795f13527b4b573fa37 | [
"MIT"
] | null | null | null | import json
from typing import Dict
from ..util.entrypoint import entrypoint
from ..util.cli.arg import Arg
from ..base import BaseConfig
from .config import BaseConfigLoaderContext, BaseConfigLoader
class JSONConfigLoaderContext(BaseConfigLoaderContext):
async def loadb(self, resource: bytes) -> Dict:
r... | 26.482759 | 70 | 0.721354 |
f69c0c9863dbb269baa9ce903bc65a495e68e7b2 | 14,055 | py | Python | simple_tensor/networks/inception_v4.py | fatchur/simple_tensor | ebc66d46d54fcfb65ef104978a6feca0a156b9b3 | [
"MIT"
] | 21 | 2019-03-08T16:02:46.000Z | 2022-02-09T03:31:26.000Z | simple_tensor/networks/inception_v4.py | fatchur/simple_tensor | ebc66d46d54fcfb65ef104978a6feca0a156b9b3 | [
"MIT"
] | 3 | 2020-02-04T08:43:20.000Z | 2020-10-20T13:52:16.000Z | simple_tensor/networks/inception_v4.py | fatchur/simple_tensor | ebc66d46d54fcfb65ef104978a6feca0a156b9b3 | [
"MIT"
] | 5 | 2019-11-30T03:40:04.000Z | 2021-12-26T07:01:53.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 applicable ... | 49.664311 | 93 | 0.639701 |
74cfd14e406d0823d3c2432cad41a4a8e497ad7b | 415 | py | Python | pymf6/tests/functional/scenarios/data/base_data_b.py | hydrocomputing/pymf6 | 0f9e2716c7881b17e1030bca895fb0410d4586bb | [
"MIT"
] | 4 | 2019-07-04T12:20:25.000Z | 2020-06-30T02:56:07.000Z | pymf6/tests/functional/scenarios/data/base_data_b.py | hydrocomputing/pymf6 | 0f9e2716c7881b17e1030bca895fb0410d4586bb | [
"MIT"
] | 2 | 2020-02-13T18:34:03.000Z | 2020-06-02T15:27:53.000Z | pymf6/tests/functional/scenarios/data/base_data_b.py | hydrocomputing/pymf6 | 0f9e2716c7881b17e1030bca895fb0410d4586bb | [
"MIT"
] | null | null | null | """Data for the base model
"""
from copy import deepcopy
from .base_data_a import data
data = deepcopy(data)
data['wel'] = {
'abs': {
'name': 'Abstraction Well',
'coords': (0, 49, 100),
'rates': [0, 0, 0]
},
'inj': {
'name': 'Injection Well... | 18.863636 | 39 | 0.412048 |
c9b5b3fcc4437519d42407e733e0fb8c8b3bb825 | 159 | py | Python | nostradamus/apps/extractor/routing.py | exactpro/nostradamus | 80df847a012374ad2b702cc9f9c9cb46c1153ee7 | [
"Apache-2.0"
] | 25 | 2019-12-18T05:32:41.000Z | 2022-03-23T12:16:49.000Z | nostradamus/apps/extractor/routing.py | Exactpro/nostradamus | 80df847a012374ad2b702cc9f9c9cb46c1153ee7 | [
"Apache-2.0"
] | 12 | 2018-12-24T14:56:50.000Z | 2019-11-29T16:53:49.000Z | nostradamus/apps/extractor/routing.py | exactpro/nostradamus | 80df847a012374ad2b702cc9f9c9cb46c1153ee7 | [
"Apache-2.0"
] | 7 | 2019-12-18T05:32:43.000Z | 2021-08-18T05:27:04.000Z | from django.urls import path
from apps.extractor.consumers import ExtractorConsumer
websocket_urlpatterns = [path("extractor_listener/", ExtractorConsumer)]
| 26.5 | 72 | 0.836478 |
fac12e03d1c78113dfed84fc2a68d3ee4da489ed | 190 | py | Python | chargebee/models/download.py | Uszczi/chargebee-python | f98a749961631aefd88e7d530f35cabd422d924b | [
"MIT"
] | null | null | null | chargebee/models/download.py | Uszczi/chargebee-python | f98a749961631aefd88e7d530f35cabd422d924b | [
"MIT"
] | null | null | null | chargebee/models/download.py | Uszczi/chargebee-python | f98a749961631aefd88e7d530f35cabd422d924b | [
"MIT"
] | null | null | null | import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError
class Download(Model):
fields = ["download_url", "valid_till", "mime_type"]
| 19 | 56 | 0.773684 |
19acf13e33249e19de8dcd066c690bfab2c215e2 | 3,177 | py | Python | collectors/StatsCollector.py | sapcc/vrops-exporter | c342f319e1f69590fa514ba07c783e586aeb223a | [
"Apache-2.0"
] | 18 | 2019-10-24T03:36:50.000Z | 2022-01-22T20:39:42.000Z | collectors/StatsCollector.py | richardtief/vrops-exporter | 7e7543f5561f85aab1828e4c9d6fada4b687639f | [
"Apache-2.0"
] | 55 | 2019-10-16T09:51:36.000Z | 2022-03-28T11:46:08.000Z | collectors/StatsCollector.py | richardtief/vrops-exporter | 7e7543f5561f85aab1828e4c9d6fada4b687639f | [
"Apache-2.0"
] | 19 | 2019-10-15T14:07:27.000Z | 2022-02-17T21:41:14.000Z | from BaseCollector import BaseCollector
import logging
import re
logger = logging.getLogger('vrops-exporter')
class StatsCollector(BaseCollector):
def get_resource_uuids(self):
raise NotImplementedError("Please Implement this method")
def get_labels(self, resource_id: str, project_ids: list):
... | 43.520548 | 113 | 0.5757 |
3b107bbf0fe262ee4a51c1c8c213f87eafceecfe | 2,475 | py | Python | tests/hikari/test_presences.py | IkBenOlie5/hikari | 09502f05427ad92b05103bd1a56533296a593755 | [
"MIT"
] | 1 | 2021-09-05T18:15:24.000Z | 2021-09-05T18:15:24.000Z | tests/hikari/test_presences.py | IkBenOlie5/hikari | 09502f05427ad92b05103bd1a56533296a593755 | [
"MIT"
] | 34 | 2021-10-01T17:08:11.000Z | 2022-03-29T02:21:07.000Z | tests/hikari/test_presences.py | IkBenOlie5/hikari | 09502f05427ad92b05103bd1a56533296a593755 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021 davfsa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the right... | 37.5 | 85 | 0.736162 |
d837e51010feb074f7e1ce6cde0fd2fde654364b | 16,916 | py | Python | var/spack/repos/builtin/packages/ascent/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/ascent/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 17 | 2018-09-20T18:32:50.000Z | 2019-12-04T16:58:12.000Z | var/spack/repos/builtin/packages/ascent/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 5 | 2019-07-30T09:42:14.000Z | 2021-01-25T05:39:20.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import sys
import os
import socket
import glob
import shutil
import llnl.util.tty as tty
from os imp... | 38.887356 | 82 | 0.50668 |
8e6863c18bfba564bf496b9bfceb3203d34b7834 | 939 | py | Python | setup.py | rafaellott/gcp-commons-utils | 933341918ed42dfce8bff28596fda108e752e1d3 | [
"MIT"
] | null | null | null | setup.py | rafaellott/gcp-commons-utils | 933341918ed42dfce8bff28596fda108e752e1d3 | [
"MIT"
] | null | null | null | setup.py | rafaellott/gcp-commons-utils | 933341918ed42dfce8bff28596fda108e752e1d3 | [
"MIT"
] | null | null | null | import os.path
from setuptools import setup, find_packages
# The directory containing this file
HERE = os.path.abspath(os.path.dirname(__file__))
# The text of the README file
with open(os.path.join(HERE, "README.md")) as fid:
README = fid.read()
# This call to setup() does all the work
setup(
name="gcp-comm... | 30.290323 | 74 | 0.686901 |
7acd0b3c95e071da9c06de5a0c05be1698b44d3c | 9,272 | py | Python | scripts/setup_eclipse.py | amitpatra/nomulus | 48e5a4423c6843ee4c040c22f34cd62df5733413 | [
"Apache-2.0"
] | 1 | 2020-11-24T08:28:30.000Z | 2020-11-24T08:28:30.000Z | scripts/setup_eclipse.py | amitpatra/nomulus | 48e5a4423c6843ee4c040c22f34cd62df5733413 | [
"Apache-2.0"
] | null | null | null | scripts/setup_eclipse.py | amitpatra/nomulus | 48e5a4423c6843ee4c040c22f34cd62df5733413 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2016 The Nomulus 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 requ... | 31.753425 | 79 | 0.620255 |
3899decf8f0f3979efdbfde4bbc071fb5b2d1573 | 4,207 | py | Python | proxmox_hetzner_autoconfigure/util/util.py | johnknott/proxmox-hetzner-autoconfigure | 5b4d613abf3c8a7e07e2f51d687786d557d5602b | [
"MIT"
] | 12 | 2020-11-15T15:45:24.000Z | 2022-02-20T03:51:07.000Z | proxmox_hetzner_autoconfigure/util/util.py | johnknott/proxmox-hetzner-autoconfigure | 5b4d613abf3c8a7e07e2f51d687786d557d5602b | [
"MIT"
] | 1 | 2021-02-17T14:12:46.000Z | 2021-09-04T08:42:22.000Z | proxmox_hetzner_autoconfigure/util/util.py | johnknott/proxmox-hetzner-autoconfigure | 5b4d613abf3c8a7e07e2f51d687786d557d5602b | [
"MIT"
] | 9 | 2020-07-31T17:51:19.000Z | 2022-03-12T13:40:27.000Z | """Collection of utility methods"""
import os
import re
import platform
from ipaddress import IPv4Network, IPv4Address
from dialog import Dialog
from jinja2 import Environment, FileSystemLoader
IP_REGEX = r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b"
CIDR_REGEX = r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}\b"
EMAIL_R... | 31.871212 | 105 | 0.646304 |
9256873ececcd924252e4f328da56628572ea505 | 25,614 | py | Python | test/test_cli_options.py | Josef-Friedrich/audiorename.py | d95a02ac7176d8bc7010b74ce2d34fe6bedb91bd | [
"MIT"
] | null | null | null | test/test_cli_options.py | Josef-Friedrich/audiorename.py | d95a02ac7176d8bc7010b74ce2d34fe6bedb91bd | [
"MIT"
] | null | null | null | test/test_cli_options.py | Josef-Friedrich/audiorename.py | d95a02ac7176d8bc7010b74ce2d34fe6bedb91bd | [
"MIT"
] | null | null | null | """Test all command line options."""
import unittest
import audiorename
import os
import shutil
import tempfile
import helper
# --best-format
# --delete
# --backup
# --backup-folder
class TestBestFormat(unittest.TestCase):
def setUp(self):
self.target = tempfile.mkdtemp()
self.high_quality = sel... | 32.0175 | 78 | 0.577575 |
ec55979252242f614c0230d8e03ce4b201ab3eb5 | 8,669 | py | Python | herepy/map_image_api.py | mnogoruk/HerePy | 4fb91310d1ca5993f2ce89c9f73461f523c754ec | [
"MIT"
] | null | null | null | herepy/map_image_api.py | mnogoruk/HerePy | 4fb91310d1ca5993f2ce89c9f73461f523c754ec | [
"MIT"
] | null | null | null | herepy/map_image_api.py | mnogoruk/HerePy | 4fb91310d1ca5993f2ce89c9f73461f523c754ec | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import json
import requests
from typing import List, Optional
from herepy.here_api import HEREApi
from herepy.utils import Utils
from herepy import MapImageResourceType, MapImageFormatType
from herepy.error import HEREError, InvalidRequestError, UnauthorizedError
class MapImageApi(H... | 46.859459 | 169 | 0.626139 |
537a242af14ce39ccb8187adcc972fa34df8da77 | 19,190 | py | Python | tests/jobs/test_local_task_job.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-07-30T17:14:05.000Z | 2021-08-03T13:51:25.000Z | tests/jobs/test_local_task_job.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2021-06-28T20:57:42.000Z | 2022-02-26T02:11:11.000Z | tests/jobs/test_local_task_job.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-03T01:44:08.000Z | 2021-03-03T01:44:08.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... | 36.552381 | 107 | 0.640594 |
b0955ed3adbc400bc6577378127da21167c9c583 | 867 | py | Python | injector/AFDProxyInjector.py | batteryshark/AfdProxy | 2a80a969a4caa197c3c8825e40ea8e8f0b855396 | [
"MIT"
] | 22 | 2019-07-04T14:13:36.000Z | 2020-10-14T12:27:26.000Z | injector/AFDProxyInjector.py | batteryshark/AfdProxy | 2a80a969a4caa197c3c8825e40ea8e8f0b855396 | [
"MIT"
] | null | null | null | injector/AFDProxyInjector.py | batteryshark/AfdProxy | 2a80a969a4caa197c3c8825e40ea8e8f0b855396 | [
"MIT"
] | 10 | 2019-12-24T05:05:31.000Z | 2020-04-23T22:21:45.000Z | # Redirection of AFD Sockets via Process Monitoring / Injection
import os
import time
from ProcessMonitor import ProcessMonitor
from ContextHijack import inject
# Get Our Socket Library Paths
base_path = os.path.dirname(os.path.abspath(__file__))
AFDPROXY_32_PATH = os.path.join(base_path, "deps", "afdproxy32.dll")
AFD... | 28.9 | 84 | 0.748558 |
85038ffb9a98a95270c95ef454a5ecac8e3233b8 | 3,437 | py | Python | tests/test_plugin_helper.py | jupyterhub/nbgitpuller-downloader-plugins | 646857507fb21a6f2a7222bdd7610d7184492e69 | [
"MIT"
] | null | null | null | tests/test_plugin_helper.py | jupyterhub/nbgitpuller-downloader-plugins | 646857507fb21a6f2a7222bdd7610d7184492e69 | [
"MIT"
] | 3 | 2021-12-21T01:55:15.000Z | 2022-01-19T14:06:32.000Z | tests/test_plugin_helper.py | jupyterhub/nbgitpuller-downloader-plugins | 646857507fb21a6f2a7222bdd7610d7184492e69 | [
"MIT"
] | 1 | 2021-12-21T00:00:00.000Z | 2021-12-21T00:00:00.000Z | import os
import pytest
import shutil
import nbgitpuller_downloader_plugins_util.plugin_helper as ph
from aioresponses import aioresponses
test_files_dir = os.getcwd() + "/tests/test_files"
archive_base = "/tmp/test_files"
repo_parent_dir = "/tmp/fake/"
temp_download_repo = "/tmp/download/"
temp_archive_download = "/t... | 33.696078 | 102 | 0.731161 |
9b40b5c13c0f83ea813196c2f996b233409318ed | 3,690 | py | Python | aiozk/recipes/allocator.py | micro-fan/aiozk | 976a208b9cd648820c7edfa93e92082c6b1f4757 | [
"MIT"
] | 22 | 2019-08-21T11:39:21.000Z | 2021-08-18T11:21:23.000Z | aiozk/recipes/allocator.py | micro-fan/aiozk | 976a208b9cd648820c7edfa93e92082c6b1f4757 | [
"MIT"
] | 44 | 2019-08-12T08:39:57.000Z | 2021-10-08T19:38:46.000Z | aiozk/recipes/allocator.py | tipsi/aiozk | 976a208b9cd648820c7edfa93e92082c6b1f4757 | [
"MIT"
] | 15 | 2017-01-13T12:19:54.000Z | 2019-06-10T22:38:28.000Z | import asyncio
import collections
import itertools
import json
from .data_watcher import DataWatcher
from .party import Party
from .lock import Lock
from .recipe import Recipe
class Allocator(Recipe):
sub_recipes = {
"party": (Party, ["member_path", "name"]),
"lock": (Lock, ["lock_path"]),
... | 27.333333 | 79 | 0.639024 |
b908df1e39f0bf722671ef39bee447aea42b3c3f | 1,355 | py | Python | trieste/models/gpflow/config.py | vishalbelsare/trieste | d25b66becd0cac47574b0f8e80bc28301aa0bf98 | [
"Apache-2.0"
] | 1 | 2021-10-02T19:53:48.000Z | 2021-10-02T19:53:48.000Z | trieste/models/gpflow/config.py | vishalbelsare/trieste | d25b66becd0cac47574b0f8e80bc28301aa0bf98 | [
"Apache-2.0"
] | null | null | null | trieste/models/gpflow/config.py | vishalbelsare/trieste | d25b66becd0cac47574b0f8e80bc28301aa0bf98 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Trieste Contributors
#
# 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... | 38.714286 | 92 | 0.791882 |
ea5879446b2334c9ee659fd280780513b1222a0e | 411 | py | Python | services/sound.py | BinderEq/space-english | 9d9fa281c945812099a728ae01c8ba0df128142e | [
"BSD-3-Clause"
] | null | null | null | services/sound.py | BinderEq/space-english | 9d9fa281c945812099a728ae01c8ba0df128142e | [
"BSD-3-Clause"
] | null | null | null | services/sound.py | BinderEq/space-english | 9d9fa281c945812099a728ae01c8ba0df128142e | [
"BSD-3-Clause"
] | null | null | null | class Sound:
EXPL = 0
TAKE = 1
SHOOT = 2
def __init__(self, pygame):
pygame.mixer.music.set_volume(0.8)
self.sounds = []
self.sounds.append(pygame.mixer.Sound("sound/explosion.mp3"))
self.sounds.append(pygame.mixer.Sound("sound/take.mp3"))
self.sounds.append(pygam... | 31.615385 | 69 | 0.618005 |
b424cbbe17d5c4ac3e8b1e61976170b57442c8ab | 10,307 | py | Python | downstream/TextSGC/build_graph.py | GOOGLE-M/SGC | 78ad8d02b80808302e38559e2d0f430f66a809bd | [
"MIT"
] | null | null | null | downstream/TextSGC/build_graph.py | GOOGLE-M/SGC | 78ad8d02b80808302e38559e2d0f430f66a809bd | [
"MIT"
] | null | null | null | downstream/TextSGC/build_graph.py | GOOGLE-M/SGC | 78ad8d02b80808302e38559e2d0f430f66a809bd | [
"MIT"
] | null | null | null | import argparse
import itertools
import pickle as pkl
import random
from collections import Counter
from math import log
import numpy as np
import scipy.sparse as sp
from tqdm import tqdm
parser = argparse.ArgumentParser(description='Build Document Graph')
parser.add_argument('--dataset', type=str, default='20ng',
... | 32.514196 | 97 | 0.665373 |
b8e46c09e6c8417542ff54c0a7f7f94371f91495 | 784 | py | Python | tests/data_sources/optical_flow/test_optical_flow_model.py | JanEbbing/nowcasting_dataset | f907054a457987e6f6dbb13bfb65fc5359c6f680 | [
"MIT"
] | 15 | 2021-07-24T09:54:13.000Z | 2022-02-01T10:14:28.000Z | tests/data_sources/optical_flow/test_optical_flow_model.py | JanEbbing/nowcasting_dataset | f907054a457987e6f6dbb13bfb65fc5359c6f680 | [
"MIT"
] | 455 | 2021-06-11T10:37:49.000Z | 2022-03-24T14:51:47.000Z | tests/data_sources/optical_flow/test_optical_flow_model.py | JanEbbing/nowcasting_dataset | f907054a457987e6f6dbb13bfb65fc5359c6f680 | [
"MIT"
] | 10 | 2021-08-09T16:17:57.000Z | 2022-03-23T00:19:17.000Z | """Test Optical Flow model."""
import os
import tempfile
import numpy as np
import pytest
from nowcasting_dataset.data_sources.fake.batch import optical_flow_fake
from nowcasting_dataset.data_sources.optical_flow.optical_flow_model import OpticalFlow
def test_optical_flow_init(): # noqa: D103
_ = optical_flow_... | 24.5 | 87 | 0.751276 |
0ae03516bafbb729bd8b13f84caf8ac143aeeed6 | 7,007 | py | Python | hybridbackend/tensorflow/data/parquet_dataset_v1.py | alibaba/HybridBackend | 498f74038fbc3be4ab1de6a8c3c2ef99f39af5e3 | [
"Apache-2.0"
] | 38 | 2021-12-01T06:54:36.000Z | 2022-03-23T11:23:21.000Z | hybridbackend/tensorflow/data/parquet_dataset_v1.py | alibaba/HybridBackend | 498f74038fbc3be4ab1de6a8c3c2ef99f39af5e3 | [
"Apache-2.0"
] | 15 | 2021-12-01T09:15:26.000Z | 2022-03-28T02:49:21.000Z | hybridbackend/tensorflow/data/parquet_dataset_v1.py | alibaba/HybridBackend | 498f74038fbc3be4ab1de6a8c3c2ef99f39af5e3 | [
"Apache-2.0"
] | 8 | 2021-12-02T01:16:14.000Z | 2022-01-28T04:51:16.000Z | # Copyright 2021 Alibaba Group Holding Limited. 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 ... | 33.526316 | 79 | 0.720565 |
3caf400f0fe73470fa0384a4edbc0120e059cb63 | 4,699 | py | Python | Project/KNN_weighted_and_unweighted_7x7.py | TOBEKNOWNABBAS/AI106394 | 51aa967ab63f9cc7fc64f7b9017d23f70bd5cfe7 | [
"MIT"
] | null | null | null | Project/KNN_weighted_and_unweighted_7x7.py | TOBEKNOWNABBAS/AI106394 | 51aa967ab63f9cc7fc64f7b9017d23f70bd5cfe7 | [
"MIT"
] | null | null | null | Project/KNN_weighted_and_unweighted_7x7.py | TOBEKNOWNABBAS/AI106394 | 51aa967ab63f9cc7fc64f7b9017d23f70bd5cfe7 | [
"MIT"
] | null | null | null | import numpy as np
import sklearn as sk
import pandas as pd
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection import train_test_split
from sklearn import svm
from sklearn.svm import SVC
from sklearn import metrics
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors ... | 28.652439 | 86 | 0.679081 |
45ad0787c7446ecafa8fb41d5e424b8af4f2ea15 | 1,647 | py | Python | dcf/compounding.py | sonntagsgesicht/dcf | 538e20ac5d4fe4762ee2762029e83443251dcfd6 | [
"Apache-2.0"
] | 16 | 2019-09-02T17:09:48.000Z | 2021-12-18T21:25:16.000Z | dcf/compounding.py | sonntagsgesicht/dcf | 538e20ac5d4fe4762ee2762029e83443251dcfd6 | [
"Apache-2.0"
] | null | null | null | dcf/compounding.py | sonntagsgesicht/dcf | 538e20ac5d4fe4762ee2762029e83443251dcfd6 | [
"Apache-2.0"
] | 4 | 2020-03-12T22:49:47.000Z | 2021-11-24T13:12:43.000Z | # -*- coding: utf-8 -*-
# dcf
# ---
# A Python library for generating discounted cashflows.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.5, copyright Sunday, 21 November 2021
# Website: https://github.com/sonntagsgesicht/dcf
# License: Apache License 2.0 (see LICENSE fil... | 27.45 | 91 | 0.757134 |
9a750e2c7ebf57902dc990ad92c309c637711bf0 | 719 | py | Python | source/mit_experiments/search_oneproc.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 151 | 2015-01-09T19:25:05.000Z | 2022-01-05T02:05:52.000Z | source/mit_experiments/search_oneproc.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 1 | 2016-08-04T13:12:51.000Z | 2016-08-04T13:12:51.000Z | source/mit_experiments/search_oneproc.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 59 | 2015-02-04T19:13:58.000Z | 2021-07-28T23:36:09.000Z | import os
import base
import config
import mit_job_controller as mjc
class Scheduler:
def evaluate_kernels(self, kernels, X, y):
scored_kernels = []
for i, k in enumerate(kernels):
print 'Evaluating %d of %d...' % (i+1, len(kernels))
sk = mjc.evaluate_kernel(k, X, y)
... | 26.62963 | 73 | 0.649513 |
c3c41db2f56ae8085f3d86ff6647fedca539d403 | 2,578 | py | Python | sleekxmpp/plugins/xep_0257/stanza.py | E-Tahta/sleekxmpp | ed067c9412835c5fe44bf203936262bcec09ced4 | [
"BSD-3-Clause"
] | 499 | 2015-01-04T21:45:16.000Z | 2022-02-14T13:04:08.000Z | sleekxmpp/plugins/xep_0257/stanza.py | numanturle/SleekXMPP | 1aeefd88accf45947c6376e9fac3abae9cbba8aa | [
"BSD-3-Clause"
] | 159 | 2015-01-02T19:09:47.000Z | 2020-02-12T08:29:54.000Z | sleekxmpp/plugins/xep_0257/stanza.py | numanturle/SleekXMPP | 1aeefd88accf45947c6376e9fac3abae9cbba8aa | [
"BSD-3-Clause"
] | 209 | 2015-01-07T16:23:16.000Z | 2022-01-26T13:02:20.000Z | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin
class Certs(ElementBase):
name = 'items'
name... | 29.295455 | 74 | 0.636928 |
82d286a6508db77c3461dac2e61db0a361f28192 | 1,976 | py | Python | create_integ_test_docker_images.py | laurenyu/sagemaker-tensorflow-extensions | 14d15e7a292926a69aa590cad3fd2c9d68bd7df5 | [
"Apache-2.0"
] | 43 | 2018-07-18T20:07:11.000Z | 2022-02-19T20:38:58.000Z | create_integ_test_docker_images.py | laurenyu/sagemaker-tensorflow-extensions | 14d15e7a292926a69aa590cad3fd2c9d68bd7df5 | [
"Apache-2.0"
] | 91 | 2018-07-28T17:55:08.000Z | 2022-02-23T22:09:14.000Z | create_integ_test_docker_images.py | laurenyu/sagemaker-tensorflow-extensions | 14d15e7a292926a69aa590cad3fd2c9d68bd7df5 | [
"Apache-2.0"
] | 53 | 2018-07-18T20:07:15.000Z | 2022-02-07T22:47:06.000Z | from __future__ import absolute_import
import argparse
import base64
import subprocess
import docker
import boto3
import botocore
import glob
import sys
TF_VERSION = "1.15.2"
REGION = "us-west-2"
REPOSITORY_NAME = "sagemaker-tensorflow-extensions-test"
if __name__ == '__main__':
parser = argparse.ArgumentParser(... | 33.491525 | 114 | 0.662955 |
1deed5e79449f94dbe676403b3bb47d724904043 | 4,668 | py | Python | mimic3models/phenotyping/hgru.py | xcgoner/mimic3-benchmarks | bbf4f19824f1ee8fcd32f37297efc17578f9658b | [
"MIT"
] | null | null | null | mimic3models/phenotyping/hgru.py | xcgoner/mimic3-benchmarks | bbf4f19824f1ee8fcd32f37297efc17578f9658b | [
"MIT"
] | null | null | null | mimic3models/phenotyping/hgru.py | xcgoner/mimic3-benchmarks | bbf4f19824f1ee8fcd32f37297efc17578f9658b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from keras import backend as K
from keras.models import Model
from keras.layers import Input, Dense, GRU, Masking, Dropout, Add, Multiply, Concatenate, Lambda
from keras.layers.wrappers import Bidirectional, TimeDistributed
from mimic3models.keras_utils import LastTimestep
from mi... | 37.344 | 138 | 0.558269 |
429b6d2f2862aa7950e1e39e1a228f0ce9e720f4 | 1,247 | py | Python | crypy/pair/indicators.py | asmodehn/crypy | 351af6588f110612d5207a5fbb29d51bfa7c3268 | [
"MIT"
] | 2 | 2019-01-20T14:15:54.000Z | 2019-07-13T17:20:32.000Z | crypy/pair/indicators.py | asmodehn/crypy | 351af6588f110612d5207a5fbb29d51bfa7c3268 | [
"MIT"
] | 12 | 2019-05-07T09:27:34.000Z | 2019-06-04T12:36:41.000Z | crypy/pair/indicators.py | asmodehn/crypy | 351af6588f110612d5207a5fbb29d51bfa7c3268 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
def HA(df, ohlc=None):
"""
Function to compute Heiken Ashi Candles (HA)
Args :
df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns
ohlc: List defining OHLC Column names (default ['Open', 'High', 'Low', 'Clo... | 30.414634 | 103 | 0.542903 |
967c1687b8d7a6108ddb18eed1ca53c1af0a4d63 | 2,271 | py | Python | tests/validation/test_validate.py | gwnoseworthy/pystac | c87f073bacc82ae5dfb125f74cb29774678dad11 | [
"Apache-2.0"
] | null | null | null | tests/validation/test_validate.py | gwnoseworthy/pystac | c87f073bacc82ae5dfb125f74cb29774678dad11 | [
"Apache-2.0"
] | null | null | null | tests/validation/test_validate.py | gwnoseworthy/pystac | c87f073bacc82ae5dfb125f74cb29774678dad11 | [
"Apache-2.0"
] | null | null | null | import json
import unittest
import jsonschema
import pystac
from pystac.serialization.common_properties import merge_common_properties
from pystac.validation import STACValidationError
from tests.utils import TestCases
class ValidateTest(unittest.TestCase):
def test_validate_current_version(self):
catal... | 38.491525 | 97 | 0.548217 |
02240d49fd588b2cf7b5d599ab189270bcc656f3 | 3,192 | py | Python | laundry/inspector.py | aniav/python-laundry | 77b6e70f541a949acba74220c770cfa3fcf70079 | [
"MIT"
] | null | null | null | laundry/inspector.py | aniav/python-laundry | 77b6e70f541a949acba74220c770cfa3fcf70079 | [
"MIT"
] | null | null | null | laundry/inspector.py | aniav/python-laundry | 77b6e70f541a949acba74220c770cfa3fcf70079 | [
"MIT"
] | null | null | null | import os
import time
import numpy
from .comparators import (
jaccard_similarity_ratio, levenshtein_similarity_ratio,
sequence_matcher_similarity_ratio, sorensen_similarity_ratio)
LEVENSHTEIN = "Levenshtein"
SEQUENCE_MATCHER = "SequenceMatcher"
SORENSEN = "Sorensen"
JACCARD = "Jaccard"
COMPARATORS = [LEVENSH... | 35.076923 | 77 | 0.662281 |
5e40cee36eb2e3dbbc38c7b5b5e18aa6317544d4 | 165 | py | Python | ABC/abc101-abc150/abc142/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc101-abc150/abc142/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc101-abc150/abc142/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
from math import ceil
n = int(input())
print(ceil(n / 2) / n)
if __name__ == '__main__':
main()
| 12.692308 | 27 | 0.472727 |
91e542d09632ec105d5b415d07298d6f54441f89 | 1,120 | py | Python | plot-class.py | drewlinsley/draw_classify | 88d348598d4d3eb20b534b88d186c2b1622066a4 | [
"MIT"
] | null | null | null | plot-class.py | drewlinsley/draw_classify | 88d348598d4d3eb20b534b88d186c2b1622066a4 | [
"MIT"
] | null | null | null | plot-class.py | drewlinsley/draw_classify | 88d348598d4d3eb20b534b88d186c2b1622066a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division, print_function
import logging
import argparse
import numpy as np
import pylab
import matplotlib as mpl
import matplotlib.pyplot as plt
import cPickle as pickle
from pandas import DataFrame
from mpl_toolkits.mplot3d import Axes3D
from blocks.main_loop import M... | 21.960784 | 71 | 0.73125 |
4d673057f21756f244da591bf2a0eb748a211387 | 3,979 | py | Python | gdrive_deploy/utilities.py | keni7385/gdrive_deploy | 0df0c3c07783bd3559e02097397bc221928fe369 | [
"MIT"
] | null | null | null | gdrive_deploy/utilities.py | keni7385/gdrive_deploy | 0df0c3c07783bd3559e02097397bc221928fe369 | [
"MIT"
] | 1 | 2021-03-16T13:32:24.000Z | 2021-03-21T07:10:38.000Z | gdrive_deploy/utilities.py | keni7385/gdrive_deploy | 0df0c3c07783bd3559e02097397bc221928fe369 | [
"MIT"
] | null | null | null | from googleapiclient import errors
from googleapiclient.http import MediaFileUpload
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
def get_authenticated(SCOPES, credential_file, service_name='drive',
api_version='v3'):
# The... | 30.607692 | 79 | 0.630058 |
81caf48127cc85352036adfbb0f3aca90f09cac2 | 754 | py | Python | 56_merge_intervals.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | 1 | 2020-07-15T14:16:23.000Z | 2020-07-15T14:16:23.000Z | 56_merge_intervals.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | 56_merge_intervals.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | #
# 56. Merge Intervals
#
# Q: https://leetcode.com/problems/merge-intervals/
# A: https://leetcode.com/problems/merge-intervals/discuss/940348/Kt-Js-Py3-Cpp-Sort-A-%2B-Track-Overlaps-via-Last-End
#
from typing import List
from functools import cmp_to_key
class Solution:
def merge(self, A: List[List[int]]) -> Lis... | 32.782609 | 118 | 0.561008 |
c2b90a85c4a9ec5360fd93beacf62cbfee2e62ac | 478 | py | Python | modules/pmg_qt/syntax/__init__.py | dualword/pymol-open-source | abc307745d7d231af4f77f984ebd64f1b428cef8 | [
"CNRI-Python"
] | 636 | 2018-06-21T20:46:36.000Z | 2022-03-30T13:07:47.000Z | modules/pmg_qt/syntax/__init__.py | dualword/pymol-open-source | abc307745d7d231af4f77f984ebd64f1b428cef8 | [
"CNRI-Python"
] | 218 | 2018-06-25T00:10:59.000Z | 2022-03-23T14:15:48.000Z | modules/pmg_qt/syntax/__init__.py | dualword/pymol-open-source | abc307745d7d231af4f77f984ebd64f1b428cef8 | [
"CNRI-Python"
] | 192 | 2018-06-21T17:33:10.000Z | 2022-03-31T17:53:03.000Z | from pymol.Qt import QtGui
def textformat(color, style=''):
fmt = QtGui.QTextCharFormat()
fmt.setForeground(QtGui.QColor(color))
for word in style.split():
if word == 'bold':
fmt.setFontWeight(QtGui.QFont.Bold)
elif word == 'italic':
fmt.setFontItalic(True)
... | 25.157895 | 53 | 0.587866 |
bf1ac6f5fe55ce52d8e68418ba232ea941a9c57f | 11,278 | py | Python | theano/tensor/tests/test_blas_c.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/tests/test_blas_c.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/tests/test_blas_c.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | import sys
import numpy
from unittest import TestCase
from nose.plugins.skip import SkipTest
import theano
import theano.tensor as tensor
from theano.tensor.blas_c import CGer
from theano.tensor.blas_scipy import ScipyGer
from theano.tensor.blas import Ger
from theano.tensor.blas_c import CGemv
from theano.tensor.b... | 37.344371 | 79 | 0.60321 |
4fc92fe72165dbc7fa17d0298331b24a49eb073c | 552 | py | Python | .history/chapter01/python_05_if_condition_20201128213833.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/chapter01/python_05_if_condition_20201128213833.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/chapter01/python_05_if_condition_20201128213833.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | """[if文について]
もし〜だったら、こうして
"""
# if 条件:
# 実行するブロック
# 条件によって処理を適応したい場合
# 3000kmごとにオイル交換しないといけない
distance = 3403
if distance > 3000:
print('オイル交換時期です')
total = 135241
if total /
# 文字列を比較する/リストを比較する
# if 'abc' == "ABC":
# print('同類です')
# if 'CDE' == 'CDE':
# print('同類です')
# if 'あいうえお' == 'あいうえお':
# ... | 15.333333 | 51 | 0.594203 |
fb59a07d9cb49de1999bfb7904aa25a30ecef2e6 | 2,970 | py | Python | examples/demonstration/tensorflow_asr/augmentations/augments.py | o74589055/tf_asr | 1801a035d15253fd25df4f9541457dd635f6d10d | [
"Apache-2.0"
] | 1 | 2021-03-20T09:21:49.000Z | 2021-03-20T09:21:49.000Z | examples/demonstration/tensorflow_asr/augmentations/augments.py | o74589055/tf_asr | 1801a035d15253fd25df4f9541457dd635f6d10d | [
"Apache-2.0"
] | null | null | null | examples/demonstration/tensorflow_asr/augmentations/augments.py | o74589055/tf_asr | 1801a035d15253fd25df4f9541457dd635f6d10d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huy Le Nguyen (@usimarit)
#
# 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 t... | 34.137931 | 87 | 0.644781 |
ef55012da1ee452a1ec3cc98d7d2170071112d7d | 113,370 | py | Python | octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py | mail2nsrajesh/octavia | 7466016ae982af2a560a94327f9e63a7e7151cc5 | [
"Apache-2.0"
] | 1 | 2019-01-11T06:18:38.000Z | 2019-01-11T06:18:38.000Z | octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py | mail2nsrajesh/octavia | 7466016ae982af2a560a94327f9e63a7e7151cc5 | [
"Apache-2.0"
] | null | null | null | octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py | mail2nsrajesh/octavia | 7466016ae982af2a560a94327f9e63a7e7151cc5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | 48.366041 | 79 | 0.533369 |
d21a5b5730416488262491a4d221b92fe9eadcec | 3,304 | py | Python | test_honeypot_exporter.py | Intrinsec/honeypot_exporter | 8d9109457879e5aa49214e5cf18fa8365a4dac6d | [
"Apache-2.0"
] | 3 | 2020-05-06T21:14:59.000Z | 2021-08-06T12:23:38.000Z | test_honeypot_exporter.py | Intrinsec/honeypot_exporter | 8d9109457879e5aa49214e5cf18fa8365a4dac6d | [
"Apache-2.0"
] | 1 | 2020-06-02T10:27:01.000Z | 2020-09-18T08:43:18.000Z | test_honeypot_exporter.py | Intrinsec/honeypot_exporter | 8d9109457879e5aa49214e5cf18fa8365a4dac6d | [
"Apache-2.0"
] | 1 | 2020-06-02T12:13:59.000Z | 2020-06-02T12:13:59.000Z | import socket
import requests
from scapy.all import send, IP, UDP
HONEYPOT_EXPORTER_URL = "http://honeypot:9733/metrics"
# The ip of the honeypot exporter is fixed in the docker-compose
HONEYPOT_IP = "172.20.0.10"
HONEYPOT_PORT = 4242
# The ip of the test client is fixed in the docker-compose
TEST_CLIENT_IP = "172.... | 36.307692 | 100 | 0.701877 |
46c190d46c22d1e48c6292730e782f11967f82b5 | 1,373 | py | Python | tests/test_histogram.py | janpipek/physt | bf6b05952b7d09bbbdae2b077f0989c392eac13e | [
"MIT"
] | 123 | 2016-04-05T10:29:02.000Z | 2021-12-15T21:18:23.000Z | tests/test_histogram.py | janpipek/physt | bf6b05952b7d09bbbdae2b077f0989c392eac13e | [
"MIT"
] | 70 | 2016-03-25T19:10:49.000Z | 2022-03-09T11:47:08.000Z | tests/test_histogram.py | janpipek/physt | bf6b05952b7d09bbbdae2b077f0989c392eac13e | [
"MIT"
] | 16 | 2016-09-07T14:07:20.000Z | 2020-07-23T16:13:59.000Z | import numpy as np
from physt import h1
class TestNumpyBins:
def test_nbin(self):
arr = np.random.rand(100)
hist = h1(arr, bins=15)
assert hist.bin_count == 15
assert np.isclose(hist.bin_right_edges[-1], arr.max())
assert np.isclose(hist.bin_left_edges[0], arr.min())
... | 32.690476 | 85 | 0.577567 |
73992b06a5f68388ce2cf2d296533683bb5d9c80 | 10,655 | py | Python | pywikibot/tools/djvu.py | PArangSae/pywikibot | caf1401e71a81d11e681a6d6adfdea907aa33b94 | [
"MIT"
] | null | null | null | pywikibot/tools/djvu.py | PArangSae/pywikibot | caf1401e71a81d11e681a6d6adfdea907aa33b94 | [
"MIT"
] | null | null | null | pywikibot/tools/djvu.py | PArangSae/pywikibot | caf1401e71a81d11e681a6d6adfdea907aa33b94 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Wrapper around djvulibre to access djvu files properties and content."""
#
# (C) Pywikibot team, 2015-2020
#
# Distributed under the terms of the MIT license.
#
import os
import re
import subprocess
from collections import Counter
import pywikibot
from pywikibot.tools imp... | 33.090062 | 79 | 0.558893 |
2b5712cab6a1a424b75361bae27a3bf284c67446 | 24,554 | py | Python | tests/invalid_models_tests/test_ordinary_fields.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/invalid_models_tests/test_ordinary_fields.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/invalid_models_tests/test_ordinary_fields.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | import unittest
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.test import SimpleTestCase, TestCase, skipIfDBFeature
from django.test.utils import isolate_apps, override_settings
from django.utils.functional import lazy
from django.utils.timez... | 35.278736 | 105 | 0.532622 |
c73029ecb15a1a29af9d12db5f50a937baeab1eb | 8,085 | py | Python | preprocess.py | sedrickkeh/Hashtag_new | 993edd200e2e0050e06982df2fec30bffaae5577 | [
"MIT"
] | 23 | 2019-05-22T07:13:05.000Z | 2022-02-23T19:53:30.000Z | preprocess.py | sedrickkeh/Hashtag_new | 993edd200e2e0050e06982df2fec30bffaae5577 | [
"MIT"
] | 4 | 2019-10-26T06:19:25.000Z | 2022-01-11T11:21:17.000Z | preprocess.py | sedrickkeh/Hashtag_new | 993edd200e2e0050e06982df2fec30bffaae5577 | [
"MIT"
] | 6 | 2019-06-18T03:44:22.000Z | 2021-11-12T05:40:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import glob
import sys
import torch
import onmt.io
import onmt.opts
from onmt.Utils import get_logger
def check_existing_pt_files(opt):
# We will use glob.glob() to find sharded {train|valid}.[0-9]*.pt
# when training, so check to avoid ... | 37.604651 | 97 | 0.645145 |
08cc2d7c4e5bbf937aa8408bfcb2af28708a87b1 | 9,507 | py | Python | external/cclib/method/volume.py | faribas/RMG-Py | 6149e29b642bf8da9537e2db98f15121f0e040c7 | [
"MIT"
] | 1 | 2017-12-18T18:43:22.000Z | 2017-12-18T18:43:22.000Z | external/cclib/method/volume.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 72 | 2016-06-06T18:18:49.000Z | 2019-11-17T03:21:10.000Z | external/cclib/method/volume.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 3 | 2017-09-22T15:47:37.000Z | 2021-12-30T23:51:47.000Z | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision: 742 $"
import copy
import numpy
try:
from PyQuante.CGBF import CGBF
module_pyq = True
except:
module_pyq = False
try:
from pyvt... | 35.875472 | 126 | 0.574314 |
2725e51de3d9507d11ea772d27ed79eddd16dd0d | 246 | py | Python | tomodachi/__version__.py | the-gw/tomodachi | a1e2efc1abe6f4e2de4a580e58184323660b4299 | [
"MIT"
] | null | null | null | tomodachi/__version__.py | the-gw/tomodachi | a1e2efc1abe6f4e2de4a580e58184323660b4299 | [
"MIT"
] | null | null | null | tomodachi/__version__.py | the-gw/tomodachi | a1e2efc1abe6f4e2de4a580e58184323660b4299 | [
"MIT"
] | null | null | null | __version_info__ = (0, 16, 2)
__version__ = ''.join(['.{}'.format(str(n)) if type(n) is int else str(n) for n in __version_info__]).replace('.', '', 1 if type(__version_info__[0]) is int else 0)
if __name__ == "__main__":
print(__version__)
| 41 | 164 | 0.658537 |
b52bb03a80c867f3049fc0c8f386856f31496e0c | 24,435 | py | Python | tests/python/mkl/test_mkldnn.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | null | null | null | tests/python/mkl/test_mkldnn.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | null | null | null | tests/python/mkl/test_mkldnn.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 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 u... | 37.708333 | 128 | 0.600614 |
a5d38f13190eff72e6f7b2f51158ea34ab1ab6a2 | 156 | py | Python | django_api_client/client/__init__.py | rhenter/django-api-client | c113a94b292ffbc14e2da589dd9fde61f068dd7f | [
"MIT"
] | 15 | 2020-07-25T12:07:14.000Z | 2021-04-27T14:32:05.000Z | django_api_client/client/__init__.py | rhenter/django-api-client | c113a94b292ffbc14e2da589dd9fde61f068dd7f | [
"MIT"
] | null | null | null | django_api_client/client/__init__.py | rhenter/django-api-client | c113a94b292ffbc14e2da589dd9fde61f068dd7f | [
"MIT"
] | 2 | 2021-04-27T14:32:11.000Z | 2021-06-11T19:03:18.000Z | from .base import BaseAPI, BaseEndpoint # noqa
from .client import api_client_factory # noqa
__all__ = ['BaseAPI', 'BaseEndpoint', 'api_client_factory']
| 26 | 59 | 0.762821 |
a2e51304f19bb125193d5f9d2cf33df7f68a0fb6 | 35 | py | Python | zfit_physics/pdf.py | ryuwd/zfit-physics | 595eb68add00ab367aed5885c48eb78d15dbda0e | [
"BSD-3-Clause"
] | null | null | null | zfit_physics/pdf.py | ryuwd/zfit-physics | 595eb68add00ab367aed5885c48eb78d15dbda0e | [
"BSD-3-Clause"
] | null | null | null | zfit_physics/pdf.py | ryuwd/zfit-physics | 595eb68add00ab367aed5885c48eb78d15dbda0e | [
"BSD-3-Clause"
] | null | null | null | from .models.pdf_argus import Argus | 35 | 35 | 0.857143 |
b7b00fd10d483c5fdb2a0e06e6746d57f1a75209 | 2,132 | py | Python | function.py | Tech-with-anmol/auto_file | 0668e3ef594942055daf18b3df205ad228ee1d96 | [
"MIT"
] | 1 | 2021-09-06T08:04:22.000Z | 2021-09-06T08:04:22.000Z | function.py | Tech-with-anmol/auto_file | 0668e3ef594942055daf18b3df205ad228ee1d96 | [
"MIT"
] | null | null | null | function.py | Tech-with-anmol/auto_file | 0668e3ef594942055daf18b3df205ad228ee1d96 | [
"MIT"
] | null | null | null | import os
def __docs__(self):
"""THIS is a libray used for creating all required filrs for making liabrary also for creating normal files"""
pass
def mklib(dict_name):
"""make all folder and files required to make a library"""
os.mkdir(dict_name)
open("ReadMe.md", ... | 52 | 1,094 | 0.663696 |
43d07a527ec51ca872812c7f4cf5fa2926986603 | 3,476 | py | Python | keras_retinanet/utils/coco_eval.py | kukuruza/keras-retinanet | 17aae2cf8906053feaba253fc599a5de3fffc1a1 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/utils/coco_eval.py | kukuruza/keras-retinanet | 17aae2cf8906053feaba253fc599a5de3fffc1a1 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/utils/coco_eval.py | kukuruza/keras-retinanet | 17aae2cf8906053feaba253fc599a5de3fffc1a1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 w... | 33.747573 | 108 | 0.660242 |
1741a32d9b22a995ae51d80dae1327383d8c1373 | 11,478 | py | Python | tests/test_login_and_assignments.py | DataManagementLab/pretix-cas | f80eac4f698257f131404d2dbb11102dfce4d147 | [
"Apache-2.0"
] | null | null | null | tests/test_login_and_assignments.py | DataManagementLab/pretix-cas | f80eac4f698257f131404d2dbb11102dfce4d147 | [
"Apache-2.0"
] | 4 | 2021-04-05T10:48:58.000Z | 2022-02-15T13:11:45.000Z | tests/test_login_and_assignments.py | DataManagementLab/pretix-cas | f80eac4f698257f131404d2dbb11102dfce4d147 | [
"Apache-2.0"
] | null | null | null | import pytest
from django.test import override_settings
from pretix_cas import views, auth_backend
from pretix_cas.models import CasAttributeTeamAssignmentRule
from rest_framework.reverse import reverse
from pretix.base.models import User, Team, Organizer
fake_cas_data = ('ab12abcd',
{'mail': 'john.... | 39.174061 | 127 | 0.725649 |
e24fb8d2375728bec17ae96041a99045f272d625 | 6,106 | py | Python | zoom-poof/poof_control.py | mbustosorg/zoom-poof | 18b85e035d19515e36257ba570ad1c2a8752dceb | [
"MIT"
] | null | null | null | zoom-poof/poof_control.py | mbustosorg/zoom-poof | 18b85e035d19515e36257ba570ad1c2a8752dceb | [
"MIT"
] | null | null | null | zoom-poof/poof_control.py | mbustosorg/zoom-poof | 18b85e035d19515e36257ba570ad1c2a8752dceb | [
"MIT"
] | null | null | null | """
Copyright (C) 2020 Mauricio Bustos (m@bustos.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | 33.549451 | 149 | 0.608418 |
734227f85ae256cfe8a62a6af67d8b5911f75d31 | 6,140 | py | Python | autotest/test_gwf_utl05_budparse.py | verkaik/modflow6-parallel | fac2892612d044634b9527fc7a417530ed43ca8f | [
"CC0-1.0"
] | 2 | 2021-09-07T07:19:12.000Z | 2022-03-31T10:19:41.000Z | autotest/test_gwf_utl05_budparse.py | verkaik/modflow6-parallel | fac2892612d044634b9527fc7a417530ed43ca8f | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_utl05_budparse.py | verkaik/modflow6-parallel | fac2892612d044634b9527fc7a417530ed43ca8f | [
"CC0-1.0"
] | 1 | 2020-03-04T17:10:34.000Z | 2020-03-04T17:10:34.000Z | """
Test of budget table parsing
"""
import os
import numpy as np
try:
import pymake
except:
msg = 'Error. Pymake package is not available.\n'
msg += 'Try installing using the following command:\n'
msg += ' pip install https://github.com/modflowpy/pymake/zipball/master'
raise Exception(msg)
try:... | 31.326531 | 80 | 0.49886 |
020f90feadb2539584de35406cb484ce5a91d681 | 8,154 | py | Python | tf_agents/bandits/networks/global_and_arm_feature_network_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 3,175 | 2017-09-08T18:28:32.000Z | 2022-03-31T01:32:22.000Z | tf_agents/bandits/networks/global_and_arm_feature_network_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 703 | 2017-09-18T05:51:57.000Z | 2022-03-31T17:37:50.000Z | tf_agents/bandits/networks/global_and_arm_feature_network_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 844 | 2017-09-08T23:28:57.000Z | 2022-03-30T09:29:32.000Z | # coding=utf-8
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 38.828571 | 80 | 0.670468 |
da897522841f592d4dcb952bfcba8b152b7cbeb0 | 8,424 | py | Python | keystone/common/cache/_memcache_pool.py | BMDan/keystone | 39de8b0a0a34c1645b607449fc1247d5cc11d89d | [
"Apache-2.0"
] | null | null | null | keystone/common/cache/_memcache_pool.py | BMDan/keystone | 39de8b0a0a34c1645b607449fc1247d5cc11d89d | [
"Apache-2.0"
] | null | null | null | keystone/common/cache/_memcache_pool.py | BMDan/keystone | 39de8b0a0a34c1645b607449fc1247d5cc11d89d | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Mirantis Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 37.945946 | 79 | 0.617877 |
a0e88b50dd3601f4ffabdf4a7befb08e73f62c99 | 46,323 | py | Python | python/test/annotators.py | mehta-sandip/spark-nlp | 13a27cd3d885ec49d2e692a6a1270883c9f97003 | [
"Apache-2.0"
] | 1 | 2020-08-20T00:07:20.000Z | 2020-08-20T00:07:20.000Z | python/test/annotators.py | mehta-sandip/spark-nlp | 13a27cd3d885ec49d2e692a6a1270883c9f97003 | [
"Apache-2.0"
] | null | null | null | python/test/annotators.py | mehta-sandip/spark-nlp | 13a27cd3d885ec49d2e692a6a1270883c9f97003 | [
"Apache-2.0"
] | null | null | null | import re
import unittest
import os
from sparknlp.annotator import *
from sparknlp.base import *
from test.util import SparkContextForTest
from test.util import SparkSessionForTest
from pyspark.ml.feature import SQLTransformer
from pyspark.ml.clustering import KMeans
class BasicAnnotatorsTestSpec(unittest.TestCase):
... | 39.157227 | 396 | 0.595061 |
3a4090cec252d88cf721a4a89a79da3e104fa893 | 22,721 | py | Python | src/tiden/sshpool.py | gridgain/tiden | 53a465a3b8b58fe8f26c36c8988b9ced0dbe83ec | [
"Apache-2.0"
] | 14 | 2020-06-05T09:30:42.000Z | 2022-01-19T00:26:48.000Z | src/tiden/sshpool.py | gridgain/tiden | 53a465a3b8b58fe8f26c36c8988b9ced0dbe83ec | [
"Apache-2.0"
] | 6 | 2020-06-09T14:05:21.000Z | 2021-03-18T13:55:15.000Z | src/tiden/sshpool.py | gridgain/tiden | 53a465a3b8b58fe8f26c36c8988b9ced0dbe83ec | [
"Apache-2.0"
] | 1 | 2020-06-09T13:53:15.000Z | 2020-06-09T13:53:15.000Z | #!/usr/bin/env python3
#
# Copyright 2017-2020 GridGain Systems.
#
# 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 applicab... | 42.232342 | 120 | 0.511729 |
1e0621e63f06dfd68447a955e838ec1503195324 | 2,283 | py | Python | src/.history/Socket_Control/Hiwin_RT605_Socket_TCPcmd_20190711103103.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Socket_Control/Hiwin_RT605_Socket_TCPcmd_20190711103103.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Socket_Control/Hiwin_RT605_Socket_TCPcmd_20190711103103.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# license removed for brevity
import Hiwin_RT605_Socket_Taskcmd as Taskcmd
class switch(object):
def __init__(self, value):
self.value = value
self.fall = False
def __iter__(self):
"""Return the match method once, then stop"""
yield self.match
rais... | 27.841463 | 62 | 0.546649 |
b3a4ae6a458a4e628fbbfc140bc7097f85f5c108 | 8,222 | py | Python | python/istio_api/mcp/v1alpha1/metadata_pb2.py | istio-testing/api | 0d1db548cf57ed2184cd0c35888e8b207564903b | [
"Apache-2.0"
] | null | null | null | python/istio_api/mcp/v1alpha1/metadata_pb2.py | istio-testing/api | 0d1db548cf57ed2184cd0c35888e8b207564903b | [
"Apache-2.0"
] | null | null | null | python/istio_api/mcp/v1alpha1/metadata_pb2.py | istio-testing/api | 0d1db548cf57ed2184cd0c35888e8b207564903b | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mcp/v1alpha1/metadata.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | 41.11 | 816 | 0.757358 |
2dcc618f01f3c9c7e54df2869cf18af5a9913b36 | 7,653 | py | Python | sentenai/stream/events.py | sentenai/py-sentenai | fec672ae1ac195523067d8f882cfe3419ab4c042 | [
"BSD-3-Clause"
] | 1 | 2018-01-09T18:49:06.000Z | 2018-01-09T18:49:06.000Z | sentenai/stream/events.py | sentenai/py-sentenai | fec672ae1ac195523067d8f882cfe3419ab4c042 | [
"BSD-3-Clause"
] | 168 | 2017-03-15T20:24:52.000Z | 2022-03-15T14:41:26.000Z | sentenai/stream/events.py | sentenai/py-sentenai | fec672ae1ac195523067d8f882cfe3419ab4c042 | [
"BSD-3-Clause"
] | 4 | 2017-07-22T04:03:08.000Z | 2017-12-22T00:21:21.000Z | import math
from copy import copy
from datetime import datetime, timedelta
import numpy as np
from sentenai.api import API, dt64, td64, iso8601
import collections
def flatten(d, parent_key='', sep='_'):
items = []
for k, v in d.items():
new_key = parent_key + sep + k if parent_key else k
if is... | 33.565789 | 110 | 0.516921 |
427a7e10f7429a3de0bc85a779d3e69bb978b20e | 104 | py | Python | backend/Django/logproplogsite/logproplogapp/admin.py | emg/proplog | 6728bf2c143f204bb4dfa403c97df36d12c91891 | [
"MIT"
] | null | null | null | backend/Django/logproplogsite/logproplogapp/admin.py | emg/proplog | 6728bf2c143f204bb4dfa403c97df36d12c91891 | [
"MIT"
] | null | null | null | backend/Django/logproplogsite/logproplogapp/admin.py | emg/proplog | 6728bf2c143f204bb4dfa403c97df36d12c91891 | [
"MIT"
] | null | null | null | from django.contrib import admin
from logproplogapp import models
admin.site.register(models.Answer)
| 14.857143 | 34 | 0.826923 |
4228f74af0a26c33592b359d93f78052b2618241 | 435 | py | Python | old_and_simple_and_deprecated/M-UZ_and_M-PROJ.py | mcjczapiewski/work | 2540afa6b18bf6ff92a7c07b16695035785c0dd8 | [
"MIT"
] | null | null | null | old_and_simple_and_deprecated/M-UZ_and_M-PROJ.py | mcjczapiewski/work | 2540afa6b18bf6ff92a7c07b16695035785c0dd8 | [
"MIT"
] | null | null | null | old_and_simple_and_deprecated/M-UZ_and_M-PROJ.py | mcjczapiewski/work | 2540afa6b18bf6ff92a7c07b16695035785c0dd8 | [
"MIT"
] | null | null | null | import os
for subdir, dirs, files in os.walk(r"D:\_MACIEK_\python_proby\seba"):
dirs.sort()
if "merge" in os.listdir(subdir):
if any("M-UZ" in fname for fname in os.listdir(subdir)) and (
any("M-PROJ" in fname for fname in os.listdir(subdir))
or any("M-WPROJ" in fname for fname ... | 36.25 | 70 | 0.590805 |
105c2215acc8c58ec84e6b31e512ab3a118efc48 | 9,293 | py | Python | demos/OptimalPlanning.py | jmainpri/ompl | 6f7445180aa787806055ded249c96e1266ee9a99 | [
"BSD-3-Clause"
] | 2 | 2018-08-10T18:11:35.000Z | 2021-04-06T00:33:13.000Z | demos/OptimalPlanning.py | jmainpri/ompl | 6f7445180aa787806055ded249c96e1266ee9a99 | [
"BSD-3-Clause"
] | null | null | null | demos/OptimalPlanning.py | jmainpri/ompl | 6f7445180aa787806055ded249c96e1266ee9a99 | [
"BSD-3-Clause"
] | 1 | 2018-08-10T18:11:36.000Z | 2018-08-10T18:11:36.000Z | #!/usr/bin/env python
######################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2010, Rice University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... | 38.882845 | 83 | 0.717637 |
f9f8bf014882ae3e8a8d7f630ebed6c1d0978880 | 3,550 | py | Python | admin/desk/views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | admin/desk/views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | admin/desk/views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.views.generic import ListView, DetailView
from django.contrib.auth.mixins import PermissionRequiredMixin
from osf.models.user import OSFUser
from admin.desk.utils import DeskClient, DeskError, DeskCustomerNotFound
class DeskCaseList(PermissionRequiredMixin, ListView):... | 39.444444 | 118 | 0.574366 |
cde8c080a02c6726af83f2095f552e89c4762d27 | 2,629 | py | Python | assignments/10_exception_handling/10-4_monthly_sales/commands.py | MrDDaye/cna_cp1855 | 5b83f5877d373e9499e379ba93b04c394c13db5f | [
"MIT"
] | null | null | null | assignments/10_exception_handling/10-4_monthly_sales/commands.py | MrDDaye/cna_cp1855 | 5b83f5877d373e9499e379ba93b04c394c13db5f | [
"MIT"
] | null | null | null | assignments/10_exception_handling/10-4_monthly_sales/commands.py | MrDDaye/cna_cp1855 | 5b83f5877d373e9499e379ba93b04c394c13db5f | [
"MIT"
] | null | null | null | """Monthly sales program command functions."""
from sys import exit
from csv import reader, writer
def read_sales_file(file: str) -> None:
"""Read the monthly sales file from configuration."""
try:
with open(file, encoding='utf-8') as monthly_sales_file:
csv = reader(monthly_sales... | 38.661765 | 78 | 0.627235 |
2137a8f131ba9131c811a82159f90ea8f807edc5 | 1,826 | py | Python | multiview/coherence.py | zhongerqiandan/OpenDialog | f478b2a912c8c742da5ced510ac40da59217ddb3 | [
"MIT"
] | 98 | 2020-07-16T06:27:29.000Z | 2022-03-12T15:21:51.000Z | multiview/coherence.py | zhongerqiandan/OpenDialog | f478b2a912c8c742da5ced510ac40da59217ddb3 | [
"MIT"
] | 2 | 2020-07-22T12:00:17.000Z | 2021-02-24T01:19:14.000Z | multiview/coherence.py | gmftbyGMFTBY/OpenDialog | 8eb56b7a21cea1172131db7a56d2656364144771 | [
"MIT"
] | 19 | 2020-07-16T08:36:09.000Z | 2021-09-14T05:36:54.000Z | from .header import *
'''
COHERENCE(BERT-RUBER) 指标本质上就是一个检索模型
TODO:
1. 直接加载BERT检索模型作为BERT-RUBER
2. 使用NLI迁移后训练的BERT检索模型
3. 人工相似度评价,之后如果结果理想,可以直接使用BERT-RUBER做后期迭代的依据
'''
class COHERENCE(RetrievalBaseAgent):
'''
do not train it, just inference for scoring
'''
def __init__(self):
sup... | 32.035088 | 88 | 0.610624 |
d8cb571021b775ef52011d4f7a01b45a2e69a2a9 | 3,461 | py | Python | sidhulabs/elastic/documents.py | sidhulabs/sidhulabs-py | f3b6cc6dbd12dce3179bf8b129cfc002bc366d83 | [
"Apache-2.0"
] | null | null | null | sidhulabs/elastic/documents.py | sidhulabs/sidhulabs-py | f3b6cc6dbd12dce3179bf8b129cfc002bc366d83 | [
"Apache-2.0"
] | null | null | null | sidhulabs/elastic/documents.py | sidhulabs/sidhulabs-py | f3b6cc6dbd12dce3179bf8b129cfc002bc366d83 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from collections import deque
from typing import Any, Dict, Iterable, List
from elasticsearch import Elasticsearch
from elasticsearch.helpers import parallel_bulk, scan
def get_all(es_client: Elasticsearch, index: str, **kwargs) -> Iterable[Dict[str, Any]]:
"""
Get all doc... | 31.18018 | 111 | 0.6423 |
8fe6a7e3806b3106b3876702bcf495323f32ce40 | 2,566 | py | Python | docker_registry/lib/xtarfile.py | mfojtik/openshift-docker-registry | dea0fbe1ab3b279d98bc3c5fcfdafa14976287a3 | [
"Apache-2.0"
] | 2 | 2015-01-20T09:47:15.000Z | 2015-11-05T23:51:51.000Z | docker_registry/lib/xtarfile.py | mfojtik/openshift-docker-registry | dea0fbe1ab3b279d98bc3c5fcfdafa14976287a3 | [
"Apache-2.0"
] | null | null | null | docker_registry/lib/xtarfile.py | mfojtik/openshift-docker-registry | dea0fbe1ab3b279d98bc3c5fcfdafa14976287a3 | [
"Apache-2.0"
] | null | null | null | '''
This is __proc_pax from ./Lib/tarfile.py from v2.7.6
catching raw (non-utf8) bytes to support some xattr headers in tar archives
This is for the use-case of reading the tar archive, not for the use case of
interacting with inodes on the filesystem that have xattr's.
-- vbatts
'''
import re
import tarfile
def _... | 31.292683 | 79 | 0.630553 |
0ac383bd385f6d293af5aa11dd72965ba9a21a64 | 9,087 | py | Python | var/spack/repos/builtin/packages/slepc/package.py | NeuralEnsemble/spack | bed3a694985466544aa16a19af0f0a13221b51a9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/slepc/package.py | NeuralEnsemble/spack | bed3a694985466544aa16a19af0f0a13221b51a9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/slepc/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
class Slepc(Package, CudaPackage, ROCmPackage):
"""Scalable Library for Ei... | 49.655738 | 113 | 0.659514 |
2a2af6acec5efe3260d2341fc03ce4ce20d8b2e1 | 32,050 | py | Python | Lib/yp_test/test_iter.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/yp_test/test_iter.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/yp_test/test_iter.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | # Test iterators.
from yp import *
from yp_test import yp_unittest
from yp_test.support import run_unittest, TESTFN, unlink, cpython_only
import pickle
import collections.abc
# Extra assurance that we're not accidentally testing Python's data types
def iter( *args, **kwargs ): raise NotImplementedError( "convert scri... | 33.246888 | 100 | 0.524524 |
812c306a62dcb79d83ae7d59ec1c15b6336e7815 | 7,969 | py | Python | scripts/collect.py | andreafioraldi/FuzzSplore | a8023b1f59f438ff3eb98da37b93d90b2a218159 | [
"Apache-2.0"
] | 32 | 2020-09-14T09:56:36.000Z | 2022-01-18T20:26:04.000Z | scripts/collect.py | andreafioraldi/FuzzSplore | a8023b1f59f438ff3eb98da37b93d90b2a218159 | [
"Apache-2.0"
] | null | null | null | scripts/collect.py | andreafioraldi/FuzzSplore | a8023b1f59f438ff3eb98da37b93d90b2a218159 | [
"Apache-2.0"
] | 7 | 2020-09-15T06:59:56.000Z | 2021-07-23T23:41:16.000Z | #!/usr/bin/python3
import subprocess
import argparse
import json
import sys
import os
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
DESCR=''''''
script_dir = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
opt = argparse.ArgumentParser(description=DESCR, fo... | 30.30038 | 146 | 0.590789 |
e2f9697692bd710f035e2b06a55f6415541f09bf | 1,130 | py | Python | easing.py | longhaoteng/captcha-crack | 34a5ddead6551ba8f24ee941872310def74a487a | [
"Apache-2.0"
] | null | null | null | easing.py | longhaoteng/captcha-crack | 34a5ddead6551ba8f24ee941872310def74a487a | [
"Apache-2.0"
] | null | null | null | easing.py | longhaoteng/captcha-crack | 34a5ddead6551ba8f24ee941872310def74a487a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'mr.long'
import math
class Easing(object):
"""
Easing functions
"""
PI = math.pi
c1 = 1.70158
c2 = c1 * 1.525
c3 = c1 + 1
c4 = (2 * PI) / 3
c5 = (2 * PI) / 4.5
def ease_out_sine(x):
return math.sin(x * Easing.PI /... | 16.142857 | 68 | 0.490265 |
cce880c22fc7016d511abff1ed9b4c74e3665116 | 38,557 | py | Python | cinder/tests/unit/objects/test_base.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/objects/test_base.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/objects/test_base.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 43.176932 | 79 | 0.629613 |
8b66632e30ab623529c9398c0b7a6277d01d8a43 | 52,058 | py | Python | python/ccxt/cex.py | dougvanzee/ccxt | ed06a2d180e02d1006f33be6ba65407ecb0a831b | [
"MIT"
] | 2 | 2021-05-27T03:58:42.000Z | 2022-02-21T03:24:08.000Z | python/ccxt/cex.py | dougvanzee/ccxt | ed06a2d180e02d1006f33be6ba65407ecb0a831b | [
"MIT"
] | null | null | null | python/ccxt/cex.py | dougvanzee/ccxt | ed06a2d180e02d1006f33be6ba65407ecb0a831b | [
"MIT"
] | 1 | 2022-01-11T07:39:19.000Z | 2022-01-11T07:39:19.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 40.449106 | 461 | 0.424719 |
cff3ef3ad81e8dd92a99bb4ffbd1d3069799ad35 | 4,458 | py | Python | api_utils.py | fastent/fastent | ce49b250e7c5b2c475b981307f11a0595fc96a89 | [
"MIT"
] | 8 | 2018-04-16T09:12:59.000Z | 2020-12-08T12:35:56.000Z | api_utils.py | fastent/fastent | ce49b250e7c5b2c475b981307f11a0595fc96a89 | [
"MIT"
] | 10 | 2018-01-23T16:03:51.000Z | 2021-03-31T18:35:22.000Z | api_utils.py | fastent/fastent | ce49b250e7c5b2c475b981307f11a0595fc96a89 | [
"MIT"
] | 3 | 2018-06-26T18:19:38.000Z | 2021-08-09T14:16:45.000Z | import subprocess
import sys
import argparse
import requests
import shutil
import lxml.html as LH
import pandas as pd
import urllib.request
from .fast_utils import exact_word_match
class DownloadError(Exception):
def __init__(self, output):
self.output = output
def spacy_model_download(model_name, timeou... | 31.174825 | 133 | 0.614177 |
3669666af0d8011cb6caa4f388cfa37c0bd8a35c | 7,588 | py | Python | tests/conftest.py | 722C/django-prices-taxjar | b9d586fda740fe1539620a1950f565987d7597df | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | 722C/django-prices-taxjar | b9d586fda740fe1539620a1950f565987d7597df | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | 722C/django-prices-taxjar | b9d586fda740fe1539620a1950f565987d7597df | [
"BSD-3-Clause"
] | null | null | null | import os
import django
import pytest
def pytest_configure():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
django.setup()
@pytest.fixture
def json_error():
data = {'success': False, 'error': {'info': 'Invalid json'}}
return data
@pytest.fixture
def json_success():
data = ... | 32.152542 | 155 | 0.418687 |
3da19c1b66db9ba1cf5db7075cb9b8558f665d75 | 8,810 | py | Python | Projects/DeepLearningTechniques/ShakeNet/imagenet/model.py | Tim232/Python-Things | 05f0f373a4cf298e70d9668c88a6e3a9d1cd8146 | [
"MIT"
] | 2 | 2020-12-05T07:42:55.000Z | 2021-01-06T23:23:18.000Z | Projects/DeepLearningTechniques/ShakeNet/imagenet/model.py | Tim232/Python-Things | 05f0f373a4cf298e70d9668c88a6e3a9d1cd8146 | [
"MIT"
] | null | null | null | Projects/DeepLearningTechniques/ShakeNet/imagenet/model.py | Tim232/Python-Things | 05f0f373a4cf298e70d9668c88a6e3a9d1cd8146 | [
"MIT"
] | null | null | null | import tensorflow.contrib.slim as slim
from Projects.DeepLearningTechniques.ShakeNet.imagenet.constants import *
class Model:
def __init__(self, sess, width, height, channel, lr, dr, is_training, is_tb_logging, name):
self.sess = sess
self.width = width
self.height = height
self.c... | 57.960526 | 150 | 0.629625 |
aadbd65d31ec111b41b3d4bcc38481ac8eacdfa1 | 1,837 | py | Python | config_original_milestone_optimizer_distiller.py | xijiali/BDBNet | e176be588652b1b4951d6f1eec6c434bae6a723b | [
"MIT"
] | null | null | null | config_original_milestone_optimizer_distiller.py | xijiali/BDBNet | e176be588652b1b4951d6f1eec6c434bae6a723b | [
"MIT"
] | null | null | null | config_original_milestone_optimizer_distiller.py | xijiali/BDBNet | e176be588652b1b4951d6f1eec6c434bae6a723b | [
"MIT"
] | null | null | null | # encoding: utf-8
import warnings
import numpy as np
class DefaultConfig(object):
# Seed
seed = 0
# dataset options
dataset = 'market1501'
datatype = 'person'
mode = 'retrieval'
# optimization options
loss = 'triplet'
optim = 'adam'
max_epoch = 400
train_batch = 128
te... | 25.873239 | 92 | 0.569951 |
f198e95b4347e403bcd37de17191d298bd59d0e6 | 28,362 | py | Python | cms/cms_toolbars.py | netzkolchose/django-cms | 0ab064b802b2463fbe5394fc3891b63dc7226033 | [
"BSD-3-Clause"
] | null | null | null | cms/cms_toolbars.py | netzkolchose/django-cms | 0ab064b802b2463fbe5394fc3891b63dc7226033 | [
"BSD-3-Clause"
] | null | null | null | cms/cms_toolbars.py | netzkolchose/django-cms | 0ab064b802b2463fbe5394fc3891b63dc7226033 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from classytags.utils import flatten_context
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.cor... | 45.893204 | 139 | 0.647028 |
3ad65b492cd1c1f3d6bc6452fada7def7ebcb975 | 2,902 | py | Python | loan/helpers.py | Casper-Smet/LOAN | 3aabf80cf4314bcba33779329fc6e4971b85e742 | [
"MIT"
] | null | null | null | loan/helpers.py | Casper-Smet/LOAN | 3aabf80cf4314bcba33779329fc6e4971b85e742 | [
"MIT"
] | null | null | null | loan/helpers.py | Casper-Smet/LOAN | 3aabf80cf4314bcba33779329fc6e4971b85e742 | [
"MIT"
] | null | null | null | import json
import operator
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
def graph_from_json(fp: Path, against_weight: int = 6, with_weight: int = 2, name: str = "HumanBody"):
"""Loads a graph from given filepath.
Each row in `network` represents an edge ... | 36.734177 | 131 | 0.65162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.