hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79023f70a4d2202d23dae4ed2e0e420489b861ce | 854 | py | Python | atcoder/ABC 192/D.py | ApocalypseMac/CP | b2db9aa5392a362dc0d979411788267ed9a5ff1d | [
"MIT"
] | null | null | null | atcoder/ABC 192/D.py | ApocalypseMac/CP | b2db9aa5392a362dc0d979411788267ed9a5ff1d | [
"MIT"
] | null | null | null | atcoder/ABC 192/D.py | ApocalypseMac/CP | b2db9aa5392a362dc0d979411788267ed9a5ff1d | [
"MIT"
] | null | null | null | x = int(input())
m = int(input())
if x < 10:
if x <= m:
print(1)
else:
print(0)
else:
xarr = []
while x:
xarr = [x % 10] + xarr
x //= 10
n = len(xarr)
l = max(xarr) + 1
def check(base, xarr):
ans = xarr[0] * (base ** (n - 1))
if ans > m:
... | 18.977778 | 48 | 0.375878 | x = int(input())
m = int(input())
if x < 10:
if x <= m:
print(1)
else:
print(0)
else:
xarr = []
while x:
xarr = [x % 10] + xarr
x //= 10
n = len(xarr)
l = max(xarr) + 1
def check(base, xarr):
ans = xarr[0] * (base ** (n - 1))
if ans > m:
... | true | true |
79024112a283dc48b7282c5fb6803acc421515ba | 7,213 | py | Python | mmseg/models/utils/inverted_residual.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | mmseg/models/utils/inverted_residual.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | mmseg/models/utils/inverted_residual.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | from mmcv.cnn import ConvModule
from torch import nn
from torch.utils import checkpoint as cp
from .se_layer import SELayer
class InvertedResidual(nn.Module):
"""InvertedResidual block for MobileNetV2.
Args:
in_channels (int): The input channels of the InvertedResidual block.
out... | 34.511962 | 80 | 0.537224 | from mmcv.cnn import ConvModule
from torch import nn
from torch.utils import checkpoint as cp
from .se_layer import SELayer
class InvertedResidual(nn.Module):
def __init__(self,
in_channels,
out_channels,
stride,
expand_ratio,
... | true | true |
7902418e48bfb94528b0786858720b6cafedce79 | 23,068 | py | Python | reframe/core/meta.py | ChristopherBignamini/reframe | 164bae6084dd9590f232f99f5cbeb0beed7ace26 | [
"BSD-3-Clause"
] | null | null | null | reframe/core/meta.py | ChristopherBignamini/reframe | 164bae6084dd9590f232f99f5cbeb0beed7ace26 | [
"BSD-3-Clause"
] | 1 | 2021-05-18T17:38:12.000Z | 2021-05-18T17:38:12.000Z | reframe/core/meta.py | giordano/reframe | 5b17b952f05dcc013888149c82b12d3f69306917 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Meta-class for creating regression tests.
#
import functools
import types
import reframe.core.namespaces as namespaces
i... | 39.432479 | 79 | 0.588304 |
import functools
import types
import reframe.core.namespaces as namespaces
import reframe.core.parameters as parameters
import reframe.core.variables as variables
import reframe.core.hooks as hooks
import reframe.utility as utils
from reframe.core.exceptions import ReframeSyntaxError
from reframe.core.deferr... | true | true |
7902435071d525ebc1985f7e0f037909fd6d32c0 | 106,955 | py | Python | lib/pygments-1.2.2-patched/pygments/lexers/other.py | artdent/jgments | 2a0c01daf1c787a9c20a4e916e243b08fef4a43d | [
"BSD-2-Clause"
] | 3 | 2015-08-12T01:11:03.000Z | 2018-09-21T11:51:03.000Z | lib/pygments-1.2.2-patched/pygments/lexers/other.py | artdent/jgments | 2a0c01daf1c787a9c20a4e916e243b08fef4a43d | [
"BSD-2-Clause"
] | null | null | null | lib/pygments-1.2.2-patched/pygments/lexers/other.py | artdent/jgments | 2a0c01daf1c787a9c20a4e916e243b08fef4a43d | [
"BSD-2-Clause"
] | 1 | 2015-01-21T06:42:28.000Z | 2015-01-21T06:42:28.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.other
~~~~~~~~~~~~~~~~~~~~~
Lexers for other languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
... | 46.441598 | 1,414 | 0.499528 |
"""
pygments.lexers.other
~~~~~~~~~~~~~~~~~~~~~
Lexers for other languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
this, do_insertions... | false | true |
790244b29d3d1a6a01cad804aec2c352548d496c | 2,002 | py | Python | xlsxwriter/test/comparison/test_chart_data_labels17.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_data_labels17.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_data_labels17.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | 27.805556 | 79 | 0.535964 | true | true | |
79024601d0939056bfc64b440ae6a7b12adbad9f | 7,957 | py | Python | hard-gists/9c4d012d6fff059ccea7/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/9c4d012d6fff059ccea7/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/9c4d012d6fff059ccea7/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | # -*- coding: utf-8 -*-
#
# Author: oldj
# Email: oldj.wu@gmail.com
# Blog: http://oldj.net
#
import os
import re
import StringIO
from PIL import Image
from PIL import ImageDraw
import pygame
g_script_folder = os.path.dirname(os.path.abspath(__file__))
g_fonts_folder = os.path.join(g_script_folder, "fonts")
g_re_fir... | 24.259146 | 113 | 0.544803 |
import os
import re
import StringIO
from PIL import Image
from PIL import ImageDraw
import pygame
g_script_folder = os.path.dirname(os.path.abspath(__file__))
g_fonts_folder = os.path.join(g_script_folder, "fonts")
g_re_first_word = re.compile((u""
+ u"(%(prefix)s+\S%(postfix)s+)"
+ u"|(%(prefix)s*\w+... | true | true |
7902465bb7ccfe78def73e81c0df02e3bdd47cd1 | 91 | py | Python | tests/test_jogo_banco.py | rafaelgarrafiel/jogo_banco | 26457430c0330fa508b6e5236e5b1aa84bdcb9bf | [
"Apache-2.0"
] | null | null | null | tests/test_jogo_banco.py | rafaelgarrafiel/jogo_banco | 26457430c0330fa508b6e5236e5b1aa84bdcb9bf | [
"Apache-2.0"
] | null | null | null | tests/test_jogo_banco.py | rafaelgarrafiel/jogo_banco | 26457430c0330fa508b6e5236e5b1aa84bdcb9bf | [
"Apache-2.0"
] | null | null | null | from jogo_banco import __version__
def test_version():
assert __version__ == '0.1.0'
| 15.166667 | 34 | 0.725275 | from jogo_banco import __version__
def test_version():
assert __version__ == '0.1.0'
| true | true |
79024695aabf9256233b0f39096a39782c9fbc2d | 2,883 | py | Python | examples/views/persistent.py | Enegg/disnake | 1d48cbf4e0dfec82fdfb65d7f58396767ce7c009 | [
"MIT"
] | 290 | 2021-11-03T12:33:16.000Z | 2022-03-31T19:30:19.000Z | examples/views/persistent.py | Enegg/disnake | 1d48cbf4e0dfec82fdfb65d7f58396767ce7c009 | [
"MIT"
] | 200 | 2021-11-03T10:41:41.000Z | 2022-03-31T08:13:11.000Z | examples/views/persistent.py | Enegg/disnake | 1d48cbf4e0dfec82fdfb65d7f58396767ce7c009 | [
"MIT"
] | 118 | 2021-11-03T18:27:09.000Z | 2022-03-25T22:00:45.000Z | import disnake
from disnake.ext import commands
# Define a simple View that persists between bot restarts
# In order a view to persist between restarts it needs to meet the following conditions:
# 1) The timeout of the View has to be set to None
# 2) Every item in the View has to have a custom_id set
# It is recommen... | 42.397059 | 105 | 0.712105 | import disnake
from disnake.ext import commands
class PersistentView(disnake.ui.View):
def __init__(self):
super().__init__(timeout=None)
@disnake.ui.button(
label="Green", style=disnake.ButtonStyle.green, custom_id="persistent_view:green"
)
async def green(self, button: disna... | true | true |
790246fa9d53ea6e7bb11ceff8b5aef04525933c | 6,510 | py | Python | ironic/drivers/modules/oneview/management.py | pyrrrat/moved-ironic | 93331da82ef13490ccf08f8f9c370e81ca176a41 | [
"Apache-2.0"
] | null | null | null | ironic/drivers/modules/oneview/management.py | pyrrrat/moved-ironic | 93331da82ef13490ccf08f8f9c370e81ca176a41 | [
"Apache-2.0"
] | null | null | null | ironic/drivers/modules/oneview/management.py | pyrrrat/moved-ironic | 93331da82ef13490ccf08f8f9c370e81ca176a41 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Hewlett Packard Development Company, LP
# Copyright 2015 Universidade Federal de Campina Grande
#
# 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://... | 37.630058 | 80 | 0.662366 |
from oslo_log import log as logging
from oslo_utils import importutils
from ironic.common import boot_devices
from ironic.common import exception
from ironic.common.i18n import _
from ironic.conductor import task_manager
from ironic.drivers import base
from ironic.drivers.modules.oneview import common
... | true | true |
79024718e8b688bb269fb61caf6f9986f5e56403 | 1,093 | py | Python | youtubeDataApi/searchApi/cron.py | aryamaan98/Youtube-Data-API-Integration | 7a941c055c637ce285ed47d40b9139446f0b6d89 | [
"MIT"
] | null | null | null | youtubeDataApi/searchApi/cron.py | aryamaan98/Youtube-Data-API-Integration | 7a941c055c637ce285ed47d40b9139446f0b6d89 | [
"MIT"
] | null | null | null | youtubeDataApi/searchApi/cron.py | aryamaan98/Youtube-Data-API-Integration | 7a941c055c637ce285ed47d40b9139446f0b6d89 | [
"MIT"
] | null | null | null | import requests
import json
from datetime import datetime, timezone
from . utils import _extract_videos_necessary_details, _save_video_detils_in_db
from .models import ApiKeys
from . import config
def _get_api_key(): #getting different key w.r.t last used every time cron job starts.(load balanced)
new_key = ApiKe... | 37.689655 | 101 | 0.755718 | import requests
import json
from datetime import datetime, timezone
from . utils import _extract_videos_necessary_details, _save_video_detils_in_db
from .models import ApiKeys
from . import config
def _get_api_key():
new_key = ApiKeys.objects.all().order_by('last_used').first()
_reponse = ApiKeys.objects.fil... | true | true |
79024724e6e005843158e10b491538592925be0e | 14,087 | py | Python | tests/examples/minlplib/ex8_3_13.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/ex8_3_13.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/ex8_3_13.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # NLP written by GAMS Convert at 04/21/18 13:51:47
#
# Equation counts
# Total E G L N X C B
# 73 73 0 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 48.913194 | 120 | 0.632001 |
from pyomo.environ import *
model = m = ConcreteModel()
m.x2 = Var(within=Reals,bounds=(0,1000),initialize=50)
m.x3 = Var(within=Reals,bounds=(0,1000),initialize=50)
m.x4 = Var(within=Reals,bounds=(0,1000),initialize=50)
m.x5 = Var(within=Reals,bounds=(0,1000),initialize=50)
m.x6 = Var(within=Real... | true | true |
7902482a6fb74642b39229bc8a84f18d19d023ff | 2,777 | py | Python | tests/utils/test_pnc.py | hjmodi/atomic-reactor | 547f3edd28628dc59a98c4928a0ecf280f5983cb | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_pnc.py | hjmodi/atomic-reactor | 547f3edd28628dc59a98c4928a0ecf280f5983cb | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_pnc.py | hjmodi/atomic-reactor | 547f3edd28628dc59a98c4928a0ecf280f5983cb | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2021 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from io import BufferedReader, BytesIO
import pytest
import requests
import responses
from flexmock import flexmock
from atomic_reactor.uti... | 33.457831 | 95 | 0.695355 |
from io import BufferedReader, BytesIO
import pytest
import requests
import responses
from flexmock import flexmock
from atomic_reactor.util import get_retrying_requests_session
from atomic_reactor.utils.pnc import PNCUtil
PNC_BASE_API_URL = 'http://pnc.localhost/pnc-rest/v2'
PNC_GET_SCM_ARCHIVE_PATH = 'builds/{}/s... | true | true |
7902487f555dccbcb2b79fb1287dfb6065bbedc3 | 116,721 | py | Python | securitycenter/google/cloud/securitycenter_v1beta1/proto/securitycenter_service_pb2.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | securitycenter/google/cloud/securitycenter_v1beta1/proto/securitycenter_service_pb2.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | securitycenter/google/cloud/securitycenter_v1beta1/proto/securitycenter_service_pb2.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-30T02:23:29.000Z | 2020-11-30T02:23:29.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/securitycenter_v1beta1/proto/securitycenter_service.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from goo... | 38.48368 | 10,592 | 0.64356 |
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
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
fro... | true | true |
79024894f3ecdb13739c0edc58d07ee1bc8be291 | 759 | py | Python | demo.py | paulhoule/usb_receipt_printer | 7526ffad7ccdb3aac95acf76d4058e6f3b532c1d | [
"MIT"
] | null | null | null | demo.py | paulhoule/usb_receipt_printer | 7526ffad7ccdb3aac95acf76d4058e6f3b532c1d | [
"MIT"
] | null | null | null | demo.py | paulhoule/usb_receipt_printer | 7526ffad7ccdb3aac95acf76d4058e6f3b532c1d | [
"MIT"
] | null | null | null | from escpos.printer import Usb
from pathlib import Path
image = Path("/tamamo-no-mae/me-cloudy.png")
printer = Usb(0x0416, 0x5011, 0, profile="ZJ-5870")
printer.image(image);
printer.cut()
# with printer() as that:
# that.write('Hello, world!\n\n')
# # 000000000111111111122222222223
# # 123... | 37.95 | 58 | 0.670619 | from escpos.printer import Usb
from pathlib import Path
image = Path("/tamamo-no-mae/me-cloudy.png")
printer = Usb(0x0416, 0x5011, 0, profile="ZJ-5870")
printer.image(image);
printer.cut()
| true | true |
790248e57ea50863c364ce7cb42db5c22f1e44f4 | 1,851 | py | Python | package/make-deb.py | jayvdb/pypi-server | 596a2fa2dd5d90cff445822bfadff5a9b7f6be9c | [
"MIT"
] | 119 | 2015-12-07T22:41:08.000Z | 2022-03-16T05:55:06.000Z | package/make-deb.py | jayvdb/pypi-server | 596a2fa2dd5d90cff445822bfadff5a9b7f6be9c | [
"MIT"
] | 37 | 2016-01-19T16:28:03.000Z | 2022-03-06T08:03:04.000Z | package/make-deb.py | jayvdb/pypi-server | 596a2fa2dd5d90cff445822bfadff5a9b7f6be9c | [
"MIT"
] | 55 | 2015-12-09T12:21:10.000Z | 2021-11-29T13:22:24.000Z | import os
from subprocess import check_output
import plumbum
from plumbum.cmd import grep, fpm, ln, sort, find, virtualenv
import logging
log = logging.getLogger()
logging.basicConfig(level=logging.INFO)
ENV_PATH = os.getenv("ENV_PATH", "/usr/share/python3/pypi-server")
SRC_PATH = os.getenv("SRC_PATH", "/mnt")
pip =... | 29.380952 | 93 | 0.605619 | import os
from subprocess import check_output
import plumbum
from plumbum.cmd import grep, fpm, ln, sort, find, virtualenv
import logging
log = logging.getLogger()
logging.basicConfig(level=logging.INFO)
ENV_PATH = os.getenv("ENV_PATH", "/usr/share/python3/pypi-server")
SRC_PATH = os.getenv("SRC_PATH", "/mnt")
pip =... | true | true |
790248fc6aadfb2df0963cfb95398dc94f7864da | 6,983 | py | Python | tests/test_simulate.py | bshapiroalbert/PsrSigSim | 74bb40814295fb6ef84aa932a0de2f684162b8c4 | [
"MIT"
] | 1 | 2021-09-06T09:03:38.000Z | 2021-09-06T09:03:38.000Z | tests/test_simulate.py | bshapiroalbert/PsrSigSim | 74bb40814295fb6ef84aa932a0de2f684162b8c4 | [
"MIT"
] | 1 | 2020-12-21T18:02:57.000Z | 2020-12-21T22:07:17.000Z | tests/test_simulate.py | bshapiroalbert/PsrSigSim | 74bb40814295fb6ef84aa932a0de2f684162b8c4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pytest
import os
import numpy as np
import glob
from psrsigsim.signal.fb_signal import FilterBankSignal
from psrsigsim.pulsar.pulsar import Pulsar
from psrsigsim.pulsar.portraits import DataPortrait
from psrsigsim.pulsar.profiles import DataProfile
from psrsigsim.... | 30.229437 | 76 | 0.597594 |
import pytest
import os
import numpy as np
import glob
from psrsigsim.signal.fb_signal import FilterBankSignal
from psrsigsim.pulsar.pulsar import Pulsar
from psrsigsim.pulsar.portraits import DataPortrait
from psrsigsim.pulsar.profiles import DataProfile
from psrsigsim.ism.ism import ISM
from psrsigsim.telescope.t... | true | true |
7902498bb5bac09d154ce48ad7e0224f31b8f5d5 | 612 | py | Python | notebooks/develop/2021-02-18-gc-bawe-data-grouping.py | grchristensen/avpd | f7617844ae454a93825aa231e04c125cb4e58a20 | [
"Apache-2.0"
] | null | null | null | notebooks/develop/2021-02-18-gc-bawe-data-grouping.py | grchristensen/avpd | f7617844ae454a93825aa231e04c125cb4e58a20 | [
"Apache-2.0"
] | 9 | 2021-03-04T20:29:54.000Z | 2021-03-31T22:03:51.000Z | notebooks/develop/2021-02-18-gc-bawe-data-grouping.py | grchristensen/avpd | f7617844ae454a93825aa231e04c125cb4e58a20 | [
"Apache-2.0"
] | 3 | 2021-01-30T02:19:07.000Z | 2021-04-11T19:48:37.000Z | import pickle
import os
from tqdm import tqdm
with open('../data/bawe_splits.p', 'rb') as f:
splits = pickle.load(f)
if not os.path.isdir('../data/preprocess/bawe-group'):
os.mkdir('../data/preprocess/bawe-group')
for filename in tqdm(splits['train']):
id = filename[:4]
with open(f'../data/bawe/CORPU... | 29.142857 | 79 | 0.609477 | import pickle
import os
from tqdm import tqdm
with open('../data/bawe_splits.p', 'rb') as f:
splits = pickle.load(f)
if not os.path.isdir('../data/preprocess/bawe-group'):
os.mkdir('../data/preprocess/bawe-group')
for filename in tqdm(splits['train']):
id = filename[:4]
with open(f'../data/bawe/CORPU... | true | true |
7902498c94d5d4db643f4846d9e565ea70b88a18 | 3,769 | py | Python | pypureclient/flasharray/FA_2_11/models/port_common.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_11/models/port_common.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_11/models/port_common.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.11
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from ... | 28.992308 | 105 | 0.529053 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_11 import models
class PortCommon(object):
swagger_types = {
'iqn': 'str',
'nqn': 'str',
'portal': 'str',
'wwn': 'str'
}
... | true | true |
79024ab06d60833685580286314d96518fe7e45a | 6,004 | py | Python | scripts/train_dqn.py | johny-c/noge | 88e68ba8c51ff0d63577991e233e9110cb76e228 | [
"MIT"
] | null | null | null | scripts/train_dqn.py | johny-c/noge | 88e68ba8c51ff0d63577991e233e9110cb76e228 | [
"MIT"
] | null | null | null | scripts/train_dqn.py | johny-c/noge | 88e68ba8c51ff0d63577991e233e9110cb76e228 | [
"MIT"
] | null | null | null | import copy
import torch
import logging
import numpy as np
from sacred import Experiment
from noge.data_loaders import get_datasets, get_test_loader, get_train_generator
from noge.factory import make_env, make_memory
from noge.network import make_network
from noge.agent import Actor, main_loop, loop_ing
from noge.trai... | 38.987013 | 115 | 0.673051 | import copy
import torch
import logging
import numpy as np
from sacred import Experiment
from noge.data_loaders import get_datasets, get_test_loader, get_train_generator
from noge.factory import make_env, make_memory
from noge.network import make_network
from noge.agent import Actor, main_loop, loop_ing
from noge.trai... | true | true |
79024b605c5c11733a72cc63b056b4003d16736e | 12,159 | py | Python | netbox/dcim/filters.py | team-telnyx/netbox | 4980774bec1bc691cf499d7768b2a93be3ba6bb2 | [
"Apache-2.0"
] | 3 | 2017-05-06T11:21:19.000Z | 2018-01-10T22:38:30.000Z | netbox/dcim/filters.py | team-telnyx/netbox | 4980774bec1bc691cf499d7768b2a93be3ba6bb2 | [
"Apache-2.0"
] | 1 | 2019-06-29T17:08:47.000Z | 2019-06-29T17:08:47.000Z | netbox/dcim/filters.py | team-telnyx/netbox | 4980774bec1bc691cf499d7768b2a93be3ba6bb2 | [
"Apache-2.0"
] | 4 | 2017-02-01T22:53:14.000Z | 2017-06-22T18:05:03.000Z | import django_filters
from netaddr.core import AddrFormatError
from django.db.models import Q
from extras.filters import CustomFieldFilterSet
from tenancy.models import Tenant
from utilities.filters import NullableModelMultipleChoiceFilter
from .models import (
ConsolePort, ConsoleServerPort, Device, DeviceRole, ... | 28.95 | 118 | 0.628999 | import django_filters
from netaddr.core import AddrFormatError
from django.db.models import Q
from extras.filters import CustomFieldFilterSet
from tenancy.models import Tenant
from utilities.filters import NullableModelMultipleChoiceFilter
from .models import (
ConsolePort, ConsoleServerPort, Device, DeviceRole, ... | true | true |
79024b64d46a47c2f213ec37d276a25c094aad81 | 4,020 | py | Python | compiler-rt/test/memprof/lit.cfg.py | acidburn0zzz/llvm-project | 7ca7a2547f00e34f5ec91be776a1d0bbca74b7a9 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | compiler-rt/test/memprof/lit.cfg.py | acidburn0zzz/llvm-project | 7ca7a2547f00e34f5ec91be776a1d0bbca74b7a9 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | compiler-rt/test/memprof/lit.cfg.py | acidburn0zzz/llvm-project | 7ca7a2547f00e34f5ec91be776a1d0bbca74b7a9 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | # -*- Python -*-
import os
import platform
import re
import lit.formats
# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if
# it's not available.
try:
import shlex
sh_quote = shlex.quote
except:
import pipes
sh_quote = pipes.quote
def get_required_attr(config, attr_name):
attr_v... | 38.653846 | 123 | 0.746766 |
import os
import platform
import re
import lit.formats
try:
import shlex
sh_quote = shlex.quote
except:
import pipes
sh_quote = pipes.quote
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
lit_config.fatal(
"No attribute %r in te... | true | true |
79024ddeebc5ee8d5c763be743de9b8fc8039427 | 3,752 | py | Python | PyMC2/database/base.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | 1 | 2019-03-01T02:47:20.000Z | 2019-03-01T02:47:20.000Z | PyMC2/database/base.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | 1 | 2019-08-17T06:58:38.000Z | 2019-08-17T06:58:38.000Z | PyMC2/database/base.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | null | null | null | """
Base backend
Trace and Database classes from the other modules should Subclass the base
classes.
"""
import PyMC2
class Trace(object):
"""Dummy Trace class.
"""
def __init__(self,value=None, obj=None):
"""Assign an initial value and an internal PyMC object."""
self._trace = val... | 31.008264 | 86 | 0.559701 | """
Base backend
Trace and Database classes from the other modules should Subclass the base
classes.
"""
import PyMC2
class Trace(object):
"""Dummy Trace class.
"""
def __init__(self,value=None, obj=None):
"""Assign an initial value and an internal PyMC object."""
self._trace = val... | false | true |
79024e36049ca2d6b893826abf487e64c7243325 | 8,871 | py | Python | tools/bin_to_rwd.py | bccw-ai/rwd-xray | a0f6cd2dbce644dde858db16c248ddcd34420fd2 | [
"MIT"
] | null | null | null | tools/bin_to_rwd.py | bccw-ai/rwd-xray | a0f6cd2dbce644dde858db16c248ddcd34420fd2 | [
"MIT"
] | null | null | null | tools/bin_to_rwd.py | bccw-ai/rwd-xray | a0f6cd2dbce644dde858db16c248ddcd34420fd2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Convert full firmware binary to rwd patch.
# Supported models:
# CR-V 5g (part num: 39990-TLA), tested
# Civic 2016 sedan (part num: 39990-TBA), tested
# Civic 2016 hatchback Australia (part num: 39990-TEA), tested
# Civic 2016 hatchback (part num: 39990-TGG), tested
#
import os
impor... | 51.277457 | 2,371 | 0.631496 |
import os
import sys
import argparse
import subprocess
import struct
default_decrypt_lookup_table = {144: 72, 218: 55, 255: 255, 164: 1, 195: 26, 99: 2, 28: 178, 205: 158, 125: 138, 45: 118, 222: 98, 142: 78, 62: 58, 243: 38, 163: 18, 83: 254, 3: 234, 172: 214, 92: 194, 12: 174, 189: 154, 109: 134, 29: 114, ... | true | true |
79024ef9d1ad387a6eaf7e488d9743a6ca5c726e | 1,844 | py | Python | scrapers/get_collections.py | fedorov/actcianable | c5e215df5dd3958766e41f52aa5e0747e58420f5 | [
"MIT"
] | null | null | null | scrapers/get_collections.py | fedorov/actcianable | c5e215df5dd3958766e41f52aa5e0747e58420f5 | [
"MIT"
] | 11 | 2020-12-30T16:22:51.000Z | 2022-03-31T15:01:17.000Z | scrapers/get_collections.py | fedorov/actcianable | c5e215df5dd3958766e41f52aa5e0747e58420f5 | [
"MIT"
] | null | null | null | #from collections import Counter
import requests
from bs4 import BeautifulSoup
from tabulate import tabulate
import backoff
import json
@backoff.on_exception(backoff.expo,
requests.exceptions.RequestException,
max_time=60)
def get_url(url):#, headers):
return reques... | 27.117647 | 182 | 0.676247 |
import requests
from bs4 import BeautifulSoup
from tabulate import tabulate
import backoff
import json
@backoff.on_exception(backoff.expo,
requests.exceptions.RequestException,
max_time=60)
def get_url(url):
return requests.get(url)
URL = 'http://www.cancerimagin... | true | true |
7902501568578fbd913dc07154688961a902b6c8 | 973 | py | Python | cgate/cgate.py | buddseye/cerberus-gate | 0bb47ea0e18e9015a5e307598737a6f7d994ac0b | [
"MIT"
] | null | null | null | cgate/cgate.py | buddseye/cerberus-gate | 0bb47ea0e18e9015a5e307598737a6f7d994ac0b | [
"MIT"
] | null | null | null | cgate/cgate.py | buddseye/cerberus-gate | 0bb47ea0e18e9015a5e307598737a6f7d994ac0b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import argparse
from cgate.reader import readfile, readschema, get_dtype
from cgate.validation import validate
def main():
parser = argparse.ArgumentParser()
parser.add_argument('target', help='Table name or File path')
parser.add_argument('--schema', '-s', help='Cerber... | 32.433333 | 103 | 0.664954 |
import sys
import argparse
from cgate.reader import readfile, readschema, get_dtype
from cgate.validation import validate
def main():
parser = argparse.ArgumentParser()
parser.add_argument('target', help='Table name or File path')
parser.add_argument('--schema', '-s', help='Cerberus schema file')
pa... | true | true |
7902506ea25b083fd1ae68eb7255136c1a1102d4 | 7,734 | py | Python | api/cloud_provider/models.py | liqiang-fit2cloud/KubeOperator | cb9346b95d29919570cefa6bea1ce4e5c3f0ee6d | [
"Apache-2.0"
] | 3 | 2019-11-29T03:49:08.000Z | 2020-07-29T02:52:51.000Z | api/cloud_provider/models.py | liqiang-fit2cloud/KubeOperator | cb9346b95d29919570cefa6bea1ce4e5c3f0ee6d | [
"Apache-2.0"
] | null | null | null | api/cloud_provider/models.py | liqiang-fit2cloud/KubeOperator | cb9346b95d29919570cefa6bea1ce4e5c3f0ee6d | [
"Apache-2.0"
] | 1 | 2020-03-04T00:29:29.000Z | 2020-03-04T00:29:29.000Z | import os
import threading
import uuid
from ipaddress import ip_address, ip_interface, ip_network
import yaml
from django.db import models
from ansible_api.models.mixins import AbstractExecutionModel
from cloud_provider import get_cloud_client
from common import models as common_models
from fit2ansible import settings... | 33.626087 | 119 | 0.641195 | import os
import threading
import uuid
from ipaddress import ip_address, ip_interface, ip_network
import yaml
from django.db import models
from ansible_api.models.mixins import AbstractExecutionModel
from cloud_provider import get_cloud_client
from common import models as common_models
from fit2ansible import settings... | true | true |
7902516c796ecfecb984b33926cda61b355d91f4 | 15,847 | py | Python | tests/users/test_views.py | uktrade/directory-cms | 8c8d13ce29ea74ddce7a40f3dd29c8847145d549 | [
"MIT"
] | 6 | 2018-03-20T11:19:07.000Z | 2021-10-05T07:53:11.000Z | tests/users/test_views.py | uktrade/directory-cms | 8c8d13ce29ea74ddce7a40f3dd29c8847145d549 | [
"MIT"
] | 802 | 2018-02-05T14:16:13.000Z | 2022-02-10T10:59:21.000Z | tests/users/test_views.py | uktrade/directory-cms | 8c8d13ce29ea74ddce7a40f3dd29c8847145d549 | [
"MIT"
] | 6 | 2019-01-22T13:19:37.000Z | 2019-07-01T10:35:26.000Z | from importlib import import_module, reload
import pytest
import sys
from unittest.mock import patch
from rest_framework import status
from django.contrib.auth.models import Permission, Group
from django.conf import settings
from django.urls import clear_url_caches
from django.urls import reverse
from .factories imp... | 34.45 | 111 | 0.730927 | from importlib import import_module, reload
import pytest
import sys
from unittest.mock import patch
from rest_framework import status
from django.contrib.auth.models import Permission, Group
from django.conf import settings
from django.urls import clear_url_caches
from django.urls import reverse
from .factories imp... | true | true |
790254dc748b02c37a6308b355bd3094569a55d8 | 82 | py | Python | test.py | demengliu/network | 028c2a5006640cf10b9aa8c47a225272e0a30954 | [
"Apache-2.0"
] | null | null | null | test.py | demengliu/network | 028c2a5006640cf10b9aa8c47a225272e0a30954 | [
"Apache-2.0"
] | null | null | null | test.py | demengliu/network | 028c2a5006640cf10b9aa8c47a225272e0a30954 | [
"Apache-2.0"
] | null | null | null | git clone
git add 文件/文件夹
git commit -m '提交说明'
git push orgin('默认仓库名') master(分支名)
| 16.4 | 35 | 0.719512 | git clone
git add 文件/文件夹
git commit -m '提交说明'
git push orgin('默认仓库名') master(分支名)
| false | true |
79025512b5ca24bb4b2e9159df5cf2b311245ffb | 14,774 | py | Python | genMassive.py | ABKGroup/GenMassive | c9cb2de29e1054787a3310840073bab3fab08c75 | [
"BSD-3-Clause"
] | null | null | null | genMassive.py | ABKGroup/GenMassive | c9cb2de29e1054787a3310840073bab3fab08c75 | [
"BSD-3-Clause"
] | null | null | null | genMassive.py | ABKGroup/GenMassive | c9cb2de29e1054787a3310840073bab3fab08c75 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# This scripts attempts to generate massive design of experiment runscripts.
# and save it into a "runMassive.sh" and "doe.log".
#-------------------------------------------------------------------------------
import os, sys
import os.path
import re
import itertools
import glob
PUBLIC = ['... | 31.703863 | 150 | 0.648707 |
import os, sys
import os.path
import re
import itertools
import glob
PUBLIC = ['nangate45', 'sky130hd', 'sky130hs', 'asap7']
NumFilesPerChunk = 50000
int_doe.sdc'
def writeConfigs(CurAttrs, CurChunkNum):
CurPlatform, CurDesign = CurAttrs.get('PLATFORM_DESIGN').split('-')
CurClkPeriod = CurAttrs.get('... | true | true |
79025571b267d4cd93217e5a5f47808a16714369 | 525 | py | Python | basic/list.py | anuragarwalkar/basic-python | 1de8088b29247a4851c31e1c03fe168945f06951 | [
"MIT"
] | null | null | null | basic/list.py | anuragarwalkar/basic-python | 1de8088b29247a4851c31e1c03fe168945f06951 | [
"MIT"
] | null | null | null | basic/list.py | anuragarwalkar/basic-python | 1de8088b29247a4851c31e1c03fe168945f06951 | [
"MIT"
] | null | null | null | names = ["John", "Bob", "Dell", "python"];
print(names[0])
print(names[-1])
print(names[-2])
names[0] = "Amina"
print(names[0])
print(names[0:3])
# List methods
numbers = [1, 2, 3, 4, 5]
numbers.append(6)
numbers.insert(0, -1)
numbers.remove(3)
is_there = 1 in numbers
numbers.count(3) # it will return count of 3
# ... | 17.5 | 49 | 0.687619 | names = ["John", "Bob", "Dell", "python"];
print(names[0])
print(names[-1])
print(names[-2])
names[0] = "Amina"
print(names[0])
print(names[0:3])
numbers = [1, 2, 3, 4, 5]
numbers.append(6)
numbers.insert(0, -1)
numbers.remove(3)
is_there = 1 in numbers
numbers.count(3)
()
numbers = numbers.copy()
print(is_th... | true | true |
79025697c6f77fd08cdd3bcbcb6e54f0f3cc413f | 1,745 | py | Python | examples/python/helloworld/async_greeter_server.py | gmambro/grpc | 61aee932d72d59ce9d8c47366aeb9df2825103ec | [
"Apache-2.0"
] | 2 | 2021-07-13T09:16:08.000Z | 2021-11-17T11:07:13.000Z | examples/python/helloworld/async_greeter_server.py | gmambro/grpc | 61aee932d72d59ce9d8c47366aeb9df2825103ec | [
"Apache-2.0"
] | 11 | 2019-10-15T23:03:57.000Z | 2020-06-14T16:10:12.000Z | examples/python/helloworld/async_greeter_server.py | gmambro/grpc | 61aee932d72d59ce9d8c47366aeb9df2825103ec | [
"Apache-2.0"
] | 7 | 2019-07-04T14:23:54.000Z | 2020-04-27T08:52:51.000Z | # Copyright 2020 gRPC 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 in writing... | 34.215686 | 78 | 0.731805 |
import logging
import asyncio
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
class Greeter(helloworld_pb2_grpc.GreeterServicer):
async def SayHello(
self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext) -> helloworld_pb2.HelloReply:
... | true | true |
790256d6575ab3621056f87be81000386bbba168 | 2,795 | py | Python | gym_multigrid/envs/collect_game.py | Nikunj-Gupta/gym-multigrid | 4fabeaf339eb93fa5f614b312a6ac4c961cc303e | [
"Apache-2.0"
] | 95 | 2020-04-01T15:59:31.000Z | 2022-03-27T05:17:22.000Z | gym_multigrid/envs/collect_game.py | Nikunj-Gupta/gym-multigrid | 4fabeaf339eb93fa5f614b312a6ac4c961cc303e | [
"Apache-2.0"
] | 2 | 2020-07-28T13:56:00.000Z | 2021-03-25T23:35:48.000Z | gym_multigrid/envs/collect_game.py | Nikunj-Gupta/gym-multigrid | 4fabeaf339eb93fa5f614b312a6ac4c961cc303e | [
"Apache-2.0"
] | 30 | 2020-04-17T15:15:07.000Z | 2022-03-17T14:49:19.000Z | from gym_multigrid.multigrid import *
class CollectGameEnv(MultiGridEnv):
"""
Environment in which the agents have to collect the balls
"""
def __init__(
self,
size=10,
width=None,
height=None,
num_balls=[],
agents_index = [],
balls_index=[],
... | 28.232323 | 94 | 0.562433 | from gym_multigrid.multigrid import *
class CollectGameEnv(MultiGridEnv):
def __init__(
self,
size=10,
width=None,
height=None,
num_balls=[],
agents_index = [],
balls_index=[],
balls_reward=[],
zero_sum = False,
view_size=7
):
... | true | true |
790256fa3652e1957e6a614ecbebd0beda2d6df5 | 11,041 | py | Python | preprocessing/make_dataset_new.py | ziqi123/AutoParking | bc2c86fe93892c0502cc7cf689d8ec072d2974d1 | [
"Apache-2.0"
] | null | null | null | preprocessing/make_dataset_new.py | ziqi123/AutoParking | bc2c86fe93892c0502cc7cf689d8ec072d2974d1 | [
"Apache-2.0"
] | null | null | null | preprocessing/make_dataset_new.py | ziqi123/AutoParking | bc2c86fe93892c0502cc7cf689d8ec072d2974d1 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
import cv2
from PIL import Image
import numpy as np
import random
import itertools
import matplotlib.pyplot as plt # plt 用于显示图片
from tqdm import tqdm
# 标注文件数据处理
def read_pslot(annt_file):
# print(annt_file)
with open(annt_file, "r") as f:
annt = f.readlines()
# print... | 33.156156 | 116 | 0.580926 | import numpy as np
import os
import cv2
from PIL import Image
import numpy as np
import random
import itertools
import matplotlib.pyplot as plt
from tqdm import tqdm
def read_pslot(annt_file):
with open(annt_file, "r") as f:
annt = f.readlines()
l = []
l_ign = []
for line in annt... | true | true |
790258ec7df84e57acc4bee76d98d0e80bce2354 | 8,895 | py | Python | products_and_services_client/api/invoice_financings_api.py | pitzer42/opbk-br-quickstart | b3f86b2e5f82a6090aaefb563614e174a452383c | [
"MIT"
] | 2 | 2021-02-07T23:58:36.000Z | 2021-02-08T01:03:25.000Z | products_and_services_client/api/invoice_financings_api.py | pitzer42/opbk-br-quickstart | b3f86b2e5f82a6090aaefb563614e174a452383c | [
"MIT"
] | null | null | null | products_and_services_client/api/invoice_financings_api.py | pitzer42/opbk-br-quickstart | b3f86b2e5f82a6090aaefb563614e174a452383c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
API's OpenData do Open Banking Brasil
As API's descritas neste documento são referentes as API's da fase OpenData do Open Banking Brasil. # noqa: E501
OpenAPI spec version: 1.0.0-rc5.2
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | 39.709821 | 117 | 0.636875 |
from __future__ import absolute_import
import re
import six
from products_and_services_client.api_client import ApiClient
class InvoiceFinancingsApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
... | true | true |
790259649967d8ddd4f5c68d708457d5ec448fed | 501 | py | Python | setup.py | wallarelvo/rover | 004d150107932a72b99a4c7421e5ea94678355ed | [
"Apache-2.0"
] | 1 | 2015-03-12T16:52:01.000Z | 2015-03-12T16:52:01.000Z | setup.py | wallarelvo/rover | 004d150107932a72b99a4c7421e5ea94678355ed | [
"Apache-2.0"
] | null | null | null | setup.py | wallarelvo/rover | 004d150107932a72b99a4c7421e5ea94678355ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
from setuptools import setup
from setuptools import find_packages
setup(
name="rover",
version="0.1",
description="Algorithm for risk and sensor quality aware sensor" +
"coverage for quadrotors",
author="Alex Wallar",
author_email="wallarelvo@gmail.com",
packages=fin... | 20.04 | 70 | 0.59481 |
from setuptools import setup
from setuptools import find_packages
setup(
name="rover",
version="0.1",
description="Algorithm for risk and sensor quality aware sensor" +
"coverage for quadrotors",
author="Alex Wallar",
author_email="wallarelvo@gmail.com",
packages=find_packages(),
inst... | true | true |
79025a1a17fd5280bcb34dcda3cfb3739e221c57 | 756 | py | Python | LeetCode/953. Verifying an Alien Dictionary.py | QinganZhao/LXXtCode | 9debb10f9d33dcdb3def9d141a638b8172d25ff3 | [
"MIT"
] | 3 | 2019-01-08T02:53:44.000Z | 2021-07-26T07:03:27.000Z | LeetCode/953. Verifying an Alien Dictionary.py | QinganZhao/LXXtCode | 9debb10f9d33dcdb3def9d141a638b8172d25ff3 | [
"MIT"
] | null | null | null | LeetCode/953. Verifying an Alien Dictionary.py | QinganZhao/LXXtCode | 9debb10f9d33dcdb3def9d141a638b8172d25ff3 | [
"MIT"
] | null | null | null | class Solution:
def isAlienSorted(self, words: List[str], order: str) -> bool:
if len(words) <= 1:
return True
self.dic = {}
for i, char in enumerate(order):
self.dic[char] = i
for i in range(1, len(words)):
if self.cmp(words[i], words[i-1]) == -1:... | 31.5 | 66 | 0.478836 | class Solution:
def isAlienSorted(self, words: List[str], order: str) -> bool:
if len(words) <= 1:
return True
self.dic = {}
for i, char in enumerate(order):
self.dic[char] = i
for i in range(1, len(words)):
if self.cmp(words[i], words[i-1]) == -1:... | true | true |
79025a8644243c33198fb578fdfeea7a5eead1c0 | 1,208 | py | Python | pymcuprog/deviceinfo/devices/pic16f1768.py | KrystianD-contribution/pymcuprog | a9411a8e4a5db8b54517c51da0bae96bf8385a65 | [
"MIT"
] | 28 | 2021-05-08T19:28:33.000Z | 2022-03-23T06:23:13.000Z | pymcuprog/deviceinfo/devices/pic16f1768.py | KrystianD-contribution/pymcuprog | a9411a8e4a5db8b54517c51da0bae96bf8385a65 | [
"MIT"
] | 20 | 2021-05-24T19:20:39.000Z | 2022-03-12T20:10:30.000Z | pymcuprog/deviceinfo/devices/pic16f1768.py | KrystianD-contribution/pymcuprog | a9411a8e4a5db8b54517c51da0bae96bf8385a65 | [
"MIT"
] | 11 | 2021-06-24T20:59:16.000Z | 2022-03-23T23:59:38.000Z | """
Required device info for the PIC16F1768 devices
"""
from pymcuprog.deviceinfo.eraseflags import ChiperaseEffect
DEVICE_INFO = {
'name': 'pic16f1768',
'architecture': 'PIC16',
# Will erase Flash, User ID and Config words
'default_bulk_erase_address_word': 0x8000,
# Flash
'flash_address_word... | 30.2 | 67 | 0.725993 | from pymcuprog.deviceinfo.eraseflags import ChiperaseEffect
DEVICE_INFO = {
'name': 'pic16f1768',
'architecture': 'PIC16',
'default_bulk_erase_address_word': 0x8000,
'flash_address_word': 0,
'flash_size_words': 4*1024,
'flash_page_size_words': 32,
'flash_write_size_words': 1,
... | true | true |
79025b40e4ba467028712a47e95bf96742a70417 | 1,343 | py | Python | examples/slash_commands.py | Astrea49/enhanced-discord.py | b92fc324c8bf426a7cba68372e1193d21093ff87 | [
"MIT"
] | 1,126 | 2021-08-28T12:09:26.000Z | 2022-03-31T16:37:54.000Z | examples/slash_commands.py | Sherlock-FH/enhanced-discord.py | 3a4a6a51b15edf890f697377920651e24c417ea5 | [
"MIT"
] | 89 | 2021-08-28T14:46:11.000Z | 2022-03-04T11:19:11.000Z | examples/slash_commands.py | Sherlock-FH/enhanced-discord.py | 3a4a6a51b15edf890f697377920651e24c417ea5 | [
"MIT"
] | 111 | 2021-08-28T02:04:22.000Z | 2022-03-05T17:48:31.000Z | import discord
from discord.ext import commands
# Set slash commands=True when constructing your bot to enable all slash commands
# if your bot is only for a couple of servers, you can use the parameter
# `slash_command_guilds=[list, of, guild, ids]` to specify this,
# then the commands will be much faster to upload.
... | 31.97619 | 111 | 0.724497 | import discord
from discord.ext import commands
bot = commands.Bot("!", intents=discord.Intents(guilds=True, messages=True), slash_commands=True)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user} (ID: {bot.user.id})")
print("------")
@bot.command()
async def ping(
ctx: commands.Cont... | true | true |
79025c313021adf45529934a895fb1d10db299ec | 5,198 | py | Python | src/coolc.py | harry1911/CoolCompiler | 0eb4636bb50341d94f757b36d2362e9d03959046 | [
"MIT"
] | null | null | null | src/coolc.py | harry1911/CoolCompiler | 0eb4636bb50341d94f757b36d2362e9d03959046 | [
"MIT"
] | null | null | null | src/coolc.py | harry1911/CoolCompiler | 0eb4636bb50341d94f757b36d2362e9d03959046 | [
"MIT"
] | null | null | null | # source ./venv/bin/activate
# ===============================================================
# =============================COOL==============================
# ===============================================================
import sys
from general import errors
# import os
# basedir = os.path.abspath(os... | 34.423841 | 111 | 0.50808 |
import sys
from general import errors
def main():
programs = sys.argv[1:]
if len(programs) == 0:
errors.throw_error(errors.CompilerError(text="No file is given to coolc compiler."))
if programs[0] == '-o':
if len(programs) == 1:
... | true | true |
79025e0d15530e6af1198aa86e4145c77319b67b | 244 | py | Python | demo/graphQLDemos/spacy/schema.py | jehalladay/React-Playground | b461917b9e608b6913d2f03b8e18f838f43927bd | [
"MIT"
] | null | null | null | demo/graphQLDemos/spacy/schema.py | jehalladay/React-Playground | b461917b9e608b6913d2f03b8e18f838f43927bd | [
"MIT"
] | 4 | 2021-05-11T17:43:14.000Z | 2022-02-27T06:38:05.000Z | demo/graphQLDemos/spacy/schema.py | jehalladay/React-Playground | b461917b9e608b6913d2f03b8e18f838f43927bd | [
"MIT"
] | null | null | null | from graphene import ObjectType, String, Schema
class ExampleQuery(ObjectType):
hello = String()
def resolve_hello(self):
return "Hello"
class RootQuery(ExampleQuery, ObjectType):
pass
schema = Schema(query=RootQuery) | 16.266667 | 47 | 0.717213 | from graphene import ObjectType, String, Schema
class ExampleQuery(ObjectType):
hello = String()
def resolve_hello(self):
return "Hello"
class RootQuery(ExampleQuery, ObjectType):
pass
schema = Schema(query=RootQuery) | true | true |
79025f59da49987a19188780dfff74ad653228c4 | 6,118 | py | Python | booster/logging/logger.py | vlievin/booster-pytorch | a8f447160c30224112731a25f90f6f97126a34b2 | [
"MIT"
] | 4 | 2019-12-10T06:41:29.000Z | 2021-08-06T13:34:59.000Z | booster/logging/logger.py | vlievin/booster-pytorch | a8f447160c30224112731a25f90f6f97126a34b2 | [
"MIT"
] | null | null | null | booster/logging/logger.py | vlievin/booster-pytorch | a8f447160c30224112731a25f90f6f97126a34b2 | [
"MIT"
] | 1 | 2020-08-20T16:12:53.000Z | 2020-08-20T16:12:53.000Z | import logging
import os
import sys
import warnings
from collections import namedtuple
from typing import *
import matplotlib.image
import matplotlib.pyplot as plt
from torch import Tensor
from torch.utils.tensorboard import SummaryWriter
from booster import Diagnostic
from .datatracker import DataTracker
BestScore ... | 33.801105 | 119 | 0.61932 | import logging
import os
import sys
import warnings
from collections import namedtuple
from typing import *
import matplotlib.image
import matplotlib.pyplot as plt
from torch import Tensor
from torch.utils.tensorboard import SummaryWriter
from booster import Diagnostic
from .datatracker import DataTracker
BestScore ... | true | true |
79025fd0ea72e3aa1a18d07f90810ce291ac8d40 | 149,012 | py | Python | yt_dlp/extractor/generic.py | king-millez/yt-dlp | ff2751ac9cc7d4150797d3207da9b566396bc796 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/generic.py | king-millez/yt-dlp | ff2751ac9cc7d4150797d3207da9b566396bc796 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/generic.py | king-millez/yt-dlp | ff2751ac9cc7d4150797d3207da9b566396bc796 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import os
import re
import sys
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..compat import (
compat_etree_fromstring,
compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils ... | 40.959868 | 432 | 0.519898 |
from __future__ import unicode_literals
import os
import re
import sys
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..compat import (
compat_etree_fromstring,
compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils import (
de... | true | true |
79026015ec7f4683525737974a3905f4f262c182 | 8,728 | py | Python | CNN/src/models.py | thunlp/AMNRE | 16970d9887561c75886123828960943b7efc9c62 | [
"MIT"
] | 25 | 2018-06-05T11:20:36.000Z | 2021-07-22T11:43:39.000Z | CNN/src/models.py | thunlp/AMNRE | 16970d9887561c75886123828960943b7efc9c62 | [
"MIT"
] | 9 | 2018-06-27T05:02:41.000Z | 2021-04-28T08:47:58.000Z | CNN/src/models.py | thunlp/AMNRE | 16970d9887561c75886123828960943b7efc9c62 | [
"MIT"
] | 7 | 2018-07-03T19:45:21.000Z | 2019-04-14T11:07:33.000Z | from __future__ import print_function
import torch
from torch import nn
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
from constant import *
from torch.nn.utils.rnn import pack_padded_sequence
class EncoderGRU(nn.Module):
def __init__(self,
vocab_size,emb_dim... | 43.422886 | 151 | 0.635655 | from __future__ import print_function
import torch
from torch import nn
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
from constant import *
from torch.nn.utils.rnn import pack_padded_sequence
class EncoderGRU(nn.Module):
def __init__(self,
vocab_size,emb_dim... | true | true |
790260919ac0f5bfddec0cc2a99dc20d566fefef | 1,358 | py | Python | modoboa/admin/forms/import_.py | antoniotrento/modoboa | 98eea782a080a3cdfea5abea7d288ff3d49595c6 | [
"ISC"
] | 1 | 2019-06-12T19:24:42.000Z | 2019-06-12T19:24:42.000Z | modoboa/admin/forms/import_.py | antoniotrento/modoboa | 98eea782a080a3cdfea5abea7d288ff3d49595c6 | [
"ISC"
] | null | null | null | modoboa/admin/forms/import_.py | antoniotrento/modoboa | 98eea782a080a3cdfea5abea7d288ff3d49595c6 | [
"ISC"
] | 1 | 2020-11-20T00:25:23.000Z | 2020-11-20T00:25:23.000Z | """Forms related to import operations."""
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy
class ImportDataForm(forms.Form):
"""Base form to import objects."""
sourcefile = forms.FileField(label=ugettext_lazy("Select a file"))
sepchar ... | 29.521739 | 80 | 0.662003 |
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy
class ImportDataForm(forms.Form):
sourcefile = forms.FileField(label=ugettext_lazy("Select a file"))
sepchar = forms.CharField(
label=ugettext_lazy("Separator"),
max_length=1... | true | true |
7902613ce459589bf5ff191f2e31f4823aa204cf | 5,576 | py | Python | tsl/data/mixin.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | 4 | 2022-03-21T09:16:33.000Z | 2022-03-30T12:24:30.000Z | tsl/data/mixin.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | null | null | null | tsl/data/mixin.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | null | null | null | from typing import Optional, Union, Tuple, Mapping, List
from torch import Tensor
from torch_geometric.data.storage import recursive_apply
from torch_geometric.typing import Adj
from torch_sparse import SparseTensor
from tsl.ops.connectivity import convert_torch_connectivity
from tsl.typing import DataArray, SparseTe... | 43.224806 | 80 | 0.603659 | from typing import Optional, Union, Tuple, Mapping, List
from torch import Tensor
from torch_geometric.data.storage import recursive_apply
from torch_geometric.typing import Adj
from torch_sparse import SparseTensor
from tsl.ops.connectivity import convert_torch_connectivity
from tsl.typing import DataArray, SparseTe... | true | true |
79026154de1f814d7e362c3cba2da3815404e7fb | 9,211 | py | Python | manila/hacking/checks.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 1 | 2015-05-28T22:28:08.000Z | 2015-05-28T22:28:08.000Z | manila/hacking/checks.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 5 | 2015-08-13T15:17:28.000Z | 2016-08-02T02:55:01.000Z | manila/hacking/checks.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 2 | 2015-08-29T08:19:58.000Z | 2016-08-02T02:46:10.000Z | # Copyright (c) 2012, Cloudscaling
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 36.551587 | 78 | 0.670828 |
import ast
import re
import pep8
UNDERSCORE_IMPORT_FILES = []
log_translation = re.compile(
r"(.)*LOG\.(audit|error|info|critical|exception)\(\s*('|\")")
log_translation_LC = re.compile(
r"(.)*LOG\.(critical)\(\s*(_\(|'|\")")
log_translation_LE = re.compile(
r"(.)*LOG\.(error|exception)\... | true | true |
7902638628bb0064f61e0251eaef00315f00d3ba | 2,027 | py | Python | GEN_SIM/Configuration/GenProduction/python/ThirteenTeV/HVDS/HVDS_MZP300_MDP20_Ctau500mm_Pythia8_13TeV_cff.py | jwill24/Timing | 99c5712eae960646e02bbb796e91b584a9a96132 | [
"MIT"
] | 2 | 2017-10-19T12:28:53.000Z | 2019-05-22T14:36:05.000Z | GEN_SIM/Configuration/GenProduction/python/ThirteenTeV/HVDS/HVDS_MZP300_MDP20_Ctau500mm_Pythia8_13TeV_cff.py | jwill24/Timing | 99c5712eae960646e02bbb796e91b584a9a96132 | [
"MIT"
] | null | null | null | GEN_SIM/Configuration/GenProduction/python/ThirteenTeV/HVDS/HVDS_MZP300_MDP20_Ctau500mm_Pythia8_13TeV_cff.py | jwill24/Timing | 99c5712eae960646e02bbb796e91b584a9a96132 | [
"MIT"
] | 6 | 2017-09-13T13:16:10.000Z | 2019-01-28T17:39:51.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
comEnergy = cms.double(13000.0),
pythiaHepMCVerbosity = cms.untracked.bool(False),
pythiaPylis... | 44.065217 | 93 | 0.513567 | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
comEnergy = cms.double(13000.0),
pythiaHepMCVerbosity = cms.untracked.bool(False),
pythiaPylis... | true | true |
790264a7803ec3eb2265392d8e40373ae6a727be | 2,162 | py | Python | benchmark/startPyquil1068.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil1068.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil1068.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=48
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=3
pr... | 25.139535 | 64 | 0.546253 |
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(0)
prog += Z(2)
prog += H(1)
prog += RX(2.66407057024... | false | true |
790264f04656fc7c67e61664be259576d99e75f7 | 3,495 | py | Python | xsocs/gui/project/ScanPositionsItem.py | omserta/xsocs | 5e1cf1352233498c48f0566e0b819e18373e95e5 | [
"MIT"
] | null | null | null | xsocs/gui/project/ScanPositionsItem.py | omserta/xsocs | 5e1cf1352233498c48f0566e0b819e18373e95e5 | [
"MIT"
] | null | null | null | xsocs/gui/project/ScanPositionsItem.py | omserta/xsocs | 5e1cf1352233498c48f0566e0b819e18373e95e5 | [
"MIT"
] | null | null | null | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | 43.148148 | 79 | 0.621173 | true | true | |
790265f034101904ace24c8650fb26d3abb22b2c | 763 | py | Python | tests/test_inventory_generation.py | matthewlchambers/standardizedinventories | 153526d34850820ee12bf5601e2703c583a07288 | [
"CC0-1.0"
] | null | null | null | tests/test_inventory_generation.py | matthewlchambers/standardizedinventories | 153526d34850820ee12bf5601e2703c583a07288 | [
"CC0-1.0"
] | null | null | null | tests/test_inventory_generation.py | matthewlchambers/standardizedinventories | 153526d34850820ee12bf5601e2703c583a07288 | [
"CC0-1.0"
] | null | null | null | """Test the creation of all inventories."""
import stewi
from stewi.globals import paths, STEWI_VERSION, config
year = 2018
def test_inventory_generation():
# Create new local path
paths.local_path = paths.local_path + "_" + STEWI_VERSION
error_list = []
for inventory in config()['databases']:
... | 24.612903 | 85 | 0.63827 |
import stewi
from stewi.globals import paths, STEWI_VERSION, config
year = 2018
def test_inventory_generation():
paths.local_path = paths.local_path + "_" + STEWI_VERSION
error_list = []
for inventory in config()['databases']:
if inventory in ['RCRAInfo']:
continue
... | true | true |
790266504aada4afbc51ccf3f2bedc285c45444a | 10,945 | py | Python | Qshop/Buyer/views.py | songdanlee/DjangoWorkSpace | 5dea8601f21f5408797a8801f74b76c696a33d83 | [
"MIT"
] | null | null | null | Qshop/Buyer/views.py | songdanlee/DjangoWorkSpace | 5dea8601f21f5408797a8801f74b76c696a33d83 | [
"MIT"
] | 1 | 2021-05-10T11:45:52.000Z | 2021-05-10T11:45:52.000Z | Qshop/Buyer/views.py | songdanlee/DjangoWorkSpace | 5dea8601f21f5408797a8801f74b76c696a33d83 | [
"MIT"
] | null | null | null | from alipay import AliPay
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.http import JsonResponse
from django.shortcuts import render
from django.utils.http import urlquote
from Qshop.settings import alipay_private_key_string, alipay_public_key_string
from Seller.v... | 29.986301 | 102 | 0.604568 | from alipay import AliPay
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.http import JsonResponse
from django.shortcuts import render
from django.utils.http import urlquote
from Qshop.settings import alipay_private_key_string, alipay_public_key_string
from Seller.v... | true | true |
790266e9a7bcf554bd70851b9a13216ab9f797e3 | 11,530 | py | Python | src/gdata/spreadsheets/data.py | Cloudlock/gdata-python3 | a6481a13590bfa225f91a97b2185cca9aacd1403 | [
"Apache-2.0"
] | 19 | 2017-06-09T13:38:03.000Z | 2020-12-12T07:45:48.000Z | src/gdata/spreadsheets/data.py | AlexxIT/gdata-python3 | 5cc5a83a469d87f804d1fda8760ec76bcb6050c9 | [
"Apache-1.1"
] | 11 | 2017-07-22T07:09:54.000Z | 2020-12-02T15:08:48.000Z | src/gdata/spreadsheets/data.py | AlexxIT/gdata-python3 | 5cc5a83a469d87f804d1fda8760ec76bcb6050c9 | [
"Apache-1.1"
] | 25 | 2017-07-03T11:30:39.000Z | 2020-10-01T02:21:13.000Z | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License 2.0;
# This module is used for version 2 of the Google Data APIs.
"""Provides classes and constants for the XML in the Google Spreadsheets API.
Documentation for the raw XML which these classes represent can be found he... | 31.162162 | 82 | 0.674761 |
import atom.core
import gdata.data
GS_TEMPLATE = '{http://schemas.google.com/spreadsheets/2006}%s'
GSX_NAMESPACE = 'http://schemas.google.com/spreadsheets/2006/extended'
INSERT_MODE = 'insert'
OVERWRITE_MODE = 'overwrite'
WORKSHEETS_REL = 'http://schemas.google.com/spreadsheets/2006#worksheetsfeed'
BA... | true | true |
790267a642be841e70d1a8236f4049183b14d8ba | 541 | py | Python | quiz/migrations/0003_auto_20191120_2238.py | chgo19/KnowledgeAppOne | 7a61bba49d984e9736a39ddc31737eb58eba1e23 | [
"MIT"
] | null | null | null | quiz/migrations/0003_auto_20191120_2238.py | chgo19/KnowledgeAppOne | 7a61bba49d984e9736a39ddc31737eb58eba1e23 | [
"MIT"
] | null | null | null | quiz/migrations/0003_auto_20191120_2238.py | chgo19/KnowledgeAppOne | 7a61bba49d984e9736a39ddc31737eb58eba1e23 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2019-11-20 17:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quiz', '0002_question_image'),
]
operations = [
migrations.RemoveField(
model_name='question',
name='answer',
... | 23.521739 | 105 | 0.5878 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quiz', '0002_question_image'),
]
operations = [
migrations.RemoveField(
model_name='question',
name='answer',
),
migrations.AddField(
m... | true | true |
79026b31bd5e8b437c6118231c44de5923735f31 | 638 | py | Python | DCS311 Artificial Intelligence/KNN/lab1_code/M3/dist.py | Lan-Jing/Courses | 540db9499b8725ca5b82a2c4e7a3da09f73c0efa | [
"MIT"
] | 1 | 2021-12-17T23:09:00.000Z | 2021-12-17T23:09:00.000Z | DCS311 Artificial Intelligence/KNN/lab1_code/M3/dist.py | Lan-Jing/Courses | 540db9499b8725ca5b82a2c4e7a3da09f73c0efa | [
"MIT"
] | null | null | null | DCS311 Artificial Intelligence/KNN/lab1_code/M3/dist.py | Lan-Jing/Courses | 540db9499b8725ca5b82a2c4e7a3da09f73c0efa | [
"MIT"
] | 1 | 2021-08-03T23:42:06.000Z | 2021-08-03T23:42:06.000Z | # module for distance computation;
import numpy as np
def dist(arraya, arrayb, mode):
if mode == 0:
dis = np.sum(np.abs(np.subtract(arraya, arrayb)))
elif mode == 1:
dis = np.sqrt(np.sum(np.power(np.subtract(arraya, arrayb), 2)))
else:
dis = 1 - np.dot(arraya, arrayb) / np.sqrt(np.s... | 35.444444 | 109 | 0.619122 |
import numpy as np
def dist(arraya, arrayb, mode):
if mode == 0:
dis = np.sum(np.abs(np.subtract(arraya, arrayb)))
elif mode == 1:
dis = np.sqrt(np.sum(np.power(np.subtract(arraya, arrayb), 2)))
else:
dis = 1 - np.dot(arraya, arrayb) / np.sqrt(np.sum(np.power(arraya, 2)) * np.sum(n... | true | true |
79026c237d69a77f4bba9d757a7640288ac10253 | 9,207 | py | Python | thor_client/experiment_client.py | JamesBrofos/Thor-Python-Client | 2cf1c2a876cf1dcce391ad2f33c8572cb0acd2e7 | [
"MIT"
] | null | null | null | thor_client/experiment_client.py | JamesBrofos/Thor-Python-Client | 2cf1c2a876cf1dcce391ad2f33c8572cb0acd2e7 | [
"MIT"
] | 2 | 2017-08-04T15:59:35.000Z | 2021-06-01T22:06:25.000Z | thor_client/experiment_client.py | JamesBrofos/Thor-Python-Client | 2cf1c2a876cf1dcce391ad2f33c8572cb0acd2e7 | [
"MIT"
] | 2 | 2017-06-23T18:46:03.000Z | 2019-11-05T19:27:47.000Z | import requests
import json
from .config import auth_token, base_url
from .recommendation_client import RecommendationClient
from .json_parser import json_parser
class ExperimentClient(object):
"""Experiment Client Class
This object defines a Thor experiment within the Python environment. In
particular, ... | 44.912195 | 80 | 0.641686 | import requests
import json
from .config import auth_token, base_url
from .recommendation_client import RecommendationClient
from .json_parser import json_parser
class ExperimentClient(object):
def __init__(self, identifier, name, date, dims, auth_token=auth_token,
base_url=base_url):
sel... | true | true |
79026ddcc57a39b498a7d5c819166bc735607d4c | 1,757 | py | Python | digital_image_processing/filters/gaussian_filter.py | czuo0303/Python | 4b71e2647b38f146e795a645957b311905c6c33f | [
"MIT"
] | 7 | 2020-03-29T08:20:07.000Z | 2022-03-19T06:41:19.000Z | digital_image_processing/filters/gaussian_filter.py | Mathewsmusukuma/Python | 4866b1330bc7c77c0ed0e050e6b99efdeb026448 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | digital_image_processing/filters/gaussian_filter.py | Mathewsmusukuma/Python | 4866b1330bc7c77c0ed0e050e6b99efdeb026448 | [
"MIT"
] | 6 | 2020-05-31T20:40:50.000Z | 2021-12-23T04:52:15.000Z | """
Implementation of gaussian filter algorithm
"""
from cv2 import imread, cvtColor, COLOR_BGR2GRAY, imshow, waitKey
from numpy import pi, mgrid, exp, square, zeros, ravel, dot, uint8
from itertools import product
def gen_gaussian_kernel(k_size, sigma):
center = k_size // 2
x, y = mgrid[0 - center : k_size -... | 32.537037 | 85 | 0.669892 | from cv2 import imread, cvtColor, COLOR_BGR2GRAY, imshow, waitKey
from numpy import pi, mgrid, exp, square, zeros, ravel, dot, uint8
from itertools import product
def gen_gaussian_kernel(k_size, sigma):
center = k_size // 2
x, y = mgrid[0 - center : k_size - center, 0 - center : k_size - center]
g = 1 / (... | true | true |
79026e40c9b60495f76ac27b1488c09fb6a0b276 | 102 | py | Python | UniGrammarRuntime/backends/__init__.py | UniGrammar/UniGrammarRuntime.py | 58097f1d03f35c346a0534d1eb821b98edd25ad5 | [
"Unlicense"
] | null | null | null | UniGrammarRuntime/backends/__init__.py | UniGrammar/UniGrammarRuntime.py | 58097f1d03f35c346a0534d1eb821b98edd25ad5 | [
"Unlicense"
] | null | null | null | UniGrammarRuntime/backends/__init__.py | UniGrammar/UniGrammarRuntime.py | 58097f1d03f35c346a0534d1eb821b98edd25ad5 | [
"Unlicense"
] | null | null | null | from .multilanguage import antlr4, waxeye
from .python import TatSu, arpeggio, parglare, parsimonious
| 34 | 59 | 0.823529 | from .multilanguage import antlr4, waxeye
from .python import TatSu, arpeggio, parglare, parsimonious
| true | true |
79026f8d54ffa067cedca51853fd88f5cc6dbbb2 | 1,392 | py | Python | src/schemathesis/cli/options.py | PrayagS/schemathesis | 80eb0a689ca197a0999e80b35d5dcbbbd88ddf4b | [
"MIT"
] | 1 | 2021-03-24T08:55:10.000Z | 2021-03-24T08:55:10.000Z | src/schemathesis/cli/options.py | PrayagS/schemathesis | 80eb0a689ca197a0999e80b35d5dcbbbd88ddf4b | [
"MIT"
] | null | null | null | src/schemathesis/cli/options.py | PrayagS/schemathesis | 80eb0a689ca197a0999e80b35d5dcbbbd88ddf4b | [
"MIT"
] | 1 | 2021-07-13T11:01:38.000Z | 2021-07-13T11:01:38.000Z | from enum import Enum
from typing import List, Optional, Type, Union
import click
from ..types import NotSet
class CSVOption(click.Choice):
def __init__(self, choices: Type[Enum]):
self.enum = choices
super().__init__(tuple(choices.__members__))
def convert(
self, value: str, param:... | 33.95122 | 98 | 0.640805 | from enum import Enum
from typing import List, Optional, Type, Union
import click
from ..types import NotSet
class CSVOption(click.Choice):
def __init__(self, choices: Type[Enum]):
self.enum = choices
super().__init__(tuple(choices.__members__))
def convert(
self, value: str, param:... | true | true |
79026fabd03fab0abe84bbc68e27af2a6cc9bee9 | 1,866 | py | Python | tests/basics/Unpacking35.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | null | null | null | tests/basics/Unpacking35.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | null | null | null | tests/basics/Unpacking35.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | 1 | 2018-12-16T23:51:18.000Z | 2018-12-16T23:51:18.000Z | # Copyright 2018, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 25.561644 | 79 | 0.665595 |
def tupleUnpacking():
return (*a, b, *c)
def listUnpacking():
return [*a, b, *c]
def setUnpacking():
return {*a, b, *c}
def dictUnpacking():
return {"a" : 1, **d}
a = range(3)
b = 5
c = range(8,10)
d = {"a" : 2}
print("Tuple unpacked", tupleUnpacking())
print("List unpacked", list... | true | true |
7902723262687509437cdd68aacb60a0299cb577 | 3,773 | py | Python | pub/permission/resource.py | DASTUDIO/MyVHost | b9eda56a67c2df9236b7866087bc7f465542f951 | [
"MIT"
] | 2 | 2021-07-27T10:38:57.000Z | 2021-10-10T20:42:56.000Z | pub/permission/resource.py | DASTUDIO/MyVHost | b9eda56a67c2df9236b7866087bc7f465542f951 | [
"MIT"
] | null | null | null | pub/permission/resource.py | DASTUDIO/MyVHost | b9eda56a67c2df9236b7866087bc7f465542f951 | [
"MIT"
] | null | null | null | # coding=utf-8
from pub.tables.resources import *
from pub.tables.user import *
import pub.client.login as login
from pub.permission.user import is_logged,is_owner
def is_valid_key(key, r_type):
try:
resource_type.objects.get(key=key)
return False
except:
pass
try:
resour... | 26.384615 | 123 | 0.640074 |
from pub.tables.resources import *
from pub.tables.user import *
import pub.client.login as login
from pub.permission.user import is_logged,is_owner
def is_valid_key(key, r_type):
try:
resource_type.objects.get(key=key)
return False
except:
pass
try:
resource_info.object... | true | true |
79027255f2380da67f8d9c7da58a3bd5dccd5411 | 11,619 | py | Python | MetamorphicTests/all_mutants/sales_forecasting_file/273.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/273.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/273.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | 1 | 2022-02-06T14:59:43.000Z | 2022-02-06T14:59:43.000Z | def gen_mutants():
import tensorflow as tf
import pandas
import numpy as np
DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv'
DATAFILE_VALIDATE = 'mock_kaggle_edit_... | 31.150134 | 232 | 0.62897 | def gen_mutants():
import tensorflow as tf
import pandas
import numpy as np
DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv'
DATAFILE_VALIDATE = 'mock_kaggle_edit_... | true | true |
790272a3ad93584e9707d0533955430526f5f09d | 154 | py | Python | src/enquiries/apps.py | kkamara/django-app | 5e6e3e3200c7f01d1c3a67e3bcb5835d8db1ffff | [
"BSD-3-Clause"
] | null | null | null | src/enquiries/apps.py | kkamara/django-app | 5e6e3e3200c7f01d1c3a67e3bcb5835d8db1ffff | [
"BSD-3-Clause"
] | null | null | null | src/enquiries/apps.py | kkamara/django-app | 5e6e3e3200c7f01d1c3a67e3bcb5835d8db1ffff | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class EnquiriesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'src.enquiries'
| 22 | 56 | 0.766234 | from django.apps import AppConfig
class EnquiriesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'src.enquiries'
| true | true |
790274b8ec9a71f78ebd00280c297b3198699f34 | 7,718 | py | Python | tests/test_format_detection.py | jenhaoyang/datumaro | add81ddb59502362fa65fa07e5bc4d8c9f61afde | [
"MIT"
] | null | null | null | tests/test_format_detection.py | jenhaoyang/datumaro | add81ddb59502362fa65fa07e5bc4d8c9f61afde | [
"MIT"
] | null | null | null | tests/test_format_detection.py | jenhaoyang/datumaro | add81ddb59502362fa65fa07e5bc4d8c9f61afde | [
"MIT"
] | 1 | 2021-12-15T22:15:59.000Z | 2021-12-15T22:15:59.000Z | from unittest import TestCase
import os.path as osp
from datumaro.components.format_detection import (
FormatDetectionConfidence, FormatRequirementsUnmet, apply_format_detector,
)
from datumaro.util.test_utils import TestDir
from tests.requirements import Requirements, mark_requirement
class FormatDetectionTest... | 38.207921 | 79 | 0.671029 | from unittest import TestCase
import os.path as osp
from datumaro.components.format_detection import (
FormatDetectionConfidence, FormatRequirementsUnmet, apply_format_detector,
)
from datumaro.util.test_utils import TestDir
from tests.requirements import Requirements, mark_requirement
class FormatDetectionTest... | true | true |
790274cf702c209f94130afcab2123d5017ee04d | 511 | py | Python | tests/v0x04/test_controller2switch/test_port_stats.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | tests/v0x04/test_controller2switch/test_port_stats.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | tests/v0x04/test_controller2switch/test_port_stats.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | """Config Port Stats message tests."""
from pyof.v0x04.controller2switch.common import PortStats
from tests.test_struct import TestStruct
class TestPortStats(TestStruct):
"""Config Port Stats message tests."""
@classmethod
def setUpClass(cls):
"""Configure raw file and its object in parent class ... | 31.9375 | 75 | 0.702544 | from pyof.v0x04.controller2switch.common import PortStats
from tests.test_struct import TestStruct
class TestPortStats(TestStruct):
@classmethod
def setUpClass(cls):
super().setUpClass()
super().set_raw_dump_file('v0x04', 'ofpt_port_stats')
super().set_raw_dump_object(PortStats)
... | true | true |
790275099919bc1e4a9c1f07d185a1ed91e196d3 | 38,309 | py | Python | src/m1_Line.py | jarskijr/10-MoreImplementingClasses | b21f0b5c6380c65b474eb6cba8bed55870d9809b | [
"MIT"
] | null | null | null | src/m1_Line.py | jarskijr/10-MoreImplementingClasses | b21f0b5c6380c65b474eb6cba8bed55870d9809b | [
"MIT"
] | null | null | null | src/m1_Line.py | jarskijr/10-MoreImplementingClasses | b21f0b5c6380c65b474eb6cba8bed55870d9809b | [
"MIT"
] | null | null | null | """
A simple Line class.
NOTE: This is NOT rosegraphics -- it is your OWN Line class.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Jacob Jarski.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
import math
impor... | 38.270729 | 98 | 0.479757 |
import math
import m1t_test_Line as m1t
| true | true |
7902764de6bc314f57e26cb5be2bf447033bf77b | 1,601 | py | Python | test/rules/outputs/test_name.py | j0lly/cfn-python-lint | 3032bab8fe190763bd0df1c34905c3528ceb411f | [
"MIT-0"
] | 1 | 2019-03-19T22:49:38.000Z | 2019-03-19T22:49:38.000Z | test/rules/outputs/test_name.py | j0lly/cfn-python-lint | 3032bab8fe190763bd0df1c34905c3528ceb411f | [
"MIT-0"
] | null | null | null | test/rules/outputs/test_name.py | j0lly/cfn-python-lint | 3032bab8fe190763bd0df1c34905c3528ceb411f | [
"MIT-0"
] | 1 | 2020-05-04T16:32:19.000Z | 2020-05-04T16:32:19.000Z | """
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... | 42.131579 | 87 | 0.723923 | from cfnlint.rules.outputs.Name import Name
from .. import BaseRuleTestCase
class TestName(BaseRuleTestCase):
def setUp(self):
super(TestName, self).setUp()
self.collection.register(Name())
self.success_templates = [
'fixtures/templates/good/outputs/name.yaml'
]
... | true | true |
79027676c5ca108e115bc437519299eb7bbd02f4 | 1,713 | py | Python | coffee-maturation/src/models/non_maximum.py | dahem/coffe-images | 2af526c57c08317829e0b99af83b11c9fb9182da | [
"MIT"
] | null | null | null | coffee-maturation/src/models/non_maximum.py | dahem/coffe-images | 2af526c57c08317829e0b99af83b11c9fb9182da | [
"MIT"
] | null | null | null | coffee-maturation/src/models/non_maximum.py | dahem/coffe-images | 2af526c57c08317829e0b99af83b11c9fb9182da | [
"MIT"
] | null | null | null | import numpy as np
def non_max_suppression_fast(boxes, overlapThresh):
# if there are no boxes, return an empty list
if len(boxes) == 0:
return []
# if the boxes are integers, convert them to floats (due to divisions)
if boxes.dtype.kind == "i":
boxes = boxes.astype("float")
# initial... | 24.126761 | 108 | 0.615879 | import numpy as np
def non_max_suppression_fast(boxes, overlapThresh):
if len(boxes) == 0:
return []
if boxes.dtype.kind == "i":
boxes = boxes.astype("float")
pick = []
x1 = boxes[:,0]
y1 = boxes[:,1]
x2 = boxes[:,2]
y2 = boxes[:,3]
scores = boxes[:,4]
... | true | true |
79027720c502b22e5dd0c8ed61a61b7ef0298deb | 3,095 | py | Python | pypureclient/flasharray/FA_2_2/models/username.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_2/models/username.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_2/models/username.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 27.633929 | 105 | 0.53958 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_2 import models
class Username(object):
swagger_types = {
'username': 'str'
}
attribute_map = {
'username': 'username'
}
requir... | true | true |
790277628e358d097d7c6420008ccc2991c4275a | 4,646 | py | Python | autolens/aggregator/fit_imaging.py | Jammy2211/AutoLens | bc132a21d1a52248f08f198474e29f985e365d85 | [
"MIT"
] | null | null | null | autolens/aggregator/fit_imaging.py | Jammy2211/AutoLens | bc132a21d1a52248f08f198474e29f985e365d85 | [
"MIT"
] | 10 | 2017-12-22T11:39:33.000Z | 2018-01-30T09:13:16.000Z | autolens/aggregator/fit_imaging.py | Jammy2211/AutoLens | bc132a21d1a52248f08f198474e29f985e365d85 | [
"MIT"
] | null | null | null | from typing import Optional, List
import autofit as af
import autoarray as aa
import autogalaxy as ag
from autogalaxy.aggregator.imaging import _imaging_from
from autogalaxy.aggregator.abstract import AbstractAgg
from autolens.imaging.fit_imaging import FitImaging
from autolens.analysis.preloads import Pre... | 35.738462 | 120 | 0.667456 | from typing import Optional, List
import autofit as af
import autoarray as aa
import autogalaxy as ag
from autogalaxy.aggregator.imaging import _imaging_from
from autogalaxy.aggregator.abstract import AbstractAgg
from autolens.imaging.fit_imaging import FitImaging
from autolens.analysis.preloads import Pre... | true | true |
79027783b2b2077d0cd6769e7b381925dd69689c | 8,138 | py | Python | nova/conductor/tasks/live_migrate.py | alvarolopez/nova | 97a97205a980459bae1f61aec3d4c7e0bec1e9c2 | [
"Apache-2.0"
] | null | null | null | nova/conductor/tasks/live_migrate.py | alvarolopez/nova | 97a97205a980459bae1f61aec3d4c7e0bec1e9c2 | [
"Apache-2.0"
] | null | null | null | nova/conductor/tasks/live_migrate.py | alvarolopez/nova | 97a97205a980459bae1f61aec3d4c7e0bec1e9c2 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 41.948454 | 78 | 0.652249 |
from oslo_config import cfg
from oslo_log import log as logging
from nova.compute import power_state
from nova.compute import rpcapi as compute_rpcapi
from nova import exception
from nova.i18n import _
from nova import image
from nova import objects
from nova.scheduler import client as scheduler_client
fro... | true | true |
790277bbc3a59e973b680871d6476a0e4df1eb85 | 7,731 | py | Python | mangum/protocols/lifespan.py | tasn/mangum | 6da7e51ca8e7979f41291ab3f0e698882f219814 | [
"MIT"
] | 661 | 2020-06-02T01:06:35.000Z | 2022-03-30T22:40:47.000Z | mangum/protocols/lifespan.py | tasn/mangum | 6da7e51ca8e7979f41291ab3f0e698882f219814 | [
"MIT"
] | 116 | 2020-06-02T02:14:14.000Z | 2022-03-25T11:54:38.000Z | mangum/protocols/lifespan.py | tasn/mangum | 6da7e51ca8e7979f41291ab3f0e698882f219814 | [
"MIT"
] | 55 | 2020-06-02T02:01:26.000Z | 2022-03-16T16:13:09.000Z | import asyncio
import logging
import types
import typing
import enum
from dataclasses import dataclass
from ..types import ASGIApp, Message
from ..exceptions import LifespanUnsupported, LifespanFailure, UnexpectedMessage
class LifespanCycleState(enum.Enum):
"""
The state of the ASGI `lifespan` connection.
... | 39.443878 | 87 | 0.644289 | import asyncio
import logging
import types
import typing
import enum
from dataclasses import dataclass
from ..types import ASGIApp, Message
from ..exceptions import LifespanUnsupported, LifespanFailure, UnexpectedMessage
class LifespanCycleState(enum.Enum):
CONNECTING = enum.auto()
STARTUP = enum.auto()
... | true | true |
790278d542d109c0e271928ce9ea3f02744bf76c | 7,278 | py | Python | ostap/fitting/tests/test_fitting_efficiency.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | 14 | 2017-03-24T12:38:08.000Z | 2022-02-21T05:00:57.000Z | ostap/fitting/tests/test_fitting_efficiency.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | 10 | 2019-03-08T18:48:42.000Z | 2022-03-22T11:59:48.000Z | ostap/fitting/tests/test_fitting_efficiency.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | 11 | 2017-03-23T15:29:58.000Z | 2022-02-21T05:03:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (c) Ostap developers.
# =============================================================================
# @file test_fitting_efficiency.py
# Test module for ostap/fitting/efficiency.p... | 34.657143 | 89 | 0.436796 |
__author__ = "Ostap developers"
__all__ = () om, math
import ostap.fitting.roofit
import ostap.fitting.models as Models
from ostap.core.core import cpp, VE, dsID, Ostap
from ostap.logger.utils import rooSilent
from ostap.fitting.efficiency import Efficiency1D
from ostap.uti... | true | true |
79027a7d23c5a15bd7a28fff8bfec6564da9122d | 13,464 | py | Python | demos/output_usage.py | songshanyuwu/PyWebIO | 419d10747ad90a76386411fb0d285f049337b093 | [
"MIT"
] | 1 | 2021-02-25T23:41:09.000Z | 2021-02-25T23:41:09.000Z | demos/output_usage.py | songshanyuwu/PyWebIO | 419d10747ad90a76386411fb0d285f049337b093 | [
"MIT"
] | null | null | null | demos/output_usage.py | songshanyuwu/PyWebIO | 419d10747ad90a76386411fb0d285f049337b093 | [
"MIT"
] | null | null | null | """
Output demo
^^^^^^^^^^^^^^
Demonstrate various output usage supported by PyWebIO
:demo_host:`Demo </?pywebio_api=output_usage>` `Source code <https://github.com/wang0618/PyWebIO/blob/dev/demos/output_usage.py>`_
"""
from pywebio import start_server
from pywebio.output import *
from pywebio.session import hold, ge... | 37.19337 | 311 | 0.621064 | from pywebio import start_server
from pywebio.output import *
from pywebio.session import hold, get_info
from functools import partial
def t(eng, chinese):
return chinese if 'zh' in get_info().user_language else eng
def code_block(code, strip_indent=4):
if strip_indent:
lines = (
i[strip... | true | true |
79027ae2d057de7e199cb76a3e86526a58da79fa | 501 | py | Python | env/Lib/site-packages/plotly/validators/histogram2dcontour/colorbar/_ticks.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/histogram2dcontour/colorbar/_ticks.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/histogram2dcontour/colorbar/_ticks.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="ticks", parent_name="histogram2dcontour.colorbar", **kwargs
):
super(TicksValidator, self).__init__(
plotly_name=plotly_name,
par... | 33.4 | 86 | 0.644711 | import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="ticks", parent_name="histogram2dcontour.colorbar", **kwargs
):
super(TicksValidator, self).__init__(
plotly_name=plotly_name,
par... | true | true |
79027aea4b332b8dfb878d883be7550b71ba06c0 | 297 | py | Python | weather.py | Geimers228/PyDev | bf2997e7a4dd3b780caeafbb5a53e87173e6891b | [
"MIT"
] | null | null | null | weather.py | Geimers228/PyDev | bf2997e7a4dd3b780caeafbb5a53e87173e6891b | [
"MIT"
] | 4 | 2021-01-21T11:41:28.000Z | 2021-01-21T11:42:30.000Z | weather.py | Geimers228/PyDev | bf2997e7a4dd3b780caeafbb5a53e87173e6891b | [
"MIT"
] | null | null | null | from pyowm import OWM
owm = OWM('21ff51d901692fd3e2f5ecc04d3617f1')
place = input('Input Place: ')
mgr = owm.weather_manager()
observation = mgr.weather_at_place(place)
w = observation.weather
wind = w.detailed_status
t = w.temperature('celsius')
print(wind)
print(t)
exit_ = input('')
| 24.75 | 46 | 0.727273 | from pyowm import OWM
owm = OWM('21ff51d901692fd3e2f5ecc04d3617f1')
place = input('Input Place: ')
mgr = owm.weather_manager()
observation = mgr.weather_at_place(place)
w = observation.weather
wind = w.detailed_status
t = w.temperature('celsius')
print(wind)
print(t)
exit_ = input('')
| true | true |
79027b4fbb5e97ffdaf75900b2f3121dc7947225 | 7,447 | py | Python | mantime/normalisers/clinical_doc_analyser.py | filannim/ManTIME | 5b47476907477c0b2dbbee3ba3a2d47903c4d12b | [
"BSD-2-Clause-FreeBSD"
] | 18 | 2015-01-08T13:54:43.000Z | 2020-11-30T14:17:56.000Z | mantime/normalisers/clinical_doc_analyser.py | filannim/ManTIME | 5b47476907477c0b2dbbee3ba3a2d47903c4d12b | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2018-02-14T11:31:57.000Z | 2021-02-03T07:59:11.000Z | mantime/normalisers/clinical_doc_analyser.py | filannim/ManTIME | 5b47476907477c0b2dbbee3ba3a2d47903c4d12b | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2016-08-29T07:28:39.000Z | 2017-06-05T12:42:43.000Z | #!/usr/bin/python
#
# Copyright 2012 Michele Filannino
#
# gnTEAM, School of Computer Science, University of Manchester.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU General Public License.
#
# authors: Michele Filannino
# email: filanni... | 48.357143 | 172 | 0.655297 |
""" It analyses the structure of the clinical document (i2b2 format) and
provides an object which exposes the key dates extracted in the doc.
"""
from __future__ import division
import codecs
from datetime import date as datex
import re
import os
import sys
from timex_clinical import normalise
cl... | false | true |
79027b6b7a1cfb2ee61bdfd3ff61c84d91452fc6 | 2,739 | py | Python | src/secondaires/peche/commandes/banc/creer.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/secondaires/peche/commandes/banc/creer.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/secondaires/peche/commandes/banc/creer.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 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
... | 44.177419 | 79 | 0.71632 |
from primaires.interpreteur.masque.parametre import Parametre
from primaires.interpreteur.editeur.presentation import Presentation
class PrmCreer(Parametre):
def __init__(self):
Parametre.__init__(self, "creer", "create")
self.schema = "<cle>"
self.a... | true | true |
79027bb9c0b17cff34796310291ecb92d89af1cd | 3,089 | py | Python | chir.py/config.py | acidvegas/chir.py | 8e8a04353f9f2f5a5aff244e2908359c9d58a449 | [
"0BSD"
] | 19 | 2016-09-07T21:06:11.000Z | 2022-02-22T22:21:27.000Z | chir.py/config.py | acidvegas/chir.py | 8e8a04353f9f2f5a5aff244e2908359c9d58a449 | [
"0BSD"
] | 1 | 2017-06-05T12:47:29.000Z | 2020-04-10T02:03:09.000Z | chir.py/config.py | acidvegas/chir.py | 8e8a04353f9f2f5a5aff244e2908359c9d58a449 | [
"0BSD"
] | 9 | 2017-03-24T23:17:46.000Z | 2022-01-09T14:23:39.000Z | #!/usr/bin/env python
# Chir.py Twitter Bot - Developed by acidvegas in Python (https://acid.vegas/chir.py)
# config.py
# API Settings
coinurl_uuid = 'CHANGEME'
twitter_consumer_key = 'CHANGEME'
twitter_consumer_secret = 'CHANGEME'
twitter_access_token = 'CHANGEME'
twitter_access_token_secre... | 77.225 | 378 | 0.655228 |
coinurl_uuid = 'CHANGEME'
twitter_consumer_key = 'CHANGEME'
twitter_consumer_secret = 'CHANGEME'
twitter_access_token = 'CHANGEME'
twitter_access_token_secret = 'CHANGEME'
boost_keywords = ('500aday','autofollow','autofollowback','f4f','follow','follow4follow','followback','followtrain... | true | true |
79027d5656a0e4c7fcfda4f18cf23cff06e1a50e | 11,852 | py | Python | src/oscar/apps/offer/benefits.py | guidoaaroni/arandu | e1553b21516f38fd2fb10cf65204541efd3c8b54 | [
"BSD-3-Clause"
] | 3 | 2020-03-30T13:11:57.000Z | 2020-04-22T13:55:31.000Z | src/oscar/apps/offer/benefits.py | guidoaaroni/arandu | e1553b21516f38fd2fb10cf65204541efd3c8b54 | [
"BSD-3-Clause"
] | 9 | 2020-10-29T08:03:28.000Z | 2021-09-08T01:21:10.000Z | src/oscar/apps/offer/benefits.py | guidoaaroni/arandu | e1553b21516f38fd2fb10cf65204541efd3c8b54 | [
"BSD-3-Clause"
] | 2 | 2021-01-06T19:25:07.000Z | 2021-05-14T02:00:19.000Z | from decimal import Decimal as D
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class, get_classes, get_model
from oscar.templatetags.currency_filters import currency
Benefit = get_model('offer', 'Benefit')
BasketDiscount, SHIPPING_DISCOUNT, ZERO_DISCOUNT = get_classes('of... | 33.862857 | 108 | 0.626645 | from decimal import Decimal as D
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class, get_classes, get_model
from oscar.templatetags.currency_filters import currency
Benefit = get_model('offer', 'Benefit')
BasketDiscount, SHIPPING_DISCOUNT, ZERO_DISCOUNT = get_classes('of... | true | true |
7902803ea0a919e46993314e8f9f69c6c1b53b90 | 8,941 | py | Python | TASSELpy/java/lang/Long.py | er432/TASSELpy | 2273d2252786679e023d1279f0c717a29ddd6d35 | [
"BSD-3-Clause"
] | 1 | 2015-11-30T21:54:19.000Z | 2015-11-30T21:54:19.000Z | TASSELpy/java/lang/Long.py | er432/TASSELpy | 2273d2252786679e023d1279f0c717a29ddd6d35 | [
"BSD-3-Clause"
] | null | null | null | TASSELpy/java/lang/Long.py | er432/TASSELpy | 2273d2252786679e023d1279f0c717a29ddd6d35 | [
"BSD-3-Clause"
] | null | null | null | from TASSELpy.java.lang.Number import Number, metaNumber
from TASSELpy.java.lang.Comparable import Comparable
from TASSELpy.utils.DocInherit import DocInherit
from TASSELpy.utils.Overloading import javaOverload,javaConstructorOverload
from TASSELpy.javaObj import javaObj
from TASSELpy.utils.helper import make_sig
from ... | 38.705628 | 80 | 0.581926 | from TASSELpy.java.lang.Number import Number, metaNumber
from TASSELpy.java.lang.Comparable import Comparable
from TASSELpy.utils.DocInherit import DocInherit
from TASSELpy.utils.Overloading import javaOverload,javaConstructorOverload
from TASSELpy.javaObj import javaObj
from TASSELpy.utils.helper import make_sig
from ... | true | true |
7902819fa6455e54dcf6b8bffe127fb94f73c00a | 4,462 | py | Python | slaid/renderers.py | mdrio/slaid | 67c85f0d1702bced1c089bfb3c20ba1cfbc9c225 | [
"MIT"
] | null | null | null | slaid/renderers.py | mdrio/slaid | 67c85f0d1702bced1c089bfb3c20ba1cfbc9c225 | [
"MIT"
] | null | null | null | slaid/renderers.py | mdrio/slaid | 67c85f0d1702bced1c089bfb3c20ba1cfbc9c225 | [
"MIT"
] | null | null | null | import abc
import json
import logging
import os
from typing import Any, Tuple, Union
import numpy as np
import tifffile
import tiledb
import zarr
from slaid.commons import Mask, BasicSlide
from slaid.commons.base import Polygon
from slaid.commons.ecvl import BasicSlide as EcvlSlide
logger = logging.getLogger(__file_... | 28.062893 | 79 | 0.575751 | import abc
import json
import logging
import os
from typing import Any, Tuple, Union
import numpy as np
import tifffile
import tiledb
import zarr
from slaid.commons import Mask, BasicSlide
from slaid.commons.base import Polygon
from slaid.commons.ecvl import BasicSlide as EcvlSlide
logger = logging.getLogger(__file_... | true | true |
79028287689454901d5359c564211cf1812ce3df | 1,260 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/FittingAngleUsage.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/FittingAngleUsage.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/FittingAngleUsage.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class FittingAngleUsage(Enum, IComparable, IFormattable, IConvertible):
"""
An enumerated type representing the options for how to limit the angle values applicable to fitting content.
enum FittingAngleUsage,values: UseAnAngleIncrement (1),UseAnyAngle (0),UseSpecificAngles (2)
"""
def __eq__(se... | 26.808511 | 221 | 0.600794 | class FittingAngleUsage(Enum, IComparable, IFormattable, IConvertible):
def __eq__(self, *args):
pass
def __format__(self, *args):
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __init__(self, *args):
pass
def _... | true | true |
7902838fffac61c0b81475eecdd93f380737dc38 | 154 | py | Python | server/src/config.py | sz-piotr/fioletowe-pomarancze | 14e748041b8022709999a39f1a70788981f5ef14 | [
"MIT"
] | null | null | null | server/src/config.py | sz-piotr/fioletowe-pomarancze | 14e748041b8022709999a39f1a70788981f5ef14 | [
"MIT"
] | null | null | null | server/src/config.py | sz-piotr/fioletowe-pomarancze | 14e748041b8022709999a39f1a70788981f5ef14 | [
"MIT"
] | null | null | null | class DefaultConfig(object):
DEBUG = False
JSONIFY_PRETTYPRINT_REGULAR = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
API_PREFIX = '/api'
| 25.666667 | 42 | 0.74026 | class DefaultConfig(object):
DEBUG = False
JSONIFY_PRETTYPRINT_REGULAR = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
API_PREFIX = '/api'
| true | true |
790284c626d7c1ecc60f1be7c3427b8445e03415 | 3,389 | py | Python | profiles_project/settings.py | Mukul-agrawal/profiles-rest-api | 4fea09e742b055129af319ef5c7a5969641e93a9 | [
"MIT"
] | null | null | null | profiles_project/settings.py | Mukul-agrawal/profiles-rest-api | 4fea09e742b055129af319ef5c7a5969641e93a9 | [
"MIT"
] | null | null | null | profiles_project/settings.py | Mukul-agrawal/profiles-rest-api | 4fea09e742b055129af319ef5c7a5969641e93a9 | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
fro... | 25.870229 | 91 | 0.705223 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-t#@y8e6d21m2+#l#m00+pi&d0eyqa2a6v09hle&!6di(d4th*0'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
7902857cb0ae8a3366f0e139dd751dbc41260739 | 2,687 | py | Python | server/djangoapp/models.py | manojarum/agfzb-CloudAppDevelopment_Capstone | 52b1a52d897821b22514962cc41f6e859aef18b5 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/models.py | manojarum/agfzb-CloudAppDevelopment_Capstone | 52b1a52d897821b22514962cc41f6e859aef18b5 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/models.py | manojarum/agfzb-CloudAppDevelopment_Capstone | 52b1a52d897821b22514962cc41f6e859aef18b5 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.timezone import now
# Create your models here.
# <HINT> Create a Car Make model `class CarMake(models.Model)`:
# - Name
# - Description
# - Any other fields you would like to include in car make model
# - __str__ method to print a car make object
class CarMake(models.Mo... | 31.611765 | 105 | 0.639375 | from django.db import models
from django.utils.timezone import now
class CarMake(models.Model):
name = models.CharField(null=False, max_length=30, default='')
description = models.CharField(max_length=1000)
def __str__(self):
return "Name: " + self.name + "," + \
"Description... | true | true |
79028670a51d84b6fe3c552fa4eb1f636541edae | 2,279 | py | Python | lingvo/core/ops/random_ops_test.py | muntasir2000/lingvo | 1555299b817288b5a6637ded416dbbdc9b00036d | [
"Apache-2.0"
] | 1 | 2019-07-11T10:14:30.000Z | 2019-07-11T10:14:30.000Z | lingvo/core/ops/random_ops_test.py | CelineQiQi/lingvo | 4c6405a3c8b29764918dbfb599212dd7620ccf9c | [
"Apache-2.0"
] | null | null | null | lingvo/core/ops/random_ops_test.py | CelineQiQi/lingvo | 4c6405a3c8b29764918dbfb599212dd7620ccf9c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.530303 | 80 | 0.678806 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from lingvo.core import test_utils
from lingvo.core.ops import py_x_ops
from six.moves import range
import tensorflow as tf
FLAGS = tf.flags.FLAGS
class RandomOpsTest(test_utils.TestCase):
d... | true | true |
790288c520c0b2ee07dec24dc8623c84a067fba4 | 714 | py | Python | perf_tests/cp_perf_test.py | ManuelaS/lifelines | e48983550254625ab7e8a3747dd02b646a1bf7ad | [
"MIT"
] | null | null | null | perf_tests/cp_perf_test.py | ManuelaS/lifelines | e48983550254625ab7e8a3747dd02b646a1bf7ad | [
"MIT"
] | null | null | null | perf_tests/cp_perf_test.py | ManuelaS/lifelines | e48983550254625ab7e8a3747dd02b646a1bf7ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# cox regression
if __name__ == "__main__":
import pandas as pd
import time
import numpy as np
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi, load_regression_dataset
reps = 1
df = load_rossi()
df = pd.concat([df] * reps)
cp_br... | 31.043478 | 96 | 0.689076 |
if __name__ == "__main__":
import pandas as pd
import time
import numpy as np
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi, load_regression_dataset
reps = 1
df = load_rossi()
df = pd.concat([df] * reps)
cp_breslow = CoxPHFitter(penalizer=0.01, l1_... | true | true |
790289a305ff3ef427083434bb77f37bb248c750 | 401 | py | Python | avocadobites/avocadobites/asgi.py | sanjuop/PatrioticPictures | e14aaa4106cc310d4cd69968ca41b033a4f4884f | [
"MIT"
] | null | null | null | avocadobites/avocadobites/asgi.py | sanjuop/PatrioticPictures | e14aaa4106cc310d4cd69968ca41b033a4f4884f | [
"MIT"
] | null | null | null | avocadobites/avocadobites/asgi.py | sanjuop/PatrioticPictures | e14aaa4106cc310d4cd69968ca41b033a4f4884f | [
"MIT"
] | null | null | null | """
ASGI config for avocadobites project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'avocadobites.settings')
application = get_asgi_application()
| true | true |
79028a174225260b671df8c8ac4560369e16c2c8 | 710 | py | Python | tests/test_issues/test_member_example.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | 3 | 2017-07-23T11:11:23.000Z | 2020-11-30T15:36:51.000Z | tests/test_issues/test_member_example.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | 15 | 2018-01-05T17:18:34.000Z | 2021-12-13T17:40:25.000Z | tests/test_issues/test_member_example.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | null | null | null | import unittest
from pyjsg.validate_json import JSGPython
class MemberExampleTestCase(unittest.TestCase):
def test1(self):
x = JSGPython('''doc {
last_name : @string, # exactly one last name of type string
first_name : @string+ # array or one or more first names
... | 28.4 | 77 | 0.533803 | import unittest
from pyjsg.validate_json import JSGPython
class MemberExampleTestCase(unittest.TestCase):
def test1(self):
x = JSGPython('''doc {
last_name : @string, # exactly one last name of type string
first_name : @string+ # array or one or more first names
... | true | true |
79028a488f889c59f63439f73bebec11476bdc65 | 1,896 | py | Python | mdp.py | GCrispino/vi-pddlgym | 2401cdbb1590cd0ebab5a3d75549c63aa130ee24 | [
"MIT"
] | 1 | 2021-11-04T02:07:04.000Z | 2021-11-04T02:07:04.000Z | mdp.py | GCrispino/vi-pddlgym | 2401cdbb1590cd0ebab5a3d75549c63aa130ee24 | [
"MIT"
] | null | null | null | mdp.py | GCrispino/vi-pddlgym | 2401cdbb1590cd0ebab5a3d75549c63aa130ee24 | [
"MIT"
] | 1 | 2021-03-07T20:53:38.000Z | 2021-03-07T20:53:38.000Z | import numpy as np
from pddlgym.core import get_successor_states, InvalidAction
from pddlgym.inference import check_goal
def get_all_reachable(s, A, env, reach=None):
reach = {} if not reach else reach
reach[s] = {}
for a in A:
try:
succ = get_successor_states(s,
... | 29.625 | 75 | 0.477848 | import numpy as np
from pddlgym.core import get_successor_states, InvalidAction
from pddlgym.inference import check_goal
def get_all_reachable(s, A, env, reach=None):
reach = {} if not reach else reach
reach[s] = {}
for a in A:
try:
succ = get_successor_states(s,
... | true | true |
79028a9d93d4df739fdc855f8449297f6c89c314 | 2,540 | py | Python | tests/test_sklearn.py | data-science-lab-amsterdam/skippa | 1349317c441f1e46e22f4c02a8aceae767aea5fe | [
"BSD-3-Clause"
] | 33 | 2021-12-15T22:56:12.000Z | 2022-02-26T12:33:56.000Z | tests/test_sklearn.py | data-science-lab-amsterdam/skippa | 1349317c441f1e46e22f4c02a8aceae767aea5fe | [
"BSD-3-Clause"
] | null | null | null | tests/test_sklearn.py | data-science-lab-amsterdam/skippa | 1349317c441f1e46e22f4c02a8aceae767aea5fe | [
"BSD-3-Clause"
] | 1 | 2022-01-20T15:41:35.000Z | 2022-01-20T15:41:35.000Z | import pytest
import numpy as np
import pandas as pd
from skippa import columns
from skippa.transformers.sklearn import(
SkippaSimpleImputer,
SkippaStandardScaler,
SkippaMinMaxScaler,
SkippaOneHotEncoder,
SkippaLabelEncoder,
SkippaOrdinalEncoder,
SkippaPCA
)
from skippa.utils import get_dum... | 30.60241 | 88 | 0.692913 | import pytest
import numpy as np
import pandas as pd
from skippa import columns
from skippa.transformers.sklearn import(
SkippaSimpleImputer,
SkippaStandardScaler,
SkippaMinMaxScaler,
SkippaOneHotEncoder,
SkippaLabelEncoder,
SkippaOrdinalEncoder,
SkippaPCA
)
from skippa.utils import get_dum... | true | true |
79028aa9533b2ca6cad9bca5c734f688fc1c8b6f | 943 | py | Python | core/migrations/0002_auto_20161229_2221.py | dishad/ADD | 51455c493a4eb433eb1d8dde44771e917efcb500 | [
"MIT"
] | null | null | null | core/migrations/0002_auto_20161229_2221.py | dishad/ADD | 51455c493a4eb433eb1d8dde44771e917efcb500 | [
"MIT"
] | 4 | 2016-11-26T19:10:01.000Z | 2016-12-24T10:42:16.000Z | core/migrations/0002_auto_20161229_2221.py | dishad/deanslist | 51455c493a4eb433eb1d8dde44771e917efcb500 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-12-30 03:21
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
... | 27.735294 | 124 | 0.61824 |
from __future__ import unicode_literals
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.DeleteModel(
nam... | true | true |
79028af7b6911898765bc30e4f34690e470d783c | 5,137 | py | Python | autotest/ogr/ogr_style.py | riseofthetigers/GDAL | 918b6939f6be25ac9d36edca3f71c8bf5dd5975e | [
"MIT"
] | null | null | null | autotest/ogr/ogr_style.py | riseofthetigers/GDAL | 918b6939f6be25ac9d36edca3f71c8bf5dd5975e | [
"MIT"
] | null | null | null | autotest/ogr/ogr_style.py | riseofthetigers/GDAL | 918b6939f6be25ac9d36edca3f71c8bf5dd5975e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Style testing.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
###################################################... | 33.575163 | 92 | 0.633444 | true | true | |
79028c9bce485b230ba23f8ce87e16781f267032 | 77 | py | Python | .history/classes/Player_20171106170937.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Player_20171106170937.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Player_20171106170937.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null |
class Player():
def __init__(self):
print("PLYR FAK SUM BODIE")
| 15.4 | 35 | 0.597403 |
class Player():
def __init__(self):
print("PLYR FAK SUM BODIE")
| true | true |
79028da567c1f41664f026797da292dc35b3b8a0 | 1,214 | py | Python | app/core/models.py | StoikovOleh/recipe-app-api | bea18993a4563e3d8d5dd1a3bc44b782f5b4517e | [
"MIT"
] | null | null | null | app/core/models.py | StoikovOleh/recipe-app-api | bea18993a4563e3d8d5dd1a3bc44b782f5b4517e | [
"MIT"
] | null | null | null | app/core/models.py | StoikovOleh/recipe-app-api | bea18993a4563e3d8d5dd1a3bc44b782f5b4517e | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, \
BaseUserManager, PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves a new user"""
if n... | 31.128205 | 76 | 0.667216 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, \
BaseUserManager, PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
if not email:
raise ValueError('Use... | true | true |
79028f363aec5299347603f6c4801f13319c7e79 | 1,165 | py | Python | Codeforces_problems/Reverse Binary Strings/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Codeforces_problems/Reverse Binary Strings/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Codeforces_problems/Reverse Binary Strings/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # We need to make our string alternating, i. e. si≠si+1. When we reverse substring sl…sr,
# we change no more than two pairs sl−1,sl and sr,sr+1. Moreover, one pair should be a
# consecutive pair 00 and other — 11. So, we can find lower bound to our answer as maximum
# between number of pairs of 00 and number of pair... | 36.40625 | 93 | 0.593133 |
for _ in range(int(input())):
n = int(input())
s = input()
z, o = 0, 0
zeros, ones = 0, 0
for el in s:
if el == '1':
ones += 1
z += max(zeros-1, 0)
zeros = 0
if el == '0':
zeros += 1
o +=... | true | true |
79028f78d8a408e97a58606dd5ac6bc08df170f3 | 5,531 | py | Python | igemm_codegen.py | aska-0096/iGEMMgen | cff8507355d86e47f5b099cd9b8a81d94fab93d7 | [
"MIT"
] | 20 | 2020-04-14T14:39:24.000Z | 2022-02-23T19:37:04.000Z | igemm_codegen.py | aska-0096/iGEMMgen | cff8507355d86e47f5b099cd9b8a81d94fab93d7 | [
"MIT"
] | 38 | 2020-04-21T12:23:07.000Z | 2021-12-31T02:26:21.000Z | igemm_codegen.py | aska-0096/iGEMMgen | cff8507355d86e47f5b099cd9b8a81d94fab93d7 | [
"MIT"
] | 9 | 2020-04-20T06:34:16.000Z | 2022-02-23T19:37:06.000Z | ################################################################################
#
# MIT License
#
# Copyright (c) 2020 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | 42.875969 | 196 | 0.685952 | true | true | |
79028faaa57ab6b8d5b1f1de6b8b8fe297b3c725 | 5,044 | py | Python | tests/riscv/vector/vector_simple_add_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/vector/vector_simple_add_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/vector/vector_simple_add_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 37.641791 | 96 | 0.652458 |
import RandomUtils
from VectorTestSequence import VectorTestSequence
from base.ChoicesModifier import ChoicesModifier
from riscv.EnvRISCV import EnvRISCV
from riscv.GenThreadRISCV import GenThreadRISCV
class MainSequence(VectorTestSequence):
def __init__(self, aGenThread, aName=None):
... | true | true |
790290c91658ac433724591c40bbc1492630611b | 1,526 | py | Python | GM2AUTOSAR_MM/Properties/unit_contracts/HUnitR06_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | GM2AUTOSAR_MM/Properties/unit_contracts/HUnitR06_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | GM2AUTOSAR_MM/Properties/unit_contracts/HUnitR06_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitR06_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitR06_IsolatedLHS
"""
# Flag this instance as compiled now
self.is_compiled = True
super... | 29.921569 | 96 | 0.700524 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitR06_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
self.is_compiled = True
super(HUnitR06_IsolatedLHS, self).__init__(name='HUnitR06_IsolatedLHS', num_nodes=0, edges=[])
self.add_edges([])
self[... | true | true |
79029123b44893cb7ec7bfa422f207de71196e2f | 1,198 | py | Python | tests/test_profiler.py | MrPainter/aiomisc | 97187987292c3f8c642a2932438061bb9ba1add6 | [
"MIT"
] | null | null | null | tests/test_profiler.py | MrPainter/aiomisc | 97187987292c3f8c642a2932438061bb9ba1add6 | [
"MIT"
] | null | null | null | tests/test_profiler.py | MrPainter/aiomisc | 97187987292c3f8c642a2932438061bb9ba1add6 | [
"MIT"
] | null | null | null | import asyncio
import os
from pstats import Stats
from tempfile import NamedTemporaryFile
from aiomisc.service.profiler import Profiler
async def test_profiler_start_stop():
profiler = Profiler(interval=0.1, top_results=10)
try:
await profiler.start()
await asyncio.sleep(0.5)
finally:
... | 23.038462 | 53 | 0.6202 | import asyncio
import os
from pstats import Stats
from tempfile import NamedTemporaryFile
from aiomisc.service.profiler import Profiler
async def test_profiler_start_stop():
profiler = Profiler(interval=0.1, top_results=10)
try:
await profiler.start()
await asyncio.sleep(0.5)
finally:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.