hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0cb0cf4f34b6c5d261619a4a08720cc3f9b623 | 25,846 | py | Python | tests/rest/client/utils.py | AndrewRyanChama/synapse | 4da66526e88bdb5b540f821acd83e3302f37dd0c | [
"Apache-2.0"
] | null | null | null | tests/rest/client/utils.py | AndrewRyanChama/synapse | 4da66526e88bdb5b540f821acd83e3302f37dd0c | [
"Apache-2.0"
] | null | null | null | tests/rest/client/utils.py | AndrewRyanChama/synapse | 4da66526e88bdb5b540f821acd83e3302f37dd0c | [
"Apache-2.0"
] | 1 | 2022-03-11T14:26:39.000Z | 2022-03-11T14:26:39.000Z | # Copyright 2014-2016 OpenMarket Ltd
# Copyright 2017 Vector Creations Ltd
# Copyright 2018-2019 New Vector Ltd
# Copyright 2019-2021 The Matrix.org Foundation C.I.C.
#
# 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... | 33.741514 | 92 | 0.582334 |
import json
import re
import time
import urllib.parse
from typing import (
Any,
AnyStr,
Dict,
Iterable,
Mapping,
MutableMapping,
Optional,
Tuple,
overload,
)
from unittest.mock import patch
from urllib.parse import urlencode
import attr
from typing_extensions import Literal
from t... | true | true |
1c0cb16448ff01377f043a444c5a6c3c7e8f2822 | 4,696 | py | Python | generate_tfrecord.py | technetbytes/CNIC | 51b7f92d6e77509167b86643ee8fef44d39e193c | [
"Apache-2.0"
] | null | null | null | generate_tfrecord.py | technetbytes/CNIC | 51b7f92d6e77509167b86643ee8fef44d39e193c | [
"Apache-2.0"
] | null | null | null | generate_tfrecord.py | technetbytes/CNIC | 51b7f92d6e77509167b86643ee8fef44d39e193c | [
"Apache-2.0"
] | null | null | null | """
Usage:
# Create train data:
python generate_tfrecord.py --label=<LABEL> --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/train_labels.csv --output_path=<PATH_TO_ANNOTATIONS_FOLDER>/train.record
# Create test data:
python generate_tfrecord.py --label=<LABEL> --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/test_labels.csv --out... | 33.784173 | 158 | 0.678024 |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import io
import pandas as pd
import tensorflow.compat.v1 as tf
import sys
sys.path.append("../../models/research")
from PIL import Image
from object_detection.utils import dataset_util
from collect... | true | true |
1c0cb24786c831235fe1e9c08dba66adc7703d03 | 627 | py | Python | GEOS_Util/coupled_diagnostics/verification/lwmask/__init__.py | GEOS-ESM/GMAO_Shared | 022af23abbc7883891006b57379be96d9a50df23 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-02-01T17:36:53.000Z | 2020-02-01T17:36:53.000Z | GEOS_Util/coupled_diagnostics/verification/lwmask/__init__.py | GEOS-ESM/GMAO_Shared | 022af23abbc7883891006b57379be96d9a50df23 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 105 | 2019-07-08T19:27:23.000Z | 2022-03-22T02:12:16.000Z | GEOS_Util/coupled_diagnostics/verification/lwmask/__init__.py | GEOS-ESM/GMAO_Shared | 022af23abbc7883891006b57379be96d9a50df23 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 10 | 2019-07-05T18:00:44.000Z | 2022-03-11T16:26:29.000Z | import scipy as sp
from datetime import date
import scipy as sp
from g5lib import dset
__all__=['mask']
class Ctl(dset.GADset):
def __init__(self):
name='lwmask'
undef=1e15
dir='/discover/nobackup/projects/gmao/share/dao_ops/verification/lwmask'
flist=[dir+'/lwmask1440721.data']
... | 27.26087 | 83 | 0.629984 | import scipy as sp
from datetime import date
import scipy as sp
from g5lib import dset
__all__=['mask']
class Ctl(dset.GADset):
def __init__(self):
name='lwmask'
undef=1e15
dir='/discover/nobackup/projects/gmao/share/dao_ops/verification/lwmask'
flist=[dir+'/lwmask1440721.data']
... | true | true |
1c0cb37293e0f8ce3ddf459d7787aa21af3c4462 | 479 | py | Python | config.py | BrianNgeno/code_chef | db751c57a8febcbb45efbfd72aac97ce1a7a44cf | [
"MIT"
] | null | null | null | config.py | BrianNgeno/code_chef | db751c57a8febcbb45efbfd72aac97ce1a7a44cf | [
"MIT"
] | null | null | null | config.py | BrianNgeno/code_chef | db751c57a8febcbb45efbfd72aac97ce1a7a44cf | [
"MIT"
] | 2 | 2018-09-18T07:09:35.000Z | 2018-09-18T07:11:32.000Z | import os
class Config():
'''
parent class config
'''
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://<username>:<password>@localhost/codechef'
@staticmethod
def init_app(app):
pass
class ProdConfig(Config):
pass
class DevConfig(Confi... | 17.740741 | 94 | 0.665971 | import os
class Config():
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://<username>:<password>@localhost/codechef'
@staticmethod
def init_app(app):
pass
class ProdConfig(Config):
pass
class DevConfig(Config):
DEBUG = True
class TestConfig(... | true | true |
1c0cb41326a46bf497e4e202b368457518deb26c | 595 | py | Python | _Projects/flask_projects/todo_app/test.py | vincepogz/CUNY2X-TTP-Notes | 8579c7457ef315c4465520b3f2ddb04b0a6ddaf7 | [
"MIT"
] | null | null | null | _Projects/flask_projects/todo_app/test.py | vincepogz/CUNY2X-TTP-Notes | 8579c7457ef315c4465520b3f2ddb04b0a6ddaf7 | [
"MIT"
] | null | null | null | _Projects/flask_projects/todo_app/test.py | vincepogz/CUNY2X-TTP-Notes | 8579c7457ef315c4465520b3f2ddb04b0a6ddaf7 | [
"MIT"
] | 1 | 2022-01-29T21:39:03.000Z | 2022-01-29T21:39:03.000Z | from app import app
def test1():
"""
This function test that the flask application has a
correct response code when the application goes live
"""
response = app.test_client().get("/")
assert response.status_code == 200
def test2():
"""A dummy docstring"""
response = app.test_cl... | 23.8 | 57 | 0.636975 | from app import app
def test1():
response = app.test_client().get("/")
assert response.status_code == 200
def test2():
response = app.test_client().get("/edit")
assert response.status_code == 200
def test3():
response = app.test_client().get("/edit")
assert b"To Do App" in response... | true | true |
1c0cb4f9f3545b9e9d422b2e463e9120569444d5 | 4,826 | py | Python | tests/mock_iam.py | kaiboma/hammer | 674028a067cad91ce1a84577d30afe7b895f2a6a | [
"Apache-2.0"
] | 385 | 2018-07-19T17:19:11.000Z | 2022-03-29T06:54:30.000Z | tests/mock_iam.py | kaiboma/hammer | 674028a067cad91ce1a84577d30afe7b895f2a6a | [
"Apache-2.0"
] | 33 | 2018-07-31T21:05:06.000Z | 2022-02-26T04:04:07.000Z | tests/mock_iam.py | kaiboma/hammer | 674028a067cad91ce1a84577d30afe7b895f2a6a | [
"Apache-2.0"
] | 62 | 2018-07-19T17:19:50.000Z | 2022-03-11T15:06:16.000Z | import boto3
import moto
import logging
from moto import mock_iam
from moto.iam.models import iam_backend
from moto.iam.exceptions import IAMNotFoundException
from datetime import datetime
from library.utility import jsonDumps
def find_key_prop(users, key, prop, default):
for test_key in users[key.user.id]["Keys... | 36.285714 | 103 | 0.662246 | import boto3
import moto
import logging
from moto import mock_iam
from moto.iam.models import iam_backend
from moto.iam.exceptions import IAMNotFoundException
from datetime import datetime
from library.utility import jsonDumps
def find_key_prop(users, key, prop, default):
for test_key in users[key.user.id]["Keys... | true | true |
1c0cb51a3c1acc5ad2326b90865565378752f640 | 7,615 | py | Python | test/test_utils/security.py | Yixiao99/deep-learning-containers | 01f078adf5abfb92e802b326511981bdd4a8c85c | [
"Apache-2.0"
] | 383 | 2020-05-19T18:09:10.000Z | 2022-03-29T22:41:05.000Z | test/test_utils/security.py | Yixiao99/deep-learning-containers | 01f078adf5abfb92e802b326511981bdd4a8c85c | [
"Apache-2.0"
] | 551 | 2020-05-27T17:25:50.000Z | 2022-03-31T18:00:35.000Z | test/test_utils/security.py | Yixiao99/deep-learning-containers | 01f078adf5abfb92e802b326511981bdd4a8c85c | [
"Apache-2.0"
] | 263 | 2020-05-19T18:17:12.000Z | 2022-03-29T22:41:10.000Z | import json
from enum import IntEnum
from test import test_utils
class ECRScanFailureException(Exception):
"""
Base class for other exceptions
"""
pass
class CVESeverity(IntEnum):
UNDEFINED = 0
INFORMATIONAL = 1
LOW = 2
MEDIUM = 3
HIGH = 4
CRITICAL = 5
class ScanVulnerab... | 40.078947 | 120 | 0.681287 | import json
from enum import IntEnum
from test import test_utils
class ECRScanFailureException(Exception):
pass
class CVESeverity(IntEnum):
UNDEFINED = 0
INFORMATIONAL = 1
LOW = 2
MEDIUM = 3
HIGH = 4
CRITICAL = 5
class ScanVulnerabilityList:
def __init__(self, minimum_severity=... | true | true |
1c0cb5aa4f3131115632087cc2cf8e02bb78afd1 | 9,506 | py | Python | pysindy/feature_library/polynomial_library.py | zy-song/pysindy | a5443a59c8c7857f8fde3b9fd345ebd0a7c49555 | [
"MIT"
] | 1 | 2020-11-17T10:50:51.000Z | 2020-11-17T10:50:51.000Z | pysindy/feature_library/polynomial_library.py | jzjosuerivera71/pysindy-1 | 6ed02140c3e255c8bb69b19a7d9452930bd3253d | [
"MIT"
] | null | null | null | pysindy/feature_library/polynomial_library.py | jzjosuerivera71/pysindy-1 | 6ed02140c3e255c8bb69b19a7d9452930bd3253d | [
"MIT"
] | null | null | null | from itertools import chain
from itertools import combinations
from itertools import combinations_with_replacement as combinations_w_r
import numpy as np
from scipy import sparse
from sklearn.preprocessing import PolynomialFeatures
from sklearn.preprocessing._csr_polynomial_expansion import _csr_polynomial_expansion
f... | 37.132813 | 88 | 0.57227 | from itertools import chain
from itertools import combinations
from itertools import combinations_with_replacement as combinations_w_r
import numpy as np
from scipy import sparse
from sklearn.preprocessing import PolynomialFeatures
from sklearn.preprocessing._csr_polynomial_expansion import _csr_polynomial_expansion
f... | true | true |
1c0cb5f21ecd24c0bad023fe7ccb4297bf7dc751 | 1,217 | py | Python | onelya_sdk/utils.py | tmconsulting/onelya-sdk | eb21398afed916021d74594d094b66e49fdb019c | [
"MIT"
] | 6 | 2017-12-16T13:55:51.000Z | 2020-01-28T01:46:23.000Z | onelya_sdk/utils.py | tmconsulting/onelya-sdk | eb21398afed916021d74594d094b66e49fdb019c | [
"MIT"
] | null | null | null | onelya_sdk/utils.py | tmconsulting/onelya-sdk | eb21398afed916021d74594d094b66e49fdb019c | [
"MIT"
] | 6 | 2017-12-08T13:57:58.000Z | 2017-12-12T03:16:42.000Z | from datetime import datetime
def get_money(item):
if item not in ['', 'Unknown', 'NoValue', None]:
return int(item * 100)
return None
def get_array(items, item_class=str):
if type(items) is list:
return [item_class(item) for item in items]
return []
def get_array_from_str(items):
... | 22.537037 | 73 | 0.604766 | from datetime import datetime
def get_money(item):
if item not in ['', 'Unknown', 'NoValue', None]:
return int(item * 100)
return None
def get_array(items, item_class=str):
if type(items) is list:
return [item_class(item) for item in items]
return []
def get_array_from_str(items):
... | true | true |
1c0cb67230247c4fa96955152fef4887bded98c2 | 2,154 | py | Python | legacy/load_database.py | pabadrubio/toshl_sync | 40d7d3356b0e1be392091e1285de9cbb9a0c68a6 | [
"Apache-2.0"
] | null | null | null | legacy/load_database.py | pabadrubio/toshl_sync | 40d7d3356b0e1be392091e1285de9cbb9a0c68a6 | [
"Apache-2.0"
] | null | null | null | legacy/load_database.py | pabadrubio/toshl_sync | 40d7d3356b0e1be392091e1285de9cbb9a0c68a6 | [
"Apache-2.0"
] | null | null | null | # Pablo Abad 2017
#
# Main program to update the tosh
import argparse
from legacy.database import ToshlDatabase
def read_token(token_file):
with open(token_file, 'r') as f:
token = f.read().strip()
return token
def save_categories(categories_file, database):
categories_names = database.getCategori... | 35.311475 | 106 | 0.659239 | import argparse
from legacy.database import ToshlDatabase
def read_token(token_file):
with open(token_file, 'r') as f:
token = f.read().strip()
return token
def save_categories(categories_file, database):
categories_names = database.getCategories()
categories = []
for categoryName in categ... | true | true |
1c0cb829d09ec627db5837bc799454c10a7db66b | 32,106 | py | Python | test/functional/test_framework/p2p.py | Frank-GER/syscoin | efbdac67f9d3d37d75de3480b8bb2c539ad05dd4 | [
"MIT"
] | 61 | 2016-03-09T10:42:05.000Z | 2018-03-13T05:06:30.000Z | test/functional/test_framework/p2p.py | Frank-GER/syscoin | efbdac67f9d3d37d75de3480b8bb2c539ad05dd4 | [
"MIT"
] | 153 | 2016-02-29T17:45:10.000Z | 2018-03-16T23:37:02.000Z | test/functional/test_framework/p2p.py | Frank-GER/syscoin | efbdac67f9d3d37d75de3480b8bb2c539ad05dd4 | [
"MIT"
] | 18 | 2016-03-02T21:50:44.000Z | 2018-03-07T20:36:12.000Z | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test objects... | 39.105968 | 190 | 0.649224 |
import asyncio
from collections import defaultdict
from io import BytesIO
import logging
import struct
import sys
import threading
from test_framework.messages import (
CBlockHeader,
MAX_HEADERS_RESULTS,
msg_addr,
msg_addrv2,
msg_block,
MSG_BLOCK,
msg_blocktxn,
msg_cfcheckpt,
msg_cf... | true | true |
1c0cbba626b541cb4af47e92c1efc8a6e7fc6bee | 5,073 | py | Python | eruditio/shared_apps/django_qa/forms.py | genghisu/eruditio | 5f8f3b682ac28fd3f464e7a993c3988c1a49eb02 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | eruditio/shared_apps/django_qa/forms.py | genghisu/eruditio | 5f8f3b682ac28fd3f464e7a993c3988c1a49eb02 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | eruditio/shared_apps/django_qa/forms.py | genghisu/eruditio | 5f8f3b682ac28fd3f464e7a993c3988c1a49eb02 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | import django.forms as forms
from django_utils.form_helpers import DivForm, FormValidator, RecaptchaForm, disable_form
import django_community.utils
import django_utils.form_widgets as form_widgets
import django_utils.html_helpers as html_helpers
import django_utils.form_fields as form_fields
import django_qa.model... | 49.735294 | 162 | 0.613444 | import django.forms as forms
from django_utils.form_helpers import DivForm, FormValidator, RecaptchaForm, disable_form
import django_community.utils
import django_utils.form_widgets as form_widgets
import django_utils.html_helpers as html_helpers
import django_utils.form_fields as form_fields
import django_qa.model... | true | true |
1c0cbc83fadbcf92aa88d10627880dd1a1dd575c | 2,045 | py | Python | imcsdk/mometa/bios/BiosVfCDNSupport.py | kgrozis/UCS-CIMC-Scripts | 44069ee853299fe5aeed023e8c998ce2534b8d8b | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/bios/BiosVfCDNSupport.py | kgrozis/UCS-CIMC-Scripts | 44069ee853299fe5aeed023e8c998ce2534b8d8b | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/bios/BiosVfCDNSupport.py | kgrozis/UCS-CIMC-Scripts | 44069ee853299fe5aeed023e8c998ce2534b8d8b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for BiosVfCDNSupport ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import ImcVersion, MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfCDNSupportConsts():
VP_CDNSUPPORT_DISABLED = "Disabled"
VP_CDNSUPPORT_LOMS_ONL... | 44.456522 | 213 | 0.669927 |
from ...imcmo import ManagedObject
from ...imccoremeta import ImcVersion, MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfCDNSupportConsts():
VP_CDNSUPPORT_DISABLED = "Disabled"
VP_CDNSUPPORT_LOMS_ONLY = "LOMs Only"
VP_CDNSUPPORT_PLATFORM_DEFAULT = "platform-default"
class BiosVfC... | true | true |
1c0cbd93363df5830f9d6f7957036ca7dbe9d2fb | 603 | py | Python | setup.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | 36 | 2021-02-26T22:54:14.000Z | 2022-03-20T12:59:48.000Z | setup.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | null | null | null | setup.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | 3 | 2021-03-17T13:44:28.000Z | 2022-01-11T11:15:23.000Z | from setuptools import setup
setup(
name='pgpelib',
version='0.0.20201210',
description='PGPE: Policy Gradients with Parameter-based Exploration',
author='Nihat Engin Toklu',
author_email='engin@nnaisense.com',
packages = ['pgpelib'],
install_requires=['numpy', 'torch', 'gym[box2d]', 'sacre... | 31.736842 | 94 | 0.630182 | from setuptools import setup
setup(
name='pgpelib',
version='0.0.20201210',
description='PGPE: Policy Gradients with Parameter-based Exploration',
author='Nihat Engin Toklu',
author_email='engin@nnaisense.com',
packages = ['pgpelib'],
install_requires=['numpy', 'torch', 'gym[box2d]', 'sacre... | true | true |
1c0cbe2c603fb2997c86cb61f0f3bdab4868be19 | 296 | py | Python | setup.py | tomkdickinson/parsemis_wrapper | e17096fd00b86adf7cac48291dace0d3bace8b4a | [
"MIT"
] | 5 | 2017-04-02T10:23:08.000Z | 2018-10-16T14:48:09.000Z | setup.py | tomkdickinson/parsemis_wrapper | e17096fd00b86adf7cac48291dace0d3bace8b4a | [
"MIT"
] | 1 | 2017-12-19T06:58:31.000Z | 2017-12-19T06:58:31.000Z | setup.py | tomkdickinson/parsemis_wrapper | e17096fd00b86adf7cac48291dace0d3bace8b4a | [
"MIT"
] | 3 | 2018-10-16T14:48:17.000Z | 2021-05-04T10:48:53.000Z | from distutils.core import setup
setup(name='parsemis',
version='1.0',
description="A simple wrapper for ParSeMiS",
author="Tom Dickinson",
author_email="tomkdickinson@gmail.com",
packages=['parsemis'],
package_data = {
'': ['parsemis.jar']
}
)
| 24.666667 | 50 | 0.608108 | from distutils.core import setup
setup(name='parsemis',
version='1.0',
description="A simple wrapper for ParSeMiS",
author="Tom Dickinson",
author_email="tomkdickinson@gmail.com",
packages=['parsemis'],
package_data = {
'': ['parsemis.jar']
}
)
| true | true |
1c0cc089efe6abcf03febc4a22d13589bfa0e494 | 4,760 | py | Python | aw_nas/rollout/ofa.py | A-suozhang/aw_nas | 9feb24974c7b44592e22ee45b98e116603d06eba | [
"MIT"
] | null | null | null | aw_nas/rollout/ofa.py | A-suozhang/aw_nas | 9feb24974c7b44592e22ee45b98e116603d06eba | [
"MIT"
] | null | null | null | aw_nas/rollout/ofa.py | A-suozhang/aw_nas | 9feb24974c7b44592e22ee45b98e116603d06eba | [
"MIT"
] | null | null | null | """
Definitions of mnasnet OFA rollout and search space.
"""
import numpy as np
from aw_nas import utils
from aw_nas.rollout.base import Rollout
from aw_nas.common import SearchSpace, genotype_from_str
class MNasNetOFASearchSpace(SearchSpace):
NAME = "ofa"
SCHEDULABLE_ATTRS = ["width_choice", "depth_choice"... | 29.937107 | 89 | 0.552521 |
import numpy as np
from aw_nas import utils
from aw_nas.rollout.base import Rollout
from aw_nas.common import SearchSpace, genotype_from_str
class MNasNetOFASearchSpace(SearchSpace):
NAME = "ofa"
SCHEDULABLE_ATTRS = ["width_choice", "depth_choice", "kernel_choice"]
def __init__(
self,
w... | true | true |
1c0cc0b79ed8c44e36be8b9f31338e23549d55be | 5,392 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | null | null | null | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 17.063291 | 76 | 0.638909 |
from enum import Enum
class ReasonCode(str, Enum):
quota_id = "QuotaId"
not_available_for_subscription = "NotAvailableForSubscription"
class SkuName(str, Enum):
standard_lrs = "Standard_LRS"
standard_grs = "Standard_GRS"
standard_ragrs = "Standard_RAGRS"
standard_zrs = "Standard_ZRS"
... | true | true |
1c0cc0d009740f539453840843d67a60c2cabf8b | 1,349 | py | Python | Datacenter/center.py | necoleman/DataProjects | 54ed57ef1bcef3749969cbbdf5aa5b4b4675ab34 | [
"MIT"
] | null | null | null | Datacenter/center.py | necoleman/DataProjects | 54ed57ef1bcef3749969cbbdf5aa5b4b4675ab34 | [
"MIT"
] | null | null | null | Datacenter/center.py | necoleman/DataProjects | 54ed57ef1bcef3749969cbbdf5aa5b4b4675ab34 | [
"MIT"
] | null | null | null | # this is a quick python script to approximate the center of mass of an n-dim
# laminar plate sitting inside R^{n+1}, defined by the equations
# \sum p_i = 1, p_j \leq c_j for all j, given constants c_j
import numpy as np
import matplotlib.pyplot as plt
# this recursively generates a fine mesh on a standard simplex ... | 31.372093 | 87 | 0.606375 |
import numpy as np
import matplotlib.pyplot as plt
def GenMesh(n,mag,dx):
if n == 1:
ret = []
for j in range(int(mag/dx)):
ret.append( [j*dx, mag-j*dx] )
return ret
else:
ret = []
for j in range(int(mag/dx)):
m = mag - j*dx
row = GenM... | false | true |
1c0cc16b62765f12a0fae1cb39241744ea85ae84 | 5,433 | py | Python | tests/test_runners/test_bazel.py | takanabe/cli | 7cbf781d7f286fc4e52ef0980712c28f386e8d09 | [
"Apache-2.0"
] | null | null | null | tests/test_runners/test_bazel.py | takanabe/cli | 7cbf781d7f286fc4e52ef0980712c28f386e8d09 | [
"Apache-2.0"
] | null | null | null | tests/test_runners/test_bazel.py | takanabe/cli | 7cbf781d7f286fc4e52ef0980712c28f386e8d09 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import responses # type: ignore
import json
import os
import gzip
import itertools
from launchable.utils.session import read_session
from tests.cli_test_case import CliTestCase
from unittest import mock
class BazelTest(CliTestCase):
test_files_dir = Path(__file__).parent.joinpath(
... | 42.779528 | 242 | 0.670716 | from pathlib import Path
import responses import json
import os
import gzip
import itertools
from launchable.utils.session import read_session
from tests.cli_test_case import CliTestCase
from unittest import mock
class BazelTest(CliTestCase):
test_files_dir = Path(__file__).parent.joinpath(
'../data/baze... | true | true |
1c0cc1e099617b0eee2899fe4c283392b4bcedb7 | 44,337 | py | Python | electrum_ltc/tests/test_lnutil.py | jakesum/electrum-ltc | 8bc205e086210e6ec40dbc0b8f46c9fc74c47121 | [
"MIT"
] | 1 | 2021-03-19T11:58:38.000Z | 2021-03-19T11:58:38.000Z | electrum_ltc/tests/test_lnutil.py | jakesum/electrum-ltc | 8bc205e086210e6ec40dbc0b8f46c9fc74c47121 | [
"MIT"
] | null | null | null | electrum_ltc/tests/test_lnutil.py | jakesum/electrum-ltc | 8bc205e086210e6ec40dbc0b8f46c9fc74c47121 | [
"MIT"
] | 1 | 2021-03-19T11:58:39.000Z | 2021-03-19T11:58:39.000Z | import unittest
import json
from electrum_ltc import bitcoin
from electrum_ltc.lnutil import (RevocationStore, get_per_commitment_secret_from_seed, make_offered_htlc,
make_received_htlc, make_commitment, make_htlc_tx_witness, make_htlc_tx_output,
make_h... | 62.35865 | 1,149 | 0.649818 | import unittest
import json
from electrum_ltc import bitcoin
from electrum_ltc.lnutil import (RevocationStore, get_per_commitment_secret_from_seed, make_offered_htlc,
make_received_htlc, make_commitment, make_htlc_tx_witness, make_htlc_tx_output,
make_h... | true | true |
1c0cc3cd135005d8630714ce1e85c7fbb5d8147f | 133 | py | Python | boj/11719.py | byeonggukgong/algorithm | d9283fdbcfe4966cd4de3e394d9fd3aa33d533a8 | [
"MIT"
] | 3 | 2018-03-11T14:10:59.000Z | 2019-01-23T12:34:27.000Z | boj/11719.py | byeonggukgong/algorithm | d9283fdbcfe4966cd4de3e394d9fd3aa33d533a8 | [
"MIT"
] | null | null | null | boj/11719.py | byeonggukgong/algorithm | d9283fdbcfe4966cd4de3e394d9fd3aa33d533a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
while True:
try:
line = input()
print(line)
except EOFError:
break
| 13.3 | 26 | 0.578947 |
if __name__ == '__main__':
while True:
try:
line = input()
print(line)
except EOFError:
break
| true | true |
1c0cc4fe17f6bcbb5fa06b05b33d966e90bfb5de | 530 | py | Python | src/providers/base_provider.py | bbhunter/s3viewer | e3d936fd9d6b9b5e7c5e874dcfb502a6f4650e1e | [
"MIT"
] | 381 | 2021-01-08T14:24:12.000Z | 2022-03-06T16:00:00.000Z | src/providers/base_provider.py | 4144/s3viewer | 564f3213e73b659946efce49cda57d99c547e73b | [
"MIT"
] | 3 | 2021-01-10T20:21:23.000Z | 2021-07-08T12:31:10.000Z | src/providers/base_provider.py | 4144/s3viewer | 564f3213e73b659946efce49cda57d99c547e73b | [
"MIT"
] | 44 | 2021-01-09T06:54:17.000Z | 2022-03-03T05:38:36.000Z |
class StorageProvider():
NODE_BATCH_UPDATE_COUNT = 1
def __init__(self, url):
self.url = url
self.should_stop = False
@staticmethod
def is_provider(url):
return False
def check(self):
return True
def get_download_url(self, relative_path):
return relat... | 17.096774 | 46 | 0.616981 |
class StorageProvider():
NODE_BATCH_UPDATE_COUNT = 1
def __init__(self, url):
self.url = url
self.should_stop = False
@staticmethod
def is_provider(url):
return False
def check(self):
return True
def get_download_url(self, relative_path):
return relat... | true | true |
1c0cc507ccab5b450862144c9709e25eb06dad01 | 2,260 | py | Python | darwin/item_sorter.py | ck37/darwin-py | a231e3844759c44a954b47126bbbf9d6afe658fc | [
"MIT"
] | 28 | 2019-10-23T09:05:45.000Z | 2022-03-07T16:28:36.000Z | darwin/item_sorter.py | ck37/darwin-py | a231e3844759c44a954b47126bbbf9d6afe658fc | [
"MIT"
] | 91 | 2019-09-20T10:31:25.000Z | 2022-03-30T15:27:17.000Z | darwin/item_sorter.py | ck37/darwin-py | a231e3844759c44a954b47126bbbf9d6afe658fc | [
"MIT"
] | 11 | 2020-04-02T08:31:37.000Z | 2021-12-20T22:57:38.000Z | from enum import Enum
from typing import Union
class SortDirection(Enum):
ASCENDING = "asc"
DESCENDING = "desc"
@classmethod
def parse(cls, direction: str) -> "SortDirection":
normalized_direction = direction.lower()
if cls._is_ascending(normalized_direction):
return cls.... | 31.830986 | 184 | 0.625221 | from enum import Enum
from typing import Union
class SortDirection(Enum):
ASCENDING = "asc"
DESCENDING = "desc"
@classmethod
def parse(cls, direction: str) -> "SortDirection":
normalized_direction = direction.lower()
if cls._is_ascending(normalized_direction):
return cls.... | true | true |
1c0cc5b1eb17d29810282d5b352b599970d27715 | 5,412 | py | Python | 15_plot_mvpa_results.py | JoseAlanis/supplementary_dpx_tt | 2b5a94c35753dc9dbf51357c840a87380e40fe3c | [
"BSD-3-Clause"
] | null | null | null | 15_plot_mvpa_results.py | JoseAlanis/supplementary_dpx_tt | 2b5a94c35753dc9dbf51357c840a87380e40fe3c | [
"BSD-3-Clause"
] | 1 | 2021-04-29T09:43:06.000Z | 2021-04-29T09:43:06.000Z | 15_plot_mvpa_results.py | JoseAlanis/supplementary_dpx_tt | 2b5a94c35753dc9dbf51357c840a87380e40fe3c | [
"BSD-3-Clause"
] | 1 | 2019-11-13T10:21:13.000Z | 2019-11-13T10:21:13.000Z | """
=============================================
Plot results of multivariate pattern analysis
=============================================
Creates figures to show classifier performance at multiple time points of
the of the EEG epoch.
Authors: José C. García Alanis <alanis.jcg@gmail.com>
License: BSD (3-clause)
"... | 36.816327 | 96 | 0.555802 | import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import seaborn as sns
from config import fname, subjects
from mvpa_stats import get_stats_lines, get_dfs, plot_image
from mne import read_epochs
subjects = subjects[subjects != 51]
input_file = fname.output(subject=subjects[0],
... | true | true |
1c0cc646399007d282cd46b122d8fbe3c5492993 | 32,511 | py | Python | slowfast/visualization/video_visualizer_colab.py | VandanaAgarwal/SlowFast | 7b1271089fbfc0b5a65bf0c322eb6ecfc0391b1d | [
"Apache-2.0"
] | null | null | null | slowfast/visualization/video_visualizer_colab.py | VandanaAgarwal/SlowFast | 7b1271089fbfc0b5a65bf0c322eb6ecfc0391b1d | [
"Apache-2.0"
] | null | null | null | slowfast/visualization/video_visualizer_colab.py | VandanaAgarwal/SlowFast | 7b1271089fbfc0b5a65bf0c322eb6ecfc0391b1d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import itertools
import logging as log
import numpy as np
import matplotlib.pyplot as plt
import torch
from detectron2.utils.visualizer import Visualizer
import slowfast.utils.logging as logging
from slowfast.utils.misc imp... | 40.588015 | 143 | 0.565778 |
import itertools
import logging as log
import numpy as np
import matplotlib.pyplot as plt
import torch
from detectron2.utils.visualizer import Visualizer
import slowfast.utils.logging as logging
from slowfast.utils.misc import get_class_names
import face_recognition
import cv2
import os
from google.colab.patches im... | true | true |
1c0cc6a9f94583d492cde0939c3356b8ff778c35 | 9,173 | py | Python | Mac/Modules/dlg/dlgsupport.py | deadsnakes/python2.4 | f493d5415b662e99a73d017bcafe2148c5bc8fb5 | [
"PSF-2.0"
] | null | null | null | Mac/Modules/dlg/dlgsupport.py | deadsnakes/python2.4 | f493d5415b662e99a73d017bcafe2148c5bc8fb5 | [
"PSF-2.0"
] | null | null | null | Mac/Modules/dlg/dlgsupport.py | deadsnakes/python2.4 | f493d5415b662e99a73d017bcafe2148c5bc8fb5 | [
"PSF-2.0"
] | null | null | null | # This script generates the Dialogs interface for Python.
# It uses the "bgen" package to generate C code.
# It execs the file dlggen.py which contain the function definitions
# (dlggen.py was generated by dlgscan.py, scanning the <Dialogs.h> header file).
from macsupport import *
# Create the type objects
DialogPtr... | 32.878136 | 107 | 0.618554 |
from macsupport import *
DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj")
DialogRef = DialogPtr
OptHandle = OpaqueByValueType("Handle", "OptResObj")
ModalFilterProcPtr = InputOnlyType("PyObject*", "O")
ModalFilterProcPtr.passInput = lambda name: "Dlg_PassFilterProc(%s)" % name
ModalFilterUPP = ModalFilterProcP... | true | true |
1c0cc8d7850cd99d5d2261438f24ca8e26b4a976 | 4,917 | py | Python | scrape_definitions.py | MAPC/epa_python | 6ee7ed562a70071dbed845bf04494c7fef0ab840 | [
"BSD-3-Clause"
] | 3 | 2015-10-12T18:05:14.000Z | 2021-03-07T22:58:03.000Z | scrape_definitions.py | MAPC/epa_python | 6ee7ed562a70071dbed845bf04494c7fef0ab840 | [
"BSD-3-Clause"
] | 1 | 2017-05-12T15:57:14.000Z | 2019-02-03T13:49:09.000Z | scrape_definitions.py | MAPC/epa_python | 6ee7ed562a70071dbed845bf04494c7fef0ab840 | [
"BSD-3-Clause"
] | 3 | 2019-02-02T21:08:10.000Z | 2021-04-17T15:05:10.000Z | #!/usr/bin/env python
"""
In order to configure lookup dicts for EPA tables and columns in the fastest
way possible, it's necessary to scrape the site (you'd think the data
definitions would be more accessible, but unfortunately, they're not).
This is a second attempt at making an adequate scraper -- but instead of u... | 35.121429 | 79 | 0.579418 |
"""
In order to configure lookup dicts for EPA tables and columns in the fastest
way possible, it's necessary to scrape the site (you'd think the data
definitions would be more accessible, but unfortunately, they're not).
This is a second attempt at making an adequate scraper -- but instead of using
the alpha version... | false | true |
1c0cc8e6592493ca8e3782143111c5054b40135b | 11,762 | py | Python | intersight/model/uuidpool_universe_response.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/uuidpool_universe_response.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/uuidpool_universe_response.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 47.048 | 1,678 | 0.637477 |
import re import sys
from intersight.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_... | true | true |
1c0cc8e7dae042b846d1eaa30059f8f094084470 | 501 | py | Python | tracking/__init__.py | yassam/django-tracking2 | 7b4089048a8e8072eea94c44b66de68918e6bbaa | [
"BSD-2-Clause"
] | null | null | null | tracking/__init__.py | yassam/django-tracking2 | 7b4089048a8e8072eea94c44b66de68918e6bbaa | [
"BSD-2-Clause"
] | null | null | null | tracking/__init__.py | yassam/django-tracking2 | 7b4089048a8e8072eea94c44b66de68918e6bbaa | [
"BSD-2-Clause"
] | null | null | null | __version_info__ = {
'major': 0,
'minor': 1,
'micro': 10,
'releaselevel': 'beta',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__]
if __version_info__['releaselev... | 29.470588 | 95 | 0.628743 | __version_info__ = {
'major': 0,
'minor': 1,
'micro': 10,
'releaselevel': 'beta',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__]
if __version_info__['releaselev... | true | true |
1c0cca5e19e05d35425bea7e7f2ac61d653ae059 | 1,756 | py | Python | Lib/site-packages/jupyter_server/services/api/handlers.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/jupyter_server/services/api/handlers.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/jupyter_server/services/api/handlers.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | """Tornado handlers for api specifications."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
from tornado import web
from jupyter_server._tz import isoformat, utcfromtimestamp
from jupyter_server.auth import authorized
from jupyter_server.ut... | 28.322581 | 78 | 0.698178 | import json
import os
from tornado import web
from jupyter_server._tz import isoformat, utcfromtimestamp
from jupyter_server.auth import authorized
from jupyter_server.utils import ensure_async
from ...base.handlers import APIHandler, JupyterHandler
AUTH_RESOURCE = "api"
class APISpecHandler(web.StaticFileHandler... | true | true |
1c0ccb5041fc2e1c33026e53565385c3b1585c0d | 3,563 | py | Python | google/ads/googleads/v7/services/services/invoice_service/transports/base.py | tridge-hq/google-ads-python | 7c61e0705063324b973a6bdf1d83193c032a9012 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v7/services/services/invoice_service/transports/base.py | tridge-hq/google-ads-python | 7c61e0705063324b973a6bdf1d83193c032a9012 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v7/services/services/invoice_service/transports/base.py | tridge-hq/google-ads-python | 7c61e0705063324b973a6bdf1d83193c032a9012 | [
"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... | 34.931373 | 78 | 0.66517 | import abc
import typing
import pkg_resources
from google import auth
from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials
from google.ads.googleads.v7.services.types import invoice_service
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientI... | true | true |
1c0ccbc0841974834946e7cde6d7a755c14664a6 | 2,392 | py | Python | lib/layer_utils/proposal_layer.py | zergmk2/tf_ctpn | f0f20606b3a2e58819cb330ede52b1d9e2c21d31 | [
"MIT"
] | 39 | 2018-06-14T01:14:34.000Z | 2021-11-21T22:03:12.000Z | lib/layer_utils/proposal_layer.py | zergmk2/tf_ctpn | f0f20606b3a2e58819cb330ede52b1d9e2c21d31 | [
"MIT"
] | 9 | 2018-08-07T03:36:47.000Z | 2020-05-07T10:17:41.000Z | lib/layer_utils/proposal_layer.py | zergmk2/tf_ctpn | f0f20606b3a2e58819cb330ede52b1d9e2c21d31 | [
"MIT"
] | 16 | 2018-07-14T15:02:31.000Z | 2022-01-06T08:57:01.000Z | # --------------------------------------------------------
# Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future_... | 37.968254 | 103 | 0.662207 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from model.config import cfg
from model.bbox_transform import bbox_transform_inv, clip_boxes
from model.nms_wrapper import nms
def proposal_layer(rpn_cls_prob, rpn_bbox_pred, im_info, cfg_k... | true | true |
1c0ccbf8ba0148d20e7d25d8ce55f07a9e06c9d8 | 635 | py | Python | tests/cicd/src/notebook_integration_tests.py | aisensiy/seismic-deeplearning | e3cd36d9e74573e0b1fd86bf5345b0cc48381bc5 | [
"MIT"
] | 3 | 2020-02-04T16:08:21.000Z | 2021-07-04T12:51:30.000Z | tests/cicd/src/notebook_integration_tests.py | aisensiy/seismic-deeplearning | e3cd36d9e74573e0b1fd86bf5345b0cc48381bc5 | [
"MIT"
] | 13 | 2020-02-03T23:51:56.000Z | 2020-02-13T14:09:18.000Z | tests/cicd/src/notebook_integration_tests.py | aisensiy/seismic-deeplearning | e3cd36d9e74573e0b1fd86bf5345b0cc48381bc5 | [
"MIT"
] | 1 | 2021-04-20T03:42:13.000Z | 2021-04-20T03:42:13.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import pytest
import papermill as pm
from tests.notebooks_common import OUTPUT_NOTEBOOK, KERNEL_NAME
# don't add any markup as this just runs any notebook which name is supplied
# @pytest.mark.integration
# @pytest.mark.not... | 31.75 | 108 | 0.737008 |
import pytest
import papermill as pm
from tests.notebooks_common import OUTPUT_NOTEBOOK, KERNEL_NAME
# @pytest.mark.integration
# @pytest.mark.notebooks
def test_notebook_run(nbname, dataset_root):
pm.execute_notebook(
nbname,
OUTPUT_NOTEBOOK,
kernel_name=KERNEL_NAME,
parameters={... | true | true |
1c0ccc37300da49bfb4b1af9466efc6150665b8e | 25,503 | py | Python | spectractor/simulation/image_simulation.py | lsst-dm/Spectractor | 4ed1bf75d6bf970fd28308da30754485722835a8 | [
"BSD-3-Clause"
] | null | null | null | spectractor/simulation/image_simulation.py | lsst-dm/Spectractor | 4ed1bf75d6bf970fd28308da30754485722835a8 | [
"BSD-3-Clause"
] | null | null | null | spectractor/simulation/image_simulation.py | lsst-dm/Spectractor | 4ed1bf75d6bf970fd28308da30754485722835a8 | [
"BSD-3-Clause"
] | null | null | null | from spectractor import parameters
from spectractor.config import set_logger
from spectractor.tools import (pixel_rotation, set_wcs_file_name, set_sources_file_name,
set_gaia_catalog_file_name, load_wcs_from_file, ensure_dir,
plot_image_simple)
from spectrac... | 44.353043 | 120 | 0.635729 | from spectractor import parameters
from spectractor.config import set_logger
from spectractor.tools import (pixel_rotation, set_wcs_file_name, set_sources_file_name,
set_gaia_catalog_file_name, load_wcs_from_file, ensure_dir,
plot_image_simple)
from spectrac... | true | true |
1c0ccc96218f60a19fbfdb4c48eee15a1e871176 | 660 | py | Python | tests/test_transforms.py | leonardoedgar/raveutils | b4f355249926ada87d863d8f25f2f6ae5d0c0a53 | [
"BSD-3-Clause"
] | 4 | 2018-04-04T15:52:50.000Z | 2021-08-01T12:04:35.000Z | tests/test_transforms.py | leonardoedgar/raveutils | b4f355249926ada87d863d8f25f2f6ae5d0c0a53 | [
"BSD-3-Clause"
] | 9 | 2017-10-20T06:08:58.000Z | 2019-04-12T01:33:55.000Z | tests/test_transforms.py | leonardoedgar/raveutils | b4f355249926ada87d863d8f25f2f6ae5d0c0a53 | [
"BSD-3-Clause"
] | 5 | 2017-10-20T03:28:06.000Z | 2022-03-31T04:37:16.000Z | #! /usr/bin/env python
import unittest
import numpy as np
import baldor as br
# PyKDL
import PyKDL
from tf_conversions import posemath
# Tested package
import raveutils as ru
class Test_transforms(unittest.TestCase):
def test_compute_twist(self):
for _ in range(100):
T0 = br.transform.random()
vel =... | 27.5 | 69 | 0.693939 | import unittest
import numpy as np
import baldor as br
import PyKDL
from tf_conversions import posemath
import raveutils as ru
class Test_transforms(unittest.TestCase):
def test_compute_twist(self):
for _ in range(100):
T0 = br.transform.random()
vel = np.random.rand(3)
rot = np.random.rand(3)... | true | true |
1c0ccdefa701afa3203806740a84dc0c74342204 | 6,834 | py | Python | homeassistant/components/ozw/config_flow.py | rchl/core | 974e099e2a9527d38445531c6d9bc1461ba4c36f | [
"Apache-2.0"
] | 1 | 2021-04-08T11:37:15.000Z | 2021-04-08T11:37:15.000Z | homeassistant/components/ozw/config_flow.py | rchl/core | 974e099e2a9527d38445531c6d9bc1461ba4c36f | [
"Apache-2.0"
] | 56 | 2020-08-03T07:30:54.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/ozw/config_flow.py | rchl/core | 974e099e2a9527d38445531c6d9bc1461ba4c36f | [
"Apache-2.0"
] | 1 | 2021-07-02T14:43:59.000Z | 2021-07-02T14:43:59.000Z | """Config flow for ozw integration."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow
from .const import CONF_INTEGRATION_CREATED_ADDON
from .const import DOMAIN # pylint:disable=unused-impo... | 37.141304 | 86 | 0.661984 | import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow
from .const import CONF_INTEGRATION_CREATED_ADDON
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
CONF_ADDON_DEVICE = "device... | true | true |
1c0ccf11557ce44e40d1f468166cf33ce3e27b08 | 1,343 | py | Python | tinygrad/gradcheck.py | 0xNaN/tinygrad | 4bdb524da7696e47cec02a211a1829c14b434cda | [
"MIT"
] | null | null | null | tinygrad/gradcheck.py | 0xNaN/tinygrad | 4bdb524da7696e47cec02a211a1829c14b434cda | [
"MIT"
] | null | null | null | tinygrad/gradcheck.py | 0xNaN/tinygrad | 4bdb524da7696e47cec02a211a1829c14b434cda | [
"MIT"
] | null | null | null | import numpy as np
from tinygrad.utils import mask_like
from tinygrad.tensor import Tensor
def jacobian(func, input):
output = func(input)
ji = input.data.reshape(-1).shape[-1]
jo = output.data.reshape(-1).shape[-1]
J = np.zeros((jo,ji))
for o in range(jo):
# tinygrad doesn't support slicing, tiny-hac... | 29.195652 | 85 | 0.667163 | import numpy as np
from tinygrad.utils import mask_like
from tinygrad.tensor import Tensor
def jacobian(func, input):
output = func(input)
ji = input.data.reshape(-1).shape[-1]
jo = output.data.reshape(-1).shape[-1]
J = np.zeros((jo,ji))
for o in range(jo):
# the needed scalar an backpropagate onl... | true | true |
1c0cd084f8e36dfae591b195ed066c527e708df8 | 446 | py | Python | packages/python/plotly/plotly/validators/layout/scene/zaxis/_categoryarraysrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/scene/zaxis/_categoryarraysrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/scene/zaxis/_categoryarraysrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class CategoryarraysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="categoryarraysrc", parent_name="layout.scene.zaxis", **kwargs
):
super(CategoryarraysrcValidator, self).__init__(
plotly_name=plotly_name... | 31.857143 | 88 | 0.672646 | import _plotly_utils.basevalidators
class CategoryarraysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="categoryarraysrc", parent_name="layout.scene.zaxis", **kwargs
):
super(CategoryarraysrcValidator, self).__init__(
plotly_name=plotly_name... | true | true |
1c0cd096fac177971ce2e977f42975aade131614 | 100 | py | Python | src/settings.py | icaroseara/project-x | 968aee9e6b84f7c17eae5cf63a2933dece767b1a | [
"FTL",
"Xnet",
"X11"
] | null | null | null | src/settings.py | icaroseara/project-x | 968aee9e6b84f7c17eae5cf63a2933dece767b1a | [
"FTL",
"Xnet",
"X11"
] | null | null | null | src/settings.py | icaroseara/project-x | 968aee9e6b84f7c17eae5cf63a2933dece767b1a | [
"FTL",
"Xnet",
"X11"
] | null | null | null | EXTERNAL_DATA_DIR = 'data/external'
RAW_DATA_DIR = 'data/raw'
PROCESSED_DATA_DIR = 'data/processed'
| 25 | 37 | 0.79 | EXTERNAL_DATA_DIR = 'data/external'
RAW_DATA_DIR = 'data/raw'
PROCESSED_DATA_DIR = 'data/processed'
| true | true |
1c0cd135fa1832e28681297ec1a5a9f0bf0ec374 | 3,887 | py | Python | cbrowse.py | lazypwny751/bin | 2f0c3f00f18d5da90d606d85b8867cc4ad8f2a62 | [
"0BSD"
] | 2 | 2019-05-04T00:50:11.000Z | 2021-08-03T16:59:38.000Z | cbrowse.py | lazypwny751/bin | 2f0c3f00f18d5da90d606d85b8867cc4ad8f2a62 | [
"0BSD"
] | null | null | null | cbrowse.py | lazypwny751/bin | 2f0c3f00f18d5da90d606d85b8867cc4ad8f2a62 | [
"0BSD"
] | 1 | 2021-08-03T16:59:57.000Z | 2021-08-03T16:59:57.000Z | #!/usr/bin/python
import curses
import os
import sys
def pad(data, width):
return data + " " * (width - len(data))
class File:
def __init__(self, name):
self.name = name
def render(self, depth, width):
return pad(
"%s%s %s" % (" " * 4 * depth, self.icon(), os.path.basename(s... | 23.415663 | 88 | 0.509133 | import curses
import os
import sys
def pad(data, width):
return data + " " * (width - len(data))
class File:
def __init__(self, name):
self.name = name
def render(self, depth, width):
return pad(
"%s%s %s" % (" " * 4 * depth, self.icon(), os.path.basename(self.name)),
... | true | true |
1c0cd238bdb621bb74663213f43560b6075af149 | 2,414 | py | Python | tests/singular_values_test.py | MathiasPede/Fast-Time-Series-Clustering | dc2d01fe3cfd57a80ba2a1f10d0fc00eaed05f09 | [
"Apache-2.0"
] | 1 | 2020-08-17T21:12:39.000Z | 2020-08-17T21:12:39.000Z | tests/singular_values_test.py | MathiasPede/Fast-Time-Series-Clustering | dc2d01fe3cfd57a80ba2a1f10d0fc00eaed05f09 | [
"Apache-2.0"
] | null | null | null | tests/singular_values_test.py | MathiasPede/Fast-Time-Series-Clustering | dc2d01fe3cfd57a80ba2a1f10d0fc00eaed05f09 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from math import floor
from ftsc.singular_values import calculate_best_relative_error_for_all_ranks, calculate_best_relative_error_rank
from tests.plotting_utils import scatter_plot, multiple_scatter_plot
from tests.tests_utils import get_singular_values, get_all_test_dataset_names
def run_best_er... | 38.935484 | 112 | 0.691798 | import numpy as np
from math import floor
from ftsc.singular_values import calculate_best_relative_error_for_all_ranks, calculate_best_relative_error_rank
from tests.plotting_utils import scatter_plot, multiple_scatter_plot
from tests.tests_utils import get_singular_values, get_all_test_dataset_names
def run_best_er... | true | true |
1c0cd292f847ba2faca97104830fc843ff3ff245 | 538 | py | Python | plotly/validators/scattergeo/marker/colorbar/_ticklen.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/scattergeo/marker/colorbar/_ticklen.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/scattergeo/marker/colorbar/_ticklen.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='ticklen',
parent_name='scattergeo.marker.colorbar',
**kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=pl... | 26.9 | 69 | 0.598513 | import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='ticklen',
parent_name='scattergeo.marker.colorbar',
**kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=pl... | true | true |
1c0cd2a3feba00740c8515e4d7e78b16d9f4ba16 | 27,864 | py | Python | numba/tests/test_target_extension.py | skailasa/numba | 38ab89dd369a14b8826d3fa30d080aa083aed00b | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-11-02T18:55:23.000Z | 2021-11-02T18:55:23.000Z | numba/tests/test_target_extension.py | skailasa/numba | 38ab89dd369a14b8826d3fa30d080aa083aed00b | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 6 | 2018-08-06T15:29:52.000Z | 2020-12-16T09:51:11.000Z | numba/tests/test_target_extension.py | skailasa/numba | 38ab89dd369a14b8826d3fa30d080aa083aed00b | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2018-04-14T00:28:12.000Z | 2020-04-16T22:17:14.000Z | """This tests the target extension API to ensure that rudimentary expected
behaviours are present and correct. It uses a piece of fake hardware as a
target, the Dummy Processing Unit (DPU), to do this. The DPU borrows a lot from
the CPU but is part of the GPU class of target. The DPU target has deliberately
strange imp... | 32.858491 | 80 | 0.604041 |
import unittest
from numba.tests.support import TestCase
import contextlib
import ctypes
import operator
import numpy as np
from numba import njit, types
from numba.extending import overload, intrinsic, overload_classmethod
from numba.core.target_extension import (
JitDecorator,
target_registry,
dispatcher... | true | true |
1c0cd2c445618f2583042030f0348710833de83d | 1,244 | py | Python | libtad/datatypes/places/geo.py | timeanddate/libtad-python | 8c3b14578ed1f5f5e79cc83b415433f59e39814f | [
"MIT"
] | 2 | 2022-01-14T11:35:50.000Z | 2022-03-07T04:20:14.000Z | libtad/datatypes/places/geo.py | timeanddate/libtad-python | 8c3b14578ed1f5f5e79cc83b415433f59e39814f | [
"MIT"
] | null | null | null | libtad/datatypes/places/geo.py | timeanddate/libtad-python | 8c3b14578ed1f5f5e79cc83b415433f59e39814f | [
"MIT"
] | null | null | null | from .country import Country
from .coordinates import Coordinates
import xml.etree.ElementTree as ET
class Geo:
"""
The geographical information type.
...
Attributes
----------
name : str
The name of the location.
state : str
The state of the location within the country (o... | 26.468085 | 87 | 0.606109 | from .country import Country
from .coordinates import Coordinates
import xml.etree.ElementTree as ET
class Geo:
def __init__(self, node: ET.Element):
self.name: str = None
self.state: str = None
self.country: Country = None
self.coordinates: Coordinates = None
latitude = n... | true | true |
1c0cd4ce72225ec486ee56c44081201a885fe8f9 | 10,651 | py | Python | userbot/modules/misc/kang.py | ZJRDroid/PaperplaneRemix | b41dffad17cce076f174a3fb36f0aeba1177cefa | [
"MIT"
] | null | null | null | userbot/modules/misc/kang.py | ZJRDroid/PaperplaneRemix | b41dffad17cce076f174a3fb36f0aeba1177cefa | [
"MIT"
] | null | null | null | userbot/modules/misc/kang.py | ZJRDroid/PaperplaneRemix | b41dffad17cce076f174a3fb36f0aeba1177cefa | [
"MIT"
] | 1 | 2019-12-21T03:44:42.000Z | 2019-12-21T03:44:42.000Z | import io
import math
import urllib.request
from PIL import Image
from telethon.tl.custom import Conversation
from telethon.tl.types import MessageMediaPhoto, DocumentAttributeFilename
from ..help import add_help_item
from userbot import bot
from userbot.events import register
PACK_FULL = "Whoa! That's probably enou... | 42.7751 | 153 | 0.53779 | import io
import math
import urllib.request
from PIL import Image
from telethon.tl.custom import Conversation
from telethon.tl.types import MessageMediaPhoto, DocumentAttributeFilename
from ..help import add_help_item
from userbot import bot
from userbot.events import register
PACK_FULL = "Whoa! That's probably enou... | true | true |
1c0cd59715e8c1b39f95145a3dddc590d6cac2b2 | 935 | py | Python | datastructures/arrays/matrix_zeroes.py | sikakente/educative-io-python | be6e6c3534bf76e6f77addce16d1ab0c40e3e48d | [
"MIT"
] | 1 | 2021-12-28T21:19:53.000Z | 2021-12-28T21:19:53.000Z | datastructures/arrays/matrix_zeroes.py | sikakente/educative-io-python | be6e6c3534bf76e6f77addce16d1ab0c40e3e48d | [
"MIT"
] | 72 | 2022-02-01T18:18:47.000Z | 2022-03-13T12:31:26.000Z | datastructures/arrays/matrix_zeroes.py | sikakente/educative-io-python | be6e6c3534bf76e6f77addce16d1ab0c40e3e48d | [
"MIT"
] | null | null | null | """
Problem Statement
----------------
Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. You must do it in place.
Input
-----
m by n matrix of integers
Output
-------
matrix with zeroes set
"""
def set_matrix_zeroes(matrix):
m = len(matrix)
n = len(matrix[0])
... | 19.893617 | 121 | 0.568984 |
def set_matrix_zeroes(matrix):
m = len(matrix)
n = len(matrix[0])
def find_zeros():
zeros = []
for row in range(m):
for col in range(n):
if matrix[row][col] == 0:
zeros.append((row, col))
return zeros
zero_indexes = find_zeros()... | true | true |
1c0cd6e8130c9556012af577efce6888aa3ddfb3 | 771 | py | Python | utz/zip.py | ryan-williams/jupyter-rc | 362d9d758498de317976006ce7dfc65e2bce2c57 | [
"MIT"
] | null | null | null | utz/zip.py | ryan-williams/jupyter-rc | 362d9d758498de317976006ce7dfc65e2bce2c57 | [
"MIT"
] | 2 | 2020-11-18T15:36:35.000Z | 2021-06-25T18:21:32.000Z | utz/zip.py | runsascoded/utz | 362d9d758498de317976006ce7dfc65e2bce2c57 | [
"MIT"
] | 1 | 2020-06-10T23:14:00.000Z | 2020-06-10T23:14:00.000Z | from os import remove
from os.path import basename, dirname, join, splitext
from pathlib import Path
from zipfile import is_zipfile, ZipFile
def try_unzip(path):
if isinstance(path, Path):
path = str(path)
if is_zipfile(path):
from shutil import move
parent = dirname(path)
name... | 26.586207 | 57 | 0.581064 | from os import remove
from os.path import basename, dirname, join, splitext
from pathlib import Path
from zipfile import is_zipfile, ZipFile
def try_unzip(path):
if isinstance(path, Path):
path = str(path)
if is_zipfile(path):
from shutil import move
parent = dirname(path)
name... | true | true |
1c0cd742d3b9509bd719868d761f7406058ed4fa | 4,702 | py | Python | utils/opt_utils.py | alzaia/improving_neural_nets_python | 52cc9c88d895e87d8024e36b86776f644e629634 | [
"MIT"
] | null | null | null | utils/opt_utils.py | alzaia/improving_neural_nets_python | 52cc9c88d895e87d8024e36b86776f644e629634 | [
"MIT"
] | null | null | null | utils/opt_utils.py | alzaia/improving_neural_nets_python | 52cc9c88d895e87d8024e36b86776f644e629634 | [
"MIT"
] | 1 | 2020-04-26T02:42:04.000Z | 2020-04-26T02:42:04.000Z |
import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy.io
import sklearn
import sklearn.datasets
def sigmoid(x):
s = 1/(1+np.exp(-x))
return s
def relu(x):
s = np.maximum(0,x)
return s
def load_params_and_grads(seed=1):
np.random.seed(seed)
W1 = np.random.randn(2,3)
... | 27.658824 | 113 | 0.571246 |
import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy.io
import sklearn
import sklearn.datasets
def sigmoid(x):
s = 1/(1+np.exp(-x))
return s
def relu(x):
s = np.maximum(0,x)
return s
def load_params_and_grads(seed=1):
np.random.seed(seed)
W1 = np.random.randn(2,3)
... | true | true |
1c0cd7d24df82a6e910809a1ae69dffb53bce26b | 20,733 | py | Python | domonic/d3/format.py | code-review-doctor/domonic | fee5704ab051d40c7b3fec5488a44d3ab1ee027c | [
"MIT"
] | null | null | null | domonic/d3/format.py | code-review-doctor/domonic | fee5704ab051d40c7b3fec5488a44d3ab1ee027c | [
"MIT"
] | null | null | null | domonic/d3/format.py | code-review-doctor/domonic | fee5704ab051d40c7b3fec5488a44d3ab1ee027c | [
"MIT"
] | null | null | null | """
domonic.d3.format
==================================
"""
from domonic.javascript import Array, Global, Math, Number, RegExp, String
def formatDecimal(x, ignore=None):
x = Math.round(x)
if Math.abs(x) >= 1e21:
return x.toLocaleString("en").replace(r"/,/g", "")
else:
return Num... | 28.208163 | 88 | 0.444509 |
from domonic.javascript import Array, Global, Math, Number, RegExp, String
def formatDecimal(x, ignore=None):
x = Math.round(x)
if Math.abs(x) >= 1e21:
return x.toLocaleString("en").replace(r"/,/g", "")
else:
return Number(x).toString(10)
def formatDecimalParts(x, p=None):
x = Numbe... | true | true |
1c0cd80b0f1b936da1179b6f90cb6677e18d3db1 | 2,215 | py | Python | rlpyt/utils/array.py | nirbhayjm/rlpyt | a2741201bbf33f5408306198d220d90f8f7b7250 | [
"MIT"
] | null | null | null | rlpyt/utils/array.py | nirbhayjm/rlpyt | a2741201bbf33f5408306198d220d90f8f7b7250 | [
"MIT"
] | null | null | null | rlpyt/utils/array.py | nirbhayjm/rlpyt | a2741201bbf33f5408306198d220d90f8f7b7250 | [
"MIT"
] | null | null | null | import numpy as np
def select_at_indexes(indexes, array):
"""Returns the contents of ``array`` at the multi-dimensional integer
array ``indexes``. Leading dimensions of ``array`` must match the
dimensions of ``indexes``.
"""
dim = len(indexes.shape)
assert indexes.shape == array.shape[:dim]
... | 36.916667 | 78 | 0.653725 | import numpy as np
def select_at_indexes(indexes, array):
dim = len(indexes.shape)
assert indexes.shape == array.shape[:dim]
num = int(np.prod(indexes.shape))
a_flat = array.reshape((num,) + array.shape[dim:])
s_flat = a_flat[np.arange(num), indexes.reshape(-1)]
selected = s_flat.reshape(array... | true | true |
1c0cd845bc7f219a3c99c1205fcf6e212a13f7c9 | 39 | py | Python | modules/2.79/bpy/types/ShaderNodeMixShader.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/ShaderNodeMixShader.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/ShaderNodeMixShader.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | class ShaderNodeMixShader:
pass
| 6.5 | 26 | 0.717949 | class ShaderNodeMixShader:
pass
| true | true |
1c0cd84f42ffb2261d70dbad034cd99eb9ba1b90 | 175 | py | Python | xhr/resources/invalid-utf8-html.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | xhr/resources/invalid-utf8-html.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | xhr/resources/invalid-utf8-html.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | from six import int2byte
def main(request, response):
headers = [(b"Content-type", b"text/html;charset=utf-8")]
content = int2byte(0xff)
return headers, content
| 21.875 | 61 | 0.691429 | from six import int2byte
def main(request, response):
headers = [(b"Content-type", b"text/html;charset=utf-8")]
content = int2byte(0xff)
return headers, content
| true | true |
1c0cd888699db42b41af35ff5bfd1a2088184686 | 4,480 | py | Python | lib/B23_findCoeff.py | GabrielCi77/ProjetInfo2021 | ec40c6ae857e895f47c7740f8745dd428b729a24 | [
"MIT"
] | null | null | null | lib/B23_findCoeff.py | GabrielCi77/ProjetInfo2021 | ec40c6ae857e895f47c7740f8745dd428b729a24 | [
"MIT"
] | null | null | null | lib/B23_findCoeff.py | GabrielCi77/ProjetInfo2021 | ec40c6ae857e895f47c7740f8745dd428b729a24 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.linear_model import Lasso, Ridge
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import r2_score, mean_squared_error
import matplotlib.pyplot as plt
# Fonction qu'on peut teste... | 29.668874 | 93 | 0.666964 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.linear_model import Lasso, Ridge
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import r2_score, mean_squared_error
import matplotlib.pyplot as plt
def findBestCoeff(df_data,... | true | true |
1c0cd8e261e051ad5e4d59ae86d24c1e18b0c02f | 11,519 | py | Python | src/pip/_internal/utils/logging.py | infinite-skx/pip | 7f8a6844037fb7255cfd0d34ff8e8cf44f2598d4 | [
"MIT"
] | 1 | 2021-12-21T07:09:33.000Z | 2021-12-21T07:09:33.000Z | src/pip/_internal/utils/logging.py | infinite-skx/pip | 7f8a6844037fb7255cfd0d34ff8e8cf44f2598d4 | [
"MIT"
] | 5 | 2018-01-26T16:41:06.000Z | 2021-10-16T08:45:28.000Z | src/pip/_internal/utils/logging.py | infinite-skx/pip | 7f8a6844037fb7255cfd0d34ff8e8cf44f2598d4 | [
"MIT"
] | 6 | 2017-07-22T14:09:49.000Z | 2019-10-09T09:29:34.000Z | import contextlib
import errno
import logging
import logging.handlers
import os
import sys
import threading
from dataclasses import dataclass
from logging import Filter
from typing import IO, Any, ClassVar, Iterator, List, Optional, TextIO, Type
from pip._vendor.rich.console import (
Console,
ConsoleOptions,
... | 33.485465 | 88 | 0.587377 | import contextlib
import errno
import logging
import logging.handlers
import os
import sys
import threading
from dataclasses import dataclass
from logging import Filter
from typing import IO, Any, ClassVar, Iterator, List, Optional, TextIO, Type
from pip._vendor.rich.console import (
Console,
ConsoleOptions,
... | true | true |
1c0cd942cc70d8342d5fc6c592f754958c3c5578 | 2,153 | py | Python | notebooks/NLP_emb_lstm.py | rghosh8/capstone-2 | b7e16642a1f16123f3059db32497ba1c3c815f6f | [
"MIT"
] | 1 | 2020-08-24T00:23:33.000Z | 2020-08-24T00:23:33.000Z | notebooks/NLP_emb_lstm.py | rghosh8/capstone-2 | b7e16642a1f16123f3059db32497ba1c3c815f6f | [
"MIT"
] | null | null | null | notebooks/NLP_emb_lstm.py | rghosh8/capstone-2 | b7e16642a1f16123f3059db32497ba1c3c815f6f | [
"MIT"
] | null | null | null | import pandas as pd
import tensorflow as tf
from tensorflow.keras import layers
from keras.models import Sequential
from keras.layers import Dense, Dropout, LSTM, Activation, Embedding, GlobalAveragePooling1D
from sklearn_pipeline import *
class NLP_emb_lstm(object):
def __init__(self, att, target, embedding_dim):... | 39.87037 | 151 | 0.68602 | import pandas as pd
import tensorflow as tf
from tensorflow.keras import layers
from keras.models import Sequential
from keras.layers import Dense, Dropout, LSTM, Activation, Embedding, GlobalAveragePooling1D
from sklearn_pipeline import *
class NLP_emb_lstm(object):
def __init__(self, att, target, embedding_dim):... | true | true |
1c0cd9d18827ad61a8bc597cfbac6c8c485c049d | 26,380 | py | Python | vkwave/api/methods/video.py | YorkDW/vkwave | 86b0278f15f398217a8211007c44651b6145831b | [
"MIT"
] | null | null | null | vkwave/api/methods/video.py | YorkDW/vkwave | 86b0278f15f398217a8211007c44651b6145831b | [
"MIT"
] | null | null | null | vkwave/api/methods/video.py | YorkDW/vkwave | 86b0278f15f398217a8211007c44651b6145831b | [
"MIT"
] | null | null | null | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Video(Category):
async def add(
self,
video_id: int,
owner_id: int,
return_raw_response: bool = False,
target_id: typing.Optional[int] = None,
) -> typing.Union[di... | 37.739628 | 381 | 0.618954 | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Video(Category):
async def add(
self,
video_id: int,
owner_id: int,
return_raw_response: bool = False,
target_id: typing.Optional[int] = None,
) -> typing.Union[di... | true | true |
1c0cd9d34da7568a32e95ba599b86a41d58d4ea5 | 4,741 | py | Python | test/functional/rpc_deriveaddresses.py | driyal/driyal | 7bcf75dc7e6df61243760071cff4b7bfd72f1535 | [
"MIT"
] | null | null | null | test/functional/rpc_deriveaddresses.py | driyal/driyal | 7bcf75dc7e6df61243760071cff4b7bfd72f1535 | [
"MIT"
] | null | null | null | test/functional/rpc_deriveaddresses.py | driyal/driyal | 7bcf75dc7e6df61243760071cff4b7bfd72f1535 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The DRiyal Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the deriveaddresses rpc call."""
from test_framework.test_framework import DRiyalTestFramework
from... | 86.2 | 297 | 0.821978 | from test_framework.test_framework import DRiyalTestFramework
from test_framework.descriptors import descsum_create
from test_framework.util import assert_equal, assert_raises_rpc_error
class DeriveaddressesTest(DRiyalTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
... | true | true |
1c0cdb21e109df8b056f20ce14d1c596cdf7176b | 1,902 | py | Python | procgame/config.py | Curbfeeler/PinbotFromES | e12734afa37c4c0accef762f39d42503392c8f5b | [
"MIT"
] | null | null | null | procgame/config.py | Curbfeeler/PinbotFromES | e12734afa37c4c0accef762f39d42503392c8f5b | [
"MIT"
] | null | null | null | procgame/config.py | Curbfeeler/PinbotFromES | e12734afa37c4c0accef762f39d42503392c8f5b | [
"MIT"
] | null | null | null | import os
import yaml
import logging
values = None
"""The configuration data structure loaded from :file:`~/.pyprocgame/config.yaml` when this submodule is loaded."""
path = None
"""Path that the configuration data structure was loaded from, by :meth:`load`."""
def value_for_key_path(keypath, default=None):
"""R... | 35.886792 | 136 | 0.647213 | import os
import yaml
import logging
values = None
"""The configuration data structure loaded from :file:`~/.pyprocgame/config.yaml` when this submodule is loaded."""
path = None
"""Path that the configuration data structure was loaded from, by :meth:`load`."""
def value_for_key_path(keypath, default=None):
"""R... | false | true |
1c0cdb296b5b6e30e1b61128a9c13f7359bb0200 | 802 | py | Python | tests/so_test.py | jtara1/VisualScripting | 66a424baad1d60c2e73fcb342c2797dd6c00e8b8 | [
"Apache-2.0"
] | null | null | null | tests/so_test.py | jtara1/VisualScripting | 66a424baad1d60c2e73fcb342c2797dd6c00e8b8 | [
"Apache-2.0"
] | null | null | null | tests/so_test.py | jtara1/VisualScripting | 66a424baad1d60c2e73fcb342c2797dd6c00e8b8 | [
"Apache-2.0"
] | null | null | null | from tkinter import *
class MyCanvas:
def __init__(self,
categories):
self.categories = categories
self._current_category = categories[0]
self._window = None
self._main()
def _main(self):
master = Tk()
self._window = Canvas(master, width=200, ... | 25.0625 | 97 | 0.627182 | from tkinter import *
class MyCanvas:
def __init__(self,
categories):
self.categories = categories
self._current_category = categories[0]
self._window = None
self._main()
def _main(self):
master = Tk()
self._window = Canvas(master, width=200, ... | true | true |
1c0cdc7d294931b6e13f335e3605f28312d69d2a | 5,352 | py | Python | web_scrap_single_page.py | panashematsaudza/Python-Scraping-to-Database-Sample | 74fa31868df388eef2a72db5a995854c17626934 | [
"Apache-2.0"
] | null | null | null | web_scrap_single_page.py | panashematsaudza/Python-Scraping-to-Database-Sample | 74fa31868df388eef2a72db5a995854c17626934 | [
"Apache-2.0"
] | null | null | null | web_scrap_single_page.py | panashematsaudza/Python-Scraping-to-Database-Sample | 74fa31868df388eef2a72db5a995854c17626934 | [
"Apache-2.0"
] | null | null | null |
import requests
import MySQLdb
from bs4 import BeautifulSoup
#SQL connection data to connect and save the data in
HOST = "localhost"
USERNAME = "root"
PASSWORD = ""
DATABASE = "webscrap"
#URL to be scraped
url_to_scrape = 'https://howpcrules.com/sample-page-for-web-scraping/'
#Load html's plain data into a variable... | 43.868852 | 571 | 0.667601 |
import requests
import MySQLdb
from bs4 import BeautifulSoup
HOST = "localhost"
USERNAME = "root"
PASSWORD = ""
DATABASE = "webscrap"
url_to_scrape = 'https://howpcrules.com/sample-page-for-web-scraping/'
plain_html_text = requests.get(url_to_scrape)
#parse the data
soup = BeautifulSoup(plain_html_text.text, "html.... | true | true |
1c0cdd814facfb5b8bc24a5a80e50d611fbb9168 | 1,648 | py | Python | setup.py | annapasca/ephypype | 6dbacdd6913234a28b690b401862ff062accecc7 | [
"BSD-3-Clause"
] | 18 | 2018-04-18T12:14:52.000Z | 2022-02-25T19:31:44.000Z | setup.py | annapasca/ephypype | 6dbacdd6913234a28b690b401862ff062accecc7 | [
"BSD-3-Clause"
] | 106 | 2017-12-09T13:34:30.000Z | 2022-03-12T01:02:17.000Z | setup.py | annapasca/ephypype | 6dbacdd6913234a28b690b401862ff062accecc7 | [
"BSD-3-Clause"
] | 13 | 2017-05-28T20:38:56.000Z | 2022-03-06T15:58:02.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup configuration."""
import os
from setuptools import setup, find_packages
required_packages=[
"nipype", "networkx>=2.0", "numpy", "mne", "pybids", "h5py","scikit-learn", "matplotlib", "mne-bids"]
VERSION = None
with open(os.path.join('ephypype', '__init__.py')... | 30.518519 | 113 | 0.64199 |
import os
from setuptools import setup, find_packages
required_packages=[
"nipype", "networkx>=2.0", "numpy", "mne", "pybids", "h5py","scikit-learn", "matplotlib", "mne-bids"]
VERSION = None
with open(os.path.join('ephypype', '__init__.py'), 'r') as fid:
for line in (line.strip() for line in fid):
if... | true | true |
1c0cddaa27f3ad49b3d8af2c7463e415539ee14f | 1,435 | py | Python | fake_agent/fake_agent/lib.py | LeGroupeDeFer/IAM | 643fd3bec6dee755d3f709e55d81ea6c4f87ebc0 | [
"MIT"
] | null | null | null | fake_agent/fake_agent/lib.py | LeGroupeDeFer/IAM | 643fd3bec6dee755d3f709e55d81ea6c4f87ebc0 | [
"MIT"
] | 25 | 2020-10-13T12:44:40.000Z | 2021-08-09T06:42:12.000Z | fake_agent/fake_agent/lib.py | LeGroupeDeFer/IAM | 643fd3bec6dee755d3f709e55d81ea6c4f87ebc0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
from datetime import datetime
from random import uniform
from decimal import Decimal
from os.path import expanduser, isabs, join
from json import JSONEncoder
from typing import Dict, Any, Tuple
NANO = Decimal('0.000000001')
CENTI = Decimal('0.01')
MILLI = Decimal('0.001')
cl... | 23.145161 | 60 | 0.642509 | import sys
from datetime import datetime
from random import uniform
from decimal import Decimal
from os.path import expanduser, isabs, join
from json import JSONEncoder
from typing import Dict, Any, Tuple
NANO = Decimal('0.000000001')
CENTI = Decimal('0.01')
MILLI = Decimal('0.001')
class MetaDict(type):
... | true | true |
1c0cde313163ef5480cffa2fe9f27cd0018525b9 | 357 | py | Python | Tools/Thread.py | wudinaonao/ProxyPool | 80c40917fc88bc608f7887ef7622964104c3f987 | [
"MIT"
] | null | null | null | Tools/Thread.py | wudinaonao/ProxyPool | 80c40917fc88bc608f7887ef7622964104c3f987 | [
"MIT"
] | null | null | null | Tools/Thread.py | wudinaonao/ProxyPool | 80c40917fc88bc608f7887ef7622964104c3f987 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.path.split(os.path.dirname(os.path.abspath(__file__)))[0])
import threading
class Thread(threading.Thread):
# create a thread
def __init__(self, threadName, spider):
super().__init__()
self.name = threadName
self.spider = spider
def r... | 19.833333 | 77 | 0.652661 | import os
import sys
sys.path.append(os.path.split(os.path.dirname(os.path.abspath(__file__)))[0])
import threading
class Thread(threading.Thread):
def __init__(self, threadName, spider):
super().__init__()
self.name = threadName
self.spider = spider
def run(self):
... | true | true |
1c0cde80edec0881c44a1acc51ec36088c5ce9bf | 923 | py | Python | bundlebuilder/models/secondary/kill_chain_phase.py | CiscoSecurity/tr-05-ctim-bundle-builder | fe4f1e877112aebc5f79ec04b6c74dc9e9f0113a | [
"MIT"
] | 3 | 2019-12-11T00:21:26.000Z | 2020-11-02T18:16:36.000Z | bundlebuilder/models/secondary/kill_chain_phase.py | CiscoSecurity/tr-05-ctim-bundle-builder | fe4f1e877112aebc5f79ec04b6c74dc9e9f0113a | [
"MIT"
] | null | null | null | bundlebuilder/models/secondary/kill_chain_phase.py | CiscoSecurity/tr-05-ctim-bundle-builder | fe4f1e877112aebc5f79ec04b6c74dc9e9f0113a | [
"MIT"
] | 2 | 2020-06-29T18:40:37.000Z | 2020-07-31T20:16:47.000Z | from marshmallow.decorators import post_load
from ..entity import (
EntitySchema,
SecondaryEntity,
)
from ..fields import StringField
from ..validators import validate_string
class KillChainPhaseSchema(EntitySchema):
"""
https://github.com/threatgrid/ctim/blob/master/doc/structures/indicator.md#killc... | 24.945946 | 100 | 0.63597 | from marshmallow.decorators import post_load
from ..entity import (
EntitySchema,
SecondaryEntity,
)
from ..fields import StringField
from ..validators import validate_string
class KillChainPhaseSchema(EntitySchema):
kill_chain_name = StringField(
validate=validate_string,
required=True,... | true | true |
1c0cdeaa3f87402ce1861732a85250186c601614 | 6,734 | py | Python | appengine/chromium_status_py3/tests/local_gae.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | appengine/chromium_status_py3/tests/local_gae.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/chromium_status_py3/tests/local_gae.py | NDevTK/chromium-infra | d38e088e158d81f7f2065a38aa1ea1894f735ec4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Setups a local GAE instance to test against a live server for integration
tests.
It makes sure Google AppEngine SDK is found and starts the server on ... | 28.777778 | 80 | 0.644045 |
import cookielib
import errno
import logging
import os
import re
import socket
import subprocess
import tempfile
import time
import sys
import urllib
import urllib2
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
GAE_SDK = None
def _load_modules():
global GAE_SDK
if GAE_SDK:
return
root_dir = BASE_D... | true | true |
1c0cdfc91696a9bb600d3ee4e0516a79a55844ed | 168 | py | Python | setup.py | alterway/rating-api | 2fc457204694473d79ac0090fa6ca3fb7a9d719a | [
"Apache-2.0"
] | null | null | null | setup.py | alterway/rating-api | 2fc457204694473d79ac0090fa6ca3fb7a9d719a | [
"Apache-2.0"
] | 1 | 2020-06-26T15:04:52.000Z | 2020-06-26T15:04:52.000Z | setup.py | alterway/rating-api | 2fc457204694473d79ac0090fa6ca3fb7a9d719a | [
"Apache-2.0"
] | null | null | null | """
rating.api setup.
Provide packaging operations through ``python setup.py [command]`` and
``pip install options .[...]``
"""
from setuptools import setup
setup()
| 15.272727 | 70 | 0.696429 |
from setuptools import setup
setup()
| true | true |
1c0cdfe0f03fdc54c281adb48e93363766f6679a | 61,217 | py | Python | qcdb/intf_nwchem/harvester.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcdb/intf_nwchem/harvester.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcdb/intf_nwchem/harvester.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | import re
import sys
import uuid
import struct
from collections import defaultdict
from decimal import Decimal
from ..pdict import PreservingDict
#from ..periodictable import *
#from ..physconst import *
from ..exceptions import *
from ..molecule import Molecule
from ..orient import OrientMols
from decimal import Deci... | 43.262898 | 157 | 0.518418 | import re
import sys
import uuid
import struct
from collections import defaultdict
from decimal import Decimal
from ..pdict import PreservingDict
from ..exceptions import *
from ..molecule import Molecule
from ..orient import OrientMols
from decimal import Decimal
from ..moptions.options import conv_float2negexp
def... | true | true |
1c0ce0c44fa7895de2ae628f592aee59a75d198f | 8,149 | py | Python | contrib/devtools/update-translations.py | coinwebfactory/aiascoin | c8741cad5264a2d4c0bbca7813c4f4ad390915ae | [
"MIT"
] | 1 | 2021-02-26T00:23:51.000Z | 2021-02-26T00:23:51.000Z | contrib/devtools/update-translations.py | coinwebfactory/aiascoin | c8741cad5264a2d4c0bbca7813c4f4ad390915ae | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | coinwebfactory/aiascoin | c8741cad5264a2d4c0bbca7813c4f4ad390915ae | [
"MIT"
] | 4 | 2018-07-30T04:58:29.000Z | 2020-05-26T17:54:59.000Z | #!/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.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | 38.620853 | 124 | 0.63382 | from __future__ import division, print_function
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'aias_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
print('No .gi... | true | true |
1c0ce14ad01374aeffbf3a4c57180c5d94acde19 | 278 | py | Python | trunk/src/Web/Warrentech_FontCenter_Web/manage.py | Xiongpq/FontCenter | f59a431608840935d4c37aa2e7b0b33ba1cf7ac3 | [
"MIT"
] | 22 | 2015-09-21T01:21:28.000Z | 2022-03-26T11:16:06.000Z | trunk/src/Web/Warrentech_FontCenter_Web/manage.py | Xiongpq/FontCenter | f59a431608840935d4c37aa2e7b0b33ba1cf7ac3 | [
"MIT"
] | 1 | 2018-09-14T14:00:13.000Z | 2018-09-17T03:48:59.000Z | trunk/src/Web/Warrentech_FontCenter_Web/manage.py | Xiongpq/FontCenter | f59a431608840935d4c37aa2e7b0b33ba1cf7ac3 | [
"MIT"
] | 11 | 2017-11-16T12:40:26.000Z | 2021-08-20T23:41:26.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Warrentech_FontCenter_Web.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 25.272727 | 90 | 0.758993 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Warrentech_FontCenter_Web.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c0ce1b15ffd3d41aa0fac0ab7d672f1993d5b03 | 420 | py | Python | app/wrapper/migrations/0015_transaction_actor_entity.py | Sirius-social/TMTM | 5b4d426e358fc9fd6cff7ec84861c0388d3785ce | [
"Apache-2.0"
] | null | null | null | app/wrapper/migrations/0015_transaction_actor_entity.py | Sirius-social/TMTM | 5b4d426e358fc9fd6cff7ec84861c0388d3785ce | [
"Apache-2.0"
] | null | null | null | app/wrapper/migrations/0015_transaction_actor_entity.py | Sirius-social/TMTM | 5b4d426e358fc9fd6cff7ec84861c0388d3785ce | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2021-03-02 13:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wrapper', '0014_transaction_created'),
]
operations = [
migrations.AddField(
model_name='transaction',
name='actor_ent... | 22.105263 | 76 | 0.619048 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wrapper', '0014_transaction_created'),
]
operations = [
migrations.AddField(
model_name='transaction',
name='actor_entity',
field=models.CharField(db_in... | true | true |
1c0ce1d16de97e0523d6dfc427ab933b580de863 | 7,203 | py | Python | uer/opts.py | linwhitehat/ET-BERT | 32a2109ae7d0e7dc83cf1a151e9611601e2b5dd6 | [
"MIT"
] | 16 | 2022-02-13T08:06:16.000Z | 2022-03-28T01:34:44.000Z | uer/opts.py | JieJayCao/ET-BERT | f6cddb27bd4c926faa64092579c117155055fa76 | [
"MIT"
] | 4 | 2022-02-28T09:30:42.000Z | 2022-03-29T05:42:32.000Z | uer/opts.py | JieJayCao/ET-BERT | f6cddb27bd4c926faa64092579c117155055fa76 | [
"MIT"
] | 7 | 2022-02-15T08:20:23.000Z | 2022-03-31T05:55:25.000Z | def model_opts(parser):
parser.add_argument("--embedding", choices=["word", "word_pos", "word_pos_seg", "word_sinusoidalpos"], default="word_pos_seg",
help="Emebdding type.")
parser.add_argument("--max_seq_length", type=int, default=512,
help="Max sequence length ... | 61.042373 | 134 | 0.531029 | def model_opts(parser):
parser.add_argument("--embedding", choices=["word", "word_pos", "word_pos_seg", "word_sinusoidalpos"], default="word_pos_seg",
help="Emebdding type.")
parser.add_argument("--max_seq_length", type=int, default=512,
help="Max sequence length ... | true | true |
1c0ce2011dbb6603f74eaddabdd230d193e56aca | 24,294 | py | Python | scripts/experiment_launchers/experiment_launcher_generic.py | iKernels/RelTextRank | 0f773fca83bb23f9a159c2da1635597a089ca7e0 | [
"Apache-2.0"
] | 13 | 2017-04-05T15:28:27.000Z | 2021-07-23T12:26:18.000Z | scripts/experiment_launchers/experiment_launcher_generic.py | iKernels/RelTextRank | 0f773fca83bb23f9a159c2da1635597a089ca7e0 | [
"Apache-2.0"
] | 1 | 2019-04-04T11:28:47.000Z | 2019-04-04T11:28:47.000Z | scripts/experiment_launchers/experiment_launcher_generic.py | iKernels/RelTextRank | 0f773fca83bb23f9a159c2da1635597a089ca7e0 | [
"Apache-2.0"
] | 6 | 2017-06-15T21:36:44.000Z | 2021-03-01T09:11:01.000Z | __author__ = 'kateryna'
import os
import logging
import argparse
import time
'''
The script generates a shell script to run
data generation, training and testing on the different corpora
Run the script without parameters to see what it does
'''
QUESTION_FILE = 0
ANSWER_FILE = 1
CAS = 2
CAND_TO_USE = 3
FEATURES_VALU... | 48.011858 | 164 | 0.581584 | __author__ = 'kateryna'
import os
import logging
import argparse
import time
'''
The script generates a shell script to run
data generation, training and testing on the different corpora
Run the script without parameters to see what it does
'''
QUESTION_FILE = 0
ANSWER_FILE = 1
CAS = 2
CAND_TO_USE = 3
FEATURES_VALU... | false | true |
1c0ce270cf2484470af5b4d041e94ba7c5223d05 | 13,593 | py | Python | symphony/bdk/gen/pod_model/user_app_entitlement.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | symphony/bdk/gen/pod_model/user_app_entitlement.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | symphony/bdk/gen/pod_model/user_app_entitlement.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | """
Pod API
This document refers to Symphony API calls that do not need encryption or decryption of content. - sessionToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined... | 46.077966 | 637 | 0.584933 |
import re import sys from typing import List, Union
from symphony.bdk.gen.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
val... | true | true |
1c0ce2ccf78966800d5dcd64cf3915410302c38b | 11,644 | py | Python | src/gentask.py | lslll0302/Planner-Carrier | 7611a02118f11b06533144c5e034f7938fb90068 | [
"zlib-acknowledgement",
"CNRI-Python",
"OML",
"Linux-OpenIB"
] | 5 | 2020-08-24T07:29:59.000Z | 2020-08-30T14:22:47.000Z | src/gentask.py | lslll0302/Planner-Carrier | 7611a02118f11b06533144c5e034f7938fb90068 | [
"zlib-acknowledgement",
"CNRI-Python",
"OML",
"Linux-OpenIB"
] | 9 | 2020-09-03T18:58:53.000Z | 2020-10-14T11:42:12.000Z | src/gentask.py | lslll0302/Eval-of-FOND-planners- | 7611a02118f11b06533144c5e034f7938fb90068 | [
"zlib-acknowledgement",
"CNRI-Python",
"OML",
"Linux-OpenIB"
] | null | null | null | import pandas as pd
import os
import re
import planner
#import mysql.connector
#from mysql.connector import Error
import utils
list_benchmarks=os.listdir(utils.BENCHMARK_PATH)
list_benchmarks.sort()
def listdir(path, char_):
list_ = []
for file in os.listdir(path):
file_path = os.path.join(path, f... | 30.885942 | 141 | 0.57214 | import pandas as pd
import os
import re
import planner
import utils
list_benchmarks=os.listdir(utils.BENCHMARK_PATH)
list_benchmarks.sort()
def listdir(path, char_):
list_ = []
for file in os.listdir(path):
file_path = os.path.join(path, file)
if os.path.isdir(file_path):
pass ... | true | true |
1c0ce34a285811fb12fce1cdeab8cde24cd7ed09 | 1,168 | py | Python | RNAPuzzles/rnapuzzles/views/user/newPassword.py | whinyadventure/RNA-Puzzles | bbd147e1a0748a77b5e3424a93ad57bb430b5a0e | [
"Apache-2.0"
] | null | null | null | RNAPuzzles/rnapuzzles/views/user/newPassword.py | whinyadventure/RNA-Puzzles | bbd147e1a0748a77b5e3424a93ad57bb430b5a0e | [
"Apache-2.0"
] | 26 | 2019-10-08T11:11:25.000Z | 2022-03-12T00:52:30.000Z | RNAPuzzles/rnapuzzles/views/user/newPassword.py | whinyadventure/RNA-Puzzles | bbd147e1a0748a77b5e3424a93ad57bb430b5a0e | [
"Apache-2.0"
] | 1 | 2020-05-11T18:51:04.000Z | 2020-05-11T18:51:04.000Z | from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponseRedirect
from django.views.generic.edit import UpdateView
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.http import urlsafe_base64_decode
from django.shortcuts import render... | 32.444444 | 71 | 0.723459 | from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponseRedirect
from django.views.generic.edit import UpdateView
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.http import urlsafe_base64_decode
from django.shortcuts import render... | true | true |
1c0ce3d20fcc565450aaeb2966bd84d9f8bb4b59 | 1,660 | py | Python | bspump/file/filecsvsource.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 17 | 2019-02-14T09:26:03.000Z | 2022-03-11T09:23:52.000Z | bspump/file/filecsvsource.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 91 | 2019-05-06T18:59:02.000Z | 2022-01-11T06:22:32.000Z | bspump/file/filecsvsource.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 10 | 2019-04-23T08:48:58.000Z | 2022-02-13T14:24:28.000Z | import csv
import logging
import os
from .fileabcsource import FileABCSource
L = logging.getLogger(__file__)
class FileCSVSource(FileABCSource):
ConfigDefaults = {
'mode': 'r',
'newline': '', # Required by CSV parser
'dialect': 'excel',
'delimiter': ',',
'doublequote': True,
'escapechar': "",
'li... | 19.08046 | 74 | 0.651807 | import csv
import logging
import os
from .fileabcsource import FileABCSource
L = logging.getLogger(__file__)
class FileCSVSource(FileABCSource):
ConfigDefaults = {
'mode': 'r',
'newline': '', 'dialect': 'excel',
'delimiter': ',',
'doublequote': True,
'escapechar': "",
'lineterminator': os.linesep... | true | true |
1c0ce4f76573db42bde5c6bdea7cb08e9712542e | 1,786 | py | Python | dcm_com/scripts/connect.py | Shedino/RoverHighLevel | e1e55e69bae7a73163cb63de0bd4f57d5bfd65b8 | [
"CC0-1.0"
] | null | null | null | dcm_com/scripts/connect.py | Shedino/RoverHighLevel | e1e55e69bae7a73163cb63de0bd4f57d5bfd65b8 | [
"CC0-1.0"
] | null | null | null | dcm_com/scripts/connect.py | Shedino/RoverHighLevel | e1e55e69bae7a73163cb63de0bd4f57d5bfd65b8 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
import sys
sys.path.append('/home/sherpa/pySWM')
import math
import rospy
import tf
import swm
from custom_msgs.msg import positionEstimate
from custom_msgs.msg import orientationEstimate
agentName = "donkey"
currentRoll = 0
currentPitch = 0
currentYaw = 0
currentLat = 0
currentLon = 0
currentAl... | 38 | 240 | 0.705487 | import sys
sys.path.append('/home/sherpa/pySWM')
import math
import rospy
import tf
import swm
from custom_msgs.msg import positionEstimate
from custom_msgs.msg import orientationEstimate
agentName = "donkey"
currentRoll = 0
currentPitch = 0
currentYaw = 0
currentLat = 0
currentLon = 0
currentAlt = 0
def updateAttit... | false | true |
1c0ce59677bf6cf4741adb53d710666665dec3ef | 15,272 | py | Python | rasa/core/featurizers/single_state_featurizer.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 9,701 | 2019-04-16T15:46:27.000Z | 2022-03-31T11:52:18.000Z | rasa/core/featurizers/single_state_featurizer.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 6,420 | 2019-04-16T15:58:22.000Z | 2022-03-31T17:54:35.000Z | rasa/core/featurizers/single_state_featurizer.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 3,063 | 2019-04-16T15:23:52.000Z | 2022-03-31T00:01:12.000Z | import logging
import numpy as np
import scipy.sparse
from typing import List, Optional, Dict, Text, Set, Any
from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
from rasa.nlu.extractors.extractor import EntityTagSpec
from rasa.nlu.utils import bilou_utils
from rasa.nlu.utils.bilou_ut... | 37.895782 | 88 | 0.62369 | import logging
import numpy as np
import scipy.sparse
from typing import List, Optional, Dict, Text, Set, Any
from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
from rasa.nlu.extractors.extractor import EntityTagSpec
from rasa.nlu.utils import bilou_utils
from rasa.nlu.utils.bilou_ut... | true | true |
1c0ce79b2fac258ba9736e928a97ad77b85d5d59 | 315 | py | Python | Exercicios/Resposta-ExerciciosFuncoes/Exerc_9.py | ThaisAlves7/Exercicios_PythonBrasil | 3c55f56c44b4da9953a79398859e7c73a155dc0e | [
"MIT"
] | null | null | null | Exercicios/Resposta-ExerciciosFuncoes/Exerc_9.py | ThaisAlves7/Exercicios_PythonBrasil | 3c55f56c44b4da9953a79398859e7c73a155dc0e | [
"MIT"
] | null | null | null | Exercicios/Resposta-ExerciciosFuncoes/Exerc_9.py | ThaisAlves7/Exercicios_PythonBrasil | 3c55f56c44b4da9953a79398859e7c73a155dc0e | [
"MIT"
] | null | null | null | # Reverso do número. Faça uma função que retorne o reverso de um número inteiro informado. Por exemplo: 127 -> 721.
def reverso(num):
palavra = str(num)
palavra_reverso = palavra[::-1]
print(f'O numero {num} invertido é {palavra_reverso}')
numero = int(input('Informe um numero: '))
reverso(numero)
| 26.25 | 115 | 0.698413 |
def reverso(num):
palavra = str(num)
palavra_reverso = palavra[::-1]
print(f'O numero {num} invertido é {palavra_reverso}')
numero = int(input('Informe um numero: '))
reverso(numero)
| true | true |
1c0ce7e98e89bf21ca869777b7866ce5284e7e25 | 1,637 | py | Python | scripts/movie_tool.py | isabella232/eclipse2017 | a328c6d437638b1fe89aa8a24579406f01fe970d | [
"Apache-2.0"
] | 18 | 2017-03-17T18:10:55.000Z | 2022-03-30T17:35:55.000Z | scripts/movie_tool.py | google/eclipse2017 | a328c6d437638b1fe89aa8a24579406f01fe970d | [
"Apache-2.0"
] | 1 | 2021-06-27T16:01:10.000Z | 2021-06-27T16:21:50.000Z | scripts/movie_tool.py | isabella232/eclipse2017 | a328c6d437638b1fe89aa8a24579406f01fe970d | [
"Apache-2.0"
] | 8 | 2017-03-28T13:34:50.000Z | 2021-06-27T15:39:10.000Z | #
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 34.104167 | 78 | 0.750764 |
"""Map image data."""
import logging
import argparse
from google.cloud import datastore, storage
import movie.pipeline
from common import config, constants
from common.chunks import chunks
DEFAULT_PROJECT = 'eclipse-2017-test'
def get_arguments():
parser = argparse.ArgumentParser(description='Map image data.')
... | false | true |
1c0ce8ad76f4906a2dc28c42714806dde909bfac | 43 | py | Python | demo.py | thomas-marquis/immo-tools-lib | 455d726923ad723b099ee098e8ded7e28942904c | [
"MIT"
] | null | null | null | demo.py | thomas-marquis/immo-tools-lib | 455d726923ad723b099ee098e8ded7e28942904c | [
"MIT"
] | null | null | null | demo.py | thomas-marquis/immo-tools-lib | 455d726923ad723b099ee098e8ded7e28942904c | [
"MIT"
] | null | null | null | import numpy as np
ones = np.ones((3, 3))
| 10.75 | 22 | 0.627907 | import numpy as np
ones = np.ones((3, 3))
| true | true |
1c0ce8ef7d7dd81e441ffa18cf193876600433ac | 4,878 | py | Python | selfdrive/locationd/calibrationd.py | MikeFotta/openpilot | 05d46fe18fa25013658a2d1fe4b96adbb72cf0fb | [
"MIT"
] | 1 | 2019-05-28T20:48:54.000Z | 2019-05-28T20:48:54.000Z | selfdrive/locationd/calibrationd.py | cyoung/openpilot | 0c6cdd29a45a4b795fcf671ba0c3fac057ee68a0 | [
"MIT"
] | null | null | null | selfdrive/locationd/calibrationd.py | cyoung/openpilot | 0c6cdd29a45a4b795fcf671ba0c3fac057ee68a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import zmq
import copy
import json
import numpy as np
import selfdrive.messaging as messaging
from selfdrive.locationd.calibration_helpers import Calibration
from selfdrive.swaglog import cloudlog
from selfdrive.services import service_list
from common.params import Params
from common.tr... | 39.024 | 126 | 0.733292 | import os
import zmq
import copy
import json
import numpy as np
import selfdrive.messaging as messaging
from selfdrive.locationd.calibration_helpers import Calibration
from selfdrive.swaglog import cloudlog
from selfdrive.services import service_list
from common.params import Params
from common.transformations.model im... | false | true |
1c0ce901f56c9d18adb3d65ce0a488c59764eac9 | 2,002 | py | Python | src/test_view.py | leoconst/3d-rendering | 367edff151513a3ccbc0a2b9e6e44d5cc72413bd | [
"MIT"
] | 1 | 2021-03-09T15:53:52.000Z | 2021-03-09T15:53:52.000Z | src/test_view.py | leoconst/3d-rendering | 367edff151513a3ccbc0a2b9e6e44d5cc72413bd | [
"MIT"
] | null | null | null | src/test_view.py | leoconst/3d-rendering | 367edff151513a3ccbc0a2b9e6e44d5cc72413bd | [
"MIT"
] | null | null | null | from math import isclose
import pytest
from view import Point
class TestPoint:
def setup(self):
self.point = Point(2.1, -.3, 4)
def test_slots(self):
self.point.x = -.7
self.point.y += 3
assert self.point == Point(-0.7, 2.7, 4)
with pytest.raises(A... | 27.054054 | 73 | 0.541459 | from math import isclose
import pytest
from view import Point
class TestPoint:
def setup(self):
self.point = Point(2.1, -.3, 4)
def test_slots(self):
self.point.x = -.7
self.point.y += 3
assert self.point == Point(-0.7, 2.7, 4)
with pytest.raises(A... | true | true |
1c0cebb60ee75588d2a8f1fc3090b96bd278911f | 11,828 | py | Python | wbb/__main__.py | risswazowlsky/Zen-Robot | 198a35a319e799a55b18564ebcbc4dd131dd4bdc | [
"MIT"
] | null | null | null | wbb/__main__.py | risswazowlsky/Zen-Robot | 198a35a319e799a55b18564ebcbc4dd131dd4bdc | [
"MIT"
] | null | null | null | wbb/__main__.py | risswazowlsky/Zen-Robot | 198a35a319e799a55b18564ebcbc4dd131dd4bdc | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 TheHamkerCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 31.881402 | 99 | 0.571102 | import asyncio
import importlib
import re
import uvloop
from pyrogram import filters, idle
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from wbb import (BOT_NAME, BOT_USERNAME, LOG_GROUP_ID,
aiohttpsession, app)
from wbb.modules import ALL_MODULES
from wbb.modules.sudoers imp... | true | true |
1c0cece56491674cc145bff01a15c7e7a8db589d | 7,699 | py | Python | utils.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | utils.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | utils.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | '''一些工具'''
from PIL import Image
import numpy
import os
import time
import random
import math
from matplotlib import pyplot
def segment(from_path,to_path,thre):
'''将模型的预测图进行阈值分割
阈值要小数,而且是 thre*(max-min)+min
'''
d=os.listdir(from_path)
for i in range(len(d)):
predict=numpy.array(Image.open(f... | 32.213389 | 102 | 0.587089 | from PIL import Image
import numpy
import os
import time
import random
import math
from matplotlib import pyplot
def segment(from_path,to_path,thre):
d=os.listdir(from_path)
for i in range(len(d)):
predict=numpy.array(Image.open(from_path+'\\'+d[i]))
ma=predict.max()
mi=predict.min()
... | true | true |
1c0ced40adf6b5e7b5d1f905ef0096f9d314c783 | 313 | py | Python | mjecv/calibration/__init__.py | mje-nz/mjecv | 9a02c005a0abc7d21594f65c348cfe5185c90184 | [
"MIT"
] | null | null | null | mjecv/calibration/__init__.py | mje-nz/mjecv | 9a02c005a0abc7d21594f65c348cfe5185c90184 | [
"MIT"
] | null | null | null | mjecv/calibration/__init__.py | mje-nz/mjecv | 9a02c005a0abc7d21594f65c348cfe5185c90184 | [
"MIT"
] | null | null | null | from . import checkerboards, intrinsics, rectification, targets
from .checkerboards import * # noqa
from .intrinsics import * # noqa
from .rectification import * # noqa
from .targets import * # noqa
__all__ = checkerboards.__all__ + intrinsics.__all__ + rectification.__all__
__all__.extend(targets.__all__)
| 34.777778 | 76 | 0.776358 | from . import checkerboards, intrinsics, rectification, targets
from .checkerboards import * from .intrinsics import * from .rectification import * from .targets import *
__all__ = checkerboards.__all__ + intrinsics.__all__ + rectification.__all__
__all__.extend(targets.__all__)
| true | true |
1c0cef40bd3cb0b13a930c6a80d902c1e783302b | 300 | py | Python | bdd/group_scenarios.py | Myppp/python_training | 39c919ea381d0ab0c2891650f5675dabdfd8e804 | [
"Apache-2.0"
] | null | null | null | bdd/group_scenarios.py | Myppp/python_training | 39c919ea381d0ab0c2891650f5675dabdfd8e804 | [
"Apache-2.0"
] | null | null | null | bdd/group_scenarios.py | Myppp/python_training | 39c919ea381d0ab0c2891650f5675dabdfd8e804 | [
"Apache-2.0"
] | null | null | null | from pytest_bdd import scenario
from .group_steps import *
@scenario('groups.feature', 'Add new group')
def test_add_new_group():
pass
@scenario('groups.feature', 'Delete a group')
def test_delete_group():
pass
@scenario('groups.feature', 'Edit a group')
def test_edit_group():
pass | 17.647059 | 45 | 0.72 | from pytest_bdd import scenario
from .group_steps import *
@scenario('groups.feature', 'Add new group')
def test_add_new_group():
pass
@scenario('groups.feature', 'Delete a group')
def test_delete_group():
pass
@scenario('groups.feature', 'Edit a group')
def test_edit_group():
pass | true | true |
1c0cf1833da3b1fecee2dc452131b02b57110d03 | 2,030 | py | Python | mmdet/ops/ops/rotated/rotate_roi_pool.py | qgh1223/SLRDet | f63335e9626067b462ad548c98f986e0d33addf9 | [
"Apache-2.0"
] | 27 | 2019-11-20T07:34:15.000Z | 2022-03-04T01:02:33.000Z | mmdet/ops/ops/rotated/rotate_roi_pool.py | qgh1223/SLRDet | f63335e9626067b462ad548c98f986e0d33addf9 | [
"Apache-2.0"
] | 5 | 2019-12-03T13:16:02.000Z | 2020-01-16T08:59:53.000Z | mmdet/ops/rotated/rotate_roi_pool.py | LUCKMOONLIGHT/SLRDet | f63335e9626067b462ad548c98f986e0d33addf9 | [
"Apache-2.0"
] | 5 | 2019-12-03T12:21:36.000Z | 2021-12-17T12:37:08.000Z | import torch
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from mmdet import _Custom as _C
from apex import amp
class _RROIPool(Function):
@staticmethod
def forward(ctx, input... | 29.42029 | 76 | 0.609852 | import torch
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from mmdet import _Custom as _C
from apex import amp
class _RROIPool(Function):
@staticmethod
def forward(ctx, input... | true | true |
1c0cf1d8f66b7eedfb6d82c1b10ffef1d8c276a1 | 6,049 | py | Python | cm_tools/saltstack/2016.3/salt/_modules/cloudutils.py | jojees/operations | bb1a242efbbf56c9afbe4b9e4b5aa14218720e2b | [
"MIT"
] | null | null | null | cm_tools/saltstack/2016.3/salt/_modules/cloudutils.py | jojees/operations | bb1a242efbbf56c9afbe4b9e4b5aa14218720e2b | [
"MIT"
] | 2 | 2019-09-22T11:24:19.000Z | 2019-09-22T11:38:49.000Z | cm_tools/saltstack/2016.3/salt/_modules/cloudutils.py | jojees/operations | bb1a242efbbf56c9afbe4b9e4b5aa14218720e2b | [
"MIT"
] | null | null | null | '''
Custom resources support for MVision Cloud Infrastructure.
'''
_OUTPUT = '--output json'
import requests
import json
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
def __virtual__():
'''
Only load if aws is avail... | 32.875 | 137 | 0.637461 |
_OUTPUT = '--output json'
import requests
import json
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
def __virtual__():
if __salt__['cmd.has_exec']('aws'):
return 'cloudutils'
return False, 'The module mvisio... | true | true |
1c0cf257e136bfb554380f278634d13c92762a3b | 1,473 | py | Python | clustering/NoSeekTime.py | cloudsTrafton/AwesomeSauce | 24d3694ebe47e59b2fbbd405f52ea5542cd3b945 | [
"MIT"
] | null | null | null | clustering/NoSeekTime.py | cloudsTrafton/AwesomeSauce | 24d3694ebe47e59b2fbbd405f52ea5542cd3b945 | [
"MIT"
] | null | null | null | clustering/NoSeekTime.py | cloudsTrafton/AwesomeSauce | 24d3694ebe47e59b2fbbd405f52ea5542cd3b945 | [
"MIT"
] | null | null | null | # Keep the clustering experiments that involve outliers here
from clustering.KMeansVariations import kMeans_baseline, kMeans_baseline_high_iteration, kMeans_baseline_random_init, \
kMeans_baseline_4_clusters, kMeans_baseline_3_clusters, kMeans_baseline_2_clusters, kMeans_baseline_2_clusters_low_iter,\
kMeans_ba... | 44.636364 | 125 | 0.815343 | from clustering.KMeansVariations import kMeans_baseline, kMeans_baseline_high_iteration, kMeans_baseline_random_init, \
kMeans_baseline_4_clusters, kMeans_baseline_3_clusters, kMeans_baseline_2_clusters, kMeans_baseline_2_clusters_low_iter,\
kMeans_baseline_2_clusters_high_iter
from clustering.MultiClusteringEx... | true | true |
1c0cf26c6b8237525445e0bcd17757514b903712 | 2,718 | py | Python | src/utils/file_utils.py | LingxB/atlx | 1230c4f845adb57edb2a91556282af500ef27880 | [
"MIT"
] | 6 | 2019-12-31T03:17:36.000Z | 2021-12-27T07:03:25.000Z | src/utils/file_utils.py | LingxB/atlx | 1230c4f845adb57edb2a91556282af500ef27880 | [
"MIT"
] | 8 | 2020-01-28T23:14:20.000Z | 2022-02-10T00:47:35.000Z | src/utils/file_utils.py | LingxB/atlx | 1230c4f845adb57edb2a91556282af500ef27880 | [
"MIT"
] | 2 | 2019-12-31T09:38:32.000Z | 2020-05-21T06:02:19.000Z | import yaml
from dotenv import load_dotenv, find_dotenv
import os
import inspect
from src.utils.att_dict import AttributeDict
from src.utils.data_utils import create_symbol_dict
import warnings
import pandas as pd
from time import time
from datetime import datetime
import pickle
def get_timestamp():
ts = time()
... | 27.18 | 115 | 0.670346 | import yaml
from dotenv import load_dotenv, find_dotenv
import os
import inspect
from src.utils.att_dict import AttributeDict
from src.utils.data_utils import create_symbol_dict
import warnings
import pandas as pd
from time import time
from datetime import datetime
import pickle
def get_timestamp():
ts = time()
... | true | true |
1c0cf2ab536c03e773f2212dc14e451a9b7119c1 | 11,859 | py | Python | period-detection-in-power-law-noise/psresp.py | wegenmat/python | d3f73197fc5b53fe75b0a0fc6ab88d87d785549d | [
"BSD-3-Clause"
] | 2 | 2021-09-02T01:41:35.000Z | 2021-09-02T01:41:44.000Z | period-detection-in-power-law-noise/psresp.py | wegenmat/python | d3f73197fc5b53fe75b0a0fc6ab88d87d785549d | [
"BSD-3-Clause"
] | 1 | 2021-02-03T09:23:28.000Z | 2021-02-16T12:40:15.000Z | period-detection-in-power-law-noise/psresp.py | wegenmat/python | d3f73197fc5b53fe75b0a0fc6ab88d87d785549d | [
"BSD-3-Clause"
] | 1 | 2021-09-02T01:42:05.000Z | 2021-09-02T01:42:05.000Z | import numpy as np
__all__ = [
'psresp',
]
def _spectrum(x, slope):
y = x ** slope
return y
def _timmerlc(slope, nt='None', dt='None', mean='None', sigma='None', seed='None'):
if dt == 'None':
dt = 1
if nt == 'None':
nt = 65536
if mean == 'None':
mean = 0
if sig... | 33.594901 | 121 | 0.588077 | import numpy as np
__all__ = [
'psresp',
]
def _spectrum(x, slope):
y = x ** slope
return y
def _timmerlc(slope, nt='None', dt='None', mean='None', sigma='None', seed='None'):
if dt == 'None':
dt = 1
if nt == 'None':
nt = 65536
if mean == 'None':
mean = 0
if sig... | true | true |
1c0cf486960f6d5ea4ea11068039fefebb31669f | 2,423 | py | Python | Object_Detection_Using_Opencv/Object_detection_removing_the_duplicates.py | bhubesh757/Object_Detection | 33e6b07a57e6cfc80d28f9c466e392138399d853 | [
"MIT"
] | 2 | 2020-09-02T19:28:06.000Z | 2020-09-23T16:21:47.000Z | Object_Detection_Using_Opencv/Object_detection_removing_the_duplicates.py | bhubesh757/Object_Detection | 33e6b07a57e6cfc80d28f9c466e392138399d853 | [
"MIT"
] | null | null | null | Object_Detection_Using_Opencv/Object_detection_removing_the_duplicates.py | bhubesh757/Object_Detection | 33e6b07a57e6cfc80d28f9c466e392138399d853 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
# first import the image to check the image whether its checking or not
#img = cv2.imread('Lenna_(test_image).PNG')
# instead of doing the image we can do the code through the webacam
thres = 0.45
nms_threshold = 0.2
cam = cv2.VideoCapture(0)
cam.set(3,1288) # 3 is with
cam... | 32.743243 | 93 | 0.587701 | import cv2
import numpy as np
thres = 0.45
nms_threshold = 0.2
cam = cv2.VideoCapture(0)
cam.set(3,1288) cam.set(4,720) cam.set(10,150)
classNames = []
classFile = 'coco.names'
with open(classFile, 'rt') as f:
classNames = f.read().rstrip('\n').split('\n')
configPath = 'ssd_mobilenet_v3... | true | true |
1c0cf4c2632f83a1cf7cc26c9563090a73d04a45 | 2,100 | py | Python | nonRedundantResolver.py | kakitone/finishingTool | a1f2608a9090adde1108451d2efb034461a75ad5 | [
"MIT"
] | 48 | 2015-01-06T22:10:34.000Z | 2022-03-25T09:45:54.000Z | nonRedundantResolver.py | kakitone/finishingTool | a1f2608a9090adde1108451d2efb034461a75ad5 | [
"MIT"
] | 24 | 2015-01-12T02:03:06.000Z | 2022-03-21T20:58:05.000Z | nonRedundantResolver.py | kakitone/finishingTool | a1f2608a9090adde1108451d2efb034461a75ad5 | [
"MIT"
] | 13 | 2015-04-06T07:03:09.000Z | 2021-12-11T00:24:11.000Z | import os
import alignerRobot
import IORobot
import houseKeeper
# ## 0) Preprocess by removing embedded contigs (I: contigs.fasta ; O : noEmbed.fasta)
def removeEmbedded(folderName , mummerLink):
print "removeEmbedded"
thres = 10
command= r'''perl -pe 's/>[^\$]*$/">Seg" . ++$n ."\n"/ge' ''' + ... | 34.42623 | 168 | 0.62619 | import os
import alignerRobot
import IORobot
import houseKeeper
def removeEmbedded(folderName , mummerLink):
print "removeEmbedded"
thres = 10
command= r'''perl -pe 's/>[^\$]*$/">Seg" . ++$n ."\n"/ge' ''' + folderName + "raw_reads.fasta > " + folderName + houseKeeper.globalReadName
os.sys... | false | true |
1c0cf5998d0c8e109d51284c7e435feb649565e0 | 18,105 | py | Python | tutorials/bios-boot-tutorial/bios-boot-tutorial.py | Commoneffort/eos | ed56850f5e7c88b32b4adc27dc8a8c8cc34d2298 | [
"MIT"
] | null | null | null | tutorials/bios-boot-tutorial/bios-boot-tutorial.py | Commoneffort/eos | ed56850f5e7c88b32b4adc27dc8a8c8cc34d2298 | [
"MIT"
] | null | null | null | tutorials/bios-boot-tutorial/bios-boot-tutorial.py | Commoneffort/eos | ed56850f5e7c88b32b4adc27dc8a8c8cc34d2298 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import json
import numpy
import os
import random
import re
import subprocess
import sys
import time
args = None
logFile = None
unlockTimeout = 999999999
fastUnstakeSystem = './fast.refund/eosio.system/eosio.system.wasm'
systemAccounts = [
'eosio.bpay',
'eosio.msig',
... | 43.837772 | 213 | 0.612317 |
import argparse
import json
import numpy
import os
import random
import re
import subprocess
import sys
import time
args = None
logFile = None
unlockTimeout = 999999999
fastUnstakeSystem = './fast.refund/eosio.system/eosio.system.wasm'
systemAccounts = [
'eosio.bpay',
'eosio.msig',
'eosio.names',
'e... | true | true |
1c0cf64828804d8542c6ff9f2954a2538ac30f79 | 169 | py | Python | Courses/HSEPython/4 week/6.py | searayeah/sublime-snippets | deff53a06948691cd5e5d7dcfa85515ddd8fab0b | [
"MIT"
] | null | null | null | Courses/HSEPython/4 week/6.py | searayeah/sublime-snippets | deff53a06948691cd5e5d7dcfa85515ddd8fab0b | [
"MIT"
] | null | null | null | Courses/HSEPython/4 week/6.py | searayeah/sublime-snippets | deff53a06948691cd5e5d7dcfa85515ddd8fab0b | [
"MIT"
] | null | null | null | def power(a, n):
if n == 1:
return a
if n == 0:
return 1
return a * power(a, n - 1)
a, n = float(input()), int(input())
print(power(a, n))
| 15.363636 | 35 | 0.467456 | def power(a, n):
if n == 1:
return a
if n == 0:
return 1
return a * power(a, n - 1)
a, n = float(input()), int(input())
print(power(a, n))
| true | true |
1c0cf663275705c10af6c5434de5ffb1d3b7e2ac | 3,858 | py | Python | rcsb/utils/chemref/PharosProvider.py | rcsb/py-rcsb_utils_chemref | 4d490ffd684bfc3cf97bb6b93e2667869d92e4de | [
"Apache-2.0"
] | null | null | null | rcsb/utils/chemref/PharosProvider.py | rcsb/py-rcsb_utils_chemref | 4d490ffd684bfc3cf97bb6b93e2667869d92e4de | [
"Apache-2.0"
] | 1 | 2022-03-28T18:47:43.000Z | 2022-03-28T18:47:43.000Z | rcsb/utils/chemref/PharosProvider.py | rcsb/py-rcsb_utils_chemref | 4d490ffd684bfc3cf97bb6b93e2667869d92e4de | [
"Apache-2.0"
] | 3 | 2020-12-03T17:27:15.000Z | 2020-12-03T17:27:32.000Z | ##
# File: PharosProvider.py
# Date: 30-Jul-2020 jdw
#
# Updated:
# 21-Jul-2021 jdw Make this provider a subclass of StashableBase
##
"""
Accessors for Pharos ChEMBL compound assignments. (JDW: this class does not build assignments)
"""
import logging
import os.path
import time
from rcsb.util... | 35.394495 | 116 | 0.600311 |
import logging
import os.path
import time
from rcsb.utils.io.MarshalUtil import MarshalUtil
from rcsb.utils.io.StashableBase import StashableBase
logger = logging.getLogger(__name__)
class PharosProvider(StashableBase):
def __init__(self, **kwargs):
dirName = "Pharos-mapping"
cachePath = kwarg... | true | true |
1c0cf6ff00cab5347e80c6d04445c9ef2c8370ea | 321 | py | Python | taller_estructura_de_control_for/ejercicio10.py | JuanMPerezM/AlgoritmosyProgramacion_Talleres | 849e9ff97a34ee3db32d52467d0de5e981d3b0ee | [
"MIT"
] | null | null | null | taller_estructura_de_control_for/ejercicio10.py | JuanMPerezM/AlgoritmosyProgramacion_Talleres | 849e9ff97a34ee3db32d52467d0de5e981d3b0ee | [
"MIT"
] | null | null | null | taller_estructura_de_control_for/ejercicio10.py | JuanMPerezM/AlgoritmosyProgramacion_Talleres | 849e9ff97a34ee3db32d52467d0de5e981d3b0ee | [
"MIT"
] | null | null | null | archivo = open('paises.txt', 'r')
lista=[]
for i in archivo:
lista.append(i)
a="".join(lista)
if(a=="Madagascar: rey julien\n"):
break
lista2=[]
for i in archivo:
a=i.index(":")
for i in range(0,len(i)):
lista2.remove("rey julien")
lista2.insert("Madagascar: Antananarivo")
print(lista2)
archivo.close(... | 21.4 | 43 | 0.65109 | archivo = open('paises.txt', 'r')
lista=[]
for i in archivo:
lista.append(i)
a="".join(lista)
if(a=="Madagascar: rey julien\n"):
break
lista2=[]
for i in archivo:
a=i.index(":")
for i in range(0,len(i)):
lista2.remove("rey julien")
lista2.insert("Madagascar: Antananarivo")
print(lista2)
archivo.close(... | true | true |
1c0cf7567e9a002f8cb75cd38b2e4d9f975a4d13 | 94 | py | Python | tests/SimpleIncludeAndMacros/slwaivers.py | bsp13/Surelog | 3a04f7f59791390c69f1e3b69609db4ede7668b9 | [
"Apache-2.0"
] | null | null | null | tests/SimpleIncludeAndMacros/slwaivers.py | bsp13/Surelog | 3a04f7f59791390c69f1e3b69609db4ede7668b9 | [
"Apache-2.0"
] | null | null | null | tests/SimpleIncludeAndMacros/slwaivers.py | bsp13/Surelog | 3a04f7f59791390c69f1e3b69609db4ede7668b9 | [
"Apache-2.0"
] | null | null | null |
SLsetWaiver("WARNI:PP0103", "top_2.v", 15, "multipl")
SLsetWaiver("INFO :PP0122", "lib.v")
| 15.666667 | 53 | 0.659574 |
SLsetWaiver("WARNI:PP0103", "top_2.v", 15, "multipl")
SLsetWaiver("INFO :PP0122", "lib.v")
| true | true |
1c0cf84a72bd068f432f7524c21ff2e216dcabdc | 614 | py | Python | instabot_py/new_auto_mod_like2.py | giovabiancia/Instabot_V1 | 0403c3497e3fb5565bb190396987c13b9eca4ec3 | [
"bzip2-1.0.6",
"MIT"
] | 2 | 2019-03-31T09:38:32.000Z | 2019-03-31T09:38:34.000Z | instabot_py/new_auto_mod_like2.py | giovabiancia/Instabot_V1 | 0403c3497e3fb5565bb190396987c13b9eca4ec3 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | instabot_py/new_auto_mod_like2.py | giovabiancia/Instabot_V1 | 0403c3497e3fb5565bb190396987c13b9eca4ec3 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
from .new_auto_mod_likeall import new_like_all_exist_media
def new_auto_mod_like2(self):
if len(self.media_by_user) > 0:
# You have media_id to like:
self.current_index = random.randint(0, len(self.media_by_user) - 1)
... | 29.238095 | 76 | 0.627036 | import random
from .new_auto_mod_likeall import new_like_all_exist_media
def new_auto_mod_like2(self):
if len(self.media_by_user) > 0:
self.current_index = random.randint(0, len(self.media_by_user) - 1)
log_string = "Current Index = %i of %i medias" % (
self.current_i... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.