hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73f0bf78d22c0e4d5f6febde9e80c90c1ab837d | 183 | py | Python | src/exceptions/__init__.py | feaus/crehana_challenge | 28f9b58235d538979550d3776eac2a3fe220e018 | [
"MIT"
] | null | null | null | src/exceptions/__init__.py | feaus/crehana_challenge | 28f9b58235d538979550d3776eac2a3fe220e018 | [
"MIT"
] | null | null | null | src/exceptions/__init__.py | feaus/crehana_challenge | 28f9b58235d538979550d3776eac2a3fe220e018 | [
"MIT"
] | null | null | null | from src.exceptions.exceptions import (
ExternalError,
external_error,
ResourceAlreadySynced,
resource_already_synced,
ResourceNotFound,
resource_not_found,
)
| 20.333333 | 39 | 0.754098 | from src.exceptions.exceptions import (
ExternalError,
external_error,
ResourceAlreadySynced,
resource_already_synced,
ResourceNotFound,
resource_not_found,
)
| true | true |
f73f0cfa409da822ba4b0c69485f38d9f2231cdb | 127 | py | Python | rawpython.py | eyyupdirek/Rawpythn | e66f0adcb8be514f349796d8ecad0a398412409d | [
"Apache-2.0"
] | null | null | null | rawpython.py | eyyupdirek/Rawpythn | e66f0adcb8be514f349796d8ecad0a398412409d | [
"Apache-2.0"
] | null | null | null | rawpython.py | eyyupdirek/Rawpythn | e66f0adcb8be514f349796d8ecad0a398412409d | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
ts = pd.Series(np.random.randn(1000),index=pd.date_range('1/1/2000', periods=1000))
ts
| 21.166667 | 83 | 0.740157 | import pandas as pd
import numpy as np
ts = pd.Series(np.random.randn(1000),index=pd.date_range('1/1/2000', periods=1000))
ts
| true | true |
f73f0d91c0a845a03c5aa376fc702205ae303d8d | 15,525 | py | Python | python/dgl/backend/pytorch/tensor.py | m30m/dgl | 2190c39d674f76c65db9ee8da7b43d3021f19c29 | [
"Apache-2.0"
] | null | null | null | python/dgl/backend/pytorch/tensor.py | m30m/dgl | 2190c39d674f76c65db9ee8da7b43d3021f19c29 | [
"Apache-2.0"
] | null | null | null | python/dgl/backend/pytorch/tensor.py | m30m/dgl | 2190c39d674f76c65db9ee8da7b43d3021f19c29 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from distutils.version import LooseVersion
import scipy # Weird bug in new pytorch when import scipy after import torch
import torch as th
import builtins
from torch.utils import dlpack
from ... import ndarray as nd
from ... import kernel as K
from ...function.base import Targe... | 32.753165 | 97 | 0.647923 | from __future__ import absolute_import
from distutils.version import LooseVersion
import scipy
import torch as th
import builtins
from torch.utils import dlpack
from ... import ndarray as nd
from ... import kernel as K
from ...function.base import TargetCode
from ...base import dgl_warning
if LooseVersion(th.__ver... | true | true |
f73f0e67c233bbfb163f3dbb2a123ef52db7a6f7 | 191 | py | Python | Modules/Test.py | Bamgm14/GarbBot-Framework- | b7a900f3994e6c7715714b56a492a2c28916305c | [
"MIT"
] | null | null | null | Modules/Test.py | Bamgm14/GarbBot-Framework- | b7a900f3994e6c7715714b56a492a2c28916305c | [
"MIT"
] | null | null | null | Modules/Test.py | Bamgm14/GarbBot-Framework- | b7a900f3994e6c7715714b56a492a2c28916305c | [
"MIT"
] | 1 | 2021-01-17T14:40:28.000Z | 2021-01-17T14:40:28.000Z | import os
def test_picture(bot):
bot.send(os.getcwd() + "\\Temp\\selenium-python.png","This is a test")
def test_text(bot):
bot.typer(' '.join(bot.message.split(' ')[1:]),bot.textbox) | 38.2 | 74 | 0.659686 | import os
def test_picture(bot):
bot.send(os.getcwd() + "\\Temp\\selenium-python.png","This is a test")
def test_text(bot):
bot.typer(' '.join(bot.message.split(' ')[1:]),bot.textbox) | true | true |
f73f0e8fbc6132b36e0535617fbdea7c1b365bb6 | 640 | py | Python | python/cudf/cudf/core/mixins/reductions.py | Ahsantw/cudf | e099688d5ca7dd20104930485a829881a68c522a | [
"Apache-2.0"
] | 239 | 2018-10-10T09:55:22.000Z | 2018-10-28T20:47:23.000Z | python/cudf/cudf/core/mixins/reductions.py | Ahsantw/cudf | e099688d5ca7dd20104930485a829881a68c522a | [
"Apache-2.0"
] | 25 | 2018-10-10T14:46:32.000Z | 2018-10-28T22:16:14.000Z | python/cudf/cudf/core/mixins/reductions.py | Ahsantw/cudf | e099688d5ca7dd20104930485a829881a68c522a | [
"Apache-2.0"
] | 19 | 2018-10-10T12:42:51.000Z | 2018-10-26T16:33:22.000Z | # Copyright (c) 2022, NVIDIA CORPORATION.
from .mixin_factory import _create_delegating_mixin
Reducible = _create_delegating_mixin(
"Reducible",
"Mixin encapsulating reduction operations.",
"REDUCTION",
"_reduce",
{
"sum",
"product",
"min",
"max",
"count",
... | 17.777778 | 51 | 0.453125 |
from .mixin_factory import _create_delegating_mixin
Reducible = _create_delegating_mixin(
"Reducible",
"Mixin encapsulating reduction operations.",
"REDUCTION",
"_reduce",
{
"sum",
"product",
"min",
"max",
"count",
"any",
"all",
"sum... | true | true |
f73f0f5f99b6da07549e119f0106b3ff7f23d020 | 2,755 | py | Python | experiments/train/exact_pixelcnn_quad.py | didriknielsen/pixelcnn_flow | 9030f6a66d5ff83d7d299541ed55b20b20bb9a15 | [
"MIT"
] | 25 | 2020-02-12T00:35:48.000Z | 2021-09-18T14:30:43.000Z | experiments/train/exact_pixelcnn_quad.py | didriknielsen/pixelcnn_flow | 9030f6a66d5ff83d7d299541ed55b20b20bb9a15 | [
"MIT"
] | 1 | 2021-08-05T10:00:04.000Z | 2021-08-10T11:11:16.000Z | experiments/train/exact_pixelcnn_quad.py | didriknielsen/pixelcnn_flow | 9030f6a66d5ff83d7d299541ed55b20b20bb9a15 | [
"MIT"
] | null | null | null | # General
import torch
import torch.nn as nn
import torch.nn.functional as F
# Setup
from setups import CategoricalImageFlowSetup
# Data
from pixelflow.data import CategoricalCIFAR10
# Model
from pixelflow.flows import AutoregressiveSubsetFlow2d
from pixelflow.transforms.subset import QuadraticSplineAutoregressiveSu... | 33.192771 | 149 | 0.544465 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from setups import CategoricalImageFlowSetup
from pixelflow.data import CategoricalCIFAR10
from pixelflow.flows import AutoregressiveSubsetFlow2d
from pixelflow.transforms.subset import QuadraticSplineAutoregressiveSubsetTransform2d
from pixelflo... | true | true |
f73f0fc3f2b45fb9c783204f3eca94aec4cbebea | 4,059 | py | Python | models/iter_mask/segformerb5_pascal_itermask_v3.py | qinliuliuqin/ritm_interactive_segmentation | f9ac9387bf51e85d908fef922d06792987f12493 | [
"MIT"
] | 14 | 2021-12-09T08:33:23.000Z | 2022-03-26T13:11:01.000Z | models/iter_mask/segformerb5_pascal_itermask_v3.py | qinliuliuqin/iSegFormer | 67b634588cc0a1e09fb3e092966eae997eb209fa | [
"MIT"
] | null | null | null | models/iter_mask/segformerb5_pascal_itermask_v3.py | qinliuliuqin/iSegFormer | 67b634588cc0a1e09fb3e092966eae997eb209fa | [
"MIT"
] | 1 | 2022-03-12T03:53:56.000Z | 2022-03-12T03:53:56.000Z | from isegm.utils.exp_imports.default import *
from isegm.model.modeling.transformer_helper.cross_entropy_loss import CrossEntropyLoss
MODEL_NAME = 'pascal_segformerb5'
def main(cfg):
model, model_cfg = init_model(cfg)
train(model, cfg, model_cfg)
def init_model(cfg):
model_cfg = edict()
model_cfg.c... | 33 | 102 | 0.612959 | from isegm.utils.exp_imports.default import *
from isegm.model.modeling.transformer_helper.cross_entropy_loss import CrossEntropyLoss
MODEL_NAME = 'pascal_segformerb5'
def main(cfg):
model, model_cfg = init_model(cfg)
train(model, cfg, model_cfg)
def init_model(cfg):
model_cfg = edict()
model_cfg.c... | true | true |
f73f10704c91ce8f183574c33ac79b4bacde04a1 | 47,784 | py | Python | py/desispec/pipeline/db.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | 24 | 2015-09-29T06:06:29.000Z | 2022-01-14T07:31:45.000Z | py/desispec/pipeline/db.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | 1,452 | 2015-02-26T00:14:23.000Z | 2022-03-31T23:35:10.000Z | py/desispec/pipeline/db.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | 25 | 2015-02-06T21:39:13.000Z | 2022-02-22T14:16:31.000Z | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desispec.pipeline.db
===========================
Pipeline processing database
"""
from __future__ import absolute_import, division, print_function
import os
import re
from collections import OrderedDict
from contextlib impor... | 36.2 | 237 | 0.52009 |
from __future__ import absolute_import, division, print_function
import os
import re
from collections import OrderedDict
from contextlib import contextmanager
import numpy as np
from desiutil.log import get_logger
from .. import io
import fitsio
from .defs import (task_states, task_int_to_state, task_state... | true | true |
f73f1437f96764bcfd0f244a9a20517b60b2eac0 | 904 | py | Python | src/utils/IrreflexiveObjectPropertiesDetector.py | IDLabResearch/lovstats | dd33183574eed692ee89059ff3c6494160dfb8a9 | [
"MIT"
] | 1 | 2018-12-11T13:57:38.000Z | 2018-12-11T13:57:38.000Z | src/utils/IrreflexiveObjectPropertiesDetector.py | IDLabResearch/lovstats | dd33183574eed692ee89059ff3c6494160dfb8a9 | [
"MIT"
] | null | null | null | src/utils/IrreflexiveObjectPropertiesDetector.py | IDLabResearch/lovstats | dd33183574eed692ee89059ff3c6494160dfb8a9 | [
"MIT"
] | null | null | null |
from RestrictionTypeDetector import RestrictionTypeDetector
from RestrictionTypeDetector import TYPE_INT
from RestrictionTypeDetector import MEASURE_OCCURRENCE
class IrreflexiveObjectPropertiesDetector(RestrictionTypeDetector):
"""
This class serves as interface for all Restriction Type Statistics of irreflex... | 39.304348 | 109 | 0.786504 |
from RestrictionTypeDetector import RestrictionTypeDetector
from RestrictionTypeDetector import TYPE_INT
from RestrictionTypeDetector import MEASURE_OCCURRENCE
class IrreflexiveObjectPropertiesDetector(RestrictionTypeDetector):
def __init__(self):
super(IrreflexiveObjectPropertiesDetector, self).__init__(... | true | true |
f73f147c28868e8fd1d9070a0519cee40508ddb0 | 3,328 | py | Python | first_interfaces/main_keyboard_recorder_v2.py | SilasPDJ/pythonRecorder | a25bde4ee25911c46054b4a1ebbdc7ee10460b6f | [
"MIT"
] | null | null | null | first_interfaces/main_keyboard_recorder_v2.py | SilasPDJ/pythonRecorder | a25bde4ee25911c46054b4a1ebbdc7ee10460b6f | [
"MIT"
] | null | null | null | first_interfaces/main_keyboard_recorder_v2.py | SilasPDJ/pythonRecorder | a25bde4ee25911c46054b4a1ebbdc7ee10460b6f | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import filedialog, messagebox
from os import path
import pickle
from utils import MyKeyboardV001
import time
import threading
from functools import partial
class Application(tk.Frame):
class MyButton(tk.Button):
def __init__(self, *args, **kwargs):
tk.Button.... | 29.451327 | 136 | 0.589844 | import tkinter as tk
from tkinter import filedialog, messagebox
from os import path
import pickle
from utils import MyKeyboardV001
import time
import threading
from functools import partial
class Application(tk.Frame):
class MyButton(tk.Button):
def __init__(self, *args, **kwargs):
tk.Button.... | true | true |
f73f14ab38de8cc77c45aba189c58eb12fb4cf1a | 3,884 | py | Python | online_learning_plugins/sklearn/tools/dataset/2017-08-22_v0.0.1.py | IRC-SPHERE/SklearnHyperStream | 7799e0ea15135fe5cb2935bdd39b471c53ccf0ff | [
"MIT"
] | 3 | 2017-11-27T11:12:35.000Z | 2019-12-25T12:33:17.000Z | online_learning_plugins/sklearn/tools/dataset/2017-08-22_v0.0.1.py | IRC-SPHERE/SklearnHyperStream | 7799e0ea15135fe5cb2935bdd39b471c53ccf0ff | [
"MIT"
] | 5 | 2017-08-22T19:25:26.000Z | 2017-11-27T10:58:58.000Z | online_learning_plugins/sklearn/tools/dataset/2017-08-22_v0.0.1.py | IRC-SPHERE/SklearnHyperStream | 7799e0ea15135fe5cb2935bdd39b471c53ccf0ff | [
"MIT"
] | 1 | 2018-11-19T08:01:55.000Z | 2018-11-19T08:01:55.000Z | # The MIT License (MIT)
# Copyright (c) 2014-2017 University of Bristol
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | 40.884211 | 79 | 0.633368 |
from hyperstream import Tool, StreamInstance
from hyperstream.utils import check_input_stream_count
from datetime import datetime, timedelta
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import label_binarize
import numpy as np
from pytz import UTC
class Datase... | true | true |
f73f14f1a66dbbe69b28099d375176c06325df2c | 2,200 | py | Python | Lecture-15/download_data.py | dataminingapp/dataminingapp | 87da9ea26bdbad3273220aeff86857b7bdf81b26 | [
"MIT"
] | 33 | 2015-01-20T18:43:17.000Z | 2021-09-29T11:25:20.000Z | Lecture-15/download_data.py | dataminingapp/dataminingapp | 87da9ea26bdbad3273220aeff86857b7bdf81b26 | [
"MIT"
] | 1 | 2015-02-27T15:56:52.000Z | 2015-02-27T15:56:52.000Z | Lecture-15/download_data.py | dataminingapp/dataminingapp | 87da9ea26bdbad3273220aeff86857b7bdf81b26 | [
"MIT"
] | 37 | 2015-01-16T20:22:39.000Z | 2021-09-29T11:49:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s OUTPUT_DIRECTORY URL1 [URL2 ...]
Download all files pointed at by the given URLs, into OUTPUT_DIRECTORY (which must... | 31.884058 | 198 | 0.665 |
import os
import sys
import logging
import requests
logger = logging.getLogger("download_data")
DEFAULT_URLS = [
'http://people.csail.mit.edu/jrennie/20Newsgroups/20news-bydate.tar.gz',
'http://dumps.wikimedia.org/simplewiki/20140623/simplewiki-20140623-pages-articles.xml.bz2',
'http://dumps.wiki... | true | true |
f73f1526c7f05d6b07ff8acd6c2aa5b09a2d1f19 | 7,204 | py | Python | python/cudf/cudf/tests/test_udf_masked_ops.py | gdaisukesuzuki/cudf | aa5c8b686b1513dba7bce168200c1259f1eda908 | [
"Apache-2.0"
] | 1 | 2021-08-19T15:45:01.000Z | 2021-08-19T15:45:01.000Z | python/cudf/cudf/tests/test_udf_masked_ops.py | gdaisukesuzuki/cudf | aa5c8b686b1513dba7bce168200c1259f1eda908 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_udf_masked_ops.py | gdaisukesuzuki/cudf | aa5c8b686b1513dba7bce168200c1259f1eda908 | [
"Apache-2.0"
] | null | null | null | import operator
import pandas as pd
import pytest
from numba import cuda
import cudf
from cudf.core.udf.pipeline import nulludf
from cudf.testing._utils import NUMERIC_TYPES, assert_eq
arith_ops = [
operator.add,
operator.sub,
operator.mul,
operator.truediv,
operator.floordiv,
operator.mod,
... | 24.587031 | 78 | 0.583703 | import operator
import pandas as pd
import pytest
from numba import cuda
import cudf
from cudf.core.udf.pipeline import nulludf
from cudf.testing._utils import NUMERIC_TYPES, assert_eq
arith_ops = [
operator.add,
operator.sub,
operator.mul,
operator.truediv,
operator.floordiv,
operator.mod,
... | true | true |
f73f16abb27744be1cda7d0a59239fcbe4cb6b6b | 26,472 | py | Python | flow/visualize/time_space_diagram.py | AHammoudeh/Flow_AH | 16c5641be3e9e85511756f75efd002478edaee9b | [
"MIT"
] | null | null | null | flow/visualize/time_space_diagram.py | AHammoudeh/Flow_AH | 16c5641be3e9e85511756f75efd002478edaee9b | [
"MIT"
] | null | null | null | flow/visualize/time_space_diagram.py | AHammoudeh/Flow_AH | 16c5641be3e9e85511756f75efd002478edaee9b | [
"MIT"
] | null | null | null | """Generate a time space diagram for some networks.
This method accepts as input a csv file containing the sumo-formatted emission
file, and then uses this data to generate a time-space diagram, with the x-axis
being the time (in seconds), the y-axis being the position of a vehicle, and
color representing the speed of... | 37.442716 | 104 | 0.598368 | from flow.utils.rllib import get_flow_params
from flow.networks import RingNetwork, FigureEightNetwork, MergeNetwork, I210SubNetwork, HighwayNetwork
import argparse
import csv
try:
from matplotlib import pyplot as plt
except ImportError:
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import ... | true | true |
f73f173be87244e1613cc0bf5a4b3400417d4966 | 38,917 | py | Python | uniparser_morph/morph_parser.py | fmatter/uniparser-morph | 2ef884f226d73dc24409191b8e5e45b202725aa6 | [
"MIT"
] | null | null | null | uniparser_morph/morph_parser.py | fmatter/uniparser-morph | 2ef884f226d73dc24409191b8e5e45b202725aa6 | [
"MIT"
] | null | null | null | uniparser_morph/morph_parser.py | fmatter/uniparser-morph | 2ef884f226d73dc24409191b8e5e45b202725aa6 | [
"MIT"
] | null | null | null | import re
import copy
import time
from .common_functions import GLOSS_EMPTY, GLOSS_STEM, GLOSS_STEM_FORCED, GLOSS_STARTWITHSELF, POS_NONFINAL
from .paradigm import Paradigm, Inflexion
from .wordform import Wordform
from .clitic import SIDE_ENCLITIC, SIDE_PROCLITIC, SIDE_OTHER
from .morph_fst import MorphFST
class Par... | 44.52746 | 111 | 0.500964 | import re
import copy
import time
from .common_functions import GLOSS_EMPTY, GLOSS_STEM, GLOSS_STEM_FORCED, GLOSS_STARTWITHSELF, POS_NONFINAL
from .paradigm import Paradigm, Inflexion
from .wordform import Wordform
from .clitic import SIDE_ENCLITIC, SIDE_PROCLITIC, SIDE_OTHER
from .morph_fst import MorphFST
class Par... | true | true |
f73f176d5d9ae027534f1d786c3387ef837160f2 | 6,445 | py | Python | gui/callback.py | CraigCiccone/crc_encrypt | 7f157a2a2c0ded67e75c315c9bbbf63bee4339b5 | [
"MIT"
] | 1 | 2019-12-13T17:22:47.000Z | 2019-12-13T17:22:47.000Z | gui/callback.py | CraigCiccone/crc_encrypt | 7f157a2a2c0ded67e75c315c9bbbf63bee4339b5 | [
"MIT"
] | null | null | null | gui/callback.py | CraigCiccone/crc_encrypt | 7f157a2a2c0ded67e75c315c9bbbf63bee4339b5 | [
"MIT"
] | null | null | null | """GUI call back functions and related helper functions."""
from functools import partial
from pathlib import Path
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.filechooser import FileChooserIconView
from kivy.uix.modalview import ModalView
from kivy.uix.rst import RstDocum... | 32.550505 | 79 | 0.707215 |
from functools import partial
from pathlib import Path
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.filechooser import FileChooserIconView
from kivy.uix.modalview import ModalView
from kivy.uix.rst import RstDocument
from kivy.uix.popup import Popup
from kivy.utils import ... | true | true |
f73f177641afbd5cf8da217055c5a23a17b3ad7d | 748 | py | Python | regexlib/python_re_test_file/regexlib_1484.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | 1 | 2022-01-24T14:43:23.000Z | 2022-01-24T14:43:23.000Z | regexlib/python_re_test_file/regexlib_1484.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | regexlib/python_re_test_file/regexlib_1484.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | # 1484
# <a[a-zA-Z0-9 ="'.:;?]*(href=[\"\'](http:\/\/|\.\/|\/)?\w+(\.\w+)*(\/\w+(\.\w+)?)*(\/|\?\w*=\w*(&\w*=\w*)*)?[\"\'])*(>[a-zA-Z0-9 ="'<>.:;?]*</a>)
# POLYNOMIAL
# nums:4
# POLYNOMIAL AttackString:"<a"+"href="0""*5000+"! _1_POA(i)"
import re
from time import perf_counter
regex = """<a[a-zA-Z0-9 ="'.:;?]*(href=[\... | 39.368421 | 158 | 0.453209 |
import re
from time import perf_counter
regex = """<a[a-zA-Z0-9 ="'.:;?]*(href=[\"\'](http:\/\/|\.\/|\/)?\w+(\.\w+)*(\/\w+(\.\w+)?)*(\/|\?\w*=\w*(&\w*=\w*)*)?[\"\'])*(>[a-zA-Z0-9 ="'<>.:;?]*</a>)"""
REGEX = re.compile(regex)
for i in range(0, 150000):
ATTACK = "<a" + "href=\"0\"" * i * 10000 + "! _1_POA(i)"
... | true | true |
f73f195e4e78f20b66530eafe660e97479f71af1 | 27,016 | py | Python | second/protos/optimizer_pb2.py | leo-muhendislik/second.pytorch | 449c7c0d081eaad44f08159f64af26d2a59f1f4c | [
"MIT"
] | 819 | 2018-12-17T03:34:12.000Z | 2022-03-31T04:17:58.000Z | second/protos/optimizer_pb2.py | zdforient/second.pytorch | 449c7c0d081eaad44f08159f64af26d2a59f1f4c | [
"MIT"
] | 25 | 2019-10-24T07:38:20.000Z | 2022-02-28T02:58:45.000Z | second/protos/optimizer_pb2.py | zdforient/second.pytorch | 449c7c0d081eaad44f08159f64af26d2a59f1f4c | [
"MIT"
] | 258 | 2018-12-17T03:34:14.000Z | 2022-03-26T11:55:27.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: second/protos/optimizer.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import refl... | 44.071778 | 2,464 | 0.772653 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db =... | true | true |
f73f1a02a2a8bd34b8c81ed357b4a90a751bda85 | 8,251 | py | Python | test/functional/mempool_persist.py | davidreband/doichain-core | 4389bbb1c898a62a83e5f2825a5fa12c44aaa07d | [
"MIT"
] | 2 | 2020-09-27T19:55:50.000Z | 2020-09-28T06:48:13.000Z | test/functional/mempool_persist.py | davidreband/doichain-core | 4389bbb1c898a62a83e5f2825a5fa12c44aaa07d | [
"MIT"
] | 18 | 2020-10-31T01:04:18.000Z | 2020-11-03T19:25:27.000Z | test/functional/mempool_persist.py | davidreband/doichain-core | 4389bbb1c898a62a83e5f2825a5fa12c44aaa07d | [
"MIT"
] | 2 | 2020-12-31T10:51:23.000Z | 2021-01-27T11:31:18.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 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 mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on sta... | 46.353933 | 207 | 0.695794 |
from decimal import Decimal
import os
import time
from test_framework.p2p import P2PTxInvStore
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_greater_than_or_equal,
assert_raises_rpc_error,
connect_nodes,
disconnect_nodes,
)... | true | true |
f73f1a04629aa825f8f8d7332cfb09f1564967e0 | 278 | py | Python | app/utils.py | kevin-corb/FastAPI | 13517a15e05ecac0894ece2df83fc81de243b0bd | [
"MIT"
] | null | null | null | app/utils.py | kevin-corb/FastAPI | 13517a15e05ecac0894ece2df83fc81de243b0bd | [
"MIT"
] | null | null | null | app/utils.py | kevin-corb/FastAPI | 13517a15e05ecac0894ece2df83fc81de243b0bd | [
"MIT"
] | null | null | null | from passlib.context import CryptContext
pwd_context = CryptContext(schemes=['bcrypt'],deprecated='auto')
def hash(password: str):
return pwd_context.hash(password)
def verify(plain_password,hashed_password):
return pwd_context.verify(plain_password,hashed_password) | 27.8 | 64 | 0.802158 | from passlib.context import CryptContext
pwd_context = CryptContext(schemes=['bcrypt'],deprecated='auto')
def hash(password: str):
return pwd_context.hash(password)
def verify(plain_password,hashed_password):
return pwd_context.verify(plain_password,hashed_password) | true | true |
f73f1a4587d75cfbccc63c9c31d03e94823ac468 | 1,267 | py | Python | stdplugins/hack.py | sahilgamer07d/Sahil-Gamer-2 | a74ab6f72da748945b957223baf65edd7b4de13e | [
"Apache-2.0"
] | null | null | null | stdplugins/hack.py | sahilgamer07d/Sahil-Gamer-2 | a74ab6f72da748945b957223baf65edd7b4de13e | [
"Apache-2.0"
] | 1 | 2021-02-08T20:47:13.000Z | 2021-02-08T20:47:13.000Z | stdplugins/hack.py | sahilgamer07d/Sahil-Gamer-2 | a74ab6f72da748945b957223baf65edd7b4de13e | [
"Apache-2.0"
] | null | null | null | """command: .hack to create a false hack"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 2
animation_ttl = range(0, 11)
input_str = event.pattern_match.grou... | 25.857143 | 113 | 0.441989 |
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 2
animation_ttl = range(0, 11)
input_str = event.pattern_match.group(1)
if input_str == "hack":
a... | true | true |
f73f1ae57e2f102d061b290c45aad4b5ca389422 | 10,566 | py | Python | scripts/plot_results_kf_dependence.py | jonassagild/Track-to-Track-Fusion | 6bb7fbe6a6e2d9a2713c47f211899226485eee79 | [
"MIT"
] | 4 | 2021-06-16T19:33:56.000Z | 2022-03-14T06:47:41.000Z | scripts/plot_results_kf_dependence.py | jonassagild/Track-to-Track-Fusion | 6bb7fbe6a6e2d9a2713c47f211899226485eee79 | [
"MIT"
] | 2 | 2021-06-08T16:18:45.000Z | 2021-11-25T09:38:08.000Z | scripts/plot_results_kf_dependence.py | jonassagild/Track-to-Track-Fusion | 6bb7fbe6a6e2d9a2713c47f211899226485eee79 | [
"MIT"
] | 4 | 2020-09-28T04:54:17.000Z | 2021-10-15T15:58:38.000Z | """plot_stuff script to plot things
Just temporary code to plot things. Not for producing results, but for testing code.
"""
import numpy as np
import scipy
from stonesoup.types.state import GaussianState
from matplotlib import pyplot as plt
from matplotlib.patches import Ellipse
from trackers.kalman_filter_dependen... | 40.953488 | 119 | 0.594359 | import numpy as np
import scipy
from stonesoup.types.state import GaussianState
from matplotlib import pyplot as plt
from matplotlib.patches import Ellipse
from trackers.kalman_filter_dependent_fusion import kalman_filter_dependent_fusion
from utils.scenario_generator import generate_scenario_2
from utils import ope... | true | true |
f73f1ba77d0a6856ebfd9b65ea5933cc208156a5 | 299 | py | Python | tests/test_dnsx.py | riccigrj/habu | 336a5d771edd318b01a94a9b793e2706ad4ccd2e | [
"BSD-3-Clause"
] | 461 | 2017-05-27T15:35:13.000Z | 2019-11-30T23:13:15.000Z | tests/test_dnsx.py | kobbycyber/habu | cda99c8df97fe669c8e45148615ba546b1f8226e | [
"BSD-3-Clause"
] | 10 | 2017-10-12T09:43:23.000Z | 2019-06-21T17:25:09.000Z | tests/test_dnsx.py | kobbycyber/habu | cda99c8df97fe669c8e45148615ba546b1f8226e | [
"BSD-3-Clause"
] | 108 | 2017-09-23T19:55:23.000Z | 2019-11-30T19:08:32.000Z | from habu.lib import dnsx
def test_mx():
assert 'aspmx.l.google.com.' in dnsx.mx('google.com')
def test_ns():
assert 'ns1.google.com.' in dnsx.ns('google.com')
def test_axfr_fail():
assert not dnsx.axfr('google.com')
def test_axfr_success():
assert dnsx.axfr('zonetransfer.me')
| 19.933333 | 57 | 0.685619 | from habu.lib import dnsx
def test_mx():
assert 'aspmx.l.google.com.' in dnsx.mx('google.com')
def test_ns():
assert 'ns1.google.com.' in dnsx.ns('google.com')
def test_axfr_fail():
assert not dnsx.axfr('google.com')
def test_axfr_success():
assert dnsx.axfr('zonetransfer.me')
| true | true |
f73f1cd808da427eaf901ec4b570dd98a8f7ffde | 978 | py | Python | psqlextra/models/options.py | adamchainz/django-postgres-extra | c11dbb5b75e16f7bd8fd336cc051806cf587269f | [
"MIT"
] | 529 | 2017-03-20T08:16:30.000Z | 2022-03-31T13:23:09.000Z | psqlextra/models/options.py | adamchainz/django-postgres-extra | c11dbb5b75e16f7bd8fd336cc051806cf587269f | [
"MIT"
] | 137 | 2017-06-08T07:59:22.000Z | 2022-02-07T08:34:38.000Z | psqlextra/models/options.py | adamchainz/django-postgres-extra | c11dbb5b75e16f7bd8fd336cc051806cf587269f | [
"MIT"
] | 67 | 2017-06-21T10:01:13.000Z | 2022-02-24T21:23:24.000Z | from typing import Dict, List, Optional, Union
from psqlextra.types import PostgresPartitioningMethod, SQLWithParams
class PostgresPartitionedModelOptions:
"""Container for :see:PostgresPartitionedModel options.
This is where attributes copied from the model's `PartitioningMeta`
are held.
"""
d... | 28.764706 | 75 | 0.690184 | from typing import Dict, List, Optional, Union
from psqlextra.types import PostgresPartitioningMethod, SQLWithParams
class PostgresPartitionedModelOptions:
def __init__(self, method: PostgresPartitioningMethod, key: List[str]):
self.method = method
self.key = key
self.original_attrs: Dic... | true | true |
f73f1da09c3b3e3d5bc0f4e42f368dbd55a63d4e | 17,197 | py | Python | sympy/polys/matrices/tests/test_ddm.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/polys/matrices/tests/test_ddm.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/polys/matrices/tests/test_ddm.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | from sympy.testing.pytest import raises
from sympy.external.gmpy import HAS_GMPY
from sympy.polys import ZZ, QQ
from sympy.polys.matrices.ddm import DDM
from sympy.polys.matrices.exceptions import (
DMShapeError, DMNonInvertibleMatrixError, DMDomainError,
DMBadInputError)
def test_DDM_init():
... | 30.818996 | 95 | 0.463627 | from sympy.testing.pytest import raises
from sympy.external.gmpy import HAS_GMPY
from sympy.polys import ZZ, QQ
from sympy.polys.matrices.ddm import DDM
from sympy.polys.matrices.exceptions import (
DMShapeError, DMNonInvertibleMatrixError, DMDomainError,
DMBadInputError)
def test_DDM_init():
... | true | true |
f73f1f30bd7b178a943713281b3dfb91694df1af | 1,906 | py | Python | sharpy-sc2/sharpy/plans/require/any.py | etzhang416/sharpy-bot-eco | badc68ad1aa903dfa1bbc33f6225608e433ff353 | [
"Unlicense"
] | null | null | null | sharpy-sc2/sharpy/plans/require/any.py | etzhang416/sharpy-bot-eco | badc68ad1aa903dfa1bbc33f6225608e433ff353 | [
"Unlicense"
] | null | null | null | sharpy-sc2/sharpy/plans/require/any.py | etzhang416/sharpy-bot-eco | badc68ad1aa903dfa1bbc33f6225608e433ff353 | [
"Unlicense"
] | null | null | null | import warnings
from typing import List, Callable, Union
from sharpy.plans.require.methods import merge_to_require
from sharpy.plans.require import RequireBase
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sharpy.knowledges import Knowledge
class Any(RequireBase):
"""Check passes if any of the con... | 31.766667 | 94 | 0.649003 | import warnings
from typing import List, Callable, Union
from sharpy.plans.require.methods import merge_to_require
from sharpy.plans.require import RequireBase
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sharpy.knowledges import Knowledge
class Any(RequireBase):
def __init__(
self,
... | true | true |
f73f1f81a21eaf1d9ca242572f90f4b8e6565cff | 91,189 | py | Python | lib/wallet.py | deeponion/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | 3 | 2018-09-29T13:50:29.000Z | 2019-05-18T23:09:44.000Z | lib/wallet.py | truongdoithuong/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | null | null | null | lib/wallet.py | truongdoithuong/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | 5 | 2018-09-29T13:50:34.000Z | 2020-11-21T12:46:41.000Z | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... | 38.476371 | 150 | 0.585345 |
import os
import threading
import random
import time
import json
import copy
import errno
import traceback
from functools import partial
from collections import defaultdict
from numbers import Number
from decimal import Decimal
import itertools
import sys
from .i18n import _
from .util im... | true | true |
f73f20c1188ca7e2a4a92e0a4084fa59f5ca0a4d | 5,262 | py | Python | repo/plugin.video.frenchdj.media.center/resources/lib/sources/ororo_tv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.frenchdj.media.center/resources/lib/sources/ororo_tv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.frenchdj.media.center/resources/lib/sources/ororo_tv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | 35.795918 | 119 | 0.576017 |
import re,urllib,urlparse
from resources.lib.libraries import control
from resources.lib.libraries import cleantitle
from resources.lib.libraries import client
class source:
def __init__(self):
self.cookie = None
self.headers = {'User-Agent': 'Specto for Kodi'}
self.lang= 'locale=en;... | true | true |
f73f21098036499c1a8f0a8f0964b2d9c1f3f31c | 498 | py | Python | tests/sample_package.py | lancondrej/freeconf | 8d05d358ab24a85b775ad39f0bace8475fff792f | [
"Unlicense"
] | null | null | null | tests/sample_package.py | lancondrej/freeconf | 8d05d358ab24a85b775ad39f0bace8475fff792f | [
"Unlicense"
] | null | null | null | tests/sample_package.py | lancondrej/freeconf | 8d05d358ab24a85b775ad39f0bace8475fff792f | [
"Unlicense"
] | null | null | null | import unittest
from src.Presenter.main_presenter import MainPresenter
import os
class SamplePackageTestCase(unittest.TestCase):
def setUp(self):
os.chdir('../')
self.main_presenter = MainPresenter()
self.package_presenter = self.main_presenter.load_package(
'sample_package')... | 22.636364 | 66 | 0.698795 | import unittest
from src.Presenter.main_presenter import MainPresenter
import os
class SamplePackageTestCase(unittest.TestCase):
def setUp(self):
os.chdir('../')
self.main_presenter = MainPresenter()
self.package_presenter = self.main_presenter.load_package(
'sample_package')... | true | true |
f73f21cf91d644e47a0aac2de84aca2d031656a5 | 17,288 | py | Python | examples/MLM_Training_transformers.py | gkuling/BIRADS_BERT | f218d05283df90e536b210efbb4fab1d6dff082d | [
"MIT"
] | 1 | 2021-11-08T15:14:26.000Z | 2021-11-08T15:14:26.000Z | examples/MLM_Training_transformers.py | gkuling/BIRADS_BERT | f218d05283df90e536b210efbb4fab1d6dff082d | [
"MIT"
] | null | null | null | examples/MLM_Training_transformers.py | gkuling/BIRADS_BERT | f218d05283df90e536b210efbb4fab1d6dff082d | [
"MIT"
] | 1 | 2022-03-11T15:59:58.000Z | 2022-03-11T15:59:58.000Z | '''
Copyright (c) 2020, Martel Lab, Sunnybrook Research Institute
Codes inspired by Hugging Face Transformers package code run_mlm.py
https://github.com/huggingface/transformers/blob/main/examples/pytorch/
language-modeling/run_mlm.py
Description: Training code used to train a BERT embedding in Masked Language
Modelin... | 39.201814 | 80 | 0.626851 | import sys
sys.path.append('.')
import argparse
import os
import torch
import logging
import random
import numpy as np
from transformers import BertConfig, BertForMaskedLM, AdamW, \
get_linear_schedule_with_warmup, BertTokenizer
from torch.utils.data import DataLoader, SequentialSampler, RandomSampler
from tqdm im... | true | true |
f73f222ed69fe5bf64b610fd9a86973bd2fbf189 | 1,547 | py | Python | tests/cephfs/cephfs_vol_management/cephfs_vol_mgmt_subvolume_gid_uid.py | julpark-rh/cephci | 3796668e8dcfc5851f387c47ff0b459d495a40c7 | [
"MIT"
] | null | null | null | tests/cephfs/cephfs_vol_management/cephfs_vol_mgmt_subvolume_gid_uid.py | julpark-rh/cephci | 3796668e8dcfc5851f387c47ff0b459d495a40c7 | [
"MIT"
] | null | null | null | tests/cephfs/cephfs_vol_management/cephfs_vol_mgmt_subvolume_gid_uid.py | julpark-rh/cephci | 3796668e8dcfc5851f387c47ff0b459d495a40c7 | [
"MIT"
] | null | null | null | import json
import random
import string
import traceback
from tests.cephfs.cephfs_utilsV1 import FsUtils
from utility.log import Log
log = Log(__name__)
def run(ceph_cluster, **kw):
"""
Test operation:
1. Create a subvolume
2. Check info for the subvolume
3. Check if gid and uid are set to 0
... | 28.648148 | 82 | 0.599871 | import json
import random
import string
import traceback
from tests.cephfs.cephfs_utilsV1 import FsUtils
from utility.log import Log
log = Log(__name__)
def run(ceph_cluster, **kw):
try:
tc = "CEPH-83574181"
log.info(f"Running CephFS tests for BZ-{tc}")
fs_util = FsUtils(ceph_cluster)
... | true | true |
f73f2304a3beb3fe5ac974c97979e20a9e1cf7e8 | 901 | py | Python | app/modules/verifications.py | PaulloClara/cav | e613a86b26023bee790ff168cdeebc784ad4d472 | [
"MIT"
] | 1 | 2019-06-08T20:04:01.000Z | 2019-06-08T20:04:01.000Z | app/modules/verifications.py | PaulloClara/cav | e613a86b26023bee790ff168cdeebc784ad4d472 | [
"MIT"
] | null | null | null | app/modules/verifications.py | PaulloClara/cav | e613a86b26023bee790ff168cdeebc784ad4d472 | [
"MIT"
] | null | null | null | class Verifications(object):
def __init__(self):
pass
def correct_functionality(self, user_input, keywords, functionalities):
for functionality in functionalities:
functionality['keywords_found'] = []
for keyword in keywords:
if keyword['value'] in user_input:
... | 34.653846 | 78 | 0.650388 | class Verifications(object):
def __init__(self):
pass
def correct_functionality(self, user_input, keywords, functionalities):
for functionality in functionalities:
functionality['keywords_found'] = []
for keyword in keywords:
if keyword['value'] in user_input:
... | true | true |
f73f23431177d90092a624ae9eeee96f810ed12e | 1,613 | py | Python | bili/bili/pipelines.py | MRmac1/net-spiders | 58ab204852b31ee3a7ac5df7776602f929a6d8cc | [
"Intel"
] | null | null | null | bili/bili/pipelines.py | MRmac1/net-spiders | 58ab204852b31ee3a7ac5df7776602f929a6d8cc | [
"Intel"
] | null | null | null | bili/bili/pipelines.py | MRmac1/net-spiders | 58ab204852b31ee3a7ac5df7776602f929a6d8cc | [
"Intel"
] | null | null | null | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
import pymysql
from pymysql import cursors
DB_HOST = '172.20.52.114'
DB_PORT = 33... | 29.87037 | 117 | 0.637322 |
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
import pymysql
from pymysql import cursors
DB_HOST = '172.20.52.114'
DB_PORT = 3306
DB_NAME = 'bili'
DB_USER = 'root'
DB_PASS = 'sensegear'
class BiliPipeline:
def __init__(sel... | true | true |
f73f247bed69525138c506352df64da3310c43b5 | 1,268 | py | Python | data_managers/data_manager_star_index_builder/data_manager/rna_star_index_builder.py | ic4f/tools-iuc | abfd3162e28a388d1dedbe55cb8b3567fa79c178 | [
"MIT"
] | 1 | 2020-10-16T13:19:44.000Z | 2020-10-16T13:19:44.000Z | data_managers/data_manager_star_index_builder/data_manager/rna_star_index_builder.py | ic4f/tools-iuc | abfd3162e28a388d1dedbe55cb8b3567fa79c178 | [
"MIT"
] | 2 | 2018-04-16T17:38:53.000Z | 2019-09-19T06:55:26.000Z | data_managers/data_manager_star_index_builder/data_manager/rna_star_index_builder.py | ic4f/tools-iuc | abfd3162e28a388d1dedbe55cb8b3567fa79c178 | [
"MIT"
] | 2 | 2018-09-12T14:56:37.000Z | 2019-07-16T00:30:14.000Z | #!/usr/bin/env python
import argparse
import json
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config-file')
parser.add_argument('--value')
parser.add_argument('--dbkey')
parser.add_argument('--name')
parser.add_argument('--subdir')
parser.add_argument('--data-tab... | 25.877551 | 84 | 0.543375 |
import argparse
import json
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config-file')
parser.add_argument('--value')
parser.add_argument('--dbkey')
parser.add_argument('--name')
parser.add_argument('--subdir')
parser.add_argument('--data-table')
parser.add_a... | true | true |
f73f252580c2a2d31905dbb46924c4f62df15218 | 268 | py | Python | Chapter11/toupper.py | PacktPublishing/Modernizing-Oracle-Tuxedo-Applications-with-Python | 32bf39da8c0b8351123701c307447aa18142cc1e | [
"MIT"
] | 2 | 2021-06-26T17:43:06.000Z | 2022-02-21T10:12:42.000Z | Chapter11/toupper.py | PacktPublishing/Modernizing-Oracle-Tuxedo-Applications-with-Python | 32bf39da8c0b8351123701c307447aa18142cc1e | [
"MIT"
] | null | null | null | Chapter11/toupper.py | PacktPublishing/Modernizing-Oracle-Tuxedo-Applications-with-Python | 32bf39da8c0b8351123701c307447aa18142cc1e | [
"MIT"
] | null | null | null | import socket
import sys
sock = socket.socket()
sock.bind(("", 8765))
sock.listen(1)
while True:
con, addr = sock.accept()
while True:
c = con.recv(1024)
print(c)
r = c.decode().upper().encode()
print(r)
con.sendall(r)
| 17.866667 | 39 | 0.55597 | import socket
import sys
sock = socket.socket()
sock.bind(("", 8765))
sock.listen(1)
while True:
con, addr = sock.accept()
while True:
c = con.recv(1024)
print(c)
r = c.decode().upper().encode()
print(r)
con.sendall(r)
| true | true |
f73f2539cfbb39f9ff596219c470841c2acb2e89 | 1,126 | py | Python | visualisation/model.py | syl-yilan/pavement-cracking-recognition | 1f6e6cffa5c469092e284ecda4a513d8ba0932cc | [
"Apache-2.0"
] | null | null | null | visualisation/model.py | syl-yilan/pavement-cracking-recognition | 1f6e6cffa5c469092e284ecda4a513d8ba0932cc | [
"Apache-2.0"
] | null | null | null | visualisation/model.py | syl-yilan/pavement-cracking-recognition | 1f6e6cffa5c469092e284ecda4a513d8ba0932cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import keras.applications as app
def get_model(name='vgg16'):
if name == 'vgg16':
model = app.vgg16.VGG16(weights='imagenet')
preprocess_input = app.vgg16.preprocess_input
if name == 'vgg19':
model = app.vgg19.VGG19(weights='imagenet')
preproce... | 38.827586 | 65 | 0.657194 |
import keras.applications as app
def get_model(name='vgg16'):
if name == 'vgg16':
model = app.vgg16.VGG16(weights='imagenet')
preprocess_input = app.vgg16.preprocess_input
if name == 'vgg19':
model = app.vgg19.VGG19(weights='imagenet')
preprocess_input = app.vgg19.pre... | true | true |
f73f2721cb401f2038ef9020ab1b03853e63a09f | 18,551 | py | Python | cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py | liangintel/stx-cinder | f4c43797a3f8c0caebfd8fb67244c084d26d9741 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py | liangintel/stx-cinder | f4c43797a3f8c0caebfd8fb67244c084d26d9741 | [
"Apache-2.0"
] | 2 | 2018-10-25T13:04:01.000Z | 2019-08-17T13:15:24.000Z | cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py | liangintel/stx-cinder | f4c43797a3f8c0caebfd8fb67244c084d26d9741 | [
"Apache-2.0"
] | 2 | 2018-10-17T13:32:50.000Z | 2018-11-08T08:39:39.000Z | # Copyright (c) 2015 Tom Barron. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 43.546948 | 78 | 0.671716 |
import ddt
import mock
from os_brick.remotefs import remotefs as remotefs_brick
from oslo_utils import units
from cinder import exception
from cinder.objects import fields
from cinder import test
from cinder.tests.unit.volume.drivers.netapp.dataontap import fakes as fake
from cinder.tests.unit.volume.dri... | true | true |
f73f273207fc4050e1eb8040ac65f549cbaa4c07 | 1,420 | py | Python | notes/algo-ds-practice/problems/dp/maximize_happiness_of_group.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/dp/maximize_happiness_of_group.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/dp/maximize_happiness_of_group.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | '''
A trip to mystical land is going to be organized in ByteLand, the city of Bytes.
Unfortunately, there are limited seats say A and there are N number of groups of people.
Every group can have old person o, child c, man m and woman w.
The organizing committee wants to maximize the happiness value of the trip.
Happine... | 37.368421 | 153 | 0.707746 | true | true | |
f73f29d520b36afa533aa6218f68dff409399a62 | 25,352 | py | Python | app/service/rest_svc.py | neoysal/caldera | da87ebf3a7f2a89d9aa87a1e170790b3dfa735bb | [
"Apache-2.0"
] | null | null | null | app/service/rest_svc.py | neoysal/caldera | da87ebf3a7f2a89d9aa87a1e170790b3dfa735bb | [
"Apache-2.0"
] | null | null | null | app/service/rest_svc.py | neoysal/caldera | da87ebf3a7f2a89d9aa87a1e170790b3dfa735bb | [
"Apache-2.0"
] | null | null | null | import asyncio
import copy
import glob
import os
import pathlib
import uuid
from datetime import time
import yaml
from aiohttp import web
from app.objects.c_adversary import Adversary
from app.objects.c_operation import Operation
from app.objects.c_schedule import Schedule
from app.objects.secondclass.c_fact import F... | 48.942085 | 135 | 0.617072 | import asyncio
import copy
import glob
import os
import pathlib
import uuid
from datetime import time
import yaml
from aiohttp import web
from app.objects.c_adversary import Adversary
from app.objects.c_operation import Operation
from app.objects.c_schedule import Schedule
from app.objects.secondclass.c_fact import F... | true | true |
f73f2ab3a9f15b9a5fb100cced084256b99dedad | 726 | py | Python | clients/serializers.py | bonetou/django-api-clients | d727b6dc60a2d62149dca12bd31f7b43b1e04210 | [
"MIT"
] | null | null | null | clients/serializers.py | bonetou/django-api-clients | d727b6dc60a2d62149dca12bd31f7b43b1e04210 | [
"MIT"
] | null | null | null | clients/serializers.py | bonetou/django-api-clients | d727b6dc60a2d62149dca12bd31f7b43b1e04210 | [
"MIT"
] | null | null | null | from django.db.models import fields
from rest_framework import serializers
from clients.models import Client
from clients.validators import *
class ClientSerializer(serializers.ModelSerializer):
class Meta:
model = Client
fields = '__all__'
def validate(self, data):
if not name_valid(d... | 40.333333 | 110 | 0.690083 | from django.db.models import fields
from rest_framework import serializers
from clients.models import Client
from clients.validators import *
class ClientSerializer(serializers.ModelSerializer):
class Meta:
model = Client
fields = '__all__'
def validate(self, data):
if not name_valid(d... | true | true |
f73f2e392b1048abb55918b907c099ee620e895d | 4,317 | py | Python | hint/01-theo-BTC/02_DQN-5-cations/02_closest-gold/Miner-Testing-CodeSample-Approach1/build/MINER_STATE.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | hint/01-theo-BTC/02_DQN-5-cations/02_closest-gold/Miner-Testing-CodeSample-Approach1/build/MINER_STATE.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | 1 | 2022-02-10T02:27:10.000Z | 2022-02-10T02:27:10.000Z | hint/01/Miner-Testing-CodeSample-Approach1/build/MINER_STATE.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | import json
def str_2_json(str):
return json.loads(str, encoding="utf-8")
class MapInfo:
def __init__(self):
self.max_x = 0
self.max_y = 0
self.golds = []
self.obstacles = []
self.numberOfPlayers = 0
self.maxStep = 0
def init_map(self, gameInfo):
... | 34.261905 | 111 | 0.53602 | import json
def str_2_json(str):
return json.loads(str, encoding="utf-8")
class MapInfo:
def __init__(self):
self.max_x = 0
self.max_y = 0
self.golds = []
self.obstacles = []
self.numberOfPlayers = 0
self.maxStep = 0
def init_map(self, gameInfo):
... | true | true |
f73f2e52213228d54738393ba720851e985b267c | 151 | py | Python | 102_misPaquetes/progs/main2.py | josuerojasq/netacad_python | 510c3a026f83e499144d91c00edc5045a8304a08 | [
"MIT"
] | null | null | null | 102_misPaquetes/progs/main2.py | josuerojasq/netacad_python | 510c3a026f83e499144d91c00edc5045a8304a08 | [
"MIT"
] | null | null | null | 102_misPaquetes/progs/main2.py | josuerojasq/netacad_python | 510c3a026f83e499144d91c00edc5045a8304a08 | [
"MIT"
] | null | null | null | from sys import path
path.append('/home/joerojas/Desarrollo/Curso-Basico-Python/102_misPaquetes/packages')
from extra.iota import FunI
print(FunI()) | 21.571429 | 85 | 0.801325 | from sys import path
path.append('/home/joerojas/Desarrollo/Curso-Basico-Python/102_misPaquetes/packages')
from extra.iota import FunI
print(FunI()) | true | true |
f73f2e6532c14eb1ed23b72ade0d769c335818c6 | 1,667 | py | Python | blog_sites/bsoup/dicts/constants.py | frankdevhub/Blog-Documents | 46a94a7e944dc7a4a4c1d2e4d581ffe84810a844 | [
"MIT"
] | 1 | 2021-09-04T23:42:27.000Z | 2021-09-04T23:42:27.000Z | blog_sites/bsoup/dicts/constants.py | frankdevhub/Blog-Documents | 46a94a7e944dc7a4a4c1d2e4d581ffe84810a844 | [
"MIT"
] | null | null | null | blog_sites/bsoup/dicts/constants.py | frankdevhub/Blog-Documents | 46a94a7e944dc7a4a4c1d2e4d581ffe84810a844 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File :constants.py
@Author :frankdevhub@gmail.com
@Blog : http://blog.frankdevhub.site
@Date :2021/9/4 18:34
"""
class Xpath:
"""
selenium dicts
web element attribute name
页面对象常用属性参数
"""
def __init__(self):
pass
ATTRIBUTE_NAM... | 29.245614 | 101 | 0.686263 |
class Xpath:
def __init__(self):
pass
ATTRIBUTE_NAME = "name"
ATTRIBUTE_TITLE = "title"
ATTRIBUTE_TARGET = "target"
ATTRIBUTE_HREF = "href"
ATTRIBUTE_CLASS = "class"
ATTRIBUTE_VALUE = "value"
class WebLinks:
def __init__(self):
pass
BAI_DU = "https://www.baidu.c... | true | true |
f73f2f38949fa2ac5e551cbc86728c2c970ff62d | 17,328 | py | Python | aix360/data/ted_data/GenerateData.py | PurplePean/AIX360 | 4037d6347c40405f342b07da5d341fcd21081cfa | [
"Apache-2.0"
] | 1 | 2019-10-21T20:07:44.000Z | 2019-10-21T20:07:44.000Z | aix360/data/ted_data/GenerateData.py | PurplePean/AIX360 | 4037d6347c40405f342b07da5d341fcd21081cfa | [
"Apache-2.0"
] | 12 | 2020-01-28T23:06:13.000Z | 2022-02-10T00:23:14.000Z | aix360/data/ted_data/GenerateData.py | dwiggles/AIX360-withdata | 0a71cfe372b91078dd7887d7597371e09d84f968 | [
"Apache-2.0"
] | 1 | 2020-04-20T08:15:36.000Z | 2020-04-20T08:15:36.000Z | # This file will generate a synthetic dataset to predict employee attrition
# Like most datasets it will have a feature vector and a Y label for each instance.
# However, unlike most datasets it will also have an Explanation (E) for each instance, encoded as an non-negative integer.
# This is motivated by the TED fr... | 42.058252 | 135 | 0.586911 |
# See the tutorial notebook TED_Cartesian_test for information about how to use this dataset and the TED framework.
# The comments in this code also provide some insight into how this dataset is generated
import random
from random import choices
import pandas as pd
Any = -99 # This is only applicable in... | true | true |
f73f30c0e8498ec79142d238ab499b63b78e9ed2 | 14,498 | py | Python | venv/lib/python3.5/site-packages/gi/types.py | joseluis8906/fancychat | c67bec8c0273f77c9070bb2b7e23421a7ca5bc11 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/gi/types.py | joseluis8906/fancychat | c67bec8c0273f77c9070bb2b7e23421a7ca5bc11 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/gi/types.py | joseluis8906/fancychat | c67bec8c0273f77c9070bb2b7e23421a7ca5bc11 | [
"MIT"
] | null | null | null | # -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2005-2009 Johan Dahlin <johan@gnome.org>
#
# types.py: base types for introspected items.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public... | 38.973118 | 97 | 0.609808 |
from __future__ import absolute_import
import sys
import warnings
import re
from ._constants import TYPE_INVALID
from .docstring import generate_doc_string
from ._gi import \
InterfaceInfo, \
ObjectInfo, \
StructInfo, \
VFuncInfo, \
register_interface_info, \
hook_up_vfu... | true | true |
f73f3229723eb1558d69389dc115b0c6b4076b43 | 10,522 | py | Python | main.py | asadziach/CarND-Semantic-Segmentation | c3431ab5dc3878b82bfc66e7384005f7a93fcb16 | [
"MIT"
] | 25 | 2018-06-11T16:31:02.000Z | 2020-10-08T00:49:06.000Z | main.py | asadziach/CarND-Semantic-Segmentation | c3431ab5dc3878b82bfc66e7384005f7a93fcb16 | [
"MIT"
] | null | null | null | main.py | asadziach/CarND-Semantic-Segmentation | c3431ab5dc3878b82bfc66e7384005f7a93fcb16 | [
"MIT"
] | 8 | 2018-03-23T20:11:55.000Z | 2020-05-08T06:03:35.000Z | import os.path
import tensorflow as tf
import helper
import ImageProcessor
import warnings
from distutils.version import LooseVersion
import project_tests as tests
import scipy.misc
from glob import glob
from moviepy.editor import VideoFileClip
import time
import timeit
# Check TensorFlow Version
assert LooseVersion(t... | 39.856061 | 112 | 0.67069 | import os.path
import tensorflow as tf
import helper
import ImageProcessor
import warnings
from distutils.version import LooseVersion
import project_tests as tests
import scipy.misc
from glob import glob
from moviepy.editor import VideoFileClip
import time
import timeit
assert LooseVersion(tf.__version__) >= LooseVer... | true | true |
f73f331d78d39ea66fdc7aa79025c59b77dedde4 | 3,131 | py | Python | tools/mask2geojson.py | huilin16/PaddleRS | ca0d6223d8e56cd3bd3cbd3a033c89f1718ce26a | [
"Apache-2.0"
] | 40 | 2022-02-28T02:07:28.000Z | 2022-03-31T09:54:29.000Z | tools/mask2geojson.py | huilin16/PaddleRS | ca0d6223d8e56cd3bd3cbd3a033c89f1718ce26a | [
"Apache-2.0"
] | 5 | 2022-03-15T12:13:33.000Z | 2022-03-31T15:54:08.000Z | tools/mask2geojson.py | huilin16/PaddleRS | ca0d6223d8e56cd3bd3cbd3a033c89f1718ce26a | [
"Apache-2.0"
] | 20 | 2022-02-28T02:07:31.000Z | 2022-03-31T11:40:40.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 38.182927 | 100 | 0.619291 |
import codecs
import argparse
import cv2
import numpy as np
import geojson
from geojson import Polygon, Feature, FeatureCollection
from utils import Raster, Timer
def _gt_convert(x, y, geotf):
x_geo = geotf[0] + x * geotf[1] + y * geotf[2]
y_geo = geotf[3] + x * geotf[4] + y * ge... | true | true |
f73f33c25f856da017646f514ee3f19811bcc845 | 6,025 | py | Python | official/core/train_lib.py | Lufeifeina/models | d7d260d4c690e5163070e21d75df372ab559ea23 | [
"Apache-2.0"
] | 1 | 2020-09-14T10:46:07.000Z | 2020-09-14T10:46:07.000Z | official/core/train_lib.py | Lufeifeina/models | d7d260d4c690e5163070e21d75df372ab559ea23 | [
"Apache-2.0"
] | null | null | null | official/core/train_lib.py | Lufeifeina/models | d7d260d4c690e5163070e21d75df372ab559ea23 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.42236 | 80 | 0.719336 |
import os
from typing import Any, Mapping, Optional, Tuple, List
from absl import logging
import orbit
import tensorflow as tf
from official.core import actions
from official.core import base_task
from official.core import base_trainer
from official.core import config_definitions
from official.core i... | true | true |
f73f341e6c0f64358232f8378060a49ad98ba6c1 | 3,833 | py | Python | python/examples/onnx/onnx2lbann.py | jonesholger/lbann | 3214f189a1438565d695542e076c4fa8e7332d34 | [
"Apache-2.0"
] | 194 | 2016-07-19T15:40:21.000Z | 2022-03-19T08:06:10.000Z | python/examples/onnx/onnx2lbann.py | jonesholger/lbann | 3214f189a1438565d695542e076c4fa8e7332d34 | [
"Apache-2.0"
] | 1,021 | 2016-07-19T12:56:31.000Z | 2022-03-29T00:41:47.000Z | python/examples/onnx/onnx2lbann.py | jonesholger/lbann | 3214f189a1438565d695542e076c4fa8e7332d34 | [
"Apache-2.0"
] | 74 | 2016-07-28T18:24:00.000Z | 2022-01-24T19:41:04.000Z | #!/usr/bin/env python3
"""
Convert an ONNX model to a LBANN model
Run "./onnx2lbann.py --help" for more details.
"""
import argparse
import onnx
import google.protobuf.text_format as txtf
import lbann.onnx.o2l
from lbann.lbann_proto import lbann_pb2
dataLayerName = "image"
labelLayerName = "label"
probLayerName = "... | 38.33 | 119 | 0.608923 |
import argparse
import onnx
import google.protobuf.text_format as txtf
import lbann.onnx.o2l
from lbann.lbann_proto import lbann_pb2
dataLayerName = "image"
labelLayerName = "label"
probLayerName = "prob"
crossEntropyLayerName = "cross_entropy"
top1AccuracyLayerName = "top1_accuracy"
top5AccuracyLayerName = "top5_... | true | true |
f73f352174e8f1cf41fc658cb1f47d6d1ba9e7ba | 6,376 | py | Python | Unbiased_LTR/data_utils.py | April-Cai/Unbiased-Learning-to-Rank-with-Unbiased-Propensity-Estimation | 74f83be4b96bbd5909218f3e476dc2bffbeea5da | [
"Apache-2.0"
] | null | null | null | Unbiased_LTR/data_utils.py | April-Cai/Unbiased-Learning-to-Rank-with-Unbiased-Propensity-Estimation | 74f83be4b96bbd5909218f3e476dc2bffbeea5da | [
"Apache-2.0"
] | null | null | null | Unbiased_LTR/data_utils.py | April-Cai/Unbiased-Learning-to-Rank-with-Unbiased-Propensity-Estimation | 74f83be4b96bbd5909218f3e476dc2bffbeea5da | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.28655 | 107 | 0.675345 |
import numpy as np
import json
import random
import os
from six.moves import xrange
class Raw_data:
def __init__(self, data_path = None, file_prefix = None, rank_cut=500):
if data_path == None:
self.embed_size = -1
self.rank_list_size = -1
self.features = []
self.dids = []
self.initia... | true | true |
f73f36370f047e4cca06d0200994a6438c3709d3 | 6,167 | py | Python | model-optimizer/extensions/middle/UpsampleToResample.py | szabi-luxonis/openvino | c8dd831fc3ba68a256ab47edb4f6bf3cb5e804be | [
"Apache-2.0"
] | 1 | 2022-01-19T15:36:45.000Z | 2022-01-19T15:36:45.000Z | model-optimizer/extensions/middle/UpsampleToResample.py | szabi-luxonis/openvino | c8dd831fc3ba68a256ab47edb4f6bf3cb5e804be | [
"Apache-2.0"
] | 30 | 2020-11-13T11:44:07.000Z | 2022-02-21T13:03:16.000Z | model-optimizer/extensions/middle/UpsampleToResample.py | szabi-luxonis/openvino | c8dd831fc3ba68a256ab47edb4f6bf3cb5e804be | [
"Apache-2.0"
] | 1 | 2020-12-18T15:47:45.000Z | 2020-12-18T15:47:45.000Z | """
Copyright (C) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 43.125874 | 114 | 0.605481 |
import logging as log
import math
from typing import Dict
import numpy as np
from extensions.ops.Cast import Cast
from extensions.ops.elementwise import Mul
from extensions.ops.interpolate import Interpolate
from mo.front.common.layout import get_height_dim, get_width_dim, get_depth_dim
from mo.front.common.partial_... | true | true |
f73f363756f77bf4bf6a9c12af78ba1aa2254949 | 143 | py | Python | introcs-1.0/3throot.py | JaydenYL/Projects | b51c0476f7be80f0b0d6aa84592966ecb4343d76 | [
"MIT"
] | 5 | 2021-09-06T04:27:56.000Z | 2021-12-14T14:50:27.000Z | introcs-1.0/3throot.py | JaydenYL/Projects | b51c0476f7be80f0b0d6aa84592966ecb4343d76 | [
"MIT"
] | null | null | null | introcs-1.0/3throot.py | JaydenYL/Projects | b51c0476f7be80f0b0d6aa84592966ecb4343d76 | [
"MIT"
] | null | null | null | import sys
import stdio
MIN = 1e-10
c = float(sys.argv[1])
t = c
while abs(t - c/(t*t)) > MIN*t:
t = (c/(t*t) +2*t)/3
stdio.writeln(t)
| 11 | 31 | 0.552448 | import sys
import stdio
MIN = 1e-10
c = float(sys.argv[1])
t = c
while abs(t - c/(t*t)) > MIN*t:
t = (c/(t*t) +2*t)/3
stdio.writeln(t)
| true | true |
f73f3670365d943c7bf8e4e5820a7a75a90342e4 | 14,687 | py | Python | dipper/sources/Ensembl.py | nicholsn/dipper | 17281945471b63c3fc9111b46f647f2b3da67f47 | [
"BSD-3-Clause"
] | null | null | null | dipper/sources/Ensembl.py | nicholsn/dipper | 17281945471b63c3fc9111b46f647f2b3da67f47 | [
"BSD-3-Clause"
] | null | null | null | dipper/sources/Ensembl.py | nicholsn/dipper | 17281945471b63c3fc9111b46f647f2b3da67f47 | [
"BSD-3-Clause"
] | null | null | null | import logging
import urllib
import csv
import http
import xml.etree.ElementTree as etree
from dipper.sources.Source import Source
from dipper.models.Model import Model
from dipper.models.Genotype import Genotype
from dipper.models.BiolinkVocabulary import BioLinkVocabulary as blv
from datetime import datetime
LOG = ... | 38.447644 | 88 | 0.551644 | import logging
import urllib
import csv
import http
import xml.etree.ElementTree as etree
from dipper.sources.Source import Source
from dipper.models.Model import Model
from dipper.models.Genotype import Genotype
from dipper.models.BiolinkVocabulary import BioLinkVocabulary as blv
from datetime import datetime
LOG = ... | true | true |
f73f37da6096ebe8b6e7c5b539df69597fa55e2a | 2,064 | py | Python | stib_administraciones/contactos/models.py | nfheredia/stib-administraciones | 05dae746d2fecf75c1d50c4ee679c02ddbf7208a | [
"BSD-3-Clause"
] | null | null | null | stib_administraciones/contactos/models.py | nfheredia/stib-administraciones | 05dae746d2fecf75c1d50c4ee679c02ddbf7208a | [
"BSD-3-Clause"
] | null | null | null | stib_administraciones/contactos/models.py | nfheredia/stib-administraciones | 05dae746d2fecf75c1d50c4ee679c02ddbf7208a | [
"BSD-3-Clause"
] | 1 | 2020-10-28T15:46:48.000Z | 2020-10-28T15:46:48.000Z | # -*- coding: utf-8 -*-
from django.db import models
from ..core.models import TimeStampedModel, ModelStatus
from ..edificios.models import Edificios
class Contactos(TimeStampedModel, ModelStatus):
"""
Contáctos de un edificio
"""
edificio = models.ForeignKey(Edificios, verbose_name='Edificio')
... | 36.857143 | 86 | 0.65843 |
from django.db import models
from ..core.models import TimeStampedModel, ModelStatus
from ..edificios.models import Edificios
class Contactos(TimeStampedModel, ModelStatus):
edificio = models.ForeignKey(Edificios, verbose_name='Edificio')
nombre = models.CharField(blank=False,
... | true | true |
f73f38c87171a4b4e48dba954e3cfb965f1e0934 | 2,594 | py | Python | scripts/rs_srd.py | sdss/robostrategy | 2eeaca6abd04f1ce9b8bd86f02aabc09e0123d0e | [
"BSD-3-Clause"
] | null | null | null | scripts/rs_srd.py | sdss/robostrategy | 2eeaca6abd04f1ce9b8bd86f02aabc09e0123d0e | [
"BSD-3-Clause"
] | null | null | null | scripts/rs_srd.py | sdss/robostrategy | 2eeaca6abd04f1ce9b8bd86f02aabc09e0123d0e | [
"BSD-3-Clause"
] | null | null | null | import sys
import slurm
try:
observatory = sys.argv[1]
except:
print("Specify observatory! (apo, lco, or both)")
sys.exit()
try:
startat = sys.argv[2]
except:
startat = 'rs_fields'
plan = 'zeta-0'
if((observatory == 'apo') | (observatory == 'lco')):
observatories = [observat... | 26.742268 | 93 | 0.543177 | import sys
import slurm
try:
observatory = sys.argv[1]
except:
print("Specify observatory! (apo, lco, or both)")
sys.exit()
try:
startat = sys.argv[2]
except:
startat = 'rs_fields'
plan = 'zeta-0'
if((observatory == 'apo') | (observatory == 'lco')):
observatories = [observat... | true | true |
f73f390fe28227799fd0093d2c3cff11a7ecff05 | 1,192 | py | Python | allure-behave/setup.py | SAmorozov/allure-python | 254896906dd3b739685729d13e5cfabbbe212772 | [
"Apache-2.0"
] | null | null | null | allure-behave/setup.py | SAmorozov/allure-python | 254896906dd3b739685729d13e5cfabbbe212772 | [
"Apache-2.0"
] | null | null | null | allure-behave/setup.py | SAmorozov/allure-python | 254896906dd3b739685729d13e5cfabbbe212772 | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup
PACKAGE = "allure-behave"
VERSION = "2.5.5"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Quality Assurance',
'Topic ::... | 25.913043 | 70 | 0.645973 | import os
from setuptools import setup
PACKAGE = "allure-behave"
VERSION = "2.5.5"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Quality Assurance',
'Topic ::... | true | true |
f73f39c0033db6d9628a45b87ade03ef46d6fe9e | 656 | py | Python | AOC-2020/days/six.py | Burntmace/AdventOfCode2020 | 32154037ba900486013e79f72e85dad99c280afa | [
"MIT"
] | null | null | null | AOC-2020/days/six.py | Burntmace/AdventOfCode2020 | 32154037ba900486013e79f72e85dad99c280afa | [
"MIT"
] | null | null | null | AOC-2020/days/six.py | Burntmace/AdventOfCode2020 | 32154037ba900486013e79f72e85dad99c280afa | [
"MIT"
] | null | null | null | def main(filepath):
with open(filepath) as file:
rows = [x.strip() for x in file.readlines()]
count1 = 0
count2 = 0
part_a = set()
part_b = []
for i in range(len(rows)):
if rows[i] == "" or i+1 == len(rows):
count1 += len(part_a)
count2 += len(se... | 31.238095 | 53 | 0.484756 | def main(filepath):
with open(filepath) as file:
rows = [x.strip() for x in file.readlines()]
count1 = 0
count2 = 0
part_a = set()
part_b = []
for i in range(len(rows)):
if rows[i] == "" or i+1 == len(rows):
count1 += len(part_a)
count2 += len(se... | true | true |
f73f39dbbc719ee897a59bb6dc54a7fc05682441 | 3,148 | py | Python | tests/test_watershed.py | Pandinosaurus/gala | db73a1c84d8a99975a2a8fb68660a83d8889ab1e | [
"BSD-3-Clause"
] | 60 | 2015-02-28T05:37:24.000Z | 2022-03-14T10:12:48.000Z | tests/test_watershed.py | Pandinosaurus/gala | db73a1c84d8a99975a2a8fb68660a83d8889ab1e | [
"BSD-3-Clause"
] | 48 | 2015-02-04T00:36:01.000Z | 2021-12-21T22:48:43.000Z | tests/test_watershed.py | jni/gala | 975ed783a6cb3c0afe24a921afdacf2f27184fcf | [
"BSD-3-Clause"
] | 27 | 2015-01-23T07:40:18.000Z | 2022-03-04T10:44:38.000Z | import os
import time
import numpy as np
from scipy import ndimage as nd
from numpy.testing import assert_array_equal, assert_array_less
from gala import morpho
rundir = os.path.dirname(__file__)
def time_me(function):
def wrapped(*args, **kwargs):
start = time.time()
r = function(*args, **kwargs... | 34.217391 | 76 | 0.709339 | import os
import time
import numpy as np
from scipy import ndimage as nd
from numpy.testing import assert_array_equal, assert_array_less
from gala import morpho
rundir = os.path.dirname(__file__)
def time_me(function):
def wrapped(*args, **kwargs):
start = time.time()
r = function(*args, **kwargs... | true | true |
f73f3a74b25db040db48b7ff324a52030427e99d | 2,508 | py | Python | soapfish/testutil/echo_service.py | soapteam/soapfish | 3f9b531d5cf14a063edbda16a62ace23fabe6d06 | [
"BSD-3-Clause"
] | 20 | 2016-07-20T01:12:40.000Z | 2021-12-16T02:49:49.000Z | soapfish/testutil/echo_service.py | FelixSchwarz/soapfish | d98a1d7e8b92897620810e75de97de598140fafb | [
"BSD-3-Clause"
] | 42 | 2015-01-17T18:54:50.000Z | 2016-06-28T07:06:18.000Z | soapfish/testutil/echo_service.py | soapteam/soapfish | 3f9b531d5cf14a063edbda16a62ace23fabe6d06 | [
"BSD-3-Clause"
] | 13 | 2016-09-02T09:37:42.000Z | 2021-11-29T13:11:33.000Z | from .. import xsd
from ..core import SOAPResponse
from ..lib.attribute_dict import AttrDict
from ..soap import Service, SOAPVersion
__all__ = ['echo_handler', 'echo_service', 'EchoInputHeader', 'EchoOutputHeader']
class EchoType(xsd.ComplexType):
INHERITANCE = None
INDICATOR = xsd.Sequence
value = xsd.E... | 29.505882 | 81 | 0.604067 | from .. import xsd
from ..core import SOAPResponse
from ..lib.attribute_dict import AttrDict
from ..soap import Service, SOAPVersion
__all__ = ['echo_handler', 'echo_service', 'EchoInputHeader', 'EchoOutputHeader']
class EchoType(xsd.ComplexType):
INHERITANCE = None
INDICATOR = xsd.Sequence
value = xsd.E... | true | true |
f73f3b0aec3c7fd3cdeed6f42112c021af36b0e6 | 4,434 | py | Python | sdk/python/pulumi_azure_native/recoveryservices/v20210401/get_replication_migration_item.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20210401/get_replication_migration_item.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20210401/get_replication_migration_item.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 34.640625 | 172 | 0.642986 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetReplicationMigrationItemResult',
'AwaitableGetReplicationMigrationItemResult',
'get_replication_migration_item',
]
@... | true | true |
f73f3b198530ebe222cb6c8cd1188a35a8e30923 | 563 | py | Python | user/migrations/0005_auto_20210824_0401.py | dewale005/whitefieldcoursesite | e96277de34d0e7d464482cda787f1ee41fbe64fe | [
"MIT"
] | null | null | null | user/migrations/0005_auto_20210824_0401.py | dewale005/whitefieldcoursesite | e96277de34d0e7d464482cda787f1ee41fbe64fe | [
"MIT"
] | null | null | null | user/migrations/0005_auto_20210824_0401.py | dewale005/whitefieldcoursesite | e96277de34d0e7d464482cda787f1ee41fbe64fe | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-24 04:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0004_auto_20210820_0954'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_email_verified'... | 23.458333 | 53 | 0.591474 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0004_auto_20210820_0954'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_email_verified',
field=models.BooleanField(default... | true | true |
f73f3b4dda379118f83b4a3a2010d3537168c15c | 3,853 | py | Python | test/units/encoding/test_esc.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | test/units/encoding/test_esc.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | test/units/encoding/test_esc.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from refinery.units.encoding.esc import esc
from .. import TestUnitBase
class TestEscaping(TestUnitBase):
def test_quoted_string_01(self):
unit = esc(quoted=True)
self.assertEqual(unit.process(RB'"r\x65\x66\x69\x6ee\x72\x79"'), B'refinery')
def ... | 51.373333 | 283 | 0.62938 |
from refinery.units.encoding.esc import esc
from .. import TestUnitBase
class TestEscaping(TestUnitBase):
def test_quoted_string_01(self):
unit = esc(quoted=True)
self.assertEqual(unit.process(RB'"r\x65\x66\x69\x6ee\x72\x79"'), B'refinery')
def test_quoted_string_02(self):
unit = e... | true | true |
f73f3cba4c865961f92b1a5b6ca6e7ca14300d83 | 1,646 | py | Python | samples/generated_samples/aiplatform_v1_generated_tensorboard_service_delete_tensorboard_experiment_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_v1_generated_tensorboard_service_delete_tensorboard_experiment_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_v1_generated_tensorboard_service_delete_tensorboard_experiment_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 32.92 | 85 | 0.770352 |
from google.cloud import aiplatform_v1
def sample_delete_tensorboard_experiment():
client = aiplatform_v1.TensorboardServiceClient()
request = aiplatform_v1.DeleteTensorboardExperimentRequest(
name="name_value",
)
operation = client.delete_tensorboard... | true | true |
f73f3cefeb48e6321e9e0540a43998cfeda9099d | 386 | py | Python | setup.py | mimoralea/gym-walk | 4f7e1812389c45330eeeeb0b32a604d022fd7b89 | [
"MIT"
] | 9 | 2020-01-08T03:24:23.000Z | 2022-02-18T19:23:16.000Z | setup.py | mimoralea/gym-walk | 4f7e1812389c45330eeeeb0b32a604d022fd7b89 | [
"MIT"
] | null | null | null | setup.py | mimoralea/gym-walk | 4f7e1812389c45330eeeeb0b32a604d022fd7b89 | [
"MIT"
] | 6 | 2020-08-14T03:20:56.000Z | 2022-03-25T20:09:16.000Z | from setuptools import setup
setup(
name='gym_walk',
version='0.0.1',
description='Gym walk environment - useful to replicate Random Walk experiments',
url='https://github.com/mimoralea/gym-walk',
author='Miguel Morales',
author_email='mimoralea@gmail.com',
packages=['gym_walk', 'gym_walk.e... | 27.571429 | 85 | 0.683938 | from setuptools import setup
setup(
name='gym_walk',
version='0.0.1',
description='Gym walk environment - useful to replicate Random Walk experiments',
url='https://github.com/mimoralea/gym-walk',
author='Miguel Morales',
author_email='mimoralea@gmail.com',
packages=['gym_walk', 'gym_walk.e... | true | true |
f73f3de381d38713dd03af502c311275812fab8f | 769 | py | Python | 14B-088/HI/archival_combination/tclean_all.py | e-koch/VLA_Lband | 8fca7b2de0b88ce5c5011b34bf3936c69338d0b0 | [
"MIT"
] | 1 | 2021-03-08T23:19:12.000Z | 2021-03-08T23:19:12.000Z | 14B-088/HI/archival_combination/tclean_all.py | e-koch/VLA_Lband | 8fca7b2de0b88ce5c5011b34bf3936c69338d0b0 | [
"MIT"
] | null | null | null | 14B-088/HI/archival_combination/tclean_all.py | e-koch/VLA_Lband | 8fca7b2de0b88ce5c5011b34bf3936c69338d0b0 | [
"MIT"
] | null | null | null |
'''
Using tclean to image the regridded 14B-088 HI data and the archival data
together.
'''
from tasks import tclean
vis = ["14B-088_HI_LSRK_AT0206_regrid.ms.contsub",
"M33_b_c_LSRK.ms"]
imagename = "M33_AT0206_14B-088_HI.clean"
model = "M33_model.image"
mask = "M33_newmask.image"
tclean(vis=vis, imagename=i... | 34.954545 | 75 | 0.694408 |
from tasks import tclean
vis = ["14B-088_HI_LSRK_AT0206_regrid.ms.contsub",
"M33_b_c_LSRK.ms"]
imagename = "M33_AT0206_14B-088_HI.clean"
model = "M33_model.image"
mask = "M33_newmask.image"
tclean(vis=vis, imagename=imagename, field="M33*", imsize=[4096, 4096],
cell="1.5arcsec", phasecenter="J2000 01h... | true | true |
f73f3ef5f66d7e60816b97e6b5e406a5b9566df1 | 3,133 | py | Python | bueno/core/mathex.py | lanl/bueno | 60d3087ea8702d597989c07d4944386f90482891 | [
"BSD-3-Clause"
] | 7 | 2020-05-15T04:47:10.000Z | 2021-12-13T03:24:29.000Z | bueno/core/mathex.py | Lcjacobpd/bueno | cd1ffa7b7955e04234a1292adf2d155c52d1756c | [
"BSD-3-Clause"
] | 9 | 2020-01-24T21:55:31.000Z | 2022-01-22T06:26:29.000Z | bueno/core/mathex.py | Lcjacobpd/bueno | cd1ffa7b7955e04234a1292adf2d155c52d1756c | [
"BSD-3-Clause"
] | 10 | 2020-06-17T14:24:47.000Z | 2021-05-20T17:32:12.000Z | #
# Copyright (c) 2020 Triad National Security, LLC
# All rights reserved.
#
# This file is part of the bueno project. See the LICENSE file at the
# top-level directory of this distribution for more information.
#
'''
Mathematical expression evaluation module.
'''
import ast
import operat... | 32.978947 | 79 | 0.611874 |
import ast
import operator
import typing
from bueno.core import metacls
class _TheCalculator(metaclass=metacls.Singleton):
def __init__(self) -> None:
self.input = ''
self.uni_ops = {
ast.USub: operator.neg
}
self.bin_ops = {
... | true | true |
f73f3efa63c92862aa06d26156f1215431de2055 | 6,008 | py | Python | flask_backend/anime_env/Lib/site-packages/mal/anime.py | shafqatshad/AnmieRecommenderSystem | f58d6ab2b3614aa81208ec844ef99963c988c69d | [
"Apache-2.0"
] | null | null | null | flask_backend/anime_env/Lib/site-packages/mal/anime.py | shafqatshad/AnmieRecommenderSystem | f58d6ab2b3614aa81208ec844ef99963c988c69d | [
"Apache-2.0"
] | null | null | null | flask_backend/anime_env/Lib/site-packages/mal/anime.py | shafqatshad/AnmieRecommenderSystem | f58d6ab2b3614aa81208ec844ef99963c988c69d | [
"Apache-2.0"
] | null | null | null | from typing import Optional, List, Dict
from mal import config
from mal.mal import _MAL
class Anime(_MAL):
def __init__(self, mal_id: int, timeout: int = config.TIMEOUT):
"""
Anime query by ID
:param mal_id: MyAnimeList ID
:param timeout: Timeout in seconds
"""
sup... | 26.350877 | 88 | 0.535786 | from typing import Optional, List, Dict
from mal import config
from mal.mal import _MAL
class Anime(_MAL):
def __init__(self, mal_id: int, timeout: int = config.TIMEOUT):
super().__init__(mal_id, "anime", timeout)
def reload(self) -> None:
self.__init__(self._mal_id)
def _get_op_ed(self... | true | true |
f73f4020f4e84e1ae41861a942b22f672ab3168f | 759 | py | Python | dataent/www/website_script.py | dataent/dataent | c41bd5942ffe5513f4d921c4c0595c84bbc422b4 | [
"MIT"
] | null | null | null | dataent/www/website_script.py | dataent/dataent | c41bd5942ffe5513f4d921c4c0595c84bbc422b4 | [
"MIT"
] | 6 | 2020-03-24T17:15:56.000Z | 2022-02-10T18:41:31.000Z | dataent/www/website_script.py | dataent/dataent | c41bd5942ffe5513f4d921c4c0595c84bbc422b4 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import dataent
from dataent.utils import strip
from dataent.website.doctype.website_theme.website_theme import get_active_theme
no_sitemap = 1
base_template_path = "templates/ww... | 31.625 | 106 | 0.777339 |
from __future__ import unicode_literals
import dataent
from dataent.utils import strip
from dataent.website.doctype.website_theme.website_theme import get_active_theme
no_sitemap = 1
base_template_path = "templates/www/website_script.js"
def get_context(context):
context.javascript = dataent.db.get_single_value('... | true | true |
f73f4029ef25c8aa556d788fc02911634314cf96 | 4,207 | py | Python | datalad/crawler/pipelines/openfmri_s3.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | null | null | null | datalad/crawler/pipelines/openfmri_s3.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | 6 | 2015-11-20T21:41:13.000Z | 2018-06-12T14:27:32.000Z | datalad/crawler/pipelines/openfmri_s3.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | 1 | 2017-03-28T14:44:16.000Z | 2017-03-28T14:44:16.000Z | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 40.84466 | 163 | 0.605657 | true | true | |
f73f403c2091305fc943160f0c5e381ece85cdcd | 163 | py | Python | mypower/matpower_ported/data/contab_ACTIVSg500.py | yasirroni/mypower | 123c2d3380bf5f753a479c35e7b5cbafc82a8ebc | [
"Apache-2.0"
] | 2 | 2020-08-08T15:13:49.000Z | 2021-01-04T07:21:29.000Z | mypower/matpower_ported/data/contab_ACTIVSg500.py | yasirroni/mypower | 123c2d3380bf5f753a479c35e7b5cbafc82a8ebc | [
"Apache-2.0"
] | null | null | null | mypower/matpower_ported/data/contab_ACTIVSg500.py | yasirroni/mypower | 123c2d3380bf5f753a479c35e7b5cbafc82a8ebc | [
"Apache-2.0"
] | 1 | 2020-08-08T15:14:17.000Z | 2020-08-08T15:14:17.000Z | def contab_ACTIVSg500(*args,nout=1,oc=None):
if oc == None:
from ...oc_api import oc_matpower
oc = oc_matpower()
return oc.contab_ACTIVSg500(*args,nout=nout)
| 27.166667 | 45 | 0.736196 | def contab_ACTIVSg500(*args,nout=1,oc=None):
if oc == None:
from ...oc_api import oc_matpower
oc = oc_matpower()
return oc.contab_ACTIVSg500(*args,nout=nout)
| true | true |
f73f405b5a8d2132cbf016b9b0471a19b7691628 | 14,528 | py | Python | insomniac/utils.py | gisthere/Insomniac | 1d5f0e871fdd9b1cdc7f3c3ac3929f88bcc69e1b | [
"MIT"
] | null | null | null | insomniac/utils.py | gisthere/Insomniac | 1d5f0e871fdd9b1cdc7f3c3ac3929f88bcc69e1b | [
"MIT"
] | null | null | null | insomniac/utils.py | gisthere/Insomniac | 1d5f0e871fdd9b1cdc7f3c3ac3929f88bcc69e1b | [
"MIT"
] | null | null | null | import base64
import os
import random
import re
import shutil
import string
import subprocess
import sys
import traceback
from datetime import datetime, timedelta
from random import randint
from subprocess import PIPE
from time import sleep
import colorama
from colorama import Fore, Style, AnsiToWin32
import insomnia... | 33.018182 | 157 | 0.642002 | import base64
import os
import random
import re
import shutil
import string
import subprocess
import sys
import traceback
from datetime import datetime, timedelta
from random import randint
from subprocess import PIPE
from time import sleep
import colorama
from colorama import Fore, Style, AnsiToWin32
import insomnia... | true | true |
f73f429703f7ada44e2aff44df73e0c92e5ab861 | 18,919 | py | Python | pcdet/models/backbones_3d/pfe/voxel_set_abstraction.py | xiangruhuang/OpenPCDet | d82d9594a0629ffed0c457aedc304e0805e93221 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_3d/pfe/voxel_set_abstraction.py | xiangruhuang/OpenPCDet | d82d9594a0629ffed0c457aedc304e0805e93221 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_3d/pfe/voxel_set_abstraction.py | xiangruhuang/OpenPCDet | d82d9594a0629ffed0c457aedc304e0805e93221 | [
"Apache-2.0"
] | null | null | null | import math
import numpy as np
import torch
import torch.nn as nn
from ....ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_stack_modules
from ....ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_stack_utils
from ....utils import common_utils
def bilinear_interpolate_torch(im, x, ... | 40.861771 | 141 | 0.611396 | import math
import numpy as np
import torch
import torch.nn as nn
from ....ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_stack_modules
from ....ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_stack_utils
from ....utils import common_utils
def bilinear_interpolate_torch(im, x, ... | true | true |
f73f42bc8834d837de5b4ab86f367dce1ddb5666 | 1,903 | py | Python | EEG-HandGrasp-Classification/FBCSP/test_file_binary.py | SulemanRasheed/Research | 29c8443a8a97af6d1eae87fc8ef706eb58eeb569 | [
"MIT"
] | null | null | null | EEG-HandGrasp-Classification/FBCSP/test_file_binary.py | SulemanRasheed/Research | 29c8443a8a97af6d1eae87fc8ef706eb58eeb569 | [
"MIT"
] | null | null | null | EEG-HandGrasp-Classification/FBCSP/test_file_binary.py | SulemanRasheed/Research | 29c8443a8a97af6d1eae87fc8ef706eb58eeb569 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Test for the binary FBCSP algorithm. I used the dataset 1 fo BCI competition IV.
@author: Alberto Zancanaro (Jesus)
@organization: University of Padua (Italy)
"""
#%%
from FBCSP_support_function import cleanWorkspaec
# cleanWorkspaec()
#%%
from FBCSP_support_function import loadDatasetD1_... | 29.734375 | 145 | 0.717288 |
from FBCSP_support_function import cleanWorkspaec
from FBCSP_support_function import loadDatasetD1_100Hz, computeTrialD1_100Hz
from FBCSP_V3 import FBCSP_V3
from FBCSP_V4 import FBCSP_V4
import numpy as np
from sklearn.svm import SVC
import time
n_w = 2
n_features = 4
tmp_string = 'abcdefg'
tmp_string = 'e'... | true | true |
f73f43ab58f11aa55cb53cd10a31dfeaea6f8a18 | 752 | py | Python | setup.py | averyhiebert/vivludo | f3c2fb46f6139f50d6df8e91bca2f4f0863890aa | [
"MIT"
] | 2 | 2021-02-08T18:51:45.000Z | 2022-03-27T07:30:07.000Z | setup.py | averyhiebert/vivludo | f3c2fb46f6139f50d6df8e91bca2f4f0863890aa | [
"MIT"
] | null | null | null | setup.py | averyhiebert/vivludo | f3c2fb46f6139f50d6df8e91bca2f4f0863890aa | [
"MIT"
] | null | null | null | from setuptools import setup
with open("README.md","r") as f:
long_description = f.read()
setup(name="vivludo",
version="0.0.1",
description="A cellular automaton library.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Avery Hiebert",
... | 27.851852 | 52 | 0.605053 | from setuptools import setup
with open("README.md","r") as f:
long_description = f.read()
setup(name="vivludo",
version="0.0.1",
description="A cellular automaton library.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Avery Hiebert",
... | true | true |
f73f454b362ee7aaae61eb6685092d5622124a40 | 1,911 | py | Python | archived/elasticache/Redis/counter.py | DS3Lab/LambdaML | 0afca7819e08632ba116fec8e102084e4040a47a | [
"Apache-2.0"
] | 23 | 2021-05-17T09:24:24.000Z | 2022-01-29T18:40:44.000Z | archived/elasticache/Redis/counter.py | DS3Lab/LambdaML | 0afca7819e08632ba116fec8e102084e4040a47a | [
"Apache-2.0"
] | 2 | 2021-05-17T16:15:12.000Z | 2021-07-20T09:11:22.000Z | archived/elasticache/Redis/counter.py | DS3Lab/LambdaML | 0afca7819e08632ba116fec8e102084e4040a47a | [
"Apache-2.0"
] | 3 | 2021-05-17T09:31:53.000Z | 2021-12-02T16:29:59.000Z | # Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This f... | 26.541667 | 81 | 0.622711 |
import logging
import redis
from botocore.exceptions import ClientError
def counter(client,key):
try:
client.incrby(key, 1)
except ClientError as e:
logging.error(e)
return False
return True
def hcounter(client, key, fi... | true | true |
f73f45a2df9ac9d6a7e5a8027946323c3a2b8bf6 | 1,064 | py | Python | tests/test_help.py | hroncok/ghia | 709516793246cb1597c3da1e43e9e0d78e34e222 | [
"MIT"
] | null | null | null | tests/test_help.py | hroncok/ghia | 709516793246cb1597c3da1e43e9e0d78e34e222 | [
"MIT"
] | 3 | 2019-11-04T18:38:08.000Z | 2020-01-02T12:58:14.000Z | tests/test_help.py | hroncok/ghia | 709516793246cb1597c3da1e43e9e0d78e34e222 | [
"MIT"
] | null | null | null | import re
from helpers import run
hlp = run('--help')
stdout = hlp.stdout
def test_usage():
assert stdout.startswith('Usage: ghia.py [OPTIONS] REPOSLUG')
def test_description():
assert (
'CLI tool for automatic issue assigning of GitHub issues' in stdout
)
def test_strategy():
assert re.... | 25.95122 | 75 | 0.567669 | import re
from helpers import run
hlp = run('--help')
stdout = hlp.stdout
def test_usage():
assert stdout.startswith('Usage: ghia.py [OPTIONS] REPOSLUG')
def test_description():
assert (
'CLI tool for automatic issue assigning of GitHub issues' in stdout
)
def test_strategy():
assert re.... | true | true |
f73f4630995ed3b623039162cbe5bcb4bc885fed | 1,621 | py | Python | vision.py | mateoguaman/Semantic-Autonomous-Mapping | 251b6ab12cb3f365112a9378805c82c1deca0870 | [
"MIT"
] | null | null | null | vision.py | mateoguaman/Semantic-Autonomous-Mapping | 251b6ab12cb3f365112a9378805c82c1deca0870 | [
"MIT"
] | null | null | null | vision.py | mateoguaman/Semantic-Autonomous-Mapping | 251b6ab12cb3f365112a9378805c82c1deca0870 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import requests
import json
from time import sleep
import base64
import rospy
from std_msgs.msg import string
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
bridge = CvBridge()
# Fix this to get an image file as a parameter (subscribe to a Node), and a... | 23.492754 | 134 | 0.661937 |
import requests
import json
from time import sleep
import base64
import rospy
from std_msgs.msg import string
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
bridge = CvBridge()
def getJSON(data):
try:
sign_img_cv2 = bridge.imgmsg_to_cv2(data, "bgr8")
exce... | true | true |
f73f4696f14dcf41b4afbd9b0558c39d1126f6d1 | 2,653 | py | Python | testing/car_record.py | dxs/neighbour-analyser | 609c220b1352f9c3e64ea96ff43007584712efb0 | [
"Apache-2.0"
] | null | null | null | testing/car_record.py | dxs/neighbour-analyser | 609c220b1352f9c3e64ea96ff43007584712efb0 | [
"Apache-2.0"
] | null | null | null | testing/car_record.py | dxs/neighbour-analyser | 609c220b1352f9c3e64ea96ff43007584712efb0 | [
"Apache-2.0"
] | null | null | null | import cv2 as cv
import argparse
import sys
import numpy as np
import os.path
#set constants
FRONT_CAMERA = 1
BACK_CAMERA = 0
i = 0
confThreshold = 0.5 #Confidence threshold
nmsThreshold = 0.4 #Non-maximum suppression threshold
inpWidth = 416 #Width of network's input image
inpHeight = 416 #Height of network's in... | 31.963855 | 170 | 0.681493 | import cv2 as cv
import argparse
import sys
import numpy as np
import os.path
FRONT_CAMERA = 1
BACK_CAMERA = 0
i = 0
confThreshold = 0.5
nmsThreshold = 0.4
inpWidth = 416
inpHeight = 416 #Height of network's input image
classesFile = 'coco.names'
classes = None
with open(classesFile, 'rt') as f:
classes... | true | true |
f73f473a495de28d12178fd88344cae3f64fc9e4 | 7,396 | py | Python | import_data.py | FlyingFishBird/msmt | 1278d4a6af3d54aa477d7c99d053549b1b80b2fa | [
"MIT"
] | null | null | null | import_data.py | FlyingFishBird/msmt | 1278d4a6af3d54aa477d7c99d053549b1b80b2fa | [
"MIT"
] | null | null | null | import_data.py | FlyingFishBird/msmt | 1278d4a6af3d54aa477d7c99d053549b1b80b2fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import sys
IS_PY2 = sys.version_info.major == 2
def connect_db(host, port, user, passwd):
import pymysql
try:
wconn = pymysql.connect(
host=host,
user=user,
password=passwd,
port=port,
charset='utf8mb... | 28.555985 | 209 | 0.58126 |
import argparse
import sys
IS_PY2 = sys.version_info.major == 2
def connect_db(host, port, user, passwd):
import pymysql
try:
wconn = pymysql.connect(
host=host,
user=user,
password=passwd,
port=port,
charset='utf8mb4',
cursorc... | true | true |
f73f48297783b6476ec6e403bb6e5b405e2ed066 | 2,706 | py | Python | tools/migrate_triggers_to_include_ref_count.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 1 | 2020-11-09T21:05:33.000Z | 2020-11-09T21:05:33.000Z | tools/migrate_triggers_to_include_ref_count.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 3 | 2021-03-26T00:29:52.000Z | 2021-03-26T00:34:45.000Z | tools/migrate_triggers_to_include_ref_count.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to the StackStorm, Inc ('StackStorm') 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 "Licens... | 33.407407 | 89 | 0.715817 |
from __future__ import absolute_import
from mongoengine.queryset import Q
from st2common import config
from st2common.script_setup import setup as common_setup
from st2common.script_setup import teardown as common_teardown
from st2common.persistence.rule import Rule
from st2common.persistence.trigger ... | true | true |
f73f486483766055e34a7fc55dd430c235e5b2f0 | 16,284 | py | Python | scone_phobia/utils/apply_analyses.py | Thomas-Schatz/scone-phobia | 55577d150ff71fd1f1c52073143c64e242b28600 | [
"MIT"
] | null | null | null | scone_phobia/utils/apply_analyses.py | Thomas-Schatz/scone-phobia | 55577d150ff71fd1f1c52073143c64e242b28600 | [
"MIT"
] | 1 | 2018-10-26T18:20:56.000Z | 2018-10-26T18:20:56.000Z | scone_phobia/utils/apply_analyses.py | Thomas-Schatz/scone-phobia | 55577d150ff71fd1f1c52073143c64e242b28600 | [
"MIT"
] | 1 | 2019-08-02T15:53:12.000Z | 2019-08-02T15:53:12.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 20 10:59:28 2018
@author: Thomas Schatz
Code for managing the analysis of a set of ABXpy minimal-pair scores
for ABX tasks with the following structure:
ON phone BY speaker, previous and following phonetic context)
The main function is apply_analysis, see readme.md f... | 46.261364 | 102 | 0.619749 |
import pandas
import os
import os.path as path
import scone_phobia.utils.mp_scores as mp_scores
import yaml
def load_cfg_from_file(f):
def wrapper(*args, **kwargs):
if not('cfg' in kwargs) or (kwargs['cfg'] is None):
dir = path.dirname(path.realpath(__file__))
cfg_file ... | true | true |
f73f4875de384a6fba29d512d2b7f142098d7762 | 715 | py | Python | py-kms/pykms_RequestUnknown.py | TheGhostGroup/py-kms | ea7cd50cc6ebfb67cf2df31d46890e6108c0336d | [
"Unlicense"
] | 1,726 | 2017-07-21T16:12:55.000Z | 2022-03-31T09:03:07.000Z | py-kms/pykms_RequestUnknown.py | TheGhostGroup/py-kms | ea7cd50cc6ebfb67cf2df31d46890e6108c0336d | [
"Unlicense"
] | 117 | 2018-02-12T05:45:55.000Z | 2022-03-31T23:05:53.000Z | py-kms/pykms_RequestUnknown.py | TheGhostGroup/py-kms | ea7cd50cc6ebfb67cf2df31d46890e6108c0336d | [
"Unlicense"
] | 629 | 2017-06-26T04:03:32.000Z | 2022-03-29T17:13:46.000Z | #!/usr/bin/env python3
import struct
from pykms_Base import kmsBase
from pykms_Misc import ErrorCodes
#---------------------------------------------------------------------------------------------------------------------------------------------------------
class kmsRequestUnknown(kmsBase):
def executeReques... | 42.058824 | 154 | 0.521678 |
import struct
from pykms_Base import kmsBase
from pykms_Misc import ErrorCodes
class kmsRequestUnknown(kmsBase):
def executeRequestLogic(self):
finalResponse = bytearray()
finalResponse.extend(bytearray(struct.pack('<I', 0)))
finalResponse.extend(bytearray(s... | true | true |
f73f489ea063e8b9e9554048a835bc880960f5fa | 1,953 | py | Python | src/transformersX/models/cutoffbert/__init__.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | 2 | 2021-08-06T05:43:55.000Z | 2022-03-17T22:31:21.000Z | src/transformersX/models/mixupbert/__init__.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | src/transformersX/models/mixupbert/__init__.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 35.509091 | 100 | 0.746544 |
# module, but to preserve other warnings. So, don't check this module at all.
from typing import TYPE_CHECKING
from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
_import_structure = {
"configuration_cutoffbert": ["CUTOFFBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Cutoff... | true | true |
f73f48e2f2c58e4c0fcd7b4734c615ed18eede29 | 29,927 | py | Python | tests/utils.py | npdoty/pywikibot | d0687ce7035401ffb63f4a95d225c27ed9ba722b | [
"MIT"
] | 2 | 2019-03-14T09:30:13.000Z | 2021-01-07T16:59:27.000Z | tests/utils.py | jayvdb/pywikibot-core | 70be2ea5cb34c4a054f89200f18b4e4be05c3ba4 | [
"MIT"
] | null | null | null | tests/utils.py | jayvdb/pywikibot-core | 70be2ea5cb34c4a054f89200f18b4e4be05c3ba4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test utilities."""
#
# (C) Pywikibot team, 2013-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import inspect
import json
import locale
import os
import re
import subprocess
import sys
import tempfile
import time
import tra... | 32.600218 | 83 | 0.609516 |
from __future__ import absolute_import, unicode_literals
import inspect
import json
import locale
import os
import re
import subprocess
import sys
import tempfile
import time
import traceback
import warnings
from collections import Mapping
from types import ModuleType
from warnings import warn
from pywikibot.t... | true | true |
f73f49ad6e0a1e4069a976ac06d62a0b50f0cce9 | 16,397 | py | Python | tests/test_list_memory.py | mwittgen/rogue | 4be0e9a4d17bdd3987a268f54ad195ee1093190d | [
"BSD-3-Clause-LBNL"
] | 26 | 2016-11-02T15:46:29.000Z | 2022-03-18T16:50:00.000Z | tests/test_list_memory.py | mwittgen/rogue | 4be0e9a4d17bdd3987a268f54ad195ee1093190d | [
"BSD-3-Clause-LBNL"
] | 419 | 2017-06-07T16:06:22.000Z | 2022-03-25T21:05:17.000Z | tests/test_list_memory.py | mwittgen/rogue | 4be0e9a4d17bdd3987a268f54ad195ee1093190d | [
"BSD-3-Clause-LBNL"
] | 12 | 2017-07-25T22:58:08.000Z | 2022-02-17T23:30:05.000Z | #!/usr/bin/env python3
#-----------------------------------------------------------------------------
# This file is part of the rogue software platform. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu... | 41.302267 | 104 | 0.546624 |
import pyrogue as pr
import pyrogue.interfaces.simulation
import rogue.interfaces.memory
import numpy as np
import random
import time
class ListDevice(pr.Device):
def __init__(
self,
name = 'ListDevice',
description = 'List Device Test',
... | true | true |
f73f4a4a80bad330756d04b52fdaa12ae3059cd7 | 3,980 | py | Python | sdk/python/pulumi_azure_nextgen/portal/v20181001/user_settings.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/portal/v20181001/user_settings.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/portal/v20181001/user_settings.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 41.894737 | 174 | 0.659296 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['UserSettings']
class UserSettings(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
f73f4aaa08bd84d8c1c9f1dc02b6dd9f0812127c | 13,782 | py | Python | nxsdk_modules_ncl/dnn/composable/composable_dnn.py | event-driven-robotics/models | 5e5b6521b8bcab6e3576e177784baaed57fd5280 | [
"BSD-3-Clause"
] | 54 | 2020-03-04T17:37:17.000Z | 2022-02-22T13:16:10.000Z | nxsdk_modules_ncl/dnn/composable/composable_dnn.py | lyes-khacef/models | a8b6e2a83d4842eb99878d3fa53cd92f4c6b3db8 | [
"BSD-3-Clause"
] | 9 | 2020-08-26T13:17:54.000Z | 2021-11-09T09:02:00.000Z | nxsdk_modules_ncl/dnn/composable/composable_dnn.py | lyes-khacef/models | a8b6e2a83d4842eb99878d3fa53cd92f4c6b3db8 | [
"BSD-3-Clause"
] | 26 | 2020-03-18T17:09:34.000Z | 2021-11-22T16:23:14.000Z | #
# Copyright © 2020 Intel Corporation.
#
# This software and the related documents are Intel copyrighted
# materials, and your use of them is governed by the express
# license under which they were provided to you (License). Unless
# the License provides otherwise, you may not use, modify, copy,
# publish, distrib... | 45.787375 | 120 | 0.640473 |
#
# This software and the related documents are provided as is, with
# no express or implied warranties, other than those that are
# expressly stated in the License.
import os
from typing import List
import numpy as np
from jinja2 import Environment, FileSystemLoader
import atexit
from nxsdk import get_l... | true | true |
f73f4adb84023567c11e78d1474fc5c848709582 | 11,020 | py | Python | src/prefect/engine/serializers.py | sixhobbits/prefect | bf7a6b95ab592ad4808415f295163a64e38f1419 | [
"Apache-2.0"
] | null | null | null | src/prefect/engine/serializers.py | sixhobbits/prefect | bf7a6b95ab592ad4808415f295163a64e38f1419 | [
"Apache-2.0"
] | null | null | null | src/prefect/engine/serializers.py | sixhobbits/prefect | bf7a6b95ab592ad4808415f295163a64e38f1419 | [
"Apache-2.0"
] | null | null | null | import base64
import bz2
import gzip
import io
import json
import lzma
from typing import TYPE_CHECKING, Any, Callable, Dict, Tuple
import zlib
import cloudpickle
import pendulum
if TYPE_CHECKING:
import pandas as pd
__all__ = (
"Serializer",
"PickleSerializer",
"JSONSerializer",
"DateTimeSeriali... | 31.129944 | 97 | 0.599637 | import base64
import bz2
import gzip
import io
import json
import lzma
from typing import TYPE_CHECKING, Any, Callable, Dict, Tuple
import zlib
import cloudpickle
import pendulum
if TYPE_CHECKING:
import pandas as pd
__all__ = (
"Serializer",
"PickleSerializer",
"JSONSerializer",
"DateTimeSeriali... | true | true |
f73f4afa0ce57db698ac2f23efb6a8e01021a30e | 108 | py | Python | main.py | Joetib/bases | 435cf3f95cb70a72b126dbfcc48554c41284aa0b | [
"MIT"
] | null | null | null | main.py | Joetib/bases | 435cf3f95cb70a72b126dbfcc48554c41284aa0b | [
"MIT"
] | null | null | null | main.py | Joetib/bases | 435cf3f95cb70a72b126dbfcc48554c41284aa0b | [
"MIT"
] | 1 | 2020-05-26T00:09:03.000Z | 2020-05-26T00:09:03.000Z | from ui.base_gui import BaseGUI
if __name__ == "__main__":
app_gui = BaseGUI()
app_gui.start_gui()
| 18 | 31 | 0.694444 | from ui.base_gui import BaseGUI
if __name__ == "__main__":
app_gui = BaseGUI()
app_gui.start_gui()
| true | true |
f73f4b7f1e3bd8095445c31d29e747777c15161e | 843 | py | Python | neural_loop_combiner/config/settings.py | mir-aidj/neural-Loop-combiner | 0bda8a5e68ef3fe7c05bf8ff440ddde86c21a2cc | [
"MIT"
] | 22 | 2020-07-31T08:11:03.000Z | 2021-08-23T07:50:24.000Z | neural_loop_combiner/config/settings.py | mir-aidj/neural-Loop-combiner | 0bda8a5e68ef3fe7c05bf8ff440ddde86c21a2cc | [
"MIT"
] | null | null | null | neural_loop_combiner/config/settings.py | mir-aidj/neural-Loop-combiner | 0bda8a5e68ef3fe7c05bf8ff440ddde86c21a2cc | [
"MIT"
] | 1 | 2021-02-26T09:14:47.000Z | 2021-02-26T09:14:47.000Z | # Database
MONGODB_SERVER = '127.0.0.1'
MONGODB_PORT = 27017
MONGODB_DB = 'nlc' # neural_loop_combiner
MONGO_USERNAME = ''
MONGO_PASSWORD = ''
MONGODB_TRACK_COL = 'tracks'
MONGODB_LOOP_COL = 'loops'
MONGODB_TAG_COL = 'tags'
MONGODB_DATASET_COL = 'datasets'
MONGODB_MODEL_COL = 'models'
# Directory
I... | 17.93617 | 62 | 0.632266 |
MONGODB_SERVER = '127.0.0.1'
MONGODB_PORT = 27017
MONGODB_DB = 'nlc'
MONGO_USERNAME = ''
MONGO_PASSWORD = ''
MONGODB_TRACK_COL = 'tracks'
MONGODB_LOOP_COL = 'loops'
MONGODB_TAG_COL = 'tags'
MONGODB_DATASET_COL = 'datasets'
MONGODB_MODEL_COL = 'models'
INT_DIR = 'files/inputs'
OUT_DIR = 'files/o... | true | true |
f73f4bfb7f1990c081011c330f021c0f4aabbed3 | 20,428 | py | Python | site-packages/dill/_objects.py | benjaminben/ThumpAV | d9ee64280d3441d355097f590f24a51ccd256532 | [
"FTL"
] | 1 | 2020-02-24T06:23:07.000Z | 2020-02-24T06:23:07.000Z | site-packages/dill/_objects.py | benjaminben/ThumpAV | d9ee64280d3441d355097f590f24a51ccd256532 | [
"FTL"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | site-packages/dill/_objects.py | benjaminben/ThumpAV | d9ee64280d3441d355097f590f24a51ccd256532 | [
"FTL"
] | null | null | null | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2019 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/di... | 36.543828 | 91 | 0.680341 |
__all__ = ['registered','failures','succeeds']
import warnings; warnings.filterwarnings("ignore", category=DeprecationWarning)
import sys
PY3 = (hex(sys.hexversion) >= '0x30000f0')
if PY3:
import queue as Queue
import dbm as anydbm
else:
import Queue
import anydbm
import sets
import m... | true | true |
f73f4c57994d8e5d3ff7cf0878912bfce110842d | 24,589 | py | Python | cogs/memes.py | MechanicalDragon0687/Kurisu | 30735e0f0c90228b324ac6b8d138a6ea3c54691b | [
"Apache-2.0"
] | null | null | null | cogs/memes.py | MechanicalDragon0687/Kurisu | 30735e0f0c90228b324ac6b8d138a6ea3c54691b | [
"Apache-2.0"
] | 1 | 2020-12-09T05:04:52.000Z | 2020-12-09T06:38:43.000Z | cogs/memes.py | MechanicalDragon0687/Kurisu | 30735e0f0c90228b324ac6b8d138a6ea3c54691b | [
"Apache-2.0"
] | null | null | null | import datetime
import discord
import math
import random
from discord.ext import commands
from utils import crud
from utils.checks import is_staff
class Memes(commands.Cog):
"""
Meme commands
"""
def __init__(self, bot):
self.bot = bot
async def _meme(self, ctx, msg, directed: bool = Fal... | 44.464738 | 268 | 0.653056 | import datetime
import discord
import math
import random
from discord.ext import commands
from utils import crud
from utils.checks import is_staff
class Memes(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def _meme(self, ctx, msg, directed: bool = False, imagelink=None, allowed_mentio... | true | true |
f73f4c6de4904ec08741f4a5c038a506eb9a06a5 | 1,900 | py | Python | setup.py | alexpantyukhin/aiocouchdb | 84a08cc339c430175c069b894b3e27b034f45b12 | [
"BSD-2-Clause"
] | 54 | 2015-04-12T13:32:33.000Z | 2021-11-12T11:42:18.000Z | setup.py | alexpantyukhin/aiocouchdb | 84a08cc339c430175c069b894b3e27b034f45b12 | [
"BSD-2-Clause"
] | 17 | 2015-04-20T21:10:37.000Z | 2020-11-16T10:15:11.000Z | setup.py | alexpantyukhin/aiocouchdb | 84a08cc339c430175c069b894b3e27b034f45b12 | [
"BSD-2-Clause"
] | 19 | 2015-06-07T19:52:38.000Z | 2021-09-19T22:21:47.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2015 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import imp
import os
import sys
from os.path import join
from setuptools import setup, find_packag... | 23.75 | 76 | 0.608947 |
import imp
import os
import sys
from os.path import join
from setuptools import setup, find_packages
setup_dir = os.path.dirname(__file__)
mod = imp.load_module(
'version', *imp.find_module('version', [join(setup_dir, 'aiocouchdb')]))
if sys.version_info < (3, 3):
raise RuntimeError('aiocouchdb requi... | true | true |
f73f4e15154d4194484a9fd8d414400852b8fc41 | 3,152 | py | Python | councelapp/migrations/0001_initial.py | Kipkorir-Gideon/Councel | c6ba2ea4a5d1794e4af4c863492e1872da73acac | [
"MIT"
] | null | null | null | councelapp/migrations/0001_initial.py | Kipkorir-Gideon/Councel | c6ba2ea4a5d1794e4af4c863492e1872da73acac | [
"MIT"
] | 5 | 2022-01-24T07:05:51.000Z | 2022-02-03T20:32:43.000Z | councelapp/migrations/0001_initial.py | Kipkorir-Gideon/Councel | c6ba2ea4a5d1794e4af4c863492e1872da73acac | [
"MIT"
] | 1 | 2022-02-04T16:24:22.000Z | 2022-02-04T16:24:22.000Z | # Generated by Django 3.2.9 on 2022-02-03 06:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 49.25 | 174 | 0.616117 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f73f4e26b73116d79d2f21aa7909bba599400cc2 | 137 | py | Python | python/matplotlib/ee.py | seekindark/helloworld | 00fe439fdbd98add53f3bec7eac2b1ba1dc817a7 | [
"BSD-2-Clause"
] | null | null | null | python/matplotlib/ee.py | seekindark/helloworld | 00fe439fdbd98add53f3bec7eac2b1ba1dc817a7 | [
"BSD-2-Clause"
] | 2 | 2019-06-24T00:56:52.000Z | 2019-06-24T01:28:29.000Z | python/matplotlib/ee.py | seekindark/helloworld | 00fe439fdbd98add53f3bec7eac2b1ba1dc817a7 | [
"BSD-2-Clause"
] | null | null | null | import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [2.3, 3.4, 1.2, 6.6, 7.0]
plt.scatter(x, y, color='r', marker='+')
plt.show() | 27.4 | 41 | 0.547445 | import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [2.3, 3.4, 1.2, 6.6, 7.0]
plt.scatter(x, y, color='r', marker='+')
plt.show() | true | true |
f73f4ec0f39766d0072cc1a29c83e5dffd603ef3 | 3,986 | py | Python | nltk/corpus/reader/ieer.py | SamuraiT/nltk3-alpha | 18a1a0ff8697eaeeb5d3c0bc6dad251d5b8fe931 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | nltk/corpus/reader/ieer.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | null | null | null | nltk/corpus/reader/ieer.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | 2 | 2019-10-28T01:33:22.000Z | 2019-10-30T06:43:43.000Z | # Natural Language Toolkit: IEER Corpus Reader
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Corpus reader for the Information Extraction and Entity Recognition C... | 35.589286 | 75 | 0.620171 |
from __future__ import unicode_literals
import nltk
from nltk import compat
from nltk.corpus.reader.api import *
titles = {
'APW_19980314': 'Associated Press Weekly, 14 March 1998',
'APW_19980424': 'Associated Press Weekly, 24 April 1998',
'APW_19980429': 'Associated Press Weekly, 29 April 1998'... | true | true |
f73f4ee0af94576eb90f3c57d20b03bf3bdf9775 | 3,719 | py | Python | portal/views/crossdomain.py | ivan-c/truenth-portal | 0b9d39ae43f42ea3413ed9634f295f5d856cbc77 | [
"BSD-3-Clause"
] | null | null | null | portal/views/crossdomain.py | ivan-c/truenth-portal | 0b9d39ae43f42ea3413ed9634f295f5d856cbc77 | [
"BSD-3-Clause"
] | 123 | 2019-04-04T06:59:59.000Z | 2021-08-02T07:46:21.000Z | portal/views/crossdomain.py | ivan-c/truenth-portal | 0b9d39ae43f42ea3413ed9634f295f5d856cbc77 | [
"BSD-3-Clause"
] | null | null | null | """Cross Domain Decorators"""
from datetime import timedelta
from functools import update_wrapper
from flask import current_app, make_response, request
from past.builtins import basestring
from ..models.client import validate_origin
def crossdomain(
origin=None,
methods=None,
headers=(
... | 36.106796 | 73 | 0.629739 | from datetime import timedelta
from functools import update_wrapper
from flask import current_app, make_response, request
from past.builtins import basestring
from ..models.client import validate_origin
def crossdomain(
origin=None,
methods=None,
headers=(
'Authorization',
... | true | true |
f73f4f191d577d170e4b70b5b6fe56297d2121cc | 3,985 | py | Python | pandas/util/clipboard/clipboards.py | tacaswell/pandas | 81c57e20da278494dfebc2f1043f5ff361a234f3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/util/clipboard/clipboards.py | tacaswell/pandas | 81c57e20da278494dfebc2f1043f5ff361a234f3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/util/clipboard/clipboards.py | tacaswell/pandas | 81c57e20da278494dfebc2f1043f5ff361a234f3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2019-02-20T18:01:08.000Z | 2019-02-20T18:01:08.000Z | # flake8: noqa
import sys
import subprocess
from .exceptions import PyperclipException
EXCEPT_MSG = """
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit https://pyperclip.readthedocs.org """
PY2 = sys.version_info[0] == 2
text_type = unicode if PY2 else str
... | 28.876812 | 77 | 0.60276 |
import sys
import subprocess
from .exceptions import PyperclipException
EXCEPT_MSG = """
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit https://pyperclip.readthedocs.org """
PY2 = sys.version_info[0] == 2
text_type = unicode if PY2 else str
def init_osx_... | true | true |
f73f4ff774bec7747d312a9d9b5cf161e45feb02 | 791 | py | Python | src/test/python/testSmvFramework/unicode/modules.py | ninjapapa/SMV2 | 42cf9f176c3ec0bed61f66fbf859c18d97027dd6 | [
"Apache-2.0"
] | null | null | null | src/test/python/testSmvFramework/unicode/modules.py | ninjapapa/SMV2 | 42cf9f176c3ec0bed61f66fbf859c18d97027dd6 | [
"Apache-2.0"
] | 34 | 2022-02-26T04:27:34.000Z | 2022-03-29T23:05:47.000Z | src/test/python/testSmvFramework/unicode/modules.py | ninjapapa/SMV2 | 42cf9f176c3ec0bed61f66fbf859c18d97027dd6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 32.958333 | 74 | 0.71555 |
from smv import *
class ModWithUnicode(SmvModule):
def requiresDS(self):
return []
def run(self, i):
unicode_str = "哈哈"
return self.smvApp.createDF("a:String", unicode_str)
| true | true |
f73f5030e2343589d7d26d6f638a9470b3c4f9e4 | 1,507 | py | Python | examples/prompts/auto-suggestion.py | dgilman/python-prompt-toolkit | c4ff7317c995b4b032f07ba2b180c89f1de4a169 | [
"BSD-3-Clause"
] | null | null | null | examples/prompts/auto-suggestion.py | dgilman/python-prompt-toolkit | c4ff7317c995b4b032f07ba2b180c89f1de4a169 | [
"BSD-3-Clause"
] | null | null | null | examples/prompts/auto-suggestion.py | dgilman/python-prompt-toolkit | c4ff7317c995b4b032f07ba2b180c89f1de4a169 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Simple example of a CLI that demonstrates fish-style auto suggestion.
When you type some input, it will match the input against the history. If One
entry of the history starts with the given input, then it will show the
remaining part as a suggestion. Pressing the right arrow will insert this... | 30.14 | 77 | 0.700066 |
from __future__ import print_function, unicode_literals
from prompt_toolkit2 import PromptSession
from prompt_toolkit2.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit2.history import InMemoryHistory
def main():
history = InMemoryHistory()
history.append_string('import os')
history.ap... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.