hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2c78f323d191615d8945cd2e3207743a075eb0 | 1,570 | py | Python | Ch5/jsondata_start.py | prottoyghose/python_essentials | 029e3208b4be343315d384b6f6a4d77eb25f9fcb | [
"Apache-2.0"
] | null | null | null | Ch5/jsondata_start.py | prottoyghose/python_essentials | 029e3208b4be343315d384b6f6a4d77eb25f9fcb | [
"Apache-2.0"
] | null | null | null | Ch5/jsondata_start.py | prottoyghose/python_essentials | 029e3208b4be343315d384b6f6a4d77eb25f9fcb | [
"Apache-2.0"
] | null | null | null | #
# Example file for parsing and processing JSON
#
import urllib.request
import json
def printResults(data):
# Use the json module to load the string data into a dictionary
theJSON = json.loads(data)
# now we can access the contents of the JSON like any other Python object
# if "title" in theJSON["metadat... | 30.784314 | 86 | 0.666879 |
import urllib.request
import json
def printResults(data):
theJSON = json.loads(data)
for i in theJSON["features"]:
if(i["properties"]["mag"] >= 4.0):
print("%2.1f" % i["properties"]["mag"], i["properties"]["place"])
print("--------------------\n")
... | true | true |
1c2c78ff440615a7440945f91e8b1bac0ee178b4 | 7,119 | py | Python | tests/integration/sdk_api/base.py | daniels290813/mlrun | c95d90c3b4ce78d9b71456333ccd201f932d60ea | [
"Apache-2.0"
] | null | null | null | tests/integration/sdk_api/base.py | daniels290813/mlrun | c95d90c3b4ce78d9b71456333ccd201f932d60ea | [
"Apache-2.0"
] | null | null | null | tests/integration/sdk_api/base.py | daniels290813/mlrun | c95d90c3b4ce78d9b71456333ccd201f932d60ea | [
"Apache-2.0"
] | null | null | null | import copy
import os
import pathlib
import subprocess
import sys
import pymysql
import mlrun
import mlrun.api.schemas
import tests.conftest
from mlrun.db.httpdb import HTTPRunDB
from mlrun.utils import create_logger, retry_until_successful
logger = create_logger(level="debug", name="test-integration")
class TestM... | 31.361233 | 114 | 0.580559 | import copy
import os
import pathlib
import subprocess
import sys
import pymysql
import mlrun
import mlrun.api.schemas
import tests.conftest
from mlrun.db.httpdb import HTTPRunDB
from mlrun.utils import create_logger, retry_until_successful
logger = create_logger(level="debug", name="test-integration")
class TestM... | true | true |
1c2c793926370a302016f44032ba3bdd72a3fa41 | 401 | py | Python | radon_server/wsgi.py | leo212/radon_transform | 04721c365d01e9b6a17eba4130a13d453844e27d | [
"Apache-2.0"
] | null | null | null | radon_server/wsgi.py | leo212/radon_transform | 04721c365d01e9b6a17eba4130a13d453844e27d | [
"Apache-2.0"
] | 2 | 2021-03-19T01:28:34.000Z | 2022-01-13T01:19:59.000Z | radon_server/wsgi.py | leo212/radon_transform | 04721c365d01e9b6a17eba4130a13d453844e27d | [
"Apache-2.0"
] | null | null | null | """
WSGI config for radon_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'radon_server.settings')
application = get_wsgi_application()
| true | true |
1c2c7a20db73d48b38cdb71eedae1aceaf185ef0 | 667 | py | Python | application/utilities/dict_mapping.py | kelp404/Victory | 132f186f18ea6a709afb003e38ed1d6de3c0579f | [
"MIT"
] | 15 | 2015-02-15T16:40:19.000Z | 2021-02-01T21:31:26.000Z | application/utilities/dict_mapping.py | kelp404/Victory | 132f186f18ea6a709afb003e38ed1d6de3c0579f | [
"MIT"
] | null | null | null | application/utilities/dict_mapping.py | kelp404/Victory | 132f186f18ea6a709afb003e38ed1d6de3c0579f | [
"MIT"
] | 1 | 2015-06-02T07:48:30.000Z | 2015-06-02T07:48:30.000Z |
class DictMapping:
"""
Dictionary Mapping
copy all values in the dict object to the custom class instance.
"""
@staticmethod
def inject(strong, dic):
"""
copy all value in dic to strong
@param strong a custom class instance
@param dic a dict object
"""
... | 26.68 | 68 | 0.506747 |
class DictMapping:
@staticmethod
def inject(strong, dic):
if isinstance(dic, dict):
for name in dir(strong):
try:
if name[:2] != '__' and name in dic:
setattr(strong, name, dic[name])
except: pass
... | true | true |
1c2c7a3489682f5b904e53760dcaba38a92ea875 | 82 | py | Python | n2survey/plot/__init__.py | N2-Survey/SurveyFramework | 8295fd9808c95db85befb1f60391460908a7d2b0 | [
"MIT"
] | 1 | 2022-01-26T19:04:38.000Z | 2022-01-26T19:04:38.000Z | n2survey/plot/__init__.py | N2-Survey/SurveyFramework | 8295fd9808c95db85befb1f60391460908a7d2b0 | [
"MIT"
] | 77 | 2021-09-14T09:33:03.000Z | 2022-03-31T18:02:47.000Z | n2survey/plot/__init__.py | N2-Survey/SurveyFramework | 8295fd9808c95db85befb1f60391460908a7d2b0 | [
"MIT"
] | 3 | 2021-09-14T20:11:28.000Z | 2021-12-26T11:56:25.000Z | from .bar import *
from .plot_likert import *
from .plot_multiple_choice import *
| 20.5 | 35 | 0.780488 | from .bar import *
from .plot_likert import *
from .plot_multiple_choice import *
| true | true |
1c2c7b901ddafeb5c8002732ecae960943849e2f | 279 | py | Python | PicoCTF 2018/Reversing/quackme/solve1.py | p-g-krish/CTF-Writeups | 05ad6a9ecbc19ceb8890f4581dfee36f16d164aa | [
"MIT"
] | 51 | 2018-06-26T09:49:42.000Z | 2019-09-14T00:06:35.000Z | PicoCTF 2018/Reversing/quackme/solve1.py | p-g-krish/CTF-Writeups | 05ad6a9ecbc19ceb8890f4581dfee36f16d164aa | [
"MIT"
] | 1 | 2018-06-29T18:40:59.000Z | 2018-07-09T20:29:41.000Z | PicoCTF 2018/Reversing/quackme/solve1.py | p-g-krish/CTF-Writeups | 05ad6a9ecbc19ceb8890f4581dfee36f16d164aa | [
"MIT"
] | 22 | 2019-10-03T14:52:43.000Z | 2022-01-17T08:55:10.000Z | #!/usr/bin/env python3
key = b"\x29\x06\x16\x4F\x2B\x35\x30\x1E\x51\x1B\x5B\x14\x4B\x08\x5D\x2B\x5C\x10\x06\x06\x18\x45\x51\x00\x5D"
cipher = b"You have now entered the Duck Web, and you're in for a honk"
flag = "".join(chr(k^c) for k,c in zip(key,cipher[:len(key)]))
print(flag) | 55.8 | 109 | 0.695341 |
key = b"\x29\x06\x16\x4F\x2B\x35\x30\x1E\x51\x1B\x5B\x14\x4B\x08\x5D\x2B\x5C\x10\x06\x06\x18\x45\x51\x00\x5D"
cipher = b"You have now entered the Duck Web, and you're in for a honk"
flag = "".join(chr(k^c) for k,c in zip(key,cipher[:len(key)]))
print(flag) | true | true |
1c2c7c7b409d735c707e4a4f5156d62ffa140283 | 8,243 | py | Python | tests/pre_merge/datasets/test_dataset.py | DavidHribek/anomalib | d8f6674bc4669fbad88cb61c235b1a2532ae44f5 | [
"Apache-2.0"
] | null | null | null | tests/pre_merge/datasets/test_dataset.py | DavidHribek/anomalib | d8f6674bc4669fbad88cb61c235b1a2532ae44f5 | [
"Apache-2.0"
] | null | null | null | tests/pre_merge/datasets/test_dataset.py | DavidHribek/anomalib | d8f6674bc4669fbad88cb61c235b1a2532ae44f5 | [
"Apache-2.0"
] | null | null | null | """Test Dataset."""
import os
import numpy as np
import pytest
from anomalib.config import get_configurable_parameters, update_input_size_config
from anomalib.data import (
BTechDataModule,
FolderDataModule,
MVTecDataModule,
get_datamodule,
)
from anomalib.pre_processing.transforms import Denormalize... | 37.986175 | 106 | 0.677787 |
import os
import numpy as np
import pytest
from anomalib.config import get_configurable_parameters, update_input_size_config
from anomalib.data import (
BTechDataModule,
FolderDataModule,
MVTecDataModule,
get_datamodule,
)
from anomalib.pre_processing.transforms import Denormalize, ToNumpy
from tests... | true | true |
1c2c7cb28a9c66943438e1a885f3e8d0f3eca3a9 | 2,870 | py | Python | ppgan/models/mpr_model.py | windstamp/PaddleGAN | 4d9609d0ab9cf1058f564e354dfbc29c0ac3108a | [
"Apache-2.0"
] | 6,852 | 2020-06-18T10:56:27.000Z | 2022-03-31T10:17:47.000Z | ppgan/models/mpr_model.py | HighCWu/PaddleGAN | 32132fa9aa288fbf0325105088b878adfaf16d75 | [
"Apache-2.0"
] | 283 | 2020-07-09T13:29:58.000Z | 2022-03-23T02:50:25.000Z | ppgan/models/mpr_model.py | HighCWu/PaddleGAN | 32132fa9aa288fbf0325105088b878adfaf16d75 | [
"Apache-2.0"
] | 973 | 2020-06-18T11:15:35.000Z | 2022-03-30T10:50:16.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 32.247191 | 86 | 0.668641 |
import paddle
import paddle.nn as nn
from .builder import MODELS
from .base_model import BaseModel
from .generators.builder import build_generator
from .criterions.builder import build_criterion
from ..modules.init import reset_parameters, init_weights
@MODELS.register()
class MPRModel(BaseModel):
... | true | true |
1c2c7cc33c3845044ace8661de804165d0fbb5df | 9,169 | py | Python | inun4d_kml.py | larryyin/barrier_interp | 0836a1678117bba687e60fe0eb18fd29cae52a9f | [
"Unlicense"
] | 2 | 2017-09-21T06:00:43.000Z | 2020-03-19T03:58:41.000Z | inun4d_kml.py | larryyin/barrier_interp | 0836a1678117bba687e60fe0eb18fd29cae52a9f | [
"Unlicense"
] | null | null | null | inun4d_kml.py | larryyin/barrier_interp | 0836a1678117bba687e60fe0eb18fd29cae52a9f | [
"Unlicense"
] | null | null | null | #%%
import time
start = time.time()
#import gdal, ogr, osr
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from osgeo.gdalnumeric import *
from osgeo.gdalconst import *
#import numpy as np
#import scipy.ndimage as ndimage
#import pandas as pd
from subprocess import call
from itertools import compres... | 22.97995 | 106 | 0.599629 |
import time
start = time.time()
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from osgeo.gdalnumeric import *
from osgeo.gdalconst import *
from subprocess import call
from itertools import compress
file_bool2 = '../inun_nj/inun_bool2.tif'
file_poly2 = '../inun_nj/inun_poly2'
file_wl = '... | true | true |
1c2c7cf6d2836cb75f5b39d865a3c9ab7bf4e33d | 1,024 | py | Python | ProjectQ/utility.py | jclapis/qsfe | 941488f8f8a81a4b7d7fe28414ce14fa478a692a | [
"Apache-2.0"
] | 11 | 2019-06-02T01:47:24.000Z | 2021-08-10T14:54:35.000Z | ProjectQ/utility.py | jclapis/qsfe | 941488f8f8a81a4b7d7fe28414ce14fa478a692a | [
"Apache-2.0"
] | null | null | null | ProjectQ/utility.py | jclapis/qsfe | 941488f8f8a81a4b7d7fe28414ce14fa478a692a | [
"Apache-2.0"
] | 2 | 2020-04-19T17:39:23.000Z | 2021-03-08T12:35:55.000Z | # ========================================================================
# Copyright (C) 2019 The MITRE Corporation.
#
# 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.apa... | 32 | 74 | 0.587891 |
from projectq.ops import *
def reset(qubits):
for qubit in qubits:
Measure | qubit
if(int(qubit) == 1):
X | qubit | true | true |
1c2c7da22660d395318a62ddab8dbfdcc1d920e1 | 505 | py | Python | parallel/__init__.py | sjwarner-bp/pyparallel | c79718e4fe700286dd27cfe5f756f9b37dcf48e8 | [
"BSD-3-Clause"
] | 36 | 2015-12-12T22:31:35.000Z | 2022-02-15T08:49:51.000Z | parallel/__init__.py | sjwarner-bp/pyparallel | c79718e4fe700286dd27cfe5f756f9b37dcf48e8 | [
"BSD-3-Clause"
] | 12 | 2016-01-05T09:14:26.000Z | 2022-03-11T12:56:53.000Z | parallel/__init__.py | sjwarner-bp/pyparallel | c79718e4fe700286dd27cfe5f756f9b37dcf48e8 | [
"BSD-3-Clause"
] | 23 | 2015-10-30T15:50:21.000Z | 2022-01-05T04:54:20.000Z | # portable parallel port access with python
# this is a wrapper module for different platform implementations
#
# (C)2001-2002 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import os
VERSION = "0.3"
# choose an implementation, depending on os
if os.name == 'nt':
from parallel.paral... | 28.055556 | 65 | 0.740594 |
import os
VERSION = "0.3"
if os.name == 'nt':
from parallel.parallelwin32 import Parallel
elif os.name == 'posix':
from parallel.parallelppdev import Parallel
else:
raise "Sorry no implementation for your platform available."
| true | true |
1c2c800b2a7bc83cb88245c0b951b01438ce7102 | 157 | py | Python | framework/QSSF Service/policies/__init__.py | S-Lab-System-Group/HeliosArtifact | ba73838935bd345ea8575b7bcfcc99e5df690c01 | [
"MIT"
] | 5 | 2021-09-20T13:59:55.000Z | 2022-03-16T12:48:08.000Z | framework/QSSF Service/policies/__init__.py | S-Lab-System-Group/HeliosArtifact | ba73838935bd345ea8575b7bcfcc99e5df690c01 | [
"MIT"
] | null | null | null | framework/QSSF Service/policies/__init__.py | S-Lab-System-Group/HeliosArtifact | ba73838935bd345ea8575b7bcfcc99e5df690c01 | [
"MIT"
] | 1 | 2021-10-15T11:39:11.000Z | 2021-10-15T11:39:11.000Z | from .sjf import ShortestJobFirst
from .srtf import ShortestRemainingTimeFirst
from .fifo import FirstInFirstOut
from .qssf import QuasiShortestServiceFirst
| 31.4 | 44 | 0.872611 | from .sjf import ShortestJobFirst
from .srtf import ShortestRemainingTimeFirst
from .fifo import FirstInFirstOut
from .qssf import QuasiShortestServiceFirst
| true | true |
1c2c8181115351ad978174b2d39e3db8876a4800 | 961 | py | Python | gpMgmt/bin/gppylib/commands/test/unit/test_unit_base.py | nurikk/gpdb | 04fe0202c59721826d1eda2b19d73e5572893fcb | [
"PostgreSQL",
"Apache-2.0"
] | 3 | 2017-12-10T16:41:21.000Z | 2020-07-08T12:59:12.000Z | gpMgmt/bin/gppylib/commands/test/unit/test_unit_base.py | nurikk/gpdb | 04fe0202c59721826d1eda2b19d73e5572893fcb | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/commands/test/unit/test_unit_base.py | nurikk/gpdb | 04fe0202c59721826d1eda2b19d73e5572893fcb | [
"PostgreSQL",
"Apache-2.0"
] | 4 | 2017-12-10T16:41:35.000Z | 2020-11-28T12:20:30.000Z | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2012. All Rights Reserved.
#
import os
import shutil
import sys
import unittest2 as unittest
from gppylib.commands.base import Command, CommandResult, WorkerPool
from mock import patch, MagicMock, Mock
class WorkerPoolTestCase(unittest.TestCase):
@patch('gpp... | 30.03125 | 71 | 0.685744 |
import os
import shutil
import sys
import unittest2 as unittest
from gppylib.commands.base import Command, CommandResult, WorkerPool
from mock import patch, MagicMock, Mock
class WorkerPoolTestCase(unittest.TestCase):
@patch('gppylib.commands.base.gplog.get_default_logger')
def test_print_progress(self, ... | true | true |
1c2c81b6d8dfa3b62cc323911a7c35d38a860cad | 1,642 | py | Python | s3backgrounddelete/s3backgrounddelete/cortx_s3_signal.py | shailesh-vaidya/cortx-s3server-1 | f61d4ab8961f53722feb68f233840326715ca47e | [
"Apache-2.0"
] | 35 | 2020-09-25T07:27:10.000Z | 2022-03-23T07:49:57.000Z | s3backgrounddelete/s3backgrounddelete/cortx_s3_signal.py | shailesh-vaidya/cortx-s3server-1 | f61d4ab8961f53722feb68f233840326715ca47e | [
"Apache-2.0"
] | 1,000 | 2020-09-24T13:10:23.000Z | 2022-03-28T08:19:34.000Z | s3backgrounddelete/s3backgrounddelete/cortx_s3_signal.py | shailesh-vaidya/cortx-s3server-1 | f61d4ab8961f53722feb68f233840326715ca47e | [
"Apache-2.0"
] | 150 | 2020-09-24T14:41:40.000Z | 2022-03-04T05:37:17.000Z | #
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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 ap... | 32.84 | 85 | 0.75944 |
import os
import traceback
import logging
import datetime
import signal
from logging import handlers
from functools import partial
from s3backgrounddelete.cortx_s3_config import CORTXS3Config
class DynamicConfigHandler(object):
def __init__(self,objectx):
sighupArg=objectx
si... | true | true |
1c2c81bebf5a8a85417b4b94ae13c371cd878309 | 7,387 | py | Python | kubernetes/client/models/v1_horizontal_pod_autoscaler_spec.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_horizontal_pod_autoscaler_spec.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_horizontal_pod_autoscaler_spec.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 34.680751 | 179 | 0.656288 |
from pprint import pformat
from six import iteritems
import re
class V1HorizontalPodAutoscalerSpec(object):
swagger_types = {
'max_replicas': 'int',
'min_replicas': 'int',
'scale_target_ref': 'V1CrossVersionObjectReference',
'target_cpu_utilization_percentage': 'int'
}
... | true | true |
1c2c83029d0adf88eed1e205553d2b7f3256f1ec | 73,836 | py | Python | tools/codegen/gen.py | hablb/pytorch | c17bc35f0e4551de300650d4702ebda4f57d77f9 | [
"Intel"
] | 2 | 2022-02-14T13:56:03.000Z | 2022-02-14T13:56:05.000Z | tools/codegen/gen.py | hablb/pytorch | c17bc35f0e4551de300650d4702ebda4f57d77f9 | [
"Intel"
] | null | null | null | tools/codegen/gen.py | hablb/pytorch | c17bc35f0e4551de300650d4702ebda4f57d77f9 | [
"Intel"
] | 1 | 2022-02-10T15:00:33.000Z | 2022-02-10T15:00:33.000Z | import os
from typing import List, Dict, Optional, Tuple, Set, Any, Union, Sequence, TypeVar
from typing_extensions import Literal
import yaml
from collections import OrderedDict, defaultdict, namedtuple
import argparse
import pathlib
import json
from dataclasses import dataclass
from tools.codegen.model import (Argum... | 43.305572 | 128 | 0.643291 | import os
from typing import List, Dict, Optional, Tuple, Set, Any, Union, Sequence, TypeVar
from typing_extensions import Literal
import yaml
from collections import OrderedDict, defaultdict, namedtuple
import argparse
import pathlib
import json
from dataclasses import dataclass
from tools.codegen.model import (Argum... | true | true |
1c2c83d541ec61b48477e9434ffd2529d76000e1 | 720 | py | Python | diplomova_praca/shared/views.py | MDobransky/thesis-grizzly | b038b477596879465636eae34444d70742a86e8f | [
"MIT"
] | 1 | 2020-07-28T18:38:19.000Z | 2020-07-28T18:38:19.000Z | diplomova_praca/shared/views.py | JankaSvK/thesis-grizzly | c0e573cd01008003c7d67e093c698ebf2d668f04 | [
"MIT"
] | 1 | 2020-09-21T21:38:46.000Z | 2020-09-21T21:38:46.000Z | diplomova_praca/shared/views.py | MDobransky/thesis-grizzly | b038b477596879465636eae34444d70742a86e8f | [
"MIT"
] | 1 | 2020-08-20T18:52:13.000Z | 2020-08-20T18:52:13.000Z | from pathlib import Path
from typing import Set
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from diplomova_praca_lib.position_similarity.models import PositionMethod
from diplomova_praca_lib.position_similarity.position_similarity_request import available_images
f... | 31.304348 | 97 | 0.761111 | from pathlib import Path
from typing import Set
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from diplomova_praca_lib.position_similarity.models import PositionMethod
from diplomova_praca_lib.position_similarity.position_similarity_request import available_images
f... | true | true |
1c2c84ba962513758acd36c71af378ec70598821 | 828 | py | Python | paperlims/core/models/experiment_data_file.py | slohr/paperlims | 598899b3a0945d9e7353ba79742bd94798b3e17b | [
"MIT"
] | null | null | null | paperlims/core/models/experiment_data_file.py | slohr/paperlims | 598899b3a0945d9e7353ba79742bd94798b3e17b | [
"MIT"
] | 1 | 2020-06-05T17:32:56.000Z | 2020-06-05T17:32:56.000Z | paperlims/core/models/experiment_data_file.py | slohr/paperlims | 598899b3a0945d9e7353ba79742bd94798b3e17b | [
"MIT"
] | null | null | null | import os.path
from django.db import models
from polymorphic.models import PolymorphicModel
from core.models.base import Base
from core.models.base import UniqueFileSystemStorage
from core import constants
from core.models import Experiment
class ExperimentDataFile(PolymorphicModel,Base):
experiment = models.Foreig... | 25.090909 | 91 | 0.754831 | import os.path
from django.db import models
from polymorphic.models import PolymorphicModel
from core.models.base import Base
from core.models.base import UniqueFileSystemStorage
from core import constants
from core.models import Experiment
class ExperimentDataFile(PolymorphicModel,Base):
experiment = models.Foreig... | true | true |
1c2c85d149efb259a9d59cc01ff04e725439b7a9 | 286 | py | Python | BAEKJOON/Python/2798.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | BAEKJOON/Python/2798.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | BAEKJOON/Python/2798.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | import itertools
#입력부
a,b = map(int,input().split())
lis = list(map(int,input().split()))
#리스트 추가
num = list(itertools.permutations(lis, 3))
final_list = []
#경우의수 다 찾기
for i in range(len(num)):
if sum(num[i]) <= b:
final_list.append(sum(num[i]))
print(max(final_list))
| 15.888889 | 42 | 0.632867 | import itertools
a,b = map(int,input().split())
lis = list(map(int,input().split()))
num = list(itertools.permutations(lis, 3))
final_list = []
for i in range(len(num)):
if sum(num[i]) <= b:
final_list.append(sum(num[i]))
print(max(final_list))
| true | true |
1c2c86346e240ca3d1809f76577a678fc96c78c5 | 142,252 | py | Python | src/oci/ai_anomaly_detection/anomaly_detection_client.py | CentroidChef/oci-python-sdk | fa406e27a52b40c70e220c20f52dfe2abe6236a3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/ai_anomaly_detection/anomaly_detection_client.py | CentroidChef/oci-python-sdk | fa406e27a52b40c70e220c20f52dfe2abe6236a3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/ai_anomaly_detection/anomaly_detection_client.py | CentroidChef/oci-python-sdk | fa406e27a52b40c70e220c20f52dfe2abe6236a3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 48.434457 | 261 | 0.647801 |
from __future__ import absolute_import
from oci._vendor import requests
from oci._vendor import six
from oci import retry, circuit_breaker
from oci.base_client import BaseClient
from oci.config import get_config_value_or_default, validate_config
from oci.signer import Signer
from oci.util import Sentinel, get... | true | true |
1c2c86dbcc5a343b86f1588a38a45c5d4e0e5f59 | 4,341 | py | Python | amatino/entry.py | Amatino-Code/amatino-python | 6c5f66b2e61bede5bf9d3e6eee8130a16f511a5f | [
"MIT"
] | 2 | 2018-07-20T20:00:33.000Z | 2020-10-08T15:49:06.000Z | amatino/entry.py | Amatino-Code/amatino-python | 6c5f66b2e61bede5bf9d3e6eee8130a16f511a5f | [
"MIT"
] | 1 | 2020-05-21T02:49:29.000Z | 2020-05-21T02:49:29.000Z | amatino/entry.py | Amatino-Code/amatino-python | 6c5f66b2e61bede5bf9d3e6eee8130a16f511a5f | [
"MIT"
] | 3 | 2018-09-03T09:31:31.000Z | 2020-05-21T05:30:00.000Z | """
Amatino API Python Bindings
Entry Module
Author: hugh@amatino.io
"""
from amatino.side import Side
from amatino.account import Account
from amatino.internal.constrained_string import ConstrainedString
from amatino.internal.encodable import Encodable
from amatino.internal.immutable import Immutable
from decimal impo... | 30.356643 | 79 | 0.615066 | from amatino.side import Side
from amatino.account import Account
from amatino.internal.constrained_string import ConstrainedString
from amatino.internal.encodable import Encodable
from amatino.internal.immutable import Immutable
from decimal import Decimal
from typing import Dict
from typing import Any
from typing imp... | true | true |
1c2c872739c70760c2acb09a3e43c88a93ad2117 | 1,095 | py | Python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/recovery_point.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/recovery_point.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/recovery_point.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 29.594595 | 117 | 0.593607 |
from msrest.serialization import Model
class RecoveryPoint(Model):
_validation = {
'object_type': {'required': True},
}
_attribute_map = {
'object_type': {'key': 'objectType', 'type': 'str'},
}
_subtype_map = {
'object_type': {'GenericRecoveryPoint': 'GenericR... | true | true |
1c2c884d9cde661100911e4d30b0255ffac3b8d3 | 645 | py | Python | ecom/manage.py | TomSCoding/ecommerce-base | 7057afe83277209fef53fda44e3e8c84afc57bde | [
"MIT"
] | null | null | null | ecom/manage.py | TomSCoding/ecommerce-base | 7057afe83277209fef53fda44e3e8c84afc57bde | [
"MIT"
] | 277 | 2019-10-11T06:58:27.000Z | 2022-03-12T00:50:30.000Z | ecom/manage.py | TomSCoding/ecommerce-base | 7057afe83277209fef53fda44e3e8c84afc57bde | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecom.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... | 29.318182 | 74 | 0.658915 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecom.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and ... | true | true |
1c2c88ca6b1582f01056302f4059664684a16f5a | 121 | py | Python | backend/core/services/__init__.py | devalv/yawm | 9f91b96cf6b9a9a1f2026d514ea24edda117e1ba | [
"MIT"
] | 1 | 2021-12-26T00:10:15.000Z | 2021-12-26T00:10:15.000Z | backend/core/services/__init__.py | devalv/yawm | 9f91b96cf6b9a9a1f2026d514ea24edda117e1ba | [
"MIT"
] | 7 | 2020-11-07T16:42:47.000Z | 2022-01-21T23:51:38.000Z | backend/core/services/__init__.py | devalv/yawm | 9f91b96cf6b9a9a1f2026d514ea24edda117e1ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Project business logic."""
from .web import get_product_name
__all__ = ["get_product_name"]
| 17.285714 | 33 | 0.677686 |
from .web import get_product_name
__all__ = ["get_product_name"]
| true | true |
1c2c8cec61fdb4270ad2b309273d6a5fc2928f1a | 8,463 | py | Python | amfe/mor/hyper_red/ecsw.py | ma-kast/AMfe | 99686cc313fb8904a093fb42e6cf0b38f8cfd791 | [
"BSD-3-Clause"
] | null | null | null | amfe/mor/hyper_red/ecsw.py | ma-kast/AMfe | 99686cc313fb8904a093fb42e6cf0b38f8cfd791 | [
"BSD-3-Clause"
] | null | null | null | amfe/mor/hyper_red/ecsw.py | ma-kast/AMfe | 99686cc313fb8904a093fb42e6cf0b38f8cfd791 | [
"BSD-3-Clause"
] | null | null | null | """
TODO: Write introduction to ECSW
"""
import logging
import numpy as np
from scipy.linalg import solve as linsolve
from scipy.sparse import csc_matrix
from .ecsw_assembly import EcswAssembly
__all__ = ['sparse_nnls',
'ecsw_assemble_G_and_b',
'ecsw_get_weights_by_component',
'Ecs... | 33.717131 | 141 | 0.631455 |
import logging
import numpy as np
from scipy.linalg import solve as linsolve
from scipy.sparse import csc_matrix
from .ecsw_assembly import EcswAssembly
__all__ = ['sparse_nnls',
'ecsw_assemble_G_and_b',
'ecsw_get_weights_by_component',
'EcswAssembly']
def sparse_nnls(G, b, tau, ... | true | true |
1c2c8ddf97baa004278da14041b5822beda019fc | 740 | py | Python | cobl/lexicon/migrations/0120_auto_20161019_1545.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | 3 | 2017-05-30T04:40:43.000Z | 2019-04-25T14:54:54.000Z | cobl/lexicon/migrations/0120_auto_20161019_1545.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | null | null | null | cobl/lexicon/migrations/0120_auto_20161019_1545.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | 3 | 2018-07-02T13:42:12.000Z | 2019-05-17T13:11:13.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lexicon', '0119_remove_cognateclass_loansourceid'),
]
operations = [
migrations.AlterField(
model_name='cognatec... | 28.461538 | 61 | 0.518919 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lexicon', '0119_remove_cognateclass_loansourceid'),
]
operations = [
migrations.AlterField(
model_name='cognateclass',
name... | true | true |
1c2c8eb6ba2fb4178d3ed64ed477ad73d3a1a5ea | 887 | py | Python | watchfolders.py | leith-bartrich/fiellc | 1c02690538f442dede5d6afc8926355cb2ac838e | [
"MIT"
] | null | null | null | watchfolders.py | leith-bartrich/fiellc | 1c02690538f442dede5d6afc8926355cb2ac838e | [
"MIT"
] | null | null | null | watchfolders.py | leith-bartrich/fiellc | 1c02690538f442dede5d6afc8926355cb2ac838e | [
"MIT"
] | null | null | null | from fiepipedesktoplib.gitstorage.shells import Shell as AssetShell, ContainerIDVariableCommand, AssetIDVarCommand, \
RootIDVarCommand
from fiepipedesktoplib.watchfolder.shell.watchfolder import WatchFolderShellApplication as WatcherShell
_CONTAINER_ID = "9341cf7f-5f48-4971-aece-a5f203c23076"
_ROOT_ID = "e00a2013-... | 30.586207 | 117 | 0.78805 | from fiepipedesktoplib.gitstorage.shells import Shell as AssetShell, ContainerIDVariableCommand, AssetIDVarCommand, \
RootIDVarCommand
from fiepipedesktoplib.watchfolder.shell.watchfolder import WatchFolderShellApplication as WatcherShell
_CONTAINER_ID = "9341cf7f-5f48-4971-aece-a5f203c23076"
_ROOT_ID = "e00a2013-... | true | true |
1c2c91a5ae3808e2dbe2282c8d8978e7e8dc1c85 | 100,045 | py | Python | roles/openshift_facts/library/openshift_facts.py | sqtran/openshift-ansible | b06a457440aa929959164ecfc11ce9edf86bdc6a | [
"Apache-2.0"
] | null | null | null | roles/openshift_facts/library/openshift_facts.py | sqtran/openshift-ansible | b06a457440aa929959164ecfc11ce9edf86bdc6a | [
"Apache-2.0"
] | null | null | null | roles/openshift_facts/library/openshift_facts.py | sqtran/openshift-ansible | b06a457440aa929959164ecfc11ce9edf86bdc6a | [
"Apache-2.0"
] | 1 | 2020-12-02T00:39:02.000Z | 2020-12-02T00:39:02.000Z | #!/usr/bin/python
# pylint: disable=too-many-lines
# -*- coding: utf-8 -*-
# Reason: Disable pylint too-many-lines because we don't want to split up this file.
# Status: Permanently disabled to keep this module as self-contained as possible.
"""Ansible module for retrieving and setting openshift related facts"""
# py... | 41.357999 | 129 | 0.57671 |
# Status: Permanently disabled to keep this module as self-contained as possible.
# pylint: disable=no-name-in-module, import-error, wrong-import-order
import copy
import errno
import json
import re
import io
import os
import yaml
import struct
import socket
from distutils.util import strtobool
from distutils.ver... | true | true |
1c2c91ef426018a08e97eb10508fb90a171c6c47 | 5,831 | py | Python | robocorp-python-ls-core/src/robocorp_ls_core/jsonrpc/streams.py | GLMeece/robotframework-lsp | dc9c807c4a192d252df1d05a1c5d16f8c1f24086 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | robocorp-python-ls-core/src/robocorp_ls_core/jsonrpc/streams.py | GLMeece/robotframework-lsp | dc9c807c4a192d252df1d05a1c5d16f8c1f24086 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | robocorp-python-ls-core/src/robocorp_ls_core/jsonrpc/streams.py | GLMeece/robotframework-lsp | dc9c807c4a192d252df1d05a1c5d16f8c1f24086 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Original work Copyright 2018 Palantir Technologies, Inc. (MIT)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file exc... | 34.099415 | 101 | 0.579832 |
import threading
from robocorp_ls_core.robotframework_log import get_logger
from typing import Optional
import json
from robocorp_ls_core.options import BaseOptions
log = get_logger(__name__)
def read(stream) -> Optional[str]:
headers = {}
while True:
line = stream.readline()... | true | true |
1c2c937a1e1b887eac89fb032b256333827e1c88 | 709 | py | Python | online_shop/app/tests/test_product_schema.py | styam/django_graphene | 7ae997bd7e3d8ceae1820f8c9ef69ba16d0c53ee | [
"MIT"
] | 2 | 2021-03-24T10:55:54.000Z | 2021-04-05T12:36:56.000Z | online_shop/app/tests/test_product_schema.py | styam/django_graphene | 7ae997bd7e3d8ceae1820f8c9ef69ba16d0c53ee | [
"MIT"
] | null | null | null | online_shop/app/tests/test_product_schema.py | styam/django_graphene | 7ae997bd7e3d8ceae1820f8c9ef69ba16d0c53ee | [
"MIT"
] | null | null | null | from django.test import TestCase
import pytest
from graphene.test import Client
from mixer.backend.django import mixer
from app.models import Product
from app.tests.schema_format import (product_query_list, )
from online_shop.schema import schema
@pytest.mark.django_db
class TestProduct(TestCase):
def setUp(sel... | 28.36 | 72 | 0.675599 | from django.test import TestCase
import pytest
from graphene.test import Client
from mixer.backend.django import mixer
from app.models import Product
from app.tests.schema_format import (product_query_list, )
from online_shop.schema import schema
@pytest.mark.django_db
class TestProduct(TestCase):
def setUp(sel... | true | true |
1c2c9484e694e8a751c4dd47aed3cf1de2b9f7ef | 1,065 | py | Python | 2020-09-01-1054-gma_my_scara_funcs.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-01-1054-gma_my_scara_funcs.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-01-1054-gma_my_scara_funcs.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 31 11:14:43 2020
@author: Georg Maubach
"""
# Ab Python 3.8 müssen dlls als vertrauenswürdig markiert werden.
# Deshalb ab 3.8.x von den unteren beiden Anweisungen den
# Kommentar entfernen und den Pfad zum Projektverzeichnis
# korrekt angeben
import os
... | 22.659574 | 79 | 0.646009 |
import os
os.add_dll_directory("D:\Selfcoding\WillmsBis040920\scara64anaconda")
os.environ['QT_PLUGIN_PATH'] = "D:\Selfcoding\WillmsBis040920\scara64anaconda"
import ctypes
Scara = ctypes.cdll.scara
def gehe2():
Scara.gehe();
Scara.gehe();
def gehe3():
... | true | true |
1c2c95e73bc880ae001b0144521b1da015427cdf | 1,950 | py | Python | strawberry/aiohttp/handlers/graphql_transport_ws_handler.py | TheVinhLuong102/Strawberry | 3c442dc19d17bc55c4e26de1db7a9eedc0a228f5 | [
"MIT"
] | 2,062 | 2019-04-07T17:47:30.000Z | 2022-03-31T01:54:16.000Z | strawberry/aiohttp/handlers/graphql_transport_ws_handler.py | TheVinhLuong102/Strawberry | 3c442dc19d17bc55c4e26de1db7a9eedc0a228f5 | [
"MIT"
] | 1,582 | 2019-04-07T18:31:33.000Z | 2022-03-31T18:32:13.000Z | strawberry/aiohttp/handlers/graphql_transport_ws_handler.py | TheVinhLuong102/Strawberry | 3c442dc19d17bc55c4e26de1db7a9eedc0a228f5 | [
"MIT"
] | 303 | 2019-04-13T08:44:40.000Z | 2022-03-29T09:54:41.000Z | from datetime import timedelta
from typing import Any
from aiohttp import http, web
from strawberry.schema import BaseSchema
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL
from strawberry.subscriptions.protocols.graphql_transport_ws.handlers import (
BaseGraphQLTransportWSHandler,
)
class Gra... | 35.454545 | 83 | 0.680513 | from datetime import timedelta
from typing import Any
from aiohttp import http, web
from strawberry.schema import BaseSchema
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL
from strawberry.subscriptions.protocols.graphql_transport_ws.handlers import (
BaseGraphQLTransportWSHandler,
)
class Gra... | true | true |
1c2c9673239875aebecc14562678e37ce6ad98b8 | 1,827 | py | Python | test/parser/unit_operators/testcases/Reciprocal/Reciprocal_generator.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 223 | 2020-04-15T20:34:33.000Z | 2022-03-28T05:41:49.000Z | test/parser/unit_operators/testcases/Reciprocal/Reciprocal_generator.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 42 | 2019-07-29T15:57:12.000Z | 2020-04-08T15:12:48.000Z | test/parser/unit_operators/testcases/Reciprocal/Reciprocal_generator.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 58 | 2019-07-22T11:46:19.000Z | 2020-04-09T22:56:41.000Z |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not ... | 38.87234 | 92 | 0.747126 |
import os, sys
import numpy as np
separator = os.path.sep
from onnx import *
sys.path.append(".."+separator+".."+separator+".."+separator+".."+separator+"python/parser")
from onnx_parser import *
op_name = 'Reciprocal'
inputs = [helper.make_tensor_value_info("X",TensorProto.FLOAT,(1,2))]
outp... | true | true |
1c2c968d6375a6da31f54444f303b6cd1847f7a9 | 41,031 | py | Python | pyasdf/block.py | mdboom/pyasdf | ac4e9f85bf96206fdd6bc3d0708875c953c66dc5 | [
"BSD-3-Clause"
] | null | null | null | pyasdf/block.py | mdboom/pyasdf | ac4e9f85bf96206fdd6bc3d0708875c953c66dc5 | [
"BSD-3-Clause"
] | null | null | null | pyasdf/block.py | mdboom/pyasdf | ac4e9f85bf96206fdd6bc3d0708875c953c66dc5 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
from collections import namedtuple
import copy
import hashlib
import io
import os
import re
import struct
import weakref
import numpy as np
impor... | 33.304383 | 85 | 0.569959 |
from __future__ import absolute_import, division, unicode_literals, print_function
from collections import namedtuple
import copy
import hashlib
import io
import os
import re
import struct
import weakref
import numpy as np
import six
from six.moves.urllib import parse as urlparse
import yaml
from . import compr... | true | true |
1c2c97d6680a3f3e3a80c84d1ae03684c0396467 | 22,260 | py | Python | pandas/core/reshape/concat.py | kpflugshaupt/pandas | c9e3883c630c48b17218e6bcc5593720c1402bf1 | [
"BSD-3-Clause"
] | 2 | 2021-04-07T13:56:06.000Z | 2021-04-12T13:45:23.000Z | pandas/core/reshape/concat.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/reshape/concat.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | 3 | 2018-01-08T08:40:55.000Z | 2019-10-07T02:02:40.000Z | """
concat routines
"""
import numpy as np
import pandas.core.dtypes.concat as _concat
from pandas import DataFrame, Index, MultiIndex, Series, compat
from pandas.core import common as com
from pandas.core.arrays.categorical import (
_factorize_from_iterable, _factorize_from_iterables)
from pandas.core.generic i... | 35 | 79 | 0.545058 |
import numpy as np
import pandas.core.dtypes.concat as _concat
from pandas import DataFrame, Index, MultiIndex, Series, compat
from pandas.core import common as com
from pandas.core.arrays.categorical import (
_factorize_from_iterable, _factorize_from_iterables)
from pandas.core.generic import NDFrame
from panda... | true | true |
1c2c9846bb530c6a7db2bfeffeaf52ece44cd30d | 1,050 | py | Python | arcade/python/arcade-theCore/06_LabyrinthOfNestedLoops/047_ComfortableNumbers.py | netor27/codefights-arcade-solutions | 69701ab06d45902c79ec9221137f90b75969d8c8 | [
"MIT"
] | null | null | null | arcade/python/arcade-theCore/06_LabyrinthOfNestedLoops/047_ComfortableNumbers.py | netor27/codefights-arcade-solutions | 69701ab06d45902c79ec9221137f90b75969d8c8 | [
"MIT"
] | null | null | null | arcade/python/arcade-theCore/06_LabyrinthOfNestedLoops/047_ComfortableNumbers.py | netor27/codefights-arcade-solutions | 69701ab06d45902c79ec9221137f90b75969d8c8 | [
"MIT"
] | null | null | null | def comfortableNumbers(l, r):
'''
Let's say that number a feels comfortable with number b if a ≠ b and b lies in the segment [a - s(a), a + s(a)], where s(x) is the sum of x's digits.
How many pairs (a, b) are there, such that a < b, both a and b lie on the segment [l, r], and each number feels comfortable wit... | 32.8125 | 153 | 0.599048 | def comfortableNumbers(l, r):
result = 0
for a in range(l, r):
sa = sumOfDigits(a)
for b in range(a + 1, min(r + 1, a + sa + 1)):
sb = sumOfDigits(b)
if b - a <= sb:
result += 1
return result
def sumOfDigits(n):
return sum([int(i) for i i... | true | true |
1c2c98cf381d25134cbbe5eeac3bcfb00b4e0d3a | 608 | py | Python | rank/urls.py | shvedovskiy/web_technopolis | 430d7e74fb87870e369ca615294116c63a51ff25 | [
"WTFPL"
] | null | null | null | rank/urls.py | shvedovskiy/web_technopolis | 430d7e74fb87870e369ca615294116c63a51ff25 | [
"WTFPL"
] | 1 | 2016-12-02T17:02:23.000Z | 2016-12-02T17:02:23.000Z | rank/urls.py | shvedovskiy/web_technopolis | 430d7e74fb87870e369ca615294116c63a51ff25 | [
"WTFPL"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = 'rank'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^about/$', views.about, name='about'),
url(r'^add_category', views.add_category, name='add_category'),
url(r'^category/(?P<category_name_slug>[\w\-]+)/$', views.category, ... | 40.533333 | 98 | 0.646382 | from django.conf.urls import url
from . import views
app_name = 'rank'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^about/$', views.about, name='about'),
url(r'^add_category', views.add_category, name='add_category'),
url(r'^category/(?P<category_name_slug>[\w\-]+)/$', views.category, ... | true | true |
1c2c99328ec43c52455f8910f49b6adb1e526a0d | 26,618 | py | Python | pipe-cli/src/model/data_storage_wrapper.py | AlfiyaRF/cloud-pipeline | 532c02a7e88928f42b28be87545aab93db404df5 | [
"Apache-2.0"
] | null | null | null | pipe-cli/src/model/data_storage_wrapper.py | AlfiyaRF/cloud-pipeline | 532c02a7e88928f42b28be87545aab93db404df5 | [
"Apache-2.0"
] | null | null | null | pipe-cli/src/model/data_storage_wrapper.py | AlfiyaRF/cloud-pipeline | 532c02a7e88928f42b28be87545aab93db404df5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 39.787743 | 119 | 0.63164 |
import os
from abc import abstractmethod, ABCMeta
from ftplib import FTP, error_temp
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urlparse
import click
import requests
import sys
from ..api.data_storage import DataStorage
from ..config import ConfigNot... | true | true |
1c2c9c7a1cf5617662b1acb6b67cef04aa34ecdd | 2,839 | py | Python | tests/test_lyaps.py | neurophysik/jitcdde | 44d7ed6ad187d3591407155b6eeb063f73e462cd | [
"BSD-3-Clause"
] | 49 | 2016-10-24T10:00:33.000Z | 2022-03-27T11:03:51.000Z | tests/test_lyaps.py | neurophysik/jitcdde | 44d7ed6ad187d3591407155b6eeb063f73e462cd | [
"BSD-3-Clause"
] | 45 | 2016-11-20T22:05:07.000Z | 2022-03-29T07:13:25.000Z | tests/test_lyaps.py | neurophysik/jitcdde | 44d7ed6ad187d3591407155b6eeb063f73e462cd | [
"BSD-3-Clause"
] | 11 | 2016-11-14T07:19:16.000Z | 2022-03-16T14:27:06.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import platform
import unittest
import numpy as np
from scipy.stats import sem
from jitcdde import t, y, jitcdde_lyap
if platform.system() == "Windows":
compile_args = None
else:
from jitcxde_common import DEFAULT_COMPILE_ARGS
compile_args = DEFAULT_COMPILE_ARGS+["-g","-... | 28.676768 | 75 | 0.695315 |
import platform
import unittest
import numpy as np
from scipy.stats import sem
from jitcdde import t, y, jitcdde_lyap
if platform.system() == "Windows":
compile_args = None
else:
from jitcxde_common import DEFAULT_COMPILE_ARGS
compile_args = DEFAULT_COMPILE_ARGS+["-g","-UNDEBUG"]
omega = np.array([0.88167179, ... | true | true |
1c2c9d6642125c20bd9273e257de3b216516ac79 | 5,707 | py | Python | ch15/train-project/train_schedule/views/main.py | kxen42/Learn-Python-Programming-Third-Edition | 851ddc5e6094fadd44f31a9ad1d3876456b04372 | [
"MIT"
] | 19 | 2021-11-05T22:54:09.000Z | 2022-03-29T15:03:47.000Z | ch15/train-project/train_schedule/views/main.py | kxen42/Learn-Python-Programming-Third-Edition | 851ddc5e6094fadd44f31a9ad1d3876456b04372 | [
"MIT"
] | null | null | null | ch15/train-project/train_schedule/views/main.py | kxen42/Learn-Python-Programming-Third-Edition | 851ddc5e6094fadd44f31a9ad1d3876456b04372 | [
"MIT"
] | 26 | 2021-11-12T17:04:50.000Z | 2022-03-29T01:10:35.000Z | # train-project/train_schedule/views/main.py
import tkinter as tk
from contextlib import contextmanager
from tkinter import messagebox, ttk
from .. import APP_TITLE
from ..resources import load_binary_resource
from .stations import StationChooser
from .trains import TrainsView
ICON_FILENAME = "icon.png"
@contextman... | 29.569948 | 66 | 0.599439 |
import tkinter as tk
from contextlib import contextmanager
from tkinter import messagebox, ttk
from .. import APP_TITLE
from ..resources import load_binary_resource
from .stations import StationChooser
from .trains import TrainsView
ICON_FILENAME = "icon.png"
@contextmanager
def show_error():
try:
yiel... | true | true |
1c2c9d8d053412ea306c9a10e0d6652d47090acf | 855 | py | Python | account/migrations/0004_auto_20171002_1918.py | natotthomer/nattr | f3f7b1bc67ff05f346e7f221d7f88b8500bd8e77 | [
"MIT"
] | 1 | 2017-11-10T19:55:12.000Z | 2017-11-10T19:55:12.000Z | account/migrations/0004_auto_20171002_1918.py | natotthomer/nattr | f3f7b1bc67ff05f346e7f221d7f88b8500bd8e77 | [
"MIT"
] | 9 | 2021-03-08T20:46:52.000Z | 2022-03-11T23:26:33.000Z | account/migrations/0004_auto_20171002_1918.py | natotthomer/nattr | f3f7b1bc67ff05f346e7f221d7f88b8500bd8e77 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-02 19:18
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0003_auto_20170... | 30.535714 | 138 | 0.667836 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0003_auto_20170922_1544'),
]
operations = [
migrations.AlterField(
... | true | true |
1c2c9eed7b32e658c90b6a2885b2e30dd90f1dbc | 2,702 | py | Python | multinet/api/views/common.py | multinet-app/multinet-api | a658d787f0fb9ba415ed85a1e37c29953486287f | [
"Apache-2.0"
] | null | null | null | multinet/api/views/common.py | multinet-app/multinet-api | a658d787f0fb9ba415ed85a1e37c29953486287f | [
"Apache-2.0"
] | 91 | 2021-03-15T19:00:15.000Z | 2022-03-11T00:04:05.000Z | multinet/api/views/common.py | multinet-app/multinet-api | a658d787f0fb9ba415ed85a1e37c29953486287f | [
"Apache-2.0"
] | 1 | 2022-02-05T15:53:04.000Z | 2022-02-05T15:53:04.000Z | from typing import Dict, List
from arango.cursor import Cursor
from django.http.response import Http404
from django.shortcuts import get_object_or_404
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.request import Request
from rest_framework_extensions.mixins import NestedViewSetMixin
... | 33.358025 | 96 | 0.703923 | from typing import Dict, List
from arango.cursor import Cursor
from django.http.response import Http404
from django.shortcuts import get_object_or_404
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.request import Request
from rest_framework_extensions.mixins import NestedViewSetMixin
... | true | true |
1c2c9f83b71d4721f0a4459f61f84fd422ec0d20 | 4,817 | py | Python | google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_image_object_detection.py | nachocano/python-aiplatform | 1c6b998d9145309d79712f494a2b00b50a9a9bf4 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_image_object_detection.py | nachocano/python-aiplatform | 1c6b998d9145309d79712f494a2b00b50a9a9bf4 | [
"Apache-2.0"
] | 1 | 2021-02-12T23:56:38.000Z | 2021-02-12T23:56:38.000Z | google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_image_object_detection.py | nachocano/python-aiplatform | 1c6b998d9145309d79712f494a2b00b50a9a9bf4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.341085 | 155 | 0.688188 |
import proto
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1.schema.trainingjob.definition",
manifest={
"AutoMlImageObjectDetection",
"AutoMlImageObjectDetectionInputs",
"AutoMlImageObjectDetectionMetadata",
},
)
class AutoMlImageObjectDetectio... | true | true |
1c2ca03875f2f69020ef92da8bca31da599ca215 | 921 | py | Python | examples/feature_selection/plot_rfe_digits.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 23 | 2020-04-15T14:02:00.000Z | 2022-03-10T23:17:32.000Z | examples/feature_selection/plot_rfe_digits.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 29 | 2021-03-04T02:56:48.000Z | 2021-04-06T04:06:45.000Z | examples/feature_selection/plot_rfe_digits.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 18 | 2020-04-15T14:22:33.000Z | 2022-02-16T06:48:34.000Z | """
=============================
Recursive feature elimination
=============================
A recursive feature elimination example showing the relevance of pixels in
a digit classification task.
.. note::
See also :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`
"""
print(__d... | 24.891892 | 94 | 0.724213 | print(__doc__)
from sklearn.svm import SVC
from sklearn.datasets import load_digits
from sklearn.feature_selection import RFE
import matplotlib.pyplot as plt
digits = load_digits()
X = digits.images.reshape((len(digits.images), -1))
y = digits.target
svc = SVC(kernel="linear", C=1)
rfe = RFE(estimator=svc, n_featu... | true | true |
1c2ca105ffaace5c78f7b401dd5af0da9c9e6ff1 | 8,162 | py | Python | control_algorithm/adaptive_tau.py | arj119/adaptive-federated-learning | c7e949bfcfd9a166780f5be838141d51016a7673 | [
"MIT"
] | 94 | 2020-04-14T02:42:26.000Z | 2022-03-23T13:54:31.000Z | control_algorithm/adaptive_tau.py | PengchaoHan/adaptive-federated-learning | 6c22d65c3a46a0b293dc5ddd4cd579f6010445f5 | [
"MIT"
] | 2 | 2021-12-10T07:46:44.000Z | 2022-01-19T23:39:30.000Z | control_algorithm/adaptive_tau.py | PengchaoHan/adaptive-federated-learning | 6c22d65c3a46a0b293dc5ddd4cd579f6010445f5 | [
"MIT"
] | 44 | 2020-05-07T16:25:04.000Z | 2022-03-24T10:48:26.000Z | import math
import numpy as np
from numpy import linalg
from util.utils import recv_msg, send_msg, moving_average
from config import tau_max
class ControlAlgAdaptiveTauServer:
def __init__(self, is_adapt_local, dim_w, client_sock_all, n_nodes, control_param_phi,
moving_average_holding_param):
... | 43.414894 | 131 | 0.633301 | import math
import numpy as np
from numpy import linalg
from util.utils import recv_msg, send_msg, moving_average
from config import tau_max
class ControlAlgAdaptiveTauServer:
def __init__(self, is_adapt_local, dim_w, client_sock_all, n_nodes, control_param_phi,
moving_average_holding_param):
... | true | true |
1c2ca250665e6de8aba306124ca10a854862961b | 13,468 | py | Python | magenta/models/music_vae/trained_model.py | veskoch/magenta | 74f16be4341925341617699dffdbddadd747acad | [
"Apache-2.0"
] | 5 | 2018-07-11T02:39:40.000Z | 2020-09-07T19:26:46.000Z | magenta/models/music_vae/trained_model.py | veskoch/magenta | 74f16be4341925341617699dffdbddadd747acad | [
"Apache-2.0"
] | 1 | 2022-02-11T19:01:43.000Z | 2022-02-11T19:01:56.000Z | magenta/models/music_vae/trained_model.py | veskoch/magenta | 74f16be4341925341617699dffdbddadd747acad | [
"Apache-2.0"
] | 2 | 2018-07-11T13:36:19.000Z | 2018-09-01T03:42:04.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 39.964392 | 80 | 0.676938 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import re
import numpy as np
import tensorflow as tf
class NoExtractedExamplesException(Exception):
pass
class MultipleExtractedExamplesException(Exception):
pass
class Trai... | true | true |
1c2ca31a29d1b7f2731163603636af4932896ea7 | 411 | py | Python | examples/flava/data/__init__.py | facebookresearch/multimodal | 13e60d9b4e421d1d5304e861cf4e54c3e376c7f1 | [
"BSD-3-Clause"
] | 128 | 2022-03-24T21:54:28.000Z | 2022-03-31T20:15:41.000Z | examples/flava/data/__init__.py | facebookresearch/multimodal | 13e60d9b4e421d1d5304e861cf4e54c3e376c7f1 | [
"BSD-3-Clause"
] | 2 | 2022-03-28T20:58:38.000Z | 2022-03-31T18:43:43.000Z | examples/flava/data/__init__.py | facebookresearch/multimodal | 13e60d9b4e421d1d5304e861cf4e54c3e376c7f1 | [
"BSD-3-Clause"
] | 3 | 2022-03-25T13:34:02.000Z | 2022-03-30T21:57:04.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from .transforms import * # noqa F401
from .utils import * # noqa F401
from .imagenet_zeroshot_data import * ... | 34.25 | 71 | 0.742092 |
from .transforms import *
from .utils import *
from .imagenet_zeroshot_data import *
from .multitask import *
from .datamodules import *
| true | true |
1c2ca48001838c748ecda70e87d40f377105808a | 3,231 | py | Python | cloudify/tests/mocks/mock_rest_client.py | isaac-s/cloudify-common | 9f512a7e0b96bfdf7c4448fc1bddacf2ae577ba8 | [
"Apache-2.0"
] | null | null | null | cloudify/tests/mocks/mock_rest_client.py | isaac-s/cloudify-common | 9f512a7e0b96bfdf7c4448fc1bddacf2ae577ba8 | [
"Apache-2.0"
] | null | null | null | cloudify/tests/mocks/mock_rest_client.py | isaac-s/cloudify-common | 9f512a7e0b96bfdf7c4448fc1bddacf2ae577ba8 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... | 24.477273 | 78 | 0.629836 |
_client import CloudifyClient
from cloudify_rest_client.executions import Execution
from cloudify_rest_client.node_instances import NodeInstance
node_instances = {}
def put_node_instance(node_instance_id,
state='started',
runtime_properties=None,
... | true | true |
1c2ca5caff5ef0a6f27869b1cd2cf147940affc7 | 3,960 | py | Python | alipay/aop/api/request/AlipayCommerceYuntaskResumeRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceYuntaskResumeRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceYuntaskResumeRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceYuntaskResumeModel import AlipayCommerceYuntaskResumeModel
class AlipayCommerceYuntaskResumeRequest(object):
def ... | 27.310345 | 148 | 0.643939 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceYuntaskResumeModel import AlipayCommerceYuntaskResumeModel
class AlipayCommerceYuntaskResumeRequest(object):
def __init__(self, biz_model=None):
self... | true | true |
1c2ca6bd4627da89353bbf6e0e73bd6a23178cc2 | 11,633 | py | Python | tests/test_maths/test_period.py | wjjmjh/Cogent3-GitHub-CI | c79c82c4b51f56be50f1079ddcdfcffaccaf80dd | [
"BSD-3-Clause"
] | null | null | null | tests/test_maths/test_period.py | wjjmjh/Cogent3-GitHub-CI | c79c82c4b51f56be50f1079ddcdfcffaccaf80dd | [
"BSD-3-Clause"
] | null | null | null | tests/test_maths/test_period.py | wjjmjh/Cogent3-GitHub-CI | c79c82c4b51f56be50f1079ddcdfcffaccaf80dd | [
"BSD-3-Clause"
] | null | null | null | from numpy import arange, array, convolve, exp, float64, pi, random, sin, zeros
from cogent3.maths.period import _autocorr_inner2 as py_autocorr_inner
from cogent3.maths.period import _goertzel_inner as py_goertzel_inner
from cogent3.maths.period import _ipdft_inner2 as py_ipdft_inner
from cogent3.maths.period import ... | 32.135359 | 79 | 0.458265 | from numpy import arange, array, convolve, exp, float64, pi, random, sin, zeros
from cogent3.maths.period import _autocorr_inner2 as py_autocorr_inner
from cogent3.maths.period import _goertzel_inner as py_goertzel_inner
from cogent3.maths.period import _ipdft_inner2 as py_ipdft_inner
from cogent3.maths.period import ... | true | true |
1c2ca72ba0a51bfb6047dce162693e6840c202cc | 1,589 | py | Python | stonesoup/simulator/platform.py | SohSalari/Stone-Soup | e073d4145df18facad43e4ab7b0a34e8d65f67ee | [
"MIT"
] | 1 | 2020-07-21T15:20:20.000Z | 2020-07-21T15:20:20.000Z | stonesoup/simulator/platform.py | mgomesborges/Stone-Soup | 39c7f02ce11e10c9b3c612ad359f6d8bca495266 | [
"MIT"
] | null | null | null | stonesoup/simulator/platform.py | mgomesborges/Stone-Soup | 39c7f02ce11e10c9b3c612ad359f6d8bca495266 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ..base import Property
from ..reader import GroundTruthReader
from .base import DetectionSimulator
from ..buffered_generator import BufferedGenerator
from ..platform import Platform
class PlatformDetectionSimulator(DetectionSimulator):
"""A simple platform detection simulator.
P... | 37.833333 | 79 | 0.582127 |
from ..base import Property
from ..reader import GroundTruthReader
from .base import DetectionSimulator
from ..buffered_generator import BufferedGenerator
from ..platform import Platform
class PlatformDetectionSimulator(DetectionSimulator):
groundtruth = Property(GroundTruthReader,
do... | true | true |
1c2ca80e2a0454be3248cf10b328f2d2d86dfa74 | 420 | py | Python | Lab_6/data/core/myservices/__init__.py | Opty1337/CN | bc01cf39bcc017783fdbb84ebd7958f405511e6c | [
"MIT"
] | null | null | null | Lab_6/data/core/myservices/__init__.py | Opty1337/CN | bc01cf39bcc017783fdbb84ebd7958f405511e6c | [
"MIT"
] | null | null | null | Lab_6/data/core/myservices/__init__.py | Opty1337/CN | bc01cf39bcc017783fdbb84ebd7958f405511e6c | [
"MIT"
] | null | null | null | """myservices
Custom services that you define can be put in this directory. Everything
listed in __all__ is automatically loaded when you add this directory to the
custom_services_dir = '/full/path/to/here' core.conf file option.
"""
__all__ = ["trafficdump", "pcpingweb01", "linkadsl_u128k", "linkadsl_u256k", "linkad... | 52.5 | 183 | 0.77381 | __all__ = ["trafficdump", "pcpingweb01", "linkadsl_u128k", "linkadsl_u256k", "linkadsl_u512k", "linkadsl_u768k", "linkadsl_u1024k", "linkbw4g_u5800k", "linkcable_u8000k", "simplenat"]
| true | true |
1c2ca9762c3d53a7dac08a120f7e7e60f5b4c3d4 | 1,783 | py | Python | ejercicios_basicos/trabajo_bd/capa_datos/conexion.py | JuanDuran85/ejemplos_python | 47aa49c65384ab89654f362f3da6cd2b0ef386e5 | [
"Apache-2.0"
] | null | null | null | ejercicios_basicos/trabajo_bd/capa_datos/conexion.py | JuanDuran85/ejemplos_python | 47aa49c65384ab89654f362f3da6cd2b0ef386e5 | [
"Apache-2.0"
] | null | null | null | ejercicios_basicos/trabajo_bd/capa_datos/conexion.py | JuanDuran85/ejemplos_python | 47aa49c65384ab89654f362f3da6cd2b0ef386e5 | [
"Apache-2.0"
] | null | null | null | import os
from dotenv import load_dotenv
import psycopg2 as db
from logger_base import log
import sys
load_dotenv()
class Conexion:
__DATABASE = os.getenv("DATABASE")
__USER = os.getenv("USER")
__PASSWORD = os.getenv("PASSWORD")
__HOST = os.getenv("HOST")
__PORT = os.getenv("PORT")
__conexion ... | 28.758065 | 74 | 0.55244 | import os
from dotenv import load_dotenv
import psycopg2 as db
from logger_base import log
import sys
load_dotenv()
class Conexion:
__DATABASE = os.getenv("DATABASE")
__USER = os.getenv("USER")
__PASSWORD = os.getenv("PASSWORD")
__HOST = os.getenv("HOST")
__PORT = os.getenv("PORT")
__conexion ... | true | true |
1c2cabc15b13e8b192fbcc58d43bd1df785b5832 | 2,542 | py | Python | xsboringen/scripts/write_csv.py | TheFrett/xsboringen | 92283809ca5dcf03dac661720a683a90dc2ff9f7 | [
"MIT"
] | null | null | null | xsboringen/scripts/write_csv.py | TheFrett/xsboringen | 92283809ca5dcf03dac661720a683a90dc2ff9f7 | [
"MIT"
] | null | null | null | xsboringen/scripts/write_csv.py | TheFrett/xsboringen | 92283809ca5dcf03dac661720a683a90dc2ff9f7 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Tom van Steijn, Royal HaskoningDHV
# Erik van Onselen, Deltares
from xsboringen.calc import SandmedianClassifier, AdmixClassifier, LithologyClassifier
from xsboringen.csvfiles import boreholes_to_csv
from xsboringen.datasources import boreholes_from_sources
import logg... | 33.012987 | 99 | 0.659717 |
from xsboringen.calc import SandmedianClassifier, AdmixClassifier, LithologyClassifier
from xsboringen.csvfiles import boreholes_to_csv
from xsboringen.datasources import boreholes_from_sources
import logging
import os
from pathlib import Path
log = logging.getLogger(os.path.basename(__file__))
def write_csv(*... | true | true |
1c2caeae83a815434c4484e3d791719568404912 | 899 | py | Python | UserPage/migrations/0006_blog.py | MidnightMadne33/Image-Blog | 8d47f2c52edb28bda5c6920c4b6e5bd1f6f2a9a0 | [
"CC0-1.0"
] | null | null | null | UserPage/migrations/0006_blog.py | MidnightMadne33/Image-Blog | 8d47f2c52edb28bda5c6920c4b6e5bd1f6f2a9a0 | [
"CC0-1.0"
] | null | null | null | UserPage/migrations/0006_blog.py | MidnightMadne33/Image-Blog | 8d47f2c52edb28bda5c6920c4b6e5bd1f6f2a9a0 | [
"CC0-1.0"
] | null | null | null | # Generated by Django 2.1.7 on 2019-02-27 12:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('UserPage', '0005_userpro... | 33.296296 | 122 | 0.628476 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('UserPage', '0005_userprofile'),
]
operations = [
migra... | true | true |
1c2caf06b51d860afd23f610a0fe74e12a962b13 | 1,818 | py | Python | tests/db_functions/test_pad.py | shinshin86/django | 5cc81cd9eb69f5f7a711412c02039b435c393135 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2020-11-04T06:26:42.000Z | 2021-01-17T19:29:52.000Z | tests/db_functions/test_pad.py | Blaahborgh/django | c591bc3ccece1514d6b419826c7fa36ada9d9213 | [
"PSF-2.0",
"BSD-3-Clause"
] | 55 | 2016-02-27T06:02:24.000Z | 2021-11-01T07:53:20.000Z | tests/db_functions/test_pad.py | Blaahborgh/django | c591bc3ccece1514d6b419826c7fa36ada9d9213 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2018-12-10T03:06:36.000Z | 2018-12-10T03:06:36.000Z | from django.db.models import CharField, Value
from django.db.models.functions import Length, LPad, RPad
from django.test import TestCase
from .models import Author
class PadTests(TestCase):
def test_pad(self):
Author.objects.create(name='John', alias='j')
tests = (
(LPad('name', 7, Va... | 40.4 | 105 | 0.558856 | from django.db.models import CharField, Value
from django.db.models.functions import Length, LPad, RPad
from django.test import TestCase
from .models import Author
class PadTests(TestCase):
def test_pad(self):
Author.objects.create(name='John', alias='j')
tests = (
(LPad('name', 7, Va... | true | true |
1c2cafa5f1cc4b99111eb6eeaa125eabbbaaeecd | 451 | py | Python | pyfmodex/studio/library.py | CDanSantana/pyfmodex | d820712a9a5203e2e2a2547e29f9e9a02f404282 | [
"MIT"
] | null | null | null | pyfmodex/studio/library.py | CDanSantana/pyfmodex | d820712a9a5203e2e2a2547e29f9e9a02f404282 | [
"MIT"
] | null | null | null | pyfmodex/studio/library.py | CDanSantana/pyfmodex | d820712a9a5203e2e2a2547e29f9e9a02f404282 | [
"MIT"
] | null | null | null | import os
import platform
from ctypes import cdll, windll
arch = platform.architecture()[0]
if os.name == 'nt':
library_type = windll
library_name = "fmodstudio"
elif os.name == "posix":
library_type = cdll
library_name = "libfmodstudio.so"
library = None
de... | 25.055556 | 56 | 0.634146 | import os
import platform
from ctypes import cdll, windll
arch = platform.architecture()[0]
if os.name == 'nt':
library_type = windll
library_name = "fmodstudio"
elif os.name == "posix":
library_type = cdll
library_name = "libfmodstudio.so"
library = None
de... | true | true |
1c2cafbe43b10c7240262483e1ca414130be2c4f | 8,586 | py | Python | mmedit/apis/matting_inference.py | wchstrife/mmediting | 2a90254b677cc505df0d36a182ae710188804221 | [
"Apache-2.0"
] | null | null | null | mmedit/apis/matting_inference.py | wchstrife/mmediting | 2a90254b677cc505df0d36a182ae710188804221 | [
"Apache-2.0"
] | null | null | null | mmedit/apis/matting_inference.py | wchstrife/mmediting | 2a90254b677cc505df0d36a182ae710188804221 | [
"Apache-2.0"
] | null | null | null | import mmcv
import torch
from mmcv.parallel import collate, scatter
from mmcv.runner import load_checkpoint
from mmedit.datasets.pipelines import Compose
from mmedit.models import build_model
def init_model(config, checkpoint=None, device='cuda:0'):
"""Initialize a model from config file.
Args:
conf... | 37.168831 | 97 | 0.626834 | import mmcv
import torch
from mmcv.parallel import collate, scatter
from mmcv.runner import load_checkpoint
from mmedit.datasets.pipelines import Compose
from mmedit.models import build_model
def init_model(config, checkpoint=None, device='cuda:0'):
if isinstance(config, str):
config = mmcv.Config.fromfi... | true | true |
1c2cb026677ecd7fe2cd08ad013b73f4da6d44cf | 34,995 | py | Python | mars/dataframe/indexing/tests/test_indexing.py | Focke-Wulf/mars | 7fbe1c7ef2f7e55455811ec511b68294546d04dc | [
"Apache-2.0"
] | 1 | 2020-11-05T05:53:00.000Z | 2020-11-05T05:53:00.000Z | mars/dataframe/indexing/tests/test_indexing.py | Focke-Wulf/mars | 7fbe1c7ef2f7e55455811ec511b68294546d04dc | [
"Apache-2.0"
] | null | null | null | mars/dataframe/indexing/tests/test_indexing.py | Focke-Wulf/mars | 7fbe1c7ef2f7e55455811ec511b68294546d04dc | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 47.03629 | 111 | 0.624861 |
import numpy as np
import pandas as pd
import mars.dataframe as md
import mars.tensor as mt
from mars.tensor.core import TENSOR_CHUNK_TYPE, Tensor
from mars.tests.core import TestBase
from mars.dataframe.core import SERIES_CHUNK_TYPE, Series, DataFrame, DATAFRAME_CHUNK_TYPE
from mars.dataframe.indexing.i... | true | true |
1c2cb0851d7ae12834f1df33acbb334bc02d9efe | 1,907 | py | Python | tensorflow_addons/utils/types.py | leondgarse/addons | 6c512e1ec49ae14ca61f1bbf0fd3403204ba21e2 | [
"Apache-2.0"
] | 1,560 | 2018-11-26T23:57:34.000Z | 2022-03-27T10:37:34.000Z | tensorflow_addons/utils/types.py | leondgarse/addons | 6c512e1ec49ae14ca61f1bbf0fd3403204ba21e2 | [
"Apache-2.0"
] | 2,067 | 2018-11-28T04:40:23.000Z | 2022-03-31T11:36:50.000Z | tensorflow_addons/utils/types.py | leondgarse/addons | 6c512e1ec49ae14ca61f1bbf0fd3403204ba21e2 | [
"Apache-2.0"
] | 679 | 2018-11-27T14:39:25.000Z | 2022-03-31T10:09:22.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... | 30.269841 | 85 | 0.695857 |
from typing import Union, Callable, List
import numpy as np
import tensorflow as tf
if tf.__version__[:3] > "2.5":
from keras.engine import keras_tensor
else:
from tensorflow.python.keras.engine import keras_tensor
Number = Union[
float,
int,
np.float16,
np.float32,
np.fl... | true | true |
1c2cb09439a11a7a92dc1017034e4a2e9a57e03f | 1,476 | py | Python | app/pizzas/serializers.py | jmorakuebler/tdp-pizza-api | 3920919701d41cf75296e1081cf4defb85fad468 | [
"MIT"
] | null | null | null | app/pizzas/serializers.py | jmorakuebler/tdp-pizza-api | 3920919701d41cf75296e1081cf4defb85fad468 | [
"MIT"
] | null | null | null | app/pizzas/serializers.py | jmorakuebler/tdp-pizza-api | 3920919701d41cf75296e1081cf4defb85fad468 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from pizzas import models
class IngredientSerializer(serializers.ModelSerializer):
"""Serializador para el objeto Ingredient"""
class Meta:
model = models.Ingredient
fields = ('id', 'name', 'get_category_display', 'category')
read_only_fields = (... | 32.8 | 70 | 0.705962 | from rest_framework import serializers
from pizzas import models
class IngredientSerializer(serializers.ModelSerializer):
class Meta:
model = models.Ingredient
fields = ('id', 'name', 'get_category_display', 'category')
read_only_fields = ('id', 'get_category_display')
extra_kwarg... | true | true |
1c2cb0bcd2f2e830ce4e0630d46c7f42a87405bb | 8,194 | py | Python | hacksHookz.py | malxcolm/fontsontiktok | 19ea5bb09c2d1310741d09aacb7a6cd4ba06dcf2 | [
"Apache-2.0"
] | null | null | null | hacksHookz.py | malxcolm/fontsontiktok | 19ea5bb09c2d1310741d09aacb7a6cd4ba06dcf2 | [
"Apache-2.0"
] | null | null | null | hacksHookz.py | malxcolm/fontsontiktok | 19ea5bb09c2d1310741d09aacb7a6cd4ba06dcf2 | [
"Apache-2.0"
] | null | null | null | import os
if os.name != "nt":
exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from datetime import datetime
from threading import Thread
from time import sleep
from sys import argv
print("[= ... | 21.118557 | 546 | 0.545521 | import os
if os.name != "nt":
exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from datetime import datetime
from threading import Thread
from time import sleep
from sys import argv
print("[= ... | true | true |
1c2cb33a1468285aeaaae12a0018473695336db0 | 6,746 | py | Python | source/speechViewer.py | riku22/nvdajp | 66a828ea89d317e4aa0ad2aed4b3b1e08920afb6 | [
"bzip2-1.0.6"
] | 19 | 2016-05-11T05:15:31.000Z | 2022-03-17T12:40:10.000Z | source/speechViewer.py | riku22/nvdajp | 66a828ea89d317e4aa0ad2aed4b3b1e08920afb6 | [
"bzip2-1.0.6"
] | 307 | 2015-08-27T11:22:33.000Z | 2022-03-29T10:43:34.000Z | source/speechViewer.py | riku22/nvdajp | 66a828ea89d317e4aa0ad2aed4b3b1e08920afb6 | [
"bzip2-1.0.6"
] | 14 | 2016-03-28T07:31:49.000Z | 2022-03-30T04:56:35.000Z | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2021 NV Access Limited, Thomas Stivers, Accessolutions, Julien Cochuyt
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
import wx
import gui
import config
from logHandler import log
from speech i... | 35.882979 | 126 | 0.739401 |
import wx
import gui
import config
from logHandler import log
from speech import SpeechSequence
import gui.contextHelp
class SpeechViewerFrame(
gui.contextHelp.ContextHelpMixin,
wx.Frame
):
helpId = "SpeechViewer"
def _getDialogSizeAndPosition(self):
dialogSize = wx.Size(500, 500)
... | true | true |
1c2cb653021515a9f97f09004e4f0b9df55007c7 | 2,498 | py | Python | MyGallery/models.py | CharityMutonii/Gallery | d691f4bf77e97fc0a15ab88ecb9ebedb9fb378e7 | [
"MIT"
] | null | null | null | MyGallery/models.py | CharityMutonii/Gallery | d691f4bf77e97fc0a15ab88ecb9ebedb9fb378e7 | [
"MIT"
] | null | null | null | MyGallery/models.py | CharityMutonii/Gallery | d691f4bf77e97fc0a15ab88ecb9ebedb9fb378e7 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Category(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=50)
def __str__(self):
'''
method to display category
'''
return self.name
def save_category(self):
... | 26.020833 | 75 | 0.599279 | from django.db import models
class Category(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=50)
def __str__(self):
return self.name
def save_category(self):
return self.save()
def delete_category(self):
return self.delete()
... | true | true |
1c2cb6e17eb3f8b50d0763004077686a348c73c0 | 931 | py | Python | skpr/nn/_functions/Broadcast.py | PhilippPelz/scikit-pr-open | 50833b13160b6afe0a743d63d560bddeee2c18b5 | [
"MIT"
] | null | null | null | skpr/nn/_functions/Broadcast.py | PhilippPelz/scikit-pr-open | 50833b13160b6afe0a743d63d560bddeee2c18b5 | [
"MIT"
] | null | null | null | skpr/nn/_functions/Broadcast.py | PhilippPelz/scikit-pr-open | 50833b13160b6afe0a743d63d560bddeee2c18b5 | [
"MIT"
] | 1 | 2020-11-11T06:51:46.000Z | 2020-11-11T06:51:46.000Z | import torch as th
from torch.autograd import Function
import skpr.inout as io
class Broadcast(Function):
@staticmethod
def forward(ctx, input, ntimes, divide_by_ntimes=True):
io.logger.debug('Broadcast forward 1')
# out = input.clone()
# print 'Broadcast.forward'
ctx.ntimes ... | 33.25 | 73 | 0.64232 | import torch as th
from torch.autograd import Function
import skpr.inout as io
class Broadcast(Function):
@staticmethod
def forward(ctx, input, ntimes, divide_by_ntimes=True):
io.logger.debug('Broadcast forward 1')
ctx.ntimes = ntimes
ctx.divide_by_ntimes = divide_b... | true | true |
1c2cb7258d8fcc35b83be82c862143d79ad2662f | 616 | py | Python | set1/hexToBase64.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | set1/hexToBase64.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | set1/hexToBase64.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | def hex_to_base64( hex ):
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
bits = ''
for i in range(len(hex)):
mid = bin(int(hex[i], 16)).replace('0b', '')
while len(mid) != 4:
mid = '0' + mid
bits += mid
while (len(bits) % 6 != 0):
... | 26.782609 | 78 | 0.525974 | def hex_to_base64( hex ):
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
bits = ''
for i in range(len(hex)):
mid = bin(int(hex[i], 16)).replace('0b', '')
while len(mid) != 4:
mid = '0' + mid
bits += mid
while (len(bits) % 6 != 0):
... | true | true |
1c2cb729a908d342f3ee9e0af387a71cf22e743f | 24,354 | py | Python | lib/galaxy/managers/users.py | ashvark/galaxy | 71d315cf3692b4a42fb684395a519d53f360ec92 | [
"CC-BY-3.0"
] | 1 | 2019-07-27T19:30:55.000Z | 2019-07-27T19:30:55.000Z | lib/galaxy/managers/users.py | ashvark/galaxy | 71d315cf3692b4a42fb684395a519d53f360ec92 | [
"CC-BY-3.0"
] | 2 | 2019-08-19T07:43:52.000Z | 2022-03-02T04:46:54.000Z | lib/galaxy/managers/users.py | ashvark/galaxy | 71d315cf3692b4a42fb684395a519d53f360ec92 | [
"CC-BY-3.0"
] | 1 | 2019-03-21T16:35:07.000Z | 2019-03-21T16:35:07.000Z | """
Manager and Serializer for Users.
"""
import logging
import random
import socket
from datetime import datetime
from markupsafe import escape
from sqlalchemy import and_, desc, exc, func, true
from galaxy import (
exceptions,
model,
util
)
from galaxy.managers import (
api_keys,
base,
delet... | 42.207972 | 402 | 0.61686 | import logging
import random
import socket
from datetime import datetime
from markupsafe import escape
from sqlalchemy import and_, desc, exc, func, true
from galaxy import (
exceptions,
model,
util
)
from galaxy.managers import (
api_keys,
base,
deletable
)
from galaxy.security.validate_user_... | true | true |
1c2cb830d024d7ea119b1306188a13f8ae5948df | 2,779 | py | Python | aoc_cas/aoc2020/day11.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | 1 | 2020-11-30T19:17:50.000Z | 2020-11-30T19:17:50.000Z | aoc_cas/aoc2020/day11.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | null | null | null | aoc_cas/aoc2020/day11.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | null | null | null | FLOOR = "."
EMPTY = "L"
OCCUPIED = "#"
def tick(grid, rule, seatsToConnected):
Y, X = len(grid), len(grid[0])
newGrid = [row.copy() for row in grid]
totalSeatOccupied = 0
for coord, connected in seatsToConnected.items():
nearbyOccupied = sum(grid[y][x] == OCCUPIED for y, x in connected)
... | 30.877778 | 86 | 0.528967 | FLOOR = "."
EMPTY = "L"
OCCUPIED = "#"
def tick(grid, rule, seatsToConnected):
Y, X = len(grid), len(grid[0])
newGrid = [row.copy() for row in grid]
totalSeatOccupied = 0
for coord, connected in seatsToConnected.items():
nearbyOccupied = sum(grid[y][x] == OCCUPIED for y, x in connected)
... | true | true |
1c2cb8c075809655ec7ef0f7be5a20ec98d758c7 | 117 | py | Python | python_teste/python_aulas/aula_25.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | 1 | 2020-07-27T14:18:08.000Z | 2020-07-27T14:18:08.000Z | python_teste/python_aulas/aula_25.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | null | null | null | python_teste/python_aulas/aula_25.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | null | null | null | nome = str(input('Qual seu nome completo? ')).strip()
print('Seu nome tem Silva? {}'.format('SILVA' in nome.upper())) | 58.5 | 63 | 0.666667 | nome = str(input('Qual seu nome completo? ')).strip()
print('Seu nome tem Silva? {}'.format('SILVA' in nome.upper())) | true | true |
1c2cb8e49b96fe48c28fbd234c1b58fd0fec13be | 58 | py | Python | app/routes/__init__.py | Luca-A-Magalhaes/himcd | 56c939bb077485adb8a75b37bf0655e1087bbfa4 | [
"MIT"
] | 2 | 2021-02-15T21:02:12.000Z | 2021-10-14T19:05:34.000Z | app/routes/__init__.py | Luca-A-Magalhaes/himcd | 56c939bb077485adb8a75b37bf0655e1087bbfa4 | [
"MIT"
] | null | null | null | app/routes/__init__.py | Luca-A-Magalhaes/himcd | 56c939bb077485adb8a75b37bf0655e1087bbfa4 | [
"MIT"
] | null | null | null | from app.routes.api import *
from app.routes.page import * | 29 | 29 | 0.775862 | from app.routes.api import *
from app.routes.page import * | true | true |
1c2cb9bd63e02cac23d2ce815fd9f657d9817cc4 | 254 | py | Python | manage.py | davidjrichardson/toucans | 7446b78ec2a09ff90eb83d4a78638c909deb06e1 | [
"MIT"
] | 1 | 2020-04-20T05:37:09.000Z | 2020-04-20T05:37:09.000Z | manage.py | davidjrichardson/toucans | 7446b78ec2a09ff90eb83d4a78638c909deb06e1 | [
"MIT"
] | 23 | 2019-03-13T10:54:36.000Z | 2022-03-11T23:33:59.000Z | manage.py | davidjrichardson/toucans | 7446b78ec2a09ff90eb83d4a78638c909deb06e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toucans.settings.dev")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.090909 | 75 | 0.771654 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toucans.settings.dev")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c2cba610a91053010dfd5163babc396c61a094a | 3,579 | py | Python | PyFinance/main.py | allangbr/PyFinance | 58d236259b232992bec8afe0ebcae4caae103fe3 | [
"MIT"
] | 1 | 2021-01-20T17:39:47.000Z | 2021-01-20T17:39:47.000Z | PyFinance/main.py | allangbr/PyFinance | 58d236259b232992bec8afe0ebcae4caae103fe3 | [
"MIT"
] | null | null | null | PyFinance/main.py | allangbr/PyFinance | 58d236259b232992bec8afe0ebcae4caae103fe3 | [
"MIT"
] | null | null | null | import funcoes as func
func.verificarArquivoReceitas()
func.verificarArquivoDespesas()
func.verificarArquivoPagamentos()
func.verificarArquivoCarteira()
func.verificarArquivoContas()
func.verificarArquivoSaques()
func.verificarArquivoDepositos()
func.verificarArquivoTransferencias()
resp = ""
while resp != "0":
res... | 28.862903 | 77 | 0.822856 | import funcoes as func
func.verificarArquivoReceitas()
func.verificarArquivoDespesas()
func.verificarArquivoPagamentos()
func.verificarArquivoCarteira()
func.verificarArquivoContas()
func.verificarArquivoSaques()
func.verificarArquivoDepositos()
func.verificarArquivoTransferencias()
resp = ""
while resp != "0":
res... | true | true |
1c2cbb99091c9b3b0b32f4456810926200fcb2db | 5,545 | py | Python | zkSNARK/my_pysnark/zkinterface/Circuit.py | grakshith/zk-priv-vote | 648c1d8c90ea67ffc480376840abcf258810991e | [
"MIT"
] | null | null | null | zkSNARK/my_pysnark/zkinterface/Circuit.py | grakshith/zk-priv-vote | 648c1d8c90ea67ffc480376840abcf258810991e | [
"MIT"
] | null | null | null | zkSNARK/my_pysnark/zkinterface/Circuit.py | grakshith/zk-priv-vote | 648c1d8c90ea67ffc480376840abcf258810991e | [
"MIT"
] | 1 | 2021-03-01T08:41:35.000Z | 2021-03-01T08:41:35.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: zkinterface
import flatbuffers
# /// A description of a circuit or sub-circuit.
# /// This can be a complete circuit ready for proving,
# /// or a part of a circuit being built.
class Circuit(object):
__slots__ = ['_tab']
@cla... | 42.984496 | 157 | 0.692516 |
import flatbuffers
class Circuit(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsCircuit(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Circuit()
x.Init(buf, n + offset)
return x
def Init(self, buf, pos):
... | true | true |
1c2cbbd49f12b2029d185b0b136b5281a6fe2462 | 132 | py | Python | tests/all.py | MacHu-GWU/docfly-project | 9fdba29290d6b856a6b42dc4194f937d3e1e9326 | [
"MIT"
] | 27 | 2016-05-31T20:24:24.000Z | 2021-01-13T07:06:54.000Z | tests/s4_api/all.py | MacHu-GWU/learn_mongoengine-project | abad18032e8183859c12dc0b08942a96641538fe | [
"MIT"
] | 2 | 2018-01-31T19:32:03.000Z | 2018-01-31T20:32:33.000Z | tests/all.py | MacHu-GWU/picage-project | d5172b79c4561a553bc608da13405d8f85e20be8 | [
"MIT"
] | 18 | 2016-09-02T09:56:46.000Z | 2019-05-08T02:41:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == "__main__":
import pytest
pytest.main(["-s", "--tb=native"])
| 16.5 | 38 | 0.560606 |
if __name__ == "__main__":
import pytest
pytest.main(["-s", "--tb=native"])
| true | true |
1c2cbdf0a461ff50bc83d8475b0b5a81c5dc8076 | 87,704 | py | Python | pysnmp/RLE-FALCON-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/RLE-FALCON-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/RLE-FALCON-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module RLE-FALCON-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RLE-FALCON-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:49:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 130.511905 | 10,128 | 0.764013 |
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuild... | true | true |
1c2cbe68ab282adbdc53a934704dba7d236fc71d | 177 | py | Python | pyeccodes/defs/mars/grib_enfh_icp_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/mars/grib_enfh_pf_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/mars/grib_enfh_pf_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | import pyeccodes.accessors as _
def load(h):
h.alias('mars.hdate', 'dataDate')
h.alias('mars.date', 'referenceDate')
h.alias('mars.number', 'perturbationNumber')
| 19.666667 | 48 | 0.672316 | import pyeccodes.accessors as _
def load(h):
h.alias('mars.hdate', 'dataDate')
h.alias('mars.date', 'referenceDate')
h.alias('mars.number', 'perturbationNumber')
| true | true |
1c2cbedcb423f26700da2934e9ec94f26ab289ff | 99,243 | py | Python | airflow/providers/google/cloud/operators/bigquery.py | pchico83/airflow | e3e8f502fe318862fed0795141e3d8281e283e6b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-05-28T13:30:38.000Z | 2020-05-28T13:30:38.000Z | airflow/providers/google/cloud/operators/bigquery.py | Sri-nidhi/Airflow | 86ad628158eb728e56c817eea2bea4ddcaa571c2 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/google/cloud/operators/bigquery.py | Sri-nidhi/Airflow | 86ad628158eb728e56c817eea2bea4ddcaa571c2 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-05T07:36:36.000Z | 2021-11-10T17:32:39.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 42.520566 | 109 | 0.669357 |
import enum
import hashlib
import json
import re
import uuid
import warnings
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Sequence, Set, SupportsAbs, Union
import attr
from google.api_core.exceptions import Conflict
from google.cloud.bigquery import TableRefe... | true | true |
1c2cbf15826a996a1947210df20821f4e3e41bb5 | 840 | py | Python | migrations/0021_auto_20160910_2144.py | jrandson/RememberTheCheese | 2d5d6752046650106bbf3e7e9c20c9efad9e700d | [
"MIT"
] | null | null | null | migrations/0021_auto_20160910_2144.py | jrandson/RememberTheCheese | 2d5d6752046650106bbf3e7e9c20c9efad9e700d | [
"MIT"
] | null | null | null | migrations/0021_auto_20160910_2144.py | jrandson/RememberTheCheese | 2d5d6752046650106bbf3e7e9c20c9efad9e700d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-09-10 21:44
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('rememberTheCheese', '0020_auto_20160910_2... | 30 | 136 | 0.641667 |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('rememberTheCheese', '0020_auto_20160910_2140'),
]
operations = [
migrations.AlterField(
... | true | true |
1c2cbf4cdf2f8864641caba9691bf5de28a27646 | 1,643 | py | Python | src/larcv3/app/imagemod/test/test_CropROI.py | zhulcher/larcv3 | 26d1ad33f0c27ddf6bb2c56bc0238aeaddcb772b | [
"MIT"
] | 14 | 2017-10-19T15:08:29.000Z | 2021-03-31T21:21:07.000Z | src/larcv3/app/imagemod/test/test_CropROI.py | zhulcher/larcv3 | 26d1ad33f0c27ddf6bb2c56bc0238aeaddcb772b | [
"MIT"
] | 34 | 2019-05-15T13:33:10.000Z | 2022-03-22T17:54:49.000Z | src/larcv3/app/imagemod/test/test_CropROI.py | zhulcher/larcv3 | 26d1ad33f0c27ddf6bb2c56bc0238aeaddcb772b | [
"MIT"
] | 16 | 2017-12-07T12:04:40.000Z | 2021-11-15T00:53:31.000Z | from larcv import larcv
from colored_msg import colored_msg as cmsg
import os, sys
larcv.logger.force_level(0)
#
# Constants
#
MSG_LEVEL=larcv.msg.kERROR
if 'debug' in sys.argv:
MSG_LEVEL = larcv.msg.kDEBUG
if 'info' in sys.argv:
MSG_LEVEL = larcv.msg.kINFO
OUT_FNAME="croproi.root"
NUM_EVENT=1
ERROR_FILE_EXI... | 24.893939 | 69 | 0.685332 | from larcv import larcv
from colored_msg import colored_msg as cmsg
import os, sys
larcv.logger.force_level(0)
MSG_LEVEL=larcv.msg.kERROR
if 'debug' in sys.argv:
MSG_LEVEL = larcv.msg.kDEBUG
if 'info' in sys.argv:
MSG_LEVEL = larcv.msg.kINFO
OUT_FNAME="croproi.root"
NUM_EVENT=1
ERROR_FILE_EXIST = 1
E... | true | true |
1c2cc00dcbadfc3b16eb935075aa55c13af58b40 | 259 | py | Python | douban/douban/__init__.py | fourierrr/Crawler | 63abc990cf5d1ee8fd3027c9c5f609e98c4fa06b | [
"Apache-2.0"
] | null | null | null | douban/douban/__init__.py | fourierrr/Crawler | 63abc990cf5d1ee8fd3027c9c5f609e98c4fa06b | [
"Apache-2.0"
] | null | null | null | douban/douban/__init__.py | fourierrr/Crawler | 63abc990cf5d1ee8fd3027c9c5f609e98c4fa06b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Nessaj
# @Date: 2018-04-04 23:08:36
# @Last Modified by: Nessaj
# @Last Modified time: 2018-04-07 11:38:10
BOT_NAME = 'douban'
SPIDER_MODULES = ['douban.spiders']
NEWSPIDER_MODULE = 'douban.spiders'
DOWNLOAD_DELAY = 2
| 21.583333 | 42 | 0.675676 |
BOT_NAME = 'douban'
SPIDER_MODULES = ['douban.spiders']
NEWSPIDER_MODULE = 'douban.spiders'
DOWNLOAD_DELAY = 2
| true | true |
1c2cc134d84ed2afa98d398383c927965b9c3b0e | 1,183 | py | Python | src/japronto/response/py.py | devblack/japronto | 3016bd659047c76aa8f4431d304ba678d4c12a7f | [
"MIT"
] | 1 | 2021-08-18T05:42:12.000Z | 2021-08-18T05:42:12.000Z | src/japronto/response/py.py | devblack/japronto | 3016bd659047c76aa8f4431d304ba678d4c12a7f | [
"MIT"
] | null | null | null | src/japronto/response/py.py | devblack/japronto | 3016bd659047c76aa8f4431d304ba678d4c12a7f | [
"MIT"
] | null | null | null | _responses = None
def factory(status_code=200, text='', mime_type='text/plain',
encoding='utf-8'):
global _responses
if _responses is None:
_responses = [Response() for _ in range(100)]
response = _responses.pop()
response.status_code = status_code
response.mime_type = mime_t... | 26.886364 | 82 | 0.602705 | _responses = None
def factory(status_code=200, text='', mime_type='text/plain',
encoding='utf-8'):
global _responses
if _responses is None:
_responses = [Response() for _ in range(100)]
response = _responses.pop()
response.status_code = status_code
response.mime_type = mime_t... | true | true |
1c2cc168d3eec7f525221d461b8001bccd8f43a1 | 64,551 | py | Python | Tensorflow/labelImg/labelImg.py | KevzPeter/Signify-Sign-Language-Speech-Converter | facfbb33ab2540e26124e3ca96142caaa57480e3 | [
"MIT"
] | null | null | null | Tensorflow/labelImg/labelImg.py | KevzPeter/Signify-Sign-Language-Speech-Converter | facfbb33ab2540e26124e3ca96142caaa57480e3 | [
"MIT"
] | null | null | null | Tensorflow/labelImg/labelImg.py | KevzPeter/Signify-Sign-Language-Speech-Converter | facfbb33ab2540e26124e3ca96142caaa57480e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import codecs
import distutils.spawn
import os.path
import platform
import re
import sys
import subprocess
from functools import partial
from collections import defaultdict
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.Qt... | 40.118707 | 169 | 0.6102 |
import argparse
import codecs
import distutils.spawn
import os.path
import platform
import re
import sys
import subprocess
from functools import partial
from collections import defaultdict
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
except ImportError:
... | true | true |
1c2cc1ba216c583d4886860a8ada7e287c0932c6 | 13,343 | py | Python | tensorflow_datasets/translate/opus.py | ChAnYaNG97/datasets | 0a45e2ea98716d325fc1c5e5494f2575f3bdb908 | [
"Apache-2.0"
] | 1 | 2020-10-11T19:15:49.000Z | 2020-10-11T19:15:49.000Z | tensorflow_datasets/translate/opus.py | ChAnYaNG97/datasets | 0a45e2ea98716d325fc1c5e5494f2575f3bdb908 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/translate/opus.py | ChAnYaNG97/datasets | 0a45e2ea98716d325fc1c5e5494f2575f3bdb908 | [
"Apache-2.0"
] | 1 | 2020-08-03T20:19:12.000Z | 2020-08-03T20:19:12.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 51.717054 | 1,652 | 0.562092 |
import os
from absl import logging
import tensorflow.compat.v2 as tf
import tensorflow_datasets.public_api as tfds
_CITATION = """
@inproceedings{Tiedemann2012ParallelData,
author = {Tiedemann, J},
title = {Parallel Data, Tools and Interfaces in OPUS},
booktitle = {LREC}
year = {2012}}
"""
_DE... | true | true |
1c2cc24b8fafab54aaa4c0912bcd55b0fd7489ec | 14,237 | py | Python | pants-plugins/src/python/internal_backend/sitegen/tasks/sitegen.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 1 | 2018-12-10T21:31:02.000Z | 2018-12-10T21:31:02.000Z | pants-plugins/src/python/internal_backend/sitegen/tasks/sitegen.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 2 | 2016-10-13T21:37:42.000Z | 2018-07-20T20:14:33.000Z | pants-plugins/src/python/internal_backend/sitegen/tasks/sitegen.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 1 | 2018-03-08T22:21:44.000Z | 2018-03-08T22:21:44.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import collections
i... | 35.240099 | 144 | 0.667416 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import collections
import json
import os
import re
import shutil
from datetime import datetime
from pystache import Renderer
from six.moves import range
from pan... | true | true |
1c2cc2599266bdbbccd6dcc6f5d4e36a7d6f337b | 498 | py | Python | tests/integration_tests/contours_tests/test_reverse.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 7 | 2020-05-07T08:13:44.000Z | 2021-12-17T07:33:51.000Z | tests/integration_tests/contours_tests/test_reverse.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 17 | 2019-11-29T23:17:26.000Z | 2020-12-20T15:47:17.000Z | tests/integration_tests/contours_tests/test_reverse.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 1 | 2020-12-17T22:44:21.000Z | 2020-12-17T22:44:21.000Z | from typing import Tuple
from hypothesis import given
from tests.bind_tests.hints import BoundContour
from tests.integration_tests.utils import are_bound_ported_contours_equal
from tests.port_tests.hints import PortedContour
from . import strategies
@given(strategies.contours_pairs)
def test_basic(contours_pair: Tu... | 26.210526 | 74 | 0.813253 | from typing import Tuple
from hypothesis import given
from tests.bind_tests.hints import BoundContour
from tests.integration_tests.utils import are_bound_ported_contours_equal
from tests.port_tests.hints import PortedContour
from . import strategies
@given(strategies.contours_pairs)
def test_basic(contours_pair: Tu... | true | true |
1c2cc40caa7a9f62496b4447c40f1d27ede16221 | 984 | py | Python | sdks/bkapi-client-core/tests/conftest.py | shabbywu/bkpaas-python-sdk | a9422906707429454ff162f7e39a697260a63d6c | [
"MIT"
] | 17 | 2021-08-03T03:15:35.000Z | 2022-03-18T06:10:04.000Z | sdks/bkapi-client-core/tests/conftest.py | piglei/bkpaas-python-sdk | 3dfea8be5702ccea1228691c6c1c3e87a27238d2 | [
"MIT"
] | 7 | 2021-08-03T07:10:12.000Z | 2022-03-23T04:47:22.000Z | sdks/bkapi-client-core/tests/conftest.py | piglei/bkpaas-python-sdk | 3dfea8be5702ccea1228691c6c1c3e87a27238d2 | [
"MIT"
] | 9 | 2021-08-03T03:20:36.000Z | 2022-03-08T13:47:50.000Z | # -*- coding: utf-8 -*-
"""
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available.
* Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in co... | 41 | 118 | 0.769309 |
import os
import pytest
from bkapi_client_core.config import settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.django_settings")
@pytest.fixture(autouse=True)
def core_settings():
settings.reset()
return settings
| true | true |
1c2cc47dddb6be2c5055de2dde433d58cdc9780a | 11,207 | py | Python | yt_dlp/extractor/animelab.py | jeroenj/yt-dlp | 11078c6d571673a0f09e21933f4ad1e6fcc35456 | [
"Unlicense"
] | 1 | 2022-03-26T15:43:50.000Z | 2022-03-26T15:43:50.000Z | yt_dlp/extractor/animelab.py | jeroenj/yt-dlp | 11078c6d571673a0f09e21933f4ad1e6fcc35456 | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/animelab.py | jeroenj/yt-dlp | 11078c6d571673a0f09e21933f4ad1e6fcc35456 | [
"Unlicense"
] | 2 | 2022-01-05T08:23:25.000Z | 2022-03-06T21:33:37.000Z | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
urlencode_postdata,
int_or_none,
str_or_none,
determine_ext,
)
from ..compat import compat_HTTPError
class AnimeLabBaseIE(InfoExtractor):
_LOGIN_URL = 'https://www... | 40.168459 | 170 | 0.563309 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
urlencode_postdata,
int_or_none,
str_or_none,
determine_ext,
)
from ..compat import compat_HTTPError
class AnimeLabBaseIE(InfoExtractor):
_LOGIN_URL = 'https://www.animelab.com/l... | true | true |
1c2cc70c8a4b2ec67143b45dcd2223f54ae38d97 | 6,369 | py | Python | fHDHR_web/api/tuners.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | 2 | 2021-11-21T18:45:35.000Z | 2022-01-11T16:11:48.000Z | fHDHR_web/api/tuners.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | null | null | null | fHDHR_web/api/tuners.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | null | null | null | from flask import Response, request, redirect, abort, stream_with_context, session
import urllib.parse
import uuid
import json
from fHDHR.exceptions import TunerError
class Tuners():
endpoints = ["/api/tuners"]
endpoint_name = "api_tuners"
endpoint_methods = ["GET", "POST"]
def __init__(self, fhdhr)... | 43.326531 | 136 | 0.576857 | from flask import Response, request, redirect, abort, stream_with_context, session
import urllib.parse
import uuid
import json
from fHDHR.exceptions import TunerError
class Tuners():
endpoints = ["/api/tuners"]
endpoint_name = "api_tuners"
endpoint_methods = ["GET", "POST"]
def __init__(self, fhdhr)... | true | true |
1c2cc77d829397c44bab480b94841a27a072d9a0 | 2,969 | py | Python | env/Lib/site-packages/github/InputFileContent.py | nitish21/fork-repo-app | 78992f061c0e5e46f95858df0fbf8478d1a5c716 | [
"MIT"
] | 1 | 2020-08-13T12:21:56.000Z | 2020-08-13T12:21:56.000Z | env/Lib/site-packages/github/InputFileContent.py | nitish21/fork-repo-app | 78992f061c0e5e46f95858df0fbf8478d1a5c716 | [
"MIT"
] | 6 | 2020-12-17T09:37:03.000Z | 2020-12-18T04:42:23.000Z | venv/lib/python3.7/site-packages/github/InputFileContent.py | bhaving07/pyup | 17ad21a2957c5cce91ad0cf5f75853a3182806d2 | [
"MIT"
] | 1 | 2020-08-13T12:21:58.000Z | 2020-08-13T12:21:58.000Z | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | 49.483333 | 80 | 0.453351 | true | true | |
1c2cc85e2a3657c90e7a5b9afc08c030f80a0c7c | 3,447 | py | Python | plots/plot_utils_mb.py | jackwilkinson255/mbmpo_master | e9e0eaf542c7895764dcb0bfee28752818124ff2 | [
"MIT"
] | 28 | 2018-11-15T14:14:23.000Z | 2022-01-10T01:53:43.000Z | plots/plot_utils_mb.py | hongzimao/model_ensemble_meta_learning | 8b1351df94dfe530efaff1118022315c8d877774 | [
"MIT"
] | 3 | 2019-05-05T23:39:01.000Z | 2021-06-15T15:28:06.000Z | plots/plot_utils_mb.py | hongzimao/model_ensemble_meta_learning | 8b1351df94dfe530efaff1118022315c8d877774 | [
"MIT"
] | 14 | 2018-11-15T16:47:02.000Z | 2021-05-28T14:58:01.000Z | import numpy as np
from rllab.misc.ext import flatten
from pprint import pprint
from collections import OrderedDict, defaultdict
def filter(exps_data, filters={}):
print("before filtering", len(exps_data), 'exps')
keep_array = []
if filters:
for i, exp in enumerate(exps_data):
keep_arra... | 40.552941 | 166 | 0.575573 | import numpy as np
from rllab.misc.ext import flatten
from pprint import pprint
from collections import OrderedDict, defaultdict
def filter(exps_data, filters={}):
print("before filtering", len(exps_data), 'exps')
keep_array = []
if filters:
for i, exp in enumerate(exps_data):
keep_arra... | true | true |
1c2cc94600336b641b10100f3b693833a810a703 | 2,298 | py | Python | setup.py | H-Shay/python-canonicaljson | b28486228619e10530edead41ba59be50bd7aad1 | [
"Apache-2.0"
] | 27 | 2015-11-28T21:24:45.000Z | 2022-03-04T17:13:04.000Z | setup.py | H-Shay/python-canonicaljson | b28486228619e10530edead41ba59be50bd7aad1 | [
"Apache-2.0"
] | 36 | 2016-08-23T19:17:00.000Z | 2022-03-04T15:48:37.000Z | setup.py | H-Shay/python-canonicaljson | b28486228619e10530edead41ba59be50bd7aad1 | [
"Apache-2.0"
] | 12 | 2016-04-07T10:06:23.000Z | 2022-02-28T12:30:35.000Z | #!/usr/bin/env python
# Copyright 2015 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 32.828571 | 77 | 0.681897 |
from setuptools import setup
from codecs import open
import os
here = os.path.abspath(os.path.dirname(__file__))
def read_file(path_segments):
file_path = os.path.join(here, *path_segments)
with open(file_path, encoding="utf-8") as f:
return f.read()
def exec_file(path_segments, na... | true | true |
1c2cca35a74332f377244398859324b2bdc9ec2d | 3,732 | py | Python | tests/test_documentation.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | tests/test_documentation.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | tests/test_documentation.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | """tests/test_documentation.py.
Tests the documentation generation capibilities integrated into Hug
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software with... | 38.474227 | 112 | 0.715702 | import sys
import json
import hug
from falcon import Request
from falcon.testing import StartResponseMock, create_environ
api = sys.modules[__name__]
def test_basic_documentation():
@hug.get()
def hello_world():
return "Hello World!"
@hug.post()
def echo(text):
return text
@hug.... | true | true |
1c2cca974cf1dcfdfefeff96f2e21d26308fae81 | 421 | py | Python | mme/construct_payload.py | arunprsh/SageMaker-Load-Testing | 94c09520f9e8d63a936749af474efbc5de18c719 | [
"Apache-2.0"
] | 12 | 2021-01-20T04:35:06.000Z | 2022-03-02T14:48:45.000Z | mme/construct_payload.py | C24IO/SageMaker-Load-Testing | f1efbe63f7e7bdfa8c0ea2c13ff544f94231fe8e | [
"Apache-2.0"
] | null | null | null | mme/construct_payload.py | C24IO/SageMaker-Load-Testing | f1efbe63f7e7bdfa8c0ea2c13ff544f94231fe8e | [
"Apache-2.0"
] | 3 | 2021-04-14T18:29:33.000Z | 2021-12-08T18:58:12.000Z | headers = 'id,text,filename__v,format__v,size__v,charsize,pages__v'
id_ = '31011'
text = """Investigational Product Accountability Log
"""
filename__v = 'foo.docx'
format__v = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
size__v = '16290'
charsize = '768'
pages__v = '1'
row = ','.join([... | 28.066667 | 86 | 0.738717 | headers = 'id,text,filename__v,format__v,size__v,charsize,pages__v'
id_ = '31011'
text = """Investigational Product Accountability Log
"""
filename__v = 'foo.docx'
format__v = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
size__v = '16290'
charsize = '768'
pages__v = '1'
row = ','.join([... | true | true |
1c2ccb41874d89447182b59e9eb3225355995335 | 756 | py | Python | webinspect/__init__.py | hqlian007/AndroidUISpy | 58bef1c590182baea0de91b2eecc68c3255a6f72 | [
"BSD-3-Clause"
] | null | null | null | webinspect/__init__.py | hqlian007/AndroidUISpy | 58bef1c590182baea0de91b2eecc68c3255a6f72 | [
"BSD-3-Clause"
] | null | null | null | webinspect/__init__.py | hqlian007/AndroidUISpy | 58bef1c590182baea0de91b2eecc68c3255a6f72 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. Yo... | 44.470588 | 89 | 0.739418 | true | true | |
1c2ccd2404baa48459d5538ea58cdda8b1dfb0bc | 1,318 | py | Python | src/xrl/algorithms/minidr/dataset.py | k4ntz/XmodRL | dffb416bcd91010d8075ee1ac00cc4b9a3021967 | [
"MIT"
] | null | null | null | src/xrl/algorithms/minidr/dataset.py | k4ntz/XmodRL | dffb416bcd91010d8075ee1ac00cc4b9a3021967 | [
"MIT"
] | null | null | null | src/xrl/algorithms/minidr/dataset.py | k4ntz/XmodRL | dffb416bcd91010d8075ee1ac00cc4b9a3021967 | [
"MIT"
] | 1 | 2021-11-10T18:09:27.000Z | 2021-11-10T18:09:27.000Z | import numpy as np
import torch
from torch._C import dtype
import torch.nn as nn
from torch.utils.data import Dataset
class ModelDataset(Dataset):
def __init__(self, history, history_size):
self.h = history #history is passed as list and updated outside
self.history_size = history_size
def __l... | 36.611111 | 93 | 0.658574 | import numpy as np
import torch
from torch._C import dtype
import torch.nn as nn
from torch.utils.data import Dataset
class ModelDataset(Dataset):
def __init__(self, history, history_size):
self.h = history
self.history_size = history_size
def __len__(self):
return self.history_size
... | true | true |
1c2cceb046fb9903d31b37fb08da5b9ddd5d1010 | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | Anuj2608/profiles-rest-api | 6a717c578918f6d7d39907b331d3517ace5a5fe5 | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | Anuj2608/profiles-rest-api | 6a717c578918f6d7d39907b331d3517ace5a5fe5 | [
"MIT"
] | 5 | 2020-06-06T01:54:14.000Z | 2021-06-10T20:11:58.000Z | profiles_api/migrations/0001_initial.py | MyNewLearnings2021/profiles-rest-api | 6a717c578918f6d7d39907b331d3517ace5a5fe5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-05-14 16:53
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.Au... | true | true |
1c2ccf214446d9691fe6e4f4dab136343f93bacc | 1,377 | py | Python | src/Fourteenth Chapter/Example4.py | matthijskrul/ThinkPython | 34c1d81f4ef535c32b8b0309b23c7ca37f851606 | [
"MIT"
] | null | null | null | src/Fourteenth Chapter/Example4.py | matthijskrul/ThinkPython | 34c1d81f4ef535c32b8b0309b23c7ca37f851606 | [
"MIT"
] | null | null | null | src/Fourteenth Chapter/Example4.py | matthijskrul/ThinkPython | 34c1d81f4ef535c32b8b0309b23c7ca37f851606 | [
"MIT"
] | null | null | null | def text_to_words(the_text):
""" return a list of words with all punctuation removed,
and all in lowercase.
"""
my_substitutions = the_text.maketrans(
# If you find any of these
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&()*+,-./:;<=>?@[]^_`{|}~'\\",
# Replace them by these
... | 28.6875 | 79 | 0.615832 | def text_to_words(the_text):
my_substitutions = the_text.maketrans(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"
# Replace them by these
"abcdefghijklmnopqrstuvwxyz ")
# Translate the text now.
cleaned_text = the_text.translate(my_substitutions... | true | true |
1c2ccf7cdf5d9fe0d588b25248a61de676a451cb | 9,952 | py | Python | reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/agent_ctrl/utils.py | jpmarques19/tensorflwo-test | 0ff8b06e0415075c7269820d080284a42595bb2e | [
"Apache-2.0"
] | 5 | 2019-01-19T23:53:35.000Z | 2022-01-29T14:04:31.000Z | reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/agent_ctrl/utils.py | jpmarques19/tensorflwo-test | 0ff8b06e0415075c7269820d080284a42595bb2e | [
"Apache-2.0"
] | 4 | 2020-09-26T01:30:01.000Z | 2022-02-10T02:20:35.000Z | reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/agent_ctrl/utils.py | jpmarques19/tensorflwo-test | 0ff8b06e0415075c7269820d080284a42595bb2e | [
"Apache-2.0"
] | 7 | 2020-03-04T22:23:51.000Z | 2021-07-13T14:05:46.000Z | '''This module should house utility methods for the agent control classes'''
import json
import math
import logging
import markov.agent_ctrl.constants as const
from markov.metrics.constants import StepMetrics
from markov.agent_ctrl.constants import RewardParam
from markov.track_geom.constants import AgentPos, TrackNea... | 51.035897 | 99 | 0.686194 | import json
import math
import logging
import markov.agent_ctrl.constants as const
from markov.metrics.constants import StepMetrics
from markov.agent_ctrl.constants import RewardParam
from markov.track_geom.constants import AgentPos, TrackNearDist, TrackNearPnts
from markov.log_handler.logger import Logger
from markov... | true | true |
1c2cd1474a3b9481174d115859d86e3006790643 | 8,437 | py | Python | libweasyl/libweasyl/images.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | null | null | null | libweasyl/libweasyl/images.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | null | null | null | libweasyl/libweasyl/images.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | null | null | null | """
Image manipulation.
This module defines functions which work on sanpera_ ``Image`` objects.
.. _sanpera: https://pypi.python.org/pypi/sanpera
"""
from __future__ import division
from sanpera.image import Image
from sanpera import geometry
from libweasyl.exceptions import ThumbnailingError
COVER_SIZE = 1024, ... | 29.603509 | 101 | 0.633875 |
from __future__ import division
from sanpera.image import Image
from sanpera import geometry
from libweasyl.exceptions import ThumbnailingError
COVER_SIZE = 1024, 3000
THUMB_HEIGHT = 250
read = Image.read
from_buffer = Image.from_buffer
IMAGE_EXTENSIONS = {
b'JPG': '.jpg',
b'JPEG': '.jpg',
b'PNG'... | true | true |
1c2cd14fafa9f48e4ed0479faf1803de1b1978dd | 4,715 | py | Python | criteo_marketing_transition/models/basic_audience_definition.py | criteo/criteo-python-marketing-transition-sdk | d6d19a23d87ab62eb4810f41490cebab9c72882f | [
"Apache-2.0"
] | null | null | null | criteo_marketing_transition/models/basic_audience_definition.py | criteo/criteo-python-marketing-transition-sdk | d6d19a23d87ab62eb4810f41490cebab9c72882f | [
"Apache-2.0"
] | null | null | null | criteo_marketing_transition/models/basic_audience_definition.py | criteo/criteo-python-marketing-transition-sdk | d6d19a23d87ab62eb4810f41490cebab9c72882f | [
"Apache-2.0"
] | 1 | 2022-02-21T11:16:20.000Z | 2022-02-21T11:16:20.000Z | # coding: utf-8
"""
Criteo API Transition Swagger
This is used to help Criteo clients transition from MAPI to Criteo API # noqa: E501
The version of the OpenAPI document: 1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class BasicAudienceDef... | 27.573099 | 90 | 0.572216 |
import pprint
import re
import six
class BasicAudienceDefinition(object):
openapi_types = {
'id': 'str',
'type': 'str',
'attributes': 'AudienceNameDescription'
}
attribute_map = {
'id': 'id',
'type': 'type',
'attributes': 'attributes'
}
def... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.