hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f026f94398b8471132157eb9acf7e08bb8b2e6 | 1,585 | py | Python | store/migrations/0013_auto_20200502_1703.py | it5prasoon/ShoppingCart | c7d5a9d72af1a7f305b59798d3eae63f19522641 | [
"MIT"
] | 2 | 2020-05-06T11:33:45.000Z | 2021-02-01T12:53:43.000Z | store/migrations/0013_auto_20200502_1703.py | it5prasoon/ShoppingCart | c7d5a9d72af1a7f305b59798d3eae63f19522641 | [
"MIT"
] | null | null | null | store/migrations/0013_auto_20200502_1703.py | it5prasoon/ShoppingCart | c7d5a9d72af1a7f305b59798d3eae63f19522641 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2020-05-02 11:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('store', '0012_auto_20200502_1644'),
]
operations = [
migrations.CreateModel(
name='Variation',
... | 33.020833 | 156 | 0.574763 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('store', '0012_auto_20200502_1644'),
]
operations = [
migrations.CreateModel(
name='Variation',
fields=[
('id', mode... | true | true |
08f0283ed5c67842f1fc1e67eb25ee6ae231808d | 1,284 | py | Python | tests/callbacks/test_callbacks.py | siriuslee/composer | 938ac0028c8622d5c59d8a3c470c85a326b8b6ee | [
"Apache-2.0"
] | null | null | null | tests/callbacks/test_callbacks.py | siriuslee/composer | 938ac0028c8622d5c59d8a3c470c85a326b8b6ee | [
"Apache-2.0"
] | null | null | null | tests/callbacks/test_callbacks.py | siriuslee/composer | 938ac0028c8622d5c59d8a3c470c85a326b8b6ee | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
import pytest
from composer.core import Event
from composer.core.callback import Callback
from composer.core.engine import Engine
from composer.core.logging import Logger
from composer.core.state import State
def test_callbacks_map_to_events():
# callback methods ... | 30.571429 | 94 | 0.718069 |
import pytest
from composer.core import Event
from composer.core.callback import Callback
from composer.core.engine import Engine
from composer.core.logging import Logger
from composer.core.state import State
def test_callbacks_map_to_events():
cb = Callback()
excluded_methods = ["state_dict", "load... | true | true |
08f0284bad3987183f93f2242fef67aa3007eeee | 756 | py | Python | tests/pubsub/test_gossipsub_backward_compatibility.py | g-r-a-n-t/py-libp2p | 36a4a9150dcc53b42315b5c6868fccde5083963b | [
"Apache-2.0",
"MIT"
] | 315 | 2019-02-13T01:29:09.000Z | 2022-03-28T13:44:07.000Z | tests/pubsub/test_gossipsub_backward_compatibility.py | pipermerriam/py-libp2p | 379a157d6b67e86a616b2458af519bbe5fb26a51 | [
"Apache-2.0",
"MIT"
] | 249 | 2019-02-22T05:00:07.000Z | 2022-03-29T16:30:46.000Z | tests/pubsub/test_gossipsub_backward_compatibility.py | ralexstokes/py-libp2p | 5144ab82894623969cb17baf0d4c64bd0a274068 | [
"Apache-2.0",
"MIT"
] | 77 | 2019-02-24T19:45:17.000Z | 2022-03-30T03:20:09.000Z | import functools
import pytest
from libp2p.tools.constants import FLOODSUB_PROTOCOL_ID
from libp2p.tools.factories import PubsubFactory
from libp2p.tools.pubsub.floodsub_integration_test_settings import (
floodsub_protocol_pytest_params,
perform_test_from_obj,
)
@pytest.mark.parametrize("test_case_obj", flo... | 27 | 74 | 0.731481 | import functools
import pytest
from libp2p.tools.constants import FLOODSUB_PROTOCOL_ID
from libp2p.tools.factories import PubsubFactory
from libp2p.tools.pubsub.floodsub_integration_test_settings import (
floodsub_protocol_pytest_params,
perform_test_from_obj,
)
@pytest.mark.parametrize("test_case_obj", flo... | true | true |
08f029f52fb324613a6b30859ac1bda20620ea8d | 21,936 | py | Python | datasets/sofc_materials_articles/sofc_materials_articles.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 10,608 | 2020-09-10T15:47:50.000Z | 2022-03-31T22:51:47.000Z | datasets/sofc_materials_articles/sofc_materials_articles.py | realChainLife/datasets | 98261e8b0b7be4dbaaa71ae188b950f7fbe51bbd | [
"Apache-2.0"
] | 2,396 | 2020-09-10T14:55:31.000Z | 2022-03-31T19:41:04.000Z | datasets/sofc_materials_articles/sofc_materials_articles.py | realChainLife/datasets | 98261e8b0b7be4dbaaa71ae188b950f7fbe51bbd | [
"Apache-2.0"
] | 1,530 | 2020-09-10T21:43:10.000Z | 2022-03-31T01:59:12.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | 46.67234 | 145 | 0.510029 |
import glob
import os
import pandas as pd
import datasets
_CITATION = """\
@misc{friedrich2020sofcexp,
title={The SOFC-Exp Corpus and Neural Approaches to Information Extraction in the Materials Science Domain},
author={Annemarie Friedrich and Heike Adel and Federico Tomazic and Johannes Hingerl and R... | true | true |
08f02a79f663f85a5f6f4692ddb84f698a52a1a1 | 6,878 | py | Python | analysis/plot_sequence_diversity.py | baymlab/wastewater_analysis | b009452669fa32c9a1a204c461725dd0a3a996c9 | [
"MIT"
] | 10 | 2021-09-02T19:34:45.000Z | 2022-01-28T03:11:25.000Z | analysis/plot_sequence_diversity.py | baymlab/wastewater_analysis | b009452669fa32c9a1a204c461725dd0a3a996c9 | [
"MIT"
] | 7 | 2021-09-16T16:33:52.000Z | 2022-01-13T12:09:46.000Z | analysis/plot_sequence_diversity.py | baymlab/wastewater_analysis | b009452669fa32c9a1a204c461725dd0a3a996c9 | [
"MIT"
] | 6 | 2021-09-23T21:01:30.000Z | 2022-02-10T02:09:42.000Z | #!/usr/bin/env python3
import sys
import os
import argparse
import matplotlib.pyplot as plt
colors = {
'B.1.1.7': (0.4980392156862745, 0.788235294117647, 0.4980392156862745, 1.0),
'B.1.351': (0.9921568627450981, 0.7529411764705882, 0.5254901960784314, 1.0),
'B.1.427': (0.2196078431372549, 0.42352941176470... | 36.010471 | 108 | 0.591596 |
import sys
import os
import argparse
import matplotlib.pyplot as plt
colors = {
'B.1.1.7': (0.4980392156862745, 0.788235294117647, 0.4980392156862745, 1.0),
'B.1.351': (0.9921568627450981, 0.7529411764705882, 0.5254901960784314, 1.0),
'B.1.427': (0.2196078431372549, 0.4235294117647059, 0.6901960784313725,... | true | true |
08f02a82e1c6b5881b3dccf825c6f4216fbc0d41 | 329 | py | Python | pyargcbr/cbrs/lists_operations.py | jaumejordan/pyargcbr | 70892360a500e83215449d98ef06746adb1ab51a | [
"MIT"
] | 1 | 2021-06-24T17:15:16.000Z | 2021-06-24T17:15:16.000Z | pyargcbr/cbrs/lists_operations.py | jaumejordan/pyargcbr | 70892360a500e83215449d98ef06746adb1ab51a | [
"MIT"
] | null | null | null | pyargcbr/cbrs/lists_operations.py | jaumejordan/pyargcbr | 70892360a500e83215449d98ef06746adb1ab51a | [
"MIT"
] | null | null | null | from typing import Sequence, TypeVar, List
T = TypeVar('T')
def merge_lists_using_sets(list1: List[T], list2: Sequence[T]):
list1 += list(set(list2) - set(list1))
def merge_lists_by_looping(list1: List[T], list2: Sequence[T]):
for element in list2:
if element not in list1:
list1.append(... | 23.5 | 63 | 0.671733 | from typing import Sequence, TypeVar, List
T = TypeVar('T')
def merge_lists_using_sets(list1: List[T], list2: Sequence[T]):
list1 += list(set(list2) - set(list1))
def merge_lists_by_looping(list1: List[T], list2: Sequence[T]):
for element in list2:
if element not in list1:
list1.append(... | true | true |
08f02b70e8cb92e7e0f20b6f73ec3fe25ae0d83f | 1,330 | py | Python | app/__init__.py | hzh0292/monitor-python | bb64ca3db703485fa64419d0bcaea52b67dd5552 | [
"MIT"
] | 26 | 2019-06-09T02:40:09.000Z | 2022-01-27T08:08:20.000Z | app/__init__.py | wenmaai/monitor-python | acf4ce0c6ac7b5de848fbd8cca3f20c81967e3a5 | [
"MIT"
] | 1 | 2019-07-09T12:49:04.000Z | 2019-07-09T12:49:04.000Z | app/__init__.py | wenmaai/monitor-python | acf4ce0c6ac7b5de848fbd8cca3f20c81967e3a5 | [
"MIT"
] | 11 | 2019-06-09T02:33:35.000Z | 2022-01-26T07:14:01.000Z | # -*- coding: utf-8 -*-
# 导入数据库连接驱动
import mysql.connector
# 导入web框架
import tornado.web
# 导入http服务
import tornado.httpserver
# 导入输入/输出事件循环
import tornado.ioloop
# 导入配置工具
import tornado.options
# 导入选项、定义配置的函数
from tornado.options import options, define
# 导入配置
from app.configs import configs, mysql_configs
# 导入路由
from ap... | 23.75 | 106 | 0.675188 | import mysql.connector
import tornado.web
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.options import options, define
from app.configs import configs, mysql_configs
from app.urls import urls
from app.tools.async_orm import make_session_factory
define("port", default=8000, type=in... | true | true |
08f02bfd27855b10fd1a9aca5a4c7405ba754127 | 40,658 | py | Python | lazy-cseq2.0/modules/lazyseqaiswarm.py | GiuseppeDiPalma/LazyCseq-LockFree-benchmak-generator | f0e945672d69209a4103e0f37330a328482d1ffd | [
"MIT"
] | 1 | 2021-08-24T06:16:00.000Z | 2021-08-24T06:16:00.000Z | lazy-cseq2.0/modules/lazyseqaiswarm.py | GiuseppeDiPalma/LazyCseq-LockFree-benchmak-generator | f0e945672d69209a4103e0f37330a328482d1ffd | [
"MIT"
] | null | null | null | lazy-cseq2.0/modules/lazyseqaiswarm.py | GiuseppeDiPalma/LazyCseq-LockFree-benchmak-generator | f0e945672d69209a4103e0f37330a328482d1ffd | [
"MIT"
] | 2 | 2020-12-29T13:31:08.000Z | 2020-12-29T23:14:14.000Z | """ Lazy-CSeq Sequentialization module (for Framac)
(swarm version of the corresponding name module)
maintained by Truc Nguyen Lam, University of Southampton.
"""
VERSION = 'lazyseqaiswarm-0.1-2016.09.14'
"""
Transformation:
special transformation for AbstractInterpretation Tool
Support:
frama... | 46.519451 | 262 | 0.550716 | """ Lazy-CSeq Sequentialization module (for Framac)
(swarm version of the corresponding name module)
maintained by Truc Nguyen Lam, University of Southampton.
"""
VERSION = 'lazyseqaiswarm-0.1-2016.09.14'
"""
Transformation:
special transformation for AbstractInterpretation Tool
Support:
frama... | false | true |
08f02cd50b48f06d6f6b368bcb3c0b0ed90df89b | 555 | py | Python | test.py | gabrielrojasnyc/iot | e3895f257bcb1e25b3f2d9cfd24c2b4530eddeea | [
"Apache-2.0"
] | null | null | null | test.py | gabrielrojasnyc/iot | e3895f257bcb1e25b3f2d9cfd24c2b4530eddeea | [
"Apache-2.0"
] | null | null | null | test.py | gabrielrojasnyc/iot | e3895f257bcb1e25b3f2d9cfd24c2b4530eddeea | [
"Apache-2.0"
] | null | null | null |
stock_prices_yesterday = [10, 7, 5, 8, 11, 9]
def get_max_profits(stock_prices_yesterday):
buy_stock = 0
sell_stock = stock_prices_yesterday[0]
for number in stock_prices_yesterday:
if number > buy_stock:
buy_stock = number
elif number < sell_stock:
sell_stock = ... | 19.821429 | 45 | 0.652252 |
stock_prices_yesterday = [10, 7, 5, 8, 11, 9]
def get_max_profits(stock_prices_yesterday):
buy_stock = 0
sell_stock = stock_prices_yesterday[0]
for number in stock_prices_yesterday:
if number > buy_stock:
buy_stock = number
elif number < sell_stock:
sell_stock = ... | true | true |
08f02d1645513513150918eabac40ef2f3bb2b4f | 608 | py | Python | spillway/compat.py | timgates42/django-spillway | f5700e21e545106005a99ba0804f7d6c88038553 | [
"BSD-3-Clause"
] | 62 | 2015-01-20T22:21:09.000Z | 2019-11-25T12:57:53.000Z | spillway/compat.py | timgates42/django-spillway | f5700e21e545106005a99ba0804f7d6c88038553 | [
"BSD-3-Clause"
] | 24 | 2015-01-07T00:03:10.000Z | 2021-06-10T17:34:35.000Z | spillway/compat.py | timgates42/django-spillway | f5700e21e545106005a99ba0804f7d6c88038553 | [
"BSD-3-Clause"
] | 19 | 2015-01-12T18:08:29.000Z | 2020-08-10T17:16:31.000Z | from django.core.exceptions import ImproperlyConfigured
from rest_framework.utils import encoders
try:
import simplejson as json
except ImportError:
import json
JSONEncoder = encoders.JSONEncoder
else:
# Workaround to support simplejson 2.2+, see
# https://github.com/simplejson/simplejson/issues/37... | 26.434783 | 66 | 0.726974 | from django.core.exceptions import ImproperlyConfigured
from rest_framework.utils import encoders
try:
import simplejson as json
except ImportError:
import json
JSONEncoder = encoders.JSONEncoder
else:
class JSONEncoder(json.JSONEncoder):
default = encoders.JSONEncoder().default
try:
... | true | true |
08f02d3e5cd496e4fd6a54256b5ae03e29bbe34b | 19,489 | py | Python | python/learn/thinkbayes/thinkplot.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | 2 | 2017-06-07T03:20:42.000Z | 2020-01-07T09:14:26.000Z | python/learn/thinkbayes/thinkplot.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | python/learn/thinkbayes/thinkplot.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import math
import matplotlib
import... | 25.475817 | 77 | 0.591513 |
from __future__ import print_function
import math
import matplotlib
import matplotlib.pyplot as pyplot
import numpy as np
import pandas
import warnings
class _Brewer(object):
color_iter = None
colors = ['#f7fbff', '#deebf7', '#c6dbef',
'#9ecae1', '#6baed6', '#4292c6',
'#21... | true | true |
08f02e564825a24eef439feaf5f90190b0d5ed20 | 1,405 | py | Python | software_testing/exercises/exercise1/triangle.py | rafaelleinio/software-testing | 0cb9e95b65675121360a0e47ad127666c6c5ae7d | [
"MIT"
] | 1 | 2021-02-28T02:12:35.000Z | 2021-02-28T02:12:35.000Z | software_testing/exercises/exercise1/triangle.py | rafaelleinio/software-testing | 0cb9e95b65675121360a0e47ad127666c6c5ae7d | [
"MIT"
] | null | null | null | software_testing/exercises/exercise1/triangle.py | rafaelleinio/software-testing | 0cb9e95b65675121360a0e47ad127666c6c5ae7d | [
"MIT"
] | null | null | null | """Triangle Module."""
class TriangleTypes:
"""Triangle types enumerator."""
EQUILATERAL = "Equilateral"
ISOSCELES = "Isosceles"
SCALENE = "Scalene"
class Triangle:
"""Basic triangle definition.
Attributes:
side_a: first side of the triangle.
side_b: second side of the tria... | 26.509434 | 75 | 0.619217 |
class TriangleTypes:
EQUILATERAL = "Equilateral"
ISOSCELES = "Isosceles"
SCALENE = "Scalene"
class Triangle:
def __init__(self, side_a: float, side_b: float, side_c: float):
self.side_a = side_a
self.side_b = side_b
self.side_c = side_c
self._validate_triagle()
... | true | true |
08f02fc4fa13ae0ff214fd45efcbe486a662f2f1 | 26,276 | py | Python | artview/components/correlation.py | savelov/artview | 83c918757d6ae51cecc7589af4ab279e2c750bfe | [
"BSD-3-Clause"
] | null | null | null | artview/components/correlation.py | savelov/artview | 83c918757d6ae51cecc7589af4ab279e2c750bfe | [
"BSD-3-Clause"
] | 1 | 2021-12-30T17:57:03.000Z | 2022-01-01T20:05:20.000Z | artview/components/correlation.py | savelov/artview | 83c918757d6ae51cecc7589af4ab279e2c750bfe | [
"BSD-3-Clause"
] | 1 | 2021-12-30T17:33:17.000Z | 2021-12-30T17:33:17.000Z | """
plot_radar.py
Class instance used to make Display.
"""
# Load the needed packages
import numpy as np
import scipy
import os
import pyart
from matplotlib.backends.qt_compat import is_pyqt5
if is_pyqt5():
from matplotlib.backends.backend_qt5agg import (
FigureCanvas, NavigationToolbar2QT as NavigationTo... | 37.376956 | 87 | 0.599825 | import numpy as np
import scipy
import os
import pyart
from matplotlib.backends.qt_compat import is_pyqt5
if is_pyqt5():
from matplotlib.backends.backend_qt5agg import (
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
else:
from matplotlib.backends.backend_qt4agg import (
FigureCanvas,... | true | true |
08f031005fed5ef06a75a28453fd41f0806f4e3e | 6,846 | py | Python | build/scripts-3.6/put_mars_nodes.py | gibsonxavier/mars_importer | f8d90d702b6b6ac6ee33d2acede8df75ea7cbd13 | [
"MIT"
] | null | null | null | build/scripts-3.6/put_mars_nodes.py | gibsonxavier/mars_importer | f8d90d702b6b6ac6ee33d2acede8df75ea7cbd13 | [
"MIT"
] | null | null | null | build/scripts-3.6/put_mars_nodes.py | gibsonxavier/mars_importer | f8d90d702b6b6ac6ee33d2acede8df75ea7cbd13 | [
"MIT"
] | null | null | null | #!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
"""put_mars_nodes
Usage:
put_mars_nodes [options] source <source_dir>
put_mars_nodes [options]
Options:
--config=CONFIG Use this config file [default: /usr/local/etc/graphit.conf]
--timeout=SEC Set HTTP read timeout [default: 300]
"""
... | 50.711111 | 171 | 0.4461 |
from gevent import monkey; monkey.patch_all()
from docopt import docopt
import os import json import os
import sys
from helper import get_config, get_session
from gevent.pool import Pool
import graphit, requests
import re
data_list = {}
def push_mars_def(source_dir, filename, session):
with open(os.path.jo... | true | true |
08f032a9f126578aa82baa407642e3aa9cd0c7e6 | 5,495 | py | Python | psana/psana/graphqt/DMQWMain.py | ZhenghengLi/lcls2 | 94e75c6536954a58c8937595dcac295163aa1cdf | [
"BSD-3-Clause-LBNL"
] | 16 | 2017-11-09T17:10:56.000Z | 2022-03-09T23:03:10.000Z | psana/psana/graphqt/DMQWMain.py | ZhenghengLi/lcls2 | 94e75c6536954a58c8937595dcac295163aa1cdf | [
"BSD-3-Clause-LBNL"
] | 6 | 2017-12-12T19:30:05.000Z | 2020-07-09T00:28:33.000Z | psana/psana/graphqt/DMQWMain.py | ZhenghengLi/lcls2 | 94e75c6536954a58c8937595dcac295163aa1cdf | [
"BSD-3-Clause-LBNL"
] | 25 | 2017-09-18T20:02:43.000Z | 2022-03-27T22:27:42.000Z |
"""Class :py:class:`DMQWMain` is a QWidget for File Manager of LCLS1
========================================================================
Usage ::
# Run test: python lcls2/psana/psana/graphqt/DMQWMain.py
from psana.graphqt.DMQWMain import DMQWMain
See method:
Created on 2021-08-10 by Mikhail Dubrovin
... | 30.359116 | 103 | 0.62384 |
import logging
logger = logging.getLogger(__name__)
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout, QSplitter, QTextEdit
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QTextCursor
from psana.graphqt.CMConfigParameters import cp, dir_calib, expname_def
from psana.graphqt.D... | true | true |
08f0332eb45d49e21698d75aa87625a723460e7f | 6,459 | py | Python | app/main/views/letter_branding.py | aldidoanta/notifications-admin | 2a565e363ae96e0503c8442fc7e822e31e53231d | [
"MIT"
] | null | null | null | app/main/views/letter_branding.py | aldidoanta/notifications-admin | 2a565e363ae96e0503c8442fc7e822e31e53231d | [
"MIT"
] | null | null | null | app/main/views/letter_branding.py | aldidoanta/notifications-admin | 2a565e363ae96e0503c8442fc7e822e31e53231d | [
"MIT"
] | null | null | null | from botocore.exceptions import ClientError as BotoClientError
from flask import (
current_app,
redirect,
render_template,
request,
session,
url_for,
)
from notifications_python_client.errors import HTTPError
from app import letter_branding_client
from app.main import main
from app.main.forms i... | 35.883333 | 106 | 0.680136 | from botocore.exceptions import ClientError as BotoClientError
from flask import (
current_app,
redirect,
render_template,
request,
session,
url_for,
)
from notifications_python_client.errors import HTTPError
from app import letter_branding_client
from app.main import main
from app.main.forms i... | true | true |
08f0344c492cf2d20861b500f30086c5d6cbe206 | 117 | py | Python | noise/backends/experimental/__init__.py | jarret/noiseprotocol | e737e159b5c836ff03e4dc93ac386a4e7d610ec8 | [
"MIT"
] | 169 | 2017-09-12T20:43:39.000Z | 2022-03-20T15:23:31.000Z | noise/backends/experimental/__init__.py | jarret/noiseprotocol | e737e159b5c836ff03e4dc93ac386a4e7d610ec8 | [
"MIT"
] | 32 | 2017-09-13T11:03:12.000Z | 2021-06-23T15:25:40.000Z | noise/backends/experimental/__init__.py | jarret/noiseprotocol | e737e159b5c836ff03e4dc93ac386a4e7d610ec8 | [
"MIT"
] | 18 | 2018-03-15T19:28:51.000Z | 2021-11-01T18:59:20.000Z | from noise.backends.experimental.backend import ExperimentalNoiseBackend
noise_backend = ExperimentalNoiseBackend()
| 29.25 | 72 | 0.880342 | from noise.backends.experimental.backend import ExperimentalNoiseBackend
noise_backend = ExperimentalNoiseBackend()
| true | true |
08f0352ece06f74984a854d09c4d1b5694969870 | 4,173 | py | Python | python/spark_sklearn/test_utils.py | WeichenXu123/spark-sklearn | cbde36f6311b73d967e2ec8a97040dfd71eca579 | [
"Apache-2.0"
] | 1,151 | 2016-01-13T22:45:24.000Z | 2022-03-22T22:03:18.000Z | python/spark_sklearn/test_utils.py | WeichenXu123/spark-sklearn | cbde36f6311b73d967e2ec8a97040dfd71eca579 | [
"Apache-2.0"
] | 83 | 2016-02-10T12:35:07.000Z | 2019-12-03T00:21:24.000Z | python/spark_sklearn/test_utils.py | WeichenXu123/spark-sklearn | cbde36f6311b73d967e2ec8a97040dfd71eca579 | [
"Apache-2.0"
] | 270 | 2016-01-13T22:45:26.000Z | 2022-02-05T03:39:27.000Z | """
Some test utilities to create the spark context.
"""
import numpy as np
import os
import pandas as pd
import random
from scipy.sparse import csr_matrix
import time
from pyspark.sql import SparkSession
from pyspark.ml.linalg import Vectors
from spark_sklearn.util import createLocalSparkSession
import sys
if sys.ver... | 36.286957 | 91 | 0.661874 |
import numpy as np
import os
import pandas as pd
import random
from scipy.sparse import csr_matrix
import time
from pyspark.sql import SparkSession
from pyspark.ml.linalg import Vectors
from spark_sklearn.util import createLocalSparkSession
import sys
if sys.version_info[:2] <= (2, 6):
try:
import unittest... | true | true |
08f0357e14cfca4090a13ad7ef1d0e215aea1ec9 | 5,213 | py | Python | harness/determined/common/experimental/trial.py | BlueskyFR/determined | ac734f0df11565333f9f37480cfc01dda011e349 | [
"Apache-2.0"
] | 1 | 2022-03-22T01:02:19.000Z | 2022-03-22T01:02:19.000Z | harness/determined/common/experimental/trial.py | BlueskyFR/determined | ac734f0df11565333f9f37480cfc01dda011e349 | [
"Apache-2.0"
] | null | null | null | harness/determined/common/experimental/trial.py | BlueskyFR/determined | ac734f0df11565333f9f37480cfc01dda011e349 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from determined.common import check
from determined.common.experimental import checkpoint, session
class TrialReference:
"""
A TrialReference object is usually obtained from
``determined.experimental.client.get_trial()``.
Trial reference class used for querying relevant
... | 38.902985 | 99 | 0.613275 | from typing import Optional
from determined.common import check
from determined.common.experimental import checkpoint, session
class TrialReference:
def __init__(self, trial_id: int, session: session.Session):
self.id = trial_id
self._session = session
def kill(self) -> None:
self._... | true | true |
08f035a858fe0bd2c84ef8865d830f2c35940e1a | 361 | py | Python | qa/apps.py | gileadslostson/es-django-example | 65c752f2a3a5deeae38de516790977cdbe652a77 | [
"Apache-2.0"
] | 181 | 2015-06-12T06:16:34.000Z | 2022-02-04T18:31:49.000Z | qa/apps.py | gileadslostson/es-django-example | 65c752f2a3a5deeae38de516790977cdbe652a77 | [
"Apache-2.0"
] | 18 | 2015-07-22T14:40:13.000Z | 2018-05-15T19:20:11.000Z | qa/apps.py | gileadslostson/es-django-example | 65c752f2a3a5deeae38de516790977cdbe652a77 | [
"Apache-2.0"
] | 53 | 2015-07-09T04:30:11.000Z | 2022-02-04T18:31:53.000Z | from django.apps import AppConfig
from django.conf import settings
from elasticsearch_dsl.connections import connections
from elasticsearch.exceptions import NotFoundError
from .search import Question, Answer
class QAConfig(AppConfig):
name = 'qa'
verbose_name = "Q & A"
def ready(self):
connecti... | 24.066667 | 56 | 0.770083 | from django.apps import AppConfig
from django.conf import settings
from elasticsearch_dsl.connections import connections
from elasticsearch.exceptions import NotFoundError
from .search import Question, Answer
class QAConfig(AppConfig):
name = 'qa'
verbose_name = "Q & A"
def ready(self):
connecti... | true | true |
08f035d6a9b825bf48a519e062e79a9a5bb88a82 | 3,029 | py | Python | caffe2/distributed/store_ops_test_util.py | VisualJoyce/caffe2 | 4b5c2b5dfd13f057cd93558278d938d2bce0cff0 | [
"Apache-2.0"
] | 585 | 2015-08-10T02:48:52.000Z | 2021-12-01T08:46:59.000Z | caffe2/distributed/store_ops_test_util.py | PDFxy/caffe2 | 28523ff1ff33f18eaf8b04cc4e0f308826e1861a | [
"Apache-2.0"
] | 23 | 2015-08-30T11:54:51.000Z | 2017-03-06T03:01:07.000Z | caffe2/distributed/store_ops_test_util.py | PDFxy/caffe2 | 28523ff1ff33f18eaf8b04cc4e0f308826e1861a | [
"Apache-2.0"
] | 183 | 2015-08-10T02:49:04.000Z | 2021-12-01T08:47:13.000Z | # Copyright (c) 2016-present, Facebook, 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... | 32.923913 | 78 | 0.623638 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from multiprocessing import Process, Queue
import numpy as np
from caffe2.python import core, workspace
class StoreOpsTests(object):
@classmethod
def _test_s... | true | true |
08f0365798b4bacb57ac5899b9e4eae539b5f087 | 1,993 | py | Python | scripts/analyze.py | thentgesMindee/doctr | f97e92ba1b7bcb785a60f2cf549f13f88e510609 | [
"Apache-2.0"
] | 628 | 2021-02-13T21:49:37.000Z | 2022-03-31T19:48:57.000Z | scripts/analyze.py | thentgesMindee/doctr | f97e92ba1b7bcb785a60f2cf549f13f88e510609 | [
"Apache-2.0"
] | 694 | 2021-02-08T15:23:38.000Z | 2022-03-31T07:24:59.000Z | scripts/analyze.py | thentgesMindee/doctr | f97e92ba1b7bcb785a60f2cf549f13f88e510609 | [
"Apache-2.0"
] | 90 | 2021-04-28T05:39:02.000Z | 2022-03-31T06:48:36.000Z | # Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
from doctr.file_utils import is_tf_available
from doctr.io import Docume... | 33.779661 | 112 | 0.688409 |
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
from doctr.file_utils import is_tf_available
from doctr.io import DocumentFile
from doctr.models import ocr_predictor
if is_tf_available():
import tensorflow as tf
gpu_devices = tf.config.experimental.list_physical_devices('GPU')
if any(gpu_devices):
... | true | true |
08f0367a6057109df58bd3e1b57b8d3b5f9c39dc | 2,233 | py | Python | data/video/MTCNN_detect.py | JungleEngine/speech_separation | 7e7d56257c3dee6da43e2df45819f8b7f7285b4e | [
"MIT"
] | null | null | null | data/video/MTCNN_detect.py | JungleEngine/speech_separation | 7e7d56257c3dee6da43e2df45819f8b7f7285b4e | [
"MIT"
] | null | null | null | data/video/MTCNN_detect.py | JungleEngine/speech_separation | 7e7d56257c3dee6da43e2df45819f8b7f7285b4e | [
"MIT"
] | null | null | null | from mtcnn.mtcnn import MTCNN
import cv2
import pandas as pd
import os
cat_train = pd.read_csv('../audio/catalog/avspeech_train.csv')
frame_path = './frames/'
output_dir = 'face_input'
detect_range = (1811,2000)
def bounding_box_check(faces,x,y):
# check the center
for face in faces:
bounding_box = fa... | 31.9 | 117 | 0.605464 | from mtcnn.mtcnn import MTCNN
import cv2
import pandas as pd
import os
cat_train = pd.read_csv('../audio/catalog/avspeech_train.csv')
frame_path = './frames/'
output_dir = 'face_input'
detect_range = (1811,2000)
def bounding_box_check(faces,x,y):
for face in faces:
bounding_box = face['box']
i... | true | true |
08f03680fb2b98f242a00af6c708064e1ed9dcb2 | 28 | py | Python | data/studio21_generated/introductory/3086/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/introductory/3086/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/introductory/3086/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | def unflatten(flat_array):
| 14 | 26 | 0.785714 | def unflatten(flat_array):
| false | true |
08f036d5a3e48d7513ec1479be391e6343b53129 | 1,592 | py | Python | examples/multiobjective/moead/moead_iepsilon_lircmop1.py | 12yuens2/jMetalPy | 6f54940cb205df831f5498e2eac2520b331ee4fd | [
"MIT"
] | null | null | null | examples/multiobjective/moead/moead_iepsilon_lircmop1.py | 12yuens2/jMetalPy | 6f54940cb205df831f5498e2eac2520b331ee4fd | [
"MIT"
] | null | null | null | examples/multiobjective/moead/moead_iepsilon_lircmop1.py | 12yuens2/jMetalPy | 6f54940cb205df831f5498e2eac2520b331ee4fd | [
"MIT"
] | null | null | null | from jmetal.algorithm.multiobjective.moead import MOEADIEpsilon
from jmetal.operator import PolynomialMutation, DifferentialEvolutionCrossover
from jmetal.problem.multiobjective.lircmop import LIRCMOP2
from jmetal.util.aggregative_function import Tschebycheff
from jmetal.util.solution import read_solutions, print_funct... | 41.894737 | 106 | 0.772613 | from jmetal.algorithm.multiobjective.moead import MOEADIEpsilon
from jmetal.operator import PolynomialMutation, DifferentialEvolutionCrossover
from jmetal.problem.multiobjective.lircmop import LIRCMOP2
from jmetal.util.aggregative_function import Tschebycheff
from jmetal.util.solution import read_solutions, print_funct... | true | true |
08f0378d17473f35a96b7f7ef170be845e1323e6 | 2,777 | py | Python | 28byj-48-driver.py | Pharylon/28byj-48-Driver-For-Raspberry-Pi | 95e37619eb46fff64003838afa4a420d34bf266b | [
"BSD-3-Clause"
] | 7 | 2016-03-28T20:18:11.000Z | 2020-07-12T08:25:24.000Z | 28byj-48-driver.py | Pharylon/28byj-48-Driver-For-Raspberry-Pi | 95e37619eb46fff64003838afa4a420d34bf266b | [
"BSD-3-Clause"
] | 2 | 2016-08-28T23:28:26.000Z | 2017-07-27T16:36:43.000Z | 28byj-48-driver.py | Pharylon/28byj-48-Driver-For-Raspberry-Pi | 95e37619eb46fff64003838afa4a420d34bf266b | [
"BSD-3-Clause"
] | 4 | 2016-11-09T07:42:11.000Z | 2019-10-14T21:01:25.000Z | __author__ = 'Pharylon'
import time
import RPi.GPIO as GPIO
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-w", "--wait", type=float, default=0.001, help="Time to wait (in seconds) between steps. Default time is 0.001")
parser.add_argument("-s", "--steps", type=int, default=500, help="Number... | 29.231579 | 142 | 0.708318 | __author__ = 'Pharylon'
import time
import RPi.GPIO as GPIO
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-w", "--wait", type=float, default=0.001, help="Time to wait (in seconds) between steps. Default time is 0.001")
parser.add_argument("-s", "--steps", type=int, default=500, help="Number... | false | true |
08f037c599f21a79acaca3a9c001e7df9a6077e3 | 1,904 | py | Python | azure-mgmt-web/azure/mgmt/web/models/error_entity.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-web/azure/mgmt/web/models/error_entity.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-web/azure/mgmt/web/models/error_entity.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 38.857143 | 76 | 0.603992 |
from msrest.serialization import Model
class ErrorEntity(Model):
_attribute_map = {
'extended_code': {'key': 'extendedCode', 'type': 'str'},
'message_template': {'key': 'messageTemplate', 'type': 'str'},
'parameters': {'key': 'parameters', 'type': '[str]'},
'inner_errors': {'key'... | true | true |
08f037ca09a5c80dad10477ace35e259df94a2c6 | 389 | py | Python | Chapter08/myshop/myshop/asgi.py | prathmesh-jagtap/Django-4-by-example | 8a9418f746117c1637db0900182e8f4454cdff5e | [
"MIT"
] | 1 | 2022-02-08T09:43:23.000Z | 2022-02-08T09:43:23.000Z | Chapter08/myshop/myshop/asgi.py | prathmesh-jagtap/Django-4-by-example | 8a9418f746117c1637db0900182e8f4454cdff5e | [
"MIT"
] | null | null | null | Chapter08/myshop/myshop/asgi.py | prathmesh-jagtap/Django-4-by-example | 8a9418f746117c1637db0900182e8f4454cdff5e | [
"MIT"
] | null | null | null | """
ASGI config for myshop project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myshop.settings')
application = get_asgi_application()
| true | true |
08f0383ff134bec536cd27a7f8fe855202fcbad7 | 663 | py | Python | updater/reports/ReportTeamsTotal.py | rashamalek/hubble | 508cc0ce4ef60fb968df5e7252ee878bf83c929f | [
"MIT"
] | null | null | null | updater/reports/ReportTeamsTotal.py | rashamalek/hubble | 508cc0ce4ef60fb968df5e7252ee878bf83c929f | [
"MIT"
] | 1 | 2022-03-02T10:13:49.000Z | 2022-03-02T10:13:49.000Z | updater/reports/ReportTeamsTotal.py | rashamalek/hubble | 508cc0ce4ef60fb968df5e7252ee878bf83c929f | [
"MIT"
] | null | null | null | from .ReportDaily import *
# Lists the total number of organizations
class ReportTeamsTotal(ReportDaily):
def name(self):
return "teams-total"
def updateDailyData(self):
newHeader, newData = self.parseData(
self.executeQuery(self.query())
)
self.header = newHeader if newHeader else self.header
self.dat... | 23.678571 | 55 | 0.690799 | from .ReportDaily import *
class ReportTeamsTotal(ReportDaily):
def name(self):
return "teams-total"
def updateDailyData(self):
newHeader, newData = self.parseData(
self.executeQuery(self.query())
)
self.header = newHeader if newHeader else self.header
self.data.extend(newData)
self.truncateData(self... | true | true |
08f0389075e2dccdd75cc51512b1f4074a2e1436 | 600 | py | Python | ads_dashboard/ads/management/commands/load_stats.py | vintage/ads_dashboard | 85a8540411a9af0a2e41dd3730b52e3c6b3805d4 | [
"MIT"
] | null | null | null | ads_dashboard/ads/management/commands/load_stats.py | vintage/ads_dashboard | 85a8540411a9af0a2e41dd3730b52e3c6b3805d4 | [
"MIT"
] | 5 | 2020-02-12T09:18:05.000Z | 2021-09-22T18:05:21.000Z | ads_dashboard/ads/management/commands/load_stats.py | vintage/ads_dashboard | 85a8540411a9af0a2e41dd3730b52e3c6b3805d4 | [
"MIT"
] | null | null | null | import os
from django.core.management.base import BaseCommand
from django.conf import settings
from ads import parser
INITIAL_DATA_FILE = os.path.join(settings.BASE_DIR, "ads/data/initial.csv")
class Command(BaseCommand):
help = "Loads initial stats data from local file"
def handle(self, *args, **options)... | 27.272727 | 75 | 0.693333 | import os
from django.core.management.base import BaseCommand
from django.conf import settings
from ads import parser
INITIAL_DATA_FILE = os.path.join(settings.BASE_DIR, "ads/data/initial.csv")
class Command(BaseCommand):
help = "Loads initial stats data from local file"
def handle(self, *args, **options)... | true | true |
08f038cbc37ee90d43ae5a8cc9373e62518e31e0 | 1,351 | py | Python | tests/test_case_info.py | mscarey/court-scraper | 0e13976d901352a09cfd7e48450bbe427494f48e | [
"0BSD"
] | null | null | null | tests/test_case_info.py | mscarey/court-scraper | 0e13976d901352a09cfd7e48450bbe427494f48e | [
"0BSD"
] | null | null | null | tests/test_case_info.py | mscarey/court-scraper | 0e13976d901352a09cfd7e48450bbe427494f48e | [
"0BSD"
] | null | null | null | from court_scraper.case_info import CaseInfo
def test_merge():
data = {'foo': 'bar', 'case_num': 1}
data2 = {'baz': 'bang', 'case_num': 1}
case_info = CaseInfo(data)
case_info2 = CaseInfo(data2)
case_info.merge(case_info2)
assert case_info.case_num == 1
assert case_info.foo == 'bar'
... | 25.018519 | 44 | 0.573649 | from court_scraper.case_info import CaseInfo
def test_merge():
data = {'foo': 'bar', 'case_num': 1}
data2 = {'baz': 'bang', 'case_num': 1}
case_info = CaseInfo(data)
case_info2 = CaseInfo(data2)
case_info.merge(case_info2)
assert case_info.case_num == 1
assert case_info.foo == 'bar'
... | true | true |
08f039cfca347691bbe998a6a8dccfd83001d61c | 23 | py | Python | main/perl-parse-yapp/update.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | null | null | null | main/perl-parse-yapp/update.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | null | null | null | main/perl-parse-yapp/update.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | null | null | null | pkgname = "Parse-Yapp"
| 11.5 | 22 | 0.695652 | pkgname = "Parse-Yapp"
| true | true |
08f03a8eca09f44c9797cec80c7c7225c346a3a9 | 1,810 | py | Python | nanocppfw/database/database_objects.py | AndreasAlbert/nanocppfw | 9e0c88a0a7a98ec4fe1731106667a984976dd789 | [
"MIT"
] | null | null | null | nanocppfw/database/database_objects.py | AndreasAlbert/nanocppfw | 9e0c88a0a7a98ec4fe1731106667a984976dd789 | [
"MIT"
] | null | null | null | nanocppfw/database/database_objects.py | AndreasAlbert/nanocppfw | 9e0c88a0a7a98ec4fe1731106667a984976dd789 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from sqlalchemy import Column, Integer, String, Boolean, Float, Date
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy import ForeignKey
import sys
import os
Base = declarative_base()
class Period... | 23.815789 | 82 | 0.683425 |
from sqlalchemy import Column, Integer, String, Boolean, Float, Date
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy import ForeignKey
import sys
import os
Base = declarative_base()
class Period(Base):
__tabl... | true | true |
08f03c20572de416510bebc73e7019d6b0a7ce02 | 1,948 | py | Python | function.py | mrvir/incognitus | c1503b7ea0be4c3e0ad9ef44ddc98e57800ddfb7 | [
"MIT"
] | null | null | null | function.py | mrvir/incognitus | c1503b7ea0be4c3e0ad9ef44ddc98e57800ddfb7 | [
"MIT"
] | null | null | null | function.py | mrvir/incognitus | c1503b7ea0be4c3e0ad9ef44ddc98e57800ddfb7 | [
"MIT"
] | 1 | 2018-11-16T18:33:14.000Z | 2018-11-16T18:33:14.000Z | import requests
import config
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
def sendButton(user_id):
headers = {'content-type': 'application/json'}
payload = '{"recipient": {"id": '+user_id+'}, "message":{"attachment":{"type":"template","payload":{"template_type":"button","text":"What ... | 26.684932 | 310 | 0.703285 | import requests
import config
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
def sendButton(user_id):
headers = {'content-type': 'application/json'}
payload = '{"recipient": {"id": '+user_id+'}, "message":{"attachment":{"type":"template","payload":{"template_type":"button","text":"What ... | true | true |
08f03d283e0a19d59af800ac904c18532cf8709a | 2,590 | py | Python | JasonKe-v1/preprocess.py | jasonke1225/AI-introduction | 0748198fc926b1e2f79d2c679ef964ffcfa4ca45 | [
"MIT"
] | null | null | null | JasonKe-v1/preprocess.py | jasonke1225/AI-introduction | 0748198fc926b1e2f79d2c679ef964ffcfa4ca45 | [
"MIT"
] | null | null | null | JasonKe-v1/preprocess.py | jasonke1225/AI-introduction | 0748198fc926b1e2f79d2c679ef964ffcfa4ca45 | [
"MIT"
] | null | null | null | #%%
### make sure the file in ./primevalData folder should be format {'date, open, high, low, close, volume'}
### come from https://coinmarketcap.com/zh-tw/historical/
### the outpur csv file will be saved in ./usefulData folder
import pandas as pd
from stockstats import StockDataFrame as Sdf
import os
Month2num = {'... | 38.656716 | 105 | 0.512355 |
import pandas as pd
from stockstats import StockDataFrame as Sdf
import os
Month2num = {'Jan':'01', 'Feb':'02', 'Mar':'03', 'Apr':'04', 'May':'05', 'Jun':'06',\
'Jul':'07', 'Aug':'08', 'Sep':'09', 'Oct':'10', 'Nov':'11', 'Dec':'12'}
def arrangeData(foldername):
df_return = None
for filename in os.listdir... | true | true |
08f03f648baac6f02e9f84671e7c47801125090c | 16,451 | py | Python | clients/keto/python/ory_keto_client/api/write_api.py | ory/sdk-generator | 958314d130922ad6f20f439b5230141a832231a5 | [
"Apache-2.0"
] | null | null | null | clients/keto/python/ory_keto_client/api/write_api.py | ory/sdk-generator | 958314d130922ad6f20f439b5230141a832231a5 | [
"Apache-2.0"
] | null | null | null | clients/keto/python/ory_keto_client/api/write_api.py | ory/sdk-generator | 958314d130922ad6f20f439b5230141a832231a5 | [
"Apache-2.0"
] | null | null | null | """
Ory Keto API
Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. # noqa: E501
The version of the OpenAPI document: v0.8.0-alpha.2
Contact: hi@ory.sh
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from ory_keto_cl... | 37.13544 | 96 | 0.514254 |
import re import sys
from ory_keto_client.api_client import ApiClient, Endpoint as _Endpoint
from ory_keto_client.model_utils import ( check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from ory_keto_client.model.generic_error im... | true | true |
08f0404659acd3e85432a95e2b7e59b0f0ae325f | 1,308 | py | Python | scripts/create_fsmi_models.py | TehMillhouse/odie-server | 86d121b615de7037000d0d891e54704a1a54dc1f | [
"MIT"
] | null | null | null | scripts/create_fsmi_models.py | TehMillhouse/odie-server | 86d121b615de7037000d0d891e54704a1a54dc1f | [
"MIT"
] | null | null | null | scripts/create_fsmi_models.py | TehMillhouse/odie-server | 86d121b615de7037000d0d891e54704a1a54dc1f | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# one of two scripts to create the tables, types and schemas necessary for odie.
# Unfortunately we need to split these (nearly identical) scripts due to Flask-SQLAlchemy
# not correctly handling Enum creation when handling multiple databases.
# (See https://gist.github.com/TehMillhouse/fdaffc4... | 31.902439 | 89 | 0.750765 |
try:
import hack
except:
from scripts import hack
import config
uri = config.FlaskConfig.SQLALCHEMY_BINDS['fsmi']
config.FlaskConfig.SQLALCHEMY_BINDS = {'fsmi': uri}
config.FlaskConfig.SQLALCHEMY_DATABASE_URI = uri
import sqlalchemy
from sqlalchemy.schema import CreateSchema
from odie import sqla, app
de... | true | true |
08f041d835f7696003e9c42ffe072c443ab529b2 | 2,093 | py | Python | vb_suite/frame_methods.py | breisfeld/pandas | f1fd50bb8e7603042fe93e01e862766673e33450 | [
"BSD-3-Clause"
] | 10 | 2015-07-21T06:35:13.000Z | 2021-10-30T00:15:05.000Z | vb_suite/frame_methods.py | breisfeld/pandas | f1fd50bb8e7603042fe93e01e862766673e33450 | [
"BSD-3-Clause"
] | null | null | null | vb_suite/frame_methods.py | breisfeld/pandas | f1fd50bb8e7603042fe93e01e862766673e33450 | [
"BSD-3-Clause"
] | 5 | 2017-05-28T05:31:12.000Z | 2020-09-01T03:08:01.000Z | from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
#----------------------------------------------------------------------
# lookup
setup = common_setup + """
df = DataFrame(np.random.randn(10000, 8), columns=list('abcdefgh'))
df['foo'] = 'bar'
row_la... | 30.779412 | 79 | 0.538939 | from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
setup = common_setup + """
df = DataFrame(np.random.randn(10000, 8), columns=list('abcdefgh'))
df['foo'] = 'bar'
row_labels = list(df.index[::10])[:900]
col_labels = list(df.columns) * 100
row_labels_... | true | true |
08f0432c93f8f390bd7d7a71479785cb462167ba | 8,786 | py | Python | examples/acados_python/test/generate_c_code.py | besticka/acados | 32767a19aed01a15b5e7b83ebc6ddbd669a47954 | [
"BSD-2-Clause"
] | null | null | null | examples/acados_python/test/generate_c_code.py | besticka/acados | 32767a19aed01a15b5e7b83ebc6ddbd669a47954 | [
"BSD-2-Clause"
] | null | null | null | examples/acados_python/test/generate_c_code.py | besticka/acados | 32767a19aed01a15b5e7b83ebc6ddbd669a47954 | [
"BSD-2-Clause"
] | null | null | null | #
# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren,
# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor,
# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan,
# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl
#
# This file is part of acado... | 31.604317 | 178 | 0.669019 |
from acados_template import *
import acados_template as at
from export_ode_model import *
import numpy as np
import scipy.linalg
from ctypes import *
import json
import argparse
GENERATE_DATA = False
LOCAL_TEST = False
TEST_TOL = 1e-8
if LOCAL_TEST is True:
FORMULATION = 'LS'
SOLVER_TYPE = 'SQP_RTI'
QP_... | true | true |
08f04339fee4b979b65dfb80494f4f4dbf65d84b | 6,223 | py | Python | main.py | sachin1092/Hashtag-Recommender-System | 88993646a7863135b49a020d204ff20154423a1b | [
"MIT"
] | null | null | null | main.py | sachin1092/Hashtag-Recommender-System | 88993646a7863135b49a020d204ff20154423a1b | [
"MIT"
] | null | null | null | main.py | sachin1092/Hashtag-Recommender-System | 88993646a7863135b49a020d204ff20154423a1b | [
"MIT"
] | null | null | null | import heapq
import math
import re
import os
global stop_words
def read_stopwords():
words = []
with open(os.getcwd() + os.sep + "stopwords.txt", "r") as f:
for line in f.readlines():
line = line.strip()
if len(line):
words.append(line.lower())
return words
stop_words=read_stopwords()
... | 30.208738 | 119 | 0.666881 | import heapq
import math
import re
import os
global stop_words
def read_stopwords():
words = []
with open(os.getcwd() + os.sep + "stopwords.txt", "r") as f:
for line in f.readlines():
line = line.strip()
if len(line):
words.append(line.lower())
return words
stop_words=read_stopwords()
... | false | true |
08f0435639081a42d2fe435310510662ad812b78 | 851 | py | Python | .ci/ansible_install.py | msaladna/mitogen | c6824b68181729cb16c090e72f4d35d6c4d95523 | [
"BSD-3-Clause"
] | null | null | null | .ci/ansible_install.py | msaladna/mitogen | c6824b68181729cb16c090e72f4d35d6c4d95523 | [
"BSD-3-Clause"
] | null | null | null | .ci/ansible_install.py | msaladna/mitogen | c6824b68181729cb16c090e72f4d35d6c4d95523 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import ci_lib
batches = [
[
# Must be installed separately, as PyNACL indirect requirement causes
# newer version to be installed if done in a single pip run.
# Separately install ansible based on version passed in from azure-pipelines.yml or .travis.yml
'pip ... | 34.04 | 108 | 0.675676 |
import ci_lib
batches = [
[
'pip install "pycparser<2.19" "idna<2.7"',
'pip install '
'-r tests/requirements.txt '
'-r tests/ansible/requirements.txt',
'LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 pip install -q ansible=={0}'.format(ci_lib.... | true | true |
08f04482acfb1ba1ff2d7626d482b53e58af7723 | 821 | py | Python | flask/backend/__init__.py | djstein/django-flask-react-example | edebdeb61dcf35fa4d8ecbfc261353a4803edf09 | [
"MIT"
] | 1 | 2018-09-23T23:09:12.000Z | 2018-09-23T23:09:12.000Z | flask/backend/__init__.py | djstein/django-flask-react-example | edebdeb61dcf35fa4d8ecbfc261353a4803edf09 | [
"MIT"
] | null | null | null | flask/backend/__init__.py | djstein/django-flask-react-example | edebdeb61dcf35fa4d8ecbfc261353a4803edf09 | [
"MIT"
] | null | null | null | import os
from flask import Flask
from . import db
def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY="dev", DATABASE=os.path.join(app.instance_path, "flaskr.sqlite")
)
if test_config i... | 23.457143 | 83 | 0.656516 | import os
from flask import Flask
from . import db
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY="dev", DATABASE=os.path.join(app.instance_path, "flaskr.sqlite")
)
if test_config is None:
app.con... | true | true |
08f0452c7947bf56b01eff090e0671914a1dcbb8 | 345 | py | Python | py/tests/testIsPalindrome/test_IsPalindrome.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | 1 | 2022-01-26T16:33:45.000Z | 2022-01-26T16:33:45.000Z | py/tests/testIsPalindrome/test_IsPalindrome.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | null | null | null | py/tests/testIsPalindrome/test_IsPalindrome.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | 1 | 2022-01-26T16:35:44.000Z | 2022-01-26T16:35:44.000Z | from solns.isPalindrome.isPalindrome import *
import unittest
from parameterized import parameterized as p
class TestIsPalindrome(unittest.TestCase):
@p.expand([
[121,True],[-121,False],[10,False],[-101,False],[0,True]
])
def test_naive_isPalindrome(self,inp,expected):
self.assertEqual(Solu... | 34.5 | 64 | 0.727536 | from solns.isPalindrome.isPalindrome import *
import unittest
from parameterized import parameterized as p
class TestIsPalindrome(unittest.TestCase):
@p.expand([
[121,True],[-121,False],[10,False],[-101,False],[0,True]
])
def test_naive_isPalindrome(self,inp,expected):
self.assertEqual(Solu... | true | true |
08f04592ed3bb2dbfee78d69f0372d485a9ab761 | 4,531 | py | Python | tools/infer.py | LeftThink/py-faster-rcnn | 39d8fa7886407a8717bcfae2a833320b7a321dea | [
"BSD-2-Clause"
] | null | null | null | tools/infer.py | LeftThink/py-faster-rcnn | 39d8fa7886407a8717bcfae2a833320b7a321dea | [
"BSD-2-Clause"
] | null | null | null | tools/infer.py | LeftThink/py-faster-rcnn | 39d8fa7886407a8717bcfae2a833320b7a321dea | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Demo script showing detections in sample i... | 32.134752 | 109 | 0.595454 |
"""
Demo script showing detections in sample images.
See README.md for installation instructions before running.
"""
import _init_paths
from fast_rcnn.config import cfg
from fast_rcnn.test import im_detect
from fast_rcnn.nms_wrapper import nms
from utils.timer import Timer
import matplotlib.pyplot as plt
import num... | false | true |
08f0459ac81ce0284c00c1a1313ce65336f32a13 | 5,444 | py | Python | pyrow/ergmanager.py | aeksei/Py3Row | e1850c2060b2baff7608a3a38f516a72a472b6c2 | [
"BSD-2-Clause"
] | 30 | 2017-11-20T01:36:19.000Z | 2021-12-25T08:39:35.000Z | pyrow/ergmanager.py | mipo47/Py3Row | aae499ff778d816f8a1f95d83ace632dd5f76bc9 | [
"BSD-2-Clause"
] | 5 | 2018-10-11T02:53:10.000Z | 2022-03-24T22:09:25.000Z | pyrow/ergmanager.py | mipo47/Py3Row | aae499ff778d816f8a1f95d83ace632dd5f76bc9 | [
"BSD-2-Clause"
] | 17 | 2018-01-12T20:09:59.000Z | 2022-02-07T14:23:47.000Z | #!/usr/bin/env python
#Copyright (c) 2017 Michael Droogleever
#Licensed under the Simplified BSD License.
# NOTE: This code has not been thoroughly tested and may not function as advertised.
# Please report and findings to the author so that they may be addressed in a stable release.
# pylint: disable=C0111,C0103
im... | 32.404762 | 95 | 0.540044 |
import threading
import queue
import time
class ErgManager(object):
def __init__(self, pyrow, *, add_callback, update_callback, check_rate=2, update_rate=0.5):
self._pyrow = pyrow
self.add_callback = add_callback
self.update_callback = update_callback
self.check_rate = ch... | true | true |
08f046abc790a2d441e3d99046231726e6128b4a | 1,777 | py | Python | scripts/download_blob_from_peer.py | StripedMonkey/lbry-sdk | b7cb2a7aa553cf3eafc239275fa6e4e30b9057e1 | [
"MIT"
] | 2 | 2020-03-25T09:56:58.000Z | 2020-03-25T09:56:59.000Z | scripts/download_blob_from_peer.py | StripedMonkey/lbry-sdk | b7cb2a7aa553cf3eafc239275fa6e4e30b9057e1 | [
"MIT"
] | null | null | null | scripts/download_blob_from_peer.py | StripedMonkey/lbry-sdk | b7cb2a7aa553cf3eafc239275fa6e4e30b9057e1 | [
"MIT"
] | null | null | null | import sys
import os
import asyncio
import socket
import ipaddress
from lbry.conf import Config
from lbry.extras.daemon.storage import SQLiteStorage
from lbry.blob.blob_manager import BlobManager
from lbry.blob_exchange.client import BlobExchangeClientProtocol, request_blob
import logging
log = logging.getLogger("lbry... | 32.907407 | 98 | 0.672482 | import sys
import os
import asyncio
import socket
import ipaddress
from lbry.conf import Config
from lbry.extras.daemon.storage import SQLiteStorage
from lbry.blob.blob_manager import BlobManager
from lbry.blob_exchange.client import BlobExchangeClientProtocol, request_blob
import logging
log = logging.getLogger("lbry... | true | true |
08f046e49572ef4c85a3294f26a5f9c7aeadafd3 | 7,189 | py | Python | session8/complete/8.py | robbaltzer/pb-exercises | 4aebe998adf94dd008662dcfddadabbde68131ec | [
"BSD-2-Clause"
] | null | null | null | session8/complete/8.py | robbaltzer/pb-exercises | 4aebe998adf94dd008662dcfddadabbde68131ec | [
"BSD-2-Clause"
] | null | null | null | session8/complete/8.py | robbaltzer/pb-exercises | 4aebe998adf94dd008662dcfddadabbde68131ec | [
"BSD-2-Clause"
] | null | null | null | from unittest import TestCase
from bloomfilter import (
BloomFilter,
BIP37_CONSTANT,
)
from ecc import PrivateKey
from helper import (
bit_field_to_bytes,
decode_base58,
hash160,
hash256,
little_endian_to_int,
murmur3,
)
from merkleblock import MerkleBlock
from network import (
GetD... | 44.376543 | 794 | 0.673529 | from unittest import TestCase
from bloomfilter import (
BloomFilter,
BIP37_CONSTANT,
)
from ecc import PrivateKey
from helper import (
bit_field_to_bytes,
decode_base58,
hash160,
hash256,
little_endian_to_int,
murmur3,
)
from merkleblock import MerkleBlock
from network import (
GetD... | true | true |
08f048821941353d410f4f9d35f696075873236d | 247 | py | Python | Exercices/11.py | GabrielTaka/-Introduction-to-Python | acbd9f42152318c95e4f3030f0bb3bacb5895322 | [
"MIT"
] | null | null | null | Exercices/11.py | GabrielTaka/-Introduction-to-Python | acbd9f42152318c95e4f3030f0bb3bacb5895322 | [
"MIT"
] | null | null | null | Exercices/11.py | GabrielTaka/-Introduction-to-Python | acbd9f42152318c95e4f3030f0bb3bacb5895322 | [
"MIT"
] | null | null | null | #Escreva um programa que converta uma temperatura digitando em graus Celsius e converta para graus Fahrenheit.
cel = float(input("Digite a temperatura em Celcius: "))
f= 1.8*cel + 32
print("A conversão para Fahrenheit será de {}".format(f))
| 41.166667 | 111 | 0.740891 |
cel = float(input("Digite a temperatura em Celcius: "))
f= 1.8*cel + 32
print("A conversão para Fahrenheit será de {}".format(f))
| true | true |
08f0490d2186403d91855b78e3bdc58a44bfe874 | 1,776 | py | Python | travel_memories/users/views.py | DoomPatrol/travel-memories | 75f0686761572f4f1f41dd48ffc0f7577b5b4492 | [
"MIT"
] | null | null | null | travel_memories/users/views.py | DoomPatrol/travel-memories | 75f0686761572f4f1f41dd48ffc0f7577b5b4492 | [
"MIT"
] | null | null | null | travel_memories/users/views.py | DoomPatrol/travel-memories | 75f0686761572f4f1f41dd48ffc0f7577b5b4492 | [
"MIT"
] | null | null | null | from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.core import serializers
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import User
from app.models import Location
class UserDetailView(LoginRequiredMixin... | 32.290909 | 108 | 0.711712 | from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.core import serializers
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import User
from app.models import Location
class UserDetailView(LoginRequiredMixin... | true | true |
08f04a78dbf600526db7de3e4598711e5e4c5833 | 6,758 | py | Python | SRC/FUN/CC/Ensamblador_2_segmento_datos.py | korvec/microsex | 0d1ee8f2f18aaef77e4aefcbdcd004acfda93cab | [
"MIT"
] | null | null | null | SRC/FUN/CC/Ensamblador_2_segmento_datos.py | korvec/microsex | 0d1ee8f2f18aaef77e4aefcbdcd004acfda93cab | [
"MIT"
] | null | null | null | SRC/FUN/CC/Ensamblador_2_segmento_datos.py | korvec/microsex | 0d1ee8f2f18aaef77e4aefcbdcd004acfda93cab | [
"MIT"
] | null | null | null | """
Los símbolos son guardados en la tabla de símbolos:
DIRECTIVA : SIMBOLO | VALOR | CONTENIDO
equ : constante | valor | ---------
rb, db : nombre | dirección | contenido
"""
import string
from FUN.CONF.nemonicos import argumentos_instrucciones
directivas_dseg = [
'.ORG',... | 39.520468 | 115 | 0.579313 |
import string
from FUN.CONF.nemonicos import argumentos_instrucciones
directivas_dseg = [
'.ORG', '.EQU', '.DB', '.RB' ]
nemonicos = list(argumentos_instrucciones().keys())
reservados = ['A', 'B', 'C', 'IX', 'IY', 'X', 'Y']
palabras_reservadas = list(nemonicos)
palabras_reservadas.extend(reserva... | true | true |
08f04ae65b3e00a76c46d37dde6ea342965f9289 | 1,783 | py | Python | airrohrFlasher/workers.py | mkretzschmar/airrohr-firmware-flasher | 1705d13393326bb66bb67e42ffdc88d353d8e49e | [
"MIT"
] | 70 | 2018-11-07T06:02:28.000Z | 2022-03-28T08:28:04.000Z | airrohrFlasher/workers.py | mkretzschmar/airrohr-firmware-flasher | 1705d13393326bb66bb67e42ffdc88d353d8e49e | [
"MIT"
] | 44 | 2018-10-22T13:40:28.000Z | 2022-01-21T19:15:46.000Z | airrohrFlasher/workers.py | mkretzschmar/airrohr-firmware-flasher | 1705d13393326bb66bb67e42ffdc88d353d8e49e | [
"MIT"
] | 32 | 2018-11-16T11:18:45.000Z | 2021-08-11T15:58:14.000Z | import time
import socket
import serial
import serial.tools.list_ports
import zeroconf
from .qtvariant import QtCore
from .utils import indexof, QuickThread
from .consts import UPDATE_REPOSITORY
class PortDetectThread(QuickThread):
interval = 1.0
portsUpdate = QtCore.Signal([list])
def target(self):
... | 28.758065 | 87 | 0.662367 | import time
import socket
import serial
import serial.tools.list_ports
import zeroconf
from .qtvariant import QtCore
from .utils import indexof, QuickThread
from .consts import UPDATE_REPOSITORY
class PortDetectThread(QuickThread):
interval = 1.0
portsUpdate = QtCore.Signal([list])
def target(self):
... | true | true |
08f04cad9db81c090096ddcbf3c4563ebc875e8c | 228 | py | Python | webempresa/services/views.py | Pac0011/web-empresa-django-2 | 618498dd753018c4dc90bb523ff0bc7a9962635f | [
"Apache-2.0"
] | null | null | null | webempresa/services/views.py | Pac0011/web-empresa-django-2 | 618498dd753018c4dc90bb523ff0bc7a9962635f | [
"Apache-2.0"
] | null | null | null | webempresa/services/views.py | Pac0011/web-empresa-django-2 | 618498dd753018c4dc90bb523ff0bc7a9962635f | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from .models import Service
# Create your views here.
def services(request):
services = Service.objects.all()
return render(request, "services/services.html", {'services': services})
| 28.5 | 76 | 0.75 | from django.shortcuts import render
from .models import Service
def services(request):
services = Service.objects.all()
return render(request, "services/services.html", {'services': services})
| true | true |
08f04ed1ef8df25b2bcd83ebcf067099327ecdb2 | 2,038 | py | Python | mmf/datasets/builders/vqa2/masked_dataset.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 3,252 | 2018-07-27T02:32:24.000Z | 2020-05-07T17:54:46.000Z | mmf/datasets/builders/vqa2/masked_dataset.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 209 | 2018-07-30T06:39:59.000Z | 2020-05-04T22:03:48.000Z | mmf/datasets/builders/vqa2/masked_dataset.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 431 | 2018-07-27T04:17:37.000Z | 2020-05-05T13:58:02.000Z | import random
from mmf.common.sample import Sample
from mmf.datasets.builders.vqa2.dataset import VQA2Dataset
class MaskedVQA2Dataset(VQA2Dataset):
def __init__(self, config, dataset_type, imdb_file_index, *args, **kwargs):
super().__init__(
config,
dataset_type,
imdb_... | 33.409836 | 83 | 0.595682 | import random
from mmf.common.sample import Sample
from mmf.datasets.builders.vqa2.dataset import VQA2Dataset
class MaskedVQA2Dataset(VQA2Dataset):
def __init__(self, config, dataset_type, imdb_file_index, *args, **kwargs):
super().__init__(
config,
dataset_type,
imdb_... | true | true |
08f04ef6be07816a14db728bb680f8534ef76223 | 6,371 | py | Python | configs/fcos/fcos_t_s_full_mask_finetune_halved_from_scratch_offline_pyramid_attention_r50_caffe_fpn_gn_1x_4gpu_nvidia.py | Lanselott/mmdetection | 03ce0a87f4d52f4adf4f78fd39ad30b2da394376 | [
"Apache-2.0"
] | null | null | null | configs/fcos/fcos_t_s_full_mask_finetune_halved_from_scratch_offline_pyramid_attention_r50_caffe_fpn_gn_1x_4gpu_nvidia.py | Lanselott/mmdetection | 03ce0a87f4d52f4adf4f78fd39ad30b2da394376 | [
"Apache-2.0"
] | null | null | null | configs/fcos/fcos_t_s_full_mask_finetune_halved_from_scratch_offline_pyramid_attention_r50_caffe_fpn_gn_1x_4gpu_nvidia.py | Lanselott/mmdetection | 03ce0a87f4d52f4adf4f78fd39ad30b2da394376 | [
"Apache-2.0"
] | null | null | null | # model settings
BLOCK_ALIGN = False
PYRAMID_ALIGN = True
HEAD_ALIGN = False
FREEZE_TEACHER = True
GOOD_INITIAL = False
ROUSE_STUDENT_POINT = 1
RATIO = 2
model = dict(
type='FCOSTS',
pretrained='open-mmlab://resnet50_caffe',
backbone=dict(
type='ResTSNet',
depth=50,
t_s_ratio=RATIO,
... | 32.340102 | 75 | 0.640088 | BLOCK_ALIGN = False
PYRAMID_ALIGN = True
HEAD_ALIGN = False
FREEZE_TEACHER = True
GOOD_INITIAL = False
ROUSE_STUDENT_POINT = 1
RATIO = 2
model = dict(
type='FCOSTS',
pretrained='open-mmlab://resnet50_caffe',
backbone=dict(
type='ResTSNet',
depth=50,
t_s_ratio=RATIO,
num_stage... | true | true |
08f04faa52722a7c15f237cfe801b97a99f0404f | 9,738 | py | Python | samples/dnn/person_reid.py | xipingyan/opencv | 39c3334147ec02761b117f180c9c4518be18d1fa | [
"Apache-2.0"
] | 56,632 | 2016-07-04T16:36:08.000Z | 2022-03-31T18:38:14.000Z | samples/dnn/person_reid.py | yusufm423/opencv | 6a2077cbd8a8a0d8cbd3e0e8c3ca239f17e6c067 | [
"Apache-2.0"
] | 13,593 | 2016-07-04T13:59:03.000Z | 2022-03-31T21:04:51.000Z | samples/dnn/person_reid.py | yusufm423/opencv | 6a2077cbd8a8a0d8cbd3e0e8c3ca239f17e6c067 | [
"Apache-2.0"
] | 54,986 | 2016-07-04T14:24:38.000Z | 2022-03-31T22:51:18.000Z | #!/usr/bin/env python
'''
You can download a baseline ReID model and sample input from:
https://github.com/ReID-Team/ReID_extra_testdata
Authors of samples and Youtu ReID baseline:
Xing Sun <winfredsun@tencent.com>
Feng Zheng <zhengf@sustech.edu.cn>
Xinyang Jiang <sevjiang@tencent.com>
... | 40.406639 | 155 | 0.650442 | import argparse
import os.path
import numpy as np
import cv2 as cv
backends = (cv.dnn.DNN_BACKEND_DEFAULT,
cv.dnn.DNN_BACKEND_INFERENCE_ENGINE,
cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM,
cv.dnn.DNN_BACKEND_CUDA)
targets = (cv.dnn.DNN_TARGET_CPU,
cv.dnn.DNN_TARGET_OPENCL,
cv.dnn.DNN_T... | true | true |
08f04fddc61b4d335de7621505a5d590733a6bc8 | 2,653 | py | Python | sdk/lusid/models/property_type.py | mneedham/lusid-sdk-python-preview | f4494009d1a2f3431d931c813cab679bdbd92c84 | [
"MIT"
] | null | null | null | sdk/lusid/models/property_type.py | mneedham/lusid-sdk-python-preview | f4494009d1a2f3431d931c813cab679bdbd92c84 | [
"MIT"
] | null | null | null | sdk/lusid/models/property_type.py | mneedham/lusid-sdk-python-preview | f4494009d1a2f3431d931c813cab679bdbd92c84 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3192
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class PropertyType(object):
"""NOTE: This class is ... | 25.757282 | 83 | 0.547682 |
import pprint
import re
import six
class PropertyType(object):
LABEL = "Label"
METRIC = "Metric"
INFORMATION = "Information"
allowable_values = [LABEL, METRIC, INFORMATION]
openapi_types = {
}
attribute_map = {
}
required_map = {
}
def __init__(self): se... | true | true |
08f04fe47e34b31d44e48be2b37c1a2ffbe68392 | 3,290 | py | Python | TD/q_learning.py | rafaelpossas/reinforcement-learning | 6e1e8057939cbcb489c714868ee650a3481b8c7c | [
"MIT"
] | null | null | null | TD/q_learning.py | rafaelpossas/reinforcement-learning | 6e1e8057939cbcb489c714868ee650a3481b8c7c | [
"MIT"
] | null | null | null | TD/q_learning.py | rafaelpossas/reinforcement-learning | 6e1e8057939cbcb489c714868ee650a3481b8c7c | [
"MIT"
] | null | null | null | import gym
import itertools
import matplotlib
import numpy as np
import pandas as pd
import sys
if "../" not in sys.path:
sys.path.append("../")
from collections import defaultdict
from lib.envs.cliff_walking import CliffWalkingEnv
from lib import plotting
matplotlib.style.use('ggplot')
env = CliffWalkingEnv()
... | 31.333333 | 102 | 0.659271 | import gym
import itertools
import matplotlib
import numpy as np
import pandas as pd
import sys
if "../" not in sys.path:
sys.path.append("../")
from collections import defaultdict
from lib.envs.cliff_walking import CliffWalkingEnv
from lib import plotting
matplotlib.style.use('ggplot')
env = CliffWalkingEnv()
... | true | true |
08f05099d42d86d963db0341d4337d54d3a15a05 | 6,133 | py | Python | tests/command_parse/test_sorted_set_parse.py | qiaocci/iredis | 81892e9083b3ebccef246926076888e986340f96 | [
"BSD-3-Clause"
] | null | null | null | tests/command_parse/test_sorted_set_parse.py | qiaocci/iredis | 81892e9083b3ebccef246926076888e986340f96 | [
"BSD-3-Clause"
] | null | null | null | tests/command_parse/test_sorted_set_parse.py | qiaocci/iredis | 81892e9083b3ebccef246926076888e986340f96 | [
"BSD-3-Clause"
] | null | null | null | import pytest
def test_zcount(judge_command):
judge_command(
"zcount foo -10 0",
{"command_key_min_max": "zcount", "key": "foo", "min": "-10", "max": "0"},
)
def test_bzpopmax(judge_command):
judge_command(
"bzpopmax set set2 set3 4",
{"command_keys_timeout": "bzpopmax", ... | 25.661088 | 86 | 0.465841 | import pytest
def test_zcount(judge_command):
judge_command(
"zcount foo -10 0",
{"command_key_min_max": "zcount", "key": "foo", "min": "-10", "max": "0"},
)
def test_bzpopmax(judge_command):
judge_command(
"bzpopmax set set2 set3 4",
{"command_keys_timeout": "bzpopmax", ... | true | true |
08f051b7bbd4ba6ae8ae9b7cfba421724ebadf2a | 17,074 | py | Python | Gilmer_Code/chem_tensorflow.py | ajz34/ML_Course_Code_Report | 59f02e4e6e2d85343a61162147ed6e775dc1a596 | [
"MIT"
] | 2 | 2019-03-18T10:17:12.000Z | 2019-06-09T16:14:44.000Z | Gilmer_Code/chem_tensorflow.py | ajz34/ML_Course_Code_Report | 59f02e4e6e2d85343a61162147ed6e775dc1a596 | [
"MIT"
] | 1 | 2018-02-18T13:32:27.000Z | 2018-02-18T14:11:34.000Z | Gilmer_Code/chem_tensorflow.py | ajz34/ML_Course_Code_Report | 59f02e4e6e2d85343a61162147ed6e775dc1a596 | [
"MIT"
] | 3 | 2018-02-16T08:42:11.000Z | 2019-03-18T10:24:48.000Z | #!/usr/bin/env/python
from typing import Tuple, List, Any, Sequence
import tensorflow as tf
import time
import os
import json
import numpy as np
import pickle
import random
from utils import MLP, ThreadedIterator, SMALL_NUMBER
class ChemModel(object):
@classmethod
def default_params(cls):
return {
... | 51.583082 | 157 | 0.558861 |
from typing import Tuple, List, Any, Sequence
import tensorflow as tf
import time
import os
import json
import numpy as np
import pickle
import random
from utils import MLP, ThreadedIterator, SMALL_NUMBER
class ChemModel(object):
@classmethod
def default_params(cls):
return {
'num_epoch... | true | true |
08f0530cd026a480c3b2a4bd8c354e37596fea35 | 294 | py | Python | release/stubs.min/System/__init___parts/IProgress.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/__init___parts/IProgress.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/__init___parts/IProgress.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class IProgress:
# no doc
def Report(self,value):
""" Report(self: IProgress[T],value: T) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
| 32.666667 | 147 | 0.666667 | class IProgress:
def Report(self,value):
pass
def __init__(self,*args):
pass
| true | true |
08f05373734d6cbc5c48351f4a577d1be48d918a | 4,320 | py | Python | graspy/cluster/kclust.py | asaadeldin11/graspy | 26083e5fe0c79d0ce0bf045a07b8c6c6b0eab559 | [
"Apache-2.0"
] | null | null | null | graspy/cluster/kclust.py | asaadeldin11/graspy | 26083e5fe0c79d0ce0bf045a07b8c6c6b0eab559 | [
"Apache-2.0"
] | null | null | null | graspy/cluster/kclust.py | asaadeldin11/graspy | 26083e5fe0c79d0ce0bf045a07b8c6c6b0eab559 | [
"Apache-2.0"
] | 1 | 2020-03-31T22:02:24.000Z | 2020-03-31T22:02:24.000Z | # Copyright 2019 NeuroData (http://neurodata.io)
#
# 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 ag... | 34.285714 | 87 | 0.622222 |
import numpy as np
from sklearn.cluster import KMeans
from sklearn.metrics import adjusted_rand_score, silhouette_score
from .base import BaseCluster
class KMeansCluster(BaseCluster):
def __init__(self, max_clusters=2, random_state=None):
if isinstance(max_clusters, int):
if max_clusters <=... | true | true |
08f05604a311ae4aac0877f85ca0a0543aba89d9 | 127 | py | Python | formaggio/signals/definitions.py | scotu/django-formaggio | ee565d3b37d71572a7fe5da23a2475117e3f6c7f | [
"BSD-3-Clause"
] | null | null | null | formaggio/signals/definitions.py | scotu/django-formaggio | ee565d3b37d71572a7fe5da23a2475117e3f6c7f | [
"BSD-3-Clause"
] | null | null | null | formaggio/signals/definitions.py | scotu/django-formaggio | ee565d3b37d71572a7fe5da23a2475117e3f6c7f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import django.dispatch
form_answered = django.dispatch.Signal(providing_args=['form', 'form_result'])
| 25.4 | 78 | 0.724409 | import django.dispatch
form_answered = django.dispatch.Signal(providing_args=['form', 'form_result'])
| true | true |
08f056236d6b6b6bf6267c93f9ca6cfc1f07aec1 | 337 | py | Python | blog/migrations/0002_alter_post_options.py | ShaviyaVictor/instagram_lite | ecaaba926ae7dac5ab0b9a1502cd09afd600e77d | [
"MIT"
] | 1 | 2022-03-11T08:27:14.000Z | 2022-03-11T08:27:14.000Z | blog/migrations/0002_alter_post_options.py | ShaviyaVictor/instagram_lite | ecaaba926ae7dac5ab0b9a1502cd09afd600e77d | [
"MIT"
] | null | null | null | blog/migrations/0002_alter_post_options.py | ShaviyaVictor/instagram_lite | ecaaba926ae7dac5ab0b9a1502cd09afd600e77d | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-05 10:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'ordering': ['-date_posted']},
... | 18.722222 | 51 | 0.575668 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'ordering': ['-date_posted']},
),
]
| true | true |
08f0566ca9a23fa8b3163006bced6fcc3ddce6e9 | 607 | py | Python | Matrix/SortedMatrixSearch.py | kopok2/DataStructures | d3877b542872c0be0f97306061c6ce0c3d98f1f3 | [
"MIT"
] | null | null | null | Matrix/SortedMatrixSearch.py | kopok2/DataStructures | d3877b542872c0be0f97306061c6ce0c3d98f1f3 | [
"MIT"
] | null | null | null | Matrix/SortedMatrixSearch.py | kopok2/DataStructures | d3877b542872c0be0f97306061c6ce0c3d98f1f3 | [
"MIT"
] | null | null | null | # coding=utf-8
"""Search in matrix sorted column wise and row wise."""
def search(matrix, key):
y = 0
x = len(matrix[0]) - 1
while x >= 0 and y < len(matrix):
if key > matrix[y][x]:
y += 1
elif key < matrix[y][x]:
x -= 1
else:
return y, x
ret... | 22.481481 | 55 | 0.476112 |
def search(matrix, key):
y = 0
x = len(matrix[0]) - 1
while x >= 0 and y < len(matrix):
if key > matrix[y][x]:
y += 1
elif key < matrix[y][x]:
x -= 1
else:
return y, x
return None
if __name__ == '__main__':
matrix = [[10, 20, 30, 40],
... | true | true |
08f0575175b8081d6f65d93c80aeb317b13c61da | 1,371 | py | Python | week2/module3/module2_31.py | ivaninkv/python_basics | 84bbdf4d0667ca2416e3594538e7ec48f0b88f47 | [
"MIT"
] | null | null | null | week2/module3/module2_31.py | ivaninkv/python_basics | 84bbdf4d0667ca2416e3594538e7ec48f0b88f47 | [
"MIT"
] | 1 | 2021-12-13T20:46:59.000Z | 2021-12-13T20:46:59.000Z | week2/module3/module2_31.py | ivaninkv/python_basics | 84bbdf4d0667ca2416e3594538e7ec48f0b88f47 | [
"MIT"
] | 1 | 2020-08-06T21:17:34.000Z | 2020-08-06T21:17:34.000Z | class multifilter:
def judge_half(pos, neg):
# допускает элемент, если его допускает хотя бы половина фукнций
# (pos >= neg)
return pos >= neg
def judge_any(pos, neg):
# допускает элемент, если его допускает хотя бы одна функция (pos >= 1)
return pos >= 1
def judge_... | 29.804348 | 79 | 0.538293 | class multifilter:
def judge_half(pos, neg):
return pos >= neg
def judge_any(pos, neg):
return pos >= 1
def judge_all(pos, neg):
return neg == 0
def __init__(self, iterable, *funcs, judge=judge_any):
self.iterable... | true | true |
08f057bcc75fba9dac0c3c9cccea0eaf2abf5bc6 | 438 | py | Python | wagtail/migrations/0007_page_latest_revision_created_at.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | 1 | 2022-02-09T05:25:30.000Z | 2022-02-09T05:25:30.000Z | wagtail/migrations/0007_page_latest_revision_created_at.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | wagtail/migrations/0007_page_latest_revision_created_at.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0006_add_lock_page_permission"),
]
operations = [
migrations.AddField(
model_name="page",
name="latest_revision_created_at",
... | 23.052632 | 66 | 0.607306 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0006_add_lock_page_permission"),
]
operations = [
migrations.AddField(
model_name="page",
name="latest_revision_created_at",
field=models.... | true | true |
08f057d8b4f18f476ad406582edb79d74778eea0 | 1,258 | py | Python | Day 10/art.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-01-28T13:55:39.000Z | 2022-01-28T13:55:39.000Z | Day 10/art.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-02-02T00:13:18.000Z | 2022-02-03T11:32:53.000Z | Day 10/art.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 2 | 2022-02-07T20:49:36.000Z | 2022-02-19T21:22:15.000Z | logo = """
_____________________
| _________________ |
| | Chimezie A. 0. | | .----------------. .----------------. .----------------. .----------------.
| |_________________| | | .--------------. || .--------------. || .--------------. || .--------------. |
| ___ ___ ___ ___ | | | ______ | || ... | 74 | 106 | 0.18442 | logo = """
_____________________
| _________________ |
| | Chimezie A. 0. | | .----------------. .----------------. .----------------. .----------------.
| |_________________| | | .--------------. || .--------------. || .--------------. || .--------------. |
| ___ ___ ___ ___ | | | ______ | || ... | true | true |
08f057dbc7eace37defee758d8f8105638ee5ae3 | 477 | py | Python | Others/dwango/dwango2015-prelims/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | Others/dwango/dwango2015-prelims/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | Others/dwango/dwango2015-prelims/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def count_niko_niko(n):
return n * (n + 1) // 2
def main():
s = input()
n = len(s)
count = 0
ans = 0
i = 0
while i + 1 < n:
if s[i] == '2' and s[i + 1] == '5':
count += 1
i += 2
else:
ans += count_niko_niko(coun... | 14.90625 | 43 | 0.404612 |
def count_niko_niko(n):
return n * (n + 1) // 2
def main():
s = input()
n = len(s)
count = 0
ans = 0
i = 0
while i + 1 < n:
if s[i] == '2' and s[i + 1] == '5':
count += 1
i += 2
else:
ans += count_niko_niko(count)
count = 0... | true | true |
08f0594e41e929d6995d2429035c2a38aca68daa | 6,799 | py | Python | sddr/plot.py | reedessick/sddr | f1225ad798a06bf351cf20b93c36864e5604f35a | [
"MIT"
] | null | null | null | sddr/plot.py | reedessick/sddr | f1225ad798a06bf351cf20b93c36864e5604f35a | [
"MIT"
] | null | null | null | sddr/plot.py | reedessick/sddr | f1225ad798a06bf351cf20b93c36864e5604f35a | [
"MIT"
] | null | null | null | __doc__ = "a method to support some basic and not-so-basic plotting functionality"
__author__ = "reed.essick@ligo.org"
#-------------------------------------------------
import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot as plt
import numpy as np
### non-standard libraries
from sddr import utils
... | 36.951087 | 184 | 0.528754 | __doc__ = "a method to support some basic and not-so-basic plotting functionality"
__author__ = "reed.essick@ligo.org"
import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot as plt
import numpy as np
from sddr import utils
def kde2fig(points, logkde, priors, fields, sanitycheck_tuple=None, levels=[... | true | true |
08f05a85b3cee391017366375e0f90fddde26f41 | 12,500 | py | Python | met/metadataparser/forms.py | mralexcraven3/met | b632c84dfae523c0272b3247130406026e52ed22 | [
"BSD-2-Clause"
] | null | null | null | met/metadataparser/forms.py | mralexcraven3/met | b632c84dfae523c0272b3247130406026e52ed22 | [
"BSD-2-Clause"
] | null | null | null | met/metadataparser/forms.py | mralexcraven3/met | b632c84dfae523c0272b3247130406026e52ed22 | [
"BSD-2-Clause"
] | null | null | null | #################################################################
# MET v2 Metadate Explorer Tool
#
# This Software is Open Source. See License: https://github.com/TERENA/met/blob/master/LICENSE.md
# Copyright (c) 2012, TERENA All rights reserved.
#
# This Software is based on MET v1 developed for TERENA by Yaco Sistem... | 43.103448 | 192 | 0.52976 |
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import CheckboxSelectMultiple, Widget
from django.forms.extras.widgets import SelectDateWidget
from django.forms.utils import ErrorDict, flatatt
from django.utils import timezone
from dateutil.relativedelta impo... | true | true |
08f05af052d7f0d8e060ca25675544dea634696e | 1,736 | py | Python | Model/countryStatistics.py | lionick/rciam-ip2country | be54b9d328c68e885b914a3de81f909d480229a1 | [
"Apache-2.0"
] | null | null | null | Model/countryStatistics.py | lionick/rciam-ip2country | be54b9d328c68e885b914a3de81f909d480229a1 | [
"Apache-2.0"
] | null | null | null | Model/countryStatistics.py | lionick/rciam-ip2country | be54b9d328c68e885b914a3de81f909d480229a1 | [
"Apache-2.0"
] | 1 | 2021-03-16T11:07:22.000Z | 2021-03-16T11:07:22.000Z | from Model.pgConnector import destinationPgConnector
from Utils import configParser
class countryStatistics(object):
STATISTICSTABLE = configParser.getConfig('destination_tables')['country_table']
def __init__(self, id, date, sourceIdp, service, countryCode, country, count):
self.id = id
self.date = date
... | 49.6 | 397 | 0.72523 | from Model.pgConnector import destinationPgConnector
from Utils import configParser
class countryStatistics(object):
STATISTICSTABLE = configParser.getConfig('destination_tables')['country_table']
def __init__(self, id, date, sourceIdp, service, countryCode, country, count):
self.id = id
self.date = date
... | true | true |
08f05b275d76216a4a07e855461e13ab68c0364c | 1,113 | py | Python | km_api/know_me/journal/tests/serializers/test_entry_detail_serializer.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 4 | 2017-08-03T00:46:31.000Z | 2018-11-06T03:32:32.000Z | km_api/know_me/journal/tests/serializers/test_entry_detail_serializer.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 526 | 2017-06-27T18:13:59.000Z | 2021-06-10T18:00:21.000Z | km_api/know_me/journal/tests/serializers/test_entry_detail_serializer.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 1 | 2017-07-10T19:46:27.000Z | 2017-07-10T19:46:27.000Z | from know_me.journal import serializers
def test_serialize(api_rf, entry_comment_factory, entry_factory):
"""
Test serializing a journal entry.
"""
entry = entry_factory()
api_rf.user = entry.km_user.user
request = api_rf.get(entry.get_absolute_url())
entry_comment_factory(entry=entry)
... | 27.146341 | 69 | 0.702606 | from know_me.journal import serializers
def test_serialize(api_rf, entry_comment_factory, entry_factory):
entry = entry_factory()
api_rf.user = entry.km_user.user
request = api_rf.get(entry.get_absolute_url())
entry_comment_factory(entry=entry)
entry_comment_factory(entry=entry)
serializer =... | true | true |
08f05b58d9116c10d8df8fa1c928dc1cf428e826 | 2,820 | py | Python | collectors/cpustats.py | vijayanant/kunai | 0dfe169731eaceb1bba66e12715b3968d2a3de20 | [
"MIT"
] | 1 | 2020-04-12T21:05:46.000Z | 2020-04-12T21:05:46.000Z | collectors/cpustats.py | vijayanant/kunai | 0dfe169731eaceb1bba66e12715b3968d2a3de20 | [
"MIT"
] | null | null | null | collectors/cpustats.py | vijayanant/kunai | 0dfe169731eaceb1bba66e12715b3968d2a3de20 | [
"MIT"
] | null | null | null | import httplib # Used only for handling httplib.HTTPException (case #26701)
import os
import sys
import platform
import re
import urllib
import urllib2
import traceback
import time
from StringIO import StringIO
from multiprocessing import subprocess
from kunai.log import logger
from kunai.collector import Collector
... | 32.790698 | 114 | 0.510638 | import httplib import os
import sys
import platform
import re
import urllib
import urllib2
import traceback
import time
from StringIO import StringIO
from multiprocessing import subprocess
from kunai.log import logger
from kunai.collector import Collector
class CpuStats(Collector):
def launch(self):
logg... | false | true |
08f05bacab7ed86477bbb36e246e12b7ef6dee7f | 348 | py | Python | pywinrt/winsdk/windows/devices/background/__init__.py | pywinrt/python-winsdk | 1e2958a712949579f5e84d38220062b2cec12511 | [
"MIT"
] | 3 | 2022-02-14T14:53:08.000Z | 2022-03-29T20:48:54.000Z | pywinrt/winsdk/windows/devices/background/__init__.py | pywinrt/python-winsdk | 1e2958a712949579f5e84d38220062b2cec12511 | [
"MIT"
] | 4 | 2022-01-28T02:53:52.000Z | 2022-02-26T18:10:05.000Z | pywinrt/winsdk/windows/devices/background/__init__.py | pywinrt/python-winsdk | 1e2958a712949579f5e84d38220062b2cec12511 | [
"MIT"
] | null | null | null | # WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.4
import winsdk
_ns_module = winsdk._import_ns_module("Windows.Devices.Background")
try:
import winsdk.windows.foundation
except Exception:
pass
DeviceServicingDetails = _ns_module.DeviceServicingDetails
DeviceUseDetails = ... | 24.857143 | 86 | 0.807471 |
import winsdk
_ns_module = winsdk._import_ns_module("Windows.Devices.Background")
try:
import winsdk.windows.foundation
except Exception:
pass
DeviceServicingDetails = _ns_module.DeviceServicingDetails
DeviceUseDetails = _ns_module.DeviceUseDetails
| true | true |
08f05c8eef21877e806556f8fff337cc651ef6c5 | 898 | py | Python | ma.py | Karvalian/CoolVideo | c51050830494f15d5bd8e6810df59bee71bff0f7 | [
"MIT"
] | null | null | null | ma.py | Karvalian/CoolVideo | c51050830494f15d5bd8e6810df59bee71bff0f7 | [
"MIT"
] | null | null | null | ma.py | Karvalian/CoolVideo | c51050830494f15d5bd8e6810df59bee71bff0f7 | [
"MIT"
] | null | null | null | # ~-~- Written and maintained by Karvalian.
# ~-~- frame by frame feature updates 2 frames per key.
# ~-~- automatic feature plays the video at its orignal framerate.
# ~-~- frame by frame feature also allows automatic play on keyhold.
# .- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.
#!/usr/bin/env... | 33.259259 | 69 | 0.579065 | import cv2
yep = input("Enter the filename of your vod: ")
frorco = input("frame by frame or automatic : ")
cv2.namedWindow('image', cv2.WINDOW_NORMAL)
def process_frame(img):
img = cv2.resize(img, (1920//2, 1080//2))
cv2.imshow('image', img)
if(frorco=="f"):
cv2.waitKey(0)
elif(frorco=="a"):
... | true | true |
08f05d084839bbcf52bb3edfea165f3969ffa8af | 39 | py | Python | py_noaa/__init__.py | GClunies/py_noaa | adad099a41ce21c81b62843530c50137b7fe59e9 | [
"MIT"
] | 17 | 2018-02-28T15:53:07.000Z | 2021-04-14T15:20:00.000Z | py_noaa/__init__.py | GClunies/py_noaa | adad099a41ce21c81b62843530c50137b7fe59e9 | [
"MIT"
] | 23 | 2018-02-28T04:08:28.000Z | 2020-08-05T04:15:03.000Z | py_noaa/__init__.py | GClunies/py_noaa | adad099a41ce21c81b62843530c50137b7fe59e9 | [
"MIT"
] | 5 | 2018-02-27T02:01:54.000Z | 2020-10-03T22:37:34.000Z | import py_noaa.coops
__version__ = 1.0 | 13 | 20 | 0.794872 | import py_noaa.coops
__version__ = 1.0 | true | true |
08f05d2c77b1024abc02fbec5f2bec25fd622913 | 717 | py | Python | problems/search-in-a-binary-search-tree.py | sailikhithk/tech-interview-prep | e833764cf98915d56118bddfa0e01871c58de75e | [
"Apache-2.0"
] | null | null | null | problems/search-in-a-binary-search-tree.py | sailikhithk/tech-interview-prep | e833764cf98915d56118bddfa0e01871c58de75e | [
"Apache-2.0"
] | null | null | null | problems/search-in-a-binary-search-tree.py | sailikhithk/tech-interview-prep | e833764cf98915d56118bddfa0e01871c58de75e | [
"Apache-2.0"
] | null | null | null | """
Time complexity: O(LogN)
Space complexity: O(1)
"""
class Solution(object):
def searchBST(self, root, val):
node = root
while node:
if node.val==val:
return node
elif node.val>val:
node = node.left
else:
... | 23.129032 | 50 | 0.531381 | class Solution(object):
def searchBST(self, root, val):
node = root
while node:
if node.val==val:
return node
elif node.val>val:
node = node.left
else:
node = node.right
return None
class Solution(... | true | true |
08f05d621190f131a3185c9dc88dccd9d3c244e9 | 946 | py | Python | src/buzzer.py | dooley-ch/microbit-grove | e25213de74d982b8ab49412e6f8b2dbe205ca932 | [
"MIT"
] | null | null | null | src/buzzer.py | dooley-ch/microbit-grove | e25213de74d982b8ab49412e6f8b2dbe205ca932 | [
"MIT"
] | null | null | null | src/buzzer.py | dooley-ch/microbit-grove | e25213de74d982b8ab49412e6f8b2dbe205ca932 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------
# Copyright James A. Dooley 2021.
#
# Distributed under the MIT License.
# (See accompanying file license.md file or copy at http://opensource.org/licenses/MIT)
#
# --------------------------------------------------------------... | 22.52381 | 92 | 0.461945 |
_HIGH = 1
_LOW = 0
from microbit import pin16, sleep, button_b, display
class Buzzer:
def __init__(self, pin):
self._pin = pin
def on(self):
self._pin.write_digital(_HIGH)
def off(self):
self._pin.write_digital(_LOW)
def main():
buzzer = Buzzer(pin16)
... | true | true |
08f05f54a27093c81ac2dc705a693ea7a0bc0708 | 1,505 | py | Python | setup.py | growbots/python-bloomfilter | 394be4aece13871f9a1e0884af484da3a29e914d | [
"MIT"
] | 1 | 2021-07-01T11:19:47.000Z | 2021-07-01T11:19:47.000Z | setup.py | growbots/python-bloomfilter | 394be4aece13871f9a1e0884af484da3a29e914d | [
"MIT"
] | null | null | null | setup.py | growbots/python-bloomfilter | 394be4aece13871f9a1e0884af484da3a29e914d | [
"MIT"
] | null | null | null | import codecs
import os.path
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="pybloom2",
use_scm_version={
"root": here,
"write_to": os.path.... | 25.948276 | 74 | 0.589369 | import codecs
import os.path
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="pybloom2",
use_scm_version={
"root": here,
"write_to": os.path.... | true | true |
08f05f9fed6c14a15d6a8be8a59e27720cc1e9a5 | 7,827 | py | Python | lightlab/laboratory/experiments.py | kynan/lightlab | 223b7fc4122a872491b3155f06c10aa9c24302a7 | [
"MIT"
] | 2 | 2020-07-02T06:47:38.000Z | 2021-04-17T20:27:11.000Z | lightlab/laboratory/experiments.py | kynan/lightlab | 223b7fc4122a872491b3155f06c10aa9c24302a7 | [
"MIT"
] | null | null | null | lightlab/laboratory/experiments.py | kynan/lightlab | 223b7fc4122a872491b3155f06c10aa9c24302a7 | [
"MIT"
] | 2 | 2020-12-11T19:34:50.000Z | 2022-02-20T06:59:37.000Z | '''
This module contains tokens for experiments that use devices and instruments.
This is useful to keep track of what is connected to what.
'''
from lightlab import logger
import lightlab.laboratory.state as labstate
from lightlab.laboratory.virtualization import Virtualizable
from contextlib import contextmanager
c... | 31.688259 | 92 | 0.564456 | from lightlab import logger
import lightlab.laboratory.state as labstate
from lightlab.laboratory.virtualization import Virtualizable
from contextlib import contextmanager
class Experiment(Virtualizable):
instruments = None
instruments_requirements = None
devices = None
validate_exprs = None
conn... | true | true |
08f0601d58cd6bb4c9e98dc0169a795b846bda15 | 8,242 | py | Python | design_baselines/coms_original/__init__.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 28 | 2020-06-30T00:40:33.000Z | 2022-03-22T05:16:27.000Z | design_baselines/coms_original/__init__.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 5 | 2020-09-17T07:15:52.000Z | 2022-03-31T23:33:27.000Z | design_baselines/coms_original/__init__.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 3 | 2020-09-17T06:55:53.000Z | 2021-08-09T20:27:26.000Z | from design_baselines.data import StaticGraphTask
from design_baselines.logger import Logger
from design_baselines.utils import spearman
from design_baselines.coms_original.trainers import ConservativeMaximumLikelihood
from design_baselines.coms_original.trainers import TransformedMaximumLikelihood
from design_baseline... | 37.981567 | 82 | 0.636011 | from design_baselines.data import StaticGraphTask
from design_baselines.logger import Logger
from design_baselines.utils import spearman
from design_baselines.coms_original.trainers import ConservativeMaximumLikelihood
from design_baselines.coms_original.trainers import TransformedMaximumLikelihood
from design_baseline... | true | true |
08f06050d65da4852bade5a8bee7696f37531390 | 4,794 | py | Python | BusinessSimulator/simulatorApp/migrations/0001_initial.py | nathanwelsh8/Business-Simulator | 5df6281ab01353cdff586218fa476a14418ba517 | [
"MIT"
] | null | null | null | BusinessSimulator/simulatorApp/migrations/0001_initial.py | nathanwelsh8/Business-Simulator | 5df6281ab01353cdff586218fa476a14418ba517 | [
"MIT"
] | 2 | 2021-03-31T09:21:35.000Z | 2021-04-20T17:12:39.000Z | BusinessSimulator/simulatorApp/migrations/0001_initial.py | nathanwelsh8/Business-Simulator | 5df6281ab01353cdff586218fa476a14418ba517 | [
"MIT"
] | 2 | 2021-04-20T17:09:24.000Z | 2021-10-16T11:05:05.000Z | # Generated by Django 3.1.2 on 2020-12-01 12:01
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL)... | 47.465347 | 143 | 0.58907 |
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.C... | true | true |
08f0609c67f805574e3125ee8561f04c1058eb4b | 517 | py | Python | setup.py | seung-lab/modelarchive | add419088dd3ab0e6bc81a2848801d41025fa5c1 | [
"MIT"
] | 1 | 2019-11-23T08:03:42.000Z | 2019-11-23T08:03:42.000Z | setup.py | seung-lab/modelarchive | add419088dd3ab0e6bc81a2848801d41025fa5c1 | [
"MIT"
] | null | null | null | setup.py | seung-lab/modelarchive | add419088dd3ab0e6bc81a2848801d41025fa5c1 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='modelarchive',
version='0.0.1',
author='Barak Nehoran',
author_email='bnehoran@users.noreply.github.com',
description='',
long_description=long_description,
long_des... | 23.5 | 53 | 0.665377 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='modelarchive',
version='0.0.1',
author='Barak Nehoran',
author_email='bnehoran@users.noreply.github.com',
description='',
long_description=long_description,
long_des... | true | true |
08f060b195baedd08004c36c44032de0bab9d59b | 1,325 | py | Python | train_detector.py | nikhil12-cmd/nikhil12345678 | 1aa14b385b6a18b8b4c7e323642448e9bb0ff41b | [
"MIT"
] | null | null | null | train_detector.py | nikhil12-cmd/nikhil12345678 | 1aa14b385b6a18b8b4c7e323642448e9bb0ff41b | [
"MIT"
] | null | null | null | train_detector.py | nikhil12-cmd/nikhil12345678 | 1aa14b385b6a18b8b4c7e323642448e9bb0ff41b | [
"MIT"
] | null | null | null | # Copied from PyImageSearch
# USAGE
# python train_detector.py --detector plateDetector_toy.svm \
# --xml ../../datasets/lplates_smallset/hand_labelled/images_labelled/plateAnnotationsWithLabels.xml
# import the necessary packages
from __future__ import print_function
import argparse
import dlib
# construct the argum... | 36.805556 | 100 | 0.775094 |
from __future__ import print_function
import argparse
import dlib
ap = argparse.ArgumentParser()
ap.add_argument("-x", "--xml", required=True, help="path to input XML file")
ap.add_argument("-d", "--detector", required=True, help="Path to the object detector")
args = vars(ap.parse_args())
print("[INFO] training dete... | true | true |
08f061be0521a39323ecc1ffbfc83b7038876fe3 | 68 | py | Python | src/2sem/while.py | freepvps/hsesamples | adbf35c1c94521d78fb75f72287512a37e49bdc8 | [
"MIT"
] | 2 | 2019-10-19T22:29:50.000Z | 2019-10-19T22:29:52.000Z | src/2sem/while.py | freepvps/hsesamples | adbf35c1c94521d78fb75f72287512a37e49bdc8 | [
"MIT"
] | null | null | null | src/2sem/while.py | freepvps/hsesamples | adbf35c1c94521d78fb75f72287512a37e49bdc8 | [
"MIT"
] | null | null | null | n = input(int())
s = 0
while n > 0:
s += n
n -= 1
print(s)
| 8.5 | 16 | 0.411765 | n = input(int())
s = 0
while n > 0:
s += n
n -= 1
print(s)
| true | true |
08f0624324c042856cf3edfa1857ea33e965af30 | 201 | py | Python | tmp.py | Battle-Of-Two-K/LugCulculation | 6f6a80c40a4d694422e4c236aa73d0ae70e05f2a | [
"MIT"
] | null | null | null | tmp.py | Battle-Of-Two-K/LugCulculation | 6f6a80c40a4d694422e4c236aa73d0ae70e05f2a | [
"MIT"
] | null | null | null | tmp.py | Battle-Of-Two-K/LugCulculation | 6f6a80c40a4d694422e4c236aa73d0ae70e05f2a | [
"MIT"
] | null | null | null | import tkinter as tk
class Slide(tk.Frame):
def __init__(self, **kw):
super().__init__(**kw)
class App:
def __init__(self):
self.root = tk.Tk()
self.slide = Slide()
| 15.461538 | 30 | 0.572139 | import tkinter as tk
class Slide(tk.Frame):
def __init__(self, **kw):
super().__init__(**kw)
class App:
def __init__(self):
self.root = tk.Tk()
self.slide = Slide()
| true | true |
08f0631060b8178d18a0e78a6b15fffa80b9bb6f | 1,275 | py | Python | pyleri/__init__.py | robbm1/pyleri | 4af16774ceb05454e5e4bdf885b6ae6404e8b884 | [
"MIT"
] | 106 | 2016-02-24T12:17:48.000Z | 2021-11-04T18:07:32.000Z | pyleri/__init__.py | robbm1/pyleri | 4af16774ceb05454e5e4bdf885b6ae6404e8b884 | [
"MIT"
] | 15 | 2016-10-24T10:32:31.000Z | 2021-11-26T14:21:46.000Z | pyleri/__init__.py | robbm1/pyleri | 4af16774ceb05454e5e4bdf885b6ae6404e8b884 | [
"MIT"
] | 12 | 2017-02-27T12:58:50.000Z | 2020-02-14T14:58:30.000Z | '''Py-LeRi (pyleri) Python LR-parsing module.
This module is inspired by lrparsing (http://lrparsing.sourceforge.net/),
a Python parser written by Russell Stuart, 2014-05-29.
We did however found some strange, conflict behavior using this module and
therefore decided to build our own parser which works together with ... | 28.333333 | 78 | 0.781961 |
from .choice import Choice
from .endofstatement import end_of_statement
from .grammar import Grammar
from .grammar import create_grammar
from .keyword import Keyword
from .list import List
from .optional import Optional
from .prio import Prio
from .ref import Ref
from .regex import Regex
from .repeat import Repeat
fro... | true | true |
08f063226579339e1cf53915ec6fc0fe0eba2f47 | 2,438 | py | Python | synapser/main.py | epicosy/synapser | 2ba6ad45803227a873051c8f8244ac4035b88c49 | [
"MIT"
] | null | null | null | synapser/main.py | epicosy/synapser | 2ba6ad45803227a873051c8f8244ac4035b88c49 | [
"MIT"
] | null | null | null | synapser/main.py | epicosy/synapser | 2ba6ad45803227a873051c8f8244ac4035b88c49 | [
"MIT"
] | null | null | null |
from cement import App, TestApp
from cement.core.exc import CaughtSignal
from synapser.core.interfaces import HandlersInterface
from synapser.handlers.command import CommandHandler
from synapser.handlers.instance import InstanceHandler
from synapser.handlers.api import SignalHandler
from synapser.handlers.plugin impo... | 24.626263 | 79 | 0.593519 |
from cement import App, TestApp
from cement.core.exc import CaughtSignal
from synapser.core.interfaces import HandlersInterface
from synapser.handlers.command import CommandHandler
from synapser.handlers.instance import InstanceHandler
from synapser.handlers.api import SignalHandler
from synapser.handlers.plugin impo... | true | true |
08f063faf14f2a1b3379832ade9fa2700bc2a054 | 305 | py | Python | extstats/utils/merge_ext_lists.py | bakl/chrome-extensions-archive | e940c40368f04b97f52c03b045569768ead6760f | [
"MIT"
] | 408 | 2016-04-27T03:20:20.000Z | 2022-02-25T06:48:16.000Z | extstats/utils/merge_ext_lists.py | bakl/chrome-extensions-archive | e940c40368f04b97f52c03b045569768ead6760f | [
"MIT"
] | 37 | 2016-04-27T07:55:57.000Z | 2022-02-13T09:25:56.000Z | extstats/utils/merge_ext_lists.py | bakl/chrome-extensions-archive | e940c40368f04b97f52c03b045569768ead6760f | [
"MIT"
] | 79 | 2016-05-18T09:51:53.000Z | 2022-03-25T13:43:31.000Z | import json
prev = json.load(open('data/enriched.json'))
curr = json.load(open('data/pages_parsed.json'))
exts_id = set(ext['ext_id'] for ext in curr)
for ext in prev:
if ext['ext_id'] not in exts_id:
ext['deleted'] = True
curr.append(ext)
json.dump(curr, open('data/_merged.json','w'), indent=2) | 23.461538 | 56 | 0.688525 | import json
prev = json.load(open('data/enriched.json'))
curr = json.load(open('data/pages_parsed.json'))
exts_id = set(ext['ext_id'] for ext in curr)
for ext in prev:
if ext['ext_id'] not in exts_id:
ext['deleted'] = True
curr.append(ext)
json.dump(curr, open('data/_merged.json','w'), indent=2) | true | true |
08f064254d4b17b095e84a212e53e54a18d8f1d8 | 1,580 | py | Python | aliyun-python-sdk-csb/aliyunsdkcsb/request/v20171118/FindInstanceListRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-csb/aliyunsdkcsb/request/v20171118/FindInstanceListRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-csb/aliyunsdkcsb/request/v20171118/FindInstanceListRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.916667 | 69 | 0.753797 |
from aliyunsdkcore.request import RpcRequest
class FindInstanceListRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'CSB', '2017-11-18', 'FindInstanceList')
def get_SearchTxt(self):
return self.get_query_params().get('SearchTxt')
def set_SearchTxt(self,SearchTxt):
self.add_query_par... | true | true |
08f064a54bc9761c0e0a5f26e95255e8fe4fad20 | 48,135 | py | Python | dockerspawner/dockerspawner.py | ideonate/dockerspawner | 84f4e18c1c93235c4ee0f75a0abe0324dcb4f006 | [
"BSD-3-Clause"
] | null | null | null | dockerspawner/dockerspawner.py | ideonate/dockerspawner | 84f4e18c1c93235c4ee0f75a0abe0324dcb4f006 | [
"BSD-3-Clause"
] | null | null | null | dockerspawner/dockerspawner.py | ideonate/dockerspawner | 84f4e18c1c93235c4ee0f75a0abe0324dcb4f006 | [
"BSD-3-Clause"
] | null | null | null | """
A Spawner for JupyterHub that runs each user's server in a separate docker container
"""
from concurrent.futures import ThreadPoolExecutor, wait
from io import BytesIO
import os
from pprint import pformat
import string
from tarfile import TarFile, TarInfo
from textwrap import dedent
from urllib.parse import urlpar... | 32.767189 | 155 | 0.581552 |
from concurrent.futures import ThreadPoolExecutor, wait
from io import BytesIO
import os
from pprint import pformat
import string
from tarfile import TarFile, TarInfo
from textwrap import dedent
from urllib.parse import urlparse
import warnings
from async_generator import async_generator, yield_
from asyncio import sl... | true | true |
08f064c5e2c6671efe15f7f4c09dfee075df19ba | 2,982 | py | Python | nb_conda_kernels/tests/test_config.py | javabrett/nb_conda_kernels | e779b519ee8c336520fa943c4556418286b796b4 | [
"BSD-3-Clause"
] | null | null | null | nb_conda_kernels/tests/test_config.py | javabrett/nb_conda_kernels | e779b519ee8c336520fa943c4556418286b796b4 | [
"BSD-3-Clause"
] | null | null | null | nb_conda_kernels/tests/test_config.py | javabrett/nb_conda_kernels | e779b519ee8c336520fa943c4556418286b796b4 | [
"BSD-3-Clause"
] | null | null | null | from sys import prefix
from nb_conda_kernels.manager import CondaKernelSpecManager, RUNNER_COMMAND
# The testing regime for nb_conda_kernels is unique, in that it needs to
# see an entire conda installation with multiple environments and both
# Python and R kernels in those environments. In contrast, most conda
# buil... | 45.181818 | 98 | 0.608987 | from sys import prefix
from nb_conda_kernels.manager import CondaKernelSpecManager, RUNNER_COMMAND
# global environment is ready to receive the other tests.
def test_configuration():
print('Conda configuration')
print('-------------------')
spec_manager = CondaKernelSpecManager()
conda_info = spec_ma... | true | true |
08f064e14a1b51d7a33f9e2e0759893ae90c46b1 | 3,952 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/windows/win_pagefile.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | venv/lib/python2.7/site-packages/ansible/modules/windows/win_pagefile.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | venv/lib/python2.7/site-packages/ansible/modules/windows/win_pagefile.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Liran Nisanov <lirannis@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata... | 29.058824 | 158 | 0.696103 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_pagefile
version_added: "2.4"
short_description: Query or change pagefile configuration
description:
- Query current pagefile configurat... | true | true |
08f06505a1d229c62dbe52a8a6dfdf2ce80c457b | 757 | py | Python | gallery/migrations/0006_auto_20180927_1811.py | Nancy-Muthinzi/ip1-django | b14c637eb494240c8d3d599e48fa31a80792c3b9 | [
"MIT"
] | null | null | null | gallery/migrations/0006_auto_20180927_1811.py | Nancy-Muthinzi/ip1-django | b14c637eb494240c8d3d599e48fa31a80792c3b9 | [
"MIT"
] | null | null | null | gallery/migrations/0006_auto_20180927_1811.py | Nancy-Muthinzi/ip1-django | b14c637eb494240c8d3d599e48fa31a80792c3b9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-09-27 15:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gallery', '0005_auto_20180927_1808'),
]
operations =... | 28.037037 | 104 | 0.640687 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gallery', '0005_auto_20180927_1808'),
]
operations = [
migrations.AlterField(
model_name='image',
... | true | true |
08f065437cfbab8c629928fde207f069e65667ac | 201 | py | Python | running_modes/reinforcement_learning/configurations/scoring_strategy_configuration.py | lilleswing/Reinvent-1 | ac4e3e6fa6379c6f4af883478dfd1b3407933ada | [
"Apache-2.0"
] | 183 | 2020-04-04T02:01:15.000Z | 2022-03-30T21:56:56.000Z | running_modes/reinforcement_learning/configurations/scoring_strategy_configuration.py | lilleswing/Reinvent-1 | ac4e3e6fa6379c6f4af883478dfd1b3407933ada | [
"Apache-2.0"
] | 39 | 2020-04-05T15:19:56.000Z | 2022-03-09T12:58:21.000Z | running_modes/reinforcement_learning/configurations/scoring_strategy_configuration.py | lilleswing/Reinvent-1 | ac4e3e6fa6379c6f4af883478dfd1b3407933ada | [
"Apache-2.0"
] | 70 | 2020-04-05T19:25:43.000Z | 2022-02-22T12:04:39.000Z | from dataclasses import dataclass
from reinvent_scoring import ScoringFunctionParameters
@dataclass
class ScoringStrategyConfiguration:
scoring_function: ScoringFunctionParameters
name: str
| 20.1 | 54 | 0.850746 | from dataclasses import dataclass
from reinvent_scoring import ScoringFunctionParameters
@dataclass
class ScoringStrategyConfiguration:
scoring_function: ScoringFunctionParameters
name: str
| true | true |
08f065aad82a63bd21a52c9d87e8a96e823581dc | 2,863 | py | Python | price_seq.py | xSakix/AI_playground | 17587583ecfc8fd9e92d9d3f643da6d37ac5cffd | [
"Apache-2.0"
] | 1 | 2022-01-26T01:36:33.000Z | 2022-01-26T01:36:33.000Z | price_seq.py | xSakix/AI_playground | 17587583ecfc8fd9e92d9d3f643da6d37ac5cffd | [
"Apache-2.0"
] | null | null | null | price_seq.py | xSakix/AI_playground | 17587583ecfc8fd9e92d9d3f643da6d37ac5cffd | [
"Apache-2.0"
] | null | null | null | from keras import Sequential
from keras.layers import LSTM, Reshape, GRU, Dropout, Dense, Bidirectional
from pandas_datareader import data as data_reader
import matplotlib.pyplot as plt
import seaborn as sns
import pymc3 as pm
from sklearn.preprocessing import StandardScaler
import numpy as np
from sklearn.cluster impo... | 24.470085 | 106 | 0.671673 | from keras import Sequential
from keras.layers import LSTM, Reshape, GRU, Dropout, Dense, Bidirectional
from pandas_datareader import data as data_reader
import matplotlib.pyplot as plt
import seaborn as sns
import pymc3 as pm
from sklearn.preprocessing import StandardScaler
import numpy as np
from sklearn.cluster impo... | true | true |
08f066e5f2d2f41b5878af859afdb8ea9cb721af | 4,863 | py | Python | pytorch3d/implicitron/tools/model_io.py | angshine/pytorch3d | 5d9b236f41ea2175d8747f0c433b8a1c82393bed | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pytorch3d/implicitron/tools/model_io.py | angshine/pytorch3d | 5d9b236f41ea2175d8747f0c433b8a1c82393bed | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pytorch3d/implicitron/tools/model_io.py | angshine/pytorch3d | 5d9b236f41ea2175d8747f0c433b8a1c82393bed | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import glob
import logging
import os
import shutil
import tempfile
import torch
logger = logging.getLogger(_... | 28.946429 | 86 | 0.62225 |
import glob
import logging
import os
import shutil
import tempfile
import torch
logger = logging.getLogger(__name__)
def load_stats(flstats):
from pytorch3d.implicitron.tools.stats import Stats
try:
stats = Stats.load(flstats)
except:
logger.info("Cant load stats! %s" % flstats)
... | true | true |
08f0677595f678882fe079560aa727dbb7c74d43 | 2,677 | py | Python | otto/classes/gymwrapper.py | C0PEP0D/otto | 9b76ab8d5514c10390df2069048062d119a951f3 | [
"MIT"
] | null | null | null | otto/classes/gymwrapper.py | C0PEP0D/otto | 9b76ab8d5514c10390df2069048062d119a951f3 | [
"MIT"
] | null | null | null | otto/classes/gymwrapper.py | C0PEP0D/otto | 9b76ab8d5514c10390df2069048062d119a951f3 | [
"MIT"
] | null | null | null | """Provides an OpenAI Gym interface for the source-tracking POMDP."""
import gym
import numpy as np
class GymWrapper(gym.Env):
"""OpenAI Gym interface for the source-tracking POMDP.
Args:
sim (SourceTracking): an instance of the SourceTracking class with draw_source = True
stop_t (int, option... | 29.417582 | 135 | 0.588719 | import gym
import numpy as np
class GymWrapper(gym.Env):
def __init__(
self,
sim,
stop_t=100000, ):
super().__init__()
self.sim = sim if not self.sim.draw_source:
raise Exception("GymWrapper requires draw_source = True")
... | true | true |
08f0686f0d0fc85a084c4f68f1f408433e5990cb | 17,146 | py | Python | vendor/packages/nose/unit_tests/test_loader.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | vendor/packages/nose/unit_tests/test_loader.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/nose/unit_tests/test_loader.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 1 | 2019-11-02T23:29:13.000Z | 2019-11-02T23:29:13.000Z | import imp
import os
import sys
import unittest
from nose.loader import TestLoader as Loader
from nose import util, loader, selector # so we can set mocks
import nose.case
def safepath(p):
"""Helper function to make cross-platform safe paths
"""
return p.replace('/', os.sep)
def mods():
#
# Set... | 34.155378 | 78 | 0.590283 | import imp
import os
import sys
import unittest
from nose.loader import TestLoader as Loader
from nose import util, loader, selector import nose.case
def safepath(p):
"""Helper function to make cross-platform safe paths
"""
return p.replace('/', os.sep)
def mods():
# test loading
#
... | false | true |
08f068bcb3e47db8c95f1383d48602d42d82eede | 6,604 | py | Python | main.py | JavisPeng/CenterNet-pytorch-detection-simple-tutorial | 1dd69dd26be3627079aeeb458dde35a1f3f1c5df | [
"MIT"
] | 15 | 2020-05-19T09:23:29.000Z | 2022-02-28T08:38:11.000Z | main.py | JavisPeng/CenterNet-pytorch-detection-simple-tutorial | 1dd69dd26be3627079aeeb458dde35a1f3f1c5df | [
"MIT"
] | 2 | 2020-11-26T05:37:26.000Z | 2022-02-09T19:32:39.000Z | main.py | JavisPeng/CenterNet-pytorch-detection-simple-tutorial | 1dd69dd26be3627079aeeb458dde35a1f3f1c5df | [
"MIT"
] | 6 | 2020-07-25T06:01:16.000Z | 2022-01-19T03:22:13.000Z | import torch, tqdm
from models import cnet
from torchvision import transforms
from torch.utils.data import DataLoader
from dataset import CTDataset
from losses import FocalLoss, RegL1Loss
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
torch.manual_seed(41)
def train_epoch(epoch, model, dl, op... | 42.333333 | 118 | 0.665203 | import torch, tqdm
from models import cnet
from torchvision import transforms
from torch.utils.data import DataLoader
from dataset import CTDataset
from losses import FocalLoss, RegL1Loss
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
torch.manual_seed(41)
def train_epoch(epoch, model, dl, op... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.