hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f7afd9fa60e22f8e3a82ea3ec80f8b51d72af3 | 6,659 | py | Python | mega_core/modeling/roi_heads/box_head/inference.py | hanranCode/mega.pytorch | 28c8a184372aa57a942576a944b3526590bc1ace | [
"BSD-2-Clause"
] | 521 | 2020-03-23T13:08:44.000Z | 2022-03-31T08:50:01.000Z | mega_core/modeling/roi_heads/box_head/inference.py | hanranCode/mega.pytorch | 28c8a184372aa57a942576a944b3526590bc1ace | [
"BSD-2-Clause"
] | 108 | 2020-03-27T07:20:12.000Z | 2022-03-22T03:30:04.000Z | mega_core/modeling/roi_heads/box_head/inference.py | hanranCode/mega.pytorch | 28c8a184372aa57a942576a944b3526590bc1ace | [
"BSD-2-Clause"
] | 115 | 2020-03-27T06:40:57.000Z | 2022-02-28T07:27:27.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
from mega_core.structures.bounding_box import BoxList
from mega_core.structures.boxlist_ops import boxlist_nms
from mega_core.structures.boxlist_ops import cat_boxlist
from mega_cor... | 38.491329 | 88 | 0.640036 |
import torch
import torch.nn.functional as F
from torch import nn
from mega_core.structures.bounding_box import BoxList
from mega_core.structures.boxlist_ops import boxlist_nms
from mega_core.structures.boxlist_ops import cat_boxlist
from mega_core.modeling.box_coder import BoxCoder
class PostProcessor(nn.Module):
... | true | true |
f7f7affade8d8a542114890e32421fd8e3b829ba | 3,839 | py | Python | hubspot/crm/tickets/models/batch_input_simple_public_object_batch_input.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | 1 | 2020-11-12T08:46:32.000Z | 2020-11-12T08:46:32.000Z | hubspot/crm/tickets/models/batch_input_simple_public_object_batch_input.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/tickets/models/batch_input_simple_public_object_batch_input.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Tickets
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubsp... | 30.959677 | 124 | 0.598333 |
import pprint
import re
import six
from hubspot.crm.tickets.configuration import Configuration
class BatchInputSimplePublicObjectBatchInput(object):
openapi_types = {"inputs": "list[SimplePublicObjectBatchInput]"}
attribute_map = {"inputs": "inputs"}
def __init__(self, inputs=None, local_vars_c... | true | true |
f7f7b1147798ce46ece79acebd6afb2506af7e3b | 4,106 | py | Python | snakescale/formatters.py | clintval/snakeskin | 0d282ae8331756ca5b93ffe7146af1ba6491d579 | [
"MIT"
] | 6 | 2018-01-24T04:40:45.000Z | 2018-08-10T18:03:35.000Z | snakescale/formatters.py | clintval/snakeskin | 0d282ae8331756ca5b93ffe7146af1ba6491d579 | [
"MIT"
] | 9 | 2018-12-27T18:13:15.000Z | 2019-01-01T23:06:22.000Z | snakescale/formatters.py | clintval/snakeskin | 0d282ae8331756ca5b93ffe7146af1ba6491d579 | [
"MIT"
] | null | null | null | from types import GeneratorType
from typing import List, Mapping, Union
__all__ = [
'clean_picard_style_value',
'snakecase_to_kebab_case',
'clean_picard_style_key',
'format_bedtools_params',
'format_bwa_params',
'format_dwgsim_params',
'format_fgbio_params',
'format_kraken_params',
... | 27.013158 | 84 | 0.595226 | from types import GeneratorType
from typing import List, Mapping, Union
__all__ = [
'clean_picard_style_value',
'snakecase_to_kebab_case',
'clean_picard_style_key',
'format_bedtools_params',
'format_bwa_params',
'format_dwgsim_params',
'format_fgbio_params',
'format_kraken_params',
... | true | true |
f7f7b1197246e351dfa64cedb61e7d02f4b2b224 | 5,756 | py | Python | server_benchmark.py | ljishen/server | b641df7de19afb67df28d70c9b64b4faa3c56b23 | [
"Apache-2.0"
] | null | null | null | server_benchmark.py | ljishen/server | b641df7de19afb67df28d70c9b64b4faa3c56b23 | [
"Apache-2.0"
] | null | null | null | server_benchmark.py | ljishen/server | b641df7de19afb67df28d70c9b64b4faa3c56b23 | [
"Apache-2.0"
] | null | null | null | """
Stand-alone benchmark for the GA4GH reference implementation.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import time
import pstats
import argparse
import cProfile
import ga4gh.backend as backend
import ga4gh.protocol as protocol
impo... | 33.271676 | 78 | 0.66435 | from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import time
import pstats
import argparse
import cProfile
import ga4gh.backend as backend
import ga4gh.protocol as protocol
import ga4gh.datarepo as datarepo
import guppy
class HeapProfilerBacken... | true | true |
f7f7b18f35a9a358c26fa33887077fdb3fe6def0 | 3,712 | py | Python | lmnet/lmnet/datasets/lm_things_on_a_table.py | toohsk/blueoil | 596922caa939db9c5ecbac3286fbf6f703865ee6 | [
"Apache-2.0"
] | 1 | 2019-10-09T04:41:02.000Z | 2019-10-09T04:41:02.000Z | lmnet/lmnet/datasets/lm_things_on_a_table.py | toohsk/blueoil | 596922caa939db9c5ecbac3286fbf6f703865ee6 | [
"Apache-2.0"
] | 1 | 2018-11-21T07:06:17.000Z | 2018-11-21T07:06:17.000Z | lmnet/lmnet/datasets/lm_things_on_a_table.py | toohsk/blueoil | 596922caa939db9c5ecbac3286fbf6f703865ee6 | [
"Apache-2.0"
] | 2 | 2019-02-08T10:03:34.000Z | 2019-03-20T06:25:55.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | 35.018868 | 95 | 0.625269 |
import functools
import os.path
from lmnet.datasets.delta_mark import ObjectDetectionBase
from lmnet.utils.random import shuffle, train_test_split
class LmThingsOnATable(ObjectDetectionBase):
classes = ["hand", "salad", "steak", "whiskey", "book"]
num_classes = len(classes)
available_subse... | true | true |
f7f7b1f561e066a4d18e2b4947e76d5429e1b13e | 2,651 | py | Python | Code/Plugins/Replacement_Plugin.py | jschneidewind/pyH2A | 66f3943916ebdf5a4bae1706b74e5cef6131460e | [
"CC-BY-4.0",
"MIT"
] | 4 | 2022-03-24T01:04:55.000Z | 2022-03-30T03:06:41.000Z | Code/Plugins/Replacement_Plugin.py | jschneidewind/pyH2A | 66f3943916ebdf5a4bae1706b74e5cef6131460e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | Code/Plugins/Replacement_Plugin.py | jschneidewind/pyH2A | 66f3943916ebdf5a4bae1706b74e5cef6131460e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | from input_modification import insert, process_input, sum_all_tables
import numpy as np
import find_nearest as fn
class Replacement_Plugin:
'''
______________
Required Input
______________
# Planned Replacement
Name | Frequency (years) | Cost ($) | Path (optional)
--- | --- | ---
str | num | num
process_inp... | 34.881579 | 147 | 0.774425 | from input_modification import insert, process_input, sum_all_tables
import numpy as np
import find_nearest as fn
class Replacement_Plugin:
def __init__(replace, self, print_info):
replace.initialize_yearly_costs(self)
replace.calculate_planned_replacement(self)
replace.unplanned_replacement(self, print_info)
... | true | true |
f7f7b36c568a98a3ec5c55eae9e612330e472879 | 275 | py | Python | tests/mocks.py | ashu-tosh-kumar/Calendar-Python | 603d3bed028bfd0e159f2ea86a8743cd3dae346c | [
"MIT"
] | null | null | null | tests/mocks.py | ashu-tosh-kumar/Calendar-Python | 603d3bed028bfd0e159f2ea86a8743cd3dae346c | [
"MIT"
] | null | null | null | tests/mocks.py | ashu-tosh-kumar/Calendar-Python | 603d3bed028bfd0e159f2ea86a8743cd3dae346c | [
"MIT"
] | null | null | null | class FakeResponse:
def __init__(self, data=None, status_code=None):
self._data = data
self._status_code = status_code
@property
def data(self):
return self._data
@property
def status_code(self):
return self._status_code
| 21.153846 | 52 | 0.643636 | class FakeResponse:
def __init__(self, data=None, status_code=None):
self._data = data
self._status_code = status_code
@property
def data(self):
return self._data
@property
def status_code(self):
return self._status_code
| true | true |
f7f7b3d679284fa1433a02cc9391e9b1b29dbaa2 | 8,072 | py | Python | sptm/run_classifier.py | ishine/qa_match | f1ede11a3e799edfb5e90d5b4396b304d2365778 | [
"Apache-2.0"
] | 320 | 2020-03-09T03:49:52.000Z | 2022-03-18T10:59:54.000Z | sptm/run_classifier.py | ishine/qa_match | f1ede11a3e799edfb5e90d5b4396b304d2365778 | [
"Apache-2.0"
] | 13 | 2020-03-12T02:37:24.000Z | 2021-05-19T03:34:52.000Z | sptm/run_classifier.py | ishine/qa_match | f1ede11a3e799edfb5e90d5b4396b304d2365778 | [
"Apache-2.0"
] | 81 | 2020-03-11T10:05:09.000Z | 2022-03-01T14:08:00.000Z | # -*- coding: utf-8 -*-
"""
finetune on pretrained model with trainset and devset
"""
import sys
import os
import tensorflow as tf
import numpy as np
import argparse
import models
import utils
def evaluate(sess, full_tensors, args, model):
total_num = 0
right_num = 0
for batch_data in utils.gen_batchs(fu... | 52.077419 | 119 | 0.613974 |
import sys
import os
import tensorflow as tf
import numpy as np
import argparse
import models
import utils
def evaluate(sess, full_tensors, args, model):
total_num = 0
right_num = 0
for batch_data in utils.gen_batchs(full_tensors, args.batch_size, is_shuffle=False):
softmax_re = sess.run(model.s... | true | true |
f7f7b4b2cfe5f6f19386ce669780320a304fc4c9 | 4,476 | py | Python | test/modules/md/test_730_static.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 2,529 | 2015-01-02T11:52:53.000Z | 2022-03-30T19:54:27.000Z | test/modules/md/test_730_static.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 133 | 2015-04-21T05:50:45.000Z | 2022-03-30T14:23:40.000Z | test/modules/md/test_730_static.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 1,113 | 2015-01-01T14:47:02.000Z | 2022-03-29T16:47:18.000Z | import os
import pytest
from .md_conf import MDConf
from .md_env import MDTestEnv
@pytest.mark.skipif(condition=not MDTestEnv.has_acme_server(),
reason="no ACME test server configured")
class TestStatic:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, acme):
... | 37.932203 | 81 | 0.61193 | import os
import pytest
from .md_conf import MDConf
from .md_env import MDTestEnv
@pytest.mark.skipif(condition=not MDTestEnv.has_acme_server(),
reason="no ACME test server configured")
class TestStatic:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, acme):
... | true | true |
f7f7b55d09b158a9f03da48d9d8cd31b1a9a5ac7 | 9,095 | py | Python | tests/contrib/sensors/test_hdfs_sensor.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-06T09:55:18.000Z | 2019-09-06T09:55:18.000Z | tests/contrib/sensors/test_hdfs_sensor.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2017-05-11T22:57:49.000Z | 2017-05-11T22:57:49.000Z | tests/contrib/sensors/test_hdfs_sensor.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-12-09T08:41:32.000Z | 2019-12-09T08:41:32.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 35.807087 | 81 | 0.523584 |
import logging
import unittest
import re
from datetime import timedelta
from airflow.contrib.sensors.hdfs_sensor import HdfsSensorFolder, HdfsSensorRegex
from airflow.exceptions import AirflowSensorTimeout
class TestHdfsSensorFolder(unittest.TestCase):
def setUp(self):
from tests.core ... | true | true |
f7f7b596546ff95f2ec719176c8bc9ab81995aa9 | 884 | py | Python | app/core/tests/test_commands.py | enpifa-travelperk/recipe-app-api | d735e923b26ac07498e8c30a77f73d5b9456ef86 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | enpifa-travelperk/recipe-app-api | d735e923b26ac07498e8c30a77f73d5b9456ef86 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | enpifa-travelperk/recipe-app-api | d735e923b26ac07498e8c30a77f73d5b9456ef86 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
# we will use this function to mock the behavior of getitem
def test_wait_for_db_ready(self):
"""Test waiting fo... | 35.36 | 74 | 0.682127 | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
def test_wait_for_db_ready(self):
with patch('django.db.utils.ConnectionHandler.__getitem__') as gi:
... | true | true |
f7f7b59785907eb7f204b3a4477927efd9f84331 | 7,206 | py | Python | coredis/exceptions.py | alisaifee/coredis | e72f5d7c665b53e6a1d41e1a7fb9e400858a8b19 | [
"MIT"
] | 9 | 2022-01-07T07:42:08.000Z | 2022-03-21T15:54:09.000Z | coredis/exceptions.py | alisaifee/coredis | e72f5d7c665b53e6a1d41e1a7fb9e400858a8b19 | [
"MIT"
] | 30 | 2022-01-15T23:33:36.000Z | 2022-03-30T22:39:53.000Z | coredis/exceptions.py | alisaifee/coredis | e72f5d7c665b53e6a1d41e1a7fb9e400858a8b19 | [
"MIT"
] | 3 | 2022-01-13T06:11:13.000Z | 2022-02-21T11:19:33.000Z | from __future__ import annotations
import re
from typing import Any
from coredis.typing import Mapping, Optional, Set, Tuple, ValueT
class RedisError(Exception):
"""
Base exception from which all other exceptions in coredis
derive from.
"""
class CommandSyntaxError(RedisError):
"""
Raised ... | 23.940199 | 82 | 0.687899 | from __future__ import annotations
import re
from typing import Any
from coredis.typing import Mapping, Optional, Set, Tuple, ValueT
class RedisError(Exception):
class CommandSyntaxError(RedisError):
def __init__(self, arguments: Set[str], message: str) -> None:
self.arguments: Set[str] = arguments
... | true | true |
f7f7b5c174e46a6f09811dfba7cacc5d8b7ae1bd | 208 | py | Python | Modulo III/aula021-funcaoParImparRetorno.py | ascaniopy/python | 6d8892b7b9ff803b7422a61e68a383ec6ac7d62d | [
"MIT"
] | null | null | null | Modulo III/aula021-funcaoParImparRetorno.py | ascaniopy/python | 6d8892b7b9ff803b7422a61e68a383ec6ac7d62d | [
"MIT"
] | null | null | null | Modulo III/aula021-funcaoParImparRetorno.py | ascaniopy/python | 6d8892b7b9ff803b7422a61e68a383ec6ac7d62d | [
"MIT"
] | null | null | null | def par(n=0):
if n % 2 == 0:
return True
else:
return False
# Programa principal
num = int(input('Digite um número: '))
if par(num):
print('É PAR.')
else:
print('NÃO É PAR.')
| 16 | 38 | 0.543269 | def par(n=0):
if n % 2 == 0:
return True
else:
return False
num = int(input('Digite um número: '))
if par(num):
print('É PAR.')
else:
print('NÃO É PAR.')
| true | true |
f7f7b5cbbc6c83984aa449d5d994dd9a545f8ecf | 1,591 | py | Python | app/run.py | tnkarthik/stock_analysis | 1b91469908bc7cfe9f5ed838540f5e5c67566f37 | [
"MIT"
] | null | null | null | app/run.py | tnkarthik/stock_analysis | 1b91469908bc7cfe9f5ed838540f5e5c67566f37 | [
"MIT"
] | null | null | null | app/run.py | tnkarthik/stock_analysis | 1b91469908bc7cfe9f5ed838540f5e5c67566f37 | [
"MIT"
] | null | null | null | import json
import plotly
import pandas as pd
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar, Histogram, Scatter, Table
import plotly.graph_objs as go
import yfinance as yf
import sys
import re
import datetime as dt
import sys
sys.path.append("..")
from... | 24.859375 | 76 | 0.703331 | import json
import plotly
import pandas as pd
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar, Histogram, Scatter, Table
import plotly.graph_objs as go
import yfinance as yf
import sys
import re
import datetime as dt
import sys
sys.path.append("..")
from... | true | true |
f7f7b74e8b48c23e613392d850029ec6621cee77 | 14,231 | py | Python | Lib/site-packages/pandas_ml/snsaccessors/test/test_sns.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pandas_ml/snsaccessors/test/test_sns.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pandas_ml/snsaccessors/test/test_sns.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python
import pytest
import matplotlib
matplotlib.use('Agg')
import numpy as np # noqa
import sklearn.datasets as datasets # noqa
import pandas_ml as pdml # noqa
import pandas_ml.util.testing as tm # noqa
try:
import seaborn as sns # ... | 34.794621 | 81 | 0.610217 |
import pytest
import matplotlib
matplotlib.use('Agg')
import numpy as np
import sklearn.datasets as datasets
import pandas_ml as pdml
import pandas_ml.util.testing as tm
try:
import seaborn as sns
except ImportError:
pass
class SeabornCa... | true | true |
f7f7b9b7d2e8b252ba130788c5f4992643f1e895 | 4,804 | py | Python | UserInterface/AC_step_PC.py | PNNL-CompBio/ion-mob-ms | 5465e1ebc5282db5654c90a09be1c6fe84d8c196 | [
"BSD-2-Clause"
] | null | null | null | UserInterface/AC_step_PC.py | PNNL-CompBio/ion-mob-ms | 5465e1ebc5282db5654c90a09be1c6fe84d8c196 | [
"BSD-2-Clause"
] | 3 | 2022-03-28T21:55:49.000Z | 2022-03-28T22:00:14.000Z | UserInterface/AC_step_PC.py | PNNL-CompBio/ion-mob-ms | 5465e1ebc5282db5654c90a09be1c6fe84d8c196 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3.9
import sys
import docker
import os
import tarfile
import time
def copy_a_file(client, src,dst):
name, dst = dst.split(':')
container = client.containers.get(name)
srcname = os.path.basename(src).replace('"',"")
src = src.replace('"', "")
os.chdir(os.path.dirname(src))
... | 45.320755 | 215 | 0.6301 |
import sys
import docker
import os
import tarfile
import time
def copy_a_file(client, src,dst):
name, dst = dst.split(':')
container = client.containers.get(name)
srcname = os.path.basename(src).replace('"',"")
src = src.replace('"', "")
os.chdir(os.path.dirname(src))
tar = tarfile.open(src ... | true | true |
f7f7ba79deb010fbfad298ecb6f92180be0264c5 | 544 | py | Python | api/enums.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | null | null | null | api/enums.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T17:31:08.000Z | 2022-03-11T23:16:12.000Z | api/enums.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | null | null | null | from django.utils.translation import gettext_lazy as _
from djchoices import DjangoChoices, ChoiceItem
class TournamentGenderTypes(DjangoChoices):
female = ChoiceItem('female', _('female'))
male = ChoiceItem('male', _('male'))
mixed = ChoiceItem('mixed', _('mixed'))
class TeamStateTypes(DjangoChoices):
... | 34 | 70 | 0.709559 | from django.utils.translation import gettext_lazy as _
from djchoices import DjangoChoices, ChoiceItem
class TournamentGenderTypes(DjangoChoices):
female = ChoiceItem('female', _('female'))
male = ChoiceItem('male', _('male'))
mixed = ChoiceItem('mixed', _('mixed'))
class TeamStateTypes(DjangoChoices):
... | true | true |
f7f7ba91c7df393b76cb02103f077a5f7e325da7 | 11,152 | py | Python | orchestra/contrib/accounts/actions.py | udm88/django-orchestra | 49c84f13a8f92427b01231615136549fb5be3a78 | [
"Unlicense"
] | 68 | 2015-02-09T10:28:44.000Z | 2022-03-12T11:08:36.000Z | orchestra/contrib/accounts/actions.py | ferminhg/django-orchestra | 49c84f13a8f92427b01231615136549fb5be3a78 | [
"Unlicense"
] | 17 | 2015-05-01T18:10:03.000Z | 2021-03-19T21:52:55.000Z | orchestra/contrib/accounts/actions.py | ferminhg/django-orchestra | 49c84f13a8f92427b01231615136549fb5be3a78 | [
"Unlicense"
] | 29 | 2015-03-31T04:51:03.000Z | 2022-02-17T02:58:50.000Z | from functools import partial, wraps
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import NestedObjects, quote
from django.contrib.auth import get_permission_codename
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import router... | 38.722222 | 118 | 0.627242 | from functools import partial, wraps
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import NestedObjects, quote
from django.contrib.auth import get_permission_codename
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import router... | true | true |
f7f7bc1c2027d7ad761ccdb4868af0a55ecf784a | 92 | py | Python | Codes/07. Example 03.py | mrfoxie/Python-for-beginners | 4aaff536cf4c311fd4fbd6cb913a546c4db66c50 | [
"MIT"
] | null | null | null | Codes/07. Example 03.py | mrfoxie/Python-for-beginners | 4aaff536cf4c311fd4fbd6cb913a546c4db66c50 | [
"MIT"
] | null | null | null | Codes/07. Example 03.py | mrfoxie/Python-for-beginners | 4aaff536cf4c311fd4fbd6cb913a546c4db66c50 | [
"MIT"
] | null | null | null | # Ask a user their weight (in pounds), convert it to kilograms and print on it on terminal.
| 46 | 91 | 0.75 | true | true | |
f7f7bcaff3181a9533a78329e9cde90510846141 | 15,020 | py | Python | library/f5bigip_gtm_pool.py | erjac77/ansible-role-f5 | c45b5d9d5f34a8ac6d19ded836d0a6b7ee7f8056 | [
"Apache-2.0"
] | 1 | 2020-02-21T06:48:14.000Z | 2020-02-21T06:48:14.000Z | library/f5bigip_gtm_pool.py | erjac77/ansible-role-f5 | c45b5d9d5f34a8ac6d19ded836d0a6b7ee7f8056 | [
"Apache-2.0"
] | null | null | null | library/f5bigip_gtm_pool.py | erjac77/ansible-role-f5 | c45b5d9d5f34a8ac6d19ded836d0a6b7ee7f8056 | [
"Apache-2.0"
] | 1 | 2021-03-29T03:55:34.000Z | 2021-03-29T03:55:34.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016 Eric Jacob <erjac77@gmail.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
#... | 39.114583 | 119 | 0.593342 |
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: f5bigip_gtm_pool
short_description: BIG-IP gtm pool module
description:
- Configures load balancing pools for the Global Traffic Manager.
version_added:... | true | true |
f7f7bced4604789f25a4e7e82c825d4fb6b982a9 | 1,724 | py | Python | facedistance/main.py | imakin/ProsesKiller | 2575a3516b4cfa245e1053876e61f0f222f214b2 | [
"MIT"
] | null | null | null | facedistance/main.py | imakin/ProsesKiller | 2575a3516b4cfa245e1053876e61f0f222f214b2 | [
"MIT"
] | null | null | null | facedistance/main.py | imakin/ProsesKiller | 2575a3516b4cfa245e1053876e61f0f222f214b2 | [
"MIT"
] | null | null | null |
import time
import dlib
import cv2
from interface_dummy import Connection
class Main(object):
def __init__(self):
self.camera = cv2.VideoCapture(0)
self.camera.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
self.camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
self.face_detector_dlib = dlib.get_f... | 30.245614 | 94 | 0.531903 |
import time
import dlib
import cv2
from interface_dummy import Connection
class Main(object):
def __init__(self):
self.camera = cv2.VideoCapture(0)
self.camera.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
self.camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
self.face_detector_dlib = dlib.get_f... | true | true |
f7f7bcf0cda6e348bf9539ecba2327376a5fac62 | 3,818 | py | Python | PLC/Methods/GenerateNodeConfFile.py | dreibh/planetlab-lxc-plcapi | 065dfc54a2b668e99eab343d113f1a31fb154b13 | [
"BSD-3-Clause"
] | null | null | null | PLC/Methods/GenerateNodeConfFile.py | dreibh/planetlab-lxc-plcapi | 065dfc54a2b668e99eab343d113f1a31fb154b13 | [
"BSD-3-Clause"
] | null | null | null | PLC/Methods/GenerateNodeConfFile.py | dreibh/planetlab-lxc-plcapi | 065dfc54a2b668e99eab343d113f1a31fb154b13 | [
"BSD-3-Clause"
] | null | null | null | import random
import base64
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Interfaces import Interface, Interfaces
from PLC.Auth import Auth
class GenerateNodeConfFile(Method):
"""
Creates a new node configuration fi... | 35.351852 | 103 | 0.577266 | import random
import base64
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Interfaces import Interface, Interfaces
from PLC.Auth import Auth
class GenerateNodeConfFile(Method):
roles = ['admin', 'pi', 'tech']
accep... | true | true |
f7f7bd00eb4e1a11bbc96dfc9abc1fc7012a5fbb | 14 | py | Python | pypi_test/module2/__init__.py | a524631266/pypi_test | 8be0cfe200457c152612a38c3d2ca0167c667fe0 | [
"MIT"
] | null | null | null | pypi_test/module2/__init__.py | a524631266/pypi_test | 8be0cfe200457c152612a38c3d2ca0167c667fe0 | [
"MIT"
] | null | null | null | pypi_test/module2/__init__.py | a524631266/pypi_test | 8be0cfe200457c152612a38c3d2ca0167c667fe0 | [
"MIT"
] | null | null | null | name2 = "mode" | 14 | 14 | 0.642857 | name2 = "mode" | true | true |
f7f7bdb27dac197e1416af3086c7324dfbcaf0b9 | 1,342 | py | Python | src/factory/evaluate/metrics.py | i-pan/kaggle-melanoma | caaec0d7e9cafc7b405eb86e7fdf00107d89e1d9 | [
"MIT"
] | 68 | 2020-08-26T00:50:45.000Z | 2022-03-04T05:31:44.000Z | src/factory/evaluate/metrics.py | FurkanThePythoneer/SkinCancerClassification | def5cfbbb7cbf80560b41ef93fd2d6ee6e9e7b5a | [
"MIT"
] | 2 | 2021-03-05T07:56:30.000Z | 2021-07-02T08:23:07.000Z | src/factory/evaluate/metrics.py | FurkanThePythoneer/SkinCancerClassification | def5cfbbb7cbf80560b41ef93fd2d6ee6e9e7b5a | [
"MIT"
] | 19 | 2020-08-26T11:36:42.000Z | 2021-11-04T02:02:28.000Z | import numpy as np
from sklearn import metrics
def auc(y_true, y_pred, **kwargs):
# y_pred.shape = (N, C)
# AUC for melanoma (class 0)
return {'auc': metrics.roc_auc_score((y_true==0).astype('float'), y_pred[:,0])}
def mel_auc(y_true, y_pred, **kwargs):
# y_pred.shape = (N, C)
# AUC for melanom... | 28.553191 | 99 | 0.616244 | import numpy as np
from sklearn import metrics
def auc(y_true, y_pred, **kwargs):
return {'auc': metrics.roc_auc_score((y_true==0).astype('float'), y_pred[:,0])}
def mel_auc(y_true, y_pred, **kwargs):
return {'mel_auc': metrics.roc_auc_score((y_true<=1).astype('float'), y_pred[:,0]+y_pr... | true | true |
f7f7bdffe6e7d03547f245739dffe47f5b63f0a2 | 26,472 | py | Python | sapp/ui/tests/issues_test.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 74 | 2020-12-18T20:04:30.000Z | 2022-03-22T22:26:02.000Z | sapp/ui/tests/issues_test.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 61 | 2020-12-21T21:33:05.000Z | 2022-01-27T21:22:20.000Z | sapp/ui/tests/issues_test.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 20 | 2021-04-08T01:28:53.000Z | 2022-03-22T22:26:05.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from unittest import TestCase
from ... import queries
from ...db import DB, DBType
from ...models import IssueInstanceSharedTextAssoc
from ... | 36.817803 | 85 | 0.549448 |
from unittest import TestCase
from ... import queries
from ...db import DB, DBType
from ...models import IssueInstanceSharedTextAssoc
from ...models import create as create_models
from ...tests.fake_object_generator import FakeObjectGenerator
from ..issues import Instance
class QueryTest(TestCase):
def setU... | true | true |
f7f7bf7403549acd5a44118e3f532538e22423d5 | 2,198 | py | Python | scripts/baseline-identify.py | pdfinn/macos_security | 33b58df094bcec6e4d5c22c15978422ba2b3399c | [
"CC-BY-4.0"
] | 1 | 2021-11-19T04:56:57.000Z | 2021-11-19T04:56:57.000Z | scripts/baseline-identify.py | pdfinn/macos_security | 33b58df094bcec6e4d5c22c15978422ba2b3399c | [
"CC-BY-4.0"
] | null | null | null | scripts/baseline-identify.py | pdfinn/macos_security | 33b58df094bcec6e4d5c22c15978422ba2b3399c | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# filename: baseline_identify.py
# description: Identify which rules fall on specific baselines.
import argparse
import io
import yaml
import os
from string import Template
from itertools import groupby
import glob
# File path setup
file_dir = os.path.dirname(os.path.abspath(__file__))
parent_... | 34.34375 | 109 | 0.653321 |
import argparse
import io
import yaml
import os
from string import Template
from itertools import groupby
import glob
file_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(file_dir)
baselines_file = os.path.join(parent_dir, 'includes', '800-53_baselines.yaml')
with open(baselines_f... | true | true |
f7f7bfb177c589624808a5f6f119160b11116252 | 6,316 | py | Python | ceph/ceph_admin/osd.py | pdhiran/cephci | ba06523ad4a10eb70dc5295439abbe2a29723798 | [
"MIT"
] | null | null | null | ceph/ceph_admin/osd.py | pdhiran/cephci | ba06523ad4a10eb70dc5295439abbe2a29723798 | [
"MIT"
] | null | null | null | ceph/ceph_admin/osd.py | pdhiran/cephci | ba06523ad4a10eb70dc5295439abbe2a29723798 | [
"MIT"
] | null | null | null | """Manage OSD service via cephadm CLI."""
import json
import logging
from time import sleep
from typing import Dict
from .apply import ApplyMixin
from .common import config_dict_to_string
from .orch import Orch
LOG = logging.getLogger()
class OSDServiceFailure(Exception):
pass
class DevicesNotFound(Exception)... | 29.376744 | 91 | 0.504908 | import json
import logging
from time import sleep
from typing import Dict
from .apply import ApplyMixin
from .common import config_dict_to_string
from .orch import Orch
LOG = logging.getLogger()
class OSDServiceFailure(Exception):
pass
class DevicesNotFound(Exception):
pass
class OSD(ApplyMixin, Orch):
... | true | true |
f7f7c0ebf01c78f6753900a3b7a292ba1dd316d9 | 5,020 | py | Python | google-cloud-sdk/platform/bq/third_party/pyasn1/codec/cer/encoder.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/platform/bq/third_party/pyasn1/codec/cer/encoder.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/platform/bq/third_party/pyasn1/codec/cer/encoder.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | #!/usr/bin/env python
# CER encoder
from pyasn1.type import univ
from pyasn1.type import useful
from pyasn1.codec.ber import encoder
from pyasn1.compat.octets import int2oct, str2octs, null
from pyasn1 import error
class BooleanEncoder(encoder.IntegerEncoder):
def encodeValue(self, encodeFun, client, defMode, maxC... | 38.030303 | 91 | 0.634263 |
from pyasn1.type import univ
from pyasn1.type import useful
from pyasn1.codec.ber import encoder
from pyasn1.compat.octets import int2oct, str2octs, null
from pyasn1 import error
class BooleanEncoder(encoder.IntegerEncoder):
def encodeValue(self, encodeFun, client, defMode, maxChunkSize):
if client == 0:... | true | true |
f7f7c1e6fd84f3ef761be973c859c21750883d78 | 8,738 | py | Python | HW 3/ps3a.py | minotaur487/MIT-OCW-Problem-Sets | 40ca55009f1543a1249cca4304357ff39d72e3e6 | [
"MIT"
] | null | null | null | HW 3/ps3a.py | minotaur487/MIT-OCW-Problem-Sets | 40ca55009f1543a1249cca4304357ff39d72e3e6 | [
"MIT"
] | null | null | null | HW 3/ps3a.py | minotaur487/MIT-OCW-Problem-Sets | 40ca55009f1543a1249cca4304357ff39d72e3e6 | [
"MIT"
] | null | null | null | # 6.00 Problem Set 3A Solutions
#
# The 6.00 Word Game
# Created by: Kevin Luu <luuk> and Jenna Wiens <jwiens>
#
#
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j'... | 27.739683 | 212 | 0.597391 |
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, 'v': 4, 'w': 4,... | true | true |
f7f7c35e8faa2a683324e9ae002588f00364ea7e | 3,517 | py | Python | code/babymapping_1219/Models/pggan_tf_official/mapping_4.py | zhaoyuzhi/ChildPredictor | ba36d9851a37522ec5a0de4eab3b973f872d885e | [
"MIT"
] | 6 | 2022-01-22T06:26:36.000Z | 2022-03-31T14:37:49.000Z | code/babymapping_1219/Models/pggan_tf_official/mapping_4.py | zhaoyuzhi/ChildPredictor | ba36d9851a37522ec5a0de4eab3b973f872d885e | [
"MIT"
] | null | null | null | code/babymapping_1219/Models/pggan_tf_official/mapping_4.py | zhaoyuzhi/ChildPredictor | ba36d9851a37522ec5a0de4eab3b973f872d885e | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.autograd as autograd
from torchvision import models
import torch.nn.functional as F
import numpy as np
import math
import torch
import torch.nn as nn
"""
Mapping network
Input: two tensor of size (batchsize, 512, 4, 4)
Output: a tensor of size (batchsize, 48... | 39.516854 | 156 | 0.626386 | import torch
import torch.nn as nn
import torch.autograd as autograd
from torchvision import models
import torch.nn.functional as F
import numpy as np
import math
import torch
import torch.nn as nn
class MappingResBlock(nn.Module):
def __init__(self, in_channels, ksize=3, padding=0, stride=1, res_weight=0.1):
... | true | true |
f7f7c4799f40587aa8e69a92f4b09b39052bf0da | 30,953 | py | Python | mailchimp_marketing/api/templates_api.py | OlegBugaichuk/mailchimp-marketing-python | c00c09dcbe0e9680e8956be97eca3c963f92b3dd | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing/api/templates_api.py | OlegBugaichuk/mailchimp-marketing-python | c00c09dcbe0e9680e8956be97eca3c963f92b3dd | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing/api/templates_api.py | OlegBugaichuk/mailchimp-marketing-python | c00c09dcbe0e9680e8956be97eca3c963f92b3dd | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.22
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from _... | 44.536691 | 241 | 0.627661 |
from __future__ import absolute_import
import re
import six
from mailchimp_marketing.api_client import ApiClient
class TemplatesApi(object):
def __init__(self, api_client):
self.api_client = api_client
def delete_template(self, template_id, **kwargs):
kwargs['_return_http_data_on... | true | true |
f7f7c49dabbf26ff1f99f5903ed816341f297fc0 | 5,361 | py | Python | ggly/ggly.py | rzinurov/ggly | 9b9a9983d87e416b6bd03149c47b410dcfe66724 | [
"MIT"
] | 1 | 2020-03-31T20:17:33.000Z | 2020-03-31T20:17:33.000Z | ggly/ggly.py | rzinurov/ggly | 9b9a9983d87e416b6bd03149c47b410dcfe66724 | [
"MIT"
] | 1 | 2021-10-12T22:59:58.000Z | 2021-10-12T22:59:58.000Z | ggly/ggly.py | rzinurov/ggly | 9b9a9983d87e416b6bd03149c47b410dcfe66724 | [
"MIT"
] | null | null | null | import logging
import os
import random
import cv2
from numpy.core.records import ndarray
from ggly import img_utils
data_dir = os.path.dirname(os.path.realpath(__file__)) + '/data/'
class Rect(object):
def __init__(self, dimensions):
(self.x, self.y, self.width, self.height) = dimensions
@property... | 41.55814 | 106 | 0.612945 | import logging
import os
import random
import cv2
from numpy.core.records import ndarray
from ggly import img_utils
data_dir = os.path.dirname(os.path.realpath(__file__)) + '/data/'
class Rect(object):
def __init__(self, dimensions):
(self.x, self.y, self.width, self.height) = dimensions
@property... | true | true |
f7f7c5e7fb12af1889e18a374044563a934bca5b | 4,753 | py | Python | stack/load_balancer.py | engineervix/aws-web-stacks | 8bb4c0b358853b8cc6feb11a6d67523ecd607503 | [
"MIT"
] | null | null | null | stack/load_balancer.py | engineervix/aws-web-stacks | 8bb4c0b358853b8cc6feb11a6d67523ecd607503 | [
"MIT"
] | null | null | null | stack/load_balancer.py | engineervix/aws-web-stacks | 8bb4c0b358853b8cc6feb11a6d67523ecd607503 | [
"MIT"
] | null | null | null | from troposphere import elasticloadbalancing as elb
from troposphere import GetAtt, If, Join, Output, Ref
from . import USE_ECS, USE_GOVCLOUD
from .security_groups import load_balancer_security_group
from .template import template
from .utils import ParameterWithDefaults as Parameter
from .vpc import public_subnet_a, ... | 26.553073 | 83 | 0.584894 | from troposphere import elasticloadbalancing as elb
from troposphere import GetAtt, If, Join, Output, Ref
from . import USE_ECS, USE_GOVCLOUD
from .security_groups import load_balancer_security_group
from .template import template
from .utils import ParameterWithDefaults as Parameter
from .vpc import public_subnet_a, ... | true | true |
f7f7c6b33bcc0b84f3f6bbf33cb3f97b2016fd5f | 7,228 | py | Python | openmetrics/datadog_checks/openmetrics/config_models/defaults.py | flowcommerce/integrations-core | c562b0d423ec1a5dd4073b703d6a8d3a9ab23c72 | [
"BSD-3-Clause"
] | null | null | null | openmetrics/datadog_checks/openmetrics/config_models/defaults.py | flowcommerce/integrations-core | c562b0d423ec1a5dd4073b703d6a8d3a9ab23c72 | [
"BSD-3-Clause"
] | null | null | null | openmetrics/datadog_checks/openmetrics/config_models/defaults.py | flowcommerce/integrations-core | c562b0d423ec1a5dd4073b703d6a8d3a9ab23c72 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x va... | 21.072886 | 105 | 0.787493 |
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_proxy(field, value):
return get_default_field_value(field, value)
def shared_service(field, value):
return get_default_field_value(field, value)
def shared_skip_proxy(field, value):
return False
def share... | true | true |
f7f7c814c5912a4c37d5370d4c8b68c55cb27de1 | 91,511 | py | Python | spyder/app/mainwindow.py | TimenoLong/spyder | c4a71b75dd3229b2bebd606e073cf2db536f5c13 | [
"MIT"
] | 1 | 2021-06-29T02:20:12.000Z | 2021-06-29T02:20:12.000Z | spyder/app/mainwindow.py | TimenoLong/spyder | c4a71b75dd3229b2bebd606e073cf2db536f5c13 | [
"MIT"
] | null | null | null | spyder/app/mainwindow.py | TimenoLong/spyder | c4a71b75dd3229b2bebd606e073cf2db536f5c13 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific Python Development Environment
=====================================================
Developed and maintained by the Spyder Proj... | 40.171642 | 85 | 0.566019 |
from __future__ import print_function
from collections import OrderedDict
from enum import Enum
import errno
import gc
import logging
import os
import os.path as osp
import shutil
import signal
import socket
import glob
import sys
import threading
import traceback
from spyder import requ... | true | true |
f7f7c9d55070dd6dfe5199e363700b99c8c56360 | 4,439 | py | Python | apps/user/migrations/0001_initial.py | sushant96702/ecommerce_website_development | 7cd1b37614e7403e53be2ba1a390cf13eee1310c | [
"BSD-2-Clause"
] | 2 | 2018-09-13T10:39:40.000Z | 2018-09-13T10:40:01.000Z | apps/user/migrations/0001_initial.py | sushant96702/ecommerce_website_development | 7cd1b37614e7403e53be2ba1a390cf13eee1310c | [
"BSD-2-Clause"
] | 7 | 2020-06-05T20:06:36.000Z | 2022-03-11T23:43:03.000Z | apps/user/migrations/0001_initial.py | sushant96702/ecommerce_website_development | 7cd1b37614e7403e53be2ba1a390cf13eee1310c | [
"BSD-2-Clause"
] | 1 | 2018-11-11T11:31:45.000Z | 2018-11-11T11:31:45.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import django.contrib.auth.models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_re... | 65.279412 | 432 | 0.634828 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import django.contrib.auth.models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002... | true | true |
f7f7ca390d44c253bf050cce13ed05190953cfaf | 828 | py | Python | django_demos/polls_admnistration/mysite/urls.py | guilhermetco/CS97---WestWoodWalks | 4e252eadd8cd20e0127fa7b87491337e33786ac4 | [
"MIT"
] | null | null | null | django_demos/polls_admnistration/mysite/urls.py | guilhermetco/CS97---WestWoodWalks | 4e252eadd8cd20e0127fa7b87491337e33786ac4 | [
"MIT"
] | null | null | null | django_demos/polls_admnistration/mysite/urls.py | guilhermetco/CS97---WestWoodWalks | 4e252eadd8cd20e0127fa7b87491337e33786ac4 | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 34.5 | 77 | 0.707729 | from django.contrib import admin
from django.urls import path
from django.conf.urls import include
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]
| true | true |
f7f7ca621560cc5b7a66f98bc234dddbac60c0fc | 3,791 | py | Python | 2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py | jiricejchan/AnonymniAnalytici | e4e96f943d0b2232d9099c6e7bb690a3d25ea422 | [
"MIT"
] | 10 | 2017-03-28T06:52:22.000Z | 2017-11-21T17:41:11.000Z | 2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py | jiricejchan/AnonymniAnalytici | e4e96f943d0b2232d9099c6e7bb690a3d25ea422 | [
"MIT"
] | 1 | 2017-07-21T08:27:01.000Z | 2017-07-21T08:27:01.000Z | 2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py | jiricejchan/AnonymniAnalytici | e4e96f943d0b2232d9099c6e7bb690a3d25ea422 | [
"MIT"
] | 8 | 2017-03-05T17:21:40.000Z | 2019-12-01T18:46:39.000Z | from catalyst.api import order_target_percent, record, symbol, set_benchmark
def initialize(context):
context.ASSET_NAME = 'USDT_REP'
context.asset = symbol(context.ASSET_NAME)
set_benchmark(context.asset)
context.is_first_time = True
# For all trading pairs in the poloniex bundle, the... | 30.821138 | 78 | 0.607491 | from catalyst.api import order_target_percent, record, symbol, set_benchmark
def initialize(context):
context.ASSET_NAME = 'USDT_REP'
context.asset = symbol(context.ASSET_NAME)
set_benchmark(context.asset)
context.is_first_time = True
context.TICK_SIZE = 1.0
def han... | true | true |
f7f7ca63a630fb4004cf1204f79d61f42852e59c | 596 | py | Python | email_service/src/email_sender.py | JoaoManoel/final-paper | e8ab6261ab06d4b057513ca22169e2a98f66c64d | [
"MIT"
] | null | null | null | email_service/src/email_sender.py | JoaoManoel/final-paper | e8ab6261ab06d4b057513ca22169e2a98f66c64d | [
"MIT"
] | null | null | null | email_service/src/email_sender.py | JoaoManoel/final-paper | e8ab6261ab06d4b057513ca22169e2a98f66c64d | [
"MIT"
] | null | null | null | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
gmail_user = ''
gmail_password = ''
def sendmail(From, to, subject, body):
msg = MIMEMultipart()
msg['From'] = From
msg['To'] = to
msg['Subject'] = subject
msg.attach(MIMEText(body, 'html'))
try:
se... | 22.923077 | 48 | 0.67953 | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
gmail_user = ''
gmail_password = ''
def sendmail(From, to, subject, body):
msg = MIMEMultipart()
msg['From'] = From
msg['To'] = to
msg['Subject'] = subject
msg.attach(MIMEText(body, 'html'))
try:
se... | true | true |
f7f7cc9c1b4fc41846aff3fb6bf0b60a335e5ec1 | 808 | py | Python | pyinterpolate/semivariance/__init__.py | NarayanAdithya/pyinterpolate | 3a8166ad0ca884f29be1afe789eff4ccfc891f71 | [
"BSD-3-Clause"
] | 61 | 2018-08-15T17:16:12.000Z | 2021-09-06T09:25:49.000Z | pyinterpolate/semivariance/__init__.py | NarayanAdithya/pyinterpolate | 3a8166ad0ca884f29be1afe789eff4ccfc891f71 | [
"BSD-3-Clause"
] | 70 | 2018-06-16T19:12:49.000Z | 2021-09-16T16:28:48.000Z | pyinterpolate/semivariance/__init__.py | NarayanAdithya/pyinterpolate | 3a8166ad0ca884f29be1afe789eff4ccfc891f71 | [
"BSD-3-Clause"
] | 7 | 2019-10-16T05:48:12.000Z | 2021-07-06T14:09:29.000Z | from .areal_semivariance.areal_semivariance import ArealSemivariance
from .semivariogram_deconvolution.regularize_semivariogram import RegularizedSemivariogram
from .semivariogram_estimation.calculate_covariance import calculate_covariance
from .semivariogram_estimation.calculate_semivariance import calculate_semivaria... | 80.8 | 116 | 0.928218 | from .areal_semivariance.areal_semivariance import ArealSemivariance
from .semivariogram_deconvolution.regularize_semivariogram import RegularizedSemivariogram
from .semivariogram_estimation.calculate_covariance import calculate_covariance
from .semivariogram_estimation.calculate_semivariance import calculate_semivaria... | true | true |
f7f7cdf9364dff18133dd3ff2b5ba10a52757e63 | 2,277 | py | Python | py_file_carving/libary/worker/worker_maximal_size_terminating.py | wahlflo/pyFileCarving | 7bbbbedccb551273fd4b22614c86f51bc876bd78 | [
"MIT"
] | null | null | null | py_file_carving/libary/worker/worker_maximal_size_terminating.py | wahlflo/pyFileCarving | 7bbbbedccb551273fd4b22614c86f51bc876bd78 | [
"MIT"
] | null | null | null | py_file_carving/libary/worker/worker_maximal_size_terminating.py | wahlflo/pyFileCarving | 7bbbbedccb551273fd4b22614c86f51bc876bd78 | [
"MIT"
] | null | null | null | import re
from .abstract_worker import AbstractWorker
class WorkerMaximalSizeTerminating(AbstractWorker):
def __init__(self, file_extension: str, first_chunk: bytes, footer_sequence: bytes, maximal_size_in_bytes: int,
make_corruption_checks: bool, flush_if_maximum_file_size_is_reached=False, min... | 47.4375 | 115 | 0.6917 | import re
from .abstract_worker import AbstractWorker
class WorkerMaximalSizeTerminating(AbstractWorker):
def __init__(self, file_extension: str, first_chunk: bytes, footer_sequence: bytes, maximal_size_in_bytes: int,
make_corruption_checks: bool, flush_if_maximum_file_size_is_reached=False, min... | true | true |
f7f7ce0f75dd43daebb219e2c3f12bf492c63354 | 5,824 | py | Python | tests/test_scripts/output/genpython/inheritedid.py | deepakunni3/linkml | a335227b05b0290c21ebae50bb99e16eca57c8eb | [
"CC0-1.0"
] | null | null | null | tests/test_scripts/output/genpython/inheritedid.py | deepakunni3/linkml | a335227b05b0290c21ebae50bb99e16eca57c8eb | [
"CC0-1.0"
] | null | null | null | tests/test_scripts/output/genpython/inheritedid.py | deepakunni3/linkml | a335227b05b0290c21ebae50bb99e16eca57c8eb | [
"CC0-1.0"
] | null | null | null | # Auto generated from inheritedid.yaml by pythongen.py version: 0.9.0
# Generation date: 2021-12-28T22:05:46
# Schema: test_inherited_id
#
# id: https://example.org/inheritedid
# description: Test
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
import re
from jsonasobj2 impo... | 30.333333 | 109 | 0.712397 |
import dataclasses
import sys
import re
from jsonasobj2 import JsonObj, as_dict
from typing import Optional, List, Union, Dict, ClassVar, Any
from dataclasses import dataclass
from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions
from linkml_runtime.utils.slot import S... | true | true |
f7f7cedf38496f5182e702d5126fb479d2e4a14c | 37,870 | py | Python | nova/tests/unit/scheduler/test_filter_scheduler.py | hashsos/hashcloudos-nova | 8350f20167f256f740c5bb94f9222c95fa3e32ad | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/scheduler/test_filter_scheduler.py | hashsos/hashcloudos-nova | 8350f20167f256f740c5bb94f9222c95fa3e32ad | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/scheduler/test_filter_scheduler.py | hashsos/hashcloudos-nova | 8350f20167f256f740c5bb94f9222c95fa3e32ad | [
"Apache-2.0"
] | 1 | 2020-07-22T21:17:41.000Z | 2020-07-22T21:17:41.000Z | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 44.763593 | 79 | 0.638078 |
import mock
from nova import exception
from nova import objects
from nova.scheduler import client
from nova.scheduler.client import report
from nova.scheduler import filter_scheduler
from nova.scheduler import host_manager
from nova.scheduler import utils as scheduler_utils
from nova.scheduler import we... | true | true |
f7f7cf61d708313e869c30369c09071980729b67 | 425 | py | Python | gedder/transforms/unmark.py | Taapeli/stk-gedcom | 8cd1a73452d8474968f591c715f7f6b21a1b8192 | [
"Unlicense"
] | null | null | null | gedder/transforms/unmark.py | Taapeli/stk-gedcom | 8cd1a73452d8474968f591c715f7f6b21a1b8192 | [
"Unlicense"
] | null | null | null | gedder/transforms/unmark.py | Taapeli/stk-gedcom | 8cd1a73452d8474968f591c715f7f6b21a1b8192 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
"""
Restores marked tags: <tag>-X -> <tag>
"""
_VERSION = "1.0"
#from transforms.model.gedcom_line import GedcomLine
def add_args(parser):
pass
def initialize(run_args):
pass
def phase3(run_args, gedline, f):
if gedline.tag.endswith("-X"):
gedline.tag = gedline.tag[:-2]
# ... | 21.25 | 75 | 0.644706 |
_VERSION = "1.0"
def add_args(parser):
pass
def initialize(run_args):
pass
def phase3(run_args, gedline, f):
if gedline.tag.endswith("-X"):
gedline.tag = gedline.tag[:-2]
f.emit(gedline.get_line())
| true | true |
f7f7d07e749ceda9e28ecbd7eafbac9bf42ce4ab | 5,161 | py | Python | problem_11/test_grid_product.py | plilja/project-euler | 646d1989cf15e903ef7e3c6e487284847d522ec9 | [
"Apache-2.0"
] | null | null | null | problem_11/test_grid_product.py | plilja/project-euler | 646d1989cf15e903ef7e3c6e487284847d522ec9 | [
"Apache-2.0"
] | null | null | null | problem_11/test_grid_product.py | plilja/project-euler | 646d1989cf15e903ef7e3c6e487284847d522ec9 | [
"Apache-2.0"
] | null | null | null | import unittest
from grid_product import *
from common.matrix import Matrix
def to_matrix(matrix_as_lists):
result = Matrix(len(matrix_as_lists), len(matrix_as_lists[0]))
for i in xrange(result.num_rows()):
for j in xrange(result.num_columns()):
result[i][j] = matrix_as_lists[i][j]
re... | 45.672566 | 97 | 0.48634 | import unittest
from grid_product import *
from common.matrix import Matrix
def to_matrix(matrix_as_lists):
result = Matrix(len(matrix_as_lists), len(matrix_as_lists[0]))
for i in xrange(result.num_rows()):
for j in xrange(result.num_columns()):
result[i][j] = matrix_as_lists[i][j]
re... | false | true |
f7f7d102523ded9ffc78ba807746901a032398de | 1,894 | py | Python | modules/dbnd/test_dbnd/task/basics/test_task_parameter_namespace.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | modules/dbnd/test_dbnd/task/basics/test_task_parameter_namespace.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | modules/dbnd/test_dbnd/task/basics/test_task_parameter_namespace.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | from typing import List, Tuple
from dbnd import config, dbnd_run_cmd, parameter
from dbnd_test_scenarios.test_common.task.factories import TTask
class TestParameterNamespaceTask(object):
def testWithNamespaceConfig(self):
class A(TTask):
task_namespace = "mynamespace"
p = paramete... | 32.101695 | 83 | 0.561774 | from typing import List, Tuple
from dbnd import config, dbnd_run_cmd, parameter
from dbnd_test_scenarios.test_common.task.factories import TTask
class TestParameterNamespaceTask(object):
def testWithNamespaceConfig(self):
class A(TTask):
task_namespace = "mynamespace"
p = paramete... | true | true |
f7f7d12084910febfa9bfe72586243ba16d66099 | 329 | py | Python | Chapter02/blocks.py | JeffreyAsuncion/PythonEssentialTraining | adf9164ac01db35f2f657e58ec60d9bcc197dcda | [
"MIT"
] | null | null | null | Chapter02/blocks.py | JeffreyAsuncion/PythonEssentialTraining | adf9164ac01db35f2f657e58ec60d9bcc197dcda | [
"MIT"
] | null | null | null | Chapter02/blocks.py | JeffreyAsuncion/PythonEssentialTraining | adf9164ac01db35f2f657e58ec60d9bcc197dcda | [
"MIT"
] | null | null | null | #!/home/jepoy/anaconda3/bin/python
## at terminal which python
x = 42
y = 73
# Python has no Switch or Case Statement
# Python uses the if elif ... else blocks
if x > y:
print('x < y: x is {} and y is {}'.format(x, y))
elif x < y:
print('x < y: x is {} and y is {}'.format(x, y))
else:
print('do somethin... | 19.352941 | 52 | 0.598784 |
> y:
print('x < y: x is {} and y is {}'.format(x, y))
elif x < y:
print('x < y: x is {} and y is {}'.format(x, y))
else:
print('do something else')
| true | true |
f7f7d1817f4059106fc1ec05748d9b67eb5f4663 | 243 | py | Python | loopchain/blockchain/transactions/v3/__init__.py | windies21/loopchain | 6e96c8a7e006747af04187155678f2fae59e1389 | [
"Apache-2.0"
] | 105 | 2018-04-03T05:29:08.000Z | 2022-01-28T17:33:20.000Z | loopchain/blockchain/transactions/v3/__init__.py | laurenceyoon/loopchain | e87032779be4715c135c2c91d2757d9c63bf4e31 | [
"Apache-2.0"
] | 135 | 2018-09-04T07:11:02.000Z | 2021-12-15T06:25:47.000Z | loopchain/blockchain/transactions/v3/__init__.py | laurenceyoon/loopchain | e87032779be4715c135c2c91d2757d9c63bf4e31 | [
"Apache-2.0"
] | 46 | 2018-05-07T09:12:07.000Z | 2022-02-23T09:58:37.000Z | from .transaction import Transaction, HASH_SALT
from .transaction_builder import TransactionBuilder
from .transaction_serializer import TransactionSerializer
from .transaction_verifier import TransactionVerifier
version = Transaction.version
| 34.714286 | 57 | 0.884774 | from .transaction import Transaction, HASH_SALT
from .transaction_builder import TransactionBuilder
from .transaction_serializer import TransactionSerializer
from .transaction_verifier import TransactionVerifier
version = Transaction.version
| true | true |
f7f7d3837c542f18a2a63c5615d45f19cdbbdd50 | 2,705 | py | Python | Python/Telemetry2U.py | telemetry2u/public | cda938d5806c034e5cb3277a6c98fb1acbc0f528 | [
"MIT"
] | 1 | 2022-03-17T09:03:50.000Z | 2022-03-17T09:03:50.000Z | Python/Telemetry2U.py | telemetry2u/public | cda938d5806c034e5cb3277a6c98fb1acbc0f528 | [
"MIT"
] | null | null | null | Python/Telemetry2U.py | telemetry2u/public | cda938d5806c034e5cb3277a6c98fb1acbc0f528 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Simple Python script demonstrating use of the Telemetry2U APi
# to retrieve data from LoRaWAN nodes.
# MIT License
# Copyright (c) 2021 Telemetry2U Pty Lrd
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "S... | 57.553191 | 462 | 0.754529 |
from http.client import HTTPSConnection
import json
import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
def do_request(request):
connection = HTTPSConnection("telemetry2u.com")
authorization = "Basic ZGVtb0BleGFtcGxlLm9yZzpQOXg2ZGgrSXpZYVV1NS9mUHpjL1... | true | true |
f7f7d3b1e916426ac4b1c88235f7a839530182d9 | 879 | py | Python | py/test/selenium/webdriver/marionette/mn_launcher_tests.py | davidgonzalezbarbe/Selenium | 55e370c99a289d36a6ecc41978f7fe2d3813b21c | [
"Apache-2.0"
] | null | null | null | py/test/selenium/webdriver/marionette/mn_launcher_tests.py | davidgonzalezbarbe/Selenium | 55e370c99a289d36a6ecc41978f7fe2d3813b21c | [
"Apache-2.0"
] | null | null | null | py/test/selenium/webdriver/marionette/mn_launcher_tests.py | davidgonzalezbarbe/Selenium | 55e370c99a289d36a6ecc41978f7fe2d3813b21c | [
"Apache-2.0"
] | 1 | 2021-08-11T15:39:13.000Z | 2021-08-11T15:39:13.000Z | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.857143 | 62 | 0.777019 |
def test_launch_and_close_browser(driver):
assert 'appBuildId' in driver.capabilities
| true | true |
f7f7d4f8e15ddacb4563e60ff86dbb0051705ebb | 2,075 | py | Python | source/component/3rd-party/btstack/raw/tool/sm_random_check.py | liangyongxiang/vsf-all-in-one | 942676bd201bb4fa6a3262f77150ab2d7766ec88 | [
"Apache-2.0"
] | 1 | 2022-01-04T08:06:04.000Z | 2022-01-04T08:06:04.000Z | source/component/3rd-party/btstack/raw/tool/sm_random_check.py | liangyongxiang/vsf-all-in-one | 942676bd201bb4fa6a3262f77150ab2d7766ec88 | [
"Apache-2.0"
] | null | null | null | source/component/3rd-party/btstack/raw/tool/sm_random_check.py | liangyongxiang/vsf-all-in-one | 942676bd201bb4fa6a3262f77150ab2d7766ec88 | [
"Apache-2.0"
] | 1 | 2021-08-23T10:11:47.000Z | 2021-08-23T10:11:47.000Z | #!/usr/bin/env python3
# BlueKitchen GmbH (c) 2014
# Report SM Pairing Random packets with value zero
import re
import sys
import time
import datetime
packet_types = [ "CMD =>", "EVT <=", "ACL =>", "ACL <="]
def read_net_32(f):
a = f.read(1)
if a == '':
return -1
b = f.read(1)
if b == '':
... | 23.314607 | 115 | 0.577831 |
import re
import sys
import time
import datetime
packet_types = [ "CMD =>", "EVT <=", "ACL =>", "ACL <="]
def read_net_32(f):
a = f.read(1)
if a == '':
return -1
b = f.read(1)
if b == '':
return -1
c = f.read(1)
if c == '':
return -1
d = f.read(1)
if d == '':
... | true | true |
f7f7d55f73ddac875cdb4cce2d68544d8db2d01e | 1,758 | py | Python | InstaF_Python/RGB_manipulation.py | lyyu0413/InstaF_Python | 949f5bd1c6d4d534409e36c977fd3b12b555f3d3 | [
"MIT"
] | null | null | null | InstaF_Python/RGB_manipulation.py | lyyu0413/InstaF_Python | 949f5bd1c6d4d534409e36c977fd3b12b555f3d3 | [
"MIT"
] | null | null | null | InstaF_Python/RGB_manipulation.py | lyyu0413/InstaF_Python | 949f5bd1c6d4d534409e36c977fd3b12b555f3d3 | [
"MIT"
] | null | null | null | # Copyright 2019 Betty Zhou
import numpy as np
import skimage.io
import pytest
def RGB_manipulation(input_path, output_path, R = 2, G = 2, B = 2):
'''
Manipulates the RGB intensity of an image
Inputs
------
input_path: string, path for an image file in .png format
output_path: string, path fo... | 29.79661 | 80 | 0.652446 |
import numpy as np
import skimage.io
import pytest
def RGB_manipulation(input_path, output_path, R = 2, G = 2, B = 2):
try:
img = skimage.io.imread(input_path)[:,:,:3]
except AttributeError:
print("Please provide the input path as a string")
raise
except OSError:
pri... | true | true |
f7f7d5afd71925510e65c3bd434f1f938101a701 | 19,676 | py | Python | lib/kb_DRAM/kb_DRAMImpl.py | shafferm/kb_DRAM | f414190b56e12aef939e405413b930b96ccb781a | [
"MIT"
] | null | null | null | lib/kb_DRAM/kb_DRAMImpl.py | shafferm/kb_DRAM | f414190b56e12aef939e405413b930b96ccb781a | [
"MIT"
] | 1 | 2021-07-23T15:43:21.000Z | 2021-07-25T19:23:13.000Z | lib/kb_DRAM/kb_DRAMImpl.py | shafferm/kb_DRAM | f414190b56e12aef939e405413b930b96ccb781a | [
"MIT"
] | 1 | 2021-11-28T16:32:51.000Z | 2021-11-28T16:32:51.000Z | # -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
import pandas as pd
import yaml
import warnings
from mag_annotator import __version__ as dram_version
from mag_annotator.database_processing import import_config, set_database_paths, print_database_locations
from mag_annotator.annotate_bins import annotate... | 50.71134 | 120 | 0.616233 |
import logging
import os
import pandas as pd
import yaml
import warnings
from mag_annotator import __version__ as dram_version
from mag_annotator.database_processing import import_config, set_database_paths, print_database_locations
from mag_annotator.annotate_bins import annotate_bins, annotate_called_genes
from ma... | true | true |
f7f7d6777c100497eec646d3e43e5c24e733fa6f | 1,185 | py | Python | src/ufdl/json/object_detection/_Polygon.py | waikato-ufdl/ufdl-json-messages | 408901bdf79aa9ae7cff1af165deee83e62f6088 | [
"Apache-2.0"
] | null | null | null | src/ufdl/json/object_detection/_Polygon.py | waikato-ufdl/ufdl-json-messages | 408901bdf79aa9ae7cff1af165deee83e62f6088 | [
"Apache-2.0"
] | null | null | null | src/ufdl/json/object_detection/_Polygon.py | waikato-ufdl/ufdl-json-messages | 408901bdf79aa9ae7cff1af165deee83e62f6088 | [
"Apache-2.0"
] | null | null | null | from typing import List
from wai.common.geometry import Polygon as GeometricPolygon, Point
from wai.json.object import StrictJSONObject
from wai.json.object.property import ArrayProperty, NumberProperty
class Polygon(StrictJSONObject['Polygon']):
"""
Represents a polygon mask for an annotation.
"""
... | 30.384615 | 71 | 0.657384 | from typing import List
from wai.common.geometry import Polygon as GeometricPolygon, Point
from wai.json.object import StrictJSONObject
from wai.json.object.property import ArrayProperty, NumberProperty
class Polygon(StrictJSONObject['Polygon']):
points: List[List[int]] = ArrayProperty(
element_pro... | true | true |
f7f7d72d14b3c09f97209cdf0e3c209ff236c0fb | 1,390 | py | Python | face_recognition/face_recogniser.py | jagannath-sahoo/face-recognition- | e19fbe1a4fd853d4c79f69c42fd055b6463f5fab | [
"BSD-3-Clause"
] | 103 | 2019-11-14T15:53:43.000Z | 2022-03-30T18:14:45.000Z | face_recognition/face_recogniser.py | jagannath-sahoo/face-recognition- | e19fbe1a4fd853d4c79f69c42fd055b6463f5fab | [
"BSD-3-Clause"
] | 20 | 2020-02-05T08:17:12.000Z | 2021-05-19T10:38:01.000Z | face_recognition/face_recogniser.py | jagannath-sahoo/face-recognition- | e19fbe1a4fd853d4c79f69c42fd055b6463f5fab | [
"BSD-3-Clause"
] | 41 | 2020-01-08T10:07:48.000Z | 2022-03-15T14:57:36.000Z | from collections import namedtuple
Prediction = namedtuple('Prediction', 'label confidence')
Face = namedtuple('Face', 'top_prediction bb all_predictions')
BoundingBox = namedtuple('BoundingBox', 'left top right bottom')
def top_prediction(idx_to_class, probs):
top_label = probs.argmax()
return Prediction(la... | 33.095238 | 95 | 0.67482 | from collections import namedtuple
Prediction = namedtuple('Prediction', 'label confidence')
Face = namedtuple('Face', 'top_prediction bb all_predictions')
BoundingBox = namedtuple('BoundingBox', 'left top right bottom')
def top_prediction(idx_to_class, probs):
top_label = probs.argmax()
return Prediction(la... | true | true |
f7f7d7ce0fda930b46fa0108ba3de629fdbd4704 | 2,267 | py | Python | 常用分割损失函数和指标/WCCE.py | 1044197988/TF.Keras-Commonly-used-models | b37276bcee454b2c39b8fcc60e87b72ec8a6a5d4 | [
"Apache-2.0"
] | 160 | 2019-09-19T14:13:23.000Z | 2022-03-25T03:14:20.000Z | 常用分割损失函数和指标/WCCE.py | johonnyyang/TF.Keras-Commonly-used-models | b37276bcee454b2c39b8fcc60e87b72ec8a6a5d4 | [
"Apache-2.0"
] | 1 | 2020-11-11T08:37:02.000Z | 2020-11-11T08:37:58.000Z | 常用分割损失函数和指标/WCCE.py | johonnyyang/TF.Keras-Commonly-used-models | b37276bcee454b2c39b8fcc60e87b72ec8a6a5d4 | [
"Apache-2.0"
] | 70 | 2019-09-24T03:05:09.000Z | 2022-03-25T03:14:21.000Z | from tensorflow.python import keras
from itertools import product
import numpy as np
from tensorflow.python.keras.utils import losses_utils
#weights->数组
class WeightedCategoricalCrossentropy(keras.losses.CategoricalCrossentropy):
def __init__(
self,
weights,
from_logits=False,
... | 35.984127 | 106 | 0.622408 | from tensorflow.python import keras
from itertools import product
import numpy as np
from tensorflow.python.keras.utils import losses_utils
class WeightedCategoricalCrossentropy(keras.losses.CategoricalCrossentropy):
def __init__(
self,
weights,
from_logits=False,
label_s... | true | true |
f7f7d90b35bda949d6319d2a1f2c991a52ce0192 | 5,750 | py | Python | django_unicorn/management/commands/startunicorn.py | nerdoc/django-unicorn | e512b8f64f5c276a78127db9a05d9d5c042232d5 | [
"MIT"
] | null | null | null | django_unicorn/management/commands/startunicorn.py | nerdoc/django-unicorn | e512b8f64f5c276a78127db9a05d9d5c042232d5 | [
"MIT"
] | null | null | null | django_unicorn/management/commands/startunicorn.py | nerdoc/django-unicorn | e512b8f64f5c276a78127db9a05d9d5c042232d5 | [
"MIT"
] | null | null | null | import os
import webbrowser
from pathlib import Path
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_unicorn.components.unicorn_view import (
convert_to_pascal_case,
convert_to_snake_case,
)
COMPONENT_FILE_CONTENT = """from django_unicorn.compon... | 32.122905 | 125 | 0.518261 | import os
import webbrowser
from pathlib import Path
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_unicorn.components.unicorn_view import (
convert_to_pascal_case,
convert_to_snake_case,
)
COMPONENT_FILE_CONTENT = """from django_unicorn.compon... | true | true |
f7f7db319ae61f6acf2466c9778b837d2fe0fedd | 2,230 | py | Python | examples/ad_manager/v202105/line_item_creative_association_service/update_licas.py | timgates42/googleads-python-lib | 86c3d0558fcc30135ff44700a499678c7e69e0c0 | [
"Apache-2.0"
] | 601 | 2015-01-07T09:53:49.000Z | 2022-03-31T17:18:11.000Z | examples/ad_manager/v202105/line_item_creative_association_service/update_licas.py | timgates42/googleads-python-lib | 86c3d0558fcc30135ff44700a499678c7e69e0c0 | [
"Apache-2.0"
] | 443 | 2015-01-07T12:16:57.000Z | 2022-03-14T14:46:56.000Z | examples/ad_manager/v202105/line_item_creative_association_service/update_licas.py | timgates42/googleads-python-lib | 86c3d0558fcc30135ff44700a499678c7e69e0c0 | [
"Apache-2.0"
] | 1,135 | 2015-01-07T15:51:55.000Z | 2022-03-31T17:18:13.000Z | #!/usr/bin/env python
#
# Copyright 2015 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 requir... | 33.283582 | 76 | 0.70583 |
from googleads import ad_manager
def main(client):
lica_service = client.GetService(
'LineItemCreativeAssociationService', version='v202105')
statement = ad_manager.StatementBuilder(version='v202105')
while True:
response = lica_service.getLineItemCreativeAssociationsBy... | true | true |
f7f7db3fda5972c16bbcd55607e45786d8fc39b2 | 1,935 | py | Python | elastalert/alerters/chatwork.py | vbisserie/elastalert2 | 982115f0de055595fa452c425b6a15bedc3161cf | [
"Apache-2.0"
] | null | null | null | elastalert/alerters/chatwork.py | vbisserie/elastalert2 | 982115f0de055595fa452c425b6a15bedc3161cf | [
"Apache-2.0"
] | null | null | null | elastalert/alerters/chatwork.py | vbisserie/elastalert2 | 982115f0de055595fa452c425b6a15bedc3161cf | [
"Apache-2.0"
] | null | null | null | import warnings
import requests
from requests import RequestException
from requests.auth import HTTPProxyAuth
from elastalert.alerts import Alerter
from elastalert.util import EAException, elastalert_logger
class ChatworkAlerter(Alerter):
""" Creates a Chatwork room message for each alert """
required_optio... | 40.3125 | 129 | 0.687339 | import warnings
import requests
from requests import RequestException
from requests.auth import HTTPProxyAuth
from elastalert.alerts import Alerter
from elastalert.util import EAException, elastalert_logger
class ChatworkAlerter(Alerter):
required_options = frozenset(['chatwork_apikey', 'chatwork_room_id'])
... | true | true |
f7f7dbd3bf4f39a55cf023a5116bf3da3d2eb1bd | 5,651 | py | Python | cloudwatch_metric2csv.py | aidenkihyunkim/cloudwatch-metric-to-csv | dbcffbf37f9a4ff230983c00fe2a3612107d2b42 | [
"MIT"
] | null | null | null | cloudwatch_metric2csv.py | aidenkihyunkim/cloudwatch-metric-to-csv | dbcffbf37f9a4ff230983c00fe2a3612107d2b42 | [
"MIT"
] | null | null | null | cloudwatch_metric2csv.py | aidenkihyunkim/cloudwatch-metric-to-csv | dbcffbf37f9a4ff230983c00fe2a3612107d2b42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################
# Export CloudWatch metric data to csv file
# Author: Aiden Kim
# 2020-11-19
##############################################
from datetime import timedelta, timezone, datetime
import argparse
import dateutil
import boto3
import re
import csv
import ... | 40.949275 | 183 | 0.679703 |
util.parser.parse(args.end).astimezone(timezone.utc) if args.end else datetime.utcnow()
statistics = args.statistics if args.statistics else 'Average'
file = args.file if args.file else '{}.csv'.format(metrics[metric]['metric'])
datas = []
cw = boto3.client('cloudwatch')
if ('AWS/EC2' in metrics[metric]['namespace']... | true | true |
f7f7deb7a85c7ce164392a8f0cf063fd4f5fa9dd | 123,818 | py | Python | fissix/tests/test_fixers.py | orsinium/fissix-py35 | 48914fcb69842c9fe3c97652870c7610a2cc639b | [
"PSF-2.0"
] | null | null | null | fissix/tests/test_fixers.py | orsinium/fissix-py35 | 48914fcb69842c9fe3c97652870c7610a2cc639b | [
"PSF-2.0"
] | null | null | null | fissix/tests/test_fixers.py | orsinium/fissix-py35 | 48914fcb69842c9fe3c97652870c7610a2cc639b | [
"PSF-2.0"
] | null | null | null | """ Test suite for the fixer modules """
# Python imports
import os
from itertools import chain
from operator import itemgetter
# Local imports
from fissix import pygram, fixer_util
from fissix.tests import support
class FixerTestCase(support.TestCase):
# Other test cases can subclass this class and replace "f... | 26.088917 | 96 | 0.433951 |
import os
from itertools import chain
from operator import itemgetter
from fissix import pygram, fixer_util
from fissix.tests import support
class FixerTestCase(support.TestCase):
def setUp(self, fix_list=None, fixer_pkg="fissix", options=None):
if fix_list is None:
fix_list = [... | true | true |
f7f7df480840dbd6f615e87db228b886d5bae05f | 1,053 | py | Python | plot_results.py | Niky1/size-image-annotator | fce57e97ac61601aa8c67cf69438f6dc6dbac946 | [
"MIT"
] | null | null | null | plot_results.py | Niky1/size-image-annotator | fce57e97ac61601aa8c67cf69438f6dc6dbac946 | [
"MIT"
] | null | null | null | plot_results.py | Niky1/size-image-annotator | fce57e97ac61601aa8c67cf69438f6dc6dbac946 | [
"MIT"
] | null | null | null | import json
import os.path
import sys
from os import path
import matplotlib.pyplot as plt
import numpy as np
from imageio import imread
from matplotlib import gridspec
with open(sys.argv[1]) as f:
data = json.load(f)
picture_indices = [i for datapoint in data for i in (
datapoint["left"], datapoint["right"])]... | 27.710526 | 89 | 0.673314 | import json
import os.path
import sys
from os import path
import matplotlib.pyplot as plt
import numpy as np
from imageio import imread
from matplotlib import gridspec
with open(sys.argv[1]) as f:
data = json.load(f)
picture_indices = [i for datapoint in data for i in (
datapoint["left"], datapoint["right"])]... | true | true |
f7f7e0401b7970df07707bce7d7c76621fa25e06 | 1,637 | py | Python | pandas/rolling_mean.py | minister19/Python_snippets | 69accc4278443271aefc7e354161eac7df2fa283 | [
"MIT"
] | null | null | null | pandas/rolling_mean.py | minister19/Python_snippets | 69accc4278443271aefc7e354161eac7df2fa283 | [
"MIT"
] | null | null | null | pandas/rolling_mean.py | minister19/Python_snippets | 69accc4278443271aefc7e354161eac7df2fa283 | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
from numpy import NaN
is_ipython = 'inline' in matplotlib.get_backend()
if is_ipython:
from IPython import display
def plot_single_with_mean(config):
'''
config: {
'id': unique identifier,
'title': '',
'xlabel':... | 25.184615 | 76 | 0.563836 | import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
from numpy import NaN
is_ipython = 'inline' in matplotlib.get_backend()
if is_ipython:
from IPython import display
def plot_single_with_mean(config):
fig = plt.figure(config['id'])
axes = fig.get_axes()
_data = config['y_data']
... | true | true |
f7f7e17a90104bb97f9edf831f6cea34066ce1c4 | 5,399 | py | Python | console.py | calypsobronte/AirBnB_clone | 25c6519b85db8f826a77f6ec76045b3358aa79df | [
"MIT"
] | null | null | null | console.py | calypsobronte/AirBnB_clone | 25c6519b85db8f826a77f6ec76045b3358aa79df | [
"MIT"
] | null | null | null | console.py | calypsobronte/AirBnB_clone | 25c6519b85db8f826a77f6ec76045b3358aa79df | [
"MIT"
] | 1 | 2020-02-28T16:01:00.000Z | 2020-02-28T16:01:00.000Z | #!/usr/bin/python3
# description of the function
import cmd
import models
import re
from models.base_model import BaseModel
from models.user import User
from models.state import State
from models.city import City
from models.amenity import Amenity
from models.place import Place
from models.review import Review
class ... | 34.832258 | 79 | 0.50213 |
import cmd
import models
import re
from models.base_model import BaseModel
from models.user import User
from models.state import State
from models.city import City
from models.amenity import Amenity
from models.place import Place
from models.review import Review
class HBNBCommand(cmd.Cmd):
prompt = '(hbnb)... | true | true |
f7f7e2795d1b53c361ffc3c5cd1e81684a6f064d | 84 | py | Python | handle/admin.py | acdh-oeaw/acdh-django-handle | 008b1e5264fb1f76d7ad4d1034e1ac0713b60498 | [
"MIT"
] | null | null | null | handle/admin.py | acdh-oeaw/acdh-django-handle | 008b1e5264fb1f76d7ad4d1034e1ac0713b60498 | [
"MIT"
] | null | null | null | handle/admin.py | acdh-oeaw/acdh-django-handle | 008b1e5264fb1f76d7ad4d1034e1ac0713b60498 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . models import Pid
admin.site.register(Pid)
| 16.8 | 32 | 0.797619 | from django.contrib import admin
from . models import Pid
admin.site.register(Pid)
| true | true |
f7f7e30adfcc111e4349028b9bd650611d1d8fba | 27,482 | py | Python | tests/components/accuweather/test_sensor.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 2 | 2021-04-15T06:11:12.000Z | 2021-12-13T21:17:29.000Z | tests/components/accuweather/test_sensor.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 84 | 2020-07-14T17:08:58.000Z | 2022-03-31T06:01:46.000Z | tests/components/accuweather/test_sensor.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 1 | 2021-12-09T11:44:52.000Z | 2021-12-09T11:44:52.000Z | """Test sensor of AccuWeather integration."""
from datetime import timedelta
import json
from unittest.mock import PropertyMock, patch
from homeassistant.components.accuweather.const import ATTRIBUTION, DOMAIN
from homeassistant.components.sensor import (
ATTR_STATE_CLASS,
DOMAIN as SENSOR_DOMAIN,
STATE_CL... | 37.087719 | 89 | 0.725602 | from datetime import timedelta
import json
from unittest.mock import PropertyMock, patch
from homeassistant.components.accuweather.const import ATTRIBUTION, DOMAIN
from homeassistant.components.sensor import (
ATTR_STATE_CLASS,
DOMAIN as SENSOR_DOMAIN,
STATE_CLASS_MEASUREMENT,
)
from homeassistant.const im... | true | true |
f7f7e34bca1b3f88ff1403c8427d3696b3f1604d | 802 | py | Python | elichika/tests/node/ndarray/Shape.py | disktnk/chainer-compiler | 5cfd027b40ea6e4abf73eb42be70b4fba74d1cde | [
"MIT"
] | null | null | null | elichika/tests/node/ndarray/Shape.py | disktnk/chainer-compiler | 5cfd027b40ea6e4abf73eb42be70b4fba74d1cde | [
"MIT"
] | null | null | null | elichika/tests/node/ndarray/Shape.py | disktnk/chainer-compiler | 5cfd027b40ea6e4abf73eb42be70b4fba74d1cde | [
"MIT"
] | null | null | null | # coding: utf-8
import chainer
import chainer.functions as F
class Shape(chainer.Chain):
def forward(self, x):
y1 = x.shape
return list(y1)
class ShapeConcat(chainer.Chain):
def forward(self, x):
y1 = x.shape
return np.array(y1 + (42,))
class ShapeIndex(chainer.Chain):
... | 19.095238 | 69 | 0.604738 |
import chainer
import chainer.functions as F
class Shape(chainer.Chain):
def forward(self, x):
y1 = x.shape
return list(y1)
class ShapeConcat(chainer.Chain):
def forward(self, x):
y1 = x.shape
return np.array(y1 + (42,))
class ShapeIndex(chainer.Chain):
def forward(sel... | true | true |
f7f7e3d1863b55115a131a6f14c0094e353bcd81 | 11,152 | py | Python | test/IECoreScene/CurvesPrimitiveTest.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 386 | 2015-01-02T11:10:43.000Z | 2022-03-10T15:12:20.000Z | test/IECoreScene/CurvesPrimitiveTest.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 484 | 2015-01-09T18:28:06.000Z | 2022-03-31T16:02:04.000Z | test/IECoreScene/CurvesPrimitiveTest.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 99 | 2015-01-28T23:18:04.000Z | 2022-03-27T00:59:39.000Z | ##########################################################################
#
# Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | 47.455319 | 143 | 0.717898 | rpolation.FaceVarying, 0 ), 4 )
self.assertEqual( c.numSegments( 0 ), 4 )
c = IECoreScene.CurvesPrimitive( IECore.IntVectorData( [ 4 ] ), IECore.CubicBasisf.bSpline(), False )
self.assertEqual( c.variableSize( IECoreScene.PrimitiveVariable.Interpolation.Constant ), 1 )
self.assertEqual( c.variableSize( IECore... | true | true |
f7f7e4c585816ab09634d61d4487a11a5d9f6f9d | 390 | py | Python | test/nose_integration_tests/dummy_first_level_pkg_two_tests/dummy_test_f.py | Points/teamcity-python | 58dd0e9d83fea92f9212f2cadaaaeaefd1deb68e | [
"Apache-2.0"
] | null | null | null | test/nose_integration_tests/dummy_first_level_pkg_two_tests/dummy_test_f.py | Points/teamcity-python | 58dd0e9d83fea92f9212f2cadaaaeaefd1deb68e | [
"Apache-2.0"
] | null | null | null | test/nose_integration_tests/dummy_first_level_pkg_two_tests/dummy_test_f.py | Points/teamcity-python | 58dd0e9d83fea92f9212f2cadaaaeaefd1deb68e | [
"Apache-2.0"
] | null | null | null | from nose.plugins.attrib import attr
@attr('demo_smoke', 'smoke', 'known_bad')
def test_dummy_known_bad_with_assertion_error():
assert False
@attr('demo_smoke', 'smoke', 'known_bad')
def test_dummy_known_bad_with_assertion_pass():
assert True
@attr('demo_smoke', 'smoke', 'known_bad')
def test_dummy_known_ba... | 26 | 48 | 0.766667 | from nose.plugins.attrib import attr
@attr('demo_smoke', 'smoke', 'known_bad')
def test_dummy_known_bad_with_assertion_error():
assert False
@attr('demo_smoke', 'smoke', 'known_bad')
def test_dummy_known_bad_with_assertion_pass():
assert True
@attr('demo_smoke', 'smoke', 'known_bad')
def test_dummy_known_ba... | true | true |
f7f7e4e4ed733a16a3c4643f001ca2f4d405ddbe | 5,768 | py | Python | MachineLearning/Classification/KernelSupportVectorMachine(SVM)Classification/kernel_support_vector_machine_(svm)_classification.py | norbertosanchezdichi/TIL | 2e9719ddd288022f53b094a42679e849bdbcc625 | [
"MIT"
] | null | null | null | MachineLearning/Classification/KernelSupportVectorMachine(SVM)Classification/kernel_support_vector_machine_(svm)_classification.py | norbertosanchezdichi/TIL | 2e9719ddd288022f53b094a42679e849bdbcc625 | [
"MIT"
] | null | null | null | MachineLearning/Classification/KernelSupportVectorMachine(SVM)Classification/kernel_support_vector_machine_(svm)_classification.py | norbertosanchezdichi/TIL | 2e9719ddd288022f53b094a42679e849bdbcc625 | [
"MIT"
] | null | null | null | # Import libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Import dataset
dataset = pd.read_csv('Social_Network_Ads.csv')
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, -1].values
print(f"X = {X}")
print(f"Y = {Y}")
print()
# Split Dataset: Training Set and Test Set
from sklearn... | 49.299145 | 224 | 0.73613 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Social_Network_Ads.csv')
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, -1].values
print(f"X = {X}")
print(f"Y = {Y}")
print()
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = ... | true | true |
f7f7e66a8966c0a484a7742228442b179fa012db | 10,093 | py | Python | bootstrap.py | qoda/python-searchengine | d514ddbc0be9755ed48143b38dd4591d0123b1bc | [
"BSD-3-Clause"
] | 19 | 2015-01-21T14:46:20.000Z | 2021-04-28T22:46:31.000Z | bootstrap.py | gourav245/python-searchengine | d514ddbc0be9755ed48143b38dd4591d0123b1bc | [
"BSD-3-Clause"
] | 1 | 2020-03-07T08:41:20.000Z | 2020-03-11T09:16:59.000Z | bootstrap.py | gourav245/python-searchengine | d514ddbc0be9755ed48143b38dd4591d0123b1bc | [
"BSD-3-Clause"
] | 15 | 2015-03-28T07:44:52.000Z | 2021-01-28T23:45:20.000Z | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 38.670498 | 78 | 0.643416 | s:
reload(sys.modules['pkg_resources'])
import pkg_resources
# This does not (always?) update the default working set. We will
# do it.
for path in sys.path:
if path not in pkg_resources.working_set.entries:
pkg_resources.working_set.add_entry(path)
cmd = [quote(sys.executa... | false | true |
f7f7e6eed95dcac0d0e9b5fccb8759e13725db67 | 7,216 | py | Python | tunnel/tunnel_node.py | peterpolidoro/tunnel_ros | a204ddc8ed7ab01a7755d822318dc456ec37c919 | [
"BSD-3-Clause"
] | null | null | null | tunnel/tunnel_node.py | peterpolidoro/tunnel_ros | a204ddc8ed7ab01a7755d822318dc456ec37c919 | [
"BSD-3-Clause"
] | null | null | null | tunnel/tunnel_node.py | peterpolidoro/tunnel_ros | a204ddc8ed7ab01a7755d822318dc456ec37c919 | [
"BSD-3-Clause"
] | 1 | 2019-12-17T21:27:57.000Z | 2019-12-17T21:27:57.000Z | # Copyright (c) 2020, Howard Hughes Medical Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | 43.733333 | 119 | 0.698725 |
import rclpy
from rclpy.node import Node
from smart_cage_msgs.msg import TunnelState
from .tunnel import Tunnel, TunnelInfo
import time
import datetime
import math
class TunnelNode(Node):
def __init__(self):
super().__init__('tunnel')
self.tunnel_info = TunnelInfo()
... | true | true |
f7f7e72f676688ff107e55ebb04e68bb70cad3ea | 156 | py | Python | setup.py | TheRender/nba-data | 0f92e7ec2e756b4880931beee528abdca719f555 | [
"MIT"
] | null | null | null | setup.py | TheRender/nba-data | 0f92e7ec2e756b4880931beee528abdca719f555 | [
"MIT"
] | null | null | null | setup.py | TheRender/nba-data | 0f92e7ec2e756b4880931beee528abdca719f555 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='nba-data',
version='0.1',
py_modules=['nba-data'],
install_requires=[
'requests'
]
)
| 14.181818 | 28 | 0.583333 | from setuptools import setup
setup(
name='nba-data',
version='0.1',
py_modules=['nba-data'],
install_requires=[
'requests'
]
)
| true | true |
f7f7e730b28e1f50be4dd6a2ac83290c2da521bc | 9,397 | py | Python | tests/snippets/strings.py | sanxiyn/RustPython | 6308be3dfeb8e1b334136c81a4175514bb8561c3 | [
"MIT"
] | 3 | 2019-08-14T02:05:49.000Z | 2020-01-03T08:39:56.000Z | tests/snippets/strings.py | Vicfred/RustPython | d42d422566f64f48311cc7e7efb4d0ffcefb0297 | [
"MIT"
] | null | null | null | tests/snippets/strings.py | Vicfred/RustPython | d42d422566f64f48311cc7e7efb4d0ffcefb0297 | [
"MIT"
] | 1 | 2022-03-14T13:03:29.000Z | 2022-03-14T13:03:29.000Z | from testutils import assert_raises
assert "".__eq__(1) == NotImplemented
assert "a" == 'a'
assert """a""" == "a"
assert len(""" " "" " "" """) == 11
assert "\"" == '"'
assert "\"" == """\""""
assert "\n" == """
"""
assert len(""" " \" """) == 5
assert len("é") == 1
assert len("é") == 2
assert len("あ") == 1
assert... | 28.737003 | 134 | 0.587634 | from testutils import assert_raises
assert "".__eq__(1) == NotImplemented
assert "a" == 'a'
assert """a""" == "a"
assert len(""" " "" " "" """) == 11
assert "\"" == '"'
assert "\"" == """\""""
assert "\n" == """
"""
assert len(""" " \" """) == 5
assert len("é") == 1
assert len("é") == 2
assert len("あ") == 1
assert... | true | true |
f7f7e7464b431923c9e478ef93cf76c0f0300b2b | 209 | py | Python | reseller_cashback/core/serializers/base.py | cesarbruschetta/reseller-cashback | 2e7fcbee15c4c446bcd1a163c5360b11e6bef6fc | [
"MIT"
] | 1 | 2022-01-12T14:26:46.000Z | 2022-01-12T14:26:46.000Z | reseller_cashback/core/serializers/base.py | cesarbruschetta/reseller-cashback | 2e7fcbee15c4c446bcd1a163c5360b11e6bef6fc | [
"MIT"
] | null | null | null | reseller_cashback/core/serializers/base.py | cesarbruschetta/reseller-cashback | 2e7fcbee15c4c446bcd1a163c5360b11e6bef6fc | [
"MIT"
] | null | null | null | from rest_framework import serializers
from ..models import BaseModel
class BaseSerializer(serializers.ModelSerializer): # type: ignore
class Meta:
model = BaseModel
fields = '__all__'
| 20.9 | 66 | 0.722488 | from rest_framework import serializers
from ..models import BaseModel
class BaseSerializer(serializers.ModelSerializer):
class Meta:
model = BaseModel
fields = '__all__'
| true | true |
f7f7e7744d659793ffbf22a7957247b46d82e28d | 23 | py | Python | user_interface/__init__.py | pablomodernell/lorawan_conformance_testing | 3e6b9028ee7a6a614e52bac684e396ecd04fd10c | [
"MIT"
] | 1 | 2020-09-10T14:12:07.000Z | 2020-09-10T14:12:07.000Z | user_interface/__init__.py | pablomodernell/lorawan_conformance_testing | 3e6b9028ee7a6a614e52bac684e396ecd04fd10c | [
"MIT"
] | null | null | null | user_interface/__init__.py | pablomodernell/lorawan_conformance_testing | 3e6b9028ee7a6a614e52bac684e396ecd04fd10c | [
"MIT"
] | null | null | null | API_VERSION = "1.0.15"
| 11.5 | 22 | 0.652174 | API_VERSION = "1.0.15"
| true | true |
f7f7e9f37f322d1bf969bfa0dcb88a6aad61503b | 2,076 | py | Python | var/spack/repos/builtin/packages/openkim-models/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/openkim-models/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/openkim-models/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-05-06T00:17:46.000Z | 2021-05-06T00:17:46.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class OpenkimModels(CMakePackage):
"""OpenKIM is an online framework for making molecular simula... | 39.923077 | 89 | 0.665222 |
from spack import *
class OpenkimModels(CMakePackage):
homepage = "https://openkim.org/"
url = "https://s3.openkim.org/archives/collection/openkim-models-2019-07-25.txz"
maintainers = ['ellio167']
extends('kim-api')
depends_on('kim-api@2.1.0:', when='@2019-07-25:')
depends_on('kim-... | true | true |
f7f7eacf047c1833e8d4d6076067b8cce1660859 | 3,215 | py | Python | siga/siga/settings.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | null | null | null | siga/siga/settings.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | 2 | 2021-03-19T03:21:17.000Z | 2021-03-30T13:24:07.000Z | siga/siga/settings.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | null | null | null | """
Django settings for siga project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Bu... | 25.314961 | 91 | 0.692691 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '-6yk-0ry&n=6a!rcgw(aa^4gn*$$gx3ixt3y4amg#7*kv^1*t1'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f7f7eb1fd5997f8121a2d808cd4ea3eb3505e636 | 4,630 | py | Python | tasks/views.py | igorxcardoso/todo-list-django | e8745e3370ab50a83612fc5a268cad04ac84f465 | [
"MIT"
] | null | null | null | tasks/views.py | igorxcardoso/todo-list-django | e8745e3370ab50a83612fc5a268cad04ac84f465 | [
"MIT"
] | null | null | null | tasks/views.py | igorxcardoso/todo-list-django | e8745e3370ab50a83612fc5a268cad04ac84f465 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required # Esse docoreto vai impedir usuários não autorizados acessem rotas protegidas
from django.http import HttpResponse
from django.contrib import messages
from django.core.paginator import Paginator # ... | 37.33871 | 135 | 0.737149 | from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.contrib import messages
from django.core.paginator import Paginator
from django.contrib.auth.views import (PasswordChangeView, PasswordResetView, ... | true | true |
f7f7eb5f7e3d44c78e8b12465d9b24340f2d06e5 | 1,155 | py | Python | Tools/scripts/ptags.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 5 | 2022-03-26T21:53:36.000Z | 2022-03-30T21:47:20.000Z | Tools/scripts/ptags.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 6 | 2020-11-18T15:48:14.000Z | 2021-05-03T21:20:50.000Z | Tools/scripts/ptags.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 2 | 2015-07-16T08:14:13.000Z | 2022-03-27T01:55:17.000Z | #! /usr/bin/env python
# ptags
#
# Create a tags file for Python programs, usable with vi.
# Tagged are:
# - functions (even inside other defs or classes)
# - classes
# - filenames
# Warns about files it cannot open.
# No warnings about duplicate tags.
import sys, re, os
tags = [] # Modified global variable!
def... | 22.211538 | 61 | 0.520346 |
import sys, re, os
tags = []
def main():
args = sys.argv[1:]
for file in args: treat_file(file)
if tags:
fp = open('tags', 'w')
tags.sort()
for s in tags: fp.write(s)
expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:\(]'
matcher = re.compile(expr)
def treat... | true | true |
f7f7eef97bf70dfbf3caf85f97c5d3de6e77513d | 11,128 | py | Python | rosleapmotion/scripts/leap_interface.py | Chikurtev/leap_joy | 2bc094baa3634890ebbf86bc582ea3e4a2c3fc6a | [
"BSD-3-Clause"
] | 7 | 2022-02-17T23:29:45.000Z | 2022-03-12T09:23:54.000Z | rosleapmotion/scripts/leap_interface.py | Chikurtev/leap_joy | 2bc094baa3634890ebbf86bc582ea3e4a2c3fc6a | [
"BSD-3-Clause"
] | 1 | 2019-02-21T13:40:48.000Z | 2019-02-21T13:47:37.000Z | rosleapmotion/scripts/leap_interface.py | Chikurtev/leap_joy | 2bc094baa3634890ebbf86bc582ea3e4a2c3fc6a | [
"BSD-3-Clause"
] | 1 | 2019-02-21T13:25:36.000Z | 2019-02-21T13:25:36.000Z | #################################################################################
# Copyright (C) 2012-2013 Leap Motion, Inc. All rights reserved. #
# Leap Motion proprietary and confidential. Not for distribution. #
# Use subject to the terms of the Leap Motion SDK Agreement available at ... | 39.885305 | 128 | 0.573688 | false | true | |
f7f7f0031e041042a7f6b934af86ea828c3f74c4 | 1,827 | py | Python | util3d/cameratex.py | aolkin/text-physics | fa74e20c2461968bd9510a5f5f8ebf92f67c8186 | [
"MIT"
] | null | null | null | util3d/cameratex.py | aolkin/text-physics | fa74e20c2461968bd9510a5f5f8ebf92f67c8186 | [
"MIT"
] | null | null | null | util3d/cameratex.py | aolkin/text-physics | fa74e20c2461968bd9510a5f5f8ebf92f67c8186 | [
"MIT"
] | null | null | null | import cv2
import io
import os
import time
import sys
from redis import Redis
from panda3d.core import CardMaker, Texture, PNMImage
from direct.stdpy import threading, thread
PIPE_FILE = "panda_camera_pipe.pnm"
class CameraReader:
def __init__(self, index=1, pipe=PIPE_FILE):
self.cap = cv2.VideoCapture... | 25.375 | 71 | 0.611932 | import cv2
import io
import os
import time
import sys
from redis import Redis
from panda3d.core import CardMaker, Texture, PNMImage
from direct.stdpy import threading, thread
PIPE_FILE = "panda_camera_pipe.pnm"
class CameraReader:
def __init__(self, index=1, pipe=PIPE_FILE):
self.cap = cv2.VideoCapture... | true | true |
f7f7f0f9faf5b94069127c7a3a753e5fd6a9cd8a | 1,066 | py | Python | EHTask/utils/FileSystem.py | CraneHzm/EHTask | 1d36e326bee8b8d5b9d20761fc24bd2b3fa22aaa | [
"MIT"
] | 15 | 2020-02-26T14:09:48.000Z | 2022-02-24T09:45:11.000Z | DGaze/utils/FileSystem.py | yangjing628/DGaze | 1f547256724f0c0ff7c68baac384b510176222a0 | [
"MIT"
] | null | null | null | DGaze/utils/FileSystem.py | yangjing628/DGaze | 1f547256724f0c0ff7c68baac384b510176222a0 | [
"MIT"
] | 7 | 2020-06-11T02:56:08.000Z | 2021-08-20T05:12:46.000Z | # Copyright (c) 2019/7/13 Hu Zhiming jimmyhu@pku.edu.cn All Rights Reserved.
# process files and directories.
#################### Libs ####################
import os
import shutil
import time
# remove a directory
def RemoveDir(dirName):
if os.path.exists(dirName):
shutil.rmtree(dirName)
else:
print("Invalid... | 19.740741 | 76 | 0.687617 | true | true | |
f7f7f1e1bd5413c2b1680792ede2d1b882897001 | 228 | py | Python | demos/datakit_fut/runDT.py | NoTravel/wtpy | bd48db23ed6eb3157fc97d298b47279c0733d197 | [
"MIT"
] | 164 | 2020-06-18T01:47:31.000Z | 2022-03-30T09:19:42.000Z | demos/datakit_fut/runDT.py | NoTravel/wtpy | bd48db23ed6eb3157fc97d298b47279c0733d197 | [
"MIT"
] | 20 | 2020-12-02T02:57:55.000Z | 2022-03-30T05:25:14.000Z | demos/datakit_fut/runDT.py | NoTravel/wtpy | bd48db23ed6eb3157fc97d298b47279c0733d197 | [
"MIT"
] | 66 | 2020-09-08T03:21:24.000Z | 2022-03-29T08:39:55.000Z | from wtpy import WtDtEngine
if __name__ == "__main__":
#创建一个运行环境,并加入策略
engine = WtDtEngine()
engine.initialize("dtcfg.json", "logcfgdt.json")
engine.run()
kw = input('press any key to exit\n') | 22.8 | 53 | 0.622807 | from wtpy import WtDtEngine
if __name__ == "__main__":
engine = WtDtEngine()
engine.initialize("dtcfg.json", "logcfgdt.json")
engine.run()
kw = input('press any key to exit\n') | true | true |
f7f7f335cdb6d5299819c87c1d07b0c979102fd1 | 27,493 | py | Python | examples/beginner/plot_hdf_utils_read.py | sulaymandesai/pyUSID | fa4d152856e4717c92b1fbe34222eb2e1c042707 | [
"MIT"
] | null | null | null | examples/beginner/plot_hdf_utils_read.py | sulaymandesai/pyUSID | fa4d152856e4717c92b1fbe34222eb2e1c042707 | [
"MIT"
] | null | null | null | examples/beginner/plot_hdf_utils_read.py | sulaymandesai/pyUSID | fa4d152856e4717c92b1fbe34222eb2e1c042707 | [
"MIT"
] | null | null | null | """
================================================================================
04. Utilities for reading h5USID files
================================================================================
**Suhas Somnath**
4/18/2018
**This document illustrates the many handy functions in pyUSID.hdf_utils that signif... | 51.873585 | 151 | 0.645473 | true | true | |
f7f7f415fcb48472a8eda2cf5ca8444622115d93 | 213 | py | Python | actions/get_cluster_configs.py | cognifloyd/stackstorm-opscenter | aabbbc5f236dc48ebc3c72f788f191c8782a5b86 | [
"Apache-2.0"
] | 164 | 2015-01-17T16:08:33.000Z | 2021-08-03T02:34:07.000Z | actions/get_cluster_configs.py | cognifloyd/stackstorm-opscenter | aabbbc5f236dc48ebc3c72f788f191c8782a5b86 | [
"Apache-2.0"
] | 442 | 2015-01-01T11:19:01.000Z | 2017-09-06T23:26:17.000Z | actions/get_cluster_configs.py | cognifloyd/stackstorm-opscenter | aabbbc5f236dc48ebc3c72f788f191c8782a5b86 | [
"Apache-2.0"
] | 202 | 2015-01-13T00:37:40.000Z | 2020-11-07T11:30:10.000Z | import requests
from lib.base import OpscenterAction
class GetClustersAction(OpscenterAction):
def run(self):
url = self._get_full_url(['cluster-configs'])
return requests.get(url).json()
| 17.75 | 53 | 0.70892 | import requests
from lib.base import OpscenterAction
class GetClustersAction(OpscenterAction):
def run(self):
url = self._get_full_url(['cluster-configs'])
return requests.get(url).json()
| true | true |
f7f7f417ba92326d6c01218e170dafcd0b4ad126 | 1,926 | py | Python | ochrona/parser/tox.py | ttw225/ochrona-cli | 974973265091e0e9ff03c8cabad4c3e6ad20ea07 | [
"MIT"
] | null | null | null | ochrona/parser/tox.py | ttw225/ochrona-cli | 974973265091e0e9ff03c8cabad4c3e6ad20ea07 | [
"MIT"
] | null | null | null | ochrona/parser/tox.py | ttw225/ochrona-cli | 974973265091e0e9ff03c8cabad4c3e6ad20ea07 | [
"MIT"
] | null | null | null | from configparser import ConfigParser, NoOptionError
from io import StringIO
from typing import List
from ochrona.const import TOX_LINKED_REQUIREMENTS, INVALID_TOX_LINES, TOX_INI
from ochrona.parser.requirements import RequirementsFile
class ToxFile:
@staticmethod
def parse(file_path: str) -> List[str]:
... | 40.978723 | 86 | 0.526999 | from configparser import ConfigParser, NoOptionError
from io import StringIO
from typing import List
from ochrona.const import TOX_LINKED_REQUIREMENTS, INVALID_TOX_LINES, TOX_INI
from ochrona.parser.requirements import RequirementsFile
class ToxFile:
@staticmethod
def parse(file_path: str) -> List[str]:
... | true | true |
f7f7f6697947b8ed87e964328d3534d73892a439 | 1,480 | py | Python | mgs/v1.2/logger.py | vt-rocksat-2017/dashboard | e99a71edc74dd8b7f3eec023c381524561a7b6e4 | [
"MIT"
] | 1 | 2017-08-09T19:57:38.000Z | 2017-08-09T19:57:38.000Z | vtgs/v1.1/logger.py | vt-rocksat-2017/dashboard | e99a71edc74dd8b7f3eec023c381524561a7b6e4 | [
"MIT"
] | null | null | null | vtgs/v1.1/logger.py | vt-rocksat-2017/dashboard | e99a71edc74dd8b7f3eec023c381524561a7b6e4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Logger utilities
import math, sys, os, time, struct, traceback, binascii, logging
import datetime as dt
class MyFormatter(logging.Formatter):
#Overriding formatter for datetime
converter=dt.datetime.utcfromtimestamp
def formatTime(self, record, datefmt=None):
ct = self.co... | 34.418605 | 93 | 0.662838 |
import math, sys, os, time, struct, traceback, binascii, logging
import datetime as dt
class MyFormatter(logging.Formatter):
converter=dt.datetime.utcfromtimestamp
def formatTime(self, record, datefmt=None):
ct = self.converter(record.created)
if datefmt:
s = ct.strftime(da... | true | true |
f7f7f698fa9513a1d995e2de5d4c0e189995a51c | 623 | py | Python | kYPython/FluentPython/BasicLearn/OOP/Dynamic.py | kyaing/KDYSample | 6a09ef3f7dab18a71187cd81f7da2dd13cf7a4a5 | [
"MIT"
] | 10 | 2017-02-23T07:42:20.000Z | 2017-02-23T07:42:25.000Z | kYPython/FluentPython/BasicLearn/OOP/Dynamic.py | kaideyi/KDYSample | 6a09ef3f7dab18a71187cd81f7da2dd13cf7a4a5 | [
"MIT"
] | null | null | null | kYPython/FluentPython/BasicLearn/OOP/Dynamic.py | kaideyi/KDYSample | 6a09ef3f7dab18a71187cd81f7da2dd13cf7a4a5 | [
"MIT"
] | null | null | null | # coding: utf-8
import types
class Person(object):
# 用 __slots__ 限制了动态添加属性,只能调用定义的属性
# __slots__ = {'name', 'age'}
def __init__(self, name, age):
self.name = name
self.age = age
def eat(self):
print('---eating---')
def run(self):
print('---running---')
@staticmethod
def test():
print('---static meth... | 15.974359 | 46 | 0.637239 |
import types
class Person(object):
def __init__(self, name, age):
self.name = name
self.age = age
def eat(self):
print('---eating---')
def run(self):
print('---running---')
@staticmethod
def test():
print('---static method---')
@classmethod
def test2(cls):
print('---class method---')
p1 = Per... | true | true |
f7f7f89e24cf78c4be7d8140c66f6a0f01a90792 | 8,136 | py | Python | tests/test_layout.py | goodmami/penman | a6030a412cb40ae6f1ab5ccffb2010b36f3169f3 | [
"MIT"
] | 97 | 2016-11-17T16:48:44.000Z | 2022-03-28T09:57:39.000Z | tests/test_layout.py | goodmami/penman | a6030a412cb40ae6f1ab5ccffb2010b36f3169f3 | [
"MIT"
] | 94 | 2016-12-17T01:08:31.000Z | 2022-02-07T11:41:45.000Z | tests/test_layout.py | goodmami/penman | a6030a412cb40ae6f1ab5ccffb2010b36f3169f3 | [
"MIT"
] | 20 | 2017-02-19T15:51:57.000Z | 2021-11-12T19:24:57.000Z |
import random
import logging
import pytest
from penman.exceptions import LayoutError
from penman.model import Model
from penman.tree import Tree
from penman.graph import Graph
from penman.codec import PENMANCodec
from penman import layout
from penman.layout import (
interpret,
rearrange,
configure,
r... | 31.292308 | 76 | 0.468781 |
import random
import logging
import pytest
from penman.exceptions import LayoutError
from penman.model import Model
from penman.tree import Tree
from penman.graph import Graph
from penman.codec import PENMANCodec
from penman import layout
from penman.layout import (
interpret,
rearrange,
configure,
r... | true | true |
f7f7f98a217d70a3deb957c5277285a94b3f466d | 60 | py | Python | test_xixi/__init__.py | jhfwb/test_x | 7db77408b2921698a48ea83742d4dc6e4d460611 | [
"MIT"
] | null | null | null | test_xixi/__init__.py | jhfwb/test_x | 7db77408b2921698a48ea83742d4dc6e4d460611 | [
"MIT"
] | null | null | null | test_xixi/__init__.py | jhfwb/test_x | 7db77408b2921698a48ea83742d4dc6e4d460611 | [
"MIT"
] | null | null | null | from test_xixi.main import xixi_class
__all__=['xixi_class'] | 30 | 37 | 0.833333 | from test_xixi.main import xixi_class
__all__=['xixi_class'] | true | true |
f7f7fb49a9bb6447630ed7b0b8cfa3a1d27ecdcb | 13,412 | py | Python | videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py | deryrahman/google-cloud-python | b55058c4b2328fde32f29bfd8ea04708fcc578e0 | [
"Apache-2.0"
] | null | null | null | videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py | deryrahman/google-cloud-python | b55058c4b2328fde32f29bfd8ea04708fcc578e0 | [
"Apache-2.0"
] | null | null | null | videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py | deryrahman/google-cloud-python | b55058c4b2328fde32f29bfd8ea04708fcc578e0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 49.674074 | 163 | 0.642261 |
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.grpc_helpers
import google.api_core.operation
import google.api_core.operations... | true | true |
f7f7fd30ae8456a6a259690f14028a754355799b | 2,981 | py | Python | tests/integration/test_stdout_exit_codes.py | simaishi/ansible-navigator | 901bc7be11c44ed1aa61340a42916a7b572302d9 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/test_stdout_exit_codes.py | simaishi/ansible-navigator | 901bc7be11c44ed1aa61340a42916a7b572302d9 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/test_stdout_exit_codes.py | simaishi/ansible-navigator | 901bc7be11c44ed1aa61340a42916a7b572302d9 | [
"Apache-2.0",
"MIT"
] | null | null | null | """ check return codes from mode stdout
"""
import os
from typing import NamedTuple
from typing import Tuple
import pytest
from ..defaults import DEFAULT_CONTAINER_IMAGE
from ..defaults import FIXTURES_DIR
PLAYBOOK = os.path.join(FIXTURES_DIR, "integration", "stdout_exit_codes", "site.yml")
@pytest.fixture(name="... | 27.601852 | 85 | 0.635693 | import os
from typing import NamedTuple
from typing import Tuple
import pytest
from ..defaults import DEFAULT_CONTAINER_IMAGE
from ..defaults import FIXTURES_DIR
PLAYBOOK = os.path.join(FIXTURES_DIR, "integration", "stdout_exit_codes", "site.yml")
@pytest.fixture(name="params")
def fixture_params(request):
re... | true | true |
f7f7fd71343031751c75ef71fcf0aeed78e5c18c | 6,298 | py | Python | fuzzer/modules/py_parser.py | FChikh/REST-API-Fuzzer | cbbb03dfa1ac16d42b7372db35ba1804e879e6f6 | [
"MIT"
] | null | null | null | fuzzer/modules/py_parser.py | FChikh/REST-API-Fuzzer | cbbb03dfa1ac16d42b7372db35ba1804e879e6f6 | [
"MIT"
] | null | null | null | fuzzer/modules/py_parser.py | FChikh/REST-API-Fuzzer | cbbb03dfa1ac16d42b7372db35ba1804e879e6f6 | [
"MIT"
] | null | null | null | """
This module is a parser of our fuzzer
It converts from RAML specs to JSON format
"""
import json
import os
from subprocess import PIPE, Popen
def parse(parsed_page, page, data):
"""
Parse data from JSON to usable format, use recursion to parse all data, probably work with RAML v1.0, probably can
be o... | 44.352113 | 130 | 0.48174 |
import json
import os
from subprocess import PIPE, Popen
def parse(parsed_page, page, data):
try:
parsed_page['baseUri'] = page['baseUri']
parsed_page['is_changeable'] = False
parsed_page['type'] = None
except KeyError:
try:
parsed_page['relativeUri'] = page['relat... | true | true |
f7f7fdf776adc9d06b10b84abe16fecb2b89d9e5 | 9,488 | py | Python | docs/gallery/general/linking_data.py | t-b/pynwb | b58e7b003247485120380360bb112bc6b22c7e60 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-04-13T20:47:36.000Z | 2021-04-13T20:47:36.000Z | docs/gallery/general/linking_data.py | t-b/pynwb | b58e7b003247485120380360bb112bc6b22c7e60 | [
"BSD-3-Clause-LBNL"
] | null | null | null | docs/gallery/general/linking_data.py | t-b/pynwb | b58e7b003247485120380360bb112bc6b22c7e60 | [
"BSD-3-Clause-LBNL"
] | null | null | null | '''
Modular Data Storage using External Files
===========================================
PyNWB supports linking between files using external links.
'''
####################
# Example Use Case: Integrating data from multiple files
# ---------------------------------------------------------
#
# NBWContainer classes (e... | 37.952 | 116 | 0.645974 |
s during data acquisition and to
# afterwards link the data into a single NWB:N file. In this case, each recording becomes represented by a
# separate file-system object that can be set as read-only once the experiment is done. In the following
# we are using :py:meth:`~pynwb.base.TimeSeries` as an example, but the s... | true | true |
f7f7fdfdf0fc7ceafca9c8c6a3a8f53f11b3c44d | 733 | py | Python | seq_match_corrector/__init__.py | slntopp/seq_match_corrector | 8f22bc81630b3c90ef43f9f9e275be70b16a96e3 | [
"Apache-2.0"
] | null | null | null | seq_match_corrector/__init__.py | slntopp/seq_match_corrector | 8f22bc81630b3c90ef43f9f9e275be70b16a96e3 | [
"Apache-2.0"
] | null | null | null | seq_match_corrector/__init__.py | slntopp/seq_match_corrector | 8f22bc81630b3c90ef43f9f9e275be70b16a96e3 | [
"Apache-2.0"
] | null | null | null | from difflib import SequenceMatcher
def ratios(target: list, dictionary: list) -> list:
def ratio(word: str):
l = len(word)
return sorted(
filter(
lambda x: x[1] > 0.5,
map(lambda x: [x, SequenceMatcher(None, x, word).ratio()], filter(lambda x: len(x) in ... | 30.541667 | 135 | 0.53206 | from difflib import SequenceMatcher
def ratios(target: list, dictionary: list) -> list:
def ratio(word: str):
l = len(word)
return sorted(
filter(
lambda x: x[1] > 0.5,
map(lambda x: [x, SequenceMatcher(None, x, word).ratio()], filter(lambda x: len(x) in ... | true | true |
f7f7ff4685247bc5bf7e07414362153a88f9b9b9 | 7,736 | py | Python | tests/test_models.py | simkimsia/django-organizations | 720129f8897efd498504af78c208f29b1d823d4c | [
"BSD-2-Clause"
] | 855 | 2015-01-06T21:08:34.000Z | 2022-03-31T04:24:49.000Z | tests/test_models.py | simkimsia/django-organizations | 720129f8897efd498504af78c208f29b1d823d4c | [
"BSD-2-Clause"
] | 156 | 2015-02-09T01:51:40.000Z | 2022-03-29T22:23:01.000Z | tests/test_models.py | simkimsia/django-organizations | 720129f8897efd498504af78c208f29b1d823d4c | [
"BSD-2-Clause"
] | 186 | 2015-01-21T06:21:59.000Z | 2022-03-29T12:44:24.000Z | # -*- coding: utf-8 -*-
from functools import partial
from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
from organizations.models import Organization
from organizations.models import OrganizationInvitation
... | 38.874372 | 86 | 0.702042 |
from functools import partial
from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
from organizations.models import Organization
from organizations.models import OrganizationInvitation
from organizations.mode... | true | true |
f7f7ff860b78f4a08e3ca5831ae247f83c0cd317 | 8,312 | py | Python | src/the_tale/the_tale/game/abilities/deck/help.py | devapromix/the-tale | 2a10efd3270734f8cf482b4cfbc5353ef8f0494c | [
"BSD-3-Clause"
] | 1 | 2020-04-02T11:51:20.000Z | 2020-04-02T11:51:20.000Z | src/the_tale/the_tale/game/abilities/deck/help.py | devapromix/the-tale | 2a10efd3270734f8cf482b4cfbc5353ef8f0494c | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/game/abilities/deck/help.py | devapromix/the-tale | 2a10efd3270734f8cf482b4cfbc5353ef8f0494c | [
"BSD-3-Clause"
] | null | null | null |
import smart_imports
smart_imports.all()
class Help(prototypes.AbilityPrototype):
TYPE = relations.ABILITY_TYPE.HELP
def use_heal(self, task, action, hero, critical):
if critical:
heal_amount = int(hero.heal(hero.max_health * random.uniform(*c.ANGEL_HELP_CRIT_HEAL_FRACTION)))
... | 46.696629 | 148 | 0.705486 |
import smart_imports
smart_imports.all()
class Help(prototypes.AbilityPrototype):
TYPE = relations.ABILITY_TYPE.HELP
def use_heal(self, task, action, hero, critical):
if critical:
heal_amount = int(hero.heal(hero.max_health * random.uniform(*c.ANGEL_HELP_CRIT_HEAL_FRACTION)))
... | true | true |
f7f7ff981455442fbf6680876525a85ec3257852 | 4,579 | py | Python | qa/rpc-tests/multi_rpc.py | ronnpaulcoin/ronpaulcoin | 07c357663483ca7781d2a4fc02746629c4eccfbe | [
"MIT"
] | null | null | null | qa/rpc-tests/multi_rpc.py | ronnpaulcoin/ronpaulcoin | 07c357663483ca7781d2a4fc02746629c4eccfbe | [
"MIT"
] | null | null | null | qa/rpc-tests/multi_rpc.py | ronnpaulcoin/ronpaulcoin | 07c357663483ca7781d2a4fc02746629c4eccfbe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test multiple rpc user config option rpcauth
#
from test_framework.test_framework import BitcoinTest... | 37.842975 | 129 | 0.645556 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import str_to_b64str, assert_equal
import os
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = False
... | true | true |
f7f7ff9ca775addcc2e9c24e3c8fa60a23bc9d70 | 9,779 | py | Python | toontown/battle/Fanfare.py | MasterLoopyBM/Toontown | ebed7fc3f2ef06a529cf02eda7ab46361aceef9d | [
"MIT"
] | 1 | 2020-02-07T18:15:12.000Z | 2020-02-07T18:15:12.000Z | toontown/battle/Fanfare.py | TrueBlueDogemon/Toontown | ebed7fc3f2ef06a529cf02eda7ab46361aceef9d | [
"MIT"
] | null | null | null | toontown/battle/Fanfare.py | TrueBlueDogemon/Toontown | ebed7fc3f2ef06a529cf02eda7ab46361aceef9d | [
"MIT"
] | 2 | 2020-11-08T03:38:35.000Z | 2021-09-02T07:03:47.000Z | from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
from toontown.toon.ToonDNA import *
from toontown.suit.SuitDNA import *
from direct.particles.ParticleEffect import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
import Mov... | 62.685897 | 760 | 0.728909 | from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
from toontown.toon.ToonDNA import *
from toontown.suit.SuitDNA import *
from direct.particles.ParticleEffect import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
import Mov... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.