hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
97bb7d784b580d82fb2ab37aadcf96974784eb02 | 96 | py | Python | WeatherPy/api_keys.py | millerbrook/python-api-challenge | 6a2935ab79cea34bcfc67ce76c184ab775fddd5d | [
"MIT"
] | null | null | null | WeatherPy/api_keys.py | millerbrook/python-api-challenge | 6a2935ab79cea34bcfc67ce76c184ab775fddd5d | [
"MIT"
] | null | null | null | WeatherPy/api_keys.py | millerbrook/python-api-challenge | 6a2935ab79cea34bcfc67ce76c184ab775fddd5d | [
"MIT"
] | null | null | null | #Google Key
g_key = "YOUR KEY HERE"
# OpenWeatherMap API Key
weather_api_key = "YOUR KEY HERE"
| 16 | 33 | 0.739583 |
888fcc1d8c83ebc62a7466d9a42df6b93d2c0f21 | 424 | py | Python | src/huggingface_hub/snapshot_download.py | merveenoyan/huggingface_hub | 550acb61bf0206f532e0cea7fb47bee0654fee68 | [
"Apache-2.0"
] | null | null | null | src/huggingface_hub/snapshot_download.py | merveenoyan/huggingface_hub | 550acb61bf0206f532e0cea7fb47bee0654fee68 | [
"Apache-2.0"
] | null | null | null | src/huggingface_hub/snapshot_download.py | merveenoyan/huggingface_hub | 550acb61bf0206f532e0cea7fb47bee0654fee68 | [
"Apache-2.0"
] | null | null | null | # TODO: remove in 0.11
import warnings
warnings.warn(
"snapshot_download.py has been made private and will no longer be available from"
" version 0.11. Please use `from huggingface_hub import snapshot_download` to"
" import the only public function in this module. Other members of the file may be"
" ... | 28.266667 | 87 | 0.738208 |
f016662417818018a3328764cd6914cd6a5d6106 | 450 | py | Python | experiments/scripts/tune_hyper.py | chrislybaer/huggingmolecules | 210239ac46b467e900a47e8f4520054636744ca6 | [
"Apache-2.0"
] | 60 | 2021-05-07T16:07:26.000Z | 2022-03-26T19:23:54.000Z | experiments/scripts/tune_hyper.py | gabegomes/huggingmolecules | adc581c97fbc21d9967dd9334afa94b22fb77651 | [
"Apache-2.0"
] | 11 | 2021-05-07T16:01:35.000Z | 2022-03-09T13:06:05.000Z | experiments/scripts/tune_hyper.py | gabegomes/huggingmolecules | adc581c97fbc21d9967dd9334afa94b22fb77651 | [
"Apache-2.0"
] | 12 | 2021-05-20T08:02:25.000Z | 2022-03-10T14:11:36.000Z | """
tune_hyper.py: this script performs hyper-parameters tuning with the optuna package.
For details see main README.md.
"""
if __name__ == "__main__":
from experiments.src import tune_hyper
from experiments.src.gin import parse_gin_config_files_and_bindings
# Bind values to functions/methods parameters b... | 32.142857 | 103 | 0.782222 |
2a6932397378c0bfc1556fec231cf6bb5d0d8568 | 7,023 | py | Python | lib/datasets/voc_eval.py | Stephanessy/FSOD-code | 08fa534c21c92f59af35740cadfbadd43297a834 | [
"MIT"
] | 233 | 2020-05-13T15:13:17.000Z | 2022-03-24T04:09:11.000Z | lib/datasets/voc_eval.py | xiaodongdreams/FSOD-code | dd8e099ef99833a7c84a487a97ba9d45efda24a0 | [
"MIT"
] | 66 | 2020-05-19T05:26:45.000Z | 2021-11-04T02:14:26.000Z | lib/datasets/voc_eval.py | xiaodongdreams/FSOD-code | dd8e099ef99833a7c84a487a97ba9d45efda24a0 | [
"MIT"
] | 62 | 2020-05-14T08:24:52.000Z | 2022-03-09T08:35:11.000Z | # Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 35.469697 | 85 | 0.538516 |
25213a0218b858247efc3416bdc6b7391728faa2 | 2,933 | py | Python | tests/test_public_api.py | coolalexzb/pyhf | e8ad7382bd408502807ad87a3fdf56396fbd1df9 | [
"Apache-2.0"
] | null | null | null | tests/test_public_api.py | coolalexzb/pyhf | e8ad7382bd408502807ad87a3fdf56396fbd1df9 | [
"Apache-2.0"
] | null | null | null | tests/test_public_api.py | coolalexzb/pyhf | e8ad7382bd408502807ad87a3fdf56396fbd1df9 | [
"Apache-2.0"
] | null | null | null | import pytest
import pyhf
import numpy as np
@pytest.fixture(scope='function')
def model_setup(backend):
np.random.seed(0)
n_bins = 100
model = pyhf.simplemodels.hepdata_like([10] * n_bins, [50] * n_bins, [1] * n_bins)
init_pars = model.config.suggested_init()
observations = np.random.randint(50, ... | 27.933333 | 87 | 0.660075 |
f3009bdc8845892cef16df9f81e527cb3b238bb3 | 24,200 | py | Python | scipy/optimize/linesearch.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 39 | 2016-11-08T11:24:30.000Z | 2021-11-18T06:50:21.000Z | scipy/optimize/linesearch.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 1 | 2017-01-12T09:51:20.000Z | 2017-03-09T23:19:57.000Z | scipy/optimize/linesearch.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 13 | 2017-04-08T08:03:12.000Z | 2021-08-25T08:38:52.000Z | """
Functions
---------
.. autosummary::
:toctree: generated/
line_search_armijo
line_search_wolfe1
line_search_wolfe2
scalar_search_wolfe1
scalar_search_wolfe2
"""
from __future__ import division, print_function, absolute_import
from warnings import warn
from scipy.optimize import minpack2
i... | 29.086538 | 81 | 0.539876 |
8e9e2cc660118aa31ddd15fca5b789224e030eb8 | 510 | py | Python | backend/onlineBenevolent/api.py | abodacs/django-fullstack-biolerplate | 87e8618638eb801fd061c34da9365ff50bebdf77 | [
"MIT"
] | null | null | null | backend/onlineBenevolent/api.py | abodacs/django-fullstack-biolerplate | 87e8618638eb801fd061c34da9365ff50bebdf77 | [
"MIT"
] | null | null | null | backend/onlineBenevolent/api.py | abodacs/django-fullstack-biolerplate | 87e8618638eb801fd061c34da9365ff50bebdf77 | [
"MIT"
] | null | null | null | from apps.delivery.views import ConfirmationViewSet, PatchViewSet
from apps.projects.views import CaseViewSet
from apps.users.views import UserViewSet
from rest_framework import routers
# Settings
api = routers.DefaultRouter()
api.trailing_slash = "/?"
# Users API
api.register(r"users", UserViewSet)
# Case API
api.... | 23.181818 | 67 | 0.786275 |
56461339f339182eb7c35d65dbafc44f70340ba9 | 1,907 | py | Python | docs/conf.py | dgalus/sas32kd | a8e92aca6f6b70ffeee252a5e3218ec5206ecb0f | [
"MIT"
] | null | null | null | docs/conf.py | dgalus/sas32kd | a8e92aca6f6b70ffeee252a5e3218ec5206ecb0f | [
"MIT"
] | null | null | null | docs/conf.py | dgalus/sas32kd | a8e92aca6f6b70ffeee252a5e3218ec5206ecb0f | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.672727 | 79 | 0.660199 |
4e004ef8a0905807c2a19fd86f9f7958876e3a36 | 2,119 | py | Python | GoberApi/controllers.py | lijemutu/NameOrigin | 6fb669d9d124125c3621064c3b7b9aa6b2abab4e | [
"Apache-2.0"
] | null | null | null | GoberApi/controllers.py | lijemutu/NameOrigin | 6fb669d9d124125c3621064c3b7b9aa6b2abab4e | [
"Apache-2.0"
] | null | null | null | GoberApi/controllers.py | lijemutu/NameOrigin | 6fb669d9d124125c3621064c3b7b9aa6b2abab4e | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint
from typing import Dict
from NameApi.controllers import NameNationalityInternal
from .models import GobernadoresMexicoModel
from .models import EstadosMexicoModel
from .scraper import RequestGoberInfo
from .scraper import ParserGoberInfo
from .scraper import SaveGoberInfo
GoberApi_blueprin... | 35.915254 | 87 | 0.719679 |
c74cdbd4031bc67c580c5b1e7c53912141520c55 | 29,780 | py | Python | core/storage/question/gae_models.py | jlau323/oppia | 37438a2c9bf7e66892fb9a6a93a1fe4ca7a82691 | [
"Apache-2.0"
] | 2 | 2021-04-08T01:06:08.000Z | 2021-06-02T08:20:13.000Z | core/storage/question/gae_models.py | jlau323/oppia | 37438a2c9bf7e66892fb9a6a93a1fe4ca7a82691 | [
"Apache-2.0"
] | null | null | null | core/storage/question/gae_models.py | jlau323/oppia | 37438a2c9bf7e66892fb9a6a93a1fe4ca7a82691 | [
"Apache-2.0"
] | 1 | 2020-12-11T06:56:31.000Z | 2020-12-11T06:56:31.000Z | # Copyright 2017 The Oppia 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 ... | 40.85048 | 80 | 0.647683 |
a6f6fe1b8fff9320bb4b527e9e4009b059630f0d | 10,921 | py | Python | VolumeToModel/VolumeToModel.py | arpinerap/SlicerMorph | dfaac4405885188f5dc73e17ce2d2e16d321d742 | [
"BSD-2-Clause"
] | 28 | 2019-05-09T22:07:06.000Z | 2022-03-03T22:33:32.000Z | VolumeToModel/VolumeToModel.py | arpinerap/SlicerMorph | dfaac4405885188f5dc73e17ce2d2e16d321d742 | [
"BSD-2-Clause"
] | 110 | 2019-09-04T12:53:26.000Z | 2022-03-31T21:19:12.000Z | VolumeToModel/VolumeToModel.py | arpinerap/SlicerMorph | dfaac4405885188f5dc73e17ce2d2e16d321d742 | [
"BSD-2-Clause"
] | 33 | 2019-03-28T15:38:44.000Z | 2022-03-08T13:15:39.000Z | import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import fnmatch
import numpy as np
import random
import math
#
# VolumeToModel
#
class VolumeToModel(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.c... | 41.367424 | 256 | 0.740592 |
80330bb7cbcfd18381b99f44c1398074ab3976fc | 1,400 | py | Python | quiz/bot/storage/storage.py | shubham-king/guess-the-melody | 1658a17f41b39cfd212175a03e043b3be7bc0e56 | [
"MIT"
] | 4 | 2019-06-15T15:32:43.000Z | 2020-02-21T09:45:36.000Z | quiz/bot/storage/storage.py | shubham-king/guess-the-melody | 1658a17f41b39cfd212175a03e043b3be7bc0e56 | [
"MIT"
] | 4 | 2020-07-05T07:20:26.000Z | 2021-04-25T21:05:53.000Z | quiz/bot/storage/storage.py | shubham-king/guess-the-melody | 1658a17f41b39cfd212175a03e043b3be7bc0e56 | [
"MIT"
] | 7 | 2020-06-13T20:11:41.000Z | 2021-11-09T07:47:02.000Z | from abc import ABC, abstractmethod
from typing import List, Tuple, Type, Any
from quiz.config import Config
from quiz.bot.storage.connection import Conn, DBConn
from quiz.bot.storage.pointer import Pointer, DBPointer
from quiz.bot.storage.table import Table, DBTable
class Storage(ABC):
"""Abstract interface for ... | 28 | 116 | 0.653571 |
705d46ffa29a6a0c82e19c9dea458072387c7ece | 3,097 | py | Python | app/models.py | Eddie956/ShipBlog | 7feb3d7d4b0d9d26ab3c22c90dbe26f00e482823 | [
"CNRI-Python"
] | null | null | null | app/models.py | Eddie956/ShipBlog | 7feb3d7d4b0d9d26ab3c22c90dbe26f00e482823 | [
"CNRI-Python"
] | null | null | null | app/models.py | Eddie956/ShipBlog | 7feb3d7d4b0d9d26ab3c22c90dbe26f00e482823 | [
"CNRI-Python"
] | null | null | null | from flask_login import UserMixin, current_user, login_manager
from werkzeug.security import generate_password_hash, check_password_hash
from . import login_manager
from datetime import datetime
from . import db, admin
from flask_admin.contrib.sqla import ModelView
@login_manager.user_loader
def load_user(user_id):
... | 26.02521 | 76 | 0.690023 |
8280a16d0837282f1684e19bcdce83d484706d0a | 1,164 | py | Python | signalprocess/data_parser_C.py | eayumba/pytorch-CycleGAN-and-pix2pix | 7217e9467556e71111b1497589e739d88c53802a | [
"BSD-3-Clause"
] | 1 | 2021-06-02T09:53:06.000Z | 2021-06-02T09:53:06.000Z | signalprocess/data_parser_C.py | eayumba/pytorch-CycleGAN-and-pix2pix | 7217e9467556e71111b1497589e739d88c53802a | [
"BSD-3-Clause"
] | null | null | null | signalprocess/data_parser_C.py | eayumba/pytorch-CycleGAN-and-pix2pix | 7217e9467556e71111b1497589e739d88c53802a | [
"BSD-3-Clause"
] | 1 | 2021-06-02T10:01:18.000Z | 2021-06-02T10:01:18.000Z | import os
from pydub import AudioSegment
from pydub.utils import make_chunks
CHUNK_LENGTH = 4 * 1000 # chunk length in milliseconds, 10 seconds
TRAINING_DIR = "Train/Training_Wavs_C"
def main():
#Export all of the individual chunks as wav files
for song in os.listdir(TRAINING_DIR):
song_name... | 37.548387 | 151 | 0.635739 |
df66af40850d014a5dd152548e4550f953a2a26b | 152 | py | Python | karo/__init__.py | SGrosse-Holz/karo | 7a58c3d1e7590a19c04311246d696bf6fcfcbf90 | [
"MIT"
] | 1 | 2021-03-03T18:22:42.000Z | 2021-03-03T18:22:42.000Z | karo/__init__.py | SGrosse-Holz/karo | 7a58c3d1e7590a19c04311246d696bf6fcfcbf90 | [
"MIT"
] | null | null | null | karo/__init__.py | SGrosse-Holz/karo | 7a58c3d1e7590a19c04311246d696bf6fcfcbf90 | [
"MIT"
] | null | null | null | from .framework import Simulation, showSim
from . import baseparticles
from . import particles
from . import collisionrules
from . import steppingrules
| 25.333333 | 42 | 0.822368 |
8294439fa6756973c9ffc4aedc9eae0d9b96276f | 8,277 | py | Python | tf_agents/agents/dqn/examples/train_eval_eager.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | 2 | 2018-12-20T01:49:33.000Z | 2019-12-09T13:17:05.000Z | tf_agents/agents/dqn/examples/train_eval_eager.py | kuanfang/agents | a0f25a4b44d4fc844c9b804bab60af2167f8d2bb | [
"Apache-2.0"
] | null | null | null | tf_agents/agents/dqn/examples/train_eval_eager.py | kuanfang/agents | a0f25a4b44d4fc844c9b804bab60af2167f8d2bb | [
"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... | 33.646341 | 80 | 0.725988 |
4896bca462bc38aa95720166ec6d1d02244d557b | 3,989 | py | Python | gnuradio-3.7.13.4/gnuradio-runtime/examples/mp-sched/run_synthetic.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gnuradio-runtime/examples/mp-sched/run_synthetic.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gnuradio-runtime/examples/mp-sched/run_synthetic.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | 39.107843 | 100 | 0.653046 |
585fede6cf9a8b23ca3585cdc5a5bdcac879b1a2 | 916 | py | Python | mmdet/models/detectors/__init__.py | cogsys-tuebingen/FourierNet | 04465e85ad0109c724358fc1e3dcbf6e4232afc8 | [
"Apache-2.0"
] | 41 | 2020-02-10T03:03:58.000Z | 2022-03-17T07:42:38.000Z | mmdet/models/detectors/__init__.py | cogsys-tuebingen/FourierNet | 04465e85ad0109c724358fc1e3dcbf6e4232afc8 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/__init__.py | cogsys-tuebingen/FourierNet | 04465e85ad0109c724358fc1e3dcbf6e4232afc8 | [
"Apache-2.0"
] | 6 | 2020-02-04T12:55:11.000Z | 2020-05-06T06:19:19.000Z | from .atss import ATSS
from .base import BaseDetector
from .cascade_rcnn import CascadeRCNN
from .double_head_rcnn import DoubleHeadRCNN
from .fast_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .fcos import FCOS
from .fovea import FOVEA
from .grid_rcnn import GridRCNN
from .htc import HybridTaskCascade
... | 35.230769 | 77 | 0.798035 |
6d7044ca21f6aa88424d0b42a1b7ffca061bb878 | 1,213 | py | Python | app/core/models.py | Ak5hay01/recipe-api | d570dc74084c95c88a4d45bb1d75a3380edc88da | [
"MIT"
] | null | null | null | app/core/models.py | Ak5hay01/recipe-api | d570dc74084c95c88a4d45bb1d75a3380edc88da | [
"MIT"
] | null | null | null | app/core/models.py | Ak5hay01/recipe-api | d570dc74084c95c88a4d45bb1d75a3380edc88da | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves a new user"""
if ... | 31.102564 | 76 | 0.661995 |
6fe45ffa850ddbdfda73cae6b75a832cdc33a75e | 1,564 | py | Python | tests/test_smc_propagator.py | HarshilShrivastava/SMCPy | e3c958023aab3f3143e70de5a52e3c195e536dd1 | [
"NASA-1.3"
] | 1 | 2020-02-11T22:37:43.000Z | 2020-02-11T22:37:43.000Z | tests/test_smc_propagator.py | HarshilShrivastava/SMCPy | e3c958023aab3f3143e70de5a52e3c195e536dd1 | [
"NASA-1.3"
] | null | null | null | tests/test_smc_propagator.py | HarshilShrivastava/SMCPy | e3c958023aab3f3143e70de5a52e3c195e536dd1 | [
"NASA-1.3"
] | null | null | null | from numpy.testing import assert_array_almost_equal
import pytest
from smcpy.smc.smc_propagator import SMCPropagator
@pytest.fixture
def expected_mean():
return {'output_0': 1., 'output_1': 2., 'output_2': 3., 'output_3': 4.}
class StubModel():
def __init__(self, expected_mean):
self.expected_mean = ... | 33.276596 | 75 | 0.711637 |
ad120630ec31b2be44450b42e019657355e51062 | 28,241 | py | Python | gpMgmt/bin/gppylib/programs/clsAddMirrors.py | haolinw/gpdb | 16a9465747a54f0c61bac8b676fe7611b4f030d8 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/programs/clsAddMirrors.py | haolinw/gpdb | 16a9465747a54f0c61bac8b676fe7611b4f030d8 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/programs/clsAddMirrors.py | haolinw/gpdb | 16a9465747a54f0c61bac8b676fe7611b4f030d8 | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2022-03-18T03:08:11.000Z | 2022-03-18T03:08:11.000Z | #!/usr/bin/env python3
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
#
# Copyright (c) Greenplum Inc 2010. All Rights Reserved.
#
# import mainUtils FIRST to get python version check
# THIS IMPORT SHOULD COME FIRST
from gppylib.mainUtils import *
from optparse im... | 45.1856 | 143 | 0.634149 |
7389a86c7590640127619b92b160d89edaafd0bc | 997 | py | Python | meiduo_lianxi/apps/carts/utils.py | Wang-TaoTao/lianxiku | 0f58b6859b4dcd4e81d8f7c4f67be68f245811cc | [
"MIT"
] | null | null | null | meiduo_lianxi/apps/carts/utils.py | Wang-TaoTao/lianxiku | 0f58b6859b4dcd4e81d8f7c4f67be68f245811cc | [
"MIT"
] | null | null | null | meiduo_lianxi/apps/carts/utils.py | Wang-TaoTao/lianxiku | 0f58b6859b4dcd4e81d8f7c4f67be68f245811cc | [
"MIT"
] | null | null | null |
import json
from utils.cookiesecret import CookieSecret
# 封装合并购物车
def merge_cart_cookie_to_redis(request,user,response):
# 获取cookie购物车数据
cookie_str = request.COOKIES.get('carts')
# 如果cookie_str 没值 就直接响应结果
if not cookie_str:
return response
# 如果有值 解密
cookie_dict = CookieSecret.lo... | 21.212766 | 70 | 0.685055 |
3dd993cc74aa200ef4d03490c737474262cebbdb | 1,334 | py | Python | ethwizard/platforms/windows/maintain.py | stake-house/eth2-validator-wizard | 90a0182afc2efa70d4398035a966200856d4a556 | [
"MIT"
] | 17 | 2021-04-15T10:44:25.000Z | 2021-08-05T13:05:22.000Z | ethwizard/platforms/windows/maintain.py | stake-house/eth2-validator-wizard | 90a0182afc2efa70d4398035a966200856d4a556 | [
"MIT"
] | 43 | 2021-04-15T14:43:53.000Z | 2021-08-23T15:20:18.000Z | ethwizard/platforms/windows/maintain.py | stake-house/eth2-validator-wizard | 90a0182afc2efa70d4398035a966200856d4a556 | [
"MIT"
] | 1 | 2021-12-27T10:32:50.000Z | 2021-12-27T10:32:50.000Z | from ethwizard.platforms.windows.common import save_state, log, quit_app
from ethwizard.constants import (
CTX_SELECTED_EXECUTION_CLIENT,
CTX_SELECTED_CONSENSUS_CLIENT,
EXECUTION_CLIENT_GETH,
CONSENSUS_CLIENT_TEKU,
WIZARD_COMPLETED_STEP_ID
)
def enter_maintenance(context):
# Maintenance entry ... | 28.382979 | 72 | 0.744378 |
f73842990d3c34bb39b1979920ca99697d282613 | 413 | py | Python | agent/indy_catalyst_agent/storage/tests/test__record.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/storage/tests/test__record.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/storage/tests/test__record.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | import pytest
from indy_catalyst_agent.storage import StorageRecord
class TestStorageRecord:
def test_create(self):
record_type = "TYPE"
record_value = "VALUE"
record = StorageRecord(record_type, record_value)
assert record.type == record_type
assert record.value == recor... | 25.8125 | 57 | 0.680387 |
b2b0ea2eb08a3257733a458999437ab52fc1d4fb | 275 | py | Python | tests/util/test_iterator.py | asherwunk/objconfig | 97243fa00a9e39d1167dc1e07a84578e20072c37 | [
"MIT"
] | null | null | null | tests/util/test_iterator.py | asherwunk/objconfig | 97243fa00a9e39d1167dc1e07a84578e20072c37 | [
"MIT"
] | null | null | null | tests/util/test_iterator.py | asherwunk/objconfig | 97243fa00a9e39d1167dc1e07a84578e20072c37 | [
"MIT"
] | null | null | null | """
Test objconfig.util.Iterator
"""
import pytest
from objconfig.exception import RuntimeException
from objconfig.util import Iterator
def test_itemmethods_iterator():
i = Iterator()
with pytest.raises(RuntimeException):
for a in i:
pass
| 17.1875 | 48 | 0.698182 |
e2db177a63201adbb99005065eb85f95a2dcd9b5 | 419 | py | Python | app/email.py | huguette135/The-pitches | 48f148fad905d410fd88e5acb9a0574fce42ccba | [
"MIT"
] | null | null | null | app/email.py | huguette135/The-pitches | 48f148fad905d410fd88e5acb9a0574fce42ccba | [
"MIT"
] | null | null | null | app/email.py | huguette135/The-pitches | 48f148fad905d410fd88e5acb9a0574fce42ccba | [
"MIT"
] | null | null | null |
from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
subject_pref = 'Pitch It Up!'
sender_email = 'staremdee@gmail.com'
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ... | 32.230769 | 66 | 0.725537 |
62bd76ed95ce045625d40969f27c74a5ae6cb577 | 3,680 | py | Python | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/lsprof.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/lsprof.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/lsprof.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:03:18.000Z | 2020-07-25T21:03:18.000Z | import sys
from _lsprof import Profiler, profiler_entry
__all__ = ['profile', 'Stats']
def profile(f, *args, **kwds):
"""XXX docstring"""
p = Profiler()
p.enable(subcalls=True, builtins=True)
try:
f(*args, **kwds)
finally:
p.disable()
return Stats(p.getstats())
class Stats(ob... | 33.454545 | 77 | 0.506793 |
5ce549cfa393c23dbd3394bafb06d043e1653257 | 80,242 | py | Python | dace/sdfg/state.py | tobiasholenstein/dace | 38fb56d12b59aa8dfe8bb1ff0068e29c5c75efc9 | [
"BSD-3-Clause"
] | null | null | null | dace/sdfg/state.py | tobiasholenstein/dace | 38fb56d12b59aa8dfe8bb1ff0068e29c5c75efc9 | [
"BSD-3-Clause"
] | null | null | null | dace/sdfg/state.py | tobiasholenstein/dace | 38fb56d12b59aa8dfe8bb1ff0068e29c5c75efc9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
""" Contains classes of a single SDFG state and dataflow subgraphs. """
import collections
import copy
from dace.subsets import Range, Subset
from dace import (data as dt, dtypes, memlet as mm, serialize, subsets as sbs,
symb... | 40.939796 | 96 | 0.546397 |
5fc845eceac6f0c048d7489fdc4c672b0c609ea0 | 10,800 | py | Python | src/main/python/apache/aurora/executor/common/health_checker.py | brinick/aurora | 963700727fe31c75ccf3506bb150e085df80cf3c | [
"Apache-2.0"
] | 11 | 2016-05-25T15:44:34.000Z | 2021-07-24T19:37:30.000Z | src/main/python/apache/aurora/executor/common/health_checker.py | brinick/aurora | 963700727fe31c75ccf3506bb150e085df80cf3c | [
"Apache-2.0"
] | 1 | 2022-01-21T23:08:28.000Z | 2022-01-21T23:08:28.000Z | src/main/python/apache/aurora/executor/common/health_checker.py | brinick/aurora | 963700727fe31c75ccf3506bb150e085df80cf3c | [
"Apache-2.0"
] | 6 | 2016-05-30T06:41:24.000Z | 2022-02-27T10:57:58.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | 37.370242 | 100 | 0.728704 |
a4de7a08d4ad58ebfc08e2700bcb5a2150480ebc | 397 | py | Python | profiles_api/permissions.py | vikashkumargaurav/Django--Rest-Framework-Udemy | 038c40674ac20c3c6a7e695b39ad5ca9fd4d0ce3 | [
"MIT"
] | null | null | null | profiles_api/permissions.py | vikashkumargaurav/Django--Rest-Framework-Udemy | 038c40674ac20c3c6a7e695b39ad5ca9fd4d0ce3 | [
"MIT"
] | 5 | 2021-03-30T13:38:01.000Z | 2021-09-22T19:10:16.000Z | profiles_api/permissions.py | vikashkumargaurav/Django--Rest-Framework-Udemy | 038c40674ac20c3c6a7e695b39ad5ca9fd4d0ce3 | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
# All user to edit only their own profile
def has_object_permission(self, request, view, obj):
""" Check user is trying to edit their own profile """
if request.method in permissions.SAFE_METH... | 28.357143 | 64 | 0.672544 |
88057882f36769450e6cc601d5d91eb36f84cd90 | 2,088 | py | Python | db_create.py | bendominguez011/community-project | d77a3070b0cbe28f7ae83bd052e3ce32087f7ebe | [
"MIT"
] | 1 | 2015-11-04T04:08:40.000Z | 2015-11-04T04:08:40.000Z | db_create.py | bendominguez011/community-project | d77a3070b0cbe28f7ae83bd052e3ce32087f7ebe | [
"MIT"
] | null | null | null | db_create.py | bendominguez011/community-project | d77a3070b0cbe28f7ae83bd052e3ce32087f7ebe | [
"MIT"
] | null | null | null | from app import db
from models import Community, Posts, Comments, User
db.create_all()
u = User(username="ben", password="appleZ1")
c = Community(name="powerlifting", password=None, founder=u, FAQ=None, description=None)
post = Posts("How to Hook Grip with Mark Robb",
"This is a video on how to hook grip with mark... | 44.425532 | 154 | 0.680077 |
2152da13aec256764feeda5ec641bac65507842c | 498 | py | Python | src/_cffi_src/openssl/ecdh.py | dabiaotouxiang/cryptography | 98410500e94a5f29496149c8009679bfa7d58dc5 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/_cffi_src/openssl/ecdh.py | dabiaotouxiang/cryptography | 98410500e94a5f29496149c8009679bfa7d58dc5 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/_cffi_src/openssl/ecdh.py | dabiaotouxiang/cryptography | 98410500e94a5f29496149c8009679bfa7d58dc5 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
INCLUDES = """
#include <openssl/ecdh.h>
#include <openssl/ssl.h>
"""
TYPES = """
"""
FUNCTIONS = """
int ECDH_compute_key(void *, size_... | 22.636364 | 79 | 0.648594 |
040d4fa4c773d235e687c5d2452e2da638552240 | 12,780 | py | Python | lale/lib/lale/grid_search_cv.py | chiragsahni/lale | a04adcdc14f2e05b846ebd5767186b66fe20463f | [
"Apache-2.0"
] | null | null | null | lale/lib/lale/grid_search_cv.py | chiragsahni/lale | a04adcdc14f2e05b846ebd5767186b66fe20463f | [
"Apache-2.0"
] | null | null | null | lale/lib/lale/grid_search_cv.py | chiragsahni/lale | a04adcdc14f2e05b846ebd5767186b66fe20463f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.922849 | 130 | 0.499374 |
c4edae56ee0d0e0fc783e27853961428161a0c89 | 382 | py | Python | catkin_ws/build/fetch_ros/fetch_moveit_config/catkin_generated/pkg.develspace.context.pc.py | RHolmewood/FetchRobot_Project2 | c096dd4bf88691d893010e95074f5c53baac37bc | [
"MIT"
] | null | null | null | catkin_ws/build/fetch_ros/fetch_moveit_config/catkin_generated/pkg.develspace.context.pc.py | RHolmewood/FetchRobot_Project2 | c096dd4bf88691d893010e95074f5c53baac37bc | [
"MIT"
] | null | null | null | catkin_ws/build/fetch_ros/fetch_moveit_config/catkin_generated/pkg.develspace.context.pc.py | RHolmewood/FetchRobot_Project2 | c096dd4bf88691d893010e95074f5c53baac37bc | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "fetch_moveit_config"
PROJECT_SPACE_DI... | 42.444444 | 68 | 0.712042 |
487942d482060106c0e12322c3ee3a8eeec09cce | 9,643 | py | Python | code/AL.py | alexmill/covid19demographics-fall | b53708883a0c091f7e4eaef3d270153d88fe11f9 | [
"MIT"
] | null | null | null | code/AL.py | alexmill/covid19demographics-fall | b53708883a0c091f7e4eaef3d270153d88fe11f9 | [
"MIT"
] | null | null | null | code/AL.py | alexmill/covid19demographics-fall | b53708883a0c091f7e4eaef3d270153d88fe11f9 | [
"MIT"
] | 2 | 2020-09-24T01:01:11.000Z | 2020-10-06T19:17:43.000Z | from bs4 import BeautifulSoup
import csv
from datetime import datetime
import time
import re
import sys
from urllib.request import urlopen
import requests
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from selenium.common.exceptions import TimeoutException
# from selenium.webdriver.su... | 65.598639 | 485 | 0.638598 |
64f7503be9ec463991c3b5fe1075d826e5bc7917 | 25,883 | py | Python | ipyslides/utils.py | massgh/ipyslides | 557c9d6a151461b1de3be0d3b0b5b9e71fb10ca9 | [
"MIT"
] | 9 | 2021-08-02T03:02:42.000Z | 2022-03-22T15:58:31.000Z | ipyslides/utils.py | massgh/ipyslides | 557c9d6a151461b1de3be0d3b0b5b9e71fb10ca9 | [
"MIT"
] | 2 | 2021-09-13T15:59:46.000Z | 2022-03-25T14:02:59.000Z | ipyslides/utils.py | massgh/ipyslides | 557c9d6a151461b1de3be0d3b0b5b9e71fb10ca9 | [
"MIT"
] | null | null | null | __all__ = ['print_context', 'write', 'iwrite', 'details', 'plt2html', 'set_dir', 'textbox',
'image','svg','format_html','format_css','alert','colored','keep_format',
'source','raw','enable_zoom','html_node','sig','doc']
__all__.extend(['rows','block'])
__all__.extend([f'block_{c}' for c in ['r',... | 47.404762 | 194 | 0.641464 |
6b3e15ea8da94d7d5ef6b14059de5b5ee2316196 | 1,033 | py | Python | karez/connector/extras/eaton_telemetry.py | cap-dcwiz/Karez | 6b9347baf63af92b4eba3fd1dc2d45f08e361d3a | [
"MIT"
] | null | null | null | karez/connector/extras/eaton_telemetry.py | cap-dcwiz/Karez | 6b9347baf63af92b4eba3fd1dc2d45f08e361d3a | [
"MIT"
] | null | null | null | karez/connector/extras/eaton_telemetry.py | cap-dcwiz/Karez | 6b9347baf63af92b4eba3fd1dc2d45f08e361d3a | [
"MIT"
] | null | null | null | from ..restful import RestfulConnectorBase
from ...utils import sub_dict
class Connector(RestfulConnectorBase):
@classmethod
def role_description(cls):
return "Connector for Eaton DCIM."
async def fetch_data(self, client, entities):
r = await client.post("/mtemplates/resources/v3/list",
... | 35.62069 | 67 | 0.442401 |
2fa0a8ae23743efacd8872ca333f4a3dd65bbbcf | 53,381 | py | Python | rpython/rtyper/llinterp.py | ruby-compiler-survey/pypy | c76ed8d0979e13497786cf99eb427ef8f94ea816 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rtyper/llinterp.py | ruby-compiler-survey/pypy | c76ed8d0979e13497786cf99eb427ef8f94ea816 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rtyper/llinterp.py | ruby-compiler-survey/pypy | c76ed8d0979e13497786cf99eb427ef8f94ea816 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import cStringIO
import os
import sys
import traceback
import py
from rpython.flowspace.model import (FunctionGraph, Constant, Variable)
from rpython.rlib import rstackovf
from rpython.rlib.objectmodel import (ComputedIntSymbolic, CDefinedIntSymbolic,
Symbolic)
# intmask is used in an exec'd code block
from rpyth... | 36.537303 | 149 | 0.611041 |
4920b8cd04bafcc6f91c4428e7c58e3e8d6fc144 | 217 | py | Python | test/test_del_group.py | ZhurkoI/python_training | 50ab63f4e65b77d44f99978031f8531c4fc603b0 | [
"Apache-2.0"
] | null | null | null | test/test_del_group.py | ZhurkoI/python_training | 50ab63f4e65b77d44f99978031f8531c4fc603b0 | [
"Apache-2.0"
] | null | null | null | test/test_del_group.py | ZhurkoI/python_training | 50ab63f4e65b77d44f99978031f8531c4fc603b0 | [
"Apache-2.0"
] | null | null | null | def test_delete_first_group(app):
# в тестовые методы в качестве параметра передается фикстура
app.session.login(username="admin", password="secret")
app.group.delete_first_group()
app.session.logout() | 43.4 | 64 | 0.75576 |
a17bf8607dccf41ef164ed46ece8e41b0352a99b | 261 | py | Python | test_stickers.py | sernote/selenium_training | 20c7b8db0847ae4c5360dcd331109aab69165bf1 | [
"Apache-2.0"
] | null | null | null | test_stickers.py | sernote/selenium_training | 20c7b8db0847ae4c5360dcd331109aab69165bf1 | [
"Apache-2.0"
] | null | null | null | test_stickers.py | sernote/selenium_training | 20c7b8db0847ae4c5360dcd331109aab69165bf1 | [
"Apache-2.0"
] | null | null | null |
def test_all_products_have_one_sticker(app):
app.go_to_main_page()
products = app.wd.find_elements_by_css_selector('.product')
for product in products:
assert len(product.find_elements_by_xpath('.//div[contains(@class, "sticker")]')) == 1
| 32.625 | 94 | 0.724138 |
c8c05061c546b7d38efe144ab295973cc63a6e56 | 3,204 | py | Python | src/lib/Bcfg2/Client/Tools/Pacman.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Client/Tools/Pacman.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Client/Tools/Pacman.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | """This is the bcfg2 support for pacman"""
import Bcfg2.Client.Tools
class Pacman(Bcfg2.Client.Tools.PkgTool):
'''Archlinux package support'''
name = 'Pacman'
__execs__ = ["/usr/bin/pacman"]
__handles__ = [('Package', 'pacman')]
__req__ = {'Package': ['name', 'version']}
pkgtype = 'pacman'
... | 38.142857 | 81 | 0.540262 |
9b97bf82101de31e84502da46b6310202c010011 | 3,178 | py | Python | azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 49.65625 | 132 | 0.682819 |
d4b98344443db31f65a8e45beb9c502733fc0ab5 | 710 | py | Python | util/bidict/bidict4.py | aliaksandr-klimovich/sandbox | adab6b18f3d78a891c38609abc71b5d7a751919c | [
"Unlicense"
] | 1 | 2020-12-25T18:21:18.000Z | 2020-12-25T18:21:18.000Z | util/bidict/bidict4.py | aliaksandr-klimovich/sandbox | adab6b18f3d78a891c38609abc71b5d7a751919c | [
"Unlicense"
] | 1 | 2021-02-11T15:05:59.000Z | 2021-02-11T15:05:59.000Z | util/bidict/bidict4.py | aliaksandr-klimovich/sandbox | adab6b18f3d78a891c38609abc71b5d7a751919c | [
"Unlicense"
] | null | null | null | import weakref
class bidict:
"""
keys 1 keys 2
{ 1 : lnk_to_2 } { 2 : lnk_to_1 }
{ 2 : lnk_to_1 }
>>> bd = bidict()
>>> bd['x'] = 1
>>> bd.keys1
todo ...
"""
def __init__(self):
self.keys1 = dict()
self.keys2 = dict()
def __se... | 19.189189 | 44 | 0.452113 |
ad779a7ec629d109d029e091f21b8f869516b314 | 7,437 | py | Python | code/plot.py | davijit868/pinn | d9015940ac1ddf58adf4f1a75b1e1cd707089f1c | [
"MIT"
] | null | null | null | code/plot.py | davijit868/pinn | d9015940ac1ddf58adf4f1a75b1e1cd707089f1c | [
"MIT"
] | null | null | null | code/plot.py | davijit868/pinn | d9015940ac1ddf58adf4f1a75b1e1cd707089f1c | [
"MIT"
] | null | null | null | import plotly.graph_objects as go
import numpy as np
from plotly.subplots import make_subplots
import pandas as pd
fig = make_subplots(rows=2, cols=2, vertical_spacing=0.05, horizontal_spacing=0.15, column_widths=[0.25, 0.75], \
specs=[[{'rowspan': 1, 'b':0.1}, {}], [{'rowspan': 1, 'b':0.1}, {}]])
... | 48.607843 | 155 | 0.523733 |
63392af714d342a05a039a71e14b288565086f22 | 128,044 | py | Python | modules/s3db/cr.py | nursix/rlpptm | e7b50b2fdf6277aed5f198ca10ad773c5ca0b947 | [
"MIT"
] | 1 | 2022-03-21T21:58:30.000Z | 2022-03-21T21:58:30.000Z | modules/s3db/cr.py | nursix/rlpptm | e7b50b2fdf6277aed5f198ca10ad773c5ca0b947 | [
"MIT"
] | null | null | null | modules/s3db/cr.py | nursix/rlpptm | e7b50b2fdf6277aed5f198ca10ad773c5ca0b947 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Shelter (Camp) Registry, model
@copyright: 2009-2021 (c) Sahana Software Foundation
@license: MIT
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 ... | 42.370615 | 146 | 0.424487 |
c1e09e3a384f7fa7d82d44b7a4c9176c5ae75d47 | 27,271 | py | Python | tensorflow/python/kernel_tests/py_func_test.py | noahtren/tensorflow | 208ae7cda40a11c67cb987eec127e667cdda60a8 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/py_func_test.py | noahtren/tensorflow | 208ae7cda40a11c67cb987eec127e667cdda60a8 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/py_func_test.py | noahtren/tensorflow | 208ae7cda40a11c67cb987eec127e667cdda60a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015 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
#
# Un... | 34.873402 | 80 | 0.659162 |
10a204f0388950d05963c4fb4220511d9ecfd06e | 1,866 | py | Python | hotroom/collector/basicinfo/BaseDanmu.py | love3forever/hotroom-api | a560936741822257a77a4a52d5c244e41f8633b8 | [
"MIT"
] | null | null | null | hotroom/collector/basicinfo/BaseDanmu.py | love3forever/hotroom-api | a560936741822257a77a4a52d5c244e41f8633b8 | [
"MIT"
] | null | null | null | hotroom/collector/basicinfo/BaseDanmu.py | love3forever/hotroom-api | a560936741822257a77a4a52d5c244e41f8633b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-02-22 13:59:02
# @Author : Wangmengcn (eclipse_sv@163.com)
# @Link : https://eclipsesv.com
# @Version : $Id$
import logging
from abc import ABCMeta, abstractmethod
from bs4 import BeautifulSoup
from pymongo import MongoClient
from requests import Ses... | 28.272727 | 76 | 0.62433 |
76db2ca30039f9758bc722f335da5d05c2a86f8e | 2,943 | py | Python | bloody_hell_bot/subtitles/opensub.py | m-kus/BloodyHellBot | 82af2b9ca243890b2cefa17a13d5eac888923c21 | [
"MIT"
] | 2 | 2019-02-09T14:31:01.000Z | 2020-09-15T20:19:52.000Z | bloody_hell_bot/subtitles/opensub.py | m-kus/BloodyHellBot | 82af2b9ca243890b2cefa17a13d5eac888923c21 | [
"MIT"
] | null | null | null | bloody_hell_bot/subtitles/opensub.py | m-kus/BloodyHellBot | 82af2b9ca243890b2cefa17a13d5eac888923c21 | [
"MIT"
] | null | null | null | import re
import zlib
import requests
import collections
from typing import List
from pythonopensubtitles.opensubtitles import OpenSubtitles
class OpenSubtitleSession:
def __init__(self, username, password):
self.username = username
self.password = password
self._ost = OpenSu... | 29.727273 | 90 | 0.546721 |
5b4f423230ad5aff88dd4950efebc209e498aaa5 | 1,139 | py | Python | napalm_example/cisco_ios/test_ios_cfg.py | tgnelson/pynet-ons-feb19 | c789e14812b90342f640f690e2717d36152487bc | [
"Apache-2.0"
] | null | null | null | napalm_example/cisco_ios/test_ios_cfg.py | tgnelson/pynet-ons-feb19 | c789e14812b90342f640f690e2717d36152487bc | [
"Apache-2.0"
] | null | null | null | napalm_example/cisco_ios/test_ios_cfg.py | tgnelson/pynet-ons-feb19 | c789e14812b90342f640f690e2717d36152487bc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from getpass import getpass
from pprint import pprint as pp
from napalm import get_network_driver
host = '184.105.247.70'
username = 'pyclass'
password = getpass()
optional_args = {}
driver = get_network_driver('ios')
device = driver(host, username, password, optional_args=optional_args)
print
... | 23.244898 | 70 | 0.76734 |
37350110752b8330f72c0883edc24c8639dfb95e | 1,057 | py | Python | tests/test_reactive.py | flipcoder/pythonic-reactive | 9a9fbcc4d45ffedcbab71aec3fc7bb460c957bbd | [
"MIT"
] | 1 | 2020-12-28T21:18:02.000Z | 2020-12-28T21:18:02.000Z | tests/test_reactive.py | flipcoder/pythonic-reactive | 9a9fbcc4d45ffedcbab71aec3fc7bb460c957bbd | [
"MIT"
] | null | null | null | tests/test_reactive.py | flipcoder/pythonic-reactive | 9a9fbcc4d45ffedcbab71aec3fc7bb460c957bbd | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
import pytest
import sys
sys.path.append("..")
from pythonic_reactive.reactive import *
from test_helpers import *
# def test_signal():
# x = Wrapper(0)
# sig = Signal()
# # connection and calling
# sig.connect(lambda x=x: x.do(increment))
# sig()
# assert x() == 1
# ... | 18.875 | 46 | 0.531693 |
31cc2421cd13f78da9bc45cc9c97ccab9a75bcc5 | 2,110 | py | Python | contact.py | aritraroy24/Get_Google_Contacts | 8735d0b914711dfc77d44d7b7b376bbb0d2adba6 | [
"MIT"
] | null | null | null | contact.py | aritraroy24/Get_Google_Contacts | 8735d0b914711dfc77d44d7b7b376bbb0d2adba6 | [
"MIT"
] | null | null | null | contact.py | aritraroy24/Get_Google_Contacts | 8735d0b914711dfc77d44d7b7b376bbb0d2adba6 | [
"MIT"
] | null | null | null | from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import json
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleap... | 36.37931 | 79 | 0.642654 |
540d060121a03ad033abfd3fbec2a7a0921f5d07 | 18,424 | py | Python | bokeh/core/property/bases.py | teresafds/bokeh | 95b2a74ff463cfabdf9e3390951fa380166e6691 | [
"BSD-3-Clause"
] | null | null | null | bokeh/core/property/bases.py | teresafds/bokeh | 95b2a74ff463cfabdf9e3390951fa380166e6691 | [
"BSD-3-Clause"
] | null | null | null | bokeh/core/property/bases.py | teresafds/bokeh | 95b2a74ff463cfabdf9e3390951fa380166e6691 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 33.559199 | 135 | 0.580873 |
30df7196dd3af9346351ee69584887e0a10fbc8e | 4,978 | py | Python | pytype/tools/xref/callgraph_test.py | souravbadami/pytype | 804fa97e7f9208df2711976085a96f756b3949e6 | [
"Apache-2.0"
] | 1 | 2020-04-20T02:55:21.000Z | 2020-04-20T02:55:21.000Z | pytype/tools/xref/callgraph_test.py | doc22940/pytype | 4772ad6fe89f4df75ae3d08e7374f68074175d4a | [
"Apache-2.0"
] | null | null | null | pytype/tools/xref/callgraph_test.py | doc22940/pytype | 4772ad6fe89f4df75ae3d08e7374f68074175d4a | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys
from pytype import config
from pytype import file_utils
from pytype.tests import test_base
from pytype.tools.xref import indexer
class CallgraphTest(test_base.TargetIndependentTest):
"""Tests for the callgraph."""
def index_code(self, code, **kwargs):
"""Ge... | 29.455621 | 76 | 0.560265 |
cef4f6a0cdb9a63d3a9e9800c9ee33be494f8384 | 786 | py | Python | main.py | ViChao17/Observer | 863336fc8de9adadfc68997a953e87d3f7edd21e | [
"Unlicense"
] | null | null | null | main.py | ViChao17/Observer | 863336fc8de9adadfc68997a953e87d3f7edd21e | [
"Unlicense"
] | null | null | null | main.py | ViChao17/Observer | 863336fc8de9adadfc68997a953e87d3f7edd21e | [
"Unlicense"
] | null | null | null | from Observable import Observable
from Observer import Observer
class MySubject(Observable):
pass
class Observer1(Observer):
def update(self, obs: Observable, arg):
print(f'Observer1({self.__class__.__bases__[0].__name__})')
class Observer2(Observer):
def update(self, obs: Observable, arg):
... | 18.27907 | 67 | 0.659033 |
c5684d13013d4e1dc585d471395591efeb8b78c0 | 108 | py | Python | test/qa-tests/buildscripts/resmokelib/__init__.py | Mrliu8023/mongo-tools | b9048617a6dc788aae9286d0c2bd3fefe49d23d3 | [
"Apache-2.0"
] | 1 | 2022-02-17T10:51:19.000Z | 2022-02-17T10:51:19.000Z | test/qa-tests/buildscripts/resmokelib/__init__.py | Mrliu8023/mongo-tools | b9048617a6dc788aae9286d0c2bd3fefe49d23d3 | [
"Apache-2.0"
] | null | null | null | test/qa-tests/buildscripts/resmokelib/__init__.py | Mrliu8023/mongo-tools | b9048617a6dc788aae9286d0c2bd3fefe49d23d3 | [
"Apache-2.0"
] | null | null | null |
from . import errors
from . import logging
from . import parser
from . import testing
from . import utils
| 13.5 | 21 | 0.75 |
bebce01374cb4f50071c4219371ac390e36f32c6 | 1,010 | py | Python | Workspace_Labs/utils.py | devanshpratapsingh/Workspace_Labs | 072853c30b320136bf17c3c4692e3953769e1bd7 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:39:51.000Z | 2021-11-30T16:39:51.000Z | Workspace_Labs/utils.py | devanshpratapsingh/Workspace_Labs | 072853c30b320136bf17c3c4692e3953769e1bd7 | [
"Apache-2.0"
] | null | null | null | Workspace_Labs/utils.py | devanshpratapsingh/Workspace_Labs | 072853c30b320136bf17c3c4692e3953769e1bd7 | [
"Apache-2.0"
] | 2 | 2021-11-22T13:22:41.000Z | 2021-11-27T07:03:35.000Z | import random
import string
import csv
import pyrebase
from firebase_workers import get_config_details
def random_key_gen(x: int) -> str:
return "".join(random.choice(string.ascii_letters) for _ in range(x))
def write2csv(headers_list):
with open('data.csv','w') as csv_file:
csv_writer = csv.DictW... | 28.857143 | 121 | 0.681188 |
5e6cf9f5b4a32ac608568c65fa7a2c53e3763b94 | 11,786 | py | Python | ddsp/losses.py | keunwoochoi/ddsp | f5bc4c13b65b2e774b73ffe31dda5db051dba8eb | [
"Apache-2.0"
] | 1 | 2020-02-13T05:39:07.000Z | 2020-02-13T05:39:07.000Z | ddsp/losses.py | keunwoochoi/ddsp | f5bc4c13b65b2e774b73ffe31dda5db051dba8eb | [
"Apache-2.0"
] | null | null | null | ddsp/losses.py | keunwoochoi/ddsp | f5bc4c13b65b2e774b73ffe31dda5db051dba8eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The DDSP 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 or agreed to in wri... | 34.869822 | 96 | 0.63796 |
a0338e291eef638439bce33942cfabafb891cef8 | 3,195 | py | Python | examples/consumer_python/sighting-of-observed-data-consumer.py | djhaynes/cti-documentation | 01e60a66cc44f7a69a5564221463bc04ed958b0c | [
"BSD-3-Clause"
] | null | null | null | examples/consumer_python/sighting-of-observed-data-consumer.py | djhaynes/cti-documentation | 01e60a66cc44f7a69a5564221463bc04ed958b0c | [
"BSD-3-Clause"
] | null | null | null | examples/consumer_python/sighting-of-observed-data-consumer.py | djhaynes/cti-documentation | 01e60a66cc44f7a69a5564221463bc04ed958b0c | [
"BSD-3-Clause"
] | null | null | null | from stix2.v21 import (Bundle)
for obj in bundle.objects:
if obj == identityPym:
print("------------------")
print("== IDENTITY ==")
print("------------------")
print("ID: " + obj.id)
print("Created: " + str(obj.created))
print("Modified: " + str(obj.modified))
... | 38.963415 | 67 | 0.50892 |
6a194aaef8c4cb42be775ed38f9b215bbf28adf7 | 7,337 | py | Python | qcfractal/interface/models/common_models.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/interface/models/common_models.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/interface/models/common_models.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | """
Common models for QCPortal/Fractal
"""
from enum import Enum
from typing import Any, Dict, Optional
from pydantic import Field, validator
from qcelemental.models import AutodocBaseSettings, Molecule, ProtoModel, Provenance
from qcelemental.models.procedures import OptimizationProtocols
from qcelemental.models.resu... | 32.179825 | 121 | 0.637181 |
19b620a38c7a5576ba4a80f71355868852bd53b5 | 2,946 | py | Python | ingenico/direct/sdk/domain/payout_response.py | Ingenico/direct-sdk-python2 | 1c5c08fe2281aa99bfe8e8e031071600cb3be11d | [
"Apache-2.0"
] | null | null | null | ingenico/direct/sdk/domain/payout_response.py | Ingenico/direct-sdk-python2 | 1c5c08fe2281aa99bfe8e8e031071600cb3be11d | [
"Apache-2.0"
] | null | null | null | ingenico/direct/sdk/domain/payout_response.py | Ingenico/direct-sdk-python2 | 1c5c08fe2281aa99bfe8e8e031071600cb3be11d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.payout_output import PayoutOutput
from ingenico.direct.sdk.domain.payout_... | 31.677419 | 102 | 0.638153 |
124c61212aa482d0d791089e0babb707e4850a65 | 8,428 | py | Python | reframe/core/exceptions.py | stevenvdb/reframe | be9de13dc16d2c9fb4b760e07ac986b04f8ed880 | [
"BSD-3-Clause"
] | null | null | null | reframe/core/exceptions.py | stevenvdb/reframe | be9de13dc16d2c9fb4b760e07ac986b04f8ed880 | [
"BSD-3-Clause"
] | null | null | null | reframe/core/exceptions.py | stevenvdb/reframe | be9de13dc16d2c9fb4b760e07ac986b04f8ed880 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Base regression exceptions
#
import inspect
import os
import traceback
import warnings
import sys
import reframe.utility... | 26.420063 | 79 | 0.660418 |
8fad06c10e05aff906e6d38fc01332e8de8d9d19 | 4,054 | py | Python | sympy/printing/precedence.py | tachycline/sympy | abf6fec12012852c7e6fae38461da9723cadc8b9 | [
"BSD-3-Clause"
] | null | null | null | sympy/printing/precedence.py | tachycline/sympy | abf6fec12012852c7e6fae38461da9723cadc8b9 | [
"BSD-3-Clause"
] | null | null | null | sympy/printing/precedence.py | tachycline/sympy | abf6fec12012852c7e6fae38461da9723cadc8b9 | [
"BSD-3-Clause"
] | null | null | null | """A module providing information about the necessity of brackets"""
from __future__ import print_function, division
from sympy.core.function import _coeff_isneg
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda": 1,
"Xor": 10,
"Or": 20,
"And": 30,
"Relational": 35,
"Add... | 27.026667 | 87 | 0.661815 |
668ecff20c665da83737203f669dcfe3df56d32e | 2,903 | py | Python | dependencies/svgwrite/examples/linearGradient.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 21 | 2015-01-16T05:10:02.000Z | 2021-06-11T20:48:15.000Z | dependencies/svgwrite/examples/linearGradient.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 1 | 2019-09-09T12:10:27.000Z | 2020-05-22T10:12:14.000Z | dependencies/svgwrite/examples/linearGradient.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 2 | 2015-05-03T04:51:08.000Z | 2018-08-24T08:28:53.000Z | #!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: svg examples
# Created: 08.09.2010
# Copyright (C) 2010, Manfred Moitzi
# License: GPLv3
try:
import svgwrite
except ImportError:
# if svgwrite is not 'installed' append parent dir of __file__ to sys.path
import sys, os
sys.pat... | 37.217949 | 98 | 0.68102 |
9be6813bcd5cc72ad5baa7e3ba4e7e26eafd2cca | 37,008 | py | Python | electrum/network.py | winhackua/electrum | 361ffc062053436f4625dbe54a6dd22d7adc8af7 | [
"MIT"
] | null | null | null | electrum/network.py | winhackua/electrum | 361ffc062053436f4625dbe54a6dd22d7adc8af7 | [
"MIT"
] | null | null | null | electrum/network.py | winhackua/electrum | 361ffc062053436f4625dbe54a6dd22d7adc8af7 | [
"MIT"
] | null | null | null | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 Thomas Voegtlin
#
# 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 rig... | 41.028825 | 119 | 0.62573 |
90a4017f253bf84a3bccb9613ddd12c06633858e | 720 | py | Python | config.py | koitoror/challenge3 | 329ac158bacc9d619774b00f58cb60a89ebb90ac | [
"MIT"
] | 2 | 2018-12-14T10:49:10.000Z | 2019-10-25T20:25:28.000Z | config.py | koitoror/challenge3 | 329ac158bacc9d619774b00f58cb60a89ebb90ac | [
"MIT"
] | null | null | null | config.py | koitoror/challenge3 | 329ac158bacc9d619774b00f58cb60a89ebb90ac | [
"MIT"
] | null | null | null | import os
class Config(object):
"""BaseClass that defines defaults for child classes
configure defaults for sending mail with gmail
sets secret key for authentication
"""
DEBUG = False
SECRET_KEY = os.getenv('SECRET')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = os.... | 22.5 | 60 | 0.7 |
e6ab9732275962aceb14cb9aa2ea1467179480c9 | 31,371 | py | Python | examples/pytorch/summarization/run_summarization.py | m607stars/transformers_event_summarization | 6f6869287f4fde36fbc56ab90d3b37ea2d2d17ea | [
"Apache-2.0"
] | 3 | 2021-12-27T20:13:38.000Z | 2021-12-28T14:11:20.000Z | examples/pytorch/summarization/run_summarization.py | m607stars/transformers_event_summarization | 6f6869287f4fde36fbc56ab90d3b37ea2d2d17ea | [
"Apache-2.0"
] | null | null | null | examples/pytorch/summarization/run_summarization.py | m607stars/transformers_event_summarization | 6f6869287f4fde36fbc56ab90d3b37ea2d2d17ea | [
"Apache-2.0"
] | 2 | 2022-02-11T13:11:27.000Z | 2022-03-10T05:28:58.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 43.450139 | 149 | 0.672118 |
6d9f8a216c8d23b3e6b7eac6db90d9957a5f0dd2 | 2,780 | py | Python | application/routes.py | kishanvekaria/Pokedex | 493343a8094051dcf1c7a69d50417212cfd11acc | [
"MIT"
] | null | null | null | application/routes.py | kishanvekaria/Pokedex | 493343a8094051dcf1c7a69d50417212cfd11acc | [
"MIT"
] | null | null | null | application/routes.py | kishanvekaria/Pokedex | 493343a8094051dcf1c7a69d50417212cfd11acc | [
"MIT"
] | 1 | 2021-02-06T12:53:07.000Z | 2021-02-06T12:53:07.000Z | from flask import render_template, request, redirect, url_for
from application.forms import pokedatabaseforms, caughtforms, rename
from application.models import Pokedata, Caught
from application import app, db
import random
from sqlalchemy import func
@app.route('/')
@app.route('/home')
def home():
return render... | 38.082192 | 147 | 0.688489 |
50ebe457a1b78802dec0ab678d488621c9afcd56 | 2,389 | py | Python | tools/Kline2HDF5.py | wzf92/rqalpha | 63a328f10d0488a4b06cd13773e506d4ee96628b | [
"Apache-2.0"
] | null | null | null | tools/Kline2HDF5.py | wzf92/rqalpha | 63a328f10d0488a4b06cd13773e506d4ee96628b | [
"Apache-2.0"
] | null | null | null | tools/Kline2HDF5.py | wzf92/rqalpha | 63a328f10d0488a4b06cd13773e506d4ee96628b | [
"Apache-2.0"
] | null | null | null | import os
import datetime
import h5py
import numpy as np
DEFAULT_DTYPE = np.dtype([
('datetime', np.int64),
('open', np.float),
('close', np.float),
('high', np.float),
('low', np.float),
('limit_up', np.float),
('limit_down', np.float),
('volume', np.float),
('total_turnover', np.f... | 32.726027 | 97 | 0.544161 |
819315e0eda55f68149086e5b969251cdec54a9a | 5,701 | py | Python | 12_Bombs_Away/python/bombs_away.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-24T17:56:31.000Z | 2022-03-24T17:56:31.000Z | 12_Bombs_Away/python/bombs_away.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-24T20:16:26.000Z | 2022-03-24T20:16:26.000Z | 12_Bombs_Away/python/bombs_away.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-11T14:14:06.000Z | 2022-03-11T14:14:06.000Z | """
Bombs away
Ported from BASIC to Python3 by Bernard Cooke (bernardcooke53)
Tested with Python 3.8.10, formatted with Black and type checked with mypy.
"""
import random
from typing import Iterable
def _stdin_choice(prompt: str, *, choices: Iterable[str]) -> str:
ret = input(prompt)
while ret not in choice... | 30.005263 | 97 | 0.600772 |
2c76a299317a8b2e78a45220fe62c8a7a01945c0 | 1,734 | py | Python | test/vanilla/version-tolerant/AcceptanceTests/asynctests/test_incorrect_error_response.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/version-tolerant/AcceptanceTests/asynctests/test_incorrect_error_response.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/version-tolerant/AcceptanceTests/asynctests/test_incorrect_error_response.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 49.542857 | 81 | 0.72203 |
abf523d955e379857fc1e932841293b173263d0b | 4,558 | py | Python | mmrotate/core/patch/merge_results.py | ZephyrusKylin/mmrotate | 0edd2578743559b35bab23b45058211b85ecb82c | [
"Apache-2.0"
] | 449 | 2022-02-18T08:26:58.000Z | 2022-03-31T11:58:32.000Z | mmrotate/core/patch/merge_results.py | ZephyrusKylin/mmrotate | 0edd2578743559b35bab23b45058211b85ecb82c | [
"Apache-2.0"
] | 162 | 2022-02-18T09:54:46.000Z | 2022-03-31T15:40:46.000Z | mmrotate/core/patch/merge_results.py | ZephyrusKylin/mmrotate | 0edd2578743559b35bab23b45058211b85ecb82c | [
"Apache-2.0"
] | 98 | 2022-02-18T08:28:48.000Z | 2022-03-31T08:52:11.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmcv.ops import nms, nms_rotated
def translate_bboxes(bboxes, offset):
"""Translate bboxes according to its shape.
If the bbox shape is (n, 5), the bboxes are regarded as horizontal bboxes
and in (x, y, x, y, score) form... | 35.609375 | 79 | 0.595875 |
2a216dc82e6c4101327ef92606930a49f6978f2b | 18,712 | py | Python | model/backup/1030_edge_miou79.96/fpn_model.py | chansoopark98/CSNet-seg | 7de095a71cb01821d269acefe9bc3b0f284dc26d | [
"MIT"
] | 7 | 2021-10-11T07:13:06.000Z | 2022-03-03T12:35:46.000Z | model/backup/1030_edge_miou79.96/fpn_model.py | chansoopark98/CSNet-seg | 7de095a71cb01821d269acefe9bc3b0f284dc26d | [
"MIT"
] | null | null | null | model/backup/1030_edge_miou79.96/fpn_model.py | chansoopark98/CSNet-seg | 7de095a71cb01821d269acefe9bc3b0f284dc26d | [
"MIT"
] | null | null | null | from tensorflow.keras.layers import (
MaxPooling2D, SeparableConv2D, UpSampling2D, Activation, BatchNormalization,
GlobalAveragePooling2D, Conv2D, Dropout, Concatenate, multiply, Add, concatenate,
DepthwiseConv2D, Reshape, ZeroPadding2D, Dense, GlobalMaxPooling2D, Permute, Lambda, Subtract)
import tensorflo... | 40.502165 | 136 | 0.631947 |
fb906a1a4cb1014ac099a78e7e40068904778d71 | 2,112 | py | Python | fourdvar/transfunc/uncondition.py | steven-thomas/py4dvar | 9e4bdf257e11ee4eb6f65407afc46e372c7990ce | [
"Apache-2.0"
] | 1 | 2022-03-10T06:02:45.000Z | 2022-03-10T06:02:45.000Z | fourdvar/transfunc/uncondition.py | hulaba/py4dvar | 9e4bdf257e11ee4eb6f65407afc46e372c7990ce | [
"Apache-2.0"
] | null | null | null | fourdvar/transfunc/uncondition.py | hulaba/py4dvar | 9e4bdf257e11ee4eb6f65407afc46e372c7990ce | [
"Apache-2.0"
] | 3 | 2021-03-10T04:18:22.000Z | 2022-03-10T06:02:38.000Z | """
uncondition.py
Copyright 2016 University of Melbourne.
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 i... | 34.064516 | 206 | 0.651515 |
b2bf3fb4af3c076b6d14934fabbabc50666bee3a | 45,124 | py | Python | dactyl/dactyl_build.py | MarcelRaschke/dactyl | c93a6e455ec904685b7992c52967401f5559d7d2 | [
"MIT"
] | 1 | 2021-03-05T10:45:35.000Z | 2021-03-05T10:45:35.000Z | dactyl/dactyl_build.py | MarcelRaschke/dactyl | c93a6e455ec904685b7992c52967401f5559d7d2 | [
"MIT"
] | null | null | null | dactyl/dactyl_build.py | MarcelRaschke/dactyl | c93a6e455ec904685b7992c52967401f5559d7d2 | [
"MIT"
] | 1 | 2020-01-18T18:26:30.000Z | 2020-01-18T18:26:30.000Z | #!/usr/bin/env python3
################################################################################
# Dactyl - a tool for heroic epics of documentation
#
# Generates a website from Markdown and Jinja templates, with filtering
# along the way.
########################################################################... | 37.078061 | 107 | 0.60839 |
b1f0358e26ccea27da6f43502a06e8a4bb481682 | 370 | py | Python | app/order/query/dao/order_summary_dao.py | amazingguni/flask-ddd | 8a789c1db96a8ad4079fdd2957f64b7af710b5b3 | [
"Apache-2.0"
] | 1 | 2022-02-06T14:00:02.000Z | 2022-02-06T14:00:02.000Z | app/order/query/dao/order_summary_dao.py | amazingguni/flask-ddd | 8a789c1db96a8ad4079fdd2957f64b7af710b5b3 | [
"Apache-2.0"
] | null | null | null | app/order/query/dao/order_summary_dao.py | amazingguni/flask-ddd | 8a789c1db96a8ad4079fdd2957f64b7af710b5b3 | [
"Apache-2.0"
] | null | null | null | import abc
class OrderSummaryDao(abc.ABC):
@abc.abstractmethod
def select_by_orderer(self, orderer_id: int):
raise NotImplementedError
@abc.abstractmethod
def counts(self, filters: dict):
raise NotImplementedError
@abc.abstractmethod
def select(self, filters: dict, offset: in... | 23.125 | 61 | 0.702703 |
d142c4469ba1d1d62497f931da9d6d6465ef90a2 | 31,612 | py | Python | sn_tokenizer_example.py | tkim135/finBERT | 07e16917ba6c89b103c403ba6a602c9b2477b23f | [
"Apache-2.0"
] | null | null | null | sn_tokenizer_example.py | tkim135/finBERT | 07e16917ba6c89b103c403ba6a602c9b2477b23f | [
"Apache-2.0"
] | null | null | null | sn_tokenizer_example.py | tkim135/finBERT | 07e16917ba6c89b103c403ba6a602c9b2477b23f | [
"Apache-2.0"
] | 1 | 2021-09-02T20:21:40.000Z | 2021-09-02T20:21:40.000Z | import numpy as np
import io
import os
import torch
from tqdm import tqdm
from torch.utils.data import Dataset, DataLoader
from sklearn.metrics import classification_report, accuracy_score
import csv
import sys
from transformers import (set_seed,
TrainingArguments,
Tr... | 45.354376 | 311 | 0.626692 |
c1d0369af8af6c8a14127ee9310e032cd7278230 | 1,779 | py | Python | patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 AT&T Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 41.372093 | 78 | 0.734682 |
0b400b657d2fb60b61df55a49797a2241ac83573 | 2,978 | py | Python | buildConditions.py | BurcinSayin/pf2 | bcd362dc0a750b8ee59cd19ecff9cf5be4f34b19 | [
"MIT"
] | 25 | 2019-09-13T19:30:24.000Z | 2022-03-14T21:57:17.000Z | buildConditions.py | BurcinSayin/pf2 | bcd362dc0a750b8ee59cd19ecff9cf5be4f34b19 | [
"MIT"
] | 13 | 2019-09-26T20:03:04.000Z | 2021-09-14T23:21:03.000Z | buildConditions.py | BurcinSayin/pf2 | bcd362dc0a750b8ee59cd19ecff9cf5be4f34b19 | [
"MIT"
] | 12 | 2019-09-13T19:47:57.000Z | 2022-03-13T03:46:16.000Z | from bs4 import BeautifulSoup
import requests
import json
import datetime
import codecs
import time
condHolder = {}
condHolder['name'] = 'Pathfinder 2.0 Condition list'
condHolder['date'] = datetime.date.today().strftime("%B %d, %Y")
def get_single(link):
details = {}
itemDetails = {}
res2 = requests.get... | 27.072727 | 127 | 0.507388 |
2198ed18d9e1ab0e267b0549276027c91bf5bb1e | 3,624 | py | Python | iotbx/cif/tests/analyse_cod_stats.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | iotbx/cif/tests/analyse_cod_stats.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | iotbx/cif/tests/analyse_cod_stats.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from libtbx import easy_pickle
from libtbx.utils import get_svn_revision, get_build_tag, plural_s
from operator import itemgetter
import glob, os, sys
from six.moves import cStringIO as StringIO
class analyse(object):
def __init__(self):
self.n_hk... | 27.876923 | 82 | 0.66032 |
ff3a85fcf184b6218a36b8cbdd0419550d5323f8 | 208 | py | Python | hrpro/hrpro/doctype/district/test_district.py | thispl/tpl-hrpro | 3e0e7b16e4e2553490380a29c72bf59a061433a2 | [
"MIT"
] | null | null | null | hrpro/hrpro/doctype/district/test_district.py | thispl/tpl-hrpro | 3e0e7b16e4e2553490380a29c72bf59a061433a2 | [
"MIT"
] | null | null | null | hrpro/hrpro/doctype/district/test_district.py | thispl/tpl-hrpro | 3e0e7b16e4e2553490380a29c72bf59a061433a2 | [
"MIT"
] | 1 | 2022-03-17T21:58:16.000Z | 2022-03-17T21:58:16.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, TeamPRO and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestDistrict(unittest.TestCase):
pass
| 18.909091 | 46 | 0.759615 |
26a0891ac88fe92426e1041c72fe467601100496 | 15,181 | py | Python | tests/pytests/test_isis_spice_drivers.py | paarongiroux/ale | aaefdf555c4f24c5610912625e81dff57c479b4c | [
"Unlicense"
] | null | null | null | tests/pytests/test_isis_spice_drivers.py | paarongiroux/ale | aaefdf555c4f24c5610912625e81dff57c479b4c | [
"Unlicense"
] | null | null | null | tests/pytests/test_isis_spice_drivers.py | paarongiroux/ale | aaefdf555c4f24c5610912625e81dff57c479b4c | [
"Unlicense"
] | null | null | null | # Disabling all tests for this mix-in until it is re-written to align with 1.0 architecture
# - Jesse Mapel 5/23/19
# from collections import namedtuple
#
# import pytest
#
# import ale
# from ale.base import data_isis
# from ale import base
# from ale import util
#
# import pvl
# import numpy as np
# import struct
# ... | 29.026769 | 104 | 0.597787 |
be814262d465215d0fc78d750ad2eb5e8c80f7f2 | 33,996 | py | Python | src/parser/mod_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/parser/mod_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/parser/mod_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Handles conversion of LibreOffice types to Python Types
"""
# region Imports
import re
from abc import ABC, abstractmethod, abstractproperty
from typing import List, Match, Optional, Set, Union
from rel import mod_rel as RelInfo
# endregion Imports
# region Maps
# hyper is 64 bit int, singed or uns... | 31.246324 | 117 | 0.594011 |
8b365865165e53238d40960c8c98b26da9a10a4f | 3,845 | py | Python | benchmarks/compute_benchmarks_noise_coarse.py | aksholokhov/dysts | d9acb38a25067cd3027978fcef3c8b3a7137a1ac | [
"Apache-2.0"
] | 71 | 2021-09-08T15:38:41.000Z | 2022-03-28T16:13:56.000Z | benchmarks/compute_benchmarks_noise_coarse.py | aksholokhov/dysts | d9acb38a25067cd3027978fcef3c8b3a7137a1ac | [
"Apache-2.0"
] | 6 | 2021-10-05T00:35:02.000Z | 2021-12-27T21:39:02.000Z | benchmarks/compute_benchmarks_noise_coarse.py | aksholokhov/dysts | d9acb38a25067cd3027978fcef3c8b3a7137a1ac | [
"Apache-2.0"
] | 7 | 2021-11-07T03:26:56.000Z | 2022-02-09T12:20:11.000Z | #!/usr/bin/python
import sys
import os
import json
import dysts
from dysts.datasets import *
import pandas as pd
import numpy as np
import darts
from darts.models import *
from darts import TimeSeries
import darts.models
cwd = os.path.dirname(os.path.realpath(__file__))
# cwd = os.getcwd()
input_path = os.path.di... | 36.273585 | 137 | 0.690767 |
7054c018c57d4ea9944d9d0540ac864e087f74bc | 3,339 | py | Python | tests/test_assign_to_workflow_seqlab_quantstudio.py | EdinburghGenomics/clarity_scripts | 472299fc4edd4e0a08895ecc7c5630b253322e28 | [
"MIT"
] | 2 | 2018-06-18T16:31:09.000Z | 2021-03-31T20:13:39.000Z | tests/test_assign_to_workflow_seqlab_quantstudio.py | EdinburghGenomics/clarity_scripts | 472299fc4edd4e0a08895ecc7c5630b253322e28 | [
"MIT"
] | 99 | 2016-02-15T16:21:51.000Z | 2022-03-11T23:43:26.000Z | tests/test_assign_to_workflow_seqlab_quantstudio.py | EdinburghGenomics/clarity_scripts | 472299fc4edd4e0a08895ecc7c5630b253322e28 | [
"MIT"
] | null | null | null | from unittest.mock import Mock, patch, PropertyMock, call
from scripts.assign_workflow_seqlab_quantstudio import AssignWorkflowSeqLabQuantStudio
from tests.test_common import TestEPP, fake_artifact
def fake_all_outputs(unique=False, resolve=False):
"""Return a list of mocked artifacts which contain samples which... | 49.102941 | 116 | 0.607966 |
aa78849851dc13ef2f5531188ea26393db57a6a6 | 7,794 | py | Python | docs/conf.py | patrickbarth89/django-allauth-bootstrap | 836bda5eaf255ac338ae05256b5000022b28aa31 | [
"MIT"
] | null | null | null | docs/conf.py | patrickbarth89/django-allauth-bootstrap | 836bda5eaf255ac338ae05256b5000022b28aa31 | [
"MIT"
] | null | null | null | docs/conf.py | patrickbarth89/django-allauth-bootstrap | 836bda5eaf255ac338ae05256b5000022b28aa31 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# django-allauth documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 6 22:58:42 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | 32.340249 | 80 | 0.715422 |
4995972e1601b33817907e91f589d547a40bbafb | 4,196 | py | Python | voitools/scripts/voi2nii.py | njvack/spamalize-to-nifti | d451b62855c6ebd236fe9f146743a7b845ae6500 | [
"MIT"
] | 2 | 2015-07-31T16:15:11.000Z | 2018-03-07T12:56:03.000Z | voitools/scripts/voi2nii.py | njvack/spamalize-to-nifti | d451b62855c6ebd236fe9f146743a7b845ae6500 | [
"MIT"
] | null | null | null | voitools/scripts/voi2nii.py | njvack/spamalize-to-nifti | d451b62855c6ebd236fe9f146743a7b845ae6500 | [
"MIT"
] | 1 | 2022-01-13T16:51:54.000Z | 2022-01-13T16:51:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the voitools package
# Copyright 2015 Board of Regents of the University of Wisconsin System
# Licensed under the MIT license; see LICENSE at the root of the package.
# Authored by Nate Vack <njvack@wisc.edu> at the Waisman Laboratory for Brain
# Imaging and Beha... | 32.527132 | 77 | 0.632984 |
3e92611499fad37f493c05174428eb478487cdd9 | 2,620 | py | Python | tests/helper_functions/mne_eeglab_stuff.py | Social-Evolution-and-Behavior/pymatreader | 838bf248621e7ea31c96f2b9d25f79f02e666bc8 | [
"BSD-2-Clause"
] | null | null | null | tests/helper_functions/mne_eeglab_stuff.py | Social-Evolution-and-Behavior/pymatreader | 838bf248621e7ea31c96f2b9d25f79f02e666bc8 | [
"BSD-2-Clause"
] | null | null | null | tests/helper_functions/mne_eeglab_stuff.py | Social-Evolution-and-Behavior/pymatreader | 838bf248621e7ea31c96f2b9d25f79f02e666bc8 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright (c) 2018, Dirk Gütlin & Thomas Hartmann
# All rights reserved.
#
# This file is part of the pymatreader Project, see: https://gitlab.com/obob/pymatreader
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... | 39.69697 | 88 | 0.711832 |
f9ecec29e5391d00aded19d0b945a369d7d506c3 | 770 | py | Python | change_video_gray.py | Sean-hku/data_process | 9d3fff07590539302a4d80e34fc8bfd13b6f0847 | [
"Apache-2.0"
] | null | null | null | change_video_gray.py | Sean-hku/data_process | 9d3fff07590539302a4d80e34fc8bfd13b6f0847 | [
"Apache-2.0"
] | null | null | null | change_video_gray.py | Sean-hku/data_process | 9d3fff07590539302a4d80e34fc8bfd13b6f0847 | [
"Apache-2.0"
] | null | null | null |
import cv2
import os
import copy
def gray3D(img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
return cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
video_name = '/media/hkuit164/WD20EJRX/test_video/output.mp4'
cap = cv2.VideoCapture(video_name)
cnt = 0
out_det_video = cv2.VideoWriter(("gray.mp4"), cv2.VideoWriter_... | 25.666667 | 105 | 0.650649 |
67eee6d10a2d0832029c3b5906231dd30f16f23f | 2,407 | py | Python | detection/relations/editRCNNFeatureFiles.py | jccaicedo/localization-agent | d280acf355307b74e68dca9ec80ab293f0d18642 | [
"MIT"
] | 8 | 2016-11-20T19:43:45.000Z | 2020-12-09T04:58:05.000Z | detection/relations/editRCNNFeatureFiles.py | jccaicedo/localization-agent | d280acf355307b74e68dca9ec80ab293f0d18642 | [
"MIT"
] | 45 | 2015-05-04T20:41:05.000Z | 2017-07-17T12:04:13.000Z | detection/relations/editRCNNFeatureFiles.py | jccaicedo/localization-agent | d280acf355307b74e68dca9ec80ab293f0d18642 | [
"MIT"
] | 9 | 2016-11-20T19:43:46.000Z | 2020-09-01T21:01:54.000Z | import os,sys
import utils as cu
import scipy.io
import numpy as np
import libDetection as det
def loadBoxIndexFile(filename):
gt = [x.split() for x in open(filename)]
images = {}
for k in gt:
try:
images[k[0]] += [ [k[1]] + map(float,k[2:]) ]
except:
images[k[0]] = [ [k[1]] + map(float,k[2:]... | 33.901408 | 152 | 0.574159 |
46bfbdb53f566cd9603cf0d11519cc28b2621521 | 8,192 | py | Python | volt/openstack/common/strutils.py | vmthunder/volt | df6e2c3820c424b5144950d07cce053ee401cff6 | [
"Apache-2.0"
] | 2 | 2015-03-15T11:12:53.000Z | 2018-10-12T03:05:52.000Z | volt/volt/openstack/common/strutils.py | vmthunder/packages | e530e243007a0f403cad1b67a490ffb9687969c3 | [
"Apache-2.0"
] | null | null | null | volt/volt/openstack/common/strutils.py | vmthunder/packages | e530e243007a0f403cad1b67a490ffb9687969c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation.
# 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 req... | 33.300813 | 78 | 0.638672 |
8936a0b371a4b5b179c06e419ca7239eba108a6c | 250 | py | Python | Python/palindrome-permutation.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2020-10-27T03:22:31.000Z | 2020-10-27T03:22:31.000Z | Python/palindrome-permutation.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | null | null | null | Python/palindrome-permutation.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2021-03-22T18:58:23.000Z | 2021-03-22T18:58:23.000Z | # Time: O(n)
# Space: O(1)
import collections
class Solution(object):
def canPermutePalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
return sum(v % 2 for v in collections.Counter(s).values()) < 2
| 17.857143 | 70 | 0.548 |
6aafea9d388e68f7095b51012c3a0e4207f301af | 558 | py | Python | A2 - HMM/datafile.py | NickSmyr/ai-player-agents | f8972d02c53a2ba566b541b1270a0637e3d3e5c7 | [
"MIT"
] | null | null | null | A2 - HMM/datafile.py | NickSmyr/ai-player-agents | f8972d02c53a2ba566b541b1270a0637e3d3e5c7 | [
"MIT"
] | null | null | null | A2 - HMM/datafile.py | NickSmyr/ai-player-agents | f8972d02c53a2ba566b541b1270a0637e3d3e5c7 | [
"MIT"
] | null | null | null | import json
from json import JSONEncoder
import numpy as np
class Datafile:
def __init__(self, ):
self.data = None
self.models = None
def load(self, f):
self.data = json.load(f)
def save(self, filename):
with open(filename, 'w') as f:
json.dump(self.data, f, ... | 17.4375 | 56 | 0.625448 |
88dce17466520e19b36942251e75dba308347043 | 25,339 | py | Python | vertica_ml_python/learn/plot.py | FeatCrush/Vertica-ML-Python | dbc5ab6d9ae1b0e95158034b7cec145b6f8782ed | [
"Apache-2.0"
] | null | null | null | vertica_ml_python/learn/plot.py | FeatCrush/Vertica-ML-Python | dbc5ab6d9ae1b0e95158034b7cec145b6f8782ed | [
"Apache-2.0"
] | null | null | null | vertica_ml_python/learn/plot.py | FeatCrush/Vertica-ML-Python | dbc5ab6d9ae1b0e95158034b7cec145b6f8782ed | [
"Apache-2.0"
] | null | null | null | # (c) Copyright [2018] Micro Focus or one of its affiliates.
# 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 la... | 47.719397 | 219 | 0.619164 |
862d93b182835ef92e6c83de3160ff2967d549a3 | 146 | py | Python | OOP/Encapsulation_exercise/wild_cat_zoo/project/lion.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | 2 | 2022-03-05T13:17:12.000Z | 2022-03-05T13:17:16.000Z | OOP/Encapsulation_exercise/wild_cat_zoo/project/lion.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | OOP/Encapsulation_exercise/wild_cat_zoo/project/lion.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | from project.animal import Animal
class Lion(Animal):
def __init__(self, name, gender, age):
super().__init__(name, gender, age, 50) | 24.333333 | 47 | 0.684932 |
ab05895b99ffcbe15466df559f8bdd2e8ce6fac4 | 1,291 | py | Python | setup.py | morepath/reg | 0ba834088c74f5478dd66e9eab771d1e09fbeb97 | [
"BSD-3-Clause"
] | 48 | 2015-01-10T02:32:25.000Z | 2021-12-16T15:17:25.000Z | setup.py | morepath/reg | 0ba834088c74f5478dd66e9eab771d1e09fbeb97 | [
"BSD-3-Clause"
] | 42 | 2015-01-06T12:06:30.000Z | 2021-04-05T12:41:33.000Z | setup.py | morepath/reg | 0ba834088c74f5478dd66e9eab771d1e09fbeb97 | [
"BSD-3-Clause"
] | 6 | 2015-05-28T07:02:04.000Z | 2020-09-29T20:44:05.000Z | from setuptools import setup, find_packages
long_description = "\n".join(
(
open("README.rst", encoding="utf-8").read(),
open("CHANGES.txt", encoding="utf-8").read(),
)
)
setup(
name="reg",
version="0.13.dev0",
description="Clever dispatch",
long_description=long_description,
... | 31.487805 | 75 | 0.603408 |
86bba8467ddb8e7cef41cc7d2c1528794e06f6e9 | 12,941 | py | Python | src/python/pants/backend/jvm/tasks/ivy_task_mixin.py | lcary/pants | 9ffe5262909ad9521e8cdf2beffd6e86330bd3bc | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/ivy_task_mixin.py | lcary/pants | 9ffe5262909ad9521e8cdf2beffd6e86330bd3bc | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/ivy_task_mixin.py | lcary/pants | 9ffe5262909ad9521e8cdf2beffd6e86330bd3bc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
import l... | 42.709571 | 121 | 0.671973 |
d0cf277e7df169524b364604d9b53c3dc6cdadaa | 3,767 | py | Python | examples/random_actions.py | Rouzip/python-microRTS | da66ca31d7b6252dbddefa88280d7456efd0c74e | [
"Apache-2.0"
] | 18 | 2018-09-24T17:00:59.000Z | 2020-10-09T19:24:50.000Z | examples/random_actions.py | Rouzip/python-microRTS | da66ca31d7b6252dbddefa88280d7456efd0c74e | [
"Apache-2.0"
] | 3 | 2019-11-12T19:17:49.000Z | 2019-11-20T07:27:06.000Z | examples/random_actions.py | Rouzip/python-microRTS | da66ca31d7b6252dbddefa88280d7456efd0c74e | [
"Apache-2.0"
] | 4 | 2019-10-19T07:29:58.000Z | 2020-12-13T11:19:48.000Z | import pyrts
from pyrts import Server
import json
from collections import defaultdict
import random
class AI(Server):
"""
Randomly selects actions for each unit
"""
def __init__(self):
super(AI, self).__init__()
def get_unit_by_type(self, units, type):
return [unit for unit in uni... | 38.835052 | 127 | 0.667375 |
f7f7ca621560cc5b7a66f98bc234dddbac60c0fc | 3,791 | py | Python | 2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py | jiricejchan/AnonymniAnalytici | e4e96f943d0b2232d9099c6e7bb690a3d25ea422 | [
"MIT"
] | 10 | 2017-03-28T06:52:22.000Z | 2017-11-21T17:41:11.000Z | 2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py | jiricejchan/AnonymniAnalytici | e4e96f943d0b2232d9099c6e7bb690a3d25ea422 | [
"MIT"
] | 1 | 2017-07-21T08:27:01.000Z | 2017-07-21T08:27:01.000Z | 2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py | jiricejchan/AnonymniAnalytici | e4e96f943d0b2232d9099c6e7bb690a3d25ea422 | [
"MIT"
] | 8 | 2017-03-05T17:21:40.000Z | 2019-12-01T18:46:39.000Z | from catalyst.api import order_target_percent, record, symbol, set_benchmark
def initialize(context):
context.ASSET_NAME = 'USDT_REP'
context.asset = symbol(context.ASSET_NAME)
set_benchmark(context.asset)
context.is_first_time = True
# For all trading pairs in the poloniex bundle, the... | 30.821138 | 78 | 0.607491 |
8f1061134892b08af14ffa85336ac58d3a34f34d | 4,454 | py | Python | tasksupervisor/TaskSupervisor/transport_order_state_machine.py | iml130/mod.sw.tp.ts | 4cda3ef0d3791eb204d5510631fdb9ec7ec57aab | [
"Apache-2.0"
] | null | null | null | tasksupervisor/TaskSupervisor/transport_order_state_machine.py | iml130/mod.sw.tp.ts | 4cda3ef0d3791eb204d5510631fdb9ec7ec57aab | [
"Apache-2.0"
] | 1 | 2021-04-24T08:43:59.000Z | 2021-04-24T08:43:59.000Z | tasksupervisor/TaskSupervisor/transport_order_state_machine.py | iml130/mod.sw.tp.ts | 4cda3ef0d3791eb204d5510631fdb9ec7ec57aab | [
"Apache-2.0"
] | 1 | 2021-03-04T10:32:52.000Z | 2021-03-04T10:32:52.000Z | """ Contains TransportOrderStateMachine class """
from transitions import Machine
import random
import uuid
from enum import Enum
# maybe it would be better to inject the received data/events to the statemachine of icent
# as parameter ocb handler would be required (including concurency, m)
# a singleton-task-genera... | 38.730435 | 118 | 0.677593 |
cc2184a0c12440e626fb4eb18f598b15d8ca9b45 | 3,424 | py | Python | src/cosalib/kubevirt.py | Rtoax/coreos-assembler | b8f61207c7a4ce345a1f136823dac6c628086273 | [
"Apache-2.0"
] | 1 | 2022-01-28T05:27:17.000Z | 2022-01-28T05:27:17.000Z | src/cosalib/kubevirt.py | Rtoax/coreos-assembler | b8f61207c7a4ce345a1f136823dac6c628086273 | [
"Apache-2.0"
] | null | null | null | src/cosalib/kubevirt.py | Rtoax/coreos-assembler | b8f61207c7a4ce345a1f136823dac6c628086273 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import logging as log
from cosalib.cmdlib import (
run_verbose,
)
from cosalib.buildah import (
buildah_base_args
)
from cosalib.qemuvariants import QemuVariantImage
class KubeVirtImage(QemuVariantImage):
"""
KubeVirtImage uses QemuVariantImage to create a normal qcow2 i... | 34.585859 | 114 | 0.665596 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.