hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7974e7402d0685a8a886a4ac9031f5bc76a1bb3e | 1,766 | py | Python | src/main/python/systemds/operator/algorithm/builtin/scale.py | Shafaq-Siddiqi/systemml | eca11c6fe9cff88df2e1960caf1b0cff9bf2b2b6 | [
"Apache-2.0"
] | 108 | 2020-07-09T08:02:05.000Z | 2022-03-31T04:10:44.000Z | src/main/python/systemds/operator/algorithm/builtin/scale.py | ywcb00/systemds | 5cc523971854cdf4f22e6199987a86e213fae4e2 | [
"Apache-2.0"
] | 362 | 2020-06-25T17:24:19.000Z | 2022-03-29T07:37:55.000Z | src/main/python/systemds/operator/algorithm/builtin/scale.py | ywcb00/systemds | 5cc523971854cdf4f22e6199987a86e213fae4e2 | [
"Apache-2.0"
] | 128 | 2020-06-27T14:02:11.000Z | 2022-03-21T12:17:04.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 unde... | 35.32 | 89 | 0.679502 |
7974e7c5bb576b293064f9bfa30e9d22273a79fa | 13,250 | py | Python | examples/seq2seq/train.py | jheek/flax | f4986e5154aa46b28fb75281ef67318f4f7cc569 | [
"Apache-2.0"
] | null | null | null | examples/seq2seq/train.py | jheek/flax | f4986e5154aa46b28fb75281ef67318f4f7cc569 | [
"Apache-2.0"
] | null | null | null | examples/seq2seq/train.py | jheek/flax | f4986e5154aa46b28fb75281ef67318f4f7cc569 | [
"Apache-2.0"
] | 1 | 2020-04-06T14:50:58.000Z | 2020-04-06T14:50:58.000Z | # Lint as: python3
#
# Copyright 2020 The Flax 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 l... | 33.291457 | 80 | 0.686943 |
7974e7dbea6330d16584932f429f990dadbee8b3 | 18,130 | py | Python | k2/python/tests/ctc_loss_test.py | EmreOzkose/k2 | 818b138b33eabe440601df8910a2b97ac088594b | [
"Apache-2.0"
] | 491 | 2020-09-17T09:05:05.000Z | 2022-03-31T13:38:18.000Z | k2/python/tests/ctc_loss_test.py | EmreOzkose/k2 | 818b138b33eabe440601df8910a2b97ac088594b | [
"Apache-2.0"
] | 600 | 2020-09-17T13:55:06.000Z | 2022-03-30T23:23:40.000Z | k2/python/tests/ctc_loss_test.py | EmreOzkose/k2 | 818b138b33eabe440601df8910a2b97ac088594b | [
"Apache-2.0"
] | 121 | 2020-09-17T15:44:56.000Z | 2022-03-23T13:22:52.000Z | #!/usr/bin/env python3
#
# Copyright 2020 Xiaomi Corporation (authors: Fangjun Kuang)
#
# See ../../../LICENSE for clarification regarding multiple 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... | 40.559284 | 82 | 0.526806 |
7974e89d486699a95505852cb910ed66df472943 | 23,495 | py | Python | hlib/python/hlib/frontend/relay_parser.py | hecmay/heterocl | e91eb4841f09385f676615cd246642744d08dd7c | [
"Apache-2.0"
] | 5 | 2019-11-09T14:30:47.000Z | 2020-10-30T04:47:47.000Z | hlib/python/hlib/frontend/relay_parser.py | hecmay/heterocl | e91eb4841f09385f676615cd246642744d08dd7c | [
"Apache-2.0"
] | null | null | null | hlib/python/hlib/frontend/relay_parser.py | hecmay/heterocl | e91eb4841f09385f676615cd246642744d08dd7c | [
"Apache-2.0"
] | 2 | 2019-10-01T18:01:09.000Z | 2020-09-15T02:36:59.000Z | import tvm
import keras
import tvm.relay.frontend as relay_front
import numpy as np
import heterocl as hcl
import hlib
import re
from ..utils import *
from .relay_attr import _attrib, _convert_map
from tvm.relay.expr import Function, Var, Call, Let, If, Constant
from tvm.relay.expr import TupleGetItem, Tuple
from tvm.r... | 34.149709 | 91 | 0.510917 |
7974ea8cb5c684fce8c5d6611d6f16b5d3480125 | 1,628 | py | Python | backend/tests/email/test_email_api.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 8 | 2019-06-03T16:29:49.000Z | 2021-05-11T20:38:36.000Z | backend/tests/email/test_email_api.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 342 | 2019-01-15T19:13:58.000Z | 2020-03-24T16:38:13.000Z | backend/tests/email/test_email_api.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 5 | 2019-02-15T09:06:47.000Z | 2022-01-24T21:38:41.000Z | import json
from grant.email.models import EmailVerification
from grant.user.models import db
from mock import patch
from ..config import BaseUserConfig
from ..test_data import test_user
class TestEmailAPI(BaseUserConfig):
@patch('grant.email.send.send_email')
def create_user(self, mock_send_email):
... | 32.56 | 76 | 0.654791 |
7974eb0e9184f58a58ba329ecce87ea0bf2b48a1 | 4,141 | py | Python | examples/roberta/multiprocessing_bpe_encoder.py | violet-zct/fairseq-detect-hallucination | 7382452ed87cbdaa7080fc065e3efaea34d8a12b | [
"MIT"
] | 13 | 2021-06-08T21:07:12.000Z | 2022-02-28T16:47:10.000Z | examples/roberta/multiprocessing_bpe_encoder.py | violet-zct/fairseq-detect-hallucination | 7382452ed87cbdaa7080fc065e3efaea34d8a12b | [
"MIT"
] | 1 | 2021-12-28T13:04:23.000Z | 2022-03-19T17:39:57.000Z | examples/roberta/multiprocessing_bpe_encoder.py | violet-zct/fairseq-detect-hallucination | 7382452ed87cbdaa7080fc065e3efaea34d8a12b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import contextlib
import sys
from collections import Counter
from multiprocessing im... | 29.368794 | 94 | 0.588264 |
7974ebb2b6945f56fa859962f18a84d175d6ed83 | 2,800 | py | Python | myvenv/lib/python3.5/site-packages/sphinx/util/console.py | tuvapp/tuvappcom | 5ca2be19f4b0c86a1d4a9553711a4da9d3f32841 | [
"MIT"
] | 1 | 2020-07-10T03:38:08.000Z | 2020-07-10T03:38:08.000Z | myvenv/lib/python3.5/site-packages/sphinx/util/console.py | tuvapp/tuvappcom | 5ca2be19f4b0c86a1d4a9553711a4da9d3f32841 | [
"MIT"
] | 6 | 2020-06-05T18:44:19.000Z | 2022-01-13T00:48:56.000Z | myvenv/lib/python3.5/site-packages/sphinx/util/console.py | tuvapp/tuvappcom | 5ca2be19f4b0c86a1d4a9553711a4da9d3f32841 | [
"MIT"
] | 1 | 2016-08-24T01:08:34.000Z | 2016-08-24T01:08:34.000Z | # -*- coding: utf-8 -*-
"""
sphinx.util.console
~~~~~~~~~~~~~~~~~~~
Format colored console output.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import re
try:
# check if colorama is installed to support colo... | 22.580645 | 79 | 0.577143 |
7974ebe71ea731a26ca7df2a139458f1bafa31c3 | 18,045 | py | Python | examples/echo_wrapper_neural.py | ml4wireless/gr-echo | 4b7e627b644741c22cd77c787fc8aee373a46d6e | [
"MIT"
] | null | null | null | examples/echo_wrapper_neural.py | ml4wireless/gr-echo | 4b7e627b644741c22cd77c787fc8aee373a46d6e | [
"MIT"
] | null | null | null | examples/echo_wrapper_neural.py | ml4wireless/gr-echo | 4b7e627b644741c22cd77c787fc8aee373a46d6e | [
"MIT"
] | 2 | 2019-10-26T13:00:29.000Z | 2019-12-25T08:23:22.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Echo Wrapper Neural
# Generated: Wed Apr 17 00:29:53 2019
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.pl... | 49.168937 | 1,052 | 0.633029 |
7974ec166a56997d4a0f5f99635be756bce03299 | 408 | py | Python | packages/python/plotly/plotly/validators/layout/geo/_oceancolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/geo/_oceancolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/geo/_oceancolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class OceancolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="oceancolor", parent_name="layout.geo", **kwargs):
super(OceancolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | 34 | 85 | 0.678922 |
7974ec58c2ba97f5d567972f1bef8f53a9d3faa5 | 1,155 | py | Python | IntegerToRoman.py | sujitmandal/leetCode | b52bfd68cd93243765a94a190807f9b79ec4b4af | [
"MIT"
] | null | null | null | IntegerToRoman.py | sujitmandal/leetCode | b52bfd68cd93243765a94a190807f9b79ec4b4af | [
"MIT"
] | null | null | null | IntegerToRoman.py | sujitmandal/leetCode | b52bfd68cd93243765a94a190807f9b79ec4b4af | [
"MIT"
] | null | null | null | class Solution:
def intToRoman(self, num: int) -> str:
roman = ['I','V','X','L','C','D','M']
value = [1,5,10,50,100,500,1000]
romanList = []
for i in range(6, -1, -1):
if 4 <= num < 5:
romanList.append('IV')
num = num % 4
eli... | 21.388889 | 64 | 0.402597 |
7974ec71ba0bb40876140509b5107c86b1c6eab7 | 1,091 | py | Python | ros/src/twist_controller/yaw_controller.py | m-pushkar/CarND-Capstone | ceb8cf65c8754f5b3d74d49063d7c2284f896a0c | [
"MIT"
] | 1 | 2020-06-28T17:39:10.000Z | 2020-06-28T17:39:10.000Z | ros/src/twist_controller/yaw_controller.py | m-pushkar/Capstone | ceb8cf65c8754f5b3d74d49063d7c2284f896a0c | [
"MIT"
] | 7 | 2020-09-26T01:13:22.000Z | 2022-03-12T00:35:14.000Z | ros/src/twist_controller/yaw_controller.py | m-pushkar/CarND-Capstone | ceb8cf65c8754f5b3d74d49063d7c2284f896a0c | [
"MIT"
] | null | null | null | from math import atan
IS_DEBUG = True
class YawController(object):
def __init__(self, wheel_base, steer_ratio, min_speed, max_lat_accel, max_steer_angle):
self.wheel_base = wheel_base
self.steer_ratio = steer_ratio
self.min_speed = min_speed
self.max_lat_accel = max_lat_accel
... | 38.964286 | 127 | 0.712191 |
7974ed56078ddcc73ca66b69318f18ece3a4d98e | 4,936 | py | Python | NCBI_submission/create_tbl2asn_files.py | RemiAllio/MitoFinder_container | d925adf315a0455e685bc09c6fd86fbc7c335980 | [
"MIT"
] | null | null | null | NCBI_submission/create_tbl2asn_files.py | RemiAllio/MitoFinder_container | d925adf315a0455e685bc09c6fd86fbc7c335980 | [
"MIT"
] | null | null | null | NCBI_submission/create_tbl2asn_files.py | RemiAllio/MitoFinder_container | d925adf315a0455e685bc09c6fd86fbc7c335980 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#Version: 1.2
#Authors: Allio Remi & Schomaker-Bastos Alex
#ISEM - CNRS - LAMPADA - IBQM - UFRJ
'''
Copyright (c) 2019 Remi Allio - ISEM/CNRS & Alex Schomaker-Bastos - LAMPADA/UFRJ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentat... | 33.351351 | 185 | 0.67342 |
7974edd6f27a24d978eabe752a7e26f6c01003e5 | 1,073 | py | Python | main.py | vpetrigo/tls-mqtt | e37b73babb9a90e052bff783d2b599af3d450a2b | [
"MIT"
] | null | null | null | main.py | vpetrigo/tls-mqtt | e37b73babb9a90e052bff783d2b599af3d450a2b | [
"MIT"
] | null | null | null | main.py | vpetrigo/tls-mqtt | e37b73babb9a90e052bff783d2b599af3d450a2b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import paho.mqtt.client as mqtt
import os
# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
# Subscribing in on_connect() means that if we lose the connection and
... | 33.53125 | 79 | 0.748369 |
7974ee1b03751c764546692a518ad71aa5307252 | 972 | py | Python | from_cpython/Lib/test/test_dl.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | from_cpython/Lib/test/test_dl.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from_cpython/Lib/test/test_dl.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | # expected: fail
"""Test dlmodule.c
Roger E. Masse revised strategy by Barry Warsaw
"""
import unittest
from test.test_support import verbose, import_module
dl = import_module('dl', deprecated=True)
sharedlibs = [
('/usr/lib/libc.so', 'getpid'),
('/lib/libc.so.6', 'getpid'),
('/usr/bin/cygwin1.dll', 'g... | 24.3 | 70 | 0.52572 |
7974ee3f60fcf561fdeafa302735107b71a82437 | 916 | py | Python | bin/rdbox/k8s_response_helper.py | rdbox-intec/rdbox-middleware | e7469c68ba745187d1db5514494663a3593164df | [
"MIT"
] | 4 | 2019-04-25T06:30:18.000Z | 2020-03-21T05:46:38.000Z | bin/rdbox/k8s_response_helper.py | fukuta-tatsuya-intec/rdbox-middleware | fc1612c655438aaebe5ec289764854b5fa887e09 | [
"MIT"
] | 21 | 2020-01-10T02:22:55.000Z | 2021-09-27T07:30:46.000Z | bin/rdbox/k8s_response_helper.py | rdbox-intec/rdbox-middleware | e7469c68ba745187d1db5514494663a3593164df | [
"MIT"
] | 5 | 2019-06-21T06:18:05.000Z | 2020-09-18T02:28:25.000Z | #!/usr/bin/env python3
# coding: utf-8
class K8sResponseHelper(object):
LOCATION_NOT_DEFINE = "NOT_DEFINE"
NGINX_INGRESS_SUFFIX = "nginx-ingress-controller"
def __init__(self):
self.input_data_list = None
def set_input_data_list(self, input_data_list):
"""
:return: K8sRespon... | 26.941176 | 100 | 0.648472 |
7974efb7039b9c383399727ffcf1b376cacc996a | 7,068 | py | Python | TAF/testCaseModules/keywords/setup/startup_checker.py | jpwhitemn/edgex-taf | dc10451182d4567c271b3628567826b51f5cdc92 | [
"Apache-2.0"
] | null | null | null | TAF/testCaseModules/keywords/setup/startup_checker.py | jpwhitemn/edgex-taf | dc10451182d4567c271b3628567826b51f5cdc92 | [
"Apache-2.0"
] | null | null | null | TAF/testCaseModules/keywords/setup/startup_checker.py | jpwhitemn/edgex-taf | dc10451182d4567c271b3628567826b51f5cdc92 | [
"Apache-2.0"
] | null | null | null | """
@copyright Copyright (C) 2019 IOTech Ltd
@license SPDX-License-Identifier: Apache-2.0
@file startup_checker.py
@description
Helper functions to check value range
"""
import http.client
import ssl
import time
import subprocess
from TAF.testCaseModules.keywords.setup import edgex
from TUC.data.SettingsInf... | 40.388571 | 137 | 0.601019 |
7974f016a3377112a92ffdf84417a4548c734803 | 2,370 | py | Python | main.py | PavelSimon/DashCBPro | 954afc80e11ab17dd32c04bbb444da81ec14a974 | [
"Apache-2.0"
] | null | null | null | main.py | PavelSimon/DashCBPro | 954afc80e11ab17dd32c04bbb444da81ec14a974 | [
"Apache-2.0"
] | null | null | null | main.py | PavelSimon/DashCBPro | 954afc80e11ab17dd32c04bbb444da81ec14a974 | [
"Apache-2.0"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.graph_objects as go
from CoinbaseProPublic import PublicAPI as CBPublicAPI
# import pandas as pd
import time
localtime = time.asctime(time.localtime(time.time()))
print(f"štart ... | 30.779221 | 110 | 0.59789 |
7974f029f7d7a53178b40f8cd5b88c77191a8d9a | 10,749 | py | Python | endtoend_tests/transfer.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 1 | 2015-06-24T09:07:20.000Z | 2015-06-24T09:07:20.000Z | endtoend_tests/transfer.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 3 | 2020-02-11T22:29:15.000Z | 2021-06-10T17:44:31.000Z | endtoend_tests/transfer.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""End to end tests for lib.flows.general.transfer."""
import hashlib
import re
import socket
import threading
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib.rdfvalues import crypto
from grr.proto import tests_pb2
... | 31.521994 | 78 | 0.641827 |
7974f03d1821ad196cd7de2bd3ea5310cf40a559 | 602 | py | Python | demo.py | chuangw46/docopt_demo | 16b8e0e0884b8e3c9f03e42f8f781fca05b07842 | [
"MIT"
] | null | null | null | demo.py | chuangw46/docopt_demo | 16b8e0e0884b8e3c9f03e42f8f781fca05b07842 | [
"MIT"
] | null | null | null | demo.py | chuangw46/docopt_demo | 16b8e0e0884b8e3c9f03e42f8f781fca05b07842 | [
"MIT"
] | null | null | null | # author: Tiffany Timbers
# date: 2020-01-15
"""This script prints out docopt args.
Usage: docopt.py <arg1> --arg2=<arg2> [--arg3=<arg3>] [--arg4=<arg4>]
Options:
<arg> Takes any value (this is a required positional argument)
--arg2=<arg2> Takes any value (this is a required option)
[--arg3=<arg3>] ... | 23.153846 | 74 | 0.649502 |
7974f04c9fe60d6378c3022d8f9ee5270d60bdc2 | 1,021 | py | Python | src/standard_libraries/test_json.py | LucienDon/learn-python | 150f9403511b3a897246988d642279926a018627 | [
"MIT"
] | null | null | null | src/standard_libraries/test_json.py | LucienDon/learn-python | 150f9403511b3a897246988d642279926a018627 | [
"MIT"
] | null | null | null | src/standard_libraries/test_json.py | LucienDon/learn-python | 150f9403511b3a897246988d642279926a018627 | [
"MIT"
] | null | null | null | """序列化
@see: https://www.learnpython.org/en/Serialization
Python提供了内置的JSON库来编码和解码JSON。"""
import json
def test_json():
"""JSON序列化。"""
# JSON数据有两种基本格式。 在字符串或对象数据结构中.
# 在Python中,对象的数据结构由相互嵌套的列表和字典组成。
# 对象数据结构允许使用python方法(用于列表和字典)从数据结构中添加、列出、搜索和删除元素。
# String 格式主要用于将数据传递到另一个程序或加载到数据结构中。
... | 29.171429 | 79 | 0.719882 |
7974f0827587a23cc65c63cb8e44290d170f9dad | 650 | py | Python | mockup/decorator.py | josemlp91/django_rest_mockup | bf6ae8f0e39ab35b5126c7bef6e0ee47334b513b | [
"MIT"
] | null | null | null | mockup/decorator.py | josemlp91/django_rest_mockup | bf6ae8f0e39ab35b5126c7bef6e0ee47334b513b | [
"MIT"
] | null | null | null | mockup/decorator.py | josemlp91/django_rest_mockup | bf6ae8f0e39ab35b5126c7bef6e0ee47334b513b | [
"MIT"
] | null | null | null | import json
from recadvisor.apps.mockup.mockup import Mockup
from django.http import JsonResponse
from recadvisor.settings import DEBUG, ENABLE_MOCKUP_VIEWS, BASE_DIR
def mockup_view(view_name):
def _mockup_view(func):
def inner(*args, **kwargs):
if DEBUG and ENABLE_MOCKUP_VIEWS:
... | 36.111111 | 68 | 0.652308 |
7974f0b1b028e6ff0f9c0bd04e2f69114ae1522c | 16,080 | py | Python | tofu/data/_inversions_comp.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 6 | 2016-09-15T17:01:19.000Z | 2017-03-06T22:53:10.000Z | tofu/data/_inversions_comp.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 9 | 2016-09-14T17:23:52.000Z | 2017-04-13T07:30:07.000Z | tofu/data/_inversions_comp.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Built-in
import time
# Common
import numpy as np
import scipy.sparse as scpsp
# tofu
from . import _generic_check
from . import _inversions_checks
from . import _inversions_algos
tomotok2tofu = _inversions_checks.tomotok2tofu
__all__ = ['get_available_inversions_algo']
# ############... | 26.061588 | 79 | 0.434142 |
7974f12d8dd4c8316ba311410e74ab5a4d7678e1 | 901 | py | Python | polyorg/admin.py | daonb/okqa | 3babf225911294dec1249472a9a3f6141fa7d6a7 | [
"BSD-3-Clause"
] | null | null | null | polyorg/admin.py | daonb/okqa | 3babf225911294dec1249472a9a3f6141fa7d6a7 | [
"BSD-3-Clause"
] | null | null | null | polyorg/admin.py | daonb/okqa | 3babf225911294dec1249472a9a3f6141fa7d6a7 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.contrib.contenttypes import generic
from models import Candidate, CandidateList, Party
from links.models import Link
class MembershipInline(admin.TabularInline):
model = CandidateList.candidates.through
extra = 1
class LinksInline(generic.GenericTabularInline):
... | 25.027778 | 68 | 0.752497 |
7974f22816bfcfe3081180f7d192027f07af9113 | 1,197 | py | Python | lymph/utils/gpool.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 89 | 2015-03-01T11:39:55.000Z | 2022-01-31T22:00:15.000Z | lymph/utils/gpool.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 214 | 2015-01-02T23:48:49.000Z | 2020-01-14T10:47:37.000Z | lymph/utils/gpool.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 36 | 2015-01-13T13:44:15.000Z | 2021-09-15T17:55:41.000Z | from gevent.pool import Pool, Group
from lymph.exceptions import ResourceExhausted
class RejectExcecutionError(ResourceExhausted):
pass
class NonBlockingPool(Pool):
"""A gevent pool that when exhausted will wait for a given timeout
for resources to be freed before rejecting the job by raising
exc:`... | 32.351351 | 90 | 0.685046 |
7974f358caf828bab79c69ba09ea68442ccdc2ef | 916 | py | Python | example/0_Basic_usage_of_the_library/python_asyncio/18_synchronous_primitive_Event.py | RecluseXU/learning_spider | 45fa790ed7970be57a21b40817cc66856de3d99b | [
"MIT"
] | 38 | 2020-08-30T11:41:53.000Z | 2022-03-23T04:30:26.000Z | example/0_Basic_usage_of_the_library/python_asyncio/18_synchronous_primitive_Event.py | AndersonHJB/learning_spider | b855b7808fb5268e9564180cf73ba5b1fb133f58 | [
"MIT"
] | 2 | 2021-08-20T16:34:12.000Z | 2021-10-08T11:06:41.000Z | example/0_Basic_usage_of_the_library/python_asyncio/18_synchronous_primitive_Event.py | AndersonHJB/learning_spider | b855b7808fb5268e9564180cf73ba5b1fb133f58 | [
"MIT"
] | 10 | 2020-11-24T09:15:42.000Z | 2022-02-25T06:05:16.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : 18_synchronous_primitive_Event.py
@Time : 2020-11-24
@Author : EvilRecluse
@Contact : https://github.com/RecluseXU
@Desc : 同步原语-Event
`asyncio` 事件可被用来通知多个 `asyncio` 任务已经有事件发生。
`Event` 对象会管理一个内部旗标,该旗标初始时将被设为 `false`
* `set()` 方法将其设为 `true`... | 21.302326 | 52 | 0.65393 |
7974f45ee5bed2887637fc0866e79ab5a67e0053 | 1,365 | py | Python | xor_checks/parse_klayout_xor_log.py | konradwilk/open_mpw_precheck | 439bb69cc0d4cdb4aa7dcaac18523546fc50a48b | [
"Apache-2.0"
] | null | null | null | xor_checks/parse_klayout_xor_log.py | konradwilk/open_mpw_precheck | 439bb69cc0d4cdb4aa7dcaac18523546fc50a48b | [
"Apache-2.0"
] | null | null | null | xor_checks/parse_klayout_xor_log.py | konradwilk/open_mpw_precheck | 439bb69cc0d4cdb4aa7dcaac18523546fc50a48b | [
"Apache-2.0"
] | 1 | 2021-09-10T01:51:20.000Z | 2021-09-10T01:51:20.000Z | # Copyright 2020 Efabless 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 to in... | 31.744186 | 74 | 0.700366 |
7974f60c515425a07a5be01844082fbecf9b8e40 | 37,471 | py | Python | util/dvsim/Deploy.py | Yetizone/opentitan | 7c66e95964adc22a32810d818994900ec6f38e00 | [
"Apache-2.0"
] | null | null | null | util/dvsim/Deploy.py | Yetizone/opentitan | 7c66e95964adc22a32810d818994900ec6f38e00 | [
"Apache-2.0"
] | null | null | null | util/dvsim/Deploy.py | Yetizone/opentitan | 7c66e95964adc22a32810d818994900ec6f38e00 | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import pprint
import random
import re
import shlex
import subprocess
import sys
import time
from collections import OrderedDict
from sim_ut... | 36.917241 | 97 | 0.5425 |
7974f9409abe0b8c2160de5a43175ae0ea934fc7 | 9,913 | py | Python | external/webkit/Tools/Scripts/webkitpy/layout_tests/port/server_process.py | ghsecuritylab/android_platform_sony_nicki | 526381be7808e5202d7865aa10303cb5d249388a | [
"Apache-2.0"
] | 15 | 2015-05-25T19:28:05.000Z | 2021-05-03T09:21:22.000Z | Tools/Scripts/webkitpy/layout_tests/port/server_process.py | FMSoftCN/mdolphin-core | 48ffdcf587a48a7bb4345ae469a45c5b64ffad0e | [
"Apache-2.0"
] | 2 | 2017-07-25T09:37:22.000Z | 2017-08-04T07:18:56.000Z | Tools/Scripts/webkitpy/layout_tests/port/server_process.py | FMSoftCN/mdolphin-core | 48ffdcf587a48a7bb4345ae469a45c5b64ffad0e | [
"Apache-2.0"
] | 7 | 2019-01-30T08:56:04.000Z | 2021-11-19T16:14:54.000Z | #!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | 43.1 | 79 | 0.610511 |
7974f95d05071b70dfcd35c234728f481308c708 | 2,650 | py | Python | tests/run_tests.py | Yuuwa0519/NevermoreEngine | 8f0a59b68ccf7c792dba3076aad982334946e1f9 | [
"MIT"
] | 245 | 2015-01-02T20:53:43.000Z | 2022-03-29T15:03:31.000Z | tests/run_tests.py | Yuuwa0519/NevermoreEngine | 8f0a59b68ccf7c792dba3076aad982334946e1f9 | [
"MIT"
] | 167 | 2015-11-07T19:54:24.000Z | 2022-03-27T23:30:55.000Z | tests/run_tests.py | Yuuwa0519/NevermoreEngine | 8f0a59b68ccf7c792dba3076aad982334946e1f9 | [
"MIT"
] | 161 | 2015-02-07T21:23:51.000Z | 2022-03-06T04:47:27.000Z | # Runs the tests
import os
import sys
import json
import subprocess
import pathlib
import random
if not os.path.isdir("tests/out"):
os.mkdir("tests/out")
# https://stackoverflow.com/questions/22081209/find-the-root-of-the-git-repository-where-the-file-lives
def find_vcs_root(test, dirs=(".git",)):
prev, test = N... | 27.894737 | 103 | 0.659623 |
7974fbf0fdd971a53652e0ccd5c4f569f29b3fb8 | 234 | py | Python | 01_execute_python/my_answer_ex01.py | gratin518/python_exercises | 2dea2e5758f2cb125cbd739bce6c3f78ccb46655 | [
"MIT"
] | null | null | null | 01_execute_python/my_answer_ex01.py | gratin518/python_exercises | 2dea2e5758f2cb125cbd739bce6c3f78ccb46655 | [
"MIT"
] | null | null | null | 01_execute_python/my_answer_ex01.py | gratin518/python_exercises | 2dea2e5758f2cb125cbd739bce6c3f78ccb46655 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
print("Hello Python!")
def plus(x1, x2):
return x1 + x2
def plus_1(x):
one = 1
return one + x
if __name__ == "__main__":
main()
print(plus(5, 4))
print(plus_1(1))
| 11.7 | 26 | 0.525641 |
7974fc555bb7d078548362b6b1de40c0974050dd | 1,196 | py | Python | facerecognition.py | tiwarisrikanth/Face_Recognition_and_Face_Cartonization- | 40bceaa230e30ad0c99a57f7d567942453e00973 | [
"MIT"
] | null | null | null | facerecognition.py | tiwarisrikanth/Face_Recognition_and_Face_Cartonization- | 40bceaa230e30ad0c99a57f7d567942453e00973 | [
"MIT"
] | null | null | null | facerecognition.py | tiwarisrikanth/Face_Recognition_and_Face_Cartonization- | 40bceaa230e30ad0c99a57f7d567942453e00973 | [
"MIT"
] | null | null | null | import cv2, time
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
face_cascade.load("haarcascade_frontalface_default.xml")
video = cv2.VideoCapture(0)
a=1
while True:
a = a + 1
check, frame = video.read()
print(frame)
gray_image = cv2.cvtColor(frame, cv2.C... | 23.92 | 91 | 0.617893 |
7974fc8a0081f25d09b0cb60ad434051aa85ae35 | 22,714 | py | Python | arcade/sprite_list.py | chris48s/arcade | 930ecd8be2d47db1f65173c6f1afc00c0df545c8 | [
"MIT"
] | 1 | 2020-04-23T17:53:00.000Z | 2020-04-23T17:53:00.000Z | arcade/sprite_list.py | chris48s/arcade | 930ecd8be2d47db1f65173c6f1afc00c0df545c8 | [
"MIT"
] | null | null | null | arcade/sprite_list.py | chris48s/arcade | 930ecd8be2d47db1f65173c6f1afc00c0df545c8 | [
"MIT"
] | null | null | null | """
This module provides functionality to manage Sprites in a list.
"""
from typing import Iterable
from typing import TypeVar
from typing import Generic
from typing import List
from typing import Optional
import pyglet.gl as gl
import math
import numpy as np
from PIL import Image
from arcade.sprite import Sprite... | 32.918841 | 117 | 0.603196 |
7974fd80b43bfdc65c7a16505f64d7bc1c384c37 | 340 | py | Python | FirstStepsInPython/Fundamentals/Lab/Lists Basics/03. List Statistics.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Fundamentals/Lab/Lists Basics/03. List Statistics.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Fundamentals/Lab/Lists Basics/03. List Statistics.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | 1 | 2021-10-07T18:30:42.000Z | 2021-10-07T18:30:42.000Z | lines = int(input())
positive_list = []
negative_list = []
for _ in range(lines):
value = int(input())
if value >= 0:
positive_list.append(value)
else:
negative_list.append(value)
print(positive_list)
print(negative_list)
print(f"Count of positives: {len(positive_list)}. Sum of negatives: {s... | 28.333333 | 90 | 0.682353 |
7974fe1370e550b165bc97c8fee14d60e74ed487 | 1,839 | py | Python | scrap.py | Aakash-kaushik/useful_scripts | 7bc7a03f7285fbe7a93dc077745602c703f3abe9 | [
"MIT"
] | 3 | 2020-09-12T14:35:25.000Z | 2021-05-07T08:38:11.000Z | scrap.py | Aakash-kaushik/useful_scripts | 7bc7a03f7285fbe7a93dc077745602c703f3abe9 | [
"MIT"
] | 2 | 2020-09-20T15:57:57.000Z | 2020-10-31T04:18:17.000Z | scrap.py | Aakash-kaushik/useful_scripts | 7bc7a03f7285fbe7a93dc077745602c703f3abe9 | [
"MIT"
] | 3 | 2020-09-19T12:35:34.000Z | 2020-09-25T07:00:14.000Z | from selenium import webdriver
import os
import urllib.request
from urllib.error import HTTPError, URLError
from selenium.webdriver.firefox.options import Options #comment this for chrome usage
#from selenium.webdriver.chrome.options import Options #uncomment this for chrome usage
searchlist = ["Pyoderm... | 40.866667 | 135 | 0.606852 |
7974fe4ba943b90d580f3f34a0d667ee6f53c72f | 404 | py | Python | crange/__init__.py | Ewenwan/crange | da1539f90a526f580677ed6d6a5b8122aa11746f | [
"BSD-3-Clause"
] | 33 | 2015-01-16T09:47:08.000Z | 2021-06-24T17:56:45.000Z | crange/__init__.py | Ewenwan/crange | da1539f90a526f580677ed6d6a5b8122aa11746f | [
"BSD-3-Clause"
] | 8 | 2015-01-22T02:20:47.000Z | 2019-11-15T20:15:42.000Z | crange/__init__.py | Ewenwan/crange | da1539f90a526f580677ed6d6a5b8122aa11746f | [
"BSD-3-Clause"
] | 11 | 2015-03-28T04:45:28.000Z | 2020-03-01T11:29:15.000Z | import sys
#: Version info (major, minor, maintenance, status)
VERSION = (0, 1, 1)
STATUS = ''
__version__ = ('%d.%d.%d' % VERSION[0:3]) + STATUS
if sys.version_info[0:2] < (2, 6):
raise RuntimeError('Python 2.6.x or higher is required!')
from .crange import Crange
from .crtags import CrTags
from .sourcefile imp... | 23.764706 | 61 | 0.70297 |
7974fe5bdab40b8e8bb6ba5fecf8b442b8bbad54 | 7,856 | py | Python | app/chat/views.py | YoungYJMaze/TongQu | 00951b85aab549230a6f4089a838ec362a6c5126 | [
"MIT"
] | 2 | 2020-03-29T08:20:17.000Z | 2020-03-29T08:20:19.000Z | app/chat/views.py | YoungYJMaze/TongQu | 00951b85aab549230a6f4089a838ec362a6c5126 | [
"MIT"
] | 3 | 2020-03-24T16:39:46.000Z | 2021-02-02T21:53:35.000Z | app/chat/views.py | YoungYJMaze/TongQu | 00951b85aab549230a6f4089a838ec362a6c5126 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from flask import render_template, redirect, request, url_for, flash, current_app,abort
from flask_login import login_user, logout_user, login_required, \
current_user
from . import chat
from .. import db
from ..__init__ import socketio
from flask_socketio import emit
from ..decorato... | 35.2287 | 167 | 0.695137 |
7974fe7e6f281935154b40b8c8452a3a4cfb3dd8 | 6,749 | py | Python | curling/simulation.py | mikhail/alpha-zero-general | 1b2641ef823a8dedd49159ecd5b69b77c7165731 | [
"MIT"
] | null | null | null | curling/simulation.py | mikhail/alpha-zero-general | 1b2641ef823a8dedd49159ecd5b69b77c7165731 | [
"MIT"
] | null | null | null | curling/simulation.py | mikhail/alpha-zero-general | 1b2641ef823a8dedd49159ecd5b69b77c7165731 | [
"MIT"
] | 1 | 2021-08-23T02:17:06.000Z | 2021-08-23T02:17:06.000Z | import logging
from typing import List
import numpy as np
from curling import board as board_utils
from curling import constants as c
from curling import utils
log = logging.getLogger(__name__)
class SimulationException(Exception): pass
class ShooterNotFound(SimulationException): pass
class Timeout(SimulationE... | 32.921951 | 99 | 0.617721 |
7974ff67c2e969771740a5137953b04220247ac6 | 2,343 | py | Python | test_generate_fake_data.py | leichtrhino/nsf-torch | 1ad4495b476908a50c18ead391a8cd57bc2f4094 | [
"MIT"
] | 2 | 2020-11-10T07:03:10.000Z | 2021-09-02T23:33:17.000Z | test_generate_fake_data.py | leichtrhino/nsf-torch | 1ad4495b476908a50c18ead391a8cd57bc2f4094 | [
"MIT"
] | 2 | 2020-03-31T09:56:15.000Z | 2020-04-15T22:57:54.000Z | test_generate_fake_data.py | leichtrhino/nsf-torch | 1ad4495b476908a50c18ead391a8cd57bc2f4094 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import librosa
import random
import torch
import numpy as np
from math import ceil
from model import NSFModel
sampling_rate = 16000
frame_length = sampling_rate * 25 // 1000
frame_shift = sampling_rate * 10 // 1000
batch_size = 2
waveform_length = 16000
context_length = ceil(waveform... | 29.658228 | 78 | 0.631242 |
797501d20c445ec65145c1b22bdc82dd093ca252 | 1,827 | py | Python | txweb2/dav/__init__.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 462 | 2016-08-14T17:43:24.000Z | 2022-03-17T07:38:16.000Z | txweb2/dav/__init__.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 72 | 2016-09-01T23:19:35.000Z | 2020-02-05T02:09:26.000Z | txweb2/dav/__init__.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 171 | 2016-08-16T03:50:30.000Z | 2022-03-26T11:49:55.000Z | # -*- test-case-name: txweb2.dav.test -*-
##
# Copyright (c) 2009 Twisted Matrix Laboratories.
# Copyright (c) 2005-2017 Apple Inc. All rights reserved.
#
# 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 ... | 33.833333 | 82 | 0.729611 |
797502bdcc000a3b1b35a53ca8afbc6cf392212a | 9,374 | py | Python | anna/model/metrics.py | jpbottaro/anna | e9a8be720cf0f95eb8b02fee469e9ed0c9c3ae6f | [
"MIT"
] | 1 | 2018-04-25T14:05:04.000Z | 2018-04-25T14:05:04.000Z | anna/model/metrics.py | jpbottaro/anna | e9a8be720cf0f95eb8b02fee469e9ed0c9c3ae6f | [
"MIT"
] | 4 | 2020-09-25T18:34:57.000Z | 2022-02-09T23:26:27.000Z | anna/model/metrics.py | jpbottaro/anna | e9a8be720cf0f95eb8b02fee469e9ed0c9c3ae6f | [
"MIT"
] | null | null | null | """Tensorflow implementation of metrics for Multi-label Classification.
Metrics: Subset Accuracy, Hamming accuracy, example-based f1, and label-based
micro/macro f1.
Definitions from: https://papers.nips.cc/paper/7125-maximizing-subset-accuracy-with-recurrent-neural-networks-in-multi-label-classification.pdf... | 38.576132 | 154 | 0.655643 |
797502f43fc2760f6809e78c3a2a1fbc5210f532 | 5,258 | py | Python | research/deeplab/evaluation/eval_coco_format_test.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/deeplab/evaluation/eval_coco_format_test.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/deeplab/evaluation/eval_coco_format_test.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.948148 | 80 | 0.696272 |
79750320176d2284ae4ad465bfa445c94086bb0e | 474 | py | Python | birdvision/quiet.py | rainbowbismuth/bird-vision | ea4a54a694be7c46906fcd703cb26d84048319a6 | [
"MIT"
] | 1 | 2020-11-26T01:33:12.000Z | 2020-11-26T01:33:12.000Z | birdvision/quiet.py | rainbowbismuth/bird-vision | ea4a54a694be7c46906fcd703cb26d84048319a6 | [
"MIT"
] | null | null | null | birdvision/quiet.py | rainbowbismuth/bird-vision | ea4a54a694be7c46906fcd703cb26d84048319a6 | [
"MIT"
] | null | null | null | """
Utility module to contain any code for any external libraries that get too noisy for my tastes.
"""
def silence_tensorflow():
"""Silence every warning of notice from tensorflow."""
import tensorflow as tf
import logging
import os
logging.getLogger('tensorflow').setLevel(logging.ERROR)
os.e... | 29.625 | 95 | 0.71097 |
797503615ac3b97249ea1578225d7701717c77d3 | 3,644 | py | Python | test/test_summarize_for_overview.py | EdinburghGenomics/illuminatus | c92d6448675fb451f2dc284d67db1711f2974c74 | [
"BSD-2-Clause"
] | 1 | 2020-02-15T00:18:51.000Z | 2020-02-15T00:18:51.000Z | test/test_summarize_for_overview.py | EdinburghGenomics/illuminatus | c92d6448675fb451f2dc284d67db1711f2974c74 | [
"BSD-2-Clause"
] | 1 | 2021-03-30T10:50:38.000Z | 2021-03-30T10:50:39.000Z | test/test_summarize_for_overview.py | EdinburghGenomics/illuminatus | c92d6448675fb451f2dc284d67db1711f2974c74 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
"""Test the script that produces most of the metadata at the top of
the HTML reports.
"""
import sys, os, re
import unittest
import logging
import yaml, yamlloader
from collections import OrderedDict
from unittest.mock import patch
DATA_DIR = os.path.abspath(os.path.dirname(__file__) + '/se... | 36.079208 | 109 | 0.681394 |
79750443fab3bd769f996f210a0355fe123e5eed | 245 | py | Python | src/cova/pipeline/plugins/annotate/dummy.py | danirivas/cova-tuner | e7eaf7e75f0c15ce35c449fb67529c9c73386817 | [
"Apache-2.0"
] | null | null | null | src/cova/pipeline/plugins/annotate/dummy.py | danirivas/cova-tuner | e7eaf7e75f0c15ce35c449fb67529c9c73386817 | [
"Apache-2.0"
] | null | null | null | src/cova/pipeline/plugins/annotate/dummy.py | danirivas/cova-tuner | e7eaf7e75f0c15ce35c449fb67529c9c73386817 | [
"Apache-2.0"
] | null | null | null | """This module implements a dummy COVAAnnotator. It does nothing."""
from cova.pipeline.pipeline import COVAAnnotate
class Dummy(COVAAnnotate):
def annotate(self, image) -> None:
pass
def epilogue(self) -> None:
pass
| 20.416667 | 68 | 0.681633 |
797504914419ac72d34cc55d382ef0b04d4479ac | 4,527 | py | Python | NodeGraphQt/widgets/tab_search.py | compix/NodeGraphQt | 511c02aef02a7e16a9f40aa368c2f560bd3bbdff | [
"MIT"
] | null | null | null | NodeGraphQt/widgets/tab_search.py | compix/NodeGraphQt | 511c02aef02a7e16a9f40aa368c2f560bd3bbdff | [
"MIT"
] | null | null | null | NodeGraphQt/widgets/tab_search.py | compix/NodeGraphQt | 511c02aef02a7e16a9f40aa368c2f560bd3bbdff | [
"MIT"
] | null | null | null | #!/usr/bin/python
from NodeGraphQt import QtCore, QtWidgets
from VisualScripting import qt_util
from NodeGraphQt.widgets.stylesheet import STYLE_TABSEARCH, STYLE_TABSEARCH_LIST
class TabSearchCompleter(QtWidgets.QCompleter):
"""
QCompleter adapted from:
https://stackoverflow.com/questions/5129211/qcomplet... | 35.367188 | 82 | 0.652308 |
797504d3215539dac8ccbf4364db01d58eed0059 | 3,191 | py | Python | simforest/distance.py | dabrze/similarity_forest | 3d0f0f304b0106a6b2d86e6e84562ef2cb5ee81d | [
"BSD-3-Clause"
] | 2 | 2020-01-24T12:37:14.000Z | 2021-04-14T10:47:20.000Z | simforest/distance.py | dabrze/similarity_forest | 3d0f0f304b0106a6b2d86e6e84562ef2cb5ee81d | [
"BSD-3-Clause"
] | null | null | null | simforest/distance.py | dabrze/similarity_forest | 3d0f0f304b0106a6b2d86e6e84562ef2cb5ee81d | [
"BSD-3-Clause"
] | 1 | 2022-03-03T09:38:28.000Z | 2022-03-03T09:38:28.000Z | import numpy as np
from scipy.linalg.blas import sgemm
import numexpr as ne
from numba import jit
def rbf(X, p, q, gamma=None):
"""A function calculating rbf kernel based projection of data-points in matrix X
X : array of shape=(n_examples, n_features),
should be 2-dimensional, even if... | 36.678161 | 100 | 0.557505 |
79750500d03edf7946027b295fb6e950e5101332 | 1,529 | py | Python | var/spack/repos/builtin/packages/py-symengine/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-symengine/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-symengine/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PySymengine(PythonPackage):
"""Python wrappers for SymEngine, a symbolic manipulat... | 43.685714 | 95 | 0.675605 |
7975051d2f91b65ca3ccb4638a0968c1a04576c6 | 946 | py | Python | ML/learn/tensorflow/tf_print.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | 2 | 2017-06-07T03:20:42.000Z | 2020-01-07T09:14:26.000Z | ML/learn/tensorflow/tf_print.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | ML/learn/tensorflow/tf_print.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# @file tf_print.py
# @brief
# @author QRS
# @blog qrsforever.github.io
# @version 1.0
# @date 2019-06-02 15:40:55
################################ jupyter-vim #######################################
# https://github.com/qrsforever/vim/blob/master/bundle/.configs/jupyter-vi... | 28.666667 | 88 | 0.566596 |
7975053511625a1fc31571504ceb51297faf2d7c | 1,870 | py | Python | src/python/ch04/sec05.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | src/python/ch04/sec05.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | src/python/ch04/sec05.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : 526614962@qq.com
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : Dive-into-Deep-Learning
@File : sec0202.py
@Version : v0.1
@Time : 2020-12-27 9:25
@License ... | 22.804878 | 72 | 0.525134 |
7975066321642ebfebcc9f2b5a3125ab91ea2265 | 533 | py | Python | Stop-Ec2-Instance.py | shaktidhara/AWS | 0cdf7835bac8a9faf0db88a4393693506a06a9fb | [
"Apache-2.0"
] | null | null | null | Stop-Ec2-Instance.py | shaktidhara/AWS | 0cdf7835bac8a9faf0db88a4393693506a06a9fb | [
"Apache-2.0"
] | null | null | null | Stop-Ec2-Instance.py | shaktidhara/AWS | 0cdf7835bac8a9faf0db88a4393693506a06a9fb | [
"Apache-2.0"
] | null | null | null | # STOP the EC2-Instance In lambda function.
import boto3
# Enter the region your instances are in. Include only the region without specifying Availability Zone; e.g., 'us-east-1'
region = 'eu-west-1'
# Enter your instances here: ex. ['X-XXXXXXXX', 'X-XXXXXXXX']
instances = ['i-0e0c8319ac6030045', 'i-086ae649e5fd4f886... | 41 | 121 | 0.739212 |
797506c715f5971e01ebc6160c8b16c3b2698135 | 4,517 | py | Python | app/gbd/plugins/alkis_grundbuch/__init__.py | gbd-consult/qwebgisapp | 86318f42d2e931ab3a6ea4e5108b9e0b0095156b | [
"MIT"
] | null | null | null | app/gbd/plugins/alkis_grundbuch/__init__.py | gbd-consult/qwebgisapp | 86318f42d2e931ab3a6ea4e5108b9e0b0095156b | [
"MIT"
] | null | null | null | app/gbd/plugins/alkis_grundbuch/__init__.py | gbd-consult/qwebgisapp | 86318f42d2e931ab3a6ea4e5108b9e0b0095156b | [
"MIT"
] | null | null | null | #coding=utf8
"""Interface for Objektartengruppe:Personen- und Bestandsdaten."""
from gbd.core import db, log, util, debug
from gbd.plugins import alkis_resolver as resolver
def _anteil(r):
if r['nenner'] is None:
return None
return '%d/%d' % (r['zaehler'] or 0, r['nenner'] or 0)
def get_all_person... | 30.727891 | 126 | 0.553465 |
797508081d3c2386f4001f995450d08d57be1875 | 1,035 | py | Python | plugins/rapid7_insight_agent/icon_rapid7_insight_agent/actions/get_agent_details/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/rapid7_insight_agent/icon_rapid7_insight_agent/actions/get_agent_details/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/rapid7_insight_agent/icon_rapid7_insight_agent/actions/get_agent_details/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import insightconnect_plugin_runtime
from .schema import GetAgentDetailsInput, GetAgentDetailsOutput, Input, Output, Component
# Custom imports below
from icon_rapid7_insight_agent.util.graphql_api.api_exception import APIException
from insightconnect_plugin_runtime.exceptions import PluginException
class GetAgentDe... | 35.689655 | 89 | 0.708213 |
797508c9099a6046c2f82cd442a3d2fffb08c627 | 877 | py | Python | setup.py | sjpfenninger/gsee | 945b0862fe1047c484061e8ecba6a763c185c992 | [
"BSD-3-Clause"
] | null | null | null | setup.py | sjpfenninger/gsee | 945b0862fe1047c484061e8ecba6a763c185c992 | [
"BSD-3-Clause"
] | null | null | null | setup.py | sjpfenninger/gsee | 945b0862fe1047c484061e8ecba6a763c185c992 | [
"BSD-3-Clause"
] | 1 | 2020-08-06T17:39:29.000Z | 2020-08-06T17:39:29.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
# Sets the __version__ variable
exec(open('gsee/_version.py').read())
with open("README.md", "r") as f:
long_description = f.read()
setup(
name='gsee',
version=__version__,
author='Stefan Pfenninger',
author_email='stefan@pfenning... | 26.575758 | 54 | 0.640821 |
79750a9d23ebde13ac82e01be647fd151266b79c | 18,158 | py | Python | Lib/sunau.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 52,316 | 2015-01-01T15:56:25.000Z | 2022-03-31T23:19:01.000Z | Lib/sunau.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 25,286 | 2015-03-03T23:18:02.000Z | 2022-03-31T23:17:27.000Z | Lib/sunau.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 31,623 | 2015-01-01T13:29:37.000Z | 2022-03-31T19:55:06.000Z | """Stuff to parse Sun and NeXT audio files.
An audio file consists of a header followed by the data. The structure
of the header is as follows.
+---------------+
| magic word |
+---------------+
| header size |
+---------------+
| data size |
+--------... | 34.455408 | 85 | 0.59544 |
79750b0a2ace40326d56d474436eb6f57bc6a413 | 12,334 | py | Python | 13-CAMH-Specialized_Compute_Cluster_Files/archive_code/masker_SCC.py | DataKnightsAI/Sleep-Deprivation-Classification-using-MRI-Scans | 0c36ab7bb0b4aec9bca95bcf8d866c39cdb17a66 | [
"Apache-2.0"
] | 1 | 2020-10-08T16:14:45.000Z | 2020-10-08T16:14:45.000Z | 13-CAMH-Specialized_Compute_Cluster_Files/archive_code/masker_SCC.py | DataKnightsAI/Sleep-Deprivation-Classification-using-MRI-Scans | 0c36ab7bb0b4aec9bca95bcf8d866c39cdb17a66 | [
"Apache-2.0"
] | null | null | null | 13-CAMH-Specialized_Compute_Cluster_Files/archive_code/masker_SCC.py | DataKnightsAI/Sleep-Deprivation-Classification-using-MRI-Scans | 0c36ab7bb0b4aec9bca95bcf8d866c39cdb17a66 | [
"Apache-2.0"
] | null | null | null | # %%
from nilearn import plotting
from nilearn import image
import nilearn
from nilearn.input_data import NiftiMasker
from nilearn.image import load_img, math_img
import glob #filesystem manipulation
import pandas as pd
import pathlib
# Parellization libraries
from joblib import Parallel, delayed
import os
import mat... | 48.368627 | 186 | 0.77031 |
79750b813b1d09a3fd7ea1b63589882c2d477166 | 4,511 | py | Python | search/views.py | OneUne/weltrip-web | b0557a83a6798d75cf7a3504db0a9f8952803d5b | [
"MIT"
] | 1 | 2020-05-05T08:17:44.000Z | 2020-05-05T08:17:44.000Z | search/views.py | OneUne/weltrip-web | b0557a83a6798d75cf7a3504db0a9f8952803d5b | [
"MIT"
] | 1 | 2020-10-19T07:34:39.000Z | 2020-10-19T07:34:39.000Z | search/views.py | OneUne/weltrip-web | b0557a83a6798d75cf7a3504db0a9f8952803d5b | [
"MIT"
] | 1 | 2020-11-05T16:13:16.000Z | 2020-11-05T16:13:16.000Z | from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse
from .models import SearchMeta, SearchObj, ClickDetail
from users.models import Profile
from .forms import searchForm
import datetime
from .search import *
from .rq_class import *
from collector.datas import basicT... | 34.7 | 218 | 0.602527 |
79750cedd46c18e4ffe8fed743e0398abeae4163 | 9,157 | py | Python | pacu/modules/s3__download_bucket/main.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | 1 | 2021-12-22T22:39:49.000Z | 2021-12-22T22:39:49.000Z | pacu/modules/s3__download_bucket/main.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | null | null | null | pacu/modules/s3__download_bucket/main.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import argparse
import datetime
from copy import deepcopy
import os
from botocore.exceptions import ClientError
from pacu.core.lib import save, strip_lines
module_info = {
# Name of the module (should be the same as the filename)
"name": "s3__download_bucket",
"author": "Spencer Gi... | 34.685606 | 121 | 0.613083 |
79750d40f78a0a779a1ae927173308c94e893c4f | 1,692 | py | Python | packages/api-server/api_server/models/ros_pydantic/rmf_lift_msgs/LiftRequest.py | Sald-for-Communication-and-IT/rmf-web | ec5996ab0b06440d7147170f3030b14c73d26116 | [
"Apache-2.0"
] | 23 | 2021-04-13T23:01:12.000Z | 2022-03-21T02:15:24.000Z | packages/api-server/api_server/models/ros_pydantic/rmf_lift_msgs/LiftRequest.py | Sald-for-Communication-and-IT/rmf-web | ec5996ab0b06440d7147170f3030b14c73d26116 | [
"Apache-2.0"
] | 326 | 2021-03-10T17:32:17.000Z | 2022-03-30T04:42:14.000Z | packages/api-server/api_server/models/ros_pydantic/rmf_lift_msgs/LiftRequest.py | Sald-for-Communication-and-IT/rmf-web | ec5996ab0b06440d7147170f3030b14c73d26116 | [
"Apache-2.0"
] | 13 | 2021-04-10T10:33:36.000Z | 2022-02-22T15:39:58.000Z | # This is a generated file, do not edit
from typing import List
import pydantic
from ..builtin_interfaces.Time import Time
class LiftRequest(pydantic.BaseModel):
lift_name: str = "" # string
request_time: Time = Time() # builtin_interfaces/Time
session_id: str = "" # string
request_type: pydanti... | 30.214286 | 77 | 0.674941 |
79750da711cf025586427c965ff5d6c334931cc3 | 10,074 | py | Python | TradingBot/bot_sma_switch.py | piotruslalka/bytebucks | 59fdd66661bbc9c65fd1ea77675977404b960f6c | [
"MIT"
] | 1 | 2018-02-01T06:38:03.000Z | 2018-02-01T06:38:03.000Z | TradingBot/bot_sma_switch.py | piotruslalka/bytebucks | 59fdd66661bbc9c65fd1ea77675977404b960f6c | [
"MIT"
] | 2 | 2017-12-12T09:25:57.000Z | 2018-01-02T15:09:14.000Z | TradingBot/bot_sma_switch.py | piotruslalka/ByteBucks | 59fdd66661bbc9c65fd1ea77675977404b960f6c | [
"MIT"
] | null | null | null | import time
import config
import logging
import numpy as np
import slack
import os.path
from moving_average import MovingAverageCalculation
from OrderBook import OrderBookConsole
from datetime import datetime
# Strategy Settings: Package Trade Settings as a dictionary so you can simply pass that into OrderBook
strate... | 45.58371 | 394 | 0.696943 |
79751060edd04348fee14c164084f9310686aa59 | 1,267 | py | Python | mitmproxy/test/tutils.py | illera88/mitmproxy | 4f464001841e5119bf57ef620a3257892ded2ded | [
"MIT"
] | 6 | 2020-11-25T07:33:05.000Z | 2022-01-25T07:25:54.000Z | mitmproxy/test/tutils.py | illera88/mitmproxy | 4f464001841e5119bf57ef620a3257892ded2ded | [
"MIT"
] | null | null | null | mitmproxy/test/tutils.py | illera88/mitmproxy | 4f464001841e5119bf57ef620a3257892ded2ded | [
"MIT"
] | 4 | 2021-03-14T16:14:27.000Z | 2021-09-25T03:01:15.000Z | from io import BytesIO
from mitmproxy.net import tcp
from mitmproxy.net import http
def treader(bytes):
"""
Construct a tcp.Read object from bytes.
"""
fp = BytesIO(bytes)
return tcp.Reader(fp)
def treq(**kwargs) -> http.Request:
"""
Returns:
mitmproxy.net.http.Request
"... | 23.036364 | 91 | 0.5809 |
79751232e9d2057f07b44ec0135f45641b952188 | 5,714 | py | Python | tests/unit/test_basket.py | radeklat/price-basket | a6fb5798f505680426234aff0c80b5721902d572 | [
"MIT"
] | null | null | null | tests/unit/test_basket.py | radeklat/price-basket | a6fb5798f505680426234aff0c80b5721902d572 | [
"MIT"
] | null | null | null | tests/unit/test_basket.py | radeklat/price-basket | a6fb5798f505680426234aff0c80b5721902d572 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. Created on 2017-01-27
.. codeauthor:: Radek Lát (radek.lat@gmail.com)
"""
from datetime import date, timedelta
from collections import deque
from typing import Dict, List, Optional, Tuple, Union
from unittest.mock import patch
import pytest
from src.ba... | 32.465909 | 92 | 0.544627 |
79751377924dbddf388f2ae9bf148e4367e556c8 | 9,717 | py | Python | xena_gdc_etl/main.py | ayan-b/xena-GDC-ETL | 107fabadd061ea1cbf2f3ec330c4277fed58284c | [
"Apache-2.0"
] | 5 | 2020-11-01T11:50:49.000Z | 2022-03-24T05:36:02.000Z | xena_gdc_etl/main.py | ayan-b/xena-GDC-ETL | 107fabadd061ea1cbf2f3ec330c4277fed58284c | [
"Apache-2.0"
] | 38 | 2019-07-02T16:43:21.000Z | 2021-12-13T19:59:56.000Z | xena_gdc_etl/main.py | ayan-b/xena-GDC-ETL | 107fabadd061ea1cbf2f3ec330c4277fed58284c | [
"Apache-2.0"
] | 2 | 2019-07-04T01:31:27.000Z | 2021-08-30T18:25:22.000Z | from __future__ import print_function
import argparse
from datetime import date
import os
import pkg_resources
import pandas as pd
from pandas.util.testing import assert_frame_equal
from .utils import handle_merge_xena
from .gdc import gdc_check_new, get_project_info
from .constants import valid_dtype, GDC_RELEASE_UR... | 33.277397 | 79 | 0.588144 |
79751398dd4b3eac25e40960b6979d9ec508d839 | 1,799 | py | Python | test/test_initial_state_zero.py | gawelk/aqua | 98ce06289cc6e12d087982cba95a45353ce0cb3b | [
"Apache-2.0"
] | null | null | null | test/test_initial_state_zero.py | gawelk/aqua | 98ce06289cc6e12d087982cba95a45353ce0cb3b | [
"Apache-2.0"
] | null | null | null | test/test_initial_state_zero.py | gawelk/aqua | 98ce06289cc6e12d087982cba95a45353ce0cb3b | [
"Apache-2.0"
] | 1 | 2019-06-05T01:08:23.000Z | 2019-06-05T01:08:23.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 35.27451 | 90 | 0.617009 |
797513dd34fed9c5da79447346672b325cbb70c7 | 588 | py | Python | src/the_tale/the_tale/common/utils/constant_code/textgen_to_utg.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/common/utils/constant_code/textgen_to_utg.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/common/utils/constant_code/textgen_to_utg.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
def convert_textgen_noun_json_to_utg(textgen_data, aninality):
# this code used in migrations, so, it MUSTN'T be changed
properties = {1: 0 if aninality else 1}
if 'мр' in textgen_data['properties']:
properties[3] = 0
if 'ср' in textgen_data['properties']:
properties[3] = 1
if 'ж... | 26.727273 | 62 | 0.605442 |
7975140636ed70ea275b734b13dfb59b26d0215f | 124,388 | py | Python | configure.py | tobiasbrunner/botan | 56a82724ad4b139dd77d9f0c38180120b59ae305 | [
"BSD-2-Clause"
] | null | null | null | configure.py | tobiasbrunner/botan | 56a82724ad4b139dd77d9f0c38180120b59ae305 | [
"BSD-2-Clause"
] | null | null | null | configure.py | tobiasbrunner/botan | 56a82724ad4b139dd77d9f0c38180120b59ae305 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Configuration program for botan
(C) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Jack Lloyd
(C) 2015,2016,2017 Simon Warta (Kullo GmbH)
Botan is released under the Simplified BSD License (see license.txt)
This script is regularly tested with CPython 2.7 and 3.5, and
occasionally teste... | 38.593857 | 120 | 0.607679 |
797514afec9de0fe0907aa4ae01f14dcd5f74b37 | 9,897 | py | Python | onnxruntime/test/python/onnxruntime_test_python_nuphar.py | EricCousineau-TRI/onnxruntime | 796948c6aee80df5562c3e1538bb675913946754 | [
"MIT"
] | null | null | null | onnxruntime/test/python/onnxruntime_test_python_nuphar.py | EricCousineau-TRI/onnxruntime | 796948c6aee80df5562c3e1538bb675913946754 | [
"MIT"
] | null | null | null | onnxruntime/test/python/onnxruntime_test_python_nuphar.py | EricCousineau-TRI/onnxruntime | 796948c6aee80df5562c3e1538bb675913946754 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: UTF-8 -*-
import numpy as np
import onnx
from onnx import numpy_helper
import onnxruntime as onnxrt
import os
from onnxruntime.nuphar.rnn_benchmark import perf_test, generate_model
from pathlib import Path
impor... | 52.089474 | 206 | 0.649288 |
797515419d1c7f33ea5778932e949a776a64622e | 302 | py | Python | napari/_qt/widgets/qt_activity_dock.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | 1 | 2021-05-16T19:31:42.000Z | 2021-05-16T19:31:42.000Z | napari/_qt/widgets/qt_activity_dock.py | 0x00b1/napari | 01c24e320dc3d8daaae80a383f95fc0587c98ee4 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/widgets/qt_activity_dock.py | 0x00b1/napari | 01c24e320dc3d8daaae80a383f95fc0587c98ee4 | [
"BSD-3-Clause"
] | null | null | null | """Provides an Activity Dock that allows the user to view running progress bars
"""
from qtpy.QtWidgets import QVBoxLayout, QWidget
class QtActivityDock(QWidget):
def __init__(
self,
) -> None:
super().__init__()
layout = QVBoxLayout()
self.setLayout(layout)
| 21.571429 | 79 | 0.65894 |
797516158bbccff2125e7dbe4e229cee97829cd0 | 2,129 | py | Python | memory.py | SioJL13/Coursera-Interactive-Programming-Python | 2ab7a948289fa2260952ff4cdf397297eee34404 | [
"MIT"
] | null | null | null | memory.py | SioJL13/Coursera-Interactive-Programming-Python | 2ab7a948289fa2260952ff4cdf397297eee34404 | [
"MIT"
] | null | null | null | memory.py | SioJL13/Coursera-Interactive-Programming-Python | 2ab7a948289fa2260952ff4cdf397297eee34404 | [
"MIT"
] | null | null | null | # Input comes from a mouse clicks.
# The implementation is very basic where the cards are just numbers from 0 to 9.
import simplegui
import random
# Global variables
CARDS = list()
TURN = 0
EXPOSED = list()
STATE = 0
INDEX_CARD1 = 0
INDEX_CARD2 = 0
# helper function to initialize globals
def new_game():
global C... | 26.949367 | 80 | 0.638328 |
79751629d0c11c2e937975bebfa07d11a989af76 | 3,753 | py | Python | Visualization/image_mosaicking.py | pberezina/earthengine-py-notebooks | 4cbe3c52bcc9ed3f1337bf097aa5799442991a5e | [
"MIT"
] | 1 | 2020-03-20T19:39:34.000Z | 2020-03-20T19:39:34.000Z | Visualization/image_mosaicking.py | pberezina/earthengine-py-notebooks | 4cbe3c52bcc9ed3f1337bf097aa5799442991a5e | [
"MIT"
] | null | null | null | Visualization/image_mosaicking.py | pberezina/earthengine-py-notebooks | 4cbe3c52bcc9ed3f1337bf097aa5799442991a5e | [
"MIT"
] | null | null | null | '''
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Visualization/image_mosaicking.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_b... | 36.436893 | 422 | 0.72049 |
79751743d365b38d2d0f15ffb53e1a46f266d535 | 3,888 | py | Python | ws/wellspring/migrations/0001_initial.py | ushatil/wellness-tracker | 74031921293ccc4c08763b7600a9a1b07b904f3a | [
"MIT"
] | null | null | null | ws/wellspring/migrations/0001_initial.py | ushatil/wellness-tracker | 74031921293ccc4c08763b7600a9a1b07b904f3a | [
"MIT"
] | null | null | null | ws/wellspring/migrations/0001_initial.py | ushatil/wellness-tracker | 74031921293ccc4c08763b7600a9a1b07b904f3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Device',
fields=[
('id', models.AutoField(db_co... | 37.028571 | 146 | 0.542953 |
7975174586404545e285c0a44a7d9188aef6fca4 | 1,388 | py | Python | generate.py | Dyphis/MusicTransformer-pytorch | f40ec69b842663d745fec096977bd1a6ff104106 | [
"MIT"
] | null | null | null | generate.py | Dyphis/MusicTransformer-pytorch | f40ec69b842663d745fec096977bd1a6ff104106 | [
"MIT"
] | null | null | null | generate.py | Dyphis/MusicTransformer-pytorch | f40ec69b842663d745fec096977bd1a6ff104106 | [
"MIT"
] | null | null | null | import custom
from custom import criterion
from custom.layers import *
from custom.config import config
from model import MusicTransformer
from data import Data
import utils
from midi_processor.processor import decode_midi, encode_midi
import datetime
import argparse
from tensorboardX import SummaryWriter
parser = ... | 25.236364 | 69 | 0.767291 |
7975179d181ddf188e62aa6a44778c2026be1694 | 676 | py | Python | apps/api/utils.py | luisito666/Mt2Web.py | e37ca79a5a21373c8b773cf30c622beba6d28ec4 | [
"MIT"
] | 5 | 2018-02-04T05:41:39.000Z | 2021-11-09T10:51:58.000Z | apps/api/utils.py | vps-hosting/Mt2Web.py | e37ca79a5a21373c8b773cf30c622beba6d28ec4 | [
"MIT"
] | 4 | 2020-11-22T16:07:47.000Z | 2022-01-13T03:27:05.000Z | apps/api/utils.py | vps-hosting/Mt2Web.py | e37ca79a5a21373c8b773cf30c622beba6d28ec4 | [
"MIT"
] | 4 | 2018-12-22T23:56:47.000Z | 2021-07-31T11:00:54.000Z |
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_naive, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and is_naive(dt):
return make_aware(dt, timezo... | 19.882353 | 59 | 0.75 |
797519780d5076cd558c76269fbcd3d1185b0fd5 | 41,692 | py | Python | scalyr_agent/tests/configuration_test.py | echee2/scalyr-agent-2 | da7d168260b94dc95aedb5ae0dca03165e55cb02 | [
"Apache-2.0"
] | null | null | null | scalyr_agent/tests/configuration_test.py | echee2/scalyr-agent-2 | da7d168260b94dc95aedb5ae0dca03165e55cb02 | [
"Apache-2.0"
] | null | null | null | scalyr_agent/tests/configuration_test.py | echee2/scalyr-agent-2 | da7d168260b94dc95aedb5ae0dca03165e55cb02 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Scalyr 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 agreed to in writing, so... | 39.820439 | 120 | 0.639835 |
79751afc024f38edfd97c7bcf0600261ed0386ad | 2,517 | py | Python | plugins/photo.py | sanith2005/Image-Editor | 7689152a615dbf244ca887f84fa1ede96cd2d845 | [
"MIT"
] | null | null | null | plugins/photo.py | sanith2005/Image-Editor | 7689152a615dbf244ca887f84fa1ede96cd2d845 | [
"MIT"
] | null | null | null | plugins/photo.py | sanith2005/Image-Editor | 7689152a615dbf244ca887f84fa1ede96cd2d845 | [
"MIT"
] | null | null | null | # By @TroJanzHEX
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message
from pyrogram import Client, filters
@Client.on_message(filters.photo & filters.private)
async def photo(client: Client, message: Message):
try:
await client.send_message(
chat_id=message.chat.id,
... | 44.157895 | 88 | 0.505364 |
79751b7782c4d9d0800dc68f342e4db6a5c110d1 | 610 | py | Python | choria_external/exceptions.py | optiz0r/py-choria-external | f7a47c83749ae1a6bdd4fdd0512087e79102f759 | [
"Apache-2.0"
] | null | null | null | choria_external/exceptions.py | optiz0r/py-choria-external | f7a47c83749ae1a6bdd4fdd0512087e79102f759 | [
"Apache-2.0"
] | null | null | null | choria_external/exceptions.py | optiz0r/py-choria-external | f7a47c83749ae1a6bdd4fdd0512087e79102f759 | [
"Apache-2.0"
] | null | null | null | class ChoriaExternalException(Exception):
""" Base exception"""
description = 'Unknown error'
statuscode = 5
def __str__(self):
return '{0}: {1}'.format(self.description, ' '.join(self.args))
class RPCAborted(ChoriaExternalException):
description = "RPC Aborted"
statuscode = 1
class... | 22.592593 | 71 | 0.713115 |
79751e55ddc0bdbc8a74d4c0eef02e4d5df3e269 | 344 | py | Python | sic_financeiro/core/forms/tags.py | diegoMasin/project-sic-financeiro | a06d4c873014e0835afa37437ad8f57c24f78163 | [
"MIT"
] | null | null | null | sic_financeiro/core/forms/tags.py | diegoMasin/project-sic-financeiro | a06d4c873014e0835afa37437ad8f57c24f78163 | [
"MIT"
] | null | null | null | sic_financeiro/core/forms/tags.py | diegoMasin/project-sic-financeiro | a06d4c873014e0835afa37437ad8f57c24f78163 | [
"MIT"
] | null | null | null | from django import forms
from sic_financeiro.core.models.tags import Tag
class TagsForm(forms.ModelForm):
class Meta:
model = Tag
fields = ['nome']
labels = {
'nome': 'Nome'
}
widgets = {
'nome': forms.TextInput(attrs={'class': 'form-control', 'requ... | 21.5 | 86 | 0.546512 |
79751fd33863d9a217b46bd172660b24073acab5 | 3,865 | py | Python | combined/app.py | cjvilla/Project-2 | 5e575abec6d2eb0c298fda6e5561cdc8deb2363b | [
"MIT"
] | null | null | null | combined/app.py | cjvilla/Project-2 | 5e575abec6d2eb0c298fda6e5561cdc8deb2363b | [
"MIT"
] | null | null | null | combined/app.py | cjvilla/Project-2 | 5e575abec6d2eb0c298fda6e5561cdc8deb2363b | [
"MIT"
] | 1 | 2021-04-24T18:23:54.000Z | 2021-04-24T18:23:54.000Z | from flask import Flask, render_template, redirect, jsonify, request, url_for, request
from sqlalchemy import create_engine
import sqlite3 as lite
import pandas as pd
import json
import folium
from folium import plugins
import ipywidgets
import geocoder
import geopy
import plotly.express as px
app = Flask(__name__)
... | 34.508929 | 223 | 0.725744 |
797521793e3c0cada3fd29cc997889648881d61f | 674 | py | Python | data/div2kjpeg.py | nSamsow/CSNLN | 309c7451828c8878b85577ee78d4ecd465c045f0 | [
"MIT"
] | null | null | null | data/div2kjpeg.py | nSamsow/CSNLN | 309c7451828c8878b85577ee78d4ecd465c045f0 | [
"MIT"
] | null | null | null | data/div2kjpeg.py | nSamsow/CSNLN | 309c7451828c8878b85577ee78d4ecd465c045f0 | [
"MIT"
] | null | null | null | import os
from data import srdata
from data import div2k
class DIV2KJPEG(div2k.DIV2K):
def __init__(self, args, name='', train=True, benchmark=False):
self.q_factor = int(name.replace('DIV2K-Q', ''))
super(DIV2KJPEG, self).__init__(
args, name=name, train=train, benchmark=benchmark
... | 33.7 | 67 | 0.615727 |
797521cf1c0f5ae6d2222e2b08ba16d1c4d62a09 | 433 | py | Python | algorithms_and_data_structures/algorithms/math/fibonacci/nth_fibonacci/nth_fibo_recursive.py | JCPedroza/algorithms-and-data-structures-py | e8532060e82bb7f56d667c587469dea2921117df | [
"MIT"
] | 2 | 2022-01-14T01:33:24.000Z | 2022-01-14T03:23:41.000Z | algorithms_and_data_structures/algorithms/math/fibonacci/nth_fibonacci/nth_fibo_recursive.py | JCPedroza/algorithms-and-data-structures-py | e8532060e82bb7f56d667c587469dea2921117df | [
"MIT"
] | 1 | 2022-01-14T03:26:58.000Z | 2022-01-14T03:26:58.000Z | algorithms_and_data_structures/algorithms/math/fibonacci/nth_fibonacci/nth_fibo_recursive.py | JCPedroza/algorithms-and-data-structures-py | e8532060e82bb7f56d667c587469dea2921117df | [
"MIT"
] | 1 | 2022-01-14T03:23:45.000Z | 2022-01-14T03:23:45.000Z | def fibo(index: int) -> int:
'''Compute the fibonacci number located at the given index, using
if conditional structure and recursion.
:param index: Location of the fibonacci number.
:return: Fibonacci number located at the given index.
'''
if index == 0:
return 0
if index == 1:
... | 24.055556 | 69 | 0.646651 |
7975220b5b2a620265c304b5cd78e1dd7b32dd15 | 1,841 | py | Python | test/test_namespace.py | dbs/rdflib | 2344de99e2ded84b3aa273d4ee8ead210d571637 | [
"BSD-3-Clause"
] | 1 | 2017-04-05T16:11:54.000Z | 2017-04-05T16:11:54.000Z | test/test_namespace.py | dbs/rdflib | 2344de99e2ded84b3aa273d4ee8ead210d571637 | [
"BSD-3-Clause"
] | null | null | null | test/test_namespace.py | dbs/rdflib | 2344de99e2ded84b3aa273d4ee8ead210d571637 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from rdflib.namespace import DCTERMS
from rdflib.graph import Graph
from rdflib.term import URIRef
from rdflib.py3compat import b
class NamespaceTest(unittest.TestCase):
def test_dcterms_title(self):
self.assertEqual(DCTERMS.title, URIRef(DCTERMS + 'title'))
class NamespacePrefixTest(un... | 36.098039 | 97 | 0.608365 |
79752279a64db5d591ffaa8ee1d4a932463e1f25 | 17,938 | py | Python | fairseq/tasks/translation.py | salvacarrion/fairseq | 009552b09d8e2a66706cfe0474af6db4ff1e41d0 | [
"MIT"
] | null | null | null | fairseq/tasks/translation.py | salvacarrion/fairseq | 009552b09d8e2a66706cfe0474af6db4ff1e41d0 | [
"MIT"
] | null | null | null | fairseq/tasks/translation.py | salvacarrion/fairseq | 009552b09d8e2a66706cfe0474af6db4ff1e41d0 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass, field
import itertools
import json
import logging
import os
from typing import Optional
from argparse impor... | 36.02008 | 108 | 0.601405 |
797522b4be3ffa9157b4bee4d2011e733091e4d0 | 1,206 | py | Python | ahc/ahc002/ahc002a.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | ahc/ahc002/ahc002a.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | ahc/ahc002/ahc002a.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | def main():
from time import time
from heapq import heappush, heappop
start = time()
si, sj = map(int, input().split())
t = [list(map(int, input().split())) for _ in range(50)]
p = [list(map(int, input().split())) for _ in range(50)]
def is_time_ok():
return time() - start < 1.95
... | 30.15 | 80 | 0.471808 |
797523c3650f4fb1e5605d57362d6d3b7e73d2e6 | 2,482 | py | Python | src/python/pants/engine/internals/options_parsing.py | ArthV/pants | 0aa7f290ed390ab3ceba0c44e4b38354d7a41d3d | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/internals/options_parsing.py | ArthV/pants | 0aa7f290ed390ab3ceba0c44e4b38354d7a41d3d | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/internals/options_parsing.py | ArthV/pants | 0aa7f290ed390ab3ceba0c44e4b38354d7a41d3d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from dataclasses import dataclass
from pants.build_graph.build_configuration import BuildConfiguration
from pants.engine.internals.session import SessionValues
from pants.engine.rules imp... | 35.971014 | 99 | 0.798147 |
7975240dd6c18db90f391221458c7bba4562b77b | 142 | py | Python | myfuc/__init__.py | kamomehz/waveletCodingCNN | 50c7db9d986039ded38999b7e4f4265e2250fb90 | [
"MIT"
] | null | null | null | myfuc/__init__.py | kamomehz/waveletCodingCNN | 50c7db9d986039ded38999b7e4f4265e2250fb90 | [
"MIT"
] | null | null | null | myfuc/__init__.py | kamomehz/waveletCodingCNN | 50c7db9d986039ded38999b7e4f4265e2250fb90 | [
"MIT"
] | null | null | null | from .makeData import *
from .makeImg import *
from .makeNet import *
from .makeWT import *
from .makePlot import *
from .trainScript import * | 23.666667 | 26 | 0.753521 |
79752484c92c6b6bcde2eafa94e3a08859a020de | 9,063 | py | Python | linalgeuc/graphics/camera.py | aneziac/linalgeuc | ecbfa9bb1d5e8491198c8e8499a27498b9e047b0 | [
"MIT"
] | null | null | null | linalgeuc/graphics/camera.py | aneziac/linalgeuc | ecbfa9bb1d5e8491198c8e8499a27498b9e047b0 | [
"MIT"
] | null | null | null | linalgeuc/graphics/camera.py | aneziac/linalgeuc | ecbfa9bb1d5e8491198c8e8499a27498b9e047b0 | [
"MIT"
] | null | null | null | import linalgeuc.math.linear_algebra as lalib
from linalgeuc.graphics.entity import Entity
from linalgeuc.graphics.mesh import Mesh
from linalgeuc.graphics.primitive import Line
import pygame as pg
from pygame.locals import *
import math
import sys
class Camera(Entity):
fov_keys = "op"
def __init__(self, dim... | 38.079832 | 118 | 0.567582 |
79752530463466f61279dd3849d754b18d5485c0 | 21,446 | py | Python | pymatgen/ext/optimade.py | pzarabadip/pymatgen | b8b27c6fa3236f032581aa82f668b25a78aa3b57 | [
"MIT"
] | null | null | null | pymatgen/ext/optimade.py | pzarabadip/pymatgen | b8b27c6fa3236f032581aa82f668b25a78aa3b57 | [
"MIT"
] | null | null | null | pymatgen/ext/optimade.py | pzarabadip/pymatgen | b8b27c6fa3236f032581aa82f668b25a78aa3b57 | [
"MIT"
] | null | null | null | """
Optimade support.
"""
import logging
import sys
from collections import namedtuple
from os.path import join
from typing import Dict, Union, List, Optional
from urllib.parse import urlparse
import requests
#from retrying import retry
from pymatgen.core.periodic_table import DummySpecies
from pymatgen.core.structu... | 40.694497 | 117 | 0.612142 |
797525835a4f2e446ea698e879d8f6763b79b9c5 | 1,368 | py | Python | q070.py | sjf/project_euler | 8514710e2018136ba8a087ae58cba35370700f6f | [
"MIT"
] | null | null | null | q070.py | sjf/project_euler | 8514710e2018136ba8a087ae58cba35370700f6f | [
"MIT"
] | null | null | null | q070.py | sjf/project_euler | 8514710e2018136ba8a087ae58cba35370700f6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import lib
N=10_000_000
sieve = lib.prime_sieve(N+1)
_factors = {}
def prime_factors(n):
if n in _factors:
return _factors[n]
if sieve[n]:
_factors[n] = [n]
return set([n])
num = n
result = set()
p=2
while p**2 <= n:
if n % p == 0:
result.add(p)
n //= p
... | 17.766234 | 52 | 0.578216 |
7975263552ef942e00b57d97cbe974bc416b25d4 | 13,368 | py | Python | testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSL_IsReportSent_TTLSet_LowestOverrideTTL.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSL_IsReportSent_TTLSet_LowestOverrideTTL.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSL_IsReportSent_TTLSet_LowestOverrideTTL.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2021 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 52.837945 | 225 | 0.625823 |
7975268cf2847fe3d5252fff582f31a313c9350c | 196 | py | Python | Arrays/Shuffle_the_Array.py | thewires2/Leetcode | a37ff81d60dd9195ba637b970b40aabbea5f4680 | [
"Unlicense"
] | 1 | 2021-06-30T17:51:56.000Z | 2021-06-30T17:51:56.000Z | Arrays/Shuffle_the_Array.py | thewires2/Leetcode | a37ff81d60dd9195ba637b970b40aabbea5f4680 | [
"Unlicense"
] | null | null | null | Arrays/Shuffle_the_Array.py | thewires2/Leetcode | a37ff81d60dd9195ba637b970b40aabbea5f4680 | [
"Unlicense"
] | null | null | null | class Solution:
def shuffle(self, nums: List[int], n: int) -> List[int]:
a=[]
for i in range(n):
a.append(nums[i])
a.append(nums[i+n])
return a
| 24.5 | 60 | 0.479592 |
797527db737e469fb829e83fb050285a4cc99276 | 3,096 | py | Python | pythonUtils/coco_processor.py | MarcWong/matlabTools | 183b437707e2a9ddf7a8b5be0a4e874109fcfaa7 | [
"MIT"
] | null | null | null | pythonUtils/coco_processor.py | MarcWong/matlabTools | 183b437707e2a9ddf7a8b5be0a4e874109fcfaa7 | [
"MIT"
] | null | null | null | pythonUtils/coco_processor.py | MarcWong/matlabTools | 183b437707e2a9ddf7a8b5be0a4e874109fcfaa7 | [
"MIT"
] | null | null | null | # Author: Tao Hu <taohu620@gmail.com>
from pycocotools.coco import COCO
from pycocotools import mask
from tensorpack.utils.segmentation.segmentation import visualize_label
import numpy as np
coco_dataset = "/data1/dataset/coco/2014"
detection_json_train = "/data2/dataset/annotations/instances_train2014.json"
detect... | 36 | 149 | 0.643088 |
797528e2434198f07fa341eeceb0463ab91d2f20 | 23 | py | Python | neurolab/optimization/optim/__init__.py | udday2014/HebbianLearning | e0d17e53e3db8ce54b8fdd901702d2d6e0633732 | [
"MIT"
] | 6 | 2020-01-08T05:36:09.000Z | 2022-02-09T21:07:04.000Z | neurolab/optimization/optim/__init__.py | GabrieleLagani/HebbianPCA | 2736bb3017fa30ad2c160c891d42361bc5894df5 | [
"MIT"
] | null | null | null | neurolab/optimization/optim/__init__.py | GabrieleLagani/HebbianPCA | 2736bb3017fa30ad2c160c891d42361bc5894df5 | [
"MIT"
] | 2 | 2022-03-04T08:28:44.000Z | 2022-03-16T19:00:34.000Z | from .sgdoptim import * | 23 | 23 | 0.782609 |
797528f81e7780f8a70207d3ace7161b9876c181 | 9,619 | py | Python | lib/model/utils/net_utils.py | DIG-Beihang/PSN | 3d4d469bb2439a59a9e77c9135de2f2c5675494f | [
"Apache-2.0"
] | 10 | 2022-03-09T13:25:58.000Z | 2022-03-23T11:36:31.000Z | lib/model/utils/net_utils.py | DIG-Beihang/PSN | 3d4d469bb2439a59a9e77c9135de2f2c5675494f | [
"Apache-2.0"
] | 1 | 2022-03-13T12:15:58.000Z | 2022-03-18T13:07:02.000Z | lib/model/utils/net_utils.py | DIG-Beihang/PSN | 3d4d469bb2439a59a9e77c9135de2f2c5675494f | [
"Apache-2.0"
] | 2 | 2022-03-14T02:20:28.000Z | 2022-03-21T07:47:20.000Z | # coding:utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable,Function
import numpy as np
import torchvision.models as models
from model.utils.config import cfg
from model.roi_crop.functions.roi_crop import RoICropFunction
import cv2
import pdb
import random
from... | 31.537705 | 129 | 0.577503 |
797528fe0a4b46cbd487d58b7857920a98e087bd | 37,630 | py | Python | python/generator.py | marmalade/marmalade-libxslt | d6fbc6ef1bae4f16af93a2abcc4fe795b15f1c33 | [
"MIT"
] | null | null | null | python/generator.py | marmalade/marmalade-libxslt | d6fbc6ef1bae4f16af93a2abcc4fe795b15f1c33 | [
"MIT"
] | null | null | null | python/generator.py | marmalade/marmalade-libxslt | d6fbc6ef1bae4f16af93a2abcc4fe795b15f1c33 | [
"MIT"
] | 1 | 2020-02-28T18:40:45.000Z | 2020-02-28T18:40:45.000Z | #!/usr/bin/python -u
#
# generate python wrappers from the XML API description
#
functions = {}
enums = {} # { enumType: { enumConstant: enumValue } }
import string
#######################################################################
#
# That part if purely the API acquisition phase from the
# XML API descripti... | 40.725108 | 131 | 0.502285 |
79752a0c73cf79b1a4ecef45c377a2871c0831e3 | 4,910 | py | Python | CartPole-basic.py | rphilipzhang/AI-blog | 4eecce51e2a24763baf1274e19e374891952d2aa | [
"MIT"
] | null | null | null | CartPole-basic.py | rphilipzhang/AI-blog | 4eecce51e2a24763baf1274e19e374891952d2aa | [
"MIT"
] | null | null | null | CartPole-basic.py | rphilipzhang/AI-blog | 4eecce51e2a24763baf1274e19e374891952d2aa | [
"MIT"
] | null | null | null | # OpenGym CartPole-v0
# -------------------
#
# This code demonstrates use of a basic Q-network (without target network)
# to solve OpenGym CartPole-v0 problem.
#
# Made as part of blog series Let's make a DQN, available at:
# https://jaromiru.com/2016/10/03/lets-make-a-dqn-implementation/
#
# author: Jaromir Janisch... | 27.58427 | 113 | 0.560081 |
79752a2b5d4d99abfc003af4d32e87f9e57b6395 | 3,714 | py | Python | jc/parsers/timedatectl.py | amintong/jc | 4140939bbf74bada6e062143ceba777c129f1955 | [
"MIT"
] | null | null | null | jc/parsers/timedatectl.py | amintong/jc | 4140939bbf74bada6e062143ceba777c129f1955 | [
"MIT"
] | null | null | null | jc/parsers/timedatectl.py | amintong/jc | 4140939bbf74bada6e062143ceba777c129f1955 | [
"MIT"
] | null | null | null | """jc - JSON Convert `timedatectl` command output parser
The `epoch_utc` calculated timestamp field is timezone-aware and is only
available if the `universal_time` field is available.
Usage (cli):
$ timedatectl | jc --timedatectl
or
$ jc timedatectl
Usage (module):
import jc
result = jc.parse... | 27.511111 | 91 | 0.588584 |
79752a501a240b5c3ed2fae7000a6529b66622e3 | 14,410 | py | Python | examples/widgets_overview_app.py | saddy001/remi | 1dd886a55b0d2750880253508df43c90db4f0b08 | [
"Apache-2.0"
] | 1 | 2018-03-30T16:57:49.000Z | 2018-03-30T16:57:49.000Z | examples/widgets_overview_app.py | saddy001/remi | 1dd886a55b0d2750880253508df43c90db4f0b08 | [
"Apache-2.0"
] | null | null | null | examples/widgets_overview_app.py | saddy001/remi | 1dd886a55b0d2750880253508df43c90db4f0b08 | [
"Apache-2.0"
] | null | null | null | """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed ... | 45.746032 | 165 | 0.654684 |
79752b2cb9f89011ab9e502585f13c8cfa304f28 | 5,648 | py | Python | utils/profile/watershed/util/input/watershed_infer_profile.py | CBIIT/nci-hitif | 2f825cbcba92ff2fdffac60de56604578f31e937 | [
"MIT"
] | null | null | null | utils/profile/watershed/util/input/watershed_infer_profile.py | CBIIT/nci-hitif | 2f825cbcba92ff2fdffac60de56604578f31e937 | [
"MIT"
] | 8 | 2020-04-13T18:52:30.000Z | 2022-02-10T01:18:21.000Z | utils/profile/watershed/util/input/watershed_infer_profile.py | CBIIT/nci-hitif | 2f825cbcba92ff2fdffac60de56604578f31e937 | [
"MIT"
] | 3 | 2018-07-10T15:19:54.000Z | 2021-02-16T17:10:01.000Z | from remove_large_objects import *
from skimage.morphology import remove_small_objects
from skimage.segmentation import watershed
from skimage.measure import label
from skimage.morphology import closing, disk
from skimage.transform import resize
import configparser
# import tensorflow as tf
from keras.models import Mod... | 35.522013 | 108 | 0.655099 |
79752bbfba0bd7536fefd4016962b345865010c5 | 1,319 | py | Python | project/models.py | lindychi/mnec | 3d18f257ed3b0bc327340de988e7552e035dbec1 | [
"MIT"
] | 1 | 2018-02-20T13:46:41.000Z | 2018-02-20T13:46:41.000Z | project/models.py | lindychi/mnec | 3d18f257ed3b0bc327340de988e7552e035dbec1 | [
"MIT"
] | 53 | 2017-10-10T02:43:22.000Z | 2022-03-11T23:15:05.000Z | project/models.py | lindychi/mnec | 3d18f257ed3b0bc327340de988e7552e035dbec1 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.contrib.auth import get_user_model
# Create your models here.
class Project(models.Model):
author = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
title = models.CharField(max_length=255)
created_date = models.DateTim... | 45.482759 | 120 | 0.736922 |
79752cf7c158ade7d0783cccb5ac3763d110ed47 | 8,427 | py | Python | env/lib/python3.8/site-packages/shapely/_buildcfg.py | CristianCristanchoT/predyctiva | d745f9d687dc0de0a1615ee219b86a9d68571782 | [
"MIT"
] | 6 | 2021-04-26T15:50:00.000Z | 2022-01-11T16:46:35.000Z | env/lib/python3.8/site-packages/shapely/_buildcfg.py | CristianCristanchoT/predyctiva | d745f9d687dc0de0a1615ee219b86a9d68571782 | [
"MIT"
] | 7 | 2021-06-04T23:45:15.000Z | 2022-03-12T00:44:14.000Z | env/lib/python3.8/site-packages/shapely/_buildcfg.py | CristianCristanchoT/predyctiva | d745f9d687dc0de0a1615ee219b86a9d68571782 | [
"MIT"
] | 2 | 2021-01-20T12:39:49.000Z | 2021-02-11T10:08:16.000Z | """
Minimal proxy to a GEOS C dynamic library, which is system dependant
Two environment variables influence this module: GEOS_LIBRARY_PATH and/or
GEOS_CONFIG.
If GEOS_LIBRARY_PATH is set to a path to a GEOS C shared library, this is
used. Otherwise GEOS_CONFIG can be set to a path to `geos-config`. If
`geos-config` ... | 33.3083 | 78 | 0.603655 |
79752d5031faf4e3318f8a706989a3de33d1fd5e | 27,006 | py | Python | src/app/utils.py | tjasmith/spdx-online-tools | 1606de206707a951e4984a144ab6fadbb2f25e8d | [
"Apache-2.0"
] | null | null | null | src/app/utils.py | tjasmith/spdx-online-tools | 1606de206707a951e4984a144ab6fadbb2f25e8d | [
"Apache-2.0"
] | null | null | null | src/app/utils.py | tjasmith/spdx-online-tools | 1606de206707a951e4984a144ab6fadbb2f25e8d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright (c) 2018 Tushar Mittal
# 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... | 43.769854 | 566 | 0.642783 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.