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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c19eb76579b6ce0c98da208e62485b5b57e00de | 621 | py | Python | salt/cli/spm.py | andrew-vant/salt | 26fd2bc89e0faaff0fd0176a9896500660204cd5 | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/cli/spm.py | andrew-vant/salt | 26fd2bc89e0faaff0fd0176a9896500660204cd5 | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/cli/spm.py | andrew-vant/salt | 26fd2bc89e0faaff0fd0176a9896500660204cd5 | [
"Apache-2.0"
] | 1 | 2018-04-19T16:57:27.000Z | 2018-04-19T16:57:27.000Z | # -*- coding: utf-8 -*-
'''
salt.cli.spm
~~~~~~~~~~~~~
Salt's spm cli parser.
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt libs
import salt.spm
import salt.utils.parsers as parsers
class SPM(parsers.SPMParser):
'''
The cli parser obje... | 18.818182 | 62 | 0.595813 |
from __future__ import absolute_import
import salt.spm
import salt.utils.parsers as parsers
class SPM(parsers.SPMParser):
def run(self):
ui = salt.spm.SPMCmdlineInterface()
self.parse_args()
self.setup_logfile_logger()
client = salt.spm.SPMClient(ui, self.config)
clie... | true | true |
1c19ebf98dd233b3cfb9a2b7327943877dd09b15 | 1,154 | py | Python | setup.py | Ag-elf/sencyber-tools | efa7832bca94938e8fe5aec4218a6b66a433cdbf | [
"MIT"
] | null | null | null | setup.py | Ag-elf/sencyber-tools | efa7832bca94938e8fe5aec4218a6b66a433cdbf | [
"MIT"
] | null | null | null | setup.py | Ag-elf/sencyber-tools | efa7832bca94938e8fe5aec4218a6b66a433cdbf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021/6/1 10:23
# @Author : Shigure_Hotaru
# @Email : minjie96@sencyber.cn
# @File : setup.py
# @Version : Python 3.8.5 +
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt", "r", encoding="... | 28.146341 | 73 | 0.629116 |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt", "r", encoding="utf-8") as rq:
rqm = rq.read().strip()
reqs = rqm.split('\n')
reqs_list = [k.split('==')[0] for k in reqs]
setuptools.setup(
name="sencyber-tools",
... | true | true |
1c19ec1018b31ee6c457a34ec81e8afc7514bedb | 2,307 | py | Python | tests_smoke/smoke/test_api_one_off.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | tests_smoke/smoke/test_api_one_off.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | tests_smoke/smoke/test_api_one_off.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | from typing import Any, Dict
import requests
from .common import (
Attachment_type,
Config,
Notification_type,
pretty_print,
single_succeeded,
)
def test_api_one_off(notification_type: Notification_type, attachment_type: Attachment_type = Attachment_type.NONE):
if attachment_type is Attachme... | 31.175676 | 117 | 0.598179 | from typing import Any, Dict
import requests
from .common import (
Attachment_type,
Config,
Notification_type,
pretty_print,
single_succeeded,
)
def test_api_one_off(notification_type: Notification_type, attachment_type: Attachment_type = Attachment_type.NONE):
if attachment_type is Attachme... | true | true |
1c19ecae14b2bf20e675c7ead22d64a3c7e15379 | 9,453 | py | Python | tests/test_features.py | TihonkovSergey/pd-model-logreg | baa6447198f5f89a43b1091413d3199192230ce1 | [
"Apache-2.0"
] | null | null | null | tests/test_features.py | TihonkovSergey/pd-model-logreg | baa6447198f5f89a43b1091413d3199192230ce1 | [
"Apache-2.0"
] | null | null | null | tests/test_features.py | TihonkovSergey/pd-model-logreg | baa6447198f5f89a43b1091413d3199192230ce1 | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
import numpy as np
from definitions import TARGET_NAME, DATA_DIR
from src.features.feature_extraction import prepare_dataset, woe_transform
from src.data.dataframes import get_train, get_test
train_df_fr_columns = {
'ab_other_current_assets', 'gen_21', 'ar_selling_expenses', 'f_2', ... | 57.993865 | 114 | 0.673225 | import os
import pandas as pd
import numpy as np
from definitions import TARGET_NAME, DATA_DIR
from src.features.feature_extraction import prepare_dataset, woe_transform
from src.data.dataframes import get_train, get_test
train_df_fr_columns = {
'ab_other_current_assets', 'gen_21', 'ar_selling_expenses', 'f_2', ... | true | true |
1c19ecf8de1b2c5eb9903125e46968e3858ef9cd | 900 | py | Python | generateTest.py | mvidaldp/pytonegen | ca72e85c8988450bb8e848f52394ab8ba5bf6182 | [
"MIT"
] | null | null | null | generateTest.py | mvidaldp/pytonegen | ca72e85c8988450bb8e848f52394ab8ba5bf6182 | [
"MIT"
] | null | null | null | generateTest.py | mvidaldp/pytonegen | ca72e85c8988450bb8e848f52394ab8ba5bf6182 | [
"MIT"
] | null | null | null |
from PyToneGen import PyToneGen
PERIOD = 0.5 # duration of the tone
letters = ['c', 'c#', 'db', 'd', 'd#', 'eb', 'e', 'f', 'f#', 'gb', 'g', 'g#', 'ab', 'a', 'a#', 'bb', 'b']
# letters = ['C', 'C#', 'Db', 'D', 'D#', 'Eb', 'E', 'F', 'F#', 'Gb', 'G', 'G#', 'Ab', 'A', 'A#', 'Bb', 'B']
def num_to_key(num):
return {
... | 27.272727 | 107 | 0.403333 |
from PyToneGen import PyToneGen
PERIOD = 0.5
letters = ['c', 'c#', 'db', 'd', 'd#', 'eb', 'e', 'f', 'f#', 'gb', 'g', 'g#', 'ab', 'a', 'a#', 'bb', 'b']
def num_to_key(num):
return {
0: 'C',
1: 'C#',
2: 'D',
3: 'D#',
4: 'E',
5: 'F',
6: 'F#',
7: 'G'... | true | true |
1c19eef499db8a0edf8cd7db2990db4b7e47f6aa | 109,389 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 52.164521 | 257 | 0.679538 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c19f12cae7027a5c56c6abc5c40969b66552d2b | 1,640 | py | Python | probabll/distributions/concrete.py | EelcovdW/dists.pt | 994c698c846226ccf1905302f2bab860a2b24ca4 | [
"MIT"
] | null | null | null | probabll/distributions/concrete.py | EelcovdW/dists.pt | 994c698c846226ccf1905302f2bab860a2b24ca4 | [
"MIT"
] | null | null | null | probabll/distributions/concrete.py | EelcovdW/dists.pt | 994c698c846226ccf1905302f2bab860a2b24ca4 | [
"MIT"
] | null | null | null | import torch
from torch.distributions.uniform import Uniform
from torch.distributions.kl import register_kl
EPS = 1e-5
class BinaryConcrete(torch.distributions.relaxed_bernoulli.RelaxedBernoulli):
def __init__(self, temperature, probs=None, logits=None, validate_args=None):
super(BinaryConcrete, self... | 43.157895 | 117 | 0.690854 | import torch
from torch.distributions.uniform import Uniform
from torch.distributions.kl import register_kl
EPS = 1e-5
class BinaryConcrete(torch.distributions.relaxed_bernoulli.RelaxedBernoulli):
def __init__(self, temperature, probs=None, logits=None, validate_args=None):
super(BinaryConcrete, self... | true | true |
1c19f153fefe7a83a2a944e713a98ecf4e136f87 | 6,304 | py | Python | dataset/FlowInitial.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | 2 | 2021-03-12T09:17:54.000Z | 2022-02-08T14:10:53.000Z | dataset/FlowInitial.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | null | null | null | dataset/FlowInitial.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | null | null | null | import torch
import os
import random
import cv2
import cvbase as cvb
import numpy as np
import torch.utils.data as data
import utils.image as im
import utils.region_fill as rf
class FlowSeq(data.Dataset):
def __init__(self, config, isTest=False):
super(FlowSeq, self).__init__()
self.config = conf... | 41.748344 | 119 | 0.567893 | import torch
import os
import random
import cv2
import cvbase as cvb
import numpy as np
import torch.utils.data as data
import utils.image as im
import utils.region_fill as rf
class FlowSeq(data.Dataset):
def __init__(self, config, isTest=False):
super(FlowSeq, self).__init__()
self.config = conf... | true | true |
1c19f1941e56e87ed7c6f57bb4cb98a0e8c2a2e7 | 4,035 | py | Python | deepstream-lpr-app/python-gpio-lpr-usbcam.py | twlawrenceko/deepstream_lpr_gpio_app | ac7ca404f62cd8a57645d99c0224d724b1fbb30b | [
"MIT"
] | null | null | null | deepstream-lpr-app/python-gpio-lpr-usbcam.py | twlawrenceko/deepstream_lpr_gpio_app | ac7ca404f62cd8a57645d99c0224d724b1fbb30b | [
"MIT"
] | null | null | null | deepstream-lpr-app/python-gpio-lpr-usbcam.py | twlawrenceko/deepstream_lpr_gpio_app | ac7ca404f62cd8a57645d99c0224d724b1fbb30b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the ri... | 40.757576 | 178 | 0.663445 |
import RPi.GPIO as GPIO
import time
import subprocess
GPIO_TRIGGER = 18
GPIO_ECHO = 24
LED_Control = 22
Light_detect = 23
command = "gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=145 ! 'video/x-raw, format=(string)YUY2' ! nvvidconv ! omxh264enc ! matroskamux ! filesink location=video... | true | true |
1c19f2b5e50ed09f338bab660257e2262cf0a3ab | 3,056 | py | Python | TcpPortForward.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | TcpPortForward.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | TcpPortForward.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #/usr/bin/python env
# -*- coding: utf-8 -*-
'''
filename:TcpPortForward.py
@desc:
利用python的socket端口转发,用于远程维护,Hack
如果连接不到远程,会sleep 36s,最多尝试200(即两小时)
@usage:
./TcpPortForward.py stream1 stream2
stream为:l:port或c:host:port
l:port表示监听指定的本地端口
c:host:port表示监听远程指定的端口
'''
import socket
import sys
import threading
import time... | 20.238411 | 84 | 0.647251 |
'''
filename:TcpPortForward.py
@desc:
利用python的socket端口转发,用于远程维护,Hack
如果连接不到远程,会sleep 36s,最多尝试200(即两小时)
@usage:
./TcpPortForward.py stream1 stream2
stream为:l:port或c:host:port
l:port表示监听指定的本地端口
c:host:port表示监听远程指定的端口
'''
import socket
import sys
import threading
import time
streams = [None, None]
debug = 1
def... | false | true |
1c19f2cd40e2478740bfba6c07d7b8d0a93fe364 | 10,456 | py | Python | extensions/interactions/base.py | aman-roy/oppia | 0e7066829b59bf6ce4b15c4723fe0398721cfd1a | [
"Apache-2.0"
] | 2 | 2019-12-02T18:56:49.000Z | 2020-03-14T17:14:15.000Z | extensions/interactions/base.py | aman-roy/oppia | 0e7066829b59bf6ce4b15c4723fe0398721cfd1a | [
"Apache-2.0"
] | 13 | 2019-03-04T18:29:27.000Z | 2019-08-24T23:27:36.000Z | extensions/interactions/base.py | aman-roy/oppia | 0e7066829b59bf6ce4b15c4723fe0398721cfd1a | [
"Apache-2.0"
] | 2 | 2019-12-02T18:56:56.000Z | 2020-03-16T08:03:45.000Z | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 38.869888 | 80 | 0.682479 |
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import json
from core.domain import obj_services
from core.domain import visualization_registry
from extensions import domain
from extensions.objects.models import objects
import feconf
import python_utils
i... | true | true |
1c19f35107510e77d10343ff6b732714b0c4d4e3 | 1,144 | bzl | Python | docker/sig_tester.bzl | NE1997/scion | 5b9e86ec958f54e537045dc5e9632da50f93931c | [
"Apache-2.0"
] | null | null | null | docker/sig_tester.bzl | NE1997/scion | 5b9e86ec958f54e537045dc5e9632da50f93931c | [
"Apache-2.0"
] | 1 | 2019-06-26T06:38:40.000Z | 2019-06-26T06:38:40.000Z | docker/sig_tester.bzl | NE1997/scion | 5b9e86ec958f54e537045dc5e9632da50f93931c | [
"Apache-2.0"
] | 1 | 2019-06-24T14:20:53.000Z | 2019-06-24T14:20:53.000Z | load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image")
load("@package_bundle//file:packages.bzl", "packages")
def build_sigtester_image():
pkg_tar(
name = "sig_entrypoint",
srcs = ["files/sig.sh"],
package_dir =... | 29.333333 | 94 | 0.516608 | load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image")
load("@package_bundle//file:packages.bzl", "packages")
def build_sigtester_image():
pkg_tar(
name = "sig_entrypoint",
srcs = ["files/sig.sh"],
package_dir =... | true | true |
1c19f3d7ba02ec0fe667baf387c3298ade452b78 | 475 | py | Python | evaluation.py | dreamer121121/artnet-pytorch | 8ff77310c4bc5b9acfacfc7641beb32c90166181 | [
"MIT"
] | 3 | 2019-10-01T15:24:52.000Z | 2020-11-07T17:57:59.000Z | evaluation.py | dreamer121121/artnet-pytorch | 8ff77310c4bc5b9acfacfc7641beb32c90166181 | [
"MIT"
] | null | null | null | evaluation.py | dreamer121121/artnet-pytorch | 8ff77310c4bc5b9acfacfc7641beb32c90166181 | [
"MIT"
] | 1 | 2020-04-08T09:09:14.000Z | 2020-04-08T09:09:14.000Z | class ConsecutiveSequencesDetectionEvaluation(object):
def __init__(self, pos_class, num_sequence=1):
self.pos_class = pos_class
self.num_sequence = num_sequence
def eval(self, prediction):
count = 0
for label in prediction:
if label == self.pos_class:
... | 21.590909 | 54 | 0.555789 | class ConsecutiveSequencesDetectionEvaluation(object):
def __init__(self, pos_class, num_sequence=1):
self.pos_class = pos_class
self.num_sequence = num_sequence
def eval(self, prediction):
count = 0
for label in prediction:
if label == self.pos_class:
... | true | true |
1c19f3de4173ab0222f397cec37dcc2c586826a2 | 12,554 | py | Python | lib/pose/hrnet/pose_estimation/gen_kpts.py | aibodygym/GAST-Net-3DPoseEstimation | 59412b019a5015b7a4fac09af7175151597d74a9 | [
"MIT"
] | 235 | 2020-07-14T10:41:18.000Z | 2022-03-28T13:15:28.000Z | lib/pose/hrnet/pose_estimation/gen_kpts.py | human2b/GAST-Net-3DPoseEstimation | 97a364affe5cd4f68fab030e0210187333fff25e | [
"MIT"
] | 58 | 2020-07-14T23:39:55.000Z | 2022-03-24T12:48:13.000Z | lib/pose/hrnet/pose_estimation/gen_kpts.py | human2b/GAST-Net-3DPoseEstimation | 97a364affe5cd4f68fab030e0210187333fff25e | [
"MIT"
] | 52 | 2020-07-23T05:59:42.000Z | 2022-03-14T07:13:26.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import os.path as osp
import argparse
import time
import numpy as np
from tqdm import tqdm
import json
import torch
import torch.backends.cudnn as cudnn
import cv2
import _init_paths
from ... | 34.11413 | 118 | 0.597738 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import os.path as osp
import argparse
import time
import numpy as np
from tqdm import tqdm
import json
import torch
import torch.backends.cudnn as cudnn
import cv2
import _init_paths
from ... | true | true |
1c19f41f055f0e57505c6e37b8b3b8904534a85a | 11,742 | py | Python | primehub/admin_volumes.py | InfuseAI/primehub-python-sdk | edbdbcb3e41f0c99e4542245de1345a64f509fb4 | [
"Apache-2.0"
] | 10 | 2021-09-13T23:14:22.000Z | 2022-02-06T06:07:40.000Z | primehub/admin_volumes.py | KellenJohn/primehub-python-sdk | edbdbcb3e41f0c99e4542245de1345a64f509fb4 | [
"Apache-2.0"
] | 4 | 2021-08-10T03:10:27.000Z | 2021-12-16T02:11:50.000Z | primehub/admin_volumes.py | KellenJohn/primehub-python-sdk | edbdbcb3e41f0c99e4542245de1345a64f509fb4 | [
"Apache-2.0"
] | 1 | 2021-12-21T11:59:51.000Z | 2021-12-21T11:59:51.000Z | import json
from typing import Optional
from primehub import Helpful, Module, cmd, primehub_load_config
from primehub.utils import PrimeHubException
from primehub.utils.optionals import file_flag
from primehub.utils.validator import validate_name, validate_pv_groups
def waring_if_needed(data: dict, stderr):
if d... | 30.419689 | 119 | 0.552461 | import json
from typing import Optional
from primehub import Helpful, Module, cmd, primehub_load_config
from primehub.utils import PrimeHubException
from primehub.utils.optionals import file_flag
from primehub.utils.validator import validate_name, validate_pv_groups
def waring_if_needed(data: dict, stderr):
if d... | true | true |
1c19f4506bb28cac7f7160106f97a1a7ab297f0c | 4,891 | py | Python | quora/Project_Quora/Project_Quora/spiders/topic/topic.py | 11harveyj/qa-scrapers | ac162d4c826fd3be653c29aaf0dc628f7d4861ca | [
"MIT"
] | 22 | 2016-01-26T16:36:23.000Z | 2021-04-17T18:45:25.000Z | quora/Project_Quora/Project_Quora/spiders/topic/topic.py | 11harveyj/qa-scrapers | ac162d4c826fd3be653c29aaf0dc628f7d4861ca | [
"MIT"
] | 8 | 2015-12-08T18:12:12.000Z | 2018-06-18T11:13:19.000Z | quora/Project_Quora/Project_Quora/spiders/topic/topic.py | 11harveyj/qa-scrapers | ac162d4c826fd3be653c29aaf0dc628f7d4861ca | [
"MIT"
] | 10 | 2015-12-04T15:17:01.000Z | 2021-04-07T20:39:46.000Z | import time
import codecs
import platform
import sys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
class T... | 35.442029 | 81 | 0.584134 | import time
import codecs
import platform
import sys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
class T... | false | true |
1c19f6042d060f5d3e348f90fd18487bec59afa7 | 1,674 | py | Python | projects/sc_virtualenv.py | xiaobailong653/scripts | c68c988f59b8b9428163f687d0116429e9a0d479 | [
"Apache-2.0"
] | null | null | null | projects/sc_virtualenv.py | xiaobailong653/scripts | c68c988f59b8b9428163f687d0116429e9a0d479 | [
"Apache-2.0"
] | null | null | null | projects/sc_virtualenv.py | xiaobailong653/scripts | c68c988f59b8b9428163f687d0116429e9a0d479 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from optparse import OptionParser
from utils.u_file import FileHandler
class ScriptHandler(object):
"""部署virtualenv"""
def __init__(self):
pass
def parser_args(self, argv):
parser = OptionParser()
parser.add_option("", "--b... | 28.862069 | 67 | 0.510155 |
import os
from optparse import OptionParser
from utils.u_file import FileHandler
class ScriptHandler(object):
"""部署virtualenv"""
def __init__(self):
pass
def parser_args(self, argv):
parser = OptionParser()
parser.add_option("", "--build-env",
action=... | false | true |
1c19f6476ec4f1a6cd177c6d53b10fe8deb094b2 | 2,124 | py | Python | code/getImagesDimsDf.py | LostPetInitiative/PetSimilarity-ML | 30ff9c9981e5f6463aad277fb6f2ba0a0ad96be7 | [
"MIT"
] | null | null | null | code/getImagesDimsDf.py | LostPetInitiative/PetSimilarity-ML | 30ff9c9981e5f6463aad277fb6f2ba0a0ad96be7 | [
"MIT"
] | null | null | null | code/getImagesDimsDf.py | LostPetInitiative/PetSimilarity-ML | 30ff9c9981e5f6463aad277fb6f2ba0a0ad96be7 | [
"MIT"
] | null | null | null | import pandas as pd
import glob
from PIL import Image
from tqdm import tqdm
import sys
import asyncio
from concurrent.futures import ThreadPoolExecutor
inputDirPath = sys.argv[1]
outputPath = sys.argv[2]
async def work():
concurrentTasksSem = asyncio.Semaphore(8)
treadPool = ThreadPoolExecutor(max_workers=10... | 27.230769 | 71 | 0.615348 | import pandas as pd
import glob
from PIL import Image
from tqdm import tqdm
import sys
import asyncio
from concurrent.futures import ThreadPoolExecutor
inputDirPath = sys.argv[1]
outputPath = sys.argv[2]
async def work():
concurrentTasksSem = asyncio.Semaphore(8)
treadPool = ThreadPoolExecutor(max_workers=10... | true | true |
1c19f64ceb45a3b1f3484f044ae39ad13fa35025 | 259 | py | Python | capexexpress/capexexpress/doctype/it_purchase_order/it_purchase_order.py | aptest2018/testcapexexpress | fff4047294f90884957e63357d4b3b56570fd13d | [
"MIT"
] | null | null | null | capexexpress/capexexpress/doctype/it_purchase_order/it_purchase_order.py | aptest2018/testcapexexpress | fff4047294f90884957e63357d4b3b56570fd13d | [
"MIT"
] | null | null | null | capexexpress/capexexpress/doctype/it_purchase_order/it_purchase_order.py | aptest2018/testcapexexpress | fff4047294f90884957e63357d4b3b56570fd13d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, defcom1 and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ITPurchaseOrder(Document):
pass
| 23.545455 | 49 | 0.783784 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ITPurchaseOrder(Document):
pass
| true | true |
1c19f66a668eacdb028345726a9e6080b6885424 | 63,780 | py | Python | instagram_scraper/app.py | rudighert/instagram-scraper | 214fe7e5d2c3b4bb79281e3be070da5965e7612e | [
"Unlicense"
] | null | null | null | instagram_scraper/app.py | rudighert/instagram-scraper | 214fe7e5d2c3b4bb79281e3be070da5965e7612e | [
"Unlicense"
] | null | null | null | instagram_scraper/app.py | rudighert/instagram-scraper | 214fe7e5d2c3b4bb79281e3be070da5965e7612e | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import codecs
import configparser
import errno
import glob
from operator import itemgetter
import json
import logging.config
import hashlib
import os
import pickle
import re
import sys
import textwrap
import time
try:
from urllib.parse import urlparse
exce... | 45.622318 | 3,655 | 0.560865 |
import argparse
import codecs
import configparser
import errno
import glob
from operator import itemgetter
import json
import logging.config
import hashlib
import os
import pickle
import re
import sys
import textwrap
import time
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import... | true | true |
1c19f6952b7aa4eaaffa978e56912e3c796948ee | 633 | py | Python | lib/watchopticalmc/tests/integration/test_runall.py | davehadley/watchoptical | a3a999b1318b021a319497c6c23624051a1b1cb3 | [
"MIT"
] | null | null | null | lib/watchopticalmc/tests/integration/test_runall.py | davehadley/watchoptical | a3a999b1318b021a319497c6c23624051a1b1cb3 | [
"MIT"
] | null | null | null | lib/watchopticalmc/tests/integration/test_runall.py | davehadley/watchoptical | a3a999b1318b021a319497c6c23624051a1b1cb3 | [
"MIT"
] | null | null | null | from watchopticalutils.filepathutils import temporaryworkingdirectory
from subprocess import run
from pathlib import Path
from watchopticalmc import AnalysisDataset
def test_runall():
with temporaryworkingdirectory() as d:
run(
[
"python",
"-m",
... | 26.375 | 69 | 0.535545 | from watchopticalutils.filepathutils import temporaryworkingdirectory
from subprocess import run
from pathlib import Path
from watchopticalmc import AnalysisDataset
def test_runall():
with temporaryworkingdirectory() as d:
run(
[
"python",
"-m",
... | true | true |
1c19f69ee89a98de3070e254f7c1b3487158d8a9 | 48,919 | py | Python | coverage/parser.py | shahzebsiddiqui/coveragepy | 21d3b37e290796312750f207442b33afbaab14de | [
"Apache-2.0"
] | 1 | 2021-01-03T00:57:40.000Z | 2021-01-03T00:57:40.000Z | coverage/parser.py | shahzebsiddiqui/coveragepy | 21d3b37e290796312750f207442b33afbaab14de | [
"Apache-2.0"
] | 1 | 2019-05-28T01:29:57.000Z | 2019-06-10T18:59:28.000Z | coverage/parser.py | shahzebsiddiqui/coveragepy | 21d3b37e290796312750f207442b33afbaab14de | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Code parsing for coverage.py."""
import ast
import collections
import os
import re
import token
import tokenize
from coverage import env
from coverage.backward... | 39.197917 | 99 | 0.595822 |
import ast
import collections
import os
import re
import token
import tokenize
from coverage import env
from coverage.backward import range
from coverage.backward import bytes_to_ints, string_class
from coverage.bytecode import CodeObjects
from coverage.debug import short_stack
from coverage.misc import contra... | true | true |
1c19f7308f94e86a01f4c85b9a3224baa0ac98e9 | 1,961 | py | Python | src/config_loader.py | daverooneyca/code_joy | b251c11111ee1f24c1084ca7242e8a3a8ca0a96d | [
"MIT"
] | null | null | null | src/config_loader.py | daverooneyca/code_joy | b251c11111ee1f24c1084ca7242e8a3a8ca0a96d | [
"MIT"
] | null | null | null | src/config_loader.py | daverooneyca/code_joy | b251c11111ee1f24c1084ca7242e8a3a8ca0a96d | [
"MIT"
] | null | null | null | # Copyright © 2022 Dave Rooney
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute... | 38.45098 | 109 | 0.715451 |
import os
import json
class ConfigurationLoader():
def __init__(self, config_file):
self.config_file = config_file
def load(self):
config = {}
try:
raw_data = self.read_config_file()
config = json.loads(raw_data)
except (Exception) as error:
... | true | true |
1c19f7e5bc48757b15f5a08aadd74fb7cb03dd68 | 8,204 | py | Python | src/core/stompest/tests/sync_client_test.py | scwicker/stompest | 715f358b8503320ea42bd4de6682916339943edc | [
"Apache-2.0"
] | 66 | 2015-01-06T02:20:04.000Z | 2022-03-08T01:32:49.000Z | src/core/stompest/tests/sync_client_test.py | scwicker/stompest | 715f358b8503320ea42bd4de6682916339943edc | [
"Apache-2.0"
] | 34 | 2015-05-06T14:34:39.000Z | 2022-03-16T23:26:04.000Z | src/core/stompest/tests/sync_client_test.py | scwicker/stompest | 715f358b8503320ea42bd4de6682916339943edc | [
"Apache-2.0"
] | 38 | 2015-05-16T18:36:08.000Z | 2022-03-16T19:23:11.000Z | import logging
import unittest
from stompest.config import StompConfig
from stompest.error import StompConnectionError, StompProtocolError
from stompest.protocol import commands, StompFrame, StompSpec, StompSession
from stompest.sync import Stomp
from stompest.tests import mock
logging.basicConfig(level=logging.DEBU... | 44.830601 | 197 | 0.693808 | import logging
import unittest
from stompest.config import StompConfig
from stompest.error import StompConnectionError, StompProtocolError
from stompest.protocol import commands, StompFrame, StompSpec, StompSession
from stompest.sync import Stomp
from stompest.tests import mock
logging.basicConfig(level=logging.DEBU... | true | true |
1c19f8594cd35dc3ea4d83aad0d8549c5caecf77 | 409 | py | Python | skeleton/wsgi.py | Joaxin/django-welogs | 260a72322cdc5591ecd3ceae1dc99a66da333d2b | [
"MIT"
] | null | null | null | skeleton/wsgi.py | Joaxin/django-welogs | 260a72322cdc5591ecd3ceae1dc99a66da333d2b | [
"MIT"
] | null | null | null | skeleton/wsgi.py | Joaxin/django-welogs | 260a72322cdc5591ecd3ceae1dc99a66da333d2b | [
"MIT"
] | null | null | null | """
WSGI config for skeleton project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault... | 24.058824 | 79 | 0.755501 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'skeleton.settings')
application = get_wsgi_application()
| true | true |
1c19f86e2a617aa24f0bca08274a8de1a69fb762 | 97,269 | py | Python | test/functional/p2p_segwit.py | Guinea1/AnotherScryptCoin | 58bae163e23da7468a9854073231a512a4d037ee | [
"MIT"
] | null | null | null | test/functional/p2p_segwit.py | Guinea1/AnotherScryptCoin | 58bae163e23da7468a9854073231a512a4d037ee | [
"MIT"
] | 2 | 2021-01-14T16:29:02.000Z | 2022-03-03T22:55:41.000Z | test/functional/p2p_segwit.py | Guinea1/AnotherScryptCoin | 58bae163e23da7468a9854073231a512a4d037ee | [
"MIT"
] | 1 | 2022-01-09T08:44:40.000Z | 2022-01-09T08:44:40.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from binascii import hexlify
import math
import ... | 46.318571 | 295 | 0.655306 |
from binascii import hexlify
import math
import random
import struct
import time
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, get_witness_script, WITNESS_COMMITMENT_HEADER
from test_framework.key import ECKey
from test_framework.messages import (
BIP125_SEQUENCE_... | true | true |
1c19f96b492aa156a49f9728bb2d445f068f09d6 | 3,829 | py | Python | aiida/backends/djsite/settings.py | azadoks/aiida-core | b806b7fef8fc79090deccfe2019b77cb922e0581 | [
"MIT",
"BSD-3-Clause"
] | 180 | 2019-07-12T07:45:26.000Z | 2022-03-22T13:16:57.000Z | aiida/backends/djsite/settings.py | azadoks/aiida-core | b806b7fef8fc79090deccfe2019b77cb922e0581 | [
"MIT",
"BSD-3-Clause"
] | 2,325 | 2019-07-04T13:41:44.000Z | 2022-03-31T12:17:10.000Z | aiida/backends/djsite/settings.py | azadoks/aiida-core | b806b7fef8fc79090deccfe2019b77cb922e0581 | [
"MIT",
"BSD-3-Clause"
] | 88 | 2019-07-06T01:42:39.000Z | 2022-03-18T14:20:09.000Z | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 33.884956 | 108 | 0.655524 | true | true | |
1c19fa05d3f590f8493e8d695d9a38c2a3cc421b | 1,368 | py | Python | blogstrap/utils.py | joehakimrahme/blogstrap | 6ff91904065d01ebaf757a51c1483c7f180521c0 | [
"Apache-2.0"
] | null | null | null | blogstrap/utils.py | joehakimrahme/blogstrap | 6ff91904065d01ebaf757a51c1483c7f180521c0 | [
"Apache-2.0"
] | 13 | 2015-11-16T12:21:50.000Z | 2020-05-28T08:25:27.000Z | blogstrap/utils.py | joehakimrahme/blogstrap | 6ff91904065d01ebaf757a51c1483c7f180521c0 | [
"Apache-2.0"
] | 2 | 2015-11-22T09:39:53.000Z | 2020-11-24T10:35:19.000Z | # Copyright 2020 Joe H. Rahme <joehakimrahme@gmail.com>
# 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
... | 35.076923 | 78 | 0.625731 |
import re
def parse_metadata(article):
lines = article.split("\n")
metadata = {}
for lino, line in enumerate(lines):
line = line.strip()
if line == '':
continue
if not line.startswith('#'):
break
pattern = r'^\s*#\s*(?P<key>[^:... | true | true |
1c19faa364f6b2449f5a59cff050e51ef290b3c6 | 1,716 | py | Python | aliyun-python-sdk-cloudesl/aliyunsdkcloudesl/request/v20200201/DescribePlanogramPositionsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cloudesl/aliyunsdkcloudesl/request/v20200201/DescribePlanogramPositionsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-cloudesl/aliyunsdkcloudesl/request/v20200201/DescribePlanogramPositionsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.020408 | 94 | 0.759907 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkcloudesl.endpoint import endpoint_data
class DescribePlanogramPositionsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'cloudesl', '2020-02-01', 'DescribePlanogramPositions','cloudesl')
if hasattr(self, "endpoint_map... | true | true |
1c19fb016046cc8abf4bc9cd058cad6348e01fa7 | 10,371 | py | Python | bot.py | kneeraazon01/SqlitePython | decf049bd75ecc44f5343837db2cef0d552048c2 | [
"Apache-2.0"
] | null | null | null | bot.py | kneeraazon01/SqlitePython | decf049bd75ecc44f5343837db2cef0d552048c2 | [
"Apache-2.0"
] | null | null | null | bot.py | kneeraazon01/SqlitePython | decf049bd75ecc44f5343837db2cef0d552048c2 | [
"Apache-2.0"
] | null | null | null | import asyncio # for asynchronous waiting
import discord # modified discord library for selfbots
from discord.errors import Forbidden, HTTPException
from discord import GuildSubscriptionOptions
from random import randint, choice, shuffle # for implementing random waiting time
import requests as req
from sys import ar... | 34.685619 | 181 | 0.605149 | import asyncio
import discord
from discord.errors import Forbidden, HTTPException
from discord import GuildSubscriptionOptions
from random import randint, choice, shuffle
import requests as req
from sys import argv
bot_limit_start = 1
bot_limit_end = 80
if len(argv) == 1:
should_join = True
else:
if argv... | true | true |
1c19fb0fe3fceba098bf98fbfe7cb9aa8f550acd | 656 | py | Python | website/models.py | mukeshprasad/Simple-Notes-App-using-Flask | 8b83376838f0dd5da77fcb77430d7aec109e71a5 | [
"MIT"
] | null | null | null | website/models.py | mukeshprasad/Simple-Notes-App-using-Flask | 8b83376838f0dd5da77fcb77430d7aec109e71a5 | [
"MIT"
] | null | null | null | website/models.py | mukeshprasad/Simple-Notes-App-using-Flask | 8b83376838f0dd5da77fcb77430d7aec109e71a5 | [
"MIT"
] | null | null | null | # have to setup both user information and store their notes
from . import db
from flask_login import UserMixin
from sqlalchemy.sql import func
class Note(db.Model):
id = db.Column(db.Integer, primary_key=True)
data = db.Column(db.String(10000))
date = db.Column(db.DateTime(timezone=True), default=f... | 36.444444 | 69 | 0.692073 |
from . import db
from flask_login import UserMixin
from sqlalchemy.sql import func
class Note(db.Model):
id = db.Column(db.Integer, primary_key=True)
data = db.Column(db.String(10000))
date = db.Column(db.DateTime(timezone=True), default=func.now())
user_id = db.Column(db.Integer, db.ForeignKe... | true | true |
1c19fb48461447ea66d6bd9fae18f373f0470f2e | 452 | py | Python | package_control/commands/package_control_tests_command.py | zjzh/package_control | cfaaeb57612023e3679ecb7f8cd7ceac9f57990d | [
"Unlicense",
"MIT"
] | 3,373 | 2015-01-01T01:19:59.000Z | 2022-03-30T13:18:47.000Z | package_control/commands/package_control_tests_command.py | zjzh/package_control | cfaaeb57612023e3679ecb7f8cd7ceac9f57990d | [
"Unlicense",
"MIT"
] | 815 | 2015-01-01T01:21:43.000Z | 2022-03-23T21:46:29.000Z | package_control/commands/package_control_tests_command.py | zjzh/package_control | cfaaeb57612023e3679ecb7f8cd7ceac9f57990d | [
"Unlicense",
"MIT"
] | 791 | 2015-01-01T01:20:00.000Z | 2022-03-23T21:10:49.000Z | import sublime
import sublime_plugin
from ..tests import TestRunner, TEST_CLASSES
class PackageControlTestsCommand(sublime_plugin.WindowCommand):
"""
A command to run the tests for Package Control
"""
def run(self):
TestRunner(args=(self.window, TEST_CLASSES)).start()
def is_visible(sel... | 25.111111 | 76 | 0.719027 | import sublime
import sublime_plugin
from ..tests import TestRunner, TEST_CLASSES
class PackageControlTestsCommand(sublime_plugin.WindowCommand):
def run(self):
TestRunner(args=(self.window, TEST_CLASSES)).start()
def is_visible(self):
settings = sublime.load_settings('Package Control.subli... | true | true |
1c19fcb3eba8cceabcb8ddb4337b93d2dbd803c6 | 5,561 | py | Python | python/paddle/fluid/dygraph/base.py | circleci-test-ix/Paddle | 82f1b27aca93ba2e50b6bf311fb90637c1085785 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/dygraph/base.py | circleci-test-ix/Paddle | 82f1b27aca93ba2e50b6bf311fb90637c1085785 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/dygraph/base.py | circleci-test-ix/Paddle | 82f1b27aca93ba2e50b6bf311fb90637c1085785 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 27.805 | 96 | 0.637655 |
from ..wrapped_decorator import signature_safe_contextmanager, wrap_decorator
import contextlib
import numpy as np
import os
from paddle.fluid import core
from paddle.fluid import framework
from .tracer import Tracer
import logging
__all__ = [
'enabled',
'no_grad',
'guard',
'to_variable',... | true | true |
1c19fcb42977b0a990369c2e282c2b6d6428c8be | 2,296 | py | Python | train.py | akhauriyash/nb-asr | 8889f37081ebbde253da1589d13fe3bc9ccd9ef8 | [
"Apache-2.0"
] | 19 | 2021-04-15T12:03:37.000Z | 2022-03-14T12:15:55.000Z | train.py | akhauriyash/nb-asr | 8889f37081ebbde253da1589d13fe3bc9ccd9ef8 | [
"Apache-2.0"
] | 3 | 2021-05-05T07:30:06.000Z | 2021-07-23T10:45:40.000Z | train.py | akhauriyash/nb-asr | 8889f37081ebbde253da1589d13fe3bc9ccd9ef8 | [
"Apache-2.0"
] | 3 | 2021-07-12T09:59:47.000Z | 2021-12-27T10:25:35.000Z | import pathlib
import argparse
from nasbench_asr import set_default_backend, get_backend_name, set_seed, prepare_devices, get_model, get_dataloaders, get_trainer, get_loss
def main():
parser = argparse.ArgumentParser()
parser.add_argument('model', type=int, nargs=9)
parser.add_argument('--batch_size', ty... | 38.915254 | 140 | 0.690767 | import pathlib
import argparse
from nasbench_asr import set_default_backend, get_backend_name, set_seed, prepare_devices, get_model, get_dataloaders, get_trainer, get_loss
def main():
parser = argparse.ArgumentParser()
parser.add_argument('model', type=int, nargs=9)
parser.add_argument('--batch_size', ty... | true | true |
1c19fcdecb73aedf6165824543f17727109b83a7 | 13,526 | py | Python | tfx/components/base/base_driver.py | lyschoening/tfx | ff87a97db07642e57e2c84cf50682dc5996f99a4 | [
"Apache-2.0"
] | null | null | null | tfx/components/base/base_driver.py | lyschoening/tfx | ff87a97db07642e57e2c84cf50682dc5996f99a4 | [
"Apache-2.0"
] | null | null | null | tfx/components/base/base_driver.py | lyschoening/tfx | ff87a97db07642e57e2c84cf50682dc5996f99a4 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 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 req... | 41.490798 | 82 | 0.688969 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from typing import Any, Dict, List, Text
import absl
import tensorflow as tf
from tfx import types
from tfx.orchestration import data_types
from tfx.orchestration import metadata
from ... | true | true |
1c19fd3191803098f3b58a3104e0dd4c10dc25a1 | 19,964 | py | Python | traffic_lights/lib/Evaluator.py | aidandunlop/traffic_light_recognition | 497efe7fe678b88db5331ba446fc45c240276e3f | [
"MIT"
] | 5 | 2020-05-11T04:11:56.000Z | 2022-02-17T09:17:08.000Z | traffic_lights/lib/Evaluator.py | aidandunlop/traffic_light_recognition | 497efe7fe678b88db5331ba446fc45c240276e3f | [
"MIT"
] | 3 | 2021-06-08T21:24:47.000Z | 2022-03-12T00:26:40.000Z | traffic_lights/lib/Evaluator.py | aidandunlop/traffic_light_recognition | 497efe7fe678b88db5331ba446fc45c240276e3f | [
"MIT"
] | 4 | 2020-05-10T03:20:08.000Z | 2021-12-08T09:49:42.000Z | ###########################################################################################
# #
# Evaluator class: Implements the most popular metrics for object detection #
# ... | 44.963964 | 103 | 0.514977 | dicPosition['right_down'],
# dicPosition['down_zero'], #'D', 'B', 'H', 'P'
# dicPosition['left_up'],
# dicPosition['up_zero'],
# dicPosition['right_up'],
# dicPosition['left_up'], # 'E', 'X', 'N', 'T',
# dicPosition['... | true | true |
1c19fd385c2c32fe37acb2873478879259e70a3b | 4,218 | py | Python | Lenguaje_Natural.py | d-michel/summary-nltk | 97e05130850135585b117b9b809c0332b637cf8f | [
"MIT"
] | null | null | null | Lenguaje_Natural.py | d-michel/summary-nltk | 97e05130850135585b117b9b809c0332b637cf8f | [
"MIT"
] | null | null | null | Lenguaje_Natural.py | d-michel/summary-nltk | 97e05130850135585b117b9b809c0332b637cf8f | [
"MIT"
] | null | null | null | from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
import nltk
from PdfToTxt import file_to_file
def summary(input_pdf):
'''
This function gives to you the summary of a text thanks to the nltk package
(using a natural language proccessing algorithm).
Input... | 35.745763 | 87 | 0.578473 | from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
import nltk
from PdfToTxt import file_to_file
def summary(input_pdf):
input_txt = file_to_file(input_pdf)
nltk.download("stopwords")
nltk.download("punkt")
... | true | true |
1c19fedc8fe9f33eaaaedd76eb13e8cc26e339db | 7,992 | py | Python | infer.py | hanqiu-hq/GFNet | 4fb4b298069aa2448b696711cb69d4f6c30fd3fd | [
"MIT"
] | 185 | 2021-07-02T05:55:49.000Z | 2022-03-25T12:20:40.000Z | infer.py | TianhaoFu/GFNet | 3dfc282831fbfbe25ad01d28e86d7d99056ea2cb | [
"MIT"
] | 12 | 2021-07-07T14:53:32.000Z | 2022-03-08T09:38:23.000Z | infer.py | TianhaoFu/GFNet | 3dfc282831fbfbe25ad01d28e86d7d99056ea2cb | [
"MIT"
] | 20 | 2021-07-02T08:36:31.000Z | 2022-02-10T02:47:23.000Z | import argparse
import datetime
import numpy as np
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import json
from pathlib import Path
from timm.data import Mixup
from timm.models import create_model
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from tim... | 34.597403 | 116 | 0.609735 | import argparse
import datetime
import numpy as np
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import json
from pathlib import Path
from timm.data import Mixup
from timm.models import create_model
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from tim... | true | true |
1c19fff9c3b806e23c980eb511ca69b65bc91a14 | 1,471 | py | Python | setup.py | rbrecheisen/cmdtools | 165ee0d85fd1f4ce21e693507e5ef61aff67814d | [
"MIT"
] | null | null | null | setup.py | rbrecheisen/cmdtools | 165ee0d85fd1f4ce21e693507e5ef61aff67814d | [
"MIT"
] | null | null | null | setup.py | rbrecheisen/cmdtools | 165ee0d85fd1f4ce21e693507e5ef61aff67814d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['pytest', 'cmd2', 'gnureadline', 'pydicom', 'pandas', 'numpy'... | 30.020408 | 90 | 0.654657 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['pytest', 'cmd2', 'gnureadline', 'pydicom', 'pandas', 'numpy']
setup_requirements = [ ]
test_requirement... | true | true |
1c1a007be6457b96e3265bafd28d00e1315726cb | 2,926 | py | Python | agent.py | skywalk163/parl_ball | b1529c2429a1dc9a0805e04acc4719a1b3ad678e | [
"BSD-3-Clause"
] | null | null | null | agent.py | skywalk163/parl_ball | b1529c2429a1dc9a0805e04acc4719a1b3ad678e | [
"BSD-3-Clause"
] | null | null | null | agent.py | skywalk163/parl_ball | b1529c2429a1dc9a0805e04acc4719a1b3ad678e | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 38 | 139 | 0.627478 |
import numpy as np
import paddle.fluid as fluid
import parl
from parl import layers
class Agent(parl.Agent):
def __init__(self, algorithm, obs_dim, act_dim):
self.obs_dim = obs_dim
self.act_dim = act_dim
super(Agent, self).__init__(algorithm)
def build_program(self):
... | true | true |
1c1a01a3507093a17edc1af73b0b59874aac06ec | 163 | py | Python | python/testData/intentions/PyInvertIfConditionIntentionTest/commentsMultilineElse.py | Tasemo/intellij-community | 50aeaf729b7073e91c7c77487a1f155e0dfe3fcd | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/intentions/PyInvertIfConditionIntentionTest/commentsMultilineElse.py | Tasemo/intellij-community | 50aeaf729b7073e91c7c77487a1f155e0dfe3fcd | [
"Apache-2.0"
] | null | null | null | python/testData/intentions/PyInvertIfConditionIntentionTest/commentsMultilineElse.py | Tasemo/intellij-community | 50aeaf729b7073e91c7c77487a1f155e0dfe3fcd | [
"Apache-2.0"
] | null | null | null | def func():
value = "not-none"
<caret>if value is None:
print("None")
# Is not none
# If it's not none
else:
print("Not none") | 18.111111 | 28 | 0.509202 | def func():
value = "not-none"
<caret>if value is None:
print("None")
else:
print("Not none") | false | true |
1c1a0200ea6136c7f3c8a71cbbc3d2620b9148b8 | 667 | py | Python | lispat_app/lispat/bin/rst2xml.py | brummetj/LISPAT | 9742b1a392780cf6664a5a6d580f4f976e48b732 | [
"MIT"
] | null | null | null | lispat_app/lispat/bin/rst2xml.py | brummetj/LISPAT | 9742b1a392780cf6664a5a6d580f4f976e48b732 | [
"MIT"
] | 2 | 2021-03-31T19:01:32.000Z | 2021-12-13T19:55:58.000Z | lispat_app/lispat/bin/rst2xml.py | ericholguin/LISPAT | 16f49197a5e598b224374094a22f28989c31302c | [
"MIT"
] | null | null | null | #!/Users/joshuabrummet/workspace/senior-design/LISPAT/lispat_app/lispat/bin/python3
# $Id: rst2xml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing Docutils XM... | 27.791667 | 83 | 0.751124 |
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
description = ('Generates Docutils-native XML from standalone '
'reStructuredText sources. ' + default_description)
publish_cmdline(writer_name='xml',... | true | true |
1c1a02f2ea06bc59546dede95f5a1469836ba6c8 | 1,980 | py | Python | beautifulsoup/split-on-br/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | beautifulsoup/split-on-br/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | beautifulsoup/split-on-br/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z |
# date: 2019.08.07
# https://stackoverflow.com/questions/57392407/how-to-split-html-text-with-br-tags/57392710#57392603
#
# https://stackoverflow.com/questions/30694558/beautifulsoup-split-text-in-tag-by-br
# [x for x in dt.find_next_sibling('dd').contents if getattr(x, 'name', None) != 'br']
# [x for x in dt.childre... | 28.285714 | 187 | 0.718182 |
removes all tags when you get .text so there is no <br> to split.
You can try .get_text(separator=...) to get it and it should add separtors between text from different tags. It should put separator instead of <br>. And then you can use split(separator)
words = text_tag.get_text(separator='|', strip=True).split('|'... | false | true |
1c1a03d61f6103ef9c3c243b412e22c55855848e | 1,182 | py | Python | setup.py | edwardmjackson/cape-frontend | 4204f50304ee5cf8808a564b6f8bf969a5bf4043 | [
"Apache-2.0"
] | null | null | null | setup.py | edwardmjackson/cape-frontend | 4204f50304ee5cf8808a564b6f8bf969a5bf4043 | [
"Apache-2.0"
] | null | null | null | setup.py | edwardmjackson/cape-frontend | 4204f50304ee5cf8808a564b6f8bf969a5bf4043 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 BLEMUNDSBURY AI LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 31.105263 | 84 | 0.698816 |
from package_settings import NAME, VERSION, PACKAGES, DESCRIPTION
from setuptools import setup
from pathlib import Path
setup(
name=NAME,
version=VERSION,
long_description=DESCRIPTION,
author='Bloomsbury AI',
author_email='contact@bloomsbury.ai',
packages=PACKAGES,
include_pa... | true | true |
1c1a03fe9aa1f9e5839917ae0cbbaa636861c6e9 | 19,799 | py | Python | src/django_bpp/settings/base.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | null | null | null | src/django_bpp/settings/base.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | null | null | null | src/django_bpp/settings/base.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | null | null | null | import os
import random
import string
import sys
from datetime import timedelta
import sentry_sdk
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from sentry_sdk.integrations.django import DjangoIntegration
from bpp.util import slugify_function
from django_bpp.version import VERSION
def dja... | 28.48777 | 91 | 0.672206 | import os
import random
import string
import sys
from datetime import timedelta
import sentry_sdk
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from sentry_sdk.integrations.django import DjangoIntegration
from bpp.util import slugify_function
from django_bpp.version import VERSION
def dja... | true | true |
1c1a047ea3442b6973314aa29c6f85670827e187 | 13,337 | py | Python | tests/unit_tests/rst_validator.py | CMakePP/CMakeDoc | 0e3fac12662e8f0b512ce8551c65fc13f234f1b9 | [
"Apache-2.0"
] | null | null | null | tests/unit_tests/rst_validator.py | CMakePP/CMakeDoc | 0e3fac12662e8f0b512ce8551c65fc13f234f1b9 | [
"Apache-2.0"
] | 27 | 2019-09-11T19:09:01.000Z | 2020-03-11T01:28:21.000Z | tests/unit_tests/rst_validator.py | CMakePP/CMakeDoc | 0e3fac12662e8f0b512ce8551c65fc13f234f1b9 | [
"Apache-2.0"
] | 1 | 2019-10-04T04:20:59.000Z | 2019-10-04T04:20:59.000Z | #!/usr/bin/python3
# Copyright 2021 CMakePP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.415152 | 141 | 0.648647 |
import docutils.frontend
import docutils.parsers.rst
import docutils.utils
from docutils.nodes import paragraph, section, bullet_list, enumerated_list, table, system_message, doctest_block, \
Admonition, field_list, image, tbody
from cminx.rstwriter import RSTWriter, Paragraph, List, Field, DocTest,... | true | true |
1c1a05947c6afa6521a3fddf747671ec33b75cbb | 1,126 | py | Python | p88_merge_sorted_array.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p88_merge_sorted_array.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p88_merge_sorted_array.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | #!/bin/env python3
# author: Fei Gao
#
# Merge Sorted Array
#
# Given two sorted integer arrays A and B, merge B into A as one sorted array.
# Note:
# You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m ... | 25.022222 | 189 | 0.516874 |
class Solution:
def merge(self, A, m, B, n):
while m > 0 and n > 0:
if A[m-1] > B[n-1]:
A[m+n-1] = A[m-1]
m -= 1
else:
A[m+n-1] = B[n-1]
n -= 1
while n > 0:
A[n-1]... | true | true |
1c1a068a4d94cab20c1c0bb5324cb3ffb440f1d2 | 2,321 | py | Python | graphs/graph.py | avullo/python-practice | 860eb3d523154502e205e4286f994c594d8c72c2 | [
"Apache-2.0"
] | null | null | null | graphs/graph.py | avullo/python-practice | 860eb3d523154502e205e4286f994c594d8c72c2 | [
"Apache-2.0"
] | null | null | null | graphs/graph.py | avullo/python-practice | 860eb3d523154502e205e4286f994c594d8c72c2 | [
"Apache-2.0"
] | null | null | null | """
graph: Graphs for python 2 and 3.
"""
import StringIO
class Graph(object):
"""
Represents a (possibly weighted) undirected graph.
"""
def __init__(self, V, weighted = False):
assert V > 0
# the adjacency matrix
self._adj = [ [ None ] * V for v in range(V) ]
... | 29.0125 | 94 | 0.472641 | """
graph: Graphs for python 2 and 3.
"""
import StringIO
class Graph(object):
"""
Represents a (possibly weighted) undirected graph.
"""
def __init__(self, V, weighted = False):
assert V > 0
self._adj = [ [ None ] * V for v in range(V) ]
self._weighted = we... | false | true |
1c1a074dd612fa58a48c97e33aeaa7a222bb2862 | 9,012 | py | Python | src/rqt_py_trees/dotcode_behaviour.py | alexfneves/rqt_py_trees | 87237c3dcf25db419ad783ec29b9a40fcfa7b75c | [
"BSD-3-Clause"
] | 4 | 2017-05-04T15:54:23.000Z | 2020-04-04T16:04:06.000Z | src/rqt_py_trees/dotcode_behaviour.py | alexfneves/rqt_py_trees | 87237c3dcf25db419ad783ec29b9a40fcfa7b75c | [
"BSD-3-Clause"
] | 7 | 2016-11-25T04:53:29.000Z | 2018-10-07T21:49:10.000Z | src/rqt_py_trees/dotcode_behaviour.py | alexfneves/rqt_py_trees | 87237c3dcf25db419ad783ec29b9a40fcfa7b75c | [
"BSD-3-Clause"
] | 3 | 2021-01-08T10:47:21.000Z | 2021-07-26T15:18:39.000Z | #!/usr/bin/env python
#
# License: BSD
# https://raw.github.com/stonier/rqt_py_trees/license/LICENSE
#
##############################################################################
# Documentation
##############################################################################
"""
.. module:: dotcode_behaviour
:pl... | 39.876106 | 136 | 0.54727 | true | true | |
1c1a082b8fba1fa1acaf0e7c369aeb2818dd34ef | 297 | py | Python | data/LineMod/ply2obj.py | tirilsu/PoseFromShape | d140ff3cf6be13765f2863411157e6f1e884c836 | [
"MIT"
] | 162 | 2019-07-12T07:15:52.000Z | 2022-03-13T01:07:23.000Z | data/LineMod/ply2obj.py | tirilsu/PoseFromShape | d140ff3cf6be13765f2863411157e6f1e884c836 | [
"MIT"
] | 26 | 2019-07-14T12:24:03.000Z | 2022-03-01T11:53:53.000Z | data/LineMod/ply2obj.py | tirilsu/PoseFromShape | d140ff3cf6be13765f2863411157e6f1e884c836 | [
"MIT"
] | 29 | 2019-07-12T07:25:25.000Z | 2021-12-22T05:41:38.000Z | import os
from tqdm import tqdm
ply_dir = "models"
obj_dir = "models"
plys = [name for name in os.listdir(ply_dir) if name.endswith(".ply")]
for ply in tqdm(plys):
os.system("meshlabserver -i %s -o %s" % (os.path.join(ply_dir, ply), os.path.join(obj_dir, ply.replace(".ply", ".obj")[4:])))
| 27 | 129 | 0.6633 | import os
from tqdm import tqdm
ply_dir = "models"
obj_dir = "models"
plys = [name for name in os.listdir(ply_dir) if name.endswith(".ply")]
for ply in tqdm(plys):
os.system("meshlabserver -i %s -o %s" % (os.path.join(ply_dir, ply), os.path.join(obj_dir, ply.replace(".ply", ".obj")[4:])))
| true | true |
1c1a095380f13ab7badd6d457f695288c0d8edac | 2,339 | py | Python | dm_control/render/__init__.py | hzm2016/dm_control | c24ec9f5f3cb3c25c6571c89c9f60bf3350f5711 | [
"Apache-2.0"
] | 2 | 2019-02-14T23:41:45.000Z | 2022-02-10T04:08:44.000Z | dm_control/render/__init__.py | jiajunhua/deepmind-dm_control | c24ec9f5f3cb3c25c6571c89c9f60bf3350f5711 | [
"Apache-2.0"
] | 1 | 2019-03-02T13:37:17.000Z | 2019-03-02T13:37:17.000Z | dm_control/render/__init__.py | svikramank/dm_control | c24ec9f5f3cb3c25c6571c89c9f60bf3350f5711 | [
"Apache-2.0"
] | 1 | 2018-11-20T04:39:05.000Z | 2018-11-20T04:39:05.000Z | # Copyright 2017 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.898551 | 82 | 0.737495 |
import os
DISABLED = bool(os.environ.get('DISABLE_MUJOCO_RENDERING', ''))
del os
DISABLED_MESSAGE = (
'Rendering support has been disabled by the `DISABLE_MUJOCO_RENDERING` '
'environment variable')
_GLFWRenderer = None
_EGLRenderer = None
_OSMesaRenderer = None
if not DISABLED:
try:
... | true | true |
1c1a0a5734cb6fa846b030a840db4914546c256a | 2,997 | py | Python | core/polyaxon/polypod/compiler/converter.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | 3,200 | 2017-05-09T11:35:31.000Z | 2022-03-28T05:43:22.000Z | core/polyaxon/polypod/compiler/converter.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | 1,324 | 2017-06-29T07:21:27.000Z | 2022-03-27T12:41:10.000Z | core/polyaxon/polypod/compiler/converter.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | 341 | 2017-01-10T23:06:53.000Z | 2022-03-10T08:15:18.000Z | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 35.258824 | 98 | 0.711712 |
from typing import Any, Dict, Iterable, Optional
from kubernetes import client as k8s_client
from polyaxon.auxiliaries import V1PolyaxonInitContainer, V1PolyaxonSidecarContainer
from polyaxon.exceptions import PolyaxonCompilerError
from polyaxon.polyflow import V1CompiledOperation
from polyaxon.polypo... | true | true |
1c1a0aae2df12cdcfa0bfee3f30fe891f8062cdf | 517 | py | Python | bqskit/ir/lang/__init__.py | jkalloor3/bqskit | ad34a6eae3c0e62d2bd960cd4cd841ba8e845811 | [
"BSD-3-Clause-LBNL"
] | 13 | 2021-05-26T21:32:26.000Z | 2022-03-15T17:48:10.000Z | bqskit/ir/lang/__init__.py | jkalloor3/bqskit | ad34a6eae3c0e62d2bd960cd4cd841ba8e845811 | [
"BSD-3-Clause-LBNL"
] | 20 | 2021-05-26T20:17:15.000Z | 2022-02-27T20:04:10.000Z | bqskit/ir/lang/__init__.py | jkalloor3/bqskit | ad34a6eae3c0e62d2bd960cd4cd841ba8e845811 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-10-05T16:00:47.000Z | 2021-10-08T01:30:06.000Z | """This package implements language reading and writing features."""
from __future__ import annotations
from bqskit.ir.lang.language import Language
__all__ = ['Language']
_language_dict: dict[str, Language] = {}
def register_language(extension: str, language: Language) -> None:
_language_dict[extension] = lan... | 25.85 | 68 | 0.752418 | from __future__ import annotations
from bqskit.ir.lang.language import Language
__all__ = ['Language']
_language_dict: dict[str, Language] = {}
def register_language(extension: str, language: Language) -> None:
_language_dict[extension] = language
def get_language(extension: str) -> Language:
if extensio... | true | true |
1c1a0ac01f5c16ee81165fc6b3f78fb66d111a5f | 102,723 | py | Python | Lib/test/test_asyncio/test_tasks.py | roy2220/cpython | 3a5b0d8988491d9408b22bceea6fd70b91345724 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_asyncio/test_tasks.py | roy2220/cpython | 3a5b0d8988491d9408b22bceea6fd70b91345724 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_asyncio/test_tasks.py | roy2220/cpython | 3a5b0d8988491d9408b22bceea6fd70b91345724 | [
"PSF-2.0"
] | null | null | null | """Tests for tasks.py."""
import collections
import contextlib
import contextvars
import functools
import gc
import io
import random
import re
import sys
import textwrap
import types
import unittest
import weakref
from unittest import mock
import asyncio
from asyncio import coroutines
from asyncio import futures
from... | 31.724212 | 105 | 0.588661 |
import collections
import contextlib
import contextvars
import functools
import gc
import io
import random
import re
import sys
import textwrap
import types
import unittest
import weakref
from unittest import mock
import asyncio
from asyncio import coroutines
from asyncio import futures
from asyncio import tasks
from... | true | true |
1c1a0b4ccb4d0a55222f427189625b125ffbc522 | 4,932 | py | Python | uwstyle/__init__.py | TakamiChie/UWStyleMethods | 7635852ff902988843dbf17ddc29ea5f8350e6bf | [
"MIT"
] | 2 | 2019-01-24T00:13:46.000Z | 2020-09-30T22:59:32.000Z | uwstyle/__init__.py | TakamiChie/UWStyleMethods | 7635852ff902988843dbf17ddc29ea5f8350e6bf | [
"MIT"
] | 5 | 2019-01-27T17:47:55.000Z | 2019-02-05T01:58:17.000Z | uwstyle/__init__.py | TakamiChie/UWStyleMethods | 7635852ff902988843dbf17ddc29ea5f8350e6bf | [
"MIT"
] | null | null | null | if __name__ == "__main__":
import sys
import pathlib
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent))
from uwstyle.dialogs.dialogs import Dialogs
from uwstyle.dialogs.slctbox import Combobox, Choose
import uwstyle.overridestd
from uwstyle.overridestd.writer import OverrideManager
VERSION = "0.0.6"
... | 24.66 | 101 | 0.664234 | if __name__ == "__main__":
import sys
import pathlib
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent))
from uwstyle.dialogs.dialogs import Dialogs
from uwstyle.dialogs.slctbox import Combobox, Choose
import uwstyle.overridestd
from uwstyle.overridestd.writer import OverrideManager
VERSION = "0.0.6"
... | true | true |
1c1a0bbfd2f910e123fcbfc481430536413a3261 | 4,893 | py | Python | eval_exploits.py | kevinkoo001/ropf | 6a41d87b74add2632205702a35753b9288723bb0 | [
"BSD-3-Clause"
] | 21 | 2016-05-31T06:37:13.000Z | 2021-10-05T12:19:12.000Z | eval_exploits.py | kevinkoo001/ropf | 6a41d87b74add2632205702a35753b9288723bb0 | [
"BSD-3-Clause"
] | 3 | 2016-05-31T17:26:03.000Z | 2021-01-05T15:19:45.000Z | eval_exploits.py | kevinkoo001/ropf | 6a41d87b74add2632205702a35753b9288723bb0 | [
"BSD-3-Clause"
] | 8 | 2016-05-31T10:20:40.000Z | 2018-06-16T02:43:10.000Z | __author__ = 'Hyungjoon Koo'
import os
import pickle
import subprocess
from bz2 import BZ2File
import util
STAT_DIR = './stats/'
MOVED = '_stats_gads_movings.bz2'
'''
Exploit Samples with Metasploit and Evaluation
(mplayer - avformat.dll) 66% (2/3 Broken)
(mplayer - avcodec.dll) Error in gadget generat... | 52.053191 | 237 | 0.640507 | __author__ = 'Hyungjoon Koo'
import os
import pickle
import subprocess
from bz2 import BZ2File
import util
STAT_DIR = './stats/'
MOVED = '_stats_gads_movings.bz2'
'''
Exploit Samples with Metasploit and Evaluation
(mplayer - avformat.dll) 66% (2/3 Broken)
(mplayer - avcodec.dll) Error in gadget generat... | false | true |
1c1a0cad496254675e4761579664d4cc31e2bb48 | 130,602 | py | Python | python/pyspark/sql/tests.py | l532857663/spark | 481f0792944d9a77f0fe8b5e2596da1d600b9d0a | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 5 | 2017-07-29T03:52:05.000Z | 2019-10-15T12:52:21.000Z | python/pyspark/sql/tests.py | l532857663/spark | 481f0792944d9a77f0fe8b5e2596da1d600b9d0a | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | null | null | null | python/pyspark/sql/tests.py | l532857663/spark | 481f0792944d9a77f0fe8b5e2596da1d600b9d0a | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 2 | 2019-06-29T14:05:24.000Z | 2020-12-09T03:04:34.000Z | # -*- encoding: utf-8 -*-
#
# 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 ... | 42.55523 | 100 | 0.59372 |
import os
import sys
import subprocess
import pydoc
import shutil
import tempfile
import pickle
import functools
import time
import datetime
import array
import ctypes
import py4j
try:
import xmlrunner
except ImportError:
xmlrunner = None
if sys.version_info[:2] <= (2, 6):
try:
i... | true | true |
1c1a0d591b87f2862c6ec8e073f3f8dba263d24b | 189 | py | Python | pyext/example.py | CrackerCat/xed | 428712c28e831573579b7f749db63d3a58dcdbd9 | [
"Apache-2.0"
] | 1,261 | 2016-12-16T14:29:30.000Z | 2022-03-30T20:21:25.000Z | pyext/example.py | CrackerCat/xed | 428712c28e831573579b7f749db63d3a58dcdbd9 | [
"Apache-2.0"
] | 190 | 2016-12-17T13:44:09.000Z | 2022-03-27T09:28:13.000Z | pyext/example.py | CrackerCat/xed | 428712c28e831573579b7f749db63d3a58dcdbd9 | [
"Apache-2.0"
] | 155 | 2016-12-16T22:17:20.000Z | 2022-02-16T20:53:59.000Z | import xed
print(xed.dis32([0,0]))
print(xed.dis64([0x48,0,0]))
print(xed.dis32([0x67, 0x8b, 0x46, 0xff]))
print(xed.dis32([0x75, 0x10]))
print(xed.dis64([0x75, 0x10], 0xaaaabbbffff0000))
| 23.625 | 49 | 0.693122 | import xed
print(xed.dis32([0,0]))
print(xed.dis64([0x48,0,0]))
print(xed.dis32([0x67, 0x8b, 0x46, 0xff]))
print(xed.dis32([0x75, 0x10]))
print(xed.dis64([0x75, 0x10], 0xaaaabbbffff0000))
| true | true |
1c1a0d6abdb4b2907f058499ab1f553e05432af6 | 2,766 | py | Python | adventure_game/rooms/room3.py | ReidLuhn/maze_game | 191e20761716e8897d45652c044cdbe5670c506d | [
"MIT"
] | null | null | null | adventure_game/rooms/room3.py | ReidLuhn/maze_game | 191e20761716e8897d45652c044cdbe5670c506d | [
"MIT"
] | null | null | null | adventure_game/rooms/room3.py | ReidLuhn/maze_game | 191e20761716e8897d45652c044cdbe5670c506d | [
"MIT"
] | null | null | null | import adventure_game.my_utils as utils
# # # # #
# ROOM 3
#
# Serves as a good template for blank rooms
room3_inventory = {
'sword': 1,
'clue': 1
}
def run_room(player_inventory):
# Let the user know what the room looks like
# valid commands for this room
room3_description = '''... | 35.922078 | 112 | 0.574114 | import adventure_game.my_utils as utils
ory = {
'sword': 1,
'clue': 1
}
def run_room(player_inventory):
room3_description = '''
. . . 3rd room ...
You are in a room that feels very familiar. There is a door to the north.
'''
if room3_inventory['sword']... | true | true |
1c1a0f29868256c477304da462204652dfacf43d | 1,996 | py | Python | 1_shinno/chapter4_iris3.py | yfur/dl-chainer | c1917710c80fd6b3dc4cded81700b92bbc349302 | [
"Apache-2.0"
] | null | null | null | 1_shinno/chapter4_iris3.py | yfur/dl-chainer | c1917710c80fd6b3dc4cded81700b92bbc349302 | [
"Apache-2.0"
] | null | null | null | 1_shinno/chapter4_iris3.py | yfur/dl-chainer | c1917710c80fd6b3dc4cded81700b92bbc349302 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, Variable
from chainer import optimizers, serializers, utils
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from sklearn import datasets
import time
''' 1. Data preparation and setti... | 25.265823 | 78 | 0.621242 | import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, Variable
from chainer import optimizers, serializers, utils
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from sklearn import datasets
import time
iris = datasets.load_iris()
X = ... | true | true |
1c1a0fceaa38baeba67bed2d373c20aad88ef46e | 19 | py | Python | python/hmtl/tests/__init__.py | aphelps/HMTL | 9d0fbb217e2d56e51d47c9ed7af04894cb9ddc5f | [
"MIT"
] | 1 | 2016-10-17T18:01:46.000Z | 2016-10-17T18:01:46.000Z | python/hmtl/tests/__init__.py | HMTL/HMTL | b8b75ba7c268e6a2f386e55d6c6463d3f62ebcb4 | [
"MIT"
] | null | null | null | python/hmtl/tests/__init__.py | HMTL/HMTL | b8b75ba7c268e6a2f386e55d6c6463d3f62ebcb4 | [
"MIT"
] | null | null | null | __author__ = 'amp'
| 9.5 | 18 | 0.684211 | __author__ = 'amp'
| true | true |
1c1a10cfb71bf4bb404437f4512e124fe937d24b | 6,008 | py | Python | source/result_analysis/result_analysis/overall_drawpic.py | RunsStudio/CAV-exclusive-lane-by-VISSIM | a06844384c37468582e8d23463bd7c37d68b7533 | [
"MIT"
] | 3 | 2021-08-10T07:39:31.000Z | 2021-12-20T07:52:22.000Z | source/result_analysis/result_analysis/overall_drawpic.py | RunsStudio/CAV-exclusive-lane-by-VISSIM | a06844384c37468582e8d23463bd7c37d68b7533 | [
"MIT"
] | null | null | null | source/result_analysis/result_analysis/overall_drawpic.py | RunsStudio/CAV-exclusive-lane-by-VISSIM | a06844384c37468582e8d23463bd7c37d68b7533 | [
"MIT"
] | 1 | 2022-02-24T07:53:11.000Z | 2022-02-24T07:53:11.000Z | import numpy as np
from matplotlib import rcParams
import pandas as pd
import matplotlib.pyplot as plt
def ANOVA_cal_by_stat(data_value):
da = pd.DataFrame(data_value)
da.columns.name = '场景'
df1 = da.melt().dropna()
from statsmodels.formula.api import ols
from statsmodels.stats.anova import anova... | 42.309859 | 149 | 0.667111 | import numpy as np
from matplotlib import rcParams
import pandas as pd
import matplotlib.pyplot as plt
def ANOVA_cal_by_stat(data_value):
da = pd.DataFrame(data_value)
da.columns.name = '场景'
df1 = da.melt().dropna()
from statsmodels.formula.api import ols
from statsmodels.stats.anova import anova... | true | true |
1c1a11c09fa77ef9db28dee37d93b5fb55af5652 | 8,230 | py | Python | models/volume3d/main/train_validate.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | 7 | 2020-08-04T19:27:33.000Z | 2022-01-28T18:00:21.000Z | models/volume3d/main/train_validate.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | null | null | null | models/volume3d/main/train_validate.py | amiralansary/BrainSurfaceTK | 17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef | [
"MIT"
] | 3 | 2020-12-31T17:26:21.000Z | 2021-02-11T19:24:56.000Z | import os
import SimpleITK as sitk
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import torch.nn.functional as F
from sklearn.model_selection import train_test_split
from torch import nn
from torch.nn import Module, Conv3d, ConvTranspose3d, Linear, ReLU, Seque... | 33.591837 | 155 | 0.627096 | import os
import SimpleITK as sitk
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import torch.nn.functional as F
from sklearn.model_selection import train_test_split
from torch import nn
from torch.nn import Module, Conv3d, ConvTranspose3d, Linear, ReLU, Seque... | true | true |
1c1a126826946a3f38c438a6aa0f8534ba9ebab4 | 822 | py | Python | leetcode/python/Q0295_Find_Median_from_Data_Stream.py | lisuizhe/algorithm | 4ae6c774ed202703a9a760eca7ff8b140feb535f | [
"Apache-2.0"
] | 2 | 2019-03-03T04:03:49.000Z | 2019-06-26T02:43:49.000Z | leetcode/python/Q0295_Find_Median_from_Data_Stream.py | lisuizhe/algorithm | 4ae6c774ed202703a9a760eca7ff8b140feb535f | [
"Apache-2.0"
] | null | null | null | leetcode/python/Q0295_Find_Median_from_Data_Stream.py | lisuizhe/algorithm | 4ae6c774ed202703a9a760eca7ff8b140feb535f | [
"Apache-2.0"
] | null | null | null | from heapq import *
class MedianFinder(object):
def __init__(self):
"""
initialize your data structure here.
"""
self.small = []
self.large = []
def addNum(self, num):
"""
:type num: int
:rtype: void
"""
heappush(self.small, -hea... | 24.176471 | 67 | 0.534063 | from heapq import *
class MedianFinder(object):
def __init__(self):
self.small = []
self.large = []
def addNum(self, num):
heappush(self.small, -heappushpop(self.large, num))
if len(self.large) < len(self.small):
heappush(self.large, -heappop(self.small))
... | true | true |
1c1a12a83c9dfa23ae1c931c3bb59a89387bb0cc | 4,373 | py | Python | pytorch/torch/random.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/random.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/random.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | import contextlib
import warnings
from torch._C import default_generator
import torch
def set_rng_state(new_state) -> None:
r"""Sets the random number generator state.
Args:
new_state (torch.ByteTensor): The desired state
"""
default_generator.set_state(new_state)
def get_rng_state() -> to... | 35.552846 | 103 | 0.664304 | import contextlib
import warnings
from torch._C import default_generator
import torch
def set_rng_state(new_state) -> None:
default_generator.set_state(new_state)
def get_rng_state() -> torch.Tensor:
return default_generator.get_state()
def manual_seed(seed) -> torch._C.Generator:
seed = int(seed)
... | true | true |
1c1a12bb80ad4618a0d447be3d24446367638f62 | 3,237 | py | Python | model.py | SRatna/Behavioral-Cloning-CNN | 5da816d43a5a631f74d6740dd6fcc8a2fb221a9a | [
"MIT"
] | null | null | null | model.py | SRatna/Behavioral-Cloning-CNN | 5da816d43a5a631f74d6740dd6fcc8a2fb221a9a | [
"MIT"
] | null | null | null | model.py | SRatna/Behavioral-Cloning-CNN | 5da816d43a5a631f74d6740dd6fcc8a2fb221a9a | [
"MIT"
] | null | null | null | import os
import csv
import cv2
import numpy as np
from math import ceil
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout
from keras.layers.convolutional import Conv2D
from keras.l... | 36.370787 | 87 | 0.676552 | import os
import csv
import cv2
import numpy as np
from math import ceil
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout
from keras.layers.convolutional import Conv2D
from keras.l... | true | true |
1c1a12d82cd334f7a1b2f8818701257c9509af0c | 3,739 | py | Python | core/model/meta/anil.py | RuiBai1999/myrepo | 1cf51db063b922ef58ff11da998c3f12f643420d | [
"MIT"
] | 471 | 2021-09-13T11:28:34.000Z | 2022-03-30T07:26:54.000Z | core/model/meta/anil.py | liuwenqi528/LibFewShot | ea8d618995a51079c79a6291af2ca02b01b846ea | [
"MIT"
] | 24 | 2021-09-22T02:34:05.000Z | 2022-02-19T07:26:39.000Z | core/model/meta/anil.py | liuwenqi528/LibFewShot | ea8d618995a51079c79a6291af2ca02b01b846ea | [
"MIT"
] | 82 | 2021-09-16T12:48:01.000Z | 2022-03-28T06:57:47.000Z | # -*- coding: utf-8 -*-
"""
@inproceedings{DBLP:conf/iclr/RaghuRBV20,
author = {Aniruddh Raghu and
Maithra Raghu and
Samy Bengio and
Oriol Vinyals},
title = {Rapid Learning or Feature Reuse? Towards Understanding the Effectiveness
of {MAML}},
book... | 35.609524 | 100 | 0.63279 |
import torch
from torch import nn
from core.utils import accuracy
from .meta_model import MetaModel
from ..backbone.utils import convert_maml_module
class ANILLayer(nn.Module):
def __init__(self, feat_dim, hid_dim, way_num):
super(ANILLayer, self).__init__()
self.layers = nn.Sequential(
... | true | true |
1c1a136b050bff67ffc3e94d3149664afa6894f6 | 3,997 | py | Python | alipay/aop/api/request/AlipayCommerceIotDevicelistCreateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayCommerceIotDevicelistCreateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayCommerceIotDevicelistCreateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceIotDevicelistCreateModel import AlipayCommerceIotDevicelistCreateModel
class AlipayCommerceIotDevicelistCreateRequest(... | 27.565517 | 148 | 0.646985 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceIotDevicelistCreateModel import AlipayCommerceIotDevicelistCreateModel
class AlipayCommerceIotDevicelistCreateRequest(object):
def __init__(self, biz_model=N... | true | true |
1c1a13e6cae78708f9b640e6acae4c7f72969de3 | 2,898 | py | Python | test/functional/mempool_resurrect.py | AYCHPay/AYCHPayGenesisRoot | a4a1094a13accebaef2c1207082d1c3c76a45130 | [
"MIT"
] | 7 | 2018-09-13T03:38:20.000Z | 2019-05-26T13:19:53.000Z | test/functional/mempool_resurrect.py | AYCHPay/AYCHPayGenesisRoot | a4a1094a13accebaef2c1207082d1c3c76a45130 | [
"MIT"
] | 2 | 2019-04-28T22:38:06.000Z | 2019-05-09T23:31:35.000Z | test/functional/mempool_resurrect.py | AYCHPay/AYCHPayGenesisRoot | a4a1094a13accebaef2c1207082d1c3c76a45130 | [
"MIT"
] | 12 | 2018-09-18T22:57:03.000Z | 2020-02-13T09:19:42.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the blockchain is re-organized."""
from test_framework.te... | 42 | 105 | 0.659765 |
from test_framework.test_framework import GenesisTestFramework
from test_framework.util import *
class MempoolCoinbaseTest(GenesisTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.extra_args = [["-checkmempool"]]
def run_test(self):
node0_address = self.nodes[0].... | true | true |
1c1a154182dab7b187edcb5e086d283f03f35527 | 85 | py | Python | reproschema/models/__init__.py | sanuann/reproschema-py | ece78068b185018ec3d7f56ef9498e6e366d1e70 | [
"Apache-2.0"
] | 3 | 2020-06-22T06:58:46.000Z | 2021-04-19T03:59:47.000Z | reproschema/models/__init__.py | sanuann/reproschema-py | ece78068b185018ec3d7f56ef9498e6e366d1e70 | [
"Apache-2.0"
] | 10 | 2020-07-02T08:56:21.000Z | 2021-08-03T15:38:25.000Z | reproschema/models/__init__.py | Remi-Gau/reproschema-py | 9597b24d0a63210508911d152f1e94175138c32e | [
"Apache-2.0"
] | 3 | 2020-06-21T19:28:40.000Z | 2020-07-03T06:53:08.000Z | from .protocol import Protocol
from .activity import Activity
from .item import Item
| 21.25 | 30 | 0.823529 | from .protocol import Protocol
from .activity import Activity
from .item import Item
| true | true |
1c1a169a4c2164702bbc805f6382c8d789b7662b | 552 | py | Python | examples/advanced/cutWithMesh1.py | mikami520/vedo | 1a3abcf3f1e495287e8934d9b5bb07b511ab8be5 | [
"MIT"
] | 1 | 2022-03-22T21:49:29.000Z | 2022-03-22T21:49:29.000Z | examples/advanced/cutWithMesh1.py | mikami520/vedo | 1a3abcf3f1e495287e8934d9b5bb07b511ab8be5 | [
"MIT"
] | null | null | null | examples/advanced/cutWithMesh1.py | mikami520/vedo | 1a3abcf3f1e495287e8934d9b5bb07b511ab8be5 | [
"MIT"
] | null | null | null | """Cut a mesh with another mesh"""
from vedo import dataurl, settings, Plotter, Volume, Ellipsoid
settings.tiffOrientationType = 4 # data origin is bottom-left
embryo = Volume(dataurl+"embryo.tif").isosurface(30).normalize()
# mesh used to cut:
msh = Ellipsoid().scale(0.4).pos(2.8, 1.5, 1.5).wireframe()
# make a wo... | 30.666667 | 64 | 0.711957 | from vedo import dataurl, settings, Plotter, Volume, Ellipsoid
settings.tiffOrientationType = 4
embryo = Volume(dataurl+"embryo.tif").isosurface(30).normalize()
msh = Ellipsoid().scale(0.4).pos(2.8, 1.5, 1.5).wireframe()
cutembryo = embryo.clone().cutWithMesh(msh).c("gold").bc("t")
plt = Plotter(N=2, axes=1)
pl... | true | true |
1c1a1743c09a934ec847232a74dfbd42e1f4ddab | 13,461 | py | Python | test/functional/feature_dbcrash.py | hiphopcoin24/hiphopcoin24 | 09b780546ba9e28b452a8641863aafa90def40d1 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | hiphopcoin24/hiphopcoin24 | 09b780546ba9e28b452a8641863aafa90def40d1 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | hiphopcoin24/hiphopcoin24 | 09b780546ba9e28b452a8641863aafa90def40d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Hiphopcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
- 4 nodes
* node0, node1, and node2 will ha... | 46.257732 | 116 | 0.638883 |
import errno
import http.client
import random
import time
from test_framework.messages import (
COIN,
COutPoint,
CTransaction,
CTxIn,
CTxOut,
ToHex,
)
from test_framework.test_framework import HiphopcoinTestFramework
from test_framework.util import (
assert_equal,
create_confirmed_... | true | true |
1c1a18d017d72804e65e22934f2359d5a81dbb92 | 2,350 | py | Python | test/layers/convolutions/conv2d.py | chrisunice/onnx2keras-custom | c37fe43fe5dce274a5a351d3c328cf61daa5f364 | [
"MIT"
] | null | null | null | test/layers/convolutions/conv2d.py | chrisunice/onnx2keras-custom | c37fe43fe5dce274a5a351d3c328cf61daa5f364 | [
"MIT"
] | null | null | null | test/layers/convolutions/conv2d.py | chrisunice/onnx2keras-custom | c37fe43fe5dce274a5a351d3c328cf61daa5f364 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from onnx2keras_custom import onnx_to_keras, check_torch_keras_error
import onnx
class LayerTest(nn.Module):
def __init__(self, inp, out, kernel_size=3, padding=1, stride=1, bias=False, dilation=1, groups=1):
super(L... | 41.964286 | 149 | 0.505532 | import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from onnx2keras_custom import onnx_to_keras, check_torch_keras_error
import onnx
class LayerTest(nn.Module):
def __init__(self, inp, out, kernel_size=3, padding=1, stride=1, bias=False, dilation=1, groups=1):
super(L... | true | true |
1c1a18d11c0f0bf12e779918952e52e1e4731bd4 | 826 | py | Python | tap_zendesk_sell/streams/text_messages.py | leag/tap-zendesk_sell | fc9a4db8f58560d3b349a344f89035cf56790c80 | [
"Apache-2.0"
] | 1 | 2022-01-26T20:20:33.000Z | 2022-01-26T20:20:33.000Z | tap_zendesk_sell/streams/text_messages.py | leag/tap-zendesk-sell | 6c13ba4f2b43a55a0a039d90343b593d34ba4926 | [
"Apache-2.0"
] | 2 | 2022-01-25T22:55:15.000Z | 2022-01-26T00:55:50.000Z | tap_zendesk_sell/streams/text_messages.py | leag/tap-zendesk_sell | fc9a4db8f58560d3b349a344f89035cf56790c80 | [
"Apache-2.0"
] | null | null | null | """Zendesk Sell text messages stream class."""
from typing import Iterable, Optional
from tap_zendesk_sell.client import ZendeskSellStream
from tap_zendesk_sell.streams import SCHEMAS_DIR
class TextMessagesStream(ZendeskSellStream):
"""Zendesk Sell text messages stream class."""
name = "text_messages"
p... | 30.592593 | 86 | 0.6477 | from typing import Iterable, Optional
from tap_zendesk_sell.client import ZendeskSellStream
from tap_zendesk_sell.streams import SCHEMAS_DIR
class TextMessagesStream(ZendeskSellStream):
name = "text_messages"
primary_keys = ["id"]
def get_records(self, context: Optional[dict]) -> Iterable[dict]:
... | true | true |
1c1a1a1b1f01ed8ffbf933161ec1f41f731c30c1 | 3,764 | py | Python | Pedersen_N07/compare_cases.py | gantech/wind-energy | e9b14dcbf41f9c74bad9dc8593cc683071d6c6ea | [
"BSD-3-Clause"
] | 2 | 2020-07-01T16:06:10.000Z | 2021-12-16T22:49:33.000Z | Pedersen_N07/compare_cases.py | gantech/wind-energy | e9b14dcbf41f9c74bad9dc8593cc683071d6c6ea | [
"BSD-3-Clause"
] | 4 | 2020-07-01T18:01:16.000Z | 2020-08-03T22:22:38.000Z | Pedersen_N07/compare_cases.py | gantech/wind-energy | e9b14dcbf41f9c74bad9dc8593cc683071d6c6ea | [
"BSD-3-Clause"
] | 6 | 2020-07-01T15:53:44.000Z | 2021-06-22T01:39:13.000Z | # coding: utf-8
import load_data, sys
sys.path.insert(1, '../utilities')
import windspectra
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
l_cases = {
'amrwind-ksgs': load_data.AMRWindStats('AmrWindKsgs'),
'naluwind-smag': load_data.NaluWindStats('NaluWindRun01'),
'nal... | 38.020202 | 119 | 0.577843 |
import load_data, sys
sys.path.insert(1, '../utilities')
import windspectra
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
l_cases = {
'amrwind-ksgs': load_data.AMRWindStats('AmrWindKsgs'),
'naluwind-smag': load_data.NaluWindStats('NaluWindRun01'),
'naluwind-ksgs': lo... | true | true |
1c1a1c348cacda0e922aa9fe92bf8a0a5684c838 | 3,114 | py | Python | examples/app/weather/main.py | Suicoleiro/bokeh | a212acdf091a7a4df639fa9d443be6ade0018039 | [
"BSD-3-Clause"
] | 15,193 | 2015-01-01T05:11:45.000Z | 2022-03-31T19:30:20.000Z | examples/app/weather/main.py | Suicoleiro/bokeh | a212acdf091a7a4df639fa9d443be6ade0018039 | [
"BSD-3-Clause"
] | 9,554 | 2015-01-01T03:16:54.000Z | 2022-03-31T22:59:39.000Z | examples/app/weather/main.py | Suicoleiro/bokeh | a212acdf091a7a4df639fa9d443be6ade0018039 | [
"BSD-3-Clause"
] | 4,829 | 2015-01-02T03:35:32.000Z | 2022-03-30T16:40:26.000Z | import datetime
from os.path import dirname, join
import pandas as pd
from scipy.signal import savgol_filter
from bokeh.io import curdoc
from bokeh.layouts import column, row
from bokeh.models import ColumnDataSource, DataRange1d, Select
from bokeh.palettes import Blues4
from bokeh.plotting import figure
STATISTICS ... | 34.6 | 129 | 0.683365 | import datetime
from os.path import dirname, join
import pandas as pd
from scipy.signal import savgol_filter
from bokeh.io import curdoc
from bokeh.layouts import column, row
from bokeh.models import ColumnDataSource, DataRange1d, Select
from bokeh.palettes import Blues4
from bokeh.plotting import figure
STATISTICS ... | true | true |
1c1a1d984eba2e1a7c30ac3040fb45bb108b9028 | 44 | py | Python | primelib/__init__.py | bhayati/primelib | d4d3de8e4a2be0642825f2fc533b961894e05ea2 | [
"MIT"
] | null | null | null | primelib/__init__.py | bhayati/primelib | d4d3de8e4a2be0642825f2fc533b961894e05ea2 | [
"MIT"
] | null | null | null | primelib/__init__.py | bhayati/primelib | d4d3de8e4a2be0642825f2fc533b961894e05ea2 | [
"MIT"
] | null | null | null | from primelib.prime_numbers import is_prime
| 22 | 43 | 0.886364 | from primelib.prime_numbers import is_prime
| true | true |
1c1a1da78fadb44117eeb84dc32132bc08b0b55d | 1,367 | py | Python | TrekBot2_WS/build/grid_map_core/catkin_generated/generate_cached_setup.py | Rafcin/RescueRoboticsLHMV | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | 1 | 2018-10-04T14:37:00.000Z | 2018-10-04T14:37:00.000Z | TrekBot2_WS/build/grid_map_core/catkin_generated/generate_cached_setup.py | Rafcin/TrekBot | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | null | null | null | TrekBot2_WS/build/grid_map_core/catkin_generated/generate_cached_setup.py | Rafcin/TrekBot | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | 44.096774 | 105 | 0.745428 |
from __future__ import print_function
import argparse
import os
import stat
import sys
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.join('/opt/ros/melodic/share/catkin/cmake', '..', 'python'))
try:
from catkin.environment_cache im... | true | true |
1c1a1e5c10465e7303b1712e6e39c355551f9bf5 | 11,880 | py | Python | main_multi_supcon.py | XG293/SupConLoss | 04d069a6d5bc37ac4df80c94327bc6f7da891589 | [
"BSD-2-Clause"
] | null | null | null | main_multi_supcon.py | XG293/SupConLoss | 04d069a6d5bc37ac4df80c94327bc6f7da891589 | [
"BSD-2-Clause"
] | null | null | null | main_multi_supcon.py | XG293/SupConLoss | 04d069a6d5bc37ac4df80c94327bc6f7da891589 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function
import os
import sys
import argparse
import time
import math
import tensorboard_logger as tb_logger
import torch
import torch.backends.cudnn as cudnn
from torchvision import transforms, datasets
from util import TwoCropTransform, AverageMeter
from util import adjust_learning_rat... | 37.955272 | 201 | 0.621044 | from __future__ import print_function
import os
import sys
import argparse
import time
import math
import tensorboard_logger as tb_logger
import torch
import torch.backends.cudnn as cudnn
from torchvision import transforms, datasets
from util import TwoCropTransform, AverageMeter
from util import adjust_learning_rat... | true | true |
1c1a1ec383fc6dfceb17c8e1f961bca2646dca6f | 3,612 | py | Python | api_modules/server/pipeline/syncup_data.py | learnerzhang/trade | 762ae0eb52562c86da11876b8a3c2660b19b0f7d | [
"Apache-2.0"
] | 6 | 2020-08-21T02:41:40.000Z | 2021-09-17T06:05:16.000Z | api_modules/server/pipeline/syncup_data.py | learnerzhang/trade | 762ae0eb52562c86da11876b8a3c2660b19b0f7d | [
"Apache-2.0"
] | null | null | null | api_modules/server/pipeline/syncup_data.py | learnerzhang/trade | 762ae0eb52562c86da11876b8a3c2660b19b0f7d | [
"Apache-2.0"
] | null | null | null | # -*- encoding: UTF-8 -*-
from api_modules.server.utils import stock_utils
from api_modules.server.utils.config import ConfigUtils
from multiprocessing import Pool
import baostock as bs
import pandas as pd
import logging
import os
logging.basicConfig(format='%(asctime)s %(message)s', filename='sequoia.log')
logging.ge... | 31.964602 | 116 | 0.633721 |
from api_modules.server.utils import stock_utils
from api_modules.server.utils.config import ConfigUtils
from multiprocessing import Pool
import baostock as bs
import pandas as pd
import logging
import os
logging.basicConfig(format='%(asctime)s %(message)s', filename='sequoia.log')
logging.getLogger().setLevel(loggin... | true | true |
1c1a1f6600781e1e0479cbb7e9c92f96bad8d28a | 2,377 | py | Python | flipdigit/flipdigit.py | lucblender/FlipDigitPython | 93ad20e1cec2f45a93b53a4e60b40e4d02960d2e | [
"X11"
] | 1 | 2021-05-05T11:24:48.000Z | 2021-05-05T11:24:48.000Z | flipdigit/flipdigit.py | lucblender/FlipDigitPython | 93ad20e1cec2f45a93b53a4e60b40e4d02960d2e | [
"X11"
] | null | null | null | flipdigit/flipdigit.py | lucblender/FlipDigitPython | 93ad20e1cec2f45a93b53a4e60b40e4d02960d2e | [
"X11"
] | null | null | null | import serial
import array
from time import sleep
from enum import Enum
number_segments = [0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F]
serial_speed_int = [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200]
class SerialSpeed(Enum):
S_1200 = 0x00
S_2400 = 0x01
S_4800 = 0x02... | 28.987805 | 96 | 0.566681 | import serial
import array
from time import sleep
from enum import Enum
number_segments = [0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F]
serial_speed_int = [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200]
class SerialSpeed(Enum):
S_1200 = 0x00
S_2400 = 0x01
S_4800 = 0x02... | true | true |
1c1a1fe990dc9b820a1005b970cbcfec31529d4a | 1,867 | py | Python | class_exercises/lists.py | klp/cuny_gc_python_class_sp2022 | 5614d5a1c790bac211f1221b7c727b59e9e05ca1 | [
"BSD-2-Clause"
] | null | null | null | class_exercises/lists.py | klp/cuny_gc_python_class_sp2022 | 5614d5a1c790bac211f1221b7c727b59e9e05ca1 | [
"BSD-2-Clause"
] | null | null | null | class_exercises/lists.py | klp/cuny_gc_python_class_sp2022 | 5614d5a1c790bac211f1221b7c727b59e9e05ca1 | [
"BSD-2-Clause"
] | null | null | null | # Lists
# Collections used to store multiple items in a single variable. They are
# ordered, changable, and allows duplicates
from itertools import count
my_list = [0, 1, "2", 3, "4", 5, 6]
print(len(my_list))
# List indexing
print(my_list[0]) # first element
print(my_list[4]) # fifth element
print(my_list[-1]... | 23.632911 | 80 | 0.722014 |
from itertools import count
my_list = [0, 1, "2", 3, "4", 5, 6]
print(len(my_list))
print(my_list[0])
print(my_list[4])
print(my_list[-1])
print(my_list[-3])
print(my_list[0:3])
print(my_list[:3])
print(my_list[4:7])
print(my_list[4:])
print(my_list[2:5])
my_list[2] = 2
my_list[4] = 4
print(my_... | true | true |
1c1a21f7f4a8edfe05af63ace3302e89bacddc98 | 5,936 | py | Python | paroxython/cli_recommend.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 31 | 2020-05-02T13:34:26.000Z | 2021-06-06T17:25:52.000Z | paroxython/cli_recommend.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 108 | 2019-11-18T19:41:52.000Z | 2022-03-18T13:58:17.000Z | paroxython/cli_recommend.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 4 | 2020-05-19T08:57:44.000Z | 2020-09-21T08:53:46.000Z | r"""
Read and execute a pipeline of commands and report the learning costs.
USAGE:
```
paroxython recommend [options] DB_PATH
```
DESCRIPTION:
```plain
Requires an existing database previously generated by the command:
paroxython collect DIRECTORY
... and a pipeline of commands descr... | 42.4 | 87 | 0.612702 |
import json
import sys
from pathlib import Path
import regex
from typed_ast.ast3 import literal_eval
from .goodies import print_success, print_exit
from .recommend_programs import Recommendations
def cli_wrapper(args):
db_path = Path(args["DB_PATH"])
if not db_path.exists():
print_exit(f"no file ... | true | true |
1c1a221d99ee4a69fa3394702a24d8cc5975356a | 5,833 | py | Python | tests/testlib/features_rdt_os.py | zzhou612/intel-cmt-cat | c351ffa565df56f5057c40ace46436bf3e776101 | [
"BSD-3-Clause"
] | 397 | 2017-11-30T17:11:14.000Z | 2022-03-31T22:55:32.000Z | tests/testlib/features_rdt_os.py | zzhou612/intel-cmt-cat | c351ffa565df56f5057c40ace46436bf3e776101 | [
"BSD-3-Clause"
] | 150 | 2017-10-30T10:49:33.000Z | 2022-03-30T21:34:41.000Z | tests/testlib/features_rdt_os.py | zzhou612/intel-cmt-cat | c351ffa565df56f5057c40ace46436bf3e776101 | [
"BSD-3-Clause"
] | 132 | 2017-11-03T11:29:49.000Z | 2022-03-21T10:55:10.000Z | ################################################################################
# BSD LICENSE
#
# Copyright(c) 2019-2021 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# *... | 36.45625 | 80 | 0.660552 | true | true | |
1c1a22be7828c50d0cc265b549f42c782f4cf454 | 9,606 | py | Python | sdk/python/pulumi_aws/ec2/subnet.py | michael-golden/pulumi-aws | 165e876e166ecab1870e857822247585d78aef64 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/subnet.py | michael-golden/pulumi-aws | 165e876e166ecab1870e857822247585d78aef64 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/subnet.py | michael-golden/pulumi-aws | 165e876e166ecab1870e857822247585d78aef64 | [
"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 Union
from .. import utilities, tables
class Subnet(pulumi.Cus... | 45.961722 | 304 | 0.668645 |
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Subnet(pulumi.CustomResource):
arn: pulumi.Output[str]
assign_ipv6_address_on_creation: pulumi.Output[bool]
availability_zone: pulumi.Output[str]
availability_zone_id: pulumi.Output[... | true | true |
1c1a2360d3305f52fdb8a790a62c062c976bfe53 | 10,475 | py | Python | bookworm/bookshelf/local_bookshelf/dialogs.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 18 | 2019-07-19T22:12:15.000Z | 2020-08-26T17:45:19.000Z | bookworm/bookshelf/local_bookshelf/dialogs.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 44 | 2019-07-15T10:17:00.000Z | 2020-07-26T11:22:53.000Z | bookworm/bookshelf/local_bookshelf/dialogs.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 9 | 2019-09-03T13:13:31.000Z | 2020-08-25T13:55:27.000Z | # coding: utf-8
from __future__ import annotations
import os
import operator
import wx
import wx.lib.sized_controls as sc
import wx.lib.filebrowsebutton as filebrowse
from bookworm import speech
from bookworm.reader import EBookReader
from bookworm.resources import sounds
from bookworm.gui.components import (
Simp... | 42.581301 | 148 | 0.640477 |
from __future__ import annotations
import os
import operator
import wx
import wx.lib.sized_controls as sc
import wx.lib.filebrowsebutton as filebrowse
from bookworm import speech
from bookworm.reader import EBookReader
from bookworm.resources import sounds
from bookworm.gui.components import (
SimpleDialog,
C... | true | true |
1c1a23b55acc8f7f03f0e890a504146d6d0510e5 | 11,474 | py | Python | clinica/pipelines/machine_learning/ml_workflows.py | Chengwei94/clinica | 0e9d837baf9064a626198422b2a70fe120f227f0 | [
"MIT"
] | 1 | 2020-06-08T15:27:55.000Z | 2020-06-08T15:27:55.000Z | clinica/pipelines/machine_learning/ml_workflows.py | 14thibea/clinica | 3ccce34e330490d346e464235690972c22ac3a4f | [
"MIT"
] | null | null | null | clinica/pipelines/machine_learning/ml_workflows.py | 14thibea/clinica | 3ccce34e330490d346e464235690972c22ac3a4f | [
"MIT"
] | null | null | null | # coding: utf8
import numpy as np
from clinica.pipelines.machine_learning import algorithm, base, input, validation
class VoxelBasedKFoldDualSVM(base.MLWorkflow):
def __init__(
self,
caps_directory,
subjects_visits_tsv,
diagnoses_tsv,
group_label,
image_type,
... | 24.569593 | 81 | 0.580268 |
import numpy as np
from clinica.pipelines.machine_learning import algorithm, base, input, validation
class VoxelBasedKFoldDualSVM(base.MLWorkflow):
def __init__(
self,
caps_directory,
subjects_visits_tsv,
diagnoses_tsv,
group_label,
image_type,
output_di... | true | true |
1c1a2489e5602b2ca591992a804cb9e958894462 | 122 | py | Python | src/405A.py | viing937/codeforces | d694eb6967cd56af02963c3a662066048cb78d07 | [
"MIT"
] | 2 | 2016-08-19T09:47:03.000Z | 2016-10-01T10:15:03.000Z | src/405A.py | viing937/codeforces | d694eb6967cd56af02963c3a662066048cb78d07 | [
"MIT"
] | null | null | null | src/405A.py | viing937/codeforces | d694eb6967cd56af02963c3a662066048cb78d07 | [
"MIT"
] | 1 | 2015-07-01T23:57:32.000Z | 2015-07-01T23:57:32.000Z | # coding: utf-8
n = int(input())
a = [int(i) for i in input().split()]
a = [str(i) for i in sorted(a)]
print(' '.join(a))
| 20.333333 | 37 | 0.557377 |
n = int(input())
a = [int(i) for i in input().split()]
a = [str(i) for i in sorted(a)]
print(' '.join(a))
| true | true |
1c1a26db92bb83bde009b4bd8eed337a8adbf22f | 574 | py | Python | FusionIIIT/applications/scholarships/migrations/0005_auto_20200524_1817.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 2 | 2020-06-17T11:59:08.000Z | 2020-07-10T12:17:35.000Z | FusionIIIT/applications/scholarships/migrations/0005_auto_20200524_1817.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 19 | 2019-09-08T06:01:14.000Z | 2020-05-21T09:08:20.000Z | FusionIIIT/applications/scholarships/migrations/0005_auto_20200524_1817.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 14 | 2019-08-31T12:25:42.000Z | 2022-01-12T08:05:33.000Z | # Generated by Django 3.0.6 on 2020-05-24 18:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scholarships', '0004_merge_20200522_1849'),
]
operations = [
migrations.RenameField(
model_name='director_gold',
old_name='c... | 23.916667 | 54 | 0.609756 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scholarships', '0004_merge_20200522_1849'),
]
operations = [
migrations.RenameField(
model_name='director_gold',
old_name='coorporate',
new_name='corporate',
... | true | true |
1c1a280d30c40e8557e3a3fc7522a214f05956ab | 2,309 | py | Python | tests/discord.py | nakul-shahdadpuri/image-processor | ed7b00274acea3a44014979b479df2e698b38e12 | [
"MIT"
] | 3 | 2021-03-21T18:05:46.000Z | 2021-05-02T12:54:51.000Z | tests/discord.py | nakul-shahdadpuri/image-processor | ed7b00274acea3a44014979b479df2e698b38e12 | [
"MIT"
] | 3 | 2020-09-28T09:51:25.000Z | 2020-10-04T06:52:35.000Z | tests/discord.py | nakul-shahdadpuri/image-processor | ed7b00274acea3a44014979b479df2e698b38e12 | [
"MIT"
] | 5 | 2020-07-19T02:43:46.000Z | 2021-01-01T08:36:41.000Z | import unittest
import requests
class DiscordTestCase(unittest.TestCase):
BASE_URL = "http://127.0.0.1:5000/discord"
class BannerTest(DiscordTestCase):
PATH = "/banners/welcome/"
URL = DiscordTestCase.BASE_URL + PATH
A_BANNER_URL = "https://i.imgur.com/6aieR4Y.gif"
BANNER_URL = "https://i.img... | 32.069444 | 110 | 0.621048 | import unittest
import requests
class DiscordTestCase(unittest.TestCase):
BASE_URL = "http://127.0.0.1:5000/discord"
class BannerTest(DiscordTestCase):
PATH = "/banners/welcome/"
URL = DiscordTestCase.BASE_URL + PATH
A_BANNER_URL = "https://i.imgur.com/6aieR4Y.gif"
BANNER_URL = "https://i.img... | true | true |
1c1a281ca26da68778062f912640d9e7aa527794 | 13,098 | py | Python | typed.py | clavierpaul/proof-tree-animation | 6a85042aed78dbe7153c2dd9eb5e0c737970862e | [
"MIT"
] | 3 | 2020-07-31T15:49:00.000Z | 2020-08-01T14:08:38.000Z | typed.py | clavierpaul/proof-tree-animation | 6a85042aed78dbe7153c2dd9eb5e0c737970862e | [
"MIT"
] | 3 | 2020-08-01T14:10:45.000Z | 2020-08-07T14:41:00.000Z | typed.py | clavierpaul/proof-tree-animation | 6a85042aed78dbe7153c2dd9eb5e0c737970862e | [
"MIT"
] | null | null | null | from re import sub
from manimlib.imports import *
from copy import deepcopy
from lib.proof import Spacing, ProofData, ProofScene
from lib.constants import *
proof_one = ProofData(
nodes = [
#1
f"r<z:>b<B {TIMES} A>",
f"r<z:>b<B {TIMES} A>",
#2
f"r<{SND} z:>b<A>",
... | 29.042129 | 174 | 0.523668 | from re import sub
from manimlib.imports import *
from copy import deepcopy
from lib.proof import Spacing, ProofData, ProofScene
from lib.constants import *
proof_one = ProofData(
nodes = [
f"r<z:>b<B {TIMES} A>",
f"r<z:>b<B {TIMES} A>",
f"r<{SND} z:>b<A>",
... | true | true |
1c1a2923e44442caf43ae6e1205b0f90b07a6fce | 6,386 | py | Python | options/train_options.py | weixk2015/DHSP3D | 02775c634da6637fc09dae42a95177618199c11c | [
"BSD-3-Clause"
] | 3 | 2022-02-17T06:41:20.000Z | 2022-03-10T12:07:58.000Z | options/train_options.py | weixk2015/DHSP3D | 02775c634da6637fc09dae42a95177618199c11c | [
"BSD-3-Clause"
] | 2 | 2022-01-05T09:52:24.000Z | 2022-02-14T06:27:19.000Z | options/train_options.py | weixk2015/DHSP3D | 02775c634da6637fc09dae42a95177618199c11c | [
"BSD-3-Clause"
] | 1 | 2022-01-05T06:31:07.000Z | 2022-01-05T06:31:07.000Z | from .base_options import BaseOptions
class TrainOptions(BaseOptions):
def initialize(self):
BaseOptions.initialize(self)
self.parser.add_argument('--epoch', type=int, default=20, help='train epochs')
self.parser.add_argument('--cur_epoch', type=int, default=1, help='train epochs')
... | 92.550725 | 178 | 0.702631 | from .base_options import BaseOptions
class TrainOptions(BaseOptions):
def initialize(self):
BaseOptions.initialize(self)
self.parser.add_argument('--epoch', type=int, default=20, help='train epochs')
self.parser.add_argument('--cur_epoch', type=int, default=1, help='train epochs')
... | true | true |
1c1a2a0545ddd4a2179a1a7e47a6e9d4cb08e808 | 970 | py | Python | apps.py | paihu/uploader | 048f27155c9452cf7cb0cb13a4e18880f97d639b | [
"MIT"
] | null | null | null | apps.py | paihu/uploader | 048f27155c9452cf7cb0cb13a4e18880f97d639b | [
"MIT"
] | null | null | null | apps.py | paihu/uploader | 048f27155c9452cf7cb0cb13a4e18880f97d639b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MoeboxConfig(AppConfig):
name = 'moebox'
max_log = 300
max_size = 5000 * 1024 * 1024
min_flag = True
min_size = 100 * 1024
max_all_flag = True
max_all_size = 5000 * 24 * 1024 * 1024
file_pre = 'moebox'
page_log = 20
thumb_flag = True
... | 23.658537 | 68 | 0.634021 | from django.apps import AppConfig
class MoeboxConfig(AppConfig):
name = 'moebox'
max_log = 300
max_size = 5000 * 1024 * 1024
min_flag = True
min_size = 100 * 1024
max_all_flag = True
max_all_size = 5000 * 24 * 1024 * 1024
file_pre = 'moebox'
page_log = 20
thumb_flag = True
... | true | true |
1c1a2ab50b953a6b760211cfb93aa3acf4cc9e2d | 3,691 | py | Python | 14-semparsing/ucca/scripts/evaluate_db.py | ariasjose/nn4nlp-code | 7327ea3e93161afbc8c008e287b646daa802be4d | [
"Apache-2.0"
] | null | null | null | 14-semparsing/ucca/scripts/evaluate_db.py | ariasjose/nn4nlp-code | 7327ea3e93161afbc8c008e287b646daa802be4d | [
"Apache-2.0"
] | null | null | null | 14-semparsing/ucca/scripts/evaluate_db.py | ariasjose/nn4nlp-code | 7327ea3e93161afbc8c008e287b646daa802be4d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
The evaluation software for UCCA layer 1.
"""
from optparse import OptionParser
from scripts import ucca_db
from ucca import convert
from ucca.evaluation import evaluate
##############################################################################
# Returns the command line ... | 46.721519 | 98 | 0.545923 |
from optparse import OptionParser
from scripts import ucca_db
from ucca import convert
from ucca.evaluation import evaluate
| true | true |
1c1a2b8d3409425e06cff7183e614b3430d81676 | 4,172 | py | Python | dulwich/bundle.py | timgates42/dulwich | e5de020835cdf1df0f12dbf5f59419cb59db9507 | [
"Apache-2.0"
] | null | null | null | dulwich/bundle.py | timgates42/dulwich | e5de020835cdf1df0f12dbf5f59419cb59db9507 | [
"Apache-2.0"
] | null | null | null | dulwich/bundle.py | timgates42/dulwich | e5de020835cdf1df0f12dbf5f59419cb59db9507 | [
"Apache-2.0"
] | null | null | null | # bundle.py -- Bundle format support
# Copyright (C) 2020 Jelmer Vernooij <jelmer@jelmer.uk>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and... | 33.645161 | 79 | 0.610499 |
from typing import Dict, List, Tuple, Optional, Union, Sequence
from .pack import PackData, write_pack_data
class Bundle(object):
version = None
capabilities = {}
prerequisites = []
references = {}
pack_data = []
def __eq__(self, other):
if not isinsta... | true | true |
1c1a2bfa1379881506528ec9f9c4b4a7e190ab05 | 3,482 | bzl | Python | dsl/library.bzl | mobileink/tek_rules_ocaml | ad4c5562fb4a3cade5764129d61d4e2f6fdf77ac | [
"Apache-2.0"
] | null | null | null | dsl/library.bzl | mobileink/tek_rules_ocaml | ad4c5562fb4a3cade5764129d61d4e2f6fdf77ac | [
"Apache-2.0"
] | null | null | null | dsl/library.bzl | mobileink/tek_rules_ocaml | ad4c5562fb4a3cade5764129d61d4e2f6fdf77ac | [
"Apache-2.0"
] | 1 | 2021-09-02T13:38:16.000Z | 2021-09-02T13:38:16.000Z | load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load(
"@obazl_rules_ocaml//ocaml:rules.bzl",
"ocaml_library",
"ocaml_module",
"ocaml_ns_library",
"ocaml_signature",
"ppx_library",
"ppx_module",
"ppx_executable",
"ppx_n... | 29.760684 | 104 | 0.575531 | load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load(
"@obazl_rules_ocaml//ocaml:rules.bzl",
"ocaml_library",
"ocaml_module",
"ocaml_ns_library",
"ocaml_signature",
"ppx_library",
"ppx_module",
"ppx_executable",
"ppx_n... | true | true |
1c1a2c3dd431cb9b370b24964cc9ff6c7a8e0fe7 | 54,658 | py | Python | geocube/pb/variables_pb2.py | airbusgeo/geocube-client-python | adc41a98386be4e14d004f2af39a62930f710c9e | [
"Apache-2.0"
] | 2 | 2021-07-05T06:47:14.000Z | 2021-08-15T03:53:13.000Z | geocube/pb/variables_pb2.py | airbusgeo/geocube-client-python | adc41a98386be4e14d004f2af39a62930f710c9e | [
"Apache-2.0"
] | null | null | null | geocube/pb/variables_pb2.py | airbusgeo/geocube-client-python | adc41a98386be4e14d004f2af39a62930f710c9e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: geocube/pb/variables.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 40.13069 | 3,942 | 0.76406 |
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
f... | true | true |
1c1a2c4df35be1211a654bff82b9ed3d32be179e | 5,456 | py | Python | test/orm/test_loading.py | atugushev/sqlalchemy | 3cb614009ee87a115ec7230949c031402efb17c1 | [
"MIT"
] | null | null | null | test/orm/test_loading.py | atugushev/sqlalchemy | 3cb614009ee87a115ec7230949c031402efb17c1 | [
"MIT"
] | null | null | null | test/orm/test_loading.py | atugushev/sqlalchemy | 3cb614009ee87a115ec7230949c031402efb17c1 | [
"MIT"
] | 1 | 2020-05-05T21:56:23.000Z | 2020-05-05T21:56:23.000Z | from sqlalchemy import exc
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.engine import result_tuple
from sqlalchemy.orm import aliased
from sqlalchemy.orm import loading
from sqlalchemy.orm import mapper
from sqlalchemy.orm import relationship
from sqlalchemy.orm import Session
from sqlal... | 29.333333 | 78 | 0.54967 | from sqlalchemy import exc
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.engine import result_tuple
from sqlalchemy.orm import aliased
from sqlalchemy.orm import loading
from sqlalchemy.orm import mapper
from sqlalchemy.orm import relationship
from sqlalchemy.orm import Session
from sqlal... | true | true |
1c1a2c939b3fb06ab37e268f13f8652c61dc3c7c | 4,297 | py | Python | tests/test_randomizedsearch.py | Yard1/tune-sklearn | 2b9eecc6fb28963b9b4b80ceb89c138e86fb21c7 | [
"Apache-2.0"
] | null | null | null | tests/test_randomizedsearch.py | Yard1/tune-sklearn | 2b9eecc6fb28963b9b4b80ceb89c138e86fb21c7 | [
"Apache-2.0"
] | null | null | null | tests/test_randomizedsearch.py | Yard1/tune-sklearn | 2b9eecc6fb28963b9b4b80ceb89c138e86fb21c7 | [
"Apache-2.0"
] | null | null | null | from tune_sklearn import TuneSearchCV
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.datasets import make_classification
from scipy.stats import expon
from sklearn.svm import SVC
from sklearn.linear_model import SGDClassifier
from sklearn import datasets
from skopt.space.space import Real
... | 36.415254 | 79 | 0.598557 | from tune_sklearn import TuneSearchCV
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.datasets import make_classification
from scipy.stats import expon
from sklearn.svm import SVC
from sklearn.linear_model import SGDClassifier
from sklearn import datasets
from skopt.space.space import Real
... | true | true |
1c1a2cfa1993e1b6bb424688eafdd662a28a6cfa | 1,744 | py | Python | tools/benchmark/drivers/esc32_cli.py | gudozhni/sapog1 | b1354f4e169930515701f0d162df08f3027bef87 | [
"BSD-3-Clause"
] | 1 | 2015-06-17T03:22:07.000Z | 2015-06-17T03:22:07.000Z | tools/benchmark/drivers/esc32_cli.py | gudozhni/sapog1 | b1354f4e169930515701f0d162df08f3027bef87 | [
"BSD-3-Clause"
] | null | null | null | tools/benchmark/drivers/esc32_cli.py | gudozhni/sapog1 | b1354f4e169930515701f0d162df08f3027bef87 | [
"BSD-3-Clause"
] | null | null | null | #
# Pavel Kirienko <pavel.kirienko@gmail.com>
#
# ESC32 CLI API
#
import logging, time
from itertools import count
from generic_serial_cli import SerialCli
class Esc32CliException(Exception):
pass
class Esc32Cli(SerialCli):
def __init__(self, port, logger=None):
SerialCli.__init__(self, port=port, ba... | 27.68254 | 112 | 0.561353 |
import logging, time
from itertools import count
from generic_serial_cli import SerialCli
class Esc32CliException(Exception):
pass
class Esc32Cli(SerialCli):
def __init__(self, port, logger=None):
SerialCli.__init__(self, port=port, baudrate=115200, timeout=1.0, logger=logger)
def start(sel... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.