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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f7a8e94993c2b1fe673e0cf1bad806686ccf30 | 22,714 | py | Python | aql/nodes/aql_builder.py | menify/aqualid | 58b6d552d677272aaa3bbfb0fe5601c46e126c7e | [
"MIT"
] | 1 | 2019-04-22T09:09:46.000Z | 2019-04-22T09:09:46.000Z | aql/nodes/aql_builder.py | JamesLinus/aqualid | 58b6d552d677272aaa3bbfb0fe5601c46e126c7e | [
"MIT"
] | 1 | 2015-01-10T23:12:29.000Z | 2015-01-10T23:12:29.000Z | aql/nodes/aql_builder.py | menify/aqualid | 58b6d552d677272aaa3bbfb0fe5601c46e126c7e | [
"MIT"
] | null | null | null | #
# Copyright (c) 2014-2015 The developers of Aqualid project
#
# 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, mo... | 30.61186 | 80 | 0.484239 |
import os
import errno
import operator
from aql.util_types import FilePath, to_sequence, to_string
from aql.utils import simple_object_signature, simplify_value, execute_command,\
event_debug, log_debug, group_paths_by_dir, group_items, relative_join,\
relative_join_list
from aql.entity import EntityBase, F... | true | true |
08f7a917efec10688da2347b582162b8d3996756 | 25,512 | py | Python | huaweicloud-sdk-classroom/huaweicloudsdkclassroom/v3/classroom_client.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-classroom/huaweicloudsdkclassroom/v3/classroom_client.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-classroom/huaweicloudsdkclassroom/v3/classroom_client.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request imp... | 31.264706 | 113 | 0.630292 |
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request import SdkStreamReq... | true | true |
08f7a965cfee47c7d621c03ed653f1626da0c44e | 6,817 | py | Python | train_model.py | Khurramjaved96/Dicta | 416638a3d1ad851b00394e55a7574ec978080d51 | [
"Apache-2.0"
] | 60 | 2019-05-29T17:09:15.000Z | 2022-03-30T15:35:57.000Z | train_model.py | Khurramjaved96/Dicta | 416638a3d1ad851b00394e55a7574ec978080d51 | [
"Apache-2.0"
] | 6 | 2018-06-08T14:32:34.000Z | 2019-05-20T05:34:39.000Z | train_model.py | Khurramjaved96/Dicta | 416638a3d1ad851b00394e55a7574ec978080d51 | [
"Apache-2.0"
] | 28 | 2019-06-10T04:07:24.000Z | 2022-01-12T19:21:49.000Z | ''' Document Localization using Recursive CNN
Maintainer : Khurram Javed
Email : kjaved@ualberta.ca '''
from __future__ import print_function
import argparse
import torch
import torch.utils.data as td
import dataprocessor
import experiment as ex
import model
import trainer
import utils
parser = argparse.Argument... | 46.37415 | 120 | 0.660701 |
from __future__ import print_function
import argparse
import torch
import torch.utils.data as td
import dataprocessor
import experiment as ex
import model
import trainer
import utils
parser = argparse.ArgumentParser(description='Recursive-CNNs')
parser.add_argument('--batch-size', type=int, default=32, metavar='N'... | true | true |
08f7a9be4fe23788a977e96c72bd24b888c4f050 | 3,617 | py | Python | tutorials/2_tensorflow_old/tensorflowTUT/tf18_CNN3/full_code.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | 2 | 2019-03-24T12:58:17.000Z | 2021-05-18T06:21:21.000Z | tutorials/2_tensorflow_old/tensorflowTUT/tf18_CNN3/full_code.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | tutorials/2_tensorflow_old/tensorflowTUT/tf18_CNN3/full_code.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | # View more 3_python tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for 3_python 3+. If you are using 3_python 2+, please modify the code accordi... | 38.073684 | 113 | 0.68261 |
from __future__ import print_function
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def compute_accuracy(v_xs, v_ys):
global prediction
y_pre = sess.run(prediction, feed_dict={xs: v_xs, keep_prob: 1})
corre... | true | true |
08f7a9ea496d7e3d789a696a7e56821132f077e2 | 30,173 | py | Python | Assignments/Assignment #4/solar-app/venv/Lib/site-packages/importlib_metadata/__init__.py | SulmanK/Omdena-MLOPS | 7ad043475d4cc6335813f3c6638983701cee0ad6 | [
"MIT"
] | 2 | 2021-12-28T23:44:54.000Z | 2021-12-28T23:45:51.000Z | Assignments/Assignment #4/solar-app/venv/Lib/site-packages/importlib_metadata/__init__.py | SulmanK/Omdena-MLOPS | 7ad043475d4cc6335813f3c6638983701cee0ad6 | [
"MIT"
] | null | null | null | Assignments/Assignment #4/solar-app/venv/Lib/site-packages/importlib_metadata/__init__.py | SulmanK/Omdena-MLOPS | 7ad043475d4cc6335813f3c6638983701cee0ad6 | [
"MIT"
] | null | null | null | import os
import re
import abc
import csv
import sys
import zipp
import email
import pathlib
import operator
import textwrap
import warnings
import functools
import itertools
import posixpath
import collections
from . import _adapters, _meta
from ._collections import FreezableDefaultDict, Pair
from ._compat import (
... | 28.681559 | 85 | 0.614258 | import os
import re
import abc
import csv
import sys
import zipp
import email
import pathlib
import operator
import textwrap
import warnings
import functools
import itertools
import posixpath
import collections
from . import _adapters, _meta
from ._collections import FreezableDefaultDict, Pair
from ._compat import (
... | true | true |
08f7ab7e25c0afec194c130e2d4e190fc645fec3 | 30,206 | py | Python | data_utils.py | luhuaei/xlnet | ef415d43ab999165d5ac284962edf0675120e55c | [
"Apache-2.0"
] | null | null | null | data_utils.py | luhuaei/xlnet | ef415d43ab999165d5ac284962edf0675120e55c | [
"Apache-2.0"
] | null | null | null | data_utils.py | luhuaei/xlnet | ef415d43ab999165d5ac284962edf0675120e55c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import random
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import numpy as np
import tensorflow as tf
from prepro_u... | 32.975983 | 88 | 0.654307 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import random
from absl import flags
import absl.logging as _logging
import numpy as np
import tensorflow as tf
from prepro_utils import preprocess_text, encode_ids
import sentencep... | true | true |
08f7ac568173c14b660c333c111259dc64020fa4 | 12,336 | py | Python | Python/util.py | arigo/vr-sketch-3 | 97491e40476278cd6d487f2516b12a3d9db84c2d | [
"MIT"
] | null | null | null | Python/util.py | arigo/vr-sketch-3 | 97491e40476278cd6d487f2516b12a3d9db84c2d | [
"MIT"
] | null | null | null | Python/util.py | arigo/vr-sketch-3 | 97491e40476278cd6d487f2516b12a3d9db84c2d | [
"MIT"
] | null | null | null | import math
EPSILON = 1e-5
class Vector3(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __repr__(self):
return 'Vector3(%s, %s, %s)' % (self.x, self.y, self.z)
def tolist(self):
return [self.x, self.y, self.z]
@staticmethod
de... | 30.534653 | 97 | 0.591926 | import math
EPSILON = 1e-5
class Vector3(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __repr__(self):
return 'Vector3(%s, %s, %s)' % (self.x, self.y, self.z)
def tolist(self):
return [self.x, self.y, self.z]
@staticmethod
de... | true | true |
08f7acbc22f57f02e2b819672c06c58a4ed75109 | 6,045 | py | Python | Levels/level01.py | mandaw2014/parkour | 8b9a7f6fa47d5de82c9d22c27d8d803cc6a30b07 | [
"MIT"
] | 4 | 2021-09-04T08:22:23.000Z | 2022-01-20T17:35:18.000Z | Levels/level01.py | mandaw2014/parkour | 8b9a7f6fa47d5de82c9d22c27d8d803cc6a30b07 | [
"MIT"
] | 1 | 2021-05-31T18:48:10.000Z | 2021-05-31T18:48:10.000Z | Levels/level01.py | mandaw2014/parkour | 8b9a7f6fa47d5de82c9d22c27d8d803cc6a30b07 | [
"MIT"
] | 2 | 2021-05-31T17:16:06.000Z | 2021-12-09T13:33:52.000Z | from player import Player
from ursina import *
import sys
sys.path.append('../Parkour/')
from block import *
normalSpeed = 2
boostSpeed = 5
normalJump = 0.3
#Level01
class Level01(Entity):
def __init__(self):
super().__init__()
self.is_enabled = True
self.player = None
self.mou... | 35.769231 | 164 | 0.581307 | from player import Player
from ursina import *
import sys
sys.path.append('../Parkour/')
from block import *
normalSpeed = 2
boostSpeed = 5
normalJump = 0.3
class Level01(Entity):
def __init__(self):
super().__init__()
self.is_enabled = True
self.player = None
self.mountain = E... | true | true |
08f7ad40d9dc69ff31152b451233f067e9ccc3ab | 1,909 | py | Python | contrib/devtools/check-doc.py | scottie/testtest | ca1baa009ac79e2cb5c394a1a5a614f6d9c53744 | [
"MIT"
] | null | null | null | contrib/devtools/check-doc.py | scottie/testtest | ca1baa009ac79e2cb5c394a1a5a614f6d9c53744 | [
"MIT"
] | null | null | null | contrib/devtools/check-doc.py | scottie/testtest | ca1baa009ac79e2cb5c394a1a5a614f6d9c53744 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author: @... | 42.422222 | 298 | 0.68989 |
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author: @MarcoFalke
'''
from subprocess import check_output
import re
FOLDER_GREP = 'src'
FOLDER_TEST = 'src/test/'
CMD_ROOT_DIR = '`git rev-parse --show-toplevel`/%s' % FOLDER_GREP
CMD_GREP_ARGS = r"egrep -r -I '(map(Mu... | false | true |
08f7ad68d556079bdd11c854637cd2d3dc013708 | 2,035 | py | Python | wechat/crawl_wechat.py | fst034356/crawler | 98f0c1a129b3b5b77fe88971f4f0c6aae5a8964f | [
"MIT"
] | 92 | 2017-03-06T06:32:49.000Z | 2020-04-05T02:14:56.000Z | wechat/crawl_wechat.py | GeraldDoubleJ/crawler | ab068b1b4d8d00336bb11cea0860244e0817e472 | [
"MIT"
] | 1 | 2018-06-03T10:38:26.000Z | 2018-09-04T09:17:40.000Z | wechat/crawl_wechat.py | GeraldDoubleJ/crawler | ab068b1b4d8d00336bb11cea0860244e0817e472 | [
"MIT"
] | 58 | 2017-04-09T11:18:40.000Z | 2020-03-23T11:20:17.000Z | # coding = utf-8
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import pdfkit
import os
import sys
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Windows NT 10.0; W... | 29.071429 | 259 | 0.64914 |
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import pdfkit
import os
import sys
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW... | true | true |
08f7ad6afce10d6acfded1264c85e02a99e051d9 | 11,262 | py | Python | LoadBusTimetable.py | JoelPerren/Fore-LoadBusTimetablesIntoAimsun | e6e25a616703de1a817827eb0bdfe79d9ad6ac4f | [
"MIT"
] | null | null | null | LoadBusTimetable.py | JoelPerren/Fore-LoadBusTimetablesIntoAimsun | e6e25a616703de1a817827eb0bdfe79d9ad6ac4f | [
"MIT"
] | null | null | null | LoadBusTimetable.py | JoelPerren/Fore-LoadBusTimetablesIntoAimsun | e6e25a616703de1a817827eb0bdfe79d9ad6ac4f | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# This script imports CSV files containing bus information into Aimsun.
# It assumes that the CSV files have been produced from an XML file in the
# Traveline National Dataset (TNDS) using the 'FORE - TNDS Parser' script.
#
# It generates ... | 27.602941 | 176 | 0.656367 |
import os
import re
import datetime, time
CSV_PATH = "C:\\Users\\Joel.Perren\\Documents\\Traveline Data\\TransXChange\\Wakefield Aimsun Model\\CSV"
PT_FOLDER = model.getCatalog().find(1671)
BUS_ID = 9
def match_stops_in_model(stops):
bus_station_ids = ['450030204', '450030188', '450030189', '450030190', '4500301... | true | true |
08f7ad85ce029005e56e956534c2e5f980b3448c | 4,078 | py | Python | moler/cmd/unix/sed.py | jochenparm/moler | 0253d677e0ef150206758c7991197ba5687d0965 | [
"BSD-3-Clause"
] | 57 | 2018-02-20T08:16:47.000Z | 2022-03-28T10:36:57.000Z | moler/cmd/unix/sed.py | jochenparm/moler | 0253d677e0ef150206758c7991197ba5687d0965 | [
"BSD-3-Clause"
] | 377 | 2018-07-19T11:56:27.000Z | 2021-07-09T13:08:12.000Z | moler/cmd/unix/sed.py | jochenparm/moler | 0253d677e0ef150206758c7991197ba5687d0965 | [
"BSD-3-Clause"
] | 24 | 2018-04-14T20:49:40.000Z | 2022-03-29T10:44:26.000Z | # -*- coding: utf-8 -*-
"""
Sed command module.
"""
__author__ = 'Agnieszka Bylica, Marcin Usielski, Michal Ernst'
__copyright__ = 'Copyright (C) 2018-2019, Nokia'
__email__ = 'agnieszka.bylica@nokia.com, marcin.usielski@nokia.com, michal.ernst@nokia.com'
import re
from moler.cmd.unix.genericunix import GenericUnixC... | 30.207407 | 117 | 0.628004 |
__author__ = 'Agnieszka Bylica, Marcin Usielski, Michal Ernst'
__copyright__ = 'Copyright (C) 2018-2019, Nokia'
__email__ = 'agnieszka.bylica@nokia.com, marcin.usielski@nokia.com, michal.ernst@nokia.com'
import re
from moler.cmd.unix.genericunix import GenericUnixCommand
from moler.exceptions import CommandFailure
f... | true | true |
08f7af63311e69c28b0a898b806e97b2a1b0d187 | 778 | py | Python | ramp/shortcuts.py | Marigold/ramp | f9ddea84bc3b5097c0ddb8a3f71a0fce1775ba76 | [
"MIT"
] | 1 | 2015-03-12T23:51:10.000Z | 2015-03-12T23:51:10.000Z | ramp/shortcuts.py | Marigold/ramp | f9ddea84bc3b5097c0ddb8a3f71a0fce1775ba76 | [
"MIT"
] | null | null | null | ramp/shortcuts.py | Marigold/ramp | f9ddea84bc3b5097c0ddb8a3f71a0fce1775ba76 | [
"MIT"
] | null | null | null | import models
from configuration import Configuration
from context import DataContext
def fit(store=None, data=None, **kwargs):
return models.fit(Configuration(**kwargs), DataContext(store, data))
def predict(store=None, data=None, predict_index=None, **kwargs):
if predict_index is None:
raise Value... | 31.12 | 72 | 0.681234 | import models
from configuration import Configuration
from context import DataContext
def fit(store=None, data=None, **kwargs):
return models.fit(Configuration(**kwargs), DataContext(store, data))
def predict(store=None, data=None, predict_index=None, **kwargs):
if predict_index is None:
raise Value... | true | true |
08f7b0151e843c7acce584505e3a8c45abf74cc6 | 154 | py | Python | Code_Python/Exercicio-04/numero-par-impa.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | 1 | 2020-07-19T16:35:51.000Z | 2020-07-19T16:35:51.000Z | Code_Python/Exercicio-04/numero-par-impa.py | gabrielf7/codigos-em-C-uteis | b155d2771291a14e8b112a0f1aa32c58254e406e | [
"MIT"
] | null | null | null | Code_Python/Exercicio-04/numero-par-impa.py | gabrielf7/codigos-em-C-uteis | b155d2771291a14e8b112a0f1aa32c58254e406e | [
"MIT"
] | null | null | null | num = int(input("Digite um número: "))
if (num % 2) == 0:
print("O número {} é par. ".format(num))
else:
print("O número {} é ímpa. ".format(num)) | 30.8 | 45 | 0.564935 | num = int(input("Digite um número: "))
if (num % 2) == 0:
print("O número {} é par. ".format(num))
else:
print("O número {} é ímpa. ".format(num)) | true | true |
08f7b1cae907157f6a9ce6050459172ec17acbd9 | 147 | py | Python | src/os_aio_pod/main.py | zanachka/os-aio-pod | 67d59a70eebcb1aa8acaa1e3319ecdf9f301941a | [
"MIT"
] | 4 | 2019-03-11T08:59:19.000Z | 2019-05-10T12:21:34.000Z | src/os_aio_pod/main.py | zanachka/os-aio-pod | 67d59a70eebcb1aa8acaa1e3319ecdf9f301941a | [
"MIT"
] | 7 | 2019-03-11T09:17:19.000Z | 2020-09-11T04:00:21.000Z | src/os_aio_pod/main.py | zanachka/os-aio-pod | 67d59a70eebcb1aa8acaa1e3319ecdf9f301941a | [
"MIT"
] | 4 | 2019-03-11T08:59:30.000Z | 2020-12-06T10:38:08.000Z | from os_aio_pod.cmdline import execute
def main():
command_packages = ["os_aio_pod.commands"]
execute(command_packages=command_packages)
| 21 | 46 | 0.77551 | from os_aio_pod.cmdline import execute
def main():
command_packages = ["os_aio_pod.commands"]
execute(command_packages=command_packages)
| true | true |
08f7b3e292dcc5fff417ae8af029bfa91bff620a | 3,329 | py | Python | TestTimeAugmentation/testTimeAugmentation.py | savan77/ensembleObjectDetection | b49770547d43bf2ad0dee8251a897a2deae435ae | [
"MIT"
] | null | null | null | TestTimeAugmentation/testTimeAugmentation.py | savan77/ensembleObjectDetection | b49770547d43bf2ad0dee8251a897a2deae435ae | [
"MIT"
] | null | null | null | TestTimeAugmentation/testTimeAugmentation.py | savan77/ensembleObjectDetection | b49770547d43bf2ad0dee8251a897a2deae435ae | [
"MIT"
] | null | null | null | import abc
from abc import ABC
#abstract class
class IPredictor(ABC):
#constructor
def __init__(self, weightPath):
self.pathPesos = weightPath
@abc.abstractmethod
def predict(self,imgPath):
pass
#heritage
class DarknetYoloPred(IPredictor):
def __init__(self,weightPath,fichNam... | 31.11215 | 120 | 0.713427 | import abc
from abc import ABC
class IPredictor(ABC):
def __init__(self, weightPath):
self.pathPesos = weightPath
@abc.abstractmethod
def predict(self,imgPath):
pass
class DarknetYoloPred(IPredictor):
def __init__(self,weightPath,fichNames, fichCfg):
IPredictor.__init... | true | true |
08f7b476031a505bf22f8ae368eb710877ba5456 | 1,104 | py | Python | setup.py | TimilsinaBimal/freetutorials-dl | 21b93cbdb43f29ac0f7f3897a33b062e63de0c82 | [
"MIT"
] | 1 | 2020-06-27T13:53:03.000Z | 2020-06-27T13:53:03.000Z | setup.py | TimilsinaBimal/freetutorials-dl | 21b93cbdb43f29ac0f7f3897a33b062e63de0c82 | [
"MIT"
] | 2 | 2020-12-27T20:02:29.000Z | 2021-01-08T09:12:56.000Z | setup.py | TimilsinaBimal/freetutorials-dl | 21b93cbdb43f29ac0f7f3897a33b062e63de0c82 | [
"MIT"
] | 2 | 2020-09-01T13:29:40.000Z | 2020-12-27T19:29:12.000Z | import setuptools
with open("README.md", 'r+') as f:
print("opened")
long_desc = f.read()
setuptools.setup(
name="freetutorials-dl",
version="1.1",
author="Timilsina Bimal",
license="MIT",
keywords=["freetutorialsdl", "downloader",
"freetutorials", "fts-dl"],
description=... | 27.6 | 106 | 0.60779 | import setuptools
with open("README.md", 'r+') as f:
print("opened")
long_desc = f.read()
setuptools.setup(
name="freetutorials-dl",
version="1.1",
author="Timilsina Bimal",
license="MIT",
keywords=["freetutorialsdl", "downloader",
"freetutorials", "fts-dl"],
description=... | true | true |
08f7b48449e0536f4e02925122d1f3be71425b14 | 1,484 | py | Python | interfaces/base.py | lig/python-interfaces | cf8c5419a827ed74732b938db82e293ea7c9f43f | [
"MIT"
] | 15 | 2019-04-29T05:35:04.000Z | 2021-07-17T01:35:19.000Z | interfaces/base.py | lig/python-interfaces | cf8c5419a827ed74732b938db82e293ea7c9f43f | [
"MIT"
] | 2 | 2019-05-04T20:51:46.000Z | 2019-05-06T07:09:32.000Z | interfaces/base.py | lig/python-interfaces | cf8c5419a827ed74732b938db82e293ea7c9f43f | [
"MIT"
] | 1 | 2020-12-04T07:37:45.000Z | 2020-12-04T07:37:45.000Z | from __future__ import annotations
import typing
import interfaces.exceptions
import interfaces.spec
import interfaces.util
__all__ = ['Interface']
class _InterfaceMeta(type):
def __interface_spec__(self) -> interfaces.spec.InterfaceSpec:
return interfaces.spec.InterfaceSpec(iface=self)
def __sub... | 31.574468 | 88 | 0.666442 | from __future__ import annotations
import typing
import interfaces.exceptions
import interfaces.spec
import interfaces.util
__all__ = ['Interface']
class _InterfaceMeta(type):
def __interface_spec__(self) -> interfaces.spec.InterfaceSpec:
return interfaces.spec.InterfaceSpec(iface=self)
def __sub... | true | true |
08f7b4ce7e5dca2874981e40e00f324fe76381c6 | 2,614 | py | Python | haskell/private/ls_modules.py | laurentlb/rules_haskell | f664d6d7d0a043b82d861a4ffee2d1c407f1fdbb | [
"Apache-2.0"
] | null | null | null | haskell/private/ls_modules.py | laurentlb/rules_haskell | f664d6d7d0a043b82d861a4ffee2d1c407f1fdbb | [
"Apache-2.0"
] | null | null | null | haskell/private/ls_modules.py | laurentlb/rules_haskell | f664d6d7d0a043b82d861a4ffee2d1c407f1fdbb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Create a list of exposed modules (including reexported modules)
# given a directory full of interface files and the content of the
# global package database (to mine the versions of all prebuilt
# dependencies). The exposed modules are filtered using a provided
# list of hidden modules, and au... | 31.119048 | 123 | 0.6557 |
from __future__ import unicode_literals
import collections
import fnmatch
import itertools
import os
import re
import sys
import io
if len(sys.argv) != 6:
sys.exit("Usage: %s <DIRECTORY> <GLOBAL_PKG_DB> <HIDDEN_MODS_FILE> <REEXPORTED_MODS_FILE> <RESULT_FILE>" % sys.argv[0])
root = sys.argv[1]
global_pkg_db_dump... | true | true |
08f7b536b385488c270beeeac3ab2216258a3f97 | 6,235 | py | Python | src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 32 | 2021-01-07T15:09:56.000Z | 2022-01-30T05:49:23.000Z | src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 228 | 2020-09-03T14:03:54.000Z | 2022-03-31T20:16:12.000Z | src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 12 | 2020-09-15T21:36:03.000Z | 2022-03-31T17:13:17.000Z | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 41.845638 | 223 | 0.600642 |
from datadog_api_client.v2.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
)
def lazy_import():
from datadog_api_client.v2.mod... | true | true |
08f7b54f3797140b99fbfc1a6245ace147e9aa1b | 53 | py | Python | codeExec/__init__.py | MiguelCodes/codeExec | 76bd25349d0c80c308d33b573811289af289c5b0 | [
"MIT"
] | null | null | null | codeExec/__init__.py | MiguelCodes/codeExec | 76bd25349d0c80c308d33b573811289af289c5b0 | [
"MIT"
] | null | null | null | codeExec/__init__.py | MiguelCodes/codeExec | 76bd25349d0c80c308d33b573811289af289c5b0 | [
"MIT"
] | null | null | null | from codeExec.codeRunner import retConsole, runScript | 53 | 53 | 0.886792 | from codeExec.codeRunner import retConsole, runScript | true | true |
08f7b71ae210b651ccea569b7ff79e3baed0eddb | 6,037 | py | Python | utils/lit/lit/util.py | clayne/DirectXShaderCompiler | 0ef9b702890b1d45f0bec5fa75481290323e14dc | [
"NCSA"
] | 1,192 | 2017-01-23T23:27:01.000Z | 2019-05-05T14:08:40.000Z | utils/lit/lit/util.py | clayne/DirectXShaderCompiler | 0ef9b702890b1d45f0bec5fa75481290323e14dc | [
"NCSA"
] | 2,214 | 2019-05-06T22:22:53.000Z | 2022-03-31T19:38:50.000Z | utils/lit/lit/util.py | clayne/DirectXShaderCompiler | 0ef9b702890b1d45f0bec5fa75481290323e14dc | [
"NCSA"
] | 269 | 2019-05-07T11:59:04.000Z | 2022-03-30T08:41:50.000Z | import errno
import itertools
import math
import os
import platform
import signal
import subprocess
import sys
def to_bytes(str):
# Encode to UTF-8 to get binary data.
return str.encode('utf-8')
def to_string(bytes):
if isinstance(bytes, str):
return bytes
return to_bytes(bytes)
def convert_s... | 30.80102 | 82 | 0.575451 | import errno
import itertools
import math
import os
import platform
import signal
import subprocess
import sys
def to_bytes(str):
return str.encode('utf-8')
def to_string(bytes):
if isinstance(bytes, str):
return bytes
return to_bytes(bytes)
def convert_string(bytes):
try:
return ... | true | true |
08f7b734bac2c1ba92e962f91aa148d722aa561e | 903 | py | Python | DQN/test_state_processor.py | irustandi/ya-pytorch-rl | 79ff292e21d5bcbfd953a2d64247ebc325689216 | [
"MIT"
] | null | null | null | DQN/test_state_processor.py | irustandi/ya-pytorch-rl | 79ff292e21d5bcbfd953a2d64247ebc325689216 | [
"MIT"
] | null | null | null | DQN/test_state_processor.py | irustandi/ya-pytorch-rl | 79ff292e21d5bcbfd953a2d64247ebc325689216 | [
"MIT"
] | null | null | null | from unittest import TestCase
import gym
import random
import utils, state_processor
class TestStateProcessor(TestCase):
def setUp(self):
self.env = gym.envs.make("Breakout-v0")
self.tfs = utils.get_transforms()
self.num_obs_in_state = 4
def test_init(self):
num_obs_in_state ... | 26.558824 | 76 | 0.653378 | from unittest import TestCase
import gym
import random
import utils, state_processor
class TestStateProcessor(TestCase):
def setUp(self):
self.env = gym.envs.make("Breakout-v0")
self.tfs = utils.get_transforms()
self.num_obs_in_state = 4
def test_init(self):
num_obs_in_state ... | true | true |
08f7b7b09e41a7863b8936ac83efcfe2de44a9bd | 3,977 | py | Python | tartiflette/types/argument.py | alexchamberlain/tartiflette | 6904b0f47770c348553e907be5f5bdb0929fe149 | [
"MIT"
] | null | null | null | tartiflette/types/argument.py | alexchamberlain/tartiflette | 6904b0f47770c348553e907be5f5bdb0929fe149 | [
"MIT"
] | null | null | null | tartiflette/types/argument.py | alexchamberlain/tartiflette | 6904b0f47770c348553e907be5f5bdb0929fe149 | [
"MIT"
] | null | null | null | from functools import partial
from typing import Any, Dict, List, Optional, Union
from tartiflette.types.helpers import (
get_directive_instances,
wraps_with_directives,
)
from tartiflette.types.type import GraphQLType
from tartiflette.utils.arguments import argument_coercer
from tartiflette.utils.coercer impo... | 29.902256 | 76 | 0.602464 | from functools import partial
from typing import Any, Dict, List, Optional, Union
from tartiflette.types.helpers import (
get_directive_instances,
wraps_with_directives,
)
from tartiflette.types.type import GraphQLType
from tartiflette.utils.arguments import argument_coercer
from tartiflette.utils.coercer impo... | true | true |
08f7b91f16a829583b1b3a5fe8cafdc0064dca39 | 176 | py | Python | cride/users/apps.py | tetric0/cride | 8845fd2953980919a8498ed868205a65930f49db | [
"MIT"
] | null | null | null | cride/users/apps.py | tetric0/cride | 8845fd2953980919a8498ed868205a65930f49db | [
"MIT"
] | null | null | null | cride/users/apps.py | tetric0/cride | 8845fd2953980919a8498ed868205a65930f49db | [
"MIT"
] | null | null | null | """Users app."""
# Django
from django.apps import AppConfig
class UsersAppConfig(AppConfig):
"""Users app config."""
name = 'cride.users'
verbose_name = 'Users' | 16 | 33 | 0.659091 |
from django.apps import AppConfig
class UsersAppConfig(AppConfig):
name = 'cride.users'
verbose_name = 'Users' | true | true |
08f7b950110a2becc9d1ae6d09bbb24b44e82e95 | 21,410 | py | Python | great_expectations/datasource/data_connector/util.py | arunnthevapalan/great_expectations | 97f1481bcd1c3f4d8878c6f383f4e6f008b20cd1 | [
"Apache-2.0"
] | 1 | 2022-03-16T22:09:49.000Z | 2022-03-16T22:09:49.000Z | great_expectations/datasource/data_connector/util.py | draev/great_expectations | 317e15ee7e50f6e0d537b62154177440f33b795d | [
"Apache-2.0"
] | null | null | null | great_expectations/datasource/data_connector/util.py | draev/great_expectations | 317e15ee7e50f6e0d537b62154177440f33b795d | [
"Apache-2.0"
] | null | null | null | # Utility methods for dealing with DataConnector objects
import copy
import logging
import os
import re
import sre_constants
import sre_parse
import warnings
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from great_expectations.core.batch import BatchDefinition, BatchRequestBase
from gr... | 41.332046 | 416 | 0.704577 |
import copy
import logging
import os
import re
import sre_constants
import sre_parse
import warnings
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from great_expectations.core.batch import BatchDefinition, BatchRequestBase
from great_expectations.core.id_dict import IDDict
from great_ex... | true | true |
08f7badfa94a0e5c153f47ba28360586180716e3 | 35 | py | Python | fakeish/utils/__init__.py | bengetch/fakeish | e8e534a980ebe5865ccaebeae0dff367190210cf | [
"MIT"
] | 1 | 2020-11-17T15:34:05.000Z | 2020-11-17T15:34:05.000Z | fakeish/utils/__init__.py | bengetch/fakeish | e8e534a980ebe5865ccaebeae0dff367190210cf | [
"MIT"
] | null | null | null | fakeish/utils/__init__.py | bengetch/fakeish | e8e534a980ebe5865ccaebeae0dff367190210cf | [
"MIT"
] | null | null | null | from fakeish.utils.loading import * | 35 | 35 | 0.828571 | from fakeish.utils.loading import * | true | true |
08f7bb4f8d4081e007a420ad8cee5e9f0f9bb882 | 171 | py | Python | python/python_backup/PRAC_PYTHON/ioi.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ioi.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ioi.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def no(n):
for i in range(1,n+1,1):
if i%2==0:
m=0
else:
m=1
for j in range(1,i+1,1):
print m,
if m==0:
m=1
else:
m=0
print " " | 13.153846 | 27 | 0.421053 | def no(n):
for i in range(1,n+1,1):
if i%2==0:
m=0
else:
m=1
for j in range(1,i+1,1):
print m,
if m==0:
m=1
else:
m=0
print " " | false | true |
08f7bbbaa5ff2b5feccd64cdac1d57077bb95ef9 | 1,037 | py | Python | neutron/tests/unit/cmd/test_sanity_check.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | 1 | 2018-10-19T01:48:37.000Z | 2018-10-19T01:48:37.000Z | neutron/tests/unit/cmd/test_sanity_check.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | neutron/tests/unit/cmd/test_sanity_check.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2015 Red Hat, Inc.
# 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... | 34.566667 | 78 | 0.711668 |
import mock
from oslo_config import cfg
from neutron.cmd import sanity_check
from neutron.tests import base
class TestSanityCheck(base.BaseTestCase):
def test_setup_conf(self):
with mock.patch.object(sanity_check.cfg, 'CONF',
return_value=cfg.ConfigOpts()):
... | true | true |
08f7bd1092f502a45a5f1d0d6dfb841b4f6fc95e | 14,636 | py | Python | solarforecastarbiter/io/reference_observations/arm.py | dplarson/solarforecastarbiter-core | d4d85a344ef38024eb47c7daaa557d4fe17730ff | [
"MIT"
] | 22 | 2019-03-04T19:10:26.000Z | 2022-01-24T07:36:45.000Z | solarforecastarbiter/io/reference_observations/arm.py | dplarson/solarforecastarbiter-core | d4d85a344ef38024eb47c7daaa557d4fe17730ff | [
"MIT"
] | 616 | 2019-01-23T17:43:02.000Z | 2022-02-11T19:15:23.000Z | solarforecastarbiter/io/reference_observations/arm.py | dplarson/solarforecastarbiter-core | d4d85a344ef38024eb47c7daaa557d4fe17730ff | [
"MIT"
] | 13 | 2019-01-23T17:51:20.000Z | 2022-02-04T15:43:45.000Z | from functools import partial
import json
import logging
import os
from pkg_resources import resource_filename, Requirement
import pandas as pd
from requests.exceptions import HTTPError
from solarforecastarbiter.io.fetch import arm
from solarforecastarbiter.io.reference_observations import (
common, default_for... | 35.960688 | 79 | 0.657215 | from functools import partial
import json
import logging
import os
from pkg_resources import resource_filename, Requirement
import pandas as pd
from requests.exceptions import HTTPError
from solarforecastarbiter.io.fetch import arm
from solarforecastarbiter.io.reference_observations import (
common, default_for... | true | true |
08f7bd6d10dca817a9e425f9c05d329ada445416 | 4,661 | py | Python | postgresqleu/elections/views.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | postgresqleu/elections/views.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | postgresqleu/elections/views.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.contrib.auth.decorators import login_required
from django.db import connection
from .models import Election, Member, Candidate, Vote
from .forms import VoteForm
from datetime import date, timedelta
... | 37.58871 | 236 | 0.652006 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.contrib.auth.decorators import login_required
from django.db import connection
from .models import Election, Member, Candidate, Vote
from .forms import VoteForm
from datetime import date, timedelta
... | true | true |
08f7bd6da7f32439ccfedf3268e0dce221cf73af | 1,053 | py | Python | stable_world/commands/ci.py | StableWorld/stable.world | 08759ced5eb56c5f8d8e60dd27a81b420015a740 | [
"BSD-2-Clause"
] | null | null | null | stable_world/commands/ci.py | StableWorld/stable.world | 08759ced5eb56c5f8d8e60dd27a81b420015a740 | [
"BSD-2-Clause"
] | 1 | 2018-08-11T02:32:55.000Z | 2018-08-11T02:32:55.000Z | stable_world/commands/ci.py | StableWorld/stable.world | 08759ced5eb56c5f8d8e60dd27a81b420015a740 | [
"BSD-2-Clause"
] | null | null | null | """
This is a command
"""
from __future__ import print_function
import click
from stable_world.interact.setup_bucket import setup_bucket
from stable_world import utils, application
@click.group()
def main():
pass
@main.command()
@click.argument('key')
@click.argument('value')
@application.pass_app
def set(app,... | 19.145455 | 76 | 0.705603 | from __future__ import print_function
import click
from stable_world.interact.setup_bucket import setup_bucket
from stable_world import utils, application
@click.group()
def main():
pass
@main.command()
@click.argument('key')
@click.argument('value')
@application.pass_app
def set(app, key, value):
app.writ... | true | true |
08f7bda9eee8c094b077ad0ce95e485507bf3806 | 1,609 | py | Python | habitat/extravehicular/migrations/0003_auto_20171009_2046.py | matrach/habitatOS | 1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3 | [
"MIT"
] | 1 | 2021-02-01T19:04:39.000Z | 2021-02-01T19:04:39.000Z | habitat/extravehicular/migrations/0003_auto_20171009_2046.py | matrach/habitatOS | 1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3 | [
"MIT"
] | null | null | null | habitat/extravehicular/migrations/0003_auto_20171009_2046.py | matrach/habitatOS | 1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-09 20:46
from __future__ import unicode_literals
from django.db import migrations, models
import habitat.timezone.models.martian_standard_time
class Migration(migrations.Migration):
dependencies = [
('extravehicular', '0002_auto_20171009_16... | 50.28125 | 319 | 0.700435 | from __future__ import unicode_literals
from django.db import migrations, models
import habitat.timezone.models.martian_standard_time
class Migration(migrations.Migration):
dependencies = [
('extravehicular', '0002_auto_20171009_1633'),
]
operations = [
migrations.AlterField(
... | true | true |
08f7beb4f000147399b02ba2334de036e684a8ff | 1,431 | py | Python | guest_book/guest_book.py | gtsofa/yt | 82a41a9de5be8b45905f9251cbc4240ad7299d79 | [
"MIT"
] | null | null | null | guest_book/guest_book.py | gtsofa/yt | 82a41a9de5be8b45905f9251cbc4240ad7299d79 | [
"MIT"
] | null | null | null | guest_book/guest_book.py | gtsofa/yt | 82a41a9de5be8b45905f9251cbc4240ad7299d79 | [
"MIT"
] | null | null | null | #guest_book.py
from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
#app.config['SQLALCHEMY_DATABASE_URI']= 'mysql://sql7233805:FGtSvLX88h@sql7.freemysqlhosting.net/sql7233805'
app.config['SQLALCHEMY_DATABASE_URI']= 'mysql+pym... | 28.62 | 108 | 0.719078 | from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI']= 'mysql+pymysql://guest_admin:FGtSvLX88h@localhost/guest_db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS']= False
db = SQLAlchemy(app)
... | true | true |
08f7bfc6dd567121d0550287028febfc0cdcc7dc | 47,203 | py | Python | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | krissterckx/neutron | 396deed808dc9b69d4641ffe16bcbe6655bc6cd5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | krissterckx/neutron | 396deed808dc9b69d4641ffe16bcbe6655bc6cd5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | krissterckx/neutron | 396deed808dc9b69d4641ffe16bcbe6655bc6cd5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2012 Cisco Systems, Inc.
# 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... | 44.363722 | 79 | 0.587738 |
import sys
import netaddr
from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib import exceptions
from neutron_lib.plugins import utils as plugin_utils
from neutron_lib.utils import helpers
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from osl... | true | true |
08f7c08b44019841d27f94b1d6ab85dd70844998 | 3,680 | py | Python | tests/02_eosio_token.py | PopeyedLocket/eosfactory | 2f6afdb67b2d5e7653afd02c23eb5c33c6565bf8 | [
"MIT"
] | 1 | 2019-01-14T11:13:00.000Z | 2019-01-14T11:13:00.000Z | tests/02_eosio_token.py | PopeyedLocket/eosfactory | 2f6afdb67b2d5e7653afd02c23eb5c33c6565bf8 | [
"MIT"
] | null | null | null | tests/02_eosio_token.py | PopeyedLocket/eosfactory | 2f6afdb67b2d5e7653afd02c23eb5c33c6565bf8 | [
"MIT"
] | null | null | null | import unittest
from eosfactory.eosf import *
verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG])
CONTRACT_WORKSPACE = "_iqhgcqllgnpkirjwwkms"
class Test(unittest.TestCase):
def run(self, result=None):
super().run(result)
@classmethod
def setUpClass(cls):
SCENA... | 27.669173 | 92 | 0.512772 | import unittest
from eosfactory.eosf import *
verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG])
CONTRACT_WORKSPACE = "_iqhgcqllgnpkirjwwkms"
class Test(unittest.TestCase):
def run(self, result=None):
super().run(result)
@classmethod
def setUpClass(cls):
SCENA... | true | true |
08f7c1017e31fd9366a549bab27c34dad55c3e61 | 2,080 | py | Python | NLP/src/test/test_returncsvfile.py | nuguziii/Flower-Chrome-Extension | c93bfcbd52e03b0fe9565b294374dc6ab4f35297 | [
"MIT"
] | 4 | 2019-08-28T15:46:50.000Z | 2021-08-06T04:30:45.000Z | NLP/src/test/test_returncsvfile.py | nuguziii/Flower-Chrome-Extension | c93bfcbd52e03b0fe9565b294374dc6ab4f35297 | [
"MIT"
] | 119 | 2019-08-01T06:51:03.000Z | 2022-03-08T22:57:06.000Z | NLP/src/test/test_returncsvfile.py | nuguziii/Flower-Chrome-Extension | c93bfcbd52e03b0fe9565b294374dc6ab4f35297 | [
"MIT"
] | 5 | 2019-08-01T06:48:22.000Z | 2019-10-18T10:35:00.000Z | import sys, os
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
import csv
from getTagList import *
from nounExtractor import *
def compare_api():
api_list = {1:'kkma', 2:'Twitter', 3:'Hannanum', 4:'Komoran', 5:'Mecab'}
with open('../../result/data.csv', 'w', encoding='utf-8') as ... | 37.818182 | 98 | 0.538942 | import sys, os
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
import csv
from getTagList import *
from nounExtractor import *
def compare_api():
api_list = {1:'kkma', 2:'Twitter', 3:'Hannanum', 4:'Komoran', 5:'Mecab'}
with open('../../result/data.csv', 'w', encoding='utf-8') as ... | true | true |
08f7c1447bda2ea3f21f8b33a3b8c9740a624abe | 2,360 | py | Python | old_Learning_Sets/Learning_Set_2:The_Basics/8_debugging:Logging.py | brendo61-byte/pythonOnBoarding | f16fdb1107631591db157b7db8bb1ea8e0dc2e1b | [
"MIT"
] | 1 | 2019-11-10T00:13:18.000Z | 2019-11-10T00:13:18.000Z | old_Learning_Sets/Learning_Set_2:The_Basics/8_debugging:Logging.py | brendo61-byte/pythonOnBoarding | f16fdb1107631591db157b7db8bb1ea8e0dc2e1b | [
"MIT"
] | null | null | null | old_Learning_Sets/Learning_Set_2:The_Basics/8_debugging:Logging.py | brendo61-byte/pythonOnBoarding | f16fdb1107631591db157b7db8bb1ea8e0dc2e1b | [
"MIT"
] | null | null | null | """
What you will learn:
- What is logging
- When to log information
Before we had a bunch of exceptions to handle errors in our code. So let's say we have a sensor platform reading in
values and it catches an error - then what? Well the program didn't behave as we expected so that's a problem. So the
best course of a... | 54.883721 | 121 | 0.755508 | import logging
logging.basicConfig(level="DEBUG", filename='program.log', filemode='w',
format='%(asctime)s - %(levelname)s - %(message)s')
print("\n\nExample 1\n")
logging.debug("This is a debug level log")
logging.info("This is a info level log")
logging.warning("This is a warning level log")
lo... | true | true |
08f7c19b20b253871907363e651fc0ce46c329b4 | 236 | py | Python | python/p009.py | ericdahl/project-euler | 4757e2c44ca9423471b2938fc1e3dd1796f000b3 | [
"BSD-3-Clause"
] | null | null | null | python/p009.py | ericdahl/project-euler | 4757e2c44ca9423471b2938fc1e3dd1796f000b3 | [
"BSD-3-Clause"
] | 1 | 2016-01-18T02:02:50.000Z | 2016-01-18T02:02:50.000Z | python/p009.py | ericdahl/project-euler | 4757e2c44ca9423471b2938fc1e3dd1796f000b3 | [
"BSD-3-Clause"
] | null | null | null | max = 10000
for a in xrange(1, max):
for b in xrange(a + 1, max):
c = 1000 - a - b
if c < 0:
break
if a**2 + b**2 == c**2:
print a, b, c
print a * b * c
break
| 19.666667 | 32 | 0.364407 | max = 10000
for a in xrange(1, max):
for b in xrange(a + 1, max):
c = 1000 - a - b
if c < 0:
break
if a**2 + b**2 == c**2:
print a, b, c
print a * b * c
break
| false | true |
08f7c2dde85bed2fee3ee0511cd1eefa46237875 | 168 | py | Python | simple_machine_learning_models/models/stacking/__init__.py | lnblanke/OCR | b235faa85fedd9f764f71ea592e8693a2a7ac42a | [
"MIT"
] | null | null | null | simple_machine_learning_models/models/stacking/__init__.py | lnblanke/OCR | b235faa85fedd9f764f71ea592e8693a2a7ac42a | [
"MIT"
] | null | null | null | simple_machine_learning_models/models/stacking/__init__.py | lnblanke/OCR | b235faa85fedd9f764f71ea592e8693a2a7ac42a | [
"MIT"
] | null | null | null | # @Time: 11/5/21
# @Author: lnblanke
# @Email: fjh314.84@gmail.com
# @File: __init__.py.py
# TODO Stacking Classifier
from .StackingRegressor import StackingRegressor
| 21 | 48 | 0.75 |
from .StackingRegressor import StackingRegressor
| true | true |
08f7c318d7f6f1f469ad956d3c90729eaf5922d7 | 196 | py | Python | services/apps.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | null | null | null | services/apps.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | 96 | 2021-08-28T12:37:02.000Z | 2022-03-23T04:25:12.000Z | services/apps.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | null | null | null | """Services App."""
from django.apps import AppConfig
class ServicesConfig(AppConfig):
"""Services Config."""
default_auto_field = "django.db.models.BigAutoField"
name = "services"
| 19.6 | 56 | 0.704082 | from django.apps import AppConfig
class ServicesConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "services"
| true | true |
08f7c3bec5e4c1f7bdc1dc7f393cd19791af7bd8 | 21,671 | py | Python | blobs.py | andywar65/architettura | eea6259e2672768ae10e966d71a235eba075eb93 | [
"BSD-2-Clause"
] | null | null | null | blobs.py | andywar65/architettura | eea6259e2672768ae10e966d71a235eba075eb93 | [
"BSD-2-Clause"
] | null | null | null | blobs.py | andywar65/architettura | eea6259e2672768ae10e966d71a235eba075eb93 | [
"BSD-2-Clause"
] | null | null | null | def get_material_blob():
material = """id=:camera-ent=;position=:-1.4231 0.0 -0.0011=;rotation=:0 324.9208 0=;layer=:0=;tag=:a-entity=;closing=:0
id=:camera=;position=:0 1.6 0=;look-controls=:pointerLockEnabled: true=;layer=:0=;tag=:a-camera=;closing=:0
id=:camera-light=;type=:point=;distance=:10=;intensity=:1=;lay... | 164.174242 | 294 | 0.680541 | def get_material_blob():
material = """id=:camera-ent=;position=:-1.4231 0.0 -0.0011=;rotation=:0 324.9208 0=;layer=:0=;tag=:a-entity=;closing=:0
id=:camera=;position=:0 1.6 0=;look-controls=:pointerLockEnabled: true=;layer=:0=;tag=:a-camera=;closing=:0
id=:camera-light=;type=:point=;distance=:10=;intensity=:1=;lay... | true | true |
08f7c4348d07902e5431c8f0a3b9cca2b1dc6188 | 1,273 | py | Python | information24/info/utils/common.py | LIJF13/information01 | 0bb7c09edb48170b327be11cb7648f32102ae853 | [
"MIT"
] | null | null | null | information24/info/utils/common.py | LIJF13/information01 | 0bb7c09edb48170b327be11cb7648f32102ae853 | [
"MIT"
] | 5 | 2021-03-18T23:11:03.000Z | 2022-03-11T23:44:04.000Z | information24/info/utils/common.py | LIJF13/information01 | 0bb7c09edb48170b327be11cb7648f32102ae853 | [
"MIT"
] | null | null | null |
# 自定义过滤器
# 1.自定义函数实现需求
from flask import session, current_app, jsonify, g
from info.response_code import RET
def do_rank_class(index):
if index == 1:
return "first"
elif index == 2:
return "second"
elif index == 3:
return "third"
else:
return ""
# 需求:发现查询用户基本信息代码在多... | 17.929577 | 66 | 0.593087 |
from flask import session, current_app, jsonify, g
from info.response_code import RET
def do_rank_class(index):
if index == 1:
return "first"
elif index == 2:
return "second"
elif index == 3:
return "third"
else:
return ""
import functools
def get_user_info(vie... | true | true |
08f7c4eed098efbd4352db6747fddc2ef7a906e6 | 3,684 | py | Python | versionner/vcs/git.py | mysz/versionup | dbd7611610d13d8855b7845bd9755f9ff6ce499f | [
"MIT"
] | 6 | 2020-08-24T16:01:02.000Z | 2021-05-06T14:35:58.000Z | versionner/vcs/git.py | mysz/versionup | dbd7611610d13d8855b7845bd9755f9ff6ce499f | [
"MIT"
] | 6 | 2017-04-17T17:41:15.000Z | 2021-05-27T13:44:53.000Z | versionner/vcs/git.py | mysz/versionup | dbd7611610d13d8855b7845bd9755f9ff6ce499f | [
"MIT"
] | 2 | 2019-09-03T13:51:09.000Z | 2020-01-23T12:08:03.000Z | """Realize VCS action for git"""
import subprocess
from versionner import defaults
from versionner.vcs import errors
class VCSCommandsBuilder:
""" Build shell VCS command"""
@staticmethod
def tag(version, params):
"""Build and return full command to use with subprocess.Popen for 'git tag' comma... | 26.695652 | 127 | 0.574919 |
import subprocess
from versionner import defaults
from versionner.vcs import errors
class VCSCommandsBuilder:
@staticmethod
def tag(version, params):
cmd = ['git', 'tag', '-a', '-m', 'v%s' % version, str(version)]
if params:
cmd.extend(params)
return cmd
@staticmet... | true | true |
08f7c4f98dd6883f852a7427270df2dfafe195d0 | 2,218 | py | Python | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/SearchTemplateRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/SearchTemplateRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/SearchTemplateRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.606061 | 73 | 0.766456 |
from aliyunsdkcore.request import RpcRequest
class SearchTemplateRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Mts', '2014-06-18', 'SearchTemplate','mts')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(self,ResourceOwner... | true | true |
08f7c5259d12f3944e67de1a73fe68636ecaf170 | 1,149 | py | Python | src/cogs/example_command_module.py | lukadd16/discordbot | 0e04399a67dc9ba36c399bbd9dd27f139f9a0bed | [
"MIT"
] | null | null | null | src/cogs/example_command_module.py | lukadd16/discordbot | 0e04399a67dc9ba36c399bbd9dd27f139f9a0bed | [
"MIT"
] | null | null | null | src/cogs/example_command_module.py | lukadd16/discordbot | 0e04399a67dc9ba36c399bbd9dd27f139f9a0bed | [
"MIT"
] | null | null | null | """
An example module for future contributors to reference using commands.
"""
from discord.ext import commands
class ExampleCommandModule(commands.Cog):
"""
An example class that inherits from commands.Cog for contributors to reference.
This one uses commands unlike the one in example_event_module
""... | 31.916667 | 83 | 0.682332 | from discord.ext import commands
class ExampleCommandModule(commands.Cog):
def __init__(self, bot, config):
self.bot = bot
self.config = config
@commands.command(name="ping", aliases=["pong", "poong"])
async def measure_ping(self, ctx):
await ctx.send(f"Pong! 🏓 -... | true | true |
08f7c692ea2ba1190cb482de454958fb5cfd0d07 | 1,617 | py | Python | napari/layers/_tests/test_layer_actions.py | sandutsar/napari | 37d476bc0b00252177f17f25e7d1fd52ddc4bb69 | [
"BSD-3-Clause"
] | 2 | 2020-06-18T20:15:41.000Z | 2021-08-11T02:10:58.000Z | napari/layers/_tests/test_layer_actions.py | sandutsar/napari | 37d476bc0b00252177f17f25e7d1fd52ddc4bb69 | [
"BSD-3-Clause"
] | 7 | 2020-04-11T03:37:54.000Z | 2021-01-31T22:41:35.000Z | napari/layers/_tests/test_layer_actions.py | DragaDoncila/napari | 044beba342ef392f4cbed2e8e3a27f27d4799ccb | [
"BSD-3-Clause"
] | 3 | 2020-08-29T21:07:38.000Z | 2022-01-10T15:36:16.000Z | import ast
import numpy as np
import pytest
from napari.components.layerlist import _CONTEXT_KEYS, LayerList
from napari.layers import Image
from napari.layers._layer_actions import (
_LAYER_ACTIONS,
ContextAction,
SubMenu,
_project,
)
class assert_expression_variables(ast.NodeVisitor):
def __in... | 27.87931 | 72 | 0.643166 | import ast
import numpy as np
import pytest
from napari.components.layerlist import _CONTEXT_KEYS, LayerList
from napari.layers import Image
from napari.layers._layer_actions import (
_LAYER_ACTIONS,
ContextAction,
SubMenu,
_project,
)
class assert_expression_variables(ast.NodeVisitor):
def __in... | true | true |
08f7c7e678fb6ca6ca1fb87d44170ba1cd8f6f9a | 79 | py | Python | simulation/sub8_simulation/sub8_sim_tools/__init__.py | ericgorday/SubjuGator | f45ac790f06eb97efc0b0810a7b43d0a6e2facee | [
"MIT"
] | 27 | 2020-02-17T21:54:09.000Z | 2022-03-18T17:49:23.000Z | simulation/sub8_simulation/sub8_sim_tools/__init__.py | ericgorday/SubjuGator | f45ac790f06eb97efc0b0810a7b43d0a6e2facee | [
"MIT"
] | 325 | 2019-09-11T14:13:56.000Z | 2022-03-31T00:38:30.000Z | simulation/sub8_simulation/sub8_sim_tools/__init__.py | ericgorday/SubjuGator | f45ac790f06eb97efc0b0810a7b43d0a6e2facee | [
"MIT"
] | 24 | 2019-09-16T00:29:45.000Z | 2022-03-06T10:56:38.000Z | # flake8: noqa
from .shaders import Shaders
from .shaders import ShaderManager
| 19.75 | 34 | 0.810127 | from .shaders import Shaders
from .shaders import ShaderManager
| true | true |
08f7c8110c19aff1f4be79be518ae0f0e32d5606 | 1,920 | py | Python | spark_auto_mapper_fhir/value_sets/definition_status.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/value_sets/definition_status.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/definition_status.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 36.226415 | 84 | 0.741146 | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
class DefinitionStatusCode(GenericTypeCode):
def __init__(... | true | true |
08f7c870a81eefa3a0796db8697f26a62ce9857e | 1,697 | py | Python | Examples/auto-mpg/config.py | MastenSpace/pysur | 2708af7a9d0407e49c98a2977e8bca8d79dbcd60 | [
"Apache-2.0"
] | 11 | 2017-03-24T23:03:49.000Z | 2021-09-30T10:22:19.000Z | Examples/auto-mpg/config.py | MastenSpace/pysur | 2708af7a9d0407e49c98a2977e8bca8d79dbcd60 | [
"Apache-2.0"
] | 2 | 2017-03-24T22:58:50.000Z | 2017-04-18T01:42:59.000Z | Examples/auto-mpg/config.py | MastenSpace/pysur | 2708af7a9d0407e49c98a2977e8bca8d79dbcd60 | [
"Apache-2.0"
] | 1 | 2019-10-16T20:59:44.000Z | 2019-10-16T20:59:44.000Z | ##############################################
# TOP-LEVEL PIPELINE CONTROL
##############################################
MAKE_MODELS = True
RUN_SA = True
DEBUG = True
output_directory = "../Test_Outputs"
modeling_description = "Car fuel-efficiency modeling"
##############################################
# DATA DESC... | 27.819672 | 55 | 0.462581 | MAKE_MODELS = True
RUN_SA = True
DEBUG = True
output_directory = "../Test_Outputs"
modeling_description = "Car fuel-efficiency modeling"
data_title = 'auto-mpg'
input_data_file = 'auto-mpg.data'
features = ['displacement', 'cylinders', 'model_year']
targets = ['mpg', 'horsepower', 'acceleration']
test_split = 0.0
... | true | true |
08f7c88ac2ced8704efb7fafd7dd672a24843ce2 | 2,640 | py | Python | experiments/pruning.py | jsleb333/paper-decision-trees-as-partitioning-machines | 0f354dac486a9845a9504419e31c84c7eb39507f | [
"MIT"
] | 2 | 2021-01-02T19:39:13.000Z | 2021-06-18T04:09:37.000Z | experiments/pruning.py | jsleb333/paper-decision-trees-as-partitioning-machines | 0f354dac486a9845a9504419e31c84c7eb39507f | [
"MIT"
] | null | null | null | experiments/pruning.py | jsleb333/paper-decision-trees-as-partitioning-machines | 0f354dac486a9845a9504419e31c84c7eb39507f | [
"MIT"
] | null | null | null | from sklearn.model_selection import KFold
from sklearn.metrics import zero_one_loss
import numpy as np
from copy import copy
from partitioning_machines import breiman_alpha_pruning_objective
def prune_with_bound(decision_tree, bound):
"""
Prunes the tree as described by Algorithm 3 in Appendix E of the paper... | 35.675676 | 220 | 0.699621 | from sklearn.model_selection import KFold
from sklearn.metrics import zero_one_loss
import numpy as np
from copy import copy
from partitioning_machines import breiman_alpha_pruning_objective
def prune_with_bound(decision_tree, bound):
leaf = decision_tree.tree
while not leaf.is_leaf():
leaf = leaf.le... | true | true |
08f7c940ae9726106f3e590128ca6e0d9d261f2b | 21,685 | py | Python | Python Scripting/Download Data From Crunchbase/GetCbCompDataJSON.py | lampitosgames/ProjectC | e5365c31d1f84c7e24ae1fbac7ddbd6d06ee64fa | [
"CC0-1.0"
] | null | null | null | Python Scripting/Download Data From Crunchbase/GetCbCompDataJSON.py | lampitosgames/ProjectC | e5365c31d1f84c7e24ae1fbac7ddbd6d06ee64fa | [
"CC0-1.0"
] | null | null | null | Python Scripting/Download Data From Crunchbase/GetCbCompDataJSON.py | lampitosgames/ProjectC | e5365c31d1f84c7e24ae1fbac7ddbd6d06ee64fa | [
"CC0-1.0"
] | null | null | null | import urllib2
import json
import os
import re
#store user input on where the company file list is located
companiesFile = ""
outputFolder = ""
errorFile = ""
outputFile = ""
investorsFile = ""
outputFileName = ""
thisNumber = ""
startOnLine = 0
#store the list of companies
companies = []
#store urls... | 41.462715 | 168 | 0.663915 | import urllib2
import json
import os
import re
companiesFile = ""
outputFolder = ""
errorFile = ""
outputFile = ""
investorsFile = ""
outputFileName = ""
thisNumber = ""
startOnLine = 0
companies = []
companyURLs = []
companyData = []
while True:
#try to open and read file...
try:
thisNumber... | false | true |
08f7c9fff623a64cde813fae1ff07d17558b28e2 | 729 | py | Python | Random/ex26.py | matewszz/Python | 18b7fc96d3ed294d2002ed484941a0ee8cf18108 | [
"MIT"
] | null | null | null | Random/ex26.py | matewszz/Python | 18b7fc96d3ed294d2002ed484941a0ee8cf18108 | [
"MIT"
] | null | null | null | Random/ex26.py | matewszz/Python | 18b7fc96d3ed294d2002ed484941a0ee8cf18108 | [
"MIT"
] | null | null | null | dados = {}
fem = []
cont = media = 0
idade = []
acima = []
while True:
cont = cont + 1
dados['Nome'] = input('Nome: ')
dados['sexo'] = input('Sexo [M/F]: '.upper())
dados['idade'] = int(input('Idade: '))
continuar = input('Deseja continuar? ')
if dados['sexo'] in 'Ff':
fem.append(dados[... | 27 | 55 | 0.570645 | dados = {}
fem = []
cont = media = 0
idade = []
acima = []
while True:
cont = cont + 1
dados['Nome'] = input('Nome: ')
dados['sexo'] = input('Sexo [M/F]: '.upper())
dados['idade'] = int(input('Idade: '))
continuar = input('Deseja continuar? ')
if dados['sexo'] in 'Ff':
fem.append(dados[... | true | true |
08f7cb0eb8c177caac0a86925d271a5a2614c07d | 3,249 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/ndmp_diagnostics.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/ndmp_diagnostics.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/ndmp_diagnostics.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_9_0_0.models.ndmp_d... | 27.769231 | 107 | 0.583256 |
import pprint
import re
import six
from isi_sdk_9_0_0.models.ndmp_diagnostics_diagnostics import NdmpDiagnosticsDiagnostics
class NdmpDiagnostics(object):
swagger_types = {
'diagnostics': 'NdmpDiagnosticsDiagnostics'
}
attribute_map = {
'diagnostics': 'diagnostics'
}
def ... | true | true |
08f7cc0d62dcbdb57c27a00d43b282cd7c6317ab | 970 | py | Python | health/urls.py | rishav-learnerml/Django-web-app | b9a48727b4483fdfa52804b680af53ce9269c985 | [
"MIT"
] | null | null | null | health/urls.py | rishav-learnerml/Django-web-app | b9a48727b4483fdfa52804b680af53ce9269c985 | [
"MIT"
] | null | null | null | health/urls.py | rishav-learnerml/Django-web-app | b9a48727b4483fdfa52804b680af53ce9269c985 | [
"MIT"
] | null | null | null | """health URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 35.925926 | 78 | 0.695876 | from django.contrib import admin
from django.urls import path, include
admin.site.site_header = "Rishav Admin"
admin.site.site_title = "Rishav Admin Portal"
admin.site.index_title = "Welcome to Rishav's Chocolate factory"
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('home.urls'))... | true | true |
08f7cc6ea7e155d60b58466517e390e23b1ab171 | 215 | py | Python | chuck-pyth/code/search3.py | KaiserPhemi/python-101 | 703facf41f1b47c486e5044696ce87b6d28a9ab3 | [
"MIT"
] | 41 | 2015-02-27T22:13:41.000Z | 2021-11-14T15:37:29.000Z | chuck-pyth/code/search3.py | KaiserPhemi/python-101 | 703facf41f1b47c486e5044696ce87b6d28a9ab3 | [
"MIT"
] | 2 | 2015-12-15T04:03:15.000Z | 2017-01-13T15:29:47.000Z | chuck-pyth/code/search3.py | KaiserPhemi/python-101 | 703facf41f1b47c486e5044696ce87b6d28a9ab3 | [
"MIT"
] | 45 | 2015-01-03T17:26:02.000Z | 2022-01-09T16:06:04.000Z | fhand = open('mbox-short.txt')
for line in fhand:
line = line.rstrip()
# Skip 'uninteresting lines'
if not line.startswith('From:') :
continue
# Process our 'interesting' line
print line
| 23.888889 | 37 | 0.632558 | fhand = open('mbox-short.txt')
for line in fhand:
line = line.rstrip()
if not line.startswith('From:') :
continue
print line
| false | true |
08f7cc93b1161cb35eaf17a7a572b6b015b170d7 | 123 | py | Python | python/testData/intentions/typeInDocstring7.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/intentions/typeInDocstring7.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/intentions/typeInDocstring7.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def foo(b<caret>ar, baz):
"""Do foo.
:param bar: something
:return: something else
"""
return bar + baz | 20.5 | 27 | 0.569106 | def foo(b<caret>ar, baz):
"""Do foo.
:param bar: something
:return: something else
"""
return bar + baz | false | true |
08f7cc9b9c7214004189ea19edeba57e7caae91e | 12,009 | py | Python | Pytorch_Object_Detection/yolov3_spp/train_utils/coco_eval.py | YouthJourney/Deep-Learning-For-Image-Process | 2d5f273baa73882f6ec61e13cc4ffca32b228657 | [
"Apache-2.0"
] | 2 | 2021-11-04T05:21:50.000Z | 2022-03-08T06:39:53.000Z | Pytorch_Object_Detection/yolov3_spp/train_utils/coco_eval.py | Wu-Xia-1/Deep-Learning-For-Image-Process | 2d5f273baa73882f6ec61e13cc4ffca32b228657 | [
"Apache-2.0"
] | null | null | null | Pytorch_Object_Detection/yolov3_spp/train_utils/coco_eval.py | Wu-Xia-1/Deep-Learning-For-Image-Process | 2d5f273baa73882f6ec61e13cc4ffca32b228657 | [
"Apache-2.0"
] | 1 | 2021-06-29T08:37:56.000Z | 2021-06-29T08:37:56.000Z | import json
import copy
from collections import defaultdict
import numpy as np
import torch
import torch._six
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO
import pycocotools.mask as mask_util
from yolov3_spp.train_utils.distributed_utils import all_gather
class CocoEvaluator(object):
... | 34.708092 | 107 | 0.569989 | import json
import copy
from collections import defaultdict
import numpy as np
import torch
import torch._six
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO
import pycocotools.mask as mask_util
from yolov3_spp.train_utils.distributed_utils import all_gather
class CocoEvaluator(object):
... | true | true |
08f7ccb9b306cd2adb16c9b8f5bfda8291c7d722 | 728 | py | Python | test/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | 1 | 2021-07-07T21:23:38.000Z | 2021-07-07T21:23:38.000Z | test/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | null | null | null | test/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 33.090909 | 77 | 0.721154 |
from .machine_learning_test_case import (QiskitMachineLearningTestCase,
requires_extra_library)
__all__ = [
'QiskitMachineLearningTestCase',
'requires_extra_library'
]
| true | true |
08f7ccd75c217917acf5d5e205beba326a7c1b39 | 4,871 | py | Python | kubernetes/client/models/v1_env_from_source.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/client/models/v1_env_from_source.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_env_from_source.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 26.617486 | 105 | 0.578115 |
from pprint import pformat
from six import iteritems
import re
class V1EnvFromSource(object):
swagger_types = {
'config_map_ref': 'V1ConfigMapEnvSource',
'prefix': 'str',
'secret_ref': 'V1SecretEnvSource'
}
attribute_map = {
'config_map_ref': 'configMapRef',
'... | true | true |
08f7ccd9641328cb037cac82f88c4a9f90a92b24 | 232 | py | Python | Servers/Frontend/project/main/forms.py | chrisbvt/ML-MalwareDetection | e00d0a0026a7c28886c3d2ab8ca9933e60f049cc | [
"MIT"
] | null | null | null | Servers/Frontend/project/main/forms.py | chrisbvt/ML-MalwareDetection | e00d0a0026a7c28886c3d2ab8ca9933e60f049cc | [
"MIT"
] | 2 | 2021-02-08T20:36:58.000Z | 2022-03-29T21:58:35.000Z | Servers/Frontend/project/main/forms.py | chrisbvt/ML-MalwareDetection | e00d0a0026a7c28886c3d2ab8ca9933e60f049cc | [
"MIT"
] | null | null | null | # project/user/forms.py
from flask_wtf import Form
from wtforms import TextField, PasswordField, FileField
from wtforms.validators import DataRequired, Email, Length, EqualTo
class UploadForm(Form):
file = FileField('file')
| 23.2 | 67 | 0.784483 |
from flask_wtf import Form
from wtforms import TextField, PasswordField, FileField
from wtforms.validators import DataRequired, Email, Length, EqualTo
class UploadForm(Form):
file = FileField('file')
| true | true |
08f7cd717fa8594f6a3d686f2a5084b44ed2e486 | 2,008 | py | Python | tests/chainer_tests/functions_tests/activation_tests/test_softplus.py | ishihara1989/chainer | 4663aa25ffcac07f2d972b2eda59edf6314ea8cb | [
"MIT"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | tests/chainer_tests/functions_tests/activation_tests/test_softplus.py | ishihara1989/chainer | 4663aa25ffcac07f2d972b2eda59edf6314ea8cb | [
"MIT"
] | null | null | null | tests/chainer_tests/functions_tests/activation_tests/test_softplus.py | ishihara1989/chainer | 4663aa25ffcac07f2d972b2eda59edf6314ea8cb | [
"MIT"
] | 1 | 2021-05-27T16:52:11.000Z | 2021-05-27T16:52:11.000Z | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(*testing.product({
'shape': [(3, 2), ()],
'dtype': [n... | 30.892308 | 76 | 0.659861 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(*testing.product({
'shape': [(3, 2), ()],
'dtype': [n... | true | true |
08f7cd963a4dedc4a3b3c082a65047cfa72269c4 | 2,713 | py | Python | pyARC/examples/RunEmcee.py | tomevans/pyARC | 935e3d9b49bca36433e4fb85a43c42b1d10d561d | [
"MIT"
] | null | null | null | pyARC/examples/RunEmcee.py | tomevans/pyARC | 935e3d9b49bca36433e4fb85a43c42b1d10d561d | [
"MIT"
] | null | null | null | pyARC/examples/RunEmcee.py | tomevans/pyARC | 935e3d9b49bca36433e4fb85a43c42b1d10d561d | [
"MIT"
] | null | null | null | from pyATMO_dev import pyATMO
from pyARC_dev import pyARC
import numpy as np
import PrepDataset, InstallNamelistParameters
import pdb
"""
This module demonstrates how to run an emcee retrieval on the synthetic
dataset generated by the PrepDataset module. ATMO parameters are imported
from the InstallNamelistParameters... | 30.144444 | 84 | 0.69554 | from pyATMO_dev import pyATMO
from pyARC_dev import pyARC
import numpy as np
import PrepDataset, InstallNamelistParameters
import pdb
LOGG = InstallNamelistParameters.LOGG
TEQ = InstallNamelistParameters.TEQ
RPLANET = InstallNamelistParameters.RPLANET
RSTAR = InstallNamelistParameters.RSTAR
AAU = InstallNamelistPar... | true | true |
08f7cec0024ffe3fc6e354c7b2b5dde48dd35ea3 | 12,617 | py | Python | src/pay/batch_payer.py | Twente-Mining/tezos-reward-distributor | 8df0745fdb44cbd765084303882545202d2427f3 | [
"MIT"
] | null | null | null | src/pay/batch_payer.py | Twente-Mining/tezos-reward-distributor | 8df0745fdb44cbd765084303882545202d2427f3 | [
"MIT"
] | null | null | null | src/pay/batch_payer.py | Twente-Mining/tezos-reward-distributor | 8df0745fdb44cbd765084303882545202d2427f3 | [
"MIT"
] | null | null | null | from random import randint
from time import sleep
import base58
import os
from log_config import main_logger
from util.client_utils import check_response
from util.rpc_utils import parse_json_response
import configparser
logger = main_logger
COMM_HEAD = " rpc get http://{}/chains/main/blocks/head"
COMM_COUNTER = " r... | 49.673228 | 203 | 0.666085 | from random import randint
from time import sleep
import base58
import os
from log_config import main_logger
from util.client_utils import check_response
from util.rpc_utils import parse_json_response
import configparser
logger = main_logger
COMM_HEAD = " rpc get http://{}/chains/main/blocks/head"
COMM_COUNTER = " r... | true | true |
08f7cfb5fcc22d669a2ff459e0be36b33bb73d90 | 2,450 | py | Python | logger.py | AZdet/causal-infogan | 146b647863a27542ad4a1a01ddb033cdcab9843d | [
"MIT"
] | 89 | 2018-07-26T09:17:01.000Z | 2021-12-12T23:33:51.000Z | logger.py | AZdet/causal-infogan | 146b647863a27542ad4a1a01ddb033cdcab9843d | [
"MIT"
] | 7 | 2019-01-13T19:53:47.000Z | 2021-12-14T06:43:28.000Z | logger.py | AZdet/causal-infogan | 146b647863a27542ad4a1a01ddb033cdcab9843d | [
"MIT"
] | 18 | 2018-09-08T12:31:15.000Z | 2022-01-20T08:31:28.000Z | # Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514
import tensorflow as tf
import numpy as np
import scipy.misc
try:
from StringIO import StringIO # Python 2.7
except ImportError:
from io import BytesIO # Python 3.x
class Logger(object):
def __init__(self, log_dir):... | 33.561644 | 89 | 0.594286 | import tensorflow as tf
import numpy as np
import scipy.misc
try:
from StringIO import StringIO except ImportError:
from io import BytesIO
class Logger(object):
def __init__(self, log_dir):
self.writer = tf.summary.FileWriter(log_dir)
def scalar_summary(self, tag, value, step):
su... | true | true |
08f7d0211eafbc06e1218e2ec313c96c0b833988 | 253,533 | py | Python | Lib/test/test_typing.py | MarshalL-son/cpython | 9b027d4cea57e98c76f5176cc3188dc81603356c | [
"0BSD"
] | null | null | null | Lib/test/test_typing.py | MarshalL-son/cpython | 9b027d4cea57e98c76f5176cc3188dc81603356c | [
"0BSD"
] | null | null | null | Lib/test/test_typing.py | MarshalL-son/cpython | 9b027d4cea57e98c76f5176cc3188dc81603356c | [
"0BSD"
] | null | null | null | import contextlib
import collections
from collections import defaultdict
from functools import lru_cache, wraps
import inspect
import itertools
import pickle
import re
import sys
import warnings
from unittest import TestCase, main, skipUnless, skip
from unittest.mock import patch
from copy import copy, deepcopy
from t... | 35.193365 | 174 | 0.562842 | import contextlib
import collections
from collections import defaultdict
from functools import lru_cache, wraps
import inspect
import itertools
import pickle
import re
import sys
import warnings
from unittest import TestCase, main, skipUnless, skip
from unittest.mock import patch
from copy import copy, deepcopy
from t... | false | true |
08f7d04d2bd89f663932525e990fac4f066d2d35 | 21,876 | py | Python | src/estimator_orginal.py | vcarehuman/tf-pose-estimation-master | 443b2101449a41cdf69cc8f510b58bef8440b641 | [
"Apache-2.0"
] | null | null | null | src/estimator_orginal.py | vcarehuman/tf-pose-estimation-master | 443b2101449a41cdf69cc8f510b58bef8440b641 | [
"Apache-2.0"
] | null | null | null | src/estimator_orginal.py | vcarehuman/tf-pose-estimation-master | 443b2101449a41cdf69cc8f510b58bef8440b641 | [
"Apache-2.0"
] | null | null | null | import itertools
import logging
import math
import pandas as pd
from collections import namedtuple
from datetime import datetime
import time
import cv2
import numpy as np
import tensorflow as tf
from scipy.ndimage import maximum_filter, gaussian_filter
from numpy import array
import matplotlib.pyplot as plt
import co... | 37.587629 | 173 | 0.537073 | import itertools
import logging
import math
import pandas as pd
from collections import namedtuple
from datetime import datetime
import time
import cv2
import numpy as np
import tensorflow as tf
from scipy.ndimage import maximum_filter, gaussian_filter
from numpy import array
import matplotlib.pyplot as plt
import co... | true | true |
08f7d15f0b2ede165eb9109395fadba2c02431fa | 18,236 | py | Python | run_nerf_helpers.py | kylegenova/nerflet | 087ed7377c0552837c8ba0e4bead9334992283e9 | [
"MIT"
] | null | null | null | run_nerf_helpers.py | kylegenova/nerflet | 087ed7377c0552837c8ba0e4bead9334992283e9 | [
"MIT"
] | null | null | null | run_nerf_helpers.py | kylegenova/nerflet | 087ed7377c0552837c8ba0e4bead9334992283e9 | [
"MIT"
] | null | null | null | import os
import sys
import tensorflow as tf
import numpy as np
import imageio
import json
# Misc utils
def img2mse(x, y): return tf.reduce_mean(tf.square(x - y))
def mse2psnr(x): return -10.*tf.log(x)/tf.log(10.)
def to8b(x): return (255*np.clip(x, 0, 1)).astype(np.uint8)
# Positional encoding
class Embedder... | 40.167401 | 154 | 0.623931 | import os
import sys
import tensorflow as tf
import numpy as np
import imageio
import json
def img2mse(x, y): return tf.reduce_mean(tf.square(x - y))
def mse2psnr(x): return -10.*tf.log(x)/tf.log(10.)
def to8b(x): return (255*np.clip(x, 0, 1)).astype(np.uint8)
class Embedder:
def __init__(self, **kwargs)... | true | true |
08f7d1f669e4d57d13acdda5e813ca6bd79eb209 | 849 | py | Python | convert_mru.py | joshleejosh/unibuddy | e73f425a25819fc88eddfd5a85ca25bb1812534e | [
"MIT"
] | null | null | null | convert_mru.py | joshleejosh/unibuddy | e73f425a25819fc88eddfd5a85ca25bb1812534e | [
"MIT"
] | null | null | null | convert_mru.py | joshleejosh/unibuddy | e73f425a25819fc88eddfd5a85ca25bb1812534e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Convert MRU data from the old flat-file list to the new JSON format.
"""
from mrubuddy import MRU
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str)
parser.add_argument('outfile', type=str)
args = parser.parse_args()
mru = MRU()
with open(args.infil... | 21.225 | 68 | 0.646643 |
from mrubuddy import MRU
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str)
parser.add_argument('outfile', type=str)
args = parser.parse_args()
mru = MRU()
with open(args.infile) as fp:
lines = fp.readlines()
if lines[0].startswith('^_^MRULEN='):
maxlen = int(l... | true | true |
08f7d216d35857a8bc9d111b9935c8aba2a06c4b | 330 | py | Python | VerismartOLD/bin/config.py | TheLonelyNull/VeriSmart | dba05c2e74919d2f1c761a8682d86f50bdccb987 | [
"BSD-3-Clause"
] | 2 | 2022-02-03T18:32:52.000Z | 2022-02-20T10:47:11.000Z | VerismartOLD/bin/config.py | TheLonelyNull/VeriSmart | dba05c2e74919d2f1c761a8682d86f50bdccb987 | [
"BSD-3-Clause"
] | null | null | null | VerismartOLD/bin/config.py | TheLonelyNull/VeriSmart | dba05c2e74919d2f1c761a8682d86f50bdccb987 | [
"BSD-3-Clause"
] | 1 | 2022-02-20T11:27:26.000Z | 2022-02-20T11:27:26.000Z | '''
General setting for CSeq
'''
# Log will be write by date in year/month directory
logpath = 'logs'
reportpath = 'reports'
# Relative path to dependencies, calling environment
relpath = {}
relpath['preprocessor'] = ''
relpath['translator'] = 'cseq-feeder.py' #
relpath['swarmtranslator'] = 'cseq-translator... | 25.384615 | 54 | 0.7 | logpath = 'logs'
reportpath = 'reports'
relpath = {}
relpath['preprocessor'] = ''
relpath['translator'] = 'cseq-feeder.py' relpath['swarmtranslator'] = 'cseq-translatorswarm.py'
| true | true |
08f7d289c853b8f558aedb78bb18f2da74d40289 | 898 | py | Python | deepLearning/perceptron3/perceptron.py | ChenHao96/tensorflow | 82b76ae80ebf5d1f320a6787371b9522e7cd5a69 | [
"Apache-2.0"
] | null | null | null | deepLearning/perceptron3/perceptron.py | ChenHao96/tensorflow | 82b76ae80ebf5d1f320a6787371b9522e7cd5a69 | [
"Apache-2.0"
] | null | null | null | deepLearning/perceptron3/perceptron.py | ChenHao96/tensorflow | 82b76ae80ebf5d1f320a6787371b9522e7cd5a69 | [
"Apache-2.0"
] | null | null | null | import numpy as np
np.random.seed(42)
input_x = np.random.rand(200, 2)
example_y = []
for i in range(len(input_x)):
result = 3 * input_x[i][0] + 4 * input_x[i][1] - 3.5
example_y.append(result)
w = np.random.random(2).reshape([2, 1])
b = np.random.random(1)
def perceptron(X, W, b):
return np.dot(X, W) +... | 24.27027 | 67 | 0.546771 | import numpy as np
np.random.seed(42)
input_x = np.random.rand(200, 2)
example_y = []
for i in range(len(input_x)):
result = 3 * input_x[i][0] + 4 * input_x[i][1] - 3.5
example_y.append(result)
w = np.random.random(2).reshape([2, 1])
b = np.random.random(1)
def perceptron(X, W, b):
return np.dot(X, W) +... | true | true |
08f7d2ef5fd736e689cc627a55d28c3607fd3197 | 4,770 | py | Python | oneflow/python/nn/optimizer/sgd.py | MaoXianXin/oneflow | 6caa52f3c5ba11a1d67f183bac4c1559b2a58ef5 | [
"Apache-2.0"
] | 1 | 2021-02-22T00:43:08.000Z | 2021-02-22T00:43:08.000Z | oneflow/python/nn/optimizer/sgd.py | MaoXianXin/oneflow | 6caa52f3c5ba11a1d67f183bac4c1559b2a58ef5 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/optimizer/sgd.py | MaoXianXin/oneflow | 6caa52f3c5ba11a1d67f183bac4c1559b2a58ef5 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 34.565217 | 135 | 0.56499 |
from typing import List, Dict, Callable, Union, Iterator
import collections
import oneflow as flow
from oneflow.python.oneflow_export import oneflow_export, experimental_api
from oneflow.python.nn.parameter import Parameter
from .optimizer import Optimizer, ParamGroup
@oneflow_export("optim.SGD")
@experimental_api... | true | true |
08f7d3909d2334671b2e0650091d6a5b35f5140f | 30,006 | py | Python | src/widgetastic/widget.py | RonnyPfannschmidt-RedHat/widgetastic.core | b24a8098846a9e64c0b9a6547184cd2e3c42e30d | [
"Apache-2.0"
] | null | null | null | src/widgetastic/widget.py | RonnyPfannschmidt-RedHat/widgetastic.core | b24a8098846a9e64c0b9a6547184cd2e3c42e30d | [
"Apache-2.0"
] | null | null | null | src/widgetastic/widget.py | RonnyPfannschmidt-RedHat/widgetastic.core | b24a8098846a9e64c0b9a6547184cd2e3c42e30d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This module contains the base classes that are used to implement the more specific behaviour."""
import inspect
import six
from cached_property import cached_property
from collections import defaultdict
from copy import copy
from smartloc import Locato... | 35.892344 | 101 | 0.618276 | from __future__ import unicode_literals
import inspect
import six
from cached_property import cached_property
from collections import defaultdict
from copy import copy
from smartloc import Locator
from wait_for import wait_for
from .browser import Browser
from .exceptions import (
NoSuchElementException, LocatorN... | true | true |
08f7d414a7dcb5b5d5b2c87404a2bb07b01653fe | 186 | py | Python | core/admin.py | Armestrong/Tourist_Attractions | 8bcc60cd135cc92f32d3e82485cb45e1ecd4714a | [
"MIT"
] | null | null | null | core/admin.py | Armestrong/Tourist_Attractions | 8bcc60cd135cc92f32d3e82485cb45e1ecd4714a | [
"MIT"
] | null | null | null | core/admin.py | Armestrong/Tourist_Attractions | 8bcc60cd135cc92f32d3e82485cb45e1ecd4714a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import TouristAttraction, IdentifierDoc
# Registering the model
admin.site.register(TouristAttraction)
admin.site.register(IdentifierDoc)
| 23.25 | 52 | 0.844086 | from django.contrib import admin
from .models import TouristAttraction, IdentifierDoc
admin.site.register(TouristAttraction)
admin.site.register(IdentifierDoc)
| true | true |
08f7d4aedbf7cb976eac85efeaf40aa88571646b | 483 | py | Python | tests/utils/fixtures.py | vrtaquest/validator | 27e9604a161daacfe96a1a833777f5143a3c5619 | [
"MIT"
] | null | null | null | tests/utils/fixtures.py | vrtaquest/validator | 27e9604a161daacfe96a1a833777f5143a3c5619 | [
"MIT"
] | null | null | null | tests/utils/fixtures.py | vrtaquest/validator | 27e9604a161daacfe96a1a833777f5143a3c5619 | [
"MIT"
] | null | null | null | import pytest
from . import data
from .validators import UserValidator
@pytest.fixture
def user_validator():
"""
Valid user validator.
"""
return UserValidator(data.user_data)
@pytest.fixture
def invalid_user_validator():
"""
Invalid user validator.
"""
return UserValidator(data.inv... | 16.655172 | 49 | 0.703934 | import pytest
from . import data
from .validators import UserValidator
@pytest.fixture
def user_validator():
return UserValidator(data.user_data)
@pytest.fixture
def invalid_user_validator():
return UserValidator(data.invalid_user_data)
@pytest.fixture
def missing_user_validator():
return UserValidat... | true | true |
08f7d5be2833244cf1e48cc24775f4546b7d850a | 33,662 | py | Python | toontown/minigame/Purchase.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | null | null | null | toontown/minigame/Purchase.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | toontown/minigame/Purchase.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | from libotp import *
from PurchaseBase import *
from direct.task.Task import Task
from toontown.toon import ToonHead
from toontown.toonbase import ToontownTimer
from direct.gui import DirectGuiGlobals as DGG
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import Functor
from toontown.... | 42.448928 | 267 | 0.628899 | from libotp import *
from PurchaseBase import *
from direct.task.Task import Task
from toontown.toon import ToonHead
from toontown.toonbase import ToontownTimer
from direct.gui import DirectGuiGlobals as DGG
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import Functor
from toontown.... | true | true |
08f7d7096161a2d4ec05ded70701a572c7c777a5 | 208 | py | Python | delira/training/__init__.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | 1 | 2019-10-03T21:00:20.000Z | 2019-10-03T21:00:20.000Z | delira/training/__init__.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null | delira/training/__init__.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null |
from delira.training.base_experiment import BaseExperiment
from delira.training.base_trainer import BaseNetworkTrainer
from delira.training.predictor import Predictor
from delira.training.backends import *
| 29.714286 | 59 | 0.870192 |
from delira.training.base_experiment import BaseExperiment
from delira.training.base_trainer import BaseNetworkTrainer
from delira.training.predictor import Predictor
from delira.training.backends import *
| true | true |
08f7d7a0597b276172429f950d9a1af43ef37ea6 | 632 | py | Python | examples/im/single/wxchat.py | dramatis/dramatis | 1a43a6be1d7e7e9fd2cde052430d6e84700dc822 | [
"MIT"
] | 5 | 2015-11-05T01:51:29.000Z | 2019-04-16T09:09:19.000Z | examples/im/single/wxchat.py | halorgium/dramatis | 50b35c4e79c33e438cb9f5eeab51ab73119bd75d | [
"MIT"
] | null | null | null | examples/im/single/wxchat.py | halorgium/dramatis | 50b35c4e79c33e438cb9f5eeab51ab73119bd75d | [
"MIT"
] | 1 | 2022-03-03T19:51:04.000Z | 2022-03-03T19:51:04.000Z | #!/usr/bin/env python
import inspect
import sys
import os.path
sys.path[0:0] = [ os.path.join( os.path.dirname( inspect.getabsfile( inspect.currentframe() ) ), '..', '..', '..', 'lib' ) ]
from logging import warning
from chat.screen.wx import Screen
from chat import Server
from chat import Client
password = "xyzzy... | 21.793103 | 124 | 0.686709 |
import inspect
import sys
import os.path
sys.path[0:0] = [ os.path.join( os.path.dirname( inspect.getabsfile( inspect.currentframe() ) ), '..', '..', '..', 'lib' ) ]
from logging import warning
from chat.screen.wx import Screen
from chat import Server
from chat import Client
password = "xyzzy"
group = "general"
s... | false | true |
08f7d8664f5f7b01118e72011ce810aad43b1091 | 454 | py | Python | graphomics/linker/migrations/0029_analysisdata_json_design.py | joewandy/omics_integration | 2dce7c46714f0d87c96d3cd0a702b4716a7be5d9 | [
"MIT"
] | 10 | 2021-08-05T20:13:33.000Z | 2022-01-25T15:08:13.000Z | graphomics/linker/migrations/0029_analysisdata_json_design.py | joewandy/omics_integration | 2dce7c46714f0d87c96d3cd0a702b4716a7be5d9 | [
"MIT"
] | 38 | 2019-07-23T16:14:49.000Z | 2020-05-15T11:28:53.000Z | graphomics/linker/migrations/0029_analysisdata_json_design.py | joewandy/omics_integration | 2dce7c46714f0d87c96d3cd0a702b4716a7be5d9 | [
"MIT"
] | 1 | 2018-11-06T12:16:30.000Z | 2018-11-06T12:16:30.000Z | # Generated by Django 2.0 on 2018-07-06 12:40
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('linker', '0028_analysissample_factor'),
]
operations = [
migrations.AddField(
model_name='analysisdata',
... | 21.619048 | 57 | 0.618943 |
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('linker', '0028_analysissample_factor'),
]
operations = [
migrations.AddField(
model_name='analysisdata',
name='json_design',
field=jsonf... | true | true |
08f7d86dd63ac97d4abb4dd377a7ef29f29b660a | 15,656 | py | Python | sentinelhub/aws_safe.py | Lemaf/sentinelhub-py | 033b70d16379d72a5629d54e770dfc5f3474f430 | [
"MIT"
] | null | null | null | sentinelhub/aws_safe.py | Lemaf/sentinelhub-py | 033b70d16379d72a5629d54e770dfc5f3474f430 | [
"MIT"
] | null | null | null | sentinelhub/aws_safe.py | Lemaf/sentinelhub-py | 033b70d16379d72a5629d54e770dfc5f3474f430 | [
"MIT"
] | null | null | null | """
Module for creating .SAFE structure with data from AWS
"""
import warnings
from .aws import AwsProduct, AwsTile
from .constants import AwsConstants, EsaSafeType, MimeType, DataSource
from .download import get_xml
class SafeProduct(AwsProduct):
""" Class inherits from `aws.AwsProduct`"""
def get_requests... | 40.770833 | 118 | 0.61197 |
import warnings
from .aws import AwsProduct, AwsTile
from .constants import AwsConstants, EsaSafeType, MimeType, DataSource
from .download import get_xml
class SafeProduct(AwsProduct):
def get_requests(self):
safe = self.get_safe_struct()
self.download_list = []
self.structure_recursion... | true | true |
08f7d94bef59692e0fddd9f3cd11cc0bb4d574a7 | 990 | py | Python | python/digit_recognizer_2/__init__.py | ivanyu/ar-sudoku-solver | 50c55fc8c3debc8868ae1f5a6d47683bc45a4159 | [
"Apache-2.0"
] | 1 | 2021-01-28T17:26:39.000Z | 2021-01-28T17:26:39.000Z | python/digit_recognizer_2/__init__.py | ivanyu/ar-sudoku-solver | 50c55fc8c3debc8868ae1f5a6d47683bc45a4159 | [
"Apache-2.0"
] | null | null | null | python/digit_recognizer_2/__init__.py | ivanyu/ar-sudoku-solver | 50c55fc8c3debc8868ae1f5a6d47683bc45a4159 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import numpy as np
import torch
import torchvision as tv
from .model import DigitRecognizer2
def create_recognizer():
_digit_recognizer: DigitRecognizer2 = DigitRecognizer2()
_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
"model-ft.pth"
... | 28.285714 | 91 | 0.643434 | import os
import numpy as np
import torch
import torchvision as tv
from .model import DigitRecognizer2
def create_recognizer():
_digit_recognizer: DigitRecognizer2 = DigitRecognizer2()
_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
"model-ft.pth"
)
_digit_recognize... | true | true |
08f7d971ba1e7fa4fd8c2c8a3d5df3509a6278a4 | 946 | py | Python | tests/wrappers/test_electra_wrapper.py | fhidalgor/erdos2021-project | b88cd6f3b495011ddfb6e8021e6de19b428c84ab | [
"MIT"
] | 1 | 2021-05-10T18:00:51.000Z | 2021-05-10T18:00:51.000Z | tests/wrappers/test_electra_wrapper.py | fhidalgor/erdos2021-project | b88cd6f3b495011ddfb6e8021e6de19b428c84ab | [
"MIT"
] | null | null | null | tests/wrappers/test_electra_wrapper.py | fhidalgor/erdos2021-project | b88cd6f3b495011ddfb6e8021e6de19b428c84ab | [
"MIT"
] | null | null | null | """
Module that tests the electra wrapper.
"""
import unittest
from engine.wrappers.electra_wrapper import ElectraWrapper
def dummy_note() -> str: # pylint: disable=missing-function-docstring
with open('tests/wrappers/dummy_note.txt') as line:
note = line.readlines()
return "".join(note)
class Test... | 32.62069 | 81 | 0.691332 | import unittest
from engine.wrappers.electra_wrapper import ElectraWrapper
def dummy_note() -> str: with open('tests/wrappers/dummy_note.txt') as line:
note = line.readlines()
return "".join(note)
class TestElectraWrapper(unittest.TestCase):
def test_predict(self) -> None: note = dummy... | true | true |
08f7d9b94a70850fc540daad80d5cca728abb429 | 1,625 | py | Python | pytris/audio.py | mjtadema/pytris | 1c69e5757b877915ce98cd86fc603ac4f622e516 | [
"MIT"
] | 3 | 2020-10-22T12:16:59.000Z | 2022-03-28T09:08:52.000Z | pytris/audio.py | mjtadema/pytris | 1c69e5757b877915ce98cd86fc603ac4f622e516 | [
"MIT"
] | 2 | 2019-05-21T08:21:36.000Z | 2019-10-28T10:45:21.000Z | pytris/audio.py | mjtadema/pytris | 1c69e5757b877915ce98cd86fc603ac4f622e516 | [
"MIT"
] | null | null | null | # Code based on https://simpleaudio.readthedocs.io/en/latest/tutorial.html#waveobject-s
# Song composition based on http://www.piano-keyboard-guide.com/how-to-play-the-tetris-theme-song-easy-piano-tutorial-korobeiniki/
import numpy as np
import simpleaudio as sa
# Song improved by Lorenzo Gaifas
song = ["E","B","C"] ... | 28.508772 | 130 | 0.557538 |
import numpy as np
import simpleaudio as sa
song = ["E","B","C"] + ["D","C","B"] + ["A","A","C"] + ["E","D","C"] + ["B","B","C"] + ["D","E","C","A","A"] + \
["P","P"] + ["D","F"] + \
["Ah","G","F"] + ["E","E","C"] + ["E","D","C"] + ["B","B","C"] + ["D","E","C","A","A"] + \
["P"]
timing = [2,1,1] ... | true | true |
08f7d9ebfd9daad133e304a702e5e0afd326557a | 5,073 | py | Python | netapp/santricity/models/symbol/drive_performance_history_retrieve_chunk_details.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | netapp/santricity/models/symbol/drive_performance_history_retrieve_chunk_details.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | netapp/santricity/models/symbol/drive_performance_history_retrieve_chunk_details.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | # coding: utf-8
"""
DrivePerformanceHistoryRetrieveChunkDetails.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the fo... | 40.261905 | 844 | 0.666667 |
from pprint import pformat
from six import iteritems
class DrivePerformanceHistoryRetrieveChunkDetails(object):
def __init__(self):
self.swagger_types = {
'drive_performance_history_data': 'str'
}
self.attribute_map = {
'drive_performance_history_data': 'drivePer... | true | true |
08f7dabc9f2174cc729dcc554c03644d3560a3f6 | 2,073 | py | Python | tests/transform/test_windowed_minmax_scaler.py | denisesato/scikit-multiflow | 3eb4c7262bb60d7e3f65c0d3395e4572d9a8cb95 | [
"BSD-3-Clause"
] | 663 | 2017-11-16T15:48:45.000Z | 2022-03-28T07:38:17.000Z | tests/transform/test_windowed_minmax_scaler.py | denisesato/scikit-multiflow | 3eb4c7262bb60d7e3f65c0d3395e4572d9a8cb95 | [
"BSD-3-Clause"
] | 293 | 2017-12-16T12:33:49.000Z | 2022-02-22T03:34:25.000Z | tests/transform/test_windowed_minmax_scaler.py | denisesato/scikit-multiflow | 3eb4c7262bb60d7e3f65c0d3395e4572d9a8cb95 | [
"BSD-3-Clause"
] | 201 | 2017-11-30T15:52:30.000Z | 2022-03-25T21:46:55.000Z | import os
import numpy as np
from copy import copy
from skmultiflow.transform.windowed_minmax_scaler import WindowedMinmaxScaler
def test_windowed_minmax_scaler(test_path):
X_orig = np.array([[1., 2., 3., 4.], [2., 3., 4., 5.], [3., 4., 5., 6.], [5., 4., 3., 2.], [4., 3., 2., 1.], [0., 1., 0., 1.], [3., 2., 3., 4.... | 74.035714 | 149 | 0.315967 | import os
import numpy as np
from copy import copy
from skmultiflow.transform.windowed_minmax_scaler import WindowedMinmaxScaler
def test_windowed_minmax_scaler(test_path):
X_orig = np.array([[1., 2., 3., 4.], [2., 3., 4., 5.], [3., 4., 5., 6.], [5., 4., 3., 2.], [4., 3., 2., 1.], [0., 1., 0., 1.], [3., 2., 3., 4.... | true | true |
08f7db3ceadf1c966c8d4fbdceec513320b99ba7 | 2,267 | py | Python | logpuzzle/logpuzzle.py | rcjeferson/wttd-exercicios | 90cb0c0602e5090eedbfdde935c5bab050402568 | [
"Apache-2.0"
] | null | null | null | logpuzzle/logpuzzle.py | rcjeferson/wttd-exercicios | 90cb0c0602e5090eedbfdde935c5bab050402568 | [
"Apache-2.0"
] | null | null | null | logpuzzle/logpuzzle.py | rcjeferson/wttd-exercicios | 90cb0c0602e5090eedbfdde935c5bab050402568 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import os
import re
import sys
import urllib.request
import fileinput
import shutil
"""Logpu... | 25.761364 | 192 | 0.633877 |
# http://code.google.com/edu/languages/google-python-class/
import os
import re
import sys
import urllib.request
import fileinput
import shutil
def read_urls(filename):
urls = []
for line in fileinput.input(files=filename):
search = re.search('.*GET (.*puzzle.*) HTTP/1.0', line, re.I)
if ... | true | true |
08f7dba6eb665e4b7120d691e27681a7d8efb16f | 728 | py | Python | useraction/models.py | AerysNan/ChallengeHub | 3ddf1131a01149c2589ef63130deee19030857db | [
"MIT"
] | 1 | 2020-09-17T02:05:38.000Z | 2020-09-17T02:05:38.000Z | useraction/models.py | youkaichao/ChallengeHub | 3ddf1131a01149c2589ef63130deee19030857db | [
"MIT"
] | null | null | null | useraction/models.py | youkaichao/ChallengeHub | 3ddf1131a01149c2589ef63130deee19030857db | [
"MIT"
] | 1 | 2019-01-04T07:55:34.000Z | 2019-01-04T07:55:34.000Z | from django.db import models
from django.contrib.auth.models import AbstractUser
from typing import Dict, Any
class User(AbstractUser):
email = models.EmailField(blank=False)
introduction = models.TextField(default='',blank=True)
school = models.CharField(default='',blank=True, max_length=64)
# need ... | 31.652174 | 67 | 0.644231 | from django.db import models
from django.contrib.auth.models import AbstractUser
from typing import Dict, Any
class User(AbstractUser):
email = models.EmailField(blank=False)
introduction = models.TextField(default='',blank=True)
school = models.CharField(default='',blank=True, max_length=64)
ind... | true | true |
08f7dbbdf624a3d16a95d784c16bb363aa6208ae | 5,992 | py | Python | bfitASCII_IO.py | haanme/DWIProstateMotionCorrection | 6ea9f52c54a92316ad0b2dcdec593c184e76ad28 | [
"MIT"
] | 1 | 2020-05-01T10:58:37.000Z | 2020-05-01T10:58:37.000Z | bfitASCII_IO.py | haanme/DWIProstateMotionCorrection | 6ea9f52c54a92316ad0b2dcdec593c184e76ad28 | [
"MIT"
] | null | null | null | bfitASCII_IO.py | haanme/DWIProstateMotionCorrection | 6ea9f52c54a92316ad0b2dcdec593c184e76ad28 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 11 20:20:02 2014
@author: merisaah
"""
import os
import numpy as np
class bfitASCIIError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class bfitASCIIReadError(bfit... | 36.096386 | 124 | 0.44259 | import os
import numpy as np
class bfitASCIIError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class bfitASCIIReadError(bfitASCIIError):
def __str__(self):
return repr('Read error ' + self.value)
class bfitASCI... | true | true |
08f7dce3445e3d9f9004516dba9fd451c58910c3 | 828 | py | Python | Advance_Python/Graph/Add_Node_Using_Matrix.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Graph/Add_Node_Using_Matrix.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Graph/Add_Node_Using_Matrix.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | # Python program to implement graph insertion operaton | add node | adjacency matrix
def add_node(val):
global node_count
if val in nodes :
print(val, "is already present in the graph!")
else:
node_count += 1
nodes.append(val)
for n in graph:
n.append(0)
... | 23.657143 | 84 | 0.567633 |
def add_node(val):
global node_count
if val in nodes :
print(val, "is already present in the graph!")
else:
node_count += 1
nodes.append(val)
for n in graph:
n.append(0)
temp = []
for i in range(node_count):
temp.append(0)
grap... | true | true |
08f7dd62b40024c00658789cdcf5b99eb8317e5d | 501 | py | Python | bob/bio/face/config/baseline/resnet50_msceleb_arcface_2021.py | bioidiap/bob.bio.face | 2341e6423ca5a412ebe23fa18acacd69ea1ef914 | [
"BSD-3-Clause"
] | 4 | 2016-09-01T13:16:46.000Z | 2021-09-03T03:27:18.000Z | bob/bio/face/config/baseline/resnet50_msceleb_arcface_2021.py | bioidiap/bob.bio.face | 2341e6423ca5a412ebe23fa18acacd69ea1ef914 | [
"BSD-3-Clause"
] | 6 | 2015-09-02T19:31:15.000Z | 2016-10-10T21:48:39.000Z | bob/bio/face/config/baseline/resnet50_msceleb_arcface_2021.py | bioidiap/bob.bio.face | 2341e6423ca5a412ebe23fa18acacd69ea1ef914 | [
"BSD-3-Clause"
] | 6 | 2015-10-07T17:18:48.000Z | 2017-07-18T19:41:14.000Z | from bob.bio.face.embeddings.tensorflow import resnet50_msceleb_arcface_2021
from bob.bio.face.utils import lookup_config_from_database
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None, memory_demanding=Non... | 31.3125 | 81 | 0.820359 | from bob.bio.face.embeddings.tensorflow import resnet50_msceleb_arcface_2021
from bob.bio.face.utils import lookup_config_from_database
annotation_type, fixed_positions, memory_demanding = lookup_config_from_database(
locals().get("database")
)
def load(annotation_type, fixed_positions=None, memory_demanding=Non... | true | true |
08f7dd64c878616872aa5ecb3a1a0375bad73b92 | 150 | py | Python | test/python/restart/v1.py | leeyangjie/unit | 02f50533c4a476b91e4b39a7a2d052095d970983 | [
"Apache-2.0"
] | 2,633 | 2017-09-06T16:10:12.000Z | 2022-03-24T07:18:45.000Z | test/python/restart/v1.py | leeyangjie/unit | 02f50533c4a476b91e4b39a7a2d052095d970983 | [
"Apache-2.0"
] | 637 | 2017-09-06T23:43:11.000Z | 2022-03-31T19:28:46.000Z | test/python/restart/v1.py | leeyangjie/unit | 02f50533c4a476b91e4b39a7a2d052095d970983 | [
"Apache-2.0"
] | 365 | 2017-09-06T22:39:55.000Z | 2022-03-29T13:06:38.000Z | def application(environ, start_response):
body = "v1".encode()
start_response('200', [('Content-Length', str(len(body)))])
return [body]
| 25 | 63 | 0.646667 | def application(environ, start_response):
body = "v1".encode()
start_response('200', [('Content-Length', str(len(body)))])
return [body]
| true | true |
08f7dd9d1b4cfbe94095cf780a73c4adb7b87fef | 1,111 | py | Python | yasit/equiv_classes.py | mvcisback/yasit | de5f06c9bb22c5509fe15985005d1cb43de0ab0a | [
"MIT"
] | 2 | 2020-09-07T11:51:26.000Z | 2020-12-28T06:44:14.000Z | yasit/equiv_classes.py | mvcisback/yasit | de5f06c9bb22c5509fe15985005d1cb43de0ab0a | [
"MIT"
] | 17 | 2018-10-15T03:40:19.000Z | 2020-11-18T05:20:45.000Z | yasit/equiv_classes.py | mvcisback/yasit | de5f06c9bb22c5509fe15985005d1cb43de0ab0a | [
"MIT"
] | null | null | null | from itertools import product
from typing import Set
import attr
import funcy as fn
from yasit.edges import adj_list, possible_edges
def find_equiv_cls(concept_class, *, child_map=None, parallel=True):
if child_map is None:
child_map = adj_list(concept_class)
@attr.s(auto_attribs=True, frozen=True,... | 29.236842 | 77 | 0.659766 | from itertools import product
from typing import Set
import attr
import funcy as fn
from yasit.edges import adj_list, possible_edges
def find_equiv_cls(concept_class, *, child_map=None, parallel=True):
if child_map is None:
child_map = adj_list(concept_class)
@attr.s(auto_attribs=True, frozen=True,... | true | true |
08f7ddf1e4786079f2f322482a5adafd56550fa0 | 5,849 | py | Python | vcse/eval.py | ToleranceVirtue/ai-debris | 33f8ca8cb9e4c8957318c2ae7963e627112e1000 | [
"Apache-2.0"
] | null | null | null | vcse/eval.py | ToleranceVirtue/ai-debris | 33f8ca8cb9e4c8957318c2ae7963e627112e1000 | [
"Apache-2.0"
] | null | null | null | vcse/eval.py | ToleranceVirtue/ai-debris | 33f8ca8cb9e4c8957318c2ae7963e627112e1000 | [
"Apache-2.0"
] | null | null | null | #! -*- coding: utf-8 -*-
# SimCSE 中文测试
from utils import *
import sys
import os
import tensorflow as tf
from bert4keras.optimizers import Adam
from bert4keras.snippets import DataGenerator, sequence_padding
import jieba
jieba.initialize()
# 基本参数
# cmd: python eval.py [model_type] [pooling] [task_name] [dropout_rate]
... | 32.494444 | 144 | 0.669174 |
from utils import *
import sys
import os
import tensorflow as tf
from bert4keras.optimizers import Adam
from bert4keras.snippets import DataGenerator, sequence_padding
import jieba
jieba.initialize()
model_type, pooling, task_name, dropout_rate = sys.argv[1:]
assert model_type in [
'BERT', 'RoBERTa', 'NEZHA', 'Wo... | true | true |
08f7df5dc99845e6d71b2551910ce32351df2e65 | 5,398 | py | Python | skl2onnx/operator_converters/linear_classifier.py | vinitra-zz/sklearn-onnx | a8f2657525d0b4dd279bcd1a971397d002929a77 | [
"MIT"
] | null | null | null | skl2onnx/operator_converters/linear_classifier.py | vinitra-zz/sklearn-onnx | a8f2657525d0b4dd279bcd1a971397d002929a77 | [
"MIT"
] | null | null | null | skl2onnx/operator_converters/linear_classifier.py | vinitra-zz/sklearn-onnx | a8f2657525d0b4dd279bcd1a971397d002929a77 | [
"MIT"
] | 1 | 2020-10-01T09:26:27.000Z | 2020-10-01T09:26:27.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import nu... | 44.245902 | 79 | 0.603927 |
import numbers
import numpy as np
import six
from sklearn.linear_model import (
LogisticRegression,
RidgeClassifier,
RidgeClassifierCV,
)
from sklearn.svm import LinearSVC
from ..common._registration import register_converter
from ..common.utils_classifier import get_label_classes
from ..proto import onnx_... | true | true |
08f7dff08e6ea063452ccc8760282dbe88b3a283 | 5,853 | py | Python | segmenter/svm/model.py | oisc/ChineseDiscourseParser | 1363716cc5caa9e9a82987f2ce76fc8b07b4cdfa | [
"Apache-2.0"
] | 13 | 2019-04-24T11:41:26.000Z | 2022-03-23T03:09:00.000Z | segmenter/svm/model.py | oisc/ChineseDiscourseParser | 1363716cc5caa9e9a82987f2ce76fc8b07b4cdfa | [
"Apache-2.0"
] | 2 | 2020-04-28T10:22:20.000Z | 2021-01-07T06:28:00.000Z | segmenter/svm/model.py | oisc/ChineseDiscourseParser | 1363716cc5caa9e9a82987f2ce76fc8b07b4cdfa | [
"Apache-2.0"
] | 5 | 2019-04-24T11:42:01.000Z | 2022-03-27T11:47:31.000Z | # coding: UTF-8
import logging
from collections import OrderedDict
from nltk import ParentedTree
from sklearn.feature_extraction import DictVectorizer
from sklearn.svm import LinearSVC
logger = logging.getLogger(__name__)
class SVMCommaClassifier:
def __init__(self, connectives, candidate=",,;", seed=21):
... | 35.689024 | 102 | 0.516316 |
import logging
from collections import OrderedDict
from nltk import ParentedTree
from sklearn.feature_extraction import DictVectorizer
from sklearn.svm import LinearSVC
logger = logging.getLogger(__name__)
class SVMCommaClassifier:
def __init__(self, connectives, candidate=",,;", seed=21):
self.connect... | true | true |
08f7e0f759d5f1d27858254f4322e7b4b1a1cc7f | 1,444 | py | Python | azure-mgmt-logic/azure/mgmt/logic/models/key_vault_key_reference.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/logic/models/key_vault_key_reference.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure/mgmt/logic/models/key_vault_key_reference.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 34.380952 | 81 | 0.605263 |
from msrest.serialization import Model
class KeyVaultKeyReference(Model):
_validation = {
'key_vault': {'required': True},
'key_name': {'required': True},
}
_attribute_map = {
'key_vault': {'key': 'keyVault', 'type': 'KeyVaultKeyReferenceKeyVault'},
'key_name': {'key': '... | true | true |
08f7e14413d0356fef727ff7aa4114aed5bd1af3 | 2,668 | py | Python | tests/test_cube.py | itsdaveba/rubik-solver | eebae6cffc9f91e64d5f3e49d556a78df0e703f5 | [
"MIT"
] | null | null | null | tests/test_cube.py | itsdaveba/rubik-solver | eebae6cffc9f91e64d5f3e49d556a78df0e703f5 | [
"MIT"
] | null | null | null | tests/test_cube.py | itsdaveba/rubik-solver | eebae6cffc9f91e64d5f3e49d556a78df0e703f5 | [
"MIT"
] | null | null | null | from .context import rubik_solver
from .context import available_moves
import numpy as np
import unittest
benchmark_scrambles = [
("F' D U' L2 B2 D2 B2 D B F U L2 R2 B2 U' L F' D U2 F' D2 U L U' B' U' B2 U R2 U",
np.array([ 1, 2, 0, 1, 2, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]),
np.array([ 7, 1, 4,... | 48.509091 | 87 | 0.601574 | from .context import rubik_solver
from .context import available_moves
import numpy as np
import unittest
benchmark_scrambles = [
("F' D U' L2 B2 D2 B2 D B F U L2 R2 B2 U' L F' D U2 F' D2 U L U' B' U' B2 U R2 U",
np.array([ 1, 2, 0, 1, 2, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]),
np.array([ 7, 1, 4,... | true | true |
08f7e1f98460644d4ec2403c5bfdf4789ec9662e | 1,252 | py | Python | main.py | Strassboom/UnderTell | 19a8ebbb045bca139c9f8d3bae3874115fe71461 | [
"MIT"
] | 1 | 2019-11-05T06:25:20.000Z | 2019-11-05T06:25:20.000Z | main.py | Strassboom/UnderTell | 19a8ebbb045bca139c9f8d3bae3874115fe71461 | [
"MIT"
] | 1 | 2019-11-05T02:05:14.000Z | 2019-11-05T02:05:14.000Z | main.py | Strassboom/UnderTell | 19a8ebbb045bca139c9f8d3bae3874115fe71461 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
from pydub import AudioSegment
import simpleaudio as sa
from pydub.effects import speedup
app = Flask(__name__)
@app.route('/',methods=["GET","POST"])
def home():
if request.method == 'GET':
text = "Heya"
else:
text = request.form["words"]
... | 28.454545 | 80 | 0.662141 | from flask import Flask, render_template, request
from pydub import AudioSegment
import simpleaudio as sa
from pydub.effects import speedup
app = Flask(__name__)
@app.route('/',methods=["GET","POST"])
def home():
if request.method == 'GET':
text = "Heya"
else:
text = request.form["words"]
... | true | true |
08f7e33eb43bebd30e89db7b20658165edb5288b | 17,460 | py | Python | tests/cli/v012/upgrade_helpers/test_upgrade_helper_pre_v013.py | mmi333/great_expectations | cc9df78596610002c24e2d46f737179e04f31d29 | [
"Apache-2.0"
] | 1 | 2022-03-17T08:05:44.000Z | 2022-03-17T08:05:44.000Z | tests/cli/v012/upgrade_helpers/test_upgrade_helper_pre_v013.py | Tchibo/great_expectations | 27220336190039148ab91138cb2fd489d2159183 | [
"Apache-2.0"
] | null | null | null | tests/cli/v012/upgrade_helpers/test_upgrade_helper_pre_v013.py | Tchibo/great_expectations | 27220336190039148ab91138cb2fd489d2159183 | [
"Apache-2.0"
] | null | null | null | import json
import os
import shutil
from click.testing import CliRunner
from freezegun import freeze_time
from moto import mock_s3
import great_expectations
from great_expectations import DataContext
# NOTE: we explicitly import the v012 CLI module, so the tests don't require the --v2-api flag explicitly,
# although... | 32.333333 | 120 | 0.629725 | import json
import os
import shutil
from click.testing import CliRunner
from freezegun import freeze_time
from moto import mock_s3
import great_expectations
from great_expectations import DataContext
# although that is what is being run.
from great_expectations.cli.v012 import cli
from great_expectations.data_contex... | true | true |
08f7e4532c246ffc7dd5bcf27700b8ecc1fa0ebb | 3,054 | py | Python | bin/lib/requests/structures.py | deductiv/deductiv_hep | a04afbd34c100fdb9450de3caef63e57d4b822eb | [
"Apache-2.0"
] | 2 | 2020-09-21T12:11:57.000Z | 2020-09-25T02:13:01.000Z | bin/lib/requests/structures.py | deductiv/deductiv_hep | a04afbd34c100fdb9450de3caef63e57d4b822eb | [
"Apache-2.0"
] | 2 | 2021-12-14T10:49:41.000Z | 2021-12-31T22:59:42.000Z | bin/lib/requests/structures.py | deductiv/deductiv_hep | a04afbd34c100fdb9450de3caef63e57d4b822eb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from builtins import str
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Impl... | 28.542056 | 81 | 0.621153 |
from builtins import str
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
def __init__(self, data=None, **kwargs):
self._store = OrderedDict()
if data is None:
data = {}
self.update(data, **kwargs)
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.