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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7264187ecb771c3ebeca5e866aa88ceae28828f | 1,923 | py | Python | src/tfchain/polyfill/encoding/ipaddr.py | GlenDC/threefold-wallet-electron | 440662a793d98781eb3bbf415ba8a482abed0288 | [
"MIT"
] | null | null | null | src/tfchain/polyfill/encoding/ipaddr.py | GlenDC/threefold-wallet-electron | 440662a793d98781eb3bbf415ba8a482abed0288 | [
"MIT"
] | 201 | 2019-05-20T15:06:05.000Z | 2019-07-16T12:48:59.000Z | src/tfchain/polyfill/encoding/ipaddr.py | GlenDC/threefold-wallet-electron | 440662a793d98781eb3bbf415ba8a482abed0288 | [
"MIT"
] | 1 | 2019-12-20T21:45:39.000Z | 2019-12-20T21:45:39.000Z | from tfchain.polyfill.encoding.jsmods.ipaddrjs import api as ipaddrjs
import tfchain.polyfill.array as jsarr
class IPAddress:
def __init__(self, value):
if isinstance(value, str):
v = None
err = None
__pragma__("js", "{}", """
try {
v = ipaddr... | 27.869565 | 110 | 0.481019 | from tfchain.polyfill.encoding.jsmods.ipaddrjs import api as ipaddrjs
import tfchain.polyfill.array as jsarr
class IPAddress:
def __init__(self, value):
if isinstance(value, str):
v = None
err = None
__pragma__("js", "{}", """
try {
v = ipaddr... | true | true |
f7264223ea3b2e4a8450d6eba91beec89e57b290 | 15,290 | py | Python | tensorflow/network.py | EricPedley/FCRN-DepthPrediction | 93aaed329e9e071c6d5c5a59e77a73a09684b156 | [
"BSD-2-Clause"
] | null | null | null | tensorflow/network.py | EricPedley/FCRN-DepthPrediction | 93aaed329e9e071c6d5c5a59e77a73a09684b156 | [
"BSD-2-Clause"
] | null | null | null | tensorflow/network.py | EricPedley/FCRN-DepthPrediction | 93aaed329e9e071c6d5c5a59e77a73a09684b156 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
# ----------------------------------------------------------------------------------
# Commonly used layers and operations based on ethereon's implementation
# https://github.com/ethereon/caffe-tensorflow
# Slight modifications may apply. F... | 39.205128 | 133 | 0.548136 | import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
# https://github.com/ethereon/caffe-tensorflow
# Slight modifications may apply. FCRN-specific operations have also been appended.
# ----------------------------------------------------------------------------------
# Thanks to *Helisa Dh... | true | true |
f726433b3c15d6223a75c1dacfab5a53d9b7791b | 350 | py | Python | app/__init__.py | ppyvras/flask_tutorial | 2c73d32c33fb80ef59bee8753500220afdd91cee | [
"MIT"
] | null | null | null | app/__init__.py | ppyvras/flask_tutorial | 2c73d32c33fb80ef59bee8753500220afdd91cee | [
"MIT"
] | null | null | null | app/__init__.py | ppyvras/flask_tutorial | 2c73d32c33fb80ef59bee8753500220afdd91cee | [
"MIT"
] | null | null | null | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
login = LoginManager(app)
login.login_view = 'login'
f... | 20.588235 | 39 | 0.805714 | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
login = LoginManager(app)
login.login_view = 'login'
f... | true | true |
f7264465fb955d98f2220ac0a57a91bd63fff024 | 1,331 | py | Python | xlsxwriter/test/comparison/test_cond_format06.py | eddiechapman/XlsxWriter | c636117ab30e64e4b7b824c9105595c42887c2c9 | [
"BSD-2-Clause-FreeBSD"
] | 2,766 | 2015-01-02T17:36:42.000Z | 2022-03-31T09:23:30.000Z | xlsxwriter/test/comparison/test_cond_format06.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 683 | 2015-01-03T09:55:02.000Z | 2022-03-31T07:18:15.000Z | xlsxwriter/test/comparison/test_cond_format06.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 636 | 2015-01-05T01:57:08.000Z | 2022-03-25T18:42:41.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 26.62 | 88 | 0.496619 | true | true | |
f7264528198aeeae3d454c3855027f09c988ee7a | 1,793 | py | Python | _unittests/ut_special/test_tsp_kohonen.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | _unittests/ut_special/test_tsp_kohonen.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | _unittests/ut_special/test_tsp_kohonen.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | """
@brief test log(time=10s)
"""
import os
import sys
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, is_travis_or_appveyor
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
... | 28.015625 | 72 | 0.591746 | import os
import sys
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, is_travis_or_appveyor
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
... | true | true |
f7264580ec84ba5145f46f58d0d1265932dadf9b | 3,505 | py | Python | parler/tests/test_query_count.py | Yiling-J/django-parler | 23b8ae3348c05d4dded729389cc8129cd03d8c5d | [
"Apache-2.0"
] | 1 | 2020-01-25T05:23:00.000Z | 2020-01-25T05:23:00.000Z | parler/tests/test_query_count.py | Yiling-J/django-parler | 23b8ae3348c05d4dded729389cc8129cd03d8c5d | [
"Apache-2.0"
] | 3 | 2019-11-02T05:52:07.000Z | 2020-06-05T21:56:17.000Z | parler/tests/test_query_count.py | Yiling-J/django-parler | 23b8ae3348c05d4dded729389cc8129cd03d8c5d | [
"Apache-2.0"
] | 2 | 2019-06-10T21:45:05.000Z | 2019-07-10T17:16:35.000Z | import datetime as dt
from django.core.cache import cache
from django.utils import translation
from django.utils.timezone import now
from parler import appsettings
from .utils import AppTestCase, override_parler_settings
from .testapp.models import SimpleModel, DateTimeModel
class QueryCountTests(AppTestCase):
... | 34.029126 | 107 | 0.633666 | import datetime as dt
from django.core.cache import cache
from django.utils import translation
from django.utils.timezone import now
from parler import appsettings
from .utils import AppTestCase, override_parler_settings
from .testapp.models import SimpleModel, DateTimeModel
class QueryCountTests(AppTestCase):
... | true | true |
f72645db2eb553529b0393f9bc851543b325fd14 | 3,880 | py | Python | webots_ros2_universal_robot/webots_ros2_universal_robot/follow_joint_trajectory_client.py | TaoYibo1866/webots_ros2 | a72c164825663cebbfd27e0649ea51d3abf9bbed | [
"Apache-2.0"
] | null | null | null | webots_ros2_universal_robot/webots_ros2_universal_robot/follow_joint_trajectory_client.py | TaoYibo1866/webots_ros2 | a72c164825663cebbfd27e0649ea51d3abf9bbed | [
"Apache-2.0"
] | 6 | 2019-08-09T08:04:37.000Z | 2019-08-14T15:05:35.000Z | webots_ros2_universal_robot/webots_ros2_universal_robot/follow_joint_trajectory_client.py | omichel/webots_ros2 | 5b59d0b1fbeff4c3f75a447bd152c10853f4691b | [
"Apache-2.0"
] | null | null | null | # Copyright 1996-2021 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 40 | 123 | 0.698711 |
from action_msgs.msg import GoalStatus
from control_msgs.action import FollowJointTrajectory
from control_msgs.msg import JointTrajectoryControllerState
from trajectory_msgs.msg import JointTrajectoryPoint
from builtin_interfaces.msg import Duration
import rclpy
from rclpy.action import ActionClient
fro... | true | true |
f726466b10a38e592d89b680d7031e520070c599 | 3,697 | py | Python | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/convert_xlnet_original_tf_checkpoint_to_pytorch.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 12 | 2021-09-13T18:31:09.000Z | 2022-03-31T12:10:28.000Z | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/convert_xlnet_original_tf_checkpoint_to_pytorch.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 5 | 2021-12-01T04:34:07.000Z | 2022-01-28T08:28:18.000Z | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/convert_xlnet_original_tf_checkpoint_to_pytorch.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 3 | 2022-01-18T10:56:05.000Z | 2022-01-28T01:46:43.000Z | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 32.147826 | 117 | 0.712199 |
import argparse
import os
import torch
from transformers import (
CONFIG_NAME,
WEIGHTS_NAME,
XLNetConfig,
XLNetForQuestionAnswering,
XLNetForSequenceClassification,
XLNetLMHeadModel,
load_tf_weights_in_xlnet,
)
from transformers.utils import logging
GLUE_TASKS_NUM_LABELS ... | true | true |
f72646ac93dd6fd9d9c8c4a8152f818f740a9035 | 2,689 | py | Python | tests/test_parsers.py | tos-kamiya/d2vg | 72ce1cb900a219f9d7bc3982e234a4498be52d5a | [
"BSD-2-Clause"
] | 3 | 2021-11-17T08:07:50.000Z | 2021-12-19T04:35:15.000Z | tests/test_parsers.py | tos-kamiya/d2vg | 72ce1cb900a219f9d7bc3982e234a4498be52d5a | [
"BSD-2-Clause"
] | null | null | null | tests/test_parsers.py | tos-kamiya/d2vg | 72ce1cb900a219f9d7bc3982e234a4498be52d5a | [
"BSD-2-Clause"
] | null | null | null | import unittest
from pathlib import Path
import re
import tempfile
import d2vg
class ParserTest(unittest.TestCase):
def test_text_file(self):
with tempfile.TemporaryDirectory() as tempdir:
p = Path(tempdir) / "a.txt"
content = "1st line.\n2nd line.\n"
p.write_text(con... | 34.474359 | 149 | 0.61138 | import unittest
from pathlib import Path
import re
import tempfile
import d2vg
class ParserTest(unittest.TestCase):
def test_text_file(self):
with tempfile.TemporaryDirectory() as tempdir:
p = Path(tempdir) / "a.txt"
content = "1st line.\n2nd line.\n"
p.write_text(con... | true | true |
f72646f0022b7bc1e1b506d20a786c3a402e9a98 | 422 | py | Python | blog/migrations/0008_post_snippet.py | cs130-w21/15 | 3e0bfd3662e930e5b67416939a976029ddad6436 | [
"Apache-2.0"
] | null | null | null | blog/migrations/0008_post_snippet.py | cs130-w21/15 | 3e0bfd3662e930e5b67416939a976029ddad6436 | [
"Apache-2.0"
] | 13 | 2021-01-14T06:09:55.000Z | 2021-03-08T08:56:36.000Z | blog/migrations/0008_post_snippet.py | cs130-w21/15 | 3e0bfd3662e930e5b67416939a976029ddad6436 | [
"Apache-2.0"
] | 1 | 2021-04-07T18:20:21.000Z | 2021-04-07T18:20:21.000Z | # Generated by Django 3.1.5 on 2021-03-05 05:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0007_auto_20210305_0539'),
]
operations = [
migrations.AddField(
model_name='post',
name='snippet',
... | 22.210526 | 92 | 0.606635 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0007_auto_20210305_0539'),
]
operations = [
migrations.AddField(
model_name='post',
name='snippet',
field=models.CharField(default='Click link ... | true | true |
f7264824f603075011c4ae3509f47ec148f2cec0 | 12,224 | py | Python | tests/test_dates.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | tests/test_dates.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | tests/test_dates.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | # coding: utf-8
import pytest
import mock
import workdays
import datetime
import dmutils.dates as dates_package
class TestPublishingDates():
def test_get_publishing_dates_formats_time(self):
with mock.patch('dmutils.dates.datetime') as mock_date:
mock_date.utcnow.return_value = datetime.dateti... | 49.489879 | 115 | 0.641525 |
import pytest
import mock
import workdays
import datetime
import dmutils.dates as dates_package
class TestPublishingDates():
def test_get_publishing_dates_formats_time(self):
with mock.patch('dmutils.dates.datetime') as mock_date:
mock_date.utcnow.return_value = datetime.datetime(2015, 5, 22,... | true | true |
f726488d8cbb6bc2a5748013e73cd7f6e42b06b9 | 20,570 | py | Python | sagemaker-debugger/model_specific_realtime_analysis/bert_attention_head_view/entry_point/data.py | jpmarques19/tensorflwo-test | 0ff8b06e0415075c7269820d080284a42595bb2e | [
"Apache-2.0"
] | 2,327 | 2020-03-01T09:47:34.000Z | 2021-11-25T12:38:42.000Z | sagemaker-debugger/model_specific_realtime_analysis/bert_attention_head_view/entry_point/data.py | jpmarques19/tensorflwo-test | 0ff8b06e0415075c7269820d080284a42595bb2e | [
"Apache-2.0"
] | 209 | 2020-03-01T17:14:12.000Z | 2021-11-08T20:35:42.000Z | sagemaker-debugger/model_specific_realtime_analysis/bert_attention_head_view/entry_point/data.py | jpmarques19/tensorflwo-test | 0ff8b06e0415075c7269820d080284a42595bb2e | [
"Apache-2.0"
] | 686 | 2020-03-03T17:24:51.000Z | 2021-11-25T23:39:12.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and DMLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 38.958333 | 84 | 0.597083 |
import collections
import multiprocessing as mp
import time
from functools import partial
from mxnet.gluon.data import SimpleDataset
from gluonnlp.data.utils import whitespace_splitter
import numpy as np
__all__ = ['SQuADTransform', '\rocess_dataset']
class SquadExample:
def __init__(self,
... | true | true |
f7264918230895dea85690103d818973bdb62a3f | 242 | py | Python | prefect/aircraftlib/__init__.py | andersy005/brouillons-quotidien | 468ebcc3327f96a6eb3a9a26460790c4f34fdc85 | [
"MIT"
] | null | null | null | prefect/aircraftlib/__init__.py | andersy005/brouillons-quotidien | 468ebcc3327f96a6eb3a9a26460790c4f34fdc85 | [
"MIT"
] | null | null | null | prefect/aircraftlib/__init__.py | andersy005/brouillons-quotidien | 468ebcc3327f96a6eb3a9a26460790c4f34fdc85 | [
"MIT"
] | null | null | null | # flake8: noqa
from .analysis import add_airline_info, clean_vector
from .database import Database
from .openflights import fetch_reference_data
from .opensky import fetch_live_aircraft_data
from .position import Area, Position, bounding_box
| 34.571429 | 52 | 0.85124 |
from .analysis import add_airline_info, clean_vector
from .database import Database
from .openflights import fetch_reference_data
from .opensky import fetch_live_aircraft_data
from .position import Area, Position, bounding_box
| true | true |
f726495538536b17d16dcc758c9c8febfb1dc64a | 13,874 | py | Python | official/vision/beta/configs/retinanet.py | melG81/models | d9ed5232648228ad58b9d50e29d8fe3bb6aa7c4a | [
"Apache-2.0"
] | 1 | 2021-05-12T08:34:32.000Z | 2021-05-12T08:34:32.000Z | official/vision/beta/configs/retinanet.py | melG81/models | d9ed5232648228ad58b9d50e29d8fe3bb6aa7c4a | [
"Apache-2.0"
] | null | null | null | official/vision/beta/configs/retinanet.py | melG81/models | d9ed5232648228ad58b9d50e29d8fe3bb6aa7c4a | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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... | 35.302799 | 95 | 0.605305 |
import os
from typing import List, Optional
import dataclasses
from official.core import config_definitions as cfg
from official.core import exp_factory
from official.modeling import hyperparams
from official.modeling import optimization
from official.vision.beta.configs import backbones
from official.v... | true | true |
f726499b8d6913a5329f1b82ef19ff7b2b6b251b | 1,827 | py | Python | Arbitrage_Spot/dquant/entrypoint.py | ronaldzgithub/CryptoArbitrage | b4b7a12b7b11f3dcf950f9d2039dad4f1388530b | [
"MIT"
] | 1 | 2021-11-03T06:16:16.000Z | 2021-11-03T06:16:16.000Z | Arbitrage_Spot/dquant/entrypoint.py | benno0810/CryptoArbitrage | b4b7a12b7b11f3dcf950f9d2039dad4f1388530b | [
"MIT"
] | null | null | null | Arbitrage_Spot/dquant/entrypoint.py | benno0810/CryptoArbitrage | b4b7a12b7b11f3dcf950f9d2039dad4f1388530b | [
"MIT"
] | 2 | 2021-05-07T09:11:54.000Z | 2021-11-27T16:29:10.000Z | import argparse
import logging
from logging.handlers import RotatingFileHandler
from dquant.datafeed import Datafeed
class EntryPoint:
datafeed = None
def exec_command(self, args ):
logging.debug('exec_command:%s' % args)
if "feed" in args.command:
self.datafeed = Datafeed()
... | 31.5 | 105 | 0.579639 | import argparse
import logging
from logging.handlers import RotatingFileHandler
from dquant.datafeed import Datafeed
class EntryPoint:
datafeed = None
def exec_command(self, args ):
logging.debug('exec_command:%s' % args)
if "feed" in args.command:
self.datafeed = Datafeed()
... | true | true |
f7264a51c8db2fd5cc7ad9b2720dd04cb72172fd | 5,693 | py | Python | noval/python/parser/utils.py | bopopescu/NovalIDE | 590c2adb69d54fa4a6c9dad5459198be057b1329 | [
"MulanPSL-1.0"
] | null | null | null | noval/python/parser/utils.py | bopopescu/NovalIDE | 590c2adb69d54fa4a6c9dad5459198be057b1329 | [
"MulanPSL-1.0"
] | null | null | null | noval/python/parser/utils.py | bopopescu/NovalIDE | 590c2adb69d54fa4a6c9dad5459198be057b1329 | [
"MulanPSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
import functools
DATABASE_FILE = "version"
def MakeDirs(dirname):
dirname = os.path.abspath(dirname)
dirname = dirname.replace("\\","/")
dirnames = dirname.split("/")
destdir = ""
destdir = os.path.join(dirnames[0] + "/",dirnames[1])
... | 30.121693 | 79 | 0.585456 |
import os
import sys
import functools
DATABASE_FILE = "version"
def MakeDirs(dirname):
dirname = os.path.abspath(dirname)
dirname = dirname.replace("\\","/")
dirnames = dirname.split("/")
destdir = ""
destdir = os.path.join(dirnames[0] + "/",dirnames[1])
if not os.path.exists(... | true | true |
f7264b00ab45f44826da46ff3c5c64fce9f84f82 | 219 | py | Python | nothing/nothing/doctype/customer_status/test_customer_status.py | libracore/nothing | e334c5a534eb3ec11ad8c77a467fae05f5383af5 | [
"MIT"
] | 1 | 2022-01-12T11:20:22.000Z | 2022-01-12T11:20:22.000Z | nothing/nothing/doctype/customer_status/test_customer_status.py | libracore/nothing | e334c5a534eb3ec11ad8c77a467fae05f5383af5 | [
"MIT"
] | null | null | null | nothing/nothing/doctype/customer_status/test_customer_status.py | libracore/nothing | e334c5a534eb3ec11ad8c77a467fae05f5383af5 | [
"MIT"
] | 2 | 2021-05-07T08:01:13.000Z | 2021-08-14T22:24:33.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore AG and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestCustomerStatus(unittest.TestCase):
pass
| 19.909091 | 51 | 0.767123 |
from __future__ import unicode_literals
import unittest
class TestCustomerStatus(unittest.TestCase):
pass
| true | true |
f7264b4fcfd7aafc1c81e31c2b3afdfb0672a9ba | 1,144 | py | Python | code/nn.py | arjunchandra/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 17 | 2019-03-29T18:30:36.000Z | 2021-10-17T15:38:22.000Z | code/nn.py | arjunchandra/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 1 | 2019-04-22T22:40:30.000Z | 2019-04-24T21:45:07.000Z | code/nn.py | ctallec/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 5 | 2019-04-29T16:26:18.000Z | 2020-01-23T07:17:49.000Z | """Some nn utilities."""
import torch
from abstract import ParametricFunction
def copy_buffer(net: ParametricFunction, target_net: ParametricFunction):
"""Copy all buffers from net to target_net."""
with torch.no_grad():
for target_buf, buf in zip(target_net.buffers(), net.buffers()): # type: ignore
... | 40.857143 | 87 | 0.701049 | import torch
from abstract import ParametricFunction
def copy_buffer(net: ParametricFunction, target_net: ParametricFunction):
with torch.no_grad():
for target_buf, buf in zip(target_net.buffers(), net.buffers()):
target_buf.copy_(buf)
def soft_update(net: ParametricFunction, target_net: Para... | true | true |
f7264b724b3836bde921699ae915f09f3081112e | 598 | py | Python | driver/forms.py | Mariga123/carpool | f7330634ace2718c2347694b207b9dd49ef6538f | [
"MIT"
] | null | null | null | driver/forms.py | Mariga123/carpool | f7330634ace2718c2347694b207b9dd49ef6538f | [
"MIT"
] | null | null | null | driver/forms.py | Mariga123/carpool | f7330634ace2718c2347694b207b9dd49ef6538f | [
"MIT"
] | null | null | null | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
from .models import *
class RegisterForm(UserCreationForm):
email = forms.EmailField()
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
... | 26 | 68 | 0.667224 | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
from .models import *
class RegisterForm(UserCreationForm):
email = forms.EmailField()
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
... | true | true |
f7264d89247663cd466f161ae8db1fc4b69e2f6a | 946 | py | Python | cms/admin/dialog/views.py | emiquelito/django-cms-2.0 | 721d6aa91925ff46aa0de9f8ea967ca93e73741b | [
"BSD-3-Clause"
] | 1 | 2015-09-28T10:08:14.000Z | 2015-09-28T10:08:14.000Z | cms/admin/dialog/views.py | gmurewa/django-cms-2.0 | 6fab9d93ddcea301a844996f5f0db7edc4883953 | [
"BSD-3-Clause"
] | 1 | 2019-11-08T02:38:49.000Z | 2019-11-08T02:38:49.000Z | cms/admin/dialog/views.py | gmurewa/django-cms-2.0 | 6fab9d93ddcea301a844996f5f0db7edc4883953 | [
"BSD-3-Clause"
] | null | null | null | from cms.admin.dialog.forms import get_copy_dialog_form
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.admin.views.decorators import staff_member_required
from django.http import Http404, HttpResponse
from django.conf import settings
from cms.models import Page
@staff_member_req... | 36.384615 | 73 | 0.738901 | from cms.admin.dialog.forms import get_copy_dialog_form
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.admin.views.decorators import staff_member_required
from django.http import Http404, HttpResponse
from django.conf import settings
from cms.models import Page
@staff_member_req... | true | true |
f7264ec3c56d15f017cede4fca8175d52c1cacc4 | 2,219 | py | Python | tests/test_user_storage.py | Cerzon/gb_chat | b4f8a6bf62b0971a135fbb2083456193f7a816cb | [
"Apache-2.0"
] | null | null | null | tests/test_user_storage.py | Cerzon/gb_chat | b4f8a6bf62b0971a135fbb2083456193f7a816cb | [
"Apache-2.0"
] | null | null | null | tests/test_user_storage.py | Cerzon/gb_chat | b4f8a6bf62b0971a135fbb2083456193f7a816cb | [
"Apache-2.0"
] | null | null | null | from unittest.mock import MagicMock
import pytest
from gb_chat.db.user_history_storage import UserHistoryStorage
from gb_chat.db.user_storage import (InvalidName, InvalidPassword, UserExists,
UserNotFound, UserStorage)
from conftest import VALID_PASSWORD, VALID_USERNAME
@pytest.... | 32.15942 | 88 | 0.775124 | from unittest.mock import MagicMock
import pytest
from gb_chat.db.user_history_storage import UserHistoryStorage
from gb_chat.db.user_storage import (InvalidName, InvalidPassword, UserExists,
UserNotFound, UserStorage)
from conftest import VALID_PASSWORD, VALID_USERNAME
@pytest.... | true | true |
f7264fe3b301f10852827f18dc032e373e7bf3a4 | 25,966 | py | Python | tests/test_commandline.py | marcelm/cutadapt | c63043e0f43970619bb7f8c1242912c236d60545 | [
"MIT"
] | 375 | 2015-01-16T14:04:50.000Z | 2022-03-16T02:19:43.000Z | tests/test_commandline.py | marcelm/cutadapt | c63043e0f43970619bb7f8c1242912c236d60545 | [
"MIT"
] | 589 | 2015-03-05T20:06:03.000Z | 2022-03-29T22:49:56.000Z | tests/test_commandline.py | marcelm/cutadapt | c63043e0f43970619bb7f8c1242912c236d60545 | [
"MIT"
] | 150 | 2015-02-10T12:19:40.000Z | 2022-03-25T05:06:50.000Z | import subprocess
import sys
import os
from io import StringIO, BytesIO
import dnaio
import pytest
from cutadapt.__main__ import main
from utils import assert_files_equal, datapath, cutpath
# pytest.mark.timeout will not fail even if pytest-timeout is not installed
try:
import pytest_timeout as _unused
except Im... | 31.359903 | 116 | 0.655973 | import subprocess
import sys
import os
from io import StringIO, BytesIO
import dnaio
import pytest
from cutadapt.__main__ import main
from utils import assert_files_equal, datapath, cutpath
try:
import pytest_timeout as _unused
except ImportError:
raise ImportError("pytest_timeout needs to be installed")
... | true | true |
f726506396cd55e3c14fcaaeebe3a90d09e1dcf1 | 851 | py | Python | tests/cupy_tests/core_tests/test_syncdetect.py | svlandeg/cupy | 484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363 | [
"MIT"
] | 6,180 | 2016-11-01T14:22:30.000Z | 2022-03-31T08:39:20.000Z | tests/cupy_tests/core_tests/test_syncdetect.py | svlandeg/cupy | 484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363 | [
"MIT"
] | 6,281 | 2016-12-22T07:42:31.000Z | 2022-03-31T19:57:02.000Z | tests/cupy_tests/core_tests/test_syncdetect.py | svlandeg/cupy | 484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363 | [
"MIT"
] | 829 | 2017-02-23T05:46:12.000Z | 2022-03-27T17:40:03.000Z | import unittest
import pytest
import cupy
import cupyx
class TestSyncDetect(unittest.TestCase):
def test_disallowed(self):
a = cupy.array([2, 3])
with cupyx.allow_synchronize(False):
with pytest.raises(cupyx.DeviceSynchronized):
a.get()
def test_allowed(self):
... | 25.029412 | 61 | 0.591069 | import unittest
import pytest
import cupy
import cupyx
class TestSyncDetect(unittest.TestCase):
def test_disallowed(self):
a = cupy.array([2, 3])
with cupyx.allow_synchronize(False):
with pytest.raises(cupyx.DeviceSynchronized):
a.get()
def test_allowed(self):
... | true | true |
f72650f004500bff57f9152bebe02c0607cf7d24 | 567 | py | Python | BOJ14405.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | 2 | 2019-03-05T15:42:46.000Z | 2019-07-24T15:52:36.000Z | BOJ14405.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | null | null | null | BOJ14405.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | null | null | null | s=input();f=True
try:
while s!="":
if s[0]=="p":
t=s[:2]
if t=="pi":
s=s[2:]
else:
f=False; break
elif s[0]=="k":
t=s[:2]
if t=="ka":
s=s[2:]
else:
f=False; break
... | 18.9 | 30 | 0.294533 | s=input();f=True
try:
while s!="":
if s[0]=="p":
t=s[:2]
if t=="pi":
s=s[2:]
else:
f=False; break
elif s[0]=="k":
t=s[:2]
if t=="ka":
s=s[2:]
else:
f=False; break
... | true | true |
f726518fe0feae8b103c50e15118f179206e6821 | 374 | py | Python | build/check_obstacle/catkin_generated/pkg.installspace.context.pc.py | EurobotMDX/eurobot_2020_odroid_cam | ddd9a17d53899f1c615816fd74512c112ecad188 | [
"MIT"
] | 4 | 2019-10-26T18:48:51.000Z | 2020-02-27T19:31:36.000Z | build/check_obstacle/catkin_generated/pkg.installspace.context.pc.py | EurobotMDX/eurobot_2020_odroid_cam | ddd9a17d53899f1c615816fd74512c112ecad188 | [
"MIT"
] | null | null | null | build/check_obstacle/catkin_generated/pkg.installspace.context.pc.py | EurobotMDX/eurobot_2020_odroid_cam | ddd9a17d53899f1c615816fd74512c112ecad188 | [
"MIT"
] | 1 | 2019-10-26T18:50:48.000Z | 2019-10-26T18:50:48.000Z | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "check_obstacle"
PROJECT_SPACE_DIR = "... | 41.555556 | 68 | 0.705882 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "check_obstacle"
PROJECT_SPACE_DIR = "/home/ros/lidar_ws/install"
PROJECT_VERSION = "0.0.0"
| true | true |
f7265193a85ba6ceeb41dc4f556930b01622c5a0 | 2,456 | py | Python | python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/ir/inference/test_identity_scale_clean_pass.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.212121 | 74 | 0.623779 |
import numpy as np
from auto_scan_test import PassAutoScanTest
from program_config import TensorConfig, ProgramConfig, OpConfig
import paddle.inference as paddle_infer
import unittest
import hypothesis.strategies as st
class TestIdentityScaleCleanPass(PassAutoScanTest):
def sample_predictor_configs... | true | true |
f72651d2708561bc7a3f8b8ff37df2a1572eaac2 | 15,984 | py | Python | LSTM for language modeling/Question2_Part_1_To_2.py | sotudian/Natural-Language-Processing | 61ba2ac78e440683519d2121ca2b29a17277e46b | [
"Apache-2.0"
] | null | null | null | LSTM for language modeling/Question2_Part_1_To_2.py | sotudian/Natural-Language-Processing | 61ba2ac78e440683519d2121ca2b29a17277e46b | [
"Apache-2.0"
] | null | null | null | LSTM for language modeling/Question2_Part_1_To_2.py | sotudian/Natural-Language-Processing | 61ba2ac78e440683519d2121ca2b29a17277e46b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Train the language model on texts from the file pride And Prejudice. Before using it to train the language model,
you need to first sentence segment, then tokenize, then lower case each line of the file using Spacy. Append
start-of-sentence token ’<s>’ and end-of-sent... | 29.820896 | 132 | 0.603478 |
import re
import pickle
import random
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import nltk
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.lm.preprocessing import pad_both_ends
from collections import Counter
import math
ces = [list(p... | true | true |
f72654a975ae6f6f07f9c0a9f4ef3e7ceecfc94a | 488 | py | Python | AssetsApp/migrations/0010_alter_assetscategories_datetime_added.py | Kayarn-Mechatronics/Octello | 45f4f73c764ca816918c31ef3ae4889740a68802 | [
"Apache-2.0"
] | null | null | null | AssetsApp/migrations/0010_alter_assetscategories_datetime_added.py | Kayarn-Mechatronics/Octello | 45f4f73c764ca816918c31ef3ae4889740a68802 | [
"Apache-2.0"
] | null | null | null | AssetsApp/migrations/0010_alter_assetscategories_datetime_added.py | Kayarn-Mechatronics/Octello | 45f4f73c764ca816918c31ef3ae4889740a68802 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.5 on 2021-09-08 01:39
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AssetsApp', '0009_alter_assetscategories_datetime_added'),
]
operations = [
migrations.AlterField(
model_name='a... | 24.4 | 97 | 0.647541 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AssetsApp', '0009_alter_assetscategories_datetime_added'),
]
operations = [
migrations.AlterField(
model_name='assetscategories',
name='datetime_ad... | true | true |
f72656c4b0c210ce9367e4cf253ca9a70c73fd41 | 5,884 | py | Python | Jumpscale/clients/oauth/OauthInstance.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 2 | 2019-05-09T07:21:25.000Z | 2019-08-05T06:37:53.000Z | Jumpscale/clients/oauth/OauthInstance.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 664 | 2018-12-19T12:43:44.000Z | 2019-08-23T04:24:42.000Z | Jumpscale/clients/oauth/OauthInstance.py | threefoldtech/jumpscale10 | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 7 | 2019-05-03T07:14:37.000Z | 2019-08-05T12:36:52.000Z | import urllib.request
import urllib.parse
import urllib.error
import string
import requests
import time
import random
from Jumpscale import j
JSConfigClient = j.application.JSBaseConfigClass
class OauthClient(JSConfigClient):
_SCHEMATEXT = """
@url = jumpscale.oauth.client
name* = "" (S)
... | 31.978261 | 116 | 0.579708 | import urllib.request
import urllib.parse
import urllib.error
import string
import requests
import time
import random
from Jumpscale import j
JSConfigClient = j.application.JSBaseConfigClass
class OauthClient(JSConfigClient):
_SCHEMATEXT = """
@url = jumpscale.oauth.client
name* = "" (S)
... | true | true |
f7265773512670aeae3bd3c088b90f7348f9d8d0 | 6,363 | py | Python | dump_teacher_hiddens.py | ChenRocks/Distill-BERT-Textgen | a3b0b22ce16febc4d3ffdbd8791ea3374110a892 | [
"MIT"
] | 111 | 2020-05-05T04:34:10.000Z | 2022-02-20T17:04:56.000Z | dump_teacher_hiddens.py | ChenRocks/Distill-BERT-Textgen | a3b0b22ce16febc4d3ffdbd8791ea3374110a892 | [
"MIT"
] | 5 | 2020-06-06T12:45:52.000Z | 2021-03-16T13:22:37.000Z | dump_teacher_hiddens.py | ChenRocks/Distill-BERT-Textgen | a3b0b22ce16febc4d3ffdbd8791ea3374110a892 | [
"MIT"
] | 17 | 2020-05-07T07:43:05.000Z | 2022-01-19T11:33:33.000Z | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
precompute hidden states of CMLM teacher to speedup KD training
"""
import argparse
import io
import os
import shelve
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from tqdm import tqdm
from pytorch_pretrained_... | 35.949153 | 79 | 0.636964 | import argparse
import io
import os
import shelve
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from tqdm import tqdm
from pytorch_pretrained_bert import BertTokenizer
from toolz.sandbox import unzip
from cmlm.model import BertForSeq2seq
from cmlm.data import convert_token_to_bert, ... | true | true |
f72658a22e37eca598653ef574062e41fecd324c | 1,652 | py | Python | test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/models/_non_string_enums_client_enums.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/models/_non_string_enums_client_enums.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/models/_non_string_enums_client_enums.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 34.416667 | 94 | 0.640436 |
from enum import Enum, EnumMeta
from six import with_metaclass
class _CaseInsensitiveEnumMeta(EnumMeta):
def __getitem__(self, name):
return super().__getitem__(name.upper())
def __getattr__(cls, name):
try:
return cls._member_map_[name.upper()]
except KeyError:
... | true | true |
f72658a883e0ec8dce8892d634b7105d4bac6c3d | 354 | py | Python | algorithm/challenges/geanytest.py | rishabhiitbhu/hackerrank | acc300851c81a29472177f15fd8b56ebebe853ea | [
"MIT"
] | null | null | null | algorithm/challenges/geanytest.py | rishabhiitbhu/hackerrank | acc300851c81a29472177f15fd8b56ebebe853ea | [
"MIT"
] | null | null | null | algorithm/challenges/geanytest.py | rishabhiitbhu/hackerrank | acc300851c81a29472177f15fd8b56ebebe853ea | [
"MIT"
] | 1 | 2020-01-30T06:47:09.000Z | 2020-01-30T06:47:09.000Z | t = int(input().strip())
for i in range(t):
n,c,m = input().strip().split(' ')
n,c,m = [int(n),int(c),int(m)]
tot_choc=n//c
wrap=tot_choc
#print(tot_choc, wrap)
while wrap >= m:
extra_choc = wrap//m
wrap-=m*extra_choc
wrap+=extra_choc
tot_choc+= extra_c... | 25.285714 | 39 | 0.516949 | t = int(input().strip())
for i in range(t):
n,c,m = input().strip().split(' ')
n,c,m = [int(n),int(c),int(m)]
tot_choc=n//c
wrap=tot_choc
while wrap >= m:
extra_choc = wrap//m
wrap-=m*extra_choc
wrap+=extra_choc
tot_choc+= extra_choc
print(tot_choc... | true | true |
f72658e3bad5fe570677617b549a92f97f742c6b | 8,745 | py | Python | selfdrive/car/hyundai/carcontroller.py | janpoo6427/openpilot_xx979xx | 189764c2ad1d6610165876a0462ba0eb896ac500 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/carcontroller.py | janpoo6427/openpilot_xx979xx | 189764c2ad1d6610165876a0462ba0eb896ac500 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/carcontroller.py | janpoo6427/openpilot_xx979xx | 189764c2ad1d6610165876a0462ba0eb896ac500 | [
"MIT"
] | 2 | 2020-09-27T20:46:34.000Z | 2020-10-15T01:01:57.000Z | from cereal import car
from common.numpy_fast import clip
from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11, create_lfa_mfa, \
create_scc11, create_scc12, create_mdps12, \
... | 42.658537 | 122 | 0.705432 | from cereal import car
from common.numpy_fast import clip
from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11, create_lfa_mfa, \
create_scc11, create_scc12, create_mdps12, \
... | true | true |
f7265a0b69f2307625509d7efc09f1872f2f80c4 | 8,067 | py | Python | trading-with-python/util/trendy.py | mikimaus78/ml_monorepo | b2c2627ff0e86e27f6829170d0dac168d8e5783b | [
"BSD-3-Clause"
] | 51 | 2019-02-01T19:43:37.000Z | 2022-03-16T09:07:03.000Z | trading-with-python/util/trendy.py | mikimaus78/ml_monorepo | b2c2627ff0e86e27f6829170d0dac168d8e5783b | [
"BSD-3-Clause"
] | 2 | 2019-02-23T18:54:22.000Z | 2019-11-09T01:30:32.000Z | trading-with-python/util/trendy.py | mikimaus78/ml_monorepo | b2c2627ff0e86e27f6829170d0dac168d8e5783b | [
"BSD-3-Clause"
] | 35 | 2019-02-08T02:00:31.000Z | 2022-03-01T23:17:00.000Z | import numpy as np
from filter import movingaverage
def gentrends(x, window=1/3.0, charts=True):
"""
Returns a Pandas dataframe with support and resistance lines.
:param x: One-dimensional data set
:param window: How long the trendlines should be. If window < 1, then it
will be take... | 32.792683 | 79 | 0.567497 | import numpy as np
from filter import movingaverage
def gentrends(x, window=1/3.0, charts=True):
import numpy as np
import pandas.io.data as pd
x = np.array(x)
if window < 1:
window = int(window * len(x))
max1 = np.where(x == max(x))[0][0]
min1 = np.where(x == min(x))[0][0]
... | true | true |
f7265b61b492e4080f0306586bfd4421f042a4b1 | 9,483 | py | Python | gamestonk_terminal/stocks/insider/openinsider_view.py | jbushago/GamestonkTerminal | 73a2b419664bf62bbdc59aa8402c8cd6a913a518 | [
"MIT"
] | 1 | 2022-03-15T13:05:40.000Z | 2022-03-15T13:05:40.000Z | gamestonk_terminal/stocks/insider/openinsider_view.py | jbushago/GamestonkTerminal | 73a2b419664bf62bbdc59aa8402c8cd6a913a518 | [
"MIT"
] | null | null | null | gamestonk_terminal/stocks/insider/openinsider_view.py | jbushago/GamestonkTerminal | 73a2b419664bf62bbdc59aa8402c8cd6a913a518 | [
"MIT"
] | null | null | null | import itertools
import logging
import os
import textwrap
from typing import List
import numpy as np
import pandas as pd
import requests
from bs4 import BeautifulSoup
from gamestonk_terminal.decorators import log_start_end
from gamestonk_terminal.helper_funcs import (
export_data,
patch_pandas_text_adjustment... | 29.178462 | 119 | 0.605505 | import itertools
import logging
import os
import textwrap
from typing import List
import numpy as np
import pandas as pd
import requests
from bs4 import BeautifulSoup
from gamestonk_terminal.decorators import log_start_end
from gamestonk_terminal.helper_funcs import (
export_data,
patch_pandas_text_adjustment... | true | true |
f7265be4393da76c22754da75898052c8a4b8c71 | 831 | py | Python | src/cpp/qpsolver/cvxopt/examples/doc/chap8/conelp.py | Hap-Hugh/quicksel | 10eee90b759638d5c54ba19994ae8e36e90e12b8 | [
"Apache-2.0"
] | 15 | 2020-07-07T16:32:53.000Z | 2022-03-16T14:23:23.000Z | src/cpp/qpsolver/cvxopt/examples/doc/chap8/conelp.py | Hap-Hugh/quicksel | 10eee90b759638d5c54ba19994ae8e36e90e12b8 | [
"Apache-2.0"
] | 2 | 2020-09-02T15:25:39.000Z | 2020-09-24T08:37:18.000Z | src/cpp/qpsolver/cvxopt/examples/doc/chap8/conelp.py | Hap-Hugh/quicksel | 10eee90b759638d5c54ba19994ae8e36e90e12b8 | [
"Apache-2.0"
] | 6 | 2020-08-14T22:02:07.000Z | 2021-03-31T07:08:29.000Z | # The small linear cone program of section 8.1 (Linear cone programs).
from cvxopt import matrix, solvers
c = matrix([-6., -4., -5.])
G = matrix([[ 16., 7., 24., -8., 8., -1., 0., -1., 0., 0., 7.,
-5., 1., -5., 1., -7., 1., -7., -4.],
[-14., 2., 7., -13., -18., 3., 0., 0.,... | 39.571429 | 75 | 0.361011 |
from cvxopt import matrix, solvers
c = matrix([-6., -4., -5.])
G = matrix([[ 16., 7., 24., -8., 8., -1., 0., -1., 0., 0., 7.,
-5., 1., -5., 1., -7., 1., -7., -4.],
[-14., 2., 7., -13., -18., 3., 0., 0., -1., 0., 3.,
13., -6., 13., 12., -10., -6., -10., -28.]... | true | true |
f7265c3d05c95935872b8f725e78bb38be5404e8 | 9,800 | py | Python | stacker/tests/test_plan.py | DomainGroupOSS/stacker | 88b71bc5cfcbbf7957245d821434b95801230425 | [
"BSD-2-Clause"
] | 1 | 2018-07-17T11:23:47.000Z | 2018-07-17T11:23:47.000Z | stacker/tests/test_plan.py | DomainGroupOSS/stacker | 88b71bc5cfcbbf7957245d821434b95801230425 | [
"BSD-2-Clause"
] | null | null | null | stacker/tests/test_plan.py | DomainGroupOSS/stacker | 88b71bc5cfcbbf7957245d821434b95801230425 | [
"BSD-2-Clause"
] | 1 | 2020-02-29T04:49:04.000Z | 2020-02-29T04:49:04.000Z | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import range
import os
import shutil
import tempfile
import unittest
import mock
from stacker.context import Context, Config
from stacker.dag import walk
from stacker.util import stack_template_k... | 30.434783 | 78 | 0.580408 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import range
import os
import shutil
import tempfile
import unittest
import mock
from stacker.context import Context, Config
from stacker.dag import walk
from stacker.util import stack_template_k... | true | true |
f7265c6925ef94f77153adae115c2e78a7324353 | 3,058 | py | Python | over_roasted/settings.py | xmedinavei/over_roasted_app | c5b9525c6435d5d2285d86961eb8674108f2c88c | [
"MIT"
] | null | null | null | over_roasted/settings.py | xmedinavei/over_roasted_app | c5b9525c6435d5d2285d86961eb8674108f2c88c | [
"MIT"
] | null | null | null | over_roasted/settings.py | xmedinavei/over_roasted_app | c5b9525c6435d5d2285d86961eb8674108f2c88c | [
"MIT"
] | null | null | null | from pathlib import Path
import django_heroku
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: ... | 24.66129 | 91 | 0.692283 | from pathlib import Path
import django_heroku
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '3+7ekm6aghztb!h1b@xcvvjid8$o%rb7bb3bha446)d1pk573*'
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
# Django
'django.contrib.admin',
'django.contrib.auth... | true | true |
f7265d7477ff3fba1b5e7f80d15d88b7c11ed07e | 1,092 | py | Python | examples/finalterm-shell-integration.py | davidbrochart/python-prompt-toolkit | 8498692b31671fee7c5a426300a9df2ee290eae2 | [
"BSD-3-Clause"
] | 2 | 2020-04-12T01:23:25.000Z | 2021-05-22T13:46:00.000Z | examples/finalterm-shell-integration.py | davidbrochart/python-prompt-toolkit | 8498692b31671fee7c5a426300a9df2ee290eae2 | [
"BSD-3-Clause"
] | null | null | null | examples/finalterm-shell-integration.py | davidbrochart/python-prompt-toolkit | 8498692b31671fee7c5a426300a9df2ee290eae2 | [
"BSD-3-Clause"
] | 2 | 2016-12-30T23:57:44.000Z | 2021-05-22T13:50:21.000Z | #!/usr/bin/env python
"""
Mark the start and end of the prompt with Final term (iterm2) escape sequences.
See: https://iterm2.com/finalterm.html
"""
from __future__ import unicode_literals
from prompt_toolkit import prompt
from prompt_toolkit.token import Token
import sys
BEFORE_PROMPT = '\033]133;A\a'
AFTER_PROMPT ... | 29.513514 | 92 | 0.701465 |
from __future__ import unicode_literals
from prompt_toolkit import prompt
from prompt_toolkit.token import Token
import sys
BEFORE_PROMPT = '\033]133;A\a'
AFTER_PROMPT = '\033]133;B\a'
BEFORE_OUTPUT = '\033]133;C\a'
AFTER_OUTPUT = '\033]133;D;{command_status}\a'
def get_prompt_tokens(cli):
... | true | true |
f7265e08d1ad65a2a3c1ac2d5369c00df1bea063 | 2,164 | py | Python | tests/unit/utils/pyxb_utils.py | MaxTakahashi/hammr | cfe593ccfdddb7f98185e561feed6a40a866b585 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/pyxb_utils.py | MaxTakahashi/hammr | cfe593ccfdddb7f98185e561feed6a40a866b585 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/pyxb_utils.py | MaxTakahashi/hammr | cfe593ccfdddb7f98185e561feed6a40a866b585 | [
"Apache-2.0"
] | null | null | null | # Copyright 2007-2017 UShareSoft SAS, All rights reserved
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 55.487179 | 121 | 0.77634 |
# is slightly modified.
# So to avoid that, the type to used is retrieved dynamically using the PyXB internal attributes.
# This method returns the type of the element in a list attributes
# Example of use:
# regionType = get_pyXB_anon_type_for_list(regions.regionEntities)
# region = regionType()
#... | true | true |
f7265e3a53380992aefc3e1f0e5022e3b36f9db4 | 4,782 | py | Python | ADSref.py | SimonJMurphy/ADSref | c144d077d622987c42d5cf8d9d111afa04073af2 | [
"MIT"
] | 2 | 2021-01-14T10:13:32.000Z | 2021-01-31T23:51:09.000Z | ADSref.py | SimonJMurphy/ADSref | c144d077d622987c42d5cf8d9d111afa04073af2 | [
"MIT"
] | null | null | null | ADSref.py | SimonJMurphy/ADSref | c144d077d622987c42d5cf8d9d111afa04073af2 | [
"MIT"
] | null | null | null | import ads
ads.config.token = 'my token'
import numpy as np
# Filenames
## Enter the filename for first-author publications here:
first_author = "first_author.bib"
## Enter the filename for cd-authored publications here:
co_author = "co_author.bib"
# Function Declarations
def extract_bibcodes(filename):
"""Tak... | 32.97931 | 367 | 0.622961 | import ads
ads.config.token = 'my token'
import numpy as np
en(filename)
full_list = f.readlines()
bibcodes = []
exclude = ['arXiv','tmp','yCat','PhDT','AAS','ASPC','BSRSL','conf','EPJWC','IAUFM','IAUGA','IAUS','hst','iue','jwst','spzr','prop']
for line in full_list:
if l... | true | true |
f7265e57b6d0c1d7e79981da52b990daf420ccab | 7,670 | py | Python | tests/test_breadcrumbs.py | PavloKapyshin/paka.breadcrumbs | ae57d1a0d609ab39f81c4b0b44d6f7081602b079 | [
"BSD-3-Clause"
] | 1 | 2018-10-28T03:02:03.000Z | 2018-10-28T03:02:03.000Z | tests/test_breadcrumbs.py | PavloKapyshin/paka.breadcrumbs | ae57d1a0d609ab39f81c4b0b44d6f7081602b079 | [
"BSD-3-Clause"
] | null | null | null | tests/test_breadcrumbs.py | PavloKapyshin/paka.breadcrumbs | ae57d1a0d609ab39f81c4b0b44d6f7081602b079 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from paka.breadcrumbs import Bread, Crumb
class BreadcrumbsTest(unittest.TestCase):
def setUp(self):
self... | 36.52381 | 78 | 0.619426 |
from __future__ import unicode_literals
import unittest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from paka.breadcrumbs import Bread, Crumb
class BreadcrumbsTest(unittest.TestCase):
def setUp(self):
self.site_name = "Some site... | true | true |
f72660bfc1f52e8bce65d7defe6754157512b67a | 3,196 | py | Python | grr/server/grr_response_server/databases/mem.py | billstackpole/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2019-03-28T07:09:41.000Z | 2019-03-28T07:09:41.000Z | grr/server/grr_response_server/databases/mem.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/databases/mem.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2018-08-30T14:50:24.000Z | 2018-08-30T14:50:24.000Z | #!/usr/bin/env python
"""An in memory database implementation used for testing."""
import sys
import threading
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import utils
from grr_response_server import db
from grr_response_server.databases import mem_blobs
from grr_response_server.databases i... | 31.643564 | 76 | 0.708385 |
import sys
import threading
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import utils
from grr_response_server import db
from grr_response_server.databases import mem_blobs
from grr_response_server.databases import mem_clients
from grr_response_server.databases import mem_cronjobs
from grr_... | true | true |
f726620976060383077043d92b478dbeab78b397 | 571 | py | Python | migrations/versions/51387d8fda8d_add_default_value_to_is_invited.py | sicness9/BugHub | 2af45b0840757f7826927d4fefc0e626fef136e1 | [
"FTL"
] | null | null | null | migrations/versions/51387d8fda8d_add_default_value_to_is_invited.py | sicness9/BugHub | 2af45b0840757f7826927d4fefc0e626fef136e1 | [
"FTL"
] | null | null | null | migrations/versions/51387d8fda8d_add_default_value_to_is_invited.py | sicness9/BugHub | 2af45b0840757f7826927d4fefc0e626fef136e1 | [
"FTL"
] | null | null | null | """add default value to is_invited
Revision ID: 51387d8fda8d
Revises: 6779bebb64e6
Create Date: 2021-12-21 18:19:50.864781
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '51387d8fda8d'
down_revision = '6779bebb64e6'
branch_labels = None
depends_on = None
def... | 19.689655 | 65 | 0.691769 | from alembic import op
import sqlalchemy as sa
revision = '51387d8fda8d'
down_revision = '6779bebb64e6'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f7266308ffe97be95f1df1a47115c73c0ac247a1 | 6,815 | py | Python | main.py | drkostas/COSC525-Project2 | a33c786621e6047b0a586c7c3a3b5b85cb51fd6d | [
"Apache-2.0"
] | null | null | null | main.py | drkostas/COSC525-Project2 | a33c786621e6047b0a586c7c3a3b5b85cb51fd6d | [
"Apache-2.0"
] | null | null | null | main.py | drkostas/COSC525-Project2 | a33c786621e6047b0a586c7c3a3b5b85cb51fd6d | [
"Apache-2.0"
] | null | null | null | import traceback
import argparse
import numpy as np
from src import NeuralNetwork, generateExample, getTensorExample
from typing import *
def get_args() -> argparse.Namespace:
"""Set-up the argument parser
Returns:
argparse.Namespace:
"""
parser = argparse.ArgumentParser(
description=... | 42.329193 | 101 | 0.612032 | import traceback
import argparse
import numpy as np
from src import NeuralNetwork, generateExample, getTensorExample
from typing import *
def get_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description='Project 2 for the Deep Learning class (COSC 525). '
'Involves t... | true | true |
f72665b02611c25f6224783cfd40d4362312e741 | 62,701 | py | Python | tests/job_metadata.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | tests/job_metadata.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | tests/job_metadata.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | 3 | 2019-10-24T11:40:06.000Z | 2022-02-24T07:34:00.000Z | """
job_metadata api data import unit tests.
Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
- ... | 49.023456 | 120 | 0.54409 |
import json
from flask import url_for
from _fixtures import *
from _helpers import job_metadata_importer
import dirbs.metadata as metadata
def test_classification_json_api(flask_app, db_conn, api_version):
extra_metadata = {'matched_imei_counts':
{'compound_dimension': 0,
... | true | true |
f726669c4c59c770ca27ddaf00f3eafdc8ca9522 | 3,606 | py | Python | mocks/mock.py | pandora-auth-ros-pkg/dashboard | 0e66c47d1987e1dfdc91dcd4f876791673938158 | [
"MIT"
] | 1 | 2016-04-01T02:37:05.000Z | 2016-04-01T02:37:05.000Z | mocks/mock.py | pandora-auth-ros-pkg/dashboard | 0e66c47d1987e1dfdc91dcd4f876791673938158 | [
"MIT"
] | null | null | null | mocks/mock.py | pandora-auth-ros-pkg/dashboard | 0e66c47d1987e1dfdc91dcd4f876791673938158 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from time import sleep
import random
import sys
import rospy
from rospy import Publisher, init_node
from sensor_msgs.msg import Range
from pandora_data_fusion_msgs.msg import VictimProbabilities
from pandora_sensor_msgs.msg import BatteryMsg, Co2Msg, Temper... | 28.848 | 70 | 0.642818 |
from __future__ import print_function
from time import sleep
import random
import sys
import rospy
from rospy import Publisher, init_node
from sensor_msgs.msg import Range
from pandora_data_fusion_msgs.msg import VictimProbabilities
from pandora_sensor_msgs.msg import BatteryMsg, Co2Msg, Temperature
from pandora_se... | true | true |
f72666c6d7fa28865bf0cc1af0a8928f8b710444 | 674 | py | Python | src/gufo/err/failfast/always.py | gufolabs/gufo_err | d3996f355b38a3efe1fa3ecae578846ffebd7790 | [
"BSD-3-Clause"
] | null | null | null | src/gufo/err/failfast/always.py | gufolabs/gufo_err | d3996f355b38a3efe1fa3ecae578846ffebd7790 | [
"BSD-3-Clause"
] | null | null | null | src/gufo/err/failfast/always.py | gufolabs/gufo_err | d3996f355b38a3efe1fa3ecae578846ffebd7790 | [
"BSD-3-Clause"
] | null | null | null | # ---------------------------------------------------------------------
# Gufo Err: AlwaysFailFast
# ---------------------------------------------------------------------
# Copyright (C) 2022, Gufo Labs
# ---------------------------------------------------------------------
# Python modules
from typing import Type
fro... | 24.962963 | 71 | 0.449555 |
from typing import Type
from types import TracebackType
from ..abc.failfast import BaseFailFast
class AlwaysFailFast(BaseFailFast):
def must_die(
self,
t: Type[BaseException],
v: BaseException,
tb: TracebackType,
) -> bool:
return True
| true | true |
f726670921d44f21aa09f17d795a742ee0c1fa0c | 8,397 | py | Python | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | import unittest
import mock
import requests
import httpretty
import settings
from bitfinex.client import Client, TradeClient
API_KEY = settings.API_KEY
API_SECRET = settings.API_SECRET
class BitfinexTest(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_should_have_server(self):... | 37.995475 | 400 | 0.609265 | import unittest
import mock
import requests
import httpretty
import settings
from bitfinex.client import Client, TradeClient
API_KEY = settings.API_KEY
API_SECRET = settings.API_SECRET
class BitfinexTest(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_should_have_server(self):... | true | true |
f726671fe689fac6b9c56332427272898befdccc | 388 | py | Python | api/v10/urls.py | huylb314/sample-django | 5c53e05ccd62abc075e4a9942681ab845d5be2e0 | [
"MIT"
] | null | null | null | api/v10/urls.py | huylb314/sample-django | 5c53e05ccd62abc075e4a9942681ab845d5be2e0 | [
"MIT"
] | null | null | null | api/v10/urls.py | huylb314/sample-django | 5c53e05ccd62abc075e4a9942681ab845d5be2e0 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
from django.views.decorators.csrf import csrf_exempt
#GET charts?userid=0&clientid=1
#GET charts?userid=0&clientid=1&chartid=2
#DELETE charts?userid=0&clientid=1&chartid=2
#POST charts?userid=0&clientid=1&chartid=2
#POST charts?userid=0&clientid=1
url... | 27.714286 | 53 | 0.744845 | from django.conf.urls import url
from . import views
from django.views.decorators.csrf import csrf_exempt
urlpatterns = [
url(r'^charts$', csrf_exempt(views.doTheMagic)),
]
| true | true |
f7266798c32cdc9f7db93d85cd1ba7543a2f7525 | 4,011 | py | Python | users/views.py | mayronH/desafio-frexco | 636b0d5ef11cb663cb46c022eed69fe8fcee49e3 | [
"MIT"
] | null | null | null | users/views.py | mayronH/desafio-frexco | 636b0d5ef11cb663cb46c022eed69fe8fcee49e3 | [
"MIT"
] | null | null | null | users/views.py | mayronH/desafio-frexco | 636b0d5ef11cb663cb46c022eed69fe8fcee49e3 | [
"MIT"
] | null | null | null | import csv
import xlsxwriter
import io
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext
from users.models import Cu... | 29.065217 | 102 | 0.612565 | import csv
import xlsxwriter
import io
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext
from users.models import Cu... | true | true |
f72667a1d24d7941c968cd6a40963f081df72e57 | 2,540 | py | Python | tests/unit/kubernetes/test_Ssh.py | owasp-sbot/OSBot-K8s | 74403194481215abb24ca82714bd23ea51b33dfd | [
"Apache-2.0"
] | null | null | null | tests/unit/kubernetes/test_Ssh.py | owasp-sbot/OSBot-K8s | 74403194481215abb24ca82714bd23ea51b33dfd | [
"Apache-2.0"
] | null | null | null | tests/unit/kubernetes/test_Ssh.py | owasp-sbot/OSBot-K8s | 74403194481215abb24ca82714bd23ea51b33dfd | [
"Apache-2.0"
] | null | null | null | import os
from unittest import TestCase
import pytest
from dotenv import load_dotenv
from pytest import skip
from osbot_utils.utils.Files import file_not_exists
from osbot_k8s.kubernetes.Ssh import Ssh
@pytest.mark.skip('needs live server') # todo add to test setup the creation of pods and nodes we can S... | 35.277778 | 136 | 0.606693 | import os
from unittest import TestCase
import pytest
from dotenv import load_dotenv
from pytest import skip
from osbot_utils.utils.Files import file_not_exists
from osbot_k8s.kubernetes.Ssh import Ssh
@pytest.mark.skip('needs live server')
class test_Ssh(TestCase):
def setUp(self) -> None:
... | true | true |
f72667ffda4b29a371dcff42c53030225f8f2e83 | 331 | py | Python | app/main/forms.py | DevWaweru/Watchlist | e9671c61fc543668b82fd1422fad0f6483640cca | [
"MIT"
] | null | null | null | app/main/forms.py | DevWaweru/Watchlist | e9671c61fc543668b82fd1422fad0f6483640cca | [
"MIT"
] | null | null | null | app/main/forms.py | DevWaweru/Watchlist | e9671c61fc543668b82fd1422fad0f6483640cca | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class ReviewForm(FlaskForm):
title = StringField('Review Title', validators=[Required()])
review = TextAreaField('Movie review',validators=[Required()])
submit = SubmitField('Su... | 36.777778 | 66 | 0.770393 | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class ReviewForm(FlaskForm):
title = StringField('Review Title', validators=[Required()])
review = TextAreaField('Movie review',validators=[Required()])
submit = SubmitField('Su... | true | true |
f72668f9f0f1bcd1855b3e06f521866410ab3bc5 | 23,269 | py | Python | InvenTree/company/models.py | inmys/InvenTree | a0d1622926ba9a13839adfe64a8fe21c073692f2 | [
"MIT"
] | null | null | null | InvenTree/company/models.py | inmys/InvenTree | a0d1622926ba9a13839adfe64a8fe21c073692f2 | [
"MIT"
] | null | null | null | InvenTree/company/models.py | inmys/InvenTree | a0d1622926ba9a13839adfe64a8fe21c073692f2 | [
"MIT"
] | null | null | null | """
Company database model definitions
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MinValueValidator
from django.core.exceptions import ValidationError
from django.db import models
from djang... | 32.408078 | 194 | 0.628089 |
from __future__ import unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MinValueValidator
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Sum, Q, UniqueConstraint
from django.apps impo... | true | true |
f7266b0a144bf41133781daf4df6f25ffb28d3a9 | 463 | py | Python | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_table_dark_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_table_dark_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_table_dark_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/jedi/shared_frn_all_table_dark_01.iff"
result.attribute_t... | 27.235294 | 84 | 0.736501 | true | true | |
f7266b31a38ebc7a5721d50d8c4e8bcd245cd5d2 | 292 | py | Python | tests/urls.py | pkeeper/pdf-crawler-test | 7f8b9ca135fae7301f7902ada3669cf82726c4e0 | [
"MIT"
] | null | null | null | tests/urls.py | pkeeper/pdf-crawler-test | 7f8b9ca135fae7301f7902ada3669cf82726c4e0 | [
"MIT"
] | null | null | null | tests/urls.py | pkeeper/pdf-crawler-test | 7f8b9ca135fae7301f7902ada3669cf82726c4e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from pdf_crawler_test.urls import urlpatterns as pdf_crawler_test_urls
urlpatterns = [
url(r'^', include(pdf_crawler_test_urls, namespace='pdf_crawler_test')),
]
| 26.545455 | 76 | 0.777397 |
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from pdf_crawler_test.urls import urlpatterns as pdf_crawler_test_urls
urlpatterns = [
url(r'^', include(pdf_crawler_test_urls, namespace='pdf_crawler_test')),
]
| true | true |
f7266dca016862413492651e6ea69b794172bb4d | 1,926 | py | Python | src/ksl.py | adnan007d/scraping-jobs-for-alex | 393c2f703d939cdf5944faa59863336070b611f3 | [
"MIT"
] | null | null | null | src/ksl.py | adnan007d/scraping-jobs-for-alex | 393c2f703d939cdf5944faa59863336070b611f3 | [
"MIT"
] | null | null | null | src/ksl.py | adnan007d/scraping-jobs-for-alex | 393c2f703d939cdf5944faa59863336070b611f3 | [
"MIT"
] | null | null | null | import time
import json
import requests
import urllib3
from random import randint
from bs4 import BeautifulSoup
from threading import Thread
urllib3.disable_warnings()
BASE_URL = "https://jobs.ksl.com/search/posted/last-7-days"
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/... | 26.027027 | 141 | 0.648494 | import time
import json
import requests
import urllib3
from random import randint
from bs4 import BeautifulSoup
from threading import Thread
urllib3.disable_warnings()
BASE_URL = "https://jobs.ksl.com/search/posted/last-7-days"
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/... | true | true |
f7266f67638e9576f4b43d525e963cfc0fa2a7b5 | 536 | py | Python | sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/__init__.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/__init__.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/__init__.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.727273 | 94 | 0.561567 |
from ._device_update import DeviceUpdate
__all__ = ['DeviceUpdate']
| true | true |
f726701582b7fe85721853e639a19adb9c7fe1fe | 7,883 | py | Python | test/functional/rpc_users.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 38.082126 | 129 | 0.614994 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
get_datadir_path,
str_to_b64str,
)
import os
import http.client
import urllib.parse
import subprocess
from random import SystemRandom
import string
import configparser
import sys
class HTTP... | true | true |
f7267055d2c097c704fe63ba2a7aa2a991fa61d0 | 6,510 | py | Python | touchdown/tests/test_aws_iam_server_certificate.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 14 | 2015-01-05T18:18:04.000Z | 2022-02-07T19:35:12.000Z | touchdown/tests/test_aws_iam_server_certificate.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 106 | 2015-01-06T00:17:13.000Z | 2019-09-07T00:35:32.000Z | touchdown/tests/test_aws_iam_server_certificate.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 5 | 2015-01-30T10:18:24.000Z | 2022-02-07T19:35:13.000Z | # Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 43.986486 | 87 | 0.650691 |
from touchdown.core import errors
from touchdown.tests.aws import StubberTestCase
from touchdown.tests.stubs.aws import ServerCertificateStubber
class TestCreateServerCertificate(StubberTestCase):
def test_create_server_certificate(self):
goal = self.create_goal("apply")
with open(S... | true | true |
f7267151612dbfc56f3defd079b3c1b033ab0459 | 2,573 | py | Python | task/models.py | Redhead95/taskful_api | 2b28a7f6ecaeb1c77d3fd3bea9ae5922667b1044 | [
"MIT"
] | null | null | null | task/models.py | Redhead95/taskful_api | 2b28a7f6ecaeb1c77d3fd3bea9ae5922667b1044 | [
"MIT"
] | null | null | null | task/models.py | Redhead95/taskful_api | 2b28a7f6ecaeb1c77d3fd3bea9ae5922667b1044 | [
"MIT"
] | null | null | null | import os
import uuid
from django.db import models
from django.utils.deconstruct import deconstructible
NOT_COMPLETE = 'NC'
COMPLETE = 'C'
TASK_STATUS_CHOICES = [
(NOT_COMPLETE, 'Not Complete'),
(COMPLETE, 'Complete'),
]
@deconstructible
class GenerateAttachmentFilePath(object):
def __init__(self):
... | 38.402985 | 134 | 0.733385 | import os
import uuid
from django.db import models
from django.utils.deconstruct import deconstructible
NOT_COMPLETE = 'NC'
COMPLETE = 'C'
TASK_STATUS_CHOICES = [
(NOT_COMPLETE, 'Not Complete'),
(COMPLETE, 'Complete'),
]
@deconstructible
class GenerateAttachmentFilePath(object):
def __init__(self):
... | true | true |
f72671733725c0c68f0d949630bf8d7a44e4778a | 14,483 | py | Python | shadowsocks/udprelay.py | whayne1103/shadowsocks | d5196497f7b0445d355c05dffa5c6a3e12b1d79b | [
"Apache-2.0"
] | 13 | 2019-09-22T06:34:18.000Z | 2021-07-17T06:19:39.000Z | shadowsocks/udprelay.py | whayne1103/shadowsocks | d5196497f7b0445d355c05dffa5c6a3e12b1d79b | [
"Apache-2.0"
] | 3 | 2020-02-10T03:23:08.000Z | 2020-06-06T10:02:36.000Z | shadowsocks/udprelay.py | whayne1103/shadowsocks | d5196497f7b0445d355c05dffa5c6a3e12b1d79b | [
"Apache-2.0"
] | 22 | 2015-08-23T00:44:46.000Z | 2020-03-16T08:33:13.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | 39.571038 | 79 | 0.538908 |
from __future__ import absolute_import, division, print_function, \
with_statement
import socket
import logging
import struct
import errno
import random
from shadowsocks import cryptor, eventloop, lru_cache, common, shell
from shadowsocks.common import ... | true | true |
f72671937db542e223720da043ede8cedbc9e9b9 | 15,617 | py | Python | frigate/events.py | gpete/frigate | e6594c6d98fc18e05df29e66924039cd53a67dd8 | [
"MIT"
] | null | null | null | frigate/events.py | gpete/frigate | e6594c6d98fc18e05df29e66924039cd53a67dd8 | [
"MIT"
] | null | null | null | frigate/events.py | gpete/frigate | e6594c6d98fc18e05df29e66924039cd53a67dd8 | [
"MIT"
] | null | null | null | import datetime
import json
import logging
import os
import queue
import subprocess as sp
import threading
import time
from collections import defaultdict
from pathlib import Path
import psutil
import shutil
from frigate.config import FrigateConfig
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
from friga... | 37.90534 | 129 | 0.539284 | import datetime
import json
import logging
import os
import queue
import subprocess as sp
import threading
import time
from collections import defaultdict
from pathlib import Path
import psutil
import shutil
from frigate.config import FrigateConfig
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
from friga... | true | true |
f726743c2af55562de0a399b95ee66d6a3d5ea4c | 900 | py | Python | WebSpider/threads.py | bianQ/similarweb | 3df31af1267a285d0bc6adf720409ceb43eb56cb | [
"MIT"
] | null | null | null | WebSpider/threads.py | bianQ/similarweb | 3df31af1267a285d0bc6adf720409ceb43eb56cb | [
"MIT"
] | null | null | null | WebSpider/threads.py | bianQ/similarweb | 3df31af1267a285d0bc6adf720409ceb43eb56cb | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: Alan
@time: 2021/05/18
"""
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import traceback
class MultiThread(ThreadPoolExecutor):
def __init__(self, max_workers=None, thread_name_prefix=''):
super().__init__(max_worker... | 26.470588 | 70 | 0.628889 |
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import traceback
class MultiThread(ThreadPoolExecutor):
def __init__(self, max_workers=None, thread_name_prefix=''):
super().__init__(max_workers, thread_name_prefix)
def thread_log(self, worker):
try:
resul... | true | true |
f7267621fdc306ffafe3ecda31e41278dccdb8f2 | 2,478 | py | Python | tests/test_metadata_get.py | iris-edu-int/datacite | 4a3aa5b9bb156cee616848cc7c8d929ad76fa3cc | [
"BSD-3-Clause"
] | null | null | null | tests/test_metadata_get.py | iris-edu-int/datacite | 4a3aa5b9bb156cee616848cc7c8d929ad76fa3cc | [
"BSD-3-Clause"
] | null | null | null | tests/test_metadata_get.py | iris-edu-int/datacite | 4a3aa5b9bb156cee616848cc7c8d929ad76fa3cc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of DataCite.
#
# Copyright (C) 2015, 2016 CERN.
#
# DataCite is free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
"""Tests for /metadata GET."""
from __future__ import absolute_import... | 22.125 | 73 | 0.633172 |
from __future__ import absolute_import, print_function
import pytest
import responses
from helpers import APIURL, get_client
from datacite.errors import DataCiteForbiddenError, DataCiteGoneError, \
DataCiteNotFoundError, DataCiteServerError, DataCiteUnauthorizedError
@responses.activate
def test_meta... | true | true |
f72676b4fc76edae6f6177c02163528b28ab531e | 7,484 | py | Python | app/states/load.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | 1 | 2020-09-23T21:40:16.000Z | 2020-09-23T21:40:16.000Z | app/states/load.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | null | null | null | app/states/load.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | 3 | 2020-07-11T19:18:12.000Z | 2021-08-14T17:43:06.000Z | import json
import os
import boto3
import yaml
from lib.dynamodb import accounts_table, requirements_table, user_table, config_table
from lib.lambda_decorator.decorator import states_decorator
client_s3 = boto3.client('s3')
user_bucket = os.getenv('USER_BUCKET')
account_bucket = os.getenv('ACCOUNT_BUCKET')
requirem... | 36.686275 | 126 | 0.704436 | import json
import os
import boto3
import yaml
from lib.dynamodb import accounts_table, requirements_table, user_table, config_table
from lib.lambda_decorator.decorator import states_decorator
client_s3 = boto3.client('s3')
user_bucket = os.getenv('USER_BUCKET')
account_bucket = os.getenv('ACCOUNT_BUCKET')
requirem... | true | true |
f72676d4da3438923201ee65422d31a01243108f | 25,485 | py | Python | pytext/trainers/trainer.py | suo/pytext | 400c80b4c040de12028970a85ce0af864931e0f4 | [
"BSD-3-Clause"
] | null | null | null | pytext/trainers/trainer.py | suo/pytext | 400c80b4c040de12028970a85ce0af864931e0f4 | [
"BSD-3-Clause"
] | null | null | null | pytext/trainers/trainer.py | suo/pytext | 400c80b4c040de12028970a85ce0af864931e0f4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
import time
from contextlib import ExitStack as contextlib_ExitStack
from typing import Any, Iterable, List, Optional, Tuple
import torch
from pytext.common.constants import BatchContext, Stage
from pytext.c... | 41.371753 | 95 | 0.626368 |
import itertools
import time
from contextlib import ExitStack as contextlib_ExitStack
from typing import Any, Iterable, List, Optional, Tuple
import torch
from pytext.common.constants import BatchContext, Stage
from pytext.config import PyTextConfig
from pytext.config.component import (
Component,
Component... | true | true |
f7267815389b318d6a8e4cfe05c3808d59d955a5 | 6,214 | py | Python | fairseq/criterions/masked_adlm.py | a1600012888/fairseq | dbd2cd08fc396f919d2e737513095fcb966896c0 | [
"MIT"
] | null | null | null | fairseq/criterions/masked_adlm.py | a1600012888/fairseq | dbd2cd08fc396f919d2e737513095fcb966896c0 | [
"MIT"
] | null | null | null | fairseq/criterions/masked_adlm.py | a1600012888/fairseq | dbd2cd08fc396f919d2e737513095fcb966896c0 | [
"MIT"
] | 1 | 2020-04-01T03:31:00.000Z | 2020-04-01T03:31:00.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn.functional as F
from fairseq import metrics, utils
from fairseq.criterions import FairseqCriterion,... | 37.660606 | 100 | 0.60251 |
import math
import torch
import torch.nn.functional as F
from fairseq import metrics, utils
from fairseq.criterions import FairseqCriterion, register_criterion
@register_criterion('masked_adlm')
class MaskedAdLmLoss(FairseqCriterion):
def __init__(self, args, task):
super(MaskedAdLmLoss, self).__... | true | true |
f726783468013df7d862175c11e8671b1275bee8 | 1,929 | py | Python | campy/cameras/emu.py | Wolfffff/campy | 988e02fea70c1a14221ad3a9c350afa52cc9bcf5 | [
"MIT"
] | null | null | null | campy/cameras/emu.py | Wolfffff/campy | 988e02fea70c1a14221ad3a9c350afa52cc9bcf5 | [
"MIT"
] | null | null | null | campy/cameras/emu.py | Wolfffff/campy | 988e02fea70c1a14221ad3a9c350afa52cc9bcf5 | [
"MIT"
] | 1 | 2021-09-02T20:01:25.000Z | 2021-09-02T20:01:25.000Z | """
"""
from campy.cameras import unicam
import os
import time
import logging
import sys
import numpy as np
from collections import deque
import csv
import imageio
def LoadSystem(params):
return params["cameraMake"]
def GetDeviceList(system):
return system
def LoadDevice(cam_params):
return cam_p... | 18.028037 | 85 | 0.718507 |
from campy.cameras import unicam
import os
import time
import logging
import sys
import numpy as np
from collections import deque
import csv
import imageio
def LoadSystem(params):
return params["cameraMake"]
def GetDeviceList(system):
return system
def LoadDevice(cam_params):
return cam_params["de... | true | true |
f72678c8ed7735a73d4972ede696b84b944d05d8 | 5,881 | py | Python | src/odm_report_shot_coverage/models/reconstruction.py | terra-submersa/opensfm-camera-coverage | a9ad2bff799a5d0d07d7900fc7d1bf10bc489632 | [
"CNRI-Python"
] | null | null | null | src/odm_report_shot_coverage/models/reconstruction.py | terra-submersa/opensfm-camera-coverage | a9ad2bff799a5d0d07d7900fc7d1bf10bc489632 | [
"CNRI-Python"
] | null | null | null | src/odm_report_shot_coverage/models/reconstruction.py | terra-submersa/opensfm-camera-coverage | a9ad2bff799a5d0d07d7900fc7d1bf10bc489632 | [
"CNRI-Python"
] | null | null | null | import json
import logging
import geojson
import numpy as np
from tqdm import tqdm
from scipy import stats
from odm_report_shot_coverage.models.camera import Camera, json_parse_camera
from odm_report_shot_coverage.models.shot import Shot, shot_boundaries_from_points, Boundaries
from odm_report_shot_coverage.models.wa... | 38.94702 | 102 | 0.660602 | import json
import logging
import geojson
import numpy as np
from tqdm import tqdm
from scipy import stats
from odm_report_shot_coverage.models.camera import Camera, json_parse_camera
from odm_report_shot_coverage.models.shot import Shot, shot_boundaries_from_points, Boundaries
from odm_report_shot_coverage.models.wa... | true | true |
f72678e2fc3806ded2ce42f11e552a9f29cbd3ae | 3,757 | py | Python | demo.py | SeongSuKim95/ReID-Baseline-swin | f30db86eb2690c20c4fbb0189eb52b57358705df | [
"MIT"
] | null | null | null | demo.py | SeongSuKim95/ReID-Baseline-swin | f30db86eb2690c20c4fbb0189eb52b57358705df | [
"MIT"
] | null | null | null | demo.py | SeongSuKim95/ReID-Baseline-swin | f30db86eb2690c20c4fbb0189eb52b57358705df | [
"MIT"
] | 1 | 2022-03-18T19:09:47.000Z | 2022-03-18T19:09:47.000Z | import argparse
import scipy.io
import torch
import numpy as np
import os
from torchvision import datasets
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
#######################################################################
# Evaluate
parser = argparse.ArgumentParser(description='Demo')
parse... | 33.846847 | 116 | 0.625233 | import argparse
import scipy.io
import torch
import numpy as np
import os
from torchvision import datasets
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
| true | true |
f72678eeeaa3ab01da38b3b2d287901a2acbed5a | 512 | py | Python | week_2/tests/lab8_p2.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | 2 | 2020-11-20T07:43:40.000Z | 2021-05-14T14:40:41.000Z | week_2/tests/lab8_p2.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | null | null | null | week_2/tests/lab8_p2.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | 2 | 2020-06-18T20:35:40.000Z | 2020-09-27T02:54:31.000Z | test = {
'name': '8.2',
'suites': [
{
'cases': [
{
'code': r"""
>>> # It looks like one of your variables is not named
>>> # correctly. Maybe there's a typo?
>>> 'avg_flt' in vars()
True
"""
},
{
'code': r"""
... | 20.48 | 69 | 0.363281 | test = {
'name': '8.2',
'suites': [
{
'cases': [
{
'code': r"""
>>> # It looks like one of your variables is not named
>>> # correctly. Maybe there's a typo?
>>> 'avg_flt' in vars()
True
"""
},
{
'code': r"""
... | true | true |
f726790477f564ff202bf60ffff1010f2a6df250 | 3,687 | py | Python | rlkit/envs/point_robot.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 381 | 2019-03-19T22:55:14.000Z | 2022-03-26T18:56:17.000Z | rlkit/envs/point_robot.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 27 | 2019-04-30T04:04:51.000Z | 2022-03-03T18:20:11.000Z | rlkit/envs/point_robot.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 107 | 2019-03-22T06:09:24.000Z | 2022-01-30T13:34:38.000Z | import numpy as np
from gym import spaces
from gym import Env
from . import register_env
@register_env('point-robot')
class PointEnv(Env):
"""
point robot on a 2-D plane with position control
tasks (aka goals) are positions on the plane
- tasks sampled from unit square
- reward is L2 distance
... | 29.97561 | 102 | 0.55872 | import numpy as np
from gym import spaces
from gym import Env
from . import register_env
@register_env('point-robot')
class PointEnv(Env):
def __init__(self, randomize_tasks=False, n_tasks=2):
if randomize_tasks:
np.random.seed(1337)
goals = [[np.random.uniform(-1., 1.), np.rand... | true | true |
f726796f43413d696b184ac1361a1c85145f966b | 217 | py | Python | vispy/gloo/gl/ext.py | mssurajkaiga/vispy-experiments | 0f3a19e0f4ac46608da792cbd36ebe59b036bce7 | [
"BSD-3-Clause"
] | 1 | 2017-06-12T16:24:11.000Z | 2017-06-12T16:24:11.000Z | vispy/gloo/gl/ext.py | mssurajkaiga/vispy-experiments | 0f3a19e0f4ac46608da792cbd36ebe59b036bce7 | [
"BSD-3-Clause"
] | null | null | null | vispy/gloo/gl/ext.py | mssurajkaiga/vispy-experiments | 0f3a19e0f4ac46608da792cbd36ebe59b036bce7 | [
"BSD-3-Clause"
] | null | null | null | """ Namespace for functions and constants corresponding to
OpenGL ES 2.0 extensions.
"""
from __future__ import division
from ._constants_ext import * # noqa
# Filled with functions when vispy.gloo.gl is imported
| 21.7 | 58 | 0.774194 |
from __future__ import division
from ._constants_ext import *
| true | true |
f72679f63807e54ba5c5c8c8ffd1b689e7012f08 | 297 | py | Python | lab/logger/destinations/__init__.py | gear/lab | ad1c5838acbcc98abb5d5d93d5c7a6c2b74bdfa2 | [
"MIT"
] | null | null | null | lab/logger/destinations/__init__.py | gear/lab | ad1c5838acbcc98abb5d5d93d5c7a6c2b74bdfa2 | [
"MIT"
] | null | null | null | lab/logger/destinations/__init__.py | gear/lab | ad1c5838acbcc98abb5d5d93d5c7a6c2b74bdfa2 | [
"MIT"
] | null | null | null | from typing import List, Union, Tuple
from lab.logger.colors import StyleCode
class Destination:
def log(self, parts: List[Union[str, Tuple[str, StyleCode]]], *,
is_new_line=True):
raise NotImplementedError()
def new_line(self):
raise NotImplementedError()
| 22.846154 | 68 | 0.680135 | from typing import List, Union, Tuple
from lab.logger.colors import StyleCode
class Destination:
def log(self, parts: List[Union[str, Tuple[str, StyleCode]]], *,
is_new_line=True):
raise NotImplementedError()
def new_line(self):
raise NotImplementedError()
| true | true |
f7267a892bdf070ee3c7619d0af334682563f6a0 | 3,432 | py | Python | simulation_3.py | ballcarsen/Networks_3_Forwarding | af211612a097db15a1605311c5c537e8bd279b12 | [
"Apache-2.0"
] | null | null | null | simulation_3.py | ballcarsen/Networks_3_Forwarding | af211612a097db15a1605311c5c537e8bd279b12 | [
"Apache-2.0"
] | null | null | null | simulation_3.py | ballcarsen/Networks_3_Forwarding | af211612a097db15a1605311c5c537e8bd279b12 | [
"Apache-2.0"
] | null | null | null | '''
Created on Oct 12, 2016
@author: mwittie
'''
import network_3
import link_3
import threading
from time import sleep
##configuration parameters
router_queue_size = 0 # 0 means unlimited
simulation_time = 1 # give the network sufficient time to transfer all packets before quitting
if __name__ == '__main__':
... | 32.377358 | 110 | 0.708333 | import network_3
import link_3
import threading
from time import sleep
simulation_time = 1
if __name__ == '__main__':
routing_dict = {'router_a': {"1" : 0, "2": 1}, 'router_d': {"3" : 0, "4": 1}}
object_L = []
host_1 = network_3.Host(1)
object_L.append(host_1)
host_2 = network_3.Host... | true | true |
f7267bf3fd0336a906e4c44012962c01fabd366c | 799 | py | Python | Hackerrank_codes/arithmetic_operators.py | Vyshnavmt94/HackerRankTasks | 634c71ccf0bea7585498bcd7d63e34d0334b4678 | [
"MIT"
] | null | null | null | Hackerrank_codes/arithmetic_operators.py | Vyshnavmt94/HackerRankTasks | 634c71ccf0bea7585498bcd7d63e34d0334b4678 | [
"MIT"
] | null | null | null | Hackerrank_codes/arithmetic_operators.py | Vyshnavmt94/HackerRankTasks | 634c71ccf0bea7585498bcd7d63e34d0334b4678 | [
"MIT"
] | null | null | null | """
Task
The provided code stub reads two integers from STDIN, and . Add code to print three lines where:
The first line contains the sum of the two numbers.
The second line contains the difference of the two numbers (first - second).
The third line contains the product of the two numbers.
Example
Print the followi... | 13.775862 | 97 | 0.677096 |
def check(n):
if n>=1 and n<=10**10:
return True
if __name__ == '__main__':
a = int(input())
b = int(input())
if check(a) and check(b):
print(a+b)
print(a-b)
print(a*b) | true | true |
f7267c622825114ec43fa387fd5603751837e983 | 3,783 | py | Python | allure-pytest/test/acceptance/status/base_teardown_status_test.py | ammarnajjar/allure-python | 975aaf94d75428330c07976c1cdfc364b9a3cafa | [
"Apache-2.0"
] | 5 | 2018-02-12T11:40:38.000Z | 2018-06-10T20:29:00.000Z | allure-pytest/test/acceptance/status/base_teardown_status_test.py | ammarnajjar/allure-python | 975aaf94d75428330c07976c1cdfc364b9a3cafa | [
"Apache-2.0"
] | null | null | null | allure-pytest/test/acceptance/status/base_teardown_status_test.py | ammarnajjar/allure-python | 975aaf94d75428330c07976c1cdfc364b9a3cafa | [
"Apache-2.0"
] | 1 | 2020-01-25T03:54:39.000Z | 2020-01-25T03:54:39.000Z | from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status
from allure_commons_test.result import has_status_details
from allure_commons_test.result import with_message_contains
from allure_commons_test.result import with_trace_contains
from ... | 49.12987 | 118 | 0.487708 | from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status
from allure_commons_test.result import has_status_details
from allure_commons_test.result import with_message_contains
from allure_commons_test.result import with_trace_contains
from ... | true | true |
f7267d5166a3b5c62a2fa38a85120010bbb91685 | 264 | py | Python | backend/authentication/admin.py | rajc1729/django-nextjs-realtime | 4d551f544729cc71a02878ad198dab665840987a | [
"MIT"
] | null | null | null | backend/authentication/admin.py | rajc1729/django-nextjs-realtime | 4d551f544729cc71a02878ad198dab665840987a | [
"MIT"
] | null | null | null | backend/authentication/admin.py | rajc1729/django-nextjs-realtime | 4d551f544729cc71a02878ad198dab665840987a | [
"MIT"
] | null | null | null | from django.contrib import admin
from authentication.models import CustomUser
# Register your models here.
class CustomUserAdmin(admin.ModelAdmin):
list_display = ['username','first_name','last_name','email']
admin.site.register(CustomUser, CustomUserAdmin) | 29.333333 | 64 | 0.799242 | from django.contrib import admin
from authentication.models import CustomUser
class CustomUserAdmin(admin.ModelAdmin):
list_display = ['username','first_name','last_name','email']
admin.site.register(CustomUser, CustomUserAdmin) | true | true |
f7267f0cc12c13e4532cd65a56c9b3d01c13894f | 14,738 | py | Python | selfdrive/locationd/locationd.py | sejongjoa/openpilot_083 | ff8277b6b51241af6b9ba37dcf55dcb6bfcc9d18 | [
"MIT"
] | 20 | 2020-12-04T12:20:57.000Z | 2022-03-31T00:40:15.000Z | selfdrive/locationd/locationd.py | wangyueguo/- | 301500dff6bd53e64257898cac939b24f56befac | [
"MIT"
] | 6 | 2020-03-06T18:13:55.000Z | 2020-07-20T05:10:20.000Z | selfdrive/locationd/locationd.py | wangyueguo/- | 301500dff6bd53e64257898cac939b24f56befac | [
"MIT"
] | 35 | 2021-03-18T23:28:11.000Z | 2021-06-24T17:36:22.000Z | #!/usr/bin/env python3
import json
import numpy as np
import sympy as sp
import cereal.messaging as messaging
from cereal import log
from common.params import Params
import common.transformations.coordinates as coord
from common.transformations.orientation import ecef_euler_from_ned, \
... | 41.988604 | 132 | 0.70688 |
import json
import numpy as np
import sympy as sp
import cereal.messaging as messaging
from cereal import log
from common.params import Params
import common.transformations.coordinates as coord
from common.transformations.orientation import ecef_euler_from_ned, \
euler_fr... | true | true |
f7267fe4a54f406a59df97aff7b19b741d435024 | 3,773 | py | Python | OpenStack.py | minidfx/Cloud-Python- | c9e4741c4c4f7de77f439e2786cca7f03f70cad9 | [
"MIT"
] | null | null | null | OpenStack.py | minidfx/Cloud-Python- | c9e4741c4c4f7de77f439e2786cca7f03f70cad9 | [
"MIT"
] | null | null | null | OpenStack.py | minidfx/Cloud-Python- | c9e4741c4c4f7de77f439e2786cca7f03f70cad9 | [
"MIT"
] | null | null | null | # Getting started with OpenStack using libcloud
# http://developer.openstack.org/firstapp-libcloud/getting_started.html
from libcloud.compute.ssh import *
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from Cloud import Cloud
from settings import *
# noinspection PyPep8N... | 35.59434 | 95 | 0.602703 |
from libcloud.compute.ssh import *
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from Cloud import Cloud
from settings import *
class OpenStack(Cloud):
def __init__(self):
super().__init__()
openstack = get_driver(Provider.OPENSTACK)
self.... | true | true |
f726800b4ff9c7c04844b758f410a70599a4f3f6 | 967 | py | Python | mergeforms/from cms10/test_wordTemplate.py | mbronstein/ssa412 | 32de4e44f16cf2044788428da2a3bab271ebcb9a | [
"MIT"
] | null | null | null | mergeforms/from cms10/test_wordTemplate.py | mbronstein/ssa412 | 32de4e44f16cf2044788428da2a3bab271ebcb9a | [
"MIT"
] | null | null | null | mergeforms/from cms10/test_wordTemplate.py | mbronstein/ssa412 | 32de4e44f16cf2044788428da2a3bab271ebcb9a | [
"MIT"
] | null | null | null | from unittest import TestCase, skip
import os
from docxtpl import DocxTemplate
class TestDocxTemplate(TestCase):
def setUp(self):
self.APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
self.FIXTURE_DIR = os.path.join(os.path.dirname(self.APP_DIR), 'fixtures')
self.FO... | 34.535714 | 84 | 0.679421 | from unittest import TestCase, skip
import os
from docxtpl import DocxTemplate
class TestDocxTemplate(TestCase):
def setUp(self):
self.APP_DIR = os.path.abspath(os.path.dirname(__file__))
self.FIXTURE_DIR = os.path.join(os.path.dirname(self.APP_DIR), 'fixtures')
self.FORM_DIR = os.path... | true | true |
f726812fa813373e14802dbfe2defbcd7a440e6d | 4,637 | py | Python | apps/permissions.py | Github-shipchain/transmission | 867971cdc366ccfd6ef632f39652633c269e7969 | [
"Apache-2.0"
] | 1 | 2019-12-15T13:44:29.000Z | 2019-12-15T13:44:29.000Z | apps/permissions.py | Github-shipchain/transmission | 867971cdc366ccfd6ef632f39652633c269e7969 | [
"Apache-2.0"
] | null | null | null | apps/permissions.py | Github-shipchain/transmission | 867971cdc366ccfd6ef632f39652633c269e7969 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 ShipChain, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... | 35.669231 | 116 | 0.723528 |
from django.db.models import Q
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import permissions, status
from shipchain_common.authentication import get_jwt_from_request
from apps.shipments.models import Shipment, PermissionLink
PROFILES_WALLET_URL = f'{s... | true | true |
f7268157ef2a0bd8d69f9adfb748756be3029bea | 5,766 | py | Python | pgoapi/protos/pogoprotos/networking/requests/messages/get_asset_digest_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 14 | 2017-03-28T16:32:24.000Z | 2021-03-13T23:03:57.000Z | pgoapi/protos/pogoprotos/networking/requests/messages/get_asset_digest_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 8 | 2017-03-01T07:56:09.000Z | 2017-08-15T07:37:12.000Z | pgoapi/protos/pogoprotos/networking/requests/messages/get_asset_digest_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 15 | 2017-02-24T01:30:23.000Z | 2021-06-27T08:46:43.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/get_asset_digest_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as ... | 47.262295 | 613 | 0.772112 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f726822728d9822a12dc779ca59f2edd95742b2b | 812 | py | Python | vendimaenv/lib/python2.7/site-packages/funcy/py2.py | soru13/vendimia | ebcf85473855e6f990b1a49574ac669fdd4d443e | [
"MIT"
] | null | null | null | vendimaenv/lib/python2.7/site-packages/funcy/py2.py | soru13/vendimia | ebcf85473855e6f990b1a49574ac669fdd4d443e | [
"MIT"
] | 5 | 2020-02-11T23:26:24.000Z | 2022-01-13T00:39:54.000Z | vendimaenv/lib/python2.7/site-packages/funcy/py2.py | soru13/vendimia | ebcf85473855e6f990b1a49574ac669fdd4d443e | [
"MIT"
] | null | null | null | import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .debug import *
from .primitives import *
# Setup __all__
modu... | 23.882353 | 87 | 0.64532 | import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .debug import *
from .primitives import *
modules = ('calc', ... | true | true |
f726841a3369bd4d21c176bdb301ddb10b209714 | 160 | py | Python | scenarios/api_key_delete/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 12 | 2015-04-12T06:18:33.000Z | 2021-03-03T23:54:19.000Z | scenarios/api_key_delete/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 1 | 2021-11-24T20:10:19.000Z | 2021-11-24T20:10:19.000Z | scenarios/api_key_delete/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 14 | 2015-03-23T17:52:06.000Z | 2021-11-24T11:04:15.000Z | import balanced
balanced.configure('ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY')
key = balanced.APIKey.fetch('/api_keys/AK3DQGzROuoRYulKXMQdHBxX')
key.delete() | 26.666667 | 65 | 0.83125 | import balanced
balanced.configure('ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY')
key = balanced.APIKey.fetch('/api_keys/AK3DQGzROuoRYulKXMQdHBxX')
key.delete() | true | true |
f726841edd23cffe106d88311ba375ae4ca2b996 | 7,722 | py | Python | cornac/models/hft/recom_hft.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | null | null | null | cornac/models/hft/recom_hft.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | null | null | null | cornac/models/hft/recom_hft.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | 1 | 2020-03-19T13:58:33.000Z | 2020-03-19T13:58:33.000Z | # Copyright 2018 The Cornac 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 ... | 38.41791 | 119 | 0.642191 |
import numpy as np
from ..recommender import Recommender
from ...exception import ScoreException
class HFT(Recommender):
def __init__(self, name='HFT', k=10, max_iter=50, grad_iter=50,
lambda_text=0.1, l2_reg=0.001, vocab_size=8000,
init_params=None, trainable=T... | true | true |
f726847a942ebeed78eb3cd894dacd72c3644eb4 | 101 | py | Python | main.py | marcacohen/mynewsfeed.io | b1debfab02c5dd6d618acd798792c906a4bb4c47 | [
"Apache-2.0"
] | 1 | 2020-11-10T16:07:24.000Z | 2020-11-10T16:07:24.000Z | main.py | marcacohen/mynewsfeed.io | b1debfab02c5dd6d618acd798792c906a4bb4c47 | [
"Apache-2.0"
] | null | null | null | main.py | marcacohen/mynewsfeed.io | b1debfab02c5dd6d618acd798792c906a4bb4c47 | [
"Apache-2.0"
] | null | null | null | from web import app
app.run(host='0.0.0.0',port=8080, use_reloader=True, debug=True, threaded=True)
| 25.25 | 79 | 0.742574 | from web import app
app.run(host='0.0.0.0',port=8080, use_reloader=True, debug=True, threaded=True)
| true | true |
f726861fe715da3c897ba6b113c2784dd07089b9 | 572 | py | Python | planutils/settings.py | AI-Planning/planning-utils | 2ab7015cfe52505c7972ed9e7066bdd3c769153f | [
"MIT"
] | 1 | 2020-04-18T15:30:58.000Z | 2020-04-18T15:30:58.000Z | planutils/settings.py | AI-Planning/planning-utils | 2ab7015cfe52505c7972ed9e7066bdd3c769153f | [
"MIT"
] | 3 | 2020-04-21T17:09:06.000Z | 2020-04-28T15:50:07.000Z | planutils/settings.py | AI-Planning/planning-utils | 2ab7015cfe52505c7972ed9e7066bdd3c769153f | [
"MIT"
] | null | null | null |
import json, os
from planutils import manifest_converter
# This should eventually be changed once the prefix is customizable
PLANUTILS_PREFIX = os.path.join(os.path.expanduser('~'), '.planutils')
SETTINGS_FILE = os.path.join(PLANUTILS_PREFIX, 'settings.json')
PAAS_SERVER = 'http://45.113.232.43:5001'
PAAS_SERVER_L... | 24.869565 | 70 | 0.713287 |
import json, os
from planutils import manifest_converter
PLANUTILS_PREFIX = os.path.join(os.path.expanduser('~'), '.planutils')
SETTINGS_FILE = os.path.join(PLANUTILS_PREFIX, 'settings.json')
PAAS_SERVER = 'http://45.113.232.43:5001'
PAAS_SERVER_LIMIT = 100
def load():
with open(SETTINGS_FILE, 'r') as f:
... | true | true |
f726862b7ddae2271ecd69d2a01c433b3d758f10 | 2,349 | py | Python | tools/mo/unit_tests/mo/load/loader_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/load/loader_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/load/loader_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from openvino.tools.mo.load.tf.loader import graph_or_sub_graph_has_nhwc_ops
from unit_tests.utils.graph import build_graph, result, regular_op, const, connect_front
class TFLoaderTest(unittest.Test... | 34.544118 | 117 | 0.613027 |
import unittest
import numpy as np
from openvino.tools.mo.load.tf.loader import graph_or_sub_graph_has_nhwc_ops
from unit_tests.utils.graph import build_graph, result, regular_op, const, connect_front
class TFLoaderTest(unittest.TestCase):
@staticmethod
def build_conv_graph():
nodes = {
... | true | true |
f726869b16a3c31ae1abced42c8498b5f9a71273 | 390 | py | Python | shorty/wsgi.py | alazaro/shorty | 2a75c2f1351b3ada20c551159f8f22b04284ead1 | [
"MIT"
] | null | null | null | shorty/wsgi.py | alazaro/shorty | 2a75c2f1351b3ada20c551159f8f22b04284ead1 | [
"MIT"
] | 1 | 2021-06-10T19:02:19.000Z | 2021-06-10T19:02:19.000Z | shorty/wsgi.py | alazaro/shorty | 2a75c2f1351b3ada20c551159f8f22b04284ead1 | [
"MIT"
] | null | null | null | """
WSGI config for shorty project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 22.941176 | 78 | 0.784615 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shorty.settings")
application = get_wsgi_application()
| true | true |
f72686bfb1c06e1c972ddd0550910b6f66064e90 | 1,361 | py | Python | other/password_generator.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 12 | 2020-02-11T22:18:10.000Z | 2021-06-23T02:56:07.000Z | other/password_generator.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 1 | 2019-09-26T08:03:36.000Z | 2019-09-26T08:03:36.000Z | other/password_generator.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 18 | 2020-02-09T13:00:11.000Z | 2021-03-11T08:47:36.000Z | """Password generator allows you to generate a random password of length N."""
from random import choice
from string import ascii_letters, digits, punctuation
def password_generator(length=8):
"""
>>> len(password_generator())
8
>>> len(password_generator(length=16))
16
>>> len(password_genera... | 26.173077 | 84 | 0.68626 | from random import choice
from string import ascii_letters, digits, punctuation
def password_generator(length=8):
chars = tuple(ascii_letters) + tuple(digits) + tuple(punctuation)
return "".join(choice(chars) for x in range(length))
def alternative_password_generator(ctbi, i):
pass
def ... | true | true |
f726874106f79a0d94063c9a43eae7fc697a4f84 | 2,283 | py | Python | mindware/components/feature_engineering/transformations/rescaler/quantile_transformer.py | jhj0411jhj/soln-ml | 002ec06bf139b14bc059e0f0438501b31d9ed16a | [
"MIT"
] | 27 | 2021-07-19T09:03:34.000Z | 2022-03-31T06:19:23.000Z | mindware/components/feature_engineering/transformations/rescaler/quantile_transformer.py | jhj0411jhj/soln-ml | 002ec06bf139b14bc059e0f0438501b31d9ed16a | [
"MIT"
] | 4 | 2021-07-15T12:17:10.000Z | 2022-01-26T17:16:58.000Z | mindware/components/feature_engineering/transformations/rescaler/quantile_transformer.py | jhj0411jhj/soln-ml | 002ec06bf139b14bc059e0f0438501b31d9ed16a | [
"MIT"
] | 17 | 2020-05-12T20:24:50.000Z | 2021-07-11T03:31:38.000Z | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter, \
CategoricalHyperparameter
from mindware.components.feature_engineering.transformations.base_transformer import *
class QuantileTransformation(Transformer):
type = 5
def _... | 40.767857 | 109 | 0.65922 | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter, \
CategoricalHyperparameter
from mindware.components.feature_engineering.transformations.base_transformer import *
class QuantileTransformation(Transformer):
type = 5
def _... | true | true |
f726877422782de259695a0ce16eb5bc2f697d80 | 360 | py | Python | resource_path.py | UAlbanyArchives/EADMachine-2.0 | 18e155f76374b295c287d32c6e54ef8ecabe29d2 | [
"MIT"
] | 5 | 2016-01-25T15:27:12.000Z | 2021-08-17T22:31:48.000Z | source/GUI/resource_path.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | null | null | null | source/GUI/resource_path.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | null | null | null | import os
import sys
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
retur... | 30 | 76 | 0.691667 | import os
import sys
def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path) | true | true |
f72687e80bced94fac9dfc6fc885ba3a3a16f55e | 1,067 | py | Python | plugins/threatstack/icon_threatstack/actions/get_rule/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/threatstack/icon_threatstack/actions/get_rule/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/threatstack/icon_threatstack/actions/get_rule/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import insightconnect_plugin_runtime
from .schema import GetRuleInput, GetRuleOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.helper import clean
from threatstack.errors import ThreatStackAPIError, ThreatStackClientError, APIRateLimitError
from insightconnect_plugin_runtime.e... | 38.107143 | 103 | 0.730084 | import insightconnect_plugin_runtime
from .schema import GetRuleInput, GetRuleOutput, Input, Output, Component
from insightconnect_plugin_runtime.helper import clean
from threatstack.errors import ThreatStackAPIError, ThreatStackClientError, APIRateLimitError
from insightconnect_plugin_runtime.exceptions import Plugi... | true | true |
f72688f4329669467a3225780b13734675bc50e3 | 383 | py | Python | geonames/exceptions.py | flyingdice/geonames-sqlite | acf51d9af723d46815c43509ce22712ce910a61e | [
"Apache-2.0"
] | null | null | null | geonames/exceptions.py | flyingdice/geonames-sqlite | acf51d9af723d46815c43509ce22712ce910a61e | [
"Apache-2.0"
] | null | null | null | geonames/exceptions.py | flyingdice/geonames-sqlite | acf51d9af723d46815c43509ce22712ce910a61e | [
"Apache-2.0"
] | null | null | null | """
geonames/exceptions
~~~~~~~~~~~~~~~~~~~
"""
from . import base
def ignore_foreign_key_constraint(db, options, record: base.T, exception: Exception) -> bool:
return 'FOREIGN KEY constraint failed' in str(exception)
def ignore_unique_key_constraint(db, options, record: base.T, exception: Exception) ->... | 27.357143 | 93 | 0.697128 | from . import base
def ignore_foreign_key_constraint(db, options, record: base.T, exception: Exception) -> bool:
return 'FOREIGN KEY constraint failed' in str(exception)
def ignore_unique_key_constraint(db, options, record: base.T, exception: Exception) -> bool:
return 'UNIQUE constraint failed' in str(exce... | true | true |
f7268900a2f97b94ecc6e2a71419685ab31bc7d7 | 131,714 | py | Python | rpython/rlib/parsing/pypackrat.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rlib/parsing/pypackrat.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rlib/parsing/pypackrat.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null |
from rpython.rlib.parsing.tree import Nonterminal, Symbol
from rpython.rlib.parsing.makepackrat import PackratParser, BacktrackException, Status
class Parser(object):
def NAME(self):
return self._NAME().result
def _NAME(self):
_key = self._pos
_status = self._dict_NAME.get(_key, None)... | 42.014035 | 93 | 0.466374 |
from rpython.rlib.parsing.tree import Nonterminal, Symbol
from rpython.rlib.parsing.makepackrat import PackratParser, BacktrackException, Status
class Parser(object):
def NAME(self):
return self._NAME().result
def _NAME(self):
_key = self._pos
_status = self._dict_NAME.get(_key, None)... | true | true |
f7268b17e5afdf9edaac16ec22aa1865bf00ab9e | 6,337 | py | Python | RecoTracker/ConversionSeedGenerators/python/PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | RecoTracker/ConversionSeedGenerators/python/PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 26 | 2018-10-30T12:47:58.000Z | 2022-03-29T08:39:00.000Z | RecoTracker/ConversionSeedGenerators/python/PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi.py | p2l1pfp/cmssw | 9bda22bf33ecf18dd19a3af2b3a8cbdb1de556a9 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
from RecoTracker.TkSeedGenerator.SeedGeneratorFromRegionHitsEDProducer_cfi import seedGeneratorFromRegionHitsEDProducer
CommonClusterCheckPSet = seedGeneratorFromRegionHitsEDProducer.ClusterCheckPSet
photonConvTrajSeedFromSingleLeg = cms.EDProducer("PhotonConversionTraject... | 70.411111 | 153 | 0.453369 | import FWCore.ParameterSet.Config as cms
from RecoTracker.TkSeedGenerator.SeedGeneratorFromRegionHitsEDProducer_cfi import seedGeneratorFromRegionHitsEDProducer
CommonClusterCheckPSet = seedGeneratorFromRegionHitsEDProducer.ClusterCheckPSet
photonConvTrajSeedFromSingleLeg = cms.EDProducer("PhotonConversionTraject... | true | true |
f7268b2e949d82a8bd564b36aff123357d5bc3a1 | 9,689 | py | Python | client_server_test/NEWGUI.py | hades208002/mdp-project | c242a8d00412cc3772d298986977f6acc47002ee | [
"MIT"
] | null | null | null | client_server_test/NEWGUI.py | hades208002/mdp-project | c242a8d00412cc3772d298986977f6acc47002ee | [
"MIT"
] | null | null | null | client_server_test/NEWGUI.py | hades208002/mdp-project | c242a8d00412cc3772d298986977f6acc47002ee | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
import tkinter.filedialog as fd
import pandas as pd
from LocalModelCommunication import LocalModelCommunication
from APP import APP
class GUI(object):
def __init__(self):
# overall
self.tabControl = None
self.tab_step1 = None
self.tab_step2 = None
self.tab_step3... | 31.254839 | 100 | 0.716999 | from tkinter import *
from tkinter import ttk
import tkinter.filedialog as fd
import pandas as pd
from LocalModelCommunication import LocalModelCommunication
from APP import APP
class GUI(object):
def __init__(self):
self.tabControl = None
self.tab_step1 = None
self.tab_step2 = None
self.tab_step3 = None
... | true | true |
f7268c06513bb9fa62c71a99d8cdf748c117880d | 14,879 | py | Python | cifar_cnn_three_conv.py | sidneyp/bidirectional | d3d1dbb727e5a25b4980646f1eb500245072f079 | [
"BSD-3-Clause"
] | 8 | 2018-05-22T10:02:51.000Z | 2022-01-11T03:02:51.000Z | cifar_cnn_three_conv.py | sidneyp/bidirectional | d3d1dbb727e5a25b4980646f1eb500245072f079 | [
"BSD-3-Clause"
] | null | null | null | cifar_cnn_three_conv.py | sidneyp/bidirectional | d3d1dbb727e5a25b4980646f1eb500245072f079 | [
"BSD-3-Clause"
] | 2 | 2021-01-07T19:39:19.000Z | 2021-11-14T09:06:35.000Z | import tensorflow as tf
import keras
from keras.datasets import cifar10
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
import sys
import csv
import utils_csv
import utils_tf as utils
from cleverhans.utils_tf import model_train, model_eval
from cleverhans.attacks impo... | 43.00289 | 178 | 0.699308 | import tensorflow as tf
import keras
from keras.datasets import cifar10
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
import sys
import csv
import utils_csv
import utils_tf as utils
from cleverhans.utils_tf import model_train, model_eval
from cleverhans.attacks impo... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.