hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7617d83caf7c5f9ac1f50e04980c8e56abfb582 | 43,513 | py | Python | tensorflow/python/ops/linalg/linalg_impl.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 57 | 2017-09-03T07:08:31.000Z | 2022-02-28T04:33:42.000Z | tensorflow/python/ops/linalg/linalg_impl.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 8 | 2019-03-13T23:13:47.000Z | 2020-01-31T21:08:21.000Z | tensorflow/python/ops/linalg/linalg_impl.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 28 | 2017-03-25T13:48:09.000Z | 2021-10-14T00:10:50.000Z | # Copyright 2017 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... | 39.665451 | 80 | 0.665617 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor... | true | true |
f7617e313b0774ed237c76a4cd67a8d4459ec094 | 35,743 | py | Python | veriloggen/fsm/fsm.py | Pyverilog/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | veriloggen/fsm/fsm.py | Pyverilog/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | veriloggen/fsm/fsm.py | shtaxxx/veriloggen | 381ac8920088d986925cf87cb838366eb48a4889 | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import collections
import functools
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from veriloggen.core.submodule import Submodule
from veriloggen.seq.subst_visitor import *
from verilog... | 32.912523 | 96 | 0.512716 | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import collections
import functools
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from veriloggen.core.submodule import Submodule
from veriloggen.seq.subst_visitor import *
from verilog... | true | true |
f7617e8ecb8a1cc983e586ae75edd127bbeff867 | 1,032 | py | Python | 630_Unit_Tests/tests.py | PacktPublishing/Python-for-Everybody-The-Ultimate-Python-3-Bootcamp | 34d11a55506b1e0831a10166a5377f6592afeee8 | [
"MIT"
] | 9 | 2020-08-06T08:53:36.000Z | 2021-12-30T13:25:01.000Z | 630_Unit_Tests/tests.py | PacktPublishing/Python-for-Everybody-The-Ultimate-Python-3-Bootcamp | 34d11a55506b1e0831a10166a5377f6592afeee8 | [
"MIT"
] | 1 | 2021-12-09T07:43:02.000Z | 2021-12-09T07:43:02.000Z | 630_Unit_Tests/tests.py | PacktPublishing/Python-for-Everybody-The-Ultimate-Python-3-Bootcamp | 34d11a55506b1e0831a10166a5377f6592afeee8 | [
"MIT"
] | 17 | 2020-07-28T10:04:41.000Z | 2021-11-06T17:54:02.000Z | import unittest
from my_program import make_it_uppercase, get_first_word, return_a_list
class TestMyProgram(unittest.TestCase):
def test_hello_world(self):
result = make_it_uppercase("hello world")
self.assertEqual(result, 'HELLO WORLD')
def test_first_word_in_sentence(self):
sentenc... | 33.290323 | 222 | 0.687016 | import unittest
from my_program import make_it_uppercase, get_first_word, return_a_list
class TestMyProgram(unittest.TestCase):
def test_hello_world(self):
result = make_it_uppercase("hello world")
self.assertEqual(result, 'HELLO WORLD')
def test_first_word_in_sentence(self):
sentenc... | true | true |
f7617ea85980386cf7c2e89a71d09154e35fc1c6 | 2,107 | py | Python | BRAIN/Scripts/PREPROCESSING (DONE)/PRE_POST_SCALP_SEGMENTATION/4middlereg_v2.py | tlsgusdn1107/BRAIN | 7664e276d0de16f27b0c40d5a83b5fe751830b15 | [
"MIT"
] | null | null | null | BRAIN/Scripts/PREPROCESSING (DONE)/PRE_POST_SCALP_SEGMENTATION/4middlereg_v2.py | tlsgusdn1107/BRAIN | 7664e276d0de16f27b0c40d5a83b5fe751830b15 | [
"MIT"
] | null | null | null | BRAIN/Scripts/PREPROCESSING (DONE)/PRE_POST_SCALP_SEGMENTATION/4middlereg_v2.py | tlsgusdn1107/BRAIN | 7664e276d0de16f27b0c40d5a83b5fe751830b15 | [
"MIT"
] | null | null | null | from __future__ import division
from sympy import *
import numpy as np
import nibabel as nib
def middle_reg(a,b):
A = nib.load(str(a))
AA = np.array(A.dataobj)
B = []
for x in range(AA.shape[0]):
for y in range(AA.shape[1]):
for z in range(AA.shape[2]):
if AA[x][y... | 36.327586 | 131 | 0.523019 | from __future__ import division
from sympy import *
import numpy as np
import nibabel as nib
def middle_reg(a,b):
A = nib.load(str(a))
AA = np.array(A.dataobj)
B = []
for x in range(AA.shape[0]):
for y in range(AA.shape[1]):
for z in range(AA.shape[2]):
if AA[x][y... | true | true |
f7617f2331d7a405d1f845ad142b2be3465c2732 | 48,894 | py | Python | cinder/tests/unit/test_nfs.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/test_nfs.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/test_nfs.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 NetApp, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 36.901132 | 79 | 0.637767 |
import errno
import os
import testtools
import mock
from mox3 import mox as mox_lib
from mox3.mox import stubout
from oslo_utils import units
from cinder import exception
from cinder.image import image_utils
from cinder import test
from cinder.volume import configuration as conf
from cinder.volume.drivers import nfs... | true | true |
f7617fb5c85b275a72e80fb9ffe3c1f417d3a610 | 366 | py | Python | PartIVExercises/11/countdown.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2020-10-12T13:33:29.000Z | 2020-10-12T13:33:29.000Z | PartIVExercises/11/countdown.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | null | null | null | PartIVExercises/11/countdown.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2016-11-09T07:28:45.000Z | 2016-11-09T07:28:45.000Z | #!/usr/bin/env python3
def countdown(n):
if n <= 0:
print()
return
print(n, end=' ')
countdown(n-1)
countdown(5)
print(list(range(5, 0, -1)))
print(list(x for x in range(5, 0, -1)))
def countdown2(n):
if n <= 0:
yield 'stop'
else:
yield n
for i in countdo... | 15.25 | 41 | 0.535519 |
def countdown(n):
if n <= 0:
print()
return
print(n, end=' ')
countdown(n-1)
countdown(5)
print(list(range(5, 0, -1)))
print(list(x for x in range(5, 0, -1)))
def countdown2(n):
if n <= 0:
yield 'stop'
else:
yield n
for i in countdown2(n-1): yield i
prin... | true | true |
f7617fc5f4e6394120e768c9553d1863be01f791 | 1,387 | py | Python | scripts/capture_the_flag/constants.py | UserXXX/CuBoltScripts | 471d575d8664f0e3827600f19eb0da8bb080e206 | [
"MIT"
] | null | null | null | scripts/capture_the_flag/constants.py | UserXXX/CuBoltScripts | 471d575d8664f0e3827600f19eb0da8bb080e206 | [
"MIT"
] | 2 | 2015-01-12T18:55:16.000Z | 2015-01-14T17:32:16.000Z | scripts/capture_the_flag/constants.py | UserXXX/CuBoltScripts | 471d575d8664f0e3827600f19eb0da8bb080e206 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2014-2015 Bjoern Lange
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy,... | 38.527778 | 70 | 0.780101 |
RELATION_FRIENDLY_PLAYER = 10
RELATION_FRIENDLY = 11
RELATION_FRIENDLY_NAME = 12
RELATION_HOSTILE_PLAYER = 13
RELATION_HOSTILE = 14
RELATION_NEUTRAL = 15
RELATION_TARGET = 16 | true | true |
f7618018f28fc01b84ce8475c8d7cc0605f3daba | 3,511 | py | Python | sentence_transformers/models/DistilBERT.py | WangHexie/sentence-transformers | a63326bc11a290c9423abea9bb372576760a1778 | [
"Apache-2.0"
] | 3 | 2022-01-08T06:50:54.000Z | 2022-03-03T06:50:47.000Z | ai/KoSentenceBERTchatbot/KoSentenceBERT/sentence_transformers/models/DistilBERT.py | MingyuKim-2933/WelfareForEveryOne | ddd3ce34e8102441d5e9bd57bd0b6b1a29cf83b7 | [
"MIT"
] | 5 | 2021-07-02T04:37:04.000Z | 2021-07-21T00:02:58.000Z | ai/KoSentenceBERTchatbot/KoSentenceBERT/sentence_transformers/models/DistilBERT.py | MingyuKim-2933/WelfareForEveryOne | ddd3ce34e8102441d5e9bd57bd0b6b1a29cf83b7 | [
"MIT"
] | 5 | 2021-07-04T06:02:02.000Z | 2021-07-21T08:32:10.000Z | from torch import Tensor
from torch import nn
from transformers import DistilBertModel, DistilBertTokenizer
import json
from typing import Union, Tuple, List, Dict, Optional
import os
import numpy as np
import logging
class DistilBERT(nn.Module):
"""DEPRECATED: Please use models.Transformer instead.
DistilBER... | 39.011111 | 167 | 0.696383 | from torch import Tensor
from torch import nn
from transformers import DistilBertModel, DistilBertTokenizer
import json
from typing import Union, Tuple, List, Dict, Optional
import os
import numpy as np
import logging
class DistilBERT(nn.Module):
def __init__(self, model_name_or_path: str, max_seq_length: int = 12... | true | true |
f7618021029965dfabe1f220b78c93723d156ad6 | 1,238 | py | Python | scripts/data_generation/create_samplesheets.py | segrelab/MiCoNE-synthetic-data | 330957b5d1c8ce8f27f915c8c5ceaedbcb1447b5 | [
"MIT"
] | null | null | null | scripts/data_generation/create_samplesheets.py | segrelab/MiCoNE-synthetic-data | 330957b5d1c8ce8f27f915c8c5ceaedbcb1447b5 | [
"MIT"
] | null | null | null | scripts/data_generation/create_samplesheets.py | segrelab/MiCoNE-synthetic-data | 330957b5d1c8ce8f27f915c8c5ceaedbcb1447b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pathlib
from typing import List
import pandas as pd
HEADER = ["id", "otu_table", "obs_metadata", "sample_metadata", "children_map"]
def main(files: List[pathlib.Path], name: str) -> None:
"""Create samplesheet for list of files"""
data = []
for file in files:
dir =... | 30.95 | 86 | 0.58643 |
import pathlib
from typing import List
import pandas as pd
HEADER = ["id", "otu_table", "obs_metadata", "sample_metadata", "children_map"]
def main(files: List[pathlib.Path], name: str) -> None:
data = []
for file in files:
dir = file.parent
id_ = dir.stem
otu_table = dir / "otu_tab... | true | true |
f76180ed5d4a6ad1dc2a760fed07faea11ca2ac1 | 82 | py | Python | describe/describe/core/__init__.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | 2 | 2018-10-10T09:32:34.000Z | 2019-03-28T08:42:31.000Z | describe/describe/core/__init__.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | null | null | null | describe/describe/core/__init__.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | null | null | null | from describe.core.system import System
from describe.core.lattice import Lattice
| 27.333333 | 41 | 0.853659 | from describe.core.system import System
from describe.core.lattice import Lattice
| true | true |
f76181aec815f220e3f65cffdac856b87e0bd547 | 13,242 | py | Python | desktop/libs/metadata/src/metadata/conf.py | multivacplatform/hue | c6fff4781fdb4da2e712b48f848c43cf5ba3c678 | [
"Apache-2.0"
] | null | null | null | desktop/libs/metadata/src/metadata/conf.py | multivacplatform/hue | c6fff4781fdb4da2e712b48f848c43cf5ba3c678 | [
"Apache-2.0"
] | null | null | null | desktop/libs/metadata/src/metadata/conf.py | multivacplatform/hue | c6fff4781fdb4da2e712b48f848c43cf5ba3c678 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 33.18797 | 177 | 0.717263 |
import logging
from subprocess import CalledProcessError
from django.utils.translation import ugettext_lazy as _t
from desktop.conf import AUTH_USERNAME as DEFAULT_AUTH_USERNAME, CLUSTER_ID as DEFAULT_CLUSTER_ID
from desktop.lib.conf import Config, ConfigSection, coerce_bool, coerce_password_from_script
from deskto... | true | true |
f76181e06d0eb6a1d77bdaa505d2a315b7d09b26 | 7,616 | py | Python | tests/python/contrib/test_hexagon/conftest.py | LEA0317/incubator-tvm | de21c8f2ef507587fdcc99b851404de5aeeb5a16 | [
"Apache-2.0"
] | null | null | null | tests/python/contrib/test_hexagon/conftest.py | LEA0317/incubator-tvm | de21c8f2ef507587fdcc99b851404de5aeeb5a16 | [
"Apache-2.0"
] | null | null | null | tests/python/contrib/test_hexagon/conftest.py | LEA0317/incubator-tvm | de21c8f2ef507587fdcc99b851404de5aeeb5a16 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.547009 | 130 | 0.707064 |
import os
import random
import socket
from typing import Optional, Union
import pytest
import tvm
import tvm.rpc.tracker
from tvm.contrib.hexagon.build import HexagonLauncher, HexagonLauncherRPC
from tvm.contrib.hexagon.session import Session
HEXAGON_TOOLCHAIN = "HEXAGON_TOOLCHAIN"
TVM_TRACKER_HOST = "TVM_TRACKER_... | true | true |
f76182774ed66d88bdbf7b5b663322c8c4cfc816 | 4,932 | py | Python | main.py | SvtFilatov/PredictPricesSoccer | ad50823ff49e696332c1a7e1e1b0559d6d5d511e | [
"MIT"
] | null | null | null | main.py | SvtFilatov/PredictPricesSoccer | ad50823ff49e696332c1a7e1e1b0559d6d5d511e | [
"MIT"
] | null | null | null | main.py | SvtFilatov/PredictPricesSoccer | ad50823ff49e696332c1a7e1e1b0559d6d5d511e | [
"MIT"
] | null | null | null | import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import warnings
warnings.filterwarnings('ignore')
import random
st.title('Прогнозирование цены футболистов')
st.markdown('Целью этого проета было предсказание цен на молодых атакующих футболисто... | 41.1 | 141 | 0.692011 | import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import warnings
warnings.filterwarnings('ignore')
import random
st.title('Прогнозирование цены футболистов')
st.markdown('Целью этого проета было предсказание цен на молодых атакующих футболисто... | true | true |
f76183858268b234449b4687219c227056b52bcc | 1,443 | py | Python | disk/form.py | lzxleslie/Hgis_program | d8377d76461c3e34d8b3ba5df020f6165ceb4573 | [
"MIT"
] | null | null | null | disk/form.py | lzxleslie/Hgis_program | d8377d76461c3e34d8b3ba5df020f6165ceb4573 | [
"MIT"
] | null | null | null | disk/form.py | lzxleslie/Hgis_program | d8377d76461c3e34d8b3ba5df020f6165ceb4573 | [
"MIT"
] | null | null | null | #! /usr/bin/python
#coding:utf-8
from django import forms
from django.conf import settings
# form for register
class RegisterForm(forms.Form):
username = forms.CharField(widget=forms.TextInput(attrs={"placeholder":"username", "required": "required",}), max_length=50, error_messages={"required": "username can not be n... | 49.758621 | 188 | 0.75052 | from django import forms
from django.conf import settings
class RegisterForm(forms.Form):
username = forms.CharField(widget=forms.TextInput(attrs={"placeholder":"username", "required": "required",}), max_length=50, error_messages={"required": "username can not be null",})
email = forms.EmailField(widget=forms.TextIn... | true | true |
f761849b5a4f4a9a3e0e3b79a8c5c9b1f726ae8e | 3,444 | py | Python | projects/ide/sublime/src/Bolt/api/inspect/highlighting.py | boltjs/bolt | c2666c876b34b1a61486a432eef3141ca8d1e411 | [
"BSD-3-Clause"
] | 11 | 2015-09-29T19:19:34.000Z | 2020-11-20T09:14:46.000Z | projects/ide/sublime/src/Bolt/api/inspect/highlighting.py | boltjs/bolt | c2666c876b34b1a61486a432eef3141ca8d1e411 | [
"BSD-3-Clause"
] | null | null | null | projects/ide/sublime/src/Bolt/api/inspect/highlighting.py | boltjs/bolt | c2666c876b34b1a61486a432eef3141ca8d1e411 | [
"BSD-3-Clause"
] | null | null | null | import sublime
from ui.read import settings as read_settings
from ui.write import write, highlight as write_highlight
from lookup import file_type as lookup_file_type
from ui.read import x as ui_read
from ui.read import spots as read_spots
from ui.read import regions as ui_regions
from core.read import read as core_rea... | 29.689655 | 116 | 0.654472 | import sublime
from ui.read import settings as read_settings
from ui.write import write, highlight as write_highlight
from lookup import file_type as lookup_file_type
from ui.read import x as ui_read
from ui.read import spots as read_spots
from ui.read import regions as ui_regions
from core.read import read as core_rea... | false | true |
f761855c3739adc24f86258724df072d2e0270a6 | 5,306 | py | Python | download_ycb_dataset.py | GPT-RL/ycb-tools | 2a2a0da7e6a3b46926c1fb0fab21327a896555ad | [
"MIT"
] | null | null | null | download_ycb_dataset.py | GPT-RL/ycb-tools | 2a2a0da7e6a3b46926c1fb0fab21327a896555ad | [
"MIT"
] | null | null | null | download_ycb_dataset.py | GPT-RL/ycb-tools | 2a2a0da7e6a3b46926c1fb0fab21327a896555ad | [
"MIT"
] | null | null | null | # Copyright 2015 Yale University - Grablab
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr... | 40.503817 | 462 | 0.683377 |
import os
import sys
import json
import urllib
from urllib.request import Request, urlopen
output_directory = os.path.join("models", "ycb")
objects_to_download = "all"
files_to_download = ["berkeley_processed", "google_16k"]
extract = True
base_url = "http://ycb-benchmarks.s3-website-us-east-1.amazonaws.com/dat... | true | true |
f76185f22303382fb3b1fb3d9abd89815b293282 | 23,335 | py | Python | yolox/models/yolo_head.py | zhanglirong1999/YOLOX | 8b96c9c954e773a68cb439506bedd3b80406cc7d | [
"Apache-2.0"
] | null | null | null | yolox/models/yolo_head.py | zhanglirong1999/YOLOX | 8b96c9c954e773a68cb439506bedd3b80406cc7d | [
"Apache-2.0"
] | 2 | 2022-02-15T05:36:02.000Z | 2022-03-30T11:26:51.000Z | yolox/models/yolo_head.py | zhanglirong1999/YOLOX | 8b96c9c954e773a68cb439506bedd3b80406cc7d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii Inc. All rights reserved.
import math
from loguru import logger
import torch
import torch.nn as nn
import torch.nn.functional as F
from yolox.utils import bboxes_iou, meshgrid
from .losses import IOUloss
from .network_blocks import BaseConv, DWCon... | 36.122291 | 106 | 0.510864 |
import math
from loguru import logger
import torch
import torch.nn as nn
import torch.nn.functional as F
from yolox.utils import bboxes_iou, meshgrid
from .losses import IOUloss
from .network_blocks import BaseConv, DWConv
class YOLOXHead(nn.Module):
def __init__(
self,
num_classes,
wi... | true | true |
f76187ec28b36aa1690b8faa4f3fa240a1a2190e | 445 | py | Python | src/bxcommon/models/config/abstract_config_model.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 12 | 2019-11-06T17:39:10.000Z | 2022-03-01T11:26:19.000Z | src/bxcommon/models/config/abstract_config_model.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 8 | 2019-11-06T21:31:11.000Z | 2021-06-02T00:46:50.000Z | src/bxcommon/models/config/abstract_config_model.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 5 | 2019-11-14T18:08:11.000Z | 2022-02-08T09:36:22.000Z | class AbstractConfigModel:
def merge(self, config: "AbstractConfigModel"):
for key, value in self.__dict__.items():
updated_attr = getattr(config, key, None)
if updated_attr:
if isinstance(updated_attr, dict) and hasattr(value, "__dict__"):
value._... | 40.454545 | 81 | 0.58427 | class AbstractConfigModel:
def merge(self, config: "AbstractConfigModel"):
for key, value in self.__dict__.items():
updated_attr = getattr(config, key, None)
if updated_attr:
if isinstance(updated_attr, dict) and hasattr(value, "__dict__"):
value._... | true | true |
f761898dc6203f87dbf9c8c9cc89cad1068128a4 | 726 | py | Python | netmiko_config.py | skpareek84/pytest | b19e780fa7f7c3b662b5f5561b8c09a7fd052bab | [
"Apache-2.0"
] | null | null | null | netmiko_config.py | skpareek84/pytest | b19e780fa7f7c3b662b5f5561b8c09a7fd052bab | [
"Apache-2.0"
] | null | null | null | netmiko_config.py | skpareek84/pytest | b19e780fa7f7c3b662b5f5561b8c09a7fd052bab | [
"Apache-2.0"
] | null | null | null | #!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
from netmiko import ConnectHandler
cisco_csr = {
'device_type' : 'cisco_ios',
'host' : '172.16.43.153',
'username' : 'root',
'password' : 'cisco'
}
# By checking couple of things connecthandler will allow you to connect
'''
. device_type
'''
device... | 22.6875 | 84 | 0.750689 | from netmiko import ConnectHandler
cisco_csr = {
'device_type' : 'cisco_ios',
'host' : '172.16.43.153',
'username' : 'root',
'password' : 'cisco'
}
device_connect= ConnectHandler(**cisco_csr)
print([ i for i in dir(device_connect) if 'send' in i])
conf=['hostname pyrouter1','username hello privi 10 password c... | true | true |
f76189acfce42b711339234c0313475fbe041a07 | 4,506 | py | Python | torch/utils/data/datapipes/dataframe/datapipes.py | svecjan/pytorch | 09d221e8d439bc748b162c028f7eece202688adf | [
"Intel"
] | 3 | 2020-11-06T22:02:36.000Z | 2021-06-25T13:50:47.000Z | torch/utils/data/datapipes/dataframe/datapipes.py | svecjan/pytorch | 09d221e8d439bc748b162c028f7eece202688adf | [
"Intel"
] | 1 | 2021-04-22T18:37:42.000Z | 2021-04-28T00:53:25.000Z | torch/utils/data/datapipes/dataframe/datapipes.py | svecjan/pytorch | 09d221e8d439bc748b162c028f7eece202688adf | [
"Intel"
] | 1 | 2021-09-29T20:30:56.000Z | 2021-09-29T20:30:56.000Z | import random
from torch.utils.data import (
DFIterDataPipe,
IterDataPipe,
functional_datapipe,
)
try:
import pandas # type: ignore[import]
# pandas used only for prototyping, will be shortly replaced with TorchArrow
WITH_PANDAS = True
except ImportError:
WITH_PANDAS = False
@functional... | 32.652174 | 89 | 0.62672 | import random
from torch.utils.data import (
DFIterDataPipe,
IterDataPipe,
functional_datapipe,
)
try:
import pandas WITH_PANDAS = True
except ImportError:
WITH_PANDAS = False
@functional_datapipe('_dataframes_as_tuples')
class DataFramesAsTuplesPipe(IterDataPipe):
def __init__(self... | true | true |
f7618a7dd0c973a4fcae796b00adbbcb6239d967 | 579 | py | Python | Course01/Backyard-Flyer-Project/drone.py | thhuang/notes-fcnd | c5b0ec7d99df3cb60a850308d16ccc6c096c7931 | [
"MIT"
] | 1 | 2021-12-14T09:34:36.000Z | 2021-12-14T09:34:36.000Z | Course01/Backyard-Flyer-Project/drone.py | thhuang/notes-fcnd | c5b0ec7d99df3cb60a850308d16ccc6c096c7931 | [
"MIT"
] | null | null | null | Course01/Backyard-Flyer-Project/drone.py | thhuang/notes-fcnd | c5b0ec7d99df3cb60a850308d16ccc6c096c7931 | [
"MIT"
] | 1 | 2018-10-26T04:06:23.000Z | 2018-10-26T04:06:23.000Z | import argparse
from udacidrone import Drone
from udacidrone.connection import MavlinkConnection
import time
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--port', type=int, default=5760, help='Port number')
parser.add_argument('--host', type=str, default='127.0.0.1', ... | 36.1875 | 103 | 0.701209 | import argparse
from udacidrone import Drone
from udacidrone.connection import MavlinkConnection
import time
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--port', type=int, default=5760, help='Port number')
parser.add_argument('--host', type=str, default='127.0.0.1', ... | true | true |
f7618b0f09113af433c06ea4a5531a1399806134 | 1,488 | py | Python | ecl/tests/unit/identity/test_identity_service.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | 5 | 2017-04-07T06:23:04.000Z | 2019-11-19T00:52:34.000Z | ecl/tests/unit/identity/test_identity_service.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | 16 | 2018-09-12T11:14:40.000Z | 2021-04-19T09:02:44.000Z | ecl/tests/unit/identity/test_identity_service.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | 14 | 2017-05-11T14:26:26.000Z | 2021-07-14T14:00:06.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 39.157895 | 75 | 0.722446 |
import testtools
from ecl.identity import identity_service
class TestIdentityService(testtools.TestCase):
def test_regular_service(self):
sot = identity_service.IdentityService()
self.assertEqual('identity', sot.service_type)
self.assertEqual('public', sot.interface)
self.assert... | true | true |
f7618c16cb3bf1e22ab4f6fc0732ae50a2ee385e | 914 | py | Python | application/server/main.py | yangboz/steganoAAS | fa33c88cf3f8c66cadf1df68f5150e269f48095b | [
"MIT"
] | null | null | null | application/server/main.py | yangboz/steganoAAS | fa33c88cf3f8c66cadf1df68f5150e269f48095b | [
"MIT"
] | null | null | null | application/server/main.py | yangboz/steganoAAS | fa33c88cf3f8c66cadf1df68f5150e269f48095b | [
"MIT"
] | null | null | null | import uvicorn
from fastapi import FastAPI, File, UploadFile
from starlette.responses import RedirectResponse
app_desc = """<h2>Try this app by demostrating[a,b,c,d,e] data and index for `api/res`</h2>
<h2>Try get/add/modify/delete rest functions and verify return response </h2>
<br>by Aniket Maurya"""
app = Fast... | 22.292683 | 92 | 0.699125 | import uvicorn
from fastapi import FastAPI, File, UploadFile
from starlette.responses import RedirectResponse
app_desc = """<h2>Try this app by demostrating[a,b,c,d,e] data and index for `api/res`</h2>
<h2>Try get/add/modify/delete rest functions and verify return response </h2>
<br>by Aniket Maurya"""
app = Fast... | true | true |
f7618dc0d74f14fcde036ceeca0c59c04d6113fd | 392 | py | Python | jp.atcoder/joi2006yo/joi2006yo_b/11171177.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/joi2006yo/joi2006yo_b/11171177.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/joi2006yo/joi2006yo_b/11171177.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
n = int(sys.stdin.readline().rstrip())
table = dict()
for _ in range(n):
b, a = sys.stdin.readline().split()
table[b] = a
n, *s = sys.stdin.read().split()
def main():
t = ''
for c in s:
if c in table:
t += table[c]
else:
t += c
r... | 17.043478 | 40 | 0.466837 | import sys
n = int(sys.stdin.readline().rstrip())
table = dict()
for _ in range(n):
b, a = sys.stdin.readline().split()
table[b] = a
n, *s = sys.stdin.read().split()
def main():
t = ''
for c in s:
if c in table:
t += table[c]
else:
t += c
r... | true | true |
f7618dd814be4093cd3956f017cb88e7d8f54ab2 | 1,423 | py | Python | migrations/versions/ac28bef87cb9_wiki版本追踪.py | Officeyutong/HelloJudge2 | e88c0a1198f8531ee0c1121dccfedb51f3f0aa0e | [
"MIT"
] | 21 | 2020-02-24T07:56:55.000Z | 2022-01-22T11:32:28.000Z | migrations/versions/ac28bef87cb9_wiki版本追踪.py | Officeyutong/HelloJudge2 | e88c0a1198f8531ee0c1121dccfedb51f3f0aa0e | [
"MIT"
] | 1 | 2021-02-07T13:08:47.000Z | 2021-02-09T04:50:49.000Z | migrations/versions/ac28bef87cb9_wiki版本追踪.py | Officeyutong/HelloJudge2 | e88c0a1198f8531ee0c1121dccfedb51f3f0aa0e | [
"MIT"
] | 3 | 2020-06-04T07:56:20.000Z | 2021-06-21T04:04:15.000Z | """wiki版本追踪
Revision ID: ac28bef87cb9
Revises: c5d936a18918
Create Date: 2020-09-05 15:09:30.698554
"""
import ormtypes
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'ac28bef87cb9'
down_revision = 'c5d936a18918'
branch_labels ... | 37.447368 | 127 | 0.724526 | import ormtypes
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = 'ac28bef87cb9'
down_revision = 'c5d936a18918'
branch_labels = None
depends_on = None
def upgrade():
op.drop_constraint('wikipage_ibfk_2', 'wikipage', type_='foreignkey')
op.drop_column('wikipag... | true | true |
f7618f6de098778e55e7b113c4712f1394f728a3 | 932 | py | Python | cfg/config_cordic.py | cornell-zhang/datuner | b893e7c0656ada8f091961b61141e73ea15c25a2 | [
"BSD-3-Clause"
] | 17 | 2017-09-28T12:12:35.000Z | 2022-01-03T23:16:37.000Z | cfg/config_cordic.py | cornell-zhang/datuner | b893e7c0656ada8f091961b61141e73ea15c25a2 | [
"BSD-3-Clause"
] | 12 | 2017-08-21T14:03:50.000Z | 2018-09-09T01:08:00.000Z | cfg/config_cordic.py | cornell-zhang/datuner | b893e7c0656ada8f091961b61141e73ea15c25a2 | [
"BSD-3-Clause"
] | 8 | 2017-11-28T01:39:28.000Z | 2019-06-30T13:06:33.000Z | space = [
['EnumParameter', 'INT_WIDTH_THETA', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
['EnumParameter', 'FRA_WIDTH_THETA', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
['EnumParameter', 'INT_WIDTH_COS', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
['EnumParameter'... | 44.380952 | 97 | 0.597639 | space = [
['EnumParameter', 'INT_WIDTH_THETA', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
['EnumParameter', 'FRA_WIDTH_THETA', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
['EnumParameter', 'INT_WIDTH_COS', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
['EnumParameter'... | false | true |
f7618fd319e400834fd09a9b6bac13d210e47523 | 664 | py | Python | blog-record/record-4/cnn-py/layer.py | MaxXSoft/Deeplearning-Notes | 0d4e2e258c0d6bf1246c4108b9242ea747242c1e | [
"MIT"
] | 3 | 2019-06-03T00:51:09.000Z | 2021-04-02T04:58:32.000Z | blog-record/record-4/cnn-py/layer.py | MaxXSoft/Deeplearning-Notes | 0d4e2e258c0d6bf1246c4108b9242ea747242c1e | [
"MIT"
] | null | null | null | blog-record/record-4/cnn-py/layer.py | MaxXSoft/Deeplearning-Notes | 0d4e2e258c0d6bf1246c4108b9242ea747242c1e | [
"MIT"
] | 1 | 2021-01-12T09:50:39.000Z | 2021-01-12T09:50:39.000Z | class Layer:
def forward(self, x):
'''
forward propagation
Parameters
---
x: matrix
input from last layer
Returns
---
out: matrix
output of current layer
'''
raise NotImplementedError
def backprop(self, d):
'''
backward propagation
Parameters
-... | 14.12766 | 33 | 0.573795 | class Layer:
def forward(self, x):
raise NotImplementedError
def backprop(self, d):
raise NotImplementedError
def gradient(self, alpha):
raise NotImplementedError
| true | true |
f7619099600ba228c5f64fad0218c5878873ec0b | 3,556 | py | Python | seisflows/system/multicore.py | fanwu8/sf | 8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf | [
"BSD-2-Clause"
] | 1 | 2021-09-17T18:25:55.000Z | 2021-09-17T18:25:55.000Z | seisflows/system/multicore.py | fanwu8/sf | 8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf | [
"BSD-2-Clause"
] | null | null | null | seisflows/system/multicore.py | fanwu8/sf | 8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf | [
"BSD-2-Clause"
] | 1 | 2019-06-27T19:16:30.000Z | 2019-06-27T19:16:30.000Z |
import os
import sys
import numpy as np
from os.path import abspath, basename, join
from subprocess import Popen
from time import sleep
from seisflows.tools import unix
from seisflows.tools.tools import call, findpath, nproc, saveobj
from seisflows.config import ParameterError, custom_import
PAR = sys.modules['seis... | 29.38843 | 88 | 0.579021 |
import os
import sys
import numpy as np
from os.path import abspath, basename, join
from subprocess import Popen
from time import sleep
from seisflows.tools import unix
from seisflows.tools.tools import call, findpath, nproc, saveobj
from seisflows.config import ParameterError, custom_import
PAR = sys.modules['seis... | true | true |
f76190baecd2a04aa26d4f3a6818515e4d8558b5 | 1,309 | py | Python | modules/tools/mapshow/roadshow.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 27 | 2019-04-06T02:27:14.000Z | 2021-11-27T13:47:06.000Z | modules/tools/mapshow/roadshow.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 7 | 2021-03-10T18:14:25.000Z | 2022-02-27T04:46:46.000Z | modules/tools/mapshow/roadshow.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 38 | 2019-04-15T10:58:37.000Z | 2022-01-27T08:52:39.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | 32.725 | 79 | 0.621849 |
import argparse
import matplotlib.pyplot as plt
from libs.map import Map
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Raodshow is a tool to display road info on a map.",
prog="roadshow.py")
parser.add_argument(
"-m", "--map", action="store", type=str, req... | true | true |
f76190d4a6afc3cb8a3ac84ada87c09c5a709eb1 | 7,191 | py | Python | chas/server/chaslib/misctools.py | Owen-Cochell/chas | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | null | null | null | chas/server/chaslib/misctools.py | Owen-Cochell/chas | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | 1 | 2018-08-09T18:51:43.000Z | 2020-08-31T20:54:00.000Z | chas/server/chaslib/misctools.py | Owen-Cochell/C.H.A.S | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | null | null | null | #!/bin/python
# ENTech SS
# This file contains misc. data for main script.
# This file dose not contain code for Home Config or the chatbot
import logging
from concurrent.futures import ThreadPoolExecutor
CHAS = None # CHAS Masterclass
def get_chas():
"""
Returns the CHAS masterclass for usage.
Great... | 24.293919 | 114 | 0.616465 |
import logging
from concurrent.futures import ThreadPoolExecutor
CHAS = None
def get_chas():
return CHAS
def set_chas(chas):
global CHAS
CHAS = chas
def get_logger(name):
log = logging.getLogger(name)
log.setLevel(logging.DEBUG)
file_hand = logging.FileHandler(g... | true | true |
f76192e206322e902146e241830201f040a73d84 | 4,478 | py | Python | build/toolchain/wrapper_utils.py | Flameeyes/nojs | b386fe707f651ffb2000d52560bc60bc3c0b2f1b | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | build/toolchain/wrapper_utils.py | Flameeyes/nojs | b386fe707f651ffb2000d52560bc60bc3c0b2f1b | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | build/toolchain/wrapper_utils.py | Flameeyes/nojs | b386fe707f651ffb2000d52560bc60bc3c0b2f1b | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright (c) 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper functions for gcc_toolchain.gni wrappers."""
import gzip
import os
import re
import subprocess
import shlex
import shutil
import sys
import th... | 29.655629 | 80 | 0.716391 |
import gzip
import os
import re
import subprocess
import shlex
import shutil
import sys
import threading
_BAT_PREFIX = 'cmd /c call '
_WHITELIST_RE = re.compile('whitelisted_resource_(?P<resource_id>[0-9]+)')
def _GzipThenDelete(src_path, dest_path):
with open(src_path, 'rb') as f_in, gzip.GzipFile(d... | true | true |
f761936ed0f2531712d8404c77ba2da177dd528d | 1,435 | py | Python | Python/Uri 1179 - Preenchimento de Vetor IV.py | Gui25Reis/URI | 3df11b4eb27513b336bdff1e56b7707568b249e3 | [
"MIT"
] | null | null | null | Python/Uri 1179 - Preenchimento de Vetor IV.py | Gui25Reis/URI | 3df11b4eb27513b336bdff1e56b7707568b249e3 | [
"MIT"
] | null | null | null | Python/Uri 1179 - Preenchimento de Vetor IV.py | Gui25Reis/URI | 3df11b4eb27513b336bdff1e56b7707568b249e3 | [
"MIT"
] | null | null | null | par_impar = [[],[]] # Cria duas listas dentro de uma (matriz)
cont_P_I = [0,0] # Variaveis q contam quantos elementos tem em cada vetor
def veri (valor_, ind_, txt_): # Função: adiciona no vetor certo e verifica se está cheio
par_impar[ind_].append(valor_) #... | 65.227273 | 135 | 0.455749 | par_impar = [[],[]] cont_P_I = [0,0]
def veri (valor_, ind_, txt_): par_impar[ind_].append(valor_) cont_P_I[ind_] += 1
if cont_P_I[ind_] == 5: [print('{}[{}] = {}' .... | true | true |
f761945ff3776162f37518a04c38da7c683d2f42 | 102 | py | Python | genFile.py | Joshua-amare/Word-Analyzer | 8985c846d858412ef96d052f99434e891aa22e1c | [
"MIT"
] | null | null | null | genFile.py | Joshua-amare/Word-Analyzer | 8985c846d858412ef96d052f99434e891aa22e1c | [
"MIT"
] | null | null | null | genFile.py | Joshua-amare/Word-Analyzer | 8985c846d858412ef96d052f99434e891aa22e1c | [
"MIT"
] | null | null | null | def genFile(name):
return open(name, "w+")
def writeFile(f , content):
f.write(content)
| 17 | 28 | 0.607843 | def genFile(name):
return open(name, "w+")
def writeFile(f , content):
f.write(content)
| true | true |
f76195fff461a1f42ed73af102b39c66106bc444 | 2,898 | py | Python | Products/LDAPUserFolder/tests/base/testcase.py | eaudeweb/Products.LDAPUserFolder | 3da7155973ac329ffd76f05b060980a29a04a55c | [
"ZPL-2.1"
] | null | null | null | Products/LDAPUserFolder/tests/base/testcase.py | eaudeweb/Products.LDAPUserFolder | 3da7155973ac329ffd76f05b060980a29a04a55c | [
"ZPL-2.1"
] | 1 | 2018-10-08T12:49:27.000Z | 2018-10-08T12:49:27.000Z | Products/LDAPUserFolder/tests/base/testcase.py | eaudeweb/Products.LDAPUserFolder | 3da7155973ac329ffd76f05b060980a29a04a55c | [
"ZPL-2.1"
] | 1 | 2020-02-12T17:33:25.000Z | 2020-02-12T17:33:25.000Z | ##############################################################################
#
# Copyright (c) 2000-2009 Jens Vagelpohl and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS S... | 35.777778 | 79 | 0.594548 |
import unittest, sys
from OFS.Folder import Folder
from Testing import ZopeTestCase
import transaction
from dataflake.fakeldap import FakeLDAPConnection
from Products.LDAPUserFolder import LDAPDelegate
LDAPDelegate.c_factory = FakeLDAPConnection
from Products.LDAPUserFolder import manage_addLDAPUserFolder
from Pro... | true | true |
f76198297709394f967b27b11e60d6906ab81cf5 | 345 | py | Python | tests/common/test_shapes.py | hadivafaii/vedo | 15f9adbd36d25c0212cbd4eb0c15af54c19f3819 | [
"CC0-1.0"
] | 836 | 2020-06-14T02:38:12.000Z | 2022-03-31T15:39:50.000Z | tests/common/test_shapes.py | hadivafaii/vedo | 15f9adbd36d25c0212cbd4eb0c15af54c19f3819 | [
"CC0-1.0"
] | 418 | 2020-06-14T10:51:32.000Z | 2022-03-31T23:23:14.000Z | tests/common/test_shapes.py | hadivafaii/vedo | 15f9adbd36d25c0212cbd4eb0c15af54c19f3819 | [
"CC0-1.0"
] | 136 | 2020-06-14T02:26:41.000Z | 2022-03-31T12:47:18.000Z |
from vedo import Arc
import numpy as np
import vtk
print('---------------------------------')
print('vtkVersion', vtk.vtkVersion().GetVTKVersion())
print('---------------------------------')
#####################################
arc = Arc(center=None, point1=(1, 1, 1), point2=None, normal=(0, 0, 1), angle=np.pi)
ass... | 26.538462 | 84 | 0.484058 |
from vedo import Arc
import numpy as np
import vtk
print('---------------------------------')
print('vtkVersion', vtk.vtkVersion().GetVTKVersion())
print('---------------------------------')
arc = Arc(center=None, point1=(1, 1, 1), point2=None, normal=(0, 0, 1), angle=np.pi)
assert isinstance(arc, Arc)
| true | true |
f761982c63ba577a8aedebb377dd8c7a12644bb5 | 820 | py | Python | env/Lib/site-packages/anyio/_core/_signals.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 749 | 2018-10-08T13:12:22.000Z | 2022-03-28T17:43:16.000Z | env/Lib/site-packages/anyio/_core/_signals.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 357 | 2018-10-07T18:12:40.000Z | 2022-03-30T20:38:29.000Z | env/Lib/site-packages/anyio/_core/_signals.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 66 | 2018-10-09T05:18:54.000Z | 2022-03-21T08:37:14.000Z | from typing import AsyncIterator
from ._compat import DeprecatedAsyncContextManager
from ._eventloop import get_asynclib
def open_signal_receiver(*signals: int) -> DeprecatedAsyncContextManager[AsyncIterator[int]]:
"""
Start receiving operating system signals.
:param signals: signals to receive (e.g. ``... | 35.652174 | 97 | 0.747561 | from typing import AsyncIterator
from ._compat import DeprecatedAsyncContextManager
from ._eventloop import get_asynclib
def open_signal_receiver(*signals: int) -> DeprecatedAsyncContextManager[AsyncIterator[int]]:
return get_asynclib().open_signal_receiver(*signals)
| true | true |
f761990ee95656ea4e1d6ccda0f1043c2ee5e246 | 1,258 | py | Python | nadypy/api/profile/delete_profile_profile.py | Nadybot/nadypy | ae6cbb886d233fde491aee501cb72bf993f3a02f | [
"MIT"
] | null | null | null | nadypy/api/profile/delete_profile_profile.py | Nadybot/nadypy | ae6cbb886d233fde491aee501cb72bf993f3a02f | [
"MIT"
] | null | null | null | nadypy/api/profile/delete_profile_profile.py | Nadybot/nadypy | ae6cbb886d233fde491aee501cb72bf993f3a02f | [
"MIT"
] | null | null | null | from typing import Any, Dict
import httpx
from ...client import AuthenticatedClient
from ...types import Response
def _get_kwargs(
profile: str,
*,
client: AuthenticatedClient,
) -> Dict[str, Any]:
url = "{}/profile/{profile}".format(client.base_url, profile=profile)
headers: Dict[str, Any] = c... | 19.65625 | 73 | 0.636725 | from typing import Any, Dict
import httpx
from ...client import AuthenticatedClient
from ...types import Response
def _get_kwargs(
profile: str,
*,
client: AuthenticatedClient,
) -> Dict[str, Any]:
url = "{}/profile/{profile}".format(client.base_url, profile=profile)
headers: Dict[str, Any] = c... | true | true |
f76199a798cd7a8b23c1ce57c7db2d3a9c800e48 | 2,083 | py | Python | Mobile_robot/scripts/twist_to_motor.py | JeelChatrola/OCMR | 5ea7a89b8d903405efdd2464bc95d5c7f73ac0f0 | [
"MIT"
] | null | null | null | Mobile_robot/scripts/twist_to_motor.py | JeelChatrola/OCMR | 5ea7a89b8d903405efdd2464bc95d5c7f73ac0f0 | [
"MIT"
] | null | null | null | Mobile_robot/scripts/twist_to_motor.py | JeelChatrola/OCMR | 5ea7a89b8d903405efdd2464bc95d5c7f73ac0f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Float32
from geometry_msgs.msg import Twist
class TwistToMotors():
def __init__(self):
rospy.init_node("twist_to_motors")
nodename = rospy.get_name()
rospy.loginfo("%s started" % nodename)
self.w = rospy... | 26.705128 | 91 | 0.548248 | import rospy
from std_msgs.msg import Float32
from geometry_msgs.msg import Twist
class TwistToMotors():
def __init__(self):
rospy.init_node("twist_to_motors")
nodename = rospy.get_name()
rospy.loginfo("%s started" % nodename)
self.w = rospy.get_param("~base_widt... | true | true |
f7619a044eada4b828958841a7dd8a1f897b8f00 | 1,357 | py | Python | test/completion/inheritance.py | mrclary/jedi | 803c3cb271ead297c4fe3ca916b54ed05a623459 | [
"MIT"
] | 4,213 | 2015-01-02T15:43:22.000Z | 2022-03-31T16:15:01.000Z | test/completion/inheritance.py | mrclary/jedi | 803c3cb271ead297c4fe3ca916b54ed05a623459 | [
"MIT"
] | 1,392 | 2015-01-02T18:43:39.000Z | 2022-03-27T18:43:59.000Z | test/completion/inheritance.py | PeterJCLaw/jedi | 070f191f550990c23220d7f209df076178307cf6 | [
"MIT"
] | 525 | 2015-01-02T19:07:31.000Z | 2022-03-13T02:03:20.000Z |
class Super(object):
attribute = 3
def func(self):
return 1
class Inner():
pass
class Sub(Super):
#? 13 Sub.attribute
def attribute(self):
pass
#! 8 ['attribute = 3']
def attribute(self):
pass
#! 4 ['def func']
func = 3
#! 12 ['def func']
... | 17.623377 | 55 | 0.476787 |
class Super(object):
attribute = 3
def func(self):
return 1
class Inner():
pass
class Sub(Super):
def attribute(self):
pass
def attribute(self):
pass
func = 3
class func(): pass
def Inner(self): pass
class Test1:
class Tes... | true | true |
f7619af6c2c684198d905c5fc94a9a6076be4644 | 1,863 | py | Python | examples/dothat/advanced/demo.py | dglaude/displayotron | 4a321328c294325f0965e673c5e420296aba7fa6 | [
"MIT"
] | null | null | null | examples/dothat/advanced/demo.py | dglaude/displayotron | 4a321328c294325f0965e673c5e420296aba7fa6 | [
"MIT"
] | null | null | null | examples/dothat/advanced/demo.py | dglaude/displayotron | 4a321328c294325f0965e673c5e420296aba7fa6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import math
import time
import dothat.backlight as backlight
import dothat.lcd as lcd
print("""
This example gives a basic demo of Display-o-Tron HAT's features.
It will sweep the backlight, scan the bargraph and display text on screen!
Press CTRL+C to exit.
""")
pirate = [
[0x00, 0x1f, ... | 23 | 74 | 0.611916 |
import math
import time
import dothat.backlight as backlight
import dothat.lcd as lcd
print("""
This example gives a basic demo of Display-o-Tron HAT's features.
It will sweep the backlight, scan the bargraph and display text on screen!
Press CTRL+C to exit.
""")
pirate = [
[0x00, 0x1f, 0x0b, 0x03, 0x00, 0x04... | true | true |
f7619caf8cd1fbbd4ed54ba517eac2da25066ea4 | 500 | py | Python | backend/backend/api/auth/__init__.py | ajbeach2/django-vue | 96d9f4dc67005955af2d9049bb48db644c3be672 | [
"MIT"
] | null | null | null | backend/backend/api/auth/__init__.py | ajbeach2/django-vue | 96d9f4dc67005955af2d9049bb48db644c3be672 | [
"MIT"
] | 10 | 2020-02-12T00:41:58.000Z | 2022-02-10T07:32:49.000Z | backend/backend/api/auth/__init__.py | ajbeach2/django-vue | 96d9f4dc67005955af2d9049bb48db644c3be672 | [
"MIT"
] | null | null | null | from rest_framework.authentication import SessionAuthentication
class SessionAuthAll(SessionAuthentication):
def authenticate(self, request):
"""
Returns a `User` and force CSRF even if
the user is Unauthenticated
"""
# Get the session-based user from the underlying HttpR... | 26.315789 | 75 | 0.674 | from rest_framework.authentication import SessionAuthentication
class SessionAuthAll(SessionAuthentication):
def authenticate(self, request):
user = getattr(request._request, 'user', None)
self.enforce_csrf(request)
return (user, None)
| true | true |
f7619ce10981b8c45f707315ef94b1f60cad65a0 | 14,110 | py | Python | py3plex/core/HINMINE/dataStructures.py | awesome-archive/Py3plex | a099acb992441c1630208ba13694acb8e2a38895 | [
"BSD-3-Clause"
] | 1 | 2020-02-20T07:37:02.000Z | 2020-02-20T07:37:02.000Z | py3plex/core/HINMINE/dataStructures.py | awesome-archive/Py3plex | a099acb992441c1630208ba13694acb8e2a38895 | [
"BSD-3-Clause"
] | null | null | null | py3plex/core/HINMINE/dataStructures.py | awesome-archive/Py3plex | a099acb992441c1630208ba13694acb8e2a38895 | [
"BSD-3-Clause"
] | null | null | null | ## core data structures
import networkx as nx
import numpy as np
import scipy.sparse as sp
from .decomposition import get_calculation_method
class Class:
def __init__(self, lab_id, name, members):
self.name = name
self.id = lab_id
self.index = -1
self.members = members # ids of me... | 44.793651 | 135 | 0.56017 |
import networkx as nx
import numpy as np
import scipy.sparse as sp
from .decomposition import get_calculation_method
class Class:
def __init__(self, lab_id, name, members):
self.name = name
self.id = lab_id
self.index = -1
self.members = members self.member_indices = []
... | true | true |
f7619efa8f8e3e5e3067d4dc5b55c5c4ce30a647 | 116 | py | Python | test/test_for_circular_reference/ref_in_one_file.py | songofhawk/autopy | d00588e7c55e1d74cea34ee036490d66e5cf5553 | [
"MIT"
] | 1 | 2022-02-16T08:37:25.000Z | 2022-02-16T08:37:25.000Z | test/test_for_circular_reference/ref_in_one_file.py | songofhawk/simplerpa | 69491f3e9a84c106921be972242d05c5e3db5849 | [
"MIT"
] | null | null | null | test/test_for_circular_reference/ref_in_one_file.py | songofhawk/simplerpa | 69491f3e9a84c106921be972242d05c5e3db5849 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import List
class A:
x: str
y: B
class B:
w: List[A]
| 9.666667 | 34 | 0.646552 | from __future__ import annotations
from typing import List
class A:
x: str
y: B
class B:
w: List[A]
| true | true |
f7619ffa8a9c80000891fa80bcb804a558456791 | 99 | py | Python | app/routes.py | Fibration/RegisterMe- | 704892e380c6f761946e8ecc8e1d2c24d41e71ae | [
"MIT"
] | null | null | null | app/routes.py | Fibration/RegisterMe- | 704892e380c6f761946e8ecc8e1d2c24d41e71ae | [
"MIT"
] | null | null | null | app/routes.py | Fibration/RegisterMe- | 704892e380c6f761946e8ecc8e1d2c24d41e71ae | [
"MIT"
] | null | null | null |
from app import app
@app.route('/')
@app.route('/index')
def index():
return "Hello, World!"
| 12.375 | 26 | 0.616162 |
from app import app
@app.route('/')
@app.route('/index')
def index():
return "Hello, World!"
| true | true |
f761a01c1865861b1ab7daaf5b26655c47499a20 | 9,120 | py | Python | topic_modeling.py | SimoCnt/Leaders-tweets-analysis-during-Covid-19-pandemic | cab6e3d8bf80dcfc487642755fc6567fdc4e26ff | [
"MIT"
] | null | null | null | topic_modeling.py | SimoCnt/Leaders-tweets-analysis-during-Covid-19-pandemic | cab6e3d8bf80dcfc487642755fc6567fdc4e26ff | [
"MIT"
] | null | null | null | topic_modeling.py | SimoCnt/Leaders-tweets-analysis-during-Covid-19-pandemic | cab6e3d8bf80dcfc487642755fc6567fdc4e26ff | [
"MIT"
] | null | null | null | """
@author: Salvatore Calderaro
@author: Simone Contini
"""
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import GridSearchCV
from sklearn.decomposition import LatentDirichletAllocation as LDA
from textblob import TextBlob
from wordcloud import WordCloud
from deep_translator... | 31.232877 | 140 | 0.645504 |
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import GridSearchCV
from sklearn.decomposition import LatentDirichletAllocation as LDA
from textblob import TextBlob
from wordcloud import WordCloud
from deep_translator import GoogleTranslator
import os
import configobj
import nu... | true | true |
f761a0d6f86209f683fa86aaf5218350b4c05f96 | 808 | py | Python | prestodb/__init__.py | 100LL/presto-python-client | f214381a18f3b78af85145772228fa19d3d3549a | [
"Apache-2.0"
] | 1 | 2021-05-11T13:17:30.000Z | 2021-05-11T13:17:30.000Z | prestodb/__init__.py | 100LL/presto-python-client | f214381a18f3b78af85145772228fa19d3d3549a | [
"Apache-2.0"
] | null | null | null | prestodb/__init__.py | 100LL/presto-python-client | f214381a18f3b78af85145772228fa19d3d3549a | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 33.666667 | 74 | 0.777228 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import auth
from . import dbapi
from . import client
from . import constants
from . import exceptions
from . import logging
__version__ = "0.7.1"
| true | true |
f761a11e1e609f5549222fa743d8cf1966fa9ee4 | 5,152 | py | Python | iscram/domain/metrics/simulation.py | tkieras/iscram | 7d710e16db2df46e9860f02efa22ab641b8729d7 | [
"MIT"
] | null | null | null | iscram/domain/metrics/simulation.py | tkieras/iscram | 7d710e16db2df46e9860f02efa22ab641b8729d7 | [
"MIT"
] | null | null | null | iscram/domain/metrics/simulation.py | tkieras/iscram | 7d710e16db2df46e9860f02efa22ab641b8729d7 | [
"MIT"
] | null | null | null | ## Placeholder code, copied from old version
# import numpy as np
# from multiprocessing import Pool
#
# def simulate(choice_problem, system_model, report, threads, trials):
# pool = Pool(threads)
#
# params = setup_simulation(choice_problem, system_model, report)
# sims = [Simulator(trials // threads, par... | 37.605839 | 128 | 0.57861 | true | true | |
f761a290ac77e9fb0cfbbf17758aca436eeb1584 | 12 | py | Python | extras/sample_site/sample_site/local_settings/nested.py | cltrudeau/django-yaset | 1b27eeb3f4bdb638609e2045b1c2902f7af96141 | [
"MIT"
] | null | null | null | extras/sample_site/sample_site/local_settings/nested.py | cltrudeau/django-yaset | 1b27eeb3f4bdb638609e2045b1c2902f7af96141 | [
"MIT"
] | 6 | 2019-12-04T23:53:29.000Z | 2021-06-10T18:31:44.000Z | extras/sample_site/sample_site/local_settings/nested.py | cltrudeau/django-yaset | 1b27eeb3f4bdb638609e2045b1c2902f7af96141 | [
"MIT"
] | null | null | null | CHAPTER = 1
| 6 | 11 | 0.666667 | CHAPTER = 1
| true | true |
f761a3162e0d8c7bf47ff29782a61904a3d736d1 | 605 | bzl | Python | source/bazel/deps/fontconfig/get.bzl | luxe/unilang | 6c8a431bf61755f4f0534c6299bd13aaeba4b69e | [
"MIT"
] | 33 | 2019-05-30T07:43:32.000Z | 2021-12-30T13:12:32.000Z | source/bazel/deps/fontconfig/get.bzl | luxe/unilang | 6c8a431bf61755f4f0534c6299bd13aaeba4b69e | [
"MIT"
] | 371 | 2019-05-16T15:23:50.000Z | 2021-09-04T15:45:27.000Z | source/bazel/deps/fontconfig/get.bzl | luxe/unilang | 6c8a431bf61755f4f0534c6299bd13aaeba4b69e | [
"MIT"
] | 6 | 2019-08-22T17:37:36.000Z | 2020-11-07T07:15:32.000Z | # Do not edit this file directly.
# It was auto-generated by: code/programs/reflexivity/reflexive_refresh
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def fontconfig():
http_archive(
name="fontconfig" ,
build_file="//bazel/deps/fontconfig:build.BUILD" ,
sha256="711... | 35.588235 | 108 | 0.719008 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def fontconfig():
http_archive(
name="fontconfig" ,
build_file="//bazel/deps/fontconfig:build.BUILD" ,
sha256="711f7fe1c4604f2d0cd8397d18ed70dede07b86a6057009b790395a8f91f558c" ,
strip_prefix="fontconfig-277eca11... | true | true |
f761a3477419c8836c06cce5f724c6670bd82fa7 | 183 | py | Python | test.py | ezequielmastrasso/cmdPyWrapper | b44cdd051748dfb13e24b4b00e1fe3ca968a708f | [
"Apache-2.0"
] | 2 | 2019-02-03T23:59:43.000Z | 2020-07-10T06:10:30.000Z | test.py | ezequielmastrasso/cmdPyWrapper | b44cdd051748dfb13e24b4b00e1fe3ca968a708f | [
"Apache-2.0"
] | null | null | null | test.py | ezequielmastrasso/cmdPyWrapper | b44cdd051748dfb13e24b4b00e1fe3ca968a708f | [
"Apache-2.0"
] | null | null | null | import os
cmd = "\"C:\\Program Files\\3Delight\\bin\\tdlmake.exe\\\" \"D:\\tmp\\shaveTest_01_fullRenderPass_1.tif\" \"D:\\tmp\\shaveTest_01_fullRenderPass_1.tdl\"
os.system( cmd )
| 30.5 | 153 | 0.699454 | import os
cmd = "\"C:\\Program Files\\3Delight\\bin\\tdlmake.exe\\\" \"D:\\tmp\\shaveTest_01_fullRenderPass_1.tif\" \"D:\\tmp\\shaveTest_01_fullRenderPass_1.tdl\"
os.system( cmd )
| false | true |
f761a3fe25edd5c5d281da66fcc6ec3d18c9f9b3 | 240 | py | Python | courses/python_scrimba/08input/index.py | CaioSilva88/100daysofcode | caeb3da047fdb648f369b59a53a511c18a95a7a3 | [
"MIT"
] | 80 | 2020-09-19T22:32:35.000Z | 2022-03-18T12:31:53.000Z | courses/python_scrimba/08input/index.py | CaioSilva88/100daysofcode | caeb3da047fdb648f369b59a53a511c18a95a7a3 | [
"MIT"
] | 2 | 2020-09-21T19:41:06.000Z | 2021-01-27T02:55:44.000Z | courses/python_scrimba/08input/index.py | CaioSilva88/100daysofcode | caeb3da047fdb648f369b59a53a511c18a95a7a3 | [
"MIT"
] | 14 | 2020-08-25T01:14:03.000Z | 2020-12-09T20:22:16.000Z | name= input('What is your name?: ')
age=input('What is your age?: ')
print('Hello '+ name + '! You are '+ age + ' years old.')
num1=input('Enter a digit: ')
num2=input('Enter a second number:')
answer=float(num1)+float(num2)
print(answer)
| 26.666667 | 57 | 0.654167 | name= input('What is your name?: ')
age=input('What is your age?: ')
print('Hello '+ name + '! You are '+ age + ' years old.')
num1=input('Enter a digit: ')
num2=input('Enter a second number:')
answer=float(num1)+float(num2)
print(answer)
| true | true |
f761a4104bfd8e74eeedd00c74368299b41b00aa | 1,373 | py | Python | rocrate/model/data_entity.py | sourav0220/ro-crate-py | e279fc7ddf188f0b22b671ab9c670f3333b477e1 | [
"Apache-2.0"
] | null | null | null | rocrate/model/data_entity.py | sourav0220/ro-crate-py | e279fc7ddf188f0b22b671ab9c670f3333b477e1 | [
"Apache-2.0"
] | null | null | null | rocrate/model/data_entity.py | sourav0220/ro-crate-py | e279fc7ddf188f0b22b671ab9c670f3333b477e1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019-2020 The University of Manchester, UK
# Copyright 2020 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
#
# Licensed under the Ap... | 39.228571 | 115 | 0.729789 |
import os
from .entity import Entity
class DataEntity(Entity):
def __init__(self, crate, identifier, properties=None):
if not identifier or str(identifier).startswith("#"):
raise ValueError("Identifier for data entity must be a relative path or absolute URI: %s" % identifier)
super(D... | true | true |
f761a567008d59cbd5dcaab5d8ec7b819cf5741d | 3,755 | py | Python | newscout_web/dashboard/views.py | rsqwerty/newscout_web | 8be095cc3e1a95d6ccf5cd8c43d3f13746b263f2 | [
"Apache-2.0"
] | null | null | null | newscout_web/dashboard/views.py | rsqwerty/newscout_web | 8be095cc3e1a95d6ccf5cd8c43d3f13746b263f2 | [
"Apache-2.0"
] | null | null | null | newscout_web/dashboard/views.py | rsqwerty/newscout_web | 8be095cc3e1a95d6ccf5cd8c43d3f13746b263f2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.views.generic import FormView
from django.http import HttpResponseRedirect
from django.contrib.auth import login, authenticate, logout
from django.views.generic.base import TemplateView, RedirectView
from braces.views import LoginRequiredMixin
from .forms import LoginForm
class E... | 28.884615 | 76 | 0.69534 |
from django.views.generic import FormView
from django.http import HttpResponseRedirect
from django.contrib.auth import login, authenticate, logout
from django.views.generic.base import TemplateView, RedirectView
from braces.views import LoginRequiredMixin
from .forms import LoginForm
class EditorTemplateView(Templa... | true | true |
f761a589da172af751dfd04f32f9e039c4cd9bec | 1,150 | py | Python | magical/service/migrations/0001_initial.py | Vicarium/magicalsmilesnl | 2a693db73ab6e504c0d618486df497854a0613be | [
"MIT"
] | null | null | null | magical/service/migrations/0001_initial.py | Vicarium/magicalsmilesnl | 2a693db73ab6e504c0d618486df497854a0613be | [
"MIT"
] | 11 | 2020-02-11T23:40:33.000Z | 2022-03-11T23:16:55.000Z | magical/service/migrations/0001_initial.py | Vicarium/magicalsmilesnl | 2a693db73ab6e504c0d618486df497854a0613be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-23 13:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | 34.848485 | 262 | 0.662609 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailc... | true | true |
f761a6d4a1b99a00286a1d9f2fa3fed83fd8046d | 3,272 | py | Python | mininet_topology/Topo11router&NAT/Topo11B.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | 3 | 2021-01-11T11:08:09.000Z | 2021-03-28T01:02:50.000Z | mininet_topology/Topo11router&NAT/Topo11B.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | 10 | 2020-12-25T10:30:25.000Z | 2021-05-17T13:09:32.000Z | mininet_topology/Topo11router&NAT/Topo11B.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
import re
import sys
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from minine... | 32.72 | 127 | 0.608802 |
import re
import sys
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLo... | true | true |
f761a714c8ecd984458310313a54c89eb440b141 | 8,586 | py | Python | text_extensions_for_pandas/spanner/test_join.py | kmh4321/text-extensions-for-pandas | 669e6a8930fed625822d6fcf00be7ac0ca3dd19f | [
"Apache-2.0"
] | null | null | null | text_extensions_for_pandas/spanner/test_join.py | kmh4321/text-extensions-for-pandas | 669e6a8930fed625822d6fcf00be7ac0ca3dd19f | [
"Apache-2.0"
] | null | null | null | text_extensions_for_pandas/spanner/test_join.py | kmh4321/text-extensions-for-pandas | 669e6a8930fed625822d6fcf00be7ac0ca3dd19f | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 IBM Corp.
# 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 writi... | 40.885714 | 83 | 0.486956 | import textwrap
import unittest
import pandas as pd
import regex
from spacy.lang.en import English
from text_extensions_for_pandas.spanner.extract import extract_regex_tok
from text_extensions_for_pandas.io.spacy import make_tokens
from text_extensions_for_pandas.util import TestBase
from text_extensions_for_pandas.a... | true | true |
f761a77d0cd6b169e134fa55b118672bed56ddcb | 1,829 | py | Python | steps/make/cmake.py | flipcoder/siege-tools | df8a9fa5a4a6f2bcce4789cebe17b0c4dd3f7e60 | [
"MIT"
] | 6 | 2015-08-14T15:26:38.000Z | 2019-11-14T01:08:31.000Z | steps/make/cmake.py | flipcoder/siege-tools | df8a9fa5a4a6f2bcce4789cebe17b0c4dd3f7e60 | [
"MIT"
] | null | null | null | steps/make/cmake.py | flipcoder/siege-tools | df8a9fa5a4a6f2bcce4789cebe17b0c4dd3f7e60 | [
"MIT"
] | 1 | 2019-05-10T04:52:40.000Z | 2019-05-10T04:52:40.000Z | #!/usr/bin/env python
import os
import sgmake
from common import Status
from common import Support
from common import Settings
from common.Plugin import Plugin
import clean.clean
def make(project):
try:
project.cmakepath = ""
except:
pass
try:
os.mkdir("build")
except:
... | 27.712121 | 89 | 0.613997 | import os
import sgmake
from common import Status
from common import Support
from common import Settings
from common.Plugin import Plugin
import clean.clean
def make(project):
try:
project.cmakepath = ""
except:
pass
try:
os.mkdir("build")
except:
pass
os.chdir(... | true | true |
f761a79e831943be924aeee2067ea68de9a2065b | 4,072 | py | Python | imblearn/datasets/_imbalance.py | bganglia/imbalanced-learn | 2b86e7296bf19f6304b5c3cbfb0ee78709a68a9c | [
"MIT"
] | 2 | 2019-11-17T22:32:23.000Z | 2020-06-06T10:37:05.000Z | imblearn/datasets/_imbalance.py | bganglia/imbalanced-learn | 2b86e7296bf19f6304b5c3cbfb0ee78709a68a9c | [
"MIT"
] | null | null | null | imblearn/datasets/_imbalance.py | bganglia/imbalanced-learn | 2b86e7296bf19f6304b5c3cbfb0ee78709a68a9c | [
"MIT"
] | 2 | 2020-07-08T21:28:10.000Z | 2021-05-25T13:49:11.000Z | """Transform a dataset into an imbalanced dataset."""
# Authors: Dayvid Oliveira
# Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
from collections import Counter
from ..under_sampling import RandomUnderSampler
from ..utils import check_sampling_strategy
def make_imba... | 34.508475 | 82 | 0.658644 |
from collections import Counter
from ..under_sampling import RandomUnderSampler
from ..utils import check_sampling_strategy
def make_imbalance(
X, y, sampling_strategy=None, random_state=None, verbose=False, **kwargs
):
target_stats = Counter(y)
if isinstance(sampling_strategy, dict) or callable(sa... | true | true |
f761a8ef09695b597d5791314be6983702215eda | 1,572 | py | Python | nipype/__init__.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2019-01-25T18:20:51.000Z | 2019-07-30T20:51:51.000Z | nipype/__init__.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/__init__.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2018-01-25T19:48:17.000Z | 2019-01-25T18:20:52.000Z | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function, division, unicode_literals, absolute_import
import os
from distutils.version import LooseVersion
from .info import (LONG_DESCRIPTION as __doc... | 30.230769 | 82 | 0.650763 | from __future__ import print_function, division, unicode_literals, absolute_import
import os
from distutils.version import LooseVersion
from .info import (LONG_DESCRIPTION as __doc__,
URL as __url__,
STATUS as __status__,
__version__)
from .utils.config import ... | true | true |
f761aa21bb5f18705568d4828d1134cb5413dac6 | 3,451 | py | Python | flaskcli_pkg/templates/orm/file_storage.py | guxal/Flask-CLI | a1408e271dda51c05fe0ae02bc3e269b0ef019c3 | [
"MIT"
] | 1 | 2020-08-24T20:06:14.000Z | 2020-08-24T20:06:14.000Z | flaskcli_pkg/templates/orm/file_storage.py | guxal/Flask-CLI | a1408e271dda51c05fe0ae02bc3e269b0ef019c3 | [
"MIT"
] | 4 | 2020-03-06T19:11:53.000Z | 2020-03-28T19:22:42.000Z | flaskcli_pkg/templates/orm/file_storage.py | guxal/Flask-CLI | a1408e271dda51c05fe0ae02bc3e269b0ef019c3 | [
"MIT"
] | 2 | 2020-03-26T18:49:04.000Z | 2020-08-25T17:55:11.000Z | #!/usr/bin/python3
"""
Handles I/O, writing and reading, of JSON for storage of all class instances
"""
import json
from models import base_model
'''
import <model> dynamic
'''
from datetime import datetime
strptime = datetime.strptime
to_json = base_model.BaseModel.to_json
class FileStorage:
"""
handles... | 28.286885 | 78 | 0.546508 | import json
from models import base_model
from datetime import datetime
strptime = datetime.strptime
to_json = base_model.BaseModel.to_json
class FileStorage:
CNC = {
'BaseModel': base_model.BaseModel,
}
__file_path = './dev/file.json'
__objects = {}
def all(self, cls=None):
if c... | true | true |
f761ab4902f6fec0a4fa241723f011e6fc3ae252 | 837 | py | Python | migrations/versions/306f880b11c3_.py | eubr-bigsea/stand | f3886c89d4bf18ef2c0d3f3b66980e249c3c793f | [
"Apache-2.0"
] | 1 | 2019-07-12T15:14:26.000Z | 2019-07-12T15:14:26.000Z | migrations/versions/306f880b11c3_.py | eubr-bigsea/stand | f3886c89d4bf18ef2c0d3f3b66980e249c3c793f | [
"Apache-2.0"
] | 23 | 2017-05-15T19:40:05.000Z | 2021-08-23T14:56:01.000Z | migrations/versions/306f880b11c3_.py | eubr-bigsea/stand | f3886c89d4bf18ef2c0d3f3b66980e249c3c793f | [
"Apache-2.0"
] | 2 | 2019-11-05T13:38:18.000Z | 2020-11-13T22:02:49.000Z | """empty message
Revision ID: 306f880b11c3
Revises: 255f81eff867
Create Date: 2018-08-03 15:07:44.354557
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '306f880b11c3'
down_revision = '255f81eff867'
branch_labels = None
depends_on = None
def upgrade():
op.... | 23.914286 | 63 | 0.589008 | import sqlalchemy as sa
from alembic import op
revision = '306f880b11c3'
down_revision = '255f81eff867'
branch_labels = None
depends_on = None
def upgrade():
op.execute("UPDATE cluster \
SET description='Spark local - 1 core / 1GB RAM', \
address='local[*]', \
executor_cores=... | true | true |
f761aba5dddf0f3ac559d50bb42746ef97a67b83 | 2,007 | py | Python | homeassistant/components/tradfri/sensor.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 3 | 2021-11-05T13:24:19.000Z | 2022-01-08T12:17:09.000Z | homeassistant/components/tradfri/sensor.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/tradfri/sensor.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 3 | 2021-05-31T15:32:08.000Z | 2021-08-10T22:08:42.000Z | """Support for IKEA Tradfri sensors."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const imp... | 31.359375 | 88 | 0.721475 | from __future__ import annotations
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
fro... | true | true |
f761acc274078e4a8c2384e776c30ce59035f585 | 828 | py | Python | synaptor/io/backends/utils.py | ZettaAI/Synaptor | e425b4c744fca093ee5c63f41b82b3cae7898af4 | [
"MIT"
] | 7 | 2018-04-01T18:18:23.000Z | 2021-09-13T07:02:16.000Z | synaptor/io/backends/utils.py | nkemnitz/Synaptor | 40618786d5b762eb3877ecac49ff310f3e6f892d | [
"MIT"
] | 5 | 2018-10-24T19:36:03.000Z | 2020-10-30T02:13:38.000Z | synaptor/io/backends/utils.py | nkemnitz/Synaptor | 40618786d5b762eb3877ecac49ff310f3e6f892d | [
"MIT"
] | 6 | 2018-07-12T17:59:54.000Z | 2020-10-30T02:29:50.000Z | """ Utilities for Cloud Backends """
def parse_remote_path(remote_path):
"""
Parses a remote pathname into its protocol, bucket, and key. These
are fields required by the current cloud backends
"""
# Simple, but should work
fields = remote_path.split("/")
assert len(fields) > 3, "Improper... | 23 | 70 | 0.603865 |
def parse_remote_path(remote_path):
fields = remote_path.split("/")
assert len(fields) > 3, "Improper remote path (needs more fields)"
protocol = fields[0]
assert fields[1] == ""
bucket = fields[2]
key = "/".join(fields[3:])
return protocol, bucket, key
def check_slash(path):
... | true | true |
f761ad3f086fabc6aeedb3ba5d69bdeea5cf6566 | 181 | py | Python | Python/PythonAulas/aula22/modulos/numeros.py | felizardo27/Python | 965d56f4956eb7b6a68c0b1cbd74d363dd2a223c | [
"MIT"
] | null | null | null | Python/PythonAulas/aula22/modulos/numeros.py | felizardo27/Python | 965d56f4956eb7b6a68c0b1cbd74d363dd2a223c | [
"MIT"
] | null | null | null | Python/PythonAulas/aula22/modulos/numeros.py | felizardo27/Python | 965d56f4956eb7b6a68c0b1cbd74d363dd2a223c | [
"MIT"
] | null | null | null | from uteis import numeros
num = int(input("Digite um valor: "))
fat = numeros.fatorial(num)
print(f"O fatorial de {num} é {fat}")
print(f'O dobro de {num} é {numeros.dobro(num)}')
| 25.857143 | 49 | 0.685083 | from uteis import numeros
num = int(input("Digite um valor: "))
fat = numeros.fatorial(num)
print(f"O fatorial de {num} é {fat}")
print(f'O dobro de {num} é {numeros.dobro(num)}')
| true | true |
f761ae72611567c40c586064c1394a4fdcdfb302 | 8,016 | py | Python | tensorflow/python/keras/optimizer_v2/adadelta_test.py | carchrae/tensorflow | 6a69a6b2e286b14ac9ae813998bb0d78b6fee440 | [
"Apache-2.0"
] | 1 | 2020-03-02T20:45:18.000Z | 2020-03-02T20:45:18.000Z | tensorflow/python/keras/optimizer_v2/adadelta_test.py | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:58:27.000Z | 2022-02-10T02:04:40.000Z | tensorflow/python/keras/optimizer_v2/adadelta_test.py | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 2 | 2021-04-28T20:57:17.000Z | 2022-01-11T13:05:41.000Z | # 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... | 40.690355 | 116 | 0.634606 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_u... | true | true |
f761aee7e347c5d2d7857e14cc55c8265818a64a | 4,772 | py | Python | docs/http_snippets/update_snippets_with_responses.py | igieon/flask-combo-jsonapi | 1ca12a62869936b807a54651d056a2ab3968b220 | [
"MIT"
] | 15 | 2020-05-02T05:05:03.000Z | 2022-01-10T18:32:23.000Z | docs/http_snippets/update_snippets_with_responses.py | igieon/flask-combo-jsonapi | 1ca12a62869936b807a54651d056a2ab3968b220 | [
"MIT"
] | 48 | 2020-04-21T17:32:58.000Z | 2022-03-02T20:55:19.000Z | docs/http_snippets/update_snippets_with_responses.py | igieon/flask-combo-jsonapi | 1ca12a62869936b807a54651d056a2ab3968b220 | [
"MIT"
] | 14 | 2020-05-17T11:08:14.000Z | 2021-12-16T09:28:32.000Z | import os
import importlib
import logging
from http import HTTPStatus
import requests
import simplejson
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("prefix", help="Snippets prefix to process. Like 'minimal_api', 'relationship_', etc")
parser.add_argument("-v", "--verbose", help="set logging... | 25.655914 | 106 | 0.637259 | import os
import importlib
import logging
from http import HTTPStatus
import requests
import simplejson
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("prefix", help="Snippets prefix to process. Like 'minimal_api', 'relationship_', etc")
parser.add_argument("-v", "--verbose", help="set logging... | true | true |
f761af15c59f628c0cf42c3098cf595ba1ae3ad2 | 79,987 | py | Python | ansible/roles/test/files/ptftests/advanced-reboot.py | emilmih/sonic-mgmt | e4e42ec8028bf51b39587e2b53e526d505fe7938 | [
"Apache-2.0"
] | null | null | null | ansible/roles/test/files/ptftests/advanced-reboot.py | emilmih/sonic-mgmt | e4e42ec8028bf51b39587e2b53e526d505fe7938 | [
"Apache-2.0"
] | 3 | 2020-11-24T16:04:56.000Z | 2021-06-15T06:44:10.000Z | ansible/roles/test/files/ptftests/advanced-reboot.py | emilmih/sonic-mgmt | e4e42ec8028bf51b39587e2b53e526d505fe7938 | [
"Apache-2.0"
] | null | null | null | #
# ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";... | 45.215941 | 580 | 0.620126 | # 8. When test start reboot procedure it connects to all VM (which emulates T1) and starts fetching status of BGP and LACP
# LACP is supposed to be down for one time only, if not - the test fails
# if default value of BGP graceful restart timeout is less than 120 seconds the test fails
# if BGP graceful restar... | false | true |
f761aff8623b11f3bd0d5b3637d0eb089088eb54 | 9,268 | py | Python | efficientdet/keras/anchors.py | abhishekvermasg/automl | 66b4828c4e1b8f542f76f91ff552db079f4bb8c3 | [
"Apache-2.0"
] | 1 | 2021-02-01T22:12:46.000Z | 2021-02-01T22:12:46.000Z | efficientdet/keras/anchors.py | saeedda/efficientdet-lab | b4cd80b396836aada750aef47c2287bfe1ac4105 | [
"Apache-2.0"
] | 2 | 2021-01-28T15:58:30.000Z | 2021-01-28T16:00:05.000Z | efficientdet/keras/anchors.py | saeedda/efficientdet-lab | b4cd80b396836aada750aef47c2287bfe1ac4105 | [
"Apache-2.0"
] | 1 | 2021-07-31T14:19:49.000Z | 2021-07-31T14:19:49.000Z | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 40.471616 | 80 | 0.689145 | import collections
import numpy as np
import tensorflow as tf
import utils
from object_detection import argmax_matcher
from object_detection import box_list
from object_detection import faster_rcnn_box_coder
from object_detection import region_similarity_calculator
from object_detection import target_assigner
MAX_DET... | true | true |
f761b0280953de231ea11c871e99b60f6045e94d | 2,868 | py | Python | tests/models/mpnet/test_tokenization_mpnet.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 8,028 | 2018-11-05T15:19:44.000Z | 2019-07-16T09:14:59.000Z | tests/models/mpnet/test_tokenization_mpnet.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 731 | 2018-11-05T21:35:52.000Z | 2019-07-16T09:51:26.000Z | tests/models/mpnet/test_tokenization_mpnet.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 2,106 | 2018-11-05T15:29:15.000Z | 2019-07-16T08:51:57.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team, Microsoft 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... | 34.554217 | 92 | 0.662831 |
import os
import unittest
from transformers import MPNetTokenizerFast
from transformers.models.mpnet.tokenization_mpnet import VOCAB_FILES_NAMES, MPNetTokenizer
from transformers.testing_utils import require_tokenizers, slow
from ...test_tokenization_common import TokenizerTesterMixin
@require_tokenizers
class MP... | true | true |
f761b0f27ab8e8e2707f4f8683f896a94544cf5a | 1,093 | py | Python | exercises/full-poc5/h2-srv.py | izzyalonso/p4-poc | ab15cd3b066253d109c2a3231e6acc62dffb127a | [
"Apache-2.0"
] | null | null | null | exercises/full-poc5/h2-srv.py | izzyalonso/p4-poc | ab15cd3b066253d109c2a3231e6acc62dffb127a | [
"Apache-2.0"
] | null | null | null | exercises/full-poc5/h2-srv.py | izzyalonso/p4-poc | ab15cd3b066253d109c2a3231e6acc62dffb127a | [
"Apache-2.0"
] | null | null | null | import socket
import sys
import struct
def deal_with_connection(connection):
data = bytearray()
while True:
buf = connection.recv(4096)
data.extend(buf)
if len(buf) < 4096:
break
address = "%d.%d.%d.%d" % (data[0], data[1], data[2], data[3])
origi... | 20.622642 | 96 | 0.580055 | import socket
import sys
import struct
def deal_with_connection(connection):
data = bytearray()
while True:
buf = connection.recv(4096)
data.extend(buf)
if len(buf) < 4096:
break
address = "%d.%d.%d.%d" % (data[0], data[1], data[2], data[3])
origi... | true | true |
f761b1d6a3f32ffec3ac1ee3c9e6ccf4d2b2dca9 | 4,584 | py | Python | train.py | rahul-jha98/sphereface_pytorch | bcacf44722fe53e2c30faca725933bf695b45620 | [
"MIT"
] | null | null | null | train.py | rahul-jha98/sphereface_pytorch | bcacf44722fe53e2c30faca725933bf695b45620 | [
"MIT"
] | null | null | null | train.py | rahul-jha98/sphereface_pytorch | bcacf44722fe53e2c30faca725933bf695b45620 | [
"MIT"
] | null | null | null | from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys,cv2,random,datetime
import argparse
import numpy as np
from dataset import ImageDataset
from matl... | 29.960784 | 125 | 0.639398 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys,cv2,random,datetime
import argparse
import numpy as np
from dataset import ImageDataset
from matl... | true | true |
f761b2d10e261408cb0c784c37b9b2a880b37b68 | 4,329 | py | Python | google/ads/google_ads/v3/proto/enums/promotion_extension_discount_modifier_pb2.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v3/proto/enums/promotion_extension_discount_modifier_pb2.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/proto/enums/promotion_extension_discount_modifier_pb2.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v3/proto/enums/promotion_extension_discount_modifier.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 g... | 43.727273 | 666 | 0.815431 |
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 = _s... | true | true |
f761b304568aa0790573fd4b8b0f19c5a8ed58f9 | 51,523 | py | Python | capsul/pipeline/pipeline_tools.py | servoz/capsul | 2d72228c096f1c43ecfca7f3651b353dc35e209e | [
"CECILL-B"
] | 5 | 2018-10-31T10:16:53.000Z | 2022-03-11T08:11:32.000Z | capsul/pipeline/pipeline_tools.py | servoz/capsul | 2d72228c096f1c43ecfca7f3651b353dc35e209e | [
"CECILL-B"
] | 78 | 2018-10-30T17:04:38.000Z | 2022-03-17T17:39:41.000Z | capsul/pipeline/pipeline_tools.py | servoz/capsul | 2d72228c096f1c43ecfca7f3651b353dc35e209e | [
"CECILL-B"
] | 11 | 2019-01-21T10:05:08.000Z | 2022-02-22T17:02:22.000Z | # -*- coding: utf-8 -*-
'''
Miscellaneous pipeline handling utility functions
Functions
=========
:func:`pipeline_node_colors`
----------------------------
:func:`pipeline_link_color`
---------------------------
:func:`dot_graph_from_pipeline`
-------------------------------
:func:`dot_graph_from_workflow`
-----------... | 38.052437 | 127 | 0.56961 |
from __future__ import print_function
from __future__ import absolute_import
import os
import logging
import tempfile
import soma.subprocess
import six
import sys
import json
from datetime import date, time, datetime
import io
logger = logging.getLogger(__name__)
try:
from traits import api as traits
except Imp... | true | true |
f761b3307342654cf94c41b70f280775e0c0de25 | 1,889 | py | Python | simulador.py | SupernovaRocketry/simuladorSSR | 0a02db42a9280055aeeb02f255196c6b0899f457 | [
"MIT"
] | null | null | null | simulador.py | SupernovaRocketry/simuladorSSR | 0a02db42a9280055aeeb02f255196c6b0899f457 | [
"MIT"
] | null | null | null | simulador.py | SupernovaRocketry/simuladorSSR | 0a02db42a9280055aeeb02f255196c6b0899f457 | [
"MIT"
] | null | null | null | import random
class Simulador():
"""
Classe destinada a simulação de dados de voo
"""
def __init__(self):
"""
Construtor da classe Simulador
"""
# Gerando lista de dados
self._altitude = [x for x in range(3000)] + [3000-x for x in range(3000)] # Simulando dados d... | 75.56 | 161 | 0.603494 | import random
class Simulador():
def __init__(self):
self._altitude = [x for x in range(3000)] + [3000-x for x in range(3000)] self._latitude = [10+random.randrange(-2,2) for x in range(6000)] self._longitude = [20+random.randrange(-4,4) for x in range(6000)] ... | true | true |
f761b36b142b4876eb5a8239d4d8842cdcd754b0 | 783 | py | Python | qsdsan/equipments/__init__.py | QSD-Group/QSDsan | 493e14e1ca4f09cbc34de8d23c2cd634e0c87543 | [
"Unlicense"
] | 23 | 2021-01-23T16:45:07.000Z | 2022-01-30T18:14:32.000Z | qsdsan/equipments/__init__.py | QSD-Group/QSDsan | 493e14e1ca4f09cbc34de8d23c2cd634e0c87543 | [
"Unlicense"
] | 39 | 2021-01-07T05:57:06.000Z | 2022-03-21T20:44:11.000Z | qsdsan/equipments/__init__.py | QSD-Group/QSDsan | 493e14e1ca4f09cbc34de8d23c2cd634e0c87543 | [
"Unlicense"
] | 12 | 2021-03-09T09:06:15.000Z | 2022-03-12T15:10:13.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
Smiti Mittal <smitimittal@gmail.com>
Yalin Li <zoe.yalin.li@gmail.com>
This module is under the University of Illinois/NCSA Open Source License.... | 21.162162 | 84 | 0.697318 |
from ._aeration import *
from ._column import *
from ._electrode import *
from ._machine import*
from ._membrane import *
from . import (
_aeration,
_column,
_electrode,
_machine,
_membrane,
)
__all__ = (
*_aeration.__all__,
*_column.__all__,
*_electrode.__all__,
*_machine._... | true | true |
f761b3a8b89d1160652e80d381a79bfac007cf06 | 160 | py | Python | bw2temporalis/tests/__init__.py | brightway-lca/temporalis | 00a49931b6f93f11d1889b5e09c4a0820079114d | [
"BSD-3-Clause"
] | null | null | null | bw2temporalis/tests/__init__.py | brightway-lca/temporalis | 00a49931b6f93f11d1889b5e09c4a0820079114d | [
"BSD-3-Clause"
] | 1 | 2020-10-08T18:27:29.000Z | 2020-10-08T18:27:29.000Z | bw2temporalis/tests/__init__.py | brightway-lca/temporalis | 00a49931b6f93f11d1889b5e09c4a0820079114d | [
"BSD-3-Clause"
] | null | null | null | from .dlca import DynamicLCATestCase
from .ia import DynamicIATestCase
from .td import TemporalDistributionTestCase
from .climate import ClimateMetricsTestCase
| 32 | 44 | 0.875 | from .dlca import DynamicLCATestCase
from .ia import DynamicIATestCase
from .td import TemporalDistributionTestCase
from .climate import ClimateMetricsTestCase
| true | true |
f761b3c67c24fd328e99d2ce7fa9b9e7c4548a5b | 325 | py | Python | lldb/test/API/lang/swift/foundation_value_types/decimal/TestSwiftFoundationTypeDecimal.py | RLovelett/llvm-project | 7137df554b840467d2509337813801b51a645579 | [
"Apache-2.0"
] | 3 | 2021-06-11T17:30:05.000Z | 2022-01-29T13:46:47.000Z | lldb/test/API/lang/swift/foundation_value_types/decimal/TestSwiftFoundationTypeDecimal.py | WYK15/swift-Ollvm10 | ea68224ab23470963b68dfcc28b5ac769a070ea3 | [
"Apache-2.0"
] | null | null | null | lldb/test/API/lang/swift/foundation_value_types/decimal/TestSwiftFoundationTypeDecimal.py | WYK15/swift-Ollvm10 | ea68224ab23470963b68dfcc28b5ac769a070ea3 | [
"Apache-2.0"
] | null | null | null | import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *
lldbinline.MakeInlineTest(__file__, globals(),
decorators=[swiftTest,skipUnlessDarwin,
expectedFailureAll(bugnumber="rdar://60396797",
setting=('symbols.use-swift-clangimporter', 'false')... | 36.111111 | 72 | 0.698462 | import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *
lldbinline.MakeInlineTest(__file__, globals(),
decorators=[swiftTest,skipUnlessDarwin,
expectedFailureAll(bugnumber="rdar://60396797",
setting=('symbols.use-swift-clangimporter', 'false')... | true | true |
f761b4e22da126fde18b7761bea998306c1b91d4 | 645 | py | Python | kano_blog/create_db.py | healeycodes/full-stack-test-for-kano | ab644569b57694d65059cd76fedbfa467d79dee5 | [
"MIT"
] | 2 | 2019-05-21T00:17:00.000Z | 2019-05-21T01:01:13.000Z | kano_blog/create_db.py | healeycodes/full-stack-test-for-kano | ab644569b57694d65059cd76fedbfa467d79dee5 | [
"MIT"
] | null | null | null | kano_blog/create_db.py | healeycodes/full-stack-test-for-kano | ab644569b57694d65059cd76fedbfa467d79dee5 | [
"MIT"
] | null | null | null | import os.path
import sys
import sqlite3
from pathlib import Path
DATABASE = 'db.sqlite'
SCHEMA = 'schema.sql'
db_path = str(Path(sys.path[0]) / DATABASE)
schema_path = str(Path(sys.path[0]) / SCHEMA)
def create_db():
# test if schema exists
if os.path.isfile(schema_path):
# connect to, or create da... | 21.5 | 51 | 0.637209 | import os.path
import sys
import sqlite3
from pathlib import Path
DATABASE = 'db.sqlite'
SCHEMA = 'schema.sql'
db_path = str(Path(sys.path[0]) / DATABASE)
schema_path = str(Path(sys.path[0]) / SCHEMA)
def create_db():
if os.path.isfile(schema_path):
db = sqlite3.connect(db_path)
with... | true | true |
f761b4e85f8841d537c6c8a08d875434c93fb3a5 | 1,691 | py | Python | utils/functions.py | doslindos/ml_crapwrap | f9daa2904234492921c6c344bfcd24992e2ff421 | [
"MIT"
] | null | null | null | utils/functions.py | doslindos/ml_crapwrap | f9daa2904234492921c6c344bfcd24992e2ff421 | [
"MIT"
] | null | null | null | utils/functions.py | doslindos/ml_crapwrap | f9daa2904234492921c6c344bfcd24992e2ff421 | [
"MIT"
] | null | null | null | from inspect import signature
def get_function_attr_values(function, attrs=None):
# Fetch default values from function attributes
# In:
# function: function module, function where values are fetched
# attrs: None returns all, str returns only the one specified... | 37.577778 | 132 | 0.594323 | from inspect import signature
def get_function_attr_values(function, attrs=None):
def check_attr(attr):
if attr in list(func_attrs.parameters.keys()):
return func_attrs.parameters[attr].default
else:
print("Attr ", attr, " not found...")
fun... | true | true |
f761b4f7ec71b553aaec1dd2a2e7bb889d5a957e | 21,115 | py | Python | test/test_runhistory/test_runhistory2epm.py | dengdifan/SMAC3 | 4739741fe9f6b0b92d419bac8f0a6252858a55dc | [
"BSD-3-Clause"
] | 1 | 2021-05-12T10:11:59.000Z | 2021-05-12T10:11:59.000Z | test/test_runhistory/test_runhistory2epm.py | dengdifan/SMAC3 | 4739741fe9f6b0b92d419bac8f0a6252858a55dc | [
"BSD-3-Clause"
] | 1 | 2021-06-17T07:57:05.000Z | 2021-06-17T07:57:05.000Z | test/test_runhistory/test_runhistory2epm.py | dengdifan/SMAC3 | 4739741fe9f6b0b92d419bac8f0a6252858a55dc | [
"BSD-3-Clause"
] | null | null | null | __author__ = "Katharina Eggensperger"
__copyright__ = "Copyright 2015, ML4AAD"
__license__ = "GPLv3"
__maintainer__ = "Katharina Eggensperger"
__email__ = "eggenspk@cs.uni-freiburg.de"
__version__ = "0.0.1"
import unittest
import numpy as np
from smac.tae import StatusType
from smac.runhistory import runhistory, run... | 45.506466 | 94 | 0.476628 | __author__ = "Katharina Eggensperger"
__copyright__ = "Copyright 2015, ML4AAD"
__license__ = "GPLv3"
__maintainer__ = "Katharina Eggensperger"
__email__ = "eggenspk@cs.uni-freiburg.de"
__version__ = "0.0.1"
import unittest
import numpy as np
from smac.tae import StatusType
from smac.runhistory import runhistory, run... | true | true |
f761b516017327ef8bb3296352cb4210bd188f3f | 7,845 | py | Python | sahara/tests/unit/plugins/spark/test_plugin.py | stackhpc/sahara | 83c7506076ee6913a381d1fda26361d9eb466e68 | [
"Apache-2.0"
] | null | null | null | sahara/tests/unit/plugins/spark/test_plugin.py | stackhpc/sahara | 83c7506076ee6913a381d1fda26361d9eb466e68 | [
"Apache-2.0"
] | 1 | 2020-10-06T07:50:12.000Z | 2020-10-06T07:50:12.000Z | sahara/tests/unit/plugins/spark/test_plugin.py | stackhpc/sahara | 83c7506076ee6913a381d1fda26361d9eb466e68 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 36.830986 | 77 | 0.633525 |
import mock
import testtools
from sahara import conductor as cond
from sahara import context
from sahara import exceptions as ex
from sahara.plugins import base as pb
from sahara.plugins import exceptions as pe
from sahara.plugins.spark import plugin as pl
from sahara.service.edp.spark import engine
from sahara.tests... | true | true |
f761b5f7347163242e21e6b63b55905e41d6f538 | 57,765 | py | Python | vnpy/app/cta_strategy/backtesting.py | ulandz/vnpy | bd6399e77364e434b89b8e866faad2556d1935aa | [
"MIT"
] | null | null | null | vnpy/app/cta_strategy/backtesting.py | ulandz/vnpy | bd6399e77364e434b89b8e866faad2556d1935aa | [
"MIT"
] | null | null | null | vnpy/app/cta_strategy/backtesting.py | ulandz/vnpy | bd6399e77364e434b89b8e866faad2556d1935aa | [
"MIT"
] | null | null | null | from collections import defaultdict
from datetime import date, datetime, timedelta
from dateutil.relativedelta import relativedelta
from typing import Callable
from itertools import product
from functools import lru_cache
from time import time
import platform
import multiprocessing
#empyrical风险指标计算模块
from empyrical imp... | 38.254967 | 240 | 0.576595 | from collections import defaultdict
from datetime import date, datetime, timedelta
from dateutil.relativedelta import relativedelta
from typing import Callable
from itertools import product
from functools import lru_cache
from time import time
import platform
import multiprocessing
from empyrical import (sortino_ratio,... | true | true |
f761b6b4ffd7aca7b04e9d565265780695dc09da | 10,848 | py | Python | pandas/tests/util/test_hashing.py | GabrielUlisses/pandas | 6430d5324ae2b602b314a7851e9c1f4c5313cceb | [
"BSD-3-Clause"
] | 1 | 2020-10-29T17:32:26.000Z | 2020-10-29T17:32:26.000Z | pandas/tests/util/test_hashing.py | GabrielUlisses/pandas | 6430d5324ae2b602b314a7851e9c1f4c5313cceb | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/util/test_hashing.py | GabrielUlisses/pandas | 6430d5324ae2b602b314a7851e9c1f4c5313cceb | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series
import pandas._testing as tm
from pandas.core.util.hashing import hash_tuples
from pandas.util import hash_array, hash_pandas_object
@pytest.fixture(
params=[
Series([1, 2, 3] * 3, dtype="int32"),... | 33.378462 | 537 | 0.679941 | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series
import pandas._testing as tm
from pandas.core.util.hashing import hash_tuples
from pandas.util import hash_array, hash_pandas_object
@pytest.fixture(
params=[
Series([1, 2, 3] * 3, dtype="int32"),... | true | true |
f761ba17d2cd1b09de168944e168fe14abecbca9 | 414 | py | Python | tests/settings.py | onufrienkovi/django-address-app | 1d8ef4674554a34df51040e4ac535e8f2269480b | [
"MIT"
] | 2 | 2021-05-26T02:33:30.000Z | 2021-06-09T01:37:57.000Z | tests/settings.py | onufrienkovi/django-address-app | 1d8ef4674554a34df51040e4ac535e8f2269480b | [
"MIT"
] | 3 | 2021-03-30T14:15:33.000Z | 2021-09-22T19:22:48.000Z | tests/settings.py | onufrienkovi/django-address-app | 1d8ef4674554a34df51040e4ac535e8f2269480b | [
"MIT"
] | null | null | null | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), "django_address"))
SECRET_KEY = "NOTREALLY"
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"),}}
INSTA... | 25.875 | 112 | 0.710145 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), "django_address"))
SECRET_KEY = "NOTREALLY"
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"),}}
INSTA... | true | true |
f761ba84f26cce41cf8ec0e06c38144a2722a553 | 12,763 | py | Python | tests/utils_tests/test_html.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | tests/utils_tests/test_html.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | tests/utils_tests/test_html.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | import os
from datetime import datetime
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.html import (
conditional_escape,
escape,
escapejs,
format_html,
html_safe,
json_script,
linebreaks,
smart_urlquote,
strip_spaces_between_tags... | 39.513932 | 100 | 0.498786 | import os
from datetime import datetime
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.html import (
conditional_escape,
escape,
escapejs,
format_html,
html_safe,
json_script,
linebreaks,
smart_urlquote,
strip_spaces_between_tags... | true | true |
f761bb0010c80d7b99f0a3abc8bb37bce799e321 | 726 | py | Python | restpython/__init__.py | HaoZ94/restpython | a8ecff65284bcdea51756fc05829c2d206f171ed | [
"MIT"
] | 5 | 2019-10-22T02:45:08.000Z | 2020-10-16T07:32:40.000Z | restpython/__init__.py | Haophdmd/restpython | a8ecff65284bcdea51756fc05829c2d206f171ed | [
"MIT"
] | 1 | 2020-04-01T13:52:10.000Z | 2020-04-01T13:52:10.000Z | restpython/__init__.py | HaoZ94/restpython | a8ecff65284bcdea51756fc05829c2d206f171ed | [
"MIT"
] | null | null | null | """REST python implementation for EEG data analysis."""
'''
For more see http://www.neuro.uestc.edu.cn/rest/
Reference: 1. Yao D (2001) A method to standardize a reference of scalp EEG recordings to a point at infinity.
Physiol Meas 22:693?11. doi: 10.1088/0967-3334/22/4/305
2. Dong L, Li F, Liu ... | 40.333333 | 157 | 0.683196 |
__author__ = "Hao Zhu"
__copyright__ = "Copyright 2019"
__date__ = '2019/05/28'
__license__ = "MIT"
__version__ = "1.1.2"
__email__ = "hz808@nyu.edu"
from .rest_ref import REST_re_reference | true | true |
f761bb9796c32f61b34357f891b1e835e7ac0516 | 2,923 | py | Python | applications/SwimmingDEMApplication/python_scripts/pre_calculated_fluid_algorithm.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 2 | 2020-04-30T19:13:08.000Z | 2021-04-14T19:40:47.000Z | applications/SwimmingDEMApplication/python_scripts/pre_calculated_fluid_algorithm.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-04-30T19:19:09.000Z | 2020-05-02T14:22:36.000Z | applications/SwimmingDEMApplication/python_scripts/pre_calculated_fluid_algorithm.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-06-12T08:51:24.000Z | 2020-06-12T08:51:24.000Z | from KratosMultiphysics import *
from KratosMultiphysics.DEMApplication import *
import swimming_DEM_algorithm
import swimming_DEM_procedures as SDP
import math
BaseAlgorithm = swimming_DEM_algorithm.Algorithm
import h5py
class Algorithm(BaseAlgorithm):
def __init__(self, varying_parameters = Parameters("{}")):
... | 42.985294 | 114 | 0.650701 | from KratosMultiphysics import *
from KratosMultiphysics.DEMApplication import *
import swimming_DEM_algorithm
import swimming_DEM_procedures as SDP
import math
BaseAlgorithm = swimming_DEM_algorithm.Algorithm
import h5py
class Algorithm(BaseAlgorithm):
def __init__(self, varying_parameters = Parameters("{}")):
... | true | true |
f761bc734aee69243ade79e7324f4536741f40d6 | 856 | py | Python | tests/test_tyco110.py | atollk/flake8-typing-collections | 5046007ac4efa357f888f7fcc00876c02d627605 | [
"MIT"
] | 2 | 2021-02-19T00:33:33.000Z | 2021-02-19T10:57:01.000Z | tests/test_tyco110.py | atollk/flake8-typing-collections | 5046007ac4efa357f888f7fcc00876c02d627605 | [
"MIT"
] | null | null | null | tests/test_tyco110.py | atollk/flake8-typing-collections | 5046007ac4efa357f888f7fcc00876c02d627605 | [
"MIT"
] | null | null | null | from tests.util import BaseTest
class Test_TYCO110(BaseTest):
@classmethod
def flags(cls):
return ["--tyco_generic_alt"]
def test_pass_1(self):
code = """
import typing
def foo(x: typing.MutableMapping):
...
"""
result = self.run_flake8(code)
... | 24.457143 | 54 | 0.547897 | from tests.util import BaseTest
class Test_TYCO110(BaseTest):
@classmethod
def flags(cls):
return ["--tyco_generic_alt"]
def test_pass_1(self):
code = """
import typing
def foo(x: typing.MutableMapping):
...
"""
result = self.run_flake8(code)
... | true | true |
f761bdda616dd24751917aa2b398df019582186f | 59,198 | py | Python | PortablePython/App/Lib/zipfile.py | thinkbase/PortableTrac | 9ea0210f6b88f135ef73f370b48127af0495b2d7 | [
"BSD-3-Clause"
] | 2 | 2015-08-06T04:19:21.000Z | 2020-04-29T23:52:10.000Z | PortablePython/App/Lib/zipfile.py | thinkbase/PortableTrac | 9ea0210f6b88f135ef73f370b48127af0495b2d7 | [
"BSD-3-Clause"
] | null | null | null | PortablePython/App/Lib/zipfile.py | thinkbase/PortableTrac | 9ea0210f6b88f135ef73f370b48127af0495b2d7 | [
"BSD-3-Clause"
] | null | null | null | """
Read and write ZIP files.
"""
import struct, os, time, sys, shutil
import binascii, cStringIO, stat
import io
import re
import string
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib = None
crc32 = binascii.crc32
__all__ = ["BadZipfi... | 38.920447 | 104 | 0.549715 | """
Read and write ZIP files.
"""
import struct, os, time, sys, shutil
import binascii, cStringIO, stat
import io
import re
import string
try:
import zlib crc32 = zlib.crc32
except ImportError:
zlib = None
crc32 = binascii.crc32
__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLA... | false | true |
f761bf03d773bb441d5dc3d1785a039ebc5ebdfb | 22,457 | py | Python | contrib/devtools/copyright_header.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | contrib/devtools/copyright_header.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | contrib/devtools/copyright_header.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Knotcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import re
import fnmatch
import sys
import subprocess
import datetime
import os
#######################... | 36.634584 | 92 | 0.601015 |
import re
import fnmatch
import sys
import subprocess
import datetime
import os
EXCLUDE = [
'src/secp256k1/include/secp256k1.h',
'src/secp256k1/include/secp256k1_ecdh.h',
'src/secp256k1/include/secp256k1_recovery.h',
'src/secp256k1/include/secp256k1_schnorr.h',
'src/secp256k1/src/java/org_kno... | true | true |
f761bf24bbb06202ab9bcb7a223bde3cd8325b96 | 20,083 | py | Python | src/xdesign/metrics/fullref.py | carterbox/xdesign | 2ab9f5835b518a7c5b564243d365c8ee4410156f | [
"BSD-3-Clause"
] | 18 | 2016-11-10T00:25:55.000Z | 2022-03-10T21:03:59.000Z | src/xdesign/metrics/fullref.py | carterbox/xdesign | 2ab9f5835b518a7c5b564243d365c8ee4410156f | [
"BSD-3-Clause"
] | 47 | 2016-08-17T18:33:10.000Z | 2022-01-14T20:59:13.000Z | src/xdesign/metrics/fullref.py | carterbox/xdesign | 2ab9f5835b518a7c5b564243d365c8ee4410156f | [
"BSD-3-Clause"
] | 21 | 2016-08-26T17:32:01.000Z | 2022-01-06T03:02:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Defines full-referene image quality metricsself.
These methods require a ground truth in order to make a quality assessment.
.. moduleauthor:: Daniel J Ching <carterbox@users.noreply.github.com>
"""
__author__ = "Daniel Ching"
__copyright__ = "Copyright (c) 2016, UChi... | 34.625862 | 80 | 0.615496 |
__author__ = "Daniel Ching"
__copyright__ = "Copyright (c) 2016, UChicago Argonne, LLC."
__docformat__ = 'restructuredtext en'
__all__ = [
'pcc',
'ImageQuality',
'ssim',
'msssim',
]
import warnings
import numpy as np
from scipy import ndimage
warnings.filterwarnings(
'ignore',
'From scipy 0\... | true | true |
f761c02172d568bb439e6830c4e36b0d94397822 | 742 | py | Python | setup.py | franciscoafonsoo/api.ai-translate | 835b5ffc8170f5b853f76a8377f5c44d3d5ffd58 | [
"MIT"
] | null | null | null | setup.py | franciscoafonsoo/api.ai-translate | 835b5ffc8170f5b853f76a8377f5c44d3d5ffd58 | [
"MIT"
] | null | null | null | setup.py | franciscoafonsoo/api.ai-translate | 835b5ffc8170f5b853f76a8377f5c44d3d5ffd58 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='api_ai_translate',
version='0.1.0',
description='Translate API.AI agents.',
long_description=readme,
author='Fra... | 27.481481 | 79 | 0.679245 |
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='api_ai_translate',
version='0.1.0',
description='Translate API.AI agents.',
long_description=readme,
author='Francisco Pires',
autho... | true | true |
f761c0625fde886ccb3836690609a3f99cad91f6 | 48,583 | py | Python | inventory/accounts/api/tests/test_accounts_api.py | cnobile2012/inventory | bc09ccdead39a5cd758088dbfe5c56dec43c7e29 | [
"MIT"
] | 10 | 2015-02-16T17:12:44.000Z | 2021-06-04T18:14:01.000Z | inventory/accounts/api/tests/test_accounts_api.py | cnobile2012/inventory | bc09ccdead39a5cd758088dbfe5c56dec43c7e29 | [
"MIT"
] | 1 | 2021-09-20T01:17:38.000Z | 2021-09-20T01:17:50.000Z | inventory/accounts/api/tests/test_accounts_api.py | cnobile2012/inventory | bc09ccdead39a5cd758088dbfe5c56dec43c7e29 | [
"MIT"
] | 5 | 2015-09-09T02:01:33.000Z | 2021-05-29T09:09:14.000Z | # -*- coding: utf-8 -*-
#
# inventory/accounts/api/tests/test_accounts_api.py
#
import base64
from django.contrib.auth import get_user_model
from django.utils.translation import gettext
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from inve... | 41.666381 | 79 | 0.622152 |
import base64
from django.contrib.auth import get_user_model
from django.utils.translation import gettext
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from inventory.common.api.tests.base_test import BaseTest
from inventory.projects.models ... | true | true |
f761c1c9b3c02a9061c67c09ee61ef9728f11fd4 | 8,889 | py | Python | apps/pretrained_compound/pretrain_gnns/pretrain_contextpred.py | WorldEditors/PaddleHelix | 7dbe947417538d7478fbab4438905b30c1d709c3 | [
"Apache-2.0"
] | null | null | null | apps/pretrained_compound/pretrain_gnns/pretrain_contextpred.py | WorldEditors/PaddleHelix | 7dbe947417538d7478fbab4438905b30c1d709c3 | [
"Apache-2.0"
] | null | null | null | apps/pretrained_compound/pretrain_gnns/pretrain_contextpred.py | WorldEditors/PaddleHelix | 7dbe947417538d7478fbab4438905b30c1d709c3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#-*-coding:utf-8-*-
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apa... | 40.404545 | 326 | 0.684666 |
import os
from os.path import join, exists
import sys
import json
import argparse
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.incubate.fleet.collective import fleet
paddle.enable_static()
from pahelix.model_zoo import PreGNNContextpredModel
from pahelix.datasets import load_zinc_... | true | true |
f761c21b7547fce2575e1e59aa35ec5ad791fb77 | 3,637 | py | Python | electrum_but/plugins/labels/qt.py | Butkoin/electrum-but | 254fd26fc09a5fd925669da0f8608a4afacd86da | [
"MIT"
] | null | null | null | electrum_but/plugins/labels/qt.py | Butkoin/electrum-but | 254fd26fc09a5fd925669da0f8608a4afacd86da | [
"MIT"
] | null | null | null | electrum_but/plugins/labels/qt.py | Butkoin/electrum-but | 254fd26fc09a5fd925669da0f8608a4afacd86da | [
"MIT"
] | null | null | null | from functools import partial
import traceback
import sys
from typing import TYPE_CHECKING
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout)
from electrum_but.plugin import hook
from electrum_but.i18n import _
from electrum_but.gui.qt.util import ThreadedButto... | 37.494845 | 102 | 0.653011 | from functools import partial
import traceback
import sys
from typing import TYPE_CHECKING
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout)
from electrum_but.plugin import hook
from electrum_but.i18n import _
from electrum_but.gui.qt.util import ThreadedButto... | true | true |
f761c4162e919a662217e7dc3c2d1962d81fa2d4 | 10,130 | py | Python | qa/rpc-tests/listtransactions.py | Avalon-Life/pura | 5728db7e553af9b050aa2e3b762a26d9cf917511 | [
"MIT"
] | 29 | 2017-09-18T13:38:27.000Z | 2019-08-06T13:37:17.000Z | qa/rpc-tests/listtransactions.py | Avalon-Life/pura | 5728db7e553af9b050aa2e3b762a26d9cf917511 | [
"MIT"
] | 13 | 2017-09-18T13:09:04.000Z | 2021-04-19T16:35:46.000Z | qa/rpc-tests/listtransactions.py | Avalon-Life/pura | 5728db7e553af9b050aa2e3b762a26d9cf917511 | [
"MIT"
] | 27 | 2017-09-24T11:47:35.000Z | 2021-12-28T08:15:26.000Z | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import BitcoinTestFramework
from ... | 50.148515 | 113 | 0.598421 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, COIN
from io import BytesIO
def txFromHex(hexstring):
tx = CTransaction()
f = BytesIO(hex_str_to_bytes(hexstring))
tx.deserialize(f)
return tx
class List... | true | true |
f761c4493616d6eefcdc53d5ce6397aac4d4cce5 | 3,967 | py | Python | tests/rest/client/v2_alpha/test_filter.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2021-03-29T22:47:31.000Z | 2021-03-29T22:47:31.000Z | tests/rest/client/v2_alpha/test_filter.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2019-04-04T05:08:04.000Z | 2019-04-04T05:08:04.000Z | tests/rest/client/v2_alpha/test_filter.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2021-09-27T14:45:52.000Z | 2021-09-27T14:45:52.000Z | # -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.106195 | 85 | 0.650618 |
from twisted.internet import defer
from synapse.api.errors import Codes
from synapse.rest.client.v2_alpha import filter
from tests import unittest
PATH_PREFIX = "/_matrix/client/v2_alpha"
class FilterTestCase(unittest.HomeserverTestCase):
user_id = "@apple:test"
hijack_auth = True
EXAMPLE_FILTER = {"... | true | true |
f761c4e4ac3fb225444596a8db851bfd6d2193ff | 18,212 | py | Python | share/models/ingest.py | aaxelb/SHARE | 896e4f0c0e119436c0aaea364ea19389e7099d59 | [
"Apache-2.0"
] | 1 | 2019-10-12T20:51:06.000Z | 2019-10-12T20:51:06.000Z | share/models/ingest.py | aaxelb/SHARE | 896e4f0c0e119436c0aaea364ea19389e7099d59 | [
"Apache-2.0"
] | 21 | 2020-06-01T13:59:32.000Z | 2021-08-01T06:20:29.000Z | share/models/ingest.py | aaxelb/SHARE | 896e4f0c0e119436c0aaea364ea19389e7099d59 | [
"Apache-2.0"
] | null | null | null | import contextlib
import datetime
import logging
from typing import Optional
from django.contrib.postgres.fields import JSONField
from django.core import validators
from django.core.files.base import ContentFile
from django.core.files.storage import Storage
from django.db import DEFAULT_DB_ALIAS
from django.db import ... | 36.941176 | 141 | 0.619262 | import contextlib
import datetime
import logging
from typing import Optional
from django.contrib.postgres.fields import JSONField
from django.core import validators
from django.core.files.base import ContentFile
from django.core.files.storage import Storage
from django.db import DEFAULT_DB_ALIAS
from django.db import ... | true | true |
f761c55cc82555aeabb6c9c3fe1f6f02b9caff4e | 2,915 | py | Python | pydfs_lineup_optimizer/sites/fanduel/single_game/settings.py | BenikaH/pydfs-lineup-optimizer | 20dd39dfb738b8eb114c012a1d455c201da60400 | [
"MIT"
] | 1 | 2021-02-17T00:38:19.000Z | 2021-02-17T00:38:19.000Z | pydfs_lineup_optimizer/sites/fanduel/single_game/settings.py | BenikaH/pydfs-lineup-optimizer | 20dd39dfb738b8eb114c012a1d455c201da60400 | [
"MIT"
] | null | null | null | pydfs_lineup_optimizer/sites/fanduel/single_game/settings.py | BenikaH/pydfs-lineup-optimizer | 20dd39dfb738b8eb114c012a1d455c201da60400 | [
"MIT"
] | null | null | null | from typing import List, Type
from pydfs_lineup_optimizer.settings import BaseSettings, LineupPosition
from pydfs_lineup_optimizer.constants import Sport, Site, PlayerRank
from pydfs_lineup_optimizer.sites.sites_registry import SitesRegistry
from pydfs_lineup_optimizer.rules import OptimizerRule, FanduelSingleGameMVPRu... | 50.258621 | 111 | 0.701201 | from typing import List, Type
from pydfs_lineup_optimizer.settings import BaseSettings, LineupPosition
from pydfs_lineup_optimizer.constants import Sport, Site, PlayerRank
from pydfs_lineup_optimizer.sites.sites_registry import SitesRegistry
from pydfs_lineup_optimizer.rules import OptimizerRule, FanduelSingleGameMVPRu... | true | true |
f761c571e9d9e201c74ef55eb0e5364c9965c0fe | 2,227 | py | Python | ivy/functional/backends/mxnet/device.py | RitujaPawas/ivy | 595788507aca609e868cb3d17edd815463af28e4 | [
"Apache-2.0"
] | 681 | 2022-01-18T19:08:56.000Z | 2022-03-31T22:48:37.000Z | ivy/functional/backends/mxnet/device.py | RitujaPawas/ivy | 595788507aca609e868cb3d17edd815463af28e4 | [
"Apache-2.0"
] | 637 | 2022-01-19T07:40:28.000Z | 2022-03-31T19:06:47.000Z | ivy/functional/backends/mxnet/device.py | RitujaPawas/ivy | 595788507aca609e868cb3d17edd815463af28e4 | [
"Apache-2.0"
] | 501 | 2022-01-23T14:48:35.000Z | 2022-03-31T04:09:38.000Z | """Collection of MXNet general functions, wrapped to fit Ivy syntax and signature."""
# global
import os
_round = round
import mxnet as mx
from typing import Union
from mxnet import profiler as _profiler
# local
import ivy
from ivy.functional.ivy.device import Profiler as BaseProfiler
def dev(
x: mx.nd.NDArray... | 22.494949 | 85 | 0.638078 |
import os
_round = round
import mxnet as mx
from typing import Union
from mxnet import profiler as _profiler
import ivy
from ivy.functional.ivy.device import Profiler as BaseProfiler
def dev(
x: mx.nd.NDArray, as_native: bool = False
) -> Union[ivy.Device, mx.context.Context]:
dv = x.context
if as_nati... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.