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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
794bb84bac8a6b82aaa034636e975968bd63ad5a | 754 | py | Python | pm4pyws/handlers/parquet/statistics/case_duration.py | ehbasouri/pm4py-ws | 9bf5f88848a4aa2873bae86af95d37f64ae1dde1 | [
"Apache-2.0"
] | null | null | null | pm4pyws/handlers/parquet/statistics/case_duration.py | ehbasouri/pm4py-ws | 9bf5f88848a4aa2873bae86af95d37f64ae1dde1 | [
"Apache-2.0"
] | null | null | null | pm4pyws/handlers/parquet/statistics/case_duration.py | ehbasouri/pm4py-ws | 9bf5f88848a4aa2873bae86af95d37f64ae1dde1 | [
"Apache-2.0"
] | null | null | null | from pm4py.statistics.traces.pandas import case_statistics
from pm4py.visualization.common.utils import get_base64_from_file
from pm4py.visualization.graphs import factory as graphs_factory
def get_case_duration_svg(dataframe, parameters=None):
"""
Gets the SVG of the case duration graph
Parameters
-... | 26 | 89 | 0.690981 |
794bb8756a2767062ef55c0d8c1e48e4940bfaf2 | 3,538 | py | Python | bindings/python/ensmallen/datasets/string/firmicutesbacteriumcag1295924.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/firmicutesbacteriumcag1295924.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/firmicutesbacteriumcag1295924.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Firmicutes bacterium CAG:129_59_24.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prot... | 33.695238 | 223 | 0.682024 |
794bb89f6a43d741d1f3dc68f51a4505b0915254 | 7,568 | py | Python | python/Utility/Metric.py | billy000400/MLTracking | e5bd3e1f51919a093bb05d78ec9c3fa7877c3744 | [
"MIT"
] | null | null | null | python/Utility/Metric.py | billy000400/MLTracking | e5bd3e1f51919a093bb05d78ec9c3fa7877c3744 | [
"MIT"
] | 1 | 2021-01-03T08:57:34.000Z | 2021-01-03T23:41:22.000Z | python/Utility/Metric.py | billy000400/MLTracking | e5bd3e1f51919a093bb05d78ec9c3fa7877c3744 | [
"MIT"
] | null | null | null | import sys
from pathlib import Path
import tensorflow as tf
from tensorflow.math import exp
from tensorflow.keras.metrics import (
binary_accuracy,
categorical_accuracy
)
from tensorflow.keras.backend import print_tensor
def union(rec_a, rec_b, intersection):
area_a = (rec_a[1]-rec_a[0])*(rec_a[3]-rec_a[... | 29.107692 | 95 | 0.661734 |
794bb8e30c46ec5c32f0a9463b9253fb2abf73d2 | 1,144 | py | Python | aliyun-python-sdk-kms/aliyunsdkkms/request/v20160120/DescribeKeyRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-kms/aliyunsdkkms/request/v20160120/DescribeKeyRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-kms/aliyunsdkkms/request/v20160120/DescribeKeyRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.903226 | 70 | 0.758741 |
794bbbc8832857f6ce2a94dcd41cacc777edef6a | 2,219 | py | Python | Assignment4/src/lr-mnist.py | haniamatera/cds-visual_new | 91c52cb607c839e6b23881aca047bda7c9888b29 | [
"MIT"
] | null | null | null | Assignment4/src/lr-mnist.py | haniamatera/cds-visual_new | 91c52cb607c839e6b23881aca047bda7c9888b29 | [
"MIT"
] | null | null | null | Assignment4/src/lr-mnist.py | haniamatera/cds-visual_new | 91c52cb607c839e6b23881aca047bda7c9888b29 | [
"MIT"
] | null | null | null | #____Assignment4_____#
#building logistic regression classifier
#importing necessary packages
import os
import sys
import argparse
sys.path.append(os.path.join(".."))
# Import teaching utils
import numpy as np
import utils.classifier_utils as clf_util
# Import sklearn metrics
from sklearn import metrics
from skle... | 26.105882 | 117 | 0.623704 |
794bbc0db73a1729cb2327a988be13bb335c218c | 209 | py | Python | giico/giico/doctype/downhole_test/test_downhole_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | giico/giico/doctype/downhole_test/test_downhole_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | giico/giico/doctype/downhole_test/test_downhole_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, VHRS and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestDownholeTest(unittest.TestCase):
pass
| 19 | 43 | 0.760766 |
794bbc44ceab57ac9e99dfb2d8c734893ace0212 | 10,355 | py | Python | mpunet/models/unet.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | null | null | null | mpunet/models/unet.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | null | null | null | mpunet/models/unet.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | null | null | null | """
Mathias Perslev
MSc Bioinformatics
University of Copenhagen
November 2017
"""
from mpunet.logging import ScreenLogger
from mpunet.utils.conv_arithmetics import compute_receptive_fields
from tensorflow.keras.models import Model
from tensorflow.keras import regularizers
from tensorflow.keras.layers import Input, B... | 41.25498 | 108 | 0.555577 |
794bbcb1eaaf6bc339ecb8d76aa7af0261265622 | 3,461 | py | Python | statick_tool/plugins/reporting/json_reporting_plugin.py | xydesa/statick | 22d863306bfd6fe411758e5807ae036679a309c5 | [
"CC0-1.0"
] | 1 | 2022-01-25T16:08:45.000Z | 2022-01-25T16:08:45.000Z | statick_tool/plugins/reporting/json_reporting_plugin.py | xydesa/statick | 22d863306bfd6fe411758e5807ae036679a309c5 | [
"CC0-1.0"
] | 1 | 2020-05-06T01:41:35.000Z | 2020-05-06T01:41:35.000Z | statick_tool/plugins/reporting/json_reporting_plugin.py | jhdcs/statick | 121ab511f206967c587d70d88217ae23db84726d | [
"CC0-1.0"
] | null | null | null | """Prints the Statick reports out to the terminal or file in JSON format."""
import json
import logging
import os
from collections import OrderedDict
from typing import Dict, List, Optional, Tuple
from statick_tool.issue import Issue
from statick_tool.package import Package
from statick_tool.reporting_plugin import Re... | 37.215054 | 84 | 0.605894 |
794bbd750be049a9bf66d2174d199b24017ef01f | 1,580 | py | Python | new_representation.py | dsoumis/NeuralNetworks_Intro | 9f11600faf867dc6b137848e66f391a9564e137d | [
"MIT"
] | null | null | null | new_representation.py | dsoumis/NeuralNetworks_Intro | 9f11600faf867dc6b137848e66f391a9564e137d | [
"MIT"
] | null | null | null | new_representation.py | dsoumis/NeuralNetworks_Intro | 9f11600faf867dc6b137848e66f391a9564e137d | [
"MIT"
] | null | null | null | import sys
import keras
import numpy
import pandas
from keras import layers
from keras.models import load_model
def assign_values_from_arguments():
inp = ""
mod = ""
if len(sys.argv) != 5:
print("Please re-run with correct arguments.")
sys.exit()
for i in range(len(sys.argv)):
... | 30.980392 | 116 | 0.662658 |
794bbd99359b99748bf7d022cc0145eb5cb1d88b | 1,087 | py | Python | websites/__init__.py | briangmaddox/NewsArticleExtractor | 2225392cfb5500477a3dfd2602100c8d41d83432 | [
"MIT"
] | 1 | 2021-07-29T16:04:40.000Z | 2021-07-29T16:04:40.000Z | websites/__init__.py | briangmaddox/NewsArticleExtractor | 2225392cfb5500477a3dfd2602100c8d41d83432 | [
"MIT"
] | null | null | null | websites/__init__.py | briangmaddox/NewsArticleExtractor | 2225392cfb5500477a3dfd2602100c8d41d83432 | [
"MIT"
] | null | null | null | from importlib import import_module
from .ExtractedArticle import ExtractedArticle
from .WebsiteBase import WebsiteBase
import multiprocessing
import configparser
# **********************************************************************************************************************
def WebsiteFactory(inURL: tuple, i... | 31.970588 | 123 | 0.628335 |
794bbf0b07fe0f89418ac2847dcffe40886e4c09 | 3,693 | py | Python | utils/generate_test_splits.py | bertop89/fnc-1-baseline | c15343b1563a137a293e3b37c57088d09e370365 | [
"Apache-2.0"
] | 1 | 2021-03-06T05:18:27.000Z | 2021-03-06T05:18:27.000Z | utils/generate_test_splits.py | bertop89/fnc-1-baseline | c15343b1563a137a293e3b37c57088d09e370365 | [
"Apache-2.0"
] | null | null | null | utils/generate_test_splits.py | bertop89/fnc-1-baseline | c15343b1563a137a293e3b37c57088d09e370365 | [
"Apache-2.0"
] | null | null | null | import random
import os
from collections import defaultdict
import numpy as np
from random import randint
def generate_hold_out_split (dataset, training = 0.8, base_dir="splits"):
r = random.Random()
r.seed(1489215)
article_ids = list(dataset.articles.keys()) # get a list of article ids
r.shuffle(ar... | 37.30303 | 117 | 0.636068 |
794bbf8c1d30033d6e60c0b339503ab5ad0c3622 | 2,241 | py | Python | listings/choises.py | MalYou/btre | 0959dabe4f6790c7f6274662e3886cb149b85941 | [
"MIT"
] | null | null | null | listings/choises.py | MalYou/btre | 0959dabe4f6790c7f6274662e3886cb149b85941 | [
"MIT"
] | null | null | null | listings/choises.py | MalYou/btre | 0959dabe4f6790c7f6274662e3886cb149b85941 | [
"MIT"
] | null | null | null | bedroom_choices = {
'1':1,
'2':2,
'3':3,
'4':4,
'5':5,
'6':6,
'7':7,
'8':8,
'9':9,
'10':10
}
price_choices = {
'100000':'$100,000',
'200000':'$200,000',
'300000':'$300,000',
'400000':'$400,000',
'500000':'$500,000',
'6... | 26.364706 | 45 | 0.354306 |
794bc2060be7f738b456c5638e741ea22e6fc7d5 | 9,376 | py | Python | test/box-py/iproto.test.py | ocelot-inc/tarantool | 47fdd0edf29d79b8a0d33a8d0716146e31bac644 | [
"BSD-2-Clause"
] | 1 | 2018-10-01T04:54:39.000Z | 2018-10-01T04:54:39.000Z | test/box-py/iproto.test.py | ocelot-inc/tarantool | 47fdd0edf29d79b8a0d33a8d0716146e31bac644 | [
"BSD-2-Clause"
] | null | null | null | test/box-py/iproto.test.py | ocelot-inc/tarantool | 47fdd0edf29d79b8a0d33a8d0716146e31bac644 | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
import struct
import socket
import msgpack
from tarantool.const import *
from tarantool import Connection
from tarantool.request import Request, RequestInsert, RequestSelect
from tarantool.response import Response
from lib.tarantool_connection import TarantoolConnection
admin("box.schema.user.gran... | 31.149502 | 84 | 0.658276 |
794bc249aaee81b00150cbcab3011e6c2a0f63f5 | 200 | py | Python | routing_only/no1_base_app.py | thinkAmi-sandbox/wsgi_framework-sample | ce9c3ef19aa179e429bb6c4facc27387fd12b1f7 | [
"Unlicense"
] | 1 | 2018-05-14T15:35:39.000Z | 2018-05-14T15:35:39.000Z | routing_only/no1_base_app.py | thinkAmi-sandbox/wsgi_framework-sample | ce9c3ef19aa179e429bb6c4facc27387fd12b1f7 | [
"Unlicense"
] | null | null | null | routing_only/no1_base_app.py | thinkAmi-sandbox/wsgi_framework-sample | ce9c3ef19aa179e429bb6c4facc27387fd12b1f7 | [
"Unlicense"
] | 1 | 2018-12-07T13:07:47.000Z | 2018-12-07T13:07:47.000Z | # python server.py no1_base_app:application
# URLに関係なく、同じ値を返す
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return [b"Hello, world."] | 40 | 63 | 0.71 |
794bc2dd54f1564d83f3b87cbf9d8830e471eea6 | 4,016 | py | Python | tensorflow/lite/testing/op_tests/batch_to_space_nd.py | chuanqi129/tensorflow | 84eb083bb5328912dde064b8b0f61d28c6edbe43 | [
"Apache-2.0"
] | 57 | 2017-09-03T07:08:31.000Z | 2022-02-28T04:33:42.000Z | tensorflow/lite/testing/op_tests/batch_to_space_nd.py | chuanqi129/tensorflow | 84eb083bb5328912dde064b8b0f61d28c6edbe43 | [
"Apache-2.0"
] | 8 | 2019-03-13T23:13:47.000Z | 2020-01-31T21:08:21.000Z | tensorflow/lite/testing/op_tests/batch_to_space_nd.py | chuanqi129/tensorflow | 84eb083bb5328912dde064b8b0f61d28c6edbe43 | [
"Apache-2.0"
] | 28 | 2017-03-25T13:48:09.000Z | 2021-10-14T00:10:50.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.844037 | 80 | 0.620518 |
794bc55c7f842d06068dac7343db0e49bf8b26fa | 61,705 | py | Python | sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py | omziv/azure-sdk-for-python | 3fbb0f9e1f86acc4e0a8cb13b790dccf32e3860f | [
"MIT"
] | 1 | 2021-09-16T02:33:52.000Z | 2021-09-16T02:33:52.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py | omziv/azure-sdk-for-python | 3fbb0f9e1f86acc4e0a8cb13b790dccf32e3860f | [
"MIT"
] | 2 | 2021-08-24T15:32:30.000Z | 2021-08-24T23:21:34.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py | omziv/azure-sdk-for-python | 3fbb0f9e1f86acc4e0a8cb13b790dccf32e3860f | [
"MIT"
] | 1 | 2016-04-19T22:15:47.000Z | 2016-04-19T22:15:47.000Z | # pylint: disable=too-many-lines
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ----------------------------------------------------... | 50.953757 | 130 | 0.650304 |
794bc5b542a5c31360ed970052c6f0a46f96b251 | 20,691 | py | Python | gammapy/data/observations.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | gammapy/data/observations.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | gammapy/data/observations.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import collections.abc
import copy
import logging
import numpy as np
from astropy.coordinates import SkyCoord
from astropy.time import Time
from astropy.units import Quantity
import astropy.units as u
from gammapy.utils.fits import LazyFitsData, earth_loca... | 32.07907 | 142 | 0.601421 |
794bc66a361240d621510a3afb17354df6802cc9 | 1,267 | py | Python | setup.py | Abstract-Horizon/pyros-client | f59512708eb84a05f4657b20479200366c0072b6 | [
"Apache-2.0"
] | null | null | null | setup.py | Abstract-Horizon/pyros-client | f59512708eb84a05f4657b20479200366c0072b6 | [
"Apache-2.0"
] | null | null | null | setup.py | Abstract-Horizon/pyros-client | f59512708eb84a05f4657b20479200366c0072b6 | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Copyright (C) 2016-2020 Abstract Horizon
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License v2.0
# which accompanies this distribution, and is available at
# http... | 31.675 | 81 | 0.596685 |
794bc7db4df35273ce8e654d7513dd9d93f62fc8 | 1,400 | py | Python | config/asgi.py | gp-shubham/django-graphql-boilerplate | 0d19aa1bd0bac23d993d91942685f75d8bf0a238 | [
"MIT"
] | null | null | null | config/asgi.py | gp-shubham/django-graphql-boilerplate | 0d19aa1bd0bac23d993d91942685f75d8bf0a238 | [
"MIT"
] | null | null | null | config/asgi.py | gp-shubham/django-graphql-boilerplate | 0d19aa1bd0bac23d993d91942685f75d8bf0a238 | [
"MIT"
] | 1 | 2021-07-03T05:36:11.000Z | 2021-07-03T05:36:11.000Z | """
ASGI config for Graphql Project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/asgi/
"""
import os
import sys
from pathlib import Path
from django.core.asgi import get_asgi_appl... | 34.146341 | 85 | 0.774286 |
794bc8c30978fd25bc135bcdf14c330fec9bfa97 | 801 | py | Python | tests/providers/local/conftest.py | inmanta/terraform | d60855493e75d4eb570c4a357e79584153e51833 | [
"Apache-2.0"
] | 1 | 2021-12-23T13:51:39.000Z | 2021-12-23T13:51:39.000Z | tests/providers/local/conftest.py | inmanta/terraform | d60855493e75d4eb570c4a357e79584153e51833 | [
"Apache-2.0"
] | 11 | 2022-01-04T14:03:10.000Z | 2022-03-16T14:50:11.000Z | tests/providers/local/conftest.py | inmanta/terraform | d60855493e75d4eb570c4a357e79584153e51833 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2021 Inmanta
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 ... | 32.04 | 76 | 0.742821 |
794bc8efbba73ea85c13a1a718b28ddd3837ab90 | 5,832 | py | Python | dask_image/ndfilters/_utils.py | martinschorb/dask-image | 03242d151db30b4adce3d6c7f43c05d1e7580bb5 | [
"BSD-3-Clause"
] | null | null | null | dask_image/ndfilters/_utils.py | martinschorb/dask-image | 03242d151db30b4adce3d6c7f43c05d1e7580bb5 | [
"BSD-3-Clause"
] | null | null | null | dask_image/ndfilters/_utils.py | martinschorb/dask-image | 03242d151db30b4adce3d6c7f43c05d1e7580bb5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
import collections
import inspect
import numbers
import re
import numpy
def _get_docstring(func):
# Drop the output parameter from the docstring.
split_doc_params = lambda s: re.subn( # noqa: E731
"( [A-Za-z]+ : )", ... | 30.857143 | 86 | 0.646433 |
794bc9d02263144a81e2a4e55a587bdfe901de99 | 465 | py | Python | configy/helpers.py | grigi/configy | 86f6bdd3164f39e83e82e3527f5863032c0ed1e7 | [
"MIT"
] | 3 | 2015-09-18T13:06:04.000Z | 2021-08-10T16:37:21.000Z | configy/helpers.py | grigi/configy | 86f6bdd3164f39e83e82e3527f5863032c0ed1e7 | [
"MIT"
] | null | null | null | configy/helpers.py | grigi/configy | 86f6bdd3164f39e83e82e3527f5863032c0ed1e7 | [
"MIT"
] | null | null | null | '''
Contains helper tools for handling configuration
'''
def to_bool(val, default=False):
'''
Converts string to bool
True
'y', 'yes', '1', 't','true'
False
'n', 'no', '0', 'f', 'false'
else
defaults to default (False, by default)
'''
val = str(val).lower()
if v... | 20.217391 | 48 | 0.503226 |
794bca0043370333f5235f241ddb0a49ee77c0d9 | 588 | py | Python | crawler/pipelines.py | lisathung/Manga-Crawler | feb606ad785bfb5c75979c16511a54c94dd710aa | [
"MIT"
] | null | null | null | crawler/pipelines.py | lisathung/Manga-Crawler | feb606ad785bfb5c75979c16511a54c94dd710aa | [
"MIT"
] | null | null | null | crawler/pipelines.py | lisathung/Manga-Crawler | feb606ad785bfb5c75979c16511a54c94dd710aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import scrapy
from scrapy.pipelines.images import ImagesPipeline
class CustomImageNamePipeline(ImagesPipeline):
def get_... | 34.588235 | 67 | 0.70068 |
794bcaa01121b38f463ad9728cf423b8422f636a | 633 | py | Python | examples/ch03/exercises_ch03/ex3_9.py | edson-gomes/Intro-to-Python | 00a2f549916616b0f2036401573e35d66317f998 | [
"MIT"
] | null | null | null | examples/ch03/exercises_ch03/ex3_9.py | edson-gomes/Intro-to-Python | 00a2f549916616b0f2036401573e35d66317f998 | [
"MIT"
] | null | null | null | examples/ch03/exercises_ch03/ex3_9.py | edson-gomes/Intro-to-Python | 00a2f549916616b0f2036401573e35d66317f998 | [
"MIT"
] | null | null | null | """(Separando os dígitos em um inteiro) No exercício 2.11, você escreveu um script para separar um inteiro de 5 dígitos em seus dígitos individuais e mostrá-los. Reimplemente seu script utilizando um laço que, em cada iteração,'pegue' um dígito (da esquerda para a direita) utilizando os operadores // e % para, então, m... | 48.692308 | 342 | 0.685624 |
794bcb106b0790928259187f7300017d86bc5ba9 | 93,695 | py | Python | kowalski/api.py | dmitryduev/kowalski-dev | 0d568dff8e3f25ed522127584a22dfcef08420d8 | [
"MIT"
] | null | null | null | kowalski/api.py | dmitryduev/kowalski-dev | 0d568dff8e3f25ed522127584a22dfcef08420d8 | [
"MIT"
] | 5 | 2020-05-12T07:29:40.000Z | 2020-09-28T19:17:23.000Z | kowalski/api.py | dmitryduev/kowalski-dev | 0d568dff8e3f25ed522127584a22dfcef08420d8 | [
"MIT"
] | null | null | null | from abc import ABC
from aiohttp import web, ClientSession
from aiohttp_swagger3 import SwaggerDocs, ReDocUiSettings
from astropy.io import fits
from astropy.visualization import (
AsymmetricPercentileInterval,
MinMaxInterval,
ZScaleInterval,
LinearStretch,
LogStretch,
AsinhStretch,
SqrtStre... | 32.991197 | 154 | 0.481936 |
794bcb4ad0f0f5831aa87b1b69f4dae995050d2f | 18,227 | py | Python | pycket/values_string.py | krono/pycket | 5eff3401ce5cf34b16863b669ac9e274edabbe00 | [
"MIT"
] | null | null | null | pycket/values_string.py | krono/pycket | 5eff3401ce5cf34b16863b669ac9e274edabbe00 | [
"MIT"
] | null | null | null | pycket/values_string.py | krono/pycket | 5eff3401ce5cf34b16863b669ac9e274edabbe00 | [
"MIT"
] | null | null | null | from pycket.base import W_Object, SingletonMeta
from pycket.error import SchemeException
from pycket import config
from rpython.rlib import rerased, jit
from rpython.rlib.objectmodel import compute_hash, we_are_translated
from rpython.rlib.unicodedata import unicodedb_6_2_0 as unicodedb
from rpython.rlib.rstring i... | 30.89322 | 96 | 0.654249 |
794bcb659c3b95c512e3489b131be74998ac04e6 | 8,673 | py | Python | basic2/practice_3/cliff_td_comparison.py | linklab/e_learning_rl | 16c11c17dfb304959cb80912e29d0540e6ed6cd5 | [
"MIT"
] | 1 | 2020-11-22T06:30:45.000Z | 2020-11-22T06:30:45.000Z | basic2/practice_3/cliff_td_comparison.py | linklab/e_learning_rl | 16c11c17dfb304959cb80912e29d0540e6ed6cd5 | [
"MIT"
] | null | null | null | basic2/practice_3/cliff_td_comparison.py | linklab/e_learning_rl | 16c11c17dfb304959cb80912e29d0540e6ed6cd5 | [
"MIT"
] | null | null | null | import numpy as np
import os
import matplotlib.pyplot as plt
import random
from basic.practice_1.cliff import CliffGridWorld
# 그리드월드 높이와 너비
GRID_HEIGHT = 4
GRID_WIDTH = 12
NUM_ACTIONS = 4
# 탐색 확률
EPSILON = 0.1
# 스텝 사이즈
ALPHA = 0.5
# 감가율
GAMMA = 1.0
# 초기 상태와 종료 상태
START_STATE = (3, 0)
TERMINAL_STATES = [(3, 11)]
... | 30.975 | 135 | 0.617318 |
794bcb6a28ecd69992c718122e60bb205f3053fc | 6,456 | py | Python | api/tests/test_user_actions.py | jcuna/room-mgt | 84c071b5f3a2e6276f0064fd3f5a8ea3d87b58f7 | [
"MIT"
] | null | null | null | api/tests/test_user_actions.py | jcuna/room-mgt | 84c071b5f3a2e6276f0064fd3f5a8ea3d87b58f7 | [
"MIT"
] | 21 | 2019-07-04T21:31:37.000Z | 2022-02-26T09:50:57.000Z | api/tests/test_user_actions.py | jcuna/room-mgt | 84c071b5f3a2e6276f0064fd3f5a8ea3d87b58f7 | [
"MIT"
] | null | null | null | from base64 import b64encode
from flask.testing import FlaskClient
from tests import endpoint, secret_key
from tests.injectors import resources
from tests.seeders import seed_project
class LocalUser(object):
id = None
token = None
pass
user = LocalUser()
def test_admin_create_user(client: FlaskClien... | 28.821429 | 96 | 0.630266 |
794bcb917398546e6f499649f0fa5435f49aa790 | 24 | py | Python | dora/__init__.py | caiertl/dora | eac67a0af6f943dfe93c6ddef7bb2192bd2516fe | [
"CC0-1.0"
] | 4 | 2017-11-15T23:09:52.000Z | 2018-08-21T11:28:46.000Z | dora/__init__.py | caiertl/dora | eac67a0af6f943dfe93c6ddef7bb2192bd2516fe | [
"CC0-1.0"
] | 1 | 2019-10-18T15:05:15.000Z | 2019-11-02T03:22:24.000Z | dora/__init__.py | caiertl/dora | eac67a0af6f943dfe93c6ddef7bb2192bd2516fe | [
"CC0-1.0"
] | 1 | 2020-04-30T17:24:52.000Z | 2020-04-30T17:24:52.000Z | __version__ = '0.2.1b0'
| 12 | 23 | 0.666667 |
794bcbf828a7c1ebada818d16dbda2838bcb8a10 | 1,405 | py | Python | python/datawrangling/datawrangling.py | imjoseangel/100DaysOfCode | bff90569033e2b02a56e893bd45727125962aeb3 | [
"MIT"
] | 1 | 2022-03-30T12:59:44.000Z | 2022-03-30T12:59:44.000Z | python/datawrangling/datawrangling.py | imjoseangel/100DaysOfCode | bff90569033e2b02a56e893bd45727125962aeb3 | [
"MIT"
] | null | null | null | python/datawrangling/datawrangling.py | imjoseangel/100DaysOfCode | bff90569033e2b02a56e893bd45727125962aeb3 | [
"MIT"
] | 3 | 2019-08-13T11:33:36.000Z | 2022-03-08T22:00:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import os
import pandas as pd
import numpy as np
# Get File Directory
WORK_DIR = os.path.dirname((os.path.realpath(__file__)))
# Loading the json data as python ... | 27.019231 | 74 | 0.701779 |
794bcc194cbb321bf1fb61dcb7446cea90bbee34 | 3,312 | py | Python | tests/eth2/beacon/state_machines/test_state_transition.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | tests/eth2/beacon/state_machines/test_state_transition.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | tests/eth2/beacon/state_machines/test_state_transition.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | import pytest
from eth2.beacon.db.chain import BeaconChainDB
from eth2.beacon.state_machines.forks.serenity.blocks import (
SerenityBeaconBlock,
)
from eth2.beacon.tools.builder.proposer import (
create_mock_block,
)
from eth2.beacon.types.historical_batch import HistoricalBatch
@pytest.mark.parametrize(
... | 30.109091 | 98 | 0.619867 |
794bcc424dddeadbf5a66442604903c26090a77c | 1,342 | py | Python | build/lib/MyHeartCounts/download_minsetdata.py | AshleyLab/MyHeartCounts2.0 | 14b939cdb0f760eb891c91bf28e018d73362d03a | [
"MIT"
] | null | null | null | build/lib/MyHeartCounts/download_minsetdata.py | AshleyLab/MyHeartCounts2.0 | 14b939cdb0f760eb891c91bf28e018d73362d03a | [
"MIT"
] | null | null | null | build/lib/MyHeartCounts/download_minsetdata.py | AshleyLab/MyHeartCounts2.0 | 14b939cdb0f760eb891c91bf28e018d73362d03a | [
"MIT"
] | null | null | null | # import libraries
from MyHeartCounts import MyHeartCounts
##############################
print('Start')
# Initilize a MyHeartCounts object
# MHC = MyHeartCounts(user_password_file_path = 'synapseAccess.txt',synapseCachePath ='/oak/stanford/groups/euan/projects/mhc/code/ali_code/data/synapseCache')
MHC = MyHeartCounts... | 47.928571 | 159 | 0.742176 |
794bcd343047a914e811c1739e95dff14dc37a41 | 10,470 | py | Python | refitt/apps/refitt/api.py | refitt/ref | 3ccc398e7b95f77549ab77884b87f40abdd3effb | [
"Apache-2.0"
] | 4 | 2020-09-11T01:15:11.000Z | 2021-05-12T16:46:48.000Z | refitt/apps/refitt/api.py | refitt/ref | 3ccc398e7b95f77549ab77884b87f40abdd3effb | [
"Apache-2.0"
] | 12 | 2021-03-20T03:24:53.000Z | 2022-02-19T03:20:43.000Z | refitt/apps/refitt/api.py | refitt/ref | 3ccc398e7b95f77549ab77884b87f40abdd3effb | [
"Apache-2.0"
] | 2 | 2021-02-01T23:49:39.000Z | 2021-12-11T19:01:23.000Z | # SPDX-FileCopyrightText: 2019-2021 REFITT Team
# SPDX-License-Identifier: Apache-2.0
"""Make authenticated requests to the API."""
# type annotations
from __future__ import annotations
from typing import List, Dict, Callable, Optional, IO, Any, Union
# standard libs
import os
import sys
import json
import functool... | 36.736842 | 110 | 0.605349 |
794bcd4d616b5c1d83e26dd54aa9239463dd3572 | 6,827 | py | Python | mmdet/models/losses/ctdet_loss.py | lizhe960118/CenterNet | d1a0d13974e2316c6d127ca7860866cdd93bcfa7 | [
"Apache-2.0"
] | 92 | 2019-08-12T09:31:38.000Z | 2022-03-17T06:22:41.000Z | mmdet/models/losses/ctdet_loss.py | lizhe960118/CenterNet | d1a0d13974e2316c6d127ca7860866cdd93bcfa7 | [
"Apache-2.0"
] | 4 | 2019-08-15T09:06:01.000Z | 2020-12-25T06:46:36.000Z | mmdet/models/losses/ctdet_loss.py | lizhe960118/CenterNet | d1a0d13974e2316c6d127ca7860866cdd93bcfa7 | [
"Apache-2.0"
] | 18 | 2019-09-05T01:29:14.000Z | 2021-06-29T13:10:11.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
from ..registry import LOSSES
# def gaussian_radius(det_size, min_overlap=0.7):
# height, width = det_size
# a1 = 1
# b1 = (height + width)
# c1 = width * height * (1 - min_overlap) / (1 + min_overlap... | 36.508021 | 96 | 0.560422 |
794bcdd393a0352ab4dea5022f0f48ae278f182a | 78 | py | Python | snowplow_tracker/redis/__init__.py | DeyanDeyanov/snowplow-python-tracker | 8fc7f1e5ed9c0e1b1faf8b477be8412b4e2630c2 | [
"Apache-2.0"
] | 33 | 2015-02-07T12:25:32.000Z | 2022-03-08T14:54:51.000Z | snowplow_tracker/redis/__init__.py | DeyanDeyanov/snowplow-python-tracker | 8fc7f1e5ed9c0e1b1faf8b477be8412b4e2630c2 | [
"Apache-2.0"
] | 145 | 2015-01-02T19:15:40.000Z | 2022-03-04T16:12:21.000Z | snowplow_tracker/redis/__init__.py | kolonialno/snowplow-python-tracker | f4d4b9da49fe1584e82ee8f6230a54c789680097 | [
"Apache-2.0"
] | 56 | 2015-01-02T19:04:20.000Z | 2021-11-29T14:29:54.000Z | from .redis_emitter import RedisEmitter
from .redis_worker import RedisWorker
| 26 | 39 | 0.871795 |
794bcee81bd15f8a5dfdf6b51d57320ee64c233b | 912 | py | Python | packages/grid/apps/domain/src/main/routes/search/routes.py | exityan/PySyft | 35166c487a5be57f9ad28929ed88a8ba6bdd5aeb | [
"Apache-2.0"
] | 425 | 2019-09-22T06:14:53.000Z | 2022-03-30T02:17:34.000Z | packages/grid/apps/domain/src/main/routes/search/routes.py | Metrix1010/PySyft | 6477f64b63dc285059c3766deab3993653cead2e | [
"Apache-2.0"
] | 352 | 2019-09-17T15:32:51.000Z | 2022-03-12T01:07:35.000Z | packages/grid/apps/domain/src/main/routes/search/routes.py | Metrix1010/PySyft | 6477f64b63dc285059c3766deab3993653cead2e | [
"Apache-2.0"
] | 208 | 2019-09-18T18:32:10.000Z | 2022-03-24T01:10:11.000Z | # stdlib
import json
# third party
from flask import Response
from flask import request
from syft.grid.messages.network_search_message import NetworkSearchMessage
# grid relative
from ...core.task_handler import route_logic
from ..auth import error_handler
from ..auth import optional_token
from ..auth import token_re... | 25.333333 | 87 | 0.743421 |
794bcf34089f3da539f3c9b3f22a3af137d1ddd6 | 866 | py | Python | LeetCode/1.TwoSum.py | njnur/CP-Practice | 5c0ba7455262ae5704748c397bee729c82887a9a | [
"MIT"
] | null | null | null | LeetCode/1.TwoSum.py | njnur/CP-Practice | 5c0ba7455262ae5704748c397bee729c82887a9a | [
"MIT"
] | null | null | null | LeetCode/1.TwoSum.py | njnur/CP-Practice | 5c0ba7455262ae5704748c397bee729c82887a9a | [
"MIT"
] | null | null | null | from typing import List, Any
class Solution:
@staticmethod
def two_sum_bruteforce(nums: List[int], target: int) -> Any:
for index_1 in range(0, len(nums)):
num_to_find = target - nums[index_1]
for index_2 in range(index_1+1, len(nums)):
if num_to_find == nums[in... | 27.0625 | 64 | 0.554273 |
794bd017b8ac5f1ae9b1a4000c49341261f79430 | 719 | py | Python | abi.py | sonicskye/btcrelay-ui | 56abff6382a7546d3340f9d0f6eda5093b6b531b | [
"MIT"
] | null | null | null | abi.py | sonicskye/btcrelay-ui | 56abff6382a7546d3340f9d0f6eda5093b6b531b | [
"MIT"
] | null | null | null | abi.py | sonicskye/btcrelay-ui | 56abff6382a7546d3340f9d0f6eda5093b6b531b | [
"MIT"
] | null | null | null | '''
sonicskye@2020
Load JSON ABI from files
'''
import os
import json
import fire
#_PATH = os.path.dirname(os.path.realpath(__file__)) + "/db/" + dbname
ABI_PATH = os.path.dirname(os.path.realpath(__file__)) + "/abi/"
btcrelayabifilename = 'BTCRelay.json'
# read ABI from file
# https://stackabuse.com/reading-and-... | 19.432432 | 100 | 0.598053 |
794bd064809d0b7fa15aafac041a018de303a0f4 | 15,287 | py | Python | notebooks/__code/kropff.py | neutronimaging/BraggEdgeFitting | 233407fc000425ee79897e514964ef196ca27a08 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/kropff.py | neutronimaging/BraggEdgeFitting | 233407fc000425ee79897e514964ef196ca27a08 | [
"BSD-3-Clause"
] | 2 | 2020-10-06T13:48:24.000Z | 2020-10-07T16:21:46.000Z | notebooks/__code/kropff.py | neutronimaging/BraggEdgeFitting | 233407fc000425ee79897e514964ef196ca27a08 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from qtpy import QtGui
from qtpy.QtWidgets import QFileDialog
from pathlib import Path
import pyqtgraph as pg
from __code.table_handler import TableHandler
from __code.bragg_edge_peak_fitting_gui_utility import GuiUtility
from __code.kropff_fitting_job_handler import KropffFittingJobHandler
from __c... | 44.438953 | 109 | 0.69896 |
794bd254ebeec9f59c1cfaf9e015c31913a7212d | 441 | py | Python | student_portal/celery.py | danielmicaletti/music-academy-student-portal | ca779f71e69d6676ee77a6cd68a13c2225c886f9 | [
"MIT"
] | null | null | null | student_portal/celery.py | danielmicaletti/music-academy-student-portal | ca779f71e69d6676ee77a6cd68a13c2225c886f9 | [
"MIT"
] | null | null | null | student_portal/celery.py | danielmicaletti/music-academy-student-portal | ca779f71e69d6676ee77a6cd68a13c2225c886f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'student_portal.settings')
from django.conf import settings
app = Celery('student_portal')
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambd... | 22.05 | 74 | 0.770975 |
794bd30900a85f67092f9d4617cad02888df11bc | 310 | py | Python | pgx/__init__.py | tantiem/pgxtended | 4f5c05ea0eebb3a6bebac1a35a74f0d161951772 | [
"MIT"
] | null | null | null | pgx/__init__.py | tantiem/pgxtended | 4f5c05ea0eebb3a6bebac1a35a74f0d161951772 | [
"MIT"
] | null | null | null | pgx/__init__.py | tantiem/pgxtended | 4f5c05ea0eebb3a6bebac1a35a74f0d161951772 | [
"MIT"
] | null | null | null | """A wrapper module for pygame that makes all aspects of drawing and viewing much, much easier by compiling the boilerplate you would have used into a library."""
__all__ = ["pgxObject","Drawable","Undrawable","Transformable","Camera","AudioSource","Dynamic","Static","UI","Physical","PhysicsBody","Particle"] | 155 | 163 | 0.754839 |
794bd373588ee2f71094e0290c4658add7d85c61 | 6,496 | py | Python | dl85/supervised/regressors/quantile_regressor.py | valentinlemaire/pydl8.5 | a846f3c36bacbbe01ff87c31413342069b0cf61b | [
"MIT"
] | null | null | null | dl85/supervised/regressors/quantile_regressor.py | valentinlemaire/pydl8.5 | a846f3c36bacbbe01ff87c31413342069b0cf61b | [
"MIT"
] | null | null | null | dl85/supervised/regressors/quantile_regressor.py | valentinlemaire/pydl8.5 | a846f3c36bacbbe01ff87c31413342069b0cf61b | [
"MIT"
] | null | null | null | from sklearn.base import RegressorMixin
from ...predictors.quantile_predictor import DL85QuantilePredictor
from sklearn.neighbors import KernelDensity
import numpy as np
from math import floor, ceil
import json
class DL85QuantileRegressor(DL85QuantilePredictor, RegressorMixin):
"""An optimal binary decision tree ... | 33.833333 | 178 | 0.611145 |
794bd3cf3df7b53ef1f2932a75c64eca33e1e219 | 405 | py | Python | nexus/__init__.py | Xarrow/PyCharmWorkSpace | daf0c3c194d0439caf96f260e23319b2ad8c7e0d | [
"Apache-2.0"
] | 14 | 2016-02-26T12:15:43.000Z | 2019-08-28T15:28:23.000Z | nexus/__init__.py | Xarrow/PyCharmWorkSpace | daf0c3c194d0439caf96f260e23319b2ad8c7e0d | [
"Apache-2.0"
] | null | null | null | nexus/__init__.py | Xarrow/PyCharmWorkSpace | daf0c3c194d0439caf96f260e23319b2ad8c7e0d | [
"Apache-2.0"
] | 11 | 2016-02-21T13:26:16.000Z | 2019-08-28T15:28:25.000Z | # -*- coding:utf-8 -*-
"""
Verion: 1.0
Author: helix
Site: https://iliangqunru.bitcron.com/
File: __init__.py.py
Time: 3/7/18
"""
import logging
import sys
import os
import requests
level = logging.DEBUG
format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
datefmt = '%Y-%m-%d %H:%M'
logging.basicConfi... | 19.285714 | 64 | 0.683951 |
794bd3e146f390ad5579832b25dec69fba29831c | 918 | py | Python | tests/kallisticore/utils/test_sanitizer.py | jpmorganchase/kallisti-core | d9dfcaa2ec3c9cd26dd37b5f2c39c3788a3d05aa | [
"Apache-2.0"
] | 1 | 2022-03-03T14:27:25.000Z | 2022-03-03T14:27:25.000Z | tests/kallisticore/utils/test_sanitizer.py | jpmorganchase/kallisti-core | d9dfcaa2ec3c9cd26dd37b5f2c39c3788a3d05aa | [
"Apache-2.0"
] | null | null | null | tests/kallisticore/utils/test_sanitizer.py | jpmorganchase/kallisti-core | d9dfcaa2ec3c9cd26dd37b5f2c39c3788a3d05aa | [
"Apache-2.0"
] | 1 | 2022-03-09T05:57:55.000Z | 2022-03-09T05:57:55.000Z | from kallisticore.utils.sanitizer import Sanitizer
from unittest import TestCase
from tests.kallisticore.utils.fixture.trial_result_data import \
sanitizer_real_example_test, sanitizer_real_example_test_expected, \
sanitizer_theoretical_test, sanitizer_theoretical_test_expected
class TestSanitizer(TestCase):
... | 38.25 | 72 | 0.766885 |
794bd3e41ab752eba2517cd40aa8f18abd53f679 | 3,644 | py | Python | src/64.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 12 | 2016-10-19T09:03:20.000Z | 2021-01-10T10:53:23.000Z | src/64.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | null | null | null | src/64.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 6 | 2018-09-12T03:13:58.000Z | 2021-07-07T00:29:43.000Z | # All square roots are periodic when written as continued fractions and can
# be written in the form:
# sqrt(N) = a0 + 1
# ------------------
# a1 + 1
# -------------
# a2 + 1
# --------
# ... | 31.964912 | 76 | 0.325741 |
794bd3f8c1e88b95d9238d25687ce2a3333550b4 | 987 | py | Python | cride/circles/serializers.py | CamiloYate09/crider_django | 850e2657fdc1107cbe63274f18264ba0867c43dd | [
"MIT"
] | null | null | null | cride/circles/serializers.py | CamiloYate09/crider_django | 850e2657fdc1107cbe63274f18264ba0867c43dd | [
"MIT"
] | null | null | null | cride/circles/serializers.py | CamiloYate09/crider_django | 850e2657fdc1107cbe63274f18264ba0867c43dd | [
"MIT"
] | null | null | null | """Circle serialziers"""
# Django REST Framework
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
# Models
from cride.circles.models import Circle
class CircleSerializer(serializers.Serializer):
"""Circle serializer."""
name = serializers.CharField()
slug_nam... | 30.84375 | 97 | 0.690983 |
794bd449cd2ea946a7fb468e80e1263540c06524 | 3,540 | py | Python | test/e2e/batcher/test_raw_batcher.py | Iamlovingit/kserve | 5091f0f87dfc0ecd91aff4722b603686ca53349b | [
"Apache-2.0"
] | null | null | null | test/e2e/batcher/test_raw_batcher.py | Iamlovingit/kserve | 5091f0f87dfc0ecd91aff4722b603686ca53349b | [
"Apache-2.0"
] | null | null | null | test/e2e/batcher/test_raw_batcher.py | Iamlovingit/kserve | 5091f0f87dfc0ecd91aff4722b603686ca53349b | [
"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 under the... | 40.689655 | 119 | 0.633333 |
794bd5842ea9b299252633eb28f71510ecbd7a36 | 37,651 | py | Python | qcodes/dataset/measurements.py | cgranade/Qcodes | 2d8fd0b8e0fa12d7921a96003318598ad347dd05 | [
"MIT"
] | null | null | null | qcodes/dataset/measurements.py | cgranade/Qcodes | 2d8fd0b8e0fa12d7921a96003318598ad347dd05 | [
"MIT"
] | null | null | null | qcodes/dataset/measurements.py | cgranade/Qcodes | 2d8fd0b8e0fa12d7921a96003318598ad347dd05 | [
"MIT"
] | null | null | null | import json
import logging
from time import monotonic
from collections import OrderedDict
from typing import (Callable, Union, Dict, Tuple, List, Sequence, cast,
MutableMapping, MutableSequence, Optional, Any)
from inspect import signature
from numbers import Number
import numpy as np
import qcode... | 42.543503 | 80 | 0.534674 |
794bd5d642c57feb7a077644ad05fa574bf6fca7 | 10,665 | py | Python | python/ray/tune/analysis/experiment_analysis.py | sunho/ray | 0ac8138b26cc66978df150c89ef291263f23c9a1 | [
"Apache-2.0"
] | 2 | 2019-06-17T12:38:24.000Z | 2020-11-11T07:52:26.000Z | python/ray/tune/analysis/experiment_analysis.py | sunho/ray | 0ac8138b26cc66978df150c89ef291263f23c9a1 | [
"Apache-2.0"
] | 3 | 2018-08-15T19:19:25.000Z | 2021-06-30T01:54:46.000Z | python/ray/tune/analysis/experiment_analysis.py | sunho/ray | 0ac8138b26cc66978df150c89ef291263f23c9a1 | [
"Apache-2.0"
] | 2 | 2017-10-31T23:20:07.000Z | 2019-11-13T20:16:03.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
try:
import pandas as pd
except ImportError:
pd = None
from ray.tune.error import TuneError
from ray.tune.result import EXPR_PROGRESS_FILE, EXPR_PARAM_FILE, CONFIG... | 36.649485 | 79 | 0.577215 |
794bd63a16a079b5c573121bb8641b7374c7a094 | 763 | py | Python | input-generator.py | rfalke/hamming-distance-squared-benchmark | 302d82ce3602b619c006a6d2e5dbef1a4bad9337 | [
"MIT"
] | 1 | 2021-04-10T05:42:51.000Z | 2021-04-10T05:42:51.000Z | input-generator.py | rfalke/hamming-distance-squared-benchmark | 302d82ce3602b619c006a6d2e5dbef1a4bad9337 | [
"MIT"
] | null | null | null | input-generator.py | rfalke/hamming-distance-squared-benchmark | 302d82ce3602b619c006a6d2e5dbef1a4bad9337 | [
"MIT"
] | null | null | null | import hashlib
def generate(name, num_entries, size):
entries = []
hashobj = hashlib.sha256()
hashobj.update("%d %d" % (num_entries, size))
for i in range(num_entries):
hashobj.update(str(i))
entries.append(hashobj.hexdigest()[:size / 4])
assert len(set(entries)) == num_entries
... | 25.433333 | 59 | 0.576671 |
794bd653cb236fd0d527096dd4ff7caf60549f70 | 2,952 | py | Python | jupyter/utils.py | dmfigol/devnet-3627 | 172b956cb893d36e25f3c120c1b68a12b634090e | [
"MIT"
] | 1 | 2018-06-16T12:48:54.000Z | 2018-06-16T12:48:54.000Z | jupyter/utils.py | dmfigol/devnet-3627 | 172b956cb893d36e25f3c120c1b68a12b634090e | [
"MIT"
] | null | null | null | jupyter/utils.py | dmfigol/devnet-3627 | 172b956cb893d36e25f3c120c1b68a12b634090e | [
"MIT"
] | 2 | 2018-06-14T14:30:23.000Z | 2018-06-14T15:51:40.000Z | from typing import Dict
from ruamel.yaml import YAML
from constants import (
NORMALIZED_INTERFACES,
INTERFACE_NAME_RE,
NEIGHBOR_SPLIT_RE,
CDP_NEIGHBOR_RE,
HOSTS_FILE,
DEVICE_USERNAME,
DEVICE_PASSWORD,
DEVICE_TYPE,
CONNECTION_TIMEOUT,
)
def normalize_interface_type(interface_type:... | 33.545455 | 100 | 0.661585 |
794bd70a542bd5c84469fd23eabe260691fb9554 | 4,668 | py | Python | reid/engine/trainer.py | NothingToSay99/HOB-net | 77d52fbd6cab5d24f6a724f146dc71e80759c1f9 | [
"MIT"
] | 2 | 2021-08-02T01:03:11.000Z | 2021-09-07T02:50:35.000Z | reid/engine/trainer.py | NothingToSay99/HOB-net | 77d52fbd6cab5d24f6a724f146dc71e80759c1f9 | [
"MIT"
] | null | null | null | reid/engine/trainer.py | NothingToSay99/HOB-net | 77d52fbd6cab5d24f6a724f146dc71e80759c1f9 | [
"MIT"
] | null | null | null | # encoding: utf-8
import logging
import torch
import torch.nn as nn
from ignite.engine import Engine, Events
from ignite.handlers import ModelCheckpoint, Timer
from ignite.metrics import RunningAverage
from utils.reid_metric import R1_mAP
global ITER
ITER = 0
def create_supervised_trainer(model, optimizer, loss_fn... | 35.633588 | 147 | 0.627035 |
794bd7ed69e1e978e635f64a2d7412ba530be4c8 | 4,375 | py | Python | setup.py | PRITI1999/klever | ac80edf4301c15f6b63e35837f4ffbf7e3e68809 | [
"Apache-2.0"
] | 1 | 2021-01-09T08:44:37.000Z | 2021-01-09T08:44:37.000Z | setup.py | Abhik1998/klever | 827bbd31b29e213bf74cb1d1b158153e62a2933e | [
"Apache-2.0"
] | 3 | 2021-03-19T09:15:16.000Z | 2021-09-22T19:24:40.000Z | setup.py | Abhik1998/klever | 827bbd31b29e213bf74cb1d1b158153e62a2933e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# htt... | 35.282258 | 91 | 0.636343 |
794bd8a38379e263664980615695cfce15eb9c0d | 6,837 | py | Python | config/settings/production.py | studebacon/Ghostwriter | 1cefcaa4859707ee11b2c3617bc03f8b3b74f57d | [
"BSD-3-Clause"
] | null | null | null | config/settings/production.py | studebacon/Ghostwriter | 1cefcaa4859707ee11b2c3617bc03f8b3b74f57d | [
"BSD-3-Clause"
] | null | null | null | config/settings/production.py | studebacon/Ghostwriter | 1cefcaa4859707ee11b2c3617bc03f8b3b74f57d | [
"BSD-3-Clause"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 41.436364 | 100 | 0.592658 |
794bd938918a29d1f907d62493c0d878c0541c2c | 5,332 | py | Python | argparsetree/cmd.py | wildfish/argparsetree | 424fb13847c4788cad7084233d008d14e17b901c | [
"MIT"
] | 1 | 2019-02-22T08:42:33.000Z | 2019-02-22T08:42:33.000Z | argparsetree/cmd.py | wildfish/argparsetree | 424fb13847c4788cad7084233d008d14e17b901c | [
"MIT"
] | null | null | null | argparsetree/cmd.py | wildfish/argparsetree | 424fb13847c4788cad7084233d008d14e17b901c | [
"MIT"
] | 2 | 2018-11-14T20:17:46.000Z | 2020-11-11T14:47:59.000Z | from __future__ import print_function
from argparse import ArgumentParser, HelpFormatter
import sys
class BaseCommand(object):
"""
The base command object
:var description: The brief description of the command
:var sub_commands: A dictionary mapping names to sub commands. Each value should be a cla... | 32.91358 | 139 | 0.631095 |
794bd95504035e63e91b678d036eab419c6fab07 | 9,930 | py | Python | utils/build/configure.py | espe-org/hermes | e2e00c6177e1b1feb7519e9b140f3b46ca111f88 | [
"MIT"
] | null | null | null | utils/build/configure.py | espe-org/hermes | e2e00c6177e1b1feb7519e9b140f3b46ca111f88 | [
"MIT"
] | null | null | null | utils/build/configure.py | espe-org/hermes | e2e00c6177e1b1feb7519e9b140f3b46ca111f88 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# 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 __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import os
import pla... | 34.241379 | 117 | 0.606244 |
794bd984de5b6ee786040c91c92b83dc732bb341 | 17,822 | py | Python | include/ClientGUIDialogsManage.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | include/ClientGUIDialogsManage.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | include/ClientGUIDialogsManage.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | from . import ClientConstants as CC
from . import ClientGUICommon
from . import ClientGUIListCtrl
from . import ClientGUIDialogs
from . import ClientGUIShortcuts
from . import ClientRatings
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusGlobals as HG
from... | 32.942699 | 231 | 0.512681 |
794bda3b9cb64f08cad298202c85e44ef7dc70a6 | 415 | py | Python | 5KYU/flatten/test.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | 4 | 2021-07-17T22:48:03.000Z | 2022-03-25T14:10:58.000Z | 5KYU/flatten/test.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | null | null | null | 5KYU/flatten/test.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | 3 | 2021-06-14T14:18:16.000Z | 2022-03-16T06:02:02.000Z | import unittest
import main
class TestFlatten(unittest.TestCase):
def test_one(self):
""" Should return flattens arguments into a single array """
self.assertEqual([1, 2, 3, 4, 5, 6, 7], main.flatten(1, [2, 3], 4, 5, [6, [7]]))
self.assertEqual(['a', 'b', 2, 3, None, 4, 'c'], main.flatten(... | 31.923077 | 108 | 0.559036 |
794bda9c5b9c485f61a52d97d6da461e4f46c26c | 113 | py | Python | jupyterblog/attention/attention.py | vimarshc/jupyterblog | 433fb170cfbc73a3e98b22b25bc7177af04f32f9 | [
"Apache-2.0"
] | null | null | null | jupyterblog/attention/attention.py | vimarshc/jupyterblog | 433fb170cfbc73a3e98b22b25bc7177af04f32f9 | [
"Apache-2.0"
] | 2 | 2021-05-20T21:55:08.000Z | 2021-09-28T05:36:06.000Z | jupyterblog/attention/attention.py | vimarshc/jupyterblog | 433fb170cfbc73a3e98b22b25bc7177af04f32f9 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: attention.attention.ipynb (unless otherwise specified).
__all__ = [] | 37.666667 | 99 | 0.761062 |
794bda9d18c9b1443b443c3d307a7b5fa028dc25 | 3,958 | py | Python | sppas/sppas/src/dependencies/grako/rendering.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/dependencies/grako/rendering.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/dependencies/grako/rendering.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The Renderer class provides the infrastructure for generating template-based
code. It's used by the .grammars module for parser generation.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
import string
from s... | 28.271429 | 85 | 0.588934 |
794bdb9caf14f16511fe6db9c60da260a0668c1e | 2,349 | py | Python | cms/tests/test_streamforms.py | DBonbon/pythoneatstail | 3f9e8ddd07f891653c82aa396a96709914113f3a | [
"MIT"
] | 4 | 2021-06-18T10:26:24.000Z | 2021-11-06T03:50:04.000Z | cms/tests/test_streamforms.py | DBonbon/pythoneatstail | 3f9e8ddd07f891653c82aa396a96709914113f3a | [
"MIT"
] | 10 | 2020-06-03T01:48:21.000Z | 2021-09-22T19:02:14.000Z | cms/tests/test_streamforms.py | DBonbon/pythoneatstail | 3f9e8ddd07f891653c82aa396a96709914113f3a | [
"MIT"
] | 2 | 2020-12-06T08:49:36.000Z | 2021-02-28T23:19:20.000Z | from django.test import TestCase
from ..wagtailstreamforms_fields import ReCaptchaField
from wagtailstreamforms.models import Form
import json
from ..models import AdvancedFormSetting
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http import QueryDict
from ..wagtailstreamforms_hooks import e... | 35.059701 | 110 | 0.59685 |
794bdd5493e56574a7c73df526cf88841cd102bb | 300 | py | Python | RecoLuminosity/LumiProducer/python/lumiProducer_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoLuminosity/LumiProducer/python/lumiProducer_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoLuminosity/LumiProducer/python/lumiProducer_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z |
import FWCore.ParameterSet.Config as cms
lumiProducer=cms.EDProducer("LumiProducer",
connect=cms.string(''),
lumiversion=cms.untracked.string(''),
ncacheEntries=cms.untracked.uint32(5)
)
| 37.5 | 65 | 0.496667 |
794bdd948a28fae4d7a03f992fdf18775dc790e7 | 4,549 | py | Python | imperative/python/megengine/optimizer/adam.py | kxz18/MegEngine | 88c1eedbd716805244b35bdda57c3cea5efe734d | [
"Apache-2.0"
] | 5,168 | 2020-03-19T06:10:04.000Z | 2022-03-31T11:11:54.000Z | imperative/python/megengine/optimizer/adam.py | kxz18/MegEngine | 88c1eedbd716805244b35bdda57c3cea5efe734d | [
"Apache-2.0"
] | 286 | 2020-03-25T01:36:23.000Z | 2022-03-31T10:26:33.000Z | imperative/python/megengine/optimizer/adam.py | kxz18/MegEngine | 88c1eedbd716805244b35bdda57c3cea5efe734d | [
"Apache-2.0"
] | 515 | 2020-03-19T06:10:05.000Z | 2022-03-30T09:15:59.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 36.103175 | 128 | 0.575511 |
794bdf5fca17d80cfb7507f3c55c9dc077c6b56a | 4,829 | py | Python | core/platform/email/dev_mode_email_services.py | aasiffaizal/oppia | 1a8634a435bec10f407e9f3c95f62bd467c5b5f7 | [
"Apache-2.0"
] | null | null | null | core/platform/email/dev_mode_email_services.py | aasiffaizal/oppia | 1a8634a435bec10f407e9f3c95f62bd467c5b5f7 | [
"Apache-2.0"
] | 1 | 2021-09-24T20:37:12.000Z | 2021-09-24T21:27:54.000Z | core/platform/email/dev_mode_email_services.py | aasiffaizal/oppia | 1a8634a435bec10f407e9f3c95f62bd467c5b5f7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2016 The Oppia 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 requi... | 37.726563 | 79 | 0.623317 |
794bdf657e0bb377bda76f31d641af3de1c04f1f | 6,418 | py | Python | build/PureCloudPlatformClientV2/models/scheduling_testing_options_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 1 | 2021-10-08T20:46:45.000Z | 2021-10-08T20:46:45.000Z | libs/PureCloudPlatformClientV2/models/scheduling_testing_options_request.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | null | null | null | libs/PureCloudPlatformClientV2/models/scheduling_testing_options_request.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 30.708134 | 96 | 0.623091 |
794be096b7309a18f9fe225642bcaafb5058df78 | 37,590 | py | Python | tensorflow/python/kernel_tests/segment_reduction_ops_test.py | Jibanprakash/tensorflow | a8ae26ae1aa7a33b48cca8bf12c42ab7503a45cf | [
"Apache-2.0"
] | 54 | 2018-05-29T19:52:44.000Z | 2021-11-30T10:41:12.000Z | tensorflow/python/kernel_tests/segment_reduction_ops_test.py | caelean/tensorflow | dcb10b1d557168646204239bea6ca5bf1abc40a3 | [
"Apache-2.0"
] | 20 | 2017-12-06T18:20:54.000Z | 2021-11-10T09:54:23.000Z | tensorflow/python/kernel_tests/segment_reduction_ops_test.py | caelean/tensorflow | dcb10b1d557168646204239bea6ca5bf1abc40a3 | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.37594 | 80 | 0.635089 |
794be115f18e678b4cce708fed1325cc0bcf8279 | 4,244 | py | Python | utils/model.py | Shenmue-Mods/ShenmueDKPy | bab62b86ed1c5b32703c39cc8109cf4f24a7152e | [
"MIT"
] | null | null | null | utils/model.py | Shenmue-Mods/ShenmueDKPy | bab62b86ed1c5b32703c39cc8109cf4f24a7152e | [
"MIT"
] | null | null | null | utils/model.py | Shenmue-Mods/ShenmueDKPy | bab62b86ed1c5b32703c39cc8109cf4f24a7152e | [
"MIT"
] | null | null | null | from enum import Enum
from utils.vector import *
from utils.matrix import *
from utils.math import *
class BoneID(Enum):
Root = 0
Spine = 1
Hip = 14
UpperLeg_R = 16
LowerLeg_R = 17
Foot_R = 18
FootToes_R = 19
UpperLeg_L = 21
LowerLeg_L = 22
Foot_L = 23
FootToes_L = 24
S... | 26.525 | 99 | 0.64114 |
794be14f343573f684e9a703309a329dd2d8c7ef | 622 | py | Python | qa/rpc-tests/python-supcoinrpc/setup.py | Voyacoin/Voyacoin | 4030c52983749f0e0ff3a20c0d67ced3f5b35b14 | [
"MIT"
] | null | null | null | qa/rpc-tests/python-supcoinrpc/setup.py | Voyacoin/Voyacoin | 4030c52983749f0e0ff3a20c0d67ced3f5b35b14 | [
"MIT"
] | null | null | null | qa/rpc-tests/python-supcoinrpc/setup.py | Voyacoin/Voyacoin | 4030c52983749f0e0ff3a20c0d67ced3f5b35b14 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from distutils.core import setup
setup(name='python-voyacoinrpc',
version='0.1',
description='Enhanced version of python-jsonrpc for use with Voyacoin',
long_description=open('README').read(),
author='Jeff Garzik',
author_email='<jgarzik@exmulti.com>',
mainta... | 38.875 | 139 | 0.686495 |
794be22f2fb6962fcac1ecae1265566bd3fe1c3f | 7,229 | py | Python | scripts/jenkins/build.py | farrepa/cla_frontend | a789ad96cf91daf755784e3a5ed11350a85bddf6 | [
"MIT"
] | null | null | null | scripts/jenkins/build.py | farrepa/cla_frontend | a789ad96cf91daf755784e3a5ed11350a85bddf6 | [
"MIT"
] | null | null | null | scripts/jenkins/build.py | farrepa/cla_frontend | a789ad96cf91daf755784e3a5ed11350a85bddf6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import logging
import os
import random
import signal
import subprocess
import sys
from Queue import Queue
logging.basicConfig(level="INFO")
log = logging.getLogger(__name__)
PROJECT_NAME = "cla_frontend"
background_processes = Queue()
def parse_args():
parser = argparse.A... | 29.627049 | 119 | 0.647392 |
794be2646df69c79b9f0f417383ba1f2d981a69e | 2,684 | py | Python | openGaussBase/testcase/GUC/CONNECTIONAUTHENTICATION/Opengauss_Function_Guc_Connectionauthentication_Case0102.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/CONNECTIONAUTHENTICATION/Opengauss_Function_Guc_Connectionauthentication_Case0102.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/CONNECTIONAUTHENTICATION/Opengauss_Function_Guc_Connectionauthentication_Case0102.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 36.27027 | 84 | 0.649404 |
794be2e0d369670cd783faf88664fcc7b8566548 | 3,824 | py | Python | integration_tests/test_suites/daemon-test-suite/test_memory.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_suites/daemon-test-suite/test_memory.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_suites/daemon-test-suite/test_memory.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | import inspect
import os
import time
from contextlib import contextmanager
import objgraph
from dagster import RunRequest, pipeline, repository, schedule, sensor, solid
from dagster.core.test_utils import instance_for_test
from dagster.core.workspace.load_target import PythonFileTarget
from dagster.daemon.controller ... | 29.19084 | 99 | 0.592573 |
794be52fff63e35939e5a316fc4167e0ee9f142e | 769 | py | Python | notifications/sms.py | btsimon97/ble-surveillance | a76d8f9f0e40572dd2e638279dd10635c4d8b702 | [
"MIT"
] | 1 | 2021-05-19T18:39:53.000Z | 2021-05-19T18:39:53.000Z | notifications/sms.py | btsimon97/ble-surveillance | a76d8f9f0e40572dd2e638279dd10635c4d8b702 | [
"MIT"
] | null | null | null | notifications/sms.py | btsimon97/ble-surveillance | a76d8f9f0e40572dd2e638279dd10635c4d8b702 | [
"MIT"
] | null | null | null | import os
import configparser
from twilio.rest import Client
# this function sends the final sms
def send_sms_message(sms_config, recipient, msg):
account_sid = sms_config.get('sms', 'twilio_account_sid')
auth_token = sms_config.get('sms', 'twilio_auth_token')
sender = sms_config.get('sms', 'sender_phone... | 32.041667 | 73 | 0.724317 |
794be731800c6052e7592714300f0b8850b56d2f | 674 | py | Python | examples/copy_existing_event.py | ftnext/connpass-ops-playbook | 6f57380c92f37f998092499dab2974de45a4e6b9 | [
"MIT"
] | null | null | null | examples/copy_existing_event.py | ftnext/connpass-ops-playbook | 6f57380c92f37f998092499dab2974de45a4e6b9 | [
"MIT"
] | 7 | 2021-08-21T14:01:10.000Z | 2021-11-08T14:48:36.000Z | examples/copy_existing_event.py | ftnext/connpass-ops-playbook | 6f57380c92f37f998092499dab2974de45a4e6b9 | [
"MIT"
] | null | null | null | """Firefoxでconnpassにある既存のイベントをコピーするまでを自動化"""
import argparse
from connpass_ops_playbook.decorators import logged_in, using_firefox
from connpass_ops_playbook.plays import copy_existing_event
from helium import kill_browser
@using_firefox
@logged_in
def show_copy_popup(url):
copy_existing_event(url, human_confir... | 23.241379 | 69 | 0.719585 |
794be89d9018b51e1d65a462a261d06ce6689792 | 7,315 | py | Python | MAIN.py | Mrprogrammernobrainz/informaticscalc | 5dbdd29128cb45f59efac7cc407f2e474b454ccd | [
"Unlicense"
] | null | null | null | MAIN.py | Mrprogrammernobrainz/informaticscalc | 5dbdd29128cb45f59efac7cc407f2e474b454ccd | [
"Unlicense"
] | null | null | null | MAIN.py | Mrprogrammernobrainz/informaticscalc | 5dbdd29128cb45f59efac7cc407f2e474b454ccd | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import random as rand
import time as tm
def plus():
print("Вы выбрали 'Сложение', ответ будет дан в десятичной\nУкажите первое число")
firstnum = int(input())
print("Укажите систему счисления первого числа")
firstnumsys = int(input())
print... | 41.327684 | 233 | 0.582502 |
794be8d67d22ab5de43e7db395b9bb4d2db4d70b | 842 | py | Python | testfixtures/__init__.py | foobacca/testfixtures | c4f893ec0ac40ffa998d97152639536f54c8436d | [
"MIT"
] | null | null | null | testfixtures/__init__.py | foobacca/testfixtures | c4f893ec0ac40ffa998d97152639536f54c8436d | [
"MIT"
] | null | null | null | testfixtures/__init__.py | foobacca/testfixtures | c4f893ec0ac40ffa998d97152639536f54c8436d | [
"MIT"
] | null | null | null | class singleton(object):
def __init__(self, name):
self.name = name
def __repr__(self):
return '<%s>' % self.name
__str__ = __repr__
not_there = singleton('not_there')
from testfixtures.comparison import (
Comparison, StringComparison, RoundComparison, compare, diff, RangeComparison... | 33.68 | 81 | 0.805226 |
794be912ca6c06a9f862dcbd698fbc353326eaec | 16,573 | py | Python | dask/dataframe/io/tests/test_sql.py | McToel/dask | 24c31a2f2a7f390c21f1aa2dc4d8a407cb3cb850 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/tests/test_sql.py | McToel/dask | 24c31a2f2a7f390c21f1aa2dc4d8a407cb3cb850 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/tests/test_sql.py | McToel/dask | 24c31a2f2a7f390c21f1aa2dc4d8a407cb3cb850 | [
"BSD-3-Clause"
] | null | null | null | import io
from contextlib import contextmanager
import pytest
# import dask
from dask.dataframe.io.sql import read_sql_query, read_sql_table, read_sql
from dask.dataframe.utils import assert_eq
from dask.utils import tmpfile
pd = pytest.importorskip("pandas")
dd = pytest.importorskip("dask.dataframe")
pytest.importo... | 30.465074 | 158 | 0.608942 |
794be9f75abbbe1b7e373a378ed892a467ed00c3 | 936 | py | Python | evamap_web/views.py | benjimor/EvaMap-Web | 6b9ad8445b2621c18872521861cfe0ceed2cce20 | [
"MIT"
] | 1 | 2020-01-13T11:51:25.000Z | 2020-01-13T11:51:25.000Z | evamap_web/views.py | benj-moreau/EvaMap-Web | 6b9ad8445b2621c18872521861cfe0ceed2cce20 | [
"MIT"
] | 5 | 2021-03-18T23:39:08.000Z | 2022-02-10T12:41:02.000Z | evamap_web/views.py | benjimor/EvaMap-Web | 6b9ad8445b2621c18872521861cfe0ceed2cce20 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from EvaMap.EvaMap import EvaMap
import json
@require_http_methods(['GET'])
def home(request):
return render(request, 'home.html')
@require_http_methods(['GET'])... | 31.2 | 117 | 0.740385 |
794be9fcc5ea16c77e3227ab2672790f9d48688b | 6,033 | py | Python | tests/fixtures.py | scorphus/holmes-api | 6b3c76d4299fecf2d8799d7b5c3c6a6442cacd59 | [
"MIT"
] | null | null | null | tests/fixtures.py | scorphus/holmes-api | 6b3c76d4299fecf2d8799d7b5c3c6a6442cacd59 | [
"MIT"
] | null | null | null | tests/fixtures.py | scorphus/holmes-api | 6b3c76d4299fecf2d8799d7b5c3c6a6442cacd59 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import datetime
import factory
import factory.alchemy
import hashlib
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from holmes.models import (
Domain, Page, Review, Violation, Fact, Key, KeysCategory, Request,... | 25.892704 | 82 | 0.633516 |
794bea22dd32ece55fe3bf73d3febac21a3b4d1e | 4,472 | py | Python | parl/algorithms/paddle/sac.py | wangzelong0663/PARL | 9954a18827fd720585b346ec83cdaf9683feb52c | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-29T15:49:21.000Z | 2021-09-29T15:49:21.000Z | parl/algorithms/paddle/sac.py | wangzelong0663/PARL | 9954a18827fd720585b346ec83cdaf9683feb52c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | parl/algorithms/paddle/sac.py | wangzelong0663/PARL | 9954a18827fd720585b346ec83cdaf9683feb52c | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-03-04T07:20:51.000Z | 2022-03-04T07:20:51.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 37.266667 | 117 | 0.635063 |
794bea4c28fcbae0bddb5a57263b501254274d6f | 192 | py | Python | job_board/users/middleware.py | lokesh1729/job_board | e9d266e7bbda041cdf30b3e7a926ac95c80def9f | [
"MIT"
] | null | null | null | job_board/users/middleware.py | lokesh1729/job_board | e9d266e7bbda041cdf30b3e7a926ac95c80def9f | [
"MIT"
] | null | null | null | job_board/users/middleware.py | lokesh1729/job_board | e9d266e7bbda041cdf30b3e7a926ac95c80def9f | [
"MIT"
] | null | null | null | from django.utils.deprecation import MiddlewareMixin
from . import utils
class RoleMiddleware(MiddlewareMixin):
def process_request(self, request):
utils.set_user_role(request)
| 21.333333 | 52 | 0.78125 |
794beafc562750cf21ecced2a6c21c5d3b73450c | 4,409 | py | Python | mcconf/UpdateConf.py | OmniTroid/mcconf | b248f0fce911b02e4cc8213c1b0e0ddc0105b6f8 | [
"MIT"
] | 1 | 2022-03-03T12:17:40.000Z | 2022-03-03T12:17:40.000Z | mcconf/UpdateConf.py | OmniTroid/mcconf | b248f0fce911b02e4cc8213c1b0e0ddc0105b6f8 | [
"MIT"
] | null | null | null | mcconf/UpdateConf.py | OmniTroid/mcconf | b248f0fce911b02e4cc8213c1b0e0ddc0105b6f8 | [
"MIT"
] | null | null | null | import io
import yaml
import json
import configparser
import pprint
from pathlib import Path
from typing import Callable
import dictcombiner.dictcombiner as dc
import fs2conf as fc
class UpdateConf:
def __init__(self, args):
self.args = args
self.serverconf = Path(args['serverconf'])
self.rolesdir = Path(args[... | 27.216049 | 79 | 0.718303 |
794beb73c2dbfc21e4a3f91c3042b4b65b64f061 | 6,502 | py | Python | ferminet/tests/train_test.py | AllanChain/ferminet | 75dc8475e2aa479484d601cc6819bc7e9f577058 | [
"Apache-2.0"
] | null | null | null | ferminet/tests/train_test.py | AllanChain/ferminet | 75dc8475e2aa479484d601cc6819bc7e9f577058 | [
"Apache-2.0"
] | null | null | null | ferminet/tests/train_test.py | AllanChain/ferminet | 75dc8475e2aa479484d601cc6819bc7e9f577058 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 35.922652 | 80 | 0.699016 |
794bebd3503c8ca083d3b90833046da36ccf01e3 | 8,917 | py | Python | training/tf_training/v2_write_training.py | godmoves/PhoenixGo | 8c813d10315660626f18e3985bbcb87ea5c684a5 | [
"Apache-2.0"
] | 11 | 2018-07-18T07:47:35.000Z | 2021-04-20T23:11:36.000Z | training/tf_training/v2_write_training.py | godmoves/PhoenixGo | 8c813d10315660626f18e3985bbcb87ea5c684a5 | [
"Apache-2.0"
] | 2 | 2018-08-18T06:40:42.000Z | 2019-02-03T14:18:50.000Z | training/tf_training/v2_write_training.py | godmoves/PhoenixGo | 8c813d10315660626f18e3985bbcb87ea5c684a5 | [
"Apache-2.0"
] | 2 | 2018-10-20T12:05:20.000Z | 2018-12-13T02:56:45.000Z | #!/usr/bin/env python3
#
# Used to dump training games in V2 format from MongoDB or V1 chunk files.
#
# Usage: v2_write_training [chunk_prefix]
# If run without a chunk_prefix it reads from MongoDB.
# With a chunk prefix, it uses all chunk files with that prefix
# as input.
#
# Sets up a dataflow pipeline that:
# 1... | 31.397887 | 90 | 0.592688 |
794bec2aa1fccaf679bbe8ed61194a234159bee0 | 885 | py | Python | test_threads.py | jtessier-cit/soft8023-darts | 51fb480b4c21a0cf49ffe1ef6e8e30855aee744e | [
"MIT"
] | null | null | null | test_threads.py | jtessier-cit/soft8023-darts | 51fb480b4c21a0cf49ffe1ef6e8e30855aee744e | [
"MIT"
] | null | null | null | test_threads.py | jtessier-cit/soft8023-darts | 51fb480b4c21a0cf49ffe1ef6e8e30855aee744e | [
"MIT"
] | null | null | null | from dao import darts_match_dao_thread_safe_singleton, darts_match_dao
from domain import darts_match
import threading
class AddThread(threading.Thread):
def __init__(self, thread_id, name, match):
threading.Thread.__init__(self)
self.threadID = thread_id
self.name = name
self.mat... | 27.65625 | 85 | 0.699435 |
794bec8e6a98e039ea7252cb2b235f866bdc0874 | 3,566 | py | Python | ultracart/models/item_enrollment123.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | 1 | 2018-03-15T16:56:23.000Z | 2018-03-15T16:56:23.000Z | ultracart/models/item_enrollment123.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | ultracart/models/item_enrollment123.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ItemEnrollment123(object... | 30.220339 | 114 | 0.606282 |
794bed8686d76852ee47f464690d9a920b98e8a1 | 7,680 | py | Python | SVHN/SVHN_recognizer_single_digit.py | leoagneau/Bib_Racer | 83c90bb3177ca13a78bee3ff0e800fbf0dd8484e | [
"MIT"
] | 2 | 2020-04-26T23:13:51.000Z | 2020-04-27T14:40:13.000Z | SVHN/SVHN_recognizer_single_digit.py | leoagneau/Bib_Racer | 83c90bb3177ca13a78bee3ff0e800fbf0dd8484e | [
"MIT"
] | null | null | null | SVHN/SVHN_recognizer_single_digit.py | leoagneau/Bib_Racer | 83c90bb3177ca13a78bee3ff0e800fbf0dd8484e | [
"MIT"
] | null | null | null | ############################
### Prepare SVHN dataset ###
############################
import os
import numpy as np
import h5py
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
import torchvision
from torchvision import datasets... | 34.909091 | 142 | 0.584635 |
794bee2bad59e798cd3ccc978182aee0bedfcd3c | 1,955 | py | Python | tests/test_card.py | shyam81295/UnoGame | 1938408b4fce791048d283b898f2a46b763a5449 | [
"Apache-2.0"
] | null | null | null | tests/test_card.py | shyam81295/UnoGame | 1938408b4fce791048d283b898f2a46b763a5449 | [
"Apache-2.0"
] | 13 | 2020-06-26T21:03:52.000Z | 2020-07-23T22:44:30.000Z | tests/test_card.py | shyam81295/UnoGame | 1938408b4fce791048d283b898f2a46b763a5449 | [
"Apache-2.0"
] | null | null | null | # Filename: tests/test_card.py
# Description: Tests class 'Card'
#
# Copyright (C) 2020 Shyam Singh
#
# 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.a... | 28.75 | 76 | 0.681841 |
794bee6e16cd788033b20f63a79ea4d26f335db9 | 2,929 | py | Python | src/engine/SCons/Tool/gnulink.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | 1 | 2019-09-18T06:37:02.000Z | 2019-09-18T06:37:02.000Z | src/engine/SCons/Tool/gnulink.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | src/engine/SCons/Tool/gnulink.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | """SCons.Tool.gnulink
Tool-specific initialization for the gnu linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, fre... | 36.160494 | 106 | 0.726869 |
794bee899ab9e4ca0b4c4e862b8b74480a72e404 | 155 | py | Python | src/app/schemas/token.py | FelisCatusKR/DBMS-term-project | bdcf3671b7189df934552df6cfd45464e3b858f3 | [
"MIT"
] | null | null | null | src/app/schemas/token.py | FelisCatusKR/DBMS-term-project | bdcf3671b7189df934552df6cfd45464e3b858f3 | [
"MIT"
] | null | null | null | src/app/schemas/token.py | FelisCatusKR/DBMS-term-project | bdcf3671b7189df934552df6cfd45464e3b858f3 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
class Token(BaseModel):
access_token: str
token_type: str
class TokenPayload(BaseModel):
user_id: int = None
| 15.5 | 30 | 0.735484 |
794beeec3742ad891974929129f524a5afd5b2ae | 3,708 | py | Python | convs-v4.py | latot/SubsWorker | 1733298ab584a85171e5365480b1dcb3656791fb | [
"MIT"
] | null | null | null | convs-v4.py | latot/SubsWorker | 1733298ab584a85171e5365480b1dcb3656791fb | [
"MIT"
] | null | null | null | convs-v4.py | latot/SubsWorker | 1733298ab584a85171e5365480b1dcb3656791fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import magic
import enzyme
from subprocess import Popen, PIPE
import tempfile
import os.path
import pysubs2
def check_file(file_):
if not os.path.isfile(file_):
raise NameError("the file don't exist")
def read_mkv(file_):
with open(file_, 'rb') as f:
return enzyme.MKV(f)
def check_sub(da... | 28.090909 | 100 | 0.6726 |
794befeabf488764c28a26fafbe24b342df53989 | 324 | py | Python | jupyterworkflow/tests/test_data.py | vedraiyani/MyJupyterWorkflow | cc97c3d6166e7d917099fdcd9e227371c11c5521 | [
"MIT"
] | null | null | null | jupyterworkflow/tests/test_data.py | vedraiyani/MyJupyterWorkflow | cc97c3d6166e7d917099fdcd9e227371c11c5521 | [
"MIT"
] | null | null | null | jupyterworkflow/tests/test_data.py | vedraiyani/MyJupyterWorkflow | cc97c3d6166e7d917099fdcd9e227371c11c5521 | [
"MIT"
] | null | null | null | # python -m pytest jupyterworkflow
from jupyterworkflow.data import get_fremont_data
import pandas as pd
import numpy as np
def test_fremont_data():
df=get_fremont_data()
assert all(df.columns==['East', 'West', 'Total'])
assert isinstance(df.index,pd.DatetimeIndex)
assert len(np.unique(df.index.time))... | 29.454545 | 53 | 0.743827 |
794bf0ede7b16152b7d5828d2bbab0ad7b68951d | 867 | py | Python | integration/dev/users/management/commands/createsuperuser_dev.py | AlexandraAlter/django-cornucopia | 1681ccbc5e98736e61f6afb1b78931dda9547486 | [
"MIT"
] | null | null | null | integration/dev/users/management/commands/createsuperuser_dev.py | AlexandraAlter/django-cornucopia | 1681ccbc5e98736e61f6afb1b78931dda9547486 | [
"MIT"
] | null | null | null | integration/dev/users/management/commands/createsuperuser_dev.py | AlexandraAlter/django-cornucopia | 1681ccbc5e98736e61f6afb1b78931dda9547486 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.contrib.auth.hashers import make_password
from users.models import User
class Command(BaseCommand):
help = 'Sets up a default superuser for development'
def add_arguments(self, parser):
pas... | 36.125 | 92 | 0.693195 |
794bf18c4d832d03e9150719799fe6567d20db2d | 1,315 | py | Python | src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/Code.py | aaron-bray/ITKExamples | 7ad0d445bb0139cf010e0e1cc906dccce97dda7c | [
"Apache-2.0"
] | null | null | null | src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/Code.py | aaron-bray/ITKExamples | 7ad0d445bb0139cf010e0e1cc906dccce97dda7c | [
"Apache-2.0"
] | null | null | null | src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/Code.py | aaron-bray/ITKExamples | 7ad0d445bb0139cf010e0e1cc906dccce97dda7c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright Insight Software Consortium
#
# 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.txt
#
# Unless required by... | 28.586957 | 74 | 0.765779 |
794bf2132d476804c7448e1098e5b79069fedd59 | 8,605 | py | Python | domainbed/scripts/sweep.py | alexrame/domainbedresearch | 6255da9aedf4584115324f8cf3a45be6e9004602 | [
"MIT"
] | 1 | 2022-03-15T16:30:14.000Z | 2022-03-15T16:30:14.000Z | domainbed/scripts/sweep.py | alexrame/domainbedresearch | 6255da9aedf4584115324f8cf3a45be6e9004602 | [
"MIT"
] | null | null | null | domainbed/scripts/sweep.py | alexrame/domainbedresearch | 6255da9aedf4584115324f8cf3a45be6e9004602 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Run sweeps
"""
import argparse
import copy
import getpass
import hashlib
import json
import os
import random
import shutil
import time
import uuid
import numpy as np
import torch
from domainbed import datasets
from domainbed import hparams_r... | 37.576419 | 94 | 0.587798 |
794bf29aacfee77d7e9541fcef74ccc27f85e0b4 | 2,771 | py | Python | hello_python_source_py3/chapter 06/4/player.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | 3 | 2017-08-02T23:40:55.000Z | 2018-07-02T14:59:07.000Z | hello_python_source_py3/chapter 06/4/player.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | null | null | null | hello_python_source_py3/chapter 06/4/player.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | null | null | null |
import shlex
class Player(object):
def __init__(self, location):
self.location = location
self.location.here.append(self)
self.playing = True
self.inventory = []
def get_input(self):
return input(">")
def inv(self, player, noun):
result = ["You... | 28.56701 | 68 | 0.528329 |
794bf3ddd5b3626d276f027aa805bffe4cd1a5c9 | 1,959 | py | Python | community/cloud-foundation/templates/logsink/logsink.py | BedrockSolutions/deploymentmanager-samples | 9042cc471817a4152645bc51a0e22badba129aff | [
"Apache-2.0"
] | null | null | null | community/cloud-foundation/templates/logsink/logsink.py | BedrockSolutions/deploymentmanager-samples | 9042cc471817a4152645bc51a0e22badba129aff | [
"Apache-2.0"
] | null | null | null | community/cloud-foundation/templates/logsink/logsink.py | BedrockSolutions/deploymentmanager-samples | 9042cc471817a4152645bc51a0e22badba129aff | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.775862 | 79 | 0.651353 |
794bf4224fe090049f23c4520266dfda05c88510 | 6,347 | py | Python | gob14_varios.py | dlunna/gob.selenium | 9c663e78b880b3363731f6e6f5b6899a972ef7c0 | [
"MIT"
] | null | null | null | gob14_varios.py | dlunna/gob.selenium | 9c663e78b880b3363731f6e6f5b6899a972ef7c0 | [
"MIT"
] | null | null | null | gob14_varios.py | dlunna/gob.selenium | 9c663e78b880b3363731f6e6f5b6899a972ef7c0 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# para base de datos
import mysql.connector
tiempo = 0.2
mydb = mysql.connector.connect(
host="sisinv.upp.edu.mx",
user="inventario2019",
passwd="1a2s3d4f.",
database="inventario2019",
)
# inicializando la base... | 29.798122 | 137 | 0.661257 |
794bf5775d552c07d51b64d53d160c9d18cd0246 | 1,758 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ReleaseETLJobRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ReleaseETLJobRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ReleaseETLJobRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... | 35.877551 | 75 | 0.750853 |
794bf671abc67b55eecb3c7c3d67d805c6df8bfd | 17,566 | py | Python | homeassistant/components/homekit/type_media_players.py | brapp0111/home-assistant | a59484bc8eadc59bc8f1413e7ab268571d8f835e | [
"Apache-2.0"
] | 1 | 2021-03-05T17:29:45.000Z | 2021-03-05T17:29:45.000Z | homeassistant/components/homekit/type_media_players.py | brapp0111/home-assistant | a59484bc8eadc59bc8f1413e7ab268571d8f835e | [
"Apache-2.0"
] | null | null | null | homeassistant/components/homekit/type_media_players.py | brapp0111/home-assistant | a59484bc8eadc59bc8f1413e7ab268571d8f835e | [
"Apache-2.0"
] | 1 | 2020-06-01T12:43:03.000Z | 2020-06-01T12:43:03.000Z | """Class to hold all media player accessories."""
import logging
from pyhap.const import CATEGORY_SWITCH, CATEGORY_TELEVISION
from homeassistant.components.media_player import (
ATTR_INPUT_SOURCE,
ATTR_INPUT_SOURCE_LIST,
ATTR_MEDIA_VOLUME_LEVEL,
ATTR_MEDIA_VOLUME_MUTED,
DOMAIN,
SERVICE_SELECT_... | 38.862832 | 88 | 0.626267 |
794bf74f0b7d6a369fe3afa6bf5a3edd10b3887d | 817 | py | Python | app/core/tests/test_commands.py | lyx999000/jobfindingrecord-app-api | c74419164747c04bf28ba1358381854105555c10 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | lyx999000/jobfindingrecord-app-api | c74419164747c04bf28ba1358381854105555c10 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | lyx999000/jobfindingrecord-app-api | c74419164747c04bf28ba1358381854105555c10 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for db when db is available"""
with patch('django.db.utils.... | 35.521739 | 74 | 0.680539 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.