hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b4ce7132667e4e93dacd9874d04e0f310a71a750 | 1,005 | py | Python | kubernetes/test/test_v1_external_documentation.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 2 | 2020-06-21T08:03:18.000Z | 2020-06-21T09:53:29.000Z | kubernetes/test/test_v1_external_documentation.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_external_documentation.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 1 | 2020-12-10T07:28:08.000Z | 2020-12-10T07:28:08.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.16
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import... | 25.125 | 124 | 0.736318 |
e3ea35a64009c702252cf717d89454852a26369a | 12,541 | py | Python | tensorflow/python/eager/function_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 1 | 2019-11-19T00:58:58.000Z | 2019-11-19T00:58:58.000Z | tensorflow/python/eager/function_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/function_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 28.437642 | 80 | 0.660553 |
ad4204ed8732bf95ee41bb6566069d85e62a646e | 1,053 | py | Python | simfile/timing/_private/timingsource.py | garcia/simfile | 4e15660c964d8d3c0e6d1f69431138e7eb4db288 | [
"MIT"
] | 22 | 2017-04-24T05:37:13.000Z | 2022-03-08T00:41:37.000Z | simfile/timing/_private/timingsource.py | garcia/simfile | 4e15660c964d8d3c0e6d1f69431138e7eb4db288 | [
"MIT"
] | 10 | 2021-05-31T01:21:56.000Z | 2022-03-17T04:26:54.000Z | simfile/timing/_private/timingsource.py | garcia/simfile | 4e15660c964d8d3c0e6d1f69431138e7eb4db288 | [
"MIT"
] | 3 | 2019-06-05T15:23:53.000Z | 2021-09-11T02:39:36.000Z | from typing import Optional, Union
from simfile.ssc import SSCSimfile, SSCChart
from simfile.types import Simfile, Chart
# Fun fact: SSC versions are stored as floats internally
# This is widely regarded as a mistake, but it does make comparisons easy!
SSC_VERSION_SPLIT_TIMING = 0.7
# These are the properties that,... | 30.085714 | 88 | 0.732194 |
729d247dfd471bce6cdc288dddfea984b4ecb780 | 1,665 | py | Python | bdc_db/models/asset.py | mzaglia/bdc-db | bce8ba164a336dd8f7638ed4c0a5c1a4ad80e3a5 | [
"MIT"
] | null | null | null | bdc_db/models/asset.py | mzaglia/bdc-db | bce8ba164a336dd8f7638ed4c0a5c1a4ad80e3a5 | [
"MIT"
] | null | null | null | bdc_db/models/asset.py | mzaglia/bdc-db | bce8ba164a336dd8f7638ed4c0a5c1a4ad80e3a5 | [
"MIT"
] | null | null | null | #
# This file is part of Brazil Data Cube Database module.
# Copyright (C) 2019 INPE.
#
# Brazil Data Cube Database module is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
from sqlalchemy import (Column, Float, ForeignKey, ForeignKeyC... | 39.642857 | 121 | 0.718318 |
e127a04f74396b419d950b1285e0e55dbc3bf177 | 3,006 | py | Python | tools/convert_datasets/chase_db1.py | Fruit-Lab/mmsegmentation | 3bdc276888c806b659d3709e33b4ecea8cb2877f | [
"Apache-2.0"
] | 1 | 2020-10-26T05:40:48.000Z | 2020-10-26T05:40:48.000Z | tools/convert_datasets/chase_db1.py | jizhe2006/mmsegmentation | e384ef578a6d82c99d9b1190b337c615814e928b | [
"Apache-2.0"
] | null | null | null | tools/convert_datasets/chase_db1.py | jizhe2006/mmsegmentation | e384ef578a6d82c99d9b1190b337c615814e928b | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import os.path as osp
import tempfile
import zipfile
import mmcv
CHASE_DB1_LEN = 28 * 3
TRAINING_LEN = 60
def parse_args():
parser = argparse.ArgumentParser(
description='Convert CHASE_DB1 dataset to mmsegmentation format')
parser.add_argument('dataset_path', help='path of ... | 35.785714 | 79 | 0.595476 |
1f9fe719590e9828f5dea927d512c4afd2015de2 | 6,313 | py | Python | airflow/providers/microsoft/azure/hooks/adx.py | shashijangra/airflow-1 | c3e340584bf1892c4f73aa9e7495b5823dab0c40 | [
"Apache-2.0"
] | 2 | 2021-07-30T17:25:56.000Z | 2021-08-03T13:51:09.000Z | airflow/providers/microsoft/azure/hooks/adx.py | shashijangra/airflow-1 | c3e340584bf1892c4f73aa9e7495b5823dab0c40 | [
"Apache-2.0"
] | 10 | 2021-09-08T21:27:07.000Z | 2022-03-30T17:54:45.000Z | airflow/providers/microsoft/azure/hooks/adx.py | shashijangra/airflow-1 | c3e340584bf1892c4f73aa9e7495b5823dab0c40 | [
"Apache-2.0"
] | 2 | 2020-10-23T18:55:05.000Z | 2022-02-16T21:53:10.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 42.086667 | 116 | 0.672739 |
a3f9ff0230fb1cdd75e4897cf5a8e2ccbad689be | 18,668 | py | Python | sdk/python/pulumi_azure_native/web/v20150801/site_backup_configuration_slot.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20150801/site_backup_configuration_slot.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20150801/site_backup_configuration_slot.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 44.132388 | 1,525 | 0.648489 |
e5b0744368543898b2b825fff6983c4200d22e84 | 1,440 | py | Python | demos/demo_reactive_planners_end_effector_trajectory3d.py | Lhumd/reactive_planners-1 | 5d8bd04da3d06fb2f968aa23a0c6713dcd773f44 | [
"BSD-3-Clause"
] | 6 | 2021-09-13T10:25:50.000Z | 2022-02-27T21:55:25.000Z | demos/demo_reactive_planners_end_effector_trajectory3d.py | Lhumd/reactive_planners-1 | 5d8bd04da3d06fb2f968aa23a0c6713dcd773f44 | [
"BSD-3-Clause"
] | 1 | 2021-11-28T04:02:31.000Z | 2022-01-18T16:33:43.000Z | demos/demo_reactive_planners_end_effector_trajectory3d.py | Lhumd/reactive_planners-1 | 5d8bd04da3d06fb2f968aa23a0c6713dcd773f44 | [
"BSD-3-Clause"
] | 2 | 2021-09-15T09:07:01.000Z | 2022-02-16T21:28:10.000Z | #!/usr/bin/env python
""" @namespace Demos of the reactive_planners.end_effector_trajectory.
@file
@copyright Copyright (c) 2017-2019,
New York University and Max Planck Gesellschaft,
License BSD-3-Clause
@example
"""
import numpy as np
from matplotlib import pyplot as plt
from reactive_planners... | 24.827586 | 70 | 0.636806 |
e9179d1b79f99eee99699252031dc394e7871d18 | 1,304 | py | Python | setup.py | ethier/braintree_python | d76fd1d43f003ce0e9fdc3411b258b3c109a4918 | [
"MIT"
] | null | null | null | setup.py | ethier/braintree_python | d76fd1d43f003ce0e9fdc3411b258b3c109a4918 | [
"MIT"
] | null | null | null | setup.py | ethier/braintree_python | d76fd1d43f003ce0e9fdc3411b258b3c109a4918 | [
"MIT"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
long_description = """
The Braintree Python SDK provides integration access to the Braintree Gateway.
1. https://github.com/braintree/braintree_python - README and Samples
2. https://developers.brain... | 37.257143 | 175 | 0.672546 |
ae7406b2ee905008270c216cc1e97c281a910789 | 4,644 | py | Python | akshare/bank/bank_cbirc.py | PKUuu/akshare | 03967312b6c8afdec32e081fb23ae5916b674936 | [
"MIT"
] | 1 | 2020-02-12T08:59:05.000Z | 2020-02-12T08:59:05.000Z | akshare/bank/bank_cbirc.py | 13767849/akshare | 5b7e4daaa80b1ccaf3f5a980a1205848e2e8570d | [
"MIT"
] | null | null | null | akshare/bank/bank_cbirc.py | 13767849/akshare | 5b7e4daaa80b1ccaf3f5a980a1205848e2e8570d | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Author: Albert King
date: 2019/11/7 14:06
contact: jindaxiang@163.com
desc: 不需要控制速度, 但是需要伪装游览器, 不然会被一次封 IP 地址
"""
import requests
import execjs
import pandas as pd
from bs4 import BeautifulSoup
from akshare.bank.cons import cbirc_headers_without_cookie_2019
def bank_p... | 33.171429 | 88 | 0.527993 |
f5908a064108bc142a6a5c21f47b7c33a16015e8 | 56,393 | py | Python | pycuda/gpuarray.py | brumen/pycuda | 50185c2718d71f8b404bf7f0ba3c025dd48f4acf | [
"Apache-2.0"
] | null | null | null | pycuda/gpuarray.py | brumen/pycuda | 50185c2718d71f8b404bf7f0ba3c025dd48f4acf | [
"Apache-2.0"
] | null | null | null | pycuda/gpuarray.py | brumen/pycuda | 50185c2718d71f8b404bf7f0ba3c025dd48f4acf | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pycuda.elementwise as elementwise
from pytools import memoize, memoize_method
import pycuda.driver as drv
from pycuda.compyte.array import (
as_strided as _as_strided,
f_contiguous_strides as _f_contiguous_strides,
c_contiguous_strides as _c_contiguous_strides,
ArrayFlags as _A... | 29.540597 | 89 | 0.561772 |
8c168727174b196d4a8d18cada3b672036bc61aa | 4,500 | py | Python | lib/python2.7/site-packages/scipy/stats/_distr_params.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 18 | 2018-02-23T11:28:54.000Z | 2021-09-23T08:19:54.000Z | SLpackage/private/thirdparty/pythonpkgs/scipy/scipy_0.19.1/lib/python2.7/site-packages/scipy/stats/_distr_params.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | 8 | 2020-09-26T00:55:16.000Z | 2022-03-12T00:23:07.000Z | SLpackage/private/thirdparty/pythonpkgs/scipy/scipy_0.19.1/lib/python2.7/site-packages/scipy/stats/_distr_params.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | 5 | 2019-03-12T14:24:18.000Z | 2021-06-23T13:42:58.000Z | """
Sane parameters for stats.distributions.
"""
distcont = [
['alpha', (3.5704770516650459,)],
['anglit', ()],
['arcsine', ()],
['argus', (1.0,)],
['beta', (2.3098496451481823, 0.62687954300963677)],
['betaprime', (5, 6)],
['bradford', (0.29891359763170633,)],
['burr', (10.5, 4.3)],
... | 34.883721 | 79 | 0.543778 |
d9bf34119f851956cb2d663b096caca48accaf23 | 2,149 | py | Python | cd/utilities/logger.py | Axelware/CD-bot | 8f923c09c3c8cfcff48813c6dd11ac50c410af72 | [
"MIT"
] | 2 | 2021-12-10T00:36:59.000Z | 2021-12-11T09:11:46.000Z | cd/utilities/logger.py | Axelware/CD-bot | 8f923c09c3c8cfcff48813c6dd11ac50c410af72 | [
"MIT"
] | 2 | 2021-12-10T01:53:10.000Z | 2021-12-10T09:06:01.000Z | cd/utilities/logger.py | Axelware/CD-bot | 8f923c09c3c8cfcff48813c6dd11ac50c410af72 | [
"MIT"
] | 1 | 2021-12-10T00:37:07.000Z | 2021-12-10T00:37:07.000Z | # Future
from __future__ import annotations
# Standard Library
import logging
import logging.handlers
import os
# Packages
import colorama
__all__ = (
"setup_logger",
)
class ColourFormatter(logging.Formatter):
COLOURS: dict[int, str] = {
logging.DEBUG: colorama.Fore.MAGENTA,
logging.IN... | 27.551282 | 120 | 0.598883 |
46863283adc24966463c27aa33bf4a604033de29 | 8,202 | py | Python | tools/text_similarity.py | ninikolov/lha | b209684b8709e191e026892c5918b53402024e51 | [
"MIT"
] | 5 | 2019-08-05T08:54:33.000Z | 2020-05-16T13:10:41.000Z | tools/text_similarity.py | ninikolov/lha | b209684b8709e191e026892c5918b53402024e51 | [
"MIT"
] | 1 | 2019-10-24T12:35:23.000Z | 2019-10-24T12:35:23.000Z | tools/text_similarity.py | ninikolov/lha | b209684b8709e191e026892c5918b53402024e51 | [
"MIT"
] | 2 | 2020-11-06T13:17:36.000Z | 2021-10-14T11:03:00.000Z | """Implements functions for computing similarity scores between texts."""
import logging
import numpy as np
from scipy.spatial.distance import cdist
from sklearn.metrics.pairwise import cosine_similarity
from lha.tools.embeddings import get_word_vector_list
from lha.preprocessing.clean_text import clean_stem, clean_t... | 35.051282 | 112 | 0.660936 |
ac24afd44b7fabe740db11b62d1e613382c0d5ee | 31,208 | py | Python | ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py | bebule/ambari | 304f47c55f2a79ffd85abc40574d6847093bd7df | [
"Apache-2.0"
] | 1 | 2021-07-03T08:17:34.000Z | 2021-07-03T08:17:34.000Z | ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py | bebule/ambari | 304f47c55f2a79ffd85abc40574d6847093bd7df | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py | bebule/ambari | 304f47c55f2a79ffd85abc40574d6847093bd7df | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
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")... | 52.187291 | 721 | 0.655217 |
0b9185f2e7112b3953d8633bb6cf661ca59b34c3 | 24,753 | py | Python | isofit/core/fileio.py | jfahlen/isofit | 8a8e6eec6d6cd11bdc128690a610186fb4ef196a | [
"Apache-2.0"
] | 1 | 2021-01-13T00:08:17.000Z | 2021-01-13T00:08:17.000Z | isofit/core/fileio.py | jfahlen/isofit | 8a8e6eec6d6cd11bdc128690a610186fb4ef196a | [
"Apache-2.0"
] | null | null | null | isofit/core/fileio.py | jfahlen/isofit | 8a8e6eec6d6cd11bdc128690a610186fb4ef196a | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
#
# Copyright 2018 California Institute of Technology
#
# 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
#
# Unle... | 40.712171 | 118 | 0.588737 |
fc4b4f7d48f2639f8bfbf0a135a4da8711e7eaeb | 6,457 | py | Python | tests/unit/test_rules/test_base.py | Worteks/OrangeAssassin | 21baf0b84fbedd887f6d88e13c624f14fb0b5e06 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_rules/test_base.py | Worteks/OrangeAssassin | 21baf0b84fbedd887f6d88e13c624f14fb0b5e06 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_rules/test_base.py | Worteks/OrangeAssassin | 21baf0b84fbedd887f6d88e13c624f14fb0b5e06 | [
"Apache-2.0"
] | null | null | null | """Tests for pad.rules.base"""
import unittest
try:
from unittest.mock import patch, Mock
except ImportError:
from mock import patch, Mock
import oa.errors
import oa.rules.base
class TestBaseRule(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.mock_msg = Mock()
... | 37.109195 | 79 | 0.614372 |
1b9b0d21b7bdd402baef6e539096d821ac57ce68 | 670 | py | Python | instagram/migrations/0004_auto_20200308_1732.py | arondasamuel123/InstagramClone | 9fff1b83e3f4ebabeeb7d3609ab2a9636e46d8b2 | [
"MIT"
] | null | null | null | instagram/migrations/0004_auto_20200308_1732.py | arondasamuel123/InstagramClone | 9fff1b83e3f4ebabeeb7d3609ab2a9636e46d8b2 | [
"MIT"
] | 7 | 2021-03-19T00:39:36.000Z | 2021-09-22T18:41:42.000Z | instagram/migrations/0004_auto_20200308_1732.py | arondasamuel123/InstagramClone | 9fff1b83e3f4ebabeeb7d3609ab2a9636e46d8b2 | [
"MIT"
] | 2 | 2021-04-25T09:15:11.000Z | 2021-05-25T07:33:34.000Z | # Generated by Django 3.0.4 on 2020-03-08 14:32
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('instagram', '0003_auto_20200307_1543'),
]
operations = [
migrations.AlterField(
model_name='image',
... | 26.8 | 99 | 0.637313 |
d5622f76ce6f20cb7a32965c6b0ed713807f9df0 | 4,827 | py | Python | src/graphql/validation/rules/fields_on_correct_type.py | fugal-dy/graphql-core | a2dc9147d61212758b93b028b9f377e36095cf35 | [
"MIT"
] | 249 | 2018-08-01T21:43:45.000Z | 2020-03-11T18:31:10.000Z | src/graphql/validation/rules/fields_on_correct_type.py | fugal-dy/graphql-core | a2dc9147d61212758b93b028b9f377e36095cf35 | [
"MIT"
] | 76 | 2018-08-03T11:48:27.000Z | 2020-03-04T17:32:26.000Z | src/graphql/validation/rules/fields_on_correct_type.py | fugal-dy/graphql-core | a2dc9147d61212758b93b028b9f377e36095cf35 | [
"MIT"
] | 48 | 2018-08-15T17:48:11.000Z | 2020-03-12T12:50:51.000Z | from collections import defaultdict
from functools import cmp_to_key
from typing import Any, Dict, List, Union, cast
from ...type import (
GraphQLAbstractType,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLOutputType,
GraphQLSchema,
is_abstract_type,
is_interface_type,
is_object_type,... | 35.233577 | 88 | 0.672053 |
7995e972f8152155068209b46e194a5dac74e420 | 5,291 | py | Python | venv/lib/python3.6/site-packages/clint/textui/prompt.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 2 | 2019-01-02T14:17:59.000Z | 2019-03-31T17:53:41.000Z | venv/lib/python3.6/site-packages/clint/textui/prompt.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/lib/python3.6/site-packages/clint/textui/prompt.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 40 | 2016-04-23T05:33:30.000Z | 2022-03-01T08:14:00.000Z | # -*- coding: utf8 -*-
"""
clint.textui.prompt
~~~~~~~~~~~~~~~~~~~
Module for simple interactive prompts handling
"""
from __future__ import absolute_import, print_function
from re import match, I
from .core import puts
from .colored import yellow
from .validators import RegexValidator, OptionValidator
try:
... | 28.912568 | 125 | 0.571348 |
599fe3d127636489d876c0663e630d57b6f5bde5 | 70,226 | py | Python | tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-30T02:23:29.000Z | 2020-11-30T02:23:29.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 41.455726 | 151 | 0.596873 |
304a54edd2f68c0ba40f90209911f9602090a00f | 3,116 | py | Python | userbot/modules/kamuii.py | jokokendi/Ice-Userbot | bc5bbf84e7f1f02ad03cc65d4d989b24b32491aa | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2022-01-26T07:57:40.000Z | 2022-03-24T23:20:54.000Z | userbot/modules/kamuii.py | kenaja/Ice-Userbot | bb8307800623dc447b1ea5059e23e55a1ae72f4f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/kamuii.py | kenaja/Ice-Userbot | bb8307800623dc447b1ea5059e23e55a1ae72f4f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 10 | 2022-02-06T18:30:42.000Z | 2022-03-29T04:21:01.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
import os
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.contacts import Unb... | 36.658824 | 85 | 0.615212 |
f02072d778026d9d84742cf452c95032460d8f0f | 3,832 | py | Python | swagger_client/models/distance_stream.py | Shark4109/stravaio | 237ac93d3adb7fe8d66cf1f468eee05234c3cd76 | [
"MIT"
] | null | null | null | swagger_client/models/distance_stream.py | Shark4109/stravaio | 237ac93d3adb7fe8d66cf1f468eee05234c3cd76 | [
"MIT"
] | null | null | null | swagger_client/models/distance_stream.py | Shark4109/stravaio | 237ac93d3adb7fe8d66cf1f468eee05234c3cd76 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Strava API v3
The [Swagger Playground](https://developers.strava.com/playground) is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with differe... | 32.474576 | 726 | 0.595251 |
31c38c09bc0682dfef5e2eb75e1c168b03755d23 | 1,159 | py | Python | strategiksv/__manifest__.py | grottas/odoosv | 3110a2806c550a05a2baa911e2fc98bf24c78909 | [
"Apache-2.0"
] | null | null | null | strategiksv/__manifest__.py | grottas/odoosv | 3110a2806c550a05a2baa911e2fc98bf24c78909 | [
"Apache-2.0"
] | null | null | null | strategiksv/__manifest__.py | grottas/odoosv | 3110a2806c550a05a2baa911e2fc98bf24c78909 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name': "strategiksv",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long description of module's purpose
""",
'author': "Strategi-k.com",
'... | 26.953488 | 100 | 0.590164 |
f756ab2f736018bc700c5f0602b1fe3824ba90c9 | 3,788 | py | Python | contrib/macdeploy/custom_dsstore.py | cryptcoin-dev/cryptcoin | d9ee1250d07190014c89d0474430634bc2c7441c | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | cryptcoin-dev/cryptcoin | d9ee1250d07190014c89d0474430634bc2c7441c | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | cryptcoin-dev/cryptcoin | d9ee1250d07190014c89d0474430634bc2c7441c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 62.098361 | 1,817 | 0.728353 |
092d98c1ab3ce79254efd0232e2177b98dd73ac4 | 167 | py | Python | fantom/asgi.py | Rasel-Al-Mamun/Fantom-Django-Blog | fdc6e25043d7790154c0880a75c907045351544a | [
"MIT"
] | null | null | null | fantom/asgi.py | Rasel-Al-Mamun/Fantom-Django-Blog | fdc6e25043d7790154c0880a75c907045351544a | [
"MIT"
] | null | null | null | fantom/asgi.py | Rasel-Al-Mamun/Fantom-Django-Blog | fdc6e25043d7790154c0880a75c907045351544a | [
"MIT"
] | null | null | null | import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fantom.settings')
application = get_asgi_application()
| 20.875 | 66 | 0.826347 |
1e091c53a24a7f2abf73c24d71a055ffe2153a9b | 3,923 | py | Python | test/test_pytest.py | tuffnatty/schemathesis | c104923f31235df49555ab0c8d92b5cb81957de0 | [
"MIT"
] | 1 | 2020-05-22T19:48:35.000Z | 2020-05-22T19:48:35.000Z | test/test_pytest.py | arvindjangra1996/schemathesis | 2132cd26e057b19f3f7600ccaa6e8a515a194481 | [
"MIT"
] | null | null | null | test/test_pytest.py | arvindjangra1996/schemathesis | 2132cd26e057b19f3f7600ccaa6e8a515a194481 | [
"MIT"
] | null | null | null | def test_pytest_parametrize_fixture(testdir):
# When `pytest_generate_tests` is used on a module level for fixture parametrization
testdir.make_test(
"""
def pytest_generate_tests(metafunc):
metafunc.parametrize("inner", ("A", "B"))
@pytest.fixture()
def param(inner):
return inner * 2
@schema.... | 33.818966 | 109 | 0.633954 |
a219cfac7613f20084ab20b79602dd5482276a4b | 466 | py | Python | rest/messages/send-sms-callback/send-sms-callback.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 234 | 2016-01-27T03:04:38.000Z | 2022-02-25T20:13:43.000Z | rest/messages/send-sms-callback/send-sms-callback.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 351 | 2016-04-06T16:55:33.000Z | 2022-03-10T18:42:36.000Z | rest/messages/send-sms-callback/send-sms-callback.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 494 | 2016-03-30T15:28:20.000Z | 2022-03-28T19:39:36.000Z | import os
from twilio.rest import Client
# put your own credentials here
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)
client.messages.create(
to="+15558675310",
... | 27.411765 | 68 | 0.751073 |
3013bd20aa258f7576f9f4c8ead634ddf6531c89 | 27,281 | py | Python | src/python/libs.py | hindsights/gml | 876810c9dc3a33731e0df9dce9dfd68a655c6330 | [
"MIT"
] | 3 | 2018-03-01T13:34:00.000Z | 2018-04-02T03:02:22.000Z | src/python/libs.py | hindsights/gml | 876810c9dc3a33731e0df9dce9dfd68a655c6330 | [
"MIT"
] | null | null | null | src/python/libs.py | hindsights/gml | 876810c9dc3a33731e0df9dce9dfd68a655c6330 | [
"MIT"
] | null | null | null |
from basetype import BuiltinTypeClass, LibLiteral, LibClass, LibFunc, LibVar, makeFuncSpec
import builtins
import operator
import xutils
import ast
import os
import sys
import os.path
import yaml
import logging
from cStringIO import StringIO
import parser
import goparser
import lib
from itertools import chain
import t... | 42.23065 | 145 | 0.610352 |
64c4fa9861eeed18d8072d767e65ab2b4991a29b | 9,919 | py | Python | bookworm/otau.py | zstanecic/bookworm | e5371344986b97a219a8a7527dec378fe7a09634 | [
"MIT"
] | null | null | null | bookworm/otau.py | zstanecic/bookworm | e5371344986b97a219a8a7527dec378fe7a09634 | [
"MIT"
] | null | null | null | bookworm/otau.py | zstanecic/bookworm | e5371344986b97a219a8a7527dec378fe7a09634 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Over the air update (OTAU) functionality."""
import sys
import os
import shutil
import zipfile
import tempfile
import requests
import wx
import win32api
from math import ceil
from io import BytesIO
from hashlib import sha1
from pathlib import Path
from lzma import decompress
from System.Diagnostics... | 40.321138 | 107 | 0.650166 |
e6e92b6bb658364da61f90054ffd390e6c9fa8c5 | 5,383 | py | Python | neural_spline_flows/nde/transforms/normalization_test.py | VincentStimper/nsf | 6bde505639ebcb67bffa227ea0021e3de235e03d | [
"MIT"
] | null | null | null | neural_spline_flows/nde/transforms/normalization_test.py | VincentStimper/nsf | 6bde505639ebcb67bffa227ea0021e3de235e03d | [
"MIT"
] | null | null | null | neural_spline_flows/nde/transforms/normalization_test.py | VincentStimper/nsf | 6bde505639ebcb67bffa227ea0021e3de235e03d | [
"MIT"
] | null | null | null | """Tests for the normalization-based transforms."""
import torch
import unittest
from neural_spline_flows.nde.transforms import base
from neural_spline_flows.nde.transforms import normalization as norm
from neural_spline_flows.nde.transforms.transform_test import TransformTest
class BatchNormTest(TransformTest):
... | 41.091603 | 88 | 0.593721 |
4a7d8d5d9b2c3b21ebc2adc417a6356e58645553 | 76 | py | Python | ABC024/ABC024d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC024/ABC024d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC024/ABC024d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC024d
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| 15.2 | 28 | 0.789474 |
6ec53a5a8cad357823eb151371956180058d8194 | 523 | py | Python | backend/apps/workers/migrations/0006_alter_worker_operador.py | jorgejimenez98/backend-evaluacion-desempenno | 08975303952608809375c5e2185bf20a84cc0f4e | [
"MIT"
] | null | null | null | backend/apps/workers/migrations/0006_alter_worker_operador.py | jorgejimenez98/backend-evaluacion-desempenno | 08975303952608809375c5e2185bf20a84cc0f4e | [
"MIT"
] | null | null | null | backend/apps/workers/migrations/0006_alter_worker_operador.py | jorgejimenez98/backend-evaluacion-desempenno | 08975303952608809375c5e2185bf20a84cc0f4e | [
"MIT"
] | null | null | null | # Generated by Django 3.2.2 on 2021-06-17 00:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workers', '0005_worker_operador'),
]
operations = [
migrations.AlterField(
model_name='worker',... | 26.15 | 155 | 0.65392 |
52ce6cbe934102e0658b6848f6ade8eb259a6a52 | 431 | py | Python | mtbf_driver/mtbf_apps/fmradio/app.py | zapion/MTBF-Driver | ad2406ce5191bd0d0849644b1e5ec9622fb45ae1 | [
"Apache-2.0"
] | null | null | null | mtbf_driver/mtbf_apps/fmradio/app.py | zapion/MTBF-Driver | ad2406ce5191bd0d0849644b1e5ec9622fb45ae1 | [
"Apache-2.0"
] | null | null | null | mtbf_driver/mtbf_apps/fmradio/app.py | zapion/MTBF-Driver | ad2406ce5191bd0d0849644b1e5ec9622fb45ae1 | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest.apps.base import Base
from gaiatest.apps.fmradio.app import FmRadio
import ti... | 28.733333 | 69 | 0.728538 |
7bae11fc32bb8fdadf6c4bf7d124be67c7026ce1 | 90,323 | py | Python | models/DeformableConvNets/rfcn/symbols/deform_conv_demo.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/DeformableConvNets/rfcn/symbols/deform_conv_demo.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/DeformableConvNets/rfcn/symbols/deform_conv_demo.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Yuwen Xiong, Xizhou Zhu
# --------------------------------------------------------
import cPickle
import mxnet as mx
from... | 80.789803 | 120 | 0.585 |
c6e1f8f9514bd6bdfc676809110b3fe823a11342 | 10,303 | py | Python | Library/src/mavlink/pymavlink/tools/mavfft_isb.py | Dieptranivsr/Ros_Diep | d790e75e6f5da916701b11a2fdf3e03b6a47086b | [
"MIT"
] | null | null | null | Library/src/mavlink/pymavlink/tools/mavfft_isb.py | Dieptranivsr/Ros_Diep | d790e75e6f5da916701b11a2fdf3e03b6a47086b | [
"MIT"
] | 1 | 2021-07-08T10:26:06.000Z | 2021-07-08T10:31:11.000Z | Library/src/mavlink/pymavlink/tools/mavfft_isb.py | Dieptranivsr/Ros_Diep | d790e75e6f5da916701b11a2fdf3e03b6a47086b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
extract ISBH and ISBD messages from AP_Logging files and produce FFT plots
'''
from __future__ import print_function
import numpy
import os
import pylab
import sys
import time
import copy
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("... | 40.562992 | 190 | 0.566049 |
38b2b450b492ba35d3f72a06bdd1f568cc1fa46f | 665 | py | Python | examples/voucher.py | edwin-19/rm-python-sdk | 8ee2eb5b2c08bba4693e1aafe37fe4e2a2c37378 | [
"MIT"
] | 3 | 2019-01-13T11:48:00.000Z | 2019-01-21T10:45:49.000Z | examples/voucher.py | edwin-19/rm-python-sdk | 8ee2eb5b2c08bba4693e1aafe37fe4e2a2c37378 | [
"MIT"
] | 1 | 2021-08-25T04:04:49.000Z | 2021-08-25T05:02:57.000Z | examples/voucher.py | edwin-19/rm-python-sdk | 8ee2eb5b2c08bba4693e1aafe37fe4e2a2c37378 | [
"MIT"
] | 1 | 2022-03-15T06:58:58.000Z | 2022-03-15T06:58:58.000Z | #!/usr/bin/python3
from rmsdk import RMSDK
from configs import configs
client = RMSDK(configs=configs)
accessToken, voucher = client.accessToken, client.voucher
# print(voucher.issueVoucher(accessToken, "EhQKCE1lcmNoYW50EJXVzd3wraqTORIYCgxWb3VjaGVyQmF0Y2gQkvnGweaB2uQg"))
# print(voucher.voidVoucher(accessToken, "Eh... | 47.5 | 116 | 0.867669 |
2cf3cf44d6081c5f0a7130ca83f3b7060ad1a74b | 1,115 | py | Python | hazelcast/protocol/codec/map_entries_with_paging_predicate_codec.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 98 | 2015-12-08T14:26:27.000Z | 2022-03-23T17:44:11.000Z | hazelcast/protocol/codec/map_entries_with_paging_predicate_codec.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 396 | 2016-02-23T11:07:55.000Z | 2022-03-31T14:26:34.000Z | hazelcast/protocol/codec/map_entries_with_paging_predicate_codec.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 62 | 2015-12-09T11:20:53.000Z | 2022-01-28T01:30:54.000Z | from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.codec.custom.paging_predicate_holder_codec import PagingPredicateHolderCodec
from hazelcast.protocol.builtin import EntryListCodec
from haz... | 38.448276 | 105 | 0.83139 |
a8299d0b7fa241659c4fb4ec9fec1b2e17f40083 | 34,239 | bzl | Python | bazel/repositories.bzl | coeuvre/envoy | 51f6fad7466dfc775493570bc1ba5afc2293425f | [
"Apache-2.0"
] | null | null | null | bazel/repositories.bzl | coeuvre/envoy | 51f6fad7466dfc775493570bc1ba5afc2293425f | [
"Apache-2.0"
] | 71 | 2021-10-04T07:20:43.000Z | 2022-03-28T07:33:06.000Z | bazel/repositories.bzl | douglas-reid/envoy | 5d3e47bed30126dd2a66b486c26f561fa988922f | [
"Apache-2.0"
] | null | null | null | load(":dev_binding.bzl", "envoy_dev_binding")
load(":genrule_repository.bzl", "genrule_repository")
load("@envoy_api//bazel:envoy_http_archive.bzl", "envoy_http_archive")
load("@envoy_api//bazel:external_deps.bzl", "load_repository_locations")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS_SPEC")
load("@com_go... | 30.570536 | 133 | 0.659891 |
d6aada183f43fce8b3d78f2b5309257d85353966 | 639 | py | Python | Recipes/ping.py | Seniatical/IPC | 145461a932974cb1e2125a134bcda0d12a54dae3 | [
"MIT"
] | null | null | null | Recipes/ping.py | Seniatical/IPC | 145461a932974cb1e2125a134bcda0d12a54dae3 | [
"MIT"
] | null | null | null | Recipes/ping.py | Seniatical/IPC | 145461a932974cb1e2125a134bcda0d12a54dae3 | [
"MIT"
] | null | null | null | ## Caclulate the ping of your app server
## Not accurate
from IPC import AppClient
client = AppClient('localhost', 5000, 'mysecretkey')
@client.on_call(event_name='ping')
def get_ping():
return 'Called!'
client.start()
## Web
from IPC import WebClient
from time import perf_counter
from flask import Flask
... | 20.612903 | 96 | 0.690141 |
87b4ae3bb326479cb38172e4ba0ef0b00f492a8e | 2,475 | py | Python | deltalogger/deltalogger.py | SpyrosMouselinos/DeltaFormers | 38508fa9b85f2c50aa0031b67e7e8feff1a75b27 | [
"Apache-2.0"
] | 1 | 2021-06-23T19:05:16.000Z | 2021-06-23T19:05:16.000Z | deltalogger/deltalogger.py | SpyrosMouselinos/DeltaFormers | 38508fa9b85f2c50aa0031b67e7e8feff1a75b27 | [
"Apache-2.0"
] | null | null | null | deltalogger/deltalogger.py | SpyrosMouselinos/DeltaFormers | 38508fa9b85f2c50aa0031b67e7e8feff1a75b27 | [
"Apache-2.0"
] | null | null | null | import os
import neptune.new as neptune
from neptune.new.exceptions import NeptuneInvalidApiTokenException, FileUploadError
# Look for API TOKEN in the MACHINE
API_TOKEN = os.getenv('NEPTUNE_API_TOKEN')
class DummySession:
def __init__(self):
return
def upload(self, *args, **kwargs):
return... | 29.117647 | 110 | 0.589899 |
24b65eb02d76e7c411a13c10b2c45ce2976a3e09 | 11,520 | py | Python | qiita_db/test/test_search.py | adamrp/qiita | 3e3e5d504352c4e5fee4a1187390c9c7dc712170 | [
"BSD-3-Clause"
] | null | null | null | qiita_db/test/test_search.py | adamrp/qiita | 3e3e5d504352c4e5fee4a1187390c9c7dc712170 | [
"BSD-3-Clause"
] | null | null | null | qiita_db/test/test_search.py | adamrp/qiita | 3e3e5d504352c4e5fee4a1187390c9c7dc712170 | [
"BSD-3-Clause"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 49.021277 | 79 | 0.543576 |
3c4b6dba3febabe090bde5c89de82f38f1ae8cd3 | 1,399 | py | Python | axonius_api_client/cli/grp_assets/grp_saved_query/cmd_add_from_wiz_csv.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/cli/grp_assets/grp_saved_query/cmd_add_from_wiz_csv.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/cli/grp_assets/grp_saved_query/cmd_add_from_wiz_csv.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""Command line interface for Axonius API Client."""
from ...context import CONTEXT_SETTINGS, click
from ...options import AUTH, INPUT_FILE, add_options, get_option_help
from .grp_common import ABORT, EXPORT_FORMAT, OVERWRITE, check_sq_exist, handle_export
OPTIONS = [
*AUTH,
EXPORT_FORM... | 36.815789 | 86 | 0.690493 |
f9f2a52ce7581c353a5e4886bc1b5f7123949fe8 | 28,731 | py | Python | google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py | dwkk-google/python-aiplatform | 016415122f93029cdd7703b6dfd6d9a431d1d571 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py | dwkk-google/python-aiplatform | 016415122f93029cdd7703b6dfd6d9a431d1d571 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py | dwkk-google/python-aiplatform | 016415122f93029cdd7703b6dfd6d9a431d1d571 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 42.88209 | 104 | 0.633741 |
4379d22c0d6f72a7d6da64d00197ea3d55dd0459 | 1,563 | py | Python | main/validators.py | dasap89/rest_accounts | e0daeece000391d93e1bc99db484b8fe45588046 | [
"MIT"
] | null | null | null | main/validators.py | dasap89/rest_accounts | e0daeece000391d93e1bc99db484b8fe45588046 | [
"MIT"
] | null | null | null | main/validators.py | dasap89/rest_accounts | e0daeece000391d93e1bc99db484b8fe45588046 | [
"MIT"
] | null | null | null | from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
import re
class CustomPasswordValidator(object):
def __init__(self, min_length=1):
self.min_length = min_length
def validate(self, password, user=None):
special_characters = "[~\!@#\$%\^&\*\(\... | 38.121951 | 80 | 0.577095 |
9364bb65b435b45a01fa35b1e0b5df90914ac989 | 1,712 | py | Python | pyrival/misc/FastIO.py | BarrensZeppelin/PyRival | bb01523283af0130c3921445ed5e532bfcf053af | [
"Apache-2.0"
] | 3 | 2020-05-07T10:48:11.000Z | 2020-08-15T08:31:40.000Z | pyrival/misc/FastIO.py | swarajspatil158/PyRival | 07c4c38b2b6ca69a275d2ed3743b6c09af80b732 | [
"Apache-2.0"
] | null | null | null | pyrival/misc/FastIO.py | swarajspatil158/PyRival | 07c4c38b2b6ca69a275d2ed3743b6c09af80b732 | [
"Apache-2.0"
] | 2 | 2021-05-22T13:45:06.000Z | 2022-03-06T18:22:05.000Z | import os
import sys
from io import BytesIO, IOBase
_str = str
str = lambda x=b"": x if type(x) is bytes else _str(x).encode()
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mod... | 30.571429 | 79 | 0.59229 |
0fd9ce12e21dc5ce764eba86c32c913f1e159397 | 300 | py | Python | Other_Python/Parallel_Learning_Tensorflow_CPU/Parallel_Visualization.py | Romit-Maulik/Tutorials-Demos-Practice | a58ddc819f24a16f7059e63d7f201fc2cd23e03a | [
"MIT"
] | 8 | 2020-09-02T14:46:07.000Z | 2021-11-29T15:27:05.000Z | Other_Python/Parallel_Learning_Tensorflow_CPU/Parallel_Visualization.py | omersan/Practice | 77eecdc2a202e6b333123cfd92e7db6dc0eea021 | [
"MIT"
] | 18 | 2020-11-13T18:49:33.000Z | 2022-03-12T00:54:43.000Z | Other_Python/Parallel_Learning_Tensorflow_CPU/Parallel_Visualization.py | omersan/Practice | 77eecdc2a202e6b333123cfd92e7db6dc0eea021 | [
"MIT"
] | 5 | 2019-09-25T23:57:00.000Z | 2021-04-18T08:15:34.000Z | # Parallel training visualization
import numpy as np
import matplotlib.pyplot as plt
total_procs = 4
plt.figure()
for i in range(total_procs):
filename_train_loss = 'loss_history_'+str(i)+'.txt'
arr = np.loadtxt(filename_train_loss)
plt.plot(arr,label='Processor '+str(i))
plt.legend()
plt.show() | 25 | 52 | 0.76 |
a6003d21b6b4a04c0a75a7616f3b9067300d5195 | 2,156 | py | Python | userbot/plugins/mf.py | RDX-GANG/RDX-bot | 9269a0fc31e15090ef6167262420ac97d263cf00 | [
"MIT"
] | 2 | 2020-12-17T00:56:04.000Z | 2021-01-15T04:33:59.000Z | userbot/plugins/mf.py | RDX-GANG/RDX-bot | 9269a0fc31e15090ef6167262420ac97d263cf00 | [
"MIT"
] | null | null | null | userbot/plugins/mf.py | RDX-GANG/RDX-bot | 9269a0fc31e15090ef6167262420ac97d263cf00 | [
"MIT"
] | 4 | 2020-12-26T08:13:23.000Z | 2022-03-07T10:28:31.000Z | import sys
import time
import os
"""Available Commands:
.mf"""
from telethon import events, functions, __version__
import asyncio
from userbot.utils import admin_cmd
@borg.on(admin_cmd("(.*)"))
async def _(event):
if event.fwd_from:
return
animation_interval = 1
animation_ttl = range(0,27)
... | 44.916667 | 937 | 0.392857 |
18d08358124eca6ba560757cf6c1e23f692d2e65 | 585 | py | Python | ordenador.py | isaberamos/Programinhas | d0bfa5099edaf05b9a5f055bf7ce5432588cdc3d | [
"MIT"
] | 1 | 2021-12-28T21:37:33.000Z | 2021-12-28T21:37:33.000Z | ordenador.py | isaberamos/Programinhas | d0bfa5099edaf05b9a5f055bf7ce5432588cdc3d | [
"MIT"
] | null | null | null | ordenador.py | isaberamos/Programinhas | d0bfa5099edaf05b9a5f055bf7ce5432588cdc3d | [
"MIT"
] | null | null | null | class Ordenador:
def selecao_direta(self, lista):
fim = len(lista)
for i in range(fim - 1):
# Inicialmente o menor elemento já visto é o i-ésimo
posicao_do_minimo = i
for j in range(i+1, fim):
if lista[j] < lista[posicao_do_minimo]:
... | 32.5 | 84 | 0.606838 |
0030feb4945a18950be6bc0d8999c1df155a52ce | 3,555 | py | Python | dl_coursera/lib/ExploringTree.py | nodamu/dl_coursera | 1cca8a12d048a37888709685e5e6e3384d6f2b8f | [
"MIT"
] | 111 | 2019-01-06T11:39:33.000Z | 2020-08-07T09:31:04.000Z | dl_coursera/lib/ExploringTree.py | avineshwar/dl_coursera | 1cca8a12d048a37888709685e5e6e3384d6f2b8f | [
"MIT"
] | 20 | 2019-08-18T15:21:01.000Z | 2020-07-28T18:22:43.000Z | dl_coursera/lib/ExploringTree.py | avineshwar/dl_coursera | 1cca8a12d048a37888709685e5e6e3384d6f2b8f | [
"MIT"
] | 20 | 2019-01-12T08:48:33.000Z | 2020-06-13T04:39:19.000Z | import collections
class _Path:
def __init__(self, li, *, absolute):
self.li = li
self.absolute = absolute
if self.absolute:
assert len(self.li) > 0 and self.li[0].isRoot()
def __str__(self):
if len(self.li) < 2:
res = ''
else:
res ... | 23.85906 | 72 | 0.522925 |
f7991ce45900672e11861ea0d61e37801dd387b5 | 2,760 | py | Python | server/djangoapp/models.py | gitbit789/agfzb-CloudAppDevelopment_Capstone | 0b68f9b0342f17a2329e89418ff3e31a9f65c5f5 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/models.py | gitbit789/agfzb-CloudAppDevelopment_Capstone | 0b68f9b0342f17a2329e89418ff3e31a9f65c5f5 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/models.py | gitbit789/agfzb-CloudAppDevelopment_Capstone | 0b68f9b0342f17a2329e89418ff3e31a9f65c5f5 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.timezone import now
# Create your models here.
# <HINT> Create a Car Make model `class CarMake(models.Model)`:
# - Name
# - Description
# - Any other fields you would like to include in car make model
# - __str__ method to print a car make object
class CarMake(models.Mo... | 32.093023 | 105 | 0.642391 |
dbb05d780eaae8e3c284da2befff1d4bc1c017ee | 79,167 | py | Python | Lib/unittest/mock.py | TeraMatrix/cpython | e3deae2870dbd13d16c309cc68020dfa3bb9e64d | [
"PSF-2.0"
] | null | null | null | Lib/unittest/mock.py | TeraMatrix/cpython | e3deae2870dbd13d16c309cc68020dfa3bb9e64d | [
"PSF-2.0"
] | null | null | null | Lib/unittest/mock.py | TeraMatrix/cpython | e3deae2870dbd13d16c309cc68020dfa3bb9e64d | [
"PSF-2.0"
] | null | null | null | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | 33.068922 | 85 | 0.60937 |
90473484bed27694335a79913f29bcedbd0d9415 | 7,549 | py | Python | src/obusgen/obusgen.py | Parrot-Developers/obus | d7104526659a12cccc1799e88f96192d9b1b5345 | [
"BSD-3-Clause"
] | null | null | null | src/obusgen/obusgen.py | Parrot-Developers/obus | d7104526659a12cccc1799e88f96192d9b1b5345 | [
"BSD-3-Clause"
] | 1 | 2021-03-31T10:29:33.000Z | 2021-03-31T10:29:33.000Z | src/obusgen/obusgen.py | isabella232/obus | d7104526659a12cccc1799e88f96192d9b1b5345 | [
"BSD-3-Clause"
] | 1 | 2016-11-03T10:42:14.000Z | 2016-11-03T10:42:14.000Z | #!/usr/bin/env python
#===============================================================================
# obusgen - obus source code generator.
#
# @file obusgen.py
#
# @brief obus source code generator
#
# @author jean-baptiste.dubois@parrot.com
#
# Copyright (c) 2013 Parrot S.A.
# All rights reserved.
#
# Redistributi... | 34.47032 | 83 | 0.580342 |
4678b971399302fed043312c06bb705980ef9139 | 3,976 | py | Python | vulhub/cli/remote_cli.py | huoxianclub/vulhub-compose | 0707abdeb41d54ec448bec537f44303eb0f30dfe | [
"MIT"
] | 18 | 2021-03-18T14:50:08.000Z | 2021-03-27T10:43:00.000Z | vulhub/cli/remote_cli.py | huoxianclub/vulhub-compose | 0707abdeb41d54ec448bec537f44303eb0f30dfe | [
"MIT"
] | null | null | null | vulhub/cli/remote_cli.py | huoxianclub/vulhub-compose | 0707abdeb41d54ec448bec537f44303eb0f30dfe | [
"MIT"
] | 4 | 2021-04-01T14:19:01.000Z | 2022-02-09T07:34:07.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: owefsad@huoxian.cn
# datetime: 2021/3/18 下午4:13
# project: vulhub-compose
import logging
import os
import queue
import tempfile
from urllib.parse import urljoin
import requests
import platform
from vulhub.cli.base_cli import BaseCli
from vulhub.cli.local_cli impo... | 32.064516 | 100 | 0.596831 |
0c06619dcc5272d7449cfd4b1df11878b73fc1ad | 1,495 | py | Python | examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py | Dan-krm/ccxt | 2ed8b7b8598e2934559822d81a8d14885b4d4ad3 | [
"MIT"
] | 1 | 2021-11-16T15:45:34.000Z | 2021-11-16T15:45:34.000Z | examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py | Dan-krm/ccxt | 2ed8b7b8598e2934559822d81a8d14885b4d4ad3 | [
"MIT"
] | null | null | null | examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py | Dan-krm/ccxt | 2ed8b7b8598e2934559822d81a8d14885b4d4ad3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from asyncio import run, gather
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxtpro # noqa: E402
print('CCXT Pro Version:', ccxtpro.__version__)
async def print_balance_continuously(exch... | 30.510204 | 87 | 0.58796 |
17b63a130fc8fa22de1d90debd0baa9dc0664b2c | 4,925 | py | Python | testframework/integration/modules/object/b_gen_object.py | ZtModArchive/blender_niftools_addon | fc28f567e1fa431ec6633cb2a138898136090b29 | [
"BSD-3-Clause"
] | 94 | 2020-11-06T15:06:20.000Z | 2022-03-25T05:58:10.000Z | testframework/integration/modules/object/b_gen_object.py | ZtModArchive/blender_niftools_addon | fc28f567e1fa431ec6633cb2a138898136090b29 | [
"BSD-3-Clause"
] | 97 | 2020-11-02T19:15:47.000Z | 2022-03-30T16:23:17.000Z | testframework/integration/modules/object/b_gen_object.py | ZtModArchive/blender_niftools_addon | fc28f567e1fa431ec6633cb2a138898136090b29 | [
"BSD-3-Clause"
] | 23 | 2020-11-29T17:51:15.000Z | 2022-03-30T19:31:29.000Z | """Helper functions to create and test Blender scene geometry data"""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright © 2005, NIF File Format Library and Tools contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | 35.948905 | 100 | 0.718376 |
dfb1e904bace0c2ae259a01467b00a16e68f1820 | 4,469 | py | Python | online_recommend/first-release-version/online_recommend/movie_recall/word2vec.py | hfhfn/db_recommend | 3a9f03157bb81e295f8cff30fbc7ad2a8cfdf963 | [
"MIT"
] | null | null | null | online_recommend/first-release-version/online_recommend/movie_recall/word2vec.py | hfhfn/db_recommend | 3a9f03157bb81e295f8cff30fbc7ad2a8cfdf963 | [
"MIT"
] | null | null | null | online_recommend/first-release-version/online_recommend/movie_recall/word2vec.py | hfhfn/db_recommend | 3a9f03157bb81e295f8cff30fbc7ad2a8cfdf963 | [
"MIT"
] | null | null | null | from utils import channelInfo, dim
from pyspark.ml.feature import Word2Vec
from pyspark.ml.feature import Word2VecModel
class Word2Vector(object):
def __init__(self, spark, refit, channel='电影'):
self.refit = refit
self.channel = channel
self.channel_id = channelInfo[self.channel]
... | 39.201754 | 125 | 0.611546 |
7721d3e15abd601695de14ef92fdf7d49a21a5ed | 19,154 | py | Python | big_sleep/big_sleep.py | yuenhy/big-sleep | b5ea80417c5229962965839a9b5a89882ccdb91d | [
"MIT"
] | null | null | null | big_sleep/big_sleep.py | yuenhy/big-sleep | b5ea80417c5229962965839a9b5a89882ccdb91d | [
"MIT"
] | null | null | null | big_sleep/big_sleep.py | yuenhy/big-sleep | b5ea80417c5229962965839a9b5a89882ccdb91d | [
"MIT"
] | null | null | null | import os
import sys
import subprocess
import signal
import dill
from datetime import datetime
from pathlib import Path
import random
import torch
import torch.nn.functional as F
from torch import nn
from torch.optim import Adam
from torchvision.utils import save_image
import torchvision.transforms as T
from PIL impo... | 35.47037 | 150 | 0.607341 |
ef5a40b184836902a30a1b1df785957beab7b38f | 21,010 | py | Python | pycqed/analysis/tools/data_manipulation.py | peendebak/PycQED_py3 | c85d511cf49f6f7e08365a7d9abe6019d05cb2ed | [
"MIT"
] | null | null | null | pycqed/analysis/tools/data_manipulation.py | peendebak/PycQED_py3 | c85d511cf49f6f7e08365a7d9abe6019d05cb2ed | [
"MIT"
] | null | null | null | pycqed/analysis/tools/data_manipulation.py | peendebak/PycQED_py3 | c85d511cf49f6f7e08365a7d9abe6019d05cb2ed | [
"MIT"
] | null | null | null | '''
Part of the 'new' analysis toolbox.
This should contain all the functions that where previously/are now contained
in modules/analysis/analysis_toolbox.py in the Analysis tools section.
To give a feeling of what functions belong here, the old a_tools can be
roughly split into
- file-handling tools
- data manipulatio... | 33.138801 | 105 | 0.597287 |
28c7010fc293f500f9e2e5f809119706506c2ca1 | 1,479 | py | Python | autobahn/protocols/ws_client_protocol.py | olegpshenichniy/uvloop-dyno-track | b90e369a12077d390bd74aab833c2c562c5a2567 | [
"MIT"
] | 2 | 2017-09-12T10:32:48.000Z | 2017-09-27T14:47:37.000Z | autobahn/protocols/ws_client_protocol.py | olegpshenichniy/uvloop-dyno-track | b90e369a12077d390bd74aab833c2c562c5a2567 | [
"MIT"
] | null | null | null | autobahn/protocols/ws_client_protocol.py | olegpshenichniy/uvloop-dyno-track | b90e369a12077d390bd74aab833c2c562c5a2567 | [
"MIT"
] | null | null | null | import json
from autobahn.asyncio.websocket import WebSocketClientProtocol
from config import DEBUG, CLIENTS_MSGS_COUNT, CLIENTS_COUNT
class WSClientProtocol(WebSocketClientProtocol):
"""
Websocket client protocol.
"""
def __init__(self):
super(WSClientProtocol, self).__init__()
sel... | 30.183673 | 101 | 0.628803 |
4118ba3248237f77d689cce89823f9a2ceb8203e | 14,573 | py | Python | gooddata-afm-client/gooddata_afm_client/model/positive_attribute_filter_body.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-24T16:27:06.000Z | 2022-02-25T10:18:49.000Z | gooddata-afm-client/gooddata_afm_client/model/positive_attribute_filter_body.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 29 | 2022-01-20T15:45:38.000Z | 2022-03-31T09:39:25.000Z | gooddata-afm-client/gooddata_afm_client/model/positive_attribute_filter_body.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-20T07:11:15.000Z | 2022-03-09T14:50:17.000Z | """
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Contact: support@gooddata.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sy... | 44.429878 | 224 | 0.597818 |
f58abe788f1b99422ac15ef70dee29ebe8050796 | 4,000 | py | Python | library/fourletterphat/__init__.py | yorkrobotlab/fourletter-phat | 3be01beadb96cb4e4db693577f973a3d9a4d401b | [
"MIT"
] | null | null | null | library/fourletterphat/__init__.py | yorkrobotlab/fourletter-phat | 3be01beadb96cb4e4db693577f973a3d9a4d401b | [
"MIT"
] | null | null | null | library/fourletterphat/__init__.py | yorkrobotlab/fourletter-phat | 3be01beadb96cb4e4db693577f973a3d9a4d401b | [
"MIT"
] | null | null | null | import atexit
from sys import exit, version_info
from .i2c_bus import bus
from .alphanum4 import AlphaNum4
from .HT16K33 import *
__version__ = '0.1.0+pipuck'
display = None
_is_setup = False
def _exit():
display.clear()
display.show()
def set_blink(frequency):
"""Blink display at specified frequency... | 23.529412 | 116 | 0.69275 |
85449beff63936635378e2862baab0656bc5b928 | 1,733 | py | Python | code_examples/tensorflow2/cifar10/cifar10_ipu_estimator.py | xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | [
"MIT"
] | null | null | null | code_examples/tensorflow2/cifar10/cifar10_ipu_estimator.py | xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | [
"MIT"
] | null | null | null | code_examples/tensorflow2/cifar10/cifar10_ipu_estimator.py | xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | [
"MIT"
] | null | null | null | # Copyright 2020 Graphcore Ltd.
from functools import partial
import tensorflow as tf
from tensorflow import keras
from tensorflow.python import ipu
from data import CIFAR10_Data
from model import get_model
from utils import parse_params, create_ipu_config
def estimator_model(features, labels, mode):
model = get... | 41.261905 | 113 | 0.753029 |
ad85710107403f11eb0ec4396755ed7d3627ad17 | 2,838 | py | Python | voltdb/tests/test_unit.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | voltdb/tests/test_unit.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | voltdb/tests/test_unit.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
from typing import Optional
import pytest
from datadog_checks.base import ConfigurationError
from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.voltdb.che... | 31.88764 | 106 | 0.637421 |
75e71af955a2d013116fce89446eb6a924023656 | 5,570 | py | Python | src/zen_nas/SearchSpace/search_choice.py | xmyyzy123/zen_nas | 4870eb0a030856bd67afe8529f65af8dc3bd81dc | [
"Apache-2.0"
] | null | null | null | src/zen_nas/SearchSpace/search_choice.py | xmyyzy123/zen_nas | 4870eb0a030856bd67afe8529f65af8dc3bd81dc | [
"Apache-2.0"
] | null | null | null | src/zen_nas/SearchSpace/search_choice.py | xmyyzy123/zen_nas | 4870eb0a030856bd67afe8529f65af8dc3bd81dc | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2021 ZTE corporation. All Rights Reserved.
SPDX-License-Identifier: Apache-2.
generate random network and mutated network
'''
# pylint: disable=global-statement
import os
import sys
import random
import numpy as np
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
try:
impo... | 35.935484 | 105 | 0.698384 |
12abef5e65a59140cbcbd38a144e2339162fb84b | 2,923 | py | Python | evalml/exceptions/exceptions.py | ObinnaObeleagu/evalml | 3b5bf62b08a5a5bc6485ba5387a08c32e1857473 | [
"BSD-3-Clause"
] | 1 | 2021-07-28T14:20:35.000Z | 2021-07-28T14:20:35.000Z | evalml/exceptions/exceptions.py | ObinnaObeleagu/evalml | 3b5bf62b08a5a5bc6485ba5387a08c32e1857473 | [
"BSD-3-Clause"
] | null | null | null | evalml/exceptions/exceptions.py | ObinnaObeleagu/evalml | 3b5bf62b08a5a5bc6485ba5387a08c32e1857473 | [
"BSD-3-Clause"
] | null | null | null | class MethodPropertyNotFoundError(Exception):
"""Exception to raise when a class is does not have an expected method or property."""
pass
class PipelineNotFoundError(Exception):
"""An exception raised when a particular pipeline is not found in automl search results"""
pass
class ObjectiveNotFoundE... | 32.477778 | 136 | 0.720835 |
65a07182766f1d30d5f3022c37087de5dfbc4b16 | 1,808 | py | Python | dydx3/eth_signing/eth_prive_action.py | formula-tech/dydx-v3-python | 95800e3620c2b1f53053b78f35de6e4c43dfdc1a | [
"Apache-2.0"
] | 1 | 2022-01-04T10:35:36.000Z | 2022-01-04T10:35:36.000Z | dydx3/eth_signing/eth_prive_action.py | formula-tech/dydx-v3-python | 95800e3620c2b1f53053b78f35de6e4c43dfdc1a | [
"Apache-2.0"
] | null | null | null | dydx3/eth_signing/eth_prive_action.py | formula-tech/dydx-v3-python | 95800e3620c2b1f53053b78f35de6e4c43dfdc1a | [
"Apache-2.0"
] | 1 | 2022-01-21T10:49:48.000Z | 2022-01-21T10:49:48.000Z | from web3 import Web3
from dydx3.eth_signing import util
from dydx3.eth_signing.sign_off_chain_action import SignOffChainAction
EIP712_ETH_PRIVATE_ACTION_STRUCT_STRING = [
{'type': 'string', 'name': 'method'},
{'type': 'string', 'name': 'requestPath'},
{'type': 'string', 'name': 'body'},
{'type': 'str... | 25.111111 | 70 | 0.555863 |
0267b9d49e2479c35c67a47f9854ad2e41e34d70 | 6,940 | py | Python | extractedDefs/blenderside/export_fbx_bin/fbx_animations.py | makehumancommunity/community-plugins-fbx | 1f78be1723063cee0ae83232587431ab0f2e9894 | [
"MIT"
] | 1 | 2020-04-17T16:32:06.000Z | 2020-04-17T16:32:06.000Z | extractedDefs/blenderside/export_fbx_bin/fbx_animations.py | makehumancommunity/community-plugins-fbx | 1f78be1723063cee0ae83232587431ab0f2e9894 | [
"MIT"
] | null | null | null | extractedDefs/blenderside/export_fbx_bin/fbx_animations.py | makehumancommunity/community-plugins-fbx | 1f78be1723063cee0ae83232587431ab0f2e9894 | [
"MIT"
] | 5 | 2019-06-01T07:04:17.000Z | 2022-02-21T14:14:51.000Z | def fbx_animations(scene_data):
"""
Generate global animation data from objects.
"""
scene = scene_data.scene
animations = []
animated = set()
frame_start = 1e100
frame_end = -1e100
def add_anim(animations, animated, anim):
nonlocal frame_start, frame_end
if anim is ... | 46.266667 | 119 | 0.590346 |
c528d7f386745ec107797605b43239c1471c2022 | 682 | py | Python | day2/code/function.py | liuchunhuicanfly/learning-python | 1f8665ceb34a4c10175fa16cf72c3f6bceefa41a | [
"MIT"
] | 4 | 2019-06-02T05:37:14.000Z | 2019-12-24T04:32:20.000Z | day2/code/function.py | liuchunhuicanfly/learning-python | 1f8665ceb34a4c10175fa16cf72c3f6bceefa41a | [
"MIT"
] | null | null | null | day2/code/function.py | liuchunhuicanfly/learning-python | 1f8665ceb34a4c10175fa16cf72c3f6bceefa41a | [
"MIT"
] | null | null | null | # 定义函数
#def function_name():
# 函数块
#
#
#
# return
# 参数使用默认值
def add(num=2):
total = 0
total += num
return total
# 在参数名前面的*表示args是一个可变参数
# 即在调用add函数时可以传入0个或多个参数
def add(*args):
total = 0
for val in args:
total += val
return total
# 用模块管理函数
'''
Python中每个文件就代表了一个模块(module),
我们... | 11.180328 | 51 | 0.656891 |
cebd8cd9f48a5e0b8097e3b38cb7f56195312a59 | 13,598 | py | Python | src/main/python/rlbot/utils/structures/game_interface.py | ericmburgess/RLBot | a4ce061bae1a773adf60d99f232f2a228de820a2 | [
"MIT"
] | 1 | 2019-08-24T11:53:35.000Z | 2019-08-24T11:53:35.000Z | src/main/python/rlbot/utils/structures/game_interface.py | Acidburn0zzz/RLBot | b6365e0c92183563fb7ff67d4ba81b58a31b1ff5 | [
"MIT"
] | null | null | null | src/main/python/rlbot/utils/structures/game_interface.py | Acidburn0zzz/RLBot | b6365e0c92183563fb7ff67d4ba81b58a31b1ff5 | [
"MIT"
] | null | null | null | import ctypes
import os
import sys
import time
from logging import DEBUG, WARNING
import flatbuffers
from rlbot.messages.flat.MatchSettings import MatchSettings as MatchSettingsPacket
from rlbot.messages.flat.BallPrediction import BallPrediction as BallPredictionPacket
from rlbot.messages.flat.FieldInfo import FieldIn... | 41.457317 | 118 | 0.691866 |
85a728c22e76e6ea054dc33c72a75a1eee52e36a | 8,485 | py | Python | tests/integration/tools/test_range_tool.py | snjypl/bokeh | c2467ee201b4516301f2893bdf7ec2c21b877a9a | [
"BSD-3-Clause"
] | 1 | 2021-06-03T13:13:21.000Z | 2021-06-03T13:13:21.000Z | tests/integration/tools/test_range_tool.py | snjypl/bokeh | c2467ee201b4516301f2893bdf7ec2c21b877a9a | [
"BSD-3-Clause"
] | null | null | null | tests/integration/tools/test_range_tool.py | snjypl/bokeh | c2467ee201b4516301f2893bdf7ec2c21b877a9a | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 28.096026 | 99 | 0.585504 |
e444234491b8a82f9fd50efc1bff58c97bec62ac | 2,767 | py | Python | deps/lib/python3.4/site-packages/netdisco/daikin.py | Haynie-Research-and-Development/jarvis | 062f20303b3e1d46a20a68e8ed8337b3d05f84dd | [
"Apache-2.0"
] | 78 | 2017-08-19T03:46:13.000Z | 2020-02-19T04:29:45.000Z | deps/lib/python3.4/site-packages/netdisco/daikin.py | Haynie-Research-and-Development/jarvis | 062f20303b3e1d46a20a68e8ed8337b3d05f84dd | [
"Apache-2.0"
] | 5 | 2017-08-21T16:33:08.000Z | 2018-06-21T18:37:18.000Z | deps/lib/python3.4/site-packages/netdisco/daikin.py | Haynie-Research-and-Development/jarvis | 062f20303b3e1d46a20a68e8ed8337b3d05f84dd | [
"Apache-2.0"
] | 13 | 2017-08-19T16:46:08.000Z | 2018-11-05T23:11:34.000Z | """Daikin device discovery."""
import socket
# pylint: disable=unused-import, import-error, no-name-in-module
try:
# Py2
from urlparse import unquote # noqa
except ImportError:
# Py3
from urllib.parse import unquote # noqa
from datetime import timedelta
DISCOVERY_MSG = b"DAIKIN_UDP/common/basic_inf... | 26.864078 | 76 | 0.509216 |
6236e0a4822d4a57c59e29813404d95fb831cc3f | 8,792 | py | Python | cade/explain_by_distance.py | whyisyoung/CADE | 22e9029b84a9fa50a9627f9b8bda8e6bbef7fc79 | [
"BSD-3-Clause"
] | 68 | 2020-10-16T19:10:06.000Z | 2022-03-25T08:03:52.000Z | cade/explain_by_distance.py | whyisyoung/CADE | 22e9029b84a9fa50a9627f9b8bda8e6bbef7fc79 | [
"BSD-3-Clause"
] | 2 | 2021-07-25T01:45:30.000Z | 2021-09-29T07:52:26.000Z | cade/explain_by_distance.py | whyisyoung/CADE | 22e9029b84a9fa50a9627f9b8bda8e6bbef7fc79 | [
"BSD-3-Clause"
] | 20 | 2020-11-18T12:53:48.000Z | 2022-02-24T18:47:38.000Z | """
explain_by_distance.py
~~~~~~~
Functions for explaining why a sample is an drift (distance-based).
Perturb the testing set drift sample to be closer to the centroid of its closest family.
If flipping a feature can make the drift sample be closer to the centroid, then we think it's important.
In this case, we can't... | 41.866667 | 143 | 0.619768 |
a278f585da1bd7864b96174f7822ba86a6e43c05 | 1,244 | py | Python | intro-to-threading/prodcom_better_queue.py | TheTwoCentsRespository/materials | ebb5eefb2ac86dadff5f99856cc1542858e4dcfd | [
"MIT"
] | 4 | 2019-04-13T23:52:51.000Z | 2021-05-10T18:16:10.000Z | intro-to-threading/prodcom_better_queue.py | TheTwoCentsRespository/materials | ebb5eefb2ac86dadff5f99856cc1542858e4dcfd | [
"MIT"
] | 12 | 2021-05-01T05:26:04.000Z | 2022-02-01T23:01:10.000Z | intro-to-threading/prodcom_better_queue.py | Greentash/materials | c18a5b4384fcea51b7138871b6567e17bf706720 | [
"MIT"
] | 5 | 2021-08-09T04:20:23.000Z | 2022-03-11T06:18:48.000Z | #!/usr/bin/env python3
import concurrent.futures
import logging
import queue
import random
import threading
import time
def producer(queue, event):
"""Pretend we're getting a number from the network."""
while not event.is_set():
message = random.randint(1, 101)
logging.info("Producer got messa... | 28.272727 | 78 | 0.659968 |
bd87ced823a9024d10abdeda183a46bdcb6a2d26 | 1,585 | py | Python | MQTT/MQTT_connectPub.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | 12 | 2015-03-03T18:32:03.000Z | 2021-03-13T18:50:37.000Z | MQTT/MQTT_connectPub.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | null | null | null | MQTT/MQTT_connectPub.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | 7 | 2017-01-20T20:31:54.000Z | 2021-12-28T16:52:48.000Z | #! /usr/bin/env python
##########################################################################################
# MQTT_connectPUB.py
#
# Basic MQTT topic publication via persistant client connection
# This is *WAY* faster than repeated single publications
#
#
# Created: 01/19/15
# - Joshua Vaughan
# - joshua.vau... | 23.308824 | 90 | 0.613249 |
0e910ed89586076205de41d748d49858cb4b9c0c | 655 | py | Python | FC/model.py | kun-1010/1 | c7f251bd254c29e3cb53bb915e69f4e00f00cb30 | [
"MulanPSL-1.0"
] | null | null | null | FC/model.py | kun-1010/1 | c7f251bd254c29e3cb53bb915e69f4e00f00cb30 | [
"MulanPSL-1.0"
] | null | null | null | FC/model.py | kun-1010/1 | c7f251bd254c29e3cb53bb915e69f4e00f00cb30 | [
"MulanPSL-1.0"
] | null | null | null | import torch
# 定义网络结构
class FC(torch.nn.Module):
def __init__(self):
super(FC, self).__init__()
self.l1 = torch.nn.Linear(784, 512)
self.l2 = torch.nn.Linear(512, 256)
self.l3 = torch.nn.Linear(256, 128)
self.l4 = torch.nn.Linear(128, 64)
self.l5 = torch.nn.Linear(6... | 20.46875 | 43 | 0.494656 |
5ccdda389df3723602d93a8ee43208eb6dde9c1e | 125 | py | Python | eyed/db/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | null | null | null | eyed/db/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | 55 | 2017-12-21T15:20:36.000Z | 2019-01-20T02:49:41.000Z | eyed/db/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | 3 | 2018-05-18T09:02:36.000Z | 2019-12-29T10:27:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from db import SessionFactory, Engine
__all__ = [
SessionFactory,
Engine
]
| 12.5 | 37 | 0.672 |
a38cc905e8d343ed34ca82f32d6ffe36bea3f216 | 5,417 | py | Python | secret_santa.py | jasecode/jas_python | 06f73053153646da69973e6e342ea8022cc39abf | [
"MIT"
] | 1 | 2021-11-24T10:09:34.000Z | 2021-11-24T10:09:34.000Z | secret_santa.py | jasecode/secret-santa-python | 06f73053153646da69973e6e342ea8022cc39abf | [
"MIT"
] | null | null | null | secret_santa.py | jasecode/secret-santa-python | 06f73053153646da69973e6e342ea8022cc39abf | [
"MIT"
] | null | null | null | import yaml
# sudo pip install pyyaml
import re
import random
import smtplib
import datetime
import pytz
import time
import socket
import sys
import getopt
import os
help_message = '''
To use, fill out config.yml with your own participants. You can also specify
DONT-PAIR so that people don't get assigned their signif... | 28.661376 | 98 | 0.54772 |
75de1b1f85d2966f4264da6c45c5c1b3f3469f88 | 1,901 | py | Python | _archive/playground/algorithm/smart/DRL.py | myxie/topsim | 0d2ebe918f214903760fbf044a4875d470dda688 | [
"MIT"
] | null | null | null | _archive/playground/algorithm/smart/DRL.py | myxie/topsim | 0d2ebe918f214903760fbf044a4875d470dda688 | [
"MIT"
] | 7 | 2019-11-11T07:52:29.000Z | 2020-10-21T05:31:59.000Z | _archive/playground/algorithm/smart/DRL.py | myxie/topsim | 0d2ebe918f214903760fbf044a4875d470dda688 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
tf.enable_eager_execution()
class Node(object):
def __init__(self, observation, action, reward, clock):
self.observation = observation
self.action = action
self.reward = reward
self.clock = clock
class RLAlgorithm(object):
def __ini... | 36.557692 | 100 | 0.660705 |
65bdcb53fc741c67f248d17880dfc4f78f5285ed | 1,990 | py | Python | rbnfrbnf/passes/graph_ir2.py | thautwarm/rbnfrbnf | fc20fb9197a553b02cb447d034e24879cb7af354 | [
"MIT"
] | 4 | 2018-10-26T09:05:39.000Z | 2018-11-09T02:57:37.000Z | rbnfrbnf/passes/graph_ir2.py | thautwarm/rbnfrbnf | fc20fb9197a553b02cb447d034e24879cb7af354 | [
"MIT"
] | null | null | null | rbnfrbnf/passes/graph_ir2.py | thautwarm/rbnfrbnf | fc20fb9197a553b02cb447d034e24879cb7af354 | [
"MIT"
] | null | null | null | from rbnfrbnf.passes.ir_constructs import *
from singledispatch import singledispatch
from typing import Dict
class ContextForIR2:
def __init__(self, imp: Dict[str, Identified], state=None):
self.imp = imp
self.recur = state or {None}
self.resume = [lambda: None]
self.perform = [l... | 24.567901 | 70 | 0.630151 |
747c76062a8fe007af8d30d35e2d4971e9d49ce0 | 2,346 | py | Python | test_chatty/test_sessions/test_email.py | hosford42/Chatty | e69bd922038367968d46fbef6f2fa5218d19e3d4 | [
"MIT"
] | null | null | null | test_chatty/test_sessions/test_email.py | hosford42/Chatty | e69bd922038367968d46fbef6f2fa5218d19e3d4 | [
"MIT"
] | null | null | null | test_chatty/test_sessions/test_email.py | hosford42/Chatty | e69bd922038367968d46fbef6f2fa5218d19e3d4 | [
"MIT"
] | 1 | 2022-01-08T19:50:38.000Z | 2022-01-08T19:50:38.000Z | import datetime
import imaplib
import smtplib
import time
import unittest
from typing import Tuple
from chatty.sessions.email import EmailSession, SMTPFactory, IMAPFactory
from chatty.sessions.interface import Session
from chatty.signals.delivery_failure import DeliveryFailure
from chatty.signals.message import Messag... | 36.65625 | 117 | 0.70162 |
103bc86ce7337b79056880128d574c35fbf017ef | 516 | py | Python | homepage/users/models.py | ephes/homepage | 9628d594683dfe2b1f0b03b9fd2aee0fa7e426d7 | [
"MIT"
] | 2 | 2018-10-20T17:43:26.000Z | 2018-11-19T10:16:16.000Z | homepage/users/models.py | ephes/homepage | 9628d594683dfe2b1f0b03b9fd2aee0fa7e426d7 | [
"MIT"
] | 4 | 2019-12-04T21:42:39.000Z | 2020-06-15T14:08:55.000Z | homepage/users/models.py | ephes/homepage | 9628d594683dfe2b1f0b03b9fd2aee0fa7e426d7 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.urls import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
# First Name and Last Name do not cover name patterns
# around the globe.
name = models.CharField(_("Name of U... | 28.666667 | 74 | 0.732558 |
086787aee643a4020dac74ac3565b899e5ccf850 | 10,557 | py | Python | PCSoft/CanSniffer.py | BDeliers/CANSniffer | a055035ef60a4caad78f35968ee196d7e2e868df | [
"Apache-2.0"
] | null | null | null | PCSoft/CanSniffer.py | BDeliers/CANSniffer | a055035ef60a4caad78f35968ee196d7e2e868df | [
"Apache-2.0"
] | null | null | null | PCSoft/CanSniffer.py | BDeliers/CANSniffer | a055035ef60a4caad78f35968ee196d7e2e868df | [
"Apache-2.0"
] | null | null | null | """
Simple script to receive data from the MCP2515 CAN bus module, over USART
Here is used to make a bus sniffer over a PIC18F2550
Frames are interpreted for a Peugeot 207 year 2011 car
BDeliers - 02/2021
"""
# -*- coding: UTF-8 -*-
# Imports
import serial
import signal
import sys
imp... | 31.798193 | 127 | 0.503836 |
e1f21c9c79cde18305a3b1d70fef15313cbffc14 | 6,485 | py | Python | async_upnp_client/aiohttp.py | romaincolombo/async_upnp_client | 5e8ecde9f363fbcd25a0ec69902bdcf2f8ceb550 | [
"Apache-2.0"
] | null | null | null | async_upnp_client/aiohttp.py | romaincolombo/async_upnp_client | 5e8ecde9f363fbcd25a0ec69902bdcf2f8ceb550 | [
"Apache-2.0"
] | null | null | null | async_upnp_client/aiohttp.py | romaincolombo/async_upnp_client | 5e8ecde9f363fbcd25a0ec69902bdcf2f8ceb550 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""aiohttp requester module."""
import asyncio
from asyncio.events import AbstractEventLoop
from asyncio.events import AbstractServer # noqa: F401
import logging
import socket
from typing import Any, Mapping, Optional, Tuple, Union # noqa: F401
import aiohttp
import aiohttp.web
import async_... | 36.22905 | 98 | 0.567772 |
6603e8ea1b8562316374e3881064658f6bec7d07 | 30,082 | py | Python | rnn/train.py | lorraine2/implicit-hyper-opt | 7e8ccadd2a1b66ff4814301b3cf091c448214182 | [
"MIT"
] | 28 | 2020-06-16T19:35:25.000Z | 2022-03-10T07:42:25.000Z | rnn/train.py | lorraine2/implicit-hyper-opt | 7e8ccadd2a1b66ff4814301b3cf091c448214182 | [
"MIT"
] | 11 | 2020-12-01T05:37:56.000Z | 2022-02-21T07:37:45.000Z | rnn/train.py | ThrunGroup/implicit-hyper-opt | fe4ac539c947ca8083049d23c5f1f67f44cd09f0 | [
"MIT"
] | 8 | 2020-10-31T15:57:08.000Z | 2022-02-23T11:25:59.000Z | """python train.py --tune=wdecay --wdecay_type=per_param --wdecay=1e-6
python train.py --wdecay=1e-9 --optimizer=sgd --lr=30 --clip=0.25 --emsize=650 --nhid=650 --nlayers=2 --dropouto=0.7 --use_nonmono_decay
"""
import os
import sys
import csv
import ipdb
import time
import math
import hashlib
import datetime
import a... | 43.159254 | 200 | 0.630344 |
c142a350830cd6eea930657dada81a37c69d1aff | 1,035 | py | Python | House_Robber_II_v2.py | xiekc/leetcode | 56dc65850ac68752f7c6f50f8b35eb23bfafed93 | [
"MIT"
] | null | null | null | House_Robber_II_v2.py | xiekc/leetcode | 56dc65850ac68752f7c6f50f8b35eb23bfafed93 | [
"MIT"
] | null | null | null | House_Robber_II_v2.py | xiekc/leetcode | 56dc65850ac68752f7c6f50f8b35eb23bfafed93 | [
"MIT"
] | null | null | null | from typing import List
# All houses at this place are arranged in a circle.
# Meanwhile, adjacent houses have security system connected and it will
# automatically contact the police if two adjacent houses were broken into on the same night.
# https://leetcode.com/problems/house-robber-ii/discuss/59934/Simple-AC-solu... | 36.964286 | 113 | 0.615459 |
010bd204ec0a7b39e6b2988402945998e36bb1cf | 2,620 | py | Python | sdk/python/pulumi_azure_nextgen/eventgrid/v20170615preview/list_topic_shared_access_keys.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/eventgrid/v20170615preview/list_topic_shared_access_keys.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/eventgrid/v20170615preview/list_topic_shared_access_keys.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 33.589744 | 169 | 0.669084 |
102ee86ba220f94e2dd94a08975a724ab5f0c2c2 | 220 | py | Python | AtC_Beg_Con_041-050/ABC043/C.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | AtC_Beg_Con_041-050/ABC043/C.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | AtC_Beg_Con_041-050/ABC043/C.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | n = int(input())
a = input().split()
a = [int(m) for m in a]
ans = float("INF")
for i in range(-100, 101):
tmp = 0
for j in range(n):
tmp += (a[j] - i) ** 2
if ans > tmp:
ans = tmp
print(ans) | 18.333333 | 30 | 0.477273 |
9d6e1f17d95ddadb4389ad7ba94319f0dc58bd45 | 5,872 | py | Python | src/runtime_src/tools/xclbinutil/unittests/SmartNic/SectionSmartNicSyntax.py | bryanloz-xilinx/XRT | 8de6bc04f7060c8272cbb7857531335f1aa31099 | [
"Apache-2.0"
] | null | null | null | src/runtime_src/tools/xclbinutil/unittests/SmartNic/SectionSmartNicSyntax.py | bryanloz-xilinx/XRT | 8de6bc04f7060c8272cbb7857531335f1aa31099 | [
"Apache-2.0"
] | null | null | null | src/runtime_src/tools/xclbinutil/unittests/SmartNic/SectionSmartNicSyntax.py | bryanloz-xilinx/XRT | 8de6bc04f7060c8272cbb7857531335f1aa31099 | [
"Apache-2.0"
] | null | null | null | from argparse import RawDescriptionHelpFormatter
import argparse
import filecmp
import json
import os
import subprocess
# Start of our unit test
# -- main() -------------------------------------------------------------------
#
# The entry point to this script.
#
# Note: It is called at the end of this script so that t... | 35.161677 | 191 | 0.61342 |
0f7b7cebacf84860367675ebc528403cc64c92da | 852 | py | Python | factorial.py | SharonNicG/52167Assessments | 4b9409f2fc28a23a86dcdb31ab10286e72043072 | [
"Apache-2.0"
] | null | null | null | factorial.py | SharonNicG/52167Assessments | 4b9409f2fc28a23a86dcdb31ab10286e72043072 | [
"Apache-2.0"
] | null | null | null | factorial.py | SharonNicG/52167Assessments | 4b9409f2fc28a23a86dcdb31ab10286e72043072 | [
"Apache-2.0"
] | null | null | null | # Sharon Gibbons, 06-04-2018
# Factorial function
# https://en.wikipedia.org/wiki/Factorial
# Python function that finds the factorial of a single input/argument.
# defines function
def factorial(x):
"""This function returns the factorial of a single input/argument."""
# check if input value is negative or p... | 28.4 | 73 | 0.670188 |
a448b787d0594ae43fbe7b997097416c0a667ad4 | 5,246 | py | Python | app/notify.py | odhinn178/rpi-notify | ebdf4b71a8cee693db5a9ec8d9ccadbe5ed75f90 | [
"MIT"
] | null | null | null | app/notify.py | odhinn178/rpi-notify | ebdf4b71a8cee693db5a9ec8d9ccadbe5ed75f90 | [
"MIT"
] | null | null | null | app/notify.py | odhinn178/rpi-notify | ebdf4b71a8cee693db5a9ec8d9ccadbe5ed75f90 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import paho.mqtt.client as paho
import os
import logging
import ssl
import json
import datetime
import uuid
LOG = logging.getLogger(__name__)
class RPiNotify(object):
"""
This class implements the MQTT and AWS IoT interface for the Raspberry Pi Notify
project.
"""
def __init__(s... | 34.741722 | 109 | 0.620854 |
8d7060253966978a4ab93a069a77c8058f45da2b | 1,057 | py | Python | app/forms/song_upload_form.py | alex-pezzati/sonic-fog | ccbfeb0b9d4c1ed9688eb2e9b79090a6855d7310 | [
"PostgreSQL",
"Unlicense"
] | 3 | 2021-03-17T01:49:42.000Z | 2021-03-23T03:05:23.000Z | app/forms/song_upload_form.py | alex-pezzati/Sound_Cloud | ccbfeb0b9d4c1ed9688eb2e9b79090a6855d7310 | [
"PostgreSQL",
"Unlicense"
] | 40 | 2021-03-18T21:47:21.000Z | 2021-03-26T16:45:25.000Z | app/forms/song_upload_form.py | alex-pezzati/sonic-fog | ccbfeb0b9d4c1ed9688eb2e9b79090a6855d7310 | [
"PostgreSQL",
"Unlicense"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms.validators import DataRequired, ValidationError
from app.utils.s3_songs import (allowed_file as allowed_song)
from app.utils.s3_helpers import (allowed_file as allowed_photo)
d... | 40.653846 | 122 | 0.756859 |
e5ff06ed612e7df8adca8f4901334a8c202da1a7 | 896 | py | Python | receive.py | Conr86/esp32-cam-80211-tx | 58e7888c4e2d0b680a031f56be99c3d5ae0c43d4 | [
"MIT"
] | 3 | 2020-11-03T05:26:52.000Z | 2022-02-18T18:38:36.000Z | receive.py | Conr86/esp32-cam-80211-tx | 58e7888c4e2d0b680a031f56be99c3d5ae0c43d4 | [
"MIT"
] | null | null | null | receive.py | Conr86/esp32-cam-80211-tx | 58e7888c4e2d0b680a031f56be99c3d5ae0c43d4 | [
"MIT"
] | 1 | 2022-01-26T02:37:16.000Z | 2022-01-26T02:37:16.000Z | #!/usr/bin/python
from scapy.all import *
last_image = b''
data = {}
def PacketHandler(pkt):
global data
if (pkt.addr2 == "b0:0b:b0:0b:b0:0b"):
sn = pkt.SC // 16
total = raw(pkt)[347]
uid = raw(pkt)[348]
print("Snapshot", uid, "Packet", sn, "of", total)
if uid not in... | 24.888889 | 58 | 0.445313 |
93e34dd087976b03c5201d699cf4e123f0c2689b | 6,201 | py | Python | contrib/devtools/symbol-check.py | Arinerron/jobecoin | d6c966cf94c44061c157da77def3e15ecb866a2b | [
"MIT"
] | 1 | 2018-05-01T21:37:53.000Z | 2018-05-01T21:37:53.000Z | contrib/devtools/symbol-check.py | Arinerron/jobecoin | d6c966cf94c44061c157da77def3e15ecb866a2b | [
"MIT"
] | null | null | null | contrib/devtools/symbol-check.py | Arinerron/jobecoin | d6c966cf94c44061c157da77def3e15ecb866a2b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc++... | 37.581818 | 142 | 0.65312 |
b43d87976c352414bf4ec28bdeef559c3cc50fa0 | 183 | py | Python | setup.py | fyhuang/archive_box | 1cbbd839012fed5e12341b78027d132c72dd01df | [
"BSD-3-Clause"
] | null | null | null | setup.py | fyhuang/archive_box | 1cbbd839012fed5e12341b78027d132c72dd01df | [
"BSD-3-Clause"
] | null | null | null | setup.py | fyhuang/archive_box | 1cbbd839012fed5e12341b78027d132c72dd01df | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from setuptools import setup, find_namespace_packages
setup(
name="archive_box",
version="0.1",
packages=find_namespace_packages(),
)
| 18.3 | 53 | 0.677596 |
6bccd192fd93cd029c26f57fe329d3a72c1de450 | 2,752 | py | Python | hsds/get_s3json.py | murlock/hsds | 9f5fc3cdb64017d07e34eb422eee5398553d213c | [
"Apache-2.0"
] | null | null | null | hsds/get_s3json.py | murlock/hsds | 9f5fc3cdb64017d07e34eb422eee5398553d213c | [
"Apache-2.0"
] | null | null | null | hsds/get_s3json.py | murlock/hsds | 9f5fc3cdb64017d07e34eb422eee5398553d213c | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# Th... | 35.282051 | 152 | 0.5625 |
aa8396b66c65ad271a9bf764184685390878a3b7 | 333 | py | Python | nqslearn/hamiltonian.py | OminiaVincit/neural-quantum-states | 4058a120b95ea6fba64e43882b8c17cdaa8aacb3 | [
"MIT"
] | 22 | 2018-02-13T08:29:07.000Z | 2021-12-29T18:55:55.000Z | nqslearn/hamiltonian.py | sahmed95/neural-quantum-states | 4058a120b95ea6fba64e43882b8c17cdaa8aacb3 | [
"MIT"
] | null | null | null | nqslearn/hamiltonian.py | sahmed95/neural-quantum-states | 4058a120b95ea6fba64e43882b8c17cdaa8aacb3 | [
"MIT"
] | 14 | 2018-04-03T08:29:27.000Z | 2022-01-25T14:21:28.000Z | class Hamiltonian(object):
"""
Will eventually allow for more general implementations of Hamiltonians
"""
def __init__(self):
super(Hamiltonian, self).__init__()
# state is a list of integers, each corresponding to a separate quantum
# number
def find_matrix_elements(self, state):
... | 25.615385 | 75 | 0.678679 |
890abc7209a99bfd99ac9a2bc9d17ff938ce37d2 | 167 | py | Python | my_flask_app.py | LorenzoDiStefano/TicTacToeFlaskApp | 2cc4a7ee167e6757917c11862f98af9180cf4bfd | [
"MIT"
] | null | null | null | my_flask_app.py | LorenzoDiStefano/TicTacToeFlaskApp | 2cc4a7ee167e6757917c11862f98af9180cf4bfd | [
"MIT"
] | null | null | null | my_flask_app.py | LorenzoDiStefano/TicTacToeFlaskApp | 2cc4a7ee167e6757917c11862f98af9180cf4bfd | [
"MIT"
] | null | null | null | from tic_tac_toe_app import app, db
from tic_tac_toe_app.models import User
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'User': User} | 27.833333 | 39 | 0.778443 |
46a4672645c35eb6b1e2c37ac81d9fc25a8b824b | 1,434 | py | Python | python/web-scraping-monitorar-preco.py | felippedesouza/scripts-automacoes | a3a252c4ab1d3795b277c24610125409b0b42691 | [
"MIT"
] | null | null | null | python/web-scraping-monitorar-preco.py | felippedesouza/scripts-automacoes | a3a252c4ab1d3795b277c24610125409b0b42691 | [
"MIT"
] | null | null | null | python/web-scraping-monitorar-preco.py | felippedesouza/scripts-automacoes | a3a252c4ab1d3795b277c24610125409b0b42691 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import smtplib
import credenciais
import babel.numbers
import unicodedata
url = "https://www.pichau.com.br/hardware/processadores/amd/processador-amd-ryzen-5-3600-hexa-core-3-6ghz-4-2ghz-turbo-35mb-cache-am4-yd3600bbafbox"
# my user agent
headers = { "User-Agent": "Mozill... | 34.142857 | 148 | 0.746165 |
df72bf02e39ddcb9fab0f1c2aebb28e631de6c43 | 4,508 | py | Python | external/fv3fit/fv3fit/keras/_models/shared/training_loop.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | 1 | 2021-12-14T23:43:35.000Z | 2021-12-14T23:43:35.000Z | external/fv3fit/fv3fit/keras/_models/shared/training_loop.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | 195 | 2021-09-16T05:47:18.000Z | 2022-03-31T22:03:15.000Z | external/fv3fit/fv3fit/keras/_models/shared/training_loop.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | null | null | null | import tensorflow as tf
from typing import Iterable, Optional, Sequence, Tuple
import dataclasses
import logging
logger = logging.getLogger(__name__)
@dataclasses.dataclass
class Logs:
loss: float
val_loss: Optional[float]
# this could be extended in the future to contain more metrics, or
# a Mapping... | 32.666667 | 81 | 0.614241 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.