hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f5c02a4fde4bcf5956b3552ed0e30be3b7c67c | 3,160 | py | Python | tests/test_structure_extend.py | loyada/typed-py | 8f946ed0cddb38bf7fd463a4c8111a592ccae31a | [
"MIT"
] | null | null | null | tests/test_structure_extend.py | loyada/typed-py | 8f946ed0cddb38bf7fd463a4c8111a592ccae31a | [
"MIT"
] | null | null | null | tests/test_structure_extend.py | loyada/typed-py | 8f946ed0cddb38bf7fd463a4c8111a592ccae31a | [
"MIT"
] | null | null | null | from typing import Optional
import pytest
from typedpy import (
Deserializer,
ImmutableStructure,
Map,
Structure,
mappers,
Serializer,
Extend,
)
class Blah(Structure):
i: int
d: Map[str, int] = dict
class Foo(Blah, ImmutableStructure):
s: Optional[str]
a: set
_seri... | 26.115702 | 83 | 0.613924 | from typing import Optional
import pytest
from typedpy import (
Deserializer,
ImmutableStructure,
Map,
Structure,
mappers,
Serializer,
Extend,
)
class Blah(Structure):
i: int
d: Map[str, int] = dict
class Foo(Blah, ImmutableStructure):
s: Optional[str]
a: set
_seri... | true | true |
08f5c2eac04c81b607ffa1069a62ac326864c08e | 11,737 | py | Python | gravelamps/inference/file_generators.py | mick-wright/gwlensing | 4cfd28ab51e74eee580630e823a0c0710745015d | [
"MIT"
] | null | null | null | gravelamps/inference/file_generators.py | mick-wright/gwlensing | 4cfd28ab51e74eee580630e823a0c0710745015d | [
"MIT"
] | null | null | null | gravelamps/inference/file_generators.py | mick-wright/gwlensing | 4cfd28ab51e74eee580630e823a0c0710745015d | [
"MIT"
] | null | null | null | '''
Pipe file generators for gravelamps.inference
Functions generate the files for the pipe based inference.
Written by Mick Wright 2021
'''
import os
import subprocess
import bilby
def lens_subfile(config, dim_freq_file, sour_pos_file, amp_fac_real_file,
amp_fac_imag_file, additional_lens_paramet... | 42.0681 | 99 | 0.688166 |
import os
import subprocess
import bilby
def lens_subfile(config, dim_freq_file, sour_pos_file, amp_fac_real_file,
amp_fac_imag_file, additional_lens_parameters):
outdir = config.get("output_settings", "outdir")
outdir = os.path.abspath(outdir)
submit_directory = outdir + "/submit"
... | true | true |
08f5c2f3e901b179a61bda19b895967fd777526b | 225,124 | py | Python | zerver/tests/test_signup.py | AllenCaoo/zulip | 110c96951d4d35318b79ea74edbcf7269909468e | [
"Apache-2.0"
] | 1 | 2020-08-12T23:28:41.000Z | 2020-08-12T23:28:41.000Z | zerver/tests/test_signup.py | AllenCaoo/zulip | 110c96951d4d35318b79ea74edbcf7269909468e | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_signup.py | AllenCaoo/zulip | 110c96951d4d35318b79ea74edbcf7269909468e | [
"Apache-2.0"
] | null | null | null | import datetime
import re
import time
import urllib
from typing import Any, Dict, List, Optional, Sequence
from unittest.mock import MagicMock, patch
from urllib.parse import urlencode
import orjson
from django.conf import settings
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.cont... | 41.977252 | 175 | 0.649464 | import datetime
import re
import time
import urllib
from typing import Any, Dict, List, Optional, Sequence
from unittest.mock import MagicMock, patch
from urllib.parse import urlencode
import orjson
from django.conf import settings
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.cont... | true | true |
08f5c37f12a034df005bbaa0b1eb2c87103708df | 12,952 | py | Python | ktrain/tests/test_textclassification.py | sathishksankarpandi/ktrain | bc9169661592ee14b95d9e56622dbb20e66b3568 | [
"MIT"
] | null | null | null | ktrain/tests/test_textclassification.py | sathishksankarpandi/ktrain | bc9169661592ee14b95d9e56622dbb20e66b3568 | [
"MIT"
] | null | null | null | ktrain/tests/test_textclassification.py | sathishksankarpandi/ktrain | bc9169661592ee14b95d9e56622dbb20e66b3568 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Tests of ktrain text classification flows
"""
import sys
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID";
os.environ["CUDA_VISIBLE_DEVICES"]="0"
sys.path.insert(0,'../..')
import IPython
from unittest import TestCase, main, skip
import numpy as np
import ktrain
from ktrain import text ... | 42.465574 | 88 | 0.557906 | import sys
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID";
os.environ["CUDA_VISIBLE_DEVICES"]="0"
sys.path.insert(0,'../..')
import IPython
from unittest import TestCase, main, skip
import numpy as np
import ktrain
from ktrain import text as txt
TEST_DOC = 'god christ jesus mother mary church sunday lord heaven... | true | true |
08f5c44ac6f7fb47308e82c9187eb68841216623 | 1,090 | py | Python | kive/transformation/serializers.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T06:10:01.000Z | 2021-12-22T06:10:01.000Z | kive/transformation/serializers.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | null | null | null | kive/transformation/serializers.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | null | null | null | from rest_framework import serializers
from transformation.models import TransformationXput, TransformationInput, \
TransformationOutput, XputStructure
class XputStructureSerializer(serializers.ModelSerializer):
class Meta:
model = XputStructure
fields = (
"compounddatatype",
... | 31.142857 | 82 | 0.707339 | from rest_framework import serializers
from transformation.models import TransformationXput, TransformationInput, \
TransformationOutput, XputStructure
class XputStructureSerializer(serializers.ModelSerializer):
class Meta:
model = XputStructure
fields = (
"compounddatatype",
... | true | true |
08f5c48937c03007340225217f1aee574a79d5d2 | 13,559 | py | Python | tavern/schemas/extensions.py | andymcf/tavern | f18aed6636541a75a10e84374f185c7a30713c04 | [
"MIT"
] | null | null | null | tavern/schemas/extensions.py | andymcf/tavern | f18aed6636541a75a10e84374f185c7a30713c04 | [
"MIT"
] | null | null | null | tavern/schemas/extensions.py | andymcf/tavern | f18aed6636541a75a10e84374f185c7a30713c04 | [
"MIT"
] | null | null | null | import os
import re
from pykwalify.types import is_bool, is_float, is_int
from tavern.util import exceptions
from tavern.util.exceptions import BadSchemaError
from tavern.util.extfunctions import get_pykwalify_logger, import_ext_function
from tavern.util.loader import ApproxScalar, BoolToken, FloatToken, IntToken
fro... | 31.978774 | 174 | 0.626669 | import os
import re
from pykwalify.types import is_bool, is_float, is_int
from tavern.util import exceptions
from tavern.util.exceptions import BadSchemaError
from tavern.util.extfunctions import get_pykwalify_logger, import_ext_function
from tavern.util.loader import ApproxScalar, BoolToken, FloatToken, IntToken
fro... | true | true |
08f5c49b4cef29983fcbde285585303d04111d77 | 4,408 | py | Python | ask-smapi-model/ask_smapi_model/v1/isp/custom_product_prompts.py | alexa-labs/alexa-apis-for-python | 52838be4f57ee1a2479402ea78b1247b56017942 | [
"Apache-2.0"
] | 90 | 2018-09-19T21:56:42.000Z | 2022-03-30T11:25:21.000Z | ask-smapi-model/ask_smapi_model/v1/isp/custom_product_prompts.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 11 | 2018-09-23T12:16:48.000Z | 2021-06-10T19:49:45.000Z | ask-smapi-model/ask_smapi_model/v1/isp/custom_product_prompts.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 28 | 2018-09-19T22:30:38.000Z | 2022-02-22T22:57:07.000Z | # 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... | 38 | 198 | 0.642241 |
import pprint
import re import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union, Any
from datetime import datetime
class CustomProductPrompts(object):
deserialized_types = {
'purchase_prompt_description': 'str',
'bought_ca... | true | true |
08f5c575bcbcd0ee74f875b6fd32a403f396576c | 6,819 | py | Python | neuralpredictors/layers/readouts/factorized.py | kellirestivo/neuralpredictors | 57205a90d2e3daa5f8746c6ef6170be9e35cb5f5 | [
"MIT"
] | 9 | 2020-11-26T18:22:32.000Z | 2022-01-22T15:51:52.000Z | neuralpredictors/layers/readouts/factorized.py | kellirestivo/neuralpredictors | 57205a90d2e3daa5f8746c6ef6170be9e35cb5f5 | [
"MIT"
] | 60 | 2020-10-21T15:32:28.000Z | 2022-02-25T10:38:16.000Z | neuralpredictors/layers/readouts/factorized.py | mohammadbashiri/neuralpredictors | 8e60c9ce91f83e3dcaa1b3dbe4422e1509ccbd5f | [
"MIT"
] | 21 | 2020-10-21T09:29:17.000Z | 2022-02-07T10:04:46.000Z | import torch
from torch import nn as nn
import numpy as np
from .base import Readout
class FullFactorized2d(Readout):
"""
Factorized fully connected layer. Weights are a sum of outer products between a spatial filter and a feature vector.
"""
def __init__(
self,
in_shape,
out... | 35.889474 | 120 | 0.60698 | import torch
from torch import nn as nn
import numpy as np
from .base import Readout
class FullFactorized2d(Readout):
def __init__(
self,
in_shape,
outdims,
bias,
normalize=True,
init_noise=1e-3,
constrain_pos=False,
positive_weights=False,
... | true | true |
08f5c5bc59fc380014c9c2a6d82be27567d62348 | 23,456 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.665198 | 249 | 0.678675 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
08f5c5bce6042df75a31d82b4338971a0b3d1e8f | 8,252 | py | Python | rl/hyperoptimizer/random_search.py | AsimKhan2019/OpenAI-Lab | d0669d89268f2dc01c1cf878e4879775c7b6eb3c | [
"MIT"
] | 340 | 2017-02-21T02:32:39.000Z | 2021-12-20T00:47:18.000Z | rl/hyperoptimizer/random_search.py | AsimKhan2019/OpenAI-Lab | d0669d89268f2dc01c1cf878e4879775c7b6eb3c | [
"MIT"
] | 14 | 2017-02-15T19:46:36.000Z | 2018-12-15T23:42:21.000Z | rl/hyperoptimizer/random_search.py | AsimKhan2019/OpenAI-Lab | d0669d89268f2dc01c1cf878e4879775c7b6eb3c | [
"MIT"
] | 72 | 2017-02-21T05:16:00.000Z | 2021-12-06T03:34:57.000Z | import json
import numpy as np
from rl.analytics import ideal_fitness_score
from rl.hyperoptimizer.base_hyperoptimizer import HyperOptimizer
from rl.util import PROBLEMS, to_json, logger
class RandomSearch(HyperOptimizer):
'''
Random Search by sampling on hysphere around a search path
algo:
1. init x... | 37.509091 | 77 | 0.606035 | import json
import numpy as np
from rl.analytics import ideal_fitness_score
from rl.hyperoptimizer.base_hyperoptimizer import HyperOptimizer
from rl.util import PROBLEMS, to_json, logger
class RandomSearch(HyperOptimizer):
def decay_search_radius(self):
min_radius = 0.01
... | true | true |
08f5c6030a4245de7d35a696e8cc40a3424bc19d | 4,778 | py | Python | src/nwb_datajoint/spikesorting/sortingview_helper_fn.py | jihyunbak/spyglass | 780fe2c101db60d42a1b73ad8fd729db42620ba6 | [
"MIT"
] | null | null | null | src/nwb_datajoint/spikesorting/sortingview_helper_fn.py | jihyunbak/spyglass | 780fe2c101db60d42a1b73ad8fd729db42620ba6 | [
"MIT"
] | null | null | null | src/nwb_datajoint/spikesorting/sortingview_helper_fn.py | jihyunbak/spyglass | 780fe2c101db60d42a1b73ad8fd729db42620ba6 | [
"MIT"
] | null | null | null | "Sortingview helper functions"
from ..common.common_lab import LabMember
import os
import tempfile
from typing import List
import sortingview as sv
import spikeinterface as si
import spikeinterface.toolkit as st
def set_workspace_permission(workspace_uri: str, team_members: List[str], sortingview_sorting_id: str =... | 41.547826 | 110 | 0.68627 |
from ..common.common_lab import LabMember
import os
import tempfile
from typing import List
import sortingview as sv
import spikeinterface as si
import spikeinterface.toolkit as st
def set_workspace_permission(workspace_uri: str, team_members: List[str], sortingview_sorting_id: str = None):
workspace = sv.load... | true | true |
08f5c7188ac813e49d180582e08d1e6a9c35c174 | 824 | py | Python | NewsFeed/models.py | 1104028/StrativNewsFeed | 4499cbb17141ca1aa19d3fd00071828ff9ab3d7a | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | NewsFeed/models.py | 1104028/StrativNewsFeed | 4499cbb17141ca1aa19d3fd00071828ff9ab3d7a | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | NewsFeed/models.py | 1104028/StrativNewsFeed | 4499cbb17141ca1aa19d3fd00071828ff9ab3d7a | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | from django.db import models
from django.conf import settings
class Countries(models.Model):
countryName= models.CharField(max_length=100)
created = models.DateTimeField(auto_now_add=True)
class Sources(models.Model):
sourceName=models.CharField(max_length=100)
created = models.DateTimeField(auto_... | 34.333333 | 58 | 0.716019 | from django.db import models
from django.conf import settings
class Countries(models.Model):
countryName= models.CharField(max_length=100)
created = models.DateTimeField(auto_now_add=True)
class Sources(models.Model):
sourceName=models.CharField(max_length=100)
created = models.DateTimeField(auto_... | true | true |
08f5c718b400c230e5a6ddf33a11b371e44aed3d | 824 | py | Python | setup.py | mendrugory/torip | 4a7acb49824f84979e8aeaac3ead442be9e675e2 | [
"MIT"
] | 7 | 2015-10-31T15:17:18.000Z | 2017-10-27T07:12:09.000Z | setup.py | mendrugory/torip | 4a7acb49824f84979e8aeaac3ead442be9e675e2 | [
"MIT"
] | 2 | 2021-09-22T16:20:52.000Z | 2021-09-23T10:19:02.000Z | setup.py | mendrugory/torip | 4a7acb49824f84979e8aeaac3ead442be9e675e2 | [
"MIT"
] | null | null | null | #!venv/bin/python
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="torip",
version="RELEASE_VERSION",
author="Gonzalo Gabriel Jiménez Fuentes",
author_email="iam@mendrugory.com",
description="Library for Tornado web frame... | 27.466667 | 83 | 0.662621 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="torip",
version="RELEASE_VERSION",
author="Gonzalo Gabriel Jiménez Fuentes",
author_email="iam@mendrugory.com",
description="Library for Tornado web framework to locate IPs... | true | true |
08f5c7d13e4fd62faba64a6fc9222cceefbf9007 | 811 | py | Python | Test.py | RealmOfTibbles/Cyberpunk-2077-LED | ecee591f1de1fb0d42f440509e6549211024670c | [
"MIT"
] | null | null | null | Test.py | RealmOfTibbles/Cyberpunk-2077-LED | ecee591f1de1fb0d42f440509e6549211024670c | [
"MIT"
] | null | null | null | Test.py | RealmOfTibbles/Cyberpunk-2077-LED | ecee591f1de1fb0d42f440509e6549211024670c | [
"MIT"
] | null | null | null | import time
import random
import board
import adafruit_dotstar as dotstar
# On-board DotStar for boards including Gemma, Trinket, and ItsyBitsy
# dots = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 2, brightness=0.2)
# Using a DotStar Digital LED Strip with 30 LEDs connected to hardware SPI
dots = dotstar.Dot... | 27.033333 | 80 | 0.727497 | import time
import random
import board
import adafruit_dotstar as dotstar
dots = dotstar.DotStar(board.SCK, board.MOSI, 42, brightness=0.3)
def random_color():
return random.randrange(0, 7) * 32
n_dots = len(dots)
while True:
for dot in range(n_dots):
dots[dot] = (random_color(), random_color... | true | true |
08f5c800d826cd47a68330d3c5d48e3d9a336cab | 3,427 | py | Python | flare/forms/formatString.py | xnopasaranx/flare | 6fbada9e6f992205f27fac91745f5da9995f4fd4 | [
"MIT"
] | null | null | null | flare/forms/formatString.py | xnopasaranx/flare | 6fbada9e6f992205f27fac91745f5da9995f4fd4 | [
"MIT"
] | null | null | null | flare/forms/formatString.py | xnopasaranx/flare | 6fbada9e6f992205f27fac91745f5da9995f4fd4 | [
"MIT"
] | null | null | null | from flare import utils
import re
def formatOneEntry(key, format, data, structure = None, prefix = None, language = None, context=None, _rec = 0):
res = format
val = data[ key ]
# Get structure if available
struct = structure.get( key ) if structure else None
if isinstance( struct, list ):
struct = { k: v for ... | 30.598214 | 159 | 0.646922 | from flare import utils
import re
def formatOneEntry(key, format, data, structure = None, prefix = None, language = None, context=None, _rec = 0):
res = format
val = data[ key ]
struct = structure.get( key ) if structure else None
if isinstance( struct, list ):
struct = { k: v for k, v in struct }
if isinsta... | true | true |
08f5c840eefdd01cb4451983334b462d242a4fd0 | 238 | py | Python | mastodon_api/db.py | perylemke/mastodon-api | cca61597b40971a464649b65ebb52d8098bb4f9c | [
"Apache-2.0"
] | null | null | null | mastodon_api/db.py | perylemke/mastodon-api | cca61597b40971a464649b65ebb52d8098bb4f9c | [
"Apache-2.0"
] | null | null | null | mastodon_api/db.py | perylemke/mastodon-api | cca61597b40971a464649b65ebb52d8098bb4f9c | [
"Apache-2.0"
] | null | null | null | # pylint: disable=invalid-name
import motor.motor_asyncio
from decouple import config
MONGO_URI = config('DB_URI', default='localhost', cast=str)
client = motor.motor_asyncio.AsyncIOMotorClient(MONGO_URI)
mastodondb = client.mastodondb
| 26.444444 | 59 | 0.810924 | import motor.motor_asyncio
from decouple import config
MONGO_URI = config('DB_URI', default='localhost', cast=str)
client = motor.motor_asyncio.AsyncIOMotorClient(MONGO_URI)
mastodondb = client.mastodondb
| true | true |
08f5c8af4efd5774bdcc30e774eb1a223d49d41e | 2,607 | py | Python | data_loader/data_generator.py | AndersDHenriksen/Tensorflow-Project-Template | 32dfeaaf1243587af4ceb7b378c135092ddb9258 | [
"Apache-2.0"
] | null | null | null | data_loader/data_generator.py | AndersDHenriksen/Tensorflow-Project-Template | 32dfeaaf1243587af4ceb7b378c135092ddb9258 | [
"Apache-2.0"
] | null | null | null | data_loader/data_generator.py | AndersDHenriksen/Tensorflow-Project-Template | 32dfeaaf1243587af4ceb7b378c135092ddb9258 | [
"Apache-2.0"
] | 1 | 2018-07-09T03:01:18.000Z | 2018-07-09T03:01:18.000Z | import numpy as np
import pathlib
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator # Currently not used
def train_test_split(X, y, test_split_ratio, random_state=0):
rng = np.random.RandomState(random_state)
indices = np.arange(X.shape[0])
rng.shuffle(indices)
n_split = int(... | 45.736842 | 118 | 0.667434 | import numpy as np
import pathlib
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
def train_test_split(X, y, test_split_ratio, random_state=0):
rng = np.random.RandomState(random_state)
indices = np.arange(X.shape[0])
rng.shuffle(indices)
n_split = int(test_split_ratio * X.... | true | true |
08f5ca2614be52f0becff1ffaf31637eb552da8c | 808 | py | Python | elementary/python/ej6.py | keyduq/programming-practices | 56b99db86d74d441c4c88cd313844e4e39c86872 | [
"MIT"
] | null | null | null | elementary/python/ej6.py | keyduq/programming-practices | 56b99db86d74d441c4c88cd313844e4e39c86872 | [
"MIT"
] | null | null | null | elementary/python/ej6.py | keyduq/programming-practices | 56b99db86d74d441c4c88cd313844e4e39c86872 | [
"MIT"
] | null | null | null | print("""\
Program that asks the user for a number n and gives him the possibility to choose between computing the sum and computing the product of 1,...,n.
Created By Keyvin Duque <thkeyduq@gmail.com>
""")
n = int(input('Ingrese un numero: '))
choice = input('Desea usted realizar la suma o la multiplicacion de sus el... | 36.727273 | 145 | 0.67698 | print("""\
Program that asks the user for a number n and gives him the possibility to choose between computing the sum and computing the product of 1,...,n.
Created By Keyvin Duque <thkeyduq@gmail.com>
""")
n = int(input('Ingrese un numero: '))
choice = input('Desea usted realizar la suma o la multiplicacion de sus el... | true | true |
08f5caf3f41c9b34a6dc0e520d1913635fe38d22 | 1,530 | py | Python | models/WTRN/WTRN.py | zskuang58/WTRN-TIP | e356b3f6264c537e829322be239cd75d8359a63b | [
"MIT"
] | 2 | 2022-03-04T06:54:35.000Z | 2022-03-26T01:58:59.000Z | models/WTRN/WTRN.py | zskuang58/WTRN-TIP | e356b3f6264c537e829322be239cd75d8359a63b | [
"MIT"
] | null | null | null | models/WTRN/WTRN.py | zskuang58/WTRN-TIP | e356b3f6264c537e829322be239cd75d8359a63b | [
"MIT"
] | 1 | 2022-03-26T01:58:54.000Z | 2022-03-26T01:58:54.000Z | from . import MainNet, LTE, SearchTransfer
import torch.nn as nn
class WTRN(nn.Module):
def __init__(self, args):
super(WTRN, self).__init__()
self.args = args
self.num_res_blocks = list(map(int, args.num_res_blocks.split('+')))
self.MainNet = MainNet.MainNet(
... | 38.25 | 77 | 0.592157 | from . import MainNet, LTE, SearchTransfer
import torch.nn as nn
class WTRN(nn.Module):
def __init__(self, args):
super(WTRN, self).__init__()
self.args = args
self.num_res_blocks = list(map(int, args.num_res_blocks.split('+')))
self.MainNet = MainNet.MainNet(
... | true | true |
08f5cb38cc77149e43a64ab6d555726960e5e476 | 1,758 | py | Python | Gurobi/schedule1.py | JarvisAPI/Pi-RTOS | 3511b214d8c1605c7772282d9ddd9acc3b186dc4 | [
"MIT"
] | 3 | 2019-08-24T16:02:03.000Z | 2021-08-07T14:39:53.000Z | Gurobi/schedule1.py | JarvisAPI/Pi-RTOS | 3511b214d8c1605c7772282d9ddd9acc3b186dc4 | [
"MIT"
] | null | null | null | Gurobi/schedule1.py | JarvisAPI/Pi-RTOS | 3511b214d8c1605c7772282d9ddd9acc3b186dc4 | [
"MIT"
] | 2 | 2020-01-01T00:33:41.000Z | 2020-12-31T11:22:51.000Z |
from pyscipopt import Model, quicksum, multidict
def BinPackingExample():
B = 1
w = [0.1,0.2,0.3]
q = [4,3,2]
s=[]
for j in range(len(w)):
for i in range(q[j]):
s.append(w[j])
return s,B
def FFD(s, B):
remain = [B]
sol = [[]]
for item in sorted(s, reverse=True... | 23.756757 | 87 | 0.494881 |
from pyscipopt import Model, quicksum, multidict
def BinPackingExample():
B = 1
w = [0.1,0.2,0.3]
q = [4,3,2]
s=[]
for j in range(len(w)):
for i in range(q[j]):
s.append(w[j])
return s,B
def FFD(s, B):
remain = [B]
sol = [[]]
for item in sorted(s, reverse=True... | true | true |
08f5cb69b24666e8de90ff6526ea128b828f1d54 | 117 | py | Python | goto/gotomagic/text/__init__.py | technocake/goto | 3bd2997ccd7ef4ee9bcf4f9b72b1e13f11738faf | [
"MIT"
] | 10 | 2017-11-05T16:12:08.000Z | 2021-10-05T08:18:12.000Z | goto/gotomagic/text/__init__.py | technocake/goto | 3bd2997ccd7ef4ee9bcf4f9b72b1e13f11738faf | [
"MIT"
] | 81 | 2017-11-05T20:22:27.000Z | 2021-11-12T12:40:50.000Z | goto/gotomagic/text/__init__.py | technocake/goto | 3bd2997ccd7ef4ee9bcf4f9b72b1e13f11738faf | [
"MIT"
] | 3 | 2017-12-14T18:20:52.000Z | 2019-05-24T09:37:56.000Z | # -*- coding: utf-8 -*-
"""
Text used by GOTO to do UX.
"""
from .text import GotoError, GotoWarning, print_text | 19.5 | 52 | 0.632479 |
from .text import GotoError, GotoWarning, print_text | true | true |
08f5cbe92f74df304963f92f22effb0457410f36 | 10,895 | py | Python | src/algos/gnn.py | DanieleGammelli/graph-meta-rl-for-amod | bd6fe8cd561ab70e85d360966715a53a0a56386c | [
"MIT"
] | null | null | null | src/algos/gnn.py | DanieleGammelli/graph-meta-rl-for-amod | bd6fe8cd561ab70e85d360966715a53a0a56386c | [
"MIT"
] | null | null | null | src/algos/gnn.py | DanieleGammelli/graph-meta-rl-for-amod | bd6fe8cd561ab70e85d360966715a53a0a56386c | [
"MIT"
] | null | null | null | """
A2C-GNN
-------
This file contains the A2C-GNN specifications. In particular, we implement:
(1) GNNParser
Converts raw environment observations to agent inputs (s_t).
(2) GNNActor:
Policy represented by a Temporal Graph Network (Section 4.3 in the paper)
(3) GNNCritic:
Critic represented by a Temporal G... | 39.908425 | 157 | 0.592474 |
import numpy as np
import json
import torch
from torch import nn
import torch.nn.functional as F
from torch.distributions import Dirichlet
from torch_geometric.data import Data
from torch_geometric.nn import GCNConv
from torch_geometric.nn import global_mean_pool, global_max_pool
from torch_scatter import scatter_sum,... | true | true |
08f5cd71722a87a1a7ca7784cfe4c413b1f1170d | 32,725 | py | Python | api/desecapi/serializers.py | unuseless/desec-stack | 399b64ea87775585b825ecdabcf5ea917269dc90 | [
"MIT"
] | null | null | null | api/desecapi/serializers.py | unuseless/desec-stack | 399b64ea87775585b825ecdabcf5ea917269dc90 | [
"MIT"
] | null | null | null | api/desecapi/serializers.py | unuseless/desec-stack | 399b64ea87775585b825ecdabcf5ea917269dc90 | [
"MIT"
] | null | null | null | import binascii
import copy
import json
import re
from base64 import urlsafe_b64decode, urlsafe_b64encode, b64encode
from captcha.image import ImageCaptcha
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.password_validation import validate_password
import django.core.exceptions
from djang... | 40.252153 | 120 | 0.650726 | import binascii
import copy
import json
import re
from base64 import urlsafe_b64decode, urlsafe_b64encode, b64encode
from captcha.image import ImageCaptcha
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.password_validation import validate_password
import django.core.exceptions
from djang... | true | true |
08f5cd8b471e506bfb71455b40b5abad27b224b8 | 3,884 | py | Python | downloader.py | mittelmax/sptrans_Data | a1ccb0d9566c9c9f9b30951bdc8430c930007311 | [
"MIT"
] | null | null | null | downloader.py | mittelmax/sptrans_Data | a1ccb0d9566c9c9f9b30951bdc8430c930007311 | [
"MIT"
] | null | null | null | downloader.py | mittelmax/sptrans_Data | a1ccb0d9566c9c9f9b30951bdc8430c930007311 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import lxml
import requests
import pandas as pd
import urllib
import ssl
from os import listdir
# data url's
url_2020 = requests.get("https://www.prefeitura.sp.gov.br/cidade/secretarias/transportes/institucional/sptrans/acesso_a_informacao/index.php?p=292723").text
url_2019 = requests.get... | 45.694118 | 156 | 0.717044 | from bs4 import BeautifulSoup
import lxml
import requests
import pandas as pd
import urllib
import ssl
from os import listdir
url_2020 = requests.get("https://www.prefeitura.sp.gov.br/cidade/secretarias/transportes/institucional/sptrans/acesso_a_informacao/index.php?p=292723").text
url_2019 = requests.get("https://www... | true | true |
08f5cdd9047c485b7630bd2f6392e62de095ffb9 | 103 | py | Python | debug.py | eyalbetzalel/GlowGAN | 144b8fef60d9dc38ca66c178a18c0c9a2a17c23e | [
"MIT"
] | null | null | null | debug.py | eyalbetzalel/GlowGAN | 144b8fef60d9dc38ca66c178a18c0c9a2a17c23e | [
"MIT"
] | null | null | null | debug.py | eyalbetzalel/GlowGAN | 144b8fef60d9dc38ca66c178a18c0c9a2a17c23e | [
"MIT"
] | null | null | null | from datasets import get_GMMSD
path = "/home/dsi/eyalbetzalel/GlowGAN/data/gmmsd.npy"
get_GMMSD(path) | 20.6 | 54 | 0.796117 | from datasets import get_GMMSD
path = "/home/dsi/eyalbetzalel/GlowGAN/data/gmmsd.npy"
get_GMMSD(path) | true | true |
08f5cddcf007cea2685847fe91d74cb27988f8c6 | 1,757 | py | Python | spiders/getMatch_spider.py | frickmh/LoL-Scrape-Test | aac8e0c669277bb6310508356f1f6aaaae2b4b4c | [
"Apache-2.0"
] | null | null | null | spiders/getMatch_spider.py | frickmh/LoL-Scrape-Test | aac8e0c669277bb6310508356f1f6aaaae2b4b4c | [
"Apache-2.0"
] | null | null | null | spiders/getMatch_spider.py | frickmh/LoL-Scrape-Test | aac8e0c669277bb6310508356f1f6aaaae2b4b4c | [
"Apache-2.0"
] | null | null | null | #Match numbers starting at: 2536802224
#Matches go to at least: 2541354219
#Test URL: https://na1.api.riotgames.com/lol/match/v3/matches/2536802224?api_key=RGAPI-adfe4a14-d491-4f12-a50f-833c09b1c138
#Production Key: 55b49f8b-52e1-4cbc-b7cf-d30a054b7833
#Rate Limit: 3k/10s, 180k/600s
#Test 2 URL: https://na1.api.ri... | 29.283333 | 138 | 0.589072 |
import scrapy
import json
class QuotesSpider(scrapy.Spider):
name = "getMatches"
print("INSTANTIATED!")
def start_requests(self):
match = 2536802224 + 150000
print("STARTED!")
for i in range(0, 100000):
url = "https://na1.api.riotgames.com/lol/match/v3... | true | true |
08f5cfa180f34104fd06ea17b06ebc6df9b9ce5a | 4,653 | py | Python | mcpython/client/rendering/entities/EntityBoxRenderingHelper.py | mcpython4-coding/core | e4c4f59dab68c90e2028db3add2e5065116bf4a6 | [
"CC0-1.0",
"MIT"
] | 2 | 2019-11-02T05:26:11.000Z | 2019-11-03T08:52:18.000Z | mcpython/client/rendering/entities/EntityBoxRenderingHelper.py | mcpython4-coding/core | e4c4f59dab68c90e2028db3add2e5065116bf4a6 | [
"CC0-1.0",
"MIT"
] | 25 | 2019-11-02T05:24:29.000Z | 2022-02-09T14:09:08.000Z | mcpython/client/rendering/entities/EntityBoxRenderingHelper.py | mcpython4-coding/core | e4c4f59dab68c90e2028db3add2e5065116bf4a6 | [
"CC0-1.0",
"MIT"
] | 5 | 2019-11-09T05:36:06.000Z | 2021-11-28T13:07:08.000Z | """
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... | 32.089655 | 103 | 0.629057 | import typing
import pyglet
class EntityBoxInstance:
class MutableEntityBox:
def __init__(
self,
source: "EntityBoxInstance",
buffer: pyglet.graphics.vertexdomain.VertexList,
position,
rotation,
):
self.source = source
... | true | true |
08f5d01db92a394c40155f572eaaf995c05f111a | 1,084 | py | Python | tests/utils.py | Teagum/chainsaddiction | b57995e60361134cfd4f6f748a92457e8ef14c81 | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | Teagum/chainsaddiction | b57995e60361134cfd4f6f748a92457e8ef14c81 | [
"BSD-3-Clause"
] | 7 | 2021-06-18T09:37:58.000Z | 2021-09-22T12:10:20.000Z | tests/utils.py | Teagum/chainsaddiction | b57995e60361134cfd4f6f748a92457e8ef14c81 | [
"BSD-3-Clause"
] | null | null | null | """
ChaisAddiction testing utilities
"""
from pathlib import Path
from typing import Union
import numpy as np
def gen_init_params(m_states: int, data: np.ndarray) -> tuple:
"""
Generate initila parameters for HMM training.
"""
init_lambda = gen_sdm(data, m_states)
init_gamma = gen_prob_mat(m_stat... | 25.209302 | 62 | 0.657749 | from pathlib import Path
from typing import Union
import numpy as np
def gen_init_params(m_states: int, data: np.ndarray) -> tuple:
init_lambda = gen_sdm(data, m_states)
init_gamma = gen_prob_mat(m_states, m_states)
init_delta = gen_prob_mat(1, m_states)
return init_lambda, init_gamma, init_delta
d... | true | true |
08f5d28b139286e16fe74026d833ed004664fcf9 | 3,181 | py | Python | scripts/sra_chip_to_bw.py | hanbinlu/preproc_chip_like_data | 662d945c333f796263014de0ea0cc4615d22f1e9 | [
"MIT"
] | null | null | null | scripts/sra_chip_to_bw.py | hanbinlu/preproc_chip_like_data | 662d945c333f796263014de0ea0cc4615d22f1e9 | [
"MIT"
] | null | null | null | scripts/sra_chip_to_bw.py | hanbinlu/preproc_chip_like_data | 662d945c333f796263014de0ea0cc4615d22f1e9 | [
"MIT"
] | null | null | null | import argparse, logging
import subprocess
import simple_chip_utils
logging.getLogger().setLevel(logging.INFO)
logger = logging.getLogger("Preprocess_ChIP")
formatter = logging.Formatter("%(asctime)s: %(message)s")
log_stream = logging.StreamHandler()
log_stream.setLevel(logging.INFO)
log_stream.setFormatter(formatter... | 28.657658 | 91 | 0.698208 | import argparse, logging
import subprocess
import simple_chip_utils
logging.getLogger().setLevel(logging.INFO)
logger = logging.getLogger("Preprocess_ChIP")
formatter = logging.Formatter("%(asctime)s: %(message)s")
log_stream = logging.StreamHandler()
log_stream.setLevel(logging.INFO)
log_stream.setFormatter(formatter... | true | true |
08f5d3a388e85bc0dfd3c84fcd1d4b25e3e59de8 | 7,889 | py | Python | tweetspy/deprecated/_parser.py | swc2124/tweetspy | d0d46e0f52b828e3ddb9876aec8d7b65d4cf97b1 | [
"MIT"
] | null | null | null | tweetspy/deprecated/_parser.py | swc2124/tweetspy | d0d46e0f52b828e3ddb9876aec8d7b65d4cf97b1 | [
"MIT"
] | null | null | null | tweetspy/deprecated/_parser.py | swc2124/tweetspy | d0d46e0f52b828e3ddb9876aec8d7b65d4cf97b1 | [
"MIT"
] | null | null | null | #SOl Courtney Columbia U Department of Astronomy and Astrophysics NYC 2016
#swc2124@columbia.edu
#--[DESCRIPTION]---------------------------------------------------------#
'''
Date: May 2016
Handeler for twitter text parsing
'''
#--[IMPORTS]--------------------------------------------------------------#
from nltk.... | 39.054455 | 146 | 0.534795 |
'''
Date: May 2016
Handeler for twitter text parsing
'''
from nltk.tokenize import word_tokenize
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
plt.ioff()
from time import gmtime, strftime, sleep
from astropy.table import Table
from collections import Counter
import numpy as np
impor... | false | true |
08f5d3b9cdacd7a02915a9047accbc659e336f14 | 415 | py | Python | codewars/add_binary.py | stephanosterburg/coding_challenges | 601cf1360a7fdf068487106ba995955407365983 | [
"MIT"
] | null | null | null | codewars/add_binary.py | stephanosterburg/coding_challenges | 601cf1360a7fdf068487106ba995955407365983 | [
"MIT"
] | null | null | null | codewars/add_binary.py | stephanosterburg/coding_challenges | 601cf1360a7fdf068487106ba995955407365983 | [
"MIT"
] | 1 | 2019-11-08T00:49:14.000Z | 2019-11-08T00:49:14.000Z | # Implement a function that adds two numbers together and
# returns their sum in binary. The conversion can be done
# before, or after the addition.
#
# The binary number returned should be a string.
def add_binary(a, b):
return bin(a + b)[2:]
print(add_binary(1, 1)) # "10"
print(add_binary(0, 1)) # "1"
print(a... | 27.666667 | 57 | 0.677108 | def add_binary(a, b):
return bin(a + b)[2:]
print(add_binary(1, 1)) print(add_binary(0, 1)) print(add_binary(1, 0)) print(add_binary(2, 2)) print(add_binary(51, 12)) | true | true |
08f5d3e5e7552690d495f932f6a794953aa1f2c3 | 2,482 | py | Python | morcilla/interfaces.py | athenianco/morcilla | 7a0be0df1e68669a24a8acaa085df88d43172ae0 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T08:49:59.000Z | 2022-03-08T08:49:59.000Z | morcilla/interfaces.py | athenianco/morcilla | 7a0be0df1e68669a24a8acaa085df88d43172ae0 | [
"BSD-3-Clause"
] | null | null | null | morcilla/interfaces.py | athenianco/morcilla | 7a0be0df1e68669a24a8acaa085df88d43172ae0 | [
"BSD-3-Clause"
] | 1 | 2022-03-07T19:23:38.000Z | 2022-03-07T19:23:38.000Z | import typing
from sqlalchemy.sql import ClauseElement
class DatabaseBackend:
async def connect(self) -> None:
raise NotImplementedError() # pragma: no cover
async def disconnect(self) -> None:
raise NotImplementedError() # pragma: no cover
def connection(self) -> "ConnectionBackend":... | 32.657895 | 88 | 0.665189 | import typing
from sqlalchemy.sql import ClauseElement
class DatabaseBackend:
async def connect(self) -> None:
raise NotImplementedError()
async def disconnect(self) -> None:
raise NotImplementedError()
def connection(self) -> "ConnectionBackend":
raise NotImplementedError() ... | true | true |
08f5d5affe9dd4a38513e6f9b95801445f734730 | 8,687 | py | Python | Old/2019/src/gamemanager.py | zeziba/Battleship_revisited | 2b6e173bf739bda2926bf3d4a300d9a36cb9b85c | [
"MIT"
] | null | null | null | Old/2019/src/gamemanager.py | zeziba/Battleship_revisited | 2b6e173bf739bda2926bf3d4a300d9a36cb9b85c | [
"MIT"
] | null | null | null | Old/2019/src/gamemanager.py | zeziba/Battleship_revisited | 2b6e173bf739bda2926bf3d4a300d9a36cb9b85c | [
"MIT"
] | null | null | null | import random
import boardmanager
import playermanager
import shipmanager
class GameManager:
def __init__(self, config):
self.config = config
self.__size = int(self.config["board size"])
self.__state = False
@property
def state(self):
return self.__state
def reset(s... | 37.283262 | 107 | 0.505928 | import random
import boardmanager
import playermanager
import shipmanager
class GameManager:
def __init__(self, config):
self.config = config
self.__size = int(self.config["board size"])
self.__state = False
@property
def state(self):
return self.__state
def reset(s... | true | true |
08f5d605170c759157dea1fe29881dd75a67ec6d | 4,229 | py | Python | orchid_DiseasePredict/pyqt-tutorial/V3.py | chengzee/disease_predict | d7a3c57b710ab2e93d56c8d73aeaa21120d3e98c | [
"MIT"
] | null | null | null | orchid_DiseasePredict/pyqt-tutorial/V3.py | chengzee/disease_predict | d7a3c57b710ab2e93d56c8d73aeaa21120d3e98c | [
"MIT"
] | null | null | null | orchid_DiseasePredict/pyqt-tutorial/V3.py | chengzee/disease_predict | d7a3c57b710ab2e93d56c8d73aeaa21120d3e98c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\V1.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# 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.
import pyqtgraph as pg
from PyQt5... | 50.345238 | 103 | 0.686214 |
import pyqtgraph as pg
from PyQt5 import QtCore, QtGui, QtWidgets
from datetime import datetime
class TimeAxisItem(pg.AxisItem):
def tickStrings(self, values, scale, spacing):
return [datetime.fromtimestamp(int(values[n]/1000)) for n in range(len(values))]
class Ui_MainWindow(object):
def setupUi(s... | true | true |
08f5d84ebfdb56711ffe813f1fe8c4151a6450c0 | 2,322 | py | Python | test/test_elasticity.py | bwspenc/neml | 2fe283cb14ab309d95627590408670dab877c5a5 | [
"MIT"
] | null | null | null | test/test_elasticity.py | bwspenc/neml | 2fe283cb14ab309d95627590408670dab877c5a5 | [
"MIT"
] | null | null | null | test/test_elasticity.py | bwspenc/neml | 2fe283cb14ab309d95627590408670dab877c5a5 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
from neml import elasticity, interpolate
import unittest
from common import *
import numpy as np
import numpy.linalg as la
class CommonElasticity(object):
"""
Tests that could apply to any elastic model.
"""
def test_C2S(self):
C = self.model.C(self.T)
self.assertT... | 30.155844 | 70 | 0.664513 | import sys
sys.path.append('..')
from neml import elasticity, interpolate
import unittest
from common import *
import numpy as np
import numpy.linalg as la
class CommonElasticity(object):
def test_C2S(self):
C = self.model.C(self.T)
self.assertTrue(np.allclose(self.model.S(self.T), la.inv(C)))
def test... | true | true |
08f5d8650db2d65205b6b05ef12b94f0f16b5bf5 | 8,315 | py | Python | kymatio/scattering2d/frontend/torch_frontend.py | edouardoyallon/kymatio | eeed6ac9e59bc6645b90fc4e7ff8ce4f693887bc | [
"BSD-3-Clause"
] | 2 | 2019-04-08T14:58:48.000Z | 2020-02-28T01:11:17.000Z | kymatio/scattering2d/frontend/torch_frontend.py | edouardoyallon/kymatio | eeed6ac9e59bc6645b90fc4e7ff8ce4f693887bc | [
"BSD-3-Clause"
] | 7 | 2018-12-14T01:42:21.000Z | 2019-10-05T21:40:42.000Z | kymatio/scattering2d/frontend/torch_frontend.py | edouardoyallon/kymatio | eeed6ac9e59bc6645b90fc4e7ff8ce4f693887bc | [
"BSD-3-Clause"
] | 1 | 2018-12-13T20:52:53.000Z | 2018-12-13T20:52:53.000Z | __all__ = ['Scattering2DTorch']
import torch
import torch.nn as nn
from kymatio.scattering2d.core.scattering2d import scattering2d
from ..filter_bank import filter_bank
from ..utils import compute_padding
from ...frontend.torch_frontend import ScatteringTorch
class Scattering2DTorch(ScatteringTorch):
""" Main m... | 42.423469 | 132 | 0.585207 | __all__ = ['Scattering2DTorch']
import torch
import torch.nn as nn
from kymatio.scattering2d.core.scattering2d import scattering2d
from ..filter_bank import filter_bank
from ..utils import compute_padding
from ...frontend.torch_frontend import ScatteringTorch
class Scattering2DTorch(ScatteringTorch):
def __init... | true | true |
08f5d888d23fa567519cbc3ba069a1a08aff4d8d | 2,769 | py | Python | tests/test_userdata_handler.py | heynemann/fakebook | d850e05e39c6900f4bc42c38bc48d3df5cbc577b | [
"MIT"
] | 4 | 2015-06-25T11:58:35.000Z | 2022-02-06T10:23:18.000Z | tests/test_userdata_handler.py | heynemann/fakebook | d850e05e39c6900f4bc42c38bc48d3df5cbc577b | [
"MIT"
] | null | null | null | tests/test_userdata_handler.py | heynemann/fakebook | d850e05e39c6900f4bc42c38bc48d3df5cbc577b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of fakebook.
# https://github.com/heynemann/fakebook
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Bernardo Heynemann <heynemann@gmail.com>
from json import loads
from tornado.testing import ... | 31.465909 | 93 | 0.672084 |
from json import loads
from tornado.testing import gen_test
from preggy import expect
from preggy import create_assertions
from tests.base import TestCase
@create_assertions
def to_be_one_of(topic, expected):
return topic in expected
class UserDataHandlerTestCase(TestCase):
@gen_test
def test_respo... | true | true |
08f5d9e8f3394c6e3dfb2d8d8011d942811784cc | 7,341 | py | Python | source/operators/rekognition/check_person_tracking_status.py | tuliocasagrande/aws-media-insights-engine | 56156b8acb496739d6dbb53ad613251b6341f665 | [
"Apache-2.0"
] | 2 | 2021-06-22T17:36:38.000Z | 2021-06-22T17:58:04.000Z | source/operators/rekognition/check_person_tracking_status.py | tuliocasagrande/aws-media-insights-engine | 56156b8acb496739d6dbb53ad613251b6341f665 | [
"Apache-2.0"
] | null | null | null | source/operators/rekognition/check_person_tracking_status.py | tuliocasagrande/aws-media-insights-engine | 56156b8acb496739d6dbb53ad613251b6341f665 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
###############################################################################
# PURPOSE:
# Lambda function to check the status of a Rekognition job processing a media object
#
# REFERENCE:
# https://gith... | 57.351563 | 184 | 0.640785 |
import os
import boto3
import json
from botocore import config
from MediaInsightsEngineLambdaHelper import OutputHelper
from MediaInsightsEngineLambdaHelper import MasExecutionError
from MediaInsightsEngineLambdaHelper import DataPlane
operator_name = os.environ['OPERATOR_NAME']
output_object = OutputHelper(operator... | true | true |
08f5d9e9b587d1f8162fdc313574f2061fec08a7 | 447 | py | Python | blog/migrations/0009_auto_20190823_2130.py | dhanupandey12/Blog | fcd274b7249c255786b46cf81d6e949a903e9a53 | [
"MIT"
] | null | null | null | blog/migrations/0009_auto_20190823_2130.py | dhanupandey12/Blog | fcd274b7249c255786b46cf81d6e949a903e9a53 | [
"MIT"
] | null | null | null | blog/migrations/0009_auto_20190823_2130.py | dhanupandey12/Blog | fcd274b7249c255786b46cf81d6e949a903e9a53 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-08-23 16:00
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0008_reviewsdata_timestamp'),
]
operations = [
migrations.AlterField(
model_name='reviewsda... | 22.35 | 74 | 0.637584 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0008_reviewsdata_timestamp'),
]
operations = [
migrations.AlterField(
model_name='reviewsdata',
name='timeStamp',
f... | true | true |
08f5da3326302ed23327065d02e0526490b7c8bf | 6,062 | py | Python | tests/unit/benchmark/scenarios/compute/test_lmbench.py | alexnemes/yardstick_enc | dc2d0eb663c7648271b04026b90046a27fe0b5fc | [
"Apache-2.0"
] | 1 | 2019-12-08T21:39:38.000Z | 2019-12-08T21:39:38.000Z | tests/unit/benchmark/scenarios/compute/test_lmbench.py | alexnemes/yardstick | 7a89a01cdb1b3569d0b67451572edbae0f3d05aa | [
"Apache-2.0"
] | null | null | null | tests/unit/benchmark/scenarios/compute/test_lmbench.py | alexnemes/yardstick | 7a89a01cdb1b3569d0b67451572edbae0f3d05aa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distrib... | 31.247423 | 78 | 0.562026 |
from __future__ import absolute_import
import unittest
import mock
from oslo_serialization import jsonutils
from yardstick.benchmark.scenarios.compute import lmbench
@mock.patch('yardstick.benchmark.scenarios.compute.lmbench.ssh')
class LmbenchTestCase(unittest.TestCase):
def setUp(self):
self.ctx ... | true | true |
08f5da3f418e324f095025f7d8abec05b9bb85e6 | 870 | py | Python | gpytorch/mlls/kl_gaussian_added_loss_term.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 2,673 | 2018-02-19T22:28:58.000Z | 2022-03-31T13:22:28.000Z | gpytorch/mlls/kl_gaussian_added_loss_term.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 1,415 | 2018-02-19T20:38:20.000Z | 2022-03-30T12:53:13.000Z | gpytorch/mlls/kl_gaussian_added_loss_term.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 467 | 2018-03-07T02:06:05.000Z | 2022-03-27T07:05:44.000Z | #!/usr/bin/env python3
from torch.distributions import kl_divergence
from .added_loss_term import AddedLossTerm
class KLGaussianAddedLossTerm(AddedLossTerm):
def __init__(self, q_x, p_x, n, data_dim):
super().__init__()
self.q_x = q_x
self.p_x = p_x
self.n = n
self.data_d... | 34.8 | 102 | 0.671264 |
from torch.distributions import kl_divergence
from .added_loss_term import AddedLossTerm
class KLGaussianAddedLossTerm(AddedLossTerm):
def __init__(self, q_x, p_x, n, data_dim):
super().__init__()
self.q_x = q_x
self.p_x = p_x
self.n = n
self.data_dim = data_dim
def ... | true | true |
08f5da4a7fee584ef33993b7295c91c24c759243 | 21,696 | py | Python | ulmo/usgs/nwis/hdf5.py | NasserMo/ulmo | 46c835100bb76f44f46c752f8cadb3cbe84652b1 | [
"BSD-3-Clause"
] | null | null | null | ulmo/usgs/nwis/hdf5.py | NasserMo/ulmo | 46c835100bb76f44f46c752f8cadb3cbe84652b1 | [
"BSD-3-Clause"
] | null | null | null | ulmo/usgs/nwis/hdf5.py | NasserMo/ulmo | 46c835100bb76f44f46c752f8cadb3cbe84652b1 | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import copy
import os
import shutil
import sys
import tempfile
import warnings
import numpy as np
import pandas
import tables
from tables.scripts import ptrepack
from ulmo import util
from ulmo.usgs.nwis import core
# default hdf5 file path
DEFAULT_HDF5_FILE_PATH = util.get_default_h5file_path('us... | 37.797909 | 91 | 0.655098 | import contextlib
import copy
import os
import shutil
import sys
import tempfile
import warnings
import numpy as np
import pandas
import tables
from tables.scripts import ptrepack
from ulmo import util
from ulmo.usgs.nwis import core
DEFAULT_HDF5_FILE_PATH = util.get_default_h5file_path('usgs/')
SITES_MIN_ITEMSIZE... | true | true |
08f5daa52a366cb5316fdafb3290bce0efd5e55f | 8,311 | py | Python | examples/microjson/mutants/CRP_Str_mutant_1486201406.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 90 | 2015-04-07T10:26:53.000Z | 2022-03-07T15:14:57.000Z | examples/microjson/mutants/CRP_Str_mutant_1486201406.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 14 | 2015-10-13T16:25:59.000Z | 2021-01-21T18:31:03.000Z | examples/microjson/mutants/CRP_Str_mutant_1486201406.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 32 | 2015-04-07T10:41:29.000Z | 2022-02-26T05:17:28.000Z | import math
import StringIO
import types
__pychecker__ = 'no-returnvalues'
WS = set([' ', '\t', '\r', '\n', '\x08', '\x0c'])
DIGITS = set([str(i) for i in range(0, 10)])
NUMSTART = DIGITS.union(['.', '-', '+'])
NUMCHARS = NUMSTART.union(['e', ''])
ESC_MAP = {'n': '\n', 't': '\t', 'r': '\r', 'b': '\x08', 'f': '\x0c'}
RE... | 27.889262 | 178 | 0.526411 | import math
import StringIO
import types
__pychecker__ = 'no-returnvalues'
WS = set([' ', '\t', '\r', '\n', '\x08', '\x0c'])
DIGITS = set([str(i) for i in range(0, 10)])
NUMSTART = DIGITS.union(['.', '-', '+'])
NUMCHARS = NUMSTART.union(['e', ''])
ESC_MAP = {'n': '\n', 't': '\t', 'r': '\r', 'b': '\x08', 'f': '\x0c'}
RE... | true | true |
08f5db11a0ce636cfc75a2bbf9a87ab11d43f6ef | 5,232 | py | Python | tests/unit/loop/test_ReaderComposite.py | benkrikler/alphatwirl | cda7d12fec21291ea33af23234fc08be19430934 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/loop/test_ReaderComposite.py | benkrikler/alphatwirl | cda7d12fec21291ea33af23234fc08be19430934 | [
"BSD-3-Clause"
] | 7 | 2018-02-26T10:32:26.000Z | 2018-03-19T12:27:12.000Z | tests/unit/loop/test_ReaderComposite.py | benkrikler/alphatwirl | cda7d12fec21291ea33af23234fc08be19430934 | [
"BSD-3-Clause"
] | null | null | null | from alphatwirl.loop import ReaderComposite
import unittest
##__________________________________________________________________||
class MockReader(object):
def __init__(self):
self._beganWith = None
self._events = [ ]
self._ended = False
def begin(self, event):
self._beganWit... | 27.97861 | 70 | 0.624235 | from alphatwirl.loop import ReaderComposite
import unittest
class MockReader(object):
def __init__(self):
self._beganWith = None
self._events = [ ]
self._ended = False
def begin(self, event):
self._beganWith = event
def event(self, event):
self._events.append(even... | true | true |
08f5db599311e4cb1b2aa9820ce547ce8980b3d4 | 7,229 | py | Python | yoapi/forms.py | YoApp/yo-api | a162e51804ab91724cc7ad3e7608410329da6789 | [
"MIT"
] | 1 | 2021-12-17T03:25:34.000Z | 2021-12-17T03:25:34.000Z | yoapi/forms.py | YoApp/yo-api | a162e51804ab91724cc7ad3e7608410329da6789 | [
"MIT"
] | null | null | null | yoapi/forms.py | YoApp/yo-api | a162e51804ab91724cc7ad3e7608410329da6789 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Forms related module"""
import re
import wtforms_json
from flask_wtf import Form as FlaskForm
from flask_mongoengine.wtf import model_form
from flask_mongoengine.wtf.orm import ModelConverter, converts
from flask_mongoengine.wtf.fields import NoneStringField
from wtforms.fields import Stri... | 34.42381 | 78 | 0.643104 |
import re
import wtforms_json
from flask_wtf import Form as FlaskForm
from flask_mongoengine.wtf import model_form
from flask_mongoengine.wtf.orm import ModelConverter, converts
from flask_mongoengine.wtf.fields import NoneStringField
from wtforms.fields import StringField, FieldList, FormField, SelectField
from wtf... | true | true |
08f5db8bc7b7f21b28da82dc680fb8c4ac20c18b | 1,988 | py | Python | gamertags.py | ValentiMS/py360 | c291b37773fbf5e4b459429fa95662533774183c | [
"BSD-2-Clause"
] | 11 | 2015-01-30T23:44:19.000Z | 2021-08-18T19:38:42.000Z | gamertags.py | ValentiMS/py360 | c291b37773fbf5e4b459429fa95662533774183c | [
"BSD-2-Clause"
] | 4 | 2019-02-24T05:44:03.000Z | 2019-11-24T19:17:47.000Z | gamertags.py | ValentiMS/py360 | c291b37773fbf5e4b459429fa95662533774183c | [
"BSD-2-Clause"
] | 5 | 2018-08-02T19:41:55.000Z | 2021-04-02T11:10:06.000Z | # An example of using py360 to extract all the GamerTags present on an image.
# Where does this data live?
# GamerTags are inside the Account block of a user's STFS container located on
# the XTAF partition.
# How do you find user STFS containers?
# Gamer profiles are located in the /Content directory in subdirector... | 44.177778 | 87 | 0.680584 |
# the XTAF partition.
# How do you find user STFS containers?
# Gamer profiles are located in the /Content directory in subdirectories named
# with 16 hex characters starting with an 'E' such as E00012DD5A4FAEE5
# The STFS container is located in the FFFE07D1/00010000 subdirectory and is named the
# same as the pro... | false | true |
08f5db96c83e558a2c2b0e2e3b7ce0fa63976d26 | 4,967 | py | Python | Mag2021-main-code/Proactive caching/FCNN/FCNN.py | wjj19950101/Magrank_v1 | 73ab296f4269ccc9a943b22088c8ca3e1c88af5e | [
"MIT"
] | null | null | null | Mag2021-main-code/Proactive caching/FCNN/FCNN.py | wjj19950101/Magrank_v1 | 73ab296f4269ccc9a943b22088c8ca3e1c88af5e | [
"MIT"
] | null | null | null | Mag2021-main-code/Proactive caching/FCNN/FCNN.py | wjj19950101/Magrank_v1 | 73ab296f4269ccc9a943b22088c8ca3e1c88af5e | [
"MIT"
] | null | null | null | # #################################################################
# Codes have been tested successfully on Python 3.6.0 with TensorFlow 1.14.0.
# #################################################################
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.c... | 46.420561 | 132 | 0.575599 | import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.contrib import layers
import random
def xavier_init(fan_in, fan_out, constant=1):
low = -constant * np.sqrt(6 / (fan_in + fan_out))
high = constant * np.sqrt(6 / (fan_in + fan_out))
return tf.random_u... | true | true |
08f5dc50ecf2e9aa7027115a1bd74fa06b2c35e1 | 425 | py | Python | main.py | iliadmitriev/auth-api | efa885b0054a3b3c6394d692a9655614652da147 | [
"MIT"
] | 3 | 2021-12-26T00:24:22.000Z | 2022-03-24T05:05:34.000Z | main.py | iliadmitriev/auth-api | efa885b0054a3b3c6394d692a9655614652da147 | [
"MIT"
] | 113 | 2021-08-19T11:57:49.000Z | 2022-03-31T17:24:49.000Z | main.py | iliadmitriev/auth-api | efa885b0054a3b3c6394d692a9655614652da147 | [
"MIT"
] | 1 | 2021-11-16T16:00:51.000Z | 2021-11-16T16:00:51.000Z | import logging
import sys
from aiohttp import web
from app import init_app
from app.settings import access_log_format, APP_HOST, APP_PORT
def main(argv):
logging.basicConfig(level=logging.INFO)
app = init_app(argv)
web.run_app(
app,
access_log_format=access_log_format,
host=APP_H... | 18.478261 | 62 | 0.684706 | import logging
import sys
from aiohttp import web
from app import init_app
from app.settings import access_log_format, APP_HOST, APP_PORT
def main(argv):
logging.basicConfig(level=logging.INFO)
app = init_app(argv)
web.run_app(
app,
access_log_format=access_log_format,
host=APP_H... | true | true |
08f5dd28b50465935fddb950094c87cea9a3b1d8 | 393,513 | py | Python | test/augmenters/test_geometric.py | MinhTran0311/imgaug_Minh | 0266ef52d61a3a892009ae5718fd5d41d8156d6a | [
"MIT"
] | 12,895 | 2016-11-26T05:59:21.000Z | 2022-03-31T07:03:40.000Z | test/augmenters/test_geometric.py | MinhTran0311/imgaug_Minh | 0266ef52d61a3a892009ae5718fd5d41d8156d6a | [
"MIT"
] | 783 | 2016-11-24T12:54:26.000Z | 2022-03-25T11:27:10.000Z | test/augmenters/test_geometric.py | MinhTran0311/imgaug_Minh | 0266ef52d61a3a892009ae5718fd5d41d8156d6a | [
"MIT"
] | 2,504 | 2016-12-10T09:55:43.000Z | 2022-03-31T14:29:34.000Z | from __future__ import print_function, division, absolute_import
import itertools
import warnings
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
# unittest.mock is not available in 2.7 (though unit... | 38.628939 | 82 | 0.558818 | from __future__ import print_function, division, absolute_import
import itertools
import warnings
import sys
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
try:
import unittest.mock as mock
except ImportError:
import mock
import numpy as np
im... | true | true |
08f5ddc5b4f60e5b8e5a998fe7921c56588b6ee1 | 21,381 | py | Python | sparrow_cloud/apps/permission_command/generators_django_1.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | 15 | 2019-09-24T09:32:32.000Z | 2021-12-30T08:07:41.000Z | sparrow_cloud/apps/permission_command/generators_django_1.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | 13 | 2019-09-06T03:20:02.000Z | 2021-09-27T03:37:25.000Z | sparrow_cloud/apps/permission_command/generators_django_1.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | 17 | 2019-09-02T06:31:05.000Z | 2021-10-08T04:23:23.000Z | import re
from collections import defaultdict
from importlib import import_module
from django.conf import settings
from django.contrib.admindocs.views import simplify_regex
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.utils import six
from django.utils.encoding import force_text, s... | 36.548718 | 133 | 0.543286 | import re
from collections import defaultdict
from importlib import import_module
from django.conf import settings
from django.contrib.admindocs.views import simplify_regex
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.utils import six
from django.utils.encoding import force_text, s... | true | true |
08f5ded915b5a0e1c26d409bee6003de1304d266 | 4,476 | py | Python | notebooks/visualise_predictions.py | raspstephan/nwp-downscale | dbb6d560126a8d13a2748bc088f382e68fa7c0b3 | [
"MIT"
] | 7 | 2020-12-14T02:57:39.000Z | 2022-03-29T08:32:36.000Z | notebooks/visualise_predictions.py | raspstephan/nwp-downscale | dbb6d560126a8d13a2748bc088f382e68fa7c0b3 | [
"MIT"
] | 39 | 2020-12-03T11:39:11.000Z | 2021-09-28T09:57:33.000Z | notebooks/visualise_predictions.py | raspstephan/nwp-downscale | dbb6d560126a8d13a2748bc088f382e68fa7c0b3 | [
"MIT"
] | 1 | 2021-09-21T23:57:36.000Z | 2021-09-21T23:57:36.000Z | import torch
from torch.nn import functional as F
from torch import nn
from pytorch_lightning.core.lightning import LightningModule
import pytorch_lightning as pl
from pytorch_lightning import loggers as pl_loggers
import torch.optim as optim
import torchvision
import torchvision.datasets as datasets
import torchvisio... | 33.909091 | 116 | 0.639187 | import torch
from torch.nn import functional as F
from torch import nn
from pytorch_lightning.core.lightning import LightningModule
import pytorch_lightning as pl
from pytorch_lightning import loggers as pl_loggers
import torch.optim as optim
import torchvision
import torchvision.datasets as datasets
import torchvisio... | true | true |
08f5df2d0494c8c62ec11af41677ea5784c8bb73 | 6,702 | py | Python | kubernetes/client/models/v1_limit_range_list.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | 1 | 2018-10-20T19:37:57.000Z | 2018-10-20T19:37:57.000Z | kubernetes/client/models/v1_limit_range_list.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_limit_range_list.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | 2 | 2018-07-27T19:39:34.000Z | 2020-12-25T02:48:27.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.613208 | 281 | 0.611161 |
from pprint import pformat
from six import iteritems
import re
class V1LimitRangeList(object):
swagger_types = {
'api_version': 'str',
'items': 'list[V1LimitRange]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'api_version': 'apiVersion',
... | true | true |
08f5dfb0c571c39b5506558c95cd426a7364e57b | 33,853 | py | Python | algofi_amm/v0/pool.py | JGomezST/algofi-amm-py-sdk | 1746bf0d87fbb55682f06b30e4b1bfa7cdae994e | [
"MIT"
] | null | null | null | algofi_amm/v0/pool.py | JGomezST/algofi-amm-py-sdk | 1746bf0d87fbb55682f06b30e4b1bfa7cdae994e | [
"MIT"
] | null | null | null | algofi_amm/v0/pool.py | JGomezST/algofi-amm-py-sdk | 1746bf0d87fbb55682f06b30e4b1bfa7cdae994e | [
"MIT"
] | null | null | null |
import time
import math
from algosdk.logic import get_application_address
from algosdk.future.transaction import LogicSigAccount, LogicSigTransaction, OnComplete, StateSchema, ApplicationCreateTxn, \
ApplicationOptInTxn, ApplicationNoOpTxn, OnComplete
from .config import PoolStatus, Network, get_validator_index, g... | 48.086648 | 167 | 0.665849 |
import time
import math
from algosdk.logic import get_application_address
from algosdk.future.transaction import LogicSigAccount, LogicSigTransaction, OnComplete, StateSchema, ApplicationCreateTxn, \
ApplicationOptInTxn, ApplicationNoOpTxn, OnComplete
from .config import PoolStatus, Network, get_validator_index, g... | true | true |
08f5e0e997cf862d1314372b32ef98eb9c8bed1e | 7,734 | py | Python | main.py | nessessence/ReID_Transitve_Label | e6bb8b51ddc628ebfa2d20d46e39ba224063a3da | [
"MIT"
] | null | null | null | main.py | nessessence/ReID_Transitve_Label | e6bb8b51ddc628ebfa2d20d46e39ba224063a3da | [
"MIT"
] | null | null | null | main.py | nessessence/ReID_Transitve_Label | e6bb8b51ddc628ebfa2d20d46e39ba224063a3da | [
"MIT"
] | null | null | null | import torch
from modeling import build_model
from dataset import ImageDataset
from torch.utils.data import DataLoader
from distance import Mahalanobis_distance
from uploader import upload_multiple_files,upload_to_db
def dataloader_collate_fn(batch):
imgs, img_paths = zip(*batch)
return torch.stack(imgs, dim=... | 45.22807 | 128 | 0.667442 | import torch
from modeling import build_model
from dataset import ImageDataset
from torch.utils.data import DataLoader
from distance import Mahalanobis_distance
from uploader import upload_multiple_files,upload_to_db
def dataloader_collate_fn(batch):
imgs, img_paths = zip(*batch)
return torch.stack(imgs, dim=... | true | true |
08f5e1125e4daa3041ecf7b488c5405be8f2c7e1 | 13,599 | py | Python | scripts/rq4.py | StefanosChaliasos/types-bug-study-artifact | eafcb89bf2b383b3fb110177ad404568c9ee0420 | [
"MIT"
] | 4 | 2021-07-09T08:13:37.000Z | 2022-01-03T16:28:11.000Z | scripts/rq4.py | StefanosChaliasos/types-bug-study-artifact | eafcb89bf2b383b3fb110177ad404568c9ee0420 | [
"MIT"
] | null | null | null | scripts/rq4.py | StefanosChaliasos/types-bug-study-artifact | eafcb89bf2b383b3fb110177ad404568c9ee0420 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import argparse
import json
import statistics
import os
from collections import defaultdict
import matplotlib.pylab as plt
import matplotlib.offsetbox as offsetbox
import seaborn as sns
import pandas as pd
def get_args():
parser = argparse.ArgumentParser(
description='Generate fi... | 35.881266 | 97 | 0.577837 | import argparse
import json
import statistics
import os
from collections import defaultdict
import matplotlib.pylab as plt
import matplotlib.offsetbox as offsetbox
import seaborn as sns
import pandas as pd
def get_args():
parser = argparse.ArgumentParser(
description='Generate figures and tables of RQ4 ... | true | true |
08f5e19fc51b6725a37cc7e53e082a7709af3be5 | 11,817 | py | Python | EP0/autograder.py | ricardokojo/MAC0425-2019 | 89b67b61817500aad359c64c7f43fcc2f1ef0698 | [
"MIT"
] | 1 | 2021-03-12T23:27:06.000Z | 2021-03-12T23:27:06.000Z | EP0/autograder.py | ricardokojo/MAC0425-2019 | 89b67b61817500aad359c64c7f43fcc2f1ef0698 | [
"MIT"
] | null | null | null | EP0/autograder.py | ricardokojo/MAC0425-2019 | 89b67b61817500aad359c64c7f43fcc2f1ef0698 | [
"MIT"
] | 1 | 2020-04-12T21:37:20.000Z | 2020-04-12T21:37:20.000Z | import os
import random
import math
from ep0 import *
TOLERANCE = 0.0001
def run_tests():
total_global = 0
total_tests_global = 16
total_tests = 5
test_results = 0
print('######################################################')
print('# Starting tests: (Part01-01) words #')
... | 42.203571 | 140 | 0.44089 | import os
import random
import math
from ep0 import *
TOLERANCE = 0.0001
def run_tests():
total_global = 0
total_tests_global = 16
total_tests = 5
test_results = 0
print('######################################################')
print('# Starting tests: (Part01-01) words #')
... | true | true |
08f5e3a31867b3156f8cb353fb674d01796a58a1 | 24,304 | py | Python | src/xrd/core/p2p/p2pfactory.py | jack3343/xrd-core | 48a6d890d62485c627060b017eadf85602268caf | [
"MIT"
] | null | null | null | src/xrd/core/p2p/p2pfactory.py | jack3343/xrd-core | 48a6d890d62485c627060b017eadf85602268caf | [
"MIT"
] | null | null | null | src/xrd/core/p2p/p2pfactory.py | jack3343/xrd-core | 48a6d890d62485c627060b017eadf85602268caf | [
"MIT"
] | null | null | null | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import random
from pyxrdlib.pyxrdlib import bin2hstr
from pyqryptonight.pyqryptonight import UInt256ToString
from twisted.internet import reactor
from twisted.internet... | 41.054054 | 125 | 0.614302 | import random
from pyxrdlib.pyxrdlib import bin2hstr
from pyqryptonight.pyqryptonight import UInt256ToString
from twisted.internet import reactor
from twisted.internet.protocol import ServerFactory
from xrd.core import config
from xrd.core.Block import Block
from xrd.core.ChainManager import ChainManager
from xrd.cor... | true | true |
08f5e3a3baaf8baf785e80756d1db3c090285d3e | 5,755 | py | Python | python/ec2_require_ebs_snapshots_for_volumes.py | zsolt-halo/aws-config-rules | 1b23b202d8fcb7d5303e8d18ff43cd5b0d0a916b | [
"CC0-1.0"
] | 1 | 2021-03-15T01:47:41.000Z | 2021-03-15T01:47:41.000Z | python/ec2_require_ebs_snapshots_for_volumes.py | zsolt-halo/aws-config-rules | 1b23b202d8fcb7d5303e8d18ff43cd5b0d0a916b | [
"CC0-1.0"
] | null | null | null | python/ec2_require_ebs_snapshots_for_volumes.py | zsolt-halo/aws-config-rules | 1b23b202d8fcb7d5303e8d18ff43cd5b0d0a916b | [
"CC0-1.0"
] | 1 | 2018-10-04T22:43:21.000Z | 2018-10-04T22:43:21.000Z | #
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure all EC2 Volumes have a recent EC2 Snapshot
#
# Trigger Type: Periodic and Change Triggered
# Scope: Volumes
# Required Parameters: requiredSnapshotFrequencyHours
# Example Value: 10
import boto... | 38.112583 | 195 | 0.683579 |
import boto3, botocore
import json
import logging
from datetime import tzinfo, datetime, timedelta
logger = logging.getLogger()
logger.setLevel(logging.INFO)
ZERO = timedelta(0)
class UTC(tzinfo):
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
... | false | true |
08f5e4436424ddb9e99e82e7719754fa18f71288 | 7,191 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/network/aci/aci_tenant_span_src_group_to_dst_group.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/network/aci/aci_tenant_span_src_group_to_dst_group.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/network/aci/aci_tenant_span_src_group_to_dst_group.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 29.592593 | 146 | 0.611042 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: aci_tenant_span_src_group_to_dst_group
short_description: ... | true | true |
08f5e4723a1832f2ed0ccc893002e811993e7c54 | 19,157 | py | Python | packages/gtmcore/gtmcore/files/tests/test_labbook_fileops.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/files/tests/test_labbook_fileops.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/files/tests/test_labbook_fileops.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 FlashX, LLC
#
# 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, distrib... | 47.068796 | 112 | 0.648327 |
import pytest
import tempfile
import os
import pprint
from gtmcore.labbook import LabBook
from gtmcore.files import FileOperations as FO
from gtmcore.fixtures import mock_config_file, mock_labbook, remote_labbook_repo, sample_src_file
class TestLabbookFileOperations(object):
def test_insert_file_success_1(self,... | true | true |
08f5e4f653060c45c10543d025b77c79788cafcc | 1,341 | py | Python | p108.py | arpit0891/Project-euler | ab36b33c578578595bb518508fa2fe5862f4a044 | [
"MIT"
] | 1 | 2020-05-14T09:22:32.000Z | 2020-05-14T09:22:32.000Z | p108.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 1 | 2020-03-13T12:42:28.000Z | 2020-05-13T13:26:32.000Z | p108.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 3 | 2020-05-13T13:39:46.000Z | 2020-06-26T10:44:53.000Z |
import eulerlib, itertools
# Rewrite the equation with x = n+i, y = n+j, and manipulate it:
# 1/n = 1/x + 1/y
# = 1/(n+i) + 1/(n+j)
# = (2n+i+j) / ((n+i)(n+j)).
# n(2n+i+j) = (n+i)(n+j).
# 2n^2 + ni + nj = n^2 + ni + nj + ij.
# n^2 = ij.
# Hence i and j are divisors of n^2. To ensure unique solut... | 28.531915 | 116 | 0.593587 |
import eulerlib, itertools
def compute():
for n in itertools.count(1):
if (count_divisors_squared(n) + 1) // 2 > 1000:
return str(n)
def count_divisors_squared(n):
count = 1
end = eulerlib.sqrt(n)
for i in itertools.count(2):
if i > end:
break
if n % i == 0:
j = 0
while True:
n //= i
... | true | true |
08f5e5a599376366aa0e2b7621381e1f2b67608b | 3,348 | py | Python | kamodo/rpc/test_kamodo_ssl_async_server.py | dfm/kamodo-core | aa7f678f0123ddffa2d0450361e9789728e9d7b8 | [
"NASA-1.3"
] | 3 | 2021-11-08T21:13:43.000Z | 2022-01-13T15:09:26.000Z | kamodo/rpc/test_kamodo_ssl_async_server.py | dfm/kamodo-core | aa7f678f0123ddffa2d0450361e9789728e9d7b8 | [
"NASA-1.3"
] | 60 | 2021-09-28T17:53:32.000Z | 2022-03-31T18:39:21.000Z | kamodo/rpc/test_kamodo_ssl_async_server.py | dfm/kamodo-core | aa7f678f0123ddffa2d0450361e9789728e9d7b8 | [
"NASA-1.3"
] | 4 | 2022-01-07T19:39:47.000Z | 2022-02-02T20:35:29.000Z | import argparse
import asyncio
import ssl
import os
import socket
from kamodo import KamodoRPC, FunctionRPC
import capnp
this_dir = os.path.dirname(os.path.abspath(__file__))
class Server:
async def myreader(self):
while self.retry:
try:
# Must be a wait_for so we don't bloc... | 29.368421 | 83 | 0.603345 | import argparse
import asyncio
import ssl
import os
import socket
from kamodo import KamodoRPC, FunctionRPC
import capnp
this_dir = os.path.dirname(os.path.abspath(__file__))
class Server:
async def myreader(self):
while self.retry:
try:
data = await asyncio.... | true | true |
08f5e641ff630d337698d29021aa25396f804281 | 4,315 | py | Python | dpipe/layers/conv.py | samokhinv/deep_pipe | 9461b02f5f32c3e9f24490619ebccf417979cffc | [
"MIT"
] | 38 | 2017-09-08T04:51:17.000Z | 2022-03-29T17:34:22.000Z | dpipe/layers/conv.py | samokhinv/deep_pipe | 9461b02f5f32c3e9f24490619ebccf417979cffc | [
"MIT"
] | 41 | 2017-09-29T22:06:21.000Z | 2021-12-03T09:31:57.000Z | dpipe/layers/conv.py | samokhinv/deep_pipe | 9461b02f5f32c3e9f24490619ebccf417979cffc | [
"MIT"
] | 12 | 2017-09-08T04:40:39.000Z | 2021-01-19T19:19:37.000Z | from functools import partial
import torch.nn as nn
from .structure import PreActivation, PostActivation
class PreActivationND(PreActivation):
"""
Performs a sequence of batch_norm, activation, and convolution
in -> (BN -> activation -> Conv) -> out
Parameters
----------
in_channels: i... | 45.421053 | 113 | 0.704983 | from functools import partial
import torch.nn as nn
from .structure import PreActivation, PostActivation
class PreActivationND(PreActivation):
def __init__(self, in_channels, out_channels, *, kernel_size, stride=1, padding=0, bias=True,
dilation=1, groups=1, batch_norm_module=None, activation_... | true | true |
08f5e6fb38b06c5a9fc9f23f608eae66b874e3ea | 17,183 | py | Python | social_welfare_experiment/utils.py | rik-helwegen/FairTrade | 649506d9e46b9fd7faaa08dc44b01229ffa4d066 | [
"MIT"
] | 6 | 2020-09-06T08:14:56.000Z | 2022-02-25T09:17:39.000Z | social_welfare_experiment/utils.py | rik-helwegen/FairTrade | 649506d9e46b9fd7faaa08dc44b01229ffa4d066 | [
"MIT"
] | null | null | null | social_welfare_experiment/utils.py | rik-helwegen/FairTrade | 649506d9e46b9fd7faaa08dc44b01229ffa4d066 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
from sklearn.manifold import TSNE
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import bernoulli, normal
from torch.distributions import OneHotCa... | 42.218673 | 131 | 0.613281 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
from sklearn.manifold import TSNE
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import bernoulli, normal
from torch.distributions import OneHotCa... | true | true |
08f5e6fb6e0853d62ee864153dadfeec5b0b26e4 | 1,313 | py | Python | wagtail/wagtailredirects/wagtail_hooks.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | 3 | 2016-08-17T13:56:36.000Z | 2019-04-23T19:59:25.000Z | wagtail/wagtailredirects/wagtail_hooks.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | 11 | 2016-08-05T15:43:06.000Z | 2016-12-16T13:32:23.000Z | wagtail/wagtailredirects/wagtail_hooks.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | 2 | 2017-08-08T01:39:02.000Z | 2018-05-06T06:16:10.000Z | from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from django.contrib.auth.models import Permission
from django.core import urlresolvers
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailadmin.menu import MenuItem
from wagtail.wagtailcore impo... | 33.666667 | 114 | 0.756283 | from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from django.contrib.auth.models import Permission
from django.core import urlresolvers
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailadmin.menu import MenuItem
from wagtail.wagtailcore impo... | true | true |
08f5e73e064a384e1f177030f96ed887c6f4cd3c | 3,073 | py | Python | tests/unit/states/test_debconfmod.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | tests/unit/states/test_debconfmod.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 1 | 2015-02-23T19:37:47.000Z | 2015-02-23T19:37:47.000Z | tests/unit/states/test_debconfmod.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import skipIf, TestCase... | 35.732558 | 80 | 0.570778 | from __future__ import absolute_import, print_function, unicode_literals
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import skipIf, TestCase
from tests.support.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
import salt.states.debconfmod as debconfmod
@ski... | true | true |
08f5e8c401af3976025e8fbd74c225904680de33 | 31,363 | py | Python | novaclient/shell.py | larrycameron80/python-novaclient | b76d378f1665e7bdf2f93fdc3e9cf1fdb4d471ed | [
"Apache-1.1"
] | null | null | null | novaclient/shell.py | larrycameron80/python-novaclient | b76d378f1665e7bdf2f93fdc3e9cf1fdb4d471ed | [
"Apache-1.1"
] | null | null | null | novaclient/shell.py | larrycameron80/python-novaclient | b76d378f1665e7bdf2f93fdc3e9cf1fdb4d471ed | [
"Apache-1.1"
] | null | null | null | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# 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/lice... | 38.482209 | 78 | 0.594299 |
from __future__ import print_function
import argparse
import getpass
import glob
import imp
import itertools
import logging
import os
import pkgutil
import sys
import pkg_resources
import six
HAS_KEYRING = False
all_errors = ValueError
try:
import keyring
HAS_KEYRING = True
except ImportError:
pass
imp... | true | true |
08f5e8eddb2534a88e1f2bfc87ce7e2dc6bf102d | 6,306 | py | Python | wirelessMain.py | zhaomh1998/TubularRobotics | 226e8711061a3fc53bfaee12b02a12e78388c036 | [
"MIT"
] | 1 | 2021-06-19T16:11:06.000Z | 2021-06-19T16:11:06.000Z | wirelessMain.py | zhaomh1998/TubularRobotics | 226e8711061a3fc53bfaee12b02a12e78388c036 | [
"MIT"
] | null | null | null | wirelessMain.py | zhaomh1998/TubularRobotics | 226e8711061a3fc53bfaee12b02a12e78388c036 | [
"MIT"
] | null | null | null | import WirelessTool, socket, traceback, colorama, time
import numpy as np
colorama.init()
TCPServer = WirelessTool.TCPEchoServer(3000,0.1)
Ultrasonic = WirelessTool.TCPClient('127.0.0.1',3001,0.1)
Encoder = WirelessTool.TCPClient('127.0.0.1',3002,0.1)
MainController = WirelessTool.TCPClient('127.0.0.1',3003,3)
while(n... | 40.948052 | 173 | 0.549952 | import WirelessTool, socket, traceback, colorama, time
import numpy as np
colorama.init()
TCPServer = WirelessTool.TCPEchoServer(3000,0.1)
Ultrasonic = WirelessTool.TCPClient('127.0.0.1',3001,0.1)
Encoder = WirelessTool.TCPClient('127.0.0.1',3002,0.1)
MainController = WirelessTool.TCPClient('127.0.0.1',3003,3)
while(n... | true | true |
08f5e97f94012ff08258178f58f35f94bc45abf2 | 1,056 | py | Python | pkg/cortex/client/cortex/util.py | HaoXiangQI/cortex | 394f369260072609e42833b180c01a0545be6de7 | [
"Apache-2.0"
] | 1 | 2022-02-23T08:45:19.000Z | 2022-02-23T08:45:19.000Z | pkg/workloads/cortex/client/cortex/util.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | null | null | null | pkg/workloads/cortex/client/cortex/util.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | 1 | 2021-05-25T03:49:14.000Z | 2021-05-25T03:49:14.000Z | # Copyright 2020 Cortex Labs, 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 wri... | 25.756098 | 74 | 0.723485 |
from contextlib import contextmanager
import os
from pathlib import Path
import shutil
@contextmanager
def open_temporarily(path, mode):
Path(path).parent.mkdir(parents=True, exist_ok=True)
file = open(path, mode)
try:
yield file
finally:
file.close()
os.remove(path)
@conte... | true | true |
08f5e9cb9cbe2d93c54eef14edcc3d23e1a62dea | 69 | py | Python | platform/arch/csky/cskyv2-l/ucube.py | jinlongliu/AliOS-Things | ce051172a775f987183e7aca88bb6f3b809ea7b0 | [
"Apache-2.0"
] | 54 | 2018-10-10T01:43:10.000Z | 2022-02-26T01:36:40.000Z | platform/arch/csky/cskyv2-l/ucube.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 4 | 2019-04-28T04:07:47.000Z | 2021-07-05T13:30:01.000Z | platform/arch/csky/cskyv2-l/ucube.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 48 | 2018-08-14T07:12:33.000Z | 2022-03-01T03:52:32.000Z | src = Split('''
''')
component = aos_component('cskyv2-l', src)
| 13.8 | 42 | 0.57971 | src = Split('''
''')
component = aos_component('cskyv2-l', src)
| true | true |
08f5ea9a14aa65b3a3e32b698bcbb09536f8883d | 2,763 | py | Python | tests/test_registrar.py | jbwang1997/BoxBox | 827d4af74a645da832282a2faa65a59240b82240 | [
"Apache-2.0"
] | 1 | 2021-08-14T07:19:26.000Z | 2021-08-14T07:19:26.000Z | tests/test_registrar.py | jbwang1997/BoxBox | 827d4af74a645da832282a2faa65a59240b82240 | [
"Apache-2.0"
] | null | null | null | tests/test_registrar.py | jbwang1997/BoxBox | 827d4af74a645da832282a2faa65a59240b82240 | [
"Apache-2.0"
] | null | null | null | from boxbox.utils import Registrar
def BaseName1_a1_b1():
pass
def BaseName1_a2_b1():
pass
def BaseName1_a1_b2():
pass
def BaseName1_a2_b2():
pass
def BaseName1_a3_b2():
pass
def BaseName1_a3():
pass
def test_empty_options():
test = Registrar('test')
print('name: ', test.name)
... | 29.393617 | 78 | 0.675715 | from boxbox.utils import Registrar
def BaseName1_a1_b1():
pass
def BaseName1_a2_b1():
pass
def BaseName1_a1_b2():
pass
def BaseName1_a2_b2():
pass
def BaseName1_a3_b2():
pass
def BaseName1_a3():
pass
def test_empty_options():
test = Registrar('test')
print('name: ', test.name)
... | true | true |
08f5eae2b0684e27e46297e583dd16fc78fc63c1 | 1,238 | py | Python | pydifact/__init__.py | qwyk/pydifact | ccb8907e443764c3ae981b4642ef1db3b0c81c7f | [
"MIT"
] | null | null | null | pydifact/__init__.py | qwyk/pydifact | ccb8907e443764c3ae981b4642ef1db3b0c81c7f | [
"MIT"
] | null | null | null | pydifact/__init__.py | qwyk/pydifact | ccb8907e443764c3ae981b4642ef1db3b0c81c7f | [
"MIT"
] | null | null | null | # Pydifact - a python edifact library
#
# Copyright (c) 2019 Christian González
#
# 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 ... | 47.615385 | 81 | 0.777868 |
from pydifact import message, parser, segments, serializer, token, tokenizer
__version__ = "0.0.3"
| true | true |
08f5ec238abddb1727933cc94390fe6e80334486 | 2,806 | py | Python | Python/brace-expansion-ii.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/brace-expansion-ii.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/brace-expansion-ii.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | # Time: O(p*l * log(p*l)), p is the production of all number of options
# , l is the length of a word
# Space: O(p*l)
import itertools
class Solution(object):
def braceExpansionII(self, expression):
"""
:type expression: str
:rtype: List[str]
"""
d... | 31.177778 | 72 | 0.431575 |
import itertools
class Solution(object):
def braceExpansionII(self, expression):
def form_words(options):
words = map("".join, itertools.product(*options))
words.sort()
return words
def generate_option(expr, i):
option_set = set()
while... | true | true |
08f5ee05d17948afab4c2a1370df59890702365c | 4,200 | py | Python | objects/control.py | alessandrobalata/pyrlmc | 493d1ad5378823a9bbb032077bea2838db76602c | [
"MIT"
] | null | null | null | objects/control.py | alessandrobalata/pyrlmc | 493d1ad5378823a9bbb032077bea2838db76602c | [
"MIT"
] | null | null | null | objects/control.py | alessandrobalata/pyrlmc | 493d1ad5378823a9bbb032077bea2838db76602c | [
"MIT"
] | null | null | null | from objects.cont_value import ContValue
from objects.controlled_process import ControlledProcess
import numpy as np
import matplotlib.pyplot as plt
from problems.problem import Problem
class Control:
'''
Control object to be used both backward and forward
'''
def __init__(self, problem: Problem):
... | 36.521739 | 120 | 0.601429 | from objects.cont_value import ContValue
from objects.controlled_process import ControlledProcess
import numpy as np
import matplotlib.pyplot as plt
from problems.problem import Problem
class Control:
def __init__(self, problem: Problem):
self.values = np.zeros((problem.N + 1, problem.M)) * np.nan
... | true | true |
08f5ee9c17dbeff1ca9d3eade3441fae65ffd5d0 | 5,051 | py | Python | tensorflow_addons/losses/focal_loss.py | joel-shor/addons | 27bbb3dd6bb8394a3793ef7a123ed730951f41e4 | [
"Apache-2.0"
] | 1 | 2020-11-06T18:57:03.000Z | 2020-11-06T18:57:03.000Z | tensorflow_addons/losses/focal_loss.py | michaelreneer/addons | b59f0e89ca09837808331be1eee8ae8df8eb9355 | [
"Apache-2.0"
] | 1 | 2020-07-08T13:38:45.000Z | 2020-07-08T13:52:04.000Z | tensorflow_addons/losses/focal_loss.py | michaelreneer/addons | b59f0e89ca09837808331be1eee8ae8df8eb9355 | [
"Apache-2.0"
] | 4 | 2020-06-03T07:09:59.000Z | 2020-12-18T14:51:56.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.450331 | 82 | 0.643833 |
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow_addons.utils.types import FloatTensorLike, TensorLike
from typeguard import typechecked
@tf.keras.utils.register_keras_serializable(package="Addons")
class SigmoidFocalCrossEntropy(tf.keras.losses.Loss):
@typechecked
def __init__(... | true | true |
08f5ef2cb825347cfae0cdbaa24cd9488ced18e0 | 215 | py | Python | basic/test.py | shanoob/Google_python_exercises | 7540ba812f11d4a438994f06d58eb696f0610d7c | [
"Apache-2.0"
] | null | null | null | basic/test.py | shanoob/Google_python_exercises | 7540ba812f11d4a438994f06d58eb696f0610d7c | [
"Apache-2.0"
] | null | null | null | basic/test.py | shanoob/Google_python_exercises | 7540ba812f11d4a438994f06d58eb696f0610d7c | [
"Apache-2.0"
] | null | null | null | import sys
dic={}
r=[]
def count(filename):
f=open(filename,'r')
t=f.read().split()
for i in t:
r.append(i.upper())
for i in r:
if i not in dic:
dic[i]=1
else:
dic[i]+=1
print dic
count(sys.argv[1]) | 14.333333 | 21 | 0.590698 | import sys
dic={}
r=[]
def count(filename):
f=open(filename,'r')
t=f.read().split()
for i in t:
r.append(i.upper())
for i in r:
if i not in dic:
dic[i]=1
else:
dic[i]+=1
print dic
count(sys.argv[1]) | false | true |
08f5efc7017d7c31d695c7ac443007b456019bc6 | 23,802 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/cloud/amazon/route53.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/cloud/amazon/route53.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/cloud/amazon/route53.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 34.247482 | 146 | 0.635241 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: route53
version_added: "1.3"
short_description: a... | true | true |
08f5eff26ab58fdfc851aa5ae73d77824861c0c7 | 6,693 | py | Python | bindings/python/ensmallen_graph/datasets/string/hyphomonassp25b141.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/hyphomonassp25b141.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/hyphomonassp25b141.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Hyphomonas sp. 25B141.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-... | 35.041885 | 223 | 0.702376 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def HyphomonasSp25b141(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
retu... | true | true |
08f5effcda11b6ea89ad56c9bac009c24b1e8fab | 388 | py | Python | opentargets/version.py | anmoljh/opentargets-py | 4a0e5b286a82a2316329c87409994c4a1d82622e | [
"Apache-2.0"
] | 20 | 2017-02-07T15:02:10.000Z | 2021-05-22T07:52:07.000Z | opentargets/version.py | anmoljh/opentargets-py | 4a0e5b286a82a2316329c87409994c4a1d82622e | [
"Apache-2.0"
] | 28 | 2017-02-07T15:31:16.000Z | 2021-11-03T13:00:36.000Z | opentargets/version.py | anmoljh/opentargets-py | 4a0e5b286a82a2316329c87409994c4a1d82622e | [
"Apache-2.0"
] | 10 | 2017-04-03T22:21:07.000Z | 2021-05-21T01:38:00.000Z | __pkgname__ = 'opentargets'
__author__ = 'OpenTargets Core Team <support@targetvalidation.org>'
__author_email__ = 'support@targetvalidation.org'
__license__ = 'Apache License, Version 2.0'
__homepage__ = 'https://github.com/opentargets/opentargets-py'
__version__ = '3.1.16'
__api_major_version__ = '3'
__description__ ... | 43.111111 | 83 | 0.791237 | __pkgname__ = 'opentargets'
__author__ = 'OpenTargets Core Team <support@targetvalidation.org>'
__author_email__ = 'support@targetvalidation.org'
__license__ = 'Apache License, Version 2.0'
__homepage__ = 'https://github.com/opentargets/opentargets-py'
__version__ = '3.1.16'
__api_major_version__ = '3'
__description__ ... | true | true |
08f5f0701d96805040e2075b107b44b6b2a4c8e9 | 44,666 | py | Python | dace/codegen/targets/xilinx.py | tehrengruber/dace | beeb3fb564d12c0cf05a235932bc5f80f4fc3cb0 | [
"BSD-3-Clause"
] | null | null | null | dace/codegen/targets/xilinx.py | tehrengruber/dace | beeb3fb564d12c0cf05a235932bc5f80f4fc3cb0 | [
"BSD-3-Clause"
] | null | null | null | dace/codegen/targets/xilinx.py | tehrengruber/dace | beeb3fb564d12c0cf05a235932bc5f80f4fc3cb0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import collections
import itertools
import os
import pdb
import re
import numpy as np
import dace
from dace import data as dt, registry, dtypes
from dace.config import Config
from dace.frontend import operations
from dace.sdfg import nodes, ut... | 45.858316 | 194 | 0.538889 | import collections
import itertools
import os
import pdb
import re
import numpy as np
import dace
from dace import data as dt, registry, dtypes
from dace.config import Config
from dace.frontend import operations
from dace.sdfg import nodes, utils
from dace.sdfg import find_input_arraynode, find_output_arraynode
from d... | true | true |
08f5f0afd43937d776e300398224e10853f56440 | 9,600 | py | Python | examples/music.py | v1s1t0r999/discord-super-utils | 048914d419e2e76126f0204aafba8f10f625229f | [
"MIT"
] | 1 | 2022-01-10T08:56:18.000Z | 2022-01-10T08:56:18.000Z | examples/music.py | v1s1t0r999/discord-super-utils | 048914d419e2e76126f0204aafba8f10f625229f | [
"MIT"
] | null | null | null | examples/music.py | v1s1t0r999/discord-super-utils | 048914d419e2e76126f0204aafba8f10f625229f | [
"MIT"
] | 1 | 2021-12-23T17:18:10.000Z | 2021-12-23T17:18:10.000Z | from discord.ext import commands
import discordSuperUtils
from discordSuperUtils import MusicManager
import discord
client_id = ""
client_secret = ""
bot = commands.Bot(command_prefix="-")
# MusicManager = MusicManager(bot, spotify_support=False)
MusicManager = MusicManager(
bot, client_id=client... | 29.090909 | 127 | 0.630313 | from discord.ext import commands
import discordSuperUtils
from discordSuperUtils import MusicManager
import discord
client_id = ""
client_secret = ""
bot = commands.Bot(command_prefix="-")
MusicManager = MusicManager(
bot, client_id=client_id, client_secret=client_secret, spotify_support=True
)
... | true | true |
08f5f1f45d878a26fea10a45a8fe611c61231bfd | 1,906 | py | Python | calculadora_factories.py | joaovictordemiranda/calculadora | b4db22f889b6525ad2f5d448e42ff94f78da4b10 | [
"MIT"
] | 1 | 2021-12-03T17:05:41.000Z | 2021-12-03T17:05:41.000Z | calculadora_factories.py | joaovictordemiranda/calculadora | b4db22f889b6525ad2f5d448e42ff94f78da4b10 | [
"MIT"
] | null | null | null | calculadora_factories.py | joaovictordemiranda/calculadora | b4db22f889b6525ad2f5d448e42ff94f78da4b10 | [
"MIT"
] | null | null | null | import tkinter as tk
from typing import List
def make_root() -> tk.Tk:
root = tk.Tk()
root.title('Calculator')
root.configure(padx=10, pady=10, background='#fff')
root.resizable(False, False)
return root
def make_label(root) -> tk.Label:
label = tk.Label(
root, text='sem conta ainda'... | 29.323077 | 78 | 0.562959 | import tkinter as tk
from typing import List
def make_root() -> tk.Tk:
root = tk.Tk()
root.title('Calculator')
root.configure(padx=10, pady=10, background='#fff')
root.resizable(False, False)
return root
def make_label(root) -> tk.Label:
label = tk.Label(
root, text='sem conta ainda'... | true | true |
08f5f24d21ea43a828454f5079ccbeb94249d408 | 3,629 | py | Python | jina/helloworld/multimodal/app.py | varghesejose2020/jina | b3e90cd6a4071a96f7127e71676dcb224d0663a8 | [
"Apache-2.0"
] | 2 | 2021-09-19T08:42:37.000Z | 2021-09-19T08:43:03.000Z | jina/helloworld/multimodal/app.py | lxvet/jina | 8b72cd5836ea25a42b2b5f50ddcd1193c46b7e7e | [
"Apache-2.0"
] | 1 | 2021-07-16T17:36:22.000Z | 2021-09-22T13:48:18.000Z | jina/helloworld/multimodal/app.py | lxvet/jina | 8b72cd5836ea25a42b2b5f50ddcd1193c46b7e7e | [
"Apache-2.0"
] | 1 | 2022-02-03T08:30:53.000Z | 2022-02-03T08:30:53.000Z | import os
import urllib.request
import webbrowser
import zipfile
from pathlib import Path
from jina import Flow
from jina.importer import ImportExtensions
from jina.logging.predefined import default_logger
from jina.logging.profile import ProgressBar
from jina.parsers.helloworld import set_hw_multimodal_parser
from ji... | 31.556522 | 87 | 0.642601 | import os
import urllib.request
import webbrowser
import zipfile
from pathlib import Path
from jina import Flow
from jina.importer import ImportExtensions
from jina.logging.predefined import default_logger
from jina.logging.profile import ProgressBar
from jina.parsers.helloworld import set_hw_multimodal_parser
from ji... | true | true |
08f5f2653fbe46a182b71176e8572288a307922e | 3,350 | py | Python | scripts/rvm_regressor.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 4,895 | 2016-08-17T22:28:34.000Z | 2022-03-31T17:07:15.000Z | scripts/rvm_regressor.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 446 | 2016-09-17T14:35:29.000Z | 2022-03-31T19:59:33.000Z | scripts/rvm_regressor.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 1,160 | 2016-08-18T23:19:27.000Z | 2022-03-31T12:44:07.000Z | """
code taken from
https://github.com/ctgk/PRML/blob/master/prml/kernel/relevance_vector_regressor.py
"""
import superimport
import numpy as np
class RelevanceVectorRegressor(object):
def __init__(self, kernel, alpha=1., beta=1.):
"""
construct relevance vector regressor
Parameters
... | 31.904762 | 82 | 0.536418 |
import superimport
import numpy as np
class RelevanceVectorRegressor(object):
def __init__(self, kernel, alpha=1., beta=1.):
self.kernel = kernel
self.alpha = alpha
self.beta = beta
def fit(self, X, t, iter_max=1000):
if X.ndim == 1:
X = X[:, None]
asser... | true | true |
08f5f275921d42d1ea06b42b31089f7c54f98d1c | 9,219 | py | Python | controller/data_loader.py | ferrocactus/CellarV | 069044b742a1ae5dcc494606ee5d975987e620f1 | [
"MIT"
] | 9 | 2021-09-08T16:56:45.000Z | 2021-12-12T03:13:29.000Z | controller/data_loader.py | ferrocactus/CellarV | 069044b742a1ae5dcc494606ee5d975987e620f1 | [
"MIT"
] | null | null | null | controller/data_loader.py | ferrocactus/CellarV | 069044b742a1ae5dcc494606ee5d975987e620f1 | [
"MIT"
] | 1 | 2022-01-20T03:04:44.000Z | 2022-01-20T03:04:44.000Z | import os
import gc
import numpy as np
import dash
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
import dash_html_components as html
import dash_bootstrap_components as dbc
from app import app, logger, dbroot
from controller.cellar.utils.exceptions import UserError
from ... | 33.043011 | 79 | 0.609502 | import os
import gc
import numpy as np
import dash
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
import dash_html_components as html
import dash_bootstrap_components as dbc
from app import app, logger, dbroot
from controller.cellar.utils.exceptions import UserError
from ... | true | true |
08f5f2ee40ae91f25af2c39af4571f6700ae6686 | 11,022 | py | Python | electrum/gui/kivy/uix/dialogs/settings.py | ben-abraham/electrum-ravencoin | 597d27b722be1f8bea4e33e69deadb3dc8348340 | [
"MIT"
] | 28 | 2021-04-03T21:30:17.000Z | 2022-02-22T08:13:14.000Z | electrum/gui/kivy/uix/dialogs/settings.py | ben-abraham/electrum-ravencoin | 597d27b722be1f8bea4e33e69deadb3dc8348340 | [
"MIT"
] | 37 | 2021-05-26T14:08:10.000Z | 2022-02-09T23:25:07.000Z | electrum/gui/kivy/uix/dialogs/settings.py | ben-abraham/electrum-ravencoin | 597d27b722be1f8bea4e33e69deadb3dc8348340 | [
"MIT"
] | 13 | 2021-04-09T20:22:32.000Z | 2021-12-17T17:18:51.000Z | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum.util import base_units_list
from electrum.i18n import languages
from electrum.gui.kivy.i18n import _
from electrum.plugin import run_hook
from electrum import coinchooser
fr... | 43.223529 | 134 | 0.575939 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum.util import base_units_list
from electrum.i18n import languages
from electrum.gui.kivy.i18n import _
from electrum.plugin import run_hook
from electrum import coinchooser
fr... | true | true |
08f5f3be6b6630bd7f04f17861e70d6260736416 | 798 | py | Python | hello.py | jamesnguyenvo/cgi-lab | ea078b92d59d188f50b2ca2d465849dc53409624 | [
"Apache-2.0"
] | null | null | null | hello.py | jamesnguyenvo/cgi-lab | ea078b92d59d188f50b2ca2d465849dc53409624 | [
"Apache-2.0"
] | null | null | null | hello.py | jamesnguyenvo/cgi-lab | ea078b92d59d188f50b2ca2d465849dc53409624 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import cgi
import cgitb
cgitb.enable()
from urllib.parse import parse-qs
import json
import os
print("Content-Type: text/html\n")
print()
print("<!doctype html><title>Hello</title><h2>Hello World</h2>")
print("<head>")
print("<title>Hello</title>")
print("<style>pre {wite-space: pre-wrap; word-... | 24.181818 | 75 | 0.681704 | import cgi
import cgitb
cgitb.enable()
from urllib.parse import parse-qs
import json
import os
print("Content-Type: text/html\n")
print()
print("<!doctype html><title>Hello</title><h2>Hello World</h2>")
print("<head>")
print("<title>Hello</title>")
print("<style>pre {wite-space: pre-wrap; word-wrap: break-word;}</sty... | false | true |
08f5f3f695309a0e0536a5fd28c8ef94ad605872 | 1,182 | py | Python | src/djangoreactredux/djrenv/lib/python3.5/site-packages/pydocstyle/wordlists.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 2 | 2018-03-14T06:45:40.000Z | 2018-06-08T07:46:02.000Z | src/djangoreactredux/djrenv/lib/python3.5/site-packages/pydocstyle/wordlists.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 3 | 2020-02-11T23:03:45.000Z | 2021-06-10T18:05:11.000Z | src/djangoreactredux/djrenv/lib/python3.5/site-packages/pydocstyle/wordlists.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 2 | 2017-11-07T18:05:19.000Z | 2017-11-14T18:06:55.000Z | """Wordlists loaded from package data.
We can treat them as part of the code for the imperative mood check, and
therefore we load them at import time, rather than on-demand.
"""
import re
import pkgutil
import snowballstemmer
#: Regular expression for stripping comments from the wordlists
COMMENT_RE = r... | 29.55 | 74 | 0.696277 | import re
import pkgutil
import snowballstemmer
COMMENT_RE = re.compile(r'\s*#.*')
stem = snowballstemmer.stemmer('english').stemWord
def load_wordlist(name):
text = pkgutil.get_data('pydocstyle', 'data/' + name).decode('utf8')
for line in text.splitlines():
line = COMMENT_RE.sub('', l... | true | true |
08f5f3fbb23e1c2c4905f91ec4c5f8f35fb1667f | 238 | py | Python | Module6_HW/hw6_1_4.py | vladspirin/python_core | 8d91dce246a438c15c8c17d30971fa5572247eb4 | [
"Unlicense"
] | null | null | null | Module6_HW/hw6_1_4.py | vladspirin/python_core | 8d91dce246a438c15c8c17d30971fa5572247eb4 | [
"Unlicense"
] | null | null | null | Module6_HW/hw6_1_4.py | vladspirin/python_core | 8d91dce246a438c15c8c17d30971fa5572247eb4 | [
"Unlicense"
] | null | null | null | from random import randint
list_1 = []
list_2 = []
numbers = [randint(-5, 5) for i in range(-5, 5)]
for i in numbers:
print(i)
if i < 0:
list_1.append(i)
if i > 0:
list_2.append(i)
print(list_1)
print(list_2)
| 17 | 48 | 0.584034 | from random import randint
list_1 = []
list_2 = []
numbers = [randint(-5, 5) for i in range(-5, 5)]
for i in numbers:
print(i)
if i < 0:
list_1.append(i)
if i > 0:
list_2.append(i)
print(list_1)
print(list_2)
| true | true |
08f5f40e510eae551e8fe46da45efbc7b79e0ecd | 4,416 | py | Python | 03_coffee_shop_full_stack/starter_code/backend/src/auth/auth.py | Mohammed-Benotmane/Udacity-NanoDegree | 9ce49273042f01637685ff7643ecf2b14006b521 | [
"MIT"
] | 3 | 2020-05-25T12:46:59.000Z | 2020-09-07T19:05:54.000Z | 03_coffee_shop_full_stack/starter_code/backend/src/auth/auth.py | Mohammed-Benotmane/Udacity-NanoDegree | 9ce49273042f01637685ff7643ecf2b14006b521 | [
"MIT"
] | 3 | 2021-05-11T15:33:52.000Z | 2022-02-27T05:32:06.000Z | backend/src/auth/auth.py | Mohammed-Benotmane/Coffee-Shop-Full-Stack | 7ee222d754c9148eed2bea70f1288abb9e8a36aa | [
"MIT"
] | null | null | null | import json
from flask import request, _request_ctx_stack,abort
from functools import wraps
from jose import jwt
from urllib.request import urlopen
AUTH0_DOMAIN = 'mohammedbenotmane.auth0.com'
ALGORITHMS = ['RS256']
API_AUDIENCE = 'image'
## AuthError Exception
'''
AuthError Exception
A standardized way to communica... | 30.666667 | 107 | 0.591486 | import json
from flask import request, _request_ctx_stack,abort
from functools import wraps
from jose import jwt
from urllib.request import urlopen
AUTH0_DOMAIN = 'mohammedbenotmane.auth0.com'
ALGORITHMS = ['RS256']
API_AUDIENCE = 'image'
class AuthError(Exception):
def __init__(self, error, status_code):
... | true | true |
08f5f42f9013297294f2519c41e892404445cf6d | 263 | py | Python | test_junkie/rules.py | Rdvp1514/test_junkie | 9246a33abc9ac8d6584781dcbe95e1093507aa8f | [
"MIT"
] | 72 | 2018-10-25T18:32:42.000Z | 2022-02-02T03:03:09.000Z | test_junkie/rules.py | nityagautam/test_junkie | f60a9d71b9a8670f6272a79e2dcc5ac2d64b0512 | [
"MIT"
] | 41 | 2018-12-13T22:30:35.000Z | 2021-11-04T09:08:49.000Z | test_junkie/rules.py | nityagautam/test_junkie | f60a9d71b9a8670f6272a79e2dcc5ac2d64b0512 | [
"MIT"
] | 10 | 2019-04-05T10:51:11.000Z | 2021-12-06T15:18:56.000Z |
class Rules:
def __init__(self, **kwargs):
self.kwargs = kwargs
def before_class(self):
pass
def before_test(self, **kwargs):
pass
def after_test(self, **kwargs):
pass
def after_class(self):
pass
| 13.842105 | 36 | 0.558935 |
class Rules:
def __init__(self, **kwargs):
self.kwargs = kwargs
def before_class(self):
pass
def before_test(self, **kwargs):
pass
def after_test(self, **kwargs):
pass
def after_class(self):
pass
| true | true |
08f5f5491c778bc3017636d003a19e1ac28ec63f | 12,025 | py | Python | script_clustering.py | xavierfav/freesound-python-tools | adc90ea1e399d1ff4d7b6f75920cf822391ed553 | [
"MIT"
] | 8 | 2017-07-10T03:13:27.000Z | 2021-06-29T05:25:06.000Z | script_clustering.py | xavierfav/freesound-python | adc90ea1e399d1ff4d7b6f75920cf822391ed553 | [
"MIT"
] | 1 | 2017-04-25T14:33:41.000Z | 2017-05-16T15:24:49.000Z | script_clustering.py | xavierfav/freesound-python | adc90ea1e399d1ff4d7b6f75920cf822391ed553 | [
"MIT"
] | 7 | 2017-06-13T13:40:08.000Z | 2020-06-03T23:35:05.000Z | import manager
from scipy.spatial.distance import pdist
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.metrics.pairwise import cosine_similarity
import webbrowser
import community.community_louvain as com
import networkx as nx
import numpy as np
import operator
#c = manager.Client()
#b = c.load_... | 41.465517 | 167 | 0.670936 | import manager
from scipy.spatial.distance import pdist
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.metrics.pairwise import cosine_similarity
import webbrowser
import community.community_louvain as com
import networkx as nx
import numpy as np
import operator
class Cluster:
"""
Comput... | false | true |
08f5f66e2738ca5fa388866a6cfd98ffcec2ff92 | 5,161 | py | Python | docker-vertica/packages/package-checksum-patcher.py | nprabhu2195/vertica-kubernetes | fcde8e1759b868c7d6712934c773a8af63ee6ce0 | [
"Apache-2.0"
] | 15 | 2021-06-07T16:20:44.000Z | 2022-02-02T21:52:20.000Z | docker-vertica/packages/package-checksum-patcher.py | MyGH001/vertica-kubernetes | 5925fa9c3760ceba1ffaade119dadc5e61ee5ce0 | [
"Apache-2.0"
] | 71 | 2021-05-31T13:03:58.000Z | 2022-03-30T13:08:52.000Z | docker-vertica/packages/package-checksum-patcher.py | MyGH001/vertica-kubernetes | 5925fa9c3760ceba1ffaade119dadc5e61ee5ce0 | [
"Apache-2.0"
] | 16 | 2021-05-04T14:08:11.000Z | 2022-03-15T21:08:00.000Z | #!/usr/bin/env python
# Copyright 2021 Vertica
# 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 agre... | 31.090361 | 92 | 0.663825 |
import os
import os.path
import re
import sys
import subprocess
progname = sys.argv[0]
def parse_conf(dir):
md5pat = re.compile('^md5sum=(.*)$')
autopat = re.compile('^Autoinstall=(.*)$')
checksum = None
autoinstall = None
with open(dir + '/package.conf', 'r') as fp:
for line in fp... | true | true |
08f5f788d5790a5947e4abbec370f64fc07b9b6f | 4,661 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/rdinfo_7071ca796bcf9b22f79921227886bad8.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/rdinfo_7071ca796bcf9b22f79921227886bad8.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/rdinfo_7071ca796bcf9b22f79921227886bad8.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 37.894309 | 186 | 0.677752 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class RdInfo(Base):
__slots__ = ()
_SDM_NAME = 'rdInfo'
_SDM_ATT_MAP = {
'Rd': 'rd',
}
_SDM_ENUM_MAP = {
}
def __init__(self, parent, list_op=False):
super(... | true | true |
08f5f9f96ebed045fcbe388bb75fca150ec403b7 | 2,437 | py | Python | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/update_member_vmr_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/update_member_vmr_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/update_member_vmr_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UpdateMemberVmrResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.337209 | 79 | 0.551498 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UpdateMemberVmrResponse(SdkResponse):
sensitive_list = []
openapi_types = {
}
attribute_map = {
}
def __init__(self):
... | true | true |
08f5fabfc5b5bcf22d999e918cdf85c5cbc69896 | 8,189 | py | Python | docs/conf.py | bb-migration/setuptools | eb75ea6eb827acf1be6c350850b350de7b500efd | [
"MIT"
] | null | null | null | docs/conf.py | bb-migration/setuptools | eb75ea6eb827acf1be6c350850b350de7b500efd | [
"MIT"
] | null | null | null | docs/conf.py | bb-migration/setuptools | eb75ea6eb827acf1be6c350850b350de7b500efd | [
"MIT"
] | null | null | null | extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker']
master_doc = "index"
link_files = {
'../CHANGES.rst': dict(
using=dict(
BB='https://bitbucket.org',
GH='https://github.com',
),
replace=[
dict(
pattern=r'(Issue ... | 36.887387 | 87 | 0.582855 | extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker']
master_doc = "index"
link_files = {
'../CHANGES.rst': dict(
using=dict(
BB='https://bitbucket.org',
GH='https://github.com',
),
replace=[
dict(
pattern=r'(Issue ... | true | true |
08f5fb7e36dddc5cf913800e9b8f9c9cd9aba72c | 6,773 | py | Python | geometric/tests/test_openmm.py | jthorton/geomeTRIC | 1cee4490c367f4b6e92c661808659231b377c727 | [
"MIT"
] | null | null | null | geometric/tests/test_openmm.py | jthorton/geomeTRIC | 1cee4490c367f4b6e92c661808659231b377c727 | [
"MIT"
] | null | null | null | geometric/tests/test_openmm.py | jthorton/geomeTRIC | 1cee4490c367f4b6e92c661808659231b377c727 | [
"MIT"
] | null | null | null | """
A set of tests for using the OpenMM engine
"""
import copy
import numpy as np
import json, os, shutil
from . import addons
import geometric
import pytest
import itertools
localizer = addons.in_folder
datad = addons.datad
@addons.using_openmm
def test_dlc_openmm_water3(localizer):
"""
Optimize the geometr... | 52.503876 | 158 | 0.640632 |
import copy
import numpy as np
import json, os, shutil
from . import addons
import geometric
import pytest
import itertools
localizer = addons.in_folder
datad = addons.datad
@addons.using_openmm
def test_dlc_openmm_water3(localizer):
progress = geometric.optimize.run_optimizer(openmm=True, pdb=os.path.join(datad... | true | true |
08f5fbee2a155c2e9b68944b65833e212d2e0008 | 1,482 | py | Python | data_aug.py | dishen12/whale | 2d5bc3aaccab87ecebe31663d2d6c99d52563cc8 | [
"MIT"
] | null | null | null | data_aug.py | dishen12/whale | 2d5bc3aaccab87ecebe31663d2d6c99d52563cc8 | [
"MIT"
] | null | null | null | data_aug.py | dishen12/whale | 2d5bc3aaccab87ecebe31663d2d6c99d52563cc8 | [
"MIT"
] | null | null | null | from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import numpy as np
import os
datagen = ImageDataGenerator(
rotation_range=30,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=Fa... | 31.531915 | 109 | 0.589069 | from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import numpy as np
import os
datagen = ImageDataGenerator(
rotation_range=30,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=Fa... | true | true |
08f5fc4134aa795aa6615557649aa8fc38153cee | 912 | py | Python | tests/test_toolkit.py | DarioPanada/panaxea | 762fee407e2fbd63e3a19f8dfa3893a74e1e7460 | [
"MIT"
] | 1 | 2020-06-26T10:55:27.000Z | 2020-06-26T10:55:27.000Z | tests/test_toolkit.py | DarioPanada/panaxea | 762fee407e2fbd63e3a19f8dfa3893a74e1e7460 | [
"MIT"
] | 1 | 2020-06-06T12:11:20.000Z | 2020-06-06T12:11:20.000Z | tests/test_toolkit.py | DarioPanada/panaxea | 762fee407e2fbd63e3a19f8dfa3893a74e1e7460 | [
"MIT"
] | 2 | 2020-02-20T13:06:02.000Z | 2020-06-26T10:55:28.000Z | import unittest
from panaxea.core.Model import Model
from tests.resources.SampleSteppables import AgentX, AgentY, AgentZ
from panaxea.toolkit.Toolkit import AgentSummary
class TestToolkit(unittest.TestCase):
def test_agent_summary(self):
model = Model(5)
model.schedule.agents.add(AgentX())
... | 29.419355 | 67 | 0.683114 | import unittest
from panaxea.core.Model import Model
from tests.resources.SampleSteppables import AgentX, AgentY, AgentZ
from panaxea.toolkit.Toolkit import AgentSummary
class TestToolkit(unittest.TestCase):
def test_agent_summary(self):
model = Model(5)
model.schedule.agents.add(AgentX())
... | true | true |
08f5fd325d6b30a22856c7f9951f07c24b598c23 | 4,282 | py | Python | flask/lib/python3.6/site-packages/openpyxl/worksheet/protection.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | 8 | 2016-05-27T12:13:16.000Z | 2019-08-05T13:49:11.000Z | flask/lib/python3.6/site-packages/openpyxl/worksheet/protection.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | 3 | 2019-07-29T09:47:34.000Z | 2019-07-29T09:47:35.000Z | flask/lib/python3.6/site-packages/openpyxl/worksheet/protection.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | 1 | 2021-07-21T00:07:30.000Z | 2021-07-21T00:07:30.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2014 openpyxl
from openpyxl.descriptors import Strict, Bool, String, Alias, Integer
from openpyxl.compat import safe_string
def hash_password(plaintext_password=''):
"""
Create a password hash from a given string for protecting a worksheet
only.... | 34.532258 | 111 | 0.652032 | from __future__ import absolute_import
from openpyxl.descriptors import Strict, Bool, String, Alias, Integer
from openpyxl.compat import safe_string
def hash_password(plaintext_password=''):
password = 0x0000
for idx, char in enumerate(plaintext_password, 1):
value = ord(char) << idx
rotated_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.