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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7767d6c777d483b7c584599abb75a788b6b5892 | 9,138 | py | Python | rao/agency/utils/utils_cert.py | alfonsoalongi/rao-pubblico | 139fff32847b217afdb69f7fa906b26462c096f2 | [
"MIT"
] | null | null | null | rao/agency/utils/utils_cert.py | alfonsoalongi/rao-pubblico | 139fff32847b217afdb69f7fa906b26462c096f2 | [
"MIT"
] | null | null | null | rao/agency/utils/utils_cert.py | alfonsoalongi/rao-pubblico | 139fff32847b217afdb69f7fa906b26462c096f2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Stdlib imports
import base64
import datetime
import hashlib
import logging
import os
import sys
import traceback
import requests
from OpenSSL import crypto
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.x509.extensions import UserNotic... | 35.011494 | 130 | 0.673123 | import base64
import datetime
import hashlib
import logging
import os
import sys
import traceback
import requests
from OpenSSL import crypto
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.x509.extensions import UserNotice
from cryptography.x509.oid import Exten... | true | true |
f7767f81e0aebc777849d439cde562742cbfa7fd | 4,315 | py | Python | tests/providers/amazon/aws/sensors/test_s3_keys_unchanged.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | 3 | 2017-08-06T23:19:48.000Z | 2018-05-11T05:50:25.000Z | tests/providers/amazon/aws/sensors/test_s3_keys_unchanged.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | 20 | 2016-11-21T22:54:28.000Z | 2018-10-28T20:03:13.000Z | tests/providers/amazon/aws/sensors/test_s3_keys_unchanged.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | 3 | 2016-10-13T09:59:18.000Z | 2017-02-22T11:29:09.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.953704 | 102 | 0.653071 |
from datetime import datetime
from unittest import TestCase, mock
import pytest
from freezegun import freeze_time
from parameterized import parameterized
from airflow.models.dag import DAG, AirflowException
from airflow.providers.amazon.aws.sensors.s3 import S3KeysUnchangedSensor
TEST_DAG_ID = 'unit_tests_aws_senso... | true | true |
f776800920f505ba881a458b027c0658816f7e2a | 49 | py | Python | tests/test_ship.py | erkandem/ogame-model | 2e18f7d0b8d177a6cd55a95fd236861d9fbb8d1e | [
"MIT"
] | null | null | null | tests/test_ship.py | erkandem/ogame-model | 2e18f7d0b8d177a6cd55a95fd236861d9fbb8d1e | [
"MIT"
] | null | null | null | tests/test_ship.py | erkandem/ogame-model | 2e18f7d0b8d177a6cd55a95fd236861d9fbb8d1e | [
"MIT"
] | null | null | null | from src import ships
class TestShip:
pass
| 8.166667 | 21 | 0.714286 | from src import ships
class TestShip:
pass
| true | true |
f7768054134d4748002ff65e35bfe644ab88c9ed | 24,298 | py | Python | src/arch/hsail/gen.py | Weil0ng/gem5_arm | 4ce9d88905135a9c67ace400ee74ec406edb6c2f | [
"BSD-3-Clause"
] | 1 | 2016-10-11T02:26:16.000Z | 2016-10-11T02:26:16.000Z | src/arch/hsail/gen.py | Weil0ng/gem5_arm | 4ce9d88905135a9c67ace400ee74ec406edb6c2f | [
"BSD-3-Clause"
] | null | null | null | src/arch/hsail/gen.py | Weil0ng/gem5_arm | 4ce9d88905135a9c67ace400ee74ec406edb6c2f | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/python
#
# Copyright (c) 2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributio... | 30.109046 | 80 | 0.642316 |
import sys, re
from m5.util import code_formatter
if len(sys.argv) != 4:
print "Error: need 3 args (file names)"
sys.exit(0)
header_code = code_formatter()
decoder_code = code_formatter()
exec_code = code_formatter()
header_code('''
#include "arch/hsail/insts/decl.hh"
#include "base/bitfield.hh"
#include... | false | true |
f776809952d021c785a42bd420f6aed5766fc1f0 | 55,647 | py | Python | aiida/orm/nodes/node.py | hongyi-zhao/aiida-core | d6e8c7d10537b754d1cb6334689ba2edf4347d43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | aiida/orm/nodes/node.py | hongyi-zhao/aiida-core | d6e8c7d10537b754d1cb6334689ba2edf4347d43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | aiida/orm/nodes/node.py | hongyi-zhao/aiida-core | d6e8c7d10537b754d1cb6334689ba2edf4347d43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 41.997736 | 148 | 0.651482 | import copy
import importlib
import warnings
from aiida.common import exceptions
from aiida.common.escaping import sql_string_match
from aiida.common.hashing import make_hash, _HASH_EXTRA_KEY
from aiida.common.lang import classproperty, type_check
from aiida.common.links import LinkType
from aiida.common.warnings impo... | true | true |
f77681a76312eb4492980d7a78499b7cf1d7ac33 | 470 | py | Python | Update.py | Derfiee/OOP-580022 | 8e3b23cfd9701bb0f708dc66965a155d55ab3234 | [
"Apache-2.0"
] | null | null | null | Update.py | Derfiee/OOP-580022 | 8e3b23cfd9701bb0f708dc66965a155d55ab3234 | [
"Apache-2.0"
] | null | null | null | Update.py | Derfiee/OOP-580022 | 8e3b23cfd9701bb0f708dc66965a155d55ab3234 | [
"Apache-2.0"
] | null | null | null | import pyodbc
try:
connect = pyodbc.connect(r'Driver= {Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:\Users\Aldrin PC\Documents\Database1.accdb;')
print("Connected to a Database")
Laboratory = 90
user_id = 5
record = connect.cursor()
record.execute('UPDATE Table1 SET Laboratory =... | 29.375 | 135 | 0.657447 | import pyodbc
try:
connect = pyodbc.connect(r'Driver= {Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:\Users\Aldrin PC\Documents\Database1.accdb;')
print("Connected to a Database")
Laboratory = 90
user_id = 5
record = connect.cursor()
record.execute('UPDATE Table1 SET Laboratory =... | true | true |
f7768207a03ea9c966841a4f390a4797aae4e62b | 10,269 | py | Python | tests/integration/framework/nsh-lwm2m/lwm2m/coap/packet.py | cerkiewny/Anjay | b38ac519225cb27369c9a411f3f96899075c1216 | [
"Apache-2.0"
] | 161 | 2017-02-08T12:07:22.000Z | 2022-03-20T11:10:10.000Z | tests/integration/framework/nsh-lwm2m/lwm2m/coap/packet.py | cerkiewny/Anjay | b38ac519225cb27369c9a411f3f96899075c1216 | [
"Apache-2.0"
] | 53 | 2017-03-15T12:58:40.000Z | 2022-01-20T09:31:54.000Z | tests/integration/framework/nsh-lwm2m/lwm2m/coap/packet.py | cerkiewny/Anjay | b38ac519225cb27369c9a411f3f96899075c1216 | [
"Apache-2.0"
] | 68 | 2017-02-21T15:02:02.000Z | 2022-03-19T06:24:21.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017-2021 AVSystem <avsystem@avsystem.com>
#
# 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 ... | 32.808307 | 116 | 0.562567 |
import operator
import struct
import logging
import textwrap
from .code import Code
from .option import Option
from .type import Type
from .utils import hexlify, hexlify_nonprintable
from .transport import Transport
from collections import namedtuple
Header = namedtuple('Header', ('code', 'version', 'type', 'id', '... | true | true |
f77683129887612892ee2db5f0a8a9eca99c8563 | 7,553 | py | Python | openpype/tools/project_manager/project_manager/multiselection_combobox.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | 1 | 2022-02-08T15:40:41.000Z | 2022-02-08T15:40:41.000Z | openpype/tools/project_manager/project_manager/multiselection_combobox.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | 2 | 2022-03-18T01:46:03.000Z | 2022-03-18T01:46:16.000Z | openpype/tools/project_manager/project_manager/multiselection_combobox.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | from Qt import QtCore, QtWidgets
class ComboItemDelegate(QtWidgets.QStyledItemDelegate):
"""
Helper styled delegate (mostly based on existing private Qt's
delegate used by the QtWidgets.QComboBox). Used to style the popup like a
list view (e.g windows style).
"""
def paint(self, painter, opti... | 34.967593 | 78 | 0.594995 | from Qt import QtCore, QtWidgets
class ComboItemDelegate(QtWidgets.QStyledItemDelegate):
def paint(self, painter, option, index):
option = QtWidgets.QStyleOptionViewItem(option)
option.showDecorationSelected = True
super(ComboItemDelegate, self).paint(pain... | true | true |
f776835a25fa9f45ffd4d843b799fd3ecb2befff | 10,040 | py | Python | tests/test_commands.py | jayvdb/django-test-tools | a832cc6acf8e45c8d6b0cd5e3c424b95595c1855 | [
"MIT"
] | null | null | null | tests/test_commands.py | jayvdb/django-test-tools | a832cc6acf8e45c8d6b0cd5e3c424b95595c1855 | [
"MIT"
] | null | null | null | tests/test_commands.py | jayvdb/django-test-tools | a832cc6acf8e45c8d6b0cd5e3c424b95595c1855 | [
"MIT"
] | null | null | null | import os
from unittest import mock
from unittest.mock import Mock, patch
from django.conf import settings
from django.core.management import call_command
from django.db.models import FileField
from django.test import TestCase, SimpleTestCase
from django_test_tools.file_utils import hash_file, temporary_file
from dja... | 49.70297 | 166 | 0.649104 | import os
from unittest import mock
from unittest.mock import Mock, patch
from django.conf import settings
from django.core.management import call_command
from django.db.models import FileField
from django.test import TestCase, SimpleTestCase
from django_test_tools.file_utils import hash_file, temporary_file
from dja... | true | true |
f77683b193a9676861ea7fdc616ca06d9ad5c92e | 477 | py | Python | pyrobud/logs.py | JTruj1ll0923/pyrobud | eb895d1e7bdf098ec7b6fa14707b8ebdad295fca | [
"MIT"
] | null | null | null | pyrobud/logs.py | JTruj1ll0923/pyrobud | eb895d1e7bdf098ec7b6fa14707b8ebdad295fca | [
"MIT"
] | null | null | null | pyrobud/logs.py | JTruj1ll0923/pyrobud | eb895d1e7bdf098ec7b6fa14707b8ebdad295fca | [
"MIT"
] | null | null | null | import logging
import colorlog
LOG_LEVEL = logging.INFO
LOG_FORMAT = " %(log_color)s%(levelname)-8s%(reset)s | %(name)-7s | %(log_color)s%(message)s%(reset)s"
def setup_logging() -> None:
logging.root.setLevel(LOG_LEVEL)
formatter = colorlog.ColoredFormatter(LOG_FORMAT)
stream = logging.StreamHandler(... | 23.85 | 103 | 0.716981 | import logging
import colorlog
LOG_LEVEL = logging.INFO
LOG_FORMAT = " %(log_color)s%(levelname)-8s%(reset)s | %(name)-7s | %(log_color)s%(message)s%(reset)s"
def setup_logging() -> None:
logging.root.setLevel(LOG_LEVEL)
formatter = colorlog.ColoredFormatter(LOG_FORMAT)
stream = logging.StreamHandler(... | true | true |
f77684ae87f026d6dcb29acea2748fccf4c48ae7 | 1,164 | py | Python | auth_app/urls.py | deephealthproject/backend | 4bf6899c1308cbd42231ff9e29fe68b3ccb881e5 | [
"MIT"
] | 2 | 2021-09-21T19:04:26.000Z | 2021-12-31T05:21:16.000Z | auth_app/urls.py | deephealthproject/backend | 4bf6899c1308cbd42231ff9e29fe68b3ccb881e5 | [
"MIT"
] | null | null | null | auth_app/urls.py | deephealthproject/backend | 4bf6899c1308cbd42231ff9e29fe68b3ccb881e5 | [
"MIT"
] | 2 | 2020-03-20T14:05:48.000Z | 2020-06-16T16:15:47.000Z | from django.contrib.auth import views as auth_views
from django.urls import include, path
from oauth2_provider.urls import management_urlpatterns
from auth_app import views
user_list = views.UsersViewSet.as_view({
'get': 'list'
})
user_detail = views.UsersViewSet.as_view({
'get': 'retrieve'
})
urlpatterns = ... | 40.137931 | 99 | 0.709622 | from django.contrib.auth import views as auth_views
from django.urls import include, path
from oauth2_provider.urls import management_urlpatterns
from auth_app import views
user_list = views.UsersViewSet.as_view({
'get': 'list'
})
user_detail = views.UsersViewSet.as_view({
'get': 'retrieve'
})
urlpatterns = ... | true | true |
f7768609e20506514d83d3ac5055fa706b884043 | 32,905 | py | Python | python/scripts/m3qa/config_arm_a1r1.py | ahoarau/m3meka | 237739f0266ce60aaa3013b0d2b22fc07b6374c4 | [
"MIT"
] | 1 | 2015-06-19T12:14:18.000Z | 2015-06-19T12:14:18.000Z | python/scripts/m3qa/config_arm_a1r1.py | semeyerz/m3meka | 6e5d6b73ad3ebdd8429497923e601eae65d8b2fe | [
"MIT"
] | null | null | null | python/scripts/m3qa/config_arm_a1r1.py | semeyerz/m3meka | 6e5d6b73ad3ebdd8429497923e601eae65d8b2fe | [
"MIT"
] | 2 | 2015-11-27T09:25:54.000Z | 2021-08-16T16:29:22.000Z | # -*- coding: utf-8 -*-
#Copyright 2010, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INC... | 40.774473 | 96 | 0.429418 |
import copy
import config_toolbox as ct
config_arm_a1r1_actuator_ec={
'chid': 0,
'ethercat': {'pdo_version': 'actx1_pdo_v1',
'product_code': 1001,
'serial_number': 0},
'name': 'm3actuator_ec_xxx_j0',
'version':'default',
'firmware': 'm3_controller_sea_a1r1',
... | true | true |
f776861948c75aafa6cee9042b8884583c64d534 | 21,754 | py | Python | src/django-nonrel/django/forms/forms.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.3/django/forms/forms.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.3/django/forms/forms.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | """
Form classes
"""
from django.core.exceptions import ValidationError
from django.utils.copycompat import deepcopy
from django.utils.datastructures import SortedDict
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
from django.utils.safest... | 40.585821 | 130 | 0.605544 | """
Form classes
"""
from django.core.exceptions import ValidationError
from django.utils.copycompat import deepcopy
from django.utils.datastructures import SortedDict
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
from django.utils.safest... | false | true |
f77686c066c729b7225cf71f69bede2202f8e539 | 626 | py | Python | fink_broker/__init__.py | astrolabsoftware/fink-broker | a52d3c5a7f38c7dd54a0786d5510e59b1e954c48 | [
"Apache-2.0"
] | 17 | 2019-03-08T12:37:06.000Z | 2022-02-01T18:02:07.000Z | fink_broker/__init__.py | astrolabsoftware/fink-broker | a52d3c5a7f38c7dd54a0786d5510e59b1e954c48 | [
"Apache-2.0"
] | 559 | 2019-03-07T14:55:27.000Z | 2022-03-11T20:13:12.000Z | fink_broker/__init__.py | astrolabsoftware/fink-broker | a52d3c5a7f38c7dd54a0786d5510e59b1e954c48 | [
"Apache-2.0"
] | 12 | 2019-03-08T13:04:38.000Z | 2022-01-23T22:22:50.000Z | # Copyright 2019 AstroLab Software
# Author: Julien Peloton
#
# 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 applicabl... | 39.125 | 74 | 0.761981 | __version__ = "1.1"
| true | true |
f77687cd90138e02eea6ff29536f0b8a984eaab1 | 6,194 | py | Python | backend/treeckle/bookings/views.py | CAPTxTreeckle/Treeckle-3.0 | 0c8a1a1db5685a22968644deabdd79b525ff0140 | [
"MIT"
] | null | null | null | backend/treeckle/bookings/views.py | CAPTxTreeckle/Treeckle-3.0 | 0c8a1a1db5685a22968644deabdd79b525ff0140 | [
"MIT"
] | 1 | 2021-11-28T06:18:51.000Z | 2021-11-28T06:18:51.000Z | backend/treeckle/bookings/views.py | CAPTxTreeckle/Treeckle-3.0 | 0c8a1a1db5685a22968644deabdd79b525ff0140 | [
"MIT"
] | 1 | 2021-08-02T09:20:10.000Z | 2021-08-02T09:20:10.000Z | from datetime import datetime
from django.utils.timezone import make_aware
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import AllowAny
from treeckle.common.constants import COMMENTS
from treeckle.common.excepti... | 35.394286 | 88 | 0.713755 | from datetime import datetime
from django.utils.timezone import make_aware
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import AllowAny
from treeckle.common.constants import COMMENTS
from treeckle.common.excepti... | true | true |
f7768801b23e7974906910952c159f2f15e63174 | 710 | py | Python | src/denoising/torch_utils.py | thunderball7cd/night-to-day-image-processing | 388a082241af4bc67e770c76f207b58b330063d9 | [
"MIT"
] | 2 | 2021-05-18T11:55:40.000Z | 2021-11-01T06:15:01.000Z | src/denoising/torch_utils.py | thunderball7cd/night-to-day-image-processing | 388a082241af4bc67e770c76f207b58b330063d9 | [
"MIT"
] | null | null | null | src/denoising/torch_utils.py | thunderball7cd/night-to-day-image-processing | 388a082241af4bc67e770c76f207b58b330063d9 | [
"MIT"
] | 1 | 2021-05-22T13:23:17.000Z | 2021-05-22T13:23:17.000Z | """
## CycleISP: Real Image Restoration Via Improved Data Synthesis
## Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, Ming-Hsuan Yang, and Ling Shao
## CVPR 2020
## https://arxiv.org/abs/2003.07761
"""
from collections import OrderedDict
import torch
def load_checkpoint(model, weigh... | 30.869565 | 113 | 0.680282 |
from collections import OrderedDict
import torch
def load_checkpoint(model, weights):
checkpoint = torch.load(weights, map_location='cpu')
try:
model.load_state_dict(checkpoint["state_dict"])
except:
state_dict = checkpoint["state_dict"]
new_state_dict = OrderedDict()
for... | true | true |
f7768873f93184b06e88574096b6364c7fed0022 | 4,124 | py | Python | workspace_tools/host_tests/host_tests_plugins/module_copy_mps2.py | oliviermartin/mbed | 2f63fa7d78a264b26ea626d542ae1b19e239bb6a | [
"Apache-2.0"
] | 54 | 2015-12-21T13:07:43.000Z | 2019-04-16T20:06:25.000Z | workspace_tools/host_tests/host_tests_plugins/module_copy_mps2.py | oliviermartin/mbed | 2f63fa7d78a264b26ea626d542ae1b19e239bb6a | [
"Apache-2.0"
] | 10 | 2015-10-31T15:16:14.000Z | 2019-03-12T13:25:29.000Z | workspace_tools/host_tests/host_tests_plugins/module_copy_mps2.py | oliviermartin/mbed | 2f63fa7d78a264b26ea626d542ae1b19e239bb6a | [
"Apache-2.0"
] | 30 | 2015-12-27T21:44:56.000Z | 2019-03-26T07:13:26.000Z | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 38.185185 | 105 | 0.620999 |
import re
from os.path import join
from host_test_plugins import HostTestPluginBase
class HostTestPluginCopyMethod_MPS2(HostTestPluginBase):
def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'):
MBED_SDK_TEST_STAMP = 'test suite entry'
image_pa... | true | true |
f776896b646fe63fff698b968b95d425fae9b7f0 | 41,748 | py | Python | tests/integration/__init__.py | iMilnb/saltstack | 31033aac6bde314f544db8b7781470325c205549 | [
"Apache-2.0"
] | 1 | 2020-06-16T05:47:58.000Z | 2020-06-16T05:47:58.000Z | tests/integration/__init__.py | iMilnb/saltstack | 31033aac6bde314f544db8b7781470325c205549 | [
"Apache-2.0"
] | null | null | null | tests/integration/__init__.py | iMilnb/saltstack | 31033aac6bde314f544db8b7781470325c205549 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import print_function
import os
import re
import sys
import time
import errno
import shutil
import pprint
import logging
import tempfile
import subprocess
import multiprocessing
from hashlib import md5
from dat... | 35.682051 | 108 | 0.55344 |
from __future__ import print_function
import os
import re
import sys
import time
import errno
import shutil
import pprint
import logging
import tempfile
import subprocess
import multiprocessing
from hashlib import md5
from datetime import datetime, timedelta
try:
import pwd
except ImportError:
pass
STATE_FU... | true | true |
f7768a18b49f2bc6fc4746ed755e8687be012a88 | 1,449 | py | Python | setup.py | jdnrg/requests-futures | 2cabcd0448423931d672c01661c87e3a58e607ea | [
"Apache-2.0"
] | null | null | null | setup.py | jdnrg/requests-futures | 2cabcd0448423931d672c01661c87e3a58e607ea | [
"Apache-2.0"
] | null | null | null | setup.py | jdnrg/requests-futures | 2cabcd0448423931d672c01661c87e3a58e607ea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import requests_futures
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
packages = [
'requests_futures',
]
requires = [
'requ... | 26.833333 | 65 | 0.652174 |
import os
import sys
import requests_futures
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
packages = [
'requests_futures',
]
requires = [
'requests>=1.2.0',
]
s... | true | true |
f7768ad0d17dbc9c868d8762d32dab2015550ffb | 351 | py | Python | utils/hash_util.py | kshewani/python_blockchain | 9bd3594dfde82e090cbe2a75d9acae6684b7a89e | [
"MIT"
] | null | null | null | utils/hash_util.py | kshewani/python_blockchain | 9bd3594dfde82e090cbe2a75d9acae6684b7a89e | [
"MIT"
] | null | null | null | utils/hash_util.py | kshewani/python_blockchain | 9bd3594dfde82e090cbe2a75d9acae6684b7a89e | [
"MIT"
] | null | null | null | import hashlib as hl
import json
def hash_string_256(string):
return hl.sha256(string).hexdigest()
def hash_block(block):
hashable_block = block.__dict__.copy()
hashable_block['transactions'] = [tx.to_ordered_dict() for tx in hashable_block['transactions']]
return hash_string_256(json.dumps(hashable_b... | 35.1 | 100 | 0.763533 | import hashlib as hl
import json
def hash_string_256(string):
return hl.sha256(string).hexdigest()
def hash_block(block):
hashable_block = block.__dict__.copy()
hashable_block['transactions'] = [tx.to_ordered_dict() for tx in hashable_block['transactions']]
return hash_string_256(json.dumps(hashable_b... | true | true |
f7768ad33d37fd57bc1f3c5da98fe78f2d44827e | 1,353 | py | Python | components/kubeflow/launcher/kubeflow_tfjob_launcher_op.py | rakelkar/pipelines | de5077bbe90feffacaccea0819f8620b6213c3e1 | [
"Apache-2.0"
] | null | null | null | components/kubeflow/launcher/kubeflow_tfjob_launcher_op.py | rakelkar/pipelines | de5077bbe90feffacaccea0819f8620b6213c3e1 | [
"Apache-2.0"
] | null | null | null | components/kubeflow/launcher/kubeflow_tfjob_launcher_op.py | rakelkar/pipelines | de5077bbe90feffacaccea0819f8620b6213c3e1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.28125 | 188 | 0.692535 |
from kfp import dsl
def kubeflow_tfjob_launcher_op(container_image, command, number_of_workers: int, number_of_parameter_servers: int, tfjob_timeout_minutes: int, output_dir=None, step_name='TFJob-launcher'):
return dsl.ContainerOp(
name = step_name,
image = 'gcr.io/ml-pipeline/ml-pipeline-kubeflo... | true | true |
f7768b48032471bcac69df6e0bb8d9b93b6bd2dc | 53 | py | Python | update_checker/globalvars.py | blake-riley/update-checker | bc197691c6b9a44bd323ed466288387723036575 | [
"CC0-1.0"
] | null | null | null | update_checker/globalvars.py | blake-riley/update-checker | bc197691c6b9a44bd323ed466288387723036575 | [
"CC0-1.0"
] | null | null | null | update_checker/globalvars.py | blake-riley/update-checker | bc197691c6b9a44bd323ed466288387723036575 | [
"CC0-1.0"
] | null | null | null | from typing import Any
OPTIONS: dict[str, Any] = {}
| 13.25 | 28 | 0.679245 | from typing import Any
OPTIONS: dict[str, Any] = {}
| true | true |
f7768b49a1deb66d7c34974a5d5d002f1a2f6bb1 | 174 | py | Python | python/optimizer/optimizer.py | sarahaguasvivas/GPC | 8b4053d22d47d482c12d008b012f3822daa4a8e4 | [
"MIT"
] | null | null | null | python/optimizer/optimizer.py | sarahaguasvivas/GPC | 8b4053d22d47d482c12d008b012f3822daa4a8e4 | [
"MIT"
] | null | null | null | python/optimizer/optimizer.py | sarahaguasvivas/GPC | 8b4053d22d47d482c12d008b012f3822daa4a8e4 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Optimizer(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def optimize(self, u_n):
pass
| 15.818182 | 35 | 0.637931 | from abc import ABC, abstractmethod
class Optimizer(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def optimize(self, u_n):
pass
| true | true |
f7768b882aa4cd21ce1070eeaaf0e330b7b31231 | 637 | py | Python | pure25519_blake2b/test_dh.py | orhanhenrik/python-pure25519-blake2b | 398761a272b8d9c0607f17a3fa7169b2e6a2d3f2 | [
"MIT"
] | null | null | null | pure25519_blake2b/test_dh.py | orhanhenrik/python-pure25519-blake2b | 398761a272b8d9c0607f17a3fa7169b2e6a2d3f2 | [
"MIT"
] | null | null | null | pure25519_blake2b/test_dh.py | orhanhenrik/python-pure25519-blake2b | 398761a272b8d9c0607f17a3fa7169b2e6a2d3f2 | [
"MIT"
] | null | null | null | import os, unittest
from binascii import hexlify
from pure25519_blake2b.basic import encodepoint
from pure25519_blake2b.dh import dh_start, dh_finish
class DH(unittest.TestCase):
def assertElementsEqual(self, e1, e2):
self.assertEqual(hexlify(encodepoint(e1)), hexlify(encodepoint(e2)))
def assertBytesE... | 33.526316 | 76 | 0.660911 | import os, unittest
from binascii import hexlify
from pure25519_blake2b.basic import encodepoint
from pure25519_blake2b.dh import dh_start, dh_finish
class DH(unittest.TestCase):
def assertElementsEqual(self, e1, e2):
self.assertEqual(hexlify(encodepoint(e1)), hexlify(encodepoint(e2)))
def assertBytesE... | true | true |
f7768bb8075a193f948831343d93b58c369cb232 | 3,961 | py | Python | src/oci/log_analytics/models/link_details_command_descriptor.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/log_analytics/models/link_details_command_descriptor.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/log_analytics/models/link_details_command_descriptor.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 46.6 | 551 | 0.683413 |
from .abstract_command_descriptor import AbstractCommandDescriptor
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class LinkDetailsCommandDescriptor(AbstractCommandDescriptor):
de... | true | true |
f7768bd4f88927b9cb0b862164682711601f0522 | 6,521 | py | Python | noxfile.py | jedhsu/tensor | 3b2fe21029fa7c50b034190e77d79d1a94ea5e8f | [
"Apache-2.0"
] | null | null | null | noxfile.py | jedhsu/tensor | 3b2fe21029fa7c50b034190e77d79d1a94ea5e8f | [
"Apache-2.0"
] | null | null | null | noxfile.py | jedhsu/tensor | 3b2fe21029fa7c50b034190e77d79d1a94ea5e8f | [
"Apache-2.0"
] | null | null | null | """
*nox*
Parameters for nox.
"""
import nox
from nox_poetry import Session
from nox_poetry import session
from pathlib import Path
from textwrap import dedent
import sys
import shutil
package = "{{cookiecutter.package_name}}"
python_versions = [
"3.9",
"3.8",
"3.7",
]
nox.needs_version = ">... | 16.677749 | 76 | 0.482135 |
import nox
from nox_poetry import Session
from nox_poetry import session
from pathlib import Path
from textwrap import dedent
import sys
import shutil
package = "{{cookiecutter.package_name}}"
python_versions = [
"3.9",
"3.8",
"3.7",
]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
"p... | true | true |
f7768d526cf4b3aba4d5637e2fdd95586f95cb4d | 2,990 | py | Python | pyremo/core/domain.py | ludwiglierhammer/pyremo | e06d349530c95007903f02b87e6a1a6b0396008e | [
"MIT"
] | null | null | null | pyremo/core/domain.py | ludwiglierhammer/pyremo | e06d349530c95007903f02b87e6a1a6b0396008e | [
"MIT"
] | null | null | null | pyremo/core/domain.py | ludwiglierhammer/pyremo | e06d349530c95007903f02b87e6a1a6b0396008e | [
"MIT"
] | null | null | null | #! /usr/bin/python
# coding: utf-8
# flake8: noqa
# This file is part of PyRemo. PyRemo is a toolbox to facilitate
# treatment and plotting of REMO or other rotated and non-rotated
# data.
#
# Copyright (C) 2010-2020 REMO Group
# See COPYING file for copying and redistribution conditions.
#
# This program is free softw... | 26 | 79 | 0.68194 |
import pandas as pd
from itertools import chain, product
import cordex as cx
from ..tables import domains
def remo_domain(short_name, **kwargs):
return cx.cordex_domain(short_name, tables=domains.table, **kwargs)
def domain_info(short_name):
return cx.domain_info(short_name, tables=domains.table)
def t... | true | true |
f7768de6b40f82b99330b162d133175124ac64a2 | 29,451 | py | Python | src/geneflow/definition.py | jhphan/geneflow | 64630828eeb8dbb9d4cf9a01c92995701a008afa | [
"Apache-2.0"
] | null | null | null | src/geneflow/definition.py | jhphan/geneflow | 64630828eeb8dbb9d4cf9a01c92995701a008afa | [
"Apache-2.0"
] | null | null | null | src/geneflow/definition.py | jhphan/geneflow | 64630828eeb8dbb9d4cf9a01c92995701a008afa | [
"Apache-2.0"
] | null | null | null | """This module contains the GeneFlow Definition class."""
import copy
import pprint
import cerberus
import yaml
from geneflow.log import Log
GF_VERSION = 'v3.0'
WORKFLOW_SCHEMA = {
'v3.0': {
'gfVersion': {
'type': 'string', 'default': GF_VERSION, 'allowed': [GF_VERSION]
},
'... | 34.086806 | 109 | 0.377237 |
import copy
import pprint
import cerberus
import yaml
from geneflow.log import Log
GF_VERSION = 'v3.0'
WORKFLOW_SCHEMA = {
'v3.0': {
'gfVersion': {
'type': 'string', 'default': GF_VERSION, 'allowed': [GF_VERSION]
},
'class': {
'type': 'string', 'default': 'workfl... | true | true |
f7768e4d6d61526a702f9d5e0b4995c46be3a7a0 | 510 | py | Python | flask/config.py | schinke/solid-fortnight-ba | 221ad998e51e9b2634d1cfb17c84ad28dbc9a7d5 | [
"MIT"
] | 1 | 2016-08-19T09:33:09.000Z | 2016-08-19T09:33:09.000Z | flask/config.py | schinke/solid-fortnight-ba | 221ad998e51e9b2634d1cfb17c84ad28dbc9a7d5 | [
"MIT"
] | null | null | null | flask/config.py | schinke/solid-fortnight-ba | 221ad998e51e9b2634d1cfb17c84ad28dbc9a7d5 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = 'this-really-needs-to-be-changed'
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/edbdev'
class ProductionConfig(Config):
DEBUG = False
class... | 17.586207 | 61 | 0.705882 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = 'this-really-needs-to-be-changed'
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/edbdev'
class ProductionConfig(Config):
DEBUG = False
class... | true | true |
f7768ef97d35ba6c7dc62510c040b48a97ac774f | 2,219 | py | Python | env/lib/python3.6/site-packages/dipy/reconst/tests/test_interpolate.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | env/lib/python3.6/site-packages/dipy/reconst/tests/test_interpolate.py | Raniac/neurolearn_dev | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | env/lib/python3.6/site-packages/dipy/reconst/tests/test_interpolate.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | from __future__ import division, print_function, absolute_import
from dipy.utils.six.moves import xrange
from dipy.testing import assert_true, assert_false
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_raises)
import numpy as np
from dipy.re... | 36.983333 | 75 | 0.609283 | from __future__ import division, print_function, absolute_import
from dipy.utils.six.moves import xrange
from dipy.testing import assert_true, assert_false
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_raises)
import numpy as np
from dipy.re... | true | true |
f7768f0c71e0f8ef4fb5e456ad6a4b75d9be31a5 | 1,637 | py | Python | scripts/analysis/TopKAccuracy.py | hangqiu/MLEXray | 11762df1b1113e86f44d81f201d54fb6ac3a2242 | [
"MIT"
] | 2 | 2022-02-11T23:49:58.000Z | 2022-03-15T20:24:46.000Z | scripts/analysis/TopKAccuracy.py | hangqiu/ML-EXray | 23d0ff7cd39854bbd8fcc8e050bb3c1787edb056 | [
"MIT"
] | null | null | null | scripts/analysis/TopKAccuracy.py | hangqiu/ML-EXray | 23d0ff7cd39854bbd8fcc8e050bb3c1787edb056 | [
"MIT"
] | null | null | null | from edgeml.python.src.MLEXray.ML_Diff.MLLogReader import MLLogReader
from edgeml.python.src.MLEXray.ML_Diff.TopKAccuracy import get_log_path, TopKAccuracy
from edgeml.python.src.MLEXray.Utils.params import ModelName, ScalarLogKeys, VectorLogKeys
groundtruth_filepath = "data/0_data/imagenet2012/groundtruth_label.txt"
... | 38.069767 | 90 | 0.729994 | from edgeml.python.src.MLEXray.ML_Diff.MLLogReader import MLLogReader
from edgeml.python.src.MLEXray.ML_Diff.TopKAccuracy import get_log_path, TopKAccuracy
from edgeml.python.src.MLEXray.Utils.params import ModelName, ScalarLogKeys, VectorLogKeys
groundtruth_filepath = "data/0_data/imagenet2012/groundtruth_label.txt"
... | true | true |
f77691b22951fcf41f3d7d80cb549f8e5baeefff | 8,931 | py | Python | dawetsql/odbc_sql.py | wakataw/ipython-dawet-sql | af17db523bfcee236e2bae7cc36995e5b41f6c36 | [
"MIT"
] | null | null | null | dawetsql/odbc_sql.py | wakataw/ipython-dawet-sql | af17db523bfcee236e2bae7cc36995e5b41f6c36 | [
"MIT"
] | null | null | null | dawetsql/odbc_sql.py | wakataw/ipython-dawet-sql | af17db523bfcee236e2bae7cc36995e5b41f6c36 | [
"MIT"
] | null | null | null | import logging
import pypyodbc
import sys
from pandas import DataFrame, read_sql, concat
from IPython.core import magic_arguments
from IPython.core.magic import magics_class, Magics, line_magic, cell_magic
from dawetsql.widgets import SchemaExplorer
from . import utils
from cryptography.fernet import Fernet
@magics_... | 30.481229 | 121 | 0.581234 | import logging
import pypyodbc
import sys
from pandas import DataFrame, read_sql, concat
from IPython.core import magic_arguments
from IPython.core.magic import magics_class, Magics, line_magic, cell_magic
from dawetsql.widgets import SchemaExplorer
from . import utils
from cryptography.fernet import Fernet
@magics_... | true | true |
f77691db61ffc836621e069559cd6bf7fcd37ef9 | 7,732 | py | Python | ampel/config/builder/DistConfigBuilder.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/config/builder/DistConfigBuilder.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/config/builder/DistConfigBuilder.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-core/ampel/config/builder/DistConfigBuilder.py
# License: BSD-3-Clause
# Author: valery brinnel <firstname.lastname@gmail.com>
# Date: 09.10.2019
# Last Modified Date: 14.03.2021
# Last Modified By: va... | 31.430894 | 106 | 0.700466 |
import json, yaml, pkg_resources, os, re
from pkg_resources import EggInfoDistribution, DistInfoDistribution from typing import Any
from collections.abc import Callable
from ampel.config.builder.ConfigBuilder import ConfigBuilder
from ampel.util.distrib import get_dist_names, get_files
from ampel.log import VERBOSE
... | true | true |
f77692715b789c45a93ff18b6f0dc8a08bf58a90 | 29,812 | py | Python | electrum_trc/plugins/ledger/ledger.py | TheSin-/electrum-trc | d2f5b15fd4399a9248cce0d63e20128f3f54e69c | [
"MIT"
] | 1 | 2019-08-20T18:05:32.000Z | 2019-08-20T18:05:32.000Z | electrum_trc/plugins/ledger/ledger.py | TheSin-/electrum-trc | d2f5b15fd4399a9248cce0d63e20128f3f54e69c | [
"MIT"
] | 1 | 2022-03-14T19:45:31.000Z | 2022-03-14T19:45:31.000Z | electrum_trc/plugins/ledger/ledger.py | TheSin-/electrum-trc | d2f5b15fd4399a9248cce0d63e20128f3f54e69c | [
"MIT"
] | null | null | null | from struct import pack, unpack
import hashlib
import sys
import traceback
from electrum_trc import constants
from electrum_trc import ecc
from electrum_trc.bitcoin import (TYPE_ADDRESS, int_to_hex, var_int,
b58_address_to_hash160,
hash160_to_b58_ad... | 42.406828 | 242 | 0.584194 | from struct import pack, unpack
import hashlib
import sys
import traceback
from electrum_trc import constants
from electrum_trc import ecc
from electrum_trc.bitcoin import (TYPE_ADDRESS, int_to_hex, var_int,
b58_address_to_hash160,
hash160_to_b58_ad... | true | true |
f776937daec7f402c05fbd580f5f58aa148a90a9 | 8,540 | py | Python | modules/dfx_modules.py | Lumonk/CNNs.PyTorch | d634fb63c86bc135e7be79102983045696bdaed4 | [
"MIT"
] | 3 | 2019-08-20T12:11:07.000Z | 2020-04-10T15:43:38.000Z | modules/dfx_modules.py | Lumonk/CNNs.PyTorch | d634fb63c86bc135e7be79102983045696bdaed4 | [
"MIT"
] | null | null | null | modules/dfx_modules.py | Lumonk/CNNs.PyTorch | d634fb63c86bc135e7be79102983045696bdaed4 | [
"MIT"
] | 1 | 2020-03-06T13:49:49.000Z | 2020-03-06T13:49:49.000Z | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from .dfx import quant, quant_grad, quant_fb
__all__ = ['QLinear', 'QConv2d', 'QBatchNorm2d']
class QLinear(nn.Linear):
def __init__(self, in_features, out_features, bias=True, weight_copy=True):
super(QLin... | 38.125 | 117 | 0.59918 | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from .dfx import quant, quant_grad, quant_fb
__all__ = ['QLinear', 'QConv2d', 'QBatchNorm2d']
class QLinear(nn.Linear):
def __init__(self, in_features, out_features, bias=True, weight_copy=True):
super(QLin... | true | true |
f77693870d2a5ea292b1360b1e5ff6aba7678595 | 52 | py | Python | lambda_utils/__init__.py | Cloud-Partner/lambda_utils | 549fd3929915afaed88ff7956d06d3e774bbf052 | [
"MIT"
] | null | null | null | lambda_utils/__init__.py | Cloud-Partner/lambda_utils | 549fd3929915afaed88ff7956d06d3e774bbf052 | [
"MIT"
] | null | null | null | lambda_utils/__init__.py | Cloud-Partner/lambda_utils | 549fd3929915afaed88ff7956d06d3e774bbf052 | [
"MIT"
] | null | null | null | from .lambda_utils import Utils
__all__ = ['Utils']
| 17.333333 | 31 | 0.75 | from .lambda_utils import Utils
__all__ = ['Utils']
| true | true |
f776960177a9aa3c005bc24cedf4214752269689 | 773 | py | Python | Week%20Of%20Code%2024/Day2_Happy_Ladybugs.py | samir4nov/Hackerrank | 4d89d602f1d94e25aeceb5e6c51ef65c9654d931 | [
"MIT"
] | 1 | 2017-04-19T17:57:49.000Z | 2017-04-19T17:57:49.000Z | Week%20Of%20Code%2024/Day2_Happy_Ladybugs.py | sameer-j/Hackerrank | 4d89d602f1d94e25aeceb5e6c51ef65c9654d931 | [
"MIT"
] | null | null | null | Week%20Of%20Code%2024/Day2_Happy_Ladybugs.py | sameer-j/Hackerrank | 4d89d602f1d94e25aeceb5e6c51ef65c9654d931 | [
"MIT"
] | null | null | null | #!/bin/python3
"""
https://www.hackerrank.com/contests/w24/challenges/happy-ladybugs
"""
import sys
from itertools import groupby
Q = int(input().strip())
for a0 in range(Q):
n = int(input().strip())
b = list(input().strip())
result = []
uniq_b = set(b)
if '_' not in uniq_b:
f... | 25.766667 | 66 | 0.496766 | import sys
from itertools import groupby
Q = int(input().strip())
for a0 in range(Q):
n = int(input().strip())
b = list(input().strip())
result = []
uniq_b = set(b)
if '_' not in uniq_b:
for x, y in groupby(b):
if len(list(y))>=2:
result.append(True)
... | true | true |
f776992e2a266970576c43b08e068d7185dbfa5f | 4,806 | py | Python | pdm/installers/installers.py | ElijahSink/pdm | f575fed3b8a2afbb66652a907aa7a4510d6c67f8 | [
"MIT"
] | null | null | null | pdm/installers/installers.py | ElijahSink/pdm | f575fed3b8a2afbb66652a907aa7a4510d6c67f8 | [
"MIT"
] | null | null | null | pdm/installers/installers.py | ElijahSink/pdm | f575fed3b8a2afbb66652a907aa7a4510d6c67f8 | [
"MIT"
] | null | null | null | from __future__ import annotations
import pathlib
import sys
from typing import TYPE_CHECKING
from installer.destinations import SchemeDictionaryDestination
from installer.exceptions import InvalidWheelSource
from installer.sources import WheelFile as _WheelFile
from pdm import termui
from pdm.exceptions import Unin... | 34.328571 | 83 | 0.646692 | from __future__ import annotations
import pathlib
import sys
from typing import TYPE_CHECKING
from installer.destinations import SchemeDictionaryDestination
from installer.exceptions import InvalidWheelSource
from installer.sources import WheelFile as _WheelFile
from pdm import termui
from pdm.exceptions import Unin... | true | true |
f776992ed07b95a58c346b4a68eb9c55e375b6a1 | 638 | py | Python | oidc_provider/management/commands/creatersakey.py | coolapp-dev/django-oidc-provider | 0c8cdc6c580b9d72e46c631167b2347affed6e74 | [
"MIT"
] | null | null | null | oidc_provider/management/commands/creatersakey.py | coolapp-dev/django-oidc-provider | 0c8cdc6c580b9d72e46c631167b2347affed6e74 | [
"MIT"
] | null | null | null | oidc_provider/management/commands/creatersakey.py | coolapp-dev/django-oidc-provider | 0c8cdc6c580b9d72e46c631167b2347affed6e74 | [
"MIT"
] | null | null | null | from Cryptodome.PublicKey import RSA
from django.core.management.base import BaseCommand
from oidc_provider.models import RSAKey
class Command(BaseCommand):
help = "Randomly generate a new RSA key for the OpenID server"
def handle(self, *args, **options):
try:
key = RSA.generate(2048)
... | 31.9 | 79 | 0.626959 | from Cryptodome.PublicKey import RSA
from django.core.management.base import BaseCommand
from oidc_provider.models import RSAKey
class Command(BaseCommand):
help = "Randomly generate a new RSA key for the OpenID server"
def handle(self, *args, **options):
try:
key = RSA.generate(2048)
... | true | true |
f77699aba5949f00fdac31c83827e0eebb9cd3da | 3,191 | py | Python | profiles_project/settings.py | narendra1695/api-work-python | a312023d9b66da9d002c2dbe2379e1d17e13864b | [
"MIT"
] | null | null | null | profiles_project/settings.py | narendra1695/api-work-python | a312023d9b66da9d002c2dbe2379e1d17e13864b | [
"MIT"
] | 5 | 2021-03-19T01:50:10.000Z | 2021-09-22T18:52:14.000Z | profiles_project/settings.py | narendra1695/api-work-python | a312023d9b66da9d002c2dbe2379e1d17e13864b | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
imp... | 25.733871 | 91 | 0.697274 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = ')bdx5jejjvr5^utgl$l_=h0+4g@&gx(rmnx!f^(hn+&ejo&l1@'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f7769a044ee575f8f7cce0266fa9801a404ee775 | 1,433 | py | Python | cle/backends/elf/relocation/__init__.py | zeroSteiner/cle | 340fb11d4f6c8f04a5273fe43203dea83e10c22c | [
"BSD-2-Clause"
] | 2 | 2019-06-01T23:41:15.000Z | 2020-01-21T22:08:50.000Z | cle/backends/elf/relocation/__init__.py | fiberx/cle-fiber | 08f5f24d61470da8a99ee0c40f2185397a958313 | [
"BSD-2-Clause"
] | null | null | null | cle/backends/elf/relocation/__init__.py | fiberx/cle-fiber | 08f5f24d61470da8a99ee0c40f2185397a958313 | [
"BSD-2-Clause"
] | null | null | null | import os
import logging
import importlib
import archinfo
from collections import defaultdict
from ...relocation import Relocation
ALL_RELOCATIONS = defaultdict(dict)
complaint_log = set()
path = os.path.dirname(os.path.abspath(__file__))
l = logging.getLogger('cle.backends.elf.relocation')
def load_relocations():
... | 28.098039 | 94 | 0.632938 | import os
import logging
import importlib
import archinfo
from collections import defaultdict
from ...relocation import Relocation
ALL_RELOCATIONS = defaultdict(dict)
complaint_log = set()
path = os.path.dirname(os.path.abspath(__file__))
l = logging.getLogger('cle.backends.elf.relocation')
def load_relocations():
... | true | true |
f7769b166db7fc3bfe9af6246231b442e4b1dd98 | 637 | py | Python | jsk_recognition/jsk_recognition_utils/python/jsk_recognition_utils/depth.py | VT-ASIM-LAB/autoware.ai | 211dff3bee2d2782cb10444272c5d98d1f30d33a | [
"Apache-2.0"
] | null | null | null | jsk_recognition/jsk_recognition_utils/python/jsk_recognition_utils/depth.py | VT-ASIM-LAB/autoware.ai | 211dff3bee2d2782cb10444272c5d98d1f30d33a | [
"Apache-2.0"
] | null | null | null | jsk_recognition/jsk_recognition_utils/python/jsk_recognition_utils/depth.py | VT-ASIM-LAB/autoware.ai | 211dff3bee2d2782cb10444272c5d98d1f30d33a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from skimage.segmentation import slic
from skimage.feature import peak_local_max
from skimage.morphology import binary_closing
from jsk_recognition_utils.mask import descent_closing
def split_fore_background(depth_img, footprint=None):
if footprin... | 27.695652 | 80 | 0.740973 |
import numpy as np
from skimage.segmentation import slic
from skimage.feature import peak_local_max
from skimage.morphology import binary_closing
from jsk_recognition_utils.mask import descent_closing
def split_fore_background(depth_img, footprint=None):
if footprint is None:
footprint = np.ones((3, 3))... | true | true |
f7769b418b2d5404c61ed1094e2a1a790aa6d678 | 562 | py | Python | packages/pyre/units/area.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/units/area.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/units/area.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
from .length import meter, centimeter, inch, foot, mile
#
# definitions of common area units
# data taken from Appendix F of Halliday, Resnick, Walker, "Fundamentals of Physics",
# fourth edition, John Willey and... | 18.129032 | 85 | 0.711744 |
from .length import meter, centimeter, inch, foot, mile
square_meter = meter**2
square_centimeter = centimeter**2
square_foot = foot**2
square_inch = inch**2
square_mile = mile**2
acre = 43560 * square_foot
hectare = 10000 * square_meter
barn = 1e-28 * square_meter
| true | true |
f7769cf5a7737d15b34a72ffe33c0d5811711034 | 38,084 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2021-09-07T18:35:07.000Z | 2021-09-07T18:35:07.000Z | sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"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.
# --------------------------------------------------------------------... | 52.027322 | 221 | 0.668942 |
import os
import time
import pytest
import re
import logging
from azure.core.credentials import AzureKeyCredential, AccessToken
from azure.ai.formrecognizer._helpers import adjust_value_type
from devtools_testutils import (
AzureTestCase,
AzureMgmtPreparer,
FakeResource,
ResourceGroupPreparer,
)
from... | true | true |
f7769d299e851e07deb13d912956cff2c75b6ed2 | 1,410 | py | Python | scripts/maya/gfToolsLauncher.py | giulianofranca/gfTools | b23616ad7483c5f0798c1f1a8829f5b5f08ef6ea | [
"Apache-2.0"
] | 1 | 2021-09-25T06:45:37.000Z | 2021-09-25T06:45:37.000Z | scripts/maya/gfToolsLauncher.py | giuliano-franca/gfTools | b23616ad7483c5f0798c1f1a8829f5b5f08ef6ea | [
"Apache-2.0"
] | null | null | null | scripts/maya/gfToolsLauncher.py | giuliano-franca/gfTools | b23616ad7483c5f0798c1f1a8829f5b5f08ef6ea | [
"Apache-2.0"
] | 1 | 2021-09-25T06:45:41.000Z | 2021-09-25T06:45:41.000Z | # -*- coding: utf-8 -*-
"""
Copyright 2020 Giuliano Franca
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 agree... | 31.333333 | 100 | 0.675887 | import maya.cmds as cmds
import gfTools.gfCore as gfCore
def launchMayaNodes():
if gfCore.platform() == "Windows":
cmds.loadPlugin("gfToolsNodes.mll")
elif gfCore.platform() == "Linux":
cmds.loadPlugin("gfToolsNodes.so")
else:
cmds.loadPlugin("gfToolsNodes.bundle")
def launchGFUtil... | true | true |
f7769e3254aeebe0cfed3609800d5272bcda07f2 | 5,820 | py | Python | src/Python/lapnet/test_line.py | 565353780/railway-fault-detect | 56c5df835d21efeb4e09111282d251c80eaa6ca0 | [
"MIT"
] | null | null | null | src/Python/lapnet/test_line.py | 565353780/railway-fault-detect | 56c5df835d21efeb4e09111282d251c80eaa6ca0 | [
"MIT"
] | null | null | null | src/Python/lapnet/test_line.py | 565353780/railway-fault-detect | 56c5df835d21efeb4e09111282d251c80eaa6ca0 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import os
import cv2
from LapNet import LAPNet
from create_dataset import createDataset
from torch.nn import DataParallel
from collections import OrderedDict
from torch.nn.parameter import Parameter
import json
import base64
import numpy as np
from flask import Flask, request, Respons... | 37.548387 | 122 | 0.634708 | import torch
import numpy as np
import os
import cv2
from LapNet import LAPNet
from create_dataset import createDataset
from torch.nn import DataParallel
from collections import OrderedDict
from torch.nn.parameter import Parameter
import json
import base64
import numpy as np
from flask import Flask, request, Respons... | true | true |
f7769e729a03b91248419515b625f719c0b3131a | 2,264 | py | Python | model-optimizer/extensions/front/caffe/data_augmentation_ext.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 3 | 2019-07-08T09:03:03.000Z | 2020-09-09T10:34:17.000Z | model-optimizer/extensions/front/caffe/data_augmentation_ext.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 6 | 2022-01-11T18:56:22.000Z | 2022-02-21T13:20:20.000Z | model-optimizer/extensions/front/caffe/data_augmentation_ext.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 3 | 2021-02-05T17:11:17.000Z | 2021-04-19T08:33:31.000Z | """
Copyright (c) 2017-2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 39.034483 | 112 | 0.687721 | from mo.front.caffe.collect_attributes import merge_attrs
from mo.front.caffe.extractors.utils import embed_input
from mo.front.extractor import FrontExtractorOp
from mo.ops.op import Op
class DataAugmentationFrontExtractor(FrontExtractorOp):
op = 'DataAugmentation'
enabled = True
@staticmethod
def e... | true | true |
f7769ebb4fb27bae2b92ec43339ac11a7654cdee | 974 | py | Python | tests/test_util_excel.py | LinAGKar/fava | 4b781d3f9b6bfb0148d8c7c82220bd99b8a03696 | [
"MIT"
] | null | null | null | tests/test_util_excel.py | LinAGKar/fava | 4b781d3f9b6bfb0148d8c7c82220bd99b8a03696 | [
"MIT"
] | null | null | null | tests/test_util_excel.py | LinAGKar/fava | 4b781d3f9b6bfb0148d8c7c82220bd99b8a03696 | [
"MIT"
] | null | null | null | # pylint: disable=missing-docstring
from __future__ import annotations
import pytest
from beancount.query.query import run_query
from fava.core import FavaLedger
from fava.util import excel
def test_to_csv(example_ledger: FavaLedger) -> None:
types, rows = run_query(
example_ledger.all_entries,
... | 26.324324 | 73 | 0.685832 | from __future__ import annotations
import pytest
from beancount.query.query import run_query
from fava.core import FavaLedger
from fava.util import excel
def test_to_csv(example_ledger: FavaLedger) -> None:
types, rows = run_query(
example_ledger.all_entries,
example_ledger.options,
"bal... | true | true |
f7769f490477ad00234d7034181612999d1f058e | 4,912 | py | Python | doc/scripts/docgen.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | 1 | 2021-07-01T02:51:08.000Z | 2021-07-01T02:51:08.000Z | doc/scripts/docgen.py | mayunpeng/Theano | c74da33de3768e231ffa0d92d9d11667a2a5aedb | [
"BSD-3-Clause"
] | null | null | null | doc/scripts/docgen.py | mayunpeng/Theano | c74da33de3768e231ffa0d92d9d11667a2a5aedb | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import sys
import os
import shutil
import inspect
from epydoc import docintrospecter
from epydoc.apidoc import RoutineDoc
def Op_to_RoutineDoc(op, routine_doc, module_name=None):
routine_doc.specialize_to(RoutineDoc)
#NB: this code is lifted from epydoc/docintrospecter... | 32.104575 | 79 | 0.579601 | from __future__ import print_function
import sys
import os
import shutil
import inspect
from epydoc import docintrospecter
from epydoc.apidoc import RoutineDoc
def Op_to_RoutineDoc(op, routine_doc, module_name=None):
routine_doc.specialize_to(RoutineDoc)
assert hasattr(op, 'perform')
rout... | true | true |
f776a047ac8f6d5656b14508f0d6d72d756119a9 | 54 | py | Python | 03-Jupyter-Notebook-Numpy-and-Matplotlib/02-Magic-Commands/mymodule/FirstML.py | youaresherlock/scikit-learnNoteAndCode | 2f63340429f4aadb322355da5eab6e6e7392bc51 | [
"Apache-2.0"
] | 1 | 2021-05-24T05:14:17.000Z | 2021-05-24T05:14:17.000Z | 03-Jupyter-Notebook-Numpy-and-Matplotlib/02-Magic-Commands/mymodule/FirstML.py | youaresherlock/scikit-learnNoteAndCode | 2f63340429f4aadb322355da5eab6e6e7392bc51 | [
"Apache-2.0"
] | null | null | null | 03-Jupyter-Notebook-Numpy-and-Matplotlib/02-Magic-Commands/mymodule/FirstML.py | youaresherlock/scikit-learnNoteAndCode | 2f63340429f4aadb322355da5eab6e6e7392bc51 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
def predict(x):
print("?") | 18 | 23 | 0.481481 | def predict(x):
print("?") | true | true |
f776a1274e05d3958c85a408350e0f32d5593c9f | 2,861 | py | Python | model-optimizer/mo/front/common/partial_infer/matmul.py | undeadinu/dldt | fbc7a4a710c24def8ab199926a7da90a0394b87d | [
"Apache-2.0"
] | 1 | 2019-03-22T06:35:55.000Z | 2019-03-22T06:35:55.000Z | model-optimizer/mo/front/common/partial_infer/matmul.py | undeadinu/dldt | fbc7a4a710c24def8ab199926a7da90a0394b87d | [
"Apache-2.0"
] | null | null | null | model-optimizer/mo/front/common/partial_infer/matmul.py | undeadinu/dldt | fbc7a4a710c24def8ab199926a7da90a0394b87d | [
"Apache-2.0"
] | 1 | 2019-06-11T06:20:42.000Z | 2019-06-11T06:20:42.000Z | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 37.644737 | 111 | 0.67389 |
import logging as log
import numpy as np
from mo.utils.error import Error
def tf_matmul_infer(node):
assert (len(node.in_nodes()) == 2)
shapes = [node.in_node(i).shape for i in range(2)]
log.debug('matmul shapes: {}'.format(shapes))
if node.transpose_a or node.transpose_b or any(s is None or len(s)... | true | true |
f776a1330b58fb0d54f2b181be671ac569b23cb2 | 118 | py | Python | exercicios curso em video/ex007.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex007.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex007.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | n1=int(input('primeira nota: '))
n2=int(input('segunda nota: '))
print('a Média é {}'.format(((n1+n2)/2)))
| 14.75 | 42 | 0.559322 | n1=int(input('primeira nota: '))
n2=int(input('segunda nota: '))
print('a Média é {}'.format(((n1+n2)/2)))
| true | true |
f776a167991fc481f1144c42cfed6338020ccea9 | 405 | py | Python | env/Lib/site-packages/plotly/validators/funnel/_cliponaxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/funnel/_cliponaxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/funnel/_cliponaxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class CliponaxisValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="cliponaxis", parent_name="funnel", **kwargs):
super(CliponaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 33.75 | 81 | 0.681481 | import _plotly_utils.basevalidators
class CliponaxisValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="cliponaxis", parent_name="funnel", **kwargs):
super(CliponaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f776a1a7ee264d9d0000242b905d17e4e65361b9 | 367 | py | Python | esercitazioni/ex3.py | lsoffi/EsperienzeDiLaboratorioDiCalcolo201920 | 7a2a821b37cc8dfca527e9afb639a86a8e6c759b | [
"MIT"
] | 1 | 2019-10-18T10:03:58.000Z | 2019-10-18T10:03:58.000Z | esercitazioni/ex3.py | lsoffi/EsperienzeDiLaboratorioDiCalcolo201920 | 7a2a821b37cc8dfca527e9afb639a86a8e6c759b | [
"MIT"
] | null | null | null | esercitazioni/ex3.py | lsoffi/EsperienzeDiLaboratorioDiCalcolo201920 | 7a2a821b37cc8dfca527e9afb639a86a8e6c759b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
plt.title('Un primo plot con Python')
plt.xlabel('x')
plt.ylabel('y')
x = np.linspace(0.0, 5.0, 100)
y = x
plt.plot(x,y,label='y=x')
x, y = np.loadtxt('temp.dat', usecols=(0,2), delimiter=' ', unpack=True)
plt.plot(x,y, 'x',label='Loaded from fil... | 26.214286 | 72 | 0.675749 | import matplotlib.pyplot as plt
import numpy as np
plt.title('Un primo plot con Python')
plt.xlabel('x')
plt.ylabel('y')
x = np.linspace(0.0, 5.0, 100)
y = x
plt.plot(x,y,label='y=x')
x, y = np.loadtxt('temp.dat', usecols=(0,2), delimiter=' ', unpack=True)
plt.plot(x,y, 'x',label='Loaded from file!')
plt.savefig('traie... | true | true |
f776a2a9475ad8562455c2749c864a9aead28e8e | 4,516 | py | Python | data-science-not/weeks/m06_twitter/p01/twitter_basics.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 4 | 2019-07-03T00:57:01.000Z | 2020-12-11T23:06:11.000Z | data-science-not/weeks/m06_twitter/p01/twitter_basics.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 1 | 2019-10-19T17:42:42.000Z | 2019-10-19T17:42:42.000Z | data-science-not/weeks/m06_twitter/p01/twitter_basics.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 1 | 2019-11-05T04:14:08.000Z | 2019-11-05T04:14:08.000Z | """
Your task is to implement some basic functions to track live tweets and inspect their content
To complete this task and test it, you MUST have created a twitter account and you should now
your credentials: access_token, access_token_secret, consumer_key, consumer_secret
More info about the Twitter API at: https://... | 38.931034 | 133 | 0.741364 |
from m06_twitter.p0.twitter_streaming import TweetToFileListener
from m06_twitter.p0.twitter_streaming import load_props
from time import sleep
from tweepy import OAuthHandler
from tweepy import Stream
import json
def get_tweet_stream(output_file, twitter_credentials):
access_token = twitter_credentials['acces... | true | true |
f776a2c9743f599d52e495910398e0e0f27e86f8 | 4,447 | py | Python | code/plotting_psc.py | Rockysed/PSC_classification | 1815b673ac9374d9d2abd08ba0f1f43597316dee | [
"MIT"
] | null | null | null | code/plotting_psc.py | Rockysed/PSC_classification | 1815b673ac9374d9d2abd08ba0f1f43597316dee | [
"MIT"
] | null | null | null | code/plotting_psc.py | Rockysed/PSC_classification | 1815b673ac9374d9d2abd08ba0f1f43597316dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 10:48:58 2019
@author: rocco
"""
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import pandas as pd
import os
"""
Definition function to plot psc, df is a pandas dataframe, i = 0 if Northern Emisphere, i = 1 if Southern Emisphere
title, classi... | 44.029703 | 148 | 0.54846 | import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import pandas as pd
import os
def plot_psc(df, i, title, classifier_type):
if i == 1:
ax = plt.axes(projection=ccrs.Orthographic(0, -90))
else:
ax = plt.axes(projection=ccrs.Orthographic(0, 90))
ax.coastlines(resolution='1... | true | true |
f776a342301cdfd9f61d7a17dc9a96b8241ab9a5 | 20,791 | py | Python | salt/states/reg.py | tqrg-bot/salt | 12c5b33396ac1b4d47c7ca4d7dbdd13087073a4b | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | salt/states/reg.py | tqrg-bot/salt | 12c5b33396ac1b4d47c7ca4d7dbdd13087073a4b | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/states/reg.py | tqrg-bot/salt | 12c5b33396ac1b4d47c7ca4d7dbdd13087073a4b | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
r'''
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
Hives
-----
This is the top level of the registry. T... | 33.479871 | 117 | 0.553268 | from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.utils.stringutils
log = logging.getLogger(__name__)
def __virtual__():
if 'reg.read_value' not in __utils__:
return (False, 'reg state module failed to load: '
'missing util functio... | true | true |
f776a4498da4c91bf31a518ee054bd270caec96a | 74 | py | Python | tests/wasp1/AllAnswerSets/bug_14.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/wasp1/AllAnswerSets/bug_14.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/wasp1/AllAnswerSets/bug_14.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
true.
w :- true.
w :- not w.
"""
output = """
{true, w}
"""
| 6.727273 | 12 | 0.405405 | input = """
true.
w :- true.
w :- not w.
"""
output = """
{true, w}
"""
| true | true |
f776a4b8c088c5b79e41c05603b4f4dfbfab2ce2 | 1,993 | py | Python | app/__init__.py | yasirabd/flask-storytelling-twitter | d2efb8297145c239877669cf82810230f3d052c3 | [
"MIT"
] | 1 | 2019-02-04T03:00:39.000Z | 2019-02-04T03:00:39.000Z | app/__init__.py | yasirabd/flask-storytelling-twitter | d2efb8297145c239877669cf82810230f3d052c3 | [
"MIT"
] | 1 | 2018-06-30T02:17:25.000Z | 2018-06-30T02:17:40.000Z | app/__init__.py | yasirabd/flask-storytelling-twitter | d2efb8297145c239877669cf82810230f3d052c3 | [
"MIT"
] | null | null | null | import logging
from logging.handlers import RotatingFileHandler
import os
from flask import Flask, current_app
from flask_bootstrap import Bootstrap
from flask_babel import Babel
from flask_googlemaps import GoogleMaps
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import MetaData
from flask_migrate import Mig... | 29.308824 | 74 | 0.687908 | import logging
from logging.handlers import RotatingFileHandler
import os
from flask import Flask, current_app
from flask_bootstrap import Bootstrap
from flask_babel import Babel
from flask_googlemaps import GoogleMaps
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import MetaData
from flask_migrate import Mig... | true | true |
f776a670a2418d5089295c65d2816297ec3a548d | 473 | py | Python | dynamic_containment/config/celery.py | david-salac/dynamic-containment | 8fd54e57cc6c7f3377fac07e2e3607e1bcb170e1 | [
"MIT"
] | null | null | null | dynamic_containment/config/celery.py | david-salac/dynamic-containment | 8fd54e57cc6c7f3377fac07e2e3607e1bcb170e1 | [
"MIT"
] | null | null | null | dynamic_containment/config/celery.py | david-salac/dynamic-containment | 8fd54e57cc6c7f3377fac07e2e3607e1bcb170e1 | [
"MIT"
] | 1 | 2021-07-10T15:49:38.000Z | 2021-07-10T15:49:38.000Z | import os
from celery import Celery
from config import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
# Create celery application
CELERY_APP = Celery('dynamic-containment')
# Load Celery config file
CELERY_APP.config_from_object('config.celery_config')
# Add all tasks
CELERY_APP.autodis... | 22.52381 | 66 | 0.788584 | import os
from celery import Celery
from config import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
CELERY_APP = Celery('dynamic-containment')
CELERY_APP.config_from_object('config.celery_config')
CELERY_APP.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
@CELERY_APP.task
def li... | true | true |
f776a7fdd3fe5e16c34921f2c4896ec4cbe86e06 | 3,780 | py | Python | MMBT/image.py | AxelAllen/Multimodal-BERT-in-Medical-Image-and-Text-Classification | 595d02ae52e13d94f7d4fffdac1b9d2830aa6cce | [
"MIT"
] | 4 | 2021-09-20T17:35:01.000Z | 2022-02-16T09:35:08.000Z | MMBT/image.py | pokarats/LAP-final-project | b60bb7bd4fe07773ee3bf8edfc5011a337ac6037 | [
"MIT"
] | null | null | null | MMBT/image.py | pokarats/LAP-final-project | b60bb7bd4fe07773ee3bf8edfc5011a337ac6037 | [
"MIT"
] | 3 | 2021-10-24T02:27:14.000Z | 2022-03-15T12:00:08.000Z | """
This code is adapted from the image.py by Kiela et al. (2020) in https://github.com/facebookresearch/mmbt/blob/master/mmbt/models/image.py
and the equivalent Huggingface implementation: utils_mmimdb.py, which can be
found here: https://github.com/huggingface/transformers/blob/8ea412a86faa8e9edeeb6b5c46b08def06aa03e... | 42.954545 | 152 | 0.699735 | import os
import logging
import torch
import torch.nn as nn
import torchvision
import torch.nn.functional as F
logger = logging.getLogger(__name__)
POOLING_BREAKDOWN = {1: (1, 1), 2: (2, 1), 3: (3, 1), 4: (2, 2), 5: (5, 1), 6: (3, 2), 7: (7, 1), 8: (4, 2), 9: (3, 3)}
MMBT_DIR_PARENT = os.path.dirname(os.path.dirnam... | true | true |
f776a7ff8ba3f4bad0956682925ea752b311e456 | 710 | py | Python | tapis_cli/project_ini/schema/actor.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 8 | 2020-10-18T22:48:23.000Z | 2022-01-10T09:16:14.000Z | tapis_cli/project_ini/schema/actor.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 238 | 2019-09-04T14:37:54.000Z | 2020-04-15T16:24:24.000Z | tapis_cli/project_ini/schema/actor.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 5 | 2019-09-20T04:23:49.000Z | 2020-01-16T17:45:14.000Z | from . import BaseSchema
class Schema(BaseSchema):
PROPERTIES = [('name', '', str, 'Tapis actor name'),
('description', '', str, 'Tapis actor name description'),
('alias', '', str, 'Tapis actor alias'),
('stateless', True, bool, 'Whether actor is stateless'),
... | 44.375 | 75 | 0.5 | from . import BaseSchema
class Schema(BaseSchema):
PROPERTIES = [('name', '', str, 'Tapis actor name'),
('description', '', str, 'Tapis actor name description'),
('alias', '', str, 'Tapis actor alias'),
('stateless', True, bool, 'Whether actor is stateless'),
... | true | true |
f776a8a42eb1e3424d9e64d886150d68fb9dc42e | 12,496 | py | Python | GSAS-II-WONDER/SUBGROUPS.py | WONDER-project/GSAS-II-WONDER-OSX | f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9 | [
"MIT"
] | null | null | null | GSAS-II-WONDER/SUBGROUPS.py | WONDER-project/GSAS-II-WONDER-OSX | f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9 | [
"MIT"
] | null | null | null | GSAS-II-WONDER/SUBGROUPS.py | WONDER-project/GSAS-II-WONDER-OSX | f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
*SUBGROUPS: Interface to special GSAS Bilbao SUBGROUPS & k-SUBGROUPSMAG web pages*
-------------------------------
Extraction of space subgroups for a given space group and a propagation vector
from the GSAS version of SUBGROUPS & k-SUBGROUPSMAG web page on the Bilbao Crystallographic serv... | 35.60114 | 106 | 0.551216 | from __future__ import division, print_function
import requests
import numpy as np
import numpy.linalg as nl
import GSASIIspc as G2spc
import GSASIIpath
GSASIIpath.SetBinaryPath()
submagSite = 'http://www.cryst.ehu.es/cgi-bin/cryst/programs/subgrmag1_general_GSAS.pl'
def GetNonStdSubgroups(SGData, kvec,star=False,land... | true | true |
f776a8de6516a26b6259875ac2bad138ddd68724 | 2,521 | py | Python | pyqir-generator/tests/test_api.py | nilslice/pyqir | 9ae0395e5a0fe52221be16322256629e891d63c6 | [
"MIT"
] | 22 | 2021-11-30T21:52:30.000Z | 2022-03-17T02:05:17.000Z | pyqir-generator/tests/test_api.py | nilslice/pyqir | 9ae0395e5a0fe52221be16322256629e891d63c6 | [
"MIT"
] | 51 | 2021-11-24T03:42:49.000Z | 2022-03-25T20:51:24.000Z | pyqir-generator/tests/test_api.py | nilslice/pyqir | 9ae0395e5a0fe52221be16322256629e891d63c6 | [
"MIT"
] | 6 | 2021-11-30T22:36:49.000Z | 2022-03-17T17:21:16.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
Smoke tests to check that basic Python API functionality works and generates an
IR string without errors. These tests are not meant to make detailed assertions
about the generated IR.
"""
from pyqir.generator import BasicQisBuilder, SimpleMo... | 24.960396 | 79 | 0.625942 |
from pyqir.generator import BasicQisBuilder, SimpleModule
def test_bell() -> None:
module = SimpleModule("Bell circuit", num_qubits=2, num_results=2)
qis = BasicQisBuilder(module.builder)
qis.h(module.qubits[0])
qis.cx(module.qubits[0], module.qubits[1])
qis.m(module.qubits[0], module.results[0]... | true | true |
f776aa223496e8d97e2850291eee5931d3949cde | 4,882 | py | Python | tests/unit/states/rabbitmq_user_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 1 | 2020-10-20T03:35:34.000Z | 2020-10-20T03:35:34.000Z | tests/unit/states/rabbitmq_user_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 1 | 2020-10-21T21:38:49.000Z | 2020-10-21T21:38:49.000Z | tests/unit/states/rabbitmq_user_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch
)
fro... | 39.056 | 95 | 0.52499 | from __future__ import absolute_import
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch
)
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
from salt.states import rabbitmq_user
rabbitmq_user.__opts__ = {'t... | true | true |
f776ab9ca7db968123df3118310586873a3802e2 | 6,715 | py | Python | libs/nftk_modify_hosts_file.py | dre/neurofuzz_toolkit | fb36e8faa23a96a81a1e677a1add1347de765ed2 | [
"BSD-3-Clause"
] | null | null | null | libs/nftk_modify_hosts_file.py | dre/neurofuzz_toolkit | fb36e8faa23a96a81a1e677a1add1347de765ed2 | [
"BSD-3-Clause"
] | null | null | null | libs/nftk_modify_hosts_file.py | dre/neurofuzz_toolkit | fb36e8faa23a96a81a1e677a1add1347de765ed2 | [
"BSD-3-Clause"
] | 1 | 2018-04-21T21:39:38.000Z | 2018-04-21T21:39:38.000Z | '''
FILENAME : nftk_modify_hosts_file.py
AUTHORS : Andres Andreu <andres [at] neurofuzzsecurity dot com>
MODIFIED BY : Andres Andreu
DATE : 07/11/2015
LAST UPDATE : 05/18/2016
modifies an /etc/hosts file and then has the ability to reset it
back to its original state
... | 33.575 | 92 | 0.615786 | import os
import sys
import hashlib
import shutil
import subprocess
import platform
def md5_of_file(path, block_size=256*128, out_hex=False):
md5 = hashlib.md5()
with open(path,'rb') as f:
for chunk in iter(lambda: f.read(block_size), b''):
md5.update(chunk)
if out_hex:
return... | true | true |
f776acd8ac3ddb3f7505aa9fd9e185caae7c6a32 | 6,016 | py | Python | sunpy/cm/cm.py | ajeytiwary/sunpy | 6ba94b471f2a2e716f91ef8b8014adbef358aa6f | [
"BSD-2-Clause"
] | 1 | 2020-01-12T15:06:49.000Z | 2020-01-12T15:06:49.000Z | sunpy/cm/cm.py | ajeytiwary/sunpy | 6ba94b471f2a2e716f91ef8b8014adbef358aa6f | [
"BSD-2-Clause"
] | null | null | null | sunpy/cm/cm.py | ajeytiwary/sunpy | 6ba94b471f2a2e716f91ef8b8014adbef358aa6f | [
"BSD-2-Clause"
] | null | null | null | """
This module provides a set of colormaps specific for solar data.
"""
from __future__ import absolute_import
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from sunpy.cm import color_tables as ct
__all__ = ['get_cmap', 'show_colormaps']
sdoaia94 = ct.aia_color_table(94)
sdoaia131 =... | 26.619469 | 81 | 0.621343 | from __future__ import absolute_import
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from sunpy.cm import color_tables as ct
__all__ = ['get_cmap', 'show_colormaps']
sdoaia94 = ct.aia_color_table(94)
sdoaia131 = ct.aia_color_table(131)
sdoaia171 = ct.aia_color_table(171)
sdoaia193 = ... | true | true |
f776ad0961a1d866380b33e822dd8a8a3debed7a | 28,039 | py | Python | rlscope/parser/nvprof.py | UofT-EcoSystem/rlscope | cdd9bbdc2a3a832be24f20105b8c9fe28149cb63 | [
"Apache-2.0"
] | 35 | 2021-01-26T22:34:17.000Z | 2022-03-02T01:25:11.000Z | rlscope/parser/nvprof.py | UofT-EcoSystem/rlscope | cdd9bbdc2a3a832be24f20105b8c9fe28149cb63 | [
"Apache-2.0"
] | 1 | 2022-03-15T01:40:03.000Z | 2022-03-15T01:40:03.000Z | rlscope/parser/nvprof.py | UofT-EcoSystem/rlscope | cdd9bbdc2a3a832be24f20105b8c9fe28149cb63 | [
"Apache-2.0"
] | 1 | 2021-03-17T08:49:07.000Z | 2021-03-17T08:49:07.000Z | """
Collecting profiling data using ``nvprof``.
.. deprecated:: 1.0.0
We use CUPTI to collect GPU profiling data.
"""
from rlscope.profiler.rlscope_logging import logger
import re
import sys
import os
import csv
import textwrap
import pprint
from io import StringIO
import json
import codecs
from os.path import joi... | 50.611913 | 684 | 0.618959 | from rlscope.profiler.rlscope_logging import logger
import re
import sys
import os
import csv
import textwrap
import pprint
from io import StringIO
import json
import codecs
from os.path import join as _j, abspath as _a, dirname as _d, exists as _e, basename as _b
from rlscope.parser.common import *
from rlscope.parse... | true | true |
f776addcc97821b83a4df78fe6947ed6a11b376a | 8,347 | py | Python | pirateMapMaker.py | cornell-cup/cs-wall | c9097dd36fdf95842648844f956951c7572642ea | [
"Apache-2.0"
] | null | null | null | pirateMapMaker.py | cornell-cup/cs-wall | c9097dd36fdf95842648844f956951c7572642ea | [
"Apache-2.0"
] | 13 | 2018-03-21T04:13:50.000Z | 2018-04-13T20:34:11.000Z | pirateMapMaker.py | cornell-cup/cs-wall | c9097dd36fdf95842648844f956951c7572642ea | [
"Apache-2.0"
] | 2 | 2018-03-21T04:19:07.000Z | 2018-03-26T21:20:28.000Z | import json
import Globals as g
class PirateMapMaker():
"""Object class for making levels for Wall from JSON files
Contains the keywords for parsing a level JSON into
a data structure representing the game state for the GUI.
"""
###Keys to access JSON data
#Background image for game
... | 33.123016 | 95 | 0.577094 | import json
import Globals as g
class PirateMapMaker():
BACKGROUND = "BACKGROUND"
DIRECTION = "DIRECTION"
BOUNDARY = "BOUNDARY"
BOUNDARY_X = "BOUNDARY_X"
BOUNDARY_Y = "BOUNDARY_Y"
START = "START"
START_X = "START_X"
START_Y = "START_Y"
GOAL = "... | true | true |
f776ae3c5a194e3296b00490b485cc6eeefcd9b1 | 360 | py | Python | pizzapi/utils.py | MMRichardson/PizzaCLI | b25837674ffbe756d30e5ac6b6461dd8d09f442a | [
"MIT"
] | null | null | null | pizzapi/utils.py | MMRichardson/PizzaCLI | b25837674ffbe756d30e5ac6b6461dd8d09f442a | [
"MIT"
] | null | null | null | pizzapi/utils.py | MMRichardson/PizzaCLI | b25837674ffbe756d30e5ac6b6461dd8d09f442a | [
"MIT"
] | null | null | null | import requests
import xmltodict
# TODO: Find out why this occasionally hangs
def request_json(url, **kwargs):
r = requests.get(url.format(**kwargs), timeout=5)
r.raise_for_status()
return r.json()
def request_xml(url, **kwargs):
r = requests.get(url.format(**kwargs), timeout=5)
r.raise_for_stat... | 22.5 | 53 | 0.697222 | import requests
import xmltodict
def request_json(url, **kwargs):
r = requests.get(url.format(**kwargs), timeout=5)
r.raise_for_status()
return r.json()
def request_xml(url, **kwargs):
r = requests.get(url.format(**kwargs), timeout=5)
r.raise_for_status()
return xmltodict.parse(r.text)
| true | true |
f776ae4c2618c0fa4226555b404e78a13cdeee0b | 4,356 | py | Python | Countdown.py | pm-str/CountDown-More | 90eed19b3d5e417d474f1d79e07c6740f5a9a53d | [
"MIT"
] | null | null | null | Countdown.py | pm-str/CountDown-More | 90eed19b3d5e417d474f1d79e07c6740f5a9a53d | [
"MIT"
] | null | null | null | Countdown.py | pm-str/CountDown-More | 90eed19b3d5e417d474f1d79e07c6740f5a9a53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Countdown.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObj... | 48.4 | 162 | 0.685032 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(406, 210)
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(10, 10, 111, 26))
self.label.setObjectName("labe... | true | true |
f776af0da8f5768a5d06c0acaea4cb6c33bfd4dc | 13,418 | py | Python | tests/test_unit/test_pickaxe.py | josephniwjc/MINE-Database | 04b64d25cb24600c2a8cf98aaab685074fd8e7c5 | [
"MIT"
] | 4 | 2017-07-09T18:00:16.000Z | 2018-05-08T07:35:55.000Z | tests/test_unit/test_pickaxe.py | josephniwjc/MINE-Database | 04b64d25cb24600c2a8cf98aaab685074fd8e7c5 | [
"MIT"
] | 23 | 2021-03-09T15:51:51.000Z | 2021-03-31T17:36:32.000Z | tests/test_unit/test_pickaxe.py | josephniwjc/MINE-Database | 04b64d25cb24600c2a8cf98aaab685074fd8e7c5 | [
"MIT"
] | 6 | 2019-10-23T05:10:12.000Z | 2021-11-12T20:26:12.000Z | """Tests for pickaxe.py using pytest."""
# pylint: disable=redefined-outer-name
# pylint: disable=protected-access
import hashlib
import os
import re
import subprocess
from filecmp import cmp
from pathlib import Path
import pymongo
import pytest
from pymongo.errors import ServerSelectionTimeoutError
from rdkit.Chem i... | 35.217848 | 88 | 0.698614 |
import hashlib
import os
import re
import subprocess
from filecmp import cmp
from pathlib import Path
import pymongo
import pytest
from pymongo.errors import ServerSelectionTimeoutError
from rdkit.Chem import AllChem
from minedatabase import pickaxe
from minedatabase.databases import MINE
try:
client = pymongo... | true | true |
f776af2a7fc2e09e8170e8bf7f370c0c4b355ccc | 8,162 | py | Python | bmdcluster/optimizers/blockdiagonalBMD.py | csprock/bmdcluster | 0caf02bb8a93846aa679518ee6a839f843819eac | [
"MIT"
] | 5 | 2019-09-19T18:21:11.000Z | 2021-12-19T00:11:29.000Z | bmdcluster/optimizers/blockdiagonalBMD.py | csprock/bmdcluster | 0caf02bb8a93846aa679518ee6a839f843819eac | [
"MIT"
] | 1 | 2021-07-24T06:08:21.000Z | 2021-07-24T06:08:21.000Z | bmdcluster/optimizers/blockdiagonalBMD.py | csprock/bmdcluster | 0caf02bb8a93846aa679518ee6a839f843819eac | [
"MIT"
] | 1 | 2019-11-21T05:32:11.000Z | 2019-11-21T05:32:11.000Z | import numpy as np
"""
This module contains a variant of the Binary Matrix Decomposition (BMD) algorithm for clustering binary data
as presented in "A General Model for Clustering Binary Data" (Tao Li, 2005) and "On Clustering Binary Data"
(Tao Li & Shenghuo Zhu, 2005). This varient of the BMD algorithm is for da... | 32.133858 | 117 | 0.589806 | import numpy as np
ITER_MESSAGE = "Iteration: {0} ............. Cost: {1:.3f}"
def _bd_objective(A,B,W):
return np.linalg.norm(W - np.dot(A, B.T))
def _is_bd_outlier(B):
i = np.where(np.sum(B, axis=1) == B.shape[1])[0]
B[i, :] = 0
return B
def _d_ik(i, W, B):
... | true | true |
f776af87ed4c85c88590d5b9a2048ce2dc9c6e25 | 243 | py | Python | python/simulation_scripts/grep_log.py | Zelenyy/phd-code | d5b8bfefd2418a915dde89f7da2cb6683f438556 | [
"MIT"
] | null | null | null | python/simulation_scripts/grep_log.py | Zelenyy/phd-code | d5b8bfefd2418a915dde89f7da2cb6683f438556 | [
"MIT"
] | null | null | null | python/simulation_scripts/grep_log.py | Zelenyy/phd-code | d5b8bfefd2418a915dde89f7da2cb6683f438556 | [
"MIT"
] | null | null | null | from phd.utils.path_tools import LogTime
import numpy as np
log = LogTime(".")
paths = np.array(log.paths)
indx = paths.argsort()
count = 1
for t, p in zip(log.time[indx], paths[indx]):
if (count % 3 == 0):
print(p,t)
count+=1 | 22.090909 | 45 | 0.633745 | from phd.utils.path_tools import LogTime
import numpy as np
log = LogTime(".")
paths = np.array(log.paths)
indx = paths.argsort()
count = 1
for t, p in zip(log.time[indx], paths[indx]):
if (count % 3 == 0):
print(p,t)
count+=1 | true | true |
f776b1fb455c4c394a2b6b5627ae82e7a94badf6 | 1,810 | py | Python | contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_task.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_task.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_task.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import subprocess
f... | 33.518519 | 100 | 0.742541 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import subprocess
from pants.backend.core.tasks.task import Task
from pants.base.exceptions import TaskError
from pants.contrib.cpp.targets.cpp_binary import CppBin... | true | true |
f776b205dd6ba89ac5e1ae1c4cfee7016b268490 | 1,694 | py | Python | tests/sql_assurance/connectors/test_connection.py | sql-assurance/sql-assurance | de1f00aba53ac292a01eb194fef2dc4b177a02d5 | [
"MIT"
] | 4 | 2017-02-02T08:57:25.000Z | 2020-04-06T15:21:20.000Z | tests/sql_assurance/connectors/test_connection.py | ssola/sql-assurance | de1f00aba53ac292a01eb194fef2dc4b177a02d5 | [
"MIT"
] | 1 | 2021-11-15T17:46:57.000Z | 2021-11-15T17:46:57.000Z | tests/sql_assurance/connectors/test_connection.py | sql-assurance/sql-assurance | de1f00aba53ac292a01eb194fef2dc4b177a02d5 | [
"MIT"
] | null | null | null | import unittest
from thrift.transport.TTransport import TTransportException
from sql_assurance.connectors.connection import ConnectionPool
from sql_assurance.connectors.connection import ConnectionFactory
class TestConnectionFactory(unittest.TestCase):
def setUp(self):
self.connection_factory = Connectio... | 31.962264 | 85 | 0.664109 | import unittest
from thrift.transport.TTransport import TTransportException
from sql_assurance.connectors.connection import ConnectionPool
from sql_assurance.connectors.connection import ConnectionFactory
class TestConnectionFactory(unittest.TestCase):
def setUp(self):
self.connection_factory = Connectio... | true | true |
f776b23d28395dad8d68b41560cbe5c35f49dac4 | 7,825 | py | Python | tests/functional/test_wheel.py | jonparrott/pip | 9c037803197b05bb722223c2f5deffcbb7f4b0c4 | [
"MIT"
] | null | null | null | tests/functional/test_wheel.py | jonparrott/pip | 9c037803197b05bb722223c2f5deffcbb7f4b0c4 | [
"MIT"
] | null | null | null | tests/functional/test_wheel.py | jonparrott/pip | 9c037803197b05bb722223c2f5deffcbb7f4b0c4 | [
"MIT"
] | 1 | 2019-02-03T19:00:10.000Z | 2019-02-03T19:00:10.000Z | """'pip wheel' tests"""
import os
from os.path import exists
import pytest
from pip.locations import write_delete_marker_file
from pip.status_codes import ERROR, PREVIOUS_BUILD_DIR_ERROR
from tests.lib import pyversion
def test_pip_wheel_fails_without_wheel(script, data):
"""
Test 'pip wheel' fails without w... | 35.40724 | 78 | 0.679489 | import os
from os.path import exists
import pytest
from pip.locations import write_delete_marker_file
from pip.status_codes import ERROR, PREVIOUS_BUILD_DIR_ERROR
from tests.lib import pyversion
def test_pip_wheel_fails_without_wheel(script, data):
result = script.pip(
'wheel', '--no-index', '-f', data.f... | true | true |
f776b2800bfed75a902a899fce68615b8ea23018 | 11,476 | py | Python | AFLW/fddb_finetune.py | kli-nlpr/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | [
"Apache-2.0"
] | 159 | 2016-08-23T22:13:26.000Z | 2021-10-24T01:31:35.000Z | AFLW/fddb_finetune.py | mrgloom/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | [
"Apache-2.0"
] | 10 | 2016-08-23T05:59:07.000Z | 2018-05-24T02:31:41.000Z | AFLW/fddb_finetune.py | mrgloom/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | [
"Apache-2.0"
] | 77 | 2016-08-21T00:35:00.000Z | 2021-06-01T05:03:34.000Z | import os
import numpy as np
import mxnet as mx
import fddb_symbol_finetune
from mxnet import optimizer as opt
from mxnet.optimizer import get_updater
import time
batchsize = 4000
start_epoch = 1
end_epoch = 201
num_cls = 10
channel_len = 64
feature_len = 3136 + 8 + num_cls * (num_cls + 1) + num_cls * channel_len
lab... | 41.280576 | 115 | 0.586441 | import os
import numpy as np
import mxnet as mx
import fddb_symbol_finetune
from mxnet import optimizer as opt
from mxnet.optimizer import get_updater
import time
batchsize = 4000
start_epoch = 1
end_epoch = 201
num_cls = 10
channel_len = 64
feature_len = 3136 + 8 + num_cls * (num_cls + 1) + num_cls * channel_len
lab... | false | true |
f776b2c22797b9712ac911fbf026d272de5339bf | 10,191 | py | Python | eli5/formatters/image.py | binfnstats/eli5 | 017c738f8dcf3e31346de49a390835ffafad3f1b | [
"MIT"
] | 2,582 | 2016-09-15T01:14:22.000Z | 2022-03-27T16:26:00.000Z | eli5/formatters/image.py | binfnstats/eli5 | 017c738f8dcf3e31346de49a390835ffafad3f1b | [
"MIT"
] | 407 | 2016-09-19T18:43:14.000Z | 2021-12-12T15:57:53.000Z | eli5/formatters/image.py | binfnstats/eli5 | 017c738f8dcf3e31346de49a390835ffafad3f1b | [
"MIT"
] | 356 | 2016-09-19T18:35:51.000Z | 2022-03-20T12:52:08.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from typing import Union, Optional, Callable
import numpy as np
from PIL import Image
import matplotlib.cm
from eli5.base import Explanation
def format_as_image(expl, # type: Explanation
resampling_filter=Image.LANCZOS, # type: int
colormap=matp... | 35.262976 | 111 | 0.630458 | from __future__ import absolute_import
from typing import Union, Optional, Callable
import numpy as np
from PIL import Image
import matplotlib.cm
from eli5.base import Explanation
def format_as_image(expl, resampling_filter=Image.LANCZOS, colormap=matplotlib.cm.viridis, alpha_limit=0.65, ):
... | true | true |
f776b36fdc50fe1a5afe122994aba620ca0be61b | 2,562 | py | Python | tools/util.py | Tanveer81/BoxVOS | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | [
"BSD-2-Clause"
] | 4 | 2022-02-16T02:48:27.000Z | 2022-03-08T06:54:32.000Z | tools/util.py | Tanveer81/BoxVOS | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | [
"BSD-2-Clause"
] | null | null | null | tools/util.py | Tanveer81/BoxVOS | c30aa319f18f3fbee2a25e0ed25cb006a4598300 | [
"BSD-2-Clause"
] | null | null | null | import logging
from detectron2.data import get_detection_dataset_dicts, DatasetFromList, DatasetMapper, MapDataset, \
build_batch_data_loader
from detectron2.data.samplers import TrainingSampler, RepeatFactorTrainingSampler
def build_detection_train_loader(cfg, mapper=None):
"""
A data loader is created b... | 42 | 102 | 0.720531 | import logging
from detectron2.data import get_detection_dataset_dicts, DatasetFromList, DatasetMapper, MapDataset, \
build_batch_data_loader
from detectron2.data.samplers import TrainingSampler, RepeatFactorTrainingSampler
def build_detection_train_loader(cfg, mapper=None):
dataset_dicts = get_detection_data... | true | true |
f776b426db25fc42059e4891f14203bb1b69138a | 6,259 | py | Python | bin/coadd_chi2_db.py | jason-neal/companion_simulations | b5773e5539011d492b7128d0dd2778041ce50d52 | [
"MIT"
] | 1 | 2018-09-04T19:06:44.000Z | 2018-09-04T19:06:44.000Z | bin/coadd_chi2_db.py | jason-neal/companion_simulations | b5773e5539011d492b7128d0dd2778041ce50d52 | [
"MIT"
] | 85 | 2017-03-25T22:37:02.000Z | 2022-03-01T16:49:14.000Z | bin/coadd_chi2_db.py | jason-neal/companion_simulations | b5773e5539011d492b7128d0dd2778041ce50d52 | [
"MIT"
] | 1 | 2017-08-18T10:56:39.000Z | 2017-08-18T10:56:39.000Z | #!/usr/bin/env python
"""Co-add_chi2_values.py.
Create Table of minimum Chi_2 values and save to a table.
"""
import argparse
import warnings
import glob
import os
import sys
import numpy as np
import pandas as pd
import sqlalchemy as sa
import simulators
def parse_args(args):
"""Take care of all the argparse ... | 37.933333 | 118 | 0.56958 | import argparse
import warnings
import glob
import os
import sys
import numpy as np
import pandas as pd
import sqlalchemy as sa
import simulators
def parse_args(args):
parser = argparse.ArgumentParser(description='Create Co-added Chi-squared db.')
parser.add_argument('star', help='Star names')
parser.ad... | true | true |
f776b5628937f714142a6f782750030b4ef716db | 2,003 | py | Python | code_search/src/setup.py | dimara/kubeflow-examples | a328aab8b95e875209593bc3fd5b90c2fcfecb00 | [
"Apache-2.0"
] | 6 | 2018-12-18T10:14:46.000Z | 2022-03-31T08:35:09.000Z | code_search/src/setup.py | gaokaige1996/examples | 4bbc0c8fd86e09f1e41a9e0ff0b80fef150f018c | [
"Apache-2.0"
] | null | null | null | code_search/src/setup.py | gaokaige1996/examples | 4bbc0c8fd86e09f1e41a9e0ff0b80fef150f018c | [
"Apache-2.0"
] | 4 | 2019-02-14T13:19:42.000Z | 2020-07-22T10:34:11.000Z | from __future__ import print_function
import subprocess
from distutils.command.build import build as distutils_build #pylint: disable=no-name-in-module
from setuptools import setup, find_packages, Command as SetupToolsCommand
VERSION = '0.1.dev0'
with open('requirements.txt', 'r') as f:
install_requires = f.readlin... | 32.306452 | 95 | 0.697953 | from __future__ import print_function
import subprocess
from distutils.command.build import build as distutils_build from setuptools import setup, find_packages, Command as SetupToolsCommand
VERSION = '0.1.dev0'
with open('requirements.txt', 'r') as f:
install_requires = f.readlines()
CUSTOM_COMMANDS = [
[... | true | true |
f776b663a97055aaee68a4c04c8b6a381be68032 | 8,234 | py | Python | pytext/data/masked_util.py | baronrustamov/pytext | 9790943736e7c0ac53095be2e20177be6fc529a9 | [
"BSD-3-Clause"
] | 6,199 | 2018-12-13T15:34:51.000Z | 2022-03-26T04:08:58.000Z | pytext/data/masked_util.py | baronrustamov/pytext | 9790943736e7c0ac53095be2e20177be6fc529a9 | [
"BSD-3-Clause"
] | 1,356 | 2018-12-13T15:50:33.000Z | 2022-03-03T20:45:58.000Z | pytext/data/masked_util.py | baronrustamov/pytext | 9790943736e7c0ac53095be2e20177be6fc529a9 | [
"BSD-3-Clause"
] | 842 | 2018-12-13T15:35:13.000Z | 2022-03-23T13:27:00.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Dict, List, Optional, Set
import numpy as np
from pytext.common.constants import SpecialTokens, Token
from pytext.config.component import Component, ComponentType
from pytext.config.pytext_config import Con... | 35.491379 | 85 | 0.634564 | from typing import Dict, List, Optional, Set
import numpy as np
from pytext.common.constants import SpecialTokens, Token
from pytext.config.component import Component, ComponentType
from pytext.config.pytext_config import ConfigBase
from pytext.data.data_structures.annotation import Annotation, Intent, Root, Slot
from... | true | true |
f776b6b515a06c59ba08f7634ae590231fdd91ab | 8 | py | Python | bean/__init__.py | NewGr8Player/json-redis-demo | ad5d97b360c50afe04041ab8539d15d5c639969c | [
"MIT"
] | null | null | null | bean/__init__.py | NewGr8Player/json-redis-demo | ad5d97b360c50afe04041ab8539d15d5c639969c | [
"MIT"
] | null | null | null | bean/__init__.py | NewGr8Player/json-redis-demo | ad5d97b360c50afe04041ab8539d15d5c639969c | [
"MIT"
] | null | null | null | # 表结构模板
| 4 | 7 | 0.625 | true | true | |
f776b6db8416e8e89dd2d98a7cf77a38fe0a203f | 6,132 | py | Python | molotov/api.py | ymoran00/molotov | 2533d9653160845bd9a40defcf2e39810ad80215 | [
"Apache-2.0"
] | null | null | null | molotov/api.py | ymoran00/molotov | 2533d9653160845bd9a40defcf2e39810ad80215 | [
"Apache-2.0"
] | null | null | null | molotov/api.py | ymoran00/molotov | 2533d9653160845bd9a40defcf2e39810ad80215 | [
"Apache-2.0"
] | null | null | null | import random
import functools
import asyncio
_SCENARIO = {}
def get_scenarios():
scenarios = list(_SCENARIO.items())
scenarios.sort()
return [scenario for (name, scenario) in scenarios]
def get_scenario(name):
return _SCENARIO.get(name)
def _check_coroutine(func):
if not asyncio.iscoroutine... | 26.093617 | 79 | 0.652153 | import random
import functools
import asyncio
_SCENARIO = {}
def get_scenarios():
scenarios = list(_SCENARIO.items())
scenarios.sort()
return [scenario for (name, scenario) in scenarios]
def get_scenario(name):
return _SCENARIO.get(name)
def _check_coroutine(func):
if not asyncio.iscoroutine... | true | true |
f776b6ff51593aa8a905e264c0693daba28102f9 | 1,132 | py | Python | Code/Mapping/ultrasound_mapping.py | XavierValParejo/SeedBot | 7b338184ac9137027c726c43b481c2f79ad12b51 | [
"MIT"
] | null | null | null | Code/Mapping/ultrasound_mapping.py | XavierValParejo/SeedBot | 7b338184ac9137027c726c43b481c2f79ad12b51 | [
"MIT"
] | null | null | null | Code/Mapping/ultrasound_mapping.py | XavierValParejo/SeedBot | 7b338184ac9137027c726c43b481c2f79ad12b51 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import math
import lidar_to_grid_map as lg
from grid_mapping_for_a_star import OccupancyGridMap
from a_star_for_ogm_testing import a_star
f = "mesures.txt"
def read_measures(file):
measures = [line.split(",") for line in open(file)]
angles = []
distances ... | 28.3 | 98 | 0.677562 | import numpy as np
import matplotlib.pyplot as plt
import math
import lidar_to_grid_map as lg
from grid_mapping_for_a_star import OccupancyGridMap
from a_star_for_ogm_testing import a_star
f = "mesures.txt"
def read_measures(file):
measures = [line.split(",") for line in open(file)]
angles = []
distances ... | true | true |
f776b7ccbba1ed3b0bb3bd5ee5d3a53ce71374ba | 11,825 | py | Python | AREL-data-process/Data_process.py | vivid-k/code | c39d5a0ba219b499e595812a31362a8f2535859e | [
"MIT"
] | 1 | 2020-05-09T12:14:07.000Z | 2020-05-09T12:14:07.000Z | AREL-data-process/Data_process.py | vivid-k/code | c39d5a0ba219b499e595812a31362a8f2535859e | [
"MIT"
] | null | null | null | AREL-data-process/Data_process.py | vivid-k/code | c39d5a0ba219b499e595812a31362a8f2535859e | [
"MIT"
] | null | null | null | import json
import os.path as osp
import matplotlib.pyplot as plt
from collections import OrderedDict
from collections import Counter
import numpy
import h5py
import os
"""
处理文本数据,提取出story,并构建词表
"""
base_path = "AREL-data-process/"
train_data = json.load(open(osp.join(base_path, "test.story-in-sequence.json")))
# tra... | 36.609907 | 231 | 0.64482 | import json
import os.path as osp
import matplotlib.pyplot as plt
from collections import OrderedDict
from collections import Counter
import numpy
import h5py
import os
base_path = "AREL-data-process/"
train_data = json.load(open(osp.join(base_path, "test.story-in-sequence.json")))
val_data = json.load(open(osp.join(... | true | true |
f776b80b30de0a002786f871dd17bb28e264c781 | 5,333 | py | Python | ietf/doc/forms.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-11-20T03:40:40.000Z | 2021-11-20T03:40:42.000Z | ietf/doc/forms.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/doc/forms.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright The IETF Trust 2017, All Rights Reserved
from __future__ import unicode_literals
import datetime
import debug #pyflakes:ignore
from django import forms
from ietf.doc.fields import SearchableDocAliasesField, SearchableDocAliasField
from ietf.doc.models import RelatedDocument
from ietf.iesg.models import T... | 46.373913 | 254 | 0.648791 |
from __future__ import unicode_literals
import datetime
import debug from django import forms
from ietf.doc.fields import SearchableDocAliasesField, SearchableDocAliasField
from ietf.doc.models import RelatedDocument
from ietf.iesg.models import TelechatDate
from ietf.iesg.utils import telechat_page_count
class Tel... | true | true |
f776bce7216537ab587f01ed4ef242e5d1a67f4f | 957 | py | Python | core/botLogger.py | artpavlov/reportme | 5aee26fb61fc893b8a7112e16054ab2636d64775 | [
"MIT"
] | null | null | null | core/botLogger.py | artpavlov/reportme | 5aee26fb61fc893b8a7112e16054ab2636d64775 | [
"MIT"
] | null | null | null | core/botLogger.py | artpavlov/reportme | 5aee26fb61fc893b8a7112e16054ab2636d64775 | [
"MIT"
] | null | null | null | import os
import logging
import datetime
log_level = logging.DEBUG # Default message level
class UseridFilter(logging.Filter):
'''Default value for the user ID'''
def filter(self, record):
if not hasattr(record, 'userid'):
record.userid = 'Global'
return True
def setup_logger... | 24.538462 | 100 | 0.68861 | import os
import logging
import datetime
log_level = logging.DEBUG
class UseridFilter(logging.Filter):
def filter(self, record):
if not hasattr(record, 'userid'):
record.userid = 'Global'
return True
def setup_logger(name, log_file, level, format_=None):
format_ = format_ or ... | true | true |
f776bda01afab84f2efeca75a0f7c23b1fe0c564 | 846 | py | Python | problems/test_0415_iteration.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0415_iteration.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0415_iteration.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
import utils
# O(n) time. O(n) space. Iteration.
class Solution:
def addStrings(self, num1: str, num2: str) -> str:
if len(num1) < len(num2):
num1, num2 = num2, num1
result = []
carry = 0
for i in range(len(num1)):
a = ord(num1[len(num1) -... | 21.692308 | 79 | 0.473995 | import unittest
import utils
class Solution:
def addStrings(self, num1: str, num2: str) -> str:
if len(num1) < len(num2):
num1, num2 = num2, num1
result = []
carry = 0
for i in range(len(num1)):
a = ord(num1[len(num1) - 1 - i]) - ord('0')
b = ... | true | true |
f776bdbb903b990035d7b837397e75a7e0f126c1 | 1,666 | py | Python | practico_01/ejercicio_10.py | pablobots/frro-python-2021-00 | 1a3d6d80462e212aa724e6581baa68411b5d2240 | [
"MIT"
] | null | null | null | practico_01/ejercicio_10.py | pablobots/frro-python-2021-00 | 1a3d6d80462e212aa724e6581baa68411b5d2240 | [
"MIT"
] | 14 | 2021-02-18T00:17:02.000Z | 2021-03-22T12:53:01.000Z | practico_01/ejercicio_10.py | pablobots/frro-python-2021-00 | 1a3d6d80462e212aa724e6581baa68411b5d2240 | [
"MIT"
] | 1 | 2021-02-16T16:23:20.000Z | 2021-02-16T16:23:20.000Z | """For-Else, Any."""
from typing import Iterable
def tiene_pares_basico(numeros: Iterable[int]) -> bool:
"""Toma una lista y devuelve un booleano en función si tiene al menos un
número par."""
for numero in numeros:
if numero % 2 == 0:
return True
return False
# NO MODIFICAR - I... | 27.766667 | 123 | 0.611044 |
from typing import Iterable
def tiene_pares_basico(numeros: Iterable[int]) -> bool:
for numero in numeros:
if numero % 2 == 0:
return True
return False
assert tiene_pares_basico([1, 3, 5]) is False
assert tiene_pares_basico([1, 3, 5, 6]) is True
assert tiene_pares_basico([1, 3, 5, 600])... | true | true |
f776be33a00e9a7a7de35e919a22d945de72c2c3 | 688 | py | Python | testapp/urls.py | danigosa/django-simple-seo | 17610e50148c6672cb34e96654df1d3515b0444f | [
"BSD-3-Clause"
] | 11 | 2015-01-02T15:44:31.000Z | 2021-07-27T06:54:35.000Z | testapp/urls.py | danigosa/django-simple-seo | 17610e50148c6672cb34e96654df1d3515b0444f | [
"BSD-3-Clause"
] | 8 | 2016-02-03T07:07:04.000Z | 2022-01-13T00:42:32.000Z | testapp/urls.py | danigosa/django-simple-seo | 17610e50148c6672cb34e96654df1d3515b0444f | [
"BSD-3-Clause"
] | 8 | 2015-02-20T13:51:51.000Z | 2021-06-24T19:11:30.000Z | from django.conf.urls import patterns, url, include
from django.contrib import admin
from django.conf import settings
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from .views import template_test
urlpatterns = patterns(
'',
url(r'^test/', template_test, name='template_test'),
url(r... | 23.724138 | 85 | 0.713663 | from django.conf.urls import patterns, url, include
from django.contrib import admin
from django.conf import settings
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from .views import template_test
urlpatterns = patterns(
'',
url(r'^test/', template_test, name='template_test'),
url(r... | true | true |
f776be466fd5cc6f3d4677bad8504dfd2f5c5031 | 15,053 | py | Python | layers/box_utils.py | neuralmagic/yolact | 68ea8f6edcc0d61047a95071fa22d8d271164605 | [
"MIT"
] | 1 | 2021-11-08T05:57:18.000Z | 2021-11-08T05:57:18.000Z | layers/box_utils.py | neuralmagic/yolact | 68ea8f6edcc0d61047a95071fa22d8d271164605 | [
"MIT"
] | 2 | 2021-11-01T16:32:22.000Z | 2021-11-30T22:03:35.000Z | layers/box_utils.py | neuralmagic/yolact | 68ea8f6edcc0d61047a95071fa22d8d271164605 | [
"MIT"
] | 2 | 2021-11-08T05:57:33.000Z | 2021-11-15T23:16:52.000Z | # -*- coding: utf-8 -*-
import torch
from utils import timer
from data import cfg
@torch.jit.script
def point_form(boxes):
""" Convert prior_boxes to (xmin, ymin, xmax, ymax)
representation for comparison to point form ground truth data.
Args:
boxes: (tensor) center-size default boxes from priorbo... | 38.498721 | 125 | 0.615957 | import torch
from utils import timer
from data import cfg
@torch.jit.script
def point_form(boxes):
return torch.cat((boxes[:, :2] - boxes[:, 2:]/2, boxes[:, :2] + boxes[:, 2:]/2), 1)
@torch.jit.script
def center_size(boxes):
return torch.cat(( (boxes[:, 2:] + boxes[:, :2])/2, ... | true | true |
f776beb762c86ac01be1c2c31d491c5785f98ebb | 1,906 | py | Python | lab/models.py | bernardobgam/edtech_experiment | 88a64b925b6692261649418260a0bdf7b4a5a9d1 | [
"MIT"
] | null | null | null | lab/models.py | bernardobgam/edtech_experiment | 88a64b925b6692261649418260a0bdf7b4a5a9d1 | [
"MIT"
] | 8 | 2020-06-05T23:56:56.000Z | 2022-03-12T00:02:52.000Z | lab/models.py | bernardobgam/edtech_experiment | 88a64b925b6692261649418260a0bdf7b4a5a9d1 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.db.models import signals
class LabCode(models.Model):
"""
Lab Code. This will be used to match the responses to a laboratory session.
"""
code = models.CharField(max_length=50, blank=False, unique=... | 29.323077 | 77 | 0.742917 | from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.db.models import signals
class LabCode(models.Model):
code = models.CharField(max_length=50, blank=False, unique=True)
date = models.DateTimeField(blank=True)
content_access = models.BooleanField(def... | true | true |
f776bec32b597ebd4c2b7019a757d6b3e1a5ec4a | 1,095 | py | Python | setup.py | g3rd/django-timetable | 24012b17632a592115b8a9f510c685cfe6d49ba3 | [
"MIT"
] | 5 | 2015-04-29T12:38:51.000Z | 2021-09-25T09:27:22.000Z | setup.py | g3rd/django-timetable | 24012b17632a592115b8a9f510c685cfe6d49ba3 | [
"MIT"
] | null | null | null | setup.py | g3rd/django-timetable | 24012b17632a592115b8a9f510c685cfe6d49ba3 | [
"MIT"
] | 2 | 2016-04-02T17:39:14.000Z | 2019-09-28T23:50:55.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
from timetable import VERSION
github_url = 'https://github.com/g3rd/django-timetable'
setup(
name='django-timetable',
version='.'.join(str(v) for v in VERSION),
description='An Django app that provides generic calendar functions',
lon... | 27.375 | 73 | 0.626484 |
from setuptools import setup, find_packages
from timetable import VERSION
github_url = 'https://github.com/g3rd/django-timetable'
setup(
name='django-timetable',
version='.'.join(str(v) for v in VERSION),
description='An Django app that provides generic calendar functions',
long_description=open('RE... | true | true |
f776becb9ce92e3d9edc988bffce41922edd457d | 212 | py | Python | dearpypixl/values.py | Atlamillias/dearpypixl | b332e23bd847abd729b53b8d77c5f49b604c16b5 | [
"MIT"
] | 2 | 2022-01-29T21:50:21.000Z | 2022-03-27T11:28:30.000Z | dearpypixl/values.py | Atlamillias/dearpypixl | b332e23bd847abd729b53b8d77c5f49b604c16b5 | [
"MIT"
] | null | null | null | dearpypixl/values.py | Atlamillias/dearpypixl | b332e23bd847abd729b53b8d77c5f49b604c16b5 | [
"MIT"
] | null | null | null | import dearpypixl.appitems.values
from dearpypixl.appitems.values import *
from dearpypixl.components.registries import ValueRegistry
__all__ = [
*dearpypixl.appitems.values.__all__,
"ValueRegistry"
]
| 19.272727 | 58 | 0.792453 | import dearpypixl.appitems.values
from dearpypixl.appitems.values import *
from dearpypixl.components.registries import ValueRegistry
__all__ = [
*dearpypixl.appitems.values.__all__,
"ValueRegistry"
]
| true | true |
f776c06b3b0d0a0e130ae44cc1bb3c819ab0490e | 13,435 | py | Python | easytrader/clienttrader.py | izhangxm/easytrader | b4815c16fe99d43f4c131a7950a178d892c4c8f3 | [
"MIT"
] | 1 | 2017-11-07T03:26:33.000Z | 2017-11-07T03:26:33.000Z | easytrader/clienttrader.py | izhangxm/easytrader | b4815c16fe99d43f4c131a7950a178d892c4c8f3 | [
"MIT"
] | null | null | null | easytrader/clienttrader.py | izhangxm/easytrader | b4815c16fe99d43f4c131a7950a178d892c4c8f3 | [
"MIT"
] | 2 | 2019-01-21T07:47:56.000Z | 2020-07-27T22:49:38.000Z | # coding:utf-8
import functools
import io
import os
import re
import sys
import time
from abc import abstractmethod
import easyutils
import pandas as pd
from . import exceptions
from . import helpers
from .config import client
from .log import log
if not sys.platform.startswith('darwin'):
import pywinauto
im... | 31.611765 | 113 | 0.604913 | import functools
import io
import os
import re
import sys
import time
from abc import abstractmethod
import easyutils
import pandas as pd
from . import exceptions
from . import helpers
from .config import client
from .log import log
if not sys.platform.startswith('darwin'):
import pywinauto
import pywinauto.... | true | true |
f776c10e3043e4058e9cff6a042e08f91cf63170 | 1,717 | py | Python | casa.CONFIG/frenck-config/custom_components/hacs/tasks/setup_websocket_api.py | janiversen/ha_config | 98d7d4eed3a136220133724a044b9358896efbb7 | [
"Apache-2.0"
] | 1,383 | 2018-06-23T20:16:57.000Z | 2022-03-30T09:10:06.000Z | config/custom_components/hacs/tasks/setup_websocket_api.py | jclark2019/home-assistant-config | a1354a8889e12b961fd16f4800c452b4fd0124f0 | [
"MIT"
] | 60 | 2018-12-14T10:11:34.000Z | 2021-11-06T18:43:19.000Z | config/custom_components/hacs/tasks/setup_websocket_api.py | jclark2019/home-assistant-config | a1354a8889e12b961fd16f4800c452b4fd0124f0 | [
"MIT"
] | 270 | 2018-12-17T05:54:10.000Z | 2022-03-23T20:28:54.000Z | """Register WS API endpoints for HACS."""
from __future__ import annotations
from homeassistant.components.websocket_api import async_register_command
from homeassistant.core import HomeAssistant
from ..api.acknowledge_critical_repository import acknowledge_critical_repository
from ..api.check_local_path import check... | 39.930233 | 81 | 0.794991 | from __future__ import annotations
from homeassistant.components.websocket_api import async_register_command
from homeassistant.core import HomeAssistant
from ..api.acknowledge_critical_repository import acknowledge_critical_repository
from ..api.check_local_path import check_local_path
from ..api.get_critical_reposi... | true | true |
f776c152210ee072684b6cc541601716697cfda6 | 847 | py | Python | aiida/parsers/exceptions.py | tomzhang/aiida_core | 949810e9f3daff0f748c5c9aa1dde4f5222bb49b | [
"BSD-2-Clause"
] | 1 | 2019-04-29T12:39:31.000Z | 2019-04-29T12:39:31.000Z | aiida/parsers/exceptions.py | tomzhang/aiida_core | 949810e9f3daff0f748c5c9aa1dde4f5222bb49b | [
"BSD-2-Clause"
] | null | null | null | aiida/parsers/exceptions.py | tomzhang/aiida_core | 949810e9f3daff0f748c5c9aa1dde4f5222bb49b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 40.333333 | 75 | 0.478158 | from __future__ import absolute_import
from aiida.common.exceptions import ValidationError, ParsingError
class OutputParsingError(ParsingError):
pass
class FailedJobError(ValidationError):
pass
| true | true |
f776c50711c50dacdf8656d1ca8f6ac88afebc3d | 1,044 | py | Python | ansiotropy/data/data_utils.py | ethankim00/soft_prompt_ansiotropy | 4b0c337135264c7bfb8dd60f78544aa55f55f59d | [
"FTL"
] | null | null | null | ansiotropy/data/data_utils.py | ethankim00/soft_prompt_ansiotropy | 4b0c337135264c7bfb8dd60f78544aa55f55f59d | [
"FTL"
] | null | null | null | ansiotropy/data/data_utils.py | ethankim00/soft_prompt_ansiotropy | 4b0c337135264c7bfb8dd60f78544aa55f55f59d | [
"FTL"
] | null | null | null | from cProfile import label
from openprompt.data_utils import PROCESSORS
DATA_DIR = "./data/"
SUPERGLUE_TASKS = [
"cb",
"copa",
"multirc",
"stsb",
"wsc",
"rte",
"mnli",
"mrpc",
"sst2",
"wic",
"qqp",
"qnli",
"mnli_mm",
]
SUPERGLUE_SCRIPTS_BASE = {
"boolq": "Supe... | 21.75 | 63 | 0.609195 | from cProfile import label
from openprompt.data_utils import PROCESSORS
DATA_DIR = "./data/"
SUPERGLUE_TASKS = [
"cb",
"copa",
"multirc",
"stsb",
"wsc",
"rte",
"mnli",
"mrpc",
"sst2",
"wic",
"qqp",
"qnli",
"mnli_mm",
]
SUPERGLUE_SCRIPTS_BASE = {
"boolq": "Supe... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.