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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71938dd1d111ba18183cd67737d4ea3ac849931 | 863 | py | Python | Software/Estadística/MCMC/HS/CC+SN_int1/4params/analisis_cadenas_4params.py | matiasleize/tesis_licenciatura | 5df6e341314583702b466b8ed7977d410f0ee457 | [
"MIT"
] | null | null | null | Software/Estadística/MCMC/HS/CC+SN_int1/4params/analisis_cadenas_4params.py | matiasleize/tesis_licenciatura | 5df6e341314583702b466b8ed7977d410f0ee457 | [
"MIT"
] | null | null | null | Software/Estadística/MCMC/HS/CC+SN_int1/4params/analisis_cadenas_4params.py | matiasleize/tesis_licenciatura | 5df6e341314583702b466b8ed7977d410f0ee457 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import emcee
import sys
import os
from pc_path import definir_path
path_git, path_datos_global = definir_path()
os.chdir(path_git)
sys.path.append('./Software/Funcionales/Clases')
from funciones_graficador import Graficador
#%% Importo las cadenas
os.chdir(path... | 26.96875 | 120 | 0.753187 | import numpy as np
from matplotlib import pyplot as plt
import emcee
import sys
import os
from pc_path import definir_path
path_git, path_datos_global = definir_path()
os.chdir(path_git)
sys.path.append('./Software/Funcionales/Clases')
from funciones_graficador import Graficador
os.chdir(path_datos_global+'/Resultad... | false | true |
f71939e1d16adffd88e34ce88da8f38f90363eca | 2,079 | py | Python | scripts/sdk_fetch_coverage_tools.py | PelionIoT/mbed-cloud-sdk-java | cc99c51db43cc9ae36601f20f20b7d8cd7515432 | [
"Apache-2.0"
] | 7 | 2017-12-28T11:19:15.000Z | 2020-03-23T19:15:31.000Z | scripts/sdk_fetch_coverage_tools.py | PelionIoT/mbed-cloud-sdk-java | cc99c51db43cc9ae36601f20f20b7d8cd7515432 | [
"Apache-2.0"
] | 99 | 2018-01-09T23:56:13.000Z | 2020-11-03T05:20:55.000Z | scripts/sdk_fetch_coverage_tools.py | PelionIoT/mbed-cloud-sdk-java | cc99c51db43cc9ae36601f20f20b7d8cd7515432 | [
"Apache-2.0"
] | 5 | 2018-08-02T06:29:18.000Z | 2019-10-23T11:43:59.000Z | #!/usr/bin/python
import os
import sdk_common
# Block in charge of fetching code coverage tools
class SDKCoverageToolsFetcher(sdk_common.BuildStepUsingGradle):
def __init__(self, logger=None):
super(SDKCoverageToolsFetcher, self).__init__('SDK Coverage tools fetch', logger)
self.is_code_coverage ... | 40.764706 | 123 | 0.696489 | import os
import sdk_common
class SDKCoverageToolsFetcher(sdk_common.BuildStepUsingGradle):
def __init__(self, logger=None):
super(SDKCoverageToolsFetcher, self).__init__('SDK Coverage tools fetch', logger)
self.is_code_coverage = self.common_config.get_config().should_perform_code_coverage()
... | true | true |
f7193a1de09a2338512e1f71556799b0418fb19a | 683 | py | Python | app/core/migrations/0002_tag.py | bwanarm/recipe-app-api | 1204280495547ceb93a59cd2ec2b1c2a82ef187d | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | bwanarm/recipe-app-api | 1204280495547ceb93a59cd2ec2b1c2a82ef187d | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | bwanarm/recipe-app-api | 1204280495547ceb93a59cd2ec2b1c2a82ef187d | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-07-31 13:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 28.458333 | 118 | 0.616398 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
... | true | true |
f7193a2229b00e7439ffb31eaf7bc0964fc3bb54 | 10,877 | py | Python | pretrained-model/stt/hubert/conformer-tiny-ctc.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | null | null | null | pretrained-model/stt/hubert/conformer-tiny-ctc.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | null | null | null | pretrained-model/stt/hubert/conformer-tiny-ctc.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | null | null | null | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '3'
import pyroomacoustics as pra
import numpy as np
from pydub import AudioSegment
from sklearn.utils import shuffle
from glob import glob
import random
import json
from malaya_speech.train.model.conformer.model import Model as ConformerModel
from malaya_speech.train.mo... | 30.639437 | 92 | 0.590144 | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '3'
import pyroomacoustics as pra
import numpy as np
from pydub import AudioSegment
from sklearn.utils import shuffle
from glob import glob
import random
import json
from malaya_speech.train.model.conformer.model import Model as ConformerModel
from malaya_speech.train.mo... | true | true |
f7193aa46ca7cccda6fa00809b1c48838617c057 | 9,046 | py | Python | killerbee/dev_telosb.py | Acesonnall/killerbee | 354c68bcf21f60910d9f68f62285b977db76fb60 | [
"BSD-3-Clause"
] | 2 | 2019-06-16T06:53:46.000Z | 2022-02-18T01:05:36.000Z | killerbee/dev_telosb.py | Acesonnall/killerbee | 354c68bcf21f60910d9f68f62285b977db76fb60 | [
"BSD-3-Clause"
] | 1 | 2019-11-23T17:16:55.000Z | 2019-11-23T17:16:55.000Z | killerbee/dev_telosb.py | Acesonnall/killerbee | 354c68bcf21f60910d9f68f62285b977db76fb60 | [
"BSD-3-Clause"
] | 2 | 2019-06-15T15:54:36.000Z | 2019-06-15T15:55:39.000Z | '''
Support for the TelosB / Tmote Sky platforms, and close clones.
Utilizes the GoodFET firmware with CCSPI application, and the GoodFET client code.
'''
import os
import time
import struct
import time
from datetime import datetime, timedelta
from kbutils import KBCapabilities, makeFCS
from GoodFETCCSPI import GoodF... | 38.168776 | 452 | 0.632876 | '''
Support for the TelosB / Tmote Sky platforms, and close clones.
Utilizes the GoodFET firmware with CCSPI application, and the GoodFET client code.
'''
import os
import time
import struct
import time
from datetime import datetime, timedelta
from kbutils import KBCapabilities, makeFCS
from GoodFETCCSPI import GoodF... | false | true |
f7193bb525a1bcd7a4c3765147b5f3469bdd3591 | 1,555 | py | Python | etools/apps/uptime/utils.py | Igelinmist/etools | 26ae66a2ad005a7a173253bc9822a770a3115645 | [
"BSD-3-Clause"
] | null | null | null | etools/apps/uptime/utils.py | Igelinmist/etools | 26ae66a2ad005a7a173253bc9822a770a3115645 | [
"BSD-3-Clause"
] | null | null | null | etools/apps/uptime/utils.py | Igelinmist/etools | 26ae66a2ad005a7a173253bc9822a770a3115645 | [
"BSD-3-Clause"
] | null | null | null | from datetime import timedelta, date
def req_date(local_date):
if isinstance(local_date, str):
d, m, y = local_date.split('.')
return '{0}-{1}-{2}'.format(y, m, d)
elif isinstance(local_date, date):
return local_date.strftime('%Y-%m-%d')
else:
return local_date
def req_ti... | 28.796296 | 80 | 0.595498 | from datetime import timedelta, date
def req_date(local_date):
if isinstance(local_date, str):
d, m, y = local_date.split('.')
return '{0}-{1}-{2}'.format(y, m, d)
elif isinstance(local_date, date):
return local_date.strftime('%Y-%m-%d')
else:
return local_date
def req_ti... | true | true |
f7193dc596182608b60c2744dd8a96f97d37ed2c | 11,229 | py | Python | docs/conf.py | jeromedontdev/discord.py | 42bab370a73440fa8af2380211ad92ccb6bf7f46 | [
"MIT"
] | 13 | 2020-12-16T06:13:11.000Z | 2021-04-15T12:01:38.000Z | docs/conf.py | RootGC/discord.py | 8bc489dba8b8c7ca9141e4e7f00a0e916a7c0269 | [
"MIT"
] | 1 | 2021-05-23T16:08:10.000Z | 2021-05-23T16:08:10.000Z | docs/conf.py | RootGC/discord.py | 8bc489dba8b8c7ca9141e4e7f00a0e916a7c0269 | [
"MIT"
] | 6 | 2020-12-16T00:01:24.000Z | 2021-02-05T12:32:54.000Z | #
# discord.py documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 21 05:43:30 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration valu... | 31.191667 | 99 | 0.708612 |
import sys
import os
import re
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('extensions'))
extensions = [
'builder',
'sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinxcontrib_trio',
'details',
'exception... | true | true |
f7193e60bdbc11912523b4e6e6233bec11f0c404 | 11,846 | py | Python | synapse/http/proxyagent.py | User-green/synapse | 173ddbbe0b220bb28e67575079e1f775d73f967f | [
"Apache-2.0"
] | null | null | null | synapse/http/proxyagent.py | User-green/synapse | 173ddbbe0b220bb28e67575079e1f775d73f967f | [
"Apache-2.0"
] | null | null | null | synapse/http/proxyagent.py | User-green/synapse | 173ddbbe0b220bb28e67575079e1f775d73f967f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.674923 | 92 | 0.639878 | import base64
import logging
import re
from typing import Optional, Tuple
from urllib.request import getproxies_environment, proxy_bypass_environment
import attr
from zope.interface import implementer
from twisted.internet import defer
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
from twiste... | true | true |
f7193e638c0b7630f3bb08df8302e36c5888e4d8 | 889 | py | Python | tensorflow_mri/python/layers/__init__.py | mrphys/tensorflow-mri | 46a8929aec4180aba4961f902897e02592f25da6 | [
"Apache-2.0"
] | 3 | 2021-07-28T17:22:26.000Z | 2022-03-29T15:17:26.000Z | tensorflow_mri/python/layers/__init__.py | mrphys/tensorflow-mri | 46a8929aec4180aba4961f902897e02592f25da6 | [
"Apache-2.0"
] | 1 | 2021-07-23T01:37:11.000Z | 2021-07-23T01:37:11.000Z | tensorflow_mri/python/layers/__init__.py | mrphys/tensorflow-mri | 46a8929aec4180aba4961f902897e02592f25da6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 University College London. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 44.45 | 80 | 0.709786 |
from tensorflow_mri.python.layers.conv_blocks import *
from tensorflow_mri.python.layers.conv_endec import *
from tensorflow_mri.python.layers.preproc_layers import *
| true | true |
f7193e94de77b2cad9feb7c3c07ac84c618b271a | 13,089 | py | Python | train.py | fab464654/SSD_on_ActiveVisionDataset | 1bc6f0745241d0b45c3f257c6fb09ea0435c993e | [
"MIT"
] | null | null | null | train.py | fab464654/SSD_on_ActiveVisionDataset | 1bc6f0745241d0b45c3f257c6fb09ea0435c993e | [
"MIT"
] | null | null | null | train.py | fab464654/SSD_on_ActiveVisionDataset | 1bc6f0745241d0b45c3f257c6fb09ea0435c993e | [
"MIT"
] | null | null | null | import time
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
from model import SSD300, MultiBoxLoss
from datasets import PascalVOCDataset
from utils import *
# Data parameters
data_folder = 'google_drive/MyDrive/ColabNotebooks/Project/GT' # folder with data files
keep_difficult = True #... | 38.049419 | 184 | 0.537627 | import time
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
from model import SSD300, MultiBoxLoss
from datasets import PascalVOCDataset
from utils import *
data_folder = 'google_drive/MyDrive/ColabNotebooks/Project/GT' keep_difficult = True
n_classes = len(label_map) device = torch.... | true | true |
f7193ee3518594b970384543fd7069dcd703cf96 | 7,181 | py | Python | artikcloud/models/aggregates_histogram_response.py | artikcloud/artikcloud-python-dev | 683cd8304f031913bcd581d1eb78ee0efbc5c113 | [
"Apache-2.0"
] | null | null | null | artikcloud/models/aggregates_histogram_response.py | artikcloud/artikcloud-python-dev | 683cd8304f031913bcd581d1eb78ee0efbc5c113 | [
"Apache-2.0"
] | null | null | null | artikcloud/models/aggregates_histogram_response.py | artikcloud/artikcloud-python-dev | 683cd8304f031913bcd581d1eb78ee0efbc5c113 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
ARTIK Cloud API
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License"... | 25.464539 | 115 | 0.576521 |
from pprint import pformat
from six import iteritems
import re
class AggregatesHistogramResponse(object):
def __init__(self, data=None, end_date=None, field=None, interval=None, sdid=None, size=None, start_date=None):
self.swagger_types = {
'data': 'list[AggregatesHistogramData]',
... | true | true |
f7193ef954651cd69d7c79d1330decefaa2e8768 | 9,116 | py | Python | ucsmsdk/mometa/equipment/EquipmentRackEnclosure.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 78 | 2015-11-30T14:10:05.000Z | 2022-02-13T00:29:08.000Z | ucsmsdk/mometa/equipment/EquipmentRackEnclosure.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 113 | 2015-11-20T09:42:46.000Z | 2022-03-16T16:53:29.000Z | ucsmsdk/mometa/equipment/EquipmentRackEnclosure.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 86 | 2015-12-12T08:22:18.000Z | 2022-01-23T03:56:34.000Z | """This module contains the general information for EquipmentRackEnclosure ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class EquipmentRackEnclosureConsts:
MFG_TIME_NOT_APPLICABLE = "not-applicable"
OPERABILITY_ACCES... | 66.057971 | 805 | 0.693725 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class EquipmentRackEnclosureConsts:
MFG_TIME_NOT_APPLICABLE = "not-applicable"
OPERABILITY_ACCESSIBILITY_PROBLEM = "accessibility-problem"
OPERABILITY_AUTO_UPGRADE = "auto-upgrade"
... | true | true |
f7193f652b00cfdbac8c192602a1299716aac80a | 1,690 | py | Python | service/tests/test_auth.py | SWE-AGGERS/reactions_service | eb8e4bcb9f9e69c03a89da82f3c71a3454fc285c | [
"MIT"
] | null | null | null | service/tests/test_auth.py | SWE-AGGERS/reactions_service | eb8e4bcb9f9e69c03a89da82f3c71a3454fc285c | [
"MIT"
] | null | null | null | service/tests/test_auth.py | SWE-AGGERS/reactions_service | eb8e4bcb9f9e69c03a89da82f3c71a3454fc285c | [
"MIT"
] | null | null | null | import json
import unittest
import mock
from service.app import create_app
from service.auth import encode_auth_token
from service.database import empty_db
class TestAuth(unittest.TestCase):
def test0(self):
user_id = 1
# create token
new_token = encode_auth_token(user_id)
_app... | 40.238095 | 105 | 0.586391 | import json
import unittest
import mock
from service.app import create_app
from service.auth import encode_auth_token
from service.database import empty_db
class TestAuth(unittest.TestCase):
def test0(self):
user_id = 1
new_token = encode_auth_token(user_id)
_app = create_app(d... | true | true |
f7193f6e01897e3e8a2c39a33cc6cfcfad2301fb | 63,187 | py | Python | tests/test_h3.py | SouvikGhosh05/aioquic | da566b8ee616b9c83d51f0f5ad0521393119f40f | [
"BSD-3-Clause"
] | null | null | null | tests/test_h3.py | SouvikGhosh05/aioquic | da566b8ee616b9c83d51f0f5ad0521393119f40f | [
"BSD-3-Clause"
] | null | null | null | tests/test_h3.py | SouvikGhosh05/aioquic | da566b8ee616b9c83d51f0f5ad0521393119f40f | [
"BSD-3-Clause"
] | null | null | null | import binascii
import contextlib
import copy
from unittest import TestCase
from aioquic.buffer import Buffer, encode_uint_var
from aioquic.h3.connection import (
H3_ALPN,
ErrorCode,
FrameType,
FrameUnexpected,
H3Connection,
MessageError,
Setting,
SettingsError,
StreamType,
enco... | 34.699066 | 90 | 0.500593 | import binascii
import contextlib
import copy
from unittest import TestCase
from aioquic.buffer import Buffer, encode_uint_var
from aioquic.h3.connection import (
H3_ALPN,
ErrorCode,
FrameType,
FrameUnexpected,
H3Connection,
MessageError,
Setting,
SettingsError,
StreamType,
enco... | true | true |
f7193fce1fa7b0ba46bf2b1d2e9a114b6453e540 | 2,901 | py | Python | scripts/md_to_html.py | fossabot/granite | 7eab82126d0cddb4fdad0c3ba2c6f431eea19cfb | [
"MIT"
] | null | null | null | scripts/md_to_html.py | fossabot/granite | 7eab82126d0cddb4fdad0c3ba2c6f431eea19cfb | [
"MIT"
] | 3 | 2021-02-06T17:29:31.000Z | 2021-05-27T20:48:58.000Z | scripts/md_to_html.py | fossabot/granite | 7eab82126d0cddb4fdad0c3ba2c6f431eea19cfb | [
"MIT"
] | 2 | 2021-02-02T23:07:50.000Z | 2021-03-27T22:06:27.000Z | #! /usr/bin/env python3
# Script from https://gist.github.com/jiffyclub/5015986
# This script turns Markdown into HTML using the Python markdown library and wraps the result in a
# complete HTML document with default Bootstrap styling so that it's immediately printable.
# Requires the python libraries jinja2, markdo... | 29.30303 | 120 | 0.612203 |
# Requires the python libraries jinja2, markdown, and mdx_smartypants.
import argparse
import sys
import jinja2
import markdown
# To install dependencies in a virtualenv:
# $ py -3 -3 venv .venv
# $ .venv/Scripts/activate
# $ pip install jinja2
# $ pip install markdown
#
# To install dependencies on ... | true | true |
f7193fdcc986cc8bca9f6efe5170d075ac0c3ace | 7,030 | py | Python | dm_control/rl/specs_test.py | 1nadequacy/dm_control | a55474768cf0a6d570fe4a376802630027ad5f01 | [
"Apache-2.0"
] | null | null | null | dm_control/rl/specs_test.py | 1nadequacy/dm_control | a55474768cf0a6d570fe4a376802630027ad5f01 | [
"Apache-2.0"
] | null | null | null | dm_control/rl/specs_test.py | 1nadequacy/dm_control | a55474768cf0a6d570fe4a376802630027ad5f01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.975124 | 80 | 0.683642 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from dm_control.rl import specs as array_spec
import numpy as np
import six
class ArraySpecTest(absltest.TestCase):
def testShapeTypeError(self):
with self.assertRai... | true | true |
f7193fe758b15f3c5dd4561b3624e25cf35dca18 | 4,536 | py | Python | Model_test.py | JoeTao-097/Multi-REZ-Evalution-for-Breast-Ultrasound-Images | 344d64ad2fe9d790c49e8005b3abee219d362278 | [
"Apache-2.0"
] | null | null | null | Model_test.py | JoeTao-097/Multi-REZ-Evalution-for-Breast-Ultrasound-Images | 344d64ad2fe9d790c49e8005b3abee219d362278 | [
"Apache-2.0"
] | null | null | null | Model_test.py | JoeTao-097/Multi-REZ-Evalution-for-Breast-Ultrasound-Images | 344d64ad2fe9d790c49e8005b3abee219d362278 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 2 17:32:52 2021
@author: jiangyt
"""
from Tools import *
from tensorflow import keras
from tensorflow.keras.layers import Dense, Activation, Flatten, Dropout, Input, BatchNormalization
from tensorflow.keras.layers import Conv2D, MaxPooling2D, add, AveragePooli... | 47.747368 | 123 | 0.646825 |
from Tools import *
from tensorflow import keras
from tensorflow.keras.layers import Dense, Activation, Flatten, Dropout, Input, BatchNormalization
from tensorflow.keras.layers import Conv2D, MaxPooling2D, add, AveragePooling2D, ZeroPadding2D, GlobalAveragePooling2D
from tensorflow.keras.models import Model, Sequ... | true | true |
f7194033eec50c8f02954cf2105d80b049769652 | 9,394 | py | Python | prepare_data.py | Euro2xx/gansformer | 83403cdb49e049e3b4d9f3472577f2ee73f7ba64 | [
"MIT"
] | 1,172 | 2021-03-02T02:00:44.000Z | 2022-03-31T02:46:45.000Z | prepare_data.py | Euro2xx/gansformer | 83403cdb49e049e3b4d9f3472577f2ee73f7ba64 | [
"MIT"
] | 37 | 2021-03-03T14:11:11.000Z | 2022-03-12T15:40:15.000Z | prepare_data.py | Euro2xx/gansformer | 83403cdb49e049e3b4d9f3472577f2ee73f7ba64 | [
"MIT"
] | 138 | 2021-03-02T06:37:10.000Z | 2022-03-30T14:59:09.000Z | # import warnings filter
from warnings import simplefilter
# ignore all future warnings
simplefilter(action = "ignore", category = FutureWarning)
import os
import sys
import tqdm
import time
import json
import glob
import gdown
import urllib
import zipfile
import hashlib
import argparse
import numpy as np
from traini... | 43.091743 | 200 | 0.597828 | from warnings import simplefilter
simplefilter(action = "ignore", category = FutureWarning)
import os
import sys
import tqdm
import time
import json
import glob
import gdown
import urllib
import zipfile
import hashlib
import argparse
import numpy as np
from training import misc
from dnnlib import EasyDict
import dat... | true | true |
f71940e708f2c32d5f339366201b373baa9e265f | 5,092 | py | Python | venv/Lib/site-packages/pandas/tests/series/indexing/test_get.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/series/indexing/test_get.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/series/indexing/test_get.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | import numpy as np
import pytest
import pandas as pd
from pandas import Series
import pandas._testing as tm
def test_get():
# GH 6383
s = Series(
np.array(
[
43,
48,
60,
48,
50,
... | 23.683721 | 88 | 0.434014 | import numpy as np
import pytest
import pandas as pd
from pandas import Series
import pandas._testing as tm
def test_get():
s = Series(
np.array(
[
43,
48,
60,
48,
50,
51,
... | true | true |
f71940f58176a96989ec11a785988a65b24d32a1 | 1,157 | py | Python | venv/Scripts/get_first_company.py | ZUSM0/zynoPYsis | 0cbe84d60a9611eac4daed82176477939bf79183 | [
"MIT"
] | null | null | null | venv/Scripts/get_first_company.py | ZUSM0/zynoPYsis | 0cbe84d60a9611eac4daed82176477939bf79183 | [
"MIT"
] | null | null | null | venv/Scripts/get_first_company.py | ZUSM0/zynoPYsis | 0cbe84d60a9611eac4daed82176477939bf79183 | [
"MIT"
] | null | null | null | #!c:\users\user\pycharmprojects\sinopse de filmes\venv\scripts\python.exe
# -*- coding: utf-8 -*-
"""
get_first_company.py
Usage: get_first_company "company name"
Search for the given name and print the best matching result.
"""
import sys
# Import the IMDbPY package.
try:
import imdb
except ImportError:
pr... | 21.425926 | 79 | 0.684529 |
import sys
try:
import imdb
except ImportError:
print('You need to install the IMDbPY package!')
sys.exit(1)
if len(sys.argv) != 2:
print('Only one argument is required:')
print(' %s "company name"' % sys.argv[0])
sys.exit(2)
name = sys.argv[1]
i = imdb.IMDb()
try:
results = i.s... | true | true |
f7194132aff142671554e00669a4cc1f9a014680 | 5,299 | py | Python | MathExample.py | AdityaSavara/CiteSoft_Py | f3a68666966565d4eb130e457cb11d285b56b4c5 | [
"BSD-3-Clause"
] | null | null | null | MathExample.py | AdityaSavara/CiteSoft_Py | f3a68666966565d4eb130e457cb11d285b56b4c5 | [
"BSD-3-Clause"
] | null | null | null | MathExample.py | AdityaSavara/CiteSoft_Py | f3a68666966565d4eb130e457cb11d285b56b4c5 | [
"BSD-3-Clause"
] | null | null | null | import sys
import math
try:
import CiteSoft
except:
import os #The below lines are to allow CiteSoftLocal to be called regardless of user's working directory.
lenOfFileName = len(os.path.basename(__file__)) #This is the name of **this** file.
absPathWithoutFileName = os.path.abspath(__file__)[0:-1*lenOf... | 58.230769 | 449 | 0.780336 | import sys
import math
try:
import CiteSoft
except:
import os lenOfFileName = len(os.path.basename(__file__)) #This is the name of **this** file.
absPathWithoutFileName = os.path.abspath(__file__)[0:-1*lenOfFileName]
sys.path.append(absPathWithoutFileName)
import CiteSoftLocal as CiteSoft
#Here... | true | true |
f719414c0fab3fa82e996e4adda1253ef5777ac1 | 141 | py | Python | performance_test/torch_deploy/__init__.py | Lionelsy/SQL-Injection-Detection-via-Deep-Learning | 5f1958822af98a99172df524eef6e921e6fa6724 | [
"MIT"
] | 1 | 2022-01-18T17:08:52.000Z | 2022-01-18T17:08:52.000Z | performance_test/torch_deploy/__init__.py | Lionelsy/SQL-Injection-Detection-via-Deep-Learning | 5f1958822af98a99172df524eef6e921e6fa6724 | [
"MIT"
] | null | null | null | performance_test/torch_deploy/__init__.py | Lionelsy/SQL-Injection-Detection-via-Deep-Learning | 5f1958822af98a99172df524eef6e921e6fa6724 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/14
# @Author : Shuyu ZHANG
# @FileName: __init__.py
# @Software: PyCharm
# @Description: Here
| 17.625 | 24 | 0.609929 | true | true | |
f71941bb492d02c50d6770e3abc0974c97079478 | 1,354 | py | Python | rclpy/services/minimal_client/setup.py | flynneva/examples | 16bffa238dfa3ff305f14b1ec75ed41dce634ffb | [
"Apache-2.0"
] | null | null | null | rclpy/services/minimal_client/setup.py | flynneva/examples | 16bffa238dfa3ff305f14b1ec75ed41dce634ffb | [
"Apache-2.0"
] | null | null | null | rclpy/services/minimal_client/setup.py | flynneva/examples | 16bffa238dfa3ff305f14b1ec75ed41dce634ffb | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
package_name = 'examples_rclpy_minimal_client'
setup(
name=package_name,
version='0.9.1',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml'... | 33.85 | 95 | 0.661004 | from setuptools import setup
package_name = 'examples_rclpy_minimal_client'
setup(
name=package_name,
version='0.9.1',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml'... | true | true |
f71942098bb86e0175943366277c2cc371a401db | 1,735 | py | Python | api/migrations/0001_initial.py | psingla1210/django-rest-api | db9fa70e3eeb747399b275e79688dfa4974a00ee | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | psingla1210/django-rest-api | db9fa70e3eeb747399b275e79688dfa4974a00ee | [
"MIT"
] | 4 | 2021-03-19T11:31:00.000Z | 2022-02-10T14:07:26.000Z | api/migrations/0001_initial.py | psingla1210/django-rest-api | db9fa70e3eeb747399b275e79688dfa4974a00ee | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-06-21 14:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='TwistedUser',
... | 51.029412 | 266 | 0.641499 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='TwistedUser',
fields=[
('id', models.Aut... | true | true |
f71942734c2781f9110c7944a358f060b7b5ed9c | 1,138 | py | Python | frappe/utils/connections.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/utils/connections.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/utils/connections.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | import socket
from six.moves.urllib.parse import urlparse
from frappe import get_conf
REDIS_KEYS = ("redis_cache", "redis_queue", "redis_socketio")
def is_open(ip, port, timeout=10):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
try:
s.connect((ip, int(port)))
s.shutdown(socket... | 24.212766 | 72 | 0.746924 | import socket
from six.moves.urllib.parse import urlparse
from frappe import get_conf
REDIS_KEYS = ("redis_cache", "redis_queue", "redis_socketio")
def is_open(ip, port, timeout=10):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
try:
s.connect((ip, int(port)))
s.shutdown(socket... | true | true |
f71943a375acd8972ca01d50dd31b6166bd90ebe | 606 | py | Python | demo.py | peter-jim/offchain-algorithm | c148fd1e3dffca9a42a4206c516533aae51d1ae1 | [
"Apache-2.0"
] | null | null | null | demo.py | peter-jim/offchain-algorithm | c148fd1e3dffca9a42a4206c516533aae51d1ae1 | [
"Apache-2.0"
] | null | null | null | demo.py | peter-jim/offchain-algorithm | c148fd1e3dffca9a42a4206c516533aae51d1ae1 | [
"Apache-2.0"
] | 1 | 2021-04-17T06:34:32.000Z | 2021-04-17T06:34:32.000Z | import requests
def demo():
'''
非小号API获取信息
:return btc,eth,eos ... pirce
'''
print("start")
#接口教程链接 https://github.com/xiaohao2019/API-docs/blob/master/PublicApi_CN.md
url = "https://fxhapi.feixiaohao.com/public/v1/ticker/"
#传入参数 start=[integer](指定结果集的开始排名) limit=[integer](指定结果集的最大... | 23.307692 | 79 | 0.580858 | import requests
def demo():
print("start")
url = "https://fxhapi.feixiaohao.com/public/v1/ticker/"
start = "start=" + str(0)+"&"
limit = "limit=" + str(10)
print(url+"?"+start+limit)
try:
response = requests.get(url=url+"?"+start+limit)
for item in response.json():
... | true | true |
f7194440cda8d5fbed1979d6f1691cf0e20dcc13 | 1,544 | py | Python | benchmark/Python/Savina/PingPong.py | Feliix42/lingua-franca | af312ca8d37d9246dcb1d77fdc254a0dbd61b2bc | [
"BSD-2-Clause"
] | 1 | 2020-11-13T02:05:57.000Z | 2020-11-13T02:05:57.000Z | benchmark/Python/Savina/PingPong.py | Feliix42/lingua-franca | af312ca8d37d9246dcb1d77fdc254a0dbd61b2bc | [
"BSD-2-Clause"
] | null | null | null | benchmark/Python/Savina/PingPong.py | Feliix42/lingua-franca | af312ca8d37d9246dcb1d77fdc254a0dbd61b2bc | [
"BSD-2-Clause"
] | 1 | 2020-10-20T12:30:38.000Z | 2020-10-20T12:30:38.000Z | from LinguaFrancaBase.constants import * #Useful constants
from LinguaFrancaBase.functions import * #Useful helper functions
from LinguaFrancaBase.classes import * #Useful classes
import sys
import copy
sys.setrecursionlimit(100000)
EXPECTED = 10000
class _Ping:
count = 1000000
pingsLeft = count
def __ini... | 29.132075 | 127 | 0.668394 | from LinguaFrancaBase.constants import * from LinguaFrancaBase.functions import * from LinguaFrancaBase.classes import * import sys
import copy
sys.setrecursionlimit(100000)
EXPECTED = 10000
class _Ping:
count = 1000000
pingsLeft = count
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
... | true | true |
f71944995b26a94873f53f48809fb0b8c10684e6 | 11,354 | py | Python | ministack/build.py | lyndon160/ref | 122e8315c00784c58285c6ad54bf8fffd39623fa | [
"Apache-2.0"
] | 6 | 2018-10-22T09:43:46.000Z | 2021-11-15T11:08:54.000Z | ministack/build.py | lyndon160/REF | 122e8315c00784c58285c6ad54bf8fffd39623fa | [
"Apache-2.0"
] | 5 | 2016-01-29T16:51:39.000Z | 2020-08-01T16:16:29.000Z | ministack/build.py | lyndon160/REF | 122e8315c00784c58285c6ad54bf8fffd39623fa | [
"Apache-2.0"
] | 4 | 2016-01-05T20:41:18.000Z | 2019-05-12T10:15:56.000Z | #!/usr/bin/python
#
# build.py
#
# chain nova and neuton service requests to build predefined compute topologies
#
# topology is defined in python language 'spec' files
#
# by default the program will build the topology requested form a clean slate,
# but give the correct option (-c) it will also attempt to complete a ... | 36.27476 | 182 | 0.586577 |
import time
import sys
import traceback
from socket import gethostbyname
from os import environ as env
import os
import argparse
from pprint import pprint
import novaclient.client
from neutron import Neutron
spec_error = False
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group... | false | true |
f719453dae93648775b69c46831ebbe5c6081c50 | 3,822 | py | Python | pygasus/storage/sql/query_builder.py | talismud/pygasus | fb01c8bd51003b5a008b572182a96bad86ef769f | [
"BSD-3-Clause"
] | 2 | 2021-11-18T09:35:10.000Z | 2021-11-18T14:46:32.000Z | pygasus/storage/sql/query_builder.py | talismud/pygasus | fb01c8bd51003b5a008b572182a96bad86ef769f | [
"BSD-3-Clause"
] | null | null | null | pygasus/storage/sql/query_builder.py | talismud/pygasus | fb01c8bd51003b5a008b572182a96bad86ef769f | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the... | 39.8125 | 79 | 0.68786 |
from pygasus.storage.query_builder import AbstractQueryBuilder
class SQLQueryBuilder(AbstractQueryBuilder):
def _get_table(self, field):
model = field.__model__
model_name = getattr(
model.__config__, "model_name", model.__name__.lower()
)
return self.storage_e... | true | true |
f719456656da103360e5cac1aae1790b2a55d482 | 20,904 | py | Python | octavia/amphorae/drivers/haproxy/rest_api_driver.py | acdc-cloud/openstack-octavia | f68460ddd31f9b09d59fff876f103324078473a6 | [
"Apache-2.0"
] | null | null | null | octavia/amphorae/drivers/haproxy/rest_api_driver.py | acdc-cloud/openstack-octavia | f68460ddd31f9b09d59fff876f103324078473a6 | [
"Apache-2.0"
] | null | null | null | octavia/amphorae/drivers/haproxy/rest_api_driver.py | acdc-cloud/openstack-octavia | f68460ddd31f9b09d59fff876f103324078473a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2015 Rackspace
#
# 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
#
# Un... | 41.975904 | 79 | 0.591179 | import functools
import hashlib
import time
import warnings
from oslo_log import log as logging
import requests
import simplejson
import six
from stevedore import driver as stevedore_driver
from octavia.amphorae.driver_exceptions import exceptions as driver_except
from octavia.amphorae.drivers import driver_base
from... | true | true |
f71945ac8b27591fea8b5cba11d2e49aa0f11109 | 8,813 | py | Python | __init__.py | mastnym/cbpi-SimpleCascadeHysteresis | 06e0a5d46868aaf7fef304eaed3308dc9b5ed269 | [
"MIT"
] | null | null | null | __init__.py | mastnym/cbpi-SimpleCascadeHysteresis | 06e0a5d46868aaf7fef304eaed3308dc9b5ed269 | [
"MIT"
] | null | null | null | __init__.py | mastnym/cbpi-SimpleCascadeHysteresis | 06e0a5d46868aaf7fef304eaed3308dc9b5ed269 | [
"MIT"
] | null | null | null | import time
from modules import cbpi
from modules.core.controller import KettleController
from modules.core.props import Property
@cbpi.controller
class SimpleCascadeHysteresis(KettleController):
"""
This hysteresis controls MashTun temp. It creates hysteresis on HLT temp not allowing it to reach
much hig... | 44.510101 | 214 | 0.641439 | import time
from modules import cbpi
from modules.core.controller import KettleController
from modules.core.props import Property
@cbpi.controller
class SimpleCascadeHysteresis(KettleController):
pos_off_desc = "Positive value indicating possibility to go above target temp with actor still switched on. If target ... | true | true |
f719467cb68b35eb1744903f1645e3dc36285aae | 182 | py | Python | Others/joi/joi2021yo1b/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | Others/joi/joi2021yo1b/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | Others/joi/joi2021yo1b/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
a, b, c = map(int, input().split())
if a <= c < b:
print(1)
else:
print(0)
if __name__ == "__main__":
main()
| 12.133333 | 39 | 0.434066 |
def main():
a, b, c = map(int, input().split())
if a <= c < b:
print(1)
else:
print(0)
if __name__ == "__main__":
main()
| true | true |
f719472b0ea2f7adf53faaf80d9dfeb1915076da | 286 | py | Python | awswrangler/__metadata__.py | Thiago-Dantas/aws-data-wrangler | b13fcd8d169feb3219b4b4fff025dc6089cfe03b | [
"Apache-2.0"
] | 1 | 2021-04-27T12:56:28.000Z | 2021-04-27T12:56:28.000Z | awswrangler/__metadata__.py | Thiago-Dantas/aws-data-wrangler | b13fcd8d169feb3219b4b4fff025dc6089cfe03b | [
"Apache-2.0"
] | 63 | 2021-05-31T08:35:17.000Z | 2022-03-28T08:12:04.000Z | awswrangler/__metadata__.py | kukushking/aws-data-wrangler | c91188472f96b222c943b35b3b082c0ba5e54745 | [
"Apache-2.0"
] | null | null | null | """Metadata Module.
Source repository: https://github.com/awslabs/aws-data-wrangler
Documentation: https://aws-data-wrangler.readthedocs.io/
"""
__title__: str = "awswrangler"
__description__: str = "Pandas on AWS."
__version__: str = "2.8.0"
__license__: str = "Apache License 2.0"
| 23.833333 | 63 | 0.734266 |
__title__: str = "awswrangler"
__description__: str = "Pandas on AWS."
__version__: str = "2.8.0"
__license__: str = "Apache License 2.0"
| true | true |
f71949204a3a8f20fdd5c84ef0a61e2047469716 | 7,418 | py | Python | 4course/theory_of_pl/course/test.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | 10 | 2021-08-28T08:44:57.000Z | 2022-03-06T16:29:51.000Z | 4course/theory_of_pl/course/test.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | null | null | null | 4course/theory_of_pl/course/test.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | 6 | 2021-09-06T07:26:18.000Z | 2021-12-16T16:11:10.000Z | import unittest
import utils
from grammar import Grammar
class SplitByCommasTest(unittest.TestCase):
def test_simple(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A, B, C', ','))
def test_without_space(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A,B,C', ','))
def... | 30.780083 | 88 | 0.383392 | import unittest
import utils
from grammar import Grammar
class SplitByCommasTest(unittest.TestCase):
def test_simple(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A, B, C', ','))
def test_without_space(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A,B,C', ','))
def... | true | true |
f7194a37fbd1fbc139636447bb1502e8a31ec9fb | 1,257 | py | Python | backend2/venv/lib/python3.9/site-packages/authlib/jose/rfc7517/_cryptography_key.py | anushkas-bot/cube.js | fc5f66e20a7073fcdb1f279440bcd582c5ccc9da | [
"Cube",
"Apache-2.0",
"MIT"
] | 3,172 | 2017-11-11T05:54:14.000Z | 2022-03-31T23:59:59.000Z | backend2/venv/lib/python3.9/site-packages/authlib/jose/rfc7517/_cryptography_key.py | anushkas-bot/cube.js | fc5f66e20a7073fcdb1f279440bcd582c5ccc9da | [
"Cube",
"Apache-2.0",
"MIT"
] | 397 | 2017-11-11T02:49:06.000Z | 2022-03-31T21:02:37.000Z | backend2/venv/lib/python3.9/site-packages/authlib/jose/rfc7517/_cryptography_key.py | anushkas-bot/cube.js | fc5f66e20a7073fcdb1f279440bcd582c5ccc9da | [
"Cube",
"Apache-2.0",
"MIT"
] | 387 | 2017-11-18T08:59:56.000Z | 2022-03-15T18:37:37.000Z | from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.primitives.serialization import (
load_pem_private_key, load_pem_public_key, load_ssh_public_key,
)
from cryptography.hazmat.backends import default_backend
from authlib.common.encoding import to_bytes
def load_pem_key(raw, ssh_type=... | 35.914286 | 86 | 0.747017 | from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.primitives.serialization import (
load_pem_private_key, load_pem_public_key, load_ssh_public_key,
)
from cryptography.hazmat.backends import default_backend
from authlib.common.encoding import to_bytes
def load_pem_key(raw, ssh_type=... | true | true |
f7194ab1a937921f6752fb9ea13a7ad2b345d88f | 2,008 | py | Python | tests/conftest.py | amosbastian/python-fpl | 3db8e0029d7cf07111db61ddee0b37b17b051bcd | [
"MIT"
] | 217 | 2018-01-17T10:03:07.000Z | 2022-03-12T06:13:02.000Z | tests/conftest.py | amosbastian/python-fpl | 3db8e0029d7cf07111db61ddee0b37b17b051bcd | [
"MIT"
] | 84 | 2018-04-23T09:56:16.000Z | 2022-02-11T16:19:58.000Z | tests/conftest.py | amosbastian/python-fpl | 3db8e0029d7cf07111db61ddee0b37b17b051bcd | [
"MIT"
] | 88 | 2018-04-21T08:07:16.000Z | 2022-02-25T03:43:54.000Z | import aiohttp
import pytest
import os
from fpl import FPL
from fpl.models import Fixture, H2HLeague, User, ClassicLeague, Team, Gameweek
from tests.test_classic_league import classic_league_data
from tests.test_fixture import fixture_data
from tests.test_h2h_league import h2h_league_data
from tests.test_team import t... | 23.08046 | 78 | 0.744024 | import aiohttp
import pytest
import os
from fpl import FPL
from fpl.models import Fixture, H2HLeague, User, ClassicLeague, Team, Gameweek
from tests.test_classic_league import classic_league_data
from tests.test_fixture import fixture_data
from tests.test_h2h_league import h2h_league_data
from tests.test_team import t... | true | true |
f7194ae6ce49e55ac49b2ee6f18f31f1b76f58c1 | 35,332 | py | Python | test/test_restful.py | ueno/keylime | 480c9b107c155e7a20442afe3be929cf5d50fb86 | [
"Apache-2.0"
] | null | null | null | test/test_restful.py | ueno/keylime | 480c9b107c155e7a20442afe3be929cf5d50fb86 | [
"Apache-2.0"
] | null | null | null | test/test_restful.py | ueno/keylime | 480c9b107c155e7a20442afe3be929cf5d50fb86 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
NOTE:
This unittest is being used as a procedural test.
The tests must be run in-order and CANNOT be parallelized!
Tests all but two RESTful interfaces:
* agent's POST /v2/keys/vkey
- Done by C... | 38.997792 | 140 | 0.635656 |
import sys
import signal
import unittest
import subprocess
import time
import os
import base64
import threading
import shutil
import errno
from pathlib import Path
import dbus
import simplejson as json
from keylime import config
from keylime import tornado_requests
from keylime.requests_client import RequestsClient
... | true | true |
f7194b8167f283797e8754a97cb5a389e35e14ce | 2,442 | py | Python | hello_fastapi_project/hello_fastapi/backend/app/alembic/env.py | KimSoungRyoul/PersistenceLayerInPythonApplication | 2431553a6cdd913babd546adc6c9376855eb3438 | [
"MIT"
] | 2 | 2021-11-01T08:08:13.000Z | 2021-11-01T08:11:51.000Z | hello_fastapi_project/hello_fastapi/backend/app/alembic/env.py | KimSoungRyoul/PersistenceLayerInPythonApplication | 2431553a6cdd913babd546adc6c9376855eb3438 | [
"MIT"
] | null | null | null | hello_fastapi_project/hello_fastapi/backend/app/alembic/env.py | KimSoungRyoul/PersistenceLayerInPythonApplication | 2431553a6cdd913babd546adc6c9376855eb3438 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import os
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config fil... | 27.75 | 87 | 0.72154 | from __future__ import with_statement
import os
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
config = context.config
fileConfig(config.config_file_name)
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.met... | true | true |
f7194cecc0e0ff877121d721d5f9416a213d7ec6 | 129 | py | Python | dan_socket/base.py | fredericowu/dan_socket | 12ccbd8333b76889f6ee2050c78aba67f0a86533 | [
"Apache-2.0"
] | null | null | null | dan_socket/base.py | fredericowu/dan_socket | 12ccbd8333b76889f6ee2050c78aba67f0a86533 | [
"Apache-2.0"
] | null | null | null | dan_socket/base.py | fredericowu/dan_socket | 12ccbd8333b76889f6ee2050c78aba67f0a86533 | [
"Apache-2.0"
] | null | null | null | import socket
class BaseConnection:
PROTOCOL = {
"TCP": socket.SOCK_STREAM,
"UDP": socket.SOCK_DGRAM
}
| 14.333333 | 34 | 0.604651 | import socket
class BaseConnection:
PROTOCOL = {
"TCP": socket.SOCK_STREAM,
"UDP": socket.SOCK_DGRAM
}
| true | true |
f7194cede6cfbfe8bf2f8a61911cecb70eada48c | 4,031 | py | Python | wok/contrib/hooks.py | chrplace/wok | a1368f6c6bc75e0b1b878b315bfd31ac8aefbabb | [
"MIT"
] | 38 | 2015-01-06T03:41:51.000Z | 2019-09-18T22:06:28.000Z | wok/contrib/hooks.py | chrplace/wok | a1368f6c6bc75e0b1b878b315bfd31ac8aefbabb | [
"MIT"
] | 38 | 2015-02-12T09:33:24.000Z | 2017-06-29T16:52:29.000Z | wok/contrib/hooks.py | chrplace/wok | a1368f6c6bc75e0b1b878b315bfd31ac8aefbabb | [
"MIT"
] | 21 | 2015-01-08T08:46:50.000Z | 2020-01-28T23:59:40.000Z | # vim: set fileencoding=utf8 :
"""Some hooks that might be useful."""
import os
import glob
import subprocess
from StringIO import StringIO
import logging
from slugify import slugify
from wok.exceptions import DependencyException
try:
from lxml import etree
except ImportError:
etree = None
try:
import ... | 32.772358 | 89 | 0.598115 | """Some hooks that might be useful."""
import os
import glob
import subprocess
from StringIO import StringIO
import logging
from slugify import slugify
from wok.exceptions import DependencyException
try:
from lxml import etree
except ImportError:
etree = None
try:
import sass
except ImportError:
sa... | false | true |
f7194df8986a3f798477abbd22f0e92a006cfa20 | 967 | py | Python | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | 1 | 2021-10-10T20:21:18.000Z | 2021-10-10T20:21:18.000Z | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
BZip = list(zip(*board))
def Checkline(li):
temp = [i for i in li if i!="."]
return len(set(temp))==len(temp)
def check_row(board):
for i in b... | 31.193548 | 83 | 0.458118 | class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
BZip = list(zip(*board))
def Checkline(li):
temp = [i for i in li if i!="."]
return len(set(temp))==len(temp)
def check_row(board):
for i in b... | true | true |
f7194e480fb8f963b01db5fe2fb064378758697e | 11,918 | py | Python | instabot/api/api_video.py | danomaj/instabot | 769e41587a1aaeb50b89f0bf9d3933123e6ddbcc | [
"Apache-2.0"
] | 1 | 2022-01-23T09:25:50.000Z | 2022-01-23T09:25:50.000Z | instabot/api/api_video.py | danomaj/instabot | 769e41587a1aaeb50b89f0bf9d3933123e6ddbcc | [
"Apache-2.0"
] | null | null | null | instabot/api/api_video.py | danomaj/instabot | 769e41587a1aaeb50b89f0bf9d3933123e6ddbcc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import json
import os
import re
import shutil
import subprocess
import time
from requests_toolbelt import MultipartEncoder
from . import config
def download_video(
self,
media_id,
filename=None,
media=False,
folder="videos"
):
video_urls = []
if not me... | 32.831956 | 78 | 0.523662 | import copy
import json
import os
import re
import shutil
import subprocess
import time
from requests_toolbelt import MultipartEncoder
from . import config
def download_video(
self,
media_id,
filename=None,
media=False,
folder="videos"
):
video_urls = []
if not media:
self.media_... | true | true |
f7194ea7dd6a75befd86621e8258b956db12dfa2 | 1,839 | py | Python | audiospec.py | MountainRange/mobius_score | fc900ab456b3e3431cfa6d9684b97ec6321d0a23 | [
"MIT"
] | null | null | null | audiospec.py | MountainRange/mobius_score | fc900ab456b3e3431cfa6d9684b97ec6321d0a23 | [
"MIT"
] | null | null | null | audiospec.py | MountainRange/mobius_score | fc900ab456b3e3431cfa6d9684b97ec6321d0a23 | [
"MIT"
] | null | null | null |
import numpy as np
import librosa
from tqdm import tqdm
from audiomisc import ks_key
from constants import VERTICALCUTOFF, FFT_SIZE, FFT_HOP
def stft(x, fft_size, hopsamp):
window = np.hanning(fft_size)
return np.array([np.fft.rfft(window*x[i:i+fft_size])
for i in range(0, len(x)-fft_siz... | 36.058824 | 86 | 0.594889 |
import numpy as np
import librosa
from tqdm import tqdm
from audiomisc import ks_key
from constants import VERTICALCUTOFF, FFT_SIZE, FFT_HOP
def stft(x, fft_size, hopsamp):
window = np.hanning(fft_size)
return np.array([np.fft.rfft(window*x[i:i+fft_size])
for i in range(0, len(x)-fft_siz... | true | true |
f7194ee4f7406065cad234d9d9516182a66c1fdd | 4,936 | py | Python | catalog/views.py | singdingo/django_local_library | e6928ce96d37e5f233a5eda89dcf63c04a551a2d | [
"MIT"
] | null | null | null | catalog/views.py | singdingo/django_local_library | e6928ce96d37e5f233a5eda89dcf63c04a551a2d | [
"MIT"
] | null | null | null | catalog/views.py | singdingo/django_local_library | e6928ce96d37e5f233a5eda89dcf63c04a551a2d | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import permission_required
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from .models import Book, Author, BookInstance, Genre
from django.views import generic
from django.views.generic.edit i... | 32.261438 | 117 | 0.6953 | from django.contrib.auth.decorators import permission_required
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from .models import Book, Author, BookInstance, Genre
from django.views import generic
from django.views.generic.edit i... | true | true |
f7194f009ff4f9095f19defc8b8b945fae4f793a | 698 | py | Python | PyCharm/Exercicios/Aula17/ex078.py | fabiodarice/Python | 15ec1c7428f138be875111ac98ba38cf2eec1a93 | [
"MIT"
] | null | null | null | PyCharm/Exercicios/Aula17/ex078.py | fabiodarice/Python | 15ec1c7428f138be875111ac98ba38cf2eec1a93 | [
"MIT"
] | null | null | null | PyCharm/Exercicios/Aula17/ex078.py | fabiodarice/Python | 15ec1c7428f138be875111ac98ba38cf2eec1a93 | [
"MIT"
] | null | null | null | # Importação de bibliotecas
# Título do programa
print('\033[1;34;40mMAIOR E MENOR VALORES NA LISTA\033[m')
# Objetos
valores = list()
# Lógica
for c in range(0, 5):
valores.append(int(input(f'\033[30mDigite um valor para a Posição {c}:\033[m ')))
maior = max(valores)
menor = min(valores)
print('=-' * 30)
pr... | 22.516129 | 85 | 0.636103 |
print('\033[1;34;40mMAIOR E MENOR VALORES NA LISTA\033[m')
valores = list()
for c in range(0, 5):
valores.append(int(input(f'\033[30mDigite um valor para a Posição {c}:\033[m ')))
maior = max(valores)
menor = min(valores)
print('=-' * 30)
print(f'Você digitou os valores {valores}')
print(f'O maior valor dig... | true | true |
f7194f875486f67d1eadb26fc5e87f6bfaed4596 | 6,237 | py | Python | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 13 | 2017-11-08T07:09:13.000Z | 2022-03-28T07:09:47.000Z | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 3 | 2018-03-08T04:30:19.000Z | 2019-01-03T15:47:24.000Z | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 5 | 2018-01-15T15:26:44.000Z | 2021-08-18T08:02:51.000Z | from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.iterator import DetTestImageIter
import cv2
class ImageDetector(object):
"""
SSD detector which hold a detection network and wraps detection API
Parameters:
----------
symbol : mx.Sy... | 29.842105 | 137 | 0.674683 | from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.iterator import DetTestImageIter
import cv2
class ImageDetector(object):
def __init__(self, symbol, model_prefix, epoch, data_shape, mean_pixels, \
classes, thresh = 0.6, plot_confid... | true | true |
f7194f9c5decb291e54561f76b15458cea4e4f8b | 357 | py | Python | aliexpress/api/rest/MarketingRedefiningGetactlist.py | bayborodin/aliexpress-sdk | 89935adf46412d8d054fa80a19153971279c4106 | [
"MIT"
] | 3 | 2021-03-10T16:46:43.000Z | 2022-03-29T15:28:50.000Z | aliexpress/api/rest/MarketingRedefiningGetactlist.py | bayborodin/aliexpress-sdk | 89935adf46412d8d054fa80a19153971279c4106 | [
"MIT"
] | null | null | null | aliexpress/api/rest/MarketingRedefiningGetactlist.py | bayborodin/aliexpress-sdk | 89935adf46412d8d054fa80a19153971279c4106 | [
"MIT"
] | 2 | 2021-10-30T17:09:34.000Z | 2021-11-25T11:50:52.000Z | from aliexpress.api.base import RestApi
class AliexpressMarketingRedefiningGetactlistRequest(RestApi):
def __init__(self, domain="gw.api.taobao.com", port=80):
RestApi.__init__(self, domain, port)
self.param_seller_coupon_activity_api_query = None
def getapiname(self):
return "aliexpr... | 32.454545 | 62 | 0.756303 | from aliexpress.api.base import RestApi
class AliexpressMarketingRedefiningGetactlistRequest(RestApi):
def __init__(self, domain="gw.api.taobao.com", port=80):
RestApi.__init__(self, domain, port)
self.param_seller_coupon_activity_api_query = None
def getapiname(self):
return "aliexpr... | true | true |
f7194fa0d3317f35e8c12bcca9423aaf27363280 | 981 | py | Python | tests/test_del_contact.py | aogn/python_train | 40131b24633c9771452813872061ca5335edecd8 | [
"Apache-2.0"
] | null | null | null | tests/test_del_contact.py | aogn/python_train | 40131b24633c9771452813872061ca5335edecd8 | [
"Apache-2.0"
] | null | null | null | tests/test_del_contact.py | aogn/python_train | 40131b24633c9771452813872061ca5335edecd8 | [
"Apache-2.0"
] | null | null | null | from models.contact import Contact
import random
import allure
def test_delete_some_contact(app, db, check_ui):
with allure.step('Check contact'):
if len(db.get_contact_list()) == 0:
app.contact.creation(Contact(first_name="test"))
with allure.step('Given a contact list and contact to delet... | 44.590909 | 125 | 0.699286 | from models.contact import Contact
import random
import allure
def test_delete_some_contact(app, db, check_ui):
with allure.step('Check contact'):
if len(db.get_contact_list()) == 0:
app.contact.creation(Contact(first_name="test"))
with allure.step('Given a contact list and contact to delet... | true | true |
f7194fe7656b09b6c529b0342d12157fb1da984f | 710 | py | Python | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | from os import path
from blazeutils import prependsitedir
from blazeweb.application import WSGIApp
from blazeweb.middleware import full_wsgi_stack
from minimal2.config import settings as settingsmod
from blazeweb.scripting import application_entry
# make sure our base module gets put on the path
try:
import minima... | 25.357143 | 61 | 0.773239 | from os import path
from blazeutils import prependsitedir
from blazeweb.application import WSGIApp
from blazeweb.middleware import full_wsgi_stack
from minimal2.config import settings as settingsmod
from blazeweb.scripting import application_entry
try:
import minimal2 except ImportError:
prependsitedir(path.d... | true | true |
f719503e9bb94c5fe728360593ebcf3637d9ab4e | 17,459 | py | Python | src/graphtastic/clustering.py | richardtjornhammar/graphtastic | 1e64d408ffb3e09d5ad068986c847032d5cfdcbd | [
"Apache-2.0"
] | 1 | 2022-02-08T09:53:38.000Z | 2022-02-08T09:53:38.000Z | src/graphtastic/clustering.py | richardtjornhammar/graphtastic | 1e64d408ffb3e09d5ad068986c847032d5cfdcbd | [
"Apache-2.0"
] | null | null | null | src/graphtastic/clustering.py | richardtjornhammar/graphtastic | 1e64d408ffb3e09d5ad068986c847032d5cfdcbd | [
"Apache-2.0"
] | 1 | 2022-03-24T12:37:05.000Z | 2022-03-24T12:37:05.000Z | """
Copyright 2022 RICHARD TJÖRNHAMMAR
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, sof... | 48.497222 | 462 | 0.452145 | import numpy as np
import typing
import sys
try :
from numba import jit
bUseNumba = True
except ImportError :
print ( "ImportError:"," NUMBA. WILL NOT USE IT")
bUseNumba = False
except OSError:
print ( "OSError:"," NUMBA. WILL NOT USE IT")
bUseNumba = False
if bUseNumba... | true | true |
f719505a712591c9db61d06ce1e597d8da79a187 | 235 | py | Python | orb_simulator/lexer/regex_ast/regex_epsilon_node.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | 1 | 2022-01-19T22:49:09.000Z | 2022-01-19T22:49:09.000Z | orb_simulator/lexer/regex_ast/regex_epsilon_node.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | 15 | 2021-11-10T14:25:02.000Z | 2022-02-12T19:17:11.000Z | orb_simulator/lexer/regex_ast/regex_epsilon_node.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | null | null | null | from lexer.regex_ast.regex_atomic_node import AtomicNode
from automaton import Automaton
class EpsilonNode(AtomicNode):
def eval(self):
return Automaton(number_of_states=1, initial_state=0, finalStates=[0], transitions={}) | 39.166667 | 94 | 0.787234 | from lexer.regex_ast.regex_atomic_node import AtomicNode
from automaton import Automaton
class EpsilonNode(AtomicNode):
def eval(self):
return Automaton(number_of_states=1, initial_state=0, finalStates=[0], transitions={}) | true | true |
f71950d1cafe3ade67ae0b9180b0da8119152a85 | 4,293 | py | Python | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import os.path as osp
import torch.nn.functional as F
import multiworld.envs.mujoco as mwmj
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.experiments.disentanglement.launcher import \
disentangled_grill_her_twin_sac_experiment
from rlkit.t... | 32.278195 | 127 | 0.575355 | import os.path as osp
import torch.nn.functional as F
import multiworld.envs.mujoco as mwmj
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.experiments.disentanglement.launcher import \
disentangled_grill_her_twin_sac_experiment
from rlkit.t... | true | true |
f71951497f2af63f6a8b59d46f752d982dea0860 | 8,150 | py | Python | python/paddle/fluid/tests/unittests/ir/inference/test_trt_activation_pass.py | TochkaAI/Paddle | 481ee79fc92304f33165f7ed0679f16c36862cea | [
"Apache-2.0"
] | 3 | 2021-06-08T14:24:36.000Z | 2021-06-08T14:24:38.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_activation_pass.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-03-17T07:53:43.000Z | 2021-03-17T07:53:43.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_activation_pass.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-06-17T06:52:01.000Z | 2021-06-17T06:52:01.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.58952 | 89 | 0.699755 |
import os
import shutil
import unittest
import numpy as np
from inference_pass_test import InferencePassTest
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.core import PassVersionChecker
from paddle.fluid.core import AnalysisConfig
class TensorRTSubgraphPassActivationTest(InferencePa... | true | true |
f71951e82d394762ce0671379de3793e5bb9983b | 1,903 | py | Python | UnitTests/test_battery_sensor_features_extractor.py | naveenkambham/big_five_personality_machine_learning | a4d673e7e72287f2448b6a7b2729e5231b4f7ab2 | [
"MIT"
] | 8 | 2021-02-22T22:12:32.000Z | 2022-03-25T15:18:28.000Z | UnitTests/test_battery_sensor_features_extractor.py | naveenkambham/big_five_personality_machine_learning | a4d673e7e72287f2448b6a7b2729e5231b4f7ab2 | [
"MIT"
] | 1 | 2020-12-29T18:59:39.000Z | 2021-01-13T17:41:25.000Z | UnitTests/test_battery_sensor_features_extractor.py | naveenkambham/big_five_personality_machine_learning | a4d673e7e72287f2448b6a7b2729e5231b4f7ab2 | [
"MIT"
] | 4 | 2021-04-08T11:36:33.000Z | 2022-02-18T14:12:47.000Z | """
Developer : Naveen Kambham
Description: Unit testing for battery sensor feature extractor code. Majority of the data extraction code has to be tested visually by looking at the plots distributions.
"""
#Importing the required libraries.
import unittest
import numpy as np
from FeatureExtraction import battery_senso... | 38.836735 | 171 | 0.656332 | import unittest
import numpy as np
from FeatureExtraction import battery_sensor_features_extractor
class BatterySensorTestCase(unittest.TestCase):
def test_TakeMostProbableTimeInStudy(self):
result= battery_sensor_features_extractor.TakeMostProbableTimeInStudy([1,1,1,1,2,2,3,3,3,3,3,3,3,3],... | true | true |
f7195383ef1c320e1cc9ce4ac28c29823e011af1 | 2,059 | py | Python | graph.py | jacgonzalez/Graph_Art | ea724c3e659aca63107ae9a59cb646f8aba821c6 | [
"MIT"
] | null | null | null | graph.py | jacgonzalez/Graph_Art | ea724c3e659aca63107ae9a59cb646f8aba821c6 | [
"MIT"
] | null | null | null | graph.py | jacgonzalez/Graph_Art | ea724c3e659aca63107ae9a59cb646f8aba821c6 | [
"MIT"
] | null | null | null | import math
points = [[4,1], [4,2], [4,3],
[3,1], [3,2], [3,3],
[2,1], [2,2], [2,3],
[1,1], [1,2], [1,3]]
def distance(point1, point2):
return math.sqrt(((point2[0] - point1[0])**2) + ((point2[1] - point1[1])**2))
def k_neighbors(i, points, k):
"""
i: index of a point
... | 21.447917 | 81 | 0.592521 | import math
points = [[4,1], [4,2], [4,3],
[3,1], [3,2], [3,3],
[2,1], [2,2], [2,3],
[1,1], [1,2], [1,3]]
def distance(point1, point2):
return math.sqrt(((point2[0] - point1[0])**2) + ((point2[1] - point1[1])**2))
def k_neighbors(i, points, k):
distancias_point_i = []
poi... | true | true |
f71953db54832094263b29e4d88077938efd3aed | 5,989 | py | Python | test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 43.398551 | 106 | 0.674236 | from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.tra... | true | true |
f7195404dfad6b9a9dd9872526043575b12c080b | 3,669 | py | Python | trafficModel.py | Mobility-simulation/IDM_Program | ac33674373d8560b440562acb5acf82ae5bf4fc6 | [
"Unlicense"
] | null | null | null | trafficModel.py | Mobility-simulation/IDM_Program | ac33674373d8560b440562acb5acf82ae5bf4fc6 | [
"Unlicense"
] | null | null | null | trafficModel.py | Mobility-simulation/IDM_Program | ac33674373d8560b440562acb5acf82ae5bf4fc6 | [
"Unlicense"
] | null | null | null | import tkinter as tk
from system.operation import Operation
from model.world import World
import settings
root = tk.Tk()
img = tk.PhotoImage(file='png/sports-car.png')
root.tk.call('wm', 'iconphoto', root._w, img)
menu = tk.Menu(root)
root.config(menu=menu)
root.protocol("WM_DELETE_WINDOW", lambda: op.terminate(root... | 29.829268 | 75 | 0.706187 | import tkinter as tk
from system.operation import Operation
from model.world import World
import settings
root = tk.Tk()
img = tk.PhotoImage(file='png/sports-car.png')
root.tk.call('wm', 'iconphoto', root._w, img)
menu = tk.Menu(root)
root.config(menu=menu)
root.protocol("WM_DELETE_WINDOW", lambda: op.terminate(root... | true | true |
f719543be7e7a689ebcb0b8ad3fa69e2a94998d6 | 3,217 | py | Python | setup.py | groupserver/gs.profile.status.send | d33c7ab535565d185a2ef95bf00c92b9ffeb8af7 | [
"ZPL-2.1"
] | null | null | null | setup.py | groupserver/gs.profile.status.send | d33c7ab535565d185a2ef95bf00c92b9ffeb8af7 | [
"ZPL-2.1"
] | null | null | null | setup.py | groupserver/gs.profile.status.send | d33c7ab535565d185a2ef95bf00c92b9ffeb8af7 | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2012, 2013, 2014, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should ... | 38.297619 | 76 | 0.618278 | import codecs
import os
import sys
from setuptools import setup, find_packages
from version import get_version
version = get_version()
core = ['setuptools',
'blessings',
'gs.config', 'gs.form', ]
if sys.version_info > (2, 6):
requires = core
else:
requires = core + ['argparse']
with ... | true | true |
f71954b599b64b8d33b4eb0854424d9b156c78cd | 64,577 | py | Python | test/integration/component/test_redundant_router_network_rules.py | lafferty/cshv3 | ee0ff7ac240bd24e19db6bd3fb9869dd087442ba | [
"Apache-2.0"
] | 2 | 2015-05-19T05:04:30.000Z | 2016-09-07T00:33:17.000Z | test/integration/component/test_redundant_router_network_rules.py | lafferty/cshv3 | ee0ff7ac240bd24e19db6bd3fb9869dd087442ba | [
"Apache-2.0"
] | null | null | null | test/integration/component/test_redundant_router_network_rules.py | lafferty/cshv3 | ee0ff7ac240bd24e19db6bd3fb9869dd087442ba | [
"Apache-2.0"
] | 2 | 2017-07-07T14:49:03.000Z | 2018-07-31T06:38:42.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 u... | 45.253679 | 128 | 0.429843 |
from nose.plugins.attrib import attr
from marvin.integration.lib.base import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.common import *
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.cloudstackAPI import *
class Services:
def __init__(self):
self.servi... | true | true |
f719550eb352bbb1095167f47a860d9ae8edd55b | 283 | py | Python | src/com/python/socket/udp_client.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/socket/udp_client.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/socket/udp_client.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | '''
Created on 2016年8月10日
@author: Administrator
'''
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for data in [b'Michael', b'Tracy', b'Sarah']:
# 发送数据:
s.sendto(data, ('127.0.0.1', 9999))
# 接收数据:
print(s.recv(1024).decode('utf-8'))
s.close() | 17.6875 | 52 | 0.636042 | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for data in [b'Michael', b'Tracy', b'Sarah']:
s.sendto(data, ('127.0.0.1', 9999))
print(s.recv(1024).decode('utf-8'))
s.close() | true | true |
f71955e2cbcdd5db22e26670801fd917e9622190 | 431 | py | Python | app/core/migrations/0005_recipe_image.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.14 on 2020-07-31 14:42
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.55 | 93 | 0.62181 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(null=True, up... | true | true |
f71956fe3c17887634434668acacfe3048dd4355 | 4,815 | py | Python | src/mem/ruby/network/garnet/GarnetNetwork.py | NickSica/gem5 | 87ffe8b4f75f3a6938144e4edc1ba0ba6f3f0610 | [
"BSD-3-Clause"
] | null | null | null | src/mem/ruby/network/garnet/GarnetNetwork.py | NickSica/gem5 | 87ffe8b4f75f3a6938144e4edc1ba0ba6f3f0610 | [
"BSD-3-Clause"
] | null | null | null | src/mem/ruby/network/garnet/GarnetNetwork.py | NickSica/gem5 | 87ffe8b4f75f3a6938144e4edc1ba0ba6f3f0610 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2008 Princeton University
# Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above c... | 55.344828 | 258 | 0.727726 |
from m5.params import *
from m5.proxy import *
from m5.objects.Network import RubyNetwork
from m5.objects.BasicRouter import BasicRouter
from m5.objects.ClockedObject import ClockedObject
class GarnetNetwork(RubyNetwork):
type = 'GarnetNetwork'
cxx_header = "mem/ruby/network/garnet/GarnetNetwork.hh"
cxx_c... | true | true |
f71957077b0dab80c0b89a88133f80aa1b7d1e31 | 23,266 | py | Python | data_generators/data_options.py | Zack-Quintana/underdog-devs-ds-a | 743c1b977eb52c1ca536df927ab1474949f1bd90 | [
"MIT"
] | null | null | null | data_generators/data_options.py | Zack-Quintana/underdog-devs-ds-a | 743c1b977eb52c1ca536df927ab1474949f1bd90 | [
"MIT"
] | null | null | null | data_generators/data_options.py | Zack-Quintana/underdog-devs-ds-a | 743c1b977eb52c1ca536df927ab1474949f1bd90 | [
"MIT"
] | null | null | null | import string
from itertools import chain
from math import ceil, floor
from random import randint, choice, random, choices, shuffle
male_first_names = (
"Liam", "Noah", "Oliver", "Elijah", "William", "James", "Benjamin", "Lucas",
"Henry", "Alexander", "Mason", "Michael", "Ethan", "Daniel", "Jacob",
"Logan"... | 65.538028 | 80 | 0.568297 | import string
from itertools import chain
from math import ceil, floor
from random import randint, choice, random, choices, shuffle
male_first_names = (
"Liam", "Noah", "Oliver", "Elijah", "William", "James", "Benjamin", "Lucas",
"Henry", "Alexander", "Mason", "Michael", "Ethan", "Daniel", "Jacob",
"Logan"... | true | true |
f719579272f6a91654381f1c2c1b0fc8aede760f | 1,559 | py | Python | channels/streamedit.py | leigh123linux/streamtuner2 | 43ded3a68bcf3d968a99c849d779fc8c3fb3d8d8 | [
"MIT"
] | 1 | 2019-03-03T19:58:01.000Z | 2019-03-03T19:58:01.000Z | channels/streamedit.py | leigh123linux/streamtuner2 | 43ded3a68bcf3d968a99c849d779fc8c3fb3d8d8 | [
"MIT"
] | null | null | null | channels/streamedit.py | leigh123linux/streamtuner2 | 43ded3a68bcf3d968a99c849d779fc8c3fb3d8d8 | [
"MIT"
] | null | null | null | # api: streamtuner2
# title: Stream entry editor
# description: Allows to inspect and modify station/stream entries.
# version: 0.6
# type: feature
# category: ui
# config: -
# priority: core
#
# Editing dialog for stream entries. Available in
# the context and main menu. Most useful for
# changing bookmarks, or even ... | 27.839286 | 105 | 0.628608 |
from uikit import *
import channels
from config import *
from copy import copy
class streamedit (AuxiliaryWindow):
fields = [
"favicon", "format", "genre", "homepage", "playing", "title", "url", "extra"
]
def open(self, mw):
self.main.configwin.load_config(self.main.row(), "streamed... | true | true |
f71957e4865285d50289aa6cd3aa2a4c44bdc813 | 260 | py | Python | lucky-four.py | omar115/codechef | 7634b085bb906e4ef29e6ae08bdbe82add2aa345 | [
"MIT"
] | null | null | null | lucky-four.py | omar115/codechef | 7634b085bb906e4ef29e6ae08bdbe82add2aa345 | [
"MIT"
] | null | null | null | lucky-four.py | omar115/codechef | 7634b085bb906e4ef29e6ae08bdbe82add2aa345 | [
"MIT"
] | null | null | null | t = int(input())
i=0
while i < t:
st = str(input())
length = len(st)
j = 0
cnt = 0
while j < length:
num = int(st[j])
#print(num)
if num == 4:
cnt = cnt + 1
j=j+1
print(cnt)
i=i+1 | 16.25 | 25 | 0.388462 | t = int(input())
i=0
while i < t:
st = str(input())
length = len(st)
j = 0
cnt = 0
while j < length:
num = int(st[j])
if num == 4:
cnt = cnt + 1
j=j+1
print(cnt)
i=i+1 | true | true |
f71958930d922f66399bb7f49e57cab4ab83d335 | 12,028 | py | Python | hfc/protos/peer/collection_pb2.py | roviso/hyberledger-py | 908dd597e0822f99cf618f235dd517824ba44bc4 | [
"Apache-2.0"
] | 389 | 2016-09-18T11:50:10.000Z | 2022-03-29T21:45:40.000Z | hfc/protos/peer/collection_pb2.py | regrlomon/fabric-sdk-py | 57ddc125cd0627c602d55b300d3e0ba50600ea9e | [
"Apache-2.0"
] | 112 | 2017-08-18T00:32:21.000Z | 2022-02-25T18:55:57.000Z | hfc/protos/peer/collection_pb2.py | regrlomon/fabric-sdk-py | 57ddc125cd0627c602d55b300d3e0ba50600ea9e | [
"Apache-2.0"
] | 268 | 2016-10-12T02:56:58.000Z | 2022-03-30T09:50:54.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hfc/protos/peer/collection.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
... | 45.388679 | 1,115 | 0.786415 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from hfc.protos.common import policies_pb2 as hfc_dot_protos... | true | true |
f7195995fd51c5d254684ca38dffb1faa4bb8fd0 | 594 | py | Python | tests/__init__.py | techthiyanes/ml_things | ddeeb16c55cf1d55cf80963217a8d1bffd0913cc | [
"Apache-2.0"
] | 153 | 2020-10-10T05:12:16.000Z | 2022-03-17T07:48:42.000Z | tests/__init__.py | techthiyanes/ml_things | ddeeb16c55cf1d55cf80963217a8d1bffd0913cc | [
"Apache-2.0"
] | 21 | 2020-09-15T22:52:43.000Z | 2022-02-21T15:27:16.000Z | tests/__init__.py | techthiyanes/ml_things | ddeeb16c55cf1d55cf80963217a8d1bffd0913cc | [
"Apache-2.0"
] | 42 | 2020-10-11T07:33:32.000Z | 2022-03-11T01:43:54.000Z | # coding=utf-8
# Copyright 2020 George Mihaila.
#
# 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 agr... | 39.6 | 74 | 0.760943 | true | true | |
f7195a417bd65f657d54400929963ce73b5b19d7 | 14,584 | py | Python | qiskit/quantum_info/operators/measures.py | KOLANICH/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 1 | 2021-04-28T14:37:16.000Z | 2021-04-28T14:37:16.000Z | qiskit/quantum_info/operators/measures.py | timgates42/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 6 | 2021-01-17T17:56:08.000Z | 2021-04-01T12:40:21.000Z | qiskit/quantum_info/operators/measures.py | timgates42/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 2 | 2021-03-07T07:58:54.000Z | 2021-04-28T03:40:49.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 38.582011 | 88 | 0.637959 |
import warnings
import numpy as np
from scipy import sparse
from qiskit.exceptions import QiskitError
from qiskit.circuit.gate import Gate
from qiskit.quantum_info.operators.base_operator import BaseOperator
from qiskit.quantum_info.operators.operator import Operator
from qiskit.quantum_info.operators.channel.quantu... | true | true |
f7195bbf84421b2fed723996ef1806b0e3e52004 | 2,465 | py | Python | backend/fleet_management/tests/test_crypto.py | OtisRed/pah-fm | 68a306fce5593a6f79711fa473a91bc8163b01df | [
"MIT"
] | 8 | 2019-08-09T11:06:16.000Z | 2021-10-05T14:56:31.000Z | backend/fleet_management/tests/test_crypto.py | OtisRed/pah-fm | 68a306fce5593a6f79711fa473a91bc8163b01df | [
"MIT"
] | 382 | 2018-10-17T19:05:30.000Z | 2022-02-10T07:09:45.000Z | backend/fleet_management/tests/test_crypto.py | OtisRed/pah-fm | 68a306fce5593a6f79711fa473a91bc8163b01df | [
"MIT"
] | 45 | 2018-10-17T17:04:04.000Z | 2021-10-05T14:30:35.000Z | from secrets import randbits
from django.conf import settings
from rest_framework.test import APISimpleTestCase
from fleet_management.crypto import (
sign,
verify,
inverse_of,
is_prime,
find_prime,
find_p_q_phi,
find_pair_of_keys,
hash_dict,
)
class CryptoTest(APISimpleTestCase):
... | 34.236111 | 79 | 0.627586 | from secrets import randbits
from django.conf import settings
from rest_framework.test import APISimpleTestCase
from fleet_management.crypto import (
sign,
verify,
inverse_of,
is_prime,
find_prime,
find_p_q_phi,
find_pair_of_keys,
hash_dict,
)
class CryptoTest(APISimpleTestCase):
... | true | true |
f7195c0c364fe7bce695c427067417d2cf71be24 | 3,496 | py | Python | bindings/python/ensmallen/datasets/string/pontibacterchinhatensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/pontibacterchinhatensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/pontibacterchinhatensis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Pontibacter chinhatensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prote... | 33.295238 | 223 | 0.67992 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def PontibacterChinhatensis(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/st... | true | true |
f7195c158eefd24c981c80cfe2493d7d0991e7c0 | 1,263 | py | Python | jesse/indicators/supersmoother.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-03-25T09:25:49.000Z | 2021-03-25T09:25:49.000Z | jesse/indicators/supersmoother.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | null | null | null | jesse/indicators/supersmoother.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-09-28T16:23:40.000Z | 2021-09-28T16:23:40.000Z | from typing import Union
import numpy as np
from numba import njit
from jesse.helpers import get_candle_source, slice_candles
def supersmoother(candles: np.ndarray, period: int = 14, source_type: str = "close", sequential: bool = False) -> Union[
float, np.ndarray]:
"""
Super Smoother Filter 2pole Butte... | 28.066667 | 120 | 0.638163 | from typing import Union
import numpy as np
from numba import njit
from jesse.helpers import get_candle_source, slice_candles
def supersmoother(candles: np.ndarray, period: int = 14, source_type: str = "close", sequential: bool = False) -> Union[
float, np.ndarray]:
candles = slice_candles(candles, sequent... | true | true |
f7195cbfea553513473b2df5d5bf67f1cff230ba | 12,078 | py | Python | cellrank/pl/_circular_projection.py | WeilerP/cellrank | c8c2b9f6bd2448861fb414435aee7620ca5a0bad | [
"BSD-3-Clause"
] | 172 | 2020-03-19T19:50:53.000Z | 2022-03-28T09:36:04.000Z | cellrank/pl/_circular_projection.py | WeilerP/cellrank | c8c2b9f6bd2448861fb414435aee7620ca5a0bad | [
"BSD-3-Clause"
] | 702 | 2020-03-19T08:09:04.000Z | 2022-03-30T09:55:14.000Z | cellrank/pl/_circular_projection.py | WeilerP/cellrank | c8c2b9f6bd2448861fb414435aee7620ca5a0bad | [
"BSD-3-Clause"
] | 17 | 2020-04-07T03:11:02.000Z | 2022-02-02T20:39:16.000Z | from typing import Any, Tuple, Union, Mapping, Callable, Optional, Sequence
from typing_extensions import Literal
from enum import auto
from types import MappingProxyType
from pathlib import Path
import scvelo as scv
from anndata import AnnData
from cellrank import logging as logg
from cellrank.tl import Lineage
from... | 35.946429 | 119 | 0.626925 | from typing import Any, Tuple, Union, Mapping, Callable, Optional, Sequence
from typing_extensions import Literal
from enum import auto
from types import MappingProxyType
from pathlib import Path
import scvelo as scv
from anndata import AnnData
from cellrank import logging as logg
from cellrank.tl import Lineage
from... | true | true |
f7195d706b8209cba3d1242687affeb52b7f4d89 | 10,085 | py | Python | app/recipe/tests/test_recipe_api.py | ajayhb/recipe-app | 226b1f4cce34412833a943e92d77f1f85775a2fc | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | ajayhb/recipe-app | 226b1f4cce34412833a943e92d77f1f85775a2fc | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | ajayhb/recipe-app | 226b1f4cce34412833a943e92d77f1f85775a2fc | [
"MIT"
] | null | null | null | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from decimal import Decimal
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from ... | 34.186441 | 78 | 0.64115 | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from decimal import Decimal
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from ... | true | true |
f7195f13467831480cf8e17b1264da8851ad2e64 | 21,774 | py | Python | quant/platform/kucoin.py | yfjelley/thenextquant | 5a2c4324ea390b513632ed2cc64d53314624e4ba | [
"MIT"
] | 2 | 2021-09-22T08:41:55.000Z | 2021-11-05T01:45:27.000Z | quant/platform/kucoin.py | mrganer/thenextquant | 52fb22f5df20d43cb275a08adad81dc97f25a712 | [
"MIT"
] | 1 | 2019-10-25T05:25:28.000Z | 2019-10-25T05:25:28.000Z | quant/platform/kucoin.py | mrganer/thenextquant | 52fb22f5df20d43cb275a08adad81dc97f25a712 | [
"MIT"
] | 4 | 2019-11-29T03:12:34.000Z | 2021-09-19T02:59:29.000Z | # -*- coding:utf-8 -*-
"""
Kucoin Trade module.
https://docs.kucoin.com
Author: HuangTao
Date: 2019/08/01
Email: huangtao@ifclover.com
"""
import json
import copy
import hmac
import base64
import hashlib
from urllib.parse import urljoin
from quant.error import Error
from quant.utils import tools
from quant.utils... | 37.412371 | 133 | 0.596445 |
import json
import copy
import hmac
import base64
import hashlib
from urllib.parse import urljoin
from quant.error import Error
from quant.utils import tools
from quant.utils import logger
from quant.const import KUCOIN
from quant.order import Order
from quant.asset import Asset, AssetSubscribe
from quant.tasks impo... | true | true |
f7195fe4de87239beab23f5be618730dc300a65f | 14,645 | py | Python | RAdam.py | blnm/RSE | 6a3f0dd858ea4b6dafcfb1d97bb979e101d9911c | [
"MIT"
] | 40 | 2020-04-24T01:03:12.000Z | 2022-03-20T18:19:30.000Z | RAdam.py | blnm/RSE | 6a3f0dd858ea4b6dafcfb1d97bb979e101d9911c | [
"MIT"
] | 4 | 2021-09-09T13:26:09.000Z | 2022-03-31T18:37:05.000Z | RAdam.py | blnm/RSE | 6a3f0dd858ea4b6dafcfb1d97bb979e101d9911c | [
"MIT"
] | 7 | 2020-11-25T14:26:09.000Z | 2022-01-29T10:18:40.000Z | import tensorflow as tf
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.ops import clip_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import resource_variable_ops
from ten... | 49.476351 | 120 | 0.629157 | import tensorflow as tf
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.ops import clip_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import resource_variable_ops
from ten... | true | true |
f7196003d3c4be36ba4db4ea82b6856d51483928 | 18,496 | py | Python | btclib/ecc/ssa.py | dginst/btclib | 70932afe32167449e369d4e2911b1bf741c0f5d2 | [
"MIT"
] | 16 | 2019-01-04T22:21:17.000Z | 2020-02-01T10:41:28.000Z | btclib/ecc/ssa.py | dginst/BitcoinBlockchainTechnology | 70932afe32167449e369d4e2911b1bf741c0f5d2 | [
"MIT"
] | 20 | 2018-05-24T18:47:12.000Z | 2018-12-22T09:52:09.000Z | btclib/ecc/ssa.py | dginst/BitcoinBlockchainTechnology | 70932afe32167449e369d4e2911b1bf741c0f5d2 | [
"MIT"
] | 9 | 2018-05-16T09:53:32.000Z | 2019-01-03T13:49:37.000Z | #!/usr/bin/env python3
# Copyright (C) 2017-2022 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except... | 31.243243 | 88 | 0.655872 |
import secrets
from dataclasses import InitVar, dataclass
from hashlib import sha256
from typing import List, Optional, Sequence, Tuple, Type, Union
from btclib.alias import BinaryData, HashF, Integer, JacPoint, Octets, Point
from btclib.bip32.bip32 import BIP32Key
from btclib.ecc.curve import Curve, secp256k1
from... | true | true |
f71960081cd60ffe81c41f006c1585cf0ab6b33d | 763 | py | Python | river/metrics/smape.py | brcharron/creme | 25290780f6bba0eb030215194e81b120d0219389 | [
"BSD-3-Clause"
] | 1 | 2020-12-04T18:56:19.000Z | 2020-12-04T18:56:19.000Z | river/metrics/smape.py | brcharron/creme | 25290780f6bba0eb030215194e81b120d0219389 | [
"BSD-3-Clause"
] | null | null | null | river/metrics/smape.py | brcharron/creme | 25290780f6bba0eb030215194e81b120d0219389 | [
"BSD-3-Clause"
] | null | null | null | from . import base
__all__ = ['SMAPE']
class SMAPE(base.MeanMetric, base.RegressionMetric):
"""Symmetric mean absolute percentage error.
Examples
--------
>>> from river import metrics
>>> y_true = [0, 0.07533, 0.07533, 0.07533, 0.07533, 0.07533, 0.07533, 0.0672, 0.0672]
>>> y_pred = [0, ... | 21.8 | 90 | 0.549148 | from . import base
__all__ = ['SMAPE']
class SMAPE(base.MeanMetric, base.RegressionMetric):
def _eval(self, y_true, y_pred):
den = abs(y_true) + abs(y_pred)
if den == 0:
return 0.
return 2. * abs(y_true - y_pred) / den
def get(self):
return 100 * super().get()
| true | true |
f7196073162dfb6d958cbb439ef46151f867a863 | 371,245 | py | Python | pandas/core/generic.py | rhshadrach/pandas | 8f51c998e84feeac6cb760a9f12baf6948cd5922 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-06T14:07:02.000Z | 2021-08-06T14:07:02.000Z | pandas/core/generic.py | jdsurya/pandas | 777c0f90c6067c636fcd76ce003a8fbfcc311d7b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/generic.py | jdsurya/pandas | 777c0f90c6067c636fcd76ce003a8fbfcc311d7b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-02-03T11:02:42.000Z | 2021-02-03T11:02:42.000Z | import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... | 33.135041 | 104 | 0.529394 | import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... | true | true |
f719607b2a4e7f5eac2478307ce00dc1f2055669 | 2,541 | py | Python | e3sm_to_cmip/cmor_handlers/zos.py | xylar/e3sm_to_cmip | 4fbe8fc91475eae26df839d0cd8062c4b8dc16ae | [
"MIT"
] | 7 | 2018-05-03T12:30:06.000Z | 2022-01-20T23:52:02.000Z | e3sm_to_cmip/cmor_handlers/zos.py | xylar/e3sm_to_cmip | 4fbe8fc91475eae26df839d0cd8062c4b8dc16ae | [
"MIT"
] | 91 | 2018-05-02T21:11:30.000Z | 2022-03-30T20:25:07.000Z | e3sm_to_cmip/cmor_handlers/zos.py | xylar/e3sm_to_cmip | 4fbe8fc91475eae26df839d0cd8062c4b8dc16ae | [
"MIT"
] | 7 | 2018-05-15T02:07:34.000Z | 2021-06-30T18:20:33.000Z |
"""
compute Sea Surface Height Above Geoid, zos
"""
from __future__ import absolute_import, division, print_function
import xarray
import logging
from e3sm_to_cmip import mpas
from e3sm_to_cmip.util import print_message
# 'MPAS' as a placeholder for raw variables needed
RAW_VARIABLES = ['MPASO', 'MPAS_mesh', 'MPAS_... | 28.233333 | 76 | 0.648564 |
from __future__ import absolute_import, division, print_function
import xarray
import logging
from e3sm_to_cmip import mpas
from e3sm_to_cmip.util import print_message
RAW_VARIABLES = ['MPASO', 'MPAS_mesh', 'MPAS_map']
VAR_NAME = 'zos'
VAR_UNITS = 'm'
TABLE = 'CMIP6_Omon.json'
def handle(infiles, tables, user_in... | true | true |
f719619a72f865368354a85f0cae0766341013ef | 1,087 | py | Python | supports/mover-performance-test/run_ssm_mover.py | MajorJason/SSM | 3341585165ac10a47ddeed0e1d5e2467db482b99 | [
"Apache-2.0"
] | 199 | 2017-04-19T06:37:24.000Z | 2022-03-31T12:14:22.000Z | supports/mover-performance-test/run_ssm_mover.py | Dam1029/SSM | d459811728980258f4ebd0b81022620b750863fe | [
"Apache-2.0"
] | 1,091 | 2017-04-14T07:09:55.000Z | 2022-01-20T11:15:54.000Z | supports/mover-performance-test/run_ssm_mover.py | Dam1029/SSM | d459811728980258f4ebd0b81022620b750863fe | [
"Apache-2.0"
] | 170 | 2017-04-14T03:45:30.000Z | 2022-03-31T12:14:24.000Z | import sys
import time
from util import *
size = sys.argv[1]
num = sys.argv[2]
#The data dir is named by case. Please see prepare.sh
case = size + "_" + num
log = sys.argv[3]
#Either "allssd" or "alldisk"
action = sys.argv[4]
if action == "allssd":
rid = submit_rule("file: path matches \"/" + case + "/*\"| allss... | 24.155556 | 72 | 0.678933 | import sys
import time
from util import *
size = sys.argv[1]
num = sys.argv[2]
case = size + "_" + num
log = sys.argv[3]
action = sys.argv[4]
if action == "allssd":
rid = submit_rule("file: path matches \"/" + case + "/*\"| allssd")
elif action == "alldisk":
rid = submit_rule("file: path matches \"/" + case ... | true | true |
f71962cca1d8ea20c86aa01378d38c3db9829b67 | 9,032 | py | Python | example_conda_pkg/descriptors.py | dajtmullaj/example_conda_pkg | 7c2bf657d14c714608e653d7218fa3cd658a6297 | [
"MIT"
] | null | null | null | example_conda_pkg/descriptors.py | dajtmullaj/example_conda_pkg | 7c2bf657d14c714608e653d7218fa3cd658a6297 | [
"MIT"
] | null | null | null | example_conda_pkg/descriptors.py | dajtmullaj/example_conda_pkg | 7c2bf657d14c714608e653d7218fa3cd658a6297 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 3 21:21:19 2020
Project: chemplot (Chemical Space Visualization)
Content: Descriptor operation methods
@author: murat cihan sorkun
"""
from rdkit import Chem
from rdkit.Chem import AllChem
import pandas as pd
import math
import mordred
from mordred import Calculator, d... | 39.441048 | 206 | 0.704052 |
from rdkit import Chem
from rdkit.Chem import AllChem
import pandas as pd
import math
import mordred
from mordred import Calculator, descriptors from sklearn.linear_model import Lasso, LogisticRegression
from sklearn.feature_selection import SelectFromModel
from sklearn.preprocessing import StandardScaler
def get_mor... | true | true |
f71962fa2355f2d2493a845f387b9126cf69d7d6 | 69,118 | py | Python | neutron/tests/unit/api/v2/test_base.py | mcadariu/neutron | 35494af5a25efb8b314941ab85b44923654f6acc | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:31.000Z | 2018-07-04T07:59:31.000Z | neutron/tests/unit/api/v2/test_base.py | ljzjohnson/neutron | d78664321482c15981a09642985a540195e754e3 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/api/v2/test_base.py | ljzjohnson/neutron | d78664321482c15981a09642985a540195e754e3 | [
"Apache-2.0"
] | 1 | 2018-08-28T17:13:16.000Z | 2018-08-28T17:13:16.000Z | # Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 42.017021 | 79 | 0.589036 |
import os
import mock
from neutron_lib.api import attributes
from neutron_lib.api import converters
from neutron_lib.callbacks import registry
from neutron_lib import constants
from neutron_lib import context
from neutron_lib import exceptions as n_exc
from neutron_lib import fixture
from neutron_lib.plugins import d... | true | true |
f719631a516cc8db5629534c7d6fe3350cae0be1 | 30,892 | py | Python | tests/integrate_test/samples/sample_builtin/0_0_5/governance/governance.py | bayeshack2016/icon-service | 36cab484d2e41548d7f2f74526f127ee3a4423fc | [
"Apache-2.0"
] | 52 | 2018-08-24T02:28:43.000Z | 2021-07-06T04:44:22.000Z | tests/integrate_test/samples/sample_builtin/0_0_5/governance/governance.py | bayeshack2016/icon-service | 36cab484d2e41548d7f2f74526f127ee3a4423fc | [
"Apache-2.0"
] | 62 | 2018-09-17T06:59:16.000Z | 2021-12-15T06:02:51.000Z | tests/integrate_test/samples/sample_builtin/0_0_5/governance/governance.py | bayeshack2016/icon-service | 36cab484d2e41548d7f2f74526f127ee3a4423fc | [
"Apache-2.0"
] | 35 | 2018-09-14T02:42:10.000Z | 2022-02-05T10:34:46.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 ICON Foundation
#
# 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 ... | 36.515366 | 109 | 0.605529 |
from iconservice import *
TAG = 'Governance'
DEBUG = False
CURRENT = 'current'
NEXT = 'next'
STATUS = 'status'
DEPLOY_TX_HASH = 'deployTxHash'
AUDIT_TX_HASH = 'auditTxHash'
VALID_STATUS_KEYS = [STATUS, DEPLOY_TX_HASH, AUDIT_TX_HASH]
STATUS_PENDING = 'pending'
STATUS_ACTIVE = 'active'
STATUS_INACTIVE = 'inactive'
S... | true | true |
f719631ce5568ca0573b1aff26b681add708c145 | 5,186 | py | Python | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """ A Qt API selector that can be used to switch between PyQt and PySide.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT = 'PyQt4' # API is not set here;... | 33.895425 | 79 | 0.642885 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
QT_API_PYQT = 'PyQt4' QT_API_PYQTv2 = 'PyQt4v2' QT_API_PYSIDE = 'PySide' QT_API_PYQT5 = 'PyQt5'
ETS = dict(pyqt=(QT_API_PYQTv2, ... | true | true |
f71963b2a8fde56239fbbd548e6a4f71526ae07c | 70,771 | py | Python | controllers/req.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | 1 | 2016-12-22T09:31:22.000Z | 2016-12-22T09:31:22.000Z | controllers/req.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | null | null | null | controllers/req.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Request Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
""" Module'... | 41.9508 | 145 | 0.445889 |
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
def index():
return s3db.cms_index(module, alt_function="index_alt")
def index_alt():
redirect(URL(f="req", args=["search"]))
def is_affiliated():
... | true | true |
f7196479819c081e316242e97b6c71d0635143b6 | 249 | py | Python | ACM/NAQ16/G.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | 1 | 2017-10-01T00:51:39.000Z | 2017-10-01T00:51:39.000Z | ACM/NAQ16/G.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | null | null | null | ACM/NAQ16/G.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | null | null | null | sa = input()
la = len(sa)
a = int(sa)
import math
num = 0
i = 0
while True:
i += 1
num += math.log10(i)
if(math.ceil(num) >= la- 100):
print(i, num, la)
if(math.ceil(num) == la):
print(i)
if(math.ceil(num) > la):
break
| 10.375 | 32 | 0.522088 | sa = input()
la = len(sa)
a = int(sa)
import math
num = 0
i = 0
while True:
i += 1
num += math.log10(i)
if(math.ceil(num) >= la- 100):
print(i, num, la)
if(math.ceil(num) == la):
print(i)
if(math.ceil(num) > la):
break
| true | true |
f719651f1696393c8cda5badd8ce6c3c1ce02286 | 3,397 | py | Python | browser_history/cli.py | RobertWetzler/browser-history | bce5438e8b697e9be70d3747d0b9835c6c1324bc | [
"Apache-2.0"
] | null | null | null | browser_history/cli.py | RobertWetzler/browser-history | bce5438e8b697e9be70d3747d0b9835c6c1324bc | [
"Apache-2.0"
] | null | null | null | browser_history/cli.py | RobertWetzler/browser-history | bce5438e8b697e9be70d3747d0b9835c6c1324bc | [
"Apache-2.0"
] | null | null | null | """This module defines functions and globals required for the
command line interface of browser-history."""
import sys
import argparse
from browser_history import get_history, generic, browsers, utils
# get list of all implemented browser by finding subclasses of generic.Browser
AVAILABLE_BROWSERS = ', '.join(b.__nam... | 37.32967 | 109 | 0.548719 |
import sys
import argparse
from browser_history import get_history, generic, browsers, utils
AVAILABLE_BROWSERS = ', '.join(b.__name__ for b in generic.Browser.__subclasses__())
AVAILABLE_FORMATS = ', '.join(generic.Outputs.formats)
def make_parser():
parser_ = argparse.ArgumentParser(description='''
... | true | true |
f7196672dac355b888cbfce65b0f4b2221ebe267 | 30,455 | py | Python | testing/test_basic.py | yaccz/pytest-twisted | 5dc4efc5d335da0172fec02e48076aacef4bf75d | [
"BSD-3-Clause"
] | null | null | null | testing/test_basic.py | yaccz/pytest-twisted | 5dc4efc5d335da0172fec02e48076aacef4bf75d | [
"BSD-3-Clause"
] | null | null | null | testing/test_basic.py | yaccz/pytest-twisted | 5dc4efc5d335da0172fec02e48076aacef4bf75d | [
"BSD-3-Clause"
] | null | null | null | import sys
import textwrap
import pytest
# https://docs.python.org/3/whatsnew/3.5.html#pep-492-coroutines-with-async-and-await-syntax
ASYNC_AWAIT = sys.version_info >= (3, 5)
# https://docs.python.org/3/whatsnew/3.6.html#pep-525-asynchronous-generators
ASYNC_GENERATORS = sys.version_info >= (3, 6)
timeout = 15
#... | 26.691499 | 125 | 0.663044 | import sys
import textwrap
import pytest
ASYNC_AWAIT = sys.version_info >= (3, 5)
ASYNC_GENERATORS = sys.version_info >= (3, 6)
timeout = 15
def force_plural(name):
if name in {"error", "warning"}:
return name + "s"
return name
def assert_outcomes(run_result, outcomes):
formatted_output = ... | true | true |
f71966a40eb176b3c19c2ff7f010677d27b381e5 | 2,799 | py | Python | channel-api/tests/integration/conftest.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | 3 | 2020-11-17T23:19:20.000Z | 2021-03-29T15:08:56.000Z | channel-api/tests/integration/conftest.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | null | null | null | channel-api/tests/integration/conftest.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | 1 | 2020-12-11T00:26:33.000Z | 2020-12-11T00:26:33.000Z | import pytest
from http import HTTPStatus
import urllib
import requests
from src import repos
from libtrustbridge.utils.conf import env_s3_config, env_queue_config, env
NOTIFICATIONS_REPO = env_queue_config('NOTIFICATIONS_REPO')
DELIVERY_OUTBOX_REPO = env_queue_config('DELIVERY_OUTBOX_REPO')
SUBSCRIPTIONS_REPO = env_... | 31.1 | 89 | 0.71597 | import pytest
from http import HTTPStatus
import urllib
import requests
from src import repos
from libtrustbridge.utils.conf import env_s3_config, env_queue_config, env
NOTIFICATIONS_REPO = env_queue_config('NOTIFICATIONS_REPO')
DELIVERY_OUTBOX_REPO = env_queue_config('DELIVERY_OUTBOX_REPO')
SUBSCRIPTIONS_REPO = env_... | true | true |
f7196801f8fa58470aa03ad73efa1012011af858 | 28,195 | py | Python | sacla/scripts/backups/sacla3_Chip_Manager_v7BAK.py | beamline-i24/DiamondChips | 02fb58a95ad2c1712c41b641eb5f197d688c54c3 | [
"Apache-2.0"
] | null | null | null | sacla/scripts/backups/sacla3_Chip_Manager_v7BAK.py | beamline-i24/DiamondChips | 02fb58a95ad2c1712c41b641eb5f197d688c54c3 | [
"Apache-2.0"
] | null | null | null | sacla/scripts/backups/sacla3_Chip_Manager_v7BAK.py | beamline-i24/DiamondChips | 02fb58a95ad2c1712c41b641eb5f197d688c54c3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import pv, os, re, sys
import math, time, string
import numpy as np
from time import sleep
from ca import caput, caget
import logging as lg
import sacla3_Chip_StartUp_v7 as startup
import sacla3_Chip_Mapping_v7 as mapping
lg.basicConfig(format='%(asctime)s %(levelname)s: \t%(message)s',level=lg.DEB... | 36.952818 | 171 | 0.563043 | import pv, os, re, sys
import math, time, string
import numpy as np
from time import sleep
from ca import caput, caget
import logging as lg
import sacla3_Chip_StartUp_v7 as startup
import sacla3_Chip_Mapping_v7 as mapping
lg.basicConfig(format='%(asctime)s %(levelname)s: \t%(message)s',level=lg.DEBUG, filename='SACL... | false | true |
f71968c2bfbb4980fde3dad9d2991f5150aef9eb | 2,841 | py | Python | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | import os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# pip install -e .[develop]
develop_requires = [
'WebTest',
'ScriptTest',
'coverage',
'docutils',
'minimoc... | 28.128713 | 78 | 0.67793 | import os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
develop_requires = [
'WebTest',
'ScriptTest',
'coverage',
'docutils',
'minimock',
'nose',
]
cdir = os... | true | true |
f71969a63ad11dd00ce0c7b25f5d250f148a897c | 2,807 | py | Python | crossbaker/samples/declarative/signals/pytoqml1/main.py | josephkirk/MeshBaker | e4f75193074cc92d12f953d6cad3a2a599f63ead | [
"MIT"
] | null | null | null | crossbaker/samples/declarative/signals/pytoqml1/main.py | josephkirk/MeshBaker | e4f75193074cc92d12f953d6cad3a2a599f63ead | [
"MIT"
] | 5 | 2018-10-09T02:43:14.000Z | 2018-10-12T13:00:09.000Z | crossbaker/samples/declarative/signals/pytoqml1/main.py | josephkirk/CrossBaker | e4f75193074cc92d12f953d6cad3a2a599f63ead | [
"MIT"
] | null | null | null | #!/usr/bin/python
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file under the t... | 38.452055 | 100 | 0.695048 |
## modification, are permitted provided that the following conditions are
## met:
## * Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright
## notice, this list ... | true | true |
f7196a03c814613734c343483b20f67cde46b40d | 260 | py | Python | w02-calling-functions/checkpoint-boxes/boxes.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | w02-calling-functions/checkpoint-boxes/boxes.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | w02-calling-functions/checkpoint-boxes/boxes.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | import math
items = int(input("Enter the number of items: "))
items_box = int(input("Enter the number of items per box: "))
boxes = math.ceil(items / items_box)
print(f"For {items} items, packing {items_box} items in each box, you will need {boxes} boxes.") | 32.5 | 96 | 0.711538 | import math
items = int(input("Enter the number of items: "))
items_box = int(input("Enter the number of items per box: "))
boxes = math.ceil(items / items_box)
print(f"For {items} items, packing {items_box} items in each box, you will need {boxes} boxes.") | true | true |
f7196aad36071501a72c16f5e95b38ddb5f8950b | 902 | py | Python | turbo/turbo_encoder.py | DaulPavid/pyturbo | 878e0b1b514c043f1b4ea5cd5268b23c0df5192e | [
"MIT"
] | 9 | 2018-10-17T17:02:05.000Z | 2022-03-03T18:58:32.000Z | turbo/turbo_encoder.py | akshay230994/pyturbo | 878e0b1b514c043f1b4ea5cd5268b23c0df5192e | [
"MIT"
] | 2 | 2018-10-16T16:57:57.000Z | 2020-04-14T13:34:40.000Z | turbo/turbo_encoder.py | akshay230994/pyturbo | 878e0b1b514c043f1b4ea5cd5268b23c0df5192e | [
"MIT"
] | 4 | 2019-12-23T18:42:29.000Z | 2022-01-19T12:08:35.000Z | #
# Turbo Encoder
#
import numpy as np
from .rsc import RSC
class TurboEncoder:
def __init__(self, interleaver):
self.interleaver = interleaver
self.block_size = len(self.interleaver)
self.encoders = 2 * [RSC()]
def reset(self):
for e in self.encoders:
e.reset()
... | 25.055556 | 73 | 0.618625 |
import numpy as np
from .rsc import RSC
class TurboEncoder:
def __init__(self, interleaver):
self.interleaver = interleaver
self.block_size = len(self.interleaver)
self.encoders = 2 * [RSC()]
def reset(self):
for e in self.encoders:
e.reset()
def interleave(... | true | true |
f7196b897dd7d74bfa6480c1e1542bf851614cfa | 534 | py | Python | src/package/scanner.py | buckler-project/armoury | 3d4c1bb9e8af190ba95d60d502b39699848d1e62 | [
"MIT"
] | 1 | 2019-02-02T06:21:21.000Z | 2019-02-02T06:21:21.000Z | src/package/scanner.py | buckler-project/armoury | 3d4c1bb9e8af190ba95d60d502b39699848d1e62 | [
"MIT"
] | 5 | 2019-01-28T00:59:15.000Z | 2019-01-31T10:35:36.000Z | src/package/scanner.py | buckler-project/armoury | 3d4c1bb9e8af190ba95d60d502b39699848d1e62 | [
"MIT"
] | null | null | null | from package import package
parent_path = '.scanners'
config_path = 'scanner.yml'
class Scanner(package.Package):
def __init__(self, url, name, auther):
super().__init__(url, name, auther)
self.parent_path = parent_path
self.config_path = config_path
class ScannerFactory(package.PackageF... | 26.7 | 57 | 0.694757 | from package import package
parent_path = '.scanners'
config_path = 'scanner.yml'
class Scanner(package.Package):
def __init__(self, url, name, auther):
super().__init__(url, name, auther)
self.parent_path = parent_path
self.config_path = config_path
class ScannerFactory(package.PackageF... | true | true |
f7196bd5fe213fbeb54a87c93b46f43e8cb1f118 | 2,742 | py | Python | inference_speed.py | wmcnally/evopose2d | ea05b818044d8d84e9cbbee778bc465be59ebd59 | [
"MIT"
] | 75 | 2020-11-18T05:07:42.000Z | 2022-03-27T03:25:16.000Z | inference_speed.py | wmcnally/evopose2d | ea05b818044d8d84e9cbbee778bc465be59ebd59 | [
"MIT"
] | 26 | 2020-11-29T17:45:44.000Z | 2022-03-22T15:30:31.000Z | inference_speed.py | wmcnally/evopose2d | ea05b818044d8d84e9cbbee778bc465be59ebd59 | [
"MIT"
] | 8 | 2020-11-25T02:59:53.000Z | 2022-03-27T10:53:59.000Z | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from dataset.dataloader import load_tfds
from time import time
import argparse
from nets.simple_basline import SimpleBaseline
from nets.evopose2d import EvoPose
from nets.hrnet import HRNet
from utils import detect_hardware
def speed_test(stra... | 32.258824 | 82 | 0.610139 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from dataset.dataloader import load_tfds
from time import time
import argparse
from nets.simple_basline import SimpleBaseline
from nets.evopose2d import EvoPose
from nets.hrnet import HRNet
from utils import detect_hardware
def speed_test(stra... | true | true |
f7196c255322af385bffc89c3fcffebd8bcec16e | 8,295 | py | Python | tango/common/util.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 52 | 2021-09-24T17:52:34.000Z | 2022-03-29T22:55:02.000Z | tango/common/util.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 90 | 2021-09-29T04:23:29.000Z | 2022-03-31T21:23:02.000Z | tango/common/util.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 8 | 2021-11-13T01:56:22.000Z | 2022-02-27T03:29:42.000Z | import importlib
import pkgutil
import signal
import string
import sys
import traceback
from contextlib import contextmanager
from datetime import datetime, tzinfo
from pathlib import Path
from typing import Iterable, Optional, Set, Tuple, Union
import pytz
from .aliases import PathOrStr
from .exceptions import SigTe... | 31.067416 | 108 | 0.660277 | import importlib
import pkgutil
import signal
import string
import sys
import traceback
from contextlib import contextmanager
from datetime import datetime, tzinfo
from pathlib import Path
from typing import Iterable, Optional, Set, Tuple, Union
import pytz
from .aliases import PathOrStr
from .exceptions import SigTe... | true | true |
f7196d520e18090ae1a9e39c71b4703d717c0c07 | 184 | py | Python | ddq_1/lang/fol_quant.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | ddq_1/lang/fol_quant.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | 6 | 2021-03-19T12:06:56.000Z | 2022-03-12T00:23:09.000Z | ddq_1/lang/fol_quant.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | '''
References:
- Symbolic Logic, Copi, p.396
'''
from .fol_lang import Wff, PropVarWff, BinaryWff, PropositionalVariable, NegWff
class QuantRule:
def applies_to():
pass | 18.4 | 79 | 0.701087 | from .fol_lang import Wff, PropVarWff, BinaryWff, PropositionalVariable, NegWff
class QuantRule:
def applies_to():
pass | true | true |
f7196e814752cab4ff82754c55fd3672bc8fd585 | 29,282 | py | Python | google/ads/google_ads/v6/proto/resources/ad_group_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/resources/ad_group_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/resources/ad_group_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v6/resources/ad_group.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection... | 73.205 | 4,007 | 0.800287 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.ads.google_ads.v6.proto.common import custom_par... | true | true |
f719701d150a3482167aae75965a980e8a9f516b | 2,199 | py | Python | backend/wazzle_33192/urls.py | crowdbotics-apps/wazzle-33192 | 6203ab17b0c80344f1b15d1d5452bfdd2e6559bd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/wazzle_33192/urls.py | crowdbotics-apps/wazzle-33192 | 6203ab17b0c80344f1b15d1d5452bfdd2e6559bd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/wazzle_33192/urls.py | crowdbotics-apps/wazzle-33192 | 6203ab17b0c80344f1b15d1d5452bfdd2e6559bd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """wazzle_33192 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 34.904762 | 87 | 0.710778 |
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from allauth.account.views import confirm_email
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
urlpatterns = [
path("",... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.