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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1d237cae60d95ccbbbbfb34cec43796ea651f5 | 2,587 | py | Python | tests/game/test_score.py | zbendas/Python-Rummy | 24baf61c73b7677dc84a82af81712a6a33a685e3 | [
"MIT"
] | null | null | null | tests/game/test_score.py | zbendas/Python-Rummy | 24baf61c73b7677dc84a82af81712a6a33a685e3 | [
"MIT"
] | null | null | null | tests/game/test_score.py | zbendas/Python-Rummy | 24baf61c73b7677dc84a82af81712a6a33a685e3 | [
"MIT"
] | null | null | null | # coding=utf-8
from rummy.game.score import Score
from rummy.player.player import Player
from rummy.player.human import Human
class TestScore:
def test_get_current_game_scores(self, mocker):
mocker.patch.object(Player, 'get_game_score', side_effect=[23, 30, 12, 40])
score = Score([Human(1), Huma... | 42.409836 | 117 | 0.67298 |
from rummy.game.score import Score
from rummy.player.player import Player
from rummy.player.human import Human
class TestScore:
def test_get_current_game_scores(self, mocker):
mocker.patch.object(Player, 'get_game_score', side_effect=[23, 30, 12, 40])
score = Score([Human(1), Human(2), Human(3)... | true | true |
1c1d23eb12fb6d71ad69070e12dc590dc8916566 | 6,763 | py | Python | lib/surface/container/hub/memberships/get_credentials.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/container/hub/memberships/get_credentials.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/container/hub/memberships/get_credentials.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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 requir... | 40.017751 | 101 | 0.736507 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import textwrap
from googlecloudsdk.api_lib.cloudresourcemanager import projects_api
from googlecloudsdk.api_lib.container import util
from googlecloudsdk.calliope import base
from googleclouds... | true | true |
1c1d24a3c5612cbe898eb6cad68fcefc8881a6cb | 1,538 | py | Python | quality/call_perspective.py | avalanchesiqi/youtube-crosstalk | 06600e9c345c37540358afe9c8efce9ce9990ada | [
"MIT"
] | 10 | 2021-03-16T10:38:29.000Z | 2022-03-09T15:20:46.000Z | quality/call_perspective.py | avalanchesiqi/youtube-crosstalk | 06600e9c345c37540358afe9c8efce9ce9990ada | [
"MIT"
] | null | null | null | quality/call_perspective.py | avalanchesiqi/youtube-crosstalk | 06600e9c345c37540358afe9c8efce9ce9990ada | [
"MIT"
] | 1 | 2021-05-15T08:05:54.000Z | 2021-05-15T08:05:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Code usage of Jigsaw's perspective api.
Usage: python call_perspective.py
"""
import time, json, requests
JIGSAW_URL = 'https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key={api_key}'
def main():
# follow the this guide to create your key
#... | 33.434783 | 144 | 0.671651 |
import time, json, requests
JIGSAW_URL = 'https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key={api_key}'
def main():
api_key = 'input your perspective API key'
comment_text = 'Why should we give her the benefit of the doubt? Clearly her appointment is driven by politics, not r... | true | true |
1c1d25d1c936f76568d017fe869e318e4e01f726 | 427 | py | Python | tests/__init__.py | seiren87/yangsutil | 045fc958bee57be905c2f48240b10abece58e55b | [
"MIT"
] | null | null | null | tests/__init__.py | seiren87/yangsutil | 045fc958bee57be905c2f48240b10abece58e55b | [
"MIT"
] | null | null | null | tests/__init__.py | seiren87/yangsutil | 045fc958bee57be905c2f48240b10abece58e55b | [
"MIT"
] | null | null | null | from tests.datetime_util import DateTimeUtilTestCase
from tests.dict_util import DictUtilTestCase
from tests.file_util import FileUtilTestCase
from tests.integer_util import IntegerUtilTestCase
from tests.log_util import LogUtilTestCase
from tests.object_util import ObjectUtilTestCase
from tests.shield_util import Shie... | 42.7 | 52 | 0.894614 | from tests.datetime_util import DateTimeUtilTestCase
from tests.dict_util import DictUtilTestCase
from tests.file_util import FileUtilTestCase
from tests.integer_util import IntegerUtilTestCase
from tests.log_util import LogUtilTestCase
from tests.object_util import ObjectUtilTestCase
from tests.shield_util import Shie... | true | true |
1c1d2605f25d2f6940e7e5a2a45b11a4c7249e42 | 1,792 | py | Python | tests/milvus_benchmark/parser.py | NeatNerdPrime/milvus | 98de0f87e99cd1ff86d8e63b91c76589b195abe1 | [
"Apache-2.0"
] | 1 | 2020-05-31T00:34:00.000Z | 2020-05-31T00:34:00.000Z | tests/milvus_benchmark/parser.py | NeatNerdPrime/milvus | 98de0f87e99cd1ff86d8e63b91c76589b195abe1 | [
"Apache-2.0"
] | 1 | 2021-03-25T23:23:50.000Z | 2021-03-25T23:23:50.000Z | tests/milvus_benchmark/parser.py | flydragon2018/milvus | fa1effdb91d9fd9710ff5a9ae519bd538e79b0b0 | [
"Apache-2.0"
] | 1 | 2021-05-23T15:04:01.000Z | 2021-05-23T15:04:01.000Z | import pdb
import logging
logger = logging.getLogger("milvus_benchmark.parser")
def operations_parser(operations, run_type="performance"):
definitions = operations[run_type]
return definitions
def table_parser(table_name):
tmp = table_name.split("_")
# if len(tmp) != 5:
# return None
da... | 27.151515 | 75 | 0.614397 | import pdb
import logging
logger = logging.getLogger("milvus_benchmark.parser")
def operations_parser(operations, run_type="performance"):
definitions = operations[run_type]
return definitions
def table_parser(table_name):
tmp = table_name.split("_")
data_type = tmp[0]
table_size_unit... | true | true |
1c1d264d5ff7b1d01477a9416285c1c9a7d75f76 | 5,431 | py | Python | pdiffcopy/cli.py | xolox/python-pdiffcopy | ed765af92c0c0823818d545e61384753912a5725 | [
"MIT"
] | 5 | 2020-03-07T00:01:24.000Z | 2020-12-03T03:44:26.000Z | pdiffcopy/cli.py | xolox/python-pdiffcopy | ed765af92c0c0823818d545e61384753912a5725 | [
"MIT"
] | null | null | null | pdiffcopy/cli.py | xolox/python-pdiffcopy | ed765af92c0c0823818d545e61384753912a5725 | [
"MIT"
] | null | null | null | # Command line interface for pdiffcopy.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 6, 2020
# URL: https://pdiffcopy.readthedocs.io
"""
Usage: pdiffcopy [OPTIONS] [SOURCE, TARGET]
Synchronize large binary data files between Linux servers at blazing speeds
by performing delta transfers and sp... | 30.005525 | 78 | 0.620328 |
import getopt
import logging
import sys
import coloredlogs
from humanfriendly import parse_size
from humanfriendly.terminal import warning, usage
from pdiffcopy.exceptions import DependencyError
logger = logging.getLogger(__name__)
def main():
coloredlogs.install(syslog=True)
try:
... | true | true |
1c1d26d47093e91c41a041edcb9d0342c2299c14 | 305 | py | Python | 2017/09/truven-poll-presc-cost-20170907/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2017/09/truven-poll-presc-cost-20170907/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2017/09/truven-poll-presc-cost-20170907/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1myI_aLBt6E2A5EuisuWF3LeqScJAni07-KBXKg-IJHw'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.813115 |
import base_filters
COPY_GOOGLE_DOC_KEY = '1myI_aLBt6E2A5EuisuWF3LeqScJAni07-KBXKg-IJHw'
USE_ASSETS = False
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| true | true |
1c1d270b94e3ca414d577056c15e771f01b954f7 | 2,186 | py | Python | src/oci/resource_manager/models/template_summary_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/resource_manager/models/template_summary_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/resource_manager/models/template_summary_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 30.788732 | 245 | 0.665142 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class TemplateSummaryCollection(object):
def __init__(self, **kwargs):
self.swagger_types = {
'items': 'lis... | true | true |
1c1d27e8d5d8fd018b4db61a0813a5b5050a328a | 4,454 | py | Python | src/python/pants/backend/jvm/tasks/nailgun_task.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/nailgun_task.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/nailgun_task.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from abc i... | 39.767857 | 99 | 0.703862 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from abc import abstractproperty
from pants.backend.core.tasks.task import Task, TaskBase
from pants.backend.jvm.tasks.jvm_tool_task_mixin import JvmToo... | true | true |
1c1d28c8e9633f5c149dc14e8b9eaa1dff800d37 | 5,789 | py | Python | hytra/dvid/upload_dataset.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/dvid/upload_dataset.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/dvid/upload_dataset.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | import logging
from libdvid import DVIDNodeService, DVIDServerService
import numpy as np
import json_tricks.np as json
from pluginsystem.plugin_manager import TrackingPluginManager
def dataToBlock(data, dtype=np.uint8, block_size=32):
if len(data.shape) == 2:
data = np.expand_dims(data, axis=2)
elif l... | 34.254438 | 318 | 0.643807 | import logging
from libdvid import DVIDNodeService, DVIDServerService
import numpy as np
import json_tricks.np as json
from pluginsystem.plugin_manager import TrackingPluginManager
def dataToBlock(data, dtype=np.uint8, block_size=32):
if len(data.shape) == 2:
data = np.expand_dims(data, axis=2)
elif l... | true | true |
1c1d28f1588f53bcb4ed4558d75ccc353314edbd | 3,513 | py | Python | fixture/group.py | marygovory/python_training | 5ba12d7ac8813215e0392a85b2ef4f314aae38b3 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | marygovory/python_training | 5ba12d7ac8813215e0392a85b2ef4f314aae38b3 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | marygovory/python_training | 5ba12d7ac8813215e0392a85b2ef4f314aae38b3 | [
"Apache-2.0"
] | null | null | null |
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()... | 31.366071 | 100 | 0.641048 |
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()... | true | true |
1c1d28f3cb33ee183c5d0870ba225e380af16098 | 9,154 | py | Python | xlsxwriter/test/worksheet/test_cond_format22.py | ziembla/forked-pylib-xlsxwiter | 9dbe366a0312c63e2142d451b288c7ed428995d3 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2018-02-26T12:31:41.000Z | 2020-10-10T14:14:11.000Z | xlsxwriter/test/worksheet/test_cond_format22.py | ziembla/forked-pylib-xlsxwiter | 9dbe366a0312c63e2142d451b288c7ed428995d3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_cond_format22.py | ziembla/forked-pylib-xlsxwiter | 9dbe366a0312c63e2142d451b288c7ed428995d3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2017, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAss... | 40.504425 | 171 | 0.378086 | </c>
</row>
<row r="3" spans="1:1">
<c r="A3">
<v>3</v>
</c>
</row>
<row r="4" spans="1:1">
<c r="A4">
<v>4</v>
... | true | true |
1c1d29cc8d2b6b6983886e81b6fdbd3127b458b5 | 217 | py | Python | py_learn/property_attribute.py | blackox626/python_learn | f4ca80305ef586691a284032b615bd68a57aadd5 | [
"MIT"
] | null | null | null | py_learn/property_attribute.py | blackox626/python_learn | f4ca80305ef586691a284032b615bd68a57aadd5 | [
"MIT"
] | null | null | null | py_learn/property_attribute.py | blackox626/python_learn | f4ca80305ef586691a284032b615bd68a57aadd5 | [
"MIT"
] | null | null | null | # property() , @property , __getattr__()、__setattr__() ,getattr()、setattr()
property() # 内置方法
@property # 注解
def f():
pass
'__getattr__()、__setattr__()' # python类特殊方法
getattr(), setattr() # 内置方法 与反射有关系的
| 15.5 | 75 | 0.645161 |
property()
@property
def f():
pass
getattr(), setattr()
| true | true |
1c1d2a242a54d533b691a8cbb2d1287007cc0f64 | 2,776 | py | Python | Modules/Filtering/ImageFeature/wrapping/test/itkGradientVectorFlowImageFilterTest.py | HongdaZ/ITK | f5d004fa3607b8e11edc30f1ba299df35af8aff8 | [
"Apache-2.0"
] | 1 | 2021-01-10T14:19:08.000Z | 2021-01-10T14:19:08.000Z | Modules/Filtering/ImageFeature/wrapping/test/itkGradientVectorFlowImageFilterTest.py | HongdaZ/ITK | f5d004fa3607b8e11edc30f1ba299df35af8aff8 | [
"Apache-2.0"
] | 1 | 2017-03-19T12:56:50.000Z | 2018-10-24T10:40:21.000Z | Modules/Filtering/ImageFeature/wrapping/test/itkGradientVectorFlowImageFilterTest.py | HongdaZ/ITK | f5d004fa3607b8e11edc30f1ba299df35af8aff8 | [
"Apache-2.0"
] | 1 | 2020-07-24T22:58:19.000Z | 2020-07-24T22:58:19.000Z | #==========================================================================
#
# Copyright NumFOCUS
#
# 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/l... | 29.849462 | 78 | 0.731268 |
import itk
from sys import argv
inputFilename = argv[1]
xOutputFilename = argv[2]
yOutputFilename = argv[3]
iterNum = int(argv[4])
noiseLevel = float(argv[5])
timeStep = float(argv[6])
itk.auto_progress(2)
DIM = 2
PixelType = itk.F
GradientPixelType = itk.CovariantVector[PixelType, DIM]
ImageTy... | true | true |
1c1d2b0aa17e6674572929a8e402370b84977f3e | 923 | py | Python | apps/djangoapp/migrations/0005_auto_20220211_1939.py | KonyaKun/07.02.2022 | e7474b50fca92c5859159107db576993a1d1b801 | [
"MIT"
] | null | null | null | apps/djangoapp/migrations/0005_auto_20220211_1939.py | KonyaKun/07.02.2022 | e7474b50fca92c5859159107db576993a1d1b801 | [
"MIT"
] | null | null | null | apps/djangoapp/migrations/0005_auto_20220211_1939.py | KonyaKun/07.02.2022 | e7474b50fca92c5859159107db576993a1d1b801 | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2022-02-11 13:39
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('djangoapp', '0004_professor'),
]
operations = [
migrations.AddField(
model_name='group',
... | 29.774194 | 124 | 0.620802 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('djangoapp', '0004_professor'),
]
operations = [
migrations.AddField(
model_name='group',
name='datetime_created',
field=mo... | true | true |
1c1d2b34748aab0807b80f02fc11e079ace1ea07 | 5,131 | py | Python | dcbr-api/dcbr/settings.py | mk08sh/agri-dcbr | a568b71df363a811747ed0be8fbec5905b56f713 | [
"Apache-2.0"
] | null | null | null | dcbr-api/dcbr/settings.py | mk08sh/agri-dcbr | a568b71df363a811747ed0be8fbec5905b56f713 | [
"Apache-2.0"
] | null | null | null | dcbr-api/dcbr/settings.py | mk08sh/agri-dcbr | a568b71df363a811747ed0be8fbec5905b56f713 | [
"Apache-2.0"
] | null | null | null | """
Django settings for dcbr project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
def p... | 29.32 | 125 | 0.69655 |
import os
def parse_bool(val):
return val and val != "0" and str(val).lower() != "false"
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv(
"DJANGO_SECRET_KEY",
"75f46345-af2d-497d-a3ec-b6f05e5266f4",
)
DEBUG = parse_bool(os.getenv("DJANGO_DEBU... | true | true |
1c1d2bdf1b6636341d67875e00886a2d7b864297 | 545 | py | Python | manage.py | Coderhypo/booklib | cd5369f35ec666b3a864a4f1d0e7fcd8c2f64cec | [
"MIT"
] | null | null | null | manage.py | Coderhypo/booklib | cd5369f35ec666b3a864a4f1d0e7fcd8c2f64cec | [
"MIT"
] | 1 | 2021-06-01T22:04:57.000Z | 2021-06-01T22:04:57.000Z | manage.py | Coderhypo/booklib | cd5369f35ec666b3a864a4f1d0e7fcd8c2f64cec | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from stone.models import init_db
from stone import create_app
app = create_app()
DATA_PATH = app.config['DATA_PATH']
def create_data(data_path):
for path in ["", "db", "images"]:
try:
os.mkdir(os.path.join(data_path, path))
except:
pass
... | 20.961538 | 80 | 0.640367 | import os
from pathlib import Path
from stone.models import init_db
from stone import create_app
app = create_app()
DATA_PATH = app.config['DATA_PATH']
def create_data(data_path):
for path in ["", "db", "images"]:
try:
os.mkdir(os.path.join(data_path, path))
except:
pass
... | true | true |
1c1d2de0699cab6b8569cf463ceeab058fc4f14c | 230 | py | Python | src/UnitTests/TestData/Grammar/AwaitAsyncNames.py | jamesralstin/python-language-server | 53eb5886776c9e75590bf2f5a787ba4015879c4d | [
"Apache-2.0"
] | 695 | 2019-05-06T23:49:37.000Z | 2022-03-30T01:56:00.000Z | src/UnitTests/TestData/Grammar/AwaitAsyncNames.py | jamesralstin/python-language-server | 53eb5886776c9e75590bf2f5a787ba4015879c4d | [
"Apache-2.0"
] | 1,672 | 2019-05-06T21:09:38.000Z | 2022-03-31T23:16:04.000Z | Python/Tests/TestData/Grammar/AwaitAsyncNames.py | RaymonGulati1/PTVS | ee1d09f2a94be4e21016f7579205bb65ec82c616 | [
"Apache-2.0"
] | 186 | 2019-05-13T03:17:37.000Z | 2022-03-31T16:24:05.000Z |
async
await
async = fob
await = fob
fob = async
fob = await
def async(): pass
def await(): pass
class async: pass
class await: pass
async(fob)
await(fob)
fob(async)
fob(await)
fob.async
fob.await
def fob(async, await): pass
| 9.583333 | 27 | 0.704348 |
async
await
async = fob
await = fob
fob = async
fob = await
def async(): pass
def await(): pass
class async: pass
class await: pass
async(fob)
await(fob)
fob(async)
fob(await)
fob.async
fob.await
def fob(async, await): pass
| false | true |
1c1d2eba8c2e6f8b51aab2c7ee9a73e6a0dc0966 | 3,570 | py | Python | toolkit/unzip_trackingnet.py | bit-bcilab/SiamDCA | 78a520f2bf6b89f8dee8b05ca7a9399813f77e92 | [
"Apache-2.0"
] | null | null | null | toolkit/unzip_trackingnet.py | bit-bcilab/SiamDCA | 78a520f2bf6b89f8dee8b05ca7a9399813f77e92 | [
"Apache-2.0"
] | null | null | null | toolkit/unzip_trackingnet.py | bit-bcilab/SiamDCA | 78a520f2bf6b89f8dee8b05ca7a9399813f77e92 | [
"Apache-2.0"
] | null | null | null | import os
from tqdm import tqdm
import zipfile
import argparse
import shutil
def main(trackingnet_dir="TrackingNet", overwrite_frames=False, chunks=[]):
for chunk_folder in chunks:
chunk_folder = chunk_folder.upper()
zip_folder = os.path.join(trackingnet_dir, chunk_folder, "zips")
... | 44.074074 | 121 | 0.532493 | import os
from tqdm import tqdm
import zipfile
import argparse
import shutil
def main(trackingnet_dir="TrackingNet", overwrite_frames=False, chunks=[]):
for chunk_folder in chunks:
chunk_folder = chunk_folder.upper()
zip_folder = os.path.join(trackingnet_dir, chunk_folder, "zips")
... | true | true |
1c1d2ecddf81a26254a20d61e6a0c7edf4a8d20a | 2,736 | py | Python | pybamm/models/submodels/particle/fast/fast_single_particle.py | jedgedrudd/PyBaMM | 79c9d34978382d50e09adaf8bf74c8fa4723f759 | [
"BSD-3-Clause"
] | 1 | 2019-10-29T19:06:04.000Z | 2019-10-29T19:06:04.000Z | pybamm/models/submodels/particle/fast/fast_single_particle.py | jedgedrudd/PyBaMM | 79c9d34978382d50e09adaf8bf74c8fa4723f759 | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/submodels/particle/fast/fast_single_particle.py | jedgedrudd/PyBaMM | 79c9d34978382d50e09adaf8bf74c8fa4723f759 | [
"BSD-3-Clause"
] | null | null | null | #
# Class for single particle with uniform concentration (i.e. infinitely fast
# diffusion in r)
#
import pybamm
from .base_fast_particle import BaseModel
class SingleParticle(BaseModel):
"""Base class for molar conservation in a single x-averaged particle with
uniform concentration in r (i.e. infinitely fas... | 34.2 | 83 | 0.604532 |
import pybamm
from .base_fast_particle import BaseModel
class SingleParticle(BaseModel):
def __init__(self, param, domain):
super().__init__(param, domain)
def get_fundamental_variables(self):
if self.domain == "Negative":
c_s_surf_xav = pybamm.st... | true | true |
1c1d2f01693e35a601c26de150a8059d1e09c4e7 | 2,269 | py | Python | intentBox/coreference/base.py | OpenJarbas/intentBox | 2b12d67fc43f08cf316d3b0eaadd4df239020a5a | [
"Apache-2.0"
] | 2 | 2021-04-27T16:32:35.000Z | 2021-04-29T18:45:58.000Z | intentBox/coreference/base.py | OpenJarbas/intentBox | 2b12d67fc43f08cf316d3b0eaadd4df239020a5a | [
"Apache-2.0"
] | null | null | null | intentBox/coreference/base.py | OpenJarbas/intentBox | 2b12d67fc43f08cf316d3b0eaadd4df239020a5a | [
"Apache-2.0"
] | 1 | 2021-04-27T16:48:19.000Z | 2021-04-27T16:48:19.000Z |
class CoreferenceSolver:
cache = {}
contexts = {}
prev_sentence = ""
prev_solved = ""
def __init__(self, lang="en"):
self.lang = lang
@staticmethod
def extract_replacements(original, solved):
a = original.lower()
b = solved.lower()
chunk = a.split(" ")
... | 31.513889 | 68 | 0.483473 |
class CoreferenceSolver:
cache = {}
contexts = {}
prev_sentence = ""
prev_solved = ""
def __init__(self, lang="en"):
self.lang = lang
@staticmethod
def extract_replacements(original, solved):
a = original.lower()
b = solved.lower()
chunk = a.split(" ")
... | true | true |
1c1d30ba4b5c12b36d4e439f3f85037c3f954f16 | 10,890 | py | Python | tensorflow/python/keras/utils/tf_utils.py | jackode/tensorflow | 11f4ecb54708865ec757ca64e4805957b05d7570 | [
"Apache-2.0"
] | 1 | 2019-08-22T02:47:35.000Z | 2019-08-22T02:47:35.000Z | tensorflow/python/keras/utils/tf_utils.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/utils/tf_utils.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 1 | 2021-05-21T15:00:04.000Z | 2021-05-21T15:00:04.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 30.25 | 80 | 0.712948 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.eager import context
from tensorflow.python.framework import composite_tensor
from tensorflow.python.framework import ops
from tensorflow.python.framework import... | true | true |
1c1d30be6add6c6a65eed7d7ccf250dc030412d9 | 36,774 | py | Python | futu/trade/open_trade_context.py | foundations/py-futu-api | b8f9fb1f26f35f99630ca47863f5595b6e635533 | [
"Apache-2.0"
] | 858 | 2018-11-12T12:54:56.000Z | 2022-03-10T17:35:43.000Z | futu/trade/open_trade_context.py | FutunnOpen/futu-api | b8f9fb1f26f35f99630ca47863f5595b6e635533 | [
"Apache-2.0"
] | 113 | 2018-11-12T01:52:31.000Z | 2022-02-27T03:53:07.000Z | futu/trade/open_trade_context.py | FutunnOpen/futu-api | b8f9fb1f26f35f99630ca47863f5595b6e635533 | [
"Apache-2.0"
] | 201 | 2018-11-19T08:32:45.000Z | 2022-03-23T06:39:02.000Z | # -*- coding: utf-8 -*-
import pandas as pd
from futu.common.open_context_base import OpenContextBase
from futu.trade.trade_query import *
from futu.common.err import *
from futu.common.constant import *
class OpenTradeContextBase(OpenContextBase):
"""Class for set context of HK stock trade"""
def __init__(s... | 39.627155 | 193 | 0.596808 |
import pandas as pd
from futu.common.open_context_base import OpenContextBase
from futu.trade.trade_query import *
from futu.common.err import *
from futu.common.constant import *
class OpenTradeContextBase(OpenContextBase):
def __init__(self, trd_mkt, host="127.0.0.1", port=11111, is_encrypt=None, security_fir... | true | true |
1c1d315896e4b143d0228c7069e0092378470f30 | 568 | py | Python | src/groups/urls.py | ITXlebyshek/cappa | bf21729e6d3d87767cdf314a73803e2d6598ad5b | [
"MIT"
] | null | null | null | src/groups/urls.py | ITXlebyshek/cappa | bf21729e6d3d87767cdf314a73803e2d6598ad5b | [
"MIT"
] | null | null | null | src/groups/urls.py | ITXlebyshek/cappa | bf21729e6d3d87767cdf314a73803e2d6598ad5b | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from django.conf.urls import url
from src.groups import views
urlpatterns = [
url(r'^$', views.GroupListView.as_view(), name='groups'),
url(r'^(?P<group_id>[0-9]+)/$', views.GroupView.as_view(), name='group'),
url(r'^(?P<group_id>[0-9]+)/courses/(?P<group_course_id>[0-9]+)/$',
... | 35.5 | 81 | 0.610915 |
from django.conf.urls import url
from src.groups import views
urlpatterns = [
url(r'^$', views.GroupListView.as_view(), name='groups'),
url(r'^(?P<group_id>[0-9]+)/$', views.GroupView.as_view(), name='group'),
url(r'^(?P<group_id>[0-9]+)/courses/(?P<group_course_id>[0-9]+)/$',
views.GroupCourseVie... | true | true |
1c1d32d32a53da7e5a6694ce4daa15cd44db32f3 | 5,351 | py | Python | datasets/medmcqa/medmcqa.py | leondz/datasets | 4110fb6034f79c5fb470cf1043ff52180e9c63b7 | [
"Apache-2.0"
] | 3,395 | 2020-05-13T21:16:50.000Z | 2020-09-10T14:36:50.000Z | datasets/medmcqa/medmcqa.py | leondz/datasets | 4110fb6034f79c5fb470cf1043ff52180e9c63b7 | [
"Apache-2.0"
] | 370 | 2020-05-13T21:28:57.000Z | 2020-09-10T11:03:38.000Z | datasets/medmcqa/medmcqa.py | leondz/datasets | 4110fb6034f79c5fb470cf1043ff52180e9c63b7 | [
"Apache-2.0"
] | 258 | 2020-05-15T01:17:09.000Z | 2020-09-10T12:41:43.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 45.735043 | 698 | 0.652775 |
import json
import os
import datasets
_DESCRIPTION = """\
MedMCQA is a large-scale, Multiple-Choice Question Answering (MCQA) dataset designed to address real-world medical entrance exam questions.
MedMCQA has more than 194k high-quality AIIMS & NEET PG entrance exam MCQs covering 2.4k healthcare top... | true | true |
1c1d32e1882c6d0c8509cf67ff55ddf3443c18e0 | 12,608 | py | Python | aiocqhttp/message.py | ishkong/aiocqhttp | a48d65e1832cb69681ca1b5fcf88dea626cd0b6d | [
"MIT"
] | null | null | null | aiocqhttp/message.py | ishkong/aiocqhttp | a48d65e1832cb69681ca1b5fcf88dea626cd0b6d | [
"MIT"
] | null | null | null | aiocqhttp/message.py | ishkong/aiocqhttp | a48d65e1832cb69681ca1b5fcf88dea626cd0b6d | [
"MIT"
] | null | null | null | """
此模块提供了消息相关类。
"""
import re
from typing import Iterable, Dict, Tuple, Any, Optional
def escape(s: str, *, escape_comma: bool = True) -> str:
"""
对字符串进行 CQ 码转义。
``escape_comma`` 参数控制是否转义逗号(``,``)。
"""
s = s.replace('&', '&') \
.replace('[', '[') \
.replace(']', ']')... | 31.207921 | 78 | 0.452649 |
import re
from typing import Iterable, Dict, Tuple, Any, Optional
def escape(s: str, *, escape_comma: bool = True) -> str:
s = s.replace('&', '&') \
.replace('[', '[') \
.replace(']', ']')
if escape_comma:
s = s.replace(',', ',')
return s
def unescape(s: str) -> ... | true | true |
1c1d333cb7d27532155c7158e8cc24a4908e2718 | 1,889 | py | Python | examples/plotting/file/unemployment.py | goncaloperes/bokeh | b857d2d17d7c19779bb0a7be2601d8238fb1d5e9 | [
"BSD-3-Clause"
] | 1 | 2021-04-09T02:57:29.000Z | 2021-04-09T02:57:29.000Z | examples/plotting/file/unemployment.py | goncaloperes/bokeh | b857d2d17d7c19779bb0a7be2601d8238fb1d5e9 | [
"BSD-3-Clause"
] | 1 | 2021-03-01T14:04:56.000Z | 2021-03-01T14:04:56.000Z | examples/plotting/file/unemployment.py | goncaloperes/bokeh | b857d2d17d7c19779bb0a7be2601d8238fb1d5e9 | [
"BSD-3-Clause"
] | null | null | null | from math import pi
import pandas as pd
from bokeh.io import show
from bokeh.models import BasicTicker, ColorBar, LinearColorMapper, PrintfTickFormatter
from bokeh.plotting import figure
from bokeh.sampledata.unemployment1948 import data
data['Year'] = data['Year'].astype(str)
data = data.set_index('Year')
data.drop... | 36.326923 | 108 | 0.688195 | from math import pi
import pandas as pd
from bokeh.io import show
from bokeh.models import BasicTicker, ColorBar, LinearColorMapper, PrintfTickFormatter
from bokeh.plotting import figure
from bokeh.sampledata.unemployment1948 import data
data['Year'] = data['Year'].astype(str)
data = data.set_index('Year')
data.drop... | true | true |
1c1d3467fe832215492835f105fafc1c252e7912 | 17,368 | py | Python | tests/mypy_test.py | Harry-Lees/typeshed | 5fa31e675980226416272271b86def0d88915f9b | [
"Apache-2.0"
] | 2 | 2022-01-02T05:45:47.000Z | 2022-01-19T04:00:42.000Z | tests/mypy_test.py | Harry-Lees/typeshed | 5fa31e675980226416272271b86def0d88915f9b | [
"Apache-2.0"
] | 12 | 2022-01-02T13:23:13.000Z | 2022-01-30T06:02:03.000Z | tests/mypy_test.py | Harry-Lees/typeshed | 5fa31e675980226416272271b86def0d88915f9b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Test runner for typeshed.
Depends on mypy being installed.
Approach:
1. Parse sys.argv
2. Compute appropriate arguments for mypy
3. Pass those arguments to mypy.api.run()
"""
from __future__ import annotations
import argparse
import os
import re
import shutil
import subprocess
import sys
i... | 35.663244 | 123 | 0.641179 |
from __future__ import annotations
import argparse
import os
import re
import shutil
import subprocess
import sys
import tempfile
from collections.abc import Iterable
from contextlib import redirect_stderr, redirect_stdout
from io import StringIO
from pathlib import Path
from typing import TYPE_CHECKING, NamedTuple
... | true | true |
1c1d347a64bad68d535f02d2168721af4c015471 | 9,785 | py | Python | CMTVEM_train_validate.py | Chemformalixer/Machine-Learning-Multiple-Target-Vars | eb42646e265aa594f7bdca1288764ef26a1096c1 | [
"Apache-2.0"
] | null | null | null | CMTVEM_train_validate.py | Chemformalixer/Machine-Learning-Multiple-Target-Vars | eb42646e265aa594f7bdca1288764ef26a1096c1 | [
"Apache-2.0"
] | null | null | null | CMTVEM_train_validate.py | Chemformalixer/Machine-Learning-Multiple-Target-Vars | eb42646e265aa594f7bdca1288764ef26a1096c1 | [
"Apache-2.0"
] | null | null | null | #####################################################################################################################################################
#####################################################################################################################################################
### ... | 59.664634 | 201 | 0.582831 | true | true | |
1c1d352f7048f17bc265e99f83e0fcb73ae6dec9 | 4,699 | py | Python | cwbot/kolextra/request/ClanDungeonLootRequest.py | ijzer/cwbot-ndy | ea746010d544bd5ae68dad3613326cd09f9da09a | [
"BSD-3-Clause"
] | null | null | null | cwbot/kolextra/request/ClanDungeonLootRequest.py | ijzer/cwbot-ndy | ea746010d544bd5ae68dad3613326cd09f9da09a | [
"BSD-3-Clause"
] | 1 | 2021-03-02T21:41:31.000Z | 2021-03-02T21:41:31.000Z | cwbot/kolextra/request/ClanDungeonLootRequest.py | ijzer/cwbot-ndy | ea746010d544bd5ae68dad3613326cd09f9da09a | [
"BSD-3-Clause"
] | 4 | 2018-05-01T01:06:41.000Z | 2021-03-02T17:49:43.000Z | from kol.request.GenericRequest import GenericRequest
from kol.manager import PatternManager
def _nameKey(x):
return "".join(x.split()).strip().lower()
class ClanDungeonLootRequest(GenericRequest):
_hoboLoot = ["Ol' Scratch's ash can","Ol' Scratch's ol' britches","Ol' Scratch's stovepipe hat","Ol' Scratch's i... | 78.316667 | 354 | 0.63737 | from kol.request.GenericRequest import GenericRequest
from kol.manager import PatternManager
def _nameKey(x):
return "".join(x.split()).strip().lower()
class ClanDungeonLootRequest(GenericRequest):
_hoboLoot = ["Ol' Scratch's ash can","Ol' Scratch's ol' britches","Ol' Scratch's stovepipe hat","Ol' Scratch's i... | true | true |
1c1d3563e2db5cae9f46e5f7e4c764856fb7aceb | 1,034 | py | Python | app/migrations/0002_auto_20180220_2202.py | burdagay/my-steemit-portal | 47e542056dec3e97524da695e6f7ae6f26757057 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20180220_2202.py | burdagay/my-steemit-portal | 47e542056dec3e97524da695e6f7ae6f26757057 | [
"MIT"
] | 1 | 2020-06-05T17:32:08.000Z | 2020-06-05T17:32:08.000Z | app/migrations/0002_auto_20180220_2202.py | burdagay/my-steemit-portal | 47e542056dec3e97524da695e6f7ae6f26757057 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-20 14:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Context',
fields=[
('id', mode... | 31.333333 | 114 | 0.556093 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Context',
fields=[
('id', models.AutoField(auto_created=True, primary_key=Tru... | true | true |
1c1d357c9480f3bcdca17ad22257d2b23a8444fb | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | BBurki/rest-api-course | a2185f91452e162c6e7c0050c193b729fed3270d | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | BBurki/rest-api-course | a2185f91452e162c6e7c0050c193b729fed3270d | [
"MIT"
] | 7 | 2020-06-06T01:35:41.000Z | 2022-02-10T11:21:21.000Z | profiles_api/migrations/0001_initial.py | BBurki/rest-api-course | a2185f91452e162c6e7c0050c193b729fed3270d | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-03-31 20:49
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.Au... | true | true |
1c1d35c6ff5932b5ec81ebabe6f555d975b57a45 | 6,851 | py | Python | tests/p2p/discv5/test_topic_table.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | tests/p2p/discv5/test_topic_table.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | tests/p2p/discv5/test_topic_table.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | import pytest
from p2p.discv5.topic_table import TopicTable
from p2p.tools.factories.discovery import (
ENRFactory,
TopicFactory,
)
@pytest.fixture
def max_queue_size():
return 5
@pytest.fixture
def max_total_size():
return 15
@pytest.fixture
def target_ad_lifetime():
return 5
@pytest.fixt... | 34.60101 | 89 | 0.730696 | import pytest
from p2p.discv5.topic_table import TopicTable
from p2p.tools.factories.discovery import (
ENRFactory,
TopicFactory,
)
@pytest.fixture
def max_queue_size():
return 5
@pytest.fixture
def max_total_size():
return 15
@pytest.fixture
def target_ad_lifetime():
return 5
@pytest.fixt... | true | true |
1c1d369699880b27ca7e2d1ab3c72c3b4246ca7e | 868 | py | Python | linked_list/reverse_linked_list.py | itsvinayak/cracking_the_codeing_interview | 7347f7e831b306c4c4314bd2d41809a5b5741497 | [
"MIT"
] | 4 | 2020-07-19T03:49:43.000Z | 2021-06-29T07:13:39.000Z | linked_list/reverse_linked_list.py | itsvinayak/cracking_the_codeing_interview | 7347f7e831b306c4c4314bd2d41809a5b5741497 | [
"MIT"
] | 1 | 2020-04-01T06:40:45.000Z | 2020-04-01T06:41:22.000Z | linked_list/reverse_linked_list.py | itsvinayak/cracking_the_codeing_interview | 7347f7e831b306c4c4314bd2d41809a5b5741497 | [
"MIT"
] | 1 | 2020-08-14T18:14:04.000Z | 2020-08-14T18:14:04.000Z | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def push(self, new_data):
new_node = Node(new_data)
new_node.next = self.head
self.head = new_node
def reverse... | 20.186047 | 61 | 0.524194 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def push(self, new_data):
new_node = Node(new_data)
new_node.next = self.head
self.head = new_node
def reverse... | true | true |
1c1d36e08bb1ffadf797b5ba2cba0602edf4177a | 6,642 | py | Python | scripts/katcp_cli.py | TobiasWinchen/mpikat | 46ea86d6861bcfd924daad7058de8a898ee6c6a1 | [
"MIT"
] | null | null | null | scripts/katcp_cli.py | TobiasWinchen/mpikat | 46ea86d6861bcfd924daad7058de8a898ee6c6a1 | [
"MIT"
] | null | null | null | scripts/katcp_cli.py | TobiasWinchen/mpikat | 46ea86d6861bcfd924daad7058de8a898ee6c6a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import logging
import sys
import traceback
import katcp
import readline
import codecs
import re
from optparse import OptionParser
from cmd2 import Cmd
from katcp import DeviceClient
import datetime
logging.basicConfig(level=logging.INFO,
... | 33.376884 | 158 | 0.582505 |
from __future__ import print_function
import logging
import sys
import traceback
import katcp
import readline
import codecs
import re
from optparse import OptionParser
from cmd2 import Cmd
from katcp import DeviceClient
import datetime
logging.basicConfig(level=logging.INFO,
stream=sys.stderr,
... | true | true |
1c1d37d2764380d878b96f3ec62618bd799f3c71 | 2,079 | py | Python | django_forms/forms_project/forms_app/migrations/0001_initial.py | joyliao07/django_review | e4311d2ccbb96646a6867e5fc426ca67a122d7ed | [
"MIT"
] | null | null | null | django_forms/forms_project/forms_app/migrations/0001_initial.py | joyliao07/django_review | e4311d2ccbb96646a6867e5fc426ca67a122d7ed | [
"MIT"
] | 8 | 2020-02-12T00:30:10.000Z | 2021-06-10T18:16:37.000Z | django_forms/forms_project/forms_app/migrations/0001_initial.py | joyliao07/django_review | e4311d2ccbb96646a6867e5fc426ca67a122d7ed | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-05-03 01:17
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | 39.980769 | 121 | 0.59115 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c1d39edce3722e506c0a6568b3e2254bb944270 | 2,162 | py | Python | python_example/test_l09.py | assassinen/sel-3 | 6b712c7e86f030e4d06e20bc5b3ea2177b128333 | [
"Apache-2.0"
] | 1 | 2017-06-09T06:53:43.000Z | 2017-06-09T06:53:43.000Z | python_example/test_l09.py | assassinen/sel-3 | 6b712c7e86f030e4d06e20bc5b3ea2177b128333 | [
"Apache-2.0"
] | null | null | null | python_example/test_l09.py | assassinen/sel-3 | 6b712c7e86f030e4d06e20bc5b3ea2177b128333 | [
"Apache-2.0"
] | null | null | null | __author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from python_example.fixture.fixture import driver
def test_l09_1(driver):
... | 43.24 | 169 | 0.724792 | __author__ = 'NovikovII'
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from python_example.fixture.fixture import driver
def test_l09_1(driver):
driver.get("http://localhost/litecart/admin/?... | true | true |
1c1d39f9d85e5cb9dbcb9d5711181b00ff8c55ef | 1,179 | py | Python | bluclobber/harness/utils.py | UCL-dataspring/cluster-code | 8e0d9f24f150537c1712de4cbe768bf53b7d6986 | [
"MIT"
] | 3 | 2015-07-13T21:00:39.000Z | 2019-01-16T08:44:00.000Z | bluclobber/harness/utils.py | UCL-dataspring/cluster-code | 8e0d9f24f150537c1712de4cbe768bf53b7d6986 | [
"MIT"
] | 1 | 2015-07-22T13:54:04.000Z | 2015-08-10T13:33:52.000Z | bluclobber/harness/utils.py | UCL-dataspring/cluster-code | 8e0d9f24f150537c1712de4cbe768bf53b7d6986 | [
"MIT"
] | 3 | 2018-03-27T10:57:04.000Z | 2019-01-30T16:15:06.000Z | def merge(dicta, dictb):
dicta.update(dictb)
return dicta
from functools import reduce
from collections import defaultdict
from collections import deque
from itertools import islice
import re
lowalpha=re.compile('[^a-z]')
def normalize(word):
return re.sub(lowalpha,'',word.lower())
def add(x,y):
re... | 23.58 | 56 | 0.615776 | def merge(dicta, dictb):
dicta.update(dictb)
return dicta
from functools import reduce
from collections import defaultdict
from collections import deque
from itertools import islice
import re
lowalpha=re.compile('[^a-z]')
def normalize(word):
return re.sub(lowalpha,'',word.lower())
def add(x,y):
re... | true | true |
1c1d3a389e41f3a4c645e411feef717d80365577 | 1,202 | py | Python | raspberry-pi/aws_connect_and_send.py | CiTRuS93/arduino-raspi-lora | 26efaa5f6481061cc256a5ed26d57feed3cfb012 | [
"MIT"
] | 4 | 2020-10-14T15:29:26.000Z | 2021-01-30T18:31:10.000Z | raspberry-pi/aws_connect_and_send.py | CiTRuS93/arduino-raspi-lora | 26efaa5f6481061cc256a5ed26d57feed3cfb012 | [
"MIT"
] | null | null | null | raspberry-pi/aws_connect_and_send.py | CiTRuS93/arduino-raspi-lora | 26efaa5f6481061cc256a5ed26d57feed3cfb012 | [
"MIT"
] | null | null | null | import json
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
from datetime import datetime
# For certificate based connection
myMQTTClient = AWSIoTMQTTClient("tryout")
# For Websocket connection
# myMQTTClient = AWSIoTMQTTClient("myClientID", useWebsocket=True)
# Configurations
# For TLS mutual authentication
myM... | 36.424242 | 85 | 0.80782 | import json
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
from datetime import datetime
myMQTTClient = AWSIoTMQTTClient("tryout")
myMQTTClient.configureEndpoint("MyEndpoint.amazonaws.com", 8883)
myMQTTClient.configureCredentials("myCertLocation")
myMQTTClient.configureOfflinePublishQueueing(-1)
my... | true | true |
1c1d3deb61b3dd4f9337a95966d8b7339aa708b1 | 906 | py | Python | examples/moduletest.py | lmodule/lmodule | e0242505dae800789beeb81e57a9698db2a83188 | [
"MIT"
] | 3 | 2020-03-05T04:12:53.000Z | 2020-03-18T10:38:13.000Z | examples/moduletest.py | lmodule/lmodule | e0242505dae800789beeb81e57a9698db2a83188 | [
"MIT"
] | 4 | 2021-03-31T14:55:21.000Z | 2022-03-02T09:50:55.000Z | examples/moduletest.py | lmodule/lmodule | e0242505dae800789beeb81e57a9698db2a83188 | [
"MIT"
] | 1 | 2020-03-05T15:34:52.000Z | 2020-03-05T15:34:52.000Z | import os, sys
from lmod.module import Module
mod_names = ["GCCcore", "Python"]
a = Module(mod_names)
module_cmds = a.get_command()
rc = a.test_modules()
if rc == 0:
print(f"The following modules: {mod_names} were loaded successfully")
print("\n")
print(f"Command Executed: {module_cmds}")
# passing a ... | 24.486486 | 74 | 0.703091 | import os, sys
from lmod.module import Module
mod_names = ["GCCcore", "Python"]
a = Module(mod_names)
module_cmds = a.get_command()
rc = a.test_modules()
if rc == 0:
print(f"The following modules: {mod_names} were loaded successfully")
print("\n")
print(f"Command Executed: {module_cmds}")
bad_names =... | true | true |
1c1d430a0a647322dcd50981cdfdd792b6f246ed | 3,550 | py | Python | resource/DrawableWriter.py | soumikmohianuta/pixtoapp | f103a580e015ef7779998f14c9533a238a4bf1d1 | [
"BSD-3-Clause"
] | 31 | 2018-03-19T19:30:29.000Z | 2022-02-16T08:50:42.000Z | resource/DrawableWriter.py | soumikmohianuta/pixtoapp | f103a580e015ef7779998f14c9533a238a4bf1d1 | [
"BSD-3-Clause"
] | 4 | 2018-10-04T08:01:15.000Z | 2019-04-25T15:50:36.000Z | resource/DrawableWriter.py | soumikmohianuta/pixtoapp | f103a580e015ef7779998f14c9533a238a4bf1d1 | [
"BSD-3-Clause"
] | 12 | 2018-07-24T18:52:07.000Z | 2021-07-15T11:36:14.000Z | from Utils import Constants, ImageUtil
from resource import Resource
from RectUtils import RectView
import cv2
import copy
from RectUtils import RectUtil
from RectUtils import Rect
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
class DrawableWriter(Resource.Resource):
# private final Str... | 31.140351 | 103 | 0.643662 | from Utils import Constants, ImageUtil
from resource import Resource
from RectUtils import RectView
import cv2
import copy
from RectUtils import RectUtil
from RectUtils import Rect
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
class DrawableWriter(Resource.Resource):
def __... | true | true |
1c1d43e9ce18a7619ef7c42d5017dc641ae4adcb | 5,491 | py | Python | Recognition/transformer_xl/utils/log_uniform_sampler.py | MengLcool/Ac-OCR | 370152cc33995f41ee79374b3f5d62e94fea09d3 | [
"MIT"
] | 1 | 2021-07-11T10:24:58.000Z | 2021-07-11T10:24:58.000Z | Recognition/transformer_xl/utils/log_uniform_sampler.py | MengLcool/Oc-OCR | 370152cc33995f41ee79374b3f5d62e94fea09d3 | [
"MIT"
] | null | null | null | Recognition/transformer_xl/utils/log_uniform_sampler.py | MengLcool/Oc-OCR | 370152cc33995f41ee79374b3f5d62e94fea09d3 | [
"MIT"
] | null | null | null | import torch
from torch import nn
import numpy as np
class LogUniformSampler(object):
def __init__(self, range_max, n_sample):
"""
Reference : https://github.com/tensorflow/tensorflow/blob/r1.10/tensorflow/python/ops/candidate_sampling_ops.py
`P(class) = (log(class + 2) - log(cl... | 37.101351 | 122 | 0.603533 | import torch
from torch import nn
import numpy as np
class LogUniformSampler(object):
def __init__(self, range_max, n_sample):
with torch.no_grad():
self.range_max = range_max
log_indices = torch.arange(1., range_max+2., 1.).log_()
self.dist = (log_indices[1:] -... | true | true |
1c1d43faf5bf3b32655b6e178933e6c0cef27df4 | 477 | py | Python | Python/NeonOcean.S4.Main/NeonOcean/S4/Main/DebugReporting.py | NeonOcean/Main | 2d85e6d4428f01294d2d34f1807287b753f7490c | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:44.000Z | 2021-05-20T19:33:44.000Z | Python/NeonOcean.S4.Main/NeonOcean/S4/Main/DebugReporting.py | NeonOcean/Main | 2d85e6d4428f01294d2d34f1807287b753f7490c | [
"CC-BY-4.0"
] | 1 | 2020-06-24T22:50:05.000Z | 2020-06-24T22:50:05.000Z | Python/NeonOcean.S4.Main/NeonOcean/S4/Main/DebugReporting.py | NeonOcean/S4.Main | 2d85e6d4428f01294d2d34f1807287b753f7490c | [
"CC-BY-4.0"
] | null | null | null | import typing
from NeonOcean.S4.Main import LoadingShared, Reporting, Debug
def _DebugLogCollector () -> typing.List[str]:
return Debug.ActiveLogger().GetLogFilesToBeReported()
# noinspection PyUnusedLocal
def _OnStart (cause: LoadingShared.LoadingCauses) -> None:
Reporting.RegisterReportFileCollector(_DebugLogColl... | 36.692308 | 61 | 0.832285 | import typing
from NeonOcean.S4.Main import LoadingShared, Reporting, Debug
def _DebugLogCollector () -> typing.List[str]:
return Debug.ActiveLogger().GetLogFilesToBeReported()
def _OnStart (cause: LoadingShared.LoadingCauses) -> None:
Reporting.RegisterReportFileCollector(_DebugLogCollector)
def _OnStop (cause:... | true | true |
1c1d4416a66777e3fa13c5b032b39a19defb67df | 1,423 | py | Python | compliance/test_client.py | parmentelat/websockets | 207518d813347b42d5f2fb9f50b09bd101016a24 | [
"BSD-3-Clause"
] | 1 | 2020-07-21T20:13:04.000Z | 2020-07-21T20:13:04.000Z | compliance/test_client.py | parmentelat/websockets | 207518d813347b42d5f2fb9f50b09bd101016a24 | [
"BSD-3-Clause"
] | null | null | null | compliance/test_client.py | parmentelat/websockets | 207518d813347b42d5f2fb9f50b09bd101016a24 | [
"BSD-3-Clause"
] | 1 | 2020-12-18T09:14:03.000Z | 2020-12-18T09:14:03.000Z | import json
import logging
import urllib.parse
import asyncio
import websockets
logging.basicConfig(level=logging.WARNING)
# Uncomment this line to make only websockets more verbose.
# logging.getLogger('websockets').setLevel(logging.DEBUG)
SERVER = 'ws://127.0.0.1:8642'
AGENT = 'websockets'
async def get_case_... | 25.872727 | 77 | 0.668306 | import json
import logging
import urllib.parse
import asyncio
import websockets
logging.basicConfig(level=logging.WARNING)
SERVER = 'ws://127.0.0.1:8642'
AGENT = 'websockets'
async def get_case_count(server):
uri = server + '/getCaseCount'
ws = await websockets.connect(uri)
msg = await ws.recv()
... | true | true |
1c1d45b6715982b34a08cb5a4d252b6b356100d3 | 42,305 | py | Python | sdk/python/pulumi_akamai/properties/property.py | pulumi/pulumi-akamai | 85f933ccf2f61738b3074a13fa718132280f8364 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2021-01-21T15:22:12.000Z | 2021-08-25T14:15:29.000Z | sdk/python/pulumi_akamai/properties/property.py | pulumi/pulumi-akamai | 85f933ccf2f61738b3074a13fa718132280f8364 | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2020-08-13T14:39:36.000Z | 2022-03-31T15:19:48.000Z | sdk/python/pulumi_akamai/properties/property.py | pulumi/pulumi-akamai | 85f933ccf2f61738b3074a13fa718132280f8364 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 44.909766 | 142 | 0.638412 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['PropertyArgs', 'Property']
@pulumi.input_type
class PropertyArgs:
def __init__(__self__, *,
... | true | true |
1c1d45dba58a5047f913c44fe2ab8c75da204dad | 724 | py | Python | blog_clone/app_clone/migrations/0006_auto_20210603_2336.py | bikash-pal/blog_site_django | d1736551f6e3cdd80114483556d60da691ee1a06 | [
"MIT"
] | null | null | null | blog_clone/app_clone/migrations/0006_auto_20210603_2336.py | bikash-pal/blog_site_django | d1736551f6e3cdd80114483556d60da691ee1a06 | [
"MIT"
] | null | null | null | blog_clone/app_clone/migrations/0006_auto_20210603_2336.py | bikash-pal/blog_site_django | d1736551f6e3cdd80114483556d60da691ee1a06 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-06-03 18:06
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('app_clone', '0005_auto_20210603_2336'),
]
operations = [
migrations.AlterField(
... | 27.846154 | 109 | 0.621547 |
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('app_clone', '0005_auto_20210603_2336'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='c... | true | true |
1c1d477aa9d2ac3dcf6aa2540dc7d8a5d7ab3527 | 3,161 | py | Python | backend/model.py | VoidlessVoid7/eLibrary | 4158c1e720a15527ce4d337636d143f324806e9e | [
"BSD-2-Clause"
] | 1 | 2021-04-05T09:25:30.000Z | 2021-04-05T09:25:30.000Z | backend/model.py | VoidlessVoid7/eLibrary | 4158c1e720a15527ce4d337636d143f324806e9e | [
"BSD-2-Clause"
] | null | null | null | backend/model.py | VoidlessVoid7/eLibrary | 4158c1e720a15527ce4d337636d143f324806e9e | [
"BSD-2-Clause"
] | 1 | 2021-07-21T05:54:45.000Z | 2021-07-21T05:54:45.000Z | import pandas as pd
import numpy as np
import pandas as pd
import numpy as np
from flask import jsonify
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
from sklearn.metrics.pairwise import linear_kernel
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.... | 34.736264 | 95 | 0.71528 | import pandas as pd
import numpy as np
import pandas as pd
import numpy as np
from flask import jsonify
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
from sklearn.metrics.pairwise import linear_kernel
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.... | true | true |
1c1d48f064986beae9db7cdd00acd93cd2204a69 | 300 | py | Python | pattern_q.py | Akshara2820/Python_WhileLoop | d525b547bc8c8236cb2cd1881080ec4e6604fffc | [
"MIT"
] | 1 | 2021-09-15T03:42:15.000Z | 2021-09-15T03:42:15.000Z | pattern_q.py | Akshara2820/Python_WhileLoop | d525b547bc8c8236cb2cd1881080ec4e6604fffc | [
"MIT"
] | null | null | null | pattern_q.py | Akshara2820/Python_WhileLoop | d525b547bc8c8236cb2cd1881080ec4e6604fffc | [
"MIT"
] | null | null | null |
# *
# * *
# * * *
# * * * *
# * * *
# * *
# *
# row=int(input("enter no."))
# for i in range(row):
# print(" "*(row-i)+"* "*(i+1))
# for j in range(row-1):
# print(" "*(j+2)+"* "*(row-1-j))
| 10 | 38 | 0.233333 | true | true | |
1c1d4a8633a9e5a863a35e81dcba0c8d41eda9c6 | 3,416 | py | Python | src/aijack/attack/inversion/gan_attack.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | src/aijack/attack/inversion/gan_attack.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/attack/inversion/gan_attack.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:46.000Z | 2022-03-17T21:17:46.000Z | import copy
import torch
from ..base_attack import BaseAttacker
class GAN_Attack(BaseAttacker):
"""GAN based model inversion attack (https://arxiv.org/abs/1702.07464)
Attributes:
model (torch.nn.Module):
target_label(int): index of target class
generator (torch.nn.Module): Generator... | 31.925234 | 99 | 0.60041 | import copy
import torch
from ..base_attack import BaseAttacker
class GAN_Attack(BaseAttacker):
def __init__(
self,
client,
target_label,
generator,
generator_optimizer,
generator_criterion,
nz=100,
device="cpu",
):
super().__init__(ta... | true | true |
1c1d4b0b3c0d9e19ea1e250e47faeb279cba2e60 | 29 | py | Python | index.py | saraswati05/Real-Ai-Assistant | 8388838e6ee53f2eb9884f6907579b597f8592ab | [
"MIT"
] | null | null | null | index.py | saraswati05/Real-Ai-Assistant | 8388838e6ee53f2eb9884f6907579b597f8592ab | [
"MIT"
] | 1 | 2019-09-22T08:33:00.000Z | 2019-09-22T08:33:00.000Z | index.py | saraswati05/Real-Ai-Assistant | 8388838e6ee53f2eb9884f6907579b597f8592ab | [
"MIT"
] | null | null | null | echo 'hello';
echo 'world';
| 7.25 | 13 | 0.62069 | echo 'hello';
echo 'world';
| false | true |
1c1d4bb6f0ff915dbaafcd98d30f81d5c3f863a5 | 36,804 | py | Python | structures/isozyme.py | tyo-nu/SimAL | 8e9c289bbd77ce2a0bcd998f2dee27990af74a0f | [
"MIT"
] | 2 | 2018-11-18T01:49:27.000Z | 2021-08-24T01:49:00.000Z | structures/isozyme.py | tyo-nu/SimAL | 8e9c289bbd77ce2a0bcd998f2dee27990af74a0f | [
"MIT"
] | null | null | null | structures/isozyme.py | tyo-nu/SimAL | 8e9c289bbd77ce2a0bcd998f2dee27990af74a0f | [
"MIT"
] | 1 | 2020-08-17T14:00:48.000Z | 2020-08-17T14:00:48.000Z | __author__ = 'Dante'
from reaction import BrendaReaction
from reaction import SDFReaction
from databases import db_queries as dbq
import numpy as np
from rdkit import Chem
from rdkit.Chem import MCS
import fingerprinter as fptr
import pybel
from sklearn.cluster import AgglomerativeClustering as AC
from skle... | 38.946032 | 181 | 0.661912 | __author__ = 'Dante'
from reaction import BrendaReaction
from reaction import SDFReaction
from databases import db_queries as dbq
import numpy as np
from rdkit import Chem
from rdkit.Chem import MCS
import fingerprinter as fptr
import pybel
from sklearn.cluster import AgglomerativeClustering as AC
from skle... | false | true |
1c1d4c347c40ac9e345e9c1e6d5db2e8dece2b6f | 10,973 | py | Python | py/cvangysel-tests/trec_utils_tests.py | cvangysel/cvangysel-common | 636d056b5070bf55415e692f9843760dc285a77f | [
"MIT"
] | null | null | null | py/cvangysel-tests/trec_utils_tests.py | cvangysel/cvangysel-common | 636d056b5070bf55415e692f9843760dc285a77f | [
"MIT"
] | null | null | null | py/cvangysel-tests/trec_utils_tests.py | cvangysel/cvangysel-common | 636d056b5070bf55415e692f9843760dc285a77f | [
"MIT"
] | 1 | 2018-07-24T18:17:38.000Z | 2018-07-24T18:17:38.000Z | import unittest
from cvangysel import trec_utils, io_utils
class TRECUtilsTest(unittest.TestCase):
DOC = """<DOC>
<DOCNO>FT922-5992</DOCNO>
<PROFILE>_AN-CE1BRAAAFT</PROFILE>
<DATE>920527
</DATE>
<HEADLINE>
FT 27 MAY 92 / World News In Brief: No second term
</HEADLINE>
<TEXT>
Russian president Boris Yeltsin sai... | 30.396122 | 124 | 0.681218 | import unittest
from cvangysel import trec_utils, io_utils
class TRECUtilsTest(unittest.TestCase):
DOC = """<DOC>
<DOCNO>FT922-5992</DOCNO>
<PROFILE>_AN-CE1BRAAAFT</PROFILE>
<DATE>920527
</DATE>
<HEADLINE>
FT 27 MAY 92 / World News In Brief: No second term
</HEADLINE>
<TEXT>
Russian president Boris Yeltsin sai... | true | true |
1c1d4e2ddb86d9190b55d76e88d15534b3b04028 | 25,678 | py | Python | sympy/physics/quantum/qubit.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2021-01-09T23:11:25.000Z | 2021-01-11T15:04:22.000Z | sympy/physics/quantum/qubit.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2020-08-18T15:21:59.000Z | 2020-08-18T19:35:29.000Z | sympy/physics/quantum/qubit.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2021-01-08T23:03:23.000Z | 2021-01-13T18:57:02.000Z | """Qubits for quantum computing.
Todo:
* Finish implementing measurement logic. This should include POVM.
* Update docstrings.
* Update tests.
"""
from __future__ import print_function, division
import math
from sympy import Integer, log, Mul, Add, Pow, conjugate
from sympy.core.basic import sympify
from sympy.core... | 31.858561 | 99 | 0.576719 |
from __future__ import print_function, division
import math
from sympy import Integer, log, Mul, Add, Pow, conjugate
from sympy.core.basic import sympify
from sympy.core.compatibility import SYMPY_INTS
from sympy.matrices import Matrix, zeros
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physic... | true | true |
1c1d4ec51b63c4a3857ce5cab2debfcee5266899 | 411 | py | Python | users/migrations/0003_auto_20191211_1047.py | serajushsalekin/Custom-AbstractUser-User | 7a95b4402005f9088144d1f0a05116ec95b30a72 | [
"MIT"
] | null | null | null | users/migrations/0003_auto_20191211_1047.py | serajushsalekin/Custom-AbstractUser-User | 7a95b4402005f9088144d1f0a05116ec95b30a72 | [
"MIT"
] | 6 | 2020-06-05T20:04:45.000Z | 2021-09-22T18:06:48.000Z | users/migrations/0003_auto_20191211_1047.py | serajushsalekin/Custom-AbstractUser-User | 7a95b4402005f9088144d1f0a05116ec95b30a72 | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2019-12-11 10:47
from django.db import migrations
import users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20191211_1046'),
]
operations = [
migrations.AlterModelManagers(
name='user',
managers=... | 19.571429 | 56 | 0.569343 |
from django.db import migrations
import users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20191211_1046'),
]
operations = [
migrations.AlterModelManagers(
name='user',
managers=[
('objects', users.models.Us... | true | true |
1c1d4f123e39543979cbf321e31317c3a68d7a4d | 1,755 | py | Python | falcon/tests/test_default_routing.py | kmt/falcon | b71d3a457704aa79543ba7b11b735e1cbd9875cd | [
"Apache-2.0"
] | 1 | 2016-03-04T19:34:26.000Z | 2016-03-04T19:34:26.000Z | falcon/tests/test_default_routing.py | kmt/falcon | b71d3a457704aa79543ba7b11b735e1cbd9875cd | [
"Apache-2.0"
] | null | null | null | falcon/tests/test_default_routing.py | kmt/falcon | b71d3a457704aa79543ba7b11b735e1cbd9875cd | [
"Apache-2.0"
] | null | null | null | from testtools.matchers import Contains
import falcon
import falcon.testing as testing
class HumanResource(object):
def on_delete(self, req, resp, name):
resp.status = falcon.HTTP_204
def on_get(self, req, resp, name):
resp.status = falcon.HTTP_402
class UndeadResource(object):
def on_... | 30.258621 | 77 | 0.694017 | from testtools.matchers import Contains
import falcon
import falcon.testing as testing
class HumanResource(object):
def on_delete(self, req, resp, name):
resp.status = falcon.HTTP_204
def on_get(self, req, resp, name):
resp.status = falcon.HTTP_402
class UndeadResource(object):
def on_... | true | true |
1c1d4f1f3305460c65c34cd3269adfc28f138985 | 12,646 | py | Python | selfdrive/car/hyundai/interface.py | wkdwnsghk/neokii_075 | 342b141a1391c2a3da277e1a4e614d0bd3151781 | [
"MIT"
] | 1 | 2021-07-02T02:39:35.000Z | 2021-07-02T02:39:35.000Z | selfdrive/car/hyundai/interface.py | wkdwnsghk/neokii_075 | 342b141a1391c2a3da277e1a4e614d0bd3151781 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/interface.py | wkdwnsghk/neokii_075 | 342b141a1391c2a3da277e1a4e614d0bd3151781 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
from selfdrive.car.hyundai.values import Ecu, ECU_FINGERPRINT, CAR, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_t... | 39.273292 | 313 | 0.686067 |
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
from selfdrive.car.hyundai.values import Ecu, ECU_FINGERPRINT, CAR, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, is_ecu_... | true | true |
1c1d4f7a59ae5d32bb5a9c20e244883cbeb642a3 | 1,088 | py | Python | tflib/plot.py | zhengliz/improved-wgan | 0ba2f3b5c127b02d55747334f5a8144653bd21a4 | [
"MIT"
] | null | null | null | tflib/plot.py | zhengliz/improved-wgan | 0ba2f3b5c127b02d55747334f5a8144653bd21a4 | [
"MIT"
] | null | null | null | tflib/plot.py | zhengliz/improved-wgan | 0ba2f3b5c127b02d55747334f5a8144653bd21a4 | [
"MIT"
] | null | null | null | import numpy as np
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import collections
import time
import cPickle as pickle
OUTPUT_PATH = os.getcwd().replace("Repositories", "Output")
_since_beginning = collections.defaultdict(lambda: {})
_since_last_flush = collections.defaultdict(l... | 25.302326 | 71 | 0.711397 | import numpy as np
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import collections
import time
import cPickle as pickle
OUTPUT_PATH = os.getcwd().replace("Repositories", "Output")
_since_beginning = collections.defaultdict(lambda: {})
_since_last_flush = collections.defaultdict(l... | false | true |
1c1d512e9d7f12bfc6b3fedc2fc0068f5c6ed764 | 452 | py | Python | source/python27/regexTut.py | zach-king/CoolPython | 2d4d74a3d4fc276663917f673a4b8eff12a9a0d0 | [
"MIT"
] | 3 | 2016-03-08T02:08:07.000Z | 2016-04-09T00:58:38.000Z | source/python34/regexTut.py | zach-king/CoolPython | 2d4d74a3d4fc276663917f673a4b8eff12a9a0d0 | [
"MIT"
] | null | null | null | source/python34/regexTut.py | zach-king/CoolPython | 2d4d74a3d4fc276663917f673a4b8eff12a9a0d0 | [
"MIT"
] | null | null | null | import re
def Main():
line = "I think I understand regular expressions"
matchResult = re.match(r'think', line, re.M | re.I)
if matchResult:
print("Match Found: " + matchResult.group())
else:
print("No match was found :(")
searchResult = re.search(r'think', line, re.M | re.I)
if searchResult:
... | 22.6 | 55 | 0.639381 | import re
def Main():
line = "I think I understand regular expressions"
matchResult = re.match(r'think', line, re.M | re.I)
if matchResult:
print("Match Found: " + matchResult.group())
else:
print("No match was found :(")
searchResult = re.search(r'think', line, re.M | re.I)
if searchResult:
... | true | true |
1c1d515d96859addb2999d0270bd8eefc2be5092 | 917 | py | Python | examples/data_augmentation/vector.py | kintatta/d3rl | 0674c4898927a53f36c5c875d8f217337f22d364 | [
"MIT"
] | null | null | null | examples/data_augmentation/vector.py | kintatta/d3rl | 0674c4898927a53f36c5c875d8f217337f22d364 | [
"MIT"
] | null | null | null | examples/data_augmentation/vector.py | kintatta/d3rl | 0674c4898927a53f36c5c875d8f217337f22d364 | [
"MIT"
] | null | null | null | from d3rlpy.datasets import get_pybullet
from d3rlpy.algos import CQL
from d3rlpy.metrics.scorer import evaluate_on_environment
from d3rlpy.metrics.scorer import td_error_scorer
from d3rlpy.metrics.scorer import discounted_sum_of_advantage_scorer
from d3rlpy.metrics.scorer import average_value_estimation_scorer
from sk... | 36.68 | 72 | 0.76554 | from d3rlpy.datasets import get_pybullet
from d3rlpy.algos import CQL
from d3rlpy.metrics.scorer import evaluate_on_environment
from d3rlpy.metrics.scorer import td_error_scorer
from d3rlpy.metrics.scorer import discounted_sum_of_advantage_scorer
from d3rlpy.metrics.scorer import average_value_estimation_scorer
from sk... | true | true |
1c1d518414923bb8d49b1dde265ad94e476b0990 | 14,983 | py | Python | build/env/lib/python2.7/site-packages/windmill-1.6-py2.7.egg/windmill/server/convergence.py | bopopescu/myhue | 5f566970a5a1fa5af9f01832c9e9808c47634bc7 | [
"Apache-2.0"
] | 61 | 2015-03-16T18:36:06.000Z | 2021-12-02T10:08:17.000Z | windmill/server/convergence.py | admc/windmill | 4304ee7258eb0c2814f215d8ce90abf02b1f737f | [
"Apache-2.0"
] | 8 | 2015-03-10T10:01:26.000Z | 2020-05-18T10:51:24.000Z | windmill/server/convergence.py | admc/windmill | 4304ee7258eb0c2814f215d8ce90abf02b1f737f | [
"Apache-2.0"
] | 14 | 2015-01-29T16:28:33.000Z | 2021-09-04T11:19:48.000Z | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 39.018229 | 120 | 0.618034 |
"""This module provides the communication and management between the various
server interfaces and the browser's js interface"""
import copy, os, sys
from windmill.dep import json
import logging
from windmill.dep import uuid
import windmill
from time import sleep
test_results_logger = logging.getLogge... | false | true |
1c1d524ce962de573374f1a012cfd110edfb2cdd | 8,327 | py | Python | tests/test_fitters.py | jacobic/redmapper | bda5bd6f486fd5f18d35aa9ae4b875628e905604 | [
"Apache-2.0"
] | null | null | null | tests/test_fitters.py | jacobic/redmapper | bda5bd6f486fd5f18d35aa9ae4b875628e905604 | [
"Apache-2.0"
] | null | null | null | tests/test_fitters.py | jacobic/redmapper | bda5bd6f486fd5f18d35aa9ae4b875628e905604 | [
"Apache-2.0"
] | null | null | null | import unittest
import numpy.testing as testing
import numpy as np
import fitsio
from numpy import random
from redmapper.fitters import EcgmmFitter
from redmapper.fitters import MedZFitter
from redmapper.fitters import RedSequenceFitter
from redmapper.fitters import CorrectionFitter
from redmapper.utilities import mak... | 42.92268 | 159 | 0.625676 | import unittest
import numpy.testing as testing
import numpy as np
import fitsio
from numpy import random
from redmapper.fitters import EcgmmFitter
from redmapper.fitters import MedZFitter
from redmapper.fitters import RedSequenceFitter
from redmapper.fitters import CorrectionFitter
from redmapper.utilities import mak... | true | true |
1c1d52d8122498b79c8a3be44173533427738ac8 | 22,865 | py | Python | platforms/ios/build_framework.py | ILLIXR/opencv | a66f61748fc4861374b8dc458866a9614925350a | [
"BSD-3-Clause"
] | 2 | 2020-11-16T06:06:57.000Z | 2021-02-28T22:17:44.000Z | platforms/ios/build_framework.py | suriya-1403/opencv | 949fe93d5aa219be95c63598b11835afff0a1b65 | [
"BSD-3-Clause"
] | 1 | 2020-10-28T23:05:13.000Z | 2020-10-28T23:05:13.000Z | platforms/ios/build_framework.py | suriya-1403/opencv | 949fe93d5aa219be95c63598b11835afff0a1b65 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T08:50:38.000Z | 2021-03-06T08:50:38.000Z | #!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir sh... | 48.340381 | 211 | 0.606123 |
from __future__ import print_function
import glob, re, os, os.path, shutil, string, sys, argparse, traceback, multiprocessing
from subprocess import check_call, check_output, CalledProcessError
from distutils.dir_util import copy_tree
IPHONEOS_DEPLOYMENT_TARGET='8.0'
def execute(cmd, cwd = None):
print("Execu... | true | true |
1c1d530e3536f4c2e5d28515d47a79772a849703 | 1,208 | py | Python | Back-End/Python/Basics/Part -1 - Functional/08 - Modules, Packages/05 - zipped_package/main.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 25 | 2021-04-28T02:51:26.000Z | 2022-03-24T13:58:04.000Z | Back-End/Python/Basics/Part -1 - Functional/08 - Modules, Packages/05 - zipped_package/main.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 1 | 2022-03-03T23:33:41.000Z | 2022-03-03T23:35:41.000Z | Back-End/Python/Basics/Part -1 - Functional/08 - Modules, Packages/05 - zipped_package/main.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 15 | 2021-05-30T01:35:20.000Z | 2022-03-25T12:38:25.000Z | import sys
sys.path.append('./common.zip')
import common
import common.validators as validators
import common.models as models
# from common.models import *
import common.helpers as helpers
validators.is_boolean('true')
validators.is_json('{}')
validators.is_numeric(10)
validators.is_date('2018-0101')
john_post = m... | 12.989247 | 39 | 0.739238 | import sys
sys.path.append('./common.zip')
import common
import common.validators as validators
import common.models as models
import common.helpers as helpers
validators.is_boolean('true')
validators.is_json('{}')
validators.is_numeric(10)
validators.is_date('2018-0101')
john_post = models.Post()
john_posts = mod... | false | true |
1c1d5351057bfcd42678e20134448115d894ff24 | 6,597 | py | Python | models/SegNet.py | mrluin/ESFNet-Pytorch | a2c166a91281e96f953398cf953f446ff6337a14 | [
"Unlicense"
] | 39 | 2019-04-06T16:34:19.000Z | 2022-03-08T11:07:35.000Z | models/SegNet.py | yongjunhe11/ESFNet-Pytorch | a2c166a91281e96f953398cf953f446ff6337a14 | [
"Unlicense"
] | 15 | 2019-04-08T07:20:29.000Z | 2022-03-08T11:03:20.000Z | models/SegNet.py | yongjunhe11/ESFNet-Pytorch | a2c166a91281e96f953398cf953f446ff6337a14 | [
"Unlicense"
] | 13 | 2019-04-06T16:54:29.000Z | 2021-12-24T12:07:17.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
class SegNet(nn.Module):
# modified
def __init__(self,config):
super(SegNet, self).__init__()
self.config = config
self.name = 'SegNet'
batchNorm_momentum = 0.1
... | 46.132867 | 87 | 0.633773 | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
class SegNet(nn.Module):
def __init__(self,config):
super(SegNet, self).__init__()
self.config = config
self.name = 'SegNet'
batchNorm_momentum = 0.1
se... | true | true |
1c1d545236dd7bbfecb86f61b54ae5d41a298c20 | 24,526 | py | Python | tensorflow/python/kernel_tests/py_func_test.py | Faagerholm/tensorflow | 98e30b8748eb018f33836ac9269db67ab60483ab | [
"Apache-2.0"
] | 4 | 2021-02-01T01:01:11.000Z | 2021-07-21T15:22:20.000Z | tensorflow/python/kernel_tests/py_func_test.py | Faagerholm/tensorflow | 98e30b8748eb018f33836ac9269db67ab60483ab | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/py_func_test.py | Faagerholm/tensorflow | 98e30b8748eb018f33836ac9269db67ab60483ab | [
"Apache-2.0"
] | 5 | 2020-12-22T10:17:47.000Z | 2021-05-06T14:14:52.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 35.289209 | 95 | 0.659015 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gc
import re
import numpy as np
from six.moves import queue
from six.moves import xrange
from tensorflow.python.client import session as session_lib
from tensorflow.python.eager impor... | true | true |
1c1d55bb73a5650b45ef3c06133638d8e5df3273 | 1,200 | py | Python | pkgs/lib/dlfcn/scripts/gen_dl_stubs.py | pg83/mix | 1aa964214a239bb80b3a2fa408551929b6b77acc | [
"MIT"
] | 12 | 2021-12-04T09:38:50.000Z | 2022-03-22T16:27:30.000Z | pkgs/lib/dlfcn/scripts/gen_dl_stubs.py | apatrushev/mix | 754fb2f7f308ad8285953aab9c4eba218968c0d4 | [
"MIT"
] | 1 | 2022-02-15T23:16:32.000Z | 2022-02-15T23:16:32.000Z | pkgs/lib/dlfcn/scripts/gen_dl_stubs.py | apatrushev/mix | 754fb2f7f308ad8285953aab9c4eba218968c0d4 | [
"MIT"
] | 1 | 2022-02-08T18:57:50.000Z | 2022-02-08T18:57:50.000Z | import sys
lib = sys.argv[1]
tgt = sys.argv[2]
def it_symbols():
for l in sys.stdin.read().splitlines():
l = l.strip()
if not l:
continue
if ':' in l:
continue
if ' ' in l:
if ' U ' in l:
continue
if '[' in l:
... | 15.189873 | 43 | 0.388333 | import sys
lib = sys.argv[1]
tgt = sys.argv[2]
def it_symbols():
for l in sys.stdin.read().splitlines():
l = l.strip()
if not l:
continue
if ':' in l:
continue
if ' ' in l:
if ' U ' in l:
continue
if '[' in l:
... | true | true |
1c1d565b9be874e1f00112ec6fa11d02d861b84b | 10,897 | py | Python | src/you_get/extractors/ixigua.py | shenjler/you-get | 6a2575c445bd223ca5a62c84a2cd07869e67f5a4 | [
"MIT"
] | null | null | null | src/you_get/extractors/ixigua.py | shenjler/you-get | 6a2575c445bd223ca5a62c84a2cd07869e67f5a4 | [
"MIT"
] | null | null | null | src/you_get/extractors/ixigua.py | shenjler/you-get | 6a2575c445bd223ca5a62c84a2cd07869e67f5a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import base64
import requests
import binascii
import subprocess
from ..common import *
import random
import string
import ctypes
from json import loads
from urllib import request
__all__ = ['ixigua_download', 'ixigua_download_playlist_by_url']
headers = {
"user-agent": "Mozilla/5.0 (Window... | 43.763052 | 161 | 0.585115 |
import base64
import requests
import binascii
import subprocess
from ..common import *
import random
import string
import ctypes
from json import loads
from urllib import request
__all__ = ['ixigua_download', 'ixigua_download_playlist_by_url']
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) App... | true | true |
1c1d56f487ccc2fffc69cf5c241f93f687587f80 | 242 | py | Python | torchvision/models/segmentation/segmentation.py | yoshitomo-matsubara/vision | 03d11338f3faf94a0749549912593ddb8b70be17 | [
"BSD-3-Clause"
] | 12,063 | 2017-01-18T19:58:38.000Z | 2022-03-31T23:08:44.000Z | torchvision/models/segmentation/segmentation.py | yoshitomo-matsubara/vision | 03d11338f3faf94a0749549912593ddb8b70be17 | [
"BSD-3-Clause"
] | 4,673 | 2017-01-18T21:30:03.000Z | 2022-03-31T20:58:33.000Z | torchvision/models/segmentation/segmentation.py | yoshitomo-matsubara/vision | 03d11338f3faf94a0749549912593ddb8b70be17 | [
"BSD-3-Clause"
] | 7,132 | 2017-01-18T18:12:23.000Z | 2022-03-31T21:19:10.000Z | import warnings
# Import all methods/classes for BC:
from . import * # noqa: F401, F403
warnings.warn(
"The 'torchvision.models.segmentation.segmentation' module is deprecated. Please use directly the parent module "
"instead."
)
| 22 | 117 | 0.731405 | import warnings
from . import *
warnings.warn(
"The 'torchvision.models.segmentation.segmentation' module is deprecated. Please use directly the parent module "
"instead."
)
| true | true |
1c1d575c43df52171527056559745f2de76802bc | 443 | py | Python | ps.py | jkkummerfeld/coref-ee | 594075470e9331ee1c40d611854b7546c735f668 | [
"Apache-2.0"
] | 39 | 2019-08-06T06:30:24.000Z | 2020-09-01T13:48:30.000Z | ps.py | jkkummerfeld/coref-ee | 594075470e9331ee1c40d611854b7546c735f668 | [
"Apache-2.0"
] | 18 | 2019-09-01T12:48:48.000Z | 2020-11-13T17:38:35.000Z | ps.py | jkkummerfeld/coref-ee | 594075470e9331ee1c40d611854b7546c735f668 | [
"Apache-2.0"
] | 8 | 2019-08-05T10:13:55.000Z | 2020-12-28T09:48:48.000Z | #!/usr/bin/env python
import os
import tensorflow as tf
import util
if __name__ == "__main__":
args = util.get_args()
config = util.initialize_from_env(args.experiment, args.logdir)
report_frequency = config["report_frequency"]
cluster_config = util.get_cluster_config()
util.set_gpus()
cluster = tf.train... | 26.058824 | 65 | 0.747178 |
import os
import tensorflow as tf
import util
if __name__ == "__main__":
args = util.get_args()
config = util.initialize_from_env(args.experiment, args.logdir)
report_frequency = config["report_frequency"]
cluster_config = util.get_cluster_config()
util.set_gpus()
cluster = tf.train.ClusterSpec(cluster_... | true | true |
1c1d57796e56cd75c37e47ad1441ee5fabbee381 | 5,443 | py | Python | object-detection/yolov2/yolov2_detection.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | null | null | null | object-detection/yolov2/yolov2_detection.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | null | null | null | object-detection/yolov2/yolov2_detection.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | 1 | 2020-04-25T06:11:28.000Z | 2020-04-25T06:11:28.000Z | # Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 33.807453 | 99 | 0.614735 |
import yolov2
from draw_utils import DrawBoundingBoxes
import nnabla as nn
import nnabla.functions as F
import time
import numpy as np
from nnabla.utils.image_utils import imread, imresize, imsave
from arg_utils import get_anchors_by_name_or_parse
def get_args():
import argparse
from os.pat... | true | true |
1c1d578eb6b03a03bf3911c7dca03e40f7bd434d | 21,685 | py | Python | omd/versions/1.2.8p15.cre/share/check_mk/modules/events.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | null | null | null | omd/versions/1.2.8p15.cre/share/check_mk/modules/events.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | null | null | null | omd/versions/1.2.8p15.cre/share/check_mk/modules/events.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | 42.188716 | 134 | 0.579571 |
import pprint, urllib, select, subprocess, socket
def event_keepalive(event_function, log_function, call_every_loop=None, loop_interval=None, shutdown_function=None):
last_config_timestamp = config_timestamp()
if os.getenv("CMK_EVENT_RESTART") != "1":
log_functio... | false | true |
1c1d5858270d5a67f9f99bffd463508ef4e5a67a | 758 | py | Python | main/first-bad-version/first-bad-version.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/first-bad-version/first-bad-version.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/first-bad-version/first-bad-version.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | # The isBadVersion API is already defined for you.
# @param version, an integer
# @return a bool
# def isBadVersion(version):
class SequenceWrapper(object):
def __init__(self, function, start, stop):
self._function = function
self._start = start
self._size = max(0, stop - start)
de... | 27.071429 | 54 | 0.60686 |
class SequenceWrapper(object):
def __init__(self, function, start, stop):
self._function = function
self._start = start
self._size = max(0, stop - start)
def __len__(self):
return self._size
def __getitem__(self, index):
if index < self._size:
... | true | true |
1c1d58e9969b925b2f3fdc2ecbb33153adcad6dd | 583 | py | Python | flutterapi/myapp/migrations/0001_initial.py | CardDev-parche/FlutterTodolist | 92ee5b98406741f968745e7056713c7138e0761b | [
"MIT"
] | null | null | null | flutterapi/myapp/migrations/0001_initial.py | CardDev-parche/FlutterTodolist | 92ee5b98406741f968745e7056713c7138e0761b | [
"MIT"
] | null | null | null | flutterapi/myapp/migrations/0001_initial.py | CardDev-parche/FlutterTodolist | 92ee5b98406741f968745e7056713c7138e0761b | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-03 08:34
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Todolist',
fields=[
('id', ... | 25.347826 | 118 | 0.554031 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Todolist',
fields=[
('id', models.BigAutoField(auto_created=True, primary_k... | true | true |
1c1d59f3689b411460c9c25340b7ffabfce4e150 | 675 | py | Python | source/articles/migrations/0005_auto_20170206_2215.py | OpenNews/opennews-source | 71b557275bc5d03c75eb471fc3293efa492c0ac7 | [
"MIT"
] | 6 | 2017-01-05T00:51:48.000Z | 2021-11-08T10:26:04.000Z | source/articles/migrations/0005_auto_20170206_2215.py | OpenNews/opennews-source | 71b557275bc5d03c75eb471fc3293efa492c0ac7 | [
"MIT"
] | 146 | 2017-01-03T16:06:43.000Z | 2022-03-11T23:25:43.000Z | source/articles/migrations/0005_auto_20170206_2215.py | OpenNews/opennews-source | 71b557275bc5d03c75eb471fc3293efa492c0ac7 | [
"MIT"
] | 3 | 2017-02-16T22:52:47.000Z | 2019-08-15T16:49:47.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-02-06 22:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0004_article_is_featured'),
]
operations = [
migrations.AlterMo... | 27 | 96 | 0.614815 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0004_article_is_featured'),
]
operations = [
migrations.AlterModelOptions(
name='article',
options={'get_lates... | true | true |
1c1d5ab6de546e3062c9ecb5ab8c539146d92fd4 | 9,293 | py | Python | bot/utils/processor.py | Lulaba/Twitter-Monitor | 050edd53900fe543adc12cb086ef6778e6c487e3 | [
"MIT"
] | null | null | null | bot/utils/processor.py | Lulaba/Twitter-Monitor | 050edd53900fe543adc12cb086ef6778e6c487e3 | [
"MIT"
] | 1 | 2021-06-01T23:21:07.000Z | 2021-06-01T23:21:07.000Z | bot/utils/processor.py | Lulaba/Twitter-Monitor | 050edd53900fe543adc12cb086ef6778e6c487e3 | [
"MIT"
] | null | null | null | from html import unescape
import re
from discord import Webhook, RequestsWebhookAdapter, Embed
import discord
import random
from datetime import datetime
COLORS = [
0x7F0000,
0x535900,
0x40D9FF,
0x8C7399,
0xD97B6C,
0xF2FF40,
0x8FB6BF,
0x502D59,
0x66504D,
0x89B... | 34.291513 | 110 | 0.507264 | from html import unescape
import re
from discord import Webhook, RequestsWebhookAdapter, Embed
import discord
import random
from datetime import datetime
COLORS = [
0x7F0000,
0x535900,
0x40D9FF,
0x8C7399,
0xD97B6C,
0xF2FF40,
0x8FB6BF,
0x502D59,
0x66504D,
0x89B... | true | true |
1c1d5b099e32dac2d0545001e16b5c624313a906 | 398 | py | Python | documentation/models/login.py | rjvanvoorhis/photomosaic-api-v2 | 5da432e911c02f17f595ef056c45a5f4fd717738 | [
"MIT"
] | null | null | null | documentation/models/login.py | rjvanvoorhis/photomosaic-api-v2 | 5da432e911c02f17f595ef056c45a5f4fd717738 | [
"MIT"
] | null | null | null | documentation/models/login.py | rjvanvoorhis/photomosaic-api-v2 | 5da432e911c02f17f595ef056c45a5f4fd717738 | [
"MIT"
] | null | null | null | __all__ = ['login_model', 'registration_model', 'auth_model']
from flask_restplus import Model, fields
login_model = Model('login_model', {
'username': fields.String,
'password': fields.String
})
registration_model = login_model.clone('registration_model', {
'email': fields.String
})
auth_model = Model(... | 23.411765 | 62 | 0.71608 | __all__ = ['login_model', 'registration_model', 'auth_model']
from flask_restplus import Model, fields
login_model = Model('login_model', {
'username': fields.String,
'password': fields.String
})
registration_model = login_model.clone('registration_model', {
'email': fields.String
})
auth_model = Model(... | true | true |
1c1d5b86817b0bb6a47a90e59c0e6eee4f3a5768 | 11,125 | py | Python | nnunet/training/network_training/HasTrainer_DP_IC_dense.py | hasukmin12/nnUNet_MDD_UNet_with_Semi_Supervised | 58c5665a5d89d1ad77038e5d6420be76fadab136 | [
"Apache-2.0"
] | 3 | 2022-03-07T07:59:14.000Z | 2022-03-17T08:50:42.000Z | nnunet/training/network_training/HasTrainer_DP_IC_dense.py | hasukmin12/nnUNet_MDD_UNet_with_Semi_Supervised | 58c5665a5d89d1ad77038e5d6420be76fadab136 | [
"Apache-2.0"
] | 1 | 2022-03-07T13:21:42.000Z | 2022-03-07T13:21:42.000Z | nnunet/training/network_training/HasTrainer_DP_IC_dense.py | hasukmin12/nnUNet_MDD_UNet_with_Semi_Supervised | 58c5665a5d89d1ad77038e5d6420be76fadab136 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 55.074257 | 123 | 0.593258 |
import numpy as np
import torch
from batchgenerators.utilities.file_and_folder_operations import *
from nnunet.training.data_augmentation.data_augmentation_moreDA import get_moreDA_augmentation
from nnunet.training.network_training.nnUNetTrainerV2 import nnUNetTrainerV2
from nnunet.utilities.to_torch imp... | true | true |
1c1d5c1bb82a809a09739b7673fec47e3c23b6c0 | 538 | py | Python | basic/forDemo.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | basic/forDemo.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | basic/forDemo.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
print '今天我们学习:%s' % '循环语句'
#第一种循环
print '-------------------for------------------'
classmates = ['Tom','Jack','John','merry']
for classmate in classmates:
print classmate
sum = 0
for x in xrange(1,10):
sum +=x
print '累计和为 sum =',sum
print '生成序列range(10)'
num = range(10)
pr... | 17.354839 | 48 | 0.520446 |
print '今天我们学习:%s' % '循环语句'
print '-------------------for------------------'
classmates = ['Tom','Jack','John','merry']
for classmate in classmates:
print classmate
sum = 0
for x in xrange(1,10):
sum +=x
print '累计和为 sum =',sum
print '生成序列range(10)'
num = range(10)
print '打印生成序列range(10)',num
print '------------... | false | true |
1c1d5c52462729c98e3568cbf9d39bd9d0d0dc92 | 36,362 | py | Python | tests/components/sensor/test_recorder.py | brandondb1/core | 11119e7508670dd38015f53228a6d701ba4565ba | [
"Apache-2.0"
] | 1 | 2021-12-11T00:41:25.000Z | 2021-12-11T00:41:25.000Z | tests/components/sensor/test_recorder.py | brandondb1/core | 11119e7508670dd38015f53228a6d701ba4565ba | [
"Apache-2.0"
] | 69 | 2020-08-04T09:03:43.000Z | 2022-03-31T06:13:01.000Z | tests/components/sensor/test_recorder.py | BKPepe/home-assistant | b4238443c86860a0540df53a8a11b9fed87dea3c | [
"Apache-2.0"
] | null | null | null | """The tests for sensor recorder platform."""
# pylint: disable=protected-access,invalid-name
from datetime import timedelta
from unittest.mock import patch
import pytest
from pytest import approx
from homeassistant.components.recorder import history
from homeassistant.components.recorder.const import DATA_INSTANCE
f... | 37.104082 | 88 | 0.593037 |
from datetime import timedelta
from unittest.mock import patch
import pytest
from pytest import approx
from homeassistant.components.recorder import history
from homeassistant.components.recorder.const import DATA_INSTANCE
from homeassistant.components.recorder.models import process_timestamp_to_utc_isoformat
from h... | true | true |
1c1d5c87cb118bb1691f7817651d651e07124775 | 750 | py | Python | noxfile.py | JackKuo-tw/ilmsdump | 6e696f2bb78307bb626c70d8f55762cfb2a9cc63 | [
"MIT"
] | null | null | null | noxfile.py | JackKuo-tw/ilmsdump | 6e696f2bb78307bb626c70d8f55762cfb2a9cc63 | [
"MIT"
] | null | null | null | noxfile.py | JackKuo-tw/ilmsdump | 6e696f2bb78307bb626c70d8f55762cfb2a9cc63 | [
"MIT"
] | null | null | null | import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ['format', 'lint', 'test']
FILES = ['ilmsdump', 'ilmsserve', 'tests', 'noxfile.py', 'setup.py']
@nox.session
@nox.parametrize('formatter', ['isort', 'black'])
def format_check(session, formatter):
session.install(formatter)
sess... | 22.727273 | 68 | 0.672 | import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ['format', 'lint', 'test']
FILES = ['ilmsdump', 'ilmsserve', 'tests', 'noxfile.py', 'setup.py']
@nox.session
@nox.parametrize('formatter', ['isort', 'black'])
def format_check(session, formatter):
session.install(formatter)
sess... | true | true |
1c1d5c973f00bb93ce64c9396740e420ce0a6aed | 13,352 | py | Python | streamzap/youtube.py | eXpl0it3r/streamzap | bc7fcc88fb28f8494e7ede9876c04c09881fab62 | [
"MIT"
] | null | null | null | streamzap/youtube.py | eXpl0it3r/streamzap | bc7fcc88fb28f8494e7ede9876c04c09881fab62 | [
"MIT"
] | null | null | null | streamzap/youtube.py | eXpl0it3r/streamzap | bc7fcc88fb28f8494e7ede9876c04c09881fab62 | [
"MIT"
] | null | null | null | from service import Service
from streamdetails import StreamDetails
from segmentinfo import SegmentInfo
import re
import json
import urlparse
class Youtube(Service):
def __init__(self, zap=None):
Service.__init__(self, zap)
self._name = 'YouTube'
self._detection_url = '.*youtub... | 74.177778 | 155 | 0.495581 | from service import Service
from streamdetails import StreamDetails
from segmentinfo import SegmentInfo
import re
import json
import urlparse
class Youtube(Service):
def __init__(self, zap=None):
Service.__init__(self, zap)
self._name = 'YouTube'
self._detection_url = '.*youtub... | true | true |
1c1d5d418d48e3af23dcf31c43272b14a2af8ba0 | 834 | py | Python | F_sorting/E_lomutoandhoare.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 58 | 2021-01-06T10:05:51.000Z | 2022-02-10T05:15:19.000Z | F_sorting/E_lomutoandhoare.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 5 | 2021-02-22T04:14:24.000Z | 2021-12-26T09:19:17.000Z | F_sorting/E_lomutoandhoare.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 27 | 2021-02-09T13:58:33.000Z | 2022-03-06T03:48:08.000Z | def method1(l: list) -> list:
def partition(arr, low, high):
pivot = arr[high]
i = low - 1
for j in range(low, high):
if arr[j] <= pivot:
i += 1
arr[i], arr[j] = arr[j], arr[i]
arr[i + 1], arr[high] = arr[high], arr[i + 1]
return i ... | 25.272727 | 67 | 0.476019 | def method1(l: list) -> list:
def partition(arr, low, high):
pivot = arr[high]
i = low - 1
for j in range(low, high):
if arr[j] <= pivot:
i += 1
arr[i], arr[j] = arr[j], arr[i]
arr[i + 1], arr[high] = arr[high], arr[i + 1]
return i ... | true | true |
1c1d5d42d124bf1a8a85d85add17b0741ccc120b | 126 | py | Python | entrypoint.py | youngjeff/m1905 | 9dd6ae21c0eb25e92d31b63f8918105f2d02b11c | [
"Apache-2.0"
] | null | null | null | entrypoint.py | youngjeff/m1905 | 9dd6ae21c0eb25e92d31b63f8918105f2d02b11c | [
"Apache-2.0"
] | null | null | null | entrypoint.py | youngjeff/m1905 | 9dd6ae21c0eb25e92d31b63f8918105f2d02b11c | [
"Apache-2.0"
] | null | null | null | from scrapy.cmdline import execute
execute(['scrapy', 'crawl', 'url_spider'])
# execute(['scrapy', 'crawl', 'movie_spider'])
| 25.2 | 46 | 0.698413 | from scrapy.cmdline import execute
execute(['scrapy', 'crawl', 'url_spider'])
| true | true |
1c1d5d7fdb59cab259843680b6b83e493c2e9184 | 16,049 | py | Python | g2p.py | Usama0121/PronouncUR | 3583a8498ae9a9f87bcdbf2b2ce45b2ad61e6c8b | [
"MIT"
] | 9 | 2018-03-09T16:41:36.000Z | 2021-12-01T01:56:32.000Z | g2p.py | Usama0121/PronouncUR | 3583a8498ae9a9f87bcdbf2b2ce45b2ad61e6c8b | [
"MIT"
] | 9 | 2018-03-10T02:14:03.000Z | 2022-02-09T23:30:02.000Z | g2p.py | Usama0121/PronouncUR | 3583a8498ae9a9f87bcdbf2b2ce45b2ad61e6c8b | [
"MIT"
] | 6 | 2018-08-30T04:44:09.000Z | 2021-07-16T07:45:01.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import time
import numpy as np
import tensorflow as tf
from tensorflow.core.protobuf import saver_pb2
import data_utils
import seq2seq_model
from six.moves import xrange, input
from six... | 39.335784 | 89 | 0.626706 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import time
import numpy as np
import tensorflow as tf
from tensorflow.core.protobuf import saver_pb2
import data_utils
import seq2seq_model
from six.moves import xrange, input
from six... | true | true |
1c1d5dfdd521f7166dffea50ee7b215751d99d80 | 1,240 | py | Python | working_with_data_types/collection/arrays.py | venkateshtantravahi/Python-0-to-hero- | dd1c5cb8a9693f72adb7e25ffc54c0492becea4a | [
"MIT"
] | 6 | 2021-09-19T09:33:20.000Z | 2022-01-03T03:57:14.000Z | working_with_data_types/collection/arrays.py | venkateshtantravahi/Python-0-to-hero- | dd1c5cb8a9693f72adb7e25ffc54c0492becea4a | [
"MIT"
] | 1 | 2021-12-18T14:19:03.000Z | 2021-12-18T14:19:03.000Z | working_with_data_types/collection/arrays.py | venkateshtantravahi/Python-0-to-hero- | dd1c5cb8a9693f72adb7e25ffc54c0492becea4a | [
"MIT"
] | null | null | null | import array as arr
# Creating array
sample_array = arr.array("d", [1.1, 4.5, 6.7, 8.9])
print(sample_array)
# Accessing data from array
print("First Element in arr: {}".format(sample_array[0]))
# converting list to array
numbered_list = [1, 34, 56, 3, 45, 43, 24, 62, 78]
numbered_array = arr.array("i", numbered_li... | 24.8 | 67 | 0.722581 | import array as arr
sample_array = arr.array("d", [1.1, 4.5, 6.7, 8.9])
print(sample_array)
print("First Element in arr: {}".format(sample_array[0]))
numbered_list = [1, 34, 56, 3, 45, 43, 24, 62, 78]
numbered_array = arr.array("i", numbered_list)
print(numbered_array[3:6])
print("Array before changing {}".for... | true | true |
1c1d5e02a598339fa59de0520030351581a5ca75 | 894 | py | Python | tests/kafkatest/utils/__init__.py | BoYiZhang/kafka-2.4.0-src | 752b76f7f48ca4c5ea20770fd990293b1b28fce4 | [
"Apache-2.0"
] | 126 | 2018-08-31T21:47:30.000Z | 2022-03-11T10:01:31.000Z | tests/kafkatest/utils/__init__.py | BoYiZhang/kafka-2.4.0-src | 752b76f7f48ca4c5ea20770fd990293b1b28fce4 | [
"Apache-2.0"
] | 75 | 2019-03-07T20:24:18.000Z | 2022-03-31T02:14:37.000Z | tests/kafkatest/utils/__init__.py | BoYiZhang/kafka-2.4.0-src | 752b76f7f48ca4c5ea20770fd990293b1b28fce4 | [
"Apache-2.0"
] | 46 | 2018-09-13T07:27:19.000Z | 2022-03-23T17:49:13.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 52.588235 | 112 | 0.789709 |
from util import kafkatest_version, is_version, is_int, is_int_with_prefix, node_is_reachable, validate_delivery
| true | true |
1c1d5e41b8b5ca0bd06726c453b2bf6793f2b943 | 7,108 | py | Python | lib/visual3D_temp/BaseWriter.py | eanemo/MedicalZooPytorch | 4996894818fad230532d42dfd590e914c36a0c53 | [
"MIT"
] | null | null | null | lib/visual3D_temp/BaseWriter.py | eanemo/MedicalZooPytorch | 4996894818fad230532d42dfd590e914c36a0c53 | [
"MIT"
] | null | null | null | lib/visual3D_temp/BaseWriter.py | eanemo/MedicalZooPytorch | 4996894818fad230532d42dfd590e914c36a0c53 | [
"MIT"
] | null | null | null | import os
import numpy as np
from torch.utils.tensorboard import SummaryWriter
import lib.utils as utils
dict_class_names = {"iseg2017": ["Air", "CSF", "GM", "WM"],
"iseg2019": ["Air", "CSF", "GM", "WM"],
"mrbrains4": ["Air", "CSF", "GM", "WM"],
"mrbrains9":... | 50.771429 | 117 | 0.444851 | import os
import numpy as np
from torch.utils.tensorboard import SummaryWriter
import lib.utils as utils
dict_class_names = {"iseg2017": ["Air", "CSF", "GM", "WM"],
"iseg2019": ["Air", "CSF", "GM", "WM"],
"mrbrains4": ["Air", "CSF", "GM", "WM"],
"mrbrains9":... | true | true |
1c1d5ecf6833a55fde8a36f26d341b9b8ae36e68 | 1,199 | py | Python | pharos/model/laser/_skeleton.py | uetke/UUPharosController | 1663dcb5acab78fe65eab9eee7948d1257dec1f0 | [
"MIT"
] | null | null | null | pharos/model/laser/_skeleton.py | uetke/UUPharosController | 1663dcb5acab78fe65eab9eee7948d1257dec1f0 | [
"MIT"
] | 1 | 2018-03-13T14:06:21.000Z | 2018-03-13T14:06:21.000Z | pharos/model/laser/_skeleton.py | uetke/UUPharosController | 1663dcb5acab78fe65eab9eee7948d1257dec1f0 | [
"MIT"
] | null | null | null | """
Pharos.Model.laser._skeleton.py
==================================
.. note:: **IMPORTANT** Whatever new function is implemented in a specific model, it should be first declared in the
laserBase class. In this way the other models will have access to the method and the program will keep running... | 25.510638 | 121 | 0.616347 |
class LaserBase():
TRIG_NO = 0
TRIG_EXTERNAL = 1
TRIG_SOFTWARE = 2
TRIG_OUTPUT = 3
MODE_SINGLE = 1
MODE_TWO_WAY = 2
MODE_STEP_SINGLE = 3
MODE_STEP_TWO_WAY = 4
PARAM_WAVELENGTH = 1
PARAM_FREQUENCY = 2
def __init__(self):
self.trig... | true | true |
1c1d5ecf82d92d43507d531c7702f04281048c05 | 3,352 | py | Python | real_estate_project/settings.py | congdv/real-estate-vn | eab6fc1e0d73661307585d6ee1735503252033e8 | [
"MIT"
] | null | null | null | real_estate_project/settings.py | congdv/real-estate-vn | eab6fc1e0d73661307585d6ee1735503252033e8 | [
"MIT"
] | null | null | null | real_estate_project/settings.py | congdv/real-estate-vn | eab6fc1e0d73661307585d6ee1735503252033e8 | [
"MIT"
] | null | null | null | """
Django settings for real_estate_project project.
Generated by 'django-admin startproject' using Django 2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
im... | 26.603175 | 91 | 0.702566 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'ik0so&dtxv=6acn)x5b*cjb#-jf3xabh11$8=f%yew8i*ysj)m'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'real_estate.apps.RealEstateConfig',
'django.contrib.admin',
'django.c... | true | true |
1c1d5f4e11502f14f3887e84d436a06a836966a6 | 55 | py | Python | scripts/sum_doc_count.py | nladuo/snrm | 2b073ad14a8cdb2740858d5998b809ddcc014ea9 | [
"BSD-3-Clause"
] | null | null | null | scripts/sum_doc_count.py | nladuo/snrm | 2b073ad14a8cdb2740858d5998b809ddcc014ea9 | [
"BSD-3-Clause"
] | null | null | null | scripts/sum_doc_count.py | nladuo/snrm | 2b073ad14a8cdb2740858d5998b809ddcc014ea9 | [
"BSD-3-Clause"
] | 1 | 2021-04-21T20:24:14.000Z | 2021-04-21T20:24:14.000Z |
with open("./data/qrels.robust2004.txt") as f:
f
| 11 | 46 | 0.618182 |
with open("./data/qrels.robust2004.txt") as f:
f
| true | true |
1c1d616570e3be2c2d83af7e2d9749ea51a4f7e4 | 3,840 | py | Python | app.py | nadjascha/FemaleAIAppInnovationEcosystem | d4c02efc2c4679d1978f2f8b6f6bdfd4ff406db3 | [
"CC-BY-4.0"
] | 1 | 2022-03-23T13:08:55.000Z | 2022-03-23T13:08:55.000Z | app.py | nadjascha/FemaleAIAppInnovationEcosystem | d4c02efc2c4679d1978f2f8b6f6bdfd4ff406db3 | [
"CC-BY-4.0"
] | null | null | null | app.py | nadjascha/FemaleAIAppInnovationEcosystem | d4c02efc2c4679d1978f2f8b6f6bdfd4ff406db3 | [
"CC-BY-4.0"
] | 2 | 2021-11-03T09:21:13.000Z | 2022-03-18T20:13:55.000Z | import os
from datetime import datetime
from typing import List
from urllib.parse import quote
import uvicorn
from azure.core.exceptions import ResourceNotFoundError
from azure.storage.blob import BlobServiceClient
from fastapi import Depends, FastAPI, File, HTTPException, Request, UploadFile
from fastapi.responses im... | 36.571429 | 179 | 0.725521 | import os
from datetime import datetime
from typing import List
from urllib.parse import quote
import uvicorn
from azure.core.exceptions import ResourceNotFoundError
from azure.storage.blob import BlobServiceClient
from fastapi import Depends, FastAPI, File, HTTPException, Request, UploadFile
from fastapi.responses im... | true | true |
1c1d636eee5419f4f3d59c1f3fd327008122d5df | 1,173 | py | Python | pyvisdk/do/host_disk_partition_layout.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_disk_partition_layout.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_disk_partition_layout.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostDiskPartitionLayout(vim, *args, **kwargs):
'''This data object type describes the... | 33.514286 | 124 | 0.628303 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
| true | true |
1c1d643232d36e9a4ebfe1f6aaf8dce3a643082a | 823 | py | Python | pladmin/pltplconf/management/commands/Messagers/MLBot.py | az13js/pl-log-notic | 10a980610597602af44004efd6f100d483995149 | [
"MIT"
] | 6 | 2020-10-17T05:02:33.000Z | 2021-12-25T15:45:31.000Z | pladmin/pltplconf/management/commands/Messagers/MLBot.py | az13js/pl-log-notic | 10a980610597602af44004efd6f100d483995149 | [
"MIT"
] | null | null | null | pladmin/pltplconf/management/commands/Messagers/MLBot.py | az13js/pl-log-notic | 10a980610597602af44004efd6f100d483995149 | [
"MIT"
] | 1 | 2021-01-06T13:57:04.000Z | 2021-01-06T13:57:04.000Z | # -*- coding: utf8 -*-
"""示例用
"""
import logging
import requests
from django.conf import settings
import json
logger = logging.getLogger(__name__)
class MLBot():
def send(self, job, params):
logger.debug("MLBot 向企业微信群发送消息")
messageText = "【" + params["job_name"] + "】\nHi,查询到 " + str(params["total... | 27.433333 | 118 | 0.538275 |
import logging
import requests
from django.conf import settings
import json
logger = logging.getLogger(__name__)
class MLBot():
def send(self, job, params):
logger.debug("MLBot 向企业微信群发送消息")
messageText = "【" + params["job_name"] + "】\nHi,查询到 " + str(params["total"]) + " 个。\n"
display = 0... | true | true |
1c1d6438f63466d3cae523f7f1689f8353c901f0 | 1,174 | py | Python | splink/break_lineage.py | riddhi150390/splink | eae96a757877cf197608be21b437356732faee6e | [
"MIT"
] | 176 | 2020-03-16T15:19:39.000Z | 2022-03-30T06:38:29.000Z | splink/break_lineage.py | riddhi150390/splink | eae96a757877cf197608be21b437356732faee6e | [
"MIT"
] | 194 | 2020-03-01T21:32:26.000Z | 2022-03-30T14:58:38.000Z | splink/break_lineage.py | riddhi150390/splink | eae96a757877cf197608be21b437356732faee6e | [
"MIT"
] | 25 | 2020-03-07T00:09:22.000Z | 2022-03-11T16:28:06.000Z | # https://stackoverflow.com/questions/52556798/spark-iterative-recursive-algorithms-breaking-spark-lineage
# From https://github.com/high-performance-spark/high-performance-spark-examples/blob/f02142bebf528437702ec8fa689c9c0263e96fe7/high_performance_pyspark/SQLLineage.py#L20
from pyspark.sql.dataframe import DataFrame... | 30.102564 | 169 | 0.724872 |
m pyspark.sql.dataframe import DataFrame
def cutLineage(df):
jRDD = df._jdf.toJavaRDD()
jSchema = df._jdf.schema()
jRDD.cache()
sqlCtx = df.sql_ctx
try:
javaSqlCtx = sqlCtx._jsqlContext
except:
javaSqlCtx = sqlCtx._ssql_ctx
newJavaDF = javaSqlCtx.createDataFrame(jRDD, jSch... | true | true |
1c1d645217708ea919d22aa9c1e6f22f7896c6bc | 1,690 | py | Python | partisanassociations/utils.py | patrickywu/PartisanAssociations | f28f3afefb75e87b6dd2909def5031a40f03b40b | [
"MIT"
] | null | null | null | partisanassociations/utils.py | patrickywu/PartisanAssociations | f28f3afefb75e87b6dd2909def5031a40f03b40b | [
"MIT"
] | null | null | null | partisanassociations/utils.py | patrickywu/PartisanAssociations | f28f3afefb75e87b6dd2909def5031a40f03b40b | [
"MIT"
] | null | null | null | import pandas as pd
import string
import gensim
from gensim.parsing.preprocessing import preprocess_string
from gensim.models.doc2vec import TaggedDocument
def data_reader(data, id_var, description_var, drop_missing=True):
id = data[id_var].values
descriptions = data[description_var].values
data_frame = {'... | 38.409091 | 113 | 0.659172 | import pandas as pd
import string
import gensim
from gensim.parsing.preprocessing import preprocess_string
from gensim.models.doc2vec import TaggedDocument
def data_reader(data, id_var, description_var, drop_missing=True):
id = data[id_var].values
descriptions = data[description_var].values
data_frame = {'... | true | true |
1c1d64a9a2dd04f44bc2dc543c91a6589e2bb395 | 5,529 | py | Python | nova/tests/unit/api/openstack/compute/test_extended_availability_zone.py | larsbutler/nova | fb190f30a911658d8b0c4deaf43cbb8c9e35b672 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_extended_availability_zone.py | larsbutler/nova | fb190f30a911658d8b0c4deaf43cbb8c9e35b672 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_extended_availability_zone.py | larsbutler/nova | fb190f30a911658d8b0c4deaf43cbb8c9e35b672 | [
"Apache-2.0"
] | 1 | 2020-03-01T17:04:57.000Z | 2020-03-01T17:04:57.000Z | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 36.375 | 78 | 0.668475 |
from oslo_serialization import jsonutils
import webob
from nova import availability_zones
from nova import compute
from nova.compute import vm_states
from nova import exception
from nova import objects
from nova.objects import instance as instance_obj
from nova import test
from nova.tests.unit.api.opens... | true | true |
1c1d64d506f20f5803ea4fdd8904a50b7e4d5208 | 1,029 | py | Python | modules/webScraper/index.py | a-bianchi/twitter-daily-phrases | 957fec61bf6f6f691b51a48eba64f38e1661a44c | [
"MIT"
] | null | null | null | modules/webScraper/index.py | a-bianchi/twitter-daily-phrases | 957fec61bf6f6f691b51a48eba64f38e1661a44c | [
"MIT"
] | null | null | null | modules/webScraper/index.py | a-bianchi/twitter-daily-phrases | 957fec61bf6f6f691b51a48eba64f38e1661a44c | [
"MIT"
] | null | null | null | import requests
import urllib.request
import time
from bs4 import BeautifulSoup
from random import randrange
class ScrapProve:
def __init__(self, base_url, autors_url, table_element):
self.base_url = base_url
self.autors_url = autors_url
self.table_element = table_element
def get_li_a... | 33.193548 | 66 | 0.680272 | import requests
import urllib.request
import time
from bs4 import BeautifulSoup
from random import randrange
class ScrapProve:
def __init__(self, base_url, autors_url, table_element):
self.base_url = base_url
self.autors_url = autors_url
self.table_element = table_element
def get_li_a... | true | true |
1c1d6555ce8aae42a95e7827335da5924a77c36b | 14,194 | py | Python | torchvision/models/detection/_utils.py | malhotraa/vision | e1a3042792a3f15a8cae8cc563d54d2215a3e201 | [
"BSD-3-Clause"
] | 1 | 2020-05-27T06:41:10.000Z | 2020-05-27T06:41:10.000Z | torchvision/models/detection/_utils.py | malhotraa/vision | e1a3042792a3f15a8cae8cc563d54d2215a3e201 | [
"BSD-3-Clause"
] | null | null | null | torchvision/models/detection/_utils.py | malhotraa/vision | e1a3042792a3f15a8cae8cc563d54d2215a3e201 | [
"BSD-3-Clause"
] | null | null | null | import math
import torch
from torch.jit.annotations import List, Tuple
from torch import Tensor
import torchvision
# TODO: https://github.com/pytorch/pytorch/issues/26727
def zeros_like(tensor, dtype):
# type: (Tensor, int) -> Tensor
return torch.zeros_like(tensor, dtype=dtype, layout=tensor.layout,
... | 39.209945 | 107 | 0.635339 | import math
import torch
from torch.jit.annotations import List, Tuple
from torch import Tensor
import torchvision
def zeros_like(tensor, dtype):
return torch.zeros_like(tensor, dtype=dtype, layout=tensor.layout,
device=tensor.device, pin_memory=tensor.is_pinned())
@torch.jit.... | true | true |
1c1d688e1dba772bd270869b71f3e47a9e55f914 | 1,213 | py | Python | conf/config.py | sakiorito/samplebot_faq_ask_bot | 3af14b4d2a887b3996a121a52febec67cad828a8 | [
"Apache-2.0"
] | null | null | null | conf/config.py | sakiorito/samplebot_faq_ask_bot | 3af14b4d2a887b3996a121a52febec67cad828a8 | [
"Apache-2.0"
] | null | null | null | conf/config.py | sakiorito/samplebot_faq_ask_bot | 3af14b4d2a887b3996a121a52febec67cad828a8 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2020-present Works Mobile Corp.
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 requi... | 26.955556 | 80 | 0.771641 |
import os
DEFAULT_LANG = 'ja'
ADMIN_ACCOUNT = "ma.18058@matsubara"
DOMAIN_ID = 10281024
API_ID = "jp1CjllpEGnNF"
SERVER_CONSUMER_KEY = "KNVo4xLQ_3s6Pm8duW_K"
SERVER_ID = "8b6efb4843ab402ca73a3d63440a2a8e"
SECRET_KEY_NAME = "private_20201116165142.key"
LOCAL_ADDRESS = "https://m-qabot.herokuapp.com/"
DB_H... | true | true |
1c1d6a08343534515329fd926ac598d96c818aef | 1,804 | py | Python | fugue_spark/ibis_engine.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | fugue_spark/ibis_engine.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | fugue_spark/ibis_engine.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Optional
import ibis
import ibis.expr.types as ir
from fugue import DataFrame, DataFrames, ExecutionEngine
from fugue_ibis._utils import to_schema
from fugue_ibis.execution.ibis_engine import IbisEngine, register_ibis_engine
from pyspark.sql import DataFrame as PySparkDataFrame
from t... | 35.372549 | 87 | 0.710089 | from typing import Any, Callable, Optional
import ibis
import ibis.expr.types as ir
from fugue import DataFrame, DataFrames, ExecutionEngine
from fugue_ibis._utils import to_schema
from fugue_ibis.execution.ibis_engine import IbisEngine, register_ibis_engine
from pyspark.sql import DataFrame as PySparkDataFrame
from t... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.