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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ce759c97f9e625acecce3dfe72eed7906e937996 | 3,272 | py | Python | app/app/settings.py | harrodcode/recipe-app-api | 109949681978f657e628cd09aad5f23cad5154b6 | [
"MIT"
] | null | null | null | app/app/settings.py | harrodcode/recipe-app-api | 109949681978f657e628cd09aad5f23cad5154b6 | [
"MIT"
] | null | null | null | app/app/settings.py | harrodcode/recipe-app-api | 109949681978f657e628cd09aad5f23cad5154b6 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib imp... | 25.5625 | 91 | 0.699878 |
17a571788bd8623108cf2cf0efc4143ce72c04e3 | 3,368 | py | Python | multirunnable/_singletons.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | 1 | 2022-03-18T15:20:53.000Z | 2022-03-18T15:20:53.000Z | multirunnable/_singletons.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | null | null | null | multirunnable/_singletons.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | null | null | null | from inspect import isclass as inspect_isclass
from typing import Dict, TypeVar, Generic, Any
from abc import ABCMeta
T = TypeVar("T")
def chk_cls(_cls):
if inspect_isclass(_cls) is False:
raise ValueError("The target object be decorated should be a 'class' level type object.")
def simple_singleton(_c... | 25.323308 | 97 | 0.655582 |
ae2a9cb1a695de9b65352961f96520a86bbc05a2 | 8,164 | py | Python | hailo_model_zoo/core/postprocessing/detection/centernet.py | hailo-ai/hailo_model_zoo | f5f0e710a7fd7c7258dd96cfcdc3da824ec5a5c4 | [
"MIT"
] | 29 | 2021-07-19T13:53:18.000Z | 2022-01-26T11:20:55.000Z | hailo_model_zoo/core/postprocessing/detection/centernet.py | hailo-ai/hailo_model_zoo | f5f0e710a7fd7c7258dd96cfcdc3da824ec5a5c4 | [
"MIT"
] | 1 | 2022-03-18T03:27:24.000Z | 2022-03-20T14:58:41.000Z | hailo_model_zoo/core/postprocessing/detection/centernet.py | hailo-ai/hailo_model_zoo | f5f0e710a7fd7c7258dd96cfcdc3da824ec5a5c4 | [
"MIT"
] | 10 | 2021-07-20T03:19:55.000Z | 2022-02-25T13:57:30.000Z | import tensorflow as tf
import numpy as np
from hailo_model_zoo.core.postprocessing.detection.detection_common import (COCO_2017_TO_2014_TRANSLATION,
tf_postproc_nms)
def pad_list(lst, pad_size):
if type(lst[0]) is np.ndarray:
pad... | 52.670968 | 117 | 0.625306 |
256f2494cd8b036e3fcef494502209bdc797648e | 4,799 | py | Python | xpulumi/runtime_support/hashed_password_provider.py | sammck/xpulumi | 1e25229cc5de113c6d4655ba81e391c29014aa5f | [
"MIT"
] | null | null | null | xpulumi/runtime_support/hashed_password_provider.py | sammck/xpulumi | 1e25229cc5de113c6d4655ba81e391c29014aa5f | [
"MIT"
] | null | null | null | xpulumi/runtime_support/hashed_password_provider.py | sammck/xpulumi | 1e25229cc5de113c6d4655ba81e391c29014aa5f | [
"MIT"
] | null | null | null | from ..internal_types import JsonableDict
from project_init_tools import gen_etc_shadow_password_hash as sync_gen_etc_shadow_password_hash
from typing import Any, Optional, List, cast
from pulumi.dynamic import ResourceProvider, CreateResult, Resource, DiffResult, UpdateResult, CheckResult, CheckFailure
from pulumi imp... | 47.99 | 165 | 0.708064 |
2eef67e1ba1fa18d49f88cccc12b29daf930b8a5 | 5,959 | py | Python | python/ray/util/sgd/v2/worker_group.py | kimikuri/ray | 96ff07b727fd58bef6cf56e018dc5de2695548db | [
"Apache-2.0"
] | null | null | null | python/ray/util/sgd/v2/worker_group.py | kimikuri/ray | 96ff07b727fd58bef6cf56e018dc5de2695548db | [
"Apache-2.0"
] | null | null | null | python/ray/util/sgd/v2/worker_group.py | kimikuri/ray | 96ff07b727fd58bef6cf56e018dc5de2695548db | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Callable, List, TypeVar
from inspect import signature
import ray
from ray.types import ObjectRef
T = TypeVar("T")
logger = logging.getLogger(__name__)
class BaseWorker:
"""A class to execute arbitrary functions. Does not hold any state."""
def execute(self, func: Callabl... | 38.694805 | 79 | 0.591039 |
94a7f12b7ee7efe29a2fe9cfed103589817dcc4f | 5,961 | py | Python | avista_data/server.py | isu-avista/data | 083c65601370a81240965e0886d966a5b24f2d6f | [
"MIT"
] | null | null | null | avista_data/server.py | isu-avista/data | 083c65601370a81240965e0886d966a5b24f2d6f | [
"MIT"
] | null | null | null | avista_data/server.py | isu-avista/data | 083c65601370a81240965e0886d966a5b24f2d6f | [
"MIT"
] | null | null | null | import re
import avista_data
from .database import Base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
class Server(Base):
"""A representation of servers to which the device is connected and to which data will be provided
Attributes:
**id (int)**: ... | 29.656716 | 121 | 0.584633 |
78e7f6c22b7a3c1a5caff4919a0b8cae093023b1 | 18,573 | py | Python | proyectos/4/LeyvaChristian-VelascoBryan/Proyecto4_chrisco.py | caleman4/sistop-2022-2 | 618fddcec75daf3798a07bf4760b0b3b4d72de20 | [
"CC-BY-4.0"
] | 9 | 2022-02-03T00:16:01.000Z | 2022-02-25T06:30:46.000Z | proyectos/4/LeyvaChristian-VelascoBryan/Proyecto4_chrisco.py | caleman4/sistop-2022-2 | 618fddcec75daf3798a07bf4760b0b3b4d72de20 | [
"CC-BY-4.0"
] | 27 | 2022-02-08T18:48:49.000Z | 2022-03-16T19:44:05.000Z | proyectos/4/LeyvaChristian-VelascoBryan/Proyecto4_chrisco.py | caleman4/sistop-2022-2 | 618fddcec75daf3798a07bf4760b0b3b4d72de20 | [
"CC-BY-4.0"
] | 31 | 2022-02-03T00:17:14.000Z | 2022-03-31T15:13:40.000Z | # Proyecto 4: (Micro) sistema de archivos
# Autores: Bryan Velasco & Christian Leyva
# Imports: -------------------------------------------------------------------------------
# Bibliotecas incluidas en el core de Python
import os,mmap,traceback, math
from datetime import datetime
import shutil
# Bibliotecas que re... | 50.061995 | 596 | 0.612233 |
27eb03d6f4aa03f1594e694df49ff4dd6eabbc82 | 3,155 | py | Python | numpoly/construct/compose.py | jonathf/npoly | 9df4bd2a3b134e8a196e24389c0ad84c26da9662 | [
"BSD-2-Clause"
] | 8 | 2019-12-13T23:54:33.000Z | 2021-11-08T22:44:25.000Z | numpoly/construct/compose.py | jonathf/npoly | 9df4bd2a3b134e8a196e24389c0ad84c26da9662 | [
"BSD-2-Clause"
] | 54 | 2019-08-25T20:03:10.000Z | 2021-08-09T08:59:27.000Z | numpoly/construct/compose.py | jonathf/npoly | 9df4bd2a3b134e8a196e24389c0ad84c26da9662 | [
"BSD-2-Clause"
] | 2 | 2020-03-05T12:03:28.000Z | 2021-03-07T16:56:09.000Z | """Compose polynomial from array of arrays of polynomials."""
from __future__ import annotations
from typing import List, Optional, Sequence, Set, Tuple
import numpy
import numpy.typing
import numpoly
from ..baseclass import ndpoly, PolyLike
def compose_polynomial_array(
arrays: Sequence[PolyLike],
... | 34.67033 | 76 | 0.618384 |
fe4189180b1f94fa147911ab734967ac4aa5cacf | 197 | py | Python | blog/urls.py | Hack3rOneness/django-site-template | 90f9649d4130a5c0c5e105071f1338663a2e239b | [
"MIT"
] | 8 | 2019-04-22T04:37:39.000Z | 2021-05-20T02:49:10.000Z | blog/urls.py | Hack3rOneness/django-site-template | 90f9649d4130a5c0c5e105071f1338663a2e239b | [
"MIT"
] | 2 | 2021-03-25T23:53:40.000Z | 2021-06-10T23:04:55.000Z | blog/urls.py | Hack3rOneness/django-site-template | 90f9649d4130a5c0c5e105071f1338663a2e239b | [
"MIT"
] | 15 | 2018-07-09T01:11:39.000Z | 2022-03-23T19:12:29.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.blogIndex, name='blogindex'),
url(r'^detail/(?P<postid>.+)$', views.blogDetail, name='blogDetail'),
] | 24.625 | 73 | 0.659898 |
52eb61c6b32ef5e69f9b90389ab203e4e5724a55 | 3,992 | py | Python | subdomaindevserver.py | saltycrane/flask-subdomaindevserver | d44f5f9d061601b54da7e42edae21b2ad506bd1f | [
"BSD-3-Clause"
] | 9 | 2015-10-12T05:28:55.000Z | 2021-05-17T16:49:15.000Z | subdomaindevserver.py | saltycrane/flask-subdomaindevserver | d44f5f9d061601b54da7e42edae21b2ad506bd1f | [
"BSD-3-Clause"
] | null | null | null | subdomaindevserver.py | saltycrane/flask-subdomaindevserver | d44f5f9d061601b54da7e42edae21b2ad506bd1f | [
"BSD-3-Clause"
] | 3 | 2015-03-15T10:47:43.000Z | 2022-02-05T11:23:50.000Z | import subprocess
from werkzeug.serving import WSGIRequestHandler, run_simple
# global flag
reloadme = False
class SubdomainDispatcher(object):
"""Modified from http://flask.pocoo.org/docs/patterns/appdispatch/#dispatch-by-subdomain
WSGI middleware that allows for configuring a Flask app using the
sub... | 35.327434 | 92 | 0.650551 |
07e9e063a48e21955363b7a8b55b773a95ad2ed6 | 853 | py | Python | sql_gen/test/test_ui_utils.py | vecin2/em_automation | b65bc498cc7c366d06425e51aaf04b970d581050 | [
"MIT"
] | null | null | null | sql_gen/test/test_ui_utils.py | vecin2/em_automation | b65bc498cc7c366d06425e51aaf04b970d581050 | [
"MIT"
] | 84 | 2018-09-15T21:36:23.000Z | 2021-12-13T19:49:57.000Z | sql_gen/test/test_ui_utils.py | vecin2/em_automation | b65bc498cc7c366d06425e51aaf04b970d581050 | [
"MIT"
] | null | null | null | from sql_gen.ui import MenuOption
from sql_gen.ui.utils import match_options
def test_match_option_by_code():
first_option = MenuOption("1", "first option")
second_option = MenuOption("2", "second option")
option_list = [first_option, second_option]
assert first_option == match_options("1", option_lis... | 35.541667 | 74 | 0.739742 |
6a18df5e15c38b938aa46f6850b58259d8698553 | 13,402 | py | Python | linear_algebra/src/lib.py | Kate028/Python-1 | 1b0ac73da25915d4cb4d2754f7c12d1b81fc9f90 | [
"MIT"
] | 5 | 2022-01-19T10:41:37.000Z | 2022-02-22T17:26:15.000Z | linear_algebra/src/lib.py | Kate028/Python-1 | 1b0ac73da25915d4cb4d2754f7c12d1b81fc9f90 | [
"MIT"
] | null | null | null | linear_algebra/src/lib.py | Kate028/Python-1 | 1b0ac73da25915d4cb4d2754f7c12d1b81fc9f90 | [
"MIT"
] | 1 | 2020-12-13T01:00:35.000Z | 2020-12-13T01:00:35.000Z | """
Created on Mon Feb 26 14:29:11 2018
@author: Christian Bender
@license: MIT-license
This module contains some useful classes and functions for dealing
with linear algebra in python.
Overview:
- class Vector
- function zeroVector(dimension)
- function unitBasisVector(dimension,pos)
- function axpy(scalar,vector1... | 31.240093 | 85 | 0.545441 |
18d74f1d9475e991811f051c5ead3dedc394c3fa | 15,093 | py | Python | Lib/distutils/command/bdist_wininst.py | OlCe2/tauthon | 7a0386f03c601663617b5ee1d1bd49e32dc9998c | [
"CNRI-Python-GPL-Compatible"
] | 473 | 2017-02-03T04:03:02.000Z | 2022-02-12T17:44:25.000Z | Lib/distutils/command/bdist_wininst.py | OlCe2/tauthon | 7a0386f03c601663617b5ee1d1bd49e32dc9998c | [
"CNRI-Python-GPL-Compatible"
] | 70 | 2017-02-02T21:20:07.000Z | 2022-02-04T15:32:45.000Z | Lib/distutils/command/bdist_wininst.py | OlCe2/tauthon | 7a0386f03c601663617b5ee1d1bd49e32dc9998c | [
"CNRI-Python-GPL-Compatible"
] | 37 | 2017-02-11T21:02:34.000Z | 2020-11-16T10:51:45.000Z | """distutils.command.bdist_wininst
Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""
__revision__ = "$Id$"
import sys
import os
import string
from sysconfig import get_python_version
from distutils.core import Command
from distutils.dir_util import remove_tree
from distut... | 40.463807 | 91 | 0.565759 |
c76635339607257aec38b4e056eddd6882941c50 | 26,635 | py | Python | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | Vigilans/torch-mlir | 0bcc6d1075c4f9b12c177136294c8ebcec60f99f | [
"Apache-2.0"
] | null | null | null | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | Vigilans/torch-mlir | 0bcc6d1075c4f9b12c177136294c8ebcec60f99f | [
"Apache-2.0"
] | null | null | null | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | Vigilans/torch-mlir | 0bcc6d1075c4f9b12c177136294c8ebcec60f99f | [
"Apache-2.0"
] | null | null | null | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
"""Queries the pytorch op registry and generates ODS and CC sourc... | 47.990991 | 132 | 0.550742 |
169b843290d1bca8704a3c84672931ccfb375b53 | 3,604 | py | Python | main.py | siddharthksah/Meeting-Minutes-Creator-WebApp | abc3376cb63441569dae21d9693d15f8e55d763f | [
"MIT"
] | null | null | null | main.py | siddharthksah/Meeting-Minutes-Creator-WebApp | abc3376cb63441569dae21d9693d15f8e55d763f | [
"MIT"
] | null | null | null | main.py | siddharthksah/Meeting-Minutes-Creator-WebApp | abc3376cb63441569dae21d9693d15f8e55d763f | [
"MIT"
] | null | null | null | # @author Siddharth
# @website www.siddharthsah.com
# importing the necessary packages
import streamlit as st
import pyaudio
import wave
from summarizer import Summarizer
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
favicon = './favicon.png'
st.set_page_config... | 27.30303 | 155 | 0.655383 |
3ea6440f06bc531aad6ec7ce08b76f4c6870720f | 722 | py | Python | configs/default_gmm_config.py | shinypond/SB-FBSDE | 2cee924a21c1f92ecf9334ef827ead76c83511c4 | [
"Apache-2.0"
] | 24 | 2022-02-05T04:55:18.000Z | 2022-03-28T02:32:22.000Z | configs/default_gmm_config.py | shinypond/SB-FBSDE | 2cee924a21c1f92ecf9334ef827ead76c83511c4 | [
"Apache-2.0"
] | null | null | null | configs/default_gmm_config.py | shinypond/SB-FBSDE | 2cee924a21c1f92ecf9334ef827ead76c83511c4 | [
"Apache-2.0"
] | 4 | 2022-02-06T08:27:20.000Z | 2022-02-25T07:59:08.000Z | import ml_collections
def get_gmm_default_configs():
config = ml_collections.ConfigDict()
# training
config.training = training = ml_collections.ConfigDict()
config.seed = 42
config.T = 1.0
config.interval = 100
config.train_method = 'joint'
config.t0 = 0
config.problem_name = 'gmm'
config.num_itr ... | 21.878788 | 58 | 0.713296 |
e89d020e1ce9818adffaaf87a889177a040afe3a | 44,186 | py | Python | test/functional/p2p_compactblocks.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | null | null | null | test/functional/p2p_compactblocks.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | 1 | 2021-07-12T07:38:58.000Z | 2021-07-12T07:38:58.000Z | test/functional/p2p_compactblocks.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test compact blocks (BIP 152).
Version 1 compact blocks are pre-segwit (txids)
Version 2 compact block... | 47.924078 | 508 | 0.673268 |
30c0b11ed7e3468f510f0fca216892d33ed2f3ed | 3,078 | py | Python | test/python/pulse/test_samplers.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 11 | 2019-06-27T09:53:29.000Z | 2021-03-02T04:40:30.000Z | test/python/pulse/test_samplers.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 35 | 2019-03-07T02:09:22.000Z | 2022-03-22T19:55:15.000Z | test/python/pulse/test_samplers.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 4 | 2019-08-05T15:35:33.000Z | 2020-09-18T18:55:02.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 32.4 | 77 | 0.658545 |
84e7ca2b3de2b96d7d93882c041268e5d9e8c01c | 832 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 3.4.0
# Copyright (C) 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import (absolute_import, division, print_function)
_... | 22.486486 | 92 | 0.715144 |
2676f6376514c9ac6b71214a5ce76c1c314447da | 1,818 | py | Python | glue_vispy_viewers/extern/vispy/visuals/regular_polygon.py | jzuhone/glue-vispy-viewers | d940705f4ba95f8d7a9a74d37fb68c71080b490a | [
"BSD-2-Clause"
] | 3 | 2018-05-09T17:55:53.000Z | 2019-07-22T09:14:41.000Z | glue_vispy_viewers/extern/vispy/visuals/regular_polygon.py | jzuhone/glue-vispy-viewers | d940705f4ba95f8d7a9a74d37fb68c71080b490a | [
"BSD-2-Clause"
] | 9 | 2017-04-07T01:44:15.000Z | 2018-12-16T20:47:08.000Z | graphViz/vispy/visuals/regular_polygon.py | onecklam/ethereum-graphviz | 6993accf0cb85e23013bf7ae6b04145724a6dbd2 | [
"Apache-2.0"
] | 1 | 2021-09-15T08:52:26.000Z | 2021-09-15T08:52:26.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
RegularPolygonVisual visual based on EllipseVisual
"""
from __future__ import division
from .ellipse import EllipseVisual
class RegularPolygonVisual(EllipseVisual):
... | 30.3 | 79 | 0.590209 |
64b0ec2c7ff65913ffc1c93d134dbc75a16ebb0d | 792 | py | Python | audio_controller/api_handler/migrations/0001_initial.py | Maxning1/MusicBox | 19b35569da31efa2d9e62aae83ddbb028a4032f7 | [
"MIT"
] | 1 | 2021-02-07T23:04:21.000Z | 2021-02-07T23:04:21.000Z | audio_controller/api_handler/migrations/0001_initial.py | Maxning1/MusicBox | 19b35569da31efa2d9e62aae83ddbb028a4032f7 | [
"MIT"
] | null | null | null | audio_controller/api_handler/migrations/0001_initial.py | Maxning1/MusicBox | 19b35569da31efa2d9e62aae83ddbb028a4032f7 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-27 04:41
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Room',
fields=[
('id', models.AutoField(aut... | 30.461538 | 114 | 0.583333 |
93d49bc3207cd11f85400fbb542fa4615974f3fe | 1,111 | py | Python | homework/all_pairs_shortest_path.py | dherault/Coursera_algorithms | 592cf999764afb7583240c77a0b0c4dc5ad4fb03 | [
"Unlicense"
] | 12 | 2017-05-16T07:29:09.000Z | 2021-02-24T15:26:25.000Z | homework/all_pairs_shortest_path.py | dherault/Coursera_algorithms | 592cf999764afb7583240c77a0b0c4dc5ad4fb03 | [
"Unlicense"
] | null | null | null | homework/all_pairs_shortest_path.py | dherault/Coursera_algorithms | 592cf999764afb7583240c77a0b0c4dc5ad4fb03 | [
"Unlicense"
] | 13 | 2017-05-24T20:04:25.000Z | 2021-09-22T17:41:32.000Z | #!/usr/bin/python3.5
import math
# Floyd-Warshall Algorithm
def floyd_warshall(n, edges):
range_n = range(n)
A = [[[0 if i == j else math.inf] for j in range_n] for i in range_n]
for (s, t, c) in edges:
A[s - 1][t - 1][0] = c
# print(A)
for k in range(1, n):
print("k:", k, "/", n... | 24.688889 | 83 | 0.542754 |
a132f100c14bfc125300b3edf4ed770534c05e05 | 1,534 | py | Python | 30_Stack with minimum value/by_stack.py | brianchiang-tw/CodingInterviews | f9e2e26571f56960b36c98d286654c509b1a5b4c | [
"MIT"
] | null | null | null | 30_Stack with minimum value/by_stack.py | brianchiang-tw/CodingInterviews | f9e2e26571f56960b36c98d286654c509b1a5b4c | [
"MIT"
] | null | null | null | 30_Stack with minimum value/by_stack.py | brianchiang-tw/CodingInterviews | f9e2e26571f56960b36c98d286654c509b1a5b4c | [
"MIT"
] | null | null | null | # first parameter is element, which stands for current element
# second parameter is min_val, which stands for global minimum value of stack
from collections import namedtuple
Entry = namedtuple('Entry', 'element min_val')
class MinStack:
def __init__(self):
"""
initialize your data structure he... | 20.72973 | 77 | 0.571056 |
e4bb9cac732ec6a4b805c168840d21801fda7d4e | 59 | py | Python | lambda-functions/telemetry-loader/telemetry_loader/config.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 17 | 2022-01-10T11:01:50.000Z | 2022-03-25T03:21:08.000Z | lambda-functions/telemetry-loader/telemetry_loader/config.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 1 | 2022-01-13T14:28:47.000Z | 2022-01-13T14:28:47.000Z | lambda-functions/telemetry-loader/telemetry_loader/config.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 7 | 2022-01-07T03:58:10.000Z | 2022-03-24T07:38:20.000Z | import contextvars
s3_var = contextvars.ContextVar('s3')
| 11.8 | 37 | 0.779661 |
c090960dc3e5c1c03f5c4673c9a85eacde9e8a29 | 19,757 | py | Python | pennylane/grouping/utils.py | aglitoiu/pennylane | fd99be754d55bbb919aadbbbdff70e40fbe3bcbf | [
"Apache-2.0"
] | null | null | null | pennylane/grouping/utils.py | aglitoiu/pennylane | fd99be754d55bbb919aadbbbdff70e40fbe3bcbf | [
"Apache-2.0"
] | null | null | null | pennylane/grouping/utils.py | aglitoiu/pennylane | fd99be754d55bbb919aadbbbdff70e40fbe3bcbf | [
"Apache-2.0"
] | 1 | 2021-07-11T11:45:14.000Z | 2021-07-11T11:45:14.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies 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... | 38.663405 | 106 | 0.654907 |
58176fe48d047bbafba77d83e51cf56e467476be | 16,501 | py | Python | train_simul.py | AzR919/Implicit-Competitive-Regularization | d69b66b1843cf72d94a1b0957aa30eb34e46af53 | [
"Apache-2.0"
] | 1 | 2021-03-28T14:21:26.000Z | 2021-03-28T14:21:26.000Z | train_simul.py | AzR919/Implicit-Competitive-Regularization | d69b66b1843cf72d94a1b0957aa30eb34e46af53 | [
"Apache-2.0"
] | null | null | null | train_simul.py | AzR919/Implicit-Competitive-Regularization | d69b66b1843cf72d94a1b0957aa30eb34e46af53 | [
"Apache-2.0"
] | null | null | null | import os
import time
import yaml
import torch
import torch.nn as nn
import torchvision.utils as vutils
from torch.optim.sgd import SGD
from torch.optim.rmsprop import RMSprop
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
from GANs import dc_G, dc_D
from optims import ACG... | 44.238606 | 106 | 0.53524 |
d3f76b3be7530cd536dfd5ab5ac600e2f16bb78a | 6,962 | py | Python | ares/analysis/DerivedQuantities.py | astrojhgu/ares | 42008c8e4bf79f0b000cc833e02a86510bce7611 | [
"MIT"
] | 1 | 2019-01-04T15:13:18.000Z | 2019-01-04T15:13:18.000Z | ares/analysis/DerivedQuantities.py | astrojhgu/ares | 42008c8e4bf79f0b000cc833e02a86510bce7611 | [
"MIT"
] | null | null | null | ares/analysis/DerivedQuantities.py | astrojhgu/ares | 42008c8e4bf79f0b000cc833e02a86510bce7611 | [
"MIT"
] | null | null | null | """
DerivedQuantities.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Thu Feb 12 14:13:19 MST 2015
Description:
"""
import re, time
import numpy as np
from ..physics import Cosmology
from collections import namedtuple
from ..physics.Constants import nu_0_mhz
def total_heat(da... | 28.650206 | 77 | 0.546969 |
ef6f4215470eed362523ecf98c7c1ef13eb24370 | 27,657 | py | Python | docker/generic/start_proxy.py | qiwzhang/esp-v2 | 99e280faca23eddb4587ba427f4ab411242b17c9 | [
"Apache-2.0"
] | null | null | null | docker/generic/start_proxy.py | qiwzhang/esp-v2 | 99e280faca23eddb4587ba427f4ab411242b17c9 | [
"Apache-2.0"
] | null | null | null | docker/generic/start_proxy.py | qiwzhang/esp-v2 | 99e280faca23eddb4587ba427f4ab411242b17c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 36.631788 | 150 | 0.653686 |
1cdc0bb1fb78cff57b0f1d70e696a91203aac78d | 1,248 | py | Python | util.py | Pypperoni/src | d3bee7a5eecbc4b94227b39f0ec8a0d07bf4e09c | [
"MIT"
] | 80 | 2018-09-06T18:36:48.000Z | 2022-03-08T11:57:15.000Z | util.py | Pypperoni/src | d3bee7a5eecbc4b94227b39f0ec8a0d07bf4e09c | [
"MIT"
] | 7 | 2020-04-12T17:30:14.000Z | 2021-08-03T01:45:52.000Z | util.py | Pypperoni/src | d3bee7a5eecbc4b94227b39f0ec8a0d07bf4e09c | [
"MIT"
] | 17 | 2018-09-06T21:04:04.000Z | 2022-01-24T20:35:59.000Z | # Copyright (c) Pypperoni
#
# Pypperoni is licensed under the MIT License; you may
# not use it except in compliance with the License.
#
# You should have received a copy of the License with
# this source code under the name "LICENSE.txt". However,
# you may obtain a copy of the License on our GitHub here:
# https://gi... | 27.130435 | 62 | 0.704327 |
391ebf895cab1463539e63590b9bf3f2944ad9a3 | 149 | py | Python | authapp/apps.py | MSFC-NASA/NasaPD | 5851b63f57d2820f48f579bf71ffa040c23b755e | [
"MIT"
] | null | null | null | authapp/apps.py | MSFC-NASA/NasaPD | 5851b63f57d2820f48f579bf71ffa040c23b755e | [
"MIT"
] | null | null | null | authapp/apps.py | MSFC-NASA/NasaPD | 5851b63f57d2820f48f579bf71ffa040c23b755e | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AuthappConfig(AppConfig):
name = 'authapp'
def ready(self):
from . import signals
| 16.555556 | 34 | 0.644295 |
ea618536814857d53631288241fdcc3e5e092f57 | 42,025 | py | Python | airflow/providers/apache/hive/hooks/hive.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 27 | 2019-02-25T14:20:36.000Z | 2022-03-22T09:35:13.000Z | airflow/providers/apache/hive/hooks/hive.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 200 | 2019-01-09T15:33:06.000Z | 2022-01-12T09:13:42.000Z | airflow/providers/apache/hive/hooks/hive.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 14 | 2019-06-25T17:08:29.000Z | 2022-03-29T13:25:53.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... | 39.16589 | 107 | 0.58508 |
426a0afed52eb39defb55be1f287b997228532ed | 532 | py | Python | var/spack/repos/builtin/packages/perl-io-sessiondata/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/perl-io-sessiondata/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/perl-io-sessiondata/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 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 *
class PerlIoSessiondata(PerlPackage):
"""A wrapper around a single IO::Socket object"""
hom... | 33.25 | 93 | 0.727444 |
5db8d579682b2df8d500461c39835ab9394fa5a8 | 8,351 | py | Python | gan_cifar.py | ywangomr/TryWG | 10dc103e1dad1a9531c2e79446dfbab37a741b21 | [
"MIT"
] | null | null | null | gan_cifar.py | ywangomr/TryWG | 10dc103e1dad1a9531c2e79446dfbab37a741b21 | [
"MIT"
] | null | null | null | gan_cifar.py | ywangomr/TryWG | 10dc103e1dad1a9531c2e79446dfbab37a741b21 | [
"MIT"
] | null | null | null | import os, sys
sys.path.append(os.getcwd())
import time
import numpy as np
import tensorflow as tf
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv2d
import tflib.ops.batchnorm
import tflib.ops.deconv2d
import tflib.save_images
import tflib.cifar10
import tflib.inception_score
import tflib.plot
# D... | 37.959091 | 131 | 0.670459 |
80758153e7e130b114189b130406dbd57d34cb62 | 468 | py | Python | RDF/graphs/themes.landportal.info/themeGeneration.py | landportal/data | 465c4ff4ec71bbb55bf74643561fb8284b46211b | [
"MIT"
] | null | null | null | RDF/graphs/themes.landportal.info/themeGeneration.py | landportal/data | 465c4ff4ec71bbb55bf74643561fb8284b46211b | [
"MIT"
] | 4 | 2016-11-23T16:12:54.000Z | 2021-06-07T11:47:36.000Z | RDF/graphs/themes.landportal.info/themeGeneration.py | landportal/data | 465c4ff4ec71bbb55bf74643561fb8284b46211b | [
"MIT"
] | 1 | 2017-02-02T12:46:20.000Z | 2017-02-02T12:46:20.000Z | from rdflib import Graph
import time
g = Graph()
themesIds=["7343", "7344", "7345", "7346", "7347", "7348", "7349", "7350", "7351" , "7352", "7508","8472", "8643", "8641" ]
for themeId in themesIds:
url = "https://landportal.org/taxonomy_term/"+str(themeId)+".rdf"
g.parse(url)
print len(g)
# save t... | 27.529412 | 123 | 0.638889 |
4b0ae4fef9e7dae3b3259d5e11c3697d19824ec7 | 7,080 | py | Python | TF-FROST/scripts/create_prototypicals.py | EtienneDavid/FROST | 1cea124d69f07e3ac7e3ad074059d29c0849254c | [
"MIT"
] | 38 | 2020-06-12T08:07:41.000Z | 2021-03-28T08:25:43.000Z | TF-FROST/scripts/create_prototypicals.py | yogsin/FROST | 1cea124d69f07e3ac7e3ad074059d29c0849254c | [
"MIT"
] | 1 | 2020-06-18T14:02:20.000Z | 2020-06-18T22:16:37.000Z | TF-FROST/scripts/create_prototypicals.py | yogsin/FROST | 1cea124d69f07e3ac7e3ad074059d29c0849254c | [
"MIT"
] | 8 | 2020-07-28T11:39:49.000Z | 2021-03-22T01:38:24.000Z | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 42.39521 | 120 | 0.577684 |
78fa6083733df87c1209c1c25032232dfa0cc4e4 | 29,043 | py | Python | mars/learn/neighbors/_faiss.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | 2 | 2019-03-29T04:11:10.000Z | 2020-07-08T10:19:54.000Z | mars/learn/neighbors/_faiss.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | mars/learn/neighbors/_faiss.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.76723 | 114 | 0.606239 |
14ea46e06fb8cd441257a99e31c1987a4e2a6777 | 49,185 | py | Python | pydub/audio_segment.py | Calvin-Xu/anki_forvo_dl | d0b0f34f922f350b2b061a70f33850d867b98c39 | [
"MIT"
] | 5,417 | 2015-01-02T12:28:04.000Z | 2022-03-31T22:50:22.000Z | pydub/audio_segment.py | Calvin-Xu/anki_forvo_dl | d0b0f34f922f350b2b061a70f33850d867b98c39 | [
"MIT"
] | 503 | 2015-01-28T00:56:06.000Z | 2022-03-31T13:34:29.000Z | Lib/site-packages/pydub/audio_segment.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 951 | 2015-01-21T11:54:22.000Z | 2022-03-31T16:14:43.000Z | from __future__ import division
import array
import os
import subprocess
from tempfile import TemporaryFile, NamedTemporaryFile
import wave
import sys
import struct
from .logging_utils import log_conversion, log_subprocess_output
from .utils import mediainfo_json, fsdecode
import base64
from collections import namedtu... | 35.132143 | 143 | 0.571089 |
456b3fa515d79c0f0afc14b1b4b770ba762c4b2e | 12,213 | py | Python | salt/modules/mount.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | 1 | 2019-03-16T12:41:43.000Z | 2019-03-16T12:41:43.000Z | salt/modules/mount.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | null | null | null | salt/modules/mount.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | null | null | null | '''
Salt module to manage unix mounts and the fstab file
'''
# Import python libs
import os
import re
import logging
# Import salt libs
import salt.utils
from salt._compat import string_types
from salt.utils import which as _which
from salt.exceptions import CommandNotFoundError, CommandExecutionError
# Set up logge... | 28.205543 | 79 | 0.485794 |
203fab4c7742be1c01f6d5c6b1eb8106b28c0509 | 7,962 | py | Python | module/subu-1/subu-mk.py | Reasoning-Technology/subu | 719ddce6201ba73b138d7957ce8167e855a13255 | [
"MIT"
] | null | null | null | module/subu-1/subu-mk.py | Reasoning-Technology/subu | 719ddce6201ba73b138d7957ce8167e855a13255 | [
"MIT"
] | null | null | null | module/subu-1/subu-mk.py | Reasoning-Technology/subu | 719ddce6201ba73b138d7957ce8167e855a13255 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# see the help option for syntax
# this script must be run from root or sudo
#
# on Fedora 29 os.getresuid returned all zeros for a script run from sudo.
# Hence, I am using the environment variable SUDO_USER
import getpass
import os
import sys
import libuser
from __future__ import print_function
co... | 26.54 | 96 | 0.615423 |
cf26d31323d3f0585ac798aba6f5ef2537bf9b0d | 2,979 | py | Python | sandbox/rescue-face.py | CM000n/VirtualChoir | c19ab925c0924734b7292e8af8f6aeeca3cf10a5 | [
"MIT"
] | 15 | 2020-10-12T16:46:23.000Z | 2022-03-23T20:19:04.000Z | sandbox/rescue-face.py | CM000n/VirtualChoir | c19ab925c0924734b7292e8af8f6aeeca3cf10a5 | [
"MIT"
] | 2 | 2021-01-20T15:08:58.000Z | 2021-03-15T22:00:50.000Z | sandbox/rescue-face.py | CM000n/VirtualChoir | c19ab925c0924734b7292e8af8f6aeeca3cf10a5 | [
"MIT"
] | 6 | 2021-01-20T08:58:49.000Z | 2021-06-01T23:47:42.000Z | #!/usr/bin/env python3
# for tracks that don't time align (presumably because the reference
# track bogged somehow during playback and performance)
# load a text file that lists a set of time deltas and where they
# should apply. then read the audio and vidoe tracks and make the
# appropriate corrections.
import ar... | 31.03125 | 110 | 0.693857 |
fc3b320066a34737a2ca99e8cbaba32c546cf400 | 519 | py | Python | lib/__init__.py | TWISTproject/electrum-twist | 4d72941c6eaabb9d0b9d351813cc9b1b86b0e699 | [
"MIT"
] | null | null | null | lib/__init__.py | TWISTproject/electrum-twist | 4d72941c6eaabb9d0b9d351813cc9b1b86b0e699 | [
"MIT"
] | null | null | null | lib/__init__.py | TWISTproject/electrum-twist | 4d72941c6eaabb9d0b9d351813cc9b1b86b0e699 | [
"MIT"
] | null | null | null | from version import ELECTRUM_VERSION
from util import format_satoshis, print_msg, print_error, set_verbosity
from wallet import Synchronizer, WalletStorage, Wallet, Imported_Wallet
from coinchooser import COIN_CHOOSERS
from network import Network, pick_random_server
from interface import Connection, Interface
from simp... | 39.923077 | 71 | 0.872832 |
d709a89f7b2361b2421c55384da142d98ad3313b | 1,127 | py | Python | flex-grid-sizer.py | appletxm/wx-python | 9e9b2095d04fad4ed6907a93e0931f66e9d5386f | [
"MIT"
] | null | null | null | flex-grid-sizer.py | appletxm/wx-python | 9e9b2095d04fad4ed6907a93e0931f66e9d5386f | [
"MIT"
] | null | null | null | flex-grid-sizer.py | appletxm/wx-python | 9e9b2095d04fad4ed6907a93e0931f66e9d5386f | [
"MIT"
] | null | null | null | import wx
class Example(wx.Frame):
def __init__(self, parent, title):
super(Example, self).__init__(parent, title = title, size = (300, 250))
self.InitUI()
self.Centre()
self.Show()
def InitUI(self):
panel = wx.Panel(self)
hbox = wx.... | 28.897436 | 78 | 0.576752 |
27d3301f59ebdac58abd4949aa675eaef8022d73 | 1,628 | py | Python | pandapower/test/test_simple_pandapower_test_networks.py | lucassm/cigre-montecarlo | fd354b9c3ade460b46687ba312f51212dad17151 | [
"MIT"
] | null | null | null | pandapower/test/test_simple_pandapower_test_networks.py | lucassm/cigre-montecarlo | fd354b9c3ade460b46687ba312f51212dad17151 | [
"MIT"
] | null | null | null | pandapower/test/test_simple_pandapower_test_networks.py | lucassm/cigre-montecarlo | fd354b9c3ade460b46687ba312f51212dad17151 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy
# System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import pytest
import pandapower as pp
i... | 28.068966 | 98 | 0.682432 |
0585747ed1c7009c1acc660830bbae9ed0520306 | 420 | py | Python | wordsiv/cli/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | 1 | 2022-03-25T19:31:00.000Z | 2022-03-25T19:31:00.000Z | wordsiv/cli/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | 19 | 2021-05-09T15:49:35.000Z | 2021-07-01T15:56:44.000Z | wordsiv/cli/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | null | null | null | import typer
from pathlib import Path
import shutil
import os
from os.path import basename
import build
from ..about import __version__
from ..utilities import installed_source_modules
from . import package
app = typer.Typer()
app.add_typer(package.app, name="package")
@app.command()
def download(data_package: str)... | 17.5 | 48 | 0.759524 |
bf1c0b086c616a7e363211d6f48e98e2915dc290 | 2,684 | py | Python | src/charma/updater/handlers/language.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-01-16T23:36:10.000Z | 2020-01-16T23:36:10.000Z | src/charma/updater/handlers/language.py | mononobi/imovie-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 24 | 2020-06-08T18:27:04.000Z | 2021-06-06T12:01:39.000Z | src/charma/updater/handlers/language.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-12-20T05:29:04.000Z | 2020-12-20T05:29:04.000Z | # -*- coding: utf-8 -*-
"""
updater handlers language module.
"""
from charma.updater.decorators import updater
from charma.updater.enumerations import UpdaterCategoryEnum
from charma.updater.handlers.base import UpdaterBase
class LanguageUpdaterBase(UpdaterBase):
"""
language updater base class.
"""
... | 30.850575 | 95 | 0.58383 |
3f588df44f91c2a9a44cb8c6526ef124ebca4455 | 1,175 | py | Python | tests/linter/test_gdlint_ignore.py | dzil123/godot-gdscript-toolkit | d3687f66390937a4fefd90a508a4899d56fc9f7c | [
"MIT"
] | 361 | 2019-12-01T23:38:13.000Z | 2022-03-30T22:37:16.000Z | tests/linter/test_gdlint_ignore.py | dzil123/godot-gdscript-toolkit | d3687f66390937a4fefd90a508a4899d56fc9f7c | [
"MIT"
] | 143 | 2019-12-21T16:56:14.000Z | 2022-03-20T17:52:24.000Z | tests/linter/test_gdlint_ignore.py | dzil123/godot-gdscript-toolkit | d3687f66390937a4fefd90a508a4899d56fc9f7c | [
"MIT"
] | 36 | 2019-12-21T19:20:12.000Z | 2022-03-17T10:50:43.000Z | import pytest
from .common import simple_ok_check, simple_nok_check
# fmt: off
@pytest.mark.parametrize('code', [
"""
# gdlint: ignore=function-name
func some_Button_pressed():
pass
""",
"""
# gdlint:ignore = function-name
func SomeName():
pass
""",
"""
# gdlint:ignore = function-name, function-argument-name... | 19.262295 | 62 | 0.714043 |
70cf014707fe2356063c8eb7180f383dc3c07be8 | 2,635 | py | Python | rp2biosensor/Utils.py | kenzadja/rp2biosensor | a97b0e22afb3441cb2175ae3e2f64f8862049e3c | [
"MIT"
] | null | null | null | rp2biosensor/Utils.py | kenzadja/rp2biosensor | a97b0e22afb3441cb2175ae3e2f64f8862049e3c | [
"MIT"
] | null | null | null | rp2biosensor/Utils.py | kenzadja/rp2biosensor | a97b0e22afb3441cb2175ae3e2f64f8862049e3c | [
"MIT"
] | null | null | null | from pathlib import Path
from distutils import dir_util
from tempfile import TemporaryDirectory
def write(args, template_dir, json_str: str):
if args.otype == 'dir':
# Prepare output dir
outdir_path = Path(args.opath).resolve()
outdir_path.mkdir(parents=True, exist_ok=True)
# Copy ... | 39.328358 | 91 | 0.617078 |
06602ea6154086a629d1a8fee1c0dd46e5f45254 | 2,565 | py | Python | pontoon/pretranslation/tests/test_pretranslate.py | Tratty/pontoon | ecb903d72f9274f02137b16669cc3c5859f6329c | [
"BSD-3-Clause"
] | 3 | 2020-01-27T12:26:20.000Z | 2022-02-03T09:56:02.000Z | pontoon/pretranslation/tests/test_pretranslate.py | texnoman/pontoon-src | 6b40ac229605e99966c3bdd1510b772c89d4de24 | [
"BSD-3-Clause"
] | 9 | 2021-03-10T21:34:51.000Z | 2022-02-19T03:30:06.000Z | pontoon/pretranslation/tests/test_pretranslate.py | texnoman/pontoon-src | 6b40ac229605e99966c3bdd1510b772c89d4de24 | [
"BSD-3-Clause"
] | 4 | 2020-01-26T21:28:43.000Z | 2021-06-10T15:25:19.000Z | from __future__ import absolute_import
from mock import patch
import pytest
from pontoon.base.models import User
from pontoon.pretranslation.pretranslate import get_translations
from pontoon.test.factories import (
EntityFactory,
TranslationMemoryFactory,
)
@patch("pontoon.pretranslation.pretranslate.get_g... | 33.75 | 87 | 0.695906 |
86c155ea038514e87cfff2f3b4a0e86be6872cc4 | 8,066 | py | Python | registration_mail/eval_rl.py | JiazeWang/reagent | b92c18a339e009504ca51ba5101f8c171b88721e | [
"MIT"
] | null | null | null | registration_mail/eval_rl.py | JiazeWang/reagent | b92c18a339e009504ca51ba5101f8c171b88721e | [
"MIT"
] | null | null | null | registration_mail/eval_rl.py | JiazeWang/reagent | b92c18a339e009504ca51ba5101f8c171b88721e | [
"MIT"
] | null | null | null | import torch
import os
import argparse
from tqdm import tqdm
from prefetch_generator import BackgroundGenerator
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)).replace("/registration_mail", ""))
import config as cfg
cfg.BENCHMARK = True
from environment import environment as env
from environment ... | 52.03871 | 119 | 0.604389 |
5bc645ac8341a755d28319060b7a883a2381866d | 10,506 | py | Python | google/cloud/tasks_v2/services/cloud_tasks/pagers.py | renovate-bot/python-tasks | 481ee6ceb7851e6a7e815b91cfee3d119381cb19 | [
"Apache-2.0"
] | 39 | 2020-04-17T09:54:54.000Z | 2022-03-23T12:28:07.000Z | google/cloud/tasks_v2/services/cloud_tasks/pagers.py | renovate-bot/python-tasks | 481ee6ceb7851e6a7e815b91cfee3d119381cb19 | [
"Apache-2.0"
] | 80 | 2020-02-04T00:48:43.000Z | 2022-03-31T22:59:41.000Z | google/cloud/tasks_v2/services/cloud_tasks/pagers.py | renovate-bot/python-tasks | 481ee6ceb7851e6a7e815b91cfee3d119381cb19 | [
"Apache-2.0"
] | 9 | 2020-02-06T01:45:11.000Z | 2021-04-14T08:38:08.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.734266 | 87 | 0.661051 |
a157713db4ae895d810b550a244b3e7264fc57fd | 205 | py | Python | audit_inspection/audit_inspection/doctype/check_list/test_check_list.py | sharpec/checklist-erpnext | fcdab8b32519007b101f0f4e48002904667efa9d | [
"MIT"
] | null | null | null | audit_inspection/audit_inspection/doctype/check_list/test_check_list.py | sharpec/checklist-erpnext | fcdab8b32519007b101f0f4e48002904667efa9d | [
"MIT"
] | null | null | null | audit_inspection/audit_inspection/doctype/check_list/test_check_list.py | sharpec/checklist-erpnext | fcdab8b32519007b101f0f4e48002904667efa9d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Texol and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestCheckList(unittest.TestCase):
pass
| 18.636364 | 44 | 0.765854 |
02f2e1299c3bade32e857dc65eb25b186597ff43 | 3,854 | py | Python | tango_nano/step6/test_ring_step6.py | fjullien/migen_litex_tutorials | ce128a94fc3ddae534c39430f10fb4caa72d1cab | [
"MIT"
] | null | null | null | tango_nano/step6/test_ring_step6.py | fjullien/migen_litex_tutorials | ce128a94fc3ddae534c39430f10fb4caa72d1cab | [
"MIT"
] | null | null | null | tango_nano/step6/test_ring_step6.py | fjullien/migen_litex_tutorials | ce128a94fc3ddae534c39430f10fb4caa72d1cab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from random import *
from migen import *
from ring import *
current_led = 0
# -------------------------------------------------------
# - This functions counts how long dut.do stays high
# -------------------------------------------------------
def get_do_high_length(dut):
len = 0
# wa... | 31.590164 | 86 | 0.475091 |
a8ef954946e6f220fba77d1414d95dfac2fbe9a4 | 548 | py | Python | core/bot/handlers/cancel.py | osipov-andrey/control_bot | 4e82da2eee762dd416db42091532f3e17f2dc7e7 | [
"MIT"
] | 2 | 2021-04-24T08:56:15.000Z | 2022-01-26T08:22:43.000Z | core/bot/handlers/cancel.py | osipov-andrey/control_bot | 4e82da2eee762dd416db42091532f3e17f2dc7e7 | [
"MIT"
] | null | null | null | core/bot/handlers/cancel.py | osipov-andrey/control_bot | 4e82da2eee762dd416db42091532f3e17f2dc7e7 | [
"MIT"
] | null | null | null | from aiogram import types
from aiogram.dispatcher import FSMContext
from core.bot.telegram_api import telegram_api_dispatcher
@telegram_api_dispatcher.message_handler(commands=["cancel"], state="*")
async def cancel(message: types.Message, state: FSMContext):
"""Reset current state"""
if (
await stat... | 34.25 | 93 | 0.717153 |
f66d9577744180122037a5f7178698ef18caacd0 | 789 | py | Python | ev3dev2simulator/obstacle/arm_floor.py | jchmrt/ev3dev2simulator | 3a8968162d1658a82860a613caf9986c5428b124 | [
"MIT"
] | 2 | 2020-07-14T01:31:14.000Z | 2021-02-22T19:14:12.000Z | ev3dev2simulator/obstacle/arm_floor.py | jchmrt/ev3dev2simulator | 3a8968162d1658a82860a613caf9986c5428b124 | [
"MIT"
] | 19 | 2020-02-16T08:11:23.000Z | 2020-12-10T10:06:36.000Z | ev3dev2simulator/obstacle/arm_floor.py | jchmrt/ev3dev2simulator | 3a8968162d1658a82860a613caf9986c5428b124 | [
"MIT"
] | 10 | 2020-03-02T08:37:29.000Z | 2022-03-06T03:49:07.000Z | """
The arm_floor module contains the class ArmFloor. A class representing the ground of the sidebar arm.
"""
from arcade import create_rectangle
class ArmFloor:
"""
The class ArmFloor represents ground in the sidebar below an arm as seen from the side.
"""
def __init__(self, width, height, color):
... | 25.451613 | 101 | 0.619772 |
f0ad8b04b39a2d12b6f21aeafcbaa009e20d54b7 | 1,785 | py | Python | streams/migrations/0001_initial.py | xflows/textflows | 7fd99cebe29bcb25ea21b8bfb7dca2d0b663ea2b | [
"MIT"
] | 18 | 2015-07-29T07:14:41.000Z | 2021-05-31T16:10:49.000Z | streams/migrations/0001_initial.py | xflows/textflows | 7fd99cebe29bcb25ea21b8bfb7dca2d0b663ea2b | [
"MIT"
] | null | null | null | streams/migrations/0001_initial.py | xflows/textflows | 7fd99cebe29bcb25ea21b8bfb7dca2d0b663ea2b | [
"MIT"
] | 8 | 2016-02-05T10:13:40.000Z | 2020-11-10T14:36:31.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-26 09:15
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import picklefield.fields
class Migration(migrations.Migration):
initial = True
dependen... | 42.5 | 144 | 0.643697 |
a063637fe3c0ec29b1400b9df8b6bcdc68670bc1 | 6,438 | py | Python | tests/modules/test_shellexec.py | gerardorf/taurus | 610872b4cf70af31d79a346db1aebd3466310d77 | [
"Apache-2.0"
] | 1 | 2019-01-15T17:23:58.000Z | 2019-01-15T17:23:58.000Z | tests/modules/test_shellexec.py | gerardorf/taurus | 610872b4cf70af31d79a346db1aebd3466310d77 | [
"Apache-2.0"
] | null | null | null | tests/modules/test_shellexec.py | gerardorf/taurus | 610872b4cf70af31d79a346db1aebd3466310d77 | [
"Apache-2.0"
] | null | null | null | import os
import time
from subprocess import CalledProcessError
from bzt.engine import Service
from bzt.modules.shellexec import ShellExecutor
from bzt.utils import BetterDict, is_windows, temp_file
from tests import BZTestCase
from tests.mocks import EngineEmul
class TaskTestCase(BZTestCase):
def setUp(self):
... | 37.870588 | 116 | 0.585741 |
bced7f167185a0651351918b669a733b216fb2fd | 1,106 | py | Python | tbot/tbot.py | vlizanae/annxious-bot | 5ba4b02fb2dc6f51d355cc7ff6e1f37cb0934f28 | [
"MIT"
] | 1 | 2018-10-26T03:07:33.000Z | 2018-10-26T03:07:33.000Z | tbot/tbot.py | vlizanae/annxious-bot | 5ba4b02fb2dc6f51d355cc7ff6e1f37cb0934f28 | [
"MIT"
] | null | null | null | tbot/tbot.py | vlizanae/annxious-bot | 5ba4b02fb2dc6f51d355cc7ff6e1f37cb0934f28 | [
"MIT"
] | null | null | null | from telegram import Bot
from telegram.ext import Updater, CommandHandler
from telegram.utils.request import Request
from config import annxious_tbot_token
from .views import start, help, userid, status
class TelegramBot:
def __init__(self, db):
self.bot = Bot(
token=annxious_tbot_token,
... | 29.105263 | 86 | 0.638336 |
2b2236a5b616ae9c1bf8112f51e452577c866510 | 1,733 | py | Python | RetinaFaceAntiCov/test.py | intflow/insightface | 6aa71aed9060f6f9b1221a8d3b9a7a5c1f0e64e4 | [
"MIT"
] | null | null | null | RetinaFaceAntiCov/test.py | intflow/insightface | 6aa71aed9060f6f9b1221a8d3b9a7a5c1f0e64e4 | [
"MIT"
] | null | null | null | RetinaFaceAntiCov/test.py | intflow/insightface | 6aa71aed9060f6f9b1221a8d3b9a7a5c1f0e64e4 | [
"MIT"
] | null | null | null | import cv2
import sys
import numpy as np
import datetime
import os
import glob
from retinaface_cov import RetinaFaceCoV
thresh = 0.8
mask_thresh = 0.2
scales = [640, 1080]
count = 1
gpuid = 0
#detector = RetinaFaceCoV('./model/mnet_cov1', 0, gpuid, 'net3')
detector = RetinaFaceCoV('./model/mnet_cov2', 0, gpuid, 'net... | 26.257576 | 112 | 0.682631 |
ed42920347d6d5a9b7363f3b42825a1970a5f10d | 3,422 | py | Python | doc/examples/plot_gabors_from_astronaut.py | JDWarner/scikit-image | 6f016c9087d1a3d194da82a8328bec30374fc5a9 | [
"BSD-3-Clause"
] | null | null | null | doc/examples/plot_gabors_from_astronaut.py | JDWarner/scikit-image | 6f016c9087d1a3d194da82a8328bec30374fc5a9 | [
"BSD-3-Clause"
] | null | null | null | doc/examples/plot_gabors_from_astronaut.py | JDWarner/scikit-image | 6f016c9087d1a3d194da82a8328bec30374fc5a9 | [
"BSD-3-Clause"
] | 1 | 2019-12-13T15:25:06.000Z | 2019-12-13T15:25:06.000Z | """
============================================================
Gabors / Primary Visual Cortex "Simple Cells" from an Image
============================================================
How to build a (bio-plausible) "sparse" dictionary (or 'codebook', or
'filterbank') for e.g. image classification without any fancy m... | 37.195652 | 75 | 0.717709 |
f56c9b20da793eb7dfc4eeb0b826b4fb03b931d3 | 3,126 | py | Python | backend/venv/lib/python3.6/site-packages/test/grammar/semantics_test.py | HalmonLui/square-hackathon | 62d5be7a229f9e39e27a546c164facd779d28aa4 | [
"MIT"
] | 3 | 2020-06-13T02:47:29.000Z | 2020-06-20T17:34:15.000Z | backend/venv/lib/python3.6/site-packages/test/grammar/semantics_test.py | HalmonLui/square-hackathon | 62d5be7a229f9e39e27a546c164facd779d28aa4 | [
"MIT"
] | 2 | 2020-06-14T20:29:26.000Z | 2020-06-14T20:29:34.000Z | backend/venv/lib/python3.6/site-packages/test/grammar/semantics_test.py | HalmonLui/square-hackathon | 62d5be7a229f9e39e27a546c164facd779d28aa4 | [
"MIT"
] | 1 | 2020-09-04T01:45:39.000Z | 2020-09-04T01:45:39.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from tatsu.tool import compile
from tatsu.semantics import ModelBuilderSemantics
class MyNode(object):
def __init__(self, ast):
pass
class SemanticsTests(unittest.TestCase):
... | 28.418182 | 101 | 0.566219 |
a1b9ffece29aa8fa3404358da88f6dcf97c9cc0d | 1,162 | py | Python | hcd/datasets/__init__.py | AnomoyousCodeReleaser/HCD | c2f5c39588b9e88d835f250546c812c384e4a7d8 | [
"MIT"
] | 3 | 2021-12-20T13:50:28.000Z | 2022-01-21T14:17:56.000Z | hcd/datasets/__init__.py | AnomoyousCodeReleaser/HCD | c2f5c39588b9e88d835f250546c812c384e4a7d8 | [
"MIT"
] | 1 | 2021-12-14T04:38:20.000Z | 2021-12-14T10:00:51.000Z | hcd/datasets/__init__.py | AnomoyousCodeReleaser/HCD | c2f5c39588b9e88d835f250546c812c384e4a7d8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import warnings
from .dukemtmc import DukeMTMC
from .market1501 import Market1501
from .msmt17 import MSMT17
__factory = {
'market1501': Market1501,
'dukemtmc': DukeMTMC,
'msmt17': MSMT17
}
def names():
return sorted(__factory.keys())
def create(name, root, *... | 25.822222 | 79 | 0.664372 |
cd3f166a747a12ac72a1859bc862650626814182 | 393 | py | Python | 3-mouth04/day06/gary_net/gary_net/wsgi.py | gary-gggggg/gary | d8ba30ea4bc2b662a2d6a87d247f813e5680d63e | [
"Apache-2.0"
] | 4 | 2021-02-01T10:28:11.000Z | 2021-02-01T10:34:40.000Z | 3-mouth04/day06/gary_net/gary_net/wsgi.py | gary-gggggg/gary | d8ba30ea4bc2b662a2d6a87d247f813e5680d63e | [
"Apache-2.0"
] | null | null | null | 3-mouth04/day06/gary_net/gary_net/wsgi.py | gary-gggggg/gary | d8ba30ea4bc2b662a2d6a87d247f813e5680d63e | [
"Apache-2.0"
] | null | null | null | """
WSGI config for gary_net project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
281933cb832cbfc034add4a6fab476ac13c9bc85 | 35,970 | py | Python | edb/server/args.py | sthagen/edgedb-edgedb | eb9b3f218fe029e68a8ddacadd54b5435653af7e | [
"Apache-2.0"
] | null | null | null | edb/server/args.py | sthagen/edgedb-edgedb | eb9b3f218fe029e68a8ddacadd54b5435653af7e | [
"Apache-2.0"
] | null | null | null | edb/server/args.py | sthagen/edgedb-edgedb | eb9b3f218fe029e68a8ddacadd54b5435653af7e | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | 35.97 | 79 | 0.603698 |
101a1d41cfa074d5b0e5d8149898c73817af67c2 | 2,064 | py | Python | main/linprog-extensions/tests/test_build_references.py | sakha002/ortools-utils | 6fc30f980228751f7c8e5fcbe93b5af1e7092e21 | [
"MIT"
] | null | null | null | main/linprog-extensions/tests/test_build_references.py | sakha002/ortools-utils | 6fc30f980228751f7c8e5fcbe93b5af1e7092e21 | [
"MIT"
] | null | null | null | main/linprog-extensions/tests/test_build_references.py | sakha002/ortools-utils | 6fc30f980228751f7c8e5fcbe93b5af1e7092e21 | [
"MIT"
] | null | null | null |
# from dataclasses import dataclass
# from google.protobuf.json_format import ParseDict, MessageToDict
from context import operations_research
from server.struct_utils import Catalogue
from server.linprog_structs.operation_research_ext import(
ReferenceMPModelRequestStreem,
)
from build_reference_model.basic_... | 24 | 88 | 0.744671 |
39a4549cf2062f6e46443d001569d3da8f8a0fae | 16,949 | py | Python | sympy/algebras/quaternion.py | atul107/sympy | 023ca2a94af32ee88f48594b9fa60a5cf430342f | [
"BSD-3-Clause"
] | null | null | null | sympy/algebras/quaternion.py | atul107/sympy | 023ca2a94af32ee88f48594b9fa60a5cf430342f | [
"BSD-3-Clause"
] | 1 | 2017-10-23T06:56:43.000Z | 2017-10-23T06:56:43.000Z | sympy/algebras/quaternion.py | ylemkimon/sympy | 5fcbde2ed7385df250510bd5207f270cba990265 | [
"BSD-3-Clause"
] | 1 | 2020-10-02T15:05:03.000Z | 2020-10-02T15:05:03.000Z | # References :
# http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/
# https://en.wikipedia.org/wiki/Quaternion
from __future__ import print_function
from sympy.core.expr import Expr
from sympy import Rational
from sympy import re, im, conjugate
from sympy import sqrt, sin, cos, acos, asin, exp,... | 30.70471 | 91 | 0.491061 |
289cdfd1aa6914a9537a43395269d9119868bfc5 | 327 | py | Python | python/1.POP/1.base/01.zkey.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | 25 | 2018-06-13T08:13:44.000Z | 2020-11-19T14:02:11.000Z | python/1.POP/1.base/01.zkey.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | null | null | null | python/1.POP/1.base/01.zkey.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | 13 | 2018-06-13T08:13:38.000Z | 2022-01-06T06:45:07.000Z | import keyword
print(keyword.kwlist)
# %c 字符
# %s 通过str() 字符串转换来格式化
# %o 八进制整数
# %x 十六进制整数(小写字母)
# %X 十六进制整数(大写字母)
# %e 指数(小写'e')
# %E 指数(大写“E”)
# %f 浮点实数
# %g %f和%e 的简写
# %G %f和%E的简写
num = 9
print("num=9,下面结果是对2的除,取余,取商操作:")
print(num / 2.0)
print(num % 2.0)
print(num // 2.0)
# 指数
print("2^3=%d" % ... | 15.571429 | 34 | 0.544343 |
8ae795f1f9414d81633ab5494e58b7c9694c0dfd | 2,479 | py | Python | solution/trie.py | quervernetzt/http-router-trie | 9c76e78c8cf9c84667f6da0df1dbcd5870102c84 | [
"MIT"
] | null | null | null | solution/trie.py | quervernetzt/http-router-trie | 9c76e78c8cf9c84667f6da0df1dbcd5870102c84 | [
"MIT"
] | null | null | null | solution/trie.py | quervernetzt/http-router-trie | 9c76e78c8cf9c84667f6da0df1dbcd5870102c84 | [
"MIT"
] | null | null | null | from typing import List
from collections import defaultdict
class TrieNode:
def __init__(self: object) -> None:
"""Constructor.
"""
self.children: defaultdict = defaultdict(TrieNode)
self.handler: str = None
class Trie:
def __init__(self: object) -> None:
"""Construct... | 28.825581 | 87 | 0.544171 |
f7ef86a684714c3bf1c67e2d89e82d22e365e8b6 | 408 | py | Python | flask/config_public.py | schmidni/app_ActiveCampaign | 2fc2e1e5472a26e5c250f067e3e7d184ae536b0d | [
"MIT"
] | null | null | null | flask/config_public.py | schmidni/app_ActiveCampaign | 2fc2e1e5472a26e5c250f067e3e7d184ae536b0d | [
"MIT"
] | null | null | null | flask/config_public.py | schmidni/app_ActiveCampaign | 2fc2e1e5472a26e5c250f067e3e7d184ae536b0d | [
"MIT"
] | null | null | null | import os
class Config(object):
SECRET_KEY = os.environ.get(
'SECRET_KEY') or 'ASDFSASFDSDDSSWWERASD'
SERVER_NAME = 'localhost:5000'
AC_KEY = "***"
AC_URL = "https://***.api-us1.com/api/3/"
STRIPE_PUBLIC_KEY = "pk_test_***"
STRIPE_SECRET_KEY = "sk_test_***"
SENDGRID_API_KEY = "SG.*... | 29.142857 | 48 | 0.639706 |
8f1a3098ad988bb5f74ccd0cdb2aae9e4dea7034 | 971 | py | Python | rclpy/test/__init__.py | nuclearsandwich/rclpy | 38fc758999af0a4d0f715c06fed5ddf7bd7ff2d3 | [
"Apache-2.0"
] | 1 | 2019-04-16T03:28:09.000Z | 2019-04-16T03:28:09.000Z | rclpy/test/__init__.py | nuclearsandwich/rclpy | 38fc758999af0a4d0f715c06fed5ddf7bd7ff2d3 | [
"Apache-2.0"
] | 6 | 2019-04-03T18:17:47.000Z | 2019-04-25T01:09:19.000Z | rclpy/test/__init__.py | nuclearsandwich/rclpy | 38fc758999af0a4d0f715c06fed5ddf7bd7ff2d3 | [
"Apache-2.0"
] | 1 | 2020-02-26T05:51:21.000Z | 2020-02-26T05:51:21.000Z | # Copyright 2016-2017 Open Source Robotics Foundation, 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 applicabl... | 32.366667 | 93 | 0.77034 |
3981a4b566a101951922ed2c19737c1f3955eb89 | 8,922 | py | Python | muzero/env.py | expz/muzero-ray | 5099577c84cc47c435ee44cb26a7dfa032c08f99 | [
"MIT"
] | null | null | null | muzero/env.py | expz/muzero-ray | 5099577c84cc47c435ee44cb26a7dfa032c08f99 | [
"MIT"
] | null | null | null | muzero/env.py | expz/muzero-ray | 5099577c84cc47c435ee44cb26a7dfa032c08f99 | [
"MIT"
] | 1 | 2021-05-30T22:56:26.000Z | 2021-05-30T22:56:26.000Z | from abc import ABC
from collections import deque
import cv2
import gym
import numpy as np
import ray.tune as tune
class NoopResetEnv(gym.Wrapper):
"""
From https://github.com/ray-project/ray/blob/ray-0.8.7/rllib/env/atari_wrappers.py
"""
def __init__(self, env, noop_max=30):
"""Sample initia... | 36.121457 | 108 | 0.606366 |
330ee2860382375011a0f4796d6a1896ab0e4a79 | 415 | py | Python | scripts/process_edger_results.py | seqcode/multimds | 8dbda98675a6d20bcecb76ab85ea8fd1571b4da3 | [
"MIT"
] | 1 | 2019-10-29T12:33:57.000Z | 2019-10-29T12:33:57.000Z | scripts/process_edger_results.py | seqcode/multimds | 8dbda98675a6d20bcecb76ab85ea8fd1571b4da3 | [
"MIT"
] | null | null | null | scripts/process_edger_results.py | seqcode/multimds | 8dbda98675a6d20bcecb76ab85ea8fd1571b4da3 | [
"MIT"
] | null | null | null | with open("nup60_sig.bed", "w") as outfile:
with open("nup60_edgeR_results.tsv") as infile:
for line in infile:
line = line.strip().split()
if line[0] != "\"logFC\"":
if float(line[4]) < 0.01:
chrom, bounds = line[0].strip("\"").split(":")
start, end = bounds.split("-")
outfile.write... | 31.923077 | 52 | 0.575904 |
29bf14b223d8ed9d50516073fdc1354d66e3d34a | 315,416 | py | Python | python/cssbeautifier/tests/generated/tests.py | UAK-35/js-beautify | 0103f7c45b2d2fa6de30aa61c1fdd1ff3e4a5df7 | [
"MIT"
] | 1 | 2020-10-29T22:23:37.000Z | 2020-10-29T22:23:37.000Z | python/cssbeautifier/tests/generated/tests.py | doc22940/js-beautify | e00d3b2b78600ffe590dc4a87a085fb1b586c9dd | [
"MIT"
] | 1 | 2021-05-11T23:00:07.000Z | 2021-05-11T23:00:07.000Z | python/cssbeautifier/tests/generated/tests.py | doc22940/js-beautify | e00d3b2b78600ffe590dc4a87a085fb1b586c9dd | [
"MIT"
] | 1 | 2020-05-29T12:57:55.000Z | 2020-05-29T12:57:55.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
AUTO-GENERATED. DO NOT MODIFY.
Script: test/generate-tests.js
Template: test/data/css/python.mustache
Data: test/data/css/tests.js
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereb... | 28.881604 | 460 | 0.263236 |
e7b8f40182d1d7c871f7d1b2f4725e46868bc707 | 5,711 | py | Python | google/cloud/ndb/_legacy_protocol_buffer.py | crwilcox/python-ndb | fc31553c77f6e7865df0efd4c820f69366f6607c | [
"Apache-2.0"
] | 1 | 2019-09-13T18:14:46.000Z | 2019-09-13T18:14:46.000Z | src/google/cloud/ndb/_legacy_protocol_buffer.py | lauro-cesar/uood4python | 90f6f6c373e6c80b53aba7cc02a05b86b0d9c55c | [
"Apache-2.0"
] | null | null | null | src/google/cloud/ndb/_legacy_protocol_buffer.py | lauro-cesar/uood4python | 90f6f6c373e6c80b53aba7cc02a05b86b0d9c55c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 26.686916 | 74 | 0.526528 |
2e510abeeb83eb0c9b96bf16477ab138c1199765 | 5,902 | py | Python | Demo/swing/JythonConsole/Console.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 332 | 2015-08-22T12:43:56.000Z | 2022-03-17T01:05:43.000Z | Demo/swing/JythonConsole/Console.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 36 | 2015-05-30T08:39:19.000Z | 2022-03-04T20:42:33.000Z | Demo/swing/JythonConsole/Console.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 74 | 2015-05-29T17:18:53.000Z | 2022-01-15T14:06:44.000Z | """This is a substantially improved version of the older Interpreter.py demo
It creates a simple GUI JPython console window with simple history
as well as the ability to interupt running code (with the ESC key).
Like Interpreter.py, this is still just a demo, and needs substantial
work before serious use.
Thanks to G... | 27.971564 | 95 | 0.722636 |
6a6156deacecd851219a3fa1e71f332fa38cc221 | 168,573 | py | Python | tests/scan/test_basic.py | mrtommyb/aesara | 86815d66af7cd93a44b20757efb01e7b21556145 | [
"BSD-3-Clause"
] | null | null | null | tests/scan/test_basic.py | mrtommyb/aesara | 86815d66af7cd93a44b20757efb01e7b21556145 | [
"BSD-3-Clause"
] | null | null | null | tests/scan/test_basic.py | mrtommyb/aesara | 86815d66af7cd93a44b20757efb01e7b21556145 | [
"BSD-3-Clause"
] | null | null | null | """
Questions and notes about scan that should be answered :
* Scan seems to do copies of every input variable. Is that needed?
answer : probably not, but it doesn't hurt also ( what we copy is
aesara variables, which just cary information about the type / dimension
of the data)
* There is some of sc... | 33.775396 | 88 | 0.544221 |
25024af2d27013a95f3975786b70d97a9605a2d4 | 4,224 | py | Python | src/screener/crawler.py | andresbeltran98/LiveStockScreener | 10bcbfeb145242ee0ab6e9cc0439f3ecfdf6b6b2 | [
"MIT"
] | null | null | null | src/screener/crawler.py | andresbeltran98/LiveStockScreener | 10bcbfeb145242ee0ab6e9cc0439f3ecfdf6b6b2 | [
"MIT"
] | 1 | 2021-06-01T22:29:48.000Z | 2021-06-01T22:29:48.000Z | src/screener/crawler.py | andresbeltran98/LiveStockScreener | 10bcbfeb145242ee0ab6e9cc0439f3ecfdf6b6b2 | [
"MIT"
] | null | null | null | """This module represents a web crawler. It gets the data from
Alpha Vantage's API
"""
__author__ = 'Andres Beltran'
__version__ = '1.0'
import json
import os
import ssl
import time
import datetime
import pandas as pd
from urllib.request import urlopen
def get_url(ticker, interval):
"""Sets the URL
Args:
... | 30.608696 | 79 | 0.559422 |
7966bc1641dd55e82c0b2dfedf7810493c866f6c | 367 | py | Python | panlex_scraper/pipelines.py | raphaelmerx/panlex_scraper | e22608ce798b1e77d303b13147c075ff688241c0 | [
"MIT"
] | 2 | 2022-02-05T19:47:55.000Z | 2022-02-20T00:27:47.000Z | panlex_scraper/pipelines.py | raphaelmerx/panlex_scraper | e22608ce798b1e77d303b13147c075ff688241c0 | [
"MIT"
] | null | null | null | panlex_scraper/pipelines.py | raphaelmerx/panlex_scraper | e22608ce798b1e77d303b13147c075ff688241c0 | [
"MIT"
] | null | null | null | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class PanlexScraperPipeline:
def process... | 26.214286 | 66 | 0.771117 |
b9db9122e4d824d879f72de83b67530b32b5bfca | 1,542 | py | Python | parser_model/tree_obj.py | NLP-Discourse-SoochowU/rst_dp2019Bottom2Up | ac1624127c9c8a3301685193ac8239357e01f6ca | [
"MIT"
] | 1 | 2020-08-18T01:28:07.000Z | 2020-08-18T01:28:07.000Z | parser_model/tree_obj.py | NLP-Discourse-SoochowU/rst_dp2019 | ac1624127c9c8a3301685193ac8239357e01f6ca | [
"MIT"
] | null | null | null | parser_model/tree_obj.py | NLP-Discourse-SoochowU/rst_dp2019 | ac1624127c9c8a3301685193ac8239357e01f6ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Author: lyzhang
@Date: 2018/4/5
@Description: tree.edus in the form of ids
tree.nodes in the form of rst_tree objective
"""
import copy
class tree_obj:
def __init__(self, tree=None):
self.edus = list()
self.nodes = list()
self.sents_edus = li... | 27.535714 | 64 | 0.568742 |
42816815a2c373eed754d564fcea88e0d216bda7 | 431 | py | Python | day17/main_part2.py | kzabashta/advent-of-code-17 | e37ff0a211791b7c120c78269b7927d8d40583fe | [
"MIT"
] | null | null | null | day17/main_part2.py | kzabashta/advent-of-code-17 | e37ff0a211791b7c120c78269b7927d8d40583fe | [
"MIT"
] | null | null | null | day17/main_part2.py | kzabashta/advent-of-code-17 | e37ff0a211791b7c120c78269b7927d8d40583fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
TOTAL_ITERS = 50000000
STEPS = 345
circle_buffer_length = 1
current = 0
current_short_circuit_val = 0
for i in range(1, TOTAL_ITERS + 1):
current = (current + STEPS) % circle_buffer_length
current += 1
# it always grows by 1
circle_buffer_length += 1
# capture latest known v... | 22.684211 | 54 | 0.707657 |
72ac636640f011726a14f331ea4cc0f8c6271498 | 31,876 | py | Python | src/molecule/provisioner/ansible.py | Be-Secure/molecule | 7644adae249b3574a0dab9f0389b2bf9e1f88e0c | [
"MIT"
] | null | null | null | src/molecule/provisioner/ansible.py | Be-Secure/molecule | 7644adae249b3574a0dab9f0389b2bf9e1f88e0c | [
"MIT"
] | null | null | null | src/molecule/provisioner/ansible.py | Be-Secure/molecule | 7644adae249b3574a0dab9f0389b2bf9e1f88e0c | [
"MIT"
] | null | null | null | # Copyright (c) 2015-2018 Cisco Systems, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge,... | 33.37801 | 151 | 0.591887 |
84e8ccbea3500313538c20485ab6d705e5a2f469 | 4,940 | py | Python | Utils/py/TeamCommGenerator/utils/TeamCommGenerator.py | BerlinUnited/NaoTH | 02848ac10c16a5349f1735da8122a64d601a5c75 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/py/TeamCommGenerator/utils/TeamCommGenerator.py | BerlinUnited/NaoTH | 02848ac10c16a5349f1735da8122a64d601a5c75 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/py/TeamCommGenerator/utils/TeamCommGenerator.py | BerlinUnited/NaoTH | 02848ac10c16a5349f1735da8122a64d601a5c75 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z | import json
import threading
import socket
import time
from utils.TeamCommReceiver import TeamCommReceiver
from utils.TeamCommSender import TeamCommSender
class TeamCommGenerator(threading.Thread):
def __init__(self, host='localhost', port=10004, delay=0.4):
threading.Thread.__init__(self)
# ind... | 34.788732 | 117 | 0.574494 |
461c04c4485b94d402f90bf6f6854a833db17b35 | 1,506 | py | Python | openstack_dashboard/dashboards/project/instances/urls.py | dreamhost/horizon | 55569d540e6c1a6957d5127f9bae6a699ed60823 | [
"Apache-2.0"
] | 3 | 2017-02-13T15:11:01.000Z | 2021-07-28T08:28:09.000Z | openstack_dashboard/dashboards/project/instances/urls.py | dreamhost/horizon | 55569d540e6c1a6957d5127f9bae6a699ed60823 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/instances/urls.py | dreamhost/horizon | 55569d540e6c1a6957d5127f9bae6a699ed60823 | [
"Apache-2.0"
] | 2 | 2018-08-29T10:56:04.000Z | 2019-11-11T11:45:20.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | 38.615385 | 78 | 0.709827 |
f7b5dbb57787addfa1c492cd1843be83772979a3 | 1,763 | py | Python | src/read_sensordata.py | fgheysels/heating-tempflow | 2eb1c08a093d9eb7d59906a0da8461a74e5604d7 | [
"MIT"
] | 2 | 2019-10-11T15:51:38.000Z | 2020-09-14T11:44:11.000Z | src/read_sensordata.py | fgheysels/heating-tempflow | 2eb1c08a093d9eb7d59906a0da8461a74e5604d7 | [
"MIT"
] | null | null | null | src/read_sensordata.py | fgheysels/heating-tempflow | 2eb1c08a093d9eb7d59906a0da8461a74e5604d7 | [
"MIT"
] | 1 | 2020-09-30T18:52:13.000Z | 2020-09-30T18:52:13.000Z | import glob
import requests
def postSensorData( influxDbAddress, database, data ):
url = influxDbAddress + "/write?db="+database
r = requests.post(url, data)
if (r.status_code > 200 and r.status_code < 300):
print "sensordata posted successfully"
else:
print "statuscode: " + str(... | 27.984127 | 263 | 0.657402 |
b940c969abefef4b0541c8d331a1d42f648f5682 | 37,921 | py | Python | modeling.py | Kerram/bert | 60437eafb84998e0ca82e8a3b2fdd0ad10c526c7 | [
"Apache-2.0"
] | null | null | null | modeling.py | Kerram/bert | 60437eafb84998e0ca82e8a3b2fdd0ad10c526c7 | [
"Apache-2.0"
] | null | null | null | modeling.py | Kerram/bert | 60437eafb84998e0ca82e8a3b2fdd0ad10c526c7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 38.420466 | 93 | 0.692967 |
a96082a4e39e5a97764856dac037a73ab41d8bf5 | 2,021 | py | Python | SupportVectorMachine/SvmFaces.py | gemmacook/Visualising-High-Dimensional-Shapes | b41e2ea49dc104263792430162132125c1164cb3 | [
"MIT"
] | 1 | 2018-07-02T15:47:58.000Z | 2018-07-02T15:47:58.000Z | SupportVectorMachine/SvmFaces.py | gemmacook/Visualising-High-Dimensional-Shapes | b41e2ea49dc104263792430162132125c1164cb3 | [
"MIT"
] | null | null | null | SupportVectorMachine/SvmFaces.py | gemmacook/Visualising-High-Dimensional-Shapes | b41e2ea49dc104263792430162132125c1164cb3 | [
"MIT"
] | 1 | 2018-07-06T12:16:38.000Z | 2018-07-06T12:16:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 27 01:42:06 2018
@author: Cameron Hargreaves
"""
from sklearn.svm import SVC
from sklearn.cross_validation import train_test_split, cross_val_score, KFold
from sklearn.datasets import fetch_olivetti_faces
from sklearn import metrics
import numpy as np
import matplotlib.p... | 34.254237 | 109 | 0.688273 |
3657e5a0acb3d8b67e89c16d97283965badffbb0 | 6,332 | py | Python | S4/S4 Library/simulation/balloon/tunable_balloon.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Library/simulation/balloon/tunable_balloon.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Library/simulation/balloon/tunable_balloon.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | import random
from balloon.balloon_enums import BALLOON_TYPE_LOOKUP
from balloon.balloon_request import BalloonRequest
from balloon.balloon_variant import BalloonVariant
from interactions import ParticipantType
from sims4.tuning.geometric import TunableVector3
from sims4.tuning.tunable import TunableFactory, Tunable, T... | 69.582418 | 1,691 | 0.651295 |
6993fcbddb4fdd4a5b3be403c8d5b83b7e005cc8 | 1,235 | py | Python | prv_accountant/composers.py | s-zanella/prv_accountant | 556044db7e3fcab8007486e377e8206233bec3a0 | [
"MIT"
] | null | null | null | prv_accountant/composers.py | s-zanella/prv_accountant | 556044db7e3fcab8007486e377e8206233bec3a0 | [
"MIT"
] | null | null | null | prv_accountant/composers.py | s-zanella/prv_accountant | 556044db7e3fcab8007486e377e8206233bec3a0 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
from abc import ABC, abstractmethod
from scipy.fft import rfft, irfft
from .discrete_privacy_random_variable import DiscretePrivacyRandomVariable
class Composer(ABC):
@abstractmethod
def compute_composition(self, nu... | 29.404762 | 90 | 0.688259 |
69acff966a0612560625152308414029d37f1bb4 | 574 | py | Python | replit/week2/palindrome.py | JL1080/tri3data1 | a4771a824eb8aee53f31137b8ea9a3e0a2fe3980 | [
"MIT"
] | null | null | null | replit/week2/palindrome.py | JL1080/tri3data1 | a4771a824eb8aee53f31137b8ea9a3e0a2fe3980 | [
"MIT"
] | null | null | null | replit/week2/palindrome.py | JL1080/tri3data1 | a4771a824eb8aee53f31137b8ea9a3e0a2fe3980 | [
"MIT"
] | null | null | null | list = ["boat", "Dadtrough", "dogpaddle", "r%ace /!@# ca%r", "H!i"]
reflection = ""
badchar = " !@#$%^&*()/~|"
for examples in list:
print("Input:", examples)
for char in badchar:
examples = examples.replace(char, "")
cleanexamples = examples.replace(char, "")
examples = examples.lower... | 30.210526 | 67 | 0.580139 |
413ff49140949e763f9212bf6d9b703fd3fbfcfa | 1,131 | py | Python | examples/delete.py | sivel/python-openstacksdk | 85c6a42c8f983b467c79e5dacdfdc996657250b1 | [
"Apache-2.0"
] | 1 | 2015-02-16T09:34:58.000Z | 2015-02-16T09:34:58.000Z | examples/delete.py | sivel/python-openstacksdk | 85c6a42c8f983b467c79e5dacdfdc996657250b1 | [
"Apache-2.0"
] | null | null | null | examples/delete.py | sivel/python-openstacksdk | 85c6a42c8f983b467c79e5dacdfdc996657250b1 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 28.275 | 75 | 0.717065 |
b1f05228d2f83bb4e90e731af2f469f8ce548561 | 1,430 | py | Python | fake_switches/telnet_service.py | fbouliane/fake-switches | b46a18352a69fd6d29ce16e5a2befcf5de6aac26 | [
"Apache-2.0"
] | null | null | null | fake_switches/telnet_service.py | fbouliane/fake-switches | b46a18352a69fd6d29ce16e5a2befcf5de6aac26 | [
"Apache-2.0"
] | null | null | null | fake_switches/telnet_service.py | fbouliane/fake-switches | b46a18352a69fd6d29ce16e5a2befcf5de6aac26 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Internap.
#
# 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, so... | 34.047619 | 84 | 0.727972 |
cfbb5d6aad9031e1d85d26bf7110b26fcd16546d | 793 | py | Python | grove/__init__.py | ncrubin/grove | 5f8024445263fc8b5ead39520e9e5f019bfe3e31 | [
"Apache-2.0"
] | null | null | null | grove/__init__.py | ncrubin/grove | 5f8024445263fc8b5ead39520e9e5f019bfe3e31 | [
"Apache-2.0"
] | null | null | null | grove/__init__.py | ncrubin/grove | 5f8024445263fc8b5ead39520e9e5f019bfe3e31 | [
"Apache-2.0"
] | 1 | 2021-11-27T16:20:00.000Z | 2021-11-27T16:20:00.000Z | ##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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... | 46.647059 | 78 | 0.583859 |
e1f1cc1ae1af1e8a7fffcd14e39ff743493956e5 | 847 | py | Python | tests/test_ranking.py | CyberZHG/keras-losses | 20f6adaf65770c031f63e69570ec96814c4591e8 | [
"MIT"
] | 9 | 2018-10-11T03:02:18.000Z | 2021-02-23T03:22:06.000Z | tests/test_ranking.py | CyberZHG/keras-losses | 20f6adaf65770c031f63e69570ec96814c4591e8 | [
"MIT"
] | null | null | null | tests/test_ranking.py | CyberZHG/keras-losses | 20f6adaf65770c031f63e69570ec96814c4591e8 | [
"MIT"
] | 2 | 2019-01-03T08:49:17.000Z | 2021-08-12T10:27:12.000Z | import unittest
import math
import tensorflow as tf
from keras_losses import get_ranking_loss
class TestRankingLoss(unittest.TestCase):
def test_eval(self):
y_pred = tf.convert_to_tensor([
[0.1, 0.2, 0.5, 2.0, 1.8],
[0.2, 0.3, 0.15, 2.2, 1.1],
])
y_true = tf.conver... | 31.37037 | 102 | 0.521842 |
a534499abf0ec287c0cc138a5f222780e717c4af | 3,150 | py | Python | GenerateMap/render_backup.py | fyabc/Toys | 3b2abd4fb2be986a8be6ed83897f7ba7fad6929e | [
"MIT"
] | 1 | 2016-08-17T10:36:03.000Z | 2016-08-17T10:36:03.000Z | GenerateMap/render_backup.py | fyabc/Toys | 3b2abd4fb2be986a8be6ed83897f7ba7fad6929e | [
"MIT"
] | null | null | null | GenerateMap/render_backup.py | fyabc/Toys | 3b2abd4fb2be986a8be6ed83897f7ba7fad6929e | [
"MIT"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""Backup old render method, from the original Python repository."""
import matplotlib.pyplot as plt
import numpy as np
try:
from .erosion import get_downhill, get_water_flow
except ImportError:
from erosion import _get_downhill, _get_water_flow
def _get_sinks(sel... | 31.5 | 100 | 0.62127 |
0c943fc7477837dc07e2dac73c686fdaca9136c0 | 898 | py | Python | repl/base/callstack.py | 946336/The-Worst-REPL-You-ve-Ever-Seen | 971f316b4b93441527a880835938a91d100f7e5d | [
"MIT"
] | null | null | null | repl/base/callstack.py | 946336/The-Worst-REPL-You-ve-Ever-Seen | 971f316b4b93441527a880835938a91d100f7e5d | [
"MIT"
] | 6 | 2018-08-26T04:52:21.000Z | 2018-09-07T05:26:41.000Z | repl/base/callstack.py | 946336/The-Worst-REPL-You-ve-Ever-Seen | 971f316b4b93441527a880835938a91d100f7e5d | [
"MIT"
] | null | null | null |
class Entry:
def __init__(self, obj, line_number = 1):
self.obj = obj
self.line_number = line_number
def __repr__(self):
return "In {}, line {}".format(self.obj.name, self.line_number)
class CallStack:
def __init__(self, initial = None):
self.__stack = [] if not initial e... | 24.944444 | 71 | 0.601336 |
a839b1dda8c98ab9a3561d653a20badb650c6c2f | 28,599 | py | Python | python/ccxt/buda.py | myhlcb/ccxt | 828a373821269d846f418c056f6e4c922d56d18c | [
"MIT"
] | 1 | 2021-01-21T23:29:27.000Z | 2021-01-21T23:29:27.000Z | python/ccxt/buda.py | myhlcb/ccxt | 828a373821269d846f418c056f6e4c922d56d18c | [
"MIT"
] | 1 | 2020-09-17T13:57:58.000Z | 2020-09-17T13:57:58.000Z | python/ccxt/buda.py | myhlcb/ccxt | 828a373821269d846f418c056f6e4c922d56d18c | [
"MIT"
] | 2 | 2020-06-17T14:28:46.000Z | 2022-02-26T13:36:02.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
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ... | 39.016371 | 147 | 0.50292 |
9116f018d01ce34c13dfc108de48abb481149e2d | 7,406 | py | Python | maskrcnn_benchmark/data/build.py | lizhenbang56/END-TO-END-TEMPORAL-FEATURE-AGGREGATION-FOR-SIAMESE-TRACKERS | 132b2e28b7f66c6ba0719774e9abd9b6515dd7e2 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/build.py | lizhenbang56/END-TO-END-TEMPORAL-FEATURE-AGGREGATION-FOR-SIAMESE-TRACKERS | 132b2e28b7f66c6ba0719774e9abd9b6515dd7e2 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/build.py | lizhenbang56/END-TO-END-TEMPORAL-FEATURE-AGGREGATION-FOR-SIAMESE-TRACKERS | 132b2e28b7f66c6ba0719774e9abd9b6515dd7e2 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import bisect
import copy
import logging
import torch.utils.data
from maskrcnn_benchmark.utils.comm import get_world_size
from maskrcnn_benchmark.utils.imports import import_file
from maskrcnn_benchmark.utils.miscellaneous import save_labels
from... | 40.032432 | 143 | 0.688361 |
f304c8afebe8aadf92ce825b5ee4969e0172f826 | 310 | py | Python | lib/openresty/lua-libinjection-3.9.1/cicada/cicada-event.py | Raymondo-C/OpenWAF | 93510692d2a75789bd3a328cd50ca69f7ec2c372 | [
"Apache-2.0"
] | 690 | 2016-10-09T10:40:21.000Z | 2022-03-31T10:31:04.000Z | lib/openresty/lua-libinjection-3.9.1/cicada/cicada-event.py | Raymondo-C/OpenWAF | 93510692d2a75789bd3a328cd50ca69f7ec2c372 | [
"Apache-2.0"
] | 29 | 2016-12-01T03:45:29.000Z | 2022-01-28T03:27:42.000Z | lib/openresty/lua-libinjection-3.9.1/cicada/cicada-event.py | Raymondo-C/OpenWAF | 93510692d2a75789bd3a328cd50ca69f7ec2c372 | [
"Apache-2.0"
] | 240 | 2016-10-24T01:55:30.000Z | 2022-03-17T09:18:15.000Z | #!/usr/bin/env python
import logging
import sys
from StateRedis import StateRedis
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
connection = StateRedis()
eventname = sys.argv[1]
logging.debug("Adding event %s", eventname)
connection.event_put(eventname)
| 23.846154 | 48 | 0.703226 |
e3d6fefee46ae90253162c612676d3bfea711efd | 6,826 | py | Python | var/spack/repos/builtin/packages/openssl/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/openssl/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/openssl/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-09-21T07:45:10.000Z | 2019-09-21T07:45:10.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)
import llnl.util.tty as tty
from spack import *
import spack.architecture
import os
class Openssl(Package): # Uses F... | 44.614379 | 96 | 0.670378 |
061c715cf118aa58023f7937a998c4b72e6879be | 1,192 | py | Python | fundamentals/fundamentals/for_loop_basic_I.py | ZhouSusan/CodingDojoPython | 8d89c9a94a3be18e79fbf24e25348eae8c96a338 | [
"MIT"
] | null | null | null | fundamentals/fundamentals/for_loop_basic_I.py | ZhouSusan/CodingDojoPython | 8d89c9a94a3be18e79fbf24e25348eae8c96a338 | [
"MIT"
] | null | null | null | fundamentals/fundamentals/for_loop_basic_I.py | ZhouSusan/CodingDojoPython | 8d89c9a94a3be18e79fbf24e25348eae8c96a338 | [
"MIT"
] | null | null | null | #1. Basic - Print all integers from 0 to 150.
for x in range(151):
print(x)
#2. Multiples of Five - Print all the multiples of 5 from 5 to 1,000
for x in range(1001):
if (x % 5 == 0):
print(x)
"""3. Counting, the Dojo Way - Print integers 1 to 100. If divisible by 5, print "Coding" instead.
If divisi... | 29.8 | 103 | 0.63255 |
1aeda87386949220501796c612f588b9f4fc0dc5 | 13,637 | py | Python | stock_financial/data_urls.py | huangsir250/financial_data_pools | 9e8101d88f74f53cf0312b720fc01f4f57e39f2f | [
"Apache-2.0"
] | 89 | 2020-12-13T02:57:38.000Z | 2021-12-09T07:27:31.000Z | stock_financial/data_urls.py | jiangsir023/financial_data_pools | 9e8101d88f74f53cf0312b720fc01f4f57e39f2f | [
"Apache-2.0"
] | 8 | 2021-03-27T08:25:21.000Z | 2021-11-25T03:20:20.000Z | stock_financial/data_urls.py | jiangsir023/financial_data_pools | 9e8101d88f74f53cf0312b720fc01f4f57e39f2f | [
"Apache-2.0"
] | 43 | 2020-12-14T11:03:26.000Z | 2021-12-08T14:46:52.000Z | '''
数据来源地址
'''
import time
import random
import datetime
from functools import partial
from comm_funcs import get_current_date
from comm_funcs import time_last_day_of_month
def get_suspended_url(**kwargs):
'''
获取停牌复牌的个股信息,来自东方财富网
:param kwargs:
:param sty : 'SRB',
:param st : '2', 排序字段,2:停牌开始时间,6... | 28.589099 | 180 | 0.607978 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.