hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72beaa7ee8d91281059cff457c016f1e6f65cb3 | 3,651 | py | Python | bindings/python/ensmallen/datasets/string/candidatussericytochromatiabacteriums15bmn24raac196.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/candidatussericytochromatiabacteriums15bmn24raac196.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/candidatussericytochromatiabacteriums15bmn24raac196.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Candidatus Sericytochromatia bacterium S15B-MN24 RAAC_196.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
... | 34.771429 | 223 | 0.690222 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def CandidatusSericytochromatiaBacteriumS15bMn24Raac196(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
... | true | true |
f72beafa6216e6ee1923e3c7055a37cbcdd6d963 | 2,305 | py | Python | oop-intro/Game.py | emptyspace42/mycode | 834c0a2817ffffa92b90ec3bd05ef41cb73a8879 | [
"MIT"
] | 5 | 2018-05-21T18:16:13.000Z | 2018-05-22T22:41:40.000Z | oop-intro/Game.py | cazzara/mycode | 834c0a2817ffffa92b90ec3bd05ef41cb73a8879 | [
"MIT"
] | null | null | null | oop-intro/Game.py | cazzara/mycode | 834c0a2817ffffa92b90ec3bd05ef41cb73a8879 | [
"MIT"
] | null | null | null | from Player import Player
from time import sleep
from Cheater import Cheater_Loaded, Cheater_Swapper
from random import random
class Game:
def __init__(self):
self.main()
def make_player(self):
p = None
name = input("Enter your name: ")
cheat = input("Are you a cheater? (y/n)")... | 32.013889 | 98 | 0.527549 | from Player import Player
from time import sleep
from Cheater import Cheater_Loaded, Cheater_Swapper
from random import random
class Game:
def __init__(self):
self.main()
def make_player(self):
p = None
name = input("Enter your name: ")
cheat = input("Are you a cheater? (y/n)")... | true | true |
f72bebf85db3d4c69b7d19ce58388cebfef5832f | 80 | py | Python | brian2/sphinxext/__init__.py | SimonAltrogge/brian2 | 6463c368a8277041051bf5ae4816f0dd5b6e057c | [
"BSD-2-Clause"
] | 674 | 2015-01-14T11:05:39.000Z | 2022-03-29T04:53:50.000Z | brian2/sphinxext/__init__.py | JongwanKim2090/brian2 | c212a57cb992b766786b5769ebb830ff12d8a8ad | [
"BSD-2-Clause"
] | 937 | 2015-01-05T13:24:22.000Z | 2022-03-25T13:10:13.000Z | brian2/sphinxext/__init__.py | JongwanKim2090/brian2 | c212a57cb992b766786b5769ebb830ff12d8a8ad | [
"BSD-2-Clause"
] | 237 | 2015-01-05T13:54:16.000Z | 2022-03-15T22:16:32.000Z | """
Brian-specific extension to the Sphinx documentation generation system.
"""
| 20 | 71 | 0.775 | true | true | |
f72bec6eb6fe20587d73322d3bca2f73d06296e7 | 24,462 | py | Python | XET.py | mezutelni/twrp-installer-xiaomi | 62ac87f316c70089e7188fa7b7f21d234c3643cd | [
"MIT"
] | 4 | 2017-10-09T20:23:56.000Z | 2019-06-27T03:59:26.000Z | XET.py | mezutelni/twrp-installer-xiaomi | 62ac87f316c70089e7188fa7b7f21d234c3643cd | [
"MIT"
] | 1 | 2017-12-01T19:12:44.000Z | 2018-01-06T14:42:47.000Z | XET.py | mezutelni/twrp-installer-xiaomi | 62ac87f316c70089e7188fa7b7f21d234c3643cd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
import sys
import time
import urllib.request
import hashlib
try:
from colorama import Fore, Back, Style, init
except ModuleNotFoundError:
print ("You have no colorama installed, i will install it for you")
print
path = sys.executable
#path = path[:-11]
path = path.r... | 39.518578 | 149 | 0.539245 | import os
import sys
import time
import urllib.request
import hashlib
try:
from colorama import Fore, Back, Style, init
except ModuleNotFoundError:
print ("You have no colorama installed, i will install it for you")
print
path = sys.executable
path = path.replace("python.exe","")
os.system(... | true | true |
f72becd780ca4f371e5aa799094ea59aac89e645 | 27,367 | py | Python | ietf/liaisons/forms.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 2 | 2022-03-12T04:37:08.000Z | 2022-03-13T00:48:39.000Z | ietf/liaisons/forms.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 39 | 2021-05-31T21:10:14.000Z | 2022-03-07T16:07:14.000Z | ietf/liaisons/forms.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 2 | 2021-10-05T12:48:20.000Z | 2021-11-08T11:38:35.000Z | # Copyright The IETF Trust 2011-2020, All Rights Reserved
# -*- coding: utf-8 -*-
import io
import datetime, os
import operator
from typing import Union # pyflakes:ignore
from email.utils import parseaddr
from form_utils.forms import BetterModelForm
from django import forms
from django.conf import setti... | 47.512153 | 176 | 0.637227 |
import io
import datetime, os
import operator
from typing import Union
from email.utils import parseaddr
from form_utils.forms import BetterModelForm
from django import forms
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db.models.que... | true | true |
f72bedbab95f862cc621615212d09c74118e2e36 | 18,978 | py | Python | benchexec/tools/ultimate.py | mikhailramalho/benchexec | 5fc5180c26e0fa18e137b142c5890a3dd7cab795 | [
"Apache-2.0"
] | null | null | null | benchexec/tools/ultimate.py | mikhailramalho/benchexec | 5fc5180c26e0fa18e137b142c5890a3dd7cab795 | [
"Apache-2.0"
] | null | null | null | benchexec/tools/ultimate.py | mikhailramalho/benchexec | 5fc5180c26e0fa18e137b142c5890a3dd7cab795 | [
"Apache-2.0"
] | null | null | null | """
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2015 Daniel Dietsch
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
... | 37.431953 | 101 | 0.566077 |
import functools
import logging
import os
import re
import subprocess
import sys
import benchexec.result as result
import benchexec.tools.template
import benchexec.util as util
from benchexec import BenchExecException
from benchexec.model import MEMLIMIT
from benchexec.tools.template import UnsupportedFeatureExceptio... | true | true |
f72beded7ef5a032d409d3786dee6fcc951198a6 | 18,914 | py | Python | site-packages/neutronclient/osc/v2/fwaas/firewallrule.py | hariza17/freezer_libraries | e0bd890eba5e7438976fb3b4d66c41c128bab790 | [
"PSF-2.0"
] | null | null | null | site-packages/neutronclient/osc/v2/fwaas/firewallrule.py | hariza17/freezer_libraries | e0bd890eba5e7438976fb3b4d66c41c128bab790 | [
"PSF-2.0"
] | null | null | null | site-packages/neutronclient/osc/v2/fwaas/firewallrule.py | hariza17/freezer_libraries | e0bd890eba5e7438976fb3b4d66c41c128bab790 | [
"PSF-2.0"
] | null | null | null | # Copyright 2016-2017 FUJITSU LIMITED
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 39.987315 | 79 | 0.635297 | import copy
import logging
from cliff import columns as cliff_columns
from osc_lib.command import command
from osc_lib import exceptions
from osc_lib import utils
from osc_lib.utils import columns as column_util
from neutronclient._i18n import _
from neutronclient.common import utils as nc_utils
from neutronclient.os... | true | true |
f72bee82c057e8b1b9e1dcbe3c8f34b55a9c0a95 | 3,518 | py | Python | django_libs/test_email_backend.py | Reston/django-libs | 8c44a0851e3be564a100df50d257c1ce5b30dc25 | [
"MIT"
] | null | null | null | django_libs/test_email_backend.py | Reston/django-libs | 8c44a0851e3be564a100df50d257c1ce5b30dc25 | [
"MIT"
] | null | null | null | django_libs/test_email_backend.py | Reston/django-libs | 8c44a0851e3be564a100df50d257c1ce5b30dc25 | [
"MIT"
] | 1 | 2020-01-09T10:23:13.000Z | 2020-01-09T10:23:13.000Z | """Custom email backend for testing the project."""
import re
from django.core.mail.backends.smtp import EmailBackend as SmtpEmailBackend
from django.core.mail.message import sanitize_address
from . import default_settings as settings
class EmailBackend(SmtpEmailBackend):
"""
Email backend that sends all em... | 34.490196 | 79 | 0.645253 | import re
from django.core.mail.backends.smtp import EmailBackend as SmtpEmailBackend
from django.core.mail.message import sanitize_address
from . import default_settings as settings
class EmailBackend(SmtpEmailBackend):
def _send(self, email_message):
if not email_message.recipients() or \
... | true | true |
f72beeeefd11624a2d91beb7c8d8ca61bb669461 | 14,901 | py | Python | py/redrock/templates.py | echaussidon/redrock | 9a3d4f0aed8c0792f2cc731dbdf04a99018083bf | [
"BSD-3-Clause"
] | 14 | 2017-09-22T23:57:33.000Z | 2022-03-15T10:36:16.000Z | py/redrock/templates.py | echaussidon/redrock | 9a3d4f0aed8c0792f2cc731dbdf04a99018083bf | [
"BSD-3-Clause"
] | 154 | 2017-06-04T22:57:39.000Z | 2022-03-11T23:01:16.000Z | py/redrock/templates.py | echaussidon/redrock | 9a3d4f0aed8c0792f2cc731dbdf04a99018083bf | [
"BSD-3-Clause"
] | 10 | 2017-06-09T15:24:59.000Z | 2021-05-26T13:16:42.000Z | """
Classes and functions for templates.
"""
from __future__ import absolute_import, division, print_function
import sys
from glob import glob
import os
import traceback
import numpy as np
from astropy.io import fits
from .utils import native_endian, elapsed, transmission_Lyman
from .rebin import rebin_template, t... | 32.253247 | 97 | 0.587075 |
from __future__ import absolute_import, division, print_function
import sys
from glob import glob
import os
import traceback
import numpy as np
from astropy.io import fits
from .utils import native_endian, elapsed, transmission_Lyman
from .rebin import rebin_template, trapz_rebin
class Template(object):
def ... | true | true |
f72bf05616bf34cf98330d2cbaf1008bb162279a | 1,420 | py | Python | redbot/message/headers/x_cache.py | thinkbox/redbot | 90744dd971389bbf435d200483309b70b748785a | [
"Unlicense"
] | 1 | 2019-06-27T13:02:52.000Z | 2019-06-27T13:02:52.000Z | redbot/message/headers/x_cache.py | thinkbox/redbot | 90744dd971389bbf435d200483309b70b748785a | [
"Unlicense"
] | null | null | null | redbot/message/headers/x_cache.py | thinkbox/redbot | 90744dd971389bbf435d200483309b70b748785a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
__author__ = "Mark Nottingham <mnot@mnot.net>"
__copyright__ = """\
Copyright (c) 2008-2013 Mark Nottingham
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restricti... | 37.368421 | 77 | 0.783803 |
__author__ = "Mark Nottingham <mnot@mnot.net>"
__copyright__ = """\
Copyright (c) 2008-2013 Mark Nottingham
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without ... | true | true |
f72bf18fa11ed33b50a81cfc1f4e0efdcb4066ad | 8,001 | py | Python | Source/FetchData/Fetch_Data_Stock_CHN_Daily.py | guissy/StockRecommendSystem | 2e8694d0bb2ceaa42585ee7414564d921cc5a854 | [
"MIT"
] | null | null | null | Source/FetchData/Fetch_Data_Stock_CHN_Daily.py | guissy/StockRecommendSystem | 2e8694d0bb2ceaa42585ee7414564d921cc5a854 | [
"MIT"
] | null | null | null | Source/FetchData/Fetch_Data_Stock_CHN_Daily.py | guissy/StockRecommendSystem | 2e8694d0bb2ceaa42585ee7414564d921cc5a854 | [
"MIT"
] | null | null | null | import sys, os, time, datetime, warnings, configparser
import pandas as pd
import numpy as np
import tushare as ts
import concurrent.futures
from tqdm import tqdm
cur_path = os.path.dirname(os.path.abspath(__file__))
for _ in range(2):
root_path = cur_path[0:cur_path.rfind('/', 0, len(cur_path))]
cur_path = ro... | 38.282297 | 155 | 0.632921 | import sys, os, time, datetime, warnings, configparser
import pandas as pd
import numpy as np
import tushare as ts
import concurrent.futures
from tqdm import tqdm
cur_path = os.path.dirname(os.path.abspath(__file__))
for _ in range(2):
root_path = cur_path[0:cur_path.rfind('/', 0, len(cur_path))]
cur_path = ro... | true | true |
f72bf3adc21681236ec82aae83471ffedf35ef9b | 817 | py | Python | src/10-async-web/acityscape_api/app.py | NissesSenap/async-techniques-python-course | 455c7222b52e7c3aa7f4eb4b03e9b6f0a99adaef | [
"MIT"
] | 380 | 2018-09-26T17:40:52.000Z | 2022-03-29T02:38:17.000Z | src/10-async-web/acityscape_api/app.py | NissesSenap/async-techniques-python-course | 455c7222b52e7c3aa7f4eb4b03e9b6f0a99adaef | [
"MIT"
] | 13 | 2018-09-30T05:55:40.000Z | 2022-01-24T20:40:09.000Z | src/10-async-web/acityscape_api/app.py | NissesSenap/async-techniques-python-course | 455c7222b52e7c3aa7f4eb4b03e9b6f0a99adaef | [
"MIT"
] | 214 | 2018-09-26T18:53:17.000Z | 2021-12-30T16:58:27.000Z | import quart
from views import city_api
from views import home
from config import settings
import services.weather_service
import services.sun_service
import services.location_service
app = quart.Quart(__name__)
is_debug = True
app.register_blueprint(home.blueprint)
app.register_blueprint(city_api.blueprint)
def co... | 23.342857 | 75 | 0.767442 | import quart
from views import city_api
from views import home
from config import settings
import services.weather_service
import services.sun_service
import services.location_service
app = quart.Quart(__name__)
is_debug = True
app.register_blueprint(home.blueprint)
app.register_blueprint(city_api.blueprint)
def co... | true | true |
f72bf4d9ad27aa607870ea1c9ce5ee5bb7ccd384 | 1,009 | py | Python | plaid_project/contrib/sites/migrations/0003_set_site_domain_and_name.py | reetikaSR/PlaidProject | 904bd7fd3412a4b5149aae899abcf8794bebba81 | [
"MIT"
] | null | null | null | plaid_project/contrib/sites/migrations/0003_set_site_domain_and_name.py | reetikaSR/PlaidProject | 904bd7fd3412a4b5149aae899abcf8794bebba81 | [
"MIT"
] | null | null | null | plaid_project/contrib/sites/migrations/0003_set_site_domain_and_name.py | reetikaSR/PlaidProject | 904bd7fd3412a4b5149aae899abcf8794bebba81 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 28.828571 | 129 | 0.684836 | from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
"domain": "127.0.0.1",
"name": "plaid_project",
... | true | true |
f72bf52ed5ae857e2f0a8b16ca7cacfc142bfbdb | 3,895 | py | Python | utils.py | ambareeshravi/TrafficSignClassifier_API | 8628057439ee70f6d827abf931071e9b6539bd5b | [
"MIT"
] | null | null | null | utils.py | ambareeshravi/TrafficSignClassifier_API | 8628057439ee70f6d827abf931071e9b6539bd5b | [
"MIT"
] | null | null | null | utils.py | ambareeshravi/TrafficSignClassifier_API | 8628057439ee70f6d827abf931071e9b6539bd5b | [
"MIT"
] | null | null | null | '''
Author: Ambareesh Ravi
Date: Jul 31, 2021
Title: utils.py
Description:
Contains utility and helper functions for the project
'''
# Libraries imports
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
from time import time
from glob import glob
from PIL import Image
import matplotlib.pyplot ... | 22.911765 | 115 | 0.558408 |
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
from time import time
from glob import glob
from PIL import Image
import matplotlib.pyplot as plt
import argparse
import cv2
MANUAL_SEED = 42
np.random.seed(42)
def INFO(s):
print("-"*40)
print("INFO:", s)
print("-"*40)
def read_dire... | true | true |
f72bf7299d2697d596b1a5964fe20792a37b1d6a | 14,540 | py | Python | fortiosapi/fortiosapi.py | javcasalc/fortiosapi | 5dd35b59cfa8b87aee2a10f2303595c3da2347df | [
"Apache-2.0"
] | null | null | null | fortiosapi/fortiosapi.py | javcasalc/fortiosapi | 5dd35b59cfa8b87aee2a10f2303595c3da2347df | [
"Apache-2.0"
] | null | null | null | fortiosapi/fortiosapi.py | javcasalc/fortiosapi | 5dd35b59cfa8b87aee2a10f2303595c3da2347df | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2015 Fortinet, Inc.
#
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 39.297297 | 82 | 0.588308 |
import json
import logging
import subprocess
import time
import paramiko
import requests
try: from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requ... | true | true |
f72bf76df8d11eb6f121b20434afa79afc78b832 | 5,472 | py | Python | tests/deep_eq.py | textioHQ/PynamoDB | cc00ff616d1ff04793af2a43a68cef7611de4e85 | [
"MIT"
] | 1,586 | 2017-04-11T13:09:30.000Z | 2022-03-30T01:38:48.000Z | tests/deep_eq.py | textioHQ/PynamoDB | cc00ff616d1ff04793af2a43a68cef7611de4e85 | [
"MIT"
] | 606 | 2017-04-11T12:53:27.000Z | 2022-03-29T12:12:51.000Z | tests/deep_eq.py | textioHQ/textio-pynamodb | cc00ff616d1ff04793af2a43a68cef7611de4e85 | [
"MIT"
] | 366 | 2017-05-04T19:36:31.000Z | 2022-03-20T14:05:53.000Z | # Copyright (c) 2010-2013 Samuel Sutch [samuel.sutch@gmail.com]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | 38.535211 | 82 | 0.561586 |
import datetime, time, functools, operator
default_fudge = datetime.timedelta(seconds=0, microseconds=0, days=0)
def deep_eq(_v1, _v2, datetime_fudge=default_fudge, _assert=False):
_deep_eq = functools.partial(deep_eq, datetime_fudge=datetime_fudge,
_assert=_assert)
def _ch... | true | true |
f72bf78a0312644a15cd73be8689aef834f595d3 | 437 | py | Python | exe077 - COntando vogais em Tupla.py | carlosbandelli/Exercicios_em_Python | 2cd5bd837fdc51932f9605db32366ad0e3871d87 | [
"MIT"
] | null | null | null | exe077 - COntando vogais em Tupla.py | carlosbandelli/Exercicios_em_Python | 2cd5bd837fdc51932f9605db32366ad0e3871d87 | [
"MIT"
] | null | null | null | exe077 - COntando vogais em Tupla.py | carlosbandelli/Exercicios_em_Python | 2cd5bd837fdc51932f9605db32366ad0e3871d87 | [
"MIT"
] | null | null | null | palavras = ('aprender', 'programar', 'Linguagem', 'python',
'cruso', 'gratis', 'estudar', 'praticar',
'trabalhar', 'mercado', 'programador', 'futuro')
for p in palavras: # para cada palavra dentro do array de palavra
print(f'\nNa palavra {p.upper()} temos', end='')
for letra in p: # para... | 54.625 | 72 | 0.606407 | palavras = ('aprender', 'programar', 'Linguagem', 'python',
'cruso', 'gratis', 'estudar', 'praticar',
'trabalhar', 'mercado', 'programador', 'futuro')
for p in palavras: print(f'\nNa palavra {p.upper()} temos', end='')
for letra in p: if letra.lower() in 'aeiou':
prin... | true | true |
f72bf78b887dc5d6cf67f9a36e0f156cb0c5c2ab | 4,851 | py | Python | profiles_api/views.py | rawaihtun/profiles-rest-api | 2a810cfcf41b3fbf336956a30805492b8249d36e | [
"MIT"
] | null | null | null | profiles_api/views.py | rawaihtun/profiles-rest-api | 2a810cfcf41b3fbf336956a30805492b8249d36e | [
"MIT"
] | 4 | 2021-03-19T12:01:37.000Z | 2022-02-10T09:30:39.000Z | profiles_api/views.py | rawaihtun/profiles-rest-api | 2a810cfcf41b3fbf336956a30805492b8249d36e | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from res... | 32.777027 | 84 | 0.669553 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from res... | true | true |
f72bf7f75d268ffc1761eda7cbca14afc9a54931 | 9,513 | py | Python | tests/test_v2.py | dajiaji/pyseto | 6e3f1259bd1a1671cccd75cb557bb63182f9e01a | [
"MIT"
] | 25 | 2021-09-06T08:53:45.000Z | 2022-02-19T20:17:23.000Z | tests/test_v2.py | dajiaji/pyseto | 6e3f1259bd1a1671cccd75cb557bb63182f9e01a | [
"MIT"
] | 124 | 2021-09-05T05:44:05.000Z | 2022-03-27T05:57:25.000Z | tests/test_v2.py | dajiaji/pyseto | 6e3f1259bd1a1671cccd75cb557bb63182f9e01a | [
"MIT"
] | 3 | 2021-09-11T02:37:09.000Z | 2022-01-06T10:49:14.000Z | from secrets import token_bytes
import pytest
import pyseto
from pyseto import DecryptError, EncryptError, Key, VerifyError
from pyseto.versions.v2 import V2Local, V2Public
from .utils import get_path, load_key
class TestV2Local:
"""
Tests for v2.local.
"""
@pytest.mark.parametrize(
"key, ... | 38.358871 | 89 | 0.599495 | from secrets import token_bytes
import pytest
import pyseto
from pyseto import DecryptError, EncryptError, Key, VerifyError
from pyseto.versions.v2 import V2Local, V2Public
from .utils import get_path, load_key
class TestV2Local:
@pytest.mark.parametrize(
"key, msg",
[
(b"", "key m... | true | true |
f72bfa6d085487f6f133c3d61b0833f55d54597a | 136 | py | Python | oandapy/entities/positions.py | gustavooferreira/oandaApi | 3c22c088e090e726cccebd201efb4254503246a0 | [
"MIT"
] | 4 | 2016-07-17T15:39:50.000Z | 2016-10-06T23:41:28.000Z | oandapy/entities/positions.py | gustavooferreira/oandaApi | 3c22c088e090e726cccebd201efb4254503246a0 | [
"MIT"
] | 1 | 2018-12-09T21:20:57.000Z | 2018-12-09T21:20:57.000Z | oandapy/entities/positions.py | gustavooferreira/oandaApi | 3c22c088e090e726cccebd201efb4254503246a0 | [
"MIT"
] | 1 | 2018-12-06T18:39:36.000Z | 2018-12-06T18:39:36.000Z | # -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Entities for Positions
"""
def main():
pass
if __name__ == '__main__':
main()
| 9.066667 | 26 | 0.544118 |
def main():
pass
if __name__ == '__main__':
main()
| true | true |
f72bfdbd824f7c5caeb25c8512edc95565455d2e | 13,091 | py | Python | naucse/views.py | befeleme/naucse.python.cz | dee2c8cce8db90108b01b40c0981053943352d11 | [
"MIT"
] | 4 | 2019-02-14T08:02:41.000Z | 2020-10-20T10:35:55.000Z | naucse/views.py | befeleme/naucse.python.cz | dee2c8cce8db90108b01b40c0981053943352d11 | [
"MIT"
] | 71 | 2018-08-26T22:31:39.000Z | 2022-01-20T10:29:23.000Z | naucse/views.py | befeleme/naucse.python.cz | dee2c8cce8db90108b01b40c0981053943352d11 | [
"MIT"
] | 40 | 2018-08-22T14:44:59.000Z | 2021-09-20T16:11:27.000Z | import datetime
from pathlib import Path
import functools
import calendar
import os
from flask import Flask, render_template, jsonify, url_for, Response, abort, g, redirect
from flask import send_from_directory
import ics
from arca import Arca
from naucse import models
from naucse.urlconverters import register_url_co... | 30.730047 | 88 | 0.625544 | import datetime
from pathlib import Path
import functools
import calendar
import os
from flask import Flask, render_template, jsonify, url_for, Response, abort, g, redirect
from flask import send_from_directory
import ics
from arca import Arca
from naucse import models
from naucse.urlconverters import register_url_co... | true | true |
f72bfe29fee50157b229530a1755cc94f9b37546 | 23,048 | py | Python | lib/keystore.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | lib/keystore.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | lib/keystore.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 The Electrum developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without... | 30.730667 | 95 | 0.63025 |
from unicodedata import normalize
from . import bitcoin
from .bitcoin import *
from .util import PrintError, InvalidPassword, hfu
from .mnemonic import Mnemonic, load_wordlist
from .plugins import run_hook
class KeyStore(PrintError):
def has_seed(self):
return False
def is_watching_only(self):
... | true | true |
f72bffcf3e618c50ae473c4085888ea423e1b4c8 | 6,863 | py | Python | tests/system_tests_console.py | kishorkunal-raj/qpid-dispatch | f629b448dc1ae92d46c31f3c8d7bf317412b9e22 | [
"Apache-2.0"
] | 1 | 2019-07-16T10:24:40.000Z | 2019-07-16T10:24:40.000Z | tests/system_tests_console.py | kishorkunal-raj/qpid-dispatch | f629b448dc1ae92d46c31f3c8d7bf317412b9e22 | [
"Apache-2.0"
] | 121 | 2020-09-16T06:03:53.000Z | 2022-03-30T13:03:23.000Z | tests/system_tests_console.py | irinabov/debian-qpid-dispatch | 42fb2ffb65f8e8c8d616633c0b4308d6531a281d | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 32.837321 | 91 | 0.635582 |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import os
import errno
import re
import time
import unittest
from subprocess import PIPE
import subprocess
from system_test import main_module, SkipIfNeeded, TestCase
fr... | true | true |
f72bfffe1663a5030918dbba8147d3457fb5b2fd | 3,095 | py | Python | examples/basic_2.py | yoavfreund/DAPPER | c2fa5cc446a2b22a1efc174afc7e091363c9375d | [
"MIT"
] | null | null | null | examples/basic_2.py | yoavfreund/DAPPER | c2fa5cc446a2b22a1efc174afc7e091363c9375d | [
"MIT"
] | null | null | null | examples/basic_2.py | yoavfreund/DAPPER | c2fa5cc446a2b22a1efc174afc7e091363c9375d | [
"MIT"
] | null | null | null | # ## Illustrate usage of DAPPER to benchmark multiple DA methods.
# #### Imports
# <b>NB:</b> If you're on <mark><b>Gooble Colab</b></mark>,
# then replace `%matplotlib notebook` below by
# `!python -m pip install git+https://github.com/nansencenter/DAPPER.git` .
# Also note that liveplotting does not work on Colab.
... | 38.6875 | 80 | 0.51567 |
# then replace `%matplotlib notebook` below by
# `!python -m pip install git+https://github.com/nansencenter/DAPPER.git` .
# Also note that liveplotting does not work on Colab.
# %matplotlib notebook
import dapper as dpr
import dapper.da_methods as da
# #### DA method configurations
from dapper.mods.Lorenz63.sakov2... | true | true |
f72c023c3e475c0e66d6e44d0f104ade3ca2bea0 | 7,867 | py | Python | accelbyte_py_sdk/api/ugc/operations/public_group/get_group.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/ugc/operations/public_group/get_group.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/ugc/operations/public_group/get_group.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 29.575188 | 164 | 0.616245 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from .....core import Operation
from .....core import HeaderStr
from .....core import HttpResponse
from ...models import ModelsCreateGroupResponse
from ...models import ResponseError
class GetGroup(Operation):
... | true | true |
f72c036616f99189d65b39be5f6f951c9fd19357 | 30,886 | py | Python | tensorflow/contrib/learn/python/learn/estimators/dnn.py | kadeng/tensorflow_project_workspace | dee284fb2d1796329895130a075cd57a62ea873f | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/dnn.py | kadeng/tensorflow_project_workspace | dee284fb2d1796329895130a075cd57a62ea873f | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/dnn.py | kadeng/tensorflow_project_workspace | dee284fb2d1796329895130a075cd57a62ea873f | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 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... | 37.896933 | 102 | 0.662015 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.contrib import layers
from tensorflow.contrib.framework import deprecated
from tensorflow.contrib.framework import deprecated_arg_values
from tensorflow.contrib.framework.python.fra... | true | true |
f72c0438b220afbd9e2368f18d00c300ac52ab61 | 8,977 | py | Python | precision_search/model/TEMPONet_float.py | EmbeddedML-EDAGroup/Q-PPG | ed42829d0a456db4f0b31d63ba8b22ba483c7b08 | [
"Apache-2.0"
] | 1 | 2021-12-18T21:04:29.000Z | 2021-12-18T21:04:29.000Z | precision_search/model/TEMPONet_float.py | EmbeddedML-EDAGroup/Q-PPG | ed42829d0a456db4f0b31d63ba8b22ba483c7b08 | [
"Apache-2.0"
] | null | null | null | precision_search/model/TEMPONet_float.py | EmbeddedML-EDAGroup/Q-PPG | ed42829d0a456db4f0b31d63ba8b22ba483c7b08 | [
"Apache-2.0"
] | null | null | null | #*----------------------------------------------------------------------------*
#* Copyright (C) 2021 Politecnico di Torino, Italy *
#* SPDX-License-Identifier: Apache-2.0 *
#* *
... | 28.22956 | 150 | 0.479782 |
import torch.nn as nn
import torch.nn.functional as F
from base import BaseModel
from math import ceil
import sys
sys.path.append("..")
from models import quant_module_1d as qm
__all__ = ['TempoNetfloat']
def TempoNetfloat(**kwargs):
return TEMPONet(**kwargs)
class TEMPONet(BaseModel):
def __init__(self,... | true | true |
f72c0485c62be64f09e5a685e3cf499a790a4ccf | 13,340 | py | Python | crossmodal_embedding/tasks/crossmodal/training_star_task.py | ai-systems/crossmodal_embedding | 5c61775531fd350c48a965450ab5e99b28deec5e | [
"MIT"
] | null | null | null | crossmodal_embedding/tasks/crossmodal/training_star_task.py | ai-systems/crossmodal_embedding | 5c61775531fd350c48a965450ab5e99b28deec5e | [
"MIT"
] | null | null | null | crossmodal_embedding/tasks/crossmodal/training_star_task.py | ai-systems/crossmodal_embedding | 5c61775531fd350c48a965450ab5e99b28deec5e | [
"MIT"
] | null | null | null | from prefect import Task
from loguru import logger
from tqdm import tqdm
from crossmodal_embedding.models import CrossModalEmbedding, SiameseNet
from crossmodal_embedding.models import InputData, InputDataTest
from sklearn.metrics import precision_recall_fscore_support, f1_score
import torch.optim as optim
import torch... | 37.366947 | 88 | 0.496027 | from prefect import Task
from loguru import logger
from tqdm import tqdm
from crossmodal_embedding.models import CrossModalEmbedding, SiameseNet
from crossmodal_embedding.models import InputData, InputDataTest
from sklearn.metrics import precision_recall_fscore_support, f1_score
import torch.optim as optim
import torch... | true | true |
f72c04c1115d6d2253cc4ff13cc515e322a0dd87 | 6,763 | py | Python | config.py | YetheYe/Mask_RCNN | 6895c617af13ecbf0bb27790e29a6271725cb34f | [
"MIT"
] | null | null | null | config.py | YetheYe/Mask_RCNN | 6895c617af13ecbf0bb27790e29a6271725cb34f | [
"MIT"
] | null | null | null | config.py | YetheYe/Mask_RCNN | 6895c617af13ecbf0bb27790e29a6271725cb34f | [
"MIT"
] | null | null | null | """
Mask R-CNN
Base Configurations class.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import math
import numpy as np
# Base Configuration Class
# Don't use this class directly. Instead, sub-class it and override
# the configurations you ... | 36.556757 | 84 | 0.69067 |
import math
import numpy as np
# the configurations you need to change.
class Config(object):
# Name the configurations. For example, 'COCO', 'Experiment 3', ...etc.
# Useful if your code needs to do things differently depending on which
# experiment is running.
NAME = None # Override in sub-classe... | true | true |
f72c04c84917b4d25698a444e88719304b1f71e7 | 17,176 | py | Python | test/test_utils/vcfutils/test_parser.py | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 8 | 2018-10-08T15:47:21.000Z | 2021-11-09T07:13:05.000Z | test/test_utils/vcfutils/test_parser.py | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 4 | 2018-11-05T09:16:27.000Z | 2020-04-09T12:32:56.000Z | test/test_utils/vcfutils/test_parser.py | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 4 | 2019-09-03T15:46:39.000Z | 2021-06-04T07:28:33.000Z | # All content Copyright (C) 2018 Genomics plc
import os
import re
import unittest
from wecall.genomics.variant import Variant
from wecall.vcfutils.genotype_call import GenotypeCall
from wecall.vcfutils.parser import VCFReader, VCFReaderContextManager, decode_VCF_string, \
parse_VCF_comma_separated_pair_value
from ... | 35.783333 | 120 | 0.615859 | import os
import re
import unittest
from wecall.genomics.variant import Variant
from wecall.vcfutils.genotype_call import GenotypeCall
from wecall.vcfutils.parser import VCFReader, VCFReaderContextManager, decode_VCF_string, \
parse_VCF_comma_separated_pair_value
from wecall.vcfutils.schema import Schema
from weca... | true | true |
f72c05338ce0e13464f88b0d16b63a74fd9ad1e2 | 6,580 | py | Python | recognition/alexnet_PD_finetuning.py | ogrenenmakine/VCL-PL-Semi-Supervised-Learning-from-Noisy-Web-Data-with-Variational-Contrastive-Learning | baef25837ce7e073d03f69a095d1992aa18dd2d5 | [
"MIT"
] | null | null | null | recognition/alexnet_PD_finetuning.py | ogrenenmakine/VCL-PL-Semi-Supervised-Learning-from-Noisy-Web-Data-with-Variational-Contrastive-Learning | baef25837ce7e073d03f69a095d1992aa18dd2d5 | [
"MIT"
] | null | null | null | recognition/alexnet_PD_finetuning.py | ogrenenmakine/VCL-PL-Semi-Supervised-Learning-from-Noisy-Web-Data-with-Variational-Contrastive-Learning | baef25837ce7e073d03f69a095d1992aa18dd2d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import math
from torch import nn
from torch.autograd import Variable
import torch
import torch.nn.functional as F
import torchvision
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.utils as vutils
import numpy as np
from PIL... | 29.375 | 600 | 0.632827 |
import math
from torch import nn
from torch.autograd import Variable
import torch
import torch.nn.functional as F
import torchvision
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.utils as vutils
import numpy as np
from PIL import Image
import os
import matplotlib.pyplo... | true | true |
f72c055d3838a4636e2e7b02c3f27e7b13404fdf | 6,398 | py | Python | skyscrapers/skyscrapers.py | Adeon18/skyscrapers.py | 8dbd6e9d648a56f8dbab7de50ef6c606e4aed18e | [
"MIT"
] | null | null | null | skyscrapers/skyscrapers.py | Adeon18/skyscrapers.py | 8dbd6e9d648a56f8dbab7de50ef6c606e4aed18e | [
"MIT"
] | null | null | null | skyscrapers/skyscrapers.py | Adeon18/skyscrapers.py | 8dbd6e9d648a56f8dbab7de50ef6c606e4aed18e | [
"MIT"
] | null | null | null | """
https://github.com/Adeon18/skyscrapers
"""
def read_input(path: str) -> list:
"""
Read game board file from path.
Return list of str.
"""
with open(path, "r") as file:
output_lst = file.read().split("\n")
output_lst = output_lst[:-1]
return output_lst
def left_to_right_c... | 29.081818 | 79 | 0.557205 |
def read_input(path: str) -> list:
with open(path, "r") as file:
output_lst = file.read().split("\n")
output_lst = output_lst[:-1]
return output_lst
def left_to_right_check(input_line: str, pivot: int) -> bool:
row = input_line
max_num = 0
count = 0
for _, num in enumerate(r... | true | true |
f72c08bf0eb0d7eb846f18ba055eede40647f94e | 30,345 | py | Python | sdk/python/pulumi_google_native/apigee/v1/organization.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/apigee/v1/organization.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/apigee/v1/organization.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 52.958115 | 929 | 0.680046 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['OrganizationArgs', 'Organization']
@pulumi.input_type
class OrganizationArgs:
def __in... | true | true |
f72c08e934eb334e53153f585231168d33ac7fca | 35,118 | py | Python | src/search.py | luisriverag/MagnetMagnet | 99f1805da0fa6399e4b28ab40d5784170bb91e82 | [
"MIT"
] | 44 | 2020-03-14T15:53:11.000Z | 2022-01-31T11:28:59.000Z | src/search.py | luisriverag/MagnetMagnet | 99f1805da0fa6399e4b28ab40d5784170bb91e82 | [
"MIT"
] | 6 | 2020-04-30T15:53:34.000Z | 2021-09-09T14:38:02.000Z | src/search.py | luisriverag/MagnetMagnet | 99f1805da0fa6399e4b28ab40d5784170bb91e82 | [
"MIT"
] | 16 | 2020-04-30T13:18:21.000Z | 2022-01-27T17:50:56.000Z | import math
import re
import pyperclip
import requests
from bs4 import BeautifulSoup
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import src.mglobals
path = src.mglobals.base_path
class Ui_searchMainWindow(object):
def copied_success_message(self):
successMessageBo... | 44.173585 | 179 | 0.539154 | import math
import re
import pyperclip
import requests
from bs4 import BeautifulSoup
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import src.mglobals
path = src.mglobals.base_path
class Ui_searchMainWindow(object):
def copied_success_message(self):
successMessageBo... | true | true |
f72c091ee41e3a1bdb0176021673692667130530 | 1,631 | py | Python | mcp/lib/Slack.py | vspeter/MCP | 1f8ee863d64a2c276c47f1f8c4803983bff88fb7 | [
"Apache-2.0"
] | null | null | null | mcp/lib/Slack.py | vspeter/MCP | 1f8ee863d64a2c276c47f1f8c4803983bff88fb7 | [
"Apache-2.0"
] | null | null | null | mcp/lib/Slack.py | vspeter/MCP | 1f8ee863d64a2c276c47f1f8c4803983bff88fb7 | [
"Apache-2.0"
] | 1 | 2021-02-24T16:51:11.000Z | 2021-02-24T16:51:11.000Z | import json
import logging
from urllib import request, parse
class Slack():
NOTSET = ':loudspeaker:'
DEBUG = ':speaker:'
INFO = ':information_source:'
WARNING = ':warning:'
ERROR = ':exclamation:'
CRITICAL = ':boom:'
SUCCESS = ':+1:'
DONE = ':checkered_flag:'
def __init__( self, proc, api_token, ch... | 28.614035 | 101 | 0.619865 | import json
import logging
from urllib import request, parse
class Slack():
NOTSET = ':loudspeaker:'
DEBUG = ':speaker:'
INFO = ':information_source:'
WARNING = ':warning:'
ERROR = ':exclamation:'
CRITICAL = ':boom:'
SUCCESS = ':+1:'
DONE = ':checkered_flag:'
def __init__( self, proc, api_token, ch... | true | true |
f72c09ac05b9052d87975715d4ccabff57f26a58 | 12,756 | py | Python | LaserRender.py | gsboylan/meerk40t | 7607b034368a428dfc5cab56629032d6074c756d | [
"MIT"
] | null | null | null | LaserRender.py | gsboylan/meerk40t | 7607b034368a428dfc5cab56629032d6074c756d | [
"MIT"
] | null | null | null | LaserRender.py | gsboylan/meerk40t | 7607b034368a428dfc5cab56629032d6074c756d | [
"MIT"
] | null | null | null | from math import floor
import wx
from PIL import Image
from ZMatrix import ZMatrix
from svgelements import *
"""
Laser Render provides GUI relevant methods of displaying the given project.
"""
DRAW_MODE_FILLS = 0x000001
DRAW_MODE_GUIDES = 0x000002
DRAW_MODE_GRID = 0x000004
DRAW_MODE_LASERPATH = 0x000... | 37.189504 | 94 | 0.541863 | from math import floor
import wx
from PIL import Image
from ZMatrix import ZMatrix
from svgelements import *
DRAW_MODE_FILLS = 0x000001
DRAW_MODE_GUIDES = 0x000002
DRAW_MODE_GRID = 0x000004
DRAW_MODE_LASERPATH = 0x000008
DRAW_MODE_RETICLE = 0x000010
DRAW_MODE_SELECTION = 0x000020
DRAW_MODE_STROKES = ... | true | true |
f72c09ef26d7bd7db7719016288f760059b46e7e | 561 | py | Python | starry_night.py | weijun-github/some-python-codes | db3d4b4ceb8b7c8ce0bd4b61da6227cd9e994718 | [
"MIT"
] | null | null | null | starry_night.py | weijun-github/some-python-codes | db3d4b4ceb8b7c8ce0bd4b61da6227cd9e994718 | [
"MIT"
] | null | null | null | starry_night.py | weijun-github/some-python-codes | db3d4b4ceb8b7c8ce0bd4b61da6227cd9e994718 | [
"MIT"
] | null | null | null | from turtle import *
from random import randint, random
def draw_star(points,size,col,x,y):
penup()
goto(x,y)
pendown()
angle = 180 - (180 / points)
color(col)
begin_fill()
for i in range(points):
forward(size)
right(angle)
end_fill()
# main code
Screen(... | 20.777778 | 39 | 0.57041 | from turtle import *
from random import randint, random
def draw_star(points,size,col,x,y):
penup()
goto(x,y)
pendown()
angle = 180 - (180 / points)
color(col)
begin_fill()
for i in range(points):
forward(size)
right(angle)
end_fill()
Screen().bgcolor("da... | true | true |
f72c09f7de9a8713a8c125758c01f1bfe2118188 | 13,359 | py | Python | fanficfare/adapters/adapter_bloodtiesfancom.py | Kolbo5/FanFicFare | cf2ae9b12631bfeeb9198ca686f9e58d4579aeb3 | [
"Apache-2.0"
] | null | null | null | fanficfare/adapters/adapter_bloodtiesfancom.py | Kolbo5/FanFicFare | cf2ae9b12631bfeeb9198ca686f9e58d4579aeb3 | [
"Apache-2.0"
] | null | null | null | fanficfare/adapters/adapter_bloodtiesfancom.py | Kolbo5/FanFicFare | cf2ae9b12631bfeeb9198ca686f9e58d4579aeb3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2011 Fanficdownloader team, 2018 FanFicFare team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 40.853211 | 157 | 0.601991 |
from __future__ import absolute_import
import logging
logger = logging.getLogger(__name__)
import re
from bs4.element import Tag
from ..htmlcleanup import stripHTML
from .. import exceptions as exceptions
from ..six import text_type as unicode
from ..six.moves.urllib.error import HTTPError
from .base_adapter import... | true | true |
f72c0a308bec3bcb670b9a62046fd98d6431cf98 | 109 | py | Python | callbacks/__init__.py | ivancreator/sgotgbot | fea3a8234610d1dee473688959167f430d43ad75 | [
"MIT"
] | null | null | null | callbacks/__init__.py | ivancreator/sgotgbot | fea3a8234610d1dee473688959167f430d43ad75 | [
"MIT"
] | null | null | null | callbacks/__init__.py | ivancreator/sgotgbot | fea3a8234610d1dee473688959167f430d43ad75 | [
"MIT"
] | null | null | null | from aiogram.utils.callback_data import CallbackData
cb_account = CallbackData('account', 'action', 'value') | 36.333333 | 55 | 0.798165 | from aiogram.utils.callback_data import CallbackData
cb_account = CallbackData('account', 'action', 'value') | true | true |
f72c0a6ac92672124a848a9846ceb3739ebe1129 | 6,194 | py | Python | module/LP.py | banboooo044/optimization | a15614b367712d6046311eac311214d27999fc7c | [
"MIT"
] | null | null | null | module/LP.py | banboooo044/optimization | a15614b367712d6046311eac311214d27999fc7c | [
"MIT"
] | null | null | null | module/LP.py | banboooo044/optimization | a15614b367712d6046311eac311214d27999fc7c | [
"MIT"
] | null | null | null | # date : 2/11/2019
# author : takeshi
import pandas as pd
import numpy as np
from IPython.display import display
def linprog(c,A,comp,b,maximize=True):
'''
Maximize(or Minimize) a linear objective function subject to linear equality and inequality constraints.
Linear Programming is intended to solve the f... | 34.99435 | 118 | 0.56474 | import pandas as pd
import numpy as np
from IPython.display import display
def linprog(c,A,comp,b,maximize=True):
def optimize(table,target):
if not __debug__:
if target == 'w':
print("Phase 1 : find initial solution")
else:
if maximize:
... | true | true |
f72c0bf5b4bcb72b7e7dd97debcab75606cc1e94 | 4,894 | py | Python | Widgets/openGL_widgets/VectorGLContext.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | Widgets/openGL_widgets/VectorGLContext.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | Widgets/openGL_widgets/VectorGLContext.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QWidget
from Widgets.openGL_widgets.AbstractGLContext import AbstractGLContext
from ColorPolicy import ColorPolicy
from ctypes import c_void_p
from PyQt5.Qt import Qt
from PyQt5.QtCore import QPoint, QThread
from cython_modules.color_policy import multi_iteration_normalize
from pattern_t... | 38.84127 | 86 | 0.626481 | from PyQt5.QtWidgets import QWidget
from Widgets.openGL_widgets.AbstractGLContext import AbstractGLContext
from ColorPolicy import ColorPolicy
from ctypes import c_void_p
from PyQt5.Qt import Qt
from PyQt5.QtCore import QPoint, QThread
from cython_modules.color_policy import multi_iteration_normalize
from pattern_t... | true | true |
f72c0c49d7421b18eade26ce7db864b767a81dcd | 6,768 | py | Python | tests/infra/runner.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | tests/infra/runner.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | tests/infra/runner.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import getpass
import time
import http
import logging
from random import seed
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
from loguru import logger as LO... | 35.067358 | 157 | 0.553783 | import getpass
import time
import http
import logging
from random import seed
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
from loguru import logger as LOG
logging.getLogger("matplotlib").setLevel(logging.WARNING)
logging.getLogger("paramiko").setLevel(l... | true | true |
f72c0cf297fb6c440eea6a74e7fd555334feff9a | 558 | py | Python | src/Product.py | AbdulMutakabbir/CCH-manufacturing-facility-simulator | ffc1b294eecf69c940b04bfc3d66ef58c7b63de6 | [
"MIT"
] | null | null | null | src/Product.py | AbdulMutakabbir/CCH-manufacturing-facility-simulator | ffc1b294eecf69c940b04bfc3d66ef58c7b63de6 | [
"MIT"
] | null | null | null | src/Product.py | AbdulMutakabbir/CCH-manufacturing-facility-simulator | ffc1b294eecf69c940b04bfc3d66ef58c7b63de6 | [
"MIT"
] | null | null | null | # holds the data and methods for products
class Product:
__type: int = None # specifies P1 or P2
# Constructor:
# Inputs:
# p_type:int -> Product Type
def __init__(self, p_type):
if (p_type is not None) and (p_type >= 0) and (p_type <= 3):
self.__type = p_type
el... | 26.571429 | 68 | 0.586022 | class Product:
__type: int = None
def __init__(self, p_type):
if (p_type is not None) and (p_type >= 0) and (p_type <= 3):
self.__type = p_type
else:
raise Exception("ProductTypeError")
def get_type(self):
if self.__type is None:
... | true | true |
f72c0d36cca4aa60ffe71a6c3374a1be477a7388 | 21,847 | py | Python | universe/rewarder/rewarder_session.py | BitJetKit/universe | cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c | [
"MIT"
] | 8,120 | 2016-12-05T06:37:45.000Z | 2022-03-21T14:45:20.000Z | universe/rewarder/rewarder_session.py | BitJetKit/universe | cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c | [
"MIT"
] | 213 | 2016-12-05T09:57:37.000Z | 2018-04-05T18:55:14.000Z | universe/rewarder/rewarder_session.py | BitJetKit/universe | cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c | [
"MIT"
] | 1,140 | 2016-12-05T06:50:43.000Z | 2022-03-23T08:28:32.000Z | from autobahn.twisted import websocket
import logging
import numpy as np
import threading
import time
from twisted.python import failure
from twisted.internet import defer, endpoints
import twisted.internet.error
from universe import utils
from universe.twisty import reactor
from universe.rewarder import connection_t... | 42.339147 | 245 | 0.602875 | from autobahn.twisted import websocket
import logging
import numpy as np
import threading
import time
from twisted.python import failure
from twisted.internet import defer, endpoints
import twisted.internet.error
from universe import utils
from universe.twisty import reactor
from universe.rewarder import connection_t... | true | true |
f72c0d7a15cd90ef41611423f1b1643e68712a61 | 2,372 | py | Python | discord/enums.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | discord/enums.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | discord/enums.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Copyright (c) 2021-present tag-epic
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
t... | 76.516129 | 623 | 0.802277 |
from glowcord.enums import ActivityType, Any, AuditLogAction, AuditLogActionCategory, ButtonStyle, ChannelType, ClassVar, ComponentType, ContentFilter, DefaultAvatar, Dict, Enum, EnumMeta, ExpireBehavior, ExpireBehaviour, InteractionResponseType, InteractionType, InviteTarget, List, MessageType, NSFWLevel, Notificatio... | true | true |
f72c0e67908a76e0ea66de8a4f836e96cdcb736d | 2,393 | py | Python | plugins/hw_wallet/plugin.py | futuro-coin/electrum-futuro | 04910904a6d4d330f202daf0c1975b8296ad8e5d | [
"MIT"
] | 4 | 2019-01-16T14:30:39.000Z | 2021-10-21T04:21:45.000Z | plugins/hw_wallet/plugin.py | futuro-coin/electrum-futuro | 04910904a6d4d330f202daf0c1975b8296ad8e5d | [
"MIT"
] | 1 | 2021-11-15T17:47:31.000Z | 2021-11-15T17:47:31.000Z | plugins/hw_wallet/plugin.py | futuro-coin/electrum-futuro | 04910904a6d4d330f202daf0c1975b8296ad8e5d | [
"MIT"
] | 2 | 2018-12-18T17:32:46.000Z | 2019-01-16T14:30:42.000Z | #!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Futurocoin client
# Copyright (C) 2016 The Electrum developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software with... | 39.229508 | 80 | 0.72921 |
from electrum.plugins import BasePlugin, hook
from electrum.i18n import _
class HW_PluginBase(BasePlugin):
def __init__(self, parent, config, name):
BasePlugin.__init__(self, parent, config, name)
self.device = self.keystore_class.device
self.keystore_class.plugin = s... | true | true |
f72c0ea16de779f16beca6532d9f0bc2298b0a63 | 214 | py | Python | embiggen/sequences/generic_sequences/__init__.py | monarch-initiative/N2V | 8ae02ca125f1d24ca158c2849f2d9bb1711920b9 | [
"BSD-3-Clause"
] | 2 | 2020-01-30T11:57:37.000Z | 2020-05-02T00:05:49.000Z | embiggen/sequences/generic_sequences/__init__.py | monarch-initiative/N2V | 8ae02ca125f1d24ca158c2849f2d9bb1711920b9 | [
"BSD-3-Clause"
] | 93 | 2020-01-26T00:43:51.000Z | 2020-05-10T03:29:54.000Z | embiggen/sequences/generic_sequences/__init__.py | monarch-initiative/N2V | 8ae02ca125f1d24ca158c2849f2d9bb1711920b9 | [
"BSD-3-Clause"
] | 5 | 2020-02-13T07:18:11.000Z | 2020-03-19T08:03:34.000Z | """Module providing generic sequences that are used throught Embiggen."""
from embiggen.sequences.generic_sequences.edge_prediction_sequence import EdgePredictionSequence
__all__ = [
"EdgePredictionSequence"
] | 35.666667 | 96 | 0.827103 | from embiggen.sequences.generic_sequences.edge_prediction_sequence import EdgePredictionSequence
__all__ = [
"EdgePredictionSequence"
] | true | true |
f72c0f9f033cd93ca71e3dcc3956bdced61ba742 | 11,944 | py | Python | nngp/nngp.py | chrhenning/uncertainty_based_ood | 13c0b9910966544527497497f6ff0441d5334591 | [
"Apache-2.0"
] | null | null | null | nngp/nngp.py | chrhenning/uncertainty_based_ood | 13c0b9910966544527497497f6ff0441d5334591 | [
"Apache-2.0"
] | null | null | null | nngp/nngp.py | chrhenning/uncertainty_based_ood | 13c0b9910966544527497497f6ff0441d5334591 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Christian Henning
#
# 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 l... | 39.681063 | 80 | 0.602646 | import torch
from warnings import warn
def inference_with_isotropic_gaussian_ll(Y, K_train, K_test, K_all, var=1e-10,
L_mat=None, return_cov=False):
m = K_train.shape[0] if L_mat is None else L_mat.shape[0]
n = K_test.shape[0]
assert Y.numel() == m
assert K_all.... | true | true |
f72c0fcbfb5b7caec767f2ca3b4965a9ad74ab72 | 814 | py | Python | python/173.binary-search-tree-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | 1 | 2019-04-11T12:34:55.000Z | 2019-04-11T12:34:55.000Z | python/173.binary-search-tree-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | python/173.binary-search-tree-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=173 lang=python3
#
# [173] 二叉搜索树迭代器
#
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class BSTIterator:
def __init__(self, root: TreeNode):
self.stack = []
if root is not None:
self.stack.ap... | 19.380952 | 41 | 0.545455 | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class BSTIterator:
def __init__(self, root: TreeNode):
self.stack = []
if root is not None:
self.stack.append(root)
def next(self) -> int:
node = sel... | true | true |
f72c101791b5714dbca430af69817d1077ddde46 | 307 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/targets/Target_IC.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/targets/Target_IC.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/targets/Target_IC.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | from pyradioconfig.calculator_model_framework.interfaces.itarget import ITarget
class Target_IC_Nixi(ITarget):
_targetName = ITarget.IC_str
_description = ""
_store_config_output = True
_cfg_location = "nixi"
_tag = ITarget.IC_str
def target_calculate(self, model):
pass
| 21.928571 | 79 | 0.732899 | from pyradioconfig.calculator_model_framework.interfaces.itarget import ITarget
class Target_IC_Nixi(ITarget):
_targetName = ITarget.IC_str
_description = ""
_store_config_output = True
_cfg_location = "nixi"
_tag = ITarget.IC_str
def target_calculate(self, model):
pass
| true | true |
f72c107476fbdd546cdfa11afec00d68c3ac2c51 | 6,189 | py | Python | test/tools/test_tools_jobs.py | Gizmokid2005/sopel | 249a05ab7c6ccb3fb0388e3194514b19897e6990 | [
"EFL-2.0"
] | 555 | 2015-07-25T21:21:43.000Z | 2022-03-28T02:22:38.000Z | test/tools/test_tools_jobs.py | Gizmokid2005/sopel | 249a05ab7c6ccb3fb0388e3194514b19897e6990 | [
"EFL-2.0"
] | 1,177 | 2015-07-31T09:52:31.000Z | 2022-03-26T05:10:34.000Z | test/tools/test_tools_jobs.py | MirahezeBots/sopel | 72aa4fa5bc0bda3cd309ae9c15e86088b29de903 | [
"EFL-2.0"
] | 406 | 2015-07-28T20:34:02.000Z | 2022-03-18T00:37:01.000Z | """Tests for Job Scheduler"""
from __future__ import generator_stop
import time
import pytest
from sopel import loader, plugin
from sopel.tools import jobs
TMP_CONFIG = """
[core]
owner = Bar
nick = Sopel
enable = coretasks
"""
class WithJobMockException(Exception):
pass
@pytest.fixture
def mockconfig(conf... | 23.895753 | 78 | 0.63112 | from __future__ import generator_stop
import time
import pytest
from sopel import loader, plugin
from sopel.tools import jobs
TMP_CONFIG = """
[core]
owner = Bar
nick = Sopel
enable = coretasks
"""
class WithJobMockException(Exception):
pass
@pytest.fixture
def mockconfig(configfactory):
return configf... | true | true |
f72c10ad899fc5c2be354213a6c67529edd4ffb0 | 4,949 | py | Python | arco.py | TunkShif/Arco | ae782e77f82b7fd685ede587e659f96a69ec3a87 | [
"MIT"
] | null | null | null | arco.py | TunkShif/Arco | ae782e77f82b7fd685ede587e659f96a69ec3a87 | [
"MIT"
] | null | null | null | arco.py | TunkShif/Arco | ae782e77f82b7fd685ede587e659f96a69ec3a87 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Arco CLI
Usage:
arco (new | n) -t <title> -g <category> -f <filename>
arco (generate | g)
arco (deploy | d)
arco -h | --help
arco -v | --version
Subcommands:
new Create a new blank page
generate Generate pages
deploy ... | 33.666667 | 78 | 0.555668 | import os
import json
import markdown
from docopt import docopt
class Utils(object):
def mkdir(self, path):
os.mkdir(path)
print(f'INFO: Folder {path} created!')
def read_file(self, file):
with open(file, 'r') as f:
return f.read()
def write_file(self, file, content):... | true | true |
f72c11ddf5cf9792898f16eb88c27c05d0a7fa22 | 121 | py | Python | modules/utility/exit_failure.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | 4 | 2020-09-23T07:11:41.000Z | 2022-02-02T09:08:21.000Z | modules/utility/exit_failure.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | 5 | 2021-08-29T18:23:01.000Z | 2021-11-20T03:53:19.000Z | modules/utility/exit_failure.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | null | null | null | import sys
import typing
import colorama
def exit_failure() -> typing.NoReturn:
colorama.deinit()
sys.exit(1)
| 12.1 | 38 | 0.710744 | import sys
import typing
import colorama
def exit_failure() -> typing.NoReturn:
colorama.deinit()
sys.exit(1)
| true | true |
f72c12cb5d888c460ea2425493c4ccae0a17c163 | 2,097 | py | Python | third_party/catapult/dashboard/dashboard/pinpoint/models/quest/run_telemetry_test.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/catapult/dashboard/dashboard/pinpoint/models/quest/run_telemetry_test.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/catapult/dashboard/dashboard/pinpoint/models/quest/run_telemetry_test.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Quest for running a Telemetry benchmark in Swarming."""
import copy
from dashboard.pinpoint.models.quest import run_test
_DEFAULT_EXTRA_ARGS = [
'... | 34.377049 | 78 | 0.69051 |
import copy
from dashboard.pinpoint.models.quest import run_test
_DEFAULT_EXTRA_ARGS = [
'-v', '--upload-results', '--output-format', 'histograms']
class RunTelemetryTest(run_test.RunTest):
def Start(self, change, isolate_server, isolate_hash):
extra_args = copy.copy(self._extra_args)
extr... | true | true |
f72c12d312063efabbecedfddb86898a11b4cc57 | 750 | py | Python | sdk/python/pulumi_aws_native/networkmanager/__init__.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/networkmanager/__init__.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/networkmanager/__init__.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from .customer_gateway_association import *
from .device import *
f... | 31.25 | 80 | 0.777333 |
from .. import _utilities
import typing
# Export this package's modules as members:
from .customer_gateway_association import *
from .device import *
from .get_customer_gateway_association import *
from .get_device import *
from .get_global_network import *
from .get_link import *
from .get_link_association import *
f... | true | true |
f72c136f7e297c4a25e30f41fa955aa92ac206dd | 28,541 | py | Python | python/ray/autoscaler/_private/command_runner.py | chinganc/ray | f91c4555270cbcb86adc6c41a9074e2f69721aad | [
"Apache-2.0"
] | null | null | null | python/ray/autoscaler/_private/command_runner.py | chinganc/ray | f91c4555270cbcb86adc6c41a9074e2f69721aad | [
"Apache-2.0"
] | null | null | null | python/ray/autoscaler/_private/command_runner.py | chinganc/ray | f91c4555270cbcb86adc6c41a9074e2f69721aad | [
"Apache-2.0"
] | null | null | null | from getpass import getuser
from shlex import quote
from typing import Dict
import click
import hashlib
import json
import logging
import os
import subprocess
import sys
import time
import warnings
from ray.autoscaler.command_runner import CommandRunnerInterface
from ray.autoscaler._private.docker import check_bind_mo... | 39.750696 | 79 | 0.566063 | from getpass import getuser
from shlex import quote
from typing import Dict
import click
import hashlib
import json
import logging
import os
import subprocess
import sys
import time
import warnings
from ray.autoscaler.command_runner import CommandRunnerInterface
from ray.autoscaler._private.docker import check_bind_mo... | true | true |
f72c13cb90eedb34f57932aeb5a75dd0d3d17462 | 9,968 | py | Python | paddlex/ppdet/modeling/assigners/atss_assigner.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 8 | 2020-03-11T08:12:19.000Z | 2020-03-18T08:33:56.000Z | paddlex/ppdet/modeling/assigners/atss_assigner.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 1 | 2020-03-15T13:05:43.000Z | 2020-03-15T13:05:43.000Z | paddlex/ppdet/modeling/assigners/atss_assigner.py | cheneyveron/PaddleX | 86f73fc6a66b12c638f642524bfd1cf730e26c4b | [
"Apache-2.0"
] | 2 | 2020-03-15T11:53:54.000Z | 2020-03-24T07:27:09.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 47.018868 | 97 | 0.634129 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddlex.ppdet.core.workspace import register
from ..ops import iou_similarity
from ..bbox_utils import bbox_center... | true | true |
f72c141ee52744b76809f89d01d00892da4316b0 | 1,625 | py | Python | models/heads/linear.py | lucasmtz/ACAR-Net | 08a224625f04bbf595baaeb1c79ec491642e0059 | [
"Apache-2.0"
] | null | null | null | models/heads/linear.py | lucasmtz/ACAR-Net | 08a224625f04bbf595baaeb1c79ec491642e0059 | [
"Apache-2.0"
] | null | null | null | models/heads/linear.py | lucasmtz/ACAR-Net | 08a224625f04bbf595baaeb1c79ec491642e0059 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torchvision
__all__ = ["linear"]
class LinearHead(nn.Module):
def __init__(self, width, roi_spatial=7, num_classes=60, dropout=0.0, bias=False):
super().__init__()
self.roi_spatial = roi_spatial
self.roi_maxpool = nn.MaxPool2d(roi_spatial)
... | 28.017241 | 100 | 0.549538 | import torch
import torch.nn as nn
import torchvision
__all__ = ["linear"]
class LinearHead(nn.Module):
def __init__(self, width, roi_spatial=7, num_classes=60, dropout=0.0, bias=False):
super().__init__()
self.roi_spatial = roi_spatial
self.roi_maxpool = nn.MaxPool2d(roi_spatial)
... | true | true |
f72c167153faf45427e82959b2fabf65122a99b7 | 3,730 | py | Python | lib/follower.py | bopopescu/ros | 5dc6e23a280e1283de7b38f35116332a79ca33d2 | [
"MIT"
] | null | null | null | lib/follower.py | bopopescu/ros | 5dc6e23a280e1283de7b38f35116332a79ca33d2 | [
"MIT"
] | null | null | null | lib/follower.py | bopopescu/ros | 5dc6e23a280e1283de7b38f35116332a79ca33d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 by Murray Altheim. All rights reserved. This file is part of
# the Robot OS project and is released under the "Apache Licence, Version 2.0".
# Please see the LICENSE file included as part of this package.
#
# author: altheim
# created: 2020-03-31
# mo... | 33.603604 | 132 | 0.538606 |
import time
from colorama import init, Fore, Style
init()
try:
import numpy
except ImportError:
exit("This script requires the numpy module\nInstall with: sudo pip3 install numpy")
from lib.tof import TimeOfFlight, Range
from lib.enums import Orientation
from lib.servo import Servo
from lib.logger import Log... | true | true |
f72c18024f079862885e04b1184e3b2d20a53ce4 | 312 | py | Python | src/Aula15ex67Tabuada.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | src/Aula15ex67Tabuada.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | src/Aula15ex67Tabuada.py | maberf/python | 0d36f1586c5f52081c2b27d42a1d37cee13116b0 | [
"MIT"
] | null | null | null | # TABUADA
#Mostra a tabuada de vários números, um de cada vez
#O programa encerra quando o número digitado é negativo
while True:
num = int(input('Número? '))
print('=' * 10)
if num < 0:
break
for i in range(1, 11):
print(f'{num} x {i} = {num * i}')
print('='*10)
print('Fim') | 26 | 55 | 0.580128 | while True:
num = int(input('Número? '))
print('=' * 10)
if num < 0:
break
for i in range(1, 11):
print(f'{num} x {i} = {num * i}')
print('='*10)
print('Fim') | true | true |
f72c197e8fe4e17b1d25cf875d15b358ebf7e019 | 3,413 | py | Python | Dataproc/synth.py | Firehed/google-cloud-php | 5c49ed7a36c276fc59a9eaf9a03db4cd522b6932 | [
"Apache-2.0"
] | 1 | 2019-11-17T06:56:43.000Z | 2019-11-17T06:56:43.000Z | Dataproc/synth.py | Firehed/google-cloud-php | 5c49ed7a36c276fc59a9eaf9a03db4cd522b6932 | [
"Apache-2.0"
] | null | null | null | Dataproc/synth.py | Firehed/google-cloud-php | 5c49ed7a36c276fc59a9eaf9a03db4cd522b6932 | [
"Apache-2.0"
] | 1 | 2019-10-16T03:38:59.000Z | 2019-10-16T03:38:59.000Z | # Copyright 2018 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 agreed to in writing, s... | 29.17094 | 94 | 0.658951 |
import os
import synthtool as s
import synthtool.gcp as gcp
import logging
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
common = gcp.CommonTemplates()
for version in ['V1', 'V1beta2']:
lower_version = version.lower()
library = gapic.php_library(
service='dataproc',
... | true | true |
f72c198a930ed3f71634b2475161d1817b4821ff | 12,725 | py | Python | simulacionPlanificador.py | inakiuy/teoria-de-la-computacion | e9087e70622a72b8ddd44a3552f13c0e1794587d | [
"MIT"
] | null | null | null | simulacionPlanificador.py | inakiuy/teoria-de-la-computacion | e9087e70622a72b8ddd44a3552f13c0e1794587d | [
"MIT"
] | null | null | null | simulacionPlanificador.py | inakiuy/teoria-de-la-computacion | e9087e70622a72b8ddd44a3552f13c0e1794587d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import deque
import random
SETS = 3 # Cantidad de sets generados
TASKS_CREATED = 10 # Cantidad de tareas creadas por cada set
MAX_SERVICETIME = 100 # Maximo Tiempo de Servicio de una tarea. 28800 = 8h
MAX_SERVICELIST_SIZE = 4 # Maxima canitad de... | 40.015723 | 275 | 0.595521 | from collections import deque
import random
SETS = 3 TASKS_CREATED = 10 MAX_SERVICETIME = 100 MAX_SERVICELIST_SIZE = 4 MAX_TIMEOUT = 150 DIA_TRABAJO = 300 MAX_TIME = 3000 ALGO = "fcfs" INTERVALO_LOG = 1500
class Tarea:
def __ini... | true | true |
f72c19b9cb3d05c83471ebe6d0f7ab647fcf3c80 | 5,478 | py | Python | saas/api/backend.py | markcstansberry/djaodjin-saas | 0749dac36c3b039334fe9f115d92b3167eea03d6 | [
"BSD-2-Clause"
] | null | null | null | saas/api/backend.py | markcstansberry/djaodjin-saas | 0749dac36c3b039334fe9f115d92b3167eea03d6 | [
"BSD-2-Clause"
] | 4 | 2021-04-08T21:56:58.000Z | 2022-02-10T13:26:56.000Z | saas/api/backend.py | markcstansberry/djaodjin-saas | 0749dac36c3b039334fe9f115d92b3167eea03d6 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2019, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 30.949153 | 78 | 0.667579 |
from rest_framework import status
from rest_framework.exceptions import ValidationError
from rest_framework.generics import (RetrieveAPIView,
RetrieveUpdateDestroyAPIView)
from rest_framework.response import Response
from ..backends import ProcessorError
from ..docs import swagger_auto_schema
from ..mixins impor... | true | true |
f72c1a54af7f21cf6b27146291cd2fe43fcaa17f | 11,489 | py | Python | src/maggma/api/query_operator.py | wuxiaohua1011/maggma | b7a059b2d12d9b96aa2092c40eb41f121c0a598b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/maggma/api/query_operator.py | wuxiaohua1011/maggma | b7a059b2d12d9b96aa2092c40eb41f121c0a598b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/maggma/api/query_operator.py | wuxiaohua1011/maggma | b7a059b2d12d9b96aa2092c40eb41f121c0a598b | [
"BSD-3-Clause-LBNL"
] | null | null | null | from typing import List, Dict, Optional, Any, Mapping
from pydantic import BaseModel
from fastapi import Query
from monty.json import MSONable
from maggma.core import Store
from maggma.api.util import STORE_PARAMS, dynamic_import
from pydantic.fields import ModelField
import inspect
import warnings
class QueryOperato... | 35.242331 | 117 | 0.542606 | from typing import List, Dict, Optional, Any, Mapping
from pydantic import BaseModel
from fastapi import Query
from monty.json import MSONable
from maggma.core import Store
from maggma.api.util import STORE_PARAMS, dynamic_import
from pydantic.fields import ModelField
import inspect
import warnings
class QueryOperato... | true | true |
f72c1ab1de5a5c97a92db41310f7ac5f79e19552 | 4,330 | py | Python | bika/lims/browser/artemplate.py | hocinebendou/bika.gsoc | 85bc0c587de7f52073ae0e89bddbc77bf875f295 | [
"MIT"
] | null | null | null | bika/lims/browser/artemplate.py | hocinebendou/bika.gsoc | 85bc0c587de7f52073ae0e89bddbc77bf875f295 | [
"MIT"
] | null | null | null | bika/lims/browser/artemplate.py | hocinebendou/bika.gsoc | 85bc0c587de7f52073ae0e89bddbc77bf875f295 | [
"MIT"
] | null | null | null | from bika.lims.interfaces import IJSONReadExtender, IARTemplate
from zope.component import adapts
from zope.interface import implements
class JSONReadExtender(object):
"""- Place additional information about profile services
into the returned records.
Used in AR Add to prevent extra requests
"""
... | 38.318584 | 83 | 0.526328 | from bika.lims.interfaces import IJSONReadExtender, IARTemplate
from zope.component import adapts
from zope.interface import implements
class JSONReadExtender(object):
implements(IJSONReadExtender)
adapts(IARTemplate)
def __init__(self, context):
self.context = context
def render_template_p... | true | true |
f72c1c45126418c8a2273a6fc96e135d6bcf4da8 | 22,915 | py | Python | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_group_list.py | cvicens/lab-knative | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | [
"Apache-2.0"
] | null | null | null | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_group_list.py | cvicens/lab-knative | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | [
"Apache-2.0"
] | null | null | null | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_group_list.py | cvicens/lab-knative | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: openshift_v1_group_list
short_description: OpenShift GroupList
description:
- Retrieve a list of groups. List operations provide a snapshot read of ... | 47.247423 | 100 | 0.560201 |
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: openshift_v1_group_list
short_description: OpenShift GroupList
description:
- Retrieve a list of groups. List operations provide a snapshot read of the underlying
objects, returning a reso... | true | true |
f72c1d801a02316cde52c7ee09431a992b7ae36e | 2,353 | py | Python | research/delf/delf/python/examples/detector.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 6 | 2020-01-15T09:55:24.000Z | 2021-04-22T09:03:46.000Z | research/delf/delf/python/examples/detector.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 10 | 2019-12-28T21:31:19.000Z | 2020-04-12T20:01:58.000Z | research/delf/delf/python/examples/detector.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 8 | 2020-04-12T04:30:33.000Z | 2021-09-17T20:54:44.000Z | # Copyright 2019 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.349206 | 80 | 0.663408 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def MakeDetector(sess, model_dir, import_scope=None):
tf.saved_model.loader.load(
sess, [tf.saved_model.tag_constants.SERVING],
model_dir,
import_scope=import_scop... | true | true |
f72c1f06d6b7f222137806f0a368da2e76782f5f | 1,411 | py | Python | project-EE/run_cleaning.py | Mariagca/EscapeEarth | 5c57ff9dc1a1aed8a3d74d664287f54746c85dff | [
"MIT"
] | 2 | 2020-10-08T20:47:36.000Z | 2020-12-12T22:20:41.000Z | project-EE/run_cleaning.py | Mariagca/EscapeEarth | 5c57ff9dc1a1aed8a3d74d664287f54746c85dff | [
"MIT"
] | null | null | null | project-EE/run_cleaning.py | Mariagca/EscapeEarth | 5c57ff9dc1a1aed8a3d74d664287f54746c85dff | [
"MIT"
] | 6 | 2020-10-08T21:18:23.000Z | 2020-10-08T21:34:35.000Z | #imports
import cleaning_modules as cm
import os
#BE SURE TO CHOOSE OR AMEND THE 'rawdatapath' & 'filename_danielle' paths for your computer!!
# our inputs
tic_list = [7582594, 7582633, 7620704, 7618785, 7584049]
sectornumber = 14
rawdatapath = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/'
rawdatapath_danie... | 45.516129 | 110 | 0.764706 | import cleaning_modules as cm
import os
tic_list = [7582594, 7582633, 7620704, 7618785, 7584049]
sectornumber = 14
rawdatapath = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/'
rawdatapath_danielle = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/'
cleandata, cleanticids = cm.Dataclean(tic_list,sectornum... | true | true |
f72c1f9c72b57af7309945959a0c4b2f24dee261 | 631 | py | Python | elk_project/manage.py | joyliao07/elk | c697d6847c57c0e7f3b4dc71a373c5fe0407e237 | [
"MIT"
] | null | null | null | elk_project/manage.py | joyliao07/elk | c697d6847c57c0e7f3b4dc71a373c5fe0407e237 | [
"MIT"
] | 7 | 2019-12-04T23:17:25.000Z | 2021-06-09T17:54:51.000Z | elk_project/manage.py | joyliao07/elk | c697d6847c57c0e7f3b4dc71a373c5fe0407e237 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'elk_project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... | 28.681818 | 75 | 0.684628 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'elk_project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f72c1fde1011d3abd20dca04a582e9d40af5f026 | 911 | py | Python | heap sort.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | heap sort.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | heap sort.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[4]:
def heapify(arr, n, i):
largest = i # Initialize largest as root
l = 2 * i + 1 # left = 2*i + 1
r = 2 * i + 2 # right = 2*i + 2
if l < n and arr[i] < arr[l]:
largest = l
if r < n and arr[largest] < arr[r]:
largest = r
if largest != i:
arr[i],ar... | 17.862745 | 51 | 0.556531 |
def heapify(arr, n, i):
largest = i l = 2 * i + 1 r = 2 * i + 2
if l < n and arr[i] < arr[l]:
largest = l
if r < n and arr[largest] < arr[r]:
largest = r
if largest != i:
arr[i],arr[largest] = arr[largest],arr[i]
heapify(arr, n, largest)
def heapSort(arr):
n = len(arr)
for i in... | true | true |
f72c206e11dd63945aef32da40727635e29f68fe | 3,204 | py | Python | tests/sources/test_url.py | mikewcasale/climetlab | 924aa602dcd638ff1a49a9d8b4b6f7bd29361d1e | [
"Apache-2.0"
] | null | null | null | tests/sources/test_url.py | mikewcasale/climetlab | 924aa602dcd638ff1a49a9d8b4b6f7bd29361d1e | [
"Apache-2.0"
] | null | null | null | tests/sources/test_url.py | mikewcasale/climetlab | 924aa602dcd638ff1a49a9d8b4b6f7bd29361d1e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its statu... | 28.607143 | 88 | 0.652934 |
import datetime
import mimetypes
import os
import sys
import pytest
from climetlab import load_source
from climetlab.sources.url import canonical_extension
from climetlab.testing import climetlab_file
@pytest.mark.skipif( sys.platform == "win32",
reason="file:// not working on Windows yet",
)
def test_ur... | true | true |
f72c2077893d50552e9dcf77f984503151020b67 | 2,825 | py | Python | Testing/Alignment.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | Testing/Alignment.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | Testing/Alignment.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, w... | 27.163462 | 79 | 0.593982 |
from pagebot.toolbox.color import color
from pagebot import getContext
EXPORT_PATH = '_export/Start'
EXPORT_PATH_PDF = EXPORT_PATH + '.pdf'
EXPORT_PATH_JPG = EXPORT_PATH + '.jpg'
EXPORT_PATH_PNG = EXPORT_PATH + '.png'
EXPORT_PATH_SVG = EXPORT_PATH + '.svg'
from pagebot.document import Document
from pagebot.elements... | true | true |
f72c210c8aaaf5a73cd82343cc65417943d52979 | 13,090 | py | Python | geofabric/model/catchment.py | CSIRO-enviro-informatics/geofabric-dataset | fbca2c79a8e7532f751fb51bebd3433c42d9f422 | [
"Apache-2.0"
] | 3 | 2019-07-16T14:07:54.000Z | 2020-07-04T17:55:24.000Z | geofabric/model/catchment.py | CSIRO-enviro-informatics/geofabric-dataset | fbca2c79a8e7532f751fb51bebd3433c42d9f422 | [
"Apache-2.0"
] | 24 | 2018-09-20T05:17:32.000Z | 2021-12-13T19:49:50.000Z | geofabric/model/catchment.py | CSIRO-enviro-informatics/geofabric-dataset | fbca2c79a8e7532f751fb51bebd3433c42d9f422 | [
"Apache-2.0"
] | 3 | 2018-10-23T05:58:22.000Z | 2019-11-03T23:04:35.000Z | # -*- coding: utf-8 -*-
#
import rdflib
from urllib.request import Request, urlopen
from flask import render_template, url_for
from lxml.etree import ParseError
from rdflib import URIRef, Literal, BNode
from lxml import etree
from geofabric import _config as config
from geofabric.helpers import gml_extract_geom_to_geoj... | 40.526316 | 126 | 0.572193 | import rdflib
from urllib.request import Request, urlopen
from flask import render_template, url_for
from lxml.etree import ParseError
from rdflib import URIRef, Literal, BNode
from lxml import etree
from geofabric import _config as config
from geofabric.helpers import gml_extract_geom_to_geojson, \
wfs_extract_fea... | true | true |
f72c2280bf4ad25e6907abd6b677f870efbe0e50 | 1,135 | py | Python | src/models/ep.py | tonyduan/ge-vae | fe3325cb643900d09536b3e1d964443d25625781 | [
"MIT"
] | 7 | 2019-11-04T09:13:44.000Z | 2021-04-22T01:28:27.000Z | src/models/ep.py | tonyduan/ge-vae | fe3325cb643900d09536b3e1d964443d25625781 | [
"MIT"
] | null | null | null | src/models/ep.py | tonyduan/ge-vae | fe3325cb643900d09536b3e1d964443d25625781 | [
"MIT"
] | 3 | 2019-11-02T10:50:29.000Z | 2020-02-09T02:50:48.000Z | import torch
import torch.nn as nn
from torch.distributions import Bernoulli
from src.modules.attn import MAB, PMA, SAB, ISAB, ISABStack
from src.utils import *
from src.modules.mlp import *
class EdgePredictor(nn.Module):
def __init__(self, embedding_dim, device):
super().__init__()
self.pairwi... | 35.46875 | 78 | 0.61674 | import torch
import torch.nn as nn
from torch.distributions import Bernoulli
from src.modules.attn import MAB, PMA, SAB, ISAB, ISABStack
from src.utils import *
from src.modules.mlp import *
class EdgePredictor(nn.Module):
def __init__(self, embedding_dim, device):
super().__init__()
self.pairwi... | true | true |
f72c22ad9e0dc3e5f4ab51f0e1e77ab067f3acac | 14,720 | py | Python | CybORG/CybORG/Tests/test_sim/test_Actions/test_BlueActions/test_blue_analyse.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 18 | 2021-08-20T15:07:55.000Z | 2022-03-11T12:05:15.000Z | CybORG/CybORG/Tests/test_sim/test_Actions/test_BlueActions/test_blue_analyse.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 7 | 2021-11-09T06:46:58.000Z | 2022-03-31T12:35:06.000Z | CybORG/CybORG/Tests/test_sim/test_Actions/test_BlueActions/test_blue_analyse.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 13 | 2021-08-17T00:26:31.000Z | 2022-03-29T20:06:45.000Z | # These tests check that the Blue Monitor action is working vs Abstract Red Actions.
# tests need to check that a range of inputs result in the correct changes to the state and return the correct obs
# tests should establish varying environmental states that results in these actions performing differently
import ... | 48.580858 | 114 | 0.640014 |
import inspect
from CybORG import CybORG
from CybORG.Shared.Actions import DiscoverRemoteSystems, DiscoverNetworkServices, ExploitRemoteService, \
PrivilegeEscalate, Impact, Analyse
from CybORG.Shared.Enums import TrinaryEnum, FileType, Path
from CybORG.Tests.EphemeralPort import Win2008EphemeralPort, LinuxEphem... | true | true |
f72c237205ee71fae08437e7206ee77f08a6cd89 | 802 | py | Python | mfgp/task2/init_train_idxs.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | null | null | null | mfgp/task2/init_train_idxs.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | 3 | 2021-08-31T08:53:49.000Z | 2021-10-05T15:10:42.000Z | mfgp/task2/init_train_idxs.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | null | null | null | # Run `init_train_idxs.py <int: dataset size> <int: initial training set size>`:
# Creates a `train_idxs.npz` file with the initial set of training indices.
# e.g `python init_train_idxs.py 64000 1000`
import sys
import numpy as np
from sklearn.model_selection import train_test_split
dataset_size = int(sys.argv[1])... | 40.1 | 115 | 0.794264 |
import sys
import numpy as np
from sklearn.model_selection import train_test_split
dataset_size = int(sys.argv[1])
init_trainset_size = int(sys.argv[2])
validation_set_size = 500
np.random.seed(1)
train_idxs, remaining_idxs = train_test_split(range(dataset_size), train_size = init_trainset_size, random_state=0)
val... | true | true |
f72c2414f2962eb27d54c0fb810c1358dceaa89f | 3,325 | py | Python | tools/visualize_json_results.py | hhy-ee/PedestrianDetection-NohNMS | 482078a6bd0ff8cf03fbf7f6988e475f75c56e57 | [
"Apache-2.0"
] | null | null | null | tools/visualize_json_results.py | hhy-ee/PedestrianDetection-NohNMS | 482078a6bd0ff8cf03fbf7f6988e475f75c56e57 | [
"Apache-2.0"
] | null | null | null | tools/visualize_json_results.py | hhy-ee/PedestrianDetection-NohNMS | 482078a6bd0ff8cf03fbf7f6988e475f75c56e57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import json
import numpy as np
import os
from collections import defaultdict
import cv2
import tqdm
from fvcore.common.file_io import PathManager
from detectron2.data import DatasetCatalog, MetadataCatalog
fro... | 34.635417 | 97 | 0.687519 |
import argparse
import json
import numpy as np
import os
from collections import defaultdict
import cv2
import tqdm
from fvcore.common.file_io import PathManager
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import Boxes, BoxMode, Instances
from detectron2.utils.logger import ... | true | true |
f72c262fa25643ba7ad1ef2d7e89c9bd6e9b9e00 | 1,084 | py | Python | redis_cache/compat.py | fu2re/django-redis-cache | 50807ae71bac0714ee625b443205153e9d917e54 | [
"BSD-3-Clause"
] | null | null | null | redis_cache/compat.py | fu2re/django-redis-cache | 50807ae71bac0714ee625b443205153e9d917e54 | [
"BSD-3-Clause"
] | null | null | null | redis_cache/compat.py | fu2re/django-redis-cache | 50807ae71bac0714ee625b443205153e9d917e54 | [
"BSD-3-Clause"
] | 1 | 2020-02-18T13:20:21.000Z | 2020-02-18T13:20:21.000Z | import sys
import django
PY3 = (sys.version_info >= (3,))
try:
# Django 1.5+
from django.utils.encoding import smart_text, smart_bytes
except ImportError:
# older Django, thus definitely Python 2
from django.utils.encoding import smart_unicode, smart_str
smart_text = smart_unicode
smart_bytes ... | 25.809524 | 89 | 0.714945 | import sys
import django
PY3 = (sys.version_info >= (3,))
try:
from django.utils.encoding import smart_text, smart_bytes
except ImportError:
from django.utils.encoding import smart_unicode, smart_str
smart_text = smart_unicode
smart_bytes = smart_str
if PY3:
bytes_type = bytes
else:
... | true | true |
f72c26bb4fa6463bbf958a86e7df8748e04888fa | 30,608 | py | Python | mwparserfromhell/wikicode.py | TheSandDoctor/mwparserfromhell | de15b8b64497d3386f133400b73dcaf36a131743 | [
"MIT"
] | null | null | null | mwparserfromhell/wikicode.py | TheSandDoctor/mwparserfromhell | de15b8b64497d3386f133400b73dcaf36a131743 | [
"MIT"
] | null | null | null | mwparserfromhell/wikicode.py | TheSandDoctor/mwparserfromhell | de15b8b64497d3386f133400b73dcaf36a131743 | [
"MIT"
] | null | null | null | #
# Copyright (C) 2012-2019 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | 44.945668 | 82 | 0.59785 |
import re
from itertools import chain
from .nodes import (Argument, Comment, ExternalLink, Heading, HTMLEntity,
Node, Tag, Template, Text, Wikilink)
from .smart_list.ListProxy import _ListProxy
from .string_mixin import StringMixIn
from .utils import parse_anything
__all__ = ["Wikicode"]
FLAGS =... | true | true |
f72c27667d2dfd2d0ef541566592c06f430e047b | 147 | py | Python | scene/__init__.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | scene/__init__.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | scene/__init__.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | from .camera import *
from .obj_file import *
from .obj_parser import *
from .ray_tracer import *
from .scene_parser import *
from .world import *
| 21 | 27 | 0.755102 | from .camera import *
from .obj_file import *
from .obj_parser import *
from .ray_tracer import *
from .scene_parser import *
from .world import *
| true | true |
f72c27de3695f8b7dc7c5ae95c8a39f24e92433e | 10,650 | py | Python | darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/update_vnic_details.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/update_vnic_details.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/core/models/update_vnic_details.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | 1 | 2020-06-25T03:12:58.000Z | 2020-06-25T03:12:58.000Z | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 35.264901 | 245 | 0.65615 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class UpdateVnicDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'defined_tags': 'dict(str... | true | true |
f72c287955fbff99748da09097b2149ee342155e | 2,564 | py | Python | smartrecruiters_python_client/models/json_patch.py | roksela/smartrecruiters-python-client | 6d0849d173a3d6718b5f0769098f4c76857f637d | [
"MIT"
] | 5 | 2018-03-27T08:20:13.000Z | 2022-03-30T06:23:38.000Z | smartrecruiters_python_client/models/json_patch.py | roksela/smartrecruiters-python-client | 6d0849d173a3d6718b5f0769098f4c76857f637d | [
"MIT"
] | null | null | null | smartrecruiters_python_client/models/json_patch.py | roksela/smartrecruiters-python-client | 6d0849d173a3d6718b5f0769098f4c76857f637d | [
"MIT"
] | 2 | 2018-12-05T04:48:37.000Z | 2020-12-17T12:12:12.000Z | # coding: utf-8
"""
Unofficial python library for the SmartRecruiters API
The SmartRecruiters API provides a platform to integrate services or applications, build apps and create fully customizable career sites. It exposes SmartRecruiters functionality and allows to connect and build software enhancing it.
... | 27.276596 | 237 | 0.543682 |
from pprint import pformat
from six import iteritems
import re
class JSONPatch(object):
def __init__(self):
self.swagger_types = {
}
self.attribute_map = {
}
def to_dict(self):
result = {}
for attr, _ in iteritems(self.swagger_ty... | true | true |
f72c2931d18a600dc4eaf9f2b95c5f5248adbea1 | 900 | py | Python | transmissionServer.py | crate19970523/yoloKnifeCallPolice- | 47b716dbacdd0d31282d13e0ec957711b3f967ca | [
"MIT"
] | null | null | null | transmissionServer.py | crate19970523/yoloKnifeCallPolice- | 47b716dbacdd0d31282d13e0ec957711b3f967ca | [
"MIT"
] | null | null | null | transmissionServer.py | crate19970523/yoloKnifeCallPolice- | 47b716dbacdd0d31282d13e0ec957711b3f967ca | [
"MIT"
] | null | null | null | #coding:utf-8
from flask import request, Flask
import time
import os
app = Flask(__name__)
@app.route("/", methods=['POST'])
def get_frame():
start_time = time.time()
upload_file = request.files['file']
old_file_name = upload_file.filename
if upload_file:
file_path = os.path.join('./imgtest/', ... | 31.034483 | 77 | 0.622222 | from flask import request, Flask
import time
import os
app = Flask(__name__)
@app.route("/", methods=['POST'])
def get_frame():
start_time = time.time()
upload_file = request.files['file']
old_file_name = upload_file.filename
if upload_file:
file_path = os.path.join('./imgtest/', old_file_name)... | true | true |
f72c298f250b50e48003137adac62548fe42bbfa | 721 | py | Python | tests/test_split_audio_file.py | greenkeytech/greenkey-asrtoolkit | f9a5990ee5c67b85dd8ff763777c986b03252ee5 | [
"Apache-2.0"
] | 31 | 2019-08-03T08:42:37.000Z | 2022-01-12T18:00:11.000Z | tests/test_split_audio_file.py | greenkeytech/greenkey-asrtoolkit | f9a5990ee5c67b85dd8ff763777c986b03252ee5 | [
"Apache-2.0"
] | 28 | 2019-07-29T17:58:17.000Z | 2021-08-20T14:30:25.000Z | tests/test_split_audio_file.py | greenkeytech/greenkey-asrtoolkit | f9a5990ee5c67b85dd8ff763777c986b03252ee5 | [
"Apache-2.0"
] | 12 | 2019-07-29T13:16:41.000Z | 2022-02-20T21:19:35.000Z | #!/usr/bin/env python
"""
Test audio file splitter
"""
import os
from asrtoolkit.split_audio_file import split_audio_file
from utils import get_test_dir
test_dir = get_test_dir(__file__)
def test_split_audio_file():
"""
Test audio file splitter
"""
split_audio_file(
f"{test_dir}/small-test-f... | 20.027778 | 56 | 0.660194 | import os
from asrtoolkit.split_audio_file import split_audio_file
from utils import get_test_dir
test_dir = get_test_dir(__file__)
def test_split_audio_file():
split_audio_file(
f"{test_dir}/small-test-file.mp3",
f"{test_dir}/small-test-file.stm",
f"{test_dir}/split",
)
assert s... | true | true |
f72c29994545a8752c8d6412f035b921d01d390f | 4,755 | py | Python | tests/test_parvec.py | DaveMcEwan/dmppl | 68e8a121d4591360080cd40121add1796ae48a1b | [
"MIT"
] | 1 | 2020-05-05T19:46:43.000Z | 2020-05-05T19:46:43.000Z | tests/test_parvec.py | DaveMcEwan/dmppl | 68e8a121d4591360080cd40121add1796ae48a1b | [
"MIT"
] | null | null | null | tests/test_parvec.py | DaveMcEwan/dmppl | 68e8a121d4591360080cd40121add1796ae48a1b | [
"MIT"
] | null | null | null | from dmppl.scripts.parvec import entryPoint
from dmppl.base import rdTxt
from dmppl.test import runEntryPoint
import os
import tempfile
import shutil
import sys
import unittest
class Test_Parvec(unittest.TestCase): # {{{
def setUp(self):
# Different PRNGs between CPython versions.
# Check against... | 30.876623 | 83 | 0.63428 | from dmppl.scripts.parvec import entryPoint
from dmppl.base import rdTxt
from dmppl.test import runEntryPoint
import os
import tempfile
import shutil
import sys
import unittest
class Test_Parvec(unittest.TestCase):
def setUp(self):
self.knownPrng = sys.version_info[:2] in [(3, 5),... | true | true |
f72c29c259a32921c65201a24cdc494eaddc5c96 | 3,974 | gyp | Python | gyp/freetype.gyp | Frankie-666/color-emoji.skia | f1634a9952086155b9069d49ab91f1fa43b5ec6a | [
"BSD-3-Clause"
] | 1 | 2018-06-18T03:20:08.000Z | 2018-06-18T03:20:08.000Z | gyp/freetype.gyp | Frankie-666/color-emoji.skia | f1634a9952086155b9069d49ab91f1fa43b5ec6a | [
"BSD-3-Clause"
] | null | null | null | gyp/freetype.gyp | Frankie-666/color-emoji.skia | f1634a9952086155b9069d49ab91f1fa43b5ec6a | [
"BSD-3-Clause"
] | null | null | null | {
'targets': [
{
'target_name': 'freetype',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [
# base components (required)
'../third_party/externals/freetype/src/base/ftsystem.c',
'../third_party/externals/freetype/src/base/ftinit.c',
'.... | 45.678161 | 111 | 0.606945 | {
'targets': [
{
'target_name': 'freetype',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [
'../third_party/externals/freetype/src/base/ftsystem.c',
'../third_party/externals/freetype/src/base/ftinit.c',
'../third_party/externals/freet... | true | true |
f72c2a8a8a6c7d963cd917f661bb29b5ba4d5351 | 12,831 | py | Python | utils/data_utils.py | joshchang1112/gcnn-survey-paper | 591af8d6c4374378831cab2cdec79575e2540d79 | [
"Apache-2.0"
] | 155 | 2019-12-18T19:01:02.000Z | 2022-03-12T16:34:06.000Z | utils/data_utils.py | google/gcnn-survey-paper | 591af8d6c4374378831cab2cdec79575e2540d79 | [
"Apache-2.0"
] | null | null | null | utils/data_utils.py | google/gcnn-survey-paper | 591af8d6c4374378831cab2cdec79575e2540d79 | [
"Apache-2.0"
] | 23 | 2020-05-11T12:39:58.000Z | 2022-03-04T09:13:58.000Z | #Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, softwa... | 34.772358 | 80 | 0.691996 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import pickle as pkl
import sys
import networkx as nx
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
import tensorflow as tf
from third_party.gcn.gc... | true | true |
f72c2b187dd8c532b6839213766774021ef6ff74 | 33 | py | Python | tests/__init__.py | yoophi/flask-google-login-example | 57cbbcbd054a6ba47c2a492950bf500b6b595b7d | [
"MIT"
] | null | null | null | tests/__init__.py | yoophi/flask-google-login-example | 57cbbcbd054a6ba47c2a492950bf500b6b595b7d | [
"MIT"
] | null | null | null | tests/__init__.py | yoophi/flask-google-login-example | 57cbbcbd054a6ba47c2a492950bf500b6b595b7d | [
"MIT"
] | null | null | null | """Unit test package for app."""
| 16.5 | 32 | 0.636364 | true | true | |
f72c2cf7b738c597ce705f662cdf1e0bb2603530 | 323 | py | Python | mmcap/models/utils/__init__.py | hnp0411/mmcaptioning | 47bcdee3734cdaaa96a34e927cdec5cc43cab538 | [
"Apache-2.0"
] | null | null | null | mmcap/models/utils/__init__.py | hnp0411/mmcaptioning | 47bcdee3734cdaaa96a34e927cdec5cc43cab538 | [
"Apache-2.0"
] | null | null | null | mmcap/models/utils/__init__.py | hnp0411/mmcaptioning | 47bcdee3734cdaaa96a34e927cdec5cc43cab538 | [
"Apache-2.0"
] | null | null | null | from .gaussian_target import gaussian_radius, gen_gaussian_target
from .res_layer import ResLayer
from .position_embedding_2d import PositionEmbeddingSine
from .sampling import topktopp
__all__ = ['ResLayer',
'gaussian_radius', 'gen_gaussian_target',
'PositionEmbeddingSine',
'topktopp... | 32.3 | 65 | 0.749226 | from .gaussian_target import gaussian_radius, gen_gaussian_target
from .res_layer import ResLayer
from .position_embedding_2d import PositionEmbeddingSine
from .sampling import topktopp
__all__ = ['ResLayer',
'gaussian_radius', 'gen_gaussian_target',
'PositionEmbeddingSine',
'topktopp... | true | true |
f72c2daa1aa4397686149633191ba4e69a6e8ed2 | 425 | py | Python | MachineLearning/DecisionTree/loan_delinquency.py | yexianyi/AI_Practice | 80499ab3a06ac055641aa069fe1e37864c9e41c4 | [
"Apache-2.0"
] | null | null | null | MachineLearning/DecisionTree/loan_delinquency.py | yexianyi/AI_Practice | 80499ab3a06ac055641aa069fe1e37864c9e41c4 | [
"Apache-2.0"
] | null | null | null | MachineLearning/DecisionTree/loan_delinquency.py | yexianyi/AI_Practice | 80499ab3a06ac055641aa069fe1e37864c9e41c4 | [
"Apache-2.0"
] | null | null | null | '''
Decision Tree
Predict if it is possible to default on the loan
'''
import numpy as np
from sklearn import tree
data = np.genfromtxt("exercise.csv", delimiter=",")
# get train data set
x_data = data[1:, 1:-1]
# get test data set
y_data = data[1:, -1]
print(x_data)
print(y_data)
# Create decision tree
dtree = tree... | 20.238095 | 55 | 0.734118 | import numpy as np
from sklearn import tree
data = np.genfromtxt("exercise.csv", delimiter=",")
x_data = data[1:, 1:-1]
y_data = data[1:, -1]
print(x_data)
print(y_data)
dtree = tree.DecisionTreeClassifier(min_samples_leaf=5)
dtree.fit(x_data, y_data)
print(dtree.score(x_data, y_data))
| true | true |
f72c2df55f1cc8270d405748ec5245b4671cc4a9 | 1,680 | py | Python | test/test_flac3d.py | ffilotto/meshio | 4413be41e6a63e33273665986f42dab80d585d10 | [
"MIT"
] | null | null | null | test/test_flac3d.py | ffilotto/meshio | 4413be41e6a63e33273665986f42dab80d585d10 | [
"MIT"
] | null | null | null | test/test_flac3d.py | ffilotto/meshio | 4413be41e6a63e33273665986f42dab80d585d10 | [
"MIT"
] | null | null | null | import copy
import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"mesh, binary, data",
[
(helpers.tet_mesh, False, []),
(helpers.hex_mesh, False, []),
(helpers.tet_mesh, False, [1, 2]),
(helpers.tet_mesh, True, []),
... | 25.454545 | 83 | 0.583333 | import copy
import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"mesh, binary, data",
[
(helpers.tet_mesh, False, []),
(helpers.hex_mesh, False, []),
(helpers.tet_mesh, False, [1, 2]),
(helpers.tet_mesh, True, []),
... | true | true |
f72c2f6aa5e33817498aeaf30c0f710fd5347dc0 | 471 | py | Python | examples/idioms/programs/177.3241-find-files-with-a-given-list-of-filename-extensions.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 31 | 2020-05-02T13:34:26.000Z | 2021-06-06T17:25:52.000Z | examples/idioms/programs/177.3241-find-files-with-a-given-list-of-filename-extensions.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 108 | 2019-11-18T19:41:52.000Z | 2022-03-18T13:58:17.000Z | examples/idioms/programs/177.3241-find-files-with-a-given-list-of-filename-extensions.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 4 | 2020-05-19T08:57:44.000Z | 2020-09-21T08:53:46.000Z | """Find files with a given list of filename extensions.
Construct a list _L that contains all filenames that have the extension ".jpg" , ".jpeg" or ".png" in directory _D and all it's subdirectories.
Source: Bart
"""
# Implementation author: charlax
# Created on 2019-09-27T11:33:27.420533Z
# Last modified on 2019-09... | 27.705882 | 143 | 0.713376 |
import glob
import itertools
list(itertools.chain(*(glob.glob("*/**.%s" % ext) for ext in ["jpg", "jpeg", "png"])))
| true | true |
f72c31469cfb67208d5848f60740b7c718ec496d | 160 | py | Python | src/battery/battery.py | BigOz/flourish | a45f9d0290878c69237fdd1949ee42f9e6039df9 | [
"BSD-2-Clause"
] | null | null | null | src/battery/battery.py | BigOz/flourish | a45f9d0290878c69237fdd1949ee42f9e6039df9 | [
"BSD-2-Clause"
] | null | null | null | src/battery/battery.py | BigOz/flourish | a45f9d0290878c69237fdd1949ee42f9e6039df9 | [
"BSD-2-Clause"
] | null | null | null | class Battery:
def __init__(self, evaluator):
raise NotImplementedError
def get_action(self, current_state):
raise NotImplementedError
| 22.857143 | 40 | 0.7125 | class Battery:
def __init__(self, evaluator):
raise NotImplementedError
def get_action(self, current_state):
raise NotImplementedError
| true | true |
f72c3198aa025287611b7e30ff0d1259ec7834b8 | 8,969 | py | Python | cache_dependencies/tests/test_transaction.py | Tusky/cache-dependencies | 6c19d0c2adfce19c3fdc53ad5704eddc6d84e106 | [
"BSD-3-Clause"
] | 3 | 2017-08-08T20:06:56.000Z | 2018-09-19T03:16:20.000Z | cache_dependencies/tests/test_transaction.py | Tusky/cache-dependencies | 6c19d0c2adfce19c3fdc53ad5704eddc6d84e106 | [
"BSD-3-Clause"
] | 1 | 2017-10-24T23:11:32.000Z | 2017-10-24T23:11:32.000Z | cache_dependencies/tests/test_transaction.py | Tusky/cache-dependencies | 6c19d0c2adfce19c3fdc53ad5704eddc6d84e106 | [
"BSD-3-Clause"
] | 8 | 2017-10-24T07:43:56.000Z | 2021-06-17T07:03:02.000Z | import time
import unittest
from cache_dependencies import interfaces, transaction
try:
from unittest import mock
except ImportError:
import mock
try:
str = unicode # Python 2.* compatible
string_types = (basestring,)
integer_types = (int, long)
except NameError:
string_types = (str,)
in... | 38.659483 | 97 | 0.721485 | import time
import unittest
from cache_dependencies import interfaces, transaction
try:
from unittest import mock
except ImportError:
import mock
try:
str = unicode string_types = (basestring,)
integer_types = (int, long)
except NameError:
string_types = (str,)
integer_types = (int,)
c... | true | true |
f72c31f2bcdc0ad3367f05a6e93c9a41b1a34424 | 1,886 | py | Python | src/oci/data_labeling_service_dataplane/models/text_dataset_format_details.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/data_labeling_service_dataplane/models/text_dataset_format_details.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/data_labeling_service_dataplane/models/text_dataset_format_details.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 37.72 | 245 | 0.697243 |
from .dataset_format_details import DatasetFormatDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class TextDatasetFormatDetails(DatasetFormatDetails):
def __init__(self, **... | true | true |
f72c32112bb05acf4043ba5c15ccde4c05c4d6f3 | 24,352 | py | Python | compiler/characterizer/model_check.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | 1 | 2022-02-17T22:12:46.000Z | 2022-02-17T22:12:46.000Z | compiler/characterizer/model_check.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | null | null | null | compiler/characterizer/model_check.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | null | null | null | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import sys,re,shutil
import debug
import tech
im... | 54.115556 | 182 | 0.627217 | import sys,re,shutil
import debug
import tech
import math
from .stimuli import *
from .trim_spice import *
from .charutils import *
import utils
from globals import OPTS
from .delay import delay
from .measurements import *
class model_check(delay):
def __init__(self, sram, spfile, corner, custom_delaychain=False)... | true | true |
f72c33ad93ae6e46739f72e67c233be7339ce4cc | 1,937 | py | Python | .ignore/old/SDN_MininetUtils.py | souvikdas95/SDN_VideoStreaming | a75a77a1d2a087c96102b2c02f5a67d3a90f1fa2 | [
"Apache-2.0"
] | 4 | 2018-04-26T20:33:15.000Z | 2022-01-20T22:43:08.000Z | .ignore/old/SDN_MininetUtils.py | souvikdas95/SDN_VideoStreaming | a75a77a1d2a087c96102b2c02f5a67d3a90f1fa2 | [
"Apache-2.0"
] | null | null | null | .ignore/old/SDN_MininetUtils.py | souvikdas95/SDN_VideoStreaming | a75a77a1d2a087c96102b2c02f5a67d3a90f1fa2 | [
"Apache-2.0"
] | 3 | 2019-05-02T08:51:20.000Z | 2021-04-02T15:29:52.000Z | #!/usr/bin/python
import mininet.util;
from mininet.util import quietRun, moveIntf;
def _makeIntfPair( intf1, intf2, addr1=None, addr2=None, node1=None, node2=None,
deleteIntfs=True, runCmd=None ):
"""Make a veth pair connnecting new interfaces intf1 and intf2
intf1: name for interfac... | 35.87037 | 81 | 0.663913 |
import mininet.util;
from mininet.util import quietRun, moveIntf;
def _makeIntfPair( intf1, intf2, addr1=None, addr2=None, node1=None, node2=None,
deleteIntfs=True, runCmd=None ):
if deleteIntfs:
quietRun( 'ip link del ' + intf1, shell=True )
quietRun( 'ip link del ' + intf2, sh... | true | true |
f72c344a4be417fe87d7e7e8ebbc0ea10789d3b1 | 22,433 | py | Python | nuitka/specs/BuiltinParameterSpecs.py | gdementen/Nuitka | 1f12be2364d07ffb168a7302dde94cb25eca9a70 | [
"Apache-2.0"
] | 5,421 | 2018-09-24T08:04:06.000Z | 2022-03-31T20:02:37.000Z | venv/Lib/site-packages/nuitka/specs/BuiltinParameterSpecs.py | matthijsvanvliet/raytracing-python | 73d692b47330ab94eedde579a51063e3a907e92b | [
"MIT"
] | 1,348 | 2018-09-22T13:41:00.000Z | 2022-03-31T22:33:40.000Z | venv/Lib/site-packages/nuitka/specs/BuiltinParameterSpecs.py | matthijsvanvliet/raytracing-python | 73d692b47330ab94eedde579a51063e3a907e92b | [
"MIT"
] | 396 | 2018-09-28T15:37:03.000Z | 2022-03-29T10:52:09.000Z | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 33.432191 | 88 | 0.642179 | from __future__ import print_function
import math
from nuitka.__past__ import builtins
from nuitka.PythonVersions import python_version
from nuitka.Tracing import optimization_logger
from .ParameterSpecs import ParameterSpec, TooManyArguments, matchCall
class BuiltinParameterSpec(ParameterSpec):
__slots__ = ("... | true | true |
f72c344f2c08cfd3448f089e38a1116d9b085c4c | 17,366 | py | Python | docker-images/taigav2/taiga-back/settings/common.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | 1 | 2017-05-29T19:01:06.000Z | 2017-05-29T19:01:06.000Z | docker-images/taigav2/taiga-back/settings/common.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | null | null | null | docker-images/taigav2/taiga-back/settings/common.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | 31.632058 | 109 | 0.620293 |
import os.path, sys, os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
APPEND_SLASH = False
ALLOWED_HOSTS = ["*"]
ADMINS = (
("Admin", "example@example.com"),
)
DEBUG = False
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "taiga",
}
}
CACHES = {
... | true | true |
f72c3524f818483a439794d6f178598c2f531f0c | 773 | py | Python | models/product.py | KennyLingineni/MiniAmazon | 95c72d3693466ca2265d0e13f2cb172e1a98c260 | [
"Unlicense"
] | null | null | null | models/product.py | KennyLingineni/MiniAmazon | 95c72d3693466ca2265d0e13f2cb172e1a98c260 | [
"Unlicense"
] | null | null | null | models/product.py | KennyLingineni/MiniAmazon | 95c72d3693466ca2265d0e13f2cb172e1a98c260 | [
"Unlicense"
] | null | null | null | from MiniAmazon.models import db
def search_by_name(query):
#Search for the product here
db_query = {'name': query}
matchingproducts = db['products'].find(db_query) # Products is the table/collection. It returns a cursor(pointer).Cursor is a type of Generator.
if matchingproducts:
return list(... | 33.608696 | 149 | 0.711514 | from MiniAmazon.models import db
def search_by_name(query):
db_query = {'name': query}
matchingproducts = db['products'].find(db_query) if matchingproducts:
return list(matchingproducts) else:
return []
def add_product(producttobeadded):
db['products'].insert_one(productto... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.