hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c30412e6c94ecd2cd33945b1fec6cdd03f1c339 | 417 | py | Python | google-code-jam-2012/password-problem/password-problem.py | robertdimarco/puzzles | 61e1b62700503fdb8794fba7fa5d3156e7adf72b | [
"MIT"
] | 36 | 2015-05-11T20:22:55.000Z | 2021-09-26T07:36:49.000Z | google-code-jam-2012/password-problem/password-problem.py | robertdimarco/puzzles | 61e1b62700503fdb8794fba7fa5d3156e7adf72b | [
"MIT"
] | null | null | null | google-code-jam-2012/password-problem/password-problem.py | robertdimarco/puzzles | 61e1b62700503fdb8794fba7fa5d3156e7adf72b | [
"MIT"
] | 16 | 2016-03-08T16:25:46.000Z | 2022-03-16T06:28:51.000Z | import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(T):
A, B = map(int, file.readline().split())
p = map(float, file.readline().split())
pj, optimal = 1, B + 2
for j in xrange(A):
pj *= p[j]
optimal = min... | 24.529412 | 60 | 0.549161 | import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(T):
A, B = map(int, file.readline().split())
p = map(float, file.readline().split())
pj, optimal = 1, B + 2
for j in xrange(A):
pj *= p[j]
optimal = min... | false | true |
1c30415163ecfaf1b9ac21056ac2ad3ebdfacf67 | 5,798 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 41.120567 | 133 | 0.673163 |
import functools
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline imp... | true | true |
1c30418c3026c3a9282d3709ebe6c9102418233c | 23,942 | py | Python | src/prefect/agent/agent.py | Ashton-Sidhu/prefect | a88c86174b70b9de6c110f1c1524b70d4b18b96e | [
"Apache-2.0"
] | 2 | 2020-09-04T10:05:55.000Z | 2020-09-04T10:06:32.000Z | src/prefect/agent/agent.py | workflowmate/prefect | b893c5c69fecd1d66786bbe4c3cc6264d759f1e6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/prefect/agent/agent.py | workflowmate/prefect | b893c5c69fecd1d66786bbe4c3cc6264d759f1e6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import functools
import logging
import math
import os
import signal
import sys
import threading
import time
from concurrent.futures import Future, ThreadPoolExecutor
from contextlib import contextmanager
from typing import Any, Generator, Iterable, Set, Optional, cast
from urllib.parse import urlparse
import pendulum
... | 37.823065 | 97 | 0.544817 | import functools
import logging
import math
import os
import signal
import sys
import threading
import time
from concurrent.futures import Future, ThreadPoolExecutor
from contextlib import contextmanager
from typing import Any, Generator, Iterable, Set, Optional, cast
from urllib.parse import urlparse
import pendulum
... | true | true |
1c304688836feeccfaa7f34d41a25f173cdb04b9 | 2,543 | py | Python | bookcut/bibliography.py | jonasw234/bookcut | c159e6f9374b55744115545fb96a73ab78255bd5 | [
"MIT"
] | null | null | null | bookcut/bibliography.py | jonasw234/bookcut | c159e6f9374b55744115545fb96a73ab78255bd5 | [
"MIT"
] | null | null | null | bookcut/bibliography.py | jonasw234/bookcut | c159e6f9374b55744115545fb96a73ab78255bd5 | [
"MIT"
] | null | null | null | import requests
import json
import re
from difflib import SequenceMatcher
import os
from bookcut.mirror_checker import pageStatus
'''This file is used by ---allbooks command
It is searching OpenLibrary for all books written from an
author, and gives the choice to user to save it to a .txt file'''
OPEN_LIBRARY_U... | 34.364865 | 87 | 0.564687 | import requests
import json
import re
from difflib import SequenceMatcher
import os
from bookcut.mirror_checker import pageStatus
OPEN_LIBRARY_URL = 'http://www.openlibrary.org'
def main(author, similarity):
status = pageStatus(OPEN_LIBRARY_URL)
if status is not False:
search_url = "http://... | true | true |
1c304704a1d512fe8f0aaa81fbdd60ed45dcc10d | 189 | py | Python | main.py | nhnam0209/Automatic-Render-PDF-CV | a2d971a62adfd2cbd8ffbc02c0c7c37c8d9a9908 | [
"CC0-1.0"
] | 1 | 2022-01-15T06:02:08.000Z | 2022-01-15T06:02:08.000Z | main.py | nhnam0209/Automatic-Render-PDF-CV | a2d971a62adfd2cbd8ffbc02c0c7c37c8d9a9908 | [
"CC0-1.0"
] | null | null | null | main.py | nhnam0209/Automatic-Render-PDF-CV | a2d971a62adfd2cbd8ffbc02c0c7c37c8d9a9908 | [
"CC0-1.0"
] | null | null | null | import json
from a_40.a_40 import fill
import time
if __name__ == '__main__':
s = time.time()
with open("cv.json", encoding="utf8") as f:
data = json.load(f)
fill(data)
| 21 | 47 | 0.62963 | import json
from a_40.a_40 import fill
import time
if __name__ == '__main__':
s = time.time()
with open("cv.json", encoding="utf8") as f:
data = json.load(f)
fill(data)
| true | true |
1c3047312aa578da327c332ab9e4e7611547e93b | 1,561 | py | Python | uvclite/test.py | worldcom-exchange/uvclite | 5fac35153faa42c712ab0f8488f6b343d3c3469e | [
"Apache-2.0"
] | 5 | 2018-04-11T08:32:55.000Z | 2021-11-26T13:56:39.000Z | uvclite/test.py | worldcom-exchange/uvclite | 5fac35153faa42c712ab0f8488f6b343d3c3469e | [
"Apache-2.0"
] | null | null | null | uvclite/test.py | worldcom-exchange/uvclite | 5fac35153faa42c712ab0f8488f6b343d3c3469e | [
"Apache-2.0"
] | 5 | 2018-11-13T18:17:18.000Z | 2021-11-26T13:56:41.000Z | #!/usr/bin/python
# Copyright 2017 Eric Callahan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.934783 | 74 | 0.649584 |
from __future__ import print_function
import uvclite
if __name__ == '__main__':
with uvclite.UVCContext() as context:
devlist = context.get_device_list()
print(len(devlist))
for dev in devlist:
devdesc = dev.get_device_descriptor()
print("Ve... | true | true |
1c304913101c17c5d6a2c699cd1001acac57a3be | 2,195 | py | Python | benchmarks/bench_dispatch.py | abitrolly/numba-benchmark | 4bea9c23276fd0399df26452d19f13810a6496c7 | [
"BSD-2-Clause"
] | 6 | 2015-10-19T09:18:50.000Z | 2021-11-29T10:37:10.000Z | benchmarks/bench_dispatch.py | abitrolly/numba-benchmark | 4bea9c23276fd0399df26452d19f13810a6496c7 | [
"BSD-2-Clause"
] | 9 | 2015-03-03T09:50:56.000Z | 2021-10-13T08:34:06.000Z | benchmarks/bench_dispatch.py | abitrolly/numba-benchmark | 4bea9c23276fd0399df26452d19f13810a6496c7 | [
"BSD-2-Clause"
] | 7 | 2015-09-09T17:38:11.000Z | 2021-09-24T15:06:19.000Z | """
Benchmarks for argument dispatching and call overhead of ``@jit`` functions.
"""
import numpy as np
rec_dtype = np.dtype([('a', np.float64),
('b', np.int32),
('c', np.complex64),
])
samples = {
'bool': True,
'int': 100000,
'float': ... | 24.120879 | 77 | 0.598633 |
import numpy as np
rec_dtype = np.dtype([('a', np.float64),
('b', np.int32),
('c', np.complex64),
])
samples = {
'bool': True,
'int': 100000,
'float': 0.5,
'complex': 0.5 + 1.0j,
'array_1d': np.zeros(10, dtype=np.int64),
'ar... | true | true |
1c304943b771fde4e13df8b6570f2d00195a8af1 | 425 | py | Python | chat/management/commands/init_db.py | moustaphacheikh/pychat | 05a8b255efda03840a9ce8d39a9ee1d38b87ea67 | [
"MIT"
] | null | null | null | chat/management/commands/init_db.py | moustaphacheikh/pychat | 05a8b255efda03840a9ce8d39a9ee1d38b87ea67 | [
"MIT"
] | null | null | null | chat/management/commands/init_db.py | moustaphacheikh/pychat | 05a8b255efda03840a9ce8d39a9ee1d38b87ea67 | [
"MIT"
] | null | null | null | __author__ = 'andrew'
from django.core.management import call_command, BaseCommand
class Command(BaseCommand):
help = 'Creates the database'
def handle(self, *args, **options):
#Django 1.6 South
#python manage.py schemamigration chat $1 --initial
#python manage.py syncdb --all
#python manage.py migrate --f... | 28.333333 | 60 | 0.731765 | __author__ = 'andrew'
from django.core.management import call_command, BaseCommand
class Command(BaseCommand):
help = 'Creates the database'
def handle(self, *args, **options):
call_command('makemigrations', 'chat')
call_command('migrate', 'auth')
| true | true |
1c304975a7a8fa4927bdb739b63ca2b5b5170682 | 12,149 | py | Python | marcottimls/etl/statistics.py | soccermetrics/marcotti-mls | 84c6d0d619c1a0c70dc6602074a3c5227959803c | [
"MIT"
] | 3 | 2016-08-04T10:34:01.000Z | 2019-03-05T23:22:06.000Z | marcottimls/etl/statistics.py | soccermetrics/marcotti-mls | 84c6d0d619c1a0c70dc6602074a3c5227959803c | [
"MIT"
] | null | null | null | marcottimls/etl/statistics.py | soccermetrics/marcotti-mls | 84c6d0d619c1a0c70dc6602074a3c5227959803c | [
"MIT"
] | null | null | null | import logging
from marcottimls.etl.base import SeasonalDataIngest
from marcottimls.models import *
logger = logging.getLogger(__name__)
class PlayerMinuteIngest(SeasonalDataIngest):
"""
Ingestion methods for data files containing player minutes.
"""
BATCH_SIZE = 50
def parse_file(self, r... | 44.339416 | 114 | 0.610009 | import logging
from marcottimls.etl.base import SeasonalDataIngest
from marcottimls.models import *
logger = logging.getLogger(__name__)
class PlayerMinuteIngest(SeasonalDataIngest):
BATCH_SIZE = 50
def parse_file(self, rows):
inserts = 0
insertion_list = []
logger.info("Inges... | true | true |
1c3049775724c20b93d2f960b2c315767c18f81b | 107 | py | Python | ChillProger/views.py | PhillKroger/ChillProger | 238348e83f199c6591a75cefec9591d977712a14 | [
"MIT"
] | null | null | null | ChillProger/views.py | PhillKroger/ChillProger | 238348e83f199c6591a75cefec9591d977712a14 | [
"MIT"
] | null | null | null | ChillProger/views.py | PhillKroger/ChillProger | 238348e83f199c6591a75cefec9591d977712a14 | [
"MIT"
] | null | null | null | from django.shortcuts import render
def home_view(request):
return render(request, 'main/main.html') | 17.833333 | 44 | 0.757009 | from django.shortcuts import render
def home_view(request):
return render(request, 'main/main.html') | true | true |
1c304a7ff78d7adceaada5123ee020405468e918 | 39,477 | py | Python | msgraph-cli-extensions/beta/calendar_beta/azext_calendar_beta/vendored_sdks/calendar/models/__init__.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/beta/calendar_beta/azext_calendar_beta/vendored_sdks/calendar/models/__init__.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/beta/calendar_beta/azext_calendar_beta/vendored_sdks/calendar/models/__init__.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 27.820296 | 94 | 0.703321 |
try:
from ._models_py3 import CollectionOfAttachment
from ._models_py3 import CollectionOfAttachment0
from ._models_py3 import CollectionOfAttachment1
from ._models_py3 import CollectionOfAttachment10
from ._models_py3 import CollectionOfAttachment2
from ._models_py3 import CollectionOfA... | true | true |
1c304aaf93f5966aee6fde13a1ac69ba893a3c51 | 8,774 | py | Python | frappe/contacts/doctype/address/address.py | Havenir/gppert-frappe | d302388ad15b36754a48c5d047d7515dad257b89 | [
"MIT"
] | null | null | null | frappe/contacts/doctype/address/address.py | Havenir/gppert-frappe | d302388ad15b36754a48c5d047d7515dad257b89 | [
"MIT"
] | 5 | 2020-07-20T01:13:34.000Z | 2022-02-10T21:49:18.000Z | frappe/contacts/doctype/address/address.py | Havenir/gppert-frappe | d302388ad15b36754a48c5d047d7515dad257b89 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import throw, _
from frappe.utils import cstr
from frappe.model.document import Document
from jinja2 import TemplateSy... | 31.224199 | 134 | 0.713928 |
from __future__ import unicode_literals
import frappe
from frappe import throw, _
from frappe.utils import cstr
from frappe.model.document import Document
from jinja2 import TemplateSyntaxError
from frappe.utils.user import is_website_user
from frappe.model.naming import make_autoname
from frappe.core.doctype.dyn... | true | true |
1c304b135783e9e7dc654907e0b2aebe5f5bcd11 | 863 | py | Python | post/migrations/0001_initial.py | Yash1256/Django-Intern | c1d42ff344324b56d462ae8c3d5b6682a2b255b6 | [
"MIT"
] | 1 | 2020-10-03T21:38:39.000Z | 2020-10-03T21:38:39.000Z | post/migrations/0001_initial.py | Yash1256/Django-Intern | c1d42ff344324b56d462ae8c3d5b6682a2b255b6 | [
"MIT"
] | 3 | 2021-04-08T19:53:55.000Z | 2021-06-10T18:45:15.000Z | post/migrations/0001_initial.py | Yash1256/Django-Intern | c1d42ff344324b56d462ae8c3d5b6682a2b255b6 | [
"MIT"
] | 1 | 2021-01-11T10:28:25.000Z | 2021-01-11T10:28:25.000Z | # Generated by Django 3.0.4 on 2020-03-06 22:37
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(aut... | 27.83871 | 114 | 0.515643 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fal... | true | true |
1c304b1d8299295e1ead2d47ec6dd4e57fee0493 | 920 | py | Python | tools/train_net.py | PeterouZh/pycls | 8058334801c140fa8c6f0dc29276c02f71ee054d | [
"MIT"
] | null | null | null | tools/train_net.py | PeterouZh/pycls | 8058334801c140fa8c6f0dc29276c02f71ee054d | [
"MIT"
] | null | null | null | tools/train_net.py | PeterouZh/pycls | 8058334801c140fa8c6f0dc29276c02f71ee054d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Train a classification model."""
import importlib
import pycls.core.config as config
import pycls.core.distributed... | 27.058824 | 78 | 0.767391 |
import importlib
import pycls.core.config as config
import pycls.core.distributed as dist
import pycls.core.trainer as trainer
from pycls.core.config import cfg
from template_lib.v2.config import global_cfg
from template_lib.d2.utils import D2Utils
def main():
config.load_cfg_fom_args("Train a classificat... | true | true |
1c304b23fc86014316f65986beeb37440af6a5df | 9,744 | py | Python | tests/test_building.py | jlitzingerdev/mqttpacket | d6fbb84ef24c5c5bc9798692206e074a2dbf3af6 | [
"MIT"
] | null | null | null | tests/test_building.py | jlitzingerdev/mqttpacket | d6fbb84ef24c5c5bc9798692206e074a2dbf3af6 | [
"MIT"
] | 1 | 2021-06-01T22:38:18.000Z | 2021-06-01T22:38:18.000Z | tests/test_building.py | jlitzingerdev/mqttpacket | d6fbb84ef24c5c5bc9798692206e074a2dbf3af6 | [
"MIT"
] | 1 | 2020-03-15T03:57:21.000Z | 2020-03-15T03:57:21.000Z | # -*- coding: utf-8 -*-
"""
Copyright 2018 Jason Litzinger
See LICENSE for details.
"""
import binascii
import json
import six
import pytest
import mqttpacket.v311 as mqttpacket
def test_connect_basic():
"""
A connect packet with only a client id is properly constructed.
"""
expect = binascii.unhexl... | 24.606061 | 77 | 0.604475 |
import binascii
import json
import six
import pytest
import mqttpacket.v311 as mqttpacket
def test_connect_basic():
expect = binascii.unhexlify(
b'101000044d5154540402003c000474657374'
)
packet = mqttpacket.connect(u'test')
assert packet == expect
assert isinstance(packet, bytes)
as... | true | true |
1c304b2e446caeea09fe4f3238f2f4808c2013b4 | 1,980 | py | Python | src/bnn_priors/bnn_priors/data/UCI/uci.py | activatedgeek/uncertainty-da-bayesian-classification | a270fb095f4790dea15327145897d09d0ba9c80b | [
"Apache-2.0"
] | 31 | 2021-02-16T09:35:03.000Z | 2022-03-31T17:18:54.000Z | src/bnn_priors/bnn_priors/data/UCI/uci.py | activatedgeek/understanding-bayesian-classification | a270fb095f4790dea15327145897d09d0ba9c80b | [
"Apache-2.0"
] | 1 | 2021-05-10T15:25:48.000Z | 2021-05-10T15:25:48.000Z | src/bnn_priors/bnn_priors/data/UCI/uci.py | activatedgeek/understanding-bayesian-classification | a270fb095f4790dea15327145897d09d0ba9c80b | [
"Apache-2.0"
] | 4 | 2021-02-21T03:38:00.000Z | 2021-12-24T15:13:29.000Z | import os
import torch as t
import numpy as np
from torch.utils.data import TensorDataset
from bnn_priors.data import Dataset
__all__ = ('UCI',)
class UCI:
"""
The usage is:
```
uci = UCIDataset("protein", 3)
```
e.g. normalized training dataset:
```
uci.norm.train
```
"""
... | 33 | 93 | 0.644949 | import os
import torch as t
import numpy as np
from torch.utils.data import TensorDataset
from bnn_priors.data import Dataset
__all__ = ('UCI',)
class UCI:
def __init__(self, dataset, split, dtype='float32', device="cpu"):
_ROOT = os.path.abspath(os.path.dirname(__file__))
dataset_dir = f'{_ROOT... | true | true |
1c304cfde2e518bcc04299a8cd1038af217984de | 3,939 | py | Python | python_data/fintech/basic_utils.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | python_data/fintech/basic_utils.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | python_data/fintech/basic_utils.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | # https://github.com/orgs/tmrwh/teams/fintech/repositories
# anubis_application_service anubis_decision_service anubis_result_service anubis_status_service: 这四个是决策引擎和业务系统交互附属包
# ice_core: 决策引擎
# feature_lib: 特征计算逻辑库
# feature_bank: 离线刷特征工具
# tethys: 数据获取特征框架
# themis: 特征计算调度框架
# lambda_core: 对外请求数据接口整合
# amon: 离线模型训练工具... | 27.354167 | 116 | 0.562325 |
import sys
import os
import traceback
import socket
import time
import urllib
import json
import datetime
import re
def get_good_contacts(contacts):
num_map = {}
good_contacts = []
for c in contacts:
if c.name.isdigit():
continue
if len(c.phone) <= 6:
... | true | true |
1c304eca5d99b8ec648c996cba5a70c52485321d | 285 | py | Python | test/magellan_focus_surface.py | ilyasdc/pycro-manager | 5f0153e8a90104eb8715348c6eb22c4d8fdee477 | [
"BSD-3-Clause"
] | 88 | 2020-05-08T16:54:24.000Z | 2022-03-09T01:03:04.000Z | test/magellan_focus_surface.py | ilyasdc/pycro-manager | 5f0153e8a90104eb8715348c6eb22c4d8fdee477 | [
"BSD-3-Clause"
] | 200 | 2020-05-15T13:21:44.000Z | 2022-03-31T17:55:23.000Z | test/magellan_focus_surface.py | ilyasdc/pycro-manager | 5f0153e8a90104eb8715348c6eb22c4d8fdee477 | [
"BSD-3-Clause"
] | 31 | 2020-04-30T03:22:50.000Z | 2022-03-19T18:00:32.000Z | from pycromanager import Bridge, Acquisition
import numpy as np
def hook_fn(event):
coordinates = np.array([event["x"], event["y"], event["z"]])
return event
# magellan example
acq = Acquisition(magellan_acq_index=0, post_hardware_hook_fn=hook_fn)
acq.await_completion()
| 19 | 70 | 0.740351 | from pycromanager import Bridge, Acquisition
import numpy as np
def hook_fn(event):
coordinates = np.array([event["x"], event["y"], event["z"]])
return event
acq = Acquisition(magellan_acq_index=0, post_hardware_hook_fn=hook_fn)
acq.await_completion()
| true | true |
1c304f0ffe61e37c164dc36801f09525d665b7ab | 588 | py | Python | site/gnss_iot/urls.py | paulohenriquerosa/gnss-iot-server | 6e7ff39bc83276d6ad86121083eb48d134d00f9d | [
"MIT"
] | null | null | null | site/gnss_iot/urls.py | paulohenriquerosa/gnss-iot-server | 6e7ff39bc83276d6ad86121083eb48d134d00f9d | [
"MIT"
] | null | null | null | site/gnss_iot/urls.py | paulohenriquerosa/gnss-iot-server | 6e7ff39bc83276d6ad86121083eb48d134d00f9d | [
"MIT"
] | null | null | null |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('profile/<int:user_id>/', views.profile, name='profile'),
path('profile/devices/', views.devices, name='devices'),
path('profile/new_device/', views.new_device, name='new_device'),
path('pro... | 39.2 | 94 | 0.705782 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('profile/<int:user_id>/', views.profile, name='profile'),
path('profile/devices/', views.devices, name='devices'),
path('profile/new_device/', views.new_device, name='new_device'),
path('pro... | true | true |
1c304f488108df86cc25e7b49439df93f5c38397 | 51,772 | py | Python | retrain.py | Math-568-project/interneuron_circuits_plasticity | ded04f8da5d315d2ec18950179efa41ed4813960 | [
"MIT"
] | null | null | null | retrain.py | Math-568-project/interneuron_circuits_plasticity | ded04f8da5d315d2ec18950179efa41ed4813960 | [
"MIT"
] | null | null | null | retrain.py | Math-568-project/interneuron_circuits_plasticity | ded04f8da5d315d2ec18950179efa41ed4813960 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import pickle
from brian2 import *
from brian2tools import *
from analyse_experiment import *
from plot_Spikingmodel import *
from utils import *
RESULTS_DIR = './results'
TUNED_ORI = 1
def run_network(params):
# get parameters
p = Struct(**params)
# simul... | 38.664675 | 146 | 0.535618 |
import numpy as np
import pickle
from brian2 import *
from brian2tools import *
from analyse_experiment import *
from plot_Spikingmodel import *
from utils import *
RESULTS_DIR = './results'
TUNED_ORI = 1
def run_network(params):
p = Struct(**params)
total_simtime = p.nonplasticwarmup_simtim... | true | true |
1c304fd07c92b9666cc4f024f111acb314da5bd6 | 2,529 | py | Python | frontends/swig_python/python_rpyc_server.py | stevenybw/thrill | a2dc05035f4e24f64af0a22b60155e80843a5ba9 | [
"BSD-2-Clause"
] | 609 | 2015-08-27T11:09:24.000Z | 2022-03-28T21:34:05.000Z | frontends/swig_python/python_rpyc_server.py | tim3z/thrill | f0e5aa2326a55af3c9a92fc418f8eb8e3cf8c5fa | [
"BSD-2-Clause"
] | 109 | 2015-09-10T21:34:42.000Z | 2022-02-15T14:46:26.000Z | frontends/swig_python/python_rpyc_server.py | tim3z/thrill | f0e5aa2326a55af3c9a92fc418f8eb8e3cf8c5fa | [
"BSD-2-Clause"
] | 114 | 2015-08-27T14:54:13.000Z | 2021-12-08T07:28:35.000Z | #!/usr/bin/env python
##########################################################################
# frontends/swig_python/python_rpyc_server.py
#
# Part of Project Thrill - http://project-thrill.org
#
# Copyright (C) 2015 Timo Bingmann <tb@panthema.net>
#
# All rights reserved. Published under the BSD-2 license in the L... | 30.107143 | 77 | 0.608936 | true | true | |
1c30502cf2a178c2357083e71e9e94f53d3bb7bf | 7,654 | py | Python | infdist/optimization/agent.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | infdist/optimization/agent.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | infdist/optimization/agent.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | from copy import copy, deepcopy
from itertools import islice
import random
from .dynamic_message_tree import DynamicMessageTree
from .dynamic_models import DynamicMessageSet
from .models import MessageSet
from .message_forecast import MessageForecast
class BaseAgent:
ACT_DROP = 0
ACT_SEND = 1
ACT_NO_DECI... | 31.240816 | 76 | 0.651555 | from copy import copy, deepcopy
from itertools import islice
import random
from .dynamic_message_tree import DynamicMessageTree
from .dynamic_models import DynamicMessageSet
from .models import MessageSet
from .message_forecast import MessageForecast
class BaseAgent:
ACT_DROP = 0
ACT_SEND = 1
ACT_NO_DECI... | true | true |
1c30507f3356bafbdd5cc8cce338dc9c571a00a8 | 461 | py | Python | soane/comms/list.py | spheten/soane | b5517275b8b3fd3b2b5a19b031c98cfd45d42292 | [
"BSD-3-Clause"
] | 1 | 2021-10-03T07:13:55.000Z | 2021-10-03T07:13:55.000Z | soane/comms/list.py | spheten/soane | b5517275b8b3fd3b2b5a19b031c98cfd45d42292 | [
"BSD-3-Clause"
] | 14 | 2021-10-03T07:10:10.000Z | 2021-10-06T09:07:41.000Z | soane/comms/list.py | spheten/soane | b5517275b8b3fd3b2b5a19b031c98cfd45d42292 | [
"BSD-3-Clause"
] | null | null | null | '''
Command definition for 'list'.
'''
import click
from soane.comms._base import group
@group.command(
name = 'list',
short_help = 'List notes.',
add_help_option = False,
)
@click.argument('glob',
default = '*',
required = False,
)
@click.help_option('-h', '--help')
@click.pass_obj
def li... | 17.074074 | 42 | 0.609544 |
import click
from soane.comms._base import group
@group.command(
name = 'list',
short_help = 'List notes.',
add_help_option = False,
)
@click.argument('glob',
default = '*',
required = False,
)
@click.help_option('-h', '--help')
@click.pass_obj
def list_(book, glob):
for note in book.... | true | true |
1c30508127e48ea49a1c38482226cef7e7506fd2 | 2,257 | py | Python | docs/conf.py | atviriduomenys/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 2 | 2019-03-14T06:41:14.000Z | 2019-03-26T11:48:14.000Z | docs/conf.py | sirex/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 44 | 2019-04-05T15:52:45.000Z | 2022-03-30T07:41:33.000Z | docs/conf.py | sirex/spinta | 77a10e201f8cdc63143fce7996fd0898acb1ff58 | [
"MIT"
] | 1 | 2019-04-01T09:54:27.000Z | 2019-04-01T09:54:27.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.686567 | 79 | 0.675233 |
project = 'Spinta'
copyright = '2020-2021, Spinta Team'
author = 'Spinta Team'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
]
templates_path = ['_templates']
language = 'en'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv']
html_theme = ... | true | true |
1c3050b2b610afa08db98f5f49804dd345368fdb | 1,038 | py | Python | Answers/week1-challenge-05/shiyanlou/spiders/github.py | ruoshengyuan/louplus-dm | f1cdcc5b7447536a40c8ffee442437fb269b2c75 | [
"MIT"
] | null | null | null | Answers/week1-challenge-05/shiyanlou/spiders/github.py | ruoshengyuan/louplus-dm | f1cdcc5b7447536a40c8ffee442437fb269b2c75 | [
"MIT"
] | null | null | null | Answers/week1-challenge-05/shiyanlou/spiders/github.py | ruoshengyuan/louplus-dm | f1cdcc5b7447536a40c8ffee442437fb269b2c75 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from shiyanlou.items import ShiyanlouItem
class GithubSpider(scrapy.Spider):
name = 'github'
allowed_domains = ['github.com']
@property
def start_urls(self):
url_temp = 'https://github.com/shiyanlou?after={}&tab=repositories'
# 此参考会失效,请自行重新手动复制 af... | 35.793103 | 114 | 0.624277 |
import scrapy
from shiyanlou.items import ShiyanlouItem
class GithubSpider(scrapy.Spider):
name = 'github'
allowed_domains = ['github.com']
@property
def start_urls(self):
url_temp = 'https://github.com/shiyanlou?after={}&tab=repositories'
after = [
'',
... | true | true |
1c305105c9b9faa649ccbbdfd85ec89e21d7b263 | 1,537 | py | Python | src/spectrabuster/backends/seatease.py | eduardosprp/spectrabuster | bb75c2bc860fd5ade7414b212e63113e6fa22eab | [
"MIT"
] | null | null | null | src/spectrabuster/backends/seatease.py | eduardosprp/spectrabuster | bb75c2bc860fd5ade7414b212e63113e6fa22eab | [
"MIT"
] | 1 | 2020-11-14T16:04:23.000Z | 2020-11-14T16:04:23.000Z | src/spectrabuster/backends/seatease.py | eduardosprp/spectrabuster | bb75c2bc860fd5ade7414b212e63113e6fa22eab | [
"MIT"
] | 3 | 2020-11-14T03:27:09.000Z | 2022-01-14T09:25:22.000Z | from seatease.spectrometers import Spectrometer, list_devices
from time import sleep
features = {
"measure": True,
"correct_nl": False,
"correct_dc": False,
"temperature": False,
"int_time_limits": True,
"sat_intensity": True,
}
class Device(object):
# {{{
def __init__(self, device_ob... | 25.196721 | 78 | 0.668835 | from seatease.spectrometers import Spectrometer, list_devices
from time import sleep
features = {
"measure": True,
"correct_nl": False,
"correct_dc": False,
"temperature": False,
"int_time_limits": True,
"sat_intensity": True,
}
class Device(object):
def __init__(self, device_obj=Non... | true | true |
1c305148d374f55b3f65306302b42c446774fab6 | 15,548 | py | Python | mongomock/filtering.py | maximeLeurent/mongo_mock | 76900d82f80ee66662460a0029058f39b096bf88 | [
"BSD-3-Clause"
] | null | null | null | mongomock/filtering.py | maximeLeurent/mongo_mock | 76900d82f80ee66662460a0029058f39b096bf88 | [
"BSD-3-Clause"
] | null | null | null | mongomock/filtering.py | maximeLeurent/mongo_mock | 76900d82f80ee66662460a0029058f39b096bf88 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
import itertools
from .helpers import ObjectId, RE_TYPE
from . import OperationFailure
import numbers
import operator
import re
from sentinels import NOTHING
from six import iteritems, iterkeys, string_types
try:
from types import NoneType
except ImportError:
NoneType = type(None... | 34.551111 | 97 | 0.61159 | from datetime import datetime
import itertools
from .helpers import ObjectId, RE_TYPE
from . import OperationFailure
import numbers
import operator
import re
from sentinels import NOTHING
from six import iteritems, iterkeys, string_types
try:
from types import NoneType
except ImportError:
NoneType = type(None... | true | true |
1c305156fe152697d24331502b2aca807f21ccf5 | 2,392 | py | Python | script.py | Aaron1515/affinity-delete-opps | e5aa4daf1d863bd7c872c31277c22872084c41f9 | [
"MIT"
] | null | null | null | script.py | Aaron1515/affinity-delete-opps | e5aa4daf1d863bd7c872c31277c22872084c41f9 | [
"MIT"
] | null | null | null | script.py | Aaron1515/affinity-delete-opps | e5aa4daf1d863bd7c872c31277c22872084c41f9 | [
"MIT"
] | null | null | null | import requests
import csv
from apikeys import *
from opp_ids import *
total_count = len(opp_ids)
current_count = 0
corrected_count = 0
log_file = open("log.csv", "w")
log_file.write("Oppertunity ID, Status code, Note")
log_file.write("\n")
for each in opp_ids:
response = requests.delete("https://api.affinity.co... | 46 | 112 | 0.644649 | import requests
import csv
from apikeys import *
from opp_ids import *
total_count = len(opp_ids)
current_count = 0
corrected_count = 0
log_file = open("log.csv", "w")
log_file.write("Oppertunity ID, Status code, Note")
log_file.write("\n")
for each in opp_ids:
response = requests.delete("https://api.affinity.co... | true | true |
1c30538966065c1eab9a2b56db803daff4678a4c | 1,423 | py | Python | voltha/extensions/alarms/onu/onu_activation_fail_alarm.py | jeffvan-netsia/voltha_doc | 8af3c0e9348142ca07e849db8ce494ce66ea15f6 | [
"Apache-2.0"
] | null | null | null | voltha/extensions/alarms/onu/onu_activation_fail_alarm.py | jeffvan-netsia/voltha_doc | 8af3c0e9348142ca07e849db8ce494ce66ea15f6 | [
"Apache-2.0"
] | 3 | 2021-03-31T18:55:31.000Z | 2022-02-11T03:40:15.000Z | voltha/extensions/alarms/onu/onu_activation_fail_alarm.py | netsia/voltha_doc | 8af3c0e9348142ca07e849db8ce494ce66ea15f6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-present Adtran, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 45.903226 | 98 | 0.676037 |
from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
from voltha.extensions.alarms.adapter_alarms import AlarmBase
class OnuActivationFailAlarm(AlarmBase):
def __init__(self, alarm_mgr, onu_id, intf_id):
super(OnuActivationFailAlarm, self).__init__(alarm... | true | true |
1c305399f11dcd40a1d2fdbabac57dd9b11aff29 | 5,483 | py | Python | qiskit/providers/aer/library/__init__.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | 1 | 2020-07-14T15:32:04.000Z | 2020-07-14T15:32:04.000Z | qiskit/providers/aer/library/__init__.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/library/__init__.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 28.409326 | 77 | 0.70983 |
__all__ = [
'SaveAmplitudes',
'SaveAmplitudesSquared',
'SaveDensityMatrix',
'SaveExpectationValue',
'SaveExpectationValueVariance',
'SaveMatrixProductState',
'SaveProbabilities',
'SaveProbabilitiesDict',
'SaveStabilizer',
'SaveState',
'SaveStatevector',
'SaveS... | true | true |
1c3053e084bf6d1940bc940227a24e8501fcf2aa | 1,223 | py | Python | 02-algorithms/teleportation.py | tai271828/cookbook-cirq | 88ac7b8d1c8d3f433c2961ce226d5a517e80e0c6 | [
"BSD-3-Clause"
] | 2 | 2020-05-17T08:13:45.000Z | 2020-09-23T00:58:17.000Z | 02-algorithms/teleportation.py | tai271828/cookbook-cirq | 88ac7b8d1c8d3f433c2961ce226d5a517e80e0c6 | [
"BSD-3-Clause"
] | null | null | null | 02-algorithms/teleportation.py | tai271828/cookbook-cirq | 88ac7b8d1c8d3f433c2961ce226d5a517e80e0c6 | [
"BSD-3-Clause"
] | null | null | null | import math
import random
import cirq
def main():
circuit = cirq.Circuit()
message, alice, bob = cirq.LineQubit.range(3)
# Prepare the Bell state of Alice's and Bob's qubits
# That is, making the entangled state of them
circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)])
# Mock up the mes... | 29.119048 | 87 | 0.668847 | import math
import random
import cirq
def main():
circuit = cirq.Circuit()
message, alice, bob = cirq.LineQubit.range(3)
circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)])
circuit.append(cirq.I(message))
circuit.append([cirq.CNOT(message, alice), cirq.H(message)])
... | true | true |
1c305481bc660200af684e6b8573b46e7253a6b5 | 2,238 | py | Python | entries/day17/main.py | ZeldaZach/AdventOfCode2021 | 3eefd3dcaeb331457c4fc58866705aa6c6580830 | [
"MIT"
] | 1 | 2022-01-02T11:00:04.000Z | 2022-01-02T11:00:04.000Z | entries/day17/main.py | ZeldaZach/AdventOfCode2021 | 3eefd3dcaeb331457c4fc58866705aa6c6580830 | [
"MIT"
] | null | null | null | entries/day17/main.py | ZeldaZach/AdventOfCode2021 | 3eefd3dcaeb331457c4fc58866705aa6c6580830 | [
"MIT"
] | null | null | null | import pathlib
import re
from typing import List, Union, Tuple
def read_inputs(input_file: str) -> List[int]:
with pathlib.Path(input_file).open() as fp:
line = fp.readline()
area_regex = re.compile(r"target area: x=(-?\d+)..(-?\d+), y=(-?\d+)..(-?\d+)")
return list(map(int, area_regex.findall(li... | 27.975 | 86 | 0.652368 | import pathlib
import re
from typing import List, Union, Tuple
def read_inputs(input_file: str) -> List[int]:
with pathlib.Path(input_file).open() as fp:
line = fp.readline()
area_regex = re.compile(r"target area: x=(-?\d+)..(-?\d+), y=(-?\d+)..(-?\d+)")
return list(map(int, area_regex.findall(li... | true | true |
1c3054edcb87c40ad2dd5603ddd25890bebe93c2 | 11,856 | py | Python | Lib/fontbakery/commands/check_specification.py | Bhanditz/fontbakery | 683fcf3a69a8c0dde805a9e93cd54693c0fad590 | [
"Apache-2.0"
] | null | null | null | Lib/fontbakery/commands/check_specification.py | Bhanditz/fontbakery | 683fcf3a69a8c0dde805a9e93cd54693c0fad590 | [
"Apache-2.0"
] | null | null | null | Lib/fontbakery/commands/check_specification.py | Bhanditz/fontbakery | 683fcf3a69a8c0dde805a9e93cd54693c0fad590 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# usage:
# $ fontbakery check-specification fontbakery.specifications.googlefonts -h
import argparse
import importlib.util
import os
import sys
from collections import OrderedDict
from fontbakery.checkrunner import (
distribute_generator
, CheckRunner
, Value... | 37.878594 | 102 | 0.609565 |
import argparse
import importlib.util
import os
import sys
from collections import OrderedDict
from fontbakery.checkrunner import (
distribute_generator
, CheckRunner
, ValueValidationError
, Spec
, get_module_specification
, DEBUG
... | true | true |
1c3055259508571a6bfa3a791d078170adfa3371 | 139 | py | Python | boa3_test/test_sc/string_test/IndexString.py | CityOfZion/neo3-boa | c31fadce597abd5e0bdea76985e35c7004ab9d39 | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/string_test/IndexString.py | CityOfZion/neo3-boa | c31fadce597abd5e0bdea76985e35c7004ab9d39 | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/string_test/IndexString.py | CityOfZion/neo3-boa | c31fadce597abd5e0bdea76985e35c7004ab9d39 | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin import public
@public
def main(a: str, value: str, start: int, end: int) -> int:
return a.index(value, start, end)
| 19.857143 | 58 | 0.676259 | from boa3.builtin import public
@public
def main(a: str, value: str, start: int, end: int) -> int:
return a.index(value, start, end)
| true | true |
1c3055cfcfa3a11de3c09866da49b3354f0d6f0d | 2,551 | py | Python | tests/test_models/test_dense_heads/test_anchor_head.py | hyperlist/mmdetection | ba4918de7fb21a96edc373584fa21a17d098a843 | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_dense_heads/test_anchor_head.py | hyperlist/mmdetection | ba4918de7fb21a96edc373584fa21a17d098a843 | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_dense_heads/test_anchor_head.py | hyperlist/mmdetection | ba4918de7fb21a96edc373584fa21a17d098a843 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import paddle
from mmdet.models.dense_heads import AnchorHead
def test_anchor_head_loss():
"""Tests anchor head loss when truth is empty and non-empty."""
s = 256
img_metas = [{
'img_shape': (s, s, 3),
'scale_factor': 1,
... | 35.929577 | 79 | 0.602901 |
import mmcv
import paddle
from mmdet.models.dense_heads import AnchorHead
def test_anchor_head_loss():
s = 256
img_metas = [{
'img_shape': (s, s, 3),
'scale_factor': 1,
'pad_shape': (s, s, 3)
}]
cfg = mmcv.Config(
dict(
assigner=dict(
type... | true | true |
1c3056485d96010aa6fa7acc377a2f817a61f3c8 | 14,477 | py | Python | molbox/box.py | daico007/molbox | 0cd18b1400ef1b0e1b5331b92aeb36af3465d425 | [
"MIT"
] | 2 | 2021-06-29T16:37:24.000Z | 2021-09-15T23:18:35.000Z | molbox/box.py | daico007/molbox | 0cd18b1400ef1b0e1b5331b92aeb36af3465d425 | [
"MIT"
] | 2 | 2021-06-29T16:41:07.000Z | 2021-07-01T14:41:49.000Z | molbox/box.py | daico007/molbox | 0cd18b1400ef1b0e1b5331b92aeb36af3465d425 | [
"MIT"
] | 2 | 2021-06-28T20:57:59.000Z | 2021-06-29T16:37:28.000Z | """generic box module."""
from warnings import warn
import numpy as np
__all__ = ["Box", "BoxError"]
class BoxError(Exception):
"""Exception to be raised when there's an error in Box methods"""
class Box(object):
"""A box representing the bounds of the system.
Parameters
----------
lengths : ... | 32.977221 | 80 | 0.599641 | from warnings import warn
import numpy as np
__all__ = ["Box", "BoxError"]
class BoxError(Exception):
class Box(object):
def __init__(self, lengths, angles=None, precision=None):
if precision is not None:
self._precision = int(precision)
else:
self._precision = 6
... | true | true |
1c30571b5d87ee2f1d181f41c63368ad40e3594c | 14,116 | py | Python | Pyrlang/node.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | Pyrlang/node.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | Pyrlang/node.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, Erlang Solutions Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 38.048518 | 97 | 0.602295 |
from __future__ import print_function
import gevent
from gevent import Greenlet
from typing import Dict, Union
from Pyrlang import logger, mailbox
from Pyrlang.Term import *
from Pyrlang.Dist.distribution import ErlangDistribution
from Pyrlang.Dist.node_opts import NodeOpts
from Pyrlang.process import ... | true | true |
1c305748b52524a688ce7cff735634434032d6d5 | 7,147 | py | Python | instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py | toumorokoshi/opentelemetry-python-contrib | 7159372e3b381119715c99a37603b3d2d6b9ea46 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py | toumorokoshi/opentelemetry-python-contrib | 7159372e3b381119715c99a37603b3d2d6b9ea46 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py | toumorokoshi/opentelemetry-python-contrib | 7159372e3b381119715c99a37603b3d2d6b9ea46 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright The OpenTelemetry 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 ... | 33.553991 | 108 | 0.665454 |
import functools
import types
from urllib.request import (
OpenerDirector,
Request,
)
from opentelemetry import context
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.urllib.version import (
__version__,
)
from opentelemetry.in... | true | true |
1c305749d00f258369cbc9bc8173c8553aa12dc1 | 2,363 | py | Python | benchmark/compare/Mesa/ForestFire/model.py | Corvince/Agents.jl | 6276084756287bd0a7b1e0dc9fcf5638f9840c73 | [
"MIT"
] | null | null | null | benchmark/compare/Mesa/ForestFire/model.py | Corvince/Agents.jl | 6276084756287bd0a7b1e0dc9fcf5638f9840c73 | [
"MIT"
] | null | null | null | benchmark/compare/Mesa/ForestFire/model.py | Corvince/Agents.jl | 6276084756287bd0a7b1e0dc9fcf5638f9840c73 | [
"MIT"
] | null | null | null | from mesa import Model
from mesa import Agent
from mesa.space import Grid
from mesa.time import RandomActivation
class TreeCell(Agent):
"""
A tree cell.
Attributes:
x, y: Grid coordinates
condition: Can be "Fine", "On Fire", or "Burned Out"
unique_id: (x,y) tuple.
unique_id isn'... | 29.5375 | 81 | 0.555226 | from mesa import Model
from mesa import Agent
from mesa.space import Grid
from mesa.time import RandomActivation
class TreeCell(Agent):
def __init__(self, pos, model):
super().__init__(pos, model)
self.pos = pos
self.condition = "Fine"
def step(self):
if self.condition == "On ... | true | true |
1c305878f64477e32f999d42339c6c175de80bd6 | 7,580 | py | Python | experimental/soundwave/soundwave/dashboard_api.py | Ashish0125/Application-test | 0b642ec89bbc8de3d76b3cd782c2ae7bc0dc7bf2 | [
"BSD-3-Clause"
] | null | null | null | experimental/soundwave/soundwave/dashboard_api.py | Ashish0125/Application-test | 0b642ec89bbc8de3d76b3cd782c2ae7bc0dc7bf2 | [
"BSD-3-Clause"
] | null | null | null | experimental/soundwave/soundwave/dashboard_api.py | Ashish0125/Application-test | 0b642ec89bbc8de3d76b3cd782c2ae7bc0dc7bf2 | [
"BSD-3-Clause"
] | 1 | 2020-07-24T04:42:31.000Z | 2020-07-24T04:42:31.000Z | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import httplib2
import json
import logging
import oauth2client.client
import oauth2client.file
from oauth2client import service_account # py... | 32.532189 | 80 | 0.683905 |
import datetime
import httplib2
import json
import logging
import oauth2client.client
import oauth2client.file
from oauth2client import service_account
import oauth2client.tools
import os
import urllib
from py_utils import retry_util
class RequestError(OSError):
def __init__(self, request, response, conten... | true | true |
1c305941578efa97a3feb50a111824a9e892608b | 833 | py | Python | back/run.py | xiaomogui/json-databook | f7909ef1dafb76c719521cfddfdaccf847723fec | [
"Apache-2.0"
] | null | null | null | back/run.py | xiaomogui/json-databook | f7909ef1dafb76c719521cfddfdaccf847723fec | [
"Apache-2.0"
] | null | null | null | back/run.py | xiaomogui/json-databook | f7909ef1dafb76c719521cfddfdaccf847723fec | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request
from flask_cors import CORS
from routes.WorkspaceRoute import workspaceRoute
from routes.BookshelfRoute import bookshelfRoute
from routes.DatabookRoute import databookRoute
app = Flask(__name__)
app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
CORS(app, resources=r'/*')
@app.r... | 23.138889 | 56 | 0.729892 | from flask import Flask, request
from flask_cors import CORS
from routes.WorkspaceRoute import workspaceRoute
from routes.BookshelfRoute import bookshelfRoute
from routes.DatabookRoute import databookRoute
app = Flask(__name__)
app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
CORS(app, resources=r'/*')
@app.r... | true | true |
1c30595d970ec0fefb3b06125454384f8076b5fb | 1,758 | py | Python | internal/notes/builtin-SAVE/packages/py-unittest2py3k/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/py-unittest2py3k/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/py-unittest2py3k/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 43.95 | 91 | 0.683163 | true | true | |
1c3059b8ba36df157f1ad186193f2fa5012b7dbb | 2,845 | py | Python | experiments/murtaza/off_policy_ssl/gym/hopper/bc.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/murtaza/off_policy_ssl/gym/hopper/bc.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/murtaza/off_policy_ssl/gym/hopper/bc.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | from railrl.torch.sac.policies import GaussianPolicy
from railrl.launchers.experiments.ashvin.awr_sac_rl import experiment
from railrl.launchers.launcher_util import run_experiment
import railrl.misc.hyperparameter as hyp
if __name__ == "__main__":
variant = dict(
num_epochs=0,
num_eval_steps_per_e... | 29.635417 | 72 | 0.572935 | from railrl.torch.sac.policies import GaussianPolicy
from railrl.launchers.experiments.ashvin.awr_sac_rl import experiment
from railrl.launchers.launcher_util import run_experiment
import railrl.misc.hyperparameter as hyp
if __name__ == "__main__":
variant = dict(
num_epochs=0,
num_eval_steps_per_e... | true | true |
1c305a1689fab06136f359666ffcc90fcdfad923 | 218 | py | Python | pypro/videos/urls.py | rodrigoddc/django-advanced-course | 098507d8111f38f8a6b914575e50861538913f6c | [
"MIT"
] | 1 | 2020-06-30T01:30:31.000Z | 2020-06-30T01:30:31.000Z | pypro/videos/urls.py | rodrigoddc/django-advanced-course | 098507d8111f38f8a6b914575e50861538913f6c | [
"MIT"
] | 102 | 2020-06-30T01:03:27.000Z | 2021-09-22T19:26:44.000Z | pypro/videos/urls.py | rodrigoddc/django-advanced-course | 098507d8111f38f8a6b914575e50861538913f6c | [
"MIT"
] | null | null | null | from django.urls import path
from .views import video_render, video_list
app_name = 'videos'
urlpatterns = [
path('', video_list, name='video_list'),
path('<slug:slug>/', video_render, name='video_render'),
]
| 24.222222 | 60 | 0.706422 | from django.urls import path
from .views import video_render, video_list
app_name = 'videos'
urlpatterns = [
path('', video_list, name='video_list'),
path('<slug:slug>/', video_render, name='video_render'),
]
| true | true |
1c305b37c58edcfc78fee46b861ad540bdec2eff | 14,296 | py | Python | tests/bugs/core_2493_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_2493_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_2493_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_2493
# title: Append the IP address of the remote host to error messages in firebird.log for TCP connections
# decription:
# Following actions are performed by this test:
#
# 1. Obtain current firebird.log and saves ... | 45.674121 | 165 | 0.55617 |
#
# 3. Kill launched ISQL process after several seconds. At this point new message must appear in firebird.log and it MUST
# be in format described in the ticket. Because this abend will be detected by SERVER, format of message will be like this:
# ... | true | true |
1c305c2d921ec67d21b2635b4f22173edf4c7a40 | 3,409 | py | Python | tests/theanolm/recurrentstate_test.py | vasuneralla/theanolm | 51fbd89082ca3ea5d0178d09b744cf15c0113ab6 | [
"Apache-2.0"
] | 95 | 2016-01-16T16:18:13.000Z | 2022-01-25T16:31:29.000Z | tests/theanolm/recurrentstate_test.py | nd1511/theanolm | 9eda655ed63e8906234e62ab7da016e64e931afe | [
"Apache-2.0"
] | 43 | 2015-10-16T08:49:26.000Z | 2020-10-12T07:17:04.000Z | tests/theanolm/recurrentstate_test.py | nd1511/theanolm | 9eda655ed63e8906234e62ab7da016e64e931afe | [
"Apache-2.0"
] | 37 | 2016-03-25T23:21:54.000Z | 2020-11-05T11:21:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
import math
import numpy
from numpy.testing import assert_equal
from theanolm.network import RecurrentState
class TestRecurrentState(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_init(self):
... | 39.639535 | 95 | 0.61983 |
import unittest
import math
import numpy
from numpy.testing import assert_equal
from theanolm.network import RecurrentState
class TestRecurrentState(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_init(self):
state = RecurrentState([200, 100, 300],... | true | true |
1c305cc64a034db53b5866f7d0d85806c73acbfd | 1,700 | py | Python | app/portal/horizon/openstack_dashboard/dashboards/identity/users/urls.py | haoshen61/f5-adcaas-openstack | 4bda29271930bf7c621f4184bda8d43b2fa96336 | [
"Apache-2.0"
] | 37 | 2018-10-30T02:47:24.000Z | 2021-12-04T10:29:40.000Z | openstack_dashboard/dashboards/identity/users/urls.py | nyzsirt/horizon | 53dd2dbd39c50b665ebe2d2a877496169f01a13f | [
"Apache-2.0"
] | 106 | 2019-01-18T03:06:55.000Z | 2019-11-29T05:06:18.000Z | openstack_dashboard/dashboards/identity/users/urls.py | nyzsirt/horizon | 53dd2dbd39c50b665ebe2d2a877496169f01a13f | [
"Apache-2.0"
] | 35 | 2018-11-26T03:36:31.000Z | 2021-12-04T10:29:41.000Z | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | 37.777778 | 78 | 0.687059 |
from django.conf import settings
from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.identity.users import views
if settings.ANGULAR_FEATURES.get('users_panel', False):
... | true | true |
1c305d425e27330d2aa3609c94420ecd795e84a1 | 881 | py | Python | LeetCode/2019-01-22-209-Minimum-Size-Subarray-Sum.py | HeRuivio/-Algorithm | 1fbe6256630758fda3af68f469471ee246730afc | [
"MIT"
] | 5 | 2018-10-30T05:07:32.000Z | 2019-06-18T08:11:38.000Z | LeetCode/2019-01-22-209-Minimum-Size-Subarray-Sum.py | HeRuivio/-Algorithm | 1fbe6256630758fda3af68f469471ee246730afc | [
"MIT"
] | 1 | 2020-05-09T09:05:16.000Z | 2020-05-09T09:05:16.000Z | LeetCode/2019-01-22-209-Minimum-Size-Subarray-Sum.py | HeRuivio/-Algorithm | 1fbe6256630758fda3af68f469471ee246730afc | [
"MIT"
] | 2 | 2020-05-09T09:02:22.000Z | 2020-12-09T13:23:00.000Z | # -*- coding: utf-8 -*-
# @Author: 何睿
# @Create Date: 2019-01-22 11:37:16
# @Last Modified by: 何睿
# @Last Modified time: 2019-01-22 11:37:16
import sys
class Solution:
def minSubArrayLen(self, s, nums):
"""
:type s: int
:type nums: List[int]
:rtype: int
... | 26.69697 | 54 | 0.466515 |
import sys
class Solution:
def minSubArrayLen(self, s, nums):
length = sys.maxsize
_sum, left, right = 0, 0, 0
while right < len(nums):
_sum += nums[right]
if _sum >= s:
while _sum >= s and left <= right:
... | true | true |
1c305d726d065f431ad67bbbb2f5919cb49ed614 | 15,133 | py | Python | nova/tests/unit/scheduler/test_scheduler_utils.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 5 | 2017-06-23T07:37:39.000Z | 2020-10-21T07:07:50.000Z | nova/tests/unit/scheduler/test_scheduler_utils.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/scheduler/test_scheduler_utils.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 4 | 2017-06-23T07:37:43.000Z | 2020-12-28T09:57:22.000Z | # Copyright (c) 2013 Rackspace Hosting
# 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 req... | 42.508427 | 78 | 0.58574 |
import contextlib
import uuid
import mock
from mox3 import mox
from oslo_config import cfg
from nova.compute import flavors
from nova.compute import utils as compute_utils
from nova import db
from nova import exception
from nova import notifications
from nova import objects
from nova import rpc
from nov... | true | true |
1c305da171d9418019b885143f595ffe0a236515 | 33,113 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.944193 | 223 | 0.671156 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
1c305ddb001f13daeb09fafa14c1e6e04627c7cf | 484 | py | Python | nnfs/initializers/he.py | akshaykurmi/neural-networks-from-scratch | 54d62d9f5adb102d14267a922a515fa79bf52bd6 | [
"MIT"
] | 2 | 2019-09-13T22:31:21.000Z | 2020-11-28T18:51:14.000Z | nnfs/initializers/he.py | akshaykurmi/neural-networks-from-scratch | 54d62d9f5adb102d14267a922a515fa79bf52bd6 | [
"MIT"
] | null | null | null | nnfs/initializers/he.py | akshaykurmi/neural-networks-from-scratch | 54d62d9f5adb102d14267a922a515fa79bf52bd6 | [
"MIT"
] | null | null | null | import numpy as np
class HeUniform:
@staticmethod
def initialize(shape):
fan_in = shape[0] if len(shape) == 2 else shape[1] * np.prod(shape[2:])
scale = np.sqrt(6.0 / fan_in)
return np.random.uniform(-scale, scale, shape)
class HeNormal:
@staticmethod
def initialize(shape):
... | 26.888889 | 79 | 0.609504 | import numpy as np
class HeUniform:
@staticmethod
def initialize(shape):
fan_in = shape[0] if len(shape) == 2 else shape[1] * np.prod(shape[2:])
scale = np.sqrt(6.0 / fan_in)
return np.random.uniform(-scale, scale, shape)
class HeNormal:
@staticmethod
def initialize(shape):
... | true | true |
1c305e22ccc0b03111e13cb76675f569b49a53b8 | 13,509 | py | Python | detectron2_repo/evaluation/lvis_evaluation.py | JaninaMattes/detectron2_dla | da9b0925eb280a208e7837986f7cf79779d3ca61 | [
"Apache-2.0"
] | null | null | null | detectron2_repo/evaluation/lvis_evaluation.py | JaninaMattes/detectron2_dla | da9b0925eb280a208e7837986f7cf79779d3ca61 | [
"Apache-2.0"
] | null | null | null | detectron2_repo/evaluation/lvis_evaluation.py | JaninaMattes/detectron2_dla | da9b0925eb280a208e7837986f7cf79779d3ca61 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import copy
import itertools
import json
import logging
import os
import pickle
from collections import OrderedDict
import torch
from fvcore.common.file_io import PathManager
import detectron2.utils.comm as comm
from detectron2.data imp... | 39.615836 | 151 | 0.596343 |
import copy
import itertools
import json
import logging
import os
import pickle
from collections import OrderedDict
import torch
from fvcore.common.file_io import PathManager
import detectron2.utils.comm as comm
from detectron2.data import MetadataCatalog
from detectron2.structures import Boxes, BoxMode, ... | true | true |
1c305e7fe75eb05d9cde1edd8ef861a1997b68b6 | 7,486 | py | Python | xrspatial/curvature.py | brendancol/xarray-spatial | 36d53b75086b760cab5100a12fcbda946dd85a25 | [
"MIT"
] | null | null | null | xrspatial/curvature.py | brendancol/xarray-spatial | 36d53b75086b760cab5100a12fcbda946dd85a25 | [
"MIT"
] | null | null | null | xrspatial/curvature.py | brendancol/xarray-spatial | 36d53b75086b760cab5100a12fcbda946dd85a25 | [
"MIT"
] | null | null | null | # std lib
from functools import partial
from typing import Union
from typing import Optional
# 3rd-party
try:
import cupy
except ImportError:
class cupy(object):
ndarray = False
import dask.array as da
from numba import cuda
import numpy as np
import xarray as xr
# local modules
from xrspatial.util... | 34.027273 | 120 | 0.558376 |
from functools import partial
from typing import Union
from typing import Optional
try:
import cupy
except ImportError:
class cupy(object):
ndarray = False
import dask.array as da
from numba import cuda
import numpy as np
import xarray as xr
from xrspatial.utils import cuda_args
from xrspatial.u... | true | true |
1c305e90a5c508127a5d8e97db379d8499158f06 | 4,203 | py | Python | sp_api/api/products/models/points.py | lionsdigitalsolutions/python-amazon-sp-api | 7374523ebc65e2e01e37d03fc4009a44fabf2c3b | [
"MIT"
] | null | null | null | sp_api/api/products/models/points.py | lionsdigitalsolutions/python-amazon-sp-api | 7374523ebc65e2e01e37d03fc4009a44fabf2c3b | [
"MIT"
] | null | null | null | sp_api/api/products/models/points.py | lionsdigitalsolutions/python-amazon-sp-api | 7374523ebc65e2e01e37d03fc4009a44fabf2c3b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Selling Partner API for Pricing
The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. # noqa: E501
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.g... | 30.021429 | 160 | 0.59743 |
import pprint
import re
import six
class Points(object):
swagger_types = {
'points_number': 'int',
'points_monetary_value': 'MoneyType'
}
attribute_map = {
'points_number': 'PointsNumber',
'points_monetary_value': 'PointsMonetaryValue'
}
def __init__(self, p... | true | true |
1c305e9c9d6a42f7765d960f9d6a66a5c31f95e0 | 73 | py | Python | src/checksum.py | cmolinaord/bimug_drone | f263207125fd49a772b7deeccee2e54ffd88e3d9 | [
"MIT"
] | null | null | null | src/checksum.py | cmolinaord/bimug_drone | f263207125fd49a772b7deeccee2e54ffd88e3d9 | [
"MIT"
] | null | null | null | src/checksum.py | cmolinaord/bimug_drone | f263207125fd49a772b7deeccee2e54ffd88e3d9 | [
"MIT"
] | null | null | null | def checksum(str):
c = 0
for s in str:
c = c ^ ord(s)
return hex(c)
| 12.166667 | 18 | 0.561644 | def checksum(str):
c = 0
for s in str:
c = c ^ ord(s)
return hex(c)
| true | true |
1c305eb2aa507e845aefc969185000164f9214bf | 26 | py | Python | lztools/enums/RemoteTool.py | Zanzes/lztools | 4091416464cbb441f5af26ade6a03ff18ae1bf01 | [
"MIT"
] | null | null | null | lztools/enums/RemoteTool.py | Zanzes/lztools | 4091416464cbb441f5af26ade6a03ff18ae1bf01 | [
"MIT"
] | null | null | null | lztools/enums/RemoteTool.py | Zanzes/lztools | 4091416464cbb441f5af26ade6a03ff18ae1bf01 | [
"MIT"
] | null | null | null | IdentifyOS = "identify_os" | 26 | 26 | 0.807692 | IdentifyOS = "identify_os" | true | true |
1c305ed176e0c14f937447f3722fb2006126a9d6 | 4,682 | py | Python | tensor2tensor/layers/modalities_test.py | sivaramakrishna7/tensor2tensor | eb0118d3f459913133e3d68a96944480a928bff1 | [
"Apache-2.0"
] | 5 | 2019-03-28T03:52:32.000Z | 2021-02-24T07:09:26.000Z | tensor2tensor/layers/modalities_test.py | sivaramakrishna7/tensor2tensor | eb0118d3f459913133e3d68a96944480a928bff1 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/layers/modalities_test.py | sivaramakrishna7/tensor2tensor | eb0118d3f459913133e3d68a96944480a928bff1 | [
"Apache-2.0"
] | 2 | 2018-08-07T03:43:09.000Z | 2019-12-09T06:41:40.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 39.016667 | 78 | 0.709099 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensor2tensor.layers import common_hparams
from tensor2tensor.layers import modalities
from tensor2tensor.utils import expert_utils
import tensorflow as tf
class Mod... | true | true |
1c305f188374ce49ca2ce60915aa41c9f776411f | 1,145 | py | Python | game/views.py | nfielder/zero-score-game | 61433e4348cc6dbfbe137901da08f896cd2afa58 | [
"MIT"
] | null | null | null | game/views.py | nfielder/zero-score-game | 61433e4348cc6dbfbe137901da08f896cd2afa58 | [
"MIT"
] | 6 | 2021-03-19T07:21:06.000Z | 2021-09-23T06:22:05.000Z | game/views.py | nfielder/zero-score-game | 61433e4348cc6dbfbe137901da08f896cd2afa58 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse
from django.views import generic
from .models import Quiz, Question, Answer
class IndexView(generic.ListView):
template_name = 'game/index.html'
def get_queryset(self):
"""Return all quizzes."""
retur... | 30.131579 | 86 | 0.699563 | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse
from django.views import generic
from .models import Quiz, Question, Answer
class IndexView(generic.ListView):
template_name = 'game/index.html'
def get_queryset(self):
return Quiz.objects.all()
class QuizV... | true | true |
1c305f48451238b0c7e8bd931f7965ead76b5b64 | 163 | py | Python | bin/cubes/pentacubes-octagonal-frame-1.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/cubes/pentacubes-octagonal-frame-1.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/cubes/pentacubes-octagonal-frame-1.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | 1 | 2022-01-02T16:54:14.000Z | 2022-01-02T16:54:14.000Z | #!/usr/bin/env python
# $Id$
"""many solutions"""
import puzzler
from puzzler.puzzles.pentacubes import PentacubesOctagonalFrame1 as puzzle
puzzler.run(puzzle)
| 16.3 | 74 | 0.773006 |
import puzzler
from puzzler.puzzles.pentacubes import PentacubesOctagonalFrame1 as puzzle
puzzler.run(puzzle)
| true | true |
1c3060cbc2ffeea68a73ad257f383f7121f03ac3 | 3,479 | py | Python | run/run_dpgan.py | vab10266/VaudsTextGans | 7b2e32b13cc4e03d12a0bd9753beee7c20c94d01 | [
"MIT"
] | null | null | null | run/run_dpgan.py | vab10266/VaudsTextGans | 7b2e32b13cc4e03d12a0bd9753beee7c20c94d01 | [
"MIT"
] | null | null | null | run/run_dpgan.py | vab10266/VaudsTextGans | 7b2e32b13cc4e03d12a0bd9753beee7c20c94d01 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author : William
# @Project : TextGAN-william
# @FileName : run_seqgan.py
# @Time : Created at 2019-05-27
# @Blog : http://zhiweil.ml/
# @Description :
# Copyrights (C) 2018. All Rights Reserved.
import sys
from subprocess import call
import os
# Job id and ... | 24.5 | 107 | 0.649037 |
import sys
from subprocess import call
import os
if len(sys.argv) > 2:
job_id = int(sys.argv[1])
gpu_id = str(sys.argv[2])
print('job_id: {}, gpu_id: {}'.format(job_id, gpu_id))
elif len(sys.argv) > 1:
job_id = int(sys.argv[1])
gpu_id = 0
print('job_id: {}, missing gpu_id (use defaul... | true | true |
1c30615b4a746379de40cc792bf7d00df1e3b945 | 4,068 | py | Python | examples/streaming_transducer/test_subword_streaming_transducer.py | Honghe/TensorFlowASR | ade78916987b6a61642b650cc10d259aeeb1d92e | [
"Apache-2.0"
] | 1 | 2020-10-20T11:42:08.000Z | 2020-10-20T11:42:08.000Z | examples/streaming_transducer/test_subword_streaming_transducer.py | dathudeptrai/TensorFlowASR | 72cd5d2b932d66ddd61e79ab41bb0d64cb8c4919 | [
"Apache-2.0"
] | null | null | null | examples/streaming_transducer/test_subword_streaming_transducer.py | dathudeptrai/TensorFlowASR | 72cd5d2b932d66ddd61e79ab41bb0d64cb8c4919 | [
"Apache-2.0"
] | 1 | 2021-10-16T22:40:42.000Z | 2021-10-16T22:40:42.000Z | # Copyright 2020 Huy Le Nguyen (@usimarit)
#
# 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 t... | 37.321101 | 95 | 0.753933 |
import os
import argparse
from tensorflow_asr.utils import setup_environment, setup_devices
setup_environment()
import tensorflow as tf
DEFAULT_YAML = os.path.join(os.path.abspath(os.path.dirname(__file__)), "config.yml")
tf.keras.backend.clear_session()
parser = argparse.ArgumentParser(prog="Conforme... | true | true |
1c306167ab64945efeb97233d525330dcef2b1e6 | 851 | py | Python | more.py | salisu14/python-tut | 4defc38924e064657daa46647e8979cde733f9f4 | [
"MIT"
] | 5 | 2021-04-16T01:29:21.000Z | 2021-12-24T10:03:54.000Z | more.py | salisu14/python-tut | 4defc38924e064657daa46647e8979cde733f9f4 | [
"MIT"
] | null | null | null | more.py | salisu14/python-tut | 4defc38924e064657daa46647e8979cde733f9f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import threading
from datetime import date
from datetime import time
from datetime import datetime
# for i in range(65, 91):
# print(f'{chr(i)} = {i}')
# letters = ['A', 'B', 'C']
# for l in letters:
# print(f'{l} = {ord(l)}')
# alpha = [x for x in range(65, 91)]
# for a in alpha... | 17.367347 | 68 | 0.615746 |
import threading
from datetime import date
from datetime import time
from datetime import datetime
def gfg():
print('Welcome to timer')
timer = threading.Timer(10000.0, gfg)
timer.start()
print('.', end='')
print("Cancelling timer\n")
timer.cancel()
print('Exit\n')
try:
date_str = i... | true | true |
1c3061b7d89899b458899d56cf3afd2c5976e3f7 | 858 | py | Python | flaskapp/app.py | zbouslama/open_maps | 26f0c8e64cf9fe28e24a05fae5c10cb3de38cf54 | [
"MIT"
] | null | null | null | flaskapp/app.py | zbouslama/open_maps | 26f0c8e64cf9fe28e24a05fae5c10cb3de38cf54 | [
"MIT"
] | 3 | 2018-05-07T21:28:40.000Z | 2018-05-07T21:31:23.000Z | flaskapp/app.py | zbouslama/open_maps | 26f0c8e64cf9fe28e24a05fae5c10cb3de38cf54 | [
"MIT"
] | 4 | 2018-04-20T10:14:10.000Z | 2018-05-11T12:59:16.000Z | from flask import Flask, render_template,request, jsonify
from data import Articles
import pandas as pd
app = Flask (__name__)
Articles= Articles()
@app.route('/')
def index():
return render_template ('home.html')
@app.route('/about')
def about ():
return render_template ('about.html')
@app.route('/articles'... | 20.428571 | 69 | 0.659674 | from flask import Flask, render_template,request, jsonify
from data import Articles
import pandas as pd
app = Flask (__name__)
Articles= Articles()
@app.route('/')
def index():
return render_template ('home.html')
@app.route('/about')
def about ():
return render_template ('about.html')
@app.route('/articles'... | true | true |
1c30629c59327e19ebbf9c332c541f043500aef2 | 8,776 | py | Python | satflow/models/conv_lstm.py | mfrasco/satflow | 2e56b46dfd81a05670c6d2b1bda8c9eec38301a7 | [
"MIT"
] | null | null | null | satflow/models/conv_lstm.py | mfrasco/satflow | 2e56b46dfd81a05670c6d2b1bda8c9eec38301a7 | [
"MIT"
] | null | null | null | satflow/models/conv_lstm.py | mfrasco/satflow | 2e56b46dfd81a05670c6d2b1bda8c9eec38301a7 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Union
import pytorch_lightning as pl
import torch
import torch.nn as nn
import numpy as np
from nowcasting_utils.models.base import register_model
from nowcasting_utils.models.loss import get_loss
from satflow.models.layers.ConvLSTM import ConvLSTMCell
import torchvision
@register_mod... | 37.991342 | 120 | 0.592183 | from typing import Any, Dict, Union
import pytorch_lightning as pl
import torch
import torch.nn as nn
import numpy as np
from nowcasting_utils.models.base import register_model
from nowcasting_utils.models.loss import get_loss
from satflow.models.layers.ConvLSTM import ConvLSTMCell
import torchvision
@register_mod... | true | true |
1c3062baff364bcff6794e9cf5af2e1815c2aa40 | 7,095 | py | Python | lte/gateway/python/magma/mobilityd/ip_allocator_dhcp.py | Milind-Blaze/magma | b54257e997ad55781752e644e62efe9a7cca4501 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/mobilityd/ip_allocator_dhcp.py | Milind-Blaze/magma | b54257e997ad55781752e644e62efe9a7cca4501 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/mobilityd/ip_allocator_dhcp.py | Milind-Blaze/magma | b54257e997ad55781752e644e62efe9a7cca4501 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 31.959459 | 82 | 0.622974 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import logging
from copy import deepcopy
from ipaddress import ip_address, ip_network
from threading import Condition
from typing import List
from magma.mobilityd.ip_descriptor import IPDesc, IPState, IPType
from... | true | true |
1c3062d47ecc1550f5535f38c0e344d751d76367 | 8,920 | py | Python | HARNN/test_harnn.py | TownShaw/Hierarchical-Multi-Label-Text-Classification | e7d0f8d29b8c7b37b951c547b62b9655011fb0be | [
"Apache-2.0"
] | 225 | 2019-09-06T05:21:20.000Z | 2022-03-29T08:36:33.000Z | HARNN/test_harnn.py | TownShaw/Hierarchical-Multi-Label-Text-Classification | e7d0f8d29b8c7b37b951c547b62b9655011fb0be | [
"Apache-2.0"
] | 18 | 2019-12-21T14:43:32.000Z | 2021-12-16T07:13:19.000Z | HARNN/test_harnn.py | TownShaw/Hierarchical-Multi-Label-Text-Classification | e7d0f8d29b8c7b37b951c547b62b9655011fb0be | [
"Apache-2.0"
] | 53 | 2019-10-09T13:36:15.000Z | 2022-03-21T09:04:02.000Z | # -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import sys
import time
import logging
import numpy as np
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import tensorflow as tf
from utils import checkmate as cm
from utils import data_helpers as dh
from utils import param_parser as par... | 48.743169 | 129 | 0.610762 |
__author__ = 'Randolph'
import os
import sys
import time
import logging
import numpy as np
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import tensorflow as tf
from utils import checkmate as cm
from utils import data_helpers as dh
from utils import param_parser as parser
from sklearn.metri... | true | true |
1c30639ec356fd7364c53bd692139438c10f7447 | 1,322 | py | Python | apps/publications/logic/sync.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/publications/logic/sync.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/publications/logic/sync.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | """
Stuff related to synchronization of organization data between the local database
and an external source
"""
from core.task_support import cache_based_lock
from erms.sync import ERMSObjectSyncer
from ..models import Platform
from django.db.transaction import atomic
from django.conf import settings
from core.models... | 30.045455 | 90 | 0.656581 | from core.task_support import cache_based_lock
from erms.sync import ERMSObjectSyncer
from ..models import Platform
from django.db.transaction import atomic
from django.conf import settings
from core.models import DataSource
from erms.api import ERMS
class PlatformSyncer(ERMSObjectSyncer):
attr_map = {
... | true | true |
1c3063d07a3f77bbb24ac89d45ba31739caf879c | 79,005 | py | Python | django/docs/topics/testing/tools.txt.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/docs/topics/testing/tools.txt.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/docs/topics/testing/tools.txt.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | XXXXXXXXXXXXX
XXXXXXX XXXXX
XXXXXXXXXXXXX
XX XXXXXXXXXXXXXXX XXXXXXXXXXX
XXXXXX XXXXXXXX X XXXXX XXX XX XXXXX XXXX XXXX XX XXXXX XXXX XXXXXXX XXXXXX
XX XXXXXXXXXXXXX
XXX XXXX XXXXXX
XXXXXXXXXXXXXXX
XXX XXXX XXXXXX XX X XXXXXX XXXXX XXXX XXXX XX X XXXXX XXX XXXXXXXX XXXXXXXX
XXX XX XXXX XXXX XXXXX XXX XXXXXXXX XXXX... | 40.619537 | 193 | 0.791646 | XXXXXXXXXXXXX
XXXXXXX XXXXX
XXXXXXXXXXXXX
XX XXXXXXXXXXXXXXX XXXXXXXXXXX
XXXXXX XXXXXXXX X XXXXX XXX XX XXXXX XXXX XXXX XX XXXXX XXXX XXXXXXX XXXXXX
XX XXXXXXXXXXXXX
XXX XXXX XXXXXX
XXXXXXXXXXXXXXX
XXX XXXX XXXXXX XX X XXXXXX XXXXX XXXX XXXX XX X XXXXX XXX XXXXXXXX XXXXXXXX
XXX XX XXXX XXXX XXXXX XXX XXXXXXXX XXXX... | false | true |
1c3063ff282f493486da891b43dde3f1edcd3ccd | 8,726 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/swupd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/swupd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/swupd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# (c) 2017, Alberto Murillo <alberto.murillo.silva@intel.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 28.148387 | 137 | 0.605547 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: swupd
short_description: Manages updates and bundles ... | true | true |
1c3064a56dc4cd358db290b5dbff8c3e63727911 | 359 | py | Python | {{cookiecutter.project_slug}}/apps/client/views.py | Nomadicode/django-cookie | 63bce1225d481d5cd6c6f2b1e1bbb6d47a3c5dab | [
"BSD-3-Clause"
] | 3 | 2020-10-10T20:08:08.000Z | 2021-03-26T05:46:25.000Z | {{cookiecutter.project_slug}}/apps/client/views.py | yunior22/django-cookie | a879f8f0388ad4e7bf4950f73f7423652b3d71c6 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/apps/client/views.py | yunior22/django-cookie | a879f8f0388ad4e7bf4950f73f7423652b3d71c6 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T21:25:45.000Z | 2021-11-19T21:25:45.000Z | from django.shortcuts import render
template = 'index.html'
# This method loads the main index html file
# and loads the root path.
def root_path(request):
return render(request, template)
# This method loads the main index html file
# and loads any vue routes.
def vue_router(request):
context = {}
ret... | 21.117647 | 45 | 0.735376 | from django.shortcuts import render
template = 'index.html'
def root_path(request):
return render(request, template)
def vue_router(request):
context = {}
return render(request, template, context)
| true | true |
1c3064c4cf5ebab2d83d1eb92d2137f66e2a6a89 | 22 | py | Python | mlvtk/base/normalize/__init__.py | tm-schwartz/mlvtk | 58db322d763b4572f1d5c52d81ba854a317bbd8c | [
"MIT"
] | 6 | 2021-01-11T20:10:28.000Z | 2022-03-31T03:02:18.000Z | mlvtk/base/normalize/__init__.py | tm-schwartz/mlvtk | 58db322d763b4572f1d5c52d81ba854a317bbd8c | [
"MIT"
] | 1 | 2020-10-23T06:11:23.000Z | 2020-10-23T06:11:23.000Z | mlvtk/base/normalize/__init__.py | tm-schwartz/mlvtk | 58db322d763b4572f1d5c52d81ba854a317bbd8c | [
"MIT"
] | 1 | 2021-06-20T07:27:47.000Z | 2021-06-20T07:27:47.000Z | from .. import Vmodel
| 11 | 21 | 0.727273 | from .. import Vmodel
| true | true |
1c3065efe5b88fa013826b85d95896ad96c68051 | 1,193 | py | Python | reviewboard/webapi/resources/draft_patched_file.py | znick/reviewboard | f32320b267efcdf2feff1661eabe57f99ef490a7 | [
"MIT"
] | null | null | null | reviewboard/webapi/resources/draft_patched_file.py | znick/reviewboard | f32320b267efcdf2feff1661eabe57f99ef490a7 | [
"MIT"
] | null | null | null | reviewboard/webapi/resources/draft_patched_file.py | znick/reviewboard | f32320b267efcdf2feff1661eabe57f99ef490a7 | [
"MIT"
] | 1 | 2021-11-23T15:25:44.000Z | 2021-11-23T15:25:44.000Z | from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from djblets.webapi.errors import DOES_NOT_EXIST
from reviewboard.webapi.resources import resources
from reviewboard.webapi.resources.base_patched_file import \
BasePatchedFileResource
class DraftPatchedFileResource(Ba... | 34.085714 | 74 | 0.701593 | from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from djblets.webapi.errors import DOES_NOT_EXIST
from reviewboard.webapi.resources import resources
from reviewboard.webapi.resources.base_patched_file import \
BasePatchedFileResource
class DraftPatchedFileResource(Ba... | true | true |
1c3066d4fe4cc6d899f83ad1bb9ca88f7ed8259c | 26,729 | py | Python | yt/visualization/fixed_resolution.py | bkhamesra/yt-EinsteinToolkit | 576bf88b5cd706fd577c513c23b1db07ec5f4cd2 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-11-29T21:59:06.000Z | 2021-11-29T21:59:06.000Z | yt/visualization/fixed_resolution.py | bkhamesra/yt-EinsteinToolkit | 576bf88b5cd706fd577c513c23b1db07ec5f4cd2 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/visualization/fixed_resolution.py | bkhamesra/yt-EinsteinToolkit | 576bf88b5cd706fd577c513c23b1db07ec5f4cd2 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Fixed resolution buffer support, along with a primitive image analysis tool.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt,... | 39.598519 | 148 | 0.564331 |
from yt.frontends.ytdata.utilities import \
save_as_dataset
from yt.funcs import \
get_output_filename, \
mylog, \
ensure_list
from .volume_rendering.api import off_axis_projection
from .fixed_resolution_filters import apply_filter, filter_registry
from yt.data_objects.image_array import ImageA... | true | true |
1c30687beb3e77c32ee8376ffc89c6780a92f2a7 | 2,205 | py | Python | imaginary/test/test_player.py | glyph/imaginary | 62299c8a0481bbee51444e688f45385a81cad328 | [
"MIT"
] | 25 | 2015-01-10T02:26:43.000Z | 2021-08-20T09:40:46.000Z | imaginary/test/test_player.py | DalavanCloud/imaginary | e84abc98d400cff5e262df2b34e725dde575af8e | [
"MIT"
] | 65 | 2015-01-07T08:02:53.000Z | 2022-02-06T02:15:09.000Z | imaginary/test/test_player.py | DalavanCloud/imaginary | e84abc98d400cff5e262df2b34e725dde575af8e | [
"MIT"
] | 7 | 2015-03-03T18:44:29.000Z | 2021-07-28T02:54:10.000Z |
"""
Tests for L{imaginary.wiring.player}.
"""
from twisted.trial import unittest
from axiom import store
from imaginary import objects
from imaginary.objects import Container
from imaginary.wiring import player
class PlayerTest(unittest.TestCase):
def setUp(self):
self.store = store.Store()
... | 31.5 | 80 | 0.610884 |
from twisted.trial import unittest
from axiom import store
from imaginary import objects
from imaginary.objects import Container
from imaginary.wiring import player
class PlayerTest(unittest.TestCase):
def setUp(self):
self.store = store.Store()
self.bob = objects.Thing(store=self.store, nam... | true | true |
1c3068ae89b9a09ec68be9a9b0bf737c91b9fe3b | 97 | py | Python | usercontrol/apps.py | MinisterioPublicoRJ/mpplus | 23501db772172567c8d421c7af69ec43cddf1c20 | [
"MIT"
] | 1 | 2019-03-05T12:02:38.000Z | 2019-03-05T12:02:38.000Z | usercontrol/apps.py | MinisterioPublicoRJ/mpplus | 23501db772172567c8d421c7af69ec43cddf1c20 | [
"MIT"
] | 8 | 2020-02-11T23:14:48.000Z | 2022-02-10T10:53:19.000Z | usercontrol/apps.py | MinisterioPublicoRJ/mpplus | 23501db772172567c8d421c7af69ec43cddf1c20 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UsercontrolConfig(AppConfig):
name = 'usercontrol'
| 16.166667 | 35 | 0.773196 | from django.apps import AppConfig
class UsercontrolConfig(AppConfig):
name = 'usercontrol'
| true | true |
1c3068b6efd9b527ae085460f22dc74a7f634a57 | 970 | py | Python | fei_webhook/app_webhook/shell_cmd.py | colingong/fei_webhook | 2acb8b8e36d05f87f06dcc1bf056beb92a41b157 | [
"Apache-2.0"
] | null | null | null | fei_webhook/app_webhook/shell_cmd.py | colingong/fei_webhook | 2acb8b8e36d05f87f06dcc1bf056beb92a41b157 | [
"Apache-2.0"
] | 6 | 2021-03-19T09:41:23.000Z | 2022-02-10T11:13:35.000Z | fei_webhook/app_webhook/shell_cmd.py | colingong/fei_webhook | 2acb8b8e36d05f87f06dcc1bf056beb92a41b157 | [
"Apache-2.0"
] | null | null | null | """执行shell cmd
"""
from subprocess import Popen, PIPE
from main_settings.settings import REPOS_PARENT_DIR
class Cmds(object):
def __init__(self, cmds):
self.cmds = cmds
self.repos_parent_dir = REPOS_PARENT_DIR
def run(self):
process = Popen('bash', shell=False, universal_newlines=... | 23.658537 | 69 | 0.542268 | from subprocess import Popen, PIPE
from main_settings.settings import REPOS_PARENT_DIR
class Cmds(object):
def __init__(self, cmds):
self.cmds = cmds
self.repos_parent_dir = REPOS_PARENT_DIR
def run(self):
process = Popen('bash', shell=False, universal_newlines=True,
stdin=... | true | true |
1c3068e44147e3e52a0e984de1b23a558a13e8fb | 3,883 | py | Python | internal/log_analysis/rules_engine/src/rule.py | stoggi/panther | 72532101a201d26c03061b6ea4fc8092995e210f | [
"Apache-2.0"
] | 2 | 2021-12-17T01:24:21.000Z | 2021-12-18T17:13:45.000Z | internal/log_analysis/rules_engine/src/rule.py | stoggi/panther | 72532101a201d26c03061b6ea4fc8092995e210f | [
"Apache-2.0"
] | null | null | null | internal/log_analysis/rules_engine/src/rule.py | stoggi/panther | 72532101a201d26c03061b6ea4fc8092995e210f | [
"Apache-2.0"
] | 5 | 2021-12-16T02:16:43.000Z | 2022-03-26T14:38:37.000Z | # Panther is a scalable, powerful, cloud-native SIEM written in Golang/React.
# Copyright (C) 2020 Panther Labs Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of t... | 37.699029 | 99 | 0.662632 |
import os
import sys
import tempfile
from importlib import util as import_util
from pathlib import Path
from typing import Any, Dict, Union
from .logging import get_logger
_RULE_FOLDER = os.path.join(tempfile.gettempdir(), 'rules')
COMMON_MODULE_RULE_ID = 'aws_globals'
class Rule:
logger = get... | true | true |
1c3069363f84e2150f277a24369f3e3872ad0037 | 39,984 | py | Python | .venv/lib/python3.8/site-packages/numpy/distutils/fcompiler/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 115 | 2020-06-18T15:00:58.000Z | 2022-03-02T10:13:19.000Z | .venv/lib/python3.8/site-packages/numpy/distutils/fcompiler/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 88 | 2020-04-23T18:33:38.000Z | 2021-08-02T06:25:47.000Z | bot/lib/python3.7/site-packages/numpy/distutils/fcompiler/__init__.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 60 | 2020-07-22T14:53:10.000Z | 2022-03-23T10:17:59.000Z | """numpy.distutils.fcompiler
Contains FCompiler, an abstract base class that defines the interface
for the numpy.distutils Fortran compiler abstraction model.
Terminology:
To be consistent, where the term 'executable' is used, it means the single
file, like 'gcc', that is executed, and should be a string. In contras... | 38.894942 | 112 | 0.595538 | __all__ = ['FCompiler', 'new_fcompiler', 'show_fcompilers',
'dummy_fortran_file']
import os
import sys
import re
from numpy.compat import open_latin1
from distutils.sysconfig import get_python_lib
from distutils.fancy_getopt import FancyGetopt
from distutils.errors import DistutilsModuleError, \
Dist... | true | true |
1c306952397df50dbb1817d16a605050bc049f1c | 1,306 | py | Python | var/spack/repos/builtin/packages/r-selectr/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-selectr/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/r-selectr/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-05-06T00:17:46.000Z | 2021-05-06T00:17:46.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RSelectr(RPackage):
"""Translates a CSS3 selector into an equivalent XPath expression. Thi... | 46.642857 | 95 | 0.724349 |
from spack import *
class RSelectr(RPackage):
homepage = "https://sjp.co.nz/projects/selectr"
url = "https://cloud.r-project.org/src/contrib/selectr_0.3-1.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/selectr"
version('0.4-1', sha256='8bd42f167629344e485e586f9b05fed34... | true | true |
1c3069de3b057d647ee4bea6dc8db9a995c582b5 | 2,872 | py | Python | hypha/apply/projects/migrations/0025_add_report_models.py | hawkinsw/hypha | a9c46f6e1e1af5d32aef9499a06a065ea3d23d61 | [
"BSD-3-Clause"
] | 20 | 2021-04-08T16:38:49.000Z | 2022-02-09T20:05:57.000Z | hypha/apply/projects/migrations/0025_add_report_models.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 1,098 | 2017-12-15T11:23:03.000Z | 2020-01-24T07:58:07.000Z | hypha/apply/projects/migrations/0025_add_report_models.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 17 | 2020-02-07T14:55:54.000Z | 2021-04-04T19:32:38.000Z | # Generated by Django 2.1.11 on 2019-10-28 14:15
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
import hypha.apply.projects.models
class Migration(migrations.Migration):
dependencies = [
('application_projects', '0024_allow_no_comments_on_pr'),... | 44.184615 | 160 | 0.602368 |
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
import hypha.apply.projects.models
class Migration(migrations.Migration):
dependencies = [
('application_projects', '0024_allow_no_comments_on_pr'),
]
operations = [
migrations.Cr... | true | true |
1c306a25629329ceaeb90ff4a2b64a1d7896121e | 412 | py | Python | pyvista/_version.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | pyvista/_version.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | pyvista/_version.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | """Version info for pyvista.
On the ``master`` branch, use 'dev0' to denote a development version.
For example:
version_info = 0, 27, 'dev0'
---
When generating pre-release wheels, use '0rcN', for example:
version_info = 0, 28, '0rc1'
Denotes the first release candidate.
"""
# major, minor, patch
version_info = ... | 18.727273 | 69 | 0.699029 |
version_info = 0, 30, 'dev0'
__version__ = '.'.join(map(str, version_info))
| true | true |
1c306bdf12f452cbe3c58a8a04259382429d80d3 | 2,551 | py | Python | setup.py | DerThorsten/jupyterlab-jitsi | 5c2c3a5ea0f15d861373b375633803762254227a | [
"BSD-3-Clause"
] | 3 | 2021-06-24T09:38:33.000Z | 2021-06-25T04:02:22.000Z | setup.py | DerThorsten/jupyterlab-jitsi | 5c2c3a5ea0f15d861373b375633803762254227a | [
"BSD-3-Clause"
] | 1 | 2021-06-30T15:30:20.000Z | 2021-06-30T15:30:20.000Z | setup.py | DerThorsten/jupyterlab-jitsi | 5c2c3a5ea0f15d861373b375633803762254227a | [
"BSD-3-Clause"
] | 1 | 2021-06-29T13:10:35.000Z | 2021-06-29T13:10:35.000Z | """
jupyterlab-jitsi setup
"""
import json
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
# The name of the project
name = "jupyterlab-jitsi"
lab_path = (HERE / name.replace("-", "_") / "labextension")
# Representative files that should exist after a successful build
ensured_targ... | 30.011765 | 119 | 0.675029 | import json
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
name = "jupyterlab-jitsi"
lab_path = (HERE / name.replace("-", "_") / "labextension")
ensured_targets = [
str(lab_path / "package.json"),
str(lab_path / "static/style.js")
]
labext_name = "jupyterlab-jitsi"
da... | true | true |
1c306c1652cab9052276bab88d6c156545572736 | 729 | py | Python | pytpp/attributes/tree_root.py | Venafi/pytpp | 42af655b2403b8c9447c86962abd4aaa0201f646 | [
"MIT"
] | 4 | 2022-02-04T23:58:55.000Z | 2022-02-15T18:53:08.000Z | pytpp/attributes/tree_root.py | Venafi/pytpp | 42af655b2403b8c9447c86962abd4aaa0201f646 | [
"MIT"
] | null | null | null | pytpp/attributes/tree_root.py | Venafi/pytpp | 42af655b2403b8c9447c86962abd4aaa0201f646 | [
"MIT"
] | null | null | null | from pytpp.attributes._helper import IterableMeta, Attribute
from pytpp.attributes.top import TopAttributes
class TreeRootAttributes(TopAttributes, metaclass=IterableMeta):
__config_class__ = "Tree Root"
company_name = Attribute('Company Name', min_version='17.3')
migration_task = Attribute('Migration Task')
pend... | 48.6 | 97 | 0.798354 | from pytpp.attributes._helper import IterableMeta, Attribute
from pytpp.attributes.top import TopAttributes
class TreeRootAttributes(TopAttributes, metaclass=IterableMeta):
__config_class__ = "Tree Root"
company_name = Attribute('Company Name', min_version='17.3')
migration_task = Attribute('Migration Task')
pend... | true | true |
1c306dc858b94ac19e37ef57b49c3a122586b7a6 | 80 | py | Python | nes/bus/devices/apu/sq2_hi.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 1 | 2017-05-13T18:57:09.000Z | 2017-05-13T18:57:09.000Z | nes/bus/devices/apu/sq2_hi.py | Hexadorsimal/py6502 | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 7 | 2020-10-24T17:16:56.000Z | 2020-11-01T14:10:23.000Z | nes/bus/devices/apu/sq2_hi.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | null | null | null | from nes.processors.registers import Register
class Sq2Hi(Register):
pass
| 13.333333 | 45 | 0.775 | from nes.processors.registers import Register
class Sq2Hi(Register):
pass
| true | true |
1c306f94d3148cda89763d15d67cfa4057307226 | 47 | py | Python | tests/conftest.py | noirbizarre/umfactory | 263426f415ef71fe27b733846e9331066be49bca | [
"MIT"
] | 2 | 2020-04-02T12:54:13.000Z | 2021-08-25T03:24:11.000Z | tests/conftest.py | noirbizarre/umfactory | 263426f415ef71fe27b733846e9331066be49bca | [
"MIT"
] | 160 | 2018-01-13T15:53:46.000Z | 2022-03-25T11:30:43.000Z | tests/conftest.py | noirbizarre/umfactory | 263426f415ef71fe27b733846e9331066be49bca | [
"MIT"
] | null | null | null | DB_URI = 'mongodb://localhost:27017/umfactory'
| 23.5 | 46 | 0.765957 | DB_URI = 'mongodb://localhost:27017/umfactory'
| true | true |
1c30700c7052f1fc5ab3723e41616a4f3d52e6f6 | 4,212 | py | Python | problem11.py | rentes/Euler | e28b536a15f2e795f886a5df261d38bb0181be07 | [
"MIT"
] | 1 | 2019-05-29T23:54:24.000Z | 2019-05-29T23:54:24.000Z | problem11.py | rentes/Euler | e28b536a15f2e795f886a5df261d38bb0181be07 | [
"MIT"
] | null | null | null | problem11.py | rentes/Euler | e28b536a15f2e795f886a5df261d38bb0181be07 | [
"MIT"
] | null | null | null | """Project Euler - Problem 11 - http://projecteuler.net/problem=11"""
import sys
import time
# please install numpy module (python-numpy on Arch Linux)
import numpy as np
import tools.timeutils as timeutils
def fill_matrix():
"""
Return a numpy matrix from the data in problem11-data.txt
"""
array = []... | 35.694915 | 78 | 0.566002 | import sys
import time
import numpy as np
import tools.timeutils as timeutils
def fill_matrix():
array = []
with open('problem11-data.txt', 'r') as f:
for line in f:
array.append(line.strip())
matrix_array = np.loadtxt('problem11-data.txt', delimiter=' ')
np_matrix = np... | true | true |
1c307052dc55b95490f16a2d9cd3b8f3a840fa5d | 10,065 | py | Python | kubernetes_asyncio/client/models/v1_status.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_status.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | 13 | 2021-04-12T02:03:48.000Z | 2022-03-28T02:08:46.000Z | kubernetes_asyncio/client/models/v1_status.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.16.14
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 31.952381 | 312 | 0.60765 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1Status(object):
openapi_types = {
'api_version': 'str',
'code': 'int',
'details': 'V1StatusDetails',
'kind': 'str',
'message': 'str',
'metadata': 'V... | true | true |
1c3070b018da55c9532e5a2ff75d604d17697ddf | 296 | py | Python | challenges/3.4.Strictly_Less_Than_Operator/main.py | pradeepsaiu/python-coding-challenges | b435ab650d85de267eeaa31a55ff77ef5dbff86b | [
"BSD-3-Clause"
] | 141 | 2017-05-07T00:38:22.000Z | 2022-03-25T10:14:25.000Z | challenges/3.4.Strictly_Less_Than_Operator/main.py | pradeepsaiu/python-coding-challenges | b435ab650d85de267eeaa31a55ff77ef5dbff86b | [
"BSD-3-Clause"
] | 23 | 2017-05-06T23:57:37.000Z | 2018-03-23T19:07:32.000Z | challenges/3.4.Strictly_Less_Than_Operator/main.py | pradeepsaiu/python-coding-challenges | b435ab650d85de267eeaa31a55ff77ef5dbff86b | [
"BSD-3-Clause"
] | 143 | 2017-05-07T09:33:35.000Z | 2022-03-12T21:04:13.000Z | def strictly_less_than(value):
if value : # Change this line
return "Less than 10"
elif value : # Change this line
return "Less than 100"
else:
return "100 or more"
# Change the value 1 below to experiment with different values
print(strictly_less_than(1))
| 26.909091 | 62 | 0.665541 | def strictly_less_than(value):
if value :
return "Less than 10"
elif value :
return "Less than 100"
else:
return "100 or more"
print(strictly_less_than(1))
| true | true |
1c3070c120e8c3dc30d18368bf6e88a29b79e99b | 6,058 | py | Python | userbot/events.py | userbot814/DCLXVI | 4bebc89324f51b93c86a9420df49ac3e3b78f29e | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/events.py | userbot814/DCLXVI | 4bebc89324f51b93c86a9420df49ac3e3b78f29e | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/events.py | userbot814/DCLXVI | 4bebc89324f51b93c86a9420df49ac3e3b78f29e | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2020 TeamDerUntergang.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed... | 37.627329 | 88 | 0.535655 |
import sys
from asyncio import create_subprocess_shell as asyncsubshell
from asyncio import subprocess as asyncsub
from os import remove
from time import gmtime, strftime
from traceback import format_exc
from telethon import events
from userbot import bot, BOTLOG_CHATID, LOGSPAMMER, BLACKLIST
def re... | true | true |
1c3070e15e0e0e85afeb3600a16c8efd262bddf6 | 2,170 | py | Python | main.py | riddopic/red-detector | 02a7ab59fdfaeabbfb9c641649bfb2618fba5310 | [
"Apache-2.0"
] | 73 | 2020-11-26T17:19:07.000Z | 2022-03-24T15:32:41.000Z | main.py | riddopic/red-detector | 02a7ab59fdfaeabbfb9c641649bfb2618fba5310 | [
"Apache-2.0"
] | 4 | 2020-12-05T01:40:09.000Z | 2021-11-22T14:36:43.000Z | main.py | riddopic/red-detector | 02a7ab59fdfaeabbfb9c641649bfb2618fba5310 | [
"Apache-2.0"
] | 17 | 2020-12-02T06:03:12.000Z | 2022-02-28T21:49:38.000Z | import argparse
from art import text2art
from src.logger import setup_logger
from src.snapper import Snapper
from src.scanner import Scanner
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--region', action='store', dest='region', type=str,
help='regi... | 43.4 | 110 | 0.694009 | import argparse
from art import text2art
from src.logger import setup_logger
from src.snapper import Snapper
from src.scanner import Scanner
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--region', action='store', dest='region', type=str,
help='regi... | true | true |
1c3071d13f3846e980379db6ae1253b2f439df34 | 1,983 | py | Python | identify-keys.py | TntMatthew/kbdisplay | 3ad974504fd2ecbb3af35f31c9148ef88c03868f | [
"MIT"
] | 1 | 2021-12-28T23:54:48.000Z | 2021-12-28T23:54:48.000Z | identify-keys.py | Tiyenti/kbdisplay | 2e53752caa0223b78607f7daa98c0bffe850098b | [
"MIT"
] | null | null | null | identify-keys.py | Tiyenti/kbdisplay | 2e53752caa0223b78607f7daa98c0bffe850098b | [
"MIT"
] | null | null | null | import subprocess
from enum import Enum
# TODO: Figure out what the rest of these are
class Keycode(Enum):
ESC = 9
ONE = 10
TWO = 11
THREE = 12
FOUR = 13
FIVE = 14
SIX = 15
SEVEN = 16
EIGHT = 17
NINE = 18
ZERO = 19
MINUS = 20
EQUALS = 21
BACKSPACE = 22
TAB =... | 17.094828 | 65 | 0.467978 | import subprocess
from enum import Enum
class Keycode(Enum):
ESC = 9
ONE = 10
TWO = 11
THREE = 12
FOUR = 13
FIVE = 14
SIX = 15
SEVEN = 16
EIGHT = 17
NINE = 18
ZERO = 19
MINUS = 20
EQUALS = 21
BACKSPACE = 22
TAB = 23
Q = 24
W = 25
E = 26
R = ... | true | true |
1c3072f1d5729e267d6619856d7905348a976d2e | 33,726 | py | Python | canvasapi/quiz.py | marvic2409/canvasapi | 2e8a151b081ff1c6700d9baaa71f13c2b9bb515c | [
"MIT"
] | null | null | null | canvasapi/quiz.py | marvic2409/canvasapi | 2e8a151b081ff1c6700d9baaa71f13c2b9bb515c | [
"MIT"
] | null | null | null | canvasapi/quiz.py | marvic2409/canvasapi | 2e8a151b081ff1c6700d9baaa71f13c2b9bb515c | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import warnings
from six import python_2_unicode_compatible
from canvasapi.canvas_object import CanvasObject
from canvasapi.exceptions import RequiredFieldMissing
from canvasapi.paginated_list import PaginatedList
from canvasapi.quiz_... | 37.682682 | 129 | 0.622131 | from __future__ import absolute_import, division, print_function, unicode_literals
import warnings
from six import python_2_unicode_compatible
from canvasapi.canvas_object import CanvasObject
from canvasapi.exceptions import RequiredFieldMissing
from canvasapi.paginated_list import PaginatedList
from canvasapi.quiz_... | true | true |
1c30738c8a1ba6427c0cd62fe0952b1badd4101e | 25,230 | py | Python | ivadomed/training.py | vs74/ivadomed | c3b5a21bbe4907853a330bd18d0dbb048439111d | [
"MIT"
] | null | null | null | ivadomed/training.py | vs74/ivadomed | c3b5a21bbe4907853a330bd18d0dbb048439111d | [
"MIT"
] | null | null | null | ivadomed/training.py | vs74/ivadomed | c3b5a21bbe4907853a330bd18d0dbb048439111d | [
"MIT"
] | null | null | null | import copy
import datetime
import logging
import os
import random
import time
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from ivadomed import losses as ime... | 45.29623 | 122 | 0.615696 | import copy
import datetime
import logging
import os
import random
import time
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from ivadomed import losses as ime... | true | true |
1c3073db02788b6fee392aaaf1064cf444cb1052 | 916 | py | Python | tests/conftest.py | imfht/sec-flask-cookiecutter | 81410cc72cc401cd1bd4698c5958f3ce0c5d581a | [
"MIT"
] | null | null | null | tests/conftest.py | imfht/sec-flask-cookiecutter | 81410cc72cc401cd1bd4698c5958f3ce0c5d581a | [
"MIT"
] | 5 | 2021-03-09T12:28:12.000Z | 2022-02-26T15:30:29.000Z | tests/conftest.py | jnoble/my_flask_app | 6d9681b04aa08b26b3d4577cca6311aa79673d79 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Defines fixtures available to all tests."""
import pytest
from webtest import TestApp
from my_flask_app.app import create_app
from my_flask_app.database import db as _db
from .factories import UserFactory
@pytest.fixture
def app():
"""Create application for the tests."""
_app = c... | 17.960784 | 46 | 0.667031 |
import pytest
from webtest import TestApp
from my_flask_app.app import create_app
from my_flask_app.database import db as _db
from .factories import UserFactory
@pytest.fixture
def app():
_app = create_app("tests.settings")
ctx = _app.test_request_context()
ctx.push()
yield _app
ctx.pop()
... | true | true |
1c307427210ec8a88e7edf75867cc0afb7b49e39 | 693 | py | Python | experimental/Python/src/Intersection/Carla/ROS/carla_intersection/src/launch_parameters.py | soerendomroes/lingua-franca | 9e5e5a16f013f6ea9760cc65f850986319dc8917 | [
"BSD-2-Clause"
] | null | null | null | experimental/Python/src/Intersection/Carla/ROS/carla_intersection/src/launch_parameters.py | soerendomroes/lingua-franca | 9e5e5a16f013f6ea9760cc65f850986319dc8917 | [
"BSD-2-Clause"
] | null | null | null | experimental/Python/src/Intersection/Carla/ROS/carla_intersection/src/launch_parameters.py | soerendomroes/lingua-franca | 9e5e5a16f013f6ea9760cc65f850986319dc8917 | [
"BSD-2-Clause"
] | null | null | null | SPAWN_POINTS = [
# x y z yaw
[-122.0, 39.6, 0.3, -90.0],
[-177.77, 6.48, 0.3, 0.0],
[-132.77, -40, 0.3, 90.0],
[-80.77, -4.5, 0.3, 180.0]
]
INITIAL_POSITIONS = [
# x y z
[0.000038, -0.000674, 2.794825], # /|\
[-0.000501, -0.001084, 2.79489... | 23.896552 | 60 | 0.454545 | SPAWN_POINTS = [
[-122.0, 39.6, 0.3, -90.0],
[-177.77, 6.48, 0.3, 0.0],
[-132.77, -40, 0.3, 90.0],
[-80.77, -4.5, 0.3, 180.0]
]
INITIAL_POSITIONS = [
[0.000038, -0.000674, 2.794825],
[-0.000501, -0.001084, 2.794891],
[-0.000060, -0.001510, 2.794854],
[0.000... | true | true |
1c3074614147e0039a1a48614dff9fe9dd4a7c69 | 1,919 | py | Python | tests/plugins/test_render.py | illikainen/luoda | eb9788b64aa18df7424e28ec902972fcbaa20620 | [
"BSD-2-Clause"
] | null | null | null | tests/plugins/test_render.py | illikainen/luoda | eb9788b64aa18df7424e28ec902972fcbaa20620 | [
"BSD-2-Clause"
] | null | null | null | tests/plugins/test_render.py | illikainen/luoda | eb9788b64aa18df7424e28ec902972fcbaa20620 | [
"BSD-2-Clause"
] | null | null | null | # pylint: disable=W0621
#
# Copyright (c) 2019, Hans Jerry Illikainen <hji@dyntopia.com>
#
# SPDX-License-Identifier: BSD-2-Clause
from datetime import date
from pathlib import Path
from time import time
from jinja2 import FileSystemLoader
from jinja2.exceptions import SecurityError, TemplateError
from pytest import ... | 26.287671 | 72 | 0.663366 |
from datetime import date
from pathlib import Path
from time import time
from jinja2 import FileSystemLoader
from jinja2.exceptions import SecurityError, TemplateError
from pytest import raises
from luoda.item import Item
from luoda.plugins.render import Sandbox, _strftime, available, run
from ..fixtures impor... | true | true |
1c3074bcc71d2bd3fef1e3ad64a3d2b9e79bff0d | 28,060 | py | Python | datatools.py | qwghlm/WhensMyBus | bef206c15a5efdeeca234a9f31d98b2ec33342af | [
"MIT"
] | 4 | 2015-01-02T20:31:43.000Z | 2017-03-02T11:27:39.000Z | datatools.py | qwghlm/WhensMyBus | bef206c15a5efdeeca234a9f31d98b2ec33342af | [
"MIT"
] | 1 | 2016-10-17T21:23:48.000Z | 2016-10-17T21:23:48.000Z | datatools.py | qwghlm/WhensMyBus | bef206c15a5efdeeca234a9f31d98b2ec33342af | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#pylint: disable=R0913
"""
Data importing tools for WhensMyTransport - import TfL's data into an easier format for us to use
"""
# Standard Python libraries
import csv
import os
import cPickle as pickle
import re
import sys
import subprocess
import tempfile
from math import sqrt
from pprint import... | 49.22807 | 149 | 0.662438 |
"""
Data importing tools for WhensMyTransport - import TfL's data into an easier format for us to use
"""
# Standard Python libraries
import csv
import os
import cPickle as pickle
import re
import sys
import subprocess
import tempfile
from math import sqrt
from pprint import pprint
# Library available from http://co... | false | true |
1c3076036b9cb826399283de80e1d2e33c1bd6c2 | 1,067 | py | Python | app/core/models.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | app/core/models.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | app/core/models.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"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):
if not email:
raise ValueError('Us... | 30.485714 | 76 | 0.673852 | 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('Us... | true | true |
1c30762ce7473bf4118ad082a0b5f888ed1b2c25 | 11,661 | py | Python | hmf/cosmo.py | tbs1980/hmf | b6a1add9e0e130aea4ec1ac2eea97c3112aa3b54 | [
"MIT"
] | 1 | 2015-11-07T12:40:49.000Z | 2015-11-07T12:40:49.000Z | hmf/cosmo.py | tbs1980/hmf | b6a1add9e0e130aea4ec1ac2eea97c3112aa3b54 | [
"MIT"
] | null | null | null | hmf/cosmo.py | tbs1980/hmf | b6a1add9e0e130aea4ec1ac2eea97c3112aa3b54 | [
"MIT"
] | null | null | null | class Cosmology(object):
"""
A class that nicely deals with cosmological parameters.
Most cosmological parameters are merely input and are made available as
attributes in the class. However, more complicated relations such as
the interrelation of omegab, omegac, omegam, omegav for example are ... | 38.740864 | 102 | 0.487866 | class Cosmology(object):
"""
A class that nicely deals with cosmological parameters.
Most cosmological parameters are merely input and are made available as
attributes in the class. However, more complicated relations such as
the interrelation of omegab, omegac, omegam, omegav for example are ... | false | true |
1c30768285fc10fefd2eec1b486d15b6c493688a | 11,078 | py | Python | pytorch_lightning/trainer/configuration_validator.py | kazhang/pytorch-lightning | 54e95d3e2896bfe092d5ee18ede2c153c200c266 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/configuration_validator.py | kazhang/pytorch-lightning | 54e95d3e2896bfe092d5ee18ede2c153c200c266 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/configuration_validator.py | kazhang/pytorch-lightning | 54e95d3e2896bfe092d5ee18ede2c153c200c266 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 51.525581 | 120 | 0.639827 |
import pytorch_lightning as pl
from pytorch_lightning.trainer.states import TrainerFn
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.utilities.model_helpers import is_overridden
from pytorch_lightning.utilities.signature_utils import is_param_in_hook_sig... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.