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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aeffcc49bbf3795bc75742f0dcf971d8375a4458 | 20,988 | py | Python | analysis/analysis_runner.py | BZSROCKETS/cemrl | 499939535794ee027f08b8a4133eefd0bb7abe14 | [
"MIT"
] | null | null | null | analysis/analysis_runner.py | BZSROCKETS/cemrl | 499939535794ee027f08b8a4133eefd0bb7abe14 | [
"MIT"
] | null | null | null | analysis/analysis_runner.py | BZSROCKETS/cemrl | 499939535794ee027f08b8a4133eefd0bb7abe14 | [
"MIT"
] | null | null | null | # Continuous Embedding Meta Reinforcement Learning (CEMRL)
import os, shutil
import pathlib
import numpy as np
import click
import json
import torch
import torch.nn as nn
from rlkit.envs import ENVS
from rlkit.envs.wrappers import NormalizedBoxEnv, CameraWrapper
from rlkit.torch.sac.policies import TanhGaussianPolicy... | 41.314961 | 187 | 0.65709 |
a163ff08bc6efa4c835e21523f726384daa6843b | 2,689 | py | Python | pywebio.py | Sbastdia/Examen-parcial | 8c86692cc0121c1afa7b2550092efafd4f16b9b2 | [
"Apache-2.0"
] | null | null | null | pywebio.py | Sbastdia/Examen-parcial | 8c86692cc0121c1afa7b2550092efafd4f16b9b2 | [
"Apache-2.0"
] | 15 | 2021-11-11T17:32:15.000Z | 2021-11-12T11:25:07.000Z | pywebio.py | Sbastdia/Examen-parcial | 8c86692cc0121c1afa7b2550092efafd4f16b9b2 | [
"Apache-2.0"
] | null | null | null | from pywebio.input import *
from pywebio.output import *
from pywebio import start_server
from fpdf import FPDF, HTMLMixin
def app():
put_markdown('#Informe')
#group all the inputs to make a form
data = input_group("Basic info",[
input('Input yourname', name='name', required=True),
checkbox("Languages ... | 39.544118 | 125 | 0.632577 |
238fc06a20e0cd7ffcf9a286b8af49592d0884d2 | 16,270 | py | Python | python/paddle/fluid/tests/unittests/test_strided_slice_op.py | javakian/Paddle | 10018f1561cb8f75f8df982dcf2217e50cee2647 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_strided_slice_op.py | javakian/Paddle | 10018f1561cb8f75f8df982dcf2217e50cee2647 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_strided_slice_op.py | javakian/Paddle | 10018f1561cb8f75f8df982dcf2217e50cee2647 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle 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 appli... | 32.281746 | 124 | 0.546835 |
8db70c0c0788c3f746d3410be057f797793444a3 | 3,210 | py | Python | release/scripts/addons/io_scene_gltf2/io/com/gltf2_io_debug.py | noorbeast/BlenderSource | 65ebecc5108388965678b04b43463b85f6c69c1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-07-08T15:51:14.000Z | 2019-07-08T15:51:14.000Z | release/scripts/addons/io_scene_gltf2/io/com/gltf2_io_debug.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons/io_scene_gltf2/io/com/gltf2_io_debug.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright 2018 The glTF-Blender-IO 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 agree... | 25.078125 | 107 | 0.692212 |
d62982fc2ba15dd8eafbf8fa89426890a992157c | 724 | py | Python | extras/bluetooth/receive.py | simondlevy/HackflightCPP | 1f6fdd0c0ac2797d9663eb2b57410bb45c43c77e | [
"MIT"
] | 200 | 2017-08-29T09:02:09.000Z | 2022-03-30T02:51:51.000Z | extras/bluetooth/receive.py | simondlevy/HackflightCPP | 1f6fdd0c0ac2797d9663eb2b57410bb45c43c77e | [
"MIT"
] | 117 | 2017-11-22T17:47:01.000Z | 2022-03-09T12:02:03.000Z | attic/bluetooth/receive.py | simondlevy/Hackflight | 27e8c7a1a3cae54563035fffe70ab90130d2960e | [
"MIT"
] | 63 | 2017-11-16T18:35:11.000Z | 2021-09-22T03:20:51.000Z | #!/usr/bin/env python3
'''
Communicate with flight controller via Bluetooth
Copyright (C) Simon D. Levy 2021
MIT License
'''
# ADDR = '00:06:66:73:E3:A6'
ADDR = '00:06:66:B8:6E:60'
PORT = 1
import socket
from time import sleep
from sys import stdout
sock = socket.socket(socket.AF_BLUETOOTH,
... | 16.837209 | 49 | 0.589779 |
7b539f80ce4d3f103187edb3885f6b0db2d8f9a5 | 16,033 | py | Python | lightly/data/collate.py | umami-ware/lightly | 5d70b34df7f784af249f9e9a6bfd6256756a877f | [
"MIT"
] | null | null | null | lightly/data/collate.py | umami-ware/lightly | 5d70b34df7f784af249f9e9a6bfd6256756a877f | [
"MIT"
] | null | null | null | lightly/data/collate.py | umami-ware/lightly | 5d70b34df7f784af249f9e9a6bfd6256756a877f | [
"MIT"
] | null | null | null | """ Collate Functions """
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
import torch
import torch.nn as nn
from typing import List
import torchvision
import torchvision.transforms as T
from lightly.transforms import GaussianBlur
from lightly.transforms import RandomRotate
from torchvisi... | 33.471816 | 86 | 0.560407 |
f0b469719267bd49e5d851048cd7ca7d54391e1d | 1,536 | py | Python | setup.py | ybakos/phpsh | 8438f3f3536f34ce73405e23a6369dc0da6e66aa | [
"BSD-3-Clause"
] | 1 | 2015-11-05T10:29:48.000Z | 2015-11-05T10:29:48.000Z | setup.py | ybakos/phpsh | 8438f3f3536f34ce73405e23a6369dc0da6e66aa | [
"BSD-3-Clause"
] | null | null | null | setup.py | ybakos/phpsh | 8438f3f3536f34ce73405e23a6369dc0da6e66aa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
from subprocess import Popen
import sys
import os
sys.path.insert(0, 'src')
from phpsh import __version__
if len(sys.argv) > 1 and sys.argv[1] == "build":
build_root = os.path.dirname(os.path.realpath(__file__))
make_dir = os.path.join(build_root, "src/xd... | 33.391304 | 79 | 0.573568 |
9a6424abc2d8c85fbfe883529d212d91e8f4da44 | 5,503 | py | Python | playbooks/robusta_playbooks/java_pod_troubleshooting.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 273 | 2021-12-28T20:48:48.000Z | 2022-03-31T16:03:13.000Z | playbooks/robusta_playbooks/java_pod_troubleshooting.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 103 | 2022-01-10T11:45:47.000Z | 2022-03-31T16:31:11.000Z | playbooks/robusta_playbooks/java_pod_troubleshooting.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 35 | 2021-12-30T15:30:14.000Z | 2022-03-28T11:43:57.000Z | from robusta.api import *
from typing import List
import traceback
class JavaParams(ProcessParams):
"""
:var jtk_image: the java-toolkit image to use for debugging
"""
jtk_image: str = None
@action
def java_process_inspector(event: PodEvent, params: JavaParams):
"""
Displays all java-toolki... | 31.994186 | 113 | 0.641287 |
ada98a36763768cd5db1cb73ceedf7d691f5dbf2 | 2,656 | py | Python | examples/map/map_data_histogram.py | johan12345/sunpy | 56e1ab0c2c992f99e0fe3e6bff468b731a51228c | [
"BSD-2-Clause"
] | 2 | 2020-07-02T13:01:42.000Z | 2020-08-27T20:05:31.000Z | examples/map/map_data_histogram.py | johan12345/sunpy | 56e1ab0c2c992f99e0fe3e6bff468b731a51228c | [
"BSD-2-Clause"
] | 1 | 2020-05-11T13:38:56.000Z | 2020-05-11T13:38:56.000Z | examples/map/map_data_histogram.py | johan12345/sunpy | 56e1ab0c2c992f99e0fe3e6bff468b731a51228c | [
"BSD-2-Clause"
] | 6 | 2017-03-15T07:17:05.000Z | 2020-09-30T18:36:49.000Z | """
=====================
Histograming map data
=====================
How to inspect the histogram of the data of a map.
"""
# sphinx_gallery_thumbnail_number = 2
import matplotlib.pyplot as plt
import numpy as np
import astropy.units as u
from astropy.coordinates import SkyCoord
import sunpy.map
from sunpy.data.sa... | 40.861538 | 90 | 0.622741 |
b5b6d12667a297aa3c5dec1abddf00dd5101986c | 6,149 | py | Python | flaskauth/oidc_client.py | lunarfish/flask-auth | 09c1626165301ccfc0a5c910b7b4832cec8d9ef9 | [
"MIT"
] | null | null | null | flaskauth/oidc_client.py | lunarfish/flask-auth | 09c1626165301ccfc0a5c910b7b4832cec8d9ef9 | [
"MIT"
] | null | null | null | flaskauth/oidc_client.py | lunarfish/flask-auth | 09c1626165301ccfc0a5c910b7b4832cec8d9ef9 | [
"MIT"
] | null | null | null | import json
import os
from urllib.parse import urlencode
from flask import Response, redirect, request, session
from flask.wrappers import Response as FlaskWrapperResponse
from jsonlogger import LOG
from oic import rndstr
from oic.exception import AccessDenied
from oic.oauth2.message import Message
from oic.oic import... | 28.868545 | 88 | 0.649049 |
61bb7f18af7a173a7f967fd347ef919025c25fec | 1,509 | py | Python | tests/tests_advanced.py | BloodVexed/PasswordCardGenerator | cc4c16d58659c229ce6241e77b7c91c11fb22566 | [
"Unlicense"
] | null | null | null | tests/tests_advanced.py | BloodVexed/PasswordCardGenerator | cc4c16d58659c229ce6241e77b7c91c11fb22566 | [
"Unlicense"
] | null | null | null | tests/tests_advanced.py | BloodVexed/PasswordCardGenerator | cc4c16d58659c229ce6241e77b7c91c11fb22566 | [
"Unlicense"
] | null | null | null | from PasswordCardGenerator import PasswordCard
from os import system
if __name__ == "__main__":
keyword = "Keyword"
card1 = PasswordCard(len(keyword), seed=10)
card2 = PasswordCard(len(keyword), seed=10)
if str(card1) != str(card2):
raise Exception("'Seed' doesn't work!")
else:
... | 29.019231 | 92 | 0.57389 |
3b757750a008ffe61d0a000aaa27fdf7a3ca7614 | 2,667 | py | Python | samples/cli/accelbyte_py_sdk_cli/platform/_sync_steam_inventory.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | samples/cli/accelbyte_py_sdk_cli/platform/_sync_steam_inventory.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | samples/cli/accelbyte_py_sdk_cli/platform/_sync_steam_inventory.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-platform-service (4.10.0)
# pylint: disable=duplicate-co... | 32.52439 | 95 | 0.721785 |
f2a93e1ccab03196e58586da05b3c719f0f9baba | 372 | py | Python | other/dingding/dingtalk/api/rest/OapiEduClassStudentinfoGetRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiEduClassStudentinfoGetRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiEduClassStudentinfoGetRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2020.08.29
'''
from dingtalk.api.base import RestApi
class OapiEduClassStudentinfoGetRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.app_id = None
self.class_id = None
self.userid = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):... | 21.882353 | 50 | 0.75 |
490048a568ffe173aaf839991c9c2f8492a6e8f9 | 7,246 | py | Python | mindmeld/components/request.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 580 | 2019-03-24T20:59:09.000Z | 2022-03-23T17:06:43.000Z | mindmeld/components/request.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 199 | 2019-04-30T18:15:46.000Z | 2022-03-22T17:11:33.000Z | mindmeld/components/request.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 164 | 2019-04-25T08:27:28.000Z | 2022-03-23T12:44:33.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 45.572327 | 98 | 0.704665 |
af5912f00a2858c64b7567514f24ec7a233d243c | 205 | py | Python | logic/menu.py | RCIX/RogueP | a3522dae65e90c16986c6254254682789e010f9f | [
"MIT"
] | 2 | 2015-09-07T10:35:12.000Z | 2015-09-12T05:55:29.000Z | logic/menu.py | RCIX/RogueP | a3522dae65e90c16986c6254254682789e010f9f | [
"MIT"
] | null | null | null | logic/menu.py | RCIX/RogueP | a3522dae65e90c16986c6254254682789e010f9f | [
"MIT"
] | null | null | null | import libtcodpy as libtcod
class Menu:
def __init__(self, width, height):
self.width = width
self.height = height
def update(self, delta):
pass
def draw(self):
pass
def exit(self):
pass | 12.8125 | 35 | 0.687805 |
33a1d07bdf0856a514764e224de3b4424ca8f5f4 | 719 | py | Python | test/test_image_op.py | brianlan/image-semantic-segmentation | aef172ed022091b9151f3eef1cc6213bbb122635 | [
"MIT"
] | 3 | 2017-09-14T16:19:46.000Z | 2018-02-28T12:51:31.000Z | test/test_image_op.py | brianlan/image-semantic-segmentation | aef172ed022091b9151f3eef1cc6213bbb122635 | [
"MIT"
] | 1 | 2017-09-14T16:20:14.000Z | 2017-09-14T16:20:14.000Z | test/test_image_op.py | brianlan/kaggle-carvana-semantic-segmentation-unet | aef172ed022091b9151f3eef1cc6213bbb122635 | [
"MIT"
] | null | null | null | import numpy as np
from image_op import run_length_encode, rlencode
def test_run_length_encode():
image = np.array([[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 0],
[0, 0... | 29.958333 | 48 | 0.30459 |
774c8b647d917d02ce459977126dec3eafb55e43 | 52,652 | py | Python | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/__init__.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 46 | 2017-09-07T14:59:22.000Z | 2020-10-31T20:34:12.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/__init__.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/__init__.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 317 | 2017-06-20T19:57:17.000Z | 2020-09-16T10:28:30.000Z | import types
import sys
import os
# comtypes version numbers follow semver (http://semver.org/) and PEP 440
__version__ = "1.1.3"
import logging
class NullHandler(logging.Handler):
"""A Handler that does nothing."""
def emit(self, record):
pass
logger = logging.getLogger(__name__)
# Add a NULL handl... | 37.851905 | 97 | 0.566797 |
2786b4cc3a63f9baf6fe5b8e270bcc00e154ab27 | 5,987 | py | Python | localstack/utils/run.py | suryatmodulus/localstack | e57ff7e62e6706001532ace412c6bceb97132cd7 | [
"Apache-2.0"
] | null | null | null | localstack/utils/run.py | suryatmodulus/localstack | e57ff7e62e6706001532ace412c6bceb97132cd7 | [
"Apache-2.0"
] | null | null | null | localstack/utils/run.py | suryatmodulus/localstack | e57ff7e62e6706001532ace412c6bceb97132cd7 | [
"Apache-2.0"
] | null | null | null | import inspect
import logging
import os
import select
import subprocess
import sys
import threading
import traceback
from concurrent.futures import Future
from typing import AnyStr, Callable, Dict, List, Optional, Union
from localstack import config
LOG = logging.getLogger(__name__)
def run(
cmd: Union[str, Lis... | 32.715847 | 100 | 0.576416 |
25ea890e8cd713dabbdccbc35db3c5d1b11cae25 | 47,608 | py | Python | app/main/views/service_settings.py | matthewford/notifications-admin | 6c6be3851e4b3f01037dc66f6d227bd741f79fb9 | [
"MIT"
] | null | null | null | app/main/views/service_settings.py | matthewford/notifications-admin | 6c6be3851e4b3f01037dc66f6d227bd741f79fb9 | [
"MIT"
] | null | null | null | app/main/views/service_settings.py | matthewford/notifications-admin | 6c6be3851e4b3f01037dc66f6d227bd741f79fb9 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from datetime import datetime
from flask import (
abort,
current_app,
flash,
jsonify,
redirect,
render_template,
request,
session,
url_for,
)
from flask_login import current_user
from notifications_python_client.errors import HTTPError
from notifi... | 37.605055 | 119 | 0.700996 |
d78ec86322cad3ee177a1022d712e16a67cba40c | 4,424 | py | Python | scripts/parse_per_flow_success.py | aakritanshuman/mtp | d24c09e99e01904ffc0d779c5e031bb7c03cff8e | [
"MIT"
] | 11 | 2020-03-03T11:58:23.000Z | 2021-04-20T02:01:30.000Z | scripts/parse_per_flow_success.py | aakritanshuman/mtp | d24c09e99e01904ffc0d779c5e031bb7c03cff8e | [
"MIT"
] | null | null | null | scripts/parse_per_flow_success.py | aakritanshuman/mtp | d24c09e99e01904ffc0d779c5e031bb7c03cff8e | [
"MIT"
] | 9 | 2020-03-17T02:17:07.000Z | 2022-02-17T16:12:31.000Z | import sys
import argparse
import statistics as stat
from config import *
import shlex
import math
delay = 30
parser = argparse.ArgumentParser('Analysis Plots')
parser.add_argument('--topo',
type=str,
required=True,
help='what topology to generate size summary for')
parser.add_argument('--pay... | 35.111111 | 122 | 0.608951 |
d9c83eb59697553d6f2986dc08c11da84511d713 | 1,077 | py | Python | zeus/api/resources/build_file_coverage.py | edgerepo/zeus | aea557bde167e95b505a42877422a652baee14c9 | [
"Apache-2.0"
] | null | null | null | zeus/api/resources/build_file_coverage.py | edgerepo/zeus | aea557bde167e95b505a42877422a652baee14c9 | [
"Apache-2.0"
] | null | null | null | zeus/api/resources/build_file_coverage.py | edgerepo/zeus | aea557bde167e95b505a42877422a652baee14c9 | [
"Apache-2.0"
] | null | null | null | from flask import request
from operator import or_
from zeus.models import Build, FileCoverage
from .base_build import BaseBuildResource
from ..schemas import FileCoverageSchema
filecoverage_schema = FileCoverageSchema(many=True, strict=True)
class BuildFileCoverageResource(BaseBuildResource):
def get(self, bu... | 29.916667 | 87 | 0.623955 |
6cb8022251748a818ad2493e5922f424cfb13471 | 5,206 | py | Python | wagtail/admin/rich_text/converters/editor_html.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 3 | 2019-05-14T13:43:08.000Z | 2021-11-09T11:27:18.000Z | wagtail/admin/rich_text/converters/editor_html.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 13 | 2019-03-25T19:57:35.000Z | 2019-12-28T19:25:23.000Z | wagtail/admin/rich_text/converters/editor_html.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 1 | 2021-08-13T15:38:43.000Z | 2021-08-13T15:38:43.000Z | from django.utils.functional import cached_property
from wagtail.core.rich_text import features as feature_registry
from wagtail.core.rich_text.rewriters import EmbedRewriter, LinkRewriter, MultiRuleRewriter
from wagtail.core.whitelist import Whitelister, allow_without_attributes
class WhitelistRule:
def __init_... | 35.414966 | 95 | 0.6529 |
33c7a2f8594a6c538e3ec703cc36c7c8326efd66 | 2,464 | py | Python | reinforce/env.py | gebob19/rl_with_jax | a30df06de3035c460e5339611974664a2130ca6e | [
"MIT"
] | 5 | 2021-08-31T22:35:08.000Z | 2021-12-15T23:07:36.000Z | reinforce/env.py | gebob19/rl_with_jax | a30df06de3035c460e5339611974664a2130ca6e | [
"MIT"
] | null | null | null | reinforce/env.py | gebob19/rl_with_jax | a30df06de3035c460e5339611974664a2130ca6e | [
"MIT"
] | null | null | null | #%%
import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
class Navigation2DEnv(gym.Env):
"""2D navigation problems, as described in [1]. The code is adapted from
https://github.com/cbfinn/maml_rl/blob/9c8e2ebd741cb0c7b8bf2d040c4caeeb8e06cc95/maml_examples/point_env_randgoal.py
... | 35.710145 | 119 | 0.628247 |
601d9075a6ea52e2216a2de14f0e25f599f37f20 | 420 | py | Python | cassis/__init__.py | ArneDefauw/dkpro-cassis | 627687225cab8fae47d386cd50c442e5b239a2f1 | [
"Apache-2.0"
] | null | null | null | cassis/__init__.py | ArneDefauw/dkpro-cassis | 627687225cab8fae47d386cd50c442e5b239a2f1 | [
"Apache-2.0"
] | null | null | null | cassis/__init__.py | ArneDefauw/dkpro-cassis | 627687225cab8fae47d386cd50c442e5b239a2f1 | [
"Apache-2.0"
] | null | null | null | """UIMA CAS processing library in Python."""
from .cas import Cas, Sofa, View
from .typesystem import TypeSystem, load_typesystem, load_dkpro_core_typesystem, merge_typesystems
from .xmi import load_cas_from_xmi
__all__ = [
"Cas",
"Sofa",
"View",
"TypeSystem",
"load_typesystem",
"load_dkpro_co... | 20 | 98 | 0.719048 |
a2e0367e70f0d6999a5f2a0daf2b76d6058e231e | 204 | py | Python | dnacauldron/AssemblyMix/mixins/__init__.py | Edinburgh-Genome-Foundry/DnaCauldron | ef1d525f2627163414b94e4fee05911634738bdf | [
"MIT"
] | 30 | 2018-05-09T14:59:03.000Z | 2022-01-08T19:00:23.000Z | dnacauldron/AssemblyMix/mixins/__init__.py | e-tomato/DnaCauldron | 5208b962e15ff2091d65df1f9be3e429cc559e08 | [
"MIT"
] | 12 | 2018-07-04T12:34:57.000Z | 2021-12-16T11:53:13.000Z | dnacauldron/AssemblyMix/mixins/__init__.py | e-tomato/DnaCauldron | 5208b962e15ff2091d65df1f9be3e429cc559e08 | [
"MIT"
] | 7 | 2017-12-13T14:33:18.000Z | 2021-03-01T08:08:57.000Z | from .ConnectorsMixin import ConnectorsMixin
from .ConstructsMixin import ConstructsMixin
from .FragmentsMixin import FragmentsMixin
from .GraphsMixin import GraphsMixin
from .PlotsMixin import PlotsMixin | 40.8 | 44 | 0.882353 |
1095fa3014f06d303390dfed0dd83418aef0b534 | 7,763 | py | Python | nlp/bert4tf2/networks/transformer_encoder.py | mikuh/models-tf2 | 1541aa4e6355e20da67d0ae562b4daa8c0823b6f | [
"MIT"
] | null | null | null | nlp/bert4tf2/networks/transformer_encoder.py | mikuh/models-tf2 | 1541aa4e6355e20da67d0ae562b4daa8c0823b6f | [
"MIT"
] | null | null | null | nlp/bert4tf2/networks/transformer_encoder.py | mikuh/models-tf2 | 1541aa4e6355e20da67d0ae562b4daa8c0823b6f | [
"MIT"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 43.127778 | 84 | 0.653742 |
892c102f12961222f4d4728e90d37e207bad160b | 1,068 | py | Python | python/dazl/model/__init__.py | digital-asset/dazl-client | 5d54edaea26d7704cc8d73e5945b37ed2806265b | [
"Apache-2.0"
] | 8 | 2019-09-08T09:41:03.000Z | 2022-02-19T12:54:30.000Z | python/dazl/model/__init__.py | digital-asset/dazl-client | 5d54edaea26d7704cc8d73e5945b37ed2806265b | [
"Apache-2.0"
] | 55 | 2019-05-30T23:00:31.000Z | 2022-01-24T01:51:32.000Z | python/dazl/model/__init__.py | digital-asset/dazl-client | 5d54edaea26d7704cc8d73e5945b37ed2806265b | [
"Apache-2.0"
] | 9 | 2019-06-30T18:15:27.000Z | 2021-12-03T10:15:27.000Z | # Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
:mod:`dazl.model` package
=========================
This module is deprecated. These types have generally moved to :mod:`dazl.client` (for the API
introduced in dazl v5) or ... | 30.514286 | 102 | 0.712547 |
26641ed9992e9178e84167bce83c72c0d30ca35a | 284 | py | Python | dist/Boxxy.app/Contents/Resources/lib/python2.7/pygame/imageext.py | JRock007/boxxy | 6c86b814baeb48513b133dad288740cddbbaff68 | [
"MIT"
] | null | null | null | dist/Boxxy.app/Contents/Resources/lib/python2.7/pygame/imageext.py | JRock007/boxxy | 6c86b814baeb48513b133dad288740cddbbaff68 | [
"MIT"
] | null | null | null | dist/Boxxy.app/Contents/Resources/lib/python2.7/pygame/imageext.py | JRock007/boxxy | 6c86b814baeb48513b133dad288740cddbbaff68 | [
"MIT"
] | null | null | null | def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__, 'imageext.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| 35.5 | 71 | 0.767606 |
c5aee8e1c718cfa86c18bd6fdd08ae85392a8cc1 | 2,792 | py | Python | nemo_text_processing/text_normalization/en/verbalizers/decimal.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | nemo_text_processing/text_normalization/en/verbalizers/decimal.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | nemo_text_processing/text_normalization/en/verbalizers/decimal.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright 2015 and onwards Google, 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/license... | 38.246575 | 154 | 0.664756 |
c00c0462f39a12ea22a9fcc5e0179af7f9dc8218 | 3,321 | py | Python | web3/providers/base.py | pscott/web3.py | 19120d26aedfbb107dc981767df5943927b6cfc5 | [
"MIT"
] | null | null | null | web3/providers/base.py | pscott/web3.py | 19120d26aedfbb107dc981767df5943927b6cfc5 | [
"MIT"
] | 1 | 2021-06-02T00:59:13.000Z | 2021-06-02T00:59:13.000Z | venv/Lib/site-packages/web3/providers/base.py | MartinMwiti/Blockchain | 450192472e85fe8a3beb0abacf2e47b8764a3574 | [
"MIT"
] | 2 | 2019-02-26T23:01:31.000Z | 2019-03-03T02:10:57.000Z | import itertools
from typing import (
TYPE_CHECKING,
Any,
Callable,
Sequence,
Tuple,
)
from eth_utils import (
to_bytes,
to_text,
)
from web3._utils.encoding import (
FriendlyJsonSerde,
)
from web3.middleware import (
combine_middlewares,
)
from web3.types import (
Middleware,
... | 30.190909 | 124 | 0.64589 |
a47c17be89b493b299b00d1ec181fba5901b96ac | 5,112 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 may ... | 46.899083 | 223 | 0.689358 |
cc9cec932203c5e2e0ff164a696e8a4b76f5a335 | 5,799 | py | Python | pts/feature/time_feature.py | adelegouttes/pytorch-ts | ecc31f60825af886940641a9f139929e50be9b30 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-05-04T18:28:38.000Z | 2021-05-04T18:28:38.000Z | pts/feature/time_feature.py | vincent-leguen/pytorch-ts | ecc31f60825af886940641a9f139929e50be9b30 | [
"Apache-2.0",
"MIT"
] | null | null | null | pts/feature/time_feature.py | vincent-leguen/pytorch-ts | ecc31f60825af886940641a9f139929e50be9b30 | [
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 28.014493 | 93 | 0.610795 |
72cc674e92466a761357c91464e1a9b4e863840b | 1,479 | gyp | Python | binding.gyp | rbuck/node-nuodb | 124d30a56b8cce97396e527f8af487bbf7ccd3d1 | [
"BSD-3-Clause"
] | 1 | 2022-01-28T06:33:02.000Z | 2022-01-28T06:33:02.000Z | binding.gyp | rbuck/node-nuodb | 124d30a56b8cce97396e527f8af487bbf7ccd3d1 | [
"BSD-3-Clause"
] | 5 | 2020-04-24T12:58:26.000Z | 2022-03-29T19:02:53.000Z | binding.gyp | rbuck/node-nuodb | 124d30a56b8cce97396e527f8af487bbf7ccd3d1 | [
"BSD-3-Clause"
] | 1 | 2022-01-28T06:33:04.000Z | 2022-01-28T06:33:04.000Z | {
"target_defaults": {
"sources": [
"src/NuoJsAddon.cpp",
"src/NuoJsConnection.cpp",
"src/NuoJsDriver.cpp",
"src/NuoJsErrMsg.cpp",
"src/NuoJsJson.cpp",
"src/NuoJsNan.cpp",
"src/NuoJsNanDate.cpp",
"src/NuoJsOptions.cpp",
"src/NuoJsParams.cpp",
"src/NuoJsR... | 22.409091 | 97 | 0.467884 |
3cb57d77f124de71995ea6ce9776d43e371480d3 | 2,740 | py | Python | tests/components/nexia/test_config_flow.py | Fred-Ch/core | 4ac4a5ada957622d8a602f9b88d13596c79f305b | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/components/nexia/test_config_flow.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/components/nexia/test_config_flow.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Test the nexia config flow."""
from asynctest import patch
from asynctest.mock import MagicMock
from requests.exceptions import ConnectTimeout
from homeassistant import config_entries, setup
from homeassistant.components.nexia.const import DOMAIN
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
async ... | 35.584416 | 86 | 0.687591 |
c10fce2a1db40d637eecc43f53d6deb687dcca5c | 1,946 | py | Python | app/user/tests/test_token_api.py | C4st3ll4n/recipe-api | af9b22d713c6dae55cd81d5d6f460223f4a79df1 | [
"MIT"
] | 1 | 2021-07-01T20:35:11.000Z | 2021-07-01T20:35:11.000Z | app/user/tests/test_token_api.py | C4st3ll4n/recipe-api | af9b22d713c6dae55cd81d5d6f460223f4a79df1 | [
"MIT"
] | null | null | null | app/user/tests/test_token_api.py | C4st3ll4n/recipe-api | af9b22d713c6dae55cd81d5d6f460223f4a79df1 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from user.tests.test_user_api import create_user
TOKEN_URL = reverse("user:token")
class PublicUserTokenAPITests(TestCase):
def setUp(self) -> None:
self.client =... | 31.387097 | 77 | 0.62333 |
f8ce469e5efda0d7e9690a410d53b8b3280043bb | 11,085 | py | Python | find_leaks.py | ironport/coreutils | c64e36256ddcfd293f6cead8cf4061a67c8a09bb | [
"MIT"
] | 2 | 2015-04-08T15:59:31.000Z | 2017-05-12T22:08:26.000Z | find_leaks.py | ironport/coreutils | c64e36256ddcfd293f6cead8cf4061a67c8a09bb | [
"MIT"
] | null | null | null | find_leaks.py | ironport/coreutils | c64e36256ddcfd293f6cead8cf4061a67c8a09bb | [
"MIT"
] | null | null | null | # -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# 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 lim... | 32.130435 | 98 | 0.601173 |
593161f1eea8583863d1efa66c7deec0efd5cef8 | 14,660 | py | Python | perf/twoPodTest/runner/prom.py | philrud/tools | b5d110d701e97b695206c23fdefe7de10205b13a | [
"Apache-2.0"
] | 1 | 2019-02-14T01:24:27.000Z | 2019-02-14T01:24:27.000Z | perf/twoPodTest/runner/prom.py | philrud/tools | b5d110d701e97b695206c23fdefe7de10205b13a | [
"Apache-2.0"
] | null | null | null | perf/twoPodTest/runner/prom.py | philrud/tools | b5d110d701e97b695206c23fdefe7de10205b13a | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import datetime
import calendar
import requests
import collections
import os
import json
import argparse
class Prom(object):
# url: base url for prometheus
#
def __init__(self, url, nseconds, end=None, host=None, start=None):
self.url = url
self.nseco... | 36.019656 | 134 | 0.593861 |
f9f6c244c33cb2ff1a5327f7683967e7866f64eb | 11,815 | py | Python | models/single_stream/baseline_pretrain.py | codezakh/ALBEF | 16aee1da1b7682afcd5a5f1ded74fc8dc199a8cf | [
"BSD-3-Clause"
] | null | null | null | models/single_stream/baseline_pretrain.py | codezakh/ALBEF | 16aee1da1b7682afcd5a5f1ded74fc8dc199a8cf | [
"BSD-3-Clause"
] | 2 | 2022-02-02T12:55:59.000Z | 2022-02-17T14:39:19.000Z | models/single_stream/baseline_pretrain.py | codezakh/ALBEF | 16aee1da1b7682afcd5a5f1ded74fc8dc199a8cf | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
from models.vit import VisionTransformer, interpolate_pos_embed
# from models.xbert import BertConfig, BertForMaskedLM
from models.xbert import BertConfig, BertModel, BertForMaskedLM
from typing import Dict
import torch
import torch.nn.functional as F
from torch import nn
import numpy as... | 44.753788 | 122 | 0.628862 |
9997c00df74c4ee9840eac61dd91d0534ed4f041 | 30,975 | py | Python | esmvaltool/diag_scripts/mlr/postprocess.py | cffbots/ESMValTool | a9b6592a02f2085634a214ff5f36a736fa18ff47 | [
"Apache-2.0"
] | 148 | 2017-02-07T13:16:03.000Z | 2022-03-26T02:21:56.000Z | esmvaltool/diag_scripts/mlr/postprocess.py | cffbots/ESMValTool | a9b6592a02f2085634a214ff5f36a736fa18ff47 | [
"Apache-2.0"
] | 2,026 | 2017-02-03T12:57:13.000Z | 2022-03-31T15:11:51.000Z | esmvaltool/diag_scripts/mlr/postprocess.py | cffbots/ESMValTool | a9b6592a02f2085634a214ff5f36a736fa18ff47 | [
"Apache-2.0"
] | 113 | 2017-01-27T13:10:19.000Z | 2022-02-03T13:42:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple postprocessing of MLR model output.
Description
-----------
This diagnostic performs postprocessing operations for MLR model output (mean
and error).
Author
------
Manuel Schlund (DLR, Germany)
Project
-------
CRESCENDO
Notes
-----
Prior to postprocessing, thi... | 39.813625 | 79 | 0.661178 |
31be38f2aeda071c2b46ff6f09dbfdd580a39207 | 974 | py | Python | SearchAlgorithms/dfs.py | abecus/Artificial-Intelligence | af784ddf4b052fc4d4be681154d619bcb43068f6 | [
"MIT"
] | 1 | 2019-05-21T16:15:18.000Z | 2019-05-21T16:15:18.000Z | SearchAlgorithms/dfs.py | abecus/Artificial-Intelligence | af784ddf4b052fc4d4be681154d619bcb43068f6 | [
"MIT"
] | null | null | null | SearchAlgorithms/dfs.py | abecus/Artificial-Intelligence | af784ddf4b052fc4d4be681154d619bcb43068f6 | [
"MIT"
] | null | null | null | # As a stand-alone, generally used to find if node exists in the graph, and to
# find a path to it
from graphExamples import *
def dfs(G, start, end):
"""
G: graph
start: start node
end: end node
"""
if start==end:
return end
visited = set()
path = []
def helper(node):
if node == end:
# fou... | 18.377358 | 79 | 0.632444 |
2b5ccdfc2575b77d8a4a6de2d34a6727b83c1456 | 5,764 | py | Python | datar/dplyr/bind.py | pdwaggoner/datar | a03f1c0ca0de1270059178e59cea151a51a6e7aa | [
"MIT"
] | null | null | null | datar/dplyr/bind.py | pdwaggoner/datar | a03f1c0ca0de1270059178e59cea151a51a6e7aa | [
"MIT"
] | null | null | null | datar/dplyr/bind.py | pdwaggoner/datar | a03f1c0ca0de1270059178e59cea151a51a6e7aa | [
"MIT"
] | null | null | null | """Bind multiple data frames by row and column
See https://github.com/tidyverse/dplyr/blob/master/R/bind.r
"""
from pipda import register_verb
from ..core.backends import pandas as pd
from ..core.backends.pandas import DataFrame, Categorical
from ..core.backends.pandas.api.types import (
union_categoricals,
i... | 29.558974 | 76 | 0.605135 |
a49c998df384199621e80833aacfb144376ca8fe | 179 | py | Python | whatlies/__init__.py | thiippal/whatlies | 4402e69299bd5074f870549e62e818c2cf80d76e | [
"Apache-2.0"
] | null | null | null | whatlies/__init__.py | thiippal/whatlies | 4402e69299bd5074f870549e62e818c2cf80d76e | [
"Apache-2.0"
] | null | null | null | whatlies/__init__.py | thiippal/whatlies | 4402e69299bd5074f870549e62e818c2cf80d76e | [
"Apache-2.0"
] | null | null | null | """
Whatlies library
"""
__version__ = "0.5.10"
from whatlies.embeddingset import EmbeddingSet
from whatlies.embedding import Embedding
__all__ = ["Embedding", "EmbeddingSet"]
| 16.272727 | 46 | 0.759777 |
ca903a9cd615fee6f997fcbdd4c9c64e8299be9d | 73,701 | py | Python | venv/lib/python3.7/site-packages/elasticsearch/client/__init__.py | findritesh/flaskApp | 33549696065fa5819f22a0595244f033334466d0 | [
"MIT"
] | 2 | 2019-11-29T13:47:15.000Z | 2020-07-08T06:25:47.000Z | venv/lib/python3.7/site-packages/elasticsearch/client/__init__.py | findritesh/flaskApp | 33549696065fa5819f22a0595244f033334466d0 | [
"MIT"
] | 6 | 2020-06-05T18:39:11.000Z | 2022-01-13T00:49:22.000Z | venv/lib/python3.7/site-packages/elasticsearch/client/__init__.py | Benlarkin/flask_practice | 1ea667c3590648f806ef19433f9947fc2221e9bf | [
"MIT"
] | 1 | 2020-04-23T09:01:13.000Z | 2020-04-23T09:01:13.000Z | from __future__ import unicode_literals
import logging
from ..transport import Transport
from ..exceptions import TransportError
from ..compat import string_types, urlparse, unquote
from .indices import IndicesClient
from .ingest import IngestClient
from .cluster import ClusterClient
from .cat import CatClient
from .n... | 52.870158 | 104 | 0.655391 |
a00fc0838004e0fed9a6229b3a664acf73edb3a6 | 3,137 | py | Python | hanoi/main.py | sh05/tiny_products | c966b259a55a27e38cc044be394e384b9a8945a3 | [
"MIT"
] | null | null | null | hanoi/main.py | sh05/tiny_products | c966b259a55a27e38cc044be394e384b9a8945a3 | [
"MIT"
] | null | null | null | hanoi/main.py | sh05/tiny_products | c966b259a55a27e38cc044be394e384b9a8945a3 | [
"MIT"
] | null | null | null | import sys, time, argparse
print = sys.stdout.write
class Tower:
def __init__(self, n=0):
self.floors = [i for i in reversed(range(1, n+1))]
def stack(self, floor):
if len(self.floors) > 0:
assert floor < self.floors[-1], "Tower must be shaped pyramid, {}".format(self.floors)
... | 32.010204 | 99 | 0.551801 |
69ba044b25c7e5f6cedc102c532ee128e6201622 | 921 | py | Python | generate.py | gokuldas/archlinux_ml_fonts | 250f386eb92ec1ab3fe72921a383ae25f6e3ece4 | [
"MIT"
] | null | null | null | generate.py | gokuldas/archlinux_ml_fonts | 250f386eb92ec1ab3fe72921a383ae25f6e3ece4 | [
"MIT"
] | null | null | null | generate.py | gokuldas/archlinux_ml_fonts | 250f386eb92ec1ab3fe72921a383ae25f6e3ece4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from urllib.request import urlopen
from hashlib import md5
with open("./proto/urllist.txt", 'r') as f:
urls = f.readlines()
sfile = "\n"
smd5 = "\n"
urls = [i.strip() for i in urls]
n = len(urls)
for count, i in enumerate(urls):
print("Processing({:2d}/{:2d}): {}".format(count + 1, n,... | 24.891892 | 64 | 0.618893 |
94ac09e357f1ffed9e99c5679ee629f0792b3aad | 4,693 | py | Python | lintcode/630.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | 1 | 2021-01-08T06:57:49.000Z | 2021-01-08T06:57:49.000Z | lintcode/630.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | null | null | null | lintcode/630.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | 1 | 2021-01-08T06:57:52.000Z | 2021-01-08T06:57:52.000Z | import sys
DELTA_DIRECTIONS = [
(1, 2),
(-1, 2),
(2, 1),
(-2, 1)
]
class Solution:
"""
@param grid: a chessboard included 0 and 1
@return: the shortest path
"""
def shortestPath2(self, grid):
# write your code here
if not grid or not grid[0]:
return -1
... | 88.54717 | 3,128 | 0.471766 |
3b1454cae0eb8e56875019f7219683c0130c4d1b | 3,310 | py | Python | virtual/lib/python3.6/site-packages/pylint/extensions/overlapping_exceptions.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | virtual/lib/python3.6/site-packages/pylint/extensions/overlapping_exceptions.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 16 | 2020-02-12T00:28:11.000Z | 2022-03-11T23:48:19.000Z | virtual/lib/python3.6/site-packages/pylint/extensions/overlapping_exceptions.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | # -*- coding: utf-8 -*-
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
"""Looks for overlapping exceptions."""
import astroid
from pylint import interfaces
from pylint import checkers
from pylint.checkers import uti... | 36.373626 | 88 | 0.543505 |
3c5022f623c1e94cec3b4381ae0e5e1c299d6d2d | 20,589 | py | Python | bin/basenji_sat2.py | AndyPJiang/basenji | 64e43570c8bece156b4ab926608014f489b7965e | [
"Apache-2.0"
] | 1 | 2020-05-22T20:53:37.000Z | 2020-05-22T20:53:37.000Z | bin/basenji_sat2.py | AndyPJiang/basenji | 64e43570c8bece156b4ab926608014f489b7965e | [
"Apache-2.0"
] | null | null | null | bin/basenji_sat2.py | AndyPJiang/basenji | 64e43570c8bece156b4ab926608014f489b7965e | [
"Apache-2.0"
] | 1 | 2021-02-05T21:01:05.000Z | 2021-02-05T21:01:05.000Z | #!/usr/bin/env python
# Copyright 2017 Calico 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 ... | 30.367257 | 118 | 0.619748 |
63e9c01feba50b7850aa96ab3675179d5c20714f | 475 | py | Python | topCoder/srms/400s/srm421/div2/gym_training.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 25 | 2015-01-21T16:39:18.000Z | 2021-05-24T07:01:24.000Z | topCoder/srms/400s/srm421/div2/gym_training.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 2 | 2020-09-30T19:39:36.000Z | 2020-10-01T17:15:16.000Z | topCoder/srms/400s/srm421/div2/gym_training.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 15 | 2015-01-21T16:39:27.000Z | 2020-10-01T17:00:22.000Z | class GymTraining:
def trainingTime(self, needToTrain, minPulse, maxPulse, trainChange, restChange):
p, c = minPulse, 0
if maxPulse - minPulse >= trainChange:
while needToTrain > 0:
if p + trainChange <= maxPulse:
p += trainChange
n... | 36.538462 | 85 | 0.505263 |
9582d3f941527c7a28f8bd7938b43fba6f61ee83 | 5,370 | py | Python | network-setup/image/setup.py | Magnitus-/DockerFiles | 57b986f36ce3dda7e74ce7dd277f7c74ddb6c0ec | [
"MIT"
] | 13 | 2016-07-29T11:39:56.000Z | 2022-01-31T13:41:53.000Z | network-setup/image/setup.py | driedel-zz/DockerFiles | 57b986f36ce3dda7e74ce7dd277f7c74ddb6c0ec | [
"MIT"
] | null | null | null | network-setup/image/setup.py | driedel-zz/DockerFiles | 57b986f36ce3dda7e74ce7dd277f7c74ddb6c0ec | [
"MIT"
] | 12 | 2018-06-13T10:56:19.000Z | 2022-02-02T04:46:27.000Z | #!/usr/local/bin/python
import os
import datetime
import re
import docker
from jinja2 import Template
from yaml import load
TEMPLATES_DIRECTORY = os.environ['TEMPLATE_DIRECTORY']
CONFIG_DIRECTORY = os.environ['CONFIG_DIRECTORY']
SERVICE_NAMES = {
'dns': os.environ.get('DNS_SERVICE_NAME', 'dns'),
'dhcp': os.... | 36.283784 | 124 | 0.641713 |
c17e304c03adf4c3b64e17bc833544b3f8cb646d | 8,848 | py | Python | simplejira/resource_collections.py | RonnyPfannschmidt-RedHat/jiraprompt | eab3c12d445b731c7f29fd01cac8d79753797987 | [
"MIT"
] | null | null | null | simplejira/resource_collections.py | RonnyPfannschmidt-RedHat/jiraprompt | eab3c12d445b731c7f29fd01cac8d79753797987 | [
"MIT"
] | null | null | null | simplejira/resource_collections.py | RonnyPfannschmidt-RedHat/jiraprompt | eab3c12d445b731c7f29fd01cac8d79753797987 | [
"MIT"
] | null | null | null | from __future__ import print_function
import copy
from inspect import isclass, isfunction
import attr
import yaml
from attr.validators import optional, instance_of
from jira.resources import Resource, Issue, Worklog
from prettytable import PrettyTable
from .common import iso_to_ctime_str, friendly_worklog_time, iso_... | 35.96748 | 98 | 0.613359 |
3b4afd190dd6bb1d429513093dc4d5032283674b | 2,017 | py | Python | src/ref_solution.py | pcmagic/stokes_flow | 464d512d3739eee77b33d1ebf2f27dae6cfa0423 | [
"MIT"
] | 1 | 2018-11-11T05:00:53.000Z | 2018-11-11T05:00:53.000Z | src/ref_solution.py | pcmagic/stokes_flow | 464d512d3739eee77b33d1ebf2f27dae6cfa0423 | [
"MIT"
] | null | null | null | src/ref_solution.py | pcmagic/stokes_flow | 464d512d3739eee77b33d1ebf2f27dae6cfa0423 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Contain reference solutions of different problems, i.e., analytical solution of sphere case.
Zhang Ji, 20161204
"""
from src import stokes_flow as sf
import numpy as np
from src.geo import *
from numpy import sin, cos, sqrt
__all__ = ['slt', 'sphere_slt']
# Todo: warnning what need I kno... | 31.515625 | 137 | 0.554289 |
5b4d0ffb95a63334aff9d3b0e0706a0bd86e6b93 | 3,097 | py | Python | docs/autodoc.py | tillahoffmann/docker_interface | ed9ac691ca22dc2937e717af7f6b5fc7de19c660 | [
"Apache-2.0"
] | 32 | 2018-03-11T01:09:47.000Z | 2022-03-20T19:21:17.000Z | docs/autodoc.py | tillahoffmann/docker_interface | ed9ac691ca22dc2937e717af7f6b5fc7de19c660 | [
"Apache-2.0"
] | 7 | 2018-05-01T15:28:55.000Z | 2018-09-24T13:16:33.000Z | docs/autodoc.py | tillahoffmann/docker_interface | ed9ac691ca22dc2937e717af7f6b5fc7de19c660 | [
"Apache-2.0"
] | 14 | 2018-03-09T12:40:46.000Z | 2022-03-19T09:59:08.000Z | # Copyright 2018 Spotify AB
# 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, soft... | 34.797753 | 302 | 0.659671 |
e28eef6bcdb1df04b8b8aaee259a3f2f2d18febb | 6,128 | py | Python | Main project/code.py | cyrobotcoder/cuExchange_Hoohacks_2021 | d23478130322aa52220dbd379cabb1174048d2b5 | [
"MIT"
] | null | null | null | Main project/code.py | cyrobotcoder/cuExchange_Hoohacks_2021 | d23478130322aa52220dbd379cabb1174048d2b5 | [
"MIT"
] | 2 | 2021-03-28T07:27:55.000Z | 2021-04-26T14:19:39.000Z | Main project/code.py | cyrobotcoder/cuExchange_Hoohacks_2021 | d23478130322aa52220dbd379cabb1174048d2b5 | [
"MIT"
] | 1 | 2021-03-27T18:14:10.000Z | 2021-03-27T18:14:10.000Z | from tkinter import *
from tkinter import messagebox
from PIL import ImageTk, Image
from forex_python.converter import CurrencyRates
from forex_python.bitcoin import BtcConverter
import tkinter.font as font
root = Tk()
root.title("REAL TIME CURRENCY CONVERTOR")
root.minsize(600,500)
root.maxsize(600,500)
... | 37.365854 | 255 | 0.61015 |
5a73203619f0f127c72fd38037c2068d2a072552 | 777 | py | Python | src/relations_iterator/iterator.py | regqueryvalueex/django-relations-iterator | b4ea23bbedf8f192841d8005b3d703949f348caa | [
"MIT"
] | 1 | 2022-02-21T19:27:04.000Z | 2022-02-21T19:27:04.000Z | src/relations_iterator/iterator.py | regqueryvalueex/django-relations-iterator | b4ea23bbedf8f192841d8005b3d703949f348caa | [
"MIT"
] | null | null | null | src/relations_iterator/iterator.py | regqueryvalueex/django-relations-iterator | b4ea23bbedf8f192841d8005b3d703949f348caa | [
"MIT"
] | null | null | null | import typing
from .relation_tree import ConfigurableRelationTree, RelationTree
from abc import ABC, abstractmethod
class AbstractRelationTreeIterator(ABC):
@abstractmethod
def get_iterator(self, tree: typing.Optional[RelationTree] = None):
pass
def __iter__(self):
return self.get_iter... | 27.75 | 71 | 0.701416 |
7da1bc7f3b0d792ea22a666a7953330c28e7266f | 8,926 | py | Python | Sandbox/mpi_bitweights_debug.py | echaussidon/LSS | 205ce48a288acacbd41358e6d0215f4aff355049 | [
"BSD-3-Clause"
] | 8 | 2017-04-12T14:52:26.000Z | 2022-01-04T08:54:18.000Z | Sandbox/mpi_bitweights_debug.py | echaussidon/LSS | 205ce48a288acacbd41358e6d0215f4aff355049 | [
"BSD-3-Clause"
] | 13 | 2017-10-26T22:06:24.000Z | 2022-03-31T15:29:06.000Z | Sandbox/mpi_bitweights_debug.py | echaussidon/LSS | 205ce48a288acacbd41358e6d0215f4aff355049 | [
"BSD-3-Clause"
] | 13 | 2015-10-26T17:30:10.000Z | 2022-02-22T09:24:38.000Z | #!/usr/bin/env python
"""
Compute bit weights in parallel to be used for PIP or IIP weights
Example run at NERSC:
srun -N 16 -c 8 -C haswell -A desi --qos=interactive -t 0:30:0 mpi_bitweights
--mtl LRG_oneperztrue_clus.dat.fits --format hdf5 --outdir output --realizations 128
Notes:
- Runs on master version of ... | 38.808696 | 125 | 0.624468 |
e34d373cea53fa85290f71f29b60cf3c55e392e9 | 4,154 | py | Python | store/sqlite.py | bowlofstew/client | 0d5ae42aaf9863e3871828b6df06170aad17c560 | [
"MIT"
] | 40 | 2015-04-15T09:40:23.000Z | 2022-02-11T11:07:24.000Z | store/sqlite.py | bowlofstew/client | 0d5ae42aaf9863e3871828b6df06170aad17c560 | [
"MIT"
] | 19 | 2015-04-15T18:34:53.000Z | 2018-11-17T00:11:05.000Z | store/sqlite.py | bowlofstew/client | 0d5ae42aaf9863e3871828b6df06170aad17c560 | [
"MIT"
] | 22 | 2015-04-15T09:45:46.000Z | 2020-09-29T17:04:19.000Z | import sqlite3
from biicode.client.exception import ClientException
import os
class SQLiteDB(object):
def __init__(self, dbfile_path):
if not os.path.exists(dbfile_path):
par = os.path.dirname(dbfile_path)
if not os.path.exists(par):
os.makedirs(par)
dbf... | 39.942308 | 99 | 0.600626 |
bc69155cf8f70199c0eb5798b3e4d7c5f121d953 | 3,712 | py | Python | mypy/test/testpythoneval.py | wiktorn/mypy | abd319ab80d476f14e96918d5615fa0ac5b41d75 | [
"PSF-2.0"
] | 1 | 2019-06-15T08:26:28.000Z | 2019-06-15T08:26:28.000Z | mypy/test/testpythoneval.py | wiktorn/mypy | abd319ab80d476f14e96918d5615fa0ac5b41d75 | [
"PSF-2.0"
] | 1 | 2021-03-31T20:22:11.000Z | 2021-03-31T20:22:11.000Z | mypy/test/testpythoneval.py | wiktorn/mypy | abd319ab80d476f14e96918d5615fa0ac5b41d75 | [
"PSF-2.0"
] | null | null | null | """Test cases for running mypy programs using a Python interpreter.
Each test case type checks a program then runs it using Python. The
output (stdout) of the program is compared to expected output. Type checking
uses full builtins and other stubs.
Note: Currently Python interpreter paths are hard coded.
Note: These... | 35.692308 | 94 | 0.676185 |
51ee0f3f829dd62efacf07779c5811fa2774f02e | 1,926 | py | Python | esque_wire/protocol/serializers/api/delete_topics_response.py | real-digital/esque-wire | eb02c49f38b89ad5e5d25aad15fb4ad795e52807 | [
"MIT"
] | null | null | null | esque_wire/protocol/serializers/api/delete_topics_response.py | real-digital/esque-wire | eb02c49f38b89ad5e5d25aad15fb4ad795e52807 | [
"MIT"
] | 7 | 2019-11-26T08:19:49.000Z | 2021-03-15T14:27:47.000Z | esque_wire/protocol/serializers/api/delete_topics_response.py | real-digital/esque-wire | eb02c49f38b89ad5e5d25aad15fb4ad795e52807 | [
"MIT"
] | null | null | null | ###############################################################
# Autogenerated module. Please don't modify. #
# Edit according file in protocol_generator/templates instead #
###############################################################
from typing import Dict
from ...structs.api.delete_topics_resp... | 37.764706 | 103 | 0.69055 |
db4df11429409f2cc7d51f09a413e1f92813c769 | 22,062 | py | Python | Program_Final/venv/Lib/site-packages/Bio/Phylo/_utils.py | isacasini/SNV_Xia_et_al_2020 | d729b68e37babf9d30941683af6723aad65319f7 | [
"MIT"
] | 2 | 2019-11-21T02:34:52.000Z | 2021-02-14T07:47:43.000Z | Bio/Phylo/_utils.py | EngineerKhan/biopython | 4e359e2aa9255aa8b420ad512d3c4cbe15c07a35 | [
"BSD-3-Clause"
] | null | null | null | Bio/Phylo/_utils.py | EngineerKhan/biopython | 4e359e2aa9255aa8b420ad512d3c4cbe15c07a35 | [
"BSD-3-Clause"
] | 1 | 2021-02-14T07:47:46.000Z | 2021-02-14T07:47:46.000Z | # Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Utilities for handling, displaying and exporting Phylo trees.
Third-party libraries ... | 41.007435 | 92 | 0.607742 |
ac5ee5e3d6ca7803fb744f2bcce7f624e4f766a1 | 2,891 | py | Python | velodyne_pointcloud/launch/velodyne_convert_node-VLP16-composed-launch.py | kquigley29/velodyne | f1b45f56b0fd3b8b76244926a9f730e2e5b63a30 | [
"BSD-3-Clause"
] | null | null | null | velodyne_pointcloud/launch/velodyne_convert_node-VLP16-composed-launch.py | kquigley29/velodyne | f1b45f56b0fd3b8b76244926a9f730e2e5b63a30 | [
"BSD-3-Clause"
] | null | null | null | velodyne_pointcloud/launch/velodyne_convert_node-VLP16-composed-launch.py | kquigley29/velodyne | f1b45f56b0fd3b8b76244926a9f730e2e5b63a30 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 Open Source Robotics Foundation, Inc.
# All rights reserved.
#
# Software License Agreement (BSD License 2.0)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must ... | 42.514706 | 94 | 0.737115 |
4a84d4bf0fbca57295d8dca979ee0ad5b13eb405 | 22 | py | Python | tempCodeRunnerFile.py | prikmm/AI-Concepts | 4b1e7229b835a4924bc2ac5e02c0ac2c500f1203 | [
"MIT"
] | 1 | 2022-02-24T12:13:25.000Z | 2022-02-24T12:13:25.000Z | tempCodeRunnerFile.py | prikmm/AI-Concepts | 4b1e7229b835a4924bc2ac5e02c0ac2c500f1203 | [
"MIT"
] | null | null | null | tempCodeRunnerFile.py | prikmm/AI-Concepts | 4b1e7229b835a4924bc2ac5e02c0ac2c500f1203 | [
"MIT"
] | null | null | null | import ipython.display | 22 | 22 | 0.909091 |
b5e6baf837f15a2ec66a964709a9bbeac6f0c580 | 807 | py | Python | evap/development/views.py | JannisBerndt/EvaP | a3ca8bcf091e811421084c4db14ae9666cf2a27f | [
"MIT"
] | 26 | 2015-01-18T18:01:57.000Z | 2018-10-12T14:37:15.000Z | evap/development/views.py | JannisBerndt/EvaP | a3ca8bcf091e811421084c4db14ae9666cf2a27f | [
"MIT"
] | 737 | 2015-01-02T17:43:25.000Z | 2018-12-10T20:45:10.000Z | evap/development/views.py | JannisBerndt/EvaP | a3ca8bcf091e811421084c4db14ae9666cf2a27f | [
"MIT"
] | 83 | 2015-01-14T12:39:41.000Z | 2018-10-29T16:36:43.000Z | import os
from django.conf import settings
from django.core.exceptions import BadRequest
from django.http import HttpResponse
from django.shortcuts import render
def development_components(request):
theme_colors = ["primary", "secondary", "success", "info", "warning", "danger", "light", "dark"]
template_data... | 33.625 | 100 | 0.723668 |
f7965bd2b72d62544298c50ec2607fff883c8f8f | 393 | py | Python | reinforch/core/logger/logger.py | kaixinbaba/reinforch | 10a8c21054cbfa03e059e2e19bee7c257faab4bf | [
"MIT"
] | 3 | 2019-04-18T22:20:25.000Z | 2019-04-19T04:51:53.000Z | reinforch/core/logger/logger.py | kaixinbaba/reinforch | 10a8c21054cbfa03e059e2e19bee7c257faab4bf | [
"MIT"
] | null | null | null | reinforch/core/logger/logger.py | kaixinbaba/reinforch | 10a8c21054cbfa03e059e2e19bee7c257faab4bf | [
"MIT"
] | null | null | null | import sys
from logbook import Logger, StreamHandler, INFO, DEBUG, WARNING, ERROR, CRITICAL
StreamHandler(sys.stdout).push_application()
LEVEL = dict(
debug=DEBUG,
info=INFO,
warning=WARNING,
warn=WARNING,
error=ERROR,
critical=CRITICAL,
)
default_level = LEVEL['info']
def Log(name, level=... | 16.375 | 80 | 0.709924 |
e586da594a1f3310311f009f9e429b6d143372aa | 4,877 | py | Python | tests/test_boosted.py | fractional-ray/fbpic | 2574662669acead79190fdb416723ac359fceceb | [
"BSD-3-Clause-LBNL"
] | 2 | 2020-11-21T07:39:05.000Z | 2020-11-21T14:00:32.000Z | tests/test_boosted.py | RemiLehe/fbpic | f0d55048eb669081c26eff28fee39891b62aaeb2 | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/test_boosted.py | RemiLehe/fbpic | f0d55048eb669081c26eff28fee39891b62aaeb2 | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-11-05T03:03:50.000Z | 2019-11-05T03:03:50.000Z | # Copyright 2016, FBPIC contributors
# Authors: Remi Lehe, Manuel Kirchen
# License: 3-Clause-BSD-LBNL
"""
This test file is part of FB-PIC (Fourier-Bessel Particle-In-Cell).
It simulates a relativistic plasma flowing through a periodic box.
This test checks that the Galilean option prevents the Cherenkov instability.... | 32.731544 | 125 | 0.622719 |
d49ec86436500edb896b860106ab01e85ba01c89 | 6,815 | py | Python | certbot-nginx/certbot_nginx/tls_sni_01.py | wimnat/certbot | 139ef206504ca241ae276b383c3cddee73db15cc | [
"Apache-2.0"
] | null | null | null | certbot-nginx/certbot_nginx/tls_sni_01.py | wimnat/certbot | 139ef206504ca241ae276b383c3cddee73db15cc | [
"Apache-2.0"
] | null | null | null | certbot-nginx/certbot_nginx/tls_sni_01.py | wimnat/certbot | 139ef206504ca241ae276b383c3cddee73db15cc | [
"Apache-2.0"
] | null | null | null | """A class that performs TLS-SNI-01 challenges for Nginx"""
import logging
import os
import six
from certbot import errors
from certbot.plugins import common
from certbot_nginx import obj
from certbot_nginx import nginxparser
logger = logging.getLogger(__name__)
class NginxTlsSni01(common.TLSSNI01):
"""TLS-... | 38.286517 | 92 | 0.57843 |
a0cf14699c28a857726f2a4151537dafa357e240 | 5,675 | py | Python | snippets/EM/2Dprops_classifier/2Dprops_classification_train.py | michielkleinnijenhuis/EM | f46a9b11298919b359e80d9f23a7e824df1356cb | [
"Apache-2.0"
] | null | null | null | snippets/EM/2Dprops_classifier/2Dprops_classification_train.py | michielkleinnijenhuis/EM | f46a9b11298919b359e80d9f23a7e824df1356cb | [
"Apache-2.0"
] | null | null | null | snippets/EM/2Dprops_classifier/2Dprops_classification_train.py | michielkleinnijenhuis/EM | f46a9b11298919b359e80d9f23a7e824df1356cb | [
"Apache-2.0"
] | null | null | null |
# coding: utf-8
# In[3]:
get_ipython().magic(u'matplotlib nbagg')
import os
import h5py
import numpy as np
from sklearn import svm
import pickle
from sklearn.externals import joblib
from sklearn import preprocessing
from skimage.morphology import binary_dilation
from wmem import utils, stack2stack
datadir = "/Use... | 25.795455 | 109 | 0.668546 |
5b967d33482f1e2c5eb0f2d3fce03efc379d6bed | 933 | py | Python | Day 10/day10-1.py | dklem/Advent-of-Code-2021 | f2d1f2e44a36c6476254c720d010b8ccceed041a | [
"MIT"
] | null | null | null | Day 10/day10-1.py | dklem/Advent-of-Code-2021 | f2d1f2e44a36c6476254c720d010b8ccceed041a | [
"MIT"
] | null | null | null | Day 10/day10-1.py | dklem/Advent-of-Code-2021 | f2d1f2e44a36c6476254c720d010b8ccceed041a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def translate(character):
if character in opening:
return(closing[opening.index(character)])
if character in closing:
index = closing.index(character)
return(opening[closing.index(character)])
# Read in file
with open('input.txt', 'r') as f:
lines = f.read().splitlines()
opening = [... | 20.282609 | 67 | 0.613076 |
dfbb3a04587d6d2a0c3efbcc4ac622c683a37241 | 19,615 | py | Python | python/istio_api/operator/v1alpha1/operator_pb2.py | yxue/api | 8af5bcd0f10cb1fc026dd1c1ed7fe4cc5b2dd792 | [
"Apache-2.0"
] | null | null | null | python/istio_api/operator/v1alpha1/operator_pb2.py | yxue/api | 8af5bcd0f10cb1fc026dd1c1ed7fe4cc5b2dd792 | [
"Apache-2.0"
] | null | null | null | python/istio_api/operator/v1alpha1/operator_pb2.py | yxue/api | 8af5bcd0f10cb1fc026dd1c1ed7fe4cc5b2dd792 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: operator/v1alpha1/operator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 45.510441 | 2,008 | 0.766556 |
23dd59ca5355f527c777048436ae9d3c120a6dcc | 485 | py | Python | classify/loginit.py | OminiaVincit/scale-variant-topo | 6945bc42aacd0d71a6fb472c87e09da223821e1e | [
"MIT"
] | 8 | 2018-11-09T21:59:59.000Z | 2020-07-22T19:02:10.000Z | classify/loginit.py | OminiaVincit/scale-variant-topo | 6945bc42aacd0d71a6fb472c87e09da223821e1e | [
"MIT"
] | null | null | null | classify/loginit.py | OminiaVincit/scale-variant-topo | 6945bc42aacd0d71a6fb472c87e09da223821e1e | [
"MIT"
] | null | null | null | import logging
def get_module_logger(modname, filename):
logger = logging.getLogger(modname)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger.addHand... | 30.3125 | 89 | 0.713402 |
3b3c159576da0860ff0f499e2f33e651fa6190a0 | 62,602 | py | Python | tests/unit/modules/test_state.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_state.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_state.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Rahul Handay <rahulha@saltstack.com>
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import os
import shutil
import tempfile
import textwrap
# Import Salt Testing Libs
from tests.support.mixins import LoaderModu... | 39.077403 | 122 | 0.476694 |
fa9bceb9923384ae33070ac5b9fbed6aa05e48b8 | 6,912 | py | Python | spectrochempy/core/analysis/efa.py | dcambie/spectrochempy | e376082d66be7a4c528b7d83be076d77534e39bd | [
"CECILL-B"
] | 3 | 2021-04-09T09:13:21.000Z | 2022-01-09T00:05:42.000Z | spectrochempy/core/analysis/efa.py | fernandezc/spectrochempy | 4707c51dba0032c160afc40682fa16d4b9855ded | [
"CECILL-B"
] | null | null | null | spectrochempy/core/analysis/efa.py | fernandezc/spectrochempy | 4707c51dba0032c160afc40682fa16d4b9855ded | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See ful... | 33.553398 | 120 | 0.477575 |
470cf98df1ece3f05eead740f24092d83d11971a | 1,957 | py | Python | azure-keyvault/azure/keyvault/v2016_10_01/models/secret_item_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-keyvault/azure/keyvault/v2016_10_01/models/secret_item_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-keyvault/azure/keyvault/v2016_10_01/models/secret_item_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 36.924528 | 110 | 0.607563 |
13c6a62fe938c9b245f751e6b2f57fa531e18f11 | 1,137 | py | Python | polls/tests.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | polls/tests.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | polls/tests.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
import datetime
from django.utils import timezone
from django.test import TestCase
from .models import Question
class QuestionMethonTests(TestCase):
def test_was_published_recently_with_future_question(self):
'''
在将来发布的问卷应该返回false
... | 33.441176 | 84 | 0.694811 |
08e6d6692eaa1c2135c7da9206fb049617c840cb | 2,891 | py | Python | lesson09/qiangshihong/devops/hello/views.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson09/qiangshihong/devops/hello/views.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson09/qiangshihong/devops/hello/views.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null |
# Create your views here.
from django.http import HttpResponse, QueryDict, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
# 练习一
# def index(request):
# return HttpResponse("<p>Hello World,Hello, Django</p>")
# 练习二
def index(request):
# 普通参数的接受方法
# 方法一、设置默认值的方式获取数据... | 32.483146 | 117 | 0.589415 |
37b9a41cdf653c3ac8fdf26951809a6d6aa8d3f1 | 7,178 | py | Python | game.py | Swapnil-Srivastava273/python-board-game | 5fd730d40fdfcef918060064b09994f86c3113c9 | [
"MIT"
] | 1 | 2021-11-29T07:27:07.000Z | 2021-11-29T07:27:07.000Z | game.py | Swapnil-Srivastava273/python-board-game | 5fd730d40fdfcef918060064b09994f86c3113c9 | [
"MIT"
] | null | null | null | game.py | Swapnil-Srivastava273/python-board-game | 5fd730d40fdfcef918060064b09994f86c3113c9 | [
"MIT"
] | null | null | null | #Made this as a school project
#Inspired by Snakes and Ladders
#Runs in a terminal - no fancy gui!!
#Requires live interaction with user
import random
board=[]
level=1
playerPos=[1,1]
dragonPos=[]
playerName=["A","B"]
levelInstr=['''Level 1: The Simple Race
This game consists of two players.
playerA -> A
playerB -> ... | 31.482456 | 125 | 0.509891 |
4a0b60f9237bb21310fcbe4e50c41f5ec824ceb0 | 718 | py | Python | com/algorithm/kNN.py | liuyangyang2015/PythonDemo | a72c009a31ff833dd12405bb97e688ae91ceda6c | [
"MIT"
] | null | null | null | com/algorithm/kNN.py | liuyangyang2015/PythonDemo | a72c009a31ff833dd12405bb97e688ae91ceda6c | [
"MIT"
] | null | null | null | com/algorithm/kNN.py | liuyangyang2015/PythonDemo | a72c009a31ff833dd12405bb97e688ae91ceda6c | [
"MIT"
] | null | null | null | import numpy as np
import operator
from imp import reload
# k近邻算法实现
# data=[[1,1.1],[1,1],[0,0],[0,0.1]]
# dataSet=np.array(data)
# labels=['A','A','B','B']
def classify0(inX,dataSet,labels,k):
dataSetSize = dataSet.shape[0]
diffMat = np.tile(inX,(dataSetSize,1)) - dataSet
sqDiffMat = diffMat**2
sqDis... | 28.72 | 88 | 0.682451 |
3acce107ebd4677e0d2157462dfb7c175ba30841 | 4,470 | py | Python | modules/extractors/ooxml.py | rotsee/protokollen | a001a1db86df57adcf5c53c95c4c2fae426340f1 | [
"MIT",
"Apache-2.0",
"CC0-1.0",
"Unlicense"
] | 4 | 2015-03-22T20:23:36.000Z | 2015-12-09T14:31:34.000Z | modules/extractors/ooxml.py | rotsee/protokollen | a001a1db86df57adcf5c53c95c4c2fae426340f1 | [
"MIT",
"Apache-2.0",
"CC0-1.0",
"Unlicense"
] | 4 | 2015-03-24T10:42:00.000Z | 2016-06-21T08:44:01.000Z | modules/extractors/ooxml.py | rotsee/protokollen | a001a1db86df57adcf5c53c95c4c2fae426340f1 | [
"MIT",
"Apache-2.0",
"CC0-1.0",
"Unlicense"
] | null | null | null | #coding=utf-8
"""This module includes tools for handling and extracting text from
Office Open XML and modern Mocrosoft Word (.docx) files.
"""
from modules.extractors.documentBase import ExtractorBase, Page
from docx import Document
import openxmllib # good for metadata, bad for text
from modules.metadata import... | 34.651163 | 100 | 0.585235 |
f33cdc9f75f02647a7c8a2680bb2ad45f9c89621 | 472 | py | Python | Chapter 07/Chap07_Example7.65.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 07/Chap07_Example7.65.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 07/Chap07_Example7.65.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | myt1 = (10, 20, -30.1, 'Hello', 34.1, True)
# displaying tuple
print("myt1: ", myt1)
# displaying 4 elements from starting
print("myt1[:4]: ", myt1[:4])
# displaying all elements from the index 1
print("myt1[1:]: ", myt1[1:])
# displaying the elements between index 3 to 5
print("myt1[3:5]: ", myt1[3:5])
# displayi... | 24.842105 | 46 | 0.644068 |
ceeea2afb5a987188936728f126c00d87abcc000 | 7,685 | bzl | Python | nodejs/yarn_repositories.bzl | jakebiesinger-storyhealth/rules_nodejs | 8df86ccb799e4f9f3c4b26174f09b58a89ef3639 | [
"Apache-2.0"
] | 1 | 2020-03-29T21:45:58.000Z | 2020-03-29T21:45:58.000Z | nodejs/yarn_repositories.bzl | jakebiesinger-storyhealth/rules_nodejs | 8df86ccb799e4f9f3c4b26174f09b58a89ef3639 | [
"Apache-2.0"
] | null | null | null | nodejs/yarn_repositories.bzl | jakebiesinger-storyhealth/rules_nodejs | 8df86ccb799e4f9f3c4b26174f09b58a89ef3639 | [
"Apache-2.0"
] | 1 | 2022-02-02T20:42:16.000Z | 2022-02-02T20:42:16.000Z | "Repository rule to fetch the Yarn package manager"
load("//nodejs/private:os_name.bzl", "is_windows_os")
load("//nodejs/private:node_labels.bzl", "get_node_label")
load("//nodejs/private:yarn_versions.bzl", "YARN_VERSIONS")
load("//nodejs:repositories.bzl", "GET_SCRIPT_DIR")
load("@bazel_skylib//lib:paths.bzl", "path... | 35.252294 | 126 | 0.660247 |
f6298a7077fd2815d4e318d0ad4efa51030ef759 | 7,597 | py | Python | google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py | bingatgoogle/python-videointelligence | 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 | [
"Apache-2.0"
] | null | null | null | google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py | bingatgoogle/python-videointelligence | 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 | [
"Apache-2.0"
] | null | null | null | google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py | bingatgoogle/python-videointelligence | 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 | [
"Apache-2.0"
] | null | null | null | # -*- 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... | 39.567708 | 103 | 0.660524 |
9a421ecba8bb3f0db3d3daed91d20ae27f5f58da | 16,491 | py | Python | async_upnp_client/profiles/igd.py | kitlaan/async_upnp_client | 6dc74a47b544728db8a0d26d40cea6536376f211 | [
"Apache-2.0"
] | 1 | 2021-04-02T17:25:19.000Z | 2021-04-02T17:25:19.000Z | async_upnp_client/profiles/igd.py | fabaff/async_upnp_client | 8a080d671cf6550182db64b13b169c16f7491a52 | [
"Apache-2.0"
] | null | null | null | async_upnp_client/profiles/igd.py | fabaff/async_upnp_client | 8a080d671cf6550182db64b13b169c16f7491a52 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""UPnP IGD module."""
from datetime import timedelta
from ipaddress import IPv4Address
import logging
from typing import List, NamedTuple, Optional, Sequence
from async_upnp_client import UpnpAction
from async_upnp_client.profiles.profile import UpnpProfileDevice
_LOGGER = logging.getLogger... | 37.479545 | 100 | 0.603117 |
e166a649aaca0e2c6f528affa685a9f00aece222 | 1,615 | py | Python | example_project/tests/conftest.py | kvirt/django-admin-inline-actions | 4b85ccc6e1fd2b4dde1ecfb822b2346a7aa3d192 | [
"Apache-2.0"
] | 3 | 2021-01-04T01:05:44.000Z | 2021-01-04T07:24:08.000Z | example_project/tests/conftest.py | kvirt/django-admin-inline-actions | 4b85ccc6e1fd2b4dde1ecfb822b2346a7aa3d192 | [
"Apache-2.0"
] | 1 | 2021-03-31T19:46:15.000Z | 2021-03-31T19:46:15.000Z | example_project/tests/conftest.py | kvirt/django-inlines-actions | 4b85ccc6e1fd2b4dde1ecfb822b2346a7aa3d192 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
import pytest
from django.apps import apps
from django.contrib.admin import site
from django.urls import reverse
from example_app.admin import BaseAdminInline
from example_app.models import Article, Author, AuthorInvalid
@pytest.fixture
def loaded_models():
author = Author.obj... | 23.071429 | 74 | 0.642105 |
cd3e7765d7ee2e064b0c4b4ed1a549a48f519674 | 8,762 | py | Python | PyEngine3D/Render/Camera.py | ubuntunux/PyEngine3D | e5542b5b185e8b9b56fc4669a6f22eb06c386c4f | [
"BSD-2-Clause"
] | 121 | 2017-06-07T19:42:30.000Z | 2022-03-31T04:42:29.000Z | PyEngine3D/Render/Camera.py | MatthewPChapdelaine/PyEngine3D | e5542b5b185e8b9b56fc4669a6f22eb06c386c4f | [
"BSD-2-Clause"
] | 16 | 2015-12-21T16:57:55.000Z | 2017-03-06T15:22:37.000Z | PyEngine3D/Render/Camera.py | ubuntunux/GuineaPig | f32852ecbfa3ebdbba00afc466719fc78e37361c | [
"BSD-2-Clause"
] | 16 | 2018-01-15T03:12:13.000Z | 2022-03-31T04:42:41.000Z | from math import *
import numpy as np
from PyEngine3D.Common import logger
from PyEngine3D.App.CoreManager import CoreManager
from PyEngine3D.Utilities import *
from . import StaticActor
# ------------------------------ #
# CLASS : Camera
# ------------------------------ #
class Camera(StaticActor):
def __init__... | 44.933333 | 108 | 0.64483 |
8fa0303866a7a936c3af0d28cf22f13773f90ff9 | 9,117 | py | Python | python/pkginv-download-client.py | slugbucket/package-inventory-server | 242d2182b57c7d06b6d76d4a19fa04705c16d194 | [
"Apache-2.0"
] | null | null | null | python/pkginv-download-client.py | slugbucket/package-inventory-server | 242d2182b57c7d06b6d76d4a19fa04705c16d194 | [
"Apache-2.0"
] | 2 | 2016-12-17T14:23:01.000Z | 2017-03-19T16:03:07.000Z | python/pkginv-download-client.py | slugbucket/package-inventory-server | 242d2182b57c7d06b6d76d4a19fa04705c16d194 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Script to query the inventory database for a list of hosts and for each
# one in the list submit a request to the package inventory server for the
# list of packages. We then go through the list of packages and update the
# host-package-version mapping as well as identifying whether new databa... | 44.257282 | 206 | 0.549084 |
607850567596cb668920c321b8a1fd24357f3105 | 19,719 | py | Python | test/test_irclib.py | joulez/Limnoria | aa89a2dd72ec6f593df4c5c281d915af456d5614 | [
"BSD-3-Clause"
] | null | null | null | test/test_irclib.py | joulez/Limnoria | aa89a2dd72ec6f593df4c5c281d915af456d5614 | [
"BSD-3-Clause"
] | null | null | null | test/test_irclib.py | joulez/Limnoria | aa89a2dd72ec6f593df4c5c281d915af456d5614 | [
"BSD-3-Clause"
] | null | null | null | ##
# Copyright (c) 2002-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of con... | 38.28932 | 262 | 0.601704 |
01f31574cf7fe56f15e37ca8f2fdf86ea6b1ecb5 | 6,642 | py | Python | Code/Base/py-loghandlers/current/doc/conf.py | rtobar/askapsoft | 6bae06071d7d24f41abe3f2b7f9ee06cb0a9445e | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | 1 | 2020-06-18T08:37:43.000Z | 2020-06-18T08:37:43.000Z | Code/Base/py-loghandlers/current/doc/conf.py | ATNF/askapsoft | d839c052d5c62ad8a511e58cd4b6548491a6006f | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | Code/Base/py-loghandlers/current/doc/conf.py | ATNF/askapsoft | d839c052d5c62ad8a511e58cd4b6548491a6006f | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | # -*- coding: utf-8 -*-
#
# askap.loghandlers documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 18 08:51:02 2009.
#
# 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 fil... | 32.881188 | 80 | 0.727943 |
c2b46cf6a3676a5c425ab63177affc0474ffe87e | 476 | py | Python | jax_rl/saving.py | LSaldyt/jax-rl | 78716d82df68ce689c0b1c33bbaceb615772dbe7 | [
"MIT"
] | 58 | 2020-04-12T23:17:41.000Z | 2022-03-16T15:07:17.000Z | jax_rl/saving.py | LSaldyt/jax-rl | 78716d82df68ce689c0b1c33bbaceb615772dbe7 | [
"MIT"
] | 4 | 2020-10-11T21:01:46.000Z | 2022-03-18T08:23:35.000Z | jax_rl/saving.py | LSaldyt/jax-rl | 78716d82df68ce689c0b1c33bbaceb615772dbe7 | [
"MIT"
] | 8 | 2020-06-15T07:17:18.000Z | 2022-03-13T07:05:30.000Z | import os
from flax import linen as nn
from flax import serialization
from tensorflow.compat.v2.io import gfile
def save_model(filename: str, model: nn.Module) -> None:
gfile.makedirs(os.path.dirname(filename))
with gfile.GFile(filename, "wb") as fp:
fp.write(serialization.to_bytes(model))
def load... | 28 | 61 | 0.718487 |
bdef393b086dcefb3ef5bdfff4c9a346a3e62394 | 109,766 | py | Python | sympy/core/expr.py | vprusso/sympy | d5aa27ec88bb076f59087aada97d99bfff8b2f4c | [
"BSD-3-Clause"
] | null | null | null | sympy/core/expr.py | vprusso/sympy | d5aa27ec88bb076f59087aada97d99bfff8b2f4c | [
"BSD-3-Clause"
] | null | null | null | sympy/core/expr.py | vprusso/sympy | d5aa27ec88bb076f59087aada97d99bfff8b2f4c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from .core import C
from .sympify import sympify, _sympify, SympifyError
from .basic import Basic, Atom
from .singleton import S
from .evalf import EvalfMixin, pure_complex
from .decorators import _sympifyit, call_highest_priority
from .cache import cacheit
from .compati... | 34.637425 | 109 | 0.524898 |
6d6318dbc484657adab3924a0a2718bbf8564051 | 1,645 | py | Python | pytorch_lightning/__about__.py | aleSuglia/pytorch-lightning | 16213b16356f5bd97b8cc8bf1849eacd68d658c5 | [
"Apache-2.0"
] | 3 | 2021-10-04T05:08:28.000Z | 2021-10-04T06:04:06.000Z | pytorch_lightning/__about__.py | truong2710-cyber/pytorch-lightning | 4610fddb19d502e534b5c5d77c3dfd6f2e5359a5 | [
"Apache-2.0"
] | 2 | 2021-03-22T00:20:28.000Z | 2021-06-25T11:35:33.000Z | pytorch_lightning/__about__.py | truong2710-cyber/pytorch-lightning | 4610fddb19d502e534b5c5d77c3dfd6f2e5359a5 | [
"Apache-2.0"
] | 1 | 2021-11-07T12:34:34.000Z | 2021-11-07T12:34:34.000Z | import time
_this_year = time.strftime("%Y")
__version__ = "1.5.0rc0"
__author__ = "William Falcon et al."
__author_email__ = "waf2107@columbia.edu"
__license__ = "Apache-2.0"
__copyright__ = f"Copyright (c) 2018-{_this_year}, {__author__}."
__homepage__ = "https://github.com/PyTorchLightning/pytorch-lightning"
__docs... | 42.179487 | 119 | 0.764134 |
4109b9f1e491b180c374959f61711812b11680c3 | 1,077 | py | Python | load_difference_of_mean_median.py | MATHplus-Young-Academy/P3-Morph-Scoring | 0e2ba66cf28e30525b22706cc50d23b9de09a58a | [
"Apache-2.0"
] | 1 | 2022-03-16T20:15:16.000Z | 2022-03-16T20:15:16.000Z | load_difference_of_mean_median.py | MATHplus-Young-Academy/P3-Morph-Scoring | 0e2ba66cf28e30525b22706cc50d23b9de09a58a | [
"Apache-2.0"
] | null | null | null | load_difference_of_mean_median.py | MATHplus-Young-Academy/P3-Morph-Scoring | 0e2ba66cf28e30525b22706cc50d23b9de09a58a | [
"Apache-2.0"
] | null | null | null | import os
import sys
import inspect
import numpy as np
import matplotlib.pyplot as plt
import pyvista as pv
from sklearn.preprocessing import normalize
from utils import runSVMClassification, plotClassificationResults
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
pare... | 28.342105 | 100 | 0.760446 |
60f5dfb1f9525e40bdaccf2e5eef60c9cd72fdcc | 4,160 | py | Python | dexsim/plugins/Geost.py | CKCat/dexsim | bb50da06a0db99b3b59c5ccd20758975fe5fa8c3 | [
"MIT"
] | null | null | null | dexsim/plugins/Geost.py | CKCat/dexsim | bb50da06a0db99b3b59c5ccd20758975fe5fa8c3 | [
"MIT"
] | null | null | null | dexsim/plugins/Geost.py | CKCat/dexsim | bb50da06a0db99b3b59c5ccd20758975fe5fa8c3 | [
"MIT"
] | null | null | null | import os
import re
import tempfile
from json import JSONEncoder
from colorclass.color import Color
from dexsim import get_value
from dexsim.plugin import Plugin
PLUGIN_CLASS_NAME = "Geost"
# fill-array-data v2, :array_2e
# invoke-virtual {p0, v2}, Lcom/rgamtgid/hnsolues/QLwdDnU;->UGanmSarY([B)[B
# move... | 33.548387 | 81 | 0.516106 |
1eb720f086de635691efd0dff58de10801994c98 | 128 | py | Python | datadog/validate.py | mauricedb/mergify-engine | b7c9c66e830a4c0c1ab54459a265c90cc67c968d | [
"Apache-2.0"
] | null | null | null | datadog/validate.py | mauricedb/mergify-engine | b7c9c66e830a4c0c1ab54459a265c90cc67c968d | [
"Apache-2.0"
] | null | null | null | datadog/validate.py | mauricedb/mergify-engine | b7c9c66e830a4c0c1ab54459a265c90cc67c968d | [
"Apache-2.0"
] | null | null | null | import glob
import yaml
for fname in glob.glob("datadog/conf.d/*.yaml"):
with open(fname) as f:
yaml.safe_load(f)
| 16 | 48 | 0.65625 |
02704588a1d59279603f10fe3dc24cfbf3035a4b | 3,475 | py | Python | createAllExamples.py | jbhunter804/NBANeural | 108b30d133398a87db7130bec34f7cccff6ad7a9 | [
"MIT"
] | null | null | null | createAllExamples.py | jbhunter804/NBANeural | 108b30d133398a87db7130bec34f7cccff6ad7a9 | [
"MIT"
] | null | null | null | createAllExamples.py | jbhunter804/NBANeural | 108b30d133398a87db7130bec34f7cccff6ad7a9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import csv
import random
import numpy as np
import pandas as pd
###################################################################################################
###################################################################################################
#############... | 41.369048 | 214 | 0.48 |
3dd638eb1570b5cdeaa6353accc65113ad8ff86a | 880 | py | Python | review/forms.py | legenduzair/epic-expeditions | aa979ee3d2a786cb180410c971f0b3b019b2b174 | [
"Adobe-Glyph"
] | null | null | null | review/forms.py | legenduzair/epic-expeditions | aa979ee3d2a786cb180410c971f0b3b019b2b174 | [
"Adobe-Glyph"
] | 24 | 2022-02-23T22:42:25.000Z | 2022-03-11T22:54:58.000Z | review/forms.py | legenduzair/epic-expeditions | aa979ee3d2a786cb180410c971f0b3b019b2b174 | [
"Adobe-Glyph"
] | null | null | null | """ System Module """
from django import forms
from .models import TravelReview, TravelComments
class TravelReviewForm(forms.ModelForm):
""" Class-based function to add expedition review form """
excerpt = forms.CharField(widget=forms.Textarea(attrs={
'rows': '3',
}))
class Meta:
""" ... | 30.344828 | 75 | 0.645455 |
1af7666b85d77871924dbae8dd0c5f4db8775dab | 201 | py | Python | mmpose/models/detectors/__init__.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | mmpose/models/detectors/__init__.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | mmpose/models/detectors/__init__.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | from .bottom_up import BottomUp
from .mesh import ParametricMesh
from .multi_task import MultiTask
from .top_down import TopDown
__all__ = ['TopDown', 'BottomUp', 'ParametricMesh', 'MultiTask']
| 28.714286 | 65 | 0.766169 |
8c0d2aab3d1a85d2b8e3733778d6597cc3df81e8 | 10,666 | py | Python | poisoning_attacks/jodie/jodie.py | Vivdaddy/recsys-filterbubbles | d21639bce515ffef5ba2db530dc2505eee1f83c0 | [
"MIT"
] | 1 | 2021-10-07T01:23:27.000Z | 2021-10-07T01:23:27.000Z | poisoning_attacks/jodie/jodie.py | Vivdaddy/recsys-filterbubbles | d21639bce515ffef5ba2db530dc2505eee1f83c0 | [
"MIT"
] | null | null | null | poisoning_attacks/jodie/jodie.py | Vivdaddy/recsys-filterbubbles | d21639bce515ffef5ba2db530dc2505eee1f83c0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import copy
import time
import argparse
import os
import rbo
from library_models import *
from library_data import *
from collections import Counter
def filter_and_split(data=[]):
(users,counts) = np.unique(data[:,0],return_counts = True)
... | 43.357724 | 267 | 0.57238 |
47316f37c7a577b7fbcdfbadc6c4dfe7635695e3 | 12,242 | py | Python | sdk/python/pulumi_azure_native/web/web_app_private_endpoint_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/web_app_private_endpoint_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/web_app_private_endpoint_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 47.084615 | 951 | 0.684855 |
6a4d312e1c643b33987009e8a90750d164fee7e5 | 4,249 | py | Python | genre_classification/model.py | XuBLin/590PresentGroupProject | 7126a43ed53f7ae528c350a289273884eaaf160e | [
"MIT"
] | null | null | null | genre_classification/model.py | XuBLin/590PresentGroupProject | 7126a43ed53f7ae528c350a289273884eaaf160e | [
"MIT"
] | null | null | null | genre_classification/model.py | XuBLin/590PresentGroupProject | 7126a43ed53f7ae528c350a289273884eaaf160e | [
"MIT"
] | 1 | 2021-11-30T17:05:55.000Z | 2021-11-30T17:05:55.000Z | # Use 1D CNN to classify 16 genres music
# Dataset should be download from the Internet because of the huge size
import os
from keras import layers, optimizers
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras import regularizers
from sklearn.preprocessing import MultiLabelBinarizer, LabelB... | 36.947826 | 117 | 0.715462 |
88bcd72560e37143df433713de607596d0f53a9c | 2,156 | py | Python | lib/surface/compute/addresses/list.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/addresses/list.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/addresses/list.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | 2 | 2020-11-04T03:08:21.000Z | 2020-11-05T08:14:41.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 29.534247 | 79 | 0.675788 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.