hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f0ac2e46cb3fa66688ea73e93336324dd3babc | 8,158 | py | Python | torchmetrics/functional/__init__.py | aaronzs/metrics | 30019851186f2e224504ec76e87cc7f5170b7166 | [
"Apache-2.0"
] | null | null | null | torchmetrics/functional/__init__.py | aaronzs/metrics | 30019851186f2e224504ec76e87cc7f5170b7166 | [
"Apache-2.0"
] | null | null | null | torchmetrics/functional/__init__.py | aaronzs/metrics | 30019851186f2e224504ec76e87cc7f5170b7166 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 47.430233 | 110 | 0.839667 | from torchmetrics.functional.audio.pit import permutation_invariant_training, pit_permutate
from torchmetrics.functional.audio.sdr import scale_invariant_signal_distortion_ratio, signal_distortion_ratio
from torchmetrics.functional.audio.snr import scale_invariant_signal_noise_ratio, signal_noise_ratio
from torchmetric... | true | true |
08f0af138b6bcc9ded5cdb1bc19bc30c2b2e681d | 1,609 | py | Python | ahorcado.py | GuarroScout/juegoAhorcado | ac63f97a2e68def5bcdf3b6c9be1419db99b1aed | [
"MIT"
] | null | null | null | ahorcado.py | GuarroScout/juegoAhorcado | ac63f97a2e68def5bcdf3b6c9be1419db99b1aed | [
"MIT"
] | null | null | null | ahorcado.py | GuarroScout/juegoAhorcado | ac63f97a2e68def5bcdf3b6c9be1419db99b1aed | [
"MIT"
] | null | null | null | def read():
read_data = []
with open("./data.txt", "r", encoding="utf-8") as r:
for reading in r:
read_data.append(reading)
choose_word = []
number_data = []
ahorcado = []
from random import randint as ran
number_data = len(read_data)
choose_word = ran(0, numb... | 25.140625 | 61 | 0.532629 | def read():
read_data = []
with open("./data.txt", "r", encoding="utf-8") as r:
for reading in r:
read_data.append(reading)
choose_word = []
number_data = []
ahorcado = []
from random import randint as ran
number_data = len(read_data)
choose_word = ran(0, numb... | true | true |
08f0af2fb13a0f4edc35ff1ea2c76a2926b3301a | 3,586 | py | Python | kubernetes/base/config/exec_provider.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | null | null | null | kubernetes/base/config/exec_provider.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | 3 | 2021-11-30T03:11:13.000Z | 2022-02-09T03:39:41.000Z | kubernetes/base/config/exec_provider.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Kubernetes Authors.
#
# 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 ... | 36.222222 | 114 | 0.60039 | import json
import os
import subprocess
import sys
from .config_exception import ConfigException
class ExecProvider(object):
def __init__(self, exec_config, cwd):
for key in ['command', 'apiVersion']:
if key not in exec_config:
raise ConfigException(
'exec... | true | true |
08f0af3fb8567ea27027ba5062f9ee3944f5f4a5 | 784 | py | Python | start.py | danielhollas/aiidalab-widgets-base | 4badc55394fb6e8f49eb0388b09ff9a7473952b0 | [
"MIT"
] | null | null | null | start.py | danielhollas/aiidalab-widgets-base | 4badc55394fb6e8f49eb0388b09ff9a7473952b0 | [
"MIT"
] | 4 | 2018-05-31T22:40:19.000Z | 2018-10-11T12:17:40.000Z | start.py | danielhollas/aiidalab-widgets-base | 4badc55394fb6e8f49eb0388b09ff9a7473952b0 | [
"MIT"
] | 1 | 2018-10-09T13:57:14.000Z | 2018-10-09T13:57:14.000Z | """Start page appearance."""
import ipywidgets as ipw
TEMPLATE = """
<table>
<tr>
<th style="text-align:center">Processes.</th>
<th style="width:70px" rowspan=2></th>
<th style="text-align:center">Electronic Lab Notebook.</th>
<tr>
<td valign="top"><ul>
<li><a href="{appbase}/notebooks/process_list.ipynb" ... | 27.034483 | 96 | 0.667092 | import ipywidgets as ipw
TEMPLATE = """
<table>
<tr>
<th style="text-align:center">Processes.</th>
<th style="width:70px" rowspan=2></th>
<th style="text-align:center">Electronic Lab Notebook.</th>
<tr>
<td valign="top"><ul>
<li><a href="{appbase}/notebooks/process_list.ipynb" target="_blank">Process list<... | true | true |
08f0af79e33a8330db4a7e27644abad90ce748b5 | 6,929 | py | Python | tests/frontend/test_logger.py | SubhashishQPIT/strawberryfields | dae6ae8b1b3eb188fc2c874bd6c943bebf697ab9 | [
"Apache-2.0"
] | 646 | 2018-03-26T15:12:35.000Z | 2022-03-21T18:52:42.000Z | tests/frontend/test_logger.py | SubhashishQPIT/strawberryfields | dae6ae8b1b3eb188fc2c874bd6c943bebf697ab9 | [
"Apache-2.0"
] | 666 | 2018-03-27T20:21:27.000Z | 2022-03-25T18:35:33.000Z | tests/frontend/test_logger.py | SubhashishQPIT/strawberryfields | dae6ae8b1b3eb188fc2c874bd6c943bebf697ab9 | [
"Apache-2.0"
] | 182 | 2018-04-11T17:09:39.000Z | 2022-03-29T15:38:43.000Z | # Copyright 2010 Pallets
# 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 the following disclaimer.
# 2. Redist... | 40.758824 | 92 | 0.738635 |
import logging
import pytest
import strawberryfields.api.job as job
import strawberryfields.api.connection as connection
import strawberryfields.engine as engine
from strawberryfields.logger import logging_handler_defined, default_handler, create_logger
modules_contain_logging = [job, connection, engine]
... | true | true |
08f0afbec79105f04745a70bd350592e41745777 | 2,459 | py | Python | utils/page2cocoresults.py | jsalvadorlpz/RPN_DLA | 62e1e10db2ec63d98273176d65dd023b99bf3d38 | [
"Apache-2.0"
] | null | null | null | utils/page2cocoresults.py | jsalvadorlpz/RPN_DLA | 62e1e10db2ec63d98273176d65dd023b99bf3d38 | [
"Apache-2.0"
] | null | null | null | utils/page2cocoresults.py | jsalvadorlpz/RPN_DLA | 62e1e10db2ec63d98273176d65dd023b99bf3d38 | [
"Apache-2.0"
] | 1 | 2022-02-04T15:11:55.000Z | 2022-02-04T15:11:55.000Z | import os
import glob
import argparse
import json
import pycocotools.mask as maskUtils
#--- expected format:
# [{"image_id":int, "category_id":int, "bbox":list, "score": float, "segmentation":{"size":list, "counts":RLE}},{...}]
def list2dic(json_data, key="file_name"):
to_return = {}
for img in json_data["... | 26.44086 | 120 | 0.576657 | import os
import glob
import argparse
import json
import pycocotools.mask as maskUtils
def list2dic(json_data, key="file_name"):
to_return = {}
for img in json_data["images"]:
name = img[key]
to_return[name] = img
return to_return
def dataset2result(gt_data, hyp_data):
gt_ids = lis... | true | true |
08f0afe3aec6f77976cfa9d0856fccb4f0d4be8e | 505 | py | Python | setup.py | WyseNynja/loot | a5f3966a1158c36012f0fce69efead5d2d4b6ea5 | [
"MIT",
"Unlicense"
] | null | null | null | setup.py | WyseNynja/loot | a5f3966a1158c36012f0fce69efead5d2d4b6ea5 | [
"MIT",
"Unlicense"
] | null | null | null | setup.py | WyseNynja/loot | a5f3966a1158c36012f0fce69efead5d2d4b6ea5 | [
"MIT",
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import setuptools
setuptools.setup(
author='Bryan Stitt',
author_email='bryan@stitthappens.com',
description='Mark shows unwatched on a schedule.',
long_description=__doc__,
entry_points={
'console_scripts': [
'loot = loot:main',
],
},
inst... | 21.956522 | 54 | 0.609901 | import setuptools
setuptools.setup(
author='Bryan Stitt',
author_email='bryan@stitthappens.com',
description='Mark shows unwatched on a schedule.',
long_description=__doc__,
entry_points={
'console_scripts': [
'loot = loot:main',
],
},
install_requires=[
... | true | true |
08f0b3b63d41daba741b4617e3188a7a027e21d3 | 430 | py | Python | src/shop/migrations/0011_auto_20170212_1109.py | uppsaladatavetare/foobar-api | c63e824ce246b15163e352f5150ef4ecbee81b96 | [
"MIT"
] | 16 | 2015-10-29T14:23:37.000Z | 2020-04-21T00:19:39.000Z | src/shop/migrations/0011_auto_20170212_1109.py | uppsaladatavetare/foobar-api | c63e824ce246b15163e352f5150ef4ecbee81b96 | [
"MIT"
] | 74 | 2016-09-14T19:52:32.000Z | 2018-10-03T10:11:16.000Z | src/shop/migrations/0011_auto_20170212_1109.py | uppsaladatavetare/foobar-api | c63e824ce246b15163e352f5150ef4ecbee81b96 | [
"MIT"
] | 7 | 2017-02-08T13:11:20.000Z | 2021-08-11T07:29:35.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-12 11:09
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0010_delivery_processed'),
]
operations = [
migrations.RenameField(
... | 20.47619 | 48 | 0.606977 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0010_delivery_processed'),
]
operations = [
migrations.RenameField(
model_name='delivery',
old_name='processed',
... | true | true |
08f0b41ce9f67fe4446416dad21d3514c4b9521a | 2,043 | py | Python | tests/PyPoE/poe/file/_data/specifications/virtual_key_duplicate.py | Gloorf/PyPoE | 23e60e0914a1a669764a552f762d2b2064203e75 | [
"MIT"
] | 1 | 2019-11-26T23:22:41.000Z | 2019-11-26T23:22:41.000Z | tests/PyPoE/poe/file/_data/specifications/virtual_key_duplicate.py | Gloorf/PyPoE | 23e60e0914a1a669764a552f762d2b2064203e75 | [
"MIT"
] | null | null | null | tests/PyPoE/poe/file/_data/specifications/virtual_key_duplicate.py | Gloorf/PyPoE | 23e60e0914a1a669764a552f762d2b2064203e75 | [
"MIT"
] | null | null | null | """Overview
===============================================================================
+----------+------------------------------------------------------------------+
| Path | tests/PyPoE/poe/file/_data/specifications/ |
+----------+-------------------------------------------------------... | 31.430769 | 79 | 0.225159 |
from collections import OrderedDict
from PyPoE.poe.file.specification.fields import *
specification = Specification({
'Main.dat': File(
fields=OrderedDict((
('One', Field(
type='int',
)),
('Two', Field(
type='int',
)),
... | true | true |
08f0b44a9fac18fff2e1dc424e32bfb8cfd765ae | 3,525 | py | Python | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.987805 | 102 | 0.632624 |
from .resource import Resource
class Eventhub(Resource):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'partition_ids': {'readonly': True},
'created_at': {'readonly': True},
'updated_at': {'readonly': True},
... | true | true |
08f0b52fb3ef4a864b26d98fdae459ad219d66e7 | 2,370 | py | Python | pyVersioning/Travis.py | Paebbels/pyVersioning | b093ee13e4506bfa6a1ab93ecd6aa8ffe933044f | [
"Apache-2.0"
] | 3 | 2020-08-27T19:36:12.000Z | 2022-02-04T19:11:53.000Z | pyVersioning/Travis.py | Paebbels/pyVersioning | b093ee13e4506bfa6a1ab93ecd6aa8ffe933044f | [
"Apache-2.0"
] | 6 | 2021-02-07T09:37:53.000Z | 2022-01-10T20:32:27.000Z | pyVersioning/Travis.py | Paebbels/pyVersioning | b093ee13e4506bfa6a1ab93ecd6aa8ffe933044f | [
"Apache-2.0"
] | null | null | null | # =============================================================================
# __ __ _ _
# _ __ _ \ \ / /__ _ __ ___(_) ___ _ __ (_)_ __ __ _
# | '_ \| | | \ \ / / _ \ '__/ __| |/ _ \| '_ \| | '_ \ / _` |
# | |_) | |_| |\ V / __/ | \__ \ | (_) | | | | | | | | (_| |
# ... | 30.779221 | 79 | 0.538397 | from os import environ
from pyVersioning.CIService import CIService, Platform, ServiceException
class Travis(CIService):
ENV_INCLUDE_FILTER = ("TRAVIS_")
ENV_EXCLUDE_FILTER = ("_TOKEN")
ENV_INCLUDES = ['CI', 'CONTINUOUS_INTEGRATION', 'TRAVIS']
ENV_EXCLUDES = []
def getPlatform(self) -> Platform... | true | true |
08f0b59fd1e973debcc07bdc3282417c32464684 | 8,352 | py | Python | src/trex/cli/smartseq2.py | cnk113/TREX | add83d8108f3602c5bbe7b37f60ff19f89b2236d | [
"MIT"
] | null | null | null | src/trex/cli/smartseq2.py | cnk113/TREX | add83d8108f3602c5bbe7b37f60ff19f89b2236d | [
"MIT"
] | 1 | 2022-03-18T01:56:53.000Z | 2022-03-24T19:35:58.000Z | src/trex/cli/smartseq2.py | cnk113/TREX | add83d8108f3602c5bbe7b37f60ff19f89b2236d | [
"MIT"
] | 1 | 2022-03-23T03:07:42.000Z | 2022-03-23T03:07:42.000Z | """
Run on Smart-Seq2 data
"""
import sys
import logging
from pathlib import Path
from collections import Counter
from typing import List, Iterable
import trex.cli
from .run10x import read_allowed_cellids, correct_clone_ids
from . import setup_logging, CommandLineError, add_file_logging, make_output_dir
from .. import... | 33.677419 | 88 | 0.666786 | import sys
import logging
from pathlib import Path
from collections import Counter
from typing import List, Iterable
import trex.cli
from .run10x import read_allowed_cellids, correct_clone_ids
from . import setup_logging, CommandLineError, add_file_logging, make_output_dir
from .. import __version__
from ..writers imp... | true | true |
08f0b5b9cd78ef480a9580de9e67bce0774984bc | 452 | py | Python | month04/Django/django6/net_note/note/models.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | 4 | 2021-01-07T14:25:10.000Z | 2021-02-01T10:36:01.000Z | month04/Django/django6/net_note/note/models.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | month04/Django/django6/net_note/note/models.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
from user.models import User
class Note(models.Model):
title = models.CharField('标题', max_length=100)
content = models.TextField('内容')
created_time = models.DateTimeField('创建时间', auto_now_add=True)
updated_time = models.DateTimeField('更新时间', aut... | 28.25 | 66 | 0.712389 | from django.db import models
from user.models import User
class Note(models.Model):
title = models.CharField('标题', max_length=100)
content = models.TextField('内容')
created_time = models.DateTimeField('创建时间', auto_now_add=True)
updated_time = models.DateTimeField('更新时间', auto_now=True)
user = mode... | true | true |
08f0b600101030ce9ba78434f87db15b6a9fff36 | 644 | py | Python | impf_termin_tester/notifiers/outlook.py | andreasdoerr/impf_termin_tester | 25153248c55ec572dd6a36d4b8b263512490a56d | [
"MIT"
] | 16 | 2021-04-03T13:17:56.000Z | 2021-06-29T08:25:38.000Z | impf_termin_tester/notifiers/outlook.py | andreasdoerr/impf_termin_tester | 25153248c55ec572dd6a36d4b8b263512490a56d | [
"MIT"
] | 14 | 2021-04-03T15:26:37.000Z | 2021-06-13T10:30:10.000Z | impf_termin_tester/notifiers/outlook.py | andreasdoerr/impf_termin_tester | 25153248c55ec572dd6a36d4b8b263512490a56d | [
"MIT"
] | 7 | 2021-04-03T13:18:41.000Z | 2021-06-04T14:20:52.000Z | import win32com.client as win32
from impf_termin_tester.notifiers import NotificationService
class OutlookNotification(NotificationService):
def __init__(self, target_email):
super().__init__(name="Outlook e-mail client")
self.target_email = target_email
self.outlook = None
def initi... | 29.272727 | 60 | 0.68323 | import win32com.client as win32
from impf_termin_tester.notifiers import NotificationService
class OutlookNotification(NotificationService):
def __init__(self, target_email):
super().__init__(name="Outlook e-mail client")
self.target_email = target_email
self.outlook = None
def initi... | true | true |
08f0b7532b802ca64b8f0c71d51c33873b4b674f | 8,457 | py | Python | rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py | eledata/rqalpha | 087b398f4d6c7faffe2d441a68f3182053797c8f | [
"Apache-2.0"
] | 44 | 2017-06-17T09:43:17.000Z | 2022-03-02T11:08:03.000Z | rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py | shengrhwu/rqalpha | a7b68c6e4a0d7c58cdbbcf67be2013f5f7b41258 | [
"Apache-2.0"
] | 2 | 2017-08-26T13:10:17.000Z | 2018-06-14T12:28:08.000Z | rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py | shengrhwu/rqalpha | a7b68c6e4a0d7c58cdbbcf67be2013f5f7b41258 | [
"Apache-2.0"
] | 28 | 2017-06-26T10:06:29.000Z | 2021-12-17T04:26:04.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 46.213115 | 134 | 0.593828 |
import datetime
from rqalpha.interface import AbstractEventSource
from rqalpha.events import Event, EVENT
from rqalpha.utils import get_account_type
from rqalpha.utils.exception import CustomException, CustomError, patch_user_exc
from rqalpha.utils.datetime_func import convert_int_to_datetime
from rqalpha.const impor... | true | true |
08f0b849cc9977e3e1959ce821630ab45e5e0646 | 1,117 | py | Python | lessons/03/frog_imp/challenge.py | jimlawton/codility | b286db80c7cfa6722b78c7eb8992e1a5934db8a0 | [
"Apache-2.0"
] | null | null | null | lessons/03/frog_imp/challenge.py | jimlawton/codility | b286db80c7cfa6722b78c7eb8992e1a5934db8a0 | [
"Apache-2.0"
] | 2 | 2021-03-25T21:32:16.000Z | 2021-07-19T11:11:15.000Z | lessons/03/frog_imp/challenge.py | jimlawton/codility | b286db80c7cfa6722b78c7eb8992e1a5934db8a0 | [
"Apache-2.0"
] | null | null | null | # A small frog wants to get to the other side of the road. The frog is
# currently located at position X and wants to get to a position greater than
# or equal to Y. The small frog always jumps a fixed distance, D.
# Count the minimal number of jumps that the small frog must perform to reach
# its target.
# Write a f... | 29.394737 | 79 | 0.664279 |
def solution(X, Y, D):
jumps = ((Y - X) // D)
if X + (jumps * D) < Y:
jumps += 1
return jumps
| true | true |
08f0b8d4792ba3b4cf88d040435c3f2fb6b39a13 | 4,556 | py | Python | alphafold/data/tools/hmmsearch.py | amorehead/alphafold_multimer_non_docker | 32f3b81fc4bbc2d8750da27158b42c2412fdfd3f | [
"Apache-2.0"
] | 8,110 | 2021-07-15T17:54:49.000Z | 2022-03-31T20:20:00.000Z | alphafold/data/tools/hmmsearch.py | amorehead/alphafold_multimer_non_docker | 32f3b81fc4bbc2d8750da27158b42c2412fdfd3f | [
"Apache-2.0"
] | 404 | 2021-07-15T18:35:07.000Z | 2022-03-31T13:55:41.000Z | alphafold/data/tools/hmmsearch.py | amorehead/alphafold_multimer_non_docker | 32f3b81fc4bbc2d8750da27158b42c2412fdfd3f | [
"Apache-2.0"
] | 1,305 | 2021-07-15T18:18:45.000Z | 2022-03-31T04:58:03.000Z | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 34.515152 | 80 | 0.634109 |
import os
import subprocess
from typing import Optional, Sequence
from absl import logging
from alphafold.data import parsers
from alphafold.data.tools import hmmbuild
from alphafold.data.tools import utils
class Hmmsearch(object):
def __init__(self,
*,
binary_path: str,
... | true | true |
08f0b9269691f93e2f3432556217e5c3db36b921 | 169 | py | Python | backend/task_category/admin.py | crowdbotics-apps/nsp-28646 | ebbe680474ccf7fbbffc996fb0d68795b0b65f3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/task_category/admin.py | crowdbotics-apps/nsp-28646 | ebbe680474ccf7fbbffc996fb0d68795b0b65f3b | [
"FTL",
"AML",
"RSA-MD"
] | 26 | 2021-08-02T20:17:22.000Z | 2022-01-23T13:45:59.000Z | backend/task_category/admin.py | crowdbotics-apps/nsp-28646 | ebbe680474ccf7fbbffc996fb0d68795b0b65f3b | [
"FTL",
"AML",
"RSA-MD"
] | 1 | 2021-07-06T16:56:23.000Z | 2021-07-06T16:56:23.000Z | from django.contrib import admin
from .models import Category, Subcategory
admin.site.register(Subcategory)
admin.site.register(Category)
# Register your models here.
| 21.125 | 41 | 0.816568 | from django.contrib import admin
from .models import Category, Subcategory
admin.site.register(Subcategory)
admin.site.register(Category)
| true | true |
08f0b9bcc665af6b98d54983ca3702676f0c1e05 | 12,321 | py | Python | src/waveapi/robot.py | hitrust/wave-robot-python-client | ddc6ae3b9eb2860f07bd41470b2037111c714fe1 | [
"Apache-2.0"
] | 7 | 2015-01-25T02:10:50.000Z | 2021-02-02T14:49:49.000Z | src/waveapi/robot.py | pombreda/wave-robot-python-client | 618aaa1169283614f2e56eb222cb86e4af4d689a | [
"Apache-2.0"
] | 1 | 2017-03-08T17:42:14.000Z | 2017-03-09T17:27:07.000Z | src/waveapi/robot.py | pombreda/wave-robot-python-client | 618aaa1169283614f2e56eb222cb86e4af4d689a | [
"Apache-2.0"
] | 4 | 2015-04-16T04:13:42.000Z | 2016-05-18T13:08:05.000Z | #!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 36.131965 | 86 | 0.684279 |
import logging
import sys
try:
__import__('google3') except ImportError:
pass
import simplejson
import blip
import errors
import ops
import simplejson
import wavelet
import waveservice
DEFAULT_PROFILE_URL = (
'http://code.google.com/apis/wave/extensions/robots/python-tutorial.html')
class Robot(object):
... | true | true |
08f0ba86b01ed86f0a47136107626a5c00ac2b6b | 2,310 | py | Python | model-optimizer/extensions/front/tf/sparse_to_dense_replacer.py | evgeniya-egupova/openvino | 4b8d6c59e3444ecdc549bfdf357d19d625479b89 | [
"Apache-2.0"
] | 1 | 2020-11-19T15:53:18.000Z | 2020-11-19T15:53:18.000Z | model-optimizer/extensions/front/tf/sparse_to_dense_replacer.py | evgeniya-egupova/openvino | 4b8d6c59e3444ecdc549bfdf357d19d625479b89 | [
"Apache-2.0"
] | 44 | 2020-12-09T12:38:22.000Z | 2022-03-28T13:18:29.000Z | model-optimizer/extensions/front/tf/sparse_to_dense_replacer.py | rkazants/openvino | a9a583eb42d43322b39b95b164b5b22c4f341111 | [
"Apache-2.0"
] | 4 | 2021-09-29T20:44:49.000Z | 2021-10-20T13:02:12.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from extensions.ops.scatternd import ScatterNDUpdate
from mo.front.common.replacement import FrontReplacementOp
from mo.graph.graph import Node, Graph, rename_nodes
from mo.ops.broadcast import Broadcast
from mo.ops.c... | 47.142857 | 104 | 0.701732 |
import numpy as np
from extensions.ops.scatternd import ScatterNDUpdate
from mo.front.common.replacement import FrontReplacementOp
from mo.graph.graph import Node, Graph, rename_nodes
from mo.ops.broadcast import Broadcast
from mo.ops.const import Const
class SparseToDenseReplacer(FrontReplacementOp):
op = "Spa... | true | true |
08f0bbae7e0f7177dfbf2c186b722c28c43fcc07 | 295 | py | Python | app/subscribe_app/urls.py | KimKiHyuk/BenefitObserver | 74d59ee2d9dc81f8b8423e14a9ce950fa21f332b | [
"MIT"
] | null | null | null | app/subscribe_app/urls.py | KimKiHyuk/BenefitObserver | 74d59ee2d9dc81f8b8423e14a9ce950fa21f332b | [
"MIT"
] | 8 | 2021-03-30T13:53:18.000Z | 2022-03-02T14:54:13.000Z | app/subscribe_app/urls.py | KimKiHyuk/BenefitObserver | 74d59ee2d9dc81f8b8423e14a9ce950fa21f332b | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf.urls import url
from . import views
app_name = 'subscribe_app'
urlpatterns = [
path('', views.UserSubscribeCreateView.as_view()),
path('user/', views.UserSubscribeFetchView.as_view()),
path('list/', views.SubscribeListView.as_view())
] | 26.818182 | 58 | 0.732203 | from django.urls import path
from django.conf.urls import url
from . import views
app_name = 'subscribe_app'
urlpatterns = [
path('', views.UserSubscribeCreateView.as_view()),
path('user/', views.UserSubscribeFetchView.as_view()),
path('list/', views.SubscribeListView.as_view())
] | true | true |
08f0bcc5e16f24f496a88589fa026ea84b02e6a0 | 8,375 | py | Python | mainwindow.py | sivaroot/ProjectCPE | 65841b76bfd3caad1c0384557d5e92ba35c88218 | [
"bzip2-1.0.6"
] | null | null | null | mainwindow.py | sivaroot/ProjectCPE | 65841b76bfd3caad1c0384557d5e92ba35c88218 | [
"bzip2-1.0.6"
] | null | null | null | mainwindow.py | sivaroot/ProjectCPE | 65841b76bfd3caad1c0384557d5e92ba35c88218 | [
"bzip2-1.0.6"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
import sys,os
from PyQt5.QtWidgets import QWidget,QTableWidget, QApplication, QMainWindow, QFileDialog, QPushButton,QHead... | 40.65534 | 140 | 0.692896 |
import sys,os
from PyQt5.QtWidgets import QWidget,QTableWidget, QApplication, QMainWindow, QFileDialog, QPushButton,QHeaderView,QTableWidgetItem,QListView
from PyQt5 import QtCore, QtGui, QtWidgets
from vtk.qt.QVTKRenderWindowInteractor import *
from PyQt5.QtGui import QIcon,QPixmap,QImage
import numpy as np
from os.... | true | true |
08f0bcdb903abbc0031767851722f21d94316670 | 2,050 | py | Python | 0.11/_downloads/plot_brainstorm_data.py | drammock/mne-tools.github.io | 5d3a104d174255644d8d5335f58036e32695e85d | [
"BSD-3-Clause"
] | null | null | null | 0.11/_downloads/plot_brainstorm_data.py | drammock/mne-tools.github.io | 5d3a104d174255644d8d5335f58036e32695e85d | [
"BSD-3-Clause"
] | null | null | null | 0.11/_downloads/plot_brainstorm_data.py | drammock/mne-tools.github.io | 5d3a104d174255644d8d5335f58036e32695e85d | [
"BSD-3-Clause"
] | null | null | null | """
============================
Brainstorm tutorial datasets
============================
Here we compute the evoked from raw for the Brainstorm
tutorial dataset. For comparison, see:
http://neuroimage.usc.edu/brainstorm/Tutorials/MedianNerveCtf
References
----------
.. [1] Tadel F, Baillet S, Mosher JC, Pantazis D,... | 26.973684 | 78 | 0.706829 |
import numpy as np
import mne
from mne.datasets.brainstorm import bst_raw
from mne.io import Raw
print(__doc__)
tmin, tmax, event_id = -0.1, 0.3, 2 reject = dict(mag=4e-12, eog=250e-6)
data_path = bst_raw.data_path()
raw_fname = data_path + '/MEG/bst_raw/' + \
'subj001_somatosensory_2011... | true | true |
08f0be4983b11cc8101e22f80256bf7261761528 | 960 | py | Python | offer/migrations/0001_initial.py | noriHanda/study_matching | 55e9525c9502c45c799f8f3a4c9c2b54406ed9e1 | [
"MIT"
] | null | null | null | offer/migrations/0001_initial.py | noriHanda/study_matching | 55e9525c9502c45c799f8f3a4c9c2b54406ed9e1 | [
"MIT"
] | null | null | null | offer/migrations/0001_initial.py | noriHanda/study_matching | 55e9525c9502c45c799f8f3a4c9c2b54406ed9e1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-17 19:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 33.103448 | 145 | 0.630208 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
08f0be5423e2fff3199991eb98fbe34a75f7859b | 996 | py | Python | bugal/base/celery.py | aquitania99/bugal-app | 3e0d7253bde847962846b629085477244cb1abf2 | [
"MIT"
] | null | null | null | bugal/base/celery.py | aquitania99/bugal-app | 3e0d7253bde847962846b629085477244cb1abf2 | [
"MIT"
] | null | null | null | bugal/base/celery.py | aquitania99/bugal-app | 3e0d7253bde847962846b629085477244cb1abf2 | [
"MIT"
] | null | null | null | """Celery app config."""
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # prag... | 29.294118 | 96 | 0.735944 |
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
app = Celery('bugal')
app.config_from_object('django.conf:settings', namespace='CELERY')
class... | true | true |
08f0bf46a1189d2b7899de9634034d420c0c888d | 281 | py | Python | yatube/posts/forms.py | aleksannikit/yatube | 7852356c268f2cfabb727badd052b15cf64ea68b | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/forms.py | aleksannikit/yatube | 7852356c268f2cfabb727badd052b15cf64ea68b | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/forms.py | aleksannikit/yatube | 7852356c268f2cfabb727badd052b15cf64ea68b | [
"BSD-3-Clause"
] | null | null | null | from django import forms
from .models import Post, Comment
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['text', 'group', 'image']
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ['text', ]
| 18.733333 | 43 | 0.619217 | from django import forms
from .models import Post, Comment
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['text', 'group', 'image']
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ['text', ]
| true | true |
08f0bf7900c93e9e15e11a4c8f365937dc705c0b | 1,764 | py | Python | app.py | fernandoleira/stockengine | b66c5f98d460025d414422fc7dac24368d90d0ce | [
"MIT"
] | null | null | null | app.py | fernandoleira/stockengine | b66c5f98d460025d414422fc7dac24368d90d0ce | [
"MIT"
] | null | null | null | app.py | fernandoleira/stockengine | b66c5f98d460025d414422fc7dac24368d90d0ce | [
"MIT"
] | null | null | null | from flask import Flask, redirect, request, jsonify, make_response, send_file
from flask_heroku import Heroku
from datetime import datetime
from stockengine.stock import Stock
from stockengine.search import search_stock
from werkzeug import exceptions
app = Flask(__name__)
heroku = Heroku(app)
app.secret_key = 'eO\xd... | 25.565217 | 77 | 0.680839 | from flask import Flask, redirect, request, jsonify, make_response, send_file
from flask_heroku import Heroku
from datetime import datetime
from stockengine.stock import Stock
from stockengine.search import search_stock
from werkzeug import exceptions
app = Flask(__name__)
heroku = Heroku(app)
app.secret_key = 'eO\xd... | true | true |
08f0c072e28b09dfbbde2f662b52f5de4cf46f3d | 5,513 | py | Python | youtube_dl/extractor/uol.py | incognitoRepo/youtube-dl | e9dbbbd87e200d37f15531973fe653c3573cfd0b | [
"Unlicense"
] | 16 | 2020-12-01T15:26:58.000Z | 2022-02-24T23:12:14.000Z | youtube_dl/extractor/uol.py | DesperateSolutions/youtube-dl-reup | 3d924243efdbda61e2e5f2fae3ac0beb73d9bd87 | [
"Unlicense"
] | 5 | 2021-02-20T10:30:00.000Z | 2021-06-01T21:12:31.000Z | youtube_dl/extractor/uol.py | DesperateSolutions/youtube-dl-reup | 3d924243efdbda61e2e5f2fae3ac0beb73d9bd87 | [
"Unlicense"
] | 7 | 2020-12-01T15:27:04.000Z | 2022-01-09T23:21:53.000Z | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_duration,
update_url_query,
str_or_none,
)
class UOLIE(InfoExtractor):
IE_NAME = 'uol.com.br'
_VALID_URL = r'https?://(?:.+?\.)?uol\.com\.br/.*?(?... | 34.45625 | 158 | 0.520044 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_duration,
update_url_query,
str_or_none,
)
class UOLIE(InfoExtractor):
IE_NAME = 'uol.com.br'
_VALID_URL = r'https?://(?:.+?\.)?uol\.com\.br/.*?(?:(?:mediaId|v)=|... | true | true |
08f0c138be1aa13da856d20dbb282437466e6ac9 | 771 | py | Python | resources/lib/models/user.py | selu/kodi-addon-vimeo | 43fa8da52d9190d8f625d882d7af9894d0a6edba | [
"MIT"
] | 1 | 2020-12-15T20:45:20.000Z | 2020-12-15T20:45:20.000Z | resources/lib/models/user.py | selu/kodi-addon-vimeo | 43fa8da52d9190d8f625d882d7af9894d0a6edba | [
"MIT"
] | null | null | null | resources/lib/models/user.py | selu/kodi-addon-vimeo | 43fa8da52d9190d8f625d882d7af9894d0a6edba | [
"MIT"
] | null | null | null | from future import standard_library
standard_library.install_aliases() # noqa: E402
import urllib.parse
import xbmcgui
from resources.lib.models.list_item import ListItem
class User(ListItem):
thumb = ""
info = {}
uri = ""
def to_list_item(self, addon, addon_base):
list_item = xbmcgui.List... | 26.586207 | 74 | 0.597925 | from future import standard_library
standard_library.install_aliases()
import urllib.parse
import xbmcgui
from resources.lib.models.list_item import ListItem
class User(ListItem):
thumb = ""
info = {}
uri = ""
def to_list_item(self, addon, addon_base):
list_item = xbmcgui.ListItem(label=se... | true | true |
08f0c193568d2ba059954610bbc076d497f936c2 | 20,883 | py | Python | models/pix2pix_model.py | alexmasterdi/CoCosNet | 5d1e58eccca3cb67e1ae93e3719f425e7b8f0a67 | [
"MIT"
] | null | null | null | models/pix2pix_model.py | alexmasterdi/CoCosNet | 5d1e58eccca3cb67e1ae93e3719f425e7b8f0a67 | [
"MIT"
] | null | null | null | models/pix2pix_model.py | alexmasterdi/CoCosNet | 5d1e58eccca3cb67e1ae93e3719f425e7b8f0a67 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import torch.nn.functional as F
import models.networks as networks
import util.util as util
class Pix2PixModel(torch.nn.Module):
@staticmethod
def modify_commandline_options(parser, is_train):
networks.modify_comman... | 51.435961 | 178 | 0.606714 |
import torch
import torch.nn.functional as F
import models.networks as networks
import util.util as util
class Pix2PixModel(torch.nn.Module):
@staticmethod
def modify_commandline_options(parser, is_train):
networks.modify_commandline_options(parser, is_train)
return parser
def __init__(s... | true | true |
08f0c19d3bc07445faa3ce8f6b6dd4b01c7015ec | 3,374 | py | Python | venv/lib/python2.7/site-packages/opbeat/processors.py | CharleyFarley/ovvio | 81489ee64f91e4aab908731ce6ddf59edb9314bf | [
"MIT"
] | 99 | 2015-02-27T02:21:41.000Z | 2021-02-09T15:13:25.000Z | venv/lib/python2.7/site-packages/opbeat/processors.py | CharleyFarley/ovvio | 81489ee64f91e4aab908731ce6ddf59edb9314bf | [
"MIT"
] | 114 | 2015-01-16T15:06:49.000Z | 2018-04-13T20:29:18.000Z | venv/lib/python2.7/site-packages/opbeat/processors.py | CharleyFarley/ovvio | 81489ee64f91e4aab908731ce6ddf59edb9314bf | [
"MIT"
] | 51 | 2015-01-07T12:13:56.000Z | 2019-05-06T14:16:35.000Z | """
opbeat.core.processors
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011-2012 Opbeat
Large portions are
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
from opbeat.utils import six, varmap
from opbeat.utils.encoding import force_text
c... | 26.777778 | 79 | 0.533491 |
import re
from opbeat.utils import six, varmap
from opbeat.utils.encoding import force_text
class Processor(object):
def __init__(self, client):
self.client = client
def get_data(self, data, **kwargs):
return
def process(self, data, **kwargs):
resp = self.get_data(data, **kwarg... | true | true |
08f0c1facac01ae0a6554b6c7fd16b927b84e4ce | 925 | py | Python | service/users_service/admin.py | TCC-MonitoramentoInteligente/users | 60ba128feb549341dc879c6d504e287a3b87dde5 | [
"MIT"
] | null | null | null | service/users_service/admin.py | TCC-MonitoramentoInteligente/users | 60ba128feb549341dc879c6d504e287a3b87dde5 | [
"MIT"
] | null | null | null | service/users_service/admin.py | TCC-MonitoramentoInteligente/users | 60ba128feb549341dc879c6d504e287a3b87dde5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
# Register your models here.
@admin.register(User)
class UserAdmin(UserAdmin):
"""Define admin model for custom User model with no email field."""
fieldsets = (
(None, {'fields': ('email', 'passw... | 34.259259 | 76 | 0.572973 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
@admin.register(User)
class UserAdmin(UserAdmin):
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name')}),
('Permissions', ... | true | true |
08f0c218bf30da9528affeaf6ece0547953fdcac | 596 | py | Python | Course/migrations/0003_auto_20201011_1738.py | shubh242/E-Learning-App | 07320b1f1aba31602c3056398ffae16f2fa6f9ae | [
"MIT"
] | null | null | null | Course/migrations/0003_auto_20201011_1738.py | shubh242/E-Learning-App | 07320b1f1aba31602c3056398ffae16f2fa6f9ae | [
"MIT"
] | null | null | null | Course/migrations/0003_auto_20201011_1738.py | shubh242/E-Learning-App | 07320b1f1aba31602c3056398ffae16f2fa6f9ae | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-11 12:08
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('Client', '0003_score_maximum'),
('Course', '0002_auto_202... | 23.84 | 66 | 0.619128 |
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('Client', '0003_score_maximum'),
('Course', '0002_auto_20201011_1737'),
]
operations = [
... | true | true |
08f0c27eefd077f5206f386d15615ab12f13dcff | 1,313 | py | Python | python/pytorch_examples.py | anjianli21/ilqgames | 2be8e2bc6d34a9a6296d341b75d59e37c9057ad5 | [
"BSD-3-Clause"
] | 53 | 2019-11-25T02:51:12.000Z | 2022-01-12T18:30:02.000Z | python/pytorch_examples.py | anjianli21/ilqgames | 2be8e2bc6d34a9a6296d341b75d59e37c9057ad5 | [
"BSD-3-Clause"
] | 42 | 2019-10-05T20:22:04.000Z | 2022-02-09T20:10:35.000Z | python/pytorch_examples.py | anjianli21/ilqgames | 2be8e2bc6d34a9a6296d341b75d59e37c9057ad5 | [
"BSD-3-Clause"
] | 23 | 2020-01-02T13:33:12.000Z | 2022-03-06T01:55:28.000Z | import torch
import numpy as np
x = torch.ones(2, 1, requires_grad=True)
# Try out some gradient descent.
print("Trying out some gradient descent.")
ii = 1
while True:
y = torch.sum(x ** 2 - 1.5 * x[0, 0] + 2.4 * x[1, 0])
y.backward()
if x.grad.norm() < 1e-3 or ii > 1000:
break
a = 0.1 / ii**... | 22.254237 | 66 | 0.614623 | import torch
import numpy as np
x = torch.ones(2, 1, requires_grad=True)
print("Trying out some gradient descent.")
ii = 1
while True:
y = torch.sum(x ** 2 - 1.5 * x[0, 0] + 2.4 * x[1, 0])
y.backward()
if x.grad.norm() < 1e-3 or ii > 1000:
break
a = 0.1 / ii**1.5
ii += 1
x.data -= a *... | true | true |
08f0c2865f6a23a814ad2ffd00888daefbef27ce | 3,695 | py | Python | contrib/macdeploy/custom_dsstore.py | qtumproject/qtum-ledger-loader | 30371a9b82622f35e6cffe00bb47f8d292aa0ecd | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | qtumproject/qtum-ledger-loader | 30371a9b82622f35e6cffe00bb47f8d292aa0ecd | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | qtumproject/qtum-ledger-loader | 30371a9b82622f35e6cffe00bb47f8d292aa0ecd | [
"MIT"
] | 1 | 2022-01-25T01:49:59.000Z | 2022-01-25T01:49:59.000Z | #!/usr/bin/env python3
# Copyright (c) 2013-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 61.583333 | 1,817 | 0.723139 | import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': '{{300, 280}, {500, 343}}',
'ContainerShowSidebar': False,
'Sideba... | true | true |
08f0c36e77fe11224617e723e26bfd6b319db3e6 | 4,170 | py | Python | PyOpenWorm/import_override.py | gsarma/PyOpenWorm | 477ae0b5453109785d9711f1e270510681d9585f | [
"MIT"
] | null | null | null | PyOpenWorm/import_override.py | gsarma/PyOpenWorm | 477ae0b5453109785d9711f1e270510681d9585f | [
"MIT"
] | 1 | 2015-05-23T19:26:57.000Z | 2015-05-26T02:04:43.000Z | PyOpenWorm/import_override.py | gsarma/PyOpenWorm | 477ae0b5453109785d9711f1e270510681d9585f | [
"MIT"
] | 1 | 2015-06-21T17:34:15.000Z | 2015-06-21T17:34:15.000Z | import wrapt
from PyOpenWorm.import_contextualizer import ImportContextualizer
import six
class Overrider(object):
instances = dict()
def __new__(cls, mapper):
if len(Overrider.instances.keys()) > 1:
raise Exception('Only one Overrider should exist. There are overriders for these: ' +
... | 38.971963 | 116 | 0.484892 | import wrapt
from PyOpenWorm.import_contextualizer import ImportContextualizer
import six
class Overrider(object):
instances = dict()
def __new__(cls, mapper):
if len(Overrider.instances.keys()) > 1:
raise Exception('Only one Overrider should exist. There are overriders for these: ' +
... | true | true |
08f0c382e39a73a56e38a3097dc9cd43057312be | 105 | py | Python | zcls/model/layers/__init__.py | ZJCV/PyCls | 1ef59301646b6134f2ffcc009b4fd76550fa4089 | [
"Apache-2.0"
] | 110 | 2021-02-04T14:32:57.000Z | 2022-03-30T01:51:56.000Z | zcls/model/layers/__init__.py | likyoo/ZCls | 568621aca3a8b090c93345f0858d52c5757f2f0e | [
"Apache-2.0"
] | 8 | 2021-04-11T02:46:57.000Z | 2021-12-14T19:30:58.000Z | zcls/model/layers/__init__.py | likyoo/ZCls | 568621aca3a8b090c93345f0858d52c5757f2f0e | [
"Apache-2.0"
] | 20 | 2021-02-07T14:17:07.000Z | 2022-03-22T05:20:40.000Z | # -*- coding: utf-8 -*-
"""
@date: 2020/11/4 下午5:03
@file: __init__.py.py
@author: zj
@description:
""" | 13.125 | 23 | 0.580952 | true | true | |
08f0c3e2544ec8d5fb60102050b77640b4372b8b | 2,462 | py | Python | salt/modules/monit.py | wikimedia/operations-debs-salt | be6342abc7401ff92f67ed59f7834f1359f35314 | [
"Apache-2.0"
] | null | null | null | salt/modules/monit.py | wikimedia/operations-debs-salt | be6342abc7401ff92f67ed59f7834f1359f35314 | [
"Apache-2.0"
] | null | null | null | salt/modules/monit.py | wikimedia/operations-debs-salt | be6342abc7401ff92f67ed59f7834f1359f35314 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Monit service module. This module will create a monit type
service watcher.
'''
# Import salt libs
import salt.utils
def __virtual__():
if salt.utils.which('monit') is not None:
# The monit binary exists, let the module load
return True
return False
def start(nam... | 20.347107 | 76 | 0.567831 |
import salt.utils
def __virtual__():
if salt.utils.which('monit') is not None:
return True
return False
def start(name):
cmd = 'monit start {0}'.format(name)
return not __salt__['cmd.retcode'](cmd, python_shell=False)
def stop(name):
cmd = 'monit stop {0}'.format(name)
r... | true | true |
08f0c3e981103100519f1258e23760c9b3dc76dd | 2,225 | py | Python | libreoffice/resolve_magic.py | vmiklos/vmexam | ff4ef386d3cfd84b8ed06387cbd87b119dd50448 | [
"MIT"
] | 1 | 2015-02-09T10:21:51.000Z | 2015-02-09T10:21:51.000Z | libreoffice/resolve_magic.py | vmiklos/vmexam | ff4ef386d3cfd84b8ed06387cbd87b119dd50448 | [
"MIT"
] | null | null | null | libreoffice/resolve_magic.py | vmiklos/vmexam | ff4ef386d3cfd84b8ed06387cbd87b119dd50448 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Resolves a magic number if we know it was constructed from flags of an enum.
#
# Example:... | 22.938144 | 103 | 0.660674 |
import sys
SwFrameInvFlags = {
0x01: "InvalidatePrt",
0x02: "InvalidateSize",
0x04: "InvalidatePos",
0x08: "SetCompletePaint",
0x10: "NextInvalidatePos",
0x20: "NextSetCompletePaint",
}
SwFlyFrameInvFlags = {
0x01: "InvalidatePos",
0x02: "InvalidateSize",
0x04: "InvalidatePrt",
0x08... | true | true |
08f0c4cf528d62cd3d971bc452ac193f2e944c0d | 6,035 | py | Python | test/functional/multi_rpc.py | SinghIshmeet/KuberCoinPoWScryptTest | 4ab9d0713b42ca79058cc4d626a38f60365e23e8 | [
"MIT"
] | null | null | null | test/functional/multi_rpc.py | SinghIshmeet/KuberCoinPoWScryptTest | 4ab9d0713b42ca79058cc4d626a38f60365e23e8 | [
"MIT"
] | null | null | null | test/functional/multi_rpc.py | SinghIshmeet/KuberCoinPoWScryptTest | 4ab9d0713b42ca79058cc4d626a38f60365e23e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 38.43949 | 129 | 0.612759 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import str_to_b64str, assert_equal
import os
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = False
s... | true | true |
08f0c5167cdcbfeb16de0fe13007fa8842830e3b | 20,038 | py | Python | chiptools/core/project.py | sarnold/chiptools | 067a1af6d14cec3a340f572b27acadbe0133b1cc | [
"Apache-2.0"
] | null | null | null | chiptools/core/project.py | sarnold/chiptools | 067a1af6d14cec3a340f572b27acadbe0133b1cc | [
"Apache-2.0"
] | 2 | 2021-07-20T01:17:05.000Z | 2021-10-22T01:53:52.000Z | chiptools/core/project.py | sarnold/chiptools | 067a1af6d14cec3a340f572b27acadbe0133b1cc | [
"Apache-2.0"
] | null | null | null | import importlib
import logging
import glob
import os
import traceback
import re
import unittest
from chiptools.common import exceptions
from chiptools.common import utils
from chiptools.common.filetypes import File
from chiptools.common.filetypes import Constraints
from chiptools.common.filetypes import ProjectAttrib... | 38.313576 | 79 | 0.608294 | import importlib
import logging
import glob
import os
import traceback
import re
import unittest
from chiptools.common import exceptions
from chiptools.common import utils
from chiptools.common.filetypes import File
from chiptools.common.filetypes import Constraints
from chiptools.common.filetypes import ProjectAttrib... | true | true |
08f0c726c146db2d6fb609c59b3cdf9c4c12aa06 | 20,639 | py | Python | tests/beeswax/impala_beeswax.py | radford-nguyen/impala | eb95c912cb7e720caf66388942b4e94d95e95658 | [
"Apache-2.0"
] | 1 | 2019-04-22T10:32:39.000Z | 2019-04-22T10:32:39.000Z | tests/beeswax/impala_beeswax.py | grcpeng/impala | 8412c772cb551c59fdb6e9dd59b49043f4aa9ef6 | [
"Apache-2.0"
] | 1 | 2019-05-06T07:23:34.000Z | 2019-05-06T07:23:34.000Z | tests/beeswax/impala_beeswax.py | grcpeng/impala | 8412c772cb551c59fdb6e9dd59b49043f4aa9ef6 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.690385 | 90 | 0.703668 |
import logging
import time
import shlex
import getpass
import re
from beeswaxd import BeeswaxService
from beeswaxd.BeeswaxService import QueryState
from datetime import datetime
try:
from ExecStats.ttypes import TExecStats
except ImportError:
pass
from ImpalaService import ImpalaService
from tests.util.thrift_u... | false | true |
08f0c79dea369bb9accc069a97660b5c5d20f06e | 4,420 | py | Python | troposphere/amplify.py | filipepmo/troposphere | b1590f58ed8cc86ba18a19ed93fc9380d6f7306b | [
"BSD-2-Clause"
] | null | null | null | troposphere/amplify.py | filipepmo/troposphere | b1590f58ed8cc86ba18a19ed93fc9380d6f7306b | [
"BSD-2-Clause"
] | null | null | null | troposphere/amplify.py | filipepmo/troposphere | b1590f58ed8cc86ba18a19ed93fc9380d6f7306b | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 51.0.0
from . import AWSObject, AWSProperty, PropsDictType, Tags
from .validators import boolean
class BasicAuth... | 30.909091 | 153 | 0.63371 |
from . import AWSObject, AWSProperty, PropsDictType, Tags
from .validators import boolean
class BasicAuthConfig(AWSProperty):
props: PropsDictType = {
"EnableBasicAuth": (boolean, False),
"Password": (str, True),
"Username": (str, True),
}
class EnvironmentVariable(AWSProperty):
... | true | true |
08f0c7a2864feb06c227e3c8afdce2d129fad05b | 5,756 | py | Python | baidu_python_record.py | cgx027/cc_edu | 62694a527501ab5d88a950c60251d8f6d20ccd04 | [
"Apache-2.0"
] | null | null | null | baidu_python_record.py | cgx027/cc_edu | 62694a527501ab5d88a950c60251d8f6d20ccd04 | [
"Apache-2.0"
] | null | null | null | baidu_python_record.py | cgx027/cc_edu | 62694a527501ab5d88a950c60251d8f6d20ccd04 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from pyaudio import PyAudio, paInt16
import numpy as np
from datetime import datetime
import wave
import time
import urllib, pycurl
from urllib.request import urlopen
import base64
import json
import os
import sys
from importlib import reload
# reload(sys)
# sys.setdefaultencoding( "utf-8" )
#一... | 32.156425 | 200 | 0.592078 | from pyaudio import PyAudio, paInt16
import numpy as np
from datetime import datetime
import wave
import time
import urllib, pycurl
from urllib.request import urlopen
import base64
import json
import os
import sys
from importlib import reload
save_count = 0
save_buffer = []
t = 0
sum = 0
flag_num = 0
filename = ''
dui... | true | true |
08f0c7ed527f751cf5bca4eb59e78e5249f01a4e | 2,283 | py | Python | tests/fastapi/test_app.py | alphavector/pandera | 7e1742fa4b750fdd47530c4107693ed72aa0f8e6 | [
"MIT"
] | 1 | 2019-08-18T22:10:52.000Z | 2019-08-18T22:10:52.000Z | tests/fastapi/test_app.py | alphavector/pandera | 7e1742fa4b750fdd47530c4107693ed72aa0f8e6 | [
"MIT"
] | null | null | null | tests/fastapi/test_app.py | alphavector/pandera | 7e1742fa4b750fdd47530c4107693ed72aa0f8e6 | [
"MIT"
] | null | null | null | # pylint: disable=redefined-outer-name,unused-argument
"""Unit tests for using pandera types in fastapi endpoints."""
import io
import subprocess
import time
from copy import deepcopy
import pandas as pd
import pytest
import requests
from hypothesis import given
from tests.fastapi.models import Transactions, Transac... | 28.5375 | 78 | 0.655278 |
import io
import subprocess
import time
from copy import deepcopy
import pandas as pd
import pytest
import requests
from hypothesis import given
from tests.fastapi.models import Transactions, TransactionsOut
@pytest.fixture(scope="module")
def app():
process = subprocess.Popen(
["uvicorn", "tests.f... | true | true |
08f0c7f993a50297951e23d2db8d7fd8bb2c93a2 | 790 | py | Python | touchdown/notifications/__init__.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 14 | 2015-01-05T18:18:04.000Z | 2022-02-07T19:35:12.000Z | touchdown/notifications/__init__.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 106 | 2015-01-06T00:17:13.000Z | 2019-09-07T00:35:32.000Z | touchdown/notifications/__init__.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 5 | 2015-01-30T10:18:24.000Z | 2022-02-07T19:35:13.000Z | # Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 39.5 | 85 | 0.788608 |
from .echo import EchoNotification
from .newrelic import NewRelicDeploymentNotification
from .slack import SlackNotification
__all__ = ["EchoNotification", "SlackNotification", "NewRelicDeploymentNotification"]
| true | true |
08f0c85bdc44f57a23dd0e4f8588579fec989efa | 1,030 | py | Python | setup.py | SourCherries/firecracker | 2397151e2d9f7b95fdf713b5d7c6235e89680883 | [
"MIT"
] | null | null | null | setup.py | SourCherries/firecracker | 2397151e2d9f7b95fdf713b5d7c6235e89680883 | [
"MIT"
] | null | null | null | setup.py | SourCherries/firecracker | 2397151e2d9f7b95fdf713b5d7c6235e89680883 | [
"MIT"
] | null | null | null | # import setuptools
# setuptools.setup()
# from setuptools import setup
import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="firecracker",
py_modules=["firecracker"],
version="1.0",
description="DO",
long_description=long_description,
l... | 32.1875 | 71 | 0.672816 | import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="firecracker",
py_modules=["firecracker"],
version="1.0",
description="DO",
long_description=long_description,
long_description_content_type="text/x-rst",
author="Carl Michael Gasp... | true | true |
08f0c90fc2f76269f05c4fb31269eb0ed3d79914 | 478 | py | Python | owoify/utility/flatten.py | deadshot465/owoify-py | 879812617615df0d33db151f9e37a99b3176dbb3 | [
"MIT"
] | 4 | 2020-11-30T06:46:22.000Z | 2021-08-22T18:32:38.000Z | owoify/utility/flatten.py | deadshot465/owoify.py | 8e3c05ec867848cfcae3a43b6a22c02db0ca111f | [
"MIT"
] | 2 | 2021-03-15T07:48:16.000Z | 2021-10-13T18:02:53.000Z | owoify/utility/flatten.py | deadshot465/owoify.py | 8e3c05ec867848cfcae3a43b6a22c02db0ca111f | [
"MIT"
] | null | null | null | import collections.abc
def flatten(arr: collections.abc.Iterable):
"""
Flatten the iterable collection. Modified from: https://note.nkmk.me/en/python-list-flatten/
:param arr: The iterable collection to flatten
:return: The generator of the flattened collection.
"""
for elem in arr:
if... | 31.866667 | 96 | 0.669456 | import collections.abc
def flatten(arr: collections.abc.Iterable):
for elem in arr:
if isinstance(elem, collections.abc.Iterable) and not isinstance(elem, (str, bytes)):
yield from flatten(elem)
else:
yield elem
| true | true |
08f0ca65eeafc2e2347ee003a2e89012b635f549 | 1,194 | py | Python | run_xbmc.py | libbymiller/notube-jabber-mythtv | eb8af36859cc5284838451e5b960b0b3abe981e8 | [
"MIT"
] | 1 | 2016-08-09T21:33:02.000Z | 2016-08-09T21:33:02.000Z | run_xbmc.py | libbymiller/notube-jabber-mythtv | eb8af36859cc5284838451e5b960b0b3abe981e8 | [
"MIT"
] | null | null | null | run_xbmc.py | libbymiller/notube-jabber-mythtv | eb8af36859cc5284838451e5b960b0b3abe981e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# This bot doesn't actualy do anything real, but just provides the outline.
# You shouldn't need myth or anything special to run it apart form pyxmpp
from pyxmpp import streamtls
from xbmc_pyxmpp_bot import XBMCBot
from pyxmpp.all import JID
from pyxmpp.jabber.client import JabberClient
import l... | 28.428571 | 82 | 0.734506 |
# You shouldn't need myth or anything special to run it apart form pyxmpp
from pyxmpp import streamtls
from xbmc_pyxmpp_bot import XBMCBot
from pyxmpp.all import JID
from pyxmpp.jabber.client import JabberClient
import locale
import codecs
import sys
class Client(JabberClient):
def __init__(self, jid, password):
... | false | true |
08f0caf5877ddab3a0257afa863151af29feaaf0 | 2,680 | py | Python | bindings/python/ensmallen/datasets/kgobo/clo.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/kgobo/clo.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/kgobo/clo.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 CLO.
The graph is automatically retrieved from the KGOBO repository.
References
---------------------
Please cite the following if you use the data:
```bib
@misc{kgobo,
title = "KG-OBO",
year = "2021",
author = "{Reese,... | 27.628866 | 73 | 0.629104 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def CLO(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/kgobo",
version: s... | true | true |
08f0cb2cd19766e84290a210600bd020914975c2 | 5,114 | py | Python | pyelfs/sftp_agent.py | kyusque/elfs | 62fc2d02d80a2bc5ec180ff7199e42c5243b2e2d | [
"MIT"
] | null | null | null | pyelfs/sftp_agent.py | kyusque/elfs | 62fc2d02d80a2bc5ec180ff7199e42c5243b2e2d | [
"MIT"
] | null | null | null | pyelfs/sftp_agent.py | kyusque/elfs | 62fc2d02d80a2bc5ec180ff7199e42c5243b2e2d | [
"MIT"
] | 2 | 2020-07-13T18:56:36.000Z | 2021-03-07T18:05:01.000Z | import json
import os
from getpass import getuser
from logging import getLogger
from os.path import expanduser
from random import random
from time import sleep
from tempfile import gettempdir
from . import CustomTransferAgent
from .sftp_auth import SftpAuth
from .util import ERROR_CODE, handle_error, Progress, stage_l... | 38.451128 | 95 | 0.513492 | import json
import os
from getpass import getuser
from logging import getLogger
from os.path import expanduser
from random import random
from time import sleep
from tempfile import gettempdir
from . import CustomTransferAgent
from .sftp_auth import SftpAuth
from .util import ERROR_CODE, handle_error, Progress, stage_l... | true | true |
08f0cc73f58fbabc53f05d321bdbac09ae5cbfcf | 3,181 | py | Python | technogix_iac_keywords/tools/dynamo.py | technogix-terraform/robotframework | e00b51ae3974bbf25b2c65238a869b3f9d776b9d | [
"MIT"
] | null | null | null | technogix_iac_keywords/tools/dynamo.py | technogix-terraform/robotframework | e00b51ae3974bbf25b2c65238a869b3f9d776b9d | [
"MIT"
] | null | null | null | technogix_iac_keywords/tools/dynamo.py | technogix-terraform/robotframework | e00b51ae3974bbf25b2c65238a869b3f9d776b9d | [
"MIT"
] | null | null | null | """ -----------------------------------------------------
# TECHNOGIX
# -------------------------------------------------------
# Copyright (c) [2022] Technogix SARL
# All rights reserved
# -------------------------------------------------------
# Keywords to manage dynamodb tasks
# -----------------------------... | 36.988372 | 98 | 0.522477 |
from sys import path as syspath
from os import path
from json import loads
syspath.append(path.normpath(path.join(path.dirname(__file__), './')))
from tool import Tool
class DynamoDBTools(Tool) :
def __init__(self):
super().__init__()
self.m_services.append('dynamodb')
def cre... | true | true |
08f0cc7d70146254902dd563aff81733d10203a6 | 8,190 | py | Python | eeggan/examples/high_gamma/models/baseline.py | kahartma/eeggan | 1fd5b45938ea6f1033f301430a5c7fb3b9bf4fb4 | [
"BSD-3-Clause"
] | 3 | 2020-08-04T08:54:55.000Z | 2021-02-19T14:17:46.000Z | eeggan/examples/high_gamma/models/baseline.py | kahartma/eeggan | 1fd5b45938ea6f1033f301430a5c7fb3b9bf4fb4 | [
"BSD-3-Clause"
] | 2 | 2020-10-08T14:14:20.000Z | 2021-06-11T07:08:42.000Z | eeggan/examples/high_gamma/models/baseline.py | kahartma/eeggan | 1fd5b45938ea6f1033f301430a5c7fb3b9bf4fb4 | [
"BSD-3-Clause"
] | 2 | 2020-07-06T11:00:36.000Z | 2020-08-10T20:48:43.000Z | # Author: Kay Hartmann <kg.hartma@gmail.com>
import numpy as np
from torch import nn
from torch.nn.init import calculate_gain
from eeggan.model.builder import ProgressiveModelBuilder
from eeggan.pytorch.modules.conv.multiconv import MultiConv1d
from eeggan.pytorch.modules.normalization.pixelnorm import PixelNorm
fro... | 44.27027 | 114 | 0.622589 |
import numpy as np
from torch import nn
from torch.nn.init import calculate_gain
from eeggan.model.builder import ProgressiveModelBuilder
from eeggan.pytorch.modules.conv.multiconv import MultiConv1d
from eeggan.pytorch.modules.normalization.pixelnorm import PixelNorm
from eeggan.pytorch.modules.projection.project im... | true | true |
08f0cd8fdaa1864df575fcb29cab1512058cb7e6 | 357 | py | Python | PythonExercicios/ex004.py | Renanfn/python | f8b930599f76c4eee57e2917c924283a1deac4db | [
"MIT"
] | null | null | null | PythonExercicios/ex004.py | Renanfn/python | f8b930599f76c4eee57e2917c924283a1deac4db | [
"MIT"
] | null | null | null | PythonExercicios/ex004.py | Renanfn/python | f8b930599f76c4eee57e2917c924283a1deac4db | [
"MIT"
] | null | null | null | a = input('Digite algo: ')
print('O tipo primitivo desse valor é', type(a))
print('Só tem espaços? ', a.isspace())
print('É um número? ', a.isnumeric())
print('É alfabético? ', a.isalpha())
print('É alfanumérico? ', a.isalnum())
print('Está em MAIÚSCULAS? ', a.isupper())
print('Está em minúsculas? ', a.islower())
print... | 35.7 | 48 | 0.663866 | a = input('Digite algo: ')
print('O tipo primitivo desse valor é', type(a))
print('Só tem espaços? ', a.isspace())
print('É um número? ', a.isnumeric())
print('É alfabético? ', a.isalpha())
print('É alfanumérico? ', a.isalnum())
print('Está em MAIÚSCULAS? ', a.isupper())
print('Está em minúsculas? ', a.islower())
print... | true | true |
08f0cdb1bb62b96c03ee767572fa51a99e1b204b | 2,162 | py | Python | integrations-and-supported-tools/kedro/scripts/kedro_neptune_advanced/src/kedro_neptune_advanced/settings.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 15 | 2021-06-11T16:35:15.000Z | 2022-03-29T15:53:59.000Z | integrations-and-supported-tools/kedro/scripts/kedro_neptune_advanced/src/kedro_neptune_advanced/settings.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 12 | 2021-04-26T13:07:50.000Z | 2021-11-15T10:50:03.000Z | integrations-and-supported-tools/kedro/scripts/kedro_neptune_advanced/src/kedro_neptune_advanced/settings.py | neptune-ai/examples | e64cfaadb028e2187063fc43768dfee44074729b | [
"MIT"
] | 10 | 2021-05-07T16:28:18.000Z | 2022-02-28T21:47:11.000Z | # Copyright 2021 QuantumBlack Visual Analytics Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 41.576923 | 79 | 0.775671 |
from kedro_neptune_advanced.hooks import ProjectHooks
HOOKS = (ProjectHooks(),)
| true | true |
08f0ce13ecf1b3971233bea8236f16e114aad6c2 | 1,434 | py | Python | main.py | mwpb/bayesian-regression | b7ee557d9301c1352e630aee998cbf652e4a481f | [
"MIT"
] | null | null | null | main.py | mwpb/bayesian-regression | b7ee557d9301c1352e630aee998cbf652e4a481f | [
"MIT"
] | null | null | null | main.py | mwpb/bayesian-regression | b7ee557d9301c1352e630aee998cbf652e4a481f | [
"MIT"
] | null | null | null | import math
import scipy.stats
import numpy as np
import pandas
from collections import defaultdict
df = list(pandas.read_csv("poverty.csv").itertuples(index=False))
cache = {}
def probability(mean, intercept, std):
if (mean, intercept, std) not in cache:
p = 0
for row in df:
x, y = r... | 31.866667 | 93 | 0.642259 | import math
import scipy.stats
import numpy as np
import pandas
from collections import defaultdict
df = list(pandas.read_csv("poverty.csv").itertuples(index=False))
cache = {}
def probability(mean, intercept, std):
if (mean, intercept, std) not in cache:
p = 0
for row in df:
x, y = r... | true | true |
08f0ce78b6690e538b7144070079506e3c0c7558 | 1,635 | py | Python | fetch_imgs_from_google.py | asiajo/face_image_scraper | 3bac8756d12cfcdb32647ca4bfe9f8931b3f0715 | [
"Apache-2.0"
] | null | null | null | fetch_imgs_from_google.py | asiajo/face_image_scraper | 3bac8756d12cfcdb32647ca4bfe9f8931b3f0715 | [
"Apache-2.0"
] | null | null | null | fetch_imgs_from_google.py | asiajo/face_image_scraper | 3bac8756d12cfcdb32647ca4bfe9f8931b3f0715 | [
"Apache-2.0"
] | null | null | null | import time
from selenium import webdriver
def fetch_image_urls_from_google(query: str, wd: webdriver, sleep_between_interactions: int = 1):
"""
Fetches all the urls of images found on the first result page for received search query.
:param query: query to search for
:param w... | 36.333333 | 120 | 0.64159 | import time
from selenium import webdriver
def fetch_image_urls_from_google(query: str, wd: webdriver, sleep_between_interactions: int = 1):
search_url = "https://www.google.com/search?q={q}&tbm=isch&hl=en-US&hl=en-US&tbs=isz%3Al&client=ubuntu&hs=hdu&ved" \
"=0CAEQpwVqFwoTCKDZh9KqmOgCFQAAAA... | true | true |
08f0cedc3164d6244b797038598fb181cdcfd8fb | 1,812 | py | Python | tests/acceptance/test_project_tags_settings.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_project_tags_settings.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_project_tags_settings.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase, SnubaTestCase
from sentry.testutils.helpers.datetime import iso_format, before_now
import pytz
event_time = before_now(days=3).replace(tzinfo=pytz.utc)
class ProjectTagsSettingsTest(AcceptanceTestCase, SnubaTestCase):
def se... | 40.266667 | 99 | 0.654525 | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase, SnubaTestCase
from sentry.testutils.helpers.datetime import iso_format, before_now
import pytz
event_time = before_now(days=3).replace(tzinfo=pytz.utc)
class ProjectTagsSettingsTest(AcceptanceTestCase, SnubaTestCase):
def se... | true | true |
08f0cf5f1f644183304c97c3516c83bdc46977e3 | 11 | py | Python | config.py | Hedy88/hurricane | 15bce944e7b1e60493c9ac5dafdf8497956d758b | [
"Apache-2.0"
] | 2 | 2022-01-10T18:29:25.000Z | 2022-01-11T04:56:47.000Z | config.py | Hedy88/hurricane | 15bce944e7b1e60493c9ac5dafdf8497956d758b | [
"Apache-2.0"
] | null | null | null | config.py | Hedy88/hurricane | 15bce944e7b1e60493c9ac5dafdf8497956d758b | [
"Apache-2.0"
] | null | null | null | PORT='3000' | 11 | 11 | 0.727273 | PORT='3000' | true | true |
08f0d030fb6af1821f5d444a3e8aec4426338d4f | 2,299 | py | Python | mnist/part2-mnist/nnet_cnn.py | tritus/ml-courses | 687c5006863ead9bee07dc3d76245a173c21528e | [
"MIT"
] | null | null | null | mnist/part2-mnist/nnet_cnn.py | tritus/ml-courses | 687c5006863ead9bee07dc3d76245a173c21528e | [
"MIT"
] | null | null | null | mnist/part2-mnist/nnet_cnn.py | tritus/ml-courses | 687c5006863ead9bee07dc3d76245a173c21528e | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import _pickle as c_pickle, gzip
import numpy as np
from tqdm import tqdm
import torch
import torch.autograd as autograd
import torch.nn.functional as F
import torch.nn as nn
import sys
sys.path.append("..")
import utils
from utils import *
from train_utils import batchify_data, run_epoch, train... | 31.067568 | 111 | 0.650283 |
import _pickle as c_pickle, gzip
import numpy as np
from tqdm import tqdm
import torch
import torch.autograd as autograd
import torch.nn.functional as F
import torch.nn as nn
import sys
sys.path.append("..")
import utils
from utils import *
from train_utils import batchify_data, run_epoch, train_model, Flatten
def ma... | true | true |
08f0d108587f3abc11c64053f6dba01183891965 | 6,518 | py | Python | pyod/test/test_iforest.py | shamimrezasohag/pyod | 5b5e1b355a5be4def2544ecd26d17e6e279d648c | [
"BSD-2-Clause"
] | null | null | null | pyod/test/test_iforest.py | shamimrezasohag/pyod | 5b5e1b355a5be4def2544ecd26d17e6e279d648c | [
"BSD-2-Clause"
] | null | null | null | pyod/test/test_iforest.py | shamimrezasohag/pyod | 5b5e1b355a5be4def2544ecd26d17e6e279d648c | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
# noinspection PyProtectedMember
from numpy.testing import assert_allclose
from numpy.testing import assert_array_less
from numpy.testing import assert_equal
from numpy.testing import as... | 36.824859 | 79 | 0.641915 |
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
from numpy.testing import assert_allclose
from numpy.testing import assert_array_less
from numpy.testing import assert_equal
from numpy.testing import assert_raises
from sklearn.utils.estimator_checks import c... | true | true |
08f0d1d5a402f91bd49ce5391e0e07fe048a1b1d | 3,441 | py | Python | tests/providers/amazon/aws/sensors/test_sagemaker_transform.py | wileeam/airflow | f46be8152a4d89c57db4ca46f5b3339e4876b723 | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | tests/providers/amazon/aws/sensors/test_sagemaker_transform.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | tests/providers/amazon/aws/sensors/test_sagemaker_transform.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# 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... | 33.735294 | 93 | 0.70619 |
import unittest
import mock
from airflow.exceptions import AirflowException
from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook
from airflow.providers.amazon.aws.sensors.sagemaker_transform import SageMakerTransformSensor
DESCRIBE_TRANSFORM_INPROGRESS_RESPONSE = {
'TransformJobStatus': 'InPro... | true | true |
08f0d251dc4ee128ce528b08bb696a6221cfa9e9 | 5,473 | py | Python | RecoTracker/SpecialSeedGenerators/python/CombinatorialSeedGeneratorForCosmicsP5_cff.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoTracker/SpecialSeedGenerators/python/CombinatorialSeedGeneratorForCosmicsP5_cff.py | gartung/cmssw | 3072dde3ce94dcd1791d778988198a44cde02162 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoTracker/SpecialSeedGenerators/python/CombinatorialSeedGeneratorForCosmicsP5_cff.py | gartung/cmssw | 3072dde3ce94dcd1791d778988198a44cde02162 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # The following comments couldn't be translated into the new config version:
#also some pairs in the barrel, in case the triplet fail. If the triplet secceds, the pairs should be skipped by the trajectory builder
#for the TEC we use pairs (Fasthelix not working properly with ss TEC hits)
# genereator for TEC+ outside... | 43.436508 | 136 | 0.676777 |
#also some pairs in the barrel, in case the triplet fail. If the triplet secceds, the pairs should be skipped by the trajectory builder
#for the TEC we use pairs (Fasthelix not working properly with ss TEC hits)
# genereator for TEC+ outsideIn
#generator for TEC+ insideOut
#generator for TEC- outsideIn
#generator fo... | true | true |
08f0d29472d26fb9b50e5f632468f265d621defa | 1,508 | py | Python | changes/jobs/import_repo.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | changes/jobs/import_repo.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | changes/jobs/import_repo.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, print_function
import logging
from datetime import datetime
from changes.config import db
from changes.models import Repository, RepositoryStatus
from changes.queue.task import tracked_task
logger = logging.getLogger('repo.sync')
@tracked_task(max_retries=None)
def import_r... | 24.721311 | 71 | 0.642573 | from __future__ import absolute_import, print_function
import logging
from datetime import datetime
from changes.config import db
from changes.models import Repository, RepositoryStatus
from changes.queue.task import tracked_task
logger = logging.getLogger('repo.sync')
@tracked_task(max_retries=None)
def import_r... | true | true |
08f0d372e84bee3c5e7e4f10cda8d07b495c8da8 | 288 | py | Python | fastlane_web/web_api/resources/__init__.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | 4 | 2021-12-10T20:30:22.000Z | 2022-01-06T17:08:20.000Z | fastlane_web/web_api/resources/__init__.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | fastlane_web/web_api/resources/__init__.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | from .health_check import HealthCheckAPI
from .pipeline import PipelineListAPI, PipelineAPI
from .pipeline_run import PipelineRunAPI, PipelineLastRunAPI
from .pipeline_memory import PipelineMemoryUsageAPI
from .pipeline_rps import PipelineRPSAPI
from .pipeline_logs import PipelineRunLogs | 48 | 60 | 0.885417 | from .health_check import HealthCheckAPI
from .pipeline import PipelineListAPI, PipelineAPI
from .pipeline_run import PipelineRunAPI, PipelineLastRunAPI
from .pipeline_memory import PipelineMemoryUsageAPI
from .pipeline_rps import PipelineRPSAPI
from .pipeline_logs import PipelineRunLogs | true | true |
08f0d4764a35433e985f37654a3a3014d9f12ed7 | 2,899 | py | Python | social_rl/multiagent_tfagents/football_gym_env.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | social_rl/multiagent_tfagents/football_gym_env.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | social_rl/multiagent_tfagents/football_gym_env.py | admariner/google-research | 7cee4b22b925581d912e8d993625c180da2a5a4f | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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... | 33.321839 | 77 | 0.735771 |
from gfootball import env as football_env
import gin
import gym
from social_rl.multiagent_tfagents import multiagent_gym_suite
class DictWrapper(gym.ObservationWrapper):
def __init__(self, env):
super().__init__(env)
self.observation_space = gym.spaces.Dict(
{'image': self.env.observation_space})
... | true | true |
08f0d4c09603b6506d610a66ccca8819fb1a747b | 2,369 | py | Python | test/filebox.py | alongubkin/filebox | dcd4b282bb3c0ad26f93d662169763653bf19a16 | [
"MIT"
] | null | null | null | test/filebox.py | alongubkin/filebox | dcd4b282bb3c0ad26f93d662169763653bf19a16 | [
"MIT"
] | null | null | null | test/filebox.py | alongubkin/filebox | dcd4b282bb3c0ad26f93d662169763653bf19a16 | [
"MIT"
] | null | null | null | import os
import tempfile
import pytest
import contextlib
import subprocess
import socket
import time
import platform
import glob
import uuid
FILEBOX_BASE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
FILEBOX_TEST_PORT = 8763
CLIENTS = 5
def get_filebox_executable(exe_type):
ARCH = {
'i3... | 24.42268 | 85 | 0.686366 | import os
import tempfile
import pytest
import contextlib
import subprocess
import socket
import time
import platform
import glob
import uuid
FILEBOX_BASE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
FILEBOX_TEST_PORT = 8763
CLIENTS = 5
def get_filebox_executable(exe_type):
ARCH = {
'i3... | true | true |
08f0d516d8e126f2401d22bee955e88f499132e7 | 1,017 | py | Python | container/google/cloud/container_v1/__init__.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2019-01-23T21:54:51.000Z | 2019-01-23T21:54:51.000Z | container/google/cloud/container_v1/__init__.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2018-04-06T19:51:23.000Z | 2018-04-06T19:51:23.000Z | container/google/cloud/container_v1/__init__.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2020-04-14T10:47:41.000Z | 2020-04-14T10:47:41.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 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... | 33.9 | 74 | 0.781711 |
from __future__ import absolute_import
from google.cloud.container_v1 import types
from google.cloud.container_v1.gapic import cluster_manager_client
from google.cloud.container_v1.gapic import enums
class ClusterManagerClient(cluster_manager_client.ClusterManagerClient):
__doc__ = cluster_manager_client.Cluste... | true | true |
08f0d57b036f6d7059e82687ebc45efd04a3ef62 | 3,256 | py | Python | examples/svm/plot_iris.py | NickVeld/scikit-learn-proj | 9694a5641a7abbec96c93817aed88ce827dbacd3 | [
"BSD-3-Clause"
] | 1 | 2021-11-26T12:22:13.000Z | 2021-11-26T12:22:13.000Z | examples/svm/plot_iris.py | NickVeld/scikit-learn-proj | 9694a5641a7abbec96c93817aed88ce827dbacd3 | [
"BSD-3-Clause"
] | null | null | null | examples/svm/plot_iris.py | NickVeld/scikit-learn-proj | 9694a5641a7abbec96c93817aed88ce827dbacd3 | [
"BSD-3-Clause"
] | null | null | null | """
==================================================
Plot different SVM classifiers in the iris dataset
==================================================
Comparison of different linear SVM classifiers on a 2D projection of the iris
dataset. We only consider the first 2 features of this dataset:
- Sepal length
- Se... | 34.638298 | 78 | 0.668305 | print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
iris = datasets.load_iris()
X = iris.data[:, :2] y = iris.target
h = .02
C = 1.0 svc = svm.SVC(kernel='linear', C=C).fit(X, y)
rbf_svc = svm.SVC(kernel='rbf', gamma=0.7, C=C).fit(X, y)
poly_s... | true | true |
08f0d6d29b89d86f889a86d2577517afac1e9e84 | 205 | py | Python | fx/fx/doctype/test_tree/test_tree.py | gpdev001/fx | 2d8e835a403266b209f42ac9abe72adb8d45ee8d | [
"MIT"
] | null | null | null | fx/fx/doctype/test_tree/test_tree.py | gpdev001/fx | 2d8e835a403266b209f42ac9abe72adb8d45ee8d | [
"MIT"
] | null | null | null | fx/fx/doctype/test_tree/test_tree.py | gpdev001/fx | 2d8e835a403266b209f42ac9abe72adb8d45ee8d | [
"MIT"
] | null | null | null | # Copyright (c) 2021, SERVIO Technologies and contributors
# For license information, please see license.txt
# import frappe
from frappe.utils.nestedset import NestedSet
class TestTree(NestedSet):
pass
| 22.777778 | 58 | 0.8 |
from frappe.utils.nestedset import NestedSet
class TestTree(NestedSet):
pass
| true | true |
08f0d7b82ec10aab72d9cdf79c526b482b20e5cc | 286 | py | Python | tests/test_mambabuild.py | tl-hbk/boa | 8cec2f0e374361fe6b6a83fde52b51d05e5f926a | [
"BSD-3-Clause"
] | null | null | null | tests/test_mambabuild.py | tl-hbk/boa | 8cec2f0e374361fe6b6a83fde52b51d05e5f926a | [
"BSD-3-Clause"
] | null | null | null | tests/test_mambabuild.py | tl-hbk/boa | 8cec2f0e374361fe6b6a83fde52b51d05e5f926a | [
"BSD-3-Clause"
] | null | null | null | import pathlib
from subprocess import check_call
def test_build_recipes():
recipes_dir = pathlib.Path(__file__).parent / "recipes"
recipes = [str(x) for x in recipes_dir.iterdir() if x.is_dir()]
for recipe in recipes:
check_call(["conda", "mambabuild", recipe])
| 23.833333 | 67 | 0.699301 | import pathlib
from subprocess import check_call
def test_build_recipes():
recipes_dir = pathlib.Path(__file__).parent / "recipes"
recipes = [str(x) for x in recipes_dir.iterdir() if x.is_dir()]
for recipe in recipes:
check_call(["conda", "mambabuild", recipe])
| true | true |
08f0d90baed087ce73d98f2eaf5f46c240da63b4 | 4,437 | py | Python | applications/facemask/libs/core.py | mrn-mln/neuralet | 9c73511d5cd585fbf6b3511d374b2133a2e0bb80 | [
"Apache-2.0"
] | 1 | 2020-04-10T12:12:18.000Z | 2020-04-10T12:12:18.000Z | applications/facemask/libs/core.py | mrn-mln/neuralet | 9c73511d5cd585fbf6b3511d374b2133a2e0bb80 | [
"Apache-2.0"
] | null | null | null | applications/facemask/libs/core.py | mrn-mln/neuralet | 9c73511d5cd585fbf6b3511d374b2133a2e0bb80 | [
"Apache-2.0"
] | null | null | null | import cv2 as cv
import numpy as np
class FaceMaskAppEngine:
"""
Perform detector which detects faces from input video,
and classifier to classify croped faces to face or mask class
:param config: Is a Config instance which provides necessary parameters.
"""
def __init__(self, config):
... | 40.706422 | 111 | 0.58801 | import cv2 as cv
import numpy as np
class FaceMaskAppEngine:
def __init__(self, config):
self.config = config
self.detector = None
self.classifier_model = None
self.running_video = False
self.device = self.config.DEVICE
if self.device == "x86":
from lib... | true | true |
08f0d93f7219c006c495cf9051c24dda81c914ef | 7,733 | py | Python | mnist_multiple_exploration_baseline_v11.py | nikhil-garg/VDSP_ocl | 906867f8cd8a899a1ce309c5ec843fa1ce865373 | [
"MIT"
] | null | null | null | mnist_multiple_exploration_baseline_v11.py | nikhil-garg/VDSP_ocl | 906867f8cd8a899a1ce309c5ec843fa1ce865373 | [
"MIT"
] | null | null | null | mnist_multiple_exploration_baseline_v11.py | nikhil-garg/VDSP_ocl | 906867f8cd8a899a1ce309c5ec843fa1ce865373 | [
"MIT"
] | 1 | 2021-03-17T20:04:08.000Z | 2021-03-17T20:04:08.000Z |
import itertools
import random
import logging
import numpy as np
import matplotlib.pyplot as plt
import os
from mnist_vdsp_multiple_baseline import *
from utilis import *
from args_mnist import args as my_args
# from ax import optimize
import pandas as pd
from itertools import product
import time
if __name__ == '__m... | 34.216814 | 678 | 0.596276 |
import itertools
import random
import logging
import numpy as np
import matplotlib.pyplot as plt
import os
from mnist_vdsp_multiple_baseline import *
from utilis import *
from args_mnist import args as my_args
import pandas as pd
from itertools import product
import time
if __name__ == '__main__':
args = my_args()... | true | true |
08f0d97c178069ee36248628bcddc407cf2dc35e | 1,961 | py | Python | examples/functional_api/chapter_1.py | xhan97/zenml | 8d87d76c6a4cca8862af3183975c8f292dafa49d | [
"Apache-2.0"
] | null | null | null | examples/functional_api/chapter_1.py | xhan97/zenml | 8d87d76c6a4cca8862af3183975c8f292dafa49d | [
"Apache-2.0"
] | null | null | null | examples/functional_api/chapter_1.py | xhan97/zenml | 8d87d76c6a4cca8862af3183975c8f292dafa49d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) ZenML GmbH 2021. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 32.147541 | 80 | 0.704233 |
import numpy as np
import tensorflow as tf
from zenml.integrations.constants import TENSORFLOW
from zenml.pipelines import pipeline
from zenml.repository import Repository
from zenml.steps import Output, step
@step
def importer_mnist() -> Output(
X_train=np.ndarray, y_train=np.ndarray, X_test=np.ndarray, y_test... | true | true |
08f0d9a14919d55421d4bc1c94b7a19b3aa4b2f5 | 6,148 | py | Python | contrib/devtools/symbol-check.py | Thanoos/limra | f56c00d81a54bac81f2d5ded472553cf16e824e7 | [
"MIT"
] | null | null | null | contrib/devtools/symbol-check.py | Thanoos/limra | f56c00d81a54bac81f2d5ded472553cf16e824e7 | [
"MIT"
] | null | null | null | contrib/devtools/symbol-check.py | Thanoos/limra | f56c00d81a54bac81f2d5ded472553cf16e824e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc+... | 37.487805 | 167 | 0.652895 | import subprocess
import re
import sys
import os
MAX_VERSIONS = {
'GCC': (4,4,0),
'CXXABI': (1,3,3),
'GLIBCXX': (3,4,13),
'GLIBC': (2,11)
}
IGNORE_EXPORTS = {
'_edata', '_end', '_init', '__bss_start', '_fini', '_IO_stdin_used', 'stdin', 'stdout', 'stderr'
}
READELF_CMD = os.getenv('READELF', '/usr/bin/readelf'... | true | true |
08f0d9edbb627a706d4f7b6a81aedece19ef56b5 | 452 | py | Python | getdata.py | asoback/Limits-To-Energy-Growth | 5568195644c0b11ad6c8ecbf03161e2990841cfb | [
"MIT"
] | null | null | null | getdata.py | asoback/Limits-To-Energy-Growth | 5568195644c0b11ad6c8ecbf03161e2990841cfb | [
"MIT"
] | null | null | null | getdata.py | asoback/Limits-To-Energy-Growth | 5568195644c0b11ad6c8ecbf03161e2990841cfb | [
"MIT"
] | null | null | null | import csv
with open('DataSources/MER_T01_01.csv') as csv_file:
with open('DataSources/newData.csv', mode='w') as out_file:
csv_writer = csv.writer(out_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csv_reader = csv.DictReader(csv_file)
for row in csv_reader:
if ... | 50.222222 | 104 | 0.626106 | import csv
with open('DataSources/MER_T01_01.csv') as csv_file:
with open('DataSources/newData.csv', mode='w') as out_file:
csv_writer = csv.writer(out_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csv_reader = csv.DictReader(csv_file)
for row in csv_reader:
if ... | true | true |
08f0dad7bd6b90e5efc3cf5f947f55a8e834e322 | 835 | py | Python | python/contrib/human_protein_map_classification/scripts/verify_result.py | Dedederek/samples | 31d99de20af2f7046556e0f48c4b789b99e422f8 | [
"Apache-2.0"
] | 5 | 2021-02-26T17:58:12.000Z | 2022-03-15T06:21:28.000Z | python/contrib/human_protein_map_classification/scripts/verify_result.py | Dedederek/samples | 31d99de20af2f7046556e0f48c4b789b99e422f8 | [
"Apache-2.0"
] | null | null | null | python/contrib/human_protein_map_classification/scripts/verify_result.py | Dedederek/samples | 31d99de20af2f7046556e0f48c4b789b99e422f8 | [
"Apache-2.0"
] | 5 | 2021-03-22T21:13:11.000Z | 2021-09-24T06:52:33.000Z | """
Copyright (R) @huawei.com, all rights reserved
-*- coding:utf-8 -*-
CREATED: 2020-12-11 10:12:13
MODIFIED: 2020-12-11 14:04:45
"""
import sys
import math
import operator
import functools
from PIL import Image
import filecmp
def image_contrast(image1, image2):
"""
Verify that the pictures are the same
... | 20.365854 | 107 | 0.631138 | import sys
import math
import operator
import functools
from PIL import Image
import filecmp
def image_contrast(image1, image2):
file1 = Image.open(image1)
file2 = Image.open(image2)
h1 = file1.histogram()
h2 = file2.histogram()
ret = math.sqrt(functools.reduce(operator.add, list(map(lamb... | true | true |
08f0db42593b978ab02bda2610a0e0a875fa770f | 20,904 | py | Python | DeepPurpose/dataset.py | Mariam05/DeepPurpose | f78b089f2289a9f6498332cf6bd4eaf8bd170732 | [
"BSD-3-Clause"
] | null | null | null | DeepPurpose/dataset.py | Mariam05/DeepPurpose | f78b089f2289a9f6498332cf6bd4eaf8bd170732 | [
"BSD-3-Clause"
] | null | null | null | DeepPurpose/dataset.py | Mariam05/DeepPurpose | f78b089f2289a9f6498332cf6bd4eaf8bd170732 | [
"BSD-3-Clause"
] | 2 | 2021-05-04T07:23:41.000Z | 2021-12-05T15:10:02.000Z | import pandas as pd
import numpy as np
import wget
from zipfile import ZipFile
from DeepPurpose.utils import *
import json
import os
'''
Acknowledgement:
The BindingDB dataset is hosted in https://www.bindingdb.org/bind/index.jsp.
The Davis Dataset can be found in http://staff.cs.utu.fi/~aatapa/data/DrugTarget/.
The... | 41.312253 | 944 | 0.782338 | import pandas as pd
import numpy as np
import wget
from zipfile import ZipFile
from DeepPurpose.utils import *
import json
import os
def read_file_training_dataset_bioassay(path):
try:
file = open(path, "r")
except:
print('Path Not Found, please double check!')
target = file.readline()
if target[-1:] == '\n'... | true | true |
08f0dca43214ea2b0ab6146c6272eaa052bb633c | 7,684 | py | Python | Code/6- Blackjack.py | Xgb6train167/01.game002 | 4fae18fd11a1651c52bd58964c381d61cd7385ed | [
"MIT"
] | 33 | 2019-12-11T14:34:33.000Z | 2022-03-29T05:44:21.000Z | Code/6- Blackjack.py | Xgb6train167/01.game002 | 4fae18fd11a1651c52bd58964c381d61cd7385ed | [
"MIT"
] | 1 | 2020-05-14T06:28:13.000Z | 2020-12-07T11:06:47.000Z | Code/6- Blackjack.py | Xgb6train167/01.game002 | 4fae18fd11a1651c52bd58964c381d61cd7385ed | [
"MIT"
] | 17 | 2019-12-02T15:55:53.000Z | 2022-03-30T03:45:03.000Z | # Mini-project #6 - Blackjack
#---------------------------------------------------------------
#---------------------------------------------------------------
#---------------------------------------------------------------
import simplegui
import random
#------------------------------------------------------------... | 29.328244 | 122 | 0.445992 |
import simplegui
import random
CARD_SIZE = (72, 96)
CARD_CENTER = (36, 48)
card_images = simplegui.load_image("http://storage.googleapis.com/codeskulptor-assets/cards_jfitz.png")
CARD_BACK_SIZE = (72, 96)
CARD_BACK_CENTER = (36, 48)
card_back = simplegui.load_image("http://storage.googleapis.com/codeskulptor-asset... | false | true |
08f0dcff0e43ddc1663df273bbb00f6fc1e350f3 | 1,592 | py | Python | plugins/redshift/dbt/adapters/redshift/impl.py | ClaySheffler/dbt | 588851ac1cd2ef9856706f14cee573dedbc46d8c | [
"Apache-2.0"
] | 1 | 2020-08-11T08:44:33.000Z | 2020-08-11T08:44:33.000Z | plugins/redshift/dbt/adapters/redshift/impl.py | ClaySheffler/dbt | 588851ac1cd2ef9856706f14cee573dedbc46d8c | [
"Apache-2.0"
] | null | null | null | plugins/redshift/dbt/adapters/redshift/impl.py | ClaySheffler/dbt | 588851ac1cd2ef9856706f14cee573dedbc46d8c | [
"Apache-2.0"
] | 1 | 2019-04-16T10:51:10.000Z | 2019-04-16T10:51:10.000Z | from dbt.adapters.postgres import PostgresAdapter
from dbt.adapters.redshift import RedshiftConnectionManager
from dbt.logger import GLOBAL_LOGGER as logger # noqa
import dbt.exceptions
class RedshiftAdapter(PostgresAdapter):
ConnectionManager = RedshiftConnectionManager
AdapterSpecificConfigs = frozenset({... | 35.377778 | 78 | 0.691583 | from dbt.adapters.postgres import PostgresAdapter
from dbt.adapters.redshift import RedshiftConnectionManager
from dbt.logger import GLOBAL_LOGGER as logger import dbt.exceptions
class RedshiftAdapter(PostgresAdapter):
ConnectionManager = RedshiftConnectionManager
AdapterSpecificConfigs = frozenset({"sort_t... | true | true |
08f0dd022975be1da22c6b7f7ee5ed932c8744d6 | 20,285 | py | Python | ufit/models/base.py | McStasMcXtrace/ufit | 02640e2b802bf6d42ae6829a1c1852b21c6fa9f7 | [
"BSD-2-Clause"
] | null | null | null | ufit/models/base.py | McStasMcXtrace/ufit | 02640e2b802bf6d42ae6829a1c1852b21c6fa9f7 | [
"BSD-2-Clause"
] | null | null | null | ufit/models/base.py | McStasMcXtrace/ufit | 02640e2b802bf6d42ae6829a1c1852b21c6fa9f7 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# ufit, a universal scattering fitting suite
#
# Copyright (c) 2013-2019, Georg Brandl and contributors. All rights reserved.
# Licensed under a 2-clause BSD license, see LICENSE.
# ********************************... | 35.278261 | 82 | 0.574562 |
import re
import inspect
import operator
from functools import reduce
from numpy import concatenate
from ufit import param, backends, UFitError, Param, Dataset
from ufit.result import Result, MultiResult
from ufit.utils import get_chisqr, cached_property
from ufit.plotting import DataPlotter
from ufit.pycompat impo... | true | true |
08f0ddd8831b6b72f0797e5f12b689a8c29ff517 | 2,130 | py | Python | python/main.py | ohsnapitskenny/PRO_LEO2 | a143ee936a5276c10cdf4a2d75ff4a432aec9b9e | [
"BSD-2-Clause"
] | null | null | null | python/main.py | ohsnapitskenny/PRO_LEO2 | a143ee936a5276c10cdf4a2d75ff4a432aec9b9e | [
"BSD-2-Clause"
] | null | null | null | python/main.py | ohsnapitskenny/PRO_LEO2 | a143ee936a5276c10cdf4a2d75ff4a432aec9b9e | [
"BSD-2-Clause"
] | null | null | null | import time
from flask import Flask
from flask_cors import CORS
from neopixel import *
# NeoPixel
LED_COUNT = 12 # Number of LED PIXELS
LED_PIN = 18 # GPIO 18 / PIN 12
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
LED_DMA = 10 # DMA channel to use for generating signal (try 10)
LED_INVERT =... | 26.296296 | 98 | 0.653521 | import time
from flask import Flask
from flask_cors import CORS
from neopixel import *
LED_COUNT = 12 LED_PIN = 18 LED_FREQ_HZ = 800000 LED_DMA = 10 LED_INVERT = False LED_BRIGHTNESS = 100
WAIT_MS = 40
RED = Color(255, 0,0)
BLUE = Color(0, 0, 255)
ORANGE = Color(255, 165, 0)
BLACK = Color(0, 0, 0)
app = Flas... | true | true |
08f0ddebf5f52f0aecf8f1af595e0fc1efd9981b | 4,359 | py | Python | sdk/python/pulumi_packet/volume_attachment.py | pulumi/pulumi-packet | 2d72d0c426057d7cafeb518cd8c1ec5a402643fa | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2018-12-16T20:46:51.000Z | 2020-09-07T16:16:13.000Z | sdk/python/pulumi_packet/volume_attachment.py | pulumi/pulumi-packet | 2d72d0c426057d7cafeb518cd8c1ec5a402643fa | [
"ECL-2.0",
"Apache-2.0"
] | 14 | 2019-02-20T22:23:46.000Z | 2020-12-14T10:26:03.000Z | sdk/python/pulumi_packet/volume_attachment.py | pulumi/pulumi-packet | 2d72d0c426057d7cafeb518cd8c1ec5a402643fa | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2019-04-30T13:55:13.000Z | 2020-10-28T20:49:15.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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
from . import _utilities... | 41.514286 | 134 | 0.642808 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities, _tables
__all__ = ['VolumeAttachment']
class VolumeAttachment(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Option... | true | true |
08f0de74084ca0506ac914266ca99c7613f8a737 | 4,132 | py | Python | shog_gui.py | BurgundyIsAPublicEnemy/ShogAI | 6e22165a09a5663418a3ed7f1edbc20bcb7dd501 | [
"MIT"
] | null | null | null | shog_gui.py | BurgundyIsAPublicEnemy/ShogAI | 6e22165a09a5663418a3ed7f1edbc20bcb7dd501 | [
"MIT"
] | 3 | 2020-02-03T00:35:02.000Z | 2020-03-02T12:29:31.000Z | shog_gui.py | BurgundyIsAPublicEnemy/ShogAI | 6e22165a09a5663418a3ed7f1edbc20bcb7dd501 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import messagebox
import copy
import upsidedown
from shog_logic import shog_logic
class shog_gui():
def __init__(self, gameState):
self.gameState = gameState
self.board_size = gameState.board_size
self.gameMatrix = gameState.gameMatrix
def drawInitia... | 36.566372 | 169 | 0.599952 | from tkinter import *
from tkinter import messagebox
import copy
import upsidedown
from shog_logic import shog_logic
class shog_gui():
def __init__(self, gameState):
self.gameState = gameState
self.board_size = gameState.board_size
self.gameMatrix = gameState.gameMatrix
def drawInitia... | true | true |
08f0df09ec387081a438f9aa690bb70b693af537 | 8,033 | py | Python | examples/example_web_app/example_web_app/database.py | aalhour/cookiecutter-aiohttp-sqlalchemy | adc495653246d7471a26c66cdbefb25c6302f4fa | [
"MIT"
] | 46 | 2018-09-30T00:05:43.000Z | 2022-02-08T05:10:13.000Z | examples/example_web_app/example_web_app/database.py | aalhour/cookiecutter-aiohttp-sqlalchemy | adc495653246d7471a26c66cdbefb25c6302f4fa | [
"MIT"
] | 9 | 2018-10-02T09:01:15.000Z | 2020-05-27T08:17:28.000Z | examples/example_web_app/example_web_app/database.py | aalhour/cookiecutter-aiohttp-sqlalchemy | adc495653246d7471a26c66cdbefb25c6302f4fa | [
"MIT"
] | 7 | 2018-10-02T05:30:41.000Z | 2021-02-17T09:19:06.000Z | """
Database module.
Defines types, functions and primitives for the initialization, disposition and management of
database connections and their sessions.
"""
import os
import importlib.util
from pathlib import Path
from typing import Callable
from sqlalchemy import create_engine as _sa_create_engine
from sqlalche... | 31.750988 | 123 | 0.658036 | import os
import importlib.util
from pathlib import Path
from typing import Callable
from sqlalchemy import create_engine as _sa_create_engine
from sqlalchemy.schema import MetaData
from sqlalchemy.engine.base import Engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker... | true | true |
08f0e014bf0856873511802852b0364d20823fa4 | 10,865 | py | Python | deep_gas_oracle/modeling/model.py | louisoutin/deep_gas_oracle | 1f69483ee5e0310e8c533e6cf3f9668a54f9fdf5 | [
"MIT"
] | 22 | 2021-01-27T01:28:09.000Z | 2022-02-24T17:30:58.000Z | deep_gas_oracle/modeling/model.py | louisoutin/deep_gas_oracle | 1f69483ee5e0310e8c533e6cf3f9668a54f9fdf5 | [
"MIT"
] | 1 | 2021-03-21T15:32:00.000Z | 2021-03-23T13:11:44.000Z | deep_gas_oracle/modeling/model.py | louisoutin/deep_gas_oracle | 1f69483ee5e0310e8c533e6cf3f9668a54f9fdf5 | [
"MIT"
] | 5 | 2021-01-27T22:48:40.000Z | 2022-01-18T05:49:41.000Z | from pathlib import Path
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from .dataset import TimeSeriesDataset
from ..preprocessing.norm import Normalizer
class GruMultiStep(nn.Module):
def __init... | 39.653285 | 115 | 0.518638 | from pathlib import Path
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from .dataset import TimeSeriesDataset
from ..preprocessing.norm import Normalizer
class GruMultiStep(nn.Module):
def __init... | true | true |
08f0e0693760921e5eebf94be156bbdc3277907e | 528 | py | Python | Calandria/database.py | Scorcherfjk/flask_app | e797afb1e06c03b1c8bfa975f8d648314c3f589c | [
"Unlicense"
] | null | null | null | Calandria/database.py | Scorcherfjk/flask_app | e797afb1e06c03b1c8bfa975f8d648314c3f589c | [
"Unlicense"
] | null | null | null | Calandria/database.py | Scorcherfjk/flask_app | e797afb1e06c03b1c8bfa975f8d648314c3f589c | [
"Unlicense"
] | null | null | null | def conexion():
import pyodbc
server = 'DESKTOP-QV8E63C'
database = 'squeegee'
username = 'sa'
password = 'Controlsi'
cnxn = pyodbc.connect('DRIVER=SQL Server;SERVER={0};DATABASE={1};UID={2};PWD={3}'
.format(server,database,username,password))
cursor = cnxn.cursor()
cursor.ex... | 22 | 85 | 0.600379 | def conexion():
import pyodbc
server = 'DESKTOP-QV8E63C'
database = 'squeegee'
username = 'sa'
password = 'Controlsi'
cnxn = pyodbc.connect('DRIVER=SQL Server;SERVER={0};DATABASE={1};UID={2};PWD={3}'
.format(server,database,username,password))
cursor = cnxn.cursor()
cursor.ex... | true | true |
08f0e0824366bf6f0b9e109fde382057dcf81422 | 4,678 | py | Python | tensorflow/python/data/kernel_tests/repeat_test.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 10 | 2021-05-25T17:43:04.000Z | 2022-03-08T10:46:09.000Z | tensorflow/python/data/kernel_tests/repeat_test.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/data/kernel_tests/repeat_test.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.144144 | 80 | 0.719538 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
from tensorflow.python.data.kernel_tests import checkpoint_test_base
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.d... | true | true |
08f0e08f38e09915998e9c6fc7744c6b37bce4e1 | 9,347 | py | Python | RoiMatching.py | ZhouBo20171229/- | 56c9d859d6931cd971419c5225199acca6c189e5 | [
"MIT"
] | null | null | null | RoiMatching.py | ZhouBo20171229/- | 56c9d859d6931cd971419c5225199acca6c189e5 | [
"MIT"
] | null | null | null | RoiMatching.py | ZhouBo20171229/- | 56c9d859d6931cd971419c5225199acca6c189e5 | [
"MIT"
] | null | null | null | import os
import zipfile
import struct
import shutil
import numpy as np
from AreaComputing import *
from BatchRename import *
# import time
from math import *
from BatchZip import *
def DicBuild(Path):
# print(Path)
# print(os.path.isfile(Path))
if ~(os.path.isfile(Path)) + 2:
pr... | 45.154589 | 143 | 0.420135 | import os
import zipfile
import struct
import shutil
import numpy as np
from AreaComputing import *
from BatchRename import *
from math import *
from BatchZip import *
def DicBuild(Path):
if ~(os.path.isfile(Path)) + 2:
print('There is no .zip file!')
return [{},'']
el... | true | true |
08f0e0dc085b8182a2d9b006e4b968095910c011 | 962 | py | Python | tests/font/HALIGN.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 2 | 2015-06-02T19:14:37.000Z | 2017-09-17T03:49:19.000Z | tests/font/HALIGN.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | tests/font/HALIGN.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 2 | 2016-07-28T18:45:57.000Z | 2020-12-05T06:13:00.000Z | #!/usr/bin/env python
'''Test that font.Text horizontal alignment works.
Three labels will be rendered aligned left, center and right.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import font
from . import base_text
class TEST_HALIGN(base_text.TextTestBase):
font_... | 22.904762 | 78 | 0.596674 |
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import font
from . import base_text
class TEST_HALIGN(base_text.TextTestBase):
font_name = ''
def render(self):
fnt = font.load('', self.font_size)
h = fnt.ascent - fnt.descent
w = self.window.w... | true | true |
08f0e13e83ce4cf5a52eb159febf6b5130265e22 | 5,335 | py | Python | docs/conf.py | stephenkeegan/molecool | bb9907eca2c56caaa705ad8201d9428306a07fd8 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | stephenkeegan/molecool | bb9907eca2c56caaa705ad8201d9428306a07fd8 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | stephenkeegan/molecool | bb9907eca2c56caaa705ad8201d9428306a07fd8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 30.485714 | 119 | 0.657919 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import molecool
project = 'molecool'
copyright = ("2020, Stephen. Project structure based on the "
"Computational Molecular Science Python Cookiecutter version 1.1")
author = 'Stephen'
version = ''
release = ''
extensions = [
's... | true | true |
08f0e34523173abd3a80b8d16287e4c2a5a285be | 794 | py | Python | src/iOS/toga_iOS/widgets/image.py | d3r3kk/toga | 2d8c0eb30371c4ef4f0610251233569e9c618e93 | [
"BSD-3-Clause"
] | null | null | null | src/iOS/toga_iOS/widgets/image.py | d3r3kk/toga | 2d8c0eb30371c4ef4f0610251233569e9c618e93 | [
"BSD-3-Clause"
] | null | null | null | src/iOS/toga_iOS/widgets/image.py | d3r3kk/toga | 2d8c0eb30371c4ef4f0610251233569e9c618e93 | [
"BSD-3-Clause"
] | null | null | null | import os
import toga
from toga_iOS.libs import NSURL, NSData, UIImage
class Image(object):
def __init__(self, interface):
self.interface = interface
@staticmethod
def _get_full_path(path):
if path.startswith(('http://', 'https://')) or os.path.isabs(path):
return path
... | 33.083333 | 107 | 0.657431 | import os
import toga
from toga_iOS.libs import NSURL, NSData, UIImage
class Image(object):
def __init__(self, interface):
self.interface = interface
@staticmethod
def _get_full_path(path):
if path.startswith(('http://', 'https://')) or os.path.isabs(path):
return path
... | true | true |
08f0e57920d720737ee644528ffad5ff2ae6cd9f | 7,866 | py | Python | juriscraper/lib/html_utils.py | Alex-Devoid/juriscraper | 6ac2d5182dbf3aea14d918e645d582e9b42c9dd6 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/lib/html_utils.py | Alex-Devoid/juriscraper | 6ac2d5182dbf3aea14d918e645d582e9b42c9dd6 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/lib/html_utils.py | Alex-Devoid/juriscraper | 6ac2d5182dbf3aea14d918e645d582e9b42c9dd6 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import re
import sys
from lxml import etree, html
from lxml.etree import XMLSyntaxError
from lxml.html import fromstring, html5parser, tostring
from lxml.html.clean import Cleaner
from six import text_type
from six.moves.html_parser import HTMLParser
from six.moves.urllib.parse ... | 36.082569 | 85 | 0.65192 | import re
import sys
from lxml import etree, html
from lxml.etree import XMLSyntaxError
from lxml.html import fromstring, html5parser, tostring
from lxml.html.clean import Cleaner
from six import text_type
from six.moves.html_parser import HTMLParser
from six.moves.urllib.parse import urlsplit, urlunsplit
try:
... | true | true |
08f0e5d8e0186891c5caa34261b3e9ec7e389480 | 1,823 | py | Python | parser/fase2/team02/Fase2_G2/Instrucciones/FunctionBinaryString/Length.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team02/Fase2_G2/Instrucciones/FunctionBinaryString/Length.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team02/Fase2_G2/Instrucciones/FunctionBinaryString/Length.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | import Instrucciones
from Instrucciones.TablaSimbolos.Tipo import Tipo, Tipo_Dato
from Instrucciones.Expresiones.Primitivo import Primitivo
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import *
from Instrucciones.Identificador import *
class Length(Instruccion):
def ... | 49.27027 | 224 | 0.711465 | import Instrucciones
from Instrucciones.TablaSimbolos.Tipo import Tipo, Tipo_Dato
from Instrucciones.Expresiones.Primitivo import Primitivo
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import *
from Instrucciones.Identificador import *
class Length(Instruccion):
def ... | true | true |
08f0e85a666a8d6e6abb0c0480d70fcc97c456b6 | 7,655 | py | Python | examples/pwr_run/checkpointing/throughput/oracle/job18.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/oracle/job18.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/oracle/job18.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 33.138528 | 118 | 0.692097 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
08f0e9b2e64daa94209fe603242324e3fc4a3984 | 397 | py | Python | Chapter1/polarcoordinates.py | galinadychko/IntroToPython | 14b804f0d7f40e9e8cb515c885d01bdc5f70c627 | [
"MIT"
] | null | null | null | Chapter1/polarcoordinates.py | galinadychko/IntroToPython | 14b804f0d7f40e9e8cb515c885d01bdc5f70c627 | [
"MIT"
] | null | null | null | Chapter1/polarcoordinates.py | galinadychko/IntroToPython | 14b804f0d7f40e9e8cb515c885d01bdc5f70c627 | [
"MIT"
] | null | null | null | import sys
import math
import stdio
x, y = map(float, sys.argv[1:3])
r = math.sqrt(x ** 2 + y ** 2)
theta = math.atan2(y, x)
stdio.writeln("Input:\n" +
"-"*6 + "\n" +
"x:{}\n".format(x) +
"y:{}\n".format(y) +
"-"*15)
stdio.writeln("In polar system:\n" +
... | 22.055556 | 53 | 0.415617 | import sys
import math
import stdio
x, y = map(float, sys.argv[1:3])
r = math.sqrt(x ** 2 + y ** 2)
theta = math.atan2(y, x)
stdio.writeln("Input:\n" +
"-"*6 + "\n" +
"x:{}\n".format(x) +
"y:{}\n".format(y) +
"-"*15)
stdio.writeln("In polar system:\n" +
... | true | true |
08f0e9b85e22410a5e474600b63d86802e5d86f9 | 1,244 | py | Python | setup.py | ifooth/iam-python-sdk | dcd677f334e8f38fb5894d3486a95f45b1c649f2 | [
"MIT"
] | 10 | 2021-03-08T09:50:12.000Z | 2022-02-09T04:08:09.000Z | setup.py | ifooth/iam-python-sdk | dcd677f334e8f38fb5894d3486a95f45b1c649f2 | [
"MIT"
] | 11 | 2021-03-15T03:03:15.000Z | 2022-03-04T03:15:22.000Z | setup.py | ifooth/iam-python-sdk | dcd677f334e8f38fb5894d3486a95f45b1c649f2 | [
"MIT"
] | 11 | 2021-03-08T09:19:47.000Z | 2021-11-22T02:36:25.000Z | import os
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
long_description = "bk-iam python sdk"
requires = [
"six>=1.11.0",
"cachetools==3.1.1",
"requests",
"curlify==2.2.1",
]
about = {}
with open(os.path.join(here, "iam", "__version__.py"), "r") as f:
exec(f.read(), about... | 28.272727 | 86 | 0.620579 | import os
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
long_description = "bk-iam python sdk"
requires = [
"six>=1.11.0",
"cachetools==3.1.1",
"requests",
"curlify==2.2.1",
]
about = {}
with open(os.path.join(here, "iam", "__version__.py"), "r") as f:
exec(f.read(), about... | true | true |
08f0eac4c5a894da39ad6545b4b70f168c0a01fa | 259 | py | Python | src/api/runner.py | alexander-sidorov/tms-z43 | 61ecd204f5de4e97ff0300f6ef91c36c2bcda31c | [
"MIT"
] | 2 | 2020-12-17T20:19:21.000Z | 2020-12-22T12:46:43.000Z | src/api/runner.py | alexander-sidorov/tms-z43 | 61ecd204f5de4e97ff0300f6ef91c36c2bcda31c | [
"MIT"
] | 4 | 2021-04-20T08:40:30.000Z | 2022-02-10T07:50:30.000Z | src/api/runner.py | alexander-sidorov/tms-z43 | 61ecd204f5de4e97ff0300f6ef91c36c2bcda31c | [
"MIT"
] | 1 | 2021-02-10T06:42:19.000Z | 2021-02-10T06:42:19.000Z | import uvicorn
from framework import dirs
if __name__ == "__main__":
uvicorn.run(
"project.asgi:application",
host="localhost",
log_level="debug",
port=8000,
reload=True,
reload_dirs=[dirs.DIR_SRC],
)
| 18.5 | 35 | 0.590734 | import uvicorn
from framework import dirs
if __name__ == "__main__":
uvicorn.run(
"project.asgi:application",
host="localhost",
log_level="debug",
port=8000,
reload=True,
reload_dirs=[dirs.DIR_SRC],
)
| true | true |
08f0eb247150ddac7df8f5f546ceb884ce6336da | 9,189 | py | Python | resources/Wireshark/WiresharkDissectorFoo/tools/make-manuf.py | joshis1/C_Programming | 4a8003321251448a167bfca0b595c5eeab88608d | [
"MIT"
] | 2 | 2020-09-11T05:51:42.000Z | 2020-12-31T11:42:02.000Z | resources/Wireshark/WiresharkDissectorFoo/tools/make-manuf.py | joshis1/C_Programming | 4a8003321251448a167bfca0b595c5eeab88608d | [
"MIT"
] | null | null | null | resources/Wireshark/WiresharkDissectorFoo/tools/make-manuf.py | joshis1/C_Programming | 4a8003321251448a167bfca0b595c5eeab88608d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
'''Update the "manuf" file.
Make-manuf creates a file containing ethernet OUIs and their company
IDs. It merges the... | 34.41573 | 169 | 0.606486 |
import csv
import io
import os
import re
import sys
if sys.version_info[0] >= 3:
import urllib.request, urllib.error, urllib.parse
import codecs
else:
import urllib2
have_icu = False
try:
import icu
have_icu = True
except ImportError:
pass
def exit_msg(msg=None, status=1):
if msg is ... | true | true |
08f0ebed59db201e9a2a53f64cb2c1134f20e041 | 1,453 | py | Python | count_PDF_pages/count_pages.py | ionpac/random_utilities | 5b1fa0183cf1777d93bfd810c830e63e6be5e7a3 | [
"Unlicense"
] | null | null | null | count_PDF_pages/count_pages.py | ionpac/random_utilities | 5b1fa0183cf1777d93bfd810c830e63e6be5e7a3 | [
"Unlicense"
] | null | null | null | count_PDF_pages/count_pages.py | ionpac/random_utilities | 5b1fa0183cf1777d93bfd810c830e63e6be5e7a3 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
from PyPDF2 import PdfFileReader
import os
from sys import argv
import sys
import re
if len(argv) < 2:
print("Usage: python {} [directory or pdf file] [optional regex filenames have to match]".format(argv[0]))
exit()
path = argv[1].strip('"') # trailing backslashes can escape the " character... | 24.627119 | 107 | 0.662078 |
from PyPDF2 import PdfFileReader
import os
from sys import argv
import sys
import re
if len(argv) < 2:
print("Usage: python {} [directory or pdf file] [optional regex filenames have to match]".format(argv[0]))
exit()
path = argv[1].strip('"') # trailing backslashes can escape the " character
print("Counting in dir... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.