hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7447c370b5b17afaffd20ba95e669f5e499a81f7 | 15,296 | py | Python | backend/backend/services/audit_gen/audit.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | backend/backend/services/audit_gen/audit.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | backend/backend/services/audit_gen/audit.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | import logging
import uuid
from datetime import datetime
from fractions import Fraction
from typing import List, Sequence
import grpc
import sqlalchemy.orm
from common.constants import (
ADMIN_UUID,
AUDIT_BASE_CURRENCY,
PAGINATION_LIMIT,
SECP256K1_ALTERNATIVE_GENERATOR,
SECP256K1_GENERATOR,
SEC... | 39.833333 | 116 | 0.62585 |
7447cf3ed733406fa29744c530eaa1145f8b37b6 | 40,789 | py | Python | mindmeld/models/taggers/lstm.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 1 | 2022-02-09T13:39:41.000Z | 2022-02-09T13:39:41.000Z | mindmeld/models/taggers/lstm.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | mindmeld/models/taggers/lstm.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | # -*- 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... | 37.558932 | 99 | 0.617127 |
7447e8b36aa91c5d78c30294f1d3fe4e733b1795 | 2,031 | py | Python | src/python/pants/backend/native/register.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/native/register.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/native/register.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.backend.native.config.environment import create_native_environment_rules
from ... | 39.823529 | 98 | 0.803053 |
7447fd56e1ffab706f99be9f819bc743825b1e30 | 8,660 | py | Python | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 ... | 42.871287 | 185 | 0.679099 |
7447ff81904ddfb05f0cb155adb4c7db08081962 | 15,320 | py | Python | datasets/nvidia_old.py | GUOShuxuan/detr | 80d45bf5df940ac6457e7cc9e3ccd6441518a903 | [
"Apache-2.0"
] | null | null | null | datasets/nvidia_old.py | GUOShuxuan/detr | 80d45bf5df940ac6457e7cc9e3ccd6441518a903 | [
"Apache-2.0"
] | null | null | null | datasets/nvidia_old.py | GUOShuxuan/detr | 80d45bf5df940ac6457e7cc9e3ccd6441518a903 | [
"Apache-2.0"
] | null | null | null | """NVIDIA Autonomous Driving Dataset.
Written by Ismail Elezi
BoxParser written by William Zhang
Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
"""
from copy import deepcopy
import os
from pathlib import Path
from PIL import Image
# import sys
# sys.path.append("/home/shuxuang/debug/ai-infra/modulusp... | 36.132075 | 147 | 0.587402 |
74483a7f6ec04d09652ee562cdade33e60f97e94 | 963 | py | Python | test/e2e2/spec/test_donation.py | peterthomassen/desec-stack | 436e48e8fc3f55ecf0b0e6a57a735a899a736f19 | [
"MIT"
] | 197 | 2016-10-13T16:44:54.000Z | 2022-03-24T08:33:25.000Z | test/e2e2/spec/test_donation.py | peterthomassen/desec-stack | 436e48e8fc3f55ecf0b0e6a57a735a899a736f19 | [
"MIT"
] | 455 | 2016-12-08T15:23:04.000Z | 2022-03-29T12:58:02.000Z | test/e2e2/spec/test_donation.py | peterthomassen/desec-stack | 436e48e8fc3f55ecf0b0e6a57a735a899a736f19 | [
"MIT"
] | 25 | 2016-10-13T16:45:02.000Z | 2022-02-23T17:57:04.000Z | from conftest import DeSECAPIV1Client
import pytest
from pytest_schema import schema, Optional
donation = {
'name': str,
'iban': str,
'bic': str,
'amount': str,
'mref': str,
'interval': int,
'message': str,
'email': str,
}
@pytest.mark.parametrize("data", [
{
"name": "Dr... | 21.886364 | 71 | 0.589823 |
7448825c3f51fcd0f3b5583dedf1633165908841 | 2,601 | py | Python | app/request.py | melissa-koi/NewsHighlight | 6159e8b4f44703f50f7f5ea838ae767a3bb76ad3 | [
"MIT"
] | null | null | null | app/request.py | melissa-koi/NewsHighlight | 6159e8b4f44703f50f7f5ea838ae767a3bb76ad3 | [
"MIT"
] | null | null | null | app/request.py | melissa-koi/NewsHighlight | 6159e8b4f44703f50f7f5ea838ae767a3bb76ad3 | [
"MIT"
] | null | null | null | import urllib.request, json
from app.models import News, Articles
# Getting api key
api_key = None
# Getting the movie base url
base_url = None
def configure_request(app):
global api_key,base_url
api_key = app.config['NEWS_APIKEY']
base_url = app.config['NEWS_API_BASE_URL']
def get_source(category):
... | 31.719512 | 102 | 0.684352 |
744886f40ff21c980adeeda284aa54faff90018e | 3,863 | py | Python | python/ray/rllib/optimizers/sync_batch_replay_optimizer.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 2 | 2019-10-08T13:31:08.000Z | 2019-10-22T18:34:52.000Z | python/ray/rllib/optimizers/sync_batch_replay_optimizer.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 1 | 2018-12-26T01:09:50.000Z | 2018-12-26T01:09:50.000Z | python/ray/rllib/optimizers/sync_batch_replay_optimizer.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 6 | 2019-03-12T05:37:35.000Z | 2020-03-09T12:25:17.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import ray
from ray.rllib.optimizers.policy_optimizer import PolicyOptimizer
from ray.rllib.evaluation.sample_batch import SampleBatch, DEFAULT_POLICY_ID, \
MultiAgentBatch
from ray.rllib.uti... | 37.872549 | 79 | 0.605747 |
74488f366f26e141ec7e9107b000d2966cc494b3 | 19,181 | py | Python | src/weekly_pr_summary.py | surfaceowl/python_weekly_dir_detail | 7648afef600000f82af1a6b9d65d937671add2b6 | [
"MIT"
] | null | null | null | src/weekly_pr_summary.py | surfaceowl/python_weekly_dir_detail | 7648afef600000f82af1a6b9d65d937671add2b6 | [
"MIT"
] | null | null | null | src/weekly_pr_summary.py | surfaceowl/python_weekly_dir_detail | 7648afef600000f82af1a6b9d65d937671add2b6 | [
"MIT"
] | null | null | null | """
module pulls select PR data from GitHub for cpython Developer In Residence reporting.
Collect final results in a list of html lines ready to drop into the weekly blog
requires env var: GITHUB_ACCESS_TOKEN, a valid access token from your GitHub account
"""
import datetime
import logging
import re
import github.Gi... | 34.313059 | 88 | 0.664199 |
7448b50f750c1dde6dd135e71cc05928d70625e5 | 6,557 | py | Python | remote_params/server.py | markkorput/pyRemoteParams | b96cc3d694f5715af40cf71865e7c2f550897a81 | [
"MIT"
] | null | null | null | remote_params/server.py | markkorput/pyRemoteParams | b96cc3d694f5715af40cf71865e7c2f550897a81 | [
"MIT"
] | 2 | 2020-03-13T07:14:36.000Z | 2020-05-22T09:54:08.000Z | remote_params/server.py | markkorput/pyRemoteParams | b96cc3d694f5715af40cf71865e7c2f550897a81 | [
"MIT"
] | null | null | null | from evento import Event
from .params import Params
from .schema import schema_list, get_path, apply_schema_list
import logging
logger = logging.getLogger(__name__)
class Remote:
def __init__(self, serialize=False):
class Incoming:
def __init__(self):
# events for remote-to-server communications
... | 30.21659 | 124 | 0.708708 |
7448f41ba253c002cddd3128bfbc769c325965d0 | 145 | py | Python | src/ggrc_workflows/settings/development.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | src/ggrc_workflows/settings/development.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc_workflows/settings/development.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
EXTENSIONS = ['ggrc_workflows']
| 29 | 78 | 0.737931 |
7448f5ce166c5e7b21b2141c79a98392e50b233e | 22,418 | py | Python | mediagoblin/db/models.py | acidburn0zzz/mediagoblin | 8fc57eaaa6e22358a1220a0baf589a4b20dd8cfe | [
"CC0-1.0"
] | 1 | 2018-12-19T00:05:55.000Z | 2018-12-19T00:05:55.000Z | mediagoblin/db/models.py | acidburn0zzz/mediagoblin | 8fc57eaaa6e22358a1220a0baf589a4b20dd8cfe | [
"CC0-1.0"
] | null | null | null | mediagoblin/db/models.py | acidburn0zzz/mediagoblin | 8fc57eaaa6e22358a1220a0baf589a4b20dd8cfe | [
"CC0-1.0"
] | null | null | null | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 35.193093 | 83 | 0.648943 |
7448fc9b9c9a43d8b81147653ad9ff729e1f0c0d | 4,062 | py | Python | assemblyline/common/net.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/common/net.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/common/net.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | import socket
import subprocess
import sys
import uuid
from random import randint
import netifaces as nif
import pyroute2
from assemblyline.common.net_static import TLDS_ALPHA_BY_DOMAIN
def is_valid_port(value: int) -> bool:
try:
if 1 <= int(value) <= 65535:
return True
except ValueError... | 26.723684 | 114 | 0.552683 |
744946b9bb3192f2f14d9a4711953ab90283bad1 | 8,083 | py | Python | bcbio/pipeline/shared.py | matanhofree/bcbio-nextgen | e6938cedb20ff3b7632165105941d71189e46aac | [
"MIT"
] | 1 | 2015-04-08T17:43:39.000Z | 2015-04-08T17:43:39.000Z | bcbio/pipeline/shared.py | matanhofree/bcbio-nextgen | e6938cedb20ff3b7632165105941d71189e46aac | [
"MIT"
] | null | null | null | bcbio/pipeline/shared.py | matanhofree/bcbio-nextgen | e6938cedb20ff3b7632165105941d71189e46aac | [
"MIT"
] | null | null | null | """Pipeline functionality shared amongst multiple analysis types.
"""
import os
from contextlib import closing
import functools
import operator
try:
import pybedtools
except ImportError:
pybedtools = None
import pysam
from bcbio import bam, broad, utils
from bcbio.pipeline import config_utils
from bcbio.utils... | 43.929348 | 102 | 0.652357 |
74494f1fbba781c487f4fcaed331a594b21a37f1 | 89 | py | Python | tests/test_search_client.py | yoyonel/2017_GRPC_Tutorial | 320aa5feb3e012260be03da4d3bfa27a75cca1d0 | [
"MIT"
] | 1 | 2020-12-10T12:45:59.000Z | 2020-12-10T12:45:59.000Z | tests/test_search_client.py | yoyonel/2017_GRPC_Tutorial | 320aa5feb3e012260be03da4d3bfa27a75cca1d0 | [
"MIT"
] | 1 | 2021-06-01T23:45:20.000Z | 2021-06-01T23:45:20.000Z | tests/test_search_client.py | yoyonel/2017_GRPC_Tutorial | 320aa5feb3e012260be03da4d3bfa27a75cca1d0 | [
"MIT"
] | null | null | null | """
"""
import tutorial.grpc.geodatas.search_client
def test_search_client():
pass
| 11.125 | 43 | 0.719101 |
7449754e5619f792bd8733b9e8f3a22907221dc1 | 1,854 | py | Python | Tools/scons/scons-local/SCons/Scanner/IDL.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Scanner/IDL.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Scanner/IDL.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """SCons.Scanner.IDL
This module implements the dependency scanner for IDL (Interface
Definition Language) files.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (t... | 37.836735 | 100 | 0.68069 |
7449a3354ee9a1b2ce5978f4ad8e629eedd5ca6e | 993 | py | Python | uvio/tests/test_timer.py | srossross/uvio | f4d55ad5ea5900a2a8b9c1249484ed621dc30055 | [
"MIT"
] | 3 | 2016-03-23T08:12:03.000Z | 2018-10-06T02:46:54.000Z | uvio/tests/test_timer.py | srossross/uvio | f4d55ad5ea5900a2a8b9c1249484ed621dc30055 | [
"MIT"
] | null | null | null | uvio/tests/test_timer.py | srossross/uvio | f4d55ad5ea5900a2a8b9c1249484ed621dc30055 | [
"MIT"
] | null | null | null | import unittest
from uvio import sleep
from uvio.loop import Loop
from uvio.timer import Timer
from uvio.handle import Handle
class Test(unittest.TestCase):
def test_init(self):
loop = Loop.create()
called = False
def callback():
nonlocal called
called = True
... | 17.12069 | 43 | 0.572004 |
7449ad65d702d0655d8a6506408df861dfc0a49f | 2,571 | py | Python | tests/unit/unit_test_Wiki.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_Wiki.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_Wiki.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | from nose.tools import assert_raises, assert_equals, raises
from mock import patch, mock_open
import synapseclient
from synapseclient.wiki import Wiki
def test_Wiki():
"""Test the construction and accessors of Wiki objects."""
#Wiki contstuctor only takes certain values
assert_raises(ValueError, Wiki, tit... | 38.373134 | 107 | 0.706729 |
7449d62106ab75cebd01bcb0f9d9e64cc4184630 | 3,134 | py | Python | tests/repos/test_codesRepo.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | null | null | null | tests/repos/test_codesRepo.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | 21 | 2021-01-08T18:03:32.000Z | 2021-02-02T16:17:34.000Z | tests/repos/test_codesRepo.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | null | null | null | import unittest
from src.appConfig import initAppConfig
from src.repos.codes.codesRepo import CodesRepo
import datetime as dt
import cx_Oracle
class TestCodesRepo(unittest.TestCase):
def setUp(self):
self.appConf = initAppConfig()
def test_createGenericCode(self) -> None:
"""tests the functio... | 36.870588 | 87 | 0.630185 |
7449fdecbb3182a41799f7fabffde5ed4ab8778f | 1,069 | py | Python | src/test/tests/hybrid/ghost_node.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/ghost_node.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/hybrid/ghost_node.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: ghost_node.py
#
# Tests: ghost node removal of multi_curv3d.silo
#
# Programmer: Eric Brugger
# Date: July 6, 2020
#
# Modifications:
# Kathleen Biagas, Fri Mar 12, 2021
# Added Del... | 23.755556 | 78 | 0.604303 |
744a673a88b55919cb3b0a24f5f0c19c72acf207 | 5,207 | py | Python | swm/servers.py | GetmeUK/swm | 4baad7e1eb2b6e763f89be353ce199414731f07e | [
"MIT"
] | 2 | 2019-07-30T13:26:41.000Z | 2020-01-08T11:44:46.000Z | swm/servers.py | GetmeUK/swm | 4baad7e1eb2b6e763f89be353ce199414731f07e | [
"MIT"
] | null | null | null | swm/servers.py | GetmeUK/swm | 4baad7e1eb2b6e763f89be353ce199414731f07e | [
"MIT"
] | null | null | null | import asyncio
import json
import time
import aioredis
import tornado.locks
import tornado.web
from swm.events import TaskCompleteEvent, TaskErrorEvent
__all__ = [
'Application',
'RequestHandler',
'TaskEventListener'
]
class Application(tornado.web.Application):
@property
def redis(self):
... | 28.767956 | 78 | 0.62512 |
744af361361221829cbb588518c97296bbc8c4cb | 7,960 | py | Python | vdb/vdb.py | vaporlang/vyper-debug | 8eab74be91dd3e4d57a566a2ab520b5000543875 | [
"MIT"
] | 21 | 2018-07-28T12:21:32.000Z | 2021-10-10T12:08:57.000Z | vdb/vdb.py | vaporlang/vyper-debug | 8eab74be91dd3e4d57a566a2ab520b5000543875 | [
"MIT"
] | 15 | 2018-07-16T09:58:05.000Z | 2019-05-16T09:40:47.000Z | vdb/vdb.py | vaporlang/vyper-debug | 8eab74be91dd3e4d57a566a2ab520b5000543875 | [
"MIT"
] | 8 | 2018-07-13T16:00:35.000Z | 2021-05-12T17:38:37.000Z | import cmd
import readline
import sys
from eth_utils import (
to_hex,
to_int,
)
import eth.vm
from eth import constants
from eth.vm.opcode import as_opcode
from vyper.opcodes import opcodes as vyper_opcodes
from vdb.variables import (
parse_global,
parse_local
)
commands = [
'continue',
'local... | 30.151515 | 100 | 0.572613 |
744b18552009d0f3b0baea98a0e563a4d086f130 | 1,095 | py | Python | rlkit/launchers/experiments/vitchyr/probabilistic_goal_reaching/env.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | rlkit/launchers/experiments/vitchyr/probabilistic_goal_reaching/env.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | rlkit/launchers/experiments/vitchyr/probabilistic_goal_reaching/env.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import gym
import numpy as np
from multiworld.envs.mujoco.classic_mujoco.ant import AntFullPositionGoalEnv
class NormalizeAntFullPositionGoalEnv(gym.Wrapper):
def __init__(self, env):
assert isinstance(env, AntFullPositionGoalEnv)
super().__init__(env)
self.qpos_weights = 1. / env.presamp... | 30.416667 | 76 | 0.624658 |
744b18db90c85aa309ad80ed032e03ce2a71c914 | 11,680 | py | Python | opsbro/dockermanager.py | naparuba/opsbro | 98618a002cd47250d21e7b877a24448fc95fec80 | [
"MIT"
] | 32 | 2017-08-29T08:57:16.000Z | 2021-04-21T08:53:04.000Z | opsbro/dockermanager.py | naparuba/opsbro | 98618a002cd47250d21e7b877a24448fc95fec80 | [
"MIT"
] | 108 | 2017-09-04T19:59:28.000Z | 2022-03-31T08:12:07.000Z | opsbro/dockermanager.py | naparuba/kunai | 98618a002cd47250d21e7b877a24448fc95fec80 | [
"MIT"
] | 8 | 2015-02-03T12:30:53.000Z | 2017-07-29T19:43:54.000Z | #!/usr/bin/env python
import json
import time
import os
from .log import LoggerFactory
from .threadmgr import threader
from .misc.cgroups import cgroupmgr
from .unixclient import get_json, get_request_errors
# Global logger for this part
logger = LoggerFactory.create_logger('docker')
DOCKER_SOCKET_PATH = '/var/run/d... | 33.757225 | 128 | 0.490925 |
744b2d65ef3dc0ac50a1c1fc4705cd61fcd5ae2d | 1,739 | py | Python | concierge/__main__.py | OpenDebates/Concierge | 6e301d95aef472ef76fe609cb0350ea9071f0c27 | [
"MIT"
] | null | null | null | concierge/__main__.py | OpenDebates/Concierge | 6e301d95aef472ef76fe609cb0350ea9071f0c27 | [
"MIT"
] | null | null | null | concierge/__main__.py | OpenDebates/Concierge | 6e301d95aef472ef76fe609cb0350ea9071f0c27 | [
"MIT"
] | null | null | null | import argparse
import sys
import concierge
from concierge.cli.start import StartCommand
def _optional_commands(parser):
"""
Optional cli passed directly to the main parser.
"""
parser.add_argument(
"-V", "--version", version=f"%(prog)s {concierge.__version__}", action="version"
)
par... | 27.171875 | 88 | 0.6613 |
744b6110174453e871e1cda3553235f23a5a7ca4 | 1,183 | py | Python | chapter05-1class-func/tagger.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | 1 | 2019-11-23T05:57:02.000Z | 2019-11-23T05:57:02.000Z | chapter05-1class-func/tagger.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | null | null | null | chapter05-1class-func/tagger.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | 1 | 2019-11-23T05:57:43.000Z | 2019-11-23T05:57:43.000Z |
"""
# BEGIN TAG_DEMO
>>> tag('br') # <1>
'<br />'
>>> tag('p', 'hello') # <2>
'<p>hello</p>'
>>> print(tag('p', 'hello', 'world'))
<p>hello</p>
<p>world</p>
>>> tag('p', 'hello', id=33) # <3>
'<p id="33">hello</p>'
>>> print(tag('p', 'hello', 'world', cls='sidebar')) # <4>
<p class="sidebar">hello</p>
<p class="s... | 27.511628 | 68 | 0.49197 |
744b6f57fb099b78b10496734ff4cfb812608c66 | 13,595 | py | Python | delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | 1 | 2020-11-25T08:51:18.000Z | 2020-11-25T08:51:18.000Z | delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 27.135729 | 78 | 0.696874 |
744b75ed9db7b303355fca0247153acda6d502da | 4,962 | py | Python | analysis/management/commands/importmusic.py | msampaio/FlautaSolo | 407253513712462e3521c06bcc35a9b95da0fe19 | [
"BSD-3-Clause"
] | null | null | null | analysis/management/commands/importmusic.py | msampaio/FlautaSolo | 407253513712462e3521c06bcc35a9b95da0fe19 | [
"BSD-3-Clause"
] | 4 | 2019-03-18T20:11:30.000Z | 2019-03-18T20:11:59.000Z | analysis/management/commands/importmusic.py | msampaio/FlautaSolo | 407253513712462e3521c06bcc35a9b95da0fe19 | [
"BSD-3-Clause"
] | null | null | null | import os
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from progressbar import ProgressBar
from analysis.models import MusicData, MusicXMLScore
import music21
from music21.stream import StreamException
from music21.musedata.base40 import pitchToBase4... | 32.431373 | 94 | 0.68158 |
744b9873775211ef0fc5c50bbec37df4cf40f0bf | 2,559 | py | Python | widgets/utils/config.py | alberand/lemonbar | baa479edb422b6595794794dcd434a3ab65ae747 | [
"MIT"
] | null | null | null | widgets/utils/config.py | alberand/lemonbar | baa479edb422b6595794794dcd434a3ab65ae747 | [
"MIT"
] | null | null | null | widgets/utils/config.py | alberand/lemonbar | baa479edb422b6595794794dcd434a3ab65ae747 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================
# File with configuration for lemonbar.
#==============================================================================
colors = {
'c_red_l' : "#fffb4934",
'c_blue_l' : "#f... | 44.12069 | 79 | 0.334506 |
744ba2e13b1a981ad29d14aa8e9803417608c44f | 2,564 | py | Python | homeassistant/components/tradfri/cover.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2021-09-29T20:33:32.000Z | 2021-09-29T20:33:32.000Z | homeassistant/components/tradfri/cover.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/tradfri/cover.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for IKEA Tradfri covers."""
from homeassistant.components.cover import ATTR_POSITION, CoverDevice
from .base_class import TradfriBaseDevice
from .const import ATTR_MODEL, CONF_GATEWAY_ID, KEY_API, KEY_GATEWAY
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Load Tradfri covers ... | 34.186667 | 84 | 0.686037 |
744bae8ac3bf080c4ea07241642227d90c7b547c | 1,228 | py | Python | supriya/ugens/RecordBuf.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/RecordBuf.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/RecordBuf.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import collections
from supriya import CalculationRate
from supriya.synthdefs import UGen
class RecordBuf(UGen):
"""
Records or overdubs into a buffer.
::
>>> buffer_id = 23
>>> source = supriya.ugens.SoundIn.ar(bus=(0, 1))
>>> record_buf = supriya.ugens.RecordBuf.ar(
..... | 22.740741 | 79 | 0.5 |
744bdc0a2dbd42ed9c6acfbc859282a597561d0d | 2,071 | py | Python | development/OCCUtils/shell.py | atomicsulfate/meshcnn-4-cadseg | c0d91ec593293cb58eec422556d1322a3b4f6183 | [
"MIT"
] | 7 | 2021-04-07T06:31:58.000Z | 2022-01-27T09:49:51.000Z | development/OCCUtils/shell.py | atomicsulfate/meshcnn-4-cadseg | c0d91ec593293cb58eec422556d1322a3b4f6183 | [
"MIT"
] | null | null | null | development/OCCUtils/shell.py | atomicsulfate/meshcnn-4-cadseg | c0d91ec593293cb58eec422556d1322a3b4f6183 | [
"MIT"
] | 2 | 2021-05-19T03:39:04.000Z | 2021-08-12T08:20:19.000Z | ##Copyright 2008-2015 Jelle Feringa (jelleferinga@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at... | 30.014493 | 97 | 0.659102 |
744c04672b1deb585ec20bb03dbcba316d6fd1a1 | 854 | py | Python | test/BribeNet/graph/generation/test_unweightedGenerator.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | test/BribeNet/graph/generation/test_unweightedGenerator.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | test/BribeNet/graph/generation/test_unweightedGenerator.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | from unittest import TestCase
from BribeNet.graph.generation.unweightedGenerator import UnweightedGraphGenerator
from BribeNet.graph.generation import GraphGeneratorAlgo
class TestUnweightedGraphGenerator(TestCase):
def test_generate_ws(self):
graph_gen = UnweightedGraphGenerator(GraphGeneratorAlgo.WATTS... | 38.818182 | 96 | 0.748244 |
744c11dabcb4cb3e79530af6310f750529f96f34 | 633 | py | Python | src/python/pants/option/option_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/option/option_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/option/option_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from unittest import TestCase
from pants.option.option_util import flatten_shlexed_list
class OptionUtilTest(TestCase):
def test_flatten_shlexed_list(self) -> None:
assert flatte... | 39.5625 | 97 | 0.699842 |
744c28f84d110461b5e8cda195ef7a3049b0cea2 | 2,776 | py | Python | src/synthesized_insight/metrics/metrics_usage.py | synthesized-io/insight | a65b2061b11f17349119eed2a3e7bd224670000a | [
"BSD-3-Clause"
] | 3 | 2021-08-24T18:48:09.000Z | 2021-09-16T08:47:50.000Z | src/synthesized_insight/metrics/metrics_usage.py | synthesized-io/insight | a65b2061b11f17349119eed2a3e7bd224670000a | [
"BSD-3-Clause"
] | 20 | 2021-08-24T18:53:53.000Z | 2022-03-28T16:29:21.000Z | src/synthesized_insight/metrics/metrics_usage.py | synthesized-io/insight | a65b2061b11f17349119eed2a3e7bd224670000a | [
"BSD-3-Clause"
] | null | null | null |
from itertools import permutations
from typing import Optional, Tuple, Union
import numpy as np
import pandas as pd
from .base import TwoColumnMetric, TwoColumnTest
class TwoColumnMap:
"""Compares columns with the same name from two given dataframes and return a DataFrame
with index as the column name and ... | 36.526316 | 111 | 0.682277 |
744c3a44332e3756c22ffe41cd547b052fb7a275 | 1,442 | py | Python | analysis/utils/confusion_matrix.py | DrugowitschLab/motion-structure-identification | 908f084b36c7387daf0cbfe75f16bab70cf96db9 | [
"MIT"
] | null | null | null | analysis/utils/confusion_matrix.py | DrugowitschLab/motion-structure-identification | 908f084b36c7387daf0cbfe75f16bab70cf96db9 | [
"MIT"
] | null | null | null | analysis/utils/confusion_matrix.py | DrugowitschLab/motion-structure-identification | 908f084b36c7387daf0cbfe75f16bab70cf96db9 | [
"MIT"
] | null | null | null | from typing import List
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import Colormap
from itertools import product
def plot_confusion_matrix(cm: np.ndarray, xticks: List[str], yticks: List[str], ax: plt.Axes,
cmap: Colormap = plt.get_cmap('Blues'), normalize: boo... | 36.05 | 114 | 0.620666 |
744c6daf9cb89819b7ac8cbf0fefa521a24387e9 | 3,122 | py | Python | add_edit_geometry_in_sql.py | mhgzadeh/spatialite_python_script | 328256664fddfc6433d82195ec090c9ca63df646 | [
"MIT"
] | null | null | null | add_edit_geometry_in_sql.py | mhgzadeh/spatialite_python_script | 328256664fddfc6433d82195ec090c9ca63df646 | [
"MIT"
] | null | null | null | add_edit_geometry_in_sql.py | mhgzadeh/spatialite_python_script | 328256664fddfc6433d82195ec090c9ca63df646 | [
"MIT"
] | null | null | null | class AddGeometry:
def __init__(self, epsg_num, input_filename, output_filename):
self.epsg_num = int(epsg_num)
self.sql_text = self.__open_text_file(input_filename)
self.edited_sql_list = list()
self.table_name = list()
self.geometry_table_name = list()
self.__edit_s... | 43.971831 | 117 | 0.586483 |
744c8a98eef4ead8a77f25aaf5fb199a1c016533 | 2,368 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/input_encrypted_file.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/input_encrypted_file.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_encrypted_file.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.573333 | 103 | 0.616132 |
744c96ede8c2df8d1245eb42b2f967c1f41d7112 | 9,528 | py | Python | data/level/level73.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | null | null | null | data/level/level73.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 6 | 2020-07-04T02:53:08.000Z | 2022-03-11T23:53:14.000Z | data/level/level73.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 3 | 2019-12-31T11:42:59.000Z | 2021-03-28T20:06:13.000Z | data = {
'level_index': 73,
'move_count': 28,
'board_info': {
(0, 1): {
'base': (66, 1),
'next': (0, 1),
'prev': (0, -1)
},
(0, 2): {
'base': (66, 1),
'next': (0, 1),
'prev': (0, -1)
},
(1, 0): {
... | 22.848921 | 34 | 0.190806 |
744cb64e99d65fa682e9a1009d4f67b2a52284a7 | 1,507 | py | Python | socfaker/application.py | atstpls/soc-faker | 119fcb9c4329a918ef9001ac5eaa36251b862bf0 | [
"MIT"
] | null | null | null | socfaker/application.py | atstpls/soc-faker | 119fcb9c4329a918ef9001ac5eaa36251b862bf0 | [
"MIT"
] | null | null | null | socfaker/application.py | atstpls/soc-faker | 119fcb9c4329a918ef9001ac5eaa36251b862bf0 | [
"MIT"
] | null | null | null | import random, pendulum
class Application(object):
def __init__(self):
self.logon_timestamp = 45
self.status = ''
self.account_status = ''
self.name = ''
@property
def status(self):
return self._status
@status.setter
def status(self, value):
self... | 25.116667 | 177 | 0.554081 |
744cb75569fdaae33feb3efe98694ed8f37f39c6 | 1,708 | py | Python | leetcode/1-easy/5-sort/2-firstbad/first_bad.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | leetcode/1-easy/5-sort/2-firstbad/first_bad.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | leetcode/1-easy/5-sort/2-firstbad/first_bad.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | # https://leetcode.com/explore/interview/card/top-interview-questions-easy/96/sorting-and-searching/774/
# https://leetcode.com/problems/first-bad-version/description/
# First Bad Version
#
# You are given an API bool isBadVersion(version) which will return
# whether version is bad. Implement a function to find the fi... | 29.964912 | 104 | 0.577283 |
744cbe24130edd553f47e5c0e93fcdfbe3e89c30 | 1,214 | py | Python | training_procedure/evaluate.py | FFTYYY/TWIRLS | e751fa514baef54e8456135b7b790a0f810d0792 | [
"MIT"
] | 25 | 2021-06-16T15:56:04.000Z | 2022-02-06T09:47:31.000Z | training_procedure/evaluate.py | FFTYYY/TWIRLS | e751fa514baef54e8456135b7b790a0f810d0792 | [
"MIT"
] | null | null | null | training_procedure/evaluate.py | FFTYYY/TWIRLS | e751fa514baef54e8456135b7b790a0f810d0792 | [
"MIT"
] | 1 | 2021-06-29T05:45:47.000Z | 2021-06-29T05:45:47.000Z | import torch as tc
from sklearn.metrics import f1_score
import torch.nn as nn
from utils.ignn_utils import Evaluation
import pdb
@tc.no_grad()
def get_eval_result(self, labels, pred_l, loss):
if self.C.multilabel:
micro , macro = Evaluation(pred_l , labels)
else:
micro = f1_score(labels.cpu(),... | 25.829787 | 74 | 0.620264 |
744cbeb68d63e3698324bb35e1746d6158f2e21b | 8,920 | py | Python | vathos/data_loader/dense_depth.py | satyajitghana/ProjektDepth | 4dea3333cd3d8dbc43174a89494e1ff832714fc8 | [
"MIT"
] | 2 | 2020-06-03T08:50:00.000Z | 2020-12-17T14:49:45.000Z | vathos/data_loader/dense_depth.py | satyajitghana/ProjektDepth | 4dea3333cd3d8dbc43174a89494e1ff832714fc8 | [
"MIT"
] | null | null | null | vathos/data_loader/dense_depth.py | satyajitghana/ProjektDepth | 4dea3333cd3d8dbc43174a89494e1ff832714fc8 | [
"MIT"
] | 5 | 2020-05-21T03:12:46.000Z | 2021-05-06T17:51:33.000Z | from pathlib import Path
import os
from torch.utils.data import Dataset
import matplotlib.pyplot as plt
import seaborn as sns
# from tqdm.auto import tqdm
from tqdm.notebook import tqdm, trange
import numpy as np
from PIL import Image
import PIL
import zipfile
from zipfile import ZipFile
sns.set()
class DenseDepth(Da... | 34.708171 | 170 | 0.591928 |
744cc2edd3f6c332855fca9839c6f0d635df452d | 1,803 | py | Python | EtekcityOutlet/etekcity_all_off.py | pgcrumley/Controllers | d121678f4585911c0b79785b6b22b92d2029ae8a | [
"MIT"
] | 3 | 2018-08-20T15:32:07.000Z | 2019-04-08T20:24:19.000Z | EtekcityOutlet/etekcity_all_off.py | pgcrumley/Controllers | d121678f4585911c0b79785b6b22b92d2029ae8a | [
"MIT"
] | null | null | null | EtekcityOutlet/etekcity_all_off.py | pgcrumley/Controllers | d121678f4585911c0b79785b6b22b92d2029ae8a | [
"MIT"
] | null | null | null | #!env python3
"""
MIT License
Copyright (c) 2017 Paul G Crumley
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, ... | 36.06 | 81 | 0.769273 |
744cebc718ae2de85e5bc4bd1d86f89063994cbf | 63,503 | py | Python | Source/Truss_Calculator.py | lorcan2440/SimpleTrussCalculator | 3c063fbc5f1987e9a700e312b763b36d4ec22495 | [
"MIT"
] | 1 | 2021-07-29T14:34:08.000Z | 2021-07-29T14:34:08.000Z | Source/Truss_Calculator.py | lorcan2440/SimpleTrussCalculator | 3c063fbc5f1987e9a700e312b763b36d4ec22495 | [
"MIT"
] | 1 | 2021-07-30T17:34:42.000Z | 2021-07-30T17:34:42.000Z | Source/Truss_Calculator.py | lorcan2440/SimpleTrussCalculator | 3c063fbc5f1987e9a700e312b763b36d4ec22495 | [
"MIT"
] | 1 | 2022-03-13T11:01:34.000Z | 2022-03-13T11:01:34.000Z | # pyright: reportMissingModuleSource=false
"""
Simple Truss Calculator
Version: 1.5
Source: https://github.com/lorcan2440/Simple-Truss-Calculator
By: Lorcan Nicholls
Contact: lnick2440@gmail.com
Tests: test_TrussCalc.py
Calculator and interactive program for finding internal/reaction forces,
s... | 42.307129 | 112 | 0.597625 |
744cf131640a99323d178c5215bdb30eab3b5d1f | 4,535 | py | Python | stand.py | scrollocks/bdd_bananas | 72e32306d0aa79e4fde58fa53045434c6a7ca4be | [
"Unlicense"
] | null | null | null | stand.py | scrollocks/bdd_bananas | 72e32306d0aa79e4fde58fa53045434c6a7ca4be | [
"Unlicense"
] | null | null | null | stand.py | scrollocks/bdd_bananas | 72e32306d0aa79e4fde58fa53045434c6a7ca4be | [
"Unlicense"
] | null | null | null | """
This toy code simulates a stand that sells frozen bananas. You could sell anything you
want really,
* The stand has an inventory, which is populated when a new stand is created.
* As sales are made, items in the inventory are consumed and sales totals and quantities arae calculated
"""
class Stand():
"""Repr... | 38.432203 | 126 | 0.612789 |
744d3ddd1508d8aa882e2579daa6640d05c276f9 | 662 | py | Python | python/CHIP/chuva.py | nidiascampos/smartgreen | d574d90918702ac3bd383ed77d673f871576c5b0 | [
"Apache-2.0"
] | 1 | 2021-02-13T07:42:04.000Z | 2021-02-13T07:42:04.000Z | python/CHIP/chuva.py | nidiascampos/smartgreen | d574d90918702ac3bd383ed77d673f871576c5b0 | [
"Apache-2.0"
] | null | null | null | python/CHIP/chuva.py | nidiascampos/smartgreen | d574d90918702ac3bd383ed77d673f871576c5b0 | [
"Apache-2.0"
] | null | null | null | import logging
import datetime
import CHIP_IO.GPIO as GPIO
from pymongo import MongoClient
# Logging config
logging.basicConfig(filename="/var/log/smartgreen/rain_sensor.log",
level=logging.DEBUG,
format="%(asctime)s %(message)s")
#logging.info("====================")
# DB
cli... | 17.891892 | 67 | 0.672205 |
744d3ecd9642543457456425bc0b383c18829d9e | 22,998 | py | Python | pytest_doctestplus/plugin.py | vanyakosmos/pytest-doctestplus | d3d22075a16e2320aa9e8393e6aad8748260f444 | [
"BSD-3-Clause"
] | null | null | null | pytest_doctestplus/plugin.py | vanyakosmos/pytest-doctestplus | d3d22075a16e2320aa9e8393e6aad8748260f444 | [
"BSD-3-Clause"
] | null | null | null | pytest_doctestplus/plugin.py | vanyakosmos/pytest-doctestplus | d3d22075a16e2320aa9e8393e6aad8748260f444 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This plugin provides advanced doctest support and enables the testing of .rst
files.
"""
import doctest
import fnmatch
import os
import re
import sys
import warnings
import pytest
import six
from pytest_doctestplus.utils import ModuleChecker
from .ou... | 41.587703 | 112 | 0.577659 |
744d511a0dd78fcab1ffc91448d1415991751a8f | 650 | py | Python | Aula25/teste.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula25/teste.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula25/teste.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | # 1- Faça um Programa que leia um vetor de 5 números inteiros e mostre-os.
# 2- Faça um Programa que leia um vetor de 10 números reais e mostre-os na ordem inversa.
# 3- Faça um Programa que leia 4 notas, mostre as notas e a média na tela.
# 4- Faça um Programa que leia um vetor de 10 caracteres, e diga quantas consoan... | 32.5 | 119 | 0.655385 |
744d5212eb2b7d949fe46b309502c3adce284d48 | 1,411 | py | Python | config/urls.py | Rydra/mastermind-api | f315eedc4e2e1397f319e3d9ab90d580ba1626b4 | [
"MIT"
] | null | null | null | config/urls.py | Rydra/mastermind-api | f315eedc4e2e1397f319e3d9ab90d580ba1626b4 | [
"MIT"
] | 3 | 2022-01-02T14:49:35.000Z | 2022-01-02T14:49:35.000Z | config/urls.py | Rydra/mastermind-api | f315eedc4e2e1397f319e3d9ab90d580ba1626b4 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views import defaults as default_views
urlpatterns = [
# Django Admin, use {% url 'admin:index' %}
path(settings.ADMIN_URL, admin.site.urls),
# User... | 33.595238 | 86 | 0.638554 |
744d6d07529e80fc1b579d29e7b7c7a508551df7 | 937 | py | Python | pyfyre/user/src/__init__.py | MrSluffy/pyfyre | e0b7fd32c230d8b2879123e8d2e91367b41e82f3 | [
"MIT"
] | null | null | null | pyfyre/user/src/__init__.py | MrSluffy/pyfyre | e0b7fd32c230d8b2879123e8d2e91367b41e82f3 | [
"MIT"
] | null | null | null | pyfyre/user/src/__init__.py | MrSluffy/pyfyre | e0b7fd32c230d8b2879123e8d2e91367b41e82f3 | [
"MIT"
] | null | null | null | from pyfyre.widgets import *
from pyfyre.pyfyre import runApp
from src.main import MyWebpage
# This class is called at `runApp` method
# at the bottom. A class that inherits
# UsesState class has a `build` method that
# should return a Widget.
class App(UsesState):
def __init__(self):
# If you want to stor... | 29.28125 | 62 | 0.689434 |
744d851f511ae7e3748001f77e543f3dd1418dc7 | 3,511 | py | Python | libs/modeling/losses.py | yjh0410/actionformer_release | 7a97422111d3e29c8d2e14088c850c6975855ea7 | [
"MIT"
] | null | null | null | libs/modeling/losses.py | yjh0410/actionformer_release | 7a97422111d3e29c8d2e14088c850c6975855ea7 | [
"MIT"
] | null | null | null | libs/modeling/losses.py | yjh0410/actionformer_release | 7a97422111d3e29c8d2e14088c850c6975855ea7 | [
"MIT"
] | null | null | null | import torch
from torch.nn import functional as F
def sigmoid_focal_loss(
inputs,
targets,
reduction = 'none',
alpha = 0.25,
gamma = 2.0):
"""
Loss used in RetinaNet for dense detection: https://arxiv.org/abs/1708.02002.
Taken from
https://github.com/facebookresearch/fvcore/blob/mas... | 32.813084 | 83 | 0.604101 |
744d872a114505a1db56460186e985d961c8a10b | 15,390 | py | Python | test/gw/detector/networks_test.py | deepchatterjeeligo/bilby | 6532c63d0d970ad33478ae0b1c28d4c570b74047 | [
"MIT"
] | null | null | null | test/gw/detector/networks_test.py | deepchatterjeeligo/bilby | 6532c63d0d970ad33478ae0b1c28d4c570b74047 | [
"MIT"
] | null | null | null | test/gw/detector/networks_test.py | deepchatterjeeligo/bilby | 6532c63d0d970ad33478ae0b1c28d4c570b74047 | [
"MIT"
] | null | null | null | import unittest
from unittest import mock
from shutil import rmtree
from itertools import combinations
import numpy as np
import bilby
class TestInterferometerList(unittest.TestCase):
def setUp(self):
self.frequency_arrays = np.linspace(0, 4096, 4097)
self.name1 = "name1"
self.name2 = "n... | 39.562982 | 88 | 0.663483 |
744dba1865b0593db3590e544096c38ed1a01e2e | 712 | py | Python | pyosmo/algorithm/base.py | OPpuolitaival/pyosmo | d95b46bccde44d5d214558ff580da033fd66feaf | [
"MIT"
] | 7 | 2018-08-13T06:01:23.000Z | 2021-12-11T18:18:14.000Z | pyosmo/algorithm/base.py | OPpuolitaival/pyosmo | d95b46bccde44d5d214558ff580da033fd66feaf | [
"MIT"
] | 4 | 2018-07-18T05:14:05.000Z | 2021-12-11T18:17:47.000Z | pyosmo/algorithm/base.py | OPpuolitaival/pyosmo | d95b46bccde44d5d214558ff580da033fd66feaf | [
"MIT"
] | 4 | 2018-03-19T11:24:00.000Z | 2021-12-11T18:16:15.000Z | from abc import abstractmethod
from random import Random
from typing import List
from pyosmo.history.history import OsmoHistory
from pyosmo.model import OsmoModelCollector, TestStep
class OsmoAlgorithm:
random = None
model = None
def __init__(self):
pass
def initialize(self, random: Random,... | 25.428571 | 80 | 0.683989 |
744dbf7cda60745d1fd488d2dc2d7c921a8286c7 | 4,635 | py | Python | experiments/ashvin/icml2020/quinoa/pen/mse_bin1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/quinoa/pen/mse_bin1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/quinoa/pen/mse_bin1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.demos.source.mdp_path_loader import MDPPathLoader
from rlkit.launchers.experiments.ashvin.quinoa_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.... | 31.965517 | 91 | 0.586192 |
744dccc8fecaa3d34653467ad3a72db78c9e2c64 | 19,221 | py | Python | tensorBNN/network.py | akgopan/TensorBNN | 44f0c02cd721c9e43e8f7ad4bbd2648969034e52 | [
"MIT"
] | null | null | null | tensorBNN/network.py | akgopan/TensorBNN | 44f0c02cd721c9e43e8f7ad4bbd2648969034e52 | [
"MIT"
] | null | null | null | tensorBNN/network.py | akgopan/TensorBNN | 44f0c02cd721c9e43e8f7ad4bbd2648969034e52 | [
"MIT"
] | null | null | null | import os
import time
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorBNN.paramAdapter import paramAdapter
tfd = tfp.distributions
class network(object):
"""An object used for storing all of the variables required to create
a Bayesian Neural Network using Hamilton... | 38.212724 | 140 | 0.552781 |
744dd998f0f887bd2a178fc383229694175f291e | 2,800 | py | Python | venv/Lib/site-packages/nbdime/diffing/seq_bruteforce.py | PeerHerholz/guideline_jupyter_book | ce445e4be0d53370b67708a22550565b90d71ac6 | [
"BSD-3-Clause"
] | 2 | 2021-02-16T16:17:07.000Z | 2021-11-08T20:27:13.000Z | venv/Lib/site-packages/nbdime/diffing/seq_bruteforce.py | PeerHerholz/guideline_jupyter_book | ce445e4be0d53370b67708a22550565b90d71ac6 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/nbdime/diffing/seq_bruteforce.py | PeerHerholz/guideline_jupyter_book | ce445e4be0d53370b67708a22550565b90d71ac6 | [
"BSD-3-Clause"
] | 4 | 2020-11-14T17:05:36.000Z | 2020-11-16T18:44:54.000Z | # coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import unicode_literals
from six.moves import xrange as range
import operator
from .lcs import diff_from_lcs
__all__ = ["diff_sequence_bruteforce"]
def bruteforce_compare_grid(A, B,... | 30.434783 | 98 | 0.573571 |
744dfe9808cc25404c39017d7f227decb6b75567 | 72 | py | Python | heist/__init__.py | CRZA5/CRZA-eSports-cogs-V3 | 80f4c9a4e5f46f4ded99ccc90bd7c45016984d29 | [
"MIT"
] | null | null | null | heist/__init__.py | CRZA5/CRZA-eSports-cogs-V3 | 80f4c9a4e5f46f4ded99ccc90bd7c45016984d29 | [
"MIT"
] | null | null | null | heist/__init__.py | CRZA5/CRZA-eSports-cogs-V3 | 80f4c9a4e5f46f4ded99ccc90bd7c45016984d29 | [
"MIT"
] | null | null | null | from .heist import Heist
def setup(bot):
bot.add_cog(Heist(bot)) | 18 | 27 | 0.680556 |
744e003a2e2367f5f8c23cd4c8d9dc8ab04de41a | 268 | py | Python | document/data mining/scivis data mining/writename.py | LiruiErnest/VisMemo | 4ff84dbb3e9d892025fa9a54e41d2c96a5ae3482 | [
"Apache-2.0"
] | null | null | null | document/data mining/scivis data mining/writename.py | LiruiErnest/VisMemo | 4ff84dbb3e9d892025fa9a54e41d2c96a5ae3482 | [
"Apache-2.0"
] | null | null | null | document/data mining/scivis data mining/writename.py | LiruiErnest/VisMemo | 4ff84dbb3e9d892025fa9a54e41d2c96a5ae3482 | [
"Apache-2.0"
] | 1 | 2019-12-10T03:05:56.000Z | 2019-12-10T03:05:56.000Z | import os, csv
with open("1.csv", 'w') as f:
writer = csv.writer(f)
for path, dirs, files in os.walk("/Users/lirui/Dropbox/Visualization/Work/Data collection/scivis memorability dataset"):
for filename in files:
writer.writerow([filename]) | 38.285714 | 124 | 0.671642 |
744e0b402f3f5160886c7774e15fb06f507e30d5 | 3,065 | py | Python | tigeralgorithmexample/gcio.py | JasonChen47/tiger | 10ab3b071efff9b3bbb9029c114b859e24b1580e | [
"MIT"
] | 4 | 2022-02-25T05:43:04.000Z | 2022-03-28T04:24:41.000Z | tigeralgorithmexample/gcio.py | DIAGNijmegen/pathology-tiger-algorithm-example | 29dfa266451f5bb60041cae3bd30ce999ac0220a | [
"MIT"
] | null | null | null | tigeralgorithmexample/gcio.py | DIAGNijmegen/pathology-tiger-algorithm-example | 29dfa266451f5bb60041cae3bd30ce999ac0220a | [
"MIT"
] | 4 | 2022-03-08T23:33:08.000Z | 2022-03-28T04:24:50.000Z | """ GrandChallenge Input/Output (gcio)
In this file settings concerning folders and paths for reading and writing on GrandChallenge are defined.
Note that these settings are moslty specific to the GrandChallenge Tiger Challenge.
"""
from pathlib import Path
from shutil import copy
# Grand Challenge paths
GRAND_CHA... | 33.681319 | 106 | 0.772594 |
744e0b41de6307c69a51b471616617644e1720bf | 53,034 | py | Python | jax/experimental/djax.py | lukstafi/jax | c1824087fc1f676fcbd1d26b0c3b07cc3bdadb01 | [
"Apache-2.0"
] | null | null | null | jax/experimental/djax.py | lukstafi/jax | c1824087fc1f676fcbd1d26b0c3b07cc3bdadb01 | [
"Apache-2.0"
] | null | null | null | jax/experimental/djax.py | lukstafi/jax | c1824087fc1f676fcbd1d26b0c3b07cc3bdadb01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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, ... | 34.237573 | 97 | 0.685862 |
744e2b64ada9eb753c9edefd4fde21eff3a4a4d8 | 2,826 | py | Python | bot/main.py | c0rexx/pepek-bot | 8f8df56ae43bc6df15a0861e127396f06d7e1f54 | [
"MIT"
] | null | null | null | bot/main.py | c0rexx/pepek-bot | 8f8df56ae43bc6df15a0861e127396f06d7e1f54 | [
"MIT"
] | null | null | null | bot/main.py | c0rexx/pepek-bot | 8f8df56ae43bc6df15a0861e127396f06d7e1f54 | [
"MIT"
] | 1 | 2021-03-12T13:46:37.000Z | 2021-03-12T13:46:37.000Z | import asyncio
import os
import random
import discord
from discord.ext import commands
from pretty_help import PrettyHelp
from cogs.garfield_cog import daily_garfield
from lib.emotes import basic_emoji
from lib.config import activities
# Bot's token
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
intents = discord.Inte... | 29.4375 | 158 | 0.710191 |
744e5bfd46956af7a87b584d824851b19ae9a014 | 9,369 | py | Python | TrainingExtensions/tensorflow/test/python/test_high_bias_fold_keras.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/tensorflow/test/python/test_high_bias_fold_keras.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/tensorflow/test/python/test_high_bias_fold_keras.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | # /usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... | 52.05 | 120 | 0.673391 |
744e6651e6e474b48a51d8626f672f5d8803d5ff | 314 | py | Python | projects/chapter7_try_yourself/7.3.py | rock-gustavo/Python_Crash_Course | 8c08c8f83e70d54f85983777dc29f1094f43f421 | [
"MIT"
] | null | null | null | projects/chapter7_try_yourself/7.3.py | rock-gustavo/Python_Crash_Course | 8c08c8f83e70d54f85983777dc29f1094f43f421 | [
"MIT"
] | null | null | null | projects/chapter7_try_yourself/7.3.py | rock-gustavo/Python_Crash_Course | 8c08c8f83e70d54f85983777dc29f1094f43f421 | [
"MIT"
] | null | null | null |
"""
7-3. Multiples of Ten: Ask the user for a number, and then report whether the number is a multiple of 10 or not.
"""
number = int(input("Choose an integer number: "))
if number % 10 == 0:
print(f"The number {number} is a multiple of 10")
else:
print(f"The number {number} is not a multiple of 10.")
| 26.166667 | 112 | 0.66879 |
744e769b39fceb9d1ec722784aea95f8bd1c2012 | 10,659 | py | Python | icebath/core/berggdf.py | lsetiawan/icebath | 018e8c5a33e0b081258d008c24a69dab6fccc0af | [
"BSD-3-Clause"
] | null | null | null | icebath/core/berggdf.py | lsetiawan/icebath | 018e8c5a33e0b081258d008c24a69dab6fccc0af | [
"BSD-3-Clause"
] | null | null | null | icebath/core/berggdf.py | lsetiawan/icebath | 018e8c5a33e0b081258d008c24a69dab6fccc0af | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import numpy as np
import scipy.io as spio
import scipy.stats as stats
import ogr
import os
import fnmatch
import geopandas as gpd
import rioxarray
from rioxarray.rioxarray import NoDataInBounds
import xarray as xr
from icebath.core import fjord_props as fjord
from icebath.core import fl_ice_calcs ... | 42.297619 | 132 | 0.607562 |
744e7e3eb0e1b0272fbd88b72ff3394b378d87b8 | 1,201 | py | Python | tests/test_provider_jianyuan_sentry.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_jianyuan_sentry.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_jianyuan_sentry.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_jianyuan_sentry.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:26:49 UTC)
def test_provider_import():
import terrascript.provider.jianyuan.sentry
def test_resource_import():
from terrascript.resource.jianyuan.sentry import sentry_key
from terrascript.resource.ji... | 29.292683 | 80 | 0.776853 |
744e89d28d0066d24d2c032c6d0fa28ccacc5d40 | 711 | py | Python | setup.py | opus49/pyddclient | 21e0805c7194b53499f54aa8ffe2a5ea2227390d | [
"MIT"
] | null | null | null | setup.py | opus49/pyddclient | 21e0805c7194b53499f54aa8ffe2a5ea2227390d | [
"MIT"
] | null | null | null | setup.py | opus49/pyddclient | 21e0805c7194b53499f54aa8ffe2a5ea2227390d | [
"MIT"
] | null | null | null | import pathlib
import setuptools
README = pathlib.Path(__file__).parent / 'README.rst'
with README.open('r') as fh_in:
LONG_DESCRIPTION = fh_in.read()
setuptools.setup(
name="goodyn",
version="0.0.1",
author="Mike Puskar",
author_email="puskar49@gmail.com",
description="Simple utility for Go... | 25.392857 | 56 | 0.670886 |
744e99c4409ecfd133c84a6652f6d47e088a3b86 | 7,999 | py | Python | pyram/tree/treeplots.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | pyram/tree/treeplots.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | pyram/tree/treeplots.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | def trajectory_multi(td,thisgal,save=None, out_dir='./'):
import matplotlib.colors as colors
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
color = td['aexp']/max(td['aexp'])
marker_area = np.sqrt(td['rvir'])
fig = plt.figure(figsize=(8,6))
ax1 = fig.add_s... | 33.190871 | 101 | 0.554069 |
744ef0c5d8e84385b06e3875f22e23954133523a | 5,670 | py | Python | pyalgotrade/barfeed/yahoofeed.py | gbecedatxapo/pyalgotrade | b1015f2f20714ae02f834a90f25376e40c6f8ab9 | [
"Apache-2.0"
] | 1 | 2020-07-06T18:38:38.000Z | 2020-07-06T18:38:38.000Z | pyalgotrade/barfeed/yahoofeed.py | gbecedatxapo/pyalgotrade | b1015f2f20714ae02f834a90f25376e40c6f8ab9 | [
"Apache-2.0"
] | null | null | null | pyalgotrade/barfeed/yahoofeed.py | gbecedatxapo/pyalgotrade | b1015f2f20714ae02f834a90f25376e40c6f8ab9 | [
"Apache-2.0"
] | null | null | null | # PyAlgoTrade
#
# Copyright 2011-2014 Gabriel Martin Becedillas Ruiz
#
# 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 ap... | 37.8 | 133 | 0.66843 |
744f0b57bf69ac33dfadcd02c780f1ee869c9b96 | 9,087 | py | Python | artemis/remote/nanny.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 235 | 2016-08-26T14:18:51.000Z | 2022-03-13T10:54:39.000Z | artemis/remote/nanny.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 112 | 2016-04-30T11:48:38.000Z | 2021-01-12T20:17:32.000Z | artemis/remote/nanny.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2016-11-05T19:09:19.000Z | 2021-09-13T07:35:40.000Z | import atexit
import signal
import sys
import threading
import time
class ManagedChildProcess(object):
def __init__(self,cp,monitor_for_termination,monitor_if_stuck_timeout):
self.cp = cp
self.monitor_for_termination = monitor_for_termination
self.monitor_if_stuck_timeout = monitor_if_stuck... | 45.208955 | 190 | 0.658633 |
744f20d7d6f5f0d73189120eaea982cf7c58b344 | 1,116 | py | Python | build_db.py | tmacro/hitman_agent | dab124adbac6e16b9f494246a49624f7af9c28da | [
"BSD-3-Clause"
] | 1 | 2017-07-29T13:02:28.000Z | 2017-07-29T13:02:28.000Z | build_db.py | tmacro/hitman_agent | dab124adbac6e16b9f494246a49624f7af9c28da | [
"BSD-3-Clause"
] | null | null | null | build_db.py | tmacro/hitman_agent | dab124adbac6e16b9f494246a49624f7af9c28da | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import sys
import socket
from gygax.util.config import config
from gygax.util.log import getLogger
import time
from gygax.app import db, Base
from gygax.models import User, Weapon, Location, Slack, Hit, game_players, Schedule
from sqlalchemy_utils import database_exists, create_database
_log = g... | 25.363636 | 83 | 0.713262 |
744f26a98013293dde2839e0c925e7ace3fc592d | 874 | py | Python | keystone/auth/plugins/saml2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/auth/plugins/saml2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/auth/plugins/saml2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | 1 | 2020-07-02T09:12:28.000Z | 2020-07-02T09:12:28.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 31.214286 | 76 | 0.757437 |
744f2d30de53f25daee9e610cb896b25de43a6f9 | 1,724 | py | Python | cyberpandas/_utils.py | achapkowski/cyberpandas | 054d3a37fe84a8d222795c31bbf99ef34be90fbf | [
"BSD-3-Clause"
] | 1 | 2019-04-29T04:29:22.000Z | 2019-04-29T04:29:22.000Z | cyberpandas/_utils.py | achapkowski/cyberpandas | 054d3a37fe84a8d222795c31bbf99ef34be90fbf | [
"BSD-3-Clause"
] | null | null | null | cyberpandas/_utils.py | achapkowski/cyberpandas | 054d3a37fe84a8d222795c31bbf99ef34be90fbf | [
"BSD-3-Clause"
] | null | null | null | """Utilities for working with IP address data."""
import struct
import numba
import six
def to_bytes(n, length, byteorder='big'):
# https://stackoverflow.com/a/20793663/1889400
h = '%x' % n
s = ('0' * (len(h) % 2) + h).zfill(length * 2).decode('hex')
return s if byteorder == 'big' else s[::-1]
def ... | 26.121212 | 64 | 0.603248 |
744f5631e58bca7f221172e4ac943707916bc29f | 3,358 | py | Python | traces/02-load-plot-traces_paper.py | pacslab/serverless-ml-serving | 03a4cd5f1739aa4710ef886edd9332b3d755efbd | [
"MIT"
] | 1 | 2022-03-06T11:21:48.000Z | 2022-03-06T11:21:48.000Z | traces/02-load-plot-traces_paper.py | pacslab/serverless-ml-serving | 03a4cd5f1739aa4710ef886edd9332b3d755efbd | [
"MIT"
] | null | null | null | traces/02-load-plot-traces_paper.py | pacslab/serverless-ml-serving | 03a4cd5f1739aa4710ef886edd9332b3d755efbd | [
"MIT"
] | null | null | null | # %%
# imports
import pacsltk
from IPython.display import display
from matplotlib.ticker import NullFormatter, ScalarFormatter
from pandas.plotting import register_matplotlib_converters
import matplotlib.pyplot as plt
from matplotlib import rcParams
from datetime import timedelta
import pacsltk.pacs_util as pacs_util
... | 28.457627 | 78 | 0.694759 |
744f809a803935937b274b474f6b0819132b21ab | 5,222 | py | Python | src/mop/framework/azure_connections.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | 1 | 2020-01-14T21:38:10.000Z | 2020-01-14T21:38:10.000Z | src/mop/framework/azure_connections.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | null | null | null | src/mop/framework/azure_connections.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | 1 | 2020-01-30T03:12:59.000Z | 2020-01-30T03:12:59.000Z | import inspect
from dotenv import load_dotenv
from msrestazure.azure_active_directory import (
AADTokenCredentials,
ServicePrincipalCredentials,
)
import logging
import configparser
import os
import adal
import requests
from contextlib import contextmanager
from adal import AuthenticationContext
@contextmanag... | 32.6375 | 175 | 0.6599 |
744f939446960257eb5a13401bb656cc6235dcb8 | 1,549 | py | Python | python/test/test_historical_app_type_setting.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/test/test_historical_app_type_setting.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/test/test_historical_app_type_setting.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import openlattice
from openlat... | 27.175439 | 105 | 0.666236 |
744fa835cb50e5c95cdf777c3c8bfc314d99040d | 4,724 | py | Python | gitgrid/gridcontroller/launchpad.py | RocketScienceAbteilung/git-grid | c38c6d73089a51144899161b19356808ceb4d725 | [
"MIT"
] | 9 | 2015-05-10T11:07:15.000Z | 2020-12-26T16:43:19.000Z | gitgrid/gridcontroller/launchpad.py | RocketScienceAbteilung/git-grid | c38c6d73089a51144899161b19356808ceb4d725 | [
"MIT"
] | null | null | null | gitgrid/gridcontroller/launchpad.py | RocketScienceAbteilung/git-grid | c38c6d73089a51144899161b19356808ceb4d725 | [
"MIT"
] | null | null | null | import mido
from . import GridController, lights, buttons
class Launchpad(GridController):
def __init__(self, input=None, output=None):
if input is None:
try:
input = mido.open_input('Launchpad Mini', callback=True)
except IOError:
input = mido.open_... | 28.630303 | 87 | 0.489416 |
744fabdf218642b0e193e3d2ec8127367c1bd976 | 7,477 | py | Python | improver/precipitation_type/snow_fraction.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver/precipitation_type/snow_fraction.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver/precipitation_type/snow_fraction.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 41.082418 | 92 | 0.652534 |
744fc9c43fe91296baee913ec6fe36328fe2d91c | 1,706 | py | Python | deepxde/array_ops.py | fabyayu/deepxde | 89880a4c61586512c87cabd1e7a3bdbaedf0feab | [
"Apache-2.0"
] | null | null | null | deepxde/array_ops.py | fabyayu/deepxde | 89880a4c61586512c87cabd1e7a3bdbaedf0feab | [
"Apache-2.0"
] | null | null | null | deepxde/array_ops.py | fabyayu/deepxde | 89880a4c61586512c87cabd1e7a3bdbaedf0feab | [
"Apache-2.0"
] | null | null | null | """Operations which handle numpy and tensorflow.compat.v1 automatically."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from . import config
from .backend import tf
def istensor(value):
return isinstance(value, (tf.Tensor, tf.V... | 29.413793 | 83 | 0.651817 |
744fcecf657e3eaac7f975989fadda4d4acd1b80 | 7,674 | py | Python | MachineLearning/kaggle/house_prices/data_visualization.py | YangXiaoo/NoteBook | 37056acad7a05b876832f72ac34d3d1a41e0dd22 | [
"CNRI-Python",
"RSA-MD",
"CECILL-B"
] | 58 | 2019-03-03T04:42:23.000Z | 2022-01-13T04:36:31.000Z | MachineLearning/kaggle/house_prices/data_visualization.py | YangXiaoo/NoteBook | 37056acad7a05b876832f72ac34d3d1a41e0dd22 | [
"CNRI-Python",
"RSA-MD",
"CECILL-B"
] | null | null | null | MachineLearning/kaggle/house_prices/data_visualization.py | YangXiaoo/NoteBook | 37056acad7a05b876832f72ac34d3d1a41e0dd22 | [
"CNRI-Python",
"RSA-MD",
"CECILL-B"
] | 28 | 2019-08-11T01:25:00.000Z | 2021-08-22T06:46:06.000Z | # coding:utf-8
# 2019-1-20
# house prices
# https://blog.csdn.net/huangxiaoyun1900/article/details/82229708
# 编码: http://www.cnblogs.com/king-lps/p/7846414.html
# 博客园:https://www.cnblogs.com/massquantity/p/8640991.html
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import seaborn as sns
import... | 31.322449 | 135 | 0.67227 |
744ffd5bdaef4904eb7dfaaca45462d27c72ac3a | 2,501 | py | Python | scrapfly/scrapy/middleware.py | scrapfly/python-scrapfly | ee3112971bc28b6a8e7039711f59da90de7025c2 | [
"BSD-2-Clause"
] | 3 | 2021-05-18T05:06:23.000Z | 2021-12-19T02:57:33.000Z | scrapfly/scrapy/middleware.py | scrapfly/python-scrapfly | ee3112971bc28b6a8e7039711f59da90de7025c2 | [
"BSD-2-Clause"
] | 5 | 2021-01-08T04:12:28.000Z | 2021-07-14T07:53:54.000Z | scrapfly/scrapy/middleware.py | scrapfly/python-scrapfly | ee3112971bc28b6a8e7039711f59da90de7025c2 | [
"BSD-2-Clause"
] | 1 | 2021-05-18T05:06:30.000Z | 2021-05-18T05:06:30.000Z | from typing import Union, Optional
from scrapy import Spider
from scrapy.http import Request, Response
from twisted.web._newclient import ResponseNeverReceived
from .spider import ScrapflySpider
from .request import ScrapflyScrapyRequest
from .response import ScrapflyScrapyResponse
import logging
logger = logging.g... | 39.078125 | 225 | 0.720512 |
745065035ec10c7c87464ed32d3069abe23a688e | 104 | py | Python | model/__init__.py | zhaoyucs/vrd-fastrcnn | 1de24034583b3af558f68c614f519072ae180c35 | [
"MIT"
] | null | null | null | model/__init__.py | zhaoyucs/vrd-fastrcnn | 1de24034583b3af558f68c614f519072ae180c35 | [
"MIT"
] | null | null | null | model/__init__.py | zhaoyucs/vrd-fastrcnn | 1de24034583b3af558f68c614f519072ae180c35 | [
"MIT"
] | null | null | null | from model.faster_rcnn_vgg16 import FasterRCNNVGG16
from model.faster_rcnn_vgg16 import VGG16PREDICATES
| 34.666667 | 51 | 0.903846 |
7450912c72e4057989764b923a5baee087a1178c | 1,403 | py | Python | ForgeShortUrl/setup.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | 1 | 2017-07-31T23:13:58.000Z | 2017-07-31T23:13:58.000Z | ForgeShortUrl/setup.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | ForgeShortUrl/setup.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 35.075 | 72 | 0.655025 |
7450978d6a62eea2d63bd68053eba8ddfc52ae75 | 29,924 | py | Python | test/base/driver_util.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | test/base/driver_util.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | null | null | null | test/base/driver_util.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | """Scripts for drivers of Galaxy functional tests."""
import collections
import fcntl
import httplib
import json
import logging
import os
import random
import shutil
import socket
import struct
import sys
import tempfile
import threading
import time
import nose.config
import nose.core
import nose.loader
import nose.p... | 39.014342 | 134 | 0.70395 |
7450bb551ea416c26afd76f58e8c3e292b183688 | 14,300 | py | Python | sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_reports_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_reports_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_reports_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 ... | 47.350993 | 245 | 0.69993 |
7450d9745847cad46bf7344243408bf285cdb4e2 | 10,097 | py | Python | tensorflow_probability/python/distributions/pert.py | renatoviolin/probability | 557351a2b79e4bd5a9025e791c81b612ab17bf38 | [
"Apache-2.0"
] | 1 | 2020-11-08T17:03:46.000Z | 2020-11-08T17:03:46.000Z | tensorflow_probability/python/distributions/pert.py | etarakci-hvl/probability | 7a0ce5e5beff91051028258dfbc7bc6cf0c4998d | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/pert.py | etarakci-hvl/probability | 7a0ce5e5beff91051028258dfbc7bc6cf0c4998d | [
"Apache-2.0"
] | 1 | 2020-05-27T19:42:06.000Z | 2020-05-27T19:42:06.000Z | # Copyright 2019 The TensorFlow Probability 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 o... | 36.583333 | 80 | 0.67525 |
7450edf32a86001e68b5f4abc14d19d611382027 | 1,237 | py | Python | Genome_organization/combine_GSEA_allnode.py | JustinRunyon/JustinRunyon | 0c3c88555459355a64e78579141af0836b674545 | [
"BSD-3-Clause"
] | 67 | 2015-11-12T17:52:49.000Z | 2021-04-08T16:07:38.000Z | Genome_organization/combine_GSEA_allnode.py | shijs1982/adage | 2575a60804218db7f91402b955371bb60e5b00d6 | [
"BSD-3-Clause"
] | 2 | 2016-01-12T21:25:17.000Z | 2016-05-17T14:03:06.000Z | Genome_organization/combine_GSEA_allnode.py | shijs1982/adage | 2575a60804218db7f91402b955371bb60e5b00d6 | [
"BSD-3-Clause"
] | 29 | 2015-12-16T14:34:07.000Z | 2022-02-16T21:04:31.000Z | '''
Combine all the significant associated operons with each node into one file.
'''
import os
import glob
import sys
FDR = float(sys.argv[1]) #significance cutoff
net_size = 50
out_file = 'Genome_organization/GSEA'+'_FDR_'+str(FDR)+'.txt'
out_fh = open(out_file,'w')
out_fh.write('node\toperon\tq_value\n')
#loop ov... | 30.925 | 108 | 0.628133 |
7450ef890e8bd88e7b3fa2ba0065907e84b0c71c | 167 | py | Python | math_and_algorithm/013.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | math_and_algorithm/013.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | math_and_algorithm/013.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import math
N = int(input())
ans = []
for i in range(1, int(math.sqrt(N)) + 1):
if N % i == 0:
print(i)
if i != N // i:
print(N // i)
| 16.7 | 41 | 0.419162 |
7451050251eae4fe85c58b0b476b57fad98fb3f4 | 3,946 | py | Python | tempest/api/volume/test_volume_transfers.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/volume/test_volume_transfers.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/volume/test_volume_transfers.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 37.580952 | 78 | 0.664724 |
745197ced723fa936b9380aefa3b2c192976ffa4 | 388 | py | Python | python/math/0575_distribute_candies.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/math/0575_distribute_candies.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/math/0575_distribute_candies.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
s = {candy for candy in candies}
return min(len(s), len(candies) // 2)
def test_distribute_candies():
s = Solution()
assert 3 == s.distributeCandies([1... | 25.866667 | 55 | 0.561856 |
7451bb9d15f3204ad0d312e11c09b081fa9a8182 | 1,458 | py | Python | datawinners/location/utils.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/location/utils.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/location/utils.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | import os, glob
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError
from datawinners.location.models import LocationLevel, location_level_mapping, madagascar_wgs84_mapping
def load_from_gdam_shp_file(file_name, verbose):
ind_shp = os.path.abspath(os.path.join(os.path.dirname(__file__) + ... | 44.181818 | 119 | 0.709191 |
7451cab8990e9fafbd59d492fe90c4d2b24792b9 | 2,202 | py | Python | daoliproxy/agent/nova.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | daoliproxy/agent/nova.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | daoliproxy/agent/nova.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | from oslo_config import cfg
from oslo_log import log as logging
from daoliproxy.agent import base
from novaclient.v2 import client as nova_client
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
def novaclient(request):
auth_url = base.url_for(request.catalog, 'compute')
LOG.debug('novaclient connection ... | 36.098361 | 77 | 0.681653 |
7451cde87078a5ba7380cb6e47ec1fe8ac36d91a | 4,291 | py | Python | alipay/aop/api/response/AlipayFundBailOrderQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayFundBailOrderQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayFundBailOrderQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFundBailOrderQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayFundBailOrderQueryResponse, self).__init__()
self._auth_no = None
self._biz_... | 29.390411 | 105 | 0.653228 |
7451ec002bdf9c55da40458010ee577346b700e4 | 4,761 | py | Python | utils/iperflexer/argumentparser.py | stepanandr/taf | 75cb85861f8e9703bab7dc6195f3926b8394e3d0 | [
"Apache-2.0"
] | 10 | 2016-12-16T00:05:58.000Z | 2018-10-30T17:48:25.000Z | utils/iperflexer/argumentparser.py | stepanandr/taf | 75cb85861f8e9703bab7dc6195f3926b8394e3d0 | [
"Apache-2.0"
] | 40 | 2017-01-04T23:07:05.000Z | 2018-04-16T19:52:02.000Z | utils/iperflexer/argumentparser.py | stepanandr/taf | 75cb85861f8e9703bab7dc6195f3926b8394e3d0 | [
"Apache-2.0"
] | 23 | 2016-12-30T05:03:53.000Z | 2020-04-01T08:40:24.000Z | """
Copyright (c) 2014 Russell Nakamura
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, publish, distribut... | 44.495327 | 171 | 0.560597 |
7452021c9c0086ffaf2c44c4d2492568066b6fd8 | 2,185 | py | Python | WhatManager2/management/commands/transmission_nice_reannounce.py | MADindustries/WhatManager2 | d000c53fd993cb526aee85ce2dbc957fa4070ab8 | [
"MIT"
] | 4 | 2015-08-26T05:13:58.000Z | 2022-01-24T07:29:51.000Z | WhatManager2/management/commands/transmission_nice_reannounce.py | point-source/WhatManager2 | d087f3603a5a96cf191a30d56619c0f5ce0dabc7 | [
"MIT"
] | 21 | 2015-08-14T03:58:43.000Z | 2019-11-14T18:25:37.000Z | WhatManager2/management/commands/transmission_nice_reannounce.py | point-source/WhatManager2 | d087f3603a5a96cf191a30d56619c0f5ce0dabc7 | [
"MIT"
] | 2 | 2015-10-28T09:02:16.000Z | 2019-09-23T00:21:54.000Z | from optparse import make_option
import time
from django.core.management.base import BaseCommand
from home.models import ReplicaSet
BATCH_SIZE = 50
def is_torrent_errored(torrent):
if torrent.error:
return True
for tracker in torrent.trackerStats:
if not tracker['lastAnnounceSucceeded']:
... | 34.68254 | 80 | 0.582151 |
745208ca9608c5a56eee9a78236bd147dfc4432c | 154 | py | Python | iris_sdk/models/maps/warning.py | NumberAI/python-bandwidth-iris | 0e05f79d68b244812afb97e00fd65b3f46d00aa3 | [
"MIT"
] | 2 | 2020-04-13T13:47:59.000Z | 2022-02-23T20:32:41.000Z | iris_sdk/models/maps/warning.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2020-09-18T20:59:24.000Z | 2021-08-25T16:51:42.000Z | iris_sdk/models/maps/warning.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2018-12-12T14:39:50.000Z | 2020-11-17T21:42:29.000Z | #!/usr/bin/env python
from iris_sdk.models.maps.base_map import BaseMap
class WarningMap(BaseMap):
description = None
telephone_number = None
| 19.25 | 49 | 0.746753 |
74521264b97cf72d8ed0c13ba31bf6444852163a | 60 | py | Python | app.py | epg-apg/lfs-checkdigit-api | 17ca1480e76e2d902f7a712b4f5bc1cf419fcb86 | [
"MIT"
] | null | null | null | app.py | epg-apg/lfs-checkdigit-api | 17ca1480e76e2d902f7a712b4f5bc1cf419fcb86 | [
"MIT"
] | null | null | null | app.py | epg-apg/lfs-checkdigit-api | 17ca1480e76e2d902f7a712b4f5bc1cf419fcb86 | [
"MIT"
] | null | null | null | from lfscheckdigitapi import create_app
app = create_app()
| 15 | 39 | 0.816667 |
745229398b328afc9bc06795f285b26af78c3a6b | 3,096 | py | Python | notification_django_app/users/tests/test_views.py | rajat-np/notification-django-app | 37929b654cc8bceadb73b50897297ef49f1af7c4 | [
"MIT"
] | null | null | null | notification_django_app/users/tests/test_views.py | rajat-np/notification-django-app | 37929b654cc8bceadb73b50897297ef49f1af7c4 | [
"MIT"
] | 1 | 2022-02-28T23:10:02.000Z | 2022-02-28T23:10:02.000Z | notification_django_app/users/tests/test_views.py | rajat-np/notification-django-app | 37929b654cc8bceadb73b50897297ef49f1af7c4 | [
"MIT"
] | null | null | null | import pytest
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory
from django.url... | 31.591837 | 75 | 0.69186 |
74523418add2a2d5b692dc64b4877342161420f4 | 5,643 | py | Python | scripts/Y2019M07D12_RH_Aqueduct30_Data_Download_Monthly_V01.py | jmccann-REH/aqueduct30_data_download | 8ec9d11ef3aec36bb58b9750cbdb55ee0200e537 | [
"MIT"
] | 13 | 2020-01-16T18:44:48.000Z | 2021-09-07T15:35:45.000Z | scripts/Y2019M07D12_RH_Aqueduct30_Data_Download_Monthly_V01.py | jmccann-REH/aqueduct30_data_download | 8ec9d11ef3aec36bb58b9750cbdb55ee0200e537 | [
"MIT"
] | 2 | 2020-01-16T10:52:10.000Z | 2022-02-18T21:14:31.000Z | scripts/Y2019M07D12_RH_Aqueduct30_Data_Download_Monthly_V01.py | jmccann-REH/aqueduct30_data_download | 8ec9d11ef3aec36bb58b9750cbdb55ee0200e537 | [
"MIT"
] | 7 | 2020-01-16T18:53:59.000Z | 2022-03-19T07:30:23.000Z |
# coding: utf-8
# In[1]:
"""
Process and export monthly data.
Author: Rutger Hofste
Date: 20190712
Kernel: python35
Docker: rutgerhofste/gisdocker:ubuntu16.04
"""
TESTING = 0
SCRIPT_NAME = "Y2019M07D12_RH_Aqueduct30_Data_Download_Monthly_V01"
OUTPUT_VERSION = 3
S3_INPUT_PATH = {}
S3_INPUT_PATH["hybas"] = "s3:... | 21.29434 | 122 | 0.626263 |
74524b71bf6a4352bb73890180c97f3447ed7681 | 8,615 | py | Python | stroeer/fragment/v1/stage_service_pb2.py | stroeer/python-tapir | 8e864568045ecaf4c0cd4e23591af0533ff91a32 | [
"Apache-2.0"
] | 2 | 2021-12-03T15:04:39.000Z | 2021-12-07T20:34:10.000Z | stroeer/fragment/v1/stage_service_pb2.py | stroeer/python-tapir | 8e864568045ecaf4c0cd4e23591af0533ff91a32 | [
"Apache-2.0"
] | null | null | null | stroeer/fragment/v1/stage_service_pb2.py | stroeer/python-tapir | 8e864568045ecaf4c0cd4e23591af0533ff91a32 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: stroeer/fragment/v1/stage_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refl... | 37.133621 | 861 | 0.787348 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.