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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f77c3d3475a190e804ebd1826ad3373e7e110fc7 | 1,644 | py | Python | contrib/signet/getcoins.py | widecoin-project/widecoin | 143b190a61f95a4b7d40c5da484cdde8f0c5ac3f | [
"MIT"
] | 8 | 2021-04-17T16:11:50.000Z | 2021-06-23T05:30:39.000Z | contrib/signet/getcoins.py | widecoin-project/widecoin | 143b190a61f95a4b7d40c5da484cdde8f0c5ac3f | [
"MIT"
] | 1 | 2021-04-18T11:57:59.000Z | 2021-04-18T11:57:59.000Z | contrib/signet/getcoins.py | widecoin-project/widecoin | 143b190a61f95a4b7d40c5da484cdde8f0c5ac3f | [
"MIT"
] | 7 | 2021-04-17T16:04:12.000Z | 2021-06-10T00:54:53.000Z | #!/usr/bin/env python3
# Copyright (c) 2020 The Widecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import argparse
import subprocess
import requests
import sys
parser = argparse.ArgumentParser(description='S... | 44.432432 | 175 | 0.706204 |
import argparse
import subprocess
import requests
import sys
parser = argparse.ArgumentParser(description='Script to get coins from a faucet.', epilog='You may need to start with double-dash (--) when providing widecoin-cli arguments.')
parser.add_argument('-c', '--cmd', dest='cmd', default='widecoin-cli', help='wide... | true | true |
f77c3d4e4f8ef6e4aee72fd5b948f0f0468deadc | 1,423 | py | Python | staging/generators/random_choice.py | Pyromanser/django-staging | 1273ba880f48705f968e85631f55af036b1dceb2 | [
"BSD-3-Clause"
] | null | null | null | staging/generators/random_choice.py | Pyromanser/django-staging | 1273ba880f48705f968e85631f55af036b1dceb2 | [
"BSD-3-Clause"
] | null | null | null | staging/generators/random_choice.py | Pyromanser/django-staging | 1273ba880f48705f968e85631f55af036b1dceb2 | [
"BSD-3-Clause"
] | 2 | 2021-06-07T23:09:19.000Z | 2021-06-09T21:27:55.000Z | import random
from django.db import models
from django import forms
from staging.generators import BaseGenerator
class NotInitialized():
pass
class Generator(BaseGenerator):
name = 'Random choice'
slug = 'random-choice'
for_fields = [models.BigIntegerField, models.CharField, models.DecimalField, mod... | 33.093023 | 120 | 0.670415 | import random
from django.db import models
from django import forms
from staging.generators import BaseGenerator
class NotInitialized():
pass
class Generator(BaseGenerator):
name = 'Random choice'
slug = 'random-choice'
for_fields = [models.BigIntegerField, models.CharField, models.DecimalField, mod... | true | true |
f77c408f205c09be899159fb3ab5f5e73e1b6cc7 | 26,171 | py | Python | python/cudf/cudf/core/column/numerical.py | adelevie/cudf | fe5e07ddba42eeb6e1dc7cf94cdeebf52970b187 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/core/column/numerical.py | adelevie/cudf | fe5e07ddba42eeb6e1dc7cf94cdeebf52970b187 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/core/column/numerical.py | adelevie/cudf | fe5e07ddba42eeb6e1dc7cf94cdeebf52970b187 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2021, NVIDIA CORPORATION.
from __future__ import annotations
from numbers import Number
from typing import Any, Callable, Sequence, Union, cast
import numpy as np
import pandas as pd
from nvtx import annotate
from pandas.api.types import is_integer_dtype
import cudf
from cudf import _lib as libc... | 34.076823 | 80 | 0.555118 | from __future__ import annotations
from numbers import Number
from typing import Any, Callable, Sequence, Union, cast
import numpy as np
import pandas as pd
from nvtx import annotate
from pandas.api.types import is_integer_dtype
import cudf
from cudf import _lib as libcudf
from cudf._lib.quantiles import quantile as... | true | true |
f77c415debdc38d69a3a98dfd189b2a9f1106eec | 1,291 | py | Python | examples/tutorial2.py | yxwlr995/-Python-Pandas-XlsxWriter | cd28c1b968795b67f3013c49a0e02ffda5898163 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/tutorial2.py | yxwlr995/-Python-Pandas-XlsxWriter | cd28c1b968795b67f3013c49a0e02ffda5898163 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/tutorial2.py | yxwlr995/-Python-Pandas-XlsxWriter | cd28c1b968795b67f3013c49a0e02ffda5898163 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-04-12T16:44:58.000Z | 2020-04-12T16:44:58.000Z | ##############################################################################
#
# A simple program to write some data to an Excel file using the XlsxWriter
# Python module.
#
# This program is shown, with explanations, in Tutorial 2 of the XlsxWriter
# documentation.
#
# Copyright 2013, John McNamara, jmcnamara@cpan.o... | 25.82 | 78 | 0.648335 | from xlsxwriter.workbook import Workbook
workbook = Workbook('Expenses02.xlsx')
worksheet = workbook.add_worksheet()
bold = workbook.add_format({'bold': True})
money = workbook.add_format({'num_format': '$#,##0'})
worksheet.write('A1', 'Item', bold)
worksheet.write('B1', 'Cost', bold)
expenses = (
['Rent', 100... | true | true |
f77c41fc3b50e8141c3f708b9daf78c15639ec36 | 242,290 | py | Python | src/sage/modules/free_module.py | nikmihale/sage | e2dcdeeabb578c37bcf0361c0be3079315e9252c | [
"BSL-1.0"
] | 4 | 2020-07-17T04:49:44.000Z | 2020-07-29T06:33:51.000Z | src/sage/modules/free_module.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | src/sage/modules/free_module.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | r"""
Free modules
Sage supports computation with free modules over an arbitrary commutative ring.
Nontrivial functionality is available over `\ZZ`, fields, and some principal
ideal domains (e.g. `\QQ[x]` and rings of integers of number fields). All free
modules over an integral domain are equipped with an embedding in... | 32.978086 | 194 | 0.530992 |
from __future__ import print_function, absolute_import
from itertools import islice
from . import free_module_element
import sage.matrix.matrix_space
import sage.misc.latex as latex
from sage.modules.module import Module
import sage.rings.finite_rings.finite_field_constructor as finite_field
import sage.rings.ring a... | true | true |
f77c42409bf52bd563c96127dc8418534bf3c486 | 6,205 | py | Python | arranger/data/collect_lmd.py | dezimynona/icml2021submission | 009eb6c6b617536bda7a247cbf5d6b7c0c131f19 | [
"MIT"
] | 29 | 2021-07-11T03:56:00.000Z | 2022-02-16T03:22:52.000Z | arranger/data/collect_lmd.py | salu133445/arranger | 54c14646b0f74fea971bd0a346fcfe384ae9507e | [
"MIT"
] | null | null | null | arranger/data/collect_lmd.py | salu133445/arranger | 54c14646b0f74fea971bd0a346fcfe384ae9507e | [
"MIT"
] | 3 | 2021-07-19T02:42:48.000Z | 2022-02-11T01:48:29.000Z | """Collect pop music dataset."""
import argparse
import logging
import operator
import random
from pathlib import Path
import joblib
import muspy
import tqdm
from arranger.utils import load_config, setup_loggers
# Load configuration
CONFIG = load_config()
def parse_arguments():
"""Parse command-line arguments.... | 28.463303 | 79 | 0.592425 | import argparse
import logging
import operator
import random
from pathlib import Path
import joblib
import muspy
import tqdm
from arranger.utils import load_config, setup_loggers
CONFIG = load_config()
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument(
"-i",
"--i... | true | true |
f77c43223c07671dfbdcb0d432e5aa05ba8ca82f | 1,552 | py | Python | empower/managers/ranmanager/vbsp/vbspmanager.py | EstefaniaCC/empower-runtime-5g-essence-multicast | b025d10b15c2b11ce313918d5961d109273245b5 | [
"Apache-2.0"
] | null | null | null | empower/managers/ranmanager/vbsp/vbspmanager.py | EstefaniaCC/empower-runtime-5g-essence-multicast | b025d10b15c2b11ce313918d5961d109273245b5 | [
"Apache-2.0"
] | null | null | null | empower/managers/ranmanager/vbsp/vbspmanager.py | EstefaniaCC/empower-runtime-5g-essence-multicast | b025d10b15c2b11ce313918d5961d109273245b5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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 applicabl... | 27.22807 | 74 | 0.686211 |
import empower.managers.ranmanager.vbsp as vbsp
from empower.managers.ranmanager.ranmanager import RANManager
from empower.managers.ranmanager.vbsp.vbshandler import VBSHandler
from empower.managers.ranmanager.vbsp.vbspconnection import VBSPConnection
from empower.core.vbs import VBS
DEFAULT_PORT = 5533
class VBS... | true | true |
f77c436790b09b7eb1f3cf2ab003fee90ed294de | 7,674 | py | Python | mephisto/abstractions/blueprints/abstract/static_task/static_blueprint.py | snyxan/Mephisto | a48ab19edf25b359379f4d31a990dfe2a3791f37 | [
"MIT"
] | null | null | null | mephisto/abstractions/blueprints/abstract/static_task/static_blueprint.py | snyxan/Mephisto | a48ab19edf25b359379f4d31a990dfe2a3791f37 | [
"MIT"
] | null | null | null | mephisto/abstractions/blueprints/abstract/static_task/static_blueprint.py | snyxan/Mephisto | a48ab19edf25b359379f4d31a990dfe2a3791f37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from mephisto.abstractions.blueprint import (
Blueprint,
OnboardingRequired,
BlueprintArgs,
SharedTaskSt... | 37.802956 | 92 | 0.640344 |
from mephisto.abstractions.blueprint import (
Blueprint,
OnboardingRequired,
BlueprintArgs,
SharedTaskState,
)
from dataclasses import dataclass, field
from omegaconf import MISSING, DictConfig
from mephisto.data_model.assignment import InitializationData
from mephisto.abstractions.blueprints.abstract... | true | true |
f77c43734c3eca1466b417f402b117f38a6394eb | 9,429 | py | Python | oslo/log/openstack/common/rpc/matchmaker.py | citrix-openstack-build/oslo.log | f3f275a7625425d8790aa92ab9f94a51474d0aab | [
"Apache-2.0"
] | null | null | null | oslo/log/openstack/common/rpc/matchmaker.py | citrix-openstack-build/oslo.log | f3f275a7625425d8790aa92ab9f94a51474d0aab | [
"Apache-2.0"
] | null | null | null | oslo/log/openstack/common/rpc/matchmaker.py | citrix-openstack-build/oslo.log | f3f275a7625425d8790aa92ab9f94a51474d0aab | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Cloudscaling Group, 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 applicabl... | 29.101852 | 78 | 0.636971 |
import contextlib
import eventlet
from oslo.config import cfg
from oslo.log.openstack.common.gettextutils import _, _LI
from oslo.log.openstack.common import log as logging
matchmaker_opts = [
cfg.IntOpt('matchmaker_heartbeat_freq',
default=300,
help='Heartbeat frequency'),
c... | true | true |
f77c440f2d4128708059f6c8b2c2f2ba7a2fd572 | 7,815 | py | Python | tests/test_model_saving.py | huangshunliang/keras_h | 87ec630a76e2badf6ddd48f889c80e5e2f571117 | [
"MIT"
] | 1 | 2021-02-09T11:52:35.000Z | 2021-02-09T11:52:35.000Z | tests/test_model_saving.py | huangshunliang/keras_h | 87ec630a76e2badf6ddd48f889c80e5e2f571117 | [
"MIT"
] | null | null | null | tests/test_model_saving.py | huangshunliang/keras_h | 87ec630a76e2badf6ddd48f889c80e5e2f571117 | [
"MIT"
] | null | null | null | import pytest
import os
import tempfile
import numpy as np
from numpy.testing import assert_allclose
from keras.models import Model, Sequential
from keras.layers import Dense, Dropout, Lambda, RepeatVector, TimeDistributed
from keras.layers import Input
from keras import optimizers
from keras import objectives
from ke... | 29.160448 | 89 | 0.659885 | import pytest
import os
import tempfile
import numpy as np
from numpy.testing import assert_allclose
from keras.models import Model, Sequential
from keras.layers import Dense, Dropout, Lambda, RepeatVector, TimeDistributed
from keras.layers import Input
from keras import optimizers
from keras import objectives
from ke... | true | true |
f77c44589297aeb82c95476754eb7380493de353 | 823 | py | Python | personalGallery/urls.py | samwendo/Gallery | d26defdb93f0d4b6c9ae88a2caad8788df7fe39a | [
"MIT"
] | null | null | null | personalGallery/urls.py | samwendo/Gallery | d26defdb93f0d4b6c9ae88a2caad8788df7fe39a | [
"MIT"
] | 4 | 2020-02-12T03:17:12.000Z | 2022-03-12T00:04:26.000Z | personalGallery/urls.py | samwendo/Gallery | d26defdb93f0d4b6c9ae88a2caad8788df7fe39a | [
"MIT"
] | null | null | null | """personalGallery URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | 34.291667 | 79 | 0.697448 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('gallery.urls'))
]
| true | true |
f77c45c534814df531087b24dcf31430a0f3ba2b | 5,384 | py | Python | lscp_args.py | DWalker487/dpm-mananger | e428da68a569e8080376d6248bc0a8c39e6c17b5 | [
"Apache-2.0"
] | 4 | 2019-04-26T10:12:35.000Z | 2019-10-24T08:02:52.000Z | lscp_args.py | DWalker487/dpm-mananger | e428da68a569e8080376d6248bc0a8c39e6c17b5 | [
"Apache-2.0"
] | 4 | 2019-03-13T12:13:25.000Z | 2019-10-24T16:09:36.000Z | lscp_args.py | DWalker487/dpm-mananger | e428da68a569e8080376d6248bc0a8c39e6c17b5 | [
"Apache-2.0"
] | 3 | 2019-03-13T12:08:44.000Z | 2019-10-22T09:54:24.000Z | from __future__ import print_function
import argparse as ap
import os
import multiprocessing
def get_args():
parser = ap.ArgumentParser(
description="General manager for durham grid storage")
parser.add_argument(
"directories",
help="gfal directories to look in",
nargs="*")
... | 27.896373 | 112 | 0.550706 | from __future__ import print_function
import argparse as ap
import os
import multiprocessing
def get_args():
parser = ap.ArgumentParser(
description="General manager for durham grid storage")
parser.add_argument(
"directories",
help="gfal directories to look in",
nargs="*")
... | true | true |
f77c47643aea5ce8eb6e192222ae4208debd8eee | 334 | py | Python | tasks/env.py | Lee-W/pycontw-postevent-report-generator | 873aa61e063022213f34b4606dbff7bd47e7b67f | [
"BSD-3-Clause"
] | null | null | null | tasks/env.py | Lee-W/pycontw-postevent-report-generator | 873aa61e063022213f34b4606dbff7bd47e7b67f | [
"BSD-3-Clause"
] | null | null | null | tasks/env.py | Lee-W/pycontw-postevent-report-generator | 873aa61e063022213f34b4606dbff7bd47e7b67f | [
"BSD-3-Clause"
] | null | null | null | from invoke import task
@task
def clean(ctx):
"""Remove virtual environement"""
ctx.run("pipenv --rm", warn=True)
@task
def init(ctx):
"""Install production dependencies"""
ctx.run("pipenv install --deploy")
@task
def init_dev(ctx):
"""Install development dependencies"""
ctx.run("pipenv in... | 16.7 | 42 | 0.658683 | from invoke import task
@task
def clean(ctx):
ctx.run("pipenv --rm", warn=True)
@task
def init(ctx):
ctx.run("pipenv install --deploy")
@task
def init_dev(ctx):
ctx.run("pipenv install --dev")
| true | true |
f77c47ecc987f776ec23ed7eb6dc4dc503622abd | 633 | py | Python | main/migrations/0015_auto_20201126_2149.py | zahir1509/project-ap-etravel | 2113a84ae4340be0e8cfa2676f448878c625e3e3 | [
"MIT"
] | 1 | 2020-12-06T17:49:11.000Z | 2020-12-06T17:49:11.000Z | main/migrations/0015_auto_20201126_2149.py | zahir1509/project-ap-etravel | 2113a84ae4340be0e8cfa2676f448878c625e3e3 | [
"MIT"
] | null | null | null | main/migrations/0015_auto_20201126_2149.py | zahir1509/project-ap-etravel | 2113a84ae4340be0e8cfa2676f448878c625e3e3 | [
"MIT"
] | 1 | 2020-12-07T14:20:41.000Z | 2020-12-07T14:20:41.000Z | # Generated by Django 3.1.3 on 2020-11-26 16:19
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0014_auto_20201126_1943'),
]
operations = [
migrations.AddField(
model_name='reservation',
n... | 25.32 | 100 | 0.601896 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0014_auto_20201126_1943'),
]
operations = [
migrations.AddField(
model_name='reservation',
name='reference_name',
field=models.C... | true | true |
f77c4854fac18d9e40d7a68606178afde9447732 | 292 | py | Python | src/covid19/lk_vax_centers/lk_vax_center_constants.py | kaveenr/covid19 | f77b1abad1a809c7ad0b77208211ed266251c489 | [
"MIT"
] | 5 | 2021-06-11T16:11:58.000Z | 2021-09-02T14:09:41.000Z | src/covid19/lk_vax_centers/lk_vax_center_constants.py | kaveenr/covid19 | f77b1abad1a809c7ad0b77208211ed266251c489 | [
"MIT"
] | 2 | 2021-07-06T11:11:50.000Z | 2021-08-23T10:35:31.000Z | src/covid19/lk_vax_centers/lk_vax_center_constants.py | kaveenr/covid19 | f77b1abad1a809c7ad0b77208211ed266251c489 | [
"MIT"
] | 2 | 2021-08-16T15:32:44.000Z | 2021-08-23T03:25:08.000Z | VAX_DASH_URL = (
'https://www.presidentsoffice.gov.lk/index.php/vaccination-dashboard/'
)
REMOTE_DATA_DIR = 'https://raw.githubusercontent.com/nuuuwan/covid19/data'
CACHE_NAME = 'covid19.lk_vax_centers'
CACHE_DIR = '/Users/nuwan.senaratna/Not.Dropbox/_CACHE'
CACHE_TIMEOUT = 86400 * 90
| 29.2 | 74 | 0.770548 | VAX_DASH_URL = (
'https://www.presidentsoffice.gov.lk/index.php/vaccination-dashboard/'
)
REMOTE_DATA_DIR = 'https://raw.githubusercontent.com/nuuuwan/covid19/data'
CACHE_NAME = 'covid19.lk_vax_centers'
CACHE_DIR = '/Users/nuwan.senaratna/Not.Dropbox/_CACHE'
CACHE_TIMEOUT = 86400 * 90
| true | true |
f77c48a5cd841243939e1718880eb7d3983ae85f | 570 | py | Python | algorithms/arrays/josephus.py | zhengli0817/algorithms | 3c98813f0329d9a5fff1107dbcd40e7f38d2275d | [
"MIT"
] | 128 | 2018-02-02T03:12:59.000Z | 2021-08-22T16:39:12.000Z | algorithms/arrays/josephus.py | zhengli0817/algorithms | 3c98813f0329d9a5fff1107dbcd40e7f38d2275d | [
"MIT"
] | 9 | 2018-09-27T01:27:25.000Z | 2018-12-05T23:44:44.000Z | algorithms/arrays/josephus.py | zhengli0817/algorithms | 3c98813f0329d9a5fff1107dbcd40e7f38d2275d | [
"MIT"
] | 57 | 2018-02-02T04:37:05.000Z | 2020-11-09T05:09:58.000Z | """
There are people sitting in a circular fashion,
print every third member while removing them,
the next counter starts immediately after the member is removed.
Print till all the members are exhausted.
For example:
Input: consider 123456789 members sitting in a circular fashion,
Output: 369485271
"""
def josephus... | 27.142857 | 64 | 0.698246 |
def josephus(int_list, skip):
skip = skip - 1 idx = 0
len_list = (len(int_list))
while len_list > 0:
idx = (skip+idx) % len_list yield int_list.pop(idx)
len_list -= 1
| true | true |
f77c494059149870f39f27c5bc06365c59e0d2e9 | 6,424 | py | Python | external/model-preparation-algorithm/tests/ote_cli/test_seg_cls_il.py | opencv/openvino_training_extensions | f5d809741e192a2345558efc75899a475019cf98 | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | external/model-preparation-algorithm/tests/ote_cli/test_seg_cls_il.py | opencv/openvino_training_extensions | f5d809741e192a2345558efc75899a475019cf98 | [
"Apache-2.0"
] | 229 | 2019-02-28T21:37:08.000Z | 2020-09-07T15:11:49.000Z | external/model-preparation-algorithm/tests/ote_cli/test_seg_cls_il.py | opencv/openvino_training_extensions | f5d809741e192a2345558efc75899a475019cf98 | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | """Tests for MPA Class-Incremental Learning for semantic segmentation with OTE CLI"""
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import os
import pytest
from ote_sdk.test_suite.e2e_test_system import e2e_pytest_component
from ote_cli.registry import Registry
from ote_cli.utils.t... | 37.132948 | 105 | 0.725093 |
import os
import pytest
from ote_sdk.test_suite.e2e_test_system import e2e_pytest_component
from ote_cli.registry import Registry
from ote_cli.utils.tests import (
create_venv,
get_some_vars,
ote_demo_deployment_testing,
ote_demo_testing,
ote_demo_openvino_testing,
ote_deploy_openvino_testi... | true | true |
f77c49467cd4d038a2106f9cc900c82e88a33d14 | 4,803 | py | Python | src/lcmap/client/http.py | lcmap/client-py | fc356d9b2917f8e2d0e73048c9bf86982caa6676 | [
"NASA-1.3"
] | null | null | null | src/lcmap/client/http.py | lcmap/client-py | fc356d9b2917f8e2d0e73048c9bf86982caa6676 | [
"NASA-1.3"
] | null | null | null | src/lcmap/client/http.py | lcmap/client-py | fc356d9b2917f8e2d0e73048c9bf86982caa6676 | [
"NASA-1.3"
] | null | null | null | """
The http module contains the primary HTTP class which provides convenience
methods for making calls to the LCMAP service. Supporting module-level
functions are also provided.
The conveniences provided by the HTTP class include:
* session setup
* default headers
* header updates based upon state changes
* path-base... | 30.398734 | 83 | 0.622528 | import logging
import sys
from requests import Session
log = logging.getLogger(__name__)
default_endpoint = "http://localhost:8080"
default_content_type = "json"
vendor = "vnd.usgs.lcmap"
project_url = "https://github.com/usgs-eros/lcmap-client-py"
def get_user_agent():
from lcmap.client import __version__ as... | true | true |
f77c4a0586399661ca6bfbca86aea55b25300c2f | 4,053 | py | Python | src/model_based_shared_control/scripts/collect_data_script.py | argallab/model_based_shared_control | ff42226b6345266f35a32021c7d0b44cc5948ec1 | [
"MIT"
] | 7 | 2019-05-08T19:47:26.000Z | 2022-03-28T06:43:31.000Z | src/model_based_shared_control/scripts/collect_data_script.py | argallab/model_based_shared_control | ff42226b6345266f35a32021c7d0b44cc5948ec1 | [
"MIT"
] | null | null | null | src/model_based_shared_control/scripts/collect_data_script.py | argallab/model_based_shared_control | ff42226b6345266f35a32021c7d0b44cc5948ec1 | [
"MIT"
] | 2 | 2019-05-08T19:47:12.000Z | 2021-07-07T10:10:17.000Z | #!/usr/bin/env python
import gym
import rospy
from sensor_msgs.msg import Joy
from std_msgs.msg import String
from model_based_shared_control.msg import State
from pyglet.window import key
import numpy as np
class LunarLander():
def __init__(self):
# initalize node
rospy.init_node('lunar_lander')
# re... | 32.166667 | 141 | 0.666173 |
import gym
import rospy
from sensor_msgs.msg import Joy
from std_msgs.msg import String
from model_based_shared_control.msg import State
from pyglet.window import key
import numpy as np
class LunarLander():
def __init__(self):
rospy.init_node('lunar_lander')
rospy.on_shutdown(self.shutdown_hook)
... | true | true |
f77c4a1c69442e83c36d112af9379168120b962f | 667 | py | Python | intro/numpy/examples/plot_elephant.py | rossbar/scipy-lecture-notes | 7f74e6925721c43bd81bf0bee34b4805ac4a3b57 | [
"CC-BY-4.0"
] | 2,538 | 2015-01-01T04:58:41.000Z | 2022-03-31T21:06:05.000Z | intro/numpy/examples/plot_elephant.py | rossbar/scipy-lecture-notes | 7f74e6925721c43bd81bf0bee34b4805ac4a3b57 | [
"CC-BY-4.0"
] | 362 | 2015-01-18T14:16:23.000Z | 2021-11-18T16:24:34.000Z | intro/numpy/examples/plot_elephant.py | rossbar/scipy-lecture-notes | 7f74e6925721c43bd81bf0bee34b4805ac4a3b57 | [
"CC-BY-4.0"
] | 1,127 | 2015-01-05T14:39:29.000Z | 2022-03-25T08:38:39.000Z | """
Reading and writing an elephant
===============================
Read and write images
"""
import numpy as np
import matplotlib.pyplot as plt
#################################
# original figure
#################################
plt.figure()
img = plt.imread('../data/elephant.png')
plt.imshow(img)
##############... | 18.527778 | 46 | 0.455772 | import numpy as np
import matplotlib.pyplot as plt
plt.figure()
img = plt.imread('../data/elephant.png')
plt.imshow(img)
plt.figure()
img_red = img[:, :, 0]
plt.imshow(img_red, cmap=plt.cm.gray)
plt.figure()
img_tiny = img[::6, ::6]
plt.imshow(img_tiny, interpolation='nearest')
plt.show()
| true | true |
f77c4aff7ab3137434c35e0de782bdb94cddf82b | 3,636 | py | Python | sushy/resources/compositionservice/resourcezone.py | openstack/sushy | 69b03d80105a98712bb2d3efc4208fa522a46266 | [
"Apache-2.0"
] | 37 | 2017-03-24T10:17:37.000Z | 2022-02-10T19:42:26.000Z | sushy/resources/compositionservice/resourcezone.py | openstack/sushy | 69b03d80105a98712bb2d3efc4208fa522a46266 | [
"Apache-2.0"
] | null | null | null | sushy/resources/compositionservice/resourcezone.py | openstack/sushy | 69b03d80105a98712bb2d3efc4208fa522a46266 | [
"Apache-2.0"
] | 29 | 2017-07-19T21:28:06.000Z | 2021-06-09T05:20:32.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 36 | 74 | 0.702695 |
import logging
from sushy.resources import base
from sushy.resources import common
LOG = logging.getLogger(__name__)
class LinksField(base.CompositeField):
endpoints = base.Field('Endpoints')
involved_switches = base.Field('InvolvedSwitches')
resource_blocks = base.Field('ResourceBlocks')
class R... | true | true |
f77c4bcd40ae8b5b613ce0129b39bbbbff6d1a89 | 9,676 | py | Python | tests/components/renault/__init__.py | andrewwa0/home-assistant-core | 095ceb3081db76ff1aed73865462970d109cdae0 | [
"Apache-2.0"
] | 1 | 2019-04-24T18:04:06.000Z | 2019-04-24T18:04:06.000Z | tests/components/renault/__init__.py | andrewwa0/home-assistant-core | 095ceb3081db76ff1aed73865462970d109cdae0 | [
"Apache-2.0"
] | 60 | 2021-01-23T06:35:15.000Z | 2022-03-31T06:06:15.000Z | tests/components/renault/__init__.py | Munsio/home-assistant | 1060630bbdccda416f4a00655069864bc851c3a9 | [
"Apache-2.0"
] | null | null | null | """Tests for the Renault integration."""
from __future__ import annotations
from types import MappingProxyType
from typing import Any
from unittest.mock import patch
from renault_api.kamereon import schemas
from renault_api.renault_account import RenaultAccount
from homeassistant.components.renault.const import DOMA... | 38.549801 | 88 | 0.72592 | from __future__ import annotations
from types import MappingProxyType
from typing import Any
from unittest.mock import patch
from renault_api.kamereon import schemas
from renault_api.renault_account import RenaultAccount
from homeassistant.components.renault.const import DOMAIN
from homeassistant.config_entries impo... | true | true |
f77c4c774f7ea60743396872c67b683928238f1d | 6,568 | py | Python | steelpy/codes/aisc/aisc335.py | svortega/steelpy | bef35eb8ab8728fc29f57b7070b5f3bac0b0e840 | [
"MIT"
] | 4 | 2021-09-28T12:52:01.000Z | 2022-02-24T22:30:22.000Z | steelpy/codes/aisc/aisc335.py | svortega/steelpy | bef35eb8ab8728fc29f57b7070b5f3bac0b0e840 | [
"MIT"
] | null | null | null | steelpy/codes/aisc/aisc335.py | svortega/steelpy | bef35eb8ab8728fc29f57b7070b5f3bac0b0e840 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2021 steelpy
#
#
# Python stdlib imports
import datetime
#
# package imports
#from iLift.codes.AISC360.July2016.AISC360_16 import *
#from iLift.codes.AISC360.print_report import *
#from iLift.codes.process.process import SummaryResults
#
#
#
#-------------------------------------------------
#
class... | 31.729469 | 79 | 0.535932 | import datetime
class AISC_335_89:
def __init__(self, cls_design):
self._units = cls_design._units
self.beam_name = cls_design.item_name
self._material = cls_design._material
self._section = cls_design._section
self.stiffne... | true | true |
f77c4c8b157d864daf2e1475c48ab602848ab0b2 | 6,069 | py | Python | vumi/components/tests/test_schedule_manager.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 199 | 2015-01-05T09:04:24.000Z | 2018-08-15T17:02:49.000Z | vumi/components/tests/test_schedule_manager.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 187 | 2015-01-06T15:22:38.000Z | 2018-07-14T13:15:29.000Z | vumi/components/tests/test_schedule_manager.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 86 | 2015-01-31T02:47:08.000Z | 2018-12-01T11:59:47.000Z | """Tests for go.apps.sequential_send.vumi_app"""
from datetime import datetime
from vumi.components.schedule_manager import ScheduleManager
from vumi.tests.utils import LogCatcher
from vumi.tests.helpers import VumiTestCase
class TestScheduleManager(VumiTestCase):
def assert_schedule_next(self, config, since_dt... | 42.145833 | 79 | 0.560389 |
from datetime import datetime
from vumi.components.schedule_manager import ScheduleManager
from vumi.tests.utils import LogCatcher
from vumi.tests.helpers import VumiTestCase
class TestScheduleManager(VumiTestCase):
def assert_schedule_next(self, config, since_dt, expected_next_dt):
sm = ScheduleManager... | true | true |
f77c4d6290421e834f35aa3d7f89c5d590027167 | 1,378 | py | Python | firstProg/nitish.py | Bunsultrix/Python-Programs | 0d98a7321197023f760349779cbb4b06c49b98b4 | [
"MIT"
] | 1 | 2021-05-05T14:13:09.000Z | 2021-05-05T14:13:09.000Z | firstProg/nitish.py | Bunsultrix/Python-Programs | 0d98a7321197023f760349779cbb4b06c49b98b4 | [
"MIT"
] | null | null | null | firstProg/nitish.py | Bunsultrix/Python-Programs | 0d98a7321197023f760349779cbb4b06c49b98b4 | [
"MIT"
] | null | null | null | print("hello NItish Susuant Khrolia")
print ("list fuction, tuple, how to interchange numbers")
# list function
#fencing = ["glove","mask","wepone"] {list }
#print (fencing[2]) #{this how we print element of list}
#numbers = [9,8,1,6,7,5,4,0,3,2]
#print (numbers[6]) #{this how we print element of list}
... | 34.45 | 112 | 0.642235 | print("hello NItish Susuant Khrolia")
print ("list fuction, tuple, how to interchange numbers")
print ("THANK YOU")
| true | true |
f77c4da14abb79e9a9f9b96dea7d231ed2255a4c | 1,006 | py | Python | src/pyrfdata/template.py | prasanna/pyrfdata | 8a73b951438a9fc1dac7e952f48c8d191d613c3f | [
"Apache-2.0"
] | null | null | null | src/pyrfdata/template.py | prasanna/pyrfdata | 8a73b951438a9fc1dac7e952f48c8d191d613c3f | [
"Apache-2.0"
] | null | null | null | src/pyrfdata/template.py | prasanna/pyrfdata | 8a73b951438a9fc1dac7e952f48c8d191d613c3f | [
"Apache-2.0"
] | null | null | null | import os
import sys
import yaml
from pyrfdata.file import File
class Template:
def __init__(self, loc, request):
self.loc = loc
self.request = request
self.files = []
self.template_yml = None
def load(self):
template_file = open(self.loc, "r")
self.template_ym... | 25.794872 | 76 | 0.571571 | import os
import sys
import yaml
from pyrfdata.file import File
class Template:
def __init__(self, loc, request):
self.loc = loc
self.request = request
self.files = []
self.template_yml = None
def load(self):
template_file = open(self.loc, "r")
self.template_ym... | true | true |
f77c4db4c612732f88db11b0aabb869f62fe4eed | 6,414 | py | Python | nova/tests/functional/db/test_request_spec.py | teresa-ho/stx-nova | 1f82323439da2449edbbaed2fe1c8414a550c86f | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/db/test_request_spec.py | teresa-ho/stx-nova | 1f82323439da2449edbbaed2fe1c8414a550c86f | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/db/test_request_spec.py | teresa-ho/stx-nova | 1f82323439da2449edbbaed2fe1c8414a550c86f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 38.407186 | 79 | 0.686779 |
from nova import context
from nova.db.sqlalchemy import api as db
from nova.db.sqlalchemy import api_models
from nova import exception
from nova import objects
from nova.objects import base as obj_base
from nova.objects import request_spec
from nova import test
from nova.tests import fixtures
from nova.tests.functiona... | true | true |
f77c4dbe701bad0878361e1ce1c0550afbc71971 | 5,271 | py | Python | buildkite/incompatible_flag_verbose_failures.py | brandjon/continuous-integration | 03a88abbd513f5f305069d82e2a7c4b02b3eadce | [
"Apache-2.0"
] | null | null | null | buildkite/incompatible_flag_verbose_failures.py | brandjon/continuous-integration | 03a88abbd513f5f305069d82e2a7c4b02b3eadce | [
"Apache-2.0"
] | null | null | null | buildkite/incompatible_flag_verbose_failures.py | brandjon/continuous-integration | 03a88abbd513f5f305069d82e2a7c4b02b3eadce | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 34.907285 | 114 | 0.613166 |
import argparse
import sys
import yaml
import bazelci
from bazelci import BuildkiteException
BUILDKITE_MAX_JOBS_LIMIT = 1500
BUILDKITE_ORG = "bazel"
PIPELINE = "bazel-at-release-plus-incompatible-flags"
def get_failing_jobs(build_info):
failing_jobs = []
for job in build_info["jobs"]:
if "state" ... | true | true |
f77c4e896ce7135038e1f7f46c5bb1c97bb36cb4 | 9,821 | py | Python | core/memory.py | devanshshukla99/8085_Simulator | c6e9e1d4b3a1f4d15e03131b6dc127061db30e42 | [
"MIT"
] | null | null | null | core/memory.py | devanshshukla99/8085_Simulator | c6e9e1d4b3a1f4d15e03131b6dc127061db30e42 | [
"MIT"
] | null | null | null | core/memory.py | devanshshukla99/8085_Simulator | c6e9e1d4b3a1f4d15e03131b6dc127061db30e42 | [
"MIT"
] | null | null | null | import re
import textwrap
from core.exceptions import InvalidMemoryAddress, MemoryLimitExceeded
class Hex:
def __init__(self, data: str = "0x00", _bytes: str = 1, *args, **kwargs) -> None:
self._bytes = _bytes
self._base = 16
self._format_spec = f"#0{2 + _bytes * 2}x"
self._format... | 31.477564 | 108 | 0.573567 | import re
import textwrap
from core.exceptions import InvalidMemoryAddress, MemoryLimitExceeded
class Hex:
def __init__(self, data: str = "0x00", _bytes: str = 1, *args, **kwargs) -> None:
self._bytes = _bytes
self._base = 16
self._format_spec = f"#0{2 + _bytes * 2}x"
self._format... | true | true |
f77c4e8eda0146f6dba7a6b0eed7dead8ddfc3a9 | 3,211 | py | Python | utils/neu/misc.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | null | null | null | utils/neu/misc.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | null | null | null | utils/neu/misc.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | 1 | 2020-04-25T06:11:28.000Z | 2020-04-25T06:11:28.000Z | # Copyright (c) 2019 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 29.458716 | 106 | 0.604485 |
import os
def init_nnabla(conf):
import nnabla as nn
from nnabla.ext_utils import get_extension_context
from .comm import CommunicatorWrapper
ctx = get_extension_context(
ext_name=conf.ext_name, device_id=conf.device_id, type_config=conf.type_config)
comm = CommunicatorWrapper(c... | true | true |
f77c5043389e5e85997517bb99d5b099584f0616 | 21,272 | py | Python | ci/test/distributed_run.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 1 | 2021-04-14T03:19:35.000Z | 2021-04-14T03:19:35.000Z | ci/test/distributed_run.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | ci/test/distributed_run.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | null | null | null | from multiprocessing.connection import Listener
import os
import subprocess
import socket
import tempfile
from contextlib import closing
import argparse
import uuid
import getpass
import atexit
import pathlib
import asyncio
import glob
from datetime import date
HARD_CODED_AFFILIATIONS = {
"192.168.1.11": ["192.168... | 35.335548 | 290 | 0.615598 | from multiprocessing.connection import Listener
import os
import subprocess
import socket
import tempfile
from contextlib import closing
import argparse
import uuid
import getpass
import atexit
import pathlib
import asyncio
import glob
from datetime import date
HARD_CODED_AFFILIATIONS = {
"192.168.1.11": ["192.168... | true | true |
f77c51c694091b60768bbc13da081d933be78f34 | 4,210 | py | Python | scripts/germany_mobility.py | mikoar/DAV_project | 8346e2c0b3171b7ddcf576eda0261533dbc6c826 | [
"MIT"
] | null | null | null | scripts/germany_mobility.py | mikoar/DAV_project | 8346e2c0b3171b7ddcf576eda0261533dbc6c826 | [
"MIT"
] | null | null | null | scripts/germany_mobility.py | mikoar/DAV_project | 8346e2c0b3171b7ddcf576eda0261533dbc6c826 | [
"MIT"
] | null | null | null | import plotly
import plotly.graph_objs as go
import pandas as pd
import sys
mobility_germany = pd.read_csv("../data/mobility_germany.csv")
mobility_germany = mobility_germany.loc[mobility_germany.sub_region_1.isnull(), :]
colors = (['indianred']*2+['lightsalmon']*5)*12 + ['indianred']
fig = go.Figure()
fig.add_tra... | 32.890625 | 88 | 0.542043 | import plotly
import plotly.graph_objs as go
import pandas as pd
import sys
mobility_germany = pd.read_csv("../data/mobility_germany.csv")
mobility_germany = mobility_germany.loc[mobility_germany.sub_region_1.isnull(), :]
colors = (['indianred']*2+['lightsalmon']*5)*12 + ['indianred']
fig = go.Figure()
fig.add_tra... | true | true |
f77c53b19150206b2e859cc1c2d210244edea77c | 831 | py | Python | main.py | akshay-1612/TwitterBot | 3c3102688433f9dc0b0163c32adbacb29ebfbcce | [
"MIT"
] | null | null | null | main.py | akshay-1612/TwitterBot | 3c3102688433f9dc0b0163c32adbacb29ebfbcce | [
"MIT"
] | null | null | null | main.py | akshay-1612/TwitterBot | 3c3102688433f9dc0b0163c32adbacb29ebfbcce | [
"MIT"
] | null | null | null | import tweepy
import time
api_key = '<api_key>'
api_key_secreat = '<api_key_secreat>'
access_token = '<access_token>'
access_token_secreat ='<access_token_secreat>'
auth = tweepy.OAuthHandler(api_key,api_key_secreat)
auth.set_access_token(access_token,access_token_secreat)
api = tweepy.API(auth,wait_on_rate_limit=T... | 20.775 | 77 | 0.690734 | import tweepy
import time
api_key = '<api_key>'
api_key_secreat = '<api_key_secreat>'
access_token = '<access_token>'
access_token_secreat ='<access_token_secreat>'
auth = tweepy.OAuthHandler(api_key,api_key_secreat)
auth.set_access_token(access_token,access_token_secreat)
api = tweepy.API(auth,wait_on_rate_limit=T... | true | true |
f77c54930bb347480809aed7f647bb0270778eaf | 962 | py | Python | samba/models.py | PolyLAN/azimut-gestion | 0b076570d7ceeef8cfd9c8e65fd0495aa16d3c8a | [
"MIT"
] | null | null | null | samba/models.py | PolyLAN/azimut-gestion | 0b076570d7ceeef8cfd9c8e65fd0495aa16d3c8a | [
"MIT"
] | null | null | null | samba/models.py | PolyLAN/azimut-gestion | 0b076570d7ceeef8cfd9c8e65fd0495aa16d3c8a | [
"MIT"
] | null | null | null | from django.db import models
from servers.models import Server
from django.conf import settings
import os
import hashlib
import string
class Share(models.Model):
"""A share"""
server = models.ForeignKey(Server)
name = models.CharField(max_length=255)
path = models.CharField(max_length=255, help_t... | 26.722222 | 174 | 0.674636 | from django.db import models
from servers.models import Server
from django.conf import settings
import os
import hashlib
import string
class Share(models.Model):
server = models.ForeignKey(Server)
name = models.CharField(max_length=255)
path = models.CharField(max_length=255, help_text='Relative path... | true | true |
f77c563b4af46453ee1ea33e3fcc30b9ed326635 | 408 | py | Python | processargs.py | mr/deluge-automator | 8edf3610d0f448eeaf0c4bcc1031ceec77b5f66b | [
"MIT"
] | null | null | null | processargs.py | mr/deluge-automator | 8edf3610d0f448eeaf0c4bcc1031ceec77b5f66b | [
"MIT"
] | null | null | null | processargs.py | mr/deluge-automator | 8edf3610d0f448eeaf0c4bcc1031ceec77b5f66b | [
"MIT"
] | null | null | null | #Copyright (c) 2013 Matthew Robinson
#
#See the file LICENSE for copying permission.
import string
def readConfig(config):
f = open(config, "r")
options = {}
for line in f:
if string.find(line, '#') != 0 or string.find(line, '\n') != 0:
equals = string.find(line, "=")
opt... | 20.4 | 71 | 0.578431 |
import string
def readConfig(config):
f = open(config, "r")
options = {}
for line in f:
if string.find(line, '#') != 0 or string.find(line, '\n') != 0:
equals = string.find(line, "=")
options[line[:equals]] = line[equals + 1:len(line) - 1]
f.close()
return optio... | true | true |
f77c578f9dc4a6191697d3a1cc516dc2119ebc90 | 3,068 | py | Python | server/athenian/api/models/web/jira_filter_with.py | athenianco/athenian-api | dd5556101a8c49703d6b0516e4268b9e8d8eda5b | [
"RSA-MD"
] | 9 | 2020-10-11T22:12:03.000Z | 2022-02-26T02:16:45.000Z | server/athenian/api/models/web/jira_filter_with.py | athenianco/athenian-api | dd5556101a8c49703d6b0516e4268b9e8d8eda5b | [
"RSA-MD"
] | 246 | 2019-12-05T06:37:30.000Z | 2022-03-29T10:00:07.000Z | server/athenian/api/models/web/jira_filter_with.py | athenianco/athenian-api | dd5556101a8c49703d6b0516e4268b9e8d8eda5b | [
"RSA-MD"
] | 5 | 2019-12-04T22:38:05.000Z | 2021-02-26T00:50:04.000Z | from typing import List, Optional
from athenian.api.models.web.base_model_ import Model
class JIRAFilterWith(Model):
"""Group of JIRA issue participant names split by role."""
openapi_types = {
"assignees": Optional[List[Optional[str]]],
"reporters": Optional[List[str]],
"commenters"... | 30.376238 | 71 | 0.631682 | from typing import List, Optional
from athenian.api.models.web.base_model_ import Model
class JIRAFilterWith(Model):
openapi_types = {
"assignees": Optional[List[Optional[str]]],
"reporters": Optional[List[str]],
"commenters": Optional[List[str]],
}
attribute_map = {
"ass... | true | true |
f77c580c2182162b789eca6a00011e0d293f6372 | 1,158 | py | Python | toast.py | jessiepullaro414/Toastifai | d2ad89fc4c4de3881eeaa3fa011cdedaeb37d58f | [
"MIT"
] | 3 | 2016-10-16T02:43:53.000Z | 2018-10-10T22:52:41.000Z | toast.py | jessiepullaro414/Toastifai | d2ad89fc4c4de3881eeaa3fa011cdedaeb37d58f | [
"MIT"
] | null | null | null | toast.py | jessiepullaro414/Toastifai | d2ad89fc4c4de3881eeaa3fa011cdedaeb37d58f | [
"MIT"
] | null | null | null | #this is a project made at hackriddle 2016
#it is a "smart" toaster using clarifai, simplecv, and twilio
#by: Jessie Pullaro, Frank Calas, Max Farrel and Kyle Spomer
from clarifai import rest
from clarifai.rest import ClarifaiApp
#pulls the api keys from keys.py
app = ClarifaiApp("nnDJHbfgjR6qFYT_zv9RVoMBmR9-vFn... | 32.166667 | 182 | 0.761658 |
from clarifai import rest
from clarifai.rest import ClarifaiApp
app = ClarifaiApp("nnDJHbfgjR6qFYT_zv9RVoMBmR9-vFnvWFMHfm0F", "JqEgorhvy0DGV8PYHwhDg24f3N4yGiRi1HQBS46a")
'''
# import 80 images to train what toast is
for it in range(10,69):
app.inputs.create_image_from_filename("/home/jessie/Projects/hackath... | false | true |
f77c5843c2512a5b84565806abad7ee52e9c8e48 | 2,994 | py | Python | sktime/annotation/adapters/_pyod.py | biologioholic/sktime | 9d0391a04b11d22bd783b452f01aa5b4529b41a2 | [
"BSD-3-Clause"
] | null | null | null | sktime/annotation/adapters/_pyod.py | biologioholic/sktime | 9d0391a04b11d22bd783b452f01aa5b4529b41a2 | [
"BSD-3-Clause"
] | null | null | null | sktime/annotation/adapters/_pyod.py | biologioholic/sktime | 9d0391a04b11d22bd783b452f01aa5b4529b41a2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements outlier detection from pyOD."""
import numpy as np
from sklearn.base import clone
from sktime.annotation.base._base import BaseSeriesAnnotator
__author__ = ["mloning", "satya-pattna... | 29.352941 | 87 | 0.593186 |
import numpy as np
from sklearn.base import clone
from sktime.annotation.base._base import BaseSeriesAnnotator
__author__ = ["mloning", "satya-pattnaik", "fkiraly"]
import pandas as pd
class PyODAnnotator(BaseSeriesAnnotator):
def __init__(self, estimator, fmt="dense", labels="indicator"):
self.estim... | true | true |
f77c5848f39ff21a52980bb82066248d17e47e46 | 697 | py | Python | py/obsolete/encode_name.py | acorg/acmacs-py | e0bf6ff7ecfe7332980d15b50f9b6dd6f6f78de1 | [
"MIT"
] | null | null | null | py/obsolete/encode_name.py | acorg/acmacs-py | e0bf6ff7ecfe7332980d15b50f9b6dd6f6f78de1 | [
"MIT"
] | null | null | null | py/obsolete/encode_name.py | acorg/acmacs-py | e0bf6ff7ecfe7332980d15b50f9b6dd6f6f78de1 | [
"MIT"
] | null | null | null | # -*- Python -*-
# license
# license.
# ======================================================================
import logging; module_logger = logging.getLogger(__name__)
# ----------------------------------------------------------------------
def encode(name):
for char in "% :()!*';@&=+$,?#[]": # the samae as i... | 29.041667 | 77 | 0.350072 |
import logging; module_logger = logging.getLogger(__name__)
def encode(name):
for char in "% :()!*';@&=+$,?#[]": # the samae as in ../cc/name-encode.hh
name = name.replace(char, '%{:02X}'.format(ord(char)))
return name
# ----------------------------------------------------------------------
def dec... | true | true |
f77c58a1a52e48a2ea0ef71d0fa05347b368414c | 2,892 | py | Python | jive/utils.py | thomaskeefe/py_jive | 81f741afe2ef5f3d3dd006b7619690d6cb5ae09c | [
"MIT"
] | 13 | 2017-07-19T20:01:21.000Z | 2021-03-19T06:50:08.000Z | jive/utils.py | thomaskeefe/py_jive | 81f741afe2ef5f3d3dd006b7619690d6cb5ae09c | [
"MIT"
] | 7 | 2017-07-17T19:18:47.000Z | 2022-01-14T21:02:41.000Z | jive/utils.py | thomaskeefe/py_jive | 81f741afe2ef5f3d3dd006b7619690d6cb5ae09c | [
"MIT"
] | 7 | 2019-06-14T09:24:00.000Z | 2022-03-15T04:39:49.000Z | import numpy as np
from scipy.sparse import issparse
from scipy.sparse.linalg import svds
from scipy.linalg import svd as full_svd
from jive.lazymatpy.interface import LinearOperator
from jive.lazymatpy.convert2scipy import convert2scipy
def svd_wrapper(X, rank=None):
"""
Computes the (possibly partial) SVD ... | 23.322581 | 75 | 0.600277 | import numpy as np
from scipy.sparse import issparse
from scipy.sparse.linalg import svds
from scipy.linalg import svd as full_svd
from jive.lazymatpy.interface import LinearOperator
from jive.lazymatpy.convert2scipy import convert2scipy
def svd_wrapper(X, rank=None):
full = False
if rank is None or rank == ... | true | true |
f77c597364ed6dff5a4a988be9f5e03821d264ca | 2,165 | py | Python | nosetimer/plugin.py | django-stars/nose-timer | c1b56a6f5215a176f513286e874f355b85424e99 | [
"MIT"
] | null | null | null | nosetimer/plugin.py | django-stars/nose-timer | c1b56a6f5215a176f513286e874f355b85424e99 | [
"MIT"
] | null | null | null | nosetimer/plugin.py | django-stars/nose-timer | c1b56a6f5215a176f513286e874f355b85424e99 | [
"MIT"
] | 1 | 2020-02-27T05:19:23.000Z | 2020-02-27T05:19:23.000Z | import operator
import os
from time import time
from nose.plugins.base import Plugin
class TimerPlugin(Plugin):
"""This plugin provides test timings
"""
name = 'timer'
score = 1
def _timeTaken(self):
if hasattr(self, '_timer'):
taken = time() - self._timer
else:
... | 30.492958 | 78 | 0.576905 | import operator
import os
from time import time
from nose.plugins.base import Plugin
class TimerPlugin(Plugin):
name = 'timer'
score = 1
def _timeTaken(self):
if hasattr(self, '_timer'):
taken = time() - self._timer
else:
taken... | true | true |
f77c5a59d18cb8279d50c9ec5b104123b6d87884 | 558 | py | Python | setup.py | goldhand/cookiecutter-project | b7c9189ca0ccda43d34ec1573b14138e979d6e78 | [
"BSD-3-Clause"
] | 1 | 2017-03-20T05:54:30.000Z | 2017-03-20T05:54:30.000Z | setup.py | goldhand/cookiecutter-project | b7c9189ca0ccda43d34ec1573b14138e979d6e78 | [
"BSD-3-Clause"
] | null | null | null | setup.py | goldhand/cookiecutter-project | b7c9189ca0ccda43d34ec1573b14138e979d6e78 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import cookiecutter-project
version = cookiecutter-project.__version__
setup(
name='cookiecutter-project',
version=version,
author='',
au... | 18.6 | 47 | 0.666667 |
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import cookiecutter-project
version = cookiecutter-project.__version__
setup(
name='cookiecutter-project',
version=version,
author='',
author_email='will@django.nu',
packages=[
... | false | true |
f77c5a8f1c1147e66892324ce159a017af99d4db | 1,660 | py | Python | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_project_async.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_project_async.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | 10 | 2021-11-18T10:47:48.000Z | 2022-03-07T15:48:54.000Z | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_project_async.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | 1 | 2022-01-29T08:15:02.000Z | 2022-01-29T08:15:02.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... | 32.54902 | 85 | 0.762651 |
from google.cloud import vmmigration_v1
async def sample_create_target_project():
client = vmmigration_v1.VmMigrationAsyncClient()
request = vmmigration_v1.CreateTargetProjectRequest(
parent="parent_value",
target_project_id="target_project_id_value",
)
operation = cli... | true | true |
f77c5b5e0ce5f77934630f11560cd5d58a3ffd74 | 929 | py | Python | opencity/fetcher/xls_fetcher.py | birkealine/konstanz-open-data-api | 5e7267020dd7db7592e1738d23f83990f9a92424 | [
"MIT"
] | 3 | 2021-06-14T09:02:25.000Z | 2021-07-19T18:14:12.000Z | opencity/fetcher/xls_fetcher.py | birkealine/konstanz-open-data-api | 5e7267020dd7db7592e1738d23f83990f9a92424 | [
"MIT"
] | 19 | 2021-07-01T15:35:19.000Z | 2022-03-10T08:46:40.000Z | opencity/fetcher/xls_fetcher.py | birkealine/konstanz-open-data-api | 5e7267020dd7db7592e1738d23f83990f9a92424 | [
"MIT"
] | 2 | 2021-07-28T19:21:33.000Z | 2022-03-06T07:56:24.000Z | import pandas as pd
import xlrd
class xlsFetcher(object):
"""
xlsFetcher: fetches xls files
"""
def __init__(self):
self.flag_final = True
def parse_xls(self, url):
"""
parses data from url to dataframe
PARAMETERS:
-----------
url: String
... | 19.765957 | 52 | 0.497309 | import pandas as pd
import xlrd
class xlsFetcher(object):
def __init__(self):
self.flag_final = True
def parse_xls(self, url):
try:
df = pd.read_excel(url, sheet_name=None)
return df
except:
self.flag_final = False
return pd.DataFrame()
... | true | true |
f77c5b75f568591b2a2e1c42881da24df9c3ad05 | 1,883 | py | Python | lte/gateway/python/magma/mobilityd/ip_allocator_base.py | ekfuhrmann/magma-old | 8b81337d250611b799a353f0ed6cff6aaea8674e | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/mobilityd/ip_allocator_base.py | ekfuhrmann/magma-old | 8b81337d250611b799a353f0ed6cff6aaea8674e | [
"BSD-3-Clause"
] | 1 | 2021-03-31T19:53:50.000Z | 2021-03-31T19:53:50.000Z | lte/gateway/python/magma/mobilityd/ip_allocator_base.py | ekfuhrmann/magma-old | 8b81337d250611b799a353f0ed6cff6aaea8674e | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2016-present, Facebook, Inc.
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. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from __future__ import abs... | 22.963415 | 77 | 0.695698 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from abc import ABC, abstractmethod
from ipaddress import ip_address, ip_network
from typing import List
from enum import Enum
from magma.mobilityd.ip_descriptor import IPDesc
DEFAULT_IP_RECYCLE_INTERVAL = 15
class IPAllocat... | true | true |
f77c5b9e04f50022ae4ca1671f6e313b04d47091 | 301 | py | Python | 06.EntryFeild/helpers.py | sarincr/Python-App-Development-using-Kivy | bc5d40efa29ddf59042a85e0e908657590149d6f | [
"MIT"
] | 1 | 2021-11-10T11:31:23.000Z | 2021-11-10T11:31:23.000Z | 06.EntryFeild/helpers.py | sarincr/Python-App-Development-using-Kivy | bc5d40efa29ddf59042a85e0e908657590149d6f | [
"MIT"
] | null | null | null | 06.EntryFeild/helpers.py | sarincr/Python-App-Development-using-Kivy | bc5d40efa29ddf59042a85e0e908657590149d6f | [
"MIT"
] | null | null | null |
HelpX = """
MDTextField:
hint_text: "Enter username"
helper_text: "or click on forgot username"
helper_text_mode: "on_focus"
icon_right: "android"
icon_right_color: app.theme_cls.primary_color
pos_hint:{'center_x': 0.5, 'center_y': 0.5}
size_hint_x:None
width:300
""" | 25.083333 | 49 | 0.681063 |
HelpX = """
MDTextField:
hint_text: "Enter username"
helper_text: "or click on forgot username"
helper_text_mode: "on_focus"
icon_right: "android"
icon_right_color: app.theme_cls.primary_color
pos_hint:{'center_x': 0.5, 'center_y': 0.5}
size_hint_x:None
width:300
""" | true | true |
f77c5c13579042d0013eacd230439d8e45f2dd3a | 2,327 | py | Python | test/readme/ensure_type_size.py | claybrooks/dwarfgen | 921d195b4f0aa375103839418eb72b143166b4c0 | [
"Unlicense"
] | null | null | null | test/readme/ensure_type_size.py | claybrooks/dwarfgen | 921d195b4f0aa375103839418eb72b143166b4c0 | [
"Unlicense"
] | null | null | null | test/readme/ensure_type_size.py | claybrooks/dwarfgen | 921d195b4f0aa375103839418eb72b143166b4c0 | [
"Unlicense"
] | null | null | null | import json
# with open('/path/to/jidl_1.json', 'r') as f:
# jidl_1 = json.load(f)
jidl_1 = {
"namespaces": {},
"enumerations": {},
"unions": {},
"structures": {
"Structure1": {
"byteSize": 8,
"members": {
"a": {
"byteOffset": 0,
... | 27.376471 | 97 | 0.374731 | import json
jidl_1 = {
"namespaces": {},
"enumerations": {},
"unions": {},
"structures": {
"Structure1": {
"byteSize": 8,
"members": {
"a": {
"byteOffset": 0,
"byteSize": 1,
"type": "char",
... | true | true |
f77c5e8be033920858b298e14ee1ca689335af60 | 2,015 | py | Python | redditscrape.py | aerovolts/python-scripts | ea3cf1753cbcb3b382858fbd127cf895fc229c1a | [
"MIT"
] | null | null | null | redditscrape.py | aerovolts/python-scripts | ea3cf1753cbcb3b382858fbd127cf895fc229c1a | [
"MIT"
] | 2 | 2016-01-17T22:16:43.000Z | 2016-02-25T13:26:25.000Z | redditscrape.py | aerovolts/python-scripts | ea3cf1753cbcb3b382858fbd127cf895fc229c1a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Scrapes the list of provided subreddits for images and downloads them to a local directory"""
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "4.0"
import json
import os
import requests
import urllib.error
import wget
# Configur... | 30.530303 | 149 | 0.586104 |
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "4.0"
import json
import os
import requests
import urllib.error
import wget
root_path = 'scrape' sub_list = [
'vexillology',
'mapporn',
'pics',
'wallpapers'
... | true | true |
f77c611c103894d54ca4b8c6be82f708ce95f38c | 2,468 | py | Python | test.py | MageStudio/ammo.js | f2682d79e3a43f7c31b9eb019a1eb8ac994c7342 | [
"Zlib"
] | null | null | null | test.py | MageStudio/ammo.js | f2682d79e3a43f7c31b9eb019a1eb8ac994c7342 | [
"Zlib"
] | null | null | null | test.py | MageStudio/ammo.js | f2682d79e3a43f7c31b9eb019a1eb8ac994c7342 | [
"Zlib"
] | null | null | null | import os, sys, re, json
from subprocess import Popen, PIPE, STDOUT
# By default use builds/ammo.js. Or the commandline argument can override that.
build = os.path.join('builds', 'ammo.js')
if len(sys.argv) > 1:
build = sys.argv[1]
print 'Using build:', build
build = os.path.basename(build)
exec(open(os.path.expand... | 25.443299 | 130 | 0.607374 | import os, sys, re, json
from subprocess import Popen, PIPE, STDOUT
build = os.path.join('builds', 'ammo.js')
if len(sys.argv) > 1:
build = sys.argv[1]
print 'Using build:', build
build = os.path.basename(build)
exec(open(os.path.expanduser('~/.emscripten'), 'r').read())
try:
JS_ENGINE = SPIDERMONKEY_ENGINE
exce... | false | true |
f77c61a6cb6846f43cc00a329c313d6fd544357f | 26,966 | py | Python | rasa/core/test.py | jeanveau/rasa_core | 953d54f057c19ef10b9c71cb8fcfc2d13dbefc65 | [
"Apache-2.0"
] | 2,433 | 2017-10-04T13:08:05.000Z | 2022-03-13T14:59:26.000Z | rasa/core/test.py | jeanveau/rasa_core | 953d54f057c19ef10b9c71cb8fcfc2d13dbefc65 | [
"Apache-2.0"
] | 1,684 | 2017-10-04T13:04:44.000Z | 2019-05-31T20:48:49.000Z | rasa/core/test.py | jeanveau/rasa_core | 953d54f057c19ef10b9c71cb8fcfc2d13dbefc65 | [
"Apache-2.0"
] | 1,229 | 2017-10-04T20:23:59.000Z | 2022-03-11T02:49:13.000Z | import argparse
import asyncio
import json
import logging
import os
import typing
import warnings
from collections import defaultdict, namedtuple
from typing import Any, Dict, List, Optional, Text, Tuple
from rasa.core.events import (
ActionExecuted, UserUttered,
ActionExecutionRejected)
if typing.TYPE_CHECKI... | 38.522857 | 80 | 0.596455 | import argparse
import asyncio
import json
import logging
import os
import typing
import warnings
from collections import defaultdict, namedtuple
from typing import Any, Dict, List, Optional, Text, Tuple
from rasa.core.events import (
ActionExecuted, UserUttered,
ActionExecutionRejected)
if typing.TYPE_CHECKI... | true | true |
f77c629995c614683e97b02bbad0e3707a7a892a | 1,048 | py | Python | test_autolens/unit/test_config.py | rakaar/PyAutoLens | bc140c5d196c426092c1178b8abfa492c6fab859 | [
"MIT"
] | null | null | null | test_autolens/unit/test_config.py | rakaar/PyAutoLens | bc140c5d196c426092c1178b8abfa492c6fab859 | [
"MIT"
] | null | null | null | test_autolens/unit/test_config.py | rakaar/PyAutoLens | bc140c5d196c426092c1178b8abfa492c6fab859 | [
"MIT"
] | null | null | null | from os import path
import pytest
import autofit as af
import autolens as al
directory = path.dirname(path.realpath(__file__))
class MockClass:
pass
@pytest.fixture(name="label_config")
def make_label_config(config):
return config["notation"]["label"]
class TestLabel:
def test_b... | 27.578947 | 85 | 0.666985 | from os import path
import pytest
import autofit as af
import autolens as al
directory = path.dirname(path.realpath(__file__))
class MockClass:
pass
@pytest.fixture(name="label_config")
def make_label_config(config):
return config["notation"]["label"]
class TestLabel:
def test_b... | true | true |
f77c62aec7b55a84a289315ed4a85842a700f967 | 2,552 | py | Python | docs/source/conf.py | vishalbelsare/geotorch | ba38d406c245d609fee4b4dac3f6427bf6d73a8e | [
"MIT"
] | 422 | 2020-07-13T20:07:56.000Z | 2022-03-31T13:47:35.000Z | docs/source/conf.py | vishalbelsare/geotorch | ba38d406c245d609fee4b4dac3f6427bf6d73a8e | [
"MIT"
] | 26 | 2020-09-09T17:46:33.000Z | 2022-03-09T15:45:34.000Z | docs/source/conf.py | vishalbelsare/geotorch | ba38d406c245d609fee4b4dac3f6427bf6d73a8e | [
"MIT"
] | 23 | 2020-07-20T12:17:42.000Z | 2022-03-14T00:05:32.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 29.333333 | 79 | 0.679859 |
import os
import sys
import geotorch
sys.path.insert(0, os.path.abspath("../../geotorch/"))
project = "geotorch"
copyright = "2020-, Mario Lezcano-Casado"
author = "Mario Lezcano-Casado"
version = geotorch.__version__
release = geotorch.__version__
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.cov... | true | true |
f77c62bdd691b9f048f5e5559fcaadde41da03e4 | 2,013 | py | Python | src/sentry/api/endpoints/organization_events_stats.py | xiaotian45123/sentry | 93428feeaa495cc36c5dcab90f3bb2bb967dd311 | [
"BSD-3-Clause"
] | 1 | 2020-02-27T02:46:25.000Z | 2020-02-27T02:46:25.000Z | src/sentry/api/endpoints/organization_events_stats.py | xiaotian45123/sentry | 93428feeaa495cc36c5dcab90f3bb2bb967dd311 | [
"BSD-3-Clause"
] | 1 | 2020-11-05T14:54:44.000Z | 2020-11-19T21:54:19.000Z | src/sentry/api/endpoints/organization_events_stats.py | xiaotian45123/sentry | 93428feeaa495cc36c5dcab90f3bb2bb967dd311 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | from __future__ import absolute_import
from datetime import timedelta
from rest_framework.response import Response
from sentry.api.bases import OrganizationEventsEndpointBase, OrganizationEventsError, NoProjects
from sentry.api.serializers.snuba import SnubaTSResultSerializer
from sentry.utils.dates import parse_stat... | 33.55 | 96 | 0.618977 | from __future__ import absolute_import
from datetime import timedelta
from rest_framework.response import Response
from sentry.api.bases import OrganizationEventsEndpointBase, OrganizationEventsError, NoProjects
from sentry.api.serializers.snuba import SnubaTSResultSerializer
from sentry.utils.dates import parse_stat... | true | true |
f77c63c7363a8ddbfdfc0658fc5da5b56196035d | 871 | py | Python | setup.py | rjalfa/Python-Rummy | bbaadd294bd409e4860be0f108a6751e06f7e275 | [
"MIT"
] | null | null | null | setup.py | rjalfa/Python-Rummy | bbaadd294bd409e4860be0f108a6751e06f7e275 | [
"MIT"
] | null | null | null | setup.py | rjalfa/Python-Rummy | bbaadd294bd409e4860be0f108a6751e06f7e275 | [
"MIT"
] | null | null | null | # coding=utf-8
from setuptools import setup, find_packages
readme = open('README.md', 'r')
README_TEXT = readme.read()
readme.close()
setup(
name='rummy',
version='1.1.7',
url='https://github.com/sarcoma/Python-Rummy',
license='MIT',
author='sarcoma',
author_email='sean@orderandchaoscreative.c... | 29.033333 | 70 | 0.673938 | from setuptools import setup, find_packages
readme = open('README.md', 'r')
README_TEXT = readme.read()
readme.close()
setup(
name='rummy',
version='1.1.7',
url='https://github.com/sarcoma/Python-Rummy',
license='MIT',
author='sarcoma',
author_email='sean@orderandchaoscreative.com',
descri... | true | true |
f77c659b1b014c22b137e175a5bfa0b5ce864122 | 3,262 | py | Python | allennlp/modules/similarity_functions/linear.py | tianjianjiang/allennlp | 0839f5c263911ec5ff04a2ebe575493c7e0436ef | [
"Apache-2.0"
] | 2 | 2019-12-03T20:04:56.000Z | 2021-03-29T10:38:06.000Z | allennlp/modules/similarity_functions/linear.py | dasguptar/allennlp | 35b285585e0677b1025eac1c19b5eefe7e2a70db | [
"Apache-2.0"
] | null | null | null | allennlp/modules/similarity_functions/linear.py | dasguptar/allennlp | 35b285585e0677b1025eac1c19b5eefe7e2a70db | [
"Apache-2.0"
] | 2 | 2019-12-04T16:55:13.000Z | 2019-12-06T18:47:15.000Z | import math
from overrides import overrides
import torch
from torch.nn.parameter import Parameter
from allennlp.modules.similarity_functions.similarity_function import SimilarityFunction
from allennlp.nn import Activation, util
@SimilarityFunction.register("linear")
class LinearSimilarity(SimilarityFunction):
"... | 45.943662 | 99 | 0.675353 | import math
from overrides import overrides
import torch
from torch.nn.parameter import Parameter
from allennlp.modules.similarity_functions.similarity_function import SimilarityFunction
from allennlp.nn import Activation, util
@SimilarityFunction.register("linear")
class LinearSimilarity(SimilarityFunction):
... | true | true |
f77c65d98525f48df67a4060bd8f09e1f82fdadf | 5,389 | py | Python | guillotina_cms/api/types.py | alteroo/guillotina_cms | a8ea0efd2ad4f4ab9fab484fe55f41abd37cdac8 | [
"BSD-2-Clause"
] | 5 | 2018-11-11T07:19:06.000Z | 2020-01-18T11:04:15.000Z | guillotina_cms/api/types.py | alteroo/guillotina_cms | a8ea0efd2ad4f4ab9fab484fe55f41abd37cdac8 | [
"BSD-2-Clause"
] | 4 | 2018-09-20T14:44:17.000Z | 2018-10-23T12:16:45.000Z | guillotina_cms/api/types.py | alteroo/guillotina_cms | a8ea0efd2ad4f4ab9fab484fe55f41abd37cdac8 | [
"BSD-2-Clause"
] | 2 | 2019-06-14T10:42:22.000Z | 2020-05-09T13:09:09.000Z | # -*- coding: utf-8 -*-
from guillotina import configure
from guillotina._cache import FACTORY_CACHE
from guillotina._cache import PERMISSIONS_CACHE
from guillotina.api.service import Service
from guillotina.component import getMultiAdapter
from guillotina.component import query_utility
from guillotina.component import... | 33.893082 | 101 | 0.617554 | from guillotina import configure
from guillotina._cache import FACTORY_CACHE
from guillotina._cache import PERMISSIONS_CACHE
from guillotina.api.service import Service
from guillotina.component import getMultiAdapter
from guillotina.component import query_utility
from guillotina.component import queryUtility
from guill... | true | true |
f77c661d2a0cb944859638124066197352d7351d | 14,676 | py | Python | palantiri/ClassificationPlotHandlers.py | wolfenfeld/Palantiri | 719d78b891bf8ac8e90f8eab1d55c57b3b7bbb70 | [
"BSD-3-Clause"
] | null | null | null | palantiri/ClassificationPlotHandlers.py | wolfenfeld/Palantiri | 719d78b891bf8ac8e90f8eab1d55c57b3b7bbb70 | [
"BSD-3-Clause"
] | 2 | 2018-11-26T20:16:50.000Z | 2018-11-26T20:21:10.000Z | palantiri/ClassificationPlotHandlers.py | wolfenfeld/Palantiri | 719d78b891bf8ac8e90f8eab1d55c57b3b7bbb70 | [
"BSD-3-Clause"
] | null | null | null |
import numpy as np
from sklearn.metrics import confusion_matrix, roc_curve, auc
import plotly.graph_objs as go
import plotly.figure_factory as ff
from plotly.offline import iplot
from palantiri.BasePlotHandlers import PlotHandler
class ClassifierPlotHandler(PlotHandler):
""" Handles all the plots related of t... | 37.248731 | 120 | 0.574271 |
import numpy as np
from sklearn.metrics import confusion_matrix, roc_curve, auc
import plotly.graph_objs as go
import plotly.figure_factory as ff
from plotly.offline import iplot
from palantiri.BasePlotHandlers import PlotHandler
class ClassifierPlotHandler(PlotHandler):
def __init__(self, dataset, trained_c... | true | true |
f77c67de84e11f54d8c68a1ebe34d159d47d7337 | 18,254 | py | Python | ldaptor/test/test_delta.py | arossert/ldaptor | 6ed55a380f05dd47aa0d03ead0ff214e26399df0 | [
"MIT"
] | null | null | null | ldaptor/test/test_delta.py | arossert/ldaptor | 6ed55a380f05dd47aa0d03ead0ff214e26399df0 | [
"MIT"
] | null | null | null | ldaptor/test/test_delta.py | arossert/ldaptor | 6ed55a380f05dd47aa0d03ead0ff214e26399df0 | [
"MIT"
] | null | null | null | """
Test cases for ldaptor.protocols.ldap.delta
"""
from twisted.trial import unittest
from ldaptor import delta, entry, attributeset, inmemory
from ldaptor.protocols.ldap import ldapsyntax, distinguishedname, ldaperrors
class TestModifications(unittest.TestCase):
def setUp(self):
self.foo = ldapsyntax.LD... | 29.113238 | 95 | 0.561904 |
from twisted.trial import unittest
from ldaptor import delta, entry, attributeset, inmemory
from ldaptor.protocols.ldap import ldapsyntax, distinguishedname, ldaperrors
class TestModifications(unittest.TestCase):
def setUp(self):
self.foo = ldapsyntax.LDAPEntry(
None,
dn='cn=foo,dc... | true | true |
f77c689539a17ac4b827c1b7d6e464628e793f43 | 3,691 | py | Python | python/test/test_color_map.py | SBCV/Open3D | 12ad57b9b2bb3dd58d3cded584848939bedb92f3 | [
"MIT"
] | 1 | 2021-04-02T02:23:56.000Z | 2021-04-02T02:23:56.000Z | python/test/test_color_map.py | EricCousineau-TRI/Open3D | d335451e2b56897c3c8e37f68e1d41eee9faf5e9 | [
"MIT"
] | 1 | 2021-12-31T05:38:58.000Z | 2021-12-31T05:38:58.000Z | python/test/test_color_map.py | EricCousineau-TRI/Open3D | d335451e2b56897c3c8e37f68e1d41eee9faf5e9 | [
"MIT"
] | 2 | 2019-09-30T06:32:15.000Z | 2021-07-25T11:52:04.000Z | import open3d as o3d
import numpy as np
import re
import os
import sys
from open3d_test import download_fountain_dataset
def get_file_list(path, extension=None):
def sorted_alphanum(file_list_ordered):
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [
... | 40.119565 | 82 | 0.636955 | import open3d as o3d
import numpy as np
import re
import os
import sys
from open3d_test import download_fountain_dataset
def get_file_list(path, extension=None):
def sorted_alphanum(file_list_ordered):
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [
... | true | true |
f77c68ccf0ca2ae319281d63e95a9528652edf21 | 141 | py | Python | app/urls.py | rzetelskik/ad_hoc | c46d55bd029cbcf5ad40f1fd9f9f40a0f4a60851 | [
"MIT"
] | null | null | null | app/urls.py | rzetelskik/ad_hoc | c46d55bd029cbcf5ad40f1fd9f9f40a0f4a60851 | [
"MIT"
] | null | null | null | app/urls.py | rzetelskik/ad_hoc | c46d55bd029cbcf5ad40f1fd9f9f40a0f4a60851 | [
"MIT"
] | null | null | null | from .views import FrontendAppView
from django.urls import path
urlpatterns = [
path('', FrontendAppView.as_view(), name='frontend'),
]
| 20.142857 | 57 | 0.730496 | from .views import FrontendAppView
from django.urls import path
urlpatterns = [
path('', FrontendAppView.as_view(), name='frontend'),
]
| true | true |
f77c699c0cad28049b25cea8de2b4a3880e31a0a | 1,928 | py | Python | data_preparation.py | mvoicer/cbic-2021-learning-preferences | 9ddd5449d5cae5a8f1cdafc6fa34b13ee83076b2 | [
"MIT"
] | null | null | null | data_preparation.py | mvoicer/cbic-2021-learning-preferences | 9ddd5449d5cae5a8f1cdafc6fa34b13ee83076b2 | [
"MIT"
] | null | null | null | data_preparation.py | mvoicer/cbic-2021-learning-preferences | 9ddd5449d5cae5a8f1cdafc6fa34b13ee83076b2 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
def create_subsample(df_var, df_pref, nobj, index):
"""
Create sub-dataframes with the features (alternatives) and target (value in the objective space).
:param df_var:
:param df_pref:
:param nobj:
:param index:
:return:
"""
# C... | 35.054545 | 123 | 0.627075 | import pandas as pd
import numpy as np
def create_subsample(df_var, df_pref, nobj, index):
sub_df = pd.DataFrame(np.zeros((len(index), df_var.shape[1]*2 + nobj)))
cont = 0
for i in index:
for j in index:
sub_df.loc[cont] = pd.concat([df_var.loc[i]... | true | true |
f77c69ab89e9dc79efe625446864418b0b5a7207 | 3,064 | py | Python | algoRandom.py | Li-Pro/Short-Codes | cb9acb8449df587f7b04335ff24f75e5b1d9a9ca | [
"MIT"
] | 3 | 2020-05-15T09:00:24.000Z | 2020-05-15T14:38:49.000Z | algoRandom.py | Li-Pro/Short-Codes | cb9acb8449df587f7b04335ff24f75e5b1d9a9ca | [
"MIT"
] | null | null | null | algoRandom.py | Li-Pro/Short-Codes | cb9acb8449df587f7b04335ff24f75e5b1d9a9ca | [
"MIT"
] | null | null | null | """
Implementation of some basic randomized algorithms.
NOT including random generator algorithm (yet(?)).
"""
#----------- Psuedo Random Generator ------------
# This part is just for testing.
import random as _librandom
def setSeed(seed=None):
"""
Set the random seed.
Quote from <random>:
None or no argumen... | 16.743169 | 68 | 0.607376 |
import random as _librandom
def setSeed(seed=None):
_librandom.seed(seed)
return
def getRandBits(k):
return _librandom.getrandbits(k)
import math
_BPUF = 52
_FSTP = 2**(-_BPUF)
def rand(N):
k = N.bit_length()
num = getRandBits(k)
while not num < N:
num = getRandBits(k)
return num
def randRange(a, ... | true | true |
f77c6a42a27243cc002e3be05d71433b9694f506 | 53 | py | Python | models/__init__.py | smallflyingpig/DAVEnet-pytorch | d198de53c4c9c540db86299976bc349c6bb99447 | [
"BSD-3-Clause"
] | 62 | 2018-09-11T21:06:30.000Z | 2022-03-12T22:08:42.000Z | models/__init__.py | smallflyingpig/DAVEnet-pytorch | d198de53c4c9c540db86299976bc349c6bb99447 | [
"BSD-3-Clause"
] | 3 | 2019-04-10T02:39:07.000Z | 2020-09-14T01:54:00.000Z | models/__init__.py | smallflyingpig/DAVEnet-pytorch | d198de53c4c9c540db86299976bc349c6bb99447 | [
"BSD-3-Clause"
] | 22 | 2018-09-13T10:39:30.000Z | 2022-02-19T12:58:31.000Z | from .AudioModels import *
from .ImageModels import * | 26.5 | 26 | 0.792453 | from .AudioModels import *
from .ImageModels import * | true | true |
f77c6ac01f238da452639449f138ea2f39375278 | 3,583 | py | Python | .Config/FslBuildGen/Xml/XmlGenFileRequirement.py | alexvonduar/gtec-demo-framework | 6f8a7e429d0e15242ba64eb4cb41bfc2dd7dc749 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | .Config/FslBuildGen/Xml/XmlGenFileRequirement.py | alexvonduar/gtec-demo-framework | 6f8a7e429d0e15242ba64eb4cb41bfc2dd7dc749 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | .Config/FslBuildGen/Xml/XmlGenFileRequirement.py | alexvonduar/gtec-demo-framework | 6f8a7e429d0e15242ba64eb4cb41bfc2dd7dc749 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#****************************************************************************************************************************************************
# Copyright (c) 2014 Freescale Semiconductor, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
#... | 57.790323 | 149 | 0.702205 |
from typing import List
import xml.etree.ElementTree as ET
from FslBuildGen import Util
from FslBuildGen.Log import Log
from FslBuildGen.DataTypes import PackageRequirementTypeString
from FslBuildGen.Xml.XmlBase import XmlBase
from FslBuildGen.Xml.Exceptions import XmlRequirementNameException
from FslBuildGen.Xml.Exc... | true | true |
f77c6afe5c929d367048b8ac8a5a1576cd023664 | 1,344 | py | Python | device_e2e/aio/test_c2d.py | anthonyvercolano/azure-iot-sdk-python | f54a3712c288406b0dfcaa2ffa02a13b1c9b6f32 | [
"MIT"
] | null | null | null | device_e2e/aio/test_c2d.py | anthonyvercolano/azure-iot-sdk-python | f54a3712c288406b0dfcaa2ffa02a13b1c9b6f32 | [
"MIT"
] | null | null | null | device_e2e/aio/test_c2d.py | anthonyvercolano/azure-iot-sdk-python | f54a3712c288406b0dfcaa2ffa02a13b1c9b6f32 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
import asyncio
import pytest
import logging
import json
from utils import get_random_dict
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)... | 32.780488 | 96 | 0.730655 | import asyncio
import pytest
import logging
import json
from utils import get_random_dict
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)
pytestmark = pytest.mark.asyncio
@pytest.mark.describe("Device Client C2d")
class TestSendMessage(object):
@pytest.mark.it("Can receive C2D")
as... | true | true |
f77c6c35c65c0538f5e4a7cfd9cdbb795f6d916e | 3,084 | py | Python | models/__init__.py | Mukosame/AODA | c187e5ff0a6502a9166da37a213ee259afa60903 | [
"BSD-3-Clause"
] | 43 | 2021-04-19T07:04:19.000Z | 2022-03-11T05:28:39.000Z | models/__init__.py | Mukosame/AODA | c187e5ff0a6502a9166da37a213ee259afa60903 | [
"BSD-3-Clause"
] | 4 | 2021-08-25T14:21:21.000Z | 2022-02-09T08:58:47.000Z | models/__init__.py | Mukosame/AODA | c187e5ff0a6502a9166da37a213ee259afa60903 | [
"BSD-3-Clause"
] | 4 | 2021-05-10T08:27:22.000Z | 2022-01-12T07:40:25.000Z | """This package contains modules related to objective functions, optimizations, and network architectures.
To add a custom model class called 'dummy', you need to add a file called 'dummy_model.py' and define a subclass DummyModel inherited from BaseModel.
You need to implement the following five functions:
-- <__... | 44.695652 | 249 | 0.697471 |
import importlib
from models.base_model import BaseModel
def find_model_using_name(model_name):
model_filename = "models." + model_name + "_model"
modellib = importlib.import_module(model_filename)
model = None
target_model_name = model_name.replace('_', '') + 'model'
for name, cls in modellib.__... | true | true |
f77c6d43243fbc98f28944b015c68d85160c8168 | 29,023 | py | Python | tests/integration_tests/lightgbm_tuner_tests/test_optimize.py | HarshTrivedi/optuna | 9ea2ebd690127ca7af6f3df7b53807c648733a95 | [
"MIT"
] | null | null | null | tests/integration_tests/lightgbm_tuner_tests/test_optimize.py | HarshTrivedi/optuna | 9ea2ebd690127ca7af6f3df7b53807c648733a95 | [
"MIT"
] | null | null | null | tests/integration_tests/lightgbm_tuner_tests/test_optimize.py | HarshTrivedi/optuna | 9ea2ebd690127ca7af6f3df7b53807c648733a95 | [
"MIT"
] | null | null | null | import contextlib
from tempfile import TemporaryDirectory
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Optional
from unittest import mock
import numpy as np
import pytest
import optuna
from optuna.integration._lightgbm_tuner.optimize import _Ba... | 35.094317 | 99 | 0.60583 | import contextlib
from tempfile import TemporaryDirectory
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Optional
from unittest import mock
import numpy as np
import pytest
import optuna
from optuna.integration._lightgbm_tuner.optimize import _Ba... | true | true |
f77c6e5f5983d4652a019fdbe21898d48222f99f | 93 | py | Python | camphr/__init__.py | esakai/camphr | 124fa2cbcec7a984402bfd2e8cad1c85e668f074 | [
"Apache-2.0"
] | null | null | null | camphr/__init__.py | esakai/camphr | 124fa2cbcec7a984402bfd2e8cad1c85e668f074 | [
"Apache-2.0"
] | null | null | null | camphr/__init__.py | esakai/camphr | 124fa2cbcec7a984402bfd2e8cad1c85e668f074 | [
"Apache-2.0"
] | null | null | null | from .models import load
from .VERSION import __version__
__all__ = ["__version__", "load"]
| 18.6 | 33 | 0.752688 | from .models import load
from .VERSION import __version__
__all__ = ["__version__", "load"]
| true | true |
f77c6ea03f8984d2eeacb0aa4dc3dcbe598c2bfa | 2,629 | py | Python | zerver/management/commands/realm_domain.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/management/commands/realm_domain.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | null | null | null | zerver/management/commands/realm_domain.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 1 | 2022-01-15T08:36:09.000Z | 2022-01-15T08:36:09.000Z | import sys
from argparse import ArgumentParser
from typing import Any, Union
from django.core.exceptions import ValidationError
from django.core.management.base import CommandError
from django.db.utils import IntegrityError
from zerver.lib.domains import validate_domain
from zerver.lib.management import ZulipBaseComm... | 41.078125 | 100 | 0.614682 | import sys
from argparse import ArgumentParser
from typing import Any, Union
from django.core.exceptions import ValidationError
from django.core.management.base import CommandError
from django.db.utils import IntegrityError
from zerver.lib.domains import validate_domain
from zerver.lib.management import ZulipBaseComm... | true | true |
f77c6f6b010a596ad866018f532a491fe683dbe3 | 872 | py | Python | invana_bot/transformers/default.py | subhead/invana-bot | c60883986acd1baf279ccbe74dfe06435680fba9 | [
"MIT"
] | 23 | 2019-01-31T08:04:39.000Z | 2021-12-20T15:55:27.000Z | invana_bot/transformers/default.py | subhead/invana-bot | c60883986acd1baf279ccbe74dfe06435680fba9 | [
"MIT"
] | 12 | 2019-02-13T04:59:38.000Z | 2021-12-13T20:43:07.000Z | invana_bot/transformers/default.py | subhead/invana-bot | c60883986acd1baf279ccbe74dfe06435680fba9 | [
"MIT"
] | 5 | 2019-12-21T16:23:34.000Z | 2022-02-22T06:08:03.000Z | def default_transformer(results):
results_cleaned = results
return results_cleaned
class InvanaBotTranformerBase(object):
def __init__(self, cti_config=None,
transformer_name=None,
cit_id=None,
crawled_id=None,
job_id=None):
if ... | 30.068966 | 80 | 0.614679 | def default_transformer(results):
results_cleaned = results
return results_cleaned
class InvanaBotTranformerBase(object):
def __init__(self, cti_config=None,
transformer_name=None,
cit_id=None,
crawled_id=None,
job_id=None):
if ... | true | true |
f77c6fca333f48afb373b83286cd496dd39f08ef | 1,664 | py | Python | main/chroot-util-linux/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | main/chroot-util-linux/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | main/chroot-util-linux/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | pkgname = "chroot-util-linux"
_mver = "2.32"
version = f"{_mver}.1"
revision = 0
wrksrc = f"util-linux-{version}"
build_style = "gnu_configure"
configure_args = [
"--without-ncurses", "--without-ncursesw", "--without-udev",
"--without-systemd", "--disable-libuuid", "--disable-libblkid",
"--disable-libmount"... | 34.666667 | 79 | 0.670072 | pkgname = "chroot-util-linux"
_mver = "2.32"
version = f"{_mver}.1"
revision = 0
wrksrc = f"util-linux-{version}"
build_style = "gnu_configure"
configure_args = [
"--without-ncurses", "--without-ncursesw", "--without-udev",
"--without-systemd", "--disable-libuuid", "--disable-libblkid",
"--disable-libmount"... | true | true |
f77c6ff7de76d615e40d1a763362fcc2e5204bd7 | 1,995 | py | Python | PE-Python/P060/P060.py | Tiny-Snow/Project-Euler-Problem-Solutions | 71f25a0ee487bad9130daf653e9eb0397c042f6f | [
"Apache-2.0"
] | 1 | 2021-03-17T08:53:53.000Z | 2021-03-17T08:53:53.000Z | PE-Python/P060/P060.py | Tiny-Snow/Project-Euler-Problem-Solutions | 71f25a0ee487bad9130daf653e9eb0397c042f6f | [
"Apache-2.0"
] | null | null | null | PE-Python/P060/P060.py | Tiny-Snow/Project-Euler-Problem-Solutions | 71f25a0ee487bad9130daf653e9eb0397c042f6f | [
"Apache-2.0"
] | null | null | null | # -*- coding:UTF-8 -*-
# Author:Tiny Snow
# Date: Fri, 26 Feb 2021, 00:55
# Project Euler # 060 Prime pair sets
#==================================================================Solution
import os, sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(BASE_DIR.partition('... | 39.117647 | 147 | 0.566416 |
import os, sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(BASE_DIR.partition('P060')[0] + 'Utility Class')
from prime_utility import *
limit = 10000
prime_class = Prime(limit)
prime_class._traverse()
prime_list = prime_class._get_prime_list()
def is_prime(p):
... | true | true |
f77c70a80887bff611a55f07e1a83c2d7e08b0f3 | 4,100 | py | Python | decode.py | CAVED123/mol-cycle-gan | feb8d7504d0078798ee70d6d5cda3f37b4f7a903 | [
"MIT"
] | 60 | 2019-02-13T21:57:22.000Z | 2022-03-27T06:48:27.000Z | decode.py | CAVED123/mol-cycle-gan | feb8d7504d0078798ee70d6d5cda3f37b4f7a903 | [
"MIT"
] | 2 | 2019-08-11T12:02:10.000Z | 2021-06-20T03:27:35.000Z | decode.py | CAVED123/mol-cycle-gan | feb8d7504d0078798ee70d6d5cda3f37b4f7a903 | [
"MIT"
] | 32 | 2019-02-09T08:42:26.000Z | 2022-01-31T21:07:08.000Z | import argparse
import os
import numpy as np
import pandas as pd
import torch
import tqdm
from jtvae import (Vocab,
JTNNVAE)
class Options:
def __init__(self,
jtvae_path="./jtvae/",
hidden_size=450,
latent_size=56,
depth=3,
... | 34.453782 | 104 | 0.683171 | import argparse
import os
import numpy as np
import pandas as pd
import torch
import tqdm
from jtvae import (Vocab,
JTNNVAE)
class Options:
def __init__(self,
jtvae_path="./jtvae/",
hidden_size=450,
latent_size=56,
depth=3,
... | true | true |
f77c717030283bd95aac811ee48ff4345d05b6bd | 7,354 | py | Python | platform_api/cluster.py | neuro-inc/platform-api | da3df2262eb38b76323f9c76596772820d523ee4 | [
"Apache-2.0"
] | null | null | null | platform_api/cluster.py | neuro-inc/platform-api | da3df2262eb38b76323f9c76596772820d523ee4 | [
"Apache-2.0"
] | 69 | 2021-11-12T13:11:58.000Z | 2022-03-31T03:20:02.000Z | platform_api/cluster.py | neuro-inc/platform-api | da3df2262eb38b76323f9c76596772820d523ee4 | [
"Apache-2.0"
] | 1 | 2022-03-10T04:25:58.000Z | 2022-03-10T04:25:58.000Z | import asyncio
import logging
from abc import ABC, abstractmethod
from collections.abc import AsyncIterator, Sequence
from contextlib import asynccontextmanager
from typing import Any, Callable, Optional
from aiorwlock import RWLock
from .cluster_config import ClusterConfig
from .config import Config
from .config_cli... | 29.416 | 82 | 0.636252 | import asyncio
import logging
from abc import ABC, abstractmethod
from collections.abc import AsyncIterator, Sequence
from contextlib import asynccontextmanager
from typing import Any, Callable, Optional
from aiorwlock import RWLock
from .cluster_config import ClusterConfig
from .config import Config
from .config_cli... | true | true |
f77c718b7ddbf630847c1f37ebc5b7b4ec620834 | 8,068 | py | Python | kivymd_extensions/akivymd/uix/buttonpanel.py | subhranil2605/akivymd | a773900cf07297a14e2227bbf12cd4bcf1a3b279 | [
"MIT"
] | 58 | 2020-10-31T11:59:26.000Z | 2022-03-31T08:44:54.000Z | kivymd_extensions/akivymd/uix/buttonpanel.py | subhranil2605/akivymd | a773900cf07297a14e2227bbf12cd4bcf1a3b279 | [
"MIT"
] | 10 | 2020-11-06T09:20:47.000Z | 2021-12-30T14:13:58.000Z | kivymd_extensions/akivymd/uix/buttonpanel.py | subhranil2605/akivymd | a773900cf07297a14e2227bbf12cd4bcf1a3b279 | [
"MIT"
] | 23 | 2020-11-01T08:17:19.000Z | 2022-03-22T04:37:14.000Z | """
Components/ButtonPanel
======================
.. rubric:: A collapsable panel of buttons
Example
-------
.. code-block:: python
from kivy.lang import Builder
from kivymd.app import MDApp
import kivymd_extensions.akivymd # NOQA
kv_string = '''
MDScreen:
AKButtonPanel:
... | 30.330827 | 106 | 0.603619 |
from kivy.animation import Animation
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import (
BooleanProperty,
ColorProperty,
ListProperty,
NumericProperty,
StringProperty,
)
from kivy.uix.relativelayout import RelativeLayout
from kivymd.theming import ThemableBehavi... | true | true |
f77c7320aafb2b8875b9d430fa3dcfe46891d536 | 3,872 | py | Python | SMT2/EscuchandoMusica/escuchandoMusica.py | luispozas/PR | 34a36ec09d9a1bc9f5cc99882243da5f453c24e8 | [
"MIT"
] | 1 | 2021-06-06T18:28:48.000Z | 2021-06-06T18:28:48.000Z | SMT2/EscuchandoMusica/escuchandoMusica.py | luispozas/PR | 34a36ec09d9a1bc9f5cc99882243da5f453c24e8 | [
"MIT"
] | null | null | null | SMT2/EscuchandoMusica/escuchandoMusica.py | luispozas/PR | 34a36ec09d9a1bc9f5cc99882243da5f453c24e8 | [
"MIT"
] | null | null | null | # LUIS POZAS PALOMO - PR - PRUEBA 20 MAYO
# -----------------------------------------------------
# Para ejecutar el código podéis hacer lo siguiente:
# python3 escuchandoMusica.py < input1.txt > escuchandoMusica.smt2
# z3 escuchandoMusica.smt2
# -----------------------------------------------------
#!/usr/bin/python3... | 21.392265 | 80 | 0.52686 |
import sys
N = int(input())
t1 = int(input())
t2 = int(input())
min_sat = int(input())
dursat = []
for i in range(N):
ds = input().split()
dursat_aux = []
dursat_aux.append(int(ds[0]))
dursat_aux.append(int(ds[1]))
dursat.append(dursat_aux)
def cancion(i):
return "cancion_"+str(i)
def se... | true | true |
f77c73f993304d84b11713c9b4dbc0740daedda7 | 5,019 | py | Python | flanker/addresslib/plugins/yahoo.py | plq/flanker | d71c36eca84ff102a32d8d9c6188900828409018 | [
"Apache-2.0"
] | null | null | null | flanker/addresslib/plugins/yahoo.py | plq/flanker | d71c36eca84ff102a32d8d9c6188900828409018 | [
"Apache-2.0"
] | null | null | null | flanker/addresslib/plugins/yahoo.py | plq/flanker | d71c36eca84ff102a32d8d9c6188900828409018 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
'''
Email address validation plugin for yahoo.com email addresses.
Notes for primary e-mail:
4-32 characters
must start with letter
must end with letter or number
must use letters, numbers, underscores (_)
only one dot (.) allowed
no consecutive ... | 26.696809 | 96 | 0.598526 |
import re
from flanker.addresslib.plugins._tokenizer import TokenStream
ALPHA = re.compile(r'''
[A-Za-z]+
''', re.MULTILINE | re.VERBOSE)
NUMERIC = re.compile(r'''
[0-9]+
''', re.MULTILINE | re.VERBOSE)
ALPHANUM... | true | true |
f77c743322d70316608d07e6de26d0a6c0b59f50 | 1,465 | py | Python | tests/test_plotting.py | CoastalHydrodynamicsLab/python-ctd | af67120346eb0d0d506628a6584601cf3daf7f6a | [
"BSD-3-Clause"
] | null | null | null | tests/test_plotting.py | CoastalHydrodynamicsLab/python-ctd | af67120346eb0d0d506628a6584601cf3daf7f6a | [
"BSD-3-Clause"
] | null | null | null | tests/test_plotting.py | CoastalHydrodynamicsLab/python-ctd | af67120346eb0d0d506628a6584601cf3daf7f6a | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
import ctd
matplotlib.use("Agg")
data_path = Path(__file__).parent.joinpath("data")
def _assert_is_valid_plot_return_object(objs):
if isinstance(objs, np.ndarray):
for el in objs.flat:
... | 22.538462 | 72 | 0.641638 | from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
import ctd
matplotlib.use("Agg")
data_path = Path(__file__).parent.joinpath("data")
def _assert_is_valid_plot_return_object(objs):
if isinstance(objs, np.ndarray):
for el in objs.flat:
... | true | true |
f77c75117ea0d84486ecbbd7ef96731b76cebd93 | 20,782 | py | Python | qa/setup_packages.py | meugur/DALI | 5028c805cc5ac630d0d76f39f8ece962be605824 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | qa/setup_packages.py | meugur/DALI | 5028c805cc5ac630d0d76f39f8ece962be605824 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | qa/setup_packages.py | meugur/DALI | 5028c805cc5ac630d0d76f39f8ece962be605824 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import sys
# use packaging from PIP as it is always present on system we are testing on
from pip._vendor.packaging.version import parse
import urllib.parse
try:
import pip._internal.utils.compatibility_tags as p
except ImportError:
try:
import pip._internal.pep425ta... | 40.431907 | 149 | 0.600568 | import argparse
import sys
from pip._vendor.packaging.version import parse
import urllib.parse
try:
import pip._internal.utils.compatibility_tags as p
except ImportError:
try:
import pip._internal.pep425tags as p
except ImportError:
import pip.pep425tags as p
from urllib.request import urlo... | true | true |
f77c7613ab2106081e64724c723b423d9b1c9f43 | 1,251 | py | Python | sendInfo.py | ErikHendriks/strongOnes | 585be1b55ba2aa67a5cb1d4b9fc2ad7ba46e2224 | [
"MIT"
] | 1 | 2019-09-04T18:55:27.000Z | 2019-09-04T18:55:27.000Z | sendInfo.py | ErikHendriks/strongOnes | 585be1b55ba2aa67a5cb1d4b9fc2ad7ba46e2224 | [
"MIT"
] | null | null | null | sendInfo.py | ErikHendriks/strongOnes | 585be1b55ba2aa67a5cb1d4b9fc2ad7ba46e2224 | [
"MIT"
] | null | null | null | import datetime
import gnupg
import smtplib
conf = [line.strip('\n') for line in open('/etc/breakout/conf.v20')]
def sendEmail(text,subject):
'''
Sending relevant information about initial buy/sell target prices as well as
stop loss and take profit prices, executed buy/sell orders, when all trades... | 34.75 | 87 | 0.610711 | import datetime
import gnupg
import smtplib
conf = [line.strip('\n') for line in open('/etc/breakout/conf.v20')]
def sendEmail(text,subject):
try:
fingerprint = conf[3]
password = conf[4]
sender = conf[6]
reciever = conf[5]
gpg = gnupg.GPG(gnupghome='/etc/breakout/.gnupg')
... | true | true |
f77c7637863ca4013cbac95975db2e1e16249188 | 17,293 | py | Python | research/object_detection/meta_architectures/context_rcnn_meta_arch.py | ashraf-bhuiyan/models | 34012bebada53934e1864dab339a9f4ab578e045 | [
"Apache-2.0"
] | 1 | 2020-11-09T16:11:44.000Z | 2020-11-09T16:11:44.000Z | research/object_detection/meta_architectures/context_rcnn_meta_arch.py | ashraf-bhuiyan/models | 34012bebada53934e1864dab339a9f4ab578e045 | [
"Apache-2.0"
] | null | null | null | research/object_detection/meta_architectures/context_rcnn_meta_arch.py | ashraf-bhuiyan/models | 34012bebada53934e1864dab339a9f4ab578e045 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 50.71261 | 80 | 0.719308 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
from object_detection.core import standard_fields as fields
from object_detection.meta_architectures import context_rcnn_lib
from object_detection.meta_architectures import faster_rcnn_meta_a... | true | true |
f77c774ed406473986a0be6b65a6390c64c8d731 | 8,365 | py | Python | plotly/graph_objs/layout/xaxis/_titlefont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/graph_objs/layout/xaxis/_titlefont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/graph_objs/layout/xaxis/_titlefont.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | from plotly.basedatatypes import BaseLayoutHierarchyType
import copy
class Titlefont(BaseLayoutHierarchyType):
# color
# -----
@property
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba stri... | 37.013274 | 79 | 0.566169 | from plotly.basedatatypes import BaseLayoutHierarchyType
import copy
class Titlefont(BaseLayoutHierarchyType):
@property
def color(self):
return self['color']
@color.setter
def color(self, val):
self['color'] = val
@property
def family(self):
return s... | true | true |
f77c7816d643ce2802e0dd808d49c8bbb9b8fc1b | 2,574 | py | Python | detector/detectors.py | Gavin666Github/chineseocr | 0cfd0ff28984c01b192646acfc63f8ec26d0752b | [
"MIT"
] | null | null | null | detector/detectors.py | Gavin666Github/chineseocr | 0cfd0ff28984c01b192646acfc63f8ec26d0752b | [
"MIT"
] | null | null | null | detector/detectors.py | Gavin666Github/chineseocr | 0cfd0ff28984c01b192646acfc63f8ec26d0752b | [
"MIT"
] | null | null | null | #coding:utf-8
from detector.other import normalize
import numpy as np
import numpy as np
from detector.utils.cython_nms import nms as cython_nms
try:
from detector.utils.gpu_nms import gpu_nms
except:
gpu_nms =cython_nms
def nms(dets, thresh):
if dets.shape[0] == 0:
return []
try:
... | 34.32 | 106 | 0.66317 | from detector.other import normalize
import numpy as np
import numpy as np
from detector.utils.cython_nms import nms as cython_nms
try:
from detector.utils.gpu_nms import gpu_nms
except:
gpu_nms =cython_nms
def nms(dets, thresh):
if dets.shape[0] == 0:
return []
try:
return gpu... | true | true |
f77c788b679fff2c910f62990f17373fb73f57aa | 2,530 | py | Python | setup.py | corydolphin/ndkale | 7ff93d535c0d93482180acef0ed7ae306b6769c0 | [
"BSD-2-Clause"
] | null | null | null | setup.py | corydolphin/ndkale | 7ff93d535c0d93482180acef0ed7ae306b6769c0 | [
"BSD-2-Clause"
] | null | null | null | setup.py | corydolphin/ndkale | 7ff93d535c0d93482180acef0ed7ae306b6769c0 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import multiprocessing # To make python setup.py test happy
import os
import shutil
import subprocess
from distutils.command.clean import clean
from setuptools import setup
multiprocessing
PACKAGE = 'ndkale'
__version__ = None
wi... | 26.631579 | 70 | 0.604743 |
from __future__ import absolute_import
import multiprocessing import os
import shutil
import subprocess
from distutils.command.clean import clean
from setuptools import setup
multiprocessing
PACKAGE = 'ndkale'
__version__ = None
with open(os.path.join('kale', 'version.py')) as f:
source = f.read()
code = comp... | true | true |
f77c79492bcde17f0182c553e3fca7e28b4b65ee | 154 | py | Python | lib/spack/external/macholib/__init__.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | lib/spack/external/macholib/__init__.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | lib/spack/external/macholib/__init__.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | """
Enough Mach-O to make your head spin.
See the relevant header files in /usr/include/mach-o
And also Apple's documentation.
"""
__version__ = '1.10'
| 17.111111 | 52 | 0.720779 | __version__ = '1.10'
| true | true |
f77c79d55889c98eac9bdfe1004e8bf8f85f489e | 559 | py | Python | digit_recognition/config/__init__.py | jordanhoare/digit-drawing-prediction | 4bdf3672dee08a21cce948f41281da3858978c99 | [
"MIT"
] | null | null | null | digit_recognition/config/__init__.py | jordanhoare/digit-drawing-prediction | 4bdf3672dee08a21cce948f41281da3858978c99 | [
"MIT"
] | null | null | null | digit_recognition/config/__init__.py | jordanhoare/digit-drawing-prediction | 4bdf3672dee08a21cce948f41281da3858978c99 | [
"MIT"
] | null | null | null | """
Declaration of the Settings class and instance that can be used to get any setting required,
using dotenv-settings-handler and python-dotenv.
"""
from typing import Optional
from dotenv import load_dotenv
from dotenv_settings_handler import BaseSettingsHandler
load_dotenv()
class Settings(BaseSettingsHandler):
... | 20.703704 | 92 | 0.711986 | from typing import Optional
from dotenv import load_dotenv
from dotenv_settings_handler import BaseSettingsHandler
load_dotenv()
class Settings(BaseSettingsHandler):
host = "127.0.0.1"
port = 8000
name = "FastAPI"
version = "0.0.1"
log_level = "info"
description: Optional[str]
class Con... | true | true |
f77c79ffd65e8cafb31c69422e4c3916dbb607b4 | 1,352 | py | Python | swintransformer/data_processing/train_validation_split.py | Chris19920210/Swin-Transformer-TF | ad9a35fd8c6303fbfa988c7a96845f96560c1184 | [
"Apache-2.0"
] | null | null | null | swintransformer/data_processing/train_validation_split.py | Chris19920210/Swin-Transformer-TF | ad9a35fd8c6303fbfa988c7a96845f96560c1184 | [
"Apache-2.0"
] | null | null | null | swintransformer/data_processing/train_validation_split.py | Chris19920210/Swin-Transformer-TF | ad9a35fd8c6303fbfa988c7a96845f96560c1184 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import pathlib
import os
import numpy as np
import shutil
flags = tf.compat.v1.flags
flags.DEFINE_string('input', './input', 'Directory to input.')
flags.DEFINE_string('output', './output', 'Directory to output. ')
flags.DEFINE_float('ratio', 0.2, 'ratio')
FLAGS = flags.FLAGS
def main(_):
... | 25.037037 | 96 | 0.629438 | import tensorflow as tf
import pathlib
import os
import numpy as np
import shutil
flags = tf.compat.v1.flags
flags.DEFINE_string('input', './input', 'Directory to input.')
flags.DEFINE_string('output', './output', 'Directory to output. ')
flags.DEFINE_float('ratio', 0.2, 'ratio')
FLAGS = flags.FLAGS
def main(_):
... | true | true |
f77c7af0a4e803fa8dbe98cd03d9c9bda65a82ab | 564 | py | Python | detector/object_detection/keras_retinanet/initializers.py | CianciarusoCataldo/nn-object-detector | a1a51f3e8ff295851759664c9155f8ceecb33256 | [
"MIT"
] | 1 | 2019-07-02T03:14:56.000Z | 2019-07-02T03:14:56.000Z | detector/object_detection/keras_retinanet/initializers.py | CianciarusoCataldo/nn-object-detector | a1a51f3e8ff295851759664c9155f8ceecb33256 | [
"MIT"
] | 9 | 2020-01-28T22:48:49.000Z | 2022-02-10T00:11:17.000Z | detector/object_detection/keras_retinanet/initializers.py | CianciarusoCataldo/nn-object-detector | a1a51f3e8ff295851759664c9155f8ceecb33256 | [
"MIT"
] | null | null | null |
import keras
import numpy as np
import math
class PriorProbability(keras.initializers.Initializer):
"""
Initializer applies a prior probability.
"""
def __init__(self, probability=0.01):
self.probability = probability
def get_config(self):
return {
'probability': se... | 21.692308 | 99 | 0.632979 |
import keras
import numpy as np
import math
class PriorProbability(keras.initializers.Initializer):
def __init__(self, probability=0.01):
self.probability = probability
def get_config(self):
return {
'probability': self.probability
}
def __call__(self, shape, dtype... | true | true |
f77c7bf3b06e2aeeee05b42d36d1907031fa5210 | 13,486 | py | Python | app/service/data_svc.py | LTHODAVDOPL/caldera | 3b87c7043667c53acf6a3bc1185e628d045586e7 | [
"Apache-2.0"
] | 1 | 2020-01-27T00:48:03.000Z | 2020-01-27T00:48:03.000Z | app/service/data_svc.py | EmilioPanti/caldera | e743703b11883c08d415650e84bbc43bf6d9e9b7 | [
"Apache-2.0"
] | null | null | null | app/service/data_svc.py | EmilioPanti/caldera | e743703b11883c08d415650e84bbc43bf6d9e9b7 | [
"Apache-2.0"
] | null | null | null | import asyncio
import copy
import glob
import json
import os.path
import pickle
import traceback
from base64 import b64encode
from collections import defaultdict, namedtuple
from app.objects.c_ability import Ability
from app.objects.c_adversary import Adversary
from app.objects.c_fact import Fact
from app.objects.c_pa... | 45.103679 | 134 | 0.531811 | import asyncio
import copy
import glob
import json
import os.path
import pickle
import traceback
from base64 import b64encode
from collections import defaultdict, namedtuple
from app.objects.c_ability import Ability
from app.objects.c_adversary import Adversary
from app.objects.c_fact import Fact
from app.objects.c_pa... | true | true |
f77c7c1e18d89a18e5d52dd64a5af9a35e325e87 | 216 | py | Python | agw/gunicorn_cfg.py | MyDataShare/access-gateway | 55883485c2b5570c5dd34efd2d836c26ad3eca9b | [
"MIT"
] | 1 | 2022-01-03T09:27:48.000Z | 2022-01-03T09:27:48.000Z | agw/gunicorn_cfg.py | MyDataShare/access-gateway | 55883485c2b5570c5dd34efd2d836c26ad3eca9b | [
"MIT"
] | null | null | null | agw/gunicorn_cfg.py | MyDataShare/access-gateway | 55883485c2b5570c5dd34efd2d836c26ad3eca9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
bind = '0.0.0.0:8171'
workers = os.environ['GUNICORN_WORKERS'] if 'GUNICORN_WORKERS' in os.environ else 5
preload_app = True
# Server Hooks
def post_fork(server, worker):
pass
| 18 | 83 | 0.722222 | import os
bind = '0.0.0.0:8171'
workers = os.environ['GUNICORN_WORKERS'] if 'GUNICORN_WORKERS' in os.environ else 5
preload_app = True
def post_fork(server, worker):
pass
| true | true |
f77c7e11ce879f928200c2396d68d493e31a0f47 | 1,709 | py | Python | app/core/migrations/0001_initial.py | igorya7v/python-django-api | bd7443df597a9a0cf743ed6708fc447d622a1b9e | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | igorya7v/python-django-api | bd7443df597a9a0cf743ed6708fc447d622a1b9e | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | igorya7v/python-django-api | bd7443df597a9a0cf743ed6708fc447d622a1b9e | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-08-28 02:07
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Aut... | true | true |
f77c7e3d01f48ae1dca551896b0cca2cd4a2d864 | 753 | py | Python | ed/l/python/examples/async/queue.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | null | null | null | ed/l/python/examples/async/queue.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | null | null | null | ed/l/python/examples/async/queue.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | 1 | 2021-11-26T05:40:08.000Z | 2021-11-26T05:40:08.000Z | import asyncio
async def worker(name, queue):
print('start worker: ', name)
while True:
await asyncio.sleep(1)
s = await queue.get()
print(s, end='', flush=True)
queue.task_done()
async def cr1():
print('[f1]')
queue = asyncio.Queue()
queue.put_nowait('a')
queue.put_nowait('b')
queue.... | 17.511628 | 91 | 0.65073 | import asyncio
async def worker(name, queue):
print('start worker: ', name)
while True:
await asyncio.sleep(1)
s = await queue.get()
print(s, end='', flush=True)
queue.task_done()
async def cr1():
print('[f1]')
queue = asyncio.Queue()
queue.put_nowait('a')
queue.put_nowait('b')
queue.... | true | true |
f77c7e942ecdd9b50982852283341f347f6297a4 | 2,720 | py | Python | dltranz/lightning_modules/emb_module.py | KirillVladimirov/pytorch-lifestream | 83005b950d41de8afc11711fc955ffafb5ff7a9e | [
"Apache-2.0"
] | null | null | null | dltranz/lightning_modules/emb_module.py | KirillVladimirov/pytorch-lifestream | 83005b950d41de8afc11711fc955ffafb5ff7a9e | [
"Apache-2.0"
] | null | null | null | dltranz/lightning_modules/emb_module.py | KirillVladimirov/pytorch-lifestream | 83005b950d41de8afc11711fc955ffafb5ff7a9e | [
"Apache-2.0"
] | 1 | 2022-02-05T15:06:48.000Z | 2022-02-05T15:06:48.000Z | import torch
from dltranz.lightning_modules.AbsModule import ABSModule
from dltranz.metric_learn.losses import get_loss
from dltranz.metric_learn.metric import BatchRecallTopPL
from dltranz.metric_learn.sampling_strategies import get_sampling_strategy
class EmbModule(ABSModule):
"""pl.LightningModule for trainin... | 30.909091 | 90 | 0.608824 | import torch
from dltranz.lightning_modules.AbsModule import ABSModule
from dltranz.metric_learn.losses import get_loss
from dltranz.metric_learn.metric import BatchRecallTopPL
from dltranz.metric_learn.sampling_strategies import get_sampling_strategy
class EmbModule(ABSModule):
def __init__(self,
... | true | true |
f77c7f124f2a9ac9f451aa3d0c10b79b40b59068 | 541 | py | Python | svs/admin.py | brand-fabian/varfish-server | 6a084d891d676ff29355e72a29d4f7b207220283 | [
"MIT"
] | 14 | 2019-09-30T12:44:17.000Z | 2022-02-04T14:45:16.000Z | svs/admin.py | brand-fabian/varfish-server | 6a084d891d676ff29355e72a29d4f7b207220283 | [
"MIT"
] | 244 | 2021-03-26T15:13:15.000Z | 2022-03-31T15:48:04.000Z | svs/admin.py | brand-fabian/varfish-server | 6a084d891d676ff29355e72a29d4f7b207220283 | [
"MIT"
] | 8 | 2020-05-19T21:55:13.000Z | 2022-03-31T07:02:58.000Z | from django.contrib import admin
from .models import (
StructuralVariant,
StructuralVariantGeneAnnotation,
StructuralVariantFlags,
StructuralVariantComment,
ImportStructuralVariantBgJob,
StructuralVariantSet,
)
# Register your models here.
admin.site.register(StructuralVariant)
admin.site.reg... | 27.05 | 52 | 0.83549 | from django.contrib import admin
from .models import (
StructuralVariant,
StructuralVariantGeneAnnotation,
StructuralVariantFlags,
StructuralVariantComment,
ImportStructuralVariantBgJob,
StructuralVariantSet,
)
admin.site.register(StructuralVariant)
admin.site.register(StructuralVariantGeneAn... | true | true |
f77c7f87d8a031923eebea14e79c9826e482ecaf | 5,865 | py | Python | docstore/docstore.py | tmp0230/7oars | 2992df4dbd7de7108c597a8591dbf86229f73dba | [
"BSD-3-Clause"
] | null | null | null | docstore/docstore.py | tmp0230/7oars | 2992df4dbd7de7108c597a8591dbf86229f73dba | [
"BSD-3-Clause"
] | null | null | null | docstore/docstore.py | tmp0230/7oars | 2992df4dbd7de7108c597a8591dbf86229f73dba | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- 7oars.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""A RESTful document store. Each document is stored with a
key... | 29.621212 | 81 | 0.611765 |
"""A RESTful document store. Each document is stored with a
key value. We provide several implementations of the document
store:
* MemoryDB - all documents are stored in memory and will be lost upon
server restart.
http://server/memory/
* FilesystemDB - all documents are persisted int... | false | true |
f77c8030fdaa14b6cbcee272d1cdcf1ade5e4323 | 465 | py | Python | src/dhl/structures/item_to_print.py | sdarmofal/api-dhl-example | 53512e1b7840a85d72816a6d4a51543250d2ed16 | [
"MIT"
] | 1 | 2020-10-01T09:27:58.000Z | 2020-10-01T09:27:58.000Z | src/dhl/structures/item_to_print.py | sdarmofal/api-dhl-example | 53512e1b7840a85d72816a6d4a51543250d2ed16 | [
"MIT"
] | 4 | 2019-05-24T15:57:59.000Z | 2021-12-13T20:03:54.000Z | src/dhl/structures/item_to_print.py | sdarmofal/api-dhl-example | 53512e1b7840a85d72816a6d4a51543250d2ed16 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from src.dhl.structures.structure_base import StructureBase
@dataclass
class ItemToPrint(StructureBase):
label_type: str
shipment_id: int
LABEL_TYPES = ('BLP', 'ZBLP', 'LP')
def build_client_object(self, client_type):
if self.label_type not in self.LABEL_TY... | 27.352941 | 82 | 0.739785 | from dataclasses import dataclass
from src.dhl.structures.structure_base import StructureBase
@dataclass
class ItemToPrint(StructureBase):
label_type: str
shipment_id: int
LABEL_TYPES = ('BLP', 'ZBLP', 'LP')
def build_client_object(self, client_type):
if self.label_type not in self.LABEL_TY... | true | true |
f77c8081c4ca74940e70a1c21374a7387c8ab877 | 815 | py | Python | src/lesson_runtime_features/gc_collect.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | 3 | 2018-08-14T09:33:52.000Z | 2022-03-21T12:31:58.000Z | src/lesson_runtime_features/gc_collect.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | src/lesson_runtime_features/gc_collect.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | import gc
import pprint
class Graph:
def __init__(self, name):
self.name = name
self.next = None
def set_next(self, next):
print('Linking nodes {}.next = {}'.format(self, next))
self.next = next
def __repr__(self):
return '{}({})'.format(
self.__class... | 21.447368 | 65 | 0.628221 | import gc
import pprint
class Graph:
def __init__(self, name):
self.name = name
self.next = None
def set_next(self, next):
print('Linking nodes {}.next = {}'.format(self, next))
self.next = next
def __repr__(self):
return '{}({})'.format(
self.__class... | true | true |
f77c814e6c26b2696655251867cb5bd308294e8e | 698 | py | Python | django/reviewApp/migrations/0013_album_art_cover_alter_album_created_at.py | Akasiek/scorethatlp | 1c669afdaa8fe990e53706f5e60d201fbb76c26a | [
"MIT"
] | 5 | 2022-03-15T18:00:40.000Z | 2022-03-25T18:19:29.000Z | django/reviewApp/migrations/0013_album_art_cover_alter_album_created_at.py | Akasiek/scorethatlp | 1c669afdaa8fe990e53706f5e60d201fbb76c26a | [
"MIT"
] | null | null | null | django/reviewApp/migrations/0013_album_art_cover_alter_album_created_at.py | Akasiek/scorethatlp | 1c669afdaa8fe990e53706f5e60d201fbb76c26a | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-22 16:57
from django.db import migrations, models
import reviewApp.models
class Migration(migrations.Migration):
dependencies = [
('reviewApp', '0012_alter_artist_background_image_alter_artist_image'),
]
operations = [
migrations.AddField(
... | 26.846154 | 106 | 0.621777 |
from django.db import migrations, models
import reviewApp.models
class Migration(migrations.Migration):
dependencies = [
('reviewApp', '0012_alter_artist_background_image_alter_artist_image'),
]
operations = [
migrations.AddField(
model_name='album',
name='art_co... | true | true |
f77c81712955bb0b64d03cd7b5cf3000b8a6f637 | 269 | py | Python | Mini Games/not_mario/utils/__init__.py | PaulPan00/donkey_wrapper | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | [
"MIT"
] | 6 | 2021-03-26T01:42:31.000Z | 2021-04-11T16:17:42.000Z | Mini Games/not_mario/utils/__init__.py | packetsss/Python | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | [
"MIT"
] | null | null | null | Mini Games/not_mario/utils/__init__.py | packetsss/Python | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | [
"MIT"
] | 7 | 2021-04-06T06:55:22.000Z | 2021-05-03T11:26:38.000Z | # Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
from .settings import *
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import sys
import time
import pathlib
import numpy as np
import pygame as pg
pg.init()
pg.font.init()
| 14.944444 | 49 | 0.765799 |
from .settings import *
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import sys
import time
import pathlib
import numpy as np
import pygame as pg
pg.init()
pg.font.init()
| true | true |
f77c81d0e6d25aea6fe94d43e0d3cb21a7b93578 | 8,113 | py | Python | pommerman/cli/Tournament.py | MaxU11/playground | 240182f88836e860fc144a82e98c0f4028294334 | [
"Apache-2.0"
] | null | null | null | pommerman/cli/Tournament.py | MaxU11/playground | 240182f88836e860fc144a82e98c0f4028294334 | [
"Apache-2.0"
] | null | null | null | pommerman/cli/Tournament.py | MaxU11/playground | 240182f88836e860fc144a82e98c0f4028294334 | [
"Apache-2.0"
] | null | null | null | import csv
import os
import random
import time
import atexit
import numpy as np
from datetime import datetime
from pommerman.agents.abstract_mcts_skeleton import AbstractMCTSSkeleton
from pommerman import utility
from pommerman import constants
from pommerman import make
def run(env, agent_names, config, render, do_... | 34.969828 | 189 | 0.541477 | import csv
import os
import random
import time
import atexit
import numpy as np
from datetime import datetime
from pommerman.agents.abstract_mcts_skeleton import AbstractMCTSSkeleton
from pommerman import utility
from pommerman import constants
from pommerman import make
def run(env, agent_names, config, render, do_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.