hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
76d68279cb8f211b737dc00cf0b12b22eea688f2 | 9,971 | py | Python | vendor/github.com/elastic/beats/x-pack/libbeat/tests/system/test_management.py | PavelStupnitski/examplebeat | 14f9e8d3997f4dfae82281eb8c2b3e66a23faf7b | [
"Apache-2.0"
] | 3 | 2021-08-03T07:54:42.000Z | 2022-02-24T08:14:07.000Z | vendor/github.com/elastic/beats/x-pack/libbeat/tests/system/test_management.py | PavelStupnitski/examplebeat | 14f9e8d3997f4dfae82281eb8c2b3e66a23faf7b | [
"Apache-2.0"
] | null | null | null | vendor/github.com/elastic/beats/x-pack/libbeat/tests/system/test_management.py | PavelStupnitski/examplebeat | 14f9e8d3997f4dfae82281eb8c2b3e66a23faf7b | [
"Apache-2.0"
] | 4 | 2021-07-17T08:38:39.000Z | 2021-09-18T07:23:11.000Z | import sys
import os
import json
import requests
import string
import random
import unittest
import time
from elasticsearch import Elasticsearch
from os import path
from base import BaseTest
INTEGRATION_TESTS = os.environ.get('INTEGRATION_TESTS', False)
TIMEOUT = 2 * 60
class TestManagement(BaseTest):
def se... | 34.863636 | 139 | 0.573664 |
d841c9f25e9b4fe724943ce831ba6bad95b800da | 4,728 | py | Python | src/python_old/boston.py | chdhr-harshal/MCMonitor | 330fc1a8f8cf83620fd6b0e503707c91e97af16d | [
"MIT"
] | 2 | 2020-11-04T20:35:18.000Z | 2021-09-05T09:06:43.000Z | src/python_old/boston.py | chdhr-harshal/MCMonitor | 330fc1a8f8cf83620fd6b0e503707c91e97af16d | [
"MIT"
] | null | null | null | src/python_old/boston.py | chdhr-harshal/MCMonitor | 330fc1a8f8cf83620fd6b0e503707c91e97af16d | [
"MIT"
] | 1 | 2021-09-05T09:10:41.000Z | 2021-09-05T09:10:41.000Z | #!/usr/local/bin/python
import pandas as pd
import numpy as np
import networkx as nx
from MarkovChain import *
import os
DATA_DIR = "/Users/harshal/Projects/markov_traffic/data/"
PLOTS_DATA_DIR = "/Users/harshal/Projects/markov_traffic/Plots_data/"
def read_gm_file(filename):
filename = DATA_DIR + filename
b... | 41.840708 | 136 | 0.741328 |
ecc782bb0e37c16cc1ddaa8854f2dd2b04d3216e | 464 | py | Python | pyxllib/xlcv.py | XLPRUtils/pyxllib | 7d559d0fc1f87ea26bdf44545c16417c9cf76318 | [
"Apache-2.0"
] | 15 | 2020-06-09T07:03:07.000Z | 2022-02-25T06:59:34.000Z | pyxllib/xlcv.py | XLPRUtils/pyxllib | 7d559d0fc1f87ea26bdf44545c16417c9cf76318 | [
"Apache-2.0"
] | 5 | 2020-08-08T07:11:21.000Z | 2020-08-08T07:11:24.000Z | pyxllib/xlcv.py | XLPRUtils/pyxllib | 7d559d0fc1f87ea26bdf44545c16417c9cf76318 | [
"Apache-2.0"
] | 2 | 2020-06-09T07:03:26.000Z | 2020-12-31T06:50:37.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author : 陈坤泽
# @Email : 877362867@qq.com
# @Date : 2021/06/03 22:23
from pyxllib.xl import *
from pyxllib.algo.geo import *
from pyxllib.cv.newbie import *
from pyxllib.cv.expert import *
# 把自定义的一些功能嵌入到PIL.Image.Image类中。
# 因为pyxllib.xlcv设计初衷本就是为了便捷而牺牲工程性。
# 如果这步没有给... | 25.777778 | 69 | 0.713362 |
96b8347a109808d15c066b7f92716279c874e474 | 17,523 | bzl | Python | bazel/grpc_deps.bzl | terracatta/grpc | f7591a3426becbed20dbd1a80beb9c1e2ca1a738 | [
"Apache-2.0"
] | 2 | 2020-03-27T17:01:34.000Z | 2020-03-27T19:38:58.000Z | bazel/grpc_deps.bzl | doc22940/grpc | 6640651bcff343c905d6fefa7ecab0eb1ba5f984 | [
"Apache-2.0"
] | 62 | 2020-02-27T00:53:36.000Z | 2021-02-05T06:10:53.000Z | bazel/grpc_deps.bzl | doc22940/grpc | 6640651bcff343c905d6fefa7ecab0eb1ba5f984 | [
"Apache-2.0"
] | null | null | null | """Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_grpc_grpc//bazel:grpc_python_deps.bzl", "grpc_python_deps")
def grpc_deps():
"""Loads dependencies need to compile and test the grpc l... | 43.160099 | 172 | 0.647149 |
3da10af5d47ec011aa200450c2856e53b472d246 | 401 | py | Python | furry/nn/__init__.py | Bill13579/furry | 3336ccd88996494c8bf0b8445bf7e7058a5f3397 | [
"MIT"
] | 1 | 2019-05-11T02:49:38.000Z | 2019-05-11T02:49:38.000Z | furry/nn/__init__.py | Bill13579/furry | 3336ccd88996494c8bf0b8445bf7e7058a5f3397 | [
"MIT"
] | null | null | null | furry/nn/__init__.py | Bill13579/furry | 3336ccd88996494c8bf0b8445bf7e7058a5f3397 | [
"MIT"
] | null | null | null | from furry.nn.batchnorm import BatchNormalization
from furry.nn.conv import Conv1d, Conv2d, Conv3d
from furry.nn.conv_t import ConvTranspose1d, ConvTranspose2d, ConvTranspose3d, DeConv1d, DeConv2d, DeConv3d
from furry.nn.dense import Dense
from furry.nn.recurrent import Recurrent
from furry.nn.gru import GRU
from furry... | 50.125 | 107 | 0.835411 |
ffefc737cd75f986a3716bc22e44dcc08035b9be | 8,582 | py | Python | openshift/installer/vendored/openshift-ansible-3.11.0-0.10.0/roles/lib_vendored_deps/library/oo_azure_rm_publish_image_facts.py | propyless/openshift-tools | 16776b4f343ea3b2018f7679cc3383e616020710 | [
"Apache-2.0"
] | null | null | null | openshift/installer/vendored/openshift-ansible-3.11.0-0.10.0/roles/lib_vendored_deps/library/oo_azure_rm_publish_image_facts.py | propyless/openshift-tools | 16776b4f343ea3b2018f7679cc3383e616020710 | [
"Apache-2.0"
] | null | null | null | openshift/installer/vendored/openshift-ansible-3.11.0-0.10.0/roles/lib_vendored_deps/library/oo_azure_rm_publish_image_facts.py | propyless/openshift-tools | 16776b4f343ea3b2018f7679cc3383e616020710 | [
"Apache-2.0"
] | 2 | 2018-10-16T05:11:13.000Z | 2018-11-07T01:46:29.000Z | #!/usr/bin/env python
# pylint: disable=missing-docstring
# Copyright 2018 Red Hat, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | 35.316872 | 119 | 0.605919 |
d5a9aa43275f124471927d4fecdb0fa7b66f7c26 | 1,298 | py | Python | tests/test_toy.py | marinang/probfit | fa5a91b84677d4d73fb47b1b9c4886a5417ef457 | [
"MIT"
] | null | null | null | tests/test_toy.py | marinang/probfit | fa5a91b84677d4d73fb47b1b9c4886a5417ef457 | [
"MIT"
] | null | null | null | tests/test_toy.py | marinang/probfit | fa5a91b84677d4d73fb47b1b9c4886a5417ef457 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib
matplotlib.use('Agg', warn=False)
from probfit.nputil import mid
from probfit.pdf import crystalball, gaussian
from probfit.functor import Normalized
from probfit.toy import gen_toy
from probfit._libstat import compute_chi2
from probfit.nputil import vector_apply
from probfit.costfu... | 25.45098 | 70 | 0.631741 |
c7564d3bb4e8bc0c51389fb5d242ccf2932fa669 | 3,736 | py | Python | tf3d/instance_segmentation/metric_test.py | wondercha/google-research | 1c3d958e8f99aad52d48a0665bc5e8446ad87d8d | [
"Apache-2.0"
] | 2 | 2021-02-11T19:57:58.000Z | 2021-06-25T18:22:21.000Z | tf3d/instance_segmentation/metric_test.py | wondercha/google-research | 1c3d958e8f99aad52d48a0665bc5e8446ad87d8d | [
"Apache-2.0"
] | 1 | 2021-03-22T17:03:30.000Z | 2021-03-22T17:03:30.000Z | tf3d/instance_segmentation/metric_test.py | wondercha/google-research | 1c3d958e8f99aad52d48a0665bc5e8446ad87d8d | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 40.172043 | 79 | 0.567184 |
3892415b67d5868d3ebb2be51b154b8a7bf65036 | 91 | py | Python | teste_quiz.py | Fabio-Coder/100_days_of_python | 74f10dae5b0bb2f9d32d5c9c779652b46fa258cf | [
"MIT"
] | null | null | null | teste_quiz.py | Fabio-Coder/100_days_of_python | 74f10dae5b0bb2f9d32d5c9c779652b46fa258cf | [
"MIT"
] | null | null | null | teste_quiz.py | Fabio-Coder/100_days_of_python | 74f10dae5b0bb2f9d32d5c9c779652b46fa258cf | [
"MIT"
] | null | null | null | def all_aboard(a, *args, **kw):
print(a, args, kw)
all_aboard(4, 7, 3, 0, x=10, y=64) | 18.2 | 34 | 0.571429 |
772ac86bf91e79082281fdc34b7cc7488a1996df | 23,043 | py | Python | tensorflow/python/data/experimental/kernel_tests/copy_to_device_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/kernel_tests/copy_to_device_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/kernel_tests/copy_to_device_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.255537 | 81 | 0.70069 |
57483345c77a965e2fd67940c92cff50d627404c | 17,076 | py | Python | netbox/extras/views.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 2 | 2021-07-08T03:58:12.000Z | 2022-02-11T21:50:46.000Z | netbox/extras/views.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 25 | 2019-09-17T19:40:50.000Z | 2022-03-11T04:01:55.000Z | netbox/extras/views.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 1 | 2022-02-11T21:50:58.000Z | 2022-02-11T21:50:58.000Z | from django import template
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.http import Http404, HttpResponseForbidden
from django.shortcuts import get_object_or_404, redirect, render
from django.views.generic import View
from dja... | 33.22179 | 110 | 0.659932 |
225da33902d662c9cc49dbbc4f0e1566550f3c4b | 24,109 | py | Python | domonic/xml/x3d.py | code-review-doctor/domonic | fee5704ab051d40c7b3fec5488a44d3ab1ee027c | [
"MIT"
] | null | null | null | domonic/xml/x3d.py | code-review-doctor/domonic | fee5704ab051d40c7b3fec5488a44d3ab1ee027c | [
"MIT"
] | null | null | null | domonic/xml/x3d.py | code-review-doctor/domonic | fee5704ab051d40c7b3fec5488a44d3ab1ee027c | [
"MIT"
] | null | null | null | """
domonic.x3d
====================================
Generate x3d with python 3
"""
from domonic.dom import Element
from domonic.html import closed_tag
x3d = X3D = type('x3d', (Element,), {'name': 'x3d'})
scene = Scene = type('scene', (Element,), {'name': 'scene'})
material = Material = type('material', ... | 92.726923 | 176 | 0.729479 |
669d46e027f3f8e88ee81dcd7d00f32d56eefdd2 | 1,280 | py | Python | bundle-workflow/src/test_workflow/perf_test/perf_test_suite.py | aditjind/opensearch-build | aa98ab8be40890b830ab2974cd7ca9030d9b3135 | [
"Apache-2.0"
] | 1 | 2022-01-11T17:47:01.000Z | 2022-01-11T17:47:01.000Z | bundle-workflow/src/test_workflow/perf_test/perf_test_suite.py | aditjind/opensearch-build | aa98ab8be40890b830ab2974cd7ca9030d9b3135 | [
"Apache-2.0"
] | null | null | null | bundle-workflow/src/test_workflow/perf_test/perf_test_suite.py | aditjind/opensearch-build | aa98ab8be40890b830ab2974cd7ca9030d9b3135 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
from system.working_directory import WorkingDirectory
class PerfTestSuite:
"""
Represents a performance test suite. This class runs rally test on the deployed cluster with the provided IP.
"""
def __init__(self, bundle_manifest, endpoint, security, current_workspace):
... | 37.647059 | 113 | 0.628906 |
a153476159f0c7357cda6c1bce02148f29055a9d | 535 | py | Python | tramatego/src/tramatego/transforms/__init__.py | kvsaurav/QRadio | 53299f5bd57b60f76596ed05ba7f1f65b255114d | [
"Apache-2.0"
] | 95 | 2016-03-04T18:34:51.000Z | 2021-08-30T03:43:17.000Z | tramatego/src/tramatego/transforms/__init__.py | netwrkspider/QRadio | 53299f5bd57b60f76596ed05ba7f1f65b255114d | [
"Apache-2.0"
] | null | null | null | tramatego/src/tramatego/transforms/__init__.py | netwrkspider/QRadio | 53299f5bd57b60f76596ed05ba7f1f65b255114d | [
"Apache-2.0"
] | 21 | 2016-03-10T12:19:59.000Z | 2020-05-09T18:54:00.000Z | #!/usr/bin/env python
__author__ = 'Zappus'
__copyright__ = 'Copyright 2016, Tramatego Project'
__credits__ = []
__license__ = 'GPL'
__version__ = '0.1'
__maintainer__ = 'Zappus'
__email__ = ''
__status__ = 'Development'
__all__ = [
'ipv4_to_hash',
'ipv4_to_blacklist',
'ipv4_to_score',
'ipv4_to_domai... | 19.107143 | 51 | 0.663551 |
20dee652cd31bb0ec3d6cf15e440e04cec763d64 | 384 | py | Python | ovc5/firmware/sandbox/blink/nmigen/sim.py | alexvonduar/ovc | ce4ecebd49208a69b1402763adda0f6b80584eac | [
"Apache-2.0"
] | 174 | 2018-03-27T23:30:27.000Z | 2022-03-28T13:48:22.000Z | ovc5/firmware/sandbox/blink/nmigen/sim.py | memoo55/ovc | 0980904627669691e2012d2fcfc2390d432c27e4 | [
"Apache-2.0"
] | 41 | 2018-03-30T16:25:39.000Z | 2022-03-28T09:00:36.000Z | ovc5/firmware/sandbox/blink/nmigen/sim.py | memoo55/ovc | 0980904627669691e2012d2fcfc2390d432c27e4 | [
"Apache-2.0"
] | 50 | 2018-04-01T01:44:03.000Z | 2022-03-11T05:58:30.000Z | #!/usr/bin/env python3
from blink import *
from nmigen.back.pysim import *
'''
def wait_led(state):
while True:
yield Tick()
if (yield dut.led) == state:
return
'''
def test():
for i in range(10000):
yield
dut = Blink()
sim = Simulator(dut)
sim.add_clock(1e-6)
sim.add_s... | 14.769231 | 36 | 0.604167 |
f132d9a4e44906632aab9691e4ffd0860397ad79 | 3,336 | py | Python | samples/gmd/plot_wavelength_2.py | aluque/CloudScat.jl | 6691533eb8c4bbed683e052409a49d6fc5f96804 | [
"MIT"
] | 8 | 2020-06-30T10:40:35.000Z | 2022-02-27T20:16:45.000Z | samples/gmd/plot_wavelength_2.py | aluque/CloudScat.jl | 6691533eb8c4bbed683e052409a49d6fc5f96804 | [
"MIT"
] | 4 | 2020-07-16T01:37:24.000Z | 2021-08-30T08:56:57.000Z | samples/gmd/plot_wavelength_2.py | aluque/CloudScat.jl | 6691533eb8c4bbed683e052409a49d6fc5f96804 | [
"MIT"
] | null | null | null | import sys
import string
from itertools import product
import scipy.constants as co
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import LogNorm
from scipy import stats
import h5py
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage[varg]{txfonts}')
plt.rc('axes'... | 26.267717 | 74 | 0.565647 |
4874c213b50026d6b6b8c21b105c26ad383d66b7 | 935 | py | Python | src/ggrc/migrations/versions/20190429_9d89d2061961_add_review_status_for_risk.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-12T23:46:00.000Z | 2019-01-12T23:46:00.000Z | src/ggrc/migrations/versions/20190429_9d89d2061961_add_review_status_for_risk.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/migrations/versions/20190429_9d89d2061961_add_review_status_for_risk.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add review status for Risk
Create Date: 2019-04-29 10:47:20.217525
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
import sqlalchemy a... | 24.605263 | 79 | 0.71123 |
68a79a1a6534946659a46c0e643ca224fd2af0e1 | 769 | py | Python | catalog/bindings/gmd/point_array_property_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/point_array_property_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/point_array_property_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import List
from bindings.gmd.point import Point
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class PointArrayPropertyType:
"""gml:PointArrayPropertyType is a container for an array of points.
The elements are always contained inline in the arr... | 24.806452 | 72 | 0.624187 |
6ad0fe246df623ee396d8f7f402dce90fe31c59f | 10,799 | py | Python | tests/test_02_dxf_graphics/test_236_mleader.py | mozman/ezdxf | a6442b808baf6504f27034bde5a7a74d1e605003 | [
"MIT"
] | 515 | 2017-01-25T05:46:52.000Z | 2022-03-29T09:52:27.000Z | tests/test_02_dxf_graphics/test_236_mleader.py | triroakenshield/ezdxf | 82e964a574bcb86febc677bd63f1626318f51caf | [
"MIT"
] | 417 | 2017-01-25T10:01:17.000Z | 2022-03-29T09:22:04.000Z | tests/test_02_dxf_graphics/test_236_mleader.py | triroakenshield/ezdxf | 82e964a574bcb86febc677bd63f1626318f51caf | [
"MIT"
] | 149 | 2017-02-01T15:52:02.000Z | 2022-03-17T10:33:38.000Z | # Copyright (c) 2018-2020 Manfred Moitzi
# License: MIT License
import pytest
import ezdxf
from ezdxf.layouts import VirtualLayout
from ezdxf import colors
from ezdxf.lldxf import const
from ezdxf.lldxf.tags import Tags
from ezdxf.lldxf.extendedtags import ExtendedTags
from ezdxf.math import Matrix44
# noinspection Py... | 12.441244 | 80 | 0.625799 |
188a8c05b6eed708a1a001fcbbf2316a2c47b70c | 1,842 | py | Python | version.py | orange-kao/rpm-s3-mirror | 4a08cdb47de33045c5e5bc8be1c5ee17bc169d56 | [
"Apache-2.0"
] | null | null | null | version.py | orange-kao/rpm-s3-mirror | 4a08cdb47de33045c5e5bc8be1c5ee17bc169d56 | [
"Apache-2.0"
] | null | null | null | version.py | orange-kao/rpm-s3-mirror | 4a08cdb47de33045c5e5bc8be1c5ee17bc169d56 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 Aiven, Helsinki, Finland. https://aiven.io/
import imp
import os
import subprocess
def save_version(new_ver, old_ver, version_file):
if not new_ver:
return False
version_file = os.path.join(os.path.dirname(__file__), version_file)
if not old_ver or new_ver != old_ver:
... | 32.892857 | 104 | 0.634093 |
96779d58b7cf3776c06333a82dfeeea454d7aa16 | 1,120 | py | Python | pyvisdk/do/cannot_move_vm_with_native_delta_disk.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/cannot_move_vm_with_native_delta_disk.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/cannot_move_vm_with_native_delta_disk.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def CannotMoveVmWithNativeDeltaDisk(vim, *args, **kwargs):
'''This fault is thrown when a... | 32.941176 | 124 | 0.625 |
e828f4adfe1c7454d82ebcf22f171a73d4535a36 | 5,576 | py | Python | ialgebra/operations/operator.py | huashen218/pytorch-ialgebra | f498fb2c91c5a48204c66ad5e6dc118cbec69641 | [
"MIT"
] | 2 | 2021-02-01T20:07:13.000Z | 2021-02-10T17:15:45.000Z | build/lib/ialgebra/operations/operator.py | huashen218/pytorch-ialgebra | f498fb2c91c5a48204c66ad5e6dc118cbec69641 | [
"MIT"
] | null | null | null | build/lib/ialgebra/operations/operator.py | huashen218/pytorch-ialgebra | f498fb2c91c5a48204c66ad5e6dc118cbec69641 | [
"MIT"
] | null | null | null | from ialgebra.utils.utils_interpreter import *
from ialgebra.utils.utils_data import to_numpy, to_tensor
name2identity = {
'grad_cam': 'GradCam',
'grad_saliency': 'GradSaliency',
'guided_backprop_grad': 'GuidedBackpropGrad',
'guided_backprop_smoothgrad': 'GuidedBackpropSmoothGrad',
'mask': 'Mask',... | 37.422819 | 160 | 0.638271 |
8fd938d0d02e157dbcef0132d057eec11e96d6df | 3,928 | py | Python | grpc/__main__.py | kaustubhhiware/swift | 7089c4e05fd831b864de46ee37b681a6249909e3 | [
"MIT"
] | null | null | null | grpc/__main__.py | kaustubhhiware/swift | 7089c4e05fd831b864de46ee37b681a6249909e3 | [
"MIT"
] | null | null | null | grpc/__main__.py | kaustubhhiware/swift | 7089c4e05fd831b864de46ee37b681a6249909e3 | [
"MIT"
] | null | null | null | """
Each node starts with broadcasting on a port.
Every node responds back with the requesting IP whose download is going on, if any
"""
import argparse
import asyncio
import pickle
import socket
import sys
import threading
import constants
import utils
from node import Node
from message import Message
# shift to cons... | 25.019108 | 123 | 0.723778 |
b168b179ade54dc24a210b2b3b37438fc8ed6b09 | 59 | py | Python | code/10-12-pytest/day11/test_weather.py | llamafarmer/100_days_of_code | 6af973157aa4c77cd6f88bf1f0fa5e60a375339c | [
"MIT"
] | 1 | 2018-08-04T00:41:32.000Z | 2018-08-04T00:41:32.000Z | code/10-12-pytest/day11/test_weather.py | llamafarmer/100_days_of_code | 6af973157aa4c77cd6f88bf1f0fa5e60a375339c | [
"MIT"
] | null | null | null | code/10-12-pytest/day11/test_weather.py | llamafarmer/100_days_of_code | 6af973157aa4c77cd6f88bf1f0fa5e60a375339c | [
"MIT"
] | null | null | null | import pytest
from weather import weather
@patch.object() | 11.8 | 27 | 0.79661 |
ffead0df733697a9582c2d4daa4dae2c0d0b4927 | 1,436 | py | Python | python/bracket-push/bracket_push.py | rootulp/exercism | 312a053ad1d375752acf0fce062ee7b9c643a149 | [
"MIT"
] | 41 | 2015-02-09T18:08:45.000Z | 2022-03-06T15:23:32.000Z | python/bracket-push/bracket_push.py | DucChuyenSoftwareEngineer/exercism | fb7820a1ba162b888a39f1b86cbe5d3ca3b15d4f | [
"MIT"
] | 21 | 2019-12-28T17:47:06.000Z | 2021-02-27T19:43:00.000Z | python/bracket-push/bracket_push.py | DucChuyenSoftwareEngineer/exercism | fb7820a1ba162b888a39f1b86cbe5d3ca3b15d4f | [
"MIT"
] | 18 | 2016-04-29T14:35:12.000Z | 2021-06-23T07:32:29.000Z | def is_empty(stack):
return stack == []
class CheckBrackets:
BRACKETS = {'{': '}',
'[': ']',
'(': ')'}
OPENING_BRACKET = set(BRACKETS.keys())
CLOSING_BRACKET = set(BRACKETS.values())
def __init__(self, inp):
self.inp = inp
def is_paired(self):
... | 29.916667 | 99 | 0.632312 |
b302bc769779f476d5e3d80ca2f453e589637440 | 724 | py | Python | merchandises/urls.py | it-teaching-abo-akademi/webshop-project-arnelimperial | 98fc7bd8ce031a50c0bd83a6c5c48ed93030e528 | [
"Unlicense"
] | null | null | null | merchandises/urls.py | it-teaching-abo-akademi/webshop-project-arnelimperial | 98fc7bd8ce031a50c0bd83a6c5c48ed93030e528 | [
"Unlicense"
] | null | null | null | merchandises/urls.py | it-teaching-abo-akademi/webshop-project-arnelimperial | 98fc7bd8ce031a50c0bd83a6c5c48ed93030e528 | [
"Unlicense"
] | null | null | null | from .views import (
merchandise_list_view,
merchandise_detail_view,
merchandise_create_view,
merchandise_update_view,
merchandise_delete_view,
)
from django.urls import path, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
app_name = 'merchandises'
urlpatterns = [
... | 38.105263 | 89 | 0.765193 |
06b0eafe70d6017f03cb7cebffe652c6048d8980 | 8,530 | py | Python | ant.py | twardzikf/aco-in-urban-transport | 89228ced89b425400a240a455d9585d0f7ef1861 | [
"MIT"
] | null | null | null | ant.py | twardzikf/aco-in-urban-transport | 89228ced89b425400a240a455d9585d0f7ef1861 | [
"MIT"
] | null | null | null | ant.py | twardzikf/aco-in-urban-transport | 89228ced89b425400a240a455d9585d0f7ef1861 | [
"MIT"
] | 1 | 2021-06-04T02:17:01.000Z | 2021-06-04T02:17:01.000Z | import numpy as np
class Ant:
"""
Class realizing single ant functionality
Attributes:
*** operational attributes ***
- number: oridnal number of an ant
- node_memory: current edge in form of list of two nodes
- src_node: start and first target node of an ant
-... | 46.108108 | 188 | 0.603048 |
f44ea6424f462ef05c04b15d236fa19743502985 | 4,513 | py | Python | test/utils/barrier_test.py | lbusoni/plico | e4bab48fcc7767a50dcac13644b5e1d6175ca5f0 | [
"MIT"
] | null | null | null | test/utils/barrier_test.py | lbusoni/plico | e4bab48fcc7767a50dcac13644b5e1d6175ca5f0 | [
"MIT"
] | 7 | 2021-08-30T17:18:34.000Z | 2022-03-25T22:42:20.000Z | test/utils/barrier_test.py | lbusoni/plico | e4bab48fcc7767a50dcac13644b5e1d6175ca5f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
from plico.utils.barrier import Predicate, Barrier, BarrierTimeout,\
FunctionPredicate
from plico.utils.decorator import override
__version__="$Id: barrier_test.py 26 2018-01-26 19:06:25Z lbusoni $"
class Dummy:
def __init__(self):
self._isTrueInvocations= 0
... | 24.005319 | 68 | 0.629293 |
041087f68731db3350a77e9b513718ee3f7de281 | 10,126 | py | Python | tools/clang/scripts/update.py | domenic/mojo | 53dda76fed90a47c35ed6e06baf833a0d44495b8 | [
"BSD-3-Clause"
] | 5 | 2019-05-24T01:25:34.000Z | 2020-04-06T05:07:01.000Z | tools/clang/scripts/update.py | domenic/mojo | 53dda76fed90a47c35ed6e06baf833a0d44495b8 | [
"BSD-3-Clause"
] | null | null | null | tools/clang/scripts/update.py | domenic/mojo | 53dda76fed90a47c35ed6e06baf833a0d44495b8 | [
"BSD-3-Clause"
] | 5 | 2016-12-23T04:21:10.000Z | 2020-06-18T13:52:33.000Z | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Windows can't run .sh files, so this is a Python implementation of
update.sh. This script should replace update.sh on all platfo... | 35.529825 | 80 | 0.674501 |
a3e335f40dd653ac30e8d7d5c3e8b98621916f12 | 552 | py | Python | adv/summer_norwin.py | dl-stuff/dl | 185cc8a16339c47ed873768ff30804f8d06090a2 | [
"Apache-2.0"
] | 22 | 2020-04-04T17:34:16.000Z | 2021-09-25T00:22:23.000Z | adv/summer_norwin.py | dl-stuff/dl | 185cc8a16339c47ed873768ff30804f8d06090a2 | [
"Apache-2.0"
] | 92 | 2020-04-04T15:30:34.000Z | 2022-03-24T01:43:11.000Z | adv/summer_norwin.py | dl-stuff/dl | 185cc8a16339c47ed873768ff30804f8d06090a2 | [
"Apache-2.0"
] | 37 | 2020-04-16T02:47:07.000Z | 2021-03-28T23:18:50.000Z | from core.advbase import *
class Summer_Norwin(Adv):
def prerun(self):
self.doleful = 0
self.current_s["s1"] = "a"
self.current_s["s2"] = "a"
def s1_before(self, e):
if e.group == "d":
self.doleful = 0
self.energy.unset_disabled("doleful")
def s2_p... | 24 | 55 | 0.548913 |
bd40f4116cc124fe18225653ab443e9febd9f242 | 8,095 | py | Python | jina/jaml/helper.py | properGrammar/jina | b483002989f642eb33791a0444dc6728929704b2 | [
"Apache-2.0"
] | null | null | null | jina/jaml/helper.py | properGrammar/jina | b483002989f642eb33791a0444dc6728929704b2 | [
"Apache-2.0"
] | null | null | null | jina/jaml/helper.py | properGrammar/jina | b483002989f642eb33791a0444dc6728929704b2 | [
"Apache-2.0"
] | null | null | null | import collections
import json
import os
from typing import Union, TextIO, Dict, Tuple, Optional
from yaml import MappingNode
from yaml.composer import Composer
from yaml.constructor import FullConstructor, ConstructorError
from yaml.parser import Parser
from yaml.reader import Reader
from yaml.resolver import Resolve... | 31.254826 | 111 | 0.619271 |
cb6d4eb1ae04510d94c3c051d7b193b12522b04a | 23,658 | py | Python | naslib/utils/utils.py | saiprasadbarke/NASLib_Exercise_DLLab21 | b8ceff881ce0028611ff373c7c6a546ed74ec916 | [
"Apache-2.0"
] | null | null | null | naslib/utils/utils.py | saiprasadbarke/NASLib_Exercise_DLLab21 | b8ceff881ce0028611ff373c7c6a546ed74ec916 | [
"Apache-2.0"
] | null | null | null | naslib/utils/utils.py | saiprasadbarke/NASLib_Exercise_DLLab21 | b8ceff881ce0028611ff373c7c6a546ed74ec916 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys
import logging
import argparse
import torchvision.datasets as dset
from torch.utils.data import Dataset
from sklearn import metrics
from scipy import stats
from copy import copy
from collections import OrderedDict
import random
import os
import os.path
import shutil
f... | 35.10089 | 171 | 0.627103 |
320d7f5e4d58711563baf620fbe738d9bf282f26 | 685 | py | Python | examples/modes/occurences.py | haesleinhuepf/pyqode.core | 88b9bab081fd580d4de86f3d926a9f0b19146d28 | [
"MIT"
] | null | null | null | examples/modes/occurences.py | haesleinhuepf/pyqode.core | 88b9bab081fd580d4de86f3d926a9f0b19146d28 | [
"MIT"
] | null | null | null | examples/modes/occurences.py | haesleinhuepf/pyqode.core | 88b9bab081fd580d4de86f3d926a9f0b19146d28 | [
"MIT"
] | null | null | null | """
Minimal example showing the use of the OccurrencesHighlighterMode.
"""
import logging
logging.basicConfig(level=logging.DEBUG)
import sys
from qtpy import QtWidgets
from pyqode.core.api import CodeEdit
from pyqode.core.backend import server
from pyqode.core.modes import OccurrencesHighlighterMode
if __name__ == ... | 25.37037 | 66 | 0.732847 |
b7640f19cb64a2316b6dcd152216b9ba51ac393a | 2,087 | py | Python | tests/test_openeye_patterns.py | flc/chem-fingerprints | 8c1b27374355f08105c5332db376b3428b6e30b2 | [
"MIT"
] | null | null | null | tests/test_openeye_patterns.py | flc/chem-fingerprints | 8c1b27374355f08105c5332db376b3428b6e30b2 | [
"MIT"
] | null | null | null | tests/test_openeye_patterns.py | flc/chem-fingerprints | 8c1b27374355f08105c5332db376b3428b6e30b2 | [
"MIT"
] | null | null | null | import sys
import unittest2
import support
try:
from openeye.oechem import OEGraphMol, OEParseSmiles
skip_oechem = False
except ImportError:
skip_oechem = support.can_skip("oe")
else:
from chemfp import openeye_patterns
import test_patterns
def parse_smiles(smiles):
mol = OEGraphMol()
OEPars... | 31.149254 | 85 | 0.70436 |
4cecd069017434a0875d2f030fed50f2432fe587 | 923 | py | Python | web_dynamic/3-hbnb.py | Zevrov/AirBnB_clone_v3 | 92a1863e4395404da5b548d3cab10627610e64a9 | [
"MIT"
] | 1 | 2021-03-03T17:29:11.000Z | 2021-03-03T17:29:11.000Z | web_dynamic/3-hbnb.py | Zevrov/AirBnB_clone_v4 | 92a1863e4395404da5b548d3cab10627610e64a9 | [
"MIT"
] | null | null | null | web_dynamic/3-hbnb.py | Zevrov/AirBnB_clone_v4 | 92a1863e4395404da5b548d3cab10627610e64a9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''Flask app to generate complete html page containing location/amenity
dropdown menus and rental listings
'''
from flask import Flask, render_template
from models import storage
import uuid
app = Flask('web_dynamic')
app.url_map.strict_slashes = False
@app.route('/3-hbnb')
def display_hbnb():
... | 27.147059 | 71 | 0.63597 |
4be8e0c7ad0316d949bf38c07cfc57aae6cf7325 | 505 | py | Python | project/settings_production.py | pmoran13800/rhgamestation-manager | dd5ca1190ae92455fce10a3475a9a14e684024d8 | [
"MIT"
] | null | null | null | project/settings_production.py | pmoran13800/rhgamestation-manager | dd5ca1190ae92455fce10a3475a9a14e684024d8 | [
"MIT"
] | null | null | null | project/settings_production.py | pmoran13800/rhgamestation-manager | dd5ca1190ae92455fce10a3475a9a14e684024d8 | [
"MIT"
] | null | null | null | from .settings import *
# Update SITE infos to use the common port 80 to publish the webapp
SITE_FIXED = {
'name': "RH Gamestation Manager",
'ip': None, # If 'None' find the ip automatically. Use a string to define another ip/hostname
'port': None, # If 'None' no port is added to hostname, so the server ha... | 33.666667 | 107 | 0.734653 |
ddbafa3d2554a4cf863210c9daba66ea2da30499 | 102,965 | py | Python | cvpysdk/schedules.py | Jayesh-Jain/SDK | 5fe5130b1eeacad9944ba34714e583c6c743482f | [
"Apache-2.0"
] | null | null | null | cvpysdk/schedules.py | Jayesh-Jain/SDK | 5fe5130b1eeacad9944ba34714e583c6c743482f | [
"Apache-2.0"
] | null | null | null | cvpysdk/schedules.py | Jayesh-Jain/SDK | 5fe5130b1eeacad9944ba34714e583c6c743482f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, 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 a... | 43.536998 | 120 | 0.496499 |
d8f951456e41a03a6f33077aa7ed7706db62d289 | 6,254 | py | Python | src/python/grpcio/grpc/_common.py | warlock135/grpc | 81e13e4fa9c0cdf7dc131ce548e1604c895b738c | [
"Apache-2.0"
] | 36,552 | 2015-02-26T17:30:13.000Z | 2022-03-31T22:41:33.000Z | src/python/grpcio/grpc/_common.py | SanjanaSingh897/grpc | 2d858866eb95ce5de8ccc8c35189a12733d8ca79 | [
"Apache-2.0"
] | 23,536 | 2015-02-26T17:50:56.000Z | 2022-03-31T23:39:42.000Z | src/python/grpcio/grpc/_common.py | SanjanaSingh897/grpc | 2d858866eb95ce5de8ccc8c35189a12733d8ca79 | [
"Apache-2.0"
] | 11,050 | 2015-02-26T17:22:10.000Z | 2022-03-31T10:12:35.000Z | # Copyright 2016 gRPC 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 writing... | 37.005917 | 80 | 0.731532 |
1b99f6486e850674169de5d480aa11ac677cd161 | 3,948 | py | Python | src/core/settings.py | aminul91/tutorsitelinks | 990a48056fc148c34da32586677e6f56801a6ec8 | [
"MIT"
] | null | null | null | src/core/settings.py | aminul91/tutorsitelinks | 990a48056fc148c34da32586677e6f56801a6ec8 | [
"MIT"
] | null | null | null | src/core/settings.py | aminul91/tutorsitelinks | 990a48056fc148c34da32586677e6f56801a6ec8 | [
"MIT"
] | null | null | null | # flake8: noqa
"""
Django settings for core project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
... | 25.470968 | 91 | 0.694022 |
fa1523800c88d601543fc5cf43ab857484c45c2c | 7,179 | py | Python | framework/SupervisedLearning/ScikitLearn/DiscriminantAnalysis/LinearDiscriminantAnalysis.py | dylanjm/raven | 7262bc3564da08dbb7bd76892b6435d9ce48256b | [
"Apache-2.0"
] | 159 | 2017-03-24T21:07:06.000Z | 2022-03-20T13:44:40.000Z | framework/SupervisedLearning/ScikitLearn/DiscriminantAnalysis/LinearDiscriminantAnalysis.py | idaholab/raven | e989b5f0b14b0e6f0cde20c22f24b76c5136c3eb | [
"Apache-2.0"
] | 1,667 | 2017-03-27T14:41:22.000Z | 2022-03-31T19:50:06.000Z | framework/SupervisedLearning/ScikitLearn/DiscriminantAnalysis/LinearDiscriminantAnalysis.py | wanghy-anl/raven | ef1372364a2776385931763f2b28fdf2930c77b9 | [
"Apache-2.0"
] | 95 | 2017-03-24T21:05:03.000Z | 2022-03-08T17:30:22.000Z | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 63.530973 | 179 | 0.594512 |
daf0714eeeed6a3c655fafa2c6c20d37df278671 | 463 | py | Python | tests/local/unit/test_wheel_build.py | git-akihakune/pilapse | 2e2cb99e074b5b234c3d8816d421e3d24909e2e6 | [
"MIT"
] | null | null | null | tests/local/unit/test_wheel_build.py | git-akihakune/pilapse | 2e2cb99e074b5b234c3d8816d421e3d24909e2e6 | [
"MIT"
] | null | null | null | tests/local/unit/test_wheel_build.py | git-akihakune/pilapse | 2e2cb99e074b5b234c3d8816d421e3d24909e2e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import pytest
# to make sure this runs from root directory
def test_cwd():
currentPath = os.getcwd()
# Get the name of current directory only
currentDir = currentPath[currentPath.rfind('/') + 1:]
if currentDir != "pilapse" or "pilapse" not in os.listdir(currentPath)... | 24.368421 | 76 | 0.693305 |
216e766df7da67e48f71ad2560a0e4cdc2c370cc | 4,990 | py | Python | src/nonogram_solver/basic/brute_force.py | MikeJongen/nonogram-solver | b174fe6c693c1ace3918bf19a9110165a5b42db9 | [
"MIT"
] | null | null | null | src/nonogram_solver/basic/brute_force.py | MikeJongen/nonogram-solver | b174fe6c693c1ace3918bf19a9110165a5b42db9 | [
"MIT"
] | null | null | null | src/nonogram_solver/basic/brute_force.py | MikeJongen/nonogram-solver | b174fe6c693c1ace3918bf19a9110165a5b42db9 | [
"MIT"
] | null | null | null | from nonogram_solver.nonogram import Nonogram
from nonogram_solver.nonogram import Row
class BruteForceSolver(Nonogram):
"""Brute force solver class
Performance heavy algorithm, use as last option
"""
def init_row_solvers(self):
Nonogram.init_row_solvers(self, BruteForceRowSolver)
def s... | 34.652778 | 100 | 0.586774 |
1019383b057620d33ef417d50a60b8ce8e88bd00 | 20,498 | py | Python | outliers_removal/pcpnet.py | GiladGH/pointcleannet | 1c7f8f00c2062923063de2f796d96e444476d698 | [
"MIT"
] | 1 | 2019-09-30T03:33:47.000Z | 2019-09-30T03:33:47.000Z | outliers_removal/pcpnet.py | GiladGH/pointcleannet | 1c7f8f00c2062923063de2f796d96e444476d698 | [
"MIT"
] | null | null | null | outliers_removal/pcpnet.py | GiladGH/pointcleannet | 1c7f8f00c2062923063de2f796d96e444476d698 | [
"MIT"
] | null | null | null | from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import torch.nn.functional as F
from torch.autograd import Variable
import utils
class STN(nn.Module):
def __init__(self, num_scales=1, num_points=500, dim=3, sym_op='max', ... | 36.024605 | 164 | 0.566787 |
cfdca9eeff45a0cc70269cc98e6f871e00b82ddc | 15,874 | py | Python | source/editableText.py | masakotoda/nvda | d520713211e070c66ab0debe14b229036183fa57 | [
"bzip2-1.0.6"
] | null | null | null | source/editableText.py | masakotoda/nvda | d520713211e070c66ab0debe14b229036183fa57 | [
"bzip2-1.0.6"
] | null | null | null | source/editableText.py | masakotoda/nvda | d520713211e070c66ab0debe14b229036183fa57 | [
"bzip2-1.0.6"
] | null | null | null | # A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2006-2020 NV Access Limited, Davy Kager, Julien Cochuyt
"""Common support for editable text.
@note: If you want editable text functionality for an NVDAObj... | 39.784461 | 193 | 0.757087 |
695bac40efdd66a920e3a86c6a860e5f7a992972 | 13,445 | py | Python | lib/python2.7/site-packages/django/utils/unittest/loader.py | bop/bauhaus | 16678396ea7e3f95228e7419c6dcd127ff45a80a | [
"MIT"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | lib/python2.7/site-packages/django/utils/unittest/loader.py | bop/bauhaus | 16678396ea7e3f95228e7419c6dcd127ff45a80a | [
"MIT"
] | 18 | 2015-01-14T07:51:48.000Z | 2021-10-14T01:19:26.000Z | lib/python2.7/site-packages/django/utils/unittest/loader.py | bop/bauhaus | 16678396ea7e3f95228e7419c6dcd127ff45a80a | [
"MIT"
] | 70 | 2015-01-01T00:33:24.000Z | 2021-12-10T03:43:07.000Z | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import unittest
from fnmatch import fnmatch
from django.utils.unittest import case, suite
try:
from os.path import relpath
except ImportError:
from django.utils.unittest.compatibility import relpath
__unittest = True
de... | 41.625387 | 123 | 0.615917 |
0269ec229888e8d187c57f2734f0007c4243b429 | 4,851 | py | Python | caffe2/python/predictor/mobile_exporter_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | caffe2/python/predictor/mobile_exporter_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | caffe2/python/predictor/mobile_exporter_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z |
from caffe2.python.test_util import TestCase
from caffe2.python import workspace, brew
from caffe2.python.model_helper import ModelHelper
from caffe2.python.predictor import mobile_exporter
import numpy as np
class TestMobileExporter(TestCase):
def test_mobile_exporter(self):
model = ModelHelper(name=... | 36.473684 | 88 | 0.647702 |
e1b6df234f6ddc8ec1db0e6a9d4a332bcd2e7294 | 248 | py | Python | ad2web/api/constants.py | billfor/alarmdecoder-webapp | 43c3ebb2b44c7291cd89a2a7a31bbdfdb3ec06dc | [
"BSD-3-Clause",
"MIT"
] | 46 | 2015-06-14T02:19:16.000Z | 2022-03-24T03:11:19.000Z | ad2web/api/constants.py | billfor/alarmdecoder-webapp | 43c3ebb2b44c7291cd89a2a7a31bbdfdb3ec06dc | [
"BSD-3-Clause",
"MIT"
] | 66 | 2015-03-14T16:30:43.000Z | 2021-08-28T22:20:01.000Z | ad2web/api/constants.py | billfor/alarmdecoder-webapp | 43c3ebb2b44c7291cd89a2a7a31bbdfdb3ec06dc | [
"BSD-3-Clause",
"MIT"
] | 44 | 2015-02-13T19:23:37.000Z | 2021-12-30T04:17:21.000Z | # -*- coding: utf-8 -*-
ERROR_NOT_AUTHORIZED = 7100
ERROR_DEVICE_NOT_INITIALIZED = 7101
ERROR_MISSING_BODY = 7102
ERROR_MISSING_FIELD = 7103
ERROR_INVALID_VALUE = 7104
ERROR_RECORD_ALREADY_EXISTS = 7105
ERROR_RECORD_DOES_NOT_EXIST = 7106
| 24.8 | 36 | 0.790323 |
4ceca657cf254b27abe1d86c70dd47a77bdef5c1 | 4,144 | py | Python | utils/animation.py | BaptisteLafoux/free_swim_illum_var | 9618611e0820c2d7ff2162aa603a47418db848ed | [
"MIT"
] | null | null | null | utils/animation.py | BaptisteLafoux/free_swim_illum_var | 9618611e0820c2d7ff2162aa603a47418db848ed | [
"MIT"
] | null | null | null | utils/animation.py | BaptisteLafoux/free_swim_illum_var | 9618611e0820c2d7ff2162aa603a47418db848ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 10 16:23:24 2022
@author: baptistelafoux
"""
from utils.loader import dataloader
from src.analysis import add_var_vs_time
from utils.graphic import set_matplotlib_config
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animatio... | 30.470588 | 178 | 0.634653 |
4d523df75776ecf740cd0753d2da7ca41897a00a | 4,549 | py | Python | experiments/steven-images/ddpg_image_classic_envs.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/steven-images/ddpg_image_classic_envs.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/steven-images/ddpg_image_classic_envs.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | import gym
import numpy as np
from railrl.torch.dqn.double_dqn import DoubleDQN
import railrl.misc.hyperparameter as hyp
import railrl.torch.pytorch_util as ptu
from railrl.launchers.launcher_util import run_experiment
from railrl.torch.dqn.dqn import DQN
from railrl.torch.networks import Mlp, CNN, CNNPolicy, MergedC... | 32.035211 | 76 | 0.626731 |
45fda5e63f86f3e2ddc4a4308196294dbe1c5c22 | 7,303 | py | Python | tests/unit/fs/test_dvc.py | itcarroll/dvc | 55219e9089005ac15d668ecf735aeaf31a771d0b | [
"Apache-2.0"
] | null | null | null | tests/unit/fs/test_dvc.py | itcarroll/dvc | 55219e9089005ac15d668ecf735aeaf31a771d0b | [
"Apache-2.0"
] | 41 | 2021-11-16T15:38:50.000Z | 2022-03-30T10:32:14.000Z | tests/unit/fs/test_dvc.py | jhhuh/dvc | fecc81e951efeaa8130264f726c27e92876422ae | [
"Apache-2.0"
] | null | null | null | import posixpath
import shutil
import pytest
from dvc.config import NoRemoteError
from dvc.data.stage import stage
from dvc.fs.dvc import DvcFileSystem
from dvc.hash_info import HashInfo
from dvc.utils.fs import remove
@pytest.mark.parametrize(
"path, key",
[
("", ("repo",)),
(".", ("repo",)... | 26.460145 | 79 | 0.589758 |
eec0ed13f084b81833274574db176fa41da94488 | 376 | py | Python | core/migrations/0006_referral_amount.py | adesiyanoladipo/django-referral-system | 7cc4b41338289ecff78f7a50c9eee4bd47986215 | [
"MIT"
] | 6 | 2020-09-03T20:05:00.000Z | 2021-07-02T11:49:46.000Z | core/migrations/0006_referral_amount.py | adesiyan-ifedayo/django-referral-system | 7cc4b41338289ecff78f7a50c9eee4bd47986215 | [
"MIT"
] | null | null | null | core/migrations/0006_referral_amount.py | adesiyan-ifedayo/django-referral-system | 7cc4b41338289ecff78f7a50c9eee4bd47986215 | [
"MIT"
] | 4 | 2020-09-03T10:52:20.000Z | 2021-01-13T16:13:45.000Z | # Generated by Django 2.2.14 on 2020-08-22 22:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_referral'),
]
operations = [
migrations.AddField(
model_name='referral',
name='amount',
fi... | 19.789474 | 52 | 0.582447 |
33692de4aa92ad907d21d251278fac217a6563a2 | 16,399 | py | Python | tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py | major/gapic-generator-python | 68515c4c1444875f151a971b595e9dc837ddf47c | [
"Apache-2.0"
] | null | null | null | tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py | major/gapic-generator-python | 68515c4c1444875f151a971b595e9dc837ddf47c | [
"Apache-2.0"
] | null | null | null | tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py | major/gapic-generator-python | 68515c4c1444875f151a971b595e9dc837ddf47c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 45.301105 | 89 | 0.630953 |
9fc4b5b8ed21eecf607780464e855b20a864a7ff | 5,038 | py | Python | generate_pairs.py | Rasoul20sh/InsightFace_TF | 06a177a3176660787f21f184728bdf6b553b25ae | [
"MIT"
] | 4 | 2019-04-01T03:52:20.000Z | 2019-11-12T21:15:05.000Z | generate_pairs.py | Rasoul20sh/InsightFace_TF | 06a177a3176660787f21f184728bdf6b553b25ae | [
"MIT"
] | null | null | null | generate_pairs.py | Rasoul20sh/InsightFace_TF | 06a177a3176660787f21f184728bdf6b553b25ae | [
"MIT"
] | 1 | 2021-01-06T06:58:49.000Z | 2021-01-06T06:58:49.000Z | #! encoding: utf-8
import os
import random
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
class GeneratePairs:
"""
Generate the pairs.txt file that is used for training face classifier when calling python `src/train_softmax.py`.
Or others' python scripts that needs the file of pairs.txt.
... | 41.295082 | 152 | 0.538706 |
5ba644e4db9f846ac9431f319b42557067365780 | 6,061 | py | Python | tests/test_caching.py | CyrilLeMat/modelkit | 2150ffe78ebb00e3302dac36ccb09e66becd5130 | [
"MIT"
] | null | null | null | tests/test_caching.py | CyrilLeMat/modelkit | 2150ffe78ebb00e3302dac36ccb09e66becd5130 | [
"MIT"
] | null | null | null | tests/test_caching.py | CyrilLeMat/modelkit | 2150ffe78ebb00e3302dac36ccb09e66becd5130 | [
"MIT"
] | null | null | null | import asyncio
import os
import subprocess
import time
from typing import List, Union
import pydantic
import pytest
import redis
from modelkit.core.library import ModelLibrary
from modelkit.core.model import AsyncModel, Model
from modelkit.utils.cache import NativeCache, RedisCache
from tests.conftest import skip_unl... | 26.937778 | 84 | 0.611615 |
8afc0121828113f030b2e97ae6578f563e7c54de | 4,337 | py | Python | barrel_reaktor/document_list/models.py | txtr/barrel-reaktor | 6d2dfb894bd449f91ede2c32e6a162664e59a971 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | barrel_reaktor/document_list/models.py | txtr/barrel-reaktor | 6d2dfb894bd449f91ede2c32e6a162664e59a971 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | barrel_reaktor/document_list/models.py | txtr/barrel-reaktor | 6d2dfb894bd449f91ede2c32e6a162664e59a971 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from barrel import Store, Field, DateField, IntField
from barrel.rpc import RpcMixin
class List(Store, RpcMixin):
interface = 'WSListMgmt'
tracked_fields = ["document_ids"]
id = Field(target='ID')
count = IntField(target='count')
creation_date = DateField(target='creationTime', default='')
d... | 40.157407 | 127 | 0.693798 |
1af5e75ca4b82b64a63cf48a03c64e112c258004 | 1,323 | py | Python | auth0/v3/authentication/users.py | santiagoroman/auth0-python | b88b056d0c68eb26a1171f33273010faf8fefe63 | [
"MIT"
] | null | null | null | auth0/v3/authentication/users.py | santiagoroman/auth0-python | b88b056d0c68eb26a1171f33273010faf8fefe63 | [
"MIT"
] | null | null | null | auth0/v3/authentication/users.py | santiagoroman/auth0-python | b88b056d0c68eb26a1171f33273010faf8fefe63 | [
"MIT"
] | null | null | null | from .base import AuthenticationBase
import warnings
class Users(AuthenticationBase):
"""Userinfo related endpoints.
Args:
domain (str): Your auth0 domain (e.g: username.auth0.com)
"""
def userinfo(self, access_token):
"""Returns the user information based on the Auth0 access token... | 27 | 93 | 0.602419 |
915bc1bd6a87d6184dec13eaf693f8936969b829 | 14,565 | py | Python | aleph/views/entitysets_api.py | davidknezic/aleph | e59c95b201313bbe40cd036f5d2aeb0f8b599639 | [
"MIT"
] | 1 | 2021-09-14T02:49:46.000Z | 2021-09-14T02:49:46.000Z | aleph/views/entitysets_api.py | houston1784/aleph | a73543c2d4334c9476042c49d7147f70c2be5f4e | [
"MIT"
] | 319 | 2021-04-30T01:09:57.000Z | 2022-03-30T01:15:19.000Z | aleph/views/entitysets_api.py | houston1784/aleph | a73543c2d4334c9476042c49d7147f70c2be5f4e | [
"MIT"
] | null | null | null | import logging
from banal import ensure_list
from flask_babel import gettext
from flask import Blueprint, request, redirect
from werkzeug.exceptions import NotFound, BadRequest
from aleph.core import db, url_for
from aleph.model import EntitySet, Judgement
from aleph.model.common import make_textid
from aleph.logic.en... | 32.366667 | 87 | 0.630965 |
bb95c1bf03d0530f9698fdc69fa1abfe494d274e | 1,534 | py | Python | setup.py | kota7/wordleai-sql | c99ec44d4d9fc5d621764c460d4f23fffbfb919b | [
"MIT"
] | null | null | null | setup.py | kota7/wordleai-sql | c99ec44d4d9fc5d621764c460d4f23fffbfb919b | [
"MIT"
] | 2 | 2022-03-08T22:36:26.000Z | 2022-03-21T23:21:37.000Z | setup.py | kota7/wordleai-sql | c99ec44d4d9fc5d621764c460d4f23fffbfb919b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
readmefile = os.path.join(os.path.dirname(__file__), "README.md")
with open(readmefile) as f:
readme = f.read()
from wordleaisql import __version__
setup(
name='wordleaisql',
version=__version__,
description='Wordle AI with... | 34.088889 | 79 | 0.627119 |
3360cb8419476e9adce7a1e1c2fdf721b9739b2f | 4,011 | py | Python | crits/services/analysis_result.py | thelandy/crits | e8d72d8e3cb278d6e86215ba2bb567a874c66edd | [
"MIT"
] | 22 | 2015-01-14T19:49:32.000Z | 2022-01-26T12:18:52.000Z | crits/services/analysis_result.py | thelandy/crits | e8d72d8e3cb278d6e86215ba2bb567a874c66edd | [
"MIT"
] | null | null | null | crits/services/analysis_result.py | thelandy/crits | e8d72d8e3cb278d6e86215ba2bb567a874c66edd | [
"MIT"
] | 6 | 2015-01-22T21:25:52.000Z | 2021-04-12T23:24:14.000Z | from django.conf import settings
from mongoengine import Document, StringField, ListField, EmbeddedDocument
from mongoengine import DynamicEmbeddedDocument, DynamicField, UUIDField
from mongoengine import DictField, EmbeddedDocumentField, BooleanField
from crits.core.crits_mongoengine import CritsDocument, CritsSchema... | 40.928571 | 86 | 0.566442 |
48cdee0e6669124e2604444a05adf9a5a7c6e61d | 2,231 | py | Python | 3d/dambreak/dissipation_p.py | AntoninoScala/air-water-vv | 06b6579cc308795dc56acfd30873747f74231589 | [
"MIT"
] | 5 | 2017-11-15T16:18:47.000Z | 2021-07-18T02:32:48.000Z | 3d/dambreak/dissipation_p.py | AntoninoScala/air-water-vv | 06b6579cc308795dc56acfd30873747f74231589 | [
"MIT"
] | 41 | 2015-06-03T17:53:17.000Z | 2017-07-26T09:15:07.000Z | 3d/dambreak/dissipation_p.py | AntoninoScala/air-water-vv | 06b6579cc308795dc56acfd30873747f74231589 | [
"MIT"
] | 21 | 2017-10-27T14:37:54.000Z | 2020-02-10T10:31:36.000Z | from proteus import *
from proteus.default_p import *
from dambreak import *
from proteus.mprans import Dissipation
LevelModelType = Dissipation.LevelModel
if useOnlyVF:
RD_model = None
LS_model = None
dissipation_model = 3
ME_model = 2
else:
RD_model = 3
LS_model = 2
ME_model = 6
kappa... | 30.561644 | 133 | 0.626625 |
415a5cc7a1806808ea28f0beca4c61c0f0f2edb8 | 20,006 | py | Python | glib-2.64.0/gio/gdbus-2.0/codegen/dbustypes.py | BeanGreen247/surf | a56d1b0ceb43c578c6a3258e4ffb2903dc691fe2 | [
"MIT"
] | null | null | null | glib-2.64.0/gio/gdbus-2.0/codegen/dbustypes.py | BeanGreen247/surf | a56d1b0ceb43c578c6a3258e4ffb2903dc691fe2 | [
"MIT"
] | null | null | null | glib-2.64.0/gio/gdbus-2.0/codegen/dbustypes.py | BeanGreen247/surf | a56d1b0ceb43c578c6a3258e4ffb2903dc691fe2 | [
"MIT"
] | null | null | null | # -*- Mode: Python -*-
# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2011 Red Hat, Inc.
#
# 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, or (a... | 41.592516 | 127 | 0.561881 |
24a78472538332cf4aad227ed722b3a37f8e4f8b | 2,491 | py | Python | pptree/utils.py | srianbury/pptree | a0c00f5b14c10d2b174d2acd9542c4955832ce3a | [
"MIT"
] | 119 | 2016-12-07T12:38:08.000Z | 2022-03-31T11:40:36.000Z | pptree/utils.py | srianbury/pptree | a0c00f5b14c10d2b174d2acd9542c4955832ce3a | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/pptree/utils.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 26 | 2017-03-08T22:56:01.000Z | 2022-01-10T17:35:49.000Z | # -*- coding: utf-8 -*-
"""
Ettore Forigo (c) 2020
"""
from itertools import chain, zip_longest, repeat
JOINER_WIDTH = 3
DEFAULT_JOINER = ' ' * JOINER_WIDTH
CONNECTION_JOINER = '─' * JOINER_WIDTH
L_BRANCH_CONNECTOR = '─┘ '
LR_BRANCH_CONNECTOR = '─┴─'
R_BRANCH_CONNECTOR = ' └─'
L_NODE_CONNECTOR = '─┐ '
LR_NODE_CONNECT... | 23.951923 | 99 | 0.620233 |
bf5c55267bb4400544370d6da1b17540d00a38b0 | 1,176 | py | Python | setup.py | redotics/dataplug | 47d7e54472aa84b3655ab1f29cdf6ad56672123a | [
"MIT"
] | 1 | 2021-02-25T19:52:41.000Z | 2021-02-25T19:52:41.000Z | setup.py | redotics/dataplug | 47d7e54472aa84b3655ab1f29cdf6ad56672123a | [
"MIT"
] | null | null | null | setup.py | redotics/dataplug | 47d7e54472aa84b3655ab1f29cdf6ad56672123a | [
"MIT"
] | null | null | null | """ dataplug setuptools-based setup.
Created thanks to:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description fr... | 29.4 | 83 | 0.677721 |
a09e1e326cc63beb6fd10ccaffb4970ec4cf61e1 | 1,038 | py | Python | bin/bx_summary.py | fargenfo/fargen-ngs | 95eee917c5ed48a4be581978481bb3dbbb906f7f | [
"MIT"
] | null | null | null | bin/bx_summary.py | fargenfo/fargen-ngs | 95eee917c5ed48a4be581978481bb3dbbb906f7f | [
"MIT"
] | null | null | null | bin/bx_summary.py | fargenfo/fargen-ngs | 95eee917c5ed48a4be581978481bb3dbbb906f7f | [
"MIT"
] | 1 | 2020-10-06T09:46:35.000Z | 2020-10-06T09:46:35.000Z | #!/usr/bin/env python3
'''
Summarize output from `bxtools stats` (https://github.com/walaj/bxtools).
'''
import sys
import numpy as np
csv = sys.argv[1]
bx_counts = []
with open(csv) as fid:
# Discard the header.
temp = fid.readline()
for line in fid:
# Split the tab separated line into fields, a... | 25.95 | 128 | 0.683044 |
5895edce03597f857784e27379e6f4ec9daae108 | 3,496 | py | Python | test/test_grammar.py | Bhaskers-Blu-Org1/lale | 6d3a361ccf2377027fba84a15d0ec38ba285ff4c | [
"Apache-2.0"
] | null | null | null | test/test_grammar.py | Bhaskers-Blu-Org1/lale | 6d3a361ccf2377027fba84a15d0ec38ba285ff4c | [
"Apache-2.0"
] | null | null | null | test/test_grammar.py | Bhaskers-Blu-Org1/lale | 6d3a361ccf2377027fba84a15d0ec38ba285ff4c | [
"Apache-2.0"
] | 1 | 2020-07-30T10:06:23.000Z | 2020-07-30T10:06:23.000Z | import unittest
from lale.grammar import Grammar
from lale.operators import make_choice, PlannedOperator, PlannedPipeline, TrainedOperator
from lale import wrap_imported_operators
from lale.lib.sklearn import LogisticRegression as LR
from lale.lib.sklearn import KNeighborsClassifier as KNN
from lale.lib.sklearn import... | 38 | 95 | 0.633867 |
035362791c6953f713e69255df3ad691b33f55e6 | 2,953 | py | Python | gpytorch/kernels/cosine_kernel.py | konstantinklemmer/gpytorch | f1d947b340a188c398b6c6e610b6a839c61aa298 | [
"MIT"
] | 2 | 2019-03-31T04:36:30.000Z | 2019-05-22T20:09:25.000Z | gpytorch/kernels/cosine_kernel.py | konstantinklemmer/gpytorch | f1d947b340a188c398b6c6e610b6a839c61aa298 | [
"MIT"
] | null | null | null | gpytorch/kernels/cosine_kernel.py | konstantinklemmer/gpytorch | f1d947b340a188c398b6c6e610b6a839c61aa298 | [
"MIT"
] | 1 | 2019-02-15T17:05:42.000Z | 2019-02-15T17:05:42.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
import torch
from .kernel import Kernel
class CosineKernel(Kernel):
r"""
Computes a covariance matrix based on the cosine kernel
between inputs ... | 38.855263 | 101 | 0.635963 |
958272b5914d2f3cdcdea5812001aa2709a8649a | 4,803 | py | Python | hk_ros_2021/scripts/animal_location_test.py | nmaatta/hk_ros_2021 | 3da25e961b5c9bffd5d8af7a9e10b99967c9e78b | [
"MIT"
] | 2 | 2021-02-15T12:36:41.000Z | 2021-02-15T16:52:16.000Z | hk_ros_2021/scripts/animal_location_test.py | nmaatta/hk_ros_2021 | 3da25e961b5c9bffd5d8af7a9e10b99967c9e78b | [
"MIT"
] | null | null | null | hk_ros_2021/scripts/animal_location_test.py | nmaatta/hk_ros_2021 | 3da25e961b5c9bffd5d8af7a9e10b99967c9e78b | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import math
import rospy
import tf
import tf2_ros
from sensor_msgs.msg import LaserScan
from darknet_ros_msgs.msg import BoundingBox #msg that contains bounding box coordinates
from darknet_ros_msgs.msg import BoundingBoxes
from apriltag_ros.msg import animalpixels
from std_msgs.msg import Strin... | 29.832298 | 127 | 0.62919 |
62fb4373ddf9e9ccfab4f63b3f159b1526df11cf | 1,457 | py | Python | app/views.py | Cgunter1/Tuition_Hike | 96a5ef105e009112099dd7e78ad19cfb70f41f2e | [
"WTFPL"
] | 1 | 2016-11-23T00:29:40.000Z | 2016-11-23T00:29:40.000Z | app/views.py | Cgunter1/Tuition_Hike | 96a5ef105e009112099dd7e78ad19cfb70f41f2e | [
"WTFPL"
] | null | null | null | app/views.py | Cgunter1/Tuition_Hike | 96a5ef105e009112099dd7e78ad19cfb70f41f2e | [
"WTFPL"
] | null | null | null | from django.shortcuts import render, HttpResponse
from app.forms import ContactForm
from django.core.mail import EmailMessage
from django.shortcuts import redirect
from django.template import Context
from django.template.loader import get_template
def index1(request):
form_class = ContactForm
# new logic!
... | 30.354167 | 60 | 0.548387 |
ecdd49373967ba8e960300b4f867a7facc8571a6 | 238 | py | Python | accounts/admin.py | felixyin/website | 4377eb9cc48ca99b8e9f802a5b42c128f805e3f5 | [
"MIT"
] | null | null | null | accounts/admin.py | felixyin/website | 4377eb9cc48ca99b8e9f802a5b42c128f805e3f5 | [
"MIT"
] | 21 | 2020-02-11T23:08:59.000Z | 2022-03-11T23:28:24.000Z | accounts/admin.py | felixyin/website | 4377eb9cc48ca99b8e9f802a5b42c128f805e3f5 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
class BlogUserAdmin(admin.ModelAdmin):
list_display = ('id', 'nickname', 'username', 'email', 'last_login', 'date_joined')
list_display_links = ('id', 'username')
| 21.636364 | 87 | 0.701681 |
d4bcce85876e436a65d97c2394bdf0d3c6aa68aa | 3,011 | py | Python | catalog/migrations/0001_initial.py | 3Cement/django_local_library | e9eb48e2b6b3ec835f98770fdf3100bf6477e9a7 | [
"MIT"
] | null | null | null | catalog/migrations/0001_initial.py | 3Cement/django_local_library | e9eb48e2b6b3ec835f98770fdf3100bf6477e9a7 | [
"MIT"
] | null | null | null | catalog/migrations/0001_initial.py | 3Cement/django_local_library | e9eb48e2b6b3ec835f98770fdf3100bf6477e9a7 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-05 12:33
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
... | 46.323077 | 205 | 0.564596 |
ff1843e7a24b23bb42364e5287e7ae8546c8b6a5 | 3,201 | py | Python | sarc.py | comex/smash-stuff | 4b659d0810fa5f042d76adab0a664aa3c60b1ec3 | [
"BSD-Source-Code"
] | 7 | 2015-01-10T12:46:52.000Z | 2022-02-18T09:50:00.000Z | sarc.py | shinyquagsire23/smash-stuff | 198ae035f089ec4dcc688689e9863fe9729b6f1c | [
"BSD-Source-Code"
] | 3 | 2015-02-10T06:52:32.000Z | 2015-12-23T17:31:28.000Z | sarc.py | shinyquagsire23/smash-stuff | 198ae035f089ec4dcc688689e9863fe9729b6f1c | [
"BSD-Source-Code"
] | 7 | 2015-01-23T00:17:21.000Z | 2021-01-27T12:20:07.000Z | # {enemy,fighter,assistpokemon/item_,stage}
import sys, struct, zlib, subprocess, os
print 'Getting strings...'
outdir = sys.argv[3]
if not os.path.exists(outdir):
os.mkdir(outdir)
strs = subprocess.check_output(['strings', '-', sys.argv[2]]).rstrip().split('\n')
by_crc = {}
def try_crc(str):
crc = zlib.crc32(s... | 65.326531 | 1,258 | 0.728522 |
a12bcd00fa74fdf120696d53926a1c3e75724586 | 4,598 | py | Python | copy_files_from_g_drive.py | tslima/copy-files-from-g-drive | d12cf6eca1fb4e4ac8b65404a71c3560f72d60ef | [
"MIT"
] | null | null | null | copy_files_from_g_drive.py | tslima/copy-files-from-g-drive | d12cf6eca1fb4e4ac8b65404a71c3560f72d60ef | [
"MIT"
] | null | null | null | copy_files_from_g_drive.py | tslima/copy-files-from-g-drive | d12cf6eca1fb4e4ac8b65404a71c3560f72d60ef | [
"MIT"
] | null | null | null | from __future__ import print_function
import io
import os.path
import sys
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError... | 35.369231 | 150 | 0.609395 |
ace171563a46090d2e375e9a54aabefe7975a56b | 11,445 | py | Python | sarnet_td3/trainer/comm_trainer_reinforce.py | JingdiC/SARNet | 05d668c2d1c0d3f8009ecb98ab33cd5a496cd4ea | [
"MIT"
] | null | null | null | sarnet_td3/trainer/comm_trainer_reinforce.py | JingdiC/SARNet | 05d668c2d1c0d3f8009ecb98ab33cd5a496cd4ea | [
"MIT"
] | null | null | null | sarnet_td3/trainer/comm_trainer_reinforce.py | JingdiC/SARNet | 05d668c2d1c0d3f8009ecb98ab33cd5a496cd4ea | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import sarnet_td3.common.tf_util as U
import sarnet_td3.common.buffer_util_td3 as butil
from sarnet_td3 import MAgentTrainer
from sarnet_td3.common.distributions import make_pdtype
def discount_with_dones(rewards, dones, gamma):
discounted = []
r = 0
for reward,... | 46.149194 | 201 | 0.635387 |
5970225fbb4ec9b01744c2c869bd1ea6f4500d6c | 16,208 | py | Python | boto/cloudformation/connection.py | adastreamer/boto | ce472cbbcffd06298fdd0c980d5bfcdcee875498 | [
"MIT"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | boto/cloudformation/connection.py | adastreamer/boto | ce472cbbcffd06298fdd0c980d5bfcdcee875498 | [
"MIT"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | boto/cloudformation/connection.py | adastreamer/boto | ce472cbbcffd06298fdd0c980d5bfcdcee875498 | [
"MIT"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | 43.687332 | 85 | 0.629257 |
b260c02957e08ea4decfa8ceef3682216d516cf7 | 1,433 | py | Python | creme/optim/vanilla_sgd.py | sroecker/creme | 9ae8d994e1ce74f760bb95c0e5569774bf19839a | [
"BSD-3-Clause"
] | null | null | null | creme/optim/vanilla_sgd.py | sroecker/creme | 9ae8d994e1ce74f760bb95c0e5569774bf19839a | [
"BSD-3-Clause"
] | null | null | null | creme/optim/vanilla_sgd.py | sroecker/creme | 9ae8d994e1ce74f760bb95c0e5569774bf19839a | [
"BSD-3-Clause"
] | 2 | 2021-06-20T09:29:38.000Z | 2021-06-23T07:47:21.000Z | from . import base
__all__ = ['VanillaSGD']
class VanillaSGD(base.Optimizer):
"""Plain stochastic gradient descent.
Example:
::
>>> from creme import compose
>>> from creme import linear_model
>>> from creme import metrics
>>> from creme import mode... | 27.557692 | 128 | 0.542917 |
9d2435a2d8349e6648af9e995082f53bf67a525f | 831 | py | Python | 01.py | hezhao/adventofcode2021 | f197efcf492019512b3844984981cc28d8881aae | [
"MIT"
] | null | null | null | 01.py | hezhao/adventofcode2021 | f197efcf492019512b3844984981cc28d8881aae | [
"MIT"
] | null | null | null | 01.py | hezhao/adventofcode2021 | f197efcf492019512b3844984981cc28d8881aae | [
"MIT"
] | null | null | null | #
# https://adventofcode.com/2021/day/1
# Advent of Code 2021
#
# Created on 2021-12-04.
#
import heapq
import math
from collections import defaultdict, deque
from itertools import combinations, permutations
from typing import List, Set, Dict, Tuple, Optional
class Solution:
def part1(self, nums: List[int]) -... | 21.307692 | 51 | 0.54633 |
c9c4a02d169b932474f89802353308e9399bcd4f | 5,504 | py | Python | garminworkouts/__main__.py | darkzbaron/garmin-workouts | f5b40af5491912b63baddfe515a3393e7c1ea452 | [
"Apache-2.0"
] | null | null | null | garminworkouts/__main__.py | darkzbaron/garmin-workouts | f5b40af5491912b63baddfe515a3393e7c1ea452 | [
"Apache-2.0"
] | null | null | null | garminworkouts/__main__.py | darkzbaron/garmin-workouts | f5b40af5491912b63baddfe515a3393e7c1ea452 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import glob
import logging
import os
from garminworkouts.config import configreader
from garminworkouts.garmin.garminclient import GarminClient
from garminworkouts.models.workout import Workout
from garminworkouts.utils.validators import writeable_dir
def command_import(args)... | 44.387097 | 149 | 0.733648 |
3090aef5252858641961d0d181f8fce682f7d357 | 2,164 | py | Python | main.py | superatomic/spider | 8c171103da0c4f3e37dce85516dea135a7222700 | [
"MIT"
] | null | null | null | main.py | superatomic/spider | 8c171103da0c4f3e37dce85516dea135a7222700 | [
"MIT"
] | null | null | null | main.py | superatomic/spider | 8c171103da0c4f3e37dce85516dea135a7222700 | [
"MIT"
] | null | null | null | """
Draws a spider using tkinter (via turtle).
"""
__author__ = 'Ethan Kinnear (https://github.com/superatomic)'
import turtle
from math import tau # 0.5 * tau = pi (https://tauday.com/tau-manifesto)
# The main scaling constant. If you want to make the spider bigger or smaller, change this.
SCALE = 20
# Spider pro... | 25.162791 | 98 | 0.649723 |
a10a9df4571f7d37edccb3fe30645bee020839b6 | 511 | py | Python | handlers/raw_idle.py | atas98/telegram-reddit-bot | e021533cb8acaa439ed57dc7e20e1b5a04970af8 | [
"MIT"
] | 4 | 2021-03-25T09:10:04.000Z | 2021-09-25T07:04:30.000Z | handlers/raw_idle.py | atas98/telegram-reddit-bot | e021533cb8acaa439ed57dc7e20e1b5a04970af8 | [
"MIT"
] | 2 | 2022-01-10T14:12:31.000Z | 2022-01-12T22:56:12.000Z | handlers/raw_idle.py | atas98/telegram-reddit-bot | e021533cb8acaa439ed57dc7e20e1b5a04970af8 | [
"MIT"
] | 1 | 2021-12-18T08:28:34.000Z | 2021-12-18T08:28:34.000Z | import re
import logging
from aiogram import types
from aiogram.dispatcher import FSMContext
from misc import reddit
from .type_handlers import type_handlers
async def raw_idle(message: types.Message, state: FSMContext):
try:
urls = re.findall(r"(https?://[^\s]+)", message.text)
for url in urls:
... | 28.388889 | 64 | 0.686888 |
ca24c70d715b2a76ce1e57e32671965a138e2f4e | 154 | py | Python | virtual/bin/django-admin.py | Julia-Agasaro/award | cd25d62e646847dfc8429c2f3abfaa93927be1b5 | [
"MIT"
] | null | null | null | virtual/bin/django-admin.py | Julia-Agasaro/award | cd25d62e646847dfc8429c2f3abfaa93927be1b5 | [
"MIT"
] | 3 | 2020-06-05T23:54:06.000Z | 2021-06-10T22:09:40.000Z | virtual/bin/django-admin.py | Julia-Agasaro/award | cd25d62e646847dfc8429c2f3abfaa93927be1b5 | [
"MIT"
] | null | null | null | #!/home/wecode/Desktop/award/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 25.666667 | 47 | 0.785714 |
a2f3a9c9013dee8a504929f8f15674c4e19ee0a5 | 2,321 | py | Python | hw2/pymoo/util/misc.py | yyb1995/software_technology_project | 4b5d9bf04a744b220e0b931917372f32d5bbfcfb | [
"Apache-2.0"
] | null | null | null | hw2/pymoo/util/misc.py | yyb1995/software_technology_project | 4b5d9bf04a744b220e0b931917372f32d5bbfcfb | [
"Apache-2.0"
] | null | null | null | hw2/pymoo/util/misc.py | yyb1995/software_technology_project | 4b5d9bf04a744b220e0b931917372f32d5bbfcfb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy
def swap(M, a, b):
tmp = M[a]
M[a] = M[b]
M[b] = tmp
# repairs a numpy array to be in bounds
def repair(X, xl, xu):
larger_than_xu = X[0, :] > xu
X[0, larger_than_xu] = xu[larger_than_xu]
smaller_than_xl = X[0, :] < xl
X[0, smaller_than_xl] = xl[smaller_t... | 22.754902 | 74 | 0.547178 |
38a1941720be0100057d14a6a4a9b038f08cc2e4 | 306 | py | Python | src/jt/jpype/JClassUtil.py | karpierz/jtypes.jpype | 225b214757ef7f7e03c4569028906d8194e3345d | [
"Apache-2.0"
] | 5 | 2019-01-08T02:33:55.000Z | 2019-11-08T21:00:45.000Z | src/jt/jpype/JClassUtil.py | karpierz/jtypes.jpype | 225b214757ef7f7e03c4569028906d8194e3345d | [
"Apache-2.0"
] | 2 | 2018-06-29T15:46:34.000Z | 2020-11-15T01:01:10.000Z | src/jt/jpype/JClassUtil.py | karpierz/jtypes.jpype | 225b214757ef7f7e03c4569028906d8194e3345d | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2018 Adam Karpierz
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
def isInterface(t):
from ..jtypes._jclass import JavaObject
return (isinstance(t, type) and issubclass(t, JavaObject) and
t.__javaclass__.isInterface())
| 27.818182 | 65 | 0.722222 |
7287359755f68cce410c6cc4bba3da41c42f8003 | 6,311 | py | Python | solutions/2020/kws/day_12.py | kws/AdventOfCode | 8da337ece8a46d070185e1d81592745dae7f6744 | [
"MIT"
] | 1 | 2020-12-04T20:15:47.000Z | 2020-12-04T20:15:47.000Z | solutions/2020/kws/day_12.py | kws/AdventOfCode | 8da337ece8a46d070185e1d81592745dae7f6744 | [
"MIT"
] | 1 | 2020-12-02T08:31:35.000Z | 2020-12-02T20:24:34.000Z | solutions/2020/kws/day_12.py | kws/AdventOfCode | 8da337ece8a46d070185e1d81592745dae7f6744 | [
"MIT"
] | 3 | 2018-11-30T18:14:15.000Z | 2018-12-10T20:18:15.000Z | #!/usr/bin/env python
import argparse
import math
from collections import namedtuple
from time import sleep
Coordinates = namedtuple('Coordinates', 'x y')
class Ship:
def __init__(self, x, y, heading: int):
self.x = x
self.y = y
self.heading = heading
def __repr__(self):
x =... | 31.08867 | 114 | 0.61274 |
f1bb8bbe33cd1497496bf1ef8ce9f235e99a0e6c | 187 | py | Python | HackerRank Solutions/Python/Strings/Designer Door Mat.py | DevashishPathrabe/Competetive-Coding | 91049459359854b7834cbfb31415682600dc9c57 | [
"MIT"
] | null | null | null | HackerRank Solutions/Python/Strings/Designer Door Mat.py | DevashishPathrabe/Competetive-Coding | 91049459359854b7834cbfb31415682600dc9c57 | [
"MIT"
] | null | null | null | HackerRank Solutions/Python/Strings/Designer Door Mat.py | DevashishPathrabe/Competetive-Coding | 91049459359854b7834cbfb31415682600dc9c57 | [
"MIT"
] | null | null | null | N,M = map(int,str(input()).split())
for i in range(1,N,2):
print((i*".|.").center(M,'-'))
print("WELCOME".center(M,'-'))
for j in range(N-2,-1,-2):
print((j*".|.").center(M,'-'))
| 26.714286 | 35 | 0.508021 |
87983cada0ea3814a22544a2e8132cfcc6fa1cf5 | 3,682 | py | Python | configs/textdet/textsnake/textsnake_r50_fpn_unet_1200e_ctw1500.py | constanreedjohn/mmocr | 8f638f11fff56c5f4969a350c88ab013849b7fd4 | [
"Apache-2.0"
] | null | null | null | configs/textdet/textsnake/textsnake_r50_fpn_unet_1200e_ctw1500.py | constanreedjohn/mmocr | 8f638f11fff56c5f4969a350c88ab013849b7fd4 | [
"Apache-2.0"
] | null | null | null | configs/textdet/textsnake/textsnake_r50_fpn_unet_1200e_ctw1500.py | constanreedjohn/mmocr | 8f638f11fff56c5f4969a350c88ab013849b7fd4 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/schedules/schedule_1200e.py',
'../../_base_/default_runtime.py'
]
model = dict(
type='TextSnake',
backbone=dict(
type='mmdet.ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
norm_cfg=dict(type='BN', requ... | 31.741379 | 78 | 0.609723 |
1c2de10847f0ffbd5d32cfa1851e433c0275227d | 1,654 | py | Python | catalyst/utils/__init__.py | olgaiv39/catalyst | 005a123482b0340c599a58856f396355a76a7db5 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/__init__.py | olgaiv39/catalyst | 005a123482b0340c599a58856f396355a76a7db5 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/__init__.py | olgaiv39/catalyst | 005a123482b0340c599a58856f396355a76a7db5 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
from .argparse import args_are_not_none, boolean_flag
from .checkpoint import pack_checkpoint, unpack_checkpoint, \
save_checkpoint, load_checkpoint
from .compression import pack, pack_if_needed, unpack, unpack_if_needed
from .config import load_ordered_yaml, get_environment_vars, dump_environment, ... | 47.257143 | 80 | 0.819831 |
beb288e165bbc55181808beb613005d0dcde2006 | 34,315 | py | Python | biostar/recipes/auth.py | tangibleai/biostar-central | 8c1cce4d3d95d49071db8ec225aa88a66b0b3910 | [
"MIT"
] | 477 | 2015-01-01T00:18:54.000Z | 2022-03-21T10:29:29.000Z | biostar/recipes/auth.py | coreydipsy/biostar-central | 2b2f09199a6332877885ef54d9ac588ed0765770 | [
"MIT"
] | 247 | 2015-01-02T08:12:03.000Z | 2022-02-24T15:20:58.000Z | biostar/recipes/auth.py | coreydipsy/biostar-central | 2b2f09199a6332877885ef54d9ac588ed0765770 | [
"MIT"
] | 251 | 2015-01-01T16:05:57.000Z | 2022-03-25T21:32:44.000Z | import difflib
import logging
import uuid, copy, base64
import json
import base64
import io
import subprocess
import random
from mimetypes import guess_type
import mistune
import toml as hjson
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.storage import fallback
from ... | 29.354149 | 113 | 0.633659 |
3806b52a404327bd92f5250a2f976dc9be8c28a7 | 1,369 | py | Python | diabetes_csv_parser.py | odia101/Class4 | d1d2309d229eb7548210948a3c69f9d670483cff | [
"MIT"
] | null | null | null | diabetes_csv_parser.py | odia101/Class4 | d1d2309d229eb7548210948a3c69f9d670483cff | [
"MIT"
] | null | null | null | diabetes_csv_parser.py | odia101/Class4 | d1d2309d229eb7548210948a3c69f9d670483cff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import numpy as np
import pandas as pd
import csv
myfilename = "diabetes.tab.txt"
# This is Class4 Homework
with open(myfilename, 'r') as file_handle:
diabeteslist = []
next(file_handle) #Skips header row
for line in file_handle.readlines():
line_clean = line.replace(' ', ' '... | 27.38 | 98 | 0.734843 |
8ca7e2b084c1990273daf6a60252e2a75b7265a6 | 15,584 | py | Python | Experimental/BipedalWalker_v4.py | ProGamerCode/FitML | 3b44160bbf6c0587b8df198d3ceef10a42e2bfca | [
"MIT"
] | 171 | 2017-11-07T09:59:20.000Z | 2022-03-29T13:59:18.000Z | Experimental/BipedalWalker_v4.py | ProGamerCode/FitML | 3b44160bbf6c0587b8df198d3ceef10a42e2bfca | [
"MIT"
] | 1 | 2017-12-24T20:08:18.000Z | 2018-01-31T22:26:49.000Z | Experimental/BipedalWalker_v4.py | ProGamerCode/FitML | 3b44160bbf6c0587b8df198d3ceef10a42e2bfca | [
"MIT"
] | 44 | 2017-11-07T12:08:05.000Z | 2022-01-04T15:53:12.000Z | '''
BipedalWalker solution by Michel Aka
https://github.com/FitMachineLearning/FitML/
https://www.youtube.com/channel/UCi7_WxajoowBl4_9P0DhzzA/featured
Using Actor Critic
Note that I prefer the terms Action Predictor Network and Q/Reward Predictor network better
Starts to hope/run at 1000 episodes
Also navigates relie... | 36.32634 | 326 | 0.598948 |
b2eaeaecffd90a681013c334caaad60d04ad04ba | 200 | py | Python | October/Stone Game IV.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | October/Stone Game IV.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | October/Stone Game IV.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | class Solution:
def winnerSquareGame(self, n: int) -> bool:
dp = [0] * (n+1)
for i in range(1, n+1):
j = 1
while j * j <= i and not dp[i]:
dp[i] = dp[i-j*j]^1
j += 1
return dp[n]
| 20 | 44 | 0.51 |
7c30bf67640b3920cad947b610a7646956f307cb | 436 | py | Python | bucketlist/users/urls.py | junngo/bucket-list | e8bfc17b6ea6aa957711813dd54a1804cdbaa914 | [
"MIT"
] | null | null | null | bucketlist/users/urls.py | junngo/bucket-list | e8bfc17b6ea6aa957711813dd54a1804cdbaa914 | [
"MIT"
] | 2 | 2020-06-05T20:04:49.000Z | 2021-03-19T22:33:31.000Z | bucketlist/users/urls.py | junngo/bucket-list | e8bfc17b6ea6aa957711813dd54a1804cdbaa914 | [
"MIT"
] | null | null | null | from django.urls import path
from bucketlist.users.views import (
user_list_view,
user_redirect_view,
user_update_view,
user_detail_view,
)
app_name = "users"
urlpatterns = [
path("", view=user_list_view, name="list"),
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~up... | 25.647059 | 66 | 0.694954 |
abd6491abe99147c3490885c77d2a564220dfc73 | 25,621 | py | Python | src/commercetools/types/_shipping_method.py | mbarga/commercetools-python-sdk | 464b2ea2518bafe4e2694a723550e0041db1f4c9 | [
"MIT"
] | null | null | null | src/commercetools/types/_shipping_method.py | mbarga/commercetools-python-sdk | 464b2ea2518bafe4e2694a723550e0041db1f4c9 | [
"MIT"
] | 1 | 2019-07-15T07:27:06.000Z | 2019-07-15T07:27:06.000Z | src/commercetools/types/_shipping_method.py | mbarga/commercetools-python-sdk | 464b2ea2518bafe4e2694a723550e0041db1f4c9 | [
"MIT"
] | null | null | null | # DO NOT EDIT! This file is automatically generated
import datetime
import enum
import typing
from commercetools.types._abstract import _BaseType
from commercetools.types._common import (
BaseResource,
Reference,
ReferenceTypeId,
ResourceIdentifier,
)
if typing.TYPE_CHECKING:
from ._common import... | 35.09726 | 177 | 0.652082 |
f7b3ecac38a79cedfd8060a3dcba5e8e124a0110 | 16,532 | py | Python | python/plugin/figa_circ.py | NegriLuca/pigasus | d5057b771f81cfa05bb08ea4b0fd99088150cd7a | [
"MIT"
] | 1 | 2021-10-21T17:15:26.000Z | 2021-10-21T17:15:26.000Z | python/plugin/figa_circ.py | NegriLuca/pigasus | d5057b771f81cfa05bb08ea4b0fd99088150cd7a | [
"MIT"
] | null | null | null | python/plugin/figa_circ.py | NegriLuca/pigasus | d5057b771f81cfa05bb08ea4b0fd99088150cd7a | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
This module is intend to solve the matrix equation
sum_i=1^r Ax_i X Ay_i = F
Where Ay_i are circulant matrices
Ax_i is in general are band matrices
"""
import numpy as np
from scipy.linalg import circulant, inv
from scipy.sparse import csr_matrix, diags
from scipy.sparse.linalg... | 24.71151 | 82 | 0.461166 |
304c96b8ed50204a559f4564b73d74920c348703 | 80 | py | Python | tests/test_app.py | moroclash/python-github-actions | 1ce20b0c96df1bfb869cdbc95f39ab6e076befa8 | [
"MIT"
] | null | null | null | tests/test_app.py | moroclash/python-github-actions | 1ce20b0c96df1bfb869cdbc95f39ab6e076befa8 | [
"MIT"
] | null | null | null | tests/test_app.py | moroclash/python-github-actions | 1ce20b0c96df1bfb869cdbc95f39ab6e076befa8 | [
"MIT"
] | 1 | 2021-02-04T00:25:21.000Z | 2021-02-04T00:25:21.000Z | from app import index
def test_index():
assert index() == "Hello, World!"
| 13.333333 | 37 | 0.65 |
9ce3e018a549d9d8b3ccb160651a535c93916cab | 4,065 | py | Python | app/account/admin.py | rogeriopaulos/gep | e56fd0450bdb8f572e2e35cc59a74ab0f0b372e2 | [
"MIT"
] | null | null | null | app/account/admin.py | rogeriopaulos/gep | e56fd0450bdb8f572e2e35cc59a74ab0f0b372e2 | [
"MIT"
] | 2 | 2021-09-02T04:22:45.000Z | 2021-09-02T04:52:26.000Z | app/account/admin.py | rogeriopaulos/gep | e56fd0450bdb8f572e2e35cc59a74ab0f0b372e2 | [
"MIT"
] | 1 | 2021-09-15T02:16:38.000Z | 2021-09-15T02:16:38.000Z | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Permission, User
from .forms import UserAdminForm, UserAdmminCreationForm
from .models import Cargo, Orgao, Profile
class UserAdmin(BaseUserAdmin):
ad... | 30.111111 | 118 | 0.668635 |
65a8ac4a0e50d74ad8af4a972cc47d2e03a314a8 | 9,705 | py | Python | pypureclient/flasharray/FA_2_8/api/directory_quotas_api.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_8/api/directory_quotas_api.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_8/api/directory_quotas_api.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re
# pyth... | 56.424419 | 671 | 0.676146 |
42ae7aedf1965014385cd5a863721cee9a6ba23f | 3,243 | py | Python | tests/unit/test_sumgram.py | oduwsdl/sumgram | c584e7eba1fab7deac1489aefa3f48f1b0d3ab64 | [
"MIT"
] | 46 | 2019-09-09T16:05:24.000Z | 2022-03-17T08:45:28.000Z | tests/unit/test_sumgram.py | oduwsdl/sumgram | c584e7eba1fab7deac1489aefa3f48f1b0d3ab64 | [
"MIT"
] | 16 | 2019-08-28T23:48:35.000Z | 2022-02-27T22:48:31.000Z | tests/unit/test_sumgram.py | oduwsdl/sumgram | c584e7eba1fab7deac1489aefa3f48f1b0d3ab64 | [
"MIT"
] | 12 | 2019-08-28T21:54:12.000Z | 2022-02-08T20:44:14.000Z | import json
import unittest
from sumgram.sumgram import get_top_sumgrams
class TestSumgram(unittest.TestCase):
ngram = 2
def test_basic_script(self):
doc_lst = [
{'id': 0, 'text': 'The eye of Category 4 Hurricane Harvey is now over Aransas Bay. A station at Aransas Pass run by the Te... | 72.066667 | 468 | 0.690718 |
f05af08aff988cc7a33bed210526f1bafcdbf6a2 | 15,710 | py | Python | scripts/summarize_results.py | PMMAraujo/snappy | e9eedbb9d181e18de1d25aee60747ac4002e455b | [
"MIT"
] | null | null | null | scripts/summarize_results.py | PMMAraujo/snappy | e9eedbb9d181e18de1d25aee60747ac4002e455b | [
"MIT"
] | null | null | null | scripts/summarize_results.py | PMMAraujo/snappy | e9eedbb9d181e18de1d25aee60747ac4002e455b | [
"MIT"
] | 3 | 2019-06-19T12:32:13.000Z | 2022-02-22T12:19:19.000Z | import pandas as pd
import numpy as np
from collections import Counter
#from Bio import Phylo
from ete3 import Tree
def process_blast_recomb(name):
"""Extract results from sliding window BLAST
This function parses the results from the slidding window BLAST
('recblast_{id_of_the_fasta_sequence}.txt'), filt... | 40.385604 | 112 | 0.585169 |
570f3238510f64a7011fae167140ab2c0b26b64e | 22 | py | Python | message/__init__.py | khallaghi/sheltie | eacbc6304a46bfc6fce336193a0727e41434a9ee | [
"MIT"
] | null | null | null | message/__init__.py | khallaghi/sheltie | eacbc6304a46bfc6fce336193a0727e41434a9ee | [
"MIT"
] | null | null | null | message/__init__.py | khallaghi/sheltie | eacbc6304a46bfc6fce336193a0727e41434a9ee | [
"MIT"
] | null | null | null | from message import * | 22 | 22 | 0.772727 |
b6ff0b8a4bbed4a9cfd88e93a54551247d525553 | 8,485 | py | Python | Chemical Equation Balancer/equation.py | Potato-Developing/Reast | f055752c8cd9535d229f084a57031ff885e862b6 | [
"MIT"
] | 37 | 2017-10-29T23:50:08.000Z | 2022-02-27T06:08:41.000Z | Chemical Equation Balancer/equation.py | Potato-Developing/Reast | f055752c8cd9535d229f084a57031ff885e862b6 | [
"MIT"
] | null | null | null | Chemical Equation Balancer/equation.py | Potato-Developing/Reast | f055752c8cd9535d229f084a57031ff885e862b6 | [
"MIT"
] | 81 | 2017-11-08T19:24:11.000Z | 2022-02-20T01:29:50.000Z | from random import randint
from math import gcd
from functools import reduce
class Equation:
"""
A chemical equation
=== Attributes ===
@type left: list[dict]
@type right: list[dict]
"""
def __init__(self, equation):
"""
Initializes an Equation object
... | 40.023585 | 104 | 0.416618 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.