hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9ec416fe1d740d9ebb75a95f78de820dd18a3f44 | 11,542 | py | Python | src_DynamicMetaEmbeddings/DynamicMetaEmbedding.py | YaoXinZhi/EMFAS | b158349426db8d0b6eef54d3243530d057227b84 | [
"Apache-2.0"
] | null | null | null | src_DynamicMetaEmbeddings/DynamicMetaEmbedding.py | YaoXinZhi/EMFAS | b158349426db8d0b6eef54d3243530d057227b84 | [
"Apache-2.0"
] | null | null | null | src_DynamicMetaEmbeddings/DynamicMetaEmbedding.py | YaoXinZhi/EMFAS | b158349426db8d0b6eef54d3243530d057227b84 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# ! usr/bin/env python3
"""
Created on 14/10/2021 17:32
@Author: XINZHI YAO
"""
"""
Dynamic Meta Embedding code of self version.
"""
import os
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def init_weight(weight, method):
if method == ... | 35.733746 | 127 | 0.601022 |
9159cd0f241b6189576c8c90848df120ff39cbfc | 644 | py | Python | backend/manage.py | crowdbotics-dev/testappauto854-dev-23396 | 54bdbf7b7f2da8fa000c3fbf8b07436ce0c709a2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-dev/testappauto854-dev-23396 | 54bdbf7b7f2da8fa000c3fbf8b07436ce0c709a2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-dev/testappauto854-dev-23396 | 54bdbf7b7f2da8fa000c3fbf8b07436ce0c709a2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testappauto854_dev_23396.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... | 29.272727 | 88 | 0.690994 |
a8ee980d00cba552ff0340462b76133c02544968 | 6,009 | py | Python | cassiopeia/type/api/rates.py | BubblegumDiscord/LoLTrivia | 70070dc2e8c59d7210d8b30ad2525bafaee4bba7 | [
"MIT"
] | null | null | null | cassiopeia/type/api/rates.py | BubblegumDiscord/LoLTrivia | 70070dc2e8c59d7210d8b30ad2525bafaee4bba7 | [
"MIT"
] | null | null | null | cassiopeia/type/api/rates.py | BubblegumDiscord/LoLTrivia | 70070dc2e8c59d7210d8b30ad2525bafaee4bba7 | [
"MIT"
] | 1 | 2018-05-06T15:49:33.000Z | 2018-05-06T15:49:33.000Z | import threading
class SingleRateLimiter(object):
"""
Handles a single rate limit, ensuring that calls don't exceed it
"""
def __init__(self, calls_per_epoch, seconds_per_epoch):
"""
Handles a single rate limit, ensuring that calls don't exceed it
"""
self.seconds_per_... | 29.747525 | 113 | 0.568647 |
284cc42ad58fa9d7f464b554d862caf47c34fb71 | 59,546 | py | Python | gewittergefahr/gg_utils/gridded_forecasts.py | dopplerchase/GewitterGefahr | 4415b08dd64f37eba5b1b9e8cc5aa9af24f96593 | [
"MIT"
] | 26 | 2018-10-04T01:07:35.000Z | 2022-01-29T08:49:32.000Z | gewittergefahr/gg_utils/gridded_forecasts.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 4 | 2017-12-25T02:01:08.000Z | 2018-12-19T01:54:21.000Z | gewittergefahr/gg_utils/gridded_forecasts.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 11 | 2017-12-10T23:05:29.000Z | 2022-01-29T08:49:33.000Z | """Methods to create gridded spatial forecasts from storm-cell-based ones."""
import copy
import numpy
import pandas
from gewittergefahr.gg_utils import storm_tracking_utils as tracking_utils
from gewittergefahr.gg_utils import projections
from gewittergefahr.gg_utils import polygons
from gewittergefahr.gg_utils impor... | 41.236842 | 80 | 0.718856 |
e67ba53f4a2cbc13381777c934d54a32a49e4111 | 11,144 | py | Python | src/common/utils.py | mzer0one/macro_pack | f4aa0d32151c5f403929e36ef949c630f256df84 | [
"Apache-2.0"
] | 1 | 2021-03-31T10:35:38.000Z | 2021-03-31T10:35:38.000Z | src/common/utils.py | mzer0one/macro_pack | f4aa0d32151c5f403929e36ef949c630f256df84 | [
"Apache-2.0"
] | null | null | null | src/common/utils.py | mzer0one/macro_pack | f4aa0d32151c5f403929e36ef949c630f256df84 | [
"Apache-2.0"
] | 1 | 2021-03-31T10:35:47.000Z | 2021-03-31T10:35:47.000Z | #!/usr/bin/env python
# encoding: utf-8
from random import choice
import string
import logging
from termcolor import colored
import os, sys
import socket
from collections import OrderedDict
import importlib.util
import psutil
from datetime import datetime
class ColorLogFiler(logging.StreamHandler):
""" Override... | 33.166667 | 180 | 0.573851 |
db645b294d3c6c294934db432c74cf0108abeb26 | 10,480 | py | Python | hangul.py | iandmyhand/korean-utils | 7837adc9111b116cab4bc220a852541fb3056948 | [
"MIT"
] | null | null | null | hangul.py | iandmyhand/korean-utils | 7837adc9111b116cab4bc220a852541fb3056948 | [
"MIT"
] | 5 | 2016-03-03T22:14:56.000Z | 2016-03-22T00:56:16.000Z | hangul.py | iandmyhand/korean-utils | 7837adc9111b116cab4bc220a852541fb3056948 | [
"MIT"
] | 1 | 2021-10-04T22:57:02.000Z | 2021-10-04T22:57:02.000Z | #
# This file is part of KoreanCodecs.
#
# Copyright(C) 2002-2003 Hye-Shik Chang <perky@FreeBSD.org>.
#
# KoreanCodecs 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 2 of the License, or... | 31.661631 | 91 | 0.495897 |
18b63598b87c8079a5c8dd82d425c46391ef87f5 | 38,404 | py | Python | electrumsv/commands.py | bakketun/electrumsv | 1ed5b3d5b3f7e25d742d8634258322eee616d31a | [
"MIT"
] | null | null | null | electrumsv/commands.py | bakketun/electrumsv | 1ed5b3d5b3f7e25d742d8634258322eee616d31a | [
"MIT"
] | null | null | null | electrumsv/commands.py | bakketun/electrumsv | 1ed5b3d5b3f7e25d742d8634258322eee616d31a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... | 40.467861 | 98 | 0.609936 |
445067c2b9a9cbef2ed97b72b5014ac29a50244f | 1,228 | py | Python | projects/north-carolina/json_extract.py | Cal-B/docker | 7cd066d4c0bd03f03bed6701633beeecb9486834 | [
"MIT"
] | 1 | 2021-04-13T19:13:41.000Z | 2021-04-13T19:13:41.000Z | projects/north-carolina/json_extract.py | sorelle/docker | 7cd066d4c0bd03f03bed6701633beeecb9486834 | [
"MIT"
] | null | null | null | projects/north-carolina/json_extract.py | sorelle/docker | 7cd066d4c0bd03f03bed6701633beeecb9486834 | [
"MIT"
] | null | null | null | def json_extract(obj, key):
"""Recursively fetch values from nested JSON."""
arr = []
def extract(obj, arr, key):
"""Recursively search for values of key in JSON tree."""
if isinstance(obj, dict):
for k, v in obj.items():
if isinstance(v, (dict, list)):
... | 26.695652 | 68 | 0.484528 |
0eb1ac0ce8f20ca10876d088183e890c31b0ce13 | 1,316 | py | Python | src/django/api/migrations/0037_remove_facility_list_fields_20191002_2323.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | 32 | 2019-01-26T05:04:03.000Z | 2022-03-11T15:09:09.000Z | src/django/api/migrations/0037_remove_facility_list_fields_20191002_2323.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | 1,586 | 2019-01-15T21:54:42.000Z | 2022-03-31T17:38:14.000Z | src/django/api/migrations/0037_remove_facility_list_fields_20191002_2323.py | Home-ac/Base0 | 04f03b8bf31146783c583df0871ab69fd6309a27 | [
"MIT"
] | 7 | 2019-02-28T03:32:46.000Z | 2021-11-04T17:03:46.000Z | # Generated by Django 2.2.3 on 2019-10-02 23:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0036_add_source_20190926_2048'),
]
operations = [
migrations.RemoveIndex(
model_name='fa... | 29.909091 | 156 | 0.594225 |
3267278b351939d561ac6ea0a9e3e13907cea880 | 1,015 | py | Python | TTC_utils/steptaker.py | tmilne5/TTC_toy_examples | ec9f8bea56c2a94ee475fbe4176253c38ab9bea8 | [
"MIT"
] | null | null | null | TTC_utils/steptaker.py | tmilne5/TTC_toy_examples | ec9f8bea56c2a94ee475fbe4176253c38ab9bea8 | [
"MIT"
] | null | null | null | TTC_utils/steptaker.py | tmilne5/TTC_toy_examples | ec9f8bea56c2a94ee475fbe4176253c38ab9bea8 | [
"MIT"
] | null | null | null | import torch
from torch import autograd
def steptaker(data, critic, step, num_step=1):
"""Applies gradient descent (GD) to data using critic
Inputs
- data; data to apply GD to
- critic; critic to compute gradients of
- step; how large of a step to take
- num_step; how finely to discretize flow... | 29.852941 | 120 | 0.632512 |
b4b44f6240d8d21505d923ed0ceda68f193069c4 | 609 | py | Python | backend/plugins/card/migrations/0004_alter_verbose_name.py | marksweb/django-cms-60min-demo-2021 | d9ca83538d6c5c7a0b0e1a18ae1a15bda4c296e4 | [
"MIT"
] | null | null | null | backend/plugins/card/migrations/0004_alter_verbose_name.py | marksweb/django-cms-60min-demo-2021 | d9ca83538d6c5c7a0b0e1a18ae1a15bda4c296e4 | [
"MIT"
] | 1 | 2022-01-15T11:29:16.000Z | 2022-01-15T22:11:45.000Z | backend/plugins/card/migrations/0004_alter_verbose_name.py | marksweb/django-cms-60min-demo-2021 | d9ca83538d6c5c7a0b0e1a18ae1a15bda4c296e4 | [
"MIT"
] | 3 | 2022-01-14T15:55:00.000Z | 2022-01-23T23:46:56.000Z | # Generated by Django 2.2.13 on 2020-06-06 19:28
import cms.models.fields
from django.db import migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('card', '0003_add_link'),
]
operations = [
migrations.AlterField(
model_name='... | 29 | 219 | 0.671593 |
09b1199708706d70142cbfa1c775bd526d561735 | 19,902 | py | Python | build/get_syzygy_binaries.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | build/get_syzygy_binaries.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | build/get_syzygy_binaries.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A utility script for downloading versioned Syzygy binaries."""
import hashlib
import errno
import json
import logging
import optpar... | 37.550943 | 80 | 0.700382 |
f8464b48adc549e011e117fe9fbc2f9e8af9e72c | 4,794 | py | Python | nova/conf/pci.py | panguan737/nova | 0d177185a439baa228b42c948cab4e934d6ac7b8 | [
"Apache-2.0"
] | 1 | 2018-05-27T09:38:17.000Z | 2018-05-27T09:38:17.000Z | nova/conf/pci.py | panguan737/nova | 0d177185a439baa228b42c948cab4e934d6ac7b8 | [
"Apache-2.0"
] | null | null | null | nova/conf/pci.py | panguan737/nova | 0d177185a439baa228b42c948cab4e934d6ac7b8 | [
"Apache-2.0"
] | 1 | 2020-11-02T10:17:13.000Z | 2020-11-02T10:17:13.000Z | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 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/li... | 33.760563 | 79 | 0.6068 |
64ed2259c0e5c07b659a5470e14e5eeed14590ea | 65,999 | py | Python | Lib/fontTools/feaLib/ast.py | serginhoabe/fonttools | f6a62e0db127c01f4d23f3398d70df21bbc6dccc | [
"Apache-2.0",
"MIT"
] | null | null | null | Lib/fontTools/feaLib/ast.py | serginhoabe/fonttools | f6a62e0db127c01f4d23f3398d70df21bbc6dccc | [
"Apache-2.0",
"MIT"
] | null | null | null | Lib/fontTools/feaLib/ast.py | serginhoabe/fonttools | f6a62e0db127c01f4d23f3398d70df21bbc6dccc | [
"Apache-2.0",
"MIT"
] | null | null | null | from fontTools.misc.py23 import *
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.location import FeatureLibLocation
from fontTools.misc.encodingTools import getEncoding
from collections import OrderedDict
import itertools
SHIFT = " " * 4
__all__ = [
"Element",
"FeatureFile",
"Com... | 35.012732 | 138 | 0.591812 |
832e83b8a1af3b1a408f22bf28b9da569fb110e7 | 58,011 | py | Python | clifford/test/test_g3c_tools.py | tBuLi/clifford | 31651d095834ad4c2c5da0692414b55c88823840 | [
"BSD-3-Clause"
] | 21 | 2015-03-21T14:20:29.000Z | 2020-04-20T02:12:03.000Z | clifford/test/test_g3c_tools.py | tBuLi/clifford | 31651d095834ad4c2c5da0692414b55c88823840 | [
"BSD-3-Clause"
] | 13 | 2016-09-01T11:58:24.000Z | 2017-11-19T17:01:51.000Z | clifford/test/test_g3c_tools.py | tBuLi/clifford | 31651d095834ad4c2c5da0692414b55c88823840 | [
"BSD-3-Clause"
] | 7 | 2016-08-31T16:19:42.000Z | 2017-11-16T17:27:45.000Z | import random
from functools import reduce
import time
import functools
import numpy as np
import numpy.testing as npt
from numpy import exp
import pytest
import numba
from clifford import Cl
from clifford.g3c import *
from clifford import general_exp
from clifford.tools.g3c import *
from clifford.tools.g3c.rotor_pa... | 42.28207 | 132 | 0.579304 |
3b5211938a8ab59014510201cb10ccfdea1f7d80 | 8,415 | py | Python | pyocd/probe/stlink_probe.py | vllogic/pyOCD | f1da976941dbce63c7ebed358617ebe3f49e70f8 | [
"Apache-2.0"
] | 1 | 2022-01-22T02:42:25.000Z | 2022-01-22T02:42:25.000Z | pyocd/probe/stlink_probe.py | ARMmbed/pyOCD-Samsung | 03242b6eb57d2170a4b531d00f1a0577e2b0abde | [
"Apache-2.0"
] | null | null | null | pyocd/probe/stlink_probe.py | ARMmbed/pyOCD-Samsung | 03242b6eb57d2170a4b531d00f1a0577e2b0abde | [
"Apache-2.0"
] | 1 | 2022-01-22T02:42:27.000Z | 2022-01-22T02:42:27.000Z | # pyOCD debugger
# Copyright (c) 2018-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 33.26087 | 103 | 0.627094 |
7bd7d3053296a299595afbf40620dc4b54786b3f | 4,266 | py | Python | test/check-error-codes.py | cPlayIt/motoko | dca676ebe6df0f33657ecf33045f0269164c217c | [
"Apache-2.0"
] | 1 | 2021-06-14T11:05:34.000Z | 2021-06-14T11:05:34.000Z | test/check-error-codes.py | cPlayIt/motoko | dca676ebe6df0f33657ecf33045f0269164c217c | [
"Apache-2.0"
] | null | null | null | test/check-error-codes.py | cPlayIt/motoko | dca676ebe6df0f33657ecf33045f0269164c217c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Checks uniqueness of error codes, and prints out the next available
# Checks that every registered code is exercised in a test
# Checks that every code exercised in a test is registered
import re
import glob
import sys
if len(sys.argv) != 2:
print("""USAGE: python check-error-codes.py pat... | 43.979381 | 131 | 0.689639 |
0b61ddcbe790bb52b520c12cab7cda2d11fb96af | 15,317 | py | Python | sdk/python/pulumi_azure_native/network/v20191101/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20191101/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20191101/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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! ***
# Export this package's modules as members:
from ._enums import *
from .application_gateway import *
from .application_security_group import *
from .az... | 54.703571 | 105 | 0.731801 |
83f34fbae43fc79435fa93f2ad9c21e36e56f451 | 24,646 | py | Python | test/functional/rpc_rawtransaction.py | DreamDev-Chain/babylite | 4a0ffd4c9fa1d80fb03a40370cd81f8d99e5a28f | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | DreamDev-Chain/babylite | 4a0ffd4c9fa1d80fb03a40370cd81f8d99e5a28f | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | DreamDev-Chain/babylite | 4a0ffd4c9fa1d80fb03a40370cd81f8d99e5a28f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
- signrawtransacti... | 56.14123 | 263 | 0.652479 |
d503ec2dacd9b68ad9463e1cabba3453b8bdd5df | 3,011 | py | Python | pychron/lasers/tasks/plugins/co2.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | pychron/lasers/tasks/plugins/co2.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/lasers/tasks/plugins/co2.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | 47.046875 | 109 | 0.519429 |
61e0275ca225f5b968bbeb3ea2bd54f2a6cf2201 | 11,040 | py | Python | layers/packet.py | tgragnato/geneva | 2fc5b2f2f4766278902cff25af50b753d1d26a76 | [
"BSD-3-Clause"
] | 1,182 | 2019-11-15T02:56:47.000Z | 2022-03-30T16:09:04.000Z | layers/packet.py | Nekotekina/geneva | 3eb6b7342f9afd7add1f4aba9e2aadf0b9a5f196 | [
"BSD-3-Clause"
] | 21 | 2019-11-15T15:08:02.000Z | 2022-01-03T16:22:45.000Z | layers/packet.py | Nekotekina/geneva | 3eb6b7342f9afd7add1f4aba9e2aadf0b9a5f196 | [
"BSD-3-Clause"
] | 102 | 2019-11-15T15:01:07.000Z | 2022-03-30T13:52:47.000Z | import copy
import random
import layers.layer
import layers.ip_layer
import layers.tcp_layer
import layers.udp_layer
import layers.dns_layer
import layers.dnsqr_layer
_SUPPORTED_LAYERS = [
layers.ip_layer.IPLayer,
layers.tcp_layer.TCPLayer,
layers.udp_layer.UDPLayer,
layers.dns_layer.DNSLayer,
lay... | 32.857143 | 125 | 0.575543 |
93dea0a2c39fa68e0d1d5e087fcf554c4f34afc8 | 3,397 | py | Python | meraki/models/update_network_model.py | dexterlabora/meraki-python-sdk | f6e6d61bd8694548169cd872b0642def69115bcb | [
"MIT"
] | null | null | null | meraki/models/update_network_model.py | dexterlabora/meraki-python-sdk | f6e6d61bd8694548169cd872b0642def69115bcb | [
"MIT"
] | null | null | null | meraki/models/update_network_model.py | dexterlabora/meraki-python-sdk | f6e6d61bd8694548169cd872b0642def69115bcb | [
"MIT"
] | 1 | 2021-01-27T00:05:25.000Z | 2021-01-27T00:05:25.000Z | # -*- coding: utf-8 -*-
"""
meraki
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
class UpdateNetworkModel(object):
"""Implementation of the 'updateNetwork' model.
TODO: type model description here.
Attributes:
name (stri... | 35.385417 | 95 | 0.589932 |
203504f6de587d4bb37125c6ff87eebf3dc0661f | 13,109 | py | Python | Contents/Libraries/Shared/websocket/_abnf.py | jippo015/Sub-Zero.bundle | 734e0f7128c05c0f639e11e7dfc77daa1014064b | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/websocket/_abnf.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/websocket/_abnf.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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 2.1 of the License, ... | 30.700234 | 136 | 0.608208 |
318aaf20b1bc82c286c87c7b56ce5addf0cec0b4 | 1,710 | py | Python | app.py | SriramyaK/Baby-Vibes-Pytorch-fastai-Raspberry-pi-4 | 90abaadb6166347eedebacb6c73743b34b4eb8ac | [
"MIT"
] | 6 | 2020-04-02T12:55:46.000Z | 2021-09-03T02:36:25.000Z | app.py | SriramyaK/Baby-Vibes-Pytorch-fastai-Raspberry-pi-4 | 90abaadb6166347eedebacb6c73743b34b4eb8ac | [
"MIT"
] | 4 | 2021-03-19T11:53:49.000Z | 2022-01-13T02:27:42.000Z | app.py | SriramyaK/Baby-Vibes-Pytorch-fastai-Raspberry-pi-4 | 90abaadb6166347eedebacb6c73743b34b4eb8ac | [
"MIT"
] | 2 | 2021-05-22T04:08:18.000Z | 2021-09-03T02:36:29.000Z | import os
import urllib
from io import BytesIO
from fastai import *
from fastai.vision import *
from fastai.vision.data import *
from flask import Flask,request,redirect,url_for,render_template,flash
from werkzeug.utils import secure_filename
import json, requests
import os, base64
import urllib
import sys
if not sys... | 26.307692 | 89 | 0.660819 |
d8ac6d330431b7f567043be178bc6b506d1c3439 | 6,958 | py | Python | app/routes.py | kuco23/PokerThing | a401bb9e59b02e2dd211d1776d68cc3e8966a7ed | [
"MIT"
] | null | null | null | app/routes.py | kuco23/PokerThing | a401bb9e59b02e2dd211d1776d68cc3e8966a7ed | [
"MIT"
] | 1 | 2020-04-17T21:27:12.000Z | 2020-04-29T16:14:47.000Z | app/routes.py | kuco23/PokerThing | a401bb9e59b02e2dd211d1776d68cc3e8966a7ed | [
"MIT"
] | null | null | null | import json
from hashlib import sha256
from jinja2 import DictLoader
from sanic import response
from sanic.websocket import ConnectionClosed
from sanic.exceptions import NotFound
from jinja2_sanic import template, render_template, setup
from .lib import *
from .lib.database import DbTable, table_enum
from app import ... | 33.941463 | 90 | 0.612389 |
49be10c924dafcbaa626b9b3a808327837cd6eae | 1,688 | py | Python | setup.py | mvdbeek/seaplotlib | af465b58fc321ddc29649f08860f81a874d95605 | [
"MIT"
] | null | null | null | setup.py | mvdbeek/seaplotlib | af465b58fc321ddc29649f08860f81a874d95605 | [
"MIT"
] | 1 | 2021-11-15T17:47:48.000Z | 2021-11-15T17:47:48.000Z | setup.py | mvdbeek/seaplotlib | af465b58fc321ddc29649f08860f81a874d95605 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['Click>=6.0', 'seaborn', 'umap-learn'... | 30.142857 | 95 | 0.638626 |
40f821e57bbc1a66fce1b7a7e83515aa94f9bf4e | 1,682 | py | Python | src/download_and_extract.py | alasdairtran/facenet | ab0b64d1dd5c978cc57ac0d85579a97018de02d1 | [
"MIT"
] | null | null | null | src/download_and_extract.py | alasdairtran/facenet | ab0b64d1dd5c978cc57ac0d85579a97018de02d1 | [
"MIT"
] | null | null | null | src/download_and_extract.py | alasdairtran/facenet | ab0b64d1dd5c978cc57ac0d85579a97018de02d1 | [
"MIT"
] | null | null | null | import os
import zipfile
import requests
model_dict = {
'lfw-subset': '1B5BQUZuJO-paxdN8UclxeHAR1WnR_Tzi',
'20170131-234652': '0B5MzpY9kBtDVSGM0RmVET2EwVEk',
'20170216-091149': '0B5MzpY9kBtDVTGZjcWkzT3pldDA',
'20170512-110547': '0B5MzpY9kBtDVZ2RpVDYwWmxoSUk',
'20180402-114759': '1EXPBSXwTaqrS... | 29.508772 | 68 | 0.691439 |
64c31fdad344a9963a1af8a8c6507eb5e0b90ca3 | 12,510 | py | Python | sdk/python/pulumi_azure_native/devtestlab/latest/virtual_machine_schedule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devtestlab/latest/virtual_machine_schedule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devtestlab/latest/virtual_machine_schedule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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
from ... import _utilities, _tables
from... | 45.992647 | 594 | 0.658913 |
355b2f78245bbb3c3fdf65730818a4fbe98d8c7f | 74 | py | Python | 7 kyu/Vowel Count/Vowel Count.py | anthonyjatoba/codewars | 76b0d66dd1ba76a4d136b658920cdf85fd5c4b06 | [
"MIT"
] | null | null | null | 7 kyu/Vowel Count/Vowel Count.py | anthonyjatoba/codewars | 76b0d66dd1ba76a4d136b658920cdf85fd5c4b06 | [
"MIT"
] | null | null | null | 7 kyu/Vowel Count/Vowel Count.py | anthonyjatoba/codewars | 76b0d66dd1ba76a4d136b658920cdf85fd5c4b06 | [
"MIT"
] | null | null | null | def getCount(inputStr):
return sum(inputStr.count(v) for v in 'aeiou') | 37 | 50 | 0.716216 |
d7bcfe3a273d6a51c5d5387238420f9b577e4c95 | 3,614 | py | Python | Contests/2020-02-25 - Google HashCode 2021/src/main_2021_raphael.py | NicolasBizzozzero/Competitive-Programming | 53ece89623b4aca542d096b2aff18be35b19da6d | [
"Unlicense"
] | 2 | 2019-04-11T17:19:59.000Z | 2019-04-23T12:07:38.000Z | Contests/2020-02-25 - Google HashCode 2021/src/main_2021_raphael.py | NicolasBi/Competitive-Programming | 53ece89623b4aca542d096b2aff18be35b19da6d | [
"Unlicense"
] | null | null | null | Contests/2020-02-25 - Google HashCode 2021/src/main_2021_raphael.py | NicolasBi/Competitive-Programming | 53ece89623b4aca542d096b2aff18be35b19da6d | [
"Unlicense"
] | null | null | null | import collections
import os
from functools import reduce
from math import gcd
import numpy as np
import pandas as pd
import tqdm
from core import Number, Problem, main
def find_gcd(list):
x = reduce(gcd, list)
return x
Input = collections.namedtuple("Input", ["D", "I", "S", "V", "F", "streets", "paths"])... | 30.369748 | 86 | 0.555064 |
667adcb363664d2370eb57a0b3c8c6707b0d20e6 | 5,465 | py | Python | client-py/iotdb/utils/Tablet.py | jixuan1989/iotdb | 624b975b484ce37baec561296749039fddebe0b5 | [
"Apache-2.0"
] | null | null | null | client-py/iotdb/utils/Tablet.py | jixuan1989/iotdb | 624b975b484ce37baec561296749039fddebe0b5 | [
"Apache-2.0"
] | null | null | null | client-py/iotdb/utils/Tablet.py | jixuan1989/iotdb | 624b975b484ce37baec561296749039fddebe0b5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.401515 | 90 | 0.619579 |
aa183976b5594d0c171e56b3b417bc5eeddb85a8 | 18,727 | py | Python | picoCTF-web/tests/integration/test_user.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 280 | 2016-03-23T05:16:07.000Z | 2022-03-25T10:45:33.000Z | picoCTF-web/tests/integration/test_user.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 384 | 2016-03-22T05:14:47.000Z | 2021-09-13T23:46:14.000Z | picoCTF-web/tests/integration/test_user.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 142 | 2016-03-15T16:27:21.000Z | 2022-02-23T23:41:28.000Z | """Tests for the /api/v1/user endpoints."""
from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPH... | 34.049091 | 110 | 0.621295 |
ebb69dc63acece15ccc69e2619d148d461023004 | 1,461 | py | Python | AppleTrailersWrapper/Related.py | Puyodead1/AppleTrailersWrapper | 8ccbe0938b0e37da878fcaa0d5e79b46736049c2 | [
"MIT"
] | null | null | null | AppleTrailersWrapper/Related.py | Puyodead1/AppleTrailersWrapper | 8ccbe0938b0e37da878fcaa0d5e79b46736049c2 | [
"MIT"
] | null | null | null | AppleTrailersWrapper/Related.py | Puyodead1/AppleTrailersWrapper | 8ccbe0938b0e37da878fcaa0d5e79b46736049c2 | [
"MIT"
] | null | null | null | class Related:
def __init__(self, related_item_dict: dict):
self.related_item_dict = related_item_dict
def get_item(self):
"""
Returns the original related_item_dict
:return: dict
"""
return self.related_item_dict
def get_thumbnail(self):
"""
... | 22.136364 | 130 | 0.551677 |
d8e499e4ecf58421482d250dbd529c4f408706e1 | 10,565 | py | Python | src/sentry/options/store.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 1 | 2022-02-09T22:56:49.000Z | 2022-02-09T22:56:49.000Z | src/sentry/options/store.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 6 | 2018-10-19T10:04:23.000Z | 2019-12-09T20:29:12.000Z | src/sentry/options/store.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 1 | 2020-07-03T00:52:19.000Z | 2020-07-03T00:52:19.000Z | """
sentry.options.store
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
from collections import namedtuple
from time import time
from ran... | 34.080645 | 91 | 0.600473 |
530d43489ffa389666818058da2f732a882e274b | 8,211 | py | Python | dodotable/condition.py | lberezinski/dodotable | a1280dadfda52301b0500d812a1d7a6f7f79c418 | [
"MIT"
] | null | null | null | dodotable/condition.py | lberezinski/dodotable | a1280dadfda52301b0500d812a1d7a6f7f79c418 | [
"MIT"
] | null | null | null | dodotable/condition.py | lberezinski/dodotable | a1280dadfda52301b0500d812a1d7a6f7f79c418 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""":mod:`dodotable.condition` --- Hello filter!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from six import string_types
from sqlalchemy.sql.expression import asc, desc, false, null, or_
from .exc import BadChoice
from .schema import Queryable, Renderable, Schema
from .util import came... | 29.220641 | 112 | 0.60492 |
42cc67d9e51b863e263536d73355adac1072c566 | 575 | py | Python | Swati Singh/week 2_Q.18.py | singhs1234/Python-BootCamp | 6f5ff8f4a4e5b8de32eb6506830f13d6939def1c | [
"MIT"
] | 4 | 2022-03-20T10:59:53.000Z | 2022-03-25T18:28:04.000Z | Swati Singh/week 2_Q.18.py | singhs1234/Python-BootCamp | 6f5ff8f4a4e5b8de32eb6506830f13d6939def1c | [
"MIT"
] | null | null | null | Swati Singh/week 2_Q.18.py | singhs1234/Python-BootCamp | 6f5ff8f4a4e5b8de32eb6506830f13d6939def1c | [
"MIT"
] | 15 | 2022-03-12T11:49:10.000Z | 2022-03-15T06:22:55.000Z | # 18. Accept the age of 4 people and display the youngest one?
a1=int(input("Enter the age of 1st person: "))
a2=int(input("Enter the age of 2nd person: "))
a3=int(input("Enter the age of 3rd person: "))
a4=int(input("Enter the age of 4th person: "))
if a1<a2 and a1<a3 and a1<a4:
print(f"1st person is the youngest ... | 41.071429 | 62 | 0.68 |
54c35a7c8183cb0bdccf6b08755a9470f72a235e | 7,909 | py | Python | Track1.2/tools/test_cls.py | VisualAnalysisOfHumans/LOVEU_TRACK1_TOP3_SUBMISSION | 6f4d1c7e6883d6b0664fcd04265f437247afab54 | [
"MIT"
] | 1 | 2021-06-25T06:43:29.000Z | 2021-06-25T06:43:29.000Z | Track1.2/tools/test_cls.py | VisualAnalysisOfHumans/LOVEU_TRACK1_TOP3_SUBMISSION | 6f4d1c7e6883d6b0664fcd04265f437247afab54 | [
"MIT"
] | 1 | 2022-01-11T02:35:57.000Z | 2022-01-11T02:35:57.000Z | Track1.2/tools/test_cls.py | VisualAnalysisOfHumans/LOVEU_TRACK1_TOP3_SUBMISSION | 6f4d1c7e6883d6b0664fcd04265f437247afab54 | [
"MIT"
] | 1 | 2022-01-12T01:55:52.000Z | 2022-01-12T01:55:52.000Z | import argparse
import os
import os.path as osp
import warnings
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.fileio.io import file_handlers
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, init_dist, l... | 36.615741 | 106 | 0.640915 |
4f2af2441e3bf8fc4e4dcb5234d539ab131edd85 | 491 | py | Python | posts/urls.py | ztaylor2/django-blog | 04e131a8e0b1ad39f4416a9e09974f8a4b724e4f | [
"MIT"
] | null | null | null | posts/urls.py | ztaylor2/django-blog | 04e131a8e0b1ad39f4416a9e09974f8a4b724e4f | [
"MIT"
] | 1 | 2020-06-05T17:40:06.000Z | 2020-06-05T17:40:06.000Z | posts/urls.py | ztaylor2/django-blog | 04e131a8e0b1ad39f4416a9e09974f8a4b724e4f | [
"MIT"
] | null | null | null | """URLS for admin login."""
from django.conf.urls import url
from posts.views import CreateView, DetailView, UpdateView, PostDelete
urlpatterns = [
url(r'^create/$',
CreateView.as_view(),
name='create'),
url(r'^detail/(?P<pk>\d+)/$',
DetailView.as_view(),
name='detail'),
url... | 25.842105 | 70 | 0.560081 |
8baf9b5ea82fa53ac2217067ffecdf5e0d009a06 | 1,604 | py | Python | ai_flow_plugins/job_plugins/bash/bash_job_config.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 1 | 2021-11-17T02:31:48.000Z | 2021-11-17T02:31:48.000Z | ai_flow_plugins/job_plugins/bash/bash_job_config.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | null | null | null | ai_flow_plugins/job_plugins/bash/bash_job_config.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.302326 | 96 | 0.693267 |
2c332c356f46d070f6ff54d6f34b06ced66af4f2 | 3,717 | py | Python | src/mot_neural_solver/data/splits.py | Newdxz/mot_mpnn | 06eabd17d47f9255e06e8c75f090c6de84fed2fb | [
"MIT"
] | 303 | 2020-04-14T02:39:20.000Z | 2022-03-11T15:08:33.000Z | src/mot_neural_solver/data/splits.py | Newdxz/mot_mpnn | 06eabd17d47f9255e06e8c75f090c6de84fed2fb | [
"MIT"
] | 39 | 2020-04-16T02:22:36.000Z | 2022-02-02T13:13:43.000Z | src/mot_neural_solver/data/splits.py | Newdxz/mot_mpnn | 06eabd17d47f9255e06e8c75f090c6de84fed2fb | [
"MIT"
] | 78 | 2020-04-28T01:10:24.000Z | 2022-03-29T20:33:05.000Z | _SPLITS = {}
#################
# MOT15
#################
# sequences used for training
mot15_train_seqs = ['KITTI-17', 'ETH-Sunnyday', 'ETH-Bahnhof', 'PETS09-S2L1', 'TUD-Stadtmitte']
# Additional train sequences not used for tranining (since they are present in MOT17 etc.)
add_mot15_train_seqs = ['ETH-Pedcross2', 'T... | 44.783133 | 126 | 0.654022 |
d3035b8310feee61a0a4d72cd851b9418c46a738 | 2,797 | py | Python | classifier2/make_files_for_nikita.py | Creearc/Codenrock-New-Year-ML-Battle | 38dc89e45482cf6668cc0abe46f07b9d69db32a2 | [
"MIT"
] | 1 | 2022-01-07T16:57:34.000Z | 2022-01-07T16:57:34.000Z | classifier2/make_files_for_nikita.py | Creearc/Codenrock-New-Year-ML-Battle | 38dc89e45482cf6668cc0abe46f07b9d69db32a2 | [
"MIT"
] | null | null | null | classifier2/make_files_for_nikita.py | Creearc/Codenrock-New-Year-ML-Battle | 38dc89e45482cf6668cc0abe46f07b9d69db32a2 | [
"MIT"
] | null | null | null | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
import tensorflow as tf
assert float(tf.__version__[:3]) >= 2.3
import tensorflow.lite as tflite
gpus = tf.config.experimental.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(gpus[0], True)
import... | 29.442105 | 94 | 0.693958 |
1af94d8930e1c232c08593923017d70ef958f893 | 175 | py | Python | player.py | Wowol/Connect4-AI | c4516e1d2b80c46d20fda2761132b8692efa4812 | [
"MIT"
] | 2 | 2021-03-31T16:46:58.000Z | 2021-12-13T17:31:20.000Z | player.py | Wowol/Connect4-AI | c4516e1d2b80c46d20fda2761132b8692efa4812 | [
"MIT"
] | null | null | null | player.py | Wowol/Connect4-AI | c4516e1d2b80c46d20fda2761132b8692efa4812 | [
"MIT"
] | 1 | 2022-01-01T12:28:44.000Z | 2022-01-01T12:28:44.000Z | from game import Game
def make_move(game, player):
while(True):
column = int(input())
t = game.make_move(player, column)
if t:
return | 19.444444 | 42 | 0.56 |
3df0d4031beaf5099f9287ce6da525e50492ae35 | 3,288 | py | Python | zou_2021/strain_energy_dft.py | andrewtarzia/citable_data | 6a9b94c7f1bddbd1f5f2f6e042fead632d17cc74 | [
"MIT"
] | null | null | null | zou_2021/strain_energy_dft.py | andrewtarzia/citable_data | 6a9b94c7f1bddbd1f5f2f6e042fead632d17cc74 | [
"MIT"
] | null | null | null | zou_2021/strain_energy_dft.py | andrewtarzia/citable_data | 6a9b94c7f1bddbd1f5f2f6e042fead632d17cc74 | [
"MIT"
] | null | null | null | from os.path import exists
import json
import sys
import pandas as pd
import stk
from atools import get_organic_linkers, calculate_energy
def calculate_ligand_SE(
org_ligs,
sdict,
extracted_energies,
free_energies,
output_json,
):
strain_energies = {}
binol_f = sdict['binol']
long_f... | 25.099237 | 65 | 0.540146 |
47c66e1a2280607969660857c2b96ff00acca480 | 832 | py | Python | users/keshmalp/logistic regression.py | IEEE-VIT/techloop-ml-plus | 44e941f1690abd2110c994db8009941bfec10727 | [
"MIT"
] | 34 | 2018-02-01T18:28:06.000Z | 2018-03-06T11:11:14.000Z | users/keshmalp/logistic regression.py | IEEE-VIT/techloop-ml-plus | 44e941f1690abd2110c994db8009941bfec10727 | [
"MIT"
] | 3 | 2018-02-01T17:59:43.000Z | 2020-05-14T07:34:44.000Z | users/keshmalp/logistic regression.py | IEEE-VIT/techloop-ml-plus | 44e941f1690abd2110c994db8009941bfec10727 | [
"MIT"
] | 14 | 2018-02-03T06:35:23.000Z | 2018-02-18T09:28:14.000Z | import numpy as np
#Credit score range 300-850 on the basis of which you will get a loan
g = np.array([500,720,690,300,370,632,820,425,740,430,421,323,620,519,620,530,422,616])
#random initialization whether loan will be sanctioned
h = np.array([0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,0,0,1])
def sigmoid(g):
return... | 32 | 88 | 0.594952 |
fbd468e6fd497747851862da4cf8dcc1d4b1e182 | 21,888 | py | Python | csr_mhqa/data_processing.py | jobine/HGN | 6d8dd5ebf2a5077652b09a00610ade89bfcd6b4b | [
"MIT"
] | null | null | null | csr_mhqa/data_processing.py | jobine/HGN | 6d8dd5ebf2a5077652b09a00610ade89bfcd6b4b | [
"MIT"
] | null | null | null | csr_mhqa/data_processing.py | jobine/HGN | 6d8dd5ebf2a5077652b09a00610ade89bfcd6b4b | [
"MIT"
] | 2 | 2021-04-19T06:18:30.000Z | 2021-05-31T07:26:29.000Z | import gzip
import pickle
import json
import torch
import numpy as np
import os
from os.path import join
from tqdm import tqdm
from numpy.random import shuffle
from envs import DATASET_FOLDER
IGNORE_INDEX = -100
def get_cached_filename(f_type, config):
assert f_type in ['examples', 'features', '... | 42.666667 | 146 | 0.583607 |
a45e7b1f8509d31002e38ccd5554b0896a35aae7 | 3,869 | py | Python | research/attention_ocr/python/demo_inference_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/attention_ocr/python/demo_inference_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/attention_ocr/python/demo_inference_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import demo_inference
import tensorflow as tf
from tensorflow.python.training import monitored_session
_CHECKPOINT = 'model.ckpt-399731'
_CHECKPOINT_URL = 'http://download.tensorflow.org/models/attention_ocr_2017_08_09.tar.gz'
class DemoInferenceTest(tf.test.TestCa... | 43.965909 | 103 | 0.515637 |
94496e4389daee93efb1d92461ed1fe605ee2aba | 3,253 | py | Python | grr/client/linux/process.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/client/linux/process.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/client/linux/process.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""A class to read process memory on Linux.
This code is based on the memorpy project:
https://github.com/n1nj4sec/memorpy
"""
import ctypes
import errno
import os
import re
from grr.client import process_error
libc = ctypes.CDLL("libc.so.6", use_errno=True)
def Errcheck(ret, func, args):
... | 26.447154 | 78 | 0.640639 |
97cea0987363ebd1bc03d3fc964c224533c4f856 | 6,464 | py | Python | XP_import.py | curVV/XPlaneImport | 236e383e29d46afb4dd199cc886db4a1a46b822c | [
"MIT"
] | 16 | 2017-10-24T06:24:10.000Z | 2022-03-06T23:07:44.000Z | XP_import.py | xxxAHMEDxxx/XPlaneImport | 236e383e29d46afb4dd199cc886db4a1a46b822c | [
"MIT"
] | 12 | 2017-07-11T04:19:55.000Z | 2022-01-19T04:52:06.000Z | XP_import.py | xxxAHMEDxxx/XPlaneImport | 236e383e29d46afb4dd199cc886db4a1a46b822c | [
"MIT"
] | 13 | 2018-05-05T09:26:38.000Z | 2021-12-31T23:59:56.000Z | #---------------------------------------------------------------------------
#
# Import an X-Plane .obj file into Blender 2.78
#
# Dave Prue <dave.prue@lahar.net>
#
# MIT License
#
# Copyright (c) 2017 David C. Prue
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and... | 34.021053 | 125 | 0.541925 |
1c8b2f4b703d081cf305d24c912339a36c10d0f7 | 17,539 | py | Python | lfs/cart/views.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | lfs/cart/views.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | lfs/cart/views.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | # python imports
import locale
# django imports
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import Http404
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts imp... | 37.799569 | 197 | 0.664348 |
f594a540f95cfc804d8cec24c6189254707b987d | 255 | py | Python | commands/explorers.py | MaferMazu/simulador-blockchain | 533d6486558fcd7b5d3d417692539837dac90684 | [
"MIT"
] | null | null | null | commands/explorers.py | MaferMazu/simulador-blockchain | 533d6486558fcd7b5d3d417692539837dac90684 | [
"MIT"
] | 1 | 2021-12-08T03:28:16.000Z | 2021-12-08T23:17:53.000Z | commands/explorers.py | MaferMazu/blockchain-network-simulator | 3f2184b2c05681184eee40168b142e5d0af581b1 | [
"MIT"
] | 1 | 2021-12-09T02:06:14.000Z | 2021-12-09T02:06:14.000Z | """Docstring."""
import click
@click.command(name="explorerBlock")
def explorer_block():
"""Docs."""
click.echo("explorerBlock")
@click.command(name="explorerTransac")
def explorer_transac():
"""Docs."""
click.echo("explorerTransac")
| 15.9375 | 38 | 0.666667 |
94fdaa25213474c0ae7baf0ab643f7e170d33c80 | 2,084 | py | Python | sparkplug/config/timereporter.py | freshbooks/sparkplug | 4f4fe38655a93cdee602019de2a75cd3d320408c | [
"MIT"
] | null | null | null | sparkplug/config/timereporter.py | freshbooks/sparkplug | 4f4fe38655a93cdee602019de2a75cd3d320408c | [
"MIT"
] | 11 | 2015-04-16T18:34:31.000Z | 2021-05-07T14:19:57.000Z | sparkplug/config/timereporter.py | freshbooks/sparkplug | 4f4fe38655a93cdee602019de2a75cd3d320408c | [
"MIT"
] | 1 | 2019-03-14T12:52:44.000Z | 2019-03-14T12:52:44.000Z | """
TimeReporter takes timing measurements made during
message processing and outputs them
to some external resource or service.
"""
from sparkplug.config import DependencyConfigurer
from sparkplug.logutils import LazyLogger
_log = LazyLogger(__name__)
import pkg_resources
import traceback
#########################... | 34.733333 | 79 | 0.661708 |
ba9f85458e605070f630c7f880a7333bf632c979 | 2,870 | py | Python | pgweb/util/middleware.py | ChristophBerg/pgweb | bf6e7a81c0a5f329ffd2f7b3e50c4c7c68735ffc | [
"PostgreSQL"
] | 1 | 2020-12-03T21:52:50.000Z | 2020-12-03T21:52:50.000Z | pgweb/util/middleware.py | ChristophBerg/pgweb | bf6e7a81c0a5f329ffd2f7b3e50c4c7c68735ffc | [
"PostgreSQL"
] | null | null | null | pgweb/util/middleware.py | ChristophBerg/pgweb | bf6e7a81c0a5f329ffd2f7b3e50c4c7c68735ffc | [
"PostgreSQL"
] | null | null | null | from django.http import HttpResponseRedirect
from django.conf import settings
# Use thread local storage to pass the username down.
# http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
try:
from threading import local, currentThread
except ImportError:
from django.utils._threading_local import loc... | 35.432099 | 93 | 0.720906 |
00a0f59cf844b8161a35df7473572f0e1b349272 | 4,028 | py | Python | tests/core/vm/test_vm.py | ggs134/py-evm | 5ad87356181b03c14a2452131f50fe8762127c84 | [
"MIT"
] | 1 | 2021-04-19T03:04:04.000Z | 2021-04-19T03:04:04.000Z | tests/core/vm/test_vm.py | ggs134/py-evm | 5ad87356181b03c14a2452131f50fe8762127c84 | [
"MIT"
] | null | null | null | tests/core/vm/test_vm.py | ggs134/py-evm | 5ad87356181b03c14a2452131f50fe8762127c84 | [
"MIT"
] | 1 | 2021-09-13T21:14:10.000Z | 2021-09-13T21:14:10.000Z | import pytest
from eth_utils import (
decode_hex,
ValidationError,
)
from eth import constants
from eth.chains.base import (
MiningChain,
)
from eth.chains.mainnet import MAINNET_VMS
from eth.tools.builder.chain import api
from eth.tools.factories.transaction import (
new_transaction
)
@pytest.fixtu... | 32.224 | 95 | 0.739325 |
33f09ab4915b09aec7cff5ff363b2f45b951f9d3 | 8,084 | py | Python | dataio.py | ImperialCollegeLondon/-Multiview-Motion-Estimation-for-3D-cardiac-motion-tracking | 0f50f496c77c4ed469eb780a29064476a44d7ae9 | [
"MIT"
] | 1 | 2022-03-22T13:46:29.000Z | 2022-03-22T13:46:29.000Z | dataio.py | ImperialCollegeLondon/Multiview-Motion-Estimation-for-3D-cardiac-motion-tracking | 0f50f496c77c4ed469eb780a29064476a44d7ae9 | [
"MIT"
] | null | null | null | dataio.py | ImperialCollegeLondon/Multiview-Motion-Estimation-for-3D-cardiac-motion-tracking | 0f50f496c77c4ed469eb780a29064476a44d7ae9 | [
"MIT"
] | null | null | null | import torch.utils.data as data
from os import listdir
from os.path import join
import numpy as np
import nibabel as nib
import glob
import cv2
from scipy import ndimage
from utils import *
class TrainDataset(data.Dataset):
def __init__(self, data_path):
super(TrainDataset, self).__init__()
self.d... | 37.953052 | 134 | 0.68283 |
cc3e240fcdcdbad78e803140b8d8085ed8605b6f | 880 | py | Python | src/parruc/flexslider/tests/test_robot.py | parruc/parruc.flexslider | b0074ba060db4a9813dca5c0da29d03ed386ce95 | [
"MIT"
] | null | null | null | src/parruc/flexslider/tests/test_robot.py | parruc/parruc.flexslider | b0074ba060db4a9813dca5c0da29d03ed386ce95 | [
"MIT"
] | null | null | null | src/parruc/flexslider/tests/test_robot.py | parruc/parruc.flexslider | b0074ba060db4a9813dca5c0da29d03ed386ce95 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from parruc.flexslider.testing import PARRUC_FLEXSLIDER_ACCEPTANCE_TESTING # noqa
from plone.app.testing import ROBOT_TEST_LEVEL
from plone.testing import layered
import os
import robotsuite
import unittest
def test_suite():
suite = unittest.TestSuite()
current_dir = os.path.abspath(... | 30.344828 | 82 | 0.676136 |
dd2be041551d0a1b3a0b5e862c7bd272764027a3 | 118 | py | Python | concepts/Greatest_common_divisor/Main.py | A-Kastner/101repo | 692a1a967b1d0f6db0c64739f9c13d68a6a6ae17 | [
"MIT"
] | 15 | 2015-04-23T02:43:22.000Z | 2021-12-07T13:39:26.000Z | concepts/Greatest_common_divisor/Main.py | A-Kastner/101repo | 692a1a967b1d0f6db0c64739f9c13d68a6a6ae17 | [
"MIT"
] | 4 | 2021-12-02T15:53:30.000Z | 2022-02-09T22:54:15.000Z | concepts/Greatest_common_divisor/Main.py | A-Kastner/101repo | 692a1a967b1d0f6db0c64739f9c13d68a6a6ae17 | [
"MIT"
] | 14 | 2015-06-04T10:05:20.000Z | 2021-03-08T12:20:26.000Z | from GCD import gcdIterative, gcdRecursive
print gcdIterative(15, 6) # prints 3
print gcdRecursive(15, 6) # prints 3
| 23.6 | 42 | 0.771186 |
f3f16bf00db7d46162f73394df5ba47987506539 | 826 | py | Python | cloudberry-py/cloudberry/api/model/anomaly.py | olliekrk/cloud-berry | 8b39fb0b4f8772348fb50c0c1d0200c96df03cbe | [
"MIT"
] | null | null | null | cloudberry-py/cloudberry/api/model/anomaly.py | olliekrk/cloud-berry | 8b39fb0b4f8772348fb50c0c1d0200c96df03cbe | [
"MIT"
] | null | null | null | cloudberry-py/cloudberry/api/model/anomaly.py | olliekrk/cloud-berry | 8b39fb0b4f8772348fb50c0c1d0200c96df03cbe | [
"MIT"
] | null | null | null | from .str_generator import auto_str
@auto_str
class AnomalyReport:
def __init__(self,
computation_id,
stddev,
mean,
spread,
minimum,
maximum,
max_diff):
self.computation_id = computation_... | 25.030303 | 44 | 0.504843 |
54ae59196a4250a6e790ffbaacefde2e32dd434a | 407 | py | Python | app/main/pages/instrument/hrs/environment/pressure/__init__.py | hettlage/salt-data-quality-site | da9ff4a51e8affa47e0bc1c0383c7fdeaac2155e | [
"MIT"
] | null | null | null | app/main/pages/instrument/hrs/environment/pressure/__init__.py | hettlage/salt-data-quality-site | da9ff4a51e8affa47e0bc1c0383c7fdeaac2155e | [
"MIT"
] | null | null | null | app/main/pages/instrument/hrs/environment/pressure/__init__.py | hettlage/salt-data-quality-site | da9ff4a51e8affa47e0bc1c0383c7fdeaac2155e | [
"MIT"
] | null | null | null | import datetime
from app.main.data_quality import default_data_quality_content_for_date_range
def title():
return 'HRS Pressure'
def content():
return default_data_quality_content_for_date_range(__package__,
datetime.date.today() - datetime.timedelta(d... | 29.071429 | 107 | 0.584767 |
8f80881b5cd750a5ba6836a85675a2b17486323e | 1,380 | py | Python | virtual/lib/python3.6/site-packages/isort/__init__.py | wanjikuciku/neighbourhood-watch | 4b7010fe4eb5dc4e5687329be486b405c53720f6 | [
"Unlicense"
] | 2 | 2019-04-05T05:51:23.000Z | 2019-04-07T04:21:47.000Z | virtual/lib/python3.6/site-packages/isort/__init__.py | wanjikuciku/neighbourhood-watch | 4b7010fe4eb5dc4e5687329be486b405c53720f6 | [
"Unlicense"
] | 8 | 2020-03-24T18:17:36.000Z | 2022-03-12T00:14:02.000Z | Lib/site-packages/isort/__init__.py | rodrigoHM/RoomR-Server | f9c6c8307f97c4536434c45ba1bcab39640c3501 | [
"bzip2-1.0.6"
] | 1 | 2019-04-08T07:11:26.000Z | 2019-04-08T07:11:26.000Z | """__init__.py.
Defines the isort module to include the SortImports utility class as well as any defined settings.
Copyright (C) 2013 Timothy Edmund Crosley
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 t... | 47.586207 | 112 | 0.797101 |
aa8b4dff4cc452e2bfb421c7be5108c711c0316e | 2,909 | py | Python | tests/units/module_utils/hwc/test_hwc_utils.py | JoannaNil/huaweicloud-modules | dd7148d27cbc9d94f777cdf542aa4924eb9d5de4 | [
"MIT"
] | null | null | null | tests/units/module_utils/hwc/test_hwc_utils.py | JoannaNil/huaweicloud-modules | dd7148d27cbc9d94f777cdf542aa4924eb9d5de4 | [
"MIT"
] | null | null | null | tests/units/module_utils/hwc/test_hwc_utils.py | JoannaNil/huaweicloud-modules | dd7148d27cbc9d94f777cdf542aa4924eb9d5de4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
from units.compat import unittest
from ansible.module_utils.hwc_utils import (navigate_hash,
remove_empty_from_dict,
remove_nones_from_dict,
... | 26.445455 | 81 | 0.319697 |
c1d2075c89aba289c560fb5522b3c80bd357f3ff | 5,812 | py | Python | manpasswd/Menu.py | Gowthaman1401/Manpasswd | 7786ec58a01f75b4e9cc22aff2cc9cbe1a60f3f9 | [
"Apache-2.0"
] | null | null | null | manpasswd/Menu.py | Gowthaman1401/Manpasswd | 7786ec58a01f75b4e9cc22aff2cc9cbe1a60f3f9 | [
"Apache-2.0"
] | null | null | null | manpasswd/Menu.py | Gowthaman1401/Manpasswd | 7786ec58a01f75b4e9cc22aff2cc9cbe1a60f3f9 | [
"Apache-2.0"
] | null | null | null | import getpass
from .Psql import Psql
from .Key import MasterKey
class Data:
def __init__(self, db_username, db_name, db_table, master_key, user_data=None):
self.user_data = user_data
self.master_key = master_key
self.db_username = db_username
self.db_name = db_name
... | 50.53913 | 118 | 0.58276 |
e1fdcfc9e221342dfcc72f2a17cc0cbbd856af65 | 141 | py | Python | payment_services/QIWI.py | Batya02/garant-bot | 751bed648e72cf7cac19fb76d475c00e9e12a0e4 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T11:44:36.000Z | 2021-06-10T11:44:36.000Z | payment_services/QIWI.py | Batya02/garant-bot | 751bed648e72cf7cac19fb76d475c00e9e12a0e4 | [
"BSD-3-Clause"
] | null | null | null | payment_services/QIWI.py | Batya02/garant-bot | 751bed648e72cf7cac19fb76d475c00e9e12a0e4 | [
"BSD-3-Clause"
] | 1 | 2021-07-14T09:40:08.000Z | 2021-07-14T09:40:08.000Z | from qiwipyapi import Wallet
from objects.globals import config
p2p_wallet = Wallet(config["qiwi_phone"], p2p_sec_key=config["qiwi_token"]) | 28.2 | 75 | 0.808511 |
2cf733d4b6c1b9a670cdb2a06131b279d0e8166d | 788 | py | Python | profiles_api/migrations/0002_profilefeeditem.py | saeedbbm/profiles-rest-api | 0a062cdc20ed1f7948c3ed697dd4a7313a63baf8 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | saeedbbm/profiles-rest-api | 0a062cdc20ed1f7948c3ed697dd4a7313a63baf8 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | saeedbbm/profiles-rest-api | 0a062cdc20ed1f7948c3ed697dd4a7313a63baf8 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2021-11-12 03:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.52 | 126 | 0.633249 |
8cda3c3c73a713fa70ada98bb0f058502bb0a872 | 1,262 | py | Python | scraper.py | mahanfarzaneh2000/kut_moblie | 32c4b376504b3bcef4c4d5694ead108c1a321fdd | [
"Apache-2.0"
] | null | null | null | scraper.py | mahanfarzaneh2000/kut_moblie | 32c4b376504b3bcef4c4d5694ead108c1a321fdd | [
"Apache-2.0"
] | null | null | null | scraper.py | mahanfarzaneh2000/kut_moblie | 32c4b376504b3bcef4c4d5694ead108c1a321fdd | [
"Apache-2.0"
] | null | null | null | import requests
import jdatetime
from bs4 import BeautifulSoup
from unidecode import unidecode
import time
import json
data = {}
data_list = []
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
"Accept-Language": "en... | 32.358974 | 136 | 0.624406 |
afff32ccfe1ee9349255b83d44b8a322354e9c12 | 10,159 | py | Python | gym_softrobot/envs/octopus/build.py | skim0119/gym-softrobot | 041cac6f6535c51b4d84128e5bd52b48d00c0970 | [
"MIT"
] | 10 | 2022-01-11T19:49:02.000Z | 2022-03-24T22:27:32.000Z | gym_softrobot/envs/octopus/build.py | skim0119/gym-softrobot | 041cac6f6535c51b4d84128e5bd52b48d00c0970 | [
"MIT"
] | 7 | 2022-01-15T07:48:53.000Z | 2022-03-07T17:43:44.000Z | gym_softrobot/envs/octopus/build.py | skim0119/gym-softrobot | 041cac6f6535c51b4d84128e5bd52b48d00c0970 | [
"MIT"
] | 2 | 2022-03-06T19:43:06.000Z | 2022-03-25T21:31:52.000Z | __doc__ = """
Module contains elastica interface to create octopus model.
We tried to select the mechanical parameters within the plausible range in soft-matter studies
and simplified model. We encourage users to try out different parameters for properties, but
the behavior of physical simulator (PyElastica) might be... | 32.560897 | 94 | 0.627227 |
a881fab140fcdb36155929dca18a7262f3c049be | 38,934 | py | Python | imperative/python/megengine/functional/tensor.py | kxz18/MegEngine | 88c1eedbd716805244b35bdda57c3cea5efe734d | [
"Apache-2.0"
] | 5,168 | 2020-03-19T06:10:04.000Z | 2022-03-31T11:11:54.000Z | imperative/python/megengine/functional/tensor.py | kxz18/MegEngine | 88c1eedbd716805244b35bdda57c3cea5efe734d | [
"Apache-2.0"
] | 286 | 2020-03-25T01:36:23.000Z | 2022-03-31T10:26:33.000Z | imperative/python/megengine/functional/tensor.py | kxz18/MegEngine | 88c1eedbd716805244b35bdda57c3cea5efe734d | [
"Apache-2.0"
] | 515 | 2020-03-19T06:10:05.000Z | 2022-03-30T09:15:59.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 27.909677 | 118 | 0.558535 |
ed481a56708cbdb645bcfb65ed169ecbc0b6ecfb | 1,179 | py | Python | esp32_python_client/libs_messages/esp32_gpio_commands.py | glenn-edgar/esp32_python_client | 9aecf10a12979e891d1d72826daca7943dc1a0ea | [
"MIT"
] | null | null | null | esp32_python_client/libs_messages/esp32_gpio_commands.py | glenn-edgar/esp32_python_client | 9aecf10a12979e891d1d72826daca7943dc1a0ea | [
"MIT"
] | null | null | null | esp32_python_client/libs_messages/esp32_gpio_commands.py | glenn-edgar/esp32_python_client | 9aecf10a12979e891d1d72826daca7943dc1a0ea | [
"MIT"
] | null | null | null | import msgpack
class ESP32_Message_Generator(object):
def __init__(self,transport_handle):
self.transport_handler = transport_handle
def read_gpio_pins(self):
request = {}
request["topic"] = "OUTPUTS/GPIO/GET"
self.send_request(request)
def write_gpio_pins... | 29.475 | 79 | 0.675997 |
040aee9f09d17d464ffd3a830586f3747c113a49 | 619 | py | Python | Algorithms/Medium/918. Maximum Sum Circular Subarray/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Medium/918. Maximum Sum Circular Subarray/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Medium/918. Maximum Sum Circular Subarray/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def maxSubarraySumCircular(self, A: List[int]) -> int:
def kadane(list):
res = cur = float('-inf')
for x in list:
cur = x + max(cur, 0)
res = max(res, cur)
return res
N = len(A)
S =... | 24.76 | 58 | 0.494346 |
ae2991467c7bf0033ecdc0a9c1e8e45862d4668f | 9,704 | py | Python | niworkflows/workflows/epi/refmap.py | GalBenZvi/niworkflows | 14c54533a0300ee760b285f7e4d0a88593b4c075 | [
"Apache-2.0"
] | 38 | 2016-12-27T21:02:30.000Z | 2020-02-14T07:22:56.000Z | niworkflows/workflows/epi/refmap.py | GalBenZvi/niworkflows | 14c54533a0300ee760b285f7e4d0a88593b4c075 | [
"Apache-2.0"
] | 327 | 2016-08-16T15:15:10.000Z | 2020-02-26T23:48:56.000Z | niworkflows/workflows/epi/refmap.py | GalBenZvi/niworkflows | 14c54533a0300ee760b285f7e4d0a88593b4c075 | [
"Apache-2.0"
] | 27 | 2016-10-26T21:51:29.000Z | 2019-12-24T01:05:32.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 37.038168 | 89 | 0.657255 |
1a00c2335f1829333543a7cfe0ae9c1d71251743 | 1,700 | py | Python | chatterbot/input/variable_input_type_adapter.py | priyashengole/Chatterbot | 49708c479226d6650a4cadf33a1bacd233c2ca0c | [
"BSD-3-Clause"
] | 5 | 2021-03-21T06:26:02.000Z | 2021-08-11T09:58:44.000Z | chatterbot/input/variable_input_type_adapter.py | priyashengole/Chatterbot | 49708c479226d6650a4cadf33a1bacd233c2ca0c | [
"BSD-3-Clause"
] | null | null | null | chatterbot/input/variable_input_type_adapter.py | priyashengole/Chatterbot | 49708c479226d6650a4cadf33a1bacd233c2ca0c | [
"BSD-3-Clause"
] | 1 | 2020-10-27T13:44:12.000Z | 2020-10-27T13:44:12.000Z | from chatterbot.input import InputAdapter
from chatterbot.conversation import Statement
class VariableInputTypeAdapter(InputAdapter):
JSON = 'json'
TEXT = 'text'
OBJECT = 'object'
VALID_FORMATS = (JSON, TEXT, OBJECT, )
def detect_type(self, statement):
if hasattr(statement, 'text'):
... | 29.310345 | 74 | 0.621765 |
a76e82b4fac27b87867b23ca8cd2090b5d5263be | 1,903 | py | Python | venv/lib/python2.7/site-packages/lettuce/django/steps/mail.py | GrupoMazoGuay/final | 782b7580848ac01dd878e54574b0a5d36132291b | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/lettuce/django/steps/mail.py | GrupoMazoGuay/final | 782b7580848ac01dd878e54574b0a5d36132291b | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/lettuce/django/steps/mail.py | GrupoMazoGuay/final | 782b7580848ac01dd878e54574b0a5d36132291b | [
"MIT"
] | null | null | null | """
Step definitions for working with Django email.
"""
from smtplib import SMTPException
from django.core import mail
from lettuce import step
STEP_PREFIX = r'(?:Given|And|Then|When) '
CHECK_PREFIX = r'(?:And|Then) '
EMAIL_PARTS = ('subject', 'body', 'from_email', 'to', 'bcc', 'cc')
GOOD_MAIL = mail.EmailMessage.s... | 24.088608 | 77 | 0.632685 |
36dd98a1e11686e8fa10a7820cf9e999750e1705 | 2,945 | py | Python | user/models.py | daonb/okqa | 3babf225911294dec1249472a9a3f6141fa7d6a7 | [
"BSD-3-Clause"
] | null | null | null | user/models.py | daonb/okqa | 3babf225911294dec1249472a9a3f6141fa7d6a7 | [
"BSD-3-Clause"
] | null | null | null | user/models.py | daonb/okqa | 3babf225911294dec1249472a9a3f6141fa7d6a7 | [
"BSD-3-Clause"
] | null | null | null | import urllib, hashlib, datetime
# Django imports
from django.db import models
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
from django.utils.functional import cached_property
from django.utils.translation import ug... | 32.362637 | 128 | 0.709677 |
1e8cca5e4da6e6334129c11989fe27b8a87a7e27 | 652 | py | Python | PythonVirtEnv/Lib/site-packages/plotly/validators/parcoords/dimension/_range.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 7 | 2021-09-29T09:46:36.000Z | 2022-03-24T08:30:41.000Z | venv/Lib/site-packages/plotly/validators/parcoords/dimension/_range.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 1 | 2021-09-30T16:56:21.000Z | 2021-10-15T09:14:12.000Z | venv/Lib/site-packages/plotly/validators/parcoords/dimension/_range.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 1 | 2021-09-29T22:34:05.000Z | 2021-09-29T22:34:05.000Z | import _plotly_utils.basevalidators
class RangeValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self, plotly_name="range", parent_name="parcoords.dimension", **kwargs
):
super(RangeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | 31.047619 | 78 | 0.527607 |
c7af8c8b3a32033f904ef788236fb5fe3a95547d | 20,783 | py | Python | sppas/sppas/src/anndata/transcription.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/anndata/transcription.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/anndata/transcription.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | | | \ ... | 32.884494 | 78 | 0.49911 |
8136355505c73d971c81f14c813033b5a71c9ff9 | 3,440 | py | Python | classifiers/abstract_classifier.py | AmadouSadouAbihi/Leaf-classification | 8b57e8d58e5757dcc46adb486b9d007ad7854812 | [
"MIT"
] | 2 | 2020-04-04T00:40:16.000Z | 2020-04-06T21:56:08.000Z | classifiers/abstract_classifier.py | AmadouSadouAbihi/Leaf-classification | 8b57e8d58e5757dcc46adb486b9d007ad7854812 | [
"MIT"
] | 17 | 2020-03-30T13:13:50.000Z | 2020-04-11T23:29:54.000Z | classifiers/abstract_classifier.py | AmadouSadouAbihi/Leaf-classification | 8b57e8d58e5757dcc46adb486b9d007ad7854812 | [
"MIT"
] | 1 | 2020-12-15T04:07:34.000Z | 2020-12-15T04:07:34.000Z | #####
# BA Amadou 16 187 314
# YING Xu 18 205 032
# ABOU Hamza 17 057 836
###
import os, sys
sys.path.append(os.path.dirname(os.path.join(os.getcwd())))
from metrics.metric import Metrics
from data_utils.data_preprocessing import DataPreprocessing
from cross_validation.cross_validation impo... | 40 | 107 | 0.668023 |
2c8ee8ae4fb53f1ab916a9e95138b1c0b5216507 | 8,605 | py | Python | MP3/envs/cartpole.py | yutong-xie/ECE598-Learning-based-Robotics | ec006d41d87706d90f64d74d2daf8dc9d9195a0f | [
"MIT"
] | null | null | null | MP3/envs/cartpole.py | yutong-xie/ECE598-Learning-based-Robotics | ec006d41d87706d90f64d74d2daf8dc9d9195a0f | [
"MIT"
] | null | null | null | MP3/envs/cartpole.py | yutong-xie/ECE598-Learning-based-Robotics | ec006d41d87706d90f64d74d2daf8dc9d9195a0f | [
"MIT"
] | null | null | null | """
Classic cart-pole system implemented by Rich Sutton et al.
Copied from http://incompleteideas.net/sutton/book/code/pole.c
permalink: https://perma.cc/C9ZM-652R
"""
import math
import gym
from gym import spaces, logger
from gym.utils import seeding
from PIL import Image
import numpy as np
class CartPoleEnv(gym.En... | 36.308017 | 142 | 0.579663 |
6a817130f7e6038119ae452261a89f3445b24661 | 233 | py | Python | DigitalSecurityHub/products/api/views.py | vineethsai/DigitalSecurityHub | fb3380e983d71bbd67dde19346fad274f6ed2ba8 | [
"MIT"
] | null | null | null | DigitalSecurityHub/products/api/views.py | vineethsai/DigitalSecurityHub | fb3380e983d71bbd67dde19346fad274f6ed2ba8 | [
"MIT"
] | null | null | null | DigitalSecurityHub/products/api/views.py | vineethsai/DigitalSecurityHub | fb3380e983d71bbd67dde19346fad274f6ed2ba8 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from ..models import Product
from .serializers import ProductSerializer
class ProductViewSet(viewsets.ModelViewSet):
serializer_class = ProductSerializer
queryset = Product.objects.all() | 25.888889 | 44 | 0.815451 |
3f19d5418ce3c1a1ab0a8e67b441656315cd7032 | 603 | py | Python | takeyourmeds/recordings/recordings_create/migrations/0003_auto_20151128_1857.py | takeyourmeds/takeyourmeds-web | edf24188f26948902cfb69793b4d5aa3cf8b6dea | [
"MIT"
] | 11 | 2015-06-01T16:31:42.000Z | 2022-03-01T01:20:58.000Z | takeyourmeds/recordings/recordings_create/migrations/0003_auto_20151128_1857.py | takeyourmeds/takeyourmeds-web | edf24188f26948902cfb69793b4d5aa3cf8b6dea | [
"MIT"
] | 111 | 2015-07-20T13:23:16.000Z | 2017-09-08T08:17:10.000Z | takeyourmeds/recordings/recordings_create/migrations/0003_auto_20151128_1857.py | takeyourmeds/takeyourmeds-web | edf24188f26948902cfb69793b4d5aa3cf8b6dea | [
"MIT"
] | 6 | 2015-07-15T08:08:12.000Z | 2018-06-23T00:13:13.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9c1 on 2015-11-28 18:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.crypto
import functools
class Migration(migrations.Migration):
dependencies = [
('recordings_create', '0002_auto_20151128_1855'),
... | 26.217391 | 143 | 0.665008 |
7c7ef1e214803b063779bb910f1341403bdf8569 | 12,149 | py | Python | storyscript/compiler/semantics/TypeResolver.py | edvald/storyscript | a912586a65c1ee31cb634092e952767da6215269 | [
"Apache-2.0"
] | null | null | null | storyscript/compiler/semantics/TypeResolver.py | edvald/storyscript | a912586a65c1ee31cb634092e952767da6215269 | [
"Apache-2.0"
] | null | null | null | storyscript/compiler/semantics/TypeResolver.py | edvald/storyscript | a912586a65c1ee31cb634092e952767da6215269 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from storyscript.compiler.semantics.types.Types import BooleanType, \
NoneType, ObjectType
from storyscript.parser import Tree
from .ExpressionResolver import ExpressionResolver
from .PathResolver import PathResolver
from .ReturnVisitor import ReturnVisitor
from .SymbolResolver import Symbo... | 37.965625 | 79 | 0.628858 |
f9711d6eca9f572f90a12ff1d9ace96dfadc91d7 | 450 | py | Python | tests/test_exsort.py | andyhorng/exsort | e8e6f7328178d4d556ab4c745fe6db373ca36a9a | [
"MIT"
] | 1 | 2017-10-18T11:00:18.000Z | 2017-10-18T11:00:18.000Z | tests/test_exsort.py | andyhorng/exsort | e8e6f7328178d4d556ab4c745fe6db373ca36a9a | [
"MIT"
] | null | null | null | tests/test_exsort.py | andyhorng/exsort | e8e6f7328178d4d556ab4c745fe6db373ca36a9a | [
"MIT"
] | null | null | null | from exsort import exsort
import random
import string
import operator
import itertools
def test_exsort():
def items():
while True:
a = random.choice(string.ascii_letters)
yield (a, random.randint(0, 20))
sorted_items = list(exsort(itertools.islice(items(), 10), key=operator.i... | 25 | 104 | 0.664444 |
1bd3884881dff6ccf2adfe2f9aeaf32ba79c6bdc | 1,770 | py | Python | days/day6.py | seankelly001/adventofcode2020 | ba04640ba05f57ba7d6dcd3c71551bc096273e28 | [
"Apache-2.0"
] | null | null | null | days/day6.py | seankelly001/adventofcode2020 | ba04640ba05f57ba7d6dcd3c71551bc096273e28 | [
"Apache-2.0"
] | null | null | null | days/day6.py | seankelly001/adventofcode2020 | ba04640ba05f57ba7d6dcd3c71551bc096273e28 | [
"Apache-2.0"
] | null | null | null | from myutils import files
def main():
print("===== Part 1 =====")
answer = part1()
print("answer: {}".format(answer))
print("===== Part 2 =====")
answer = part2()
print("answer: {}".format(answer))
def part1():
inputs = files.getInputs("../inputs/day6-input.txt")
groups = getGroupsA... | 22.987013 | 70 | 0.571751 |
40482cdd549bf9ba4a02036c0bfcd76fe2cc9d44 | 1,389 | py | Python | supervisor/medusa/util.py | Leon-sk/supervisor-nacos | 5de2dd5ccdc16cc1142419945d0e41e78387040f | [
"Apache-2.0"
] | 1 | 2022-03-31T06:48:17.000Z | 2022-03-31T06:48:17.000Z | supervisor/medusa/util.py | Leon-sk/supervisor-nacos | 5de2dd5ccdc16cc1142419945d0e41e78387040f | [
"Apache-2.0"
] | null | null | null | supervisor/medusa/util.py | Leon-sk/supervisor-nacos | 5de2dd5ccdc16cc1142419945d0e41e78387040f | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/env python3
# -*- coding:utf-8 -*-
from supervisor.compat import escape
def html_repr (object):
so = escape (repr (object))
if hasattr (object, 'hyper_respond'):
return '<a href="/status/object/%d/">%s</a>' % (id (object), so)
else:
return so
# for example, tera, gi... | 23.15 | 72 | 0.530598 |
3e565b483290cdba46a8f21590b9018949859cc4 | 237 | py | Python | nose2/tests/functional/support/scenario/pretty_asserts/multiline_funcdef/test_multiline_funcdef.py | ltfish/nose2 | e47363dad10056cf906daf387613c21d74f37e56 | [
"BSD-2-Clause"
] | null | null | null | nose2/tests/functional/support/scenario/pretty_asserts/multiline_funcdef/test_multiline_funcdef.py | ltfish/nose2 | e47363dad10056cf906daf387613c21d74f37e56 | [
"BSD-2-Clause"
] | null | null | null | nose2/tests/functional/support/scenario/pretty_asserts/multiline_funcdef/test_multiline_funcdef.py | ltfish/nose2 | e47363dad10056cf906daf387613c21d74f37e56 | [
"BSD-2-Clause"
] | null | null | null | from nose2.tools.params import params
# multiline function definition
def test_demo(
):
x = 1
y = 2
assert x > y, "oh noez, x <= y"
@params(('foo',),
('bar',))
def test_multiline_deco(value):
assert not value
| 14.8125 | 37 | 0.607595 |
49cadcf948810a8d12c9985b7a468f4d7caff0eb | 508 | py | Python | setup.py | KirstensGitHub/example | 2c4dfa3f6309b997d1496db6d6132022f766958b | [
"MIT"
] | null | null | null | setup.py | KirstensGitHub/example | 2c4dfa3f6309b997d1496db6d6132022f766958b | [
"MIT"
] | null | null | null | setup.py | KirstensGitHub/example | 2c4dfa3f6309b997d1496db6d6132022f766958b | [
"MIT"
] | 1 | 2021-03-28T19:51:33.000Z | 2021-03-28T19:51:33.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='cdl',
version='0.1.0',
description='Sample package for CDL tutorial',
long_description=readme,
author='Contextual... | 22.086957 | 53 | 0.663386 |
ec979a8715d13f9d354059faeca6a17ae2d69396 | 4,507 | py | Python | tests/test_ec2/test_key_pairs.py | jdhardy/moto | d23910fb86d15ea09418ef5818129349d21e33aa | [
"Apache-2.0"
] | null | null | null | tests/test_ec2/test_key_pairs.py | jdhardy/moto | d23910fb86d15ea09418ef5818129349d21e33aa | [
"Apache-2.0"
] | null | null | null | tests/test_ec2/test_key_pairs.py | jdhardy/moto | d23910fb86d15ea09418ef5818129349d21e33aa | [
"Apache-2.0"
] | 1 | 2019-08-14T14:14:14.000Z | 2019-08-14T14:14:14.000Z | from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises
from nose.tools import assert_raises
import boto
import six
import sure # noqa
from boto.exception import EC2ResponseError
from moto import mock_ec2_deprecated
@mock_ec2_depre... | 33.887218 | 141 | 0.722432 |
25c6420b48f492a79e2633f7f3da54213b62d14a | 4,794 | py | Python | preprocessing/drugprot_to_bioc.py | bionlplab/drugprot_bcvii | 4dde48ab37e7fe15d5cf6e4e6b1a5da00d63ad52 | [
"BSD-3-Clause"
] | 2 | 2021-11-10T13:01:12.000Z | 2021-11-23T15:30:51.000Z | preprocessing/drugprot_to_bioc.py | bionlplab/drugprot_bcvii | 4dde48ab37e7fe15d5cf6e4e6b1a5da00d63ad52 | [
"BSD-3-Clause"
] | null | null | null | preprocessing/drugprot_to_bioc.py | bionlplab/drugprot_bcvii | 4dde48ab37e7fe15d5cf6e4e6b1a5da00d63ad52 | [
"BSD-3-Clause"
] | null | null | null | import collections
from pathlib import Path
import bioc
import tqdm
import os
def get_passage_ann(doc: bioc.BioCDocument, ann: bioc.BioCAnnotation) -> bioc.BioCPassage:
total_span = ann.total_span
for p in doc.passages:
if p.offset <= total_span.offset and total_span.end <= p.offset + len(p.text):
... | 36.59542 | 125 | 0.567584 |
e0f36c8d4f9360fc4001860ce86c400121aef416 | 494 | py | Python | question1.py | gusenov/test-tech-mail-ru-python2 | 70e37a3de447b6f7c4da5add75f65df1b51405fe | [
"MIT"
] | null | null | null | question1.py | gusenov/test-tech-mail-ru-python2 | 70e37a3de447b6f7c4da5add75f65df1b51405fe | [
"MIT"
] | null | null | null | question1.py | gusenov/test-tech-mail-ru-python2 | 70e37a3de447b6f7c4da5add75f65df1b51405fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class Foo:
def __init__(this): # def __init__(self):
this = Foo
# print type(this) # <type 'classobj'>
try:
this.var += [1]
except:
this.var = []
a = Foo()
# print type(a) # <type 'instance'>
# Сработает исключение и Foo.var присв... | 21.478261 | 77 | 0.538462 |
b7f7ac93c0c05a246a8862f6cc1038ea5fff5e17 | 12,500 | py | Python | llvmlite/ir/types.py | OxfordIonTrapGroup/llvmlite | fc3497bbd1cf6958e729a6d0cce3cb0d05b0d097 | [
"BSD-2-Clause"
] | null | null | null | llvmlite/ir/types.py | OxfordIonTrapGroup/llvmlite | fc3497bbd1cf6958e729a6d0cce3cb0d05b0d097 | [
"BSD-2-Clause"
] | null | null | null | llvmlite/ir/types.py | OxfordIonTrapGroup/llvmlite | fc3497bbd1cf6958e729a6d0cce3cb0d05b0d097 | [
"BSD-2-Clause"
] | null | null | null | """
Classes that are LLVM types
"""
from __future__ import print_function, absolute_import
import struct
from ._utils import _StrCaching
# XXX This doesn't seem to be used
_type_state = iter(range(50))
_type_enum = lambda: next(_type_state)
TYPE_UNKNOWN = _type_enum()
TYPE_POINTER = _type_enum()
TYPE_STRUCT = _ty... | 25.826446 | 78 | 0.59408 |
7876fb6c4d37ad28ca1981f14bbfb96172f4843c | 2,695 | py | Python | tests/python/unittest/test_arith_domain_touched.py | robo-corg/incubator-tvm | 4ddfdb4b15d05a5bf85a984837967d004efee5dd | [
"Apache-2.0"
] | 3 | 2020-03-12T10:25:51.000Z | 2020-08-05T05:36:23.000Z | tests/python/unittest/test_arith_domain_touched.py | robo-corg/incubator-tvm | 4ddfdb4b15d05a5bf85a984837967d004efee5dd | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_arith_domain_touched.py | robo-corg/incubator-tvm | 4ddfdb4b15d05a5bf85a984837967d004efee5dd | [
"Apache-2.0"
] | 1 | 2018-10-19T18:11:41.000Z | 2018-10-19T18:11:41.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.957746 | 76 | 0.636364 |
c731b036d56b6e6cb2a95c6ed6e8b546770a42d9 | 412 | py | Python | hackerrank/Algorithms/Powers Game/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Algorithms/Powers Game/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Algorithms/Powers Game/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | #!/bin/python3
import os
#
# Complete the powersGame function below.
#
def powersGame(n):
#
# Write your code here.
#
return 'First' if n % 8 else 'Second'
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input())
for t_itr in range(t):
n = int(in... | 14.206897 | 47 | 0.56068 |
1478e3a9330426f9869a0f767b0890b9f165e9da | 1,938 | py | Python | GommalCalc.py | Abdelrahman-Security159/GommalCalculator | 0d847e392a782aca3f0a19bb8ca371deb3a574e0 | [
"MIT"
] | null | null | null | GommalCalc.py | Abdelrahman-Security159/GommalCalculator | 0d847e392a782aca3f0a19bb8ca371deb3a574e0 | [
"MIT"
] | null | null | null | GommalCalc.py | Abdelrahman-Security159/GommalCalculator | 0d847e392a782aca3f0a19bb8ca371deb3a574e0 | [
"MIT"
] | null | null | null | class GommalCalculator():
def __init__(self):
self.input_value = ''
self.sentance = ''
self.output_value = 0
def calculate(self, sentance, word_list):
self.output_value = 0
itr = 0
try:
while itr < len(sentance):
if sentance[itr] == ' ... | 24.846154 | 134 | 0.482456 |
c09318999873a7004808f7d1ac3cc32d7b380e76 | 1,918 | py | Python | atomic_reactor/plugins/exit_remove_worker_metadata.py | shokakucarrier/atomic-reactor | 3ad81a5532cde317d0fddd4578f27438e88ee637 | [
"BSD-3-Clause"
] | null | null | null | atomic_reactor/plugins/exit_remove_worker_metadata.py | shokakucarrier/atomic-reactor | 3ad81a5532cde317d0fddd4578f27438e88ee637 | [
"BSD-3-Clause"
] | null | null | null | atomic_reactor/plugins/exit_remove_worker_metadata.py | shokakucarrier/atomic-reactor | 3ad81a5532cde317d0fddd4578f27438e88ee637 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from atomic_reactor.plugin import ExitPlugin
from atomic_reactor.constants import PLUGIN_REMOVE_WORKER_METADATA_KEY
from osbs.exceptions impor... | 36.188679 | 89 | 0.664234 |
8bd7c249b1d6fff9f2b5cc92aed8b87a460bf730 | 3,559 | py | Python | bindings/python/ensmallen/datasets/string/capnocytophagasputigena.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/capnocytophagasputigena.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/capnocytophagasputigena.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Capnocytophaga sputigena.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prote... | 32.953704 | 223 | 0.678561 |
ac8668a4cce2fb45dca67781e043b523e823660f | 1,441 | py | Python | sdk/python/lib/test/langhost/future_input/test_future_input.py | Dominik-K/pulumi | 3621c01f4becf75e24bf937bbda69ff8aaf6b5f7 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/test/langhost/future_input/test_future_input.py | Dominik-K/pulumi | 3621c01f4becf75e24bf937bbda69ff8aaf6b5f7 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/test/langhost/future_input/test_future_input.py | Dominik-K/pulumi | 3621c01f4becf75e24bf937bbda69ff8aaf6b5f7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018, Pulumi Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 35.146341 | 105 | 0.671062 |
cec6e3ab4294e6f2355bca7d251b86c2ad9bb6d5 | 1,624 | py | Python | lib/datasets/posetrack/poseval/py/evaluateAP.py | wjbKimberly/DetectAndTrack-wjb | e8f065ce389d559307f48b5de3fbb0a417b7faea | [
"Apache-2.0"
] | 1,007 | 2018-05-02T18:32:10.000Z | 2022-03-23T05:50:46.000Z | lib/datasets/posetrack/poseval/py/evaluateAP.py | wjbKimberly/DetectAndTrack-wjb | e8f065ce389d559307f48b5de3fbb0a417b7faea | [
"Apache-2.0"
] | 75 | 2018-05-07T21:18:10.000Z | 2020-06-25T21:05:29.000Z | lib/datasets/posetrack/poseval/py/evaluateAP.py | wjbKimberly/DetectAndTrack-wjb | e8f065ce389d559307f48b5de3fbb0a417b7faea | [
"Apache-2.0"
] | 208 | 2018-05-03T02:14:22.000Z | 2022-03-25T17:15:23.000Z | import numpy as np
import json
import os
import sys
import eval_helpers
def computeMetrics(scoresAll, labelsAll, nGTall):
apAll = np.zeros((nGTall.shape[0] + 1, 1))
recAll = np.zeros((nGTall.shape[0] + 1, 1))
preAll = np.zeros((nGTall.shape[0] + 1, 1))
# iterate over joints
for j in range(nGTall.... | 34.553191 | 102 | 0.644089 |
5b6a7954d7e27b80c67d6881b57d6a834025ecf5 | 3,497 | py | Python | data_processing/data_kaggle.py | rebeccaayu/masked-emotions | dc3ebb935a245484d8a9ad1580ab1c44a7bfa322 | [
"MIT"
] | null | null | null | data_processing/data_kaggle.py | rebeccaayu/masked-emotions | dc3ebb935a245484d8a9ad1580ab1c44a7bfa322 | [
"MIT"
] | null | null | null | data_processing/data_kaggle.py | rebeccaayu/masked-emotions | dc3ebb935a245484d8a9ad1580ab1c44a7bfa322 | [
"MIT"
] | 2 | 2020-12-09T08:57:54.000Z | 2020-12-27T21:05:21.000Z | #!/opt/conda/bin/python
import numpy as np
import pandas as pd
import cv2
import dlib
import os
import sys
import subprocess
from tqdm import tqdm
SHAPE_PREDICTOR_LOCATION = "/home/util/shape_predictor_68_face_landmarks.dat"
DATA_CSV = '/home/data/icml_face_data.csv' # https://www.kaggle.com/debanga/facial-expressi... | 30.946903 | 117 | 0.652273 |
a9a7ddea952c8b8bc647b60655010ed51fb3c00b | 1,665 | py | Python | setup.py | Jimmy2027/torchio | 98e5f4f379e877fa20c49f93645a3d0e0834f650 | [
"MIT"
] | null | null | null | setup.py | Jimmy2027/torchio | 98e5f4f379e877fa20c49f93645a3d0e0834f650 | [
"MIT"
] | null | null | null | setup.py | Jimmy2027/torchio | 98e5f4f379e877fa20c49f93645a3d0e0834f650 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=7.0',
'nibabel',
'numpy',
'Python-Dep... | 26.428571 | 69 | 0.618619 |
ccec13863493c4574fac604bfafe3488ce5803ef | 65,290 | py | Python | nova/tests/unit/objects/test_request_spec.py | huaqiangwang/nova | ba3147420c0a6f8b17a46b1a493b89bcd67af6f1 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/objects/test_request_spec.py | huaqiangwang/nova | ba3147420c0a6f8b17a46b1a493b89bcd67af6f1 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/objects/test_request_spec.py | huaqiangwang/nova | ba3147420c0a6f8b17a46b1a493b89bcd67af6f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.852564 | 79 | 0.603477 |
8daf741d97a1fb80cea8af85c3690410adf9ee2d | 35,881 | py | Python | Tests/designspaceLib/designspace_test.py | bhumikapaharia/fonttools | fe6057e922d0e995893a39eaece1d99be9aaf405 | [
"Apache-2.0",
"MIT"
] | null | null | null | Tests/designspaceLib/designspace_test.py | bhumikapaharia/fonttools | fe6057e922d0e995893a39eaece1d99be9aaf405 | [
"Apache-2.0",
"MIT"
] | 1 | 2015-11-30T17:47:38.000Z | 2015-11-30T17:47:38.000Z | Tests/designspaceLib/designspace_test.py | bhumikapaharia/fonttools | fe6057e922d0e995893a39eaece1d99be9aaf405 | [
"Apache-2.0",
"MIT"
] | null | null | null | # coding=utf-8
import os
import sys
import pytest
import warnings
from fontTools.misc import plistlib
from fontTools.designspaceLib import (
DesignSpaceDocument, SourceDescriptor, AxisDescriptor, RuleDescriptor,
InstanceDescriptor, evaluateRule, processRules, posix, DesignSpaceDocumentError)
from fontTools im... | 35.005854 | 260 | 0.653382 |
0a513185bc07e082878af3bce65c4cc307b3feb8 | 2,395 | py | Python | lib/msgqueue.py | yuuki0xff/mika | 47cb369e47afdc94e4b8bcbe9a6c6a4c62eb0543 | [
"MIT"
] | null | null | null | lib/msgqueue.py | yuuki0xff/mika | 47cb369e47afdc94e4b8bcbe9a6c6a4c62eb0543 | [
"MIT"
] | null | null | null | lib/msgqueue.py | yuuki0xff/mika | 47cb369e47afdc94e4b8bcbe9a6c6a4c62eb0543 | [
"MIT"
] | null | null | null | from lib.models import Session, MessageQueue
import core.settings as settings
import threading
import socket
import time
import os
import traceback
import logging
log = logging.getLogger(__name__)
def _multiThreadWorker(worker, queue):
while not queue.empty():
args = queue.get()
try:
worker(*args)
except Exc... | 23.95 | 90 | 0.680167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.