hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f701966dbcbde2e302dd356581a77f271b483d27 | 1,420 | py | Python | vision/tests/unittests/test_gluoncv_object_detection.py | huibinshen/autogluon | 18c182c90df89762a916128327a6792b8887c5c6 | [
"Apache-2.0"
] | null | null | null | vision/tests/unittests/test_gluoncv_object_detection.py | huibinshen/autogluon | 18c182c90df89762a916128327a6792b8887c5c6 | [
"Apache-2.0"
] | null | null | null | vision/tests/unittests/test_gluoncv_object_detection.py | huibinshen/autogluon | 18c182c90df89762a916128327a6792b8887c5c6 | [
"Apache-2.0"
] | null | null | null | import pytest
from autogluon.core.space import Categorical
from autogluon.vision._gluoncv import ObjectDetection
def get_dataset(path):
return ObjectDetection.Dataset.from_voc(path)
@pytest.mark.skip(reason="ObjectDetector is not stable to test, and fails due to transient errors occasionally.")
def test_object... | 48.965517 | 171 | 0.759155 | import pytest
from autogluon.core.space import Categorical
from autogluon.vision._gluoncv import ObjectDetection
def get_dataset(path):
return ObjectDetection.Dataset.from_voc(path)
@pytest.mark.skip(reason="ObjectDetector is not stable to test, and fails due to transient errors occasionally.")
def test_object... | true | true |
f70197fc6a79be6feea98dd6115376e99549f28a | 1,644 | py | Python | KnowledgeMapping/puppeteer_exp/demo_ip.py | nickliqian/ralph_doc_to_chinese | be120ce2bb94a8e8395630218985f5e51ae087d9 | [
"MIT"
] | 8 | 2018-05-22T01:11:33.000Z | 2020-03-19T01:44:55.000Z | KnowledgeMapping/puppeteer_exp/demo_ip.py | yangliangguang/keep_learning | 47ab39c726cb28713ad22bf4cf39d6b146715910 | [
"MIT"
] | null | null | null | KnowledgeMapping/puppeteer_exp/demo_ip.py | yangliangguang/keep_learning | 47ab39c726cb28713ad22bf4cf39d6b146715910 | [
"MIT"
] | 3 | 2018-07-25T09:31:53.000Z | 2019-09-14T14:05:31.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import asyncio
import pyppeteer
import time
import os
import random
from exe_js import js1, js3, js4, js5
# http://www.mamicode.com/info-detail-2302923.html
# https://segmentfault.com/a/1190000011627343
"""
{
proxy: "127.0.0.1:1234",
proxy-auth: "userx:passx",
prox... | 28.842105 | 145 | 0.652068 |
import asyncio
import pyppeteer
import time
import os
import random
from exe_js import js1, js3, js4, js5
def input_time_random():
return random.randint(300, 500)
async def main():
print("in main ")
print(os.environ.get('PYPPETEER_CHROMIUM_REVISION'))
browser = await pyppeteer.launch(
exe... | true | true |
f701981ccf648a9810af3604f8f36ca0e814c54e | 170 | py | Python | api_yamdb/api_yamdb/wsgi.py | 4madeuz/DRF_exampe | ab4f155fcc0ed10912f8a05f57de6b45d4d836fd | [
"MIT"
] | null | null | null | api_yamdb/api_yamdb/wsgi.py | 4madeuz/DRF_exampe | ab4f155fcc0ed10912f8a05f57de6b45d4d836fd | [
"MIT"
] | 3 | 2021-06-05T00:11:14.000Z | 2021-09-22T19:57:18.000Z | api_yamdb/api_yamdb/wsgi.py | 4madeuz/DRF_exampe | ab4f155fcc0ed10912f8a05f57de6b45d4d836fd | [
"MIT"
] | 1 | 2022-02-16T07:46:34.000Z | 2022-02-16T07:46:34.000Z | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_yamdb.settings')
application = get_wsgi_application()
| 21.25 | 69 | 0.829412 | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_yamdb.settings')
application = get_wsgi_application()
| true | true |
f7019845428c7fc64ebcc3c40f655114efc7e296 | 4,330 | py | Python | bingo/settings.py | Rekha-Pal/Bingo-Buddy | 1ba705e049122faa6efb8b193d8bcd03680d9cb6 | [
"MIT"
] | null | null | null | bingo/settings.py | Rekha-Pal/Bingo-Buddy | 1ba705e049122faa6efb8b193d8bcd03680d9cb6 | [
"MIT"
] | null | null | null | bingo/settings.py | Rekha-Pal/Bingo-Buddy | 1ba705e049122faa6efb8b193d8bcd03680d9cb6 | [
"MIT"
] | null | null | null | """
Django settings for bingo project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# B... | 27.232704 | 100 | 0.706236 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR,'templates')
STATIC_DIR=os.path.join(BASE_DIR,'static')
MEDIA_ROOT=os.path.join(BASE_DIR,'static')
SECRET_KEY = '@k0#p3kidu)yaaa3u1hplxz)f@^6xiy384*(+n@@s5x#1bx@m5'
DEBUG = True
ALLOWED_HOSTS... | true | true |
f701988043815716192816ee9d1943d869d9d5e0 | 1,438 | py | Python | atari-game-play/steps/configs.py | zenml-io/zenfiles | b45e0effb22d9bb109262b997e60c9d356a69b2f | [
"Apache-2.0"
] | 15 | 2022-02-01T13:56:20.000Z | 2022-02-08T14:15:14.000Z | atari-game-play/steps/configs.py | zenml-io/zenfiles | b45e0effb22d9bb109262b997e60c9d356a69b2f | [
"Apache-2.0"
] | 2 | 2022-02-17T09:35:26.000Z | 2022-03-08T14:23:05.000Z | atari-game-play/steps/configs.py | zenml-io/zenfiles | b45e0effb22d9bb109262b997e60c9d356a69b2f | [
"Apache-2.0"
] | 5 | 2022-02-01T13:59:28.000Z | 2022-03-07T08:44:34.000Z | from zenml.steps import BaseStepConfig
class PreTrainingConfigs(BaseStepConfig):
# The configuration for the pre-training of the agent
ENV_NAME: str = "BreakoutDeterministic-v4"
WRITE_TENSORBOARD: bool = True
TENSORBOARD_DIR: str = "tensorboard/"
LEARNING_RATE: float = 0.00001
INP... | 35.073171 | 165 | 0.692629 | from zenml.steps import BaseStepConfig
class PreTrainingConfigs(BaseStepConfig):
ENV_NAME: str = "BreakoutDeterministic-v4"
WRITE_TENSORBOARD: bool = True
TENSORBOARD_DIR: str = "tensorboard/"
LEARNING_RATE: float = 0.00001
INPUT_SHAPE: tuple = (84, 84)
BATCH_SIZE: int = 32
... | true | true |
f70198ed9246ec768bc297a4af607b887745c332 | 1,677 | py | Python | educative/course1/stacks_queues/ch5_sort_stack_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | null | null | null | educative/course1/stacks_queues/ch5_sort_stack_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | null | null | null | educative/course1/stacks_queues/ch5_sort_stack_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | 1 | 2019-12-27T01:08:08.000Z | 2019-12-27T01:08:08.000Z | import educative.course1.stacks_queues.stack as s
input_data = [23, 60, 12, 42, 4, 97, 2]
expected_output_data = [2, 4, 12, 23, 42, 60, 97]
# This solution uses a second stack
# 1. until input stack is not empty, we pop the top value and compare it
# with the top value of the second stack
# 2. if value > top of s... | 35.680851 | 95 | 0.634466 | import educative.course1.stacks_queues.stack as s
input_data = [23, 60, 12, 42, 4, 97, 2]
expected_output_data = [2, 4, 12, 23, 42, 60, 97]
def sort_stack_1(stack):
result = s.Stack(stack.capacity, True)
while not stack.is_empty():
value = stack.pop()
if not result.is_empty() and ... | true | true |
f7019b7e9ff96813b178c0a284d211839bedd0c6 | 113,274 | py | Python | cassandra/metadata.py | mikefero/python-driver | 3a5bd85f0cccb4a74399dc5eb3b9e69e9af532c7 | [
"Apache-2.0"
] | null | null | null | cassandra/metadata.py | mikefero/python-driver | 3a5bd85f0cccb4a74399dc5eb3b9e69e9af532c7 | [
"Apache-2.0"
] | null | null | null | cassandra/metadata.py | mikefero/python-driver | 3a5bd85f0cccb4a74399dc5eb3b9e69e9af532c7 | [
"Apache-2.0"
] | null | null | null | # Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 38.307068 | 194 | 0.627929 |
from binascii import unhexlify
from bisect import bisect_left
from collections import defaultdict
from functools import total_ordering
from hashlib import md5
import json
import logging
import re
import six
from six.moves import zip
import sys
from threading import RLock
import struct
import random
murmu... | true | true |
f7019bcbba493a7e75313d52037640e545c8fb0a | 72 | py | Python | src/__init__.py | adaliuBC/DropEdge | c2bc536fec052559a3bbcbbe3dd27af2aae57440 | [
"MIT"
] | 380 | 2019-10-09T16:18:52.000Z | 2022-03-23T11:47:18.000Z | src/__init__.py | adaliuBC/DropEdge | c2bc536fec052559a3bbcbbe3dd27af2aae57440 | [
"MIT"
] | 16 | 2019-10-17T16:47:50.000Z | 2022-03-04T13:02:32.000Z | src/__init__.py | adaliuBC/DropEdge | c2bc536fec052559a3bbcbbe3dd27af2aae57440 | [
"MIT"
] | 72 | 2019-10-13T08:03:37.000Z | 2022-03-24T21:42:24.000Z | from __future__ import print_function
from __future__ import division
| 24 | 38 | 0.861111 | from __future__ import print_function
from __future__ import division
| true | true |
f7019c079af370cd129ec31bd1709f5d25f0a4d5 | 2,375 | py | Python | openstack_plugin/common/clients.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 5 | 2016-06-22T20:08:31.000Z | 2021-08-30T11:40:11.000Z | openstack_plugin/common/clients.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 61 | 2016-06-23T11:49:08.000Z | 2016-07-13T10:03:51.000Z | openstack_plugin/common/clients.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 1 | 2016-06-22T20:08:32.000Z | 2016-06-22T20:08:32.000Z | # Author: Denys Makogon
#
# 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 t... | 34.42029 | 78 | 0.685474 |
from glanceclient.v2 import client as glanceclient
from keystoneauth1 import loading
from keystoneauth1 import session
from keystoneclient import client as keystoneclient
from novaclient import client as novaclient
from neutronclient.v2_0 import client as neutronclient
class OpenStackClients(object):
... | true | true |
f7019d3e8de57db347a5428bc4bb44c24cb31213 | 3,332 | py | Python | fetcher/masterchef_apr_fetcher.py | Avalanche-FR-community/apr-fetcher | 25b12e8fe3da4a7ee678017b80dabc07990144f8 | [
"MIT"
] | null | null | null | fetcher/masterchef_apr_fetcher.py | Avalanche-FR-community/apr-fetcher | 25b12e8fe3da4a7ee678017b80dabc07990144f8 | [
"MIT"
] | null | null | null | fetcher/masterchef_apr_fetcher.py | Avalanche-FR-community/apr-fetcher | 25b12e8fe3da4a7ee678017b80dabc07990144f8 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from .apr_fetcher import APRFetcher
from typing import Dict, List, Union, Any
from .dapp_apr_fetcher import DappAPRFetcher
from .utils.utils import (
calculate_lp_token_price,
get_block_average_time,
get_token_price_from_dexs,
open_contract,
usdt_address,
platform_... | 40.144578 | 137 | 0.704982 | from abc import abstractmethod
from .apr_fetcher import APRFetcher
from typing import Dict, List, Union, Any
from .dapp_apr_fetcher import DappAPRFetcher
from .utils.utils import (
calculate_lp_token_price,
get_block_average_time,
get_token_price_from_dexs,
open_contract,
usdt_address,
platform_... | true | true |
f7019d6ec2203928ab2ee798997a992aada51e7e | 547 | py | Python | app/questionary/tests/test_quiz.py | brakebrinker/django-englishtest | 787d7fbdf8ab7da3d11f94a534963857770b88b5 | [
"MIT"
] | null | null | null | app/questionary/tests/test_quiz.py | brakebrinker/django-englishtest | 787d7fbdf8ab7da3d11f94a534963857770b88b5 | [
"MIT"
] | null | null | null | app/questionary/tests/test_quiz.py | brakebrinker/django-englishtest | 787d7fbdf8ab7da3d11f94a534963857770b88b5 | [
"MIT"
] | 1 | 2021-05-25T05:43:02.000Z | 2021-05-25T05:43:02.000Z | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
QUIZZES_URL = reverse('questionary:quiz-list')
class PublicQuizzesApiTests(TestCase):
"""Test the publicly available tags API"""
def setUp(self):
self.client ... | 27.35 | 71 | 0.740402 | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
QUIZZES_URL = reverse('questionary:quiz-list')
class PublicQuizzesApiTests(TestCase):
def setUp(self):
self.client = APIClient()
def test_login_required(self... | true | true |
f7019d7f6a6aad808f7a45c350dcbed3e0f01bc0 | 4,053 | py | Python | PythonApp/qc_serial/SerialStateMachine.py | CallMeCCLemon/queercon16-pillars | fc58ec21a62c4a8bc8f475e265edefeac0ebc129 | [
"BSD-3-Clause"
] | null | null | null | PythonApp/qc_serial/SerialStateMachine.py | CallMeCCLemon/queercon16-pillars | fc58ec21a62c4a8bc8f475e265edefeac0ebc129 | [
"BSD-3-Clause"
] | null | null | null | PythonApp/qc_serial/SerialStateMachine.py | CallMeCCLemon/queercon16-pillars | fc58ec21a62c4a8bc8f475e265edefeac0ebc129 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# Author: CallMeCCLemon
# Date: 2019
# Copyright: 2019 Thomas Littlejohn (@CallMeCCLemon) - Modified BSD License
###############################################################################
from enum import Enum
from Py... | 39.735294 | 97 | 0.625216 | true | true | |
f7019e9c6ca4456265e110317834c674537e93ef | 24,901 | py | Python | extras/openslides_gui/gui.py | DebVortex/OpenSlides | f17f1a723a034dd7ebe80cd4ff4385d97d020c5f | [
"MIT"
] | null | null | null | extras/openslides_gui/gui.py | DebVortex/OpenSlides | f17f1a723a034dd7ebe80cd4ff4385d97d020c5f | [
"MIT"
] | null | null | null | extras/openslides_gui/gui.py | DebVortex/OpenSlides | f17f1a723a034dd7ebe80cd4ff4385d97d020c5f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import Queue
import datetime
import errno
import gettext
import itertools
import json
import locale
import os
import subprocess
import sys
import threading
import wx
import openslides
from openslides.utils.main import (
detect_openslides_type,
filesystem2unicode,
... | 32.89432 | 80 | 0.615517 | from __future__ import unicode_literals
import Queue
import datetime
import errno
import gettext
import itertools
import json
import locale
import os
import subprocess
import sys
import threading
import wx
import openslides
from openslides.utils.main import (
detect_openslides_type,
filesystem2unicode,
... | true | true |
f7019f0d737cd3d77e15b898a760b40f9eb97817 | 4,711 | py | Python | djangocms_blog/migrations/0010_auto_20150923_1151.py | skirsdeda/djangocms-blog | 23d28962e5eb3fa6a82efbd3f7cce85679ae04e1 | [
"BSD-3-Clause"
] | null | null | null | djangocms_blog/migrations/0010_auto_20150923_1151.py | skirsdeda/djangocms-blog | 23d28962e5eb3fa6a82efbd3f7cce85679ae04e1 | [
"BSD-3-Clause"
] | null | null | null | djangocms_blog/migrations/0010_auto_20150923_1151.py | skirsdeda/djangocms-blog | 23d28962e5eb3fa6a82efbd3f7cce85679ae04e1 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
import aldryn_apphooks_config.fields
import app_data.fields
import djangocms_text_ckeditor.fields
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '__first__'),
('djangocms_blo... | 49.072917 | 249 | 0.624708 |
from __future__ import unicode_literals
import aldryn_apphooks_config.fields
import app_data.fields
import djangocms_text_ckeditor.fields
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '__first__'),
('djangocms_blog', '0009_latestpostsp... | true | true |
f7019f169af8f3f2b62f63f2c035f85dc91e1411 | 2,277 | py | Python | paragraph2actions/augmentation/compound_name_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 17 | 2020-04-09T06:04:56.000Z | 2022-03-21T09:22:37.000Z | paragraph2actions/augmentation/compound_name_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 1 | 2021-09-02T00:56:57.000Z | 2021-09-06T07:20:59.000Z | paragraph2actions/augmentation/compound_name_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 7 | 2020-07-21T01:15:30.000Z | 2022-03-21T09:23:31.000Z | import copy
import re
from collections import defaultdict
from typing import List, Dict
from .substitution_augmenter import SubstitutionAugmenter
from ..actions import Chemical
from ..utils import extract_chemicals
from paragraph2actions.misc import TextWithActions
class CompoundNameAugmenter(SubstitutionAugmenter):... | 38.59322 | 117 | 0.665788 | import copy
import re
from collections import defaultdict
from typing import List, Dict
from .substitution_augmenter import SubstitutionAugmenter
from ..actions import Chemical
from ..utils import extract_chemicals
from paragraph2actions.misc import TextWithActions
class CompoundNameAugmenter(SubstitutionAugmenter):... | true | true |
f7019fc569cb74e3d15397e3f62c30f72325dab6 | 6,038 | py | Python | app/stac_api/migrations/0016_auto_20210902_1731.py | geoadmin/service-stac | ee5064558133142160bd4fa15850f7528f5d70aa | [
"BSD-3-Clause"
] | 9 | 2020-08-17T11:01:48.000Z | 2022-01-17T22:24:13.000Z | app/stac_api/migrations/0016_auto_20210902_1731.py | geoadmin/service-stac | ee5064558133142160bd4fa15850f7528f5d70aa | [
"BSD-3-Clause"
] | 100 | 2020-08-14T05:56:40.000Z | 2022-03-01T22:39:58.000Z | app/stac_api/migrations/0016_auto_20210902_1731.py | geoadmin/service-stac | ee5064558133142160bd4fa15850f7528f5d70aa | [
"BSD-3-Clause"
] | 3 | 2020-09-02T14:01:07.000Z | 2021-07-27T06:30:26.000Z | # Generated by Django 3.1.13 on 2021-09-02 17:31
import django.contrib.postgres.fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('stac_api', '0015_data_collection_summaries'),
]
operations = [
migrations.AddFie... | 50.316667 | 114 | 0.47052 |
import django.contrib.postgres.fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('stac_api', '0015_data_collection_summaries'),
]
operations = [
migrations.AddField(
model_name='collection',
... | true | true |
f701a0734a4a1d19b5d201689491ebbaa931e073 | 20 | py | Python | dnd/constants/references.py | Saevon/webdnd | 4dd5d30ae105ede51bbd92bf5281a6965b7d55f4 | [
"MIT"
] | 4 | 2015-09-26T01:12:36.000Z | 2020-01-04T19:36:58.000Z | dnd/constants/references.py | Saevon/webdnd | 4dd5d30ae105ede51bbd92bf5281a6965b7d55f4 | [
"MIT"
] | null | null | null | dnd/constants/references.py | Saevon/webdnd | 4dd5d30ae105ede51bbd92bf5281a6965b7d55f4 | [
"MIT"
] | null | null | null | SOURCE_DOC_PATH = '' | 20 | 20 | 0.75 | SOURCE_DOC_PATH = '' | true | true |
f701a0d7186cec3acc6b2d5419f28cc2f64ee5c4 | 4,658 | py | Python | i3Deep/merge_labels.py | Karol-G/nnUNet | a30bdbd64254c94c515ee03617173eb217eea505 | [
"Apache-2.0"
] | 2 | 2022-03-18T12:49:28.000Z | 2022-03-24T14:39:20.000Z | i3Deep/merge_labels.py | Karol-G/nnUNet | a30bdbd64254c94c515ee03617173eb217eea505 | [
"Apache-2.0"
] | null | null | null | i3Deep/merge_labels.py | Karol-G/nnUNet | a30bdbd64254c94c515ee03617173eb217eea505 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from i3Deep import utils
from tqdm import tqdm
import os
# name = "KGU-53317EB91645"
# load_mask = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/" + name + "/mask.nii.gz"
# load_label_table = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/" + name + "/label_table.txt"
# save_mask = "D:/... | 39.474576 | 157 | 0.61915 | import numpy as np
from i3Deep import utils
from tqdm import tqdm
import os
load_path = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/"
def rename(case_path):
filenames = utils.load_filenames(case_path + "/", extensions=None)
for filename in filenames:
name = os.path.basename(filen... | true | true |
f701a0e0bac8930e8e013a4c8abaa3726fc575f7 | 14,150 | py | Python | mlflow/utils/rest_utils.py | devlibx/mlflowx | 291c51161ec26450b1e79c8e4a32af960da79591 | [
"Apache-2.0"
] | 1 | 2021-12-02T19:00:59.000Z | 2021-12-02T19:00:59.000Z | mlflow/utils/rest_utils.py | devlibx/mlflowx | 291c51161ec26450b1e79c8e4a32af960da79591 | [
"Apache-2.0"
] | 2 | 2022-02-14T21:58:58.000Z | 2022-02-27T21:44:09.000Z | mlflow/utils/rest_utils.py | devlibx/mlflowx | 291c51161ec26450b1e79c8e4a32af960da79591 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import requests
import urllib3
from contextlib import contextmanager
from packaging.version import Version
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from requests.exceptions import HTTPError
from mlflow import __version__
from mlflow.protos import databricks_pb2... | 40.31339 | 127 | 0.687067 | import base64
import json
import requests
import urllib3
from contextlib import contextmanager
from packaging.version import Version
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from requests.exceptions import HTTPError
from mlflow import __version__
from mlflow.protos import databricks_pb2... | true | true |
f701a2d5a7e3f8a3cda2bdf2b032006a0d23d1da | 12,777 | py | Python | difflikelihoods/sampling.py | pnkraemer/differentiable_likelihoods | a07876dbf8fcd4aa14bf36bd3e98e06ea10d2a94 | [
"MIT"
] | 7 | 2020-07-29T13:15:09.000Z | 2022-01-04T15:16:16.000Z | difflikelihoods/sampling.py | pnkraemer/differentiable_likelihoods | a07876dbf8fcd4aa14bf36bd3e98e06ea10d2a94 | [
"MIT"
] | null | null | null | difflikelihoods/sampling.py | pnkraemer/differentiable_likelihoods | a07876dbf8fcd4aa14bf36bd3e98e06ea10d2a94 | [
"MIT"
] | null | null | null | """
sampling.py
We sample Metropolis-Hastings:
* Random walk proposals
* Langevin proposals
* Langevin proposals with preconditioning
* Hamiltonian MC
* Hamiltonian MC with preconditioning
NOTE:
The functionality of this module is restricted to log-densities,
i.e. densities of the form p(s... | 32.677749 | 86 | 0.632386 |
import collections
from abc import ABC, abstractmethod
import numpy as np
from difflikelihoods import logdensity
def metropolishastings_rw(logpdf, nsamps, initstate, pwidth, ninits):
logdens = logdensity.LogDensity(logpdf)
rwmh = RandomWalkMH(logdens)
return rwmh.sample_nd(nsamps, initstate, pwidth, nini... | true | true |
f701a3bd912ec7dd82ad514397f651ce74c46977 | 16,336 | py | Python | tests/ut/python/dataset/test_random_crop_and_resize.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | 1 | 2021-06-02T02:46:20.000Z | 2021-06-02T02:46:20.000Z | tests/ut/python/dataset/test_random_crop_and_resize.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_random_crop_and_resize.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.102902 | 112 | 0.711741 |
import numpy as np
import cv2
import mindspore.dataset.transforms.py_transforms
import mindspore.dataset.vision.c_transforms as c_vision
import mindspore.dataset.vision.py_transforms as py_vision
import mindspore.dataset.vision.utils as mode
import mindspore.dataset as ds
from mindspore import log as log... | true | true |
f701a3f297c60253d22a493d95df26355ef4e656 | 52,558 | py | Python | test/augmentation/test_random_generator.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/augmentation/test_random_generator.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/augmentation/test_random_generator.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import pytest
import torch
from torch.testing import assert_allclose
from kornia.augmentation.random_generator import (
random_prob_generator,
random_color_jitter_generator,
random_perspective_generator,
random_affine_generator,
random_rotation_generator,
random_crop_generator,
random_crop_... | 45.114163 | 119 | 0.589121 | import pytest
import torch
from torch.testing import assert_allclose
from kornia.augmentation.random_generator import (
random_prob_generator,
random_color_jitter_generator,
random_perspective_generator,
random_affine_generator,
random_rotation_generator,
random_crop_generator,
random_crop_... | true | true |
f701a42275067e59f8ec099af3df99ce24399797 | 5,853 | py | Python | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/alexa/presentation/apl/parallel_command.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | null | null | null | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/alexa/presentation/apl/parallel_command.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | null | null | null | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/alexa/presentation/apl/parallel_command.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 44.007519 | 310 | 0.658466 |
import pprint
import re
import six
import typing
from enum import Enum
from ask_sdk_model.interfaces.alexa.presentation.apl.command import Command
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union, Any
from datetime import datetime
from ask_sdk_model.interfaces.alexa... | true | true |
f701a4e8d6c62f14457b5a5fe5464b1abcbc021e | 2,399 | py | Python | test/functional/p2p_timeouts.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | test/functional/p2p_timeouts.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | test/functional/p2p_timeouts.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Test Coin Super Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various net timeouts.
- Create three testcoinsuperd nodes:
no_verack_node - we never... | 32.418919 | 116 | 0.738224 |
from time import sleep
from test_framework.messages import msg_ping
from test_framework.mininode import P2PInterface
from test_framework.test_framework import TestCoinSuperTestFramework
class TestP2PConn(P2PInterface):
def on_version(self, message):
pass
class TimeoutsTest(TestCoinSuperTest... | true | true |
f701a4ef419edbf2ea2af74486dcd82605f2aa39 | 401 | py | Python | mrpython/version.py | Ikzue/MrPython | 2fb12d010c0b67b1119803080574a792ade6f289 | [
"PSF-2.0"
] | 5 | 2020-02-05T14:44:29.000Z | 2020-04-15T19:24:26.000Z | mrpython/version.py | Botsaa/MrPython | 264696204860b4e269b98c9ee4f4419b5ab5e039 | [
"PSF-2.0"
] | null | null | null | mrpython/version.py | Botsaa/MrPython | 264696204860b4e269b98c9ee4f4419b5ab5e039 | [
"PSF-2.0"
] | null | null | null |
MRPYTHON_VERSION_MAJOR = 3
MRPYTHON_VERSION_MINOR = 0
MRPYTHON_VERSION_PATCH = 9
MRPYTHON_VERSION_TAG = "beta"
def version_string():
return "{}.{}.{}{}".format(MRPYTHON_VERSION_MAJOR,
MRPYTHON_VERSION_MINOR,
MRPYTHON_VERSION_PATCH,
... | 28.642857 | 98 | 0.583541 |
MRPYTHON_VERSION_MAJOR = 3
MRPYTHON_VERSION_MINOR = 0
MRPYTHON_VERSION_PATCH = 9
MRPYTHON_VERSION_TAG = "beta"
def version_string():
return "{}.{}.{}{}".format(MRPYTHON_VERSION_MAJOR,
MRPYTHON_VERSION_MINOR,
MRPYTHON_VERSION_PATCH,
... | true | true |
f701a625c2071f626b47318c752e19e835dda579 | 577 | py | Python | train/optimize.py | creaiter/Classification-PyTorch | 2feabf4b3d0d561420399bdf65840a58af76069d | [
"MIT"
] | 1 | 2021-04-02T05:13:58.000Z | 2021-04-02T05:13:58.000Z | train/optimize.py | creaiter/Classification-PyTorch | 2feabf4b3d0d561420399bdf65840a58af76069d | [
"MIT"
] | null | null | null | train/optimize.py | creaiter/Classification-PyTorch | 2feabf4b3d0d561420399bdf65840a58af76069d | [
"MIT"
] | null | null | null | import torch
import torch.optim as optim
def set_optimizer(model, cfg):
r"""Sets the optimizer
"""
if cfg.optimizer == 'SGD':
optimizer = optim.SGD(model.parameters(), lr=cfg.lr,
momentum=cfg.momentum, weight_decay=cfg.weight_decay,
neste... | 33.941176 | 83 | 0.551127 | import torch
import torch.optim as optim
def set_optimizer(model, cfg):
if cfg.optimizer == 'SGD':
optimizer = optim.SGD(model.parameters(), lr=cfg.lr,
momentum=cfg.momentum, weight_decay=cfg.weight_decay,
nesterov=cfg.nesterov)
elif cfg.opti... | true | true |
f701a6a9a29c899827f6c090c2cc3954d90b3ede | 21,559 | py | Python | src/pytypes/onefuzztypes/models.py | chkeita/onefuzz | e413aec03dcd682c049855b77cf0b0042407ddc1 | [
"MIT"
] | null | null | null | src/pytypes/onefuzztypes/models.py | chkeita/onefuzz | e413aec03dcd682c049855b77cf0b0042407ddc1 | [
"MIT"
] | null | null | null | src/pytypes/onefuzztypes/models.py | chkeita/onefuzz | e413aec03dcd682c049855b77cf0b0042407ddc1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from datetime import datetime
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from uuid import UUID, uuid4
from pydantic import BaseModel, Field, root_validator, validator
from pydantic.datacl... | 25.819162 | 84 | 0.692611 |
from datetime import datetime
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from uuid import UUID, uuid4
from pydantic import BaseModel, Field, root_validator, validator
from pydantic.dataclasses import dataclass
from .consts import ONE_HOUR, SEVEN_DAYS
from .enums import (
OS,... | true | true |
f701a7a19672d4a369f690670c7acd3cd38db635 | 22,035 | py | Python | Software_project/primary_gui/test.py | fanghaow/srtp_project | d490f706dc5d2f26dd00563a0a0724cb442ff98d | [
"MIT"
] | 1 | 2021-07-06T14:27:39.000Z | 2021-07-06T14:27:39.000Z | Software_project/primary_gui/test.py | fanghaow/srtp_project | d490f706dc5d2f26dd00563a0a0724cb442ff98d | [
"MIT"
] | null | null | null | Software_project/primary_gui/test.py | fanghaow/srtp_project | d490f706dc5d2f26dd00563a0a0724cb442ff98d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, ... | 58.603723 | 101 | 0.718039 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(873, 697)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
... | true | true |
f701a8683774ddb24cb2f16bec478bfc6819e465 | 26 | py | Python | hackernews/__init__.py | samisnotinsane/hackernews-client | c1c6e7791c366a7df0dbec544e18104bccfa93c8 | [
"MIT"
] | 5 | 2020-03-15T10:35:29.000Z | 2021-09-07T18:50:16.000Z | hackernews/__init__.py | samisnotinsane/hackernews-client | c1c6e7791c366a7df0dbec544e18104bccfa93c8 | [
"MIT"
] | 9 | 2019-08-13T16:51:45.000Z | 2019-08-21T13:23:08.000Z | hackernews/__init__.py | samisnotinsane/hackernews-client | c1c6e7791c366a7df0dbec544e18104bccfa93c8 | [
"MIT"
] | null | null | null | from .hn import NewsClient | 26 | 26 | 0.846154 | from .hn import NewsClient | true | true |
f701a87736fbc584f7e9ffd3e6d8d63f457be0ba | 2,204 | py | Python | lhotse/manipulation.py | freewym/lhotse | 66e9bbaf25b75011388ab00189baa162c3c1d435 | [
"Apache-2.0"
] | null | null | null | lhotse/manipulation.py | freewym/lhotse | 66e9bbaf25b75011388ab00189baa162c3c1d435 | [
"Apache-2.0"
] | null | null | null | lhotse/manipulation.py | freewym/lhotse | 66e9bbaf25b75011388ab00189baa162c3c1d435 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
from itertools import chain
from operator import add
from typing import Iterable, Optional, TypeVar
from lhotse.audio import Recording, RecordingSet
from lhotse.cut import Cut, CutSet, MixedCut
from lhotse.features import FeatureSet, Features
from lhotse.supervision import SupervisionSegme... | 38 | 120 | 0.72686 | from functools import reduce
from itertools import chain
from operator import add
from typing import Iterable, Optional, TypeVar
from lhotse.audio import Recording, RecordingSet
from lhotse.cut import Cut, CutSet, MixedCut
from lhotse.features import FeatureSet, Features
from lhotse.supervision import SupervisionSegme... | true | true |
f701a89de548f767ba7b5a94b01d7537f9814e22 | 7,659 | py | Python | magenta/models/improv_rnn/improv_rnn_sequence_generator.py | bugrevelio/magenta | a54c6e4aa8b32f2625d416fb1b39b03d123e1e51 | [
"Apache-2.0"
] | 51 | 2016-11-06T16:48:47.000Z | 2021-11-12T08:59:58.000Z | magenta/models/improv_rnn/improv_rnn_sequence_generator.py | bugrevelio/magenta | a54c6e4aa8b32f2625d416fb1b39b03d123e1e51 | [
"Apache-2.0"
] | 1 | 2017-06-27T20:05:51.000Z | 2017-06-27T20:05:51.000Z | magenta/models/improv_rnn/improv_rnn_sequence_generator.py | bugrevelio/magenta | a54c6e4aa8b32f2625d416fb1b39b03d123e1e51 | [
"Apache-2.0"
] | 16 | 2016-11-10T06:31:02.000Z | 2020-01-22T12:07:28.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 44.789474 | 80 | 0.727118 |
from functools import partial
from magenta.models.improv_rnn import improv_rnn_model
import magenta.music as mm
class ImprovRnnSequenceGenerator(mm.BaseSequenceGenerator):
def __init__(self, model, details, steps_per_quarter=4, checkpoint=None,
bundle=None):
super(ImprovRnnSeque... | true | true |
f701a95e256e4511c3c6997f44261b1ac28e3d32 | 1,625 | py | Python | csrv/model/cards/runner/card01003.py | mrroach/CentralServer | e377c65d8f3adf5a2d3273acd4f459be697aea56 | [
"Apache-2.0"
] | null | null | null | csrv/model/cards/runner/card01003.py | mrroach/CentralServer | e377c65d8f3adf5a2d3273acd4f459be697aea56 | [
"Apache-2.0"
] | null | null | null | csrv/model/cards/runner/card01003.py | mrroach/CentralServer | e377c65d8f3adf5a2d3273acd4f459be697aea56 | [
"Apache-2.0"
] | 1 | 2020-09-20T11:26:20.000Z | 2020-09-20T11:26:20.000Z | from csrv.model import actions
from csrv.model.actions import play_run_event
from csrv.model import cost
from csrv.model import events
from csrv.model import timing_phases
from csrv.model.cards import card_info
from csrv.model.cards import event
class TrashForFree(actions.TrashOnAccess):
COST_CLASS = cost.NullCost
... | 29.017857 | 80 | 0.755692 | from csrv.model import actions
from csrv.model.actions import play_run_event
from csrv.model import cost
from csrv.model import events
from csrv.model import timing_phases
from csrv.model.cards import card_info
from csrv.model.cards import event
class TrashForFree(actions.TrashOnAccess):
COST_CLASS = cost.NullCost
... | true | true |
f701a97d3784b5f4cbf25b14e0548467c94684a3 | 27,688 | py | Python | Tests/test_integration.py | sergiooylo/content | 60b3a1022cffe536fdef2a94920c1e9d521dbdda | [
"MIT"
] | null | null | null | Tests/test_integration.py | sergiooylo/content | 60b3a1022cffe536fdef2a94920c1e9d521dbdda | [
"MIT"
] | null | null | null | Tests/test_integration.py | sergiooylo/content | 60b3a1022cffe536fdef2a94920c1e9d521dbdda | [
"MIT"
] | 1 | 2020-12-03T10:03:59.000Z | 2020-12-03T10:03:59.000Z | from __future__ import print_function
import copy
import time
from pprint import pformat
import uuid
import ast
import urllib
import urllib3
import requests.exceptions
from demisto_client.demisto_api.rest import ApiException
import demisto_client
import json
from Tests.test_utils import print_error, print_warning, pri... | 47.903114 | 120 | 0.631176 | from __future__ import print_function
import copy
import time
from pprint import pformat
import uuid
import ast
import urllib
import urllib3
import requests.exceptions
from demisto_client.demisto_api.rest import ApiException
import demisto_client
import json
from Tests.test_utils import print_error, print_warning, pri... | true | true |
f701a99f506b09342af3659b73251e1900d227a5 | 3,189 | py | Python | docs/conf.py | tpajurek-dtml/pydata-sphinx-theme | 925ac87225cf1e303b180e35a59809ac9db2e3b2 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | tpajurek-dtml/pydata-sphinx-theme | 925ac87225cf1e303b180e35a59809ac9db2e3b2 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | tpajurek-dtml/pydata-sphinx-theme | 925ac87225cf1e303b180e35a59809ac9db2e3b2 | [
"BSD-3-Clause"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 30.961165 | 87 | 0.644403 |
project = "PyData Sphinx Theme"
copyright = "2019, PyData Community"
author = "PyData Community"
release = "0.0.1dev0"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"numpydoc",
"recommonmark",
"jupyter_sphinx",
]
autosummary_generate = True
templates_... | true | true |
f701ab2ec78d85a7e8989abbfce1a933b877897f | 922 | py | Python | interfaces/gearman/requires.py | centauri-charmers/charm-zuul-executor | 2fb4adc1b042d7efe294574e3ce3b23cca9df6bb | [
"Apache-2.0"
] | null | null | null | interfaces/gearman/requires.py | centauri-charmers/charm-zuul-executor | 2fb4adc1b042d7efe294574e3ce3b23cca9df6bb | [
"Apache-2.0"
] | null | null | null | interfaces/gearman/requires.py | centauri-charmers/charm-zuul-executor | 2fb4adc1b042d7efe294574e3ce3b23cca9df6bb | [
"Apache-2.0"
] | null | null | null | from charms.reactive import Endpoint, when, set_flag, clear_flag
import charmhelpers.core.hookenv as hookenv
from charmhelpers.core.hookenv import log
class GearmanRequires(Endpoint):
@when('endpoint.{endpoint_name}.joined')
def joined(self):
# if any(unit.received['port'] for unit in self.all_joined_... | 36.88 | 74 | 0.650759 | from charms.reactive import Endpoint, when, set_flag, clear_flag
import charmhelpers.core.hookenv as hookenv
from charmhelpers.core.hookenv import log
class GearmanRequires(Endpoint):
@when('endpoint.{endpoint_name}.joined')
def joined(self):
set_flag(self.expand_name('available'))
@when... | true | true |
f701abc28c2e475986674f70ad2db19f55a743ca | 4,112 | py | Python | flee/InputGeography_food.py | timvink/flee | c7901e2a0de70f18c3267236e127ab1c26c8f5e5 | [
"BSD-3-Clause"
] | null | null | null | flee/InputGeography_food.py | timvink/flee | c7901e2a0de70f18c3267236e127ab1c26c8f5e5 | [
"BSD-3-Clause"
] | null | null | null | flee/InputGeography_food.py | timvink/flee | c7901e2a0de70f18c3267236e127ab1c26c8f5e5 | [
"BSD-3-Clause"
] | null | null | null | import csv
import sys
from flee import flee
from flee import SimulationSettings
class InputGeography:
"""
Class which reads in Geographic information.
"""
def __init__(self):
self.locations = []
self.links = []
def ReadLocationsFromCSV(self, csv_name, columns=["name", "region", "... | 32.377953 | 147 | 0.467656 | import csv
import sys
from flee import flee
from flee import SimulationSettings
class InputGeography:
def __init__(self):
self.locations = []
self.links = []
def ReadLocationsFromCSV(self, csv_name, columns=["name", "region", "country", "gps_x", "gps_y", "location_type", "conflict_date", "po... | true | true |
f701ac12f403dff5d5ffd0d52254d851cf2cca58 | 901 | py | Python | tpot_output _pipeline.py | vermaakarsh/Code-Vulnerability | 38791e2f2bc970bed4c4e8af397ac1f4ac4d7363 | [
"Apache-2.0"
] | null | null | null | tpot_output _pipeline.py | vermaakarsh/Code-Vulnerability | 38791e2f2bc970bed4c4e8af397ac1f4ac4d7363 | [
"Apache-2.0"
] | null | null | null | tpot_output _pipeline.py | vermaakarsh/Code-Vulnerability | 38791e2f2bc970bed4c4e8af397ac1f4ac4d7363 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
# NOTE: Make sure that the outcome column is labeled 'target' in the data file
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features =... | 45.05 | 86 | 0.801332 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features = tpot_data.drop('target', axis=1)
training_features, testing_features, trainin... | true | true |
f701ad039addc3139e0d9bb52293365f52a99e55 | 5,544 | py | Python | tests/unit/modules/brew_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 2 | 2017-09-17T21:10:35.000Z | 2019-08-26T03:00:12.000Z | tests/unit/modules/brew_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/brew_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 3 | 2021-02-23T08:12:48.000Z | 2021-02-23T08:13:13.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@satlstack.com>`
'''
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.mock import MagicMock, patch
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
from salt.modules i... | 33.197605 | 79 | 0.628066 |
from salttesting import TestCase
from salttesting.mock import MagicMock, patch
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
from salt.modules import brew
brew.__context__ = {}
brew.__salt__ = {}
TAPS_STRING = 'homebrew/dupes\nhomebrew/science\nhomebrew/x11'
TAPS_LIST = ['homebr... | true | true |
f701adc7789e0923c53cf8d6186000a9a0af4fa7 | 305,992 | py | Python | ibm_watson/compare_comply_v1.py | BuiQuangAnh/python-sdk | f9726a4f74d0a5a3ea901044af8565b4eea4d05e | [
"Apache-2.0"
] | null | null | null | ibm_watson/compare_comply_v1.py | BuiQuangAnh/python-sdk | f9726a4f74d0a5a3ea901044af8565b4eea4d05e | [
"Apache-2.0"
] | null | null | null | ibm_watson/compare_comply_v1.py | BuiQuangAnh/python-sdk | f9726a4f74d0a5a3ea901044af8565b4eea4d05e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# (C) Copyright IBM Corp. 2019, 2020.
#
# 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 la... | 42.043419 | 155 | 0.603382 |
import json
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
from .common import get_sdk_headers
from datetime import date
from datetime import datetime
from enum import Enum
from ibm_cloud_sdk_core import BaseService
from ibm_cloud_sdk_core import DetailedResponse
from ibm_clou... | true | true |
f701ae34f77efd8ff4cc435f28951c39d6332715 | 2,985 | py | Python | dassl/engine/dg/crossgrad.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | 1 | 2021-12-11T23:37:02.000Z | 2021-12-11T23:37:02.000Z | dassl/engine/dg/crossgrad.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | null | null | null | dassl/engine/dg/crossgrad.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | 1 | 2020-09-21T03:16:10.000Z | 2020-09-21T03:16:10.000Z | import torch
from torch.nn import functional as F
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import count_num_param
from dassl.engine import TRAINER_REGISTRY, TrainerX
from dassl.engine.trainer import SimpleNet
@TRAINER_REGISTRY.register()
class CrossGrad(TrainerX):
"""Cross-gra... | 33.920455 | 70 | 0.634506 | import torch
from torch.nn import functional as F
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import count_num_param
from dassl.engine import TRAINER_REGISTRY, TrainerX
from dassl.engine.trainer import SimpleNet
@TRAINER_REGISTRY.register()
class CrossGrad(TrainerX):
def __init_... | true | true |
f701aec6e638ee242787e854aea47bb65ae4772d | 2,327 | py | Python | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/DeleteGlobalAccelerationInstanceRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/DeleteGlobalAccelerationInstanceRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/DeleteGlobalAccelerationInstanceRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"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... | 38.147541 | 90 | 0.788139 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvpc.endpoint import endpoint_data
class DeleteGlobalAccelerationInstanceRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Vpc', '2016-04-28', 'DeleteGlobalAccelerationInstance','vpc')
if hasattr(self, "endpoint_map"):... | true | true |
f701aee858154e8cb77d9a32cdd49a298245ef0c | 4,748 | py | Python | AI-lec8-rnn/classify.py | 0HenryH/ai2021s | 1cadc3f963f7f2fba99441607e62c8da88183327 | [
"MIT"
] | null | null | null | AI-lec8-rnn/classify.py | 0HenryH/ai2021s | 1cadc3f963f7f2fba99441607e62c8da88183327 | [
"MIT"
] | null | null | null | AI-lec8-rnn/classify.py | 0HenryH/ai2021s | 1cadc3f963f7f2fba99441607e62c8da88183327 | [
"MIT"
] | null | null | null | import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import itertools
import collections
import matplotlib.pyplot as plt
# Read in data
df = pd.read_csv("Chinese_Names_Corpus_Gender(120W).txt", header=2)
df = df[df.sex != "未知"]
names = df["dict"].values
# Compute charact... | 27.766082 | 88 | 0.614153 | import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import itertools
import collections
import matplotlib.pyplot as plt
df = pd.read_csv("Chinese_Names_Corpus_Gender(120W).txt", header=2)
df = df[df.sex != "未知"]
names = df["dict"].values
chars = [list(name) for name in... | true | true |
f701af063627ad31533a04cbfc26bc4587ca9308 | 11,996 | py | Python | tests/test_integration.py | Jerry2001Qu/pennylane-qiskit | 7ba24ac6ab695d83508cd0f5064f7dfb1670a79b | [
"Apache-2.0"
] | null | null | null | tests/test_integration.py | Jerry2001Qu/pennylane-qiskit | 7ba24ac6ab695d83508cd0f5064f7dfb1670a79b | [
"Apache-2.0"
] | null | null | null | tests/test_integration.py | Jerry2001Qu/pennylane-qiskit | 7ba24ac6ab695d83508cd0f5064f7dfb1670a79b | [
"Apache-2.0"
] | null | null | null | import sys
import numpy as np
import pennylane as qml
import pytest
import qiskit
from pennylane_qiskit import AerDevice, BasicAerDevice
from conftest import state_backends
pldevices = [("qiskit.aer", qiskit.Aer), ("qiskit.basicaer", qiskit.BasicAer)]
class TestDeviceIntegration:
"""Test the devices work corr... | 35.808955 | 106 | 0.615038 | import sys
import numpy as np
import pennylane as qml
import pytest
import qiskit
from pennylane_qiskit import AerDevice, BasicAerDevice
from conftest import state_backends
pldevices = [("qiskit.aer", qiskit.Aer), ("qiskit.basicaer", qiskit.BasicAer)]
class TestDeviceIntegration:
@pytest.mark.parametrize("d"... | true | true |
f701af7f21d797ec05eaafd75fcf08aa25842a12 | 1,041 | py | Python | tensorflow_datasets/core/utils/__init__.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | 14 | 2019-03-30T02:11:29.000Z | 2021-11-16T12:06:32.000Z | tensorflow_datasets/core/utils/__init__.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | 1 | 2019-09-13T15:10:18.000Z | 2019-09-13T21:05:46.000Z | tensorflow_datasets/core/utils/__init__.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | 10 | 2019-03-31T08:35:29.000Z | 2021-09-01T06:28:43.000Z | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... | 40.038462 | 74 | 0.793468 |
from tensorflow_datasets.core.utils.image_utils import *
from tensorflow_datasets.core.utils.py_utils import *
from tensorflow_datasets.core.utils.tf_utils import *
from tensorflow_datasets.core.utils.tqdm_utils import *
from tensorflow_datasets.core.utils.version import Experiment
from tensorflow_data... | true | true |
f701afa198407aba031878919da8b1a0c0c97bbb | 3,875 | py | Python | server/data_common/rwlock.py | atong01/cellxgene | 147830a87d100a33537121b277a5ac921e7cb250 | [
"MIT"
] | 3 | 2019-11-11T15:41:07.000Z | 2020-12-14T08:47:35.000Z | server/data_common/rwlock.py | atong01/cellxgene | 147830a87d100a33537121b277a5ac921e7cb250 | [
"MIT"
] | 7 | 2021-01-07T19:20:57.000Z | 2021-06-15T18:17:55.000Z | server/data_common/rwlock.py | atong01/cellxgene | 147830a87d100a33537121b277a5ac921e7cb250 | [
"MIT"
] | 1 | 2021-05-12T15:15:05.000Z | 2021-05-12T15:15:05.000Z | # -*- coding: utf-8 -*-
""" rwlock.py
A class to implement read-write locks on top of the standard threading
library.
This is implemented with two mutexes (threading.Lock instances) as per this
wikipedia pseudocode:
https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_two_mutexes
... | 28.492647 | 89 | 0.634323 |
from contextlib import contextmanager
from threading import Lock
class RWLock(object):
def __init__(self):
self.w_lock = Lock()
self.num_r_lock = Lock()
self.num_r = 0
self.d_lock = Lock()
def r_acquire(self)... | true | true |
f701b0663ae322a7d89698146ffc17a3ffd54c29 | 257 | py | Python | mycode/src/def_Net_u_B.py | darkxaze/PINNs | f344a907cf8b585e5f667465178c4442b907024d | [
"MIT"
] | null | null | null | mycode/src/def_Net_u_B.py | darkxaze/PINNs | f344a907cf8b585e5f667465178c4442b907024d | [
"MIT"
] | null | null | null | mycode/src/def_Net_u_B.py | darkxaze/PINNs | f344a907cf8b585e5f667465178c4442b907024d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed May 20 11:36:58 2020
@author: nastavirs
"""
import numpy as np
import tensorflow as tf
def net_u(self, x, t):
u = self.neural_net(tf.concat([x,t],1), self.weights, self.biases)
return u | 23.363636 | 75 | 0.603113 |
import numpy as np
import tensorflow as tf
def net_u(self, x, t):
u = self.neural_net(tf.concat([x,t],1), self.weights, self.biases)
return u | true | true |
f701b20352404c4faaee1be82c31f131651d29b3 | 7,717 | py | Python | tests/contrib/aiopg/test.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/aiopg/test.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/aiopg/test.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
# DEV: Skip linting, we lint with Python 2, we'll get SyntaxErrors from `yield from`
# stdlib
import time
import asyncio
# 3p
import aiopg
from psycopg2 import extras
# project
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.aiopg.patch import patch, unpatch
from ddtrace im... | 31.88843 | 84 | 0.618375 |
# stdlib
import time
import asyncio
# 3p
import aiopg
from psycopg2 import extras
# project
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.aiopg.patch import patch, unpatch
from ddtrace import Pin
# testing
from tests.opentracer.utils import init_tracer
from tests.contrib.config impor... | true | true |
f701b264e4efe7ddcef5722e06cf332a1fd1560f | 1,379 | py | Python | coherent_gradients/weak_and_strong/datasets/dataset_with_indices.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | coherent_gradients/weak_and_strong/datasets/dataset_with_indices.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | coherent_gradients/weak_and_strong/datasets/dataset_with_indices.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 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... | 34.475 | 78 | 0.758521 |
import torchvision
class VisionDatasetWithIndices(torchvision.datasets.vision.VisionDataset):
def __init__(self, dataset):
super(VisionDatasetWithIndices, self).__init__(None)
self.dataset = dataset
def __getitem__(self, index):
data, target = self.dataset.__getitem__(index)
retu... | true | true |
f701b364ce2fce6e6dfb12c50a12a53ff3dfaa6d | 319 | py | Python | tests/Hello/Hello.py | timkrentz/riaps-pycom | 5b4d9b3c80f9191ec9f680264e6d0ccb14f171ba | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2019-02-24T10:14:46.000Z | 2020-07-08T16:22:17.000Z | tests/Hello/Hello.py | timkrentz/riaps-pycom | 5b4d9b3c80f9191ec9f680264e6d0ccb14f171ba | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2018-10-16T04:39:54.000Z | 2022-02-09T17:38:05.000Z | tests/Hello/Hello.py | timkrentz/riaps-pycom | 5b4d9b3c80f9191ec9f680264e6d0ccb14f171ba | [
"ECL-2.0",
"Apache-2.0"
] | 8 | 2018-10-23T22:09:18.000Z | 2021-04-23T02:53:24.000Z | # import riaps
from riaps.run.comp import Component
import logging
class Hello(Component):
def __init__(self):
super(Hello, self).__init__()
def on_clock(self):
now = self.clock.recv_pyobj() # Receive time.time() as float
self.logger.info('on_clock(): %s' % str(now))
| 21.266667 | 70 | 0.623824 |
from riaps.run.comp import Component
import logging
class Hello(Component):
def __init__(self):
super(Hello, self).__init__()
def on_clock(self):
now = self.clock.recv_pyobj()
self.logger.info('on_clock(): %s' % str(now))
| true | true |
f701b44598f469f78fdd2c04701671f5c382aebe | 5,337 | py | Python | sdk/python/pulumi_azure_nextgen/securityinsights/v20200101/data_connector.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/securityinsights/v20200101/data_connector.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/securityinsights/v20200101/data_connector.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.431818 | 196 | 0.636125 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = ['DataConnector']
class DataConnector(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
f701b469709e4b7ce9ab7cdd6a4669708f0e4bab | 1,186 | py | Python | rpi-dp/leaveprob-dttor/lenet.py | khoaDLuu/plantinum | 6c371bc2fe5a2e85eeb9a755cde84daff1dde1e3 | [
"MIT"
] | null | null | null | rpi-dp/leaveprob-dttor/lenet.py | khoaDLuu/plantinum | 6c371bc2fe5a2e85eeb9a755cde84daff1dde1e3 | [
"MIT"
] | 15 | 2020-06-17T08:24:10.000Z | 2022-02-13T16:11:12.000Z | rpi-dp/planttp-clfier/lenet.py | khoaDLuu/plantinum | 6c371bc2fe5a2e85eeb9a755cde84daff1dde1e3 | [
"MIT"
] | null | null | null | from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from keras.layers.core import Dense
from keras import backend as K
class LeNet:
@staticmethod
def... | 31.210526 | 77 | 0.632378 | from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from keras.layers.core import Dense
from keras import backend as K
class LeNet:
@staticmethod
def... | true | true |
f701b4a374c74580f619e923008a71b9b2a99b99 | 1,068 | py | Python | test/fixtures/teststream.py | tmehnert/complate-cpp-for-python | fd089f40104b25d437c4bf71639e534372511baf | [
"Apache-2.0"
] | 1 | 2022-01-28T17:42:39.000Z | 2022-01-28T17:42:39.000Z | test/fixtures/teststream.py | tmehnert/complate-cpp-for-python | fd089f40104b25d437c4bf71639e534372511baf | [
"Apache-2.0"
] | null | null | null | test/fixtures/teststream.py | tmehnert/complate-cpp-for-python | fd089f40104b25d437c4bf71639e534372511baf | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Torsten Mehnert
#
# 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 wri... | 28.864865 | 75 | 0.675094 |
from complatecpp import Stream
class TestStream(Stream):
__test__ = False
def __init__(self, *args, **kwargs):
Stream.__init__(self, *args, **kwargs)
self.data = str()
def write(self, string, length):
self.data += string[0:length]
def writeln(self, stri... | true | true |
f701b50160bd279e359fca39ed40b647c9d2aa30 | 4,529 | py | Python | samples/RiskManagement/Verification/multiple-line-items.py | snavinch/cybersource-rest-samples-python | adb7a6b4b55dff6ac833295192d6677b53003c16 | [
"MIT"
] | 21 | 2019-01-22T17:48:32.000Z | 2022-02-07T17:40:58.000Z | samples/RiskManagement/Verification/multiple-line-items.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | 10 | 2018-12-03T22:45:17.000Z | 2021-04-19T20:40:14.000Z | samples/RiskManagement/Verification/multiple-line-items.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | 29 | 2018-11-09T11:44:53.000Z | 2022-03-18T08:56:46.000Z | from CyberSource import *
import os
import json
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
# To delete None values in Input Request Json body
def del_none(d):
for ke... | 36.821138 | 92 | 0.739678 | from CyberSource import *
import os
import json
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
def del_none(d):
for key, value in list(d.items()):
if value is N... | true | true |
f701b5d10713e0b10dd7948288a9644afa6766b6 | 861 | py | Python | Ex082.py | raphaeltertuliano/Python | ffa9813aaa13ccca807f7c08be9489a2d88d3d62 | [
"MIT"
] | 1 | 2021-11-23T21:38:46.000Z | 2021-11-23T21:38:46.000Z | Ex082.py | raphaeltertuliano/Python | ffa9813aaa13ccca807f7c08be9489a2d88d3d62 | [
"MIT"
] | null | null | null | Ex082.py | raphaeltertuliano/Python | ffa9813aaa13ccca807f7c08be9489a2d88d3d62 | [
"MIT"
] | null | null | null | #Crie um programa que vai ler vários números e colocar em uma lista.
#Depois disso, crie duas listas extras que vão conter apenas valores pares
#e os valores impares digitados, respectivamente.
#Ao final, mostre o conteúdo das três listas geradas
principal = []
par = []
impar = []
while True:
n = int(input('Digite... | 29.689655 | 74 | 0.610918 |
principal = []
par = []
impar = []
while True:
n = int(input('Digite um valor: '))
principal.append(n)
if n % 2 == 0:
par.append(n)
else:
impar.append(n)
while True:
opção = str(input('Quer continuar? [S/N]: ')).upper()
if opção == 'S':
break
... | true | true |
f701b64a83d4fad74752f11c9de67ca20ba37308 | 1,925 | py | Python | docs/generator.py | chibisov/cli-bdd | 579e2d9a07f9985b268aa9aaba42dee33021e163 | [
"MIT"
] | 8 | 2016-05-17T21:32:28.000Z | 2022-02-12T08:59:59.000Z | docs/generator.py | chibisov/cli-bdd | 579e2d9a07f9985b268aa9aaba42dee33021e163 | [
"MIT"
] | 7 | 2016-04-24T07:54:07.000Z | 2020-06-16T15:38:52.000Z | docs/generator.py | chibisov/cli-bdd | 579e2d9a07f9985b268aa9aaba42dee33021e163 | [
"MIT"
] | 4 | 2018-02-21T11:19:24.000Z | 2019-06-10T17:53:29.000Z | # -*- coding: utf-8 -*-
import sys
import os
import re
sys.path.append('../') # noqa
from jinja2 import Template
from cli_bdd.core.steps import (
command,
environment,
file as file_steps,
)
BASE_PATH = os.path.dirname(os.path.normpath(__file__))
TEMPLATES_PATH = os.path.join(BASE_PATH, 'templates')
S... | 22.647059 | 64 | 0.577662 |
import sys
import os
import re
sys.path.append('../')
from jinja2 import Template
from cli_bdd.core.steps import (
command,
environment,
file as file_steps,
)
BASE_PATH = os.path.dirname(os.path.normpath(__file__))
TEMPLATES_PATH = os.path.join(BASE_PATH, 'templates')
STEPS_MODULES = [
command,... | true | true |
f701b651ffc596d8a3269548b9676a5ee60d5fb7 | 5,219 | py | Python | test/functional/wallet_hd.py | sighttviewliu/michaellaoliu_coin | 5d6d3eb2e2a0d4273bd7108744e1a362339697a9 | [
"MIT"
] | 2 | 2018-12-05T12:47:59.000Z | 2019-06-27T12:01:59.000Z | test/functional/wallet_hd.py | sighttviewliu/michaellaoliu_coin | 5d6d3eb2e2a0d4273bd7108744e1a362339697a9 | [
"MIT"
] | null | null | null | test/functional/wallet_hd.py | sighttviewliu/michaellaoliu_coin | 5d6d3eb2e2a0d4273bd7108744e1a362339697a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Michaellaoliu Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import Mi... | 42.430894 | 113 | 0.647634 |
from test_framework.test_framework import MichaellaoliuTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
)
import shutil
import os
class WalletHDTest(MichaellaoliuTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
... | true | true |
f701b8e4102b4d078dab74fc6655620decfbed24 | 665 | py | Python | themodelshop/utils/data/handlers.py | laraib-sidd/themodelshop | e811036eaf22f0d1b56b7b9c60912930a1fed3cb | [
"MIT"
] | 1 | 2021-01-12T16:13:14.000Z | 2021-01-12T16:13:14.000Z | themodelshop/utils/data/handlers.py | laraib-sidd/themodelshop | e811036eaf22f0d1b56b7b9c60912930a1fed3cb | [
"MIT"
] | 4 | 2020-11-30T12:32:39.000Z | 2021-01-08T12:20:39.000Z | themodelshop/utils/data/handlers.py | laraib-sidd/themodelshop | e811036eaf22f0d1b56b7b9c60912930a1fed3cb | [
"MIT"
] | 1 | 2021-01-12T16:13:20.000Z | 2021-01-12T16:13:20.000Z | """Utilities for working with data.
These are intended to be used predominantly by the filing cabinet
in order to read and write datasets appropriately.
"""
from typing import Any
def _get_handlers(location:str=""):
"""Returns available file handlers.
This checks for a handlers folder at this location and w... | 26.6 | 67 | 0.705263 |
from typing import Any
def _get_handlers(location:str=""):
| true | true |
f701ba3fa91512a9d99c2bac3f0e9fddf9d82770 | 3,759 | py | Python | examples/play_pachi.py | beenfhb/AlphaGo | efb092308fe834ddae4226e3f2f12e1cadec8db4 | [
"MIT"
] | 721 | 2016-04-14T22:19:28.000Z | 2022-03-30T17:32:04.000Z | examples/play_pachi.py | tanmayb123/betago | b5ad8ad9f9a5dd8db1be5d78673dcdc3d07e3f84 | [
"MIT"
] | 48 | 2016-04-15T05:17:53.000Z | 2020-12-12T22:08:28.000Z | examples/play_pachi.py | tanmayb123/betago | b5ad8ad9f9a5dd8db1be5d78673dcdc3d07e3f84 | [
"MIT"
] | 185 | 2016-04-15T11:22:29.000Z | 2022-03-09T13:37:01.000Z | from __future__ import print_function
import yaml
import subprocess
import re
import argparse
from keras.models import model_from_yaml
from betago.model import KerasBot
from betago.processor import SevenPlaneProcessor
from betago.gtp.board import gtp_position_to_coords, coords_to_gtp_position
argparser = argparse.Arg... | 29.598425 | 94 | 0.61958 | from __future__ import print_function
import yaml
import subprocess
import re
import argparse
from keras.models import model_from_yaml
from betago.model import KerasBot
from betago.processor import SevenPlaneProcessor
from betago.gtp.board import gtp_position_to_coords, coords_to_gtp_position
argparser = argparse.Arg... | true | true |
f701ba757a6ae229d32381d1ef87f1aa6197ba1a | 393 | py | Python | main.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:22:59.000Z | 2020-11-22T22:22:59.000Z | main.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | null | null | null | main.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:24:19.000Z | 2020-11-22T22:24:19.000Z | import os
import sys
from time import sleep
import threading
import window
import comunication
import DisplayActions
debugMode = True
def main():
print("starting...",end='')
state = True
print("[" + ("OK" if state else "ERROR" ) + "]")
winThread.start()
comunication.start()
winThread = thre... | 14.555556 | 53 | 0.669211 | import os
import sys
from time import sleep
import threading
import window
import comunication
import DisplayActions
debugMode = True
def main():
print("starting...",end='')
state = True
print("[" + ("OK" if state else "ERROR" ) + "]")
winThread.start()
comunication.start()
winThread = thre... | true | true |
f701bba607c7fe613014a28a599917b8211d664b | 2,804 | py | Python | panama-papers-solutions/pp-solution-6.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | panama-papers-solutions/pp-solution-6.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | panama-papers-solutions/pp-solution-6.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | # Write a script that generates daily edit AND view counts for Panama Papers over its first 30 days of existence, and prints them to a CSV or TSV file in reverse-chronological order. You file should have three colums with the headers "date", "edits" and "views".
import csv
import json
import requests
import operator
f... | 32.229885 | 262 | 0.587019 |
import csv
import json
import requests
import operator
from urllib.parse import quote
ENDPOINT = 'https://en.wikipedia.org/w/api.php'
parameters = { 'action' : 'query',
'prop' : 'revisions',
'titles' : 'Panama_Papers',
'format' : 'json',
'rvdir' : 'newer',... | true | true |
f701bbb5eb365727210f47ca73154593772e20df | 2,642 | py | Python | txweb/tests/test_resources_routing.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | null | null | null | txweb/tests/test_resources_routing.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | 4 | 2020-11-03T19:59:05.000Z | 2021-06-02T03:22:25.000Z | txweb/tests/test_resources_routing.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | null | null | null | from unittest.mock import MagicMock
from twisted.web.resource import NoResource
from txweb.resources import RoutingResource
from txweb import App
from txweb.http_codes import Unrenderable
from txweb.resources import ViewClassResource
from unittest.mock import sentinel
import typing as T
from .helper import RequestR... | 23.175439 | 103 | 0.716881 | from unittest.mock import MagicMock
from twisted.web.resource import NoResource
from txweb.resources import RoutingResource
from txweb import App
from txweb.http_codes import Unrenderable
from txweb.resources import ViewClassResource
from unittest.mock import sentinel
import typing as T
from .helper import RequestR... | true | true |
f701bcf97badc3db13f081431a166db21e865c8f | 20,382 | py | Python | test/distribution/test_distribution_inference.py | jgasthaus/gluon-ts | 4d044a2dcd9f3f5282e72a5324db12a6b7b30c50 | [
"Apache-2.0"
] | 1 | 2021-08-03T09:09:31.000Z | 2021-08-03T09:09:31.000Z | test/distribution/test_distribution_inference.py | Happiness20/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | null | null | null | test/distribution/test_distribution_inference.py | Happiness20/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 31.797192 | 112 | 0.647385 |
from typing import Iterable, List, Tuple
import mxnet as mx
import numpy as np
import pytest
from pydantic import PositiveFloat, PositiveInt
from gluonts.model.common import NPArrayLike
from gluonts.distribution.box_cox_tranform import (
InverseBoxCoxTransform,
InverseBoxCoxTransformOutput,
)
... | true | true |
f701bd47787bb3e9effa1e72e02589a4fb89873b | 69,852 | py | Python | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/image/nitf.py | Mikevin/hobbits | 0a99aa97a34abe06a8c0542acd5c96e1a7078ec4 | [
"MIT"
] | null | null | null | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/image/nitf.py | Mikevin/hobbits | 0a99aa97a34abe06a8c0542acd5c96e1a7078ec4 | [
"MIT"
] | null | null | null | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/image/nitf.py | Mikevin/hobbits | 0a99aa97a34abe06a8c0542acd5c96e1a7078ec4 | [
"MIT"
] | null | null | null | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise E... | 58.69916 | 811 | 0.607055 |
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kai... | true | true |
f701be017cb6068bb7180d6b49d93e3d329c70f9 | 5,741 | py | Python | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_minnesota_zip.py | mmi333/great_expectations | cc9df78596610002c24e2d46f737179e04f31d29 | [
"Apache-2.0"
] | 1 | 2022-03-17T08:05:44.000Z | 2022-03-17T08:05:44.000Z | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_minnesota_zip.py | Tchibo/great_expectations | 27220336190039148ab91138cb2fd489d2159183 | [
"Apache-2.0"
] | null | null | null | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_minnesota_zip.py | Tchibo/great_expectations | 27220336190039148ab91138cb2fd489d2159183 | [
"Apache-2.0"
] | null | null | null | import json
from typing import Optional
import zipcodes
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkD... | 39.593103 | 116 | 0.643964 | import json
from typing import Optional
import zipcodes
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkD... | true | true |
f701bed5f06cf5ca6d955a109586871d6cfe103f | 817 | py | Python | setup.py | jdurgin/radosgw-agent | 8f304e58fd24430990f43b1dde788e393e30e4ab | [
"MIT"
] | null | null | null | setup.py | jdurgin/radosgw-agent | 8f304e58fd24430990f43b1dde788e393e30e4ab | [
"MIT"
] | null | null | null | setup.py | jdurgin/radosgw-agent | 8f304e58fd24430990f43b1dde788e393e30e4ab | [
"MIT"
] | null | null | null | #!/usr/bin/python
from setuptools import setup, find_packages
import sys
install_requires = []
pyversion = sys.version_info[:2]
if pyversion < (2, 7) or (3, 0) <= pyversion <= (3, 1):
install_requires.append('argparse')
setup(
name='radosgw-agent',
version='1.0',
packages=find_packages(),
author... | 23.342857 | 70 | 0.615667 |
from setuptools import setup, find_packages
import sys
install_requires = []
pyversion = sys.version_info[:2]
if pyversion < (2, 7) or (3, 0) <= pyversion <= (3, 1):
install_requires.append('argparse')
setup(
name='radosgw-agent',
version='1.0',
packages=find_packages(),
author='Josh Durgin',
... | true | true |
f701bee115cbe92b692ea9957fcaa3b7e8eabfd0 | 806 | py | Python | app/api/core.py | Aneureka/njuapi | f45f703e20451f12d0900c5c38b93cdd6e9b672c | [
"MIT"
] | 6 | 2017-09-16T13:50:28.000Z | 2019-10-24T03:06:49.000Z | app/api/core.py | Aneureka/njuapi | f45f703e20451f12d0900c5c38b93cdd6e9b672c | [
"MIT"
] | null | null | null | app/api/core.py | Aneureka/njuapi | f45f703e20451f12d0900c5c38b93cdd6e9b672c | [
"MIT"
] | 1 | 2017-09-16T13:58:35.000Z | 2017-09-16T13:58:35.000Z | from flask import Blueprint, request
from app.spiders.core import *
from app.utils import build_result
from app.constants import code
core = Blueprint('core', __name__)
@core.route('/login', methods=['POST'])
def login():
data = request.form
username = data.get('username')
password = data.get('password'... | 23.028571 | 53 | 0.708437 | from flask import Blueprint, request
from app.spiders.core import *
from app.utils import build_result
from app.constants import code
core = Blueprint('core', __name__)
@core.route('/login', methods=['POST'])
def login():
data = request.form
username = data.get('username')
password = data.get('password'... | true | true |
f701c2d3525f9a249070c919385a3b355d9997f5 | 2,386 | py | Python | venv/Scripts/pygal_gen.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | null | null | null | venv/Scripts/pygal_gen.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | null | null | null | venv/Scripts/pygal_gen.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | null | null | null | #!C:\Users\Aditya\PycharmProjects\python-docs-azure-app\venv\Scripts\python.exe
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2016 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Gener... | 34.57971 | 79 | 0.657167 |
import argparse
import pygal
parser = argparse.ArgumentParser(
description='Generate pygal chart in command line',
prog='pygal_gen')
parser.add_argument('-t', '--type', dest='type', default='Line',
choices=map(lambda x: x.__name__, pygal.CHARTS),
hel... | true | true |
f701c3fa430078a4a4c6025fa8ea7d47ced68f14 | 1,911 | py | Python | pylibui/libui/combobox.py | superzazu/pylibui | 2e74db787bfea533f3ae465670963daedcaec344 | [
"MIT"
] | 222 | 2016-05-20T19:12:05.000Z | 2022-03-09T14:59:48.000Z | pylibui/libui/combobox.py | superzazu/pylibui | 2e74db787bfea533f3ae465670963daedcaec344 | [
"MIT"
] | 66 | 2016-05-29T00:11:53.000Z | 2018-10-14T20:01:38.000Z | pylibui/libui/combobox.py | superzazu/pylibui | 2e74db787bfea533f3ae465670963daedcaec344 | [
"MIT"
] | 32 | 2016-06-03T07:08:29.000Z | 2021-05-12T07:41:41.000Z | """
Python wrapper for libui.
"""
import ctypes
from . import clibui
class uiCombobox(ctypes.Structure):
"""Wrapper for the uiCombobox C struct."""
pass
def uiComboboxPointer(obj):
"""
Casts an object to uiCombobox pointer type.
:param obj: a generic object
:return: uiCombobox
"""
... | 20.115789 | 95 | 0.679749 |
import ctypes
from . import clibui
class uiCombobox(ctypes.Structure):
pass
def uiComboboxPointer(obj):
return ctypes.cast(obj, ctypes.POINTER(uiCombobox))
def uiComboboxAppend(combobox, text):
clibui.uiComboboxAppend(combobox, bytes(text, 'utf-8'))
def uiComboboxSelected(combobox):
retur... | true | true |
f701c4842e2415839a30e2f078a2fcdf68f16ab3 | 1,773 | py | Python | pre-process.py | nicoperetti/metadata-sadosky-santander | a0d686ba8dfa6c3929727248fc52d802d74f4c45 | [
"MIT"
] | null | null | null | pre-process.py | nicoperetti/metadata-sadosky-santander | a0d686ba8dfa6c3929727248fc52d802d74f4c45 | [
"MIT"
] | null | null | null | pre-process.py | nicoperetti/metadata-sadosky-santander | a0d686ba8dfa6c3929727248fc52d802d74f4c45 | [
"MIT"
] | null | null | null | import click
import pandas as pd
# Due textacy problems
try:
from textacy.preprocess import preprocess_text
except Exception:
from textacy.preprocess import preprocess_text
def preprocess_f(text, fix_unicode=True, lowercase=True,
no_urls=True, no_emails=True,
no_phone_numbers... | 33.45283 | 76 | 0.605189 | import click
import pandas as pd
try:
from textacy.preprocess import preprocess_text
except Exception:
from textacy.preprocess import preprocess_text
def preprocess_f(text, fix_unicode=True, lowercase=True,
no_urls=True, no_emails=True,
no_phone_numbers=True,
... | true | true |
f701c4c31af1aa206d2ecb2f6f56d4723ce57c34 | 4,477 | py | Python | core/action/list.py | caostorm/smng | f1cff4010a0645ae8e1182cd3c961d97cecf4a6e | [
"MIT"
] | null | null | null | core/action/list.py | caostorm/smng | f1cff4010a0645ae8e1182cd3c961d97cecf4a6e | [
"MIT"
] | null | null | null | core/action/list.py | caostorm/smng | f1cff4010a0645ae8e1182cd3c961d97cecf4a6e | [
"MIT"
] | 1 | 2019-06-26T13:05:45.000Z | 2019-06-26T13:05:45.000Z | #coding=utf-8
import sys
import getopt
from core.interface.action import server_action
from core.helper.usage import usage_helper
from prettytable import PrettyTable
from core.helper.parser import config_parser
import re
class action_list(server_action):
# 参数列表示例,可以在这边增加参数描述,最终代码将根据argname生成对对应的参数
_parameters ... | 34.438462 | 93 | 0.53786 |
import sys
import getopt
from core.interface.action import server_action
from core.helper.usage import usage_helper
from prettytable import PrettyTable
from core.helper.parser import config_parser
import re
class action_list(server_action):
_parameters = [
{"name":"h", "needarg":False, "desc":"显示这条帮助... | true | true |
f701c4c68ea3dc6f108a4fb7a2d844def96a3dd3 | 50,706 | py | Python | cinder/volume/flows/manager/create_volume.py | netsec/cinder | 435b2300149bece70dd2f42f05d1b5d0f0eb9aa6 | [
"Apache-2.0"
] | null | null | null | cinder/volume/flows/manager/create_volume.py | netsec/cinder | 435b2300149bece70dd2f42f05d1b5d0f0eb9aa6 | [
"Apache-2.0"
] | null | null | null | cinder/volume/flows/manager/create_volume.py | netsec/cinder | 435b2300149bece70dd2f42f05d1b5d0f0eb9aa6 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 45.598921 | 79 | 0.568789 |
import traceback
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import fileutils
from oslo_utils import timeutils
import taskflow.engines
from taskflow.patterns import linear_flow
from taskflow.types import failure as ft
from cinder import b... | true | true |
f701c5f7e8e6742e853467d6e7e8f7bc7fc593a7 | 625 | py | Python | pyEdda/test_uni_gaussian.py | GRAVITYLab/edda | 2acd00373db1003922db9f5959644e7506de5726 | [
"MIT"
] | 3 | 2016-01-15T20:17:21.000Z | 2021-01-21T02:32:15.000Z | pyEdda/test_uni_gaussian.py | GRAVITYLab/edda | 2acd00373db1003922db9f5959644e7506de5726 | [
"MIT"
] | 11 | 2016-07-26T01:37:46.000Z | 2018-06-19T16:50:25.000Z | pyEdda/test_uni_gaussian.py | GRAVITYLab/edda | 2acd00373db1003922db9f5959644e7506de5726 | [
"MIT"
] | 12 | 2016-02-09T04:31:41.000Z | 2021-12-03T01:04:04.000Z | #make print in python 2, 3 compatible
from __future__ import print_function
import numpy as np
import pyedda as edda
#Univariate Gaussian
print("//////////Univariate Gaussian///////")
dummy_data = np.random.rand(100)
gaussian = edda.Gaussian(100, 20)
print("gaussian.getMean():", gaussian.getMean())
print("gaussian.g... | 31.25 | 63 | 0.736 |
from __future__ import print_function
import numpy as np
import pyedda as edda
print("//////////Univariate Gaussian///////")
dummy_data = np.random.rand(100)
gaussian = edda.Gaussian(100, 20)
print("gaussian.getMean():", gaussian.getMean())
print("gaussian.getVar():", gaussian.getVar())
print("gaussian.getPdf(105)... | true | true |
f701c606e9f0cf64783a10a36270e8694918d0e6 | 1,910 | py | Python | src/contact/schema.py | mesherinovivan/graphql-django | 732fb284fd3b1ad9270b1539e1d7b53c80bb4cdf | [
"MIT"
] | null | null | null | src/contact/schema.py | mesherinovivan/graphql-django | 732fb284fd3b1ad9270b1539e1d7b53c80bb4cdf | [
"MIT"
] | null | null | null | src/contact/schema.py | mesherinovivan/graphql-django | 732fb284fd3b1ad9270b1539e1d7b53c80bb4cdf | [
"MIT"
] | null | null | null | import graphene
from graphene import Node
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.rest_framework.mutation import SerializerMutation
from graphene_django.types import DjangoObjectType
from rest_framework.generics import get_object_or_404
from contact.models import Contact
fro... | 27.681159 | 70 | 0.731937 | import graphene
from graphene import Node
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.rest_framework.mutation import SerializerMutation
from graphene_django.types import DjangoObjectType
from rest_framework.generics import get_object_or_404
from contact.models import Contact
fro... | true | true |
f701c6373cd2ec48e39c87c6d61a464dbb1a4fda | 8,277 | py | Python | upyutils/uping.py | Naohiro2g/upydev | a07d5966fc4cd132bdc769a73ccd3b2476a0a2bf | [
"MIT"
] | 36 | 2019-08-14T15:59:44.000Z | 2022-01-17T17:33:47.000Z | upyutils/uping.py | Naohiro2g/upydev | a07d5966fc4cd132bdc769a73ccd3b2476a0a2bf | [
"MIT"
] | 21 | 2019-08-15T06:11:38.000Z | 2021-01-30T22:05:24.000Z | upyutils/uping.py | Naohiro2g/upydev | a07d5966fc4cd132bdc769a73ccd3b2476a0a2bf | [
"MIT"
] | 3 | 2020-05-01T22:32:34.000Z | 2021-01-30T20:16:19.000Z | # µPing (MicroPing) for MicroPython
# copyright (c) 2018 Shawwwn <shawwwn1@gmail.com>
# License: MIT
# Internet Checksum Algorithm
# Author: Olav Morken
# https://github.com/olavmrk/python-ping/blob/master/ping.py
# @data: bytes
# ping statistics, loop mode and KeyboardInterrupt handler, + esp8266 compatible
# copyri... | 37.116592 | 170 | 0.423342 |
def checksum(data):
if len(data) & 0x1:
data += b'\0'
cs = 0
for pos in range(0, len(data), 2):
b1 = data[pos]
b2 = data[pos + 1]
cs += (b1 << 8) + b2
while cs >= 0x10000:
cs = (cs & 0xffff) + (cs >> 16)
cs = ~cs & 0xffff
return cs
def st... | true | true |
f701c6c64208dfe1a447075a36f01d47f9da0f28 | 531 | py | Python | venv/Lib/site-packages/celery/tests/concurrency/test_solo.py | Verckolf/MyInterfaceTest | e05674bd673a6a43cfb33f7cb4318886ba92a05c | [
"MIT"
] | 39 | 2016-12-05T14:36:37.000Z | 2021-07-29T18:22:34.000Z | microblog/flask/venv/lib/python2.7/site-packages/celery/tests/concurrency/test_solo.py | johankaito/fufuka | 32a96ecf98ce305c2206c38443e58fdec88c788d | [
"Apache-2.0"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | microblog/flask/venv/lib/python2.7/site-packages/celery/tests/concurrency/test_solo.py | johankaito/fufuka | 32a96ecf98ce305c2206c38443e58fdec88c788d | [
"Apache-2.0"
] | 120 | 2016-08-18T14:53:03.000Z | 2020-06-16T13:27:20.000Z | from __future__ import absolute_import
import operator
from celery.concurrency import solo
from celery.utils.functional import noop
from celery.tests.case import AppCase
class test_solo_TaskPool(AppCase):
def test_on_start(self):
x = solo.TaskPool()
x.on_start()
def test_on_apply(self):
... | 21.24 | 56 | 0.655367 | from __future__ import absolute_import
import operator
from celery.concurrency import solo
from celery.utils.functional import noop
from celery.tests.case import AppCase
class test_solo_TaskPool(AppCase):
def test_on_start(self):
x = solo.TaskPool()
x.on_start()
def test_on_apply(self):
... | true | true |
f701c6f320981fb5b4389ff053785d02cd02a20e | 6,513 | py | Python | hybrid/opensubtitle/hyb/bid/type1/len2/hybrid_len2_t1_predict.py | 1130310223/Static-Dynamic-Attention | 1da223b06ae41f14575960e247fb13506ed8a124 | [
"MIT"
] | 1 | 2020-04-16T08:42:38.000Z | 2020-04-16T08:42:38.000Z | hybrid/opensubtitle/hyb/bid/type1/len2/hybrid_len2_t1_predict.py | 1130310223/Static-Dynamic-Attention | 1da223b06ae41f14575960e247fb13506ed8a124 | [
"MIT"
] | null | null | null | hybrid/opensubtitle/hyb/bid/type1/len2/hybrid_len2_t1_predict.py | 1130310223/Static-Dynamic-Attention | 1da223b06ae41f14575960e247fb13506ed8a124 | [
"MIT"
] | 1 | 2020-04-16T08:41:53.000Z | 2020-04-16T08:41:53.000Z | #-*- coding: utf-8 -*-
import sys
import os
import random
import re
import time
import torch
from torch.autograd import Variable
from torch import optim
import torch.nn as nn
#sys.path.append('../')
from hybrid_bid_t1_model import Seq2Seq
from hybrid_data_utils import *
sub = '-'*20
def init_command_l... | 35.016129 | 120 | 0.729464 |
import sys
import os
import random
import re
import time
import torch
from torch.autograd import Variable
from torch import optim
import torch.nn as nn
from hybrid_bid_t1_model import Seq2Seq
from hybrid_data_utils import *
sub = '-'*20
def init_command_line(argv):
from argparse import ArgumentParse... | true | true |
f701c8a0e57e7bfda97acfc93d52ee215f8b23f6 | 3,259 | py | Python | frameworks/shared/callee.py | aligapaul/automlbenchmark | 97c1ef8f7529f9814c5228ae0ff91d4055223d50 | [
"MIT"
] | 2 | 2020-12-06T22:09:12.000Z | 2022-02-09T00:02:29.000Z | frameworks/shared/callee.py | automl/automlbenchmark | 59e796fe6632637233a7104dfffe65f210f9eef5 | [
"MIT"
] | null | null | null | frameworks/shared/callee.py | automl/automlbenchmark | 59e796fe6632637233a7104dfffe65f210f9eef5 | [
"MIT"
] | null | null | null | import json
import logging
import os
import re
import sys
import time
def setup_logger():
console = logging.StreamHandler(sys.stdout)
handlers = [console]
logging.basicConfig(handlers=handlers)
root = logging.getLogger()
root.setLevel(logging.INFO)
setup_logger()
log = logging.getLogger(__name_... | 23.963235 | 84 | 0.572261 | import json
import logging
import os
import re
import sys
import time
def setup_logger():
console = logging.StreamHandler(sys.stdout)
handlers = [console]
logging.basicConfig(handlers=handlers)
root = logging.getLogger()
root.setLevel(logging.INFO)
setup_logger()
log = logging.getLogger(__name_... | true | true |
f701c8ad9ef2bfd1a87e7c7045808347a887c250 | 1,225 | py | Python | feature_extract/label_clean_data.py | bradysalz/MinVAD | 4d4a396b381bbb4714b434f60e09fb2fa7d3c474 | [
"MIT"
] | null | null | null | feature_extract/label_clean_data.py | bradysalz/MinVAD | 4d4a396b381bbb4714b434f60e09fb2fa7d3c474 | [
"MIT"
] | 2 | 2016-12-09T21:16:28.000Z | 2016-12-09T21:29:10.000Z | feature_extract/label_clean_data.py | bradysalz/MinVAD | 4d4a396b381bbb4714b434f60e09fb2fa7d3c474 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Goes through the clean dataset and determines when audio is occuring by
measuring across a simple threshold
We use these labels for the 15, 10 5, 0dB SNR samples
Created on Sun Dec 4 15:37:11 2016
@author: brady
"""
import os
import wavio
from fe_utils import *
from config import TRAI... | 25 | 72 | 0.606531 |
import os
import wavio
from fe_utils import *
from config import TRAIN_CLEAN
os.chdir(TRAIN_CLEAN)
for file in os.listdir():
if not file.endswith('.wav'):
continue
mWav = wavio.read(file)
frame_len = int(getFrameSize(mWav.rate))
mWav.data = normalizeAudio(mWav.data, mWav.sampwidth... | true | true |
f701c8ef1deceba47a5c1182c16f3b55f0c6f6ff | 85,881 | py | Python | src/jack.py | zynthian/jackclient-python | e86ee6e82af707bfb34bfac4d53ef3c5f665f65b | [
"MIT"
] | null | null | null | src/jack.py | zynthian/jackclient-python | e86ee6e82af707bfb34bfac4d53ef3c5f665f65b | [
"MIT"
] | null | null | null | src/jack.py | zynthian/jackclient-python | e86ee6e82af707bfb34bfac4d53ef3c5f665f65b | [
"MIT"
] | 1 | 2022-01-10T12:36:53.000Z | 2022-01-10T12:36:53.000Z | # Copyright (c) 2014-2015 Matthias Geier
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 34.741505 | 97 | 0.616958 |
__version__ = '0.4.3'
from ctypes.util import find_library as _find_library
import errno as _errno
import platform as _platform
import warnings as _warnings
from _jack import ffi as _ffi
if _platform.system() == 'Windows':
if _platform.architecture()[0] == '64bit':
_libname = _find_li... | true | true |
f701c97318788c77594229bcd305aa762690af71 | 15,444 | py | Python | yaxil/bids/__init__.py | AMP-SCZ/yaxil | 13ec90df8565930702c9f173182dcaec8e8734e2 | [
"BSD-3-Clause"
] | null | null | null | yaxil/bids/__init__.py | AMP-SCZ/yaxil | 13ec90df8565930702c9f173182dcaec8e8734e2 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T01:05:42.000Z | 2022-01-05T18:22:39.000Z | yaxil/bids/__init__.py | AMP-SCZ/yaxil | 13ec90df8565930702c9f173182dcaec8e8734e2 | [
"BSD-3-Clause"
] | null | null | null | import re
import os
import glob
import json
import string
import logging
import subprocess as sp
import yaxil.commons as commons
logger = logging.getLogger(__name__)
# bids legal characters for sub, ses, and task
legal = re.compile('[^a-zA-Z0-9]')
def bids_from_config(yaxil_session, scans_metadata, config, out_base)... | 38.80402 | 101 | 0.559959 | import re
import os
import glob
import json
import string
import logging
import subprocess as sp
import yaxil.commons as commons
logger = logging.getLogger(__name__)
legal = re.compile('[^a-zA-Z0-9]')
def bids_from_config(yaxil_session, scans_metadata, config, out_base):
_item = next(iter(scans_metadata))
... | true | true |
f701c99be4ff76447f67b9cbb2dd1f257ff3916e | 30,823 | py | Python | yahoo_fin/stock_info.py | rokdd/yahoo_fin | da55c89582bc8e858131581da1bd380d19d68bf2 | [
"MIT"
] | null | null | null | yahoo_fin/stock_info.py | rokdd/yahoo_fin | da55c89582bc8e858131581da1bd380d19d68bf2 | [
"MIT"
] | null | null | null | yahoo_fin/stock_info.py | rokdd/yahoo_fin | da55c89582bc8e858131581da1bd380d19d68bf2 | [
"MIT"
] | null | null | null | import requests
import pandas as pd
import ftplib
import io
import re
import json
import datetime
try:
from requests_html import HTMLSession
except Exception:
print("""Warning - Certain functionality
requires requests_html, which is not installed.
Install ... | 29.666025 | 179 | 0.58677 | import requests
import pandas as pd
import ftplib
import io
import re
import json
import datetime
try:
from requests_html import HTMLSession
except Exception:
print("""Warning - Certain functionality
requires requests_html, which is not installed.
Install ... | true | true |
f701caa049f13a466bcf42bb60f125bec4bf7b7c | 18 | py | Python | mc/__init__.py | munasaber/djlib | 2066353ff718a6fe30dd8897f635ac0f4616b948 | [
"MIT"
] | null | null | null | mc/__init__.py | munasaber/djlib | 2066353ff718a6fe30dd8897f635ac0f4616b948 | [
"MIT"
] | null | null | null | mc/__init__.py | munasaber/djlib | 2066353ff718a6fe30dd8897f635ac0f4616b948 | [
"MIT"
] | null | null | null | from .mc import *
| 9 | 17 | 0.666667 | from .mc import *
| true | true |
f701cacdb2d327f91c1bbc2baa9f7012220e3c96 | 218 | py | Python | somebox/common/pathtool.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | 4 | 2017-12-25T10:36:15.000Z | 2018-01-01T10:42:34.000Z | somebox/common/pathtool.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | null | null | null | somebox/common/pathtool.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | null | null | null | import os
def find_base(p, bases):
for base_name, base_path in bases.items():
r = os.path.relpath(p, base_path)
if r and (r == '.' or r[0] != '.'):
return base_name, r
return None
| 21.8 | 46 | 0.550459 | import os
def find_base(p, bases):
for base_name, base_path in bases.items():
r = os.path.relpath(p, base_path)
if r and (r == '.' or r[0] != '.'):
return base_name, r
return None
| true | true |
f701cb9ade8c6b90ec926940c886e49ad6ab15a3 | 1,534 | py | Python | kinder/lambda_funcs.py | 42B/krampus | 738f00652abc93302db5b1205ab3ba45f2507463 | [
"MIT"
] | 54 | 2018-07-16T02:33:10.000Z | 2022-03-31T07:57:06.000Z | kinder/lambda_funcs.py | 42B/krampus | 738f00652abc93302db5b1205ab3ba45f2507463 | [
"MIT"
] | 12 | 2018-07-12T17:02:54.000Z | 2019-03-06T03:34:28.000Z | kinder/lambda_funcs.py | 42B/krampus | 738f00652abc93302db5b1205ab3ba45f2507463 | [
"MIT"
] | 10 | 2018-07-03T16:35:28.000Z | 2022-02-19T12:27:09.000Z | ###############################################################################
# Lambda kinder class
###############################################################################
# lambda is actionable dot ru
###############################################################################
# TODO:
####################... | 40.368421 | 106 | 0.470013 | true | true | |
f701cc90df7c8af6299601fb9178eb9a859c130c | 307 | py | Python | codigos/Cap02/ex2.1.py | skunkworksdev/Ifes_Algoritmo | 458ef73a304573c12b45d8afae38e13ae0f3354f | [
"MIT"
] | null | null | null | codigos/Cap02/ex2.1.py | skunkworksdev/Ifes_Algoritmo | 458ef73a304573c12b45d8afae38e13ae0f3354f | [
"MIT"
] | null | null | null | codigos/Cap02/ex2.1.py | skunkworksdev/Ifes_Algoritmo | 458ef73a304573c12b45d8afae38e13ae0f3354f | [
"MIT"
] | null | null | null | T = float(input("Entre com a temperatura que está agora: "))
if T >= 26.0 and T <= 36.0:
print("A temperatura está boa")
elif T > 36.0:
print("A temperatura está quente\n Tome bastante líquido")
elif T >= 15.0 and T < 26.0:
print("A temperatura está agradável")
else:
print("A temperatura esta fria")
| 27.909091 | 60 | 0.680782 | T = float(input("Entre com a temperatura que está agora: "))
if T >= 26.0 and T <= 36.0:
print("A temperatura está boa")
elif T > 36.0:
print("A temperatura está quente\n Tome bastante líquido")
elif T >= 15.0 and T < 26.0:
print("A temperatura está agradável")
else:
print("A temperatura esta fria")
| true | true |
f701cca3686904209fe1073f6449348e9c1f82a1 | 7,163 | py | Python | theano/sparse/sandbox/sp2.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | 1 | 2020-12-30T19:12:52.000Z | 2020-12-30T19:12:52.000Z | theano/sparse/sandbox/sp2.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | null | null | null | theano/sparse/sandbox/sp2.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy.sparse
import theano
from theano import gof, tensor
from theano.gof.op import Op
from theano.sparse.basic import (
Remove0,
SparseType,
_is_sparse,
as_sparse_variable,
remove0,
)
# Also for compatibility
from theano.tensor import discrete_dtypes, float_dtypes
# Pr... | 32.265766 | 85 | 0.620969 | import numpy as np
import scipy.sparse
import theano
from theano import gof, tensor
from theano.gof.op import Op
from theano.sparse.basic import (
Remove0,
SparseType,
_is_sparse,
as_sparse_variable,
remove0,
)
from theano.tensor import discrete_dtypes, float_dtypes
# the perform() method twi... | true | true |
f701ccda92c2322adfba38a2ac93489f41755a14 | 400 | py | Python | getDoc/wsgi.py | srijannnd/GetDoc-API | 33ba87f0941f7a8e4b83a4fa85ec83a52b57e3d0 | [
"MIT"
] | null | null | null | getDoc/wsgi.py | srijannnd/GetDoc-API | 33ba87f0941f7a8e4b83a4fa85ec83a52b57e3d0 | [
"MIT"
] | null | null | null | getDoc/wsgi.py | srijannnd/GetDoc-API | 33ba87f0941f7a8e4b83a4fa85ec83a52b57e3d0 | [
"MIT"
] | null | null | null | """
WSGI config for getDoc project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 23.529412 | 78 | 0.7875 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'getDoc.settings.production')
application = get_wsgi_application()
| true | true |
f701cdf08acc2234f9c12d8d349622d596e0778f | 526 | py | Python | d2/poker/main.py | blurgyy/summer2019 | 62e5530c74fb77721768f984b3cfbd67c28595ba | [
"Apache-2.0"
] | 3 | 2019-09-06T01:13:56.000Z | 2020-03-18T03:10:53.000Z | d2/poker/main.py | blurgyy/summer2019 | 62e5530c74fb77721768f984b3cfbd67c28595ba | [
"Apache-2.0"
] | null | null | null | d2/poker/main.py | blurgyy/summer2019 | 62e5530c74fb77721768f984b3cfbd67c28595ba | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import deck
while(True):
p = deck.Deck()
p.shuffle()
pai = p.deal(5)
# assert len(pai) == 5, "??????"
del p
pai.sort(key=lambda x:x.figure)
x = True
for i in range(1, len(pai)):
if(pai[i].suit == pai[i-1].suit and (pai[i].figure == pai[i-1].figure + 1 or pai[i... | 21.916667 | 132 | 0.471483 |
import deck
while(True):
p = deck.Deck()
p.shuffle()
pai = p.deal(5)
del p
pai.sort(key=lambda x:x.figure)
x = True
for i in range(1, len(pai)):
if(pai[i].suit == pai[i-1].suit and (pai[i].figure == pai[i-1].figure + 1 or pai[i].figure == 10 and pai[i-1].figure == 1)):
... | true | true |
f701ce4be73d3f3af3e6256b3bb71ac213ac3103 | 4,318 | py | Python | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | """Support for Eliot tracing with Dask computations."""
from pyrsistent import PClass, field
from dask import compute, optimize
from dask.core import toposort, get_dependencies
from . import start_action, current_action, Action, Message
class _RunWithEliotContext(PClass):
"""
Run a callable within an Eliot ... | 31.064748 | 79 | 0.629458 |
from pyrsistent import PClass, field
from dask import compute, optimize
from dask.core import toposort, get_dependencies
from . import start_action, current_action, Action, Message
class _RunWithEliotContext(PClass):
task_id = field(type=str)
func = field()
key = field(type=str)
dependencies = fie... | true | true |
f701cf88425ad59561c2f13828995c8ac4ce256c | 4,582 | py | Python | earo/event.py | meso5533/Laky-Earo | 67fa4f2b45596fc3dcfe1b6a54e12202e62cd860 | [
"Apache-2.0"
] | 1 | 2021-12-22T14:21:42.000Z | 2021-12-22T14:21:42.000Z | earo/event.py | Everley1993/Laky-Earo | 67fa4f2b45596fc3dcfe1b6a54e12202e62cd860 | [
"Apache-2.0"
] | null | null | null | earo/event.py | Everley1993/Laky-Earo | 67fa4f2b45596fc3dcfe1b6a54e12202e62cd860 | [
"Apache-2.0"
] | 1 | 2021-12-22T14:21:43.000Z | 2021-12-22T14:21:43.000Z | #!/usr/bin/python
# -*- coding:utf-8 -*-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Copyright 2016 Everley #
# #
# Licensed under the Apache License,... | 30.751678 | 87 | 0.494326 | true | true | |
f701cfcda0e7aeba57d87044b5234012ec3d46b3 | 4,184 | py | Python | dataloaders/combine_dbs.py | ZurMaD/DeepGrabCut-PyTorch | 13d9e81e6e438ad3394fb3a78aca26c2cc63c825 | [
"MIT"
] | 244 | 2018-06-16T07:52:56.000Z | 2022-03-12T21:45:30.000Z | dataloaders/combine_dbs.py | ZurMaD/DeepGrabCut-PyTorch | 13d9e81e6e438ad3394fb3a78aca26c2cc63c825 | [
"MIT"
] | 7 | 2018-08-21T13:08:06.000Z | 2021-08-25T04:04:59.000Z | dataloaders/combine_dbs.py | ZurMaD/DeepGrabCut-PyTorch | 13d9e81e6e438ad3394fb3a78aca26c2cc63c825 | [
"MIT"
] | 60 | 2018-07-26T15:47:10.000Z | 2022-01-02T13:59:56.000Z | import torch.utils.data as data
class CombineDBs(data.Dataset):
def __init__(self, dataloaders, excluded=None):
self.dataloaders = dataloaders
self.excluded = excluded
self.im_ids = []
# Combine object lists
for dl in dataloaders:
for elem in dl.im_ids:
... | 37.693694 | 121 | 0.580784 | import torch.utils.data as data
class CombineDBs(data.Dataset):
def __init__(self, dataloaders, excluded=None):
self.dataloaders = dataloaders
self.excluded = excluded
self.im_ids = []
for dl in dataloaders:
for elem in dl.im_ids:
if elem not i... | true | true |
f701d45f0c4e24fdc3dba6acf4d40a703353740b | 7,254 | py | Python | autoload/vital/__vim_gista__/Web/API/github.py | lambdalisue/vim-gista | c046de1b9d4cf97ff6f80cf3bdbb75b1094f2aaf | [
"MIT"
] | 158 | 2015-01-07T14:32:12.000Z | 2022-03-23T04:17:40.000Z | vim/plugins/vim-gista/autoload/vital/__vim_gista__/Web/API/github.py | Raymond-yn/dotfiles | b1745ff62f4285785877a2c04d93ce8fa2775964 | [
"MIT"
] | 41 | 2015-01-29T13:50:39.000Z | 2021-02-22T14:11:15.000Z | autoload/vital/_github_auth/Web/API/github.py | momo-lab/github_auth.vim | 8e2e7b61d705368699d50ddff8150bea8dc166c9 | [
"MIT"
] | 10 | 2015-01-29T12:57:43.000Z | 2021-06-20T09:39:31.000Z | try:
import vim
except ImportError:
raise ImportError(
'"vim" is not available. This module require to be loaded from Vim.'
)
#
# NOTE
# Vim use a global namespace for python/python3 so define a unique name
# function and write a code inside of the function to prevent conflicts.
#
def _vim_vit... | 34.056338 | 78 | 0.560656 | try:
import vim
except ImportError:
raise ImportError(
'"vim" is not available. This module require to be loaded from Vim.'
)
def _vim_vital_web_api_github_main():
import re
import sys
import ssl
import collections
from itertools import chain
from threading import Lock... | true | true |
f701d5cc91a7627c4c17ffe3d7d861dcaa962752 | 900 | py | Python | scanner.py | xaviercho/port_scanner | c83891782c4d37524b9bf1face1165c7ae0b6820 | [
"MIT"
] | null | null | null | scanner.py | xaviercho/port_scanner | c83891782c4d37524b9bf1face1165c7ae0b6820 | [
"MIT"
] | null | null | null | scanner.py | xaviercho/port_scanner | c83891782c4d37524b9bf1face1165c7ae0b6820 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
import socket
from datetime import datetime
#Defining our target
if len (sys.argv) == 2:
target=socket.gethostbyname(sys.argv[1]) #translate hostname to IPv4
else:
print("invalid amount of arguments.")
print("Syntax: python3 scanner.py <ip>")
#add a pretty banner
print("-" * 50)
print("... | 21.428571 | 69 | 0.703333 |
import sys
import socket
from datetime import datetime
if len (sys.argv) == 2:
target=socket.gethostbyname(sys.argv[1])
else:
print("invalid amount of arguments.")
print("Syntax: python3 scanner.py <ip>")
print("-" * 50)
print("Scanning target " + target)
print("Time started: " +str(datetime.now()))
print("-... | true | true |
f701d60a5f3be60144083a87cbb8236ccd34114a | 5,308 | py | Python | lib/pwiki/OsAbstract.py | ckolumbus/WikidPad.svn | 8f03c1105a8144c9a82e392ab7f32e263c533775 | [
"Apache-2.0"
] | 2 | 2019-02-24T08:53:20.000Z | 2019-09-25T02:11:17.000Z | lib/pwiki/OsAbstract.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | null | null | null | lib/pwiki/OsAbstract.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | null | null | null | """
OS abstraction
"""
import os, shutil, os.path, re, traceback
import wx
from . import SystemInfo
from .StringOps import mbcsEnc, urlQuote, pathnameFromUrl, pathEnc
# import WindowsHacks
try:
import WindowsHacks
except:
if SystemInfo.isWindows():
traceback.print_exc()
Window... | 30.505747 | 82 | 0.646948 |
import os, shutil, os.path, re, traceback
import wx
from . import SystemInfo
from .StringOps import mbcsEnc, urlQuote, pathnameFromUrl, pathEnc
try:
import WindowsHacks
except:
if SystemInfo.isWindows():
traceback.print_exc()
WindowsHacks = None
try:
import GtkHacks
exce... | true | true |
f701d647f8fe822a2a2729383c44109685c2195f | 13,630 | py | Python | sdk/python/pulumi_azure/apimanagement/policy.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 109 | 2018-06-18T00:19:44.000Z | 2022-02-20T05:32:57.000Z | sdk/python/pulumi_azure/apimanagement/policy.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 663 | 2018-06-18T21:08:46.000Z | 2022-03-31T20:10:11.000Z | sdk/python/pulumi_azure/apimanagement/policy.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-07-19T22:37:38.000Z | 2022-03-14T10:56:26.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, overload
from .. import... | 44.110032 | 316 | 0.65818 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['PolicyArgs', 'Policy']
@pulumi.input_type
class PolicyArgs:
def __init__(__self__, *,
api_management_id: pulumi.Input[str],
... | true | true |
f701d7618a85844aeb01cd94452ad9a35deb367d | 3,321 | py | Python | backend/backend/settings.py | gabrielacham/e-store | 03118b04a37d2e32c89a576427734bd02a8c46fd | [
"MIT"
] | null | null | null | backend/backend/settings.py | gabrielacham/e-store | 03118b04a37d2e32c89a576427734bd02a8c46fd | [
"MIT"
] | null | null | null | backend/backend/settings.py | gabrielacham/e-store | 03118b04a37d2e32c89a576427734bd02a8c46fd | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 2.2.13.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 25.351145 | 91 | 0.696778 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'q-)uruwrq0lgi+fp=do3(nbh)$o_+fr4qzp5w&_n5$lq0$*ywx'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f701d79de132b4a6cd7e54e5a411a0f1e7ea9253 | 6,198 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_connections_response.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_connections_response.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_connections_response.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | 27.546667 | 86 | 0.592449 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1ListConnectionsResponse(object):
openapi_types = {
"count": "int",
"results": "list[V1ConnectionResponse]",
"previous": "str",
"next": "str",
}
attribut... | true | true |
f701d83453f612268763a247855c8cdd1e3ec468 | 1,393 | py | Python | test/sca/test_edit.py | scrambler-crypto/pyecsca | 491abfb548455669abd470382a48dcd07b2eda87 | [
"MIT"
] | null | null | null | test/sca/test_edit.py | scrambler-crypto/pyecsca | 491abfb548455669abd470382a48dcd07b2eda87 | [
"MIT"
] | null | null | null | test/sca/test_edit.py | scrambler-crypto/pyecsca | 491abfb548455669abd470382a48dcd07b2eda87 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
from pyecsca.sca import Trace, trim, reverse, pad
class EditTests(TestCase):
def setUp(self):
self._trace = Trace(np.array([10, 20, 30, 40, 50], dtype=np.dtype("i1")))
def test_trim(self):
result = trim(self._trace, 2)
self.assertIsN... | 33.97561 | 97 | 0.585068 | from unittest import TestCase
import numpy as np
from pyecsca.sca import Trace, trim, reverse, pad
class EditTests(TestCase):
def setUp(self):
self._trace = Trace(np.array([10, 20, 30, 40, 50], dtype=np.dtype("i1")))
def test_trim(self):
result = trim(self._trace, 2)
self.assertIsN... | true | true |
f701d83c8c0491098011e98966490d3b6a659777 | 21,807 | py | Python | venv/Lib/site-packages/shiboken2/files.dir/shibokensupport/signature/mapping.py | gabistoian/Hide-Text-in-image | 88b5ef0bd2bcb0e222cfbc7abf6ac2b869f72ec5 | [
"X11"
] | null | null | null | venv/Lib/site-packages/shiboken2/files.dir/shibokensupport/signature/mapping.py | gabistoian/Hide-Text-in-image | 88b5ef0bd2bcb0e222cfbc7abf6ac2b869f72ec5 | [
"X11"
] | null | null | null | venv/Lib/site-packages/shiboken2/files.dir/shibokensupport/signature/mapping.py | gabistoian/Hide-Text-in-image | 88b5ef0bd2bcb0e222cfbc7abf6ac2b869f72ec5 | [
"X11"
] | null | null | null | #############################################################################
##
## Copyright (C) 2019 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of Qt for Python.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may us... | 32.941088 | 107 | 0.647315 | "PyDate": datetime.date,
"sample.bool": bool,
"sample.char": int,
"sample.double": float,
"sample.int": int,
"sample.ObjectType": object,
"sample.OddBool": bool,
"sample.Photon.TemplateBase[Photon.DuplicatorType]": sample.Photon.ValueDuplicator,
"sampl... | true | true |
f701d937456c45c6727a342282dc55e55803f41c | 1,747 | py | Python | pyqt_ui.py | hacker-h/pyusb-keyboard-alike | ce892fbd8dac5ad72af628c993a3e12c076485d6 | [
"MIT"
] | 47 | 2015-02-09T11:39:03.000Z | 2022-03-29T00:55:21.000Z | pyqt_ui.py | hacker-h/pyusb-keyboard-alike | ce892fbd8dac5ad72af628c993a3e12c076485d6 | [
"MIT"
] | 12 | 2015-03-03T21:13:28.000Z | 2021-10-02T18:05:18.000Z | pyqt_ui.py | hacker-h/pyusb-keyboard-alike | ce892fbd8dac5ad72af628c993a3e12c076485d6 | [
"MIT"
] | 23 | 2015-02-19T13:46:32.000Z | 2021-07-31T18:57:55.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_example.ui'
#
# Created: Sun May 18 03:45:55 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | 36.395833 | 105 | 0.718947 |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _enc... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.