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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2f11dff72f8364a0ea8758e647d0af627bafc8 | 38,569 | py | Python | tensorflow/python/debug/lib/debug_events_writer_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/debug/lib/debug_events_writer_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/debug/lib/debug_events_writer_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.831887 | 80 | 0.675309 |
import glob
import json as json_lib
import os
import re
import threading
import time
from absl.testing import parameterized
from tensorflow.core.protobuf import debug_event_pb2
from tensorflow.python.debug.lib import debug_events_reader
from tensorflow.python.debug.lib import debug_events_writer
from t... | true | true |
1c2f122b468c80626a01b121b18aa5167206ae08 | 3,685 | py | Python | livesync/indico_livesync/controllers.py | tomasr8/indico-plugins | b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 | [
"MIT"
] | null | null | null | livesync/indico_livesync/controllers.py | tomasr8/indico-plugins | b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 | [
"MIT"
] | null | null | null | livesync/indico_livesync/controllers.py | tomasr8/indico-plugins | b85e4ad826fa362aa32eb236e73c9ab2f7c7f465 | [
"MIT"
] | null | null | null | # This file is part of the Indico plugins.
# Copyright (C) 2002 - 2022 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from flask import flash, redirect, request
from flask_pluginengine import cur... | 39.623656 | 119 | 0.688195 |
from flask import flash, redirect, request
from flask_pluginengine import current_plugin, render_plugin_template
from sqlalchemy.orm.attributes import flag_modified
from werkzeug.exceptions import NotFound
from indico.core.db import db
from indico.core.errors import UserValueError
from indico.modules.admin impo... | true | true |
1c2f125d2dc314b0fc43aaa3ca2b3b0b148148cb | 1,503 | py | Python | src/clustar_project/graph.py | jz5jx/Test_Repo | 8796f45021943984ed02232fd34ff02e17123d71 | [
"MIT"
] | 1 | 2021-04-24T21:52:53.000Z | 2021-04-24T21:52:53.000Z | src/clustar_project/graph.py | jz5jx/Test_Repo | 8796f45021943984ed02232fd34ff02e17123d71 | [
"MIT"
] | null | null | null | src/clustar_project/graph.py | jz5jx/Test_Repo | 8796f45021943984ed02232fd34ff02e17123d71 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
def identify_peaks(image, smoothing=5, clip=0.75):
n_rows = image.shape[0]
n_cols = image.shape[1]
mid = n_rows // 2
y = np.array([image[mid, c] for c in range(n_cols)])
x = np.arange(0, len(y), 1)
y_... | 28.903846 | 72 | 0.465735 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
def identify_peaks(image, smoothing=5, clip=0.75):
n_rows = image.shape[0]
n_cols = image.shape[1]
mid = n_rows // 2
y = np.array([image[mid, c] for c in range(n_cols)])
x = np.arange(0, len(y), 1)
y_... | true | true |
1c2f127cdfa2366e188a595e18fd3dfb435b4486 | 2,218 | py | Python | app/auth/forms.py | sgaoshang/seeker | bb96ab9835abddf076dfe61f4ffc4fd8d5933b6f | [
"MIT"
] | null | null | null | app/auth/forms.py | sgaoshang/seeker | bb96ab9835abddf076dfe61f4ffc4fd8d5933b6f | [
"MIT"
] | 2 | 2021-03-31T19:01:13.000Z | 2021-12-13T19:50:54.000Z | app/auth/forms.py | sgaoshang/seeker | bb96ab9835abddf076dfe61f4ffc4fd8d5933b6f | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, SelectField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from flask_babel import _, lazy_gettext as _l
from app.models import User
class LoginForm(FlaskForm):
username = Strin... | 42.653846 | 114 | 0.672227 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, SelectField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from flask_babel import _, lazy_gettext as _l
from app.models import User
class LoginForm(FlaskForm):
username = Strin... | true | true |
1c2f13420cec6ec91fd855a91f15b93e5ee912ca | 454 | py | Python | passwlib.py | Lightmoll/SimpleStatus | e2eef3b1c7488899f5da74e18976dac5b18aefe0 | [
"MIT"
] | null | null | null | passwlib.py | Lightmoll/SimpleStatus | e2eef3b1c7488899f5da74e18976dac5b18aefe0 | [
"MIT"
] | null | null | null | passwlib.py | Lightmoll/SimpleStatus | e2eef3b1c7488899f5da74e18976dac5b18aefe0 | [
"MIT"
] | null | null | null | from passlib.hash import pbkdf2_sha256
#external lib
DEFAULT_PASSWD_URI = "data/passw.db"
def verify_password(in_passw):
base_passw_hash = ""
with open(DEFAULT_PASSWD_URI, "r") as file:
base_passw_hash = file.read().rstrip()
return pbkdf2_sha256.verify(in_passw, base_passw_hash)
def set_passwor... | 25.222222 | 58 | 0.729075 | from passlib.hash import pbkdf2_sha256
DEFAULT_PASSWD_URI = "data/passw.db"
def verify_password(in_passw):
base_passw_hash = ""
with open(DEFAULT_PASSWD_URI, "r") as file:
base_passw_hash = file.read().rstrip()
return pbkdf2_sha256.verify(in_passw, base_passw_hash)
def set_password(passw):
... | true | true |
1c2f149739b4d45fd677b49e34c515d4fcbe65c5 | 3,751 | py | Python | www/server.py | cjds/rpicar | 01e9db2149691cb29bfe223644236b7634c3998b | [
"WTFPL"
] | null | null | null | www/server.py | cjds/rpicar | 01e9db2149691cb29bfe223644236b7634c3998b | [
"WTFPL"
] | null | null | null | www/server.py | cjds/rpicar | 01e9db2149691cb29bfe223644236b7634c3998b | [
"WTFPL"
] | 1 | 2020-04-07T18:03:01.000Z | 2020-04-07T18:03:01.000Z | #!/usr/bin/env python3
# @author Carl Saldanha <cjds92@gmail.com>
# @brief Web server to help move the robot
from http.server import BaseHTTPRequestHandler, HTTPServer
from os import curdir, sep
import contextlib
import os
import socket
import urllib.parse as urlparse
from urllib.parse import parse_qs
from functools... | 35.72381 | 90 | 0.559051 |
from http.server import BaseHTTPRequestHandler, HTTPServer
from os import curdir, sep
import contextlib
import os
import socket
import urllib.parse as urlparse
from urllib.parse import parse_qs
from functools import partialmethod
PORT_NUMBER = 8080
HOST = '127.0.0.1'
SOCKET_PORT = 65432
def partialc... | true | true |
1c2f15a19961e75280cc697ad0564e6c34542fa7 | 1,204 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/iam/apis/CreateSubUserRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/iam/apis/CreateSubUserRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/iam/apis/CreateSubUserRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 28.666667 | 75 | 0.719269 |
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class CreateSubUserRequest(JDCloudRequest):
def __init__(self, parameters, header=None, version="v1"):
super(CreateSubUserRequest, self).__init__(
'/subUser', 'POST', header, version)
self.parameters = parame... | true | true |
1c2f15c725d49d08657992ccce0173a331d53cb5 | 3,770 | py | Python | Chapter11_AI/cartpoleAgent4.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter11_AI/cartpoleAgent4.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter11_AI/cartpoleAgent4.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | # noqa
import gym
import numpy as np
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
from tensorflow.keras.utils import to_categorical
class Agent:
def __init__(self, env: gym.Env):
self.env = env
self.num_ober... | 35.904762 | 96 | 0.58992 |
import gym
import numpy as np
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
from tensorflow.keras.utils import to_categorical
class Agent:
def __init__(self, env: gym.Env):
self.env = env
self.num_obersvatio... | true | true |
1c2f162efea13b0be77e2364ee076b27e19c6389 | 1,532 | py | Python | jupyter_sparkmonitor/test_jupyter_sparkmonitor.py | hellysmile/initialization-actions | d390a8981716d4cc2d69291ed844de3b229a689e | [
"Apache-2.0"
] | null | null | null | jupyter_sparkmonitor/test_jupyter_sparkmonitor.py | hellysmile/initialization-actions | d390a8981716d4cc2d69291ed844de3b229a689e | [
"Apache-2.0"
] | null | null | null | jupyter_sparkmonitor/test_jupyter_sparkmonitor.py | hellysmile/initialization-actions | d390a8981716d4cc2d69291ed844de3b229a689e | [
"Apache-2.0"
] | null | null | null | import pkg_resources
from absl.testing import absltest
from absl.testing import parameterized
from integration_tests.dataproc_test_case import DataprocTestCase
class JupyterTestCase(DataprocTestCase):
OPTIONAL_COMPONENTS = ["ANACONDA", "JUPYTER"]
COMPONENT = "sparkmonitor"
INIT_ACTIONS = ["jupyter_sparkmonitor... | 32.595745 | 80 | 0.711488 | import pkg_resources
from absl.testing import absltest
from absl.testing import parameterized
from integration_tests.dataproc_test_case import DataprocTestCase
class JupyterTestCase(DataprocTestCase):
OPTIONAL_COMPONENTS = ["ANACONDA", "JUPYTER"]
COMPONENT = "sparkmonitor"
INIT_ACTIONS = ["jupyter_sparkmonitor... | true | true |
1c2f168df79115e9222c2d243fc9f168fa29b3fc | 6,502 | py | Python | PaddleClas/ppcls/arch/backbone/__init__.py | unseenme/mnasnet-paddle-iv | 3bfc38477f1f80e79d35045a3dadef857fc2f4e5 | [
"Apache-2.0"
] | null | null | null | PaddleClas/ppcls/arch/backbone/__init__.py | unseenme/mnasnet-paddle-iv | 3bfc38477f1f80e79d35045a3dadef857fc2f4e5 | [
"Apache-2.0"
] | null | null | null | PaddleClas/ppcls/arch/backbone/__init__.py | unseenme/mnasnet-paddle-iv | 3bfc38477f1f80e79d35045a3dadef857fc2f4e5 | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 84.441558 | 308 | 0.851277 |
import sys
import inspect
from ppcls.arch.backbone.legendary_models.mobilenet_v1 import MobileNetV1_x0_25, MobileNetV1_x0_5, MobileNetV1_x0_75, MobileNetV1
from ppcls.arch.backbone.legendary_models.mobilenet_v3 import MobileNetV3_small_x0_35, MobileNetV3_small_x0_5, MobileNetV3_small_x0_75, MobileNetV3_s... | true | true |
1c2f17169652f1a2e25d41d17d8f7c398981ef1f | 3,546 | py | Python | salt/beacons/log_beacon.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 1 | 2021-09-06T00:14:04.000Z | 2021-09-06T00:14:04.000Z | salt/beacons/log_beacon.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 2 | 2021-04-30T21:17:57.000Z | 2021-12-13T20:40:23.000Z | salt/beacons/log_beacon.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Beacon to fire events at specific log messages.
.. versionadded:: 2017.7.0
"""
# Import Python libs
from __future__ import absolute_import, unicode_literals
import logging
# Import salt libs
import salt.utils.files
import salt.utils.platform
from salt.ext.six.moves import map
try:
... | 24.455172 | 81 | 0.529893 |
from __future__ import absolute_import, unicode_literals
import logging
import salt.utils.files
import salt.utils.platform
from salt.ext.six.moves import map
try:
import re
HAS_REGEX = True
except ImportError:
HAS_REGEX = False
__virtualname__ = "log"
LOC_KEY = "log.loc"
SKEL = {}
SKEL["tag"] = ""... | true | true |
1c2f181ffbe17bdbddf3d9d3184668f45a5503f0 | 1,435 | py | Python | otwstest/conflict/__init__.py | OpenTreeOfLife/test-ot-ws | eee0eeb4150e942bea32e9131d20c01ad9666757 | [
"BSD-2-Clause"
] | null | null | null | otwstest/conflict/__init__.py | OpenTreeOfLife/test-ot-ws | eee0eeb4150e942bea32e9131d20c01ad9666757 | [
"BSD-2-Clause"
] | 4 | 2019-04-10T19:44:00.000Z | 2020-04-21T19:50:29.000Z | otwstest/conflict/__init__.py | OpenTreeOfLife/test-ot-ws | eee0eeb4150e942bea32e9131d20c01ad9666757 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from otwstest import is_str_type, all_api_versions
import otwstest.schema.tnrs as tnrs
from otwstest.schema.taxonomy.taxon import get_ott_id_property
@all_api_versions
def test_conflict_status_synth(outcome): # De... | 41 | 88 | 0.701045 |
import re
from otwstest import is_str_type, all_api_versions
import otwstest.schema.tnrs as tnrs
from otwstest.schema.taxonomy.taxon import get_ott_id_property
@all_api_versions
def test_conflict_status_synth(outcome):
url = outcome.make_url('conflict/conflict-status')
result = outcome.do_http_json(url... | true | true |
1c2f18bdcc169f658acad2c313a665e9715bf886 | 319 | py | Python | src/f2py/importTest.py | friedenhe/idwarp | 76dce98b244810cb32f6abadcd2454fc22074b59 | [
"Apache-2.0"
] | null | null | null | src/f2py/importTest.py | friedenhe/idwarp | 76dce98b244810cb32f6abadcd2454fc22074b59 | [
"Apache-2.0"
] | null | null | null | src/f2py/importTest.py | friedenhe/idwarp | 76dce98b244810cb32f6abadcd2454fc22074b59 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import sys
name = "idwarp"
print("Testing if module %s can be imported..." % name)
import_cmd = "import %s" % name
try:
exec(import_cmd)
except ImportError:
print("Error: idwarp was not imported correctly")
sys.exit(1)
# end try
print("Module %s was successfully imported." % name)
| 21.266667 | 55 | 0.68652 |
import sys
name = "idwarp"
print("Testing if module %s can be imported..." % name)
import_cmd = "import %s" % name
try:
exec(import_cmd)
except ImportError:
print("Error: idwarp was not imported correctly")
sys.exit(1)
print("Module %s was successfully imported." % name)
| true | true |
1c2f18f0f69e93b068f718d5da8b83873e8e44f0 | 336 | py | Python | experiments/jacobi-1d/tmp_files/1959.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/jacobi-1d/tmp_files/1959.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/jacobi-1d/tmp_files/1959.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/jacobi-1d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/jacobi-1d/tmp_files/1959.c')
procedure('kernel_jacobi_1d')
loop(0)
known(' n > 2 ')
tile(0,2,16,2)... | 30.545455 | 118 | 0.764881 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/jacobi-1d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/jacobi-1d/tmp_files/1959.c')
procedure('kernel_jacobi_1d')
loop(0)
known(' n > 2 ')
tile(0,2,16,2)... | true | true |
1c2f1becf02f9bebf5f0826ef7992a68ad8b6b49 | 90 | py | Python | yt/frontends/gizmo/api.py | aemerick/yt | 984484616d75c6d7603e71b9d45c5d617705a0e5 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/gizmo/api.py | aemerick/yt | 984484616d75c6d7603e71b9d45c5d617705a0e5 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/gizmo/api.py | aemerick/yt | 984484616d75c6d7603e71b9d45c5d617705a0e5 | [
"BSD-3-Clause-Clear"
] | null | null | null | from .data_structures import \
GizmoDataset
from .fields import \
GizmoFieldInfo
| 15 | 30 | 0.744444 | from .data_structures import \
GizmoDataset
from .fields import \
GizmoFieldInfo
| true | true |
1c2f1c04218c3c5fef5f3291c23141f001befb38 | 28,125 | py | Python | saleor/lib/python3.7/site-packages/promise/promise.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 2 | 2019-12-06T15:40:14.000Z | 2020-07-29T21:30:35.000Z | saleor/lib/python3.7/site-packages/promise/promise.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | saleor/lib/python3.7/site-packages/promise/promise.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | null | null | null | from collections import namedtuple
from functools import partial, wraps
from sys import version_info, exc_info
from threading import RLock
from types import TracebackType
from six import reraise # type: ignore
from .async_ import Async
from .compat import (
Future,
ensure_future,
iscoroutine, # type: ign... | 33.166274 | 124 | 0.599147 | from collections import namedtuple
from functools import partial, wraps
from sys import version_info, exc_info
from threading import RLock
from types import TracebackType
from six import reraise
from .async_ import Async
from .compat import (
Future,
ensure_future,
iscoroutine,
iterate_promise,
) ... | true | true |
1c2f1d50fcd7c7c1fa85dee0f7e295ced1eeb880 | 881 | py | Python | src/setup.py | skfzyy/twitter-past-crawler | 56c16fe8fd2ac2dc869912f28a55f05ffc63bce5 | [
"MIT"
] | null | null | null | src/setup.py | skfzyy/twitter-past-crawler | 56c16fe8fd2ac2dc869912f28a55f05ffc63bce5 | [
"MIT"
] | null | null | null | src/setup.py | skfzyy/twitter-past-crawler | 56c16fe8fd2ac2dc869912f28a55f05ffc63bce5 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='proxytwitter',
version='0.0.9',
description='A crawler that can crawl and accumulate past tweets without using the official API.',
url='https://github.com/skfzyy/twitter-past-crawler',
author='skfzyy',
license='MIT',
keywords='proxy twitter r... | 21.487805 | 102 | 0.609535 | from setuptools import setup
setup(
name='proxytwitter',
version='0.0.9',
description='A crawler that can crawl and accumulate past tweets without using the official API.',
url='https://github.com/skfzyy/twitter-past-crawler',
author='skfzyy',
license='MIT',
keywords='proxy twitter r... | true | true |
1c2f1d960b752d232d8019234dbb96c9ecfffe4e | 5,738 | py | Python | inspectors/gsa.py | crdunwel/inspectors-general | e2ea3eb978a2819c56ad61df49b541027f377fcd | [
"CC0-1.0"
] | 1 | 2019-06-10T00:33:02.000Z | 2019-06-10T00:33:02.000Z | inspectors/gsa.py | crdunwel/inspectors-general | e2ea3eb978a2819c56ad61df49b541027f377fcd | [
"CC0-1.0"
] | null | null | null | inspectors/gsa.py | crdunwel/inspectors-general | e2ea3eb978a2819c56ad61df49b541027f377fcd | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
from utils import utils, inspector
from bs4 import BeautifulSoup
from datetime import datetime
import re
import logging
# oldest year: 1979
def run(options):
crawl_index(SEMIANNUAL_REPORTS_URL, options)
crawl_index(AUDIT_REPORTS_URL, options, True)
crawl_index(PEER_REVIEW_REPORTS_URL, opt... | 34.987805 | 142 | 0.679157 |
from utils import utils, inspector
from bs4 import BeautifulSoup
from datetime import datetime
import re
import logging
def run(options):
crawl_index(SEMIANNUAL_REPORTS_URL, options)
crawl_index(AUDIT_REPORTS_URL, options, True)
crawl_index(PEER_REVIEW_REPORTS_URL, options)
crawl_index(MISCELLANEOUS_REPORT... | true | true |
1c2f1df2a725c60c51c41657841a45853c5cd7b4 | 1,651 | py | Python | test/test_requests.py | disocord/neis.py | d0dd32bf7238882db65381e39bc6fcd6fae43754 | [
"MIT"
] | 61 | 2020-04-26T03:06:45.000Z | 2022-03-17T02:30:59.000Z | test/test_requests.py | disocord/neis.py | d0dd32bf7238882db65381e39bc6fcd6fae43754 | [
"MIT"
] | 28 | 2020-04-27T05:07:30.000Z | 2021-10-01T12:17:55.000Z | test/test_requests.py | disocord/neis.py | d0dd32bf7238882db65381e39bc6fcd6fae43754 | [
"MIT"
] | 17 | 2020-04-27T03:48:52.000Z | 2022-03-10T04:45:54.000Z | from neispy.sync import SyncNeispy
def test_all(client: SyncNeispy):
scinfo = client.schoolInfo(SCHUL_NM="인천석천초등학교")
AE = scinfo[0].ATPT_OFCDC_SC_CODE # 교육청코드
SE = scinfo[0].SD_SCHUL_CODE # 학교코드
# 학교코드와 교육청 코드로 2019년 1월 22일의 급식 정보 요청
scmeal = client.mealServiceDietInfo(AE, SE, MLSV_YMD="2019012... | 34.395833 | 81 | 0.6808 | from neispy.sync import SyncNeispy
def test_all(client: SyncNeispy):
scinfo = client.schoolInfo(SCHUL_NM="인천석천초등학교")
AE = scinfo[0].ATPT_OFCDC_SC_CODE
SE = scinfo[0].SD_SCHUL_CODE
scmeal = client.mealServiceDietInfo(AE, SE, MLSV_YMD="20190122")
meal = scmeal[0].DDISH_NM.replace("<br/>", ... | true | true |
1c2f1e821c040c09f681ea450138ed0ffaac8cff | 1,537 | py | Python | setup.py | rtmigo/lnkdpn | d63ef55deff5ba408381af04250e97dada0995a0 | [
"BSD-3-Clause"
] | 1 | 2021-03-08T04:18:13.000Z | 2021-03-08T04:18:13.000Z | setup.py | rtmigo/lnkdpn | d63ef55deff5ba408381af04250e97dada0995a0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | rtmigo/lnkdpn | d63ef55deff5ba408381af04250e97dada0995a0 | [
"BSD-3-Clause"
] | null | null | null | from importlib.machinery import SourceFileLoader
from pathlib import Path
from setuptools import setup, find_packages
ver = SourceFileLoader('ver', 'depz/x00_version.py').load_module()
# transform GitHub spoilers into markdown
setup(
name="depz",
version=ver.__version__,
author="Art Galkin",
author_email="... | 27.446429 | 97 | 0.688354 | from importlib.machinery import SourceFileLoader
from pathlib import Path
from setuptools import setup, find_packages
ver = SourceFileLoader('ver', 'depz/x00_version.py').load_module()
setup(
name="depz",
version=ver.__version__,
author="Art Galkin",
author_email="ortemeo@gmail.com",
url='https://github... | true | true |
1c2f1f0ab3c906ecf4a0f01346cdecbec21f72d9 | 11,698 | py | Python | fury/shaders/tests/test_base.py | sreekarchigurupati/fury | 07ed10123954d3ce3197c45f8ee54a7d4909656d | [
"BSD-3-Clause"
] | null | null | null | fury/shaders/tests/test_base.py | sreekarchigurupati/fury | 07ed10123954d3ce3197c45f8ee54a7d4909656d | [
"BSD-3-Clause"
] | null | null | null | fury/shaders/tests/test_base.py | sreekarchigurupati/fury | 07ed10123954d3ce3197c45f8ee54a7d4909656d | [
"BSD-3-Clause"
] | null | null | null | import os
import pytest
import numpy as np
import numpy.testing as npt
from fury import actor, window
from fury.shaders import (add_shader_callback, attribute_to_actor,
compose_shader, import_fury_shader, load_shader,
load, shader_to_actor, replace_shader_in_actor)
... | 28.812808 | 79 | 0.614977 | import os
import pytest
import numpy as np
import numpy.testing as npt
from fury import actor, window
from fury.shaders import (add_shader_callback, attribute_to_actor,
compose_shader, import_fury_shader, load_shader,
load, shader_to_actor, replace_shader_in_actor)
... | true | true |
1c2f1f30c8c00b5cee84afb83df909994e3ce8fa | 362 | py | Python | array/last_stone_weight.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/last_stone_weight.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/last_stone_weight.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | def last_stone_weight(stones):
while len(stones) > 1:
stones.sort()
if stones[-1] == stones[-2]:
stones.pop()
stones.pop()
else:
last = stones.pop(-2)
stones[-1] -= last
return stones[0] if stones else 0
print(last_stone_weight([2, 7, 4,... | 22.625 | 44 | 0.527624 | def last_stone_weight(stones):
while len(stones) > 1:
stones.sort()
if stones[-1] == stones[-2]:
stones.pop()
stones.pop()
else:
last = stones.pop(-2)
stones[-1] -= last
return stones[0] if stones else 0
print(last_stone_weight([2, 7, 4,... | true | true |
1c2f1fc326d0bfd52e2588be7c8aa9e6e7d62a31 | 6,659 | py | Python | built-in/TensorFlow/Official/cv/image_classification/ResNext50_for_TensorFlow/code/resnext50_train/configs/res50_32bs_1p_host.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/TensorFlow/Official/cv/image_classification/ResNext50_for_TensorFlow/code/resnext50_train/configs/res50_32bs_1p_host.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/TensorFlow/Official/cv/image_classification/ResNext50_for_TensorFlow/code/resnext50_train/configs/res50_32bs_1p_host.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # coding=utf-8
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 45.609589 | 169 | 0.517946 |
import tensorflow as tf
import os
log_dir = './resnet50_train/results/'+os.path.basename(__file__).split('.')[0]
config = {
'accelerator': '1980',
'shuffle_enable': 'yes',
'shuffle_buffer_size': 10000,
'rank_size': 1,
'shard': False,
'mode':'train',... | true | true |
1c2f209df3bd6f54e25cf86519b7e33cd9059853 | 14,351 | py | Python | django/db/migrations/operations/models.py | dnozay/django | 5dcdbe95c749d36072f527e120a8cb463199ae0d | [
"BSD-3-Clause"
] | 1 | 2019-03-26T02:49:39.000Z | 2019-03-26T02:49:39.000Z | django/db/migrations/operations/models.py | dnozay/django | 5dcdbe95c749d36072f527e120a8cb463199ae0d | [
"BSD-3-Clause"
] | null | null | null | django/db/migrations/operations/models.py | dnozay/django | 5dcdbe95c749d36072f527e120a8cb463199ae0d | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.db.models.options import normalize_together
from django.db.migrations.state import ModelState
from django.db.migrations.operations.base import Operation
from django.utils import six
class CreateModel(Operation):
"""
Create a mod... | 39.863889 | 119 | 0.656122 | from __future__ import unicode_literals
from django.db import models
from django.db.models.options import normalize_together
from django.db.migrations.state import ModelState
from django.db.migrations.operations.base import Operation
from django.utils import six
class CreateModel(Operation):
serialization_expan... | true | true |
1c2f229959a938a1f8c49e23047256c2a1862a08 | 729 | py | Python | priceserver/modules/exchange/__init__.py | Stakedllc/oracle-feeder | d12e465168cecd38eb9a33a736d50d70c2659aa2 | [
"Apache-2.0"
] | null | null | null | priceserver/modules/exchange/__init__.py | Stakedllc/oracle-feeder | d12e465168cecd38eb9a33a736d50d70c2659aa2 | [
"Apache-2.0"
] | null | null | null | priceserver/modules/exchange/__init__.py | Stakedllc/oracle-feeder | d12e465168cecd38eb9a33a736d50d70c2659aa2 | [
"Apache-2.0"
] | null | null | null | import json
class Price:
currency: str
price: str
raw_price: float
dispersion: float
def __init__(self, currency: str, price: float, dispersion: float = 0.0):
self.currency = currency
self.dispersion = dispersion
self.raw_price = price
self.price = format(price, "... | 23.516129 | 79 | 0.599451 | import json
class Price:
currency: str
price: str
raw_price: float
dispersion: float
def __init__(self, currency: str, price: float, dispersion: float = 0.0):
self.currency = currency
self.dispersion = dispersion
self.raw_price = price
self.price = format(price, "... | true | true |
1c2f22d9a76cb912e4e682553caee78afcffd15e | 469 | py | Python | env/Lib/site-packages/plotly/validators/cone/_opacity.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/cone/_opacity.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/cone/_opacity.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="opacity", parent_name="cone", **kwargs):
super(OpacityValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | 33.5 | 76 | 0.63113 | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="opacity", parent_name="cone", **kwargs):
super(OpacityValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | true | true |
1c2f2330481d30ae8177192c0a4d12370917af9b | 15,734 | py | Python | GTSRB/train_watermarked_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | 14 | 2020-11-16T03:57:19.000Z | 2022-03-30T01:44:53.000Z | GTSRB/train_watermarked_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | null | null | null | GTSRB/train_watermarked_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | 5 | 2020-11-16T03:56:00.000Z | 2022-03-19T06:37:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This is the implement of two most important label-inconsistent backdoor attacks, including BadNets [1] and
Blended Attack [2] on MNIST dataset.
Reference:
[1] Badnets: Evaluating backdooring attacks on deep neural networks. IEEE Access 2019.
[2] Targeted Back... | 37.551313 | 176 | 0.65082 |
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as transforms
import gt... | true | true |
1c2f2397e10b6ee71825879c89041f0aa6475ace | 2,128 | py | Python | pvlib/test/test_surfrad.py | sjanzou/pvlib-python | 17751ca69f271891ee83082772b3261138e34dd0 | [
"BSD-3-Clause"
] | null | null | null | pvlib/test/test_surfrad.py | sjanzou/pvlib-python | 17751ca69f271891ee83082772b3261138e34dd0 | [
"BSD-3-Clause"
] | null | null | null | pvlib/test/test_surfrad.py | sjanzou/pvlib-python | 17751ca69f271891ee83082772b3261138e34dd0 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import os
from pandas import Timestamp, DatetimeIndex
from pandas.util.testing import network
from pvlib.iotools import surfrad
test_dir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe())))
testfile = os.path.join(test_dir, '../data/surfrad-slv16001.dat')
network_testfile =... | 32.242424 | 78 | 0.699248 | import inspect
import os
from pandas import Timestamp, DatetimeIndex
from pandas.util.testing import network
from pvlib.iotools import surfrad
test_dir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe())))
testfile = os.path.join(test_dir, '../data/surfrad-slv16001.dat')
network_testfile =... | true | true |
1c2f24ca1f8cf87e4151939c8e28a2b8c430feea | 1,163 | py | Python | Packs/CommonScripts/Scripts/RunPollingCommand/RunPollingCommand_test.py | Gil-nuriel/content | b5237605d24ad915566f96c2cac392b1a93be80a | [
"MIT"
] | 1 | 2021-04-20T07:10:06.000Z | 2021-04-20T07:10:06.000Z | Packs/CommonScripts/Scripts/RunPollingCommand/RunPollingCommand_test.py | Gil-nuriel/content | b5237605d24ad915566f96c2cac392b1a93be80a | [
"MIT"
] | 2 | 2019-09-18T08:11:22.000Z | 2020-11-24T18:50:28.000Z | Packs/CommonScripts/Scripts/RunPollingCommand/RunPollingCommand_test.py | Gil-nuriel/content | b5237605d24ad915566f96c2cac392b1a93be80a | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | import pytest
from RunPollingCommand import prepare_arg_dict
IDS_ARGS = [
# sanity
(
('ids', ['a', 'b', 'c'], None, None),
{'ids': 'a,b,c'},
),
# single ID
(
('ids', 'a', None, None),
{'ids': 'a'},
),
# numeric IDs
(
('ids', [1, 2, 3], None, None... | 24.229167 | 88 | 0.483233 | import pytest
from RunPollingCommand import prepare_arg_dict
IDS_ARGS = [
(
('ids', ['a', 'b', 'c'], None, None),
{'ids': 'a,b,c'},
),
(
('ids', 'a', None, None),
{'ids': 'a'},
),
(
('ids', [1, 2, 3], None, None),
{'ids': '1,2,3'},
... | true | true |
1c2f25b44f7e259e539f14d9e7e009f5c9a4208e | 1,629 | py | Python | views/__init__.py | jftsang/pypew | 238b227493d41d10b7d4da9849f46d40c87039dc | [
"MIT"
] | null | null | null | views/__init__.py | jftsang/pypew | 238b227493d41d10b7d4da9849f46d40c87039dc | [
"MIT"
] | 6 | 2022-01-30T12:55:13.000Z | 2022-03-08T14:47:36.000Z | views/__init__.py | jftsang/pypew | 238b227493d41d10b7d4da9849f46d40c87039dc | [
"MIT"
] | null | null | null | import os
from tempfile import TemporaryDirectory
from traceback import format_exc
import pandas as pd
from flask import (flash, make_response, render_template, send_file)
from forms import UpdateTextsForm
from models import FEASTS_CSV
from utils import logger
from .feast_views import *
from .pew_sheet_views import *... | 25.061538 | 84 | 0.685697 | import os
from tempfile import TemporaryDirectory
from traceback import format_exc
import pandas as pd
from flask import (flash, make_response, render_template, send_file)
from forms import UpdateTextsForm
from models import FEASTS_CSV
from utils import logger
from .feast_views import *
from .pew_sheet_views import *... | true | true |
1c2f25bc1e0474a82211285206167478ae439650 | 3,357 | py | Python | moya/namespaces.py | moyaproject/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 129 | 2015-02-16T12:02:50.000Z | 2021-11-06T00:20:01.000Z | moya/namespaces.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 5 | 2015-02-19T15:56:41.000Z | 2015-09-08T18:58:35.000Z | moya/namespaces.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 14 | 2015-02-19T17:20:34.000Z | 2022-03-28T01:38:09.000Z | from __future__ import unicode_literals
"""XML namespaces"""
admin = "http://moyaproject.com/admin"
auth = "http://moyaproject.com/auth"
blog = "http://moyaproject.com/blog"
comments = "http://moyaproject.com/comments"
db = "http://moyaproject.com/db"
default = "http://moyaproject.com"
email = "http://moyaproject.co... | 34.255102 | 80 | 0.627942 | from __future__ import unicode_literals
admin = "http://moyaproject.com/admin"
auth = "http://moyaproject.com/auth"
blog = "http://moyaproject.com/blog"
comments = "http://moyaproject.com/comments"
db = "http://moyaproject.com/db"
default = "http://moyaproject.com"
email = "http://moyaproject.com/email"
feedback = "... | true | true |
1c2f26f100c28e13893b2f00da4bf3f5f3d16cf2 | 13,557 | py | Python | services/storage/tests/unit/test_rest.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | services/storage/tests/unit/test_rest.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | services/storage/tests/unit/test_rest.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
import json
import os
import sys
from pathlib import Path
from typing import Any, Dict
from urllib.parse import quote
import pytest
import simcore_service_storage.meta
from aiohttp import web
from aiohttp.test_u... | 30.881549 | 172 | 0.651914 |
import json
import os
import sys
from pathlib import Path
from typing import Any, Dict
from urllib.parse import quote
import pytest
import simcore_service_storage.meta
from aiohttp import web
from aiohttp.test_utils import TestClient
from simcore_service_storage.access_layer import AccessRights
from simcore_servic... | true | true |
1c2f2750fa44f2fe21985ee9cadce4bf03d52400 | 6,013 | py | Python | tests/snapshots/test_snapshot.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | 6 | 2021-05-20T16:48:27.000Z | 2022-03-15T15:43:40.000Z | tests/snapshots/test_snapshot.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | 25 | 2021-06-25T13:37:21.000Z | 2022-01-03T15:54:26.000Z | tests/snapshots/test_snapshot.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | null | null | null | import pytest
import os
import tempfile
from copy import deepcopy
import pandas as pd
from pandas.util.testing import assert_frame_equal
from indico_toolkit import ToolkitInputError
from indico_toolkit.snapshots import Snapshot
# TODO: tests for exception handling
def test_instantiation_wo_params(snapshot_csv_path):... | 34.959302 | 87 | 0.729752 | import pytest
import os
import tempfile
from copy import deepcopy
import pandas as pd
from pandas.util.testing import assert_frame_equal
from indico_toolkit import ToolkitInputError
from indico_toolkit.snapshots import Snapshot
def test_instantiation_wo_params(snapshot_csv_path):
snap = Snapshot(snapshot_csv_pa... | true | true |
1c2f2836f7ba4fa41f03b0e014f4625b9574f535 | 6,959 | py | Python | src/oci/core/models/update_instance_shape_config_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/update_instance_shape_config_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/update_instance_shape_config_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 40.225434 | 245 | 0.699813 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class UpdateInstanceShapeConfigDetails(object):
BASELINE_OCPU_UTILIZATION_BASELINE_1_8 = "BASELINE_1_8"
... | true | true |
1c2f2892c020fb625b3bc82f8a9c4d88de484d6c | 919 | py | Python | wave2.0/division2B/hw1/A_interactor.py | stanislav-kudriavtsev/Yandex-Algorithms-Training | 0ad882e04847f6c2a973716a419befb21aa1df20 | [
"CC0-1.0"
] | null | null | null | wave2.0/division2B/hw1/A_interactor.py | stanislav-kudriavtsev/Yandex-Algorithms-Training | 0ad882e04847f6c2a973716a419befb21aa1df20 | [
"CC0-1.0"
] | null | null | null | wave2.0/division2B/hw1/A_interactor.py | stanislav-kudriavtsev/Yandex-Algorithms-Training | 0ad882e04847f6c2a973716a419befb21aa1df20 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""https://contest.yandex.ru/contest/28730/problems/A/"""
# pylint: disable=invalid-name
# pylint: disable=too-many-return-statements
def solve(ret: int, inter: int, check: int) -> int:
"""
Return the final decision.
Parameters
----------
return_co... | 19.145833 | 71 | 0.526659 |
def solve(ret: int, inter: int, check: int) -> int:
if inter == 0:
if ret:
return 3
return check
if inter == 1:
return check
if inter == 4:
if ret:
return 3
return 4
if inter == 6:
return 0
if inter == 7:
return ... | true | true |
1c2f28df8e9b7f3a8f79ee73f179528d1523295b | 2,172 | py | Python | paper2remarkable/providers/tandfonline.py | hukkelas/paper2remarkable | acc63b4b7328413f41f791caca2a611762f4f3b7 | [
"MIT"
] | null | null | null | paper2remarkable/providers/tandfonline.py | hukkelas/paper2remarkable | acc63b4b7328413f41f791caca2a611762f4f3b7 | [
"MIT"
] | null | null | null | paper2remarkable/providers/tandfonline.py | hukkelas/paper2remarkable | acc63b4b7328413f41f791caca2a611762f4f3b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Provider for Taylor and Francis Online
Author: G.J.J. van den Burg
License: See LICENSE file
Copyright: 2020, G.J.J. van den Burg
"""
import re
from ._base import Provider
from ._info import Informer
from ..exceptions import URLResolutionError
from ..log import Logger
logger = Logger()
... | 28.96 | 91 | 0.587477 |
import re
from ._base import Provider
from ._info import Informer
from ..exceptions import URLResolutionError
from ..log import Logger
logger = Logger()
class TandFOnlineInformer(Informer):
meta_title_key = "dc.Title"
meta_author_key = "dc.Creator"
meta_date_key = "dc.Date"
def _format_authors(s... | true | true |
1c2f291af7d0a5541bcac4ca900ac1d3d7c23f0b | 7,067 | py | Python | python/handwritten_baseline/pipeline/model/feature_extr/tfidf.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 10 | 2020-11-28T05:01:04.000Z | 2021-12-21T19:34:00.000Z | python/handwritten_baseline/pipeline/model/feature_extr/tfidf.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 1 | 2022-03-12T07:20:39.000Z | 2022-03-16T05:11:38.000Z | python/handwritten_baseline/pipeline/model/feature_extr/tfidf.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 1 | 2021-12-21T19:34:08.000Z | 2021-12-21T19:34:08.000Z | import pprint
from typing import Optional, List, Tuple, Set, Any, Dict
import numpy as np
from overrides import overrides
from sklearn.feature_extraction.text import TfidfVectorizer
from python import TOKEN, DOCUMENT_ID, SENTENCE_IDX
from python.handwritten_baseline import LEMMA
from python.handwritten_baseline.pipel... | 50.120567 | 137 | 0.685015 | import pprint
from typing import Optional, List, Tuple, Set, Any, Dict
import numpy as np
from overrides import overrides
from sklearn.feature_extraction.text import TfidfVectorizer
from python import TOKEN, DOCUMENT_ID, SENTENCE_IDX
from python.handwritten_baseline import LEMMA
from python.handwritten_baseline.pipel... | true | true |
1c2f2958c02a6c73b748d3b9c3776bf0c674cd1e | 1,333 | py | Python | setup.py | evildmp/facts | bcfb0ce33cf70f208d3db3abe1bc2969ef468f01 | [
"MIT"
] | 1 | 2015-07-20T10:40:25.000Z | 2015-07-20T10:40:25.000Z | setup.py | evildmp/facts | bcfb0ce33cf70f208d3db3abe1bc2969ef468f01 | [
"MIT"
] | null | null | null | setup.py | evildmp/facts | bcfb0ce33cf70f208d3db3abe1bc2969ef468f01 | [
"MIT"
] | null | null | null | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = 'facts',
version ... | 32.512195 | 78 | 0.629407 | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = 'facts',
version = '0.0.1',
description='A simple fac... | true | true |
1c2f296504fafdd4718d57268a30f1951299cc1b | 133 | py | Python | dynamo/__init__.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | 4 | 2016-01-05T21:18:17.000Z | 2018-07-02T23:19:26.000Z | dynamo/__init__.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | null | null | null | dynamo/__init__.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | 3 | 2015-06-27T15:36:01.000Z | 2021-12-13T18:20:33.000Z |
# import dynamo signals to make sure that they are connected for use by
# other apps
from dynamo.signals import *
version = '0.25'
| 19 | 71 | 0.744361 |
from dynamo.signals import *
version = '0.25'
| true | true |
1c2f2988c850ffb00fb533c65656e4736c3f8c50 | 5,055 | py | Python | tests/test_coordinates/test_velocity_transform.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | 2 | 2019-04-07T04:01:57.000Z | 2019-07-11T11:59:55.000Z | tests/test_coordinates/test_velocity_transform.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | tests/test_coordinates/test_velocity_transform.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | import sys
from io import StringIO
from unittest import mock
import astropy.units as u
import numpy as np
import pytest
from numpy.testing import assert_allclose
from einsteinpy import coordinates
@pytest.fixture()
def cartesian_differential():
return coordinates.CartesianDifferential(
10 / np.sqrt(2) *... | 29.051724 | 88 | 0.699308 | import sys
from io import StringIO
from unittest import mock
import astropy.units as u
import numpy as np
import pytest
from numpy.testing import assert_allclose
from einsteinpy import coordinates
@pytest.fixture()
def cartesian_differential():
return coordinates.CartesianDifferential(
10 / np.sqrt(2) *... | true | true |
1c2f2afdfe1c155e69711d6df88d944adfbce20b | 110 | py | Python | src/python/services/api/schemas/common/base.py | benlague/CS411 | afff0affb0a353c4fd14b6229dd83ef5ab7520aa | [
"MIT"
] | 4 | 2021-12-10T20:30:22.000Z | 2022-01-06T17:08:20.000Z | fastlane_web/web_api/schemas/common/base.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | fastlane_web/web_api/schemas/common/base.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | from marshmallow import Schema, EXCLUDE
class BaseSchema(Schema):
class Meta:
unknown = EXCLUDE
| 15.714286 | 39 | 0.709091 | from marshmallow import Schema, EXCLUDE
class BaseSchema(Schema):
class Meta:
unknown = EXCLUDE
| true | true |
1c2f2b4d69afab3f7b372e60201f16a6f9e5216d | 30,580 | py | Python | saleor/graphql/checkout/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 8 | 2018-07-17T13:13:21.000Z | 2022-03-01T17:02:34.000Z | saleor/graphql/checkout/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 1 | 2021-03-10T07:55:59.000Z | 2021-03-10T07:55:59.000Z | saleor/graphql/checkout/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | null | null | null | from typing import List, Optional, Tuple
import graphene
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import transaction
from django.utils import timezone
from ...checkout import models
from ...checkout.error_codes import CheckoutErrorCode
from... | 36.018846 | 88 | 0.643165 | from typing import List, Optional, Tuple
import graphene
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import transaction
from django.utils import timezone
from ...checkout import models
from ...checkout.error_codes import CheckoutErrorCode
from... | true | true |
1c2f2bcadeab8e03b1eced3d3248600da24dceb3 | 254 | py | Python | spider/__init__.py | CCYYGO/PSpider | 5978fdfeecdbcb449f562194c91913ece3f12035 | [
"BSD-2-Clause"
] | 1 | 2019-12-24T04:28:10.000Z | 2019-12-24T04:28:10.000Z | spider/__init__.py | CCYYGO/PSpider | 5978fdfeecdbcb449f562194c91913ece3f12035 | [
"BSD-2-Clause"
] | null | null | null | spider/__init__.py | CCYYGO/PSpider | 5978fdfeecdbcb449f562194c91913ece3f12035 | [
"BSD-2-Clause"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
define WebSpider, and also define utilities and instances for web_spider
"""
__version__ = "2.5.3"
from .utilities import *
from .concurrent import TPEnum, WebSpider
from .instances import Fetcher, Parser, Saver, Proxieser
| 21.166667 | 72 | 0.748031 |
__version__ = "2.5.3"
from .utilities import *
from .concurrent import TPEnum, WebSpider
from .instances import Fetcher, Parser, Saver, Proxieser
| true | true |
1c2f2dc160dc28e6805357962b8f8d9df566c32e | 1,416 | py | Python | src/stack/python/test_stack.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | src/stack/python/test_stack.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | src/stack/python/test_stack.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#################################################
""" test_stack.py
# # Test for Stack(LIFO) Implementation
# Tests:
# - Capacity, size.
# - Push, Pop, Peek.
# - Delete_mid.
"""
#################################################
# ### Author: Samyuel Danyo
# ### Date: 02/06/2020
... | 30.782609 | 72 | 0.531073 | true | true | |
1c2f2dff5e72218d9f9d7885c6a6a23e047231d4 | 1,345 | py | Python | hyperparams.py | kotsonis/banana-DDQN_RL | 7c7abd771e2758cff178ce65dc6f3afcbb35805a | [
"MIT"
] | null | null | null | hyperparams.py | kotsonis/banana-DDQN_RL | 7c7abd771e2758cff178ce65dc6f3afcbb35805a | [
"MIT"
] | null | null | null | hyperparams.py | kotsonis/banana-DDQN_RL | 7c7abd771e2758cff178ce65dc6f3afcbb35805a | [
"MIT"
] | null | null | null | std_learn_params = {
# Unity Environment parameters
"banana_location": "./Banana_Windows_x86_64/Banana.exe",
# MDP learning parameters
"n_episodes": 2000, # maximum episodes to train on
"max_t":1000, # maximum scenes in an episodic training
"eps_start":0.975, # s... | 51.730769 | 108 | 0.572491 | std_learn_params = {
"banana_location": "./Banana_Windows_x86_64/Banana.exe",
"n_episodes": 2000,
"max_t":1000,
"eps_start":0.975,
"eps_end":0.05,
"eps_decay":0.99,
'early_stop': 13,
"gamma": 1, ... | true | true |
1c2f2f3f821253be8de0a4ac64cc0e7883dd55ee | 10,787 | py | Python | tests/test_functions.py | vrthra/PyVM | 61fdf22533aceea2cc1f463f7cdbbc13eda6ff25 | [
"MIT"
] | null | null | null | tests/test_functions.py | vrthra/PyVM | 61fdf22533aceea2cc1f463f7cdbbc13eda6ff25 | [
"MIT"
] | null | null | null | tests/test_functions.py | vrthra/PyVM | 61fdf22533aceea2cc1f463f7cdbbc13eda6ff25 | [
"MIT"
] | null | null | null | """Test functions etc, for Bytevm."""
from __future__ import print_function
from . import vmtest
import six
PY3 = six.PY3
class TestFunctions(vmtest.VmTestCase):
def test_functions(self):
self.assert_ok("""\
def fn(a, b=17, c="Hello", d=[]):
d.append(99)
print... | 27.103015 | 82 | 0.370539 |
from __future__ import print_function
from . import vmtest
import six
PY3 = six.PY3
class TestFunctions(vmtest.VmTestCase):
def test_functions(self):
self.assert_ok("""\
def fn(a, b=17, c="Hello", d=[]):
d.append(99)
print(a, b, c, d)
fn(1)
... | true | true |
1c2f304c2cdde31005f56751f34965b6155440a8 | 1,341 | py | Python | dataset.py | ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning | 73c5dbd8a272a534cc0af455a9f61567dc67fb66 | [
"MIT"
] | 29 | 2020-09-14T22:34:25.000Z | 2022-03-26T18:59:26.000Z | dataset.py | ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning | 73c5dbd8a272a534cc0af455a9f61567dc67fb66 | [
"MIT"
] | 1 | 2020-10-16T07:25:21.000Z | 2020-10-31T01:37:45.000Z | dataset.py | ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning | 73c5dbd8a272a534cc0af455a9f61567dc67fb66 | [
"MIT"
] | 7 | 2020-09-28T08:45:41.000Z | 2021-09-23T09:02:44.000Z | import torch
import os
import numpy as np
import random
from librosa import load
def read(data, normalize=False, sr=16000):
data, sr = load(data, sr=sr)
if normalize:
data /= np.abs(data).max()
return data, sr
class SpeechDataset(torch.utils.data.Dataset):
def __init__(self, noisy_path, clean... | 31.928571 | 77 | 0.635347 | import torch
import os
import numpy as np
import random
from librosa import load
def read(data, normalize=False, sr=16000):
data, sr = load(data, sr=sr)
if normalize:
data /= np.abs(data).max()
return data, sr
class SpeechDataset(torch.utils.data.Dataset):
def __init__(self, noisy_path, clean... | true | true |
1c2f33edbb6f8768974ca054915c523175e95c05 | 2,563 | py | Python | quart/utils.py | SmartManoj/quart | 317562ea660edb7159efc20fa57b95223d408ea0 | [
"MIT"
] | 1 | 2020-08-09T19:45:14.000Z | 2020-08-09T19:45:14.000Z | quart/utils.py | SmartManoj/quart | 317562ea660edb7159efc20fa57b95223d408ea0 | [
"MIT"
] | null | null | null | quart/utils.py | SmartManoj/quart | 317562ea660edb7159efc20fa57b95223d408ea0 | [
"MIT"
] | null | null | null | import asyncio
from datetime import datetime, timedelta, timezone
from http.cookies import SimpleCookie
from os import PathLike
from pathlib import Path
from typing import Callable, List, Optional, TYPE_CHECKING, Union
from wsgiref.handlers import format_date_time
from .globals import current_app
from .typing import F... | 32.0375 | 99 | 0.671479 | import asyncio
from datetime import datetime, timedelta, timezone
from http.cookies import SimpleCookie
from os import PathLike
from pathlib import Path
from typing import Callable, List, Optional, TYPE_CHECKING, Union
from wsgiref.handlers import format_date_time
from .globals import current_app
from .typing import F... | true | true |
1c2f3708c08ea5ad6a991257dbb4736fffb2c251 | 843 | py | Python | flask_resty/fields.py | sloria/flask-resty | 6a9a6948289277681c71f2f50b08f8c70fef4e2b | [
"MIT"
] | null | null | null | flask_resty/fields.py | sloria/flask-resty | 6a9a6948289277681c71f2f50b08f8c70fef4e2b | [
"MIT"
] | null | null | null | flask_resty/fields.py | sloria/flask-resty | 6a9a6948289277681c71f2f50b08f8c70fef4e2b | [
"MIT"
] | null | null | null | from marshmallow import fields, ValidationError
import marshmallow.utils
# -----------------------------------------------------------------------------
class RelatedItem(fields.Nested):
def _deserialize(self, value, attr, data):
if self.many and not marshmallow.utils.is_collection(value):
se... | 38.318182 | 79 | 0.623962 | from marshmallow import fields, ValidationError
import marshmallow.utils
class RelatedItem(fields.Nested):
def _deserialize(self, value, attr, data):
if self.many and not marshmallow.utils.is_collection(value):
self.fail('type', input=value, type=value.__class__.__name__)
d... | true | true |
1c2f3768d54c480684ca5f4e4efefe9e576b4ae4 | 405 | py | Python | expensetracker/asgi.py | Aasess/ExpenseTracker | 9feb83b2b66d5d87a994bf6997d9cc33ca6ec066 | [
"MIT"
] | 9 | 2020-06-23T05:55:30.000Z | 2020-07-09T10:07:25.000Z | expensetracker/asgi.py | Aasess/ExpenseTracker | 9feb83b2b66d5d87a994bf6997d9cc33ca6ec066 | [
"MIT"
] | 3 | 2020-06-17T16:36:26.000Z | 2021-02-16T06:29:23.000Z | expensetracker/asgi.py | Aasess/ExpenseTracker | 9feb83b2b66d5d87a994bf6997d9cc33ca6ec066 | [
"MIT"
] | 5 | 2020-06-23T03:27:33.000Z | 2020-08-16T19:37:53.000Z | """
ASGI config for expensetracker project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'expensetracker.settings')
application = get_asgi_application()
| true | true |
1c2f379724bd0df6af5464ff9cc000f65cf0265f | 427 | py | Python | projects/serializers.py | Joannsaj/projects | 13d806fa01b8de1053b30b0bcaad937a29694844 | [
"MIT"
] | null | null | null | projects/serializers.py | Joannsaj/projects | 13d806fa01b8de1053b30b0bcaad937a29694844 | [
"MIT"
] | null | null | null | projects/serializers.py | Joannsaj/projects | 13d806fa01b8de1053b30b0bcaad937a29694844 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Profile, Project
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ('profile_pic', 'contact', 'user', 'bio', 'name')
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
mod... | 35.583333 | 94 | 0.676815 | from rest_framework import serializers
from .models import Profile, Project
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ('profile_pic', 'contact', 'user', 'bio', 'name')
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
mod... | true | true |
1c2f37db70dfd7d9a354f7f90a9a0edb627afee5 | 947 | bzl | Python | docs/docs.bzl | Mivik/jflex | 5544d565e8534541056ffdc4d91374a38663c842 | [
"BSD-3-Clause"
] | 486 | 2015-02-15T18:06:12.000Z | 2022-03-28T12:37:00.000Z | docs/docs.bzl | Mivik/jflex | 5544d565e8534541056ffdc4d91374a38663c842 | [
"BSD-3-Clause"
] | 472 | 2015-02-15T06:11:37.000Z | 2022-03-13T21:26:12.000Z | docs/docs.bzl | regisd/jflex | 19fe94f9c72e409945b56971f636ad85506ee77d | [
"BSD-3-Clause"
] | 129 | 2015-03-01T06:24:32.000Z | 2022-03-30T20:51:19.000Z | """Helpers to build the docs."""
load("@bazel_pandoc//:pandoc.bzl", "pandoc")
VERSION = "1.9.0-SNAPSHOT"
RELEASE_DATE = "21 September 2018"
UNICODE_VER = "12.0"
DOC_SECTIONS = [
"intro",
"installing",
"maven-plugin",
"ant-task",
"example",
"lex-specs",
"generated-class",
"encodings"... | 23.675 | 65 | 0.503696 |
load("@bazel_pandoc//:pandoc.bzl", "pandoc")
VERSION = "1.9.0-SNAPSHOT"
RELEASE_DATE = "21 September 2018"
UNICODE_VER = "12.0"
DOC_SECTIONS = [
"intro",
"installing",
"maven-plugin",
"ant-task",
"example",
"lex-specs",
"generated-class",
"encodings",
"performance",
"porting... | true | true |
1c2f38103d50270abb98bbd24bc72fa08347e488 | 2,362 | py | Python | setup.py | tylerhuntington222/biosteam | 234959180a3210d95e39a012454f455723c92686 | [
"MIT"
] | null | null | null | setup.py | tylerhuntington222/biosteam | 234959180a3210d95e39a012454f455723c92686 | [
"MIT"
] | null | null | null | setup.py | tylerhuntington222/biosteam | 234959180a3210d95e39a012454f455723c92686 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
fro... | 43.740741 | 163 | 0.562235 |
from setuptools import setup
setup(
name='biosteam',
packages=['biosteam'],
license='MIT',
version='2.20.9',
description='The Biorefinery Simulation and Techno-Economic Analysis Modules',
long_description=open('README.rst').read(),
author='Yoel Cortes-Pena',
install_requires=['... | true | true |
1c2f390cd745c7857fcea188e21f791aca7da079 | 539 | py | Python | manage.py | alexandre/flask-rest-template | 206729ea7c229c4ff428dc9161d23fb3e1912026 | [
"Unlicense"
] | 77 | 2015-05-18T11:02:28.000Z | 2019-05-30T09:36:52.000Z | manage.py | alexandre-old/flask-rest-template | 206729ea7c229c4ff428dc9161d23fb3e1912026 | [
"Unlicense"
] | 11 | 2015-05-03T22:12:17.000Z | 2018-03-26T13:17:19.000Z | manage.py | alexandre/flask-rest-template | 206729ea7c229c4ff428dc9161d23fb3e1912026 | [
"Unlicense"
] | 21 | 2015-08-20T02:35:13.000Z | 2019-02-26T04:59:01.000Z | #!/usr/bin/env python
import os
from flask.ext.script import Manager, Shell, Server
from app import create_app
from app.extensions import db
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
# access python shell with context
manager.add_command(
"shell",
Shell(make_context=lam... | 20.730769 | 73 | 0.703154 |
import os
from flask.ext.script import Manager, Shell, Server
from app import create_app
from app.extensions import db
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command(
"shell",
Shell(make_context=lambda: {'app': app, 'db': db}), use_ipython=True)
manag... | true | true |
1c2f3a1e9b824f0c633b51319c90a11656c514c8 | 7,825 | py | Python | egs/wsj/s5/steps/nnet3/report/nnet3_log_parse_lib.py | jxzhanggg/kaldi-trunk | 03fbab26e5714a990e1b6dee9475d4a282a42ccc | [
"Apache-2.0"
] | 16 | 2016-05-31T06:53:04.000Z | 2020-02-12T05:23:18.000Z | egs/wsj/s5/steps/nnet3/report/nnet3_log_parse_lib.py | jxzhanggg/kaldi-trunk | 03fbab26e5714a990e1b6dee9475d4a282a42ccc | [
"Apache-2.0"
] | 2 | 2019-02-18T11:54:14.000Z | 2021-12-21T14:48:57.000Z | egs/wsj/s5/steps/nnet3/report/nnet3_log_parse_lib.py | jxzhanggg/kaldi-trunk | 03fbab26e5714a990e1b6dee9475d4a282a42ccc | [
"Apache-2.0"
] | 7 | 2016-08-27T09:28:24.000Z | 2019-12-16T10:30:12.000Z | # Copyright 2016 Vijayaditya Peddinti.
# Apache 2.0.
from __future__ import division
import sys, glob, re, math, datetime, argparse
import imp
ntl = imp.load_source('ntl', 'steps/nnet3/nnet3_train_lib.py')
#exp/nnet3/lstm_self_repair_ld5_sp/log/progress.9.log:component name=Lstm3_i type=SigmoidComponent, dim=1280, s... | 50.160256 | 624 | 0.662364 |
from __future__ import division
import sys, glob, re, math, datetime, argparse
import imp
ntl = imp.load_source('ntl', 'steps/nnet3/nnet3_train_lib.py')
def ParseProgressLogsForNonlinearityStats(exp_dir):
progress_log_files = "%s/log/progress.*.log" % (exp_dir)
stats_per_component_per_iter = {}
progr... | true | true |
1c2f3c6ca70178903816b9e32cbce3f9d96baa46 | 1,893 | py | Python | test/test_memory_unit_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_memory_unit_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_memory_unit_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 49.815789 | 1,052 | 0.777602 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.memory_unit_all_of import MemoryUnitAllOf
from intersight.rest import ApiException
class TestMemoryUnitAllOf(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testMe... | true | true |
1c2f3ca8fc71d788090cc8b3b9b4b65ce270ba1e | 497 | py | Python | datafactory/util/metrics.py | sdsc-bw/pre_processing | df4eea6d9191ecfe0697e00cf5c5990c9a348e58 | [
"MIT"
] | 1 | 2022-01-24T13:45:05.000Z | 2022-01-24T13:45:05.000Z | datafactory/util/metrics.py | sdsc-bw/pre_processing | df4eea6d9191ecfe0697e00cf5c5990c9a348e58 | [
"MIT"
] | 24 | 2021-07-13T09:36:25.000Z | 2022-03-02T15:01:50.000Z | datafactory/util/metrics.py | sdsc-bw/pre_processing | df4eea6d9191ecfe0697e00cf5c5990c9a348e58 | [
"MIT"
] | null | null | null | from sklearn.metrics import f1_score
from .constants import logger
def relative_absolute_error(pred, y):
dis = abs((pred-y)).sum()
dis2 = abs((y.mean() - y)).sum()
if dis2 == 0 :
return 1
return dis/dis2
def get_score(y_pred, y_test, mtype='C'):
if mtype == 'C':
score = f1_sco... | 27.611111 | 60 | 0.617706 | from sklearn.metrics import f1_score
from .constants import logger
def relative_absolute_error(pred, y):
dis = abs((pred-y)).sum()
dis2 = abs((y.mean() - y)).sum()
if dis2 == 0 :
return 1
return dis/dis2
def get_score(y_pred, y_test, mtype='C'):
if mtype == 'C':
score = f1_sco... | true | true |
1c2f3ceb96d4495575d36dcdf147a06a93bc9071 | 9,177 | py | Python | kaleidoscope/transformations.py | andrewasheridan/kaleidoscope | a84ffbec9dda98f438b0e94f1350d6c810031c94 | [
"MIT"
] | 1 | 2020-12-22T16:53:38.000Z | 2020-12-22T16:53:38.000Z | kaleidoscope/transformations.py | andrewasheridan/super-duper-chainsaw | a84ffbec9dda98f438b0e94f1350d6c810031c94 | [
"MIT"
] | null | null | null | kaleidoscope/transformations.py | andrewasheridan/super-duper-chainsaw | a84ffbec9dda98f438b0e94f1350d6c810031c94 | [
"MIT"
] | 1 | 2020-12-22T16:54:00.000Z | 2020-12-22T16:54:00.000Z | # _ __ _ _
# | | / _| | | (_)
# | |_ _ __ __ _ _ __ ___| |_ ___ _ __ _ __ ___ __ _| |_ _ ___ _ __ ___
# | __| '__/ _` | '_ \/ __| _/ _ \| '__| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# | |_| | | (_| | | | \__ \ |... | 33.370909 | 120 | 0.610875 |
# | |_| | | (_| | | | \__ \ || (_) | | | | | | | | (_| | |_| | (_) | | | \__ \
# \__|_| \__,_|_| |_|___/_| \___/|_| |_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
import cv2
import numpy as np
import random
def random_square_crop_with_resize(
image, new_side_len=400, interpolation=cv2.INTER_LANCZOS4
):
... | true | true |
1c2f3d678fa05dc788e74d46380faf513e8b1297 | 5,714 | py | Python | src/04_visualization/licence_vis_synthesis.py | aakanksha023/EVAN | 981327e4e8c408144b409f1e39f207ad96376c2d | [
"MIT"
] | null | null | null | src/04_visualization/licence_vis_synthesis.py | aakanksha023/EVAN | 981327e4e8c408144b409f1e39f207ad96376c2d | [
"MIT"
] | null | null | null | src/04_visualization/licence_vis_synthesis.py | aakanksha023/EVAN | 981327e4e8c408144b409f1e39f207ad96376c2d | [
"MIT"
] | null | null | null | # author: Jasmine Qin
# date: 2020-06-09
"""
This script performs data wrangling and synthesizing needed for
visualization of the business licence file.
Usage: src/04_visualization/licence_vis_synthesis.py
"""
# load packages
import pandas as pd
import json
import re
from joblib import load
import warnings
warnings... | 33.22093 | 81 | 0.611481 |
import pandas as pd
import json
import re
from joblib import load
import warnings
warnings.filterwarnings("ignore")
def main():
licence_df = pd.read_csv(
"data/processed/03_cleaned_combined_licences.csv",
low_memory=False)
parking = pd.read_csv(
"data/raw/parking-meters.csv... | true | true |
1c2f3d6980edffcca618a76d1dba702fda36f9cb | 6,030 | py | Python | pyamg/krylov/_bicgstab.py | isuruf/pyamg | 9f831a4c49762983bd7d3d9adeaa3738ba79ff4e | [
"MIT"
] | null | null | null | pyamg/krylov/_bicgstab.py | isuruf/pyamg | 9f831a4c49762983bd7d3d9adeaa3738ba79ff4e | [
"MIT"
] | 1 | 2019-12-06T17:06:29.000Z | 2019-12-06T17:06:29.000Z | pyamg/krylov/_bicgstab.py | lexeyV/pyamg | cabbb008fa26d4c9d8c24decf06374185864c88b | [
"MIT"
] | null | null | null | import numpy as np
from scipy.sparse.linalg.isolve.utils import make_system
from pyamg.util.linalg import norm
__all__ = ['bicgstab']
def bicgstab(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None,
callback=None, residuals=None):
"""Biconjugate Gradient Algorithm with Stabilization.
So... | 30.301508 | 75 | 0.567496 | import numpy as np
from scipy.sparse.linalg.isolve.utils import make_system
from pyamg.util.linalg import norm
__all__ = ['bicgstab']
def bicgstab(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None,
callback=None, residuals=None):
A, M, x, b, postprocess = make_system(A, M, x0, b)
... | true | true |
1c2f3e20153ac6c97651d529554e861b3d977580 | 899 | py | Python | lib/surface/spanner/operations/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/spanner/operations/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/spanner/operations/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2016 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 33.296296 | 74 | 0.765295 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Operations(base.Group):
pass
| true | true |
1c2f3ec69e5661d66eaf27f41fb089bf715ab8cc | 21,579 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | openapi-env-ppe/azure-sdk-for-python | 93c10270978f1d8c9d3728609866a8408c437630 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | openapi-env-ppe/azure-sdk-for-python | 93c10270978f1d8c9d3728609866a8408c437630 | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | test-repo-tih/azure-sdk-for-python | 18bc3d8e57339ed6a444e38dd5cb3574cc5f9c69 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import ( # pylint: disable=unused-import
Union,
Optional,
Any,
List,
Dict,
TYPE_CHECKING
)
from azure.core.tracing.d... | 52.249395 | 118 | 0.667269 |
from typing import (
Union,
Optional,
Any,
List,
Dict,
TYPE_CHECKING
)
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.exceptions import HttpResponseError
from ._base_client_async import AsyncTextAnalyticsClientBase
from .._request_handlers import _... | true | true |
1c2f3ed030714ef125b6db7b53b582104d5a5c35 | 221 | py | Python | setup.py | Golden-Retrieval/AI-Vision | eab471fe40ce17178e2eebdb7f41666229e85873 | [
"Unlicense"
] | 64 | 2018-12-17T04:35:36.000Z | 2019-04-07T04:58:17.000Z | setup.py | Golden-Retrieval/AI-Vision | eab471fe40ce17178e2eebdb7f41666229e85873 | [
"Unlicense"
] | 307 | 2018-12-20T06:46:24.000Z | 2019-04-09T04:38:35.000Z | setup.py | Golden-Retrieval/AI-Vision | eab471fe40ce17178e2eebdb7f41666229e85873 | [
"Unlicense"
] | 47 | 2018-12-30T12:49:43.000Z | 2019-05-06T06:51:44.000Z | #nsml: nsml/ml:cuda9.0-cudnn7-tf-1.11torch0.4keras2.2
from distutils.core import setup
setup(
name='nsml vision hackathon',
version='1.0',
description='nsml vision hackathon',
install_requires=[
]
)
| 18.416667 | 53 | 0.687783 |
from distutils.core import setup
setup(
name='nsml vision hackathon',
version='1.0',
description='nsml vision hackathon',
install_requires=[
]
)
| true | true |
1c2f40240c79b048a674983f13443ad88f30d61c | 54,916 | py | Python | Syntney.py | lotts/Syntney | 926f87937b6bcde679f27a89973cbd6c974c7c9f | [
"MIT"
] | null | null | null | Syntney.py | lotts/Syntney | 926f87937b6bcde679f27a89973cbd6c974c7c9f | [
"MIT"
] | null | null | null | Syntney.py | lotts/Syntney | 926f87937b6bcde679f27a89973cbd6c974c7c9f | [
"MIT"
] | null | null | null | import os
from Bio import SeqIO
import numpy as np
#from colour import Color
import argparse
import subprocess
from subprocess import run, PIPE
from ete3 import *
import shutil
import sys
import tempfile
import re
def check_NCBI_format(fasta_header):
tmp_header = ""
p = re.compile(r'.{0,20}:c?... | 48.59823 | 321 | 0.586059 | import os
from Bio import SeqIO
import numpy as np
import argparse
import subprocess
from subprocess import run, PIPE
from ete3 import *
import shutil
import sys
import tempfile
import re
def check_NCBI_format(fasta_header):
tmp_header = ""
p = re.compile(r'.{0,20}:c?\d*-\d*')
q = re.comp... | true | true |
1c2f4147e9c1a7505fdb20d1f991ede7ff4c2812 | 7,766 | py | Python | F29.BioEntity/WebAPI/biophens_api.py | foundation29org/F29.BioEntity | 531947fb85465f363e63e268b9e3ca17283d76dd | [
"MIT"
] | null | null | null | F29.BioEntity/WebAPI/biophens_api.py | foundation29org/F29.BioEntity | 531947fb85465f363e63e268b9e3ca17283d76dd | [
"MIT"
] | null | null | null | F29.BioEntity/WebAPI/biophens_api.py | foundation29org/F29.BioEntity | 531947fb85465f363e63e268b9e3ca17283d76dd | [
"MIT"
] | null | null | null | from flask import current_app, request, make_response, jsonify
from flask_restplus import Resource
from ._api import *
'''
ALL
'''
@API.route('/diseases/<string:lan>/all')
class diseases_all(Resource):
def get(self, lan):
bio = get_bio_phens(lan)
res = bio.all_conds()
return jsonify(re... | 36.805687 | 152 | 0.631599 | from flask import current_app, request, make_response, jsonify
from flask_restplus import Resource
from ._api import *
@API.route('/diseases/<string:lan>/all')
class diseases_all(Resource):
def get(self, lan):
bio = get_bio_phens(lan)
res = bio.all_conds()
return jsonify(res)
@API.route('... | true | true |
1c2f414d2dae9da8fdc876b9da180bef3242e346 | 1,027 | py | Python | test/num_one_forms_bracket.py | mevangelista-alvarado/NumericalPoissonGrometry- | 76f41be4eb11248c3206b5e371c7aa9eb9d73b44 | [
"MIT"
] | 7 | 2020-10-30T22:49:49.000Z | 2021-07-15T20:56:13.000Z | test/num_one_forms_bracket.py | mevangelista-alvarado/NumericalPoissonGrometry- | 76f41be4eb11248c3206b5e371c7aa9eb9d73b44 | [
"MIT"
] | 2 | 2020-11-13T19:01:28.000Z | 2021-03-24T04:55:34.000Z | test/num_one_forms_bracket.py | mevangelista-alvarado/NumericalPoissonGrometry- | 76f41be4eb11248c3206b5e371c7aa9eb9d73b44 | [
"MIT"
] | 1 | 2021-02-23T05:41:02.000Z | 2021-02-23T05:41:02.000Z | import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry
npg = NumPoissonGeometry(6, 'x')
P = {(1, 4): 1, (2, 5): 1, (3, 6): 1, (5, 6): 'x2**2'}
alpha = {(5,): 1}
beta = {(6,): 1}
num_one_forms_bracket_res = dict()
j = 2
for mesh_path in ['6Qmesh_10... | 31.121212 | 134 | 0.64557 | import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry
npg = NumPoissonGeometry(6, 'x')
P = {(1, 4): 1, (2, 5): 1, (3, 6): 1, (5, 6): 'x2**2'}
alpha = {(5,): 1}
beta = {(6,): 1}
num_one_forms_bracket_res = dict()
j = 2
for mesh_path in ['6Qmesh_10... | true | true |
1c2f41f14f2035b26a2ad8d5b1f03ba69975cbb2 | 905 | py | Python | ad_manager/utils.py | mhulse/django-ad-manager | c1335d2e304e20dd84ad766d57fcccbfbae60dd8 | [
"Apache-2.0"
] | 1 | 2015-11-08T08:58:10.000Z | 2015-11-08T08:58:10.000Z | ad_manager/utils.py | registerguard/django-ad-manager | fb94bc49388f01a95ee4b1065bd4d0589725d048 | [
"Apache-2.0"
] | null | null | null | ad_manager/utils.py | registerguard/django-ad-manager | fb94bc49388f01a95ee4b1065bd4d0589725d048 | [
"Apache-2.0"
] | null | null | null | from django import http
from django.template import loader
from django.template import RequestContext
# https://bitbucket.org/chris1610/satchmo/src/7e5842d3c520/satchmo/apps/satchmo_store/shop/templates/404.html?at=default
def bad_or_missing(request, msg):
"""
Return an HTTP 404 response for a date reque... | 26.617647 | 120 | 0.609945 | from django import http
from django.template import loader
from django.template import RequestContext
def bad_or_missing(request, msg):
if request.is_ajax():
resp = http.HttpResponse()
resp.status_code = 404
resp.content = {
'message': msg
... | true | true |
1c2f421cc5afd3815f6ae661773e0d4e6b555263 | 830 | py | Python | src/y0/cli.py | y0-causal-inference/y0 | 3a84c35c78e79d502570510109fd0dc919ad1bfd | [
"BSD-3-Clause"
] | 8 | 2021-02-09T22:47:11.000Z | 2022-03-29T17:26:52.000Z | src/y0/cli.py | altdeep/y0 | 3e9e8d47b08b51f64216000db31d8f4c0fd388a3 | [
"BSD-3-Clause"
] | 61 | 2021-01-11T20:03:01.000Z | 2022-03-19T20:09:20.000Z | src/y0/cli.py | y0-causal-inference/y0 | 3a84c35c78e79d502570510109fd0dc919ad1bfd | [
"BSD-3-Clause"
] | 4 | 2021-01-12T01:19:36.000Z | 2021-12-01T04:02:20.000Z | # -*- coding: utf-8 -*-
"""Command line interface for :mod:`y0`.
Why does this file exist, and why not put this in ``__main__``? You might be tempted to import things from ``__main__``
later, but that will cause problems--the code will get executed twice:
- When you run ``python3 -m y0`` python will execute``__main_... | 25.151515 | 119 | 0.691566 |
import logging
import click
__all__ = ["main"]
logger = logging.getLogger(__name__)
@click.group()
@click.version_option()
def main():
if __name__ == "__main__":
main()
| true | true |
1c2f4264208bb43bc506d2cfa41c00bf63d87532 | 2,589 | py | Python | python/mediapipe/facemesh.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/mediapipe/facemesh.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/mediapipe/facemesh.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | #!/usr/bin/env python3
# Src: https://google.github.io/mediapipe/solutions/face_mesh#python-solution-api
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_face_mesh = mp.solutions.face_mesh
# For static images:
IMAGE_FILES = []
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radi... | 35.958333 | 81 | 0.71881 |
mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_face_mesh = mp.solutions.face_mesh
IMAGE_FILES = []
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=1)
with mp_face_mesh.FaceMesh(
static_image_mode=True,
max_num_faces=1,
min_detection_confidence=0.5) as face_mesh:
for idx, f... | true | true |
1c2f4272084c82989e16b417f3133fb32a81846e | 1,843 | py | Python | setup.py | pkkid/django-redsocks | 615805c6b99aeedd59a2a66ea3bd25f7b606b968 | [
"MIT"
] | null | null | null | setup.py | pkkid/django-redsocks | 615805c6b99aeedd59a2a66ea3bd25f7b606b968 | [
"MIT"
] | null | null | null | setup.py | pkkid/django-redsocks | 615805c6b99aeedd59a2a66ea3bd25f7b606b968 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup, find_packages
from redsocks import __version__
try:
from pypandoc import convert
except ImportError:
import io
def convert(filename, fmt):
with io.open(filename, encoding='utf-8') as... | 28.796875 | 69 | 0.625068 |
from __future__ import unicode_literals
from setuptools import setup, find_packages
from redsocks import __version__
try:
from pypandoc import convert
except ImportError:
import io
def convert(filename, fmt):
with io.open(filename, encoding='utf-8') as fd:
return fd.read()
DESCRIPTI... | true | true |
1c2f42a28ebb4e804087a5088d68bb37cc17aec5 | 14,991 | py | Python | ds4se/ds/prediction/eval/traceability.py | rmclanton/ds4se | d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2 | [
"Apache-2.0"
] | null | null | null | ds4se/ds/prediction/eval/traceability.py | rmclanton/ds4se | d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2 | [
"Apache-2.0"
] | null | null | null | ds4se/ds/prediction/eval/traceability.py | rmclanton/ds4se | d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/9.0_ds.prediction.eval.traceability.ipynb (unless otherwise specified).
__all__ = ['SupervisedVectorEvaluation', 'ManifoldEntropy']
# Cell
from prg import prg
# Cell
import ds4se as ds
from ....mining.ir import VectorizationType
from ....mining.ir import SimilarityMetr... | 41.071233 | 127 | 0.615169 |
__all__ = ['SupervisedVectorEvaluation', 'ManifoldEntropy']
from prg import prg
import ds4se as ds
from ....mining.ir import VectorizationType
from ....mining.ir import SimilarityMetric
from ....mining.ir import EntropyMetric
from ....mining.ir import DistanceMetric
from ...description.eval.traceability import... | true | true |
1c2f42c274483c6e58fe8b55527b6c91924688b6 | 2,563 | py | Python | dash_mantine_components/Spoiler.py | lenamax2355/dash-mantine-components | f24e48f3e2f88521cf2c14a070384458132a14d8 | [
"MIT"
] | 1 | 2021-12-27T08:14:31.000Z | 2021-12-27T08:14:31.000Z | dash_mantine_components/Spoiler.py | lenamax2355/dash-mantine-components | f24e48f3e2f88521cf2c14a070384458132a14d8 | [
"MIT"
] | null | null | null | dash_mantine_components/Spoiler.py | lenamax2355/dash-mantine-components | f24e48f3e2f88521cf2c14a070384458132a14d8 | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Spoiler(Component):
"""A Spoiler component.
Hide long sections of content under spoiler. For more information, see: https://mantine.dev/core/spoiler/
Keyword arguments:
- children (string; optiona... | 37.691176 | 261 | 0.684354 |
from dash.development.base_component import Component, _explicitize_args
class Spoiler(Component):
@_explicitize_args
def __init__(self, children=None, hideLabel=Component.UNDEFINED, id=Component.UNDEFINED, initialState=Component.UNDEFINED, maxHeight=Component.UNDEFINED, loading_state=Component.UNDEFINED, s... | true | true |
1c2f42dd0b1fe3d10529645039af19067969efa5 | 33,314 | py | Python | web/transiq/supplier/services.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | web/transiq/supplier/services.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | 14 | 2020-06-05T23:06:45.000Z | 2022-03-12T00:00:18.000Z | web/transiq/supplier/services.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import pandas as pd
from django.contrib.auth.models import User
from django.db.models import Count
from api.utils import get_or_none
from authentication.models import Profile
from broker.models import Broker
from driver.models import Driver as d_Driver
from fileupload.models import Owner... | 51.569659 | 129 | 0.617128 | from datetime import datetime
import pandas as pd
from django.contrib.auth.models import User
from django.db.models import Count
from api.utils import get_or_none
from authentication.models import Profile
from broker.models import Broker
from driver.models import Driver as d_Driver
from fileupload.models import Owner... | true | true |
1c2f445208e6e280e4e703eb7f963c9f3a32c49b | 855 | py | Python | tests/conftest.py | BNMetrics/fetchme | f33e7368b33d74bc2777ac6d698555fe92e9539b | [
"Apache-2.0"
] | 3 | 2018-05-30T12:38:58.000Z | 2018-10-23T11:30:48.000Z | tests/conftest.py | BNMetrics/fetchme | f33e7368b33d74bc2777ac6d698555fe92e9539b | [
"Apache-2.0"
] | 2 | 2020-09-25T05:36:37.000Z | 2021-06-25T15:22:34.000Z | tests/conftest.py | BNMetrics/fetchme | f33e7368b33d74bc2777ac6d698555fe92e9539b | [
"Apache-2.0"
] | null | null | null | import pytest
import mock
import shutil
from pathlib import Path
@pytest.fixture
def tmp_config(mock_home_dir):
project_dir = Path(__file__).parent.parent
mock_config_path = mock_home_dir / '.fetchmerc'
shutil.copyfile(project_dir / 'cfg/.fetchmerc', mock_config_path)
with open(mock_config_path, 'a... | 23.75 | 77 | 0.575439 | import pytest
import mock
import shutil
from pathlib import Path
@pytest.fixture
def tmp_config(mock_home_dir):
project_dir = Path(__file__).parent.parent
mock_config_path = mock_home_dir / '.fetchmerc'
shutil.copyfile(project_dir / 'cfg/.fetchmerc', mock_config_path)
with open(mock_config_path, 'a... | true | true |
1c2f44848af40cc8407c8c14930e0d336a2f5d87 | 2,490 | py | Python | test/test_hidden.py | Freso/beets | ef7cca4c1205466086c658a9f50cefb09b5da450 | [
"MIT"
] | null | null | null | test/test_hidden.py | Freso/beets | ef7cca4c1205466086c658a9f50cefb09b5da450 | [
"MIT"
] | null | null | null | test/test_hidden.py | Freso/beets | ef7cca4c1205466086c658a9f50cefb09b5da450 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte.
#
# 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 ... | 33.2 | 79 | 0.63494 |
from __future__ import division, absolute_import, print_function
from test._common import unittest
import sys
import tempfile
from beets.util import hidden
import subprocess
import errno
import ctypes
class HiddenFileTest(unittest.TestCase):
def setUp(self):
pass
def test_osx_hidden(... | true | true |
1c2f47059c8e0b8a6d29ebd5ce959f2c94607e78 | 10,674 | py | Python | tests/test_transforms.py | cattidea/PaTTA | 0a50eb9b6459c91e3a488f8772e124c164cb0d75 | [
"MIT"
] | 122 | 2021-03-09T15:45:22.000Z | 2022-03-28T09:25:51.000Z | tests/test_transforms.py | cattidea/PaTTA | 0a50eb9b6459c91e3a488f8772e124c164cb0d75 | [
"MIT"
] | 9 | 2021-03-14T02:46:13.000Z | 2021-11-13T06:59:26.000Z | tests/test_transforms.py | cattidea/PaTTA | 0a50eb9b6459c91e3a488f8772e124c164cb0d75 | [
"MIT"
] | 16 | 2021-03-10T02:39:52.000Z | 2021-11-03T14:32:16.000Z | import cv2
import numpy as np
import paddle
import patta as tta
import pytest
@pytest.mark.parametrize(
"transform",
[
tta.HorizontalFlip(),
tta.VerticalFlip(),
tta.HorizontalShift(shifts=[0.1, 0.2, 0.4]),
tta.VerticalShift(shifts=[0.1, 0.2, 0.4]),
tta.Rotate90(angles=[... | 36.554795 | 120 | 0.55846 | import cv2
import numpy as np
import paddle
import patta as tta
import pytest
@pytest.mark.parametrize(
"transform",
[
tta.HorizontalFlip(),
tta.VerticalFlip(),
tta.HorizontalShift(shifts=[0.1, 0.2, 0.4]),
tta.VerticalShift(shifts=[0.1, 0.2, 0.4]),
tta.Rotate90(angles=[... | true | true |
1c2f474a8aa68e48585c6b0f9ba36c039760f8c8 | 3,830 | py | Python | measure_mate/migrations/0001_initial.py | niche-tester/measure-mate | c3acba57747bcb89fe0c6b9509ec90f04a581506 | [
"MIT"
] | 15 | 2015-12-14T02:20:31.000Z | 2022-01-30T04:36:39.000Z | measure_mate/migrations/0001_initial.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 1,403 | 2017-02-16T01:00:04.000Z | 2022-03-15T21:12:13.000Z | measure_mate/migrations/0001_initial.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 10 | 2015-12-18T01:30:46.000Z | 2022-01-30T04:36:41.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Assessment',
fields=[
('id', models.AutoField(v... | 37.184466 | 135 | 0.536292 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Assessment',
fields=[
('id', models.AutoField(verbose_name='ID', seria... | true | true |
1c2f4903ed0f5a94ab7a56b2b885e62f9d8cc28b | 856 | py | Python | download/Cost-Function-Of-ML/costFunctionExam1.py | chenjian158978/chenjian.github.io | 1742e518d43470aa88690f2f40094859e7d7f261 | [
"Apache-2.0"
] | 3 | 2019-05-06T15:14:43.000Z | 2019-12-23T07:26:52.000Z | download/Cost-Function-Of-ML/costFunctionExam1.py | chenjian158978/chenjian.github.io | 1742e518d43470aa88690f2f40094859e7d7f261 | [
"Apache-2.0"
] | 4 | 2020-02-25T06:39:47.000Z | 2022-02-26T03:22:42.000Z | download/Cost-Function-Of-ML/costFunctionExam1.py | chenjian158978/chenjian.github.io | 1742e518d43470aa88690f2f40094859e7d7f261 | [
"Apache-2.0"
] | 5 | 2017-02-26T09:06:25.000Z | 2019-10-01T17:15:39.000Z | # -*- coding:utf8 -*-
"""
@author: chenjian158978@gmail.com
@date: Tue, May 23 2017
@time: 19:05:20 GMT+8
"""
import matplotlib.pyplot as plt
import numpy as np
def calcu_cost(theta, X, Y):
""" 计算代价函数的值
:param theta: 斜率
:param X: x值
:param Y: y值
:return: J值
"""
m = X.shape[0]
h = ... | 17.469388 | 47 | 0.598131 |
import matplotlib.pyplot as plt
import numpy as np
def calcu_cost(theta, X, Y):
m = X.shape[0]
h = np.dot(X, theta)
return np.dot((h - Y).T, (h - Y)) / (2 * m)
X = np.array([[0, 1, 2, 4]]).T
Y = np.array([[0, 1, 2, 4]]).T
theta = np.array([np.linspace(-2, 4, 101)]).T
J_list = []
for i in range(10... | true | true |
1c2f4905406663f456667777b14afcb3fbbb2224 | 704 | py | Python | question_bank/build-an-array-with-stack-operations/build-an-array-with-stack-operations.py | yatengLG/leetcode-python | 5d48aecb578c86d69835368fad3d9cc21961c226 | [
"Apache-2.0"
] | 9 | 2020-08-12T10:01:00.000Z | 2022-01-05T04:37:48.000Z | question_bank/build-an-array-with-stack-operations/build-an-array-with-stack-operations.py | yatengLG/leetcode-python | 5d48aecb578c86d69835368fad3d9cc21961c226 | [
"Apache-2.0"
] | 1 | 2021-02-16T10:19:31.000Z | 2021-02-16T10:19:31.000Z | question_bank/build-an-array-with-stack-operations/build-an-array-with-stack-operations.py | yatengLG/leetcode-python | 5d48aecb578c86d69835368fad3d9cc21961c226 | [
"Apache-2.0"
] | 4 | 2020-08-12T10:13:31.000Z | 2021-11-05T01:26:58.000Z | # -*- coding: utf-8 -*-
# @Author : LG
"""
执行用时:28 ms, 在所有 Python3 提交中击败了99.57% 的用户
内存消耗:13.4 MB, 在所有 Python3 提交中击败了38.43% 的用户
解题思路:
用下标去查看target元素
见代码注释
"""
class Solution:
def buildArray(self, target: List[int], n: int) -> List[str]:
i = 0
N = len(target)
result = []
for... | 24.275862 | 75 | 0.482955 |
class Solution:
def buildArray(self, target: List[int], n: int) -> List[str]:
i = 0
N = len(target)
result = []
for num in range(1, n+1):
if num == target[i]:
i += 1
result.append('Push')
else:
result.appen... | true | true |
1c2f4971647180e7f5027c908f7a6137bf303b5f | 27,315 | py | Python | mai_version/fold/fold_file_parser.py | joschout/tilde | 1403b50842b83f2edd6b16b1fbe24b9bec2d0048 | [
"Apache-2.0"
] | 16 | 2019-03-06T06:11:33.000Z | 2022-02-07T21:30:25.000Z | mai_version/fold/fold_file_parser.py | joschout/tilde | 1403b50842b83f2edd6b16b1fbe24b9bec2d0048 | [
"Apache-2.0"
] | 4 | 2019-10-08T14:48:23.000Z | 2020-03-26T00:31:57.000Z | mai_version/fold/fold_file_parser.py | krishnangovindraj/tilde | 5243a02d92f375d56ffc49ab8c3d1a87e31e99b9 | [
"Apache-2.0"
] | 4 | 2019-08-14T05:40:47.000Z | 2020-08-05T13:21:16.000Z | import time
from math import sqrt
from statistics import mean, variance
from typing import Set, List, Tuple
from problog.engine import DefaultEngine, GenericEngine
from problog.logic import Constant
from mai_version.classification.classification_helper import get_keys_classifier, do_labeled_examples_get_correctly_cla... | 53.664047 | 157 | 0.646385 | import time
from math import sqrt
from statistics import mean, variance
from typing import Set, List, Tuple
from problog.engine import DefaultEngine, GenericEngine
from problog.logic import Constant
from mai_version.classification.classification_helper import get_keys_classifier, do_labeled_examples_get_correctly_cla... | true | true |
1c2f49a98f4323879a647210d79f92f18591350c | 630 | py | Python | project_name/accounts/views.py | danrobinson/project_template | 192cf2edc811943564dfe7883bd25a8a77950cbc | [
"MIT"
] | 1 | 2017-06-28T06:43:37.000Z | 2017-06-28T06:43:37.000Z | project_name/accounts/views.py | danrobinson/project_template | 192cf2edc811943564dfe7883bd25a8a77950cbc | [
"MIT"
] | null | null | null | project_name/accounts/views.py | danrobinson/project_template | 192cf2edc811943564dfe7883bd25a8a77950cbc | [
"MIT"
] | null | null | null | # Create your views here.
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView, CreateView, UpdateView, DeleteView
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from em... | 35 | 82 | 0.790476 |
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView, CreateView, UpdateView, DeleteView
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from emailusernames.forms import... | true | true |
1c2f49e4ce83fd985358a0b8c4471afa0792dc59 | 2,120 | py | Python | graphbrain/utils/lemmas.py | vishalbelsare/graphbrain | efad1f96dcb616595b13bd4e3ada806862fe7de7 | [
"MIT"
] | 412 | 2016-02-20T12:04:34.000Z | 2022-03-30T21:07:39.000Z | graphbrain/utils/lemmas.py | vishalbelsare/graphbrain | efad1f96dcb616595b13bd4e3ada806862fe7de7 | [
"MIT"
] | 20 | 2018-09-21T13:47:59.000Z | 2021-04-10T04:21:30.000Z | graphbrain/utils/lemmas.py | vishalbelsare/graphbrain | efad1f96dcb616595b13bd4e3ada806862fe7de7 | [
"MIT"
] | 51 | 2017-01-25T17:19:30.000Z | 2022-03-29T07:32:53.000Z | import graphbrain.constants as const
def lemma(hg, atom, same_if_none=False):
"""Returns the lemma of the given atom if it exists, None otherwise.
Keyword argument:
same_if_none -- if False, returns None when lemma does not exist. If True,
returns atom items when lemma does not exist. (default: False... | 29.444444 | 78 | 0.634906 | import graphbrain.constants as const
def lemma(hg, atom, same_if_none=False):
if atom.is_atom():
satom = atom.simplify()
for lemma_edge in hg.search((const.lemma_pred, satom, '*')):
return lemma_edge[2]
if same_if_none:
return atom
else:
return None
def deep_l... | true | true |
1c2f4a8d8e8d18087601f036286b95767fbbc42c | 6,623 | py | Python | var/spack/repos/builtin/packages/py-scipy/package.py | FrankD412/spack | b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-07-30T02:03:30.000Z | 2021-07-30T02:03:30.000Z | var/spack/repos/builtin/packages/py-scipy/package.py | FrankD412/spack | b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13 | 2021-05-12T06:10:02.000Z | 2022-03-25T21:00:29.000Z | var/spack/repos/builtin/packages/py-scipy/package.py | Kerilk/spack | e027942b55407a4a5fe323b93d8e57200c873a43 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import platform
class PyScipy(PythonPackage):
"""SciPy (pronounced "Sigh Pie") is a Scientific Library for Python.
... | 59.666667 | 140 | 0.696965 |
import platform
class PyScipy(PythonPackage):
homepage = "https://www.scipy.org/"
pypi = "scipy/scipy-1.5.4.tar.gz"
git = "https://github.com/scipy/scipy.git"
maintainers = ['adamjstewart']
version('master', branch='master')
version('1.6.3', sha256='a75b014d3294fce26852a9d04ea27b5671d... | true | true |
1c2f4ab76cdcfe10466615eb6c2953691babf2b2 | 377 | py | Python | padinfo/view/closable_embed.py | bitwalk/pad-cogs | 40e4911841d165caf615c7459eb7b0a20aa4cbe1 | [
"MIT"
] | 3 | 2021-04-16T23:47:59.000Z | 2021-09-10T06:00:18.000Z | padinfo/view/closable_embed.py | bitwalk/pad-cogs | 40e4911841d165caf615c7459eb7b0a20aa4cbe1 | [
"MIT"
] | 708 | 2020-10-31T08:02:40.000Z | 2022-03-31T09:39:25.000Z | padinfo/view/closable_embed.py | bitwalk/pad-cogs | 40e4911841d165caf615c7459eb7b0a20aa4cbe1 | [
"MIT"
] | 20 | 2020-11-01T23:11:29.000Z | 2022-02-07T07:04:15.000Z | from padinfo.view.components.view_state_base import ViewStateBase
class ClosableEmbedViewState(ViewStateBase):
def __init__(self, original_author_id, menu_type, raw_query,
color, view_type, props):
super().__init__(original_author_id, menu_type, raw_query)
self.color = color
... | 34.272727 | 66 | 0.710875 | from padinfo.view.components.view_state_base import ViewStateBase
class ClosableEmbedViewState(ViewStateBase):
def __init__(self, original_author_id, menu_type, raw_query,
color, view_type, props):
super().__init__(original_author_id, menu_type, raw_query)
self.color = color
... | true | true |
1c2f4b64da660b7d848a1aa1f2f021cd7fb920cf | 13,758 | py | Python | core/controllers/library.py | aasiffaizal/oppia | 1a8634a435bec10f407e9f3c95f62bd467c5b5f7 | [
"Apache-2.0"
] | 1 | 2021-02-23T04:23:56.000Z | 2021-02-23T04:23:56.000Z | core/controllers/library.py | arpit1912/oppia | 00303a0830e775f8491ec57ac625ed44eafd73a4 | [
"Apache-2.0"
] | null | null | null | core/controllers/library.py | arpit1912/oppia | 00303a0830e775f8491ec57ac625ed44eafd73a4 | [
"Apache-2.0"
] | 1 | 2020-12-09T21:33:49.000Z | 2020-12-09T21:33:49.000Z | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.085227 | 115 | 0.66296 |
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import logging
import string
from constants import constants
from core.controllers import acl_decorators
from core.controllers import base
from core.domain import collection_services
from core.domain import exp_s... | true | true |
1c2f4b85cac45680e581cb5f7f143bbdc49b2354 | 681 | py | Python | SS/p145_postorderTraversal.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | SS/p145_postorderTraversal.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | SS/p145_postorderTraversal.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | from typing import List
import collections
class TreeNode:
def __init__(self, left=None, right=None, val=0) -> None:
self.val = val
self.left = left
self.right = right
class Solution:
def postorderTraversal(self, root: TreeNode) -> List[int]:
if not root:
return []... | 21.967742 | 62 | 0.499266 | from typing import List
import collections
class TreeNode:
def __init__(self, left=None, right=None, val=0) -> None:
self.val = val
self.left = left
self.right = right
class Solution:
def postorderTraversal(self, root: TreeNode) -> List[int]:
if not root:
return []... | true | true |
1c2f4ca5ce1f0579712660b8f09e0d19ed6634aa | 31,286 | py | Python | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | Xinyue-Wang/azure-cli | 35d5702039d21247712eeedfdbe8f128f5f90fa3 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | Xinyue-Wang/azure-cli | 35d5702039d21247712eeedfdbe8f128f5f90fa3 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | Xinyue-Wang/azure-cli | 35d5702039d21247712eeedfdbe8f128f5f90fa3 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 50.871545 | 138 | 0.740555 |
import unittest
from unittest import mock
from azure.cli.command_modules.appservice.static_sites import \
list_staticsites, show_staticsite, delete_staticsite, create_staticsites, CLIError, disconnect_staticsite, \
reconnect_staticsite, list_staticsite_environments, show_staticsite_environment, list_static... | true | true |
1c2f4d74c7cdd282900ad475bba9d5debd255c19 | 1,809 | py | Python | tensorflow/python/eager/tensor.py | SWMaestro8th/tensorflow | 084d29e67a72e369958c18ae6abfe2752fcddcbf | [
"Apache-2.0"
] | 5 | 2021-01-11T01:51:57.000Z | 2021-12-11T17:19:08.000Z | tensorflow/python/eager/tensor.py | SWMaestro8th/tensorflow | 084d29e67a72e369958c18ae6abfe2752fcddcbf | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/tensor.py | SWMaestro8th/tensorflow | 084d29e67a72e369958c18ae6abfe2752fcddcbf | [
"Apache-2.0"
] | 3 | 2020-07-02T13:46:32.000Z | 2021-01-11T01:52:01.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.303571 | 80 | 0.726921 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework.ops import _tensor_from_handle
from tensorflow.python.framework.ops import convert_n_to_eager_tensor
from tensorflow.python.framework.ops i... | true | true |
1c2f4f06d496fb200aa0f3fdf76cf1b97fd86cff | 485 | py | Python | binary_search_trees/reconstruct_bst.py | maanavshah/coding-interview | 4c842cdbc6870da79684635f379966d1caec2162 | [
"MIT"
] | null | null | null | binary_search_trees/reconstruct_bst.py | maanavshah/coding-interview | 4c842cdbc6870da79684635f379966d1caec2162 | [
"MIT"
] | null | null | null | binary_search_trees/reconstruct_bst.py | maanavshah/coding-interview | 4c842cdbc6870da79684635f379966d1caec2162 | [
"MIT"
] | null | null | null | # O(n^2) time | O(n) space
def reconstructBst(array):
if len(array) == 0:
return None
currValue = array[0]
rightSubTreeIdx = len(array)
for idx in range(1, len(array)):
value = array[idx]
if value >= currValue:
rightSubTreeIdx = idx
break
le... | 26.944444 | 58 | 0.62268 |
def reconstructBst(array):
if len(array) == 0:
return None
currValue = array[0]
rightSubTreeIdx = len(array)
for idx in range(1, len(array)):
value = array[idx]
if value >= currValue:
rightSubTreeIdx = idx
break
leftSubTree = reconstructBst... | true | true |
1c2f4f6962078375353088f4b4bd41164c5cbe9d | 1,066 | py | Python | container-scripts/set-credentials.py | companieshouse/chips-tuxedo-proxy-domain | 3406f0197e8060648e5751eb453fb4601a82ee1c | [
"MIT"
] | null | null | null | container-scripts/set-credentials.py | companieshouse/chips-tuxedo-proxy-domain | 3406f0197e8060648e5751eb453fb4601a82ee1c | [
"MIT"
] | null | null | null | container-scripts/set-credentials.py | companieshouse/chips-tuxedo-proxy-domain | 3406f0197e8060648e5751eb453fb4601a82ee1c | [
"MIT"
] | null | null | null |
domain_name = os.environ.get("DOMAIN_NAME", "wldomain")
admin_name = os.environ.get("ADMIN_NAME", "wladmin")
admin_pass = os.environ.get("ADMIN_PASSWORD")
domain_path = '/apps/oracle/%s' % domain_name
domain_credential = os.environ.get("DOMAIN_CREDENTIAL", "domain_credential")
ldap_credential = os.environ.get("... | 28.810811 | 77 | 0.718574 |
domain_name = os.environ.get("DOMAIN_NAME", "wldomain")
admin_name = os.environ.get("ADMIN_NAME", "wladmin")
admin_pass = os.environ.get("ADMIN_PASSWORD")
domain_path = '/apps/oracle/%s' % domain_name
domain_credential = os.environ.get("DOMAIN_CREDENTIAL", "domain_credential")
ldap_credential = os.environ.get("... | true | true |
1c2f512c329b877cdf63760a5622029c361a14bf | 3,397 | py | Python | views.py | audacious-software/Simple-Messaging-Django | 7cdcd700ce828abe9e2bb30c467d510315f2bbd3 | [
"Apache-2.0"
] | null | null | null | views.py | audacious-software/Simple-Messaging-Django | 7cdcd700ce828abe9e2bb30c467d510315f2bbd3 | [
"Apache-2.0"
] | 4 | 2020-06-20T15:42:13.000Z | 2022-02-23T21:28:35.000Z | views.py | audacious-software/Simple-Messaging-Django | 7cdcd700ce828abe9e2bb30c467d510315f2bbd3 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=no-member, line-too-long
import importlib
import json
import arrow
import phonenumbers
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.core.management import call_command
from django.http import Http404, HttpResponse
from django.s... | 34.663265 | 117 | 0.678246 |
import importlib
import json
import arrow
import phonenumbers
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.core.management import call_command
from django.http import Http404, HttpResponse
from django.shortcuts import render
from django.utils i... | true | true |
1c2f51e30a52edf948c881404405939a9de755d9 | 2,180 | py | Python | samples/server/petstore/python-fastapi/src/openapi_server/security_api.py | pgadura/openapi-generator | 3c866fb4a34e86d0ea2fef401a30206d7452bd2a | [
"Apache-2.0"
] | 1 | 2021-06-01T18:55:58.000Z | 2021-06-01T18:55:58.000Z | samples/server/petstore/python-fastapi/src/openapi_server/security_api.py | pgadura/openapi-generator | 3c866fb4a34e86d0ea2fef401a30206d7452bd2a | [
"Apache-2.0"
] | null | null | null | samples/server/petstore/python-fastapi/src/openapi_server/security_api.py | pgadura/openapi-generator | 3c866fb4a34e86d0ea2fef401a30206d7452bd2a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from typing import List
from fastapi import APIRouter, Depends, Response, Security, status
from fastapi.openapi.models import OAuthFlowImplicit, OAuthFlows
from fastapi.security import (
HTTPAuthorizationCredentials,
HTTPBasic,
HTTPBasicCredentials,
HTTPBearer,
OAuth2,
OAuth2Au... | 25.952381 | 122 | 0.698624 |
from typing import List
from fastapi import APIRouter, Depends, Response, Security, status
from fastapi.openapi.models import OAuthFlowImplicit, OAuthFlows
from fastapi.security import (
HTTPAuthorizationCredentials,
HTTPBasic,
HTTPBasicCredentials,
HTTPBearer,
OAuth2,
OAuth2AuthorizationCode... | true | true |
1c2f52c6038e6acd197d60dd2e1f55aea0bdf4e4 | 7,922 | py | Python | homeassistant/components/zha/fan.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/zha/fan.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/zha/fan.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Fans on Zigbee Home Automation networks."""
from __future__ import annotations
from abc import abstractmethod
import functools
import math
from zigpy.exceptions import ZigbeeException
from zigpy.zcl.clusters import hvac
from homeassistant.components.fan import (
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
FanE... | 35.208889 | 96 | 0.686317 | from __future__ import annotations
from abc import abstractmethod
import functools
import math
from zigpy.exceptions import ZigbeeException
from zigpy.zcl.clusters import hvac
from homeassistant.components.fan import (
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
FanEntity,
FanEntityFeature,
NotValidPreset... | true | true |
1c2f55a77d0082d3ba51ac40a1c53a3b253923d4 | 329 | py | Python | exercicios_python_brasil/estrutura_sequencial/16_calculadora_tintas.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_sequencial/16_calculadora_tintas.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_sequencial/16_calculadora_tintas.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | print('\033[1m>>> CALCULADORA DE TINTAS - LOJA ABC <<<\033[m')
area = float(input('ÁREA A SER PINTADA (m²): '))
litros = (area/3)
lata = (litros/18)
preco = lata*80
print('-'*40)
print(f'QUANTIDADE NECESSÁRIA: {litros:.2f} litro(s)')
print(f'LATA (18 LITROS): {lata:.2f} lata(s).')
print(f'VALOR TOTAL: R$ {preco... | 32.9 | 63 | 0.6231 | print('\033[1m>>> CALCULADORA DE TINTAS - LOJA ABC <<<\033[m')
area = float(input('ÁREA A SER PINTADA (m²): '))
litros = (area/3)
lata = (litros/18)
preco = lata*80
print('-'*40)
print(f'QUANTIDADE NECESSÁRIA: {litros:.2f} litro(s)')
print(f'LATA (18 LITROS): {lata:.2f} lata(s).')
print(f'VALOR TOTAL: R$ {preco... | true | true |
1c2f566d1d53012897e74ed2df7f16d2a8991fad | 1,545 | py | Python | setup.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 18 | 2020-11-13T11:54:23.000Z | 2022-03-23T15:25:10.000Z | setup.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 9 | 2020-11-17T07:54:58.000Z | 2022-02-09T23:29:52.000Z | setup.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 7 | 2021-05-06T22:00:39.000Z | 2022-01-31T06:25:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup for the ADS-B Exchange Cursor-on-Target Gateway.
Source:: https://github.com/ampledata/adsbxcot
"""
import os
import sys
import setuptools
__title__ = "adsbxcot"
__version__ = "1.5.0"
__author__ = "Greg Albrecht W2GMD <oss@undef.net>"
__copyright__ = "Copyrig... | 24.52381 | 74 | 0.631068 |
import os
import sys
import setuptools
__title__ = "adsbxcot"
__version__ = "1.5.0"
__author__ = "Greg Albrecht W2GMD <oss@undef.net>"
__copyright__ = "Copyright 2021 Orion Labs, Inc."
__license__ = "Apache License, Version 2.0"
def publish():
if sys.argv[-1] == 'publish':
os.system('python setup.py... | true | true |
1c2f56ff0c6fe054d1c581114ff4f7162b4b35f5 | 5,236 | py | Python | ranksvm.py | jrplatin/NBA-RankSVM | 74bec6cf79bc4554e8a456450d45d892e034a425 | [
"BSD-4-Clause-UC"
] | 1 | 2020-06-23T15:57:30.000Z | 2020-06-23T15:57:30.000Z | ranksvm.py | jrplatin/NBA-RankSVM | 74bec6cf79bc4554e8a456450d45d892e034a425 | [
"BSD-4-Clause-UC"
] | null | null | null | ranksvm.py | jrplatin/NBA-RankSVM | 74bec6cf79bc4554e8a456450d45d892e034a425 | [
"BSD-4-Clause-UC"
] | null | null | null | from sklearn import svm
from itertools import permutations
import numpy as np
from operator import itemgetter
from itertools import combinations
import numpy as np
# Get all permutation pairs out of an array
def get_pairs(arr):
return permutations(arr, 2)
# Transform data to pairs, where label of (x1, x2) is ... | 31.926829 | 110 | 0.618029 | from sklearn import svm
from itertools import permutations
import numpy as np
from operator import itemgetter
from itertools import combinations
import numpy as np
def get_pairs(arr):
return permutations(arr, 2)
def data_to_pairs(X, y):
X_pairs = []
y_pairs = []
pairs = get_pairs(np.arange... | true | true |
1c2f572cc0fd7450967f7d9eb62c73d81cbd22a6 | 19,495 | py | Python | lib/modules/python/situational_awareness/host/osx/HijackScanner.py | terrorizer1980/Empire | 9259e5106986847d2bb770c4289c0c0f1adf2344 | [
"BSD-3-Clause"
] | 49 | 2015-09-02T15:20:09.000Z | 2022-03-05T18:18:23.000Z | lib/modules/python/situational_awareness/host/osx/HijackScanner.py | rmusser01/Empire | c1bdbd0fdafd5bf34760d5b158dfd0db2bb19556 | [
"BSD-3-Clause"
] | 1 | 2020-11-04T08:15:12.000Z | 2020-11-04T08:15:12.000Z | lib/modules/python/situational_awareness/host/osx/HijackScanner.py | InfinitelyFreedom/Empire | 3a922f60d92658fb716efb3be5a1c15074114766 | [
"BSD-3-Clause"
] | 24 | 2015-09-08T11:45:23.000Z | 2022-02-07T23:53:58.000Z | from builtins import object
class Module(object):
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Dylib Hijack Vulnerability Scanner',
... | 31.596434 | 222 | 0.532136 | from builtins import object
class Module(object):
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Dylib Hijack Vulnerability Scanner',
'Author': ['@patrickwardle','@xorrior'],
'Description': ('This modu... | true | true |
1c2f57cef9fb7678921c729910c67d1be947e38b | 756 | py | Python | django_semantic_ui/urls.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | 4 | 2016-05-06T20:52:42.000Z | 2018-11-18T08:29:33.000Z | django_semantic_ui/urls.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | null | null | null | django_semantic_ui/urls.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = (
url(r'^admin/', include(admi... | 54 | 129 | 0.768519 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = (
url(r'^admin/', include(admi... | true | true |
1c2f583b482610b2b4f3242d6c3c16518d744bec | 7,278 | py | Python | models.py | Chianugoogidi/deit | a286bfc817e9e285291ab8b2e9dff277d6447bda | [
"Apache-2.0"
] | null | null | null | models.py | Chianugoogidi/deit | a286bfc817e9e285291ab8b2e9dff277d6447bda | [
"Apache-2.0"
] | null | null | null | models.py | Chianugoogidi/deit | a286bfc817e9e285291ab8b2e9dff277d6447bda | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
__all__ = [
'deit_ti... | 38.919786 | 116 | 0.690849 |
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
__all__ = [
'deit_tiny_patch16_224', 'deit_small_patch16_224', 'deit_base_patch16_224'... | true | true |
1c2f5972b1791976318abf04c19d13a3a96213ae | 5,802 | py | Python | BERT.py | china-zyy/NLP-Tutorials | 3216c5616770af11185a6d6d238cf1e8bda4edd6 | [
"MIT"
] | null | null | null | BERT.py | china-zyy/NLP-Tutorials | 3216c5616770af11185a6d6d238cf1e8bda4edd6 | [
"MIT"
] | 2 | 2021-08-25T16:13:10.000Z | 2022-02-10T02:27:17.000Z | BERT.py | hades12580/NLP-Tutorials | 670160b5a9344b240c90dbaf0e62de3120c6d9e5 | [
"MIT"
] | 1 | 2021-09-23T17:25:21.000Z | 2021-09-23T17:25:21.000Z | # [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/pdf/1810.04805.pdf)
import numpy as np
import tensorflow as tf
import utils
import time
from GPT import GPT
import os
import pickle
class BERT(GPT):
def __init__(self, model_dim, max_len, n_layer, n_head, n_voca... | 40.291667 | 122 | 0.610479 |
import numpy as np
import tensorflow as tf
import utils
import time
from GPT import GPT
import os
import pickle
class BERT(GPT):
def __init__(self, model_dim, max_len, n_layer, n_head, n_vocab, lr, max_seg=3, drop_rate=0.1, padding_idx=0):
super().__init__(model_dim, max_len, n_layer, n_head, n_vocab, lr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.